gemi 0.42.2 → 0.43.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.
- package/dist/app/index.js +1 -1
- package/dist/bin/gemi.js +392 -70
- package/dist/bin/gemi.js.map +15 -12
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-522q81af.js → chunk-20376aj6.js} +3 -3
- package/dist/{chunk-522q81af.js.map → chunk-20376aj6.js.map} +1 -1
- package/dist/{chunk-wa84ybnt.js → chunk-25d4feyv.js} +22 -22
- package/dist/{chunk-wa84ybnt.js.map → chunk-25d4feyv.js.map} +8 -6
- package/dist/{chunk-qyn10pv7.js → chunk-32ct42e2.js} +1 -1
- package/dist/{chunk-cx38xsyf.js → chunk-3xqyzegw.js} +2 -2
- package/dist/{chunk-cx38xsyf.js.map → chunk-3xqyzegw.js.map} +1 -1
- package/dist/{chunk-358x9aca.js → chunk-5kx4hw7c.js} +2 -2
- package/dist/{chunk-358x9aca.js.map → chunk-5kx4hw7c.js.map} +1 -1
- package/dist/{chunk-cwq1vdcb.js → chunk-6gtmkbh0.js} +2 -2
- package/dist/{chunk-cwq1vdcb.js.map → chunk-6gtmkbh0.js.map} +1 -1
- package/dist/{chunk-z9vdcpqr.js → chunk-87keq057.js} +2 -2
- package/dist/{chunk-z9vdcpqr.js.map → chunk-87keq057.js.map} +1 -1
- package/dist/{chunk-ayjtdck4.js → chunk-8b461343.js} +2 -2
- package/dist/{chunk-ayjtdck4.js.map → chunk-8b461343.js.map} +1 -1
- package/dist/{chunk-0pjn1a5d.js → chunk-9cw39se2.js} +2 -2
- package/dist/{chunk-0pjn1a5d.js.map → chunk-9cw39se2.js.map} +1 -1
- package/dist/{chunk-b3qebxqh.js → chunk-9r2k5ykk.js} +2 -2
- package/dist/{chunk-b3qebxqh.js.map → chunk-9r2k5ykk.js.map} +1 -1
- package/dist/{chunk-8cqkdzyh.js → chunk-9s3te5pa.js} +3 -3
- package/dist/{chunk-8cqkdzyh.js.map → chunk-9s3te5pa.js.map} +1 -1
- package/dist/{chunk-9byxbqnn.js → chunk-bsfbba90.js} +2 -2
- package/dist/{chunk-9byxbqnn.js.map → chunk-bsfbba90.js.map} +1 -1
- package/dist/{chunk-8mgsjrcc.js → chunk-cbvq4keh.js} +2 -2
- package/dist/{chunk-8mgsjrcc.js.map → chunk-cbvq4keh.js.map} +1 -1
- package/dist/{chunk-xpk460d1.js → chunk-drbqadx7.js} +1 -1
- package/dist/{chunk-akbepc3f.js → chunk-errq965d.js} +3 -3
- package/dist/{chunk-akbepc3f.js.map → chunk-errq965d.js.map} +1 -1
- package/dist/chunk-fk9xtngd.js +4 -0
- package/dist/chunk-fk9xtngd.js.map +33 -0
- package/dist/{chunk-ratbccpg.js → chunk-fvtfwssb.js} +2 -2
- package/dist/{chunk-ratbccpg.js.map → chunk-fvtfwssb.js.map} +1 -1
- package/dist/{chunk-shpca068.js → chunk-gv4v6qsg.js} +2 -2
- package/dist/{chunk-shpca068.js.map → chunk-gv4v6qsg.js.map} +1 -1
- package/dist/chunk-h4rd3cwd.js +6 -0
- package/dist/{chunk-m1t1f3s5.js.map → chunk-h4rd3cwd.js.map} +2 -2
- package/dist/{chunk-pygcsw1f.js → chunk-h509r9s3.js} +2 -2
- package/dist/{chunk-pygcsw1f.js.map → chunk-h509r9s3.js.map} +1 -1
- package/dist/{chunk-54wqarj8.js → chunk-j3x1fffh.js} +1 -1
- package/dist/{chunk-pfaq2mer.js → chunk-jvcbdxtq.js} +2 -2
- package/dist/{chunk-pfaq2mer.js.map → chunk-jvcbdxtq.js.map} +1 -1
- package/dist/{chunk-1kmbs8cd.js → chunk-kkdtznm5.js} +2 -2
- package/dist/{chunk-1kmbs8cd.js.map → chunk-kkdtznm5.js.map} +1 -1
- package/dist/{chunk-qeq8hv3t.js → chunk-knrx23te.js} +2 -2
- package/dist/{chunk-qeq8hv3t.js.map → chunk-knrx23te.js.map} +1 -1
- package/dist/{chunk-gsvzrj5r.js → chunk-m359awjw.js} +2 -2
- package/dist/{chunk-gsvzrj5r.js.map → chunk-m359awjw.js.map} +1 -1
- package/dist/{chunk-rrwtgt86.js → chunk-mfwbdztp.js} +2 -2
- package/dist/{chunk-rrwtgt86.js.map → chunk-mfwbdztp.js.map} +1 -1
- package/dist/{chunk-syaxsp9y.js → chunk-ngnrytfh.js} +2 -2
- package/dist/{chunk-syaxsp9y.js.map → chunk-ngnrytfh.js.map} +1 -1
- package/dist/{chunk-pr3pvtmh.js → chunk-nhyc69tx.js} +2 -2
- package/dist/{chunk-pr3pvtmh.js.map → chunk-nhyc69tx.js.map} +1 -1
- package/dist/{chunk-pxcv9ccp.js → chunk-nx8t65g3.js} +2 -2
- package/dist/{chunk-pxcv9ccp.js.map → chunk-nx8t65g3.js.map} +1 -1
- package/dist/chunk-q8haepmm.js +79 -0
- package/dist/{chunk-pjgfvdr6.js.map → chunk-q8haepmm.js.map} +5 -5
- package/dist/{chunk-hzw2y2rz.js → chunk-qy3aczt9.js} +2 -2
- package/dist/{chunk-hzw2y2rz.js.map → chunk-qy3aczt9.js.map} +1 -1
- package/dist/{chunk-zaa3yt2w.js → chunk-s49529x2.js} +2 -2
- package/dist/{chunk-zaa3yt2w.js.map → chunk-s49529x2.js.map} +1 -1
- package/dist/{chunk-qzemjynx.js → chunk-sdj112nj.js} +2 -2
- package/dist/{chunk-qzemjynx.js.map → chunk-sdj112nj.js.map} +1 -1
- package/dist/{chunk-bfnh3gwv.js → chunk-sdx8r2qb.js} +2 -2
- package/dist/{chunk-bfnh3gwv.js.map → chunk-sdx8r2qb.js.map} +1 -1
- package/dist/chunk-tatd75jn.js +5 -0
- package/dist/{chunk-tb8yy4rf.js.map → chunk-tatd75jn.js.map} +1 -1
- package/dist/{chunk-sbmg0hfr.js → chunk-ty3q916e.js} +3 -3
- package/dist/{chunk-sbmg0hfr.js.map → chunk-ty3q916e.js.map} +1 -1
- package/dist/{chunk-22pr1w8v.js → chunk-w7czqgx2.js} +2 -2
- package/dist/{chunk-22pr1w8v.js.map → chunk-w7czqgx2.js.map} +1 -1
- package/dist/chunk-whj1a3vr.js +5 -0
- package/dist/chunk-whj1a3vr.js.map +15 -0
- package/dist/{chunk-n78kxce1.js → chunk-wrp2v923.js} +2 -2
- package/dist/{chunk-n78kxce1.js.map → chunk-wrp2v923.js.map} +1 -1
- package/dist/{chunk-x3vy6dbw.js → chunk-x2cq1qp8.js} +2 -2
- package/dist/{chunk-x3vy6dbw.js.map → chunk-x2cq1qp8.js.map} +1 -1
- package/dist/{chunk-v3agzap3.js → chunk-yrtvjmrj.js} +1 -1
- package/dist/{chunk-q0y425d3.js → chunk-ytr22fm4.js} +2 -2
- package/dist/{chunk-q0y425d3.js.map → chunk-ytr22fm4.js.map} +1 -1
- package/dist/{chunk-81yxskss.js → chunk-ywhazhqt.js} +2 -2
- package/dist/{chunk-81yxskss.js.map → chunk-ywhazhqt.js.map} +1 -1
- package/dist/config/index.js +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/FileStorage.d.ts +14 -1
- package/dist/facades/FileStorage.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/http/ApiRouter.d.ts +41 -1
- package/dist/http/ApiRouter.d.ts.map +1 -1
- package/dist/http/HttpRequest.d.ts +7 -0
- package/dist/http/HttpRequest.d.ts.map +1 -1
- package/dist/http/ViewRouter.d.ts.map +1 -1
- package/dist/http/contentDisposition.d.ts +9 -0
- package/dist/http/contentDisposition.d.ts.map +1 -0
- package/dist/http/createStreamResponse.d.ts +38 -0
- package/dist/http/createStreamResponse.d.ts.map +1 -0
- package/dist/http/errors.d.ts +16 -0
- package/dist/http/errors.d.ts.map +1 -1
- package/dist/http/index.d.ts +3 -1
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/http/range.d.ts +63 -0
- package/dist/http/range.d.ts.map +1 -0
- package/dist/http/requestContext.d.ts +11 -0
- package/dist/http/requestContext.d.ts.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/file-storage/drivers/AzureBlobDriver.d.ts +78 -0
- package/dist/services/file-storage/drivers/AzureBlobDriver.d.ts.map +1 -0
- package/dist/services/file-storage/drivers/FileStorageDriver.d.ts +17 -1
- package/dist/services/file-storage/drivers/FileStorageDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/FileSystemDriver.d.ts +3 -1
- package/dist/services/file-storage/drivers/FileSystemDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/S3Driver.d.ts +3 -1
- package/dist/services/file-storage/drivers/S3Driver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/types.d.ts +45 -0
- package/dist/services/file-storage/drivers/types.d.ts.map +1 -1
- package/dist/services/index.d.ts +4 -1
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/router/ApiRouterServiceContainer.d.ts +5 -0
- package/dist/services/router/ApiRouterServiceContainer.d.ts.map +1 -1
- package/dist/services/router/createFlatApiRoutes.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/chunk-m1t1f3s5.js +0 -6
- package/dist/chunk-n1xpxhm0.js +0 -5
- package/dist/chunk-n1xpxhm0.js.map +0 -13
- package/dist/chunk-pjgfvdr6.js +0 -79
- package/dist/chunk-tb8yy4rf.js +0 -5
- package/dist/chunk-yeqwzeq7.js +0 -4
- package/dist/chunk-yeqwzeq7.js.map +0 -32
- /package/dist/{chunk-qyn10pv7.js.map → chunk-32ct42e2.js.map} +0 -0
- /package/dist/{chunk-xpk460d1.js.map → chunk-drbqadx7.js.map} +0 -0
- /package/dist/{chunk-54wqarj8.js.map → chunk-j3x1fffh.js.map} +0 -0
- /package/dist/{chunk-v3agzap3.js.map → chunk-yrtvjmrj.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Na as
|
|
3
|
-
Headers: ${JSON.stringify(B)}`);this.code=u,this.body=D,this.headers={},B.forEach((A,w)=>{this.headers[w]=A})}}l6.ApiException=j6});var g=$((U2)=>{var Su=U2&&U2.__awaiter||function(u,D,B,A){function w(F){return F instanceof B?F:new B(function(N){N(F)})}return new(B||(B=Promise))(function(F,N){function G(Q){try{z(A.next(Q))}catch(Z){N(Z)}}function v(Q){try{z(A.throw(Q))}catch(Z){N(Z)}}function z(Q){Q.done?F(Q.value):w(Q.value).then(G,v)}z((A=A.apply(u,D||[])).next())})};Object.defineProperty(U2,"__esModule",{value:!0});U2.SvixRequest=U2.HttpMethod=U2.LIB_VERSION=void 0;var p3=n3();U2.LIB_VERSION="1.92.2";var Mx=`svix-libs/${U2.LIB_VERSION}/javascript`,Lx;(function(u){u.GET="GET",u.HEAD="HEAD",u.POST="POST",u.PUT="PUT",u.DELETE="DELETE",u.CONNECT="CONNECT",u.OPTIONS="OPTIONS",u.TRACE="TRACE",u.PATCH="PATCH"})(Lx=U2.HttpMethod||(U2.HttpMethod={}));class r6{constructor(u,D){this.method=u,this.path=D,this.queryParams={},this.headerParams={}}setPathParam(u,D){let B=this.path.replace(`{${u}}`,encodeURIComponent(D));if(this.path===B)throw Error(`path parameter ${u} not found`);this.path=B}setQueryParams(u){for(let[D,B]of Object.entries(u))this.setQueryParam(D,B)}setQueryParam(u,D){if(D===void 0||D===null)return;if(typeof D==="string")this.queryParams[u]=D;else if(typeof D==="boolean"||typeof D==="number")this.queryParams[u]=D.toString();else if(D instanceof Date)this.queryParams[u]=D.toISOString();else if(Array.isArray(D)){if(D.length>0)this.queryParams[u]=D.join(",")}else{let B=D;throw Error(`query parameter ${u} has unsupported type`)}}setHeaderParam(u,D){if(D===void 0)return;this.headerParams[u]=D}setBody(u){this.body=JSON.stringify(u)}send(u,D){return Su(this,void 0,void 0,function*(){let B=yield this.sendInner(u);if(B.status===204)return null;let A=yield B.text();return D(JSON.parse(A))})}sendNoResponseBody(u){return Su(this,void 0,void 0,function*(){yield this.sendInner(u)})}sendInner(u){var D,B;return Su(this,void 0,void 0,function*(){let A=new URL(u.baseUrl+this.path);for(let[G,v]of Object.entries(this.queryParams))A.searchParams.set(G,v);if(this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST")this.headerParams["idempotency-key"]=`auto_${crypto.randomUUID()}`;let w=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);if(this.body!=null)this.headerParams["content-type"]="application/json";let F="credentials"in Request.prototype,N=yield i6(A,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${u.token}`,"user-agent":Mx,"svix-req-id":w.toString()},this.headerParams),credentials:F?"same-origin":void 0,signal:u.timeout!==void 0?AbortSignal.timeout(u.timeout):void 0},u.retryScheduleInMs,(D=u.retryScheduleInMs)===null||D===void 0?void 0:D[0],((B=u.retryScheduleInMs)===null||B===void 0?void 0:B.length)||u.numRetries,u.fetch);return Ex(N)})}}U2.SvixRequest=r6;function Ex(u){return Su(this,void 0,void 0,function*(){if(u.status<300)return u;let D=yield u.text();if(u.status===422)throw new p3.ApiException(u.status,JSON.parse(D),u.headers);if(u.status>=400&&u.status<=499)throw new p3.ApiException(u.status,JSON.parse(D),u.headers);throw new p3.ApiException(u.status,D,u.headers)})}function i6(u,D,B,A=50,w=2,F=fetch,N=1){return Su(this,void 0,void 0,function*(){let G=(v)=>new Promise((z)=>setTimeout(z,v));try{let v=yield F(u,D);if(w<=0||v.status<500)return v}catch(v){if(w<=0)throw v}return yield G(A),D.headers["svix-retry-count"]=N.toString(),A=(B===null||B===void 0?void 0:B[N])||A*2,yield i6(u,D,B,A,--w,F,++N)})}});var s6=$((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});p6.Application=void 0;var a3=i1(),Ru=i3(),Ox=m6(),Cx=b6(),Z2=g();class n6{constructor(u){this.requestCtx=u}list(u){let D=new Z2.SvixRequest(Z2.HttpMethod.GET,"/api/v1/app");return D.setQueryParams({exclude_apps_with_no_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithSvixPlayEndpoints,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,Cx.ListResponseApplicationOutSerializer._fromJsonObject)}create(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.POST,"/api/v1/app");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(a3.ApplicationInSerializer._toJsonObject(u)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}getOrCreate(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.POST,"/api/v1/app");return B.setQueryParam("get_if_exists",!0),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(a3.ApplicationInSerializer._toJsonObject(u)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}get(u){let D=new Z2.SvixRequest(Z2.HttpMethod.GET,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}update(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.PUT,"/api/v1/app/{app_id}");return B.setPathParam("app_id",u),B.setBody(a3.ApplicationInSerializer._toJsonObject(D)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}delete(u){let D=new Z2.SvixRequest(Z2.HttpMethod.DELETE,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new Z2.SvixRequest(Z2.HttpMethod.PATCH,"/api/v1/app/{app_id}");return B.setPathParam("app_id",u),B.setBody(Ox.ApplicationPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,Ru.ApplicationOutSerializer._fromJsonObject)}}p6.Application=n6});var e6=$((t6)=>{Object.defineProperty(t6,"__esModule",{value:!0});t6.ApiTokenOutSerializer=void 0;t6.ApiTokenOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),expiresAt:u.expiresAt?new Date(u.expiresAt):null,id:u.id,name:u.name,scopes:u.scopes,token:u.token}},_toJsonObject(u){return{createdAt:u.createdAt,expiresAt:u.expiresAt,id:u.id,name:u.name,scopes:u.scopes,token:u.token}}}});var s3=$((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.AppPortalCapabilitySerializer=DA.AppPortalCapability=void 0;var Px;(function(u){u.ViewBase="ViewBase",u.ViewEndpointSecret="ViewEndpointSecret",u.ManageEndpointSecret="ManageEndpointSecret",u.ManageTransformations="ManageTransformations",u.CreateAttempts="CreateAttempts",u.ManageEndpoint="ManageEndpoint"})(Px=DA.AppPortalCapability||(DA.AppPortalCapability={}));DA.AppPortalCapabilitySerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var GA=$((FA)=>{Object.defineProperty(FA,"__esModule",{value:!0});FA.AppPortalAccessInSerializer=void 0;var AA=s3(),wA=i1();FA.AppPortalAccessInSerializer={_fromJsonObject(u){var D;return{application:u.application!=null?wA.ApplicationInSerializer._fromJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((B)=>AA.AppPortalCapabilitySerializer._fromJsonObject(B)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}},_toJsonObject(u){var D;return{application:u.application!=null?wA.ApplicationInSerializer._toJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((B)=>AA.AppPortalCapabilitySerializer._toJsonObject(B)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}}}});var zA=$(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.AppPortalAccessOutSerializer=void 0;$A.AppPortalAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var QA=$((ZA)=>{Object.defineProperty(ZA,"__esModule",{value:!0});ZA.ApplicationTokenExpireInSerializer=void 0;ZA.ApplicationTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var YA=$((WA)=>{Object.defineProperty(WA,"__esModule",{value:!0});WA.RotatePollerTokenInSerializer=void 0;WA.RotatePollerTokenInSerializer={_fromJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}},_toJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}}}});var xA=$((hA)=>{Object.defineProperty(hA,"__esModule",{value:!0});hA.StreamPortalAccessInSerializer=void 0;hA.StreamPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}},_toJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}}}});var HA=$((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.StreamTokenExpireInSerializer=void 0;SA.StreamTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var t3=$((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.DashboardAccessOutSerializer=void 0;UA.DashboardAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var PA=$((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});OA.Authentication=void 0;var MA=e6(),kx=GA(),LA=zA(),yx=QA(),Vx=YA(),Tx=xA(),Ix=HA(),qx=t3(),u2=g();class EA{constructor(u){this.requestCtx=u}appPortalAccess(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(kx.AppPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,LA.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(yx.ApplicationTokenExpireInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}dashboardAccess(u,D){let B=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,qx.DashboardAccessOutSerializer._fromJsonObject)}logout(u){let D=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamLogout(u){let D=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream-logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamPortalAccess(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(Tx.StreamPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,LA.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(Ix.StreamTokenExpireInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(u,D){let B=new u2.SvixRequest(u2.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,MA.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(u,D,B,A){let w=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return w.setPathParam("stream_id",u),w.setPathParam("sink_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(Vx.RotatePollerTokenInSerializer._toJsonObject(B)),w.send(this.requestCtx,MA.ApiTokenOutSerializer._fromJsonObject)}}OA.Authentication=EA});var a2=$((yA)=>{Object.defineProperty(yA,"__esModule",{value:!0});yA.BackgroundTaskStatusSerializer=yA.BackgroundTaskStatus=void 0;var mx;(function(u){u.Running="running",u.Finished="finished",u.Failed="failed"})(mx=yA.BackgroundTaskStatus||(yA.BackgroundTaskStatus={}));yA.BackgroundTaskStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var s2=$((IA)=>{Object.defineProperty(IA,"__esModule",{value:!0});IA.BackgroundTaskTypeSerializer=IA.BackgroundTaskType=void 0;var gx;(function(u){u.EndpointReplay="endpoint.replay",u.EndpointRecover="endpoint.recover",u.ApplicationStats="application.stats",u.MessageBroadcast="message.broadcast",u.SdkGenerate="sdk.generate",u.EventTypeAggregate="event-type.aggregate",u.ApplicationPurgeContent="application.purge_content",u.EndpointBulkReplay="endpoint.bulk-replay"})(gx=IA.BackgroundTaskType||(IA.BackgroundTaskType={}));IA.BackgroundTaskTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var o3=$((_A)=>{Object.defineProperty(_A,"__esModule",{value:!0});_A.BackgroundTaskOutSerializer=void 0;var mA=a2(),gA=s2();_A.BackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data,id:u.id,status:mA.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:gA.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{data:u.data,id:u.id,status:mA.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:gA.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var dA=$((jA)=>{Object.defineProperty(jA,"__esModule",{value:!0});jA.ListResponseBackgroundTaskOutSerializer=void 0;var bA=o3();jA.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>bA.BackgroundTaskOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>bA.BackgroundTaskOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var pA=$((iA)=>{Object.defineProperty(iA,"__esModule",{value:!0});iA.BackgroundTask=void 0;var _x=o3(),fx=dA(),n1=g();class rA{constructor(u){this.requestCtx=u}list(u){let D=new n1.SvixRequest(n1.HttpMethod.GET,"/api/v1/background-task");return D.setQueryParams({status:u===null||u===void 0?void 0:u.status,task:u===null||u===void 0?void 0:u.task,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,fx.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(u){return this.list(u)}get(u){let D=new n1.SvixRequest(n1.HttpMethod.GET,"/api/v1/background-task/{task_id}");return D.setPathParam("task_id",u),D.send(this.requestCtx,_x.BackgroundTaskOutSerializer._fromJsonObject)}}iA.BackgroundTask=rA});var k0=$((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.ConnectorKindSerializer=sA.ConnectorKind=void 0;var bx;(function(u){u.Custom="Custom",u.AgenticCommerceProtocol="AgenticCommerceProtocol",u.CloseCrm="CloseCRM",u.CustomerIo="CustomerIO",u.Discord="Discord",u.Hubspot="Hubspot",u.Inngest="Inngest",u.Loops="Loops",u.Otel="Otel",u.Resend="Resend",u.Salesforce="Salesforce",u.Segment="Segment",u.Sendgrid="Sendgrid",u.Slack="Slack",u.Teams="Teams",u.TriggerDev="TriggerDev",u.Windmill="Windmill",u.Zapier="Zapier"})(bx=sA.ConnectorKind||(sA.ConnectorKind={}));sA.ConnectorKindSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var p1=$((eA)=>{Object.defineProperty(eA,"__esModule",{value:!0});eA.ConnectorProductSerializer=eA.ConnectorProduct=void 0;var jx;(function(u){u.Dispatch="Dispatch",u.Stream="Stream"})(jx=eA.ConnectorProduct||(eA.ConnectorProduct={}));eA.ConnectorProductSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var e3=$((Aw)=>{Object.defineProperty(Aw,"__esModule",{value:!0});Aw.ConnectorInSerializer=void 0;var Dw=k0(),Bw=p1();Aw.ConnectorInSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Dw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?Bw.ConnectorProductSerializer._fromJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Dw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?Bw.ConnectorProductSerializer._toJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}}}});var a1=$((Gw)=>{Object.defineProperty(Gw,"__esModule",{value:!0});Gw.ConnectorOutSerializer=void 0;var Fw=k0(),Nw=p1();Gw.ConnectorOutSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:new Date(u.createdAt),description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:Fw.ConnectorKindSerializer._fromJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:Nw.ConnectorProductSerializer._fromJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:new Date(u.transformationUpdatedAt),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:u.createdAt,description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:Fw.ConnectorKindSerializer._toJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:Nw.ConnectorProductSerializer._toJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:u.transformationUpdatedAt,uid:u.uid,updatedAt:u.updatedAt}}}});var Jw=$((zw)=>{Object.defineProperty(zw,"__esModule",{value:!0});zw.ConnectorPatchSerializer=void 0;var vw=k0();zw.ConnectorPatchSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?vw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?vw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var Yw=$((Ww)=>{Object.defineProperty(Ww,"__esModule",{value:!0});Ww.ConnectorUpdateSerializer=void 0;var Qw=k0();Ww.ConnectorUpdateSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Qw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Qw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var Sw=$((Kw)=>{Object.defineProperty(Kw,"__esModule",{value:!0});Kw.ListResponseConnectorOutSerializer=void 0;var hw=a1();Kw.ListResponseConnectorOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>hw.ConnectorOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>hw.ConnectorOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var cw=$((Hw)=>{Object.defineProperty(Hw,"__esModule",{value:!0});Hw.Connector=void 0;var lx=e3(),s1=a1(),dx=Jw(),rx=Yw(),ix=Sw(),c2=g();class Rw{constructor(u){this.requestCtx=u}list(u){let D=new c2.SvixRequest(c2.HttpMethod.GET,"/api/v1/connector");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,product_type:u===null||u===void 0?void 0:u.productType}),D.send(this.requestCtx,ix.ListResponseConnectorOutSerializer._fromJsonObject)}create(u,D){let B=new c2.SvixRequest(c2.HttpMethod.POST,"/api/v1/connector");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(lx.ConnectorInSerializer._toJsonObject(u)),B.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}get(u){let D=new c2.SvixRequest(c2.HttpMethod.GET,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}update(u,D){let B=new c2.SvixRequest(c2.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return B.setPathParam("connector_id",u),B.setBody(rx.ConnectorUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}delete(u){let D=new c2.SvixRequest(c2.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new c2.SvixRequest(c2.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return B.setPathParam("connector_id",u),B.setBody(dx.ConnectorPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,s1.ConnectorOutSerializer._fromJsonObject)}}Hw.Connector=Rw});var y0=$((Lw)=>{Object.defineProperty(Lw,"__esModule",{value:!0});Lw.MessageStatusSerializer=Lw.MessageStatus=void 0;var nx;(function(u){u[u.Success=0]="Success",u[u.Pending=1]="Pending",u[u.Fail=2]="Fail",u[u.Sending=3]="Sending"})(nx=Lw.MessageStatus||(Lw.MessageStatus={}));Lw.MessageStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var u8=$((Cw)=>{Object.defineProperty(Cw,"__esModule",{value:!0});Cw.StatusCodeClassSerializer=Cw.StatusCodeClass=void 0;var px;(function(u){u[u.CodeNone=0]="CodeNone",u[u.Code1xx=100]="Code1xx",u[u.Code2xx=200]="Code2xx",u[u.Code3xx=300]="Code3xx",u[u.Code4xx=400]="Code4xx",u[u.Code5xx=500]="Code5xx"})(px=Cw.StatusCodeClass||(Cw.StatusCodeClass={}));Cw.StatusCodeClassSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var Iw=$((Vw)=>{Object.defineProperty(Vw,"__esModule",{value:!0});Vw.BulkReplayInSerializer=void 0;var kw=y0(),yw=u8();Vw.BulkReplayInSerializer={_fromJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:new Date(u.since),status:u.status!=null?kw.MessageStatusSerializer._fromJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?yw.StatusCodeClassSerializer._fromJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until?new Date(u.until):null}},_toJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:u.since,status:u.status!=null?kw.MessageStatusSerializer._toJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?yw.StatusCodeClassSerializer._toJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until}}}});var gw=$((qw)=>{Object.defineProperty(qw,"__esModule",{value:!0});qw.EndpointHeadersInSerializer=void 0;qw.EndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var D8=$((_w)=>{Object.defineProperty(_w,"__esModule",{value:!0});_w.EndpointHeadersOutSerializer=void 0;_w.EndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var lw=$((bw)=>{Object.defineProperty(bw,"__esModule",{value:!0});bw.EndpointHeadersPatchInSerializer=void 0;bw.EndpointHeadersPatchInSerializer={_fromJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}},_toJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}}}});var iw=$((dw)=>{Object.defineProperty(dw,"__esModule",{value:!0});dw.EndpointInSerializer=void 0;dw.EndpointInSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var B8=$((nw)=>{Object.defineProperty(nw,"__esModule",{value:!0});nw.EndpointOutSerializer=void 0;nw.EndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var tw=$((aw)=>{Object.defineProperty(aw,"__esModule",{value:!0});aw.EndpointPatchSerializer=void 0;aw.EndpointPatchSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var uF=$((ow)=>{Object.defineProperty(ow,"__esModule",{value:!0});ow.EndpointSecretOutSerializer=void 0;ow.EndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var A8=$((DF)=>{Object.defineProperty(DF,"__esModule",{value:!0});DF.EndpointSecretRotateInSerializer=void 0;DF.EndpointSecretRotateInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var FF=$((AF)=>{Object.defineProperty(AF,"__esModule",{value:!0});AF.EndpointStatsSerializer=void 0;AF.EndpointStatsSerializer={_fromJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}},_toJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}}}});var $F=$((NF)=>{Object.defineProperty(NF,"__esModule",{value:!0});NF.EndpointTransformationInSerializer=void 0;NF.EndpointTransformationInSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var ZF=$((vF)=>{Object.defineProperty(vF,"__esModule",{value:!0});vF.EndpointTransformationOutSerializer=void 0;vF.EndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt?new Date(u.updatedAt):null}},_toJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt}}}});var WF=$((JF)=>{Object.defineProperty(JF,"__esModule",{value:!0});JF.EndpointTransformationPatchSerializer=void 0;JF.EndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var hF=$((XF)=>{Object.defineProperty(XF,"__esModule",{value:!0});XF.EndpointUpdateSerializer=void 0;XF.EndpointUpdateSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var SF=$((KF)=>{Object.defineProperty(KF,"__esModule",{value:!0});KF.EventExampleInSerializer=void 0;KF.EventExampleInSerializer={_fromJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}},_toJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}}}});var cF=$((HF)=>{Object.defineProperty(HF,"__esModule",{value:!0});HF.ListResponseEndpointOutSerializer=void 0;var RF=B8();HF.ListResponseEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>RF.EndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>RF.EndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Hu=$((MF)=>{Object.defineProperty(MF,"__esModule",{value:!0});MF.MessageOutSerializer=void 0;MF.MessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var CF=$((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});EF.RecoverInSerializer=void 0;EF.RecoverInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var TF=$((yF)=>{Object.defineProperty(yF,"__esModule",{value:!0});yF.RecoverOutSerializer=void 0;var PF=a2(),kF=s2();yF.RecoverOutSerializer={_fromJsonObject(u){return{id:u.id,status:PF.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:kF.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:PF.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:kF.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var mF=$((IF)=>{Object.defineProperty(IF,"__esModule",{value:!0});IF.ReplayInSerializer=void 0;IF.ReplayInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var jF=$((fF)=>{Object.defineProperty(fF,"__esModule",{value:!0});fF.ReplayOutSerializer=void 0;var gF=a2(),_F=s2();fF.ReplayOutSerializer={_fromJsonObject(u){return{id:u.id,status:gF.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:_F.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:gF.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:_F.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var nF=$((rF)=>{Object.defineProperty(rF,"__esModule",{value:!0});rF.Endpoint=void 0;var ax=Iw(),sx=gw(),tx=D8(),ox=lw(),ex=iw(),t1=B8(),uS=tw(),DS=uF(),BS=A8(),AS=FF(),wS=$F(),FS=ZF(),NS=WF(),GS=hF(),$S=SF(),vS=cF(),zS=Hu(),ZS=CF(),JS=TF(),QS=mF(),lF=jF(),H=g();class dF{constructor(u){this.requestCtx=u}list(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,vS.ListResponseEndpointOutSerializer._fromJsonObject)}create(u,D,B){let A=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(ex.EndpointInSerializer._toJsonObject(D)),A.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}get(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}update(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(GS.EndpointUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}delete(u,D){let B=new H.SvixRequest(H.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.sendNoResponseBody(this.requestCtx)}patch(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(uS.EndpointPatchSerializer._toJsonObject(B)),A.send(this.requestCtx,t1.EndpointOutSerializer._fromJsonObject)}bulkReplay(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(ax.BulkReplayInSerializer._toJsonObject(B)),w.send(this.requestCtx,lF.ReplayOutSerializer._fromJsonObject)}getHeaders(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,tx.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(sx.EndpointHeadersInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}headersUpdate(u,D,B){return this.updateHeaders(u,D,B)}patchHeaders(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(ox.EndpointHeadersPatchInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}headersPatch(u,D,B){return this.patchHeaders(u,D,B)}recover(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(ZS.RecoverInSerializer._toJsonObject(B)),w.send(this.requestCtx,JS.RecoverOutSerializer._fromJsonObject)}replayMissing(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(QS.ReplayInSerializer._toJsonObject(B)),w.send(this.requestCtx,lF.ReplayOutSerializer._fromJsonObject)}getSecret(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,DS.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(BS.EndpointSecretRotateInSerializer._toJsonObject(B)),w.sendNoResponseBody(this.requestCtx)}sendExample(u,D,B,A){let w=new H.SvixRequest(H.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody($S.EventExampleInSerializer._toJsonObject(B)),w.send(this.requestCtx,zS.MessageOutSerializer._fromJsonObject)}getStats(u,D,B){let A=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({since:B===null||B===void 0?void 0:B.since,until:B===null||B===void 0?void 0:B.until}),A.send(this.requestCtx,AS.EndpointStatsSerializer._fromJsonObject)}transformationGet(u,D){let B=new H.SvixRequest(H.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,FS.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(NS.EndpointTransformationPatchSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(u,D,B){let A=new H.SvixRequest(H.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(wS.EndpointTransformationInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}}rF.Endpoint=dF});var w8=$((pF)=>{Object.defineProperty(pF,"__esModule",{value:!0});pF.EventTypeInSerializer=void 0;pF.EventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var u7=$((oF)=>{Object.defineProperty(oF,"__esModule",{value:!0});oF.EnvironmentInSerializer=void 0;var sF=e3(),tF=w8();oF.EnvironmentInSerializer={_fromJsonObject(u){var D,B;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((A)=>sF.ConnectorInSerializer._fromJsonObject(A)),eventTypes:(B=u.eventTypes)===null||B===void 0?void 0:B.map((A)=>tF.EventTypeInSerializer._fromJsonObject(A)),settings:u.settings}},_toJsonObject(u){var D,B;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((A)=>sF.ConnectorInSerializer._toJsonObject(A)),eventTypes:(B=u.eventTypes)===null||B===void 0?void 0:B.map((A)=>tF.EventTypeInSerializer._toJsonObject(A)),settings:u.settings}}}});var o1=$((D7)=>{Object.defineProperty(D7,"__esModule",{value:!0});D7.EventTypeOutSerializer=void 0;D7.EventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:u.updatedAt}}}});var G7=$((F7)=>{Object.defineProperty(F7,"__esModule",{value:!0});F7.EnvironmentOutSerializer=void 0;var A7=a1(),w7=o1();F7.EnvironmentOutSerializer={_fromJsonObject(u){return{connectors:u.connectors.map((D)=>A7.ConnectorOutSerializer._fromJsonObject(D)),createdAt:new Date(u.createdAt),eventTypes:u.eventTypes.map((D)=>w7.EventTypeOutSerializer._fromJsonObject(D)),settings:u.settings,version:u.version}},_toJsonObject(u){return{connectors:u.connectors.map((D)=>A7.ConnectorOutSerializer._toJsonObject(D)),createdAt:u.createdAt,eventTypes:u.eventTypes.map((D)=>w7.EventTypeOutSerializer._toJsonObject(D)),settings:u.settings,version:u.version}}}});var Z7=$((v7)=>{Object.defineProperty(v7,"__esModule",{value:!0});v7.Environment=void 0;var WS=u7(),XS=G7(),e1=g();class $7{constructor(u){this.requestCtx=u}export(u){let D=new e1.SvixRequest(e1.HttpMethod.POST,"/api/v1/environment/export");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.send(this.requestCtx,XS.EnvironmentOutSerializer._fromJsonObject)}import(u,D){let B=new e1.SvixRequest(e1.HttpMethod.POST,"/api/v1/environment/import");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(WS.EnvironmentInSerializer._toJsonObject(u)),B.sendNoResponseBody(this.requestCtx)}}v7.Environment=$7});var W7=$((J7)=>{Object.defineProperty(J7,"__esModule",{value:!0});J7.EventTypeImportOpenApiInSerializer=void 0;J7.EventTypeImportOpenApiInSerializer={_fromJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}},_toJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}}}});var h7=$((X7)=>{Object.defineProperty(X7,"__esModule",{value:!0});X7.EventTypeFromOpenApiSerializer=void 0;X7.EventTypeFromOpenApiSerializer={_fromJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var R7=$((x7)=>{Object.defineProperty(x7,"__esModule",{value:!0});x7.EventTypeImportOpenApiOutDataSerializer=void 0;var K7=h7();x7.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(u){var D;return{modified:u.modified,toModify:(D=u.to_modify)===null||D===void 0?void 0:D.map((B)=>K7.EventTypeFromOpenApiSerializer._fromJsonObject(B))}},_toJsonObject(u){var D;return{modified:u.modified,to_modify:(D=u.toModify)===null||D===void 0?void 0:D.map((B)=>K7.EventTypeFromOpenApiSerializer._toJsonObject(B))}}}});var M7=$((U7)=>{Object.defineProperty(U7,"__esModule",{value:!0});U7.EventTypeImportOpenApiOutSerializer=void 0;var H7=R7();U7.EventTypeImportOpenApiOutSerializer={_fromJsonObject(u){return{data:H7.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(u.data)}},_toJsonObject(u){return{data:H7.EventTypeImportOpenApiOutDataSerializer._toJsonObject(u.data)}}}});var O7=$((L7)=>{Object.defineProperty(L7,"__esModule",{value:!0});L7.EventTypePatchSerializer=void 0;L7.EventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var k7=$((C7)=>{Object.defineProperty(C7,"__esModule",{value:!0});C7.EventTypeUpdateSerializer=void 0;C7.EventTypeUpdateSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var I7=$((V7)=>{Object.defineProperty(V7,"__esModule",{value:!0});V7.ListResponseEventTypeOutSerializer=void 0;var y7=o1();V7.ListResponseEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>y7.EventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>y7.EventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var _7=$((m7)=>{Object.defineProperty(m7,"__esModule",{value:!0});m7.EventType=void 0;var YS=W7(),hS=M7(),KS=w8(),uD=o1(),xS=O7(),SS=k7(),RS=I7(),J2=g();class q7{constructor(u){this.requestCtx=u}list(u){let D=new J2.SvixRequest(J2.HttpMethod.GET,"/api/v1/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived,with_content:u===null||u===void 0?void 0:u.withContent}),D.send(this.requestCtx,RS.ListResponseEventTypeOutSerializer._fromJsonObject)}create(u,D){let B=new J2.SvixRequest(J2.HttpMethod.POST,"/api/v1/event-type");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(KS.EventTypeInSerializer._toJsonObject(u)),B.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}importOpenapi(u,D){let B=new J2.SvixRequest(J2.HttpMethod.POST,"/api/v1/event-type/import/openapi");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(YS.EventTypeImportOpenApiInSerializer._toJsonObject(u)),B.send(this.requestCtx,hS.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(u){let D=new J2.SvixRequest(J2.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return D.setPathParam("event_type_name",u),D.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}update(u,D){let B=new J2.SvixRequest(J2.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setBody(SS.EventTypeUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}delete(u,D){let B=new J2.SvixRequest(J2.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),B.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new J2.SvixRequest(J2.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setBody(xS.EventTypePatchSerializer._toJsonObject(D)),B.send(this.requestCtx,uD.EventTypeOutSerializer._fromJsonObject)}}m7.EventType=q7});var d7=$((j7)=>{Object.defineProperty(j7,"__esModule",{value:!0});j7.Health=void 0;var f7=g();class b7{constructor(u){this.requestCtx=u}get(){return new f7.SvixRequest(f7.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}}j7.Health=b7});var n7=$((r7)=>{Object.defineProperty(r7,"__esModule",{value:!0});r7.IngestSourceConsumerPortalAccessInSerializer=void 0;r7.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}},_toJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}}}});var s7=$((p7)=>{Object.defineProperty(p7,"__esModule",{value:!0});p7.IngestEndpointHeadersInSerializer=void 0;p7.IngestEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var e7=$((t7)=>{Object.defineProperty(t7,"__esModule",{value:!0});t7.IngestEndpointHeadersOutSerializer=void 0;t7.IngestEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var BN=$((uN)=>{Object.defineProperty(uN,"__esModule",{value:!0});uN.IngestEndpointInSerializer=void 0;uN.IngestEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var F8=$((AN)=>{Object.defineProperty(AN,"__esModule",{value:!0});AN.IngestEndpointOutSerializer=void 0;AN.IngestEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var GN=$((FN)=>{Object.defineProperty(FN,"__esModule",{value:!0});FN.IngestEndpointSecretInSerializer=void 0;FN.IngestEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var zN=$(($N)=>{Object.defineProperty($N,"__esModule",{value:!0});$N.IngestEndpointSecretOutSerializer=void 0;$N.IngestEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var QN=$((ZN)=>{Object.defineProperty(ZN,"__esModule",{value:!0});ZN.IngestEndpointTransformationOutSerializer=void 0;ZN.IngestEndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var YN=$((WN)=>{Object.defineProperty(WN,"__esModule",{value:!0});WN.IngestEndpointTransformationPatchSerializer=void 0;WN.IngestEndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var xN=$((hN)=>{Object.defineProperty(hN,"__esModule",{value:!0});hN.IngestEndpointUpdateSerializer=void 0;hN.IngestEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var UN=$((RN)=>{Object.defineProperty(RN,"__esModule",{value:!0});RN.ListResponseIngestEndpointOutSerializer=void 0;var SN=F8();RN.ListResponseIngestEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>SN.IngestEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>SN.IngestEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var EN=$((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});MN.IngestEndpoint=void 0;var HS=s7(),US=e7(),cS=BN(),N8=F8(),MS=GN(),LS=zN(),ES=QN(),OS=YN(),CS=xN(),PS=UN(),b=g();class cN{constructor(u){this.requestCtx=u}list(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return B.setPathParam("source_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,PS.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(u,D,B){let A=new b.SvixRequest(b.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(cS.IngestEndpointInSerializer._toJsonObject(D)),A.send(this.requestCtx,N8.IngestEndpointOutSerializer._fromJsonObject)}get(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,N8.IngestEndpointOutSerializer._fromJsonObject)}update(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(CS.IngestEndpointUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,N8.IngestEndpointOutSerializer._fromJsonObject)}delete(u,D){let B=new b.SvixRequest(b.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.sendNoResponseBody(this.requestCtx)}getHeaders(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,US.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(HS.IngestEndpointHeadersInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}getSecret(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,LS.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new b.SvixRequest(b.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return w.setPathParam("source_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(MS.IngestEndpointSecretInSerializer._toJsonObject(B)),w.sendNoResponseBody(this.requestCtx)}getTransformation(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,ES.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(OS.IngestEndpointTransformationPatchSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}}MN.IngestEndpoint=cN});var PN=$((ON)=>{Object.defineProperty(ON,"__esModule",{value:!0});ON.AdobeSignConfigSerializer=void 0;ON.AdobeSignConfigSerializer={_fromJsonObject(u){return{clientId:u.clientId}},_toJsonObject(u){return{clientId:u.clientId}}}});var VN=$((kN)=>{Object.defineProperty(kN,"__esModule",{value:!0});kN.AirwallexConfigSerializer=void 0;kN.AirwallexConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var qN=$((TN)=>{Object.defineProperty(TN,"__esModule",{value:!0});TN.CheckbookConfigSerializer=void 0;TN.CheckbookConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var G8=$((mN)=>{Object.defineProperty(mN,"__esModule",{value:!0});mN.CronConfigSerializer=void 0;mN.CronConfigSerializer={_fromJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}},_toJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}}}});var bN=$((_N)=>{Object.defineProperty(_N,"__esModule",{value:!0});_N.DocusignConfigSerializer=void 0;_N.DocusignConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var dN=$((jN)=>{Object.defineProperty(jN,"__esModule",{value:!0});jN.EasypostConfigSerializer=void 0;jN.EasypostConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var nN=$((rN)=>{Object.defineProperty(rN,"__esModule",{value:!0});rN.GithubConfigSerializer=void 0;rN.GithubConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var sN=$((pN)=>{Object.defineProperty(pN,"__esModule",{value:!0});pN.HubspotConfigSerializer=void 0;pN.HubspotConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var eN=$((tN)=>{Object.defineProperty(tN,"__esModule",{value:!0});tN.MetaConfigSerializer=void 0;tN.MetaConfigSerializer={_fromJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}},_toJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}}}});var BG=$((uG)=>{Object.defineProperty(uG,"__esModule",{value:!0});uG.OrumIoConfigSerializer=void 0;uG.OrumIoConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var FG=$((AG)=>{Object.defineProperty(AG,"__esModule",{value:!0});AG.PandaDocConfigSerializer=void 0;AG.PandaDocConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var $G=$((NG)=>{Object.defineProperty(NG,"__esModule",{value:!0});NG.PortIoConfigSerializer=void 0;NG.PortIoConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var ZG=$((vG)=>{Object.defineProperty(vG,"__esModule",{value:!0});vG.RutterConfigSerializer=void 0;vG.RutterConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var WG=$((JG)=>{Object.defineProperty(JG,"__esModule",{value:!0});JG.SegmentConfigSerializer=void 0;JG.SegmentConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var hG=$((XG)=>{Object.defineProperty(XG,"__esModule",{value:!0});XG.ShopifyConfigSerializer=void 0;XG.ShopifyConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var SG=$((KG)=>{Object.defineProperty(KG,"__esModule",{value:!0});KG.SlackConfigSerializer=void 0;KG.SlackConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var UG=$((RG)=>{Object.defineProperty(RG,"__esModule",{value:!0});RG.StripeConfigSerializer=void 0;RG.StripeConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var LG=$((cG)=>{Object.defineProperty(cG,"__esModule",{value:!0});cG.SvixConfigSerializer=void 0;cG.SvixConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var CG=$((EG)=>{Object.defineProperty(EG,"__esModule",{value:!0});EG.TelnyxConfigSerializer=void 0;EG.TelnyxConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var yG=$((PG)=>{Object.defineProperty(PG,"__esModule",{value:!0});PG.VapiConfigSerializer=void 0;PG.VapiConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var IG=$((VG)=>{Object.defineProperty(VG,"__esModule",{value:!0});VG.VeriffConfigSerializer=void 0;VG.VeriffConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var gG=$((qG)=>{Object.defineProperty(qG,"__esModule",{value:!0});qG.ZoomConfigSerializer=void 0;qG.ZoomConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var $$=$((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});N$.IngestSourceInSerializer=void 0;var _G=PN(),fG=VN(),bG=qN(),jG=G8(),lG=bN(),dG=dN(),rG=nN(),iG=sN(),nG=eN(),pG=BG(),aG=FG(),sG=$G(),tG=ZG(),oG=WG(),eG=hG(),u$=SG(),D$=UG(),C=LG(),B$=CG(),A$=yG(),w$=IG(),F$=gG();N$.IngestSourceInSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"generic-webhook":return{};case"cron":return jG.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return _G.AdobeSignConfigSerializer._fromJsonObject(u.config);case"beehiiv":return C.SvixConfigSerializer._fromJsonObject(u.config);case"brex":return C.SvixConfigSerializer._fromJsonObject(u.config);case"checkbook":return bG.CheckbookConfigSerializer._fromJsonObject(u.config);case"clerk":return C.SvixConfigSerializer._fromJsonObject(u.config);case"docusign":return lG.DocusignConfigSerializer._fromJsonObject(u.config);case"easypost":return dG.EasypostConfigSerializer._fromJsonObject(u.config);case"github":return rG.GithubConfigSerializer._fromJsonObject(u.config);case"guesty":return C.SvixConfigSerializer._fromJsonObject(u.config);case"hubspot":return iG.HubspotConfigSerializer._fromJsonObject(u.config);case"incident-io":return C.SvixConfigSerializer._fromJsonObject(u.config);case"lithic":return C.SvixConfigSerializer._fromJsonObject(u.config);case"meta":return nG.MetaConfigSerializer._fromJsonObject(u.config);case"nash":return C.SvixConfigSerializer._fromJsonObject(u.config);case"orum-io":return pG.OrumIoConfigSerializer._fromJsonObject(u.config);case"panda-doc":return aG.PandaDocConfigSerializer._fromJsonObject(u.config);case"port-io":return sG.PortIoConfigSerializer._fromJsonObject(u.config);case"pleo":return C.SvixConfigSerializer._fromJsonObject(u.config);case"psi-fi":return C.SvixConfigSerializer._fromJsonObject(u.config);case"replicate":return C.SvixConfigSerializer._fromJsonObject(u.config);case"resend":return C.SvixConfigSerializer._fromJsonObject(u.config);case"rutter":return tG.RutterConfigSerializer._fromJsonObject(u.config);case"safebase":return C.SvixConfigSerializer._fromJsonObject(u.config);case"sardine":return C.SvixConfigSerializer._fromJsonObject(u.config);case"segment":return oG.SegmentConfigSerializer._fromJsonObject(u.config);case"shopify":return eG.ShopifyConfigSerializer._fromJsonObject(u.config);case"slack":return u$.SlackConfigSerializer._fromJsonObject(u.config);case"stripe":return D$.StripeConfigSerializer._fromJsonObject(u.config);case"stych":return C.SvixConfigSerializer._fromJsonObject(u.config);case"svix":return C.SvixConfigSerializer._fromJsonObject(u.config);case"zoom":return F$.ZoomConfigSerializer._fromJsonObject(u.config);case"telnyx":return B$.TelnyxConfigSerializer._fromJsonObject(u.config);case"vapi":return A$.VapiConfigSerializer._fromJsonObject(u.config);case"open-ai":return C.SvixConfigSerializer._fromJsonObject(u.config);case"render":return C.SvixConfigSerializer._fromJsonObject(u.config);case"veriff":return w$.VeriffConfigSerializer._fromJsonObject(u.config);case"airwallex":return fG.AirwallexConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=jG.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=_G.AdobeSignConfigSerializer._toJsonObject(u.config);break;case"beehiiv":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"brex":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"checkbook":D=bG.CheckbookConfigSerializer._toJsonObject(u.config);break;case"clerk":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"docusign":D=lG.DocusignConfigSerializer._toJsonObject(u.config);break;case"easypost":D=dG.EasypostConfigSerializer._toJsonObject(u.config);break;case"github":D=rG.GithubConfigSerializer._toJsonObject(u.config);break;case"guesty":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"hubspot":D=iG.HubspotConfigSerializer._toJsonObject(u.config);break;case"incident-io":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"lithic":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"meta":D=nG.MetaConfigSerializer._toJsonObject(u.config);break;case"nash":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"orum-io":D=pG.OrumIoConfigSerializer._toJsonObject(u.config);break;case"panda-doc":D=aG.PandaDocConfigSerializer._toJsonObject(u.config);break;case"port-io":D=sG.PortIoConfigSerializer._toJsonObject(u.config);break;case"pleo":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"psi-fi":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"replicate":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"resend":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"rutter":D=tG.RutterConfigSerializer._toJsonObject(u.config);break;case"safebase":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"sardine":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"segment":D=oG.SegmentConfigSerializer._toJsonObject(u.config);break;case"shopify":D=eG.ShopifyConfigSerializer._toJsonObject(u.config);break;case"slack":D=u$.SlackConfigSerializer._toJsonObject(u.config);break;case"stripe":D=D$.StripeConfigSerializer._toJsonObject(u.config);break;case"stych":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"svix":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"zoom":D=F$.ZoomConfigSerializer._toJsonObject(u.config);break;case"telnyx":D=B$.TelnyxConfigSerializer._toJsonObject(u.config);break;case"vapi":D=A$.VapiConfigSerializer._toJsonObject(u.config);break;case"open-ai":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"render":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"veriff":D=w$.VeriffConfigSerializer._toJsonObject(u.config);break;case"airwallex":D=fG.AirwallexConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,metadata:u.metadata,name:u.name,uid:u.uid}}}});var Z$=$((v$)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.AdobeSignConfigOutSerializer=void 0;v$.AdobeSignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var W$=$((J$)=>{Object.defineProperty(J$,"__esModule",{value:!0});J$.AirwallexConfigOutSerializer=void 0;J$.AirwallexConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var h$=$((X$)=>{Object.defineProperty(X$,"__esModule",{value:!0});X$.CheckbookConfigOutSerializer=void 0;X$.CheckbookConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var S$=$((K$)=>{Object.defineProperty(K$,"__esModule",{value:!0});K$.DocusignConfigOutSerializer=void 0;K$.DocusignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var U$=$((R$)=>{Object.defineProperty(R$,"__esModule",{value:!0});R$.EasypostConfigOutSerializer=void 0;R$.EasypostConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var L$=$((c$)=>{Object.defineProperty(c$,"__esModule",{value:!0});c$.GithubConfigOutSerializer=void 0;c$.GithubConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var C$=$((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});E$.HubspotConfigOutSerializer=void 0;E$.HubspotConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var y$=$((P$)=>{Object.defineProperty(P$,"__esModule",{value:!0});P$.MetaConfigOutSerializer=void 0;P$.MetaConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var I$=$((V$)=>{Object.defineProperty(V$,"__esModule",{value:!0});V$.OrumIoConfigOutSerializer=void 0;V$.OrumIoConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var g$=$((q$)=>{Object.defineProperty(q$,"__esModule",{value:!0});q$.PandaDocConfigOutSerializer=void 0;q$.PandaDocConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var b$=$((_$)=>{Object.defineProperty(_$,"__esModule",{value:!0});_$.PortIoConfigOutSerializer=void 0;_$.PortIoConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var d$=$((j$)=>{Object.defineProperty(j$,"__esModule",{value:!0});j$.RutterConfigOutSerializer=void 0;j$.RutterConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var n$=$((r$)=>{Object.defineProperty(r$,"__esModule",{value:!0});r$.SegmentConfigOutSerializer=void 0;r$.SegmentConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var s$=$((p$)=>{Object.defineProperty(p$,"__esModule",{value:!0});p$.ShopifyConfigOutSerializer=void 0;p$.ShopifyConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var e$=$((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.SlackConfigOutSerializer=void 0;t$.SlackConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Bv=$((uv)=>{Object.defineProperty(uv,"__esModule",{value:!0});uv.StripeConfigOutSerializer=void 0;uv.StripeConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Fv=$((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});Av.SvixConfigOutSerializer=void 0;Av.SvixConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var $v=$((Nv)=>{Object.defineProperty(Nv,"__esModule",{value:!0});Nv.TelnyxConfigOutSerializer=void 0;Nv.TelnyxConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var Zv=$((vv)=>{Object.defineProperty(vv,"__esModule",{value:!0});vv.VapiConfigOutSerializer=void 0;vv.VapiConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Wv=$((Jv)=>{Object.defineProperty(Jv,"__esModule",{value:!0});Jv.VeriffConfigOutSerializer=void 0;Jv.VeriffConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var hv=$((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});Xv.ZoomConfigOutSerializer=void 0;Xv.ZoomConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var $8=$((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});_v.IngestSourceOutSerializer=void 0;var Kv=Z$(),xv=W$(),Sv=h$(),Rv=G8(),Hv=S$(),Uv=U$(),cv=L$(),Mv=C$(),Lv=y$(),Ev=I$(),Ov=g$(),Cv=b$(),Pv=d$(),kv=n$(),yv=s$(),Vv=e$(),Tv=Bv(),P=Fv(),Iv=$v(),qv=Zv(),mv=Wv(),gv=hv();_v.IngestSourceOutSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"generic-webhook":return{};case"cron":return Rv.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return Kv.AdobeSignConfigOutSerializer._fromJsonObject(u.config);case"beehiiv":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"brex":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"checkbook":return Sv.CheckbookConfigOutSerializer._fromJsonObject(u.config);case"clerk":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"docusign":return Hv.DocusignConfigOutSerializer._fromJsonObject(u.config);case"easypost":return Uv.EasypostConfigOutSerializer._fromJsonObject(u.config);case"github":return cv.GithubConfigOutSerializer._fromJsonObject(u.config);case"guesty":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"hubspot":return Mv.HubspotConfigOutSerializer._fromJsonObject(u.config);case"incident-io":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"lithic":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"meta":return Lv.MetaConfigOutSerializer._fromJsonObject(u.config);case"nash":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"orum-io":return Ev.OrumIoConfigOutSerializer._fromJsonObject(u.config);case"panda-doc":return Ov.PandaDocConfigOutSerializer._fromJsonObject(u.config);case"port-io":return Cv.PortIoConfigOutSerializer._fromJsonObject(u.config);case"psi-fi":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"pleo":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"replicate":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"resend":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"rutter":return Pv.RutterConfigOutSerializer._fromJsonObject(u.config);case"safebase":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"sardine":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"segment":return kv.SegmentConfigOutSerializer._fromJsonObject(u.config);case"shopify":return yv.ShopifyConfigOutSerializer._fromJsonObject(u.config);case"slack":return Vv.SlackConfigOutSerializer._fromJsonObject(u.config);case"stripe":return Tv.StripeConfigOutSerializer._fromJsonObject(u.config);case"stych":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"svix":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"zoom":return gv.ZoomConfigOutSerializer._fromJsonObject(u.config);case"telnyx":return Iv.TelnyxConfigOutSerializer._fromJsonObject(u.config);case"vapi":return qv.VapiConfigOutSerializer._fromJsonObject(u.config);case"open-ai":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"render":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"veriff":return mv.VeriffConfigOutSerializer._fromJsonObject(u.config);case"airwallex":return xv.AirwallexConfigOutSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),createdAt:new Date(u.createdAt),id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=Rv.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=Kv.AdobeSignConfigOutSerializer._toJsonObject(u.config);break;case"beehiiv":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"brex":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"checkbook":D=Sv.CheckbookConfigOutSerializer._toJsonObject(u.config);break;case"clerk":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"docusign":D=Hv.DocusignConfigOutSerializer._toJsonObject(u.config);break;case"easypost":D=Uv.EasypostConfigOutSerializer._toJsonObject(u.config);break;case"github":D=cv.GithubConfigOutSerializer._toJsonObject(u.config);break;case"guesty":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"hubspot":D=Mv.HubspotConfigOutSerializer._toJsonObject(u.config);break;case"incident-io":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"lithic":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"meta":D=Lv.MetaConfigOutSerializer._toJsonObject(u.config);break;case"nash":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"orum-io":D=Ev.OrumIoConfigOutSerializer._toJsonObject(u.config);break;case"panda-doc":D=Ov.PandaDocConfigOutSerializer._toJsonObject(u.config);break;case"port-io":D=Cv.PortIoConfigOutSerializer._toJsonObject(u.config);break;case"psi-fi":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"pleo":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"replicate":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"resend":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"rutter":D=Pv.RutterConfigOutSerializer._toJsonObject(u.config);break;case"safebase":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"sardine":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"segment":D=kv.SegmentConfigOutSerializer._toJsonObject(u.config);break;case"shopify":D=yv.ShopifyConfigOutSerializer._toJsonObject(u.config);break;case"slack":D=Vv.SlackConfigOutSerializer._toJsonObject(u.config);break;case"stripe":D=Tv.StripeConfigOutSerializer._toJsonObject(u.config);break;case"stych":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"svix":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"zoom":D=gv.ZoomConfigOutSerializer._toJsonObject(u.config);break;case"telnyx":D=Iv.TelnyxConfigOutSerializer._toJsonObject(u.config);break;case"vapi":D=qv.VapiConfigOutSerializer._toJsonObject(u.config);break;case"open-ai":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"render":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"veriff":D=mv.VeriffConfigOutSerializer._toJsonObject(u.config);break;case"airwallex":D=xv.AirwallexConfigOutSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,createdAt:u.createdAt,id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var dv=$((jv)=>{Object.defineProperty(jv,"__esModule",{value:!0});jv.ListResponseIngestSourceOutSerializer=void 0;var bv=$8();jv.ListResponseIngestSourceOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>bv.IngestSourceOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>bv.IngestSourceOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var nv=$((rv)=>{Object.defineProperty(rv,"__esModule",{value:!0});rv.RotateTokenOutSerializer=void 0;rv.RotateTokenOutSerializer={_fromJsonObject(u){return{ingestUrl:u.ingestUrl}},_toJsonObject(u){return{ingestUrl:u.ingestUrl}}}});var ov=$((sv)=>{Object.defineProperty(sv,"__esModule",{value:!0});sv.IngestSource=void 0;var pv=$$(),v8=$8(),kS=dv(),yS=nv(),M2=g();class av{constructor(u){this.requestCtx=u}list(u){let D=new M2.SvixRequest(M2.HttpMethod.GET,"/ingest/api/v1/source");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,kS.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(u,D){let B=new M2.SvixRequest(M2.HttpMethod.POST,"/ingest/api/v1/source");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(pv.IngestSourceInSerializer._toJsonObject(u)),B.send(this.requestCtx,v8.IngestSourceOutSerializer._fromJsonObject)}get(u){let D=new M2.SvixRequest(M2.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.send(this.requestCtx,v8.IngestSourceOutSerializer._fromJsonObject)}update(u,D){let B=new M2.SvixRequest(M2.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return B.setPathParam("source_id",u),B.setBody(pv.IngestSourceInSerializer._toJsonObject(D)),B.send(this.requestCtx,v8.IngestSourceOutSerializer._fromJsonObject)}delete(u){let D=new M2.SvixRequest(M2.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.sendNoResponseBody(this.requestCtx)}rotateToken(u,D){let B=new M2.SvixRequest(M2.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return B.setPathParam("source_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,yS.RotateTokenOutSerializer._fromJsonObject)}}sv.IngestSource=av});var Az=$((Dz)=>{Object.defineProperty(Dz,"__esModule",{value:!0});Dz.Ingest=void 0;var VS=t3(),TS=n7(),IS=EN(),qS=ov(),ev=g();class uz{constructor(u){this.requestCtx=u}get endpoint(){return new IS.IngestEndpoint(this.requestCtx)}get source(){return new qS.IngestSource(this.requestCtx)}dashboard(u,D,B){let A=new ev.SvixRequest(ev.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(TS.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,VS.DashboardAccessOutSerializer._fromJsonObject)}}Dz.Ingest=uz});var Nz=$((wz)=>{Object.defineProperty(wz,"__esModule",{value:!0});wz.IntegrationInSerializer=void 0;wz.IntegrationInSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var vz=$((Gz)=>{Object.defineProperty(Gz,"__esModule",{value:!0});Gz.IntegrationKeyOutSerializer=void 0;Gz.IntegrationKeyOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var z8=$((zz)=>{Object.defineProperty(zz,"__esModule",{value:!0});zz.IntegrationOutSerializer=void 0;zz.IntegrationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:u.updatedAt}}}});var Wz=$((Jz)=>{Object.defineProperty(Jz,"__esModule",{value:!0});Jz.IntegrationUpdateSerializer=void 0;Jz.IntegrationUpdateSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var Kz=$((Yz)=>{Object.defineProperty(Yz,"__esModule",{value:!0});Yz.ListResponseIntegrationOutSerializer=void 0;var Xz=z8();Yz.ListResponseIntegrationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Xz.IntegrationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Xz.IntegrationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Uz=$((Rz)=>{Object.defineProperty(Rz,"__esModule",{value:!0});Rz.Integration=void 0;var mS=Nz(),xz=vz(),Z8=z8(),gS=Wz(),_S=Kz(),Q2=g();class Sz{constructor(u){this.requestCtx=u}list(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,_S.ListResponseIntegrationOutSerializer._fromJsonObject)}create(u,D,B){let A=new Q2.SvixRequest(Q2.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(mS.IntegrationInSerializer._toJsonObject(D)),A.send(this.requestCtx,Z8.IntegrationOutSerializer._fromJsonObject)}get(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.send(this.requestCtx,Z8.IntegrationOutSerializer._fromJsonObject)}update(u,D,B){let A=new Q2.SvixRequest(Q2.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.setBody(gS.IntegrationUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,Z8.IntegrationOutSerializer._fromJsonObject)}delete(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.sendNoResponseBody(this.requestCtx)}getKey(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.send(this.requestCtx,xz.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(u,D,B){let A=new Q2.SvixRequest(Q2.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.send(this.requestCtx,xz.IntegrationKeyOutSerializer._fromJsonObject)}}Rz.Integration=Sz});var Oz=$((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.ExpungeAllContentsOutSerializer=void 0;var cz=a2(),Mz=s2();Lz.ExpungeAllContentsOutSerializer={_fromJsonObject(u){return{id:u.id,status:cz.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:Mz.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:cz.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:Mz.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var yz=$((Pz)=>{Object.defineProperty(Pz,"__esModule",{value:!0});Pz.ListResponseMessageOutSerializer=void 0;var Cz=Hu();Pz.ListResponseMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Cz.MessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Cz.MessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Iz=$((Vz)=>{Object.defineProperty(Vz,"__esModule",{value:!0});Vz.MessagePrecheckInSerializer=void 0;Vz.MessagePrecheckInSerializer={_fromJsonObject(u){return{channels:u.channels,eventType:u.eventType}},_toJsonObject(u){return{channels:u.channels,eventType:u.eventType}}}});var gz=$((qz)=>{Object.defineProperty(qz,"__esModule",{value:!0});qz.MessagePrecheckOutSerializer=void 0;qz.MessagePrecheckOutSerializer={_fromJsonObject(u){return{active:u.active}},_toJsonObject(u){return{active:u.active}}}});var bz=$((_z)=>{Object.defineProperty(_z,"__esModule",{value:!0});_z.PollingEndpointConsumerSeekInSerializer=void 0;_z.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(u){return{after:new Date(u.after)}},_toJsonObject(u){return{after:u.after}}}});var dz=$((jz)=>{Object.defineProperty(jz,"__esModule",{value:!0});jz.PollingEndpointConsumerSeekOutSerializer=void 0;jz.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(u){return{iterator:u.iterator}},_toJsonObject(u){return{iterator:u.iterator}}}});var nz=$((rz)=>{Object.defineProperty(rz,"__esModule",{value:!0});rz.PollingEndpointMessageOutSerializer=void 0;rz.PollingEndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var tz=$((az)=>{Object.defineProperty(az,"__esModule",{value:!0});az.PollingEndpointOutSerializer=void 0;var pz=nz();az.PollingEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>pz.PollingEndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>pz.PollingEndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var BZ=$((uZ)=>{Object.defineProperty(uZ,"__esModule",{value:!0});uZ.MessagePoller=void 0;var fS=bz(),bS=dz(),oz=tz(),V0=g();class ez{constructor(u){this.requestCtx=u}poll(u,D,B){let A=new V0.SvixRequest(V0.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return A.setPathParam("app_id",u),A.setPathParam("sink_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,event_type:B===null||B===void 0?void 0:B.eventType,channel:B===null||B===void 0?void 0:B.channel,after:B===null||B===void 0?void 0:B.after}),A.send(this.requestCtx,oz.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(u,D,B,A){let w=new V0.SvixRequest(V0.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return w.setPathParam("app_id",u),w.setPathParam("sink_id",D),w.setPathParam("consumer_id",B),w.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator}),w.send(this.requestCtx,oz.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(u,D,B,A,w){let F=new V0.SvixRequest(V0.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return F.setPathParam("app_id",u),F.setPathParam("sink_id",D),F.setPathParam("consumer_id",B),F.setHeaderParam("idempotency-key",w===null||w===void 0?void 0:w.idempotencyKey),F.setBody(fS.PollingEndpointConsumerSeekInSerializer._toJsonObject(A)),F.send(this.requestCtx,bS.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}}uZ.MessagePoller=ez});var NZ=$((wZ)=>{Object.defineProperty(wZ,"__esModule",{value:!0});wZ.MessageInSerializer=void 0;var AZ=i1();wZ.MessageInSerializer={_fromJsonObject(u){return{application:u.application!=null?AZ.ApplicationInSerializer._fromJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}},_toJsonObject(u){return{application:u.application!=null?AZ.ApplicationInSerializer._toJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}}}});var J8=$((vZ)=>{Object.defineProperty(vZ,"__esModule",{value:!0});vZ.messageInRaw=vZ.Message=void 0;var jS=Oz(),lS=yz(),GZ=Hu(),dS=Iz(),rS=gz(),iS=BZ(),L2=g(),nS=NZ();class $Z{constructor(u){this.requestCtx=u}get poller(){return new iS.MessagePoller(this.requestCtx)}list(u,D){let B=new L2.SvixRequest(L2.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,channel:D===null||D===void 0?void 0:D.channel,before:D===null||D===void 0?void 0:D.before,after:D===null||D===void 0?void 0:D.after,with_content:D===null||D===void 0?void 0:D.withContent,tag:D===null||D===void 0?void 0:D.tag,event_types:D===null||D===void 0?void 0:D.eventTypes}),B.send(this.requestCtx,lS.ListResponseMessageOutSerializer._fromJsonObject)}create(u,D,B){let A=new L2.SvixRequest(L2.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return A.setPathParam("app_id",u),A.setQueryParams({with_content:B===null||B===void 0?void 0:B.withContent}),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(nS.MessageInSerializer._toJsonObject(D)),A.send(this.requestCtx,GZ.MessageOutSerializer._fromJsonObject)}expungeAllContents(u,D){let B=new L2.SvixRequest(L2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,jS.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(u,D,B){let A=new L2.SvixRequest(L2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(dS.MessagePrecheckInSerializer._toJsonObject(D)),A.send(this.requestCtx,rS.MessagePrecheckOutSerializer._fromJsonObject)}get(u,D,B){let A=new L2.SvixRequest(L2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({with_content:B===null||B===void 0?void 0:B.withContent}),A.send(this.requestCtx,GZ.MessageOutSerializer._fromJsonObject)}expungeContent(u,D){let B=new L2.SvixRequest(L2.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.sendNoResponseBody(this.requestCtx)}}vZ.Message=$Z;function pS(u,D,B){return{eventType:u,payload:{},transformationsParams:{rawPayload:D,headers:B?{"content-type":B}:void 0}}}vZ.messageInRaw=pS});var Q8=$((ZZ)=>{Object.defineProperty(ZZ,"__esModule",{value:!0});ZZ.EmptyResponseSerializer=void 0;ZZ.EmptyResponseSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Uu=$((WZ)=>{Object.defineProperty(WZ,"__esModule",{value:!0});WZ.MessageStatusTextSerializer=WZ.MessageStatusText=void 0;var sS;(function(u){u.Success="success",u.Pending="pending",u.Fail="fail",u.Sending="sending"})(sS=WZ.MessageStatusText||(WZ.MessageStatusText={}));WZ.MessageStatusTextSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var SZ=$((KZ)=>{Object.defineProperty(KZ,"__esModule",{value:!0});KZ.EndpointMessageOutSerializer=void 0;var YZ=y0(),hZ=Uu();KZ.EndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,payload:u.payload,status:YZ.MessageStatusSerializer._fromJsonObject(u.status),statusText:hZ.MessageStatusTextSerializer._fromJsonObject(u.statusText),tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt,payload:u.payload,status:YZ.MessageStatusSerializer._toJsonObject(u.status),statusText:hZ.MessageStatusTextSerializer._toJsonObject(u.statusText),tags:u.tags,timestamp:u.timestamp}}}});var cZ=$((HZ)=>{Object.defineProperty(HZ,"__esModule",{value:!0});HZ.ListResponseEndpointMessageOutSerializer=void 0;var RZ=SZ();HZ.ListResponseEndpointMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>RZ.EndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>RZ.EndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var W8=$((LZ)=>{Object.defineProperty(LZ,"__esModule",{value:!0});LZ.MessageAttemptTriggerTypeSerializer=LZ.MessageAttemptTriggerType=void 0;var tS;(function(u){u[u.Scheduled=0]="Scheduled",u[u.Manual=1]="Manual"})(tS=LZ.MessageAttemptTriggerType||(LZ.MessageAttemptTriggerType={}));LZ.MessageAttemptTriggerTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var X8=$((yZ)=>{Object.defineProperty(yZ,"__esModule",{value:!0});yZ.MessageAttemptOutSerializer=void 0;var OZ=W8(),CZ=Hu(),PZ=y0(),kZ=Uu();yZ.MessageAttemptOutSerializer={_fromJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?CZ.MessageOutSerializer._fromJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:PZ.MessageStatusSerializer._fromJsonObject(u.status),statusText:kZ.MessageStatusTextSerializer._fromJsonObject(u.statusText),timestamp:new Date(u.timestamp),triggerType:OZ.MessageAttemptTriggerTypeSerializer._fromJsonObject(u.triggerType),url:u.url}},_toJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?CZ.MessageOutSerializer._toJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:PZ.MessageStatusSerializer._toJsonObject(u.status),statusText:kZ.MessageStatusTextSerializer._toJsonObject(u.statusText),timestamp:u.timestamp,triggerType:OZ.MessageAttemptTriggerTypeSerializer._toJsonObject(u.triggerType),url:u.url}}}});var mZ=$((IZ)=>{Object.defineProperty(IZ,"__esModule",{value:!0});IZ.ListResponseMessageAttemptOutSerializer=void 0;var TZ=X8();IZ.ListResponseMessageAttemptOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>TZ.MessageAttemptOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>TZ.MessageAttemptOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var jZ=$((fZ)=>{Object.defineProperty(fZ,"__esModule",{value:!0});fZ.MessageEndpointOutSerializer=void 0;var gZ=y0(),_Z=Uu();fZ.MessageEndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,rateLimit:u.rateLimit,status:gZ.MessageStatusSerializer._fromJsonObject(u.status),statusText:_Z.MessageStatusTextSerializer._fromJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt,rateLimit:u.rateLimit,status:gZ.MessageStatusSerializer._toJsonObject(u.status),statusText:_Z.MessageStatusTextSerializer._toJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var iZ=$((dZ)=>{Object.defineProperty(dZ,"__esModule",{value:!0});dZ.ListResponseMessageEndpointOutSerializer=void 0;var lZ=jZ();dZ.ListResponseMessageEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>lZ.MessageEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>lZ.MessageEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var tZ=$((aZ)=>{Object.defineProperty(aZ,"__esModule",{value:!0});aZ.MessageAttempt=void 0;var oS=Q8(),eS=cZ(),nZ=mZ(),uR=iZ(),DR=X8(),W2=g();class pZ{constructor(u){this.requestCtx=u}listByEndpoint(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,status:B===null||B===void 0?void 0:B.status,status_code_class:B===null||B===void 0?void 0:B.statusCodeClass,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,with_msg:B===null||B===void 0?void 0:B.withMsg,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,nZ.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,status:B===null||B===void 0?void 0:B.status,status_code_class:B===null||B===void 0?void 0:B.statusCodeClass,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,endpoint_id:B===null||B===void 0?void 0:B.endpointId,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,nZ.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,status:B===null||B===void 0?void 0:B.status,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,eS.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setPathParam("attempt_id",B),A.send(this.requestCtx,DR.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setPathParam("attempt_id",B),A.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator}),A.send(this.requestCtx,uR.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(u,D,B,A){let w=new W2.SvixRequest(W2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return w.setPathParam("app_id",u),w.setPathParam("msg_id",D),w.setPathParam("endpoint_id",B),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.send(this.requestCtx,oS.EmptyResponseSerializer._fromJsonObject)}}aZ.MessageAttempt=pZ});var Y8=$((oZ)=>{Object.defineProperty(oZ,"__esModule",{value:!0});oZ.OperationalWebhookEndpointOutSerializer=void 0;oZ.OperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var AJ=$((DJ)=>{Object.defineProperty(DJ,"__esModule",{value:!0});DJ.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var uJ=Y8();DJ.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>uJ.OperationalWebhookEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>uJ.OperationalWebhookEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var NJ=$((wJ)=>{Object.defineProperty(wJ,"__esModule",{value:!0});wJ.OperationalWebhookEndpointHeadersInSerializer=void 0;wJ.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var vJ=$((GJ)=>{Object.defineProperty(GJ,"__esModule",{value:!0});GJ.OperationalWebhookEndpointHeadersOutSerializer=void 0;GJ.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var JJ=$((zJ)=>{Object.defineProperty(zJ,"__esModule",{value:!0});zJ.OperationalWebhookEndpointInSerializer=void 0;zJ.OperationalWebhookEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var XJ=$((QJ)=>{Object.defineProperty(QJ,"__esModule",{value:!0});QJ.OperationalWebhookEndpointSecretInSerializer=void 0;QJ.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var KJ=$((YJ)=>{Object.defineProperty(YJ,"__esModule",{value:!0});YJ.OperationalWebhookEndpointSecretOutSerializer=void 0;YJ.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var RJ=$((xJ)=>{Object.defineProperty(xJ,"__esModule",{value:!0});xJ.OperationalWebhookEndpointUpdateSerializer=void 0;xJ.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var K8=$((UJ)=>{Object.defineProperty(UJ,"__esModule",{value:!0});UJ.OperationalWebhookEndpoint=void 0;var BR=AJ(),AR=NJ(),wR=vJ(),FR=JJ(),h8=Y8(),NR=XJ(),GR=KJ(),$R=RJ(),D2=g();class HJ{constructor(u){this.requestCtx=u}list(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,BR.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(u,D){let B=new D2.SvixRequest(D2.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(FR.OperationalWebhookEndpointInSerializer._toJsonObject(u)),B.send(this.requestCtx,h8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,h8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(u,D){let B=new D2.SvixRequest(D2.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return B.setPathParam("endpoint_id",u),B.setBody($R.OperationalWebhookEndpointUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,h8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(u){let D=new D2.SvixRequest(D2.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.sendNoResponseBody(this.requestCtx)}getHeaders(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,wR.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D){let B=new D2.SvixRequest(D2.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return B.setPathParam("endpoint_id",u),B.setBody(AR.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(D)),B.sendNoResponseBody(this.requestCtx)}getSecret(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,GR.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B){let A=new D2.SvixRequest(D2.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return A.setPathParam("endpoint_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(NR.OperationalWebhookEndpointSecretInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}}UJ.OperationalWebhookEndpoint=HJ});var OJ=$((LJ)=>{Object.defineProperty(LJ,"__esModule",{value:!0});LJ.OperationalWebhook=void 0;var vR=K8();class MJ{constructor(u){this.requestCtx=u}get endpoint(){return new vR.OperationalWebhookEndpoint(this.requestCtx)}}LJ.OperationalWebhook=MJ});var VJ=$((kJ)=>{Object.defineProperty(kJ,"__esModule",{value:!0});kJ.AggregateEventTypesOutSerializer=void 0;var CJ=a2(),PJ=s2();kJ.AggregateEventTypesOutSerializer={_fromJsonObject(u){return{id:u.id,status:CJ.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:PJ.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:CJ.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:PJ.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var qJ=$((TJ)=>{Object.defineProperty(TJ,"__esModule",{value:!0});TJ.AppUsageStatsInSerializer=void 0;TJ.AppUsageStatsInSerializer={_fromJsonObject(u){return{appIds:u.appIds,since:new Date(u.since),until:new Date(u.until)}},_toJsonObject(u){return{appIds:u.appIds,since:u.since,until:u.until}}}});var bJ=$((_J)=>{Object.defineProperty(_J,"__esModule",{value:!0});_J.AppUsageStatsOutSerializer=void 0;var mJ=a2(),gJ=s2();_J.AppUsageStatsOutSerializer={_fromJsonObject(u){return{id:u.id,status:mJ.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:gJ.BackgroundTaskTypeSerializer._fromJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:mJ.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:gJ.BackgroundTaskTypeSerializer._toJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:u.updatedAt}}}});var rJ=$((lJ)=>{Object.defineProperty(lJ,"__esModule",{value:!0});lJ.Statistics=void 0;var zR=VJ(),ZR=qJ(),JR=bJ(),DD=g();class jJ{constructor(u){this.requestCtx=u}aggregateAppStats(u,D){let B=new DD.SvixRequest(DD.HttpMethod.POST,"/api/v1/stats/usage/app");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(ZR.AppUsageStatsInSerializer._toJsonObject(u)),B.send(this.requestCtx,JR.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new DD.SvixRequest(DD.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,zR.AggregateEventTypesOutSerializer._fromJsonObject)}}lJ.Statistics=jJ});var pJ=$((iJ)=>{Object.defineProperty(iJ,"__esModule",{value:!0});iJ.HttpSinkHeadersPatchInSerializer=void 0;iJ.HttpSinkHeadersPatchInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var tJ=$((aJ)=>{Object.defineProperty(aJ,"__esModule",{value:!0});aJ.SinkTransformationOutSerializer=void 0;aJ.SinkTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var x8=$((oJ)=>{Object.defineProperty(oJ,"__esModule",{value:!0});oJ.StreamEventTypeOutSerializer=void 0;oJ.StreamEventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:u.updatedAt}}}});var AQ=$((DQ)=>{Object.defineProperty(DQ,"__esModule",{value:!0});DQ.ListResponseStreamEventTypeOutSerializer=void 0;var uQ=x8();DQ.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>uQ.StreamEventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>uQ.StreamEventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var NQ=$((wQ)=>{Object.defineProperty(wQ,"__esModule",{value:!0});wQ.StreamEventTypeInSerializer=void 0;wQ.StreamEventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var vQ=$((GQ)=>{Object.defineProperty(GQ,"__esModule",{value:!0});GQ.StreamEventTypePatchSerializer=void 0;GQ.StreamEventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var WQ=$((JQ)=>{Object.defineProperty(JQ,"__esModule",{value:!0});JQ.StreamingEventType=void 0;var QR=AQ(),zQ=NQ(),BD=x8(),WR=vQ(),E2=g();class ZQ{constructor(u){this.requestCtx=u}list(u){let D=new E2.SvixRequest(E2.HttpMethod.GET,"/api/v1/stream/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived}),D.send(this.requestCtx,QR.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(u,D){let B=new E2.SvixRequest(E2.HttpMethod.POST,"/api/v1/stream/event-type");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(zQ.StreamEventTypeInSerializer._toJsonObject(u)),B.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}get(u){let D=new E2.SvixRequest(E2.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return D.setPathParam("name",u),D.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}update(u,D){let B=new E2.SvixRequest(E2.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setBody(zQ.StreamEventTypeInSerializer._toJsonObject(D)),B.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}delete(u,D){let B=new E2.SvixRequest(E2.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),B.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new E2.SvixRequest(E2.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setBody(WR.StreamEventTypePatchSerializer._toJsonObject(D)),B.send(this.requestCtx,BD.StreamEventTypeOutSerializer._fromJsonObject)}}JQ.StreamingEventType=ZQ});var hQ=$((XQ)=>{Object.defineProperty(XQ,"__esModule",{value:!0});XQ.EventInSerializer=void 0;XQ.EventInSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload}}}});var S8=$((KQ)=>{Object.defineProperty(KQ,"__esModule",{value:!0});KQ.StreamInSerializer=void 0;KQ.StreamInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}}}});var cQ=$((HQ)=>{Object.defineProperty(HQ,"__esModule",{value:!0});HQ.CreateStreamEventsInSerializer=void 0;var SQ=hQ(),RQ=S8();HQ.CreateStreamEventsInSerializer={_fromJsonObject(u){return{events:u.events.map((D)=>SQ.EventInSerializer._fromJsonObject(D)),stream:u.stream!=null?RQ.StreamInSerializer._fromJsonObject(u.stream):void 0}},_toJsonObject(u){return{events:u.events.map((D)=>SQ.EventInSerializer._toJsonObject(D)),stream:u.stream!=null?RQ.StreamInSerializer._toJsonObject(u.stream):void 0}}}});var EQ=$((MQ)=>{Object.defineProperty(MQ,"__esModule",{value:!0});MQ.CreateStreamEventsOutSerializer=void 0;MQ.CreateStreamEventsOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var PQ=$((OQ)=>{Object.defineProperty(OQ,"__esModule",{value:!0});OQ.EventOutSerializer=void 0;OQ.EventOutSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:u.timestamp}}}});var TQ=$((yQ)=>{Object.defineProperty(yQ,"__esModule",{value:!0});yQ.EventStreamOutSerializer=void 0;var kQ=PQ();yQ.EventStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>kQ.EventOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>kQ.EventOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var gQ=$((qQ)=>{Object.defineProperty(qQ,"__esModule",{value:!0});qQ.StreamingEvents=void 0;var XR=cQ(),YR=EQ(),hR=TQ(),AD=g();class IQ{constructor(u){this.requestCtx=u}create(u,D,B){let A=new AD.SvixRequest(AD.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(XR.CreateStreamEventsInSerializer._toJsonObject(D)),A.send(this.requestCtx,YR.CreateStreamEventsOutSerializer._fromJsonObject)}get(u,D,B){let A=new AD.SvixRequest(AD.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,after:B===null||B===void 0?void 0:B.after}),A.send(this.requestCtx,hR.EventStreamOutSerializer._fromJsonObject)}}qQ.StreamingEvents=IQ});var R8=$((_Q)=>{Object.defineProperty(_Q,"__esModule",{value:!0});_Q.AzureBlobStorageConfigSerializer=void 0;_Q.AzureBlobStorageConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var H8=$((bQ)=>{Object.defineProperty(bQ,"__esModule",{value:!0});bQ.GoogleCloudStorageConfigSerializer=void 0;bQ.GoogleCloudStorageConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var U8=$((lQ)=>{Object.defineProperty(lQ,"__esModule",{value:!0});lQ.S3ConfigSerializer=void 0;lQ.S3ConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var c8=$((rQ)=>{Object.defineProperty(rQ,"__esModule",{value:!0});rQ.SinkHttpConfigSerializer=void 0;rQ.SinkHttpConfigSerializer={_fromJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}},_toJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}}}});var M8=$((nQ)=>{Object.defineProperty(nQ,"__esModule",{value:!0});nQ.SinkOtelV1ConfigSerializer=void 0;nQ.SinkOtelV1ConfigSerializer={_fromJsonObject(u){return{headers:u.headers,url:u.url}},_toJsonObject(u){return{headers:u.headers,url:u.url}}}});var L8=$((sQ)=>{Object.defineProperty(sQ,"__esModule",{value:!0});sQ.SinkStatusSerializer=sQ.SinkStatus=void 0;var KR;(function(u){u.Enabled="enabled",u.Paused="paused",u.Disabled="disabled",u.Retrying="retrying"})(KR=sQ.SinkStatus||(sQ.SinkStatus={}));sQ.SinkStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var E8=$((wW)=>{Object.defineProperty(wW,"__esModule",{value:!0});wW.StreamSinkOutSerializer=void 0;var oQ=R8(),eQ=H8(),uW=U8(),DW=c8(),BW=M8(),AW=L8();wW.StreamSinkOutSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return oQ.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return BW.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return DW.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return uW.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return eQ.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,createdAt:new Date(u.createdAt),currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt?new Date(u.nextRetryAt):null,status:AW.SinkStatusSerializer._fromJsonObject(u.status),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=oQ.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=BW.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=DW.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=uW.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=eQ.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,createdAt:u.createdAt,currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt,status:AW.SinkStatusSerializer._toJsonObject(u.status),uid:u.uid,updatedAt:u.updatedAt}}}});var vW=$((GW)=>{Object.defineProperty(GW,"__esModule",{value:!0});GW.ListResponseStreamSinkOutSerializer=void 0;var NW=E8();GW.ListResponseStreamSinkOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>NW.StreamSinkOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>NW.StreamSinkOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var JW=$((zW)=>{Object.defineProperty(zW,"__esModule",{value:!0});zW.SinkSecretOutSerializer=void 0;zW.SinkSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var XW=$((QW)=>{Object.defineProperty(QW,"__esModule",{value:!0});QW.SinkTransformInSerializer=void 0;QW.SinkTransformInSerializer={_fromJsonObject(u){return{code:u.code}},_toJsonObject(u){return{code:u.code}}}});var wD=$((hW)=>{Object.defineProperty(hW,"__esModule",{value:!0});hW.SinkStatusInSerializer=hW.SinkStatusIn=void 0;var xR;(function(u){u.Enabled="enabled",u.Disabled="disabled"})(xR=hW.SinkStatusIn||(hW.SinkStatusIn={}));hW.SinkStatusInSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var EW=$((MW)=>{Object.defineProperty(MW,"__esModule",{value:!0});MW.StreamSinkInSerializer=void 0;var xW=R8(),SW=H8(),RW=U8(),HW=c8(),UW=M8(),cW=wD();MW.StreamSinkInSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return xW.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return UW.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return HW.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return RW.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return SW.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?cW.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=xW.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=UW.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=HW.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=RW.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=SW.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?cW.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var PW=$((OW)=>{Object.defineProperty(OW,"__esModule",{value:!0});OW.AmazonS3PatchConfigSerializer=void 0;OW.AmazonS3PatchConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var VW=$((kW)=>{Object.defineProperty(kW,"__esModule",{value:!0});kW.AzureBlobStoragePatchConfigSerializer=void 0;kW.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var qW=$((TW)=>{Object.defineProperty(TW,"__esModule",{value:!0});TW.GoogleCloudStoragePatchConfigSerializer=void 0;TW.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var _W=$((mW)=>{Object.defineProperty(mW,"__esModule",{value:!0});mW.HttpPatchConfigSerializer=void 0;mW.HttpPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var jW=$((fW)=>{Object.defineProperty(fW,"__esModule",{value:!0});fW.OtelTracingPatchConfigSerializer=void 0;fW.OtelTracingPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var tW=$((aW)=>{Object.defineProperty(aW,"__esModule",{value:!0});aW.StreamSinkPatchSerializer=void 0;var lW=PW(),dW=VW(),rW=qW(),iW=_W(),nW=jW(),pW=wD();aW.StreamSinkPatchSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return dW.AzureBlobStoragePatchConfigSerializer._fromJsonObject(u.config);case"otelTracing":return nW.OtelTracingPatchConfigSerializer._fromJsonObject(u.config);case"http":return iW.HttpPatchConfigSerializer._fromJsonObject(u.config);case"amazonS3":return lW.AmazonS3PatchConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return rW.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?pW.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=dW.AzureBlobStoragePatchConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=nW.OtelTracingPatchConfigSerializer._toJsonObject(u.config);break;case"http":D=iW.HttpPatchConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=lW.AmazonS3PatchConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=rW.GoogleCloudStoragePatchConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?pW.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var AX=$((DX)=>{Object.defineProperty(DX,"__esModule",{value:!0});DX.StreamingSink=void 0;var oW=Q8(),SR=A8(),RR=vW(),HR=JW(),UR=XW(),eW=EW(),FD=E8(),cR=tW(),B2=g();class uX{constructor(u){this.requestCtx=u}list(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return B.setPathParam("stream_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,RR.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(eW.StreamSinkInSerializer._toJsonObject(D)),A.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}get(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}update(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(eW.StreamSinkInSerializer._toJsonObject(B)),A.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}delete(u,D){let B=new B2.SvixRequest(B2.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.sendNoResponseBody(this.requestCtx)}patch(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(cR.StreamSinkPatchSerializer._toJsonObject(B)),A.send(this.requestCtx,FD.StreamSinkOutSerializer._fromJsonObject)}getSecret(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,HR.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new B2.SvixRequest(B2.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return w.setPathParam("stream_id",u),w.setPathParam("sink_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(SR.EndpointSecretRotateInSerializer._toJsonObject(B)),w.send(this.requestCtx,oW.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(UR.SinkTransformInSerializer._toJsonObject(B)),A.send(this.requestCtx,oW.EmptyResponseSerializer._fromJsonObject)}}DX.StreamingSink=uX});var O8=$((wX)=>{Object.defineProperty(wX,"__esModule",{value:!0});wX.StreamOutSerializer=void 0;wX.StreamOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var vX=$((GX)=>{Object.defineProperty(GX,"__esModule",{value:!0});GX.ListResponseStreamOutSerializer=void 0;var NX=O8();GX.ListResponseStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>NX.StreamOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>NX.StreamOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var JX=$((zX)=>{Object.defineProperty(zX,"__esModule",{value:!0});zX.StreamPatchSerializer=void 0;zX.StreamPatchSerializer={_fromJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}},_toJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}}}});var hX=$((XX)=>{Object.defineProperty(XX,"__esModule",{value:!0});XX.StreamingStream=void 0;var MR=vX(),QX=S8(),ND=O8(),LR=JX(),O2=g();class WX{constructor(u){this.requestCtx=u}list(u){let D=new O2.SvixRequest(O2.HttpMethod.GET,"/api/v1/stream");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,MR.ListResponseStreamOutSerializer._fromJsonObject)}create(u,D){let B=new O2.SvixRequest(O2.HttpMethod.POST,"/api/v1/stream");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(QX.StreamInSerializer._toJsonObject(u)),B.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}get(u){let D=new O2.SvixRequest(O2.HttpMethod.GET,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}update(u,D){let B=new O2.SvixRequest(O2.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return B.setPathParam("stream_id",u),B.setBody(QX.StreamInSerializer._toJsonObject(D)),B.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}delete(u){let D=new O2.SvixRequest(O2.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new O2.SvixRequest(O2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return B.setPathParam("stream_id",u),B.setBody(LR.StreamPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,ND.StreamOutSerializer._fromJsonObject)}}XX.StreamingStream=WX});var HX=$((SX)=>{Object.defineProperty(SX,"__esModule",{value:!0});SX.Streaming=void 0;var KX=D8(),ER=pJ(),OR=tJ(),CR=WQ(),PR=gQ(),kR=AX(),yR=hX(),T0=g();class xX{constructor(u){this.requestCtx=u}get event_type(){return new CR.StreamingEventType(this.requestCtx)}get events(){return new PR.StreamingEvents(this.requestCtx)}get sink(){return new kR.StreamingSink(this.requestCtx)}get stream(){return new yR.StreamingStream(this.requestCtx)}sinkHeadersGet(u,D){let B=new T0.SvixRequest(T0.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,KX.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(u,D,B){let A=new T0.SvixRequest(T0.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(ER.HttpSinkHeadersPatchInSerializer._toJsonObject(B)),A.send(this.requestCtx,KX.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(u,D){let B=new T0.SvixRequest(T0.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,OR.SinkTransformationOutSerializer._fromJsonObject)}}SX.Streaming=xX});var MX=$((UX)=>{Object.defineProperty(UX,"__esModule",{value:!0});UX.HTTPValidationError=UX.ValidationError=UX.HttpErrorOut=void 0;class I0{static getAttributeTypeMap(){return I0.attributeTypeMap}}UX.HttpErrorOut=I0;I0.discriminator=void 0;I0.mapping=void 0;I0.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];class q0{static getAttributeTypeMap(){return q0.attributeTypeMap}}UX.ValidationError=q0;q0.discriminator=void 0;q0.mapping=void 0;q0.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];class m0{static getAttributeTypeMap(){return m0.attributeTypeMap}}UX.HTTPValidationError=m0;m0.discriminator=void 0;m0.mapping=void 0;m0.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var CX=$((EX)=>{Object.defineProperty(EX,"__esModule",{value:!0});EX.timingSafeEqual=void 0;function LX(u,D=""){if(!u)throw Error(D)}function IR(u,D){if(u.byteLength!==D.byteLength)return!1;if(!(u instanceof DataView))u=new DataView(ArrayBuffer.isView(u)?u.buffer:u);if(!(D instanceof DataView))D=new DataView(ArrayBuffer.isView(D)?D.buffer:D);LX(u instanceof DataView),LX(D instanceof DataView);let B=u.byteLength,A=0,w=-1;while(++w<B)A|=u.getUint8(w)^D.getUint8(w);return A===0}EX.timingSafeEqual=IR});var yX=$((h2)=>{var qR=h2&&h2.__extends||function(){var u=function(D,B){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,w){A.__proto__=w}||function(A,w){for(var F in w)if(w.hasOwnProperty(F))A[F]=w[F]},u(D,B)};return function(D,B){u(D,B);function A(){this.constructor=D}D.prototype=B===null?Object.create(B):(A.prototype=B.prototype,new A)}}();Object.defineProperty(h2,"__esModule",{value:!0});var i=256,C8=function(){function u(D){if(D===void 0)D="=";this._paddingCharacter=D}return u.prototype.encodedLength=function(D){if(!this._paddingCharacter)return(D*8+5)/6|0;return(D+2)/3*4|0},u.prototype.encode=function(D){var B="",A=0;for(;A<D.length-2;A+=3){var w=D[A]<<16|D[A+1]<<8|D[A+2];B+=this._encodeByte(w>>>18&63),B+=this._encodeByte(w>>>12&63),B+=this._encodeByte(w>>>6&63),B+=this._encodeByte(w>>>0&63)}var F=D.length-A;if(F>0){var w=D[A]<<16|(F===2?D[A+1]<<8:0);if(B+=this._encodeByte(w>>>18&63),B+=this._encodeByte(w>>>12&63),F===2)B+=this._encodeByte(w>>>6&63);else B+=this._paddingCharacter||"";B+=this._paddingCharacter||""}return B},u.prototype.maxDecodedLength=function(D){if(!this._paddingCharacter)return(D*6+7)/8|0;return D/4*3|0},u.prototype.decodedLength=function(D){return this.maxDecodedLength(D.length-this._getPaddingLength(D))},u.prototype.decode=function(D){if(D.length===0)return new Uint8Array(0);var B=this._getPaddingLength(D),A=D.length-B,w=new Uint8Array(this.maxDecodedLength(A)),F=0,N=0,G=0,v=0,z=0,Q=0,Z=0;for(;N<A-4;N+=4)v=this._decodeChar(D.charCodeAt(N+0)),z=this._decodeChar(D.charCodeAt(N+1)),Q=this._decodeChar(D.charCodeAt(N+2)),Z=this._decodeChar(D.charCodeAt(N+3)),w[F++]=v<<2|z>>>4,w[F++]=z<<4|Q>>>2,w[F++]=Q<<6|Z,G|=v&i,G|=z&i,G|=Q&i,G|=Z&i;if(N<A-1)v=this._decodeChar(D.charCodeAt(N)),z=this._decodeChar(D.charCodeAt(N+1)),w[F++]=v<<2|z>>>4,G|=v&i,G|=z&i;if(N<A-2)Q=this._decodeChar(D.charCodeAt(N+2)),w[F++]=z<<4|Q>>>2,G|=Q&i;if(N<A-3)Z=this._decodeChar(D.charCodeAt(N+3)),w[F++]=Q<<6|Z,G|=Z&i;if(G!==0)throw Error("Base64Coder: incorrect characters for decoding");return w},u.prototype._encodeByte=function(D){var B=D;return B+=65,B+=25-D>>>8&6,B+=51-D>>>8&-75,B+=61-D>>>8&-15,B+=62-D>>>8&3,String.fromCharCode(B)},u.prototype._decodeChar=function(D){var B=i;return B+=(42-D&D-44)>>>8&-i+D-43+62,B+=(46-D&D-48)>>>8&-i+D-47+63,B+=(47-D&D-58)>>>8&-i+D-48+52,B+=(64-D&D-91)>>>8&-i+D-65+0,B+=(96-D&D-123)>>>8&-i+D-97+26,B},u.prototype._getPaddingLength=function(D){var B=0;if(this._paddingCharacter){for(var A=D.length-1;A>=0;A--){if(D[A]!==this._paddingCharacter)break;B++}if(D.length<4||B>2)throw Error("Base64Coder: incorrect padding")}return B},u}();h2.Coder=C8;var cu=new C8;function mR(u){return cu.encode(u)}h2.encode=mR;function gR(u){return cu.decode(u)}h2.decode=gR;var PX=function(u){qR(D,u);function D(){return u!==null&&u.apply(this,arguments)||this}return D.prototype._encodeByte=function(B){var A=B;return A+=65,A+=25-B>>>8&6,A+=51-B>>>8&-75,A+=61-B>>>8&-13,A+=62-B>>>8&49,String.fromCharCode(A)},D.prototype._decodeChar=function(B){var A=i;return A+=(44-B&B-46)>>>8&-i+B-45+62,A+=(94-B&B-96)>>>8&-i+B-95+63,A+=(47-B&B-58)>>>8&-i+B-48+52,A+=(64-B&B-91)>>>8&-i+B-65+0,A+=(96-B&B-123)>>>8&-i+B-97+26,A},D}(C8);h2.URLSafeCoder=PX;var kX=new PX;function _R(u){return kX.encode(u)}h2.encodeURLSafe=_R;function fR(u){return kX.decode(u)}h2.decodeURLSafe=fR;h2.encodedLength=function(u){return cu.encodedLength(u)};h2.maxDecodedLength=function(u){return cu.maxDecodedLength(u)};h2.decodedLength=function(u){return cu.decodedLength(u)}});var TX=$((VX,GD)=>{(function(u,D){var B={};D(B);var A=B.default;for(var w in B)A[w]=B[w];if(typeof GD==="object"&&typeof GD.exports==="object")GD.exports=A;else if(typeof define==="function"&&define.amd)define(function(){return A});else u.sha256=A})(VX,function(u){u.__esModule=!0,u.digestLength=32,u.blockSize=64;var D=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function B(Z,J,W,Y,M){var x,L,S,y,_,V,x2,a,F2,s,o0,e0,qu;while(M>=64){x=J[0],L=J[1],S=J[2],y=J[3],_=J[4],V=J[5],x2=J[6],a=J[7];for(s=0;s<16;s++)o0=Y+s*4,Z[s]=(W[o0]&255)<<24|(W[o0+1]&255)<<16|(W[o0+2]&255)<<8|W[o0+3]&255;for(s=16;s<64;s++)F2=Z[s-2],e0=(F2>>>17|F2<<15)^(F2>>>19|F2<<13)^F2>>>10,F2=Z[s-15],qu=(F2>>>7|F2<<25)^(F2>>>18|F2<<14)^F2>>>3,Z[s]=(e0+Z[s-7]|0)+(qu+Z[s-16]|0);for(s=0;s<64;s++)e0=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&V^~_&x2)|0)+(a+(D[s]+Z[s]|0)|0)|0,qu=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))+(x&L^x&S^L&S)|0,a=x2,x2=V,V=_,_=y+e0|0,y=S,S=L,L=x,x=e0+qu|0;J[0]+=x,J[1]+=L,J[2]+=S,J[3]+=y,J[4]+=_,J[5]+=V,J[6]+=x2,J[7]+=a,Y+=64,M-=64}return Y}var A=function(){function Z(){this.digestLength=u.digestLength,this.blockSize=u.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return Z.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},Z.prototype.clean=function(){for(var J=0;J<this.buffer.length;J++)this.buffer[J]=0;for(var J=0;J<this.temp.length;J++)this.temp[J]=0;this.reset()},Z.prototype.update=function(J,W){if(W===void 0)W=J.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var Y=0;if(this.bytesHashed+=W,this.bufferLength>0){while(this.bufferLength<64&&W>0)this.buffer[this.bufferLength++]=J[Y++],W--;if(this.bufferLength===64)B(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(W>=64)Y=B(this.temp,this.state,J,Y,W),W%=64;while(W>0)this.buffer[this.bufferLength++]=J[Y++],W--;return this},Z.prototype.finish=function(J){if(!this.finished){var W=this.bytesHashed,Y=this.bufferLength,M=W/536870912|0,x=W<<3,L=W%64<56?64:128;this.buffer[Y]=128;for(var S=Y+1;S<L-8;S++)this.buffer[S]=0;this.buffer[L-8]=M>>>24&255,this.buffer[L-7]=M>>>16&255,this.buffer[L-6]=M>>>8&255,this.buffer[L-5]=M>>>0&255,this.buffer[L-4]=x>>>24&255,this.buffer[L-3]=x>>>16&255,this.buffer[L-2]=x>>>8&255,this.buffer[L-1]=x>>>0&255,B(this.temp,this.state,this.buffer,0,L),this.finished=!0}for(var S=0;S<8;S++)J[S*4+0]=this.state[S]>>>24&255,J[S*4+1]=this.state[S]>>>16&255,J[S*4+2]=this.state[S]>>>8&255,J[S*4+3]=this.state[S]>>>0&255;return this},Z.prototype.digest=function(){var J=new Uint8Array(this.digestLength);return this.finish(J),J},Z.prototype._saveState=function(J){for(var W=0;W<this.state.length;W++)J[W]=this.state[W]},Z.prototype._restoreState=function(J,W){for(var Y=0;Y<this.state.length;Y++)this.state[Y]=J[Y];this.bytesHashed=W,this.finished=!1,this.bufferLength=0},Z}();u.Hash=A;var w=function(){function Z(J){this.inner=new A,this.outer=new A,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var W=new Uint8Array(this.blockSize);if(J.length>this.blockSize)new A().update(J).finish(W).clean();else for(var Y=0;Y<J.length;Y++)W[Y]=J[Y];for(var Y=0;Y<W.length;Y++)W[Y]^=54;this.inner.update(W);for(var Y=0;Y<W.length;Y++)W[Y]^=106;this.outer.update(W),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var Y=0;Y<W.length;Y++)W[Y]=0}return Z.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},Z.prototype.clean=function(){for(var J=0;J<this.istate.length;J++)this.ostate[J]=this.istate[J]=0;this.inner.clean(),this.outer.clean()},Z.prototype.update=function(J){return this.inner.update(J),this},Z.prototype.finish=function(J){if(this.outer.finished)this.outer.finish(J);else this.inner.finish(J),this.outer.update(J,this.digestLength).finish(J);return this},Z.prototype.digest=function(){var J=new Uint8Array(this.digestLength);return this.finish(J),J},Z}();u.HMAC=w;function F(Z){var J=new A().update(Z),W=J.digest();return J.clean(),W}u.hash=F,u.default=F;function N(Z,J){var W=new w(Z).update(J),Y=W.digest();return W.clean(),Y}u.hmac=N;function G(Z,J,W,Y){var M=Y[0];if(M===0)throw Error("hkdf: cannot expand more");if(J.reset(),M>1)J.update(Z);if(W)J.update(W);J.update(Y),J.finish(Z),Y[0]++}var v=new Uint8Array(u.digestLength);function z(Z,J,W,Y){if(J===void 0)J=v;if(Y===void 0)Y=32;var M=new Uint8Array([1]),x=N(J,Z),L=new w(x),S=new Uint8Array(L.digestLength),y=S.length,_=new Uint8Array(Y);for(var V=0;V<Y;V++){if(y===S.length)G(S,L,W,M),y=0;_[V]=S[y++]}return L.clean(),S.fill(0),M.fill(0),_}u.hkdf=z;function Q(Z,J,W,Y){var M=new w(Z),x=M.digestLength,L=new Uint8Array(4),S=new Uint8Array(x),y=new Uint8Array(x),_=new Uint8Array(Y);for(var V=0;V*x<Y;V++){var x2=V+1;L[0]=x2>>>24&255,L[1]=x2>>>16&255,L[2]=x2>>>8&255,L[3]=x2>>>0&255,M.reset(),M.update(J),M.update(L),M.finish(y);for(var a=0;a<x;a++)S[a]=y[a];for(var a=2;a<=W;a++){M.reset(),M.update(y).finish(y);for(var F2=0;F2<x;F2++)S[F2]^=y[F2]}for(var a=0;a<x&&V*x+a<Y;a++)_[V*x+a]=S[a]}for(var V=0;V<x;V++)S[V]=y[V]=0;for(var V=0;V<4;V++)L[V]=0;return M.clean(),_}u.pbkdf2=Q})});var k8=$((mX)=>{Object.defineProperty(mX,"__esModule",{value:!0});mX.Webhook=mX.WebhookVerificationError=void 0;var bR=CX(),IX=yX(),jR=TX(),qX=300;class P8 extends Error{constructor(u){super(u);Object.setPrototypeOf(this,P8.prototype),this.name="ExtendableError",this.stack=Error(u).stack}}class t2 extends P8{constructor(u){super(u);Object.setPrototypeOf(this,t2.prototype),this.name="WebhookVerificationError"}}mX.WebhookVerificationError=t2;class Mu{constructor(u,D){if(!u)throw Error("Secret can't be empty.");if((D===null||D===void 0?void 0:D.format)==="raw")if(u instanceof Uint8Array)this.key=u;else this.key=Uint8Array.from(u,(B)=>B.charCodeAt(0));else{if(typeof u!=="string")throw Error("Expected secret to be of type string");if(u.startsWith(Mu.prefix))u=u.substring(Mu.prefix.length);this.key=IX.decode(u)}}verify(u,D){let B={};for(let Z of Object.keys(D))B[Z.toLowerCase()]=D[Z];let A=B["webhook-id"],w=B["webhook-signature"],F=B["webhook-timestamp"];if(!w||!A||!F)throw new t2("Missing required headers");let N=this.verifyTimestamp(F),v=this.sign(A,N,u).split(",")[1],z=w.split(" "),Q=new globalThis.TextEncoder;for(let Z of z){let[J,W]=Z.split(",");if(J!=="v1")continue;if((0,bR.timingSafeEqual)(Q.encode(W),Q.encode(v)))return JSON.parse(u.toString())}throw new t2("No matching signature found")}sign(u,D,B){if(typeof B==="string");else if(B.constructor.name==="Buffer")B=B.toString();else throw Error("Expected payload to be of type string or Buffer.");let A=new TextEncoder,w=Math.floor(D.getTime()/1000),F=A.encode(`${u}.${w}.${B}`);return`v1,${IX.encode(jR.hmac(this.key,F))}`}verifyTimestamp(u){let D=Math.floor(Date.now()/1000),B=parseInt(u,10);if(isNaN(B))throw new t2("Invalid Signature Headers");if(D-B>qX)throw new t2("Message timestamp too old");if(B>D+qX)throw new t2("Message timestamp too new");return new Date(B*1000)}}mX.Webhook=Mu;Mu.prefix="whsec_"});var bX=$((y8)=>{Object.defineProperty(y8,"__esModule",{value:!0});y8.Webhook=y8.WebhookVerificationError=void 0;var dR=k8(),rR=k8();Object.defineProperty(y8,"WebhookVerificationError",{enumerable:!0,get:function(){return rR.WebhookVerificationError}});class _X{constructor(u,D){this.inner=new dR.Webhook(u,D)}verify(u,D){var B,A,w,F,N,G;let v={};for(let z of Object.keys(D))v[z.toLowerCase()]=D[z];return v["webhook-id"]=(A=(B=v["svix-id"])!==null&&B!==void 0?B:v["webhook-id"])!==null&&A!==void 0?A:"",v["webhook-signature"]=(F=(w=v["svix-signature"])!==null&&w!==void 0?w:v["webhook-signature"])!==null&&F!==void 0?F:"",v["webhook-timestamp"]=(G=(N=v["svix-timestamp"])!==null&&N!==void 0?N:v["webhook-timestamp"])!==null&&G!==void 0?G:"",this.inner.verify(u,v)}sign(u,D,B){return this.inner.sign(u,D,B)}}y8.Webhook=_X});var rX=$((lX)=>{Object.defineProperty(lX,"__esModule",{value:!0});lX.EndpointDisabledTriggerSerializer=lX.EndpointDisabledTrigger=void 0;var iR;(function(u){u.Manual="manual",u.Automatic="automatic"})(iR=lX.EndpointDisabledTrigger||(lX.EndpointDisabledTrigger={}));lX.EndpointDisabledTriggerSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var aX=$((nX)=>{Object.defineProperty(nX,"__esModule",{value:!0});nX.OrderingSerializer=nX.Ordering=void 0;var nR;(function(u){u.Ascending="ascending",u.Descending="descending"})(nR=nX.Ordering||(nX.Ordering={}));nX.OrderingSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var sX=$((v2)=>{Object.defineProperty(v2,"__esModule",{value:!0});v2.StatusCodeClass=v2.SinkStatusIn=v2.SinkStatus=v2.Ordering=v2.MessageStatusText=v2.MessageStatus=v2.MessageAttemptTriggerType=v2.EndpointDisabledTrigger=v2.ConnectorProduct=v2.ConnectorKind=v2.BackgroundTaskType=v2.BackgroundTaskStatus=v2.AppPortalCapability=void 0;var pR=s3();Object.defineProperty(v2,"AppPortalCapability",{enumerable:!0,get:function(){return pR.AppPortalCapability}});var aR=a2();Object.defineProperty(v2,"BackgroundTaskStatus",{enumerable:!0,get:function(){return aR.BackgroundTaskStatus}});var sR=s2();Object.defineProperty(v2,"BackgroundTaskType",{enumerable:!0,get:function(){return sR.BackgroundTaskType}});var tR=k0();Object.defineProperty(v2,"ConnectorKind",{enumerable:!0,get:function(){return tR.ConnectorKind}});var oR=p1();Object.defineProperty(v2,"ConnectorProduct",{enumerable:!0,get:function(){return oR.ConnectorProduct}});var eR=rX();Object.defineProperty(v2,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return eR.EndpointDisabledTrigger}});var uH=W8();Object.defineProperty(v2,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return uH.MessageAttemptTriggerType}});var DH=y0();Object.defineProperty(v2,"MessageStatus",{enumerable:!0,get:function(){return DH.MessageStatus}});var BH=Uu();Object.defineProperty(v2,"MessageStatusText",{enumerable:!0,get:function(){return BH.MessageStatusText}});var AH=aX();Object.defineProperty(v2,"Ordering",{enumerable:!0,get:function(){return AH.Ordering}});var wH=L8();Object.defineProperty(v2,"SinkStatus",{enumerable:!0,get:function(){return wH.SinkStatus}});var FH=wD();Object.defineProperty(v2,"SinkStatusIn",{enumerable:!0,get:function(){return FH.SinkStatusIn}});var NH=u8();Object.defineProperty(v2,"StatusCodeClass",{enumerable:!0,get:function(){return NH.StatusCodeClass}})});var eX=$((n)=>{var $H=n&&n.__createBinding||(Object.create?function(u,D,B,A){if(A===void 0)A=B;var w=Object.getOwnPropertyDescriptor(D,B);if(!w||("get"in w?!D.__esModule:w.writable||w.configurable))w={enumerable:!0,get:function(){return D[B]}};Object.defineProperty(u,A,w)}:function(u,D,B,A){if(A===void 0)A=B;u[A]=D[B]}),tX=n&&n.__exportStar||function(u,D){for(var B in u)if(B!=="default"&&!Object.prototype.hasOwnProperty.call(D,B))$H(D,u,B)};Object.defineProperty(n,"__esModule",{value:!0});n.Svix=n.messageInRaw=n.ValidationError=n.HttpErrorOut=n.HTTPValidationError=n.ApiException=void 0;var vH=s6(),zH=PA(),ZH=pA(),JH=cw(),QH=nF(),WH=Z7(),XH=_7(),YH=d7(),hH=Az(),KH=Uz(),xH=J8(),SH=tZ(),RH=OJ(),HH=rJ(),UH=HX(),cH=K8(),MH=n3();Object.defineProperty(n,"ApiException",{enumerable:!0,get:function(){return MH.ApiException}});var V8=MX();Object.defineProperty(n,"HTTPValidationError",{enumerable:!0,get:function(){return V8.HTTPValidationError}});Object.defineProperty(n,"HttpErrorOut",{enumerable:!0,get:function(){return V8.HttpErrorOut}});Object.defineProperty(n,"ValidationError",{enumerable:!0,get:function(){return V8.ValidationError}});tX(bX(),n);tX(sX(),n);var LH=J8();Object.defineProperty(n,"messageInRaw",{enumerable:!0,get:function(){return LH.messageInRaw}});var EH=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}];class oX{constructor(u,D={}){var B,A,w;let F=(B=EH.find((G)=>G.region===u.split(".")[1]))===null||B===void 0?void 0:B.url,N=(w=(A=D.serverUrl)!==null&&A!==void 0?A:F)!==null&&w!==void 0?w:"https://api.svix.com";if(D.retryScheduleInMs){this.requestCtx={baseUrl:N,token:u,timeout:D.requestTimeout,retryScheduleInMs:D.retryScheduleInMs,fetch:D.fetch};return}if(D.numRetries){this.requestCtx={baseUrl:N,token:u,timeout:D.requestTimeout,numRetries:D.numRetries,fetch:D.fetch};return}this.requestCtx={baseUrl:N,token:u,timeout:D.requestTimeout,fetch:D.fetch}}get application(){return new vH.Application(this.requestCtx)}get authentication(){return new zH.Authentication(this.requestCtx)}get backgroundTask(){return new ZH.BackgroundTask(this.requestCtx)}get connector(){return new JH.Connector(this.requestCtx)}get endpoint(){return new QH.Endpoint(this.requestCtx)}get environment(){return new WH.Environment(this.requestCtx)}get eventType(){return new XH.EventType(this.requestCtx)}get health(){return new YH.Health(this.requestCtx)}get ingest(){return new hH.Ingest(this.requestCtx)}get integration(){return new KH.Integration(this.requestCtx)}get message(){return new xH.Message(this.requestCtx)}get messageAttempt(){return new SH.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new RH.OperationalWebhook(this.requestCtx)}get statistics(){return new HH.Statistics(this.requestCtx)}get streaming(){return new UH.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new cH.OperationalWebhookEndpoint(this.requestCtx)}}n.Svix=oX});class Q0{}import{readdir as Dh}from"fs/promises";class mu extends Q0{folderPath;constructor(u=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=u}async put(u){let D,B;if(u instanceof Blob)D=u,B=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`;else D=u.body,B=u.name;let A=D instanceof Buffer?D:D instanceof Blob||D instanceof File?Buffer.from(await D.arrayBuffer()):"",w=`${this.folderPath}/${B}`;return await Bun.write(w,A),B}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=`${this.folderPath}/${B}`,w=Bun.file(A),F=Bun.file(A).stream(),N=new Date(w.lastModified).toUTCString();return new Response(F,{headers:{"Content-Type":w.type,"Content-Length":String(w.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":N}})}async list(){return await Dh(this.folderPath)}}class m5 extends f{driver=new mu;boot(){}}var g5=X(m2(),1);function Bh(u){return(D)=>async(B)=>{let{request:A}=B;if(u.expectContinueHeader!==!1&&g5.HttpRequest.isInstance(A)&&A.body&&u.runtime==="node"&&u.requestHandler?.constructor?.name!=="FetchHttpHandler"){let w=!0;if(typeof u.expectContinueHeader==="number")try{w=(Number(A.headers?.["content-length"])??u.bodyLengthChecker?.(A.body)??1/0)>=u.expectContinueHeader}catch(F){}else w=!!u.expectContinueHeader;if(w)A.headers.Expect="100-continue"}return D({...B,request:A})}}var Ah={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},_5=(u)=>({applyToStack:(D)=>{D.add(Bh(u),Ah)}});var S2={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},gu=S2.WHEN_SUPPORTED,A0={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},_u=S2.WHEN_SUPPORTED,k;(function(u){u.MD5="MD5",u.CRC32="CRC32",u.CRC32C="CRC32C",u.CRC64NVME="CRC64NVME",u.SHA1="SHA1",u.SHA256="SHA256"})(k||(k={}));var f5;(function(u){u.HEADER="header",u.TRAILER="trailer"})(f5||(f5={}));var uu=k.CRC32;var f2;(function(u){u.ENV="env",u.CONFIG="shared config entry"})(f2||(f2={}));var W0=(u,D,B,A)=>{if(!(D in u))return;let w=u[D].toUpperCase();if(!Object.values(B).includes(w))throw TypeError(`Cannot load ${A} '${D}'. Expected one of ${Object.values(B)}, got '${u[D]}'.`);return w};var wh="AWS_REQUEST_CHECKSUM_CALCULATION",Fh="request_checksum_calculation",b5={environmentVariableSelector:(u)=>W0(u,wh,S2,f2.ENV),configFileSelector:(u)=>W0(u,Fh,S2,f2.CONFIG),default:gu};var Nh="AWS_RESPONSE_CHECKSUM_VALIDATION",Gh="response_checksum_validation",j5={environmentVariableSelector:(u)=>W0(u,Nh,A0,f2.ENV),configFileSelector:(u)=>W0(u,Gh,A0,f2.CONFIG),default:_u};var X0=X(Y0(),1),u4=X(m2(),1),D4=X(iu(),1);var l5=(u,{requestChecksumRequired:D,requestAlgorithmMember:B,requestChecksumCalculation:A})=>{if(!B)return A===S2.WHEN_SUPPORTED||D?uu:void 0;if(!u[B])return;return u[B]};var w0=(u)=>u===k.MD5?"content-md5":`x-amz-checksum-${u.toLowerCase()}`;var d5=(u,D)=>{let B=u.toLowerCase();for(let A of Object.keys(D))if(B===A.toLowerCase())return!0;return!1};var r5=(u,D)=>{let B=u.toLowerCase();for(let A of Object.keys(D))if(A.toLowerCase().startsWith(B))return!0;return!1};var i5=X($h(),1),fu=(u)=>u!==void 0&&typeof u!=="string"&&!ArrayBuffer.isView(u)&&!i5.isArrayBuffer(u);var n5=X(vh(),1),{__extends:fU,__assign:bU,__rest:jU,__decorate:lU,__param:dU,__esDecorate:rU,__runInitializers:iU,__propKey:nU,__setFunctionName:pU,__metadata:aU,__awaiter:bu,__generator:ju,__exportStar:sU,__createBinding:tU,__values:lu,__read:oU,__spread:eU,__spreadArrays:uc,__spreadArray:Dc,__await:Bc,__asyncGenerator:Ac,__asyncDelegator:wc,__asyncValues:Fc,__makeTemplateObject:Nc,__importStar:Gc,__importDefault:$c,__classPrivateFieldGet:vc,__classPrivateFieldSet:zc,__classPrivateFieldIn:Zc,__addDisposableResource:Jc,__disposeResources:Qc,__rewriteRelativeImportExtension:Wc}=n5.default;import{Buffer as p5}from"buffer";var a5=(u,D)=>{if(typeof u!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof u} (${u})`);return D?p5.from(u,D):p5.from(u)};var PD=(u)=>{let D=a5(u,"utf8");return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var zh=typeof Buffer<"u"&&Buffer.from?function(u){return Buffer.from(u,"utf8")}:PD;function Du(u){if(u instanceof Uint8Array)return u;if(typeof u==="string")return zh(u);if(ArrayBuffer.isView(u))return new Uint8Array(u.buffer,u.byteOffset,u.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(u)}function Bu(u){if(typeof u==="string")return u.length===0;return u.byteLength===0}function F0(u){return new Uint8Array([(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255])}function Au(u){if(!Uint32Array.from){var D=new Uint32Array(u.length),B=0;while(B<u.length)D[B]=u[B],B+=1;return D}return Uint32Array.from(u)}var yD=function(){function u(){this.crc32c=new kD}return u.prototype.update=function(D){if(Bu(D))return;this.crc32c.update(Du(D))},u.prototype.digest=function(){return bu(this,void 0,void 0,function(){return ju(this,function(D){return[2,F0(this.crc32c.digest())]})})},u.prototype.reset=function(){this.crc32c=new kD},u}();var kD=function(){function u(){this.checksum=4294967295}return u.prototype.update=function(D){var B,A;try{for(var w=lu(D),F=w.next();!F.done;F=w.next()){var N=F.value;this.checksum=this.checksum>>>8^Jh[(this.checksum^N)&255]}}catch(G){B={error:G}}finally{try{if(F&&!F.done&&(A=w.return))A.call(w)}finally{if(B)throw B.error}}return this},u.prototype.digest=function(){return(this.checksum^4294967295)>>>0},u}();var Zh=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],Jh=Au(Zh);var Qh=()=>{let D=[,,,,,,,,];for(let B=0;B<8;B++){let A=Array(512);for(let w=0;w<256;w++){let F=BigInt(w);for(let N=0;N<8*(B+1);N++)if(F&1n)F=F>>1n^0x9a6c9329ac4bc9b5n;else F=F>>1n;A[w*2]=Number(F>>32n&0xffffffffn),A[w*2+1]=Number(F&0xffffffffn)}D[B]=new Uint32Array(A)}return D},VD,wu,TD,ID,qD,mD,gD,_D,fD,Wh=()=>{if(!VD)VD=Qh(),[wu,TD,ID,qD,mD,gD,_D,fD]=VD};class bD{c1=0;c2=0;constructor(){Wh(),this.reset()}update(u){let D=u.length,B=0,A=this.c1,w=this.c2;while(B+8<=D){let F=((w^u[B++])&255)<<1,N=((w>>>8^u[B++])&255)<<1,G=((w>>>16^u[B++])&255)<<1,v=((w>>>24^u[B++])&255)<<1,z=((A^u[B++])&255)<<1,Q=((A>>>8^u[B++])&255)<<1,Z=((A>>>16^u[B++])&255)<<1,J=((A>>>24^u[B++])&255)<<1;A=fD[F]^_D[N]^gD[G]^mD[v]^qD[z]^ID[Q]^TD[Z]^wu[J],w=fD[F+1]^_D[N+1]^gD[G+1]^mD[v+1]^qD[z+1]^ID[Q+1]^TD[Z+1]^wu[J+1]}while(B<D){let F=((w^u[B])&255)<<1;w=(w>>>8|(A&255)<<24)>>>0,A=A>>>8^wu[F],w^=wu[F+1],B++}this.c1=A,this.c2=w}async digest(){let u=this.c1^4294967295,D=this.c2^4294967295;return new Uint8Array([u>>>24,u>>>16&255,u>>>8&255,u&255,D>>>24,D>>>16&255,D>>>8&255,D&255])}reset(){this.c1=4294967295,this.c2=4294967295}}var jD={CrtCrc64Nvme:null};var lD=function(){function u(){this.crc32=new N0}return u.prototype.update=function(D){if(Bu(D))return;this.crc32.update(Du(D))},u.prototype.digest=function(){return bu(this,void 0,void 0,function(){return ju(this,function(D){return[2,F0(this.crc32.digest())]})})},u.prototype.reset=function(){this.crc32=new N0},u}();var N0=function(){function u(){this.checksum=4294967295}return u.prototype.update=function(D){var B,A;try{for(var w=lu(D),F=w.next();!F.done;F=w.next()){var N=F.value;this.checksum=this.checksum>>>8^Yh[(this.checksum^N)&255]}}catch(G){B={error:G}}finally{try{if(F&&!F.done&&(A=w.return))A.call(w)}finally{if(B)throw B.error}}return this},u.prototype.digest=function(){return(this.checksum^4294967295)>>>0},u}();var Xh=[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,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],Yh=Au(Xh);import*as dD from"zlib";class s5{checksum=0;update(u){this.checksum=dD.crc32(u,this.checksum)}async digest(){return F0(this.checksum)}reset(){this.checksum=0}}var t5=()=>{if(typeof dD.crc32>"u")return lD;return s5};var o5=[k.CRC32,k.CRC32C,k.CRC64NVME,k.SHA1,k.SHA256],rD=[k.SHA256,k.SHA1,k.CRC32,k.CRC32C,k.CRC64NVME];var du=(u,D)=>{let{checksumAlgorithms:B={}}=D;switch(u){case k.MD5:return B?.MD5??D.md5;case k.CRC32:return B?.CRC32??t5();case k.CRC32C:return B?.CRC32C??yD;case k.CRC64NVME:if(typeof jD.CrtCrc64Nvme!=="function")return B?.CRC64NVME??bD;return B?.CRC64NVME??jD.CrtCrc64Nvme;case k.SHA1:return B?.SHA1??D.sha1;case k.SHA256:return B?.SHA256??D.sha256;default:if(B?.[u])return B[u];throw Error(`The checksum algorithm "${u}" is not supported by the client. Select one of ${o5}, or provide an implementation to the client constructor checksums field.`)}};var e5=X(iD(),1),ru=(u,D)=>{let B=new u;return B.update(e5.toUint8Array(D||"")),B.digest()};var B4={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},A4=(u,D)=>(B,A)=>async(w)=>{if(!u4.HttpRequest.isInstance(w.request))return B(w);if(r5("x-amz-checksum-",w.request.headers))return B(w);let{request:F,input:N}=w,{body:G,headers:v}=F,{base64Encoder:z,streamHasher:Q}=u,{requestChecksumRequired:Z,requestAlgorithmMember:J}=D,W=await u.requestChecksumCalculation(),Y=J?.name,M=J?.httpHeader;if(Y&&!N[Y]){if(W===S2.WHEN_SUPPORTED||Z){if(N[Y]=uu,M)v[M]=uu}}let x=l5(N,{requestChecksumRequired:Z,requestAlgorithmMember:J?.name,requestChecksumCalculation:W}),L=G,S=v;if(x){switch(x){case k.CRC32:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case k.CRC32C:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case k.CRC64NVME:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case k.SHA1:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case k.SHA256:X0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}let y=w0(x),_=du(x,u);if(fu(G)){let{getAwsChunkedEncodingStream:V,bodyLengthChecker:x2}=u;L=V(typeof u.requestStreamBufferSize==="number"&&u.requestStreamBufferSize>=8192?D4.createBufferedReadable(G,u.requestStreamBufferSize,A.logger):G,{base64Encoder:z,bodyLengthChecker:x2,checksumLocationName:y,checksumAlgorithmFn:_,streamHasher:Q}),S={...v,"content-encoding":v["content-encoding"]?`${v["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":v["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":y},delete S["content-length"]}else if(!d5(y,v)){let V=await ru(_,G);S={...v,[y]:z(V)}}}try{return await B({...w,request:{...F,headers:S,body:L}})}catch(y){if(y instanceof Error&&y.name==="InvalidChunkSizeError")try{if(!y.message.endsWith("."))y.message+=".";y.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch(_){}throw y}};var Fu=X(Y0(),1);var w4={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},F4=(u,D)=>(B,A)=>async(w)=>{let F=w.input,{requestValidationModeMember:N}=D,G=await u.requestChecksumCalculation(),v=await u.responseChecksumValidation();switch(G){case S2.WHEN_REQUIRED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case S2.WHEN_SUPPORTED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch(v){case A0.WHEN_REQUIRED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case A0.WHEN_SUPPORTED:Fu.setFeature(A,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}if(N&&!F[N]){if(v===A0.WHEN_SUPPORTED)F[N]="ENABLED"}return B(w)};var z4=X(m2(),1);var nu=(u=[])=>{let D=[],B=rD.length;for(let A of u){let w=rD.indexOf(A);if(w!==-1)D[w]=A;else D[B++]=A}return D.filter(Boolean)};var N4=(u)=>{let D=u.lastIndexOf("-");if(D!==-1){let B=u.slice(D+1);if(!B.startsWith("0")){let A=parseInt(B,10);if(!isNaN(A)&&A>=1&&A<=1e4)return!0}}return!1};var $4=X(iu(),1);var G4=async(u,{checksumAlgorithmFn:D,base64Encoder:B})=>B(await ru(D,u));var v4=async(u,{config:D,responseAlgorithms:B,logger:A})=>{let w=nu(B),{body:F,headers:N}=u;for(let G of w){let v=w0(G),z=N[v];if(z){let Q;try{Q=du(G,D)}catch(W){if(G===k.CRC64NVME){A?.warn(`Skipping ${k.CRC64NVME} checksum validation: ${W.message}`);continue}throw W}let{base64Encoder:Z}=D;if(fu(F)){u.body=$4.createChecksumStream({expectedChecksum:z,checksumSourceLocation:v,checksum:new Q,source:F,base64Encoder:Z});return}let J=await G4(F,{checksumAlgorithmFn:Q,base64Encoder:Z});if(J===z)break;throw Error(`Checksum mismatch: expected "${J}" but received "${z}" in response header "${v}".`)}}};var Z4={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},J4=(u,D)=>(B,A)=>async(w)=>{if(!z4.HttpRequest.isInstance(w.request))return B(w);let F=w.input,N=await B(w),G=N.response,{requestValidationModeMember:v,responseAlgorithms:z}=D;if(v&&F[v]==="ENABLED"){let{clientName:Q,commandName:Z}=A,J=Object.keys(u.checksumAlgorithms??{}).filter((M)=>{let x=w0(M);return G.headers[x]!==void 0}),W=nu([...z??[],...J]);if(Q==="S3Client"&&Z==="GetObjectCommand"&&W.every((M)=>{let x=w0(M),L=G.headers[x];return!L||N4(L)}))return N;await v4(G,{config:u,responseAlgorithms:W,logger:A.logger})}return N};var pu=(u,D)=>({applyToStack:(B)=>{B.add(A4(u,D),B4),B.addRelativeTo(F4(u,D),w4),B.addRelativeTo(J4(u,D),Z4)}});var nD=X(pD(),1);var Q4=(u)=>{let{requestChecksumCalculation:D,responseChecksumValidation:B,requestStreamBufferSize:A}=u;return Object.assign(u,{requestChecksumCalculation:nD.normalizeProvider(D??gu),responseChecksumValidation:nD.normalizeProvider(B??_u),requestStreamBufferSize:Number(A??0),checksumAlgorithms:u.checksumAlgorithms??{}})};var I1=X(wx(),1),N6=X(Fx(),1),G6=X(Nx(),1);var W4=X(m2(),1),X4=X(k2(),1),hh="content-length",Kh="x-amz-decoded-content-length";function xh(){return(u,D)=>async(B)=>{let{request:A}=B;if(W4.HttpRequest.isInstance(A)){if(!(hh in A.headers)&&!(Kh in A.headers))if(typeof D?.logger?.warn==="function"&&!(D.logger instanceof X4.NoOpLogger))D.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return u({...B})}}var Sh={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Y4=(u)=>({applyToStack:(D)=>{D.add(xh(),Sh)}});var h4=(u)=>{return(D,B)=>async(A)=>{let w=await u.region(),F=u.region,N=()=>{};if(B.__s3RegionRedirect)Object.defineProperty(u,"region",{writable:!1,value:async()=>{return B.__s3RegionRedirect}}),N=()=>Object.defineProperty(u,"region",{writable:!0,value:F});try{let G=await D(A);if(B.__s3RegionRedirect){N();let v=await u.region();if(w!==v)throw Error("Region was not restored following S3 region redirect.")}return G}catch(G){throw N(),G}}},K4={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Rh(u){return(D,B)=>async(A)=>{try{return await D(A)}catch(w){if(u.followRegionRedirects){let F=w?.$metadata?.httpStatusCode,N=B.commandName==="HeadBucketCommand",G=w?.$response?.headers?.["x-amz-bucket-region"];if(G){if(F===301||F===400&&(w?.name==="IllegalLocationConstraintException"||N)){try{let v=G;B.logger?.debug(`Redirecting from ${await u.region()} to ${v}`),B.__s3RegionRedirect=v}catch(v){throw Error("Region redirect failed: "+v)}return D(A)}}}throw w}}}var Hh={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},x4=(u)=>({applyToStack:(D)=>{D.add(Rh(u),Hh),D.addRelativeTo(h4(u),K4)}});var S4=X(m2(),1),R4=X(k2(),1),Uh=(u)=>{return(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(S4.HttpResponse.isInstance(F)){if(F.headers.expires){F.headers.expiresstring=F.headers.expires;try{R4.parseRfc7231DateTime(F.headers.expires)}catch(N){B.logger?.warn(`AWS SDK Warning for ${B.clientName}::${B.commandName} response parsing (${F.headers.expires}): ${N}`),delete F.headers.expires}}}return w}},ch={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},H4=(u)=>({applyToStack:(D)=>{D.addRelativeTo(Uh(u),ch)}});class au{data;lastPurgeTime=Date.now();static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;constructor(u={}){this.data=u}get(u){let D=this.data[u];if(!D)return;return D}set(u,D){return this.data[u]=D,D}delete(u){delete this.data[u]}async purgeExpired(){let u=Date.now();if(this.lastPurgeTime+au.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>u)return;for(let D in this.data){let B=this.data[D];if(!B.isRefreshing){let A=await B.identity;if(A.expiration){if(A.expiration.getTime()<u)delete this.data[D]}}}}}class Nu{_identity;isRefreshing;accessed;constructor(u,D=!1,B=Date.now()){this._identity=u,this.isRefreshing=D,this.accessed=B}get identity(){return this.accessed=Date.now(),this._identity}}class Gu{createSessionFn;cache;static REFRESH_WINDOW_MS=60000;constructor(u,D=new au){this.createSessionFn=u,this.cache=D}async getS3ExpressIdentity(u,D){let B=D.Bucket,{cache:A}=this,w=A.get(B);if(w)return w.identity.then((F)=>{if((F.expiration?.getTime()??0)<Date.now())return A.set(B,new Nu(this.getIdentity(B))).identity;if((F.expiration?.getTime()??0)<Date.now()+Gu.REFRESH_WINDOW_MS&&!w.isRefreshing)w.isRefreshing=!0,this.getIdentity(B).then((v)=>{A.set(B,new Nu(Promise.resolve(v)))});return F});return A.set(B,new Nu(this.getIdentity(B))).identity}async getIdentity(u){await this.cache.purgeExpired().catch((A)=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache:
|
|
4
|
-
`+A)});let D=await this.createSessionFn(u);if(!D.Credentials?.AccessKeyId||!D.Credentials?.SecretAccessKey)throw Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:D.Credentials.AccessKeyId,secretAccessKey:D.Credentials.SecretAccessKey,sessionToken:D.Credentials.SessionToken,expiration:D.Credentials.Expiration?new Date(D.Credentials.Expiration):void 0}}}var P4=X(C4(),1);var h0=X(U4(),1),c4="Directory",M4="S3Express",L4="sigv4-s3express",su="X-Amz-S3session-Token",$u=su.toLowerCase(),Mh="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Lh="s3_disable_express_session_auth",aD={environmentVariableSelector:(u)=>h0.booleanSelector(u,Mh,h0.SelectorType.ENV),configFileSelector:(u)=>h0.booleanSelector(u,Lh,h0.SelectorType.CONFIG),default:!1};class tu extends P4.SignatureV4{async signWithCredentials(u,D,B){let A=E4(D);u.headers[$u]=D.sessionToken;let w=this;return O4(w,A),w.signRequest(u,B??{})}async presignWithCredentials(u,D,B){let A=E4(D);return delete u.headers[$u],u.headers[su]=D.sessionToken,u.query=u.query??{},u.query[su]=D.sessionToken,O4(this,A),this.presign(u,B)}}function E4(u){return{accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey,expiration:u.expiration}}function O4(u,D){let B=setTimeout(()=>{throw Error("SignatureV4S3Express credential override was created but not called.")},10),A=u.credentialProvider,w=()=>{return clearTimeout(B),u.credentialProvider=A,Promise.resolve(D)};u.credentialProvider=w}var k4=X(Y0(),1),y4=X(m2(),1);var V4=(u)=>{return(D,B)=>async(A)=>{if(B.endpointV2){let w=B.endpointV2,F=w.properties?.authSchemes?.[0]?.name===L4;if(w.properties?.backend===M4||w.properties?.bucketType===c4)k4.setFeature(B,"S3_EXPRESS_BUCKET","J"),B.isS3ExpressBucket=!0;if(F){let G=A.input.Bucket;if(G){let v=await u.s3ExpressIdentityProvider.getS3ExpressIdentity(await u.credentials(),{Bucket:G});if(B.s3ExpressIdentity=v,y4.HttpRequest.isInstance(A.request)&&v.sessionToken)A.request.headers[$u]=v.sessionToken}}}return D(A)}},T4={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},sD=(u)=>({applyToStack:(D)=>{D.add(V4(u),T4)}});var m4=X(q4(),1),g4=X(m2(),1),_4=X(pD(),1);var I4=async(u,D,B,A)=>{let w=await A.signWithCredentials(B,u,{});if(w.headers["X-Amz-Security-Token"]||w.headers["x-amz-security-token"])throw Error("X-Amz-Security-Token must not be set for s3-express requests.");return w};var Eh=(u)=>(D)=>{throw D},Oh=(u,D)=>{};var f4=(u)=>(D,B)=>async(A)=>{if(!g4.HttpRequest.isInstance(A.request))return D(A);let F=_4.getSmithyContext(B).selectedHttpAuthScheme;if(!F)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:N={}},identity:G,signer:v}=F,z;if(B.s3ExpressIdentity)z=await I4(B.s3ExpressIdentity,N,A.request,await u.signer());else z=await v.sign(A.request,G,N);let Q=await D({...A,request:z}).catch((v.errorHandler||Eh)(N));return(v.successHandler||Oh)(Q.response,N),Q},tD=(u)=>({applyToStack:(D)=>{D.addRelativeTo(f4(u),m4.httpSigningMiddlewareOptions)}});var b4=(u,{session:D})=>{let[B,A]=D,{forcePathStyle:w,useAccelerateEndpoint:F,disableMultiregionAccessPoints:N,followRegionRedirects:G,s3ExpressIdentityProvider:v,bucketEndpoint:z,expectContinueHeader:Q}=u;return Object.assign(u,{forcePathStyle:w??!1,useAccelerateEndpoint:F??!1,disableMultiregionAccessPoints:N??!1,followRegionRedirects:G??!1,s3ExpressIdentityProvider:v??new Gu(async(Z)=>B().send(new A({Bucket:Z}))),bucketEndpoint:z??!1,expectContinueHeader:Q??2097152})};var j4=X(m2(),1),ou=X(iu(),1),Ch={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Ph=3000,kh=(u)=>(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(!j4.HttpResponse.isInstance(F))return w;let{statusCode:N,body:G}=F;if(N<200||N>=300)return w;if(!(typeof G?.stream==="function"||typeof G?.pipe==="function"||typeof G?.tee==="function"))return w;let z=G,Q=G;if(G&&typeof G==="object"&&!(G instanceof Uint8Array))[z,Q]=await ou.splitStream(G);F.body=Q;let Z=await yh(z,{streamCollector:async(W)=>{return ou.headStream(W,Ph)}});if(typeof z?.destroy==="function")z.destroy();let J=u.utf8Encoder(Z.subarray(Z.length-16));if(Z.length===0&&Ch[B.commandName]){let W=Error("S3 aborted request");throw W.name="InternalError",W}if(J&&J.endsWith("</Error>"))F.statusCode=400;return w},yh=(u=new Uint8Array,D)=>{if(u instanceof Uint8Array)return Promise.resolve(u);return D.streamCollector(u)||Promise.resolve(new Uint8Array)},Vh={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},K0=(u)=>({applyToStack:(D)=>{D.addRelativeTo(kh(u),Vh)}});var l4=(u)=>typeof u==="string"&&u.indexOf("arn:")===0&&u.split(":").length>=6;function d4(u){return(D,B)=>async(A)=>{if(u.bucketEndpoint){let w=B.endpointV2;if(w){let F=A.input.Bucket;if(typeof F==="string")try{let N=new URL(F);B.endpointV2={...w,url:N}}catch(N){let G=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${F} could not be parsed as URL.`;if(B.logger?.constructor?.name==="NoOpLogger")console.warn(G);else B.logger?.warn?.(G);throw N}}}return D(A)}}var r4={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Th({bucketEndpoint:u}){return(D)=>async(B)=>{let{input:{Bucket:A}}=B;if(!u&&typeof A==="string"&&!l4(A)&&A.indexOf("/")>=0){let w=Error(`Bucket name shouldn't contain '/', received '${A}'`);throw w.name="InvalidBucketName",w}return D({...B})}}var Ih={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},i4=(u)=>({applyToStack:(D)=>{D.add(Th(u),Ih),D.addRelativeTo(d4(u),r4)}});var q1=X(Gx(),1),$6=X(tB(),1),O0=X(q4(),1),v6=X(ZB(),1);var n4=(u)=>Object.assign(u,{eventStreamMarshaller:u.eventStreamSerdeProvider(u)});var z6=X($x(),1),Z6=X(U0(),1),m1=X(oB(),1),J6=X(k2(),1);var w1=X(Y0(),1);var oD=X(C4(),1);var vu={CrtSignerV4:null};class zu{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof vu.CrtSignerV4==="function")return"crt";else if(typeof oD.signatureV4aContainer.SignatureV4a==="function")return"js";return"none"}constructor(u){this.sigv4Signer=new tu(u),this.signerOptions=u}async sign(u,D={}){if(D.signingRegion==="*")return this.getSigv4aSigner().sign(u,D);return this.sigv4Signer.sign(u,D)}async signWithCredentials(u,D,B={}){if(B.signingRegion==="*"){let A=this.getSigv4aSigner(),w=vu.CrtSignerV4;if(w&&A instanceof w)return A.signWithCredentials(u,D,B);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(u,D,B)}async presign(u,D={}){if(D.signingRegion==="*"){let B=this.getSigv4aSigner(),A=vu.CrtSignerV4;if(A&&B instanceof A)return B.presign(u,D);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(u,D)}async presignWithCredentials(u,D,B={}){if(B.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(u,D,B)}getSigv4aSigner(){if(!this.sigv4aSigner){let u=vu.CrtSignerV4,D=oD.signatureV4aContainer.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!u&&!D)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(u&&typeof u==="function")this.sigv4aSigner=new u({...this.signerOptions,signingAlgorithm:1});else if(D&&typeof D==="function")this.sigv4aSigner=new D({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!D||typeof D!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new D({...this.signerOptions})}}return this.sigv4aSigner}}var BB=X(U0(),1),c0=X(pD(),1);var DB=X(ih(),1),H0=X(rh(),1);var x0={["required"]:!1,["type"]:"string"},S0={["required"]:!0,default:!1,["type"]:"boolean"},Zu={["required"]:!1,["type"]:"boolean"},H2={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},j={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},n9={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},p4={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},Qu={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},O={["ref"]:"Bucket"},a4={["conditions"]:[H2],["error"]:"S3Express does not support S3 Accelerate.",["type"]:"error"},s4={["conditions"]:[j,{["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"}],["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},$2={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},eD={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},p9={["ref"]:"url"},a9={["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"},X2={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},h={},s9={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]},t4={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},o4={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},e4={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},K={["fn"]:"not",["argv"]:[j]},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},eu={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},u9={["fn"]:"not",["argv"]:[Qu]},D9={["ref"]:"hardwareType"},B9={["conditions"]:[K],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},u1={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},u3={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},qh={["ref"]:"ForcePathStyle"},l={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},p={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},t={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[p]},o={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},A9={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},d={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},e={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},w9={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},F9={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},N9={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},D3={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[p9,"isIp"]},!1]},B3={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:d,["headers"]:{}},H3={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:d,["headers"]:{}},G9={["endpoint"]:H3,["type"]:"endpoint"},A3={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},$9={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},D1={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},z2={["ref"]:"bucketArn"},t9={["ref"]:"arnType"},w3={["fn"]:"getAttr",["argv"]:[z2,"service"]},U3={["ref"]:"accessPointName"},v9={["conditions"]:[T],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},z9={["conditions"]:[H2],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Z9={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},F3={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},o9={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},e9={["fn"]:"getAttr",["argv"]:[z2,"accountId"]},N3={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},J9={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},G3={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},$3={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},v3={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Q9={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},W9={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Ju={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},X9={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Y9={["fn"]:"aws.parseArn",["argv"]:[O]},h9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},K9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},x9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},z3={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},S9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},R9={["ref"]:"UseObjectLambdaEndpoint"},Z3={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},H9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},U9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},c9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},J3={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:d,["headers"]:{}},M9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},Q3=[{["ref"]:"Region"}],mh=[{["ref"]:"Endpoint"}],gh=[O],W3=[H2],R0=[j,$2],L9=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],_h=[a9],X3=[s9],R2=[n9],Y3=[I,T],Wu=[I,U],Xu=[R,T],Yu=[R,U],E9=[{["fn"]:"substring",["argv"]:[O,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],T2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Wu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Yu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:{}},["type"]:"endpoint"}],O9=[{["fn"]:"substring",["argv"]:[O,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],C9=[{["fn"]:"substring",["argv"]:[O,6,19,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,19,21,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],P9=[{["fn"]:"substring",["argv"]:[O,6,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],k9=[{["fn"]:"substring",["argv"]:[O,6,26,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,26,28,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Wu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Yu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],y9=[O,0,7,!0],V9=[{["fn"]:"substring",["argv"]:[O,7,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],T9=[{["fn"]:"substring",["argv"]:[O,7,16,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,16,18,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I9=[{["fn"]:"substring",["argv"]:[O,7,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],q9=[{["fn"]:"substring",["argv"]:[O,7,21,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,21,23,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],m9=[{["fn"]:"substring",["argv"]:[O,7,27,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,27,29,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],fh=[Qu],g9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],_9=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],bh=["*"],f9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],b2=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],h3=[{["fn"]:"stringEquals",["argv"]:[t9,"accesspoint"]}],b9=[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[U3,""]}]}],jh=[z2,"resourceId[1]"],j9=[T],K3=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},""]}]}],l9=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[2]"]}]}]}],lh=[z2,"resourceId[2]"],x3=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]}],["assign"]:"bucketPartition"}],d9=[{["fn"]:"stringEquals",["argv"]:[o9,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],S3=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"region"]},!0]}],R3=[{["fn"]:"isValidHostLabel",["argv"]:[e9,!1]}],r9=[{["fn"]:"isValidHostLabel",["argv"]:[U3,!1]}],B1=[I],i9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],dh={version:"1.0",parameters:{Bucket:x0,Region:x0,UseFIPS:S0,UseDualStack:S0,Endpoint:x0,ForcePathStyle:S0,Accelerate:S0,UseGlobalEndpoint:S0,UseObjectLambdaEndpoint:Zu,Key:x0,Prefix:x0,CopySource:x0,DisableAccessPoints:Zu,DisableMultiRegionAccessPoints:S0,UseArnRegion:Zu,UseS3ExpressControlEndpoint:Zu,DisableS3ExpressSessionAuth:Zu},["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Q3}],["rules"]:[{["conditions"]:[H2,I],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[T,j],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[j,I],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[j,H2],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[I,n9,p4],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:[O,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],["rules"]:[a4,s4,{["conditions"]:[o4,e4],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[a9,K],["rules"]:[{["conditions"]:Y3,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:X3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:L9,["rules"]:[{["conditions"]:E9,["rules"]:T2,["type"]:"tree"},{["conditions"]:O9,["rules"]:T2,["type"]:"tree"},{["conditions"]:C9,["rules"]:T2,["type"]:"tree"},{["conditions"]:P9,["rules"]:T2,["type"]:"tree"},{["conditions"]:k9,["rules"]:T2,["type"]:"tree"},eu],["type"]:"tree"},{["conditions"]:E9,["rules"]:I2,["type"]:"tree"},{["conditions"]:O9,["rules"]:I2,["type"]:"tree"},{["conditions"]:C9,["rules"]:I2,["type"]:"tree"},{["conditions"]:P9,["rules"]:I2,["type"]:"tree"},{["conditions"]:k9,["rules"]:I2,["type"]:"tree"},eu],["type"]:"tree"}],["type"]:"tree"},t4],["type"]:"tree"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:y9,["assign"]:"accessPointSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"accessPointSuffix"},"--xa-s3"]}],["rules"]:[a4,s4,{["conditions"]:X3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:L9,["rules"]:[{["conditions"]:V9,["rules"]:T2,["type"]:"tree"},{["conditions"]:T9,["rules"]:T2,["type"]:"tree"},{["conditions"]:I9,["rules"]:T2,["type"]:"tree"},{["conditions"]:q9,["rules"]:T2,["type"]:"tree"},{["conditions"]:m9,["rules"]:T2,["type"]:"tree"},eu],["type"]:"tree"},{["conditions"]:V9,["rules"]:I2,["type"]:"tree"},{["conditions"]:T9,["rules"]:I2,["type"]:"tree"},{["conditions"]:I9,["rules"]:I2,["type"]:"tree"},{["conditions"]:q9,["rules"]:I2,["type"]:"tree"},{["conditions"]:m9,["rules"]:I2,["type"]:"tree"},eu],["type"]:"tree"}],["type"]:"tree"},t4],["type"]:"tree"},{["conditions"]:[u9,o4,e4],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Y3,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",["properties"]:X2,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Qu,{["fn"]:"substring",["argv"]:[O,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[O,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:y9,["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[O,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Q3,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],["rules"]:[{["conditions"]:g9,["rules"]:[{["conditions"]:X3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[D9,"e"]}],["rules"]:[{["conditions"]:_9,["rules"]:[B9,{["conditions"]:R0,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[D9,"o"]}],["rules"]:[{["conditions"]:_9,["rules"]:[B9,{["conditions"]:R0,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:u1,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',["type"]:"error"}],["type"]:"tree"},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:fh,["rules"]:[{["conditions"]:[j,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:mh}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[u3,s9],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:f9,["rules"]:[{["conditions"]:[H2,p4],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[T,I,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,I,l,K,E,o],["rules"]:[{endpoint:A9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,I,l,K,E,e],endpoint:A9,["type"]:"endpoint"},{["conditions"]:[U,I,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,I,l,K,E,o],["rules"]:[{endpoint:w9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,I,l,K,E,e],endpoint:w9,["type"]:"endpoint"},{["conditions"]:[T,R,H2,K,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,R,H2,K,E,o],["rules"]:[{endpoint:F9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,R,H2,K,E,e],endpoint:F9,["type"]:"endpoint"},{["conditions"]:[T,R,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,R,l,K,E,o],["rules"]:[{endpoint:N9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,R,l,K,E,e],endpoint:N9,["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,eD,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,D3,p],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,eD,E,o],["rules"]:[{["conditions"]:b2,endpoint:B3,["type"]:"endpoint"},{endpoint:B3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,l,j,$2,D3,E,o],["rules"]:[{["conditions"]:b2,endpoint:H3,["type"]:"endpoint"},G9],["type"]:"tree"},{["conditions"]:[U,R,l,j,$2,eD,E,e],endpoint:B3,["type"]:"endpoint"},{["conditions"]:[U,R,l,j,$2,D3,E,e],endpoint:H3,["type"]:"endpoint"},{["conditions"]:[U,R,H2,K,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,H2,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:A3,["type"]:"endpoint"},{endpoint:A3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,H2,K,E,e],endpoint:A3,["type"]:"endpoint"},{["conditions"]:[U,R,l,K,p],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,R,l,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:$9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,R,l,K,E,e],endpoint:$9,["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[j,$2,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[p9,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!0]},u3,R,U,l],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:f9,["rules"]:[G9],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[u3,{["fn"]:"aws.parseArn",["argv"]:gh,["assign"]:"bucketArn"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[t9,""]}]}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3-object-lambda"]}],["rules"]:[{["conditions"]:h3,["rules"]:[{["conditions"]:b9,["rules"]:[v9,z9,{["conditions"]:K3,["rules"]:[Z9,{["conditions"]:l9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:d9,["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[e9,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:R3,["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"},{["conditions"]:B1,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:N3,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},J9],["type"]:"tree"},G3],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Q9],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},W9],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:h3,["rules"]:[{["conditions"]:b9,["rules"]:[{["conditions"]:K3,["rules"]:[{["conditions"]:h3,["rules"]:[{["conditions"]:K3,["rules"]:[Z9,{["conditions"]:l9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[o9,"{partitionResult#name}"]}],["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3"]}],["rules"]:[{["conditions"]:R3,["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:W3,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:Y3,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Wu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Xu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,j,$2],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"},{["conditions"]:Yu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ju,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},J9],["type"]:"tree"},G3],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Q9],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[U3,!0]}],["rules"]:[{["conditions"]:j9,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:B1,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:W3,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:Q3,["assign"]:"mrapPartition"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[z2,"partition"]}]}],["rules"]:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:bh}]},["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},W9],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[w3,"s3-outposts"]}],["rules"]:[{["conditions"]:j9,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:B1,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:W3,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:jh,["assign"]:"outpostId"}],["rules"]:[{["conditions"]:g9,["rules"]:[F3,{["conditions"]:x3,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:d9,["rules"]:[{["conditions"]:S3,["rules"]:[{["conditions"]:R3,["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:lh,["assign"]:"outpostType"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[z2,"resourceId[3]"],["assign"]:"accessPointName"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],["rules"]:[{["conditions"]:R0,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:X9,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:X9,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},G3],["type"]:"tree"},$3],["type"]:"tree"},v3],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[O,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Y9]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[qh,!0]},Y9],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:_h,["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:[l],["rules"]:[{["conditions"]:[T,K,I,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,K,I,E,o],["rules"]:[{endpoint:h9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,K,I,E,e],endpoint:h9,["type"]:"endpoint"},{["conditions"]:[U,K,I,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,K,I,E,o],["rules"]:[{endpoint:K9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,K,I,E,e],endpoint:K9,["type"]:"endpoint"},{["conditions"]:[T,K,R,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[T,K,R,E,o],["rules"]:[{endpoint:x9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,K,R,E,e],endpoint:x9,["type"]:"endpoint"},{["conditions"]:[U,j,$2,R,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,j,$2,R,E,o],["rules"]:[{["conditions"]:b2,endpoint:z3,["type"]:"endpoint"},{endpoint:z3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,j,$2,R,E,e],endpoint:z3,["type"]:"endpoint"},{["conditions"]:[U,K,R,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[U,K,R,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:S9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,K,R,E,e],endpoint:S9,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[R9]},{["fn"]:"booleanEquals",["argv"]:[R9,!0]}],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:i9,["rules"]:[v9,z9,{["conditions"]:R0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"},{["conditions"]:B1,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Z3,["headers"]:h},["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[u9],["rules"]:[{["conditions"]:R2,["rules"]:[{["conditions"]:i9,["rules"]:[{["conditions"]:[I,T,K,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[I,T,K,E,o],["rules"]:[{endpoint:H9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,K,E,e],endpoint:H9,["type"]:"endpoint"},{["conditions"]:[I,U,K,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[I,U,K,E,o],["rules"]:[{endpoint:U9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,U,K,E,e],endpoint:U9,["type"]:"endpoint"},{["conditions"]:[R,T,K,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,T,K,E,o],["rules"]:[{endpoint:c9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,T,K,E,e],endpoint:c9,["type"]:"endpoint"},{["conditions"]:[R,U,j,$2,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,j,$2,E,o],["rules"]:[{["conditions"]:b2,endpoint:J3,["type"]:"endpoint"},{endpoint:J3,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,U,j,$2,E,e],endpoint:J3,["type"]:"endpoint"},{["conditions"]:[R,U,K,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:h},["type"]:"endpoint"},{["conditions"]:[R,U,K,E,o],["rules"]:[{["conditions"]:b2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:h},["type"]:"endpoint"},{endpoint:M9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,U,K,E,e],endpoint:M9,["type"]:"endpoint"}],["type"]:"tree"},D1],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},uB=dh;var nh=new H0.EndpointCache({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),A1=(u,D={})=>{return nh.get(u,()=>H0.resolveEndpoint(uB,{endpointParams:u,logger:D.logger}))};H0.customEndpointFunctions.aws=DB.awsEndpointFunctions;var ph=(u)=>async(D,B,A)=>{if(!A)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let w=await u(D,B,A),F=c0.getSmithyContext(B)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!F)throw Error(`getEndpointParameterInstructions() is not defined on '${B.commandName}'`);let N=await BB.resolveParams(A,{getEndpointParameterInstructions:F},D);return Object.assign(w,N)},ah=async(u,D,B)=>{return{operation:c0.getSmithyContext(D).operation,region:await c0.normalizeProvider(u.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},AB=ph(ah);function wB(u){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}function FB(u){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}var sh=(u,D,B)=>{return(w)=>{let N=u(w).properties?.authSchemes;if(!N)return D(w);let G=[];for(let v of N){let{name:z,properties:Q={},...Z}=v,J=z.toLowerCase();if(z!==J)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${z}' to '${J}'`);let W;if(J==="sigv4a"){W="aws.auth#sigv4a";let x=N.find((L)=>{let S=L.name.toLowerCase();return S!=="sigv4a"&&S.startsWith("sigv4")});if(zu.sigv4aDependency()==="none"&&x)continue}else if(J.startsWith("sigv4"))W="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${J}'`);let Y=B[W];if(!Y)throw Error(`Could not find HttpAuthOption create function for '${W}'`);let M=Y(w);M.schemeId=W,M.signingProperties={...M.signingProperties||{},...Z,...Q},G.push(M)}return G}},th=(u)=>{let D=[];switch(u.operation){default:D.push(wB(u)),D.push(FB(u))}return D},NB=sh(A1,th,{"aws.auth#sigv4":wB,"aws.auth#sigv4a":FB}),GB=(u)=>{let D=w1.resolveAwsSdkSigV4Config(u),B=w1.resolveAwsSdkSigV4AConfig(D);return Object.assign(B,{authSchemePreference:c0.normalizeProvider(u.authSchemePreference??[])})};var SB=X(U0(),1),RB=X(k2(),1);var $B=(u)=>{return Object.assign(u,{useFipsEndpoint:u.useFipsEndpoint??!1,useDualstackEndpoint:u.useDualstackEndpoint??!1,forcePathStyle:u.forcePathStyle??!1,useAccelerateEndpoint:u.useAccelerateEndpoint??!1,useGlobalEndpoint:u.useGlobalEndpoint??!1,disableMultiregionAccessPoints:u.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:u.clientContextParams??{}})},j2={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var c3=X(ZB(),1);var vB=X(k2(),1);class r extends vB.ServiceException{constructor(u){super(u);Object.setPrototypeOf(this,r.prototype)}}class F1 extends r{name="NoSuchUpload";$fault="client";constructor(u){super({name:"NoSuchUpload",$fault:"client",...u});Object.setPrototypeOf(this,F1.prototype)}}class N1 extends r{name="AccessDenied";$fault="client";constructor(u){super({name:"AccessDenied",$fault:"client",...u});Object.setPrototypeOf(this,N1.prototype)}}class G1 extends r{name="ObjectNotInActiveTierError";$fault="client";constructor(u){super({name:"ObjectNotInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,G1.prototype)}}class $1 extends r{name="BucketAlreadyExists";$fault="client";constructor(u){super({name:"BucketAlreadyExists",$fault:"client",...u});Object.setPrototypeOf(this,$1.prototype)}}class v1 extends r{name="BucketAlreadyOwnedByYou";$fault="client";constructor(u){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...u});Object.setPrototypeOf(this,v1.prototype)}}class z1 extends r{name="NoSuchBucket";$fault="client";constructor(u){super({name:"NoSuchBucket",$fault:"client",...u});Object.setPrototypeOf(this,z1.prototype)}}class Z1 extends r{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(u){super({name:"InvalidObjectState",$fault:"client",...u});Object.setPrototypeOf(this,Z1.prototype),this.StorageClass=u.StorageClass,this.AccessTier=u.AccessTier}}class J1 extends r{name="NoSuchKey";$fault="client";constructor(u){super({name:"NoSuchKey",$fault:"client",...u});Object.setPrototypeOf(this,J1.prototype)}}class Q1 extends r{name="NotFound";$fault="client";constructor(u){super({name:"NotFound",$fault:"client",...u});Object.setPrototypeOf(this,Q1.prototype)}}class W1 extends r{name="EncryptionTypeMismatch";$fault="client";constructor(u){super({name:"EncryptionTypeMismatch",$fault:"client",...u});Object.setPrototypeOf(this,W1.prototype)}}class X1 extends r{name="InvalidRequest";$fault="client";constructor(u){super({name:"InvalidRequest",$fault:"client",...u});Object.setPrototypeOf(this,X1.prototype)}}class Y1 extends r{name="InvalidWriteOffset";$fault="client";constructor(u){super({name:"InvalidWriteOffset",$fault:"client",...u});Object.setPrototypeOf(this,Y1.prototype)}}class h1 extends r{name="TooManyParts";$fault="client";constructor(u){super({name:"TooManyParts",$fault:"client",...u});Object.setPrototypeOf(this,h1.prototype)}}class K1 extends r{name="IdempotencyParameterMismatch";$fault="client";constructor(u){super({name:"IdempotencyParameterMismatch",$fault:"client",...u});Object.setPrototypeOf(this,K1.prototype)}}class x1 extends r{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(u){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,x1.prototype)}}var JB=c3.TypeRegistry.for("smithy.ts.sdk.synthetic.com.amazonaws.s3"),oh=[-3,"smithy.ts.sdk.synthetic.com.amazonaws.s3","S3ServiceException",0,[],[]];JB.registerError(oh,r);var G2=c3.TypeRegistry.for("com.amazonaws.s3"),eh=[-3,"com.amazonaws.s3","AccessDenied",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(eh,N1);var uK=[-3,"com.amazonaws.s3","BucketAlreadyExists",{["error"]:"client",["httpError"]:409},[],[]];G2.registerError(uK,$1);var DK=[-3,"com.amazonaws.s3","BucketAlreadyOwnedByYou",{["error"]:"client",["httpError"]:409},[],[]];G2.registerError(DK,v1);var BK=[-3,"com.amazonaws.s3","EncryptionTypeMismatch",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(BK,W1);var AK=[-3,"com.amazonaws.s3","IdempotencyParameterMismatch",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(AK,K1);var wK=[-3,"com.amazonaws.s3","InvalidObjectState",{["error"]:"client",["httpError"]:403},["StorageClass","AccessTier"],[0,0]];G2.registerError(wK,Z1);var FK=[-3,"com.amazonaws.s3","InvalidRequest",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(FK,X1);var NK=[-3,"com.amazonaws.s3","InvalidWriteOffset",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(NK,Y1);var GK=[-3,"com.amazonaws.s3","NoSuchBucket",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError(GK,z1);var $K=[-3,"com.amazonaws.s3","NoSuchKey",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError($K,J1);var vK=[-3,"com.amazonaws.s3","NoSuchUpload",{["error"]:"client",["httpError"]:404},[],[]];G2.registerError(vK,F1);var zK=[-3,"com.amazonaws.s3","NotFound",{["error"]:"client"},[],[]];G2.registerError(zK,Q1);var ZK=[-3,"com.amazonaws.s3","ObjectAlreadyInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(ZK,x1);var JK=[-3,"com.amazonaws.s3","ObjectNotInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];G2.registerError(JK,G1);var QK=[-3,"com.amazonaws.s3","TooManyParts",{["error"]:"client",["httpError"]:400},[],[]];G2.registerError(QK,h1);var QB=[JB,G2];var zB=[0,"com.amazonaws.s3","SessionCredentialValue",8,0],WB=[0,"com.amazonaws.s3","SSECustomerKey",8,0],S1=[0,"com.amazonaws.s3","SSEKMSEncryptionContext",8,0],hu=[0,"com.amazonaws.s3","SSEKMSKeyId",8,0],XB=[0,"com.amazonaws.s3","StreamingBlob",{["streaming"]:1},42];var WK=[3,"com.amazonaws.s3","CommonPrefix",0,["Prefix"],[0]];var XK=[3,"com.amazonaws.s3","CreateSessionOutput",{["xmlName"]:"CreateSessionResult"},["Credentials","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[()=>LK,{["xmlName"]:"Credentials"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1],YK=[3,"com.amazonaws.s3","CreateSessionRequest",0,["Bucket","SessionMode","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[0,1],[0,{["httpHeader"]:"x-amz-create-session-mode"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1];var hK=[3,"com.amazonaws.s3","GetObjectOutput",0,["Body","DeleteMarker","AcceptRanges","Expiration","Restore","LastModified","ContentLength","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","MissingMeta","VersionId","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentRange","ContentType","Expires","ExpiresString","WebsiteRedirectLocation","ServerSideEncryption","Metadata","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","BucketKeyEnabled","StorageClass","RequestCharged","ReplicationStatus","PartsCount","TagCount","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus"],[[()=>XB,16],[2,{["httpHeader"]:"x-amz-delete-marker"}],[0,{["httpHeader"]:"accept-ranges"}],[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"x-amz-restore"}],[4,{["httpHeader"]:"Last-Modified"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[1,{["httpHeader"]:"x-amz-missing-meta"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[0,{["httpHeader"]:"Content-Range"}],[0,{["httpHeader"]:"Content-Type"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"ExpiresString"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-request-charged"}],[0,{["httpHeader"]:"x-amz-replication-status"}],[1,{["httpHeader"]:"x-amz-mp-parts-count"}],[1,{["httpHeader"]:"x-amz-tagging-count"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}]]],KK=[3,"com.amazonaws.s3","GetObjectRequest",0,["Bucket","Key","IfMatch","IfModifiedSince","IfNoneMatch","IfUnmodifiedSince","Range","ResponseCacheControl","ResponseContentDisposition","ResponseContentEncoding","ResponseContentLanguage","ResponseContentType","ResponseExpires","VersionId","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","RequestPayer","PartNumber","ExpectedBucketOwner","ChecksumMode"],[[0,1],[0,1],[0,{["httpHeader"]:"If-Match"}],[4,{["httpHeader"]:"If-Modified-Since"}],[0,{["httpHeader"]:"If-None-Match"}],[4,{["httpHeader"]:"If-Unmodified-Since"}],[0,{["httpHeader"]:"Range"}],[0,{["httpQuery"]:"response-cache-control"}],[0,{["httpQuery"]:"response-content-disposition"}],[0,{["httpQuery"]:"response-content-encoding"}],[0,{["httpQuery"]:"response-content-language"}],[0,{["httpQuery"]:"response-content-type"}],[6,{["httpQuery"]:"response-expires"}],[0,{["httpQuery"]:"versionId"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>WB,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[1,{["httpQuery"]:"partNumber"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[0,{["httpHeader"]:"x-amz-checksum-mode"}]],2];var xK=[3,"com.amazonaws.s3","ListObjectsV2Output",{["xmlName"]:"ListBucketResult"},["IsTruncated","Contents","Name","Prefix","Delimiter","MaxKeys","CommonPrefixes","EncodingType","KeyCount","ContinuationToken","NextContinuationToken","StartAfter","RequestCharged"],[2,[()=>OK,{["xmlFlattened"]:1}],0,0,0,1,[()=>EK,{["xmlFlattened"]:1}],0,1,0,0,0,[0,{["httpHeader"]:"x-amz-request-charged"}]]],SK=[3,"com.amazonaws.s3","ListObjectsV2Request",0,["Bucket","Delimiter","EncodingType","MaxKeys","Prefix","ContinuationToken","FetchOwner","StartAfter","RequestPayer","ExpectedBucketOwner","OptionalObjectAttributes"],[[0,1],[0,{["httpQuery"]:"delimiter"}],[0,{["httpQuery"]:"encoding-type"}],[1,{["httpQuery"]:"max-keys"}],[0,{["httpQuery"]:"prefix"}],[0,{["httpQuery"]:"continuation-token"}],[2,{["httpQuery"]:"fetch-owner"}],[0,{["httpQuery"]:"start-after"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[64,{["httpHeader"]:"x-amz-optional-object-attributes"}]],1];var RK=[3,"com.amazonaws.s3","Object",0,["Key","LastModified","ETag","ChecksumAlgorithm","ChecksumType","Size","StorageClass","Owner","RestoreStatus"],[0,4,0,[64,{["xmlFlattened"]:1}],0,1,0,()=>HK,()=>MK]];var HK=[3,"com.amazonaws.s3","Owner",0,["DisplayName","ID"],[0,0]];var UK=[3,"com.amazonaws.s3","PutObjectOutput",0,["Expiration","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","ServerSideEncryption","VersionId","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","Size","RequestCharged"],[[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[1,{["httpHeader"]:"x-amz-object-size"}],[0,{["httpHeader"]:"x-amz-request-charged"}]]],cK=[3,"com.amazonaws.s3","PutObjectRequest",0,["Bucket","Key","ACL","Body","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentLength","ContentMD5","ContentType","ChecksumAlgorithm","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","Expires","IfMatch","IfNoneMatch","GrantFullControl","GrantRead","GrantReadACP","GrantWriteACP","WriteOffsetBytes","Metadata","ServerSideEncryption","StorageClass","WebsiteRedirectLocation","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","RequestPayer","Tagging","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus","ExpectedBucketOwner"],[[0,1],[0,1],[0,{["httpHeader"]:"x-amz-acl"}],[()=>XB,16],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"Content-MD5"}],[0,{["httpHeader"]:"Content-Type"}],[0,{["httpHeader"]:"x-amz-sdk-checksum-algorithm"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"If-Match"}],[0,{["httpHeader"]:"If-None-Match"}],[0,{["httpHeader"]:"x-amz-grant-full-control"}],[0,{["httpHeader"]:"x-amz-grant-read"}],[0,{["httpHeader"]:"x-amz-grant-read-acp"}],[0,{["httpHeader"]:"x-amz-grant-write-acp"}],[1,{["httpHeader"]:"x-amz-write-offset-bytes"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>WB,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>hu,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>S1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-tagging"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}]],2];var MK=[3,"com.amazonaws.s3","RestoreStatus",0,["IsRestoreInProgress","RestoreExpiryDate"],[2,4]];var LK=[3,"com.amazonaws.s3","SessionCredentials",0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[[0,{["xmlName"]:"AccessKeyId"}],[()=>zB,{["xmlName"]:"SecretAccessKey"}],[()=>zB,{["xmlName"]:"SessionToken"}],[4,{["xmlName"]:"Expiration"}]],4];var EK=[1,"com.amazonaws.s3","CommonPrefixList",0,()=>WK];var OK=[1,"com.amazonaws.s3","ObjectList",0,[()=>RK,0]];var YB=[9,"com.amazonaws.s3","CreateSession",{["http"]:["GET","/?session",200]},()=>YK,()=>XK];var hB=[9,"com.amazonaws.s3","GetObject",{["httpChecksum"]:"-",["http"]:["GET","/{Key+}?x-id=GetObject",200]},()=>KK,()=>hK];var KB=[9,"com.amazonaws.s3","ListObjectsV2",{["http"]:["GET","/?list-type=2",200]},()=>SK,()=>xK];var xB=[9,"com.amazonaws.s3","PutObject",{["httpChecksum"]:"-",["http"]:["PUT","/{Key+}?x-id=PutObject",200]},()=>cK,()=>UK];class M3 extends RB.Command.classBuilder().ep({...j2,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(u,D,B,A){return[SB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),K0(B)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(YB).build(){}var HB={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.1015.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.mts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs","test:integration":"yarn g:vitest run -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest watch -c vitest.config.integ.mts","test:watch":"yarn g:vitest watch"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.24","@aws-sdk/credential-provider-node":"^3.972.25","@aws-sdk/middleware-bucket-endpoint":"^3.972.8","@aws-sdk/middleware-expect-continue":"^3.972.8","@aws-sdk/middleware-flexible-checksums":"^3.974.4","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-location-constraint":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.8","@aws-sdk/middleware-sdk-s3":"^3.972.24","@aws-sdk/middleware-ssec":"^3.972.8","@aws-sdk/middleware-user-agent":"^3.972.25","@aws-sdk/region-config-resolver":"^3.972.9","@aws-sdk/signature-v4-multi-region":"^3.996.12","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.11","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/eventstream-serde-browser":"^4.2.12","@smithy/eventstream-serde-config-resolver":"^4.3.12","@smithy/eventstream-serde-node":"^4.2.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-blob-browser":"^4.2.13","@smithy/hash-node":"^4.2.12","@smithy/hash-stream-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/md5-js":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-stream":"^4.5.20","@smithy/util-utf8":"^4.2.2","@smithy/util-waiter":"^4.2.13",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.1015.0","@smithy/snapshot-testing":"^2.0.3","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3",vitest:"^4.0.17"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var E0=X(Y0(),1);var H1=X(cB(),1),kB=X(kK(),1);var R1=X(cB(),1),UB="AWS_EC2_METADATA_DISABLED",MB=async(u)=>{let{ENV_CMDS_FULL_URI:D,ENV_CMDS_RELATIVE_URI:B,fromContainerMetadata:A,fromInstanceMetadata:w}=await import("./chunk-ratbccpg.js");if(process.env[B]||process.env[D]){u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:F}=await import("./chunk-pfaq2mer.js");return R1.chain(F(u),A(u))}if(process.env[UB]&&process.env[UB]!=="false")return async()=>{throw new R1.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:u.logger})};return u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),w(u)};function LB(u,D){let B=PK(u),A,w,F,N=async(G)=>{if(G?.forceRefresh)return await B(G);if(F?.expiration){if(F?.expiration?.getTime()<Date.now())F=void 0}if(A)await A;else if(!F||D?.(F))if(F){if(!w)w=B(G).then((v)=>{F=v}).finally(()=>{w=void 0})}else return A=B(G).then((v)=>{F=v}).finally(()=>{A=void 0}),N(G);return F};return N}var PK=(u)=>async(D)=>{let B;for(let A of u)try{return await A(D)}catch(w){if(B=w,w?.tryNextLink)continue;throw w}throw B};var EB=!1,yB=(u={})=>LB([async()=>{if(u.profile??process.env[kB.ENV_PROFILE]){if(process.env[OB]&&process.env[CB]){if(!EB)(u.logger?.warn&&u.logger?.constructor?.name!=="NoOpLogger"?u.logger.warn.bind(u.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
2
|
+
import{Na as q6,Oa as m6,Ta as _6}from"./chunk-knrx23te.js";import{$a as Ah,Ua as d4,Va as m4,Wa as H0,Xa as hx,Ya as xx,Za as Hx,_a as k4,ab as wh,bb as Jx,cb as Sx,db as FB,eb as Rx,fb as J0,gb as GB,hb as Qx,ib as Wx,jb as Xx,kb as Yx,lb as zx,mb as Kx}from"./chunk-20376aj6.js";import{nb as vx}from"./chunk-ngnrytfh.js";import{ob as uD,pb as Nx,rb as Zx,sb as l6,tb as tu,vb as x6,zb as R2}from"./chunk-9s3te5pa.js";import{Ab as g2}from"./chunk-qy3aczt9.js";import{Bb as HK,Db as o3}from"./chunk-ytr22fm4.js";import{Eb as $x}from"./chunk-kkdtznm5.js";import{Fb as ih}from"./chunk-s49529x2.js";import{Ib as V6}from"./chunk-sdj112nj.js";import{Jb as SK}from"./chunk-gv4v6qsg.js";import{Kb as CY}from"./chunk-9r2k5ykk.js";import{Mb as wu,Nb as rD,Ob as Ru,Vb as d2,Wb as Z2,Zb as GK,_b as f}from"./chunk-whj1a3vr.js";import{ac as JK}from"./chunk-sdx8r2qb.js";import{bc as X,cc as z,ec as f2}from"./chunk-6gtmkbh0.js";var o1=z((lB)=>{Object.defineProperty(lB,"__esModule",{value:!0});lB.ApplicationInSerializer=void 0;lB.ApplicationInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid}}}});var D8=z((iB)=>{Object.defineProperty(iB,"__esModule",{value:!0});iB.ApplicationOutSerializer=void 0;iB.ApplicationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt}}}});var aB=z((nB)=>{Object.defineProperty(nB,"__esModule",{value:!0});nB.ApplicationPatchSerializer=void 0;nB.ApplicationPatchSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,rateLimit:u.rateLimit,uid:u.uid}}}});var eB=z((tB)=>{Object.defineProperty(tB,"__esModule",{value:!0});tB.ListResponseApplicationOutSerializer=void 0;var sB=D8();tB.ListResponseApplicationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>sB.ApplicationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>sB.ApplicationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var B8=z((DA)=>{Object.defineProperty(DA,"__esModule",{value:!0});DA.ApiException=void 0;class uA extends Error{constructor(u,D,B){super(`HTTP-Code: ${u}
|
|
3
|
+
Headers: ${JSON.stringify(B)}`);this.code=u,this.body=D,this.headers={},B.forEach((A,w)=>{this.headers[w]=A})}}DA.ApiException=uA});var _=z((L2)=>{var Lu=L2&&L2.__awaiter||function(u,D,B,A){function w(F){return F instanceof B?F:new B(function(G){G(F)})}return new(B||(B=Promise))(function(F,G){function N(Q){try{Z(A.next(Q))}catch(J){G(J)}}function $(Q){try{Z(A.throw(Q))}catch(J){G(J)}}function Z(Q){Q.done?F(Q.value):w(Q.value).then(N,$)}Z((A=A.apply(u,D||[])).next())})};Object.defineProperty(L2,"__esModule",{value:!0});L2.SvixRequest=L2.HttpMethod=L2.LIB_VERSION=void 0;var A8=B8();L2.LIB_VERSION="1.92.2";var jx=`svix-libs/${L2.LIB_VERSION}/javascript`,lx;(function(u){u.GET="GET",u.HEAD="HEAD",u.POST="POST",u.PUT="PUT",u.DELETE="DELETE",u.CONNECT="CONNECT",u.OPTIONS="OPTIONS",u.TRACE="TRACE",u.PATCH="PATCH"})(lx=L2.HttpMethod||(L2.HttpMethod={}));class AA{constructor(u,D){this.method=u,this.path=D,this.queryParams={},this.headerParams={}}setPathParam(u,D){let B=this.path.replace(`{${u}}`,encodeURIComponent(D));if(this.path===B)throw Error(`path parameter ${u} not found`);this.path=B}setQueryParams(u){for(let[D,B]of Object.entries(u))this.setQueryParam(D,B)}setQueryParam(u,D){if(D===void 0||D===null)return;if(typeof D==="string")this.queryParams[u]=D;else if(typeof D==="boolean"||typeof D==="number")this.queryParams[u]=D.toString();else if(D instanceof Date)this.queryParams[u]=D.toISOString();else if(Array.isArray(D)){if(D.length>0)this.queryParams[u]=D.join(",")}else{let B=D;throw Error(`query parameter ${u} has unsupported type`)}}setHeaderParam(u,D){if(D===void 0)return;this.headerParams[u]=D}setBody(u){this.body=JSON.stringify(u)}send(u,D){return Lu(this,void 0,void 0,function*(){let B=yield this.sendInner(u);if(B.status===204)return null;let A=yield B.text();return D(JSON.parse(A))})}sendNoResponseBody(u){return Lu(this,void 0,void 0,function*(){yield this.sendInner(u)})}sendInner(u){var D,B;return Lu(this,void 0,void 0,function*(){let A=new URL(u.baseUrl+this.path);for(let[N,$]of Object.entries(this.queryParams))A.searchParams.set(N,$);if(this.headerParams["idempotency-key"]===void 0&&this.method.toUpperCase()==="POST")this.headerParams["idempotency-key"]=`auto_${crypto.randomUUID()}`;let w=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER);if(this.body!=null)this.headerParams["content-type"]="application/json";let F="credentials"in Request.prototype,G=yield wA(A,{method:this.method.toString(),body:this.body,headers:Object.assign({accept:"application/json, */*;q=0.8",authorization:`Bearer ${u.token}`,"user-agent":jx,"svix-req-id":w.toString()},this.headerParams),credentials:F?"same-origin":void 0,signal:u.timeout!==void 0?AbortSignal.timeout(u.timeout):void 0},u.retryScheduleInMs,(D=u.retryScheduleInMs)===null||D===void 0?void 0:D[0],((B=u.retryScheduleInMs)===null||B===void 0?void 0:B.length)||u.numRetries,u.fetch);return dx(G)})}}L2.SvixRequest=AA;function dx(u){return Lu(this,void 0,void 0,function*(){if(u.status<300)return u;let D=yield u.text();if(u.status===422)throw new A8.ApiException(u.status,JSON.parse(D),u.headers);if(u.status>=400&&u.status<=499)throw new A8.ApiException(u.status,JSON.parse(D),u.headers);throw new A8.ApiException(u.status,D,u.headers)})}function wA(u,D,B,A=50,w=2,F=fetch,G=1){return Lu(this,void 0,void 0,function*(){let N=($)=>new Promise((Z)=>setTimeout(Z,$));try{let $=yield F(u,D);if(w<=0||$.status<500)return $}catch($){if(w<=0)throw $}return yield N(A),D.headers["svix-retry-count"]=G.toString(),A=(B===null||B===void 0?void 0:B[G])||A*2,yield wA(u,D,B,A,--w,F,++G)})}});var $A=z((GA)=>{Object.defineProperty(GA,"__esModule",{value:!0});GA.Application=void 0;var w8=o1(),cu=D8(),ix=aB(),rx=eB(),v2=_();class FA{constructor(u){this.requestCtx=u}list(u){let D=new v2.SvixRequest(v2.HttpMethod.GET,"/api/v1/app");return D.setQueryParams({exclude_apps_with_no_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithNoEndpoints,exclude_apps_with_disabled_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithDisabledEndpoints,exclude_apps_with_svix_play_endpoints:u===null||u===void 0?void 0:u.excludeAppsWithSvixPlayEndpoints,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,rx.ListResponseApplicationOutSerializer._fromJsonObject)}create(u,D){let B=new v2.SvixRequest(v2.HttpMethod.POST,"/api/v1/app");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(w8.ApplicationInSerializer._toJsonObject(u)),B.send(this.requestCtx,cu.ApplicationOutSerializer._fromJsonObject)}getOrCreate(u,D){let B=new v2.SvixRequest(v2.HttpMethod.POST,"/api/v1/app");return B.setQueryParam("get_if_exists",!0),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(w8.ApplicationInSerializer._toJsonObject(u)),B.send(this.requestCtx,cu.ApplicationOutSerializer._fromJsonObject)}get(u){let D=new v2.SvixRequest(v2.HttpMethod.GET,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.send(this.requestCtx,cu.ApplicationOutSerializer._fromJsonObject)}update(u,D){let B=new v2.SvixRequest(v2.HttpMethod.PUT,"/api/v1/app/{app_id}");return B.setPathParam("app_id",u),B.setBody(w8.ApplicationInSerializer._toJsonObject(D)),B.send(this.requestCtx,cu.ApplicationOutSerializer._fromJsonObject)}delete(u){let D=new v2.SvixRequest(v2.HttpMethod.DELETE,"/api/v1/app/{app_id}");return D.setPathParam("app_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new v2.SvixRequest(v2.HttpMethod.PATCH,"/api/v1/app/{app_id}");return B.setPathParam("app_id",u),B.setBody(ix.ApplicationPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,cu.ApplicationOutSerializer._fromJsonObject)}}GA.Application=FA});var JA=z((zA)=>{Object.defineProperty(zA,"__esModule",{value:!0});zA.ApiTokenOutSerializer=void 0;zA.ApiTokenOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),expiresAt:u.expiresAt?new Date(u.expiresAt):null,id:u.id,name:u.name,scopes:u.scopes,token:u.token}},_toJsonObject(u){return{createdAt:u.createdAt,expiresAt:u.expiresAt,id:u.id,name:u.name,scopes:u.scopes,token:u.token}}}});var F8=z((QA)=>{Object.defineProperty(QA,"__esModule",{value:!0});QA.AppPortalCapabilitySerializer=QA.AppPortalCapability=void 0;var nx;(function(u){u.ViewBase="ViewBase",u.ViewEndpointSecret="ViewEndpointSecret",u.ManageEndpointSecret="ManageEndpointSecret",u.ManageTransformations="ManageTransformations",u.CreateAttempts="CreateAttempts",u.ManageEndpoint="ManageEndpoint"})(nx=QA.AppPortalCapability||(QA.AppPortalCapability={}));QA.AppPortalCapabilitySerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var xA=z((KA)=>{Object.defineProperty(KA,"__esModule",{value:!0});KA.AppPortalAccessInSerializer=void 0;var XA=F8(),YA=o1();KA.AppPortalAccessInSerializer={_fromJsonObject(u){var D;return{application:u.application!=null?YA.ApplicationInSerializer._fromJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((B)=>XA.AppPortalCapabilitySerializer._fromJsonObject(B)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}},_toJsonObject(u){var D;return{application:u.application!=null?YA.ApplicationInSerializer._toJsonObject(u.application):void 0,capabilities:(D=u.capabilities)===null||D===void 0?void 0:D.map((B)=>XA.AppPortalCapabilitySerializer._toJsonObject(B)),expiry:u.expiry,featureFlags:u.featureFlags,readOnly:u.readOnly,sessionId:u.sessionId}}}});var RA=z((HA)=>{Object.defineProperty(HA,"__esModule",{value:!0});HA.AppPortalAccessOutSerializer=void 0;HA.AppPortalAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var LA=z((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.ApplicationTokenExpireInSerializer=void 0;UA.ApplicationTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var OA=z((cA)=>{Object.defineProperty(cA,"__esModule",{value:!0});cA.RotatePollerTokenInSerializer=void 0;cA.RotatePollerTokenInSerializer={_fromJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}},_toJsonObject(u){return{expiry:u.expiry,oldTokenExpiry:u.oldTokenExpiry}}}});var kA=z((CA)=>{Object.defineProperty(CA,"__esModule",{value:!0});CA.StreamPortalAccessInSerializer=void 0;CA.StreamPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}},_toJsonObject(u){return{expiry:u.expiry,featureFlags:u.featureFlags,sessionId:u.sessionId}}}});var TA=z((VA)=>{Object.defineProperty(VA,"__esModule",{value:!0});VA.StreamTokenExpireInSerializer=void 0;VA.StreamTokenExpireInSerializer={_fromJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}},_toJsonObject(u){return{expiry:u.expiry,sessionIds:u.sessionIds}}}});var G8=z((IA)=>{Object.defineProperty(IA,"__esModule",{value:!0});IA.DashboardAccessOutSerializer=void 0;IA.DashboardAccessOutSerializer={_fromJsonObject(u){return{token:u.token,url:u.url}},_toJsonObject(u){return{token:u.token,url:u.url}}}});var jA=z((fA)=>{Object.defineProperty(fA,"__esModule",{value:!0});fA.Authentication=void 0;var mA=JA(),px=xA(),_A=RA(),ax=LA(),sx=OA(),tx=kA(),ox=TA(),ex=G8(),u2=_();class gA{constructor(u){this.requestCtx=u}appPortalAccess(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/app-portal-access/{app_id}");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(px.AppPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,_A.AppPortalAccessOutSerializer._fromJsonObject)}expireAll(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/app/{app_id}/expire-all");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(ax.ApplicationTokenExpireInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}dashboardAccess(u,D){let B=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/dashboard-access/{app_id}");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,ex.DashboardAccessOutSerializer._fromJsonObject)}logout(u){let D=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamLogout(u){let D=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream-logout");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.sendNoResponseBody(this.requestCtx)}streamPortalAccess(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream-portal-access/{stream_id}");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(tx.StreamPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,_A.AppPortalAccessOutSerializer._fromJsonObject)}streamExpireAll(u,D,B){let A=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/expire-all");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(ox.StreamTokenExpireInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}getStreamPollerToken(u,D){let B=new u2.SvixRequest(u2.HttpMethod.GET,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,mA.ApiTokenOutSerializer._fromJsonObject)}rotateStreamPollerToken(u,D,B,A){let w=new u2.SvixRequest(u2.HttpMethod.POST,"/api/v1/auth/stream/{stream_id}/sink/{sink_id}/poller/token/rotate");return w.setPathParam("stream_id",u),w.setPathParam("sink_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(sx.RotatePollerTokenInSerializer._toJsonObject(B)),w.send(this.requestCtx,mA.ApiTokenOutSerializer._fromJsonObject)}}fA.Authentication=gA});var e2=z((dA)=>{Object.defineProperty(dA,"__esModule",{value:!0});dA.BackgroundTaskStatusSerializer=dA.BackgroundTaskStatus=void 0;var uH;(function(u){u.Running="running",u.Finished="finished",u.Failed="failed"})(uH=dA.BackgroundTaskStatus||(dA.BackgroundTaskStatus={}));dA.BackgroundTaskStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var u0=z((nA)=>{Object.defineProperty(nA,"__esModule",{value:!0});nA.BackgroundTaskTypeSerializer=nA.BackgroundTaskType=void 0;var DH;(function(u){u.EndpointReplay="endpoint.replay",u.EndpointRecover="endpoint.recover",u.ApplicationStats="application.stats",u.MessageBroadcast="message.broadcast",u.SdkGenerate="sdk.generate",u.EventTypeAggregate="event-type.aggregate",u.ApplicationPurgeContent="application.purge_content",u.EndpointBulkReplay="endpoint.bulk-replay"})(DH=nA.BackgroundTaskType||(nA.BackgroundTaskType={}));nA.BackgroundTaskTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var N8=z((tA)=>{Object.defineProperty(tA,"__esModule",{value:!0});tA.BackgroundTaskOutSerializer=void 0;var aA=e2(),sA=u0();tA.BackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data,id:u.id,status:aA.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:sA.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{data:u.data,id:u.id,status:aA.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:sA.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var Bw=z((uw)=>{Object.defineProperty(uw,"__esModule",{value:!0});uw.ListResponseBackgroundTaskOutSerializer=void 0;var eA=N8();uw.ListResponseBackgroundTaskOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>eA.BackgroundTaskOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>eA.BackgroundTaskOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Gw=z((ww)=>{Object.defineProperty(ww,"__esModule",{value:!0});ww.BackgroundTask=void 0;var BH=N8(),AH=Bw(),e1=_();class Aw{constructor(u){this.requestCtx=u}list(u){let D=new e1.SvixRequest(e1.HttpMethod.GET,"/api/v1/background-task");return D.setQueryParams({status:u===null||u===void 0?void 0:u.status,task:u===null||u===void 0?void 0:u.task,limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,AH.ListResponseBackgroundTaskOutSerializer._fromJsonObject)}listByEndpoint(u){return this.list(u)}get(u){let D=new e1.SvixRequest(e1.HttpMethod.GET,"/api/v1/background-task/{task_id}");return D.setPathParam("task_id",u),D.send(this.requestCtx,BH.BackgroundTaskOutSerializer._fromJsonObject)}}ww.BackgroundTask=Aw});var I0=z(($w)=>{Object.defineProperty($w,"__esModule",{value:!0});$w.ConnectorKindSerializer=$w.ConnectorKind=void 0;var wH;(function(u){u.Custom="Custom",u.AgenticCommerceProtocol="AgenticCommerceProtocol",u.CloseCrm="CloseCRM",u.CustomerIo="CustomerIO",u.Discord="Discord",u.Hubspot="Hubspot",u.Inngest="Inngest",u.Loops="Loops",u.Otel="Otel",u.Resend="Resend",u.Salesforce="Salesforce",u.Segment="Segment",u.Sendgrid="Sendgrid",u.Slack="Slack",u.Teams="Teams",u.TriggerDev="TriggerDev",u.Windmill="Windmill",u.Zapier="Zapier"})(wH=$w.ConnectorKind||($w.ConnectorKind={}));$w.ConnectorKindSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var u3=z((Jw)=>{Object.defineProperty(Jw,"__esModule",{value:!0});Jw.ConnectorProductSerializer=Jw.ConnectorProduct=void 0;var FH;(function(u){u.Dispatch="Dispatch",u.Stream="Stream"})(FH=Jw.ConnectorProduct||(Jw.ConnectorProduct={}));Jw.ConnectorProductSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var $8=z((Xw)=>{Object.defineProperty(Xw,"__esModule",{value:!0});Xw.ConnectorInSerializer=void 0;var Qw=I0(),Ww=u3();Xw.ConnectorInSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Qw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?Ww.ConnectorProductSerializer._fromJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Qw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,productType:u.productType!=null?Ww.ConnectorProductSerializer._toJsonObject(u.productType):void 0,transformation:u.transformation,uid:u.uid}}}});var D3=z((xw)=>{Object.defineProperty(xw,"__esModule",{value:!0});xw.ConnectorOutSerializer=void 0;var Kw=I0(),hw=u3();xw.ConnectorOutSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:new Date(u.createdAt),description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:Kw.ConnectorKindSerializer._fromJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:hw.ConnectorProductSerializer._fromJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:new Date(u.transformationUpdatedAt),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,createdAt:u.createdAt,description:u.description,featureFlags:u.featureFlags,id:u.id,instructions:u.instructions,kind:Kw.ConnectorKindSerializer._toJsonObject(u.kind),logo:u.logo,name:u.name,orgId:u.orgId,productType:hw.ConnectorProductSerializer._toJsonObject(u.productType),transformation:u.transformation,transformationUpdatedAt:u.transformationUpdatedAt,uid:u.uid,updatedAt:u.updatedAt}}}});var Mw=z((Rw)=>{Object.defineProperty(Rw,"__esModule",{value:!0});Rw.ConnectorPatchSerializer=void 0;var Sw=I0();Rw.ConnectorPatchSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Sw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Sw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var Ow=z((cw)=>{Object.defineProperty(cw,"__esModule",{value:!0});cw.ConnectorUpdateSerializer=void 0;var Lw=I0();cw.ConnectorUpdateSerializer={_fromJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Lw.ConnectorKindSerializer._fromJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}},_toJsonObject(u){return{allowedEventTypes:u.allowedEventTypes,description:u.description,featureFlags:u.featureFlags,instructions:u.instructions,kind:u.kind!=null?Lw.ConnectorKindSerializer._toJsonObject(u.kind):void 0,logo:u.logo,name:u.name,transformation:u.transformation}}}});var Vw=z((Pw)=>{Object.defineProperty(Pw,"__esModule",{value:!0});Pw.ListResponseConnectorOutSerializer=void 0;var Cw=D3();Pw.ListResponseConnectorOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Cw.ConnectorOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Cw.ConnectorOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var qw=z((Tw)=>{Object.defineProperty(Tw,"__esModule",{value:!0});Tw.Connector=void 0;var GH=$8(),B3=D3(),NH=Mw(),$H=Ow(),zH=Vw(),c2=_();class yw{constructor(u){this.requestCtx=u}list(u){let D=new c2.SvixRequest(c2.HttpMethod.GET,"/api/v1/connector");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,product_type:u===null||u===void 0?void 0:u.productType}),D.send(this.requestCtx,zH.ListResponseConnectorOutSerializer._fromJsonObject)}create(u,D){let B=new c2.SvixRequest(c2.HttpMethod.POST,"/api/v1/connector");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(GH.ConnectorInSerializer._toJsonObject(u)),B.send(this.requestCtx,B3.ConnectorOutSerializer._fromJsonObject)}get(u){let D=new c2.SvixRequest(c2.HttpMethod.GET,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.send(this.requestCtx,B3.ConnectorOutSerializer._fromJsonObject)}update(u,D){let B=new c2.SvixRequest(c2.HttpMethod.PUT,"/api/v1/connector/{connector_id}");return B.setPathParam("connector_id",u),B.setBody($H.ConnectorUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,B3.ConnectorOutSerializer._fromJsonObject)}delete(u){let D=new c2.SvixRequest(c2.HttpMethod.DELETE,"/api/v1/connector/{connector_id}");return D.setPathParam("connector_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new c2.SvixRequest(c2.HttpMethod.PATCH,"/api/v1/connector/{connector_id}");return B.setPathParam("connector_id",u),B.setBody(NH.ConnectorPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,B3.ConnectorOutSerializer._fromJsonObject)}}Tw.Connector=yw});var q0=z((_w)=>{Object.defineProperty(_w,"__esModule",{value:!0});_w.MessageStatusSerializer=_w.MessageStatus=void 0;var ZH;(function(u){u[u.Success=0]="Success",u[u.Pending=1]="Pending",u[u.Fail=2]="Fail",u[u.Sending=3]="Sending"})(ZH=_w.MessageStatus||(_w.MessageStatus={}));_w.MessageStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var z8=z((bw)=>{Object.defineProperty(bw,"__esModule",{value:!0});bw.StatusCodeClassSerializer=bw.StatusCodeClass=void 0;var JH;(function(u){u[u.CodeNone=0]="CodeNone",u[u.Code1xx=100]="Code1xx",u[u.Code2xx=200]="Code2xx",u[u.Code3xx=300]="Code3xx",u[u.Code4xx=400]="Code4xx",u[u.Code5xx=500]="Code5xx"})(JH=bw.StatusCodeClass||(bw.StatusCodeClass={}));bw.StatusCodeClassSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var nw=z((iw)=>{Object.defineProperty(iw,"__esModule",{value:!0});iw.BulkReplayInSerializer=void 0;var lw=q0(),dw=z8();iw.BulkReplayInSerializer={_fromJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:new Date(u.since),status:u.status!=null?lw.MessageStatusSerializer._fromJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?dw.StatusCodeClassSerializer._fromJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until?new Date(u.until):null}},_toJsonObject(u){return{channel:u.channel,eventTypes:u.eventTypes,since:u.since,status:u.status!=null?lw.MessageStatusSerializer._toJsonObject(u.status):void 0,statusCodeClass:u.statusCodeClass!=null?dw.StatusCodeClassSerializer._toJsonObject(u.statusCodeClass):void 0,tag:u.tag,until:u.until}}}});var sw=z((pw)=>{Object.defineProperty(pw,"__esModule",{value:!0});pw.EndpointHeadersInSerializer=void 0;pw.EndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var Z8=z((tw)=>{Object.defineProperty(tw,"__esModule",{value:!0});tw.EndpointHeadersOutSerializer=void 0;tw.EndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var D7=z((ew)=>{Object.defineProperty(ew,"__esModule",{value:!0});ew.EndpointHeadersPatchInSerializer=void 0;ew.EndpointHeadersPatchInSerializer={_fromJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}},_toJsonObject(u){return{deleteHeaders:u.deleteHeaders,headers:u.headers}}}});var w7=z((B7)=>{Object.defineProperty(B7,"__esModule",{value:!0});B7.EndpointInSerializer=void 0;B7.EndpointInSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,headers:u.headers,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var J8=z((F7)=>{Object.defineProperty(F7,"__esModule",{value:!0});F7.EndpointOutSerializer=void 0;F7.EndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var z7=z((N7)=>{Object.defineProperty(N7,"__esModule",{value:!0});N7.EndpointPatchSerializer=void 0;N7.EndpointPatchSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var v7=z((Z7)=>{Object.defineProperty(Z7,"__esModule",{value:!0});Z7.EndpointSecretOutSerializer=void 0;Z7.EndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var v8=z((Q7)=>{Object.defineProperty(Q7,"__esModule",{value:!0});Q7.EndpointSecretRotateInSerializer=void 0;Q7.EndpointSecretRotateInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var K7=z((X7)=>{Object.defineProperty(X7,"__esModule",{value:!0});X7.EndpointStatsSerializer=void 0;X7.EndpointStatsSerializer={_fromJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}},_toJsonObject(u){return{fail:u.fail,pending:u.pending,sending:u.sending,success:u.success}}}});var H7=z((h7)=>{Object.defineProperty(h7,"__esModule",{value:!0});h7.EndpointTransformationInSerializer=void 0;h7.EndpointTransformationInSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var U7=z((S7)=>{Object.defineProperty(S7,"__esModule",{value:!0});S7.EndpointTransformationOutSerializer=void 0;S7.EndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt?new Date(u.updatedAt):null}},_toJsonObject(u){return{code:u.code,enabled:u.enabled,updatedAt:u.updatedAt}}}});var c7=z((M7)=>{Object.defineProperty(M7,"__esModule",{value:!0});M7.EndpointTransformationPatchSerializer=void 0;M7.EndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var C7=z((E7)=>{Object.defineProperty(E7,"__esModule",{value:!0});E7.EndpointUpdateSerializer=void 0;E7.EndpointUpdateSerializer={_fromJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,throttleRate:u.throttleRate,uid:u.uid,url:u.url,version:u.version}}}});var V7=z((P7)=>{Object.defineProperty(P7,"__esModule",{value:!0});P7.EventExampleInSerializer=void 0;P7.EventExampleInSerializer={_fromJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}},_toJsonObject(u){return{eventType:u.eventType,exampleIndex:u.exampleIndex}}}});var q7=z((T7)=>{Object.defineProperty(T7,"__esModule",{value:!0});T7.ListResponseEndpointOutSerializer=void 0;var y7=J8();T7.ListResponseEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>y7.EndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>y7.EndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var Eu=z((m7)=>{Object.defineProperty(m7,"__esModule",{value:!0});m7.MessageOutSerializer=void 0;m7.MessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var b7=z((g7)=>{Object.defineProperty(g7,"__esModule",{value:!0});g7.RecoverInSerializer=void 0;g7.RecoverInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var r7=z((d7)=>{Object.defineProperty(d7,"__esModule",{value:!0});d7.RecoverOutSerializer=void 0;var j7=e2(),l7=u0();d7.RecoverOutSerializer={_fromJsonObject(u){return{id:u.id,status:j7.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:l7.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:j7.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:l7.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var a7=z((n7)=>{Object.defineProperty(n7,"__esModule",{value:!0});n7.ReplayInSerializer=void 0;n7.ReplayInSerializer={_fromJsonObject(u){return{since:new Date(u.since),until:u.until?new Date(u.until):null}},_toJsonObject(u){return{since:u.since,until:u.until}}}});var uF=z((o7)=>{Object.defineProperty(o7,"__esModule",{value:!0});o7.ReplayOutSerializer=void 0;var s7=e2(),t7=u0();o7.ReplayOutSerializer={_fromJsonObject(u){return{id:u.id,status:s7.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:t7.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:s7.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:t7.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var FF=z((AF)=>{Object.defineProperty(AF,"__esModule",{value:!0});AF.Endpoint=void 0;var vH=nw(),QH=sw(),WH=Z8(),XH=D7(),YH=w7(),A3=J8(),KH=z7(),hH=v7(),xH=v8(),HH=K7(),SH=H7(),RH=U7(),UH=c7(),MH=C7(),LH=V7(),cH=q7(),EH=Eu(),OH=b7(),CH=r7(),PH=a7(),DF=uF(),R=_();class BF{constructor(u){this.requestCtx=u}list(u,D){let B=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,cH.ListResponseEndpointOutSerializer._fromJsonObject)}create(u,D,B){let A=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(YH.EndpointInSerializer._toJsonObject(D)),A.send(this.requestCtx,A3.EndpointOutSerializer._fromJsonObject)}get(u,D){let B=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,A3.EndpointOutSerializer._fromJsonObject)}update(u,D,B){let A=new R.SvixRequest(R.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(MH.EndpointUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,A3.EndpointOutSerializer._fromJsonObject)}delete(u,D){let B=new R.SvixRequest(R.HttpMethod.DELETE,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.sendNoResponseBody(this.requestCtx)}patch(u,D,B){let A=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(KH.EndpointPatchSerializer._toJsonObject(B)),A.send(this.requestCtx,A3.EndpointOutSerializer._fromJsonObject)}bulkReplay(u,D,B,A){let w=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/bulk-replay");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(vH.BulkReplayInSerializer._toJsonObject(B)),w.send(this.requestCtx,DF.ReplayOutSerializer._fromJsonObject)}getHeaders(u,D){let B=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,WH.EndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,B){let A=new R.SvixRequest(R.HttpMethod.PUT,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(QH.EndpointHeadersInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}headersUpdate(u,D,B){return this.updateHeaders(u,D,B)}patchHeaders(u,D,B){let A=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(XH.EndpointHeadersPatchInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}headersPatch(u,D,B){return this.patchHeaders(u,D,B)}recover(u,D,B,A){let w=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(OH.RecoverInSerializer._toJsonObject(B)),w.send(this.requestCtx,CH.RecoverOutSerializer._fromJsonObject)}replayMissing(u,D,B,A){let w=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(PH.ReplayInSerializer._toJsonObject(B)),w.send(this.requestCtx,DF.ReplayOutSerializer._fromJsonObject)}getSecret(u,D){let B=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,hH.EndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(xH.EndpointSecretRotateInSerializer._toJsonObject(B)),w.sendNoResponseBody(this.requestCtx)}sendExample(u,D,B,A){let w=new R.SvixRequest(R.HttpMethod.POST,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example");return w.setPathParam("app_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(LH.EventExampleInSerializer._toJsonObject(B)),w.send(this.requestCtx,EH.MessageOutSerializer._fromJsonObject)}getStats(u,D,B){let A=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({since:B===null||B===void 0?void 0:B.since,until:B===null||B===void 0?void 0:B.until}),A.send(this.requestCtx,HH.EndpointStatsSerializer._fromJsonObject)}transformationGet(u,D){let B=new R.SvixRequest(R.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("app_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,RH.EndpointTransformationOutSerializer._fromJsonObject)}patchTransformation(u,D,B){let A=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(UH.EndpointTransformationPatchSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}transformationPartialUpdate(u,D,B){let A=new R.SvixRequest(R.HttpMethod.PATCH,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setBody(SH.EndpointTransformationInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}}AF.Endpoint=BF});var Q8=z((GF)=>{Object.defineProperty(GF,"__esModule",{value:!0});GF.EventTypeInSerializer=void 0;GF.EventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var vF=z((ZF)=>{Object.defineProperty(ZF,"__esModule",{value:!0});ZF.EnvironmentInSerializer=void 0;var $F=$8(),zF=Q8();ZF.EnvironmentInSerializer={_fromJsonObject(u){var D,B;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((A)=>$F.ConnectorInSerializer._fromJsonObject(A)),eventTypes:(B=u.eventTypes)===null||B===void 0?void 0:B.map((A)=>zF.EventTypeInSerializer._fromJsonObject(A)),settings:u.settings}},_toJsonObject(u){var D,B;return{connectors:(D=u.connectors)===null||D===void 0?void 0:D.map((A)=>$F.ConnectorInSerializer._toJsonObject(A)),eventTypes:(B=u.eventTypes)===null||B===void 0?void 0:B.map((A)=>zF.EventTypeInSerializer._toJsonObject(A)),settings:u.settings}}}});var w3=z((QF)=>{Object.defineProperty(QF,"__esModule",{value:!0});QF.EventTypeOutSerializer=void 0;QF.EventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas,updatedAt:u.updatedAt}}}});var xF=z((KF)=>{Object.defineProperty(KF,"__esModule",{value:!0});KF.EnvironmentOutSerializer=void 0;var XF=D3(),YF=w3();KF.EnvironmentOutSerializer={_fromJsonObject(u){return{connectors:u.connectors.map((D)=>XF.ConnectorOutSerializer._fromJsonObject(D)),createdAt:new Date(u.createdAt),eventTypes:u.eventTypes.map((D)=>YF.EventTypeOutSerializer._fromJsonObject(D)),settings:u.settings,version:u.version}},_toJsonObject(u){return{connectors:u.connectors.map((D)=>XF.ConnectorOutSerializer._toJsonObject(D)),createdAt:u.createdAt,eventTypes:u.eventTypes.map((D)=>YF.EventTypeOutSerializer._toJsonObject(D)),settings:u.settings,version:u.version}}}});var UF=z((SF)=>{Object.defineProperty(SF,"__esModule",{value:!0});SF.Environment=void 0;var kH=vF(),VH=xF(),F3=_();class HF{constructor(u){this.requestCtx=u}export(u){let D=new F3.SvixRequest(F3.HttpMethod.POST,"/api/v1/environment/export");return D.setHeaderParam("idempotency-key",u===null||u===void 0?void 0:u.idempotencyKey),D.send(this.requestCtx,VH.EnvironmentOutSerializer._fromJsonObject)}import(u,D){let B=new F3.SvixRequest(F3.HttpMethod.POST,"/api/v1/environment/import");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(kH.EnvironmentInSerializer._toJsonObject(u)),B.sendNoResponseBody(this.requestCtx)}}SF.Environment=HF});var cF=z((MF)=>{Object.defineProperty(MF,"__esModule",{value:!0});MF.EventTypeImportOpenApiInSerializer=void 0;MF.EventTypeImportOpenApiInSerializer={_fromJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}},_toJsonObject(u){return{dryRun:u.dryRun,replaceAll:u.replaceAll,spec:u.spec,specRaw:u.specRaw}}}});var CF=z((EF)=>{Object.defineProperty(EF,"__esModule",{value:!0});EF.EventTypeFromOpenApiSerializer=void 0;EF.EventTypeFromOpenApiSerializer={_fromJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}},_toJsonObject(u){return{deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,name:u.name,schemas:u.schemas}}}});var yF=z((kF)=>{Object.defineProperty(kF,"__esModule",{value:!0});kF.EventTypeImportOpenApiOutDataSerializer=void 0;var PF=CF();kF.EventTypeImportOpenApiOutDataSerializer={_fromJsonObject(u){var D;return{modified:u.modified,toModify:(D=u.to_modify)===null||D===void 0?void 0:D.map((B)=>PF.EventTypeFromOpenApiSerializer._fromJsonObject(B))}},_toJsonObject(u){var D;return{modified:u.modified,to_modify:(D=u.toModify)===null||D===void 0?void 0:D.map((B)=>PF.EventTypeFromOpenApiSerializer._toJsonObject(B))}}}});var mF=z((IF)=>{Object.defineProperty(IF,"__esModule",{value:!0});IF.EventTypeImportOpenApiOutSerializer=void 0;var TF=yF();IF.EventTypeImportOpenApiOutSerializer={_fromJsonObject(u){return{data:TF.EventTypeImportOpenApiOutDataSerializer._fromJsonObject(u.data)}},_toJsonObject(u){return{data:TF.EventTypeImportOpenApiOutDataSerializer._toJsonObject(u.data)}}}});var fF=z((_F)=>{Object.defineProperty(_F,"__esModule",{value:!0});_F.EventTypePatchSerializer=void 0;_F.EventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var lF=z((bF)=>{Object.defineProperty(bF,"__esModule",{value:!0});bF.EventTypeUpdateSerializer=void 0;bF.EventTypeUpdateSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlag:u.featureFlag,featureFlags:u.featureFlags,groupName:u.groupName,schemas:u.schemas}}}});var nF=z((iF)=>{Object.defineProperty(iF,"__esModule",{value:!0});iF.ListResponseEventTypeOutSerializer=void 0;var dF=w3();iF.ListResponseEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>dF.EventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>dF.EventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var tF=z((aF)=>{Object.defineProperty(aF,"__esModule",{value:!0});aF.EventType=void 0;var yH=cF(),TH=mF(),IH=Q8(),G3=w3(),qH=fF(),mH=lF(),_H=nF(),Q2=_();class pF{constructor(u){this.requestCtx=u}list(u){let D=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived,with_content:u===null||u===void 0?void 0:u.withContent}),D.send(this.requestCtx,_H.ListResponseEventTypeOutSerializer._fromJsonObject)}create(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.POST,"/api/v1/event-type");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(IH.EventTypeInSerializer._toJsonObject(u)),B.send(this.requestCtx,G3.EventTypeOutSerializer._fromJsonObject)}importOpenapi(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.POST,"/api/v1/event-type/import/openapi");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(yH.EventTypeImportOpenApiInSerializer._toJsonObject(u)),B.send(this.requestCtx,TH.EventTypeImportOpenApiOutSerializer._fromJsonObject)}get(u){let D=new Q2.SvixRequest(Q2.HttpMethod.GET,"/api/v1/event-type/{event_type_name}");return D.setPathParam("event_type_name",u),D.send(this.requestCtx,G3.EventTypeOutSerializer._fromJsonObject)}update(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.PUT,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setBody(mH.EventTypeUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,G3.EventTypeOutSerializer._fromJsonObject)}delete(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.DELETE,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),B.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new Q2.SvixRequest(Q2.HttpMethod.PATCH,"/api/v1/event-type/{event_type_name}");return B.setPathParam("event_type_name",u),B.setBody(qH.EventTypePatchSerializer._toJsonObject(D)),B.send(this.requestCtx,G3.EventTypeOutSerializer._fromJsonObject)}}aF.EventType=pF});var BG=z((uG)=>{Object.defineProperty(uG,"__esModule",{value:!0});uG.Health=void 0;var oF=_();class eF{constructor(u){this.requestCtx=u}get(){return new oF.SvixRequest(oF.HttpMethod.GET,"/api/v1/health").sendNoResponseBody(this.requestCtx)}}uG.Health=eF});var FG=z((AG)=>{Object.defineProperty(AG,"__esModule",{value:!0});AG.IngestSourceConsumerPortalAccessInSerializer=void 0;AG.IngestSourceConsumerPortalAccessInSerializer={_fromJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}},_toJsonObject(u){return{expiry:u.expiry,readOnly:u.readOnly}}}});var $G=z((GG)=>{Object.defineProperty(GG,"__esModule",{value:!0});GG.IngestEndpointHeadersInSerializer=void 0;GG.IngestEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var JG=z((zG)=>{Object.defineProperty(zG,"__esModule",{value:!0});zG.IngestEndpointHeadersOutSerializer=void 0;zG.IngestEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var WG=z((vG)=>{Object.defineProperty(vG,"__esModule",{value:!0});vG.IngestEndpointInSerializer=void 0;vG.IngestEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var W8=z((XG)=>{Object.defineProperty(XG,"__esModule",{value:!0});XG.IngestEndpointOutSerializer=void 0;XG.IngestEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var xG=z((KG)=>{Object.defineProperty(KG,"__esModule",{value:!0});KG.IngestEndpointSecretInSerializer=void 0;KG.IngestEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var RG=z((HG)=>{Object.defineProperty(HG,"__esModule",{value:!0});HG.IngestEndpointSecretOutSerializer=void 0;HG.IngestEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var LG=z((UG)=>{Object.defineProperty(UG,"__esModule",{value:!0});UG.IngestEndpointTransformationOutSerializer=void 0;UG.IngestEndpointTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var OG=z((cG)=>{Object.defineProperty(cG,"__esModule",{value:!0});cG.IngestEndpointTransformationPatchSerializer=void 0;cG.IngestEndpointTransformationPatchSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var kG=z((CG)=>{Object.defineProperty(CG,"__esModule",{value:!0});CG.IngestEndpointUpdateSerializer=void 0;CG.IngestEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var IG=z((yG)=>{Object.defineProperty(yG,"__esModule",{value:!0});yG.ListResponseIngestEndpointOutSerializer=void 0;var VG=W8();yG.ListResponseIngestEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>VG.IngestEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>VG.IngestEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var gG=z((mG)=>{Object.defineProperty(mG,"__esModule",{value:!0});mG.IngestEndpoint=void 0;var gH=$G(),fH=JG(),bH=WG(),X8=W8(),jH=xG(),lH=RG(),dH=LG(),iH=OG(),rH=kG(),nH=IG(),b=_();class qG{constructor(u){this.requestCtx=u}list(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint");return B.setPathParam("source_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,nH.ListResponseIngestEndpointOutSerializer._fromJsonObject)}create(u,D,B){let A=new b.SvixRequest(b.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(bH.IngestEndpointInSerializer._toJsonObject(D)),A.send(this.requestCtx,X8.IngestEndpointOutSerializer._fromJsonObject)}get(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,X8.IngestEndpointOutSerializer._fromJsonObject)}update(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(rH.IngestEndpointUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,X8.IngestEndpointOutSerializer._fromJsonObject)}delete(u,D){let B=new b.SvixRequest(b.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.sendNoResponseBody(this.requestCtx)}getHeaders(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,fH.IngestEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/headers");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(gH.IngestEndpointHeadersInSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}getSecret(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,lH.IngestEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new b.SvixRequest(b.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/secret/rotate");return w.setPathParam("source_id",u),w.setPathParam("endpoint_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(jH.IngestEndpointSecretInSerializer._toJsonObject(B)),w.sendNoResponseBody(this.requestCtx)}getTransformation(u,D){let B=new b.SvixRequest(b.HttpMethod.GET,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return B.setPathParam("source_id",u),B.setPathParam("endpoint_id",D),B.send(this.requestCtx,dH.IngestEndpointTransformationOutSerializer._fromJsonObject)}setTransformation(u,D,B){let A=new b.SvixRequest(b.HttpMethod.PATCH,"/ingest/api/v1/source/{source_id}/endpoint/{endpoint_id}/transformation");return A.setPathParam("source_id",u),A.setPathParam("endpoint_id",D),A.setBody(iH.IngestEndpointTransformationPatchSerializer._toJsonObject(B)),A.sendNoResponseBody(this.requestCtx)}}mG.IngestEndpoint=qG});var jG=z((fG)=>{Object.defineProperty(fG,"__esModule",{value:!0});fG.AdobeSignConfigSerializer=void 0;fG.AdobeSignConfigSerializer={_fromJsonObject(u){return{clientId:u.clientId}},_toJsonObject(u){return{clientId:u.clientId}}}});var iG=z((lG)=>{Object.defineProperty(lG,"__esModule",{value:!0});lG.AirwallexConfigSerializer=void 0;lG.AirwallexConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var pG=z((rG)=>{Object.defineProperty(rG,"__esModule",{value:!0});rG.CheckbookConfigSerializer=void 0;rG.CheckbookConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var Y8=z((aG)=>{Object.defineProperty(aG,"__esModule",{value:!0});aG.CronConfigSerializer=void 0;aG.CronConfigSerializer={_fromJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}},_toJsonObject(u){return{contentType:u.contentType,payload:u.payload,schedule:u.schedule}}}});var eG=z((tG)=>{Object.defineProperty(tG,"__esModule",{value:!0});tG.DocusignConfigSerializer=void 0;tG.DocusignConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var BN=z((uN)=>{Object.defineProperty(uN,"__esModule",{value:!0});uN.EasypostConfigSerializer=void 0;uN.EasypostConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var FN=z((AN)=>{Object.defineProperty(AN,"__esModule",{value:!0});AN.GithubConfigSerializer=void 0;AN.GithubConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var $N=z((GN)=>{Object.defineProperty(GN,"__esModule",{value:!0});GN.HubspotConfigSerializer=void 0;GN.HubspotConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var JN=z((zN)=>{Object.defineProperty(zN,"__esModule",{value:!0});zN.MetaConfigSerializer=void 0;zN.MetaConfigSerializer={_fromJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}},_toJsonObject(u){return{secret:u.secret,verifyToken:u.verifyToken}}}});var WN=z((vN)=>{Object.defineProperty(vN,"__esModule",{value:!0});vN.OrumIoConfigSerializer=void 0;vN.OrumIoConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var KN=z((XN)=>{Object.defineProperty(XN,"__esModule",{value:!0});XN.PandaDocConfigSerializer=void 0;XN.PandaDocConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var HN=z((hN)=>{Object.defineProperty(hN,"__esModule",{value:!0});hN.PortIoConfigSerializer=void 0;hN.PortIoConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var UN=z((SN)=>{Object.defineProperty(SN,"__esModule",{value:!0});SN.RutterConfigSerializer=void 0;SN.RutterConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var cN=z((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});MN.SegmentConfigSerializer=void 0;MN.SegmentConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var CN=z((EN)=>{Object.defineProperty(EN,"__esModule",{value:!0});EN.ShopifyConfigSerializer=void 0;EN.ShopifyConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var VN=z((PN)=>{Object.defineProperty(PN,"__esModule",{value:!0});PN.SlackConfigSerializer=void 0;PN.SlackConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var IN=z((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});yN.StripeConfigSerializer=void 0;yN.StripeConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var _N=z((qN)=>{Object.defineProperty(qN,"__esModule",{value:!0});qN.SvixConfigSerializer=void 0;qN.SvixConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var bN=z((gN)=>{Object.defineProperty(gN,"__esModule",{value:!0});gN.TelnyxConfigSerializer=void 0;gN.TelnyxConfigSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var dN=z((jN)=>{Object.defineProperty(jN,"__esModule",{value:!0});jN.VapiConfigSerializer=void 0;jN.VapiConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var nN=z((iN)=>{Object.defineProperty(iN,"__esModule",{value:!0});iN.VeriffConfigSerializer=void 0;iN.VeriffConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var sN=z((pN)=>{Object.defineProperty(pN,"__esModule",{value:!0});pN.ZoomConfigSerializer=void 0;pN.ZoomConfigSerializer={_fromJsonObject(u){return{secret:u.secret}},_toJsonObject(u){return{secret:u.secret}}}});var H$=z((h$)=>{Object.defineProperty(h$,"__esModule",{value:!0});h$.IngestSourceInSerializer=void 0;var tN=jG(),oN=iG(),eN=pG(),u$=Y8(),D$=eG(),B$=BN(),A$=FN(),w$=$N(),F$=JN(),G$=WN(),N$=KN(),$$=HN(),z$=UN(),Z$=cN(),J$=CN(),v$=VN(),Q$=IN(),C=_N(),W$=bN(),X$=dN(),Y$=nN(),K$=sN();h$.IngestSourceInSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"generic-webhook":return{};case"cron":return u$.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return tN.AdobeSignConfigSerializer._fromJsonObject(u.config);case"beehiiv":return C.SvixConfigSerializer._fromJsonObject(u.config);case"brex":return C.SvixConfigSerializer._fromJsonObject(u.config);case"checkbook":return eN.CheckbookConfigSerializer._fromJsonObject(u.config);case"clerk":return C.SvixConfigSerializer._fromJsonObject(u.config);case"docusign":return D$.DocusignConfigSerializer._fromJsonObject(u.config);case"easypost":return B$.EasypostConfigSerializer._fromJsonObject(u.config);case"github":return A$.GithubConfigSerializer._fromJsonObject(u.config);case"guesty":return C.SvixConfigSerializer._fromJsonObject(u.config);case"hubspot":return w$.HubspotConfigSerializer._fromJsonObject(u.config);case"incident-io":return C.SvixConfigSerializer._fromJsonObject(u.config);case"lithic":return C.SvixConfigSerializer._fromJsonObject(u.config);case"meta":return F$.MetaConfigSerializer._fromJsonObject(u.config);case"nash":return C.SvixConfigSerializer._fromJsonObject(u.config);case"orum-io":return G$.OrumIoConfigSerializer._fromJsonObject(u.config);case"panda-doc":return N$.PandaDocConfigSerializer._fromJsonObject(u.config);case"port-io":return $$.PortIoConfigSerializer._fromJsonObject(u.config);case"pleo":return C.SvixConfigSerializer._fromJsonObject(u.config);case"psi-fi":return C.SvixConfigSerializer._fromJsonObject(u.config);case"replicate":return C.SvixConfigSerializer._fromJsonObject(u.config);case"resend":return C.SvixConfigSerializer._fromJsonObject(u.config);case"rutter":return z$.RutterConfigSerializer._fromJsonObject(u.config);case"safebase":return C.SvixConfigSerializer._fromJsonObject(u.config);case"sardine":return C.SvixConfigSerializer._fromJsonObject(u.config);case"segment":return Z$.SegmentConfigSerializer._fromJsonObject(u.config);case"shopify":return J$.ShopifyConfigSerializer._fromJsonObject(u.config);case"slack":return v$.SlackConfigSerializer._fromJsonObject(u.config);case"stripe":return Q$.StripeConfigSerializer._fromJsonObject(u.config);case"stych":return C.SvixConfigSerializer._fromJsonObject(u.config);case"svix":return C.SvixConfigSerializer._fromJsonObject(u.config);case"zoom":return K$.ZoomConfigSerializer._fromJsonObject(u.config);case"telnyx":return W$.TelnyxConfigSerializer._fromJsonObject(u.config);case"vapi":return X$.VapiConfigSerializer._fromJsonObject(u.config);case"open-ai":return C.SvixConfigSerializer._fromJsonObject(u.config);case"render":return C.SvixConfigSerializer._fromJsonObject(u.config);case"veriff":return Y$.VeriffConfigSerializer._fromJsonObject(u.config);case"airwallex":return oN.AirwallexConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=u$.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=tN.AdobeSignConfigSerializer._toJsonObject(u.config);break;case"beehiiv":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"brex":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"checkbook":D=eN.CheckbookConfigSerializer._toJsonObject(u.config);break;case"clerk":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"docusign":D=D$.DocusignConfigSerializer._toJsonObject(u.config);break;case"easypost":D=B$.EasypostConfigSerializer._toJsonObject(u.config);break;case"github":D=A$.GithubConfigSerializer._toJsonObject(u.config);break;case"guesty":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"hubspot":D=w$.HubspotConfigSerializer._toJsonObject(u.config);break;case"incident-io":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"lithic":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"meta":D=F$.MetaConfigSerializer._toJsonObject(u.config);break;case"nash":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"orum-io":D=G$.OrumIoConfigSerializer._toJsonObject(u.config);break;case"panda-doc":D=N$.PandaDocConfigSerializer._toJsonObject(u.config);break;case"port-io":D=$$.PortIoConfigSerializer._toJsonObject(u.config);break;case"pleo":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"psi-fi":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"replicate":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"resend":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"rutter":D=z$.RutterConfigSerializer._toJsonObject(u.config);break;case"safebase":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"sardine":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"segment":D=Z$.SegmentConfigSerializer._toJsonObject(u.config);break;case"shopify":D=J$.ShopifyConfigSerializer._toJsonObject(u.config);break;case"slack":D=v$.SlackConfigSerializer._toJsonObject(u.config);break;case"stripe":D=Q$.StripeConfigSerializer._toJsonObject(u.config);break;case"stych":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"svix":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"zoom":D=K$.ZoomConfigSerializer._toJsonObject(u.config);break;case"telnyx":D=W$.TelnyxConfigSerializer._toJsonObject(u.config);break;case"vapi":D=X$.VapiConfigSerializer._toJsonObject(u.config);break;case"open-ai":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"render":D=C.SvixConfigSerializer._toJsonObject(u.config);break;case"veriff":D=Y$.VeriffConfigSerializer._toJsonObject(u.config);break;case"airwallex":D=oN.AirwallexConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,metadata:u.metadata,name:u.name,uid:u.uid}}}});var U$=z((S$)=>{Object.defineProperty(S$,"__esModule",{value:!0});S$.AdobeSignConfigOutSerializer=void 0;S$.AdobeSignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var c$=z((M$)=>{Object.defineProperty(M$,"__esModule",{value:!0});M$.AirwallexConfigOutSerializer=void 0;M$.AirwallexConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var C$=z((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});E$.CheckbookConfigOutSerializer=void 0;E$.CheckbookConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var V$=z((P$)=>{Object.defineProperty(P$,"__esModule",{value:!0});P$.DocusignConfigOutSerializer=void 0;P$.DocusignConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var I$=z((y$)=>{Object.defineProperty(y$,"__esModule",{value:!0});y$.EasypostConfigOutSerializer=void 0;y$.EasypostConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var _$=z((q$)=>{Object.defineProperty(q$,"__esModule",{value:!0});q$.GithubConfigOutSerializer=void 0;q$.GithubConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var b$=z((g$)=>{Object.defineProperty(g$,"__esModule",{value:!0});g$.HubspotConfigOutSerializer=void 0;g$.HubspotConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var d$=z((j$)=>{Object.defineProperty(j$,"__esModule",{value:!0});j$.MetaConfigOutSerializer=void 0;j$.MetaConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var n$=z((i$)=>{Object.defineProperty(i$,"__esModule",{value:!0});i$.OrumIoConfigOutSerializer=void 0;i$.OrumIoConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var s$=z((p$)=>{Object.defineProperty(p$,"__esModule",{value:!0});p$.PandaDocConfigOutSerializer=void 0;p$.PandaDocConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var e$=z((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.PortIoConfigOutSerializer=void 0;t$.PortIoConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Bz=z((uz)=>{Object.defineProperty(uz,"__esModule",{value:!0});uz.RutterConfigOutSerializer=void 0;uz.RutterConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Fz=z((Az)=>{Object.defineProperty(Az,"__esModule",{value:!0});Az.SegmentConfigOutSerializer=void 0;Az.SegmentConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var $z=z((Gz)=>{Object.defineProperty(Gz,"__esModule",{value:!0});Gz.ShopifyConfigOutSerializer=void 0;Gz.ShopifyConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Jz=z((zz)=>{Object.defineProperty(zz,"__esModule",{value:!0});zz.SlackConfigOutSerializer=void 0;zz.SlackConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Wz=z((vz)=>{Object.defineProperty(vz,"__esModule",{value:!0});vz.StripeConfigOutSerializer=void 0;vz.StripeConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Kz=z((Xz)=>{Object.defineProperty(Xz,"__esModule",{value:!0});Xz.SvixConfigOutSerializer=void 0;Xz.SvixConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Hz=z((hz)=>{Object.defineProperty(hz,"__esModule",{value:!0});hz.TelnyxConfigOutSerializer=void 0;hz.TelnyxConfigOutSerializer={_fromJsonObject(u){return{publicKey:u.publicKey}},_toJsonObject(u){return{publicKey:u.publicKey}}}});var Uz=z((Sz)=>{Object.defineProperty(Sz,"__esModule",{value:!0});Sz.VapiConfigOutSerializer=void 0;Sz.VapiConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var cz=z((Mz)=>{Object.defineProperty(Mz,"__esModule",{value:!0});Mz.VeriffConfigOutSerializer=void 0;Mz.VeriffConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Cz=z((Ez)=>{Object.defineProperty(Ez,"__esModule",{value:!0});Ez.ZoomConfigOutSerializer=void 0;Ez.ZoomConfigOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var K8=z((tz)=>{Object.defineProperty(tz,"__esModule",{value:!0});tz.IngestSourceOutSerializer=void 0;var Pz=U$(),kz=c$(),Vz=C$(),yz=Y8(),Tz=V$(),Iz=I$(),qz=_$(),mz=b$(),_z=d$(),gz=n$(),fz=s$(),bz=e$(),jz=Bz(),lz=Fz(),dz=$z(),iz=Jz(),rz=Wz(),P=Kz(),nz=Hz(),pz=Uz(),az=cz(),sz=Cz();tz.IngestSourceOutSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"generic-webhook":return{};case"cron":return yz.CronConfigSerializer._fromJsonObject(u.config);case"adobe-sign":return Pz.AdobeSignConfigOutSerializer._fromJsonObject(u.config);case"beehiiv":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"brex":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"checkbook":return Vz.CheckbookConfigOutSerializer._fromJsonObject(u.config);case"clerk":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"docusign":return Tz.DocusignConfigOutSerializer._fromJsonObject(u.config);case"easypost":return Iz.EasypostConfigOutSerializer._fromJsonObject(u.config);case"github":return qz.GithubConfigOutSerializer._fromJsonObject(u.config);case"guesty":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"hubspot":return mz.HubspotConfigOutSerializer._fromJsonObject(u.config);case"incident-io":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"lithic":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"meta":return _z.MetaConfigOutSerializer._fromJsonObject(u.config);case"nash":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"orum-io":return gz.OrumIoConfigOutSerializer._fromJsonObject(u.config);case"panda-doc":return fz.PandaDocConfigOutSerializer._fromJsonObject(u.config);case"port-io":return bz.PortIoConfigOutSerializer._fromJsonObject(u.config);case"psi-fi":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"pleo":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"replicate":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"resend":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"rutter":return jz.RutterConfigOutSerializer._fromJsonObject(u.config);case"safebase":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"sardine":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"segment":return lz.SegmentConfigOutSerializer._fromJsonObject(u.config);case"shopify":return dz.ShopifyConfigOutSerializer._fromJsonObject(u.config);case"slack":return iz.SlackConfigOutSerializer._fromJsonObject(u.config);case"stripe":return rz.StripeConfigOutSerializer._fromJsonObject(u.config);case"stych":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"svix":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"zoom":return sz.ZoomConfigOutSerializer._fromJsonObject(u.config);case"telnyx":return nz.TelnyxConfigOutSerializer._fromJsonObject(u.config);case"vapi":return pz.VapiConfigOutSerializer._fromJsonObject(u.config);case"open-ai":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"render":return P.SvixConfigOutSerializer._fromJsonObject(u.config);case"veriff":return az.VeriffConfigOutSerializer._fromJsonObject(u.config);case"airwallex":return kz.AirwallexConfigOutSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),createdAt:new Date(u.createdAt),id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"generic-webhook":D={};break;case"cron":D=yz.CronConfigSerializer._toJsonObject(u.config);break;case"adobe-sign":D=Pz.AdobeSignConfigOutSerializer._toJsonObject(u.config);break;case"beehiiv":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"brex":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"checkbook":D=Vz.CheckbookConfigOutSerializer._toJsonObject(u.config);break;case"clerk":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"docusign":D=Tz.DocusignConfigOutSerializer._toJsonObject(u.config);break;case"easypost":D=Iz.EasypostConfigOutSerializer._toJsonObject(u.config);break;case"github":D=qz.GithubConfigOutSerializer._toJsonObject(u.config);break;case"guesty":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"hubspot":D=mz.HubspotConfigOutSerializer._toJsonObject(u.config);break;case"incident-io":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"lithic":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"meta":D=_z.MetaConfigOutSerializer._toJsonObject(u.config);break;case"nash":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"orum-io":D=gz.OrumIoConfigOutSerializer._toJsonObject(u.config);break;case"panda-doc":D=fz.PandaDocConfigOutSerializer._toJsonObject(u.config);break;case"port-io":D=bz.PortIoConfigOutSerializer._toJsonObject(u.config);break;case"psi-fi":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"pleo":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"replicate":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"resend":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"rutter":D=jz.RutterConfigOutSerializer._toJsonObject(u.config);break;case"safebase":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"sardine":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"segment":D=lz.SegmentConfigOutSerializer._toJsonObject(u.config);break;case"shopify":D=dz.ShopifyConfigOutSerializer._toJsonObject(u.config);break;case"slack":D=iz.SlackConfigOutSerializer._toJsonObject(u.config);break;case"stripe":D=rz.StripeConfigOutSerializer._toJsonObject(u.config);break;case"stych":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"svix":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"zoom":D=sz.ZoomConfigOutSerializer._toJsonObject(u.config);break;case"telnyx":D=nz.TelnyxConfigOutSerializer._toJsonObject(u.config);break;case"vapi":D=pz.VapiConfigOutSerializer._toJsonObject(u.config);break;case"open-ai":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"render":D=P.SvixConfigOutSerializer._toJsonObject(u.config);break;case"veriff":D=az.VeriffConfigOutSerializer._toJsonObject(u.config);break;case"airwallex":D=kz.AirwallexConfigOutSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,createdAt:u.createdAt,id:u.id,ingestUrl:u.ingestUrl,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var BZ=z((uZ)=>{Object.defineProperty(uZ,"__esModule",{value:!0});uZ.ListResponseIngestSourceOutSerializer=void 0;var ez=K8();uZ.ListResponseIngestSourceOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>ez.IngestSourceOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>ez.IngestSourceOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var FZ=z((AZ)=>{Object.defineProperty(AZ,"__esModule",{value:!0});AZ.RotateTokenOutSerializer=void 0;AZ.RotateTokenOutSerializer={_fromJsonObject(u){return{ingestUrl:u.ingestUrl}},_toJsonObject(u){return{ingestUrl:u.ingestUrl}}}});var ZZ=z(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});$Z.IngestSource=void 0;var GZ=H$(),h8=K8(),pH=BZ(),aH=FZ(),E2=_();class NZ{constructor(u){this.requestCtx=u}list(u){let D=new E2.SvixRequest(E2.HttpMethod.GET,"/ingest/api/v1/source");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,pH.ListResponseIngestSourceOutSerializer._fromJsonObject)}create(u,D){let B=new E2.SvixRequest(E2.HttpMethod.POST,"/ingest/api/v1/source");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(GZ.IngestSourceInSerializer._toJsonObject(u)),B.send(this.requestCtx,h8.IngestSourceOutSerializer._fromJsonObject)}get(u){let D=new E2.SvixRequest(E2.HttpMethod.GET,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.send(this.requestCtx,h8.IngestSourceOutSerializer._fromJsonObject)}update(u,D){let B=new E2.SvixRequest(E2.HttpMethod.PUT,"/ingest/api/v1/source/{source_id}");return B.setPathParam("source_id",u),B.setBody(GZ.IngestSourceInSerializer._toJsonObject(D)),B.send(this.requestCtx,h8.IngestSourceOutSerializer._fromJsonObject)}delete(u){let D=new E2.SvixRequest(E2.HttpMethod.DELETE,"/ingest/api/v1/source/{source_id}");return D.setPathParam("source_id",u),D.sendNoResponseBody(this.requestCtx)}rotateToken(u,D){let B=new E2.SvixRequest(E2.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/token/rotate");return B.setPathParam("source_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,aH.RotateTokenOutSerializer._fromJsonObject)}}$Z.IngestSource=NZ});var XZ=z((QZ)=>{Object.defineProperty(QZ,"__esModule",{value:!0});QZ.Ingest=void 0;var sH=G8(),tH=FG(),oH=gG(),eH=ZZ(),JZ=_();class vZ{constructor(u){this.requestCtx=u}get endpoint(){return new oH.IngestEndpoint(this.requestCtx)}get source(){return new eH.IngestSource(this.requestCtx)}dashboard(u,D,B){let A=new JZ.SvixRequest(JZ.HttpMethod.POST,"/ingest/api/v1/source/{source_id}/dashboard");return A.setPathParam("source_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(tH.IngestSourceConsumerPortalAccessInSerializer._toJsonObject(D)),A.send(this.requestCtx,sH.DashboardAccessOutSerializer._fromJsonObject)}}QZ.Ingest=vZ});var hZ=z((YZ)=>{Object.defineProperty(YZ,"__esModule",{value:!0});YZ.IntegrationInSerializer=void 0;YZ.IntegrationInSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var SZ=z((xZ)=>{Object.defineProperty(xZ,"__esModule",{value:!0});xZ.IntegrationKeyOutSerializer=void 0;xZ.IntegrationKeyOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var x8=z((RZ)=>{Object.defineProperty(RZ,"__esModule",{value:!0});RZ.IntegrationOutSerializer=void 0;RZ.IntegrationOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,featureFlags:u.featureFlags,id:u.id,name:u.name,updatedAt:u.updatedAt}}}});var cZ=z((MZ)=>{Object.defineProperty(MZ,"__esModule",{value:!0});MZ.IntegrationUpdateSerializer=void 0;MZ.IntegrationUpdateSerializer={_fromJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{featureFlags:u.featureFlags,name:u.name}}}});var PZ=z((OZ)=>{Object.defineProperty(OZ,"__esModule",{value:!0});OZ.ListResponseIntegrationOutSerializer=void 0;var EZ=x8();OZ.ListResponseIntegrationOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>EZ.IntegrationOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>EZ.IntegrationOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var IZ=z((yZ)=>{Object.defineProperty(yZ,"__esModule",{value:!0});yZ.Integration=void 0;var uS=hZ(),kZ=SZ(),H8=x8(),DS=cZ(),BS=PZ(),W2=_();class VZ{constructor(u){this.requestCtx=u}list(u,D){let B=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/integration");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,BS.ListResponseIntegrationOutSerializer._fromJsonObject)}create(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.POST,"/api/v1/app/{app_id}/integration");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(uS.IntegrationInSerializer._toJsonObject(D)),A.send(this.requestCtx,H8.IntegrationOutSerializer._fromJsonObject)}get(u,D){let B=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.send(this.requestCtx,H8.IntegrationOutSerializer._fromJsonObject)}update(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.PUT,"/api/v1/app/{app_id}/integration/{integ_id}");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.setBody(DS.IntegrationUpdateSerializer._toJsonObject(B)),A.send(this.requestCtx,H8.IntegrationOutSerializer._fromJsonObject)}delete(u,D){let B=new W2.SvixRequest(W2.HttpMethod.DELETE,"/api/v1/app/{app_id}/integration/{integ_id}");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.sendNoResponseBody(this.requestCtx)}getKey(u,D){let B=new W2.SvixRequest(W2.HttpMethod.GET,"/api/v1/app/{app_id}/integration/{integ_id}/key");return B.setPathParam("app_id",u),B.setPathParam("integ_id",D),B.send(this.requestCtx,kZ.IntegrationKeyOutSerializer._fromJsonObject)}rotateKey(u,D,B){let A=new W2.SvixRequest(W2.HttpMethod.POST,"/api/v1/app/{app_id}/integration/{integ_id}/key/rotate");return A.setPathParam("app_id",u),A.setPathParam("integ_id",D),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.send(this.requestCtx,kZ.IntegrationKeyOutSerializer._fromJsonObject)}}yZ.Integration=VZ});var fZ=z((_Z)=>{Object.defineProperty(_Z,"__esModule",{value:!0});_Z.ExpungeAllContentsOutSerializer=void 0;var qZ=e2(),mZ=u0();_Z.ExpungeAllContentsOutSerializer={_fromJsonObject(u){return{id:u.id,status:qZ.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:mZ.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:qZ.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:mZ.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var dZ=z((jZ)=>{Object.defineProperty(jZ,"__esModule",{value:!0});jZ.ListResponseMessageOutSerializer=void 0;var bZ=Eu();jZ.ListResponseMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>bZ.MessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>bZ.MessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var nZ=z((iZ)=>{Object.defineProperty(iZ,"__esModule",{value:!0});iZ.MessagePrecheckInSerializer=void 0;iZ.MessagePrecheckInSerializer={_fromJsonObject(u){return{channels:u.channels,eventType:u.eventType}},_toJsonObject(u){return{channels:u.channels,eventType:u.eventType}}}});var sZ=z((pZ)=>{Object.defineProperty(pZ,"__esModule",{value:!0});pZ.MessagePrecheckOutSerializer=void 0;pZ.MessagePrecheckOutSerializer={_fromJsonObject(u){return{active:u.active}},_toJsonObject(u){return{active:u.active}}}});var eZ=z((tZ)=>{Object.defineProperty(tZ,"__esModule",{value:!0});tZ.PollingEndpointConsumerSeekInSerializer=void 0;tZ.PollingEndpointConsumerSeekInSerializer={_fromJsonObject(u){return{after:new Date(u.after)}},_toJsonObject(u){return{after:u.after}}}});var BJ=z((uJ)=>{Object.defineProperty(uJ,"__esModule",{value:!0});uJ.PollingEndpointConsumerSeekOutSerializer=void 0;uJ.PollingEndpointConsumerSeekOutSerializer={_fromJsonObject(u){return{iterator:u.iterator}},_toJsonObject(u){return{iterator:u.iterator}}}});var FJ=z((AJ)=>{Object.defineProperty(AJ,"__esModule",{value:!0});AJ.PollingEndpointMessageOutSerializer=void 0;AJ.PollingEndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,headers:u.headers,id:u.id,payload:u.payload,tags:u.tags,timestamp:u.timestamp}}}});var zJ=z((NJ)=>{Object.defineProperty(NJ,"__esModule",{value:!0});NJ.PollingEndpointOutSerializer=void 0;var GJ=FJ();NJ.PollingEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>GJ.PollingEndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>GJ.PollingEndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var WJ=z((vJ)=>{Object.defineProperty(vJ,"__esModule",{value:!0});vJ.MessagePoller=void 0;var AS=eZ(),wS=BJ(),ZJ=zJ(),m0=_();class JJ{constructor(u){this.requestCtx=u}poll(u,D,B){let A=new m0.SvixRequest(m0.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}");return A.setPathParam("app_id",u),A.setPathParam("sink_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,event_type:B===null||B===void 0?void 0:B.eventType,channel:B===null||B===void 0?void 0:B.channel,after:B===null||B===void 0?void 0:B.after}),A.send(this.requestCtx,ZJ.PollingEndpointOutSerializer._fromJsonObject)}consumerPoll(u,D,B,A){let w=new m0.SvixRequest(m0.HttpMethod.GET,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}");return w.setPathParam("app_id",u),w.setPathParam("sink_id",D),w.setPathParam("consumer_id",B),w.setQueryParams({limit:A===null||A===void 0?void 0:A.limit,iterator:A===null||A===void 0?void 0:A.iterator}),w.send(this.requestCtx,ZJ.PollingEndpointOutSerializer._fromJsonObject)}consumerSeek(u,D,B,A,w){let F=new m0.SvixRequest(m0.HttpMethod.POST,"/api/v1/app/{app_id}/poller/{sink_id}/consumer/{consumer_id}/seek");return F.setPathParam("app_id",u),F.setPathParam("sink_id",D),F.setPathParam("consumer_id",B),F.setHeaderParam("idempotency-key",w===null||w===void 0?void 0:w.idempotencyKey),F.setBody(AS.PollingEndpointConsumerSeekInSerializer._toJsonObject(A)),F.send(this.requestCtx,wS.PollingEndpointConsumerSeekOutSerializer._fromJsonObject)}}vJ.MessagePoller=JJ});var hJ=z((YJ)=>{Object.defineProperty(YJ,"__esModule",{value:!0});YJ.MessageInSerializer=void 0;var XJ=o1();YJ.MessageInSerializer={_fromJsonObject(u){return{application:u.application!=null?XJ.ApplicationInSerializer._fromJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}},_toJsonObject(u){return{application:u.application!=null?XJ.ApplicationInSerializer._toJsonObject(u.application):void 0,channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,payload:u.payload,payloadRetentionHours:u.payloadRetentionHours,payloadRetentionPeriod:u.payloadRetentionPeriod,tags:u.tags,transformationsParams:u.transformationsParams}}}});var S8=z((SJ)=>{Object.defineProperty(SJ,"__esModule",{value:!0});SJ.messageInRaw=SJ.Message=void 0;var FS=fZ(),GS=dZ(),xJ=Eu(),NS=nZ(),$S=sZ(),zS=WJ(),O2=_(),ZS=hJ();class HJ{constructor(u){this.requestCtx=u}get poller(){return new zS.MessagePoller(this.requestCtx)}list(u,D){let B=new O2.SvixRequest(O2.HttpMethod.GET,"/api/v1/app/{app_id}/msg");return B.setPathParam("app_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,channel:D===null||D===void 0?void 0:D.channel,before:D===null||D===void 0?void 0:D.before,after:D===null||D===void 0?void 0:D.after,with_content:D===null||D===void 0?void 0:D.withContent,tag:D===null||D===void 0?void 0:D.tag,event_types:D===null||D===void 0?void 0:D.eventTypes}),B.send(this.requestCtx,GS.ListResponseMessageOutSerializer._fromJsonObject)}create(u,D,B){let A=new O2.SvixRequest(O2.HttpMethod.POST,"/api/v1/app/{app_id}/msg");return A.setPathParam("app_id",u),A.setQueryParams({with_content:B===null||B===void 0?void 0:B.withContent}),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(ZS.MessageInSerializer._toJsonObject(D)),A.send(this.requestCtx,xJ.MessageOutSerializer._fromJsonObject)}expungeAllContents(u,D){let B=new O2.SvixRequest(O2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/expunge-all-contents");return B.setPathParam("app_id",u),B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.send(this.requestCtx,FS.ExpungeAllContentsOutSerializer._fromJsonObject)}precheck(u,D,B){let A=new O2.SvixRequest(O2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/precheck/active");return A.setPathParam("app_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(NS.MessagePrecheckInSerializer._toJsonObject(D)),A.send(this.requestCtx,$S.MessagePrecheckOutSerializer._fromJsonObject)}get(u,D,B){let A=new O2.SvixRequest(O2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({with_content:B===null||B===void 0?void 0:B.withContent}),A.send(this.requestCtx,xJ.MessageOutSerializer._fromJsonObject)}expungeContent(u,D){let B=new O2.SvixRequest(O2.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/content");return B.setPathParam("app_id",u),B.setPathParam("msg_id",D),B.sendNoResponseBody(this.requestCtx)}}SJ.Message=HJ;function JS(u,D,B){return{eventType:u,payload:{},transformationsParams:{rawPayload:D,headers:B?{"content-type":B}:void 0}}}SJ.messageInRaw=JS});var R8=z((UJ)=>{Object.defineProperty(UJ,"__esModule",{value:!0});UJ.EmptyResponseSerializer=void 0;UJ.EmptyResponseSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var Ou=z((cJ)=>{Object.defineProperty(cJ,"__esModule",{value:!0});cJ.MessageStatusTextSerializer=cJ.MessageStatusText=void 0;var QS;(function(u){u.Success="success",u.Pending="pending",u.Fail="fail",u.Sending="sending"})(QS=cJ.MessageStatusText||(cJ.MessageStatusText={}));cJ.MessageStatusTextSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var VJ=z((PJ)=>{Object.defineProperty(PJ,"__esModule",{value:!0});PJ.EndpointMessageOutSerializer=void 0;var OJ=q0(),CJ=Ou();PJ.EndpointMessageOutSerializer={_fromJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt?new Date(u.deliverAt):null,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,payload:u.payload,status:OJ.MessageStatusSerializer._fromJsonObject(u.status),statusText:CJ.MessageStatusTextSerializer._fromJsonObject(u.statusText),tags:u.tags,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{channels:u.channels,deliverAt:u.deliverAt,eventId:u.eventId,eventType:u.eventType,id:u.id,nextAttempt:u.nextAttempt,payload:u.payload,status:OJ.MessageStatusSerializer._toJsonObject(u.status),statusText:CJ.MessageStatusTextSerializer._toJsonObject(u.statusText),tags:u.tags,timestamp:u.timestamp}}}});var qJ=z((TJ)=>{Object.defineProperty(TJ,"__esModule",{value:!0});TJ.ListResponseEndpointMessageOutSerializer=void 0;var yJ=VJ();TJ.ListResponseEndpointMessageOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>yJ.EndpointMessageOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>yJ.EndpointMessageOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var U8=z((_J)=>{Object.defineProperty(_J,"__esModule",{value:!0});_J.MessageAttemptTriggerTypeSerializer=_J.MessageAttemptTriggerType=void 0;var WS;(function(u){u[u.Scheduled=0]="Scheduled",u[u.Manual=1]="Manual"})(WS=_J.MessageAttemptTriggerType||(_J.MessageAttemptTriggerType={}));_J.MessageAttemptTriggerTypeSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var M8=z((dJ)=>{Object.defineProperty(dJ,"__esModule",{value:!0});dJ.MessageAttemptOutSerializer=void 0;var fJ=U8(),bJ=Eu(),jJ=q0(),lJ=Ou();dJ.MessageAttemptOutSerializer={_fromJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?bJ.MessageOutSerializer._fromJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:jJ.MessageStatusSerializer._fromJsonObject(u.status),statusText:lJ.MessageStatusTextSerializer._fromJsonObject(u.statusText),timestamp:new Date(u.timestamp),triggerType:fJ.MessageAttemptTriggerTypeSerializer._fromJsonObject(u.triggerType),url:u.url}},_toJsonObject(u){return{endpointId:u.endpointId,id:u.id,msg:u.msg!=null?bJ.MessageOutSerializer._toJsonObject(u.msg):void 0,msgId:u.msgId,response:u.response,responseDurationMs:u.responseDurationMs,responseStatusCode:u.responseStatusCode,status:jJ.MessageStatusSerializer._toJsonObject(u.status),statusText:lJ.MessageStatusTextSerializer._toJsonObject(u.statusText),timestamp:u.timestamp,triggerType:fJ.MessageAttemptTriggerTypeSerializer._toJsonObject(u.triggerType),url:u.url}}}});var aJ=z((nJ)=>{Object.defineProperty(nJ,"__esModule",{value:!0});nJ.ListResponseMessageAttemptOutSerializer=void 0;var rJ=M8();nJ.ListResponseMessageAttemptOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>rJ.MessageAttemptOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>rJ.MessageAttemptOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var uv=z((oJ)=>{Object.defineProperty(oJ,"__esModule",{value:!0});oJ.MessageEndpointOutSerializer=void 0;var sJ=q0(),tJ=Ou();oJ.MessageEndpointOutSerializer={_fromJsonObject(u){return{channels:u.channels,createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt?new Date(u.nextAttempt):null,rateLimit:u.rateLimit,status:sJ.MessageStatusSerializer._fromJsonObject(u.status),statusText:tJ.MessageStatusTextSerializer._fromJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url,version:u.version}},_toJsonObject(u){return{channels:u.channels,createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,nextAttempt:u.nextAttempt,rateLimit:u.rateLimit,status:sJ.MessageStatusSerializer._toJsonObject(u.status),statusText:tJ.MessageStatusTextSerializer._toJsonObject(u.statusText),throttleRate:u.throttleRate,uid:u.uid,updatedAt:u.updatedAt,url:u.url,version:u.version}}}});var wv=z((Bv)=>{Object.defineProperty(Bv,"__esModule",{value:!0});Bv.ListResponseMessageEndpointOutSerializer=void 0;var Dv=uv();Bv.ListResponseMessageEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>Dv.MessageEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>Dv.MessageEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var zv=z((Nv)=>{Object.defineProperty(Nv,"__esModule",{value:!0});Nv.MessageAttempt=void 0;var XS=R8(),YS=qJ(),Fv=aJ(),KS=wv(),hS=M8(),X2=_();class Gv{constructor(u){this.requestCtx=u}listByEndpoint(u,D,B){let A=new X2.SvixRequest(X2.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/endpoint/{endpoint_id}");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,status:B===null||B===void 0?void 0:B.status,status_code_class:B===null||B===void 0?void 0:B.statusCodeClass,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,with_msg:B===null||B===void 0?void 0:B.withMsg,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,Fv.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listByMsg(u,D,B){let A=new X2.SvixRequest(X2.HttpMethod.GET,"/api/v1/app/{app_id}/attempt/msg/{msg_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,status:B===null||B===void 0?void 0:B.status,status_code_class:B===null||B===void 0?void 0:B.statusCodeClass,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,endpoint_id:B===null||B===void 0?void 0:B.endpointId,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,Fv.ListResponseMessageAttemptOutSerializer._fromJsonObject)}listAttemptedMessages(u,D,B){let A=new X2.SvixRequest(X2.HttpMethod.GET,"/api/v1/app/{app_id}/endpoint/{endpoint_id}/msg");return A.setPathParam("app_id",u),A.setPathParam("endpoint_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,channel:B===null||B===void 0?void 0:B.channel,tag:B===null||B===void 0?void 0:B.tag,status:B===null||B===void 0?void 0:B.status,before:B===null||B===void 0?void 0:B.before,after:B===null||B===void 0?void 0:B.after,with_content:B===null||B===void 0?void 0:B.withContent,event_types:B===null||B===void 0?void 0:B.eventTypes}),A.send(this.requestCtx,YS.ListResponseEndpointMessageOutSerializer._fromJsonObject)}get(u,D,B){let A=new X2.SvixRequest(X2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setPathParam("attempt_id",B),A.send(this.requestCtx,hS.MessageAttemptOutSerializer._fromJsonObject)}expungeContent(u,D,B){let A=new X2.SvixRequest(X2.HttpMethod.DELETE,"/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setPathParam("attempt_id",B),A.sendNoResponseBody(this.requestCtx)}listAttemptedDestinations(u,D,B){let A=new X2.SvixRequest(X2.HttpMethod.GET,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint");return A.setPathParam("app_id",u),A.setPathParam("msg_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator}),A.send(this.requestCtx,KS.ListResponseMessageEndpointOutSerializer._fromJsonObject)}resend(u,D,B,A){let w=new X2.SvixRequest(X2.HttpMethod.POST,"/api/v1/app/{app_id}/msg/{msg_id}/endpoint/{endpoint_id}/resend");return w.setPathParam("app_id",u),w.setPathParam("msg_id",D),w.setPathParam("endpoint_id",B),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.send(this.requestCtx,XS.EmptyResponseSerializer._fromJsonObject)}}Nv.MessageAttempt=Gv});var L8=z((Zv)=>{Object.defineProperty(Zv,"__esModule",{value:!0});Zv.OperationalWebhookEndpointOutSerializer=void 0;Zv.OperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:new Date(u.updatedAt),url:u.url}},_toJsonObject(u){return{createdAt:u.createdAt,description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,id:u.id,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,updatedAt:u.updatedAt,url:u.url}}}});var Xv=z((Qv)=>{Object.defineProperty(Qv,"__esModule",{value:!0});Qv.ListResponseOperationalWebhookEndpointOutSerializer=void 0;var vv=L8();Qv.ListResponseOperationalWebhookEndpointOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>vv.OperationalWebhookEndpointOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>vv.OperationalWebhookEndpointOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var hv=z((Yv)=>{Object.defineProperty(Yv,"__esModule",{value:!0});Yv.OperationalWebhookEndpointHeadersInSerializer=void 0;Yv.OperationalWebhookEndpointHeadersInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var Sv=z((xv)=>{Object.defineProperty(xv,"__esModule",{value:!0});xv.OperationalWebhookEndpointHeadersOutSerializer=void 0;xv.OperationalWebhookEndpointHeadersOutSerializer={_fromJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}},_toJsonObject(u){return{headers:u.headers,sensitive:u.sensitive}}}});var Mv=z((Rv)=>{Object.defineProperty(Rv,"__esModule",{value:!0});Rv.OperationalWebhookEndpointInSerializer=void 0;Rv.OperationalWebhookEndpointInSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,secret:u.secret,uid:u.uid,url:u.url}}}});var Ev=z((Lv)=>{Object.defineProperty(Lv,"__esModule",{value:!0});Lv.OperationalWebhookEndpointSecretInSerializer=void 0;Lv.OperationalWebhookEndpointSecretInSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var Pv=z((Ov)=>{Object.defineProperty(Ov,"__esModule",{value:!0});Ov.OperationalWebhookEndpointSecretOutSerializer=void 0;Ov.OperationalWebhookEndpointSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var yv=z((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});kv.OperationalWebhookEndpointUpdateSerializer=void 0;kv.OperationalWebhookEndpointUpdateSerializer={_fromJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}},_toJsonObject(u){return{description:u.description,disabled:u.disabled,filterTypes:u.filterTypes,metadata:u.metadata,rateLimit:u.rateLimit,uid:u.uid,url:u.url}}}});var E8=z((Iv)=>{Object.defineProperty(Iv,"__esModule",{value:!0});Iv.OperationalWebhookEndpoint=void 0;var xS=Xv(),HS=hv(),SS=Sv(),RS=Mv(),c8=L8(),US=Ev(),MS=Pv(),LS=yv(),D2=_();class Tv{constructor(u){this.requestCtx=u}list(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,xS.ListResponseOperationalWebhookEndpointOutSerializer._fromJsonObject)}create(u,D){let B=new D2.SvixRequest(D2.HttpMethod.POST,"/api/v1/operational-webhook/endpoint");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(RS.OperationalWebhookEndpointInSerializer._toJsonObject(u)),B.send(this.requestCtx,c8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}get(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,c8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}update(u,D){let B=new D2.SvixRequest(D2.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return B.setPathParam("endpoint_id",u),B.setBody(LS.OperationalWebhookEndpointUpdateSerializer._toJsonObject(D)),B.send(this.requestCtx,c8.OperationalWebhookEndpointOutSerializer._fromJsonObject)}delete(u){let D=new D2.SvixRequest(D2.HttpMethod.DELETE,"/api/v1/operational-webhook/endpoint/{endpoint_id}");return D.setPathParam("endpoint_id",u),D.sendNoResponseBody(this.requestCtx)}getHeaders(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,SS.OperationalWebhookEndpointHeadersOutSerializer._fromJsonObject)}updateHeaders(u,D){let B=new D2.SvixRequest(D2.HttpMethod.PUT,"/api/v1/operational-webhook/endpoint/{endpoint_id}/headers");return B.setPathParam("endpoint_id",u),B.setBody(HS.OperationalWebhookEndpointHeadersInSerializer._toJsonObject(D)),B.sendNoResponseBody(this.requestCtx)}getSecret(u){let D=new D2.SvixRequest(D2.HttpMethod.GET,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret");return D.setPathParam("endpoint_id",u),D.send(this.requestCtx,MS.OperationalWebhookEndpointSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B){let A=new D2.SvixRequest(D2.HttpMethod.POST,"/api/v1/operational-webhook/endpoint/{endpoint_id}/secret/rotate");return A.setPathParam("endpoint_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(US.OperationalWebhookEndpointSecretInSerializer._toJsonObject(D)),A.sendNoResponseBody(this.requestCtx)}}Iv.OperationalWebhookEndpoint=Tv});var fv=z((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});_v.OperationalWebhook=void 0;var cS=E8();class mv{constructor(u){this.requestCtx=u}get endpoint(){return new cS.OperationalWebhookEndpoint(this.requestCtx)}}_v.OperationalWebhook=mv});var iv=z((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});lv.AggregateEventTypesOutSerializer=void 0;var bv=e2(),jv=u0();lv.AggregateEventTypesOutSerializer={_fromJsonObject(u){return{id:u.id,status:bv.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:jv.BackgroundTaskTypeSerializer._fromJsonObject(u.task),updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:bv.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:jv.BackgroundTaskTypeSerializer._toJsonObject(u.task),updatedAt:u.updatedAt}}}});var pv=z((rv)=>{Object.defineProperty(rv,"__esModule",{value:!0});rv.AppUsageStatsInSerializer=void 0;rv.AppUsageStatsInSerializer={_fromJsonObject(u){return{appIds:u.appIds,since:new Date(u.since),until:new Date(u.until)}},_toJsonObject(u){return{appIds:u.appIds,since:u.since,until:u.until}}}});var ev=z((tv)=>{Object.defineProperty(tv,"__esModule",{value:!0});tv.AppUsageStatsOutSerializer=void 0;var av=e2(),sv=u0();tv.AppUsageStatsOutSerializer={_fromJsonObject(u){return{id:u.id,status:av.BackgroundTaskStatusSerializer._fromJsonObject(u.status),task:sv.BackgroundTaskTypeSerializer._fromJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{id:u.id,status:av.BackgroundTaskStatusSerializer._toJsonObject(u.status),task:sv.BackgroundTaskTypeSerializer._toJsonObject(u.task),unresolvedAppIds:u.unresolvedAppIds,updatedAt:u.updatedAt}}}});var AQ=z((DQ)=>{Object.defineProperty(DQ,"__esModule",{value:!0});DQ.Statistics=void 0;var ES=iv(),OS=pv(),CS=ev(),N3=_();class uQ{constructor(u){this.requestCtx=u}aggregateAppStats(u,D){let B=new N3.SvixRequest(N3.HttpMethod.POST,"/api/v1/stats/usage/app");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(OS.AppUsageStatsInSerializer._toJsonObject(u)),B.send(this.requestCtx,CS.AppUsageStatsOutSerializer._fromJsonObject)}aggregateEventTypes(){return new N3.SvixRequest(N3.HttpMethod.PUT,"/api/v1/stats/usage/event-types").send(this.requestCtx,ES.AggregateEventTypesOutSerializer._fromJsonObject)}}DQ.Statistics=uQ});var GQ=z((wQ)=>{Object.defineProperty(wQ,"__esModule",{value:!0});wQ.HttpSinkHeadersPatchInSerializer=void 0;wQ.HttpSinkHeadersPatchInSerializer={_fromJsonObject(u){return{headers:u.headers}},_toJsonObject(u){return{headers:u.headers}}}});var zQ=z((NQ)=>{Object.defineProperty(NQ,"__esModule",{value:!0});NQ.SinkTransformationOutSerializer=void 0;NQ.SinkTransformationOutSerializer={_fromJsonObject(u){return{code:u.code,enabled:u.enabled}},_toJsonObject(u){return{code:u.code,enabled:u.enabled}}}});var O8=z((ZQ)=>{Object.defineProperty(ZQ,"__esModule",{value:!0});ZQ.StreamEventTypeOutSerializer=void 0;ZQ.StreamEventTypeOutSerializer={_fromJsonObject(u){return{archived:u.archived,createdAt:new Date(u.createdAt),deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{archived:u.archived,createdAt:u.createdAt,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name,updatedAt:u.updatedAt}}}});var XQ=z((QQ)=>{Object.defineProperty(QQ,"__esModule",{value:!0});QQ.ListResponseStreamEventTypeOutSerializer=void 0;var vQ=O8();QQ.ListResponseStreamEventTypeOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>vQ.StreamEventTypeOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>vQ.StreamEventTypeOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var hQ=z((YQ)=>{Object.defineProperty(YQ,"__esModule",{value:!0});YQ.StreamEventTypeInSerializer=void 0;YQ.StreamEventTypeInSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var SQ=z((xQ)=>{Object.defineProperty(xQ,"__esModule",{value:!0});xQ.StreamEventTypePatchSerializer=void 0;xQ.StreamEventTypePatchSerializer={_fromJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}},_toJsonObject(u){return{archived:u.archived,deprecated:u.deprecated,description:u.description,featureFlags:u.featureFlags,name:u.name}}}});var cQ=z((MQ)=>{Object.defineProperty(MQ,"__esModule",{value:!0});MQ.StreamingEventType=void 0;var PS=XQ(),RQ=hQ(),$3=O8(),kS=SQ(),C2=_();class UQ{constructor(u){this.requestCtx=u}list(u){let D=new C2.SvixRequest(C2.HttpMethod.GET,"/api/v1/stream/event-type");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order,include_archived:u===null||u===void 0?void 0:u.includeArchived}),D.send(this.requestCtx,PS.ListResponseStreamEventTypeOutSerializer._fromJsonObject)}create(u,D){let B=new C2.SvixRequest(C2.HttpMethod.POST,"/api/v1/stream/event-type");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(RQ.StreamEventTypeInSerializer._toJsonObject(u)),B.send(this.requestCtx,$3.StreamEventTypeOutSerializer._fromJsonObject)}get(u){let D=new C2.SvixRequest(C2.HttpMethod.GET,"/api/v1/stream/event-type/{name}");return D.setPathParam("name",u),D.send(this.requestCtx,$3.StreamEventTypeOutSerializer._fromJsonObject)}update(u,D){let B=new C2.SvixRequest(C2.HttpMethod.PUT,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setBody(RQ.StreamEventTypeInSerializer._toJsonObject(D)),B.send(this.requestCtx,$3.StreamEventTypeOutSerializer._fromJsonObject)}delete(u,D){let B=new C2.SvixRequest(C2.HttpMethod.DELETE,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setQueryParams({expunge:D===null||D===void 0?void 0:D.expunge}),B.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new C2.SvixRequest(C2.HttpMethod.PATCH,"/api/v1/stream/event-type/{name}");return B.setPathParam("name",u),B.setBody(kS.StreamEventTypePatchSerializer._toJsonObject(D)),B.send(this.requestCtx,$3.StreamEventTypeOutSerializer._fromJsonObject)}}MQ.StreamingEventType=UQ});var CQ=z((EQ)=>{Object.defineProperty(EQ,"__esModule",{value:!0});EQ.EventInSerializer=void 0;EQ.EventInSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload}}}});var C8=z((PQ)=>{Object.defineProperty(PQ,"__esModule",{value:!0});PQ.StreamInSerializer=void 0;PQ.StreamInSerializer={_fromJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}},_toJsonObject(u){return{metadata:u.metadata,name:u.name,uid:u.uid}}}});var qQ=z((TQ)=>{Object.defineProperty(TQ,"__esModule",{value:!0});TQ.CreateStreamEventsInSerializer=void 0;var VQ=CQ(),yQ=C8();TQ.CreateStreamEventsInSerializer={_fromJsonObject(u){return{events:u.events.map((D)=>VQ.EventInSerializer._fromJsonObject(D)),stream:u.stream!=null?yQ.StreamInSerializer._fromJsonObject(u.stream):void 0}},_toJsonObject(u){return{events:u.events.map((D)=>VQ.EventInSerializer._toJsonObject(D)),stream:u.stream!=null?yQ.StreamInSerializer._toJsonObject(u.stream):void 0}}}});var gQ=z((mQ)=>{Object.defineProperty(mQ,"__esModule",{value:!0});mQ.CreateStreamEventsOutSerializer=void 0;mQ.CreateStreamEventsOutSerializer={_fromJsonObject(u){return{}},_toJsonObject(u){return{}}}});var jQ=z((fQ)=>{Object.defineProperty(fQ,"__esModule",{value:!0});fQ.EventOutSerializer=void 0;fQ.EventOutSerializer={_fromJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:new Date(u.timestamp)}},_toJsonObject(u){return{eventType:u.eventType,payload:u.payload,timestamp:u.timestamp}}}});var rQ=z((dQ)=>{Object.defineProperty(dQ,"__esModule",{value:!0});dQ.EventStreamOutSerializer=void 0;var lQ=jQ();dQ.EventStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>lQ.EventOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator}},_toJsonObject(u){return{data:u.data.map((D)=>lQ.EventOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator}}}});var sQ=z((pQ)=>{Object.defineProperty(pQ,"__esModule",{value:!0});pQ.StreamingEvents=void 0;var VS=qQ(),yS=gQ(),TS=rQ(),z3=_();class nQ{constructor(u){this.requestCtx=u}create(u,D,B){let A=new z3.SvixRequest(z3.HttpMethod.POST,"/api/v1/stream/{stream_id}/events");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(VS.CreateStreamEventsInSerializer._toJsonObject(D)),A.send(this.requestCtx,yS.CreateStreamEventsOutSerializer._fromJsonObject)}get(u,D,B){let A=new z3.SvixRequest(z3.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/events");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setQueryParams({limit:B===null||B===void 0?void 0:B.limit,iterator:B===null||B===void 0?void 0:B.iterator,after:B===null||B===void 0?void 0:B.after}),A.send(this.requestCtx,TS.EventStreamOutSerializer._fromJsonObject)}}pQ.StreamingEvents=nQ});var P8=z((tQ)=>{Object.defineProperty(tQ,"__esModule",{value:!0});tQ.AzureBlobStorageConfigSerializer=void 0;tQ.AzureBlobStorageConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var k8=z((eQ)=>{Object.defineProperty(eQ,"__esModule",{value:!0});eQ.GoogleCloudStorageConfigSerializer=void 0;eQ.GoogleCloudStorageConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var V8=z((DW)=>{Object.defineProperty(DW,"__esModule",{value:!0});DW.S3ConfigSerializer=void 0;DW.S3ConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var y8=z((AW)=>{Object.defineProperty(AW,"__esModule",{value:!0});AW.SinkHttpConfigSerializer=void 0;AW.SinkHttpConfigSerializer={_fromJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}},_toJsonObject(u){return{headers:u.headers,key:u.key,url:u.url}}}});var T8=z((FW)=>{Object.defineProperty(FW,"__esModule",{value:!0});FW.SinkOtelV1ConfigSerializer=void 0;FW.SinkOtelV1ConfigSerializer={_fromJsonObject(u){return{headers:u.headers,url:u.url}},_toJsonObject(u){return{headers:u.headers,url:u.url}}}});var I8=z(($W)=>{Object.defineProperty($W,"__esModule",{value:!0});$W.SinkStatusSerializer=$W.SinkStatus=void 0;var IS;(function(u){u.Enabled="enabled",u.Paused="paused",u.Disabled="disabled",u.Retrying="retrying"})(IS=$W.SinkStatus||($W.SinkStatus={}));$W.SinkStatusSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var q8=z((YW)=>{Object.defineProperty(YW,"__esModule",{value:!0});YW.StreamSinkOutSerializer=void 0;var ZW=P8(),JW=k8(),vW=V8(),QW=y8(),WW=T8(),XW=I8();YW.StreamSinkOutSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return ZW.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return WW.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return QW.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return vW.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return JW.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,createdAt:new Date(u.createdAt),currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt?new Date(u.nextRetryAt):null,status:XW.SinkStatusSerializer._fromJsonObject(u.status),uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=ZW.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=WW.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=QW.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=vW.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=JW.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,createdAt:u.createdAt,currentIterator:u.currentIterator,eventTypes:u.eventTypes,failureReason:u.failureReason,id:u.id,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,nextRetryAt:u.nextRetryAt,status:XW.SinkStatusSerializer._toJsonObject(u.status),uid:u.uid,updatedAt:u.updatedAt}}}});var SW=z((xW)=>{Object.defineProperty(xW,"__esModule",{value:!0});xW.ListResponseStreamSinkOutSerializer=void 0;var hW=q8();xW.ListResponseStreamSinkOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>hW.StreamSinkOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>hW.StreamSinkOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var MW=z((RW)=>{Object.defineProperty(RW,"__esModule",{value:!0});RW.SinkSecretOutSerializer=void 0;RW.SinkSecretOutSerializer={_fromJsonObject(u){return{key:u.key}},_toJsonObject(u){return{key:u.key}}}});var EW=z((LW)=>{Object.defineProperty(LW,"__esModule",{value:!0});LW.SinkTransformInSerializer=void 0;LW.SinkTransformInSerializer={_fromJsonObject(u){return{code:u.code}},_toJsonObject(u){return{code:u.code}}}});var Z3=z((CW)=>{Object.defineProperty(CW,"__esModule",{value:!0});CW.SinkStatusInSerializer=CW.SinkStatusIn=void 0;var qS;(function(u){u.Enabled="enabled",u.Disabled="disabled"})(qS=CW.SinkStatusIn||(CW.SinkStatusIn={}));CW.SinkStatusInSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var gW=z((mW)=>{Object.defineProperty(mW,"__esModule",{value:!0});mW.StreamSinkInSerializer=void 0;var kW=P8(),VW=k8(),yW=V8(),TW=y8(),IW=T8(),qW=Z3();mW.StreamSinkInSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return kW.AzureBlobStorageConfigSerializer._fromJsonObject(u.config);case"otelTracing":return IW.SinkOtelV1ConfigSerializer._fromJsonObject(u.config);case"http":return TW.SinkHttpConfigSerializer._fromJsonObject(u.config);case"amazonS3":return yW.S3ConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return VW.GoogleCloudStorageConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?qW.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=kW.AzureBlobStorageConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=IW.SinkOtelV1ConfigSerializer._toJsonObject(u.config);break;case"http":D=TW.SinkHttpConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=yW.S3ConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=VW.GoogleCloudStorageConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?qW.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var jW=z((fW)=>{Object.defineProperty(fW,"__esModule",{value:!0});fW.AmazonS3PatchConfigSerializer=void 0;fW.AmazonS3PatchConfigSerializer={_fromJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}},_toJsonObject(u){return{accessKeyId:u.accessKeyId,bucket:u.bucket,endpointUrl:u.endpointUrl,region:u.region,secretAccessKey:u.secretAccessKey}}}});var iW=z((lW)=>{Object.defineProperty(lW,"__esModule",{value:!0});lW.AzureBlobStoragePatchConfigSerializer=void 0;lW.AzureBlobStoragePatchConfigSerializer={_fromJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}},_toJsonObject(u){return{accessKey:u.accessKey,account:u.account,container:u.container}}}});var pW=z((rW)=>{Object.defineProperty(rW,"__esModule",{value:!0});rW.GoogleCloudStoragePatchConfigSerializer=void 0;rW.GoogleCloudStoragePatchConfigSerializer={_fromJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}},_toJsonObject(u){return{bucket:u.bucket,credentials:u.credentials}}}});var tW=z((aW)=>{Object.defineProperty(aW,"__esModule",{value:!0});aW.HttpPatchConfigSerializer=void 0;aW.HttpPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var uX=z((oW)=>{Object.defineProperty(oW,"__esModule",{value:!0});oW.OtelTracingPatchConfigSerializer=void 0;oW.OtelTracingPatchConfigSerializer={_fromJsonObject(u){return{url:u.url}},_toJsonObject(u){return{url:u.url}}}});var zX=z((NX)=>{Object.defineProperty(NX,"__esModule",{value:!0});NX.StreamSinkPatchSerializer=void 0;var DX=jW(),BX=iW(),AX=pW(),wX=tW(),FX=uX(),GX=Z3();NX.StreamSinkPatchSerializer={_fromJsonObject(u){let D=u.type;function B(A){switch(A){case"poller":return{};case"azureBlobStorage":return BX.AzureBlobStoragePatchConfigSerializer._fromJsonObject(u.config);case"otelTracing":return FX.OtelTracingPatchConfigSerializer._fromJsonObject(u.config);case"http":return wX.HttpPatchConfigSerializer._fromJsonObject(u.config);case"amazonS3":return DX.AmazonS3PatchConfigSerializer._fromJsonObject(u.config);case"googleCloudStorage":return AX.GoogleCloudStoragePatchConfigSerializer._fromJsonObject(u.config);default:throw Error(`Unexpected type: ${A}`)}}return{type:D,config:B(D),batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?GX.SinkStatusInSerializer._fromJsonObject(u.status):void 0,uid:u.uid}},_toJsonObject(u){let D;switch(u.type){case"poller":D={};break;case"azureBlobStorage":D=BX.AzureBlobStoragePatchConfigSerializer._toJsonObject(u.config);break;case"otelTracing":D=FX.OtelTracingPatchConfigSerializer._toJsonObject(u.config);break;case"http":D=wX.HttpPatchConfigSerializer._toJsonObject(u.config);break;case"amazonS3":D=DX.AmazonS3PatchConfigSerializer._toJsonObject(u.config);break;case"googleCloudStorage":D=AX.GoogleCloudStoragePatchConfigSerializer._toJsonObject(u.config);break}return{type:u.type,config:D,batchSize:u.batchSize,eventTypes:u.eventTypes,maxWaitSecs:u.maxWaitSecs,metadata:u.metadata,status:u.status!=null?GX.SinkStatusInSerializer._toJsonObject(u.status):void 0,uid:u.uid}}}});var XX=z((QX)=>{Object.defineProperty(QX,"__esModule",{value:!0});QX.StreamingSink=void 0;var ZX=R8(),mS=v8(),_S=SW(),gS=MW(),fS=EW(),JX=gW(),J3=q8(),bS=zX(),B2=_();class vX{constructor(u){this.requestCtx=u}list(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink");return B.setPathParam("stream_id",u),B.setQueryParams({limit:D===null||D===void 0?void 0:D.limit,iterator:D===null||D===void 0?void 0:D.iterator,order:D===null||D===void 0?void 0:D.order}),B.send(this.requestCtx,_S.ListResponseStreamSinkOutSerializer._fromJsonObject)}create(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink");return A.setPathParam("stream_id",u),A.setHeaderParam("idempotency-key",B===null||B===void 0?void 0:B.idempotencyKey),A.setBody(JX.StreamSinkInSerializer._toJsonObject(D)),A.send(this.requestCtx,J3.StreamSinkOutSerializer._fromJsonObject)}get(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,J3.StreamSinkOutSerializer._fromJsonObject)}update(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PUT,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(JX.StreamSinkInSerializer._toJsonObject(B)),A.send(this.requestCtx,J3.StreamSinkOutSerializer._fromJsonObject)}delete(u,D){let B=new B2.SvixRequest(B2.HttpMethod.DELETE,"/api/v1/stream/{stream_id}/sink/{sink_id}");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.sendNoResponseBody(this.requestCtx)}patch(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(bS.StreamSinkPatchSerializer._toJsonObject(B)),A.send(this.requestCtx,J3.StreamSinkOutSerializer._fromJsonObject)}getSecret(u,D){let B=new B2.SvixRequest(B2.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,gS.SinkSecretOutSerializer._fromJsonObject)}rotateSecret(u,D,B,A){let w=new B2.SvixRequest(B2.HttpMethod.POST,"/api/v1/stream/{stream_id}/sink/{sink_id}/secret/rotate");return w.setPathParam("stream_id",u),w.setPathParam("sink_id",D),w.setHeaderParam("idempotency-key",A===null||A===void 0?void 0:A.idempotencyKey),w.setBody(mS.EndpointSecretRotateInSerializer._toJsonObject(B)),w.send(this.requestCtx,ZX.EmptyResponseSerializer._fromJsonObject)}transformationPartialUpdate(u,D,B){let A=new B2.SvixRequest(B2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(fS.SinkTransformInSerializer._toJsonObject(B)),A.send(this.requestCtx,ZX.EmptyResponseSerializer._fromJsonObject)}}QX.StreamingSink=vX});var m8=z((YX)=>{Object.defineProperty(YX,"__esModule",{value:!0});YX.StreamOutSerializer=void 0;YX.StreamOutSerializer={_fromJsonObject(u){return{createdAt:new Date(u.createdAt),id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:new Date(u.updatedAt)}},_toJsonObject(u){return{createdAt:u.createdAt,id:u.id,metadata:u.metadata,name:u.name,uid:u.uid,updatedAt:u.updatedAt}}}});var SX=z((xX)=>{Object.defineProperty(xX,"__esModule",{value:!0});xX.ListResponseStreamOutSerializer=void 0;var hX=m8();xX.ListResponseStreamOutSerializer={_fromJsonObject(u){return{data:u.data.map((D)=>hX.StreamOutSerializer._fromJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}},_toJsonObject(u){return{data:u.data.map((D)=>hX.StreamOutSerializer._toJsonObject(D)),done:u.done,iterator:u.iterator,prevIterator:u.prevIterator}}}});var MX=z((RX)=>{Object.defineProperty(RX,"__esModule",{value:!0});RX.StreamPatchSerializer=void 0;RX.StreamPatchSerializer={_fromJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}},_toJsonObject(u){return{description:u.description,metadata:u.metadata,uid:u.uid}}}});var CX=z((EX)=>{Object.defineProperty(EX,"__esModule",{value:!0});EX.StreamingStream=void 0;var jS=SX(),LX=C8(),v3=m8(),lS=MX(),P2=_();class cX{constructor(u){this.requestCtx=u}list(u){let D=new P2.SvixRequest(P2.HttpMethod.GET,"/api/v1/stream");return D.setQueryParams({limit:u===null||u===void 0?void 0:u.limit,iterator:u===null||u===void 0?void 0:u.iterator,order:u===null||u===void 0?void 0:u.order}),D.send(this.requestCtx,jS.ListResponseStreamOutSerializer._fromJsonObject)}create(u,D){let B=new P2.SvixRequest(P2.HttpMethod.POST,"/api/v1/stream");return B.setHeaderParam("idempotency-key",D===null||D===void 0?void 0:D.idempotencyKey),B.setBody(LX.StreamInSerializer._toJsonObject(u)),B.send(this.requestCtx,v3.StreamOutSerializer._fromJsonObject)}get(u){let D=new P2.SvixRequest(P2.HttpMethod.GET,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.send(this.requestCtx,v3.StreamOutSerializer._fromJsonObject)}update(u,D){let B=new P2.SvixRequest(P2.HttpMethod.PUT,"/api/v1/stream/{stream_id}");return B.setPathParam("stream_id",u),B.setBody(LX.StreamInSerializer._toJsonObject(D)),B.send(this.requestCtx,v3.StreamOutSerializer._fromJsonObject)}delete(u){let D=new P2.SvixRequest(P2.HttpMethod.DELETE,"/api/v1/stream/{stream_id}");return D.setPathParam("stream_id",u),D.sendNoResponseBody(this.requestCtx)}patch(u,D){let B=new P2.SvixRequest(P2.HttpMethod.PATCH,"/api/v1/stream/{stream_id}");return B.setPathParam("stream_id",u),B.setBody(lS.StreamPatchSerializer._toJsonObject(D)),B.send(this.requestCtx,v3.StreamOutSerializer._fromJsonObject)}}EX.StreamingStream=cX});var TX=z((VX)=>{Object.defineProperty(VX,"__esModule",{value:!0});VX.Streaming=void 0;var PX=Z8(),dS=GQ(),iS=zQ(),rS=cQ(),nS=sQ(),pS=XX(),aS=CX(),_0=_();class kX{constructor(u){this.requestCtx=u}get event_type(){return new rS.StreamingEventType(this.requestCtx)}get events(){return new nS.StreamingEvents(this.requestCtx)}get sink(){return new pS.StreamingSink(this.requestCtx)}get stream(){return new aS.StreamingStream(this.requestCtx)}sinkHeadersGet(u,D){let B=new _0.SvixRequest(_0.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,PX.EndpointHeadersOutSerializer._fromJsonObject)}sinkHeadersPatch(u,D,B){let A=new _0.SvixRequest(_0.HttpMethod.PATCH,"/api/v1/stream/{stream_id}/sink/{sink_id}/headers");return A.setPathParam("stream_id",u),A.setPathParam("sink_id",D),A.setBody(dS.HttpSinkHeadersPatchInSerializer._toJsonObject(B)),A.send(this.requestCtx,PX.EndpointHeadersOutSerializer._fromJsonObject)}sinkTransformationGet(u,D){let B=new _0.SvixRequest(_0.HttpMethod.GET,"/api/v1/stream/{stream_id}/sink/{sink_id}/transformation");return B.setPathParam("stream_id",u),B.setPathParam("sink_id",D),B.send(this.requestCtx,iS.SinkTransformationOutSerializer._fromJsonObject)}}VX.Streaming=kX});var mX=z((IX)=>{Object.defineProperty(IX,"__esModule",{value:!0});IX.HTTPValidationError=IX.ValidationError=IX.HttpErrorOut=void 0;class g0{static getAttributeTypeMap(){return g0.attributeTypeMap}}IX.HttpErrorOut=g0;g0.discriminator=void 0;g0.mapping=void 0;g0.attributeTypeMap=[{name:"code",baseName:"code",type:"string",format:""},{name:"detail",baseName:"detail",type:"string",format:""}];class f0{static getAttributeTypeMap(){return f0.attributeTypeMap}}IX.ValidationError=f0;f0.discriminator=void 0;f0.mapping=void 0;f0.attributeTypeMap=[{name:"loc",baseName:"loc",type:"Array<string>",format:""},{name:"msg",baseName:"msg",type:"string",format:""},{name:"type",baseName:"type",type:"string",format:""}];class b0{static getAttributeTypeMap(){return b0.attributeTypeMap}}IX.HTTPValidationError=b0;b0.discriminator=void 0;b0.mapping=void 0;b0.attributeTypeMap=[{name:"detail",baseName:"detail",type:"Array<ValidationError>",format:""}]});var bX=z((gX)=>{Object.defineProperty(gX,"__esModule",{value:!0});gX.timingSafeEqual=void 0;function _X(u,D=""){if(!u)throw Error(D)}function oS(u,D){if(u.byteLength!==D.byteLength)return!1;if(!(u instanceof DataView))u=new DataView(ArrayBuffer.isView(u)?u.buffer:u);if(!(D instanceof DataView))D=new DataView(ArrayBuffer.isView(D)?D.buffer:D);_X(u instanceof DataView),_X(D instanceof DataView);let B=u.byteLength,A=0,w=-1;while(++w<B)A|=u.getUint8(w)^D.getUint8(w);return A===0}gX.timingSafeEqual=oS});var dX=z((h2)=>{var eS=h2&&h2.__extends||function(){var u=function(D,B){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,w){A.__proto__=w}||function(A,w){for(var F in w)if(w.hasOwnProperty(F))A[F]=w[F]},u(D,B)};return function(D,B){u(D,B);function A(){this.constructor=D}D.prototype=B===null?Object.create(B):(A.prototype=B.prototype,new A)}}();Object.defineProperty(h2,"__esModule",{value:!0});var r=256,_8=function(){function u(D){if(D===void 0)D="=";this._paddingCharacter=D}return u.prototype.encodedLength=function(D){if(!this._paddingCharacter)return(D*8+5)/6|0;return(D+2)/3*4|0},u.prototype.encode=function(D){var B="",A=0;for(;A<D.length-2;A+=3){var w=D[A]<<16|D[A+1]<<8|D[A+2];B+=this._encodeByte(w>>>18&63),B+=this._encodeByte(w>>>12&63),B+=this._encodeByte(w>>>6&63),B+=this._encodeByte(w>>>0&63)}var F=D.length-A;if(F>0){var w=D[A]<<16|(F===2?D[A+1]<<8:0);if(B+=this._encodeByte(w>>>18&63),B+=this._encodeByte(w>>>12&63),F===2)B+=this._encodeByte(w>>>6&63);else B+=this._paddingCharacter||"";B+=this._paddingCharacter||""}return B},u.prototype.maxDecodedLength=function(D){if(!this._paddingCharacter)return(D*6+7)/8|0;return D/4*3|0},u.prototype.decodedLength=function(D){return this.maxDecodedLength(D.length-this._getPaddingLength(D))},u.prototype.decode=function(D){if(D.length===0)return new Uint8Array(0);var B=this._getPaddingLength(D),A=D.length-B,w=new Uint8Array(this.maxDecodedLength(A)),F=0,G=0,N=0,$=0,Z=0,Q=0,J=0;for(;G<A-4;G+=4)$=this._decodeChar(D.charCodeAt(G+0)),Z=this._decodeChar(D.charCodeAt(G+1)),Q=this._decodeChar(D.charCodeAt(G+2)),J=this._decodeChar(D.charCodeAt(G+3)),w[F++]=$<<2|Z>>>4,w[F++]=Z<<4|Q>>>2,w[F++]=Q<<6|J,N|=$&r,N|=Z&r,N|=Q&r,N|=J&r;if(G<A-1)$=this._decodeChar(D.charCodeAt(G)),Z=this._decodeChar(D.charCodeAt(G+1)),w[F++]=$<<2|Z>>>4,N|=$&r,N|=Z&r;if(G<A-2)Q=this._decodeChar(D.charCodeAt(G+2)),w[F++]=Z<<4|Q>>>2,N|=Q&r;if(G<A-3)J=this._decodeChar(D.charCodeAt(G+3)),w[F++]=Q<<6|J,N|=J&r;if(N!==0)throw Error("Base64Coder: incorrect characters for decoding");return w},u.prototype._encodeByte=function(D){var B=D;return B+=65,B+=25-D>>>8&6,B+=51-D>>>8&-75,B+=61-D>>>8&-15,B+=62-D>>>8&3,String.fromCharCode(B)},u.prototype._decodeChar=function(D){var B=r;return B+=(42-D&D-44)>>>8&-r+D-43+62,B+=(46-D&D-48)>>>8&-r+D-47+63,B+=(47-D&D-58)>>>8&-r+D-48+52,B+=(64-D&D-91)>>>8&-r+D-65+0,B+=(96-D&D-123)>>>8&-r+D-97+26,B},u.prototype._getPaddingLength=function(D){var B=0;if(this._paddingCharacter){for(var A=D.length-1;A>=0;A--){if(D[A]!==this._paddingCharacter)break;B++}if(D.length<4||B>2)throw Error("Base64Coder: incorrect padding")}return B},u}();h2.Coder=_8;var Cu=new _8;function uR(u){return Cu.encode(u)}h2.encode=uR;function DR(u){return Cu.decode(u)}h2.decode=DR;var jX=function(u){eS(D,u);function D(){return u!==null&&u.apply(this,arguments)||this}return D.prototype._encodeByte=function(B){var A=B;return A+=65,A+=25-B>>>8&6,A+=51-B>>>8&-75,A+=61-B>>>8&-13,A+=62-B>>>8&49,String.fromCharCode(A)},D.prototype._decodeChar=function(B){var A=r;return A+=(44-B&B-46)>>>8&-r+B-45+62,A+=(94-B&B-96)>>>8&-r+B-95+63,A+=(47-B&B-58)>>>8&-r+B-48+52,A+=(64-B&B-91)>>>8&-r+B-65+0,A+=(96-B&B-123)>>>8&-r+B-97+26,A},D}(_8);h2.URLSafeCoder=jX;var lX=new jX;function BR(u){return lX.encode(u)}h2.encodeURLSafe=BR;function AR(u){return lX.decode(u)}h2.decodeURLSafe=AR;h2.encodedLength=function(u){return Cu.encodedLength(u)};h2.maxDecodedLength=function(u){return Cu.maxDecodedLength(u)};h2.decodedLength=function(u){return Cu.decodedLength(u)}});var rX=z((iX,Q3)=>{(function(u,D){var B={};D(B);var A=B.default;for(var w in B)A[w]=B[w];if(typeof Q3==="object"&&typeof Q3.exports==="object")Q3.exports=A;else if(typeof define==="function"&&define.amd)define(function(){return A});else u.sha256=A})(iX,function(u){u.__esModule=!0,u.digestLength=32,u.blockSize=64;var D=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function B(J,v,W,Y,L){var x,c,H,V,g,y,H2,a,F2,s,Bu,Au,bu;while(L>=64){x=v[0],c=v[1],H=v[2],V=v[3],g=v[4],y=v[5],H2=v[6],a=v[7];for(s=0;s<16;s++)Bu=Y+s*4,J[s]=(W[Bu]&255)<<24|(W[Bu+1]&255)<<16|(W[Bu+2]&255)<<8|W[Bu+3]&255;for(s=16;s<64;s++)F2=J[s-2],Au=(F2>>>17|F2<<15)^(F2>>>19|F2<<13)^F2>>>10,F2=J[s-15],bu=(F2>>>7|F2<<25)^(F2>>>18|F2<<14)^F2>>>3,J[s]=(Au+J[s-7]|0)+(bu+J[s-16]|0);for(s=0;s<64;s++)Au=(((g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(g&y^~g&H2)|0)+(a+(D[s]+J[s]|0)|0)|0,bu=((x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10))+(x&c^x&H^c&H)|0,a=H2,H2=y,y=g,g=V+Au|0,V=H,H=c,c=x,x=Au+bu|0;v[0]+=x,v[1]+=c,v[2]+=H,v[3]+=V,v[4]+=g,v[5]+=y,v[6]+=H2,v[7]+=a,Y+=64,L-=64}return Y}var A=function(){function J(){this.digestLength=u.digestLength,this.blockSize=u.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return J.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},J.prototype.clean=function(){for(var v=0;v<this.buffer.length;v++)this.buffer[v]=0;for(var v=0;v<this.temp.length;v++)this.temp[v]=0;this.reset()},J.prototype.update=function(v,W){if(W===void 0)W=v.length;if(this.finished)throw Error("SHA256: can't update because hash was finished.");var Y=0;if(this.bytesHashed+=W,this.bufferLength>0){while(this.bufferLength<64&&W>0)this.buffer[this.bufferLength++]=v[Y++],W--;if(this.bufferLength===64)B(this.temp,this.state,this.buffer,0,64),this.bufferLength=0}if(W>=64)Y=B(this.temp,this.state,v,Y,W),W%=64;while(W>0)this.buffer[this.bufferLength++]=v[Y++],W--;return this},J.prototype.finish=function(v){if(!this.finished){var W=this.bytesHashed,Y=this.bufferLength,L=W/536870912|0,x=W<<3,c=W%64<56?64:128;this.buffer[Y]=128;for(var H=Y+1;H<c-8;H++)this.buffer[H]=0;this.buffer[c-8]=L>>>24&255,this.buffer[c-7]=L>>>16&255,this.buffer[c-6]=L>>>8&255,this.buffer[c-5]=L>>>0&255,this.buffer[c-4]=x>>>24&255,this.buffer[c-3]=x>>>16&255,this.buffer[c-2]=x>>>8&255,this.buffer[c-1]=x>>>0&255,B(this.temp,this.state,this.buffer,0,c),this.finished=!0}for(var H=0;H<8;H++)v[H*4+0]=this.state[H]>>>24&255,v[H*4+1]=this.state[H]>>>16&255,v[H*4+2]=this.state[H]>>>8&255,v[H*4+3]=this.state[H]>>>0&255;return this},J.prototype.digest=function(){var v=new Uint8Array(this.digestLength);return this.finish(v),v},J.prototype._saveState=function(v){for(var W=0;W<this.state.length;W++)v[W]=this.state[W]},J.prototype._restoreState=function(v,W){for(var Y=0;Y<this.state.length;Y++)this.state[Y]=v[Y];this.bytesHashed=W,this.finished=!1,this.bufferLength=0},J}();u.Hash=A;var w=function(){function J(v){this.inner=new A,this.outer=new A,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var W=new Uint8Array(this.blockSize);if(v.length>this.blockSize)new A().update(v).finish(W).clean();else for(var Y=0;Y<v.length;Y++)W[Y]=v[Y];for(var Y=0;Y<W.length;Y++)W[Y]^=54;this.inner.update(W);for(var Y=0;Y<W.length;Y++)W[Y]^=106;this.outer.update(W),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var Y=0;Y<W.length;Y++)W[Y]=0}return J.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},J.prototype.clean=function(){for(var v=0;v<this.istate.length;v++)this.ostate[v]=this.istate[v]=0;this.inner.clean(),this.outer.clean()},J.prototype.update=function(v){return this.inner.update(v),this},J.prototype.finish=function(v){if(this.outer.finished)this.outer.finish(v);else this.inner.finish(v),this.outer.update(v,this.digestLength).finish(v);return this},J.prototype.digest=function(){var v=new Uint8Array(this.digestLength);return this.finish(v),v},J}();u.HMAC=w;function F(J){var v=new A().update(J),W=v.digest();return v.clean(),W}u.hash=F,u.default=F;function G(J,v){var W=new w(J).update(v),Y=W.digest();return W.clean(),Y}u.hmac=G;function N(J,v,W,Y){var L=Y[0];if(L===0)throw Error("hkdf: cannot expand more");if(v.reset(),L>1)v.update(J);if(W)v.update(W);v.update(Y),v.finish(J),Y[0]++}var $=new Uint8Array(u.digestLength);function Z(J,v,W,Y){if(v===void 0)v=$;if(Y===void 0)Y=32;var L=new Uint8Array([1]),x=G(v,J),c=new w(x),H=new Uint8Array(c.digestLength),V=H.length,g=new Uint8Array(Y);for(var y=0;y<Y;y++){if(V===H.length)N(H,c,W,L),V=0;g[y]=H[V++]}return c.clean(),H.fill(0),L.fill(0),g}u.hkdf=Z;function Q(J,v,W,Y){var L=new w(J),x=L.digestLength,c=new Uint8Array(4),H=new Uint8Array(x),V=new Uint8Array(x),g=new Uint8Array(Y);for(var y=0;y*x<Y;y++){var H2=y+1;c[0]=H2>>>24&255,c[1]=H2>>>16&255,c[2]=H2>>>8&255,c[3]=H2>>>0&255,L.reset(),L.update(v),L.update(c),L.finish(V);for(var a=0;a<x;a++)H[a]=V[a];for(var a=2;a<=W;a++){L.reset(),L.update(V).finish(V);for(var F2=0;F2<x;F2++)H[F2]^=V[F2]}for(var a=0;a<x&&y*x+a<Y;a++)g[y*x+a]=H[a]}for(var y=0;y<x;y++)H[y]=V[y]=0;for(var y=0;y<4;y++)c[y]=0;return L.clean(),g}u.pbkdf2=Q})});var f8=z((aX)=>{Object.defineProperty(aX,"__esModule",{value:!0});aX.Webhook=aX.WebhookVerificationError=void 0;var wR=bX(),nX=dX(),FR=rX(),pX=300;class g8 extends Error{constructor(u){super(u);Object.setPrototypeOf(this,g8.prototype),this.name="ExtendableError",this.stack=Error(u).stack}}class D0 extends g8{constructor(u){super(u);Object.setPrototypeOf(this,D0.prototype),this.name="WebhookVerificationError"}}aX.WebhookVerificationError=D0;class Pu{constructor(u,D){if(!u)throw Error("Secret can't be empty.");if((D===null||D===void 0?void 0:D.format)==="raw")if(u instanceof Uint8Array)this.key=u;else this.key=Uint8Array.from(u,(B)=>B.charCodeAt(0));else{if(typeof u!=="string")throw Error("Expected secret to be of type string");if(u.startsWith(Pu.prefix))u=u.substring(Pu.prefix.length);this.key=nX.decode(u)}}verify(u,D){let B={};for(let J of Object.keys(D))B[J.toLowerCase()]=D[J];let A=B["webhook-id"],w=B["webhook-signature"],F=B["webhook-timestamp"];if(!w||!A||!F)throw new D0("Missing required headers");let G=this.verifyTimestamp(F),$=this.sign(A,G,u).split(",")[1],Z=w.split(" "),Q=new globalThis.TextEncoder;for(let J of Z){let[v,W]=J.split(",");if(v!=="v1")continue;if((0,wR.timingSafeEqual)(Q.encode(W),Q.encode($)))return JSON.parse(u.toString())}throw new D0("No matching signature found")}sign(u,D,B){if(typeof B==="string");else if(B.constructor.name==="Buffer")B=B.toString();else throw Error("Expected payload to be of type string or Buffer.");let A=new TextEncoder,w=Math.floor(D.getTime()/1000),F=A.encode(`${u}.${w}.${B}`);return`v1,${nX.encode(FR.hmac(this.key,F))}`}verifyTimestamp(u){let D=Math.floor(Date.now()/1000),B=parseInt(u,10);if(isNaN(B))throw new D0("Invalid Signature Headers");if(D-B>pX)throw new D0("Message timestamp too old");if(B>D+pX)throw new D0("Message timestamp too new");return new Date(B*1000)}}aX.Webhook=Pu;Pu.prefix="whsec_"});var eX=z((b8)=>{Object.defineProperty(b8,"__esModule",{value:!0});b8.Webhook=b8.WebhookVerificationError=void 0;var NR=f8(),$R=f8();Object.defineProperty(b8,"WebhookVerificationError",{enumerable:!0,get:function(){return $R.WebhookVerificationError}});class tX{constructor(u,D){this.inner=new NR.Webhook(u,D)}verify(u,D){var B,A,w,F,G,N;let $={};for(let Z of Object.keys(D))$[Z.toLowerCase()]=D[Z];return $["webhook-id"]=(A=(B=$["svix-id"])!==null&&B!==void 0?B:$["webhook-id"])!==null&&A!==void 0?A:"",$["webhook-signature"]=(F=(w=$["svix-signature"])!==null&&w!==void 0?w:$["webhook-signature"])!==null&&F!==void 0?F:"",$["webhook-timestamp"]=(N=(G=$["svix-timestamp"])!==null&&G!==void 0?G:$["webhook-timestamp"])!==null&&N!==void 0?N:"",this.inner.verify(u,$)}sign(u,D,B){return this.inner.sign(u,D,B)}}b8.Webhook=tX});var AY=z((DY)=>{Object.defineProperty(DY,"__esModule",{value:!0});DY.EndpointDisabledTriggerSerializer=DY.EndpointDisabledTrigger=void 0;var zR;(function(u){u.Manual="manual",u.Automatic="automatic"})(zR=DY.EndpointDisabledTrigger||(DY.EndpointDisabledTrigger={}));DY.EndpointDisabledTriggerSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var NY=z((FY)=>{Object.defineProperty(FY,"__esModule",{value:!0});FY.OrderingSerializer=FY.Ordering=void 0;var ZR;(function(u){u.Ascending="ascending",u.Descending="descending"})(ZR=FY.Ordering||(FY.Ordering={}));FY.OrderingSerializer={_fromJsonObject(u){return u},_toJsonObject(u){return u}}});var $Y=z((z2)=>{Object.defineProperty(z2,"__esModule",{value:!0});z2.StatusCodeClass=z2.SinkStatusIn=z2.SinkStatus=z2.Ordering=z2.MessageStatusText=z2.MessageStatus=z2.MessageAttemptTriggerType=z2.EndpointDisabledTrigger=z2.ConnectorProduct=z2.ConnectorKind=z2.BackgroundTaskType=z2.BackgroundTaskStatus=z2.AppPortalCapability=void 0;var JR=F8();Object.defineProperty(z2,"AppPortalCapability",{enumerable:!0,get:function(){return JR.AppPortalCapability}});var vR=e2();Object.defineProperty(z2,"BackgroundTaskStatus",{enumerable:!0,get:function(){return vR.BackgroundTaskStatus}});var QR=u0();Object.defineProperty(z2,"BackgroundTaskType",{enumerable:!0,get:function(){return QR.BackgroundTaskType}});var WR=I0();Object.defineProperty(z2,"ConnectorKind",{enumerable:!0,get:function(){return WR.ConnectorKind}});var XR=u3();Object.defineProperty(z2,"ConnectorProduct",{enumerable:!0,get:function(){return XR.ConnectorProduct}});var YR=AY();Object.defineProperty(z2,"EndpointDisabledTrigger",{enumerable:!0,get:function(){return YR.EndpointDisabledTrigger}});var KR=U8();Object.defineProperty(z2,"MessageAttemptTriggerType",{enumerable:!0,get:function(){return KR.MessageAttemptTriggerType}});var hR=q0();Object.defineProperty(z2,"MessageStatus",{enumerable:!0,get:function(){return hR.MessageStatus}});var xR=Ou();Object.defineProperty(z2,"MessageStatusText",{enumerable:!0,get:function(){return xR.MessageStatusText}});var HR=NY();Object.defineProperty(z2,"Ordering",{enumerable:!0,get:function(){return HR.Ordering}});var SR=I8();Object.defineProperty(z2,"SinkStatus",{enumerable:!0,get:function(){return SR.SinkStatus}});var RR=Z3();Object.defineProperty(z2,"SinkStatusIn",{enumerable:!0,get:function(){return RR.SinkStatusIn}});var UR=z8();Object.defineProperty(z2,"StatusCodeClass",{enumerable:!0,get:function(){return UR.StatusCodeClass}})});var JY=z((n)=>{var LR=n&&n.__createBinding||(Object.create?function(u,D,B,A){if(A===void 0)A=B;var w=Object.getOwnPropertyDescriptor(D,B);if(!w||("get"in w?!D.__esModule:w.writable||w.configurable))w={enumerable:!0,get:function(){return D[B]}};Object.defineProperty(u,A,w)}:function(u,D,B,A){if(A===void 0)A=B;u[A]=D[B]}),zY=n&&n.__exportStar||function(u,D){for(var B in u)if(B!=="default"&&!Object.prototype.hasOwnProperty.call(D,B))LR(D,u,B)};Object.defineProperty(n,"__esModule",{value:!0});n.Svix=n.messageInRaw=n.ValidationError=n.HttpErrorOut=n.HTTPValidationError=n.ApiException=void 0;var cR=$A(),ER=jA(),OR=Gw(),CR=qw(),PR=FF(),kR=UF(),VR=tF(),yR=BG(),TR=XZ(),IR=IZ(),qR=S8(),mR=zv(),_R=fv(),gR=AQ(),fR=TX(),bR=E8(),jR=B8();Object.defineProperty(n,"ApiException",{enumerable:!0,get:function(){return jR.ApiException}});var j8=mX();Object.defineProperty(n,"HTTPValidationError",{enumerable:!0,get:function(){return j8.HTTPValidationError}});Object.defineProperty(n,"HttpErrorOut",{enumerable:!0,get:function(){return j8.HttpErrorOut}});Object.defineProperty(n,"ValidationError",{enumerable:!0,get:function(){return j8.ValidationError}});zY(eX(),n);zY($Y(),n);var lR=S8();Object.defineProperty(n,"messageInRaw",{enumerable:!0,get:function(){return lR.messageInRaw}});var dR=[{region:"us",url:"https://api.us.svix.com"},{region:"eu",url:"https://api.eu.svix.com"},{region:"in",url:"https://api.in.svix.com"},{region:"ca",url:"https://api.ca.svix.com"},{region:"au",url:"https://api.au.svix.com"}];class ZY{constructor(u,D={}){var B,A,w;let F=(B=dR.find((N)=>N.region===u.split(".")[1]))===null||B===void 0?void 0:B.url,G=(w=(A=D.serverUrl)!==null&&A!==void 0?A:F)!==null&&w!==void 0?w:"https://api.svix.com";if(D.retryScheduleInMs){this.requestCtx={baseUrl:G,token:u,timeout:D.requestTimeout,retryScheduleInMs:D.retryScheduleInMs,fetch:D.fetch};return}if(D.numRetries){this.requestCtx={baseUrl:G,token:u,timeout:D.requestTimeout,numRetries:D.numRetries,fetch:D.fetch};return}this.requestCtx={baseUrl:G,token:u,timeout:D.requestTimeout,fetch:D.fetch}}get application(){return new cR.Application(this.requestCtx)}get authentication(){return new ER.Authentication(this.requestCtx)}get backgroundTask(){return new OR.BackgroundTask(this.requestCtx)}get connector(){return new CR.Connector(this.requestCtx)}get endpoint(){return new PR.Endpoint(this.requestCtx)}get environment(){return new kR.Environment(this.requestCtx)}get eventType(){return new VR.EventType(this.requestCtx)}get health(){return new yR.Health(this.requestCtx)}get ingest(){return new TR.Ingest(this.requestCtx)}get integration(){return new IR.Integration(this.requestCtx)}get message(){return new qR.Message(this.requestCtx)}get messageAttempt(){return new mR.MessageAttempt(this.requestCtx)}get operationalWebhook(){return new _R.OperationalWebhook(this.requestCtx)}get statistics(){return new gR.Statistics(this.requestCtx)}get streaming(){return new fR.Streaming(this.requestCtx)}get operationalWebhookEndpoint(){return new bR.OperationalWebhookEndpoint(this.requestCtx)}}n.Svix=ZY});class l2{async read(u){let D=typeof u==="string"?{name:u}:u,B=await this.fetch({name:D.name,bucket:D.bucket});if(!B.ok)throw new Z2(D.name);let A=B.headers.get("Content-Type")??"application/octet-stream",w=B.headers.get("ETag")??void 0,F=B.headers.get("Last-Modified"),G=F?new Date(F):void 0;if(D.range){let Z=await B.blob();return{body:Z,start:0,end:Z.size-1,total:Z.size,partial:!1,type:A,etag:w,lastModified:G,name:D.name}}let N=Number(B.headers.get("Content-Length")),$=Number.isFinite(N)?N:0;return{body:B.body,start:0,end:$-1,total:$,partial:!1,type:A,etag:w,lastModified:G,name:D.name}}async size(u){let D=typeof u==="string"?u:u.name,B=typeof u==="string"?void 0:u.bucket,A=await this.fetch({name:D,bucket:B});if(!A.ok)throw new Z2(D);let w=Number(A.headers.get("Content-Length"));if(Number.isFinite(w))return await A.body?.cancel(),w;return(await A.blob()).size}}import{readdir as QK}from"fs/promises";class ju extends l2{folderPath;constructor(u=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=u}async put(u){let D,B;if(u instanceof Blob)D=u,B=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`;else D=u.body,B=u.name;let A=D instanceof Buffer?D:D instanceof Blob||D instanceof File?Buffer.from(await D.arrayBuffer()):"",w=`${this.folderPath}/${B}`;return await Bun.write(w,A),B}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=`${this.folderPath}/${B}`,w=Bun.file(A),F=Bun.file(A).stream(),G=new Date(w.lastModified).toUTCString();return new Response(F,{headers:{"Content-Type":w.type,"Content-Length":String(w.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":G}})}async read(u){let D=typeof u==="string"?{name:u}:u,{name:B,range:A=null}=D;if(!B)throw Error("Object name has to be specified");let w=Bun.file(`${this.folderPath}/${B}`);if(!await w.exists())throw new Z2(B);let F=w.size,G=A?wu(A,F):null;if(A&&!G)throw new d2(F);let N=G?.start??0,$=G?G.end:F-1;return{body:G?w.slice(N,$+1):w,start:N,end:$,total:F,partial:Boolean(G),type:w.type||"application/octet-stream",lastModified:new Date(w.lastModified),name:B}}async size(u){let D=typeof u==="string"?u:u.name,B=Bun.file(`${this.folderPath}/${D}`);if(!await B.exists())throw new Z2(D);return B.size}async list(){return await QK(this.folderPath)}}class r5 extends f{driver=new ju;boot(){}}var n5=X(g2(),1);function WK(u){return(D)=>async(B)=>{let{request:A}=B;if(u.expectContinueHeader!==!1&&n5.HttpRequest.isInstance(A)&&A.body&&u.runtime==="node"&&u.requestHandler?.constructor?.name!=="FetchHttpHandler"){let w=!0;if(typeof u.expectContinueHeader==="number")try{w=(Number(A.headers?.["content-length"])??u.bodyLengthChecker?.(A.body)??1/0)>=u.expectContinueHeader}catch(F){}else w=!!u.expectContinueHeader;if(w)A.headers.Expect="100-continue"}return D({...B,request:A})}}var XK={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},p5=(u)=>({applyToStack:(D)=>{D.add(WK(u),XK)}});var S2={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},lu=S2.WHEN_SUPPORTED,N0={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},du=S2.WHEN_SUPPORTED,k;(function(u){u.MD5="MD5",u.CRC32="CRC32",u.CRC32C="CRC32C",u.CRC64NVME="CRC64NVME",u.SHA1="SHA1",u.SHA256="SHA256"})(k||(k={}));var a5;(function(u){u.HEADER="header",u.TRAILER="trailer"})(a5||(a5={}));var Fu=k.CRC32;var i2;(function(u){u.ENV="env",u.CONFIG="shared config entry"})(i2||(i2={}));var h0=(u,D,B,A)=>{if(!(D in u))return;let w=u[D].toUpperCase();if(!Object.values(B).includes(w))throw TypeError(`Cannot load ${A} '${D}'. Expected one of ${Object.values(B)}, got '${u[D]}'.`);return w};var YK="AWS_REQUEST_CHECKSUM_CALCULATION",KK="request_checksum_calculation",s5={environmentVariableSelector:(u)=>h0(u,YK,S2,i2.ENV),configFileSelector:(u)=>h0(u,KK,S2,i2.CONFIG),default:lu};var hK="AWS_RESPONSE_CHECKSUM_VALIDATION",xK="response_checksum_validation",t5={environmentVariableSelector:(u)=>h0(u,hK,N0,i2.ENV),configFileSelector:(u)=>h0(u,xK,N0,i2.CONFIG),default:du};var x0=X(H0(),1),z4=X(g2(),1),Z4=X(tu(),1);var o5=(u,{requestChecksumRequired:D,requestAlgorithmMember:B,requestChecksumCalculation:A})=>{if(!B)return A===S2.WHEN_SUPPORTED||D?Fu:void 0;if(!u[B])return;return u[B]};var $0=(u)=>u===k.MD5?"content-md5":`x-amz-checksum-${u.toLowerCase()}`;var e5=(u,D)=>{let B=u.toLowerCase();for(let A of Object.keys(D))if(B===A.toLowerCase())return!0;return!1};var u4=(u,D)=>{let B=u.toLowerCase();for(let A of Object.keys(D))if(A.toLowerCase().startsWith(B))return!0;return!1};var D4=X(HK(),1),iu=(u)=>u!==void 0&&typeof u!=="string"&&!ArrayBuffer.isView(u)&&!D4.isArrayBuffer(u);var B4=X(SK(),1),{__extends:GM,__assign:NM,__rest:$M,__decorate:zM,__param:ZM,__esDecorate:JM,__runInitializers:vM,__propKey:QM,__setFunctionName:WM,__metadata:XM,__awaiter:ru,__generator:nu,__exportStar:YM,__createBinding:KM,__values:pu,__read:hM,__spread:xM,__spreadArrays:HM,__spreadArray:SM,__await:RM,__asyncGenerator:UM,__asyncDelegator:MM,__asyncValues:LM,__makeTemplateObject:cM,__importStar:EM,__importDefault:OM,__classPrivateFieldGet:CM,__classPrivateFieldSet:PM,__classPrivateFieldIn:kM,__addDisposableResource:VM,__disposeResources:yM,__rewriteRelativeImportExtension:TM}=B4.default;import{Buffer as A4}from"buffer";var w4=(u,D)=>{if(typeof u!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof u} (${u})`);return D?A4.from(u,D):A4.from(u)};var q3=(u)=>{let D=w4(u,"utf8");return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var RK=typeof Buffer<"u"&&Buffer.from?function(u){return Buffer.from(u,"utf8")}:q3;function Gu(u){if(u instanceof Uint8Array)return u;if(typeof u==="string")return RK(u);if(ArrayBuffer.isView(u))return new Uint8Array(u.buffer,u.byteOffset,u.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(u)}function Nu(u){if(typeof u==="string")return u.length===0;return u.byteLength===0}function z0(u){return new Uint8Array([(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255])}function $u(u){if(!Uint32Array.from){var D=new Uint32Array(u.length),B=0;while(B<u.length)D[B]=u[B],B+=1;return D}return Uint32Array.from(u)}var _3=function(){function u(){this.crc32c=new m3}return u.prototype.update=function(D){if(Nu(D))return;this.crc32c.update(Gu(D))},u.prototype.digest=function(){return ru(this,void 0,void 0,function(){return nu(this,function(D){return[2,z0(this.crc32c.digest())]})})},u.prototype.reset=function(){this.crc32c=new m3},u}();var m3=function(){function u(){this.checksum=4294967295}return u.prototype.update=function(D){var B,A;try{for(var w=pu(D),F=w.next();!F.done;F=w.next()){var G=F.value;this.checksum=this.checksum>>>8^MK[(this.checksum^G)&255]}}catch(N){B={error:N}}finally{try{if(F&&!F.done&&(A=w.return))A.call(w)}finally{if(B)throw B.error}}return this},u.prototype.digest=function(){return(this.checksum^4294967295)>>>0},u}();var UK=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],MK=$u(UK);var LK=()=>{let D=[,,,,,,,,];for(let B=0;B<8;B++){let A=Array(512);for(let w=0;w<256;w++){let F=BigInt(w);for(let G=0;G<8*(B+1);G++)if(F&1n)F=F>>1n^0x9a6c9329ac4bc9b5n;else F=F>>1n;A[w*2]=Number(F>>32n&0xffffffffn),A[w*2+1]=Number(F&0xffffffffn)}D[B]=new Uint32Array(A)}return D},g3,zu,f3,b3,j3,l3,d3,i3,r3,cK=()=>{if(!g3)g3=LK(),[zu,f3,b3,j3,l3,d3,i3,r3]=g3};class n3{c1=0;c2=0;constructor(){cK(),this.reset()}update(u){let D=u.length,B=0,A=this.c1,w=this.c2;while(B+8<=D){let F=((w^u[B++])&255)<<1,G=((w>>>8^u[B++])&255)<<1,N=((w>>>16^u[B++])&255)<<1,$=((w>>>24^u[B++])&255)<<1,Z=((A^u[B++])&255)<<1,Q=((A>>>8^u[B++])&255)<<1,J=((A>>>16^u[B++])&255)<<1,v=((A>>>24^u[B++])&255)<<1;A=r3[F]^i3[G]^d3[N]^l3[$]^j3[Z]^b3[Q]^f3[J]^zu[v],w=r3[F+1]^i3[G+1]^d3[N+1]^l3[$+1]^j3[Z+1]^b3[Q+1]^f3[J+1]^zu[v+1]}while(B<D){let F=((w^u[B])&255)<<1;w=(w>>>8|(A&255)<<24)>>>0,A=A>>>8^zu[F],w^=zu[F+1],B++}this.c1=A,this.c2=w}async digest(){let u=this.c1^4294967295,D=this.c2^4294967295;return new Uint8Array([u>>>24,u>>>16&255,u>>>8&255,u&255,D>>>24,D>>>16&255,D>>>8&255,D&255])}reset(){this.c1=4294967295,this.c2=4294967295}}var p3={CrtCrc64Nvme:null};var a3=function(){function u(){this.crc32=new Z0}return u.prototype.update=function(D){if(Nu(D))return;this.crc32.update(Gu(D))},u.prototype.digest=function(){return ru(this,void 0,void 0,function(){return nu(this,function(D){return[2,z0(this.crc32.digest())]})})},u.prototype.reset=function(){this.crc32=new Z0},u}();var Z0=function(){function u(){this.checksum=4294967295}return u.prototype.update=function(D){var B,A;try{for(var w=pu(D),F=w.next();!F.done;F=w.next()){var G=F.value;this.checksum=this.checksum>>>8^OK[(this.checksum^G)&255]}}catch(N){B={error:N}}finally{try{if(F&&!F.done&&(A=w.return))A.call(w)}finally{if(B)throw B.error}}return this},u.prototype.digest=function(){return(this.checksum^4294967295)>>>0},u}();var EK=[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,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],OK=$u(EK);import*as s3 from"zlib";class F4{checksum=0;update(u){this.checksum=s3.crc32(u,this.checksum)}async digest(){return z0(this.checksum)}reset(){this.checksum=0}}var G4=()=>{if(typeof s3.crc32>"u")return a3;return F4};var N4=[k.CRC32,k.CRC32C,k.CRC64NVME,k.SHA1,k.SHA256],t3=[k.SHA256,k.SHA1,k.CRC32,k.CRC32C,k.CRC64NVME];var au=(u,D)=>{let{checksumAlgorithms:B={}}=D;switch(u){case k.MD5:return B?.MD5??D.md5;case k.CRC32:return B?.CRC32??G4();case k.CRC32C:return B?.CRC32C??_3;case k.CRC64NVME:if(typeof p3.CrtCrc64Nvme!=="function")return B?.CRC64NVME??n3;return B?.CRC64NVME??p3.CrtCrc64Nvme;case k.SHA1:return B?.SHA1??D.sha1;case k.SHA256:return B?.SHA256??D.sha256;default:if(B?.[u])return B[u];throw Error(`The checksum algorithm "${u}" is not supported by the client. Select one of ${N4}, or provide an implementation to the client constructor checksums field.`)}};var $4=X(o3(),1),su=(u,D)=>{let B=new u;return B.update($4.toUint8Array(D||"")),B.digest()};var J4={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},v4=(u,D)=>(B,A)=>async(w)=>{if(!z4.HttpRequest.isInstance(w.request))return B(w);if(u4("x-amz-checksum-",w.request.headers))return B(w);let{request:F,input:G}=w,{body:N,headers:$}=F,{base64Encoder:Z,streamHasher:Q}=u,{requestChecksumRequired:J,requestAlgorithmMember:v}=D,W=await u.requestChecksumCalculation(),Y=v?.name,L=v?.httpHeader;if(Y&&!G[Y]){if(W===S2.WHEN_SUPPORTED||J){if(G[Y]=Fu,L)$[L]=Fu}}let x=o5(G,{requestChecksumRequired:J,requestAlgorithmMember:v?.name,requestChecksumCalculation:W}),c=N,H=$;if(x){switch(x){case k.CRC32:x0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case k.CRC32C:x0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case k.CRC64NVME:x0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case k.SHA1:x0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case k.SHA256:x0.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y");break}let V=$0(x),g=au(x,u);if(iu(N)){let{getAwsChunkedEncodingStream:y,bodyLengthChecker:H2}=u;c=y(typeof u.requestStreamBufferSize==="number"&&u.requestStreamBufferSize>=8192?Z4.createBufferedReadable(N,u.requestStreamBufferSize,A.logger):N,{base64Encoder:Z,bodyLengthChecker:H2,checksumLocationName:V,checksumAlgorithmFn:g,streamHasher:Q}),H={...$,"content-encoding":$["content-encoding"]?`${$["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":$["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":V},delete H["content-length"]}else if(!e5(V,$)){let y=await su(g,N);H={...$,[V]:Z(y)}}}try{return await B({...w,request:{...F,headers:H,body:c}})}catch(V){if(V instanceof Error&&V.name==="InvalidChunkSizeError")try{if(!V.message.endsWith("."))V.message+=".";V.message+=" Set [requestStreamBufferSize=number e.g. 65_536] in client constructor to instruct AWS SDK to buffer your input stream."}catch(g){}throw V}};var Zu=X(H0(),1);var Q4={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},W4=(u,D)=>(B,A)=>async(w)=>{let F=w.input,{requestValidationModeMember:G}=D,N=await u.requestChecksumCalculation(),$=await u.responseChecksumValidation();switch(N){case S2.WHEN_REQUIRED:Zu.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case S2.WHEN_SUPPORTED:Zu.setFeature(A,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z");break}switch($){case N0.WHEN_REQUIRED:Zu.setFeature(A,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case N0.WHEN_SUPPORTED:Zu.setFeature(A,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b");break}if(G&&!F[G]){if($===N0.WHEN_SUPPORTED)F[G]="ENABLED"}return B(w)};var x4=X(g2(),1);var ou=(u=[])=>{let D=[],B=t3.length;for(let A of u){let w=t3.indexOf(A);if(w!==-1)D[w]=A;else D[B++]=A}return D.filter(Boolean)};var X4=(u)=>{let D=u.lastIndexOf("-");if(D!==-1){let B=u.slice(D+1);if(!B.startsWith("0")){let A=parseInt(B,10);if(!isNaN(A)&&A>=1&&A<=1e4)return!0}}return!1};var K4=X(tu(),1);var Y4=async(u,{checksumAlgorithmFn:D,base64Encoder:B})=>B(await su(D,u));var h4=async(u,{config:D,responseAlgorithms:B,logger:A})=>{let w=ou(B),{body:F,headers:G}=u;for(let N of w){let $=$0(N),Z=G[$];if(Z){let Q;try{Q=au(N,D)}catch(W){if(N===k.CRC64NVME){A?.warn(`Skipping ${k.CRC64NVME} checksum validation: ${W.message}`);continue}throw W}let{base64Encoder:J}=D;if(iu(F)){u.body=K4.createChecksumStream({expectedChecksum:Z,checksumSourceLocation:$,checksum:new Q,source:F,base64Encoder:J});return}let v=await Y4(F,{checksumAlgorithmFn:Q,base64Encoder:J});if(v===Z)break;throw Error(`Checksum mismatch: expected "${v}" but received "${Z}" in response header "${$}".`)}}};var H4={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},S4=(u,D)=>(B,A)=>async(w)=>{if(!x4.HttpRequest.isInstance(w.request))return B(w);let F=w.input,G=await B(w),N=G.response,{requestValidationModeMember:$,responseAlgorithms:Z}=D;if($&&F[$]==="ENABLED"){let{clientName:Q,commandName:J}=A,v=Object.keys(u.checksumAlgorithms??{}).filter((L)=>{let x=$0(L);return N.headers[x]!==void 0}),W=ou([...Z??[],...v]);if(Q==="S3Client"&&J==="GetObjectCommand"&&W.every((L)=>{let x=$0(L),c=N.headers[x];return!c||X4(c)}))return G;await h4(N,{config:u,responseAlgorithms:W,logger:A.logger})}return G};var eu=(u,D)=>({applyToStack:(B)=>{B.add(v4(u,D),J4),B.addRelativeTo(W4(u,D),Q4),B.addRelativeTo(S4(u,D),H4)}});var e3=X(uD(),1);var R4=(u)=>{let{requestChecksumCalculation:D,responseChecksumValidation:B,requestStreamBufferSize:A}=u;return Object.assign(u,{requestChecksumCalculation:e3.normalizeProvider(D??lu),responseChecksumValidation:e3.normalizeProvider(B??du),requestStreamBufferSize:Number(A??0),checksumAlgorithms:u.checksumAlgorithms??{}})};var b1=X(hx(),1),WB=X(xx(),1),XB=X(Hx(),1);var U4=X(g2(),1),M4=X(R2(),1),CK="content-length",PK="x-amz-decoded-content-length";function kK(){return(u,D)=>async(B)=>{let{request:A}=B;if(U4.HttpRequest.isInstance(A)){if(!(CK in A.headers)&&!(PK in A.headers))if(typeof D?.logger?.warn==="function"&&!(D.logger instanceof M4.NoOpLogger))D.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return u({...B})}}var VK={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},L4=(u)=>({applyToStack:(D)=>{D.add(kK(),VK)}});var c4=(u)=>{return(D,B)=>async(A)=>{let w=await u.region(),F=u.region,G=()=>{};if(B.__s3RegionRedirect)Object.defineProperty(u,"region",{writable:!1,value:async()=>{return B.__s3RegionRedirect}}),G=()=>Object.defineProperty(u,"region",{writable:!0,value:F});try{let N=await D(A);if(B.__s3RegionRedirect){G();let $=await u.region();if(w!==$)throw Error("Region was not restored following S3 region redirect.")}return N}catch(N){throw G(),N}}},E4={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function yK(u){return(D,B)=>async(A)=>{try{return await D(A)}catch(w){if(u.followRegionRedirects){let F=w?.$metadata?.httpStatusCode,G=B.commandName==="HeadBucketCommand",N=w?.$response?.headers?.["x-amz-bucket-region"];if(N){if(F===301||F===400&&(w?.name==="IllegalLocationConstraintException"||G)){try{let $=N;B.logger?.debug(`Redirecting from ${await u.region()} to ${$}`),B.__s3RegionRedirect=$}catch($){throw Error("Region redirect failed: "+$)}return D(A)}}}throw w}}}var TK={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},O4=(u)=>({applyToStack:(D)=>{D.add(yK(u),TK),D.addRelativeTo(c4(u),E4)}});var C4=X(g2(),1),P4=X(R2(),1),IK=(u)=>{return(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(C4.HttpResponse.isInstance(F)){if(F.headers.expires){F.headers.expiresstring=F.headers.expires;try{P4.parseRfc7231DateTime(F.headers.expires)}catch(G){B.logger?.warn(`AWS SDK Warning for ${B.clientName}::${B.commandName} response parsing (${F.headers.expires}): ${G}`),delete F.headers.expires}}}return w}},qK={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},u1=(u)=>({applyToStack:(D)=>{D.addRelativeTo(IK(u),qK)}});class D1{data;lastPurgeTime=Date.now();static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;constructor(u={}){this.data=u}get(u){let D=this.data[u];if(!D)return;return D}set(u,D){return this.data[u]=D,D}delete(u){delete this.data[u]}async purgeExpired(){let u=Date.now();if(this.lastPurgeTime+D1.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>u)return;for(let D in this.data){let B=this.data[D];if(!B.isRefreshing){let A=await B.identity;if(A.expiration){if(A.expiration.getTime()<u)delete this.data[D]}}}}}class Ju{_identity;isRefreshing;accessed;constructor(u,D=!1,B=Date.now()){this._identity=u,this.isRefreshing=D,this.accessed=B}get identity(){return this.accessed=Date.now(),this._identity}}class vu{createSessionFn;cache;static REFRESH_WINDOW_MS=60000;constructor(u,D=new D1){this.createSessionFn=u,this.cache=D}async getS3ExpressIdentity(u,D){let B=D.Bucket,{cache:A}=this,w=A.get(B);if(w)return w.identity.then((F)=>{if((F.expiration?.getTime()??0)<Date.now())return A.set(B,new Ju(this.getIdentity(B))).identity;if((F.expiration?.getTime()??0)<Date.now()+vu.REFRESH_WINDOW_MS&&!w.isRefreshing)w.isRefreshing=!0,this.getIdentity(B).then(($)=>{A.set(B,new Ju(Promise.resolve($)))});return F});return A.set(B,new Ju(this.getIdentity(B))).identity}async getIdentity(u){await this.cache.purgeExpired().catch((A)=>{console.warn(`Error while clearing expired entries in S3ExpressIdentityCache:
|
|
4
|
+
`+A)});let D=await this.createSessionFn(u);if(!D.Credentials?.AccessKeyId||!D.Credentials?.SecretAccessKey)throw Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:D.Credentials.AccessKeyId,secretAccessKey:D.Credentials.SecretAccessKey,sessionToken:D.Credentials.SessionToken,expiration:D.Credentials.Expiration?new Date(D.Credentials.Expiration):void 0}}}var _4=X(m4(),1);var S0=X(k4(),1),V4="Directory",y4="S3Express",T4="sigv4-s3express",B1="X-Amz-S3session-Token",Qu=B1.toLowerCase(),mK="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",_K="s3_disable_express_session_auth",DD={environmentVariableSelector:(u)=>S0.booleanSelector(u,mK,S0.SelectorType.ENV),configFileSelector:(u)=>S0.booleanSelector(u,_K,S0.SelectorType.CONFIG),default:!1};class A1 extends _4.SignatureV4{async signWithCredentials(u,D,B){let A=I4(D);u.headers[Qu]=D.sessionToken;let w=this;return q4(w,A),w.signRequest(u,B??{})}async presignWithCredentials(u,D,B){let A=I4(D);return delete u.headers[Qu],u.headers[B1]=D.sessionToken,u.query=u.query??{},u.query[B1]=D.sessionToken,q4(this,A),this.presign(u,B)}}function I4(u){return{accessKeyId:u.accessKeyId,secretAccessKey:u.secretAccessKey,expiration:u.expiration}}function q4(u,D){let B=setTimeout(()=>{throw Error("SignatureV4S3Express credential override was created but not called.")},10),A=u.credentialProvider,w=()=>{return clearTimeout(B),u.credentialProvider=A,Promise.resolve(D)};u.credentialProvider=w}var g4=X(H0(),1),f4=X(g2(),1);var b4=(u)=>{return(D,B)=>async(A)=>{if(B.endpointV2){let w=B.endpointV2,F=w.properties?.authSchemes?.[0]?.name===T4;if(w.properties?.backend===y4||w.properties?.bucketType===V4)g4.setFeature(B,"S3_EXPRESS_BUCKET","J"),B.isS3ExpressBucket=!0;if(F){let N=A.input.Bucket;if(N){let $=await u.s3ExpressIdentityProvider.getS3ExpressIdentity(await u.credentials(),{Bucket:N});if(B.s3ExpressIdentity=$,f4.HttpRequest.isInstance(A.request)&&$.sessionToken)A.request.headers[Qu]=$.sessionToken}}}return D(A)}},j4={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},BD=(u)=>({applyToStack:(D)=>{D.add(b4(u),j4)}});var i4=X(d4(),1),r4=X(g2(),1),n4=X(uD(),1);var l4=async(u,D,B,A)=>{let w=await A.signWithCredentials(B,u,{});if(w.headers["X-Amz-Security-Token"]||w.headers["x-amz-security-token"])throw Error("X-Amz-Security-Token must not be set for s3-express requests.");return w};var gK=(u)=>(D)=>{throw D},fK=(u,D)=>{};var p4=(u)=>(D,B)=>async(A)=>{if(!r4.HttpRequest.isInstance(A.request))return D(A);let F=n4.getSmithyContext(B).selectedHttpAuthScheme;if(!F)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:G={}},identity:N,signer:$}=F,Z;if(B.s3ExpressIdentity)Z=await l4(B.s3ExpressIdentity,G,A.request,await u.signer());else Z=await $.sign(A.request,N,G);let Q=await D({...A,request:Z}).catch(($.errorHandler||gK)(G));return($.successHandler||fK)(Q.response,G),Q},AD=(u)=>({applyToStack:(D)=>{D.addRelativeTo(p4(u),i4.httpSigningMiddlewareOptions)}});var a4=(u,{session:D})=>{let[B,A]=D,{forcePathStyle:w,useAccelerateEndpoint:F,disableMultiregionAccessPoints:G,followRegionRedirects:N,s3ExpressIdentityProvider:$,bucketEndpoint:Z,expectContinueHeader:Q}=u;return Object.assign(u,{forcePathStyle:w??!1,useAccelerateEndpoint:F??!1,disableMultiregionAccessPoints:G??!1,followRegionRedirects:N??!1,s3ExpressIdentityProvider:$??new vu(async(J)=>B().send(new A({Bucket:J}))),bucketEndpoint:Z??!1,expectContinueHeader:Q??2097152})};var s4=X(g2(),1),w1=X(tu(),1),bK={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},jK=3000,lK=(u)=>(D,B)=>async(A)=>{let w=await D(A),{response:F}=w;if(!s4.HttpResponse.isInstance(F))return w;let{statusCode:G,body:N}=F;if(G<200||G>=300)return w;if(!(typeof N?.stream==="function"||typeof N?.pipe==="function"||typeof N?.tee==="function"))return w;let Z=N,Q=N;if(N&&typeof N==="object"&&!(N instanceof Uint8Array))[Z,Q]=await w1.splitStream(N);F.body=Q;let J=await dK(Z,{streamCollector:async(W)=>{return w1.headStream(W,jK)}});if(typeof Z?.destroy==="function")Z.destroy();let v=u.utf8Encoder(J.subarray(J.length-16));if(J.length===0&&bK[B.commandName]){let W=Error("S3 aborted request");throw W.name="InternalError",W}if(v&&v.endsWith("</Error>"))F.statusCode=400;return w},dK=(u=new Uint8Array,D)=>{if(u instanceof Uint8Array)return Promise.resolve(u);return D.streamCollector(u)||Promise.resolve(new Uint8Array)},iK={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},r2=(u)=>({applyToStack:(D)=>{D.addRelativeTo(lK(u),iK)}});var t4=(u)=>typeof u==="string"&&u.indexOf("arn:")===0&&u.split(":").length>=6;function o4(u){return(D,B)=>async(A)=>{if(u.bucketEndpoint){let w=B.endpointV2;if(w){let F=A.input.Bucket;if(typeof F==="string")try{let G=new URL(F);B.endpointV2={...w,url:G}}catch(G){let N=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${F} could not be parsed as URL.`;if(B.logger?.constructor?.name==="NoOpLogger")console.warn(N);else B.logger?.warn?.(N);throw G}}}return D(A)}}var e4={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function rK({bucketEndpoint:u}){return(D)=>async(B)=>{let{input:{Bucket:A}}=B;if(!u&&typeof A==="string"&&!t4(A)&&A.indexOf("/")>=0){let w=Error(`Bucket name shouldn't contain '/', received '${A}'`);throw w.name="InvalidBucketName",w}return D({...B})}}var nK={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},u9=(u)=>({applyToStack:(D)=>{D.add(rK(u),nK),D.addRelativeTo(o4(u),e4)}});var j1=X(Sx(),1),YB=X(FB(),1),k0=X(d4(),1),KB=X(x6(),1);var D9=(u)=>Object.assign(u,{eventStreamMarshaller:u.eventStreamSerdeProvider(u)});var hB=X(Rx(),1),xB=X(J0(),1),l1=X(GB(),1),HB=X(R2(),1);var Z1=X(H0(),1);var wD=X(m4(),1);var Wu={CrtSignerV4:null};class Xu{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof Wu.CrtSignerV4==="function")return"crt";else if(typeof wD.signatureV4aContainer.SignatureV4a==="function")return"js";return"none"}constructor(u){this.sigv4Signer=new A1(u),this.signerOptions=u}async sign(u,D={}){if(D.signingRegion==="*")return this.getSigv4aSigner().sign(u,D);return this.sigv4Signer.sign(u,D)}async signWithCredentials(u,D,B={}){if(B.signingRegion==="*"){let A=this.getSigv4aSigner(),w=Wu.CrtSignerV4;if(w&&A instanceof w)return A.signWithCredentials(u,D,B);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(u,D,B)}async presign(u,D={}){if(D.signingRegion==="*"){let B=this.getSigv4aSigner(),A=Wu.CrtSignerV4;if(A&&B instanceof A)return B.presign(u,D);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(u,D)}async presignWithCredentials(u,D,B={}){if(B.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(u,D,B)}getSigv4aSigner(){if(!this.sigv4aSigner){let u=Wu.CrtSignerV4,D=wD.signatureV4aContainer.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!u&&!D)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(u&&typeof u==="function")this.sigv4aSigner=new u({...this.signerOptions,signingAlgorithm:1});else if(D&&typeof D==="function")this.sigv4aSigner=new D({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!D||typeof D!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new D({...this.signerOptions})}}return this.sigv4aSigner}}var Z6=X(J0(),1),c0=X(uD(),1);var z6=X(wh(),1),L0=X(Ah(),1);var R0={["required"]:!1,["type"]:"string"},U0={["required"]:!0,default:!1,["type"]:"boolean"},Yu={["required"]:!1,["type"]:"boolean"},M2={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},j={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},D6={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},B9={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},hu={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},O={["ref"]:"Bucket"},A9={["conditions"]:[M2],["error"]:"S3Express does not support S3 Accelerate.",["type"]:"error"},w9={["conditions"]:[j,{["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"}],["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]}],["rules"]:[{["conditions"]:[{["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]}],["rules"]:[{["endpoint"]:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],["type"]:"tree"},{["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"}],["type"]:"tree"},$2={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},FD={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},B6={["ref"]:"url"},A6={["fn"]:"uriEncode",["argv"]:[O],["assign"]:"uri_encoded_bucket"},Y2={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},K={},w6={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!1]},F9={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},G9={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},N9={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},h={["fn"]:"not",["argv"]:[j]},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},F1={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},$9={["fn"]:"not",["argv"]:[hu]},z9={["ref"]:"hardwareType"},Z9={["conditions"]:[h],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},G1={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},GD={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},pK={["ref"]:"ForcePathStyle"},l={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},p={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},t={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[p]},o={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},J9={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},d={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},e={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},v9={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},Q9={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},W9={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},ND={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[B6,"isIp"]},!1]},$D={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:d,["headers"]:{}},OD={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:d,["headers"]:{}},X9={["endpoint"]:OD,["type"]:"endpoint"},zD={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},Y9={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},N1={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},J2={["ref"]:"bucketArn"},F6={["ref"]:"arnType"},ZD={["fn"]:"getAttr",["argv"]:[J2,"service"]},CD={["ref"]:"accessPointName"},K9={["conditions"]:[T],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},h9={["conditions"]:[M2],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},x9={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},JD={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J2,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},G6={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},N6={["fn"]:"getAttr",["argv"]:[J2,"accountId"]},vD={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},H9={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},QD={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},WD={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},XD={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},S9={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},R9={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Ku={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},U9={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},M9={["fn"]:"aws.parseArn",["argv"]:[O]},L9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},c9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},E9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},YD={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},O9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:{}},C9={["ref"]:"UseObjectLambdaEndpoint"},KD={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},P9={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},k9={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},V9={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},hD={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:d,["headers"]:{}},y9={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:{}},xD=[{["ref"]:"Region"}],aK=[{["ref"]:"Endpoint"}],sK=[O],HD=[M2],M0=[j,$2],T9=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],tK=[A6],SD=[w6],U2=[D6],RD=[I,T],xu=[I,U],Hu=[S,T],Su=[S,U],I9=[{["fn"]:"substring",["argv"]:[O,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],I2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Hu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Su,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:{}},["type"]:"endpoint"}],q9=[{["fn"]:"substring",["argv"]:[O,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],m9=[{["fn"]:"substring",["argv"]:[O,6,19,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,19,21,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],_9=[{["fn"]:"substring",["argv"]:[O,6,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],g9=[{["fn"]:"substring",["argv"]:[O,6,26,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,26,28,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],q2=[{["conditions"]:[I,T],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:xu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Hu,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"},{["conditions"]:Su,["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},["headers"]:{}},["type"]:"endpoint"}],f9=[O,0,7,!0],b9=[{["fn"]:"substring",["argv"]:[O,7,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],j9=[{["fn"]:"substring",["argv"]:[O,7,16,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,16,18,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],l9=[{["fn"]:"substring",["argv"]:[O,7,20,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,20,22,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],d9=[{["fn"]:"substring",["argv"]:[O,7,21,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,21,23,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],i9=[{["fn"]:"substring",["argv"]:[O,7,27,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[O,27,29,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],oK=[hu],r9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],n9=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],eK=["*"],p9=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],n2=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],UD=[{["fn"]:"stringEquals",["argv"]:[F6,"accesspoint"]}],a9=[{["fn"]:"getAttr",["argv"]:[J2,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[CD,""]}]}],uh=[J2,"resourceId[1]"],s9=[T],MD=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[J2,"region"]},""]}]}],t9=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J2,"resourceId[2]"]}]}]}],Dh=[J2,"resourceId[2]"],LD=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[J2,"region"]}],["assign"]:"bucketPartition"}],o9=[{["fn"]:"stringEquals",["argv"]:[G6,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],cD=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[J2,"region"]},!0]}],ED=[{["fn"]:"isValidHostLabel",["argv"]:[N6,!1]}],e9=[{["fn"]:"isValidHostLabel",["argv"]:[CD,!1]}],$1=[I],u6=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Bh={version:"1.0",parameters:{Bucket:R0,Region:R0,UseFIPS:U0,UseDualStack:U0,Endpoint:R0,ForcePathStyle:U0,Accelerate:U0,UseGlobalEndpoint:U0,UseObjectLambdaEndpoint:Yu,Key:R0,Prefix:R0,CopySource:R0,DisableAccessPoints:Yu,DisableMultiRegionAccessPoints:U0,UseArnRegion:Yu,UseS3ExpressControlEndpoint:Yu,DisableS3ExpressSessionAuth:Yu},["rules"]:[{["conditions"]:[{["fn"]:"isSet",["argv"]:xD}],["rules"]:[{["conditions"]:[M2,I],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[T,j],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[j,I],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[j,M2],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[I,D6,B9],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[hu,{["fn"]:"substring",["argv"]:[O,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],["rules"]:[A9,w9,{["conditions"]:[G9,N9],["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:[A6,h],["rules"]:[{["conditions"]:RD,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:xu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:Hu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:Su,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:SD,["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:T9,["rules"]:[{["conditions"]:I9,["rules"]:I2,["type"]:"tree"},{["conditions"]:q9,["rules"]:I2,["type"]:"tree"},{["conditions"]:m9,["rules"]:I2,["type"]:"tree"},{["conditions"]:_9,["rules"]:I2,["type"]:"tree"},{["conditions"]:g9,["rules"]:I2,["type"]:"tree"},F1],["type"]:"tree"},{["conditions"]:I9,["rules"]:q2,["type"]:"tree"},{["conditions"]:q9,["rules"]:q2,["type"]:"tree"},{["conditions"]:m9,["rules"]:q2,["type"]:"tree"},{["conditions"]:_9,["rules"]:q2,["type"]:"tree"},{["conditions"]:g9,["rules"]:q2,["type"]:"tree"},F1],["type"]:"tree"}],["type"]:"tree"},F9],["type"]:"tree"},{["conditions"]:[hu,{["fn"]:"substring",["argv"]:f9,["assign"]:"accessPointSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"accessPointSuffix"},"--xa-s3"]}],["rules"]:[A9,w9,{["conditions"]:SD,["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:T9,["rules"]:[{["conditions"]:b9,["rules"]:I2,["type"]:"tree"},{["conditions"]:j9,["rules"]:I2,["type"]:"tree"},{["conditions"]:l9,["rules"]:I2,["type"]:"tree"},{["conditions"]:d9,["rules"]:I2,["type"]:"tree"},{["conditions"]:i9,["rules"]:I2,["type"]:"tree"},F1],["type"]:"tree"},{["conditions"]:b9,["rules"]:q2,["type"]:"tree"},{["conditions"]:j9,["rules"]:q2,["type"]:"tree"},{["conditions"]:l9,["rules"]:q2,["type"]:"tree"},{["conditions"]:d9,["rules"]:q2,["type"]:"tree"},{["conditions"]:i9,["rules"]:q2,["type"]:"tree"},F1],["type"]:"tree"}],["type"]:"tree"},F9],["type"]:"tree"},{["conditions"]:[$9,G9,N9],["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:M0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:RD,endpoint:{["url"]:"https://s3express-control-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:xu,endpoint:{["url"]:"https://s3express-control-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:Hu,endpoint:{["url"]:"https://s3express-control.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"},{["conditions"]:Su,endpoint:{["url"]:"https://s3express-control.{Region}.{partitionResult#dnsSuffix}",["properties"]:Y2,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[hu,{["fn"]:"substring",["argv"]:[O,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[O,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:f9,["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[O,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:xD,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],["rules"]:[{["conditions"]:r9,["rules"]:[{["conditions"]:SD,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[z9,"e"]}],["rules"]:[{["conditions"]:n9,["rules"]:[Z9,{["conditions"]:M0,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:G1,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:G1,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[z9,"o"]}],["rules"]:[{["conditions"]:n9,["rules"]:[Z9,{["conditions"]:M0,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:G1,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:G1,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},{error:'Unrecognized hardware type: "Expected hardware type o or e but got {hardwareType}"',["type"]:"error"}],["type"]:"tree"},{error:"Invalid Outposts Bucket alias - it must be a valid bucket name.",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:oK,["rules"]:[{["conditions"]:[j,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:aK}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[GD,w6],["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:p9,["rules"]:[{["conditions"]:[M2,B9],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[T,I,l,h,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[T,I,l,h,E,o],["rules"]:[{endpoint:J9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,I,l,h,E,e],endpoint:J9,["type"]:"endpoint"},{["conditions"]:[U,I,l,h,p],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,I,l,h,E,o],["rules"]:[{endpoint:v9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,I,l,h,E,e],endpoint:v9,["type"]:"endpoint"},{["conditions"]:[T,S,M2,h,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[T,S,M2,h,E,o],["rules"]:[{endpoint:Q9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,S,M2,h,E,e],endpoint:Q9,["type"]:"endpoint"},{["conditions"]:[T,S,l,h,p],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[T,S,l,h,E,o],["rules"]:[{endpoint:W9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,S,l,h,E,e],endpoint:W9,["type"]:"endpoint"},{["conditions"]:[U,S,l,j,$2,FD,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,S,l,j,$2,ND,p],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,S,l,j,$2,FD,E,o],["rules"]:[{["conditions"]:n2,endpoint:$D,["type"]:"endpoint"},{endpoint:$D,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,S,l,j,$2,ND,E,o],["rules"]:[{["conditions"]:n2,endpoint:OD,["type"]:"endpoint"},X9],["type"]:"tree"},{["conditions"]:[U,S,l,j,$2,FD,E,e],endpoint:$D,["type"]:"endpoint"},{["conditions"]:[U,S,l,j,$2,ND,E,e],endpoint:OD,["type"]:"endpoint"},{["conditions"]:[U,S,M2,h,p],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,S,M2,h,E,o],["rules"]:[{["conditions"]:n2,endpoint:zD,["type"]:"endpoint"},{endpoint:zD,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,S,M2,h,E,e],endpoint:zD,["type"]:"endpoint"},{["conditions"]:[U,S,l,h,p],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,S,l,h,E,o],["rules"]:[{["conditions"]:n2,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:K},["type"]:"endpoint"},{endpoint:Y9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,S,l,h,E,e],endpoint:Y9,["type"]:"endpoint"}],["type"]:"tree"},N1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[j,$2,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[B6,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[O,!0]},GD,S,U,l],["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:p9,["rules"]:[X9],["type"]:"tree"},N1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[GD,{["fn"]:"aws.parseArn",["argv"]:sK,["assign"]:"bucketArn"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J2,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[F6,""]}]}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ZD,"s3-object-lambda"]}],["rules"]:[{["conditions"]:UD,["rules"]:[{["conditions"]:a9,["rules"]:[K9,h9,{["conditions"]:MD,["rules"]:[x9,{["conditions"]:t9,["rules"]:[JD,{["conditions"]:LD,["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:o9,["rules"]:[{["conditions"]:cD,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[N6,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:ED,["rules"]:[{["conditions"]:e9,["rules"]:[{["conditions"]:M0,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:vD,["headers"]:K},["type"]:"endpoint"},{["conditions"]:$1,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:vD,["headers"]:K},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:vD,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},H9],["type"]:"tree"},QD],["type"]:"tree"},WD],["type"]:"tree"},XD],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},S9],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},R9],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:UD,["rules"]:[{["conditions"]:a9,["rules"]:[{["conditions"]:MD,["rules"]:[{["conditions"]:UD,["rules"]:[{["conditions"]:MD,["rules"]:[x9,{["conditions"]:t9,["rules"]:[JD,{["conditions"]:LD,["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[G6,"{partitionResult#name}"]}],["rules"]:[{["conditions"]:cD,["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ZD,"s3"]}],["rules"]:[{["conditions"]:ED,["rules"]:[{["conditions"]:e9,["rules"]:[{["conditions"]:HD,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:RD,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ku,["headers"]:K},["type"]:"endpoint"},{["conditions"]:xu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ku,["headers"]:K},["type"]:"endpoint"},{["conditions"]:Hu,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ku,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[S,U,j,$2],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ku,["headers"]:K},["type"]:"endpoint"},{["conditions"]:Su,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ku,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},H9],["type"]:"tree"},QD],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},WD],["type"]:"tree"},XD],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},S9],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[CD,!0]}],["rules"]:[{["conditions"]:s9,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:$1,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:HD,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:xD,["assign"]:"mrapPartition"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[J2,"partition"]}]}],["rules"]:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:eK}]},["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},R9],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ZD,"s3-outposts"]}],["rules"]:[{["conditions"]:s9,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:$1,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:HD,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[J2,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:uh,["assign"]:"outpostId"}],["rules"]:[{["conditions"]:r9,["rules"]:[JD,{["conditions"]:LD,["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:o9,["rules"]:[{["conditions"]:cD,["rules"]:[{["conditions"]:ED,["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Dh,["assign"]:"outpostType"}],["rules"]:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[J2,"resourceId[3]"],["assign"]:"accessPointName"}],["rules"]:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],["rules"]:[{["conditions"]:M0,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:U9,["headers"]:K},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:U9,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},QD],["type"]:"tree"},WD],["type"]:"tree"},XD],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[O,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[M9]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[pK,!0]},M9],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:tK,["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:[l],["rules"]:[{["conditions"]:[T,h,I,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[T,h,I,E,o],["rules"]:[{endpoint:L9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,h,I,E,e],endpoint:L9,["type"]:"endpoint"},{["conditions"]:[U,h,I,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,h,I,E,o],["rules"]:[{endpoint:c9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,h,I,E,e],endpoint:c9,["type"]:"endpoint"},{["conditions"]:[T,h,S,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[T,h,S,E,o],["rules"]:[{endpoint:E9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[T,h,S,E,e],endpoint:E9,["type"]:"endpoint"},{["conditions"]:[U,j,$2,S,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,j,$2,S,E,o],["rules"]:[{["conditions"]:n2,endpoint:YD,["type"]:"endpoint"},{endpoint:YD,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,j,$2,S,E,e],endpoint:YD,["type"]:"endpoint"},{["conditions"]:[U,h,S,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[U,h,S,E,o],["rules"]:[{["conditions"]:n2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:d,["headers"]:K},["type"]:"endpoint"},{endpoint:O9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[U,h,S,E,e],endpoint:O9,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[C9]},{["fn"]:"booleanEquals",["argv"]:[C9,!0]}],["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:u6,["rules"]:[K9,h9,{["conditions"]:M0,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:KD,["headers"]:K},["type"]:"endpoint"},{["conditions"]:$1,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:KD,["headers"]:K},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:KD,["headers"]:K},["type"]:"endpoint"}],["type"]:"tree"},N1],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[$9],["rules"]:[{["conditions"]:U2,["rules"]:[{["conditions"]:u6,["rules"]:[{["conditions"]:[I,T,h,p],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[I,T,h,E,o],["rules"]:[{endpoint:P9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,h,E,e],endpoint:P9,["type"]:"endpoint"},{["conditions"]:[I,U,h,p],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[I,U,h,E,o],["rules"]:[{endpoint:k9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,U,h,E,e],endpoint:k9,["type"]:"endpoint"},{["conditions"]:[S,T,h,p],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[S,T,h,E,o],["rules"]:[{endpoint:V9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,T,h,E,e],endpoint:V9,["type"]:"endpoint"},{["conditions"]:[S,U,j,$2,p],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[S,U,j,$2,E,o],["rules"]:[{["conditions"]:n2,endpoint:hD,["type"]:"endpoint"},{endpoint:hD,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,U,j,$2,E,e],endpoint:hD,["type"]:"endpoint"},{["conditions"]:[S,U,h,p],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:t,["headers"]:K},["type"]:"endpoint"},{["conditions"]:[S,U,h,E,o],["rules"]:[{["conditions"]:n2,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:d,["headers"]:K},["type"]:"endpoint"},{endpoint:y9,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,U,h,E,e],endpoint:y9,["type"]:"endpoint"}],["type"]:"tree"},N1],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},$6=Bh;var Fh=new L0.EndpointCache({size:50,params:["Accelerate","Bucket","DisableAccessPoints","DisableMultiRegionAccessPoints","DisableS3ExpressSessionAuth","Endpoint","ForcePathStyle","Region","UseArnRegion","UseDualStack","UseFIPS","UseGlobalEndpoint","UseObjectLambdaEndpoint","UseS3ExpressControlEndpoint"]}),z1=(u,D={})=>{return Fh.get(u,()=>L0.resolveEndpoint($6,{endpointParams:u,logger:D.logger}))};L0.customEndpointFunctions.aws=z6.awsEndpointFunctions;var Gh=(u)=>async(D,B,A)=>{if(!A)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let w=await u(D,B,A),F=c0.getSmithyContext(B)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!F)throw Error(`getEndpointParameterInstructions() is not defined on '${B.commandName}'`);let G=await Z6.resolveParams(A,{getEndpointParameterInstructions:F},D);return Object.assign(w,G)},Nh=async(u,D,B)=>{return{operation:c0.getSmithyContext(D).operation,region:await c0.normalizeProvider(u.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},J6=Gh(Nh);function v6(u){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}function Q6(u){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:u.region},propertiesExtractor:(D,B)=>({signingProperties:{config:D,context:B}})}}var $h=(u,D,B)=>{return(w)=>{let G=u(w).properties?.authSchemes;if(!G)return D(w);let N=[];for(let $ of G){let{name:Z,properties:Q={},...J}=$,v=Z.toLowerCase();if(Z!==v)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${Z}' to '${v}'`);let W;if(v==="sigv4a"){W="aws.auth#sigv4a";let x=G.find((c)=>{let H=c.name.toLowerCase();return H!=="sigv4a"&&H.startsWith("sigv4")});if(Xu.sigv4aDependency()==="none"&&x)continue}else if(v.startsWith("sigv4"))W="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${v}'`);let Y=B[W];if(!Y)throw Error(`Could not find HttpAuthOption create function for '${W}'`);let L=Y(w);L.schemeId=W,L.signingProperties={...L.signingProperties||{},...J,...Q},N.push(L)}return N}},zh=(u)=>{let D=[];switch(u.operation){default:D.push(v6(u)),D.push(Q6(u))}return D},W6=$h(z1,zh,{"aws.auth#sigv4":v6,"aws.auth#sigv4a":Q6}),X6=(u)=>{let D=Z1.resolveAwsSdkSigV4Config(u),B=Z1.resolveAwsSdkSigV4AConfig(D);return Object.assign(B,{authSchemePreference:c0.normalizeProvider(u.authSchemePreference??[])})};var O6=X(J0(),1),C6=X(R2(),1);var Y6=(u)=>{return Object.assign(u,{useFipsEndpoint:u.useFipsEndpoint??!1,useDualstackEndpoint:u.useDualstackEndpoint??!1,forcePathStyle:u.forcePathStyle??!1,useAccelerateEndpoint:u.useAccelerateEndpoint??!1,useGlobalEndpoint:u.useGlobalEndpoint??!1,disableMultiregionAccessPoints:u.disableMultiregionAccessPoints??!1,defaultSigningName:"s3",clientContextParams:u.clientContextParams??{}})},m2={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var PD=X(x6(),1);var K6=X(R2(),1);class i extends K6.ServiceException{constructor(u){super(u);Object.setPrototypeOf(this,i.prototype)}}class J1 extends i{name="NoSuchUpload";$fault="client";constructor(u){super({name:"NoSuchUpload",$fault:"client",...u});Object.setPrototypeOf(this,J1.prototype)}}class v1 extends i{name="AccessDenied";$fault="client";constructor(u){super({name:"AccessDenied",$fault:"client",...u});Object.setPrototypeOf(this,v1.prototype)}}class Q1 extends i{name="ObjectNotInActiveTierError";$fault="client";constructor(u){super({name:"ObjectNotInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,Q1.prototype)}}class W1 extends i{name="BucketAlreadyExists";$fault="client";constructor(u){super({name:"BucketAlreadyExists",$fault:"client",...u});Object.setPrototypeOf(this,W1.prototype)}}class X1 extends i{name="BucketAlreadyOwnedByYou";$fault="client";constructor(u){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...u});Object.setPrototypeOf(this,X1.prototype)}}class Y1 extends i{name="NoSuchBucket";$fault="client";constructor(u){super({name:"NoSuchBucket",$fault:"client",...u});Object.setPrototypeOf(this,Y1.prototype)}}class K1 extends i{name="InvalidObjectState";$fault="client";StorageClass;AccessTier;constructor(u){super({name:"InvalidObjectState",$fault:"client",...u});Object.setPrototypeOf(this,K1.prototype),this.StorageClass=u.StorageClass,this.AccessTier=u.AccessTier}}class h1 extends i{name="NoSuchKey";$fault="client";constructor(u){super({name:"NoSuchKey",$fault:"client",...u});Object.setPrototypeOf(this,h1.prototype)}}class x1 extends i{name="NotFound";$fault="client";constructor(u){super({name:"NotFound",$fault:"client",...u});Object.setPrototypeOf(this,x1.prototype)}}class H1 extends i{name="EncryptionTypeMismatch";$fault="client";constructor(u){super({name:"EncryptionTypeMismatch",$fault:"client",...u});Object.setPrototypeOf(this,H1.prototype)}}class S1 extends i{name="InvalidRequest";$fault="client";constructor(u){super({name:"InvalidRequest",$fault:"client",...u});Object.setPrototypeOf(this,S1.prototype)}}class R1 extends i{name="InvalidWriteOffset";$fault="client";constructor(u){super({name:"InvalidWriteOffset",$fault:"client",...u});Object.setPrototypeOf(this,R1.prototype)}}class U1 extends i{name="TooManyParts";$fault="client";constructor(u){super({name:"TooManyParts",$fault:"client",...u});Object.setPrototypeOf(this,U1.prototype)}}class M1 extends i{name="IdempotencyParameterMismatch";$fault="client";constructor(u){super({name:"IdempotencyParameterMismatch",$fault:"client",...u});Object.setPrototypeOf(this,M1.prototype)}}class L1 extends i{name="ObjectAlreadyInActiveTierError";$fault="client";constructor(u){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...u});Object.setPrototypeOf(this,L1.prototype)}}var H6=PD.TypeRegistry.for("smithy.ts.sdk.synthetic.com.amazonaws.s3"),Zh=[-3,"smithy.ts.sdk.synthetic.com.amazonaws.s3","S3ServiceException",0,[],[]];H6.registerError(Zh,i);var N2=PD.TypeRegistry.for("com.amazonaws.s3"),Jh=[-3,"com.amazonaws.s3","AccessDenied",{["error"]:"client",["httpError"]:403},[],[]];N2.registerError(Jh,v1);var vh=[-3,"com.amazonaws.s3","BucketAlreadyExists",{["error"]:"client",["httpError"]:409},[],[]];N2.registerError(vh,W1);var Qh=[-3,"com.amazonaws.s3","BucketAlreadyOwnedByYou",{["error"]:"client",["httpError"]:409},[],[]];N2.registerError(Qh,X1);var Wh=[-3,"com.amazonaws.s3","EncryptionTypeMismatch",{["error"]:"client",["httpError"]:400},[],[]];N2.registerError(Wh,H1);var Xh=[-3,"com.amazonaws.s3","IdempotencyParameterMismatch",{["error"]:"client",["httpError"]:400},[],[]];N2.registerError(Xh,M1);var Yh=[-3,"com.amazonaws.s3","InvalidObjectState",{["error"]:"client",["httpError"]:403},["StorageClass","AccessTier"],[0,0]];N2.registerError(Yh,K1);var Kh=[-3,"com.amazonaws.s3","InvalidRequest",{["error"]:"client",["httpError"]:400},[],[]];N2.registerError(Kh,S1);var hh=[-3,"com.amazonaws.s3","InvalidWriteOffset",{["error"]:"client",["httpError"]:400},[],[]];N2.registerError(hh,R1);var xh=[-3,"com.amazonaws.s3","NoSuchBucket",{["error"]:"client",["httpError"]:404},[],[]];N2.registerError(xh,Y1);var Hh=[-3,"com.amazonaws.s3","NoSuchKey",{["error"]:"client",["httpError"]:404},[],[]];N2.registerError(Hh,h1);var Sh=[-3,"com.amazonaws.s3","NoSuchUpload",{["error"]:"client",["httpError"]:404},[],[]];N2.registerError(Sh,J1);var Rh=[-3,"com.amazonaws.s3","NotFound",{["error"]:"client"},[],[]];N2.registerError(Rh,x1);var Uh=[-3,"com.amazonaws.s3","ObjectAlreadyInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];N2.registerError(Uh,L1);var Mh=[-3,"com.amazonaws.s3","ObjectNotInActiveTierError",{["error"]:"client",["httpError"]:403},[],[]];N2.registerError(Mh,Q1);var Lh=[-3,"com.amazonaws.s3","TooManyParts",{["error"]:"client",["httpError"]:400},[],[]];N2.registerError(Lh,U1);var S6=[H6,N2];var h6=[0,"com.amazonaws.s3","SessionCredentialValue",8,0],kD=[0,"com.amazonaws.s3","SSECustomerKey",8,0],c1=[0,"com.amazonaws.s3","SSEKMSEncryptionContext",8,0],E0=[0,"com.amazonaws.s3","SSEKMSKeyId",8,0],R6=[0,"com.amazonaws.s3","StreamingBlob",{["streaming"]:1},42];var ch=[3,"com.amazonaws.s3","CommonPrefix",0,["Prefix"],[0]];var Eh=[3,"com.amazonaws.s3","CreateSessionOutput",{["xmlName"]:"CreateSessionResult"},["Credentials","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[()=>fh,{["xmlName"]:"Credentials"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>E0,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>c1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1],Oh=[3,"com.amazonaws.s3","CreateSessionRequest",0,["Bucket","SessionMode","ServerSideEncryption","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled"],[[0,1],[0,{["httpHeader"]:"x-amz-create-session-mode"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[()=>E0,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>c1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}]],1];var Ch=[3,"com.amazonaws.s3","GetObjectOutput",0,["Body","DeleteMarker","AcceptRanges","Expiration","Restore","LastModified","ContentLength","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","MissingMeta","VersionId","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentRange","ContentType","Expires","ExpiresString","WebsiteRedirectLocation","ServerSideEncryption","Metadata","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","BucketKeyEnabled","StorageClass","RequestCharged","ReplicationStatus","PartsCount","TagCount","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus"],[[()=>R6,16],[2,{["httpHeader"]:"x-amz-delete-marker"}],[0,{["httpHeader"]:"accept-ranges"}],[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"x-amz-restore"}],[4,{["httpHeader"]:"Last-Modified"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[1,{["httpHeader"]:"x-amz-missing-meta"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[0,{["httpHeader"]:"Content-Range"}],[0,{["httpHeader"]:"Content-Type"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"ExpiresString"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>E0,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-request-charged"}],[0,{["httpHeader"]:"x-amz-replication-status"}],[1,{["httpHeader"]:"x-amz-mp-parts-count"}],[1,{["httpHeader"]:"x-amz-tagging-count"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}]]],Ph=[3,"com.amazonaws.s3","GetObjectRequest",0,["Bucket","Key","IfMatch","IfModifiedSince","IfNoneMatch","IfUnmodifiedSince","Range","ResponseCacheControl","ResponseContentDisposition","ResponseContentEncoding","ResponseContentLanguage","ResponseContentType","ResponseExpires","VersionId","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","RequestPayer","PartNumber","ExpectedBucketOwner","ChecksumMode"],[[0,1],[0,1],[0,{["httpHeader"]:"If-Match"}],[4,{["httpHeader"]:"If-Modified-Since"}],[0,{["httpHeader"]:"If-None-Match"}],[4,{["httpHeader"]:"If-Unmodified-Since"}],[0,{["httpHeader"]:"Range"}],[0,{["httpQuery"]:"response-cache-control"}],[0,{["httpQuery"]:"response-content-disposition"}],[0,{["httpQuery"]:"response-content-encoding"}],[0,{["httpQuery"]:"response-content-language"}],[0,{["httpQuery"]:"response-content-type"}],[6,{["httpQuery"]:"response-expires"}],[0,{["httpQuery"]:"versionId"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>kD,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[1,{["httpQuery"]:"partNumber"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[0,{["httpHeader"]:"x-amz-checksum-mode"}]],2];var kh=[3,"com.amazonaws.s3","HeadObjectOutput",0,["DeleteMarker","AcceptRanges","Expiration","Restore","ArchiveStatus","LastModified","ContentLength","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","ETag","MissingMeta","VersionId","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentType","ContentRange","Expires","ExpiresString","WebsiteRedirectLocation","ServerSideEncryption","Metadata","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","BucketKeyEnabled","StorageClass","RequestCharged","ReplicationStatus","PartsCount","TagCount","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus"],[[2,{["httpHeader"]:"x-amz-delete-marker"}],[0,{["httpHeader"]:"accept-ranges"}],[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"x-amz-restore"}],[0,{["httpHeader"]:"x-amz-archive-status"}],[4,{["httpHeader"]:"Last-Modified"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[0,{["httpHeader"]:"ETag"}],[1,{["httpHeader"]:"x-amz-missing-meta"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[0,{["httpHeader"]:"Content-Type"}],[0,{["httpHeader"]:"Content-Range"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"ExpiresString"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>E0,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-request-charged"}],[0,{["httpHeader"]:"x-amz-replication-status"}],[1,{["httpHeader"]:"x-amz-mp-parts-count"}],[1,{["httpHeader"]:"x-amz-tagging-count"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}]]],Vh=[3,"com.amazonaws.s3","HeadObjectRequest",0,["Bucket","Key","IfMatch","IfModifiedSince","IfNoneMatch","IfUnmodifiedSince","Range","ResponseCacheControl","ResponseContentDisposition","ResponseContentEncoding","ResponseContentLanguage","ResponseContentType","ResponseExpires","VersionId","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","RequestPayer","PartNumber","ExpectedBucketOwner","ChecksumMode"],[[0,1],[0,1],[0,{["httpHeader"]:"If-Match"}],[4,{["httpHeader"]:"If-Modified-Since"}],[0,{["httpHeader"]:"If-None-Match"}],[4,{["httpHeader"]:"If-Unmodified-Since"}],[0,{["httpHeader"]:"Range"}],[0,{["httpQuery"]:"response-cache-control"}],[0,{["httpQuery"]:"response-content-disposition"}],[0,{["httpQuery"]:"response-content-encoding"}],[0,{["httpQuery"]:"response-content-language"}],[0,{["httpQuery"]:"response-content-type"}],[6,{["httpQuery"]:"response-expires"}],[0,{["httpQuery"]:"versionId"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>kD,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[1,{["httpQuery"]:"partNumber"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[0,{["httpHeader"]:"x-amz-checksum-mode"}]],2];var yh=[3,"com.amazonaws.s3","ListObjectsV2Output",{["xmlName"]:"ListBucketResult"},["IsTruncated","Contents","Name","Prefix","Delimiter","MaxKeys","CommonPrefixes","EncodingType","KeyCount","ContinuationToken","NextContinuationToken","StartAfter","RequestCharged"],[2,[()=>jh,{["xmlFlattened"]:1}],0,0,0,1,[()=>bh,{["xmlFlattened"]:1}],0,1,0,0,0,[0,{["httpHeader"]:"x-amz-request-charged"}]]],Th=[3,"com.amazonaws.s3","ListObjectsV2Request",0,["Bucket","Delimiter","EncodingType","MaxKeys","Prefix","ContinuationToken","FetchOwner","StartAfter","RequestPayer","ExpectedBucketOwner","OptionalObjectAttributes"],[[0,1],[0,{["httpQuery"]:"delimiter"}],[0,{["httpQuery"]:"encoding-type"}],[1,{["httpQuery"]:"max-keys"}],[0,{["httpQuery"]:"prefix"}],[0,{["httpQuery"]:"continuation-token"}],[2,{["httpQuery"]:"fetch-owner"}],[0,{["httpQuery"]:"start-after"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}],[64,{["httpHeader"]:"x-amz-optional-object-attributes"}]],1];var Ih=[3,"com.amazonaws.s3","Object",0,["Key","LastModified","ETag","ChecksumAlgorithm","ChecksumType","Size","StorageClass","Owner","RestoreStatus"],[0,4,0,[64,{["xmlFlattened"]:1}],0,1,0,()=>qh,()=>gh]];var qh=[3,"com.amazonaws.s3","Owner",0,["DisplayName","ID"],[0,0]];var mh=[3,"com.amazonaws.s3","PutObjectOutput",0,["Expiration","ETag","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","ChecksumType","ServerSideEncryption","VersionId","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","Size","RequestCharged"],[[0,{["httpHeader"]:"x-amz-expiration"}],[0,{["httpHeader"]:"ETag"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[0,{["httpHeader"]:"x-amz-checksum-type"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-version-id"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>E0,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>c1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[1,{["httpHeader"]:"x-amz-object-size"}],[0,{["httpHeader"]:"x-amz-request-charged"}]]],_h=[3,"com.amazonaws.s3","PutObjectRequest",0,["Bucket","Key","ACL","Body","CacheControl","ContentDisposition","ContentEncoding","ContentLanguage","ContentLength","ContentMD5","ContentType","ChecksumAlgorithm","ChecksumCRC32","ChecksumCRC32C","ChecksumCRC64NVME","ChecksumSHA1","ChecksumSHA256","Expires","IfMatch","IfNoneMatch","GrantFullControl","GrantRead","GrantReadACP","GrantWriteACP","WriteOffsetBytes","Metadata","ServerSideEncryption","StorageClass","WebsiteRedirectLocation","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId","SSEKMSEncryptionContext","BucketKeyEnabled","RequestPayer","Tagging","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus","ExpectedBucketOwner"],[[0,1],[0,1],[0,{["httpHeader"]:"x-amz-acl"}],[()=>R6,16],[0,{["httpHeader"]:"Cache-Control"}],[0,{["httpHeader"]:"Content-Disposition"}],[0,{["httpHeader"]:"Content-Encoding"}],[0,{["httpHeader"]:"Content-Language"}],[1,{["httpHeader"]:"Content-Length"}],[0,{["httpHeader"]:"Content-MD5"}],[0,{["httpHeader"]:"Content-Type"}],[0,{["httpHeader"]:"x-amz-sdk-checksum-algorithm"}],[0,{["httpHeader"]:"x-amz-checksum-crc32"}],[0,{["httpHeader"]:"x-amz-checksum-crc32c"}],[0,{["httpHeader"]:"x-amz-checksum-crc64nvme"}],[0,{["httpHeader"]:"x-amz-checksum-sha1"}],[0,{["httpHeader"]:"x-amz-checksum-sha256"}],[4,{["httpHeader"]:"Expires"}],[0,{["httpHeader"]:"If-Match"}],[0,{["httpHeader"]:"If-None-Match"}],[0,{["httpHeader"]:"x-amz-grant-full-control"}],[0,{["httpHeader"]:"x-amz-grant-read"}],[0,{["httpHeader"]:"x-amz-grant-read-acp"}],[0,{["httpHeader"]:"x-amz-grant-write-acp"}],[1,{["httpHeader"]:"x-amz-write-offset-bytes"}],[128,{["httpPrefixHeaders"]:"x-amz-meta-"}],[0,{["httpHeader"]:"x-amz-server-side-encryption"}],[0,{["httpHeader"]:"x-amz-storage-class"}],[0,{["httpHeader"]:"x-amz-website-redirect-location"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-algorithm"}],[()=>kD,{["httpHeader"]:"x-amz-server-side-encryption-customer-key"}],[0,{["httpHeader"]:"x-amz-server-side-encryption-customer-key-MD5"}],[()=>E0,{["httpHeader"]:"x-amz-server-side-encryption-aws-kms-key-id"}],[()=>c1,{["httpHeader"]:"x-amz-server-side-encryption-context"}],[2,{["httpHeader"]:"x-amz-server-side-encryption-bucket-key-enabled"}],[0,{["httpHeader"]:"x-amz-request-payer"}],[0,{["httpHeader"]:"x-amz-tagging"}],[0,{["httpHeader"]:"x-amz-object-lock-mode"}],[5,{["httpHeader"]:"x-amz-object-lock-retain-until-date"}],[0,{["httpHeader"]:"x-amz-object-lock-legal-hold"}],[0,{["httpHeader"]:"x-amz-expected-bucket-owner"}]],2];var gh=[3,"com.amazonaws.s3","RestoreStatus",0,["IsRestoreInProgress","RestoreExpiryDate"],[2,4]];var fh=[3,"com.amazonaws.s3","SessionCredentials",0,["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],[[0,{["xmlName"]:"AccessKeyId"}],[()=>h6,{["xmlName"]:"SecretAccessKey"}],[()=>h6,{["xmlName"]:"SessionToken"}],[4,{["xmlName"]:"Expiration"}]],4];var bh=[1,"com.amazonaws.s3","CommonPrefixList",0,()=>ch];var jh=[1,"com.amazonaws.s3","ObjectList",0,[()=>Ih,0]];var U6=[9,"com.amazonaws.s3","CreateSession",{["http"]:["GET","/?session",200]},()=>Oh,()=>Eh];var M6=[9,"com.amazonaws.s3","GetObject",{["httpChecksum"]:"-",["http"]:["GET","/{Key+}?x-id=GetObject",200]},()=>Ph,()=>Ch];var L6=[9,"com.amazonaws.s3","HeadObject",{["http"]:["HEAD","/{Key+}",200]},()=>Vh,()=>kh];var c6=[9,"com.amazonaws.s3","ListObjectsV2",{["http"]:["GET","/?list-type=2",200]},()=>Th,()=>yh];var E6=[9,"com.amazonaws.s3","PutObject",{["httpChecksum"]:"-",["http"]:["PUT","/{Key+}?x-id=PutObject",200]},()=>_h,()=>mh];class VD extends C6.Command.classBuilder().ep({...m2,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(u,D,B,A){return[O6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),r2(B)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").sc(U6).build(){}var P6={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.1015.0",scripts:{build:"concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":'yarn g:turbo run build -F="$npm_package_name"',"build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn g:vitest run","test:browser":"node ./test/browser-build/esbuild && yarn g:vitest run -c vitest.config.browser.mts","test:browser:watch":"node ./test/browser-build/esbuild && yarn g:vitest watch -c vitest.config.browser.mts","test:e2e":"yarn g:vitest run -c vitest.config.e2e.mts && yarn test:browser","test:e2e:watch":"yarn g:vitest watch -c vitest.config.e2e.mts","test:index":"tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs","test:integration":"yarn g:vitest run -c vitest.config.integ.mts","test:integration:watch":"yarn g:vitest watch -c vitest.config.integ.mts","test:watch":"yarn g:vitest watch"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"^3.973.24","@aws-sdk/credential-provider-node":"^3.972.25","@aws-sdk/middleware-bucket-endpoint":"^3.972.8","@aws-sdk/middleware-expect-continue":"^3.972.8","@aws-sdk/middleware-flexible-checksums":"^3.974.4","@aws-sdk/middleware-host-header":"^3.972.8","@aws-sdk/middleware-location-constraint":"^3.972.8","@aws-sdk/middleware-logger":"^3.972.8","@aws-sdk/middleware-recursion-detection":"^3.972.8","@aws-sdk/middleware-sdk-s3":"^3.972.24","@aws-sdk/middleware-ssec":"^3.972.8","@aws-sdk/middleware-user-agent":"^3.972.25","@aws-sdk/region-config-resolver":"^3.972.9","@aws-sdk/signature-v4-multi-region":"^3.996.12","@aws-sdk/types":"^3.973.6","@aws-sdk/util-endpoints":"^3.996.5","@aws-sdk/util-user-agent-browser":"^3.972.8","@aws-sdk/util-user-agent-node":"^3.973.11","@smithy/config-resolver":"^4.4.13","@smithy/core":"^3.23.12","@smithy/eventstream-serde-browser":"^4.2.12","@smithy/eventstream-serde-config-resolver":"^4.3.12","@smithy/eventstream-serde-node":"^4.2.12","@smithy/fetch-http-handler":"^5.3.15","@smithy/hash-blob-browser":"^4.2.13","@smithy/hash-node":"^4.2.12","@smithy/hash-stream-node":"^4.2.12","@smithy/invalid-dependency":"^4.2.12","@smithy/md5-js":"^4.2.12","@smithy/middleware-content-length":"^4.2.12","@smithy/middleware-endpoint":"^4.4.27","@smithy/middleware-retry":"^4.4.44","@smithy/middleware-serde":"^4.2.15","@smithy/middleware-stack":"^4.2.12","@smithy/node-config-provider":"^4.3.12","@smithy/node-http-handler":"^4.5.0","@smithy/protocol-http":"^5.3.12","@smithy/smithy-client":"^4.12.7","@smithy/types":"^4.13.1","@smithy/url-parser":"^4.2.12","@smithy/util-base64":"^4.3.2","@smithy/util-body-length-browser":"^4.2.2","@smithy/util-body-length-node":"^4.2.3","@smithy/util-defaults-mode-browser":"^4.3.43","@smithy/util-defaults-mode-node":"^4.2.47","@smithy/util-endpoints":"^3.3.3","@smithy/util-middleware":"^4.2.12","@smithy/util-retry":"^4.2.12","@smithy/util-stream":"^4.5.20","@smithy/util-utf8":"^4.2.2","@smithy/util-waiter":"^4.2.13",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.1015.0","@smithy/snapshot-testing":"^2.0.3","@tsconfig/node20":"20.1.8","@types/node":"^20.14.8",concurrently:"7.0.0","downlevel-dts":"0.10.1",premove:"4.0.0",typescript:"~5.8.3",vitest:"^4.0.17"},engines:{node:">=20.0.0"},typesVersions:{"<4.5":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var P0=X(H0(),1);var O1=X(V6(),1),g6=X(ih(),1);var E1=X(V6(),1),k6="AWS_EC2_METADATA_DISABLED",y6=async(u)=>{let{ENV_CMDS_FULL_URI:D,ENV_CMDS_RELATIVE_URI:B,fromContainerMetadata:A,fromInstanceMetadata:w}=await import("./chunk-fvtfwssb.js");if(process.env[B]||process.env[D]){u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:F}=await import("./chunk-jvcbdxtq.js");return E1.chain(F(u),A(u))}if(process.env[k6]&&process.env[k6]!=="false")return async()=>{throw new E1.CredentialsProviderError("EC2 Instance Metadata Service access disabled",{logger:u.logger})};return u.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),w(u)};function T6(u,D){let B=dh(u),A,w,F,G=async(N)=>{if(N?.forceRefresh)return await B(N);if(F?.expiration){if(F?.expiration?.getTime()<Date.now())F=void 0}if(A)await A;else if(!F||D?.(F))if(F){if(!w)w=B(N).then(($)=>{F=$}).finally(()=>{w=void 0})}else return A=B(N).then(($)=>{F=$}).finally(()=>{A=void 0}),G(N);return F};return G}var dh=(u)=>async(D)=>{let B;for(let A of u)try{return await A(D)}catch(w){if(B=w,w?.tryNextLink)continue;throw w}throw B};var I6=!1,f6=(u={})=>T6([async()=>{if(u.profile??process.env[g6.ENV_PROFILE]){if(process.env[q6]&&process.env[m6]){if(!I6)(u.logger?.warn&&u.logger?.constructor?.name!=="NoOpLogger"?u.logger.warn.bind(u.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
5
5
|
Multiple credential sources detected:
|
|
6
6
|
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
7
7
|
This SDK will proceed with the AWS_PROFILE value.
|
|
@@ -9,13 +9,13 @@ Headers: ${JSON.stringify(B)}`);this.code=u,this.body=D,this.headers={},B.forEac
|
|
|
9
9
|
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
10
10
|
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
11
11
|
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
12
|
-
`),EB=!0}throw new H1.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:u.logger,tryNextLink:!0})}return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),PB(u)()},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:B,ssoAccountId:A,ssoRegion:w,ssoRoleName:F,ssoSession:N}=u;if(!B&&!A&&!w&&!F&&!N)throw new H1.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:u.logger});let{fromSSO:G}=await import("./chunk-8mgsjrcc.js");return G(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:B}=await import("./chunk-81yxskss.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:B}=await import("./chunk-0pjn1a5d.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:B}=await import("./chunk-x3vy6dbw.js");return B(u)(D)},async()=>{return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await MB(u))()},async()=>{throw new H1.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:u.logger})}],yK);var yK=(u)=>u?.expiration!==void 0&&u.expiration.getTime()-Date.now()<300000;var M0=X(U4(),1),VK="AWS_S3_USE_ARN_REGION",TK="s3_use_arn_region",VB={environmentVariableSelector:(u)=>M0.booleanSelector(u,VK,M0.SelectorType.ENV),configFileSelector:(u)=>M0.booleanSelector(u,TK,M0.SelectorType.CONFIG),default:void 0};var O1=X(eK(),1),i2=X(tB(),1);var d2=X(IB(),1);var qB=X(IB(),1);class L0{bytes;constructor(u){if(this.bytes=u,u.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(u){if(u>9223372036854776000||u<-9223372036854776000)throw Error(`${u} is too large (or, if negative, too small) to represent as an Int64`);let D=new Uint8Array(8);for(let B=7,A=Math.abs(Math.round(u));B>-1&&A>0;B--,A/=256)D[B]=A;if(u<0)TB(D);return new L0(D)}valueOf(){let u=this.bytes.slice(0),D=u[0]&128;if(D)TB(u);return parseInt(qB.toHex(u),16)*(D?-1:1)}toString(){return String(this.valueOf())}}function TB(u){for(let D=0;D<8;D++)u[D]^=255;for(let D=7;D>-1;D--)if(u[D]++,u[D]!==0)break}class L3{toUtf8;fromUtf8;constructor(u,D){this.toUtf8=u,this.fromUtf8=D}format(u){let D=[];for(let w of Object.keys(u)){let F=this.fromUtf8(w);D.push(Uint8Array.from([F.byteLength]),F,this.formatHeaderValue(u[w]))}let B=new Uint8Array(D.reduce((w,F)=>w+F.byteLength,0)),A=0;for(let w of D)B.set(w,A),A+=w.byteLength;return B}formatHeaderValue(u){switch(u.type){case"boolean":return Uint8Array.from([u.value?0:1]);case"byte":return Uint8Array.from([2,u.value]);case"short":let D=new DataView(new ArrayBuffer(3));return D.setUint8(0,3),D.setInt16(1,u.value,!1),new Uint8Array(D.buffer);case"integer":let B=new DataView(new ArrayBuffer(5));return B.setUint8(0,4),B.setInt32(1,u.value,!1),new Uint8Array(B.buffer);case"long":let A=new Uint8Array(9);return A[0]=5,A.set(u.value.bytes,1),A;case"binary":let w=new DataView(new ArrayBuffer(3+u.value.byteLength));w.setUint8(0,6),w.setUint16(1,u.value.byteLength,!1);let F=new Uint8Array(w.buffer);return F.set(u.value,3),F;case"string":let N=this.fromUtf8(u.value),G=new DataView(new ArrayBuffer(3+N.byteLength));G.setUint8(0,7),G.setUint16(1,N.byteLength,!1);let v=new Uint8Array(G.buffer);return v.set(N,3),v;case"timestamp":let z=new Uint8Array(9);return z[0]=8,z.set(L0.fromNumber(u.value.valueOf()).bytes,1),z;case"uuid":if(!lK.test(u.value))throw Error(`Invalid UUID received: ${u.value}`);let Q=new Uint8Array(17);return Q[0]=9,Q.set(d2.fromHex(u.value.replace(/\-/g,"")),1),Q}}parse(u){let D={},B=0;while(B<u.byteLength){let A=u.getUint8(B++),w=this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,A));switch(B+=A,u.getUint8(B++)){case 0:D[w]={type:gB,value:!0};break;case 1:D[w]={type:gB,value:!1};break;case 2:D[w]={type:IK,value:u.getInt8(B++)};break;case 3:D[w]={type:qK,value:u.getInt16(B,!1)},B+=2;break;case 4:D[w]={type:mK,value:u.getInt32(B,!1)},B+=4;break;case 5:D[w]={type:gK,value:new L0(new Uint8Array(u.buffer,u.byteOffset+B,8))},B+=8;break;case 6:let F=u.getUint16(B,!1);B+=2,D[w]={type:_K,value:new Uint8Array(u.buffer,u.byteOffset+B,F)},B+=F;break;case 7:let N=u.getUint16(B,!1);B+=2,D[w]={type:fK,value:this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,N))},B+=N;break;case 8:D[w]={type:bK,value:new Date(new L0(new Uint8Array(u.buffer,u.byteOffset+B,8)).valueOf())},B+=8;break;case 9:let G=new Uint8Array(u.buffer,u.byteOffset+B,16);B+=16,D[w]={type:jK,value:`${d2.toHex(G.subarray(0,4))}-${d2.toHex(G.subarray(4,6))}-${d2.toHex(G.subarray(6,8))}-${d2.toHex(G.subarray(8,10))}-${d2.toHex(G.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return D}}var mB;(function(u){u[u.boolTrue=0]="boolTrue",u[u.boolFalse=1]="boolFalse",u[u.byte=2]="byte",u[u.short=3]="short",u[u.integer=4]="integer",u[u.long=5]="long",u[u.byteArray=6]="byteArray",u[u.string=7]="string",u[u.timestamp=8]="timestamp",u[u.uuid=9]="uuid"})(mB||(mB={}));var gB="boolean",IK="byte",qK="short",mK="integer",gK="long",_K="binary",fK="string",bK="timestamp",jK="uuid",lK=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var _B=4,r2=_B*2,G0=4,dK=r2+G0*2;function fB({byteLength:u,byteOffset:D,buffer:B}){if(u<dK)throw Error("Provided message too short to accommodate event stream message overhead");let A=new DataView(B,D,u),w=A.getUint32(0,!1);if(u!==w)throw Error("Reported message length does not match received message length");let F=A.getUint32(_B,!1),N=A.getUint32(r2,!1),G=A.getUint32(u-G0,!1),v=new N0().update(new Uint8Array(B,D,r2));if(N!==v.digest())throw Error(`The prelude checksum specified in the message (${N}) does not match the calculated CRC32 checksum (${v.digest()})`);if(v.update(new Uint8Array(B,D+r2,u-(r2+G0))),G!==v.digest())throw Error(`The message checksum (${v.digest()}) did not match the expected value of ${G}`);return{headers:new DataView(B,D+r2+G0,F),body:new Uint8Array(B,D+r2+G0+F,w-F-(r2+G0+G0))}}class E3{headerMarshaller;messageBuffer;isEndOfStream;constructor(u,D){this.headerMarshaller=new L3(u,D),this.messageBuffer=[],this.isEndOfStream=!1}feed(u){this.messageBuffer.push(this.decode(u))}endOfStream(){this.isEndOfStream=!0}getMessage(){let u=this.messageBuffer.pop(),D=this.isEndOfStream;return{getMessage(){return u},isEndOfStream(){return D}}}getAvailableMessages(){let u=this.messageBuffer;this.messageBuffer=[];let D=this.isEndOfStream;return{getMessages(){return u},isEndOfStream(){return D}}}encode({headers:u,body:D}){let B=this.headerMarshaller.format(u),A=B.byteLength+D.byteLength+16,w=new Uint8Array(A),F=new DataView(w.buffer,w.byteOffset,w.byteLength),N=new N0;return F.setUint32(0,A,!1),F.setUint32(4,B.byteLength,!1),F.setUint32(8,N.update(w.subarray(0,8)).digest(),!1),w.set(B,12),w.set(D,B.byteLength+12),F.setUint32(A-4,N.update(w.subarray(8,A-4)).digest(),!1),w}decode(u){let{headers:D,body:B}=fB(u);return{headers:this.headerMarshaller.parse(D),body:B}}formatHeaders(u){return this.headerMarshaller.format(u)}}class O3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.decoder.decode(u)}}class C3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream)yield this.options.encoder.encode(u);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class P3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream){let D=await this.options.deserializer(u);if(D===void 0)continue;yield D}}}class k3{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.serializer(u)}}function bB(u){let D=0,B=0,A=null,w=null,F=(G)=>{if(typeof G!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+G);D=G,B=4,A=new Uint8Array(G),new DataView(A.buffer).setUint32(0,G,!1)},N=async function*(){let G=u[Symbol.asyncIterator]();while(!0){let{value:v,done:z}=await G.next();if(z){if(!D)return;else if(D===B)yield A;else throw Error("Truncated event message received.");return}let Q=v.length,Z=0;while(Z<Q){if(!A){let W=Q-Z;if(!w)w=new Uint8Array(4);let Y=Math.min(4-B,W);if(w.set(v.slice(Z,Z+Y),B),B+=Y,Z+=Y,B<4)break;F(new DataView(w.buffer).getUint32(0,!1)),w=null}let J=Math.min(D-B,Q-Z);if(A.set(v.slice(Z,Z+J),B),B+=J,Z+=J,D&&D===B)yield A,A=null,D=0,B=0}}};return{[Symbol.asyncIterator]:N}}function jB(u,D){return async function(B){let{value:A}=B.headers[":message-type"];if(A==="error"){let w=Error(B.headers[":error-message"].value||"UnknownError");throw w.name=B.headers[":error-code"].value,w}else if(A==="exception"){let w=B.headers[":exception-type"].value,F={[w]:B},N=await u(F);if(N.$unknown){let G=Error(D(B.body));throw G.name=w,G}throw N[w]}else if(A==="event"){let w={[B.headers[":event-type"].value]:B},F=await u(w);if(F.$unknown)return;return F}else throw Error(`Unrecognizable event type: ${B.headers[":event-type"].value}`)}}class y3{eventStreamCodec;utfEncoder;constructor({utf8Encoder:u,utf8Decoder:D}){this.eventStreamCodec=new E3(u,D),this.utfEncoder=u}deserialize(u,D){let B=bB(u);return new P3({messageStream:new O3({inputStream:B,decoder:this.eventStreamCodec}),deserializer:jB(D,this.utfEncoder)})}serialize(u,D){return new C3({messageStream:new k3({inputStream:u,serializer:D}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as rK}from"stream";async function*lB(u){let D=!1,B=!1,A=[];u.on("error",(w)=>{if(!D)D=!0;if(w)throw w}),u.on("data",(w)=>{A.push(w)}),u.on("end",()=>{D=!0});while(!B){let w=await new Promise((F)=>setTimeout(()=>F(A.shift()),0));if(w)yield w;B=D&&A.length===0}}class V3{universalMarshaller;constructor({utf8Encoder:u,utf8Decoder:D}){this.universalMarshaller=new y3({utf8Decoder:D,utf8Encoder:u})}deserialize(u,D){let B=typeof u[Symbol.asyncIterator]==="function"?u:lB(u);return this.universalMarshaller.deserialize(B,D)}serialize(u,D){return rK.from(this.universalMarshaller.serialize(u,D))}}var dB=(u)=>new V3(u);var E1=X(ux(),1);var rB=X(iD(),1);import{Writable as iK}from"stream";class T3 extends iK{hash;constructor(u,D){super(D);this.hash=u}_write(u,D,B){try{this.hash.update(rB.toUint8Array(u))}catch(A){return B(A)}B()}}var iB=(u,D)=>{if(D.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let B=new u,A=new T3(B);return D.pipe(A),new Promise((w,F)=>{D.on("error",(N)=>{A.end(),F(N)}),A.on("error",F),A.on("finish",()=>{B.digest().then(w).catch(F)})})};var C1=X(oB(),1),Y2=X(oK(),1),P1=X(sK(),1),k1=X(k2(),1),eB=X(Dx(),1),u6=X(Bx(),1),D6=X(tK(),1);var U1=X(Y0(),1),nB=X(aK(),1);var pB=X(k2(),1),aB=X(pK(),1),c1=X(nK(),1),M1=X(iu(),1),L1=X(iD(),1);var sB=(u)=>{return{apiVersion:"2006-03-01",base64Decoder:u?.base64Decoder??c1.fromBase64,base64Encoder:u?.base64Encoder??c1.toBase64,disableHostPrefix:u?.disableHostPrefix??!1,endpointProvider:u?.endpointProvider??A1,extensions:u?.extensions??[],getAwsChunkedEncodingStream:u?.getAwsChunkedEncodingStream??M1.getAwsChunkedEncodingStream,httpAuthSchemeProvider:u?.httpAuthSchemeProvider??NB,httpAuthSchemes:u?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4"),signer:new U1.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4a"),signer:new U1.AwsSdkSigV4ASigner}],logger:u?.logger??new pB.NoOpLogger,protocol:u?.protocol??nB.AwsRestXmlProtocol,protocolSettings:u?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:QB,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:u?.sdkStreamMixin??M1.sdkStreamMixin,serviceId:u?.serviceId??"S3",signerConstructor:u?.signerConstructor??zu,signingEscapePath:u?.signingEscapePath??!1,urlParser:u?.urlParser??aB.parseUrl,useArnRegion:u?.useArnRegion??void 0,utf8Decoder:u?.utf8Decoder??L1.fromUtf8,utf8Encoder:u?.utf8Encoder??L1.toUtf8}};var B6=(u)=>{k1.emitWarningIfUnsupportedVersion(process.version);let D=u6.resolveDefaultsModeConfig(u),B=()=>D().then(k1.loadConfigsForDefaultMode),A=sB(u);E0.emitWarningIfUnsupportedVersion(process.version);let w={profile:u?.profile,logger:A.logger};return{...A,...u,runtime:"node",defaultsMode:D,authSchemePreference:u?.authSchemePreference??Y2.loadConfig(E0.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,w),bodyLengthChecker:u?.bodyLengthChecker??eB.calculateBodyLength,credentialDefaultProvider:u?.credentialDefaultProvider??yB,defaultUserAgentProvider:u?.defaultUserAgentProvider??O1.createDefaultUserAgentProvider({serviceId:A.serviceId,clientVersion:HB.version}),disableS3ExpressSessionAuth:u?.disableS3ExpressSessionAuth??Y2.loadConfig(aD,w),eventStreamSerdeProvider:u?.eventStreamSerdeProvider??dB,maxAttempts:u?.maxAttempts??Y2.loadConfig(C1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,u),md5:u?.md5??E1.Hash.bind(null,"md5"),region:u?.region??Y2.loadConfig(i2.NODE_REGION_CONFIG_OPTIONS,{...i2.NODE_REGION_CONFIG_FILE_OPTIONS,...w}),requestChecksumCalculation:u?.requestChecksumCalculation??Y2.loadConfig(b5,w),requestHandler:P1.NodeHttpHandler.create(u?.requestHandler??B),responseChecksumValidation:u?.responseChecksumValidation??Y2.loadConfig(j5,w),retryMode:u?.retryMode??Y2.loadConfig({...C1.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await B()).retryMode||D6.DEFAULT_RETRY_MODE},u),sha1:u?.sha1??E1.Hash.bind(null,"sha1"),sha256:u?.sha256??E1.Hash.bind(null,"sha256"),sigv4aSigningRegionSet:u?.sigv4aSigningRegionSet??Y2.loadConfig(E0.NODE_SIGV4A_CONFIG_OPTIONS,w),streamCollector:u?.streamCollector??P1.streamCollector,streamHasher:u?.streamHasher??iB,useArnRegion:u?.useArnRegion??Y2.loadConfig(VB,w),useDualstackEndpoint:u?.useDualstackEndpoint??Y2.loadConfig(i2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,w),useFipsEndpoint:u?.useFipsEndpoint??Y2.loadConfig(i2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,w),userAgentAppId:u?.userAgentAppId??Y2.loadConfig(O1.NODE_APP_ID_CONFIG_OPTIONS,w)}};var y1=X(Ax(),1),V1=X(m2(),1),T1=X(k2(),1);var A6=(u)=>{let{httpAuthSchemes:D,httpAuthSchemeProvider:B,credentials:A}=u;return{setHttpAuthScheme(w){let F=D.findIndex((N)=>N.schemeId===w.schemeId);if(F===-1)D.push(w);else D.splice(F,1,w)},httpAuthSchemes(){return D},setHttpAuthSchemeProvider(w){B=w},httpAuthSchemeProvider(){return B},setCredentials(w){A=w},credentials(){return A}}},w6=(u)=>{return{httpAuthSchemes:u.httpAuthSchemes(),httpAuthSchemeProvider:u.httpAuthSchemeProvider(),credentials:u.credentials()}};var F6=(u,D)=>{let B=Object.assign(y1.getAwsRegionExtensionConfiguration(u),T1.getDefaultExtensionConfiguration(u),V1.getHttpHandlerExtensionConfiguration(u),A6(u));return D.forEach((A)=>A.configure(B)),Object.assign(u,y1.resolveAwsRegionExtensionConfiguration(B),T1.resolveDefaultRuntimeConfig(B),V1.resolveHttpHandlerRuntimeConfig(B),w6(B))};class I3 extends J6.Client{config;constructor(...[u]){let D=B6(u||{});super(D);this.initConfig=D;let B=$B(D),A=q1.resolveUserAgentConfig(B),w=Q4(A),F=m1.resolveRetryConfig(w),N=$6.resolveRegionConfig(F),G=I1.resolveHostHeaderConfig(N),v=Z6.resolveEndpointConfig(G),z=n4(v),Q=GB(z),Z=b4(Q,{session:[()=>this,M3]}),J=F6(Z,u?.extensions||[]);this.config=J,this.middlewareStack.use(v6.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(q1.getUserAgentPlugin(this.config)),this.middlewareStack.use(m1.getRetryPlugin(this.config)),this.middlewareStack.use(z6.getContentLengthPlugin(this.config)),this.middlewareStack.use(I1.getHostHeaderPlugin(this.config)),this.middlewareStack.use(N6.getLoggerPlugin(this.config)),this.middlewareStack.use(G6.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(O0.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:AB,identityProviderConfigProvider:async(W)=>new O0.DefaultIdentityProviderConfig({"aws.auth#sigv4":W.credentials,"aws.auth#sigv4a":W.credentials})})),this.middlewareStack.use(O0.getHttpSigningPlugin(this.config)),this.middlewareStack.use(i4(this.config)),this.middlewareStack.use(_5(this.config)),this.middlewareStack.use(x4(this.config)),this.middlewareStack.use(sD(this.config)),this.middlewareStack.use(tD(this.config))}destroy(){super.destroy()}}function vx(u){return(D)=>async(B)=>{let A={...B.input},w=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let F of w){let N=A[F.target];if(N){let G;if(typeof N==="string")if(Zx(N,u))G=u.base64Decoder(N);else G=u.utf8Decoder(N),A[F.target]=u.base64Encoder(G);else G=ArrayBuffer.isView(N)?new Uint8Array(N.buffer,N.byteOffset,N.byteLength):new Uint8Array(N),A[F.target]=u.base64Encoder(G);let v=new u.md5;v.update(G),A[F.hash]=u.base64Encoder(await v.digest())}}return D({...B,input:A})}}var zx={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},g1=(u)=>({applyToStack:(D)=>{D.add(vx(u),zx)}});function Zx(u,D){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u))return!1;try{return D.base64Decoder(u).length===32}catch{return!1}}var Q6=X(U0(),1),W6=X(k2(),1);class q3 extends W6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[Q6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),pu(B,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),g1(B),H4(B)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(hB).build(){}var X6=X(U0(),1),Y6=X(k2(),1);class m3 extends Y6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(u,D,B,A){return[X6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),K0(B)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(KB).build(){}var h6=X(U0(),1),K6=X(k2(),1);class g3 extends K6.Command.classBuilder().ep({...j2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[h6.getEndpointPlugin(B,u.getEndpointParameterInstructions()),pu(B,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),Y4(B),K0(B),g1(B)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(xB).build(){}import{Buffer as x6}from"buffer";class S6 extends Q0{client;constructor(...u){super();this.client=new I3(...u)}async put(u){let D,B,A,w=process.env.BUCKET_NAME;if(u instanceof Blob)D=u,A=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`,B=u.type;else D=u.body,A=u.name,w=u.bucket??w,B=u.contentType;B=D instanceof Blob||D instanceof File?D.type:void 0;let F=D instanceof x6?D:D instanceof Blob||D instanceof File?x6.from(await D.arrayBuffer()):"";return await this.client.send(new g3({Bucket:w,Key:A,Body:F,ContentType:B})),A}async list(u){return await this.client.send(new m3({Bucket:process.env.BUCKET_NAME,Prefix:u}))}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=await this.client.send(new q3({Bucket:D,Key:B}));return new Response(A.Body.transformToWebStream(),{headers:{"Content-Type":A.ContentType,"Content-Length":A.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":A.LastModified?.toUTCString()||"",ETag:A.ETag||""}})}}class _1{}class f1 extends _1{requests=new Map;consume(u,D){if(!this.requests.has(u))this.requests.set(u,{date:Date.now(),count:1});else{let B=this.requests.get(u),A=Date.now();if(A-B.date>=60000)this.requests.set(u,{date:A,count:1});else this.requests.set(u,{date:B.date,count:B.count+1})}return this.requests.get(u).count}}class R6 extends f{driver=new f1;boot(){}}var n2=new TextEncoder;var Ku=new Uint8Array(256);for(let u=0;u<64;u++)Ku["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(u)]=u;function b1(u){let D=Math.ceil(u.length/4)*3,B=u.length,A=0;if(u.length%4===3)D--;else if(u.length%4===2)D-=2;else if(u[u.length-1]==="="){if(D--,u[u.length-2]==="=")D--}let w=new ArrayBuffer(D),F=new Uint8Array(w);for(let N=0;N<B;N+=4){let G=Ku[u.charCodeAt(N)],v=Ku[u.charCodeAt(N+1)],z=Ku[u.charCodeAt(N+2)],Q=Ku[u.charCodeAt(N+3)];F[A++]=G<<2|v>>4,F[A++]=(v&15)<<4|z>>2,F[A++]=(z&3)<<6|Q&63}return w}function C0(u){u=u||"utf8";let D;try{D=new TextDecoder(u)}catch(B){D=new TextDecoder("windows-1252")}return D}async function p2(u){if("arrayBuffer"in u)return await u.arrayBuffer();let D=new FileReader;return new Promise((B,A)=>{D.onload=function(w){B(w.target.result)},D.onerror=function(w){A(D.error)},D.readAsArrayBuffer(u)})}function H6(u){if(u>=48&&u<=57||u>=97&&u<=102||u>=65&&u<=70)return String.fromCharCode(u);return!1}function Jx(u,D,B){let A=u.indexOf("*");if(A>=0)u=u.substr(0,A);D=D.toUpperCase();let w;if(D==="Q"){B=B.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let F=n2.encode(B),N=[];for(let v=0,z=F.length;v<z;v++){let Q=F[v];if(v<=z-2&&Q===61){let Z=H6(F[v+1]),J=H6(F[v+2]);if(Z&&J){let W=parseInt(Z+J,16);N.push(W),v+=2;continue}}N.push(Q)}w=new ArrayBuffer(N.length);let G=new DataView(w);for(let v=0,z=N.length;v<z;v++)G.setUint8(v,N[v])}else if(D==="B")w=b1(B.replace(/[^a-zA-Z0-9\+\/=]+/g,""));else w=n2.encode(B);return C0(u).decode(w)}function $0(u){let D=!0,B=!1;while(!B){let A=(u||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(w,F,N,G,v)=>{if(!D)return w;if(N===v&&G.length%4===0&&!/=$/.test(G))return F+"__\x00JOIN\x00__";return w}).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(w,F,N,G)=>{if(!D)return w;if(N===G)return F+"__\x00JOIN\x00__";return w}).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(w,F,N,G)=>Jx(F,N,G));if(D&&A.indexOf("\uFFFD")>=0)D=!1;else return A}}function Qx(u,D){D=D||"utf-8";let B=[];for(let F=0;F<u.length;F++){let N=u.charAt(F);if(N==="%"&&/^[a-f0-9]{2}/i.test(u.substr(F+1,2))){let G=u.substr(F+1,2);F+=2,B.push(parseInt(G,16))}else if(N.charCodeAt(0)>126){N=n2.encode(N);for(let G=0;G<N.length;G++)B.push(N[G])}else B.push(N.charCodeAt(0))}let A=new ArrayBuffer(B.length),w=new DataView(A);for(let F=0,N=B.length;F<N;F++)w.setUint8(F,B[F]);return C0(D).decode(A)}function U6(u){let D=new Map;Object.keys(u.params).forEach((B)=>{let A=B.match(/\*((\d+)\*?)?$/);if(!A)return;let w=B.substr(0,A.index).toLowerCase(),F=Number(A[2])||0,N;if(!D.has(w))N={charset:!1,values:[]},D.set(w,N);else N=D.get(w);let G=u.params[B];if(F===0&&A[0].charAt(A[0].length-1)==="*"&&(A=G.match(/^([^']*)'[^']*'(.*)$/)))N.charset=A[1]||"utf-8",G=A[2];N.values.push({nr:F,value:G}),delete u.params[B]}),D.forEach((B,A)=>{u.params[A]=Qx(B.values.sort((w,F)=>w.nr-F.nr).map((w)=>w.value).join(""),B.charset)})}class j1{constructor(){this.chunks=[]}update(u){this.chunks.push(u),this.chunks.push(`
|
|
13
|
-
`)}finalize(){return
|
|
14
|
-
`;if(D=this.remainder+D,D.length<this.maxChunkSize){this.remainder=D;return}this.remainder="";let B=D.match(
|
|
12
|
+
`),I6=!0}throw new O1.CredentialsProviderError("AWS_PROFILE is set, skipping fromEnv provider.",{logger:u.logger,tryNextLink:!0})}return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),_6(u)()},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:B,ssoAccountId:A,ssoRegion:w,ssoRoleName:F,ssoSession:G}=u;if(!B&&!A&&!w&&!F&&!G)throw new O1.CredentialsProviderError("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:u.logger});let{fromSSO:N}=await import("./chunk-cbvq4keh.js");return N(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:B}=await import("./chunk-ywhazhqt.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:B}=await import("./chunk-9cw39se2.js");return B(u)(D)},async(D)=>{u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:B}=await import("./chunk-x2cq1qp8.js");return B(u)(D)},async()=>{return u.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await y6(u))()},async()=>{throw new O1.CredentialsProviderError("Could not load credentials from any providers",{tryNextLink:!1,logger:u.logger})}],rh);var rh=(u)=>u?.expiration!==void 0&&u.expiration.getTime()-Date.now()<300000;var O0=X(k4(),1),nh="AWS_S3_USE_ARN_REGION",ph="s3_use_arn_region",b6={environmentVariableSelector:(u)=>O0.booleanSelector(u,nh,O0.SelectorType.ENV),configFileSelector:(u)=>O0.booleanSelector(u,ph,O0.SelectorType.CONFIG),default:void 0};var T1=X(Qx(),1),s2=X(FB(),1);var p2=X(l6(),1);var d6=X(l6(),1);class C0{bytes;constructor(u){if(this.bytes=u,u.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(u){if(u>9223372036854776000||u<-9223372036854776000)throw Error(`${u} is too large (or, if negative, too small) to represent as an Int64`);let D=new Uint8Array(8);for(let B=7,A=Math.abs(Math.round(u));B>-1&&A>0;B--,A/=256)D[B]=A;if(u<0)j6(D);return new C0(D)}valueOf(){let u=this.bytes.slice(0),D=u[0]&128;if(D)j6(u);return parseInt(d6.toHex(u),16)*(D?-1:1)}toString(){return String(this.valueOf())}}function j6(u){for(let D=0;D<8;D++)u[D]^=255;for(let D=7;D>-1;D--)if(u[D]++,u[D]!==0)break}class yD{toUtf8;fromUtf8;constructor(u,D){this.toUtf8=u,this.fromUtf8=D}format(u){let D=[];for(let w of Object.keys(u)){let F=this.fromUtf8(w);D.push(Uint8Array.from([F.byteLength]),F,this.formatHeaderValue(u[w]))}let B=new Uint8Array(D.reduce((w,F)=>w+F.byteLength,0)),A=0;for(let w of D)B.set(w,A),A+=w.byteLength;return B}formatHeaderValue(u){switch(u.type){case"boolean":return Uint8Array.from([u.value?0:1]);case"byte":return Uint8Array.from([2,u.value]);case"short":let D=new DataView(new ArrayBuffer(3));return D.setUint8(0,3),D.setInt16(1,u.value,!1),new Uint8Array(D.buffer);case"integer":let B=new DataView(new ArrayBuffer(5));return B.setUint8(0,4),B.setInt32(1,u.value,!1),new Uint8Array(B.buffer);case"long":let A=new Uint8Array(9);return A[0]=5,A.set(u.value.bytes,1),A;case"binary":let w=new DataView(new ArrayBuffer(3+u.value.byteLength));w.setUint8(0,6),w.setUint16(1,u.value.byteLength,!1);let F=new Uint8Array(w.buffer);return F.set(u.value,3),F;case"string":let G=this.fromUtf8(u.value),N=new DataView(new ArrayBuffer(3+G.byteLength));N.setUint8(0,7),N.setUint16(1,G.byteLength,!1);let $=new Uint8Array(N.buffer);return $.set(G,3),$;case"timestamp":let Z=new Uint8Array(9);return Z[0]=8,Z.set(C0.fromNumber(u.value.valueOf()).bytes,1),Z;case"uuid":if(!Ax.test(u.value))throw Error(`Invalid UUID received: ${u.value}`);let Q=new Uint8Array(17);return Q[0]=9,Q.set(p2.fromHex(u.value.replace(/\-/g,"")),1),Q}}parse(u){let D={},B=0;while(B<u.byteLength){let A=u.getUint8(B++),w=this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,A));switch(B+=A,u.getUint8(B++)){case 0:D[w]={type:r6,value:!0};break;case 1:D[w]={type:r6,value:!1};break;case 2:D[w]={type:ah,value:u.getInt8(B++)};break;case 3:D[w]={type:sh,value:u.getInt16(B,!1)},B+=2;break;case 4:D[w]={type:th,value:u.getInt32(B,!1)},B+=4;break;case 5:D[w]={type:oh,value:new C0(new Uint8Array(u.buffer,u.byteOffset+B,8))},B+=8;break;case 6:let F=u.getUint16(B,!1);B+=2,D[w]={type:eh,value:new Uint8Array(u.buffer,u.byteOffset+B,F)},B+=F;break;case 7:let G=u.getUint16(B,!1);B+=2,D[w]={type:ux,value:this.toUtf8(new Uint8Array(u.buffer,u.byteOffset+B,G))},B+=G;break;case 8:D[w]={type:Dx,value:new Date(new C0(new Uint8Array(u.buffer,u.byteOffset+B,8)).valueOf())},B+=8;break;case 9:let N=new Uint8Array(u.buffer,u.byteOffset+B,16);B+=16,D[w]={type:Bx,value:`${p2.toHex(N.subarray(0,4))}-${p2.toHex(N.subarray(4,6))}-${p2.toHex(N.subarray(6,8))}-${p2.toHex(N.subarray(8,10))}-${p2.toHex(N.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return D}}var i6;(function(u){u[u.boolTrue=0]="boolTrue",u[u.boolFalse=1]="boolFalse",u[u.byte=2]="byte",u[u.short=3]="short",u[u.integer=4]="integer",u[u.long=5]="long",u[u.byteArray=6]="byteArray",u[u.string=7]="string",u[u.timestamp=8]="timestamp",u[u.uuid=9]="uuid"})(i6||(i6={}));var r6="boolean",ah="byte",sh="short",th="integer",oh="long",eh="binary",ux="string",Dx="timestamp",Bx="uuid",Ax=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var n6=4,a2=n6*2,v0=4,wx=a2+v0*2;function p6({byteLength:u,byteOffset:D,buffer:B}){if(u<wx)throw Error("Provided message too short to accommodate event stream message overhead");let A=new DataView(B,D,u),w=A.getUint32(0,!1);if(u!==w)throw Error("Reported message length does not match received message length");let F=A.getUint32(n6,!1),G=A.getUint32(a2,!1),N=A.getUint32(u-v0,!1),$=new Z0().update(new Uint8Array(B,D,a2));if(G!==$.digest())throw Error(`The prelude checksum specified in the message (${G}) does not match the calculated CRC32 checksum (${$.digest()})`);if($.update(new Uint8Array(B,D+a2,u-(a2+v0))),N!==$.digest())throw Error(`The message checksum (${$.digest()}) did not match the expected value of ${N}`);return{headers:new DataView(B,D+a2+v0,F),body:new Uint8Array(B,D+a2+v0+F,w-F-(a2+v0+v0))}}class TD{headerMarshaller;messageBuffer;isEndOfStream;constructor(u,D){this.headerMarshaller=new yD(u,D),this.messageBuffer=[],this.isEndOfStream=!1}feed(u){this.messageBuffer.push(this.decode(u))}endOfStream(){this.isEndOfStream=!0}getMessage(){let u=this.messageBuffer.pop(),D=this.isEndOfStream;return{getMessage(){return u},isEndOfStream(){return D}}}getAvailableMessages(){let u=this.messageBuffer;this.messageBuffer=[];let D=this.isEndOfStream;return{getMessages(){return u},isEndOfStream(){return D}}}encode({headers:u,body:D}){let B=this.headerMarshaller.format(u),A=B.byteLength+D.byteLength+16,w=new Uint8Array(A),F=new DataView(w.buffer,w.byteOffset,w.byteLength),G=new Z0;return F.setUint32(0,A,!1),F.setUint32(4,B.byteLength,!1),F.setUint32(8,G.update(w.subarray(0,8)).digest(),!1),w.set(B,12),w.set(D,B.byteLength+12),F.setUint32(A-4,G.update(w.subarray(8,A-4)).digest(),!1),w}decode(u){let{headers:D,body:B}=p6(u);return{headers:this.headerMarshaller.parse(D),body:B}}formatHeaders(u){return this.headerMarshaller.format(u)}}class ID{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.decoder.decode(u)}}class qD{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream)yield this.options.encoder.encode(u);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class mD{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.messageStream){let D=await this.options.deserializer(u);if(D===void 0)continue;yield D}}}class _D{options;constructor(u){this.options=u}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let u of this.options.inputStream)yield this.options.serializer(u)}}function a6(u){let D=0,B=0,A=null,w=null,F=(N)=>{if(typeof N!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+N);D=N,B=4,A=new Uint8Array(N),new DataView(A.buffer).setUint32(0,N,!1)},G=async function*(){let N=u[Symbol.asyncIterator]();while(!0){let{value:$,done:Z}=await N.next();if(Z){if(!D)return;else if(D===B)yield A;else throw Error("Truncated event message received.");return}let Q=$.length,J=0;while(J<Q){if(!A){let W=Q-J;if(!w)w=new Uint8Array(4);let Y=Math.min(4-B,W);if(w.set($.slice(J,J+Y),B),B+=Y,J+=Y,B<4)break;F(new DataView(w.buffer).getUint32(0,!1)),w=null}let v=Math.min(D-B,Q-J);if(A.set($.slice(J,J+v),B),B+=v,J+=v,D&&D===B)yield A,A=null,D=0,B=0}}};return{[Symbol.asyncIterator]:G}}function s6(u,D){return async function(B){let{value:A}=B.headers[":message-type"];if(A==="error"){let w=Error(B.headers[":error-message"].value||"UnknownError");throw w.name=B.headers[":error-code"].value,w}else if(A==="exception"){let w=B.headers[":exception-type"].value,F={[w]:B},G=await u(F);if(G.$unknown){let N=Error(D(B.body));throw N.name=w,N}throw G[w]}else if(A==="event"){let w={[B.headers[":event-type"].value]:B},F=await u(w);if(F.$unknown)return;return F}else throw Error(`Unrecognizable event type: ${B.headers[":event-type"].value}`)}}class gD{eventStreamCodec;utfEncoder;constructor({utf8Encoder:u,utf8Decoder:D}){this.eventStreamCodec=new TD(u,D),this.utfEncoder=u}deserialize(u,D){let B=a6(u);return new mD({messageStream:new ID({inputStream:B,decoder:this.eventStreamCodec}),deserializer:s6(D,this.utfEncoder)})}serialize(u,D){return new qD({messageStream:new _D({inputStream:u,serializer:D}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as Fx}from"stream";async function*t6(u){let D=!1,B=!1,A=[];u.on("error",(w)=>{if(!D)D=!0;if(w)throw w}),u.on("data",(w)=>{A.push(w)}),u.on("end",()=>{D=!0});while(!B){let w=await new Promise((F)=>setTimeout(()=>F(A.shift()),0));if(w)yield w;B=D&&A.length===0}}class fD{universalMarshaller;constructor({utf8Encoder:u,utf8Decoder:D}){this.universalMarshaller=new gD({utf8Decoder:D,utf8Encoder:u})}deserialize(u,D){let B=typeof u[Symbol.asyncIterator]==="function"?u:t6(u);return this.universalMarshaller.deserialize(B,D)}serialize(u,D){return Fx.from(this.universalMarshaller.serialize(u,D))}}var o6=(u)=>new fD(u);var y1=X(Wx(),1);var e6=X(o3(),1);import{Writable as Gx}from"stream";class bD extends Gx{hash;constructor(u,D){super(D);this.hash=u}_write(u,D,B){try{this.hash.update(e6.toUint8Array(u))}catch(A){return B(A)}B()}}var uB=(u,D)=>{if(D.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let B=new u,A=new bD(B);return D.pipe(A),new Promise((w,F)=>{D.on("error",(G)=>{A.end(),F(G)}),A.on("error",F),A.on("finish",()=>{B.digest().then(w).catch(F)})})};var I1=X(GB(),1),K2=X(vx(),1),q1=X(Zx(),1),m1=X(R2(),1),NB=X(Xx(),1),$B=X(Yx(),1),zB=X(Jx(),1);var C1=X(H0(),1),DB=X(zx(),1);var BB=X(R2(),1),AB=X($x(),1),P1=X(Nx(),1),k1=X(tu(),1),V1=X(o3(),1);var wB=(u)=>{return{apiVersion:"2006-03-01",base64Decoder:u?.base64Decoder??P1.fromBase64,base64Encoder:u?.base64Encoder??P1.toBase64,disableHostPrefix:u?.disableHostPrefix??!1,endpointProvider:u?.endpointProvider??z1,extensions:u?.extensions??[],getAwsChunkedEncodingStream:u?.getAwsChunkedEncodingStream??k1.getAwsChunkedEncodingStream,httpAuthSchemeProvider:u?.httpAuthSchemeProvider??W6,httpAuthSchemes:u?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4"),signer:new C1.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(D)=>D.getIdentityProvider("aws.auth#sigv4a"),signer:new C1.AwsSdkSigV4ASigner}],logger:u?.logger??new BB.NoOpLogger,protocol:u?.protocol??DB.AwsRestXmlProtocol,protocolSettings:u?.protocolSettings??{defaultNamespace:"com.amazonaws.s3",errorTypeRegistries:S6,xmlNamespace:"http://s3.amazonaws.com/doc/2006-03-01/",version:"2006-03-01",serviceTarget:"AmazonS3"},sdkStreamMixin:u?.sdkStreamMixin??k1.sdkStreamMixin,serviceId:u?.serviceId??"S3",signerConstructor:u?.signerConstructor??Xu,signingEscapePath:u?.signingEscapePath??!1,urlParser:u?.urlParser??AB.parseUrl,useArnRegion:u?.useArnRegion??void 0,utf8Decoder:u?.utf8Decoder??V1.fromUtf8,utf8Encoder:u?.utf8Encoder??V1.toUtf8}};var ZB=(u)=>{m1.emitWarningIfUnsupportedVersion(process.version);let D=$B.resolveDefaultsModeConfig(u),B=()=>D().then(m1.loadConfigsForDefaultMode),A=wB(u);P0.emitWarningIfUnsupportedVersion(process.version);let w={profile:u?.profile,logger:A.logger};return{...A,...u,runtime:"node",defaultsMode:D,authSchemePreference:u?.authSchemePreference??K2.loadConfig(P0.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,w),bodyLengthChecker:u?.bodyLengthChecker??NB.calculateBodyLength,credentialDefaultProvider:u?.credentialDefaultProvider??f6,defaultUserAgentProvider:u?.defaultUserAgentProvider??T1.createDefaultUserAgentProvider({serviceId:A.serviceId,clientVersion:P6.version}),disableS3ExpressSessionAuth:u?.disableS3ExpressSessionAuth??K2.loadConfig(DD,w),eventStreamSerdeProvider:u?.eventStreamSerdeProvider??o6,maxAttempts:u?.maxAttempts??K2.loadConfig(I1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,u),md5:u?.md5??y1.Hash.bind(null,"md5"),region:u?.region??K2.loadConfig(s2.NODE_REGION_CONFIG_OPTIONS,{...s2.NODE_REGION_CONFIG_FILE_OPTIONS,...w}),requestChecksumCalculation:u?.requestChecksumCalculation??K2.loadConfig(s5,w),requestHandler:q1.NodeHttpHandler.create(u?.requestHandler??B),responseChecksumValidation:u?.responseChecksumValidation??K2.loadConfig(t5,w),retryMode:u?.retryMode??K2.loadConfig({...I1.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await B()).retryMode||zB.DEFAULT_RETRY_MODE},u),sha1:u?.sha1??y1.Hash.bind(null,"sha1"),sha256:u?.sha256??y1.Hash.bind(null,"sha256"),sigv4aSigningRegionSet:u?.sigv4aSigningRegionSet??K2.loadConfig(P0.NODE_SIGV4A_CONFIG_OPTIONS,w),streamCollector:u?.streamCollector??q1.streamCollector,streamHasher:u?.streamHasher??uB,useArnRegion:u?.useArnRegion??K2.loadConfig(b6,w),useDualstackEndpoint:u?.useDualstackEndpoint??K2.loadConfig(s2.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,w),useFipsEndpoint:u?.useFipsEndpoint??K2.loadConfig(s2.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,w),userAgentAppId:u?.userAgentAppId??K2.loadConfig(T1.NODE_APP_ID_CONFIG_OPTIONS,w)}};var _1=X(Kx(),1),g1=X(g2(),1),f1=X(R2(),1);var JB=(u)=>{let{httpAuthSchemes:D,httpAuthSchemeProvider:B,credentials:A}=u;return{setHttpAuthScheme(w){let F=D.findIndex((G)=>G.schemeId===w.schemeId);if(F===-1)D.push(w);else D.splice(F,1,w)},httpAuthSchemes(){return D},setHttpAuthSchemeProvider(w){B=w},httpAuthSchemeProvider(){return B},setCredentials(w){A=w},credentials(){return A}}},vB=(u)=>{return{httpAuthSchemes:u.httpAuthSchemes(),httpAuthSchemeProvider:u.httpAuthSchemeProvider(),credentials:u.credentials()}};var QB=(u,D)=>{let B=Object.assign(_1.getAwsRegionExtensionConfiguration(u),f1.getDefaultExtensionConfiguration(u),g1.getHttpHandlerExtensionConfiguration(u),JB(u));return D.forEach((A)=>A.configure(B)),Object.assign(u,_1.resolveAwsRegionExtensionConfiguration(B),f1.resolveDefaultRuntimeConfig(B),g1.resolveHttpHandlerRuntimeConfig(B),vB(B))};class jD extends HB.Client{config;constructor(...[u]){let D=ZB(u||{});super(D);this.initConfig=D;let B=Y6(D),A=j1.resolveUserAgentConfig(B),w=R4(A),F=l1.resolveRetryConfig(w),G=YB.resolveRegionConfig(F),N=b1.resolveHostHeaderConfig(G),$=xB.resolveEndpointConfig(N),Z=D9($),Q=X6(Z),J=a4(Q,{session:[()=>this,VD]}),v=QB(J,u?.extensions||[]);this.config=v,this.middlewareStack.use(KB.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(j1.getUserAgentPlugin(this.config)),this.middlewareStack.use(l1.getRetryPlugin(this.config)),this.middlewareStack.use(hB.getContentLengthPlugin(this.config)),this.middlewareStack.use(b1.getHostHeaderPlugin(this.config)),this.middlewareStack.use(WB.getLoggerPlugin(this.config)),this.middlewareStack.use(XB.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(k0.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:J6,identityProviderConfigProvider:async(W)=>new k0.DefaultIdentityProviderConfig({"aws.auth#sigv4":W.credentials,"aws.auth#sigv4a":W.credentials})})),this.middlewareStack.use(k0.getHttpSigningPlugin(this.config)),this.middlewareStack.use(u9(this.config)),this.middlewareStack.use(p5(this.config)),this.middlewareStack.use(O4(this.config)),this.middlewareStack.use(BD(this.config)),this.middlewareStack.use(AD(this.config))}destroy(){super.destroy()}}function Ux(u){return(D)=>async(B)=>{let A={...B.input},w=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let F of w){let G=A[F.target];if(G){let N;if(typeof G==="string")if(Lx(G,u))N=u.base64Decoder(G);else N=u.utf8Decoder(G),A[F.target]=u.base64Encoder(N);else N=ArrayBuffer.isView(G)?new Uint8Array(G.buffer,G.byteOffset,G.byteLength):new Uint8Array(G),A[F.target]=u.base64Encoder(N);let $=new u.md5;$.update(N),A[F.hash]=u.base64Encoder(await $.digest())}}return D({...B,input:A})}}var Mx={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},V0=(u)=>({applyToStack:(D)=>{D.add(Ux(u),Mx)}});function Lx(u,D){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u))return!1;try{return D.base64Decoder(u).length===32}catch{return!1}}var SB=X(J0(),1),RB=X(R2(),1);class d1 extends RB.Command.classBuilder().ep({...m2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[SB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),eu(B,{requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC64NVME","CRC32","CRC32C","SHA256","SHA1"]}),V0(B),u1(B)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").sc(M6).build(){}var UB=X(J0(),1),MB=X(R2(),1);class lD extends MB.Command.classBuilder().ep({...m2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[UB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),r2(B),V0(B),u1(B)]}).s("AmazonS3","HeadObject",{}).n("S3Client","HeadObjectCommand").sc(L6).build(){}var LB=X(J0(),1),cB=X(R2(),1);class dD extends cB.Command.classBuilder().ep({...m2,Bucket:{type:"contextParams",name:"Bucket"},Prefix:{type:"contextParams",name:"Prefix"}}).m(function(u,D,B,A){return[LB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),r2(B)]}).s("AmazonS3","ListObjectsV2",{}).n("S3Client","ListObjectsV2Command").sc(c6).build(){}var EB=X(J0(),1),OB=X(R2(),1);class iD extends OB.Command.classBuilder().ep({...m2,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(u,D,B,A){return[EB.getEndpointPlugin(B,u.getEndpointParameterInstructions()),eu(B,{requestAlgorithmMember:{httpHeader:"x-amz-sdk-checksum-algorithm",name:"ChecksumAlgorithm"},requestChecksumRequired:!1}),L4(B),r2(B),V0(B)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").sc(E6).build(){}import{Buffer as CB}from"buffer";class PB extends l2{client;constructor(...u){super();this.client=new jD(...u)}async put(u){let D,B,A,w=process.env.BUCKET_NAME;if(u instanceof Blob)D=u,A=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`,B=u.type;else D=u.body,A=u.name,w=u.bucket??w,B=u.contentType||(D instanceof Blob||D instanceof File?D.type:void 0);B=B||void 0;let F=D instanceof CB?D:D instanceof Blob||D instanceof File?CB.from(await D.arrayBuffer()):"";return await this.client.send(new iD({Bucket:w,Key:A,Body:F,ContentType:B})),A}async list(u){return await this.client.send(new dD({Bucket:process.env.BUCKET_NAME,Prefix:u}))}async fetch(u){let D=process.env.BUCKET_NAME,B;if(typeof u==="string")B=u;else D=u.bucket??D,B=u.name;if(!B)throw Error("Object name has to be specified");let A=await this.client.send(new d1({Bucket:D,Key:B}));return new Response(A.Body.transformToWebStream(),{headers:{"Content-Type":A.ContentType,"Content-Length":A.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":A.LastModified?.toUTCString()||"",ETag:A.ETag||""}})}async read(u){let D=typeof u==="string"?{name:u}:u,B=D.bucket??process.env.BUCKET_NAME,{name:A,range:w=null}=D;if(!A)throw Error("Object name has to be specified");let F;try{F=await this.client.send(new d1({Bucket:B,Key:A,Range:w?rD(w):void 0}))}catch(Z){if(Z?.name==="InvalidRange"||Z?.$metadata?.httpStatusCode===416)throw new d2(await this.size({name:A,bucket:B}));if(Z?.name==="NoSuchKey"||Z?.$metadata?.httpStatusCode===404)throw new Z2(A);throw Z}let G=Ru(F.ContentRange),N=Boolean(G)&&F.$metadata?.httpStatusCode===206,$=G?.total??F.ContentLength??0;return{body:F.Body.transformToWebStream(),start:G?.start??0,end:G?.end??$-1,total:$,partial:N,type:F.ContentType??"application/octet-stream",etag:F.ETag||void 0,lastModified:F.LastModified,name:A}}async size(u){let D=typeof u==="string"?u:u.name,B=(typeof u==="string"?void 0:u.bucket)??process.env.BUCKET_NAME;try{return(await this.client.send(new lD({Bucket:B,Key:D}))).ContentLength??0}catch(A){if(A?.name==="NotFound"||A?.$metadata?.httpStatusCode===404)throw new Z2(D);throw A}}}import{Buffer as kB}from"buffer";import{Readable as cx}from"stream";function nD(u){return u?.statusCode===404||u?.details?.errorCode==="BlobNotFound"||u?.code==="BlobNotFound"}function Ex(u){return u?.statusCode===416||u?.details?.errorCode==="InvalidRange"||u?.code==="InvalidRange"}class VB extends l2{config;serviceClientPromise=null;constructor(u={}){super();this.config=u}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let u;try{u=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let D=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new u.BlobServiceClient(this.config.url,this.config.credential);if(D)return u.BlobServiceClient.fromConnectionString(D);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(u,D){if(!u)throw Error("Object name has to be specified");let B=D??this.config.container??process.env.BUCKET_NAME;if(!B)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(B).getBlockBlobClient(u)}async put(u){let D,B,A,w;if(u instanceof Blob)D=u,A=`${Bun.randomUUIDv7()}.${u.type.split("/")[1].split(";")[0]}`,B=u.type;else D=u.body,A=u.name,w=u.bucket,B=u.contentType??(D instanceof Blob||D instanceof File?D.type:void 0);let F=D instanceof kB?D:kB.from(await D.arrayBuffer());return await(await this.blob(A,w)).uploadData(F,{blobHTTPHeaders:B?{blobContentType:B}:void 0}),A}async list(u){let D=this.config.container??process.env.BUCKET_NAME,A=(await this.serviceClient()).getContainerClient(D),w=[];for await(let F of A.listBlobsFlat({prefix:u}))w.push(F.name);return w}async fetch(u){let D=await this.read(typeof u==="string"?{name:u}:{name:u.name,bucket:u.bucket});return new Response(D.body,{headers:{"Content-Type":D.type,"Content-Length":String(D.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":D.lastModified?.toUTCString()??"",ETag:D.etag??""}})}async read(u){let D=typeof u==="string"?{name:u}:u,{name:B,bucket:A,range:w=null}=D,F=await this.blob(B,A),G,N;if(w?.kind==="suffix"){let v=await this.size({name:B,bucket:A}),W=wu(w,v);if(!W)throw new d2(v);G=W.start,N=W.length}else if(w)G=w.start,N=w.end===null?void 0:w.end-w.start+1;let $;try{$=await F.download(G,N)}catch(v){if(Ex(v))throw new d2(await this.size({name:B,bucket:A}));if(nD(v))throw new Z2(B);throw v}let Z=Ru($.contentRange),Q=Boolean(Z),J=Z?.total??$.contentLength??0;return{body:await Ox($),start:Z?.start??0,end:Z?.end??J-1,total:J,partial:Q,type:$.contentType??"application/octet-stream",etag:$.etag||void 0,lastModified:$.lastModified,name:B}}async size(u){let D=typeof u==="string"?u:u.name,B=typeof u==="string"?void 0:u.bucket,A=await this.blob(D,B);try{return(await A.getProperties()).contentLength??0}catch(w){if(nD(w))throw new Z2(D);throw w}}async delete(u){let D=typeof u==="string"?u:u.name,B=typeof u==="string"?void 0:u.bucket,A=await this.blob(D,B);try{await A.delete()}catch(w){if(nD(w))throw new Z2(D);throw w}}}async function Ox(u){if(u.blobBody)return await u.blobBody;if(u.readableStreamBody)return cx.toWeb(u.readableStreamBody);return null}class i1{}class r1 extends i1{requests=new Map;consume(u,D){if(!this.requests.has(u))this.requests.set(u,{date:Date.now(),count:1});else{let B=this.requests.get(u),A=Date.now();if(A-B.date>=60000)this.requests.set(u,{date:A,count:1});else this.requests.set(u,{date:B.date,count:B.count+1})}return this.requests.get(u).count}}class yB extends f{driver=new r1;boot(){}}var t2=new TextEncoder;var Uu=new Uint8Array(256);for(let u=0;u<64;u++)Uu["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(u)]=u;function n1(u){let D=Math.ceil(u.length/4)*3,B=u.length,A=0;if(u.length%4===3)D--;else if(u.length%4===2)D-=2;else if(u[u.length-1]==="="){if(D--,u[u.length-2]==="=")D--}let w=new ArrayBuffer(D),F=new Uint8Array(w);for(let G=0;G<B;G+=4){let N=Uu[u.charCodeAt(G)],$=Uu[u.charCodeAt(G+1)],Z=Uu[u.charCodeAt(G+2)],Q=Uu[u.charCodeAt(G+3)];F[A++]=N<<2|$>>4,F[A++]=($&15)<<4|Z>>2,F[A++]=(Z&3)<<6|Q&63}return w}function y0(u){u=u||"utf8";let D;try{D=new TextDecoder(u)}catch(B){D=new TextDecoder("windows-1252")}return D}async function o2(u){if("arrayBuffer"in u)return await u.arrayBuffer();let D=new FileReader;return new Promise((B,A)=>{D.onload=function(w){B(w.target.result)},D.onerror=function(w){A(D.error)},D.readAsArrayBuffer(u)})}function TB(u){if(u>=48&&u<=57||u>=97&&u<=102||u>=65&&u<=70)return String.fromCharCode(u);return!1}function Cx(u,D,B){let A=u.indexOf("*");if(A>=0)u=u.substr(0,A);D=D.toUpperCase();let w;if(D==="Q"){B=B.replace(/=\s+([0-9a-fA-F])/g,"=$1").replace(/[_\s]/g," ");let F=t2.encode(B),G=[];for(let $=0,Z=F.length;$<Z;$++){let Q=F[$];if($<=Z-2&&Q===61){let J=TB(F[$+1]),v=TB(F[$+2]);if(J&&v){let W=parseInt(J+v,16);G.push(W),$+=2;continue}}G.push(Q)}w=new ArrayBuffer(G.length);let N=new DataView(w);for(let $=0,Z=G.length;$<Z;$++)N.setUint8($,G[$])}else if(D==="B")w=n1(B.replace(/[^a-zA-Z0-9\+\/=]+/g,""));else w=t2.encode(B);return y0(u).decode(w)}function Q0(u){let D=!0,B=!1;while(!B){let A=(u||"").toString().replace(/(=\?([^?]+)\?[Bb]\?([^?]*)\?=)\s*(?==\?([^?]+)\?[Bb]\?[^?]*\?=)/g,(w,F,G,N,$)=>{if(!D)return w;if(G===$&&N.length%4===0&&!/=$/.test(N))return F+"__\x00JOIN\x00__";return w}).replace(/(=\?([^?]+)\?[Qq]\?[^?]*\?=)\s*(?==\?([^?]+)\?[Qq]\?[^?]*\?=)/g,(w,F,G,N)=>{if(!D)return w;if(G===N)return F+"__\x00JOIN\x00__";return w}).replace(/(\?=)?__\x00JOIN\x00__(=\?([^?]+)\?[QqBb]\?)?/g,"").replace(/(=\?[^?]+\?[QqBb]\?[^?]*\?=)\s+(?==\?[^?]+\?[QqBb]\?[^?]*\?=)/g,"$1").replace(/=\?([\w_\-*]+)\?([QqBb])\?([^?]*)\?=/g,(w,F,G,N)=>Cx(F,G,N));if(D&&A.indexOf("\uFFFD")>=0)D=!1;else return A}}function Px(u,D){D=D||"utf-8";let B=[];for(let F=0;F<u.length;F++){let G=u.charAt(F);if(G==="%"&&/^[a-f0-9]{2}/i.test(u.substr(F+1,2))){let N=u.substr(F+1,2);F+=2,B.push(parseInt(N,16))}else if(G.charCodeAt(0)>126){G=t2.encode(G);for(let N=0;N<G.length;N++)B.push(G[N])}else B.push(G.charCodeAt(0))}let A=new ArrayBuffer(B.length),w=new DataView(A);for(let F=0,G=B.length;F<G;F++)w.setUint8(F,B[F]);return y0(D).decode(A)}function IB(u){let D=new Map;Object.keys(u.params).forEach((B)=>{let A=B.match(/\*((\d+)\*?)?$/);if(!A)return;let w=B.substr(0,A.index).toLowerCase(),F=Number(A[2])||0,G;if(!D.has(w))G={charset:!1,values:[]},D.set(w,G);else G=D.get(w);let N=u.params[B];if(F===0&&A[0].charAt(A[0].length-1)==="*"&&(A=N.match(/^([^']*)'[^']*'(.*)$/)))G.charset=A[1]||"utf-8",N=A[2];G.values.push({nr:F,value:N}),delete u.params[B]}),D.forEach((B,A)=>{u.params[A]=Px(B.values.sort((w,F)=>w.nr-F.nr).map((w)=>w.value).join(""),B.charset)})}class p1{constructor(){this.chunks=[]}update(u){this.chunks.push(u),this.chunks.push(`
|
|
13
|
+
`)}finalize(){return o2(new Blob(this.chunks,{type:"application/octet-stream"}))}}class a1{constructor(u){u=u||{},this.decoder=u.decoder||new TextDecoder,this.maxChunkSize=102400,this.chunks=[],this.remainder=""}update(u){let D=this.decoder.decode(u);if(D=D.replace(/[^a-zA-Z0-9+\/]+/g,""),this.remainder+=D,this.remainder.length>=this.maxChunkSize){let B=Math.floor(this.remainder.length/4)*4,A;if(B===this.remainder.length)A=this.remainder,this.remainder="";else A=this.remainder.substr(0,B),this.remainder=this.remainder.substr(B);if(A.length)this.chunks.push(n1(A))}}finalize(){if(this.remainder&&!/^=+$/.test(this.remainder))this.chunks.push(n1(this.remainder));return o2(new Blob(this.chunks,{type:"application/octet-stream"}))}}var qB=/^=[a-f0-9]{2}$/i,kx=/(?==[a-f0-9]{2})/i,Vx=/=\r?\n/g,yx=/=[a-fA-F0-9]?$/;class s1{constructor(u){u=u||{},this.decoder=u.decoder||new TextDecoder,this.maxChunkSize=102400,this.remainder="",this.chunks=[]}decodeQPBytes(u){let D=new ArrayBuffer(u.length),B=new DataView(D);for(let A=0,w=u.length;A<w;A++)B.setUint8(A,parseInt(u[A],16));return D}decodeChunks(u){u=u.replace(Vx,"");let D=u.split(kx),B=[];for(let A of D){if(A.charAt(0)!=="="){if(B.length)this.chunks.push(this.decodeQPBytes(B)),B=[];this.chunks.push(A);continue}if(A.length===3){if(qB.test(A))B.push(A.substr(1));else{if(B.length)this.chunks.push(this.decodeQPBytes(B)),B=[];this.chunks.push(A)}continue}if(A.length>3){let w=A.substr(0,3);if(qB.test(w))B.push(A.substr(1,2)),this.chunks.push(this.decodeQPBytes(B)),B=[],A=A.substr(3),this.chunks.push(A);else{if(B.length)this.chunks.push(this.decodeQPBytes(B)),B=[];this.chunks.push(A)}}}if(B.length)this.chunks.push(this.decodeQPBytes(B))}update(u){let D=this.decoder.decode(u)+`
|
|
14
|
+
`;if(D=this.remainder+D,D.length<this.maxChunkSize){this.remainder=D;return}this.remainder="";let B=D.match(yx);if(B){if(B.index===0){this.remainder=D;return}this.remainder=D.substr(B.index),D=D.substr(0,B.index)}this.decodeChunks(D)}finalize(){if(this.remainder.length)this.decodeChunks(this.remainder),this.remainder="";return o2(new Blob(this.chunks,{type:"application/octet-stream"}))}}var Tx=y0();class Mu{constructor(u){if(this.options=u||{},this.postalMime=this.options.postalMime,this.root=!!this.options.parentNode,this.childNodes=[],this.options.parentNode){if(this.parentNode=this.options.parentNode,this.depth=this.parentNode.depth+1,this.depth>this.options.maxNestingDepth)throw Error(`Maximum MIME nesting depth of ${this.options.maxNestingDepth} levels exceeded`);this.options.parentNode.childNodes.push(this)}else this.depth=0;this.state="header",this.headerLines=[],this.headerSize=0;let B=(this.options.parentMultipartType||null)==="digest"?"message/rfc822":"text/plain";this.contentType={value:B,default:!0},this.contentTransferEncoding={value:"8bit"},this.contentDisposition={value:""},this.headers=[],this.contentDecoder=!1}setupContentDecoder(u){if(/base64/i.test(u))this.contentDecoder=new a1;else if(/quoted-printable/i.test(u))this.contentDecoder=new s1({decoder:y0(this.contentType.parsed.params.charset)});else this.contentDecoder=new p1}async finalize(){if(this.state==="finished")return;if(this.state==="header")this.processHeaders();let u=this.postalMime.boundaries;for(let D=u.length-1;D>=0;D--)if(u[D].node===this){u.splice(D,1);break}await this.finalizeChildNodes(),this.content=this.contentDecoder?await this.contentDecoder.finalize():null,this.state="finished"}async finalizeChildNodes(){for(let u of this.childNodes)await u.finalize()}stripComments(u){let D="",B=0,A=!1,w=!1;for(let F=0;F<u.length;F++){let G=u.charAt(F);if(A){if(B===0)D+=G;A=!1;continue}if(G==="\\"){if(A=!0,B===0)D+=G;continue}if(G==='"'&&B===0){w=!w,D+=G;continue}if(!w){if(G==="("){B++;continue}if(G===")"&&B>0){B--;continue}}if(B===0)D+=G}return D}parseStructuredHeader(u){u=this.stripComments(u);let D={value:!1,params:{}},B=!1,A="",w="value",F=!1,G=!1,N;for(let $=0,Z=u.length;$<Z;$++)switch(N=u.charAt($),w){case"key":if(N==="="){B=A.trim().toLowerCase(),w="value",A="";break}A+=N;break;case"value":if(G)A+=N;else if(N==="\\"){G=!0;continue}else if(F&&N===F)F=!1;else if(!F&&N==='"')F=N;else if(!F&&N===";"){if(B===!1)D.value=A.trim();else D.params[B]=A.trim();w="key",A=""}else A+=N;G=!1;break}if(A=A.trim(),w==="value")if(B===!1)D.value=A;else D.params[B]=A;else if(A)D.params[A.toLowerCase()]="";if(D.value)D.value=D.value.toLowerCase();return IB(D),D}decodeFlowedText(u,D){return u.split(/\r?\n/).reduce((B,A)=>{if(B.endsWith(" ")&&B!=="-- "&&!B.endsWith(`
|
|
15
15
|
-- `))if(D)return B.slice(0,-1)+A;else return B+A;else return B+`
|
|
16
|
-
`+A}).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let u=
|
|
17
|
-
`+D,this.headerLines.splice(u,1)}this.rawHeaderLines=[];for(let u=this.headerLines.length-1;u>=0;u--){let D=this.headerLines[u],B=D.indexOf(":"),A=B<0?D.trim():D.substr(0,B).trim();this.rawHeaderLines.push({key:A.toLowerCase(),line:D});let w=D.replace(/\s+/g," ");B=w.indexOf(":");let F=B<0?w.trim():w.substr(0,B).trim(),
|
|
18
|
-
`,"𝔑":"\uD835\uDD11","⁠":"\u2060"," ":"\xA0","ℕ":"\u2115","⫬":"\u2AEC","≢":"\u2262","≭":"\u226D","∦":"\u2226","∉":"\u2209","≠":"\u2260","≂̸":"\u2242\u0338","∄":"\u2204","≯":"\u226F","≱":"\u2271","≧̸":"\u2267\u0338","≫̸":"\u226B\u0338","≹":"\u2279","⩾̸":"\u2A7E\u0338","≵":"\u2275","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⋪":"\u22EA","⧏̸":"\u29CF\u0338","⋬":"\u22EC","≮":"\u226E","≰":"\u2270","≸":"\u2278","≪̸":"\u226A\u0338","⩽̸":"\u2A7D\u0338","≴":"\u2274","⪢̸":"\u2AA2\u0338","⪡̸":"\u2AA1\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⋠":"\u22E0","∌":"\u220C","⋫":"\u22EB","⧐̸":"\u29D0\u0338","⋭":"\u22ED","⊏̸":"\u228F\u0338","⋢":"\u22E2","⊐̸":"\u2290\u0338","⋣":"\u22E3","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⋡":"\u22E1","≿̸":"\u227F\u0338","⊃⃒":"\u2283\u20D2","⊉":"\u2289","≁":"\u2241","≄":"\u2244","≇":"\u2247","≉":"\u2249","∤":"\u2224","𝒩":"\uD835\uDCA9","Ñ":"\xD1","Ñ":"\xD1","Ν":"\u039D","Œ":"\u0152","Ó":"\xD3","Ó":"\xD3","Ô":"\xD4","Ô":"\xD4","О":"\u041E","Ő":"\u0150","𝔒":"\uD835\uDD12","Ò":"\xD2","Ò":"\xD2","Ō":"\u014C","Ω":"\u03A9","Ο":"\u039F","𝕆":"\uD835\uDD46","“":"\u201C","‘":"\u2018","⩔":"\u2A54","𝒪":"\uD835\uDCAA","Ø":"\xD8","Ø":"\xD8","Õ":"\xD5","Õ":"\xD5","⨷":"\u2A37","Ö":"\xD6","Ö":"\xD6","‾":"\u203E","⏞":"\u23DE","⎴":"\u23B4","⏜":"\u23DC","∂":"\u2202","П":"\u041F","𝔓":"\uD835\uDD13","Φ":"\u03A6","Π":"\u03A0","±":"\xB1","ℌ":"\u210C","ℙ":"\u2119","⪻":"\u2ABB","≺":"\u227A","⪯":"\u2AAF","≼":"\u227C","≾":"\u227E","″":"\u2033","∏":"\u220F","∷":"\u2237","∝":"\u221D","𝒫":"\uD835\uDCAB","Ψ":"\u03A8",""":'"',""":'"',"𝔔":"\uD835\uDD14","ℚ":"\u211A","𝒬":"\uD835\uDCAC","⤐":"\u2910","®":"\xAE","®":"\xAE","Ŕ":"\u0154","⟫":"\u27EB","↠":"\u21A0","⤖":"\u2916","Ř":"\u0158","Ŗ":"\u0156","Р":"\u0420","ℜ":"\u211C","∋":"\u220B","⇋":"\u21CB","⥯":"\u296F","ℜ":"\u211C","Ρ":"\u03A1","⟩":"\u27E9","→":"\u2192","⇥":"\u21E5","⇄":"\u21C4","⌉":"\u2309","⟧":"\u27E7","⥝":"\u295D","⇂":"\u21C2","⥕":"\u2955","⌋":"\u230B","⊢":"\u22A2","↦":"\u21A6","⥛":"\u295B","⊳":"\u22B3","⧐":"\u29D0","⊵":"\u22B5","⥏":"\u294F","⥜":"\u295C","↾":"\u21BE","⥔":"\u2954","⇀":"\u21C0","⥓":"\u2953","⇒":"\u21D2","ℝ":"\u211D","⥰":"\u2970","⇛":"\u21DB","ℛ":"\u211B","↱":"\u21B1","⧴":"\u29F4","Щ":"\u0429","Ш":"\u0428","Ь":"\u042C","Ś":"\u015A","⪼":"\u2ABC","Š":"\u0160","Ş":"\u015E","Ŝ":"\u015C","С":"\u0421","𝔖":"\uD835\uDD16","↓":"\u2193","←":"\u2190","→":"\u2192","↑":"\u2191","Σ":"\u03A3","∘":"\u2218","𝕊":"\uD835\uDD4A","√":"\u221A","□":"\u25A1","⊓":"\u2293","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊔":"\u2294","𝒮":"\uD835\uDCAE","⋆":"\u22C6","⋐":"\u22D0","⋐":"\u22D0","⊆":"\u2286","≻":"\u227B","⪰":"\u2AB0","≽":"\u227D","≿":"\u227F","∋":"\u220B","∑":"\u2211","⋑":"\u22D1","⊃":"\u2283","⊇":"\u2287","⋑":"\u22D1","Þ":"\xDE","Þ":"\xDE","™":"\u2122","Ћ":"\u040B","Ц":"\u0426","	":"\t","Τ":"\u03A4","Ť":"\u0164","Ţ":"\u0162","Т":"\u0422","𝔗":"\uD835\uDD17","∴":"\u2234","Θ":"\u0398","  ":"\u205F\u200A"," ":"\u2009","∼":"\u223C","≃":"\u2243","≅":"\u2245","≈":"\u2248","𝕋":"\uD835\uDD4B","⃛":"\u20DB","𝒯":"\uD835\uDCAF","Ŧ":"\u0166","Ú":"\xDA","Ú":"\xDA","↟":"\u219F","⥉":"\u2949","Ў":"\u040E","Ŭ":"\u016C","Û":"\xDB","Û":"\xDB","У":"\u0423","Ű":"\u0170","𝔘":"\uD835\uDD18","Ù":"\xD9","Ù":"\xD9","Ū":"\u016A","_":"_","⏟":"\u23DF","⎵":"\u23B5","⏝":"\u23DD","⋃":"\u22C3","⊎":"\u228E","Ų":"\u0172","𝕌":"\uD835\uDD4C","↑":"\u2191","⤒":"\u2912","⇅":"\u21C5","↕":"\u2195","⥮":"\u296E","⊥":"\u22A5","↥":"\u21A5","⇑":"\u21D1","⇕":"\u21D5","↖":"\u2196","↗":"\u2197","ϒ":"\u03D2","Υ":"\u03A5","Ů":"\u016E","𝒰":"\uD835\uDCB0","Ũ":"\u0168","Ü":"\xDC","Ü":"\xDC","⊫":"\u22AB","⫫":"\u2AEB","В":"\u0412","⊩":"\u22A9","⫦":"\u2AE6","⋁":"\u22C1","‖":"\u2016","‖":"\u2016","∣":"\u2223","|":"|","❘":"\u2758","≀":"\u2240"," ":"\u200A","𝔙":"\uD835\uDD19","𝕍":"\uD835\uDD4D","𝒱":"\uD835\uDCB1","⊪":"\u22AA","Ŵ":"\u0174","⋀":"\u22C0","𝔚":"\uD835\uDD1A","𝕎":"\uD835\uDD4E","𝒲":"\uD835\uDCB2","𝔛":"\uD835\uDD1B","Ξ":"\u039E","𝕏":"\uD835\uDD4F","𝒳":"\uD835\uDCB3","Я":"\u042F","Ї":"\u0407","Ю":"\u042E","Ý":"\xDD","Ý":"\xDD","Ŷ":"\u0176","Ы":"\u042B","𝔜":"\uD835\uDD1C","𝕐":"\uD835\uDD50","𝒴":"\uD835\uDCB4","Ÿ":"\u0178","Ж":"\u0416","Ź":"\u0179","Ž":"\u017D","З":"\u0417","Ż":"\u017B","​":"\u200B","Ζ":"\u0396","ℨ":"\u2128","ℤ":"\u2124","𝒵":"\uD835\uDCB5","á":"\xE1","á":"\xE1","ă":"\u0103","∾":"\u223E","∾̳":"\u223E\u0333","∿":"\u223F","â":"\xE2","â":"\xE2","´":"\xB4","´":"\xB4","а":"\u0430","æ":"\xE6","æ":"\xE6","⁡":"\u2061","𝔞":"\uD835\uDD1E","à":"\xE0","à":"\xE0","ℵ":"\u2135","ℵ":"\u2135","α":"\u03B1","ā":"\u0101","⨿":"\u2A3F","&":"&","&":"&","∧":"\u2227","⩕":"\u2A55","⩜":"\u2A5C","⩘":"\u2A58","⩚":"\u2A5A","∠":"\u2220","⦤":"\u29A4","∠":"\u2220","∡":"\u2221","⦨":"\u29A8","⦩":"\u29A9","⦪":"\u29AA","⦫":"\u29AB","⦬":"\u29AC","⦭":"\u29AD","⦮":"\u29AE","⦯":"\u29AF","∟":"\u221F","⊾":"\u22BE","⦝":"\u299D","∢":"\u2222","Å":"\xC5","⍼":"\u237C","ą":"\u0105","𝕒":"\uD835\uDD52","≈":"\u2248","⩰":"\u2A70","⩯":"\u2A6F","≊":"\u224A","≋":"\u224B","'":"'","≈":"\u2248","≊":"\u224A","å":"\xE5","å":"\xE5","𝒶":"\uD835\uDCB6","*":"*","≈":"\u2248","≍":"\u224D","ã":"\xE3","ã":"\xE3","ä":"\xE4","ä":"\xE4","∳":"\u2233","⨑":"\u2A11","⫭":"\u2AED","≌":"\u224C","϶":"\u03F6","‵":"\u2035","∽":"\u223D","⋍":"\u22CD","⊽":"\u22BD","⌅":"\u2305","⌅":"\u2305","⎵":"\u23B5","⎶":"\u23B6","≌":"\u224C","б":"\u0431","„":"\u201E","∵":"\u2235","∵":"\u2235","⦰":"\u29B0","϶":"\u03F6","ℬ":"\u212C","β":"\u03B2","ℶ":"\u2136","≬":"\u226C","𝔟":"\uD835\uDD1F","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","⨀":"\u2A00","⨁":"\u2A01","⨂":"\u2A02","⨆":"\u2A06","★":"\u2605","▽":"\u25BD","△":"\u25B3","⨄":"\u2A04","⋁":"\u22C1","⋀":"\u22C0","⤍":"\u290D","⧫":"\u29EB","▪":"\u25AA","▴":"\u25B4","▾":"\u25BE","◂":"\u25C2","▸":"\u25B8","␣":"\u2423","▒":"\u2592","░":"\u2591","▓":"\u2593","█":"\u2588","=⃥":"=\u20E5","≡⃥":"\u2261\u20E5","⌐":"\u2310","𝕓":"\uD835\uDD53","⊥":"\u22A5","⊥":"\u22A5","⋈":"\u22C8","╗":"\u2557","╔":"\u2554","╖":"\u2556","╓":"\u2553","═":"\u2550","╦":"\u2566","╩":"\u2569","╤":"\u2564","╧":"\u2567","╝":"\u255D","╚":"\u255A","╜":"\u255C","╙":"\u2559","║":"\u2551","╬":"\u256C","╣":"\u2563","╠":"\u2560","╫":"\u256B","╢":"\u2562","╟":"\u255F","⧉":"\u29C9","╕":"\u2555","╒":"\u2552","┐":"\u2510","┌":"\u250C","─":"\u2500","╥":"\u2565","╨":"\u2568","┬":"\u252C","┴":"\u2534","⊟":"\u229F","⊞":"\u229E","⊠":"\u22A0","╛":"\u255B","╘":"\u2558","┘":"\u2518","└":"\u2514","│":"\u2502","╪":"\u256A","╡":"\u2561","╞":"\u255E","┼":"\u253C","┤":"\u2524","├":"\u251C","‵":"\u2035","˘":"\u02D8","¦":"\xA6","¦":"\xA6","𝒷":"\uD835\uDCB7","⁏":"\u204F","∽":"\u223D","⋍":"\u22CD","\":"\\","⧅":"\u29C5","⟈":"\u27C8","•":"\u2022","•":"\u2022","≎":"\u224E","⪮":"\u2AAE","≏":"\u224F","≏":"\u224F","ć":"\u0107","∩":"\u2229","⩄":"\u2A44","⩉":"\u2A49","⩋":"\u2A4B","⩇":"\u2A47","⩀":"\u2A40","∩︀":"\u2229\uFE00","⁁":"\u2041","ˇ":"\u02C7","⩍":"\u2A4D","č":"\u010D","ç":"\xE7","ç":"\xE7","ĉ":"\u0109","⩌":"\u2A4C","⩐":"\u2A50","ċ":"\u010B","¸":"\xB8","¸":"\xB8","⦲":"\u29B2","¢":"\xA2","¢":"\xA2","·":"\xB7","𝔠":"\uD835\uDD20","ч":"\u0447","✓":"\u2713","✓":"\u2713","χ":"\u03C7","○":"\u25CB","⧃":"\u29C3","ˆ":"\u02C6","≗":"\u2257","↺":"\u21BA","↻":"\u21BB","®":"\xAE","Ⓢ":"\u24C8","⊛":"\u229B","⊚":"\u229A","⊝":"\u229D","≗":"\u2257","⨐":"\u2A10","⫯":"\u2AEF","⧂":"\u29C2","♣":"\u2663","♣":"\u2663",":":":","≔":"\u2254","≔":"\u2254",",":",","@":"@","∁":"\u2201","∘":"\u2218","∁":"\u2201","ℂ":"\u2102","≅":"\u2245","⩭":"\u2A6D","∮":"\u222E","𝕔":"\uD835\uDD54","∐":"\u2210","©":"\xA9","©":"\xA9","℗":"\u2117","↵":"\u21B5","✗":"\u2717","𝒸":"\uD835\uDCB8","⫏":"\u2ACF","⫑":"\u2AD1","⫐":"\u2AD0","⫒":"\u2AD2","⋯":"\u22EF","⤸":"\u2938","⤵":"\u2935","⋞":"\u22DE","⋟":"\u22DF","↶":"\u21B6","⤽":"\u293D","∪":"\u222A","⩈":"\u2A48","⩆":"\u2A46","⩊":"\u2A4A","⊍":"\u228D","⩅":"\u2A45","∪︀":"\u222A\uFE00","↷":"\u21B7","⤼":"\u293C","⋞":"\u22DE","⋟":"\u22DF","⋎":"\u22CE","⋏":"\u22CF","¤":"\xA4","¤":"\xA4","↶":"\u21B6","↷":"\u21B7","⋎":"\u22CE","⋏":"\u22CF","∲":"\u2232","∱":"\u2231","⌭":"\u232D","⇓":"\u21D3","⥥":"\u2965","†":"\u2020","ℸ":"\u2138","↓":"\u2193","‐":"\u2010","⊣":"\u22A3","⤏":"\u290F","˝":"\u02DD","ď":"\u010F","д":"\u0434","ⅆ":"\u2146","‡":"\u2021","⇊":"\u21CA","⩷":"\u2A77","°":"\xB0","°":"\xB0","δ":"\u03B4","⦱":"\u29B1","⥿":"\u297F","𝔡":"\uD835\uDD21","⇃":"\u21C3","⇂":"\u21C2","⋄":"\u22C4","⋄":"\u22C4","♦":"\u2666","♦":"\u2666","¨":"\xA8","ϝ":"\u03DD","⋲":"\u22F2","÷":"\xF7","÷":"\xF7","÷":"\xF7","⋇":"\u22C7","⋇":"\u22C7","ђ":"\u0452","⌞":"\u231E","⌍":"\u230D","$":"$","𝕕":"\uD835\uDD55","˙":"\u02D9","≐":"\u2250","≑":"\u2251","∸":"\u2238","∔":"\u2214","⊡":"\u22A1","⌆":"\u2306","↓":"\u2193","⇊":"\u21CA","⇃":"\u21C3","⇂":"\u21C2","⤐":"\u2910","⌟":"\u231F","⌌":"\u230C","𝒹":"\uD835\uDCB9","ѕ":"\u0455","⧶":"\u29F6","đ":"\u0111","⋱":"\u22F1","▿":"\u25BF","▾":"\u25BE","⇵":"\u21F5","⥯":"\u296F","⦦":"\u29A6","џ":"\u045F","⟿":"\u27FF","⩷":"\u2A77","≑":"\u2251","é":"\xE9","é":"\xE9","⩮":"\u2A6E","ě":"\u011B","≖":"\u2256","ê":"\xEA","ê":"\xEA","≕":"\u2255","э":"\u044D","ė":"\u0117","ⅇ":"\u2147","≒":"\u2252","𝔢":"\uD835\uDD22","⪚":"\u2A9A","è":"\xE8","è":"\xE8","⪖":"\u2A96","⪘":"\u2A98","⪙":"\u2A99","⏧":"\u23E7","ℓ":"\u2113","⪕":"\u2A95","⪗":"\u2A97","ē":"\u0113","∅":"\u2205","∅":"\u2205","∅":"\u2205"," ":"\u2004"," ":"\u2005"," ":"\u2003","ŋ":"\u014B"," ":"\u2002","ę":"\u0119","𝕖":"\uD835\uDD56","⋕":"\u22D5","⧣":"\u29E3","⩱":"\u2A71","ε":"\u03B5","ε":"\u03B5","ϵ":"\u03F5","≖":"\u2256","≕":"\u2255","≂":"\u2242","⪖":"\u2A96","⪕":"\u2A95","=":"=","≟":"\u225F","≡":"\u2261","⩸":"\u2A78","⧥":"\u29E5","≓":"\u2253","⥱":"\u2971","ℯ":"\u212F","≐":"\u2250","≂":"\u2242","η":"\u03B7","ð":"\xF0","ð":"\xF0","ë":"\xEB","ë":"\xEB","€":"\u20AC","!":"!","∃":"\u2203","ℰ":"\u2130","ⅇ":"\u2147","≒":"\u2252","ф":"\u0444","♀":"\u2640","ffi":"\uFB03","ff":"\uFB00","ffl":"\uFB04","𝔣":"\uD835\uDD23","fi":"\uFB01","fj":"fj","♭":"\u266D","fl":"\uFB02","▱":"\u25B1","ƒ":"\u0192","𝕗":"\uD835\uDD57","∀":"\u2200","⋔":"\u22D4","⫙":"\u2AD9","⨍":"\u2A0D","½":"\xBD","½":"\xBD","⅓":"\u2153","¼":"\xBC","¼":"\xBC","⅕":"\u2155","⅙":"\u2159","⅛":"\u215B","⅔":"\u2154","⅖":"\u2156","¾":"\xBE","¾":"\xBE","⅗":"\u2157","⅜":"\u215C","⅘":"\u2158","⅚":"\u215A","⅝":"\u215D","⅞":"\u215E","⁄":"\u2044","⌢":"\u2322","𝒻":"\uD835\uDCBB","≧":"\u2267","⪌":"\u2A8C","ǵ":"\u01F5","γ":"\u03B3","ϝ":"\u03DD","⪆":"\u2A86","ğ":"\u011F","ĝ":"\u011D","г":"\u0433","ġ":"\u0121","≥":"\u2265","⋛":"\u22DB","≥":"\u2265","≧":"\u2267","⩾":"\u2A7E","⩾":"\u2A7E","⪩":"\u2AA9","⪀":"\u2A80","⪂":"\u2A82","⪄":"\u2A84","⋛︀":"\u22DB\uFE00","⪔":"\u2A94","𝔤":"\uD835\uDD24","≫":"\u226B","⋙":"\u22D9","ℷ":"\u2137","ѓ":"\u0453","≷":"\u2277","⪒":"\u2A92","⪥":"\u2AA5","⪤":"\u2AA4","≩":"\u2269","⪊":"\u2A8A","⪊":"\u2A8A","⪈":"\u2A88","⪈":"\u2A88","≩":"\u2269","⋧":"\u22E7","𝕘":"\uD835\uDD58","`":"`","ℊ":"\u210A","≳":"\u2273","⪎":"\u2A8E","⪐":"\u2A90",">":">",">":">","⪧":"\u2AA7","⩺":"\u2A7A","⋗":"\u22D7","⦕":"\u2995","⩼":"\u2A7C","⪆":"\u2A86","⥸":"\u2978","⋗":"\u22D7","⋛":"\u22DB","⪌":"\u2A8C","≷":"\u2277","≳":"\u2273","≩︀":"\u2269\uFE00","≩︀":"\u2269\uFE00","⇔":"\u21D4"," ":"\u200A","½":"\xBD","ℋ":"\u210B","ъ":"\u044A","↔":"\u2194","⥈":"\u2948","↭":"\u21AD","ℏ":"\u210F","ĥ":"\u0125","♥":"\u2665","♥":"\u2665","…":"\u2026","⊹":"\u22B9","𝔥":"\uD835\uDD25","⤥":"\u2925","⤦":"\u2926","⇿":"\u21FF","∻":"\u223B","↩":"\u21A9","↪":"\u21AA","𝕙":"\uD835\uDD59","―":"\u2015","𝒽":"\uD835\uDCBD","ℏ":"\u210F","ħ":"\u0127","⁃":"\u2043","‐":"\u2010","í":"\xED","í":"\xED","⁣":"\u2063","î":"\xEE","î":"\xEE","и":"\u0438","е":"\u0435","¡":"\xA1","¡":"\xA1","⇔":"\u21D4","𝔦":"\uD835\uDD26","ì":"\xEC","ì":"\xEC","ⅈ":"\u2148","⨌":"\u2A0C","∭":"\u222D","⧜":"\u29DC","℩":"\u2129","ij":"\u0133","ī":"\u012B","ℑ":"\u2111","ℐ":"\u2110","ℑ":"\u2111","ı":"\u0131","⊷":"\u22B7","Ƶ":"\u01B5","∈":"\u2208","℅":"\u2105","∞":"\u221E","⧝":"\u29DD","ı":"\u0131","∫":"\u222B","⊺":"\u22BA","ℤ":"\u2124","⊺":"\u22BA","⨗":"\u2A17","⨼":"\u2A3C","ё":"\u0451","į":"\u012F","𝕚":"\uD835\uDD5A","ι":"\u03B9","⨼":"\u2A3C","¿":"\xBF","¿":"\xBF","𝒾":"\uD835\uDCBE","∈":"\u2208","⋹":"\u22F9","⋵":"\u22F5","⋴":"\u22F4","⋳":"\u22F3","∈":"\u2208","⁢":"\u2062","ĩ":"\u0129","і":"\u0456","ï":"\xEF","ï":"\xEF","ĵ":"\u0135","й":"\u0439","𝔧":"\uD835\uDD27","ȷ":"\u0237","𝕛":"\uD835\uDD5B","𝒿":"\uD835\uDCBF","ј":"\u0458","є":"\u0454","κ":"\u03BA","ϰ":"\u03F0","ķ":"\u0137","к":"\u043A","𝔨":"\uD835\uDD28","ĸ":"\u0138","х":"\u0445","ќ":"\u045C","𝕜":"\uD835\uDD5C","𝓀":"\uD835\uDCC0","⇚":"\u21DA","⇐":"\u21D0","⤛":"\u291B","⤎":"\u290E","≦":"\u2266","⪋":"\u2A8B","⥢":"\u2962","ĺ":"\u013A","⦴":"\u29B4","ℒ":"\u2112","λ":"\u03BB","⟨":"\u27E8","⦑":"\u2991","⟨":"\u27E8","⪅":"\u2A85","«":"\xAB","«":"\xAB","←":"\u2190","⇤":"\u21E4","⤟":"\u291F","⤝":"\u291D","↩":"\u21A9","↫":"\u21AB","⤹":"\u2939","⥳":"\u2973","↢":"\u21A2","⪫":"\u2AAB","⤙":"\u2919","⪭":"\u2AAD","⪭︀":"\u2AAD\uFE00","⤌":"\u290C","❲":"\u2772","{":"{","[":"[","⦋":"\u298B","⦏":"\u298F","⦍":"\u298D","ľ":"\u013E","ļ":"\u013C","⌈":"\u2308","{":"{","л":"\u043B","⤶":"\u2936","“":"\u201C","„":"\u201E","⥧":"\u2967","⥋":"\u294B","↲":"\u21B2","≤":"\u2264","←":"\u2190","↢":"\u21A2","↽":"\u21BD","↼":"\u21BC","⇇":"\u21C7","↔":"\u2194","⇆":"\u21C6","⇋":"\u21CB","↭":"\u21AD","⋋":"\u22CB","⋚":"\u22DA","≤":"\u2264","≦":"\u2266","⩽":"\u2A7D","⩽":"\u2A7D","⪨":"\u2AA8","⩿":"\u2A7F","⪁":"\u2A81","⪃":"\u2A83","⋚︀":"\u22DA\uFE00","⪓":"\u2A93","⪅":"\u2A85","⋖":"\u22D6","⋚":"\u22DA","⪋":"\u2A8B","≶":"\u2276","≲":"\u2272","⥼":"\u297C","⌊":"\u230A","𝔩":"\uD835\uDD29","≶":"\u2276","⪑":"\u2A91","↽":"\u21BD","↼":"\u21BC","⥪":"\u296A","▄":"\u2584","љ":"\u0459","≪":"\u226A","⇇":"\u21C7","⌞":"\u231E","⥫":"\u296B","◺":"\u25FA","ŀ":"\u0140","⎰":"\u23B0","⎰":"\u23B0","≨":"\u2268","⪉":"\u2A89","⪉":"\u2A89","⪇":"\u2A87","⪇":"\u2A87","≨":"\u2268","⋦":"\u22E6","⟬":"\u27EC","⇽":"\u21FD","⟦":"\u27E6","⟵":"\u27F5","⟷":"\u27F7","⟼":"\u27FC","⟶":"\u27F6","↫":"\u21AB","↬":"\u21AC","⦅":"\u2985","𝕝":"\uD835\uDD5D","⨭":"\u2A2D","⨴":"\u2A34","∗":"\u2217","_":"_","◊":"\u25CA","◊":"\u25CA","⧫":"\u29EB","(":"(","⦓":"\u2993","⇆":"\u21C6","⌟":"\u231F","⇋":"\u21CB","⥭":"\u296D","‎":"\u200E","⊿":"\u22BF","‹":"\u2039","𝓁":"\uD835\uDCC1","↰":"\u21B0","≲":"\u2272","⪍":"\u2A8D","⪏":"\u2A8F","[":"[","‘":"\u2018","‚":"\u201A","ł":"\u0142","<":"<","<":"<","⪦":"\u2AA6","⩹":"\u2A79","⋖":"\u22D6","⋋":"\u22CB","⋉":"\u22C9","⥶":"\u2976","⩻":"\u2A7B","⦖":"\u2996","◃":"\u25C3","⊴":"\u22B4","◂":"\u25C2","⥊":"\u294A","⥦":"\u2966","≨︀":"\u2268\uFE00","≨︀":"\u2268\uFE00","∺":"\u223A","¯":"\xAF","¯":"\xAF","♂":"\u2642","✠":"\u2720","✠":"\u2720","↦":"\u21A6","↦":"\u21A6","↧":"\u21A7","↤":"\u21A4","↥":"\u21A5","▮":"\u25AE","⨩":"\u2A29","м":"\u043C","—":"\u2014","∡":"\u2221","𝔪":"\uD835\uDD2A","℧":"\u2127","µ":"\xB5","µ":"\xB5","∣":"\u2223","*":"*","⫰":"\u2AF0","·":"\xB7","·":"\xB7","−":"\u2212","⊟":"\u229F","∸":"\u2238","⨪":"\u2A2A","⫛":"\u2ADB","…":"\u2026","∓":"\u2213","⊧":"\u22A7","𝕞":"\uD835\uDD5E","∓":"\u2213","𝓂":"\uD835\uDCC2","∾":"\u223E","μ":"\u03BC","⊸":"\u22B8","⊸":"\u22B8","⋙̸":"\u22D9\u0338","≫⃒":"\u226B\u20D2","≫̸":"\u226B\u0338","⇍":"\u21CD","⇎":"\u21CE","⋘̸":"\u22D8\u0338","≪⃒":"\u226A\u20D2","≪̸":"\u226A\u0338","⇏":"\u21CF","⊯":"\u22AF","⊮":"\u22AE","∇":"\u2207","ń":"\u0144","∠⃒":"\u2220\u20D2","≉":"\u2249","⩰̸":"\u2A70\u0338","≋̸":"\u224B\u0338","ʼn":"\u0149","≉":"\u2249","♮":"\u266E","♮":"\u266E","ℕ":"\u2115"," ":"\xA0"," ":"\xA0","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⩃":"\u2A43","ň":"\u0148","ņ":"\u0146","≇":"\u2247","⩭̸":"\u2A6D\u0338","⩂":"\u2A42","н":"\u043D","–":"\u2013","≠":"\u2260","⇗":"\u21D7","⤤":"\u2924","↗":"\u2197","↗":"\u2197","≐̸":"\u2250\u0338","≢":"\u2262","⤨":"\u2928","≂̸":"\u2242\u0338","∄":"\u2204","∄":"\u2204","𝔫":"\uD835\uDD2B","≧̸":"\u2267\u0338","≱":"\u2271","≱":"\u2271","≧̸":"\u2267\u0338","⩾̸":"\u2A7E\u0338","⩾̸":"\u2A7E\u0338","≵":"\u2275","≯":"\u226F","≯":"\u226F","⇎":"\u21CE","↮":"\u21AE","⫲":"\u2AF2","∋":"\u220B","⋼":"\u22FC","⋺":"\u22FA","∋":"\u220B","њ":"\u045A","⇍":"\u21CD","≦̸":"\u2266\u0338","↚":"\u219A","‥":"\u2025","≰":"\u2270","↚":"\u219A","↮":"\u21AE","≰":"\u2270","≦̸":"\u2266\u0338","⩽̸":"\u2A7D\u0338","⩽̸":"\u2A7D\u0338","≮":"\u226E","≴":"\u2274","≮":"\u226E","⋪":"\u22EA","⋬":"\u22EC","∤":"\u2224","𝕟":"\uD835\uDD5F","¬":"\xAC","¬":"\xAC","∉":"\u2209","⋹̸":"\u22F9\u0338","⋵̸":"\u22F5\u0338","∉":"\u2209","⋷":"\u22F7","⋶":"\u22F6","∌":"\u220C","∌":"\u220C","⋾":"\u22FE","⋽":"\u22FD","∦":"\u2226","∦":"\u2226","⫽⃥":"\u2AFD\u20E5","∂̸":"\u2202\u0338","⨔":"\u2A14","⊀":"\u2280","⋠":"\u22E0","⪯̸":"\u2AAF\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⇏":"\u21CF","↛":"\u219B","⤳̸":"\u2933\u0338","↝̸":"\u219D\u0338","↛":"\u219B","⋫":"\u22EB","⋭":"\u22ED","⊁":"\u2281","⋡":"\u22E1","⪰̸":"\u2AB0\u0338","𝓃":"\uD835\uDCC3","∤":"\u2224","∦":"\u2226","≁":"\u2241","≄":"\u2244","≄":"\u2244","∤":"\u2224","∦":"\u2226","⋢":"\u22E2","⋣":"\u22E3","⊄":"\u2284","⫅̸":"\u2AC5\u0338","⊈":"\u2288","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⫅̸":"\u2AC5\u0338","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⊅":"\u2285","⫆̸":"\u2AC6\u0338","⊉":"\u2289","⊃⃒":"\u2283\u20D2","⊉":"\u2289","⫆̸":"\u2AC6\u0338","≹":"\u2279","ñ":"\xF1","ñ":"\xF1","≸":"\u2278","⋪":"\u22EA","⋬":"\u22EC","⋫":"\u22EB","⋭":"\u22ED","ν":"\u03BD","#":"#","№":"\u2116"," ":"\u2007","⊭":"\u22AD","⤄":"\u2904","≍⃒":"\u224D\u20D2","⊬":"\u22AC","≥⃒":"\u2265\u20D2",">⃒":">\u20D2","⧞":"\u29DE","⤂":"\u2902","≤⃒":"\u2264\u20D2","<⃒":"<\u20D2","⊴⃒":"\u22B4\u20D2","⤃":"\u2903","⊵⃒":"\u22B5\u20D2","∼⃒":"\u223C\u20D2","⇖":"\u21D6","⤣":"\u2923","↖":"\u2196","↖":"\u2196","⤧":"\u2927","Ⓢ":"\u24C8","ó":"\xF3","ó":"\xF3","⊛":"\u229B","⊚":"\u229A","ô":"\xF4","ô":"\xF4","о":"\u043E","⊝":"\u229D","ő":"\u0151","⨸":"\u2A38","⊙":"\u2299","⦼":"\u29BC","œ":"\u0153","⦿":"\u29BF","𝔬":"\uD835\uDD2C","˛":"\u02DB","ò":"\xF2","ò":"\xF2","⧁":"\u29C1","⦵":"\u29B5","Ω":"\u03A9","∮":"\u222E","↺":"\u21BA","⦾":"\u29BE","⦻":"\u29BB","‾":"\u203E","⧀":"\u29C0","ō":"\u014D","ω":"\u03C9","ο":"\u03BF","⦶":"\u29B6","⊖":"\u2296","𝕠":"\uD835\uDD60","⦷":"\u29B7","⦹":"\u29B9","⊕":"\u2295","∨":"\u2228","↻":"\u21BB","⩝":"\u2A5D","ℴ":"\u2134","ℴ":"\u2134","ª":"\xAA","ª":"\xAA","º":"\xBA","º":"\xBA","⊶":"\u22B6","⩖":"\u2A56","⩗":"\u2A57","⩛":"\u2A5B","ℴ":"\u2134","ø":"\xF8","ø":"\xF8","⊘":"\u2298","õ":"\xF5","õ":"\xF5","⊗":"\u2297","⨶":"\u2A36","ö":"\xF6","ö":"\xF6","⌽":"\u233D","∥":"\u2225","¶":"\xB6","¶":"\xB6","∥":"\u2225","⫳":"\u2AF3","⫽":"\u2AFD","∂":"\u2202","п":"\u043F","%":"%",".":".","‰":"\u2030","⊥":"\u22A5","‱":"\u2031","𝔭":"\uD835\uDD2D","φ":"\u03C6","ϕ":"\u03D5","ℳ":"\u2133","☎":"\u260E","π":"\u03C0","⋔":"\u22D4","ϖ":"\u03D6","ℏ":"\u210F","ℎ":"\u210E","ℏ":"\u210F","+":"+","⨣":"\u2A23","⊞":"\u229E","⨢":"\u2A22","∔":"\u2214","⨥":"\u2A25","⩲":"\u2A72","±":"\xB1","±":"\xB1","⨦":"\u2A26","⨧":"\u2A27","±":"\xB1","⨕":"\u2A15","𝕡":"\uD835\uDD61","£":"\xA3","£":"\xA3","≺":"\u227A","⪳":"\u2AB3","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","≺":"\u227A","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","⪹":"\u2AB9","⪵":"\u2AB5","⋨":"\u22E8","≾":"\u227E","′":"\u2032","ℙ":"\u2119","⪵":"\u2AB5","⪹":"\u2AB9","⋨":"\u22E8","∏":"\u220F","⌮":"\u232E","⌒":"\u2312","⌓":"\u2313","∝":"\u221D","∝":"\u221D","≾":"\u227E","⊰":"\u22B0","𝓅":"\uD835\uDCC5","ψ":"\u03C8"," ":"\u2008","𝔮":"\uD835\uDD2E","⨌":"\u2A0C","𝕢":"\uD835\uDD62","⁗":"\u2057","𝓆":"\uD835\uDCC6","ℍ":"\u210D","⨖":"\u2A16","?":"?","≟":"\u225F",""":'"',""":'"',"⇛":"\u21DB","⇒":"\u21D2","⤜":"\u291C","⤏":"\u290F","⥤":"\u2964","∽̱":"\u223D\u0331","ŕ":"\u0155","√":"\u221A","⦳":"\u29B3","⟩":"\u27E9","⦒":"\u2992","⦥":"\u29A5","⟩":"\u27E9","»":"\xBB","»":"\xBB","→":"\u2192","⥵":"\u2975","⇥":"\u21E5","⤠":"\u2920","⤳":"\u2933","⤞":"\u291E","↪":"\u21AA","↬":"\u21AC","⥅":"\u2945","⥴":"\u2974","↣":"\u21A3","↝":"\u219D","⤚":"\u291A","∶":"\u2236","ℚ":"\u211A","⤍":"\u290D","❳":"\u2773","}":"}","]":"]","⦌":"\u298C","⦎":"\u298E","⦐":"\u2990","ř":"\u0159","ŗ":"\u0157","⌉":"\u2309","}":"}","р":"\u0440","⤷":"\u2937","⥩":"\u2969","”":"\u201D","”":"\u201D","↳":"\u21B3","ℜ":"\u211C","ℛ":"\u211B","ℜ":"\u211C","ℝ":"\u211D","▭":"\u25AD","®":"\xAE","®":"\xAE","⥽":"\u297D","⌋":"\u230B","𝔯":"\uD835\uDD2F","⇁":"\u21C1","⇀":"\u21C0","⥬":"\u296C","ρ":"\u03C1","ϱ":"\u03F1","→":"\u2192","↣":"\u21A3","⇁":"\u21C1","⇀":"\u21C0","⇄":"\u21C4","⇌":"\u21CC","⇉":"\u21C9","↝":"\u219D","⋌":"\u22CC","˚":"\u02DA","≓":"\u2253","⇄":"\u21C4","⇌":"\u21CC","‏":"\u200F","⎱":"\u23B1","⎱":"\u23B1","⫮":"\u2AEE","⟭":"\u27ED","⇾":"\u21FE","⟧":"\u27E7","⦆":"\u2986","𝕣":"\uD835\uDD63","⨮":"\u2A2E","⨵":"\u2A35",")":")","⦔":"\u2994","⨒":"\u2A12","⇉":"\u21C9","›":"\u203A","𝓇":"\uD835\uDCC7","↱":"\u21B1","]":"]","’":"\u2019","’":"\u2019","⋌":"\u22CC","⋊":"\u22CA","▹":"\u25B9","⊵":"\u22B5","▸":"\u25B8","⧎":"\u29CE","⥨":"\u2968","℞":"\u211E","ś":"\u015B","‚":"\u201A","≻":"\u227B","⪴":"\u2AB4","⪸":"\u2AB8","š":"\u0161","≽":"\u227D","⪰":"\u2AB0","ş":"\u015F","ŝ":"\u015D","⪶":"\u2AB6","⪺":"\u2ABA","⋩":"\u22E9","⨓":"\u2A13","≿":"\u227F","с":"\u0441","⋅":"\u22C5","⊡":"\u22A1","⩦":"\u2A66","⇘":"\u21D8","⤥":"\u2925","↘":"\u2198","↘":"\u2198","§":"\xA7","§":"\xA7",";":";","⤩":"\u2929","∖":"\u2216","∖":"\u2216","✶":"\u2736","𝔰":"\uD835\uDD30","⌢":"\u2322","♯":"\u266F","щ":"\u0449","ш":"\u0448","∣":"\u2223","∥":"\u2225","­":"\xAD","­":"\xAD","σ":"\u03C3","ς":"\u03C2","ς":"\u03C2","∼":"\u223C","⩪":"\u2A6A","≃":"\u2243","≃":"\u2243","⪞":"\u2A9E","⪠":"\u2AA0","⪝":"\u2A9D","⪟":"\u2A9F","≆":"\u2246","⨤":"\u2A24","⥲":"\u2972","←":"\u2190","∖":"\u2216","⨳":"\u2A33","⧤":"\u29E4","∣":"\u2223","⌣":"\u2323","⪪":"\u2AAA","⪬":"\u2AAC","⪬︀":"\u2AAC\uFE00","ь":"\u044C","/":"/","⧄":"\u29C4","⌿":"\u233F","𝕤":"\uD835\uDD64","♠":"\u2660","♠":"\u2660","∥":"\u2225","⊓":"\u2293","⊓︀":"\u2293\uFE00","⊔":"\u2294","⊔︀":"\u2294\uFE00","⊏":"\u228F","⊑":"\u2291","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊐":"\u2290","⊒":"\u2292","□":"\u25A1","□":"\u25A1","▪":"\u25AA","▪":"\u25AA","→":"\u2192","𝓈":"\uD835\uDCC8","∖":"\u2216","⌣":"\u2323","⋆":"\u22C6","☆":"\u2606","★":"\u2605","ϵ":"\u03F5","ϕ":"\u03D5","¯":"\xAF","⊂":"\u2282","⫅":"\u2AC5","⪽":"\u2ABD","⊆":"\u2286","⫃":"\u2AC3","⫁":"\u2AC1","⫋":"\u2ACB","⊊":"\u228A","⪿":"\u2ABF","⥹":"\u2979","⊂":"\u2282","⊆":"\u2286","⫅":"\u2AC5","⊊":"\u228A","⫋":"\u2ACB","⫇":"\u2AC7","⫕":"\u2AD5","⫓":"\u2AD3","≻":"\u227B","⪸":"\u2AB8","≽":"\u227D","⪰":"\u2AB0","⪺":"\u2ABA","⪶":"\u2AB6","⋩":"\u22E9","≿":"\u227F","∑":"\u2211","♪":"\u266A","¹":"\xB9","¹":"\xB9","²":"\xB2","²":"\xB2","³":"\xB3","³":"\xB3","⊃":"\u2283","⫆":"\u2AC6","⪾":"\u2ABE","⫘":"\u2AD8","⊇":"\u2287","⫄":"\u2AC4","⟉":"\u27C9","⫗":"\u2AD7","⥻":"\u297B","⫂":"\u2AC2","⫌":"\u2ACC","⊋":"\u228B","⫀":"\u2AC0","⊃":"\u2283","⊇":"\u2287","⫆":"\u2AC6","⊋":"\u228B","⫌":"\u2ACC","⫈":"\u2AC8","⫔":"\u2AD4","⫖":"\u2AD6","⇙":"\u21D9","⤦":"\u2926","↙":"\u2199","↙":"\u2199","⤪":"\u292A","ß":"\xDF","ß":"\xDF","⌖":"\u2316","τ":"\u03C4","⎴":"\u23B4","ť":"\u0165","ţ":"\u0163","т":"\u0442","⃛":"\u20DB","⌕":"\u2315","𝔱":"\uD835\uDD31","∴":"\u2234","∴":"\u2234","θ":"\u03B8","ϑ":"\u03D1","ϑ":"\u03D1","≈":"\u2248","∼":"\u223C"," ":"\u2009","≈":"\u2248","∼":"\u223C","þ":"\xFE","þ":"\xFE","˜":"\u02DC","×":"\xD7","×":"\xD7","⊠":"\u22A0","⨱":"\u2A31","⨰":"\u2A30","∭":"\u222D","⤨":"\u2928","⊤":"\u22A4","⌶":"\u2336","⫱":"\u2AF1","𝕥":"\uD835\uDD65","⫚":"\u2ADA","⤩":"\u2929","‴":"\u2034","™":"\u2122","▵":"\u25B5","▿":"\u25BF","◃":"\u25C3","⊴":"\u22B4","≜":"\u225C","▹":"\u25B9","⊵":"\u22B5","◬":"\u25EC","≜":"\u225C","⨺":"\u2A3A","⨹":"\u2A39","⧍":"\u29CD","⨻":"\u2A3B","⏢":"\u23E2","𝓉":"\uD835\uDCC9","ц":"\u0446","ћ":"\u045B","ŧ":"\u0167","≬":"\u226C","↞":"\u219E","↠":"\u21A0","⇑":"\u21D1","⥣":"\u2963","ú":"\xFA","ú":"\xFA","↑":"\u2191","ў":"\u045E","ŭ":"\u016D","û":"\xFB","û":"\xFB","у":"\u0443","⇅":"\u21C5","ű":"\u0171","⥮":"\u296E","⥾":"\u297E","𝔲":"\uD835\uDD32","ù":"\xF9","ù":"\xF9","↿":"\u21BF","↾":"\u21BE","▀":"\u2580","⌜":"\u231C","⌜":"\u231C","⌏":"\u230F","◸":"\u25F8","ū":"\u016B","¨":"\xA8","¨":"\xA8","ų":"\u0173","𝕦":"\uD835\uDD66","↑":"\u2191","↕":"\u2195","↿":"\u21BF","↾":"\u21BE","⊎":"\u228E","υ":"\u03C5","ϒ":"\u03D2","υ":"\u03C5","⇈":"\u21C8","⌝":"\u231D","⌝":"\u231D","⌎":"\u230E","ů":"\u016F","◹":"\u25F9","𝓊":"\uD835\uDCCA","⋰":"\u22F0","ũ":"\u0169","▵":"\u25B5","▴":"\u25B4","⇈":"\u21C8","ü":"\xFC","ü":"\xFC","⦧":"\u29A7","⇕":"\u21D5","⫨":"\u2AE8","⫩":"\u2AE9","⊨":"\u22A8","⦜":"\u299C","ϵ":"\u03F5","ϰ":"\u03F0","∅":"\u2205","ϕ":"\u03D5","ϖ":"\u03D6","∝":"\u221D","↕":"\u2195","ϱ":"\u03F1","ς":"\u03C2","⊊︀":"\u228A\uFE00","⫋︀":"\u2ACB\uFE00","⊋︀":"\u228B\uFE00","⫌︀":"\u2ACC\uFE00","ϑ":"\u03D1","⊲":"\u22B2","⊳":"\u22B3","в":"\u0432","⊢":"\u22A2","∨":"\u2228","⊻":"\u22BB","≚":"\u225A","⋮":"\u22EE","|":"|","|":"|","𝔳":"\uD835\uDD33","⊲":"\u22B2","⊂⃒":"\u2282\u20D2","⊃⃒":"\u2283\u20D2","𝕧":"\uD835\uDD67","∝":"\u221D","⊳":"\u22B3","𝓋":"\uD835\uDCCB","⫋︀":"\u2ACB\uFE00","⊊︀":"\u228A\uFE00","⫌︀":"\u2ACC\uFE00","⊋︀":"\u228B\uFE00","⦚":"\u299A","ŵ":"\u0175","⩟":"\u2A5F","∧":"\u2227","≙":"\u2259","℘":"\u2118","𝔴":"\uD835\uDD34","𝕨":"\uD835\uDD68","℘":"\u2118","≀":"\u2240","≀":"\u2240","𝓌":"\uD835\uDCCC","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","▽":"\u25BD","𝔵":"\uD835\uDD35","⟺":"\u27FA","⟷":"\u27F7","ξ":"\u03BE","⟸":"\u27F8","⟵":"\u27F5","⟼":"\u27FC","⋻":"\u22FB","⨀":"\u2A00","𝕩":"\uD835\uDD69","⨁":"\u2A01","⨂":"\u2A02","⟹":"\u27F9","⟶":"\u27F6","𝓍":"\uD835\uDCCD","⨆":"\u2A06","⨄":"\u2A04","△":"\u25B3","⋁":"\u22C1","⋀":"\u22C0","ý":"\xFD","ý":"\xFD","я":"\u044F","ŷ":"\u0177","ы":"\u044B","¥":"\xA5","¥":"\xA5","𝔶":"\uD835\uDD36","ї":"\u0457","𝕪":"\uD835\uDD6A","𝓎":"\uD835\uDCCE","ю":"\u044E","ÿ":"\xFF","ÿ":"\xFF","ź":"\u017A","ž":"\u017E","з":"\u0437","ż":"\u017C","ℨ":"\u2128","ζ":"\u03B6","𝔷":"\uD835\uDD37","ж":"\u0436","⇝":"\u21DD","𝕫":"\uD835\uDD6B","𝓏":"\uD835\uDCCF","‍":"\u200D","‌":"\u200C"},_3=Kx;function xx(u){return u.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(D,B)=>{if(typeof _3[D]==="string")return _3[D];if(B.charAt(0)!=="#"||D.charAt(D.length-1)!==";")return D;let A;if(B.charAt(1)==="x")A=parseInt(B.substr(2),16);else A=parseInt(B.substr(1),10);let w="";if(A>=55296&&A<=57343||A>1114111)return"\uFFFD";if(A>65535)A-=65536,w+=String.fromCharCode(A>>>10&1023|55296),A=56320|A&1023;return w+=String.fromCharCode(A),w})}function v0(u){return u.trim().replace(/[<>"'?&]/g,(D)=>{let B=D.charCodeAt(0).toString(16);if(B.length<2)B="0"+B;return"&#x"+B.toUpperCase()+";"})}function M6(u){return"<div>"+v0(u).replace(/\n/g,"<br />")+"</div>"}function L6(u){return u=u.replace(/\r?\n/g,"\x01").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
16
|
+
`+A}).replace(/^ /gm,"")}getTextContent(){if(!this.content)return"";let u=y0(this.contentType.parsed.params.charset).decode(this.content);if(/^flowed$/i.test(this.contentType.parsed.params.format))u=this.decodeFlowedText(u,/^yes$/i.test(this.contentType.parsed.params.delsp));return u}processHeaders(){for(let u=this.headerLines.length-1;u>=0;u--){let D=this.headerLines[u];if(u&&/^\s/.test(D))this.headerLines[u-1]+=`
|
|
17
|
+
`+D,this.headerLines.splice(u,1)}this.rawHeaderLines=[];for(let u=this.headerLines.length-1;u>=0;u--){let D=this.headerLines[u],B=D.indexOf(":"),A=B<0?D.trim():D.substr(0,B).trim();this.rawHeaderLines.push({key:A.toLowerCase(),line:D});let w=D.replace(/\s+/g," ");B=w.indexOf(":");let F=B<0?w.trim():w.substr(0,B).trim(),G=B<0?"":w.substr(B+1).trim();switch(this.headers.push({key:F.toLowerCase(),originalKey:F,value:G}),F.toLowerCase()){case"content-type":if(this.contentType.default)this.contentType={value:G,parsed:{}};break;case"content-transfer-encoding":this.contentTransferEncoding={value:G,parsed:{}};break;case"content-disposition":this.contentDisposition={value:G,parsed:{}};break;case"content-id":this.contentId=G;break;case"content-description":this.contentDescription=G;break}}if(this.contentType.parsed=this.parseStructuredHeader(this.contentType.value),this.contentType.multipart=/^multipart\//i.test(this.contentType.parsed.value)?this.contentType.parsed.value.substr(this.contentType.parsed.value.indexOf("/")+1):!1,this.contentType.multipart&&this.contentType.parsed.params.boundary)this.postalMime.boundaries.push({value:t2.encode(this.contentType.parsed.params.boundary),node:this});this.contentDisposition.parsed=this.parseStructuredHeader(this.contentDisposition.value),this.contentTransferEncoding.encoding=this.contentTransferEncoding.value.toLowerCase().split(/[^\w-]/).shift(),this.setupContentDecoder(this.contentTransferEncoding.encoding)}feed(u){switch(this.state){case"header":if(!u.length)return this.state="body",this.processHeaders();if(this.headerSize+=u.length,this.headerSize>this.options.maxHeadersSize)throw Error(`Maximum header size of ${this.options.maxHeadersSize} bytes exceeded`);this.headerLines.push(Tx.decode(u));break;case"body":this.contentDecoder.update(u)}}}var Ix={"Æ":"\xC6","Æ":"\xC6","&":"&","&":"&","Á":"\xC1","Á":"\xC1","Ă":"\u0102","Â":"\xC2","Â":"\xC2","А":"\u0410","𝔄":"\uD835\uDD04","À":"\xC0","À":"\xC0","Α":"\u0391","Ā":"\u0100","⩓":"\u2A53","Ą":"\u0104","𝔸":"\uD835\uDD38","⁡":"\u2061","Å":"\xC5","Å":"\xC5","𝒜":"\uD835\uDC9C","≔":"\u2254","Ã":"\xC3","Ã":"\xC3","Ä":"\xC4","Ä":"\xC4","∖":"\u2216","⫧":"\u2AE7","⌆":"\u2306","Б":"\u0411","∵":"\u2235","ℬ":"\u212C","Β":"\u0392","𝔅":"\uD835\uDD05","𝔹":"\uD835\uDD39","˘":"\u02D8","ℬ":"\u212C","≎":"\u224E","Ч":"\u0427","©":"\xA9","©":"\xA9","Ć":"\u0106","⋒":"\u22D2","ⅅ":"\u2145","ℭ":"\u212D","Č":"\u010C","Ç":"\xC7","Ç":"\xC7","Ĉ":"\u0108","∰":"\u2230","Ċ":"\u010A","¸":"\xB8","·":"\xB7","ℭ":"\u212D","Χ":"\u03A7","⊙":"\u2299","⊖":"\u2296","⊕":"\u2295","⊗":"\u2297","∲":"\u2232","”":"\u201D","’":"\u2019","∷":"\u2237","⩴":"\u2A74","≡":"\u2261","∯":"\u222F","∮":"\u222E","ℂ":"\u2102","∐":"\u2210","∳":"\u2233","⨯":"\u2A2F","𝒞":"\uD835\uDC9E","⋓":"\u22D3","≍":"\u224D","ⅅ":"\u2145","⤑":"\u2911","Ђ":"\u0402","Ѕ":"\u0405","Џ":"\u040F","‡":"\u2021","↡":"\u21A1","⫤":"\u2AE4","Ď":"\u010E","Д":"\u0414","∇":"\u2207","Δ":"\u0394","𝔇":"\uD835\uDD07","´":"\xB4","˙":"\u02D9","˝":"\u02DD","`":"`","˜":"\u02DC","⋄":"\u22C4","ⅆ":"\u2146","𝔻":"\uD835\uDD3B","¨":"\xA8","⃜":"\u20DC","≐":"\u2250","∯":"\u222F","¨":"\xA8","⇓":"\u21D3","⇐":"\u21D0","⇔":"\u21D4","⫤":"\u2AE4","⟸":"\u27F8","⟺":"\u27FA","⟹":"\u27F9","⇒":"\u21D2","⊨":"\u22A8","⇑":"\u21D1","⇕":"\u21D5","∥":"\u2225","↓":"\u2193","⤓":"\u2913","⇵":"\u21F5","̑":"\u0311","⥐":"\u2950","⥞":"\u295E","↽":"\u21BD","⥖":"\u2956","⥟":"\u295F","⇁":"\u21C1","⥗":"\u2957","⊤":"\u22A4","↧":"\u21A7","⇓":"\u21D3","𝒟":"\uD835\uDC9F","Đ":"\u0110","Ŋ":"\u014A","Ð":"\xD0","Ð":"\xD0","É":"\xC9","É":"\xC9","Ě":"\u011A","Ê":"\xCA","Ê":"\xCA","Э":"\u042D","Ė":"\u0116","𝔈":"\uD835\uDD08","È":"\xC8","È":"\xC8","∈":"\u2208","Ē":"\u0112","◻":"\u25FB","▫":"\u25AB","Ę":"\u0118","𝔼":"\uD835\uDD3C","Ε":"\u0395","⩵":"\u2A75","≂":"\u2242","⇌":"\u21CC","ℰ":"\u2130","⩳":"\u2A73","Η":"\u0397","Ë":"\xCB","Ë":"\xCB","∃":"\u2203","ⅇ":"\u2147","Ф":"\u0424","𝔉":"\uD835\uDD09","◼":"\u25FC","▪":"\u25AA","𝔽":"\uD835\uDD3D","∀":"\u2200","ℱ":"\u2131","ℱ":"\u2131","Ѓ":"\u0403",">":">",">":">","Γ":"\u0393","Ϝ":"\u03DC","Ğ":"\u011E","Ģ":"\u0122","Ĝ":"\u011C","Г":"\u0413","Ġ":"\u0120","𝔊":"\uD835\uDD0A","⋙":"\u22D9","𝔾":"\uD835\uDD3E","≥":"\u2265","⋛":"\u22DB","≧":"\u2267","⪢":"\u2AA2","≷":"\u2277","⩾":"\u2A7E","≳":"\u2273","𝒢":"\uD835\uDCA2","≫":"\u226B","Ъ":"\u042A","ˇ":"\u02C7","^":"^","Ĥ":"\u0124","ℌ":"\u210C","ℋ":"\u210B","ℍ":"\u210D","─":"\u2500","ℋ":"\u210B","Ħ":"\u0126","≎":"\u224E","≏":"\u224F","Е":"\u0415","IJ":"\u0132","Ё":"\u0401","Í":"\xCD","Í":"\xCD","Î":"\xCE","Î":"\xCE","И":"\u0418","İ":"\u0130","ℑ":"\u2111","Ì":"\xCC","Ì":"\xCC","ℑ":"\u2111","Ī":"\u012A","ⅈ":"\u2148","⇒":"\u21D2","∬":"\u222C","∫":"\u222B","⋂":"\u22C2","⁣":"\u2063","⁢":"\u2062","Į":"\u012E","𝕀":"\uD835\uDD40","Ι":"\u0399","ℐ":"\u2110","Ĩ":"\u0128","І":"\u0406","Ï":"\xCF","Ï":"\xCF","Ĵ":"\u0134","Й":"\u0419","𝔍":"\uD835\uDD0D","𝕁":"\uD835\uDD41","𝒥":"\uD835\uDCA5","Ј":"\u0408","Є":"\u0404","Х":"\u0425","Ќ":"\u040C","Κ":"\u039A","Ķ":"\u0136","К":"\u041A","𝔎":"\uD835\uDD0E","𝕂":"\uD835\uDD42","𝒦":"\uD835\uDCA6","Љ":"\u0409","<":"<","<":"<","Ĺ":"\u0139","Λ":"\u039B","⟪":"\u27EA","ℒ":"\u2112","↞":"\u219E","Ľ":"\u013D","Ļ":"\u013B","Л":"\u041B","⟨":"\u27E8","←":"\u2190","⇤":"\u21E4","⇆":"\u21C6","⌈":"\u2308","⟦":"\u27E6","⥡":"\u2961","⇃":"\u21C3","⥙":"\u2959","⌊":"\u230A","↔":"\u2194","⥎":"\u294E","⊣":"\u22A3","↤":"\u21A4","⥚":"\u295A","⊲":"\u22B2","⧏":"\u29CF","⊴":"\u22B4","⥑":"\u2951","⥠":"\u2960","↿":"\u21BF","⥘":"\u2958","↼":"\u21BC","⥒":"\u2952","⇐":"\u21D0","⇔":"\u21D4","⋚":"\u22DA","≦":"\u2266","≶":"\u2276","⪡":"\u2AA1","⩽":"\u2A7D","≲":"\u2272","𝔏":"\uD835\uDD0F","⋘":"\u22D8","⇚":"\u21DA","Ŀ":"\u013F","⟵":"\u27F5","⟷":"\u27F7","⟶":"\u27F6","⟸":"\u27F8","⟺":"\u27FA","⟹":"\u27F9","𝕃":"\uD835\uDD43","↙":"\u2199","↘":"\u2198","ℒ":"\u2112","↰":"\u21B0","Ł":"\u0141","≪":"\u226A","⤅":"\u2905","М":"\u041C"," ":"\u205F","ℳ":"\u2133","𝔐":"\uD835\uDD10","∓":"\u2213","𝕄":"\uD835\uDD44","ℳ":"\u2133","Μ":"\u039C","Њ":"\u040A","Ń":"\u0143","Ň":"\u0147","Ņ":"\u0145","Н":"\u041D","​":"\u200B","​":"\u200B","​":"\u200B","​":"\u200B","≫":"\u226B","≪":"\u226A","
":`
|
|
18
|
+
`,"𝔑":"\uD835\uDD11","⁠":"\u2060"," ":"\xA0","ℕ":"\u2115","⫬":"\u2AEC","≢":"\u2262","≭":"\u226D","∦":"\u2226","∉":"\u2209","≠":"\u2260","≂̸":"\u2242\u0338","∄":"\u2204","≯":"\u226F","≱":"\u2271","≧̸":"\u2267\u0338","≫̸":"\u226B\u0338","≹":"\u2279","⩾̸":"\u2A7E\u0338","≵":"\u2275","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⋪":"\u22EA","⧏̸":"\u29CF\u0338","⋬":"\u22EC","≮":"\u226E","≰":"\u2270","≸":"\u2278","≪̸":"\u226A\u0338","⩽̸":"\u2A7D\u0338","≴":"\u2274","⪢̸":"\u2AA2\u0338","⪡̸":"\u2AA1\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⋠":"\u22E0","∌":"\u220C","⋫":"\u22EB","⧐̸":"\u29D0\u0338","⋭":"\u22ED","⊏̸":"\u228F\u0338","⋢":"\u22E2","⊐̸":"\u2290\u0338","⋣":"\u22E3","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⋡":"\u22E1","≿̸":"\u227F\u0338","⊃⃒":"\u2283\u20D2","⊉":"\u2289","≁":"\u2241","≄":"\u2244","≇":"\u2247","≉":"\u2249","∤":"\u2224","𝒩":"\uD835\uDCA9","Ñ":"\xD1","Ñ":"\xD1","Ν":"\u039D","Œ":"\u0152","Ó":"\xD3","Ó":"\xD3","Ô":"\xD4","Ô":"\xD4","О":"\u041E","Ő":"\u0150","𝔒":"\uD835\uDD12","Ò":"\xD2","Ò":"\xD2","Ō":"\u014C","Ω":"\u03A9","Ο":"\u039F","𝕆":"\uD835\uDD46","“":"\u201C","‘":"\u2018","⩔":"\u2A54","𝒪":"\uD835\uDCAA","Ø":"\xD8","Ø":"\xD8","Õ":"\xD5","Õ":"\xD5","⨷":"\u2A37","Ö":"\xD6","Ö":"\xD6","‾":"\u203E","⏞":"\u23DE","⎴":"\u23B4","⏜":"\u23DC","∂":"\u2202","П":"\u041F","𝔓":"\uD835\uDD13","Φ":"\u03A6","Π":"\u03A0","±":"\xB1","ℌ":"\u210C","ℙ":"\u2119","⪻":"\u2ABB","≺":"\u227A","⪯":"\u2AAF","≼":"\u227C","≾":"\u227E","″":"\u2033","∏":"\u220F","∷":"\u2237","∝":"\u221D","𝒫":"\uD835\uDCAB","Ψ":"\u03A8",""":'"',""":'"',"𝔔":"\uD835\uDD14","ℚ":"\u211A","𝒬":"\uD835\uDCAC","⤐":"\u2910","®":"\xAE","®":"\xAE","Ŕ":"\u0154","⟫":"\u27EB","↠":"\u21A0","⤖":"\u2916","Ř":"\u0158","Ŗ":"\u0156","Р":"\u0420","ℜ":"\u211C","∋":"\u220B","⇋":"\u21CB","⥯":"\u296F","ℜ":"\u211C","Ρ":"\u03A1","⟩":"\u27E9","→":"\u2192","⇥":"\u21E5","⇄":"\u21C4","⌉":"\u2309","⟧":"\u27E7","⥝":"\u295D","⇂":"\u21C2","⥕":"\u2955","⌋":"\u230B","⊢":"\u22A2","↦":"\u21A6","⥛":"\u295B","⊳":"\u22B3","⧐":"\u29D0","⊵":"\u22B5","⥏":"\u294F","⥜":"\u295C","↾":"\u21BE","⥔":"\u2954","⇀":"\u21C0","⥓":"\u2953","⇒":"\u21D2","ℝ":"\u211D","⥰":"\u2970","⇛":"\u21DB","ℛ":"\u211B","↱":"\u21B1","⧴":"\u29F4","Щ":"\u0429","Ш":"\u0428","Ь":"\u042C","Ś":"\u015A","⪼":"\u2ABC","Š":"\u0160","Ş":"\u015E","Ŝ":"\u015C","С":"\u0421","𝔖":"\uD835\uDD16","↓":"\u2193","←":"\u2190","→":"\u2192","↑":"\u2191","Σ":"\u03A3","∘":"\u2218","𝕊":"\uD835\uDD4A","√":"\u221A","□":"\u25A1","⊓":"\u2293","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊔":"\u2294","𝒮":"\uD835\uDCAE","⋆":"\u22C6","⋐":"\u22D0","⋐":"\u22D0","⊆":"\u2286","≻":"\u227B","⪰":"\u2AB0","≽":"\u227D","≿":"\u227F","∋":"\u220B","∑":"\u2211","⋑":"\u22D1","⊃":"\u2283","⊇":"\u2287","⋑":"\u22D1","Þ":"\xDE","Þ":"\xDE","™":"\u2122","Ћ":"\u040B","Ц":"\u0426","	":"\t","Τ":"\u03A4","Ť":"\u0164","Ţ":"\u0162","Т":"\u0422","𝔗":"\uD835\uDD17","∴":"\u2234","Θ":"\u0398","  ":"\u205F\u200A"," ":"\u2009","∼":"\u223C","≃":"\u2243","≅":"\u2245","≈":"\u2248","𝕋":"\uD835\uDD4B","⃛":"\u20DB","𝒯":"\uD835\uDCAF","Ŧ":"\u0166","Ú":"\xDA","Ú":"\xDA","↟":"\u219F","⥉":"\u2949","Ў":"\u040E","Ŭ":"\u016C","Û":"\xDB","Û":"\xDB","У":"\u0423","Ű":"\u0170","𝔘":"\uD835\uDD18","Ù":"\xD9","Ù":"\xD9","Ū":"\u016A","_":"_","⏟":"\u23DF","⎵":"\u23B5","⏝":"\u23DD","⋃":"\u22C3","⊎":"\u228E","Ų":"\u0172","𝕌":"\uD835\uDD4C","↑":"\u2191","⤒":"\u2912","⇅":"\u21C5","↕":"\u2195","⥮":"\u296E","⊥":"\u22A5","↥":"\u21A5","⇑":"\u21D1","⇕":"\u21D5","↖":"\u2196","↗":"\u2197","ϒ":"\u03D2","Υ":"\u03A5","Ů":"\u016E","𝒰":"\uD835\uDCB0","Ũ":"\u0168","Ü":"\xDC","Ü":"\xDC","⊫":"\u22AB","⫫":"\u2AEB","В":"\u0412","⊩":"\u22A9","⫦":"\u2AE6","⋁":"\u22C1","‖":"\u2016","‖":"\u2016","∣":"\u2223","|":"|","❘":"\u2758","≀":"\u2240"," ":"\u200A","𝔙":"\uD835\uDD19","𝕍":"\uD835\uDD4D","𝒱":"\uD835\uDCB1","⊪":"\u22AA","Ŵ":"\u0174","⋀":"\u22C0","𝔚":"\uD835\uDD1A","𝕎":"\uD835\uDD4E","𝒲":"\uD835\uDCB2","𝔛":"\uD835\uDD1B","Ξ":"\u039E","𝕏":"\uD835\uDD4F","𝒳":"\uD835\uDCB3","Я":"\u042F","Ї":"\u0407","Ю":"\u042E","Ý":"\xDD","Ý":"\xDD","Ŷ":"\u0176","Ы":"\u042B","𝔜":"\uD835\uDD1C","𝕐":"\uD835\uDD50","𝒴":"\uD835\uDCB4","Ÿ":"\u0178","Ж":"\u0416","Ź":"\u0179","Ž":"\u017D","З":"\u0417","Ż":"\u017B","​":"\u200B","Ζ":"\u0396","ℨ":"\u2128","ℤ":"\u2124","𝒵":"\uD835\uDCB5","á":"\xE1","á":"\xE1","ă":"\u0103","∾":"\u223E","∾̳":"\u223E\u0333","∿":"\u223F","â":"\xE2","â":"\xE2","´":"\xB4","´":"\xB4","а":"\u0430","æ":"\xE6","æ":"\xE6","⁡":"\u2061","𝔞":"\uD835\uDD1E","à":"\xE0","à":"\xE0","ℵ":"\u2135","ℵ":"\u2135","α":"\u03B1","ā":"\u0101","⨿":"\u2A3F","&":"&","&":"&","∧":"\u2227","⩕":"\u2A55","⩜":"\u2A5C","⩘":"\u2A58","⩚":"\u2A5A","∠":"\u2220","⦤":"\u29A4","∠":"\u2220","∡":"\u2221","⦨":"\u29A8","⦩":"\u29A9","⦪":"\u29AA","⦫":"\u29AB","⦬":"\u29AC","⦭":"\u29AD","⦮":"\u29AE","⦯":"\u29AF","∟":"\u221F","⊾":"\u22BE","⦝":"\u299D","∢":"\u2222","Å":"\xC5","⍼":"\u237C","ą":"\u0105","𝕒":"\uD835\uDD52","≈":"\u2248","⩰":"\u2A70","⩯":"\u2A6F","≊":"\u224A","≋":"\u224B","'":"'","≈":"\u2248","≊":"\u224A","å":"\xE5","å":"\xE5","𝒶":"\uD835\uDCB6","*":"*","≈":"\u2248","≍":"\u224D","ã":"\xE3","ã":"\xE3","ä":"\xE4","ä":"\xE4","∳":"\u2233","⨑":"\u2A11","⫭":"\u2AED","≌":"\u224C","϶":"\u03F6","‵":"\u2035","∽":"\u223D","⋍":"\u22CD","⊽":"\u22BD","⌅":"\u2305","⌅":"\u2305","⎵":"\u23B5","⎶":"\u23B6","≌":"\u224C","б":"\u0431","„":"\u201E","∵":"\u2235","∵":"\u2235","⦰":"\u29B0","϶":"\u03F6","ℬ":"\u212C","β":"\u03B2","ℶ":"\u2136","≬":"\u226C","𝔟":"\uD835\uDD1F","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","⨀":"\u2A00","⨁":"\u2A01","⨂":"\u2A02","⨆":"\u2A06","★":"\u2605","▽":"\u25BD","△":"\u25B3","⨄":"\u2A04","⋁":"\u22C1","⋀":"\u22C0","⤍":"\u290D","⧫":"\u29EB","▪":"\u25AA","▴":"\u25B4","▾":"\u25BE","◂":"\u25C2","▸":"\u25B8","␣":"\u2423","▒":"\u2592","░":"\u2591","▓":"\u2593","█":"\u2588","=⃥":"=\u20E5","≡⃥":"\u2261\u20E5","⌐":"\u2310","𝕓":"\uD835\uDD53","⊥":"\u22A5","⊥":"\u22A5","⋈":"\u22C8","╗":"\u2557","╔":"\u2554","╖":"\u2556","╓":"\u2553","═":"\u2550","╦":"\u2566","╩":"\u2569","╤":"\u2564","╧":"\u2567","╝":"\u255D","╚":"\u255A","╜":"\u255C","╙":"\u2559","║":"\u2551","╬":"\u256C","╣":"\u2563","╠":"\u2560","╫":"\u256B","╢":"\u2562","╟":"\u255F","⧉":"\u29C9","╕":"\u2555","╒":"\u2552","┐":"\u2510","┌":"\u250C","─":"\u2500","╥":"\u2565","╨":"\u2568","┬":"\u252C","┴":"\u2534","⊟":"\u229F","⊞":"\u229E","⊠":"\u22A0","╛":"\u255B","╘":"\u2558","┘":"\u2518","└":"\u2514","│":"\u2502","╪":"\u256A","╡":"\u2561","╞":"\u255E","┼":"\u253C","┤":"\u2524","├":"\u251C","‵":"\u2035","˘":"\u02D8","¦":"\xA6","¦":"\xA6","𝒷":"\uD835\uDCB7","⁏":"\u204F","∽":"\u223D","⋍":"\u22CD","\":"\\","⧅":"\u29C5","⟈":"\u27C8","•":"\u2022","•":"\u2022","≎":"\u224E","⪮":"\u2AAE","≏":"\u224F","≏":"\u224F","ć":"\u0107","∩":"\u2229","⩄":"\u2A44","⩉":"\u2A49","⩋":"\u2A4B","⩇":"\u2A47","⩀":"\u2A40","∩︀":"\u2229\uFE00","⁁":"\u2041","ˇ":"\u02C7","⩍":"\u2A4D","č":"\u010D","ç":"\xE7","ç":"\xE7","ĉ":"\u0109","⩌":"\u2A4C","⩐":"\u2A50","ċ":"\u010B","¸":"\xB8","¸":"\xB8","⦲":"\u29B2","¢":"\xA2","¢":"\xA2","·":"\xB7","𝔠":"\uD835\uDD20","ч":"\u0447","✓":"\u2713","✓":"\u2713","χ":"\u03C7","○":"\u25CB","⧃":"\u29C3","ˆ":"\u02C6","≗":"\u2257","↺":"\u21BA","↻":"\u21BB","®":"\xAE","Ⓢ":"\u24C8","⊛":"\u229B","⊚":"\u229A","⊝":"\u229D","≗":"\u2257","⨐":"\u2A10","⫯":"\u2AEF","⧂":"\u29C2","♣":"\u2663","♣":"\u2663",":":":","≔":"\u2254","≔":"\u2254",",":",","@":"@","∁":"\u2201","∘":"\u2218","∁":"\u2201","ℂ":"\u2102","≅":"\u2245","⩭":"\u2A6D","∮":"\u222E","𝕔":"\uD835\uDD54","∐":"\u2210","©":"\xA9","©":"\xA9","℗":"\u2117","↵":"\u21B5","✗":"\u2717","𝒸":"\uD835\uDCB8","⫏":"\u2ACF","⫑":"\u2AD1","⫐":"\u2AD0","⫒":"\u2AD2","⋯":"\u22EF","⤸":"\u2938","⤵":"\u2935","⋞":"\u22DE","⋟":"\u22DF","↶":"\u21B6","⤽":"\u293D","∪":"\u222A","⩈":"\u2A48","⩆":"\u2A46","⩊":"\u2A4A","⊍":"\u228D","⩅":"\u2A45","∪︀":"\u222A\uFE00","↷":"\u21B7","⤼":"\u293C","⋞":"\u22DE","⋟":"\u22DF","⋎":"\u22CE","⋏":"\u22CF","¤":"\xA4","¤":"\xA4","↶":"\u21B6","↷":"\u21B7","⋎":"\u22CE","⋏":"\u22CF","∲":"\u2232","∱":"\u2231","⌭":"\u232D","⇓":"\u21D3","⥥":"\u2965","†":"\u2020","ℸ":"\u2138","↓":"\u2193","‐":"\u2010","⊣":"\u22A3","⤏":"\u290F","˝":"\u02DD","ď":"\u010F","д":"\u0434","ⅆ":"\u2146","‡":"\u2021","⇊":"\u21CA","⩷":"\u2A77","°":"\xB0","°":"\xB0","δ":"\u03B4","⦱":"\u29B1","⥿":"\u297F","𝔡":"\uD835\uDD21","⇃":"\u21C3","⇂":"\u21C2","⋄":"\u22C4","⋄":"\u22C4","♦":"\u2666","♦":"\u2666","¨":"\xA8","ϝ":"\u03DD","⋲":"\u22F2","÷":"\xF7","÷":"\xF7","÷":"\xF7","⋇":"\u22C7","⋇":"\u22C7","ђ":"\u0452","⌞":"\u231E","⌍":"\u230D","$":"$","𝕕":"\uD835\uDD55","˙":"\u02D9","≐":"\u2250","≑":"\u2251","∸":"\u2238","∔":"\u2214","⊡":"\u22A1","⌆":"\u2306","↓":"\u2193","⇊":"\u21CA","⇃":"\u21C3","⇂":"\u21C2","⤐":"\u2910","⌟":"\u231F","⌌":"\u230C","𝒹":"\uD835\uDCB9","ѕ":"\u0455","⧶":"\u29F6","đ":"\u0111","⋱":"\u22F1","▿":"\u25BF","▾":"\u25BE","⇵":"\u21F5","⥯":"\u296F","⦦":"\u29A6","џ":"\u045F","⟿":"\u27FF","⩷":"\u2A77","≑":"\u2251","é":"\xE9","é":"\xE9","⩮":"\u2A6E","ě":"\u011B","≖":"\u2256","ê":"\xEA","ê":"\xEA","≕":"\u2255","э":"\u044D","ė":"\u0117","ⅇ":"\u2147","≒":"\u2252","𝔢":"\uD835\uDD22","⪚":"\u2A9A","è":"\xE8","è":"\xE8","⪖":"\u2A96","⪘":"\u2A98","⪙":"\u2A99","⏧":"\u23E7","ℓ":"\u2113","⪕":"\u2A95","⪗":"\u2A97","ē":"\u0113","∅":"\u2205","∅":"\u2205","∅":"\u2205"," ":"\u2004"," ":"\u2005"," ":"\u2003","ŋ":"\u014B"," ":"\u2002","ę":"\u0119","𝕖":"\uD835\uDD56","⋕":"\u22D5","⧣":"\u29E3","⩱":"\u2A71","ε":"\u03B5","ε":"\u03B5","ϵ":"\u03F5","≖":"\u2256","≕":"\u2255","≂":"\u2242","⪖":"\u2A96","⪕":"\u2A95","=":"=","≟":"\u225F","≡":"\u2261","⩸":"\u2A78","⧥":"\u29E5","≓":"\u2253","⥱":"\u2971","ℯ":"\u212F","≐":"\u2250","≂":"\u2242","η":"\u03B7","ð":"\xF0","ð":"\xF0","ë":"\xEB","ë":"\xEB","€":"\u20AC","!":"!","∃":"\u2203","ℰ":"\u2130","ⅇ":"\u2147","≒":"\u2252","ф":"\u0444","♀":"\u2640","ffi":"\uFB03","ff":"\uFB00","ffl":"\uFB04","𝔣":"\uD835\uDD23","fi":"\uFB01","fj":"fj","♭":"\u266D","fl":"\uFB02","▱":"\u25B1","ƒ":"\u0192","𝕗":"\uD835\uDD57","∀":"\u2200","⋔":"\u22D4","⫙":"\u2AD9","⨍":"\u2A0D","½":"\xBD","½":"\xBD","⅓":"\u2153","¼":"\xBC","¼":"\xBC","⅕":"\u2155","⅙":"\u2159","⅛":"\u215B","⅔":"\u2154","⅖":"\u2156","¾":"\xBE","¾":"\xBE","⅗":"\u2157","⅜":"\u215C","⅘":"\u2158","⅚":"\u215A","⅝":"\u215D","⅞":"\u215E","⁄":"\u2044","⌢":"\u2322","𝒻":"\uD835\uDCBB","≧":"\u2267","⪌":"\u2A8C","ǵ":"\u01F5","γ":"\u03B3","ϝ":"\u03DD","⪆":"\u2A86","ğ":"\u011F","ĝ":"\u011D","г":"\u0433","ġ":"\u0121","≥":"\u2265","⋛":"\u22DB","≥":"\u2265","≧":"\u2267","⩾":"\u2A7E","⩾":"\u2A7E","⪩":"\u2AA9","⪀":"\u2A80","⪂":"\u2A82","⪄":"\u2A84","⋛︀":"\u22DB\uFE00","⪔":"\u2A94","𝔤":"\uD835\uDD24","≫":"\u226B","⋙":"\u22D9","ℷ":"\u2137","ѓ":"\u0453","≷":"\u2277","⪒":"\u2A92","⪥":"\u2AA5","⪤":"\u2AA4","≩":"\u2269","⪊":"\u2A8A","⪊":"\u2A8A","⪈":"\u2A88","⪈":"\u2A88","≩":"\u2269","⋧":"\u22E7","𝕘":"\uD835\uDD58","`":"`","ℊ":"\u210A","≳":"\u2273","⪎":"\u2A8E","⪐":"\u2A90",">":">",">":">","⪧":"\u2AA7","⩺":"\u2A7A","⋗":"\u22D7","⦕":"\u2995","⩼":"\u2A7C","⪆":"\u2A86","⥸":"\u2978","⋗":"\u22D7","⋛":"\u22DB","⪌":"\u2A8C","≷":"\u2277","≳":"\u2273","≩︀":"\u2269\uFE00","≩︀":"\u2269\uFE00","⇔":"\u21D4"," ":"\u200A","½":"\xBD","ℋ":"\u210B","ъ":"\u044A","↔":"\u2194","⥈":"\u2948","↭":"\u21AD","ℏ":"\u210F","ĥ":"\u0125","♥":"\u2665","♥":"\u2665","…":"\u2026","⊹":"\u22B9","𝔥":"\uD835\uDD25","⤥":"\u2925","⤦":"\u2926","⇿":"\u21FF","∻":"\u223B","↩":"\u21A9","↪":"\u21AA","𝕙":"\uD835\uDD59","―":"\u2015","𝒽":"\uD835\uDCBD","ℏ":"\u210F","ħ":"\u0127","⁃":"\u2043","‐":"\u2010","í":"\xED","í":"\xED","⁣":"\u2063","î":"\xEE","î":"\xEE","и":"\u0438","е":"\u0435","¡":"\xA1","¡":"\xA1","⇔":"\u21D4","𝔦":"\uD835\uDD26","ì":"\xEC","ì":"\xEC","ⅈ":"\u2148","⨌":"\u2A0C","∭":"\u222D","⧜":"\u29DC","℩":"\u2129","ij":"\u0133","ī":"\u012B","ℑ":"\u2111","ℐ":"\u2110","ℑ":"\u2111","ı":"\u0131","⊷":"\u22B7","Ƶ":"\u01B5","∈":"\u2208","℅":"\u2105","∞":"\u221E","⧝":"\u29DD","ı":"\u0131","∫":"\u222B","⊺":"\u22BA","ℤ":"\u2124","⊺":"\u22BA","⨗":"\u2A17","⨼":"\u2A3C","ё":"\u0451","į":"\u012F","𝕚":"\uD835\uDD5A","ι":"\u03B9","⨼":"\u2A3C","¿":"\xBF","¿":"\xBF","𝒾":"\uD835\uDCBE","∈":"\u2208","⋹":"\u22F9","⋵":"\u22F5","⋴":"\u22F4","⋳":"\u22F3","∈":"\u2208","⁢":"\u2062","ĩ":"\u0129","і":"\u0456","ï":"\xEF","ï":"\xEF","ĵ":"\u0135","й":"\u0439","𝔧":"\uD835\uDD27","ȷ":"\u0237","𝕛":"\uD835\uDD5B","𝒿":"\uD835\uDCBF","ј":"\u0458","є":"\u0454","κ":"\u03BA","ϰ":"\u03F0","ķ":"\u0137","к":"\u043A","𝔨":"\uD835\uDD28","ĸ":"\u0138","х":"\u0445","ќ":"\u045C","𝕜":"\uD835\uDD5C","𝓀":"\uD835\uDCC0","⇚":"\u21DA","⇐":"\u21D0","⤛":"\u291B","⤎":"\u290E","≦":"\u2266","⪋":"\u2A8B","⥢":"\u2962","ĺ":"\u013A","⦴":"\u29B4","ℒ":"\u2112","λ":"\u03BB","⟨":"\u27E8","⦑":"\u2991","⟨":"\u27E8","⪅":"\u2A85","«":"\xAB","«":"\xAB","←":"\u2190","⇤":"\u21E4","⤟":"\u291F","⤝":"\u291D","↩":"\u21A9","↫":"\u21AB","⤹":"\u2939","⥳":"\u2973","↢":"\u21A2","⪫":"\u2AAB","⤙":"\u2919","⪭":"\u2AAD","⪭︀":"\u2AAD\uFE00","⤌":"\u290C","❲":"\u2772","{":"{","[":"[","⦋":"\u298B","⦏":"\u298F","⦍":"\u298D","ľ":"\u013E","ļ":"\u013C","⌈":"\u2308","{":"{","л":"\u043B","⤶":"\u2936","“":"\u201C","„":"\u201E","⥧":"\u2967","⥋":"\u294B","↲":"\u21B2","≤":"\u2264","←":"\u2190","↢":"\u21A2","↽":"\u21BD","↼":"\u21BC","⇇":"\u21C7","↔":"\u2194","⇆":"\u21C6","⇋":"\u21CB","↭":"\u21AD","⋋":"\u22CB","⋚":"\u22DA","≤":"\u2264","≦":"\u2266","⩽":"\u2A7D","⩽":"\u2A7D","⪨":"\u2AA8","⩿":"\u2A7F","⪁":"\u2A81","⪃":"\u2A83","⋚︀":"\u22DA\uFE00","⪓":"\u2A93","⪅":"\u2A85","⋖":"\u22D6","⋚":"\u22DA","⪋":"\u2A8B","≶":"\u2276","≲":"\u2272","⥼":"\u297C","⌊":"\u230A","𝔩":"\uD835\uDD29","≶":"\u2276","⪑":"\u2A91","↽":"\u21BD","↼":"\u21BC","⥪":"\u296A","▄":"\u2584","љ":"\u0459","≪":"\u226A","⇇":"\u21C7","⌞":"\u231E","⥫":"\u296B","◺":"\u25FA","ŀ":"\u0140","⎰":"\u23B0","⎰":"\u23B0","≨":"\u2268","⪉":"\u2A89","⪉":"\u2A89","⪇":"\u2A87","⪇":"\u2A87","≨":"\u2268","⋦":"\u22E6","⟬":"\u27EC","⇽":"\u21FD","⟦":"\u27E6","⟵":"\u27F5","⟷":"\u27F7","⟼":"\u27FC","⟶":"\u27F6","↫":"\u21AB","↬":"\u21AC","⦅":"\u2985","𝕝":"\uD835\uDD5D","⨭":"\u2A2D","⨴":"\u2A34","∗":"\u2217","_":"_","◊":"\u25CA","◊":"\u25CA","⧫":"\u29EB","(":"(","⦓":"\u2993","⇆":"\u21C6","⌟":"\u231F","⇋":"\u21CB","⥭":"\u296D","‎":"\u200E","⊿":"\u22BF","‹":"\u2039","𝓁":"\uD835\uDCC1","↰":"\u21B0","≲":"\u2272","⪍":"\u2A8D","⪏":"\u2A8F","[":"[","‘":"\u2018","‚":"\u201A","ł":"\u0142","<":"<","<":"<","⪦":"\u2AA6","⩹":"\u2A79","⋖":"\u22D6","⋋":"\u22CB","⋉":"\u22C9","⥶":"\u2976","⩻":"\u2A7B","⦖":"\u2996","◃":"\u25C3","⊴":"\u22B4","◂":"\u25C2","⥊":"\u294A","⥦":"\u2966","≨︀":"\u2268\uFE00","≨︀":"\u2268\uFE00","∺":"\u223A","¯":"\xAF","¯":"\xAF","♂":"\u2642","✠":"\u2720","✠":"\u2720","↦":"\u21A6","↦":"\u21A6","↧":"\u21A7","↤":"\u21A4","↥":"\u21A5","▮":"\u25AE","⨩":"\u2A29","м":"\u043C","—":"\u2014","∡":"\u2221","𝔪":"\uD835\uDD2A","℧":"\u2127","µ":"\xB5","µ":"\xB5","∣":"\u2223","*":"*","⫰":"\u2AF0","·":"\xB7","·":"\xB7","−":"\u2212","⊟":"\u229F","∸":"\u2238","⨪":"\u2A2A","⫛":"\u2ADB","…":"\u2026","∓":"\u2213","⊧":"\u22A7","𝕞":"\uD835\uDD5E","∓":"\u2213","𝓂":"\uD835\uDCC2","∾":"\u223E","μ":"\u03BC","⊸":"\u22B8","⊸":"\u22B8","⋙̸":"\u22D9\u0338","≫⃒":"\u226B\u20D2","≫̸":"\u226B\u0338","⇍":"\u21CD","⇎":"\u21CE","⋘̸":"\u22D8\u0338","≪⃒":"\u226A\u20D2","≪̸":"\u226A\u0338","⇏":"\u21CF","⊯":"\u22AF","⊮":"\u22AE","∇":"\u2207","ń":"\u0144","∠⃒":"\u2220\u20D2","≉":"\u2249","⩰̸":"\u2A70\u0338","≋̸":"\u224B\u0338","ʼn":"\u0149","≉":"\u2249","♮":"\u266E","♮":"\u266E","ℕ":"\u2115"," ":"\xA0"," ":"\xA0","≎̸":"\u224E\u0338","≏̸":"\u224F\u0338","⩃":"\u2A43","ň":"\u0148","ņ":"\u0146","≇":"\u2247","⩭̸":"\u2A6D\u0338","⩂":"\u2A42","н":"\u043D","–":"\u2013","≠":"\u2260","⇗":"\u21D7","⤤":"\u2924","↗":"\u2197","↗":"\u2197","≐̸":"\u2250\u0338","≢":"\u2262","⤨":"\u2928","≂̸":"\u2242\u0338","∄":"\u2204","∄":"\u2204","𝔫":"\uD835\uDD2B","≧̸":"\u2267\u0338","≱":"\u2271","≱":"\u2271","≧̸":"\u2267\u0338","⩾̸":"\u2A7E\u0338","⩾̸":"\u2A7E\u0338","≵":"\u2275","≯":"\u226F","≯":"\u226F","⇎":"\u21CE","↮":"\u21AE","⫲":"\u2AF2","∋":"\u220B","⋼":"\u22FC","⋺":"\u22FA","∋":"\u220B","њ":"\u045A","⇍":"\u21CD","≦̸":"\u2266\u0338","↚":"\u219A","‥":"\u2025","≰":"\u2270","↚":"\u219A","↮":"\u21AE","≰":"\u2270","≦̸":"\u2266\u0338","⩽̸":"\u2A7D\u0338","⩽̸":"\u2A7D\u0338","≮":"\u226E","≴":"\u2274","≮":"\u226E","⋪":"\u22EA","⋬":"\u22EC","∤":"\u2224","𝕟":"\uD835\uDD5F","¬":"\xAC","¬":"\xAC","∉":"\u2209","⋹̸":"\u22F9\u0338","⋵̸":"\u22F5\u0338","∉":"\u2209","⋷":"\u22F7","⋶":"\u22F6","∌":"\u220C","∌":"\u220C","⋾":"\u22FE","⋽":"\u22FD","∦":"\u2226","∦":"\u2226","⫽⃥":"\u2AFD\u20E5","∂̸":"\u2202\u0338","⨔":"\u2A14","⊀":"\u2280","⋠":"\u22E0","⪯̸":"\u2AAF\u0338","⊀":"\u2280","⪯̸":"\u2AAF\u0338","⇏":"\u21CF","↛":"\u219B","⤳̸":"\u2933\u0338","↝̸":"\u219D\u0338","↛":"\u219B","⋫":"\u22EB","⋭":"\u22ED","⊁":"\u2281","⋡":"\u22E1","⪰̸":"\u2AB0\u0338","𝓃":"\uD835\uDCC3","∤":"\u2224","∦":"\u2226","≁":"\u2241","≄":"\u2244","≄":"\u2244","∤":"\u2224","∦":"\u2226","⋢":"\u22E2","⋣":"\u22E3","⊄":"\u2284","⫅̸":"\u2AC5\u0338","⊈":"\u2288","⊂⃒":"\u2282\u20D2","⊈":"\u2288","⫅̸":"\u2AC5\u0338","⊁":"\u2281","⪰̸":"\u2AB0\u0338","⊅":"\u2285","⫆̸":"\u2AC6\u0338","⊉":"\u2289","⊃⃒":"\u2283\u20D2","⊉":"\u2289","⫆̸":"\u2AC6\u0338","≹":"\u2279","ñ":"\xF1","ñ":"\xF1","≸":"\u2278","⋪":"\u22EA","⋬":"\u22EC","⋫":"\u22EB","⋭":"\u22ED","ν":"\u03BD","#":"#","№":"\u2116"," ":"\u2007","⊭":"\u22AD","⤄":"\u2904","≍⃒":"\u224D\u20D2","⊬":"\u22AC","≥⃒":"\u2265\u20D2",">⃒":">\u20D2","⧞":"\u29DE","⤂":"\u2902","≤⃒":"\u2264\u20D2","<⃒":"<\u20D2","⊴⃒":"\u22B4\u20D2","⤃":"\u2903","⊵⃒":"\u22B5\u20D2","∼⃒":"\u223C\u20D2","⇖":"\u21D6","⤣":"\u2923","↖":"\u2196","↖":"\u2196","⤧":"\u2927","Ⓢ":"\u24C8","ó":"\xF3","ó":"\xF3","⊛":"\u229B","⊚":"\u229A","ô":"\xF4","ô":"\xF4","о":"\u043E","⊝":"\u229D","ő":"\u0151","⨸":"\u2A38","⊙":"\u2299","⦼":"\u29BC","œ":"\u0153","⦿":"\u29BF","𝔬":"\uD835\uDD2C","˛":"\u02DB","ò":"\xF2","ò":"\xF2","⧁":"\u29C1","⦵":"\u29B5","Ω":"\u03A9","∮":"\u222E","↺":"\u21BA","⦾":"\u29BE","⦻":"\u29BB","‾":"\u203E","⧀":"\u29C0","ō":"\u014D","ω":"\u03C9","ο":"\u03BF","⦶":"\u29B6","⊖":"\u2296","𝕠":"\uD835\uDD60","⦷":"\u29B7","⦹":"\u29B9","⊕":"\u2295","∨":"\u2228","↻":"\u21BB","⩝":"\u2A5D","ℴ":"\u2134","ℴ":"\u2134","ª":"\xAA","ª":"\xAA","º":"\xBA","º":"\xBA","⊶":"\u22B6","⩖":"\u2A56","⩗":"\u2A57","⩛":"\u2A5B","ℴ":"\u2134","ø":"\xF8","ø":"\xF8","⊘":"\u2298","õ":"\xF5","õ":"\xF5","⊗":"\u2297","⨶":"\u2A36","ö":"\xF6","ö":"\xF6","⌽":"\u233D","∥":"\u2225","¶":"\xB6","¶":"\xB6","∥":"\u2225","⫳":"\u2AF3","⫽":"\u2AFD","∂":"\u2202","п":"\u043F","%":"%",".":".","‰":"\u2030","⊥":"\u22A5","‱":"\u2031","𝔭":"\uD835\uDD2D","φ":"\u03C6","ϕ":"\u03D5","ℳ":"\u2133","☎":"\u260E","π":"\u03C0","⋔":"\u22D4","ϖ":"\u03D6","ℏ":"\u210F","ℎ":"\u210E","ℏ":"\u210F","+":"+","⨣":"\u2A23","⊞":"\u229E","⨢":"\u2A22","∔":"\u2214","⨥":"\u2A25","⩲":"\u2A72","±":"\xB1","±":"\xB1","⨦":"\u2A26","⨧":"\u2A27","±":"\xB1","⨕":"\u2A15","𝕡":"\uD835\uDD61","£":"\xA3","£":"\xA3","≺":"\u227A","⪳":"\u2AB3","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","≺":"\u227A","⪷":"\u2AB7","≼":"\u227C","⪯":"\u2AAF","⪹":"\u2AB9","⪵":"\u2AB5","⋨":"\u22E8","≾":"\u227E","′":"\u2032","ℙ":"\u2119","⪵":"\u2AB5","⪹":"\u2AB9","⋨":"\u22E8","∏":"\u220F","⌮":"\u232E","⌒":"\u2312","⌓":"\u2313","∝":"\u221D","∝":"\u221D","≾":"\u227E","⊰":"\u22B0","𝓅":"\uD835\uDCC5","ψ":"\u03C8"," ":"\u2008","𝔮":"\uD835\uDD2E","⨌":"\u2A0C","𝕢":"\uD835\uDD62","⁗":"\u2057","𝓆":"\uD835\uDCC6","ℍ":"\u210D","⨖":"\u2A16","?":"?","≟":"\u225F",""":'"',""":'"',"⇛":"\u21DB","⇒":"\u21D2","⤜":"\u291C","⤏":"\u290F","⥤":"\u2964","∽̱":"\u223D\u0331","ŕ":"\u0155","√":"\u221A","⦳":"\u29B3","⟩":"\u27E9","⦒":"\u2992","⦥":"\u29A5","⟩":"\u27E9","»":"\xBB","»":"\xBB","→":"\u2192","⥵":"\u2975","⇥":"\u21E5","⤠":"\u2920","⤳":"\u2933","⤞":"\u291E","↪":"\u21AA","↬":"\u21AC","⥅":"\u2945","⥴":"\u2974","↣":"\u21A3","↝":"\u219D","⤚":"\u291A","∶":"\u2236","ℚ":"\u211A","⤍":"\u290D","❳":"\u2773","}":"}","]":"]","⦌":"\u298C","⦎":"\u298E","⦐":"\u2990","ř":"\u0159","ŗ":"\u0157","⌉":"\u2309","}":"}","р":"\u0440","⤷":"\u2937","⥩":"\u2969","”":"\u201D","”":"\u201D","↳":"\u21B3","ℜ":"\u211C","ℛ":"\u211B","ℜ":"\u211C","ℝ":"\u211D","▭":"\u25AD","®":"\xAE","®":"\xAE","⥽":"\u297D","⌋":"\u230B","𝔯":"\uD835\uDD2F","⇁":"\u21C1","⇀":"\u21C0","⥬":"\u296C","ρ":"\u03C1","ϱ":"\u03F1","→":"\u2192","↣":"\u21A3","⇁":"\u21C1","⇀":"\u21C0","⇄":"\u21C4","⇌":"\u21CC","⇉":"\u21C9","↝":"\u219D","⋌":"\u22CC","˚":"\u02DA","≓":"\u2253","⇄":"\u21C4","⇌":"\u21CC","‏":"\u200F","⎱":"\u23B1","⎱":"\u23B1","⫮":"\u2AEE","⟭":"\u27ED","⇾":"\u21FE","⟧":"\u27E7","⦆":"\u2986","𝕣":"\uD835\uDD63","⨮":"\u2A2E","⨵":"\u2A35",")":")","⦔":"\u2994","⨒":"\u2A12","⇉":"\u21C9","›":"\u203A","𝓇":"\uD835\uDCC7","↱":"\u21B1","]":"]","’":"\u2019","’":"\u2019","⋌":"\u22CC","⋊":"\u22CA","▹":"\u25B9","⊵":"\u22B5","▸":"\u25B8","⧎":"\u29CE","⥨":"\u2968","℞":"\u211E","ś":"\u015B","‚":"\u201A","≻":"\u227B","⪴":"\u2AB4","⪸":"\u2AB8","š":"\u0161","≽":"\u227D","⪰":"\u2AB0","ş":"\u015F","ŝ":"\u015D","⪶":"\u2AB6","⪺":"\u2ABA","⋩":"\u22E9","⨓":"\u2A13","≿":"\u227F","с":"\u0441","⋅":"\u22C5","⊡":"\u22A1","⩦":"\u2A66","⇘":"\u21D8","⤥":"\u2925","↘":"\u2198","↘":"\u2198","§":"\xA7","§":"\xA7",";":";","⤩":"\u2929","∖":"\u2216","∖":"\u2216","✶":"\u2736","𝔰":"\uD835\uDD30","⌢":"\u2322","♯":"\u266F","щ":"\u0449","ш":"\u0448","∣":"\u2223","∥":"\u2225","­":"\xAD","­":"\xAD","σ":"\u03C3","ς":"\u03C2","ς":"\u03C2","∼":"\u223C","⩪":"\u2A6A","≃":"\u2243","≃":"\u2243","⪞":"\u2A9E","⪠":"\u2AA0","⪝":"\u2A9D","⪟":"\u2A9F","≆":"\u2246","⨤":"\u2A24","⥲":"\u2972","←":"\u2190","∖":"\u2216","⨳":"\u2A33","⧤":"\u29E4","∣":"\u2223","⌣":"\u2323","⪪":"\u2AAA","⪬":"\u2AAC","⪬︀":"\u2AAC\uFE00","ь":"\u044C","/":"/","⧄":"\u29C4","⌿":"\u233F","𝕤":"\uD835\uDD64","♠":"\u2660","♠":"\u2660","∥":"\u2225","⊓":"\u2293","⊓︀":"\u2293\uFE00","⊔":"\u2294","⊔︀":"\u2294\uFE00","⊏":"\u228F","⊑":"\u2291","⊏":"\u228F","⊑":"\u2291","⊐":"\u2290","⊒":"\u2292","⊐":"\u2290","⊒":"\u2292","□":"\u25A1","□":"\u25A1","▪":"\u25AA","▪":"\u25AA","→":"\u2192","𝓈":"\uD835\uDCC8","∖":"\u2216","⌣":"\u2323","⋆":"\u22C6","☆":"\u2606","★":"\u2605","ϵ":"\u03F5","ϕ":"\u03D5","¯":"\xAF","⊂":"\u2282","⫅":"\u2AC5","⪽":"\u2ABD","⊆":"\u2286","⫃":"\u2AC3","⫁":"\u2AC1","⫋":"\u2ACB","⊊":"\u228A","⪿":"\u2ABF","⥹":"\u2979","⊂":"\u2282","⊆":"\u2286","⫅":"\u2AC5","⊊":"\u228A","⫋":"\u2ACB","⫇":"\u2AC7","⫕":"\u2AD5","⫓":"\u2AD3","≻":"\u227B","⪸":"\u2AB8","≽":"\u227D","⪰":"\u2AB0","⪺":"\u2ABA","⪶":"\u2AB6","⋩":"\u22E9","≿":"\u227F","∑":"\u2211","♪":"\u266A","¹":"\xB9","¹":"\xB9","²":"\xB2","²":"\xB2","³":"\xB3","³":"\xB3","⊃":"\u2283","⫆":"\u2AC6","⪾":"\u2ABE","⫘":"\u2AD8","⊇":"\u2287","⫄":"\u2AC4","⟉":"\u27C9","⫗":"\u2AD7","⥻":"\u297B","⫂":"\u2AC2","⫌":"\u2ACC","⊋":"\u228B","⫀":"\u2AC0","⊃":"\u2283","⊇":"\u2287","⫆":"\u2AC6","⊋":"\u228B","⫌":"\u2ACC","⫈":"\u2AC8","⫔":"\u2AD4","⫖":"\u2AD6","⇙":"\u21D9","⤦":"\u2926","↙":"\u2199","↙":"\u2199","⤪":"\u292A","ß":"\xDF","ß":"\xDF","⌖":"\u2316","τ":"\u03C4","⎴":"\u23B4","ť":"\u0165","ţ":"\u0163","т":"\u0442","⃛":"\u20DB","⌕":"\u2315","𝔱":"\uD835\uDD31","∴":"\u2234","∴":"\u2234","θ":"\u03B8","ϑ":"\u03D1","ϑ":"\u03D1","≈":"\u2248","∼":"\u223C"," ":"\u2009","≈":"\u2248","∼":"\u223C","þ":"\xFE","þ":"\xFE","˜":"\u02DC","×":"\xD7","×":"\xD7","⊠":"\u22A0","⨱":"\u2A31","⨰":"\u2A30","∭":"\u222D","⤨":"\u2928","⊤":"\u22A4","⌶":"\u2336","⫱":"\u2AF1","𝕥":"\uD835\uDD65","⫚":"\u2ADA","⤩":"\u2929","‴":"\u2034","™":"\u2122","▵":"\u25B5","▿":"\u25BF","◃":"\u25C3","⊴":"\u22B4","≜":"\u225C","▹":"\u25B9","⊵":"\u22B5","◬":"\u25EC","≜":"\u225C","⨺":"\u2A3A","⨹":"\u2A39","⧍":"\u29CD","⨻":"\u2A3B","⏢":"\u23E2","𝓉":"\uD835\uDCC9","ц":"\u0446","ћ":"\u045B","ŧ":"\u0167","≬":"\u226C","↞":"\u219E","↠":"\u21A0","⇑":"\u21D1","⥣":"\u2963","ú":"\xFA","ú":"\xFA","↑":"\u2191","ў":"\u045E","ŭ":"\u016D","û":"\xFB","û":"\xFB","у":"\u0443","⇅":"\u21C5","ű":"\u0171","⥮":"\u296E","⥾":"\u297E","𝔲":"\uD835\uDD32","ù":"\xF9","ù":"\xF9","↿":"\u21BF","↾":"\u21BE","▀":"\u2580","⌜":"\u231C","⌜":"\u231C","⌏":"\u230F","◸":"\u25F8","ū":"\u016B","¨":"\xA8","¨":"\xA8","ų":"\u0173","𝕦":"\uD835\uDD66","↑":"\u2191","↕":"\u2195","↿":"\u21BF","↾":"\u21BE","⊎":"\u228E","υ":"\u03C5","ϒ":"\u03D2","υ":"\u03C5","⇈":"\u21C8","⌝":"\u231D","⌝":"\u231D","⌎":"\u230E","ů":"\u016F","◹":"\u25F9","𝓊":"\uD835\uDCCA","⋰":"\u22F0","ũ":"\u0169","▵":"\u25B5","▴":"\u25B4","⇈":"\u21C8","ü":"\xFC","ü":"\xFC","⦧":"\u29A7","⇕":"\u21D5","⫨":"\u2AE8","⫩":"\u2AE9","⊨":"\u22A8","⦜":"\u299C","ϵ":"\u03F5","ϰ":"\u03F0","∅":"\u2205","ϕ":"\u03D5","ϖ":"\u03D6","∝":"\u221D","↕":"\u2195","ϱ":"\u03F1","ς":"\u03C2","⊊︀":"\u228A\uFE00","⫋︀":"\u2ACB\uFE00","⊋︀":"\u228B\uFE00","⫌︀":"\u2ACC\uFE00","ϑ":"\u03D1","⊲":"\u22B2","⊳":"\u22B3","в":"\u0432","⊢":"\u22A2","∨":"\u2228","⊻":"\u22BB","≚":"\u225A","⋮":"\u22EE","|":"|","|":"|","𝔳":"\uD835\uDD33","⊲":"\u22B2","⊂⃒":"\u2282\u20D2","⊃⃒":"\u2283\u20D2","𝕧":"\uD835\uDD67","∝":"\u221D","⊳":"\u22B3","𝓋":"\uD835\uDCCB","⫋︀":"\u2ACB\uFE00","⊊︀":"\u228A\uFE00","⫌︀":"\u2ACC\uFE00","⊋︀":"\u228B\uFE00","⦚":"\u299A","ŵ":"\u0175","⩟":"\u2A5F","∧":"\u2227","≙":"\u2259","℘":"\u2118","𝔴":"\uD835\uDD34","𝕨":"\uD835\uDD68","℘":"\u2118","≀":"\u2240","≀":"\u2240","𝓌":"\uD835\uDCCC","⋂":"\u22C2","◯":"\u25EF","⋃":"\u22C3","▽":"\u25BD","𝔵":"\uD835\uDD35","⟺":"\u27FA","⟷":"\u27F7","ξ":"\u03BE","⟸":"\u27F8","⟵":"\u27F5","⟼":"\u27FC","⋻":"\u22FB","⨀":"\u2A00","𝕩":"\uD835\uDD69","⨁":"\u2A01","⨂":"\u2A02","⟹":"\u27F9","⟶":"\u27F6","𝓍":"\uD835\uDCCD","⨆":"\u2A06","⨄":"\u2A04","△":"\u25B3","⋁":"\u22C1","⋀":"\u22C0","ý":"\xFD","ý":"\xFD","я":"\u044F","ŷ":"\u0177","ы":"\u044B","¥":"\xA5","¥":"\xA5","𝔶":"\uD835\uDD36","ї":"\u0457","𝕪":"\uD835\uDD6A","𝓎":"\uD835\uDCCE","ю":"\u044E","ÿ":"\xFF","ÿ":"\xFF","ź":"\u017A","ž":"\u017E","з":"\u0437","ż":"\u017C","ℨ":"\u2128","ζ":"\u03B6","𝔷":"\uD835\uDD37","ж":"\u0436","⇝":"\u21DD","𝕫":"\uD835\uDD6B","𝓏":"\uD835\uDCCF","‍":"\u200D","‌":"\u200C"},pD=Ix;function qx(u){return u.replace(/&(#\d+|#x[a-f0-9]+|[a-z]+\d*);?/gi,(D,B)=>{if(typeof pD[D]==="string")return pD[D];if(B.charAt(0)!=="#"||D.charAt(D.length-1)!==";")return D;let A;if(B.charAt(1)==="x")A=parseInt(B.substr(2),16);else A=parseInt(B.substr(1),10);let w="";if(A>=55296&&A<=57343||A>1114111)return"\uFFFD";if(A>65535)A-=65536,w+=String.fromCharCode(A>>>10&1023|55296),A=56320|A&1023;return w+=String.fromCharCode(A),w})}function W0(u){return u.trim().replace(/[<>"'?&]/g,(D)=>{let B=D.charCodeAt(0).toString(16);if(B.length<2)B="0"+B;return"&#x"+B.toUpperCase()+";"})}function mB(u){return"<div>"+W0(u).replace(/\n/g,"<br />")+"</div>"}function _B(u){return u=u.replace(/\r?\n/g,"\x01").replace(/<\!\-\-.*?\-\->/gi," ").replace(/<br\b[^>]*>/gi,`
|
|
19
19
|
`).replace(/<\/?(p|div|table|tr|td|th)\b[^>]*>/gi,`
|
|
20
20
|
|
|
21
21
|
`).replace(/<script\b[^>]*>.*?<\/script\b[^>]*>/gi," ").replace(/^.*<body\b[^>]*>/i,"").replace(/^.*<\/head\b[^>]*>/i,"").replace(/^.*<\!doctype\b[^>]*>/i,"").replace(/<\/body\b[^>]*>.*$/i,"").replace(/<\/html\b[^>]*>.*$/i,"").replace(/<a\b[^>]*href\s*=\s*["']?([^\s"']+)[^>]*>/gi," ($1) ").replace(/<\/?(span|em|i|strong|b|u|a)\b[^>]*>/gi,"").replace(/<li\b[^>]*>[\n\u0001\s]*/gi,"* ").replace(/<hr\b[^>]*>/g,`
|
|
@@ -25,24 +25,24 @@ Headers: ${JSON.stringify(B)}`);this.code=u,this.body=D,this.headers={},B.forEac
|
|
|
25
25
|
|
|
26
26
|
`).replace(/^\n+/,`
|
|
27
27
|
`).replace(/\n+$/,`
|
|
28
|
-
`),u=
|
|
29
|
-
`}return F}function
|
|
28
|
+
`),u=qx(u),u}function gB(u){return[].concat(u.name||[]).concat(u.name?`<${u.address}>`:u.address).join(" ")}function aD(u){let D=[],B=(A,w)=>{if(w)D.push(", ");if(A.group){let F=`${A.name}:`,G=";";D.push(F),A.group.forEach(B),D.push(G)}else D.push(gB(A))};return u.forEach(B),D.join("")}function fB(u){return`<a href="mailto:${W0(u.address)}" class="postal-email-address">${W0(u.name||`<${u.address}>`)}</a>`}function sD(u){let D=[],B=(A,w)=>{if(w)D.push('<span class="postal-email-address-separator">, </span>');if(A.group){let F=`<span class="postal-email-address-group">${W0(A.name)}:</span>`,G='<span class="postal-email-address-group">;</span>';D.push(F),A.group.forEach(B),D.push(G)}else D.push(fB(A))};return u.forEach(B),D.join(" ")}function mx(u,D,B){u=(u||"").toString(),D=D||76;let A=0,w=u.length,F="",G,N;while(A<w){if(G=u.substr(A,D),G.length<D){F+=G;break}if(N=G.match(/^[^\n\r]*(\r?\n|\r)/)){G=N[0],F+=G,A+=G.length;continue}else if((N=G.match(/(\s+)[^\s]*$/))&&N[0].length-(B?(N[1]||"").length:0)<G.length)G=G.substr(0,G.length-(N[0].length-(B?(N[1]||"").length:0)));else if(N=u.substr(A+G.length).match(/^[^\s]+(\s*)/))G=G+N[0].substr(0,N[0].length-(!B?(N[1]||"").length:0));if(F+=G,A+=G.length,A<w)F+=`\r
|
|
29
|
+
`}return F}function tD(u){let D=[];if(u.from)D.push({key:"From",val:gB(u.from)});if(u.subject)D.push({key:"Subject",val:u.subject});if(u.date){let G={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},N=typeof Intl>"u"?u.date:new Intl.DateTimeFormat("default",G).format(new Date(u.date));D.push({key:"Date",val:N})}if(u.to&&u.to.length)D.push({key:"To",val:aD(u.to)});if(u.cc&&u.cc.length)D.push({key:"Cc",val:aD(u.cc)});if(u.bcc&&u.bcc.length)D.push({key:"Bcc",val:aD(u.bcc)});let B=D.map((G)=>G.key.length).reduce((G,N)=>{return N>G?N:G},0);D=D.flatMap((G)=>{let N=B-G.key.length,$=`${G.key}: ${" ".repeat(N)}`,Z=`${" ".repeat(G.key.length+1)} ${" ".repeat(N)}`;return mx(G.val,80,!0).split(/\r?\n/).map((J)=>J.trim()).map((J,v)=>`${v?Z:$}${J}`)});let A=D.map((G)=>G.length).reduce((G,N)=>{return N>G?N:G},0),w="-".repeat(A);return`
|
|
30
30
|
${w}
|
|
31
31
|
${D.join(`
|
|
32
32
|
`)}
|
|
33
33
|
${w}
|
|
34
|
-
`}function
|
|
35
|
-
<div class="postal-email-header-row">`)}${D.length?"</div>":""}</div>`}function
|
|
34
|
+
`}function oD(u){let D=[];if(u.from)D.push(`<div class="postal-email-header-key">From</div><div class="postal-email-header-value">${fB(u.from)}</div>`);if(u.subject)D.push(`<div class="postal-email-header-key">Subject</div><div class="postal-email-header-value postal-email-header-subject">${W0(u.subject)}</div>`);if(u.date){let A={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!1},w=typeof Intl>"u"?u.date:new Intl.DateTimeFormat("default",A).format(new Date(u.date));D.push(`<div class="postal-email-header-key">Date</div><div class="postal-email-header-value postal-email-header-date" data-date="${W0(u.date)}">${W0(w)}</div>`)}if(u.to&&u.to.length)D.push(`<div class="postal-email-header-key">To</div><div class="postal-email-header-value">${sD(u.to)}</div>`);if(u.cc&&u.cc.length)D.push(`<div class="postal-email-header-key">Cc</div><div class="postal-email-header-value">${sD(u.cc)}</div>`);if(u.bcc&&u.bcc.length)D.push(`<div class="postal-email-header-key">Bcc</div><div class="postal-email-header-value">${sD(u.bcc)}</div>`);return`<div class="postal-email-header">${D.length?'<div class="postal-email-header-row">':""}${D.join(`</div>
|
|
35
|
+
<div class="postal-email-header-row">`)}${D.length?"</div>":""}</div>`}function _x(u,D){let B=!1,A="text",w,F=[],G={address:[],comment:[],group:[],text:[],textWasQuoted:[]},N,$,Z=!1;for(N=0,$=u.length;N<$;N++){let Q=u[N],J=N?u[N-1]:null;if(Q.type==="operator")switch(Q.value){case"<":A="address",Z=!1;break;case"(":A="comment",Z=!1;break;case":":A="group",B=!0,Z=!1;break;case'"':Z=!Z,A="text";break;default:A="text",Z=!1;break}else if(Q.value){if(A==="address")Q.value=Q.value.replace(/^[^<]*<\s*/,"");if(J&&J.noBreak&&G[A].length){if(G[A][G[A].length-1]+=Q.value,A==="text"&&Z)G.textWasQuoted[G.textWasQuoted.length-1]=!0}else if(G[A].push(Q.value),A==="text")G.textWasQuoted.push(Z)}}if(!G.text.length&&G.comment.length)G.text=G.comment,G.comment=[];if(B){G.text=G.text.join(" ");let Q=[];if(G.group.length)eD(G.group.join(","),{_depth:D+1}).forEach((v)=>{if(v.group)Q=Q.concat(v.group);else Q.push(v)});F.push({name:Q0(G.text||w&&w.name),group:Q})}else{if(!G.address.length&&G.text.length){for(N=G.text.length-1;N>=0;N--)if(!G.textWasQuoted[N]&&G.text[N].match(/^[^@\s]+@[^@\s]+$/)){G.address=G.text.splice(N,1),G.textWasQuoted.splice(N,1);break}let Q=function(J){if(!G.address.length)return G.address=[J.trim()]," ";else return J};if(!G.address.length){for(N=G.text.length-1;N>=0;N--)if(!G.textWasQuoted[N]){if(G.text[N]=G.text[N].replace(/\s*\b[^@\s]+@[^\s]+\b\s*/,Q).trim(),G.address.length)break}}}if(!G.text.length&&G.comment.length)G.text=G.comment,G.comment=[];if(G.address.length>1)G.text=G.text.concat(G.address.splice(1));if(G.text=G.text.join(" "),G.address=G.address.join(" "),!G.address&&/^=\?[^=]+?=$/.test(G.text.trim())){let Q=Q0(G.text);if(/<[^<>]+@[^<>]+>/.test(Q)){let J=eD(Q);if(J&&J.length)return J}return[{address:"",name:Q}]}if(w={address:G.address||G.text||"",name:Q0(G.text||G.address||"")},w.address===w.name)if((w.address||"").match(/@/))w.name="";else w.address="";F.push(w)}return F}class bB{constructor(u){this.str=(u||"").toString(),this.operatorCurrent="",this.operatorExpecting="",this.node=null,this.escaped=!1,this.list=[],this.operators={'"':'"',"(":")","<":">",",":"",":":";",";":""}}tokenize(){let u=[];for(let D=0,B=this.str.length;D<B;D++){let A=this.str.charAt(D),w=D<B-1?this.str.charAt(D+1):null;this.checkChar(A,w)}return this.list.forEach((D)=>{if(D.value=(D.value||"").toString().trim(),D.value)u.push(D)}),u}checkChar(u,D){if(this.escaped);else if(u===this.operatorExpecting){if(this.node={type:"operator",value:u},D&&![" ","\t","\r",`
|
|
36
36
|
`,",",";"].includes(D))this.node.noBreak=!0;this.list.push(this.node),this.node=null,this.operatorExpecting="",this.escaped=!1;return}else if(!this.operatorExpecting&&u in this.operators){this.node={type:"operator",value:u},this.list.push(this.node),this.node=null,this.operatorExpecting=this.operators[u],this.escaped=!1;return}else if(this.operatorExpecting==='"'&&u==="\\"){this.escaped=!0;return}if(!this.node)this.node={type:"text",value:""},this.list.push(this.node);if(u===`
|
|
37
|
-
`)u=" ";if(u.charCodeAt(0)>=33||[" ","\t"].includes(u))this.node.value+=u;this.escaped=!1}}var
|
|
37
|
+
`)u=" ";if(u.charCodeAt(0)>=33||[" ","\t"].includes(u))this.node.value+=u;this.escaped=!1}}var gx=50;function eD(u,D){D=D||{};let B=D._depth||0;if(B>gx)return[];let w=new bB(u).tokenize(),F=[],G=[],N=[];if(w.forEach(($)=>{if($.type==="operator"&&($.value===","||$.value===";")){if(G.length)F.push(G);G=[]}else G.push($)}),G.length)F.push(G);if(F.forEach(($)=>{if($=_x($,B),$.length)N=N.concat($)}),D.flatten){let $=[],Z=(Q)=>{Q.forEach((J)=>{if(J.group)return Z(J.group);else $.push(J)})};return Z(N),$}return N}var t1=eD;function jB(u){var D="",B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=new Uint8Array(u),w=A.byteLength,F=w%3,G=w-F,N,$,Z,Q,J;for(var v=0;v<G;v=v+3)J=A[v]<<16|A[v+1]<<8|A[v+2],N=(J&16515072)>>18,$=(J&258048)>>12,Z=(J&4032)>>6,Q=J&63,D+=B[N]+B[$]+B[Z]+B[Q];if(F==1)J=A[G],N=(J&252)>>2,$=(J&3)<<4,D+=B[N]+B[$]+"==";else if(F==2)J=A[G]<<8|A[G+1],N=(J&64512)>>10,$=(J&1008)>>4,Z=(J&15)<<2,D+=B[N]+B[$]+B[Z]+"=";return D}var fx=256,bx=2097152;function u8(u){return u.replace(/-(.)/g,(D,B)=>B.toUpperCase())}class T0{static parse(u,D){return new T0(D).parse(u)}constructor(u){this.options=u||{},this.mimeOptions={maxNestingDepth:this.options.maxNestingDepth||fx,maxHeadersSize:this.options.maxHeadersSize||bx},this.root=this.currentNode=new Mu({postalMime:this,...this.mimeOptions}),this.boundaries=[],this.textContent={},this.attachments=[],this.attachmentEncoding=(this.options.attachmentEncoding||"").toString().replace(/[-_\s]/g,"").trim().toLowerCase()||"arraybuffer",this.started=!1}async finalize(){await this.root.finalize()}async processLine(u,D){let B=this.boundaries;if(B.length&&u.length>2&&u[0]===45&&u[1]===45)for(let A=B.length-1;A>=0;A--){let w=B[A];if(u.length<w.value.length+2)continue;let F=!0;for(let Z=0;Z<w.value.length;Z++)if(u[Z+2]!==w.value[Z]){F=!1;break}if(!F)continue;let G=w.value.length+2,N=!1;if(u.length>=w.value.length+4&&u[w.value.length+2]===45&&u[w.value.length+3]===45)N=!0,G=w.value.length+4;let $=!0;for(let Z=G;Z<u.length;Z++)if(u[Z]!==32&&u[Z]!==9){$=!1;break}if(!$)continue;if(N)await w.node.finalize(),this.currentNode=w.node.parentNode||this.root;else await w.node.finalizeChildNodes(),this.currentNode=new Mu({postalMime:this,parentNode:w.node,parentMultipartType:w.node.contentType.multipart,...this.mimeOptions});if(D)return this.finalize();return}if(this.currentNode.feed(u),D)return this.finalize()}readLine(){let u=this.readPos,D=this.readPos;while(this.readPos<this.av.length){let B=this.av[this.readPos++];if(B!==13&&B!==10)D=this.readPos;if(B===10)return{bytes:new Uint8Array(this.buf,u,D-u),done:this.readPos>=this.av.length}}return{bytes:new Uint8Array(this.buf,u,D-u),done:this.readPos>=this.av.length}}async processNodeTree(){let u={},D=new Set,B=this.textMap=new Map,A=this.forceRfc822Attachments(),w=async(F,G,N)=>{if(G=G||!1,N=N||!1,!F.contentType.multipart){if(this.isInlineMessageRfc822(F)&&!A){let $=new T0;if(F.subMessage=await $.parse(F.content),!B.has(F))B.set(F,{});let Z=B.get(F);if(F.subMessage.text||!F.subMessage.html)Z.plain=Z.plain||[],Z.plain.push({type:"subMessage",value:F.subMessage}),D.add("plain");if(F.subMessage.html)Z.html=Z.html||[],Z.html.push({type:"subMessage",value:F.subMessage}),D.add("html");if($.textMap)$.textMap.forEach((Q,J)=>{B.set(J,Q)});for(let Q of F.subMessage.attachments||[])this.attachments.push(Q)}else if(this.isInlineTextNode(F)){let $=F.contentType.parsed.value.substr(F.contentType.parsed.value.indexOf("/")+1),Z=G||F;if(!B.has(Z))B.set(Z,{});let Q=B.get(Z);Q[$]=Q[$]||[],Q[$].push({type:"text",value:F.getTextContent()}),D.add($)}else if(F.content){let $=F.contentDisposition?.parsed?.params?.filename||F.contentType.parsed.params.name||null,Z={filename:$?Q0($):null,mimeType:F.contentType.parsed.value,disposition:F.contentDisposition?.parsed?.value||null};if(N&&F.contentId)Z.related=!0;if(F.contentDescription)Z.description=F.contentDescription;if(F.contentId)Z.contentId=F.contentId;switch(F.contentType.parsed.value){case"text/calendar":case"application/ics":{if(F.contentType.parsed.params.method)Z.method=F.contentType.parsed.params.method.toString().toUpperCase().trim();let Q=F.getTextContent().replace(/\r?\n/g,`
|
|
38
38
|
`).replace(/\n*$/,`
|
|
39
|
-
`);
|
|
40
|
-
`)}),this.textContent=u}isInlineTextNode(u){if(u.contentDisposition?.parsed?.value==="attachment")return!1;switch(u.contentType.parsed?.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(u){if(u.contentType.parsed?.value!=="message/rfc822")return!1;return(u.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let u=!1,D=(B)=>{if(!B.contentType.multipart){if(B.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(B.contentType.parsed.value))u=!0}for(let A of B.childNodes)D(A)};return D(this.root),u}async resolveStream(u){let D=0,B=[],A=u.getReader();while(!0){let{done:N,value:G}=await A.read();if(N)break;B.push(G),D+=G.length}let w=new Uint8Array(D),F=0;for(let N of B)w.set(N,F),F+=N.length;return w}async parse(u){if(this.started)throw Error("Can not reuse parser, create a new PostalMime object");if(this.started=!0,u&&typeof u.getReader==="function")u=await this.resolveStream(u);if(u=u||new ArrayBuffer(0),typeof u==="string")u=n2.encode(u);if(u instanceof Blob||Object.prototype.toString.call(u)==="[object Blob]")u=await p2(u);if(u.buffer instanceof ArrayBuffer)u=new Uint8Array(u).buffer;this.buf=u,this.av=new Uint8Array(u),this.readPos=0;while(this.readPos<this.av.length){let A=this.readLine();await this.processLine(A.bytes,A.done)}await this.processNodeTree();let D={headers:this.root.headers.map((A)=>({key:A.key,originalKey:A.originalKey,value:A.value})).reverse()};for(let A of["from","sender"]){let w=this.root.headers.find((F)=>F.key===A);if(w&&w.value){let F=r1(w.value);if(F&&F.length)D[A]=F[0]}}for(let A of["delivered-to","return-path"]){let w=this.root.headers.find((F)=>F.key===A);if(w&&w.value){let F=r1(w.value);if(F&&F.length&&F[0].address){let N=r3(A);D[N]=F[0].address}}}for(let A of["to","cc","bcc","reply-to"]){let w=this.root.headers.filter((N)=>N.key===A),F=[];if(w.filter((N)=>N&&N.value).map((N)=>r1(N.value)).forEach((N)=>F=F.concat(N||[])),F&&F.length){let N=r3(A);D[N]=F}}for(let A of["subject","message-id","in-reply-to","references"]){let w=this.root.headers.find((F)=>F.key===A);if(w&&w.value){let F=r3(A);D[F]=$0(w.value)}}let B=this.root.headers.find((A)=>A.key==="date");if(B){let A=new Date(B.value);if(A.toString()==="Invalid Date")A=B.value;else A=A.toISOString();D.date=A}if(this.textContent?.html)D.html=this.textContent.html;if(this.textContent?.plain)D.text=this.textContent.plain;switch(D.attachments=this.attachments,D.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let w of D.attachments||[])if(w?.content)w.content=P6(w.content),w.encoding="base64";break;case"utf8":let A=new TextDecoder("utf8");for(let w of D.attachments||[])if(w?.content)w.content=A.decode(w.content),w.encoding="utf8";break;default:throw Error("Unknown attachment encoding")}return D}}var NY=X(eX(),1),OH="6.12.3";function A2(u){let D=new URLSearchParams;if(u.limit!==void 0)D.set("limit",u.limit.toString());if("after"in u&&u.after!==void 0)D.set("after",u.after);if("before"in u&&u.before!==void 0)D.set("before",u.before);return D.toString()}var CH=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/api-keys",u,D)}async list(u={}){let D=A2(u),B=D?`/api-keys?${D}`:"/api-keys";return await this.resend.get(B)}async remove(u){return await this.resend.delete(`/api-keys/${u}`)}},PH=class{constructor(u){this.resend=u}async get(u){return await this.resend.get(`/automations/${u.automationId}/runs/${u.runId}`)}async list(u){let D=A2(u),B=new URLSearchParams(D);if(u.status){let F=Array.isArray(u.status)?u.status.join(","):u.status;B.set("status",F)}let A=B.toString(),w=A?`/automations/${u.automationId}/runs?${A}`:`/automations/${u.automationId}/runs`;return await this.resend.get(w)}};function GY(u){switch(u.type){case"trigger":return{key:u.key,type:u.type,config:{event_name:u.config.eventName}};case"delay":return{key:u.key,type:u.type,config:u.config};case"send_email":return{key:u.key,type:u.type,config:{template:u.config.template,subject:u.config.subject,from:u.config.from,reply_to:u.config.replyTo}};case"wait_for_event":return{key:u.key,type:u.type,config:{event_name:u.config.eventName,timeout:u.config.timeout,filter_rule:u.config.filterRule}};case"condition":return{key:u.key,type:u.type,config:u.config};case"contact_update":return{key:u.key,type:u.type,config:{first_name:u.config.firstName,last_name:u.config.lastName,unsubscribed:u.config.unsubscribed,properties:u.config.properties}};case"contact_delete":return{key:u.key,type:u.type,config:u.config};case"add_to_segment":return{key:u.key,type:u.type,config:{segment_id:u.config.segmentId}}}}function $Y(u){return{from:u.from,to:u.to,type:u.type}}function kH(u){return{name:u.name,status:u.status,steps:u.steps.map(GY),connections:u.connections.map($Y)}}function yH(u){return{event:u.event,contact_id:u.contactId,email:u.email,payload:u.payload}}var VH=class{constructor(u){this.resend=u,this.runs=new PH(this.resend)}async create(u){return await this.resend.post("/automations",kH(u))}async list(u={}){let D=[A2(u)];if(u.status)D.push(`status=${encodeURIComponent(u.status)}`);let B=D.filter(Boolean).join("&"),A=B?`/automations?${B}`:"/automations";return await this.resend.get(A)}async get(u){return await this.resend.get(`/automations/${u}`)}async remove(u){return await this.resend.delete(`/automations/${u}`)}async update(u,D){let B={};if(D.name!==void 0)B.name=D.name;if(D.status!==void 0)B.status=D.status;if(D.steps!==void 0)B.steps=D.steps.map(GY);if(D.connections!==void 0)B.connections=D.connections.map($Y);return await this.resend.patch(`/automations/${u}`,B)}async stop(u){return await this.resend.post(`/automations/${u}/stop`)}};function TH(u){return u?.map((D)=>({content:D.content,filename:D.filename,path:D.path,content_type:D.contentType,content_id:D.contentId}))}function vY(u){return{attachments:TH(u.attachments),bcc:u.bcc,cc:u.cc,from:u.from,headers:u.headers,html:u.html,reply_to:u.replyTo,scheduled_at:u.scheduledAt,subject:u.subject,tags:u.tags,text:u.text,to:u.to,template:u.template?{id:u.template.id,variables:u.template.variables}:void 0,topic_id:u.topicId}}async function $D(u){let D;try{({render:D}=await import("@react-email/render"))}catch{throw Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return D(u)}var IH=class{constructor(u){this.resend=u}async send(u,D){return this.create(u,D)}async create(u,D){let B=[];for(let A of u){if(A.react)A.html=await $D(A.react),A.react=void 0;B.push(vY(A))}return await this.resend.post("/emails/batch",B,{...D,headers:{"x-batch-validation":D?.batchValidation??"strict",...D?.headers}})}},qH=class{constructor(u){this.resend=u}async create(u,D={}){if(u.react)u.html=await $D(u.react);return await this.resend.post("/broadcasts",{name:u.name,segment_id:u.segmentId,audience_id:u.audienceId,preview_text:u.previewText,from:u.from,html:u.html,reply_to:u.replyTo,subject:u.subject,text:u.text,topic_id:u.topicId,send:u.send,scheduled_at:u.scheduledAt},D)}async send(u,D){return await this.resend.post(`/broadcasts/${u}/send`,{scheduled_at:D?.scheduledAt})}async list(u={}){let D=A2(u),B=D?`/broadcasts?${D}`:"/broadcasts";return await this.resend.get(B)}async get(u){return await this.resend.get(`/broadcasts/${u}`)}async remove(u){return await this.resend.delete(`/broadcasts/${u}`)}async update(u,D){if(D.react)D.html=await $D(D.react);return await this.resend.patch(`/broadcasts/${u}`,{name:D.name,segment_id:D.segmentId,audience_id:D.audienceId,from:D.from,html:D.html,text:D.text,subject:D.subject,reply_to:D.replyTo,preview_text:D.previewText,topic_id:D.topicId})}};function uY(u){return{id:u.id,key:u.key,createdAt:u.created_at,type:u.type,fallbackValue:u.fallback_value}}function DY(u){if("key"in u)return{key:u.key,type:u.type,fallback_value:u.fallbackValue};return{fallback_value:u.fallbackValue}}var mH=class{constructor(u){this.resend=u}async create(u){let D=DY(u);return await this.resend.post("/contact-properties",D)}async list(u={}){let D=A2(u),B=D?`/contact-properties?${D}`:"/contact-properties",A=await this.resend.get(B);if(A.data)return{data:{...A.data,data:A.data.data.map((w)=>uY(w))},headers:A.headers,error:null};return A}async get(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let D=await this.resend.get(`/contact-properties/${u}`);if(D.data)return{data:{object:"contact_property",...uY(D.data)},headers:D.headers,error:null};return D}async update(u){if(!u.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let D=DY(u);return await this.resend.patch(`/contact-properties/${u.id}`,D)}async remove(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.delete(`/contact-properties/${u}`)}},gH=class{constructor(u){this.resend=u}async list(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId,B=A2(u),A=B?`/contacts/${D}/segments?${B}`:`/contacts/${D}/segments`;return await this.resend.get(A)}async add(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId;return this.resend.post(`/contacts/${D}/segments/${u.segmentId}`)}async remove(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId;return this.resend.delete(`/contacts/${D}/segments/${u.segmentId}`)}},_H=class{constructor(u){this.resend=u}async update(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.id;return this.resend.patch(`/contacts/${D}/topics`,u.topics)}async list(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.id,B=A2(u),A=B?`/contacts/${D}/topics?${B}`:`/contacts/${D}/topics`;return this.resend.get(A)}},fH=class{constructor(u){this.resend=u,this.topics=new _H(this.resend),this.segments=new gH(this.resend)}async create(u,D={}){if("audienceId"in u){if("segments"in u||"topics"in u)return{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}};return await this.resend.post(`/audiences/${u.audienceId}/contacts`,{unsubscribed:u.unsubscribed,email:u.email,first_name:u.firstName,last_name:u.lastName,properties:u.properties},D)}return await this.resend.post("/contacts",{unsubscribed:u.unsubscribed,email:u.email,first_name:u.firstName,last_name:u.lastName,properties:u.properties,segments:u.segments,topics:u.topics},D)}async list(u={}){let D=u.segmentId??u.audienceId;if(!D){let w=A2(u),F=w?`/contacts?${w}`:"/contacts";return await this.resend.get(F)}let B=A2(u),A=B?`/segments/${D}/contacts?${B}`:`/segments/${D}/contacts`;return await this.resend.get(A)}async get(u){if(typeof u==="string")return this.resend.get(`/contacts/${u}`);if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return this.resend.get(`/contacts/${u?.email?u?.email:u?.id}`);return this.resend.get(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`)}async update(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return await this.resend.patch(`/contacts/${u?.email?u?.email:u?.id}`,{unsubscribed:u.unsubscribed,first_name:u.firstName,last_name:u.lastName,properties:u.properties});return await this.resend.patch(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`,{unsubscribed:u.unsubscribed,first_name:u.firstName,last_name:u.lastName,properties:u.properties})}async remove(u){if(typeof u==="string")return this.resend.delete(`/contacts/${u}`);if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return this.resend.delete(`/contacts/${u?.email?u?.email:u?.id}`);return this.resend.delete(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`)}};function bH(u){return{name:u.name,region:u.region,custom_return_path:u.customReturnPath,capabilities:u.capabilities,open_tracking:u.openTracking,click_tracking:u.clickTracking,tls:u.tls,tracking_subdomain:u.trackingSubdomain}}var jH=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/domains",bH(u),D)}async list(u={}){let D=A2(u),B=D?`/domains?${D}`:"/domains";return await this.resend.get(B)}async get(u){return await this.resend.get(`/domains/${u}`)}async update(u){return await this.resend.patch(`/domains/${u.id}`,{click_tracking:u.clickTracking,open_tracking:u.openTracking,tls:u.tls,capabilities:u.capabilities,tracking_subdomain:u.trackingSubdomain})}async remove(u){return await this.resend.delete(`/domains/${u}`)}async verify(u){return await this.resend.post(`/domains/${u}/verify`)}},lH=class{constructor(u){this.resend=u}async get(u){let{emailId:D,id:B}=u;return await this.resend.get(`/emails/${D}/attachments/${B}`)}async list(u){let{emailId:D}=u,B=A2(u),A=B?`/emails/${D}/attachments?${B}`:`/emails/${D}/attachments`;return await this.resend.get(A)}},dH=class{constructor(u){this.resend=u}async get(u){let{emailId:D,id:B}=u;return await this.resend.get(`/emails/receiving/${D}/attachments/${B}`)}async list(u){let{emailId:D}=u,B=A2(u),A=B?`/emails/receiving/${D}/attachments?${B}`:`/emails/receiving/${D}/attachments`;return await this.resend.get(A)}},rH=class{constructor(u){this.resend=u,this.attachments=new dH(u)}async get(u){return await this.resend.get(`/emails/receiving/${u}`)}async list(u={}){let D=A2(u),B=D?`/emails/receiving?${D}`:"/emails/receiving";return await this.resend.get(B)}async forward(u){let{emailId:D,to:B,from:A}=u,w=u.passthrough!==!1,F=await this.get(D);if(F.error)return{data:null,error:F.error,headers:F.headers};let N=F.data,G=N.subject||"(no subject)";if(w)return this.forwardPassthrough(N,{to:B,from:A,subject:G});let v=G.startsWith("Fwd:")?G:`Fwd: ${G}`;return this.forwardWrapped(N,{to:B,from:A,subject:v,text:"text"in u?u.text:void 0,html:"html"in u?u.html:void 0})}async forwardPassthrough(u,D){let{to:B,from:A,subject:w}=D;if(!u.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let F=await fetch(u.raw.download_url);if(!F.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:F.status},headers:null};let N=await F.text(),G=await P0.parse(N,{attachmentEncoding:"base64"}),v=G.attachments.map((z)=>{let Q=z.contentId?z.contentId.replace(/^<|>$/g,""):void 0;return{filename:z.filename,content:z.content.toString(),content_type:z.mimeType,content_id:Q||void 0}});return await this.resend.post("/emails",{from:A,to:B,subject:w,text:G.text||void 0,html:G.html||void 0,attachments:v.length>0?v:void 0})}async forwardWrapped(u,D){let{to:B,from:A,subject:w,text:F,html:N}=D;if(!u.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let G=await fetch(u.raw.download_url);if(!G.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:G.status},headers:null};let v=await G.text();return await this.resend.post("/emails",{from:A,to:B,subject:w,text:F,html:N,attachments:[{filename:"forwarded_message.eml",content:Buffer.from(v).toString("base64"),content_type:"message/rfc822"}]})}},iH=class{constructor(u){this.resend=u,this.attachments=new lH(u),this.receiving=new rH(u)}async send(u,D={}){return this.create(u,D)}async create(u,D={}){if(u.react)u.html=await $D(u.react);return await this.resend.post("/emails",vY(u),D)}async get(u){return await this.resend.get(`/emails/${u}`)}async list(u={}){let D=A2(u),B=D?`/emails?${D}`:"/emails";return await this.resend.get(B)}async update(u){return await this.resend.patch(`/emails/${u.id}`,{scheduled_at:u.scheduledAt})}async cancel(u){return await this.resend.post(`/emails/${u}/cancel`)}},nH=class{constructor(u){this.resend=u}async send(u){return await this.resend.post("/events/send",yH(u))}async create(u){return await this.resend.post("/events",u)}async get(u){return await this.resend.get(`/events/${encodeURIComponent(u)}`)}async list(u={}){let D=A2(u),B=D?`/events?${D}`:"/events";return await this.resend.get(B)}async update(u,D){return await this.resend.patch(`/events/${encodeURIComponent(u)}`,D)}async remove(u){return await this.resend.delete(`/events/${encodeURIComponent(u)}`)}},pH=class{constructor(u){this.resend=u}async list(u={}){let D=A2(u),B=D?`/logs?${D}`:"/logs";return await this.resend.get(B)}async get(u){return await this.resend.get(`/logs/${u}`)}},aH=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/segments",u,D)}async list(u={}){let D=A2(u),B=D?`/segments?${D}`:"/segments";return await this.resend.get(B)}async get(u){return await this.resend.get(`/segments/${u}`)}async remove(u){return await this.resend.delete(`/segments/${u}`)}};function sH(u={}){let D=new URLSearchParams;if(u.before)D.set("before",u.before);if(u.after)D.set("after",u.after);if(u.limit)D.set("limit",u.limit.toString());return D.size>0?`?${D.toString()}`:""}function tH(u){return u?.map((D)=>({key:D.key,type:D.type,fallback_value:D.fallbackValue}))}function BY(u){return{name:"name"in u?u.name:void 0,subject:u.subject,html:u.html,text:u.text,alias:u.alias,from:u.from,reply_to:u.replyTo,variables:tH(u.variables)}}var AY=class{constructor(u,D){this.promise=u,this.publishFn=D}then(u,D){return this.promise.then(u,D)}async publish(){let{data:u,error:D}=await this.promise;if(D)return{data:null,headers:null,error:D};return this.publishFn(u.id)}},oH=class{constructor(u){this.resend=u}create(u){return new AY(this.performCreate(u),this.publish.bind(this))}async performCreate(u){if(u.react){if(!this.renderAsync)try{let{renderAsync:D}=await import("@react-email/render");this.renderAsync=D}catch{throw Error("Failed to render React component. Make sure to install `@react-email/render`")}u.html=await this.renderAsync(u.react)}return this.resend.post("/templates",BY(u))}async remove(u){return await this.resend.delete(`/templates/${u}`)}async get(u){return await this.resend.get(`/templates/${u}`)}async list(u={}){return this.resend.get(`/templates${sH(u)}`)}duplicate(u){return new AY(this.resend.post(`/templates/${u}/duplicate`),this.publish.bind(this))}async publish(u){return await this.resend.post(`/templates/${u}/publish`)}async update(u,D){return await this.resend.patch(`/templates/${u}`,BY(D))}},eH=class{constructor(u){this.resend=u}async create(u){let{defaultSubscription:D,...B}=u;return await this.resend.post("/topics",{...B,default_subscription:D})}async list(){return await this.resend.get("/topics")}async get(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.get(`/topics/${u}`)}async update(u){if(!u.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.patch(`/topics/${u.id}`,u)}async remove(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.delete(`/topics/${u}`)}},uU=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/webhooks",u,D)}async get(u){return await this.resend.get(`/webhooks/${u}`)}async list(u={}){let D=A2(u),B=D?`/webhooks?${D}`:"/webhooks";return await this.resend.get(B)}async update(u,D){return await this.resend.patch(`/webhooks/${u}`,D)}async remove(u){return await this.resend.delete(`/webhooks/${u}`)}verify(u){return new NY.Webhook(u.webhookSecret).verify(u.payload,{"svix-id":u.headers.id,"svix-timestamp":u.headers.timestamp,"svix-signature":u.headers.signature})}},wY="https://api.resend.com",FY=`resend-node:${OH}`,DU=typeof process<"u"&&process.env?process.env.RESEND_BASE_URL||wY:wY,BU=typeof process<"u"&&process.env?process.env.RESEND_USER_AGENT||FY:FY,zY=class{constructor(u){if(this.key=u,this.segments=new aH(this),this.apiKeys=new CH(this),this.audiences=this.segments,this.automations=new VH(this),this.batch=new IH(this),this.broadcasts=new qH(this),this.contactProperties=new mH(this),this.contacts=new fH(this),this.domains=new jH(this),this.emails=new iH(this),this.events=new nH(this),this.logs=new pH(this),this.templates=new oH(this),this.topics=new eH(this),this.webhooks=new uU(this),!u){if(typeof process<"u"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":BU,"Content-Type":"application/json"})}async fetchRequest(u,D={}){try{let B=await fetch(`${DU}${u}`,D);if(!B.ok)try{let A=await B.text();return{data:null,error:JSON.parse(A),headers:Object.fromEntries(B.headers.entries())}}catch(A){if(A instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:B.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(B.headers.entries())};let w={message:B.statusText,statusCode:B.status,name:"application_error"};if(A instanceof Error)return{data:null,error:{...w,message:A.message},headers:Object.fromEntries(B.headers.entries())};return{data:null,error:w,headers:Object.fromEntries(B.headers.entries())}}return{data:await B.json(),error:null,headers:Object.fromEntries(B.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(u,D,B={}){let A=new Headers(this.headers);if(B.headers)for(let[F,N]of new Headers(B.headers).entries())A.set(F,N);if(B.idempotencyKey)A.set("Idempotency-Key",B.idempotencyKey);let w={method:"POST",body:JSON.stringify(D),...B,headers:A};return this.fetchRequest(u,w)}async get(u,D={}){let B=new Headers(this.headers);if(D.headers)for(let[w,F]of new Headers(D.headers).entries())B.set(w,F);let A={method:"GET",...D,headers:B};return this.fetchRequest(u,A)}async put(u,D,B={}){let A=new Headers(this.headers);if(B.headers)for(let[F,N]of new Headers(B.headers).entries())A.set(F,N);let w={method:"PUT",body:JSON.stringify(D),...B,headers:A};return this.fetchRequest(u,w)}async patch(u,D,B={}){let A=new Headers(this.headers);if(B.headers)for(let[F,N]of new Headers(B.headers).entries())A.set(F,N);let w={method:"PATCH",body:JSON.stringify(D),...B,headers:A};return this.fetchRequest(u,w)}async delete(u,D){let B={method:"DELETE",body:JSON.stringify(D),headers:this.headers};return this.fetchRequest(u,B)}};class vD{}class zD extends vD{apiKey;constructor(u=process.env.RESEND_API_KEY){super();this.apiKey=u}async send(u){let D=new zY(this.apiKey),{data:B,error:A}=await D.emails.send({...u});if(A)return console.error(A),!1;if(B)return!0;return!1}}class ZY extends f{driver=new zD;headers={};boot(){}filterRecipients(u){return u}}class JY extends f{channels={};boot(){}}class QY extends f{root;rootRouter;boot(){}onRequestStart(u){}onRequestEnd(u){}onRequestFail(u,D){}}class WY extends f{rootRouter;boot(){}onRequestStart(u){}onRequestEnd(u){}onRequestFail(u,D){}}class XY extends f{maxFileSize=10485760;boot(){}onLogFileClosed(u){}onLogCreated(u){}}class YY extends f{jobs=[];concurrency=1;boot(){}}class KY{static name="unset";worker=!1;maxAttempts=3;run(...u){}onFail(u,...D){}onSuccess(u,...D){}onDeadletter(u,...D){}static dispatch(...u){if(this.name==="unset")throw Error("Cannot dispatch a job with no name");hY.use().push(this,JSON.stringify(u))}}import AU from"sharp";class ZD{}class JD extends ZD{async resize(u,D){let{height:B,width:A,quality:w,fit:F}=D;return await AU(u).resize(A>0?A:void 0,B>0?B:void 0,{fit:F}).webp({quality:w>0?w:80,force:!0}).toBuffer()}}class xY extends f{driver=new JD;boot(){}}class g0{}var wU={clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET,redirectPath:"/auth/oauth/google/callback",scope:"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"};class SY extends g0{config;constructor(u={}){super();this.config={...wU,...u}}getRedirectUrl(){let u=this.config.scope,D=this.config.clientId,B=new URL("https://accounts.google.com/o/oauth2/v2/auth"),A={scope:u,include_granted_scopes:"true",response_type:"code",state:"state_parameter_passthrough_value",redirect_uri:`${process.env.HOST_NAME}/auth/oauth/google/callback`,client_id:D};for(let[F,N]of Object.entries(A))B.searchParams.append(F,N);return B.toString()}async onCallback(u){let D=new URL("https://oauth2.googleapis.com/token");D.searchParams.append("code",u.search.get("code")),D.searchParams.append("client_id",this.config.clientId),D.searchParams.append("client_secret",this.config.clientSecret),D.searchParams.append("grant_type","authorization_code"),D.searchParams.append("redirect_uri",`${process.env.HOST_NAME}${this.config.redirectPath}`);let B=await fetch(D.toString(),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}),{access_token:A}=await B.json(),F=await(await fetch(`https://www.googleapis.com/oauth2/v3/userinfo?access_token=${A}`)).json();if(!F.email)console.error("Google OAuth error: email not found in user info response",F);return{name:F.name,email:F.email}}}var o2="https://api.x.com/2/",_0="https://api.x.com/labs/2/",e2="https://api.x.com/1.1/",g2="https://upload.x.com/1.1/",RY="https://stream.x.com/1.1/",f0="https://ads-api.x.com/12/",b0="https://ads-api-sandbox.twitter.com/12/";class T8{constructor({realData:u,rateLimit:D,instance:B,queryParams:A,sharedParams:w}){this._maxResultsWhenFetchLast=100,this._realData=u,this._rateLimit=D,this._instance=B,this._queryParams=A,this._sharedParams=w}get _isRateLimitOk(){if(!this._rateLimit)return!0;if(this._rateLimit.reset*1000<Date.now())return!0;return this._rateLimit.remaining>0}makeRequest(u){return this._instance.get(this.getEndpoint(),u,{fullResponse:!0,params:this._sharedParams})}makeNewInstanceFromResult(u,D){return new this.constructor({realData:u.data,rateLimit:u.rateLimit,instance:this._instance,queryParams:D,sharedParams:this._sharedParams})}getEndpoint(){return this._endpoint}injectQueryParams(u){return{...u?{max_results:u}:{},...this._queryParams}}async next(u){let D=this.getNextQueryParams(u),B=await this.makeRequest(D);return this.makeNewInstanceFromResult(B,D)}async fetchNext(u){let D=this.getNextQueryParams(u),B=await this.makeRequest(D);return await this.refreshInstanceFromResult(B,!0),this}async fetchLast(u=1/0){let D=this.getNextQueryParams(this._maxResultsWhenFetchLast),B=0;while(B<u&&this._isRateLimitOk){let A=await this.makeRequest(D);if(await this.refreshInstanceFromResult(A,!0),B+=this.getPageLengthFromRequest(A),this.isFetchLastOver(A))break;D=this.getNextQueryParams(this._maxResultsWhenFetchLast)}return this}get rateLimit(){var u;return{...(u=this._rateLimit)!==null&&u!==void 0?u:{}}}get data(){return this._realData}get done(){return!this.canFetchNextPage(this._realData)}*[Symbol.iterator](){yield*this.getItemArray()}async*[Symbol.asyncIterator](){yield*this.getItemArray();let u=this,D=this.canFetchNextPage(this._realData);while(D&&this._isRateLimitOk&&u.getItemArray().length>0){let B=await u.next(this._maxResultsWhenFetchLast);this.refreshInstanceFromResult({data:B._realData,headers:{},rateLimit:B._rateLimit},!0),D=this.canFetchNextPage(B._realData),yield*B.getItemArray(),u=B}}async*fetchAndIterate(){for(let B of this.getItemArray())yield[B,this];let u=this,D=this.canFetchNextPage(this._realData);while(D&&this._isRateLimitOk&&u.getItemArray().length>0){let B=await u.next(this._maxResultsWhenFetchLast);this.refreshInstanceFromResult({data:B._realData,headers:{},rateLimit:B._rateLimit},!0),D=this.canFetchNextPage(B._realData);for(let A of B.getItemArray())yield[A,B];this._rateLimit=B._rateLimit,u=B}}}class I8 extends T8{async previous(u){let D=this.getPreviousQueryParams(u),B=await this.makeRequest(D);return this.makeNewInstanceFromResult(B,D)}async fetchPrevious(u){let D=this.getPreviousQueryParams(u),B=await this.makeRequest(D);return await this.refreshInstanceFromResult(B,!1),this}}var j0=T8;class w2 extends j0{getNextQueryParams(u){var D;return{...this._queryParams,cursor:(D=this._realData.next_cursor_str)!==null&&D!==void 0?D:this._realData.next_cursor,...u?{count:u}:{}}}isFetchLastOver(u){return!this.canFetchNextPage(u.data)}canFetchNextPage(u){return!this.isNextCursorInvalid(u.next_cursor)||!this.isNextCursorInvalid(u.next_cursor_str)}isNextCursorInvalid(u){return u===void 0||u===0||u===-1||u==="0"||u==="-1"}}class q8 extends w2{constructor(){super(...arguments);this._endpoint="direct_messages/events/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.events.push(...B.events),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.events.length}getItemArray(){return this.events}get events(){return this._realData.events}}class m8 extends w2{constructor(){super(...arguments);this._endpoint="direct_messages/welcome_messages/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.welcome_messages.push(...B.welcome_messages),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.welcome_messages.length}getItemArray(){return this.welcomeMessages}get welcomeMessages(){return this._realData.welcome_messages}}var m;(function(u){u.Jpeg="image/jpeg",u.Mp4="video/mp4",u.Mov="video/quicktime",u.Gif="image/gif",u.Png="image/png",u.Srt="text/plain",u.Webp="image/webp"})(m||(m={}));var u0;(function(u){u.Create="message_create",u.WelcomeCreate="welcome_message"})(u0||(u0={}));var Lu;(function(u){u.Request="request",u.PartialResponse="partial-response",u.Response="response"})(Lu||(Lu={}));class QD extends Error{constructor(){super(...arguments);this.error=!0}}class Eu extends QD{constructor(u,D){super(u);this.type=Lu.Request,Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"_options",{value:D})}get request(){return this._options.request}get requestError(){return this._options.requestError}toJSON(){return{type:this.type,error:this.requestError}}}class Ou extends QD{constructor(u,D){super(u);this.type=Lu.PartialResponse,Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"_options",{value:D})}get request(){return this._options.request}get response(){return this._options.response}get responseError(){return this._options.responseError}get rawContent(){return this._options.rawContent}toJSON(){return{type:this.type,error:this.responseError}}}class Cu extends QD{constructor(u,D){super(u);if(this.type=Lu.Response,Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"_options",{value:D}),this.code=D.code,this.headers=D.headers,this.rateLimit=D.rateLimit,D.data&&typeof D.data==="object"&&"error"in D.data&&!D.data.errors){let B={...D.data};B.errors=[{code:z0.InternalError,message:B.error}],this.data=B}else this.data=D.data}get request(){return this._options.request}get response(){return this._options.response}hasErrorCode(...u){let D=this.errors;if(!(D===null||D===void 0?void 0:D.length))return!1;if("code"in D[0])return D.some((w)=>u.includes(w.code));let B=this.data;return u.includes(B.type)}get errors(){var u;return(u=this.data)===null||u===void 0?void 0:u.errors}get rateLimitError(){return this.code===420||this.code===429}get isAuthError(){if(this.code===401)return!0;return this.hasErrorCode(z0.AuthTimestampInvalid,z0.AuthenticationFail,z0.BadAuthenticationData,z0.InvalidOrExpiredToken)}toJSON(){return{type:this.type,code:this.code,error:this.data,rateLimit:this.rateLimit,headers:this.headers}}}var z0;(function(u){u[u.InvalidCoordinates=3]="InvalidCoordinates",u[u.NoLocationFound=13]="NoLocationFound",u[u.AuthenticationFail=32]="AuthenticationFail",u[u.InvalidOrExpiredToken=89]="InvalidOrExpiredToken",u[u.UnableToVerifyCredentials=99]="UnableToVerifyCredentials",u[u.AuthTimestampInvalid=135]="AuthTimestampInvalid",u[u.BadAuthenticationData=215]="BadAuthenticationData",u[u.NoUserMatch=17]="NoUserMatch",u[u.UserNotFound=50]="UserNotFound",u[u.ResourceNotFound=34]="ResourceNotFound",u[u.TweetNotFound=144]="TweetNotFound",u[u.TweetNotVisible=179]="TweetNotVisible",u[u.NotAllowedResource=220]="NotAllowedResource",u[u.MediaIdNotFound=325]="MediaIdNotFound",u[u.TweetNoLongerAvailable=421]="TweetNoLongerAvailable",u[u.TweetViolatedRules=422]="TweetViolatedRules",u[u.TargetUserSuspended=63]="TargetUserSuspended",u[u.YouAreSuspended=64]="YouAreSuspended",u[u.AccountUpdateFailed=120]="AccountUpdateFailed",u[u.NoSelfSpamReport=36]="NoSelfSpamReport",u[u.NoSelfMute=271]="NoSelfMute",u[u.AccountLocked=326]="AccountLocked",u[u.RateLimitExceeded=88]="RateLimitExceeded",u[u.NoDMRightForApp=93]="NoDMRightForApp",u[u.OverCapacity=130]="OverCapacity",u[u.InternalError=131]="InternalError",u[u.TooManyFollowings=161]="TooManyFollowings",u[u.TweetLimitExceeded=185]="TweetLimitExceeded",u[u.DuplicatedTweet=187]="DuplicatedTweet",u[u.TooManySpamReports=205]="TooManySpamReports",u[u.RequestLooksLikeSpam=226]="RequestLooksLikeSpam",u[u.NoWriteRightForApp=261]="NoWriteRightForApp",u[u.TweetActionsDisabled=425]="TweetActionsDisabled",u[u.TweetRepliesRestricted=433]="TweetRepliesRestricted",u[u.NamedParameterMissing=38]="NamedParameterMissing",u[u.InvalidAttachmentUrl=44]="InvalidAttachmentUrl",u[u.TweetTextTooLong=186]="TweetTextTooLong",u[u.MissingUrlParameter=195]="MissingUrlParameter",u[u.NoMultipleGifs=323]="NoMultipleGifs",u[u.InvalidMediaIds=324]="InvalidMediaIds",u[u.InvalidUrl=407]="InvalidUrl",u[u.TooManyTweetAttachments=386]="TooManyTweetAttachments",u[u.StatusAlreadyFavorited=139]="StatusAlreadyFavorited",u[u.FollowRequestAlreadySent=160]="FollowRequestAlreadySent",u[u.CannotUnmuteANonMutedAccount=272]="CannotUnmuteANonMutedAccount",u[u.TweetAlreadyRetweeted=327]="TweetAlreadyRetweeted",u[u.ReplyToDeletedTweet=385]="ReplyToDeletedTweet",u[u.DMReceiverNotFollowingYou=150]="DMReceiverNotFollowingYou",u[u.UnableToSendDM=151]="UnableToSendDM",u[u.MustAllowDMFromAnyone=214]="MustAllowDMFromAnyone",u[u.CannotSendDMToThisUser=349]="CannotSendDMToThisUser",u[u.DMTextTooLong=354]="DMTextTooLong",u[u.SubscriptionAlreadyExists=355]="SubscriptionAlreadyExists",u[u.CallbackUrlNotApproved=415]="CallbackUrlNotApproved",u[u.SuspendedApplication=416]="SuspendedApplication",u[u.OobOauthIsNotAllowed=417]="OobOauthIsNotAllowed"})(z0||(z0={}));var HY;(function(u){u.InvalidRequest="https://developer.x.com/en/support/x-api/error-troubleshooting#invalid-request",u.ClientForbidden="https://developer.x.com/en/support/x-api/error-troubleshooting#client-forbidden",u.UnsupportedAuthentication="https://developer.x.com/en/support/x-api/error-troubleshooting#unsupported-authentication",u.InvalidRules="https://developer.x.com/en/support/x-api/error-troubleshooting#invalid-rules",u.TooManyRules="https://developer.x.com/en/support/x-api/error-troubleshooting#rule-cap",u.DuplicatedRules="https://developer.x.com/en/support/x-api/error-troubleshooting#duplicate-rules",u.RateLimitExceeded="https://developer.x.com/en/support/x-api/error-troubleshooting#usage-capped",u.ConnectionError="https://developer.x.com/en/support/x-api/error-troubleshooting#streaming-connection",u.ClientDisconnected="https://developer.x.com/en/support/x-api/error-troubleshooting#client-disconnected",u.TwitterDisconnectedYou="https://developer.x.com/en/support/x-api/error-troubleshooting#operational-disconnect",u.ResourceNotFound="https://developer.x.com/en/support/x-api/error-troubleshooting#resource-not-found",u.ResourceUnauthorized="https://developer.x.com/en/support/x-api/error-troubleshooting#not-authorized-for-resource",u.DisallowedResource="https://developer.x.com/en/support/x-api/error-troubleshooting#disallowed-resource"})(HY||(HY={}));var c;(function(u){u.Connected="connected",u.ConnectError="connect error",u.ConnectionError="connection error",u.ConnectionClosed="connection closed",u.ConnectionLost="connection lost",u.ReconnectAttempt="reconnect attempt",u.Reconnected="reconnected",u.ReconnectError="reconnect error",u.ReconnectLimitExceeded="reconnect limit exceeded",u.DataKeepAlive="data keep-alive",u.Data="data event content",u.DataError="data twitter error",u.TweetParseError="data tweet parse error",u.Error="stream error"})(c||(c={}));class Pu{constructor(u){this.value=u}}import*as v5 from"fs";var N2={debug:!1,deprecationWarnings:!0,logger:{log:console.log.bind(console)}};function g8(u){let D={value:void 0,promise:u().then((B)=>{return D.value=B,B})};return D}function WD(u){if(Array.isArray(u))return u;return[u]}function cY(u){for(let D of Object.keys(u))if(u[D]===void 0)delete u[D]}function XD(u){return typeof u==="object"&&"errors"in u&&!("data"in u)}function ku(u){if(Array.isArray(u)&&u.length>1)return!0;return u.toString().includes(",")}var UY=new Set;function _8(u){if(typeof console>"u"||!console.warn||!N2.deprecationWarnings)return;let D=`${u.instance}-${u.method}-${u.problem}`;if(UY.has(D))return;let B=`[twitter-api-v2] Deprecation warning: In ${u.instance}.${u.method}() call, ${u.problem}.
|
|
41
|
-
${u.resolution}.`;console.warn(B),console.warn("To disable this message, import variable TwitterApiV2Settings from twitter-api-v2 and set TwitterApiV2Settings.deprecationWarnings to false."),UY.add(D)}import{EventEmitter as vU}from"events";import{request as FU}from"https";import*as K2 from"zlib";import{EventEmitter as NU}from"events";class MY{constructor(u){this.requestData=u,this.requestErrorHandled=!1,this.responseData=[]}get hrefPathname(){let u=this.requestData.url;return u.hostname+u.pathname}isCompressionDisabled(){return!this.requestData.compression||this.requestData.compression==="identity"}isFormEncodedEndpoint(){return this.requestData.url.href.startsWith("https://api.x.com/oauth/")}createRequestError(u){if(N2.debug)N2.logger.log("Request error:",u);return new Eu("Request failed.",{request:this.req,error:u})}createPartialResponseError(u,D){let A=`Request failed with partial response with HTTP code ${this.res.statusCode}`;if(D)A+=" (connection abruptly closed)";else A+=" (parse error)";return new Ou(A,{request:this.req,response:this.res,responseError:u,rawContent:Buffer.concat(this.responseData).toString()})}formatV1Errors(u){return u.map(({code:D,message:B})=>`${B} (Twitter code ${D})`).join(", ")}formatV2Error(u){return`${u.title}: ${u.detail} (see ${u.type})`}createResponseError({res:u,data:D,rateLimit:B,code:A}){var w;if(N2.debug)N2.logger.log(`Request failed with code ${A}, data:`,D),N2.logger.log("Response headers:",u.headers);let F=`Request failed with code ${A}`;if((w=D===null||D===void 0?void 0:D.errors)===null||w===void 0?void 0:w.length){let N=D.errors;if(typeof N[0]==="object"&&"code"in N[0])F+=" - "+this.formatV1Errors(N);else F+=" - "+this.formatV2Error(D)}return new Cu(F,{code:A,data:D,headers:u.headers,request:this.req,response:u,rateLimit:B})}getResponseDataStream(u){if(this.isCompressionDisabled())return u;let D=(u.headers["content-encoding"]||"identity").trim().toLowerCase();if(D==="br"){let B=K2.createBrotliDecompress({flush:K2.constants.BROTLI_OPERATION_FLUSH,finishFlush:K2.constants.BROTLI_OPERATION_FLUSH});return u.pipe(B),B}if(D==="gzip"){let B=K2.createGunzip({flush:K2.constants.Z_SYNC_FLUSH,finishFlush:K2.constants.Z_SYNC_FLUSH});return u.pipe(B),B}if(D==="deflate"){let B=K2.createInflate({flush:K2.constants.Z_SYNC_FLUSH,finishFlush:K2.constants.Z_SYNC_FLUSH});return u.pipe(B),B}return u}detectResponseType(u){var D,B;if(((D=u.headers["content-type"])===null||D===void 0?void 0:D.includes("application/json"))||((B=u.headers["content-type"])===null||B===void 0?void 0:B.includes("application/problem+json")))return"json";else if(this.isFormEncodedEndpoint())return"url";return"text"}getParsedResponse(u){let D=this.responseData,B=this.requestData.forceParseMode||this.detectResponseType(u);if(B==="buffer")return Buffer.concat(D);else if(B==="text")return Buffer.concat(D).toString();else if(B==="json"){let A=Buffer.concat(D).toString();return A.length?JSON.parse(A):void 0}else if(B==="url"){let A=Buffer.concat(D).toString(),w={};for(let[F,N]of new URLSearchParams(A))w[F]=N;return w}else return}getRateLimitFromResponse(u){let D=void 0;if(u.headers["x-rate-limit-limit"]){if(D={limit:Number(u.headers["x-rate-limit-limit"]),remaining:Number(u.headers["x-rate-limit-remaining"]),reset:Number(u.headers["x-rate-limit-reset"])},u.headers["x-app-limit-24hour-limit"])D.day={limit:Number(u.headers["x-app-limit-24hour-limit"]),remaining:Number(u.headers["x-app-limit-24hour-remaining"]),reset:Number(u.headers["x-app-limit-24hour-reset"])};if(u.headers["x-user-limit-24hour-limit"])D.userDay={limit:Number(u.headers["x-user-limit-24hour-limit"]),remaining:Number(u.headers["x-user-limit-24hour-remaining"]),reset:Number(u.headers["x-user-limit-24hour-reset"])};if(this.requestData.rateLimitSaver)this.requestData.rateLimitSaver(D)}return D}onSocketEventHandler(u,D,B){let A=this.onSocketCloseHandler.bind(this,u);B.on("close",A),D.on("complete",()=>B.off("close",A))}onSocketCloseHandler(u){if(this.req.removeAllListeners("timeout"),this.res)return;if(!this.requestErrorHandled)return u(this.createRequestError(Error("Socket closed without any information.")))}requestErrorHandler(u,D){var B,A;(A=(B=this.requestData).requestEventDebugHandler)===null||A===void 0||A.call(B,"request-error",{requestError:D}),this.requestErrorHandled=!0,u(this.createRequestError(D))}timeoutErrorHandler(){this.requestErrorHandled=!0,this.req.destroy(Error("Request timeout."))}classicResponseHandler(u,D,B){this.res=B;let A=this.getResponseDataStream(B);if(A.on("data",(w)=>this.responseData.push(w)),A.on("end",this.onResponseEndHandler.bind(this,u,D)),A.on("close",this.onResponseCloseHandler.bind(this,u,D)),this.requestData.requestEventDebugHandler)this.requestData.requestEventDebugHandler("response",{res:B}),B.on("aborted",(w)=>this.requestData.requestEventDebugHandler("response-aborted",{error:w})),B.on("error",(w)=>this.requestData.requestEventDebugHandler("response-error",{error:w})),B.on("close",()=>this.requestData.requestEventDebugHandler("response-close",{data:this.responseData})),B.on("end",()=>this.requestData.requestEventDebugHandler("response-end"))}onResponseEndHandler(u,D){let B=this.getRateLimitFromResponse(this.res),A;try{A=this.getParsedResponse(this.res)}catch(F){D(this.createPartialResponseError(F,!1));return}let w=this.res.statusCode;if(w>=400){D(this.createResponseError({data:A,res:this.res,rateLimit:B,code:w}));return}if(N2.debug)N2.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${this.res.statusCode}`),N2.logger.log("Response body:",A);u({data:A,headers:this.res.headers,rateLimit:B})}onResponseCloseHandler(u,D){let B=this.res;if(B.aborted)try{return this.getParsedResponse(this.res),this.onResponseEndHandler(u,D)}catch(A){return D(this.createPartialResponseError(A,!0))}if(!B.complete)return D(this.createPartialResponseError(Error("Response has been interrupted before response could be parsed."),!0))}streamResponseHandler(u,D,B){if(B.statusCode<400){if(N2.debug)N2.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${B.statusCode} (starting stream)`);let w=this.getResponseDataStream(B);u({req:this.req,res:w,originalResponse:B,requestData:this.requestData})}else this.classicResponseHandler(()=>{return},D,B)}debugRequest(){let u=this.requestData.url;if(N2.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]`,this.requestData.options),u.search)N2.logger.log("Request parameters:",[...u.searchParams.entries()].map(([D,B])=>`${D}: ${B}`));if(this.requestData.body)N2.logger.log("Request body:",this.requestData.body)}buildRequest(){var u;let D=this.requestData.url,B=D.username?`${D.username}:${D.password}`:void 0,A=(u=this.requestData.options.headers)!==null&&u!==void 0?u:{};if(this.requestData.compression===!0||this.requestData.compression==="brotli")A["accept-encoding"]="br;q=1.0, gzip;q=0.8, deflate;q=0.5, *;q=0.1";else if(this.requestData.compression==="gzip")A["accept-encoding"]="gzip;q=1, deflate;q=0.5, *;q=0.1";else if(this.requestData.compression==="deflate")A["accept-encoding"]="deflate;q=1, *;q=0.1";if(N2.debug)this.debugRequest();this.req=FU({...this.requestData.options,host:D.hostname,port:D.port||void 0,path:D.pathname+D.search,protocol:D.protocol,auth:B,headers:A})}registerRequestEventDebugHandlers(u){u.on("close",()=>this.requestData.requestEventDebugHandler("close")),u.on("abort",()=>this.requestData.requestEventDebugHandler("abort")),u.on("socket",(D)=>{this.requestData.requestEventDebugHandler("socket",{socket:D}),D.on("error",(B)=>this.requestData.requestEventDebugHandler("socket-error",{socket:D,error:B})),D.on("connect",()=>this.requestData.requestEventDebugHandler("socket-connect",{socket:D})),D.on("close",(B)=>this.requestData.requestEventDebugHandler("socket-close",{socket:D,withError:B})),D.on("end",()=>this.requestData.requestEventDebugHandler("socket-end",{socket:D})),D.on("lookup",(...B)=>this.requestData.requestEventDebugHandler("socket-lookup",{socket:D,data:B})),D.on("timeout",()=>this.requestData.requestEventDebugHandler("socket-timeout",{socket:D}))})}makeRequest(){return this.buildRequest(),new Promise((u,D)=>{let B=(N)=>{w.emit("complete"),u(N)},A=(N)=>{w.emit("complete"),D(N)},w=new NU,F=this.req;if(F.on("error",this.requestErrorHandler.bind(this,A)),F.on("socket",this.onSocketEventHandler.bind(this,A,w)),F.on("response",this.classicResponseHandler.bind(this,B,A)),this.requestData.options.timeout)F.on("timeout",this.timeoutErrorHandler.bind(this));if(this.requestData.requestEventDebugHandler)this.registerRequestEventDebugHandlers(F);if(this.requestData.body)F.write(this.requestData.body);F.end()})}async makeRequestAsStream(){let{req:u,res:D,requestData:B,originalResponse:A}=await this.makeRequestAndResolveWhenReady();return new YD(B,{req:u,res:D,originalResponse:A})}makeRequestAndResolveWhenReady(){return this.buildRequest(),new Promise((u,D)=>{let B=this.req;if(B.on("error",this.requestErrorHandler.bind(this,D)),B.on("response",this.streamResponseHandler.bind(this,u,D)),this.requestData.body)B.write(this.requestData.body);B.end()})}}var yu=MY;import{EventEmitter as GU}from"events";class LY extends GU{constructor(u){super();this.stream=u,this.stack=[],this.onStreamData=this.onStreamData.bind(this),this.onStreamError=this.onStreamError.bind(this),this.onceNewEvent=this.once.bind(this,"event"),u.on(c.Data,this.onStreamData),u.on(c.ConnectionError,this.onStreamError),u.on(c.TweetParseError,this.onStreamError),u.on(c.ConnectionClosed,this.onStreamError)}nextEvent(){return new Promise(this.onceNewEvent)}hasStack(){return this.stack.length>0}popStack(){let u=this.stack;return this.stack=[],u}destroy(){this.removeAllListeners(),this.stream.off(c.Data,this.onStreamData),this.stream.off(c.ConnectionError,this.onStreamError),this.stream.off(c.TweetParseError,this.onStreamError),this.stream.off(c.ConnectionClosed,this.onStreamError)}emitEvent(u,D){this.emit("event",{type:u,payload:D})}onStreamError(u){this.emitEvent("error",u)}onStreamData(u){this.stack.push(u),this.emitEvent("data",u)}}var EY=LY;import{EventEmitter as $U}from"events";class hD extends $U{constructor(){super(...arguments);this.currentMessage=""}push(u){this.currentMessage+=u,u=this.currentMessage;let D=u.length,B=0,A=0;while(A<D){if(u.slice(A,A+2)===`\r
|
|
42
|
-
`){let w=u.slice(B,A);if(B=A+=2,!w.length)continue;try{let F=JSON.parse(w);if(F){this.emit(
|
|
43
|
-
`)return this.emit(
|
|
44
|
-
`;V2.DEFAULT_CONTENT_TYPE="application/octet-stream";class f8{static formatQueryToString(u){let D={};for(let B in u)if(typeof u[B]==="string")D[B]=u[B];else if(typeof u[B]<"u")D[B]=String(u[B]);return D}static autoDetectBodyType(u){if(u.pathname.startsWith("/2/")||u.pathname.startsWith("/labs/2/")){if(u.password.startsWith("/2/oauth2"))return"url";return"json"}if(u.hostname==="upload.x.com"){if(u.pathname==="/1.1/media/upload.json")return"form-data";return"json"}let D=u.pathname.split("/1.1/",2)[1];if(this.JSON_1_1_ENDPOINTS.has(D))return"json";return"url"}static addQueryParamsToUrl(u,D){let B=Object.entries(D);if(B.length){let A="";for(let[w,F]of B)A+=(A.length?"&":"?")+`${Vu.percentEncode(w)}=${Vu.percentEncode(F)}`;u.search=A}}static constructBodyParams(u,D,B){if(u instanceof Buffer)return u;if(B==="json"){if(!D["content-type"])D["content-type"]="application/json;charset=UTF-8";return JSON.stringify(u)}else if(B==="url"){if(!D["content-type"])D["content-type"]="application/x-www-form-urlencoded;charset=UTF-8";if(Object.keys(u).length)return new URLSearchParams(u).toString().replace(/\*/g,"%2A");return""}else if(B==="raw")throw Error("You can only use raw body mode with Buffers. To give a string, use Buffer.from(str).");else{let A=new V2;for(let w in u)A.append(w,u[w]);if(!D["content-type"]){let w=A.getHeaders();D["content-type"]=w["content-type"]}return A.getBuffer()}}static setBodyLengthHeader(u,D){var B;if(u.headers=(B=u.headers)!==null&&B!==void 0?B:{},typeof D==="string")u.headers["content-length"]=Buffer.byteLength(D);else u.headers["content-length"]=D.length}static isOAuthSerializable(u){return!(u instanceof Buffer)}static mergeQueryAndBodyForOAuth(u,D){let B={};for(let A in u)B[A]=u[A];if(this.isOAuthSerializable(D))for(let A in D){let w=D[A];if(this.isOAuthSerializable(w))B[A]=typeof w==="object"&&w!==null&&"toString"in w?w.toString():w}return B}static moveUrlQueryParamsIntoObject(u,D){for(let[B,A]of u.searchParams)D[B]=A;return u.search="",u}static applyRequestParametersToUrl(u,D){return u.pathname=u.pathname.replace(/:([A-Z_-]+)/ig,(B,A)=>{if(D[A]!==void 0)return String(D[A]);return B}),u}}f8.JSON_1_1_ENDPOINTS=new Set(["direct_messages/events/new.json","direct_messages/welcome_messages/new.json","direct_messages/welcome_messages/rules/new.json","media/metadata/create.json","collections/entries/curate.json"]);var C2=f8;import*as IY from"crypto";class J0{static getCodeVerifier(){return this.generateRandomString(128)}static getCodeChallengeFromVerifier(u){return this.escapeBase64Url(IY.createHash("sha256").update(u).digest("base64"))}static getAuthHeader(u,D){let B=encodeURIComponent(u)+":"+encodeURIComponent(D);return Buffer.from(B).toString("base64")}static generateRandomString(u){let D="",B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";for(let A=0;A<u;A++)D+=B[Math.floor(Math.random()*B.length)];return D}static escapeBase64Url(u){return u.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}class l0{constructor(u){if(this.rateLimits={},this.clientSettings={},u)this.clientSettings=u}getRateLimits(){return this.rateLimits}saveRateLimit(u,D){this.rateLimits[u]=D}async send(u){var D,B,A,w,F;if((D=this.clientSettings.plugins)===null||D===void 0?void 0:D.length){let Z=await this.applyPreRequestConfigHooks(u);if(Z)return Z}let N=this.getHttpRequestArgs(u),G={method:N.method,headers:N.headers,timeout:u.timeout,agent:this.clientSettings.httpAgent},v=u.enableRateLimitSave!==!1;if(N.body)C2.setBodyLengthHeader(G,N.body);if((B=this.clientSettings.plugins)===null||B===void 0?void 0:B.length)await this.applyPreRequestHooks(u,N,G);let z=new yu({url:N.url,options:G,body:N.body,rateLimitSaver:v?this.saveRateLimit.bind(this,N.rawUrl):void 0,requestEventDebugHandler:u.requestEventDebugHandler,compression:(w=(A=u.compression)!==null&&A!==void 0?A:this.clientSettings.compression)!==null&&w!==void 0?w:!0,forceParseMode:u.forceParseMode}).makeRequest();if(PY(this))z=this.applyResponseErrorHooks(u,N,G,z);let Q=await z;if((F=this.clientSettings.plugins)===null||F===void 0?void 0:F.length){let Z=await this.applyPostRequestHooks(u,N,G,Q);if(Z)return Z.value}return Q}sendStream(u){var D,B;if(this.clientSettings.plugins)this.applyPreStreamRequestConfigHooks(u);let A=this.getHttpRequestArgs(u),w={method:A.method,headers:A.headers,agent:this.clientSettings.httpAgent},F=u.enableRateLimitSave!==!1,N=u.autoConnect!==!1;if(A.body)C2.setBodyLengthHeader(w,A.body);let G={url:A.url,options:w,body:A.body,rateLimitSaver:F?this.saveRateLimit.bind(this,A.rawUrl):void 0,payloadIsError:u.payloadIsError,compression:(B=(D=u.compression)!==null&&D!==void 0?D:this.clientSettings.compression)!==null&&B!==void 0?B:!0},v=new YD(G);if(!N)return v;return v.connect()}initializeToken(u){if(typeof u==="string")this.bearerToken=u;else if(typeof u==="object"&&"appKey"in u){if(this.consumerToken=u.appKey,this.consumerSecret=u.appSecret,u.accessToken&&u.accessSecret)this.accessToken=u.accessToken,this.accessSecret=u.accessSecret;this._oauth=this.buildOAuth()}else if(typeof u==="object"&&"username"in u){let D=encodeURIComponent(u.username)+":"+encodeURIComponent(u.password);this.basicToken=Buffer.from(D).toString("base64")}else if(typeof u==="object"&&"clientId"in u)this.clientId=u.clientId,this.clientSecret=u.clientSecret}getActiveTokens(){if(this.bearerToken)return{type:"oauth2",bearerToken:this.bearerToken};else if(this.basicToken)return{type:"basic",token:this.basicToken};else if(this.consumerSecret&&this._oauth)return{type:"oauth-1.0a",appKey:this.consumerToken,appSecret:this.consumerSecret,accessToken:this.accessToken,accessSecret:this.accessSecret};else if(this.clientId)return{type:"oauth2-user",clientId:this.clientId};return{type:"none"}}buildOAuth(){if(!this.consumerSecret||!this.consumerToken)throw Error("Invalid consumer tokens");return new Vu({consumerKeys:{key:this.consumerToken,secret:this.consumerSecret}})}getOAuthAccessTokens(){if(!this.accessSecret||!this.accessToken)return;return{key:this.accessToken,secret:this.accessSecret}}getPlugins(){var u;return(u=this.clientSettings.plugins)!==null&&u!==void 0?u:[]}hasPlugins(){var u;return!!((u=this.clientSettings.plugins)===null||u===void 0?void 0:u.length)}async applyPluginMethod(u,D){var B;let A;for(let w of this.getPlugins()){let F=await((B=w[u])===null||B===void 0?void 0:B.call(w,D));if(F&&F instanceof Pu)A=F}return A}writeAuthHeaders({headers:u,bodyInSignature:D,url:B,method:A,query:w,body:F}){if(u={...u},this.bearerToken)u.Authorization="Bearer "+this.bearerToken;else if(this.basicToken)u.Authorization="Basic "+this.basicToken;else if(this.clientId&&this.clientSecret)u.Authorization="Basic "+J0.getAuthHeader(this.clientId,this.clientSecret);else if(this.consumerSecret&&this._oauth){let N=D?C2.mergeQueryAndBodyForOAuth(w,F):w,G=this._oauth.authorize({url:B.toString(),method:A,data:N},this.getOAuthAccessTokens());u={...u,...this._oauth.toHeader(G)}}return u}getUrlObjectFromUrlString(u){if(!u.startsWith("http"))u="https://"+u;return new URL(u)}getHttpRequestArgs({url:u,method:D,query:B={},body:A={},headers:w,forceBodyMode:F,enableAuth:N,params:G}){let v=void 0;if(D=D.toUpperCase(),w=w!==null&&w!==void 0?w:{},!w["x-user-agent"])w["x-user-agent"]="Node.twitter-api-v2";let z=this.getUrlObjectFromUrlString(u),Q=z.origin+z.pathname;if(G)C2.applyRequestParametersToUrl(z,G);let Z=C2.formatQueryToString(B);if(C2.moveUrlQueryParamsIntoObject(z,Z),!(A instanceof Buffer))cY(A);let J=F!==null&&F!==void 0?F:C2.autoDetectBodyType(z);if(N!==!1){let W=l0.BODY_METHODS.has(D)&&J==="url";w=this.writeAuthHeaders({headers:w,bodyInSignature:W,method:D,query:Z,url:z,body:A})}if(l0.BODY_METHODS.has(D))v=C2.constructBodyParams(A,w,J)||void 0;return C2.addQueryParamsToUrl(z,Z),{rawUrl:Q,url:z,method:D,headers:w,body:v}}async applyPreRequestConfigHooks(u){var D;let B=this.getUrlObjectFromUrlString(u.url);for(let A of this.getPlugins()){let w=await((D=A.onBeforeRequestConfig)===null||D===void 0?void 0:D.call(A,{client:this,url:B,params:u}));if(w)return w}}applyPreStreamRequestConfigHooks(u){var D;let B=this.getUrlObjectFromUrlString(u.url);for(let A of this.getPlugins())(D=A.onBeforeStreamRequestConfig)===null||D===void 0||D.call(A,{client:this,url:B,params:u})}async applyPreRequestHooks(u,D,B){await this.applyPluginMethod("onBeforeRequest",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B})}async applyPostRequestHooks(u,D,B,A){return await this.applyPluginMethod("onAfterRequest",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,response:A})}applyResponseErrorHooks(u,D,B,A){return A.catch(kY.bind(this,u,D,B))}}l0.BODY_METHODS=new Set(["POST","PUT","PATCH"]);class D0{constructor(u,D={}){if(this._currentUser=null,this._currentUserV2=null,u instanceof D0)this._requestMaker=u._requestMaker;else this._requestMaker=new l0(D),this._requestMaker.initializeToken(u)}setPrefix(u){this._prefix=u}cloneWithPrefix(u){let D=this.constructor(this);return D.setPrefix(u),D}getActiveTokens(){return this._requestMaker.getActiveTokens()}getPlugins(){return this._requestMaker.getPlugins()}getPluginOfType(u){return this.getPlugins().find((D)=>D instanceof u)}hasHitRateLimit(u){var D;if(this.isRateLimitStatusObsolete(u))return!1;return((D=this.getLastRateLimitStatus(u))===null||D===void 0?void 0:D.remaining)===0}isRateLimitStatusObsolete(u){let D=this.getLastRateLimitStatus(u);if(D===void 0)return!0;return D.reset*1000<Date.now()}getLastRateLimitStatus(u){let D=u.match(/^https?:\/\//)?u:this._prefix+u;return this._requestMaker.getRateLimits()[D]}getCurrentUserObject(u=!1){if(!u&&this._currentUser){if(this._currentUser.value)return Promise.resolve(this._currentUser.value);return this._currentUser.promise}return this._currentUser=g8(()=>this.get("account/verify_credentials.json",{tweet_mode:"extended"},{prefix:e2})),this._currentUser.promise}getCurrentUserV2Object(u=!1){if(!u&&this._currentUserV2){if(this._currentUserV2.value)return Promise.resolve(this._currentUserV2.value);return this._currentUserV2.promise}return this._currentUserV2=g8(()=>this.get("users/me",void 0,{prefix:o2})),this._currentUserV2.promise}async get(u,D={},{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"GET",query:D,...w});return B?F:F.data}async delete(u,D={},{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"DELETE",query:D,...w});return B?F:F.data}async post(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"POST",body:D,...w});return B?F:F.data}async put(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"PUT",body:D,...w});return B?F:F.data}async patch(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"PATCH",body:D,...w});return B?F:F.data}getStream(u,D,{prefix:B=this._prefix,...A}={}){return this._requestMaker.sendStream({url:B?B+u:u,method:"GET",query:D,...A})}postStream(u,D,{prefix:B=this._prefix,...A}={}){return this._requestMaker.sendStream({url:B?B+u:u,method:"POST",body:D,...A})}}class P2 extends D0{constructor(u){if(!(u instanceof D0))throw Error("You must instance SubTwitterApi instance from existing TwitterApi instance.");super(u)}}class d0 extends j0{constructor(){super(...arguments);this.hasFinishedFetch=!1}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.push(...B),this.hasFinishedFetch=B.length===0}getNextQueryParams(u){let D=BigInt(this._realData[this._realData.length-1].id_str);return{...this.injectQueryParams(u),max_id:(D-BigInt(1)).toString()}}getPageLengthFromRequest(u){return u.data.length}isFetchLastOver(u){return!u.data.length}canFetchNextPage(u){return u.length>0}getItemArray(){return this.tweets}get tweets(){return this._realData}get done(){return super.done||this.hasFinishedFetch}}class b8 extends d0{constructor(){super(...arguments);this._endpoint="statuses/home_timeline.json"}}class j8 extends d0{constructor(){super(...arguments);this._endpoint="statuses/mentions_timeline.json"}}class KD extends d0{constructor(){super(...arguments);this._endpoint="statuses/user_timeline.json"}}class l8 extends d0{constructor(){super(...arguments);this._endpoint="lists/statuses.json"}}class xD extends d0{constructor(){super(...arguments);this._endpoint="favorites/list.json"}}class d8 extends w2{constructor(){super(...arguments);this._endpoint="mutes/users/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class r8 extends w2{constructor(){super(...arguments);this._endpoint="mutes/users/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class i8 extends w2{constructor(){super(...arguments);this._endpoint="followers/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class n8 extends w2{constructor(){super(...arguments);this._endpoint="followers/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class p8 extends w2{constructor(){super(...arguments);this._endpoint="friends/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class a8 extends w2{constructor(){super(...arguments);this._endpoint="friends/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class s8 extends j0{constructor(){super(...arguments);this._endpoint="users/search.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.push(...B)}getNextQueryParams(u){var D;let B=Number((D=this._queryParams.page)!==null&&D!==void 0?D:"1");return{...this._queryParams,page:B+1,...u?{count:u}:{}}}getPageLengthFromRequest(u){return u.data.length}isFetchLastOver(u){return!u.data.length}canFetchNextPage(u){return u.length>0}getItemArray(){return this.users}get users(){return this._realData}}class SD extends w2{constructor(){super(...arguments);this._endpoint="friendships/incoming.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class t8 extends SD{constructor(){super(...arguments);this._endpoint="friendships/outgoing.json"}}class RD extends w2{refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.lists.push(...B.lists),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.lists.length}getItemArray(){return this.lists}get lists(){return this._realData.lists}}class o8 extends RD{constructor(){super(...arguments);this._endpoint="lists/memberships.json"}}class e8 extends RD{constructor(){super(...arguments);this._endpoint="lists/ownerships.json"}}class u5 extends RD{constructor(){super(...arguments);this._endpoint="lists/subscriptions.json"}}class D5 extends w2{refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class B5 extends D5{constructor(){super(...arguments);this._endpoint="lists/members.json"}}class A5 extends D5{constructor(){super(...arguments);this._endpoint="lists/subscribers.json"}}class r0 extends P2{constructor(){super(...arguments);this._prefix=e2}singleTweet(u,D={}){return this.get("statuses/show.json",{tweet_mode:"extended",id:u,...D})}tweets(u,D={}){return this.post("statuses/lookup.json",{tweet_mode:"extended",id:u,...D})}oembedTweet(u,D={}){return this.get("oembed",{url:`https://x.com/i/statuses/${u}`,...D},{prefix:"https://publish.x.com/"})}async homeTimeline(u={}){let D={tweet_mode:"extended",...u},B=await this.get("statuses/home_timeline.json",D,{fullResponse:!0});return new b8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async mentionTimeline(u={}){let D={tweet_mode:"extended",...u},B=await this.get("statuses/mentions_timeline.json",D,{fullResponse:!0});return new j8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userTimeline(u,D={}){let B={tweet_mode:"extended",user_id:u,...D},A=await this.get("statuses/user_timeline.json",B,{fullResponse:!0});return new KD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async userTimelineByUsername(u,D={}){let B={tweet_mode:"extended",screen_name:u,...D},A=await this.get("statuses/user_timeline.json",B,{fullResponse:!0});return new KD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async favoriteTimeline(u,D={}){let B={tweet_mode:"extended",user_id:u,...D},A=await this.get("favorites/list.json",B,{fullResponse:!0});return new xD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async favoriteTimelineByUsername(u,D={}){let B={tweet_mode:"extended",screen_name:u,...D},A=await this.get("favorites/list.json",B,{fullResponse:!0});return new xD({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}user(u){return this.get("users/show.json",{tweet_mode:"extended",...u})}users(u){return this.get("users/lookup.json",{tweet_mode:"extended",...u})}verifyCredentials(u={}){return this.get("account/verify_credentials.json",u)}async listMutedUsers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("mutes/users/list.json",D,{fullResponse:!0});return new d8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listMutedUserIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("mutes/users/ids.json",D,{fullResponse:!0});return new r8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFriendList(u={}){let D={...u},B=await this.get("friends/list.json",D,{fullResponse:!0});return new p8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowerList(u={}){let D={...u},B=await this.get("followers/list.json",D,{fullResponse:!0});return new i8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowerIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("followers/ids.json",D,{fullResponse:!0});return new n8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowingIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("friends/ids.json",D,{fullResponse:!0});return new a8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async searchUsers(u,D={}){let B={q:u,tweet_mode:"extended",page:1,...D},A=await this.get("users/search.json",B,{fullResponse:!0});return new s8({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}friendship(u){return this.get("friendships/show.json",u)}friendships(u){return this.get("friendships/lookup.json",u)}friendshipsNoRetweets(){return this.get("friendships/no_retweets/ids.json",{stringify_ids:!0})}async friendshipsIncoming(u={}){let D={stringify_ids:!0,...u},B=await this.get("friendships/incoming.json",D,{fullResponse:!0});return new SD({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async friendshipsOutgoing(u={}){let D={stringify_ids:!0,...u},B=await this.get("friendships/outgoing.json",D,{fullResponse:!0});return new t8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}accountSettings(){return this.get("account/settings.json")}userProfileBannerSizes(u){return this.get("users/profile_banner.json",u)}list(u){return this.get("lists/show.json",{tweet_mode:"extended",...u})}lists(u={}){return this.get("lists/list.json",{tweet_mode:"extended",...u})}async listMembers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/members.json",D,{fullResponse:!0});return new B5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}listGetMember(u){return this.get("lists/members/show.json",{tweet_mode:"extended",...u})}async listMemberships(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/memberships.json",D,{fullResponse:!0});return new o8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listOwnerships(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/ownerships.json",D,{fullResponse:!0});return new e8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listStatuses(u){let D={tweet_mode:"extended",...u},B=await this.get("lists/statuses.json",D,{fullResponse:!0});return new l8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listSubscribers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/subscribers.json",D,{fullResponse:!0});return new A5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}listGetSubscriber(u){return this.get("lists/subscribers/show.json",{tweet_mode:"extended",...u})}async listSubscriptions(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/subscriptions.json",D,{fullResponse:!0});return new u5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}mediaInfo(u){return this.get("media/upload.json",{command:"STATUS",media_id:u},{prefix:g2})}filterStream({autoConnect:u,...D}={}){let B={};for(let[w,F]of Object.entries(D))if(w==="follow"||w==="track")B[w]=F.toString();else if(w==="locations"){let N=F;B.locations=WD(N).map((G)=>`${G.lng},${G.lat}`).join(",")}else B[w]=F;return this.stream.postStream("statuses/filter.json",B,{autoConnect:u})}sampleStream({autoConnect:u,...D}={}){return this.stream.getStream("statuses/sample.json",D,{autoConnect:u})}get stream(){let u=new HD(this);return u.setPrefix(RY),u}trendsByPlace(u,D={}){return this.get("trends/place.json",{id:u,...D})}trendsAvailable(){return this.get("trends/available.json")}trendsClosest(u,D){return this.get("trends/closest.json",{lat:u,long:D})}geoPlace(u){return this.get("geo/id/:place_id.json",void 0,{params:{place_id:u}})}geoSearch(u){return this.get("geo/search.json",u)}geoReverseGeoCode(u){return this.get("geo/reverse_geocode.json",u)}rateLimitStatuses(...u){return this.get("application/rate_limit_status.json",{resources:u})}supportedLanguages(){return this.get("help/languages.json")}}import*as B0 from"fs";async function w5(u){let D=await F5(u);if(typeof D==="number")return new Promise((B,A)=>{B0.readFile(D,(w,F)=>{if(w)return A(w);B(F)})});else if(D instanceof Buffer)return D;else return D.readFile()}function F5(u){if(typeof u==="string")return B0.promises.open(u,"r");else if(typeof u==="number")return u;else if(typeof u==="object"&&!(u instanceof Buffer))return u;else if(!(u instanceof Buffer))throw Error("Given file is not valid, please check its type.");else return u}async function qY(u){if(typeof u==="number")return(await new Promise((B,A)=>{B0.fstat(u,(w,F)=>{if(w)A(w);B(F)})})).size;else if(u instanceof Buffer)return u.length;else return(await u.stat()).size}function mY(u,D,B){if(typeof B==="string")return B;else if(typeof u==="string"&&!D)return WU(u);else if(typeof D==="string")return XU(D);throw Error("You must specify type if file is a file handle or Buffer.")}function WU(u){if(u.endsWith(".jpeg")||u.endsWith(".jpg"))return m.Jpeg;if(u.endsWith(".png"))return m.Png;if(u.endsWith(".webp"))return m.Webp;if(u.endsWith(".gif"))return m.Gif;if(u.endsWith(".mpeg4")||u.endsWith(".mp4"))return m.Mp4;if(u.endsWith(".mov")||u.endsWith(".mov"))return m.Mov;if(u.endsWith(".srt"))return m.Srt;return _8({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"options.mimeType is missing and filename couldn't help to resolve MIME type, so it will fallback to image/jpeg",resolution:"If you except to give filenames without extensions, please specify explicitlty the MIME type using options.mimeType"}),m.Jpeg}function XU(u){if(_8({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"you're using options.type",resolution:"Remove options.type argument and migrate to options.mimeType which takes the real MIME type. If you're using type=longmp4, add options.longVideo alongside of mimeType=EUploadMimeType.Mp4"}),u==="gif")return m.Gif;if(u==="jpg")return m.Jpeg;if(u==="png")return m.Png;if(u==="webp")return m.Webp;if(u==="srt")return m.Srt;if(u==="mp4"||u==="longmp4")return m.Mp4;if(u==="mov")return m.Mov;return u}function gY(u,D){if(u===m.Mp4||u===m.Mov)return D==="tweet"?"TweetVideo":"DmVideo";if(u===m.Gif)return D==="tweet"?"TweetGif":"DmGif";if(u===m.Srt)return"Subtitles";else return D==="tweet"?"TweetImage":"DmImage"}function N5(u){return new Promise((D)=>setTimeout(D,u*1000))}async function G5(u,D,B=0,A){if(u instanceof Buffer){let F=u.slice(B,B+D);return[F,F.length]}if(!A)throw Error("Well, we will need a buffer to store file content.");let w;if(typeof u==="number")w=await new Promise((F,N)=>{B0.read(u,A,0,D,B,(G,v)=>{if(G)N(G);F(v)})});else w=(await u.read(A,0,D,B)).bytesRead;return[A,w]}var $5="media/upload.json";class i0 extends r0{constructor(){super(...arguments);this._prefix=e2}get readOnly(){return this}tweet(u,D={}){let B={status:u,tweet_mode:"extended",...D};return this.post("statuses/update.json",B)}async quote(u,D,B={}){let A="https://x.com/i/statuses/"+D;return this.tweet(u,{...B,attachment_url:A})}async tweetThread(u){let D=[];for(let B of u){let A=D.length?D[D.length-1]:null,w={...typeof B==="string"?{status:B}:B},F=A?A.id_str:w.in_reply_to_status_id,N=w.status;if(F)D.push(await this.reply(N,F,w));else D.push(await this.tweet(N,w))}return D}reply(u,D,B={}){return this.tweet(u,{auto_populate_reply_metadata:!0,in_reply_to_status_id:D,...B})}deleteTweet(u){return this.post("statuses/destroy/:id.json",{tweet_mode:"extended"},{params:{id:u}})}reportUserAsSpam(u){return this.post("users/report_spam.json",{tweet_mode:"extended",...u})}updateFriendship(u){return this.post("friendships/update.json",u)}createFriendship(u){return this.post("friendships/create.json",u)}destroyFriendship(u){return this.post("friendships/destroy.json",u)}updateAccountSettings(u){return this.post("account/settings.json",u)}updateAccountProfile(u){return this.post("account/update_profile.json",u)}async updateAccountProfileBanner(u,D={}){let B={banner:await w5(u),...D};return this.post("account/update_profile_banner.json",B,{forceBodyMode:"form-data"})}async updateAccountProfileImage(u,D={}){let B={tweet_mode:"extended",image:await w5(u),...D};return this.post("account/update_profile_image.json",B,{forceBodyMode:"form-data"})}removeAccountProfileBanner(){return this.post("account/remove_profile_banner.json")}createList(u){return this.post("lists/create.json",{tweet_mode:"extended",...u})}updateList(u){return this.post("lists/update.json",{tweet_mode:"extended",...u})}removeList(u){return this.post("lists/destroy.json",{tweet_mode:"extended",...u})}addListMembers(u){let B=u.user_id&&ku(u.user_id)||u.screen_name&&ku(u.screen_name)?"lists/members/create_all.json":"lists/members/create.json";return this.post(B,u)}removeListMembers(u){let B=u.user_id&&ku(u.user_id)||u.screen_name&&ku(u.screen_name)?"lists/members/destroy_all.json":"lists/members/destroy.json";return this.post(B,u)}subscribeToList(u){return this.post("lists/subscribers/create.json",{tweet_mode:"extended",...u})}unsubscribeOfList(u){return this.post("lists/subscribers/destroy.json",{tweet_mode:"extended",...u})}createMediaMetadata(u,D){return this.post("media/metadata/create.json",{media_id:u,...D},{prefix:g2,forceBodyMode:"json"})}createMediaSubtitles(u,D){return this.post("media/subtitles/create.json",{media_id:u,media_category:"TweetVideo",subtitle_info:{subtitles:D}},{prefix:g2,forceBodyMode:"json"})}deleteMediaSubtitles(u,...D){return this.post("media/subtitles/delete.json",{media_id:u,media_category:"TweetVideo",subtitle_info:{subtitles:D.map((B)=>({language_code:B}))}},{prefix:g2,forceBodyMode:"json"})}async uploadMedia(u,D={},B=!1){var A;let w=(A=D.chunkLength)!==null&&A!==void 0?A:1048576,{fileHandle:F,mediaCategory:N,fileSize:G,mimeType:v}=await this.getUploadMediaRequirements(u,D);try{let z=await this.post($5,{command:"INIT",total_bytes:G,media_type:v,media_category:N,additional_owners:D.additionalOwners,shared:D.shared?!0:void 0},{prefix:g2});await this.mediaChunkedUpload(F,w,z.media_id_string,D.maxConcurrentUploads);let Q=await this.post($5,{command:"FINALIZE",media_id:z.media_id_string},{prefix:g2});if(Q.processing_info&&Q.processing_info.state!=="succeeded")await this.awaitForMediaProcessingCompletion(Q);if(B)return Q;else return Q.media_id_string}finally{if(typeof u==="number")v5.close(u,()=>{});else if(typeof F==="object"&&!(F instanceof Buffer))F.close()}}async awaitForMediaProcessingCompletion(u){var D;while(!0){u=await this.mediaInfo(u.media_id_string);let{processing_info:B}=u;if(!B||B.state==="succeeded")return;if((D=B.error)===null||D===void 0?void 0:D.code){let{name:A,message:w}=B.error;throw Error(`Failed to process media: ${A} - ${w}.`)}if(B.state==="failed")throw Error("Failed to process the media.");if(B.check_after_secs)await N5(B.check_after_secs);else await N5(5)}}async getUploadMediaRequirements(u,{mimeType:D,type:B,target:A,longVideo:w}={}){let F;try{F=await F5(u);let N=mY(u,B,D),G;if(N===m.Mp4&&(!D&&!B&&A!=="dm"||w))G="amplify_video";else G=gY(N,A!==null&&A!==void 0?A:"tweet");return{fileHandle:F,mediaCategory:G,fileSize:await qY(F),mimeType:N}}catch(N){if(typeof u==="number")v5.close(u,()=>{});else if(typeof F==="object"&&!(F instanceof Buffer))F.close();throw N}}async mediaChunkedUpload(u,D,B,A=3){let w=0;if(A<1)throw RangeError("Bad maxConcurrentUploads parameter.");let F=u instanceof Buffer?void 0:Buffer.alloc(D),N,G,v=0;[N,G]=await G5(u,D,v,F),v+=G;let z=new Set;while(G){let Q=N.slice(0,G);if(Q.length){let Z=this.post($5,{command:"APPEND",media_id:B,segment_index:w,media:Q},{prefix:g2});z.add(Z),Z.then(()=>{z.delete(Z)}),w++}if(z.size>=A)await Promise.race(z);[N,G]=await G5(u,D,v,F),v+=G}await Promise.all([...z])}}class _Y extends i0{constructor(){super(...arguments);this._prefix=e2}get readWrite(){return this}sendDm({recipient_id:u,custom_profile_id:D,...B}){let A={event:{type:u0.Create,[u0.Create]:{target:{recipient_id:u},message_data:B}}};if(D)A.event[u0.Create].custom_profile_id=D;return this.post("direct_messages/events/new.json",A,{forceBodyMode:"json"})}getDmEvent(u){return this.get("direct_messages/events/show.json",{id:u})}deleteDm(u){return this.delete("direct_messages/events/destroy.json",{id:u})}async listDmEvents(u={}){let D={...u},B=await this.get("direct_messages/events/list.json",D,{fullResponse:!0});return new q8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}newWelcomeDm(u,D){let B={[u0.WelcomeCreate]:{name:u,message_data:D}};return this.post("direct_messages/welcome_messages/new.json",B,{forceBodyMode:"json"})}getWelcomeDm(u){return this.get("direct_messages/welcome_messages/show.json",{id:u})}deleteWelcomeDm(u){return this.delete("direct_messages/welcome_messages/destroy.json",{id:u})}updateWelcomeDm(u,D){let B={message_data:D};return this.put("direct_messages/welcome_messages/update.json",B,{forceBodyMode:"json",query:{id:u}})}async listWelcomeDms(u={}){let D={...u},B=await this.get("direct_messages/welcome_messages/list.json",D,{fullResponse:!0});return new m8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}newWelcomeDmRule(u){return this.post("direct_messages/welcome_messages/rules/new.json",{welcome_message_rule:{welcome_message_id:u}},{forceBodyMode:"json"})}getWelcomeDmRule(u){return this.get("direct_messages/welcome_messages/rules/show.json",{id:u})}deleteWelcomeDmRule(u){return this.delete("direct_messages/welcome_messages/rules/destroy.json",{id:u})}async listWelcomeDmRules(u={}){let D={...u};return this.get("direct_messages/welcome_messages/rules/list.json",D)}async setWelcomeDm(u,D=!0){var B;let A=await this.listWelcomeDmRules();if((B=A.welcome_message_rules)===null||B===void 0?void 0:B.length){for(let w of A.welcome_message_rules)if(await this.deleteWelcomeDmRule(w.id),D)await this.deleteWelcomeDm(w.welcome_message_id)}return this.newWelcomeDmRule(u)}markDmAsRead(u,D){return this.post("direct_messages/mark_read.json",{last_read_event_id:u,recipient_id:D},{forceBodyMode:"url"})}indicateDmTyping(u){return this.post("direct_messages/indicate_typing.json",{recipient_id:u},{forceBodyMode:"url"})}async downloadDmImage(u){if(typeof u!=="string"){let B=u[u0.Create].message_data.attachment;if(!B)throw Error("The given direct message doesn't contain any attachment");u=B.media.media_url_https}let D=await this.get(u,void 0,{forceParseMode:"buffer",prefix:""});if(!D.length)throw Error("Image not found. Make sure you are logged with credentials able to access direct messages, and check the URL.");return D}}var HD=_Y;class q{constructor(u){this.result=u}get tweets(){return q.tweets(this.result)}static tweets(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.tweets)!==null&&B!==void 0?B:[]}tweetById(u){return q.tweetById(this.result,u)}static tweetById(u,D){return this.tweets(u).find((B)=>B.id===D)}retweet(u){return q.retweet(this.result,u)}static retweet(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="retweeted").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}quote(u){return q.quote(this.result,u)}static quote(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="quoted").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}repliedTo(u){return q.repliedTo(this.result,u)}static repliedTo(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="replied_to").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}author(u){return q.author(this.result,u)}static author(u,D){let B=D.author_id;return B?this.users(u).find((A)=>A.id===B):void 0}repliedToAuthor(u){return q.repliedToAuthor(this.result,u)}static repliedToAuthor(u,D){let B=D.in_reply_to_user_id;return B?this.users(u).find((A)=>A.id===B):void 0}get users(){return q.users(this.result)}static users(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.users)!==null&&B!==void 0?B:[]}userById(u){return q.userById(this.result,u)}static userById(u,D){return this.users(u).find((B)=>B.id===D)}pinnedTweet(u){return q.pinnedTweet(this.result,u)}static pinnedTweet(u,D){return D.pinned_tweet_id?this.tweets(u).find((B)=>B.id===D.pinned_tweet_id):void 0}get media(){return q.media(this.result)}static media(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.media)!==null&&B!==void 0?B:[]}medias(u){return q.medias(this.result,u)}static medias(u,D){var B,A;let w=(A=(B=D.attachments)===null||B===void 0?void 0:B.media_keys)!==null&&A!==void 0?A:[];return this.media(u).filter((F)=>w.includes(F.media_key))}get polls(){return q.polls(this.result)}static polls(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.polls)!==null&&B!==void 0?B:[]}poll(u){return q.poll(this.result,u)}static poll(u,D){var B,A;let w=(A=(B=D.attachments)===null||B===void 0?void 0:B.poll_ids)!==null&&A!==void 0?A:[];if(w.length){let F=w[0];return this.polls(u).find((N)=>N.id===F)}return}get places(){return q.places(this.result)}static places(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.places)!==null&&B!==void 0?B:[]}place(u){return q.place(this.result,u)}static place(u,D){var B;let A=(B=D.geo)===null||B===void 0?void 0:B.place_id;return A?this.places(u).find((w)=>w.id===A):void 0}listOwner(u){return q.listOwner(this.result,u)}static listOwner(u,D){let B=D.owner_id;return B?this.users(u).find((A)=>A.id===B):void 0}spaceCreator(u){return q.spaceCreator(this.result,u)}static spaceCreator(u,D){let B=D.creator_id;return B?this.users(u).find((A)=>A.id===B):void 0}spaceHosts(u){return q.spaceHosts(this.result,u)}static spaceHosts(u,D){var B;let A=(B=D.host_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}spaceSpeakers(u){return q.spaceSpeakers(this.result,u)}static spaceSpeakers(u,D){var B;let A=(B=D.speaker_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}spaceInvitedUsers(u){return q.spaceInvitedUsers(this.result,u)}static spaceInvitedUsers(u,D){var B;let A=(B=D.invited_user_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}}class UD extends I8{updateIncludes(u){if(u.errors){if(!this._realData.errors)this._realData.errors=[];this._realData.errors=[...this._realData.errors,...u.errors]}if(!u.includes)return;if(!this._realData.includes)this._realData.includes={};let D=this._realData.includes;for(let[B,A]of Object.entries(u.includes)){if(!D[B])D[B]=[];D[B]=[...D[B],...A]}}assertUsable(){if(this.unusable)throw Error("Unable to use this paginator to fetch more data, as it does not contain any metadata. Check .errors property for more details.")}get meta(){return this._realData.meta}get includes(){var u;if(!((u=this._realData)===null||u===void 0?void 0:u.includes))return new q(this._realData);if(this._includesInstance)return this._includesInstance;return this._includesInstance=new q(this._realData)}get errors(){var u;return(u=this._realData.errors)!==null&&u!==void 0?u:[]}get unusable(){return this.errors.length>0&&!this._realData.meta&&!this._realData.data}}class q2 extends UD{refreshInstanceFromResult(u,D){var B;let A=u.data,w=(B=A.data)!==null&&B!==void 0?B:[];if(this._rateLimit=u.rateLimit,!this._realData.data)this._realData.data=[];if(D)this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.next_token=A.meta.next_token,this._realData.data.push(...w);else this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.previous_token=A.meta.previous_token,this._realData.data.unshift(...w);this.updateIncludes(A)}getNextQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),pagination_token:this._realData.meta.next_token}}getPreviousQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),pagination_token:this._realData.meta.previous_token}}getPageLengthFromRequest(u){var D,B;return(B=(D=u.data.data)===null||D===void 0?void 0:D.length)!==null&&B!==void 0?B:0}isFetchLastOver(u){var D;return!((D=u.data.data)===null||D===void 0?void 0:D.length)||!this.canFetchNextPage(u.data)}canFetchNextPage(u){var D;return!!((D=u.meta)===null||D===void 0?void 0:D.next_token)}}class z5 extends UD{refreshInstanceFromResult(u,D){var B;let A=u.data,w=(B=A.data)!==null&&B!==void 0?B:[];if(this._rateLimit=u.rateLimit,!this._realData.data)this._realData.data=[];if(D)this._realData.meta.oldest_id=A.meta.oldest_id,this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.next_token=A.meta.next_token,this._realData.data.push(...w);else this._realData.meta.newest_id=A.meta.newest_id,this._realData.meta.result_count+=A.meta.result_count,this._realData.data.unshift(...w);this.updateIncludes(A)}getNextQueryParams(u){this.assertUsable();let D={...this.injectQueryParams(u)};if(this._realData.meta.next_token)D.next_token=this._realData.meta.next_token;else{if(D.start_time)D.since_id=this.dateStringToSnowflakeId(D.start_time),delete D.start_time;if(D.end_time)delete D.end_time;D.until_id=this._realData.meta.oldest_id}return D}getPreviousQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),since_id:this._realData.meta.newest_id}}getPageLengthFromRequest(u){var D,B;return(B=(D=u.data.data)===null||D===void 0?void 0:D.length)!==null&&B!==void 0?B:0}isFetchLastOver(u){var D;return!((D=u.data.data)===null||D===void 0?void 0:D.length)||!this.canFetchNextPage(u.data)}canFetchNextPage(u){return!!u.meta.next_token}getItemArray(){return this.tweets}dateStringToSnowflakeId(u){let D=BigInt("1288834974657"),B=new Date(u);if(isNaN(B.valueOf()))throw Error("Unable to convert start_time/end_time to a valid date. A ISO 8601 DateTime is excepted, please check your input.");return(BigInt(B.valueOf())-D<<BigInt("22")).toString()}get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class n0 extends q2{refreshInstanceFromResult(u,D){super.refreshInstanceFromResult(u,D);let B=u.data;if(D)this._realData.meta.oldest_id=B.meta.oldest_id;else this._realData.meta.newest_id=B.meta.newest_id}getItemArray(){return this.tweets}get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class Z5 extends z5{constructor(){super(...arguments);this._endpoint="tweets/search/recent"}}class J5 extends z5{constructor(){super(...arguments);this._endpoint="tweets/search/all"}}class Q5 extends n0{constructor(){super(...arguments);this._endpoint="tweets/:id/quote_tweets"}}class W5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/timelines/reverse_chronological"}}class X5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/tweets"}}class Y5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/mentions"}}class h5 extends n0{constructor(){super(...arguments);this._endpoint="users/:id/bookmarks"}}class K5 extends q2{get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}getItemArray(){return this.tweets}}class x5 extends K5{constructor(){super(...arguments);this._endpoint="users/:id/liked_tweets"}}class S5 extends K5{constructor(){super(...arguments);this._endpoint="lists/:id/tweets"}}class _2 extends q2{getItemArray(){return this.users}get users(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class R5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/blocking"}}class H5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/muting"}}class U5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/followers"}}class c5 extends _2{constructor(){super(...arguments);this._endpoint="users/:id/following"}}class M5 extends _2{constructor(){super(...arguments);this._endpoint="lists/:id/members"}}class L5 extends _2{constructor(){super(...arguments);this._endpoint="lists/:id/followers"}}class E5 extends _2{constructor(){super(...arguments);this._endpoint="tweets/:id/liking_users"}}class O5 extends _2{constructor(){super(...arguments);this._endpoint="tweets/:id/retweeted_by"}}class cD extends q2{getItemArray(){return this.lists}get lists(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class C5 extends cD{constructor(){super(...arguments);this._endpoint="users/:id/owned_lists"}}class P5 extends cD{constructor(){super(...arguments);this._endpoint="users/:id/list_memberships"}}class k5 extends cD{constructor(){super(...arguments);this._endpoint="users/:id/followed_lists"}}class p0 extends P2{constructor(){super(...arguments);this._prefix=_0}}class MD extends q2{getItemArray(){return this.events}get events(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class y5 extends MD{constructor(){super(...arguments);this._endpoint="dm_events"}}class V5 extends MD{constructor(){super(...arguments);this._endpoint="dm_conversations/with/:participant_id/dm_events"}}class T5 extends MD{constructor(){super(...arguments);this._endpoint="dm_conversations/:dm_conversation_id/dm_events"}}class a0 extends P2{constructor(){super(...arguments);this._prefix=o2}get labs(){if(this._labs)return this._labs;return this._labs=new p0(this)}async search(u,D={}){let B=typeof u==="string"?{...D,query:u}:{...u},A=await this.get("tweets/search/recent",B,{fullResponse:!0});return new Z5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async searchAll(u,D={}){let B={...D,query:u},A=await this.get("tweets/search/all",B,{fullResponse:!0});return new J5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}singleTweet(u,D={}){return this.get("tweets/:id",D,{params:{id:u}})}tweets(u,D={}){return this.get("tweets",{ids:u,...D})}tweetCountRecent(u,D={}){return this.get("tweets/counts/recent",{query:u,...D})}tweetCountAll(u,D={}){return this.get("tweets/counts/all",{query:u,...D})}async tweetRetweetedBy(u,D={}){let{asPaginator:B,...A}=D,w=await this.get("tweets/:id/retweeted_by",A,{fullResponse:!0,params:{id:u}});if(!B)return w.data;return new O5({realData:w.data,rateLimit:w.rateLimit,instance:this,queryParams:A,sharedParams:{id:u}})}async tweetLikedBy(u,D={}){let{asPaginator:B,...A}=D,w=await this.get("tweets/:id/liking_users",A,{fullResponse:!0,params:{id:u}});if(!B)return w.data;return new E5({realData:w.data,rateLimit:w.rateLimit,instance:this,queryParams:A,sharedParams:{id:u}})}async homeTimeline(u={}){let D=await this.getCurrentUserV2Object(),B=await this.get("users/:id/timelines/reverse_chronological",u,{fullResponse:!0,params:{id:D.data.id}});return new W5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:u,sharedParams:{id:D.data.id}})}async userTimeline(u,D={}){let B=await this.get("users/:id/tweets",D,{fullResponse:!0,params:{id:u}});return new X5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async userMentionTimeline(u,D={}){let B=await this.get("users/:id/mentions",D,{fullResponse:!0,params:{id:u}});return new Y5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async quotes(u,D={}){let B=await this.get("tweets/:id/quote_tweets",D,{fullResponse:!0,params:{id:u}});return new Q5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async bookmarks(u={}){let D=await this.getCurrentUserV2Object(),B=await this.get("users/:id/bookmarks",u,{fullResponse:!0,params:{id:D.data.id}});return new h5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:u,sharedParams:{id:D.data.id}})}me(u={}){return this.get("users/me",u)}user(u,D={}){return this.get("users/:id",D,{params:{id:u}})}users(u,D={}){let B=Array.isArray(u)?u.join(","):u;return this.get("users",{...D,ids:B})}userByUsername(u,D={}){return this.get("users/by/username/:username",D,{params:{username:u}})}usersByUsernames(u,D={}){return u=Array.isArray(u)?u.join(","):u,this.get("users/by",{...D,usernames:u})}async followers(u,D={}){let{asPaginator:B,...A}=D,w={id:u};if(!B)return this.get("users/:id/followers",A,{params:w});let F=await this.get("users/:id/followers",A,{fullResponse:!0,params:w});return new U5({realData:F.data,rateLimit:F.rateLimit,instance:this,queryParams:A,sharedParams:w})}async following(u,D={}){let{asPaginator:B,...A}=D,w={id:u};if(!B)return this.get("users/:id/following",A,{params:w});let F=await this.get("users/:id/following",A,{fullResponse:!0,params:w});return new c5({realData:F.data,rateLimit:F.rateLimit,instance:this,queryParams:A,sharedParams:w})}async userLikedTweets(u,D={}){let B={id:u},A=await this.get("users/:id/liked_tweets",D,{fullResponse:!0,params:B});return new x5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async userBlockingUsers(u,D={}){let B={id:u},A=await this.get("users/:id/blocking",D,{fullResponse:!0,params:B});return new R5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async userMutingUsers(u,D={}){let B={id:u},A=await this.get("users/:id/muting",D,{fullResponse:!0,params:B});return new H5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}list(u,D={}){return this.get("lists/:id",D,{params:{id:u}})}async listsOwned(u,D={}){let B={id:u},A=await this.get("users/:id/owned_lists",D,{fullResponse:!0,params:B});return new C5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listMemberships(u,D={}){let B={id:u},A=await this.get("users/:id/list_memberships",D,{fullResponse:!0,params:B});return new P5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listFollowed(u,D={}){let B={id:u},A=await this.get("users/:id/followed_lists",D,{fullResponse:!0,params:B});return new k5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listTweets(u,D={}){let B={id:u},A=await this.get("lists/:id/tweets",D,{fullResponse:!0,params:B});return new S5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listMembers(u,D={}){let B={id:u},A=await this.get("lists/:id/members",D,{fullResponse:!0,params:B});return new M5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listFollowers(u,D={}){let B={id:u},A=await this.get("lists/:id/followers",D,{fullResponse:!0,params:B});return new L5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listDmEvents(u={}){let D=await this.get("dm_events",u,{fullResponse:!0});return new y5({realData:D.data,rateLimit:D.rateLimit,instance:this,queryParams:{...u}})}async listDmEventsWithParticipant(u,D={}){let B={participant_id:u},A=await this.get("dm_conversations/with/:participant_id/dm_events",D,{fullResponse:!0,params:B});return new V5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listDmEventsOfConversation(u,D={}){let B={dm_conversation_id:u},A=await this.get("dm_conversations/:dm_conversation_id/dm_events",D,{fullResponse:!0,params:B});return new T5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}space(u,D={}){return this.get("spaces/:id",D,{params:{id:u}})}spaces(u,D={}){return this.get("spaces",{ids:u,...D})}spacesByCreators(u,D={}){return this.get("spaces/by/creator_ids",{user_ids:u,...D})}searchSpaces(u){return this.get("spaces/search",u)}spaceBuyers(u,D={}){return this.get("spaces/:id/buyers",D,{params:{id:u}})}spaceTweets(u,D={}){return this.get("spaces/:id/tweets",D,{params:{id:u}})}searchStream({autoConnect:u,...D}={}){return this.getStream("tweets/search/stream",D,{payloadIsError:XD,autoConnect:u})}streamRules(u={}){return this.get("tweets/search/stream/rules",u)}updateStreamRules(u,D={}){return this.post("tweets/search/stream/rules",u,{query:D})}sampleStream({autoConnect:u,...D}={}){return this.getStream("tweets/sample/stream",D,{payloadIsError:XD,autoConnect:u})}sample10Stream({autoConnect:u,...D}={}){return this.getStream("tweets/sample10/stream",D,{payloadIsError:XD,autoConnect:u})}complianceJobs(u){return this.get("compliance/jobs",u)}complianceJob(u){return this.get("compliance/jobs/:id",void 0,{params:{id:u}})}async sendComplianceJob(u){let D=await this.post("compliance/jobs",{type:u.type,name:u.name}),B=u.ids instanceof Buffer?u.ids:Buffer.from(u.ids.join(`
|
|
39
|
+
`);Z.content=t2.encode(Q);break}default:Z.content=F.content}this.attachments.push(Z)}}else if(F.contentType.multipart==="alternative")G=F;else if(F.contentType.multipart==="related")N=F;for(let $ of F.childNodes)await w($,G,N)};await w(this.root,!1,!1),B.forEach((F)=>{D.forEach((G)=>{if(!u[G])u[G]=[];if(F[G])F[G].forEach((N)=>{switch(N.type){case"text":u[G].push(N.value);break;case"subMessage":switch(G){case"html":u[G].push(oD(N.value));break;case"plain":u[G].push(tD(N.value));break}break}});else{let N;switch(G){case"html":N="plain";break;case"plain":N="html";break}(F[N]||[]).forEach(($)=>{switch($.type){case"text":switch(G){case"html":u[G].push(mB($.value));break;case"plain":u[G].push(_B($.value));break}break;case"subMessage":switch(G){case"html":u[G].push(oD($.value));break;case"plain":u[G].push(tD($.value));break}break}})}})}),Object.keys(u).forEach((F)=>{u[F]=u[F].join(`
|
|
40
|
+
`)}),this.textContent=u}isInlineTextNode(u){if(u.contentDisposition?.parsed?.value==="attachment")return!1;switch(u.contentType.parsed?.value){case"text/html":case"text/plain":return!0;case"text/calendar":case"text/csv":default:return!1}}isInlineMessageRfc822(u){if(u.contentType.parsed?.value!=="message/rfc822")return!1;return(u.contentDisposition?.parsed?.value||(this.options.rfc822Attachments?"attachment":"inline"))==="inline"}forceRfc822Attachments(){if(this.options.forceRfc822Attachments)return!0;let u=!1,D=(B)=>{if(!B.contentType.multipart){if(B.contentType.parsed&&["message/delivery-status","message/feedback-report"].includes(B.contentType.parsed.value))u=!0}for(let A of B.childNodes)D(A)};return D(this.root),u}async resolveStream(u){let D=0,B=[],A=u.getReader();while(!0){let{done:G,value:N}=await A.read();if(G)break;B.push(N),D+=N.length}let w=new Uint8Array(D),F=0;for(let G of B)w.set(G,F),F+=G.length;return w}async parse(u){if(this.started)throw Error("Can not reuse parser, create a new PostalMime object");if(this.started=!0,u&&typeof u.getReader==="function")u=await this.resolveStream(u);if(u=u||new ArrayBuffer(0),typeof u==="string")u=t2.encode(u);if(u instanceof Blob||Object.prototype.toString.call(u)==="[object Blob]")u=await o2(u);if(u.buffer instanceof ArrayBuffer)u=new Uint8Array(u).buffer;this.buf=u,this.av=new Uint8Array(u),this.readPos=0;while(this.readPos<this.av.length){let A=this.readLine();await this.processLine(A.bytes,A.done)}await this.processNodeTree();let D={headers:this.root.headers.map((A)=>({key:A.key,originalKey:A.originalKey,value:A.value})).reverse()};for(let A of["from","sender"]){let w=this.root.headers.find((F)=>F.key===A);if(w&&w.value){let F=t1(w.value);if(F&&F.length)D[A]=F[0]}}for(let A of["delivered-to","return-path"]){let w=this.root.headers.find((F)=>F.key===A);if(w&&w.value){let F=t1(w.value);if(F&&F.length&&F[0].address){let G=u8(A);D[G]=F[0].address}}}for(let A of["to","cc","bcc","reply-to"]){let w=this.root.headers.filter((G)=>G.key===A),F=[];if(w.filter((G)=>G&&G.value).map((G)=>t1(G.value)).forEach((G)=>F=F.concat(G||[])),F&&F.length){let G=u8(A);D[G]=F}}for(let A of["subject","message-id","in-reply-to","references"]){let w=this.root.headers.find((F)=>F.key===A);if(w&&w.value){let F=u8(A);D[F]=Q0(w.value)}}let B=this.root.headers.find((A)=>A.key==="date");if(B){let A=new Date(B.value);if(A.toString()==="Invalid Date")A=B.value;else A=A.toISOString();D.date=A}if(this.textContent?.html)D.html=this.textContent.html;if(this.textContent?.plain)D.text=this.textContent.plain;switch(D.attachments=this.attachments,D.headerLines=(this.root.rawHeaderLines||[]).slice().reverse(),this.attachmentEncoding){case"arraybuffer":break;case"base64":for(let w of D.attachments||[])if(w?.content)w.content=jB(w.content),w.encoding="base64";break;case"utf8":let A=new TextDecoder("utf8");for(let w of D.attachments||[])if(w?.content)w.content=A.decode(w.content),w.encoding="utf8";break;default:throw Error("Unknown attachment encoding")}return D}}var hY=X(JY(),1),iR="6.12.3";function A2(u){let D=new URLSearchParams;if(u.limit!==void 0)D.set("limit",u.limit.toString());if("after"in u&&u.after!==void 0)D.set("after",u.after);if("before"in u&&u.before!==void 0)D.set("before",u.before);return D.toString()}var rR=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/api-keys",u,D)}async list(u={}){let D=A2(u),B=D?`/api-keys?${D}`:"/api-keys";return await this.resend.get(B)}async remove(u){return await this.resend.delete(`/api-keys/${u}`)}},nR=class{constructor(u){this.resend=u}async get(u){return await this.resend.get(`/automations/${u.automationId}/runs/${u.runId}`)}async list(u){let D=A2(u),B=new URLSearchParams(D);if(u.status){let F=Array.isArray(u.status)?u.status.join(","):u.status;B.set("status",F)}let A=B.toString(),w=A?`/automations/${u.automationId}/runs?${A}`:`/automations/${u.automationId}/runs`;return await this.resend.get(w)}};function xY(u){switch(u.type){case"trigger":return{key:u.key,type:u.type,config:{event_name:u.config.eventName}};case"delay":return{key:u.key,type:u.type,config:u.config};case"send_email":return{key:u.key,type:u.type,config:{template:u.config.template,subject:u.config.subject,from:u.config.from,reply_to:u.config.replyTo}};case"wait_for_event":return{key:u.key,type:u.type,config:{event_name:u.config.eventName,timeout:u.config.timeout,filter_rule:u.config.filterRule}};case"condition":return{key:u.key,type:u.type,config:u.config};case"contact_update":return{key:u.key,type:u.type,config:{first_name:u.config.firstName,last_name:u.config.lastName,unsubscribed:u.config.unsubscribed,properties:u.config.properties}};case"contact_delete":return{key:u.key,type:u.type,config:u.config};case"add_to_segment":return{key:u.key,type:u.type,config:{segment_id:u.config.segmentId}}}}function HY(u){return{from:u.from,to:u.to,type:u.type}}function pR(u){return{name:u.name,status:u.status,steps:u.steps.map(xY),connections:u.connections.map(HY)}}function aR(u){return{event:u.event,contact_id:u.contactId,email:u.email,payload:u.payload}}var sR=class{constructor(u){this.resend=u,this.runs=new nR(this.resend)}async create(u){return await this.resend.post("/automations",pR(u))}async list(u={}){let D=[A2(u)];if(u.status)D.push(`status=${encodeURIComponent(u.status)}`);let B=D.filter(Boolean).join("&"),A=B?`/automations?${B}`:"/automations";return await this.resend.get(A)}async get(u){return await this.resend.get(`/automations/${u}`)}async remove(u){return await this.resend.delete(`/automations/${u}`)}async update(u,D){let B={};if(D.name!==void 0)B.name=D.name;if(D.status!==void 0)B.status=D.status;if(D.steps!==void 0)B.steps=D.steps.map(xY);if(D.connections!==void 0)B.connections=D.connections.map(HY);return await this.resend.patch(`/automations/${u}`,B)}async stop(u){return await this.resend.post(`/automations/${u}/stop`)}};function tR(u){return u?.map((D)=>({content:D.content,filename:D.filename,path:D.path,content_type:D.contentType,content_id:D.contentId}))}function SY(u){return{attachments:tR(u.attachments),bcc:u.bcc,cc:u.cc,from:u.from,headers:u.headers,html:u.html,reply_to:u.replyTo,scheduled_at:u.scheduledAt,subject:u.subject,tags:u.tags,text:u.text,to:u.to,template:u.template?{id:u.template.id,variables:u.template.variables}:void 0,topic_id:u.topicId}}async function W3(u){let D;try{({render:D}=await import("@react-email/render"))}catch{throw Error("Failed to render React component. Make sure to install `@react-email/render` or `@react-email/components`.")}return D(u)}var oR=class{constructor(u){this.resend=u}async send(u,D){return this.create(u,D)}async create(u,D){let B=[];for(let A of u){if(A.react)A.html=await W3(A.react),A.react=void 0;B.push(SY(A))}return await this.resend.post("/emails/batch",B,{...D,headers:{"x-batch-validation":D?.batchValidation??"strict",...D?.headers}})}},eR=class{constructor(u){this.resend=u}async create(u,D={}){if(u.react)u.html=await W3(u.react);return await this.resend.post("/broadcasts",{name:u.name,segment_id:u.segmentId,audience_id:u.audienceId,preview_text:u.previewText,from:u.from,html:u.html,reply_to:u.replyTo,subject:u.subject,text:u.text,topic_id:u.topicId,send:u.send,scheduled_at:u.scheduledAt},D)}async send(u,D){return await this.resend.post(`/broadcasts/${u}/send`,{scheduled_at:D?.scheduledAt})}async list(u={}){let D=A2(u),B=D?`/broadcasts?${D}`:"/broadcasts";return await this.resend.get(B)}async get(u){return await this.resend.get(`/broadcasts/${u}`)}async remove(u){return await this.resend.delete(`/broadcasts/${u}`)}async update(u,D){if(D.react)D.html=await W3(D.react);return await this.resend.patch(`/broadcasts/${u}`,{name:D.name,segment_id:D.segmentId,audience_id:D.audienceId,from:D.from,html:D.html,text:D.text,subject:D.subject,reply_to:D.replyTo,preview_text:D.previewText,topic_id:D.topicId})}};function vY(u){return{id:u.id,key:u.key,createdAt:u.created_at,type:u.type,fallbackValue:u.fallback_value}}function QY(u){if("key"in u)return{key:u.key,type:u.type,fallback_value:u.fallbackValue};return{fallback_value:u.fallbackValue}}var uU=class{constructor(u){this.resend=u}async create(u){let D=QY(u);return await this.resend.post("/contact-properties",D)}async list(u={}){let D=A2(u),B=D?`/contact-properties?${D}`:"/contact-properties",A=await this.resend.get(B);if(A.data)return{data:{...A.data,data:A.data.data.map((w)=>vY(w))},headers:A.headers,error:null};return A}async get(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let D=await this.resend.get(`/contact-properties/${u}`);if(D.data)return{data:{object:"contact_property",...vY(D.data)},headers:D.headers,error:null};return D}async update(u){if(!u.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};let D=QY(u);return await this.resend.patch(`/contact-properties/${u.id}`,D)}async remove(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.delete(`/contact-properties/${u}`)}},DU=class{constructor(u){this.resend=u}async list(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId,B=A2(u),A=B?`/contacts/${D}/segments?${B}`:`/contacts/${D}/segments`;return await this.resend.get(A)}async add(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId;return this.resend.post(`/contacts/${D}/segments/${u.segmentId}`)}async remove(u){if(!u.contactId&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.contactId;return this.resend.delete(`/contacts/${D}/segments/${u.segmentId}`)}},BU=class{constructor(u){this.resend=u}async update(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.id;return this.resend.patch(`/contacts/${D}/topics`,u.topics)}async list(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};let D=u.email?u.email:u.id,B=A2(u),A=B?`/contacts/${D}/topics?${B}`:`/contacts/${D}/topics`;return this.resend.get(A)}},AU=class{constructor(u){this.resend=u,this.topics=new BU(this.resend),this.segments=new DU(this.resend)}async create(u,D={}){if("audienceId"in u){if("segments"in u||"topics"in u)return{data:null,headers:null,error:{message:"`audienceId` is deprecated, and cannot be used together with `segments` or `topics`. Use `segments` instead to add one or more segments to the new contact.",statusCode:null,name:"invalid_parameter"}};return await this.resend.post(`/audiences/${u.audienceId}/contacts`,{unsubscribed:u.unsubscribed,email:u.email,first_name:u.firstName,last_name:u.lastName,properties:u.properties},D)}return await this.resend.post("/contacts",{unsubscribed:u.unsubscribed,email:u.email,first_name:u.firstName,last_name:u.lastName,properties:u.properties,segments:u.segments,topics:u.topics},D)}async list(u={}){let D=u.segmentId??u.audienceId;if(!D){let w=A2(u),F=w?`/contacts?${w}`:"/contacts";return await this.resend.get(F)}let B=A2(u),A=B?`/segments/${D}/contacts?${B}`:`/segments/${D}/contacts`;return await this.resend.get(A)}async get(u){if(typeof u==="string")return this.resend.get(`/contacts/${u}`);if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return this.resend.get(`/contacts/${u?.email?u?.email:u?.id}`);return this.resend.get(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`)}async update(u){if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return await this.resend.patch(`/contacts/${u?.email?u?.email:u?.id}`,{unsubscribed:u.unsubscribed,first_name:u.firstName,last_name:u.lastName,properties:u.properties});return await this.resend.patch(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`,{unsubscribed:u.unsubscribed,first_name:u.firstName,last_name:u.lastName,properties:u.properties})}async remove(u){if(typeof u==="string")return this.resend.delete(`/contacts/${u}`);if(!u.id&&!u.email)return{data:null,headers:null,error:{message:"Missing `id` or `email` field.",statusCode:null,name:"missing_required_field"}};if(!u.audienceId)return this.resend.delete(`/contacts/${u?.email?u?.email:u?.id}`);return this.resend.delete(`/audiences/${u.audienceId}/contacts/${u?.email?u?.email:u?.id}`)}};function wU(u){return{name:u.name,region:u.region,custom_return_path:u.customReturnPath,capabilities:u.capabilities,open_tracking:u.openTracking,click_tracking:u.clickTracking,tls:u.tls,tracking_subdomain:u.trackingSubdomain}}var FU=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/domains",wU(u),D)}async list(u={}){let D=A2(u),B=D?`/domains?${D}`:"/domains";return await this.resend.get(B)}async get(u){return await this.resend.get(`/domains/${u}`)}async update(u){return await this.resend.patch(`/domains/${u.id}`,{click_tracking:u.clickTracking,open_tracking:u.openTracking,tls:u.tls,capabilities:u.capabilities,tracking_subdomain:u.trackingSubdomain})}async remove(u){return await this.resend.delete(`/domains/${u}`)}async verify(u){return await this.resend.post(`/domains/${u}/verify`)}},GU=class{constructor(u){this.resend=u}async get(u){let{emailId:D,id:B}=u;return await this.resend.get(`/emails/${D}/attachments/${B}`)}async list(u){let{emailId:D}=u,B=A2(u),A=B?`/emails/${D}/attachments?${B}`:`/emails/${D}/attachments`;return await this.resend.get(A)}},NU=class{constructor(u){this.resend=u}async get(u){let{emailId:D,id:B}=u;return await this.resend.get(`/emails/receiving/${D}/attachments/${B}`)}async list(u){let{emailId:D}=u,B=A2(u),A=B?`/emails/receiving/${D}/attachments?${B}`:`/emails/receiving/${D}/attachments`;return await this.resend.get(A)}},$U=class{constructor(u){this.resend=u,this.attachments=new NU(u)}async get(u){return await this.resend.get(`/emails/receiving/${u}`)}async list(u={}){let D=A2(u),B=D?`/emails/receiving?${D}`:"/emails/receiving";return await this.resend.get(B)}async forward(u){let{emailId:D,to:B,from:A}=u,w=u.passthrough!==!1,F=await this.get(D);if(F.error)return{data:null,error:F.error,headers:F.headers};let G=F.data,N=G.subject||"(no subject)";if(w)return this.forwardPassthrough(G,{to:B,from:A,subject:N});let $=N.startsWith("Fwd:")?N:`Fwd: ${N}`;return this.forwardWrapped(G,{to:B,from:A,subject:$,text:"text"in u?u.text:void 0,html:"html"in u?u.html:void 0})}async forwardPassthrough(u,D){let{to:B,from:A,subject:w}=D;if(!u.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let F=await fetch(u.raw.download_url);if(!F.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:F.status},headers:null};let G=await F.text(),N=await T0.parse(G,{attachmentEncoding:"base64"}),$=N.attachments.map((Z)=>{let Q=Z.contentId?Z.contentId.replace(/^<|>$/g,""):void 0;return{filename:Z.filename,content:Z.content.toString(),content_type:Z.mimeType,content_id:Q||void 0}});return await this.resend.post("/emails",{from:A,to:B,subject:w,text:N.text||void 0,html:N.html||void 0,attachments:$.length>0?$:void 0})}async forwardWrapped(u,D){let{to:B,from:A,subject:w,text:F,html:G}=D;if(!u.raw?.download_url)return{data:null,error:{name:"validation_error",message:"Raw email content is not available for this email",statusCode:400},headers:null};let N=await fetch(u.raw.download_url);if(!N.ok)return{data:null,error:{name:"application_error",message:"Failed to download raw email content",statusCode:N.status},headers:null};let $=await N.text();return await this.resend.post("/emails",{from:A,to:B,subject:w,text:F,html:G,attachments:[{filename:"forwarded_message.eml",content:Buffer.from($).toString("base64"),content_type:"message/rfc822"}]})}},zU=class{constructor(u){this.resend=u,this.attachments=new GU(u),this.receiving=new $U(u)}async send(u,D={}){return this.create(u,D)}async create(u,D={}){if(u.react)u.html=await W3(u.react);return await this.resend.post("/emails",SY(u),D)}async get(u){return await this.resend.get(`/emails/${u}`)}async list(u={}){let D=A2(u),B=D?`/emails?${D}`:"/emails";return await this.resend.get(B)}async update(u){return await this.resend.patch(`/emails/${u.id}`,{scheduled_at:u.scheduledAt})}async cancel(u){return await this.resend.post(`/emails/${u}/cancel`)}},ZU=class{constructor(u){this.resend=u}async send(u){return await this.resend.post("/events/send",aR(u))}async create(u){return await this.resend.post("/events",u)}async get(u){return await this.resend.get(`/events/${encodeURIComponent(u)}`)}async list(u={}){let D=A2(u),B=D?`/events?${D}`:"/events";return await this.resend.get(B)}async update(u,D){return await this.resend.patch(`/events/${encodeURIComponent(u)}`,D)}async remove(u){return await this.resend.delete(`/events/${encodeURIComponent(u)}`)}},JU=class{constructor(u){this.resend=u}async list(u={}){let D=A2(u),B=D?`/logs?${D}`:"/logs";return await this.resend.get(B)}async get(u){return await this.resend.get(`/logs/${u}`)}},vU=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/segments",u,D)}async list(u={}){let D=A2(u),B=D?`/segments?${D}`:"/segments";return await this.resend.get(B)}async get(u){return await this.resend.get(`/segments/${u}`)}async remove(u){return await this.resend.delete(`/segments/${u}`)}};function QU(u={}){let D=new URLSearchParams;if(u.before)D.set("before",u.before);if(u.after)D.set("after",u.after);if(u.limit)D.set("limit",u.limit.toString());return D.size>0?`?${D.toString()}`:""}function WU(u){return u?.map((D)=>({key:D.key,type:D.type,fallback_value:D.fallbackValue}))}function WY(u){return{name:"name"in u?u.name:void 0,subject:u.subject,html:u.html,text:u.text,alias:u.alias,from:u.from,reply_to:u.replyTo,variables:WU(u.variables)}}var XY=class{constructor(u,D){this.promise=u,this.publishFn=D}then(u,D){return this.promise.then(u,D)}async publish(){let{data:u,error:D}=await this.promise;if(D)return{data:null,headers:null,error:D};return this.publishFn(u.id)}},XU=class{constructor(u){this.resend=u}create(u){return new XY(this.performCreate(u),this.publish.bind(this))}async performCreate(u){if(u.react){if(!this.renderAsync)try{let{renderAsync:D}=await import("@react-email/render");this.renderAsync=D}catch{throw Error("Failed to render React component. Make sure to install `@react-email/render`")}u.html=await this.renderAsync(u.react)}return this.resend.post("/templates",WY(u))}async remove(u){return await this.resend.delete(`/templates/${u}`)}async get(u){return await this.resend.get(`/templates/${u}`)}async list(u={}){return this.resend.get(`/templates${QU(u)}`)}duplicate(u){return new XY(this.resend.post(`/templates/${u}/duplicate`),this.publish.bind(this))}async publish(u){return await this.resend.post(`/templates/${u}/publish`)}async update(u,D){return await this.resend.patch(`/templates/${u}`,WY(D))}},YU=class{constructor(u){this.resend=u}async create(u){let{defaultSubscription:D,...B}=u;return await this.resend.post("/topics",{...B,default_subscription:D})}async list(){return await this.resend.get("/topics")}async get(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.get(`/topics/${u}`)}async update(u){if(!u.id)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.patch(`/topics/${u.id}`,u)}async remove(u){if(!u)return{data:null,headers:null,error:{message:"Missing `id` field.",statusCode:null,name:"missing_required_field"}};return await this.resend.delete(`/topics/${u}`)}},KU=class{constructor(u){this.resend=u}async create(u,D={}){return await this.resend.post("/webhooks",u,D)}async get(u){return await this.resend.get(`/webhooks/${u}`)}async list(u={}){let D=A2(u),B=D?`/webhooks?${D}`:"/webhooks";return await this.resend.get(B)}async update(u,D){return await this.resend.patch(`/webhooks/${u}`,D)}async remove(u){return await this.resend.delete(`/webhooks/${u}`)}verify(u){return new hY.Webhook(u.webhookSecret).verify(u.payload,{"svix-id":u.headers.id,"svix-timestamp":u.headers.timestamp,"svix-signature":u.headers.signature})}},YY="https://api.resend.com",KY=`resend-node:${iR}`,hU=typeof process<"u"&&process.env?process.env.RESEND_BASE_URL||YY:YY,xU=typeof process<"u"&&process.env?process.env.RESEND_USER_AGENT||KY:KY,RY=class{constructor(u){if(this.key=u,this.segments=new vU(this),this.apiKeys=new rR(this),this.audiences=this.segments,this.automations=new sR(this),this.batch=new oR(this),this.broadcasts=new eR(this),this.contactProperties=new uU(this),this.contacts=new AU(this),this.domains=new FU(this),this.emails=new zU(this),this.events=new ZU(this),this.logs=new JU(this),this.templates=new XU(this),this.topics=new YU(this),this.webhooks=new KU(this),!u){if(typeof process<"u"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":xU,"Content-Type":"application/json"})}async fetchRequest(u,D={}){try{let B=await fetch(`${hU}${u}`,D);if(!B.ok)try{let A=await B.text();return{data:null,error:JSON.parse(A),headers:Object.fromEntries(B.headers.entries())}}catch(A){if(A instanceof SyntaxError)return{data:null,error:{name:"application_error",statusCode:B.status,message:"Internal server error. We are unable to process your request right now, please try again later."},headers:Object.fromEntries(B.headers.entries())};let w={message:B.statusText,statusCode:B.status,name:"application_error"};if(A instanceof Error)return{data:null,error:{...w,message:A.message},headers:Object.fromEntries(B.headers.entries())};return{data:null,error:w,headers:Object.fromEntries(B.headers.entries())}}return{data:await B.json(),error:null,headers:Object.fromEntries(B.headers.entries())}}catch{return{data:null,error:{name:"application_error",statusCode:null,message:"Unable to fetch data. The request could not be resolved."},headers:null}}}async post(u,D,B={}){let A=new Headers(this.headers);if(B.headers)for(let[F,G]of new Headers(B.headers).entries())A.set(F,G);if(B.idempotencyKey)A.set("Idempotency-Key",B.idempotencyKey);let w={method:"POST",body:JSON.stringify(D),...B,headers:A};return this.fetchRequest(u,w)}async get(u,D={}){let B=new Headers(this.headers);if(D.headers)for(let[w,F]of new Headers(D.headers).entries())B.set(w,F);let A={method:"GET",...D,headers:B};return this.fetchRequest(u,A)}async put(u,D,B={}){let A=new Headers(this.headers);if(B.headers)for(let[F,G]of new Headers(B.headers).entries())A.set(F,G);let w={method:"PUT",body:JSON.stringify(D),...B,headers:A};return this.fetchRequest(u,w)}async patch(u,D,B={}){let A=new Headers(this.headers);if(B.headers)for(let[F,G]of new Headers(B.headers).entries())A.set(F,G);let w={method:"PATCH",body:JSON.stringify(D),...B,headers:A};return this.fetchRequest(u,w)}async delete(u,D){let B={method:"DELETE",body:JSON.stringify(D),headers:this.headers};return this.fetchRequest(u,B)}};class X3{}class Y3 extends X3{apiKey;constructor(u=process.env.RESEND_API_KEY){super();this.apiKey=u}async send(u){let D=new RY(this.apiKey),{data:B,error:A}=await D.emails.send({...u});if(A)return console.error(A),!1;if(B)return!0;return!1}}class UY extends f{driver=new Y3;headers={};boot(){}filterRecipients(u){return u}}class MY extends f{channels={};boot(){}}class LY extends f{root;rootRouter;boot(){}onRequestStart(u){}onRequestEnd(u){}onRequestFail(u,D){}}class cY extends f{rootRouter;boot(){}onRequestStart(u){}onRequestEnd(u){}onRequestFail(u,D){}}class EY extends f{maxFileSize=10485760;boot(){}onLogFileClosed(u){}onLogCreated(u){}}class OY extends f{jobs=[];concurrency=1;boot(){}}class PY{static name="unset";worker=!1;maxAttempts=3;run(...u){}onFail(u,...D){}onSuccess(u,...D){}onDeadletter(u,...D){}static dispatch(...u){if(this.name==="unset")throw Error("Cannot dispatch a job with no name");CY.use().push(this,JSON.stringify(u))}}import HU from"sharp";class K3{}class h3 extends K3{async resize(u,D){let{height:B,width:A,quality:w,fit:F}=D;return await HU(u).resize(A>0?A:void 0,B>0?B:void 0,{fit:F}).webp({quality:w>0?w:80,force:!0}).toBuffer()}}class kY extends f{driver=new h3;boot(){}}class j0{}var SU={clientId:process.env.GOOGLE_CLIENT_ID,clientSecret:process.env.GOOGLE_CLIENT_SECRET,redirectPath:"/auth/oauth/google/callback",scope:"https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"};class VY extends j0{config;constructor(u={}){super();this.config={...SU,...u}}getRedirectUrl(){let u=this.config.scope,D=this.config.clientId,B=new URL("https://accounts.google.com/o/oauth2/v2/auth"),A={scope:u,include_granted_scopes:"true",response_type:"code",state:"state_parameter_passthrough_value",redirect_uri:`${process.env.HOST_NAME}/auth/oauth/google/callback`,client_id:D};for(let[F,G]of Object.entries(A))B.searchParams.append(F,G);return B.toString()}async onCallback(u){let D=new URL("https://oauth2.googleapis.com/token");D.searchParams.append("code",u.search.get("code")),D.searchParams.append("client_id",this.config.clientId),D.searchParams.append("client_secret",this.config.clientSecret),D.searchParams.append("grant_type","authorization_code"),D.searchParams.append("redirect_uri",`${process.env.HOST_NAME}${this.config.redirectPath}`);let B=await fetch(D.toString(),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}}),{access_token:A}=await B.json(),F=await(await fetch(`https://www.googleapis.com/oauth2/v3/userinfo?access_token=${A}`)).json();if(!F.email)console.error("Google OAuth error: email not found in user info response",F);return{name:F.name,email:F.email}}}var B0="https://api.x.com/2/",l0="https://api.x.com/labs/2/",A0="https://api.x.com/1.1/",b2="https://upload.x.com/1.1/",yY="https://stream.x.com/1.1/",d0="https://ads-api.x.com/12/",i0="https://ads-api-sandbox.twitter.com/12/";class l8{constructor({realData:u,rateLimit:D,instance:B,queryParams:A,sharedParams:w}){this._maxResultsWhenFetchLast=100,this._realData=u,this._rateLimit=D,this._instance=B,this._queryParams=A,this._sharedParams=w}get _isRateLimitOk(){if(!this._rateLimit)return!0;if(this._rateLimit.reset*1000<Date.now())return!0;return this._rateLimit.remaining>0}makeRequest(u){return this._instance.get(this.getEndpoint(),u,{fullResponse:!0,params:this._sharedParams})}makeNewInstanceFromResult(u,D){return new this.constructor({realData:u.data,rateLimit:u.rateLimit,instance:this._instance,queryParams:D,sharedParams:this._sharedParams})}getEndpoint(){return this._endpoint}injectQueryParams(u){return{...u?{max_results:u}:{},...this._queryParams}}async next(u){let D=this.getNextQueryParams(u),B=await this.makeRequest(D);return this.makeNewInstanceFromResult(B,D)}async fetchNext(u){let D=this.getNextQueryParams(u),B=await this.makeRequest(D);return await this.refreshInstanceFromResult(B,!0),this}async fetchLast(u=1/0){let D=this.getNextQueryParams(this._maxResultsWhenFetchLast),B=0;while(B<u&&this._isRateLimitOk){let A=await this.makeRequest(D);if(await this.refreshInstanceFromResult(A,!0),B+=this.getPageLengthFromRequest(A),this.isFetchLastOver(A))break;D=this.getNextQueryParams(this._maxResultsWhenFetchLast)}return this}get rateLimit(){var u;return{...(u=this._rateLimit)!==null&&u!==void 0?u:{}}}get data(){return this._realData}get done(){return!this.canFetchNextPage(this._realData)}*[Symbol.iterator](){yield*this.getItemArray()}async*[Symbol.asyncIterator](){yield*this.getItemArray();let u=this,D=this.canFetchNextPage(this._realData);while(D&&this._isRateLimitOk&&u.getItemArray().length>0){let B=await u.next(this._maxResultsWhenFetchLast);this.refreshInstanceFromResult({data:B._realData,headers:{},rateLimit:B._rateLimit},!0),D=this.canFetchNextPage(B._realData),yield*B.getItemArray(),u=B}}async*fetchAndIterate(){for(let B of this.getItemArray())yield[B,this];let u=this,D=this.canFetchNextPage(this._realData);while(D&&this._isRateLimitOk&&u.getItemArray().length>0){let B=await u.next(this._maxResultsWhenFetchLast);this.refreshInstanceFromResult({data:B._realData,headers:{},rateLimit:B._rateLimit},!0),D=this.canFetchNextPage(B._realData);for(let A of B.getItemArray())yield[A,B];this._rateLimit=B._rateLimit,u=B}}}class d8 extends l8{async previous(u){let D=this.getPreviousQueryParams(u),B=await this.makeRequest(D);return this.makeNewInstanceFromResult(B,D)}async fetchPrevious(u){let D=this.getPreviousQueryParams(u),B=await this.makeRequest(D);return await this.refreshInstanceFromResult(B,!1),this}}var r0=l8;class w2 extends r0{getNextQueryParams(u){var D;return{...this._queryParams,cursor:(D=this._realData.next_cursor_str)!==null&&D!==void 0?D:this._realData.next_cursor,...u?{count:u}:{}}}isFetchLastOver(u){return!this.canFetchNextPage(u.data)}canFetchNextPage(u){return!this.isNextCursorInvalid(u.next_cursor)||!this.isNextCursorInvalid(u.next_cursor_str)}isNextCursorInvalid(u){return u===void 0||u===0||u===-1||u==="0"||u==="-1"}}class i8 extends w2{constructor(){super(...arguments);this._endpoint="direct_messages/events/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.events.push(...B.events),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.events.length}getItemArray(){return this.events}get events(){return this._realData.events}}class r8 extends w2{constructor(){super(...arguments);this._endpoint="direct_messages/welcome_messages/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.welcome_messages.push(...B.welcome_messages),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.welcome_messages.length}getItemArray(){return this.welcomeMessages}get welcomeMessages(){return this._realData.welcome_messages}}var m;(function(u){u.Jpeg="image/jpeg",u.Mp4="video/mp4",u.Mov="video/quicktime",u.Gif="image/gif",u.Png="image/png",u.Srt="text/plain",u.Webp="image/webp"})(m||(m={}));var w0;(function(u){u.Create="message_create",u.WelcomeCreate="welcome_message"})(w0||(w0={}));var ku;(function(u){u.Request="request",u.PartialResponse="partial-response",u.Response="response"})(ku||(ku={}));class x3 extends Error{constructor(){super(...arguments);this.error=!0}}class Vu extends x3{constructor(u,D){super(u);this.type=ku.Request,Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"_options",{value:D})}get request(){return this._options.request}get requestError(){return this._options.requestError}toJSON(){return{type:this.type,error:this.requestError}}}class yu extends x3{constructor(u,D){super(u);this.type=ku.PartialResponse,Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"_options",{value:D})}get request(){return this._options.request}get response(){return this._options.response}get responseError(){return this._options.responseError}get rawContent(){return this._options.rawContent}toJSON(){return{type:this.type,error:this.responseError}}}class Tu extends x3{constructor(u,D){super(u);if(this.type=ku.Response,Error.captureStackTrace(this,this.constructor),Object.defineProperty(this,"_options",{value:D}),this.code=D.code,this.headers=D.headers,this.rateLimit=D.rateLimit,D.data&&typeof D.data==="object"&&"error"in D.data&&!D.data.errors){let B={...D.data};B.errors=[{code:X0.InternalError,message:B.error}],this.data=B}else this.data=D.data}get request(){return this._options.request}get response(){return this._options.response}hasErrorCode(...u){let D=this.errors;if(!(D===null||D===void 0?void 0:D.length))return!1;if("code"in D[0])return D.some((w)=>u.includes(w.code));let B=this.data;return u.includes(B.type)}get errors(){var u;return(u=this.data)===null||u===void 0?void 0:u.errors}get rateLimitError(){return this.code===420||this.code===429}get isAuthError(){if(this.code===401)return!0;return this.hasErrorCode(X0.AuthTimestampInvalid,X0.AuthenticationFail,X0.BadAuthenticationData,X0.InvalidOrExpiredToken)}toJSON(){return{type:this.type,code:this.code,error:this.data,rateLimit:this.rateLimit,headers:this.headers}}}var X0;(function(u){u[u.InvalidCoordinates=3]="InvalidCoordinates",u[u.NoLocationFound=13]="NoLocationFound",u[u.AuthenticationFail=32]="AuthenticationFail",u[u.InvalidOrExpiredToken=89]="InvalidOrExpiredToken",u[u.UnableToVerifyCredentials=99]="UnableToVerifyCredentials",u[u.AuthTimestampInvalid=135]="AuthTimestampInvalid",u[u.BadAuthenticationData=215]="BadAuthenticationData",u[u.NoUserMatch=17]="NoUserMatch",u[u.UserNotFound=50]="UserNotFound",u[u.ResourceNotFound=34]="ResourceNotFound",u[u.TweetNotFound=144]="TweetNotFound",u[u.TweetNotVisible=179]="TweetNotVisible",u[u.NotAllowedResource=220]="NotAllowedResource",u[u.MediaIdNotFound=325]="MediaIdNotFound",u[u.TweetNoLongerAvailable=421]="TweetNoLongerAvailable",u[u.TweetViolatedRules=422]="TweetViolatedRules",u[u.TargetUserSuspended=63]="TargetUserSuspended",u[u.YouAreSuspended=64]="YouAreSuspended",u[u.AccountUpdateFailed=120]="AccountUpdateFailed",u[u.NoSelfSpamReport=36]="NoSelfSpamReport",u[u.NoSelfMute=271]="NoSelfMute",u[u.AccountLocked=326]="AccountLocked",u[u.RateLimitExceeded=88]="RateLimitExceeded",u[u.NoDMRightForApp=93]="NoDMRightForApp",u[u.OverCapacity=130]="OverCapacity",u[u.InternalError=131]="InternalError",u[u.TooManyFollowings=161]="TooManyFollowings",u[u.TweetLimitExceeded=185]="TweetLimitExceeded",u[u.DuplicatedTweet=187]="DuplicatedTweet",u[u.TooManySpamReports=205]="TooManySpamReports",u[u.RequestLooksLikeSpam=226]="RequestLooksLikeSpam",u[u.NoWriteRightForApp=261]="NoWriteRightForApp",u[u.TweetActionsDisabled=425]="TweetActionsDisabled",u[u.TweetRepliesRestricted=433]="TweetRepliesRestricted",u[u.NamedParameterMissing=38]="NamedParameterMissing",u[u.InvalidAttachmentUrl=44]="InvalidAttachmentUrl",u[u.TweetTextTooLong=186]="TweetTextTooLong",u[u.MissingUrlParameter=195]="MissingUrlParameter",u[u.NoMultipleGifs=323]="NoMultipleGifs",u[u.InvalidMediaIds=324]="InvalidMediaIds",u[u.InvalidUrl=407]="InvalidUrl",u[u.TooManyTweetAttachments=386]="TooManyTweetAttachments",u[u.StatusAlreadyFavorited=139]="StatusAlreadyFavorited",u[u.FollowRequestAlreadySent=160]="FollowRequestAlreadySent",u[u.CannotUnmuteANonMutedAccount=272]="CannotUnmuteANonMutedAccount",u[u.TweetAlreadyRetweeted=327]="TweetAlreadyRetweeted",u[u.ReplyToDeletedTweet=385]="ReplyToDeletedTweet",u[u.DMReceiverNotFollowingYou=150]="DMReceiverNotFollowingYou",u[u.UnableToSendDM=151]="UnableToSendDM",u[u.MustAllowDMFromAnyone=214]="MustAllowDMFromAnyone",u[u.CannotSendDMToThisUser=349]="CannotSendDMToThisUser",u[u.DMTextTooLong=354]="DMTextTooLong",u[u.SubscriptionAlreadyExists=355]="SubscriptionAlreadyExists",u[u.CallbackUrlNotApproved=415]="CallbackUrlNotApproved",u[u.SuspendedApplication=416]="SuspendedApplication",u[u.OobOauthIsNotAllowed=417]="OobOauthIsNotAllowed"})(X0||(X0={}));var TY;(function(u){u.InvalidRequest="https://developer.x.com/en/support/x-api/error-troubleshooting#invalid-request",u.ClientForbidden="https://developer.x.com/en/support/x-api/error-troubleshooting#client-forbidden",u.UnsupportedAuthentication="https://developer.x.com/en/support/x-api/error-troubleshooting#unsupported-authentication",u.InvalidRules="https://developer.x.com/en/support/x-api/error-troubleshooting#invalid-rules",u.TooManyRules="https://developer.x.com/en/support/x-api/error-troubleshooting#rule-cap",u.DuplicatedRules="https://developer.x.com/en/support/x-api/error-troubleshooting#duplicate-rules",u.RateLimitExceeded="https://developer.x.com/en/support/x-api/error-troubleshooting#usage-capped",u.ConnectionError="https://developer.x.com/en/support/x-api/error-troubleshooting#streaming-connection",u.ClientDisconnected="https://developer.x.com/en/support/x-api/error-troubleshooting#client-disconnected",u.TwitterDisconnectedYou="https://developer.x.com/en/support/x-api/error-troubleshooting#operational-disconnect",u.ResourceNotFound="https://developer.x.com/en/support/x-api/error-troubleshooting#resource-not-found",u.ResourceUnauthorized="https://developer.x.com/en/support/x-api/error-troubleshooting#not-authorized-for-resource",u.DisallowedResource="https://developer.x.com/en/support/x-api/error-troubleshooting#disallowed-resource"})(TY||(TY={}));var M;(function(u){u.Connected="connected",u.ConnectError="connect error",u.ConnectionError="connection error",u.ConnectionClosed="connection closed",u.ConnectionLost="connection lost",u.ReconnectAttempt="reconnect attempt",u.Reconnected="reconnected",u.ReconnectError="reconnect error",u.ReconnectLimitExceeded="reconnect limit exceeded",u.DataKeepAlive="data keep-alive",u.Data="data event content",u.DataError="data twitter error",u.TweetParseError="data tweet parse error",u.Error="stream error"})(M||(M={}));class Iu{constructor(u){this.value=u}}import*as h5 from"fs";var G2={debug:!1,deprecationWarnings:!0,logger:{log:console.log.bind(console)}};function n8(u){let D={value:void 0,promise:u().then((B)=>{return D.value=B,B})};return D}function H3(u){if(Array.isArray(u))return u;return[u]}function qY(u){for(let D of Object.keys(u))if(u[D]===void 0)delete u[D]}function S3(u){return typeof u==="object"&&"errors"in u&&!("data"in u)}function qu(u){if(Array.isArray(u)&&u.length>1)return!0;return u.toString().includes(",")}var IY=new Set;function p8(u){if(typeof console>"u"||!console.warn||!G2.deprecationWarnings)return;let D=`${u.instance}-${u.method}-${u.problem}`;if(IY.has(D))return;let B=`[twitter-api-v2] Deprecation warning: In ${u.instance}.${u.method}() call, ${u.problem}.
|
|
41
|
+
${u.resolution}.`;console.warn(B),console.warn("To disable this message, import variable TwitterApiV2Settings from twitter-api-v2 and set TwitterApiV2Settings.deprecationWarnings to false."),IY.add(D)}import{EventEmitter as cU}from"events";import{request as RU}from"https";import*as x2 from"zlib";import{EventEmitter as UU}from"events";class mY{constructor(u){this.requestData=u,this.requestErrorHandled=!1,this.responseData=[]}get hrefPathname(){let u=this.requestData.url;return u.hostname+u.pathname}isCompressionDisabled(){return!this.requestData.compression||this.requestData.compression==="identity"}isFormEncodedEndpoint(){return this.requestData.url.href.startsWith("https://api.x.com/oauth/")}createRequestError(u){if(G2.debug)G2.logger.log("Request error:",u);return new Vu("Request failed.",{request:this.req,error:u})}createPartialResponseError(u,D){let A=`Request failed with partial response with HTTP code ${this.res.statusCode}`;if(D)A+=" (connection abruptly closed)";else A+=" (parse error)";return new yu(A,{request:this.req,response:this.res,responseError:u,rawContent:Buffer.concat(this.responseData).toString()})}formatV1Errors(u){return u.map(({code:D,message:B})=>`${B} (Twitter code ${D})`).join(", ")}formatV2Error(u){return`${u.title}: ${u.detail} (see ${u.type})`}createResponseError({res:u,data:D,rateLimit:B,code:A}){var w;if(G2.debug)G2.logger.log(`Request failed with code ${A}, data:`,D),G2.logger.log("Response headers:",u.headers);let F=`Request failed with code ${A}`;if((w=D===null||D===void 0?void 0:D.errors)===null||w===void 0?void 0:w.length){let G=D.errors;if(typeof G[0]==="object"&&"code"in G[0])F+=" - "+this.formatV1Errors(G);else F+=" - "+this.formatV2Error(D)}return new Tu(F,{code:A,data:D,headers:u.headers,request:this.req,response:u,rateLimit:B})}getResponseDataStream(u){if(this.isCompressionDisabled())return u;let D=(u.headers["content-encoding"]||"identity").trim().toLowerCase();if(D==="br"){let B=x2.createBrotliDecompress({flush:x2.constants.BROTLI_OPERATION_FLUSH,finishFlush:x2.constants.BROTLI_OPERATION_FLUSH});return u.pipe(B),B}if(D==="gzip"){let B=x2.createGunzip({flush:x2.constants.Z_SYNC_FLUSH,finishFlush:x2.constants.Z_SYNC_FLUSH});return u.pipe(B),B}if(D==="deflate"){let B=x2.createInflate({flush:x2.constants.Z_SYNC_FLUSH,finishFlush:x2.constants.Z_SYNC_FLUSH});return u.pipe(B),B}return u}detectResponseType(u){var D,B;if(((D=u.headers["content-type"])===null||D===void 0?void 0:D.includes("application/json"))||((B=u.headers["content-type"])===null||B===void 0?void 0:B.includes("application/problem+json")))return"json";else if(this.isFormEncodedEndpoint())return"url";return"text"}getParsedResponse(u){let D=this.responseData,B=this.requestData.forceParseMode||this.detectResponseType(u);if(B==="buffer")return Buffer.concat(D);else if(B==="text")return Buffer.concat(D).toString();else if(B==="json"){let A=Buffer.concat(D).toString();return A.length?JSON.parse(A):void 0}else if(B==="url"){let A=Buffer.concat(D).toString(),w={};for(let[F,G]of new URLSearchParams(A))w[F]=G;return w}else return}getRateLimitFromResponse(u){let D=void 0;if(u.headers["x-rate-limit-limit"]){if(D={limit:Number(u.headers["x-rate-limit-limit"]),remaining:Number(u.headers["x-rate-limit-remaining"]),reset:Number(u.headers["x-rate-limit-reset"])},u.headers["x-app-limit-24hour-limit"])D.day={limit:Number(u.headers["x-app-limit-24hour-limit"]),remaining:Number(u.headers["x-app-limit-24hour-remaining"]),reset:Number(u.headers["x-app-limit-24hour-reset"])};if(u.headers["x-user-limit-24hour-limit"])D.userDay={limit:Number(u.headers["x-user-limit-24hour-limit"]),remaining:Number(u.headers["x-user-limit-24hour-remaining"]),reset:Number(u.headers["x-user-limit-24hour-reset"])};if(this.requestData.rateLimitSaver)this.requestData.rateLimitSaver(D)}return D}onSocketEventHandler(u,D,B){let A=this.onSocketCloseHandler.bind(this,u);B.on("close",A),D.on("complete",()=>B.off("close",A))}onSocketCloseHandler(u){if(this.req.removeAllListeners("timeout"),this.res)return;if(!this.requestErrorHandled)return u(this.createRequestError(Error("Socket closed without any information.")))}requestErrorHandler(u,D){var B,A;(A=(B=this.requestData).requestEventDebugHandler)===null||A===void 0||A.call(B,"request-error",{requestError:D}),this.requestErrorHandled=!0,u(this.createRequestError(D))}timeoutErrorHandler(){this.requestErrorHandled=!0,this.req.destroy(Error("Request timeout."))}classicResponseHandler(u,D,B){this.res=B;let A=this.getResponseDataStream(B);if(A.on("data",(w)=>this.responseData.push(w)),A.on("end",this.onResponseEndHandler.bind(this,u,D)),A.on("close",this.onResponseCloseHandler.bind(this,u,D)),this.requestData.requestEventDebugHandler)this.requestData.requestEventDebugHandler("response",{res:B}),B.on("aborted",(w)=>this.requestData.requestEventDebugHandler("response-aborted",{error:w})),B.on("error",(w)=>this.requestData.requestEventDebugHandler("response-error",{error:w})),B.on("close",()=>this.requestData.requestEventDebugHandler("response-close",{data:this.responseData})),B.on("end",()=>this.requestData.requestEventDebugHandler("response-end"))}onResponseEndHandler(u,D){let B=this.getRateLimitFromResponse(this.res),A;try{A=this.getParsedResponse(this.res)}catch(F){D(this.createPartialResponseError(F,!1));return}let w=this.res.statusCode;if(w>=400){D(this.createResponseError({data:A,res:this.res,rateLimit:B,code:w}));return}if(G2.debug)G2.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${this.res.statusCode}`),G2.logger.log("Response body:",A);u({data:A,headers:this.res.headers,rateLimit:B})}onResponseCloseHandler(u,D){let B=this.res;if(B.aborted)try{return this.getParsedResponse(this.res),this.onResponseEndHandler(u,D)}catch(A){return D(this.createPartialResponseError(A,!0))}if(!B.complete)return D(this.createPartialResponseError(Error("Response has been interrupted before response could be parsed."),!0))}streamResponseHandler(u,D,B){if(B.statusCode<400){if(G2.debug)G2.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]: Request succeeds with code ${B.statusCode} (starting stream)`);let w=this.getResponseDataStream(B);u({req:this.req,res:w,originalResponse:B,requestData:this.requestData})}else this.classicResponseHandler(()=>{return},D,B)}debugRequest(){let u=this.requestData.url;if(G2.logger.log(`[${this.requestData.options.method} ${this.hrefPathname}]`,this.requestData.options),u.search)G2.logger.log("Request parameters:",[...u.searchParams.entries()].map(([D,B])=>`${D}: ${B}`));if(this.requestData.body)G2.logger.log("Request body:",this.requestData.body)}buildRequest(){var u;let D=this.requestData.url,B=D.username?`${D.username}:${D.password}`:void 0,A=(u=this.requestData.options.headers)!==null&&u!==void 0?u:{};if(this.requestData.compression===!0||this.requestData.compression==="brotli")A["accept-encoding"]="br;q=1.0, gzip;q=0.8, deflate;q=0.5, *;q=0.1";else if(this.requestData.compression==="gzip")A["accept-encoding"]="gzip;q=1, deflate;q=0.5, *;q=0.1";else if(this.requestData.compression==="deflate")A["accept-encoding"]="deflate;q=1, *;q=0.1";if(G2.debug)this.debugRequest();this.req=RU({...this.requestData.options,host:D.hostname,port:D.port||void 0,path:D.pathname+D.search,protocol:D.protocol,auth:B,headers:A})}registerRequestEventDebugHandlers(u){u.on("close",()=>this.requestData.requestEventDebugHandler("close")),u.on("abort",()=>this.requestData.requestEventDebugHandler("abort")),u.on("socket",(D)=>{this.requestData.requestEventDebugHandler("socket",{socket:D}),D.on("error",(B)=>this.requestData.requestEventDebugHandler("socket-error",{socket:D,error:B})),D.on("connect",()=>this.requestData.requestEventDebugHandler("socket-connect",{socket:D})),D.on("close",(B)=>this.requestData.requestEventDebugHandler("socket-close",{socket:D,withError:B})),D.on("end",()=>this.requestData.requestEventDebugHandler("socket-end",{socket:D})),D.on("lookup",(...B)=>this.requestData.requestEventDebugHandler("socket-lookup",{socket:D,data:B})),D.on("timeout",()=>this.requestData.requestEventDebugHandler("socket-timeout",{socket:D}))})}makeRequest(){return this.buildRequest(),new Promise((u,D)=>{let B=(G)=>{w.emit("complete"),u(G)},A=(G)=>{w.emit("complete"),D(G)},w=new UU,F=this.req;if(F.on("error",this.requestErrorHandler.bind(this,A)),F.on("socket",this.onSocketEventHandler.bind(this,A,w)),F.on("response",this.classicResponseHandler.bind(this,B,A)),this.requestData.options.timeout)F.on("timeout",this.timeoutErrorHandler.bind(this));if(this.requestData.requestEventDebugHandler)this.registerRequestEventDebugHandlers(F);if(this.requestData.body)F.write(this.requestData.body);F.end()})}async makeRequestAsStream(){let{req:u,res:D,requestData:B,originalResponse:A}=await this.makeRequestAndResolveWhenReady();return new R3(B,{req:u,res:D,originalResponse:A})}makeRequestAndResolveWhenReady(){return this.buildRequest(),new Promise((u,D)=>{let B=this.req;if(B.on("error",this.requestErrorHandler.bind(this,D)),B.on("response",this.streamResponseHandler.bind(this,u,D)),this.requestData.body)B.write(this.requestData.body);B.end()})}}var mu=mY;import{EventEmitter as MU}from"events";class _Y extends MU{constructor(u){super();this.stream=u,this.stack=[],this.onStreamData=this.onStreamData.bind(this),this.onStreamError=this.onStreamError.bind(this),this.onceNewEvent=this.once.bind(this,"event"),u.on(M.Data,this.onStreamData),u.on(M.ConnectionError,this.onStreamError),u.on(M.TweetParseError,this.onStreamError),u.on(M.ConnectionClosed,this.onStreamError)}nextEvent(){return new Promise(this.onceNewEvent)}hasStack(){return this.stack.length>0}popStack(){let u=this.stack;return this.stack=[],u}destroy(){this.removeAllListeners(),this.stream.off(M.Data,this.onStreamData),this.stream.off(M.ConnectionError,this.onStreamError),this.stream.off(M.TweetParseError,this.onStreamError),this.stream.off(M.ConnectionClosed,this.onStreamError)}emitEvent(u,D){this.emit("event",{type:u,payload:D})}onStreamError(u){this.emitEvent("error",u)}onStreamData(u){this.stack.push(u),this.emitEvent("data",u)}}var gY=_Y;import{EventEmitter as LU}from"events";class U3 extends LU{constructor(){super(...arguments);this.currentMessage=""}push(u){this.currentMessage+=u,u=this.currentMessage;let D=u.length,B=0,A=0;while(A<D){if(u.slice(A,A+2)===`\r
|
|
42
|
+
`){let w=u.slice(B,A);if(B=A+=2,!w.length)continue;try{let F=JSON.parse(w);if(F){this.emit(Y0.ParsedData,F);continue}}catch(F){this.emit(Y0.ParseError,F)}}A++}this.currentMessage=u.slice(B,D)}reset(){this.currentMessage=""}}var Y0;(function(u){u.ParsedData="parsed data",u.ParseError="parse error"})(Y0||(Y0={}));var fY=[5,15,30,60,90,120,180,300,600,900],EU=(u)=>u>fY.length?901000:fY[u-1]*1000;class bY extends cU{constructor(u,D){super();if(this.requestData=u,this.autoReconnect=!1,this.autoReconnectRetries=5,this.keepAliveTimeoutMs=120000,this.nextRetryTimeout=EU,this.parser=new U3,this.connectionProcessRunning=!1,this.onKeepAliveTimeout=this.onKeepAliveTimeout.bind(this),this.initEventsFromParser(),D)this.req=D.req,this.res=D.res,this.originalResponse=D.originalResponse,this.initEventsFromRequest()}on(u,D){return super.on(u,D)}initEventsFromRequest(){if(!this.req||!this.res)throw Error("TweetStream error: You cannot init TweetStream without a request and response object.");let u=(D)=>{this.emit(M.ConnectionError,D),this.emit(M.Error,{type:M.ConnectionError,error:D,message:"Connection lost or closed by Twitter."}),this.onConnectionError()};this.req.on("error",u),this.res.on("error",u),this.res.on("close",()=>u(Error("Connection closed by Twitter."))),this.res.on("data",(D)=>{if(this.resetKeepAliveTimeout(),D.toString()===`\r
|
|
43
|
+
`)return this.emit(M.DataKeepAlive);this.parser.push(D.toString())}),this.resetKeepAliveTimeout()}initEventsFromParser(){let u=this.requestData.payloadIsError;this.parser.on(Y0.ParsedData,(D)=>{if(u&&u(D))this.emit(M.DataError,D),this.emit(M.Error,{type:M.DataError,error:D,message:"Twitter sent a payload that is detected as an error payload."});else this.emit(M.Data,D)}),this.parser.on(Y0.ParseError,(D)=>{this.emit(M.TweetParseError,D),this.emit(M.Error,{type:M.TweetParseError,error:D,message:"Failed to parse stream data."})})}resetKeepAliveTimeout(){if(this.unbindKeepAliveTimeout(),this.keepAliveTimeoutMs!==1/0)this.keepAliveTimeout=setTimeout(this.onKeepAliveTimeout,this.keepAliveTimeoutMs)}onKeepAliveTimeout(){this.emit(M.ConnectionLost),this.onConnectionError()}unbindTimeouts(){this.unbindRetryTimeout(),this.unbindKeepAliveTimeout()}unbindKeepAliveTimeout(){if(this.keepAliveTimeout)clearTimeout(this.keepAliveTimeout),this.keepAliveTimeout=void 0}unbindRetryTimeout(){if(this.retryTimeout)clearTimeout(this.retryTimeout),this.retryTimeout=void 0}closeWithoutEmit(){if(this.unbindTimeouts(),this.res)this.res.removeAllListeners(),this.res.destroy();if(this.req)this.req.removeAllListeners(),this.req.destroy()}close(){this.emit(M.ConnectionClosed),this.closeWithoutEmit()}destroy(){this.removeAllListeners(),this.close()}async clone(){let D=await new mu(this.requestData).makeRequestAsStream(),B=this.eventNames();for(let A of B){let w=this.listeners(A);for(let F of w)D.on(A,F)}return D}async connect(u={}){if(typeof u.autoReconnect<"u")this.autoReconnect=u.autoReconnect;if(typeof u.autoReconnectRetries<"u")this.autoReconnectRetries=u.autoReconnectRetries==="unlimited"?1/0:u.autoReconnectRetries;if(typeof u.keepAliveTimeout<"u")this.keepAliveTimeoutMs=u.keepAliveTimeout==="disable"?1/0:u.keepAliveTimeout;if(typeof u.nextRetryTimeout<"u")this.nextRetryTimeout=u.nextRetryTimeout;this.unbindTimeouts();try{await this.reconnect()}catch(D){if(this.emit(M.ConnectError,0),this.emit(M.Error,{type:M.ConnectError,error:D,message:"Connect error - Initial connection just failed."}),this.autoReconnect)this.makeAutoReconnectRetry(0,D);else throw D}return this}async reconnect(){if(this.connectionProcessRunning)throw Error("Connection process is already running.");this.connectionProcessRunning=!0;try{let u=!0;if(this.req)u=!1,this.closeWithoutEmit();let{req:D,res:B,originalResponse:A}=await new mu(this.requestData).makeRequestAndResolveWhenReady();this.req=D,this.res=B,this.originalResponse=A,this.emit(u?M.Connected:M.Reconnected),this.parser.reset(),this.initEventsFromRequest()}finally{this.connectionProcessRunning=!1}}async onConnectionError(u=0){if(this.unbindTimeouts(),this.closeWithoutEmit(),!this.autoReconnect){this.emit(M.ConnectionClosed);return}if(u>=this.autoReconnectRetries){this.emit(M.ReconnectLimitExceeded),this.emit(M.ConnectionClosed);return}try{this.emit(M.ReconnectAttempt,u),await this.reconnect()}catch(D){this.emit(M.ReconnectError,u),this.emit(M.Error,{type:M.ReconnectError,error:D,message:`Reconnect error - ${u+1} attempts made yet.`}),this.makeAutoReconnectRetry(u,D)}}makeAutoReconnectRetry(u,D){let B=this.nextRetryTimeout(u+1,D);this.retryTimeout=setTimeout(()=>{this.onConnectionError(u+1)},B)}async*[Symbol.asyncIterator](){let u=new gY(this);try{while(!0){if(!this.req||this.req.aborted)throw Error("Connection closed");if(u.hasStack())yield*u.popStack();let{type:D,payload:B}=await u.nextEvent();if(D==="error")throw B}}finally{u.destroy()}}}var R3=bY;function jY(u){var D;if(!((D=u.clientSettings.plugins)===null||D===void 0?void 0:D.length))return!1;for(let B of u.clientSettings.plugins)if(B.onRequestError||B.onResponseError)return!0;return!1}async function lY(u,D,B,A){let w;if(A instanceof Vu||A instanceof yu)w=await this.applyPluginMethod("onRequestError",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,error:A});else if(A instanceof Tu)w=await this.applyPluginMethod("onResponseError",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,error:A});if(w&&w instanceof Iu)return w.value;return Promise.reject(A)}import*as rY from"crypto";class y2{constructor(u){this.nonceLength=32,this.consumerKeys=u.consumerKeys}static percentEncode(u){return encodeURIComponent(u).replace(/!/g,"%21").replace(/\*/g,"%2A").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")}hash(u,D){return rY.createHmac("sha1",D).update(u).digest("base64")}authorize(u,D={}){let B={oauth_consumer_key:this.consumerKeys.key,oauth_nonce:this.getNonce(),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:this.getTimestamp(),oauth_version:"1.0"};if(D.key!==void 0)B.oauth_token=D.key;if(!u.data)u.data={};return B.oauth_signature=this.getSignature(u,D.secret,B),B}toHeader(u){let D=iY(u),B="OAuth ";for(let A of D){if(A.key.indexOf("oauth_")!==0)continue;B+=y2.percentEncode(A.key)+'="'+y2.percentEncode(A.value)+'",'}return{Authorization:B.slice(0,B.length-1)}}getNonce(){let D="";for(let B=0;B<this.nonceLength;B++)D+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.trunc(Math.random()*62)];return D}getTimestamp(){return Math.trunc(new Date().getTime()/1000)}getSignature(u,D,B){return this.hash(this.getBaseString(u,B),this.getSigningKey(D))}getSigningKey(u){return y2.percentEncode(this.consumerKeys.secret)+"&"+y2.percentEncode(u||"")}getBaseString(u,D){return u.method.toUpperCase()+"&"+y2.percentEncode(this.getBaseUrl(u.url))+"&"+y2.percentEncode(this.getParameterString(u,D))}getParameterString(u,D){let B=iY(PU(dY(D,dY(u.data,CU(u.url))))),A="";for(let{key:w,value:F}of B)if(F&&Array.isArray(F)){F.sort();let G="";F.forEach((N,$)=>{if(G+=w+"="+N,$<F.length)G+="&"}),A+=G}else A+=w+"="+F+"&";return A.slice(0,A.length-1)}getBaseUrl(u){return u.split("?")[0]}}var _u=y2;function dY(u,D){return{...u||{},...D||{}}}function iY(u){return Object.keys(u).sort().map((D)=>({key:D,value:u[D]}))}function OU(u){let D=u.split("&"),B={};for(let A of D){let[w,F=""]=A.split("=");if(B[w]){if(!Array.isArray(B[w]))B[w]=[B[w]];B[w].push(decodeURIComponent(F))}else B[w]=decodeURIComponent(F)}return B}function CU(u){let D=u.split("?");if(D.length===1)return{};return OU(D[1])}function PU(u){let D={};for(let B in u){let A=u[B];if(A&&Array.isArray(A))A=A.map((w)=>y2.percentEncode(w));else A=y2.percentEncode(A);D[y2.percentEncode(B)]=A}return D}class T2{constructor(){this._boundary="",this._chunks=[]}bodyAppend(...u){let D=u.map((B)=>B instanceof Buffer?B:Buffer.from(B));this._chunks.push(...D)}append(u,D,B){let A=D instanceof Buffer?D:D.toString(),w=this.getMultipartHeader(u,A,B);this.bodyAppend(w,A,T2.LINE_BREAK)}getHeaders(){return{"content-type":"multipart/form-data; boundary="+this.getBoundary()}}getLength(){return this._chunks.reduce((u,D)=>u+D.length,this.getMultipartFooter().length)}getBuffer(){let u=[...this._chunks,this.getMultipartFooter()],D=Buffer.alloc(this.getLength()),B=0;for(let A of u)for(let w=0;w<A.length;B++,w++)D[B]=A[w];return D}getBoundary(){if(!this._boundary)this.generateBoundary();return this._boundary}generateBoundary(){let u="--------------------------";for(let D=0;D<24;D++)u+=Math.floor(Math.random()*10).toString(16);this._boundary=u}getMultipartHeader(u,D,B){if(!B)B=D instanceof Buffer?T2.DEFAULT_CONTENT_TYPE:"";let A={"Content-Disposition":["form-data",`name="${u}"`],"Content-Type":B},w="";for(let[F,G]of Object.entries(A)){if(!G.length)continue;w+=F+": "+H3(G).join("; ")+T2.LINE_BREAK}return"--"+this.getBoundary()+T2.LINE_BREAK+w+T2.LINE_BREAK}getMultipartFooter(){if(this._footerChunk)return this._footerChunk;return this._footerChunk=Buffer.from("--"+this.getBoundary()+"--"+T2.LINE_BREAK)}}T2.LINE_BREAK=`\r
|
|
44
|
+
`;T2.DEFAULT_CONTENT_TYPE="application/octet-stream";class a8{static formatQueryToString(u){let D={};for(let B in u)if(typeof u[B]==="string")D[B]=u[B];else if(typeof u[B]<"u")D[B]=String(u[B]);return D}static autoDetectBodyType(u){if(u.pathname.startsWith("/2/")||u.pathname.startsWith("/labs/2/")){if(u.password.startsWith("/2/oauth2"))return"url";return"json"}if(u.hostname==="upload.x.com"){if(u.pathname==="/1.1/media/upload.json")return"form-data";return"json"}let D=u.pathname.split("/1.1/",2)[1];if(this.JSON_1_1_ENDPOINTS.has(D))return"json";return"url"}static addQueryParamsToUrl(u,D){let B=Object.entries(D);if(B.length){let A="";for(let[w,F]of B)A+=(A.length?"&":"?")+`${_u.percentEncode(w)}=${_u.percentEncode(F)}`;u.search=A}}static constructBodyParams(u,D,B){if(u instanceof Buffer)return u;if(B==="json"){if(!D["content-type"])D["content-type"]="application/json;charset=UTF-8";return JSON.stringify(u)}else if(B==="url"){if(!D["content-type"])D["content-type"]="application/x-www-form-urlencoded;charset=UTF-8";if(Object.keys(u).length)return new URLSearchParams(u).toString().replace(/\*/g,"%2A");return""}else if(B==="raw")throw Error("You can only use raw body mode with Buffers. To give a string, use Buffer.from(str).");else{let A=new T2;for(let w in u)A.append(w,u[w]);if(!D["content-type"]){let w=A.getHeaders();D["content-type"]=w["content-type"]}return A.getBuffer()}}static setBodyLengthHeader(u,D){var B;if(u.headers=(B=u.headers)!==null&&B!==void 0?B:{},typeof D==="string")u.headers["content-length"]=Buffer.byteLength(D);else u.headers["content-length"]=D.length}static isOAuthSerializable(u){return!(u instanceof Buffer)}static mergeQueryAndBodyForOAuth(u,D){let B={};for(let A in u)B[A]=u[A];if(this.isOAuthSerializable(D))for(let A in D){let w=D[A];if(this.isOAuthSerializable(w))B[A]=typeof w==="object"&&w!==null&&"toString"in w?w.toString():w}return B}static moveUrlQueryParamsIntoObject(u,D){for(let[B,A]of u.searchParams)D[B]=A;return u.search="",u}static applyRequestParametersToUrl(u,D){return u.pathname=u.pathname.replace(/:([A-Z_-]+)/ig,(B,A)=>{if(D[A]!==void 0)return String(D[A]);return B}),u}}a8.JSON_1_1_ENDPOINTS=new Set(["direct_messages/events/new.json","direct_messages/welcome_messages/new.json","direct_messages/welcome_messages/rules/new.json","media/metadata/create.json","collections/entries/curate.json"]);var k2=a8;import*as nY from"crypto";class K0{static getCodeVerifier(){return this.generateRandomString(128)}static getCodeChallengeFromVerifier(u){return this.escapeBase64Url(nY.createHash("sha256").update(u).digest("base64"))}static getAuthHeader(u,D){let B=encodeURIComponent(u)+":"+encodeURIComponent(D);return Buffer.from(B).toString("base64")}static generateRandomString(u){let D="",B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~";for(let A=0;A<u;A++)D+=B[Math.floor(Math.random()*B.length)];return D}static escapeBase64Url(u){return u.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}}class n0{constructor(u){if(this.rateLimits={},this.clientSettings={},u)this.clientSettings=u}getRateLimits(){return this.rateLimits}saveRateLimit(u,D){this.rateLimits[u]=D}async send(u){var D,B,A,w,F;if((D=this.clientSettings.plugins)===null||D===void 0?void 0:D.length){let J=await this.applyPreRequestConfigHooks(u);if(J)return J}let G=this.getHttpRequestArgs(u),N={method:G.method,headers:G.headers,timeout:u.timeout,agent:this.clientSettings.httpAgent},$=u.enableRateLimitSave!==!1;if(G.body)k2.setBodyLengthHeader(N,G.body);if((B=this.clientSettings.plugins)===null||B===void 0?void 0:B.length)await this.applyPreRequestHooks(u,G,N);let Z=new mu({url:G.url,options:N,body:G.body,rateLimitSaver:$?this.saveRateLimit.bind(this,G.rawUrl):void 0,requestEventDebugHandler:u.requestEventDebugHandler,compression:(w=(A=u.compression)!==null&&A!==void 0?A:this.clientSettings.compression)!==null&&w!==void 0?w:!0,forceParseMode:u.forceParseMode}).makeRequest();if(jY(this))Z=this.applyResponseErrorHooks(u,G,N,Z);let Q=await Z;if((F=this.clientSettings.plugins)===null||F===void 0?void 0:F.length){let J=await this.applyPostRequestHooks(u,G,N,Q);if(J)return J.value}return Q}sendStream(u){var D,B;if(this.clientSettings.plugins)this.applyPreStreamRequestConfigHooks(u);let A=this.getHttpRequestArgs(u),w={method:A.method,headers:A.headers,agent:this.clientSettings.httpAgent},F=u.enableRateLimitSave!==!1,G=u.autoConnect!==!1;if(A.body)k2.setBodyLengthHeader(w,A.body);let N={url:A.url,options:w,body:A.body,rateLimitSaver:F?this.saveRateLimit.bind(this,A.rawUrl):void 0,payloadIsError:u.payloadIsError,compression:(B=(D=u.compression)!==null&&D!==void 0?D:this.clientSettings.compression)!==null&&B!==void 0?B:!0},$=new R3(N);if(!G)return $;return $.connect()}initializeToken(u){if(typeof u==="string")this.bearerToken=u;else if(typeof u==="object"&&"appKey"in u){if(this.consumerToken=u.appKey,this.consumerSecret=u.appSecret,u.accessToken&&u.accessSecret)this.accessToken=u.accessToken,this.accessSecret=u.accessSecret;this._oauth=this.buildOAuth()}else if(typeof u==="object"&&"username"in u){let D=encodeURIComponent(u.username)+":"+encodeURIComponent(u.password);this.basicToken=Buffer.from(D).toString("base64")}else if(typeof u==="object"&&"clientId"in u)this.clientId=u.clientId,this.clientSecret=u.clientSecret}getActiveTokens(){if(this.bearerToken)return{type:"oauth2",bearerToken:this.bearerToken};else if(this.basicToken)return{type:"basic",token:this.basicToken};else if(this.consumerSecret&&this._oauth)return{type:"oauth-1.0a",appKey:this.consumerToken,appSecret:this.consumerSecret,accessToken:this.accessToken,accessSecret:this.accessSecret};else if(this.clientId)return{type:"oauth2-user",clientId:this.clientId};return{type:"none"}}buildOAuth(){if(!this.consumerSecret||!this.consumerToken)throw Error("Invalid consumer tokens");return new _u({consumerKeys:{key:this.consumerToken,secret:this.consumerSecret}})}getOAuthAccessTokens(){if(!this.accessSecret||!this.accessToken)return;return{key:this.accessToken,secret:this.accessSecret}}getPlugins(){var u;return(u=this.clientSettings.plugins)!==null&&u!==void 0?u:[]}hasPlugins(){var u;return!!((u=this.clientSettings.plugins)===null||u===void 0?void 0:u.length)}async applyPluginMethod(u,D){var B;let A;for(let w of this.getPlugins()){let F=await((B=w[u])===null||B===void 0?void 0:B.call(w,D));if(F&&F instanceof Iu)A=F}return A}writeAuthHeaders({headers:u,bodyInSignature:D,url:B,method:A,query:w,body:F}){if(u={...u},this.bearerToken)u.Authorization="Bearer "+this.bearerToken;else if(this.basicToken)u.Authorization="Basic "+this.basicToken;else if(this.clientId&&this.clientSecret)u.Authorization="Basic "+K0.getAuthHeader(this.clientId,this.clientSecret);else if(this.consumerSecret&&this._oauth){let G=D?k2.mergeQueryAndBodyForOAuth(w,F):w,N=this._oauth.authorize({url:B.toString(),method:A,data:G},this.getOAuthAccessTokens());u={...u,...this._oauth.toHeader(N)}}return u}getUrlObjectFromUrlString(u){if(!u.startsWith("http"))u="https://"+u;return new URL(u)}getHttpRequestArgs({url:u,method:D,query:B={},body:A={},headers:w,forceBodyMode:F,enableAuth:G,params:N}){let $=void 0;if(D=D.toUpperCase(),w=w!==null&&w!==void 0?w:{},!w["x-user-agent"])w["x-user-agent"]="Node.twitter-api-v2";let Z=this.getUrlObjectFromUrlString(u),Q=Z.origin+Z.pathname;if(N)k2.applyRequestParametersToUrl(Z,N);let J=k2.formatQueryToString(B);if(k2.moveUrlQueryParamsIntoObject(Z,J),!(A instanceof Buffer))qY(A);let v=F!==null&&F!==void 0?F:k2.autoDetectBodyType(Z);if(G!==!1){let W=n0.BODY_METHODS.has(D)&&v==="url";w=this.writeAuthHeaders({headers:w,bodyInSignature:W,method:D,query:J,url:Z,body:A})}if(n0.BODY_METHODS.has(D))$=k2.constructBodyParams(A,w,v)||void 0;return k2.addQueryParamsToUrl(Z,J),{rawUrl:Q,url:Z,method:D,headers:w,body:$}}async applyPreRequestConfigHooks(u){var D;let B=this.getUrlObjectFromUrlString(u.url);for(let A of this.getPlugins()){let w=await((D=A.onBeforeRequestConfig)===null||D===void 0?void 0:D.call(A,{client:this,url:B,params:u}));if(w)return w}}applyPreStreamRequestConfigHooks(u){var D;let B=this.getUrlObjectFromUrlString(u.url);for(let A of this.getPlugins())(D=A.onBeforeStreamRequestConfig)===null||D===void 0||D.call(A,{client:this,url:B,params:u})}async applyPreRequestHooks(u,D,B){await this.applyPluginMethod("onBeforeRequest",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B})}async applyPostRequestHooks(u,D,B,A){return await this.applyPluginMethod("onAfterRequest",{client:this,url:this.getUrlObjectFromUrlString(u.url),params:u,computedParams:D,requestOptions:B,response:A})}applyResponseErrorHooks(u,D,B,A){return A.catch(lY.bind(this,u,D,B))}}n0.BODY_METHODS=new Set(["POST","PUT","PATCH"]);class F0{constructor(u,D={}){if(this._currentUser=null,this._currentUserV2=null,u instanceof F0)this._requestMaker=u._requestMaker;else this._requestMaker=new n0(D),this._requestMaker.initializeToken(u)}setPrefix(u){this._prefix=u}cloneWithPrefix(u){let D=this.constructor(this);return D.setPrefix(u),D}getActiveTokens(){return this._requestMaker.getActiveTokens()}getPlugins(){return this._requestMaker.getPlugins()}getPluginOfType(u){return this.getPlugins().find((D)=>D instanceof u)}hasHitRateLimit(u){var D;if(this.isRateLimitStatusObsolete(u))return!1;return((D=this.getLastRateLimitStatus(u))===null||D===void 0?void 0:D.remaining)===0}isRateLimitStatusObsolete(u){let D=this.getLastRateLimitStatus(u);if(D===void 0)return!0;return D.reset*1000<Date.now()}getLastRateLimitStatus(u){let D=u.match(/^https?:\/\//)?u:this._prefix+u;return this._requestMaker.getRateLimits()[D]}getCurrentUserObject(u=!1){if(!u&&this._currentUser){if(this._currentUser.value)return Promise.resolve(this._currentUser.value);return this._currentUser.promise}return this._currentUser=n8(()=>this.get("account/verify_credentials.json",{tweet_mode:"extended"},{prefix:A0})),this._currentUser.promise}getCurrentUserV2Object(u=!1){if(!u&&this._currentUserV2){if(this._currentUserV2.value)return Promise.resolve(this._currentUserV2.value);return this._currentUserV2.promise}return this._currentUserV2=n8(()=>this.get("users/me",void 0,{prefix:B0})),this._currentUserV2.promise}async get(u,D={},{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"GET",query:D,...w});return B?F:F.data}async delete(u,D={},{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"DELETE",query:D,...w});return B?F:F.data}async post(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"POST",body:D,...w});return B?F:F.data}async put(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"PUT",body:D,...w});return B?F:F.data}async patch(u,D,{fullResponse:B,prefix:A=this._prefix,...w}={}){if(A)u=A+u;let F=await this._requestMaker.send({url:u,method:"PATCH",body:D,...w});return B?F:F.data}getStream(u,D,{prefix:B=this._prefix,...A}={}){return this._requestMaker.sendStream({url:B?B+u:u,method:"GET",query:D,...A})}postStream(u,D,{prefix:B=this._prefix,...A}={}){return this._requestMaker.sendStream({url:B?B+u:u,method:"POST",body:D,...A})}}class V2 extends F0{constructor(u){if(!(u instanceof F0))throw Error("You must instance SubTwitterApi instance from existing TwitterApi instance.");super(u)}}class p0 extends r0{constructor(){super(...arguments);this.hasFinishedFetch=!1}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.push(...B),this.hasFinishedFetch=B.length===0}getNextQueryParams(u){let D=BigInt(this._realData[this._realData.length-1].id_str);return{...this.injectQueryParams(u),max_id:(D-BigInt(1)).toString()}}getPageLengthFromRequest(u){return u.data.length}isFetchLastOver(u){return!u.data.length}canFetchNextPage(u){return u.length>0}getItemArray(){return this.tweets}get tweets(){return this._realData}get done(){return super.done||this.hasFinishedFetch}}class s8 extends p0{constructor(){super(...arguments);this._endpoint="statuses/home_timeline.json"}}class t8 extends p0{constructor(){super(...arguments);this._endpoint="statuses/mentions_timeline.json"}}class M3 extends p0{constructor(){super(...arguments);this._endpoint="statuses/user_timeline.json"}}class o8 extends p0{constructor(){super(...arguments);this._endpoint="lists/statuses.json"}}class L3 extends p0{constructor(){super(...arguments);this._endpoint="favorites/list.json"}}class e8 extends w2{constructor(){super(...arguments);this._endpoint="mutes/users/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class u5 extends w2{constructor(){super(...arguments);this._endpoint="mutes/users/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class D5 extends w2{constructor(){super(...arguments);this._endpoint="followers/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class B5 extends w2{constructor(){super(...arguments);this._endpoint="followers/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class A5 extends w2{constructor(){super(...arguments);this._endpoint="friends/list.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class w5 extends w2{constructor(){super(...arguments);this._endpoint="friends/ids.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class F5 extends r0{constructor(){super(...arguments);this._endpoint="users/search.json"}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.push(...B)}getNextQueryParams(u){var D;let B=Number((D=this._queryParams.page)!==null&&D!==void 0?D:"1");return{...this._queryParams,page:B+1,...u?{count:u}:{}}}getPageLengthFromRequest(u){return u.data.length}isFetchLastOver(u){return!u.data.length}canFetchNextPage(u){return u.length>0}getItemArray(){return this.users}get users(){return this._realData}}class c3 extends w2{constructor(){super(...arguments);this._endpoint="friendships/incoming.json",this._maxResultsWhenFetchLast=5000}refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.ids.push(...B.ids),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.ids.length}getItemArray(){return this.ids}get ids(){return this._realData.ids}}class G5 extends c3{constructor(){super(...arguments);this._endpoint="friendships/outgoing.json"}}class E3 extends w2{refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.lists.push(...B.lists),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.lists.length}getItemArray(){return this.lists}get lists(){return this._realData.lists}}class N5 extends E3{constructor(){super(...arguments);this._endpoint="lists/memberships.json"}}class $5 extends E3{constructor(){super(...arguments);this._endpoint="lists/ownerships.json"}}class z5 extends E3{constructor(){super(...arguments);this._endpoint="lists/subscriptions.json"}}class Z5 extends w2{refreshInstanceFromResult(u,D){let B=u.data;if(this._rateLimit=u.rateLimit,D)this._realData.users.push(...B.users),this._realData.next_cursor=B.next_cursor}getPageLengthFromRequest(u){return u.data.users.length}getItemArray(){return this.users}get users(){return this._realData.users}}class J5 extends Z5{constructor(){super(...arguments);this._endpoint="lists/members.json"}}class v5 extends Z5{constructor(){super(...arguments);this._endpoint="lists/subscribers.json"}}class a0 extends V2{constructor(){super(...arguments);this._prefix=A0}singleTweet(u,D={}){return this.get("statuses/show.json",{tweet_mode:"extended",id:u,...D})}tweets(u,D={}){return this.post("statuses/lookup.json",{tweet_mode:"extended",id:u,...D})}oembedTweet(u,D={}){return this.get("oembed",{url:`https://x.com/i/statuses/${u}`,...D},{prefix:"https://publish.x.com/"})}async homeTimeline(u={}){let D={tweet_mode:"extended",...u},B=await this.get("statuses/home_timeline.json",D,{fullResponse:!0});return new s8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async mentionTimeline(u={}){let D={tweet_mode:"extended",...u},B=await this.get("statuses/mentions_timeline.json",D,{fullResponse:!0});return new t8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userTimeline(u,D={}){let B={tweet_mode:"extended",user_id:u,...D},A=await this.get("statuses/user_timeline.json",B,{fullResponse:!0});return new M3({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async userTimelineByUsername(u,D={}){let B={tweet_mode:"extended",screen_name:u,...D},A=await this.get("statuses/user_timeline.json",B,{fullResponse:!0});return new M3({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async favoriteTimeline(u,D={}){let B={tweet_mode:"extended",user_id:u,...D},A=await this.get("favorites/list.json",B,{fullResponse:!0});return new L3({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async favoriteTimelineByUsername(u,D={}){let B={tweet_mode:"extended",screen_name:u,...D},A=await this.get("favorites/list.json",B,{fullResponse:!0});return new L3({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}user(u){return this.get("users/show.json",{tweet_mode:"extended",...u})}users(u){return this.get("users/lookup.json",{tweet_mode:"extended",...u})}verifyCredentials(u={}){return this.get("account/verify_credentials.json",u)}async listMutedUsers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("mutes/users/list.json",D,{fullResponse:!0});return new e8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listMutedUserIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("mutes/users/ids.json",D,{fullResponse:!0});return new u5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFriendList(u={}){let D={...u},B=await this.get("friends/list.json",D,{fullResponse:!0});return new A5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowerList(u={}){let D={...u},B=await this.get("followers/list.json",D,{fullResponse:!0});return new D5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowerIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("followers/ids.json",D,{fullResponse:!0});return new B5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async userFollowingIds(u={}){let D={stringify_ids:!0,...u},B=await this.get("friends/ids.json",D,{fullResponse:!0});return new w5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async searchUsers(u,D={}){let B={q:u,tweet_mode:"extended",page:1,...D},A=await this.get("users/search.json",B,{fullResponse:!0});return new F5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}friendship(u){return this.get("friendships/show.json",u)}friendships(u){return this.get("friendships/lookup.json",u)}friendshipsNoRetweets(){return this.get("friendships/no_retweets/ids.json",{stringify_ids:!0})}async friendshipsIncoming(u={}){let D={stringify_ids:!0,...u},B=await this.get("friendships/incoming.json",D,{fullResponse:!0});return new c3({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async friendshipsOutgoing(u={}){let D={stringify_ids:!0,...u},B=await this.get("friendships/outgoing.json",D,{fullResponse:!0});return new G5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}accountSettings(){return this.get("account/settings.json")}userProfileBannerSizes(u){return this.get("users/profile_banner.json",u)}list(u){return this.get("lists/show.json",{tweet_mode:"extended",...u})}lists(u={}){return this.get("lists/list.json",{tweet_mode:"extended",...u})}async listMembers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/members.json",D,{fullResponse:!0});return new J5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}listGetMember(u){return this.get("lists/members/show.json",{tweet_mode:"extended",...u})}async listMemberships(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/memberships.json",D,{fullResponse:!0});return new N5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listOwnerships(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/ownerships.json",D,{fullResponse:!0});return new $5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listStatuses(u){let D={tweet_mode:"extended",...u},B=await this.get("lists/statuses.json",D,{fullResponse:!0});return new o8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}async listSubscribers(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/subscribers.json",D,{fullResponse:!0});return new v5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}listGetSubscriber(u){return this.get("lists/subscribers/show.json",{tweet_mode:"extended",...u})}async listSubscriptions(u={}){let D={tweet_mode:"extended",...u},B=await this.get("lists/subscriptions.json",D,{fullResponse:!0});return new z5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}mediaInfo(u){return this.get("media/upload.json",{command:"STATUS",media_id:u},{prefix:b2})}filterStream({autoConnect:u,...D}={}){let B={};for(let[w,F]of Object.entries(D))if(w==="follow"||w==="track")B[w]=F.toString();else if(w==="locations"){let G=F;B.locations=H3(G).map((N)=>`${N.lng},${N.lat}`).join(",")}else B[w]=F;return this.stream.postStream("statuses/filter.json",B,{autoConnect:u})}sampleStream({autoConnect:u,...D}={}){return this.stream.getStream("statuses/sample.json",D,{autoConnect:u})}get stream(){let u=new O3(this);return u.setPrefix(yY),u}trendsByPlace(u,D={}){return this.get("trends/place.json",{id:u,...D})}trendsAvailable(){return this.get("trends/available.json")}trendsClosest(u,D){return this.get("trends/closest.json",{lat:u,long:D})}geoPlace(u){return this.get("geo/id/:place_id.json",void 0,{params:{place_id:u}})}geoSearch(u){return this.get("geo/search.json",u)}geoReverseGeoCode(u){return this.get("geo/reverse_geocode.json",u)}rateLimitStatuses(...u){return this.get("application/rate_limit_status.json",{resources:u})}supportedLanguages(){return this.get("help/languages.json")}}import*as G0 from"fs";async function Q5(u){let D=await W5(u);if(typeof D==="number")return new Promise((B,A)=>{G0.readFile(D,(w,F)=>{if(w)return A(w);B(F)})});else if(D instanceof Buffer)return D;else return D.readFile()}function W5(u){if(typeof u==="string")return G0.promises.open(u,"r");else if(typeof u==="number")return u;else if(typeof u==="object"&&!(u instanceof Buffer))return u;else if(!(u instanceof Buffer))throw Error("Given file is not valid, please check its type.");else return u}async function pY(u){if(typeof u==="number")return(await new Promise((B,A)=>{G0.fstat(u,(w,F)=>{if(w)A(w);B(F)})})).size;else if(u instanceof Buffer)return u.length;else return(await u.stat()).size}function aY(u,D,B){if(typeof B==="string")return B;else if(typeof u==="string"&&!D)return kU(u);else if(typeof D==="string")return VU(D);throw Error("You must specify type if file is a file handle or Buffer.")}function kU(u){if(u.endsWith(".jpeg")||u.endsWith(".jpg"))return m.Jpeg;if(u.endsWith(".png"))return m.Png;if(u.endsWith(".webp"))return m.Webp;if(u.endsWith(".gif"))return m.Gif;if(u.endsWith(".mpeg4")||u.endsWith(".mp4"))return m.Mp4;if(u.endsWith(".mov")||u.endsWith(".mov"))return m.Mov;if(u.endsWith(".srt"))return m.Srt;return p8({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"options.mimeType is missing and filename couldn't help to resolve MIME type, so it will fallback to image/jpeg",resolution:"If you except to give filenames without extensions, please specify explicitlty the MIME type using options.mimeType"}),m.Jpeg}function VU(u){if(p8({instance:"TwitterApiv1ReadWrite",method:"uploadMedia",problem:"you're using options.type",resolution:"Remove options.type argument and migrate to options.mimeType which takes the real MIME type. If you're using type=longmp4, add options.longVideo alongside of mimeType=EUploadMimeType.Mp4"}),u==="gif")return m.Gif;if(u==="jpg")return m.Jpeg;if(u==="png")return m.Png;if(u==="webp")return m.Webp;if(u==="srt")return m.Srt;if(u==="mp4"||u==="longmp4")return m.Mp4;if(u==="mov")return m.Mov;return u}function sY(u,D){if(u===m.Mp4||u===m.Mov)return D==="tweet"?"TweetVideo":"DmVideo";if(u===m.Gif)return D==="tweet"?"TweetGif":"DmGif";if(u===m.Srt)return"Subtitles";else return D==="tweet"?"TweetImage":"DmImage"}function X5(u){return new Promise((D)=>setTimeout(D,u*1000))}async function Y5(u,D,B=0,A){if(u instanceof Buffer){let F=u.slice(B,B+D);return[F,F.length]}if(!A)throw Error("Well, we will need a buffer to store file content.");let w;if(typeof u==="number")w=await new Promise((F,G)=>{G0.read(u,A,0,D,B,(N,$)=>{if(N)G(N);F($)})});else w=(await u.read(A,0,D,B)).bytesRead;return[A,w]}var K5="media/upload.json";class s0 extends a0{constructor(){super(...arguments);this._prefix=A0}get readOnly(){return this}tweet(u,D={}){let B={status:u,tweet_mode:"extended",...D};return this.post("statuses/update.json",B)}async quote(u,D,B={}){let A="https://x.com/i/statuses/"+D;return this.tweet(u,{...B,attachment_url:A})}async tweetThread(u){let D=[];for(let B of u){let A=D.length?D[D.length-1]:null,w={...typeof B==="string"?{status:B}:B},F=A?A.id_str:w.in_reply_to_status_id,G=w.status;if(F)D.push(await this.reply(G,F,w));else D.push(await this.tweet(G,w))}return D}reply(u,D,B={}){return this.tweet(u,{auto_populate_reply_metadata:!0,in_reply_to_status_id:D,...B})}deleteTweet(u){return this.post("statuses/destroy/:id.json",{tweet_mode:"extended"},{params:{id:u}})}reportUserAsSpam(u){return this.post("users/report_spam.json",{tweet_mode:"extended",...u})}updateFriendship(u){return this.post("friendships/update.json",u)}createFriendship(u){return this.post("friendships/create.json",u)}destroyFriendship(u){return this.post("friendships/destroy.json",u)}updateAccountSettings(u){return this.post("account/settings.json",u)}updateAccountProfile(u){return this.post("account/update_profile.json",u)}async updateAccountProfileBanner(u,D={}){let B={banner:await Q5(u),...D};return this.post("account/update_profile_banner.json",B,{forceBodyMode:"form-data"})}async updateAccountProfileImage(u,D={}){let B={tweet_mode:"extended",image:await Q5(u),...D};return this.post("account/update_profile_image.json",B,{forceBodyMode:"form-data"})}removeAccountProfileBanner(){return this.post("account/remove_profile_banner.json")}createList(u){return this.post("lists/create.json",{tweet_mode:"extended",...u})}updateList(u){return this.post("lists/update.json",{tweet_mode:"extended",...u})}removeList(u){return this.post("lists/destroy.json",{tweet_mode:"extended",...u})}addListMembers(u){let B=u.user_id&&qu(u.user_id)||u.screen_name&&qu(u.screen_name)?"lists/members/create_all.json":"lists/members/create.json";return this.post(B,u)}removeListMembers(u){let B=u.user_id&&qu(u.user_id)||u.screen_name&&qu(u.screen_name)?"lists/members/destroy_all.json":"lists/members/destroy.json";return this.post(B,u)}subscribeToList(u){return this.post("lists/subscribers/create.json",{tweet_mode:"extended",...u})}unsubscribeOfList(u){return this.post("lists/subscribers/destroy.json",{tweet_mode:"extended",...u})}createMediaMetadata(u,D){return this.post("media/metadata/create.json",{media_id:u,...D},{prefix:b2,forceBodyMode:"json"})}createMediaSubtitles(u,D){return this.post("media/subtitles/create.json",{media_id:u,media_category:"TweetVideo",subtitle_info:{subtitles:D}},{prefix:b2,forceBodyMode:"json"})}deleteMediaSubtitles(u,...D){return this.post("media/subtitles/delete.json",{media_id:u,media_category:"TweetVideo",subtitle_info:{subtitles:D.map((B)=>({language_code:B}))}},{prefix:b2,forceBodyMode:"json"})}async uploadMedia(u,D={},B=!1){var A;let w=(A=D.chunkLength)!==null&&A!==void 0?A:1048576,{fileHandle:F,mediaCategory:G,fileSize:N,mimeType:$}=await this.getUploadMediaRequirements(u,D);try{let Z=await this.post(K5,{command:"INIT",total_bytes:N,media_type:$,media_category:G,additional_owners:D.additionalOwners,shared:D.shared?!0:void 0},{prefix:b2});await this.mediaChunkedUpload(F,w,Z.media_id_string,D.maxConcurrentUploads);let Q=await this.post(K5,{command:"FINALIZE",media_id:Z.media_id_string},{prefix:b2});if(Q.processing_info&&Q.processing_info.state!=="succeeded")await this.awaitForMediaProcessingCompletion(Q);if(B)return Q;else return Q.media_id_string}finally{if(typeof u==="number")h5.close(u,()=>{});else if(typeof F==="object"&&!(F instanceof Buffer))F.close()}}async awaitForMediaProcessingCompletion(u){var D;while(!0){u=await this.mediaInfo(u.media_id_string);let{processing_info:B}=u;if(!B||B.state==="succeeded")return;if((D=B.error)===null||D===void 0?void 0:D.code){let{name:A,message:w}=B.error;throw Error(`Failed to process media: ${A} - ${w}.`)}if(B.state==="failed")throw Error("Failed to process the media.");if(B.check_after_secs)await X5(B.check_after_secs);else await X5(5)}}async getUploadMediaRequirements(u,{mimeType:D,type:B,target:A,longVideo:w}={}){let F;try{F=await W5(u);let G=aY(u,B,D),N;if(G===m.Mp4&&(!D&&!B&&A!=="dm"||w))N="amplify_video";else N=sY(G,A!==null&&A!==void 0?A:"tweet");return{fileHandle:F,mediaCategory:N,fileSize:await pY(F),mimeType:G}}catch(G){if(typeof u==="number")h5.close(u,()=>{});else if(typeof F==="object"&&!(F instanceof Buffer))F.close();throw G}}async mediaChunkedUpload(u,D,B,A=3){let w=0;if(A<1)throw RangeError("Bad maxConcurrentUploads parameter.");let F=u instanceof Buffer?void 0:Buffer.alloc(D),G,N,$=0;[G,N]=await Y5(u,D,$,F),$+=N;let Z=new Set;while(N){let Q=G.slice(0,N);if(Q.length){let J=this.post(K5,{command:"APPEND",media_id:B,segment_index:w,media:Q},{prefix:b2});Z.add(J),J.then(()=>{Z.delete(J)}),w++}if(Z.size>=A)await Promise.race(Z);[G,N]=await Y5(u,D,$,F),$+=N}await Promise.all([...Z])}}class tY extends s0{constructor(){super(...arguments);this._prefix=A0}get readWrite(){return this}sendDm({recipient_id:u,custom_profile_id:D,...B}){let A={event:{type:w0.Create,[w0.Create]:{target:{recipient_id:u},message_data:B}}};if(D)A.event[w0.Create].custom_profile_id=D;return this.post("direct_messages/events/new.json",A,{forceBodyMode:"json"})}getDmEvent(u){return this.get("direct_messages/events/show.json",{id:u})}deleteDm(u){return this.delete("direct_messages/events/destroy.json",{id:u})}async listDmEvents(u={}){let D={...u},B=await this.get("direct_messages/events/list.json",D,{fullResponse:!0});return new i8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}newWelcomeDm(u,D){let B={[w0.WelcomeCreate]:{name:u,message_data:D}};return this.post("direct_messages/welcome_messages/new.json",B,{forceBodyMode:"json"})}getWelcomeDm(u){return this.get("direct_messages/welcome_messages/show.json",{id:u})}deleteWelcomeDm(u){return this.delete("direct_messages/welcome_messages/destroy.json",{id:u})}updateWelcomeDm(u,D){let B={message_data:D};return this.put("direct_messages/welcome_messages/update.json",B,{forceBodyMode:"json",query:{id:u}})}async listWelcomeDms(u={}){let D={...u},B=await this.get("direct_messages/welcome_messages/list.json",D,{fullResponse:!0});return new r8({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D})}newWelcomeDmRule(u){return this.post("direct_messages/welcome_messages/rules/new.json",{welcome_message_rule:{welcome_message_id:u}},{forceBodyMode:"json"})}getWelcomeDmRule(u){return this.get("direct_messages/welcome_messages/rules/show.json",{id:u})}deleteWelcomeDmRule(u){return this.delete("direct_messages/welcome_messages/rules/destroy.json",{id:u})}async listWelcomeDmRules(u={}){let D={...u};return this.get("direct_messages/welcome_messages/rules/list.json",D)}async setWelcomeDm(u,D=!0){var B;let A=await this.listWelcomeDmRules();if((B=A.welcome_message_rules)===null||B===void 0?void 0:B.length){for(let w of A.welcome_message_rules)if(await this.deleteWelcomeDmRule(w.id),D)await this.deleteWelcomeDm(w.welcome_message_id)}return this.newWelcomeDmRule(u)}markDmAsRead(u,D){return this.post("direct_messages/mark_read.json",{last_read_event_id:u,recipient_id:D},{forceBodyMode:"url"})}indicateDmTyping(u){return this.post("direct_messages/indicate_typing.json",{recipient_id:u},{forceBodyMode:"url"})}async downloadDmImage(u){if(typeof u!=="string"){let B=u[w0.Create].message_data.attachment;if(!B)throw Error("The given direct message doesn't contain any attachment");u=B.media.media_url_https}let D=await this.get(u,void 0,{forceParseMode:"buffer",prefix:""});if(!D.length)throw Error("Image not found. Make sure you are logged with credentials able to access direct messages, and check the URL.");return D}}var O3=tY;class q{constructor(u){this.result=u}get tweets(){return q.tweets(this.result)}static tweets(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.tweets)!==null&&B!==void 0?B:[]}tweetById(u){return q.tweetById(this.result,u)}static tweetById(u,D){return this.tweets(u).find((B)=>B.id===D)}retweet(u){return q.retweet(this.result,u)}static retweet(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="retweeted").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}quote(u){return q.quote(this.result,u)}static quote(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="quoted").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}repliedTo(u){return q.repliedTo(this.result,u)}static repliedTo(u,D){var B;let A=((B=D.referenced_tweets)!==null&&B!==void 0?B:[]).filter((w)=>w.type==="replied_to").map((w)=>w.id);return this.tweets(u).find((w)=>A.includes(w.id))}author(u){return q.author(this.result,u)}static author(u,D){let B=D.author_id;return B?this.users(u).find((A)=>A.id===B):void 0}repliedToAuthor(u){return q.repliedToAuthor(this.result,u)}static repliedToAuthor(u,D){let B=D.in_reply_to_user_id;return B?this.users(u).find((A)=>A.id===B):void 0}get users(){return q.users(this.result)}static users(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.users)!==null&&B!==void 0?B:[]}userById(u){return q.userById(this.result,u)}static userById(u,D){return this.users(u).find((B)=>B.id===D)}pinnedTweet(u){return q.pinnedTweet(this.result,u)}static pinnedTweet(u,D){return D.pinned_tweet_id?this.tweets(u).find((B)=>B.id===D.pinned_tweet_id):void 0}get media(){return q.media(this.result)}static media(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.media)!==null&&B!==void 0?B:[]}medias(u){return q.medias(this.result,u)}static medias(u,D){var B,A;let w=(A=(B=D.attachments)===null||B===void 0?void 0:B.media_keys)!==null&&A!==void 0?A:[];return this.media(u).filter((F)=>w.includes(F.media_key))}get polls(){return q.polls(this.result)}static polls(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.polls)!==null&&B!==void 0?B:[]}poll(u){return q.poll(this.result,u)}static poll(u,D){var B,A;let w=(A=(B=D.attachments)===null||B===void 0?void 0:B.poll_ids)!==null&&A!==void 0?A:[];if(w.length){let F=w[0];return this.polls(u).find((G)=>G.id===F)}return}get places(){return q.places(this.result)}static places(u){var D,B;return(B=(D=u.includes)===null||D===void 0?void 0:D.places)!==null&&B!==void 0?B:[]}place(u){return q.place(this.result,u)}static place(u,D){var B;let A=(B=D.geo)===null||B===void 0?void 0:B.place_id;return A?this.places(u).find((w)=>w.id===A):void 0}listOwner(u){return q.listOwner(this.result,u)}static listOwner(u,D){let B=D.owner_id;return B?this.users(u).find((A)=>A.id===B):void 0}spaceCreator(u){return q.spaceCreator(this.result,u)}static spaceCreator(u,D){let B=D.creator_id;return B?this.users(u).find((A)=>A.id===B):void 0}spaceHosts(u){return q.spaceHosts(this.result,u)}static spaceHosts(u,D){var B;let A=(B=D.host_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}spaceSpeakers(u){return q.spaceSpeakers(this.result,u)}static spaceSpeakers(u,D){var B;let A=(B=D.speaker_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}spaceInvitedUsers(u){return q.spaceInvitedUsers(this.result,u)}static spaceInvitedUsers(u,D){var B;let A=(B=D.invited_user_ids)!==null&&B!==void 0?B:[];return this.users(u).filter((w)=>A.includes(w.id))}}class C3 extends d8{updateIncludes(u){if(u.errors){if(!this._realData.errors)this._realData.errors=[];this._realData.errors=[...this._realData.errors,...u.errors]}if(!u.includes)return;if(!this._realData.includes)this._realData.includes={};let D=this._realData.includes;for(let[B,A]of Object.entries(u.includes)){if(!D[B])D[B]=[];D[B]=[...D[B],...A]}}assertUsable(){if(this.unusable)throw Error("Unable to use this paginator to fetch more data, as it does not contain any metadata. Check .errors property for more details.")}get meta(){return this._realData.meta}get includes(){var u;if(!((u=this._realData)===null||u===void 0?void 0:u.includes))return new q(this._realData);if(this._includesInstance)return this._includesInstance;return this._includesInstance=new q(this._realData)}get errors(){var u;return(u=this._realData.errors)!==null&&u!==void 0?u:[]}get unusable(){return this.errors.length>0&&!this._realData.meta&&!this._realData.data}}class _2 extends C3{refreshInstanceFromResult(u,D){var B;let A=u.data,w=(B=A.data)!==null&&B!==void 0?B:[];if(this._rateLimit=u.rateLimit,!this._realData.data)this._realData.data=[];if(D)this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.next_token=A.meta.next_token,this._realData.data.push(...w);else this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.previous_token=A.meta.previous_token,this._realData.data.unshift(...w);this.updateIncludes(A)}getNextQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),pagination_token:this._realData.meta.next_token}}getPreviousQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),pagination_token:this._realData.meta.previous_token}}getPageLengthFromRequest(u){var D,B;return(B=(D=u.data.data)===null||D===void 0?void 0:D.length)!==null&&B!==void 0?B:0}isFetchLastOver(u){var D;return!((D=u.data.data)===null||D===void 0?void 0:D.length)||!this.canFetchNextPage(u.data)}canFetchNextPage(u){var D;return!!((D=u.meta)===null||D===void 0?void 0:D.next_token)}}class x5 extends C3{refreshInstanceFromResult(u,D){var B;let A=u.data,w=(B=A.data)!==null&&B!==void 0?B:[];if(this._rateLimit=u.rateLimit,!this._realData.data)this._realData.data=[];if(D)this._realData.meta.oldest_id=A.meta.oldest_id,this._realData.meta.result_count+=A.meta.result_count,this._realData.meta.next_token=A.meta.next_token,this._realData.data.push(...w);else this._realData.meta.newest_id=A.meta.newest_id,this._realData.meta.result_count+=A.meta.result_count,this._realData.data.unshift(...w);this.updateIncludes(A)}getNextQueryParams(u){this.assertUsable();let D={...this.injectQueryParams(u)};if(this._realData.meta.next_token)D.next_token=this._realData.meta.next_token;else{if(D.start_time)D.since_id=this.dateStringToSnowflakeId(D.start_time),delete D.start_time;if(D.end_time)delete D.end_time;D.until_id=this._realData.meta.oldest_id}return D}getPreviousQueryParams(u){return this.assertUsable(),{...this.injectQueryParams(u),since_id:this._realData.meta.newest_id}}getPageLengthFromRequest(u){var D,B;return(B=(D=u.data.data)===null||D===void 0?void 0:D.length)!==null&&B!==void 0?B:0}isFetchLastOver(u){var D;return!((D=u.data.data)===null||D===void 0?void 0:D.length)||!this.canFetchNextPage(u.data)}canFetchNextPage(u){return!!u.meta.next_token}getItemArray(){return this.tweets}dateStringToSnowflakeId(u){let D=BigInt("1288834974657"),B=new Date(u);if(isNaN(B.valueOf()))throw Error("Unable to convert start_time/end_time to a valid date. A ISO 8601 DateTime is excepted, please check your input.");return(BigInt(B.valueOf())-D<<BigInt("22")).toString()}get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class t0 extends _2{refreshInstanceFromResult(u,D){super.refreshInstanceFromResult(u,D);let B=u.data;if(D)this._realData.meta.oldest_id=B.meta.oldest_id;else this._realData.meta.newest_id=B.meta.newest_id}getItemArray(){return this.tweets}get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class H5 extends x5{constructor(){super(...arguments);this._endpoint="tweets/search/recent"}}class S5 extends x5{constructor(){super(...arguments);this._endpoint="tweets/search/all"}}class R5 extends t0{constructor(){super(...arguments);this._endpoint="tweets/:id/quote_tweets"}}class U5 extends t0{constructor(){super(...arguments);this._endpoint="users/:id/timelines/reverse_chronological"}}class M5 extends t0{constructor(){super(...arguments);this._endpoint="users/:id/tweets"}}class L5 extends t0{constructor(){super(...arguments);this._endpoint="users/:id/mentions"}}class c5 extends t0{constructor(){super(...arguments);this._endpoint="users/:id/bookmarks"}}class E5 extends _2{get tweets(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}getItemArray(){return this.tweets}}class O5 extends E5{constructor(){super(...arguments);this._endpoint="users/:id/liked_tweets"}}class C5 extends E5{constructor(){super(...arguments);this._endpoint="lists/:id/tweets"}}class j2 extends _2{getItemArray(){return this.users}get users(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class P5 extends j2{constructor(){super(...arguments);this._endpoint="users/:id/blocking"}}class k5 extends j2{constructor(){super(...arguments);this._endpoint="users/:id/muting"}}class V5 extends j2{constructor(){super(...arguments);this._endpoint="users/:id/followers"}}class y5 extends j2{constructor(){super(...arguments);this._endpoint="users/:id/following"}}class T5 extends j2{constructor(){super(...arguments);this._endpoint="lists/:id/members"}}class I5 extends j2{constructor(){super(...arguments);this._endpoint="lists/:id/followers"}}class q5 extends j2{constructor(){super(...arguments);this._endpoint="tweets/:id/liking_users"}}class m5 extends j2{constructor(){super(...arguments);this._endpoint="tweets/:id/retweeted_by"}}class P3 extends _2{getItemArray(){return this.lists}get lists(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class _5 extends P3{constructor(){super(...arguments);this._endpoint="users/:id/owned_lists"}}class g5 extends P3{constructor(){super(...arguments);this._endpoint="users/:id/list_memberships"}}class f5 extends P3{constructor(){super(...arguments);this._endpoint="users/:id/followed_lists"}}class o0 extends V2{constructor(){super(...arguments);this._prefix=l0}}class k3 extends _2{getItemArray(){return this.events}get events(){var u;return(u=this._realData.data)!==null&&u!==void 0?u:[]}get meta(){return super.meta}}class b5 extends k3{constructor(){super(...arguments);this._endpoint="dm_events"}}class j5 extends k3{constructor(){super(...arguments);this._endpoint="dm_conversations/with/:participant_id/dm_events"}}class l5 extends k3{constructor(){super(...arguments);this._endpoint="dm_conversations/:dm_conversation_id/dm_events"}}class e0 extends V2{constructor(){super(...arguments);this._prefix=B0}get labs(){if(this._labs)return this._labs;return this._labs=new o0(this)}async search(u,D={}){let B=typeof u==="string"?{...D,query:u}:{...u},A=await this.get("tweets/search/recent",B,{fullResponse:!0});return new H5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}async searchAll(u,D={}){let B={...D,query:u},A=await this.get("tweets/search/all",B,{fullResponse:!0});return new S5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:B})}singleTweet(u,D={}){return this.get("tweets/:id",D,{params:{id:u}})}tweets(u,D={}){return this.get("tweets",{ids:u,...D})}tweetCountRecent(u,D={}){return this.get("tweets/counts/recent",{query:u,...D})}tweetCountAll(u,D={}){return this.get("tweets/counts/all",{query:u,...D})}async tweetRetweetedBy(u,D={}){let{asPaginator:B,...A}=D,w=await this.get("tweets/:id/retweeted_by",A,{fullResponse:!0,params:{id:u}});if(!B)return w.data;return new m5({realData:w.data,rateLimit:w.rateLimit,instance:this,queryParams:A,sharedParams:{id:u}})}async tweetLikedBy(u,D={}){let{asPaginator:B,...A}=D,w=await this.get("tweets/:id/liking_users",A,{fullResponse:!0,params:{id:u}});if(!B)return w.data;return new q5({realData:w.data,rateLimit:w.rateLimit,instance:this,queryParams:A,sharedParams:{id:u}})}async homeTimeline(u={}){let D=await this.getCurrentUserV2Object(),B=await this.get("users/:id/timelines/reverse_chronological",u,{fullResponse:!0,params:{id:D.data.id}});return new U5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:u,sharedParams:{id:D.data.id}})}async userTimeline(u,D={}){let B=await this.get("users/:id/tweets",D,{fullResponse:!0,params:{id:u}});return new M5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async userMentionTimeline(u,D={}){let B=await this.get("users/:id/mentions",D,{fullResponse:!0,params:{id:u}});return new L5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async quotes(u,D={}){let B=await this.get("tweets/:id/quote_tweets",D,{fullResponse:!0,params:{id:u}});return new R5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:D,sharedParams:{id:u}})}async bookmarks(u={}){let D=await this.getCurrentUserV2Object(),B=await this.get("users/:id/bookmarks",u,{fullResponse:!0,params:{id:D.data.id}});return new c5({realData:B.data,rateLimit:B.rateLimit,instance:this,queryParams:u,sharedParams:{id:D.data.id}})}me(u={}){return this.get("users/me",u)}user(u,D={}){return this.get("users/:id",D,{params:{id:u}})}users(u,D={}){let B=Array.isArray(u)?u.join(","):u;return this.get("users",{...D,ids:B})}userByUsername(u,D={}){return this.get("users/by/username/:username",D,{params:{username:u}})}usersByUsernames(u,D={}){return u=Array.isArray(u)?u.join(","):u,this.get("users/by",{...D,usernames:u})}async followers(u,D={}){let{asPaginator:B,...A}=D,w={id:u};if(!B)return this.get("users/:id/followers",A,{params:w});let F=await this.get("users/:id/followers",A,{fullResponse:!0,params:w});return new V5({realData:F.data,rateLimit:F.rateLimit,instance:this,queryParams:A,sharedParams:w})}async following(u,D={}){let{asPaginator:B,...A}=D,w={id:u};if(!B)return this.get("users/:id/following",A,{params:w});let F=await this.get("users/:id/following",A,{fullResponse:!0,params:w});return new y5({realData:F.data,rateLimit:F.rateLimit,instance:this,queryParams:A,sharedParams:w})}async userLikedTweets(u,D={}){let B={id:u},A=await this.get("users/:id/liked_tweets",D,{fullResponse:!0,params:B});return new O5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async userBlockingUsers(u,D={}){let B={id:u},A=await this.get("users/:id/blocking",D,{fullResponse:!0,params:B});return new P5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async userMutingUsers(u,D={}){let B={id:u},A=await this.get("users/:id/muting",D,{fullResponse:!0,params:B});return new k5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}list(u,D={}){return this.get("lists/:id",D,{params:{id:u}})}async listsOwned(u,D={}){let B={id:u},A=await this.get("users/:id/owned_lists",D,{fullResponse:!0,params:B});return new _5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listMemberships(u,D={}){let B={id:u},A=await this.get("users/:id/list_memberships",D,{fullResponse:!0,params:B});return new g5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listFollowed(u,D={}){let B={id:u},A=await this.get("users/:id/followed_lists",D,{fullResponse:!0,params:B});return new f5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listTweets(u,D={}){let B={id:u},A=await this.get("lists/:id/tweets",D,{fullResponse:!0,params:B});return new C5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listMembers(u,D={}){let B={id:u},A=await this.get("lists/:id/members",D,{fullResponse:!0,params:B});return new T5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listFollowers(u,D={}){let B={id:u},A=await this.get("lists/:id/followers",D,{fullResponse:!0,params:B});return new I5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listDmEvents(u={}){let D=await this.get("dm_events",u,{fullResponse:!0});return new b5({realData:D.data,rateLimit:D.rateLimit,instance:this,queryParams:{...u}})}async listDmEventsWithParticipant(u,D={}){let B={participant_id:u},A=await this.get("dm_conversations/with/:participant_id/dm_events",D,{fullResponse:!0,params:B});return new j5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}async listDmEventsOfConversation(u,D={}){let B={dm_conversation_id:u},A=await this.get("dm_conversations/:dm_conversation_id/dm_events",D,{fullResponse:!0,params:B});return new l5({realData:A.data,rateLimit:A.rateLimit,instance:this,queryParams:{...D},sharedParams:B})}space(u,D={}){return this.get("spaces/:id",D,{params:{id:u}})}spaces(u,D={}){return this.get("spaces",{ids:u,...D})}spacesByCreators(u,D={}){return this.get("spaces/by/creator_ids",{user_ids:u,...D})}searchSpaces(u){return this.get("spaces/search",u)}spaceBuyers(u,D={}){return this.get("spaces/:id/buyers",D,{params:{id:u}})}spaceTweets(u,D={}){return this.get("spaces/:id/tweets",D,{params:{id:u}})}searchStream({autoConnect:u,...D}={}){return this.getStream("tweets/search/stream",D,{payloadIsError:S3,autoConnect:u})}streamRules(u={}){return this.get("tweets/search/stream/rules",u)}updateStreamRules(u,D={}){return this.post("tweets/search/stream/rules",u,{query:D})}sampleStream({autoConnect:u,...D}={}){return this.getStream("tweets/sample/stream",D,{payloadIsError:S3,autoConnect:u})}sample10Stream({autoConnect:u,...D}={}){return this.getStream("tweets/sample10/stream",D,{payloadIsError:S3,autoConnect:u})}complianceJobs(u){return this.get("compliance/jobs",u)}complianceJob(u){return this.get("compliance/jobs/:id",void 0,{params:{id:u}})}async sendComplianceJob(u){let D=await this.post("compliance/jobs",{type:u.type,name:u.name}),B=u.ids instanceof Buffer?u.ids:Buffer.from(u.ids.join(`
|
|
45
45
|
`));return await this.put(D.data.upload_url,B,{forceBodyMode:"raw",enableAuth:!1,headers:{"Content-Type":"text/plain"},prefix:""}),D}async complianceJobResult(u){let D=u;while(D.status!=="complete"){if(D.status==="expired"||D.status==="failed")throw Error("Job failed to be completed.");await new Promise((A)=>setTimeout(A,3500)),D=(await this.complianceJob(u.id)).data}return(await this.get(u.download_url,void 0,{enableAuth:!1,prefix:""})).trim().split(`
|
|
46
|
-
`).filter((A)=>A).map((A)=>JSON.parse(A))}async usage(u={}){return this.get("usage/tweets",u)}community(u,D={}){return this.get("communities/:id",D,{params:{id:u}})}searchCommunities(u,D={}){return this.get("communities/search",{query:u,...D})}}class s0 extends p0{constructor(){super(...arguments);this._prefix=_0}get readOnly(){return this}}class t0 extends a0{constructor(){super(...arguments);this._prefix=o2}get readOnly(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new s0(this)}hideReply(u,D){return this.put("tweets/:id/hidden",{hidden:D},{params:{id:u}})}like(u,D){return this.post("users/:id/likes",{tweet_id:D},{params:{id:u}})}unlike(u,D){return this.delete("users/:id/likes/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}retweet(u,D){return this.post("users/:id/retweets",{tweet_id:D},{params:{id:u}})}unretweet(u,D){return this.delete("users/:id/retweets/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}tweet(u,D={}){if(typeof u==="object")D=u;else D={text:u,...D};return this.post("tweets",D)}async uploadMedia(u,D,B=1048576){let A=D.media_category;if(!D.media_category){if(D.media_type.includes("gif"))A="tweet_gif";else if(D.media_type.includes("image"))A="tweet_image";else if(D.media_type.includes("video"))A="tweet_video"}let w={additional_owners:D.additional_owners,media_type:D.media_type,total_bytes:u.length,media_category:A},N=(await this.post("media/upload/initialize",w)).data.id,G=Math.ceil(u.length/B),v=new Uint8Array(u);for(let Q=0;Q<G;Q++){let Z=Q*B,J=Math.min(Z+B,u.length),W=v.slice(Z,J),Y=Buffer.from(W),M={segment_index:Q,media:Y};await this.post(`media/upload/${N}/append`,M,{forceBodyMode:"form-data"})}if((await this.post(`media/upload/${N}/finalize`)).data.processing_info)await this.waitForMediaProcessing(N);return N}async waitForMediaProcessing(u){var D;let A=(await this.get("media/upload",{command:"STATUS",media_id:u})).data.processing_info;if(!A)return;switch(A.state){case"succeeded":return;case"failed":throw Error(`Media processing failed: ${(D=A.error)===null||D===void 0?void 0:D.message}`);case"pending":case"in_progress":{let w=A===null||A===void 0?void 0:A.check_after_secs;if(w&&w>0)await new Promise((F)=>setTimeout(F,w*1000)),await this.waitForMediaProcessing(u)}}}createMediaMetadata(u,D){return this.post("media/metadata",{id:u,metadata:D})}reply(u,D,B={}){var A;let w={in_reply_to_tweet_id:D,...(A=B.reply)!==null&&A!==void 0?A:{}};return this.post("tweets",{text:u,...B,reply:w})}quote(u,D,B={}){return this.tweet(u,{...B,quote_tweet_id:D})}async tweetThread(u){var D,B;let A=[];for(let w of u){let F=A.length?A[A.length-1]:null,N={...typeof w==="string"?{text:w}:w},G=F?F.data.id:(D=N.reply)===null||D===void 0?void 0:D.in_reply_to_tweet_id,v=(B=N.text)!==null&&B!==void 0?B:"";if(G)A.push(await this.reply(v,G,N));else A.push(await this.tweet(v,N))}return A}deleteTweet(u){return this.delete("tweets/:id",void 0,{params:{id:u}})}async bookmark(u){let D=await this.getCurrentUserV2Object();return this.post("users/:id/bookmarks",{tweet_id:u},{params:{id:D.data.id}})}async deleteBookmark(u){let D=await this.getCurrentUserV2Object();return this.delete("users/:id/bookmarks/:tweet_id",void 0,{params:{id:D.data.id,tweet_id:u}})}follow(u,D){return this.post("users/:id/following",{target_user_id:D},{params:{id:u}})}unfollow(u,D){return this.delete("users/:source_user_id/following/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}block(u,D){return this.post("users/:id/blocking",{target_user_id:D},{params:{id:u}})}unblock(u,D){return this.delete("users/:source_user_id/blocking/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}mute(u,D){return this.post("users/:id/muting",{target_user_id:D},{params:{id:u}})}unmute(u,D){return this.delete("users/:source_user_id/muting/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}createList(u){return this.post("lists",u)}updateList(u,D={}){return this.put("lists/:id",D,{params:{id:u}})}removeList(u){return this.delete("lists/:id",void 0,{params:{id:u}})}addListMember(u,D){return this.post("lists/:id/members",{user_id:D},{params:{id:u}})}removeListMember(u,D){return this.delete("lists/:id/members/:user_id",void 0,{params:{id:u,user_id:D}})}subscribeToList(u,D){return this.post("users/:id/followed_lists",{list_id:D},{params:{id:u}})}unsubscribeOfList(u,D){return this.delete("users/:id/followed_lists/:list_id",void 0,{params:{id:u,list_id:D}})}pinList(u,D){return this.post("users/:id/pinned_lists",{list_id:D},{params:{id:u}})}unpinList(u,D){return this.delete("users/:id/pinned_lists/:list_id",void 0,{params:{id:u,list_id:D}})}sendDmInConversation(u,D){return this.post("dm_conversations/:dm_conversation_id/messages",D,{params:{dm_conversation_id:u}})}sendDmToParticipant(u,D){return this.post("dm_conversations/with/:participant_id/messages",D,{params:{participant_id:u}})}createDmConversation(u){return this.post("dm_conversations",u)}}class fY extends s0{constructor(){super(...arguments);this._prefix=_0}get readWrite(){return this}}var bY=fY;class jY extends t0{constructor(){super(...arguments);this._prefix=o2}get readWrite(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new bY(this)}}var lY=jY;class Tu extends D0{get v1(){if(this._v1)return this._v1;return this._v1=new r0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new a0(this)}async currentUser(u=!1){return await this.getCurrentUserObject(u)}async currentUserV2(u=!1){return await this.getCurrentUserV2Object(u)}search(u,D){return this.v2.search(u,D)}async generateAuthLink(u="oob",{authAccessType:D,linkMode:B="authenticate",forceLogin:A,screenName:w}={}){let F=await this.post("https://api.x.com/oauth/request_token",{oauth_callback:u,x_auth_access_type:D}),N=`https://api.x.com/oauth/${B}?oauth_token=${encodeURIComponent(F.oauth_token)}`;if(A!==void 0)N+=`&force_login=${encodeURIComponent(A)}`;if(w!==void 0)N+=`&screen_name=${encodeURIComponent(w)}`;if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth1RequestToken",{client:this._requestMaker,url:N,oauthResult:F});return{url:N,...F}}async login(u){let D=this.getActiveTokens();if(D.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login");let B=await this.post("https://api.x.com/oauth/access_token",{oauth_token:D.accessToken,oauth_verifier:u}),A=new this.constructor({appKey:D.appKey,appSecret:D.appSecret,accessToken:B.oauth_token,accessSecret:B.oauth_token_secret},this._requestMaker.clientSettings);return{accessToken:B.oauth_token,accessSecret:B.oauth_token_secret,userId:B.user_id,screenName:B.screen_name,client:A}}async appLogin(){let u=this.getActiveTokens();if(u.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept app-only login");let B=await new this.constructor({username:u.appKey,password:u.appSecret},this._requestMaker.clientSettings).post("https://api.x.com/oauth2/token",{grant_type:"client_credentials"});return new this.constructor(B.access_token,this._requestMaker.clientSettings)}generateOAuth2AuthLink(u,D={}){var B,A;if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let w=(B=D.state)!==null&&B!==void 0?B:J0.generateRandomString(32),F=J0.getCodeVerifier(),N=J0.getCodeChallengeFromVerifier(F),G=(A=D.scope)!==null&&A!==void 0?A:"",v=Array.isArray(G)?G.join(" "):G,z=new URL("https://x.com/i/oauth2/authorize"),Q={response_type:"code",client_id:this._requestMaker.clientId,redirect_uri:u,state:w,code_challenge:N,code_challenge_method:"s256",scope:v};C2.addQueryParamsToUrl(z,Q);let Z={url:z.toString(),state:w,codeVerifier:F,codeChallenge:N};if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth2RequestToken",{client:this._requestMaker,result:Z,redirectUri:u});return Z}async loginWithOAuth2({code:u,codeVerifier:D,redirectUri:B}){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let A=await this.post("https://api.x.com/2/oauth2/token",{code:u,code_verifier:D,redirect_uri:B,grant_type:"authorization_code",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(A)}async refreshOAuth2Token(u){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let D=await this.post("https://api.x.com/2/oauth2/token",{refresh_token:u,grant_type:"refresh_token",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(D)}async revokeOAuth2Token(u,D="access_token"){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");return await this.post("https://api.x.com/2/oauth2/revoke",{client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret,token:u,token_type_hint:D})}parseOAuth2AccessTokenResult(u){let D=new this.constructor(u.access_token,this._requestMaker.clientSettings),B=u.scope.split(" ").filter((A)=>A);return{client:D,expiresIn:u.expires_in,accessToken:u.access_token,scope:B,refreshToken:u.refresh_token}}}class Iu extends Tu{get v1(){if(this._v1)return this._v1;return this._v1=new i0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new t0(this)}get readOnly(){return this}}class LD extends P2{constructor(){super(...arguments);this._prefix=f0}}class ED extends LD{constructor(){super(...arguments);this._prefix=f0}get readOnly(){return this}}class OD extends P2{constructor(){super(...arguments);this._prefix=b0}}class CD extends OD{constructor(){super(...arguments);this._prefix=b0}get readOnly(){return this}}class dY extends CD{constructor(){super(...arguments);this._prefix=b0}get readWrite(){return this}}var rY=dY;class iY extends ED{constructor(){super(...arguments);this._prefix=f0}get readWrite(){return this}get sandbox(){if(this._sandbox)return this._sandbox;return this._sandbox=new rY(this)}}var nY=iY;class I5 extends Iu{get v1(){if(this._v1)return this._v1;return this._v1=new HD(this)}get v2(){if(this._v2)return this._v2;return this._v2=new lY(this)}get readWrite(){return this}get ads(){if(this._ads)return this._ads;return this._ads=new nY(this)}static getErrors(u){var D;if(typeof u!=="object")return[];if(!("data"in u))return[];return(D=u.data.errors)!==null&&D!==void 0?D:[]}static getProfileImageInSize(u,D){let B=u.split("/").pop(),A=["normal","bigger","mini"],w=u;for(let N of A)if(B.includes(`_${N}`)){w=u.replace(`_${N}`,"");break}if(D==="original")return w;let F=w.lastIndexOf(".");if(F!==-1){let N=w.slice(F+1);return w.slice(0,F)+"_"+D+"."+N}else return w+"_"+D}}var YU={clientId:process.env.X_CLIENT_ID,clientSecret:process.env.X_SECRET,redirectPath:"/auth/oauth/x/callback",scope:["tweet.read","users.read","offline.access"]};class aY extends g0{config;client;oauthStates=new Map;constructor(u={}){super();this.config={...YU,...u},this.client=new I5({clientId:this.config.clientId,clientSecret:this.config.clientSecret})}getRedirectUrl(){let{url:u,codeVerifier:D,state:B}=this.client.generateOAuth2AuthLink(`${process.env.HOST_NAME}${this.config.redirectPath}`,{scope:this.config.scope});return this.oauthStates.set(B,{state:B,codeVerifier:D}),pY.to(u),u}async onCallback(u){let D=u.search.get("code"),B=u.search.get("state"),A=this.oauthStates.get(B);if(!A)throw Error("Invalid or expired OAuth state");let w=await this.client.loginWithOAuth2({code:D,codeVerifier:A.codeVerifier,redirectUri:`${process.env.HOST_NAME}${this.config.redirectPath}`});this.oauthStates.delete(B);let{data:F}=await w.client.v2.me({"user.fields":["name","username","entities"]}),{name:N,email:G,id:v="",username:z}=F??{};return{name:N,email:G,username:z,providerId:v}}}class sY extends f{kernel;jobs=[];constructor(u){super();this.kernel=u}boot(){}}class tY{name;cron;callback(){}onTick(){}onComplete(){}static exp(u){return u}}class oY extends f{url=process.env.REDIS_URL;options;boot(){}}class q5 extends eY{service;static _name="SingletonServiceContainer";constructor(u){super();this.service=u}}class uh{static use(){let u=q5.use().service;if(u.services.has(this.name))return u.services.get(this.name);let D=new this;return u.services.set(this.name,D),D}}export{Q0 as ma,mu as na,m5 as oa,WY as pa,S6 as qa,_1 as ra,f1 as sa,R6 as ta,vD as ua,zD as va,ZY as wa,JY as xa,QY as ya,XY as za,YY as Aa,KY as Ba,ZD as Ca,JD as Da,xY as Ea,g0 as Fa,SY as Ga,aY as Ha,sY as Ia,tY as Ja,oY as Ka,q5 as La,uh as Ma};
|
|
46
|
+
`).filter((A)=>A).map((A)=>JSON.parse(A))}async usage(u={}){return this.get("usage/tweets",u)}community(u,D={}){return this.get("communities/:id",D,{params:{id:u}})}searchCommunities(u,D={}){return this.get("communities/search",{query:u,...D})}}class uu extends o0{constructor(){super(...arguments);this._prefix=l0}get readOnly(){return this}}class Du extends e0{constructor(){super(...arguments);this._prefix=B0}get readOnly(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new uu(this)}hideReply(u,D){return this.put("tweets/:id/hidden",{hidden:D},{params:{id:u}})}like(u,D){return this.post("users/:id/likes",{tweet_id:D},{params:{id:u}})}unlike(u,D){return this.delete("users/:id/likes/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}retweet(u,D){return this.post("users/:id/retweets",{tweet_id:D},{params:{id:u}})}unretweet(u,D){return this.delete("users/:id/retweets/:tweet_id",void 0,{params:{id:u,tweet_id:D}})}tweet(u,D={}){if(typeof u==="object")D=u;else D={text:u,...D};return this.post("tweets",D)}async uploadMedia(u,D,B=1048576){let A=D.media_category;if(!D.media_category){if(D.media_type.includes("gif"))A="tweet_gif";else if(D.media_type.includes("image"))A="tweet_image";else if(D.media_type.includes("video"))A="tweet_video"}let w={additional_owners:D.additional_owners,media_type:D.media_type,total_bytes:u.length,media_category:A},G=(await this.post("media/upload/initialize",w)).data.id,N=Math.ceil(u.length/B),$=new Uint8Array(u);for(let Q=0;Q<N;Q++){let J=Q*B,v=Math.min(J+B,u.length),W=$.slice(J,v),Y=Buffer.from(W),L={segment_index:Q,media:Y};await this.post(`media/upload/${G}/append`,L,{forceBodyMode:"form-data"})}if((await this.post(`media/upload/${G}/finalize`)).data.processing_info)await this.waitForMediaProcessing(G);return G}async waitForMediaProcessing(u){var D;let A=(await this.get("media/upload",{command:"STATUS",media_id:u})).data.processing_info;if(!A)return;switch(A.state){case"succeeded":return;case"failed":throw Error(`Media processing failed: ${(D=A.error)===null||D===void 0?void 0:D.message}`);case"pending":case"in_progress":{let w=A===null||A===void 0?void 0:A.check_after_secs;if(w&&w>0)await new Promise((F)=>setTimeout(F,w*1000)),await this.waitForMediaProcessing(u)}}}createMediaMetadata(u,D){return this.post("media/metadata",{id:u,metadata:D})}reply(u,D,B={}){var A;let w={in_reply_to_tweet_id:D,...(A=B.reply)!==null&&A!==void 0?A:{}};return this.post("tweets",{text:u,...B,reply:w})}quote(u,D,B={}){return this.tweet(u,{...B,quote_tweet_id:D})}async tweetThread(u){var D,B;let A=[];for(let w of u){let F=A.length?A[A.length-1]:null,G={...typeof w==="string"?{text:w}:w},N=F?F.data.id:(D=G.reply)===null||D===void 0?void 0:D.in_reply_to_tweet_id,$=(B=G.text)!==null&&B!==void 0?B:"";if(N)A.push(await this.reply($,N,G));else A.push(await this.tweet($,G))}return A}deleteTweet(u){return this.delete("tweets/:id",void 0,{params:{id:u}})}async bookmark(u){let D=await this.getCurrentUserV2Object();return this.post("users/:id/bookmarks",{tweet_id:u},{params:{id:D.data.id}})}async deleteBookmark(u){let D=await this.getCurrentUserV2Object();return this.delete("users/:id/bookmarks/:tweet_id",void 0,{params:{id:D.data.id,tweet_id:u}})}follow(u,D){return this.post("users/:id/following",{target_user_id:D},{params:{id:u}})}unfollow(u,D){return this.delete("users/:source_user_id/following/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}block(u,D){return this.post("users/:id/blocking",{target_user_id:D},{params:{id:u}})}unblock(u,D){return this.delete("users/:source_user_id/blocking/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}mute(u,D){return this.post("users/:id/muting",{target_user_id:D},{params:{id:u}})}unmute(u,D){return this.delete("users/:source_user_id/muting/:target_user_id",void 0,{params:{source_user_id:u,target_user_id:D}})}createList(u){return this.post("lists",u)}updateList(u,D={}){return this.put("lists/:id",D,{params:{id:u}})}removeList(u){return this.delete("lists/:id",void 0,{params:{id:u}})}addListMember(u,D){return this.post("lists/:id/members",{user_id:D},{params:{id:u}})}removeListMember(u,D){return this.delete("lists/:id/members/:user_id",void 0,{params:{id:u,user_id:D}})}subscribeToList(u,D){return this.post("users/:id/followed_lists",{list_id:D},{params:{id:u}})}unsubscribeOfList(u,D){return this.delete("users/:id/followed_lists/:list_id",void 0,{params:{id:u,list_id:D}})}pinList(u,D){return this.post("users/:id/pinned_lists",{list_id:D},{params:{id:u}})}unpinList(u,D){return this.delete("users/:id/pinned_lists/:list_id",void 0,{params:{id:u,list_id:D}})}sendDmInConversation(u,D){return this.post("dm_conversations/:dm_conversation_id/messages",D,{params:{dm_conversation_id:u}})}sendDmToParticipant(u,D){return this.post("dm_conversations/with/:participant_id/messages",D,{params:{participant_id:u}})}createDmConversation(u){return this.post("dm_conversations",u)}}class oY extends uu{constructor(){super(...arguments);this._prefix=l0}get readWrite(){return this}}var eY=oY;class uK extends Du{constructor(){super(...arguments);this._prefix=B0}get readWrite(){return this}get labs(){if(this._labs)return this._labs;return this._labs=new eY(this)}}var DK=uK;class gu extends F0{get v1(){if(this._v1)return this._v1;return this._v1=new a0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new e0(this)}async currentUser(u=!1){return await this.getCurrentUserObject(u)}async currentUserV2(u=!1){return await this.getCurrentUserV2Object(u)}search(u,D){return this.v2.search(u,D)}async generateAuthLink(u="oob",{authAccessType:D,linkMode:B="authenticate",forceLogin:A,screenName:w}={}){let F=await this.post("https://api.x.com/oauth/request_token",{oauth_callback:u,x_auth_access_type:D}),G=`https://api.x.com/oauth/${B}?oauth_token=${encodeURIComponent(F.oauth_token)}`;if(A!==void 0)G+=`&force_login=${encodeURIComponent(A)}`;if(w!==void 0)G+=`&screen_name=${encodeURIComponent(w)}`;if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth1RequestToken",{client:this._requestMaker,url:G,oauthResult:F});return{url:G,...F}}async login(u){let D=this.getActiveTokens();if(D.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept OAuth 1.0 login");let B=await this.post("https://api.x.com/oauth/access_token",{oauth_token:D.accessToken,oauth_verifier:u}),A=new this.constructor({appKey:D.appKey,appSecret:D.appSecret,accessToken:B.oauth_token,accessSecret:B.oauth_token_secret},this._requestMaker.clientSettings);return{accessToken:B.oauth_token,accessSecret:B.oauth_token_secret,userId:B.user_id,screenName:B.screen_name,client:A}}async appLogin(){let u=this.getActiveTokens();if(u.type!=="oauth-1.0a")throw Error("You must setup TwitterApi instance with consumer keys to accept app-only login");let B=await new this.constructor({username:u.appKey,password:u.appSecret},this._requestMaker.clientSettings).post("https://api.x.com/oauth2/token",{grant_type:"client_credentials"});return new this.constructor(B.access_token,this._requestMaker.clientSettings)}generateOAuth2AuthLink(u,D={}){var B,A;if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. You can find your client ID in Twitter Developer Portal. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let w=(B=D.state)!==null&&B!==void 0?B:K0.generateRandomString(32),F=K0.getCodeVerifier(),G=K0.getCodeChallengeFromVerifier(F),N=(A=D.scope)!==null&&A!==void 0?A:"",$=Array.isArray(N)?N.join(" "):N,Z=new URL("https://x.com/i/oauth2/authorize"),Q={response_type:"code",client_id:this._requestMaker.clientId,redirect_uri:u,state:w,code_challenge:G,code_challenge_method:"s256",scope:$};k2.addQueryParamsToUrl(Z,Q);let J={url:Z.toString(),state:w,codeVerifier:F,codeChallenge:G};if(this._requestMaker.hasPlugins())this._requestMaker.applyPluginMethod("onOAuth2RequestToken",{client:this._requestMaker,result:J,redirectUri:u});return J}async loginWithOAuth2({code:u,codeVerifier:D,redirectUri:B}){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let A=await this.post("https://api.x.com/2/oauth2/token",{code:u,code_verifier:D,redirect_uri:B,grant_type:"authorization_code",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(A)}async refreshOAuth2Token(u){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");let D=await this.post("https://api.x.com/2/oauth2/token",{refresh_token:u,grant_type:"refresh_token",client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret});return this.parseOAuth2AccessTokenResult(D)}async revokeOAuth2Token(u,D="access_token"){if(!this._requestMaker.clientId)throw Error("Twitter API instance is not initialized with client ID. Please build an instance with: new TwitterApi({ clientId: '<yourClientId>' })");return await this.post("https://api.x.com/2/oauth2/revoke",{client_id:this._requestMaker.clientId,client_secret:this._requestMaker.clientSecret,token:u,token_type_hint:D})}parseOAuth2AccessTokenResult(u){let D=new this.constructor(u.access_token,this._requestMaker.clientSettings),B=u.scope.split(" ").filter((A)=>A);return{client:D,expiresIn:u.expires_in,accessToken:u.access_token,scope:B,refreshToken:u.refresh_token}}}class fu extends gu{get v1(){if(this._v1)return this._v1;return this._v1=new s0(this)}get v2(){if(this._v2)return this._v2;return this._v2=new Du(this)}get readOnly(){return this}}class V3 extends V2{constructor(){super(...arguments);this._prefix=d0}}class y3 extends V3{constructor(){super(...arguments);this._prefix=d0}get readOnly(){return this}}class T3 extends V2{constructor(){super(...arguments);this._prefix=i0}}class I3 extends T3{constructor(){super(...arguments);this._prefix=i0}get readOnly(){return this}}class BK extends I3{constructor(){super(...arguments);this._prefix=i0}get readWrite(){return this}}var AK=BK;class wK extends y3{constructor(){super(...arguments);this._prefix=d0}get readWrite(){return this}get sandbox(){if(this._sandbox)return this._sandbox;return this._sandbox=new AK(this)}}var FK=wK;class d5 extends fu{get v1(){if(this._v1)return this._v1;return this._v1=new O3(this)}get v2(){if(this._v2)return this._v2;return this._v2=new DK(this)}get readWrite(){return this}get ads(){if(this._ads)return this._ads;return this._ads=new FK(this)}static getErrors(u){var D;if(typeof u!=="object")return[];if(!("data"in u))return[];return(D=u.data.errors)!==null&&D!==void 0?D:[]}static getProfileImageInSize(u,D){let B=u.split("/").pop(),A=["normal","bigger","mini"],w=u;for(let G of A)if(B.includes(`_${G}`)){w=u.replace(`_${G}`,"");break}if(D==="original")return w;let F=w.lastIndexOf(".");if(F!==-1){let G=w.slice(F+1);return w.slice(0,F)+"_"+D+"."+G}else return w+"_"+D}}var yU={clientId:process.env.X_CLIENT_ID,clientSecret:process.env.X_SECRET,redirectPath:"/auth/oauth/x/callback",scope:["tweet.read","users.read","offline.access"]};class NK extends j0{config;client;oauthStates=new Map;constructor(u={}){super();this.config={...yU,...u},this.client=new d5({clientId:this.config.clientId,clientSecret:this.config.clientSecret})}getRedirectUrl(){let{url:u,codeVerifier:D,state:B}=this.client.generateOAuth2AuthLink(`${process.env.HOST_NAME}${this.config.redirectPath}`,{scope:this.config.scope});return this.oauthStates.set(B,{state:B,codeVerifier:D}),GK.to(u),u}async onCallback(u){let D=u.search.get("code"),B=u.search.get("state"),A=this.oauthStates.get(B);if(!A)throw Error("Invalid or expired OAuth state");let w=await this.client.loginWithOAuth2({code:D,codeVerifier:A.codeVerifier,redirectUri:`${process.env.HOST_NAME}${this.config.redirectPath}`});this.oauthStates.delete(B);let{data:F}=await w.client.v2.me({"user.fields":["name","username","entities"]}),{name:G,email:N,id:$="",username:Z}=F??{};return{name:G,email:N,username:Z,providerId:$}}}class $K extends f{kernel;jobs=[];constructor(u){super();this.kernel=u}boot(){}}class zK{name;cron;callback(){}onTick(){}onComplete(){}static exp(u){return u}}class ZK extends f{url=process.env.REDIS_URL;options;boot(){}}class i5 extends JK{service;static _name="SingletonServiceContainer";constructor(u){super();this.service=u}}class vK{static use(){let u=i5.use().service;if(u.services.has(this.name))return u.services.get(this.name);let D=new this;return u.services.set(this.name,D),D}}export{l2 as la,ju as ma,r5 as na,cY as oa,PB as pa,VB as qa,i1 as ra,r1 as sa,yB as ta,X3 as ua,Y3 as va,UY as wa,MY as xa,LY as ya,EY as za,OY as Aa,PY as Ba,K3 as Ca,h3 as Da,kY as Ea,j0 as Fa,VY as Ga,NK as Ha,$K as Ia,zK as Ja,ZK as Ka,i5 as La,vK as Ma};
|
|
47
47
|
|
|
48
|
-
//# debugId=
|
|
48
|
+
//# debugId=1E282DB02D5EC68164756E2164756E21
|