appos 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +399 -0
  2. package/build/client/assets/IconMail-BZadZvAd.js +1 -0
  3. package/build/client/assets/_-CgPm6_fJ.js +1 -0
  4. package/build/client/assets/_index-BCLDp_mg.js +1 -0
  5. package/build/client/assets/_layout-CTmjtKOZ.js +1 -0
  6. package/build/client/assets/_layout-HsJ3Zu5t.js +1 -0
  7. package/build/client/assets/_layout-OcS85aOt.js +1 -0
  8. package/build/client/assets/app-sidebar-Bm6e4kn_.js +1 -0
  9. package/build/client/assets/app-sidebar-D2Nsi85j.js +1 -0
  10. package/build/client/assets/auth-provider-rkzBVtYX.js +1 -0
  11. package/build/client/assets/brand-CbTWw97e.js +1 -0
  12. package/build/client/assets/browser-ponyfill-D3yQFvRu.js +2 -0
  13. package/build/client/assets/button-DtZhoqpk.js +1 -0
  14. package/build/client/assets/check-D5D2EGI4.js +1 -0
  15. package/build/client/assets/checkbox-B35Nn166.js +1 -0
  16. package/build/client/assets/chunk-JG3XND5A-BetDbdG0.js +1 -0
  17. package/build/client/assets/chunk-UIGDSWPH-DeiamgQc.js +26 -0
  18. package/build/client/assets/chunk-vBKQ29Cd.js +1 -0
  19. package/build/client/assets/circle-alert-DB4JluX5.js +1 -0
  20. package/build/client/assets/compare-Br3z3FUS-BXkA2ojG.js +2 -0
  21. package/build/client/assets/compiler-runtime-Co9svCia.js +1 -0
  22. package/build/client/assets/config-ChcA_Pkv.js +1 -0
  23. package/build/client/assets/createReactComponent-C2TSpqC7.js +1 -0
  24. package/build/client/assets/dialog-CQrpvURm.js +1 -0
  25. package/build/client/assets/dist-B6TkSbxV.js +1 -0
  26. package/build/client/assets/dist-BNO39Rfs.js +1 -0
  27. package/build/client/assets/dist-BWnI-4xl.js +1 -0
  28. package/build/client/assets/dist-CA21wN5I.js +1 -0
  29. package/build/client/assets/dist-CBNvQRbZ.js +1 -0
  30. package/build/client/assets/dist-CYRPrwOb.js +1 -0
  31. package/build/client/assets/dist-DKtC0FSi.js +1 -0
  32. package/build/client/assets/dist-DhfcebhF.js +1 -0
  33. package/build/client/assets/dist-VqaKdvZu.js +1 -0
  34. package/build/client/assets/dist-Yn6lj8QC.js +5 -0
  35. package/build/client/assets/dropdown-menu-CbzduuDa.js +1 -0
  36. package/build/client/assets/empty-DQRarCKT.js +1 -0
  37. package/build/client/assets/entry.client-BN1GPjAL.js +10 -0
  38. package/build/client/assets/es2015-BJguufLZ.js +41 -0
  39. package/build/client/assets/eye-Ctrln70x.js +1 -0
  40. package/build/client/assets/file-preview-dialog-BRkWSRN4.js +14 -0
  41. package/build/client/assets/index-Del2yBnb.js +1 -0
  42. package/build/client/assets/initReactI18next-CyHiepAw.js +1 -0
  43. package/build/client/assets/input-V1lM1yoz.js +1 -0
  44. package/build/client/assets/jsx-runtime-SCjaiuzT.js +1 -0
  45. package/build/client/assets/lock-Bj7dxHab.js +1 -0
  46. package/build/client/assets/manifest-ca813980.js +1 -0
  47. package/build/client/assets/nav-user-BqPUBe9x.js +1 -0
  48. package/build/client/assets/nav-user-Yu7wt7b_.js +1 -0
  49. package/build/client/assets/org-switcher-BIuearbE.js +1 -0
  50. package/build/client/assets/password-input-bor7e4TM.js +1 -0
  51. package/build/client/assets/react-dom-Bhi-1tDD.js +1 -0
  52. package/build/client/assets/realtime-BmU1LPhx.js +1 -0
  53. package/build/client/assets/root-CS5YIV-V.js +3 -0
  54. package/build/client/assets/root-D0CFuQYc.css +2 -0
  55. package/build/client/assets/route-B9cwW-UK.js +1 -0
  56. package/build/client/assets/route-BD2nV1q2.js +1 -0
  57. package/build/client/assets/route-BEnDcljt.js +1 -0
  58. package/build/client/assets/route-BR4LdxHR.js +1 -0
  59. package/build/client/assets/route-BU5TYmVE.js +0 -0
  60. package/build/client/assets/route-BVmIPEvK.js +11 -0
  61. package/build/client/assets/route-BY244T48.js +1 -0
  62. package/build/client/assets/route-Bwd903CU.js +1 -0
  63. package/build/client/assets/route-CN9iChOk.js +1 -0
  64. package/build/client/assets/route-CQ3p9Qb1.js +1 -0
  65. package/build/client/assets/route-CVLnTONw.js +1 -0
  66. package/build/client/assets/route-CoMZag4T.js +1 -0
  67. package/build/client/assets/route-CsYSLbnx.js +1 -0
  68. package/build/client/assets/route-DWNrq2GE.js +1 -0
  69. package/build/client/assets/route-Dxfmap_u.js +1 -0
  70. package/build/client/assets/route-Gnx1fkRX.js +0 -0
  71. package/build/client/assets/route-NduA4SS_.js +1 -0
  72. package/build/client/assets/route-u2hskgE_.js +1 -0
  73. package/build/client/assets/route-v9Jwv-AW.js +1 -0
  74. package/build/client/assets/select-DATRE76_.js +1 -0
  75. package/build/client/assets/separator-Cla0V581.js +1 -0
  76. package/build/client/assets/shim-TRiHENXu.js +1 -0
  77. package/build/client/assets/sidebar-CqrdL512.js +1 -0
  78. package/build/client/assets/site-header-CZO3qBhf.js +1 -0
  79. package/build/client/assets/site-header-CwidwSv1.js +1 -0
  80. package/build/client/assets/social-providers-Bz7f1_yd.js +1 -0
  81. package/build/client/assets/test-WdoqKbLa.js +1 -0
  82. package/build/client/assets/tooltip-BeDraHQn.js +1 -0
  83. package/build/client/assets/trpc-C1CjVipH.js +6 -0
  84. package/build/client/assets/trust-indicator-D4tEs4Dr.js +20 -0
  85. package/build/client/assets/use-file-upload-CNPfWC6W.js +1 -0
  86. package/build/client/assets/useTranslation-Bz7VuQ7j.js +1 -0
  87. package/build/client/assets/utils-InBzhUf_.js +1 -0
  88. package/build/client/assets/x-4CC8aqOW.js +1 -0
  89. package/build/client/favicon.ico +0 -0
  90. package/build/client/locales/en/emails.json +11 -0
  91. package/build/client/locales/en/translation.json +411 -0
  92. package/build/client/locales/zh-CN/emails.json +11 -0
  93. package/build/client/locales/zh-CN/translation.json +1 -0
  94. package/build/client/locales/zh-TW/emails.json +11 -0
  95. package/build/client/locales/zh-TW/translation.json +1 -0
  96. package/build/client/logo-invert.png +0 -0
  97. package/build/client/logo.png +0 -0
  98. package/build/lib/adapter-factory-CLtf7vT5-CTKiMV2u.mjs +19675 -0
  99. package/build/lib/bun-sqlite-dialect-DN7EKoIB-0pWIoG0L.mjs +155 -0
  100. package/build/lib/chunk-BYI67GdN.mjs +1 -0
  101. package/build/lib/chunk-CkKlU7xI.mjs +44 -0
  102. package/build/lib/client-BtuhFgvy.mjs +65 -0
  103. package/build/lib/client.d.ts +2272 -0
  104. package/build/lib/client.js +24 -0
  105. package/build/lib/date.d.ts +1 -0
  106. package/build/lib/date.js +1 -0
  107. package/build/lib/dialect-BeMwdQoz-D41NdSow.mjs +72 -0
  108. package/build/lib/dist-cjs-B43A5HXv.mjs +169 -0
  109. package/build/lib/dist-cjs-B_wkbabY.mjs +214 -0
  110. package/build/lib/dist-cjs-BmbYbMhp.mjs +143 -0
  111. package/build/lib/dist-cjs-Cc337rwW.mjs +7 -0
  112. package/build/lib/dist-cjs-CgzfN8xY.mjs +4974 -0
  113. package/build/lib/dist-cjs-DBFcizQf.mjs +50 -0
  114. package/build/lib/dist-cjs-DC-UL-xx.mjs +97 -0
  115. package/build/lib/dist-cjs-DHlTgXUO.mjs +6975 -0
  116. package/build/lib/dist-cjs-DYAmJYzN.mjs +323 -0
  117. package/build/lib/dist-cjs-Ddm6Stp9.mjs +1294 -0
  118. package/build/lib/dist-cjs-GFGBhaZg.mjs +84 -0
  119. package/build/lib/dist-cjs-ieCOxrOi.mjs +181 -0
  120. package/build/lib/dist-cjs-nbOGa7i_.mjs +47 -0
  121. package/build/lib/dist-cjs-pN6ekzMW.mjs +66 -0
  122. package/build/lib/dist-cjs-yYlQ1OiO.mjs +102 -0
  123. package/build/lib/esm-DPet4lFW.mjs +15816 -0
  124. package/build/lib/event-streams-x9fP9BzF.mjs +185 -0
  125. package/build/lib/file-preview-dialog-Cugg8tEc.mjs +59 -0
  126. package/build/lib/kysely-adapter-BTWfu5rn.mjs +183 -0
  127. package/build/lib/magic-string.es-jZcifc5m.mjs +1013 -0
  128. package/build/lib/memory-adapter-DiU519m9.mjs +147 -0
  129. package/build/lib/node-ponyfill-Dmm1SWTU.mjs +38212 -0
  130. package/build/lib/node-sqlite-dialect-BqISUSC3-DYvTLBpY.mjs +155 -0
  131. package/build/lib/package-DfozRyK6.mjs +5 -0
  132. package/build/lib/react-dom-CPjM_WCt.mjs +42 -0
  133. package/build/lib/server.d.mts +76273 -0
  134. package/build/lib/server.mjs +325 -0
  135. package/build/lib/sso-oidc-Qom0PEDW.mjs +1036 -0
  136. package/build/lib/sts-CLRaHSW_.mjs +13 -0
  137. package/build/lib/sts-Dl7yZqX1.mjs +1405 -0
  138. package/build/lib/test.d.mts +8922 -0
  139. package/build/lib/test.mjs +175650 -0
  140. package/build/lib/ui/index.d.ts +1643 -0
  141. package/build/lib/ui/index.js +160 -0
  142. package/build/lib/utils.d.ts +21 -0
  143. package/build/lib/utils.js +1 -0
  144. package/build/lib/zod.d.ts +1 -0
  145. package/build/lib/zod.js +23 -0
  146. package/build/main.js +2383 -0
  147. package/build/server/assets/context-BoNg86Eh.js +35 -0
  148. package/build/server/assets/dialog-B8YbGNaz.js +54 -0
  149. package/build/server/assets/file-preview-dialog-qWSViOWQ.js +15 -0
  150. package/build/server/assets/react-CFQ4y0AA.js +13 -0
  151. package/build/server/assets/react-dom-Ca1YUVo2.js +5 -0
  152. package/build/server/assets/server-build-BMOfm0ad.js +118 -0
  153. package/build/server/assets/server.node-B2oksIp8.js +196 -0
  154. package/build/server/assets/server.node-VQzoub0A.js +1 -0
  155. package/build/server/index.js +123 -0
  156. package/package.json +224 -0
@@ -0,0 +1,325 @@
1
+ import{i as e,o as t,r as n,t as r}from"./chunk-BYI67GdN.mjs";import{c as i,o as a,r as o,t as s}from"./react-dom-CPjM_WCt.mjs";import{readdir as c}from"node:fs/promises";import{join as l}from"node:path";import{randomBytes as u,randomUUID as d}from"crypto";import{debuglog as f,format as p}from"util";const m=Symbol.for(`drizzle:entityKind`);function h(e,t){if(!e||typeof e!=`object`)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,m))throw Error(`Class "${t.name??`<unknown>`}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let n=Object.getPrototypeOf(e).constructor;if(n)for(;n;){if(m in n&&n[m]===t[m])return!0;n=Object.getPrototypeOf(n)}return!1}var g=class{static[m]=`Column`;name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;length;isLengthExact;config;table;onInit(){}constructor(e,t){this.config=t,this.onInit(),this.table=e,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity,this.length=t.length,this.isLengthExact=t.isLengthExact}mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!==`byDefault`}},_=class{static[m]=`ColumnBuilder`;config;constructor(e,t,n){this.config={name:e,keyAsName:e===``,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:n,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){this.config.name===``&&(this.config.name=e)}};const v=Symbol.for(`drizzle:Name`);var y=class{static[m]=`PgForeignKeyBuilder`;reference;_onUpdate=`no action`;_onDelete=`no action`;constructor(e,t){this.reference=()=>{let{name:t,columns:n,foreignColumns:r}=e();return{name:t,columns:n,foreignTable:r[0].table,foreignColumns:r}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e===void 0?`no action`:e,this}onDelete(e){return this._onDelete=e===void 0?`no action`:e,this}build(e){return new b(e,this)}},b=class{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[m]=`PgForeignKey`;reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:n}=this.reference(),r=t.map(e=>e.name),i=n.map(e=>e.name),a=[this.table[v],...r,n[0].table[v],...i];return e??`${a.join(`_`)}_fk`}};function x(e,...t){return e(...t)}function S(e){return new T(e)}function C(e,t){return`${e[v]}_${t.join(`_`)}_unique`}var w=class{constructor(e,t){this.name=t,this.columns=e}static[m]=`PgUniqueConstraintBuilder`;columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new E(e,this.columns,this.nullsNotDistinctConfig,this.name)}},T=class{static[m]=`PgUniqueOnConstraintBuilder`;name;constructor(e){this.name=e}on(...e){return new w(e,this.name)}},E=class{constructor(e,t,n,r){this.table=e,this.columns=t,this.name=r??C(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=n}static[m]=`PgUniqueConstraint`;columns;name;nullsNotDistinct=!1;getName(){return this.name}};function ee(e,t,n){for(let r=t;r<e.length;r++){let i=e[r];if(i===`\\`){r++;continue}if(i===`"`)return[e.slice(t,r).replace(/\\/g,``),r+1];if(!n&&(i===`,`||i===`}`))return[e.slice(t,r).replace(/\\/g,``),r]}return[e.slice(t).replace(/\\/g,``),e.length]}function te(e,t=0){let n=[],r=t,i=!1;for(;r<e.length;){let a=e[r];if(a===`,`){(i||r===t)&&n.push(``),i=!0,r++;continue}if(i=!1,a===`\\`){r+=2;continue}if(a===`"`){let[t,i]=ee(e,r+1,!0);n.push(t),r=i;continue}if(a===`}`)return[n,r+1];if(a===`{`){let[t,i]=te(e,r+1);n.push(t),r=i;continue}let[o,s]=ee(e,r,!1);n.push(o),r=s}return[n,r]}function D(e){let[t]=te(e,1);return t}function ne(e){return`{${e.map(e=>Array.isArray(e)?ne(e):typeof e==`string`?`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`:`${e}`).join(`,`)}}`}var O=class extends _{foreignKeyConfigs=[];static[m]=`PgColumnBuilder`;array(e){return new ie(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:`always`,mode:`stored`},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:n,actions:r})=>x((n,r)=>{let i=new y(()=>{let t=n();return{columns:[e],foreignColumns:[t]}});return r.onUpdate&&i.onUpdate(r.onUpdate),r.onDelete&&i.onDelete(r.onDelete),i.build(t)},n,r))}buildExtraConfigColumn(e){return new re(e,this.config)}},k=class extends g{static[m]=`PgColumn`;table;constructor(e,t){t.uniqueName||=C(e,[t.name]),super(e,t),this.table=e}},re=class extends k{static[m]=`ExtraConfigColumn`;getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??`asc`,nulls:this.config.nulls??`last`,opClass:this.config.opClass};defaultConfig={order:`asc`,nulls:`last`,opClass:void 0};asc(){return this.indexConfig.order=`asc`,this}desc(){return this.indexConfig.order=`desc`,this}nullsFirst(){return this.indexConfig.nulls=`first`,this}nullsLast(){return this.indexConfig.nulls=`last`,this}op(e){return this.indexConfig.opClass=e,this}},A=class{static[m]=`IndexedColumn`;constructor(e,t,n,r){this.name=e,this.keyAsName=t,this.type=n,this.indexConfig=r}name;keyAsName;type;indexConfig},ie=class extends O{static[m]=`PgArrayBuilder`;constructor(e,t,n){super(e,`array basecolumn`,`PgArray`),this.config.baseBuilder=t,this.config.length=n}build(e){let t=this.config.baseBuilder.build(e);return new ae(e,this.config,t)}},ae=class e extends k{constructor(e,t,n,r){super(e,t),this.baseColumn=n,this.range=r}static[m]=`PgArray`;getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.length==`number`?this.length:``}]`}mapFromDriverValue(e){return typeof e==`string`&&(e=D(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapFromJsonValue(e){typeof e==`string`&&(e=D(e));let t=this.baseColumn;return`mapFromJsonValue`in t?e.map(e=>t.mapFromJsonValue(e)):e.map(e=>t.mapFromDriverValue(e))}mapToDriverValue(t,n=!1){let r=t.map(t=>t===null?null:h(this.baseColumn,e)?this.baseColumn.mapToDriverValue(t,!0):this.baseColumn.mapToDriverValue(t));return n?r:ne(r)}};const oe=Symbol.for(`drizzle:isPgEnum`);function se(e){return!!e&&typeof e==`function`&&oe in e&&e[oe]===!0}var ce=class{static[m]=`Subquery`;constructor(e,t,n,r=!1,i=[]){this._={brand:`Subquery`,sql:e,selectedFields:t,alias:n,isWith:r,usedTables:i}}};const le={startActiveSpan(e,t){return t()}},ue=Symbol.for(`drizzle:ViewBaseConfig`),de=Symbol.for(`drizzle:Schema`),fe=Symbol.for(`drizzle:Columns`),pe=Symbol.for(`drizzle:ExtraConfigColumns`),me=Symbol.for(`drizzle:OriginalName`),he=Symbol.for(`drizzle:BaseName`),ge=Symbol.for(`drizzle:IsAlias`),_e=Symbol.for(`drizzle:ExtraConfigBuilder`),ve=Symbol.for(`drizzle:IsDrizzleTable`);var j=class{static[m]=`Table`;static Symbol={Name:v,Schema:de,OriginalName:me,Columns:fe,ExtraConfigColumns:pe,BaseName:he,IsAlias:ge,ExtraConfigBuilder:_e};[v];[me];[de];[fe];[pe];[he];[ge]=!1;[ve]=!0;[_e]=void 0;constructor(e,t,n){this[v]=this[me]=e,this[de]=t,this[he]=n}getSQL=void 0};function ye(e){return e!=null&&typeof e.getSQL==`function`}function be(e){let t={sql:``,params:[]};for(let n of e)t.sql+=n.sql,t.params.push(...n.params),n.typings?.length&&(t.typings||=[],t.typings.push(...n.typings));return t}var M=class{static[m]=`StringChunk`;value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new N([this])}},N=class e{constructor(e){this.queryChunks=e;for(let t of e)if(h(t,j)){let e=t[j.Symbol.Schema];this.usedTables.push(e===void 0?t[j.Symbol.Name]:e+`.`+t[j.Symbol.Name])}}static[m]=`SQL`;decoder=Ce;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return le.startActiveSpan(`drizzle.buildSQL`,t=>{let n=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":n.sql,"drizzle.query.params":JSON.stringify(n.params)}),n})}buildQueryFromSourceParams(t,n){let r=Object.assign({},n,{inlineParams:n.inlineParams||this.shouldInlineParams,paramStartIndex:n.paramStartIndex||{value:0}}),{casing:i,escapeName:a,escapeParam:o,prepareTyping:s,inlineParams:c,paramStartIndex:l}=r;return be(t.map(t=>{if(h(t,M))return{sql:t.value.join(``),params:[]};if(h(t,xe))return{sql:a(t.value),params:[]};if(t===void 0)return{sql:``,params:[]};if(Array.isArray(t)){let e=[new M(`(`)];for(let[n,r]of t.entries())e.push(r),n<t.length-1&&e.push(new M(`, `));return e.push(new M(`)`)),this.buildQueryFromSourceParams(e,r)}if(h(t,e))return this.buildQueryFromSourceParams(t.queryChunks,{...r,inlineParams:c||t.shouldInlineParams});if(h(t,j)){let e=t[j.Symbol.Schema],n=t[j.Symbol.Name];return{sql:e===void 0||t[ge]?a(n):a(e)+`.`+a(n),params:[]}}if(h(t,g)){let e=i.getColumnCasing(t);if(n.invokeSource===`indexes`)return{sql:a(e),params:[]};let r=t.table[j.Symbol.Schema];return{sql:t.table[ge]||r===void 0?a(t.table[j.Symbol.Name])+`.`+a(e):a(r)+`.`+a(t.table[j.Symbol.Name])+`.`+a(e),params:[]}}if(h(t,Oe)){let e=t[ue].schema,n=t[ue].name;return{sql:e===void 0||t[ue].isAlias?a(n):a(e)+`.`+a(n),params:[]}}if(h(t,Te)){if(h(t.value,Ee))return{sql:o(l.value++,t),params:[t],typings:[`none`]};let n=t.value===null?null:t.encoder.mapToDriverValue(t.value);if(h(n,e))return this.buildQueryFromSourceParams([n],r);if(c)return{sql:this.mapInlineParam(n,r),params:[]};let i=[`none`];return s&&(i=[s(t.encoder)]),{sql:o(l.value++,n),params:[n],typings:i}}return h(t,Ee)?{sql:o(l.value++,t),params:[t],typings:[`none`]}:h(t,e.Aliased)&&t.fieldAlias!==void 0?{sql:a(t.fieldAlias),params:[]}:h(t,ce)?t._.isWith?{sql:a(t._.alias),params:[]}:this.buildQueryFromSourceParams([new M(`(`),t._.sql,new M(`) `),new xe(t._.alias)],r):se(t)?t.schema?{sql:a(t.schema)+`.`+a(t.enumName),params:[]}:{sql:a(t.enumName),params:[]}:ye(t)?t.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([t.getSQL()],r):this.buildQueryFromSourceParams([new M(`(`),t.getSQL(),new M(`)`)],r):c?{sql:this.mapInlineParam(t,r),params:[]}:{sql:o(l.value++,t),params:[t],typings:[`none`]}}))}mapInlineParam(e,{escapeString:t}){if(e===null)return`null`;if(typeof e==`number`||typeof e==`boolean`)return e.toString();if(typeof e==`string`)return t(e);if(typeof e==`object`){let n=e.toString();return t(n===`[object Object]`?JSON.stringify(e):n)}throw Error(`Unexpected param value: `+e)}getSQL(){return this}as(t){return t===void 0?this:new e.Aliased(this,t)}mapWith(e){return this.decoder=typeof e==`function`?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}},xe=class{constructor(e){this.value=e}static[m]=`Name`;brand;getSQL(){return new N([this])}};function Se(e){return typeof e==`object`&&!!e&&`mapToDriverValue`in e&&typeof e.mapToDriverValue==`function`}const Ce={mapFromDriverValue:e=>e},we={mapToDriverValue:e=>e};({...Ce,...we});var Te=class{constructor(e,t=we){this.value=e,this.encoder=t}static[m]=`Param`;brand;getSQL(){return new N([this])}};function P(e,...t){let n=[];(t.length>0||e.length>0&&e[0]!==``)&&n.push(new M(e[0]));for(let[r,i]of t.entries())n.push(i,new M(e[r+1]));return new N(n)}(e=>{function t(){return new N([])}e.empty=t;function n(e){return new N(e)}e.fromList=n;function r(e){return new N([new M(e)])}e.raw=r;function i(e,t){let n=[];for(let[r,i]of e.entries())r>0&&t!==void 0&&n.push(t),n.push(i);return new N(n)}e.join=i;function a(e){return new xe(e)}e.identifier=a;function o(e){return new Ee(e)}e.placeholder=o;function s(e,t){return new Te(e,t)}e.param=s})(P||={}),(e=>{class t{constructor(e,t){this.sql=e,this.fieldAlias=t}static[m]=`SQL.Aliased`;isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(N||={});var Ee=class{constructor(e){this.name=e}static[m]=`Placeholder`;getSQL(){return new N([this])}};const De=Symbol.for(`drizzle:IsDrizzleView`);var Oe=class{static[m]=`View`;[ue];[De]=!0;get[v](){return this[ue].name}get[de](){return this[ue].schema}get[ge](){return this[ue].isAlias}get[me](){return this[ue].originalName}get[fe](){return this[ue].selectedFields}constructor({name:e,schema:t,selectedFields:n,query:r}){this[ue]={name:e,originalName:e,schema:t,selectedFields:n,query:r,isExisting:!r,isAlias:!1}}getSQL(){return new N([this])}};g.prototype.getSQL=function(){return new N([this])},j.prototype.getSQL=function(){return new N([this])},ce.prototype.getSQL=function(){return new N([this])};function ke(e,t){return Se(t)&&!ye(e)&&!h(e,Te)&&!h(e,Ee)&&!h(e,g)&&!h(e,j)&&!h(e,Oe)?new Te(e,t):e}const Ae=(e,t)=>P`${e} = ${ke(t,e)}`;function je(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new N(t):new N([new M(`(`),P.join(t,new M(` and `)),new M(`)`)])}function Me(...e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new N(t):new N([new M(`(`),P.join(t,new M(` or `)),new M(`)`)])}const Ne=(e,t)=>P`${e} > ${ke(t,e)}`,Pe=(e,t)=>P`${e} >= ${ke(t,e)}`,Fe=(e,t)=>P`${e} < ${ke(t,e)}`,Ie=(e,t)=>P`${e} <= ${ke(t,e)}`;function Le(e){return P`${e} is not null`}function Re(e,t){return P`${e} like ${t}`}function ze(e,t){return P`${e} ilike ${t}`}function Be(e){return P`${e} asc`}function Ve(e){return P`${e} desc`}function He(e,t){for(let t of Object.values(e))for(let[e,n]of Object.entries(t.relations))h(n,We)&&(n.sourceTable=t.table,n.fieldName=e);for(let[n,r]of Object.entries(e))for(let[i,a]of Object.entries(r.relations)){if(!h(a,We))continue;let o,{targetTableName:s,alias:c,sourceColumns:l,targetColumns:u,throughTable:d,sourceTable:f,through:p,targetTable:m,where:g,sourceColumnTableNames:_,targetColumnTableNames:v}=a,y=`relations -> ${r.name}: { ${i}: r.${h(a,Ge)?`one`:`many`}.${s}(...) }`;if(i in r.table[fe])throw Error(`${y}: relation name collides with column "${i}" of table "${r.name}"`);if(typeof c==`string`&&!c)throw Error(`${y}: "alias" cannot be an empty string - omit it if you don't need it`);if(l?.length===0)throw Error(`${y}: "from" cannot be empty`);if(u?.length===0)throw Error(`${y}: "to" cannot be empty`);if(l&&u){if(l.length!==u.length&&!d)throw Error(`${y}: "from" and "to" fields without "through" must have the same length`);for(let e of _)if(e!==n)throw Error(`${y}: all "from" columns must belong to table "${n}", found column of table "${e}"`);for(let e of v)if(e!==s)throw Error(`${y}: all "to" columns must belong to table "${m}", found column of table "${e}"`);if(p){if(p.source.length!==l.length||p.target.length!==u.length)throw Error(`${y}: ".through(column)" must be used either on all columns in "from" and "to" or not defined on any of them`);for(let e of p.source)if(t[e._.tableName]!==d)throw Error(`${y}: ".through(column)" must be used on the same table by all columns of the relation`);for(let e of p.target)if(t[e._.tableName]!==d)throw Error(`${y}: ".through(column)" must be used on the same table by all columns of the relation`)}continue}if(l||u)throw Error(`${y}: relation must have either both "from" and "to" defined, or none of them`);let b=e[s];if(!b)throw Error(`${y}: not enough data provided to build the relation - "from"/"to" are not defined, and no reverse relations of table "${s}" were found"`);if(c){let e=Object.values(b.relations).filter(e=>h(e,We)&&e.alias===c&&e!==a);if(e.length>1)throw Error(`${y}: not enough data provided to build the relation - "from"/"to" are not defined, and multiple relations with alias "${c}" found in table "${s}": ${e.map(e=>`"${e.fieldName}"`).join(`, `)}`);if(o=e[0],!o)throw Error(`${y}: not enough data provided to build the relation - "from"/"to" are not defined, and there is no reverse relation of table "${s}" with alias "${c}"`)}else{let e=Object.values(b.relations).filter(e=>h(e,We)&&e.targetTable===f&&!e.alias&&e!==a);if(e.length>1)throw Error(`${y}: not enough data provided to build the relation - "from"/"to" are not defined, and multiple relations between "${s}" and "${n}" were found.
2
+ Hint: you can specify "alias" on both sides of the relation with the same value`);if(o=e[0],!o)throw Error(`${y}: not enough data provided to build the relation - "from"/"to" are not defined, and no reverse relation of table "${s}" with target table "${n}" was found`)}if(!o.sourceColumns||!o.targetColumns)throw Error(`${y}: not enough data provided to build the relation - "from"/"to" are not defined, and reverse relation "${s}.${o.fieldName}" does not have "from"/"to" defined`);a.sourceColumns=o.targetColumns,a.targetColumns=o.sourceColumns,a.through=o.through?{source:o.through.target,target:o.through.source}:void 0,a.throughTable=o.throughTable,a.isReversed=!g,a.where=g??o.where}return e}function Ue(e,t){let n={};for(let[r,i]of Object.entries(e))n[r]={table:i,name:r,relations:t[r]??{}};return He(n,e)}var We=class{constructor(e,t){this.targetTableName=t,this.targetTable=e}static[m]=`RelationV2`;fieldName;sourceColumns;targetColumns;alias;where;sourceTable;targetTable;through;throughTable;isReversed;sourceColumnTableNames=[];targetColumnTableNames=[]},Ge=class extends We{static[m]=`OneV2`;relationType=`one`;optional;constructor(e,t,n,r){super(t,n),this.alias=r?.alias,this.where=r?.where,r?.from&&(this.sourceColumns=(Array.isArray(r.from)?r.from:[r.from]).map(t=>(this.throughTable??=t._.through?e[t._.through._.tableName]:void 0,this.sourceColumnTableNames.push(t._.tableName),t._.column))),r?.to&&(this.targetColumns=(Array.isArray(r.to)?r.to:[r.to]).map(t=>(this.throughTable??=t._.through?e[t._.through._.tableName]:void 0,this.targetColumnTableNames.push(t._.tableName),t._.column))),this.throughTable&&(this.through={source:(Array.isArray(r?.from)?r.from:r?.from?[r.from]:[]).map(e=>e._.through),target:(Array.isArray(r?.to)?r.to:r?.to?[r.to]:[]).map(e=>e._.through)}),this.optional=r?.optional??!0}},Ke=class extends We{constructor(e,t,n,r){super(t,n),this.config=r,this.alias=r?.alias,this.where=r?.where,r?.from&&(this.sourceColumns=(Array.isArray(r.from)?r.from:[r.from]).map(t=>(this.throughTable??=t._.through?e[t._.through._.tableName]:void 0,this.sourceColumnTableNames.push(t._.tableName),t._.column))),r?.to&&(this.targetColumns=(Array.isArray(r.to)?r.to:[r.to]).map(t=>(this.throughTable??=t._.through?e[t._.through._.tableName]:void 0,this.targetColumnTableNames.push(t._.tableName),t._.column))),this.throughTable&&(this.through={source:(Array.isArray(r?.from)?r.from:r?.from?[r.from]:[]).map(e=>e._.through),target:(Array.isArray(r?.to)?r.to:r?.to?[r.to]:[]).map(e=>e._.through)})}static[m]=`ManyV2`;relationType=`many`},qe=class{static[m]=`AggregatedField`;table;onTable(e){return this.table=e,this}},Je=class extends qe{static[m]=`AggregatedFieldCount`;query;getSQL(){if(!this.query){if(!this.table)throw Error(`Table must be set before building aggregate field`);this.query=P`select count(*) as ${P.identifier(`r`)} from ${tt(this.table)}`.mapWith(Number)}return this.query}},Ye=class{static[m]=`RelationsBuilderTable`;_;constructor(e,t){this._={name:t,table:e}}},Xe=class{static[m]=`RelationsBuilderColumn`;_;constructor(e,t,n){this._={tableName:t,column:e,key:n}}through(e){return new Ze(this._.column,this._.tableName,this._.key,e)}},Ze=class{static[m]=`RelationsBuilderColumn`;_;constructor(e,t,n,r){this._={tableName:t,column:e,through:r,key:n}}},F=class{static[m]=`RelationsHelperStatic`;_;constructor(e){this._={tables:e};let t={},n={};for(let[r,i]of Object.entries(e))t[r]=t=>new Ge(e,i,r,t),n[r]=t=>new Ke(e,i,r,t);this.one=t,this.many=n}one;many;aggs={count(){return new Je}}};function Qe(e){let t=new F(e),n=Object.entries(e).reduce((e,[t,n])=>{let r=new Ye(n,t),i=Object.entries(n[fe]).reduce((e,[n,r])=>(e[n]=new Xe(r,t,n),e),{});return e[t]=Object.assign(r,i),e},{});return Object.assign(t,n)}function $e(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>h(t,j)||h(t,Oe)))}function et(e,t){let n=$e(e);return Ue(n,t?t(Qe(n)):{})}function tt(e){return P`${e[ge]?P`${P`${P.identifier(e[de]??``)}.`.if(e[de])}${P.identifier(e[me])} as ${e}`:e}`}function nt(e){return e[j.Symbol.Columns]}function rt(e,t){return{name:typeof e==`string`&&e.length>0?e:``,config:typeof e==`object`?e:t}}typeof TextDecoder>`u`||new TextDecoder;var it=class extends O{static[m]=`PgIntColumnBaseBuilder`;generatedAlwaysAsIdentity(e){if(e){let{name:t,...n}=e;this.config.generatedIdentity={type:`always`,sequenceName:t,sequenceOptions:n}}else this.config.generatedIdentity={type:`always`};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(e){if(e){let{name:t,...n}=e;this.config.generatedIdentity={type:`byDefault`,sequenceName:t,sequenceOptions:n}}else this.config.generatedIdentity={type:`byDefault`};return this.config.hasDefault=!0,this.config.notNull=!0,this}},at=class extends it{static[m]=`PgBigInt53Builder`;constructor(e){super(e,`number int53`,`PgBigInt53`)}build(e){return new ot(e,this.config)}},ot=class extends k{static[m]=`PgBigInt53`;getSQLType(){return`bigint`}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}},st=class extends it{static[m]=`PgBigInt64Builder`;constructor(e){super(e,`bigint int64`,`PgBigInt64`)}build(e){return new I(e,this.config)}},I=class extends k{static[m]=`PgBigInt64`;getSQLType(){return`bigint`}mapFromDriverValue(e){return BigInt(e)}};function L(e,t){let{name:n,config:r}=rt(e,t);return r.mode===`number`?new at(n):new st(n)}var ct=class extends O{static[m]=`PgBigSerial53Builder`;constructor(e){super(e,`number int53`,`PgBigSerial53`),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new lt(e,this.config)}},lt=class extends k{static[m]=`PgBigSerial53`;getSQLType(){return`bigserial`}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}},ut=class extends O{static[m]=`PgBigSerial64Builder`;constructor(e){super(e,`bigint int64`,`PgBigSerial64`),this.config.hasDefault=!0}build(e){return new dt(e,this.config)}},dt=class extends k{static[m]=`PgBigSerial64`;getSQLType(){return`bigserial`}mapFromDriverValue(e){return BigInt(e)}};function ft(e,t){let{name:n,config:r}=rt(e,t);return r.mode===`number`?new ct(n):new ut(n)}var pt=class extends O{static[m]=`PgBooleanBuilder`;constructor(e){super(e,`boolean`,`PgBoolean`)}build(e){return new mt(e,this.config)}},mt=class extends k{static[m]=`PgBoolean`;getSQLType(){return`boolean`}};function ht(e){return new pt(e??``)}var gt=class extends O{static[m]=`PgCharBuilder`;constructor(e,t){super(e,t.enum?.length?`string enum`:`string`,`PgChar`),this.config.length=t.length??1,this.config.setLength=t.length!==void 0,this.config.enumValues=t.enum,this.config.isLengthExact=!0}build(e){return new _t(e,this.config)}},_t=class extends k{static[m]=`PgChar`;enumValues=this.config.enumValues;getSQLType(){return this.config.setLength?`char(${this.length})`:`char`}};function vt(e,t={}){let{name:n,config:r}=rt(e,t);return new gt(n,r)}var yt=class extends O{static[m]=`PgCidrBuilder`;constructor(e){super(e,`string cidr`,`PgCidr`)}build(e){return new bt(e,this.config)}},bt=class extends k{static[m]=`PgCidr`;getSQLType(){return`cidr`}};function xt(e){return new yt(e??``)}var St=class extends O{static[m]=`PgCustomColumnBuilder`;constructor(e,t,n){super(e,`custom`,`PgCustomColumn`),this.config.fieldConfig=t,this.config.customTypeParams=n}build(e){return new Ct(e,this.config)}},Ct=class extends k{static[m]=`PgCustomColumn`;sqlName;mapTo;mapFrom;mapJson;forJsonSelect;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver,this.mapJson=t.customTypeParams.fromJson,this.forJsonSelect=t.customTypeParams.forJsonSelect}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom==`function`?this.mapFrom(e):e}mapFromJsonValue(e){return typeof this.mapJson==`function`?this.mapJson(e):this.mapFromDriverValue(e)}jsonSelectIdentifier(e,t,n){if(typeof this.forJsonSelect==`function`)return this.forJsonSelect(e,t,n);let r=this.getSQLType().toLowerCase(),i=r.indexOf(`(`);switch(i+1?r.slice(0,i):r){case`bytea`:case`geometry`:case`timestamp`:case`numeric`:case`bigint`:{let r=`[]`.repeat(n??0);return t`${e}::text${t.raw(r).if(n)}`}default:return e}}mapToDriverValue(e){return typeof this.mapTo==`function`?this.mapTo(e):e}};function wt(e){return(t,n)=>{let{name:r,config:i}=rt(t,n);return new St(r,i,e)}}var Tt=class extends O{static[m]=`PgDateColumnBaseBuilder`;defaultNow(){return this.default(P`now()`)}},Et=class extends Tt{static[m]=`PgDateBuilder`;constructor(e){super(e,`object date`,`PgDate`)}build(e){return new Dt(e,this.config)}},Dt=class extends k{static[m]=`PgDate`;getSQLType(){return`date`}mapFromDriverValue(e){return new Date(e)}mapToDriverValue(e){return e.toISOString()}},Ot=class extends Tt{static[m]=`PgDateStringBuilder`;constructor(e){super(e,`string date`,`PgDateString`)}build(e){return new kt(e,this.config)}},kt=class extends k{static[m]=`PgDateString`;getSQLType(){return`date`}};function At(e,t){let{name:n,config:r}=rt(e,t);return r?.mode===`date`?new Et(n):new Ot(n)}var jt=class extends O{static[m]=`PgDoublePrecisionBuilder`;constructor(e){super(e,`number double`,`PgDoublePrecision`)}build(e){return new Mt(e,this.config)}},Mt=class extends k{static[m]=`PgDoublePrecision`;getSQLType(){return`double precision`}mapFromDriverValue(e){return typeof e==`string`?Number.parseFloat(e):e}};function Nt(e){return new jt(e??``)}var Pt=class extends O{static[m]=`PgInetBuilder`;constructor(e){super(e,`string inet`,`PgInet`)}build(e){return new Ft(e,this.config)}},Ft=class extends k{static[m]=`PgInet`;getSQLType(){return`inet`}};function It(e){return new Pt(e??``)}var Lt=class extends it{static[m]=`PgIntegerBuilder`;constructor(e){super(e,`number int32`,`PgInteger`)}build(e){return new Rt(e,this.config)}},Rt=class extends k{static[m]=`PgInteger`;getSQLType(){return`integer`}mapFromDriverValue(e){return typeof e==`string`?Number.parseInt(e):e}};function zt(e){return new Lt(e??``)}var Bt=class extends O{static[m]=`PgIntervalBuilder`;constructor(e,t){super(e,`string interval`,`PgInterval`),this.config.intervalConfig=t}build(e){return new Vt(e,this.config)}},Vt=class extends k{static[m]=`PgInterval`;fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){return`interval${this.fields?` ${this.fields}`:``}${this.precision?`(${this.precision})`:``}`}};function Ht(e,t={}){let{name:n,config:r}=rt(e,t);return new Bt(n,r)}var Ut=class extends O{static[m]=`PgJsonBuilder`;constructor(e){super(e,`object json`,`PgJson`)}build(e){return new Wt(e,this.config)}},Wt=class extends k{static[m]=`PgJson`;constructor(e,t){super(e,t)}getSQLType(){return`json`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}};function Gt(e){return new Ut(e??``)}var Kt=class extends O{static[m]=`PgJsonbBuilder`;constructor(e){super(e,`object json`,`PgJsonb`)}build(e){return new qt(e,this.config)}},qt=class extends k{static[m]=`PgJsonb`;constructor(e,t){super(e,t)}getSQLType(){return`jsonb`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if(typeof e==`string`)try{return JSON.parse(e)}catch{return e}return e}};function Jt(e){return new Kt(e??``)}var Yt=class extends O{static[m]=`PgLineBuilder`;constructor(e){super(e,`array line`,`PgLine`)}build(e){return new Xt(e,this.config)}},Xt=class extends k{static[m]=`PgLine`;getSQLType(){return`line`}mapFromDriverValue(e){let[t,n,r]=e.slice(1,-1).split(`,`);return[Number.parseFloat(t),Number.parseFloat(n),Number.parseFloat(r)]}mapToDriverValue(e){return`{${e[0]},${e[1]},${e[2]}}`}},Zt=class extends O{static[m]=`PgLineABCBuilder`;constructor(e){super(e,`object line`,`PgLineABC`)}build(e){return new Qt(e,this.config)}},Qt=class extends k{static[m]=`PgLineABC`;getSQLType(){return`line`}mapFromDriverValue(e){let[t,n,r]=e.slice(1,-1).split(`,`);return{a:Number.parseFloat(t),b:Number.parseFloat(n),c:Number.parseFloat(r)}}mapToDriverValue(e){return`{${e.a},${e.b},${e.c}}`}};function $t(e,t){let{name:n,config:r}=rt(e,t);return!r?.mode||r.mode===`tuple`?new Yt(n):new Zt(n)}var en=class extends O{static[m]=`PgMacaddrBuilder`;constructor(e){super(e,`string macaddr`,`PgMacaddr`)}build(e){return new tn(e,this.config)}},tn=class extends k{static[m]=`PgMacaddr`;getSQLType(){return`macaddr`}};function nn(e){return new en(e??``)}var rn=class extends O{static[m]=`PgMacaddr8Builder`;constructor(e){super(e,`string macaddr8`,`PgMacaddr8`)}build(e){return new an(e,this.config)}},an=class extends k{static[m]=`PgMacaddr8`;getSQLType(){return`macaddr8`}};function on(e){return new rn(e??``)}var sn=class extends O{static[m]=`PgNumericBuilder`;constructor(e,t,n){super(e,`string numeric`,`PgNumeric`),this.config.precision=t,this.config.scale=n}build(e){return new cn(e,this.config)}},cn=class extends k{static[m]=`PgNumeric`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`string`?e:String(e)}getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},ln=class extends O{static[m]=`PgNumericNumberBuilder`;constructor(e,t,n){super(e,`number`,`PgNumericNumber`),this.config.precision=t,this.config.scale=n}build(e){return new un(e,this.config)}},un=class extends k{static[m]=`PgNumericNumber`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return typeof e==`number`?e:Number(e)}mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}},dn=class extends O{static[m]=`PgNumericBigIntBuilder`;constructor(e,t,n){super(e,`bigint int64`,`PgNumericBigInt`),this.config.precision=t,this.config.scale=n}build(e){return new fn(e,this.config)}},fn=class extends k{static[m]=`PgNumericBigInt`;precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return this.precision!==void 0&&this.scale!==void 0?`numeric(${this.precision}, ${this.scale})`:this.precision===void 0?`numeric`:`numeric(${this.precision})`}};function pn(e,t){let{name:n,config:r}=rt(e,t),i=r?.mode;return i===`number`?new ln(n,r?.precision,r?.scale):i===`bigint`?new dn(n,r?.precision,r?.scale):new sn(n,r?.precision,r?.scale)}var mn=class extends O{static[m]=`PgPointTupleBuilder`;constructor(e){super(e,`array point`,`PgPointTuple`)}build(e){return new hn(e,this.config)}},hn=class extends k{static[m]=`PgPointTuple`;getSQLType(){return`point`}mapFromDriverValue(e){if(typeof e==`string`){let[t,n]=e.slice(1,-1).split(`,`);return[Number.parseFloat(t),Number.parseFloat(n)]}return[e.x,e.y]}mapToDriverValue(e){return`(${e[0]},${e[1]})`}},gn=class extends O{static[m]=`PgPointObjectBuilder`;constructor(e){super(e,`object point`,`PgPointObject`)}build(e){return new _n(e,this.config)}},_n=class extends k{static[m]=`PgPointObject`;getSQLType(){return`point`}mapFromDriverValue(e){if(typeof e==`string`){let[t,n]=e.slice(1,-1).split(`,`);return{x:Number.parseFloat(t),y:Number.parseFloat(n)}}return e}mapToDriverValue(e){return`(${e.x},${e.y})`}};function vn(e,t){let{name:n,config:r}=rt(e,t);return!r?.mode||r.mode===`tuple`?new mn(n):new gn(n)}function yn(e){let t=[];for(let n=0;n<e.length;n+=2)t.push(Number.parseInt(e.slice(n,n+2),16));return new Uint8Array(t)}function bn(e,t){let n=new ArrayBuffer(8),r=new DataView(n);for(let n=0;n<8;n++)r.setUint8(n,e[t+n]);return r.getFloat64(0,!0)}function xn(e){let t=yn(e),n=0,r=t[n];n+=1;let i=new DataView(t.buffer),a=i.getUint32(n,r===1);if(n+=4,a&536870912&&(i.getUint32(n,r===1),n+=4),(a&65535)==1){let e=bn(t,n);n+=8;let r=bn(t,n);return n+=8,[e,r]}throw Error(`Unsupported geometry type`)}var Sn=class extends O{static[m]=`PgGeometryBuilder`;constructor(e){super(e,`array geometry`,`PgGeometry`)}build(e){return new Cn(e,this.config)}},Cn=class extends k{static[m]=`PgGeometry`;getSQLType(){return`geometry(point)`}mapFromDriverValue(e){return typeof e==`string`?xn(e):e}mapToDriverValue(e){return`point(${e[0]} ${e[1]})`}},wn=class extends O{static[m]=`PgGeometryObjectBuilder`;constructor(e){super(e,`object geometry`,`PgGeometryObject`)}build(e){return new Tn(e,this.config)}},Tn=class extends k{static[m]=`PgGeometryObject`;getSQLType(){return`geometry(point)`}mapFromDriverValue(e){let t=xn(e);return{x:t[0],y:t[1]}}mapToDriverValue(e){return`point(${e.x} ${e.y})`}};function En(e,t){let{name:n,config:r}=rt(e,t);return!r?.mode||r.mode===`tuple`?new Sn(n):new wn(n)}var Dn=class extends O{static[m]=`PgRealBuilder`;constructor(e,t){super(e,`number float`,`PgReal`),this.config.length=t}build(e){return new On(e,this.config)}},On=class extends k{static[m]=`PgReal`;constructor(e,t){super(e,t)}getSQLType(){return`real`}mapFromDriverValue=e=>typeof e==`string`?Number.parseFloat(e):e};function kn(e){return new Dn(e??``)}var An=class extends O{static[m]=`PgSerialBuilder`;constructor(e){super(e,`number int32`,`PgSerial`),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new jn(e,this.config)}},jn=class extends k{static[m]=`PgSerial`;getSQLType(){return`serial`}};function Mn(e){return new An(e??``)}var Nn=class extends it{static[m]=`PgSmallIntBuilder`;constructor(e){super(e,`number int16`,`PgSmallInt`)}build(e){return new Pn(e,this.config)}},Pn=class extends k{static[m]=`PgSmallInt`;getSQLType(){return`smallint`}mapFromDriverValue=e=>typeof e==`string`?Number(e):e};function Fn(e){return new Nn(e??``)}var In=class extends O{static[m]=`PgSmallSerialBuilder`;constructor(e){super(e,`number int16`,`PgSmallSerial`),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new Ln(e,this.config)}},Ln=class extends k{static[m]=`PgSmallSerial`;getSQLType(){return`smallserial`}};function Rn(e){return new In(e??``)}var zn=class extends O{static[m]=`PgTextBuilder`;constructor(e,t){super(e,t.enum?.length?`string enum`:`string`,`PgText`),this.config.enumValues=t.enum}build(e){return new Bn(e,this.config,this.config.enumValues)}},Bn=class extends k{static[m]=`PgText`;enumValues;constructor(e,t,n){super(e,t),this.enumValues=n}getSQLType(){return`text`}};function Vn(e,t={}){let{name:n,config:r}=rt(e,t);return new zn(n,r)}var Hn=class extends Tt{constructor(e,t,n){super(e,`string time`,`PgTime`),this.withTimezone=t,this.precision=n,this.config.withTimezone=t,this.config.precision=n}static[m]=`PgTimeBuilder`;build(e){return new Un(e,this.config)}},Un=class extends k{static[m]=`PgTime`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`time${this.precision===void 0?``:`(${this.precision})`}${this.withTimezone?` with time zone`:``}`}};function Wn(e,t={}){let{name:n,config:r}=rt(e,t);return new Hn(n,r.withTimezone??!1,r.precision)}var Gn=class extends Tt{static[m]=`PgTimestampBuilder`;constructor(e,t,n){super(e,`object date`,`PgTimestamp`),this.config.withTimezone=t,this.config.precision=n}build(e){return new Kn(e,this.config)}},Kn=class extends k{static[m]=`PgTimestamp`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`timestamp${this.precision===void 0?``:` (${this.precision})`}${this.withTimezone?` with time zone`:``}`}mapFromDriverValue=e=>new Date(this.withTimezone?e:e+`+0000`);mapToDriverValue=e=>e.toISOString()},qn=class extends Tt{static[m]=`PgTimestampStringBuilder`;constructor(e,t,n){super(e,`string timestamp`,`PgTimestampString`),this.config.withTimezone=t,this.config.precision=n}build(e){return new Jn(e,this.config)}},Jn=class extends k{static[m]=`PgTimestampString`;withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){return`timestamp${this.precision===void 0?``:`(${this.precision})`}${this.withTimezone?` with time zone`:``}`}};function Yn(e,t={}){let{name:n,config:r}=rt(e,t);return r?.mode===`string`?new qn(n,r.withTimezone??!1,r.precision):new Gn(n,r?.withTimezone??!1,r?.precision)}var Xn=class extends O{static[m]=`PgUUIDBuilder`;constructor(e){super(e,`string uuid`,`PgUUID`)}defaultRandom(){return this.default(P`gen_random_uuid()`)}build(e){return new Zn(e,this.config)}},Zn=class extends k{static[m]=`PgUUID`;getSQLType(){return`uuid`}};function Qn(e){return new Xn(e??``)}var $n=class extends O{static[m]=`PgVarcharBuilder`;constructor(e,t){super(e,t.enum?.length?`string enum`:`string`,`PgVarchar`),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new er(e,this.config)}},er=class extends k{static[m]=`PgVarchar`;enumValues=this.config.enumValues;getSQLType(){return this.length===void 0?`varchar`:`varchar(${this.length})`}};function tr(e,t={}){let{name:n,config:r}=rt(e,t);return new $n(n,r)}var nr=class extends O{static[m]=`PgBinaryVectorBuilder`;constructor(e,t){super(e,`string binary`,`PgBinaryVector`),this.config.length=t.dimensions,this.config.isLengthExact=!0}build(e){return new rr(e,this.config)}},rr=class extends k{static[m]=`PgBinaryVector`;getSQLType(){return`bit(${this.length})`}};function ir(e,t){let{name:n,config:r}=rt(e,t);return new nr(n,r)}var ar=class extends O{static[m]=`PgHalfVectorBuilder`;constructor(e,t){super(e,`array halfvector`,`PgHalfVector`),this.config.length=t.dimensions,this.config.isLengthExact=!0}build(e){return new or(e,this.config)}},or=class extends k{static[m]=`PgHalfVector`;getSQLType(){return`halfvec(${this.length})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(`,`).map(e=>Number.parseFloat(e))}};function sr(e,t){let{name:n,config:r}=rt(e,t);return new ar(n,r)}var cr=class extends O{static[m]=`PgSparseVectorBuilder`;constructor(e,t){super(e,`string sparsevec`,`PgSparseVector`),this.config.dimensions=t.dimensions}build(e){return new lr(e,this.config)}},lr=class extends k{static[m]=`PgSparseVector`;dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}};function ur(e,t){let{name:n,config:r}=rt(e,t);return new cr(n,r)}var dr=class extends O{static[m]=`PgVectorBuilder`;constructor(e,t){super(e,`array vector`,`PgVector`),this.config.length=t.dimensions,this.config.isLengthExact=!0}build(e){return new fr(e,this.config)}},fr=class extends k{static[m]=`PgVector`;getSQLType(){return`vector(${this.length})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(`,`).map(e=>Number.parseFloat(e))}};function pr(e,t){let{name:n,config:r}=rt(e,t);return new dr(n,r)}function mr(){return{bigint:L,bigserial:ft,boolean:ht,char:vt,cidr:xt,customType:wt,date:At,doublePrecision:Nt,inet:It,integer:zt,interval:Ht,json:Gt,jsonb:Jt,line:$t,macaddr:nn,macaddr8:on,numeric:pn,point:vn,geometry:En,real:kn,serial:Mn,smallint:Fn,smallserial:Rn,text:Vn,time:Wn,timestamp:Yn,uuid:Qn,varchar:tr,bit:ir,halfvec:sr,sparsevec:ur,vector:pr}}const hr=Symbol.for(`drizzle:PgInlineForeignKeys`),gr=Symbol.for(`drizzle:EnableRLS`);var _r=class extends j{static[m]=`PgTable`;static Symbol=Object.assign({},j.Symbol,{InlineForeignKeys:hr,EnableRLS:gr});[hr]=[];[gr]=!1;[j.Symbol.ExtraConfigBuilder]=void 0;[j.Symbol.ExtraConfigColumns]={}};function vr(e,t,n,r,i=e){let a=new _r(e,r,i),o=typeof t==`function`?t(mr()):t,s=Object.fromEntries(Object.entries(o).map(([e,t])=>{let n=t;n.setName(e);let r=n.build(a);return a[hr].push(...n.buildForeignKeys(r,a)),[e,r]})),c=Object.fromEntries(Object.entries(o).map(([e,t])=>{let n=t;return n.setName(e),[e,n.buildExtraConfigColumn(a)]})),l=Object.assign(a,s);return l[j.Symbol.Columns]=s,l[j.Symbol.ExtraConfigColumns]=c,n&&(l[_r.Symbol.ExtraConfigBuilder]=n),Object.assign(l,{enableRLS:()=>(l[_r.Symbol.EnableRLS]=!0,l)})}const yr=(e,t,n)=>vr(e,t,n,void 0);var br=class{constructor(e,t){this.unique=e,this.name=t}static[m]=`PgIndexBuilderOn`;on(...e){return new xr(e.map(e=>{if(h(e,N))return e;e=e;let t=new A(e.name,!!e.keyAsName,e.columnType,e.indexConfig);return e.indexConfig=JSON.parse(JSON.stringify(e.defaultConfig)),t}),this.unique,!1,this.name)}onOnly(...e){return new xr(e.map(e=>{if(h(e,N))return e;e=e;let t=new A(e.name,!!e.keyAsName,e.columnType,e.indexConfig);return e.indexConfig=e.defaultConfig,t}),this.unique,!0,this.name)}using(e,...t){return new xr(t.map(e=>{if(h(e,N))return e;e=e;let t=new A(e.name,!!e.keyAsName,e.columnType,e.indexConfig);return e.indexConfig=JSON.parse(JSON.stringify(e.defaultConfig)),t}),this.unique,!0,this.name,e)}},xr=class{static[m]=`PgIndexBuilder`;config;constructor(e,t,n,r,i=`btree`){this.config={name:r,columns:e,unique:t,only:n,method:i}}concurrently(){return this.config.concurrently=!0,this}with(e){return this.config.with=e,this}where(e){return this.config.where=e,this}build(e){return new Sr(this.config,e)}},Sr=class{static[m]=`PgIndex`;config;constructor(e,t){this.config={...e,table:t}}};function Cr(e){return new br(!1,e)}function wr(){let e=yr(`accounts`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),accessToken:e.text(`access_token`),accessTokenExpiresAt:e.timestamp(`access_token_expires_at`,{withTimezone:!0}),accountId:e.text(`account_id`).notNull(),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),idToken:e.text(`id_token`),providerId:e.text(`provider_id`).notNull(),password:e.text(`password`),userId:e.text(`user_id`).notNull().references(()=>s.id,{onDelete:`cascade`}),refreshToken:e.text(`refresh_token`),refreshTokenExpiresAt:e.timestamp(`refresh_token_expires_at`,{withTimezone:!0}),scope:e.text(`scope`),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[]),t=yr(`api_keys`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),name:e.text(`name`),enabled:e.boolean(`enabled`).default(!0),expiresAt:e.timestamp(`expires_at`,{withTimezone:!0}),key:e.text(`key`).notNull(),lastRefillAt:e.timestamp(`last_refill_at`,{withTimezone:!0}),lastRequest:e.timestamp(`last_request`,{withTimezone:!0}),lastUsedAt:e.timestamp(`last_used_at`,{withTimezone:!0}),metadata:e.text(`metadata`),permissions:e.text(`permissions`),prefix:e.text(`prefix`),rateLimitEnabled:e.boolean(`rate_limit_enabled`).default(!0),rateLimitTimeWindow:e.integer(`rate_limit_time_window`).default(864e5),rateLimitMax:e.integer(`rate_limit_max`).default(10),refillInterval:e.integer(`refill_interval`),refillAmount:e.integer(`refill_amount`),requestCount:e.integer(`request_count`),remaining:e.integer(`remaining`),start:e.text(`start`),userId:e.text(`user_id`).notNull().references(()=>s.id,{onDelete:`cascade`}),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[]),n=yr(`invitations`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),email:e.text(`email`).notNull(),expiresAt:e.timestamp(`expires_at`,{withTimezone:!0}).notNull(),inviterId:e.text(`inviter_id`).notNull().references(()=>s.id,{onDelete:`cascade`}),organizationId:e.text(`organization_id`).notNull().references(()=>i.id,{onDelete:`cascade`}),role:e.text(`role`),status:e.text(`status`).default(`pending`).notNull(),teamId:e.text(`team_id`),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[]),r=yr(`members`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),organizationId:e.text(`organization_id`).notNull().references(()=>i.id,{onDelete:`cascade`}),role:e.text(`role`).default(`member`).notNull(),userId:e.text(`user_id`).notNull().references(()=>s.id,{onDelete:`cascade`}),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[]),i=yr(`organizations`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),name:e.text(`name`).notNull(),slug:e.text(`slug`).unique(),logo:e.text(`logo`),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),metadata:e.text(`metadata`)}),e=>[]),a=yr(`sessions`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),activeOrganizationId:e.text(`active_organization_id`).references(()=>i.id,{onDelete:`set null`}),activeTeamId:e.text(`active_team_id`),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),expiresAt:e.timestamp(`expires_at`,{withTimezone:!0}).notNull(),impersonatedBy:e.text(`impersonated_by`).references(()=>s.id,{onDelete:`set null`}),ipAddress:e.text(`ip_address`),token:e.text(`token`).notNull().unique(),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),userAgent:e.text(`user_agent`),userId:e.text(`user_id`).notNull().references(()=>s.id,{onDelete:`cascade`})}),e=>[]),o=yr(`sso_providers`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),domain:e.text(`domain`).notNull(),issuer:e.text(`issuer`).notNull(),oidcConfig:e.text(`oidc_config`),organizationId:e.text(`organization_id`).references(()=>i.id,{onDelete:`cascade`}),providerId:e.text(`provider_id`).notNull().unique(),samlConfig:e.text(`saml_config`),userId:e.text(`user_id`).references(()=>s.id,{onDelete:`cascade`})}),e=>[]),s=yr(`users`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),banExpires:e.timestamp(`ban_expires`,{withTimezone:!0}),banReason:e.text(`ban_reason`),banned:e.boolean(`banned`).default(!1),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),displayUsername:e.text(`display_username`),email:e.text(`email`).notNull().unique(),emailVerified:e.boolean(`email_verified`).default(!1).notNull(),image:e.text(`image`),isAnonymous:e.boolean(`is_anonymous`),lastLoginMethod:e.text(`last_login_method`),name:e.text(`name`).notNull(),phoneNumber:e.text(`phone_number`).unique(),phoneNumberVerified:e.boolean(`phone_number_verified`),role:e.text(`role`),twoFactorEnabled:e.boolean(`two_factor_enabled`).default(!1),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),username:e.text(`username`).unique()}),e=>[]),c=yr(`teams`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),name:e.text(`name`).notNull(),organizationId:e.text(`organization_id`).notNull().references(()=>i.id,{onDelete:`cascade`}),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[]);return{tables:{accounts:e,apiKeys:t,invitations:n,members:r,organizations:i,sessions:a,ssoProviders:o,teams:c,teamMembers:yr(`team_members`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),teamId:e.text(`team_id`).notNull().references(()=>c.id,{onDelete:`cascade`}),userId:e.text(`user_id`).notNull().references(()=>s.id,{onDelete:`cascade`}),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[]),twoFactors:yr(`two_factors`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),secret:e.text(`secret`).notNull(),backupCodes:e.text(`backup_codes`).notNull(),userId:e.text(`user_id`).notNull().references(()=>s.id,{onDelete:`cascade`})}),e=>[]),users:s,verifications:yr(`verifications`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),expiresAt:e.timestamp(`expires_at`,{withTimezone:!0}).notNull(),identifier:e.text(`identifier`).notNull(),updatedAt:e.timestamp(`updated_at`,{withTimezone:!0}).default(P`NOW()`).notNull(),value:e.text(`value`).notNull()}),e=>[])},relations:e=>({users:{sessions:e.many.sessions({from:e.users.id,to:e.sessions.userId}),accounts:e.many.accounts({from:e.users.id,to:e.accounts.userId}),apiKeys:e.many.apiKeys({from:e.users.id,to:e.apiKeys.userId}),memberships:e.many.members({from:e.users.id,to:e.members.userId}),invitations:e.many.invitations({from:e.users.id,to:e.invitations.inviterId}),ssoProvider:e.one.ssoProviders({from:e.users.id,to:e.ssoProviders.userId}),twoFactor:e.one.twoFactors({from:e.users.id,to:e.twoFactors.userId})},sessions:{user:e.one.users({from:e.sessions.userId,to:e.users.id})},accounts:{user:e.one.users({from:e.accounts.userId,to:e.users.id})},apiKeys:{user:e.one.users({from:e.apiKeys.userId,to:e.users.id})},organizations:{members:e.many.members({from:e.organizations.id,to:e.members.organizationId}),invitations:e.many.invitations({from:e.organizations.id,to:e.invitations.organizationId}),teams:e.many.teams({from:e.organizations.id,to:e.teams.organizationId})},members:{organization:e.one.organizations({from:e.members.organizationId,to:e.organizations.id}),user:e.one.users({from:e.members.userId,to:e.users.id})},invitations:{organization:e.one.organizations({from:e.invitations.organizationId,to:e.organizations.id}),inviter:e.one.users({from:e.invitations.inviterId,to:e.users.id})},teams:{organization:e.one.organizations({from:e.teams.organizationId,to:e.organizations.id})},ssoProviders:{user:e.one.users({from:e.ssoProviders.userId,to:e.users.id})},verifications:{},twoFactors:{user:e.one.users({from:e.twoFactors.userId,to:e.users.id})}})}}r(((t,n)=>{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{remixRoutesOptionAdapter:()=>b}),n.exports=f(p);function m(e,t=`root`){let n={};for(let t in e){let r=e[t];n[t]={id:r.id,file:r.file,path:r.path,index:r.index,caseSensitive:r.caseSensitive}}let r=[];for(let i in n){let a=n[i],o=e[a.id].parentId;if(o===t)r.push(a);else{let e=o&&n[o];e&&(e.children=e.children||[],e.children.push(a))}}return r}var h=d(e(`path`));function g(e){return e.replaceAll(h.default.win32.sep,`/`)}var _=e=>{let t=Object.create(null),n=[],r=!1;return e((e,i,a,o)=>{if(r)throw Error("You tried to define routes asynchronously but started defining routes before the async work was done. Please await all async data before calling `defineRoutes()`");let s;typeof a==`function`?(s={},o=a):s=a||{};let c={path:e||void 0,index:s.index?!0:void 0,caseSensitive:s.caseSensitive?!0:void 0,id:s.id||v(i),parentId:n.length>0?n[n.length-1].id:`root`,file:i};if(c.id in t)throw Error(`Unable to define routes with duplicate route id: "${c.id}"`);t[c.id]=c,o&&(n.push(c),o(),n.pop())}),r=!0,t};function v(e){return g(y(e))}function y(e){return e.replace(/\.[a-z0-9]+$/i,``)}async function b(e){return m(await e(_))}}))();const Tr=Object.freeze({status:`aborted`});function R(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}const Er=Symbol(`zod_brand`);var Dr=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Or=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const kr={};function Ar(e){return e&&Object.assign(kr,e),kr}var jr=n({BIGINT_FORMAT_RANGES:()=>fi,Class:()=>Pi,NUMBER_FORMAT_RANGES:()=>di,aborted:()=>bi,allowsEval:()=>ei,assert:()=>Ir,assertEqual:()=>Mr,assertIs:()=>Pr,assertNever:()=>Fr,assertNotEqual:()=>Nr,assignProp:()=>Gr,base64ToUint8Array:()=>Oi,base64urlToUint8Array:()=>Ai,cached:()=>zr,captureStackTrace:()=>Qr,cleanEnum:()=>Di,cleanRegex:()=>Vr,clone:()=>ci,cloneDef:()=>qr,createTransparentProxy:()=>li,defineLazy:()=>B,esc:()=>Zr,escapeRegex:()=>si,extend:()=>hi,finalizeIssue:()=>Ci,floatSafeRemainder:()=>Hr,getElementAtPath:()=>Jr,getEnumValues:()=>Lr,getLengthableOrigin:()=>Ti,getParsedType:()=>ii,getSizableOrigin:()=>wi,hexToUint8Array:()=>Mi,isObject:()=>$r,isPlainObject:()=>ti,issue:()=>Ei,joinValues:()=>z,jsonStringifyReplacer:()=>Rr,merge:()=>_i,mergeDefs:()=>Kr,normalizeParams:()=>V,nullish:()=>Br,numKeys:()=>ri,objectClone:()=>Wr,omit:()=>mi,optionalKeys:()=>ui,partial:()=>vi,pick:()=>pi,prefixIssues:()=>xi,primitiveTypes:()=>oi,promiseAllObject:()=>Yr,propertyKeyTypes:()=>ai,randomString:()=>Xr,required:()=>yi,safeExtend:()=>gi,shallowClone:()=>ni,stringifyPrimitive:()=>H,uint8ArrayToBase64:()=>ki,uint8ArrayToBase64url:()=>ji,uint8ArrayToHex:()=>Ni,unwrapMessage:()=>Si});function Mr(e){return e}function Nr(e){return e}function Pr(e){}function Fr(e){throw Error()}function Ir(e){}function Lr(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function z(e,t=`|`){return e.map(e=>H(e)).join(t)}function Rr(e,t){return typeof t==`bigint`?t.toString():t}function zr(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Br(e){return e==null}function Vr(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Hr(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const Ur=Symbol(`evaluating`);function B(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ur)return r===void 0&&(r=Ur,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Wr(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Gr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Kr(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function qr(e){return Kr(e._zod.def)}function Jr(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Yr(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function Xr(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Zr(e){return JSON.stringify(e)}const Qr=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function $r(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const ei=zr(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function ti(e){if($r(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!($r(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ni(e){return ti(e)?{...e}:Array.isArray(e)?[...e]:e}function ri(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const ii=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},ai=new Set([`string`,`number`,`symbol`]),oi=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function si(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ci(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function V(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function li(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function H(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ui(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const di={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},fi={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function pi(e,t){let n=e._zod.def;return ci(e,Kr(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Gr(this,`shape`,e),e},checks:[]}))}function mi(e,t){let n=e._zod.def;return ci(e,Kr(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Gr(this,`shape`,r),r},checks:[]}))}function hi(e,t){if(!ti(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return ci(e,Kr(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Gr(this,`shape`,n),n},checks:[]}))}function gi(e,t){if(!ti(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ci(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return Gr(this,`shape`,n),n},checks:e._zod.def.checks})}function _i(e,t){return ci(e,Kr(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Gr(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function vi(e,t,n){return ci(t,Kr(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return Gr(this,`shape`,i),i},checks:[]}))}function yi(e,t,n){return ci(t,Kr(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return Gr(this,`shape`,i),i},checks:[]}))}function bi(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function xi(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Si(e){return typeof e==`string`?e:e?.message}function Ci(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Si(e.inst?._zod.def?.error?.(e))??Si(t?.error?.(e))??Si(n.customError?.(e))??Si(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function wi(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ti(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ei(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Di(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Oi(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function ki(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ai(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Oi(t+`=`.repeat((4-t.length%4)%4))}function ji(e){return ki(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Mi(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function Ni(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var Pi=class{constructor(...e){}};const Fi=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,Rr,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ii=R(`$ZodError`,Fi),Li=R(`$ZodError`,Fi,{Parent:Error});function Ri(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function zi(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function Bi(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function Vi(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function Hi(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Vi(e.path)}`);return t.join(`
3
+ `)}const Ui=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Dr;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Ci(e,a,Ar())));throw Qr(t,i?.callee),t}return o.value},Wi=Ui(Li),Gi=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Ci(e,a,Ar())));throw Qr(t,i?.callee),t}return o.value},Ki=Gi(Li),qi=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Dr;return a.issues.length?{success:!1,error:new(e??Ii)(a.issues.map(e=>Ci(e,i,Ar())))}:{success:!0,data:a.value}},Ji=qi(Li),Yi=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Ci(e,i,Ar())))}:{success:!0,data:a.value}},Xi=Yi(Li),Zi=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ui(e)(t,n,i)},Qi=Zi(Li),$i=e=>(t,n,r)=>Ui(e)(t,n,r),ea=$i(Li),ta=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Gi(e)(t,n,i)},na=ta(Li),ra=e=>async(t,n,r)=>Gi(e)(t,n,r),ia=ra(Li),aa=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return qi(e)(t,n,i)},oa=aa(Li),sa=e=>(t,n,r)=>qi(e)(t,n,r),ca=sa(Li),la=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Yi(e)(t,n,i)},ua=la(Li),da=e=>async(t,n,r)=>Yi(e)(t,n,r),fa=da(Li);var pa=n({base64:()=>Ra,base64url:()=>za,bigint:()=>Ya,boolean:()=>Qa,browserEmail:()=>Ma,cidrv4:()=>Ia,cidrv6:()=>La,cuid:()=>ma,cuid2:()=>ha,date:()=>Wa,datetime:()=>qa,domain:()=>Va,duration:()=>ba,e164:()=>Ha,email:()=>Da,emoji:()=>Na,extendedDuration:()=>xa,guid:()=>Sa,hex:()=>ro,hostname:()=>Ba,html5Email:()=>Oa,idnEmail:()=>ja,integer:()=>Xa,ipv4:()=>Pa,ipv6:()=>Fa,ksuid:()=>va,lowercase:()=>to,md5_base64:()=>so,md5_base64url:()=>co,md5_hex:()=>oo,nanoid:()=>ya,null:()=>$a,number:()=>Za,rfc5322Email:()=>ka,sha1_base64:()=>uo,sha1_base64url:()=>fo,sha1_hex:()=>lo,sha256_base64:()=>mo,sha256_base64url:()=>ho,sha256_hex:()=>po,sha384_base64:()=>_o,sha384_base64url:()=>vo,sha384_hex:()=>go,sha512_base64:()=>bo,sha512_base64url:()=>xo,sha512_hex:()=>yo,string:()=>Ja,time:()=>Ka,ulid:()=>ga,undefined:()=>eo,unicodeEmail:()=>Aa,uppercase:()=>no,uuid:()=>Ca,uuid4:()=>wa,uuid6:()=>Ta,uuid7:()=>Ea,xid:()=>_a});const ma=/^[cC][^\s-]{8,}$/,ha=/^[0-9a-z]+$/,ga=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_a=/^[0-9a-vA-V]{20}$/,va=/^[A-Za-z0-9]{27}$/,ya=/^[a-zA-Z0-9_-]{21}$/,ba=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,xa=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sa=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ca=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,wa=Ca(4),Ta=Ca(6),Ea=Ca(7),Da=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Oa=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ka=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Aa=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,ja=Aa,Ma=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Na(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Pa=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Fa=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ia=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,La=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ra=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,za=/^[A-Za-z0-9_-]*$/,Ba=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Va=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ha=/^\+(?:[0-9]){6,14}[0-9]$/,Ua=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Wa=RegExp(`^${Ua}$`);function Ga(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ka(e){return RegExp(`^${Ga(e)}$`)}function qa(e){let t=Ga({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Ua}T(?:${r})$`)}const Ja=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ya=/^-?\d+n?$/,Xa=/^-?\d+$/,Za=/^-?\d+(?:\.\d+)?/,Qa=/^(?:true|false)$/i,$a=/^null$/i,eo=/^undefined$/i,to=/^[^A-Z]*$/,no=/^[^a-z]*$/,ro=/^[0-9a-fA-F]*$/;function io(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ao(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const oo=/^[0-9a-fA-F]{32}$/,so=io(22,`==`),co=ao(22),lo=/^[0-9a-fA-F]{40}$/,uo=io(27,`=`),fo=ao(27),po=/^[0-9a-fA-F]{64}$/,mo=io(43,`=`),ho=ao(43),go=/^[0-9a-fA-F]{96}$/,_o=io(64,``),vo=ao(64),yo=/^[0-9a-fA-F]{128}$/,bo=io(86,`==`),xo=ao(86),So=R(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Co={number:`number`,bigint:`bigint`,object:`date`},wo=R(`$ZodCheckLessThan`,(e,t)=>{So.init(e,t);let n=Co[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),To=R(`$ZodCheckGreaterThan`,(e,t)=>{So.init(e,t);let n=Co[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Eo=R(`$ZodCheckMultipleOf`,(e,t)=>{So.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Hr(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Do=R(`$ZodCheckNumberFormat`,(e,t)=>{So.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=di[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Xa)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Oo=R(`$ZodCheckBigIntFormat`,(e,t)=>{So.init(e,t);let[n,r]=fi[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),ko=R(`$ZodCheckMaxSize`,(e,t)=>{var n;So.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Br(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:wi(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ao=R(`$ZodCheckMinSize`,(e,t)=>{var n;So.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Br(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:wi(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jo=R(`$ZodCheckSizeEquals`,(e,t)=>{var n;So.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Br(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:wi(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Mo=R(`$ZodCheckMaxLength`,(e,t)=>{var n;So.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Br(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ti(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),No=R(`$ZodCheckMinLength`,(e,t)=>{var n;So.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Br(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ti(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Po=R(`$ZodCheckLengthEquals`,(e,t)=>{var n;So.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Br(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ti(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Fo=R(`$ZodCheckStringFormat`,(e,t)=>{var n,r;So.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Io=R(`$ZodCheckRegex`,(e,t)=>{Fo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Lo=R(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=to,Fo.init(e,t)}),Ro=R(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=no,Fo.init(e,t)}),zo=R(`$ZodCheckIncludes`,(e,t)=>{So.init(e,t);let n=si(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Bo=R(`$ZodCheckStartsWith`,(e,t)=>{So.init(e,t);let n=RegExp(`^${si(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Vo=R(`$ZodCheckEndsWith`,(e,t)=>{So.init(e,t);let n=RegExp(`.*${si(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function Ho(e,t,n){e.issues.length&&t.issues.push(...xi(n,e.issues))}const Uo=R(`$ZodCheckProperty`,(e,t)=>{So.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>Ho(n,e,t.property));Ho(n,e,t.property)}}),Wo=R(`$ZodCheckMimeType`,(e,t)=>{So.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Go=R(`$ZodCheckOverwrite`,(e,t)=>{So.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Ko=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
4
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
5
+ `))}};const qo={major:4,minor:1,patch:12},U=R(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qo;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=bi(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Dr;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=bi(e,t))});else{if(e.issues.length===t)continue;r||=bi(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(bi(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Dr;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Dr;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=Ji(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Xi(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Jo=R(`$ZodString`,(e,t)=>{U.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ja(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),W=R(`$ZodStringFormat`,(e,t)=>{Fo.init(e,t),Jo.init(e,t)}),Yo=R(`$ZodGUID`,(e,t)=>{t.pattern??=Sa,W.init(e,t)}),Xo=R(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ca(e)}else t.pattern??=Ca();W.init(e,t)}),Zo=R(`$ZodEmail`,(e,t)=>{t.pattern??=Da,W.init(e,t)}),Qo=R(`$ZodURL`,(e,t)=>{W.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:Ba.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),$o=R(`$ZodEmoji`,(e,t)=>{t.pattern??=Na(),W.init(e,t)}),es=R(`$ZodNanoID`,(e,t)=>{t.pattern??=ya,W.init(e,t)}),ts=R(`$ZodCUID`,(e,t)=>{t.pattern??=ma,W.init(e,t)}),ns=R(`$ZodCUID2`,(e,t)=>{t.pattern??=ha,W.init(e,t)}),rs=R(`$ZodULID`,(e,t)=>{t.pattern??=ga,W.init(e,t)}),is=R(`$ZodXID`,(e,t)=>{t.pattern??=_a,W.init(e,t)}),as=R(`$ZodKSUID`,(e,t)=>{t.pattern??=va,W.init(e,t)}),os=R(`$ZodISODateTime`,(e,t)=>{t.pattern??=qa(t),W.init(e,t)}),ss=R(`$ZodISODate`,(e,t)=>{t.pattern??=Wa,W.init(e,t)}),cs=R(`$ZodISOTime`,(e,t)=>{t.pattern??=Ka(t),W.init(e,t)}),ls=R(`$ZodISODuration`,(e,t)=>{t.pattern??=ba,W.init(e,t)}),us=R(`$ZodIPv4`,(e,t)=>{t.pattern??=Pa,W.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),ds=R(`$ZodIPv6`,(e,t)=>{t.pattern??=Fa,W.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),fs=R(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ia,W.init(e,t)}),ps=R(`$ZodCIDRv6`,(e,t)=>{t.pattern??=La,W.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function ms(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const hs=R(`$ZodBase64`,(e,t)=>{t.pattern??=Ra,W.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{ms(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function gs(e){if(!za.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ms(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const _s=R(`$ZodBase64URL`,(e,t)=>{t.pattern??=za,W.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{gs(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),vs=R(`$ZodE164`,(e,t)=>{t.pattern??=Ha,W.init(e,t)});function ys(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const bs=R(`$ZodJWT`,(e,t)=>{W.init(e,t),e._zod.check=n=>{ys(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),xs=R(`$ZodCustomStringFormat`,(e,t)=>{W.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Ss=R(`$ZodNumber`,(e,t)=>{U.init(e,t),e._zod.pattern=e._zod.bag.pattern??Za,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Cs=R(`$ZodNumber`,(e,t)=>{Do.init(e,t),Ss.init(e,t)}),ws=R(`$ZodBoolean`,(e,t)=>{U.init(e,t),e._zod.pattern=Qa,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ts=R(`$ZodBigInt`,(e,t)=>{U.init(e,t),e._zod.pattern=Ya,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),Es=R(`$ZodBigInt`,(e,t)=>{Oo.init(e,t),Ts.init(e,t)}),Ds=R(`$ZodSymbol`,(e,t)=>{U.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Os=R(`$ZodUndefined`,(e,t)=>{U.init(e,t),e._zod.pattern=eo,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),ks=R(`$ZodNull`,(e,t)=>{U.init(e,t),e._zod.pattern=$a,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),As=R(`$ZodAny`,(e,t)=>{U.init(e,t),e._zod.parse=e=>e}),js=R(`$ZodUnknown`,(e,t)=>{U.init(e,t),e._zod.parse=e=>e}),Ms=R(`$ZodNever`,(e,t)=>{U.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),Ns=R(`$ZodVoid`,(e,t)=>{U.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),Ps=R(`$ZodDate`,(e,t)=>{U.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function Fs(e,t,n){e.issues.length&&t.issues.push(...xi(n,e.issues)),t.value[n]=e.value}const Is=R(`$ZodArray`,(e,t)=>{U.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Fs(t,n,e))):Fs(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ls(e,t,n,r){e.issues.length&&t.issues.push(...xi(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Rs(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ui(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function zs(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Ls(e,n,i,t))):Ls(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Bs=R(`$ZodObject`,(e,t)=>{if(U.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=zr(()=>Rs(t));B(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=$r,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>Ls(n,t,e,s))):Ls(n,t,e,s)}return i?zs(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Vs=R(`$ZodObjectJIT`,(e,t)=>{Bs.init(e,t);let n=e._zod.parse,r=zr(()=>Rs(t)),i=e=>{let t=new Ko([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=Zr(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=Zr(e);t.write(`const ${n} = ${i(e)};`),t.write(`
6
+ if (${n}.issues.length) {
7
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
8
+ ...iss,
9
+ path: iss.path ? [${r}, ...iss.path] : [${r}]
10
+ })));
11
+ }
12
+
13
+
14
+ if (${n}.value === undefined) {
15
+ if (${r} in input) {
16
+ newResult[${r}] = undefined;
17
+ }
18
+ } else {
19
+ newResult[${r}] = ${n}.value;
20
+ }
21
+
22
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=$r,s=!kr.jitless,c=s&&ei.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?zs([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Hs(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!bi(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ci(e,r,Ar())))}),t)}const Us=R(`$ZodUnion`,(e,t)=>{U.init(e,t),B(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),B(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),B(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),B(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Vr(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Hs(t,i,e,a)):Hs(s,i,e,a)}}),Ws=R(`$ZodDiscriminatedUnion`,(e,t)=>{Us.init(e,t);let n=e._zod.parse;B(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=zr(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!$r(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Gs=R(`$ZodIntersection`,(e,t)=>{U.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>qs(e,t,n)):qs(e,i,a)}});function Ks(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ti(e)&&ti(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ks(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ks(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function qs(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),bi(e))return e;let r=Ks(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Js=R(`$ZodTuple`,(e,t)=>{U.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length},input:o,inst:e,origin:`array`}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>Ys(e,i,c))):Ys(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>Ys(e,i,c))):Ys(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function Ys(e,t,n){e.issues.length&&t.issues.push(...xi(n,e.issues)),t.value[n]=e.value}const Xs=R(`$ZodRecord`,(e,t)=>{U.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!ti(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...xi(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...xi(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Ci(e,r,Ar())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...xi(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...xi(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Zs=R(`$ZodMap`,(e,t)=>{U.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Qs(t,a,n,o,i,e,r)})):Qs(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function Qs(e,t,n,r,i,a,o){e.issues.length&&(ai.has(typeof r)?n.issues.push(...xi(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>Ci(e,o,Ar()))})),t.issues.length&&(ai.has(typeof r)?n.issues.push(...xi(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>Ci(e,o,Ar()))})),n.value.set(e.value,t.value)}const $s=R(`$ZodSet`,(e,t)=>{U.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>ec(e,n))):ec(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function ec(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const tc=R(`$ZodEnum`,(e,t)=>{U.init(e,t);let n=Lr(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ai.has(typeof e)).map(e=>typeof e==`string`?si(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),nc=R(`$ZodLiteral`,(e,t)=>{if(U.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?si(e):e?si(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),rc=R(`$ZodFile`,(e,t)=>{U.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),ic=R(`$ZodTransform`,(e,t)=>{U.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Or(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Dr;return n.value=i,n}});function ac(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const oc=R(`$ZodOptional`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,B(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),B(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Vr(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>ac(t,e.value)):ac(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),sc=R(`$ZodNullable`,(e,t)=>{U.init(e,t),B(e._zod,`optin`,()=>t.innerType._zod.optin),B(e._zod,`optout`,()=>t.innerType._zod.optout),B(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Vr(e.source)}|null)$`):void 0}),B(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),cc=R(`$ZodDefault`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,B(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>lc(e,t)):lc(r,t)}});function lc(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const uc=R(`$ZodPrefault`,(e,t)=>{U.init(e,t),e._zod.optin=`optional`,B(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),dc=R(`$ZodNonOptional`,(e,t)=>{U.init(e,t),B(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>fc(t,e)):fc(i,e)}});function fc(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const pc=R(`$ZodSuccess`,(e,t)=>{U.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new Or(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),mc=R(`$ZodCatch`,(e,t)=>{U.init(e,t),B(e._zod,`optin`,()=>t.innerType._zod.optin),B(e._zod,`optout`,()=>t.innerType._zod.optout),B(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ci(e,n,Ar()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ci(e,n,Ar()))},input:e.value}),e.issues=[]),e)}}),hc=R(`$ZodNaN`,(e,t)=>{U.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),gc=R(`$ZodPipe`,(e,t)=>{U.init(e,t),B(e._zod,`values`,()=>t.in._zod.values),B(e._zod,`optin`,()=>t.in._zod.optin),B(e._zod,`optout`,()=>t.out._zod.optout),B(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>_c(e,t.in,n)):_c(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>_c(e,t.out,n)):_c(r,t.out,n)}});function _c(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const vc=R(`$ZodCodec`,(e,t)=>{U.init(e,t),B(e._zod,`values`,()=>t.in._zod.values),B(e._zod,`optin`,()=>t.in._zod.optin),B(e._zod,`optout`,()=>t.out._zod.optout),B(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>yc(e,t,n)):yc(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>yc(e,t,n)):yc(r,t,n)}}});function yc(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>bc(e,r,t.out,n)):bc(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>bc(e,r,t.in,n)):bc(e,r,t.in,n)}}function bc(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const xc=R(`$ZodReadonly`,(e,t)=>{U.init(e,t),B(e._zod,`propValues`,()=>t.innerType._zod.propValues),B(e._zod,`values`,()=>t.innerType._zod.values),B(e._zod,`optin`,()=>t.innerType._zod.optin),B(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Sc):Sc(r)}});function Sc(e){return e.value=Object.freeze(e.value),e}const Cc=R(`$ZodTemplateLiteral`,(e,t)=>{U.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=t.startsWith(`^`)?1:0,i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||oi.has(typeof e))n.push(si(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`template_literal`,code:`invalid_type`}),n)}),wc=R(`$ZodFunction`,(e,t)=>(U.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Wi(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Wi(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Ki(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Ki(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Js({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Tc=R(`$ZodPromise`,(e,t)=>{U.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Ec=R(`$ZodLazy`,(e,t)=>{U.init(e,t),B(e._zod,`innerType`,()=>t.getter()),B(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),B(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),B(e._zod,`optin`,()=>e._zod.innerType._zod.optin??void 0),B(e._zod,`optout`,()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Dc=R(`$ZodCustom`,(e,t)=>{So.init(e,t),U.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Oc(t,n,r,e));Oc(i,n,r,e)}});function Oc(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Ei(e))}}const kc=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${H(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${z(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Ac(){return{localeError:kc()}}const jc=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${H(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Mc(){return{localeError:jc()}}function Nc(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Pc=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${H(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Nc(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Nc(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Fc(){return{localeError:Pc()}}const Ic=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Lc=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`};return e=>{switch(e.code){case`invalid_type`:return`Невалиден вход: очакван ${e.expected}, получен ${Ic(e.input)}`;case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${H(e.values[0])}`:`Невалидна опция: очаквано едно от ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function Rc(){return{localeError:Lc()}}const zc=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${H(e.values[0])}`:`Opció invàlida: s'esperava una de ${z(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function Bc(){return{localeError:zc()}}const Vc=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;case`boolean`:return`boolean`;case`bigint`:return`bigint`;case`function`:return`funkce`;case`symbol`:return`symbol`;case`undefined`:return`undefined`;case`object`:if(Array.isArray(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${H(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${z(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function Hc(){return{localeError:Vc()}}const Uc=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`}},t={string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};function n(t){return e[t]??null}function r(e){return t[e]??e}let i=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tal`;case`object`:return Array.isArray(e)?`liste`:e===null?`null`:Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:`objekt`}return t},a={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldigt input: forventede ${r(e.expected)}, fik ${r(i(e.input))}`;case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${H(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${z(e.values,`|`)}`;case`too_big`:{let t=e.inclusive?`<=`:`<`,i=n(e.origin),a=r(e.origin);return i?`For stor: forventede ${a??`value`} ${i.verb} ${t} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${t} ${e.maximum.toString()}`}case`too_small`:{let t=e.inclusive?`>=`:`>`,i=n(e.origin),a=r(e.origin);return i?`For lille: forventede ${a} ${i.verb} ${t} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${t} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${a[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function Wc(){return{localeError:Uc()}}const Gc=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;case`object`:if(Array.isArray(e))return`Array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,jwt:`JWT`,template_literal:`Eingabe`};return e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${H(e.values[0])}`:`Ungültige Option: erwartet eine von ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function Kc(){return{localeError:Gc()}}const qc=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Jc=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${qc(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${H(e.values[0])}`:`Invalid option: expected one of ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Yc(){return{localeError:Jc()}}const Xc=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombro`;case`object`:if(Array.isArray(e))return`tabelo`;if(e===null)return`senvalora`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},Zc=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,jwt:`JWT`,template_literal:`enigo`};return e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${Xc(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${H(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function Qc(){return{localeError:Zc()}}const $c=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}},t={string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};function n(t){return e[t]??null}function r(e){return t[e]??e}let i=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:Object.getPrototypeOf(e)===Object.prototype?`object`:e.constructor.name}return t},a={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${r(e.expected)}, recibido ${r(i(e.input))}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${H(e.values[0])}`:`Opción inválida: se esperaba una de ${z(e.values,`|`)}`;case`too_big`:{let t=e.inclusive?`<=`:`<`,i=n(e.origin),a=r(e.origin);return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${t}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${t}${e.maximum.toString()}`}case`too_small`:{let t=e.inclusive?`>=`:`>`,i=n(e.origin),a=r(e.origin);return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${t}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${t}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${a[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r(e.origin)}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r(e.origin)}`;default:return`Entrada inválida`}}};function el(){return{localeError:$c()}}const tl=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: می‌بایست ${e.expected} می‌بود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${H(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${z(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${z(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function nl(){return{localeError:tl()}}const rl=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,jwt:`JWT`,template_literal:`templaattimerkkijono`};return e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${H(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}};function il(){return{localeError:rl()}}const al=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${H(e.values[0])} attendu`:`Option invalide : une valeur parmi ${z(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${z(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function ol(){return{localeError:al()}}const sl=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${H(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${z(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function cl(){return{localeError:sl()}}const ll=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`קלט`,email:`כתובת אימייל`,url:`כתובת רשת`,emoji:`אימוג'י`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`תאריך וזמן ISO`,date:`תאריך ISO`,time:`זמן ISO`,duration:`משך זמן ISO`,ipv4:`כתובת IPv4`,ipv6:`כתובת IPv6`,cidrv4:`טווח IPv4`,cidrv6:`טווח IPv6`,base64:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${H(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב"${t.prefix}"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב "${t.suffix}"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול "${t.includes}"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}};function ul(){return{localeError:ll()}}const dl=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${H(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function fl(){return{localeError:dl()}}const pl=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${H(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function ml(){return{localeError:pl()}}const hl=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`númer`;case`object`:if(Array.isArray(e))return`fylki`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},gl=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,jwt:`JWT`,template_literal:`gildi`};return e=>{switch(e.code){case`invalid_type`:return`Rangt gildi: Þú slóst inn ${hl(e.input)} þar sem á að vera ${e.expected}`;case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${H(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function _l(){return{localeError:gl()}}const vl=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${H(e.values[0])}`:`Opzione non valida: atteso uno tra ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function yl(){return{localeError:vl()}}const bl=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${H(e.values[0])}が期待されました`:`無効な選択: ${z(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${z(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function xl(){return{localeError:bl()}}const Sl=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`რიცხვი`;case`object`:if(Array.isArray(e))return`მასივი`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return{string:`სტრინგი`,boolean:`ბულეანი`,undefined:`undefined`,bigint:`bigint`,symbol:`symbol`,function:`ფუნქცია`}[t]??t},Cl=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`};return e=>{switch(e.code){case`invalid_type`:return`არასწორი შეყვანა: მოსალოდნელი ${e.expected}, მიღებული ${Sl(e.input)}`;case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${H(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${z(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function wl(){return{localeError:Cl()}}const Tl=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;case`object`:if(Array.isArray(e))return`អារេ (Array)`;if(e===null)return`គ្មានតម្លៃ (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${H(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${z(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function El(){return{localeError:Tl()}}function Dl(){return El()}const Ol=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${H(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${z(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${z(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function kl(){return{localeError:Ol()}}const Al=e=>jl(typeof e,e),jl=(e,t=void 0)=>{switch(e){case`number`:return Number.isNaN(t)?`NaN`:`skaičius`;case`bigint`:return`sveikasis skaičius`;case`string`:return`eilutė`;case`boolean`:return`loginė reikšmė`;case`undefined`:case`void`:return`neapibrėžta reikšmė`;case`function`:return`funkcija`;case`symbol`:return`simbolis`;case`object`:return t===void 0?`nežinomas objektas`:t===null?`nulinė reikšmė`:Array.isArray(t)?`masyvas`:Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:`objektas`;case`null`:return`nulinė reikšmė`}return e},Ml=e=>e.charAt(0).toUpperCase()+e.slice(1);function Nl(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const Pl=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`};return e=>{switch(e.code){case`invalid_type`:return`Gautas tipas ${Al(e.input)}, o tikėtasi - ${jl(e.expected)}`;case`invalid_value`:return e.values.length===1?`Privalo būti ${H(e.values[0])}`:`Privalo būti vienas iš ${z(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=jl(e.origin),r=t(e.origin,Nl(Number(e.maximum)),e.inclusive??!1,`smaller`);if(r?.verb)return`${Ml(n??e.origin??`reikšmė`)} ${r.verb} ${e.maximum.toString()} ${r.unit??`elementų`}`;let i=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${Ml(n??e.origin??`reikšmė`)} turi būti ${i} ${e.maximum.toString()} ${r?.unit}`}case`too_small`:{let n=jl(e.origin),r=t(e.origin,Nl(Number(e.minimum)),e.inclusive??!1,`bigger`);if(r?.verb)return`${Ml(n??e.origin??`reikšmė`)} ${r.verb} ${e.minimum.toString()} ${r.unit??`elementų`}`;let i=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${Ml(n??e.origin??`reikšmė`)} turi būti ${i} ${e.minimum.toString()} ${r?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${Ml(jl(e.origin)??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}};function Fl(){return{localeError:Pl()}}const Il=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${H(e.values[0])}`:`Грешана опција: се очекува една ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Ll(){return{localeError:Il()}}const Rl=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${H(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${z(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function zl(){return{localeError:Rl()}}const Bl=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`invoer`};return e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${H(e.values[0])}`:`Ongeldige optie: verwacht één van ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Vl(){return{localeError:Bl()}}const Hl=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${H(e.values[0])}`:`Ugyldig valg: forventet en av ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Ul(){return{localeError:Hl()}}const Wl=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${H(e.values[0])}`:`Fâsit tercih: mûteberler ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Gl(){return{localeError:Wl()}}const Kl=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${H(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${z(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function ql(){return{localeError:Kl()}}const Jl=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${H(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Yl(){return{localeError:Jl()}}const Xl=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço de e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`duração ISO`,ipv4:`endereço IPv4`,ipv6:`endereço IPv6`,cidrv4:`faixa de IPv4`,cidrv6:`faixa de IPv6`,base64:`texto codificado em base64`,base64url:`URL codificada em base64`,json_string:`texto JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${H(e.values[0])}`:`Opção inválida: esperada uma das ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Zl(){return{localeError:Xl()}}function Ql(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const $l=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${H(e.values[0])}`:`Неверный вариант: ожидалось одно из ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Ql(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Ql(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function eu(){return{localeError:$l()}}const tu=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${H(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function nu(){return{localeError:tu()}}const ru=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-intervall`,ipv6:`IPv6-intervall`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${H(e.values[0])}`:`Ogiltigt val: förväntade en av ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function iu(){return{localeError:ru()}}const au=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${H(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${z(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function ou(){return{localeError:au()}}const su=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;case`object`:if(Array.isArray(e))return`อาร์เรย์ (Array)`;if(e===null)return`ไม่มีค่า (null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${H(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${z(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function cu(){return{localeError:su()}}const lu=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},uu=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${lu(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${H(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function du(){return{localeError:uu()}}const fu=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${H(e.values[0])}`:`Неправильна опція: очікується одне з ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${z(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function pu(){return{localeError:fu()}}function mu(){return pu()}const hu=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${H(e.values[0])} متوقع تھا`:`غلط آپشن: ${z(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${z(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function gu(){return{localeError:hu()}}const _u=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${H(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${z(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function vu(){return{localeError:_u()}}const yu=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${H(e.values[0])}`:`无效选项:期望以下之一 ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${z(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function bu(){return{localeError:yu()}}const xu=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${H(e.values[0])}`:`無效的選項:預期為以下其中之一 ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${z(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function Su(){return{localeError:xu()}}const Cu=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nọ́mbà`;case`object`:if(Array.isArray(e))return`akopọ`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`};return e=>{switch(e.code){case`invalid_type`:return`Ìbáwọlé aṣìṣe: a ní láti fi ${e.expected}, àmọ̀ a rí ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${H(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${z(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${z(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function wu(){return{localeError:Cu()}}var Tu=n({ar:()=>Ac,az:()=>Mc,be:()=>Fc,bg:()=>Rc,ca:()=>Bc,cs:()=>Hc,da:()=>Wc,de:()=>Kc,en:()=>Yc,eo:()=>Qc,es:()=>el,fa:()=>nl,fi:()=>il,fr:()=>ol,frCA:()=>cl,he:()=>ul,hu:()=>fl,id:()=>ml,is:()=>_l,it:()=>yl,ja:()=>xl,ka:()=>wl,kh:()=>Dl,km:()=>El,ko:()=>kl,lt:()=>Fl,mk:()=>Ll,ms:()=>zl,nl:()=>Vl,no:()=>Ul,ota:()=>Gl,pl:()=>Yl,ps:()=>ql,pt:()=>Zl,ru:()=>eu,sl:()=>nu,sv:()=>iu,ta:()=>ou,th:()=>cu,tr:()=>du,ua:()=>mu,uk:()=>pu,ur:()=>gu,vi:()=>vu,yo:()=>wu,zhCN:()=>bu,zhTW:()=>Su});const Eu=Symbol(`ZodOutput`),Du=Symbol(`ZodInput`);var Ou=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ku(){return new Ou}const Au=ku();function ju(e,t){return new e({type:`string`,...V(t)})}function Mu(e,t){return new e({type:`string`,coerce:!0,...V(t)})}function Nu(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...V(t)})}function Pu(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...V(t)})}function Fu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...V(t)})}function Iu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...V(t)})}function Lu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...V(t)})}function Ru(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...V(t)})}function zu(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...V(t)})}function Bu(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...V(t)})}function Vu(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...V(t)})}function Hu(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...V(t)})}function Uu(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...V(t)})}function Wu(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...V(t)})}function Gu(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...V(t)})}function Ku(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...V(t)})}function qu(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...V(t)})}function Ju(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...V(t)})}function Yu(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...V(t)})}function Xu(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...V(t)})}function Zu(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...V(t)})}function Qu(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...V(t)})}function $u(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...V(t)})}function ed(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...V(t)})}const td={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function nd(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...V(t)})}function rd(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...V(t)})}function id(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...V(t)})}function ad(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...V(t)})}function od(e,t){return new e({type:`number`,checks:[],...V(t)})}function sd(e,t){return new e({type:`number`,coerce:!0,checks:[],...V(t)})}function cd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...V(t)})}function ld(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...V(t)})}function ud(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...V(t)})}function dd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...V(t)})}function fd(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...V(t)})}function pd(e,t){return new e({type:`boolean`,...V(t)})}function md(e,t){return new e({type:`boolean`,coerce:!0,...V(t)})}function hd(e,t){return new e({type:`bigint`,...V(t)})}function gd(e,t){return new e({type:`bigint`,coerce:!0,...V(t)})}function _d(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...V(t)})}function vd(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...V(t)})}function yd(e,t){return new e({type:`symbol`,...V(t)})}function bd(e,t){return new e({type:`undefined`,...V(t)})}function xd(e,t){return new e({type:`null`,...V(t)})}function Sd(e){return new e({type:`any`})}function Cd(e){return new e({type:`unknown`})}function wd(e,t){return new e({type:`never`,...V(t)})}function Td(e,t){return new e({type:`void`,...V(t)})}function Ed(e,t){return new e({type:`date`,...V(t)})}function Dd(e,t){return new e({type:`date`,coerce:!0,...V(t)})}function Od(e,t){return new e({type:`nan`,...V(t)})}function kd(e,t){return new wo({check:`less_than`,...V(t),value:e,inclusive:!1})}function Ad(e,t){return new wo({check:`less_than`,...V(t),value:e,inclusive:!0})}function jd(e,t){return new To({check:`greater_than`,...V(t),value:e,inclusive:!1})}function Md(e,t){return new To({check:`greater_than`,...V(t),value:e,inclusive:!0})}function Nd(e){return jd(0,e)}function Pd(e){return kd(0,e)}function Fd(e){return Ad(0,e)}function Id(e){return Md(0,e)}function Ld(e,t){return new Eo({check:`multiple_of`,...V(t),value:e})}function Rd(e,t){return new ko({check:`max_size`,...V(t),maximum:e})}function zd(e,t){return new Ao({check:`min_size`,...V(t),minimum:e})}function Bd(e,t){return new jo({check:`size_equals`,...V(t),size:e})}function Vd(e,t){return new Mo({check:`max_length`,...V(t),maximum:e})}function Hd(e,t){return new No({check:`min_length`,...V(t),minimum:e})}function Ud(e,t){return new Po({check:`length_equals`,...V(t),length:e})}function Wd(e,t){return new Io({check:`string_format`,format:`regex`,...V(t),pattern:e})}function Gd(e){return new Lo({check:`string_format`,format:`lowercase`,...V(e)})}function Kd(e){return new Ro({check:`string_format`,format:`uppercase`,...V(e)})}function qd(e,t){return new zo({check:`string_format`,format:`includes`,...V(t),includes:e})}function Jd(e,t){return new Bo({check:`string_format`,format:`starts_with`,...V(t),prefix:e})}function Yd(e,t){return new Vo({check:`string_format`,format:`ends_with`,...V(t),suffix:e})}function Xd(e,t,n){return new Uo({check:`property`,property:e,schema:t,...V(n)})}function Zd(e,t){return new Wo({check:`mime_type`,mime:e,...V(t)})}function Qd(e){return new Go({check:`overwrite`,tx:e})}function $d(e){return Qd(t=>t.normalize(e))}function ef(){return Qd(e=>e.trim())}function tf(){return Qd(e=>e.toLowerCase())}function nf(){return Qd(e=>e.toUpperCase())}function rf(e,t,n){return new e({type:`array`,element:t,...V(n)})}function af(e,t,n){return new e({type:`union`,options:t,...V(n)})}function of(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...V(r)})}function sf(e,t,n){return new e({type:`intersection`,left:t,right:n})}function cf(e,t,n,r){let i=n instanceof U;return new e({type:`tuple`,items:t,rest:i?n:null,...V(i?r:n)})}function lf(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...V(r)})}function uf(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...V(r)})}function df(e,t,n){return new e({type:`set`,valueType:t,...V(n)})}function ff(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...V(n)})}function pf(e,t,n){return new e({type:`enum`,entries:t,...V(n)})}function mf(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...V(n)})}function hf(e,t){return new e({type:`file`,...V(t)})}function gf(e,t){return new e({type:`transform`,transform:t})}function _f(e,t){return new e({type:`optional`,innerType:t})}function vf(e,t){return new e({type:`nullable`,innerType:t})}function yf(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():ni(n)}})}function bf(e,t,n){return new e({type:`nonoptional`,innerType:t,...V(n)})}function xf(e,t){return new e({type:`success`,innerType:t})}function Sf(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function Cf(e,t,n){return new e({type:`pipe`,in:t,out:n})}function wf(e,t){return new e({type:`readonly`,innerType:t})}function Tf(e,t,n){return new e({type:`template_literal`,parts:t,...V(n)})}function Ef(e,t){return new e({type:`lazy`,getter:t})}function Df(e,t){return new e({type:`promise`,innerType:t})}function Of(e,t,n){let r=V(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function kf(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...V(n)})}function Af(e){let t=jf(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Ei(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Ei(r))}},e(n.value,n)));return t}function jf(e,t){let n=new So({check:`custom`,...V(t)});return n._zod.check=e,n}function Mf(e,t){let n=V(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??vc,c=e.Boolean??ws,l=new s({type:`pipe`,in:new(e.String??Jo)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function Nf(e,t,n,r={}){let i=V(r),a={...V(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var Pf=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Au,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`||this.target===`draft-4`||this.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&this.target!==`draft-4`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&this.target!==`draft-4`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:this.target===`openapi-3.0`?(t.type=`string`,t.nullable=!0,t.enum=[null]):t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=this.target===`draft-2020-12`?`prefixItems`:`items`,o=this.target===`draft-2020-12`||this.target===`openapi-3.0`?`items`:`additionalItems`,s=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,a,t]})),c=r.rest?this.process(r.rest,{...n,path:[...n.path,o,...this.target===`openapi-3.0`?[r.items.length]:[]]}):null;this.target===`draft-2020-12`?(i.prefixItems=s,c&&(i.items=c)):this.target===`openapi-3.0`?(i.items={anyOf:s},c&&i.items.anyOf.push(c),i.minItems=s.length,c||(i.maxItems=s.length)):(i.items=s,c&&(i.additionalItems=c));let{minimum:l,maximum:u}=e._zod.bag;typeof l==`number`&&(i.minItems=l),typeof u==`number`&&(i.maxItems=u);break}case`record`:{let e=t;e.type=`object`,(this.target===`draft-7`||this.target===`draft-2020-12`)&&(e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]})),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=Lr(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,this.target===`draft-4`||this.target===`openapi-3.0`?e.enum=[t]:e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:{let e=this.process(r.innerType,n);this.target===`openapi-3.0`?(o.ref=r.innerType,t.nullable=!0):t.anyOf=[e,{type:`null`}];break}case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;case`function`:if(this.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`);break;default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&If(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>
23
+
24
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&(t.target===`draft-7`||t.target===`draft-4`||t.target===`openapi-3.0`)?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:this.target===`draft-4`?s.$schema=`http://json-schema.org/draft-04/schema#`:this.target===`openapi-3.0`||console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function Ff(e,t){if(e instanceof Ou){let n=new Pf(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new Pf(t);return n.process(e),n.emit(e,t)}function If(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:return!1;case`array`:return If(r.element,n);case`object`:for(let e in r.shape)if(If(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(If(e,n))return!0;return!1;case`intersection`:return If(r.left,n)||If(r.right,n);case`tuple`:for(let e of r.items)if(If(e,n))return!0;return!!(r.rest&&If(r.rest,n));case`record`:return If(r.keyType,n)||If(r.valueType,n);case`map`:return If(r.keyType,n)||If(r.valueType,n);case`set`:return If(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return If(r.innerType,n);case`lazy`:return If(r.getter(),n);case`default`:return If(r.innerType,n);case`prefault`:return If(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return If(r.in,n)||If(r.out,n);case`success`:return!1;case`catch`:return!1;case`function`:return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var Lf={},Rf=n({$ZodAny:()=>As,$ZodArray:()=>Is,$ZodAsyncError:()=>Dr,$ZodBase64:()=>hs,$ZodBase64URL:()=>_s,$ZodBigInt:()=>Ts,$ZodBigIntFormat:()=>Es,$ZodBoolean:()=>ws,$ZodCIDRv4:()=>fs,$ZodCIDRv6:()=>ps,$ZodCUID:()=>ts,$ZodCUID2:()=>ns,$ZodCatch:()=>mc,$ZodCheck:()=>So,$ZodCheckBigIntFormat:()=>Oo,$ZodCheckEndsWith:()=>Vo,$ZodCheckGreaterThan:()=>To,$ZodCheckIncludes:()=>zo,$ZodCheckLengthEquals:()=>Po,$ZodCheckLessThan:()=>wo,$ZodCheckLowerCase:()=>Lo,$ZodCheckMaxLength:()=>Mo,$ZodCheckMaxSize:()=>ko,$ZodCheckMimeType:()=>Wo,$ZodCheckMinLength:()=>No,$ZodCheckMinSize:()=>Ao,$ZodCheckMultipleOf:()=>Eo,$ZodCheckNumberFormat:()=>Do,$ZodCheckOverwrite:()=>Go,$ZodCheckProperty:()=>Uo,$ZodCheckRegex:()=>Io,$ZodCheckSizeEquals:()=>jo,$ZodCheckStartsWith:()=>Bo,$ZodCheckStringFormat:()=>Fo,$ZodCheckUpperCase:()=>Ro,$ZodCodec:()=>vc,$ZodCustom:()=>Dc,$ZodCustomStringFormat:()=>xs,$ZodDate:()=>Ps,$ZodDefault:()=>cc,$ZodDiscriminatedUnion:()=>Ws,$ZodE164:()=>vs,$ZodEmail:()=>Zo,$ZodEmoji:()=>$o,$ZodEncodeError:()=>Or,$ZodEnum:()=>tc,$ZodError:()=>Ii,$ZodFile:()=>rc,$ZodFunction:()=>wc,$ZodGUID:()=>Yo,$ZodIPv4:()=>us,$ZodIPv6:()=>ds,$ZodISODate:()=>ss,$ZodISODateTime:()=>os,$ZodISODuration:()=>ls,$ZodISOTime:()=>cs,$ZodIntersection:()=>Gs,$ZodJWT:()=>bs,$ZodKSUID:()=>as,$ZodLazy:()=>Ec,$ZodLiteral:()=>nc,$ZodMap:()=>Zs,$ZodNaN:()=>hc,$ZodNanoID:()=>es,$ZodNever:()=>Ms,$ZodNonOptional:()=>dc,$ZodNull:()=>ks,$ZodNullable:()=>sc,$ZodNumber:()=>Ss,$ZodNumberFormat:()=>Cs,$ZodObject:()=>Bs,$ZodObjectJIT:()=>Vs,$ZodOptional:()=>oc,$ZodPipe:()=>gc,$ZodPrefault:()=>uc,$ZodPromise:()=>Tc,$ZodReadonly:()=>xc,$ZodRealError:()=>Li,$ZodRecord:()=>Xs,$ZodRegistry:()=>Ou,$ZodSet:()=>$s,$ZodString:()=>Jo,$ZodStringFormat:()=>W,$ZodSuccess:()=>pc,$ZodSymbol:()=>Ds,$ZodTemplateLiteral:()=>Cc,$ZodTransform:()=>ic,$ZodTuple:()=>Js,$ZodType:()=>U,$ZodULID:()=>rs,$ZodURL:()=>Qo,$ZodUUID:()=>Xo,$ZodUndefined:()=>Os,$ZodUnion:()=>Us,$ZodUnknown:()=>js,$ZodVoid:()=>Ns,$ZodXID:()=>is,$brand:()=>Er,$constructor:()=>R,$input:()=>Du,$output:()=>Eu,Doc:()=>Ko,JSONSchema:()=>Lf,JSONSchemaGenerator:()=>Pf,NEVER:()=>Tr,TimePrecision:()=>td,_any:()=>Sd,_array:()=>rf,_base64:()=>Zu,_base64url:()=>Qu,_bigint:()=>hd,_boolean:()=>pd,_catch:()=>Sf,_check:()=>jf,_cidrv4:()=>Yu,_cidrv6:()=>Xu,_coercedBigint:()=>gd,_coercedBoolean:()=>md,_coercedDate:()=>Dd,_coercedNumber:()=>sd,_coercedString:()=>Mu,_cuid:()=>Hu,_cuid2:()=>Uu,_custom:()=>Of,_date:()=>Ed,_decode:()=>$i,_decodeAsync:()=>ra,_default:()=>yf,_discriminatedUnion:()=>of,_e164:()=>$u,_email:()=>Nu,_emoji:()=>Bu,_encode:()=>Zi,_encodeAsync:()=>ta,_endsWith:()=>Yd,_enum:()=>ff,_file:()=>hf,_float32:()=>ld,_float64:()=>ud,_gt:()=>jd,_gte:()=>Md,_guid:()=>Pu,_includes:()=>qd,_int:()=>cd,_int32:()=>dd,_int64:()=>_d,_intersection:()=>sf,_ipv4:()=>qu,_ipv6:()=>Ju,_isoDate:()=>rd,_isoDateTime:()=>nd,_isoDuration:()=>ad,_isoTime:()=>id,_jwt:()=>ed,_ksuid:()=>Ku,_lazy:()=>Ef,_length:()=>Ud,_literal:()=>mf,_lowercase:()=>Gd,_lt:()=>kd,_lte:()=>Ad,_map:()=>uf,_max:()=>Ad,_maxLength:()=>Vd,_maxSize:()=>Rd,_mime:()=>Zd,_min:()=>Md,_minLength:()=>Hd,_minSize:()=>zd,_multipleOf:()=>Ld,_nan:()=>Od,_nanoid:()=>Vu,_nativeEnum:()=>pf,_negative:()=>Pd,_never:()=>wd,_nonnegative:()=>Id,_nonoptional:()=>bf,_nonpositive:()=>Fd,_normalize:()=>$d,_null:()=>xd,_nullable:()=>vf,_number:()=>od,_optional:()=>_f,_overwrite:()=>Qd,_parse:()=>Ui,_parseAsync:()=>Gi,_pipe:()=>Cf,_positive:()=>Nd,_promise:()=>Df,_property:()=>Xd,_readonly:()=>wf,_record:()=>lf,_refine:()=>kf,_regex:()=>Wd,_safeDecode:()=>sa,_safeDecodeAsync:()=>da,_safeEncode:()=>aa,_safeEncodeAsync:()=>la,_safeParse:()=>qi,_safeParseAsync:()=>Yi,_set:()=>df,_size:()=>Bd,_startsWith:()=>Jd,_string:()=>ju,_stringFormat:()=>Nf,_stringbool:()=>Mf,_success:()=>xf,_superRefine:()=>Af,_symbol:()=>yd,_templateLiteral:()=>Tf,_toLowerCase:()=>tf,_toUpperCase:()=>nf,_transform:()=>gf,_trim:()=>ef,_tuple:()=>cf,_uint32:()=>fd,_uint64:()=>vd,_ulid:()=>Wu,_undefined:()=>bd,_union:()=>af,_unknown:()=>Cd,_uppercase:()=>Kd,_url:()=>zu,_uuid:()=>Fu,_uuidv4:()=>Iu,_uuidv6:()=>Lu,_uuidv7:()=>Ru,_void:()=>Td,_xid:()=>Gu,clone:()=>ci,config:()=>Ar,decode:()=>ea,decodeAsync:()=>ia,encode:()=>Qi,encodeAsync:()=>na,flattenError:()=>Ri,formatError:()=>zi,globalConfig:()=>kr,globalRegistry:()=>Au,isValidBase64:()=>ms,isValidBase64URL:()=>gs,isValidJWT:()=>ys,locales:()=>Tu,parse:()=>Wi,parseAsync:()=>Ki,prettifyError:()=>Hi,regexes:()=>pa,registry:()=>ku,safeDecode:()=>ca,safeDecodeAsync:()=>fa,safeEncode:()=>oa,safeEncodeAsync:()=>ua,safeParse:()=>Ji,safeParseAsync:()=>Xi,toDotPath:()=>Vi,toJSONSchema:()=>Ff,treeifyError:()=>Bi,util:()=>jr,version:()=>qo}),zf=n({ZodISODate:()=>Hf,ZodISODateTime:()=>Bf,ZodISODuration:()=>Kf,ZodISOTime:()=>Wf,date:()=>Uf,datetime:()=>Vf,duration:()=>qf,time:()=>Gf});const Bf=R(`ZodISODateTime`,(e,t)=>{os.init(e,t),q.init(e,t)});function Vf(e){return nd(Bf,e)}const Hf=R(`ZodISODate`,(e,t)=>{ss.init(e,t),q.init(e,t)});function Uf(e){return rd(Hf,e)}const Wf=R(`ZodISOTime`,(e,t)=>{cs.init(e,t),q.init(e,t)});function Gf(e){return id(Wf,e)}const Kf=R(`ZodISODuration`,(e,t)=>{ls.init(e,t),q.init(e,t)});function qf(e){return ad(Kf,e)}const Jf=(e,t)=>{Ii.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>zi(e,t)},flatten:{value:t=>Ri(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Rr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Rr,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yf=R(`ZodError`,Jf),Xf=R(`ZodError`,Jf,{Parent:Error}),Zf=Ui(Xf),Qf=Gi(Xf),$f=qi(Xf),ep=Yi(Xf),tp=Zi(Xf),np=$i(Xf),rp=ta(Xf),ip=ra(Xf),ap=aa(Xf),op=sa(Xf),sp=la(Xf),cp=da(Xf),G=R(`ZodType`,(e,t)=>(U.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(Kr(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>ci(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Zf(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>$f(e,t,n),e.parseAsync=async(t,n)=>Qf(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ep(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>tp(e,t,n),e.decode=(t,n)=>np(e,t,n),e.encodeAsync=async(t,n)=>rp(e,t,n),e.decodeAsync=async(t,n)=>ip(e,t,n),e.safeEncode=(t,n)=>ap(e,t,n),e.safeDecode=(t,n)=>op(e,t,n),e.safeEncodeAsync=async(t,n)=>sp(e,t,n),e.safeDecodeAsync=async(t,n)=>cp(e,t,n),e.refine=(t,n)=>e.check(Gh(t,n)),e.superRefine=t=>e.check(Kh(t)),e.overwrite=t=>e.check(Qd(t)),e.optional=()=>fh(e),e.nullable=()=>mh(e),e.nullish=()=>fh(mh(e)),e.nonoptional=t=>xh(e,t),e.array=()=>Im(e),e.or=t=>Hm([e,t]),e.and=t=>Km(e,t),e.transform=t=>kh(e,uh(t)),e.default=t=>_h(e,t),e.prefault=t=>yh(e,t),e.catch=t=>Th(e,t),e.pipe=t=>kh(e,t),e.readonly=()=>Nh(e),e.describe=t=>{let n=e.clone();return Au.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Au.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Au.get(e);let n=e.clone();return Au.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),lp=R(`_ZodString`,(e,t)=>{Jo.init(e,t),G.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Wd(...t)),e.includes=(...t)=>e.check(qd(...t)),e.startsWith=(...t)=>e.check(Jd(...t)),e.endsWith=(...t)=>e.check(Yd(...t)),e.min=(...t)=>e.check(Hd(...t)),e.max=(...t)=>e.check(Vd(...t)),e.length=(...t)=>e.check(Ud(...t)),e.nonempty=(...t)=>e.check(Hd(1,...t)),e.lowercase=t=>e.check(Gd(t)),e.uppercase=t=>e.check(Kd(t)),e.trim=()=>e.check(ef()),e.normalize=(...t)=>e.check($d(...t)),e.toLowerCase=()=>e.check(tf()),e.toUpperCase=()=>e.check(nf())}),up=R(`ZodString`,(e,t)=>{Jo.init(e,t),lp.init(e,t),e.email=t=>e.check(Nu(dp,t)),e.url=t=>e.check(zu(bp,t)),e.jwt=t=>e.check(ed(Zp,t)),e.emoji=t=>e.check(Bu(Cp,t)),e.guid=t=>e.check(Pu(pp,t)),e.uuid=t=>e.check(Fu(hp,t)),e.uuidv4=t=>e.check(Iu(hp,t)),e.uuidv6=t=>e.check(Lu(hp,t)),e.uuidv7=t=>e.check(Ru(hp,t)),e.nanoid=t=>e.check(Vu(Tp,t)),e.guid=t=>e.check(Pu(pp,t)),e.cuid=t=>e.check(Hu(Dp,t)),e.cuid2=t=>e.check(Uu(kp,t)),e.ulid=t=>e.check(Wu(jp,t)),e.base64=t=>e.check(Zu(Gp,t)),e.base64url=t=>e.check(Qu(qp,t)),e.xid=t=>e.check(Gu(Np,t)),e.ksuid=t=>e.check(Ku(Fp,t)),e.ipv4=t=>e.check(qu(Lp,t)),e.ipv6=t=>e.check(Ju(zp,t)),e.cidrv4=t=>e.check(Yu(Vp,t)),e.cidrv6=t=>e.check(Xu(Up,t)),e.e164=t=>e.check($u(Yp,t)),e.datetime=t=>e.check(Vf(t)),e.date=t=>e.check(Uf(t)),e.time=t=>e.check(Gf(t)),e.duration=t=>e.check(qf(t))});function K(e){return ju(up,e)}const q=R(`ZodStringFormat`,(e,t)=>{W.init(e,t),lp.init(e,t)}),dp=R(`ZodEmail`,(e,t)=>{Zo.init(e,t),q.init(e,t)});function fp(e){return Nu(dp,e)}const pp=R(`ZodGUID`,(e,t)=>{Yo.init(e,t),q.init(e,t)});function mp(e){return Pu(pp,e)}const hp=R(`ZodUUID`,(e,t)=>{Xo.init(e,t),q.init(e,t)});function gp(e){return Fu(hp,e)}function _p(e){return Iu(hp,e)}function vp(e){return Lu(hp,e)}function yp(e){return Ru(hp,e)}const bp=R(`ZodURL`,(e,t)=>{Qo.init(e,t),q.init(e,t)});function xp(e){return zu(bp,e)}function Sp(e){return zu(bp,{protocol:/^https?$/,hostname:Va,...V(e)})}const Cp=R(`ZodEmoji`,(e,t)=>{$o.init(e,t),q.init(e,t)});function wp(e){return Bu(Cp,e)}const Tp=R(`ZodNanoID`,(e,t)=>{es.init(e,t),q.init(e,t)});function Ep(e){return Vu(Tp,e)}const Dp=R(`ZodCUID`,(e,t)=>{ts.init(e,t),q.init(e,t)});function Op(e){return Hu(Dp,e)}const kp=R(`ZodCUID2`,(e,t)=>{ns.init(e,t),q.init(e,t)});function Ap(e){return Uu(kp,e)}const jp=R(`ZodULID`,(e,t)=>{rs.init(e,t),q.init(e,t)});function Mp(e){return Wu(jp,e)}const Np=R(`ZodXID`,(e,t)=>{is.init(e,t),q.init(e,t)});function Pp(e){return Gu(Np,e)}const Fp=R(`ZodKSUID`,(e,t)=>{as.init(e,t),q.init(e,t)});function Ip(e){return Ku(Fp,e)}const Lp=R(`ZodIPv4`,(e,t)=>{us.init(e,t),q.init(e,t)});function Rp(e){return qu(Lp,e)}const zp=R(`ZodIPv6`,(e,t)=>{ds.init(e,t),q.init(e,t)});function Bp(e){return Ju(zp,e)}const Vp=R(`ZodCIDRv4`,(e,t)=>{fs.init(e,t),q.init(e,t)});function Hp(e){return Yu(Vp,e)}const Up=R(`ZodCIDRv6`,(e,t)=>{ps.init(e,t),q.init(e,t)});function Wp(e){return Xu(Up,e)}const Gp=R(`ZodBase64`,(e,t)=>{hs.init(e,t),q.init(e,t)});function Kp(e){return Zu(Gp,e)}const qp=R(`ZodBase64URL`,(e,t)=>{_s.init(e,t),q.init(e,t)});function Jp(e){return Qu(qp,e)}const Yp=R(`ZodE164`,(e,t)=>{vs.init(e,t),q.init(e,t)});function Xp(e){return $u(Yp,e)}const Zp=R(`ZodJWT`,(e,t)=>{bs.init(e,t),q.init(e,t)});function Qp(e){return ed(Zp,e)}const $p=R(`ZodCustomStringFormat`,(e,t)=>{xs.init(e,t),q.init(e,t)});function em(e,t,n={}){return Nf($p,e,t,n)}function tm(e){return Nf($p,`hostname`,Ba,e)}function nm(e){return Nf($p,`hex`,ro,e)}function rm(e,t){let n=`${e}_${t?.enc??`hex`}`,r=pa[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return Nf($p,n,r,t)}const im=R(`ZodNumber`,(e,t)=>{Ss.init(e,t),G.init(e,t),e.gt=(t,n)=>e.check(jd(t,n)),e.gte=(t,n)=>e.check(Md(t,n)),e.min=(t,n)=>e.check(Md(t,n)),e.lt=(t,n)=>e.check(kd(t,n)),e.lte=(t,n)=>e.check(Ad(t,n)),e.max=(t,n)=>e.check(Ad(t,n)),e.int=t=>e.check(sm(t)),e.safe=t=>e.check(sm(t)),e.positive=t=>e.check(jd(0,t)),e.nonnegative=t=>e.check(Md(0,t)),e.negative=t=>e.check(kd(0,t)),e.nonpositive=t=>e.check(Ad(0,t)),e.multipleOf=(t,n)=>e.check(Ld(t,n)),e.step=(t,n)=>e.check(Ld(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function am(e){return od(im,e)}const om=R(`ZodNumberFormat`,(e,t)=>{Cs.init(e,t),im.init(e,t)});function sm(e){return cd(om,e)}function cm(e){return ld(om,e)}function lm(e){return ud(om,e)}function um(e){return dd(om,e)}function dm(e){return fd(om,e)}const fm=R(`ZodBoolean`,(e,t)=>{ws.init(e,t),G.init(e,t)});function pm(e){return pd(fm,e)}const mm=R(`ZodBigInt`,(e,t)=>{Ts.init(e,t),G.init(e,t),e.gte=(t,n)=>e.check(Md(t,n)),e.min=(t,n)=>e.check(Md(t,n)),e.gt=(t,n)=>e.check(jd(t,n)),e.gte=(t,n)=>e.check(Md(t,n)),e.min=(t,n)=>e.check(Md(t,n)),e.lt=(t,n)=>e.check(kd(t,n)),e.lte=(t,n)=>e.check(Ad(t,n)),e.max=(t,n)=>e.check(Ad(t,n)),e.positive=t=>e.check(jd(BigInt(0),t)),e.negative=t=>e.check(kd(BigInt(0),t)),e.nonpositive=t=>e.check(Ad(BigInt(0),t)),e.nonnegative=t=>e.check(Md(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(Ld(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function hm(e){return hd(mm,e)}const gm=R(`ZodBigIntFormat`,(e,t)=>{Es.init(e,t),mm.init(e,t)});function _m(e){return _d(gm,e)}function vm(e){return vd(gm,e)}const ym=R(`ZodSymbol`,(e,t)=>{Ds.init(e,t),G.init(e,t)});function bm(e){return yd(ym,e)}const xm=R(`ZodUndefined`,(e,t)=>{Os.init(e,t),G.init(e,t)});function Sm(e){return bd(xm,e)}const Cm=R(`ZodNull`,(e,t)=>{ks.init(e,t),G.init(e,t)});function wm(e){return xd(Cm,e)}const Tm=R(`ZodAny`,(e,t)=>{As.init(e,t),G.init(e,t)});function Em(){return Sd(Tm)}const Dm=R(`ZodUnknown`,(e,t)=>{js.init(e,t),G.init(e,t)});function Om(){return Cd(Dm)}const km=R(`ZodNever`,(e,t)=>{Ms.init(e,t),G.init(e,t)});function Am(e){return wd(km,e)}const jm=R(`ZodVoid`,(e,t)=>{Ns.init(e,t),G.init(e,t)});function Mm(e){return Td(jm,e)}const Nm=R(`ZodDate`,(e,t)=>{Ps.init(e,t),G.init(e,t),e.min=(t,n)=>e.check(Md(t,n)),e.max=(t,n)=>e.check(Ad(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Pm(e){return Ed(Nm,e)}const Fm=R(`ZodArray`,(e,t)=>{Is.init(e,t),G.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Hd(t,n)),e.nonempty=t=>e.check(Hd(1,t)),e.max=(t,n)=>e.check(Vd(t,n)),e.length=(t,n)=>e.check(Ud(t,n)),e.unwrap=()=>e.element});function Im(e,t){return rf(Fm,e,t)}function Lm(e){let t=e._zod.def.shape;return rh(Object.keys(t))}const Rm=R(`ZodObject`,(e,t)=>{Vs.init(e,t),G.init(e,t),B(e,`shape`,()=>t.shape),e.keyof=()=>rh(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Om()}),e.loose=()=>e.clone({...e._zod.def,catchall:Om()}),e.strict=()=>e.clone({...e._zod.def,catchall:Am()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>hi(e,t),e.safeExtend=t=>gi(e,t),e.merge=t=>_i(e,t),e.pick=t=>pi(e,t),e.omit=t=>mi(e,t),e.partial=(...t)=>vi(dh,e,t[0]),e.required=(...t)=>yi(bh,e,t[0])});function J(e,t){return new Rm({type:`object`,shape:e??{},...V(t)})}function zm(e,t){return new Rm({type:`object`,shape:e,catchall:Am(),...V(t)})}function Bm(e,t){return new Rm({type:`object`,shape:e,catchall:Om(),...V(t)})}const Vm=R(`ZodUnion`,(e,t)=>{Us.init(e,t),G.init(e,t),e.options=t.options});function Hm(e,t){return new Vm({type:`union`,options:e,...V(t)})}const Um=R(`ZodDiscriminatedUnion`,(e,t)=>{Vm.init(e,t),Ws.init(e,t)});function Wm(e,t,n){return new Um({type:`union`,options:t,discriminator:e,...V(n)})}const Gm=R(`ZodIntersection`,(e,t)=>{Gs.init(e,t),G.init(e,t)});function Km(e,t){return new Gm({type:`intersection`,left:e,right:t})}const qm=R(`ZodTuple`,(e,t)=>{Js.init(e,t),G.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Jm(e,t,n){let r=t instanceof U;return new qm({type:`tuple`,items:e,rest:r?t:null,...V(r?n:t)})}const Ym=R(`ZodRecord`,(e,t)=>{Xs.init(e,t),G.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Xm(e,t,n){return new Ym({type:`record`,keyType:e,valueType:t,...V(n)})}function Zm(e,t,n){let r=ci(e);return r._zod.values=void 0,new Ym({type:`record`,keyType:r,valueType:t,...V(n)})}const Qm=R(`ZodMap`,(e,t)=>{Zs.init(e,t),G.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function $m(e,t,n){return new Qm({type:`map`,keyType:e,valueType:t,...V(n)})}const eh=R(`ZodSet`,(e,t)=>{$s.init(e,t),G.init(e,t),e.min=(...t)=>e.check(zd(...t)),e.nonempty=t=>e.check(zd(1,t)),e.max=(...t)=>e.check(Rd(...t)),e.size=(...t)=>e.check(Bd(...t))});function th(e,t){return new eh({type:`set`,valueType:e,...V(t)})}const nh=R(`ZodEnum`,(e,t)=>{tc.init(e,t),G.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new nh({...t,checks:[],...V(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new nh({...t,checks:[],...V(r),entries:i})}});function rh(e,t){return new nh({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...V(t)})}function ih(e,t){return new nh({type:`enum`,entries:e,...V(t)})}const ah=R(`ZodLiteral`,(e,t)=>{nc.init(e,t),G.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function oh(e,t){return new ah({type:`literal`,values:Array.isArray(e)?e:[e],...V(t)})}const sh=R(`ZodFile`,(e,t)=>{rc.init(e,t),G.init(e,t),e.min=(t,n)=>e.check(zd(t,n)),e.max=(t,n)=>e.check(Rd(t,n)),e.mime=(t,n)=>e.check(Zd(Array.isArray(t)?t:[t],n))});function ch(e){return hf(sh,e)}const lh=R(`ZodTransform`,(e,t)=>{ic.init(e,t),G.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Or(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ei(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Ei(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function uh(e){return new lh({type:`transform`,transform:e})}const dh=R(`ZodOptional`,(e,t)=>{oc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fh(e){return new dh({type:`optional`,innerType:e})}const ph=R(`ZodNullable`,(e,t)=>{sc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function mh(e){return new ph({type:`nullable`,innerType:e})}function hh(e){return fh(mh(e))}const gh=R(`ZodDefault`,(e,t)=>{cc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _h(e,t){return new gh({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ni(t)}})}const vh=R(`ZodPrefault`,(e,t)=>{uc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yh(e,t){return new vh({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ni(t)}})}const bh=R(`ZodNonOptional`,(e,t)=>{dc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xh(e,t){return new bh({type:`nonoptional`,innerType:e,...V(t)})}const Sh=R(`ZodSuccess`,(e,t)=>{pc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ch(e){return new Sh({type:`success`,innerType:e})}const wh=R(`ZodCatch`,(e,t)=>{mc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Th(e,t){return new wh({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const Eh=R(`ZodNaN`,(e,t)=>{hc.init(e,t),G.init(e,t)});function Dh(e){return Od(Eh,e)}const Oh=R(`ZodPipe`,(e,t)=>{gc.init(e,t),G.init(e,t),e.in=t.in,e.out=t.out});function kh(e,t){return new Oh({type:`pipe`,in:e,out:t})}const Ah=R(`ZodCodec`,(e,t)=>{Oh.init(e,t),vc.init(e,t)});function jh(e,t,n){return new Ah({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const Mh=R(`ZodReadonly`,(e,t)=>{xc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Nh(e){return new Mh({type:`readonly`,innerType:e})}const Ph=R(`ZodTemplateLiteral`,(e,t)=>{Cc.init(e,t),G.init(e,t)});function Fh(e,t){return new Ph({type:`template_literal`,parts:e,...V(t)})}const Ih=R(`ZodLazy`,(e,t)=>{Ec.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Lh(e){return new Ih({type:`lazy`,getter:e})}const Rh=R(`ZodPromise`,(e,t)=>{Tc.init(e,t),G.init(e,t),e.unwrap=()=>e._zod.def.innerType});function zh(e){return new Rh({type:`promise`,innerType:e})}const Bh=R(`ZodFunction`,(e,t)=>{wc.init(e,t),G.init(e,t)});function Vh(e){return new Bh({type:`function`,input:Array.isArray(e?.input)?Jm(e?.input):e?.input??Im(Om()),output:e?.output??Om()})}const Hh=R(`ZodCustom`,(e,t)=>{Dc.init(e,t),G.init(e,t)});function Uh(e){let t=new So({check:`custom`});return t._zod.check=e,t}function Wh(e,t){return Of(Hh,e??(()=>!0),t)}function Gh(e,t={}){return kf(Hh,e,t)}function Kh(e){return Af(e)}function qh(e,t={error:`Input not instance of ${e.name}`}){let n=new Hh({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...V(t)});return n._zod.bag.Class=e,n}const Jh=(...e)=>Mf({Codec:Ah,Boolean:fm,String:up},...e);function Yh(e){let t=Lh(()=>Hm([K(e),am(),pm(),wm(),Im(t),Xm(K(),t)]));return t}function Xh(e,t){return kh(uh(e),t)}const Zh={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`};function Qh(e){Ar({customError:e})}function $h(){return Ar().customError}var eg;(function(e){})(eg||={});var tg=n({bigint:()=>ag,boolean:()=>ig,date:()=>og,number:()=>rg,string:()=>ng});function ng(e){return Mu(up,e)}function rg(e){return sd(im,e)}function ig(e){return md(fm,e)}function ag(e){return gd(mm,e)}function og(e){return Dd(Nm,e)}var sg=n({$brand:()=>Er,$input:()=>Du,$output:()=>Eu,NEVER:()=>Tr,TimePrecision:()=>td,ZodAny:()=>Tm,ZodArray:()=>Fm,ZodBase64:()=>Gp,ZodBase64URL:()=>qp,ZodBigInt:()=>mm,ZodBigIntFormat:()=>gm,ZodBoolean:()=>fm,ZodCIDRv4:()=>Vp,ZodCIDRv6:()=>Up,ZodCUID:()=>Dp,ZodCUID2:()=>kp,ZodCatch:()=>wh,ZodCodec:()=>Ah,ZodCustom:()=>Hh,ZodCustomStringFormat:()=>$p,ZodDate:()=>Nm,ZodDefault:()=>gh,ZodDiscriminatedUnion:()=>Um,ZodE164:()=>Yp,ZodEmail:()=>dp,ZodEmoji:()=>Cp,ZodEnum:()=>nh,ZodError:()=>Yf,ZodFile:()=>sh,ZodFirstPartyTypeKind:()=>eg,ZodFunction:()=>Bh,ZodGUID:()=>pp,ZodIPv4:()=>Lp,ZodIPv6:()=>zp,ZodISODate:()=>Hf,ZodISODateTime:()=>Bf,ZodISODuration:()=>Kf,ZodISOTime:()=>Wf,ZodIntersection:()=>Gm,ZodIssueCode:()=>Zh,ZodJWT:()=>Zp,ZodKSUID:()=>Fp,ZodLazy:()=>Ih,ZodLiteral:()=>ah,ZodMap:()=>Qm,ZodNaN:()=>Eh,ZodNanoID:()=>Tp,ZodNever:()=>km,ZodNonOptional:()=>bh,ZodNull:()=>Cm,ZodNullable:()=>ph,ZodNumber:()=>im,ZodNumberFormat:()=>om,ZodObject:()=>Rm,ZodOptional:()=>dh,ZodPipe:()=>Oh,ZodPrefault:()=>vh,ZodPromise:()=>Rh,ZodReadonly:()=>Mh,ZodRealError:()=>Xf,ZodRecord:()=>Ym,ZodSet:()=>eh,ZodString:()=>up,ZodStringFormat:()=>q,ZodSuccess:()=>Sh,ZodSymbol:()=>ym,ZodTemplateLiteral:()=>Ph,ZodTransform:()=>lh,ZodTuple:()=>qm,ZodType:()=>G,ZodULID:()=>jp,ZodURL:()=>bp,ZodUUID:()=>hp,ZodUndefined:()=>xm,ZodUnion:()=>Vm,ZodUnknown:()=>Dm,ZodVoid:()=>jm,ZodXID:()=>Np,_ZodString:()=>lp,_default:()=>_h,_function:()=>Vh,any:()=>Em,array:()=>Im,base64:()=>Kp,base64url:()=>Jp,bigint:()=>hm,boolean:()=>pm,catch:()=>Th,check:()=>Uh,cidrv4:()=>Hp,cidrv6:()=>Wp,clone:()=>ci,codec:()=>jh,coerce:()=>tg,config:()=>Ar,core:()=>Rf,cuid:()=>Op,cuid2:()=>Ap,custom:()=>Wh,date:()=>Pm,decode:()=>np,decodeAsync:()=>ip,discriminatedUnion:()=>Wm,e164:()=>Xp,email:()=>fp,emoji:()=>wp,encode:()=>tp,encodeAsync:()=>rp,endsWith:()=>Yd,enum:()=>rh,file:()=>ch,flattenError:()=>Ri,float32:()=>cm,float64:()=>lm,formatError:()=>zi,function:()=>Vh,getErrorMap:()=>$h,globalRegistry:()=>Au,gt:()=>jd,gte:()=>Md,guid:()=>mp,hash:()=>rm,hex:()=>nm,hostname:()=>tm,httpUrl:()=>Sp,includes:()=>qd,instanceof:()=>qh,int:()=>sm,int32:()=>um,int64:()=>_m,intersection:()=>Km,ipv4:()=>Rp,ipv6:()=>Bp,iso:()=>zf,json:()=>Yh,jwt:()=>Qp,keyof:()=>Lm,ksuid:()=>Ip,lazy:()=>Lh,length:()=>Ud,literal:()=>oh,locales:()=>Tu,looseObject:()=>Bm,lowercase:()=>Gd,lt:()=>kd,lte:()=>Ad,map:()=>$m,maxLength:()=>Vd,maxSize:()=>Rd,mime:()=>Zd,minLength:()=>Hd,minSize:()=>zd,multipleOf:()=>Ld,nan:()=>Dh,nanoid:()=>Ep,nativeEnum:()=>ih,negative:()=>Pd,never:()=>Am,nonnegative:()=>Id,nonoptional:()=>xh,nonpositive:()=>Fd,normalize:()=>$d,null:()=>wm,nullable:()=>mh,nullish:()=>hh,number:()=>am,object:()=>J,optional:()=>fh,overwrite:()=>Qd,parse:()=>Zf,parseAsync:()=>Qf,partialRecord:()=>Zm,pipe:()=>kh,positive:()=>Nd,prefault:()=>yh,preprocess:()=>Xh,prettifyError:()=>Hi,promise:()=>zh,property:()=>Xd,readonly:()=>Nh,record:()=>Xm,refine:()=>Gh,regex:()=>Wd,regexes:()=>pa,registry:()=>ku,safeDecode:()=>op,safeDecodeAsync:()=>cp,safeEncode:()=>ap,safeEncodeAsync:()=>sp,safeParse:()=>$f,safeParseAsync:()=>ep,set:()=>th,setErrorMap:()=>Qh,size:()=>Bd,startsWith:()=>Jd,strictObject:()=>zm,string:()=>K,stringFormat:()=>em,stringbool:()=>Jh,success:()=>Ch,superRefine:()=>Kh,symbol:()=>bm,templateLiteral:()=>Fh,toJSONSchema:()=>Ff,toLowerCase:()=>tf,toUpperCase:()=>nf,transform:()=>uh,treeifyError:()=>Bi,trim:()=>ef,tuple:()=>Jm,uint32:()=>dm,uint64:()=>vm,ulid:()=>Mp,undefined:()=>Sm,union:()=>Hm,unknown:()=>Om,uppercase:()=>Kd,url:()=>xp,util:()=>jr,uuid:()=>gp,uuidv4:()=>_p,uuidv6:()=>vp,uuidv7:()=>yp,void:()=>Mm,xid:()=>Pp});Ar(Yc());var cg=sg;function lg(){return`${process.env.NODE_ENV===`production`?`build/`:``}appos`}function ug(){return process.env.NODE_ENV!==`production`&&!process.env.VITEST}l(process.cwd(),lg(),`public`,`openapi`);function dg(e){let t={};for(let[n,r]of Object.entries(e)){let e=Number(n),r=fg(e);r&&(t[r]=t=>({__response:!0,status:e,data:t??null}))}return t.status=(e,t)=>({__response:!0,status:Number(e),data:t??null}),t}function fg(e){return{200:`ok`,201:`created`,202:`accepted`,204:`noContent`,400:`badRequest`,401:`unauthorized`,403:`forbidden`,404:`notFound`,409:`conflict`,422:`unprocessableEntity`,500:`internalServerError`}[e]||null}function pg(e){return e}function mg(e,t){return e?e.parse(t):t}function hg(e,t){let n={};for(let[e,r]of t.searchParams.entries()){let t=n[e];t===void 0?n[e]=r:Array.isArray(t)?t.push(r):n[e]=[t,r]}return e?e.parse(n):n}function gg(e,t){let n=t.body;return e?e.parse(n):n}function _g(e,t){let n=t.headers;return e?e.parse(n):n}function vg(e){switch(e){case`params`:case`query`:case`headers`:return 400;case`body`:return 422;default:return 400}}function yg(e,t){let n=vg(t);return{__response:!0,status:n,data:{error:`validation_error`,status:n,detail:`Request validation failed`,errors:e.issues.map(e=>({field:e.path.join(`.`),message:e.message,received:`received`in e?e.received:e.input}))}}}function bg(e,t){return async(n,r,i)=>{try{let t=new URL(n.url||`/`,`http://${n.headers.host}`),i=mg(e.parameters,n.params),a=hg(e.query,t),o=gg(e.requestBody,n),s=_g(e.headers,n),c=dg(e.responses),l=await e.handler({request:n,params:i,context:n.app.locals,body:o,query:a,headers:s,response:c});if(l&&typeof l==`object`&&`__response`in l){let e=l;e.data===null||e.data===void 0?r.status(e.status).end():r.status(e.status).json(e.data)}else r.status(200).json(l)}catch(e){if(e instanceof Yf){let n=yg(e,t===`GET`||t===`HEAD`?`query`:`body`);r.status(n.status).json(n.data)}else i(e)}}}function xg(e){let t=[];for(let n of[`GET`,`HEAD`,`POST`,`PUT`,`PATCH`,`DELETE`]){let r=e[n];if(!r)continue;let i={};r.parameters&&(i.params=r.parameters),r.query&&(i.query=r.query),r.requestBody&&(i.body=r.requestBody),r.headers&&(i.headers=r.headers);let a={};for(let[e,t]of Object.entries(r.responses))a[Number(e)]={description:t.description,content:{"application/json":{schema:t.schema}}};t.push({method:n.toLowerCase(),summary:r.summary,description:r.description,request:Object.keys(i).length>0?i:void 0,responses:a})}return t}function Sg(e){let t={};for(let n of[`GET`,`HEAD`,`POST`,`PUT`,`PATCH`,`DELETE`]){let r=e[n];r&&(t[n]=bg(r,n))}return{handlers:t,openAPISpec:xg(e)}}function Cg(e){return t=>{let n=e(t);return{info:n.info,servers:n.servers,openapi:`3.1.0`}}}function wg(){let e=yr(`storage_blobs`,e=>({id:e.text(`id`).primaryKey().default(P`uuidv7()`),key:e.text(`key`).notNull().unique(),filename:e.text(`filename`).notNull(),contentType:e.text(`content_type`),metadata:e.jsonb(`metadata`),serviceName:e.text(`service_name`).notNull().default(`private`),byteSize:e.bigint(`byte_size`,{mode:`number`}).notNull(),checksum:e.text(`checksum`),createdAt:e.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[Cr(`storage_blobs_key_idx`).on(e.key),Cr(`storage_blobs_service_name_idx`).on(e.serviceName)]);return{tables:{storageBlobs:e,storageAttachments:yr(`storage_attachments`,t=>({id:t.text(`id`).primaryKey().default(P`uuidv7()`),name:t.text(`name`).notNull(),recordType:t.text(`record_type`).notNull(),recordId:t.text(`record_id`).notNull(),blobId:t.text(`blob_id`).notNull().references(()=>e.id,{onDelete:`cascade`}),createdAt:t.timestamp(`created_at`,{withTimezone:!0}).notNull().default(P`NOW()`)}),e=>[Cr(`storage_attachments_record_idx`).on(e.recordType,e.recordId),Cr(`storage_attachments_blob_id_idx`).on(e.blobId)]),storageVariantRecords:yr(`storage_variant_records`,t=>({id:t.text(`id`).primaryKey().default(P`uuidv7()`),blobId:t.text(`blob_id`).notNull().references(()=>e.id,{onDelete:`cascade`}),variationDigest:t.text(`variation_digest`).notNull(),createdAt:t.timestamp(`created_at`,{withTimezone:!0}).default(P`NOW()`).notNull()}),e=>[Cr(`storage_variant_records_blob_id_idx`).on(e.blobId),S(`storage_variant_records_unique`).on(e.blobId,e.variationDigest)])},relations:e=>({storageBlobs:{attachments:e.many.storageAttachments({from:e.storageBlobs.id,to:e.storageAttachments.blobId}),variantRecords:e.many.storageVariantRecords({from:e.storageBlobs.id,to:e.storageVariantRecords.blobId})},storageAttachments:{blob:e.one.storageBlobs({from:e.storageAttachments.blobId,to:e.storageBlobs.id})},storageVariantRecords:{blob:e.one.storageBlobs({from:e.storageVariantRecords.blobId,to:e.storageBlobs.id})}})}}wg();const Tg={PARSE_ERROR:-32700,BAD_REQUEST:-32600,INTERNAL_SERVER_ERROR:-32603,NOT_IMPLEMENTED:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603,UNAUTHORIZED:-32001,PAYMENT_REQUIRED:-32002,FORBIDDEN:-32003,NOT_FOUND:-32004,METHOD_NOT_SUPPORTED:-32005,TIMEOUT:-32008,CONFLICT:-32009,PRECONDITION_FAILED:-32012,PAYLOAD_TOO_LARGE:-32013,UNSUPPORTED_MEDIA_TYPE:-32015,UNPROCESSABLE_CONTENT:-32022,PRECONDITION_REQUIRED:-32028,TOO_MANY_REQUESTS:-32029,CLIENT_CLOSED_REQUEST:-32099};Tg.BAD_GATEWAY,Tg.SERVICE_UNAVAILABLE,Tg.GATEWAY_TIMEOUT,Tg.INTERNAL_SERVER_ERROR;function Eg(e,...t){let n=Object.assign(Object.create(null),e);for(let e of t)for(let t in e){if(t in n&&n[t]!==e[t])throw Error(`Duplicate key ${t}`);n[t]=e[t]}return n}function Dg(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function Og(e){return typeof e==`function`}function kg(e){return Object.assign(Object.create(null),e)}const Ag=typeof Symbol==`function`&&!!Symbol.asyncIterator;function jg(e){return Ag&&Dg(e)&&Symbol.asyncIterator in e}var Mg=Object.create,Ng=Object.defineProperty,Pg=Object.getOwnPropertyDescriptor,Fg=Object.getOwnPropertyNames,Ig=Object.getPrototypeOf,Lg=Object.prototype.hasOwnProperty,Rg=(e,t)=>function(){return t||(0,e[Fg(e)[0]])((t={exports:{}}).exports,t),t.exports},zg=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Fg(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Lg.call(e,s)&&s!==n&&Ng(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Pg(t,s))||r.enumerable});return e},Bg=(e,t,n)=>(n=e==null?{}:Mg(Ig(e)),zg(t||!e||!e.__esModule?Ng(n,`default`,{value:e,enumerable:!0}):n,e));const Vg=()=>{},Hg=e=>{Object.freeze&&Object.freeze(e)};function Ug(e,t,n){let r=t.join(`.`);return n[r]??(n[r]=new Proxy(Vg,{get(r,i){if(!(typeof i!=`string`||i===`then`))return Ug(e,[...t,i],n)},apply(n,r,i){let a=t[t.length-1],o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),Hg(o.args),Hg(o.path),e(o)}})),n[r]}const Wg=e=>Ug(e,[],Object.create(null)),Gg=e=>new Proxy(Vg,{get(t,n){if(n!==`then`)return e(n)}});var Kg=Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),qg=Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=Kg().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Jg=Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=Kg().default,r=qg();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),Yg=Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=Jg();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),Xg=Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Yg();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});Bg(Xg(),1);const Zg=({shape:e})=>e;var Qg=Bg(Yg(),1),$g=class extends Error{};function e_(e){if(e instanceof Error)return e;let t=typeof e;if(!(t===`undefined`||t===`function`||e===null)){if(t!==`object`)return Error(String(e));if(Dg(e))return Object.assign(new $g,e)}}function t_(e){if(e instanceof n_||e instanceof Error&&e.name===`TRPCError`)return e;let t=new n_({code:`INTERNAL_SERVER_ERROR`,cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}var n_=class extends Error{constructor(e){let t=e_(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),(0,Qg.default)(this,`cause`,void 0),(0,Qg.default)(this,`code`,void 0),this.code=e.code,this.name=`TRPCError`,this.cause??=t}};Bg(Xg(),1);function r_(e){return`input`in e?e:{input:e,output:e}}const i_={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}};var a_=Bg(Xg(),1);function o_(e){let t=Symbol(),n=t;return()=>(n===t&&(n=e()),n)}function s_(e){return typeof e==`function`&&`lazyMarker`in e}function c_(e){return Dg(e)&&Dg(e._def)&&`router`in e._def}const l_={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Zg,transformer:i_},u_=[`then`,`call`,`apply`];function d_(e){function t(t){let n=new Set(Object.keys(t).filter(e=>u_.includes(e)));if(n.size>0)throw Error("Reserved words used in `router({})` call: "+Array.from(n).join(`, `));let r=kg({}),i=kg({});function a(e){return{ref:e.ref,load:o_(async()=>{let t=await e.ref(),n=[...e.path,e.key],r=n.join(`.`);e.aggregate[e.key]=o(t._def.record,n),delete i[r];for(let[r,o]of Object.entries(t._def.lazy)){let t=[...n,r].join(`.`);i[t]=a({ref:o.ref,path:n,key:r,aggregate:e.aggregate[e.key]})}})}}function o(e,t=[]){let n=kg({});for(let[s,c]of Object.entries(e??{})){if(s_(c)){i[[...t,s].join(`.`)]=a({path:t,ref:c,key:s,aggregate:n});continue}if(c_(c)){n[s]=o(c._def.record,[...t,s]);continue}if(!f_(c)){n[s]=o(c,[...t,s]);continue}let e=[...t,s].join(`.`);if(r[e])throw Error(`Duplicate key: ${e}`);r[e]=c,n[s]=c}return n}let s=o(t),c=(0,a_.default)((0,a_.default)({_config:e,router:!0,procedures:r,lazy:i},l_),{},{record:s});return(0,a_.default)((0,a_.default)({},s),{},{_def:c,createCaller:m_()({_def:c})})}return t}function f_(e){return typeof e==`function`}async function p_(e,t){let{_def:n}=e,r=n.procedures[t];for(;!r;){let e=Object.keys(n.lazy).find(e=>t.startsWith(e));if(!e)return null;await n.lazy[e].load(),r=n.procedures[t]}return r}function m_(){return function(e){let{_def:t}=e;return function(n,r){return Wg(async i=>{let{path:a,args:o}=i,s=a.join(`.`);if(a.length===1&&a[0]===`_def`)return t;let c=await p_(e,s),l;try{if(!c)throw new n_({code:`NOT_FOUND`,message:`No procedure found on path "${a}"`});return l=Og(n)?await Promise.resolve(n()):n,await c({path:s,getRawInput:async()=>o[0],ctx:l,type:c._def.type,signal:r?.signal})}catch(e){var u;throw r==null||(u=r.onError)==null||u.call(r,{ctx:l,error:t_(e),input:o[0],path:s,type:c?._def.type??`unknown`}),e}})}}}function h_(...e){let t=Eg({},...e.map(e=>e._def.record));return d_({errorFormatter:e.reduce((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==Zg){if(e!==Zg&&e!==t._def._config.errorFormatter)throw Error(`You seem to have several error formatters`);return t._def._config.errorFormatter}return e},Zg),transformer:e.reduce((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==i_){if(e!==i_&&e!==t._def._config.transformer)throw Error(`You seem to have several transformers`);return t._def._config.transformer}return e},i_),isDev:e.every(e=>e._def._config.isDev),allowOutsideOfServer:e.every(e=>e._def._config.allowOutsideOfServer),isServer:e.every(e=>e._def._config.isServer),$types:e[0]?._def._config.$types})(t)}var g_=Bg(Xg(),1);const __=`middlewareMarker`;function v_(){function e(t){return{_middlewares:t,unstable_pipe(n){let r=`_middlewares`in n?n._middlewares:[n];return e([...t,...r])}}}function t(t){return e([t])}return t}function y_(e){let t=async function(t){let n,r=await t.getRawInput();try{n=await e(r)}catch(e){throw new n_({code:`BAD_REQUEST`,cause:e})}let i=Dg(t.input)&&Dg(n)?(0,g_.default)((0,g_.default)({},t.input),n):n;return t.next({input:i})};return t._type=`input`,t}function b_(e){let t=async function({next:t}){let n=await t();if(!n.ok)return n;try{let t=await e(n.data);return(0,g_.default)((0,g_.default)({},n),{},{data:t})}catch(e){throw new n_({message:`Output validation failed`,code:`INTERNAL_SERVER_ERROR`,cause:e})}};return t._type=`output`,t}var x_=Bg(Yg(),1),S_=class extends Error{constructor(e){super(e[0]?.message),(0,x_.default)(this,`issues`,void 0),this.name=`SchemaError`,this.issues=e}};function C_(e){let t=e,n=`~standard`in t;if(typeof t==`function`&&typeof t.assert==`function`)return t.assert.bind(t);if(typeof t==`function`&&!n)return t;if(typeof t.parseAsync==`function`)return t.parseAsync.bind(t);if(typeof t.parse==`function`)return t.parse.bind(t);if(typeof t.validateSync==`function`)return t.validateSync.bind(t);if(typeof t.create==`function`)return t.create.bind(t);if(typeof t.assert==`function`)return e=>(t.assert(e),e);if(n)return async e=>{let n=await t[`~standard`].validate(e);if(n.issues)throw new S_(n.issues);return n.value};throw Error(`Could not find a validator fn`)}var w_=Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),T_=Bg(Rg({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=w_();function r(e,t){if(e==null)return{};var r,i,a=n(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),E_=Bg(Xg(),1);const D_=[`middlewares`,`inputs`,`meta`];function O_(e,t){let{middlewares:n=[],inputs:r,meta:i}=t,a=(0,T_.default)(t,D_);return k_((0,E_.default)((0,E_.default)({},Eg(e,a)),{},{inputs:[...e.inputs,...r??[]],middlewares:[...e.middlewares,...n],meta:e.meta&&i?(0,E_.default)((0,E_.default)({},e.meta),i):i??e.meta}))}function k_(e={}){let t=(0,E_.default)({procedure:!0,inputs:[],middlewares:[]},e);return{_def:t,input(e){let n=C_(e);return O_(t,{inputs:[e],middlewares:[y_(n)]})},output(e){return O_(t,{output:e,middlewares:[b_(C_(e))]})},meta(e){return O_(t,{meta:e})},use(e){return O_(t,{middlewares:`_middlewares`in e?e._middlewares:[e]})},unstable_concat(e){return O_(t,e._def)},concat(e){return O_(t,e._def)},query(e){return A_((0,E_.default)((0,E_.default)({},t),{},{type:`query`}),e)},mutation(e){return A_((0,E_.default)((0,E_.default)({},t),{},{type:`mutation`}),e)},subscription(e){return A_((0,E_.default)((0,E_.default)({},t),{},{type:`subscription`}),e)},experimental_caller(e){return O_(t,{caller:e})}}}function A_(e,t){let n=O_(e,{resolver:t,middlewares:[async function(e){return{marker:__,ok:!0,data:await t(e),ctx:e.ctx}}]}),r=(0,E_.default)((0,E_.default)({},n._def),{},{type:e.type,experimental_caller:!!n._def.caller,meta:n._def.meta,$types:null}),i=M_(n._def),a=n._def.caller;if(!a)return i;let o=async(...e)=>await a({args:e,invoke:i,_def:r});return o._def=r,o}async function j_(e,t,n){try{let r=t.middlewares[e];return await r((0,E_.default)((0,E_.default)({},n),{},{meta:t.meta,input:n.input,next(r){let i=r;return j_(e+1,t,(0,E_.default)((0,E_.default)({},n),{},{ctx:i?.ctx?(0,E_.default)((0,E_.default)({},n.ctx),i.ctx):n.ctx,input:i&&`input`in i?i.input:n.input,getRawInput:i?.getRawInput??n.getRawInput}))}}))}catch(e){return{ok:!1,error:t_(e),marker:__}}}function M_(e){async function t(t){if(!t||!(`getRawInput`in t))throw Error(`This is a client-only function.
25
+ If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls`);let n=await j_(0,e,t);if(!n)throw new n_({code:`INTERNAL_SERVER_ERROR`,message:"No result from middlewares - did you forget to `return next()`?"});if(!n.ok)throw n.error;return n.data}return t._def=e,t.procedure=!0,t.meta=e.meta,t}var N_,P_,F_;const I_=typeof window>`u`||`Deno`in window||((N_=globalThis.process)==null||(N_=N_.env)==null?void 0:N_.NODE_ENV)===`test`||!!(!((P_=globalThis.process)==null||(P_=P_.env)==null)&&P_.JEST_WORKER_ID)||!!(!((F_=globalThis.process)==null||(F_=F_.env)==null)&&F_.VITEST_WORKER_ID);var L_=Bg(Xg(),1);const R_=new class e{context(){return new e}meta(){return new e}create(e){let t=(0,L_.default)((0,L_.default)({},e),{},{transformer:r_(e?.transformer??i_),isDev:e?.isDev??globalThis.process?.env.NODE_ENV!==`production`,allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??Zg,isServer:e?.isServer??I_,$types:null});if(!(e?.isServer??I_)&&e?.allowOutsideOfServer!==!0)throw Error(`You're trying to use @trpc/server in a non-server environment. This is not supported by default.`);return{_config:t,procedure:k_({meta:e?.defaultMeta}),middleware:v_(),router:d_(t),mergeRouters:h_,createCallerFactory:m_()}}};var z_=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},B_=class{constructor(e){this.generateIdentifier=e,this.kv=new z_}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},V_=class extends B_{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function H_(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function U_(e,t){let n=H_(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function W_(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function G_(e,t){return e.indexOf(t)!==-1}function K_(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var q_=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return U_(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}};const J_=e=>Object.prototype.toString.call(e).slice(8,-1),Y_=e=>e===void 0,X_=e=>e===null,Z_=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Q_=e=>Z_(e)&&Object.keys(e).length===0,$_=e=>Array.isArray(e),ev=e=>typeof e==`string`,tv=e=>typeof e==`number`&&!isNaN(e),nv=e=>typeof e==`boolean`,rv=e=>e instanceof RegExp,iv=e=>e instanceof Map,av=e=>e instanceof Set,ov=e=>J_(e)===`Symbol`,sv=e=>e instanceof Date&&!isNaN(e.valueOf()),cv=e=>e instanceof Error,lv=e=>typeof e==`number`&&isNaN(e),uv=e=>nv(e)||X_(e)||Y_(e)||tv(e)||ev(e)||ov(e),dv=e=>typeof e==`bigint`,fv=e=>e===1/0||e===-1/0,pv=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),mv=e=>e instanceof URL,hv=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),gv=e=>e.map(String).map(hv).join(`.`),_v=(e,t)=>{let n=[],r=``;for(let i=0;i<e.length;i++){let a=e.charAt(i);if(!t&&a===`\\`){let t=e.charAt(i+1);if(t===`\\`){r+=`\\`,i++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(a===`\\`&&e.charAt(i+1)===`.`){r+=`.`,i++;continue}if(a===`.`){n.push(r),r=``;continue}r+=a}let i=r;return n.push(i),n};function vv(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const yv=[vv(Y_,`undefined`,()=>null,()=>void 0),vv(dv,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),vv(sv,`Date`,e=>e.toISOString(),e=>new Date(e)),vv(cv,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),vv(rv,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),vv(av,`set`,e=>[...e.values()],e=>new Set(e)),vv(iv,`map`,e=>[...e.entries()],e=>new Map(e)),vv(e=>lv(e)||fv(e),`number`,e=>lv(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),vv(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),vv(mv,`URL`,e=>e.toString(),e=>new URL(e))];function bv(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}const xv=bv((e,t)=>ov(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),Sv=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),Cv=bv(pv,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=Sv[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function wv(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}const Tv=bv(wv,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),Ev=bv((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),Dv=[Tv,xv,Ev,Cv],Ov=(e,t)=>{let n=K_(Dv,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=K_(yv,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},kv={};yv.forEach(e=>{kv[e.annotation]=e});const Av=(e,t,n)=>{if($_(t))switch(t[0]){case`symbol`:return xv.untransform(e,t,n);case`class`:return Tv.untransform(e,t,n);case`custom`:return Ev.untransform(e,t,n);case`typed-array`:return Cv.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=kv[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},jv=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function Mv(e){if(G_(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(G_(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(G_(e,`constructor`))throw Error(`constructor is not allowed as a property`)}const Nv=(e,t)=>{Mv(t);for(let n=0;n<t.length;n++){let r=t[n];if(av(e))e=jv(e,+r);else if(iv(e)){let i=+r,a=+t[++n]==0?`key`:`value`,o=jv(e,i);switch(a){case`key`:e=o;break;case`value`:e=e.get(o);break}}else e=e[r]}return e},Pv=(e,t,n)=>{if(Mv(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if($_(r)){let e=+n;r=r[e]}else if(Z_(r))r=r[n];else if(av(r)){let e=+n;r=jv(r,e)}else if(iv(r)){if(e===t.length-2)break;let i=+n,a=+t[++e]==0?`key`:`value`,o=jv(r,i);switch(a){case`key`:r=o;break;case`value`:r=r.get(o);break}}}let i=t[t.length-1];if($_(r)?r[+i]=n(r[+i]):Z_(r)&&(r[i]=n(r[i])),av(r)){let e=jv(r,+i),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(iv(r)){let e=+t[t.length-2],a=jv(r,e);switch(+i==0?`key`:`value`){case`key`:{let e=n(a);r.set(e,r.get(a)),e!==a&&r.delete(a);break}case`value`:r.set(a,n(r.get(a)));break}}return e},Fv=e=>e<1;function Iv(e,t,n,r=[]){if(!e)return;let i=Fv(n);if(!$_(e)){W_(e,(e,a)=>Iv(e,t,n,[...r,..._v(a,i)]));return}let[a,o]=e;o&&W_(o,(e,a)=>{Iv(e,t,n,[...r,..._v(a,i)])}),t(a,r)}function Lv(e,t,n,r){return Iv(t,(t,n)=>{e=Pv(e,n,e=>Av(e,t,r))},n),e}function Rv(e,t,n){let r=Fv(n);function i(t,n){let i=Nv(e,_v(n,r));t.map(e=>_v(e,r)).forEach(t=>{e=Pv(e,t,()=>i)})}if($_(t)){let[n,a]=t;n.forEach(t=>{e=Pv(e,_v(t,r),()=>e)}),a&&W_(a,i)}else W_(t,i);return e}const zv=(e,t)=>Z_(e)||$_(e)||iv(e)||av(e)||cv(e)||wv(e,t);function Bv(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function Vv(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[i,...a]=e;i.length===0?r=a.map(gv):n[gv(i)]=a.map(gv)}),r?Q_(n)?[r]:[r,n]:Q_(n)?void 0:n}const Hv=(e,t,n,r,i=[],a=[],o=new Map)=>{let s=uv(e);if(!s){Bv(e,i,t);let n=o.get(e);if(n)return r?{transformedValue:null}:n}if(!zv(e,n)){let t=Ov(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return s||o.set(e,r),r}if(G_(a,e))return{transformedValue:null};let c=Ov(e,n),l=c?.value??e,u=$_(l)?[]:{},d={};W_(l,(s,c)=>{if(c===`__proto__`||c===`constructor`||c===`prototype`)throw Error(`Detected property ${c}. This is a prototype pollution risk, please remove it from your object.`);let l=Hv(s,t,n,r,[...i,c],[...a,e],o);u[c]=l.transformedValue,$_(l.annotations)?d[hv(c)]=l.annotations:Z_(l.annotations)&&W_(l.annotations,(e,t)=>{d[hv(c)+`.`+t]=e})});let f=Q_(d)?{transformedValue:u,annotations:c?[c.type]:void 0}:{transformedValue:u,annotations:c?[c.type,d]:d};return s||o.set(e,f),f};function Uv(e){return Object.prototype.toString.call(e).slice(8,-1)}function Wv(e){return Uv(e)===`Array`}function Gv(e){if(Uv(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Kv(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function qv(e,t={}){if(Wv(e))return e.map(e=>qv(e,t));if(!Gv(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||Wv(t.props)&&!t.props.includes(r))return n;let i=e[r];return Kv(n,r,qv(i,t),e,t.nonenumerable),n},{})}var Y=class{constructor({dedupe:e=!1}={}){this.classRegistry=new V_,this.symbolRegistry=new B_(e=>e.description??``),this.customTransformerRegistry=new q_,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=Hv(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let i=Vv(t,this.dedupe);return i&&(r.meta={...r.meta,referentialEqualities:i}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,i=t?.inPlace?n:qv(n);return r?.values&&(i=Lv(i,r.values,r.v??0,this)),r?.referentialEqualities&&(i=Rv(i,r.referentialEqualities,r.v??0)),i}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};Y.defaultInstance=new Y,Y.serialize=Y.defaultInstance.serialize.bind(Y.defaultInstance),Y.deserialize=Y.defaultInstance.deserialize.bind(Y.defaultInstance),Y.stringify=Y.defaultInstance.stringify.bind(Y.defaultInstance),Y.parse=Y.defaultInstance.parse.bind(Y.defaultInstance),Y.registerClass=Y.defaultInstance.registerClass.bind(Y.defaultInstance),Y.registerSymbol=Y.defaultInstance.registerSymbol.bind(Y.defaultInstance),Y.registerCustom=Y.defaultInstance.registerCustom.bind(Y.defaultInstance),Y.allowErrorProps=Y.defaultInstance.allowErrorProps.bind(Y.defaultInstance),Y.serialize,Y.deserialize,Y.stringify,Y.parse,Y.registerClass,Y.registerCustom,Y.registerSymbol,Y.allowErrorProps;const Jv=R_.context().create({transformer:Y,errorFormatter({shape:e}){return e}}),Yv=Jv.router,Xv=Jv.middleware,Zv=Jv.procedure,Qv=Jv.procedure.use(({ctx:e,next:t})=>t({ctx:e})),$v=Qv.use(({ctx:e,next:t})=>t({ctx:e})),ey=Qv.use(({ctx:e,next:t})=>t({ctx:e})),ty=e=>Zv.use(e);var ny=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getDBOSErrorCode=e.DBOSInvalidQueuePriorityError=e.DBOSQueueDuplicatedError=e.QueueDedupIDDuplicated=e.DBOSAwaitedWorkflowCancelledError=e.DBOSUnexpectedStepError=e.DBOSConflictingRegistrationError=e.DBOSWorkflowCancelledError=e.DBOSMaxStepRetriesError=e.DBOSConflictingWorkflowError=e.DBOSInvalidWorkflowTransitionError=e.DBOSExecutorNotInitializedError=e.DBOSMaxRecoveryAttemptsExceededError=e.DBOSFailLoadOperationsError=e.DBOSNonExistentWorkflowError=e.DBOSDebuggerError=e.DBOSConfigKeyTypeError=e.DBOSNotAuthorizedError=e.DBOSDataValidationError=e.DBOSNotRegisteredError=e.DBOSWorkflowConflictError=e.DBOSInitializationError=e.DBOSError=e.isDataValidationError=void 0;function t(e){let t=e?.dbosErrorCode;return t?t===r:!1}e.isDataValidationError=t;var n=class extends Error{dbosErrorCode;constructor(e,t=1){super(e),this.dbosErrorCode=t}};e.DBOSError=n,e.DBOSInitializationError=class extends n{error;constructor(e,t){super(e,3),this.error=t}},e.DBOSWorkflowConflictError=class extends n{constructor(e){super(`Conflicting WF ID ${e}`,5)}},e.DBOSNotRegisteredError=class extends n{constructor(e,t){let n=t??`Operation (Name: ${e}) not registered`;super(n,6)}};let r=9;e.DBOSDataValidationError=class extends n{constructor(e){super(e,9)}},e.DBOSNotAuthorizedError=class extends n{status;constructor(e,t=403){super(e,12),this.status=t}},e.DBOSConfigKeyTypeError=class extends n{constructor(e,t,n){super(`${e} should be of type ${t}, but got ${n}`,14)}},e.DBOSDebuggerError=class extends n{constructor(e){super(`DEBUGGER: `+e,15)}},e.DBOSNonExistentWorkflowError=class extends n{constructor(e){super(e,16)}},e.DBOSFailLoadOperationsError=class extends n{constructor(e){super(e,17)}},e.DBOSMaxRecoveryAttemptsExceededError=class extends n{constructor(e,t){super(`Workflow ${e} has exceeded its maximum of ${t} execution or recovery attempts. Further attempts to execute or recover it will fail.`,18)}},e.DBOSExecutorNotInitializedError=class extends n{constructor(){super(`DBOS not initialized`,20)}},e.DBOSInvalidWorkflowTransitionError=class extends n{constructor(e){super(e??`Invalid workflow state`,21)}},e.DBOSConflictingWorkflowError=class extends n{constructor(e,t){super(`Conflicting workflow invocation with the same ID (${e}): ${t}`,22)}},e.DBOSMaxStepRetriesError=class extends n{errors;constructor(e,t,n){let r=n.map((e,t)=>`Error ${t+1}: ${e.message}`).join(`. `);super(`Step ${e} has exceeded its maximum of ${t} retries. Previous errors: ${r}`,23),this.errors=n}},e.DBOSWorkflowCancelledError=class extends n{workflowID;constructor(e){super(`Workflow ${e} has been cancelled`,24),this.workflowID=e}},e.DBOSConflictingRegistrationError=class extends n{constructor(e){super(e,25)}},e.DBOSUnexpectedStepError=class extends n{workflowID;stepID;expectedName;constructor(e,t,n,r){super(`During execution of workflow ${e} step ${t}, function ${r} was recorded when ${n} was expected. Check that your workflow is deterministic.`,26),this.workflowID=e,this.stepID=t,this.expectedName=n}},e.DBOSAwaitedWorkflowCancelledError=class extends n{workflowID;constructor(e){super(`Awaited ${e} was cancelled`,27),this.workflowID=e}},e.QueueDedupIDDuplicated=28,e.DBOSQueueDuplicatedError=class extends n{workflowID;queue;deduplicationID;constructor(t,n,r){super(`Workflow ${t} was deduplicated due to an existing workflow in queue ${n} with deduplication ID ${r}.`,e.QueueDedupIDDuplicated),this.workflowID=t,this.queue=n,this.deduplicationID=r}},e.DBOSInvalidQueuePriorityError=class extends n{priority;min;max;constructor(e,t,n){super(`Invalid priority ${e}. Priority must be between ${t} and ${n}.`,29),this.priority=e,this.min=t,this.max=n}};function i(e){if(e&&typeof e==`object`&&`dbosErrorCode`in e){let t=e.dbosErrorCode;return typeof t==`number`?t:void 0}}e.getDBOSErrorCode=i})),ry=r((e=>{e.__esModule=!0,e.DoubleIndexedKV=void 0,e.DoubleIndexedKV=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)},e.prototype.getByKey=function(e){return this.keyToValue.get(e)},e.prototype.getByValue=function(e){return this.valueToKey.get(e)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}()})),iy=r((e=>{e.__esModule=!0,e.Registry=void 0;var t=ry();e.Registry=function(){function e(e){this.generateIdentifier=e,this.kv=new t.DoubleIndexedKV}return e.prototype.register=function(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(e){return this.kv.getByValue(e)},e.prototype.getValue=function(e){return this.kv.getByKey(e)},e}()})),ay=r((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();e.__esModule=!0,e.ClassRegistry=void 0,e.ClassRegistry=function(e){t(n,e);function n(){var t=e.call(this,function(e){return e.name})||this;return t.classToAllowedProps=new Map,t}return n.prototype.register=function(t,n){typeof n==`object`?(n.allowProps&&this.classToAllowedProps.set(t,n.allowProps),e.prototype.register.call(this,t,n.identifier)):e.prototype.register.call(this,t,n)},n.prototype.getAllowedProps=function(e){return this.classToAllowedProps.get(e)},n}(iy().Registry)})),oy=r((e=>{var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a};e.__esModule=!0,e.findArr=e.includes=e.forEach=e.find=void 0;function n(e){if(`values`in Object)return Object.values(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function r(e,t){var r=n(e);if(`find`in r)return r.find(t);for(var i=r,a=0;a<i.length;a++){var o=i[a];if(t(o))return o}}e.find=r;function i(e,n){Object.entries(e).forEach(function(e){var r=t(e,2),i=r[0],a=r[1];return n(a,i)})}e.forEach=i;function a(e,t){return e.indexOf(t)!==-1}e.includes=a;function o(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}e.findArr=o})),sy=r((e=>{e.__esModule=!0,e.CustomTransformerRegistry=void 0;var t=oy();e.CustomTransformerRegistry=function(){function e(){this.transfomers={}}return e.prototype.register=function(e){this.transfomers[e.name]=e},e.prototype.findApplicable=function(e){return t.find(this.transfomers,function(t){return t.isApplicable(e)})},e.prototype.findByName=function(e){return this.transfomers[e]},e}()})),cy=r((e=>{e.__esModule=!0,e.isURL=e.isTypedArray=e.isInfinite=e.isBigint=e.isPrimitive=e.isNaNValue=e.isError=e.isDate=e.isSymbol=e.isSet=e.isMap=e.isRegExp=e.isBoolean=e.isNumber=e.isString=e.isArray=e.isEmptyObject=e.isPlainObject=e.isNull=e.isUndefined=void 0;var t=function(e){return Object.prototype.toString.call(e).slice(8,-1)};e.isUndefined=function(e){return e===void 0},e.isNull=function(e){return e===null},e.isPlainObject=function(e){return typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},e.isEmptyObject=function(t){return e.isPlainObject(t)&&Object.keys(t).length===0},e.isArray=function(e){return Array.isArray(e)},e.isString=function(e){return typeof e==`string`},e.isNumber=function(e){return typeof e==`number`&&!isNaN(e)},e.isBoolean=function(e){return typeof e==`boolean`},e.isRegExp=function(e){return e instanceof RegExp},e.isMap=function(e){return e instanceof Map},e.isSet=function(e){return e instanceof Set},e.isSymbol=function(e){return t(e)===`Symbol`},e.isDate=function(e){return e instanceof Date&&!isNaN(e.valueOf())},e.isError=function(e){return e instanceof Error},e.isNaNValue=function(e){return typeof e==`number`&&isNaN(e)},e.isPrimitive=function(t){return e.isBoolean(t)||e.isNull(t)||e.isUndefined(t)||e.isNumber(t)||e.isString(t)||e.isSymbol(t)},e.isBigint=function(e){return typeof e==`bigint`},e.isInfinite=function(e){return e===1/0||e===-1/0},e.isTypedArray=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},e.isURL=function(e){return e instanceof URL}})),ly=r((e=>{e.__esModule=!0,e.parsePath=e.stringifyPath=e.escapeKey=void 0,e.escapeKey=function(e){return e.replace(/\./g,`\\.`)},e.stringifyPath=function(t){return t.map(String).map(e.escapeKey).join(`.`)},e.parsePath=function(e){for(var t=[],n=``,r=0;r<e.length;r++){var i=e.charAt(r);if(i===`\\`&&e.charAt(r+1)===`.`){n+=`.`,r++;continue}if(i===`.`){t.push(n),n=``;continue}n+=i}var a=n;return t.push(a),t}})),uy=r((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},r=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};e.__esModule=!0,e.untransformValue=e.transformValue=e.isInstanceOfRegisteredClass=void 0;var i=cy(),a=oy();function o(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var s=[o(i.isUndefined,`undefined`,function(){return null},function(){}),o(i.isBigint,`bigint`,function(e){return e.toString()},function(e){return typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)}),o(i.isDate,`Date`,function(e){return e.toISOString()},function(e){return new Date(e)}),o(i.isError,`Error`,function(e,t){var n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(t){n[t]=e[t]}),n},function(e,t){var n=Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(function(t){n[t]=e[t]}),n}),o(i.isRegExp,`regexp`,function(e){return``+e},function(e){var t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),o(i.isSet,`set`,function(e){return r([],n(e.values()))},function(e){return new Set(e)}),o(i.isMap,`map`,function(e){return r([],n(e.entries()))},function(e){return new Map(e)}),o(function(e){return i.isNaNValue(e)||i.isInfinite(e)},`number`,function(e){return i.isNaNValue(e)?`NaN`:e>0?`Infinity`:`-Infinity`},Number),o(function(e){return e===0&&1/e==-1/0},`number`,function(){return`-0`},Number),o(i.isURL,`URL`,function(e){return e.toString()},function(e){return new URL(e)})];function c(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var l=c(function(e,t){return i.isSymbol(e)?!!t.symbolRegistry.getIdentifier(e):!1},function(e,t){return[`symbol`,t.symbolRegistry.getIdentifier(e)]},function(e){return e.description},function(e,t,n){var r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),u=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),d=c(i.isTypedArray,function(e){return[`typed-array`,e.constructor.name]},function(e){return r([],n(e))},function(e,t){var n=u[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function f(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}e.isInstanceOfRegisteredClass=f;var p=c(f,function(e,t){return[`class`,t.classRegistry.getIdentifier(e.constructor)]},function(e,n){var r=n.classRegistry.getAllowedProps(e.constructor);if(!r)return t({},e);var i={};return r.forEach(function(t){i[t]=e[t]}),i},function(e,t,n){var r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),m=c(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){return[`custom`,t.customTransformerRegistry.findApplicable(e).name]},function(e,t){return t.customTransformerRegistry.findApplicable(e).serialize(e)},function(e,t,n){var r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),h=[p,l,m,d];e.transformValue=function(e,t){var n=a.findArr(h,function(n){return n.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=a.findArr(s,function(n){return n.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}};var g={};s.forEach(function(e){g[e.annotation]=e}),e.untransformValue=function(e,t,n){if(i.isArray(t))switch(t[0]){case`symbol`:return l.untransform(e,t,n);case`class`:return p.untransform(e,t,n);case`custom`:return m.untransform(e,t,n);case`typed-array`:return d.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{var r=g[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}}})),dy=r((e=>{e.__esModule=!0,e.setDeep=e.getDeep=void 0;var t=cy(),n=oy(),r=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function i(e){if(n.includes(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(n.includes(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(n.includes(e,`constructor`))throw Error(`constructor is not allowed as a property`)}e.getDeep=function(e,n){i(n);for(var a=0;a<n.length;a++){var o=n[a];if(t.isSet(e))e=r(e,+o);else if(t.isMap(e)){var s=+o,c=+n[++a]==0?`key`:`value`,l=r(e,s);switch(c){case`key`:e=l;break;case`value`:e=e.get(l);break}}else e=e[o]}return e},e.setDeep=function(e,n,a){if(i(n),n.length===0)return a(e);for(var o=e,s=0;s<n.length-1;s++){var c=n[s];if(t.isArray(o)){var l=+c;o=o[l]}else if(t.isPlainObject(o))o=o[c];else if(t.isSet(o)){var u=+c;o=r(o,u)}else if(t.isMap(o)){if(s===n.length-2)break;var u=+c,d=+n[++s]==0?`key`:`value`,f=r(o,u);switch(d){case`key`:o=f;break;case`value`:o=o.get(f);break}}}var p=n[n.length-1];if(t.isArray(o)?o[+p]=a(o[+p]):t.isPlainObject(o)&&(o[p]=a(o[p])),t.isSet(o)){var m=r(o,+p),h=a(m);m!==h&&(o.delete(m),o.add(h))}if(t.isMap(o)){var u=+n[n.length-2],g=r(o,u),d=+p==0?`key`:`value`;switch(d){case`key`:var _=a(g);o.set(_,o.get(g)),_!==g&&o.delete(g);break;case`value`:o.set(g,a(o.get(g)));break}}return e}})),fy=r((e=>{var t=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};e.__esModule=!0,e.walker=e.generateReferentialEqualityAnnotations=e.applyReferentialEqualityAnnotations=e.applyValueAnnotations=void 0;var r=cy(),i=ly(),a=uy(),o=oy(),s=ly(),c=dy();function l(e,i,a){if(a===void 0&&(a=[]),e){if(!r.isArray(e)){o.forEach(e,function(e,r){return l(e,i,n(n([],t(a)),t(s.parsePath(r))))});return}var c=t(e,2),u=c[0],d=c[1];d&&o.forEach(d,function(e,r){l(e,i,n(n([],t(a)),t(s.parsePath(r))))}),i(u,a)}}function u(e,t,n){return l(t,function(t,r){e=c.setDeep(e,r,function(e){return a.untransformValue(e,t,n)})}),e}e.applyValueAnnotations=u;function d(e,n){function i(t,n){var r=c.getDeep(e,s.parsePath(n));t.map(s.parsePath).forEach(function(t){e=c.setDeep(e,t,function(){return r})})}if(r.isArray(n)){var a=t(n,2),l=a[0],u=a[1];l.forEach(function(t){e=c.setDeep(e,s.parsePath(t),function(){return e})}),u&&o.forEach(u,i)}else o.forEach(n,i);return e}e.applyReferentialEqualityAnnotations=d;var f=function(e,t){return r.isPlainObject(e)||r.isArray(e)||r.isMap(e)||r.isSet(e)||a.isInstanceOfRegisteredClass(e,t)};function p(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function m(e,n){var a={},o=void 0;return e.forEach(function(e){if(!(e.length<=1)){n||(e=e.map(function(e){return e.map(String)}).sort(function(e,t){return e.length-t.length}));var r=t(e),s=r[0],c=r.slice(1);s.length===0?o=c.map(i.stringifyPath):a[i.stringifyPath(s)]=c.map(i.stringifyPath)}}),o?r.isEmptyObject(a)?[o]:[o,a]:r.isEmptyObject(a)?void 0:a}e.generateReferentialEqualityAnnotations=m,e.walker=function(s,c,l,u,d,m,h){d===void 0&&(d=[]),m===void 0&&(m=[]),h===void 0&&(h=new Map);var g=r.isPrimitive(s);if(!g){p(s,d,c);var _=h.get(s);if(_)return u?{transformedValue:null}:_}if(!f(s,l)){var v=a.transformValue(s,l),y=v?{transformedValue:v.value,annotations:[v.type]}:{transformedValue:s};return g||h.set(s,y),y}if(o.includes(m,s))return{transformedValue:null};var b=a.transformValue(s,l),x=b?.value??s,S=r.isArray(x)?[]:{},C={};o.forEach(x,function(a,f){var p=e.walker(a,c,l,u,n(n([],t(d)),[f]),n(n([],t(m)),[s]),h);S[f]=p.transformedValue,r.isArray(p.annotations)?C[f]=p.annotations:r.isPlainObject(p.annotations)&&o.forEach(p.annotations,function(e,t){C[i.escapeKey(f)+`.`+t]=e})});var w=r.isEmptyObject(C)?{transformedValue:S,annotations:b?[b.type]:void 0}:{transformedValue:S,annotations:b?[b.type,C]:C};return g||h.set(s,w),w}})),py=r((e=>{function t(e){return Object.prototype.toString.call(e).slice(8,-1)}function n(e){return t(e)===`Object`}function r(e){return t(e)===`Array`}function i(e){return t(e)===`Blob`}function a(e){return t(e)===`Boolean`}function o(e){return t(e)===`Date`&&!isNaN(e)}function s(e){return r(e)&&e.length===0}function c(e){if(t(e)!==`Object`)return!1;let n=Object.getPrototypeOf(e);return!!n&&n.constructor===Object&&n===Object.prototype}function l(e){return c(e)&&Object.keys(e).length===0}function u(e){return e===``}function d(e){return t(e)===`Error`||e instanceof Error}function f(e){return t(e)===`File`}function p(e){return r(e)&&e.length>0}function m(e){return c(e)&&Object.keys(e).length>0}function h(e){return t(e)===`String`}function g(e){return h(e)&&e!==``}function _(e){return typeof e==`function`}function v(e,n){if(!(n instanceof Function))throw TypeError(`Type must be a function`);if(!Object.prototype.hasOwnProperty.call(n,`prototype`))throw TypeError(`Type is not a class`);let r=n.name;return t(e)===r||!!(e&&e.constructor===n)}function y(e,n){if(typeof n==`function`){for(let t=e;t;t=Object.getPrototypeOf(t))if(v(t,n))return!0;return!1}else{for(let r=e;r;r=Object.getPrototypeOf(r))if(t(r)===n)return!0;return!1}}function b(e){return t(e)===`Map`}function x(e){return t(e)===`Number`&&isNaN(e)}function S(e){return t(e)===`Number`&&!isNaN(e)}function C(e){return S(e)&&e<0}function w(e){return t(e)===`Null`}function T(e,t,n,r,i){return a=>e(a)||t(a)||!!n&&n(a)||!!r&&r(a)||!!i&&i(a)}function E(e){return t(e)===`Undefined`}let ee=T(w,E);function te(e){return c(e)}function D(e){return n(e)}function ne(e){return S(e)&&e>0}function O(e){return t(e)===`Symbol`}function k(e){return a(e)||w(e)||E(e)||S(e)||h(e)||O(e)}function re(e){return t(e)===`Promise`}function A(e){return t(e)===`RegExp`}function ie(e){return t(e)===`Set`}function ae(e){return t(e)===`WeakMap`}function oe(e){return t(e)===`WeakSet`}e.getType=t,e.isAnyObject=n,e.isArray=r,e.isBlob=i,e.isBoolean=a,e.isDate=o,e.isEmptyArray=s,e.isEmptyObject=l,e.isEmptyString=u,e.isError=d,e.isFile=f,e.isFullArray=p,e.isFullObject=m,e.isFullString=g,e.isFunction=_,e.isInstanceOf=y,e.isMap=b,e.isNaNValue=x,e.isNegativeNumber=C,e.isNull=w,e.isNullOrUndefined=ee,e.isNumber=S,e.isObject=te,e.isObjectLike=D,e.isOneOf=T,e.isPlainObject=c,e.isPositiveNumber=ne,e.isPrimitive=k,e.isPromise=re,e.isRegExp=A,e.isSet=ie,e.isString=h,e.isSymbol=O,e.isType=v,e.isUndefined=E,e.isWeakMap=ae,e.isWeakSet=oe})),my=r((e=>{let t=py();function n(e,t,n,r,i){let a={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;a===`enumerable`&&(e[t]=n),i&&a===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function r(e,i={}){if(t.isArray(e))return e.map(e=>r(e,i));if(!t.isPlainObject(e))return e;let a=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e);return[...a,...o].reduce((a,o)=>{if(t.isArray(i.props)&&!i.props.includes(o))return a;let s=e[o];return n(a,o,r(s,i),e,i.nonenumerable),a},{})}e.copy=r})),hy=r((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)},n=e&&e.__read||function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},r=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};e.__esModule=!0,e.allowErrorProps=e.registerSymbol=e.registerCustom=e.registerClass=e.parse=e.stringify=e.deserialize=e.serialize=e.SuperJSON=void 0;var i=ay(),a=iy(),o=sy(),s=fy(),c=my(),l=function(){function e(e){var t=(e===void 0?{}:e).dedupe,n=t===void 0?!1:t;this.classRegistry=new i.ClassRegistry,this.symbolRegistry=new a.Registry(function(e){return e.description??``}),this.customTransformerRegistry=new o.CustomTransformerRegistry,this.allowedErrorProps=[],this.dedupe=n}return e.prototype.serialize=function(e){var n=new Map,r=s.walker(e,n,this,this.dedupe),i={json:r.transformedValue};r.annotations&&(i.meta=t(t({},i.meta),{values:r.annotations}));var a=s.generateReferentialEqualityAnnotations(n,this.dedupe);return a&&(i.meta=t(t({},i.meta),{referentialEqualities:a})),i},e.prototype.deserialize=function(e){var t=e.json,n=e.meta,r=c.copy(t);return n?.values&&(r=s.applyValueAnnotations(r,n.values,this)),n?.referentialEqualities&&(r=s.applyReferentialEqualityAnnotations(r,n.referentialEqualities)),r},e.prototype.stringify=function(e){return JSON.stringify(this.serialize(e))},e.prototype.parse=function(e){return this.deserialize(JSON.parse(e))},e.prototype.registerClass=function(e,t){this.classRegistry.register(e,t)},e.prototype.registerSymbol=function(e,t){this.symbolRegistry.register(e,t)},e.prototype.registerCustom=function(e,n){this.customTransformerRegistry.register(t({name:n},e))},e.prototype.allowErrorProps=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];(e=this.allowedErrorProps).push.apply(e,r([],n(t)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}();e.SuperJSON=l,e.default=l,e.serialize=l.serialize,e.deserialize=l.deserialize,e.stringify=l.stringify,e.parse=l.parse,e.registerClass=l.registerClass,e.registerCustom=l.registerCustom,e.registerSymbol=l.registerSymbol,e.allowErrorProps=l.allowErrorProps})),gy=r((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.getClientConfig=t.interceptStreams=t.exhaustiveCheckGuard=t.serializeFunctionInputOutput=t.DBOSJSON=t.SERIALIZER_MARKER_VALUE=t.SERIALIZER_MARKER_KEY=t.DBOSJSONLegacy=t.DBOSReviver=t.DBOSReplacer=t.cancellableSleep=t.DEBOUNCER_WORKLOW_NAME=t.INTERNAL_QUEUE_NAME=t.sleepms=t.globalParams=t.defaultEnableOTLP=t.readFileSync=t.registerSerializationRecipe=void 0;let r=n(e(`node:fs`)),i=n(e(`node:path`)),a=n(hy());function o(e){a.default.registerCustom(e,e.name)}t.registerSerializationRecipe=o,o({isApplicable:e=>Buffer.isBuffer(e),serialize:e=>Array.from(e),deserialize:e=>Buffer.from(e),name:`Buffer`});function s(e,t=`utf8`){return r.default.readFileSync(e,{encoding:t})}t.readFileSync=s;function c(){try{function t(e){if(typeof e==`string`&&(e.endsWith(i.default.sep)||(e+=i.default.sep),e=e.split(i.default.sep)),e.length===0)throw Error(`package.json not found in path`);e.pop();let n=e.join(i.default.sep);return r.default.existsSync(i.default.join(n,`package.json`))?n:t(e)}return e(i.default.join(t(__dirname),`package.json`)).version}catch{return`unknown`}}function l(){return process.env.DBOS__CLOUD===`true`}t.defaultEnableOTLP=l,t.globalParams={appVersion:process.env.DBOS__APPVERSION||``,wasComputed:!1,executorID:process.env.DBOS__VMID||`local`,appID:process.env.DBOS__APPID||``,enableOTLP:l(),dbosVersion:c()},t.sleepms=e=>new Promise(t=>setTimeout(t,e)),t.INTERNAL_QUEUE_NAME=`_dbos_internal_queue`,t.DEBOUNCER_WORKLOW_NAME=`_dbos_debouncer_workflow`;function u(e){let t,n,r=!1;return{promise:new Promise(i=>{n=()=>{r||(r=!0,i(),t=void 0)},t=setTimeout(n,e)}),cancel:()=>{t&&(clearTimeout(t),t=void 0,n())}}}t.cancellableSleep=u;function d(e,t){let n=this[e];return n instanceof Date?{dbos_type:`dbos_Date`,dbos_data:n.toISOString()}:typeof n==`bigint`?{dbos_type:`dbos_BigInt`,dbos_data:n.toString()}:t}t.DBOSReplacer=d;function f(e){return typeof e==`object`&&!!e&&e.type===`Buffer`}function p(e){return typeof e==`object`&&!!e&&e.dbos_type===`dbos_Date`}function m(e){return typeof e==`object`&&!!e&&e.dbos_type===`dbos_BigInt`}function h(e,t){switch(!0){case f(t):return Buffer.from(t.data);case p(t):return new Date(Date.parse(t.dbos_data));case m(t):return BigInt(t.dbos_data);default:return t}}t.DBOSReviver=h,t.DBOSJSONLegacy={parse:e=>e===null?null:JSON.parse(e,h),stringify:e=>JSON.stringify(e,d)},t.SERIALIZER_MARKER_KEY=`__dbos_serializer`,t.SERIALIZER_MARKER_VALUE=`superjson`;let g=`"${t.SERIALIZER_MARKER_KEY}":"${t.SERIALIZER_MARKER_VALUE}"`;function _(e){return typeof e==`object`&&!!e&&t.SERIALIZER_MARKER_KEY in e&&e[t.SERIALIZER_MARKER_KEY]===t.SERIALIZER_MARKER_VALUE&&`json`in e}function v(e){let n=a.default.serialize(e);return JSON.stringify({...n,[t.SERIALIZER_MARKER_KEY]:t.SERIALIZER_MARKER_VALUE})}t.DBOSJSON={parse:e=>{if(e==null)return null;if(e.includes(g)){let t=JSON.parse(e);if(_(t))return a.default.deserialize(t)}return t.DBOSJSONLegacy.parse(e)},stringify:v};function y(e,n=[]){let r=t.DBOSJSON.stringify(e),i=t.DBOSJSON.parse(r);return x(i)&&b(e,i,n),{deserialized:i,stringified:r}}t.serializeFunctionInputOutput=y;function b(e,t,n=[]){let r=new WeakSet,i=[{o:e,d:t,p:n}];for(;i.length;){let{o:e,d:t,p:n}=i.pop();if(!r.has(e)){r.add(e);for(let r of T(e))r in t||S(t,r,n);for(let r of w(e))try{let a=e[r],o=t[r];if(!C(a,o))continue;i.push({o:a,d:o,p:[...n,r]})}catch{}if(e instanceof Map&&t instanceof Map)for(let[r,a]of e){let e=t.get(r);if(C(a,e)){let t=ee(r)?String(r):`[MapValue]`;i.push({o:a,d:e,p:[...n,t]})}}if(e instanceof Set&&t instanceof Set){let r=Array.from(e),a=Array.from(t);for(let e=0;e<Math.min(r.length,a.length);e++){let t=r[e],o=a[e];C(t,o)&&i.push({o:t,d:o,p:[...n,e]})}}}}}function x(e){return typeof e==`object`&&!!e||typeof e==`function`}function S(e,t,n){let r=function(...e){throw Error(`Attempted to call '${String(t)}' at path ${E(n)} on an object that is a serialized function input our output value. Functions are not preserved through serialization; see 'DBOS.registerSerialization'. `)};try{Object.defineProperty(e,t,{value:r,configurable:!0,writable:!1,enumerable:!1})}catch{e[t]=r}}function C(e,t){return!(!e||!t||typeof e!=`object`||typeof t!=`object`||[Date,RegExp,WeakMap,WeakSet,ArrayBuffer,DataView].some(t=>e instanceof t))}function w(e){let t=Object.getOwnPropertyNames(e),n=Object.getOwnPropertySymbols(e);return[...t,...n]}function T(e){let t=new Set;for(let n of w(e)){let r=Object.getOwnPropertyDescriptor(e,n);r&&`value`in r&&typeof r.value==`function`&&t.add(n)}let n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;){for(let e of Object.getOwnPropertyNames(n)){if(e===`constructor`)continue;let r=Object.getOwnPropertyDescriptor(n,e);r&&`value`in r&&typeof r.value==`function`&&t.add(e)}n=Object.getPrototypeOf(n)}return Array.from(t)}function E(e){return e.length===0?`(root)`:e.map(e=>typeof e==`number`?`[${e}]`:typeof e==`symbol`?`[${String(e)}]`:/^<?[A-Za-z_$][A-Za-z0-9_$]*>?$/.test(e)?`.${e}`:`[${JSON.stringify(e)}]`).join(``).replace(/^\./,``)}function ee(e){return typeof e==`string`||typeof e==`number`}function te(e){throw Error(`Exaustive matching is not applied`)}t.exhaustiveCheckGuard=te;let D=process.stdout.write.bind(process.stdout),ne=process.stderr.write.bind(process.stderr);function O(e){let t=(t,n)=>(r,i,a)=>(e(r.toString(),t),typeof i==`function`?n(r,i):n(r,i,a));process.stdout.write=t(`stdout`,D),process.stderr.write=t(`stderr`,ne)}t.interceptStreams=O;function k(e){let t=typeof e==`string`?e:e.toString(),n=r(typeof e==`string`?new URL(e):e);return{connectionString:t,connectionTimeoutMillis:n?n*1e3:1e4};function r(e){try{let t=e.searchParams.get(`connect_timeout`);return t?Number.parseInt(t,10):void 0}catch{return}}}t.getClientConfig=k})),_y=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RetrievedHandle=e.InvokedHandle=e.isWorkflowActive=e.StatusString=e.DEFAULT_MAX_RECOVERY_ATTEMPTS=void 0;let t=gy(),n=xS(),r=Rb();e.DEFAULT_MAX_RECOVERY_ATTEMPTS=100,e.StatusString={PENDING:`PENDING`,SUCCESS:`SUCCESS`,ERROR:`ERROR`,MAX_RECOVERY_ATTEMPTS_EXCEEDED:`MAX_RECOVERY_ATTEMPTS_EXCEEDED`,CANCELLED:`CANCELLED`,ENQUEUED:`ENQUEUED`};function i(t){return t===e.StatusString.PENDING||t===e.StatusString.ENQUEUED}e.isWorkflowActive=i;var a=class{systemDatabase;workflowPromise;workflowUUID;workflowName;constructor(e,t,n,r){this.systemDatabase=e,this.workflowPromise=t,this.workflowUUID=n,this.workflowName=r}getWorkflowUUID(){return this.workflowUUID}get workflowID(){return this.workflowUUID}async getStatus(){return await n.DBOS.getWorkflowStatus(this.workflowUUID)}async getResult(e){return await(0,n.runInternalStep)(async()=>await this.workflowPromise,`DBOS.getResult`,this.workflowUUID,e)}async getWorkflowInputs(){let e=await this.systemDatabase.getWorkflowStatus(this.workflowUUID);return t.DBOSJSON.parse(e.input)}};e.InvokedHandle=a;var o=class{systemDatabase;workflowUUID;constructor(e,t){this.systemDatabase=e,this.workflowUUID=t}getWorkflowUUID(){return this.workflowUUID}get workflowID(){return this.workflowUUID}async getStatus(){return await n.DBOS.getWorkflowStatus(this.workflowUUID)}async getResult(e){return await n.DBOS.getResultInternal(this.workflowUUID,void 0,void 0,e)}async getWorkflowInputs(){let e=await this.systemDatabase.getWorkflowStatus(this.workflowUUID);return t.DBOSJSON.parse(e.input)}};e.RetrievedHandle=o,(0,t.registerSerializationRecipe)({name:`DBOS.WorkflowHandle`,isApplicable:e=>e instanceof o||e instanceof a,serialize:e=>({wfid:e.workflowID}),deserialize:e=>new o(r.DBOSExecutor.globalInstance.systemDatabase,e.wfid)})})),vy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TelemetryCollector=void 0;var t=class{data=[];push(e){this.data.push(e)}pop(){return this.data.shift()}size(){return this.data.length}};e.TelemetryCollector=class{exporter;signals=new t;signalBufferID;processAndExportSignalsIntervalMs=100;constructor(e){this.exporter=e,this.signalBufferID=setInterval(()=>{this.processAndExportSignals()},this.processAndExportSignalsIntervalMs)}async destroy(){clearInterval(this.signalBufferID),await this.processAndExportSignals(),await this.exporter?.flush()}push(e){this.signals.push(e)}pop(){return this.signals.pop()}async processAndExportSignals(){let e=[];for(;this.signals.size()>0;){let t=this.pop();if(!t)break;e.push(t)}if(e.length>0&&this.exporter)try{await this.exporter.export(e)}catch(e){console.error(e.message)}}}})),yy=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Tracer=t.installTraceContextManager=t.isTraceContextWorking=t.getActiveSpan=t.runWithTrace=t.SpanStatusCode=void 0;let n=gy();var r;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(r||(t.SpanStatusCode=r={}));var i=class{attributes={};setStatus(e){return this}setAttribute(e,t){return this}addEvent(e,t,n){return this}};function a(t,r){if(!n.globalParams.enableOTLP)return r();let{context:i,trace:a}=e(`@opentelemetry/api`);return i.with(a.setSpan(i.active(),t),r)}t.runWithTrace=a;function o(){if(!n.globalParams.enableOTLP)return;let{trace:t}=e(`@opentelemetry/api`);return t.getActiveSpan()}t.getActiveSpan=o;function s(){if(!n.globalParams.enableOTLP)return!1;let{context:t,trace:r}=e(`@opentelemetry/api`),i=r.getTracer(`otel-bootstrap-check`).startSpan(`probe`),a=r.setSpan(t.active(),i),o;return t.with(a,()=>{o=r.getSpan(t.active())===i}),i.end?.(),o===!0}t.isTraceContextWorking=s;function c(t=`dbos`){if(!n.globalParams.enableOTLP)return;let{AsyncLocalStorageContextManager:r}=e(`@opentelemetry/context-async-hooks`),{context:i}=e(`@opentelemetry/api`),{BasicTracerProvider:a}=e(`@opentelemetry/sdk-trace-base`),o=new r;o.enable(),i.setGlobalContextManager(o),new a({resource:{attributes:{"service.name":t}}}).register()}t.installTraceContextManager=c,t.Tracer=class{telemetryCollector;applicationID;executorID;constructor(t,r=`dbos`){if(this.telemetryCollector=t,this.applicationID=n.globalParams.appID,this.executorID=n.globalParams.executorID,!n.globalParams.enableOTLP)return;let{BasicTracerProvider:i}=e(`@opentelemetry/sdk-trace-base`);new i({resource:{attributes:{"service.name":r}}}).register()}startSpanWithContext(t,r,a){if(!n.globalParams.enableOTLP)return new i;let o=e(`@opentelemetry/api`),s=o.trace.getTracer(`dbos-tracer`),c=o.trace.setSpanContext(o.context.active(),t);return s.startSpan(r,{startTime:performance.now(),attributes:a},c)}startSpan(t,r,a){if(!n.globalParams.enableOTLP)return new i;let o=a,s=e(`@opentelemetry/api`),{hrTime:c}=e(`@opentelemetry/core`),l=s.trace.getTracer(`dbos-tracer`),u=c(performance.now());if(o){let e=s.trace.setSpan(s.context.active(),o);return l.startSpan(t,{startTime:u,attributes:r},e)}else return l.startSpan(t,{startTime:u,attributes:r})}endSpan(t){if(!n.globalParams.enableOTLP)return;let{hrTime:r}=e(`@opentelemetry/core`),i=t;i.setAttributes({applicationID:this.applicationID,applicationVersion:n.globalParams.appVersion}),i.attributes&&!(`executorID`in i.attributes)&&i.setAttribute(`executorID`,this.executorID),i.end(r(performance.now())),this.telemetryCollector.push(i)}}})),by=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DBOSConsoleLogger=t.DBOSContextualLogger=t.GlobalLogger=void 0;let n=gy();var r;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(r||={}),t.GlobalLogger=class{telemetryCollector;logger;addContextMetadata;isLogging=!1;constructor(t,o,s=`dbos`){if(this.telemetryCollector=t,this.addContextMetadata=o?.addContextMetadata||!1,!n.globalParams.enableOTLP){this.logger=new i(o??{});return}let c=e(`winston-transport`);class l extends c{telemetryCollector;name=`OTLPLogQueueTransport`;otelLogger;applicationID;executorID;constructor(t,r){super(),this.telemetryCollector=t,this.level=r;let{LoggerProvider:i}=e(`@opentelemetry/sdk-logs`),a=new i({resource:{attributes:{"service.name":s}}});this.otelLogger=a.getLogger(`dbos-logger`),this.applicationID=n.globalParams.appID,this.executorID=n.globalParams.executorID,a.addLogRecordProcessor({forceFlush:async()=>{},onEmit(e){t.push(e)},shutdown:async()=>{}})}log(e,t){let{level:i,message:a,stack:o,span:s}=e,c={error:r.ERROR,warn:r.WARN,info:r.INFO,debug:r.DEBUG};this.otelLogger.emit({severityNumber:c[i],severityText:i,body:a,timestamp:performance.now(),observedTimestamp:performance.now(),attributes:{...s?.attributes,traceId:s?.spanContext()?.traceId,spanId:s?.spanContext()?.spanId,stack:o,applicationID:this.applicationID,applicationVersion:n.globalParams.appVersion,executorID:this.executorID}}),t()}}let{transports:u,createLogger:d}=e(`winston`),f=[];f.push(new u.Console({format:a(),level:o?.logLevel||`info`,silent:o?.silent||!1,forceConsole:o?.forceConsole||!1}));let p;n.globalParams.enableOTLP&&this.telemetryCollector?.exporter&&(p=new l(this.telemetryCollector,o?.logLevel||`info`),f.push(p)),this.logger=d({transports:f}),n.globalParams.enableOTLP&&process.env.DBOS__CAPTURE_STD!==`false`&&this.telemetryCollector?.exporter&&(0,n.interceptStreams)((e,t)=>{t===`stdout`?this.isLogging||p?.log({level:`info`,message:e.trim()},()=>{}):this.isLogging||p?.log({level:`error`,message:e.trim(),stack:Error().stack},()=>{})})}info(e,t){this.isLogging=!0,typeof e==`string`?this.logger.info(e,t):this.logger.info(n.DBOSJSON.stringify(e),t),this.isLogging=!1}debug(e,t){this.isLogging=!0,typeof e==`string`?this.logger.debug(e,t):this.logger.debug(n.DBOSJSON.stringify(e),t),this.isLogging=!1}warn(e,t){this.isLogging=!0,typeof e==`string`?this.logger.warn(e,t):this.logger.warn(n.DBOSJSON.stringify(e),t),this.isLogging=!1}error(e,t){this.isLogging=!0,e instanceof Error?this.logger.error(e.message,{...t,stack:e.stack}):typeof e==`string`?this.logger.error(e,{...t,stack:Error().stack}):this.logger.error(n.DBOSJSON.stringify(e),{...t,stack:Error().stack}),this.isLogging=!1}async destroy(){await this.telemetryCollector?.destroy()}},t.DBOSContextualLogger=class{globalLogger;ctx;includeContextMetadata;constructor(e,t){this.globalLogger=e,this.ctx=t,this.includeContextMetadata=this.globalLogger.addContextMetadata}info(e,t){this.globalLogger.info(e,{includeContextMetadata:this.includeContextMetadata,span:this.ctx(),...t})}debug(e,t){this.globalLogger.debug(e,{includeContextMetadata:this.includeContextMetadata,span:this.ctx(),...t})}warn(e,t){this.globalLogger.warn(e,{includeContextMetadata:this.includeContextMetadata,span:this.ctx(),...t})}error(e,t){this.globalLogger.error(e,{includeContextMetadata:this.includeContextMetadata,span:this.ctx(),...t})}};var i=class{config;constructor(e){this.config=e}info(e,t){console.log(e)}debug(e,t){this.config.logLevel===`debug`&&console.debug(e)}warn(e,t){console.warn(e)}error(e,t){e instanceof Error?console.error(e):t?.stack?console.error(e,`
26
+ `,t.stack):console.error(e)}};t.DBOSConsoleLogger=i;function a(){let{format:t}=e(`winston`);return t.combine(t.errors({stack:!0}),t.timestamp(),t.colorize(),t.printf(e=>{let{timestamp:t,level:r,message:i,stack:a}=e,o=n.globalParams.appVersion,s=typeof t==`string`?t.slice(0,19).replace(`T`,` `):void 0,c=typeof a==`string`?a?.split(`
27
+ `).slice(1).join(`
28
+ `):void 0,l=`${typeof i==`string`?i:n.DBOSJSON.stringify(i)}${e.includeContextMetadata?` ${n.DBOSJSON.stringify(e.span?.attributes)}`:``}`;return`${s}${o?` [version ${o}]`:``} [${r}]: ${l} ${a?`
29
+ `+c:``}`}))}})),xy=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TelemetryExporter=void 0;let n=gy();function r(e){return`kind`in e}function i(e){return`severityText`in e&&`severityNumber`in e}t.TelemetryExporter=class{tracesExporters=[];logsExporters=[];constructor(t){if(!n.globalParams.enableOTLP)return;let{OTLPTraceExporter:r}=e(`@opentelemetry/exporter-trace-otlp-proto`),{OTLPLogExporter:i}=e(`@opentelemetry/exporter-logs-otlp-proto`),a=new Set(t.tracesEndpoint);for(let e of a)this.tracesExporters.push(new r({url:e})),console.log(`Traces will be exported to ${e}`);let o=new Set(t.logsEndpoint);for(let e of o)this.logsExporters.push(new i({url:e})),console.log(`Logs will be exported to ${e}`)}async export(t){if(!n.globalParams.enableOTLP)return;let{ExportResultCode:a}=e(`@opentelemetry/core`),o=[],s=[];t.forEach(e=>{r(e)&&o.push(e),i(e)&&s.push(e)});let c=[];if(o.length>0&&this.tracesExporters.length>0){let e=new Promise(e=>{let t=t=>{t.code!==a.SUCCESS&&(console.warn(`Trace export failed: ${t.code}`),console.warn(t)),e()};for(let e of this.tracesExporters)e.export(o,t)});c.push(e)}if(s.length>0&&this.logsExporters.length>0){let e=new Promise(e=>{let t=t=>{t.code!==a.SUCCESS&&(console.warn(`Log export failed: ${t.code}`),console.warn(t)),e()};for(let e of this.logsExporters)e.export(s,t)});c.push(e)}await Promise.all(c)}async flush(){if(n.globalParams.enableOTLP){for(let e of this.tracesExporters)await e.forceFlush();for(let e of this.logsExporters)await e.forceFlush()}}}})),Sy=r((e=>{e.parse=function(e,n){return new t(e,n).parse()};var t=class e{constructor(e,t){this.source=e,this.transform=t||n,this.position=0,this.entries=[],this.recorded=[],this.dimension=0}isEof(){return this.position>=this.source.length}nextCharacter(){var e=this.source[this.position++];return e===`\\`?{value:this.source[this.position++],escaped:!0}:{value:e,escaped:!1}}record(e){this.recorded.push(e)}newEntry(e){var t;(this.recorded.length>0||e)&&(t=this.recorded.join(``),t===`NULL`&&!e&&(t=null),t!==null&&(t=this.transform(t)),this.entries.push(t),this.recorded=[])}consumeDimensions(){if(this.source[0]===`[`)for(;!this.isEof()&&this.nextCharacter().value!==`=`;);}parse(t){var n,r,i;for(this.consumeDimensions();!this.isEof();)if(n=this.nextCharacter(),n.value===`{`&&!i)this.dimension++,this.dimension>1&&(r=new e(this.source.substr(this.position-1),this.transform),this.entries.push(r.parse(!0)),this.position+=r.position-2);else if(n.value===`}`&&!i){if(this.dimension--,!this.dimension&&(this.newEntry(),t))return this.entries}else n.value===`"`&&!n.escaped?(i&&this.newEntry(!0),i=!i):n.value===`,`&&!i?this.newEntry():this.record(n.value);if(this.dimension!==0)throw Error(`array dimension not balanced`);return this.entries}};function n(e){return e}})),Cy=r(((e,t)=>{var n=Sy();t.exports={create:function(e,t){return{parse:function(){return n.parse(e,t)}}}}})),wy=r(((e,t)=>{var n=/(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?.*?( BC)?$/,r=/^(\d{1,})-(\d{2})-(\d{2})( BC)?$/,i=/([Z+-])(\d{2})?:?(\d{2})?:?(\d{2})?/,a=/^-?infinity$/;t.exports=function(e){if(a.test(e))return Number(e.replace(`i`,`I`));var t=n.exec(e);if(!t)return o(e)||null;var r=!!t[8],i=parseInt(t[1],10);r&&(i=c(i));var u=parseInt(t[2],10)-1,d=t[3],f=parseInt(t[4],10),p=parseInt(t[5],10),m=parseInt(t[6],10),h=t[7];h=h?1e3*parseFloat(h):0;var g,_=s(e);return _==null?(g=new Date(i,u,d,f,p,m,h),l(i)&&g.setFullYear(i)):(g=new Date(Date.UTC(i,u,d,f,p,m,h)),l(i)&&g.setUTCFullYear(i),_!==0&&g.setTime(g.getTime()-_)),g};function o(e){var t=r.exec(e);if(t){var n=parseInt(t[1],10);t[4]&&(n=c(n));var i=parseInt(t[2],10)-1,a=t[3],o=new Date(n,i,a);return l(n)&&o.setFullYear(n),o}}function s(e){if(e.endsWith(`+00`))return 0;var t=i.exec(e.split(` `)[1]);if(t){var n=t[1];if(n===`Z`)return 0;var r=n===`-`?-1:1;return(parseInt(t[2],10)*3600+parseInt(t[3]||0,10)*60+parseInt(t[4]||0,10))*r*1e3}}function c(e){return-(e-1)}function l(e){return e>=0&&e<100}})),Ty=r(((e,t)=>{t.exports=r;var n=Object.prototype.hasOwnProperty;function r(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e}})),Ey=r(((e,t)=>{var n=Ty();t.exports=r;function r(e){if(!(this instanceof r))return new r(e);n(this,g(e))}var i=[`seconds`,`minutes`,`hours`,`days`,`months`,`years`];r.prototype.toPostgres=function(){var e=i.filter(this.hasOwnProperty,this);return this.milliseconds&&e.indexOf(`seconds`)<0&&e.push(`seconds`),e.length===0?`0`:e.map(function(e){var t=this[e]||0;return e===`seconds`&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/\.?0+$/,``)),t+` `+e},this).join(` `)};var a={years:`Y`,months:`M`,days:`D`,hours:`H`,minutes:`M`,seconds:`S`},o=[`years`,`months`,`days`],s=[`hours`,`minutes`,`seconds`];r.prototype.toISOString=r.prototype.toISO=function(){var e=o.map(n,this).join(``),t=s.map(n,this).join(``);return`P`+e+`T`+t;function n(e){var t=this[e]||0;return e===`seconds`&&this.milliseconds&&(t=(t+this.milliseconds/1e3).toFixed(6).replace(/0+$/,``)),t+a[e]}};var c=`([+-]?\\d+)`,l=c+`\\s+years?`,u=c+`\\s+mons?`,d=c+`\\s+days?`,f=new RegExp([l,u,d,`([+-])?([\\d]*):(\\d\\d):(\\d\\d)\\.?(\\d{1,6})?`].map(function(e){return`(`+e+`)?`}).join(`\\s*`)),p={years:2,months:4,days:6,hours:9,minutes:10,seconds:11,milliseconds:12},m=[`hours`,`minutes`,`seconds`,`milliseconds`];function h(e){var t=e+`000000`.slice(e.length);return parseInt(t,10)/1e3}function g(e){if(!e)return{};var t=f.exec(e),n=t[8]===`-`;return Object.keys(p).reduce(function(e,r){var i=t[p[r]];return!i||(i=r===`milliseconds`?h(i):parseInt(i,10),!i)?e:(n&&~m.indexOf(r)&&(i*=-1),e[r]=i,e)},{})}})),Dy=r(((e,t)=>{t.exports=function(e){if(/^\\x/.test(e))return new Buffer(e.substr(2),`hex`);for(var t=``,n=0;n<e.length;)if(e[n]!==`\\`)t+=e[n],++n;else if(/[0-7]{3}/.test(e.substr(n+1,3)))t+=String.fromCharCode(parseInt(e.substr(n+1,3),8)),n+=4;else{for(var r=1;n+r<e.length&&e[n+r]===`\\`;)r++;for(var i=0;i<Math.floor(r/2);++i)t+=`\\`;n+=Math.floor(r/2)*2}return new Buffer(t,`binary`)}})),Oy=r(((e,t)=>{var n=Sy(),r=Cy(),i=wy(),a=Ey(),o=Dy();function s(e){return function(t){return t===null?t:e(t)}}function c(e){return e===null?e:e===`TRUE`||e===`t`||e===`true`||e===`y`||e===`yes`||e===`on`||e===`1`}function l(e){return e?n.parse(e,c):null}function u(e){return parseInt(e,10)}function d(e){return e?n.parse(e,s(u)):null}function f(e){return e?n.parse(e,s(function(e){return b(e).trim()})):null}var p=function(e){return e?r.create(e,function(e){return e!==null&&(e=S(e)),e}).parse():null},m=function(e){return e?r.create(e,function(e){return e!==null&&(e=parseFloat(e)),e}).parse():null},h=function(e){return e?r.create(e).parse():null},g=function(e){return e?r.create(e,function(e){return e!==null&&(e=i(e)),e}).parse():null},_=function(e){return e?r.create(e,function(e){return e!==null&&(e=a(e)),e}).parse():null},v=function(e){return e?n.parse(e,s(o)):null},y=function(e){return parseInt(e,10)},b=function(e){var t=String(e);return/^\d+$/.test(t)?t:e},x=function(e){return e?n.parse(e,s(JSON.parse)):null},S=function(e){return e[0]===`(`?(e=e.substring(1,e.length-1).split(`,`),{x:parseFloat(e[0]),y:parseFloat(e[1])}):null},C=function(e){if(e[0]!==`<`&&e[1]!==`(`)return null;for(var t=`(`,n=``,r=!1,i=2;i<e.length-1;i++){if(r||(t+=e[i]),e[i]===`)`){r=!0;continue}else if(!r)continue;e[i]!==`,`&&(n+=e[i])}var a=S(t);return a.radius=parseFloat(n),a};t.exports={init:function(e){e(20,b),e(21,y),e(23,y),e(26,y),e(700,parseFloat),e(701,parseFloat),e(16,c),e(1082,i),e(1114,i),e(1184,i),e(600,S),e(651,h),e(718,C),e(1e3,l),e(1001,v),e(1005,d),e(1007,d),e(1028,d),e(1016,f),e(1017,p),e(1021,m),e(1022,m),e(1231,m),e(1014,h),e(1015,h),e(1008,h),e(1009,h),e(1040,h),e(1041,h),e(1115,g),e(1182,g),e(1185,g),e(1186,a),e(1187,_),e(17,o),e(114,JSON.parse.bind(JSON)),e(3802,JSON.parse.bind(JSON)),e(199,x),e(3807,x),e(3907,h),e(2951,h),e(791,h),e(1183,h),e(1270,h)}}})),ky=r(((e,t)=>{var n=1e6;function r(e){var t=e.readInt32BE(0),r=e.readUInt32BE(4),i=``;t<0&&(t=~t+(r===0),r=~r+1>>>0,i=`-`);var a=``,o=t%n,s,c,l,u,d;if(t=t/n>>>0,s=4294967296*o+r,r=s/n>>>0,c=``+(s-n*r),r===0&&t===0)return i+c+a;for(l=``,u=6-c.length,d=0;d<u;d++)l+=`0`;if(a=l+c+a,o=t%n,t=t/n>>>0,s=4294967296*o+r,r=s/n>>>0,c=``+(s-n*r),r===0&&t===0)return i+c+a;for(l=``,u=6-c.length,d=0;d<u;d++)l+=`0`;if(a=l+c+a,o=t%n,t=t/n>>>0,s=4294967296*o+r,r=s/n>>>0,c=``+(s-n*r),r===0&&t===0)return i+c+a;for(l=``,u=6-c.length,d=0;d<u;d++)l+=`0`;return a=l+c+a,o=t%n,s=4294967296*o+r,c=``+s%n,i+c+a}t.exports=r})),Ay=r(((e,t)=>{var n=ky(),r=function(e,t,n,r,i){n||=0,r||=!1,i||=function(e,t,n){return e*2**n+t};var a=n>>3,o=function(e){return r?~e&255:e},s=255,c=8-n%8;t<c&&(s=255<<8-t&255,c=t),n&&(s>>=n%8);var l=0;n%8+t>=8&&(l=i(0,o(e[a])&s,c));for(var u=t+n>>3,d=a+1;d<u;d++)l=i(l,o(e[d]),8);var f=(t+n)%8;return f>0&&(l=i(l,o(e[u])>>8-f,f)),l},i=function(e,t,n){var i=2**(n-1)-1,a=r(e,1),o=r(e,n,1);if(o===0)return 0;var s=1,c=r(e,t,n+1,!1,function(e,t,n){e===0&&(e=1);for(var r=1;r<=n;r++)s/=2,(t&1<<n-r)>0&&(e+=s);return e});return o==2**(n+1)-1?c===0?a===0?1/0:-1/0:NaN:(a===0?1:-1)*2**(o-i)*c},a=function(e){return r(e,1)==1?-1*(r(e,15,1,!0)+1):r(e,15,1)},o=function(e){return r(e,1)==1?-1*(r(e,31,1,!0)+1):r(e,31,1)},s=function(e){return i(e,23,8)},c=function(e){return i(e,52,11)},l=function(e){var t=r(e,16,32);if(t==49152)return NaN;for(var n=1e4**r(e,16,16),i=0,a=r(e,16),o=0;o<a;o++)i+=r(e,16,64+16*o)*n,n/=1e4;var s=10**r(e,16,48);return(t===0?1:-1)*Math.round(i*s)/s},u=function(e,t){var n=r(t,1),i=r(t,63,1),a=new Date((n===0?1:-1)*i/1e3+9466848e5);return e||a.setTime(a.getTime()+a.getTimezoneOffset()*6e4),a.usec=i%1e3,a.getMicroSeconds=function(){return this.usec},a.setMicroSeconds=function(e){this.usec=e},a.getUTCMicroSeconds=function(){return this.usec},a},d=function(e){var t=r(e,32);r(e,32,32);for(var n=r(e,32,64),i=96,a=[],o=0;o<t;o++)a[o]=r(e,32,i),i+=32,i+=32;var s=function(t){var n=r(e,32,i);if(i+=32,n==4294967295)return null;var a;if(t==23||t==20)return a=r(e,n*8,i),i+=n*8,a;if(t==25)return a=e.toString(this.encoding,i>>3,(i+=n<<3)>>3),a;console.log(`ERROR: ElementType not implemented: `+t)},c=function(e,t){var n=[],r;if(e.length>1){var i=e.shift();for(r=0;r<i;r++)n[r]=c(e,t);e.unshift(i)}else for(r=0;r<e[0];r++)n[r]=s(t);return n};return c(a,n)},f=function(e){return e.toString(`utf8`)},p=function(e){return e===null?null:r(e,8)>0};t.exports={init:function(e){e(20,n),e(21,a),e(23,o),e(26,o),e(1700,l),e(700,s),e(701,c),e(16,p),e(1114,u.bind(null,!1)),e(1184,u.bind(null,!0)),e(1e3,d),e(1007,d),e(1016,d),e(1008,d),e(1009,d),e(25,f)}}})),jy=r(((e,t)=>{t.exports={BOOL:16,BYTEA:17,CHAR:18,INT8:20,INT2:21,INT4:23,REGPROC:24,TEXT:25,OID:26,TID:27,XID:28,CID:29,JSON:114,XML:142,PG_NODE_TREE:194,SMGR:210,PATH:602,POLYGON:604,CIDR:650,FLOAT4:700,FLOAT8:701,ABSTIME:702,RELTIME:703,TINTERVAL:704,CIRCLE:718,MACADDR8:774,MONEY:790,MACADDR:829,INET:869,ACLITEM:1033,BPCHAR:1042,VARCHAR:1043,DATE:1082,TIME:1083,TIMESTAMP:1114,TIMESTAMPTZ:1184,INTERVAL:1186,TIMETZ:1266,BIT:1560,VARBIT:1562,NUMERIC:1700,REFCURSOR:1790,REGPROCEDURE:2202,REGOPER:2203,REGOPERATOR:2204,REGCLASS:2205,REGTYPE:2206,UUID:2950,TXID_SNAPSHOT:2970,PG_LSN:3220,PG_NDISTINCT:3361,PG_DEPENDENCIES:3402,TSVECTOR:3614,TSQUERY:3615,GTSVECTOR:3642,REGCONFIG:3734,REGDICTIONARY:3769,JSONB:3802,REGNAMESPACE:4089,REGROLE:4096}})),My=r((e=>{var t=Oy(),n=Ay(),r=Cy(),i=jy();e.getTypeParser=s,e.setTypeParser=c,e.arrayParser=r,e.builtins=i;var a={text:{},binary:{}};function o(e){return String(e)}function s(e,t){return t||=`text`,a[t]&&a[t][e]||o}function c(e,t,n){typeof t==`function`&&(n=t,t=`text`),a[t][e]=n}t.init(function(e,t){a.text[e]=t}),n.init(function(e,t){a.binary[e]=t})})),Ny=r(((e,t)=>{t.exports={host:`localhost`,user:process.platform===`win32`?process.env.USERNAME:process.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:``,ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};var n=My(),r=n.getTypeParser(20,`text`),i=n.getTypeParser(1016,`text`);t.exports.__defineSetter__(`parseInt8`,function(e){n.setTypeParser(20,`text`,e?n.getTypeParser(23,`text`):r),n.setTypeParser(1016,`text`,e?n.getTypeParser(1007,`text`):i)})})),Py=r(((e,t)=>{let n=Ny();function r(e){return`"`+e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)+`"`}function i(e){for(var t=`{`,n=0;n<e.length;n++)n>0&&(t+=`,`),e[n]===null||e[n]===void 0?t+=`NULL`:Array.isArray(e[n])?t+=i(e[n]):e[n]instanceof Buffer?t+=`\\\\x`+e[n].toString(`hex`):t+=r(a(e[n]));return t+=`}`,t}var a=function(e,t){if(e==null)return null;if(e instanceof Buffer)return e;if(ArrayBuffer.isView(e)){var r=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return r.length===e.byteLength?r:r.slice(e.byteOffset,e.byteOffset+e.byteLength)}return e instanceof Date?n.parseInputDatesAsUTC?l(e):c(e):Array.isArray(e)?i(e):typeof e==`object`?o(e,t):e.toString()};function o(e,t){if(e&&typeof e.toPostgres==`function`){if(t||=[],t.indexOf(e)!==-1)throw Error(`circular reference detected while preparing "`+e+`" for query`);return t.push(e),a(e.toPostgres(a),t)}return JSON.stringify(e)}function s(e,t){for(e=``+e;e.length<t;)e=`0`+e;return e}function c(e){var t=-e.getTimezoneOffset(),n=e.getFullYear(),r=n<1;r&&(n=Math.abs(n)+1);var i=s(n,4)+`-`+s(e.getMonth()+1,2)+`-`+s(e.getDate(),2)+`T`+s(e.getHours(),2)+`:`+s(e.getMinutes(),2)+`:`+s(e.getSeconds(),2)+`.`+s(e.getMilliseconds(),3);return t<0?(i+=`-`,t*=-1):i+=`+`,i+=s(Math.floor(t/60),2)+`:`+s(t%60,2),r&&(i+=` BC`),i}function l(e){var t=e.getUTCFullYear(),n=t<1;n&&(t=Math.abs(t)+1);var r=s(t,4)+`-`+s(e.getUTCMonth()+1,2)+`-`+s(e.getUTCDate(),2)+`T`+s(e.getUTCHours(),2)+`:`+s(e.getUTCMinutes(),2)+`:`+s(e.getUTCSeconds(),2)+`.`+s(e.getUTCMilliseconds(),3);return r+=`+00:00`,n&&(r+=` BC`),r}function u(e,t,n){return e=typeof e==`string`?{text:e}:e,t&&(typeof t==`function`?e.callback=t:e.values=t),n&&(e.callback=n),e}t.exports={prepareValue:function(e){return a(e)},normalizeQueryConfig:u,escapeIdentifier:function(e){return`"`+e.replace(/"/g,`""`)+`"`},escapeLiteral:function(e){for(var t=!1,n=`'`,r=0;r<e.length;r++){var i=e[r];i===`'`?n+=i+i:i===`\\`?(n+=i+i,t=!0):n+=i}return n+=`'`,t===!0&&(n=` E`+n),n}}})),Fy=r(((t,n)=>{let r=e(`crypto`);function i(e){return r.createHash(`md5`).update(e,`utf-8`).digest(`hex`)}function a(e,t,n){var r=i(t+e);return`md5`+i(Buffer.concat([Buffer.from(r),n]))}function o(e){return r.createHash(`sha256`).update(e).digest()}function s(e,t){return r.createHmac(`sha256`,e).update(t).digest()}async function c(e,t,n){return r.pbkdf2Sync(e,t,n,32,`sha256`)}n.exports={postgresMd5PasswordHash:a,randomBytes:r.randomBytes,deriveKey:c,sha256:o,hmacSha256:s,md5:i}})),Iy=r(((t,n)=>{let r=e(`crypto`);n.exports={postgresMd5PasswordHash:l,randomBytes:s,deriveKey:f,sha256:u,hmacSha256:d,md5:c};let i=r.webcrypto||globalThis.crypto,a=i.subtle,o=new TextEncoder;function s(e){return i.getRandomValues(Buffer.alloc(e))}async function c(e){try{return r.createHash(`md5`).update(e,`utf-8`).digest(`hex`)}catch{let t=typeof e==`string`?o.encode(e):e,n=await a.digest(`MD5`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}}async function l(e,t,n){var r=await c(t+e);return`md5`+await c(Buffer.concat([Buffer.from(r),n]))}async function u(e){return await a.digest(`SHA-256`,e)}async function d(e,t){let n=await a.importKey(`raw`,e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]);return await a.sign(`HMAC`,n,o.encode(t))}async function f(e,t,n){let r=await a.importKey(`raw`,o.encode(e),`PBKDF2`,!1,[`deriveBits`]),i={name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:n};return await a.deriveBits(i,r,256,[`deriveBits`])}})),Ly=r(((e,t)=>{parseInt(process.versions&&process.versions.node&&process.versions.node.split(`.`)[0])<15?t.exports=Fy():t.exports=Iy()})),Ry=r(((e,t)=>{let n=Ly();function r(e){if(e.indexOf(`SCRAM-SHA-256`)===-1)throw Error(`SASL: Only mechanism SCRAM-SHA-256 is currently supported`);let t=n.randomBytes(18).toString(`base64`);return{mechanism:`SCRAM-SHA-256`,clientNonce:t,response:`n,,n=*,r=`+t,message:`SASLInitialResponse`}}async function i(e,t,r){if(e.message!==`SASLInitialResponse`)throw Error(`SASL: Last message was not SASLInitialResponse`);if(typeof t!=`string`)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string`);if(t===``)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string`);if(typeof r!=`string`)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string`);let i=l(r);if(i.nonce.startsWith(e.clientNonce)){if(i.nonce.length===e.clientNonce.length)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce`);var a=`n=*,r=`+e.clientNonce,o=`r=`+i.nonce+`,s=`+i.salt+`,i=`+i.iteration,s=`c=biws,r=`+i.nonce,c=a+`,`+o+`,`+s,u=Buffer.from(i.salt,`base64`),f=await n.deriveKey(t,u,i.iteration),p=await n.hmacSha256(f,`Client Key`),m=await n.sha256(p),h=await n.hmacSha256(m,c),g=d(Buffer.from(p),Buffer.from(h)).toString(`base64`),_=await n.hmacSha256(f,`Server Key`),v=await n.hmacSha256(_,c);e.message=`SASLResponse`,e.serverSignature=Buffer.from(v).toString(`base64`),e.response=s+`,p=`+g}function a(e,t){if(e.message!==`SASLResponse`)throw Error(`SASL: Last message was not SASLResponse`);if(typeof t!=`string`)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string`);let{serverSignature:n}=u(t);if(n!==e.serverSignature)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match`)}function o(e){if(typeof e!=`string`)throw TypeError(`SASL: text must be a string`);return e.split(``).map((t,n)=>e.charCodeAt(n)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function s(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function c(e){if(typeof e!=`string`)throw TypeError(`SASL: attribute pairs text must be a string`);return new Map(e.split(`,`).map(e=>{if(!/^.=/.test(e))throw Error(`SASL: Invalid attribute pair entry`);return[e[0],e.substring(2)]}))}function l(e){let t=c(e),n=t.get(`r`);if(n){if(!o(n))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing`);let r=t.get(`s`);if(r){if(!s(r))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing`);let i=t.get(`i`);if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing`);return{nonce:n,salt:r,iteration:parseInt(i,10)}}function u(e){let t=c(e).get(`v`);if(t){if(!s(t))throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64`)}else throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing`);return{serverSignature:t}}function d(e,t){if(!Buffer.isBuffer(e))throw TypeError(`first argument must be a Buffer`);if(!Buffer.isBuffer(t))throw TypeError(`second argument must be a Buffer`);if(e.length!==t.length)throw Error(`Buffer lengths must match`);if(e.length===0)throw Error(`Buffers cannot be empty`);return Buffer.from(e.map((n,r)=>e[r]^t[r]))}t.exports={startSession:r,continueSession:i,finalizeSession:a}})),zy=r(((e,t)=>{var n=My();function r(e){this._types=e||n,this.text={},this.binary={}}r.prototype.getOverrides=function(e){switch(e){case`text`:return this.text;case`binary`:return this.binary;default:return{}}},r.prototype.setTypeParser=function(e,t,n){typeof t==`function`&&(n=t,t=`text`),this.getOverrides(t)[e]=n},r.prototype.getTypeParser=function(e,t){return t||=`text`,this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=r})),By=r(((t,n)=>{function r(t,n={}){if(t.charAt(0)===`/`){let e=t.split(` `);return{host:e[0],database:e[1]}}let r={},i,a=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(t)&&(t=encodeURI(t).replace(/%25(\d\d)/g,`%$1`));try{try{i=new URL(t,`postgres://base`)}catch{i=new URL(t.replace(`@/`,`@___DUMMY___/`),`postgres://base`),a=!0}}catch(e){e.input&&=`*****REDACTED*****`}for(let e of i.searchParams.entries())r[e[0]]=e[1];if(r.user=r.user||decodeURIComponent(i.username),r.password=r.password||decodeURIComponent(i.password),i.protocol==`socket:`)return r.host=decodeURI(i.pathname),r.database=i.searchParams.get(`db`),r.client_encoding=i.searchParams.get(`encoding`),r;let o=a?``:i.hostname;r.host?o&&/^%2f/i.test(o)&&(i.pathname=o+i.pathname):r.host=decodeURIComponent(o),r.port||=i.port;let s=i.pathname.slice(1)||null;r.database=s?decodeURI(s):null,(r.ssl===`true`||r.ssl===`1`)&&(r.ssl=!0),r.ssl===`0`&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});let c=r.sslcert||r.sslkey||r.sslrootcert?e(`fs`):null;if(r.sslcert&&(r.ssl.cert=c.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=c.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=c.readFileSync(r.sslrootcert).toString()),n.useLibpqCompat&&r.uselibpqcompat)throw Error(`Both useLibpqCompat and uselibpqcompat are set. Please use only one of them.`);if(r.uselibpqcompat===`true`||n.useLibpqCompat)switch(r.sslmode){case`disable`:r.ssl=!1;break;case`prefer`:r.ssl.rejectUnauthorized=!1;break;case`require`:r.sslrootcert?r.ssl.checkServerIdentity=function(){}:r.ssl.rejectUnauthorized=!1;break;case`verify-ca`:if(!r.ssl.ca)throw Error(`SECURITY WARNING: Using sslmode=verify-ca requires specifying a CA with sslrootcert. If a public CA is used, verify-ca allows connections to a server that somebody else may have registered with the CA, making you vulnerable to Man-in-the-Middle attacks. Either specify a custom CA certificate with sslrootcert parameter or use sslmode=verify-full for proper security.`);r.ssl.checkServerIdentity=function(){};break;case`verify-full`:break}else switch(r.sslmode){case`disable`:r.ssl=!1;break;case`prefer`:case`require`:case`verify-ca`:case`verify-full`:break;case`no-verify`:r.ssl.rejectUnauthorized=!1;break}return r}function i(e){return Object.entries(e).reduce((e,[t,n])=>(n!=null&&(e[t]=n),e),{})}function a(e){return Object.entries(e).reduce((e,[t,n])=>{if(t===`ssl`){let r=n;typeof r==`boolean`&&(e[t]=r),typeof r==`object`&&(e[t]=i(r))}else if(n!=null)if(t===`port`){if(n!==``){let r=parseInt(n,10);if(isNaN(r))throw Error(`Invalid ${t}: ${n}`);e[t]=r}}else e[t]=n;return e},{})}function o(e){return a(r(e))}n.exports=r,r.parse=r,r.toClientConfig=a,r.parseIntoClientConfig=o})),Vy=r(((t,n)=>{var r=e(`dns`),i=Ny(),a=By().parse,o=function(e,t,n){return n===void 0?n=process.env[`PG`+e.toUpperCase()]:n===!1||(n=process.env[n]),t[e]||n||i[e]},s=function(){switch(process.env.PGSSLMODE){case`disable`:return!1;case`prefer`:case`require`:case`verify-ca`:case`verify-full`:return!0;case`no-verify`:return{rejectUnauthorized:!1}}return i.ssl},c=function(e){return`'`+(``+e).replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)+`'`},l=function(e,t,n){var r=t[n];r!=null&&e.push(n+`=`+c(r))};n.exports=class{constructor(e){e=typeof e==`string`?a(e):e||{},e.connectionString&&(e=Object.assign({},e,a(e.connectionString))),this.user=o(`user`,e),this.database=o(`database`,e),this.database===void 0&&(this.database=this.user),this.port=parseInt(o(`port`,e),10),this.host=o(`host`,e),Object.defineProperty(this,`password`,{configurable:!0,enumerable:!1,writable:!0,value:o(`password`,e)}),this.binary=o(`binary`,e),this.options=o(`options`,e),this.ssl=e.ssl===void 0?s():e.ssl,typeof this.ssl==`string`&&this.ssl===`true`&&(this.ssl=!0),this.ssl===`no-verify`&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,`key`,{enumerable:!1}),this.client_encoding=o(`client_encoding`,e),this.replication=o(`replication`,e),this.isDomainSocket=!(this.host||``).indexOf(`/`),this.application_name=o(`application_name`,e,`PGAPPNAME`),this.fallback_application_name=o(`fallback_application_name`,e,!1),this.statement_timeout=o(`statement_timeout`,e,!1),this.lock_timeout=o(`lock_timeout`,e,!1),this.idle_in_transaction_session_timeout=o(`idle_in_transaction_session_timeout`,e,!1),this.query_timeout=o(`query_timeout`,e,!1),e.connectionTimeoutMillis===void 0?this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis==`number`&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){var t=[];l(t,this,`user`),l(t,this,`password`),l(t,this,`port`),l(t,this,`application_name`),l(t,this,`fallback_application_name`),l(t,this,`connect_timeout`),l(t,this,`options`);var n=typeof this.ssl==`object`?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(l(t,n,`sslmode`),l(t,n,`sslca`),l(t,n,`sslkey`),l(t,n,`sslcert`),l(t,n,`sslrootcert`),this.database&&t.push(`dbname=`+c(this.database)),this.replication&&t.push(`replication=`+c(this.replication)),this.host&&t.push(`host=`+c(this.host)),this.isDomainSocket)return e(null,t.join(` `));this.client_encoding&&t.push(`client_encoding=`+c(this.client_encoding)),r.lookup(this.host,function(n,r){return n?e(n,null):(t.push(`hostaddr=`+c(r)),e(null,t.join(` `)))})}}})),Hy=r(((e,t)=>{var n=My(),r=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;t.exports=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray=e===`array`,this.rowAsArray&&(this.parseRow=this._parseRowAsArray),this._prebuiltEmptyResultObject=null}addCommandComplete(e){var t=e.text?r.exec(e.text):r.exec(e.command);t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++){var i=e[n];i===null?t[n]=null:t[n]=this._parsers[n](i)}return t}parseRow(e){for(var t={...this._prebuiltEmptyResultObject},n=0,r=e.length;n<r;n++){var i=e[n],a=this.fields[n].name;i!==null&&(t[a]=this._parsers[n](i))}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));for(var t=0;t<e.length;t++){var r=e[t];this._types?this._parsers[t]=this._types.getTypeParser(r.dataTypeID,r.format||`text`):this._parsers[t]=n.getTypeParser(r.dataTypeID,r.format||`text`)}this._createPrebuiltEmptyResultObject()}_createPrebuiltEmptyResultObject(){for(var e={},t=0;t<this.fields.length;t++)e[this.fields[t].name]=null;this._prebuiltEmptyResultObject={...e}}}})),Uy=r(((t,n)=>{let{EventEmitter:r}=e(`events`),i=Hy(),a=Py();n.exports=class extends r{constructor(e,t,n){super(),e=a.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.binary=e.binary,this.portal=e.portal||``,this.callback=e.callback,this._rowMode=e.rowMode,process.domain&&e.callback&&(this.callback=process.domain.bind(e.callback)),this._result=new i(this._rowMode,this.types),this._results=this._result,this.isPreparedStatement=!1,this._canceledDueToError=!1,this._promise=null}requiresPreparation(){return this.name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new i(this._rowMode,this.types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners(`row`).length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit(`row`,t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&=(e=this._canceledDueToError,!1),this.callback)return this.callback(e);this.emit(`error`,e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){process.nextTick(()=>{throw e})}this.emit(`end`,this._results)}submit(e){if(typeof this.text!=`string`&&typeof this.name!=`string`)return Error(`A query must have either text or a name. Supplying neither is unsupported.`);let t=e.parsedStatements[this.name];return this.text&&t&&this.text!==t?Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`):this.values&&!Array.isArray(this.values)?Error(`Query values must be an array`):(this.requiresPreparation()?this.prepare(e):e.query(this.text),null)}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.isPreparedStatement=!0,this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:a.prepareValue})}catch(t){this.handleError(t,e);return}e.describe({type:`P`,name:this.portal||``}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail(`No source stream defined`)}handleCopyData(e,t){}}})),Wy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NoticeMessage=e.DataRowMessage=e.CommandCompleteMessage=e.ReadyForQueryMessage=e.NotificationResponseMessage=e.BackendKeyDataMessage=e.AuthenticationMD5Password=e.ParameterStatusMessage=e.ParameterDescriptionMessage=e.RowDescriptionMessage=e.Field=e.CopyResponse=e.CopyDataMessage=e.DatabaseError=e.copyDone=e.emptyQuery=e.replicationStart=e.portalSuspended=e.noData=e.closeComplete=e.bindComplete=e.parseComplete=void 0,e.parseComplete={name:`parseComplete`,length:5},e.bindComplete={name:`bindComplete`,length:5},e.closeComplete={name:`closeComplete`,length:5},e.noData={name:`noData`,length:5},e.portalSuspended={name:`portalSuspended`,length:5},e.replicationStart={name:`replicationStart`,length:4},e.emptyQuery={name:`emptyQuery`,length:4},e.copyDone={name:`copyDone`,length:4},e.DatabaseError=class extends Error{constructor(e,t,n){super(e),this.length=t,this.name=n}},e.CopyDataMessage=class{constructor(e,t){this.length=e,this.chunk=t,this.name=`copyData`}},e.CopyResponse=class{constructor(e,t,n,r){this.length=e,this.name=t,this.binary=n,this.columnTypes=Array(r)}},e.Field=class{constructor(e,t,n,r,i,a,o){this.name=e,this.tableID=t,this.columnID=n,this.dataTypeID=r,this.dataTypeSize=i,this.dataTypeModifier=a,this.format=o}},e.RowDescriptionMessage=class{constructor(e,t){this.length=e,this.fieldCount=t,this.name=`rowDescription`,this.fields=Array(this.fieldCount)}},e.ParameterDescriptionMessage=class{constructor(e,t){this.length=e,this.parameterCount=t,this.name=`parameterDescription`,this.dataTypeIDs=Array(this.parameterCount)}},e.ParameterStatusMessage=class{constructor(e,t,n){this.length=e,this.parameterName=t,this.parameterValue=n,this.name=`parameterStatus`}},e.AuthenticationMD5Password=class{constructor(e,t){this.length=e,this.salt=t,this.name=`authenticationMD5Password`}},e.BackendKeyDataMessage=class{constructor(e,t,n){this.length=e,this.processID=t,this.secretKey=n,this.name=`backendKeyData`}},e.NotificationResponseMessage=class{constructor(e,t,n,r){this.length=e,this.processId=t,this.channel=n,this.payload=r,this.name=`notification`}},e.ReadyForQueryMessage=class{constructor(e,t){this.length=e,this.status=t,this.name=`readyForQuery`}},e.CommandCompleteMessage=class{constructor(e,t){this.length=e,this.text=t,this.name=`commandComplete`}},e.DataRowMessage=class{constructor(e,t){this.length=e,this.fields=t,this.name=`dataRow`,this.fieldCount=t.length}},e.NoticeMessage=class{constructor(e,t){this.length=e,this.message=t,this.name=`notice`}}})),Gy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Writer=void 0,e.Writer=class{constructor(e=256){this.size=e,this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(e)}ensure(e){if(this.buffer.length-this.offset<e){let t=this.buffer,n=t.length+(t.length>>1)+e;this.buffer=Buffer.allocUnsafe(n),t.copy(this.buffer)}}addInt32(e){return this.ensure(4),this.buffer[this.offset++]=e>>>24&255,this.buffer[this.offset++]=e>>>16&255,this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addInt16(e){return this.ensure(2),this.buffer[this.offset++]=e>>>8&255,this.buffer[this.offset++]=e>>>0&255,this}addCString(e){if(!e)this.ensure(1);else{let t=Buffer.byteLength(e);this.ensure(t+1),this.buffer.write(e,this.offset,`utf-8`),this.offset+=t}return this.buffer[this.offset++]=0,this}addString(e=``){let t=Buffer.byteLength(e);return this.ensure(t),this.buffer.write(e,this.offset),this.offset+=t,this}add(e){return this.ensure(e.length),e.copy(this.buffer,this.offset),this.offset+=e.length,this}join(e){if(e){this.buffer[this.headerPosition]=e;let t=this.offset-(this.headerPosition+1);this.buffer.writeInt32BE(t,this.headerPosition+1)}return this.buffer.slice(e?0:5,this.offset)}flush(e){let t=this.join(e);return this.offset=5,this.headerPosition=0,this.buffer=Buffer.allocUnsafe(this.size),t}}})),Ky=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.serialize=void 0;let t=Gy(),n=new t.Writer,r=e=>{n.addInt16(3).addInt16(0);for(let t of Object.keys(e))n.addCString(t).addCString(e[t]);n.addCString(`client_encoding`).addCString(`UTF8`);let r=n.addCString(``).flush(),i=r.length+4;return new t.Writer().addInt32(i).add(r).flush()},i=()=>{let e=Buffer.allocUnsafe(8);return e.writeInt32BE(8,0),e.writeInt32BE(80877103,4),e},a=e=>n.addCString(e).flush(112),o=function(e,t){return n.addCString(e).addInt32(Buffer.byteLength(t)).addString(t),n.flush(112)},s=function(e){return n.addString(e).flush(112)},c=e=>n.addCString(e).flush(81),l=[],u=e=>{let t=e.name||``;t.length>63&&(console.error(`Warning! Postgres only supports 63 characters for query names.`),console.error(`You supplied %s (%s)`,t,t.length),console.error(`This can cause conflicts and silent errors executing queries`));let r=e.types||l,i=r.length,a=n.addCString(t).addCString(e.text).addInt16(i);for(let e=0;e<i;e++)a.addInt32(r[e]);return n.flush(80)},d=new t.Writer,f=function(e,t){for(let r=0;r<e.length;r++){let i=t?t(e[r],r):e[r];i==null?(n.addInt16(0),d.addInt32(-1)):i instanceof Buffer?(n.addInt16(1),d.addInt32(i.length),d.add(i)):(n.addInt16(0),d.addInt32(Buffer.byteLength(i)),d.addString(i))}},p=(e={})=>{let t=e.portal||``,r=e.statement||``,i=e.binary||!1,a=e.values||l,o=a.length;return n.addCString(t).addCString(r),n.addInt16(o),f(a,e.valueMapper),n.addInt16(o),n.add(d.flush()),n.addInt16(1),n.addInt16(i?1:0),n.flush(66)},m=Buffer.from([69,0,0,0,9,0,0,0,0,0]),h=e=>{if(!e||!e.portal&&!e.rows)return m;let t=e.portal||``,n=e.rows||0,r=Buffer.byteLength(t),i=4+r+1+4,a=Buffer.allocUnsafe(1+i);return a[0]=69,a.writeInt32BE(i,1),a.write(t,5,`utf-8`),a[r+5]=0,a.writeUInt32BE(n,a.length-4),a},g=(e,t)=>{let n=Buffer.allocUnsafe(16);return n.writeInt32BE(16,0),n.writeInt16BE(1234,4),n.writeInt16BE(5678,6),n.writeInt32BE(e,8),n.writeInt32BE(t,12),n},_=(e,t)=>{let n=4+Buffer.byteLength(t)+1,r=Buffer.allocUnsafe(1+n);return r[0]=e,r.writeInt32BE(n,1),r.write(t,5,`utf-8`),r[n]=0,r},v=n.addCString(`P`).flush(68),y=n.addCString(`S`).flush(68),b=e=>e.name?_(68,`${e.type}${e.name||``}`):e.type===`P`?v:y,x=e=>_(67,`${e.type}${e.name||``}`),S=e=>n.add(e).flush(100),C=e=>_(102,e),w=e=>Buffer.from([e,0,0,0,4]),T=w(72),E=w(83),ee=w(88),te=w(99);e.serialize={startup:r,password:a,requestSsl:i,sendSASLInitialResponseMessage:o,sendSCRAMClientFinalMessage:s,query:c,parse:u,bind:p,execute:h,describe:b,close:x,flush:()=>T,sync:()=>E,end:()=>ee,copyData:S,copyDone:()=>te,copyFail:C,cancel:g}})),qy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BufferReader=void 0;let t=Buffer.allocUnsafe(0);e.BufferReader=class{constructor(e=0){this.offset=e,this.buffer=t,this.encoding=`utf-8`}setBuffer(e,t){this.offset=e,this.buffer=t}int16(){let e=this.buffer.readInt16BE(this.offset);return this.offset+=2,e}byte(){let e=this.buffer[this.offset];return this.offset++,e}int32(){let e=this.buffer.readInt32BE(this.offset);return this.offset+=4,e}uint32(){let e=this.buffer.readUInt32BE(this.offset);return this.offset+=4,e}string(e){let t=this.buffer.toString(this.encoding,this.offset,this.offset+e);return this.offset+=e,t}cstring(){let e=this.offset,t=e;for(;this.buffer[t++]!==0;);return this.offset=t,this.buffer.toString(this.encoding,e,t-1)}bytes(e){let t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}}})),Jy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Parser=void 0;let t=Wy(),n=qy(),r=Buffer.allocUnsafe(0);e.Parser=class{constructor(e){if(this.buffer=r,this.bufferLength=0,this.bufferOffset=0,this.reader=new n.BufferReader,e?.mode===`binary`)throw Error(`Binary mode not supported yet`);this.mode=e?.mode||`text`}parse(e,t){this.mergeBuffer(e);let n=this.bufferOffset+this.bufferLength,i=this.bufferOffset;for(;i+5<=n;){let e=this.buffer[i],r=this.buffer.readUInt32BE(i+1),a=1+r;if(a+i<=n)t(this.handlePacket(i+5,e,r,this.buffer)),i+=a;else break}i===n?(this.buffer=r,this.bufferLength=0,this.bufferOffset=0):(this.bufferLength=n-i,this.bufferOffset=i)}mergeBuffer(e){if(this.bufferLength>0){let t=this.bufferLength+e.byteLength;if(t+this.bufferOffset>this.buffer.byteLength){let e;if(t<=this.buffer.byteLength&&this.bufferOffset>=this.bufferLength)e=this.buffer;else{let n=this.buffer.byteLength*2;for(;t>=n;)n*=2;e=Buffer.allocUnsafe(n)}this.buffer.copy(e,0,this.bufferOffset,this.bufferOffset+this.bufferLength),this.buffer=e,this.bufferOffset=0}e.copy(this.buffer,this.bufferOffset+this.bufferLength),this.bufferLength=t}else this.buffer=e,this.bufferOffset=0,this.bufferLength=e.byteLength}handlePacket(e,n,r,i){switch(n){case 50:return t.bindComplete;case 49:return t.parseComplete;case 51:return t.closeComplete;case 110:return t.noData;case 115:return t.portalSuspended;case 99:return t.copyDone;case 87:return t.replicationStart;case 73:return t.emptyQuery;case 68:return this.parseDataRowMessage(e,r,i);case 67:return this.parseCommandCompleteMessage(e,r,i);case 90:return this.parseReadyForQueryMessage(e,r,i);case 65:return this.parseNotificationMessage(e,r,i);case 82:return this.parseAuthenticationResponse(e,r,i);case 83:return this.parseParameterStatusMessage(e,r,i);case 75:return this.parseBackendKeyData(e,r,i);case 69:return this.parseErrorMessage(e,r,i,`error`);case 78:return this.parseErrorMessage(e,r,i,`notice`);case 84:return this.parseRowDescriptionMessage(e,r,i);case 116:return this.parseParameterDescriptionMessage(e,r,i);case 71:return this.parseCopyInMessage(e,r,i);case 72:return this.parseCopyOutMessage(e,r,i);case 100:return this.parseCopyData(e,r,i);default:return new t.DatabaseError(`received invalid response: `+n.toString(16),r,`error`)}}parseReadyForQueryMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.string(1);return new t.ReadyForQueryMessage(n,i)}parseCommandCompleteMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.cstring();return new t.CommandCompleteMessage(n,i)}parseCopyData(e,n,r){let i=r.slice(e,e+(n-4));return new t.CopyDataMessage(n,i)}parseCopyInMessage(e,t,n){return this.parseCopyMessage(e,t,n,`copyInResponse`)}parseCopyOutMessage(e,t,n){return this.parseCopyMessage(e,t,n,`copyOutResponse`)}parseCopyMessage(e,n,r,i){this.reader.setBuffer(e,r);let a=this.reader.byte()!==0,o=this.reader.int16(),s=new t.CopyResponse(n,i,a,o);for(let e=0;e<o;e++)s.columnTypes[e]=this.reader.int16();return s}parseNotificationMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.int32(),a=this.reader.cstring(),o=this.reader.cstring();return new t.NotificationResponseMessage(n,i,a,o)}parseRowDescriptionMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.int16(),a=new t.RowDescriptionMessage(n,i);for(let e=0;e<i;e++)a.fields[e]=this.parseField();return a}parseField(){let e=this.reader.cstring(),n=this.reader.uint32(),r=this.reader.int16(),i=this.reader.uint32(),a=this.reader.int16(),o=this.reader.int32(),s=this.reader.int16()===0?`text`:`binary`;return new t.Field(e,n,r,i,a,o,s)}parseParameterDescriptionMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.int16(),a=new t.ParameterDescriptionMessage(n,i);for(let e=0;e<i;e++)a.dataTypeIDs[e]=this.reader.int32();return a}parseDataRowMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.int16(),a=Array(i);for(let e=0;e<i;e++){let t=this.reader.int32();a[e]=t===-1?null:this.reader.string(t)}return new t.DataRowMessage(n,a)}parseParameterStatusMessage(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.cstring(),a=this.reader.cstring();return new t.ParameterStatusMessage(n,i,a)}parseBackendKeyData(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.int32(),a=this.reader.int32();return new t.BackendKeyDataMessage(n,i,a)}parseAuthenticationResponse(e,n,r){this.reader.setBuffer(e,r);let i=this.reader.int32(),a={name:`authenticationOk`,length:n};switch(i){case 0:break;case 3:a.length===8&&(a.name=`authenticationCleartextPassword`);break;case 5:if(a.length===12){a.name=`authenticationMD5Password`;let e=this.reader.bytes(4);return new t.AuthenticationMD5Password(n,e)}break;case 10:{a.name=`authenticationSASL`,a.mechanisms=[];let e;do e=this.reader.cstring(),e&&a.mechanisms.push(e);while(e)}break;case 11:a.name=`authenticationSASLContinue`,a.data=this.reader.string(n-8);break;case 12:a.name=`authenticationSASLFinal`,a.data=this.reader.string(n-8);break;default:throw Error(`Unknown authenticationOk message type `+i)}return a}parseErrorMessage(e,n,r,i){this.reader.setBuffer(e,r);let a={},o=this.reader.string(1);for(;o!==`\0`;)a[o]=this.reader.cstring(),o=this.reader.string(1);let s=a.M,c=i===`notice`?new t.NoticeMessage(n,s):new t.DatabaseError(s,n,i);return c.severity=a.S,c.code=a.C,c.detail=a.D,c.hint=a.H,c.position=a.P,c.internalPosition=a.p,c.internalQuery=a.q,c.where=a.W,c.schema=a.s,c.table=a.t,c.column=a.c,c.dataType=a.d,c.constraint=a.n,c.file=a.F,c.line=a.L,c.routine=a.R,c}}})),Yy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DatabaseError=e.serialize=e.parse=void 0;let t=Wy();Object.defineProperty(e,`DatabaseError`,{enumerable:!0,get:function(){return t.DatabaseError}});let n=Ky();Object.defineProperty(e,`serialize`,{enumerable:!0,get:function(){return n.serialize}});let r=Jy();function i(e,t){let n=new r.Parser;return e.on(`data`,e=>n.parse(e,t)),new Promise(t=>e.on(`end`,()=>t()))}e.parse=i})),Xy=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default={}})),Zy=r(((t,n)=>{n.exports.getStream=function(t){let n=e(`net`);if(typeof n.Socket==`function`)return new n.Socket;{let{CloudflareSocket:e}=Xy();return new e(t)}},n.exports.getSecureStream=function(t){var n=e(`tls`);return n.connect?n.connect(t):(t.socket.startTls(t),t.socket)}})),Qy=r(((t,n)=>{e(`net`);var r=e(`events`).EventEmitter;let{parse:i,serialize:a}=Yy(),{getStream:o,getSecureStream:s}=Zy(),c=a.flush(),l=a.sync(),u=a.end();n.exports=class extends r{constructor(e){super(),e||={},this.stream=e.stream||o(e.ssl),typeof this.stream==`function`&&(this.stream=this.stream(e)),this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;var t=this;this.on(`newListener`,function(e){e===`message`&&(t._emitMessage=!0)})}connect(t,n){var r=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(t,n),this.stream.once(`connect`,function(){r._keepAlive&&r.stream.setKeepAlive(!0,r._keepAliveInitialDelayMillis),r.emit(`connect`)});let i=function(e){r._ending&&(e.code===`ECONNRESET`||e.code===`EPIPE`)||r.emit(`error`,e)};if(this.stream.on(`error`,i),this.stream.on(`close`,function(){r.emit(`end`)}),!this.ssl)return this.attachListeners(this.stream);this.stream.once(`data`,function(t){switch(t.toString(`utf8`)){case`S`:break;case`N`:return r.stream.end(),r.emit(`error`,Error(`The server does not support SSL connections`));default:return r.stream.end(),r.emit(`error`,Error(`There was an error establishing an SSL connection`))}let a={socket:r.stream};r.ssl!==!0&&(Object.assign(a,r.ssl),`key`in r.ssl&&(a.key=r.ssl.key));var o=e(`net`);o.isIP&&o.isIP(n)===0&&(a.servername=n);try{r.stream=s(a)}catch(e){return r.emit(`error`,e)}r.attachListeners(r.stream),r.stream.on(`error`,i),r.emit(`sslconnect`)})}attachListeners(e){i(e,e=>{var t=e.name===`error`?`errorMessage`:e.name;this._emitMessage&&this.emit(`message`,e),this.emit(t,e)})}requestSsl(){this.stream.write(a.requestSsl())}startup(e){this.stream.write(a.startup(e))}cancel(e,t){this._send(a.cancel(e,t))}password(e){this._send(a.password(e))}sendSASLInitialResponseMessage(e,t){this._send(a.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(a.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(a.query(e))}parse(e){this._send(a.parse(e))}bind(e){this._send(a.bind(e))}execute(e){this._send(a.execute(e))}flush(){this.stream.writable&&this.stream.write(c)}sync(){this._ending=!0,this._send(l)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(u,()=>{this.stream.end()})}close(e){this._send(a.close(e))}describe(e){this._send(a.describe(e))}sendCopyFromChunk(e){this._send(a.copyData(e))}endCopyFrom(){this._send(a.copyDone())}sendCopyFail(e){this._send(a.copyFail(e))}}})),$y=r(((t,n)=>{let{Transform:r}=e(`stream`),{StringDecoder:i}=e(`string_decoder`),a=Symbol(`last`),o=Symbol(`decoder`);function s(e,t,n){let r;if(this.overflow){if(r=this[o].write(e).split(this.matcher),r.length===1)return n();r.shift(),this.overflow=!1}else this[a]+=this[o].write(e),r=this[a].split(this.matcher);this[a]=r.pop();for(let e=0;e<r.length;e++)try{l(this,this.mapper(r[e]))}catch(e){return n(e)}if(this.overflow=this[a].length>this.maxLength,this.overflow&&!this.skipOverflow){n(Error(`maximum buffer reached`));return}n()}function c(e){if(this[a]+=this[o].end(),this[a])try{l(this,this.mapper(this[a]))}catch(t){return e(t)}e()}function l(e,t){t!==void 0&&e.push(t)}function u(e){return e}function d(e,t,n){switch(e||=/\r?\n/,t||=u,n||={},arguments.length){case 1:typeof e==`function`?(t=e,e=/\r?\n/):typeof e==`object`&&!(e instanceof RegExp)&&!e[Symbol.split]&&(n=e,e=/\r?\n/);break;case 2:typeof e==`function`?(n=t,t=e,e=/\r?\n/):typeof t==`object`&&(n=t,t=u)}n=Object.assign({},n),n.autoDestroy=!0,n.transform=s,n.flush=c,n.readableObjectMode=!0;let l=new r(n);return l[a]=``,l[o]=new i(`utf8`),l.matcher=e,l.mapper=t,l.maxLength=n.maxLength,l.skipOverflow=n.skipOverflow||!1,l.overflow=!1,l._destroy=function(e,t){this._writableState.errorEmitted=!1,t(e)},l}n.exports=d})),eb=r(((t,n)=>{var r=e(`path`),i=e(`stream`).Stream,a=$y(),o=e(`util`),s=5432,c=process.platform===`win32`,l=process.stderr,u=56,d=7,f=61440,p=32768;function m(e){return(e&f)==p}var h=[`host`,`port`,`database`,`user`,`password`],g=h.length,_=h[g-1];function v(){if(l instanceof i&&!0===l.writable){var e=Array.prototype.slice.call(arguments).concat(`
30
+ `);l.write(o.format.apply(o,e))}}Object.defineProperty(n.exports,`isWin`,{get:function(){return c},set:function(e){c=e}}),n.exports.warnTo=function(e){var t=l;return l=e,t},n.exports.getFileName=function(e){var t=e||process.env;return t.PGPASSFILE||(c?r.join(t.APPDATA||`./`,`postgresql`,`pgpass.conf`):r.join(t.HOME||`./`,`.pgpass`))},n.exports.usePgPass=function(e,t){return Object.prototype.hasOwnProperty.call(process.env,`PGPASSWORD`)?!1:c?!0:(t||=`<unkn>`,m(e.mode)?e.mode&(u|d)?(v(`WARNING: password file "%s" has group or world access; permissions should be u=rw (0600) or less`,t),!1):!0:(v(`WARNING: password file "%s" is not a plain file`,t),!1))};var y=n.exports.match=function(e,t){return h.slice(0,-1).reduce(function(n,r,i){return i==1&&Number(e[r]||s)===Number(t[r])?n&&!0:n&&(t[r]===`*`||t[r]===e[r])},!0)};n.exports.getPassword=function(e,t,n){var r,i=t.pipe(a());function o(t){var n=b(t);n&&x(n)&&y(e,n)&&(r=n[_],i.end())}var s=function(){t.destroy(),n(r)},c=function(e){t.destroy(),v(`WARNING: error on reading file: %s`,e),n(void 0)};t.on(`error`,c),i.on(`data`,o).on(`end`,s).on(`error`,c)};var b=n.exports.parseLine=function(e){if(e.length<11||e.match(/^\s+#/))return null;for(var t=``,n=``,r=0,i=0,a={},o=!1,s=function(t,n,r){var i=e.substring(n,r);Object.hasOwnProperty.call(process.env,`PGPASS_NO_DEESCAPE`)||(i=i.replace(/\\([:\\])/g,`$1`)),a[h[t]]=i},c=0;c<e.length-1;c+=1){if(t=e.charAt(c+1),n=e.charAt(c),o=r==g-1,o){s(r,i);break}c>=0&&t==`:`&&n!==`\\`&&(s(r,i,c+1),i=c+2,r+=1)}return a=Object.keys(a).length===g?a:null,a},x=n.exports.isValidEntry=function(e){for(var t={0:function(e){return e.length>0},1:function(e){return e===`*`?!0:(e=Number(e),isFinite(e)&&e>0&&e<9007199254740992&&Math.floor(e)===e)},2:function(e){return e.length>0},3:function(e){return e.length>0},4:function(e){return e.length>0}},n=0;n<h.length;n+=1){var r=t[n];if(!r(e[h[n]]||``))return!1}return!0}})),tb=r(((t,n)=>{e(`path`);var r=e(`fs`),i=eb();n.exports=function(e,t){var n=i.getFileName();r.stat(n,function(a,o){if(a||!i.usePgPass(o,n))return t(void 0);var s=r.createReadStream(n);i.getPassword(e,s,t)})},n.exports.warnTo=i.warnTo})),nb=r(((t,n)=>{var r=e(`events`).EventEmitter,i=Py(),a=Ry(),o=zy(),s=Vy(),c=Uy(),l=Ny(),u=Qy();let d=Ly();var f=class extends r{constructor(e){super(),this.connectionParameters=new s(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,`password`,{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;var t=e||{};this._Promise=t.Promise||global.Promise,this._types=new o(t.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.connection=t.connection||new u({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||`utf8`}),this.queryQueue=[],this.binary=t.binary||l.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,`key`,{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=t=>{process.nextTick(()=>{t.handleError(e,this.connection)})};this.activeQuery&&=(t(this.activeQuery),null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){var t=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error(`Client has already been connected. You cannot reuse a client.`);process.nextTick(()=>{e(t)});return}this._connecting=!0,this.connectionTimeoutHandle,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(Error(`timeout expired`))},this._connectionTimeoutMillis)),this.host&&this.host.indexOf(`/`)===0?n.connect(this.host+`/.s.PGSQL.`+this.port):n.connect(this.port,this.host),n.on(`connect`,function(){t.ssl?n.requestSsl():n.startup(t.getStartupConf())}),n.on(`sslconnect`,function(){n.startup(t.getStartupConf())}),this._attachListeners(n),n.once(`end`,()=>{let e=this._ending?Error(`Connection terminated`):Error(`Connection terminated unexpectedly`);clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ended=!0,this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),process.nextTick(()=>{this.emit(`end`)})})}connect(e){if(e){this._connect(e);return}return new this._Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})}_attachListeners(e){e.on(`authenticationCleartextPassword`,this._handleAuthCleartextPassword.bind(this)),e.on(`authenticationMD5Password`,this._handleAuthMD5Password.bind(this)),e.on(`authenticationSASL`,this._handleAuthSASL.bind(this)),e.on(`authenticationSASLContinue`,this._handleAuthSASLContinue.bind(this)),e.on(`authenticationSASLFinal`,this._handleAuthSASLFinal.bind(this)),e.on(`backendKeyData`,this._handleBackendKeyData.bind(this)),e.on(`error`,this._handleErrorEvent.bind(this)),e.on(`errorMessage`,this._handleErrorMessage.bind(this)),e.on(`readyForQuery`,this._handleReadyForQuery.bind(this)),e.on(`notice`,this._handleNotice.bind(this)),e.on(`rowDescription`,this._handleRowDescription.bind(this)),e.on(`dataRow`,this._handleDataRow.bind(this)),e.on(`portalSuspended`,this._handlePortalSuspended.bind(this)),e.on(`emptyQuery`,this._handleEmptyQuery.bind(this)),e.on(`commandComplete`,this._handleCommandComplete.bind(this)),e.on(`parseComplete`,this._handleParseComplete.bind(this)),e.on(`copyInResponse`,this._handleCopyInResponse.bind(this)),e.on(`copyData`,this._handleCopyData.bind(this)),e.on(`notification`,this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;if(typeof this.password==`function`)this._Promise.resolve().then(()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!=`string`){t.emit(`error`,TypeError(`Password must be a string`));return}this.connectionParameters.password=this.password=n}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit(`error`,e)});else if(this.password!==null)e();else try{tb()(this.connectionParameters,t=>{t!==void 0&&(this.connectionParameters.password=this.password=t),e()})}catch(e){this.emit(`error`,e)}}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(async()=>{try{let t=await d.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)}catch(e){this.emit(`error`,e)}})}_handleAuthSASL(e){this._checkPgPass(()=>{try{this.saslSession=a.startSession(e.mechanisms),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(e){this.connection.emit(`error`,e)}})}async _handleAuthSASLContinue(e){try{await a.continueSession(this.saslSession,this.password,e.data),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(e){this.connection.emit(`error`,e)}}_handleAuthSASLFinal(e){try{a.finalizeSession(this.saslSession,e.data),this.saslSession=null}catch(e){this.connection.emit(`error`,e)}}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&=(this._connectionCallback(null,this),null),this.emit(`connect`));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit(`error`,e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit(`error`,e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t){this._handleErrorEvent(e);return}this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(e){this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit(`notification`,e)}_handleNotice(e){this.emit(`notice`,e)}getStartupConf(){var e=this.connectionParameters,t={user:e.user,database:e.database},n=e.application_name||e.fallback_application_name;return n&&(t.application_name=n),e.replication&&(t.replication=``+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){var n=this.connection;this.host&&this.host.indexOf(`/`)===0?n.connect(this.host+`/.s.PGSQL.`+this.port):n.connect(this.port,this.host),n.on(`connect`,function(){n.cancel(e.processID,e.secretKey)})}else e.queryQueue.indexOf(t)!==-1&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,n){return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return i.escapeIdentifier(e)}escapeLiteral(e){return i.escapeLiteral(e)}_pulseQueryQueue(){if(this.readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&process.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit(`drain`))}query(e,t,n){var r,i,a,o,s;if(e==null)throw TypeError(`Client was passed a null or undefined query`);return typeof e.submit==`function`?(a=e.query_timeout||this.connectionParameters.query_timeout,i=r=e,typeof t==`function`&&(r.callback=r.callback||t)):(a=this.connectionParameters.query_timeout,r=new c(e,t,n),r.callback||(i=new this._Promise((e,t)=>{r.callback=(n,r)=>n?t(n):e(r)}).catch(e=>{throw Error.captureStackTrace(e),e}))),a&&(s=r.callback,o=setTimeout(()=>{var e=Error(`Query read timeout`);process.nextTick(()=>{r.handleError(e,this.connection)}),s(e),r.callback=()=>{};var t=this.queryQueue.indexOf(r);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},a),r.callback=(e,t)=>{clearTimeout(o),s(e,t)}),this.binary&&!r.binary&&(r.binary=!0),r._result&&!r._result._types&&(r._result._types=this._types),this._queryable?this._ending?(process.nextTick(()=>{r.handleError(Error(`Client was closed and is not queryable`),this.connection)}),i):(this.queryQueue.push(r),this._pulseQueryQueue(),i):(process.nextTick(()=>{r.handleError(Error(`Client has encountered a connection error and is not queryable`),this.connection)}),i)}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting||this._ended)if(e)e();else return this._Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),e)this.connection.once(`end`,e);else return new this._Promise(e=>{this.connection.once(`end`,e)})}};f.Query=c,n.exports=f})),rb=r(((e,t)=>{t.exports={host:`localhost`,user:process.platform===`win32`?process.env.USERNAME:process.env.USER,database:void 0,password:null,connectionString:void 0,port:5432,rows:0,binary:!1,max:10,idleTimeoutMillis:3e4,client_encoding:``,ssl:!1,application_name:void 0,fallback_application_name:void 0,options:void 0,parseInputDatesAsUTC:!1,statement_timeout:!1,lock_timeout:!1,idle_in_transaction_session_timeout:!1,query_timeout:!1,connect_timeout:0,keepalives:1,keepalives_idle:0};let n=My(),r=n.getTypeParser(20,`text`),i=n.getTypeParser(1016,`text`);t.exports.__defineSetter__(`parseInt8`,function(e){n.setTypeParser(20,`text`,e?n.getTypeParser(23,`text`):r),n.setTypeParser(1016,`text`,e?n.getTypeParser(1007,`text`):i)})})),ib=r(((t,n)=>{let r=rb(),i=e(`util`),{isDate:a}=i.types||i;function o(e){return`"`+e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)+`"`}function s(e){let t=`{`;for(let n=0;n<e.length;n++)if(n>0&&(t+=`,`),e[n]===null||e[n]===void 0)t+=`NULL`;else if(Array.isArray(e[n]))t+=s(e[n]);else if(ArrayBuffer.isView(e[n])){let r=e[n];if(!(r instanceof Buffer)){let e=Buffer.from(r.buffer,r.byteOffset,r.byteLength);r=e.length===r.byteLength?e:e.slice(r.byteOffset,r.byteOffset+r.byteLength)}t+=`\\\\x`+r.toString(`hex`)}else t+=o(c(e[n]));return t+=`}`,t}let c=function(e,t){if(e==null)return null;if(typeof e==`object`){if(e instanceof Buffer)return e;if(ArrayBuffer.isView(e)){let t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return t.length===e.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.byteLength)}return a(e)?r.parseInputDatesAsUTC?d(e):u(e):Array.isArray(e)?s(e):l(e,t)}return e.toString()};function l(e,t){if(e&&typeof e.toPostgres==`function`){if(t||=[],t.indexOf(e)!==-1)throw Error(`circular reference detected while preparing "`+e+`" for query`);return t.push(e),c(e.toPostgres(c),t)}return JSON.stringify(e)}function u(e){let t=-e.getTimezoneOffset(),n=e.getFullYear(),r=n<1;r&&(n=Math.abs(n)+1);let i=String(n).padStart(4,`0`)+`-`+String(e.getMonth()+1).padStart(2,`0`)+`-`+String(e.getDate()).padStart(2,`0`)+`T`+String(e.getHours()).padStart(2,`0`)+`:`+String(e.getMinutes()).padStart(2,`0`)+`:`+String(e.getSeconds()).padStart(2,`0`)+`.`+String(e.getMilliseconds()).padStart(3,`0`);return t<0?(i+=`-`,t*=-1):i+=`+`,i+=String(Math.floor(t/60)).padStart(2,`0`)+`:`+String(t%60).padStart(2,`0`),r&&(i+=` BC`),i}function d(e){let t=e.getUTCFullYear(),n=t<1;n&&(t=Math.abs(t)+1);let r=String(t).padStart(4,`0`)+`-`+String(e.getUTCMonth()+1).padStart(2,`0`)+`-`+String(e.getUTCDate()).padStart(2,`0`)+`T`+String(e.getUTCHours()).padStart(2,`0`)+`:`+String(e.getUTCMinutes()).padStart(2,`0`)+`:`+String(e.getUTCSeconds()).padStart(2,`0`)+`.`+String(e.getUTCMilliseconds()).padStart(3,`0`);return r+=`+00:00`,n&&(r+=` BC`),r}function f(e,t,n){return e=typeof e==`string`?{text:e}:e,t&&(typeof t==`function`?e.callback=t:e.values=t),n&&(e.callback=n),e}n.exports={prepareValue:function(e){return c(e)},normalizeQueryConfig:f,escapeIdentifier:function(e){return`"`+e.replace(/"/g,`""`)+`"`},escapeLiteral:function(e){let t=!1,n=`'`;if(e==null||typeof e!=`string`)return`''`;for(let r=0;r<e.length;r++){let i=e[r];i===`'`?n+=i+i:i===`\\`?(n+=i+i,t=!0):n+=i}return n+=`'`,t===!0&&(n=` E`+n),n}}})),ab=r(((t,n)=>{let r=e(`crypto`);function i(e){return r.createHash(`md5`).update(e,`utf-8`).digest(`hex`)}function a(e,t,n){let r=i(t+e);return`md5`+i(Buffer.concat([Buffer.from(r),n]))}function o(e){return r.createHash(`sha256`).update(e).digest()}function s(e,t){return e=e.replace(/(\D)-/,`$1`),r.createHash(e).update(t).digest()}function c(e,t){return r.createHmac(`sha256`,e).update(t).digest()}async function l(e,t,n){return r.pbkdf2Sync(e,t,n,32,`sha256`)}n.exports={postgresMd5PasswordHash:a,randomBytes:r.randomBytes,deriveKey:l,sha256:o,hashByName:s,hmacSha256:c,md5:i}})),ob=r(((t,n)=>{let r=e(`crypto`);n.exports={postgresMd5PasswordHash:l,randomBytes:s,deriveKey:p,sha256:u,hashByName:d,hmacSha256:f,md5:c};let i=r.webcrypto||globalThis.crypto,a=i.subtle,o=new TextEncoder;function s(e){return i.getRandomValues(Buffer.alloc(e))}async function c(e){try{return r.createHash(`md5`).update(e,`utf-8`).digest(`hex`)}catch{let t=typeof e==`string`?o.encode(e):e,n=await a.digest(`MD5`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}}async function l(e,t,n){let r=await c(t+e);return`md5`+await c(Buffer.concat([Buffer.from(r),n]))}async function u(e){return await a.digest(`SHA-256`,e)}async function d(e,t){return await a.digest(e,t)}async function f(e,t){let n=await a.importKey(`raw`,e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]);return await a.sign(`HMAC`,n,o.encode(t))}async function p(e,t,n){let r=await a.importKey(`raw`,o.encode(e),`PBKDF2`,!1,[`deriveBits`]),i={name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:n};return await a.deriveBits(i,r,256,[`deriveBits`])}})),sb=r(((e,t)=>{parseInt(process.versions&&process.versions.node&&process.versions.node.split(`.`)[0])<15?t.exports=ab():t.exports=ob()})),cb=r(((e,t)=>{function n(e,t){return Error(`SASL channel binding: `+e+` when parsing public certificate `+t.toString(`base64`))}function r(e,t){let r=e[t++];if(r<128)return{length:r,index:t};let i=r&127;if(i>4)throw n(`bad length`,e);r=0;for(let n=0;n<i;n++)r=r<<8|e[t++];return{length:r,index:t}}function i(e,t){if(e[t++]!==6)throw n(`non-OID data`,e);let{length:i,index:a}=r(e,t);t=a;let o=t+i,s=e[t++],c=(s/40>>0)+`.`+s%40;for(;t<o;){let n=0;for(;t<o;){let r=e[t++];if(n=n<<7|r&127,r<128)break}c+=`.`+n}return{oid:c,index:t}}function a(e,t){if(e[t++]!==48)throw n(`non-sequence data`,e);return r(e,t)}function o(e,t){t===void 0&&(t=0),t=a(e,t).index;let{length:o,index:s}=a(e,t);t=s+o,t=a(e,t).index;let{oid:c,index:l}=i(e,t);switch(c){case`1.2.840.113549.1.1.4`:return`MD5`;case`1.2.840.113549.1.1.5`:return`SHA-1`;case`1.2.840.113549.1.1.11`:return`SHA-256`;case`1.2.840.113549.1.1.12`:return`SHA-384`;case`1.2.840.113549.1.1.13`:return`SHA-512`;case`1.2.840.113549.1.1.14`:return`SHA-224`;case`1.2.840.113549.1.1.15`:return`SHA512-224`;case`1.2.840.113549.1.1.16`:return`SHA512-256`;case`1.2.840.10045.4.1`:return`SHA-1`;case`1.2.840.10045.4.3.1`:return`SHA-224`;case`1.2.840.10045.4.3.2`:return`SHA-256`;case`1.2.840.10045.4.3.3`:return`SHA-384`;case`1.2.840.10045.4.3.4`:return`SHA-512`;case`1.2.840.113549.1.1.10`:{if(t=l,t=a(e,t).index,e[t++]!==160)throw n(`non-tag data`,e);t=r(e,t).index,t=a(e,t).index;let{oid:o}=i(e,t);switch(o){case`1.2.840.113549.2.5`:return`MD5`;case`1.3.14.3.2.26`:return`SHA-1`;case`2.16.840.1.101.3.4.2.1`:return`SHA-256`;case`2.16.840.1.101.3.4.2.2`:return`SHA-384`;case`2.16.840.1.101.3.4.2.3`:return`SHA-512`}throw n(`unknown hash OID `+o,e)}case`1.3.101.110`:case`1.3.101.112`:return`SHA-512`;case`1.3.101.111`:case`1.3.101.113`:throw n(`Ed448 certificate channel binding is not currently supported by Postgres`)}throw n(`unknown OID `+c,e)}t.exports={signatureAlgorithmHashFromCertificate:o}})),lb=r(((e,t)=>{let n=sb(),{signatureAlgorithmHashFromCertificate:r}=cb();function i(e,t){let r=[`SCRAM-SHA-256`];t&&r.unshift(`SCRAM-SHA-256-PLUS`);let i=r.find(t=>e.includes(t));if(!i)throw Error(`SASL: Only mechanism(s) `+r.join(` and `)+` are supported`);if(i===`SCRAM-SHA-256-PLUS`&&typeof t.getPeerCertificate!=`function`)throw Error(`SASL: Mechanism SCRAM-SHA-256-PLUS requires a certificate`);let a=n.randomBytes(18).toString(`base64`);return{mechanism:i,clientNonce:a,response:(i===`SCRAM-SHA-256-PLUS`?`p=tls-server-end-point`:t?`y`:`n`)+`,,n=*,r=`+a,message:`SASLInitialResponse`}}async function a(e,t,i,a){if(e.message!==`SASLInitialResponse`)throw Error(`SASL: Last message was not SASLInitialResponse`);if(typeof t!=`string`)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a string`);if(t===``)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: client password must be a non-empty string`);if(typeof i!=`string`)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: serverData must be a string`);let o=u(i);if(o.nonce.startsWith(e.clientNonce)){if(o.nonce.length===e.clientNonce.length)throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce is too short`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: server nonce does not start with client nonce`);let s=`n=*,r=`+e.clientNonce,c=`r=`+o.nonce+`,s=`+o.salt+`,i=`+o.iteration,l=a?`eSws`:`biws`;if(e.mechanism===`SCRAM-SHA-256-PLUS`){let e=a.getPeerCertificate().raw,t=r(e);(t===`MD5`||t===`SHA-1`)&&(t=`SHA-256`);let i=await n.hashByName(t,e);l=Buffer.concat([Buffer.from(`p=tls-server-end-point,,`),Buffer.from(i)]).toString(`base64`)}let d=`c=`+l+`,r=`+o.nonce,p=s+`,`+c+`,`+d,m=Buffer.from(o.salt,`base64`),h=await n.deriveKey(t,m,o.iteration),g=await n.hmacSha256(h,`Client Key`),_=await n.sha256(g),v=await n.hmacSha256(_,p),y=f(Buffer.from(g),Buffer.from(v)).toString(`base64`),b=await n.hmacSha256(h,`Server Key`),x=await n.hmacSha256(b,p);e.message=`SASLResponse`,e.serverSignature=Buffer.from(x).toString(`base64`),e.response=d+`,p=`+y}function o(e,t){if(e.message!==`SASLResponse`)throw Error(`SASL: Last message was not SASLResponse`);if(typeof t!=`string`)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: serverData must be a string`);let{serverSignature:n}=d(t);if(n!==e.serverSignature)throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature does not match`)}function s(e){if(typeof e!=`string`)throw TypeError(`SASL: text must be a string`);return e.split(``).map((t,n)=>e.charCodeAt(n)).every(e=>e>=33&&e<=43||e>=45&&e<=126)}function c(e){return/^(?:[a-zA-Z0-9+/]{4})*(?:[a-zA-Z0-9+/]{2}==|[a-zA-Z0-9+/]{3}=)?$/.test(e)}function l(e){if(typeof e!=`string`)throw TypeError(`SASL: attribute pairs text must be a string`);return new Map(e.split(`,`).map(e=>{if(!/^.=/.test(e))throw Error(`SASL: Invalid attribute pair entry`);return[e[0],e.substring(2)]}))}function u(e){let t=l(e),n=t.get(`r`);if(n){if(!s(n))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce must only contain printable characters`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: nonce missing`);let r=t.get(`s`);if(r){if(!c(r))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: salt must be base64`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: salt missing`);let i=t.get(`i`);if(i){if(!/^[1-9][0-9]*$/.test(i))throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: invalid iteration count`)}else throw Error(`SASL: SCRAM-SERVER-FIRST-MESSAGE: iteration missing`);return{nonce:n,salt:r,iteration:parseInt(i,10)}}function d(e){let t=l(e).get(`v`);if(t){if(!c(t))throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature must be base64`)}else throw Error(`SASL: SCRAM-SERVER-FINAL-MESSAGE: server signature is missing`);return{serverSignature:t}}function f(e,t){if(!Buffer.isBuffer(e))throw TypeError(`first argument must be a Buffer`);if(!Buffer.isBuffer(t))throw TypeError(`second argument must be a Buffer`);if(e.length!==t.length)throw Error(`Buffer lengths must match`);if(e.length===0)throw Error(`Buffers cannot be empty`);return Buffer.from(e.map((n,r)=>e[r]^t[r]))}t.exports={startSession:i,continueSession:a,finalizeSession:o}})),ub=r(((e,t)=>{let n=My();function r(e){this._types=e||n,this.text={},this.binary={}}r.prototype.getOverrides=function(e){switch(e){case`text`:return this.text;case`binary`:return this.binary;default:return{}}},r.prototype.setTypeParser=function(e,t,n){typeof t==`function`&&(n=t,t=`text`),this.getOverrides(t)[e]=n},r.prototype.getTypeParser=function(e,t){return t||=`text`,this.getOverrides(t)[e]||this._types.getTypeParser(e,t)},t.exports=r})),db=r(((t,n)=>{let r=e(`dns`),i=rb(),a=By().parse,o=function(e,t,n){return n===void 0?n=process.env[`PG`+e.toUpperCase()]:n===!1||(n=process.env[n]),t[e]||n||i[e]},s=function(){switch(process.env.PGSSLMODE){case`disable`:return!1;case`prefer`:case`require`:case`verify-ca`:case`verify-full`:return!0;case`no-verify`:return{rejectUnauthorized:!1}}return i.ssl},c=function(e){return`'`+(``+e).replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)+`'`},l=function(e,t,n){let r=t[n];r!=null&&e.push(n+`=`+c(r))};n.exports=class{constructor(e){e=typeof e==`string`?a(e):e||{},e.connectionString&&(e=Object.assign({},e,a(e.connectionString))),this.user=o(`user`,e),this.database=o(`database`,e),this.database===void 0&&(this.database=this.user),this.port=parseInt(o(`port`,e),10),this.host=o(`host`,e),Object.defineProperty(this,`password`,{configurable:!0,enumerable:!1,writable:!0,value:o(`password`,e)}),this.binary=o(`binary`,e),this.options=o(`options`,e),this.ssl=e.ssl===void 0?s():e.ssl,typeof this.ssl==`string`&&this.ssl===`true`&&(this.ssl=!0),this.ssl===`no-verify`&&(this.ssl={rejectUnauthorized:!1}),this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,`key`,{enumerable:!1}),this.client_encoding=o(`client_encoding`,e),this.replication=o(`replication`,e),this.isDomainSocket=!(this.host||``).indexOf(`/`),this.application_name=o(`application_name`,e,`PGAPPNAME`),this.fallback_application_name=o(`fallback_application_name`,e,!1),this.statement_timeout=o(`statement_timeout`,e,!1),this.lock_timeout=o(`lock_timeout`,e,!1),this.idle_in_transaction_session_timeout=o(`idle_in_transaction_session_timeout`,e,!1),this.query_timeout=o(`query_timeout`,e,!1),e.connectionTimeoutMillis===void 0?this.connect_timeout=process.env.PGCONNECT_TIMEOUT||0:this.connect_timeout=Math.floor(e.connectionTimeoutMillis/1e3),e.keepAlive===!1?this.keepalives=0:e.keepAlive===!0&&(this.keepalives=1),typeof e.keepAliveInitialDelayMillis==`number`&&(this.keepalives_idle=Math.floor(e.keepAliveInitialDelayMillis/1e3))}getLibpqConnectionString(e){let t=[];l(t,this,`user`),l(t,this,`password`),l(t,this,`port`),l(t,this,`application_name`),l(t,this,`fallback_application_name`),l(t,this,`connect_timeout`),l(t,this,`options`);let n=typeof this.ssl==`object`?this.ssl:this.ssl?{sslmode:this.ssl}:{};if(l(t,n,`sslmode`),l(t,n,`sslca`),l(t,n,`sslkey`),l(t,n,`sslcert`),l(t,n,`sslrootcert`),this.database&&t.push(`dbname=`+c(this.database)),this.replication&&t.push(`replication=`+c(this.replication)),this.host&&t.push(`host=`+c(this.host)),this.isDomainSocket)return e(null,t.join(` `));this.client_encoding&&t.push(`client_encoding=`+c(this.client_encoding)),r.lookup(this.host,function(n,r){return n?e(n,null):(t.push(`hostaddr=`+c(r)),e(null,t.join(` `)))})}}})),fb=r(((e,t)=>{let n=My(),r=/^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;t.exports=class{constructor(e,t){this.command=null,this.rowCount=null,this.oid=null,this.rows=[],this.fields=[],this._parsers=void 0,this._types=t,this.RowCtor=null,this.rowAsArray=e===`array`,this.rowAsArray&&(this.parseRow=this._parseRowAsArray),this._prebuiltEmptyResultObject=null}addCommandComplete(e){let t;t=e.text?r.exec(e.text):r.exec(e.command),t&&(this.command=t[1],t[3]?(this.oid=parseInt(t[2],10),this.rowCount=parseInt(t[3],10)):t[2]&&(this.rowCount=parseInt(t[2],10)))}_parseRowAsArray(e){let t=Array(e.length);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===null?t[n]=null:t[n]=this._parsers[n](r)}return t}parseRow(e){let t={...this._prebuiltEmptyResultObject};for(let n=0,r=e.length;n<r;n++){let r=e[n],i=this.fields[n].name;if(r!==null){let e=this.fields[n].format===`binary`?Buffer.from(r):r;t[i]=this._parsers[n](e)}else t[i]=null}return t}addRow(e){this.rows.push(e)}addFields(e){this.fields=e,this.fields.length&&(this._parsers=Array(e.length));let t={};for(let r=0;r<e.length;r++){let i=e[r];t[i.name]=null,this._types?this._parsers[r]=this._types.getTypeParser(i.dataTypeID,i.format||`text`):this._parsers[r]=n.getTypeParser(i.dataTypeID,i.format||`text`)}this._prebuiltEmptyResultObject={...t}}}})),pb=r(((t,n)=>{let{EventEmitter:r}=e(`events`),i=fb(),a=ib();n.exports=class extends r{constructor(e,t,n){super(),e=a.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.rows=e.rows,this.types=e.types,this.name=e.name,this.queryMode=e.queryMode,this.binary=e.binary,this.portal=e.portal||``,this.callback=e.callback,this._rowMode=e.rowMode,process.domain&&e.callback&&(this.callback=process.domain.bind(e.callback)),this._result=new i(this._rowMode,this.types),this._results=this._result,this._canceledDueToError=!1}requiresPreparation(){return this.queryMode===`extended`||this.name||this.rows?!0:!this.text||!this.values?!1:this.values.length>0}_checkForMultirow(){this._result.command&&(Array.isArray(this._results)||(this._results=[this._result]),this._result=new i(this._rowMode,this._result._types),this._results.push(this._result))}handleRowDescription(e){this._checkForMultirow(),this._result.addFields(e.fields),this._accumulateRows=this.callback||!this.listeners(`row`).length}handleDataRow(e){let t;if(!this._canceledDueToError){try{t=this._result.parseRow(e.fields)}catch(e){this._canceledDueToError=e;return}this.emit(`row`,t,this._result),this._accumulateRows&&this._result.addRow(t)}}handleCommandComplete(e,t){this._checkForMultirow(),this._result.addCommandComplete(e),this.rows&&t.sync()}handleEmptyQuery(e){this.rows&&e.sync()}handleError(e,t){if(this._canceledDueToError&&=(e=this._canceledDueToError,!1),this.callback)return this.callback(e);this.emit(`error`,e)}handleReadyForQuery(e){if(this._canceledDueToError)return this.handleError(this._canceledDueToError,e);if(this.callback)try{this.callback(null,this._results)}catch(e){process.nextTick(()=>{throw e})}this.emit(`end`,this._results)}submit(e){if(typeof this.text!=`string`&&typeof this.name!=`string`)return Error(`A query must have either text or a name. Supplying neither is unsupported.`);let t=e.parsedStatements[this.name];if(this.text&&t&&this.text!==t)return Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);if(this.values&&!Array.isArray(this.values))return Error(`Query values must be an array`);if(this.requiresPreparation()){e.stream.cork&&e.stream.cork();try{this.prepare(e)}finally{e.stream.uncork&&e.stream.uncork()}}else e.query(this.text);return null}hasBeenParsed(e){return this.name&&e.parsedStatements[this.name]}handlePortalSuspended(e){this._getRows(e,this.rows)}_getRows(e,t){e.execute({portal:this.portal,rows:t}),t?e.flush():e.sync()}prepare(e){this.hasBeenParsed(e)||e.parse({text:this.text,name:this.name,types:this.types});try{e.bind({portal:this.portal,statement:this.name,values:this.values,binary:this.binary,valueMapper:a.prepareValue})}catch(t){this.handleError(t,e);return}e.describe({type:`P`,name:this.portal||``}),this._getRows(e,this.rows)}handleCopyInResponse(e){e.sendCopyFail(`No source stream defined`)}handleCopyData(e,t){}}})),mb=r(((t,n)=>{let{getStream:r,getSecureStream:i}=c();n.exports={getStream:r,getSecureStream:i};function a(){function t(t){return new(e(`net`)).Socket}function n(t){return e(`tls`).connect(t)}return{getStream:t,getSecureStream:n}}function o(){function e(e){let{CloudflareSocket:t}=Xy();return new t(e)}function t(e){return e.socket.startTls(e),e.socket}return{getStream:e,getSecureStream:t}}function s(){if(typeof navigator==`object`&&navigator!==null&&typeof navigator.userAgent==`string`)return navigator.userAgent===`Cloudflare-Workers`;if(typeof Response==`function`){let e=new Response(null,{cf:{thing:!0}});if(typeof e.cf==`object`&&e.cf!==null&&e.cf.thing)return!0}return!1}function c(){return s()?o():a()}})),hb=r(((t,n)=>{let r=e(`events`).EventEmitter,{parse:i,serialize:a}=Yy(),{getStream:o,getSecureStream:s}=mb(),c=a.flush(),l=a.sync(),u=a.end();n.exports=class extends r{constructor(e){super(),e||={},this.stream=e.stream||o(e.ssl),typeof this.stream==`function`&&(this.stream=this.stream(e)),this._keepAlive=e.keepAlive,this._keepAliveInitialDelayMillis=e.keepAliveInitialDelayMillis,this.lastBuffer=!1,this.parsedStatements={},this.ssl=e.ssl||!1,this._ending=!1,this._emitMessage=!1;let t=this;this.on(`newListener`,function(e){e===`message`&&(t._emitMessage=!0)})}connect(t,n){let r=this;this._connecting=!0,this.stream.setNoDelay(!0),this.stream.connect(t,n),this.stream.once(`connect`,function(){r._keepAlive&&r.stream.setKeepAlive(!0,r._keepAliveInitialDelayMillis),r.emit(`connect`)});let i=function(e){r._ending&&(e.code===`ECONNRESET`||e.code===`EPIPE`)||r.emit(`error`,e)};if(this.stream.on(`error`,i),this.stream.on(`close`,function(){r.emit(`end`)}),!this.ssl)return this.attachListeners(this.stream);this.stream.once(`data`,function(t){switch(t.toString(`utf8`)){case`S`:break;case`N`:return r.stream.end(),r.emit(`error`,Error(`The server does not support SSL connections`));default:return r.stream.end(),r.emit(`error`,Error(`There was an error establishing an SSL connection`))}let a={socket:r.stream};r.ssl!==!0&&(Object.assign(a,r.ssl),`key`in r.ssl&&(a.key=r.ssl.key));let o=e(`net`);o.isIP&&o.isIP(n)===0&&(a.servername=n);try{r.stream=s(a)}catch(e){return r.emit(`error`,e)}r.attachListeners(r.stream),r.stream.on(`error`,i),r.emit(`sslconnect`)})}attachListeners(e){i(e,e=>{let t=e.name===`error`?`errorMessage`:e.name;this._emitMessage&&this.emit(`message`,e),this.emit(t,e)})}requestSsl(){this.stream.write(a.requestSsl())}startup(e){this.stream.write(a.startup(e))}cancel(e,t){this._send(a.cancel(e,t))}password(e){this._send(a.password(e))}sendSASLInitialResponseMessage(e,t){this._send(a.sendSASLInitialResponseMessage(e,t))}sendSCRAMClientFinalMessage(e){this._send(a.sendSCRAMClientFinalMessage(e))}_send(e){return this.stream.writable?this.stream.write(e):!1}query(e){this._send(a.query(e))}parse(e){this._send(a.parse(e))}bind(e){this._send(a.bind(e))}execute(e){this._send(a.execute(e))}flush(){this.stream.writable&&this.stream.write(c)}sync(){this._ending=!0,this._send(l)}ref(){this.stream.ref()}unref(){this.stream.unref()}end(){if(this._ending=!0,!this._connecting||!this.stream.writable){this.stream.end();return}return this.stream.write(u,()=>{this.stream.end()})}close(e){this._send(a.close(e))}describe(e){this._send(a.describe(e))}sendCopyFromChunk(e){this._send(a.copyData(e))}endCopyFrom(){this._send(a.copyDone())}sendCopyFail(e){this._send(a.copyFail(e))}}})),gb=r(((t,n)=>{let r=e(`events`).EventEmitter,i=ib(),a=lb(),o=ub(),s=db(),c=pb(),l=rb(),u=hb(),d=sb();var f=class extends r{constructor(e){super(),this.connectionParameters=new s(e),this.user=this.connectionParameters.user,this.database=this.connectionParameters.database,this.port=this.connectionParameters.port,this.host=this.connectionParameters.host,Object.defineProperty(this,`password`,{configurable:!0,enumerable:!1,writable:!0,value:this.connectionParameters.password}),this.replication=this.connectionParameters.replication;let t=e||{};this._Promise=t.Promise||global.Promise,this._types=new o(t.types),this._ending=!1,this._ended=!1,this._connecting=!1,this._connected=!1,this._connectionError=!1,this._queryable=!0,this.enableChannelBinding=!!t.enableChannelBinding,this.connection=t.connection||new u({stream:t.stream,ssl:this.connectionParameters.ssl,keepAlive:t.keepAlive||!1,keepAliveInitialDelayMillis:t.keepAliveInitialDelayMillis||0,encoding:this.connectionParameters.client_encoding||`utf8`}),this.queryQueue=[],this.binary=t.binary||l.binary,this.processID=null,this.secretKey=null,this.ssl=this.connectionParameters.ssl||!1,this.ssl&&this.ssl.key&&Object.defineProperty(this.ssl,`key`,{enumerable:!1}),this._connectionTimeoutMillis=t.connectionTimeoutMillis||0}_errorAllQueries(e){let t=t=>{process.nextTick(()=>{t.handleError(e,this.connection)})};this.activeQuery&&=(t(this.activeQuery),null),this.queryQueue.forEach(t),this.queryQueue.length=0}_connect(e){let t=this,n=this.connection;if(this._connectionCallback=e,this._connecting||this._connected){let t=Error(`Client has already been connected. You cannot reuse a client.`);process.nextTick(()=>{e(t)});return}this._connecting=!0,this._connectionTimeoutMillis>0&&(this.connectionTimeoutHandle=setTimeout(()=>{n._ending=!0,n.stream.destroy(Error(`timeout expired`))},this._connectionTimeoutMillis),this.connectionTimeoutHandle.unref&&this.connectionTimeoutHandle.unref()),this.host&&this.host.indexOf(`/`)===0?n.connect(this.host+`/.s.PGSQL.`+this.port):n.connect(this.port,this.host),n.on(`connect`,function(){t.ssl?n.requestSsl():n.startup(t.getStartupConf())}),n.on(`sslconnect`,function(){n.startup(t.getStartupConf())}),this._attachListeners(n),n.once(`end`,()=>{let e=this._ending?Error(`Connection terminated`):Error(`Connection terminated unexpectedly`);clearTimeout(this.connectionTimeoutHandle),this._errorAllQueries(e),this._ended=!0,this._ending||(this._connecting&&!this._connectionError?this._connectionCallback?this._connectionCallback(e):this._handleErrorEvent(e):this._connectionError||this._handleErrorEvent(e)),process.nextTick(()=>{this.emit(`end`)})})}connect(e){if(e){this._connect(e);return}return new this._Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})}_attachListeners(e){e.on(`authenticationCleartextPassword`,this._handleAuthCleartextPassword.bind(this)),e.on(`authenticationMD5Password`,this._handleAuthMD5Password.bind(this)),e.on(`authenticationSASL`,this._handleAuthSASL.bind(this)),e.on(`authenticationSASLContinue`,this._handleAuthSASLContinue.bind(this)),e.on(`authenticationSASLFinal`,this._handleAuthSASLFinal.bind(this)),e.on(`backendKeyData`,this._handleBackendKeyData.bind(this)),e.on(`error`,this._handleErrorEvent.bind(this)),e.on(`errorMessage`,this._handleErrorMessage.bind(this)),e.on(`readyForQuery`,this._handleReadyForQuery.bind(this)),e.on(`notice`,this._handleNotice.bind(this)),e.on(`rowDescription`,this._handleRowDescription.bind(this)),e.on(`dataRow`,this._handleDataRow.bind(this)),e.on(`portalSuspended`,this._handlePortalSuspended.bind(this)),e.on(`emptyQuery`,this._handleEmptyQuery.bind(this)),e.on(`commandComplete`,this._handleCommandComplete.bind(this)),e.on(`parseComplete`,this._handleParseComplete.bind(this)),e.on(`copyInResponse`,this._handleCopyInResponse.bind(this)),e.on(`copyData`,this._handleCopyData.bind(this)),e.on(`notification`,this._handleNotification.bind(this))}_checkPgPass(e){let t=this.connection;if(typeof this.password==`function`)this._Promise.resolve().then(()=>this.password()).then(n=>{if(n!==void 0){if(typeof n!=`string`){t.emit(`error`,TypeError(`Password must be a string`));return}this.connectionParameters.password=this.password=n}else this.connectionParameters.password=this.password=null;e()}).catch(e=>{t.emit(`error`,e)});else if(this.password!==null)e();else try{tb()(this.connectionParameters,t=>{t!==void 0&&(this.connectionParameters.password=this.password=t),e()})}catch(e){this.emit(`error`,e)}}_handleAuthCleartextPassword(e){this._checkPgPass(()=>{this.connection.password(this.password)})}_handleAuthMD5Password(e){this._checkPgPass(async()=>{try{let t=await d.postgresMd5PasswordHash(this.user,this.password,e.salt);this.connection.password(t)}catch(e){this.emit(`error`,e)}})}_handleAuthSASL(e){this._checkPgPass(()=>{try{this.saslSession=a.startSession(e.mechanisms,this.enableChannelBinding&&this.connection.stream),this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism,this.saslSession.response)}catch(e){this.connection.emit(`error`,e)}})}async _handleAuthSASLContinue(e){try{await a.continueSession(this.saslSession,this.password,e.data,this.enableChannelBinding&&this.connection.stream),this.connection.sendSCRAMClientFinalMessage(this.saslSession.response)}catch(e){this.connection.emit(`error`,e)}}_handleAuthSASLFinal(e){try{a.finalizeSession(this.saslSession,e.data),this.saslSession=null}catch(e){this.connection.emit(`error`,e)}}_handleBackendKeyData(e){this.processID=e.processID,this.secretKey=e.secretKey}_handleReadyForQuery(e){this._connecting&&(this._connecting=!1,this._connected=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback&&=(this._connectionCallback(null,this),null),this.emit(`connect`));let{activeQuery:t}=this;this.activeQuery=null,this.readyForQuery=!0,t&&t.handleReadyForQuery(this.connection),this._pulseQueryQueue()}_handleErrorWhileConnecting(e){if(!this._connectionError){if(this._connectionError=!0,clearTimeout(this.connectionTimeoutHandle),this._connectionCallback)return this._connectionCallback(e);this.emit(`error`,e)}}_handleErrorEvent(e){if(this._connecting)return this._handleErrorWhileConnecting(e);this._queryable=!1,this._errorAllQueries(e),this.emit(`error`,e)}_handleErrorMessage(e){if(this._connecting)return this._handleErrorWhileConnecting(e);let t=this.activeQuery;if(!t){this._handleErrorEvent(e);return}this.activeQuery=null,t.handleError(e,this.connection)}_handleRowDescription(e){this.activeQuery.handleRowDescription(e)}_handleDataRow(e){this.activeQuery.handleDataRow(e)}_handlePortalSuspended(e){this.activeQuery.handlePortalSuspended(this.connection)}_handleEmptyQuery(e){this.activeQuery.handleEmptyQuery(this.connection)}_handleCommandComplete(e){if(this.activeQuery==null){let e=Error(`Received unexpected commandComplete message from backend.`);this._handleErrorEvent(e);return}this.activeQuery.handleCommandComplete(e,this.connection)}_handleParseComplete(){if(this.activeQuery==null){let e=Error(`Received unexpected parseComplete message from backend.`);this._handleErrorEvent(e);return}this.activeQuery.name&&(this.connection.parsedStatements[this.activeQuery.name]=this.activeQuery.text)}_handleCopyInResponse(e){this.activeQuery.handleCopyInResponse(this.connection)}_handleCopyData(e){this.activeQuery.handleCopyData(e,this.connection)}_handleNotification(e){this.emit(`notification`,e)}_handleNotice(e){this.emit(`notice`,e)}getStartupConf(){let e=this.connectionParameters,t={user:e.user,database:e.database},n=e.application_name||e.fallback_application_name;return n&&(t.application_name=n),e.replication&&(t.replication=``+e.replication),e.statement_timeout&&(t.statement_timeout=String(parseInt(e.statement_timeout,10))),e.lock_timeout&&(t.lock_timeout=String(parseInt(e.lock_timeout,10))),e.idle_in_transaction_session_timeout&&(t.idle_in_transaction_session_timeout=String(parseInt(e.idle_in_transaction_session_timeout,10))),e.options&&(t.options=e.options),t}cancel(e,t){if(e.activeQuery===t){let t=this.connection;this.host&&this.host.indexOf(`/`)===0?t.connect(this.host+`/.s.PGSQL.`+this.port):t.connect(this.port,this.host),t.on(`connect`,function(){t.cancel(e.processID,e.secretKey)})}else e.queryQueue.indexOf(t)!==-1&&e.queryQueue.splice(e.queryQueue.indexOf(t),1)}setTypeParser(e,t,n){return this._types.setTypeParser(e,t,n)}getTypeParser(e,t){return this._types.getTypeParser(e,t)}escapeIdentifier(e){return i.escapeIdentifier(e)}escapeLiteral(e){return i.escapeLiteral(e)}_pulseQueryQueue(){if(this.readyForQuery===!0)if(this.activeQuery=this.queryQueue.shift(),this.activeQuery){this.readyForQuery=!1,this.hasExecuted=!0;let e=this.activeQuery.submit(this.connection);e&&process.nextTick(()=>{this.activeQuery.handleError(e,this.connection),this.readyForQuery=!0,this._pulseQueryQueue()})}else this.hasExecuted&&(this.activeQuery=null,this.emit(`drain`))}query(e,t,n){let r,i,a,o,s;if(e==null)throw TypeError(`Client was passed a null or undefined query`);return typeof e.submit==`function`?(a=e.query_timeout||this.connectionParameters.query_timeout,i=r=e,typeof t==`function`&&(r.callback=r.callback||t)):(a=e.query_timeout||this.connectionParameters.query_timeout,r=new c(e,t,n),r.callback||(i=new this._Promise((e,t)=>{r.callback=(n,r)=>n?t(n):e(r)}).catch(e=>{throw Error.captureStackTrace(e),e}))),a&&(s=r.callback,o=setTimeout(()=>{let e=Error(`Query read timeout`);process.nextTick(()=>{r.handleError(e,this.connection)}),s(e),r.callback=()=>{};let t=this.queryQueue.indexOf(r);t>-1&&this.queryQueue.splice(t,1),this._pulseQueryQueue()},a),r.callback=(e,t)=>{clearTimeout(o),s(e,t)}),this.binary&&!r.binary&&(r.binary=!0),r._result&&!r._result._types&&(r._result._types=this._types),this._queryable?this._ending?(process.nextTick(()=>{r.handleError(Error(`Client was closed and is not queryable`),this.connection)}),i):(this.queryQueue.push(r),this._pulseQueryQueue(),i):(process.nextTick(()=>{r.handleError(Error(`Client has encountered a connection error and is not queryable`),this.connection)}),i)}ref(){this.connection.ref()}unref(){this.connection.unref()}end(e){if(this._ending=!0,!this.connection._connecting||this._ended)if(e)e();else return this._Promise.resolve();if(this.activeQuery||!this._queryable?this.connection.stream.destroy():this.connection.end(),e)this.connection.once(`end`,e);else return new this._Promise(e=>{this.connection.once(`end`,e)})}};f.Query=c,n.exports=f})),_b=r(((t,n)=>{let r=e(`events`).EventEmitter,i=e(`util`),a=ib(),o=n.exports=function(e,t,n){r.call(this),e=a.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.queryMode=e.queryMode,this.callback=e.callback,this.state=`new`,this._arrayMode=e.rowMode===`array`,this._emitRowEvents=!1,this.on(`newListener`,function(e){e===`row`&&(this._emitRowEvents=!0)}.bind(this))};i.inherits(o,r);let s={sqlState:`code`,statementPosition:`position`,messagePrimary:`message`,context:`where`,schemaName:`schema`,tableName:`table`,columnName:`column`,dataTypeName:`dataType`,constraintName:`constraint`,sourceFile:`file`,sourceLine:`line`,sourceFunction:`routine`};o.prototype.handleError=function(e){let t=this.native.pq.resultErrorFields();if(t)for(let n in t){let r=s[n]||n;e[r]=t[n]}this.callback?this.callback(e):this.emit(`error`,e),this.state=`error`},o.prototype.then=function(e,t){return this._getPromise().then(e,t)},o.prototype.catch=function(e){return this._getPromise().catch(e)},o.prototype._getPromise=function(){return this._promise||=new Promise(function(e,t){this._once(`end`,e),this._once(`error`,t)}.bind(this)),this._promise},o.prototype.submit=function(e){this.state=`running`;let t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;let n=function(n,r,i){if(e.native.arrayMode=!1,setImmediate(function(){t.emit(`_done`)}),n)return t.handleError(n);t._emitRowEvents&&(i.length>1?r.forEach((e,n)=>{e.forEach(e=>{t.emit(`row`,e,i[n])})}):r.forEach(function(e){t.emit(`row`,e,i)})),t.state=`end`,t.emit(`end`,i),t.callback&&t.callback(null,i)};if(process.domain&&(n=process.domain.bind(n)),this.name){this.name.length>63&&(console.error(`Warning! Postgres only supports 63 characters for query names.`),console.error(`You supplied %s (%s)`,this.name,this.name.length),console.error(`This can cause conflicts and silent errors executing queries`));let r=(this.values||[]).map(a.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return n(e)}return e.native.execute(this.name,r,n)}return e.native.prepare(this.name,this.text,r.length,function(i){return i?n(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,r,n))})}else if(this.values){if(!Array.isArray(this.values))return n(Error(`Query values must be an array`));let t=this.values.map(a.prepareValue);e.native.query(this.text,t,n)}else this.queryMode===`extended`?e.native.query(this.text,[],n):e.native.query(this.text,n)}})),vb=r(((t,n)=>{var r;try{r=e(`pg-native`)}catch(e){throw e}let i=ub(),a=e(`events`).EventEmitter,o=e(`util`),s=db(),c=_b(),l=n.exports=function(e){a.call(this),e||={},this._Promise=e.Promise||global.Promise,this._types=new i(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;let t=this.connectionParameters=new s(e);e.nativeConnectionString&&(t.nativeConnectionString=e.nativeConnectionString),this.user=t.user,Object.defineProperty(this,`password`,{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};l.Query=c,o.inherits(l,a),l.prototype._errorAllQueries=function(e){let t=t=>{process.nextTick(()=>{t.native=this.native,t.handleError(e)})};this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},l.prototype._connect=function(e){let t=this;if(this._connecting){process.nextTick(()=>e(Error(`Client has already been connected. You cannot reuse a client.`)));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(n,r){if(t.connectionParameters.nativeConnectionString&&(r=t.connectionParameters.nativeConnectionString),n)return e(n);t.native.connect(r,function(n){if(n)return t.native.end(),e(n);t._connected=!0,t.native.on(`error`,function(e){t._queryable=!1,t._errorAllQueries(e),t.emit(`error`,e)}),t.native.on(`notification`,function(e){t.emit(`notification`,{channel:e.relname,payload:e.extra})}),t.emit(`connect`),t._pulseQueryQueue(!0),e()})})},l.prototype.connect=function(e){if(e){this._connect(e);return}return new this._Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})},l.prototype.query=function(e,t,n){let r,i,a,o,s;if(e==null)throw TypeError(`Client was passed a null or undefined query`);if(typeof e.submit==`function`)a=e.query_timeout||this.connectionParameters.query_timeout,i=r=e,typeof t==`function`&&(e.callback=t);else if(a=e.query_timeout||this.connectionParameters.query_timeout,r=new c(e,t,n),!r.callback){let e,t;i=new this._Promise((n,r)=>{e=n,t=r}).catch(e=>{throw Error.captureStackTrace(e),e}),r.callback=(n,r)=>n?t(n):e(r)}return a&&(s=r.callback,o=setTimeout(()=>{let e=Error(`Query read timeout`);process.nextTick(()=>{r.handleError(e,this.connection)}),s(e),r.callback=()=>{};let t=this._queryQueue.indexOf(r);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},a),r.callback=(e,t)=>{clearTimeout(o),s(e,t)}),this._queryable?this._ending?(r.native=this.native,process.nextTick(()=>{r.handleError(Error(`Client was closed and is not queryable`))}),i):(this._queryQueue.push(r),this._pulseQueryQueue(),i):(r.native=this.native,process.nextTick(()=>{r.handleError(Error(`Client has encountered a connection error and is not queryable`))}),i)},l.prototype.end=function(e){let t=this;this._ending=!0,this._connected||this.once(`connect`,this.end.bind(this,e));let n;return e||(n=new this._Promise(function(t,n){e=e=>e?n(e):t()})),this.native.end(function(){t._errorAllQueries(Error(`Connection terminated`)),process.nextTick(()=>{t.emit(`end`),e&&e()})}),n},l.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!==`error`&&this._activeQuery.state!==`end`},l.prototype._pulseQueryQueue=function(e){if(!this._connected||this._hasActiveQuery())return;let t=this._queryQueue.shift();if(!t){e||this.emit(`drain`);return}this._activeQuery=t,t.submit(this);let n=this;t.once(`_done`,function(){n._pulseQueryQueue()})},l.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):this._queryQueue.indexOf(e)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},l.prototype.ref=function(){},l.prototype.unref=function(){},l.prototype.setTypeParser=function(e,t,n){return this._types.setTypeParser(e,t,n)},l.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}})),yb=r(((e,t)=>{t.exports=vb()})),bb=r(((e,t)=>{let n=gb(),r=rb(),i=hb(),a=fb(),o=ib(),s=xb(),c=ub(),{DatabaseError:l}=Yy(),{escapeIdentifier:u,escapeLiteral:d}=ib(),f=e=>class extends s{constructor(t){super(t,e)}},p=function(e){this.defaults=r,this.Client=e,this.Query=this.Client.Query,this.Pool=f(this.Client),this._pools=[],this.Connection=i,this.types=My(),this.DatabaseError=l,this.TypeOverrides=c,this.escapeIdentifier=u,this.escapeLiteral=d,this.Result=a,this.utils=o};process.env.NODE_PG_FORCE_NATIVE===void 0?(t.exports=new p(n),Object.defineProperty(t.exports,`native`,{configurable:!0,enumerable:!1,get(){let e=null;try{e=new p(yb())}catch(e){if(e.code!==`MODULE_NOT_FOUND`)throw e}return Object.defineProperty(t.exports,`native`,{value:e}),e}})):t.exports=new p(yb())})),xb=r(((t,n)=>{let r=e(`events`).EventEmitter,i=function(){},a=(e,t)=>{let n=e.findIndex(t);return n===-1?void 0:e.splice(n,1)[0]};var o=class{constructor(e,t,n){this.client=e,this.idleListener=t,this.timeoutId=n}},s=class{constructor(e){this.callback=e}};function c(){throw Error(`Release called on client which has already been released to the pool.`)}function l(e,t){if(t)return{callback:t,result:void 0};let n,r;return{callback:function(e,t){e?n(e):r(t)},result:new e(function(e,t){r=e,n=t}).catch(e=>{throw Error.captureStackTrace(e),e})}}function u(e,t){return function n(r){r.client=t,t.removeListener(`error`,n),t.on(`error`,()=>{e.log(`additional client error after disconnection due to error`,r)}),e._remove(t),e.emit(`error`,r,t)}}n.exports=class extends r{constructor(e,t){super(),this.options=Object.assign({},e),e!=null&&`password`in e&&Object.defineProperty(this.options,`password`,{configurable:!0,enumerable:!1,writable:!0,value:e.password}),e!=null&&e.ssl&&e.ssl.key&&Object.defineProperty(this.options.ssl,`key`,{enumerable:!1}),this.options.max=this.options.max||this.options.poolSize||10,this.options.min=this.options.min||0,this.options.maxUses=this.options.maxUses||1/0,this.options.allowExitOnIdle=this.options.allowExitOnIdle||!1,this.options.maxLifetimeSeconds=this.options.maxLifetimeSeconds||0,this.log=this.options.log||function(){},this.Client=this.options.Client||t||bb().Client,this.Promise=this.options.Promise||global.Promise,this.options.idleTimeoutMillis===void 0&&(this.options.idleTimeoutMillis=1e4),this._clients=[],this._idle=[],this._expired=new WeakSet,this._pendingQueue=[],this._endCallback=void 0,this.ending=!1,this.ended=!1}_isFull(){return this._clients.length>=this.options.max}_isAboveMin(){return this._clients.length>this.options.min}_pulseQueue(){if(this.log(`pulse queue`),this.ended){this.log(`pulse queue ended`);return}if(this.ending){this.log(`pulse queue on ending`),this._idle.length&&this._idle.slice().map(e=>{this._remove(e.client)}),this._clients.length||(this.ended=!0,this._endCallback());return}if(!this._pendingQueue.length){this.log(`no queued requests`);return}if(!this._idle.length&&this._isFull())return;let e=this._pendingQueue.shift();if(this._idle.length){let t=this._idle.pop();clearTimeout(t.timeoutId);let n=t.client;n.ref&&n.ref();let r=t.idleListener;return this._acquireClient(n,e,r,!1)}if(!this._isFull())return this.newClient(e);throw Error(`unexpected condition`)}_remove(e,t){let n=a(this._idle,t=>t.client===e);n!==void 0&&clearTimeout(n.timeoutId),this._clients=this._clients.filter(t=>t!==e);let r=this;e.end(()=>{r.emit(`remove`,e),typeof t==`function`&&t()})}connect(e){if(this.ending){let t=Error(`Cannot use a pool after calling end on the pool`);return e?e(t):this.Promise.reject(t)}let t=l(this.Promise,e),n=t.result;if(this._isFull()||this._idle.length){if(this._idle.length&&process.nextTick(()=>this._pulseQueue()),!this.options.connectionTimeoutMillis)return this._pendingQueue.push(new s(t.callback)),n;let e=(e,n,r)=>{clearTimeout(i),t.callback(e,n,r)},r=new s(e),i=setTimeout(()=>{a(this._pendingQueue,t=>t.callback===e),r.timedOut=!0,t.callback(Error(`timeout exceeded when trying to connect`))},this.options.connectionTimeoutMillis);return i.unref&&i.unref(),this._pendingQueue.push(r),n}return this.newClient(new s(t.callback)),n}newClient(e){let t=new this.Client(this.options);this._clients.push(t);let n=u(this,t);this.log(`checking client timeout`);let r,a=!1;this.options.connectionTimeoutMillis&&(r=setTimeout(()=>{this.log(`ending client due to timeout`),a=!0,t.connection?t.connection.stream.destroy():t.end()},this.options.connectionTimeoutMillis)),this.log(`connecting new client`),t.connect(o=>{if(r&&clearTimeout(r),t.on(`error`,n),o)this.log(`client failed to connect`,o),this._clients=this._clients.filter(e=>e!==t),a&&(o=Error(`Connection terminated due to connection timeout`,{cause:o})),this._pulseQueue(),e.timedOut||e.callback(o,void 0,i);else{if(this.log(`new client connected`),this.options.maxLifetimeSeconds!==0){let e=setTimeout(()=>{this.log(`ending client due to expired lifetime`),this._expired.add(t),this._idle.findIndex(e=>e.client===t)!==-1&&this._acquireClient(t,new s((e,t,n)=>n()),n,!1)},this.options.maxLifetimeSeconds*1e3);e.unref(),t.once(`end`,()=>clearTimeout(e))}return this._acquireClient(t,e,n,!0)}})}_acquireClient(e,t,n,r){r&&this.emit(`connect`,e),this.emit(`acquire`,e),e.release=this._releaseOnce(e,n),e.removeListener(`error`,n),t.timedOut?r&&this.options.verify?this.options.verify(e,e.release):e.release():r&&this.options.verify?this.options.verify(e,n=>{if(n)return e.release(n),t.callback(n,void 0,i);t.callback(void 0,e,e.release)}):t.callback(void 0,e,e.release)}_releaseOnce(e,t){let n=!1;return r=>{n&&c(),n=!0,this._release(e,t,r)}}_release(e,t,n){if(e.on(`error`,t),e._poolUseCount=(e._poolUseCount||0)+1,this.emit(`release`,n,e),n||this.ending||!e._queryable||e._ending||e._poolUseCount>=this.options.maxUses)return e._poolUseCount>=this.options.maxUses&&this.log(`remove expended client`),this._remove(e,this._pulseQueue.bind(this));if(this._expired.has(e))return this.log(`remove expired client`),this._expired.delete(e),this._remove(e,this._pulseQueue.bind(this));let r;this.options.idleTimeoutMillis&&this._isAboveMin()&&(r=setTimeout(()=>{this.log(`remove idle client`),this._remove(e,this._pulseQueue.bind(this))},this.options.idleTimeoutMillis),this.options.allowExitOnIdle&&r.unref()),this.options.allowExitOnIdle&&e.unref(),this._idle.push(new o(e,t,r)),this._pulseQueue()}query(e,t,n){if(typeof e==`function`){let t=l(this.Promise,e);return setImmediate(function(){return t.callback(Error(`Passing a function as the first parameter to pool.query is not supported`))}),t.result}typeof t==`function`&&(n=t,t=void 0);let r=l(this.Promise,n);return n=r.callback,this.connect((r,i)=>{if(r)return n(r);let a=!1,o=e=>{a||(a=!0,i.release(e),n(e))};i.once(`error`,o),this.log(`dispatching query`);try{i.query(e,t,(e,t)=>{if(this.log(`query dispatched`),i.removeListener(`error`,o),!a)return a=!0,i.release(e),e?n(e):n(void 0,t)})}catch(e){return i.release(e),n(e)}}),r.result}end(e){if(this.log(`ending`),this.ending){let t=Error(`Called end on pool more than once`);return e?e(t):this.Promise.reject(t)}this.ending=!0;let t=l(this.Promise,e);return this._endCallback=t.callback,this._pulseQueue(),t.result}get waitingCount(){return this._pendingQueue.length}get idleCount(){return this._idle.length}get expiredCount(){return this._clients.reduce((e,t)=>e+(this._expired.has(t)?1:0),0)}get totalCount(){return this._clients.length}}})),Sb=r(((t,n)=>{var r=e(`events`).EventEmitter,i=e(`util`),a=Py(),o=n.exports=function(e,t,n){r.call(this),e=a.normalizeQueryConfig(e,t,n),this.text=e.text,this.values=e.values,this.name=e.name,this.callback=e.callback,this.state=`new`,this._arrayMode=e.rowMode===`array`,this._emitRowEvents=!1,this.on(`newListener`,function(e){e===`row`&&(this._emitRowEvents=!0)}.bind(this))};i.inherits(o,r);var s={sqlState:`code`,statementPosition:`position`,messagePrimary:`message`,context:`where`,schemaName:`schema`,tableName:`table`,columnName:`column`,dataTypeName:`dataType`,constraintName:`constraint`,sourceFile:`file`,sourceLine:`line`,sourceFunction:`routine`};o.prototype.handleError=function(e){var t=this.native.pq.resultErrorFields();if(t)for(var n in t){var r=s[n]||n;e[r]=t[n]}this.callback?this.callback(e):this.emit(`error`,e),this.state=`error`},o.prototype.then=function(e,t){return this._getPromise().then(e,t)},o.prototype.catch=function(e){return this._getPromise().catch(e)},o.prototype._getPromise=function(){return this._promise||=new Promise(function(e,t){this._once(`end`,e),this._once(`error`,t)}.bind(this)),this._promise},o.prototype.submit=function(e){this.state=`running`;var t=this;this.native=e.native,e.native.arrayMode=this._arrayMode;var n=function(n,r,i){if(e.native.arrayMode=!1,setImmediate(function(){t.emit(`_done`)}),n)return t.handleError(n);t._emitRowEvents&&(i.length>1?r.forEach((e,n)=>{e.forEach(e=>{t.emit(`row`,e,i[n])})}):r.forEach(function(e){t.emit(`row`,e,i)})),t.state=`end`,t.emit(`end`,i),t.callback&&t.callback(null,i)};if(process.domain&&(n=process.domain.bind(n)),this.name){this.name.length>63&&(console.error(`Warning! Postgres only supports 63 characters for query names.`),console.error(`You supplied %s (%s)`,this.name,this.name.length),console.error(`This can cause conflicts and silent errors executing queries`));var r=(this.values||[]).map(a.prepareValue);if(e.namedQueries[this.name]){if(this.text&&e.namedQueries[this.name]!==this.text){let e=Error(`Prepared statements must be unique - '${this.name}' was used for a different statement`);return n(e)}return e.native.execute(this.name,r,n)}return e.native.prepare(this.name,this.text,r.length,function(i){return i?n(i):(e.namedQueries[t.name]=t.text,t.native.execute(t.name,r,n))})}else if(this.values){if(!Array.isArray(this.values))return n(Error(`Query values must be an array`));var i=this.values.map(a.prepareValue);e.native.query(this.text,i,n)}else e.native.query(this.text,n)}})),Cb=r(((t,n)=>{var r;try{r=e(`pg-native`)}catch(e){throw e}var i=zy(),a=e(`events`).EventEmitter,o=e(`util`),s=Vy(),c=Sb(),l=n.exports=function(e){a.call(this),e||={},this._Promise=e.Promise||global.Promise,this._types=new i(e.types),this.native=new r({types:this._types}),this._queryQueue=[],this._ending=!1,this._connecting=!1,this._connected=!1,this._queryable=!0;var t=this.connectionParameters=new s(e);e.nativeConnectionString&&(t.nativeConnectionString=e.nativeConnectionString),this.user=t.user,Object.defineProperty(this,`password`,{configurable:!0,enumerable:!1,writable:!0,value:t.password}),this.database=t.database,this.host=t.host,this.port=t.port,this.namedQueries={}};l.Query=c,o.inherits(l,a),l.prototype._errorAllQueries=function(e){let t=t=>{process.nextTick(()=>{t.native=this.native,t.handleError(e)})};this._hasActiveQuery()&&(t(this._activeQuery),this._activeQuery=null),this._queryQueue.forEach(t),this._queryQueue.length=0},l.prototype._connect=function(e){var t=this;if(this._connecting){process.nextTick(()=>e(Error(`Client has already been connected. You cannot reuse a client.`)));return}this._connecting=!0,this.connectionParameters.getLibpqConnectionString(function(n,r){if(t.connectionParameters.nativeConnectionString&&(r=t.connectionParameters.nativeConnectionString),n)return e(n);t.native.connect(r,function(n){if(n)return t.native.end(),e(n);t._connected=!0,t.native.on(`error`,function(e){t._queryable=!1,t._errorAllQueries(e),t.emit(`error`,e)}),t.native.on(`notification`,function(e){t.emit(`notification`,{channel:e.relname,payload:e.extra})}),t.emit(`connect`),t._pulseQueryQueue(!0),e()})})},l.prototype.connect=function(e){if(e){this._connect(e);return}return new this._Promise((e,t)=>{this._connect(n=>{n?t(n):e()})})},l.prototype.query=function(e,t,n){var r,i,a,o,s;if(e==null)throw TypeError(`Client was passed a null or undefined query`);if(typeof e.submit==`function`)a=e.query_timeout||this.connectionParameters.query_timeout,i=r=e,typeof t==`function`&&(e.callback=t);else if(a=this.connectionParameters.query_timeout,r=new c(e,t,n),!r.callback){let e,t;i=new this._Promise((n,r)=>{e=n,t=r}).catch(e=>{throw Error.captureStackTrace(e),e}),r.callback=(n,r)=>n?t(n):e(r)}return a&&(s=r.callback,o=setTimeout(()=>{var e=Error(`Query read timeout`);process.nextTick(()=>{r.handleError(e,this.connection)}),s(e),r.callback=()=>{};var t=this._queryQueue.indexOf(r);t>-1&&this._queryQueue.splice(t,1),this._pulseQueryQueue()},a),r.callback=(e,t)=>{clearTimeout(o),s(e,t)}),this._queryable?this._ending?(r.native=this.native,process.nextTick(()=>{r.handleError(Error(`Client was closed and is not queryable`))}),i):(this._queryQueue.push(r),this._pulseQueryQueue(),i):(r.native=this.native,process.nextTick(()=>{r.handleError(Error(`Client has encountered a connection error and is not queryable`))}),i)},l.prototype.end=function(e){var t=this;this._ending=!0,this._connected||this.once(`connect`,this.end.bind(this,e));var n;return e||(n=new this._Promise(function(t,n){e=e=>e?n(e):t()})),this.native.end(function(){t._errorAllQueries(Error(`Connection terminated`)),process.nextTick(()=>{t.emit(`end`),e&&e()})}),n},l.prototype._hasActiveQuery=function(){return this._activeQuery&&this._activeQuery.state!==`error`&&this._activeQuery.state!==`end`},l.prototype._pulseQueryQueue=function(e){if(this._connected&&!this._hasActiveQuery()){var t=this._queryQueue.shift();if(!t){e||this.emit(`drain`);return}this._activeQuery=t,t.submit(this);var n=this;t.once(`_done`,function(){n._pulseQueryQueue()})}},l.prototype.cancel=function(e){this._activeQuery===e?this.native.cancel(function(){}):this._queryQueue.indexOf(e)!==-1&&this._queryQueue.splice(this._queryQueue.indexOf(e),1)},l.prototype.ref=function(){},l.prototype.unref=function(){},l.prototype.setTypeParser=function(e,t,n){return this._types.setTypeParser(e,t,n)},l.prototype.getTypeParser=function(e,t){return this._types.getTypeParser(e,t)}})),wb=r(((e,t)=>{t.exports=Cb()})),Tb=r(((e,t)=>{var n=nb(),r=Ny(),i=Qy(),a=xb();let{DatabaseError:o}=Yy(),{escapeIdentifier:s,escapeLiteral:c}=Py(),l=e=>class extends a{constructor(t){super(t,e)}};var u=function(e){this.defaults=r,this.Client=e,this.Query=this.Client.Query,this.Pool=l(this.Client),this._pools=[],this.Connection=i,this.types=My(),this.DatabaseError=o,this.escapeIdentifier=s,this.escapeLiteral=c};process.env.NODE_PG_FORCE_NATIVE===void 0?(t.exports=new u(n),Object.defineProperty(t.exports,`native`,{configurable:!0,enumerable:!1,get(){var e=null;try{e=new u(wb())}catch(e){if(e.code!==`MODULE_NOT_FOUND`)throw e}return Object.defineProperty(t.exports,`native`,{value:e}),e}})):t.exports=new u(wb())})),Eb=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getPGDatabaseOwner=e.currentDBUserIdentity=e.connectToPGAndReportOutcome=e.connectToPGDatabase=e.maskDatabaseUrl=e.getDatabaseNameFromUrl=e.getPGClientConfig=e.deriveDatabaseUrl=e.ensurePGDatabase=e.dropPGDatabase=void 0;let t=Tb();async function n(e={}){if(!e.urlToDrop&&!e.dbToDrop)throw TypeError(`dropPGDatabase requires a target database name or URL to DROP`);let t=[],n=n=>{t.push(n),(e.logger??console.log)(n)};function r(e,r){return n(`FAIL: ${e}${r?` | HINT: ${r}`:``}`),{message:e,status:`failed`,notes:t,hint:r}}let a=e.adminUrl??(e.urlToDrop?i(e.urlToDrop,`postgres`):void 0);if(!a)throw TypeError(`dropPostgresDatabase requires a connection string to a database with permission to perform the DROP`);let p=i(e.urlToDrop??a,`template1`),h=e.tryTemplate1Fallback??!0,b=e.dbToDrop??o(e.urlToDrop);if(!b)return r(`Target URL has no database name in the path (e.g., /mydb).`,`Fix the target URL and retry.`);n(`Target DB to drop: ${b}`),n(`Admin URL (planned): ${s(a)}`);let x=await c(a,n);!x&&h&&(n(`Admin connect failed. Trying template1 as a fallback...`),x=await c(p,n));let S=async()=>{if(!x)return`unknown`;let{rows:e}=await x.query(`SELECT EXISTS (SELECT 1 FROM pg_database WHERE datname = $1) AS exists`,[b]);return e[0]?.exists??!1};try{let o=`unknown`;if(x&&(o=await S(),o===!1))return n(`DB "${b}" does not exist (confirmed via catalog).`),{status:`did_not_exist`,notes:t,message:`Success (already dropped)`};if(!x){let o=await l(e.urlToDrop??i(a,b),n,`probe target (existence test)`);return o.result===`ok`?(await o.client.end().catch(()=>{}),r(`Database "${b}" exists, but we could not establish an admin connection to drop it.`,`Provide an admin/alternate DB URL (same server) with privileges to DROP DATABASE`)):o.code===`3D000`?(n(`DB "${b}" does not exist (error 3D000 while connecting). Database already does not exist.`),{status:`did_not_exist`,notes:t,message:`Success (already dropped)`}):r(`Could not establish any admin connection, and target connect failed with ${o.code??o.result}.`,v(o.code))}let s=await d(x),c=await f(x,b);!s.isSuperuser&&c&&c!==s.user&&(n(`Ownership check: DB owned by "${c}", current_user is "${s.user}" (superuser=${s.isSuperuser}).`),n(`Warning: You might lack privileges to DROP this database unless you are the owner or superuser.`));try{n(`Attempting DROP ... WITH (FORCE).`),await m(x,b)}catch(e){let t=e;if(g(t)){n(`WITH (FORCE) not supported by server (syntax error). Falling back to terminate-and-drop.`);try{await _(x,b,3e3,n)}catch(e){let t=e;return await x.end().catch(()=>{}),r(`Drop failed even after fallback: ${u(t)}`,y(t?.code))}}else return await x.end().catch(()=>{}),r(`Drop failed: ${u(t)}`,y(t?.code))}let p=await S();return p===!1?(n(`Verified: database "${b}" is gone.`),{status:`dropped`,notes:t,message:`Success (dropped)`}):p===!0?r(`After drop attempt, database "${b}" still exists.`,`Terminate all sessions and retry.`):(n(`Could not verify drop due to unexpected state.`),{status:`dropped`,notes:t,message:`Success (dropped)`})}finally{await x?.end().catch(()=>{})}}e.dropPGDatabase=n;async function r(e){if(!e.urlToEnsure&&!e.dbToEnsure)throw TypeError(`ensurePGDatabase requires a target database name or URL to check`);let t=[],n=n=>{t.push(n),(e.logger??console.log)(n)};function r(e,r){return n(`FAIL: ${e}${r?` | HINT: ${r}`:``}`),{status:`failed`,notes:t,hint:r,message:e}}let a=e.dbToEnsure??o(e.urlToEnsure);if(!a)return r(`Target URL has no database name in the path (e.g., /mydb).`,`Fix the target URL and retry.`);if(e.urlToEnsure)try{let r=await l(e.urlToEnsure,n,`probe target (existence test)`);if(r.result===`ok`)return await r.client.end().catch(()=>{}),{status:`already_exists`,notes:t,message:`Success (already existed)`}}catch{n(`Caught error probing database: (e as Error).message; attempting create.`)}let d=e.adminUrl??(e.urlToEnsure?i(e.urlToEnsure,`postgres`):void 0);if(!d)throw TypeError(`dropPostgresDatabase requires a connection string to a database with permission to perform the DROP`);let f=i(e.urlToEnsure??d,`template1`),p=e.tryTemplate1Fallback??!0,m=await c(d,n);!m&&p&&(n(`Admin connect failed. Trying template1 as a fallback...`),m=await c(f,n));let g=async()=>{if(!m)return`unknown`;let{rows:e}=await m.query(`SELECT EXISTS (SELECT 1 FROM pg_database WHERE datname = $1) AS exists`,[a]);return e[0]?.exists??!1};try{let o=`unknown`;if(m&&(o=await g(),o===!0))return n(`DB "${a}" exists (confirmed via catalog).`),{status:`already_exists`,notes:t,message:`Success (already existed)`};if(!m){let o=e.urlToEnsure??i(d,a),c=await l(o,n,`probe target (existence test)`);return c.result===`ok`?(await c.client.end().catch(()=>{}),n(`Probe of database ${a} via ${s(o)} succeeds.`),{status:`already_exists`,notes:t,message:`Success (already existed)`}):r(`Could not establish any admin connection, and target connect failed with ${c.code??c.result}.`,v(c.code))}try{n(`Attempting CREATE.`),await h(m,a)}catch(e){let t=e;return await m.end().catch(()=>{}),r(`Create failed: ${u(t)}`,y(t?.code))}let c=await g();return c===!0?(n(`Verified: database "${a}" exists.`),{status:`created`,notes:t,message:`Success (created)`}):c===!1?r(`After create attempt, database "${a}" does not exist still.`):(n(`Could not verify creation due to unexpected state.`),{status:`created`,notes:t,message:`Success (unverified)`})}finally{await m?.end().catch(()=>{})}}e.ensurePGDatabase=r;function i(e,t){try{let n=new URL(e);return n.pathname=`/${t}`,n.toString()}catch{return e}}e.deriveDatabaseUrl=i;function a(e){let t=typeof e==`string`?e:e.toString(),n=r(typeof e==`string`?new URL(e):e);return{connectionString:t,connectionTimeoutMillis:n?n*1e3:1e4};function r(e){try{let t=e.searchParams.get(`connect_timeout`);return t?parseInt(t,10):void 0}catch{return}}}e.getPGClientConfig=a;function o(e){return new URL(e).pathname?.replace(/^\//,``)||``}e.getDatabaseNameFromUrl=o;function s(e){try{let t=new URL(e);if(t.password){let e=decodeURIComponent(t.password),n=e.length<=2?e:`${e[0]}${`*`.repeat(e.length-2)}${e[e.length-1]}`;t.password=encodeURIComponent(n)}return t.toString()}catch{return e}}e.maskDatabaseUrl=s;async function c(e,n){n(`Connecting: ${s(e)}`);let r=new t.Client(a(e));r.on(`error`,e=>{n(`Unexpected error in startup client: ${e}`)});try{return await r.connect(),r}catch(e){let t=e;n(`Connect failed: ${u(t)}${t?.code?` (code ${t.code})`:``}`);try{await r.end()}catch{}return null}}e.connectToPGDatabase=c;async function l(e,n,r){n(`Connecting to ${r}: ${s(e)}`);let i=new t.Client(a(e));i.on(`error`,e=>{n(`Unexpected error in startup client: ${e}`)});try{return await i.connect(),{result:`ok`,client:i}}catch(e){let t=e;try{await i.end()}catch{}return{result:`error`,code:t?.code,message:t?.message??String(t)}}}e.connectToPGAndReportOutcome=l;function u(e){let t=e?.message??String(e);return t.length>500?`${t.slice(0,500)}…`:t}async function d(e){let{rows:t}=await e.query(`SELECT current_user AS user`),n=t[0]?.user??``,{rows:r}=await e.query(`SELECT rolsuper FROM pg_roles WHERE rolname = current_user`);return{user:n,isSuperuser:!!r[0]?.rolsuper}}e.currentDBUserIdentity=d;async function f(e,t){let{rows:n}=await e.query(`SELECT r.rolname AS owner
31
+ FROM pg_database d JOIN pg_roles r ON r.oid = d.datdba
32
+ WHERE d.datname = $1`,[t]);return n[0]?.owner??null}e.getPGDatabaseOwner=f;function p(e){return`"${e.replace(/"/g,`""`)}"`}async function m(e,t){await e.query(`DROP DATABASE IF EXISTS ${p(t)} WITH (FORCE)`)}async function h(e,t){await e.query(`CREATE DATABASE ${p(t)}`)}function g(e){return e?.code===`42601`||/WITH\s*\(\s*FORCE\s*\)/i.test(e?.message??``)}async function _(e,t,n,r){try{await e.query(`ALTER DATABASE ${p(t)} WITH ALLOW_CONNECTIONS = false`)}catch(e){r(`ALTER DATABASE ... ALLOW_CONNECTIONS=false failed (continuing): ${u(e)}`)}await e.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = $1 AND pid <> pg_backend_pid()`,[t]),n>0&&(r(`Waiting ${n}ms for backends to terminate...`),await new Promise(e=>setTimeout(e,n)));try{await e.query(`DROP DATABASE IF EXISTS ${p(t)}`)}catch(i){let a=i;if(a?.code===`55006`)r(`DB still "being accessed by other users"; retrying after extra wait...`),await new Promise(e=>setTimeout(e,Math.max(1e3,n))),await e.query(`SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = $1 AND pid <> pg_backend_pid()`,[t]),await e.query(`DROP DATABASE IF EXISTS ${p(t)}`);else throw a}}function v(e){if(e)switch(e){case`ECONNREFUSED`:return`Server not reachable. Check host/port or firewall.`;case`ENOTFOUND`:return`Hostname not resolvable. Check DNS/host.`;case`ETIMEDOUT`:return`Connection timed out. Check network/firewall.`;case`28P01`:return`Invalid password.`;case`28000`:return`Authentication rejected (pg_hba.conf or method).`;default:return e.substring(0,2)===`28`?`Other connection security error`:void 0}}function y(e){switch(e?.substring(0,5)){case`42501`:return`Insufficient privilege. You must be the owner or a superuser.`;case`53300`:return`Too many connections to server; free some slots.`;default:break}switch(e?.substring(0,2)){case`42`:return`Syntax error or access rule violation.`;case`3D`:return`Target database does not exist (already gone).`;case`55`:return`Database is in use. Terminate sessions or use PG13+ WITH (FORCE).`;case`53`:return`Insufficient resources.`;default:return}}})),Db=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.runSysMigrationsPg=e.getCurrentSysDBVersion=void 0;async function t(e,t=`dbos`){if(!(await e.query(`SELECT table_name FROM information_schema.tables WHERE table_schema = $1 AND table_name = 'dbos_migrations'`,[t])).rows[0]?.table_name)return 0;let n=await e.query(`select version from "${t}"."dbos_migrations" order by version desc limit 1`);if(n.rowCount===0)return 0;let r=n.rows[0].version,i=Number(r);return Number.isFinite(i)?i:0}e.getCurrentSysDBVersion=t;let n=new Set([`42P07`,`42710`,`42701`,`42P06`,`23505`]);function r(e){return typeof e==`object`&&!!e&&(`code`in e||`message`in e)}function i(e,t){if(!r(e))return!1;if(e.code&&t.has(e.code))return!0;let n=e.message??``;return/already exists/i.test(n)||/duplicate/i.test(n)||/multiple.*?not allowed/i.test(n)}async function a(e,t,n,r){for(let a of t)try{await e.query(a,[])}catch(e){if(i(e,n)){r(`Ignoring migration error; migration was likely already applied. Occurred while executing: ${a}`,e);continue}throw e}}async function o(e,r,i=`dbos`,o={}){let{ignoreErrorCodes:s=n,onWarn:c=e=>console.info(e)}=o,l=await t(e,i),u=r.length;if(l>u)return{fromVersion:l,toVersion:l,appliedCount:0,skippedCount:r.length,notice:`Database version (${l}) is ahead of this build's max (${u}). A newer software version may be running concurrently.`};let d=0,f=0,p=l,m=!1;for(let t=0;t<r.length;t++){let n=r[t],i=t+1;if(i<=l){f++;continue}m||=(c(`Running DBOS system database migrations...`),!0);let o=n.pg??[];if(o.length===0){c(`Migration "${n.name}" has no Postgres statements; skipping.`),f++;continue}await a(e,o,s,(e,t)=>c(`${e}${t?`\n → ${String(t.message??``)}`:``}`)),d++,p=i}return(await e.query(`UPDATE "${i}"."dbos_migrations" SET "version" = $1`,[p])).rowCount===0&&await e.query(`INSERT into "${i}"."dbos_migrations" ("version") values ($1)`,[p]),{fromVersion:l,toVersion:p,appliedCount:d,skippedCount:f,notice:l<u&&d===0&&f>0?`Nothing to apply; DB is already up-to-date relative to known migrations.`:void 0}}e.runSysMigrationsPg=o})),Ob=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.allMigrations=void 0;function t(e=`dbos`){return[{name:`20240123182943_schema`,pg:[`CREATE SCHEMA IF NOT EXISTS "${e}"`]},{name:`20240123182944_dbos_migrations`,pg:[`create table "${e}"."dbos_migrations" ("version" bigint not null, constraint "dbos_migrations_pkey" primary key ("version"))`]},{name:`20240123183021_tables`,pg:[`create table "${e}"."operation_outputs" ("workflow_uuid" text not null, "function_id" integer not null, "output" text, "error" text, constraint "operation_outputs_pkey" primary key ("workflow_uuid", "function_id"))`,`create table "${e}"."workflow_inputs" ("workflow_uuid" text not null, "inputs" text not null, constraint "workflow_inputs_pkey" primary key ("workflow_uuid"))`,`create table "${e}"."workflow_status" ("workflow_uuid" text, "status" text, "name" text, "authenticated_user" text, "assumed_role" text, "authenticated_roles" text, "request" text, "output" text, "error" text, "executor_id" text, constraint "workflow_status_pkey" primary key ("workflow_uuid"))`,`create table "${e}"."notifications" ("destination_uuid" text not null, "topic" text, "message" text not null, "created_at_epoch_ms" bigint not null default (EXTRACT(EPOCH FROM now())*1000)::bigint)`,`create table "${e}"."workflow_events" ("workflow_uuid" text not null, "key" text not null, "value" text not null, constraint "workflow_events_pkey" primary key ("workflow_uuid", "key"))`]},{name:`20240123183025_indexes`,pg:[`create index "idx_workflow_topic" on "${e}"."notifications" ("destination_uuid", "topic")`]},{name:`20240123183030_triggers`,pg:[`
33
+ CREATE OR REPLACE FUNCTION "${e}".notifications_function() RETURNS TRIGGER AS $$
34
+ DECLARE
35
+ payload text := NEW.destination_uuid || '::' || NEW.topic;
36
+ BEGIN
37
+ PERFORM pg_notify('dbos_notifications_channel', payload);
38
+ RETURN NEW;
39
+ END;
40
+ $$ LANGUAGE plpgsql;
41
+
42
+ CREATE TRIGGER dbos_notifications_trigger
43
+ AFTER INSERT ON "${e}".notifications
44
+ FOR EACH ROW EXECUTE FUNCTION "${e}".notifications_function();
45
+
46
+ CREATE OR REPLACE FUNCTION "${e}".workflow_events_function() RETURNS TRIGGER AS $$
47
+ DECLARE
48
+ payload text := NEW.workflow_uuid || '::' || NEW.key;
49
+ BEGIN
50
+ PERFORM pg_notify('dbos_workflow_events_channel', payload);
51
+ RETURN NEW;
52
+ END;
53
+ $$ LANGUAGE plpgsql;
54
+
55
+ CREATE TRIGGER dbos_workflow_events_trigger
56
+ AFTER INSERT ON "${e}".workflow_events
57
+ FOR EACH ROW EXECUTE FUNCTION "${e}".workflow_events_function();
58
+ `]},{name:`20240124015239_status_timestamp`,pg:[`alter table "${e}"."workflow_status" add column "created_at" bigint not null default (EXTRACT(EPOCH FROM now())*1000)::bigint, add column "updated_at" bigint not null default (EXTRACT(EPOCH FROM now())*1000)::bigint`]},{name:`20240201213211_replica_identity`,pg:[`create extension if not exists "uuid-ossp"`,`alter table "${e}"."notifications" add column "message_uuid" text default uuid_generate_v4()`,`alter table "${e}"."notifications" add constraint "notifications_pkey" primary key ("message_uuid")`]},{name:`20240205223925_foreign_keys`,pg:[`create index "workflow_status_created_at_index" on "${e}"."workflow_status" ("created_at")`,`alter table "${e}"."operation_outputs" add constraint "operation_outputs_workflow_uuid_foreign" foreign key ("workflow_uuid") references "${e}"."workflow_status" ("workflow_uuid") on update CASCADE on delete CASCADE`,`alter table "${e}"."workflow_inputs" add constraint "workflow_inputs_workflow_uuid_foreign" foreign key ("workflow_uuid") references "${e}"."workflow_status" ("workflow_uuid") on update CASCADE on delete CASCADE`,`alter table "${e}"."notifications" add constraint "notifications_destination_uuid_foreign" foreign key ("destination_uuid") references "${e}"."workflow_status" ("workflow_uuid") on update CASCADE on delete CASCADE`,`alter table "${e}"."workflow_events" add constraint "workflow_events_workflow_uuid_foreign" foreign key ("workflow_uuid") references "${e}"."workflow_status" ("workflow_uuid") on update CASCADE on delete CASCADE`]},{name:`20240207192338_executor_id_index`,pg:[`create index "workflow_status_executor_id_index" on "${e}"."workflow_status" ("executor_id")`]},{name:`20240430090000_tables`,pg:[`create table "${e}"."scheduler_state" ("workflow_fn_name" text not null, "last_run_time" bigint not null, constraint "scheduler_state_pkey" primary key ("workflow_fn_name"))`]},{name:`20240516004341_application_version`,pg:[`alter table "${e}"."workflow_status" add column "application_version" text, add column "application_id" text`]},{name:`20240517000000_status_class_config`,pg:[`alter table "${e}"."workflow_status" add column "class_name" varchar(255) default null, add column "config_name" varchar(255) default null`]},{name:`20240621000000_workflow_tries`,pg:[`alter table "${e}"."workflow_status" add column "recovery_attempts" bigint default '0'`]},{name:`20240924000000_workflowqueue`,pg:[`alter table "${e}"."workflow_status" add column "queue_name" text default null`,`create table "${e}"."workflow_queue" ("queue_name" text not null, "workflow_uuid" text not null, "created_at_epoch_ms" bigint not null default (EXTRACT(EPOCH FROM now())*1000)::bigint, "started_at_epoch_ms" bigint, "completed_at_epoch_ms" bigint, constraint "workflow_queue_pkey" primary key ("workflow_uuid"))`,`alter table "${e}"."workflow_queue" add constraint "workflow_queue_workflow_uuid_foreign" foreign key ("workflow_uuid") references "${e}"."workflow_status" ("workflow_uuid") on update CASCADE on delete CASCADE`]},{name:`20241009150000_event_dispatch_kv`,pg:[`create table "${e}"."event_dispatch_kv" ("service_name" text not null, "workflow_fn_name" text not null, "key" text not null, "value" text, "update_seq" decimal(38, 0), "update_time" decimal(38, 15), constraint "event_dispatch_kv_pkey" primary key ("service_name", "workflow_fn_name", "key"))`]},{name:`20250312171547_function_name_op_outputs`,pg:[`alter table "${e}"."operation_outputs" add column "function_name" text not null default ''`]},{name:`20250319190617_add_childid_opoutputs`,pg:[`alter table "${e}"."operation_outputs" add column "child_workflow_id" text`]},{name:`20252101000000_workflow_queues_executor_id`,pg:[`alter table "${e}"."workflow_queue" add column "executor_id" text`]},{name:`20252501190959_queue_dedup_id`,pg:[`alter table "${e}"."workflow_queue" add column "deduplication_id" text`,`alter table "${e}"."workflow_queue" add constraint "workflow_queue_queue_name_deduplication_id_unique" unique ("queue_name", "deduplication_id")`]},{name:`20252505000000_workflow_timeout`,pg:[`alter table "${e}"."workflow_status" add column "workflow_timeout_ms" bigint, add column "workflow_deadline_epoch_ms" bigint`]},{name:`20252512000000_queue_priority`,pg:[`alter table "${e}"."workflow_queue" add column "priority" integer not null default '0'`]},{name:`20252523000000_consolidate_inputs`,pg:[`alter table "${e}"."workflow_status" add column "inputs" text null`]},{name:`20252528000000_consolidate_queues`,pg:[`alter table "${e}"."workflow_status" add column "started_at_epoch_ms" bigint null, add column "deduplication_id" text null, add column "priority" integer not null default '0'`,`alter table "${e}"."workflow_status" add constraint "uq_workflow_status_queue_name_dedup_id" unique ("queue_name", "deduplication_id")`,`create index "workflow_status_status_index" on "${e}"."workflow_status" ("status")`]},{name:`20252806000000_streaming`,pg:[`create table "${e}"."streams" ("workflow_uuid" text not null, "key" text not null, "value" text not null, "offset" integer not null, constraint "streams_pkey" primary key ("workflow_uuid", "key", "offset"))`,`alter table "${e}"."streams" add constraint "streams_workflow_uuid_foreign" foreign key ("workflow_uuid") references "${e}"."workflow_status" ("workflow_uuid") on update CASCADE on delete CASCADE`]},{name:`20252810000000_partitioned_queues`,pg:[`alter table "${e}"."workflow_status" add column "queue_partition_key" text`]},{name:`20252950000000_workflow_status_queue_status_started_index`,pg:[`create index "idx_workflow_status_queue_status_started" on "${e}"."workflow_status" ("queue_name", "status", "started_at_epoch_ms")`]},{pg:[`ALTER TABLE "${e}".workflow_status ADD COLUMN forked_from TEXT;`,`create index "idx_workflow_status_forked_from" on "${e}"."workflow_status" ("forked_from")`]},{pg:[`ALTER TABLE "${e}".operation_outputs ADD COLUMN started_at_epoch_ms BIGINT, ADD COLUMN completed_at_epoch_ms BIGINT;`]}]}e.allMigrations=t})),kb=r((t=>{var n=t&&t.__decorate||function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},r=t&&t.__metadata||function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)};Object.defineProperty(t,`__esModule`,{value:!0}),t.PostgresSystemDatabase=t.ensureSystemDatabase=t.grantDbosSchemaPermissions=t.DBOS_STREAM_CLOSED_SENTINEL=t.DEFAULT_POOL_SIZE=t.DBOS_FUNCNAME_CLOSESTREAM=t.DBOS_FUNCNAME_WRITESTREAM=t.DBOS_FUNCNAME_GETSTATUS=t.DBOS_FUNCNAME_SLEEP=t.DBOS_FUNCNAME_GETEVENT=t.DBOS_FUNCNAME_SETEVENT=t.DBOS_FUNCNAME_RECV=t.DBOS_FUNCNAME_SEND=void 0;let i=Rb(),a=Tb(),o=ny(),s=_y(),c=gy(),l=e(`crypto`),u=gy(),d=Eb(),f=Db(),p=Ob();t.DBOS_FUNCNAME_SEND=`DBOS.send`,t.DBOS_FUNCNAME_RECV=`DBOS.recv`,t.DBOS_FUNCNAME_SETEVENT=`DBOS.setEvent`,t.DBOS_FUNCNAME_GETEVENT=`DBOS.getEvent`,t.DBOS_FUNCNAME_SLEEP=`DBOS.sleep`,t.DBOS_FUNCNAME_GETSTATUS=`getStatus`,t.DBOS_FUNCNAME_WRITESTREAM=`DBOS.writeStream`,t.DBOS_FUNCNAME_CLOSESTREAM=`DBOS.closeStream`,t.DEFAULT_POOL_SIZE=10,t.DBOS_STREAM_CLOSED_SENTINEL=`__DBOS_STREAM_CLOSED__`;async function m(e,t,n,r=`dbos`){n.info(`Granting permissions for ${r} schema to ${t}`);let i=new a.Client((0,u.getClientConfig)(e));await i.connect();try{let e=`GRANT USAGE ON SCHEMA "${r}" TO "${t}"`;n.info(e),await i.query(e);let a=`GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA "${r}" TO "${t}"`;n.info(a),await i.query(a);let o=`GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA "${r}" TO "${t}"`;n.info(o),await i.query(o);let s=`GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA "${r}" TO "${t}"`;n.info(s),await i.query(s);let c=`ALTER DEFAULT PRIVILEGES IN SCHEMA "${r}" GRANT ALL ON TABLES TO "${t}"`;n.info(c),await i.query(c);let l=`ALTER DEFAULT PRIVILEGES IN SCHEMA "${r}" GRANT ALL ON SEQUENCES TO "${t}"`;n.info(l),await i.query(l);let u=`ALTER DEFAULT PRIVILEGES IN SCHEMA "${r}" GRANT EXECUTE ON FUNCTIONS TO "${t}"`;n.info(u),await i.query(u)}catch(e){throw n.error(`Failed to grant permissions to role ${t}: ${e.message}`),e}finally{await i.end()}}t.grantDbosSchemaPermissions=m;async function h(e,t,n=!1,r,i=`dbos`){if(n)return;let a=null;if(r)a=await r.connect();else{let r=await(0,d.ensurePGDatabase)({urlToEnsure:e,logger:e=>t.debug(e)});r.status===`failed`&&t.warn(`Database could not be verified / created: ${(0,d.maskDatabaseUrl)(e)}: ${r.message} ${r.hint??``}\n ${r.notes.join(`
59
+ `)}`);let i=await(0,d.connectToPGAndReportOutcome)(e,()=>{},`System Database`);if(i.result!==`ok`)throw t.warn(`Unable to connect to system database at ${(0,d.maskDatabaseUrl)(e)}${n?` (debug mode)`:``}
60
+ ${i.message}: (${i.code?i.code:`connectivity problem`})`),new o.DBOSInitializationError(`Unable to connect to system database at ${(0,d.maskDatabaseUrl)(e)}`);a=i.client}try{await(0,f.runSysMigrationsPg)(a,(0,p.allMigrations)(i),i,{onWarn:e=>t.info(e)})}finally{try{r?a.release():await a.end()}catch{}}}t.ensureSystemDatabase=h;var g=class{map=new Map;curCK=0;registerCallback(e,t){this.map.has(e)||this.map.set(e,new Map);let n=this.curCK++;return this.map.get(e).set(n,t),{key:e,ck:n}}deregisterCallback(e){if(!this.map.has(e.key))return;let t=this.map.get(e.key);t.has(e.ck)&&(t.delete(e.ck),t.size===0&&this.map.delete(e.key))}callCallbacks(e,t){if(!this.map.has(e))return;let n=this.map.get(e);for(let e of n.values())e(t)}};async function _(e,t,n){try{let{rows:r}=await e.query(`INSERT INTO "${n}".workflow_status (
61
+ workflow_uuid,
62
+ status,
63
+ name,
64
+ class_name,
65
+ config_name,
66
+ queue_name,
67
+ authenticated_user,
68
+ assumed_role,
69
+ authenticated_roles,
70
+ request,
71
+ executor_id,
72
+ application_version,
73
+ application_id,
74
+ created_at,
75
+ recovery_attempts,
76
+ updated_at,
77
+ workflow_timeout_ms,
78
+ workflow_deadline_epoch_ms,
79
+ inputs,
80
+ deduplication_id,
81
+ priority,
82
+ queue_partition_key,
83
+ forked_from
84
+ ) VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23)
85
+ ON CONFLICT (workflow_uuid)
86
+ DO UPDATE SET
87
+ recovery_attempts = CASE
88
+ WHEN workflow_status.status != '${s.StatusString.ENQUEUED}'
89
+ THEN workflow_status.recovery_attempts + 1
90
+ ELSE workflow_status.recovery_attempts
91
+ END,
92
+ updated_at = EXCLUDED.updated_at,
93
+ executor_id = CASE
94
+ WHEN EXCLUDED.status != '${s.StatusString.ENQUEUED}'
95
+ THEN EXCLUDED.executor_id
96
+ ELSE workflow_status.executor_id
97
+ END
98
+ RETURNING recovery_attempts, status, name, class_name, config_name, queue_name, workflow_deadline_epoch_ms`,[t.workflowUUID,t.status,t.workflowName,t.workflowClassName,t.workflowConfigName,t.queueName??null,t.authenticatedUser,t.assumedRole,JSON.stringify(t.authenticatedRoles),JSON.stringify(t.request),t.executorId,t.applicationVersion??null,t.applicationID,t.createdAt,t.status===s.StatusString.ENQUEUED?0:1,t.updatedAt??Date.now(),t.timeoutMS??null,t.deadlineEpochMS??null,t.input??null,t.deduplicationID??null,t.priority,t.queuePartitionKey??null,t.forkedFrom??null]);if(r.length===0)throw Error(`Attempt to insert workflow ${t.workflowUUID} failed`);return r[0]}catch(e){throw e.code===`23505`?new o.DBOSQueueDuplicatedError(t.workflowUUID,t.queueName??``,t.deduplicationID??``):e}}async function v(e,t,n){let{rows:r}=await e.query(`SELECT status FROM "${n}".workflow_status WHERE workflow_uuid=$1`,[t]);return r.length===0?void 0:r[0].status}async function y(e,t,n,r,i={}){let a=`SET status=$2, updated_at=$3`,s=`WHERE workflow_uuid=$1`,c=[t,n,Date.now()],l=i.update??{};if(l.output){let e=c.push(l.output);a+=`, output=$${e}`}if(l.error){let e=c.push(l.error);a+=`, error=$${e}`}if(l.resetRecoveryAttempts&&(a+=`, recovery_attempts = 0`),l.resetDeadline&&(a+=`, workflow_deadline_epoch_ms = NULL`),l.queueName!==void 0){let e=c.push(l.queueName??void 0);a+=`, queue_name=$${e}`}l.resetDeduplicationID&&(a+=`, deduplication_id = NULL`),l.resetStartedAtEpochMs&&(a+=`, started_at_epoch_ms = NULL`);let u=i.where??{};if(u.status){let e=c.push(u.status);s+=` AND status=$${e}`}let d=await e.query(`UPDATE "${r}".workflow_status ${a} ${s}`,c);if((i.throwOnFailure??!0)&&d.rowCount!==1)throw new o.DBOSWorkflowConflictError(`Attempt to record transition of nonexistent workflow ${t}`)}async function b(e,t,n,r,i,a,s,c={}){try{await e.query(`INSERT INTO ${a}.operation_outputs
99
+ (workflow_uuid, function_id, output, error, function_name, child_workflow_id, started_at_epoch_ms, completed_at_epoch_ms)
100
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
101
+ ${i?``:` ON CONFLICT DO NOTHING`};`,[t,n,c.output??null,c.error??null,r,c.childWorkflowID??null,s,Date.now()])}catch(e){let n=e;throw n.code===`40001`||n.code===`23505`?new o.DBOSWorkflowConflictError(t):n}}function x(e){return{workflowUUID:e.workflow_uuid,status:e.status,workflowName:e.name,output:e.output?e.output:null,error:e.error?e.error:null,workflowClassName:e.class_name??``,workflowConfigName:e.config_name??``,queueName:e.queue_name??void 0,authenticatedUser:e.authenticated_user,assumedRole:e.assumed_role,authenticatedRoles:JSON.parse(e.authenticated_roles),request:e.request?JSON.parse(e.request):{},executorId:e.executor_id,createdAt:Number(e.created_at),updatedAt:Number(e.updated_at),applicationVersion:e.application_version,applicationID:e.application_id,recoveryAttempts:Number(e.recovery_attempts),input:e.inputs?e.inputs:null,timeoutMS:e.workflow_timeout_ms?Number(e.workflow_timeout_ms):void 0,deadlineEpochMS:e.workflow_deadline_epoch_ms?Number(e.workflow_deadline_epoch_ms):void 0,deduplicationID:e.deduplication_id??void 0,priority:e.priority??0,queuePartitionKey:e.queue_partition_key??void 0,forkedFrom:e.forked_from??void 0}}let S=new Set([`08`,`53`,`57`]),C=new Set([`40003`]),w=new Set([`ECONNRESET`,`ECONNREFUSED`,`EHOSTUNREACH`,`ENETUNREACH`,`ETIMEDOUT`,`ECONNABORTED`]);function T(e){return!!e&&typeof e==`object`&&typeof e.code==`string`&&e.code.length===5}function E(e){if(!e)return!1;if(C.has(e))return!0;let t=e.toString().slice(0,2);return S.has(t)}function ee(e){let t=e.code;return!!t&&w.has(t)}function te(e){let t=e.toLowerCase();return e.includes(`ECONNREFUSED`)||e.includes(`ECONNRESET`)||t.includes(`connection timeout`)||t.includes(`server closed the connection`)||t.includes(`connection terminated unexpectedly`)||t.includes(`client has encountered a connection error`)||t.includes(`timeout exceeded when trying to connect`)||t.includes(`could not connect to server`)}function*D(e){let t=[e],n=new Set;for(;t.length;){let e=t.shift();if(e&&typeof e==`object`){if(n.has(e))continue;n.add(e);let r=e;Array.isArray(r.errors)&&t.push(...r.errors);let i=e;i.cause&&t.push(i.cause);let a=e;a.error&&t.push(a.error)}yield e}}function ne(e){for(let t of D(e)){let e=t;if(T(e)&&E(e.code)||ee(e))return!0;if(t instanceof Error){if(t.stack&&te(t.stack)||t.message&&te(t.message))return!0}else if(te(String(t)))return!0}return!1}function O(e={}){let{initialBackoff:t=1,maxBackoff:n=60}=e;return function(e,r,a){let o=a.value;return a.value=async function(...e){let r=0,a=t;for(;;)try{return await o.apply(this,e)}catch(e){if(ne(e)){r++;let t=a*(.5+Math.random());i.DBOSExecutor.globalInstance?.logger.warn(`Database connection failed: ${e instanceof Error?e.message:String(e)}. Retrying in ${t.toFixed(2)}s (attempt ${r})`),await(0,c.sleepms)(t*1e3),a=Math.min(a*2,n)}else throw e}},a}}var k=class{systemDatabaseUrl;logger;pool;schemaName;notificationsClient=null;dbPollingIntervalResultMs=1e3;dbPollingIntervalEventMs=1e4;shouldUseDBNotifications=!0;notificationsMap=new g;workflowEventsMap=new g;cancelWakeupMap=new g;customPool=!1;runningWorkflowMap=new Map;workflowCancellationMap=new Map;constructor(e,n,r=t.DEFAULT_POOL_SIZE,i,o=`dbos`){if(this.systemDatabaseUrl=e,this.logger=n,this.schemaName=o,i)this.pool=i,this.customPool=!0;else{let t={...(0,u.getClientConfig)(e),application_name:`dbos_transact_${c.globalParams.executorID}_${c.globalParams.appVersion}`,max:r};this.pool=new a.Pool(t)}this.pool.on(`error`,e=>{this.logger.warn(`Unexpected error in pool: ${e}`)}),this.pool.on(`connect`,e=>{e.on(`error`,e=>{this.logger.warn(`Unexpected error in idle client: ${e}`)})})}async init(e=!1){await h(this.systemDatabaseUrl,this.logger,e,this.customPool?this.pool:void 0,this.schemaName),this.shouldUseDBNotifications&&await this.#o()}async destroy(){if(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.notificationsClient)try{this.notificationsClient.release(!0)}catch(e){this.logger.warn(`Error ending notifications client: ${String(e)}`)}await this.pool.end()}async initWorkflowStatus(e,t){let n=await this.pool.connect();try{await n.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);let r=await _(n,e,this.schemaName);if(r.name!==e.workflowName){let t=`Workflow already exists with a different function name: ${r.name}, but the provided function name is: ${e.workflowName}`;throw new o.DBOSConflictingWorkflowError(e.workflowUUID,t)}else if(r.class_name!==e.workflowClassName){let t=`Workflow already exists with a different class name: ${r.class_name}, but the provided class name is: ${e.workflowClassName}`;throw new o.DBOSConflictingWorkflowError(e.workflowUUID,t)}else if((r.config_name||``)!==(e.workflowConfigName||``)){let t=`Workflow already exists with a different class configuration: ${r.config_name}, but the provided class configuration is: ${e.workflowConfigName}`;throw new o.DBOSConflictingWorkflowError(e.workflowUUID,t)}else (r.queue_name??void 0)!==(e.queueName??void 0)&&this.logger.warn(`Workflow (${e.workflowUUID}) already exists in queue: ${r.queue_name}, but the provided queue name is: ${e.queueName}. The queue is not updated. ${Error().stack}`);let i=r.recovery_attempts;if(t&&i>t+1)throw await y(n,e.workflowUUID,s.StatusString.MAX_RECOVERY_ATTEMPTS_EXCEEDED,this.schemaName,{where:{status:s.StatusString.PENDING},throwOnFailure:!1}),new o.DBOSMaxRecoveryAttemptsExceededError(e.workflowUUID,t);return this.logger.debug(`Workflow ${e.workflowUUID} attempt number: ${i}.`),{status:r.status,deadlineEpochMS:r.workflow_deadline_epoch_ms??void 0}}finally{try{await n.query(`COMMIT`)}finally{n.release()}}}async recordWorkflowOutput(e,t){let n=await this.pool.connect();try{await y(n,e,s.StatusString.SUCCESS,this.schemaName,{update:{output:t.output,resetDeduplicationID:!0}})}finally{n.release()}}async recordWorkflowError(e,t){let n=await this.pool.connect();try{await y(n,e,s.StatusString.ERROR,this.schemaName,{update:{error:t.error,resetDeduplicationID:!0}})}finally{n.release()}}async getPendingWorkflows(e,t){return(await this.pool.query(`SELECT workflow_uuid, queue_name
102
+ FROM "${this.schemaName}".workflow_status
103
+ WHERE status=$1 AND executor_id=$2 AND application_version=$3`,[s.StatusString.PENDING,e,t])).rows.map(e=>({workflowUUID:e.workflow_uuid,queueName:e.queue_name}))}async#e(e,t,n){await this.#a(e,t);let{rows:r}=await e.query(`SELECT output, error, child_workflow_id, function_name
104
+ FROM "${this.schemaName}".operation_outputs
105
+ WHERE workflow_uuid=$1 AND function_id=$2`,[t,n]);if(r.length!==0)return{output:r[0].output,error:r[0].error,childWorkflowID:r[0].child_workflow_id,functionName:r[0].function_name}}async getOperationResultAndThrowIfCancelled(e,t){let n=await this.pool.connect();try{return await this.#e(n,e,t)}finally{n.release()}}async getAllOperationResults(e){let{rows:t}=await this.pool.query(`SELECT * FROM "${this.schemaName}".operation_outputs WHERE workflow_uuid=$1`,[e]);return t}async recordOperationResult(e,t,n,r,i,a={}){let o=await this.pool.connect();try{await b(o,e,t,n,r,this.schemaName,i,a)}finally{o.release()}}async forkWorkflow(e,t,n={}){let r=n.newWorkflowID??(0,l.randomUUID)(),i=await this.getWorkflowStatus(e);if(i===null)throw new o.DBOSNonExistentWorkflowError(`Workflow ${e} does not exist`);if(!i.input)throw new o.DBOSNonExistentWorkflowError(`Workflow ${e} has no input`);let a=await this.pool.connect();try{await a.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);let o=Date.now();if(await _(a,{workflowUUID:r,status:s.StatusString.ENQUEUED,workflowName:i.workflowName,workflowClassName:i.workflowClassName,workflowConfigName:i.workflowConfigName,queueName:c.INTERNAL_QUEUE_NAME,authenticatedUser:i.authenticatedUser,assumedRole:i.assumedRole,authenticatedRoles:i.authenticatedRoles,output:null,error:null,request:i.request,executorId:c.globalParams.executorID,applicationVersion:n.applicationVersion??i.applicationVersion,applicationID:i.applicationID,createdAt:o,recoveryAttempts:0,updatedAt:o,timeoutMS:n.timeoutMS??i.timeoutMS,input:i.input,deduplicationID:void 0,priority:0,queuePartitionKey:void 0,forkedFrom:e},this.schemaName),t>0){let n=`INSERT INTO "${this.schemaName}".operation_outputs
106
+ (workflow_uuid, function_id, output, error, function_name, child_workflow_id )
107
+ SELECT $1 AS workflow_uuid, function_id, output, error, function_name, child_workflow_id
108
+ FROM "${this.schemaName}".operation_outputs
109
+ WHERE workflow_uuid = $2 AND function_id < $3`;await a.query(n,[r,e,t])}return await a.query(`COMMIT`),r}catch(e){throw await a.query(`ROLLBACK`),e}finally{a.release()}}async#t(e,t,n,r,i){let a=Date.now(),s=await this.#e(e,n,r);if(s!==void 0){if(s.functionName!==t)throw new o.DBOSUnexpectedStepError(n,r,t,s.functionName);return s.output}let c=await i();return await b(e,n,r,t,!0,this.schemaName,a,{output:c}),c}async durableSleepms(e,t,n){let r,i=new Promise(e=>{r=e}),a=this.cancelWakeupMap.registerCallback(e,r);try{let r=Promise.resolve(),{promise:a,cancel:o}=await this.#n(e,t,n);r=a;try{await Promise.race([i,r])}finally{o()}}finally{this.cancelWakeupMap.deregisterCallback(a)}await this.checkIfCanceled(e)}async#n(e,n,r,i){i===void 0&&(i=r);let a=Date.now(),s=a+r,l=await this.pool.connect();try{let r=await this.#e(l,e,n);if(r){if(r.functionName!==t.DBOS_FUNCNAME_SLEEP)throw new o.DBOSUnexpectedStepError(e,n,t.DBOS_FUNCNAME_SLEEP,r.functionName);s=JSON.parse(r.output)}else await b(l,e,n,t.DBOS_FUNCNAME_SLEEP,!1,this.schemaName,Date.now(),{output:JSON.stringify(s)});return{...(0,c.cancellableSleep)(Math.max(Math.min(i,s-a),0)),endTime:s}}finally{l.release()}}nullTopic=`__null__topic__`;async send(e,n,r,i,a){a??=this.nullTopic;let s=await this.pool.connect();try{await s.query(`BEGIN ISOLATION LEVEL READ COMMITTED`),await this.#t(s,t.DBOS_FUNCNAME_SEND,e,n,async()=>{await s.query(`INSERT INTO "${this.schemaName}".notifications (destination_uuid, topic, message) VALUES ($1, $2, $3);`,[r,a,i])}),await s.query(`COMMIT`)}catch(e){await s.query(`ROLLBACK`);let t=e;throw t.code===`23503`?new o.DBOSNonExistentWorkflowError(`Sent to non-existent destination workflow UUID: ${r}`):t}finally{s.release()}}async recv(e,n,r,a,s=i.DBOSExecutor.defaultNotificationTimeoutSec){a??=this.nullTopic;let l=Date.now(),u=await this.getOperationResultAndThrowIfCancelled(e,n);if(u){if(u.functionName!==t.DBOS_FUNCNAME_RECV)throw new o.DBOSUnexpectedStepError(e,n,t.DBOS_FUNCNAME_RECV,u.functionName);return u.output}let d=s===void 0?void 0:s*1e3,f=d===void 0?void 0:Date.now()+d;for(;;){let t,n=new Promise(e=>{t=e}),i=`${e}::${a}`,o=this.notificationsMap.registerCallback(i,t),s=this.cancelWakeupMap.registerCallback(e,e=>{t()});try{if(await this.checkIfCanceled(e),(await this.pool.query(`SELECT topic FROM "${this.schemaName}".notifications WHERE destination_uuid=$1 AND topic=$2;`,[e,a])).rows.length!==0)break;let t=Date.now();if(f&&t>f)break;let i=Promise.resolve(),o=()=>{};if(d){let{promise:t,cancel:n,endTime:a}=await this.#n(e,r,d,this.dbPollingIntervalEventMs);i=t,o=n,f=a}else{let e=f?f-t:this.dbPollingIntervalEventMs;e=Math.min(this.dbPollingIntervalEventMs,e);let{promise:n,cancel:r}=(0,c.cancellableSleep)(e);i=n,o=r}try{await Promise.race([n,i])}finally{o()}}finally{this.notificationsMap.deregisterCallback(o),this.cancelWakeupMap.deregisterCallback(s)}}await this.checkIfCanceled(e);let p=null,m=await this.pool.connect();try{await m.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);let r=(await m.query(`WITH oldest_entry AS (
110
+ SELECT destination_uuid, topic, message, created_at_epoch_ms
111
+ FROM "${this.schemaName}".notifications
112
+ WHERE destination_uuid = $1
113
+ AND topic = $2
114
+ ORDER BY created_at_epoch_ms ASC
115
+ LIMIT 1
116
+ )
117
+
118
+ DELETE FROM "${this.schemaName}".notifications
119
+ USING oldest_entry
120
+ WHERE notifications.destination_uuid = oldest_entry.destination_uuid
121
+ AND notifications.topic = oldest_entry.topic
122
+ AND notifications.created_at_epoch_ms = oldest_entry.created_at_epoch_ms
123
+ RETURNING notifications.*;`,[e,a])).rows;r.length>0&&(p=r[0].message),await b(m,e,n,t.DBOS_FUNCNAME_RECV,!0,this.schemaName,l,{output:p}),await m.query(`COMMIT`)}catch(e){throw this.logger.error(e),await m.query(`ROLLBACK`),e}finally{m.release()}return p}async setWorkflowStatus(e,t,n){let r=await this.pool.connect();try{await y(r,e,t,this.schemaName,{update:{resetRecoveryAttempts:n}})}finally{r.release()}}async setEvent(e,n,r,i){let a=await this.pool.connect();try{await a.query(`BEGIN ISOLATION LEVEL READ COMMITTED`),await this.#t(a,t.DBOS_FUNCNAME_SETEVENT,e,n,async()=>{await a.query(`INSERT INTO "${this.schemaName}".workflow_events (workflow_uuid, key, value)
124
+ VALUES ($1, $2, $3)
125
+ ON CONFLICT (workflow_uuid, key)
126
+ DO UPDATE SET value = $3
127
+ RETURNING workflow_uuid;`,[e,r,i])}),await a.query(`COMMIT`)}catch(e){throw this.logger.error(e),await a.query(`ROLLBACK`),e}finally{a.release()}}async getEvent(e,n,r,i){let a=Date.now();if(i){let e=await this.getOperationResultAndThrowIfCancelled(i.workflowID,i.functionID);if(e){if(e.functionName!==t.DBOS_FUNCNAME_GETEVENT)throw new o.DBOSUnexpectedStepError(i.workflowID,i.functionID,t.DBOS_FUNCNAME_GETEVENT,e.functionName);return e.output}}let s=null,l=`${e}::${n}`,u=r===void 0?void 0:r*1e3,d=u===void 0?void 0:Date.now()+u;for(;;){let t,r=new Promise(e=>{t=e}),a=this.workflowEventsMap.registerCallback(l,t),o=i?.workflowID?this.cancelWakeupMap.registerCallback(i.workflowID,e=>{t()}):void 0;try{i?.workflowID&&await this.checkIfCanceled(i?.workflowID);let t=(await this.pool.query(`SELECT key, value
128
+ FROM "${this.schemaName}".workflow_events
129
+ WHERE workflow_uuid=$1 AND key=$2;`,[e,n])).rows;if(t.length>0){s=t[0].value;break}let a=Date.now();if(d&&a>d)break;let o=Promise.resolve(),l=()=>{};if(i&&u){let{promise:e,cancel:t,endTime:n}=await this.#n(i.workflowID,i.timeoutFunctionID??-1,u,this.dbPollingIntervalEventMs);o=e,l=t,d=n}else{let e=d?d-a:this.dbPollingIntervalEventMs;e=Math.min(this.dbPollingIntervalEventMs,e);let{promise:t,cancel:n}=(0,c.cancellableSleep)(e);o=t,l=n}try{await Promise.race([r,o])}finally{l()}}finally{this.workflowEventsMap.deregisterCallback(a),o&&this.cancelWakeupMap.deregisterCallback(o)}}return i&&await this.recordOperationResult(i.workflowID,i.functionID,t.DBOS_FUNCNAME_GETEVENT,!0,a,{output:s}),s}#r(e){this.runningWorkflowMap.has(e)&&this.workflowCancellationMap.set(e,!0),this.cancelWakeupMap.callCallbacks(e)}#i(e){this.workflowCancellationMap.has(e)&&this.workflowCancellationMap.delete(e)}async cancelWorkflow(e){let t=await this.pool.connect();try{await t.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);let n=await v(t,e,this.schemaName);if(!n)throw new o.DBOSNonExistentWorkflowError(`Workflow ${e} does not exist`);if(n===s.StatusString.SUCCESS||n===s.StatusString.ERROR||n===s.StatusString.CANCELLED){await t.query(`ROLLBACK`);return}await y(t,e,s.StatusString.CANCELLED,this.schemaName,{update:{queueName:null,resetDeduplicationID:!0,resetStartedAtEpochMs:!0}}),await t.query(`COMMIT`)}catch(e){throw this.logger.error(e),await t.query(`ROLLBACK`),e}finally{t.release()}this.#r(e)}async#a(e,t){if(this.workflowCancellationMap.get(t)===!0||await v(e,t,this.schemaName)===s.StatusString.CANCELLED)throw new o.DBOSWorkflowCancelledError(t)}async checkIfCanceled(e){let t=await this.pool.connect();try{await this.#a(t,e)}finally{t.release()}}async resumeWorkflow(e){this.#i(e);let t=await this.pool.connect();try{await t.query(`BEGIN ISOLATION LEVEL REPEATABLE READ`);let n=await v(t,e,this.schemaName);if(!n||n===s.StatusString.SUCCESS||n===s.StatusString.ERROR){if(await t.query(`ROLLBACK`),!n&&n===void 0)throw new o.DBOSNonExistentWorkflowError(`Workflow ${e} does not exist`);return}await y(t,e,s.StatusString.ENQUEUED,this.schemaName,{update:{queueName:c.INTERNAL_QUEUE_NAME,resetRecoveryAttempts:!0,resetDeadline:!0,resetDeduplicationID:!0,resetStartedAtEpochMs:!0},throwOnFailure:!1}),await t.query(`COMMIT`)}catch(e){throw this.logger.error(e),await t.query(`ROLLBACK`),e}finally{t.release()}}registerRunningWorkflow(e,t){let n=t.catch(e=>{this.logger.debug(`Captured error in awaitWorkflowPromise: `+e)}).finally(()=>{this.runningWorkflowMap.delete(e),this.workflowCancellationMap.delete(e)});this.runningWorkflowMap.set(e,n)}async awaitRunningWorkflows(){this.runningWorkflowMap.size>0&&(this.logger.info(`Waiting for pending workflows to finish.`),await Promise.allSettled(this.runningWorkflowMap.values())),this.workflowEventsMap.map.size>0&&this.logger.warn(`Workflow events map is not empty - shutdown is not clean.`),this.notificationsMap.map.size>0&&this.logger.warn(`Message notification map is not empty - shutdown is not clean.`)}async getWorkflowStatus(e,n,r){let i=async()=>{let t=(await this.listWorkflows({workflowIDs:[e]})).find(t=>t.workflowUUID===e);return t?JSON.stringify(t):null};if(n&&r){let e=await this.pool.connect();try{return a(await this.#t(e,t.DBOS_FUNCNAME_GETSTATUS,n,r,i))}finally{e.release()}}else return a(await i());function a(e){return e?JSON.parse(e):null}}async awaitWorkflowResult(e,t,n,r){let i=t===void 0?void 0:t*1e3,a=i===void 0?void 0:Date.now()+i;for(;;){let t,o=new Promise(e=>{t=e}),l=this.cancelWakeupMap.registerCallback(e,e=>{t()}),u=n?this.cancelWakeupMap.registerCallback(n,e=>{t()}):void 0;try{n&&await this.checkIfCanceled(n);try{let{rows:t}=await this.pool.query(`SELECT status, output, error FROM "${this.schemaName}".workflow_status
130
+ WHERE workflow_uuid=$1`,[e]);if(t.length>0){let e=t[0].status;if(e===s.StatusString.SUCCESS)return{output:t[0].output};if(e===s.StatusString.ERROR)return{error:t[0].error};if(e===s.StatusString.CANCELLED)return{cancelled:!0}}}catch(e){let t=e;throw this.logger.error(`Exception from system database: ${t}`),t}let t=Date.now();if(a&&t>a)return;let l=Promise.resolve(),u=()=>{};if(r!==void 0&&n!==void 0&&i!==void 0){let{promise:e,cancel:t,endTime:o}=await this.#n(n,r,i,this.dbPollingIntervalResultMs);a=o,l=e,u=t}else{let e=a?a-t:this.dbPollingIntervalResultMs;e=Math.min(this.dbPollingIntervalResultMs,e);let{promise:n,cancel:r}=(0,c.cancellableSleep)(e);l=n,u=r}try{await Promise.race([o,l])}finally{u()}}finally{this.cancelWakeupMap.deregisterCallback(l),u&&this.cancelWakeupMap.deregisterCallback(u)}}}reconnectTimeout=null;async#o(){let e=async()=>{let t=()=>{this.reconnectTimeout||=setTimeout(async()=>{this.reconnectTimeout=null,await e()},1e3)},n=null;try{n=await this.pool.connect(),await n.query(`LISTEN dbos_notifications_channel;`),await n.query(`LISTEN dbos_workflow_events_channel;`),n.on(`notification`,e=>{this.shouldUseDBNotifications&&(e.channel===`dbos_notifications_channel`&&e.payload?this.notificationsMap.callCallbacks(e.payload):e.channel===`dbos_workflow_events_channel`&&e.payload&&this.workflowEventsMap.callCallbacks(e.payload))}),n.on(`error`,e=>{this.logger.warn(`Error in notifications client: ${e}`),n&&(n.removeAllListeners(),n.release(!0)),t()}),this.notificationsClient=n}catch(e){this.logger.warn(`Error in notifications listener: ${String(e)}`),n&&(n.removeAllListeners(),n.release(!0)),t()}};await e()}async getEventDispatchState(e,t,n){let r=await this.pool.query(`SELECT * FROM "${this.schemaName}".event_dispatch_kv
131
+ WHERE workflow_fn_name = $1 AND service_name = $2 AND key = $3;`,[t,e,n]);if(r.rows.length!==0)return{service:r.rows[0].service_name,workflowFnName:r.rows[0].workflow_fn_name,key:r.rows[0].key,value:r.rows[0].value,updateTime:r.rows[0].update_time,updateSeq:r.rows[0].update_seq!==null&&r.rows[0].update_seq!==void 0?BigInt(r.rows[0].update_seq):void 0}}async upsertEventDispatchState(e){let t=await this.pool.query(`INSERT INTO "${this.schemaName}".event_dispatch_kv (
132
+ service_name, workflow_fn_name, key, value, update_time, update_seq)
133
+ VALUES ($1, $2, $3, $4, $5, $6)
134
+ ON CONFLICT (service_name, workflow_fn_name, key)
135
+ DO UPDATE SET
136
+ update_time = GREATEST(EXCLUDED.update_time, event_dispatch_kv.update_time),
137
+ update_seq = GREATEST(EXCLUDED.update_seq, event_dispatch_kv.update_seq),
138
+ value = CASE WHEN (EXCLUDED.update_time > event_dispatch_kv.update_time
139
+ OR EXCLUDED.update_seq > event_dispatch_kv.update_seq
140
+ OR (event_dispatch_kv.update_time IS NULL and event_dispatch_kv.update_seq IS NULL)
141
+ ) THEN EXCLUDED.value ELSE event_dispatch_kv.value END
142
+ RETURNING value, update_time, update_seq;`,[e.service,e.workflowFnName,e.key,e.value,e.updateTime,e.updateSeq]);return{service:e.service,workflowFnName:e.workflowFnName,key:e.key,value:t.rows[0].value,updateTime:t.rows[0].update_time,updateSeq:t.rows[0].update_seq!==void 0&&t.rows[0].update_seq!==null?BigInt(t.rows[0].update_seq):void 0}}async listWorkflows(e){let t=this.schemaName,n=[`workflow_uuid`,`status`,`name`,`recovery_attempts`,`config_name`,`class_name`,`authenticated_user`,`authenticated_roles`,`assumed_role`,`queue_name`,`executor_id`,`created_at`,`updated_at`,`application_version`,`application_id`,`workflow_deadline_epoch_ms`,`workflow_timeout_ms`,`forked_from`];e.loadInput=e.loadInput??!0,e.loadOutput=e.loadOutput??!0,e.loadInput&&n.push(`inputs`,`request`),e.loadOutput&&n.push(`output`,`error`),e.sortDesc=e.sortDesc??!1;let r=[],i=[],a=1;if(e.queuesOnly&&(r.push(`queue_name IS NOT NULL`),r.push(`status IN ($${a}, $${a+1})`),i.push(s.StatusString.ENQUEUED,s.StatusString.PENDING),a+=2),e.workflowName&&(r.push(`name = $${a}`),i.push(e.workflowName),a++),e.queueName&&(r.push(`queue_name = $${a}`),i.push(e.queueName),a++),e.workflow_id_prefix&&(r.push(`workflow_uuid LIKE $${a}`),i.push(`${e.workflow_id_prefix}%`),a++),e.workflowIDs){let t=e.workflowIDs.map((e,t)=>`$${a+t}`).join(`, `);r.push(`workflow_uuid IN (${t})`),i.push(...e.workflowIDs),a+=e.workflowIDs.length}e.authenticatedUser&&(r.push(`authenticated_user = $${a}`),i.push(e.authenticatedUser),a++),e.forkedFrom&&(r.push(`forked_from = $${a}`),i.push(e.forkedFrom),a++),e.startTime&&(r.push(`created_at >= $${a}`),i.push(new Date(e.startTime).getTime()),a++),e.endTime&&(r.push(`created_at <= $${a}`),i.push(new Date(e.endTime).getTime()),a++),e.status&&(r.push(`status = $${a}`),i.push(e.status),a++),e.applicationVersion&&(r.push(`application_version = $${a}`),i.push(e.applicationVersion),a++);let o=r.length>0?`WHERE ${r.join(` AND `)}`:``,c=`ORDER BY created_at ${e.sortDesc?`DESC`:`ASC`}`,l=e.limit?`LIMIT ${e.limit}`:``,u=e.offset?`OFFSET ${e.offset}`:``,d=`
143
+ SELECT ${n.join(`, `)}
144
+ FROM "${t}".workflow_status
145
+ ${o}
146
+ ${c}
147
+ ${l}
148
+ ${u}
149
+ `;return(await this.pool.query(d,i)).rows.map(x)}async clearQueueAssignment(e){return((await this.pool.query(`UPDATE "${this.schemaName}".workflow_status
150
+ SET started_at_epoch_ms = NULL, status = $2
151
+ WHERE workflow_uuid = $1 AND queue_name is NOT NULL AND status = $3`,[e,s.StatusString.ENQUEUED,s.StatusString.PENDING])).rowCount??0)>0}async getDeduplicatedWorkflow(e,t){let{rows:n}=await this.pool.query(`SELECT workflow_uuid FROM "${this.schemaName}".workflow_status
152
+ WHERE queue_name = $1 AND deduplication_id = $2`,[e,t]);return n.length===0?null:n[0].workflow_uuid}async getQueuePartitions(e){let{rows:t}=await this.pool.query(`SELECT DISTINCT queue_partition_key FROM "${this.schemaName}".workflow_status
153
+ WHERE queue_name = $1
154
+ AND status = $2
155
+ AND queue_partition_key IS NOT NULL`,[e,s.StatusString.ENQUEUED]);return t.map(e=>e.queue_partition_key)}async findAndMarkStartableWorkflows(e,t,n,r){let i=Date.now(),a=e.rateLimit?e.rateLimit.periodSec*1e3:0,o=[],c=``,l=[];r===void 0?c=`AND queue_partition_key IS NULL`:(c=`AND queue_partition_key = $PARTITION`,l.push(r));let u=await this.pool.connect();try{await u.query(`BEGIN ISOLATION LEVEL REPEATABLE READ`);let r=0;if(e.rateLimit){let t=[e.name,s.StatusString.ENQUEUED,i-a,...l],n=await u.query(`SELECT COUNT(*) FROM "${this.schemaName}".workflow_status
156
+ WHERE queue_name = $1
157
+ AND status <> $2
158
+ AND started_at_epoch_ms > $3
159
+ ${c.replace(`$PARTITION`,`$4`)}`,t);if(r=Number(n.rows[0].count),r>=e.rateLimit.limitPerPeriod)return await u.query(`COMMIT`),o}let d=1/0;if(e.workerConcurrency!==void 0||e.concurrency!==void 0){let n=[e.name,s.StatusString.PENDING,...l],r=await u.query(`SELECT executor_id, COUNT(*) as task_count
160
+ FROM "${this.schemaName}".workflow_status
161
+ WHERE queue_name = $1 AND status = $2
162
+ ${c.replace(`$PARTITION`,`$3`)}
163
+ GROUP BY executor_id`,n),i={};r.rows.forEach(e=>{i[e.executor_id]=Number(e.task_count)});let a=i[t]||0;if(e.workerConcurrency!==void 0&&(d=Math.max(0,e.workerConcurrency-a)),e.concurrency!==void 0){let t=Object.values(i).reduce((e,t)=>e+t,0);t>e.concurrency&&this.logger.warn(`Total running tasks (${t}) exceeds the global concurrency limit (${e.concurrency})`);let n=Math.max(0,e.concurrency-t);d=Math.min(d,n)}}if(d<=0)return await u.query(`COMMIT`),o;let f=e.concurrency?`FOR UPDATE NOWAIT`:`FOR UPDATE SKIP LOCKED`,p=e.priorityEnabled?`ORDER BY priority ASC, created_at ASC`:`ORDER BY created_at ASC`,m=d===1/0?``:`LIMIT ${d}`,h=[s.StatusString.ENQUEUED,e.name,n,...l],g=`
164
+ SELECT workflow_uuid
165
+ FROM "${this.schemaName}".workflow_status
166
+ WHERE status = $1
167
+ AND queue_name = $2
168
+ AND (application_version IS NULL OR application_version = $3)
169
+ ${c.replace(`$PARTITION`,`$4`)}
170
+ ${p}
171
+ ${m}
172
+ ${f}
173
+ `,{rows:_}=await u.query(g,h),v=_.map(e=>e.workflow_uuid);for(let a of v){if(e.rateLimit&&o.length+r>=e.rateLimit.limitPerPeriod)break;await u.query(`UPDATE "${this.schemaName}".workflow_status
174
+ SET status = $1,
175
+ executor_id = $2,
176
+ application_version = $3,
177
+ started_at_epoch_ms = $4,
178
+ workflow_deadline_epoch_ms = CASE
179
+ WHEN workflow_timeout_ms IS NOT NULL AND workflow_deadline_epoch_ms IS NULL
180
+ THEN (EXTRACT(epoch FROM now()) * 1000)::bigint + workflow_timeout_ms
181
+ ELSE workflow_deadline_epoch_ms
182
+ END
183
+ WHERE workflow_uuid = $5`,[s.StatusString.PENDING,t,n,i,a]),o.push(a)}await u.query(`COMMIT`)}catch(e){throw await u.query(`ROLLBACK`),e}finally{u.release()}return o}async writeStreamFromStep(e,t,n){let r=await this.pool.connect();try{await r.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);let i=(await r.query(`SELECT MAX("offset") FROM "${this.schemaName}".streams
184
+ WHERE workflow_uuid = $1 AND key = $2`,[e,t])).rows[0].max,a=i===null?0:i+1,o=JSON.stringify(n);await r.query(`INSERT INTO "${this.schemaName}".streams (workflow_uuid, key, value, "offset")
185
+ VALUES ($1, $2, $3, $4)`,[e,t,o,a]),await r.query(`COMMIT`)}catch(e){throw this.logger.error(e),await r.query(`ROLLBACK`),e}finally{r.release()}}async writeStreamFromWorkflow(e,n,r,i){let a=await this.pool.connect();try{await a.query(`BEGIN ISOLATION LEVEL READ COMMITTED`);let o=i===t.DBOS_STREAM_CLOSED_SENTINEL?t.DBOS_FUNCNAME_CLOSESTREAM:t.DBOS_FUNCNAME_WRITESTREAM;await this.#t(a,o,e,n,async()=>{let t=(await a.query(`SELECT MAX("offset") FROM "${this.schemaName}".streams
186
+ WHERE workflow_uuid = $1 AND key = $2`,[e,r])).rows[0].max,n=t===null?0:t+1,o=JSON.stringify(i);await a.query(`INSERT INTO "${this.schemaName}".streams (workflow_uuid, key, value, "offset")
187
+ VALUES ($1, $2, $3, $4)`,[e,r,o,n])}),await a.query(`COMMIT`)}catch(e){throw this.logger.error(e),await a.query(`ROLLBACK`),e}finally{a.release()}}async closeStream(e,n,r){await this.writeStreamFromWorkflow(e,n,r,t.DBOS_STREAM_CLOSED_SENTINEL)}async readStream(e,t,n){let r=await this.pool.connect();try{let i=await r.query(`SELECT value FROM "${this.schemaName}".streams
188
+ WHERE workflow_uuid = $1 AND key = $2 AND "offset" = $3`,[e,t,n]);if(i.rows.length===0)throw Error(`No value found for workflow_uuid=${e}, key=${t}, offset=${n}`);let a=i.rows[0];return JSON.parse(a.value)}finally{r.release()}}async garbageCollect(e,t){if(t!==void 0){let n=await this.pool.query(`SELECT created_at
189
+ FROM "${this.schemaName}".workflow_status
190
+ ORDER BY created_at DESC
191
+ LIMIT 1 OFFSET $1`,[t-1]);if(n.rows.length>0){let t=n.rows[0].created_at;(e===void 0||t>e)&&(e=t)}}e!==void 0&&await this.pool.query(`DELETE FROM "${this.schemaName}".workflow_status
192
+ WHERE created_at < $1
193
+ AND status NOT IN ($2, $3)`,[e,s.StatusString.PENDING,s.StatusString.ENQUEUED])}};t.PostgresSystemDatabase=k,n([O(),r(`design:type`,Function),r(`design:paramtypes`,[Object,Number]),r(`design:returntype`,Promise)],k.prototype,`initWorkflowStatus`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Object]),r(`design:returntype`,Promise)],k.prototype,`recordWorkflowOutput`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Object]),r(`design:returntype`,Promise)],k.prototype,`recordWorkflowError`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number]),r(`design:returntype`,Promise)],k.prototype,`getOperationResultAndThrowIfCancelled`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,String,Boolean,Number,Object]),r(`design:returntype`,Promise)],k.prototype,`recordOperationResult`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,Number]),r(`design:returntype`,Promise)],k.prototype,`durableSleepms`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,String,Object,String]),r(`design:returntype`,Promise)],k.prototype,`send`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,Number,String,Number]),r(`design:returntype`,Promise)],k.prototype,`recv`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,String,Object]),r(`design:returntype`,Promise)],k.prototype,`setEvent`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,String,Number,Object]),r(`design:returntype`,Promise)],k.prototype,`getEvent`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String]),r(`design:returntype`,Promise)],k.prototype,`checkIfCanceled`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,String,Number]),r(`design:returntype`,Promise)],k.prototype,`getWorkflowStatus`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,String,Number]),r(`design:returntype`,Promise)],k.prototype,`awaitWorkflowResult`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,String,String]),r(`design:returntype`,Promise)],k.prototype,`getEventDispatchState`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[Object]),r(`design:returntype`,Promise)],k.prototype,`upsertEventDispatchState`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,String]),r(`design:returntype`,Promise)],k.prototype,`getDeduplicatedWorkflow`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String]),r(`design:returntype`,Promise)],k.prototype,`getQueuePartitions`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,String,Object]),r(`design:returntype`,Promise)],k.prototype,`writeStreamFromStep`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,Number,String,Object]),r(`design:returntype`,Promise)],k.prototype,`writeStreamFromWorkflow`,null),n([O(),r(`design:type`,Function),r(`design:paramtypes`,[String,String,Number]),r(`design:returntype`,Promise)],k.prototype,`readStream`,null)})),Ab=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ArgName=e.getRegistrationsForExternal=e.associateParameterWithExternal=e.associateMethodWithExternal=e.associateClassWithExternal=e.getTransactionalDataSource=e.registerTransactionalDataSource=e.transactionalDataSources=e.getConfiguredInstance=e.getOrCreateClassRegistration=e.getClassRegistrationByName=e.getAllRegisteredFunctions=e.getAllRegisteredClassNames=e.getNameForClass=e.wrapDBOSFunctionAndRegister=e.wrapDBOSFunctionAndRegisterDec=e.wrapDBOSFunctionAndRegisterByUniqueName=e.wrapDBOSFunctionAndRegisterByUniqueNameDec=e.getOrCreateMethodArgsRegistration=e.getRegisteredFunctionsByClassname=e.getRegisteredOperations=e.getFunctionRegistrationByName=e.getFunctionRegistration=e.registerFunctionWrapper=e.getRegisteredFunctionName=e.getRegisteredFunctionClassName=e.getRegisteredFunctionQualifiedName=e.getRegisteredFunctionFullName=e.insertAllMiddleware=e.registerMiddlewareInstaller=e.getLifecycleListeners=e.registerLifecycleCallback=e.ensureDBOSIsLaunched=e.ensureDBOSIsNotLaunched=e.recordDBOSShutdown=e.recordDBOSLaunch=e.ClassRegistration=e.ConfiguredInstance=e.MethodRegistration=e.DBOS_AUTH=e.MethodParameter=e.DBOSDataType=void 0;let t=ny();var n=class e{dataType=`text`;length=-1;precision=-1;scale=-1;static varchar(t){let n=new e;return n.dataType=`varchar`,n.length=t,n}static decimal(t,n){let r=new e;return r.dataType=`decimal`,r.precision=t,r.scale=n,r}static fromArg(t){if(!t)return;let n=new e;return t===String?n.dataType=`text`:t===Date?n.dataType=`timestamp`:t===Number?n.dataType=`double`:t===Boolean?n.dataType=`boolean`:n.dataType=`json`,n}formatAsString(){let e=this.dataType;return this.dataType===`varchar`&&this.length>0&&(e+=`(${this.length})`),this.dataType===`decimal`&&this.precision>0&&(this.scale>0?e+=`(${this.precision},${this.scale})`:e+=`(${this.precision})`),e}};e.DBOSDataType=n;function r(e){let t=e.toString(),n=[],r=``,i=0,a=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=t.indexOf(`(`);if(d===-1)return[];let f=t.substring(d+1);for(let e=0;e<f.length;e++){let t=f[e],d=f[e+1];if(l){t===`*`&&d===`/`&&(l=!1,e++);continue}else if(c){t===`
194
+ `&&(c=!1);continue}else if(t===`/`&&d===`*`){l=!0,e++;continue}else if(t===`/`&&d===`/`){c=!0;continue}if(!(c||l)&&(t===`'`&&!o&&!s?a=!a:t===`"`&&!a&&!s?o=!o:t==="`"&&!a&&!o&&(s=!s),!(a||o||s))){if(t===`=`&&i===0){u=!0;continue}if((t===`(`||t===`{`||t===`[`)&&i++,t===`)`||t===`}`||t===`]`){if(i===0)break;i--}if(t===`.`&&d===`.`&&f[e+2]===`.`){e+=2;continue}if(t===`,`&&i===0){r.trim()&&n.push(r.trim()),r=``,u=!1;continue}u||(r+=t)}}return r.trim()&&r.trim()&&n.push(r.trim()),n}var i=class{name=``;index=-1;externalRegInfo=new Map;getRegisteredInfo(e){return this.externalRegInfo.has(e)||this.externalRegInfo.set(e,{}),this.externalRegInfo.get(e)}get dataType(){return this.getRegisteredInfo(`type`).dataType}initializeBaseType(e){this.externalRegInfo.has(`type`)||this.externalRegInfo.set(`type`,{});let t=this.externalRegInfo.get(`type`);t.dataType=n.fromArg(e)}constructor(e,t){this.index=e,this.initializeBaseType(t)}};e.MethodParameter=i,e.DBOS_AUTH=`auth`;var a=class{defaults;name=``;className=``;onEnter=[];addEntryInterceptor(e,t=10){this.onEnter.push({seqNum:t,func:e}),this.onEnter.sort((e,t)=>e.seqNum-t.seqNum)}args=[];constructor(e,t){this.origFunction=e,this.isInstance=t}needInitialized=!0;isInstance;origFunction;registeredFunction;wrappedFunction=void 0;workflowConfig;stepConfig;regLocation;externalRegInfo=new Map;getRegisteredInfo(e){return this.externalRegInfo.has(e)||this.externalRegInfo.set(e,{}),this.externalRegInfo.get(e)}getAssignedType(){if(this.workflowConfig)return`Workflow`;if(this.stepConfig)return`Step`}checkFuncTypeUnassigned(e){let n=this.getAssignedType(),r;if(n&&e!==n?r=`Operation (Name: ${this.className}.${this.name}) is already registered with a conflicting function type: ${n} vs. ${e}`:n&&(r=`Operation (Name: ${this.className}.${this.name}) is already registered.`),r)throw this.regLocation&&(r+=`\nPrior registration occurred at:\n${this.regLocation.join(`
195
+ `)}`),new t.DBOSConflictingRegistrationError(`${r}`);this.regLocation=new s().getCleanStack(3)}setStepConfig(e){this.checkFuncTypeUnassigned(`Step`),this.stepConfig=e}setWorkflowConfig(e){this.checkFuncTypeUnassigned(`Workflow`),this.workflowConfig=e}init=!1;invoke(e,t){return(this.wrappedFunction??this.registeredFunction??this.origFunction).call(e,...t)}getRequiredRoles(){let t=this.getRegisteredInfo(e.DBOS_AUTH);return t?.requiredRole?t.requiredRole:this.defaults?.getRegisteredInfo(e.DBOS_AUTH)?.requiredRole||[]}};e.MethodRegistration=a,e.ConfiguredInstance=class{name;constructor(e){c&&console.warn(`ConfiguredInstance '${e}' is being created after DBOS initialization and was not available for recovery.`),this.name=e,x(this,e)}initialize(){return Promise.resolve()}};var o=class{name=``;needsInitialized=!0;ormEntities=[];registeredOperationsByName=new Map;allRegisteredOperations=new Map;configuredInstances=new Map;configuredInstanceRegLocs=new Map;externalRegInfo=new Map;registerOperationByName(e,n){let r=this.registeredOperationsByName.get(e);if(r&&r!==n){let n=`Operation (Name: ${this.name}.${e}) is already registered.`;throw r.regLocation&&(n+=`\nPrior registration occurred at:\n${r.regLocation.join(`
196
+ `)}`),new t.DBOSConflictingRegistrationError(`${n}`)}this.registeredOperationsByName.set(e,n),n.regLocation=new s().getCleanStack(3)}getRegisteredInfo(e){return this.externalRegInfo.has(e)||this.externalRegInfo.set(e,{}),this.externalRegInfo.get(e)}constructor(){}};e.ClassRegistration=o;var s=class e extends Error{constructor(){super(`StackGrabber`),Error.captureStackTrace(this,e)}getCleanStack(e=1){return this.stack?.split(`
197
+ `).slice(e+1).map(e=>`>>> `+e.replace(/^\s*at\s*/,``))}};let c;function l(){c=new s().getCleanStack(2)}e.recordDBOSLaunch=l;function u(){c=void 0}e.recordDBOSShutdown=u;function d(){if(c)throw new t.DBOSConflictingRegistrationError(`DBOS code is being registered after DBOS.launch(). DBOS was launched from:\n${c.join(`
198
+ `)}\n`)}e.ensureDBOSIsNotLaunched=d;function f(e){if(!c)throw TypeError(`\`DBOS.launch()\` must be called before running ${e}.`)}e.ensureDBOSIsLaunched=f;let p=[];function m(e){p.includes(e)||p.push(e)}e.registerLifecycleCallback=m;function h(){return p}e.getLifecycleListeners=h;let g=!1,_=[];function v(e){if(g)throw TypeError(`Attempt to provide method middleware after insertion was performed`);_.includes(e)||_.push(e)}e.registerMiddlewareInstaller=v;function y(){if(!g){g=!0;for(let[e,t]of se)for(let e of t.reg.allRegisteredOperations.values())for(let t of _)t.installMiddleware(e)}}e.insertAllMiddleware=y;let b=new Map;function x(e,n){let r=pe(e.constructor);if(r.configuredInstances.has(n))throw new t.DBOSConflictingRegistrationError(`An instance of class '${e.constructor.name}' with name '${n}' was already registered. Earlier registration occurred at:\n${(r.configuredInstanceRegLocs.get(n)??[]).join(`
199
+ `)}`);r.configuredInstances.set(n,e),r.configuredInstanceRegLocs.set(n,new s().getCleanStack(3)??[])}function S(e){let t=``,n=e.name??``;if(b.has(e)){let r=b.get(e);t=r.className,n=r.name}return{className:t,name:n}}e.getRegisteredFunctionFullName=S;function C(e){let t=S(e);return t.className+`.`+t.name}e.getRegisteredFunctionQualifiedName=C;function w(e){return S(e).className}e.getRegisteredFunctionClassName=w;function T(e){return S(e).name}e.getRegisteredFunctionName=T;function E(e,t){t.wrappedFunction=e,b.set(e,t)}e.registerFunctionWrapper=E;function ee(e){return b.get(e)}e.getFunctionRegistration=ee;function te(e,t){let n=fe(e,!1);if(!n)return;let r=n.registeredOperationsByName.get(t);if(r)return r}e.getFunctionRegistrationByName=te;function D(e){let t=[];if(typeof e==`function`)se.get(e.name)?.reg?.allRegisteredOperations?.forEach(e=>t.push(e));else{let n=e;for(;n;){let e=n.constructor.name;se.has(e)&&t.push(...D(n.constructor)),n=Object.getPrototypeOf(n)}}return t}e.getRegisteredOperations=D;function ne(e){let t=[];return fe(e)?.allRegisteredOperations?.forEach(e=>t.push(e)),t}e.getRegisteredFunctionsByClassname=ne;let O=new Map;function k(e,t,n){let a=e;a&&typeof a!=`function`&&(a=a.constructor),n||=Object.getOwnPropertyDescriptor(e,t).value;let o=O.get(n);if(o===void 0){let a;if(e){function n(e,t){let n=Reflect?.getMetadata;if(n)return n(`design:paramtypes`,e,t)}a=n(e,t)}o=a?a.map((e,t)=>new i(t,e)):n?r(n).map((e,t)=>new i(t)):r(Object.getOwnPropertyDescriptor(e,t)?.value).map((e,t)=>new i(t)),O.set(n,o)}return o}e.getOrCreateMethodArgsRegistration=k;function re(e,t,n,i){let o,s;({classReg:o,isInstance:s,className:t}=me(e,t));let c=n.toString(),l=b.get(i)?.origFunction??i;if(!o.allRegisteredOperations.has(l)){let e=new a(i,s);o.allRegisteredOperations.set(i,e)}let u=o.allRegisteredOperations.get(i);if(u.needInitialized){u.needInitialized=!1,u.name=c,u.className=o.name,u.defaults=o,u.args=k(e,n,i);let t=r(i);u.args.forEach(e=>{e.name||e.index<t.length&&(e.name=t[e.index])});let a=async function(...e){let t=e;for(let e of u.onEnter)t=e.func(u,t);return u.origFunction.call(this,...t)};Object.defineProperty(a,`name`,{value:u.name}),u.registeredFunction=a,b.set(u.registeredFunction,u),b.set(u.origFunction,u)}return u}function A(e,t,n){if(!n.value)throw Error(`Use of decorator when original method is undefined`);let r=ie(e,void 0,t,n.value);return n.value=r.wrappedFunction??r.registeredFunction,{descriptor:n,registration:r}}e.wrapDBOSFunctionAndRegisterByUniqueNameDec=A;function ie(e,t,n,r){d();let i=typeof n==`string`?n:n.toString(),a=ee(r);if(a)return me(e,t).classReg.registerOperationByName(i,a),a;let o=re(e,t,n,r);return me(e,t).classReg.registerOperationByName(i,o),o}e.wrapDBOSFunctionAndRegisterByUniqueName=ie;function ae(e,t,n){if(!n.value)throw Error(`Use of decorator when original method is undefined`);let r=oe(e,void 0,t,n.value);return n.value=r.wrappedFunction??r.registeredFunction,{descriptor:n,registration:r}}e.wrapDBOSFunctionAndRegisterDec=ae;function oe(e,t,n,r){return d(),ee(r)||re(e,t,n,r)}e.wrapDBOSFunctionAndRegister=oe;let se=new Map,ce=new Map;function le(e){let t;return t=typeof e==`function`?e:e.constructor,ce.has(t)?ce.get(t).name:t.name}e.getNameForClass=le;function ue(){let e=[];for(let[t,n]of se)e.push(t);return e}e.getAllRegisteredClassNames=ue;function de(){let e=new Set,t=[];for(let[n,r]of b)e.has(r)||(t.push(r),e.add(r));return t}e.getAllRegisteredFunctions=de;function fe(e,n=!1){if(!se.has(e)&&!n)throw new t.DBOSNotRegisteredError(e,`Class '${e}' is not registered`);se.has(e)||se.set(e,{reg:new o});let r=se.get(e).reg;return r.needsInitialized&&=(r.name=e,!1),r}e.getClassRegistrationByName=fe;function pe(e){let t=le(e);se.has(t)||se.set(t,{ctor:e,reg:new o});let n=se.get(t).reg;return n.needsInitialized&&=(n.name=t,!1),n}e.getOrCreateClassRegistration=pe;function me(e,t){let n,r=!1;return e&&(typeof e==`function`?n=e:(n=e.constructor,r=!0)),t||n&&(t=n.name),t||=``,{classReg:fe(t,!0),isInstance:r,className:t}}function he(e,t){let n=se.get(e)?.reg;return n?n.configuredInstances.get(t)??null:null}e.getConfiguredInstance=he,e.transactionalDataSources=new Map;function ge(n,r){if(e.transactionalDataSources.has(n)){if(e.transactionalDataSources.get(n)!==r)throw new t.DBOSConflictingRegistrationError(`Data source with name ${n} is already registered`);return}d(),e.transactionalDataSources.set(n,r)}e.registerTransactionalDataSource=ge;function _e(n){if(e.transactionalDataSources.has(n))return e.transactionalDataSources.get(n);throw new t.DBOSNotRegisteredError(n,`Data source '${n}' is not registered`)}e.getTransactionalDataSource=_e;function ve(e,t){return fe(typeof t==`string`?t:le(t),!0).getRegisteredInfo(e)}e.associateClassWithExternal=ve;function j(e,t,n,r,i){let a=oe(t,n,r,i);return a.externalRegInfo.has(e)||a.externalRegInfo.set(e,{}),{registration:a,regInfo:a.externalRegInfo.get(e)}}e.associateMethodWithExternal=j;function ye(e,t,n,r,i,a){i||=Object.getOwnPropertyDescriptor(t,r).value;let o=oe(t,n,r,i),s;if(s=typeof a==`number`?o.args[a]:o.args.find(e=>e.name===a),s)return s.externalRegInfo.has(e)||s.externalRegInfo.set(e,{}),s.externalRegInfo.get(e)}e.associateParameterWithExternal=ye;function be(e,t,n){let r=[];if(t){let e=typeof t==`string`?t:le(t),r=se.get(e);if(r)if(n){let e=r.reg.registeredOperationsByName.get(n);e&&a(e)}else i(r)}else for(let[e,t]of se)i(t);return r;function i(e){for(let t of e.reg.allRegisteredOperations.values())a(t)}function a(t){let n=t.externalRegInfo.get(e),i=t.defaults?.externalRegInfo.get(e),a=[],o=!1;for(let n of t.args)n.externalRegInfo.has(e)&&(o=!0),a.push({name:n.name,index:n.index,paramConfig:n.externalRegInfo.get(e)});!n&&!i&&!o||r.push({methodReg:t,methodConfig:n,classConfig:i??{},paramConfig:a})}}e.getRegistrationsForExternal=be;function M(e){return function(t,n,r){let i=k(t,n)[r];i.name=e}}e.ArgName=M})),jb=r(((e,t)=>{var n=class e extends Error{constructor(t){super(e._prepareSuperMessage(t)),Object.defineProperty(this,`name`,{value:`NonError`,configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,e)}static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{return String(e)}}};let r=[{property:`name`,enumerable:!1},{property:`message`,enumerable:!1},{property:`stack`,enumerable:!1},{property:`code`,enumerable:!0}],i=Symbol(`.toJSON called`),a=e=>{e[i]=!0;let t=e.toJSON();return delete e[i],t},o=({from:e,seen:t,to_:n,forceEnumerable:s,maxDepth:c,depth:l})=>{let u=n||(Array.isArray(e)?[]:{});if(t.push(e),l>=c)return u;if(typeof e.toJSON==`function`&&e[i]!==!0)return a(e);for(let[n,r]of Object.entries(e)){if(typeof Buffer==`function`&&Buffer.isBuffer(r)){u[n]=`[object Buffer]`;continue}if(typeof r!=`function`){if(!r||typeof r!=`object`){u[n]=r;continue}if(!t.includes(e[n])){l++,u[n]=o({from:e[n],seen:t.slice(),forceEnumerable:s,maxDepth:c,depth:l});continue}u[n]=`[Circular]`}}for(let{property:t,enumerable:n}of r)typeof e[t]==`string`&&Object.defineProperty(u,t,{value:e[t],enumerable:s?!0:n,configurable:!0,writable:!0});return u};t.exports={serializeError:(e,t={})=>{let{maxDepth:n=1/0}=t;return typeof e==`object`&&e?o({from:e,seen:[],forceEnumerable:!0,maxDepth:n,depth:0}):typeof e==`function`?`[Function: ${e.name||`anonymous`}]`:e},deserializeError:(e,t={})=>{let{maxDepth:r=1/0}=t;if(e instanceof Error)return e;if(typeof e==`object`&&e&&!Array.isArray(e)){let t=Error();return o({from:e,seen:[],to_:t,maxDepth:r,depth:0}),t}return new n(e)}}})),Mb=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEBUG_TRIGGER_WORKFLOW_ENQUEUE=e.DEBUG_TRIGGER_WORKFLOW_QUEUE_START=e.clearDebugTriggers=e.setDebugTrigger=e.debugTriggerPoint=e.pointLocations=e.pointTriggers=e.DebugAction=e.getCallSiteInfo=void 0;let t=gy();function n(){let e=Error().stack?.split(`
200
+ `);if(e&&e.length>2){let t=e[2].match(/at\s+(.*):(\d+):(\d+)/);if(t)return{fileName:t[1],lineNumber:parseInt(t[2],10)}}return{fileName:`unknown`,lineNumber:-1}}e.getCallSiteInfo=n,e.DebugAction=class{sleepms;awaitEvent;callback;asyncCallback},e.pointTriggers=new Map,e.pointLocations=new Map;async function r(r){let i=n();e.pointLocations.has(r)||e.pointLocations.set(r,{name:r,...i,hitCount:0});let a=e.pointLocations.get(r);if(a.fileName!==i.fileName||i.lineNumber!==a.lineNumber)throw Error(`Duplicate debug point name: ${r}`);if(e.pointTriggers.has(r)){let n=e.pointTriggers.get(r);n.sleepms&&await(0,t.sleepms)(n.sleepms),n.asyncCallback&&await n.asyncCallback(),n.callback&&n.callback(),n.awaitEvent&&await n.awaitEvent}}e.debugTriggerPoint=r;function i(t,n){e.pointTriggers.set(t,n)}e.setDebugTrigger=i;function a(){e.pointTriggers.clear()}e.clearDebugTriggers=a,e.DEBUG_TRIGGER_WORKFLOW_QUEUE_START=`DEBUG_TRIGGER_WORKFLOW_QUEUE_START`,e.DEBUG_TRIGGER_WORKFLOW_ENQUEUE=`DEBUG_TRIGGER_WORKFLOW_ENQUEUE`})),Nb=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.wfQueueRunner=e.WorkflowQueue=void 0;let t=xS(),n=Mb(),r=gy();e.WorkflowQueue=class{name;concurrency;rateLimit;workerConcurrency;priorityEnabled=!1;partitionQueue=!1;constructor(n,r,i){if(this.name=n,t.DBOS.isInitialized()&&t.DBOS.logger.warn(`Workflow queue '${n}' is being created after DBOS initialization and will not be considered for dequeue.`),typeof r==`object`&&r?(this.concurrency=r.concurrency,this.rateLimit=r.rateLimit,this.workerConcurrency=r.workerConcurrency,this.priorityEnabled=r.priorityEnabled??!1,this.partitionQueue=r.partitionQueue??!1):(this.concurrency=r,this.rateLimit=i),e.wfQueueRunner.wfQueuesByName.has(n))throw Error(`Workflow Queue '${n}' defined multiple times`);e.wfQueueRunner.wfQueuesByName.set(n,this)}},e.wfQueueRunner=new class{wfQueuesByName=new Map;isRunning=!1;interruptResolve;pollingIntervalMs=1e3;minPollingIntervalMs=1e3;maxPollingIntervalMs=12e4;stop(){this.isRunning&&(this.isRunning=!1,this.interruptResolve&&this.interruptResolve())}async dispatchLoop(e){for(this.isRunning=!0;this.isRunning;){let t,i=new Promise(e=>{t=setTimeout(()=>{e()},this.pollingIntervalMs)});if(await Promise.race([i,new Promise((e,t)=>this.interruptResolve=t)]).catch(()=>{e.logger.debug(`Workflow queue loop interrupted!`)}),clearTimeout(t),!this.isRunning)break;for(let[t,i]of this.wfQueuesByName){let t=[];try{if(i.partitionQueue){let n=await e.systemDatabase.getQueuePartitions(i.name);for(let a of n){let n=await e.systemDatabase.findAndMarkStartableWorkflows(i,e.executorID,r.globalParams.appVersion,a);t.push(...n)}}else t=await e.systemDatabase.findAndMarkStartableWorkflows(i,e.executorID,r.globalParams.appVersion,void 0)}catch(n){let r=n;`code`in r&&(r.code===`40001`||r.code===`55P03`)?(this.pollingIntervalMs=Math.min(this.maxPollingIntervalMs,this.pollingIntervalMs*2),e.logger.warn(`Contention detected in queue thread for ${i.name}. Increasing polling interval to ${(this.pollingIntervalMs/1e3).toFixed(2)}s.`)):e.logger.warn(`Error getting startable workflows: ${r.message}`),t=[]}t.length>0&&await(0,n.debugTriggerPoint)(n.DEBUG_TRIGGER_WORKFLOW_QUEUE_START);for(let n of t)try{await e.executeWorkflowUUID(n)}catch(t){e.logger.warn(`Could not execute workflow with id ${n}: ${t.message}`)}}this.pollingIntervalMs=Math.max(this.minPollingIntervalMs,this.pollingIntervalMs*.9)}}logRegisteredEndpoints(e){let t=e.logger;t.info(`Workflow queues:`);for(let[e,n]of this.wfQueuesByName){let r=n.concurrency===void 0?`No concurrency limit set`:`global concurrency limit: ${n.concurrency}`;t.info(` ${e}: ${r}`);let i=n.workerConcurrency===void 0?`No worker concurrency limit set`:`worker concurrency limit: ${n.workerConcurrency}`;t.info(` ${e}: ${i}`)}}}})),Pb=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.TimeMatcher=e.convertExpression=e.validateCrontab=e.convertAsterisksToRanges=void 0;function t(e){return e.replace(/\s{2,}/g,` `).trim()}function n(e){return e.length===5?[`0`].concat(e):e}let r=[`january`,`february`,`march`,`april`,`may`,`june`,`july`,`august`,`september`,`october`,`november`,`december`],i=[`jan`,`feb`,`mar`,`apr`,`may`,`jun`,`jul`,`aug`,`sep`,`oct`,`nov`,`dec`];function a(e,t){for(let n=0;n<t.length;n++)e=e.replace(new RegExp(t[n],`gi`),`${n+1}`);return e}function o(e){return e=a(e,r),e=a(e,i),e}let s=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`],c=[`sun`,`mon`,`tue`,`wed`,`thu`,`fri`,`sat`];function l(e,t){for(let n=0;n<t.length;n++)e=e.replace(new RegExp(t[n],`gi`),`${n}`);return e}function u(e){return e=e.replace(`7`,`0`),e=l(e,s),l(e,c)}function d(e,t){return e.indexOf(`*`)===-1?e:e.replace(`*`,t)}function f(e){return e[0]=d(e[0],`0-59`),e[1]=d(e[1],`0-59`),e[2]=d(e[2],`0-23`),e[3]=d(e[3],`1-31`),e[4]=d(e[4],`1-12`),e[5]=d(e[5],`0-6`),e}e.convertAsterisksToRanges=f;function p(e,t,n,r){let i=[],a=parseInt(r),o=parseInt(n);o>a&&(a=parseInt(n),o=parseInt(r));for(let e=o;e<=a;e++)i.push(e.toString());return e.replace(new RegExp(t,`i`),i.join())}function m(e){let t=/(\d+)-(\d+)/,n=t.exec(e);for(;n!==null&&n.length>0;)e=p(e,n[0],n[1],n[2]),n=t.exec(e);return e}function h(e){for(let t=0;t<e.length;t++)e[t]=m(e[t]);return e}function g(e){let t=/^(.+)\/(\w+)$/;for(let n=0;n<e.length;n++){let r=t.exec(e[n]);if(r!==null&&r.length>0){let t=r[2];if(isNaN(parseInt(t)))throw Error(t+` is not a valid step value`);let i=r[1].split(`,`),a=[],o=parseInt(t,10);for(let e=0;e<=i.length;e++){let t=parseInt(i[e],10);t%o===0&&a.push(`${t}`)}e[n]=a.join(`,`)}}return e}function _(e){for(let t=0;t<e.length;t++){let n=e[t].split(`,`);for(let e=0;e<n.length;e++)n[e]=parseInt(n[e]).toString();e[t]=n.join(`,`)}return e}let v=/^(?:\d+|\*|\*\/\d+)$/;function y(e,t,n){let r=e.split(`,`);for(let e of r){let r=parseInt(e,10);if(!Number.isNaN(r)&&(r<t||r>n)||!v.test(e))return!1}return!0}function b(e){return!y(e,0,59)}function x(e){return!y(e,0,59)}function S(e){return!y(e,0,23)}function C(e){return!y(e,1,31)}function w(e){return!y(e,1,12)}function T(e){return!y(e,0,7)}function E(e,t){if(b(t[0]))throw Error(`${e[0]} is a invalid expression for second`);if(x(t[1]))throw Error(`${e[1]} is a invalid expression for minute`);if(S(t[2]))throw Error(`${e[2]} is a invalid expression for hour`);if(C(t[3]))throw Error(`${e[3]} is a invalid expression for day of month`);if(w(t[4]))throw Error(`${e[4]} is a invalid expression for month`);if(T(t[5]))throw Error(`${e[5]} is a invalid expression for week day`)}function ee(e){if(typeof e!=`string`)throw TypeError(`pattern must be a string!`);let t=e.split(` `),n=te(e).split(` `);return t.length===5&&t.unshift(`0`),E(t,n),n.join(` `)}e.validateCrontab=ee;function te(e){let r=t(e).split(` `);return r=n(r),r[4]=o(r[4]),r[5]=u(r[5]),r=f(r),r=h(r),r=g(r),r=_(r),r.join(` `)}e.convertExpression=te;function D(e,t){let n=`${t}`;return e.indexOf(`,`)===-1?e===n:e.split(`,`).includes(n)}e.TimeMatcher=class{#e;#t;#n;#r;constructor(e,t){ee(e),this.#e=te(e),this.#r=t,this.#t=this.#e.split(` `),this.#n=this.#r?new Intl.DateTimeFormat(`en-US`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`,fractionalSecondDigits:3,timeZone:this.#r}):null}match(e){e=this.#a(e);let t=D(this.#t[0],e.getSeconds()),n=D(this.#t[1],e.getMinutes()),r=D(this.#t[2],e.getHours()),i=this.#i(e);return t&&n&&r&&i}#i(e){let t=D(this.#t[3],e.getDate()),n=D(this.#t[4],e.getMonth()+1),r=D(this.#t[5],e.getDay());return t&&n&&r}nextWakeupTime(e){let t=typeof e==`number`?e:e.getTime(),n=Math.round(t);for(let e=3600;--e;){n+=1e3;let e=new Date(n);if(this.match(e))return e}return new Date(n)}#a(e){return this.#n?new Date(this.#n.format(e)):typeof e==`number`?new Date(e):e}}})),Fb=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ScheduledReceiver=e.SchedulerMode=void 0;let t=CS(),n=gy(),r=Pb();var i;(function(e){e.ExactlyOncePerInterval=`ExactlyOncePerInterval`,e.ExactlyOncePerIntervalWhenActive=`ExactlyOncePerIntervalWhenActive`})(i||(e.SchedulerMode=i={}));let a=`dbos.scheduler`;e.ScheduledReceiver=class e{#e=new AbortController;#t=[];constructor(){t.DBOS.registerLifecycleCallback(this)}async initialize(){for(let n of t.DBOS.getAssociatedInfo(a)){if(n.methodReg.registeredFunction===void 0){t.DBOS.logger.warn(`Scheduled workflow ${n.methodReg.className}.${n.methodReg.name} is missing registered function; skipping`);continue}let{crontab:a,mode:o,queueName:s}=n.methodConfig;if(!a){t.DBOS.logger.warn(`Scheduled workflow ${n.methodReg.className}.${n.methodReg.name} is missing crontab; skipping`);continue}let c=new r.TimeMatcher(a),l=e.#n(n.methodReg,c,o??i.ExactlyOncePerIntervalWhenActive,s,this.#e.signal);this.#t.push(l)}}async destroy(){this.#e.abort();let e=this.#t.splice(0);await Promise.allSettled(e)}logRegisteredEndpoints(){t.DBOS.logger.info(`Scheduled endpoints:`);for(let e of t.DBOS.getAssociatedInfo(a)){let n=`${e.methodReg.className}.${e.methodReg.name}`,{crontab:r,mode:a}=e.methodConfig;r?t.DBOS.logger.info(` ${n} @ ${r}; ${a??i.ExactlyOncePerIntervalWhenActive}`):t.DBOS.logger.info(` ${n} is missing crontab; skipping`)}}static async#n(r,o,s,c,l){let u=`${r.className}.${r.name}`,d=new Date().setMilliseconds(0);if(s===i.ExactlyOncePerInterval){let e=await t.DBOS.getEventDispatchState(a,u,`lastState`);e?.value&&(d=parseFloat(e.value))}for(;!l.aborted;){let i=o.nextWakeupTime(d).getTime(),a=i-Date.now();if(a>0&&await new Promise((e,t)=>{let n,r=()=>{clearTimeout(n),t(Error(`Abort signal received`))};l.addEventListener(`abort`,r,{once:!0}),l.aborted&&(l.removeEventListener(`abort`,r),t(Error(`Abort signal received`))),n=setTimeout(()=>{l.removeEventListener(`abort`,r),e()},a)}),l.aborted)break;if(!o.match(i)){d=i;continue}let s=new Date(i);if(r.workflowConfig&&r.registeredFunction){let e=`sched-${u}-${s.toISOString()}`,i={workflowID:e,queueName:c??n.INTERNAL_QUEUE_NAME};t.DBOS.logger.debug(`Executing scheduled workflow ${e}`),await t.DBOS.startWorkflow(r.registeredFunction,i)(s,new Date)}else t.DBOS.logger.error(`${u} is @scheduled but not a workflow`);d=await e.#r(u,i)}}static async#r(e,n){try{let r={service:a,workflowFnName:e,key:`lastState`,value:`${n}`,updateTime:n},i=await t.DBOS.upsertEventDispatchState(r),o=parseFloat(i.value);if(o&&o>n)return o}catch(e){let n=e;t.DBOS.logger.warn(`Scheduler caught an error writing to system DB: ${n.message}`),t.DBOS.logger.error(e)}return n}static registerScheduled(e,n){let{regInfo:r}=t.DBOS.associateFunctionWithInfo(a,e,{ctorOrProto:n.ctorOrProto,className:n.className,name:n.name??e.name}),i=r;i.crontab=n.crontab,i.mode=n.mode,i.queueName=n.queueName}}})),Ib=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.globalTimeout=t.toWorkflowStatus=t.forkWorkflow=t.listWorkflowSteps=t.getWorkflow=t.listQueuedWorkflows=t.listWorkflows=void 0;let n=gy(),r=jb(),i=e(`node:crypto`);async function a(e,t){return(await e.listWorkflows(t)).map(e=>u(e))}t.listWorkflows=a;async function o(e,t){return t.queuesOnly=!0,t.loadOutput=!1,(await e.listWorkflows(t)).map(e=>u(e))}t.listQueuedWorkflows=o;async function s(e,t){let n=await e.getWorkflowStatus(t);return n?u(n):void 0}t.getWorkflow=s;async function c(e,t){if(await e.getWorkflowStatus(t))return(await e.getAllOperationResults(t)).map(e=>({functionID:e.function_id,name:e.function_name??``,output:e.output?n.DBOSJSON.parse(e.output):null,error:e.error?(0,r.deserializeError)(n.DBOSJSON.parse(e.error)):null,childWorkflowID:e.child_workflow_id,startedAtEpochMs:e.started_at_epoch_ms,completedAtEpochMs:e.completed_at_epoch_ms})).toSorted((e,t)=>e.functionID-t.functionID)}t.listWorkflowSteps=c;async function l(e,t,n,r={}){let a=r.newWorkflowID??(0,i.randomUUID)();return await e.forkWorkflow(t,n,{...r,newWorkflowID:a}),a}t.forkWorkflow=l;function u(e){return{workflowID:e.workflowUUID,status:e.status,workflowName:e.workflowName,workflowClassName:e.workflowClassName,workflowConfigName:e.workflowConfigName,queueName:e.queueName,authenticatedUser:e.authenticatedUser,assumedRole:e.assumedRole,authenticatedRoles:e.authenticatedRoles,input:e.input?n.DBOSJSON.parse(e.input):void 0,output:e.output?n.DBOSJSON.parse(e.output??null):void 0,error:e.error?(0,r.deserializeError)(n.DBOSJSON.parse(e.error)):void 0,request:e.request,executorId:e.executorId,applicationVersion:e.applicationVersion,applicationID:e.applicationID,recoveryAttempts:e.recoveryAttempts,createdAt:e.createdAt,updatedAt:e.updatedAt,timeoutMS:e.timeoutMS,deadlineEpochMS:e.deadlineEpochMS,deduplicationID:e.deduplicationID,priority:e.priority,queuePartitionKey:e.queuePartitionKey,forkedFrom:e.forkedFrom}}t.toWorkflowStatus=u;async function d(e,t){let n=new Date(t).toISOString();for(let t of await a(e,{status:`PENDING`,endTime:n}))await e.cancelWorkflow(t.workflowID);for(let t of await a(e,{status:`ENQUEUED`,endTime:n}))await e.cancelWorkflow(t.workflowID)}t.globalTimeout=d})),Lb=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DebouncerClient=t.Debouncer=t.debouncerWorkflowFunction=void 0;let n=e(`node:crypto`),r=CS(),i=Rb(),a=Ab(),o=ny(),s=gy(),c=`DEBOUNCER_TOPIC`;t.debouncerWorkflowFunction=async(e,t,...n)=>{let i=n,o=t.debounceTimeoutMs?Date.now()+t.debounceTimeoutMs:Number.MAX_VALUE,s=e;for(;Date.now()<o;){let e=Math.max(o-Date.now(),0),t=Math.min(s,e),n=await r.DBOS.recv(c,t/1e3);if(n===null)break;i=n.args,s=n.debouncePeriodMs,await r.DBOS.setEvent(n.messageID,n.messageID)}let l=(0,a.getFunctionRegistrationByName)(t.workflowClassName,t.workflowName);if(!l||!l.registeredFunction)throw Error(`Invalid workflow name provided to debouncer: ${t.workflowName}`);let u=l?.registeredFunction;await r.DBOS.startWorkflow(u,t.startWorkflowParams)(...i)},t.Debouncer=class{cfg;constructor(e){this.cfg={workflowName:(0,a.getFunctionRegistration)(e.workflow)?.name??e.workflow.name,workflowClassName:(0,a.getRegisteredFunctionClassName)(e.workflow),startWorkflowParams:e.startWorkflowParams,debounceTimeoutMs:e.debounceTimeoutMs}}async debounce(e,t,...n){if(t<=0)throw Error(`debouncePeriodMs must be positive, not ${t}`);let a={...this.cfg};for(a.startWorkflowParams=this.cfg.startWorkflowParams?{...this.cfg.startWorkflowParams}:{},a.startWorkflowParams.workflowID=a.startWorkflowParams.workflowID??await r.DBOS.randomUUID();;){let l=`${a.workflowClassName}.${a.workflowName}-${e}`;try{return await r.DBOS.startWorkflow(i.DBOSExecutor.debouncerWorkflow,{queueName:s.INTERNAL_QUEUE_NAME,enqueueOptions:{deduplicationID:l}})(t,a,...n),r.DBOS.retrieveWorkflow(a.startWorkflowParams.workflowID)}catch(e){if(e instanceof Error&&(0,o.getDBOSErrorCode)(e)===o.QueueDedupIDDuplicated){let e=await r.DBOS.runStep(async()=>await i.DBOSExecutor.globalInstance?.systemDatabase.getDeduplicatedWorkflow(s.INTERNAL_QUEUE_NAME,l));if(e){let i=await r.DBOS.randomUUID(),a={messageID:i,args:n,debouncePeriodMs:t};if(await r.DBOS.send(e,a,c),!await r.DBOS.getEvent(e,i,1e3))continue;let o=(await r.DBOS.retrieveWorkflow(e).getWorkflowInputs())[1].startWorkflowParams.workflowID;return r.DBOS.retrieveWorkflow(o)}else continue}else throw e}}}},t.DebouncerClient=class{client;cfg;constructor(e,t){this.client=e,this.cfg={workflowName:t.workflowName,workflowClassName:t.workflowClassName||``,startWorkflowParams:t.startWorkflowParams,debounceTimeoutMs:t.debounceTimeoutMs}}async debounce(e,t,...r){if(t<=0)throw Error(`debouncePeriodMs must be positive, not ${t}`);let i={...this.cfg};for(i.startWorkflowParams=this.cfg.startWorkflowParams?{...this.cfg.startWorkflowParams}:{},i.startWorkflowParams.workflowID=i.startWorkflowParams.workflowID??String((0,n.randomUUID)());;){let a=`${i.workflowClassName}.${i.workflowName}-${e}`;try{return await this.client.enqueue({workflowName:s.DEBOUNCER_WORKLOW_NAME,queueName:s.INTERNAL_QUEUE_NAME,deduplicationID:a},t,i,...r),this.client.retrieveWorkflow(i.startWorkflowParams.workflowID)}catch(e){if(e instanceof Error&&(0,o.getDBOSErrorCode)(e)===o.QueueDedupIDDuplicated){let e=await this.client.systemDatabase.getDeduplicatedWorkflow(s.INTERNAL_QUEUE_NAME,a);if(e){let i=String((0,n.randomUUID)()),a={messageID:i,args:r,debouncePeriodMs:t};if(await this.client.send(e,a,c),!await this.client.getEvent(e,i,1e3))continue;let o=(await this.client.retrieveWorkflow(e).getWorkflowInputs())[1].startWorkflowParams.workflowID;return this.client.retrieveWorkflow(o)}else continue}else throw e}}}}})),Rb=r((t=>{var n=t&&t.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=t&&t.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(t,`__esModule`,{value:!0}),t.DBOSExecutor=t.TempWorkflowType=t.OperationType=t.DBOS_QUEUE_MAX_PRIORITY=t.DBOS_QUEUE_MIN_PRIORITY=void 0;let a=ny(),o=_y(),s=vy(),c=yy(),l=by(),u=xy(),d=kb(),f=e(`node:crypto`),p=Ab(),m=zb(),h=jb(),g=gy(),_=CS(),v=Nb(),y=Mb(),b=Fb(),x=i(e(`crypto`)),S=Ib(),C=Eb(),w=Lb(),T={};t.DBOS_QUEUE_MIN_PRIORITY=1,t.DBOS_QUEUE_MAX_PRIORITY=2**31-1,t.OperationType={HANDLER:`handler`,WORKFLOW:`workflow`,TRANSACTION:`transaction`,STEP:`step`},t.TempWorkflowType={step:`step`,send:`send`},t.DBOSExecutor=class e{config;initialized;systemDatabase;static#e=`temp_workflow`;telemetryCollector;static defaultNotificationTimeoutSec=60;#t;systemDBSchemaName;logger;ctxLogger;tracer;#n=void 0;executorID=g.globalParams.executorID;static globalInstance=void 0;constructor(t,{systemDatabase:n,debugMode:r}={}){if(this.config=t,this.#t=r??!1,this.systemDBSchemaName=t.systemDatabaseSchemaName,t.telemetry.OTLPExporter){let e=new u.TelemetryExporter(t.telemetry.OTLPExporter);this.telemetryCollector=new s.TelemetryCollector(e)}else this.telemetryCollector=new s.TelemetryCollector;this.logger=new l.GlobalLogger(this.telemetryCollector,this.config.telemetry.logs,this.appName),this.ctxLogger=new l.DBOSContextualLogger(this.logger,()=>(0,c.getActiveSpan)()),this.tracer=new c.Tracer(this.telemetryCollector,this.appName),this.#t&&this.logger.info(`Running in debug mode!`),n?(this.logger.debug(`Using provided system database`),this.systemDatabase=n):(this.logger.debug(`Using Postgres system database`),this.systemDatabase=new d.PostgresSystemDatabase(this.config.systemDatabaseUrl,this.logger,this.config.sysDbPoolSize,this.config.systemDatabasePool,this.systemDBSchemaName)),new b.ScheduledReceiver,this.initialized=!1,e.globalInstance=this}get appName(){return this.config.name}async init(){if(this.initialized){this.logger.error(`Workflow executor already initialized!`);return}try{await this.systemDatabase.init(this.#t)}catch(e){if(e instanceof a.DBOSInitializationError)throw e;this.logger.error(e);let t=`Failed to initialize workflow executor: `;if(e instanceof AggregateError)for(let n of e.errors)t+=`${n.message}; `;else e instanceof Error?t+=e.message:t+=String(e);throw new a.DBOSInitializationError(t,e instanceof Error?e:void 0)}if(this.initialized=!0,!this.#t){g.globalParams.appVersion===``&&(g.globalParams.appVersion=this.computeAppVersion(),g.globalParams.wasComputed=!0);let e=(0,p.getAllRegisteredClassNames)();for(let t of e){let e=(0,p.getClassRegistrationByName)(t);for(let[t,n]of e.configuredInstances)await n.initialize()}this.logger.info(`Initializing DBOS (v${g.globalParams.dbosVersion})`),this.logger.info(`System Database URL: ${(0,C.maskDatabaseUrl)(this.config.systemDatabaseUrl)}`),this.logger.info(`Executor ID: ${this.executorID}`),this.logger.info(`Application version: ${g.globalParams.appVersion}`),await this.recoverPendingWorkflows([this.executorID])}this.logger.info(`DBOS launched!`)}async destroy(){try{await this.systemDatabase.awaitRunningWorkflows(),await this.systemDatabase.destroy(),await this.logger.destroy(),e.globalInstance===this&&(e.globalInstance=void 0)}catch(e){let t=e;throw this.logger.error(t),e}}#r(e){return{methReg:(0,p.getFunctionRegistrationByName)(e.workflowClassName,e.workflowName),configuredInst:(0,p.getConfiguredInstance)(e.workflowClassName,e.workflowConfigName)}}static reviveResultOrError(e,t){if(t===!0||!e.error)return g.DBOSJSON.parse(e.output??null);throw(0,h.deserializeError)(g.DBOSJSON.parse(e.error))}async workflow(e,t,...n){return this.internalWorkflow(e,t,void 0,void 0,...n)}async internalWorkflow(n,r,i,s,...l){let u=r.workflowUUID?r.workflowUUID:(0,f.randomUUID)(),d=!!r.workflowUUID,_=r.timeoutMS??void 0,v=r.timeoutMS?r.queueName?void 0:Date.now()+r.timeoutMS:r.deadlineEpochMS,b=r?.enqueueOptions?.priority;if(b!==void 0&&(b<t.DBOS_QUEUE_MIN_PRIORITY||b>t.DBOS_QUEUE_MAX_PRIORITY))throw new a.DBOSInvalidQueuePriorityError(b,t.DBOS_QUEUE_MIN_PRIORITY,t.DBOS_QUEUE_MAX_PRIORITY);if(r.queueName&&!this.getQueueByName(r.queueName).priorityEnabled&&b!==void 0)throw Error(`Priority is not enabled for queue ${r.queueName}. Setting priority will not have any effect.`);let x={...(0,m.getCurrentContextStore)()},S={},C=(0,p.getFunctionRegistration)(n);if(n.name!==e.#e){if(!C||!C.workflowConfig)throw new a.DBOSNotRegisteredError(n.name);S=C.workflowConfig}let w=S.maxRecoveryAttempts?S.maxRecoveryAttempts:o.DEFAULT_MAX_RECOVERY_ATTEMPTS,T=n.name,E=this.tracer.startSpan(T,{status:o.StatusString.PENDING,operationUUID:u,operationType:t.OperationType.WORKFLOW,operationName:C?.name??n.name,authenticatedUser:x?.authenticatedUser??``,authenticatedRoles:x?.authenticatedRoles??[],assumedRole:x?.assumedRole??``}),ee=e.#e===T,te=(0,g.serializeFunctionInputOutput)(l,[T,`<arguments>`]);l=te.deserialized;let D={workflowUUID:u,status:r.queueName===void 0?o.StatusString.PENDING:o.StatusString.ENQUEUED,workflowName:(0,p.getRegisteredFunctionName)(n),workflowClassName:ee?``:(0,p.getRegisteredFunctionClassName)(n),workflowConfigName:r.configuredInstance?.name||``,queueName:r.queueName,output:null,error:null,authenticatedUser:x?.authenticatedUser||``,assumedRole:x?.assumedRole||``,authenticatedRoles:x?.authenticatedRoles||[],request:x?.request||{},executorId:g.globalParams.executorID,applicationVersion:g.globalParams.appVersion,applicationID:g.globalParams.appID,createdAt:Date.now(),timeoutMS:_,deadlineEpochMS:v,input:te.stringified,deduplicationID:r.enqueueOptions?.deduplicationID,priority:b??0,queuePartitionKey:r.enqueueOptions?.queuePartitionKey};ee&&(D.workflowName=`${e.#e}-${r.tempWfType}-${r.tempWfName}`,D.workflowClassName=r.tempWfClass??``);let ne,O;if(this.#t){let e=await this.systemDatabase.getWorkflowStatus(u);if(!e)throw new a.DBOSDebuggerError(`Failed to find inputs for workflow UUID ${u}`);if(te.stringified!==e.input)throw new a.DBOSDebuggerError(`Detected different inputs for workflow UUID ${u}.\n Received: ${te.stringified}\n Original: ${e.input}`);ne=e.status}else{if(s!==void 0&&i!==void 0){let e=await this.systemDatabase.getOperationResultAndThrowIfCancelled(i,s);if(e){if(e.error)throw(0,h.deserializeError)(g.DBOSJSON.parse(e.error));return new o.RetrievedHandle(this.systemDatabase,e.childWorkflowID)}}let e;try{e=await this.systemDatabase.initWorkflowStatus(D,w)}catch(e){throw e instanceof a.DBOSQueueDuplicatedError&&i&&s&&await this.systemDatabase.recordOperationResult(i,s,D.workflowName,!0,Date.now(),{error:g.DBOSJSON.stringify((0,h.serializeError)(e))}),e}s!==void 0&&i!==void 0&&await this.systemDatabase.recordOperationResult(i,s,D.workflowName,!0,Date.now(),{childWorkflowID:u}),ne=e.status,O=e.deadlineEpochMS,await(0,y.debugTriggerPoint)(y.DEBUG_TRIGGER_WORKFLOW_ENQUEUE)}async function k(e,t,n){let r,i={},o=new Promise((e,n)=>{r=setTimeout(n,t-Date.now(),i)});try{return await Promise.race([e,o])}catch(t){throw t===i?(await n.cancelWorkflow(u),await e.catch(()=>{}),new a.DBOSWorkflowCancelledError(u)):t}finally{clearTimeout(r)}}async function re(e,t){let n=e;t.logger.error(n),n.dbos_already_logged=!0,D.error=g.DBOSJSON.stringify((0,h.serializeError)(n)),D.status=o.StatusString.ERROR,t.#t||await t.systemDatabase.recordWorkflowError(u,D),E.setStatus({code:c.SpanStatusCode.ERROR,message:n.message})}let A=async()=>{let t;try{let i=await(0,c.runWithTrace)(E,async()=>await(0,m.runWithParentContext)(x,{presetID:d,workflowTimeoutMS:void 0,deadlineEpochMS:v,workflowId:u,logger:this.ctxLogger,curWFFunctionId:void 0},()=>{let e=n.call(r.configuredInstance,...l);return O===void 0?e:k(e,O,this.systemDatabase)}));if(this.#t){function n(e,t){return e===null?t==null:g.DBOSJSON.stringify(e)===g.DBOSJSON.stringify(t)}let r=e.reviveResultOrError(await this.systemDatabase.awaitWorkflowResult(u));n(r,i)||this.logger.error(`Detect different output for the workflow UUID ${u}!\n Received: ${g.DBOSJSON.stringify(i)}\n Original: ${g.DBOSJSON.stringify(r)}`),t=r}else t=i;let a=(0,g.serializeFunctionInputOutput)(t,[T,`<result>`]);t=a.deserialized,D.output=a.stringified,D.status=o.StatusString.SUCCESS,this.#t||await this.systemDatabase.recordWorkflowOutput(u,D),E.setStatus({code:c.SpanStatusCode.OK})}catch(e){if(e instanceof a.DBOSWorkflowConflictError)t=await this.retrieveWorkflow(u).getResult(),E.setAttribute(`cached`,!0),E.setStatus({code:c.SpanStatusCode.OK});else if(e instanceof a.DBOSWorkflowCancelledError){if(E.setStatus({code:c.SpanStatusCode.ERROR,message:e.message}),D.error=e.message,e.workflowID===u)throw D.status=o.StatusString.CANCELLED,e;{let t=new a.DBOSAwaitedWorkflowCancelledError(e.workflowID);throw await re(t,this),t}}else throw await re(e,this),e}finally{this.tracer.endSpan(E)}return t};if(this.#t||ne!==`SUCCESS`&&ne!==`ERROR`&&(r.queueName===void 0||r.executeWorkflow)){let e=A();return this.systemDatabase.registerRunningWorkflow(u,e),new o.InvokedHandle(this.systemDatabase,e,u,n.name)}else return new o.RetrievedHandle(this.systemDatabase,u)}getQueueByName(e){let t=v.wfQueueRunner.wfQueuesByName.get(e);if(!t)throw new a.DBOSNotRegisteredError(e,`Workflow queue '${e}' is not defined.`);return t}async runStepTempWF(e,t,...n){return await(await this.startStepTempWF(e,t,void 0,void 0,...n)).getResult()}async startStepTempWF(e,n,r,i,...a){return await this.internalWorkflow(async(...t)=>await this.callStepFunction(e,void 0,void 0,n.configuredInstance??null,...t),{...n,tempWfType:t.TempWorkflowType.step,tempWfName:(0,p.getRegisteredFunctionName)(e),tempWfClass:(0,p.getRegisteredFunctionClassName)(e)},r,i,...a)}async callStepFunction(n,r,i,o,...s){r=r??n.name??`<unnamed>`;let l=Date.now();if(i||=(0,p.getFunctionRegistration)(n)?.stepConfig,i===void 0)throw new a.DBOSNotRegisteredError(r);let u=(0,m.functionIDGetIncrement)(),d={...(0,m.getCurrentContextStore)()},f=d.workflowId;await this.systemDatabase.checkIfCanceled(f);let _=3600,v=this.tracer.startSpan(r,{operationUUID:f,operationType:t.OperationType.STEP,operationName:r,authenticatedUser:d.authenticatedUser??``,assumedRole:d.assumedRole??``,authenticatedRoles:d.authenticatedRoles??[],retriesAllowed:i.retriesAllowed,intervalSeconds:i.intervalSeconds,maxAttempts:i.maxAttempts,backoffRate:i.backoffRate}),y=await this.systemDatabase.getOperationResultAndThrowIfCancelled(f,u);if(y){if(y.functionName!==r)throw new a.DBOSUnexpectedStepError(f,u,r,y.functionName??`?`);let t=e.reviveResultOrError(y);return v.setAttribute(`cached`,!0),v.setStatus({code:c.SpanStatusCode.OK}),this.tracer.endSpan(v),t}if(this.#t)throw new a.DBOSDebuggerError(`Failed to find the recorded output for the step: workflow UUID: ${f}, step number: ${u}`);let b=i.maxAttempts??3,x=T,S=T,C=[];if(i.retriesAllowed){let e=0,t=i.intervalSeconds??1;for(t>_&&this.logger.warn(`Step config interval exceeds maximum allowed interval, capped to ${_} seconds!`);x===T&&e++<(b??3);)try{await this.systemDatabase.checkIfCanceled(f);let t;await(0,m.runInStepContext)(d,u,b,e,async()=>{t=await n.call(o,...s)}),x=t}catch(n){let r=n;C.push(r),this.logger.warn(`Error in step being automatically retried. Attempt ${e} of ${b}. ${r.stack}`),v.addEvent(`Step attempt ${e+1} failed`,{retryIntervalSeconds:t,error:n.message},performance.now()),e<b&&(await(0,g.sleepms)(t*1e3),t*=i.backoffRate??2,t=t<_?t:_)}}else try{let e;await(0,c.runWithTrace)(v,async()=>{await(0,m.runInStepContext)(d,u,b,void 0,async()=>{e=await n.call(o,...s)})}),x=e}catch(e){S=e}if(x===T)throw S=S===T?new a.DBOSMaxStepRetriesError(r,b,C):S,await this.systemDatabase.recordOperationResult(f,u,r,!0,l,{error:g.DBOSJSON.stringify((0,h.serializeError)(S))}),v.setStatus({code:c.SpanStatusCode.ERROR,message:S.message}),this.tracer.endSpan(v),S;{let e=(0,g.serializeFunctionInputOutput)(x,[r,`<result>`]);return await this.systemDatabase.recordOperationResult(f,u,r,!0,l,{output:e.stringified}),v.setStatus({code:c.SpanStatusCode.OK}),this.tracer.endSpan(v),e.deserialized}}async runSendTempWF(e,n,r,i){let a=async(e,t,n)=>{let r=(0,m.getCurrentContextStore)(),i=(0,m.functionIDGetIncrement)();await this.systemDatabase.send(r.workflowId,i,e,g.DBOSJSON.stringify(t),n)},o=i?e+i:void 0;return(await this.workflow(a,{workflowUUID:o,tempWfType:t.TempWorkflowType.send,configuredInstance:null},e,n,r)).getResult()}async getEvent(t,n,r=e.defaultNotificationTimeoutSec){return g.DBOSJSON.parse(await this.systemDatabase.getEvent(t,n,r))}forkWorkflow(e,t,n={}){let r=n.newWorkflowID??(0,m.getNextWFID)(void 0);return(0,S.forkWorkflow)(this.systemDatabase,e,t,{...n,newWorkflowID:r})}retrieveWorkflow(e){return new o.RetrievedHandle(this.systemDatabase,e)}async runInternalStep(t,n,r,i,o){let s=Date.now(),c=await this.systemDatabase.getOperationResultAndThrowIfCancelled(r,i);if(c){if(c.functionName!==n)throw new a.DBOSUnexpectedStepError(r,i,n,c.functionName);return e.reviveResultOrError(c)}try{let e=await t(),a=(0,g.serializeFunctionInputOutput)(e,[n,`<result>`]);return await this.systemDatabase.recordOperationResult(r,i,n,!0,s,{output:a.stringified,childWorkflowID:o}),a.deserialized}catch(e){throw await this.systemDatabase.recordOperationResult(r,i,n,!1,s,{error:g.DBOSJSON.stringify((0,h.serializeError)(e)),childWorkflowID:o}),e}}async getWorkflowStatus(e,t,n){let r=await this.systemDatabase.getWorkflowStatus(e,t,n);return r?(0,S.toWorkflowStatus)(r):null}async listWorkflows(e){return(0,S.listWorkflows)(this.systemDatabase,e)}async listQueuedWorkflows(e){return(0,S.listQueuedWorkflows)(this.systemDatabase,e)}async listWorkflowSteps(e){return(0,S.listWorkflowSteps)(this.systemDatabase,e)}async recoverPendingWorkflows(e=[`local`]){if(this.#t)throw new a.DBOSDebuggerError(`Cannot recover pending workflows in debug mode.`);let t=[];for(let n of e){this.logger.debug(`Recovering workflows assigned to executor: ${n}`);let e=await this.systemDatabase.getPendingWorkflows(n,g.globalParams.appVersion);e.length>0?this.logger.info(`Recovering ${e.length} workflows from application version ${g.globalParams.appVersion}`):this.logger.info(`No workflows to recover from application version ${g.globalParams.appVersion}`);for(let n of e){this.logger.debug(`Recovering workflow: ${n.workflowUUID}. Queue name: ${n.queueName}`);try{n.queueName&&await this.systemDatabase.clearQueueAssignment(n.workflowUUID)?t.push(this.retrieveWorkflow(n.workflowUUID)):t.push(await this.executeWorkflowUUID(n.workflowUUID))}catch(e){this.logger.warn(`Recovery of workflow ${n.workflowUUID} failed: ${e.message}`)}}}return t}async initEventReceivers(){this.#n=v.wfQueueRunner.dispatchLoop(this);for(let e of(0,p.getLifecycleListeners)())await e.initialize?.()}async deactivateEventReceivers(e=!0){this.logger.debug(`Deactivating lifecycle listeners`);for(let e of(0,p.getLifecycleListeners)())try{await e.destroy?.()}catch(e){let t=e;this.logger.warn(`Error destroying lifecycle listener: ${t.message}`)}if(this.logger.debug(`Deactivating queue runner`),e)try{v.wfQueueRunner.stop(),await this.#n}catch(e){let t=e;this.logger.warn(`Error destroying wf queue runner: ${t.message}`)}}async executeWorkflowUUID(n,r=!1){let i=await this.systemDatabase.getWorkflowStatus(n);if(!i)throw this.logger.error(`Failed to find workflow status for workflowUUID: ${n}`),new a.DBOSError(`Failed to find workflow status for workflow UUID: ${n}`);if(!i?.input)throw this.logger.error(`Failed to find inputs for workflowUUID: ${n}`),new a.DBOSError(`Failed to find inputs for workflow UUID: ${n}`);let o=g.DBOSJSON.parse(i.input),s=this.#i(n,i),{methReg:c,configuredInst:l}=this.#r(i),u=r?void 0:n;if(c?.workflowConfig)return await(0,m.runWithTopContext)(s,async()=>await this.workflow(c.registeredFunction,{workflowUUID:u,configuredInstance:l,queueName:i.queueName,executeWorkflow:!0,deadlineEpochMS:i.deadlineEpochMS},...o));let d=i.workflowName,f=d.split(`-`);if(!f[0].startsWith(e.#e))throw new a.DBOSError(`Cannot find workflow function for a non-temporary workflow, ID ${n}, class '${i.workflowClassName}', function '${d}'; did you change your code?`);if(f[1]===t.TempWorkflowType.step){let e=(0,p.getFunctionRegistrationByName)(i.workflowClassName,f[2]);if(!e?.stepConfig)throw this.logger.error(`Cannot find step info for ID ${n}, name ${f[2]}`),new a.DBOSNotRegisteredError(f[2]);return await(0,m.runWithTopContext)(s,async()=>await this.startStepTempWF(e.registeredFunction,{workflowUUID:u,configuredInstance:l,queueName:i.queueName,executeWorkflow:!0},void 0,void 0,...o))}else if(f[1]===t.TempWorkflowType.send){let e=async(e,t,n)=>{let r=(0,m.getCurrentContextStore)(),i=(0,m.functionIDGetIncrement)();await this.systemDatabase.send(r.workflowId,i,e,g.DBOSJSON.stringify(t),n)};return await(0,m.runWithTopContext)(s,async()=>this.workflow(e,{workflowUUID:u,tempWfType:t.TempWorkflowType.send,queueName:i.queueName,executeWorkflow:!0},...o))}else throw this.logger.error(`Unrecognized temporary workflow! UUID ${n}, name ${d}`),new a.DBOSNotRegisteredError(d)}async getEventDispatchState(e,t,n){return await this.systemDatabase.getEventDispatchState(e,t,n)}async upsertEventDispatchState(e){return await this.systemDatabase.upsertEventDispatchState(e)}#i(e,t){let n={};return n.request=t.request,n.authenticatedUser=t.authenticatedUser,n.authenticatedRoles=t.authenticatedRoles,n.assumedRole=t.assumedRole,n}async cancelWorkflow(e){await this.systemDatabase.cancelWorkflow(e),this.logger.info(`Cancelling workflow ${e}`)}async getWorkflowSteps(e){return(await this.systemDatabase.getAllOperationResults(e)).map(e=>({function_id:e.function_id,function_name:e.function_name??`<unknown>`,child_workflow_id:e.child_workflow_id,output:e.output===null?null:g.DBOSJSON.parse(e.output),error:e.error===null?null:(0,h.deserializeError)(g.DBOSJSON.parse(e.error))}))}async resumeWorkflow(e){await this.systemDatabase.resumeWorkflow(e)}computeAppVersion(){let e=x.createHash(`md5`),t=Array.from((0,p.getAllRegisteredFunctions)()).filter(e=>e.workflowConfig).map(e=>e.origFunction.toString()).sort();t.push(g.globalParams.dbosVersion);for(let n of t)e.update(n);return e.digest(`hex`)}static internalQueue=void 0;static createInternalQueue(){e.internalQueue===void 0&&(e.internalQueue=new v.WorkflowQueue(g.INTERNAL_QUEUE_NAME,{}))}static debouncerWorkflow=void 0;static createDebouncerWorkflow(){e.debouncerWorkflow===void 0&&(e.debouncerWorkflow=_.DBOS.registerWorkflow(w.debouncerWorkflowFunction,{name:g.DEBOUNCER_WORKLOW_NAME}))}}})),zb=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.runInStepContext=t.runWithDataSourceContext=t.runWithParentContext=t.runWithTopContext=t.functionIDGetIncrement=t.getNextWFID=t.getCurrentContextStore=t.isInWorkflowCtx=void 0;let n=e(`async_hooks`),r=ny(),i=Rb();function a(e){return e.workflowId!==void 0}function o(e){return e.workflowId===void 0?!1:!!e.curStepFunctionId}function s(e){return e.workflowId===void 0?!1:!!e.curTxFunctionId}function c(e){return!(!a(e)||o(e)||s(e))}t.isInWorkflowCtx=c;let l=new n.AsyncLocalStorage;function u(){return l.getStore()}t.getCurrentContextStore=u;function d(e){let t=e;if(!t){let e=u(),n=e?.idAssignedForNextWorkflow;n&&(t=n,e.idAssignedForNextWorkflow=void 0)}return t}t.getNextWFID=d;function f(){let e=u();if(!e)throw new r.DBOSInvalidWorkflowTransitionError(`Attempt to get a call ID number outside of a workflow`);if(!c(e))throw new r.DBOSInvalidWorkflowTransitionError(`Attempt to get a call ID number in a workflow that is already in a call`);return e.curWFFunctionId===void 0&&(e.curWFFunctionId=0),e.curWFFunctionId++}t.functionIDGetIncrement=f;async function p(e,t){return await l.run(e,t)}t.runWithTopContext=p;async function m(e,t,n){return await l.run({...e,...t,parentCtx:e},n)}t.runWithParentContext=m;async function h(e,t){let n=u()??{};return await l.run({...n,curTxFunctionId:e,parentCtx:n,logger:i.DBOSExecutor.globalInstance.ctxLogger},t)}t.runWithDataSourceContext=h;async function g(e,t,n,a,o){if(!e||!c(e))throw new r.DBOSInvalidWorkflowTransitionError;return await m(e,{stepStatus:{stepID:t,currentAttempt:a,maxAttempts:a?n:void 0},curStepFunctionId:t,parentCtx:e,logger:i.DBOSExecutor.globalInstance.ctxLogger},o)}t.runInStepContext=g})),X=r((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),Bb=r((e=>{var t=X();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),Vb=r((e=>{var t=X(),n=Bb();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
201
+ `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),Hb=r((e=>{var t=X(),n=Bb();function r(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function i(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=new Map,s=null;return{onAnchor:t=>{r.push(t),s||=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),Ub=r((e=>{function t(e,n,r,i){if(i&&typeof i==`object`)if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}return e.call(n,r,i)}e.applyReviver=t})),Wb=r((e=>{var t=X();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),Gb=r((e=>{var t=Ub(),n=X(),r=Wb();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),Kb=r((e=>{var t=Hb(),n=Bb(),r=X(),i=Gb(),a=Wb(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e){let t;return n.visit(e,{Node:(e,r)=>{if(r===this)return n.visit.BREAK;r.anchor===this.source&&(t=r)}}),t}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let c=n.get(o);if(c||=(a.toJS(o,null,t),n.get(o)),!c||c.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=s(r,o,n)),c.count*c.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return c.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}else if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),qb=r((e=>{var t=X(),n=Gb(),r=Wb();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),Jb=r((e=>{var t=Kb(),n=X(),r=qb();function i(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor||=c(e),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),Yb=r((e=>{var t=Jb(),n=X(),r=Gb();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;var o=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}};o.maxFlowStringSingleLineLength=60,e.Collection=o,e.collectionFromPath=i,e.isEmptyPath=a})),Xb=r((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
202
+ `)?n(r,t):r.includes(`
203
+ `)?`
204
+ `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),Zb=r((e=>{let t=`block`,n=`quoted`;function r(e,r,a=`flow`,{indentAtStart:o,lineWidth:s=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!s||s<0)return e;let d=Math.max(1+c,1+s-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.length;typeof o==`number`&&(o>s-Math.max(2,c)?f.push(0):m=s-o);let h,g,_=!1,v=-1,y=-1,b=-1;a===t&&(v=i(e,v,r.length),v!==-1&&(m=v+d));for(let o;o=e[v+=1];){if(a===n&&o===`\\`){switch(y=v,e[v+1]){case`x`:v+=3;break;case`u`:v+=5;break;case`U`:v+=9;break;default:v+=1}b=v}if(o===`
205
+ `)a===t&&(v=i(e,v,r.length)),m=v+r.length+d,h=void 0;else{if(o===` `&&g&&g!==` `&&g!==`
206
+ `&&g!==` `){let t=e[v+1];t&&t!==` `&&t!==`
207
+ `&&t!==` `&&(h=v)}if(v>=m)if(h)f.push(h),m=h+d,h=void 0;else if(a===n){for(;g===` `||g===` `;)g=o,o=e[v+=1],_=!0;let t=v>b+1?v-2:y-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,h=void 0}else _=!0}g=o}if(_&&u&&u(),f.length===0)return e;l&&l();let x=e.slice(0,f[0]);for(let t=0;t<f.length;++t){let i=f[t],o=f[t+1]||e.length;i===0?x=`\n${r}${e.slice(0,o)}`:(a===n&&p[i]&&(x+=`${e[i]}\\`),x+=`\n${r}${e.slice(i+1,o)}`)}return x}function i(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
208
+ `);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),Qb=r((e=>{var t=qb(),n=Zb();let r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),i=e=>/^(%|---|\.\.\.)/m.test(e);function a(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
209
+ `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function o(e,t){let a=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return a;let{implicitKey:o}=t,s=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(i(e)?` `:``),l=``,u=0;for(let e=0,t=a[e];t;t=a[++e])if(t===` `&&a[e+1]===`\\`&&a[e+2]===`n`&&(l+=a.slice(u,e)+`\\ `,e+=1,u=e,t=`\\`),t===`\\`)switch(a[e+1]){case`u`:{l+=a.slice(u,e);let t=a.substr(e+2,4);switch(t){case`0000`:l+=`\\0`;break;case`0007`:l+=`\\a`;break;case`000b`:l+=`\\v`;break;case`001b`:l+=`\\e`;break;case`0085`:l+=`\\N`;break;case`00a0`:l+=`\\_`;break;case`2028`:l+=`\\L`;break;case`2029`:l+=`\\P`;break;default:t.substr(0,2)===`00`?l+=`\\x`+t.substr(2):l+=a.substr(e,6)}e+=5,u=e+1}break;case`n`:if(o||a[e+2]===`"`||a.length<s)e+=1;else{for(l+=a.slice(u,e)+`
210
+
211
+ `;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)l+=`
212
+ `,e+=2;l+=c,a[e+2]===` `&&(l+=`\\`),e+=1,u=e+1}break;default:e+=1}return l=u?l+a.slice(u):a,o?l:n.foldFlowLines(l,c,n.FOLD_QUOTED,r(t,!1))}function s(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
213
+ `)||/[ \t]\n|\n[ \t]/.test(e))return o(e,t);let a=t.indent||(i(e)?` `:``),s=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${a}`)+`'`;return t.implicitKey?s:n.foldFlowLines(s,a,n.FOLD_FLOW,r(t,!1))}function c(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=o;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?s:i&&!t?o:n?s:o}return r(e,t)}let l;try{l=RegExp(`(^|(?<!
214
+ ))
215
+ +(?!
216
+ |$)`,`g`)}catch{l=/\n+(?!\n|$)/g}function u({comment:e,type:o,value:s},u,d,f){let{blockQuote:p,commentString:m,lineWidth:h}=u.options;if(!p||/\n[\t ]+$/.test(s)||/^\s*$/.test(s))return c(s,u);let g=u.indent||(u.forceBlockIndent||i(s)?` `:``),_=p===`literal`?!0:p===`folded`||o===t.Scalar.BLOCK_FOLDED?!1:o===t.Scalar.BLOCK_LITERAL?!0:!a(s,h,g.length);if(!s)return _?`|
217
+ `:`>
218
+ `;let v,y;for(y=s.length;y>0;--y){let e=s[y-1];if(e!==`
219
+ `&&e!==` `&&e!==` `)break}let b=s.substring(y),x=b.indexOf(`
220
+ `);x===-1?v=`-`:s===b||x!==b.length-1?(v=`+`,f&&f()):v=``,b&&=(s=s.slice(0,-b.length),b[b.length-1]===`
221
+ `&&(b=b.slice(0,-1)),b.replace(l,`$&${g}`));let S=!1,C,w=-1;for(C=0;C<s.length;++C){let e=s[C];if(e===` `)S=!0;else if(e===`
222
+ `)w=C;else break}let T=s.substring(0,w<C?w+1:C);T&&=(s=s.substring(T.length),T.replace(/\n+/g,`$&${g}`));let E=(_?`|`:`>`)+(S?g?`2`:`1`:``)+v;if(e&&(E+=` `+m(e.replace(/ ?[\r\n]+/g,` `)),d&&d()),_)return s=s.replace(/\n+/g,`$&${g}`),`${E}\n${g}${T}${s}${b}`;s=s.replace(/\n+/g,`
223
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${g}`);let ee=n.foldFlowLines(`${T}${s}${b}`,g,n.FOLD_BLOCK,r(u,!0));return`${E}\n${g}${ee}`}function d(e,a,o,s){let{type:l,value:d}=e,{actualString:f,implicitKey:p,indent:m,indentStep:h,inFlow:g}=a;if(p&&d.includes(`
224
+ `)||g&&/[[\]{},]/.test(d))return c(d,a);if(!d||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(d))return p||g||!d.includes(`
225
+ `)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(`
226
+ `))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),$b=r((e=>{var t=Hb(),n=X(),r=Xb(),i=Qb();function a(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function o(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??typeof i;throw Error(`Tag not resolved for ${e} value`)}return r}function s(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag?e.tag:r.default?null:r.tag;return c&&o.push(a.directives.tagString(c)),o.join(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c||=o(t.doc.schema.tags,l);let u=s(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),ex=r((e=>{var t=X(),n=qb(),r=$b(),i=Xb();function a({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e))throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?`
227
+ `:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===`
228
+ `&&(E=`
229
+
230
+ `):E+=`\n${o.indent}`}else if(!_&&t.isCollection(a)){let e=T[0],t=T.indexOf(`
231
+ `),n=t!==-1,r=o.inFlow??a.flow??a.items.length===0;if(n||!r){let r=!1;if(n&&(e===`&`||e===`!`)){let n=T.indexOf(` `);e===`&`&&n!==-1&&n<t&&T[n+1]===`!`&&(n=T.indexOf(` `,n+1)),(n===-1||t<n)&&(r=!0)}r||(E=`\n${o.indent}`)}}else (T===``||T[0]===`
232
+ `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),tx=r((e=>{function t(e,...t){e===`debug`&&console.log(...t)}function n(e,t){(e===`debug`||e===`warn`)&&(typeof process<`u`&&process.emitWarning?process.emitWarning(t):console.warn(t))}e.debug=t,e.warn=n})),nx=r((e=>{var t=tx(),n=$b(),r=X(),i=qb(),a=Wb();function o(e,t,{key:n,value:i}){if(e?.doc.schema.merge&&s(n))if(i=r.isAlias(i)?i.resolve(e.doc):i,r.isSeq(i))for(let n of i.items)c(e,t,n);else if(Array.isArray(i))for(let n of i)c(e,t,n);else c(e,t,i);else{let r=a.toJS(n,``,e);if(t instanceof Map)t.set(r,a.toJS(i,r,e));else if(t instanceof Set)t.add(r);else{let o=l(n,r,e),s=a.toJS(i,o,e);o in t?Object.defineProperty(t,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):t[o]=s}}return t}let s=e=>e===`<<`||r.isScalar(e)&&e.value===`<<`&&(!e.type||e.type===i.Scalar.PLAIN);function c(e,t,n){let i=e&&r.isAlias(n)?n.resolve(e.doc):n;if(!r.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,n]of a)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function l(e,i,a){if(i===null)return``;if(typeof i!=`object`)return String(i);if(r.isNode(e)&&a?.doc){let r=n.createStringifyContext(a.doc,{});r.anchors=new Set;for(let e of a.anchors.keys())r.anchors.add(e.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=e.toString(r);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(i)}e.addPairToJSMap=o})),rx=r((e=>{var t=Jb(),n=ex(),r=nx(),i=X();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=o,e.createPair=a})),ix=r((e=>{var t=X(),n=$b(),r=Xb();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;e<i.length;++e){let c=i[e],u=null;if(t.isNode(c))!h&&c.spaceBefore&&g.push(``),s(a,g,c.commentBefore,h),c.comment&&(u=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(!h&&e.spaceBefore&&g.push(``),s(a,g,e.commentBefore,h))}h=!1;let d=n.stringify(c,m,()=>u=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(o+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;e<g.length;++e){let t=g[e];_+=t?`\n${f}${t}`:`
233
+ `}}return e?(_+=`
234
+ `+r.indentComment(p(e),f),d&&d()):h&&u&&u(),_}function o({items:e},i,{flowChars:a,itemIndent:o}){let{indent:c,indentStep:l,flowCollectionPadding:u,options:{commentString:d}}=i;o+=l;let f=Object.assign({},i,{indent:o,inFlow:!0,type:null}),p=!1,m=0,h=[];for(let a=0;a<e.length;++a){let c=e[a],l=null;if(t.isNode(c))c.spaceBefore&&h.push(``),s(i,h,c.commentBefore,!1),c.comment&&(l=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(e.spaceBefore&&h.push(``),s(i,h,e.commentBefore,!1),e.comment&&(p=!0));let n=t.isNode(c.value)?c.value:null;n?(n.comment&&(l=n.comment),n.commentBefore&&(p=!0)):c.value==null&&e?.comment&&(l=e.comment)}l&&(p=!0);let u=n.stringify(c,f,()=>l=null);a<e.length-1&&(u+=`,`),l&&(u+=r.lineComment(u,o,d(l))),!p&&(h.length>m||u.includes(`
235
+ `))&&(p=!0),h.push(u),m=h.length}let{start:g,end:_}=a;if(h.length===0)return g+_;if(!p){let e=h.reduce((e,t)=>e+t.length+2,2);p=i.options.lineWidth>0&&e>i.options.lineWidth}if(p){let e=g;for(let t of h)e+=t?`\n${l}${c}${t}`:`
236
+ `;return`${e}\n${c}${_}`}else return`${g}${u}${h.join(` `)}${u}${_}`}function s({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=i})),ax=r((e=>{var t=ix(),n=nx(),r=Yb(),i=X(),a=rx(),o=qb();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),ox=r((e=>{var t=X(),n=ax();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),sx=r((e=>{var t=Jb(),n=ix(),r=Yb(),i=X(),a=qb(),o=Wb(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=c(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];i.isScalar(r)&&a.isScalarValue(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(o.toJS(e,String(r++),t));return n}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,a=new this(e);if(n&&Symbol.iterator in Object(n)){let e=0;for(let o of n){if(typeof i==`function`){let t=n instanceof Set?o:String(e++);o=i.call(n,t,o)}a.items.push(t.createNode(o,void 0,r))}}return a}};function c(e){let t=i.isScalar(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}e.YAMLSeq=s})),cx=r((e=>{var t=X(),n=sx();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),lx=r((e=>{var t=Qb();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),ux=r((e=>{var t=qb();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),dx=r((e=>{var t=qb();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),fx=r((e=>{function t({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^\d/.test(a)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}e.stringifyNumber=t})),px=r((e=>{var t=qb(),n=fx();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),mx=r((e=>{var t=fx();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),hx=r((e=>{var t=ox(),n=ux(),r=cx(),i=lx(),a=dx(),o=px(),s=mx();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),gx=r((e=>{var t=qb(),n=ox(),r=cx();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true|false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),_x=r((e=>{var t=qb(),n=Qb();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof Buffer==`function`)return Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:r,value:i},a,o,s){let c=i,l;if(typeof Buffer==`function`)l=c instanceof Buffer?c.toString(`base64`):Buffer.from(c.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<c.length;++t)e+=String.fromCharCode(c[t]);l=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(r||=t.Scalar.BLOCK_LITERAL,r!==t.Scalar.QUOTE_DOUBLE){let e=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),n=Math.ceil(l.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=l.substr(r,e);l=i.join(r===t.Scalar.BLOCK_LITERAL?`
237
+ `:` `)}return n.stringifyString({comment:e,type:r,value:l},a,o,s)}}})),vx=r((e=>{var t=X(),n=rx(),r=qb(),i=sx();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e))if(e.length===2)i=e[0],c=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),yx=r((e=>{var t=X(),n=Wb(),r=ax(),i=sx(),a=vx(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),bx=r((e=>{var t=qb();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new t.Scalar(!0),stringify:n},i={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,resolve:()=>new t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),xx=r((e=>{var t=qb(),n=fx();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),Sx=r((e=>{var t=fx();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),Cx=r((e=>{var t=X(),n=rx(),r=ax(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),wx=r((e=>{var t=fx();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,``)};e.floatTime=a,e.intTime=i,e.timestamp=o})),Tx=r((e=>{var t=ox(),n=ux(),r=cx(),i=lx(),a=_x(),o=bx(),s=xx(),c=Sx(),l=yx(),u=vx(),d=Cx(),f=wx();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.omap,u.pairs,d.set,f.intTime,f.floatTime,f.timestamp]})),Ex=r((e=>{var t=ox(),n=ux(),r=cx(),i=lx(),a=dx(),o=px(),s=mx(),c=hx(),l=gx(),u=_x(),d=yx(),f=vx(),p=Tx(),m=Cx(),h=wx();let g=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,p.schema],[`yaml-1.1`,p.schema]]),_={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:h.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:h.intTime,map:t.map,null:n.nullTag,omap:d.omap,pairs:f.pairs,seq:r.seq,set:m.set,timestamp:h.timestamp},v={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:omap":d.omap,"tag:yaml.org,2002:pairs":f.pairs,"tag:yaml.org,2002:set":m.set,"tag:yaml.org,2002:timestamp":h.timestamp};function y(e,t){let n=g.get(t);if(!n)if(Array.isArray(e))n=[];else{let e=Array.from(g.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)n=n.concat(t);else typeof e==`function`&&(n=e(n.slice()));return n.map(e=>{if(typeof e!=`string`)return e;let t=_[e];if(t)return t;let n=Object.keys(_).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag "${e}"; use one of ${n}`)})}e.coreKnownTags=v,e.getTags=y})),Dx=r((e=>{var t=X(),n=ox(),r=cx(),i=lx(),a=Ex();let o=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.merge=!!c,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),Ox=r((e=>{var t=X(),n=$b(),r=Xb();function i(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=c(e.comment);t.includes(`
238
+ `)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`);else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(`
239
+ `)+`
240
+ `}e.stringifyDocument=i})),kx=r((e=>{var t=Kb(),n=Yb(),r=X(),i=rx(),a=Wb(),o=Dx(),s=Ox(),c=Hb(),l=Ub(),u=Jb(),d=Vb(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new d.Directives({version:`1.1`}),n={merge:!0,resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new d.Directives({version:e}),n={merge:!1,resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new o.Schema(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Ax=r((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
241
+ `),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t&&t.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}}})),jx=r((e=>{function t(e,{flow:t,indicator:n,next:r,offset:i,onError:a,startOnNewline:o}){let s=!1,c=o,l=o,u=``,d=``,f=!1,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null;for(let r of e)switch(m&&=(r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),r.type){case`space`:!t&&c&&n!==`doc-start`&&r.source[0]===` `&&a(r,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),l=!0;break;case`comment`:{l||a(r,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=r.source.substring(1)||` `;u?u+=d+e:u=e,d=``,c=!1;break}case`newline`:c?u?u+=r.source:s=!0:d+=r.source,c=!0,f=!0,(h||g)&&(p=!0),l=!0;break;case`anchor`:h&&a(r,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),r.source.endsWith(`:`)&&a(r.offset+r.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),h=r,y===null&&(y=r.offset),c=!1,l=!1,m=!0;break;case`tag`:g&&a(r,`MULTIPLE_TAGS`,`A node can have at most one tag`),g=r,y===null&&(y=r.offset),c=!1,l=!1,m=!0;break;case n:(h||g)&&a(r,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${r.source} indicator`),v&&a(r,`UNEXPECTED_TOKEN`,`Unexpected ${r.source} in ${t??`collection`}`),v=r,c=!1,l=!1;break;case`comma`:if(t){_&&a(r,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),_=r,c=!1,l=!1;break}default:a(r,`UNEXPECTED_TOKEN`,`Unexpected ${r.type} token`),c=!1,l=!1}let b=e[e.length-1],x=b?b.offset+b.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),{comma:_,found:v,spaceBefore:s,comment:u,hasNewline:f,hasNewlineAfterProp:p,anchor:h,tag:g,end:x,start:y??x}}e.resolveProps=t})),Mx=r((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
242
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),Nx=r((e=>{var t=Mx();function n(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=n})),Px=r((e=>{var t=X();function n(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(n,r)=>n===r||t.isScalar(n)&&t.isScalar(r)&&n.value===r.value&&!(n.value===`<<`&&e.schema.merge);return n.some(e=>a(e.key,r))}e.mapIncludes=n})),Fx=r((e=>{var t=rx(),n=ax(),r=jx(),i=Mx(),a=Nx(),o=Px();let s=`All mapping items must start at the same column`;function c({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new(f?.nodeClass??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
243
+ `+y.comment:p.comment=y.comment);continue}(y.hasNewlineAfterProp||i.containsNewline(g))&&d(g??f[f.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else y.found?.indent!==u.indent&&d(m,`BAD_INDENT`,s);let x=y.end,S=g?e(l,g,y,d):c(l,x,f,null,y,d);l.schema.compat&&a.flowIndentCheck(u.indent,g,d),o.mapIncludes(l,p.items,S)&&d(x,`DUPLICATE_KEY`,`Map keys must be unique`);let C=r.resolveProps(_??[],{indicator:`map-value-ind`,next:v,offset:S.range[2],onError:d,startOnNewline:!g||g.type===`block-scalar`});if(m=C.end,C.found){b&&(v?.type===`block-map`&&!C.hasNewline&&d(m,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),l.options.strict&&y.start<C.found.offset-1024&&d(S.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let r=v?e(l,v,C,d):c(l,m,_,null,C,d);l.schema.compat&&a.flowIndentCheck(u.indent,v,d),m=r.range[2];let i=new t.Pair(S,r);l.options.keepSourceTokens&&(i.srcToken=n),p.items.push(i)}else{b&&d(S.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),C.comment&&(S.comment?S.comment+=`
244
+ `+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}e.resolveBlockMap=c})),Ix=r((e=>{var t=sx(),n=jx(),r=Nx();function i({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new(c?.nodeClass??t.YAMLSeq)(a.schema);a.atRoot&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||c)c&&c.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=i})),Lx=r((e=>{function t(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}e.resolveEnd=t})),Rx=r((e=>{var t=X(),n=rx(),r=ax(),i=sx(),a=Lx(),o=jx(),s=Mx(),c=Px();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new(h?.nodeClass??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1);let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
245
+ `+C.comment:v.comment=C.comment),b=C.end;continue}!g&&f.options.strict&&s.containsNewline(y)&&m(y,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(i===0)C.comma&&m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`);else if(C.comma||m(C.start,`MISSING_CHAR`,`Missing , between ${_} items`),C.comment){let e=``;loop:for(let t of h)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let n=v.items[v.items.length-1];t.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+=`
246
+ `+e:n.comment=e,C.comment=C.comment.substring(e.length+1)}}if(!g&&!x&&!C.found){let t=S?e(f,S,C,m):d(f,C.end,x,null,C,m);v.items.push(t),b=t.range[2],u(S)&&m(t.range,`BLOCK_IN_FLOW`,l)}else{let t=C.end,i=y?e(f,y,C,m):d(f,t,h,null,C,m);u(y)&&m(i.range,`BLOCK_IN_FLOW`,l);let s=o.resolveProps(x??[],{flow:_,indicator:`map-value-ind`,next:S,offset:i.range[2],onError:m,startOnNewline:!1});if(s.found){if(!g&&!C.found&&f.options.strict){if(x)for(let e of x){if(e===s.found)break;if(e.type===`newline`){m(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}C.start<s.found.offset-1024&&m(s.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else S&&(`source`in S&&S.source&&S.source[0]===`:`?m(S,`MISSING_CHAR`,`Missing space after : in ${_}`):m(s.start,`MISSING_CHAR`,`Missing , or : between ${_} items`));let p=S?e(f,S,s,m):s.found?d(f,s.end,x,null,s,m):null;p?u(S)&&m(p.range,`BLOCK_IN_FLOW`,l):s.comment&&(i.comment?i.comment+=`
247
+ `+s.comment:i.comment=s.comment);let w=new n.Pair(i,p);if(f.options.keepSourceTokens&&(w.srcToken=a),g){let e=v;c.mapIncludes(f,e.items,i)&&m(t,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(w)}else{let e=new r.YAMLMap(f.schema);e.flow=!0,e.items.push(w),v.items.push(e)}b=p?p.range[2]:s.end}}let x=g?`}`:`]`,[S,...C]=p.end,w=b;if(S&&S.source===x)w=S.offset+S.source.length;else{let e=_[0].toUpperCase()+_.substring(1),t=y?`${e} must end with a ${x}`:`${e} in block collection must be sufficiently indented and end with a ${x}`;m(b,y?`MISSING_CHAR`:`BAD_INDENT`,t),S&&S.source.length!==1&&C.unshift(S)}if(C.length>0){let e=a.resolveEnd(C,w,f.options.strict,m);e.comment&&(v.comment?v.comment+=`
248
+ `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),zx=r((e=>{var t=X(),n=qb(),r=ax(),i=sx(),a=Fx(),o=Ix(),s=Rx();function c(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function l(e,a,o,s,l){let u=s?a.directives.tagName(s.source,e=>l(s,`TAG_RESOLVE_FAILED`,e)):null,d=o.type===`block-map`?`map`:o.type===`block-seq`?`seq`:o.start.source===`{`?`map`:`seq`;if(!s||!u||u===`!`||u===r.YAMLMap.tagName&&d===`map`||u===i.YAMLSeq.tagName&&d===`seq`||!d)return c(e,a,o,l,u);let f=a.schema.tags.find(e=>e.tag===u&&e.collection===d);if(!f){let t=a.schema.knownTags[u];if(t&&t.collection===d)a.schema.tags.push(Object.assign({},t,{default:!1})),f=t;else return t?.collection?l(s,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${d} collection, but expects ${t.collection}`,!0):l(s,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${u}`,!0),c(e,a,o,l,u)}let p=c(e,a,o,l,u,f),m=f.resolve?.(p,e=>l(s,`TAG_RESOLVE_FAILED`,e),a.options)??p,h=t.isNode(m)?m:new n.Scalar(m);return h.range=p.range,h.tag=u,f?.format&&(h.format=f.format),h}e.composeCollection=l})),Bx=r((e=>{var t=qb();function n(e,n,a){let o=e.offset,s=r(e,n,a);if(!s)return{value:``,type:null,comment:``,range:[o,o,o]};let c=s.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,l=e.source?i(e.source):[],u=l.length;for(let e=l.length-1;e>=0;--e){let t=l[e][1];if(t===``||t===`\r`)u=e;else break}if(u===0){let t=s.chomp===`+`&&l.length>0?`
249
+ `.repeat(Math.max(1,l.length-1)):``,n=o+s.length;return e.source&&(n+=e.source.length),{value:t,type:c,comment:s.comment,range:[o,n,n]}}let d=e.indent+s.indent,f=e.offset+s.length,p=0;for(let e=0;e<u;++e){let[t,n]=l[e];if(n===``||n===`\r`)s.indent===0&&t.length>d&&(d=t.length);else{t.length<d&&a(f+t.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),s.indent===0&&(d=t.length),p=e;break}f+=t.length+n.length+1}for(let e=l.length-1;e>=u;--e)l[e][0].length>d&&(u=e+1);let m=``,h=``,g=!1;for(let e=0;e<p;++e)m+=l[e][0].slice(d)+`
250
+ `;for(let e=p;e<u;++e){let[n,r]=l[e];f+=n.length+r.length+1;let i=r[r.length-1]===`\r`;if(i&&(r=r.slice(0,-1)),r&&n.length<d){let e=`Block scalar lines must not be less indented than their ${s.indent?`explicit indentation indicator`:`first line`}`;a(f-r.length-(i?2:1),`BAD_INDENT`,e),n=``}c===t.Scalar.BLOCK_LITERAL?(m+=h+n.slice(d)+r,h=`
251
+ `):n.length>d||r[0]===` `?(h===` `?h=`
252
+ `:!g&&h===`
253
+ `&&(h=`
254
+
255
+ `),m+=h+n.slice(d)+r,h=`
256
+ `,g=!0):r===``?h===`
257
+ `?m+=`
258
+ `:h=`
259
+ `:(m+=h+r,h=` `,g=!1)}switch(s.chomp){case`-`:break;case`+`:for(let e=u;e<l.length;++e)m+=`
260
+ `+l[e][0].slice(d);m[m.length-1]!==`
261
+ `&&(m+=`
262
+ `);break;default:m+=`
263
+ `}let _=o+s.length+e.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function i(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}e.resolveBlockScalar=n})),Vx=r((e=>{var t=qb(),n=Lx();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;default:return o(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),o(e)}function a(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),o(e.slice(1,-1)).replace(/''/g,`'`)}function o(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
264
+ `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
265
+ `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
266
+ `?i+=a:a=`
267
+ `:(i+=a+r[1],a=` `),o=n.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,r=s.exec(e),i+a+(r?.[1]??``)}function s(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(!(i===`\r`&&e[r+1]===`
268
+ `))if(i===`
269
+ `){let{fold:t,offset:i}=c(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=l[i];if(a)n+=a;else if(i===`
270
+ `)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
271
+ `)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a={x:2,u:4,U:8}[i];n+=u(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
272
+ `&&!(a===`\r`&&e[r+2]===`
273
+ `)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function c(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
274
+ `||r===`\r`)&&!(r===`\r`&&e[t+2]!==`
275
+ `);)r===`
276
+ `&&(n+=`
277
+ `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}let l={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
278
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}e.resolveFlowScalar=r})),Hx=r((e=>{var t=X(),n=qb(),r=Bx(),i=Vx();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(a,e.options.strict,l):i.resolveFlowScalar(a,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h=c&&m?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR],g;try{let r=h.resolve(u,e=>l(c??a,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??a,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}function o(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(t.default&&t.test)o.push(t);else return t;for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function s({directives:e,schema:n},r,i,a){let o=n.tags.find(e=>e.default&&e.test?.test(r))||n[t.SCALAR];if(n.compat){let s=n.compat.find(e=>e.default&&e.test?.test(r))??n[t.SCALAR];o.tag!==s.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${e.tagString(o.tag)} or ${e.tagString(s.tag)}`,!0)}return o}e.composeScalar=a})),Ux=r((e=>{function t(e,t,n){if(t){n===null&&(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}e.emptyScalarPosition=t})),Wx=r((e=>{var t=Kb(),n=zx(),r=Hx(),i=Lx(),a=Ux();let o={composeNode:s,composeEmptyNode:c};function s(e,t,i,a){let{spaceBefore:s,comment:u,anchor:d,tag:f}=i,p,m=!0;switch(t.type){case`alias`:p=l(e,t,a),(d||f)&&a(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:p=r.composeScalar(e,t,f,a),d&&(p.anchor=d.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:p=n.composeCollection(o,e,t,f,a),d&&(p.anchor=d.source.substring(1));break;default:a(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),p=c(e,t.offset,void 0,null,i,a),m=!1}return d&&p.anchor===``&&a(d,`BAD_ALIAS`,`Anchor cannot be an empty string`),s&&(p.spaceBefore=!0),u&&(t.type===`scalar`&&t.source===``?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&m&&(p.srcToken=t),p}function c(e,t,n,i,{spaceBefore:o,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:a.emptyScalarPosition(t,n,i),indent:-1,source:``},p=r.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),o&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function l({options:e},{offset:n,source:r,end:a},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=i.resolveEnd(a,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=c,e.composeNode=s})),Gx=r((e=>{var t=kx(),n=Wx(),r=Lx(),i=jx();function a(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}e.composeDoc=a})),Kx=r((e=>{var t=Vb(),n=kx(),r=Ax(),i=X(),a=Gx(),o=Lx();function s(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function c(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
279
+
280
+ `:`
281
+ `)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}e.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,i)=>{let a=s(e);i?this.warnings.push(new r.YAMLWarning(a,t,n)):this.errors.push(new r.YAMLParseError(a,t,n))},this.directives=new t.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=c(this.prelude);if(n){let a=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!a)e.commentBefore=n;else if(i.isCollection(a)&&!a.flow&&a.items.length>0){let e=a.items[0];i.isPair(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=a.commentBefore;a.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:c(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(process.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=s(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=a.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new r.YAMLParseError(s(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new r.YAMLParseError(s(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=o.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new r.YAMLParseError(s(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=Object.assign({_directives:this.directives},this.options),r=new n.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),r.range=[0,t,t],this.decorate(r,!1),yield r}}}})),qx=r((e=>{var t=Bx(),n=Vx(),r=Ax(),i=Qb();function a(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar(e,i,o)}}return null}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:`
282
+ `}];switch(c[0]){case`|`:case`>`:{let e=c.indexOf(`
283
+ `),t=c.substring(0,e),n=c.substring(e+1)+`
284
+ `,i=[{type:`block-scalar-header`,offset:o,indent:r,source:t}];return l(i,u)||i.push({type:`newline`,offset:-1,indent:r,source:`
285
+ `}),{type:`block-scalar`,offset:o,indent:r,props:i,source:n}}case`"`:return{type:`double-quoted-scalar`,offset:o,indent:r,source:c,end:u};case`'`:return{type:`single-quoted-scalar`,offset:o,indent:r,source:c,end:u};default:return{type:`scalar`,offset:o,indent:r,source:c,end:u}}}function s(e,t,n={}){let{afterKey:r=!1,implicitKey:a=!1,inFlow:o=!1,type:s}=n,l=`indent`in e?e.indent:null;if(r&&typeof l==`number`&&(l+=2),!s)switch(e.type){case`single-quoted-scalar`:s=`QUOTE_SINGLE`;break;case`double-quoted-scalar`:s=`QUOTE_DOUBLE`;break;case`block-scalar`:{let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);s=t.source[0]===`>`?`BLOCK_FOLDED`:`BLOCK_LITERAL`;break}default:s=`PLAIN`}let d=i.stringifyString({type:s,value:t},{implicitKey:a||l===null,indent:l!==null&&l>0?` `.repeat(l):``,inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(d[0]){case`|`:case`>`:c(e,d);break;case`"`:u(e,d,`double-quoted-scalar`);break;case`'`:u(e,d,`single-quoted-scalar`);break;default:u(e,d,`scalar`)}}function c(e,t){let n=t.indexOf(`
286
+ `),r=t.substring(0,n),i=t.substring(n+1)+`
287
+ `;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];l(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
288
+ `});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function l(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function u(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
289
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),Jx=r((e=>{let t=e=>`type`in e?n(e):r(e);function n(e){switch(e.type){case`block-scalar`:{let t=``;for(let r of e.props)t+=n(r);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=r(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=r(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=r(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function r({start:e,key:t,sep:r,value:i}){let a=``;for(let t of e)a+=t.source;if(t&&(a+=n(t)),r)for(let e of r)a+=e.source;return i&&(a+=n(i)),a}e.stringify=t})),Yx=r((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function i(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),a(Object.freeze([]),e,t)}i.BREAK=t,i.SKIP=n,i.REMOVE=r,i.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},i.parentCollection=(e,t)=>{let n=i.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&`items`in a)return a;throw Error(`Parent collection not found`)};function a(e,n,i){let o=i(n,e);if(typeof o==`symbol`)return o;for(let s of[`key`,`value`]){let c=n[s];if(c&&`items`in c){for(let n=0;n<c.items.length;++n){let o=a(Object.freeze(e.concat([[s,n]])),c.items[n],i);if(typeof o==`number`)n=o-1;else if(o===t)return t;else o===r&&(c.items.splice(n,1),--n)}typeof o==`function`&&s===`key`&&(o=o(n,e))}}return typeof o==`function`?o(n,e):o}e.visit=i})),Xx=r((e=>{var t=qx(),n=Jx(),r=Yx();let i=e=>!!e&&`items`in e,a=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function o(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function s(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
290
+ `:case`\r
291
+ `:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),Zx=r((e=>{var t=Xx();function n(e){switch(e){case void 0:case` `:case`
292
+ `:case`\r`:case` `:return!0;default:return!1}}let r=`0123456789ABCDEFabcdef`.split(``),i=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`.split(``),a=`,[]{}`.split(``),o=` ,[]{}
293
+ \r `.split(``),s=e=>!e||o.includes(e);e.Lexer=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){e&&(this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null),this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
294
+ `?!0:t===`\r`?this.buffer[e+1]===`
295
+ `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
296
+ `||!t&&!this.atEnd)return e+n+1}return t===`
297
+ `||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&n(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
298
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===t.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);if(n!==-1){let r=e[n-1];(r===` `||r===` `)&&(t=n-1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield t.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if(e===`---`&&n(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,`doc`;if(e===`...`&&n(this.charAt(3)))return yield*this.pushCount(3),`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!n(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&n(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*this.parseBlockStart()}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(s),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let a=this.getLine();if(a===null)return this.setNext(`flow`);if((i!==-1&&i<this.indentNext&&a[0]!==`#`||i===0&&(a.startsWith(`---`)||a.startsWith(`...`))&&n(a[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(a[0]===`]`||a[0]===`}`)))return this.flowLevel=0,yield t.FLOW_END,yield*this.parseLineStart();let o=0;for(;a[o]===`,`;)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),a[o]){case void 0:return`flow`;case`#`:return yield*this.pushCount(a.length-o),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(s),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||n(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
299
+ `,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
300
+ `,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>n(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,n=0,r;loop:for(let t=this.pos;r=this.buffer[t];++t)switch(r){case` `:n+=1;break;case`
301
+ `:e=t,n=0;break;case`\r`:{let e=this.buffer[t+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
302
+ `)break}default:break loop}if(!r&&!this.atEnd)return this.setNext(`block-scalar`);if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
303
+ `,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}if(!this.blockScalarKeep)do{let t=e-1,r=this.buffer[t];r===`\r`&&(r=this.buffer[--t]);let i=t;for(;r===` `||r===` `;)r=this.buffer[--t];if(r===`
304
+ `&&t>=this.pos&&t+1+n>i)e=t;else break}while(!0);return yield t.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,o;for(;o=this.buffer[++i];)if(o===`:`){let t=this.buffer[i+1];if(n(t)||e&&t===`,`)break;r=i}else if(n(o)){let t=this.buffer[i+1];if(o===`\r`&&(t===`
305
+ `?(i+=1,o=`
306
+ `,t=this.buffer[i+1]):r=i),t===`#`||e&&a.includes(t))break;if(o===`
307
+ `){let e=this.continueScalar(i+1);if(e===-1)break;i=Math.max(i,e-2)}}else{if(e&&a.includes(o))break;r=i}return!o&&!this.atEnd?this.setNext(`plain-scalar`):(yield t.SCALAR,yield*this.pushToIndex(r+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(s))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(n(t)||e&&a.includes(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!n(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(i.includes(t))t=this.buffer[++e];else if(t===`%`&&r.includes(this.buffer[e+1])&&r.includes(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
308
+ `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
309
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}})),Qx=r((e=>{e.LineCounter=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}})),$x=r((e=>{var t=Xx(),n=Zx();function r(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function i(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function a(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function o(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function s(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function c(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!r(t.start,`explicit-key-ind`)&&!r(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,a(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}e.Parser=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new n.Lexer,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,process.env.LOG_TOKENS&&console.log(`|`,t.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=t.tokenType(e);if(n)if(n===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=n,yield*this.step(),n){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&(!e||e.type!==`doc-end`)){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&c(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!r(n.start,`explicit-key-ind`);return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&i(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:i(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=s(o(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
310
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
311
+ `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent&&t.sep&&this.type!==`seq-item-ind`,i=[];if(n&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:n||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!r(t.start,`explicit-key-ind`)?t.start.push(this.sourceToken):n||t.value?(i.push(this.sourceToken),e.items.push({start:i})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(r(t.start,`explicit-key-ind`))if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(r(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(a(t.key)&&!r(t.sep,`newline`)){let e=s(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(r(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=s(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||n?e.items.push({start:i,key:null,sep:[this.sourceToken]}):r(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let r=this.flowScalar(this.type);n||t.value?(e.items.push({start:i,key:r,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(r):(Object.assign(t,{key:r,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){n&&a.type!==`block-seq`&&r(t.start,`explicit-key-ind`)&&e.items.push({start:i}),this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||r(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e&&e.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=s(o(t));c(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
312
+ `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
313
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=s(o(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=s(o(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;case`space`:case`comment`:default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),eS=r((e=>{var t=Kx(),n=kx(),r=Ax(),i=tx(),a=Qx(),o=$x();function s(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new a.LineCounter||null,prettyErrors:t}}function c(e,n={}){let{lineCounter:i,prettyErrors:a}=s(n),c=new o.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(c.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=s(n),c=new o.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(c.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function u(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=l(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function d(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return new n.Document(e,i,r).toString(r)}e.parse=u,e.parseAllDocuments=c,e.parseDocument=l,e.stringify=d})),tS=r((e=>{var t=Kx(),n=kx(),r=Dx(),i=Ax(),a=Kb(),o=X(),s=rx(),c=qb(),l=ax(),u=sx(),d=Xx(),f=Zx(),p=Qx(),m=$x(),h=eS(),g=Bb();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.CST=d,e.Lexer=f.Lexer,e.LineCounter=p.LineCounter,e.Parser=m.Parser,e.parse=h.parse,e.parseAllDocuments=h.parseAllDocuments,e.parseDocument=h.parseDocument,e.stringify=h.stringify,e.visit=g.visit,e.visitAsync=g.visitAsync})),nS=r((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.overwriteConfigForDBOSCloud=t.translateRuntimeConfig=t.getRuntimeConfig=t.translateDbosConfig=t.getDbosConfig=t.getSystemDatabaseUrl=t.isValidDatabaseName=t.writeConfigFile=t.readConfigFile=t.substituteEnvVars=t.dbosConfigFilePath=void 0;let r=gy(),i=n(tS()),a=e(`fs`),o=n(e(`path`)),s=n(e(`assert`)),c=Eb();t.dbosConfigFilePath=`dbos-config.yaml`;function l(e){return e.replace(/\${([^}]+)}/g,(e,t)=>process.env[t]||`""`)}t.substituteEnvVars=l;function u(e){e??=process.cwd();let n=s(o.default.join(e,t.dbosConfigFilePath)),a=n?i.default.parse(l(n)):{};if(!a.name){let t=s(o.default.join(e,`package.json`));a.name=(t?JSON.parse(t):{}).name}return a;function s(e){try{return(0,r.readFileSync)(e)}catch(e){if(e&&typeof e==`object`&&`code`in e&&e.code===`ENOENT`)return;throw e}}}t.readConfigFile=u;function d(e,t){try{let n=i.default.stringify(e);(0,a.writeFileSync)(t,n)}catch(e){throw e instanceof Error?Error(`Failed to write config to ${t}: ${e.message}`):e}}t.writeConfigFile=d;function f(e){return!(e.length<1||e.length>63)}t.isValidDatabaseName=f;function p(e){let t=e.system_database_url||a(e.name),n=new URL(t),r=n.pathname.slice(1),i=[];if(n.username||i.push(`username`),n.hostname||i.push(`hostname`),r||i.push(`database name`),i.length>0)throw Error(`Invalid database URL: missing required field(s): ${i.join(`, `)}`);if(!f(r))throw Error(`Database name "${r}" in database_url ${(0,c.maskDatabaseUrl)(t)} is invalid.`);if(process.env.DBOS_DEBUG_WORKFLOW_ID!==void 0)return n.hostname=process.env.DBOS_DBHOST||n.hostname,n.port=process.env.DBOS_DBPORT||n.port,n.username=process.env.DBOS_DBUSER||n.username,n.password=process.env.DBOS_DBPASSWORD||n.password,n.toString();return t;function a(e){(0,s.default)(e,`Application name must be defined to construct a valid database URL.`);let t=process.env.PGHOST||`localhost`,n=process.env.PGPORT||`5432`,r=process.env.PGUSER||`postgres`,i=process.env.PGPASSWORD||`dbos`,a=o(e)+`_dbos_sys`,c=process.env.PGCONNECT_TIMEOUT||`10`,l=process.env.PGSSLMODE||(t===`localhost`?`disable`:`allow`),u=new URL(`postgresql://host/database`);return u.username=r,u.password=i,u.hostname=t,u.port=n,u.protocol=`postgresql`,u.pathname=`/${a}`,u.searchParams.set(`connect_timeout`,c),u.searchParams.set(`sslmode`,l),u.toString()}function o(e){let t=e.toLowerCase().replaceAll(`-`,`_`).replaceAll(` `,`_`);return t.match(/^\d/)?`_`+t:t}}t.getSystemDatabaseUrl=p;function m(e,t={}){return(0,s.default)(e.language===void 0||e.language===`node`,`Config file specifies invalid language ${e.language}`),g({name:e.name,systemDatabaseUrl:e.system_database_url,systemDatabaseSchemaName:e.system_database_schema_name,logLevel:t.logLevel??e.telemetry?.logs?.logLevel,addContextMetadata:e.telemetry?.logs?.addContextMetadata,otlpTracesEndpoints:h(e.telemetry?.OTLPExporter?.tracesEndpoint),otlpLogsEndpoints:h(e.telemetry?.OTLPExporter?.logsEndpoint),runAdminServer:e.runtimeConfig?.runAdminServer,adminPort:e.runtimeConfig?.admin_port},t.forceConsole)}t.getDbosConfig=m;function h(e){return e?Array.isArray(e)?e:[e]:[]}function g(e,t=!1){let n=p({system_database_url:e.systemDatabaseUrl,name:e.name});return{name:e.name,systemDatabaseUrl:n,sysDbPoolSize:e.systemDatabasePoolSize,systemDatabasePool:e.systemDatabasePool,systemDatabaseSchemaName:e.systemDatabaseSchemaName??`dbos`,telemetry:{logs:{logLevel:e.logLevel||`info`,addContextMetadata:e.addContextMetadata,forceConsole:t},OTLPExporter:{tracesEndpoint:e.otlpTracesEndpoints,logsEndpoint:e.otlpLogsEndpoints}}}}t.translateDbosConfig=g;function _(e){return v(e.runtimeConfig)}t.getRuntimeConfig=_;function v(e={}){return{runAdminServer:e.runAdminServer??!0,admin_port:e.admin_port??e.adminPort??3001,start:e.start??[],setup:e.setup??[]}}t.translateRuntimeConfig=v;function y(e,t,n){let r=process.env.DBOS_SYSTEM_DATABASE_URL;(0,s.default)(r,`DBOS_SYSTEM_DATABASE_URL must be set in DBOS Cloud environment`);let i=n.name??e.name,a=new Set(e.telemetry.OTLPExporter?.logsEndpoint),o=n.telemetry?.OTLPExporter?.logsEndpoint;o&&(Array.isArray(o)?o.forEach(e=>a.add(e)):a.add(o));let c=new Set(e.telemetry.OTLPExporter?.tracesEndpoint),l=n.telemetry?.OTLPExporter?.tracesEndpoint;return l&&(Array.isArray(l)?l.forEach(e=>c.add(e)):c.add(l)),[{...e,name:i,systemDatabaseUrl:r,systemDatabaseSchemaName:n.system_database_schema_name??e.systemDatabaseSchemaName,telemetry:{logs:{...e.telemetry.logs},OTLPExporter:{logsEndpoint:Array.from(a).filter(e=>!!e),tracesEndpoint:Array.from(c).filter(e=>!!e)}}},{...t,admin_port:3001,runAdminServer:!0}]}t.overwriteConfigForDBOSCloud=y})),rS=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RetentionResponse=e.RetentionRequest=e.ForkWorkflowResponse=e.ForkWorkflowRequest=e.ListStepsResponse=e.ListStepsRequest=e.ExistPendingWorkflowsResponse=e.ExistPendingWorkflowsRequest=e.GetWorkflowResponse=e.GetWorkflowRequest=e.ListQueuedWorkflowsResponse=e.ListQueuedWorkflowsRequest=e.ListWorkflowsResponse=e.ListWorkflowsRequest=e.WorkflowSteps=e.WorkflowsOutput=e.RestartResponse=e.RestartRequest=e.ResumeResponse=e.ResumeRequest=e.CancelResponse=e.CancelRequest=e.RecoveryResponse=e.RecoveryRequest=e.ExecutorInfoResponse=e.BaseResponse=e.MessageType=void 0;let t=jb();var n;(function(e){e.EXECUTOR_INFO=`executor_info`,e.RECOVERY=`recovery`,e.CANCEL=`cancel`,e.LIST_WORKFLOWS=`list_workflows`,e.LIST_QUEUED_WORKFLOWS=`list_queued_workflows`,e.RESUME=`resume`,e.RESTART=`restart`,e.GET_WORKFLOW=`get_workflow`,e.EXIST_PENDING_WORKFLOWS=`exist_pending_workflows`,e.LIST_STEPS=`list_steps`,e.FORK_WORKFLOW=`fork_workflow`,e.RETENTION=`retention`})(n||(e.MessageType=n={}));var r=class{type;request_id;error_message;constructor(e,t,n){this.type=e,this.request_id=t,this.error_message=n}};e.BaseResponse=r,e.ExecutorInfoResponse=class extends r{executor_id;application_version;hostname;constructor(e,t,r,i,a){super(n.EXECUTOR_INFO,e,a),this.executor_id=t,this.application_version=r,this.hostname=i}},e.RecoveryRequest=class{type=n.RECOVERY;request_id;executor_ids;constructor(e,t){this.request_id=e,this.executor_ids=t}},e.RecoveryResponse=class extends r{success;constructor(e,t,r){super(n.RECOVERY,e,r),this.success=t}},e.CancelRequest=class{type=n.CANCEL;request_id;workflow_id;constructor(e,t){this.request_id=e,this.workflow_id=t}},e.CancelResponse=class extends r{success;constructor(e,t,r){super(n.CANCEL,e,r),this.success=t}},e.ResumeRequest=class{type=n.RESUME;request_id;workflow_id;constructor(e,t){this.request_id=e,this.workflow_id=t}},e.ResumeResponse=class extends r{success;constructor(e,t,r){super(n.RESUME,e,r),this.success=t}},e.RestartRequest=class{type=n.RESTART;request_id;workflow_id;constructor(e,t){this.request_id=e,this.workflow_id=t}},e.RestartResponse=class extends r{success;constructor(e,t,r){super(n.RESTART,e,r),this.success=t}},e.WorkflowsOutput=class{WorkflowUUID;Status;WorkflowName;WorkflowClassName;WorkflowConfigName;AuthenticatedUser;AssumedRole;AuthenticatedRoles;Input;Output;Request;Error;CreatedAt;UpdatedAt;QueueName;ApplicationVersion;ExecutorID;WorkflowTimeoutMS;WorkflowDeadlineEpochMS;DeduplicationID;Priority;QueuePartitionKey;ForkedFrom;constructor(e){this.WorkflowUUID=e.workflowID,this.Status=e.status,this.WorkflowName=e.workflowName,this.WorkflowClassName=e.workflowClassName?e.workflowClassName:void 0,this.WorkflowConfigName=e.workflowConfigName?e.workflowConfigName:void 0,this.AuthenticatedUser=e.authenticatedUser?e.authenticatedUser:void 0,this.AssumedRole=e.assumedRole?e.assumedRole:void 0,this.AuthenticatedRoles=(e.authenticatedRoles??[]).length>0?JSON.stringify(e.authenticatedRoles):void 0,this.Input=e.input?JSON.stringify(e.input):void 0,this.Output=e.output?JSON.stringify(e.output):void 0,this.Request=e.request?JSON.stringify(e.request):void 0,this.Error=e.error?JSON.stringify((0,t.serializeError)(e.error)):void 0,this.CreatedAt=e.createdAt?String(e.createdAt):void 0,this.UpdatedAt=e.updatedAt?String(e.updatedAt):void 0,this.QueueName=e.queueName?e.queueName:void 0,this.ApplicationVersion=e.applicationVersion,this.ExecutorID=e.executorId,this.WorkflowTimeoutMS=e.timeoutMS===void 0?void 0:String(e.timeoutMS),this.WorkflowDeadlineEpochMS=e.deadlineEpochMS===void 0?void 0:String(e.deadlineEpochMS),this.DeduplicationID=e.deduplicationID,this.Priority=String(e.priority),this.QueuePartitionKey=e.queuePartitionKey,this.ForkedFrom=e.forkedFrom}},e.WorkflowSteps=class{function_id;function_name;output;error;child_workflow_id;started_at_epoch_ms;completed_at_epoch_ms;constructor(e){this.function_id=e.functionID,this.function_name=e.name,this.output=e.output?JSON.stringify(e.output):void 0,this.error=e.error?JSON.stringify((0,t.serializeError)(e.error)):void 0,this.child_workflow_id=e.childWorkflowID??void 0,this.started_at_epoch_ms=e.startedAtEpochMs===void 0?void 0:String(e.startedAtEpochMs),this.completed_at_epoch_ms=e.completedAtEpochMs===void 0?void 0:String(e.completedAtEpochMs)}},e.ListWorkflowsRequest=class{type=n.LIST_WORKFLOWS;request_id;body;constructor(e,t){this.request_id=e,this.body=t}},e.ListWorkflowsResponse=class extends r{output;constructor(e,t,r){super(n.LIST_WORKFLOWS,e,r),this.output=t}},e.ListQueuedWorkflowsRequest=class{type=n.LIST_QUEUED_WORKFLOWS;request_id;body;constructor(e,t){this.request_id=e,this.body=t}},e.ListQueuedWorkflowsResponse=class extends r{output;constructor(e,t,r){super(n.LIST_QUEUED_WORKFLOWS,e,r),this.output=t}},e.GetWorkflowRequest=class{type=n.GET_WORKFLOW;request_id;workflow_id;constructor(e,t){this.request_id=e,this.workflow_id=t}},e.GetWorkflowResponse=class extends r{output;constructor(e,t,r){super(n.GET_WORKFLOW,e,r),this.output=t}},e.ExistPendingWorkflowsRequest=class{type=n.EXIST_PENDING_WORKFLOWS;request_id;executor_id;application_version;constructor(e,t,n){this.request_id=e,this.executor_id=t,this.application_version=n}},e.ExistPendingWorkflowsResponse=class extends r{exist;constructor(e,t,r){super(n.EXIST_PENDING_WORKFLOWS,e,r),this.exist=t}},e.ListStepsRequest=class{type=n.LIST_STEPS;request_id;workflow_id;constructor(e,t){this.request_id=e,this.workflow_id=t}},e.ListStepsResponse=class extends r{output;constructor(e,t,r){super(n.LIST_STEPS,e,r),this.output=t}},e.ForkWorkflowRequest=class{type=n.FORK_WORKFLOW;request_id;body;constructor(e,t){this.request_id=e,this.body=t}},e.ForkWorkflowResponse=class extends r{new_workflow_id;constructor(e,t,r){super(n.FORK_WORKFLOW,e,r),this.new_workflow_id=t}},e.RetentionRequest=class{type=n.RETENTION;request_id;body;constructor(e,t){this.request_id=e,this.body=t}},e.RetentionResponse=class extends r{success;constructor(e,t,r){super(n.RETENTION,e,r),this.success=t}}})),iS=r((t=>{var n=t&&t.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=t&&t.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t};Object.defineProperty(t,`__esModule`,{value:!0}),t.DBOSAdminServer=t.WorkflowQueuesMetadataUrl=t.DeactivateUrl=t.PerfUrl=t.HealthUrl=t.WorkflowRecoveryUrl=t.WorkflowUUIDHeader=void 0;let a=i(e(`http`)),o=i(e(`url`)),s=ny(),c=i(e(`net`)),l=e(`perf_hooks`),u=gy(),d=Nb(),f=Ib(),p=i(rS());t.WorkflowUUIDHeader=`dbos-idempotency-key`,t.WorkflowRecoveryUrl=`/dbos-workflow-recovery`,t.HealthUrl=`/dbos-healthz`,t.PerfUrl=`/dbos-perf`,t.DeactivateUrl=`/deactivate`,t.WorkflowQueuesMetadataUrl=`/dbos-workflow-queues-metadata`;async function m(e){return new Promise((t,n)=>{let r=``;e.on(`data`,e=>{r+=String(e)}),e.on(`end`,()=>{try{t(r?JSON.parse(r):{})}catch{n(Error(`Invalid JSON`))}}),e.on(`error`,n)})}function h(e,t,n){e.writeHead(t,{"Content-Type":`application/json`,"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`GET, POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`}),e.end(JSON.stringify(n))}function g(e,t,n){e.writeHead(t,{"Content-Type":`text/plain`,"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`GET, POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`}),e.end(n)}function _(e){e.writeHead(204,{"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`GET, POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`}),e.end()}function v(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==r.length)return null;let i={};for(let e=0;e<n.length;e++){let t=n[e],a=r[e];if(t.startsWith(`:`)){let e=t.substring(1);i[e]=a}else if(t!==a)return null}return i}t.DBOSAdminServer=class e{static setupAdminApp(t){let n=[];return e.registerHealthEndpoint(t,n),e.registerRecoveryEndpoint(t,n),e.registerPerfEndpoint(t,n),e.registerDeactivateEndpoint(t,n),e.registerCancelWorkflowEndpoint(t,n),e.registerResumeWorkflowEndpoint(t,n),e.registerRestartWorkflowEndpoint(t,n),e.registerQueueMetadataEndpoint(t,n),e.registerListWorkflowStepsEndpoint(t,n),e.registerListWorkflowsEndpoint(t,n),e.registerListQueuedWorkflowsEndpoint(t,n),e.registerGetWorkflowEndpoint(t,n),e.registerForkWorkflowEndpoint(t,n),e.registerGarbageCollectEndpoint(t,n),e.registerGlobalTimeoutEndpoint(t,n),a.createServer(async(e,r)=>{if(e.method===`OPTIONS`){r.writeHead(200,{"Access-Control-Allow-Origin":`*`,"Access-Control-Allow-Methods":`GET, POST, OPTIONS`,"Access-Control-Allow-Headers":`Content-Type`,"Access-Control-Max-Age":`86400`}),r.end();return}let i=o.parse(e.url||``,!0).pathname||``,a=!1;for(let o of n)if(e.method===o.method){let n=v(o.path,i);if(n!==null){a=!0;try{await o.handler(e,r,n)}catch(e){t.logger.error(`Request handler error: ${String(e)}`),h(r,500,{error:`Internal server error`})}break}}a||(r.writeHead(404,{"Content-Type":`text/plain`}),r.end(`Not Found`))})}static async checkPortAvailabilityIPv4Ipv6(e,t){try{await this.checkPortAvailability(e,`127.0.0.1`)}catch(n){let r=n;if(r.code===`EADDRINUSE`)throw t.warn(`Port ${e} is already used for IPv4 address "127.0.0.1". Please use the -p option to choose another port.\n${r.message}`),n;t.warn(`Error occurred while checking port availability for IPv4 address "127.0.0.1" : ${r.code}\n${r.message}`)}try{await this.checkPortAvailability(e,`::1`)}catch(n){let r=n;if(r.code===`EADDRINUSE`)throw t.warn(`Port ${e} is already used for IPv6 address "::1". Please use the -p option to choose another port.\n${r.message}`),n;t.warn(`Error occurred while checking port availability for IPv6 address "::1" : ${r.code}\n${r.message}`)}}static async checkPortAvailability(e,t){return new Promise((n,r)=>{let i=new c.Server;i.on(`error`,e=>{r(e)}),i.on(`listening`,()=>{i.close(),n()}),i.listen({port:e,host:t},()=>{n()})})}static registerHealthEndpoint(e,n){n.push({method:`GET`,path:t.HealthUrl,handler:async(e,t)=>(g(t,200,`healthy`),Promise.resolve())}),e.logger.debug(`DBOS Server Registered Healthz GET ${t.HealthUrl}`)}static registerQueueMetadataEndpoint(e,n){n.push({method:`GET`,path:t.WorkflowQueuesMetadataUrl,handler:async(e,t)=>{let n=[];return d.wfQueueRunner.wfQueuesByName.forEach((e,t)=>{n.push({name:t,concurrency:e.concurrency,workerConcurrency:e.workerConcurrency,rateLimit:e.rateLimit})}),h(t,200,n),Promise.resolve()}}),e.logger.debug(`DBOS Server Registered Queue Metadata GET ${t.WorkflowQueuesMetadataUrl}`)}static registerRecoveryEndpoint(e,n){n.push({method:`POST`,path:t.WorkflowRecoveryUrl,handler:async(t,n)=>{let r=await m(t);e.logger.info(`Recovering workflows for executors: `+r.toString());let i=await e.recoverPendingWorkflows(r);h(n,200,await Promise.allSettled(i.map(e=>e.workflowID)).then(e=>e.filter(e=>e.status===`fulfilled`).map(e=>e.value)))}}),e.logger.debug(`DBOS Server Registered Recovery POST ${t.WorkflowRecoveryUrl}`)}static lastELU=l.performance.eventLoopUtilization();static registerPerfEndpoint(n,r){r.push({method:`GET`,path:t.PerfUrl,handler:async(t,n)=>{let r=l.performance.eventLoopUtilization();return h(n,200,l.performance.eventLoopUtilization(r,e.lastELU)),e.lastELU=r,Promise.resolve()}}),n.logger.debug(`DBOS Server Registered Perf GET ${t.PerfUrl}`)}static isDeactivated=!1;static registerDeactivateEndpoint(n,r){r.push({method:`GET`,path:t.DeactivateUrl,handler:async(t,r)=>{e.isDeactivated||=(n.logger.info(`Deactivating DBOS executor ${u.globalParams.executorID} with version ${u.globalParams.appVersion}. This executor will complete existing workflows but will not create new workflows.`),!0),await n.deactivateEventReceivers(!1),g(r,200,`Deactivated`)}}),n.logger.debug(`DBOS Server Registered Deactivate GET ${t.DeactivateUrl}`)}static registerGarbageCollectEndpoint(e,t){t.push({method:`POST`,path:`/dbos-garbage-collect`,handler:async(t,n)=>{let r=await m(t);await e.systemDatabase.garbageCollect(r.cutoff_epoch_timestamp_ms,r.rows_threshold),_(n)}})}static registerGlobalTimeoutEndpoint(e,t){t.push({method:`POST`,path:`/dbos-global-timeout`,handler:async(t,n)=>{let r=await m(t);await(0,f.globalTimeout)(e.systemDatabase,r.cutoff_epoch_timestamp_ms),_(n)}})}static registerCancelWorkflowEndpoint(e,t){let n=`/workflows/:workflow_id/cancel`;t.push({method:`POST`,path:n,handler:async(t,n,r)=>{let i=r.workflow_id;await e.cancelWorkflow(i),_(n)}}),e.logger.debug(`DBOS Server Registered Cancel Workflow POST ${n}`)}static registerResumeWorkflowEndpoint(e,t){let n=`/workflows/:workflow_id/resume`;t.push({method:`POST`,path:n,handler:async(t,n,r)=>{let i=r.workflow_id;e.logger.info(`Resuming workflow with ID: ${i}`);try{await e.resumeWorkflow(i),_(n)}catch(t){let r=``;r=t instanceof s.DBOSError?t.message:`Unknown error`,e.logger.error(`Error resuming workflow ${i}: ${r}`),h(n,500,{error:`Error resuming workflow ${i}: ${r}`})}}}),e.logger.debug(`DBOS Server Registered Resume Workflow POST ${n}`)}static registerRestartWorkflowEndpoint(e,t){let n=`/workflows/:workflow_id/restart`;t.push({method:`POST`,path:n,handler:async(t,n,r)=>{let i=r.workflow_id;e.logger.info(`Restarting workflow: ${i} with a new id`),h(n,200,{workflow_id:await e.forkWorkflow(i,0)})}}),e.logger.debug(`DBOS Server Registered Restart Workflow POST ${n}`)}static registerForkWorkflowEndpoint(e,t){let n=`/workflows/:workflow_id/fork`;t.push({method:`POST`,path:n,handler:async(t,n,r)=>{let i=r.workflow_id,a=await m(t);if(a.start_step===void 0){h(n,400,{error:`Missing start_step in request body`});return}e.logger.info(`Forking workflow: ${i} from step ${a.start_step} with a new id`);try{h(n,200,{workflow_id:await e.forkWorkflow(i,a.start_step,{newWorkflowID:a.new_workflow_id,applicationVersion:a.application_version,timeoutMS:a.timeout_ms})})}catch(t){let r=``;r=t instanceof s.DBOSError?t.message:`Unknown error`,e.logger.error(`Error forking workflow ${i}: ${r}`),h(n,500,{error:`Error forking workflow ${i}: ${r}`})}}}),e.logger.debug(`DBOS Server Registered Fork Workflow POST ${n}`)}static registerListWorkflowStepsEndpoint(e,t){let n=`/workflows/:workflow_id/steps`;t.push({method:`GET`,path:n,handler:async(t,n,r)=>{let i=r.workflow_id,a=(await e.listWorkflowSteps(i))?.map(e=>new p.WorkflowSteps(e));h(n,200,a)}}),e.logger.debug(`DBOS Server Registered List Workflow steps Get ${n}`)}static registerListWorkflowsEndpoint(e,t){let n=`/workflows`;t.push({method:`POST`,path:n,handler:async(t,n)=>{let r=await m(t),i={workflowIDs:r.workflow_uuids,workflowName:r.workflow_name,authenticatedUser:r.authenticated_user,startTime:r.start_time,endTime:r.end_time,status:r.status,applicationVersion:r.application_version,forkedFrom:r.fork_from,limit:r.limit,offset:r.offset,sortDesc:r.sort_desc,workflow_id_prefix:r.workflow_id_prefix,loadInput:r.load_input??!1,loadOutput:r.load_output??!1};h(n,200,(await e.listWorkflows(i)).map(e=>new p.WorkflowsOutput(e)))}}),e.logger.debug(`DBOS Server Registered List Workflows POST ${n}`)}static registerListQueuedWorkflowsEndpoint(e,t){let n=`/queues`;t.push({method:`POST`,path:n,handler:async(t,n)=>{let r=await m(t),i={workflowName:r.workflow_name,startTime:r.start_time,endTime:r.end_time,status:r.status,forkedFrom:r.fork_from,queueName:r.queue_name,limit:r.limit,offset:r.offset,sortDesc:r.sort_desc,loadInput:r.load_input??!1};h(n,200,(await e.listQueuedWorkflows(i)).map(e=>new p.WorkflowsOutput(e)))}}),e.logger.debug(`DBOS Server Registered List Queued Workflows POST ${n}`)}static registerGetWorkflowEndpoint(e,t){let n=`/workflows/:workflow_id`;t.push({method:`GET`,path:n,handler:async(t,n,r)=>{let i=r.workflow_id,a=await e.getWorkflowStatus(i);a?h(n,200,new p.WorkflowsOutput(a)):h(n,404,{error:`Workflow ${i} not found`})}}),e.logger.debug(`DBOS Server Registered Get Workflow GET ${n}`)}}})),aS=r(((e,t)=>{let n=[`nodebuffer`,`arraybuffer`,`fragments`],r=typeof Blob<`u`;r&&n.push(`blob`),t.exports={BINARY_TYPES:n,EMPTY_BUFFER:Buffer.alloc(0),GUID:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,hasBlob:r,kForOnEventAttribute:Symbol(`kIsForOnEventAttribute`),kListener:Symbol(`kListener`),kStatusCode:Symbol(`status-code`),kWebSocket:Symbol(`websocket`),NOOP:()=>{}}})),oS=r(((t,n)=>{let{EMPTY_BUFFER:r}=aS(),i=Buffer[Symbol.species];function a(e,t){if(e.length===0)return r;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),a=0;for(let t=0;t<e.length;t++){let r=e[t];n.set(r,a),a+=r.length}return a<t?new i(n.buffer,n.byteOffset,a):n}function o(e,t,n,r,i){for(let a=0;a<i;a++)n[r+a]=e[a]^t[a&3]}function s(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}function c(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function l(e){if(l.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new i(e):ArrayBuffer.isView(e)?t=new i(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),l.readOnly=!1),t}if(n.exports={concat:a,mask:o,toArrayBuffer:c,toBuffer:l,unmask:s},!process.env.WS_NO_BUFFER_UTIL)try{let t=e(`bufferutil`);n.exports.mask=function(e,n,r,i,a){a<48?o(e,n,r,i,a):t.mask(e,n,r,i,a)},n.exports.unmask=function(e,n){e.length<32?s(e,n):t.unmask(e,n)}}catch{}})),sS=r(((e,t)=>{let n=Symbol(`kDone`),r=Symbol(`kRun`);t.exports=class{constructor(e){this[n]=()=>{this.pending--,this[r]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[r]()}[r](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[n])}}}})),cS=r(((t,n)=>{let r=e(`zlib`),i=oS(),a=sS(),{kStatusCode:o}=aS(),s=Buffer[Symbol.species],c=Buffer.from([0,0,255,255]),l=Symbol(`permessage-deflate`),u=Symbol(`total-length`),d=Symbol(`callback`),f=Symbol(`buffers`),p=Symbol(`error`),m;n.exports=class{constructor(e,t,n){this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold===void 0?1024:this._options.threshold,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,m||=new a(this._options.concurrencyLimit===void 0?10:this._options.concurrencyLimit)}static get extensionName(){return`permessage-deflate`}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits??(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&=(this._inflate.close(),null),this._deflate){let e=this._deflate[d];this._deflate.close(),this._deflate=null,e&&e(Error(`The deflate stream was closed while data was being processed`))}}acceptAsServer(e){let t=this._options,n=e.find(e=>!(t.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits==`number`&&t.serverMaxWindowBits>e.server_max_window_bits)||typeof t.clientMaxWindowBits==`number`&&!e.client_max_window_bits));if(!n)throw Error(`None of the extension offers can be accepted`);return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof t.serverMaxWindowBits==`number`&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits==`number`?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw Error(`Unexpected parameter "client_no_context_takeover"`);if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits==`number`&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==`number`&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw Error(`Unexpected or invalid parameter "client_max_window_bits"`);return t}normalizeParams(e){return e.forEach(e=>{Object.keys(e).forEach(t=>{let n=e[t];if(n.length>1)throw Error(`Parameter "${t}" must have only a single value`);if(n=n[0],t===`client_max_window_bits`){if(n!==!0){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else if(t===`server_max_window_bits`){let e=+n;if(!Number.isInteger(e)||e<8||e>15)throw TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(t===`client_no_context_takeover`||t===`server_no_context_takeover`){if(n!==!0)throw TypeError(`Invalid value for parameter "${t}": ${n}`)}else throw Error(`Unknown parameter "${t}"`);e[t]=n})}),e}decompress(e,t,n){m.add(r=>{this._decompress(e,t,(e,t)=>{r(),n(e,t)})})}compress(e,t,n){m.add(r=>{this._compress(e,t,(e,t)=>{r(),n(e,t)})})}_decompress(e,t,n){let a=this._isServer?`client`:`server`;if(!this._inflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:r.Z_DEFAULT_WINDOWBITS;this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[l]=this,this._inflate[u]=0,this._inflate[f]=[],this._inflate.on(`error`,_),this._inflate.on(`data`,g)}this._inflate[d]=n,this._inflate.write(e),t&&this._inflate.write(c),this._inflate.flush(()=>{let e=this._inflate[p];if(e){this._inflate.close(),this._inflate=null,n(e);return}let r=i.concat(this._inflate[f],this._inflate[u]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[u]=0,this._inflate[f]=[],t&&this.params[`${a}_no_context_takeover`]&&this._inflate.reset()),n(null,r)})}_compress(e,t,n){let a=this._isServer?`server`:`client`;if(!this._deflate){let e=`${a}_max_window_bits`,t=typeof this.params[e]==`number`?this.params[e]:r.Z_DEFAULT_WINDOWBITS;this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[u]=0,this._deflate[f]=[],this._deflate.on(`data`,h)}this._deflate[d]=n,this._deflate.write(e),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let e=i.concat(this._deflate[f],this._deflate[u]);t&&(e=new s(e.buffer,e.byteOffset,e.length-4)),this._deflate[d]=null,this._deflate[u]=0,this._deflate[f]=[],t&&this.params[`${a}_no_context_takeover`]&&this._deflate.reset(),n(null,e)})}};function h(e){this[f].push(e),this[u]+=e.length}function g(e){if(this[u]+=e.length,this[l]._maxPayload<1||this[u]<=this[l]._maxPayload){this[f].push(e);return}this[p]=RangeError(`Max payload size exceeded`),this[p].code=`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`,this[p][o]=1009,this.removeListener(`data`,g),this.reset()}function _(e){if(this[l]._inflate=null,this[p]){this[d](this[p]);return}e[o]=1007,this[d](e)}})),lS=r(((t,n)=>{let{isUtf8:r}=e(`buffer`),{hasBlob:i}=aS(),a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function o(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function s(e){let t=e.length,n=0;for(;n<t;)if(!(e[n]&128))n++;else if((e[n]&224)==192){if(n+1===t||(e[n+1]&192)!=128||(e[n]&254)==192)return!1;n+=2}else if((e[n]&240)==224){if(n+2>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||e[n]===224&&(e[n+1]&224)==128||e[n]===237&&(e[n+1]&224)==160)return!1;n+=3}else if((e[n]&248)==240){if(n+3>=t||(e[n+1]&192)!=128||(e[n+2]&192)!=128||(e[n+3]&192)!=128||e[n]===240&&(e[n+1]&240)==128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}function c(e){return i&&typeof e==`object`&&typeof e.arrayBuffer==`function`&&typeof e.type==`string`&&typeof e.stream==`function`&&(e[Symbol.toStringTag]===`Blob`||e[Symbol.toStringTag]===`File`)}if(n.exports={isBlob:c,isValidStatusCode:o,isValidUTF8:s,tokenChars:a},r)n.exports.isValidUTF8=function(e){return e.length<24?s(e):r(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=e(`utf-8-validate`);n.exports.isValidUTF8=function(e){return e.length<32?s(e):t(e)}}catch{}})),uS=r(((t,n)=>{let{Writable:r}=e(`stream`),i=cS(),{BINARY_TYPES:a,EMPTY_BUFFER:o,kStatusCode:s,kWebSocket:c}=aS(),{concat:l,toArrayBuffer:u,unmask:d}=oS(),{isValidStatusCode:f,isValidUTF8:p}=lS(),m=Buffer[Symbol.species];n.exports=class extends r{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents===void 0?!0:e.allowSynchronousEvents,this._binaryType=e.binaryType||a[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[c]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,n){if(this._opcode===8&&this._state==0)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let t=this._buffers[0];return this._buffers[0]=new m(t.buffer,t.byteOffset+e,t.length-e),new m(t.buffer,t.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new m(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if(t[0]&48){e(this.createError(RangeError,`RSV2 and RSV3 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_2_3`));return}let n=(t[0]&64)==64;if(n&&!this._extensions[i.extensionName]){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._fin=(t[0]&128)==128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(!this._fragmented){e(this.createError(RangeError,`invalid opcode 0`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){e(this.createError(RangeError,`FIN must be set`,!0,1002,`WS_ERR_EXPECTED_FIN`));return}if(n){e(this.createError(RangeError,`RSV1 must be clear`,!0,1002,`WS_ERR_UNEXPECTED_RSV_1`));return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,`WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH`));return}}else{e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,`WS_ERR_INVALID_OPCODE`));return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)==128,this._isServer){if(!this._masked){e(this.createError(RangeError,`MASK must be set`,!0,1002,`WS_ERR_EXPECTED_MASK`));return}}else if(this._masked){e(this.createError(RangeError,`MASK must be clear`,!0,1002,`WS_ERR_UNEXPECTED_MASK`));return}this._payloadLength===126?this._state=1:this._payloadLength===127?this._state=2:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>2**21-1){e(this.createError(RangeError,`Unsupported WebSocket frame: payload length > 2^53 - 1`,!1,1009,`WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH`));return}this._payloadLength=n*2**32+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){e(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}this._masked?this._state=3:this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(e){let t=o;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&d(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=5,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[i.extensionName].decompress(e,this._fin,(e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){t(this.createError(RangeError,`Max payload size exceeded`,!1,1009,`WS_ERR_UNSUPPORTED_MESSAGE_LENGTH`));return}this._fragments.push(n)}this.dataMessage(t),this._state===0&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=0;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;r=this._binaryType===`nodebuffer`?l(n,t):this._binaryType===`arraybuffer`?u(l(n,t)):this._binaryType===`blob`?new Blob(n):n,this._allowSynchronousEvents?(this.emit(`message`,r,!0),this._state=0):(this._state=6,setImmediate(()=>{this.emit(`message`,r,!0),this._state=0,this.startLoop(e)}))}else{let r=l(n,t);if(!this._skipUTF8Validation&&!p(r)){e(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._state===5||this._allowSynchronousEvents?(this.emit(`message`,r,!1),this._state=0):(this._state=6,setImmediate(()=>{this.emit(`message`,r,!1),this._state=0,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit(`conclude`,1005,o),this.end();else{let n=e.readUInt16BE(0);if(!f(n)){t(this.createError(RangeError,`invalid status code ${n}`,!0,1002,`WS_ERR_INVALID_CLOSE_CODE`));return}let r=new m(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!p(r)){t(this.createError(Error,`invalid UTF-8 sequence`,!0,1007,`WS_ERR_INVALID_UTF8`));return}this._loop=!1,this.emit(`conclude`,n,r),this.end()}this._state=0;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?`ping`:`pong`,e),this._state=0):(this._state=6,setImmediate(()=>{this.emit(this._opcode===9?`ping`:`pong`,e),this._state=0,this.startLoop(t)}))}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;let a=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(a,this.createError),a.code=i,a[s]=r,a}}})),dS=r(((t,n)=>{let{Duplex:r}=e(`stream`),{randomFillSync:i}=e(`crypto`),a=cS(),{EMPTY_BUFFER:o,kWebSocket:s,NOOP:c}=aS(),{isBlob:l,isValidStatusCode:u}=lS(),{mask:d,toBuffer:f}=oS(),p=Symbol(`kByteLength`),m=Buffer.alloc(4),h=8*1024,g,_=h;n.exports=class e{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=0,this.onerror=c,this[s]=void 0}static frame(e,t){let n,r=!1,a=2,o=!1;t.mask&&(n=t.maskBuffer||m,t.generateMask?t.generateMask(n):(_===h&&(g===void 0&&(g=Buffer.alloc(h)),i(g,0,h),_=0),n[0]=g[_++],n[1]=g[_++],n[2]=g[_++],n[3]=g[_++]),o=(n[0]|n[1]|n[2]|n[3])===0,a=6);let s;typeof e==`string`?(!t.mask||o)&&t[p]!==void 0?s=t[p]:(e=Buffer.from(e),s=e.length):(s=e.length,r=t.mask&&t.readOnly&&!o);let c=s;s>=65536?(a+=8,c=127):s>125&&(a+=2,c=126);let l=Buffer.allocUnsafe(r?s+a:a);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(s,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(s,4,6)),!t.mask||(l[1]|=128,l[a-4]=n[0],l[a-3]=n[1],l[a-2]=n[2],l[a-1]=n[3],o)?[l,e]:r?(d(e,n,l,a,s),[l]):(d(e,n,e,0,s),[l,e])}close(t,n,r,i){let a;if(t===void 0)a=o;else if(typeof t!=`number`||!u(t))throw TypeError(`First argument must be a valid error code number`);else if(n===void 0||!n.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let e=Buffer.byteLength(n);if(e>123)throw RangeError(`The message must not be greater than 123 bytes`);a=Buffer.allocUnsafe(2+e),a.writeUInt16BE(t,0),typeof n==`string`?a.write(n,2):a.set(n,2)}let s={[p]:a.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state===0?this.sendFrame(e.frame(a,s),i):this.enqueue([this.dispatch,a,!1,s,i])}ping(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):l(t)?(i=t.size,a=!1):(t=f(t),i=t.length,a=f.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[p]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};l(t)?this._state===0?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===0?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}pong(t,n,r){let i,a;if(typeof t==`string`?(i=Buffer.byteLength(t),a=!1):l(t)?(i=t.size,a=!1):(t=f(t),i=t.length,a=f.readOnly),i>125)throw RangeError(`The data size must not be greater than 125 bytes`);let o={[p]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};l(t)?this._state===0?this.getBlobData(t,!1,o,r):this.enqueue([this.getBlobData,t,!1,o,r]):this._state===0?this.sendFrame(e.frame(t,o),r):this.enqueue([this.dispatch,t,!1,o,r])}send(e,t,n){let r=this._extensions[a.extensionName],i=t.binary?2:1,o=t.compress,s,c;typeof e==`string`?(s=Buffer.byteLength(e),c=!1):l(e)?(s=e.size,c=!1):(e=f(e),s=e.length,c=f.readOnly),this._firstFragment?(this._firstFragment=!1,o&&r&&r.params[r._isServer?`server_no_context_takeover`:`client_no_context_takeover`]&&(o=s>=r._threshold),this._compress=o):(o=!1,i=0),t.fin&&(this._firstFragment=!0);let u={[p]:s,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};l(e)?this._state===0?this.getBlobData(e,this._compress,u,n):this.enqueue([this.getBlobData,e,this._compress,u,n]):this._state===0?this.dispatch(e,this._compress,u,n):this.enqueue([this.dispatch,e,this._compress,u,n])}getBlobData(t,n,r,i){this._bufferedBytes+=r[p],this._state=2,t.arrayBuffer().then(t=>{if(this._socket.destroyed){let e=Error(`The socket was closed while the blob was being read`);process.nextTick(v,this,e,i);return}this._bufferedBytes-=r[p];let a=f(t);n?this.dispatch(a,n,r,i):(this._state=0,this.sendFrame(e.frame(a,r),i),this.dequeue())}).catch(e=>{process.nextTick(y,this,e,i)})}dispatch(t,n,r,i){if(!n){this.sendFrame(e.frame(t,r),i);return}let o=this._extensions[a.extensionName];this._bufferedBytes+=r[p],this._state=1,o.compress(t,r.fin,(t,n)=>{if(this._socket.destroyed){v(this,Error(`The socket was closed while data was being compressed`),i);return}this._bufferedBytes-=r[p],this._state=0,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()})}dequeue(){for(;this._state===0&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][p],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][p],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};function v(e,t,n){typeof n==`function`&&n(t);for(let n=0;n<e._queue.length;n++){let r=e._queue[n],i=r[r.length-1];typeof i==`function`&&i(t)}}function y(e,t,n){v(e,t,n),e.onerror(t)}})),fS=r(((e,t)=>{let{kForOnEventAttribute:n,kListener:r}=aS(),i=Symbol(`kCode`),a=Symbol(`kData`),o=Symbol(`kError`),s=Symbol(`kMessage`),c=Symbol(`kReason`),l=Symbol(`kTarget`),u=Symbol(`kType`),d=Symbol(`kWasClean`);var f=class{constructor(e){this[l]=null,this[u]=e}get target(){return this[l]}get type(){return this[u]}};Object.defineProperty(f.prototype,`target`,{enumerable:!0}),Object.defineProperty(f.prototype,`type`,{enumerable:!0});var p=class extends f{constructor(e,t={}){super(e),this[i]=t.code===void 0?0:t.code,this[c]=t.reason===void 0?``:t.reason,this[d]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[i]}get reason(){return this[c]}get wasClean(){return this[d]}};Object.defineProperty(p.prototype,`code`,{enumerable:!0}),Object.defineProperty(p.prototype,`reason`,{enumerable:!0}),Object.defineProperty(p.prototype,`wasClean`,{enumerable:!0});var m=class extends f{constructor(e,t={}){super(e),this[o]=t.error===void 0?null:t.error,this[s]=t.message===void 0?``:t.message}get error(){return this[o]}get message(){return this[s]}};Object.defineProperty(m.prototype,`error`,{enumerable:!0}),Object.defineProperty(m.prototype,`message`,{enumerable:!0});var h=class extends f{constructor(e,t={}){super(e),this[a]=t.data===void 0?null:t.data}get data(){return this[a]}};Object.defineProperty(h.prototype,`data`,{enumerable:!0}),t.exports={CloseEvent:p,ErrorEvent:m,Event:f,EventTarget:{addEventListener(e,t,i={}){for(let a of this.listeners(e))if(!i[n]&&a[r]===t&&!a[n])return;let a;if(e===`message`)a=function(e,n){let r=new h(`message`,{data:n?e:e.toString()});r[l]=this,g(t,this,r)};else if(e===`close`)a=function(e,n){let r=new p(`close`,{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[l]=this,g(t,this,r)};else if(e===`error`)a=function(e){let n=new m(`error`,{error:e,message:e.message});n[l]=this,g(t,this,n)};else if(e===`open`)a=function(){let e=new f(`open`);e[l]=this,g(t,this,e)};else return;a[n]=!!i[n],a[r]=t,i.once?this.once(e,a):this.on(e,a)},removeEventListener(e,t){for(let i of this.listeners(e))if(i[r]===t&&!i[n]){this.removeListener(e,i);break}}},MessageEvent:h};function g(e,t,n){typeof e==`object`&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}})),pS=r(((e,t)=>{let{tokenChars:n}=lS();function r(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}function i(e){let t=Object.create(null),i=Object.create(null),a=!1,o=!1,s=!1,c,l,u=-1,d=-1,f=-1,p=0;for(;p<e.length;p++)if(d=e.charCodeAt(p),c===void 0)if(f===-1&&n[d]===1)u===-1&&(u=p);else if(p!==0&&(d===32||d===9))f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);d===44?(r(t,n,i),i=Object.create(null)):c=n,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);else if(l===void 0)if(f===-1&&n[d]===1)u===-1&&(u=p);else if(d===32||d===9)f===-1&&u!==-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),r(i,e.slice(u,f),!0),d===44&&(r(t,c,i),i=Object.create(null),c=void 0),u=f=-1}else if(d===61&&u!==-1&&f===-1)l=e.slice(u,p),u=f=-1;else throw SyntaxError(`Unexpected character at index ${p}`);else if(o){if(n[d]!==1)throw SyntaxError(`Unexpected character at index ${p}`);u===-1?u=p:a||=!0,o=!1}else if(s)if(n[d]===1)u===-1&&(u=p);else if(d===34&&u!==-1)s=!1,f=p;else if(d===92)o=!0;else throw SyntaxError(`Unexpected character at index ${p}`);else if(d===34&&e.charCodeAt(p-1)===61)s=!0;else if(f===-1&&n[d]===1)u===-1&&(u=p);else if(u!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let n=e.slice(u,f);a&&=(n=n.replace(/\\/g,``),!1),r(i,l,n),d===44&&(r(t,c,i),i=Object.create(null),c=void 0),l=void 0,u=f=-1}else throw SyntaxError(`Unexpected character at index ${p}`);if(u===-1||s||d===32||d===9)throw SyntaxError(`Unexpected end of input`);f===-1&&(f=p);let m=e.slice(u,f);return c===void 0?r(t,m,i):(l===void 0?r(i,m,!0):a?r(i,l,m.replace(/\\/g,``)):r(i,l,m),r(t,c,i)),t}function a(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>[t].concat(Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(e=>e===!0?t:`${t}=${e}`).join(`; `)})).join(`; `)).join(`, `)}).join(`, `)}t.exports={format:a,parse:i}})),mS=r(((t,n)=>{let r=e(`events`),i=e(`https`),a=e(`http`),o=e(`net`),s=e(`tls`),{randomBytes:c,createHash:l}=e(`crypto`),{Duplex:u,Readable:d}=e(`stream`),{URL:f}=e(`url`),p=cS(),m=uS(),h=dS(),{isBlob:g}=lS(),{BINARY_TYPES:_,EMPTY_BUFFER:v,GUID:y,kForOnEventAttribute:b,kListener:x,kStatusCode:S,kWebSocket:C,NOOP:w}=aS(),{EventTarget:{addEventListener:T,removeEventListener:E}}=fS(),{format:ee,parse:te}=pS(),{toBuffer:D}=oS(),ne=Symbol(`kAborted`),O=[8,13],k=[`CONNECTING`,`OPEN`,`CLOSING`,`CLOSED`],re=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;var A=class e extends r{constructor(t,n,r){super(),this._binaryType=_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=v,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol=``,this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t===null?(this._autoPong=r.autoPong,this._isServer=!0):(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n==`object`&&n?(r=n,n=[]):n=[n]),ie(this,t,n,r))}get binaryType(){return this._binaryType}set binaryType(e){_.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,n,r){let i=new m({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),a=new h(t,this._extensions,r.generateMask);this._receiver=i,this._sender=a,this._socket=t,i[C]=this,a[C]=this,t[C]=this,i.on(`conclude`,ue),i.on(`drain`,de),i.on(`error`,fe),i.on(`message`,me),i.on(`ping`,he),i.on(`pong`,ge),a.onerror=ve,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on(`close`,ye),t.on(`data`,be),t.on(`end`,M),t.on(`error`,N),this._readyState=e.OPEN,this.emit(`open`)}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit(`close`,this._closeCode,this._closeMessage);return}this._extensions[p.extensionName]&&this._extensions[p.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit(`close`,this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ce(this,this._req,`WebSocket was closed before the connection was established`);return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),j(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof t==`function`?(r=t,t=n=void 0):typeof n==`function`&&(r=n,n=void 0),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){le(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||v,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof t==`function`?(r=t,t=n=void 0):typeof n==`function`&&(r=n,n=void 0),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){le(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||v,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw Error(`WebSocket is not open: readyState 0 (CONNECTING)`);if(typeof n==`function`&&(r=n,n={}),typeof t==`number`&&(t=t.toString()),this.readyState!==e.OPEN){le(this,t,r);return}let i={binary:typeof t!=`string`,mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[p.extensionName]||(i.compress=!1),this._sender.send(t||v,i,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){ce(this,this._req,`WebSocket was closed before the connection was established`);return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(A,`CONNECTING`,{enumerable:!0,value:k.indexOf(`CONNECTING`)}),Object.defineProperty(A.prototype,`CONNECTING`,{enumerable:!0,value:k.indexOf(`CONNECTING`)}),Object.defineProperty(A,`OPEN`,{enumerable:!0,value:k.indexOf(`OPEN`)}),Object.defineProperty(A.prototype,`OPEN`,{enumerable:!0,value:k.indexOf(`OPEN`)}),Object.defineProperty(A,`CLOSING`,{enumerable:!0,value:k.indexOf(`CLOSING`)}),Object.defineProperty(A.prototype,`CLOSING`,{enumerable:!0,value:k.indexOf(`CLOSING`)}),Object.defineProperty(A,`CLOSED`,{enumerable:!0,value:k.indexOf(`CLOSED`)}),Object.defineProperty(A.prototype,`CLOSED`,{enumerable:!0,value:k.indexOf(`CLOSED`)}),[`binaryType`,`bufferedAmount`,`extensions`,`isPaused`,`protocol`,`readyState`,`url`].forEach(e=>{Object.defineProperty(A.prototype,e,{enumerable:!0})}),[`open`,`error`,`close`,`message`].forEach(e=>{Object.defineProperty(A.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[b])return t[x];return null},set(t){for(let t of this.listeners(e))if(t[b]){this.removeListener(e,t);break}typeof t==`function`&&this.addEventListener(e,t,{[b]:!0})}})}),A.prototype.addEventListener=T,A.prototype.removeEventListener=E,n.exports=A;function ie(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:O[1],maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:`GET`,host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,!O.includes(o.protocolVersion))throw RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${O.join(`, `)})`);let s;if(t instanceof f)s=t;else try{s=new f(t)}catch{throw SyntaxError(`Invalid URL: ${t}`)}s.protocol===`http:`?s.protocol=`ws:`:s.protocol===`https:`&&(s.protocol=`wss:`),e._url=s.href;let u=s.protocol===`wss:`,d=s.protocol===`ws+unix:`,m;if(s.protocol!==`ws:`&&!u&&!d?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:d&&!s.pathname?m=`The URL's pathname is empty`:s.hash&&(m=`The URL contains a fragment identifier`),m){let t=SyntaxError(m);if(e._redirects===0)throw t;ae(e,t);return}let h=u?443:80,g=c(16).toString(`base64`),_=u?i.request:a.request,v=new Set,b;if(o.createConnection=o.createConnection||(u?se:oe),o.defaultPort=o.defaultPort||h,o.port=s.port||h,o.host=s.hostname.startsWith(`[`)?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":g,Connection:`Upgrade`,Upgrade:`websocket`},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(b=new p(o.perMessageDeflate===!0?{}:o.perMessageDeflate,!1,o.maxPayload),o.headers[`Sec-WebSocket-Extensions`]=ee({[p.extensionName]:b.offer()})),n.length){for(let e of n){if(typeof e!=`string`||!re.test(e)||v.has(e))throw SyntaxError(`An invalid or duplicated subprotocol was specified`);v.add(e)}o.headers[`Sec-WebSocket-Protocol`]=n.join(`,`)}if(o.origin&&(o.protocolVersion<13?o.headers[`Sec-WebSocket-Origin`]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),d){let e=o.path.split(`:`);o.socketPath=e[0],o.path=e[1]}let x;if(o.followRedirects){if(e._redirects===0){e._originalIpc=d,e._originalSecure=u,e._originalHostOrSocketPath=d?o.socketPath:s.host;let t=r&&r.headers;if(r={...r,headers:{}},t)for(let[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(e.listenerCount(`redirect`)===0){let t=d?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!u)&&(delete o.headers.authorization,delete o.headers.cookie,t||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization=`Basic `+Buffer.from(o.auth).toString(`base64`)),x=e._req=_(o),e._redirects&&e.emit(`redirect`,e.url,x)}else x=e._req=_(o);o.timeout&&x.on(`timeout`,()=>{ce(e,x,`Opening handshake has timed out`)}),x.on(`error`,t=>{x===null||x[ne]||(x=e._req=null,ae(e,t))}),x.on(`response`,i=>{let a=i.headers.location,s=i.statusCode;if(a&&o.followRedirects&&s>=300&&s<400){if(++e._redirects>o.maxRedirects){ce(e,x,`Maximum redirects exceeded`);return}x.abort();let i;try{i=new f(a,t)}catch{ae(e,SyntaxError(`Invalid URL: ${a}`));return}ie(e,i,n,r)}else e.emit(`unexpected-response`,x,i)||ce(e,x,`Unexpected server response: ${i.statusCode}`)}),x.on(`upgrade`,(t,n,r)=>{if(e.emit(`upgrade`,t),e.readyState!==A.CONNECTING)return;x=e._req=null;let i=t.headers.upgrade;if(i===void 0||i.toLowerCase()!==`websocket`){ce(e,n,`Invalid Upgrade header`);return}let a=l(`sha1`).update(g+y).digest(`base64`);if(t.headers[`sec-websocket-accept`]!==a){ce(e,n,`Invalid Sec-WebSocket-Accept header`);return}let s=t.headers[`sec-websocket-protocol`],c;if(s===void 0?v.size&&(c=`Server sent no subprotocol`):v.size?v.has(s)||(c=`Server sent an invalid subprotocol`):c=`Server sent a subprotocol but none was requested`,c){ce(e,n,c);return}s&&(e._protocol=s);let u=t.headers[`sec-websocket-extensions`];if(u!==void 0){if(!b){ce(e,n,`Server sent a Sec-WebSocket-Extensions header but no extension was requested`);return}let t;try{t=te(u)}catch{ce(e,n,`Invalid Sec-WebSocket-Extensions header`);return}let r=Object.keys(t);if(r.length!==1||r[0]!==p.extensionName){ce(e,n,`Server indicated an extension that was not requested`);return}try{b.accept(t[p.extensionName])}catch{ce(e,n,`Invalid Sec-WebSocket-Extensions header`);return}e._extensions[p.extensionName]=b}e.setSocket(n,r,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(x,e):x.end()}function ae(e,t){e._readyState=A.CLOSING,e._errorEmitted=!0,e.emit(`error`,t),e.emitClose()}function oe(e){return e.path=e.socketPath,o.connect(e)}function se(e){return e.path=void 0,!e.servername&&e.servername!==``&&(e.servername=o.isIP(e.host)?``:e.host),s.connect(e)}function ce(e,t,n){e._readyState=A.CLOSING;let r=Error(n);Error.captureStackTrace(r,ce),t.setHeader?(t[ne]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(ae,e,r)):(t.destroy(r),t.once(`error`,e.emit.bind(e,`error`)),t.once(`close`,e.emitClose.bind(e)))}function le(e,t,n){if(t){let n=g(t)?t.size:D(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){let t=Error(`WebSocket is not open: readyState ${e.readyState} (${k[e.readyState]})`);process.nextTick(n,t)}}function ue(e,t){let n=this[C];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[C]!==void 0&&(n._socket.removeListener(`data`,be),process.nextTick(_e,n._socket),e===1005?n.close():n.close(e,t))}function de(){let e=this[C];e.isPaused||e._socket.resume()}function fe(e){let t=this[C];t._socket[C]!==void 0&&(t._socket.removeListener(`data`,be),process.nextTick(_e,t._socket),t.close(e[S])),t._errorEmitted||(t._errorEmitted=!0,t.emit(`error`,e))}function pe(){this[C].emitClose()}function me(e,t){this[C].emit(`message`,e,t)}function he(e){let t=this[C];t._autoPong&&t.pong(e,!this._isServer,w),t.emit(`ping`,e)}function ge(e){this[C].emit(`pong`,e)}function _e(e){e.resume()}function ve(e){let t=this[C];t.readyState!==A.CLOSED&&(t.readyState===A.OPEN&&(t._readyState=A.CLOSING,j(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit(`error`,e)))}function j(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),3e4)}function ye(){let e=this[C];this.removeListener(`close`,ye),this.removeListener(`data`,be),this.removeListener(`end`,M),e._readyState=A.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[C]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on(`error`,pe),e._receiver.on(`finish`,pe))}function be(e){this[C]._receiver.write(e)||this.pause()}function M(){let e=this[C];e._readyState=A.CLOSING,e._receiver.end(),this.end()}function N(){let e=this[C];this.removeListener(`error`,N),this.on(`error`,w),e&&(e._readyState=A.CLOSING,this.destroy())}})),hS=r(((t,n)=>{mS();let{Duplex:r}=e(`stream`);function i(e){e.emit(`close`)}function a(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o(e){this.removeListener(`error`,o),this.destroy(),this.listenerCount(`error`)===0&&this.emit(`error`,e)}function s(e,t){let n=!0,s=new r({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on(`message`,function(t,n){let r=!n&&s._readableState.objectMode?t.toString():t;s.push(r)||e.pause()}),e.once(`error`,function(e){s.destroyed||(n=!1,s.destroy(e))}),e.once(`close`,function(){s.destroyed||s.push(null)}),s._destroy=function(t,r){if(e.readyState===e.CLOSED){r(t),process.nextTick(i,s);return}let a=!1;e.once(`error`,function(e){a=!0,r(e)}),e.once(`close`,function(){a||r(t),process.nextTick(i,s)}),n&&e.terminate()},s._final=function(t){if(e.readyState===e.CONNECTING){e.once(`open`,function(){s._final(t)});return}e._socket!==null&&(e._socket._writableState.finished?(t(),s._readableState.endEmitted&&s.destroy()):(e._socket.once(`finish`,function(){t()}),e.close()))},s._read=function(){e.isPaused&&e.resume()},s._write=function(t,n,r){if(e.readyState===e.CONNECTING){e.once(`open`,function(){s._write(t,n,r)});return}e.send(t,r)},s.on(`end`,a),s.on(`error`,o),s}n.exports=s})),gS=r(((e,t)=>{let{tokenChars:n}=lS();function r(e){let t=new Set,r=-1,i=-1,a=0;for(;a<e.length;a++){let o=e.charCodeAt(a);if(i===-1&&n[o]===1)r===-1&&(r=a);else if(a!==0&&(o===32||o===9))i===-1&&r!==-1&&(i=a);else if(o===44){if(r===-1)throw SyntaxError(`Unexpected character at index ${a}`);i===-1&&(i=a);let n=e.slice(r,i);if(t.has(n))throw SyntaxError(`The "${n}" subprotocol is duplicated`);t.add(n),r=i=-1}else throw SyntaxError(`Unexpected character at index ${a}`)}if(r===-1||i!==-1)throw SyntaxError(`Unexpected end of input`);let o=e.slice(r,a);if(t.has(o))throw SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}t.exports={parse:r}})),_S=r(((t,n)=>{let r=e(`events`),i=e(`http`),{Duplex:a}=e(`stream`),{createHash:o}=e(`crypto`),s=pS(),c=cS(),l=gS(),u=mS(),{GUID:d,kWebSocket:f}=aS(),p=/^[+/0-9A-Za-z]{22}==$/;n.exports=class extends r{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:u,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw TypeError(`One and only one of the "port", "server", or "noServer" options must be specified`);if(e.port==null?e.server&&(this._server=e.server):(this._server=i.createServer((e,t)=>{let n=i.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":`text/plain`}),t.end(n)}),this._server.listen(e.port,e.host,e.backlog,t)),this._server){let e=this.emit.bind(this,`connection`);this._removeListeners=m(this._server,{listening:this.emit.bind(this,`listening`),error:this.emit.bind(this,`error`),upgrade:(t,n,r)=>{this.handleUpgrade(t,n,r,e)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw Error(`The server is operating in "noServer" mode`);return this._server?this._server.address():null}close(e){if(this._state===2){e&&this.once(`close`,()=>{e(Error(`The server is not running`))}),process.nextTick(h,this);return}if(e&&this.once(`close`,e),this._state!==1)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(h,this);else{let e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close(()=>{h(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf(`?`);if((t===-1?e.url:e.url.slice(0,t))!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on(`error`,g);let i=e.headers[`sec-websocket-key`],a=e.headers.upgrade,o=+e.headers[`sec-websocket-version`];if(e.method!==`GET`){v(this,e,t,405,`Invalid HTTP method`);return}if(a===void 0||a.toLowerCase()!==`websocket`){v(this,e,t,400,`Invalid Upgrade header`);return}if(i===void 0||!p.test(i)){v(this,e,t,400,`Missing or invalid Sec-WebSocket-Key header`);return}if(o!==13&&o!==8){v(this,e,t,400,`Missing or invalid Sec-WebSocket-Version header`,{"Sec-WebSocket-Version":`13, 8`});return}if(!this.shouldHandle(e)){_(t,400);return}let u=e.headers[`sec-websocket-protocol`],d=new Set;if(u!==void 0)try{d=l.parse(u)}catch{v(this,e,t,400,`Invalid Sec-WebSocket-Protocol header`);return}let f=e.headers[`sec-websocket-extensions`],m={};if(this.options.perMessageDeflate&&f!==void 0){let n=new c(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let e=s.parse(f);e[c.extensionName]&&(n.accept(e[c.extensionName]),m[c.extensionName]=n)}catch{v(this,e,t,400,`Invalid or unacceptable Sec-WebSocket-Extensions header`);return}}if(this.options.verifyClient){let a={origin:e.headers[`${o===8?`sec-websocket-origin`:`origin`}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(a,(a,o,s,c)=>{if(!a)return _(t,o||401,s,c);this.completeUpgrade(m,i,d,e,t,n,r)});return}if(!this.options.verifyClient(a))return _(t,401)}this.completeUpgrade(m,i,d,e,t,n,r)}completeUpgrade(e,t,n,r,i,a,l){if(!i.readable||!i.writable)return i.destroy();if(i[f])throw Error(`server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration`);if(this._state>0)return _(i,503);let u=[`HTTP/1.1 101 Switching Protocols`,`Upgrade: websocket`,`Connection: Upgrade`,`Sec-WebSocket-Accept: ${o(`sha1`).update(t+d).digest(`base64`)}`],p=new this.options.WebSocket(null,void 0,this.options);if(n.size){let e=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;e&&(u.push(`Sec-WebSocket-Protocol: ${e}`),p._protocol=e)}if(e[c.extensionName]){let t=e[c.extensionName].params,n=s.format({[c.extensionName]:[t]});u.push(`Sec-WebSocket-Extensions: ${n}`),p._extensions=e}this.emit(`headers`,u,r),i.write(u.concat(`\r
314
+ `).join(`\r
315
+ `)),i.removeListener(`error`,g),p.setSocket(i,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on(`close`,()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(h,this)})),l(p,r)}};function m(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function h(e){e._state=2,e.emit(`close`)}function g(){this.destroy()}function _(e,t,n,r){n||=i.STATUS_CODES[t],r={Connection:`close`,"Content-Type":`text/html`,"Content-Length":Buffer.byteLength(n),...r},e.once(`finish`,e.destroy),e.end(`HTTP/1.1 ${t} ${i.STATUS_CODES[t]}\r\n`+Object.keys(r).map(e=>`${e}: ${r[e]}`).join(`\r
316
+ `)+`\r
317
+ \r
318
+ `+n)}function v(e,t,n,r,i,a){if(e.listenerCount(`wsClientError`)){let r=Error(i);Error.captureStackTrace(r,v),e.emit(`wsClientError`,r,n,t)}else _(n,r,i,a)}})),vS=r(((e,t)=>{let n=mS();n.createWebSocketStream=hS(),n.Server=_S(),n.Receiver=uS(),n.Sender=dS(),n.WebSocket=n,n.WebSocketServer=n.Server,t.exports=n})),yS=r((t=>{var n=t&&t.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=t&&t.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=t&&t.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Conductor=void 0;let o=gy(),s=a(vS()),c=i(rS()),l=e(`node:os`),u=Ib(),d=a(e(`node:assert`));t.Conductor=class{dbosExec;conductorKey;conductorURL;url;websocket=void 0;isShuttingDown=!1;isClosed=!1;pingPeriodMs=2e4;pingTimeoutMs=15e3;pingIntervalTimeout=void 0;reconnectDelayMs=1e3;reconnectTimeout=void 0;constructor(e,t,n){this.dbosExec=e,this.conductorKey=t,this.conductorURL=n;let r=e.appName;(0,d.default)(r,`Application name must be set in configuration in order to use DBOS Conductor`),this.url=`${n.replace(/\/+$/,``)}/websocket/${r}/${t}`}resetWebsocket(e,t){clearInterval(t?.interval),clearTimeout(t?.timeout),e&&(e.terminate(),this.websocket===e&&(this.websocket=void 0)),!(this.reconnectTimeout||this.isShuttingDown)&&(this.dbosExec.logger.debug(`Reconnecting in ${this.reconnectDelayMs/1e3} second`),this.reconnectTimeout=setTimeout(()=>{this.dispatchLoop()},this.reconnectDelayMs))}setPingInterval(e,t){clearInterval(t.interval),clearTimeout(t.timeout),t.interval=setInterval(()=>{t.timeout=setTimeout(()=>{this.isShuttingDown||this.reconnectTimeout===void 0&&(this.dbosExec.logger.warn(`Connection to conductor lost. Reconnecting...`),this.resetWebsocket(e,t))},this.pingTimeoutMs),e.readyState===s.default.OPEN&&(this.dbosExec.logger.debug(`Sending ping to conductor`),e.ping())},this.pingPeriodMs)}dispatchLoop(){if(this.websocket&&(this.websocket.readyState===s.default.OPEN||this.websocket.readyState===s.default.CONNECTING)){this.dbosExec.logger.warn(`Conductor websocket already exists`);return}if(clearTimeout(this.pingIntervalTimeout?.timeout),clearInterval(this.pingIntervalTimeout?.interval),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.isShuttingDown){this.dbosExec.logger.debug(`Not starting dispatch loop as conductor is shutting down`);return}try{this.dbosExec.logger.debug(`Connecting to conductor at ${this.url}`);let e=new s.default(this.url,{handshakeTimeout:5e3});this.websocket=e;let t={interval:void 0,timeout:void 0};this.setPingInterval(e,t),this.pingIntervalTimeout=t,e.on(`open`,()=>{this.dbosExec.logger.debug(`Opened connection to DBOS conductor`),clearTimeout(t.timeout)}),e.on(`pong`,()=>{this.dbosExec.logger.debug(`Received pong from conductor`),clearTimeout(t.timeout)}),e.on(`message`,async n=>{this.dbosExec.logger.debug(`Received message from conductor: ${n}`);let r=JSON.parse(n),i=r.type,a;switch(clearTimeout(t.timeout),i){case c.MessageType.EXECUTOR_INFO:let t=new c.ExecutorInfoResponse(r.request_id,o.globalParams.executorID,o.globalParams.appVersion,(0,l.hostname)());e.send(JSON.stringify(t)),this.dbosExec.logger.info(`Connected to DBOS conductor`);break;case c.MessageType.RECOVERY:let n=r,i=!0;try{await this.dbosExec.recoverPendingWorkflows(n.executor_ids)}catch(e){a=`Exception encountered when recovering workflows: ${e.message}`,this.dbosExec.logger.error(a),i=!1}let s=new c.RecoveryResponse(r.request_id,i,a);e.send(JSON.stringify(s));break;case c.MessageType.CANCEL:let d=r,f=!0;try{await this.dbosExec.cancelWorkflow(d.workflow_id)}catch(e){a=`Exception encountered when cancelling workflow ${d.workflow_id}: ${e.message}`,this.dbosExec.logger.error(a),f=!1}let p=new c.CancelResponse(r.request_id,f,a);e.send(JSON.stringify(p));break;case c.MessageType.RESUME:let m=r,h=!0;try{await this.dbosExec.resumeWorkflow(m.workflow_id)}catch(e){a=`Exception encountered when resuming workflow ${m.workflow_id}: ${e.message}`,this.dbosExec.logger.error(a),h=!1}let g=new c.ResumeResponse(r.request_id,h,a);e.send(JSON.stringify(g));break;case c.MessageType.RESTART:let _=r,v=!0;try{await this.dbosExec.forkWorkflow(_.workflow_id,0)}catch(e){a=`Exception encountered when restarting workflow ${_.workflow_id}: ${e.message}`,this.dbosExec.logger.error(a),v=!1}let y=new c.RestartResponse(r.request_id,v,a);e.send(JSON.stringify(y));break;case c.MessageType.FORK_WORKFLOW:let b=r,x=b.body.new_workflow_id;try{x=await this.dbosExec.forkWorkflow(b.body.workflow_id,b.body.start_step,{newWorkflowID:x,applicationVersion:b.body.application_version})}catch(e){a=`Exception encountered when forking workflow ${b.body.workflow_id} to new workflow ${x} on step ${b.body.start_step}, app version ${b.body.application_version}: ${e.message}`,this.dbosExec.logger.error(a),x=void 0}let S=new c.ForkWorkflowResponse(r.request_id,x,a);e.send(JSON.stringify(S));break;case c.MessageType.LIST_WORKFLOWS:let C=r,w=C.body,T={workflowIDs:w.workflow_uuids,workflowName:w.workflow_name,authenticatedUser:w.authenticated_user,startTime:w.start_time,endTime:w.end_time,status:w.status,applicationVersion:w.application_version,forkedFrom:w.forked_from,limit:w.limit,offset:w.offset,sortDesc:w.sort_desc,loadInput:w.load_input??!1,loadOutput:w.load_output??!1},E=[];try{E=(await this.dbosExec.listWorkflows(T)).map(e=>new c.WorkflowsOutput(e))}catch(e){a=`Exception encountered when listing workflows: ${e.message}`,this.dbosExec.logger.error(a)}let ee=new c.ListWorkflowsResponse(C.request_id,E,a);e.send(JSON.stringify(ee));break;case c.MessageType.LIST_QUEUED_WORKFLOWS:let te=r,D=te.body,ne={workflowName:D.workflow_name,startTime:D.start_time,endTime:D.end_time,status:D.status,forkedFrom:D.forked_from,limit:D.limit,queueName:D.queue_name,offset:D.offset,sortDesc:D.sort_desc,loadInput:D.load_input??!1},O=[];try{O=(await this.dbosExec.listQueuedWorkflows(ne)).map(e=>new c.WorkflowsOutput(e))}catch(e){a=`Exception encountered when listing queued workflows: ${e.message}`,this.dbosExec.logger.error(a)}let k=new c.ListQueuedWorkflowsResponse(te.request_id,O,a);e.send(JSON.stringify(k));break;case c.MessageType.GET_WORKFLOW:let re=r,A;try{let e=await this.dbosExec.getWorkflowStatus(re.workflow_id);e&&(A=new c.WorkflowsOutput(e))}catch(e){a=`Exception encountered when getting workflow ${re.workflow_id}: ${e.message}`,this.dbosExec.logger.error(a)}let ie=new c.GetWorkflowResponse(re.request_id,A,a);e.send(JSON.stringify(ie));break;case c.MessageType.EXIST_PENDING_WORKFLOWS:let ae=r,oe=!1;try{oe=(await this.dbosExec.systemDatabase.getPendingWorkflows(ae.executor_id,ae.application_version)).length>0}catch(e){a=`Exception encountered when checking for pending workflows: ${e.message}`,this.dbosExec.logger.error(a)}let se=new c.ExistPendingWorkflowsResponse(r.request_id,oe,a);e.send(JSON.stringify(se));break;case c.MessageType.LIST_STEPS:let ce=r,le;try{le=(await this.dbosExec.listWorkflowSteps(ce.workflow_id))?.map(e=>new c.WorkflowSteps(e))}catch(e){a=`Exception encountered when listing steps ${ce.workflow_id}: ${e.message}`,this.dbosExec.logger.error(a)}let ue=new c.ListStepsResponse(ce.request_id,le,a);e.send(JSON.stringify(ue));break;case c.MessageType.RETENTION:let de=r,fe=!0;try{await this.dbosExec.systemDatabase.garbageCollect(de.body.gc_cutoff_epoch_ms,de.body.gc_rows_threshold),de.body.timeout_cutoff_epoch_ms&&await(0,u.globalTimeout)(this.dbosExec.systemDatabase,de.body.timeout_cutoff_epoch_ms)}catch(e){fe=!1,a=`Exception encountered during enforcing retention policy: ${e.message}`,this.dbosExec.logger.error(a)}let pe=new c.RetentionResponse(de.request_id,fe,a);e.send(JSON.stringify(pe));break;default:this.dbosExec.logger.warn(`Unknown message type: ${r.type}`);let me=new c.BaseResponse(r.type,r.request_id,`Unknown message type`);e.send(JSON.stringify(me))}}),e.on(`close`,()=>{if(this.isShuttingDown){this.dbosExec.logger.info(`Shutdown Conductor connection`);return}else this.reconnectTimeout===void 0&&(this.dbosExec.logger.warn(`Connection to conductor lost. Reconnecting.`),this.resetWebsocket(e,t))}),e.on(`unexpected-response`,(n,r)=>{this.dbosExec.logger.warn(`Unexpected response from conductor: ${r.statusCode} ${r.statusMessage}}`),this.reconnectTimeout===void 0&&this.resetWebsocket(e,t)}),e.on(`error`,n=>{this.dbosExec.logger.warn(`Unexpected exception in connection to conductor. Reconnecting: ${n.message}`),this.reconnectTimeout===void 0&&this.resetWebsocket(e,t)})}catch(e){this.dbosExec.logger.warn(`Error in conductor loop. Reconnecting: ${e.message}`),this.reconnectTimeout===void 0&&this.resetWebsocket(this.websocket,this.pingIntervalTimeout)}}stop(){this.isShuttingDown=!0,clearInterval(this.pingIntervalTimeout?.interval),clearTimeout(this.pingIntervalTimeout?.timeout),clearTimeout(this.reconnectTimeout),this.websocket&&this.websocket.close(),this.isClosed=!0}}})),bS=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.registerAuthChecker=void 0;let t=zb(),n=xS(),r=Ab(),i=ny();function a(e,r){let a=e.getRequiredRoles();if(a.length>0){n.DBOS.span?.setAttribute(`requiredRoles`,a);let r=n.DBOS.authenticatedRoles,o=!1,s=new Set(r);for(let e of a)if(s.has(e)){o=!0,(0,t.getCurrentContextStore)()&&((0,t.getCurrentContextStore)().assumedRole=e);break}if(!o){let t=new i.DBOSNotAuthorizedError(`User does not have a role with permission to call ${e.name}`,403);throw n.DBOS.span?.addEvent(`DBOSNotAuthorizedError`,{message:t.message}),t}}return r}let o=new class{installMiddleware(e){let t=e?.defaults?.getRegisteredInfo(r.DBOS_AUTH),n=e?.getRegisteredInfo(r.DBOS_AUTH);(t?.requiredRole!==void 0||n?.requiredRole!==void 0)&&e.addEntryInterceptor(a,10)}};function s(){(0,r.registerMiddlewareInstaller)(o)}e.registerAuthChecker=s})),xS=r((t=>{var n=t&&t.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DBOS=t.runInternalStep=t.getExecutor=void 0;let r=zb(),i=Rb(),a=yy(),o=_y(),s=by(),c=ny(),l=nS(),u=Fb(),d=Ab(),f=gy(),p=iS(),m=e(`node:crypto`),h=yS(),g=kb(),_=Nb(),v=bS(),y=n(e(`node:assert`));function b(){if(!i.DBOSExecutor.globalInstance)throw new c.DBOSExecutorNotInitializedError;return i.DBOSExecutor.globalInstance}t.getExecutor=b;function x(e,t,n,a){if(S.isWithinWorkflow()){if(S.isInStep())return e();if(S.isInWorkflow())return i.DBOSExecutor.globalInstance.runInternalStep(e,t,S.workflowID,a??(0,r.functionIDGetIncrement)(),n);throw new c.DBOSInvalidWorkflowTransitionError(`Invalid call to \`${t}\` inside a \`transaction\` or \`procedure\``)}return e()}t.runInternalStep=x;var S=class e{static adminServer=void 0;static conductor=void 0;static setConfig(t){(0,y.default)(!e.isInitialized(),`Cannot call DBOS.setConfig after DBOS.launch`),e.#t=t}static isInitialized(){return!!i.DBOSExecutor.globalInstance?.initialized}static async launch(t){let n=t?.debugMode??process.env.DBOS_DEBUG_WORKFLOW_ID!==void 0,r=(0,l.readConfigFile)(),o=e.#t?(0,l.translateDbosConfig)(e.#t,n):(0,l.getDbosConfig)(r),s=e.#t?(0,l.translateRuntimeConfig)(e.#t):(0,l.getRuntimeConfig)(r);if(process.env.DBOS__CLOUD===`true`&&([o,s]=(0,l.overwriteConfigForDBOSCloud)(o,s,r)),f.globalParams.enableOTLP=e.#t?.enableOTLP??(0,f.defaultEnableOTLP)(),(0,a.isTraceContextWorking)()||(0,a.installTraceContextManager)(o.name),(0,d.insertAllMiddleware)(),e.isInitialized())return;t?.conductorKey&&(f.globalParams.executorID=(0,m.randomUUID)()),process.env.DBOS__CLOUD!==`true`&&e.#t?.applicationVersion&&(f.globalParams.appVersion=e.#t.applicationVersion),i.DBOSExecutor.createDebouncerWorkflow(),i.DBOSExecutor.createInternalQueue(),i.DBOSExecutor.globalInstance=new i.DBOSExecutor(o,{debugMode:n}),(0,d.recordDBOSLaunch)();let c=i.DBOSExecutor.globalInstance;await c.init();let u=process.env.DBOS_DEBUG_WORKFLOW_ID;if(u){e.logger.info(`Debugging workflow "${u}"`),await(await c.executeWorkflowUUID(u)).getResult(),e.logger.info(`Workflow Debugging complete. Exiting process.`),await c.destroy(),process.exit(0);return}await i.DBOSExecutor.globalInstance.initEventReceivers();for(let[e,t]of d.transactionalDataSources)await t.initialize();t?.conductorKey&&(t.conductorURL||=`wss://${process.env.DBOS_DOMAIN||`cloud.dbos.dev`}/conductor/v1alpha1`,e.conductor=new h.Conductor(i.DBOSExecutor.globalInstance,t.conductorKey,t.conductorURL),e.conductor.dispatchLoop());let g=e.logger;if(s.runAdminServer){let t=p.DBOSAdminServer.setupAdminApp(c);try{await p.DBOSAdminServer.checkPortAvailabilityIPv4Ipv6(s.admin_port,g),e.adminServer=await new Promise((n,r)=>{let i=t.listen(s?.admin_port,()=>{e.logger.debug(`DBOS Admin Server is running at http://localhost:${s?.admin_port}`),n(i)});i.on(`error`,e=>{r(e)})})}catch{g.warn(`Unable to start DBOS admin server on port ${s.admin_port}`)}}}static logRegisteredEndpoints(){if(i.DBOSExecutor.globalInstance){_.wfQueueRunner.logRegisteredEndpoints(i.DBOSExecutor.globalInstance);for(let e of(0,d.getLifecycleListeners)())e.logRegisteredEndpoints?.()}}static async shutdown(){if(e.adminServer&&=(e.adminServer.close(),void 0),e.conductor){for(e.conductor.stop();!e.conductor.isClosed;)await(0,f.sleepms)(500);e.conductor=void 0}i.DBOSExecutor.globalInstance&&(await i.DBOSExecutor.globalInstance.deactivateEventReceivers(),await i.DBOSExecutor.globalInstance.destroy(),i.DBOSExecutor.globalInstance=void 0);for(let[e,t]of d.transactionalDataSources)await t.destroy();f.globalParams.appVersion=process.env.DBOS__APPVERSION||``,f.globalParams.wasComputed=!1,f.globalParams.appID=process.env.DBOS__APPID||``,f.globalParams.executorID=process.env.DBOS__VMID||`local`,(0,d.recordDBOSShutdown)()}static async deactivateEventReceivers(){return i.DBOSExecutor.globalInstance?.deactivateEventReceivers()}static async initEventReceivers(){return i.DBOSExecutor.globalInstance?.initEventReceivers()}static get#e(){return b()}static#t;static get logger(){let e=(0,r.getCurrentContextStore)();if(e?.logger)return e.logger;let t=i.DBOSExecutor.globalInstance;return t?t.logger:new s.GlobalLogger}static get tracer(){let e=i.DBOSExecutor.globalInstance;if(e)return e.tracer}static get span(){return(0,a.getActiveSpan)()}static requestObject(){return(0,r.getCurrentContextStore)()?.request}static getRequest(){return this.requestObject()}static get request(){let t=e.getRequest();if(!t)throw new c.DBOSError("`DBOS.request` accessed from outside of HTTP requests");return t}static get applicationVersion(){return f.globalParams.appVersion}static get workflowID(){return(0,r.getCurrentContextStore)()?.workflowId}static get stepID(){if(e.isInStep())return(0,r.getCurrentContextStore)()?.curStepFunctionId;if(e.isInTransaction())return(0,r.getCurrentContextStore)()?.curTxFunctionId}static get stepStatus(){return(0,r.getCurrentContextStore)()?.stepStatus}static get authenticatedUser(){return(0,r.getCurrentContextStore)()?.authenticatedUser??``}static get authenticatedRoles(){return(0,r.getCurrentContextStore)()?.authenticatedRoles??[]}static get assumedRole(){return(0,r.getCurrentContextStore)()?.assumedRole??``}static isInTransaction(){return(0,r.getCurrentContextStore)()?.curTxFunctionId!==void 0}static isInStep(){return(0,r.getCurrentContextStore)()?.curStepFunctionId!==void 0}static isWithinWorkflow(){return(0,r.getCurrentContextStore)()?.workflowId!==void 0}static isInWorkflow(){return e.isWithinWorkflow()&&!e.isInTransaction()&&!e.isInStep()}static async getEventDispatchState(t,n,r){return(0,d.ensureDBOSIsLaunched)(`getEventDispatchState`),await e.#e.getEventDispatchState(t,n,r)}static async upsertEventDispatchState(t){return(0,d.ensureDBOSIsLaunched)(`upsertEventDispatchState`),await e.#e.upsertEventDispatchState(t)}static getWorkflowStatus(t){if((0,d.ensureDBOSIsLaunched)(`getWorkflowStatus`),e.isWithinWorkflow()){if(e.isInStep())return e.#e.getWorkflowStatus(t);if(e.isInWorkflow())return e.#e.getWorkflowStatus(t,e.workflowID,(0,r.functionIDGetIncrement)());throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `getWorkflowStatus` inside a `transaction` or `procedure`")}return e.#e.getWorkflowStatus(t)}static async getResult(t,n){(0,d.ensureDBOSIsLaunched)(`getResult`);let i;return e.isWithinWorkflow()&&n!==void 0&&(i=(0,r.functionIDGetIncrement)()),await e.getResultInternal(t,n,i,void 0)}static async getResultInternal(t,n,r,a){return await x(async()=>{let a=await i.DBOSExecutor.globalInstance.systemDatabase.awaitWorkflowResult(t,n,e.workflowID,r);if(!a)return null;if(a?.cancelled)throw new c.DBOSAwaitedWorkflowCancelledError(t);return i.DBOSExecutor.reviveResultOrError(a)},`DBOS.getResult`,t,a)}static retrieveWorkflow(t){if((0,d.ensureDBOSIsLaunched)(`retrieveWorkflow`),e.isWithinWorkflow()){if(!e.isInWorkflow())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `retrieveWorkflow` inside a `transaction` or `step`");return new o.RetrievedHandle(i.DBOSExecutor.globalInstance.systemDatabase,t)}return e.#e.retrieveWorkflow(t)}static async listWorkflows(t){return(0,d.ensureDBOSIsLaunched)(`listWorkflows`),await x(async()=>await e.#e.listWorkflows(t),`DBOS.listWorkflows`)}static async listQueuedWorkflows(t){return(0,d.ensureDBOSIsLaunched)(`listQueuedWorkflows`),await x(async()=>await e.#e.listQueuedWorkflows(t),`DBOS.listQueuedWorkflows`)}static async listWorkflowSteps(t){return(0,d.ensureDBOSIsLaunched)(`listWorkflowSteps`),await x(async()=>await e.#e.listWorkflowSteps(t),`DBOS.listWorkflowSteps`)}static async cancelWorkflow(t){return(0,d.ensureDBOSIsLaunched)(`cancelWorkflow`),await x(async()=>await e.#e.cancelWorkflow(t),`DBOS.cancelWorkflow`)}static async resumeWorkflow(t){return(0,d.ensureDBOSIsLaunched)(`resumeWorkflow`),await x(async()=>await e.#e.resumeWorkflow(t),`DBOS.resumeWorkflow`),this.retrieveWorkflow(t)}static async forkWorkflow(t,n,r){(0,d.ensureDBOSIsLaunched)(`forkWorkflow`);let i=await x(async()=>await e.#e.forkWorkflow(t,n,r),`DBOS.forkWorkflow`);return this.retrieveWorkflow(i)}static async sleepms(t){if(e.isWithinWorkflow()&&!e.isInStep()){if(e.isInTransaction())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.sleep` inside a `transaction`");let n=(0,r.functionIDGetIncrement)();return t<=0?void 0:await i.DBOSExecutor.globalInstance.systemDatabase.durableSleepms(e.workflowID,n,t)}await(0,f.sleepms)(t)}static async sleepSeconds(t){return e.sleepms(t*1e3)}static async sleep(t){return e.sleepms(t)}static async now(){return e.isInWorkflow()?x(async()=>Promise.resolve(Date.now()),`DBOS.now`):Date.now()}static async randomUUID(){return e.isInWorkflow()?x(async()=>Promise.resolve((0,m.randomUUID)()),`DBOS.randomUUID`):(0,m.randomUUID)()}static async withNextWorkflowID(t,n){return(0,d.ensureDBOSIsLaunched)(`workflows`),e.#n({idAssignedForNextWorkflow:t},n)}static async withAuthedContext(t,n,r){return(0,d.ensureDBOSIsLaunched)(`auth`),e.#n({authenticatedUser:t,authenticatedRoles:n},r)}static async withNamedContext(t,n){return(0,d.ensureDBOSIsLaunched)(`tracing`),e.#n({operationCaller:t},n)}static async withWorkflowQueue(t,n){return(0,d.ensureDBOSIsLaunched)(`workflows`),e.#n({queueAssignedForWorkflows:t},n)}static async withWorkflowTimeout(t,n){return(0,d.ensureDBOSIsLaunched)(`workflows`),e.#n({workflowTimeoutMS:t},n)}static async runWithContext(t,n){return(0,d.ensureDBOSIsLaunched)(`contexts`),e.#n(t,n)}static async#n(e,t){let n=(0,r.getCurrentContextStore)();if(n){let r={};for(let t of Object.keys(e))Object.hasOwn(n,t)&&(r[t]=e[t]),n[t]=e[t];try{return await t()}finally{for(let t of Object.keys(e))Object.hasOwn(r,t)?n[t]=r[t]:delete n[t]}}else return await(0,r.runWithTopContext)(e,t)}static startWorkflow(t,n){(0,d.ensureDBOSIsLaunched)(`workflows`);let r=typeof t==`function`?null:t;if(r&&typeof r!=`function`&&!(r instanceof d.ConfiguredInstance))throw new c.DBOSInvalidWorkflowTransitionError("Attempt to call `startWorkflow` on an object that is not a `ConfiguredInstance`");if(n&&n.queueName){let e=this.#e.getQueueByName(n.queueName),t=n.enqueueOptions?.queuePartitionKey;if(e.partitionQueue&&!t)throw Error(`A workflow cannot be enqueued on partitioned queue ${n.queueName} without a partition key`);if(t&&!e.partitionQueue)throw Error(`You can only use a partition key on a partition-enabled queue. Key ${t} was used with non-partitioned queue ${n.queueName}`);if(t&&n.enqueueOptions?.deduplicationID)throw Error(`Deduplication is not supported for partitioned queues`)}let i=(0,d.getRegisteredOperations)(t);return new Proxy(t,{apply(t,i,a){let o=(0,d.getFunctionRegistration)(t);if(!o){let e=typeof t==`function`?t.name:t.toString();throw new c.DBOSNotRegisteredError(e,`${e} is not a registered DBOS workflow function`)}return e.#r(r,o,a,n)},get(t,a,o){let s=Reflect.get(t,a,o),l=(0,d.getFunctionRegistration)(s)??i.find(e=>e.name===a);if(l)return(...t)=>e.#r(r,l,t,n);let u=typeof a==`string`?a:String(a);throw new c.DBOSNotRegisteredError(u,`${u} is not a registered DBOS workflow function`)}})}static async send(t,n,a,o){if((0,d.ensureDBOSIsLaunched)(`send`),e.isWithinWorkflow()){if(!e.isInWorkflow())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.send` inside a `step` or `transaction`");if(o)throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.send` with an idempotency key from within a workflow");let s=(0,r.functionIDGetIncrement)();return await i.DBOSExecutor.globalInstance.systemDatabase.send(e.workflowID,s,t,f.DBOSJSON.stringify(n),a)}return e.#e.runSendTempWF(t,n,a,o)}static async recv(t,n){if((0,d.ensureDBOSIsLaunched)(`recv`),e.isWithinWorkflow()){if(!e.isInWorkflow())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.recv` inside a `step` or `transaction`");let a=(0,r.functionIDGetIncrement)(),o=(0,r.functionIDGetIncrement)();return f.DBOSJSON.parse(await i.DBOSExecutor.globalInstance.systemDatabase.recv(e.workflowID,a,o,t,n))}throw new c.DBOSInvalidWorkflowTransitionError("Attempt to call `DBOS.recv` outside of a workflow")}static async setEvent(t,n){if((0,d.ensureDBOSIsLaunched)(`setEvent`),e.isWithinWorkflow()){if(!e.isInWorkflow())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.setEvent` inside a `step` or `transaction`");let a=(0,r.functionIDGetIncrement)();return i.DBOSExecutor.globalInstance.systemDatabase.setEvent(e.workflowID,a,t,f.DBOSJSON.stringify(n))}throw new c.DBOSInvalidWorkflowTransitionError("Attempt to call `DBOS.setEvent` outside of a workflow")}static async getEvent(t,n,a){if((0,d.ensureDBOSIsLaunched)(`getEvent`),e.isWithinWorkflow()){if(!e.isInWorkflow())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.getEvent` inside a `step` or `transaction`");let o=(0,r.functionIDGetIncrement)(),s=(0,r.functionIDGetIncrement)(),l={workflowID:e.workflowID,functionID:o,timeoutFunctionID:s};return f.DBOSJSON.parse(await i.DBOSExecutor.globalInstance.systemDatabase.getEvent(t,n,a??i.DBOSExecutor.defaultNotificationTimeoutSec,l))}return e.#e.getEvent(t,n,a)}static async writeStream(t,n){if((0,d.ensureDBOSIsLaunched)(`writeStream`),e.isWithinWorkflow())if(e.isInWorkflow()){let a=(0,r.functionIDGetIncrement)();return await i.DBOSExecutor.globalInstance.systemDatabase.writeStreamFromWorkflow(e.workflowID,a,t,n)}else if(e.isInStep())return await i.DBOSExecutor.globalInstance.systemDatabase.writeStreamFromStep(e.workflowID,t,n);else throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.writeStream` outside of a workflow or step");else throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.writeStream` outside of a workflow or step")}static async closeStream(t){if((0,d.ensureDBOSIsLaunched)(`closeStream`),e.isWithinWorkflow())if(e.isInWorkflow()){let n=(0,r.functionIDGetIncrement)();return await i.DBOSExecutor.globalInstance.systemDatabase.closeStream(e.workflowID,n,t)}else throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.closeStream` outside of a workflow or step");else throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to `DBOS.closeStream` outside of a workflow")}static async*readStream(t,n){(0,d.ensureDBOSIsLaunched)(`readStream`);let r=0;for(;;)try{let e=await i.DBOSExecutor.globalInstance.systemDatabase.readStream(t,n,r);if(e===g.DBOS_STREAM_CLOSED_SENTINEL)break;yield e,r+=1}catch(n){if(n instanceof Error&&n.message.includes(`No value found`)){let n=await e.getWorkflowStatus(t);if(!n||!(0,o.isWorkflowActive)(n.status))break;await(0,f.sleepms)(1e3);continue}throw n}}static registerScheduled(e,t){u.ScheduledReceiver.registerScheduled(e,t)}static scheduled(t){function n(n,r,i){return i.value&&e.registerScheduled(i.value,{...t,ctorOrProto:n,name:String(r)}),i}return n}static workflow(t={}){function n(n,r,i){let{descriptor:a,registration:o}=(0,d.wrapDBOSFunctionAndRegisterByUniqueNameDec)(n,r,i),s=e.#i(o,t);return a.value=s,o.wrappedFunction=s,(0,d.registerFunctionWrapper)(s,o),a}return n}static registerWorkflow(t,n){let r=(0,d.wrapDBOSFunctionAndRegisterByUniqueName)(n?.ctorOrProto,n?.className,n?.name??t.name,t);return e.#i(r,n)}static async#r(t,n,a,o={},s){(0,d.ensureDBOSIsLaunched)(`workflows`);let l=(0,r.getNextWFID)(o.workflowID),u=(0,r.getCurrentContextStore)(),f=o.queueName??u?.queueAssignedForWorkflows,p=o.timeoutMS??u?.workflowTimeoutMS,m=t===void 0||typeof t==`function`?void 0:t;if(m&&!(m instanceof d.ConfiguredInstance))throw new c.DBOSInvalidWorkflowTransitionError("Attempt to call a `workflow` function on an object that is not a `ConfiguredInstance`");if(e.isWithinWorkflow()){if(!e.isInWorkflow())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to a `workflow` function from within a `step` or `transaction`");let t=s??(0,r.functionIDGetIncrement)(),n=(0,r.getCurrentContextStore)(),i=n.workflowId;return await h({workflowUUID:l||i+`-`+t,configuredInstance:m,queueName:f,timeoutMS:p,deadlineEpochMS:o.timeoutMS===null||n?.workflowTimeoutMS===null?void 0:n?.deadlineEpochMS,enqueueOptions:o.enqueueOptions},i,t)}else return await h({workflowUUID:l,queueName:f,enqueueOptions:o.enqueueOptions,configuredInstance:m,timeoutMS:p},void 0,void 0);function h(e,t,r){if(n.workflowConfig){let o=n.registeredFunction;return i.DBOSExecutor.globalInstance.internalWorkflow(o,e,t,r,...a)}if(n.stepConfig){let o=n.registeredFunction;return i.DBOSExecutor.globalInstance.startStepTempWF(o,e,t,r,...a)}throw new c.DBOSNotRegisteredError(n.name,`${n.name} is not a registered DBOS workflow, step, or transaction function`)}}static#i(t,n){t.setWorkflowConfig(n??{});let i=async function(...n){if((0,d.ensureDBOSIsLaunched)(`workflows`),e.isInWorkflow()){let i=(0,r.functionIDGetIncrement)(),a=(0,r.functionIDGetIncrement)();return await(await e.#r(this,t,n,void 0,i)).getResult(a)}return await(await e.#r(this,t,n)).getResult()};return(0,d.registerFunctionWrapper)(i,t),Object.defineProperty(i,`name`,{value:t.name}),i}static step(t={}){function n(n,a,o){let{descriptor:s,registration:l}=(0,d.wrapDBOSFunctionAndRegisterByUniqueNameDec)(n,a,o);l.setStepConfig(t);let u=async function(...t){(0,d.ensureDBOSIsLaunched)(`steps`);let n;if(!(this===void 0||typeof this==`function`)&&(n=this,!(n instanceof d.ConfiguredInstance)))throw new c.DBOSInvalidWorkflowTransitionError("Attempt to call a `step` function on an object that is not a `ConfiguredInstance`");if(e.isWithinWorkflow()){if(e.isInTransaction())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to a `step` function from within a `transaction`");return e.isInStep()?l.registeredFunction.call(this,...t):await i.DBOSExecutor.globalInstance.callStepFunction(l.registeredFunction,void 0,void 0,n??null,...t)}let a=(0,r.getNextWFID)(void 0),o={configuredInstance:n,workflowUUID:a};return await e.#e.runStepTempWF(l.registeredFunction,o,...t)};return s.value=u,l.wrappedFunction=u,(0,d.registerFunctionWrapper)(u,l),Object.defineProperty(u,`name`,{value:l.name}),s}return n}static registerStep(t,n={}){let a=n.name??t.name,o=(0,d.wrapDBOSFunctionAndRegister)(n?.ctorOrProto,n?.className,a,t),s=async function(...t){(0,d.ensureDBOSIsLaunched)(`steps`);let s=this,l=o.registeredFunction??o.origFunction;if(e.isWithinWorkflow()){if(e.isInTransaction())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to a `step` function from within a `transaction`");return e.isInStep()?l.call(this,...t):await i.DBOSExecutor.globalInstance.callStepFunction(l,a,n,s??null,...t)}if((0,r.getNextWFID)(void 0))throw new c.DBOSInvalidWorkflowTransitionError(`Invalid call to step '${a}' outside of a workflow; with directive to start a workflow.`);return l.call(this,...t)};return(0,d.registerFunctionWrapper)(s,o),Object.defineProperty(s,`name`,{value:a}),s}static runStep(t,n={}){(0,d.ensureDBOSIsLaunched)(`steps`);let a=n.name??t.name;if(e.isWithinWorkflow()){if(e.isInTransaction())throw new c.DBOSInvalidWorkflowTransitionError("Invalid call to a runStep from within a `transaction`");return e.isInStep()?t():i.DBOSExecutor.globalInstance.callStepFunction(t,a,n,null)}if((0,r.getNextWFID)(void 0))throw new c.DBOSInvalidWorkflowTransitionError(`Invalid call to step '${a}' outside of a workflow; with directive to start a workflow.`);return t()}static registerSerialization(t){if(e.isInitialized())throw TypeError(`Serializers/deserializers should not be registered after DBOS.launch()`);(0,f.registerSerializationRecipe)(t)}static defaultRequiredRole(e){function t(t){let n=(0,d.associateClassWithExternal)(d.DBOS_AUTH,t);n.requiredRole=e,(0,v.registerAuthChecker)()}return t}static requiredRole(e){function t(t,n,r){let i=(0,d.associateMethodWithExternal)(d.DBOS_AUTH,t,void 0,n.toString(),r.value);return i.regInfo.requiredRole=e,(0,v.registerAuthChecker)(),r.value=i.registration.wrappedFunction??i.registration.registeredFunction,r}return t}static registerLifecycleCallback(e){(0,d.registerLifecycleCallback)(e)}static registerMiddlewareInstaller(e){(0,d.registerMiddlewareInstaller)(e)}static associateClassWithInfo(e,t){return(0,d.associateClassWithExternal)(e,t)}static associateFunctionWithInfo(e,t,n){return(0,d.associateMethodWithExternal)(e,n.ctorOrProto,n.className,n.name??t.name,t)}static associateParamWithInfo(e,t,n){return(0,d.associateParameterWithExternal)(e,n.ctorOrProto,n.className,n.name??t?.name??`<unknown>`,t,n.param)}static getAssociatedInfo(e,t,n){return(0,d.getRegistrationsForExternal)(e,t,n)}};t.DBOS=S})),SS=r((t=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DBOSClient=t.ClientHandle=void 0;let n=kb(),r=by(),i=e(`node:crypto`),a=_y(),o=gy(),s=Ib(),c=Rb(),l=ny();var u=class{systemDatabase;workflowUUID;constructor(e,t){this.systemDatabase=e,this.workflowUUID=t}getWorkflowUUID(){return this.workflowUUID}get workflowID(){return this.workflowUUID}async getStatus(){let e=await this.systemDatabase.getWorkflowStatus(this.workflowUUID);return e?(0,s.toWorkflowStatus)(e):null}async getResult(){let e=await this.systemDatabase.awaitWorkflowResult(this.workflowID);if(e?.cancelled)throw new l.DBOSAwaitedWorkflowCancelledError(this.workflowID);return c.DBOSExecutor.reviveResultOrError(e)}async getWorkflowInputs(){let e=await this.systemDatabase.getWorkflowStatus(this.workflowUUID);return o.DBOSJSON.parse(e.input)}};t.ClientHandle=u,t.DBOSClient=class e{logger;systemDatabase;constructor(e,t){this.logger=new r.GlobalLogger,this.systemDatabase=new n.PostgresSystemDatabase(e,this.logger,n.DEFAULT_POOL_SIZE,t)}static async create({systemDatabaseUrl:t,systemDatabasePool:n}){let r=new e(t,n);return Promise.resolve(r)}async destroy(){await this.systemDatabase.destroy()}async enqueue(e,...t){let{workflowName:n,workflowClassName:r,workflowConfigName:s,queueName:c,appVersion:l}=e,d=e.workflowID??(0,i.randomUUID)(),f={workflowUUID:d,status:a.StatusString.ENQUEUED,workflowName:n,workflowClassName:r??``,workflowConfigName:s??``,queueName:c,authenticatedUser:``,output:null,error:null,assumedRole:``,authenticatedRoles:[],request:{},executorId:``,applicationVersion:l,applicationID:``,createdAt:Date.now(),timeoutMS:e.workflowTimeoutMS,deadlineEpochMS:void 0,input:o.DBOSJSON.stringify(t),deduplicationID:e.deduplicationID,priority:e.priority??0,queuePartitionKey:e.queuePartitionKey};return await this.systemDatabase.initWorkflowStatus(f),new u(this.systemDatabase,d)}async send(e,t,n,r){r??=(0,i.randomUUID)();let s={workflowUUID:`${e}-${r}`,status:a.StatusString.SUCCESS,workflowName:`temp_workflow-send-client`,workflowClassName:``,workflowConfigName:``,authenticatedUser:``,output:null,error:null,assumedRole:``,authenticatedRoles:[],request:{},executorId:``,applicationID:``,createdAt:Date.now(),input:o.DBOSJSON.stringify([e,t,n]),deduplicationID:void 0,priority:0,queuePartitionKey:void 0};await this.systemDatabase.initWorkflowStatus(s),await this.systemDatabase.send(s.workflowUUID,0,e,o.DBOSJSON.stringify(t),n)}async getEvent(e,t,n){return o.DBOSJSON.parse(await this.systemDatabase.getEvent(e,t,n??60))}retrieveWorkflow(e){return new u(this.systemDatabase,e)}cancelWorkflow(e){return this.systemDatabase.cancelWorkflow(e)}resumeWorkflow(e){return this.systemDatabase.resumeWorkflow(e)}forkWorkflow(e,t,n){return(0,s.forkWorkflow)(this.systemDatabase,e,t,n)}getWorkflow(e){return(0,s.getWorkflow)(this.systemDatabase,e)}listWorkflows(e){return(0,s.listWorkflows)(this.systemDatabase,e)}listQueuedWorkflows(e){return(0,s.listQueuedWorkflows)(this.systemDatabase,e)}listWorkflowSteps(e){return(0,s.listWorkflowSteps)(this.systemDatabase,e)}async*readStream(e,t){let r=0;for(;;)try{let i=await this.systemDatabase.readStream(e,t,r);if(i===n.DBOS_STREAM_CLOSED_SENTINEL)break;yield i,r+=1}catch(t){if(t instanceof Error&&t.message.includes(`No value found`)){let t=await this.getWorkflow(e);if(!t||!(0,a.isWorkflowActive)(t.status))break;await(0,o.sleepms)(1e3);continue}throw t}}}})),CS=r((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.MethodParameter=e.ConfiguredInstance=e.DebouncerClient=e.Debouncer=e.StatusString=e.DBOSWorkflowConflictError=e.Error=e.WorkflowQueue=e.ArgName=e.DBOSDataType=e.SchedulerMode=e.DBOSClient=e.DBOS=void 0;var i=xS();Object.defineProperty(e,`DBOS`,{enumerable:!0,get:function(){return i.DBOS}});var a=SS();Object.defineProperty(e,`DBOSClient`,{enumerable:!0,get:function(){return a.DBOSClient}});var o=Fb();Object.defineProperty(e,`SchedulerMode`,{enumerable:!0,get:function(){return o.SchedulerMode}});var s=Ab();Object.defineProperty(e,`DBOSDataType`,{enumerable:!0,get:function(){return s.DBOSDataType}}),Object.defineProperty(e,`ArgName`,{enumerable:!0,get:function(){return s.ArgName}});var c=Nb();Object.defineProperty(e,`WorkflowQueue`,{enumerable:!0,get:function(){return c.WorkflowQueue}}),e.Error=r(ny());var l=ny();Object.defineProperty(e,`DBOSWorkflowConflictError`,{enumerable:!0,get:function(){return l.DBOSWorkflowConflictError}});var u=_y();Object.defineProperty(e,`StatusString`,{enumerable:!0,get:function(){return u.StatusString}});var d=Lb();Object.defineProperty(e,`Debouncer`,{enumerable:!0,get:function(){return d.Debouncer}}),Object.defineProperty(e,`DebouncerClient`,{enumerable:!0,get:function(){return d.DebouncerClient}});var f=Ab();Object.defineProperty(e,`ConfiguredInstance`,{enumerable:!0,get:function(){return f.ConfiguredInstance}}),Object.defineProperty(e,`MethodParameter`,{enumerable:!0,get:function(){return f.MethodParameter}})}));CS();var wS=CS();function TS(e,t){return{name:``,queue:t.queue,fn:null,originalFn:e,execute:async t=>e(t)}}function ES(e,t){return{name:``,queue:t.queue,fn:null,originalFn:t=>e(t),execute:async t=>e(t),crontab:t.crontab}}var DS=class extends Error{constructor(e,t=400){super(e),this.statusCode=t,this.name=`PaginationError`}},OS=class extends DS{constructor(e=`The provided cursor is invalid or malformed`){super(e,400),this.name=`InvalidCursorError`}},kS=class extends DS{constructor(e){super(e,400),this.name=`ValidationError`}},AS=class e{static MAX_PAGE_SIZE=100;constructor(e,t){this.db=e,this.config=t}static encodeCursor(e){return Buffer.from(JSON.stringify(e),`utf-8`).toString(`base64url`)}static decodeCursor(e){if(typeof e!=`string`||e.length===0)throw new OS(`Cursor must be a non-empty string`);try{let t=Buffer.from(e,`base64url`).toString(`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)throw new OS(`Cursor must decode to an object`);return n}catch(e){throw e instanceof OS?e:new OS(`Cursor is malformed or uses an invalid encoding`)}}validateParams(t){if(`cursor`in t&&`cursorBefore`in t&&t.cursor&&t.cursorBefore)throw new kS(`Cannot specify both "cursor" and "cursorBefore" parameters`);if(t.pageSize!==void 0){if(t.pageSize<1)throw new kS(`Page size must be at least 1`);if(t.pageSize>e.MAX_PAGE_SIZE)throw new kS(`Page size cannot exceed ${e.MAX_PAGE_SIZE}`)}}async listCursor(t){this.validateParams(t);let{cursorColumn:n,tiebreaker:r,defaultPageSize:i}=this.config.pagination,a=t.pageSize||i,o=!!t.cursorBefore&&!t.cursor,s=t.cursor??t.cursorBefore,c,l;if(s!=null&&s!==``){let r=e.decodeCursor(s)._orderBy;r?(c=r.column,l=r.direction):(c=t.orderBy?.column||n,l=t.orderBy?.direction||`desc`)}else c=t.orderBy?.column||n,l=t.orderBy?.direction||`desc`;if(s===``)throw new OS(`Cursor must be a non-empty string`);let u=this.db.select().from(this.config.table).$dynamic(),d=[];d.push(Le(this.config.table[c]));let f=this.buildCursorCondition(s,c,l,o);if(f&&d.push(f),t.filters)for(let[e,n]of Object.entries(t.filters)){if(n==null)continue;let t=this.config.table[e];typeof n==`string`&&n.includes(`%`)?d.push(Re(t,n)):d.push(Ae(t,n))}if(t.search){let e=this.config.fields.filter(e=>e.searchable).map(e=>this.config.table[e.key]);if(e.length>0){let n=Me(...e.map(e=>ze(e,`${t.search}%`)));n&&d.push(n)}}if(d.length>0&&(u=u.where(je(...d))),o){let e=l===`desc`?`asc`:`desc`;u=this.applySort(u,{column:c,direction:e})}else u=this.applySort(u,{column:c,direction:l});let p=await u.limit(a+1);o&&(p=p.reverse());let m=p.length>a,h=o&&m?p.slice(1,a+1):p.slice(0,a),g=!s,_=o?await this.hasItemsAfter(h[h.length-1],t.orderBy,t.filters,t.search):m,v=o?m:g?!1:await this.hasItemsBefore(h[0],t.orderBy,t.filters,t.search);return{data:h,nextCursor:h.length>0&&_?this.extractCursor(h[h.length-1],{column:c,direction:l}):null,prevCursor:h.length>0&&v?this.extractCursor(h[0],{column:c,direction:l}):null,hasNext:_,hasPrev:v}}async listOffset(e){let{defaultPageSize:t}=this.config.pagination,n=e.pageSize||t,r=e.page||1,i=(r-1)*n,a=this.db.select().from(this.config.table).$dynamic(),o=[];o.push(...this.buildFilterConditions(e.filters)),o.push(...this.buildSearchConditions(e.search)),o.length>0&&(a=a.where(je(...o))),a=this.applySort(a,e.orderBy);let s=this.db.select({total:P`cast(count(*) as int)`}).from(this.config.table).$dynamic();o.length>0&&(s=s.where(je(...o)));let[c,[{total:l}]]=await Promise.all([a.limit(n).offset(i),s]);return{data:c,page:r,pageSize:n,total:l,totalPages:Math.ceil(l/n),hasMore:r*n<l}}buildFilterConditions(e){if(!e)return[];let t=[];for(let[n,r]of Object.entries(e)){if(r==null)continue;let e=this.config.table[n];typeof r==`string`&&r.includes(`%`)?t.push(Re(e,r)):t.push(Ae(e,r))}return t}buildSearchConditions(e){if(!e)return[];let t=this.config.fields.filter(e=>e.searchable).map(e=>this.config.table[e.key]);if(t.length===0)return[];let n=Me(...t.map(t=>ze(t,`${e}%`)));return n?[n]:[]}buildCursorCondition(t,n,r,i){if(t==null)return null;let{tiebreaker:a}=this.config.pagination,o=e.decodeCursor(t),s=typeof o[n]==`string`&&!Number.isNaN(Date.parse(o[n]))?new Date(o[n]):o[n],c=i?r===`desc`?Ne:Fe:r===`desc`?Fe:Ne;if(a){let e=typeof o[a]==`string`&&!Number.isNaN(Date.parse(o[a]))?new Date(o[a]):o[a];return s instanceof Date?je((i?r===`desc`?Pe:Ie:r===`desc`?Ie:Pe)(this.config.table[n],s),c(this.config.table[a],e)):Me(c(this.config.table[n],s),je(Ae(this.config.table[n],s),c(this.config.table[a],e)))}return c(this.config.table[n],s)}applySort(e,t){if(!t){let t=this.config.pagination.type===`cursor`?this.config.pagination.cursorColumn:`createdAt`,n=this.config.table[t];if(this.config.pagination.type===`cursor`){let{tiebreaker:r}=this.config.pagination;if(r&&r!==t){let t=this.config.table[r];return e.orderBy(Ve(n),Ve(t))}}return e.orderBy(Ve(n))}let n=this.config.table[t.column],r=t.direction===`asc`?Be:Ve;if(this.config.pagination.type===`cursor`){let{tiebreaker:i}=this.config.pagination;if(i&&i!==t.column){let t=this.config.table[i];return e.orderBy(r(n),r(t))}}return e.orderBy(r(n))}async hasItemsAfter(e,t,n,r){if(!e||this.config.pagination.type!==`cursor`)return!1;let{cursorColumn:i,tiebreaker:a}=this.config.pagination,o=t?.column||i,s=t?.direction||`desc`,c=this.db.select({exists:P`1`}).from(this.config.table).$dynamic(),l=[];l.push(Le(this.config.table[o])),l.push(...this.buildFilterConditions(n)),l.push(...this.buildSearchConditions(r));let u=e[o],d=s===`desc`?Fe:Ne;if(a){let t=e[a],n=Me(d(this.config.table[o],u),je(Ae(this.config.table[o],u),d(this.config.table[a],t)));n&&l.push(n)}else l.push(d(this.config.table[o],u));return l.length>0&&(c=c.where(je(...l))),(await c.limit(1)).length>0}async hasItemsBefore(e,t,n,r){if(!e||this.config.pagination.type!==`cursor`)return!1;let{cursorColumn:i,tiebreaker:a}=this.config.pagination,o=t?.column||i,s=t?.direction||`desc`,c=this.db.select({exists:P`1`}).from(this.config.table).$dynamic(),l=[];l.push(Le(this.config.table[o])),l.push(...this.buildFilterConditions(n)),l.push(...this.buildSearchConditions(r));let u=e[o],d=s===`desc`?Ne:Fe;if(a){let t=e[a],n=Me(d(this.config.table[o],u),je(Ae(this.config.table[o],u),d(this.config.table[a],t)));n&&l.push(n)}else l.push(d(this.config.table[o],u));return l.length>0&&(c=c.where(je(...l))),(await c.limit(1)).length>0}extractCursor(t,n){if(this.config.pagination.type!==`cursor`)return null;let{cursorColumn:r,tiebreaker:i}=this.config.pagination,a=n?.column||r,o=n?.direction||`desc`,s={[a]:t[a],_orderBy:{column:a,direction:o}};return i&&(s[i]=t[i]),e.encodeCursor(s)}};function jS(e){return{config:e,createQueryBuilder:t=>new AS(t,e)}}var MS=class extends Error{name;status;constructor(e,t){super(e,t);let n=this.constructor;this.name=n.name,this.message=e||n.message||``,this.status=t?.status||n.status||500;let r=t?.code||n.code;r!==void 0&&(this.code=r);let i=n.help;i!==void 0&&(this.help=i),Error.captureStackTrace(this,n)}get[Symbol.toStringTag](){return this.constructor.name}toString(){return this.code?`${this.name} [${this.code}]: ${this.message}`:`${this.name}: ${this.message}`}};function NS(e,t,n){return class extends MS{static message=e;static code=t;static status=n;constructor(t,n){super(p(e,...t||[]),n),this.name=`Exception`}}}var PS=r(((e,t)=>{let n=typeof Buffer<`u`,r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function a(e,t,a){a==null&&typeof t==`object`&&t&&(a=t,t=void 0),n&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));let s=JSON.parse(e,t);if(typeof s!=`object`||!s)return s;let c=a&&a.protoAction||`error`,l=a&&a.constructorAction||`error`;if(c===`ignore`&&l===`ignore`)return s;if(c!==`ignore`&&l!==`ignore`){if(r.test(e)===!1&&i.test(e)===!1)return s}else if(c!==`ignore`&&l===`ignore`){if(r.test(e)===!1)return s}else if(i.test(e)===!1)return s;return o(s,{protoAction:c,constructorAction:l,safe:a&&a.safe})}function o(e,{protoAction:t=`error`,constructorAction:n=`error`,safe:r}={}){let i=[e];for(;i.length;){let e=i;i=[];for(let a of e){if(t!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`__proto__`)){if(r===!0)return null;if(t===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.__proto__}if(n!==`ignore`&&Object.prototype.hasOwnProperty.call(a,`constructor`)&&a.constructor!==null&&typeof a.constructor==`object`&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`)){if(r===!0)return null;if(n===`error`)throw SyntaxError(`Object contains forbidden prototype property`);delete a.constructor}for(let e in a){let t=a[e];t&&typeof t==`object`&&i.push(t)}}}return e}function s(e,t,n){let{stackTraceLimit:r}=Error;Error.stackTraceLimit=0;try{return a(e,t,n)}finally{Error.stackTraceLimit=r}}function c(e,t){let{stackTraceLimit:n}=Error;Error.stackTraceLimit=0;try{return a(e,t,{safe:!0})}catch{return}finally{Error.stackTraceLimit=n}}t.exports=s,t.exports.default=s,t.exports.parse=s,t.exports.safeParse=c,t.exports.scan=o})),FS=r(((e,t)=>{let{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,e.stringify=r,e.configure=_,t.exports=r;let i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function a(e){return e.length<5e3&&!i.test(e)?`"${e}"`:JSON.stringify(e)}function o(e,t){if(e.length>200||t)return e.sort(t);for(let t=1;t<e.length;t++){let n=e[t],r=t;for(;r!==0&&e[r-1]>n;)e[r]=e[r-1],r--;e[r]=n}return e}let s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function c(e){return s.call(e)!==void 0&&e.length!==0}function l(e,t,n){e.length<n&&(n=e.length);let r=t===`,`?``:` `,i=`"0":${r}${e[0]}`;for(let a=1;a<n;a++)i+=`${t}"${a}":${r}${e[a]}`;return i}function u(e){if(n.call(e,`circularValue`)){let t=e.circularValue;if(typeof t==`string`)return`"${t}"`;if(t==null)return t;if(t===Error||t===TypeError)return{toString(){throw TypeError(`Converting circular structure to JSON`)}};throw TypeError(`The "circularValue" argument must be of type string or the value null or undefined`)}return`"[Circular]"`}function d(e){let t;if(n.call(e,`deterministic`)&&(t=e.deterministic,typeof t!=`boolean`&&typeof t!=`function`))throw TypeError(`The "deterministic" argument must be of type boolean or comparator function`);return t===void 0?!0:t}function f(e,t){let r;if(n.call(e,t)&&(r=e[t],typeof r!=`boolean`))throw TypeError(`The "${t}" argument must be of type boolean`);return r===void 0?!0:r}function p(e,t){let r;if(n.call(e,t)){if(r=e[t],typeof r!=`number`)throw TypeError(`The "${t}" argument must be of type number`);if(!Number.isInteger(r))throw TypeError(`The "${t}" argument must be an integer`);if(r<1)throw RangeError(`The "${t}" argument must be >= 1`)}return r===void 0?1/0:r}function m(e){return e===1?`1 item`:`${e} items`}function h(e){let t=new Set;for(let n of e)(typeof n==`string`||typeof n==`number`)&&t.add(String(n));return t}function g(e){if(n.call(e,`strict`)){let t=e.strict;if(typeof t!=`boolean`)throw TypeError(`The "strict" argument must be of type boolean`);if(t)return e=>{let t=`Object can not safely be stringified. Received type ${typeof e}`;throw typeof e!=`function`&&(t+=` (${e.toString()})`),Error(t)}}}function _(e){e={...e};let t=g(e);t&&(e.bigint===void 0&&(e.bigint=!1),`circularValue`in e||(e.circularValue=Error));let n=u(e),r=f(e,`bigint`),i=d(e),s=typeof i==`function`?i:void 0,_=p(e,`maximumDepth`),v=p(e,`maximumBreadth`);function y(e,l,u,d,f,p){let h=l[e];switch(typeof h==`object`&&h&&typeof h.toJSON==`function`&&(h=h.toJSON(e)),h=d.call(l,e,h),typeof h){case`string`:return a(h);case`object`:{if(h===null)return`null`;if(u.indexOf(h)!==-1)return n;let e=``,t=`,`,r=p;if(Array.isArray(h)){if(h.length===0)return`[]`;if(_<u.length+1)return`"[Array]"`;u.push(h),f!==``&&(p+=f,e+=`\n${p}`,t=`,\n${p}`);let n=Math.min(h.length,v),i=0;for(;i<n-1;i++){let n=y(String(i),h,u,d,f,p);e+=n===void 0?`null`:n,e+=t}let a=y(String(i),h,u,d,f,p);if(e+=a===void 0?`null`:a,h.length-1>v){let n=h.length-v-1;e+=`${t}"... ${m(n)} not stringified"`}return f!==``&&(e+=`\n${r}`),u.pop(),`[${e}]`}let l=Object.keys(h),g=l.length;if(g===0)return`{}`;if(_<u.length+1)return`"[Object]"`;let b=``,x=``;f!==``&&(p+=f,t=`,\n${p}`,b=` `);let S=Math.min(g,v);i&&!c(h)&&(l=o(l,s)),u.push(h);for(let n=0;n<S;n++){let r=l[n],i=y(r,h,u,d,f,p);i!==void 0&&(e+=`${x}${a(r)}:${b}${i}`,x=t)}if(g>v){let n=g-v;e+=`${x}"...":${b}"${m(n)} not stringified"`,x=t}return f!==``&&x.length>1&&(e=`\n${p}${e}\n${r}`),u.pop(),`{${e}}`}case`number`:return isFinite(h)?String(h):t?t(h):`null`;case`boolean`:return h===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(h);default:return t?t(h):void 0}}function b(e,i,o,s,c,l){switch(typeof i==`object`&&i&&typeof i.toJSON==`function`&&(i=i.toJSON(e)),typeof i){case`string`:return a(i);case`object`:{if(i===null)return`null`;if(o.indexOf(i)!==-1)return n;let e=l,t=``,r=`,`;if(Array.isArray(i)){if(i.length===0)return`[]`;if(_<o.length+1)return`"[Array]"`;o.push(i),c!==``&&(l+=c,t+=`\n${l}`,r=`,\n${l}`);let n=Math.min(i.length,v),a=0;for(;a<n-1;a++){let e=b(String(a),i[a],o,s,c,l);t+=e===void 0?`null`:e,t+=r}let u=b(String(a),i[a],o,s,c,l);if(t+=u===void 0?`null`:u,i.length-1>v){let e=i.length-v-1;t+=`${r}"... ${m(e)} not stringified"`}return c!==``&&(t+=`\n${e}`),o.pop(),`[${t}]`}o.push(i);let u=``;c!==``&&(l+=c,r=`,\n${l}`,u=` `);let d=``;for(let e of s){let n=b(e,i[e],o,s,c,l);n!==void 0&&(t+=`${d}${a(e)}:${u}${n}`,d=r)}return c!==``&&d.length>1&&(t=`\n${l}${t}\n${e}`),o.pop(),`{${t}}`}case`number`:return isFinite(i)?String(i):t?t(i):`null`;case`boolean`:return i===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(i);default:return t?t(i):void 0}}function x(e,u,d,f,p){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return x(e,u,d,f,p);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=p;if(Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u),p+=f;let e=`\n${p}`,n=`,\n${p}`,r=Math.min(u.length,v),i=0;for(;i<r-1;i++){let t=x(String(i),u[i],d,f,p);e+=t===void 0?`null`:t,e+=n}let a=x(String(i),u[i],d,f,p);if(e+=a===void 0?`null`:a,u.length-1>v){let t=u.length-v-1;e+=`${n}"... ${m(t)} not stringified"`}return e+=`\n${t}`,d.pop(),`[${e}]`}let r=Object.keys(u),h=r.length;if(h===0)return`{}`;if(_<d.length+1)return`"[Object]"`;p+=f;let g=`,\n${p}`,y=``,b=``,S=Math.min(h,v);c(u)&&(y+=l(u,g,v),r=r.slice(u.length),S-=u.length,b=g),i&&(r=o(r,s)),d.push(u);for(let e=0;e<S;e++){let t=r[e],n=x(t,u[t],d,f,p);n!==void 0&&(y+=`${b}${a(t)}: ${n}`,b=g)}if(h>v){let e=h-v;y+=`${b}"...": "${m(e)} not stringified"`,b=g}return b!==``&&(y=`\n${p}${y}\n${t}`),d.pop(),`{${y}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function S(e,u,d){switch(typeof u){case`string`:return a(u);case`object`:{if(u===null)return`null`;if(typeof u.toJSON==`function`){if(u=u.toJSON(e),typeof u!=`object`)return S(e,u,d);if(u===null)return`null`}if(d.indexOf(u)!==-1)return n;let t=``,r=u.length!==void 0;if(r&&Array.isArray(u)){if(u.length===0)return`[]`;if(_<d.length+1)return`"[Array]"`;d.push(u);let e=Math.min(u.length,v),n=0;for(;n<e-1;n++){let e=S(String(n),u[n],d);t+=e===void 0?`null`:e,t+=`,`}let r=S(String(n),u[n],d);if(t+=r===void 0?`null`:r,u.length-1>v){let e=u.length-v-1;t+=`,"... ${m(e)} not stringified"`}return d.pop(),`[${t}]`}let f=Object.keys(u),p=f.length;if(p===0)return`{}`;if(_<d.length+1)return`"[Object]"`;let h=``,g=Math.min(p,v);r&&c(u)&&(t+=l(u,`,`,v),f=f.slice(u.length),g-=u.length,h=`,`),i&&(f=o(f,s)),d.push(u);for(let e=0;e<g;e++){let n=f[e],r=S(n,u[n],d);r!==void 0&&(t+=`${h}${a(n)}:${r}`,h=`,`)}if(p>v){let e=p-v;t+=`${h}"...":"${m(e)} not stringified"`}return d.pop(),`{${t}}`}case`number`:return isFinite(u)?String(u):t?t(u):`null`;case`boolean`:return u===!0?`true`:`false`;case`undefined`:return;case`bigint`:if(r)return String(u);default:return t?t(u):void 0}}function C(e,t,n){if(arguments.length>1){let r=``;if(typeof n==`number`?r=` `.repeat(Math.min(n,10)):typeof n==`string`&&(r=n.slice(0,10)),t!=null){if(typeof t==`function`)return y(``,{"":e},[],t,r,``);if(Array.isArray(t))return b(``,e,[],h(t),r,``)}if(r.length!==0)return x(``,e,[],r,``)}return S(``,e,[])}return C}}));PS();const IS=t(FS(),1).configure;IS({bigint:!1,circularValue:void 0,deterministic:!1});var LS=Object.defineProperty,RS=Object.getOwnPropertyDescriptor,zS=Object.getOwnPropertyNames,BS=Object.prototype.hasOwnProperty,VS=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of zS(t))!BS.call(e,i)&&i!==n&&LS(e,i,{get:()=>t[i],enumerable:!(r=RS(t,i))||r.enumerable});return e},HS=(e,t,n)=>(VS(e,t,`default`),n&&VS(n,t,`default`)),US=r(((e,t)=>{(function(){function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function r(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&!1!==t(e[n],n,e););}function i(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function a(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function o(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function s(e){return function(t){return e(t)}}function c(e){var t=Object;return function(n){return e(t(n))}}function l(){}function u(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function d(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function f(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function p(e){this.size=(this.__data__=new d(e)).size}function m(e,t){var n=hn(e),r=!n&&mn(e),i=!n&&!r&&gn(e),a=!n&&!r&&!i&&yn(e);if(n=n||r||i||a){for(var r=e.length,o=String,s=-1,c=Array(r);++s<r;)c[s]=o(s);r=c}else r=[];var l,o=r.length;for(l in e)!t&&!wt.call(e,l)||n&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||P(l,o))||r.push(l);return r}function h(e,t,n){(n===F||Ne(e[t],n))&&(n!==F||t in e)||b(e,t,n)}function g(e,t,n){var r=e[t];wt.call(e,t)&&Ne(r,n)&&(n!==F||t in e)||b(e,t,n)}function _(e,t){for(var n=e.length;n--;)if(Ne(e[n][0],t))return n;return-1}function v(e,t){return e&&me(t,Ke(t),e)}function y(e,t){return e&&me(t,qe(t),e)}function b(e,t,n){t==`__proto__`&&zt?zt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function x(e,t,n,i,a,o){var s,c=1&t,l=2&t,u=4&t;if(n&&(s=a?n(e,i,a,o):n(e)),s!==F)return s;if(!Re(e))return e;if(i=hn(e)){if(s=Se(e),!c)return pe(e,s)}else{var d=dn(e),f=d==`[object Function]`||d==`[object GeneratorFunction]`;if(gn(e))return ue(e,c);if(d==`[object Object]`||d==`[object Arguments]`||f&&!a){if(s=l||f?{}:Ce(e),!c)return l?ge(e,y(s,e)):he(e,v(s,e))}else{if(!L[d])return a?e:{};s=we(e,d,c)}}if(o||=new p,a=o.get(e))return a;if(o.set(e,s),vn(e))return e.forEach(function(r){s.add(x(r,t,n,r,e,o))}),s;if(_n(e))return e.forEach(function(r,i){s.set(i,x(r,t,n,i,e,o))}),s;var l=u?l?be:ye:l?qe:Ke,m=i?F:l(e);return r(m||e,function(r,i){m&&(i=r,r=e[i]),g(s,i,x(r,t,n,i,e,o))}),s}function S(e,t,n,r,i){var a=-1,s=e.length;for(n||=Te,i||=[];++a<s;){var c=e[a];0<t&&n(c)?1<t?S(c,t-1,n,r,i):o(i,c):r||(i[i.length]=c)}return i}function C(e,t){t=le(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Oe(t[n++])];return n&&n==r?e:F}function w(e,t,n){return t=t(e),hn(e)?t:o(t,n(e))}function T(e){if(e==null)e=e===F?`[object Undefined]`:`[object Null]`;else if(Rt&&Rt in Object(e)){var t=wt.call(e,Rt),n=e[Rt];try{e[Rt]=F;var r=!0}catch{}var i=Et.call(e);r&&(t?e[Rt]=n:delete e[Rt]),e=i}else e=Et.call(e);return e}function E(e,t){return e!=null&&wt.call(e,t)}function ee(e,t){return e!=null&&t in Object(e)}function te(e){return ze(e)&&T(e)==`[object Arguments]`}function D(e){return ze(e)&&dn(e)==`[object Map]`}function ne(e){return ze(e)&&dn(e)==`[object Set]`}function O(e){return ze(e)&&Le(e.length)&&!!I[T(e)]}function k(e){if(!Ee(e))return Ht(e);var t,n=[];for(t in Object(e))wt.call(e,t)&&t!=`constructor`&&n.push(t);return n}function re(e,t,n,r,i){e!==t&&sn(t,function(a,o){if(Re(a)){i||=new p;var s=i,c=o==`__proto__`?F:e[o],l=o==`__proto__`?F:t[o],u=s.get(l);if(u)h(e,o,u);else{var u=r?r(c,l,o+``,e,t,s):F,d=u===F;if(d){var f=hn(l),m=!f&&gn(l),g=!f&&!m&&yn(l),u=l;f||m||g?hn(c)?u=c:Fe(c)?u=pe(c):m?(d=!1,u=ue(l,!0)):g?(d=!1,u=fe(l,!0)):u=[]:Be(l)||mn(l)?(u=c,mn(c)?u=Ue(c):(!Re(c)||n&&Ie(c))&&(u=Ce(l))):d=!1}d&&(s.set(l,u),re(u,l,n,r,s),s.delete(l)),h(e,o,u)}}else s=r?r(o==`__proto__`?F:e[o],a,o+``,e,t,i):F,s===F&&(s=a),h(e,o,s)},qe)}function A(e,t){return ie(e,t,function(t,n){return Ge(e,n)})}function ie(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=C(e,o);n(s,o)&&oe(a,le(o,e),s)}return a}function ae(e){return fn(De(e,void 0,Ye),e+``)}function oe(e,t,n){if(!Re(e))return e;t=le(t,e);for(var r=-1,i=t.length,a=i-1,o=e;o!=null&&++r<i;){var s=Oe(t[r]),c=n;if(r!=a){var l=o[s],c=F;c===F&&(c=Re(l)?l:P(t[r+1])?[]:{})}g(o,s,c),o=o[s]}return e}function se(e){if(typeof e==`string`)return e;if(hn(e))return a(e,se)+``;if(He(e))return an?an.call(e):``;var t=e+``;return t==`0`&&1/e==-Qe?`-0`:t}function ce(e,t){t=le(t,e);var n;if(2>t.length)n=e;else{n=t;var r=0,i=-1,a=-1,o=n.length;for(0>r&&(r=-r>o?0:o+r),i=i>o?o:i,0>i&&(i+=o),o=r>i?0:i-r>>>0,r>>>=0,i=Array(o);++a<o;)i[a]=n[a+r];n=C(e,i)}return e=n,e==null||delete e[Oe(je(t))]}function le(e,t){var n;return hn(e)?n=e:(hn(e)?n=!1:(n=typeof e,n=!(n!=`number`&&n!=`symbol`&&n!=`boolean`&&e!=null&&!He(e))||et.test(e)||!$e.test(e)||t!=null&&e in Object(t)),n=n?[e]:pn(We(e))),n}function ue(e,t){if(t)return e.slice();var n=e.length,n=Mt?Mt(n):new e.constructor(n);return e.copy(n),n}function de(e){var t=new e.constructor(e.byteLength);return new jt(t).set(new jt(e)),t}function fe(e,t){return new e.constructor(t?de(e.buffer):e.buffer,e.byteOffset,e.length)}function pe(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function me(e,t,n){var r=!n;n||={};for(var i=-1,a=t.length;++i<a;){var o=t[i],s=F;s===F&&(s=e[o]),r?b(n,o,s):g(n,o,s)}return n}function he(e,t){return me(e,ln(e),t)}function ge(e,t){return me(e,un(e),t)}function _e(e){return ae(function(t,n){var r,i=-1,a=n.length,o=1<a?n[a-1]:F,s=2<a?n[2]:F,o=3<e.length&&typeof o==`function`?(a--,o):F;if(r=s){r=n[0];var c=n[1];if(Re(s)){var l=typeof c;r=!!(l==`number`?Pe(s)&&P(c,s.length):l==`string`&&c in s)&&Ne(s[c],r)}else r=!1}for(r&&(o=3>a?F:o,a=1),t=Object(t);++i<a;)(s=n[i])&&e(t,s,i,o);return t})}function ve(e){return Be(e)?F:e}function j(e){return fn(De(e,F,Ae),e+``)}function ye(e){return w(e,Ke,ln)}function be(e){return w(e,qe,un)}function M(e,t){var n=e.__data__,r=typeof t;return(r==`string`||r==`number`||r==`symbol`||r==`boolean`?t!==`__proto__`:t===null)?n[typeof t==`string`?`string`:`hash`]:n.map}function N(e,t){var n=e==null?F:e[t];return!(!Re(n)||Tt&&Tt in n)&&(Ie(n)?Ot:it).test(ke(n))?n:F}function xe(e,t,n){t=le(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=Oe(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Le(i)&&P(o,i)&&(hn(e)||mn(e)))}function Se(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&wt.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Ce(e){return typeof e.constructor!=`function`||Ee(e)?{}:on(Nt(e))}function we(e,t,n){var r=e.constructor;switch(t){case`[object ArrayBuffer]`:return de(e);case`[object Boolean]`:case`[object Date]`:return new r(+e);case`[object DataView]`:return t=n?de(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.byteLength);case`[object Float32Array]`:case`[object Float64Array]`:case`[object Int8Array]`:case`[object Int16Array]`:case`[object Int32Array]`:case`[object Uint8Array]`:case`[object Uint8ClampedArray]`:case`[object Uint16Array]`:case`[object Uint32Array]`:return fe(e,n);case`[object Map]`:return new r;case`[object Number]`:case`[object String]`:return new r(e);case`[object RegExp]`:return t=new e.constructor(e.source,rt.exec(e)),t.lastIndex=e.lastIndex,t;case`[object Set]`:return new r;case`[object Symbol]`:return rn?Object(rn.call(e)):{}}}function Te(e){return hn(e)||mn(e)||!!(Lt&&e&&e[Lt])}function P(e,t){var n=typeof e;return t??=9007199254740991,!!t&&(n==`number`||n!=`symbol`&&at.test(e))&&-1<e&&e%1==0&&e<t}function Ee(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||xt)}function De(e,t,r){return t=Ut(t===F?e.length-1:t,0),function(){for(var i=arguments,a=-1,o=Ut(i.length-t,0),s=Array(o);++a<o;)s[a]=i[t+a];for(a=-1,o=Array(t+1);++a<t;)o[a]=i[a];return o[t]=r(s),n(e,this,o)}}function Oe(e){if(typeof e==`string`||He(e))return e;var t=e+``;return t==`0`&&1/e==-Qe?`-0`:t}function ke(e){if(e!=null){try{return Ct.call(e)}catch{}return e+``}return``}function Ae(e){return e!=null&&e.length?S(e,1):[]}function je(e){var t=e==null?0:e.length;return t?e[t-1]:F}function Me(e,t){function n(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;return a.has(i)?a.get(i):(r=e.apply(this,r),n.cache=a.set(i,r)||a,r)}if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);return n.cache=new(Me.Cache||f),n}function Ne(e,t){return e===t||e!==e&&t!==t}function Pe(e){return e!=null&&Le(e.length)&&!Ie(e)}function Fe(e){return ze(e)&&Pe(e)}function Ie(e){return!!Re(e)&&(e=T(e),e==`[object Function]`||e==`[object GeneratorFunction]`||e==`[object AsyncFunction]`||e==`[object Proxy]`)}function Le(e){return typeof e==`number`&&-1<e&&e%1==0&&9007199254740991>=e}function Re(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function ze(e){return typeof e==`object`&&!!e}function Be(e){return!(!ze(e)||T(e)!=`[object Object]`)&&(e=Nt(e),e===null||(e=wt.call(e,`constructor`)&&e.constructor,typeof e==`function`&&e instanceof e&&Ct.call(e)==Dt))}function Ve(e){return typeof e==`string`||!hn(e)&&ze(e)&&T(e)==`[object String]`}function He(e){return typeof e==`symbol`||ze(e)&&T(e)==`[object Symbol]`}function Ue(e){return me(e,qe(e))}function We(e){return e==null?``:se(e)}function Ge(e,t){return e!=null&&xe(e,t,ee)}function Ke(e){return Pe(e)?m(e):k(e)}function qe(e){if(Pe(e))e=m(e,!0);else if(Re(e)){var t,n=Ee(e),r=[];for(t in e)(t!=`constructor`||!n&&wt.call(e,t))&&r.push(t);e=r}else{if(t=[],e!=null)for(n in Object(e))t.push(n);e=t}return e}function Je(e){return function(){return e}}function Ye(e){return e}function Xe(){return[]}function Ze(){return!1}var F,Qe=1/0,$e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,et=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/\\(\\)?/g,rt=/\w*$/,it=/^\[object .+?Constructor\]$/,at=/^(?:0|[1-9]\d*)$/,ot=RegExp(`\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*`,`g`),st=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`),I={};I[`[object Float32Array]`]=I[`[object Float64Array]`]=I[`[object Int8Array]`]=I[`[object Int16Array]`]=I[`[object Int32Array]`]=I[`[object Uint8Array]`]=I[`[object Uint8ClampedArray]`]=I[`[object Uint16Array]`]=I[`[object Uint32Array]`]=!0,I[`[object Arguments]`]=I[`[object Array]`]=I[`[object ArrayBuffer]`]=I[`[object Boolean]`]=I[`[object DataView]`]=I[`[object Date]`]=I[`[object Error]`]=I[`[object Function]`]=I[`[object Map]`]=I[`[object Number]`]=I[`[object Object]`]=I[`[object RegExp]`]=I[`[object Set]`]=I[`[object String]`]=I[`[object WeakMap]`]=!1;var L={};L[`[object Arguments]`]=L[`[object Array]`]=L[`[object ArrayBuffer]`]=L[`[object DataView]`]=L[`[object Boolean]`]=L[`[object Date]`]=L[`[object Float32Array]`]=L[`[object Float64Array]`]=L[`[object Int8Array]`]=L[`[object Int16Array]`]=L[`[object Int32Array]`]=L[`[object Map]`]=L[`[object Number]`]=L[`[object Object]`]=L[`[object RegExp]`]=L[`[object Set]`]=L[`[object String]`]=L[`[object Symbol]`]=L[`[object Uint8Array]`]=L[`[object Uint8ClampedArray]`]=L[`[object Uint16Array]`]=L[`[object Uint32Array]`]=!0,L[`[object Error]`]=L[`[object Function]`]=L[`[object WeakMap]`]=!1;var ct,lt=typeof global==`object`&&global&&global.Object===Object&&global,ut=typeof self==`object`&&self&&self.Object===Object&&self,dt=lt||ut||Function(`return this`)(),ft=typeof e==`object`&&e&&!e.nodeType&&e,pt=ft&&typeof t==`object`&&t&&!t.nodeType&&t,mt=pt&&pt.exports===ft,ht=mt&&lt.process;t:{try{ct=ht&&ht.binding&&ht.binding(`util`);break t}catch{}ct=void 0}var gt=ct&&ct.isMap,_t=ct&&ct.isSet,vt=ct&&ct.isTypedArray,yt=function(e){return function(t){return t==null?F:t[e]}}(`length`),bt=Array.prototype,xt=Object.prototype,St=dt[`__core-js_shared__`],Ct=Function.prototype.toString,wt=xt.hasOwnProperty,Tt=function(){var e=/[^.]+$/.exec(St&&St.keys&&St.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),Et=xt.toString,Dt=Ct.call(Object),Ot=RegExp(`^`+Ct.call(wt).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),kt=mt?dt.Buffer:F,At=dt.Symbol,jt=dt.Uint8Array,Mt=kt?kt.a:F,Nt=c(Object.getPrototypeOf),Pt=Object.create,Ft=xt.propertyIsEnumerable,It=bt.splice,Lt=At?At.isConcatSpreadable:F,Rt=At?At.toStringTag:F,zt=function(){try{var e=N(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Bt=Object.getOwnPropertySymbols,Vt=kt?kt.isBuffer:F,Ht=c(Object.keys),Ut=Math.max,Wt=Date.now,Gt=N(dt,`DataView`),Kt=N(dt,`Map`),qt=N(dt,`Promise`),Jt=N(dt,`Set`),Yt=N(dt,`WeakMap`),Xt=N(Object,`create`),Zt=ke(Gt),Qt=ke(Kt),$t=ke(qt),en=ke(Jt),tn=ke(Yt),nn=At?At.prototype:F,rn=nn?nn.valueOf:F,an=nn?nn.toString:F,on=function(){function e(){}return function(t){return Re(t)?Pt?Pt(t):(e.prototype=t,t=new e,e.prototype=F,t):{}}}();u.prototype.clear=function(){this.__data__=Xt?Xt(null):{},this.size=0},u.prototype.delete=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},u.prototype.get=function(e){var t=this.__data__;return Xt?(e=t[e],e===`__lodash_hash_undefined__`?F:e):wt.call(t,e)?t[e]:F},u.prototype.has=function(e){var t=this.__data__;return Xt?t[e]!==F:wt.call(t,e)},u.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Xt&&t===F?`__lodash_hash_undefined__`:t,this},d.prototype.clear=function(){this.__data__=[],this.size=0},d.prototype.delete=function(e){var t=this.__data__;return e=_(t,e),!(0>e)&&(e==t.length-1?t.pop():It.call(t,e,1),--this.size,!0)},d.prototype.get=function(e){var t=this.__data__;return e=_(t,e),0>e?F:t[e][1]},d.prototype.has=function(e){return-1<_(this.__data__,e)},d.prototype.set=function(e,t){var n=this.__data__,r=_(n,e);return 0>r?(++this.size,n.push([e,t])):n[r][1]=t,this},f.prototype.clear=function(){this.size=0,this.__data__={hash:new u,map:new(Kt||d),string:new u}},f.prototype.delete=function(e){return e=M(this,e).delete(e),this.size-=e?1:0,e},f.prototype.get=function(e){return M(this,e).get(e)},f.prototype.has=function(e){return M(this,e).has(e)},f.prototype.set=function(e,t){var n=M(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},p.prototype.clear=function(){this.__data__=new d,this.size=0},p.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},p.prototype.get=function(e){return this.__data__.get(e)},p.prototype.has=function(e){return this.__data__.has(e)},p.prototype.set=function(e,t){var n=this.__data__;if(n instanceof d){var r=n.__data__;if(!Kt||199>r.length)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new f(r)}return n.set(e,t),this.size=n.size,this};var sn=function(e){return function(t,n,r){var i=-1,a=Object(t);r=r(t);for(var o=r.length;o--;){var s=r[e?o:++i];if(!1===n(a[s],s,a))break}return t}}(),cn=zt?function(e,t){return zt(e,`toString`,{configurable:!0,enumerable:!1,value:Je(t),writable:!0})}:Ye,ln=Bt?function(e){return e==null?[]:(e=Object(e),i(Bt(e),function(t){return Ft.call(e,t)}))}:Xe,un=Bt?function(e){for(var t=[];e;)o(t,ln(e)),e=Nt(e);return t}:Xe,dn=T;(Gt&&dn(new Gt(new ArrayBuffer(1)))!=`[object DataView]`||Kt&&dn(new Kt)!=`[object Map]`||qt&&dn(qt.resolve())!=`[object Promise]`||Jt&&dn(new Jt)!=`[object Set]`||Yt&&dn(new Yt)!=`[object WeakMap]`)&&(dn=function(e){var t=T(e);if(e=(e=t==`[object Object]`?e.constructor:F)?ke(e):``)switch(e){case Zt:return`[object DataView]`;case Qt:return`[object Map]`;case $t:return`[object Promise]`;case en:return`[object Set]`;case tn:return`[object WeakMap]`}return t});var fn=function(e){var t=0,n=0;return function(){var r=Wt(),i=16-(r-n);if(n=r,0<i){if(800<=++t)return arguments[0]}else t=0;return e.apply(F,arguments)}}(cn),pn=function(e){e=Me(e,function(e){return t.size===500&&t.clear(),e});var t=e.cache;return e}(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(tt,function(e,n,r,i){t.push(r?i.replace(nt,`$1`):n||e)}),t});Me.Cache=f;var mn=te(function(){return arguments}())?te:function(e){return ze(e)&&wt.call(e,`callee`)&&!Ft.call(e,`callee`)},hn=Array.isArray,gn=Vt||Ze,_n=gt?s(gt):D,vn=_t?s(_t):ne,yn=vt?s(vt):O,bn=_e(function(e,t,n){re(e,t,n)}),xn=_e(function(e,t,n,r){re(e,t,n,r)}),Sn=j(function(e,t){var n={};if(e==null)return n;var r=!1;t=a(t,function(t){return t=le(t,e),r||=1<t.length,t}),me(e,be(e),n),r&&(n=x(n,7,ve));for(var i=t.length;i--;)ce(n,t[i]);return n}),Cn=j(function(e,t){return e==null?{}:A(e,t)});l.constant=Je,l.flatten=Ae,l.keys=Ke,l.keysIn=qe,l.memoize=Me,l.merge=bn,l.mergeWith=xn,l.omit=Sn,l.pick=Cn,l.set=function(e,t,n){return e==null?e:oe(e,t,n)},l.toPath=function(e){return hn(e)?a(e,Oe):He(e)?[e]:pe(pn(We(e)))},l.toPlainObject=Ue,l.unset=function(e,t){return e==null||ce(e,t)},l.clone=function(e){return x(e,4)},l.cloneDeep=function(e){return x(e,5)},l.cloneDeepWith=function(e,t){return t=typeof t==`function`?t:F,x(e,5,t)},l.cloneWith=function(e,t){return t=typeof t==`function`?t:F,x(e,4,t)},l.eq=Ne,l.get=function(e,t,n){return e=e==null?F:C(e,t),e===F?n:e},l.has=function(e,t){return e!=null&&xe(e,t,E)},l.hasIn=Ge,l.identity=Ye,l.isArguments=mn,l.isArray=hn,l.isArrayLike=Pe,l.isArrayLikeObject=Fe,l.isBuffer=gn,l.isFunction=Ie,l.isLength=Le,l.isMap=_n,l.isObject=Re,l.isObjectLike=ze,l.isPlainObject=Be,l.isSet=vn,l.isString=Ve,l.isSymbol=He,l.isTypedArray=yn,l.last=je,l.stubArray=Xe,l.stubFalse=Ze,l.size=function(e){if(e==null)return 0;if(Pe(e)){if(Ve(e))if(st.test(e)){for(var t=ot.lastIndex=0;ot.test(e);)++t;e=t}else e=yt(e);else e=e.length;return e}return t=dn(e),t==`[object Map]`||t==`[object Set]`?e.size:k(e).length},l.toString=We,l.VERSION=`4.17.5`,typeof define==`function`&&typeof define.amd==`object`&&define.amd?(dt._=l,define(function(){return l})):pt?((pt.exports=l)._=l,ft._=l):dt._=l}).call(e)}));r(((e,t)=>{t.exports=o,t.exports.format=s,t.exports.parse=c;var n=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,i={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:1024**4,pb:1024**5},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function o(e,t){return typeof e==`string`?c(e):typeof e==`number`?s(e,t):null}function s(e,t){if(!Number.isFinite(e))return null;var a=Math.abs(e),o=t&&t.thousandsSeparator||``,s=t&&t.unitSeparator||``,c=t&&t.decimalPlaces!==void 0?t.decimalPlaces:2,l=!!(t&&t.fixedDecimals),u=t&&t.unit||``;(!u||!i[u.toLowerCase()])&&(u=a>=i.pb?`PB`:a>=i.tb?`TB`:a>=i.gb?`GB`:a>=i.mb?`MB`:a>=i.kb?`KB`:`B`);var d=(e/i[u.toLowerCase()]).toFixed(c);return l||(d=d.replace(r,`$1`)),o&&(d=d.split(`.`).map(function(e,t){return t===0?e.replace(n,o):e}).join(`.`)),d+s+u}function c(e){if(typeof e==`number`&&!isNaN(e))return e;if(typeof e!=`string`)return null;var t=a.exec(e),n,r=`b`;return t?(n=parseFloat(t[1]),r=t[4].toLowerCase()):(n=parseInt(e,10),r=`b`),isNaN(n)?null:Math.floor(i[r]*n)}}))(),US();var WS=r(((e,t)=>{(function(n,r,i){typeof e==`object`?(t.exports=i(),t.exports.default=i()):typeof define==`function`&&define.amd?define(i):r[n]=i()})(`slugify`,e,function(){var e=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),t=JSON.parse(`{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}`);function n(n,r){if(typeof n!=`string`)throw Error(`slugify: string argument expected`);r=typeof r==`string`?{replacement:r}:r||{};var i=t[r.locale]||{},a=r.replacement===void 0?`-`:r.replacement,o=r.trim===void 0?!0:r.trim,s=n.normalize().split(``).reduce(function(t,n){var o=i[n];return o===void 0&&(o=e[n]),o===void 0&&(o=n),o===a&&(o=` `),t+o.replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,``)},``);return r.strict&&(s=s.replace(/[^A-Za-z0-9\s]/g,``)),o&&(s=s.trim()),s=s.replace(/\s+/g,a),r.lower&&(s=s.toLowerCase()),s}return n.extend=function(t){Object.assign(e,t)},n})})),GS=r(((e,t)=>{(function(e){var n=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],r=function(e,t){var t=t||{},e=(e||``).trim(),r=``,i=0,a=!1,o=``,s=[],c=``,l=0,u=0,d=0,f=0,p=1,m=2;if(t.TruncateBy=t.TruncateBy===void 0||typeof t.TruncateBy!=`string`||!t.TruncateBy.match(/(word(s)?|character(s)?|paragraph(s)?)/)?`words`:t.TruncateBy.toLowerCase(),t.TruncateLength=t.TruncateLength===void 0||typeof t.TruncateLength!=`number`?50:t.TruncateLength,t.StripHTML=t.StripHTML===void 0||typeof t.StripHTML!=`boolean`?!1:t.StripHTML,t.Strict=t.Strict===void 0||typeof t.Strict!=`boolean`?!0:t.Strict,t.Suffix=t.Suffix===void 0||typeof t.Suffix!=`string`?`...`:t.Suffix,e===``||e.length<=t.TruncateLength&&t.StripHTML===!1)return e;t.StripHTML&&(e=String(e).replace(/<br( \/)?>/gi,` `)),t.StripHTML&&!t.TruncateBy.match(/(paragraph(s)?)/)&&(e=String(e).replace(/<!--(.*?)-->/gm,``).replace(/<\/?[^>]+>/gi,``)),e=String(e).replace(/<\/p>(\r?\n)+<p>/gm,`</p><p>`),t.StripHTML&&String(e).match(/\r?\n\r?\n/)&&(e=String(e).replace(/((.+)(\r?\n\r?\n|$))/gi,`<p>$2</p>`));for(var h=0;h<e.length;h++){var g=e[h];switch(g){case`<`:i===f&&(i=p,o=``),t.StripHTML||(r+=g);break;case`>`:(i===p||i===m)&&(i=f,o=o.toLowerCase(),o===`/p`&&(d++,t.StripHTML&&(r+=` `)),n.indexOf(o)===-1&&n.indexOf(o+`/`)===-1&&(o.indexOf(`/`)>=0?s.pop():s.push(o))),t.StripHTML||(r+=g);break;case` `:i===p&&(i=m),i===f&&(u++,l++),(i===f||!t.StripHTML)&&(r+=g);break;default:i===f&&l++,i===p&&(o+=g),(i===f||!t.StripHTML)&&(r+=g);break}if(c=e[h+1]||``,a=t.Strict?!0:!g.match(/[a-zA-ZÇ-Ü']/i)||!c.match(/[a-zA-ZÇ-Ü']/i),t.TruncateBy.match(/word(s)?/i)&&t.TruncateLength<=u){r=r.replace(/\s+$/,``);break}if(t.TruncateBy.match(/character(s)?/i)&&t.TruncateLength<=l&&a||t.TruncateBy.match(/paragraph(s)?/i)&&t.TruncateLength===d)break}if(!t.StripHTML&&s.length>0)for(;s.length>0;){var _=s.pop();_!==`!--`&&(r+=`</`+_+`>`)}return h<e.length-1&&(r.match(/<\/p>$/gi)?r=r.replace(/(<\/p>)$/gi,t.Suffix+`$1`):r+=t.Suffix),r.trim()};if(t!==void 0&&t.exports)return t.exports=r;e.truncatise=r})(e)})),KS=r(((t,n)=>{(function(r,i){typeof e==`function`&&typeof t==`object`&&typeof n==`object`?n.exports=i():typeof define==`function`&&define.amd?define(function(){return i()}):r.pluralize=i()})(t,function(){var e=[],t=[],n={},r={},i={};function a(e){return typeof e==`string`?RegExp(`^`+e+`$`,`i`):e}function o(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function s(e,t){return e.replace(/\$(\d{1,2})/g,function(e,n){return t[n]||``})}function c(e,t){return e.replace(t[0],function(n,r){var i=s(t[1],arguments);return o(n===``?e[r-1]:n,i)})}function l(e,t,r){if(!e.length||n.hasOwnProperty(e))return t;for(var i=r.length;i--;){var a=r[i];if(a[0].test(t))return c(t,a)}return t}function u(e,t,n){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?o(r,i):e.hasOwnProperty(i)?o(r,e[i]):l(i,r,n)}}function d(e,t,n,r){return function(r){var i=r.toLowerCase();return t.hasOwnProperty(i)?!0:e.hasOwnProperty(i)?!1:l(i,i,n)===i}}function f(e,t,n){var r=t===1?f.singular(e):f.plural(e);return(n?t+` `:``)+r}return f.plural=u(i,r,e),f.isPlural=d(i,r,e),f.singular=u(r,i,t),f.isSingular=d(r,i,t),f.addPluralRule=function(t,n){e.push([a(t),n])},f.addSingularRule=function(e,n){t.push([a(e),n])},f.addUncountableRule=function(e){if(typeof e==`string`){n[e.toLowerCase()]=!0;return}f.addPluralRule(e,`$0`),f.addSingularRule(e,`$0`)},f.addIrregularRule=function(e,t){t=t.toLowerCase(),e=e.toLowerCase(),i[e]=t,r[t]=e},[[`I`,`we`],[`me`,`us`],[`he`,`they`],[`she`,`they`],[`them`,`them`],[`myself`,`ourselves`],[`yourself`,`yourselves`],[`itself`,`themselves`],[`herself`,`themselves`],[`himself`,`themselves`],[`themself`,`themselves`],[`is`,`are`],[`was`,`were`],[`has`,`have`],[`this`,`these`],[`that`,`those`],[`echo`,`echoes`],[`dingo`,`dingoes`],[`volcano`,`volcanoes`],[`tornado`,`tornadoes`],[`torpedo`,`torpedoes`],[`genus`,`genera`],[`viscus`,`viscera`],[`stigma`,`stigmata`],[`stoma`,`stomata`],[`dogma`,`dogmata`],[`lemma`,`lemmata`],[`schema`,`schemata`],[`anathema`,`anathemata`],[`ox`,`oxen`],[`axe`,`axes`],[`die`,`dice`],[`yes`,`yeses`],[`foot`,`feet`],[`eave`,`eaves`],[`goose`,`geese`],[`tooth`,`teeth`],[`quiz`,`quizzes`],[`human`,`humans`],[`proof`,`proofs`],[`carve`,`carves`],[`valve`,`valves`],[`looey`,`looies`],[`thief`,`thieves`],[`groove`,`grooves`],[`pickaxe`,`pickaxes`],[`passerby`,`passersby`]].forEach(function(e){return f.addIrregularRule(e[0],e[1])}),[[/s?$/i,`s`],[/[^\u0000-\u007F]$/i,`$0`],[/([^aeiou]ese)$/i,`$1`],[/(ax|test)is$/i,`$1es`],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,`$1es`],[/(e[mn]u)s?$/i,`$1s`],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,`$1`],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,`$1i`],[/(alumn|alg|vertebr)(?:a|ae)$/i,`$1ae`],[/(seraph|cherub)(?:im)?$/i,`$1im`],[/(her|at|gr)o$/i,`$1oes`],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,`$1a`],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,`$1a`],[/sis$/i,`ses`],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,`$1$2ves`],[/([^aeiouy]|qu)y$/i,`$1ies`],[/([^ch][ieo][ln])ey$/i,`$1ies`],[/(x|ch|ss|sh|zz)$/i,`$1es`],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,`$1ices`],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,`$1ice`],[/(pe)(?:rson|ople)$/i,`$1ople`],[/(child)(?:ren)?$/i,`$1ren`],[/eaux$/i,`$0`],[/m[ae]n$/i,`men`],[`thou`,`you`]].forEach(function(e){return f.addPluralRule(e[0],e[1])}),[[/s$/i,``],[/(ss)$/i,`$1`],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,`$1fe`],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,`$1f`],[/ies$/i,`y`],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,`$1ie`],[/\b(mon|smil)ies$/i,`$1ey`],[/\b((?:tit)?m|l)ice$/i,`$1ouse`],[/(seraph|cherub)im$/i,`$1`],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,`$1`],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,`$1sis`],[/(movie|twelve|abuse|e[mn]u)s$/i,`$1`],[/(test)(?:is|es)$/i,`$1is`],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,`$1us`],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,`$1um`],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,`$1on`],[/(alumn|alg|vertebr)ae$/i,`$1a`],[/(cod|mur|sil|vert|ind)ices$/i,`$1ex`],[/(matr|append)ices$/i,`$1ix`],[/(pe)(rson|ople)$/i,`$1rson`],[/(child)ren$/i,`$1`],[/(eau)x?$/i,`$1`],[/men$/i,`man`]].forEach(function(e){return f.addSingularRule(e[0],e[1])}),[`adulthood`,`advice`,`agenda`,`aid`,`aircraft`,`alcohol`,`ammo`,`analytics`,`anime`,`athletics`,`audio`,`bison`,`blood`,`bream`,`buffalo`,`butter`,`carp`,`cash`,`chassis`,`chess`,`clothing`,`cod`,`commerce`,`cooperation`,`corps`,`debris`,`diabetes`,`digestion`,`elk`,`energy`,`equipment`,`excretion`,`expertise`,`firmware`,`flounder`,`fun`,`gallows`,`garbage`,`graffiti`,`hardware`,`headquarters`,`health`,`herpes`,`highjinks`,`homework`,`housework`,`information`,`jeans`,`justice`,`kudos`,`labour`,`literature`,`machinery`,`mackerel`,`mail`,`media`,`mews`,`moose`,`music`,`mud`,`manga`,`news`,`only`,`personnel`,`pike`,`plankton`,`pliers`,`police`,`pollution`,`premises`,`rain`,`research`,`rice`,`salmon`,`scissors`,`series`,`sewage`,`shambles`,`shrimp`,`software`,`species`,`staff`,`swine`,`tennis`,`traffic`,`transportation`,`trout`,`tuna`,`wealth`,`welfare`,`whiting`,`wildebeest`,`wildlife`,`you`,/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(f.addUncountableRule),f})}));WS(),GS(),GS();var qS=t(KS(),1),JS=d;function YS(e){return JS(e)}YS.use=function(e){JS=e},YS.restore=function(){JS=d};var XS=e=>{let t=(e+1)*6,n=u(Math.ceil(t/8));return Buffer.from(n).toString(`base64`).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/\=/g,``).slice(0,e)},ZS=XS;function QS(e){return ZS(e)}QS.use=function(e){ZS=e},QS.restore=function(){ZS=XS};function $S(e,t,n){return(0,qS.default)(e,t,n)}$S.addPluralRule=qS.default.addPluralRule,$S.addSingularRule=qS.default.addSingularRule,$S.addIrregularRule=qS.default.addIrregularRule,$S.addUncountableRule=qS.default.addUncountableRule,qS.default.plural,qS.default.singular,qS.default.isPlural,qS.default.isSingular;var eC=n({ObjectBuilder:()=>tC}),tC=class{#e;values;constructor(e,t){this.values=e,this.#e=t===!0}add(e,t){return t===void 0||this.#e===!0&&t===null||(this.values[e]=t),this}remove(e){return delete this.values[e],this}has(e){return this.get(e)!==void 0}get(e){return this.values[e]}toObject(){return this.values}};US(),new class{encode(e,t){return typeof e==`string`?Buffer.from(e,t).toString(`base64`):Buffer.isBuffer(e)?e.toString(`base64`):Buffer.from(e).toString(`base64`)}decode(e,t=`utf-8`,n=!1){if(Buffer.isBuffer(e))return e.toString(t);let r=Buffer.from(e,`base64`).toString(t),i=this.encode(r,t)!==e;if(n&&i)throw Error(`Cannot decode malformed value`);return i?null:r}urlEncode(e,t){return(typeof e==`string`?this.encode(e,t):this.encode(e)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/\=/g,``)}urlDecode(e,t=`utf-8`,n=!1){if(Buffer.isBuffer(e))return e.toString(t);let r=Buffer.from(e,`base64`).toString(t),i=this.urlEncode(r,t)!==e;if(n&&i)throw Error(`Cannot urlDecode malformed value`);return i?null:r}};var nC={};HS(nC,eC),nC.ObjectBuilder;var rC=Object.defineProperty;((e,t)=>{for(var n in t)rC(e,n,{get:t[n],enumerable:!0})})({},{E_CANNOT_CHECK_FILE_EXISTENCE:()=>uC,E_CANNOT_COPY_FILE:()=>cC,E_CANNOT_DELETE_DIRECTORY:()=>sC,E_CANNOT_DELETE_FILE:()=>oC,E_CANNOT_GENERATE_URL:()=>pC,E_CANNOT_GET_METADATA:()=>dC,E_CANNOT_MOVE_FILE:()=>lC,E_CANNOT_READ_FILE:()=>aC,E_CANNOT_SET_VISIBILITY:()=>fC,E_CANNOT_WRITE_FILE:()=>iC,E_INVALID_KEY:()=>hC,E_PATH_TRAVERSAL_DETECTED:()=>gC,E_UNALLOWED_CHARACTERS:()=>mC});var iC=NS(`Cannot write file at location "%s"`,`E_CANNOT_WRITE_FILE`),aC=NS(`Cannot read file from location "%s"`,`E_CANNOT_READ_FILE`),oC=NS(`Cannot delete file at location "%s"`,`E_CANNOT_DELETE_FILE`),sC=NS(`Cannot delete directory at location "%s"`,`E_CANNOT_DELETE_DIRECTORY`),cC=NS(`Cannot copy file from "%s" to "%s"`,`E_CANNOT_COPY_FILE`),lC=NS(`Cannot move file from "%s" to "%s"`,`E_CANNOT_MOVE_FILE`),uC=NS(`Unable to check existence for file at location "%s"`,`E_CANNOT_CHECK_FILE_EXISTENCE`),dC=NS(`Unable to retrieve metadata of file at location "%s"`,`E_CANNOT_GET_METADATA`),fC=NS(`Unable to set visibility for file at location "%s"`,`E_CANNOT_SET_VISIBILITY`),pC=NS(`Cannot generate URL for file at location "%s"`,`E_CANNOT_GENERATE_URL`),mC=NS(`The key "%s" has unallowed characters`,`E_UNALLOWED_CHARACTERS`),hC=NS(`Invalid key "%s". After normalization results in an empty string`,`E_INVALID_KEY`),gC=NS(`Path traversal segment detected in key "%s"`,`E_PATH_TRAVERSAL_DETECTED`),_C=r(((t,n)=>{n.exports=s;var r=e(`crypto`),i=e(`fs`).Stats,a=Object.prototype.toString;function o(e){if(e.length===0)return`"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"`;var t=r.createHash(`sha1`).update(e,`utf8`).digest(`base64`).substring(0,27);return`"`+(typeof e==`string`?Buffer.byteLength(e,`utf8`):e.length).toString(16)+`-`+t+`"`}function s(e,t){if(e==null)throw TypeError(`argument entity is required`);var n=c(e),r=t&&typeof t.weak==`boolean`?t.weak:n;if(!n&&typeof e!=`string`&&!Buffer.isBuffer(e))throw TypeError(`argument entity must be string, Buffer, or fs.Stats`);var i=n?l(e):o(e);return r?`W/`+i:i}function c(e){return typeof i==`function`&&e instanceof i?!0:e&&typeof e==`object`&&`ctime`in e&&a.call(e.ctime)===`[object Date]`&&`mtime`in e&&a.call(e.mtime)===`[object Date]`&&`ino`in e&&typeof e.ino==`number`&&`size`in e&&typeof e.size==`number`}function l(e){var t=e.mtime.getTime().toString(16);return`"`+e.size.toString(16)+`-`+t+`"`}})),vC=r(((e,t)=>{t.exports={"application/1d-interleaved-parityfec":{source:`iana`},"application/3gpdash-qoe-report+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/3gpp-ims+xml":{source:`iana`,compressible:!0},"application/3gpphal+json":{source:`iana`,compressible:!0},"application/3gpphalforms+json":{source:`iana`,compressible:!0},"application/a2l":{source:`iana`},"application/ace+cbor":{source:`iana`},"application/ace+json":{source:`iana`,compressible:!0},"application/ace-groupcomm+cbor":{source:`iana`},"application/ace-trl+cbor":{source:`iana`},"application/activemessage":{source:`iana`},"application/activity+json":{source:`iana`,compressible:!0},"application/aif+cbor":{source:`iana`},"application/aif+json":{source:`iana`,compressible:!0},"application/alto-cdni+json":{source:`iana`,compressible:!0},"application/alto-cdnifilter+json":{source:`iana`,compressible:!0},"application/alto-costmap+json":{source:`iana`,compressible:!0},"application/alto-costmapfilter+json":{source:`iana`,compressible:!0},"application/alto-directory+json":{source:`iana`,compressible:!0},"application/alto-endpointcost+json":{source:`iana`,compressible:!0},"application/alto-endpointcostparams+json":{source:`iana`,compressible:!0},"application/alto-endpointprop+json":{source:`iana`,compressible:!0},"application/alto-endpointpropparams+json":{source:`iana`,compressible:!0},"application/alto-error+json":{source:`iana`,compressible:!0},"application/alto-networkmap+json":{source:`iana`,compressible:!0},"application/alto-networkmapfilter+json":{source:`iana`,compressible:!0},"application/alto-propmap+json":{source:`iana`,compressible:!0},"application/alto-propmapparams+json":{source:`iana`,compressible:!0},"application/alto-tips+json":{source:`iana`,compressible:!0},"application/alto-tipsparams+json":{source:`iana`,compressible:!0},"application/alto-updatestreamcontrol+json":{source:`iana`,compressible:!0},"application/alto-updatestreamparams+json":{source:`iana`,compressible:!0},"application/aml":{source:`iana`},"application/andrew-inset":{source:`iana`,extensions:[`ez`]},"application/appinstaller":{compressible:!1,extensions:[`appinstaller`]},"application/applefile":{source:`iana`},"application/applixware":{source:`apache`,extensions:[`aw`]},"application/appx":{compressible:!1,extensions:[`appx`]},"application/appxbundle":{compressible:!1,extensions:[`appxbundle`]},"application/at+jwt":{source:`iana`},"application/atf":{source:`iana`},"application/atfx":{source:`iana`},"application/atom+xml":{source:`iana`,compressible:!0,extensions:[`atom`]},"application/atomcat+xml":{source:`iana`,compressible:!0,extensions:[`atomcat`]},"application/atomdeleted+xml":{source:`iana`,compressible:!0,extensions:[`atomdeleted`]},"application/atomicmail":{source:`iana`},"application/atomsvc+xml":{source:`iana`,compressible:!0,extensions:[`atomsvc`]},"application/atsc-dwd+xml":{source:`iana`,compressible:!0,extensions:[`dwd`]},"application/atsc-dynamic-event-message":{source:`iana`},"application/atsc-held+xml":{source:`iana`,compressible:!0,extensions:[`held`]},"application/atsc-rdt+json":{source:`iana`,compressible:!0},"application/atsc-rsat+xml":{source:`iana`,compressible:!0,extensions:[`rsat`]},"application/atxml":{source:`iana`},"application/auth-policy+xml":{source:`iana`,compressible:!0},"application/automationml-aml+xml":{source:`iana`,compressible:!0,extensions:[`aml`]},"application/automationml-amlx+zip":{source:`iana`,compressible:!1,extensions:[`amlx`]},"application/bacnet-xdd+zip":{source:`iana`,compressible:!1},"application/batch-smtp":{source:`iana`},"application/bdoc":{compressible:!1,extensions:[`bdoc`]},"application/beep+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/bufr":{source:`iana`},"application/c2pa":{source:`iana`},"application/calendar+json":{source:`iana`,compressible:!0},"application/calendar+xml":{source:`iana`,compressible:!0,extensions:[`xcs`]},"application/call-completion":{source:`iana`},"application/cals-1840":{source:`iana`},"application/captive+json":{source:`iana`,compressible:!0},"application/cbor":{source:`iana`},"application/cbor-seq":{source:`iana`},"application/cccex":{source:`iana`},"application/ccmp+xml":{source:`iana`,compressible:!0},"application/ccxml+xml":{source:`iana`,compressible:!0,extensions:[`ccxml`]},"application/cda+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/cdfx+xml":{source:`iana`,compressible:!0,extensions:[`cdfx`]},"application/cdmi-capability":{source:`iana`,extensions:[`cdmia`]},"application/cdmi-container":{source:`iana`,extensions:[`cdmic`]},"application/cdmi-domain":{source:`iana`,extensions:[`cdmid`]},"application/cdmi-object":{source:`iana`,extensions:[`cdmio`]},"application/cdmi-queue":{source:`iana`,extensions:[`cdmiq`]},"application/cdni":{source:`iana`},"application/ce+cbor":{source:`iana`},"application/cea":{source:`iana`},"application/cea-2018+xml":{source:`iana`,compressible:!0},"application/cellml+xml":{source:`iana`,compressible:!0},"application/cfw":{source:`iana`},"application/cid-edhoc+cbor-seq":{source:`iana`},"application/city+json":{source:`iana`,compressible:!0},"application/city+json-seq":{source:`iana`},"application/clr":{source:`iana`},"application/clue+xml":{source:`iana`,compressible:!0},"application/clue_info+xml":{source:`iana`,compressible:!0},"application/cms":{source:`iana`},"application/cnrp+xml":{source:`iana`,compressible:!0},"application/coap-eap":{source:`iana`},"application/coap-group+json":{source:`iana`,compressible:!0},"application/coap-payload":{source:`iana`},"application/commonground":{source:`iana`},"application/concise-problem-details+cbor":{source:`iana`},"application/conference-info+xml":{source:`iana`,compressible:!0},"application/cose":{source:`iana`},"application/cose-key":{source:`iana`},"application/cose-key-set":{source:`iana`},"application/cose-x509":{source:`iana`},"application/cpl+xml":{source:`iana`,compressible:!0,extensions:[`cpl`]},"application/csrattrs":{source:`iana`},"application/csta+xml":{source:`iana`,compressible:!0},"application/cstadata+xml":{source:`iana`,compressible:!0},"application/csvm+json":{source:`iana`,compressible:!0},"application/cu-seeme":{source:`apache`,extensions:[`cu`]},"application/cwl":{source:`iana`,extensions:[`cwl`]},"application/cwl+json":{source:`iana`,compressible:!0},"application/cwl+yaml":{source:`iana`},"application/cwt":{source:`iana`},"application/cybercash":{source:`iana`},"application/dart":{compressible:!0},"application/dash+xml":{source:`iana`,compressible:!0,extensions:[`mpd`]},"application/dash-patch+xml":{source:`iana`,compressible:!0,extensions:[`mpp`]},"application/dashdelta":{source:`iana`},"application/davmount+xml":{source:`iana`,compressible:!0,extensions:[`davmount`]},"application/dca-rft":{source:`iana`},"application/dcd":{source:`iana`},"application/dec-dx":{source:`iana`},"application/dialog-info+xml":{source:`iana`,compressible:!0},"application/dicom":{source:`iana`,extensions:[`dcm`]},"application/dicom+json":{source:`iana`,compressible:!0},"application/dicom+xml":{source:`iana`,compressible:!0},"application/dii":{source:`iana`},"application/dit":{source:`iana`},"application/dns":{source:`iana`},"application/dns+json":{source:`iana`,compressible:!0},"application/dns-message":{source:`iana`},"application/docbook+xml":{source:`apache`,compressible:!0,extensions:[`dbk`]},"application/dots+cbor":{source:`iana`},"application/dpop+jwt":{source:`iana`},"application/dskpp+xml":{source:`iana`,compressible:!0},"application/dssc+der":{source:`iana`,extensions:[`dssc`]},"application/dssc+xml":{source:`iana`,compressible:!0,extensions:[`xdssc`]},"application/dvcs":{source:`iana`},"application/eat+cwt":{source:`iana`},"application/eat+jwt":{source:`iana`},"application/eat-bun+cbor":{source:`iana`},"application/eat-bun+json":{source:`iana`,compressible:!0},"application/eat-ucs+cbor":{source:`iana`},"application/eat-ucs+json":{source:`iana`,compressible:!0},"application/ecmascript":{source:`apache`,compressible:!0,extensions:[`ecma`]},"application/edhoc+cbor-seq":{source:`iana`},"application/edi-consent":{source:`iana`},"application/edi-x12":{source:`iana`,compressible:!1},"application/edifact":{source:`iana`,compressible:!1},"application/efi":{source:`iana`},"application/elm+json":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/elm+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.cap+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/emergencycalldata.comment+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.control+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.ecall.msd":{source:`iana`},"application/emergencycalldata.legacyesn+json":{source:`iana`,compressible:!0},"application/emergencycalldata.providerinfo+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:`iana`,compressible:!0},"application/emergencycalldata.veds+xml":{source:`iana`,compressible:!0},"application/emma+xml":{source:`iana`,compressible:!0,extensions:[`emma`]},"application/emotionml+xml":{source:`iana`,compressible:!0,extensions:[`emotionml`]},"application/encaprtp":{source:`iana`},"application/entity-statement+jwt":{source:`iana`},"application/epp+xml":{source:`iana`,compressible:!0},"application/epub+zip":{source:`iana`,compressible:!1,extensions:[`epub`]},"application/eshop":{source:`iana`},"application/exi":{source:`iana`,extensions:[`exi`]},"application/expect-ct-report+json":{source:`iana`,compressible:!0},"application/express":{source:`iana`,extensions:[`exp`]},"application/fastinfoset":{source:`iana`},"application/fastsoap":{source:`iana`},"application/fdf":{source:`iana`,extensions:[`fdf`]},"application/fdt+xml":{source:`iana`,compressible:!0,extensions:[`fdt`]},"application/fhir+json":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/fhir+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:`iana`},"application/flexfec":{source:`iana`},"application/font-sfnt":{source:`iana`},"application/font-tdpfr":{source:`iana`,extensions:[`pfr`]},"application/font-woff":{source:`iana`,compressible:!1},"application/framework-attributes+xml":{source:`iana`,compressible:!0},"application/geo+json":{source:`iana`,compressible:!0,extensions:[`geojson`]},"application/geo+json-seq":{source:`iana`},"application/geopackage+sqlite3":{source:`iana`},"application/geopose+json":{source:`iana`,compressible:!0},"application/geoxacml+json":{source:`iana`,compressible:!0},"application/geoxacml+xml":{source:`iana`,compressible:!0},"application/gltf-buffer":{source:`iana`},"application/gml+xml":{source:`iana`,compressible:!0,extensions:[`gml`]},"application/gnap-binding-jws":{source:`iana`},"application/gnap-binding-jwsd":{source:`iana`},"application/gnap-binding-rotation-jws":{source:`iana`},"application/gnap-binding-rotation-jwsd":{source:`iana`},"application/gpx+xml":{source:`apache`,compressible:!0,extensions:[`gpx`]},"application/grib":{source:`iana`},"application/gxf":{source:`apache`,extensions:[`gxf`]},"application/gzip":{source:`iana`,compressible:!1,extensions:[`gz`]},"application/h224":{source:`iana`},"application/held+xml":{source:`iana`,compressible:!0},"application/hjson":{extensions:[`hjson`]},"application/hl7v2+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/http":{source:`iana`},"application/hyperstudio":{source:`iana`,extensions:[`stk`]},"application/ibe-key-request+xml":{source:`iana`,compressible:!0},"application/ibe-pkg-reply+xml":{source:`iana`,compressible:!0},"application/ibe-pp-data":{source:`iana`},"application/iges":{source:`iana`},"application/im-iscomposing+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/index":{source:`iana`},"application/index.cmd":{source:`iana`},"application/index.obj":{source:`iana`},"application/index.response":{source:`iana`},"application/index.vnd":{source:`iana`},"application/inkml+xml":{source:`iana`,compressible:!0,extensions:[`ink`,`inkml`]},"application/iotp":{source:`iana`},"application/ipfix":{source:`iana`,extensions:[`ipfix`]},"application/ipp":{source:`iana`},"application/isup":{source:`iana`},"application/its+xml":{source:`iana`,compressible:!0,extensions:[`its`]},"application/java-archive":{source:`iana`,compressible:!1,extensions:[`jar`,`war`,`ear`]},"application/java-serialized-object":{source:`apache`,compressible:!1,extensions:[`ser`]},"application/java-vm":{source:`apache`,compressible:!1,extensions:[`class`]},"application/javascript":{source:`apache`,charset:`UTF-8`,compressible:!0,extensions:[`js`]},"application/jf2feed+json":{source:`iana`,compressible:!0},"application/jose":{source:`iana`},"application/jose+json":{source:`iana`,compressible:!0},"application/jrd+json":{source:`iana`,compressible:!0},"application/jscalendar+json":{source:`iana`,compressible:!0},"application/jscontact+json":{source:`iana`,compressible:!0},"application/json":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`json`,`map`]},"application/json-patch+json":{source:`iana`,compressible:!0},"application/json-seq":{source:`iana`},"application/json5":{extensions:[`json5`]},"application/jsonml+json":{source:`apache`,compressible:!0,extensions:[`jsonml`]},"application/jsonpath":{source:`iana`},"application/jwk+json":{source:`iana`,compressible:!0},"application/jwk-set+json":{source:`iana`,compressible:!0},"application/jwk-set+jwt":{source:`iana`},"application/jwt":{source:`iana`},"application/kpml-request+xml":{source:`iana`,compressible:!0},"application/kpml-response+xml":{source:`iana`,compressible:!0},"application/ld+json":{source:`iana`,compressible:!0,extensions:[`jsonld`]},"application/lgr+xml":{source:`iana`,compressible:!0,extensions:[`lgr`]},"application/link-format":{source:`iana`},"application/linkset":{source:`iana`},"application/linkset+json":{source:`iana`,compressible:!0},"application/load-control+xml":{source:`iana`,compressible:!0},"application/logout+jwt":{source:`iana`},"application/lost+xml":{source:`iana`,compressible:!0,extensions:[`lostxml`]},"application/lostsync+xml":{source:`iana`,compressible:!0},"application/lpf+zip":{source:`iana`,compressible:!1},"application/lxf":{source:`iana`},"application/mac-binhex40":{source:`iana`,extensions:[`hqx`]},"application/mac-compactpro":{source:`apache`,extensions:[`cpt`]},"application/macwriteii":{source:`iana`},"application/mads+xml":{source:`iana`,compressible:!0,extensions:[`mads`]},"application/manifest+json":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`webmanifest`]},"application/marc":{source:`iana`,extensions:[`mrc`]},"application/marcxml+xml":{source:`iana`,compressible:!0,extensions:[`mrcx`]},"application/mathematica":{source:`iana`,extensions:[`ma`,`nb`,`mb`]},"application/mathml+xml":{source:`iana`,compressible:!0,extensions:[`mathml`]},"application/mathml-content+xml":{source:`iana`,compressible:!0},"application/mathml-presentation+xml":{source:`iana`,compressible:!0},"application/mbms-associated-procedure-description+xml":{source:`iana`,compressible:!0},"application/mbms-deregister+xml":{source:`iana`,compressible:!0},"application/mbms-envelope+xml":{source:`iana`,compressible:!0},"application/mbms-msk+xml":{source:`iana`,compressible:!0},"application/mbms-msk-response+xml":{source:`iana`,compressible:!0},"application/mbms-protection-description+xml":{source:`iana`,compressible:!0},"application/mbms-reception-report+xml":{source:`iana`,compressible:!0},"application/mbms-register+xml":{source:`iana`,compressible:!0},"application/mbms-register-response+xml":{source:`iana`,compressible:!0},"application/mbms-schedule+xml":{source:`iana`,compressible:!0},"application/mbms-user-service-description+xml":{source:`iana`,compressible:!0},"application/mbox":{source:`iana`,extensions:[`mbox`]},"application/media-policy-dataset+xml":{source:`iana`,compressible:!0,extensions:[`mpf`]},"application/media_control+xml":{source:`iana`,compressible:!0},"application/mediaservercontrol+xml":{source:`iana`,compressible:!0,extensions:[`mscml`]},"application/merge-patch+json":{source:`iana`,compressible:!0},"application/metalink+xml":{source:`apache`,compressible:!0,extensions:[`metalink`]},"application/metalink4+xml":{source:`iana`,compressible:!0,extensions:[`meta4`]},"application/mets+xml":{source:`iana`,compressible:!0,extensions:[`mets`]},"application/mf4":{source:`iana`},"application/mikey":{source:`iana`},"application/mipc":{source:`iana`},"application/missing-blocks+cbor-seq":{source:`iana`},"application/mmt-aei+xml":{source:`iana`,compressible:!0,extensions:[`maei`]},"application/mmt-usd+xml":{source:`iana`,compressible:!0,extensions:[`musd`]},"application/mods+xml":{source:`iana`,compressible:!0,extensions:[`mods`]},"application/moss-keys":{source:`iana`},"application/moss-signature":{source:`iana`},"application/mosskey-data":{source:`iana`},"application/mosskey-request":{source:`iana`},"application/mp21":{source:`iana`,extensions:[`m21`,`mp21`]},"application/mp4":{source:`iana`,extensions:[`mp4`,`mpg4`,`mp4s`,`m4p`]},"application/mpeg4-generic":{source:`iana`},"application/mpeg4-iod":{source:`iana`},"application/mpeg4-iod-xmt":{source:`iana`},"application/mrb-consumer+xml":{source:`iana`,compressible:!0},"application/mrb-publish+xml":{source:`iana`,compressible:!0},"application/msc-ivr+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/msc-mixer+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/msix":{compressible:!1,extensions:[`msix`]},"application/msixbundle":{compressible:!1,extensions:[`msixbundle`]},"application/msword":{source:`iana`,compressible:!1,extensions:[`doc`,`dot`]},"application/mud+json":{source:`iana`,compressible:!0},"application/multipart-core":{source:`iana`},"application/mxf":{source:`iana`,extensions:[`mxf`]},"application/n-quads":{source:`iana`,extensions:[`nq`]},"application/n-triples":{source:`iana`,extensions:[`nt`]},"application/nasdata":{source:`iana`},"application/news-checkgroups":{source:`iana`,charset:`US-ASCII`},"application/news-groupinfo":{source:`iana`,charset:`US-ASCII`},"application/news-transmission":{source:`iana`},"application/nlsml+xml":{source:`iana`,compressible:!0},"application/node":{source:`iana`,extensions:[`cjs`]},"application/nss":{source:`iana`},"application/oauth-authz-req+jwt":{source:`iana`},"application/oblivious-dns-message":{source:`iana`},"application/ocsp-request":{source:`iana`},"application/ocsp-response":{source:`iana`},"application/octet-stream":{source:`iana`,compressible:!0,extensions:[`bin`,`dms`,`lrf`,`mar`,`so`,`dist`,`distz`,`pkg`,`bpk`,`dump`,`elc`,`deploy`,`exe`,`dll`,`deb`,`dmg`,`iso`,`img`,`msi`,`msp`,`msm`,`buffer`]},"application/oda":{source:`iana`,extensions:[`oda`]},"application/odm+xml":{source:`iana`,compressible:!0},"application/odx":{source:`iana`},"application/oebps-package+xml":{source:`iana`,compressible:!0,extensions:[`opf`]},"application/ogg":{source:`iana`,compressible:!1,extensions:[`ogx`]},"application/ohttp-keys":{source:`iana`},"application/omdoc+xml":{source:`apache`,compressible:!0,extensions:[`omdoc`]},"application/onenote":{source:`apache`,extensions:[`onetoc`,`onetoc2`,`onetmp`,`onepkg`,`one`,`onea`]},"application/opc-nodeset+xml":{source:`iana`,compressible:!0},"application/oscore":{source:`iana`},"application/oxps":{source:`iana`,extensions:[`oxps`]},"application/p21":{source:`iana`},"application/p21+zip":{source:`iana`,compressible:!1},"application/p2p-overlay+xml":{source:`iana`,compressible:!0,extensions:[`relo`]},"application/parityfec":{source:`iana`},"application/passport":{source:`iana`},"application/patch-ops-error+xml":{source:`iana`,compressible:!0,extensions:[`xer`]},"application/pdf":{source:`iana`,compressible:!1,extensions:[`pdf`]},"application/pdx":{source:`iana`},"application/pem-certificate-chain":{source:`iana`},"application/pgp-encrypted":{source:`iana`,compressible:!1,extensions:[`pgp`]},"application/pgp-keys":{source:`iana`,extensions:[`asc`]},"application/pgp-signature":{source:`iana`,extensions:[`sig`,`asc`]},"application/pics-rules":{source:`apache`,extensions:[`prf`]},"application/pidf+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/pidf-diff+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/pkcs10":{source:`iana`,extensions:[`p10`]},"application/pkcs12":{source:`iana`},"application/pkcs7-mime":{source:`iana`,extensions:[`p7m`,`p7c`]},"application/pkcs7-signature":{source:`iana`,extensions:[`p7s`]},"application/pkcs8":{source:`iana`,extensions:[`p8`]},"application/pkcs8-encrypted":{source:`iana`},"application/pkix-attr-cert":{source:`iana`,extensions:[`ac`]},"application/pkix-cert":{source:`iana`,extensions:[`cer`]},"application/pkix-crl":{source:`iana`,extensions:[`crl`]},"application/pkix-pkipath":{source:`iana`,extensions:[`pkipath`]},"application/pkixcmp":{source:`iana`,extensions:[`pki`]},"application/pls+xml":{source:`iana`,compressible:!0,extensions:[`pls`]},"application/poc-settings+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/postscript":{source:`iana`,compressible:!0,extensions:[`ai`,`eps`,`ps`]},"application/ppsp-tracker+json":{source:`iana`,compressible:!0},"application/private-token-issuer-directory":{source:`iana`},"application/private-token-request":{source:`iana`},"application/private-token-response":{source:`iana`},"application/problem+json":{source:`iana`,compressible:!0},"application/problem+xml":{source:`iana`,compressible:!0},"application/provenance+xml":{source:`iana`,compressible:!0,extensions:[`provx`]},"application/provided-claims+jwt":{source:`iana`},"application/prs.alvestrand.titrax-sheet":{source:`iana`},"application/prs.cww":{source:`iana`,extensions:[`cww`]},"application/prs.cyn":{source:`iana`,charset:`7-BIT`},"application/prs.hpub+zip":{source:`iana`,compressible:!1},"application/prs.implied-document+xml":{source:`iana`,compressible:!0},"application/prs.implied-executable":{source:`iana`},"application/prs.implied-object+json":{source:`iana`,compressible:!0},"application/prs.implied-object+json-seq":{source:`iana`},"application/prs.implied-object+yaml":{source:`iana`},"application/prs.implied-structure":{source:`iana`},"application/prs.mayfile":{source:`iana`},"application/prs.nprend":{source:`iana`},"application/prs.plucker":{source:`iana`},"application/prs.rdf-xml-crypt":{source:`iana`},"application/prs.vcfbzip2":{source:`iana`},"application/prs.xsf+xml":{source:`iana`,compressible:!0,extensions:[`xsf`]},"application/pskc+xml":{source:`iana`,compressible:!0,extensions:[`pskcxml`]},"application/pvd+json":{source:`iana`,compressible:!0},"application/qsig":{source:`iana`},"application/raml+yaml":{compressible:!0,extensions:[`raml`]},"application/raptorfec":{source:`iana`},"application/rdap+json":{source:`iana`,compressible:!0},"application/rdf+xml":{source:`iana`,compressible:!0,extensions:[`rdf`,`owl`]},"application/reginfo+xml":{source:`iana`,compressible:!0,extensions:[`rif`]},"application/relax-ng-compact-syntax":{source:`iana`,extensions:[`rnc`]},"application/remote-printing":{source:`apache`},"application/reputon+json":{source:`iana`,compressible:!0},"application/resolve-response+jwt":{source:`iana`},"application/resource-lists+xml":{source:`iana`,compressible:!0,extensions:[`rl`]},"application/resource-lists-diff+xml":{source:`iana`,compressible:!0,extensions:[`rld`]},"application/rfc+xml":{source:`iana`,compressible:!0},"application/riscos":{source:`iana`},"application/rlmi+xml":{source:`iana`,compressible:!0},"application/rls-services+xml":{source:`iana`,compressible:!0,extensions:[`rs`]},"application/route-apd+xml":{source:`iana`,compressible:!0,extensions:[`rapd`]},"application/route-s-tsid+xml":{source:`iana`,compressible:!0,extensions:[`sls`]},"application/route-usd+xml":{source:`iana`,compressible:!0,extensions:[`rusd`]},"application/rpki-checklist":{source:`iana`},"application/rpki-ghostbusters":{source:`iana`,extensions:[`gbr`]},"application/rpki-manifest":{source:`iana`,extensions:[`mft`]},"application/rpki-publication":{source:`iana`},"application/rpki-roa":{source:`iana`,extensions:[`roa`]},"application/rpki-signed-tal":{source:`iana`},"application/rpki-updown":{source:`iana`},"application/rsd+xml":{source:`apache`,compressible:!0,extensions:[`rsd`]},"application/rss+xml":{source:`apache`,compressible:!0,extensions:[`rss`]},"application/rtf":{source:`iana`,compressible:!0,extensions:[`rtf`]},"application/rtploopback":{source:`iana`},"application/rtx":{source:`iana`},"application/samlassertion+xml":{source:`iana`,compressible:!0},"application/samlmetadata+xml":{source:`iana`,compressible:!0},"application/sarif+json":{source:`iana`,compressible:!0},"application/sarif-external-properties+json":{source:`iana`,compressible:!0},"application/sbe":{source:`iana`},"application/sbml+xml":{source:`iana`,compressible:!0,extensions:[`sbml`]},"application/scaip+xml":{source:`iana`,compressible:!0},"application/scim+json":{source:`iana`,compressible:!0},"application/scvp-cv-request":{source:`iana`,extensions:[`scq`]},"application/scvp-cv-response":{source:`iana`,extensions:[`scs`]},"application/scvp-vp-request":{source:`iana`,extensions:[`spq`]},"application/scvp-vp-response":{source:`iana`,extensions:[`spp`]},"application/sdp":{source:`iana`,extensions:[`sdp`]},"application/secevent+jwt":{source:`iana`},"application/senml+cbor":{source:`iana`},"application/senml+json":{source:`iana`,compressible:!0},"application/senml+xml":{source:`iana`,compressible:!0,extensions:[`senmlx`]},"application/senml-etch+cbor":{source:`iana`},"application/senml-etch+json":{source:`iana`,compressible:!0},"application/senml-exi":{source:`iana`},"application/sensml+cbor":{source:`iana`},"application/sensml+json":{source:`iana`,compressible:!0},"application/sensml+xml":{source:`iana`,compressible:!0,extensions:[`sensmlx`]},"application/sensml-exi":{source:`iana`},"application/sep+xml":{source:`iana`,compressible:!0},"application/sep-exi":{source:`iana`},"application/session-info":{source:`iana`},"application/set-payment":{source:`iana`},"application/set-payment-initiation":{source:`iana`,extensions:[`setpay`]},"application/set-registration":{source:`iana`},"application/set-registration-initiation":{source:`iana`,extensions:[`setreg`]},"application/sgml":{source:`iana`},"application/sgml-open-catalog":{source:`iana`},"application/shf+xml":{source:`iana`,compressible:!0,extensions:[`shf`]},"application/sieve":{source:`iana`,extensions:[`siv`,`sieve`]},"application/simple-filter+xml":{source:`iana`,compressible:!0},"application/simple-message-summary":{source:`iana`},"application/simplesymbolcontainer":{source:`iana`},"application/sipc":{source:`iana`},"application/slate":{source:`iana`},"application/smil":{source:`apache`},"application/smil+xml":{source:`iana`,compressible:!0,extensions:[`smi`,`smil`]},"application/smpte336m":{source:`iana`},"application/soap+fastinfoset":{source:`iana`},"application/soap+xml":{source:`iana`,compressible:!0},"application/sparql-query":{source:`iana`,extensions:[`rq`]},"application/sparql-results+xml":{source:`iana`,compressible:!0,extensions:[`srx`]},"application/spdx+json":{source:`iana`,compressible:!0},"application/spirits-event+xml":{source:`iana`,compressible:!0},"application/sql":{source:`iana`,extensions:[`sql`]},"application/srgs":{source:`iana`,extensions:[`gram`]},"application/srgs+xml":{source:`iana`,compressible:!0,extensions:[`grxml`]},"application/sru+xml":{source:`iana`,compressible:!0,extensions:[`sru`]},"application/ssdl+xml":{source:`apache`,compressible:!0,extensions:[`ssdl`]},"application/sslkeylogfile":{source:`iana`},"application/ssml+xml":{source:`iana`,compressible:!0,extensions:[`ssml`]},"application/st2110-41":{source:`iana`},"application/stix+json":{source:`iana`,compressible:!0},"application/stratum":{source:`iana`},"application/swid+cbor":{source:`iana`},"application/swid+xml":{source:`iana`,compressible:!0,extensions:[`swidtag`]},"application/tamp-apex-update":{source:`iana`},"application/tamp-apex-update-confirm":{source:`iana`},"application/tamp-community-update":{source:`iana`},"application/tamp-community-update-confirm":{source:`iana`},"application/tamp-error":{source:`iana`},"application/tamp-sequence-adjust":{source:`iana`},"application/tamp-sequence-adjust-confirm":{source:`iana`},"application/tamp-status-query":{source:`iana`},"application/tamp-status-response":{source:`iana`},"application/tamp-update":{source:`iana`},"application/tamp-update-confirm":{source:`iana`},"application/tar":{compressible:!0},"application/taxii+json":{source:`iana`,compressible:!0},"application/td+json":{source:`iana`,compressible:!0},"application/tei+xml":{source:`iana`,compressible:!0,extensions:[`tei`,`teicorpus`]},"application/tetra_isi":{source:`iana`},"application/thraud+xml":{source:`iana`,compressible:!0,extensions:[`tfi`]},"application/timestamp-query":{source:`iana`},"application/timestamp-reply":{source:`iana`},"application/timestamped-data":{source:`iana`,extensions:[`tsd`]},"application/tlsrpt+gzip":{source:`iana`},"application/tlsrpt+json":{source:`iana`,compressible:!0},"application/tm+json":{source:`iana`,compressible:!0},"application/tnauthlist":{source:`iana`},"application/toc+cbor":{source:`iana`},"application/token-introspection+jwt":{source:`iana`},"application/toml":{source:`iana`,compressible:!0,extensions:[`toml`]},"application/trickle-ice-sdpfrag":{source:`iana`},"application/trig":{source:`iana`,extensions:[`trig`]},"application/trust-chain+json":{source:`iana`,compressible:!0},"application/trust-mark+jwt":{source:`iana`},"application/trust-mark-delegation+jwt":{source:`iana`},"application/ttml+xml":{source:`iana`,compressible:!0,extensions:[`ttml`]},"application/tve-trigger":{source:`iana`},"application/tzif":{source:`iana`},"application/tzif-leap":{source:`iana`},"application/ubjson":{compressible:!1,extensions:[`ubj`]},"application/uccs+cbor":{source:`iana`},"application/ujcs+json":{source:`iana`,compressible:!0},"application/ulpfec":{source:`iana`},"application/urc-grpsheet+xml":{source:`iana`,compressible:!0},"application/urc-ressheet+xml":{source:`iana`,compressible:!0,extensions:[`rsheet`]},"application/urc-targetdesc+xml":{source:`iana`,compressible:!0,extensions:[`td`]},"application/urc-uisocketdesc+xml":{source:`iana`,compressible:!0},"application/vc":{source:`iana`},"application/vc+cose":{source:`iana`},"application/vc+jwt":{source:`iana`},"application/vcard+json":{source:`iana`,compressible:!0},"application/vcard+xml":{source:`iana`,compressible:!0},"application/vemmi":{source:`iana`},"application/vividence.scriptfile":{source:`apache`},"application/vnd.1000minds.decision-model+xml":{source:`iana`,compressible:!0,extensions:[`1km`]},"application/vnd.1ob":{source:`iana`},"application/vnd.3gpp-prose+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp-prose-pc3a+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp-prose-pc3ach+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp-prose-pc8+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:`iana`},"application/vnd.3gpp.5gnas":{source:`iana`},"application/vnd.3gpp.5gsa2x":{source:`iana`},"application/vnd.3gpp.5gsa2x-local-service-information":{source:`iana`},"application/vnd.3gpp.5gsv2x":{source:`iana`},"application/vnd.3gpp.5gsv2x-local-service-information":{source:`iana`},"application/vnd.3gpp.access-transfer-events+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.bsf+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.crs+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.current-location-discovery+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.gmop+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.gtpc":{source:`iana`},"application/vnd.3gpp.interworking-data":{source:`iana`},"application/vnd.3gpp.lpp":{source:`iana`},"application/vnd.3gpp.mc-signalling-ear":{source:`iana`},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:`iana`},"application/vnd.3gpp.mcdata-regroup+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcdata-service-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:`iana`},"application/vnd.3gpp.mcdata-ue-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-regroup+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-regroup+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.ngap":{source:`iana`},"application/vnd.3gpp.pfcp":{source:`iana`},"application/vnd.3gpp.pic-bw-large":{source:`iana`,extensions:[`plb`]},"application/vnd.3gpp.pic-bw-small":{source:`iana`,extensions:[`psb`]},"application/vnd.3gpp.pic-bw-var":{source:`iana`,extensions:[`pvb`]},"application/vnd.3gpp.pinapp-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.s1ap":{source:`iana`},"application/vnd.3gpp.seal-group-doc+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-location-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-mbms-usage-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-network-qos-management-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-ue-config-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-unicast-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.seal-user-profile-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.sms":{source:`iana`},"application/vnd.3gpp.sms+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.ussd+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp.v2x":{source:`iana`},"application/vnd.3gpp.vae-info+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:`iana`,compressible:!0},"application/vnd.3gpp2.sms":{source:`iana`},"application/vnd.3gpp2.tcap":{source:`iana`,extensions:[`tcap`]},"application/vnd.3lightssoftware.imagescal":{source:`iana`},"application/vnd.3m.post-it-notes":{source:`iana`,extensions:[`pwn`]},"application/vnd.accpac.simply.aso":{source:`iana`,extensions:[`aso`]},"application/vnd.accpac.simply.imp":{source:`iana`,extensions:[`imp`]},"application/vnd.acm.addressxfer+json":{source:`iana`,compressible:!0},"application/vnd.acm.chatbot+json":{source:`iana`,compressible:!0},"application/vnd.acucobol":{source:`iana`,extensions:[`acu`]},"application/vnd.acucorp":{source:`iana`,extensions:[`atc`,`acutc`]},"application/vnd.adobe.air-application-installer-package+zip":{source:`apache`,compressible:!1,extensions:[`air`]},"application/vnd.adobe.flash.movie":{source:`iana`},"application/vnd.adobe.formscentral.fcdt":{source:`iana`,extensions:[`fcdt`]},"application/vnd.adobe.fxp":{source:`iana`,extensions:[`fxp`,`fxpl`]},"application/vnd.adobe.partial-upload":{source:`iana`},"application/vnd.adobe.xdp+xml":{source:`iana`,compressible:!0,extensions:[`xdp`]},"application/vnd.adobe.xfdf":{source:`apache`,extensions:[`xfdf`]},"application/vnd.aether.imp":{source:`iana`},"application/vnd.afpc.afplinedata":{source:`iana`},"application/vnd.afpc.afplinedata-pagedef":{source:`iana`},"application/vnd.afpc.cmoca-cmresource":{source:`iana`},"application/vnd.afpc.foca-charset":{source:`iana`},"application/vnd.afpc.foca-codedfont":{source:`iana`},"application/vnd.afpc.foca-codepage":{source:`iana`},"application/vnd.afpc.modca":{source:`iana`},"application/vnd.afpc.modca-cmtable":{source:`iana`},"application/vnd.afpc.modca-formdef":{source:`iana`},"application/vnd.afpc.modca-mediummap":{source:`iana`},"application/vnd.afpc.modca-objectcontainer":{source:`iana`},"application/vnd.afpc.modca-overlay":{source:`iana`},"application/vnd.afpc.modca-pagesegment":{source:`iana`},"application/vnd.age":{source:`iana`,extensions:[`age`]},"application/vnd.ah-barcode":{source:`apache`},"application/vnd.ahead.space":{source:`iana`,extensions:[`ahead`]},"application/vnd.airzip.filesecure.azf":{source:`iana`,extensions:[`azf`]},"application/vnd.airzip.filesecure.azs":{source:`iana`,extensions:[`azs`]},"application/vnd.amadeus+json":{source:`iana`,compressible:!0},"application/vnd.amazon.ebook":{source:`apache`,extensions:[`azw`]},"application/vnd.amazon.mobi8-ebook":{source:`iana`},"application/vnd.americandynamics.acc":{source:`iana`,extensions:[`acc`]},"application/vnd.amiga.ami":{source:`iana`,extensions:[`ami`]},"application/vnd.amundsen.maze+xml":{source:`iana`,compressible:!0},"application/vnd.android.ota":{source:`iana`},"application/vnd.android.package-archive":{source:`apache`,compressible:!1,extensions:[`apk`]},"application/vnd.anki":{source:`iana`},"application/vnd.anser-web-certificate-issue-initiation":{source:`iana`,extensions:[`cii`]},"application/vnd.anser-web-funds-transfer-initiation":{source:`apache`,extensions:[`fti`]},"application/vnd.antix.game-component":{source:`iana`,extensions:[`atx`]},"application/vnd.apache.arrow.file":{source:`iana`},"application/vnd.apache.arrow.stream":{source:`iana`},"application/vnd.apache.parquet":{source:`iana`},"application/vnd.apache.thrift.binary":{source:`iana`},"application/vnd.apache.thrift.compact":{source:`iana`},"application/vnd.apache.thrift.json":{source:`iana`},"application/vnd.apexlang":{source:`iana`},"application/vnd.api+json":{source:`iana`,compressible:!0},"application/vnd.aplextor.warrp+json":{source:`iana`,compressible:!0},"application/vnd.apothekende.reservation+json":{source:`iana`,compressible:!0},"application/vnd.apple.installer+xml":{source:`iana`,compressible:!0,extensions:[`mpkg`]},"application/vnd.apple.keynote":{source:`iana`,extensions:[`key`]},"application/vnd.apple.mpegurl":{source:`iana`,extensions:[`m3u8`]},"application/vnd.apple.numbers":{source:`iana`,extensions:[`numbers`]},"application/vnd.apple.pages":{source:`iana`,extensions:[`pages`]},"application/vnd.apple.pkpass":{compressible:!1,extensions:[`pkpass`]},"application/vnd.arastra.swi":{source:`apache`},"application/vnd.aristanetworks.swi":{source:`iana`,extensions:[`swi`]},"application/vnd.artisan+json":{source:`iana`,compressible:!0},"application/vnd.artsquare":{source:`iana`},"application/vnd.astraea-software.iota":{source:`iana`,extensions:[`iota`]},"application/vnd.audiograph":{source:`iana`,extensions:[`aep`]},"application/vnd.autodesk.fbx":{extensions:[`fbx`]},"application/vnd.autopackage":{source:`iana`},"application/vnd.avalon+json":{source:`iana`,compressible:!0},"application/vnd.avistar+xml":{source:`iana`,compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:`iana`,compressible:!0,extensions:[`bmml`]},"application/vnd.balsamiq.bmpr":{source:`iana`},"application/vnd.banana-accounting":{source:`iana`},"application/vnd.bbf.usp.error":{source:`iana`},"application/vnd.bbf.usp.msg":{source:`iana`},"application/vnd.bbf.usp.msg+json":{source:`iana`,compressible:!0},"application/vnd.bekitzur-stech+json":{source:`iana`,compressible:!0},"application/vnd.belightsoft.lhzd+zip":{source:`iana`,compressible:!1},"application/vnd.belightsoft.lhzl+zip":{source:`iana`,compressible:!1},"application/vnd.bint.med-content":{source:`iana`},"application/vnd.biopax.rdf+xml":{source:`iana`,compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:`iana`},"application/vnd.blueice.multipass":{source:`iana`,extensions:[`mpm`]},"application/vnd.bluetooth.ep.oob":{source:`iana`},"application/vnd.bluetooth.le.oob":{source:`iana`},"application/vnd.bmi":{source:`iana`,extensions:[`bmi`]},"application/vnd.bpf":{source:`iana`},"application/vnd.bpf3":{source:`iana`},"application/vnd.businessobjects":{source:`iana`,extensions:[`rep`]},"application/vnd.byu.uapi+json":{source:`iana`,compressible:!0},"application/vnd.bzip3":{source:`iana`},"application/vnd.c3voc.schedule+xml":{source:`iana`,compressible:!0},"application/vnd.cab-jscript":{source:`iana`},"application/vnd.canon-cpdl":{source:`iana`},"application/vnd.canon-lips":{source:`iana`},"application/vnd.capasystems-pg+json":{source:`iana`,compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:`iana`},"application/vnd.century-systems.tcp_stream":{source:`iana`},"application/vnd.chemdraw+xml":{source:`iana`,compressible:!0,extensions:[`cdxml`]},"application/vnd.chess-pgn":{source:`iana`},"application/vnd.chipnuts.karaoke-mmd":{source:`iana`,extensions:[`mmd`]},"application/vnd.ciedi":{source:`iana`},"application/vnd.cinderella":{source:`iana`,extensions:[`cdy`]},"application/vnd.cirpack.isdn-ext":{source:`iana`},"application/vnd.citationstyles.style+xml":{source:`iana`,compressible:!0,extensions:[`csl`]},"application/vnd.claymore":{source:`iana`,extensions:[`cla`]},"application/vnd.cloanto.rp9":{source:`iana`,extensions:[`rp9`]},"application/vnd.clonk.c4group":{source:`iana`,extensions:[`c4g`,`c4d`,`c4f`,`c4p`,`c4u`]},"application/vnd.cluetrust.cartomobile-config":{source:`iana`,extensions:[`c11amc`]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:`iana`,extensions:[`c11amz`]},"application/vnd.cncf.helm.chart.content.v1.tar+gzip":{source:`iana`},"application/vnd.cncf.helm.chart.provenance.v1.prov":{source:`iana`},"application/vnd.cncf.helm.config.v1+json":{source:`iana`,compressible:!0},"application/vnd.coffeescript":{source:`iana`},"application/vnd.collabio.xodocuments.document":{source:`iana`},"application/vnd.collabio.xodocuments.document-template":{source:`iana`},"application/vnd.collabio.xodocuments.presentation":{source:`iana`},"application/vnd.collabio.xodocuments.presentation-template":{source:`iana`},"application/vnd.collabio.xodocuments.spreadsheet":{source:`iana`},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:`iana`},"application/vnd.collection+json":{source:`iana`,compressible:!0},"application/vnd.collection.doc+json":{source:`iana`,compressible:!0},"application/vnd.collection.next+json":{source:`iana`,compressible:!0},"application/vnd.comicbook+zip":{source:`iana`,compressible:!1},"application/vnd.comicbook-rar":{source:`iana`},"application/vnd.commerce-battelle":{source:`iana`},"application/vnd.commonspace":{source:`iana`,extensions:[`csp`]},"application/vnd.contact.cmsg":{source:`iana`,extensions:[`cdbcmsg`]},"application/vnd.coreos.ignition+json":{source:`iana`,compressible:!0},"application/vnd.cosmocaller":{source:`iana`,extensions:[`cmc`]},"application/vnd.crick.clicker":{source:`iana`,extensions:[`clkx`]},"application/vnd.crick.clicker.keyboard":{source:`iana`,extensions:[`clkk`]},"application/vnd.crick.clicker.palette":{source:`iana`,extensions:[`clkp`]},"application/vnd.crick.clicker.template":{source:`iana`,extensions:[`clkt`]},"application/vnd.crick.clicker.wordbank":{source:`iana`,extensions:[`clkw`]},"application/vnd.criticaltools.wbs+xml":{source:`iana`,compressible:!0,extensions:[`wbs`]},"application/vnd.cryptii.pipe+json":{source:`iana`,compressible:!0},"application/vnd.crypto-shade-file":{source:`iana`},"application/vnd.cryptomator.encrypted":{source:`iana`},"application/vnd.cryptomator.vault":{source:`iana`},"application/vnd.ctc-posml":{source:`iana`,extensions:[`pml`]},"application/vnd.ctct.ws+xml":{source:`iana`,compressible:!0},"application/vnd.cups-pdf":{source:`iana`},"application/vnd.cups-postscript":{source:`iana`},"application/vnd.cups-ppd":{source:`iana`,extensions:[`ppd`]},"application/vnd.cups-raster":{source:`iana`},"application/vnd.cups-raw":{source:`iana`},"application/vnd.curl":{source:`iana`},"application/vnd.curl.car":{source:`apache`,extensions:[`car`]},"application/vnd.curl.pcurl":{source:`apache`,extensions:[`pcurl`]},"application/vnd.cyan.dean.root+xml":{source:`iana`,compressible:!0},"application/vnd.cybank":{source:`iana`},"application/vnd.cyclonedx+json":{source:`iana`,compressible:!0},"application/vnd.cyclonedx+xml":{source:`iana`,compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:`iana`,compressible:!1},"application/vnd.d3m-dataset":{source:`iana`},"application/vnd.d3m-problem":{source:`iana`},"application/vnd.dart":{source:`iana`,compressible:!0,extensions:[`dart`]},"application/vnd.data-vision.rdz":{source:`iana`,extensions:[`rdz`]},"application/vnd.datalog":{source:`iana`},"application/vnd.datapackage+json":{source:`iana`,compressible:!0},"application/vnd.dataresource+json":{source:`iana`,compressible:!0},"application/vnd.dbf":{source:`iana`,extensions:[`dbf`]},"application/vnd.dcmp+xml":{source:`iana`,compressible:!0,extensions:[`dcmp`]},"application/vnd.debian.binary-package":{source:`iana`},"application/vnd.dece.data":{source:`iana`,extensions:[`uvf`,`uvvf`,`uvd`,`uvvd`]},"application/vnd.dece.ttml+xml":{source:`iana`,compressible:!0,extensions:[`uvt`,`uvvt`]},"application/vnd.dece.unspecified":{source:`iana`,extensions:[`uvx`,`uvvx`]},"application/vnd.dece.zip":{source:`iana`,extensions:[`uvz`,`uvvz`]},"application/vnd.denovo.fcselayout-link":{source:`iana`,extensions:[`fe_launch`]},"application/vnd.desmume.movie":{source:`iana`},"application/vnd.dir-bi.plate-dl-nosuffix":{source:`iana`},"application/vnd.dm.delegation+xml":{source:`iana`,compressible:!0},"application/vnd.dna":{source:`iana`,extensions:[`dna`]},"application/vnd.document+json":{source:`iana`,compressible:!0},"application/vnd.dolby.mlp":{source:`apache`,extensions:[`mlp`]},"application/vnd.dolby.mobile.1":{source:`iana`},"application/vnd.dolby.mobile.2":{source:`iana`},"application/vnd.doremir.scorecloud-binary-document":{source:`iana`},"application/vnd.dpgraph":{source:`iana`,extensions:[`dpg`]},"application/vnd.dreamfactory":{source:`iana`,extensions:[`dfac`]},"application/vnd.drive+json":{source:`iana`,compressible:!0},"application/vnd.ds-keypoint":{source:`apache`,extensions:[`kpxx`]},"application/vnd.dtg.local":{source:`iana`},"application/vnd.dtg.local.flash":{source:`iana`},"application/vnd.dtg.local.html":{source:`iana`},"application/vnd.dvb.ait":{source:`iana`,extensions:[`ait`]},"application/vnd.dvb.dvbisl+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.dvbj":{source:`iana`},"application/vnd.dvb.esgcontainer":{source:`iana`},"application/vnd.dvb.ipdcdftnotifaccess":{source:`iana`},"application/vnd.dvb.ipdcesgaccess":{source:`iana`},"application/vnd.dvb.ipdcesgaccess2":{source:`iana`},"application/vnd.dvb.ipdcesgpdd":{source:`iana`},"application/vnd.dvb.ipdcroaming":{source:`iana`},"application/vnd.dvb.iptv.alfec-base":{source:`iana`},"application/vnd.dvb.iptv.alfec-enhancement":{source:`iana`},"application/vnd.dvb.notif-aggregate-root+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.notif-container+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.notif-init+xml":{source:`iana`,compressible:!0},"application/vnd.dvb.pfr":{source:`iana`},"application/vnd.dvb.service":{source:`iana`,extensions:[`svc`]},"application/vnd.dxr":{source:`iana`},"application/vnd.dynageo":{source:`iana`,extensions:[`geo`]},"application/vnd.dzr":{source:`iana`},"application/vnd.easykaraoke.cdgdownload":{source:`iana`},"application/vnd.ecdis-update":{source:`iana`},"application/vnd.ecip.rlp":{source:`iana`},"application/vnd.eclipse.ditto+json":{source:`iana`,compressible:!0},"application/vnd.ecowin.chart":{source:`iana`,extensions:[`mag`]},"application/vnd.ecowin.filerequest":{source:`iana`},"application/vnd.ecowin.fileupdate":{source:`iana`},"application/vnd.ecowin.series":{source:`iana`},"application/vnd.ecowin.seriesrequest":{source:`iana`},"application/vnd.ecowin.seriesupdate":{source:`iana`},"application/vnd.efi.img":{source:`iana`},"application/vnd.efi.iso":{source:`iana`},"application/vnd.eln+zip":{source:`iana`,compressible:!1},"application/vnd.emclient.accessrequest+xml":{source:`iana`,compressible:!0},"application/vnd.enliven":{source:`iana`,extensions:[`nml`]},"application/vnd.enphase.envoy":{source:`iana`},"application/vnd.eprints.data+xml":{source:`iana`,compressible:!0},"application/vnd.epson.esf":{source:`iana`,extensions:[`esf`]},"application/vnd.epson.msf":{source:`iana`,extensions:[`msf`]},"application/vnd.epson.quickanime":{source:`iana`,extensions:[`qam`]},"application/vnd.epson.salt":{source:`iana`,extensions:[`slt`]},"application/vnd.epson.ssf":{source:`iana`,extensions:[`ssf`]},"application/vnd.ericsson.quickcall":{source:`iana`},"application/vnd.erofs":{source:`iana`},"application/vnd.espass-espass+zip":{source:`iana`,compressible:!1},"application/vnd.eszigno3+xml":{source:`iana`,compressible:!0,extensions:[`es3`,`et3`]},"application/vnd.etsi.aoc+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.asic-e+zip":{source:`iana`,compressible:!1},"application/vnd.etsi.asic-s+zip":{source:`iana`,compressible:!1},"application/vnd.etsi.cug+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.mcid+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.mheg5":{source:`iana`},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.pstn+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.sci+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.simservs+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.timestamp-token":{source:`iana`},"application/vnd.etsi.tsl+xml":{source:`iana`,compressible:!0},"application/vnd.etsi.tsl.der":{source:`iana`},"application/vnd.eu.kasparian.car+json":{source:`iana`,compressible:!0},"application/vnd.eudora.data":{source:`iana`},"application/vnd.evolv.ecig.profile":{source:`iana`},"application/vnd.evolv.ecig.settings":{source:`iana`},"application/vnd.evolv.ecig.theme":{source:`iana`},"application/vnd.exstream-empower+zip":{source:`iana`,compressible:!1},"application/vnd.exstream-package":{source:`iana`},"application/vnd.ezpix-album":{source:`iana`,extensions:[`ez2`]},"application/vnd.ezpix-package":{source:`iana`,extensions:[`ez3`]},"application/vnd.f-secure.mobile":{source:`iana`},"application/vnd.familysearch.gedcom+zip":{source:`iana`,compressible:!1},"application/vnd.fastcopy-disk-image":{source:`iana`},"application/vnd.fdf":{source:`apache`,extensions:[`fdf`]},"application/vnd.fdsn.mseed":{source:`iana`,extensions:[`mseed`]},"application/vnd.fdsn.seed":{source:`iana`,extensions:[`seed`,`dataless`]},"application/vnd.fdsn.stationxml+xml":{source:`iana`,charset:`XML-BASED`,compressible:!0},"application/vnd.ffsns":{source:`iana`},"application/vnd.ficlab.flb+zip":{source:`iana`,compressible:!1},"application/vnd.filmit.zfc":{source:`iana`},"application/vnd.fints":{source:`iana`},"application/vnd.firemonkeys.cloudcell":{source:`iana`},"application/vnd.flographit":{source:`iana`,extensions:[`gph`]},"application/vnd.fluxtime.clip":{source:`iana`,extensions:[`ftc`]},"application/vnd.font-fontforge-sfd":{source:`iana`},"application/vnd.framemaker":{source:`iana`,extensions:[`fm`,`frame`,`maker`,`book`]},"application/vnd.freelog.comic":{source:`iana`},"application/vnd.frogans.fnc":{source:`apache`,extensions:[`fnc`]},"application/vnd.frogans.ltf":{source:`apache`,extensions:[`ltf`]},"application/vnd.fsc.weblaunch":{source:`iana`,extensions:[`fsc`]},"application/vnd.fujifilm.fb.docuworks":{source:`iana`},"application/vnd.fujifilm.fb.docuworks.binder":{source:`iana`},"application/vnd.fujifilm.fb.docuworks.container":{source:`iana`},"application/vnd.fujifilm.fb.jfi+xml":{source:`iana`,compressible:!0},"application/vnd.fujitsu.oasys":{source:`iana`,extensions:[`oas`]},"application/vnd.fujitsu.oasys2":{source:`iana`,extensions:[`oa2`]},"application/vnd.fujitsu.oasys3":{source:`iana`,extensions:[`oa3`]},"application/vnd.fujitsu.oasysgp":{source:`iana`,extensions:[`fg5`]},"application/vnd.fujitsu.oasysprs":{source:`iana`,extensions:[`bh2`]},"application/vnd.fujixerox.art-ex":{source:`iana`},"application/vnd.fujixerox.art4":{source:`iana`},"application/vnd.fujixerox.ddd":{source:`iana`,extensions:[`ddd`]},"application/vnd.fujixerox.docuworks":{source:`iana`,extensions:[`xdw`]},"application/vnd.fujixerox.docuworks.binder":{source:`iana`,extensions:[`xbd`]},"application/vnd.fujixerox.docuworks.container":{source:`iana`},"application/vnd.fujixerox.hbpl":{source:`iana`},"application/vnd.fut-misnet":{source:`iana`},"application/vnd.futoin+cbor":{source:`iana`},"application/vnd.futoin+json":{source:`iana`,compressible:!0},"application/vnd.fuzzysheet":{source:`iana`,extensions:[`fzs`]},"application/vnd.ga4gh.passport+jwt":{source:`iana`},"application/vnd.genomatix.tuxedo":{source:`iana`,extensions:[`txd`]},"application/vnd.genozip":{source:`iana`},"application/vnd.gentics.grd+json":{source:`iana`,compressible:!0},"application/vnd.gentoo.catmetadata+xml":{source:`iana`,compressible:!0},"application/vnd.gentoo.ebuild":{source:`iana`},"application/vnd.gentoo.eclass":{source:`iana`},"application/vnd.gentoo.gpkg":{source:`iana`},"application/vnd.gentoo.manifest":{source:`iana`},"application/vnd.gentoo.pkgmetadata+xml":{source:`iana`,compressible:!0},"application/vnd.gentoo.xpak":{source:`iana`},"application/vnd.geo+json":{source:`apache`,compressible:!0},"application/vnd.geocube+xml":{source:`apache`,compressible:!0},"application/vnd.geogebra.file":{source:`iana`,extensions:[`ggb`]},"application/vnd.geogebra.pinboard":{source:`iana`},"application/vnd.geogebra.slides":{source:`iana`,extensions:[`ggs`]},"application/vnd.geogebra.tool":{source:`iana`,extensions:[`ggt`]},"application/vnd.geometry-explorer":{source:`iana`,extensions:[`gex`,`gre`]},"application/vnd.geonext":{source:`iana`,extensions:[`gxt`]},"application/vnd.geoplan":{source:`iana`,extensions:[`g2w`]},"application/vnd.geospace":{source:`iana`,extensions:[`g3w`]},"application/vnd.gerber":{source:`iana`},"application/vnd.globalplatform.card-content-mgt":{source:`iana`},"application/vnd.globalplatform.card-content-mgt-response":{source:`iana`},"application/vnd.gmx":{source:`iana`,extensions:[`gmx`]},"application/vnd.gnu.taler.exchange+json":{source:`iana`,compressible:!0},"application/vnd.gnu.taler.merchant+json":{source:`iana`,compressible:!0},"application/vnd.google-apps.audio":{},"application/vnd.google-apps.document":{compressible:!1,extensions:[`gdoc`]},"application/vnd.google-apps.drawing":{compressible:!1,extensions:[`gdraw`]},"application/vnd.google-apps.drive-sdk":{compressible:!1},"application/vnd.google-apps.file":{},"application/vnd.google-apps.folder":{compressible:!1},"application/vnd.google-apps.form":{compressible:!1,extensions:[`gform`]},"application/vnd.google-apps.fusiontable":{},"application/vnd.google-apps.jam":{compressible:!1,extensions:[`gjam`]},"application/vnd.google-apps.mail-layout":{},"application/vnd.google-apps.map":{compressible:!1,extensions:[`gmap`]},"application/vnd.google-apps.photo":{},"application/vnd.google-apps.presentation":{compressible:!1,extensions:[`gslides`]},"application/vnd.google-apps.script":{compressible:!1,extensions:[`gscript`]},"application/vnd.google-apps.shortcut":{},"application/vnd.google-apps.site":{compressible:!1,extensions:[`gsite`]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:[`gsheet`]},"application/vnd.google-apps.unknown":{},"application/vnd.google-apps.video":{},"application/vnd.google-earth.kml+xml":{source:`iana`,compressible:!0,extensions:[`kml`]},"application/vnd.google-earth.kmz":{source:`iana`,compressible:!1,extensions:[`kmz`]},"application/vnd.gov.sk.e-form+xml":{source:`apache`,compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:`iana`,compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:`iana`,compressible:!0,extensions:[`xdcf`]},"application/vnd.gpxsee.map+xml":{source:`iana`,compressible:!0},"application/vnd.grafeq":{source:`iana`,extensions:[`gqf`,`gqs`]},"application/vnd.gridmp":{source:`iana`},"application/vnd.groove-account":{source:`iana`,extensions:[`gac`]},"application/vnd.groove-help":{source:`iana`,extensions:[`ghf`]},"application/vnd.groove-identity-message":{source:`iana`,extensions:[`gim`]},"application/vnd.groove-injector":{source:`iana`,extensions:[`grv`]},"application/vnd.groove-tool-message":{source:`iana`,extensions:[`gtm`]},"application/vnd.groove-tool-template":{source:`iana`,extensions:[`tpl`]},"application/vnd.groove-vcard":{source:`iana`,extensions:[`vcg`]},"application/vnd.hal+json":{source:`iana`,compressible:!0},"application/vnd.hal+xml":{source:`iana`,compressible:!0,extensions:[`hal`]},"application/vnd.handheld-entertainment+xml":{source:`iana`,compressible:!0,extensions:[`zmm`]},"application/vnd.hbci":{source:`iana`,extensions:[`hbci`]},"application/vnd.hc+json":{source:`iana`,compressible:!0},"application/vnd.hcl-bireports":{source:`iana`},"application/vnd.hdt":{source:`iana`},"application/vnd.heroku+json":{source:`iana`,compressible:!0},"application/vnd.hhe.lesson-player":{source:`iana`,extensions:[`les`]},"application/vnd.hp-hpgl":{source:`iana`,extensions:[`hpgl`]},"application/vnd.hp-hpid":{source:`iana`,extensions:[`hpid`]},"application/vnd.hp-hps":{source:`iana`,extensions:[`hps`]},"application/vnd.hp-jlyt":{source:`iana`,extensions:[`jlt`]},"application/vnd.hp-pcl":{source:`iana`,extensions:[`pcl`]},"application/vnd.hp-pclxl":{source:`iana`,extensions:[`pclxl`]},"application/vnd.hsl":{source:`iana`},"application/vnd.httphone":{source:`iana`},"application/vnd.hydrostatix.sof-data":{source:`iana`,extensions:[`sfd-hdstx`]},"application/vnd.hyper+json":{source:`iana`,compressible:!0},"application/vnd.hyper-item+json":{source:`iana`,compressible:!0},"application/vnd.hyperdrive+json":{source:`iana`,compressible:!0},"application/vnd.hzn-3d-crossword":{source:`iana`},"application/vnd.ibm.afplinedata":{source:`apache`},"application/vnd.ibm.electronic-media":{source:`iana`},"application/vnd.ibm.minipay":{source:`iana`,extensions:[`mpy`]},"application/vnd.ibm.modcap":{source:`apache`,extensions:[`afp`,`listafp`,`list3820`]},"application/vnd.ibm.rights-management":{source:`iana`,extensions:[`irm`]},"application/vnd.ibm.secure-container":{source:`iana`,extensions:[`sc`]},"application/vnd.iccprofile":{source:`iana`,extensions:[`icc`,`icm`]},"application/vnd.ieee.1905":{source:`iana`},"application/vnd.igloader":{source:`iana`,extensions:[`igl`]},"application/vnd.imagemeter.folder+zip":{source:`iana`,compressible:!1},"application/vnd.imagemeter.image+zip":{source:`iana`,compressible:!1},"application/vnd.immervision-ivp":{source:`iana`,extensions:[`ivp`]},"application/vnd.immervision-ivu":{source:`iana`,extensions:[`ivu`]},"application/vnd.ims.imsccv1p1":{source:`iana`},"application/vnd.ims.imsccv1p2":{source:`iana`},"application/vnd.ims.imsccv1p3":{source:`iana`},"application/vnd.ims.lis.v2.result+json":{source:`iana`,compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:`iana`,compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:`iana`,compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:`iana`,compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:`iana`,compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:`iana`,compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:`iana`,compressible:!0},"application/vnd.informix-visionary":{source:`apache`},"application/vnd.infotech.project":{source:`iana`},"application/vnd.infotech.project+xml":{source:`iana`,compressible:!0},"application/vnd.innopath.wamp.notification":{source:`iana`},"application/vnd.insors.igm":{source:`iana`,extensions:[`igm`]},"application/vnd.intercon.formnet":{source:`iana`,extensions:[`xpw`,`xpx`]},"application/vnd.intergeo":{source:`iana`,extensions:[`i2g`]},"application/vnd.intertrust.digibox":{source:`iana`},"application/vnd.intertrust.nncp":{source:`iana`},"application/vnd.intu.qbo":{source:`iana`,extensions:[`qbo`]},"application/vnd.intu.qfx":{source:`iana`,extensions:[`qfx`]},"application/vnd.ipfs.ipns-record":{source:`iana`},"application/vnd.ipld.car":{source:`iana`},"application/vnd.ipld.dag-cbor":{source:`iana`},"application/vnd.ipld.dag-json":{source:`iana`},"application/vnd.ipld.raw":{source:`iana`},"application/vnd.iptc.g2.catalogitem+xml":{source:`iana`,compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:`iana`,compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:`iana`,compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:`iana`,compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:`iana`,compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:`iana`,compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:`iana`,compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:`iana`,extensions:[`rcprofile`]},"application/vnd.irepository.package+xml":{source:`iana`,compressible:!0,extensions:[`irp`]},"application/vnd.is-xpr":{source:`iana`,extensions:[`xpr`]},"application/vnd.isac.fcs":{source:`iana`,extensions:[`fcs`]},"application/vnd.iso11783-10+zip":{source:`iana`,compressible:!1},"application/vnd.jam":{source:`iana`,extensions:[`jam`]},"application/vnd.japannet-directory-service":{source:`iana`},"application/vnd.japannet-jpnstore-wakeup":{source:`iana`},"application/vnd.japannet-payment-wakeup":{source:`iana`},"application/vnd.japannet-registration":{source:`iana`},"application/vnd.japannet-registration-wakeup":{source:`iana`},"application/vnd.japannet-setstore-wakeup":{source:`iana`},"application/vnd.japannet-verification":{source:`iana`},"application/vnd.japannet-verification-wakeup":{source:`iana`},"application/vnd.jcp.javame.midlet-rms":{source:`iana`,extensions:[`rms`]},"application/vnd.jisp":{source:`iana`,extensions:[`jisp`]},"application/vnd.joost.joda-archive":{source:`iana`,extensions:[`joda`]},"application/vnd.jsk.isdn-ngn":{source:`iana`},"application/vnd.kahootz":{source:`iana`,extensions:[`ktz`,`ktr`]},"application/vnd.kde.karbon":{source:`iana`,extensions:[`karbon`]},"application/vnd.kde.kchart":{source:`iana`,extensions:[`chrt`]},"application/vnd.kde.kformula":{source:`iana`,extensions:[`kfo`]},"application/vnd.kde.kivio":{source:`iana`,extensions:[`flw`]},"application/vnd.kde.kontour":{source:`iana`,extensions:[`kon`]},"application/vnd.kde.kpresenter":{source:`iana`,extensions:[`kpr`,`kpt`]},"application/vnd.kde.kspread":{source:`iana`,extensions:[`ksp`]},"application/vnd.kde.kword":{source:`iana`,extensions:[`kwd`,`kwt`]},"application/vnd.kdl":{source:`iana`},"application/vnd.kenameaapp":{source:`iana`,extensions:[`htke`]},"application/vnd.keyman.kmp+zip":{source:`iana`,compressible:!1},"application/vnd.keyman.kmx":{source:`iana`},"application/vnd.kidspiration":{source:`iana`,extensions:[`kia`]},"application/vnd.kinar":{source:`iana`,extensions:[`kne`,`knp`]},"application/vnd.koan":{source:`iana`,extensions:[`skp`,`skd`,`skt`,`skm`]},"application/vnd.kodak-descriptor":{source:`iana`,extensions:[`sse`]},"application/vnd.las":{source:`iana`},"application/vnd.las.las+json":{source:`iana`,compressible:!0},"application/vnd.las.las+xml":{source:`iana`,compressible:!0,extensions:[`lasxml`]},"application/vnd.laszip":{source:`iana`},"application/vnd.ldev.productlicensing":{source:`iana`},"application/vnd.leap+json":{source:`iana`,compressible:!0},"application/vnd.liberty-request+xml":{source:`iana`,compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:`iana`,extensions:[`lbd`]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:`iana`,compressible:!0,extensions:[`lbe`]},"application/vnd.logipipe.circuit+zip":{source:`iana`,compressible:!1},"application/vnd.loom":{source:`iana`},"application/vnd.lotus-1-2-3":{source:`iana`,extensions:[`123`]},"application/vnd.lotus-approach":{source:`iana`,extensions:[`apr`]},"application/vnd.lotus-freelance":{source:`iana`,extensions:[`pre`]},"application/vnd.lotus-notes":{source:`iana`,extensions:[`nsf`]},"application/vnd.lotus-organizer":{source:`iana`,extensions:[`org`]},"application/vnd.lotus-screencam":{source:`iana`,extensions:[`scm`]},"application/vnd.lotus-wordpro":{source:`iana`,extensions:[`lwp`]},"application/vnd.macports.portpkg":{source:`iana`,extensions:[`portpkg`]},"application/vnd.mapbox-vector-tile":{source:`iana`,extensions:[`mvt`]},"application/vnd.marlin.drm.actiontoken+xml":{source:`iana`,compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:`iana`,compressible:!0},"application/vnd.marlin.drm.license+xml":{source:`iana`,compressible:!0},"application/vnd.marlin.drm.mdcf":{source:`iana`},"application/vnd.mason+json":{source:`iana`,compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:`iana`,compressible:!1},"application/vnd.maxmind.maxmind-db":{source:`iana`},"application/vnd.mcd":{source:`iana`,extensions:[`mcd`]},"application/vnd.mdl":{source:`iana`},"application/vnd.mdl-mbsdf":{source:`iana`},"application/vnd.medcalcdata":{source:`iana`,extensions:[`mc1`]},"application/vnd.mediastation.cdkey":{source:`iana`,extensions:[`cdkey`]},"application/vnd.medicalholodeck.recordxr":{source:`iana`},"application/vnd.meridian-slingshot":{source:`iana`},"application/vnd.mermaid":{source:`iana`},"application/vnd.mfer":{source:`iana`,extensions:[`mwf`]},"application/vnd.mfmp":{source:`iana`,extensions:[`mfm`]},"application/vnd.micro+json":{source:`iana`,compressible:!0},"application/vnd.micrografx.flo":{source:`iana`,extensions:[`flo`]},"application/vnd.micrografx.igx":{source:`iana`,extensions:[`igx`]},"application/vnd.microsoft.portable-executable":{source:`iana`},"application/vnd.microsoft.windows.thumbnail-cache":{source:`iana`},"application/vnd.miele+json":{source:`iana`,compressible:!0},"application/vnd.mif":{source:`iana`,extensions:[`mif`]},"application/vnd.minisoft-hp3000-save":{source:`iana`},"application/vnd.mitsubishi.misty-guard.trustweb":{source:`iana`},"application/vnd.mobius.daf":{source:`iana`,extensions:[`daf`]},"application/vnd.mobius.dis":{source:`iana`,extensions:[`dis`]},"application/vnd.mobius.mbk":{source:`iana`,extensions:[`mbk`]},"application/vnd.mobius.mqy":{source:`iana`,extensions:[`mqy`]},"application/vnd.mobius.msl":{source:`iana`,extensions:[`msl`]},"application/vnd.mobius.plc":{source:`iana`,extensions:[`plc`]},"application/vnd.mobius.txf":{source:`iana`,extensions:[`txf`]},"application/vnd.modl":{source:`iana`},"application/vnd.mophun.application":{source:`iana`,extensions:[`mpn`]},"application/vnd.mophun.certificate":{source:`iana`,extensions:[`mpc`]},"application/vnd.motorola.flexsuite":{source:`iana`},"application/vnd.motorola.flexsuite.adsi":{source:`iana`},"application/vnd.motorola.flexsuite.fis":{source:`iana`},"application/vnd.motorola.flexsuite.gotap":{source:`iana`},"application/vnd.motorola.flexsuite.kmr":{source:`iana`},"application/vnd.motorola.flexsuite.ttc":{source:`iana`},"application/vnd.motorola.flexsuite.wem":{source:`iana`},"application/vnd.motorola.iprm":{source:`iana`},"application/vnd.mozilla.xul+xml":{source:`iana`,compressible:!0,extensions:[`xul`]},"application/vnd.ms-3mfdocument":{source:`iana`},"application/vnd.ms-artgalry":{source:`iana`,extensions:[`cil`]},"application/vnd.ms-asf":{source:`iana`},"application/vnd.ms-cab-compressed":{source:`iana`,extensions:[`cab`]},"application/vnd.ms-color.iccprofile":{source:`apache`},"application/vnd.ms-excel":{source:`iana`,compressible:!1,extensions:[`xls`,`xlm`,`xla`,`xlc`,`xlt`,`xlw`]},"application/vnd.ms-excel.addin.macroenabled.12":{source:`iana`,extensions:[`xlam`]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:`iana`,extensions:[`xlsb`]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:`iana`,extensions:[`xlsm`]},"application/vnd.ms-excel.template.macroenabled.12":{source:`iana`,extensions:[`xltm`]},"application/vnd.ms-fontobject":{source:`iana`,compressible:!0,extensions:[`eot`]},"application/vnd.ms-htmlhelp":{source:`iana`,extensions:[`chm`]},"application/vnd.ms-ims":{source:`iana`,extensions:[`ims`]},"application/vnd.ms-lrm":{source:`iana`,extensions:[`lrm`]},"application/vnd.ms-office.activex+xml":{source:`iana`,compressible:!0},"application/vnd.ms-officetheme":{source:`iana`,extensions:[`thmx`]},"application/vnd.ms-opentype":{source:`apache`,compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:[`msg`]},"application/vnd.ms-package.obfuscated-opentype":{source:`apache`},"application/vnd.ms-pki.seccat":{source:`apache`,extensions:[`cat`]},"application/vnd.ms-pki.stl":{source:`apache`,extensions:[`stl`]},"application/vnd.ms-playready.initiator+xml":{source:`iana`,compressible:!0},"application/vnd.ms-powerpoint":{source:`iana`,compressible:!1,extensions:[`ppt`,`pps`,`pot`]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:`iana`,extensions:[`ppam`]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:`iana`,extensions:[`pptm`]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:`iana`,extensions:[`sldm`]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:`iana`,extensions:[`ppsm`]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:`iana`,extensions:[`potm`]},"application/vnd.ms-printdevicecapabilities+xml":{source:`iana`,compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:`apache`,compressible:!0},"application/vnd.ms-printschematicket+xml":{source:`iana`,compressible:!0},"application/vnd.ms-project":{source:`iana`,extensions:[`mpp`,`mpt`]},"application/vnd.ms-tnef":{source:`iana`},"application/vnd.ms-visio.viewer":{extensions:[`vdx`]},"application/vnd.ms-windows.devicepairing":{source:`iana`},"application/vnd.ms-windows.nwprinting.oob":{source:`iana`},"application/vnd.ms-windows.printerpairing":{source:`iana`},"application/vnd.ms-windows.wsd.oob":{source:`iana`},"application/vnd.ms-wmdrm.lic-chlg-req":{source:`iana`},"application/vnd.ms-wmdrm.lic-resp":{source:`iana`},"application/vnd.ms-wmdrm.meter-chlg-req":{source:`iana`},"application/vnd.ms-wmdrm.meter-resp":{source:`iana`},"application/vnd.ms-word.document.macroenabled.12":{source:`iana`,extensions:[`docm`]},"application/vnd.ms-word.template.macroenabled.12":{source:`iana`,extensions:[`dotm`]},"application/vnd.ms-works":{source:`iana`,extensions:[`wps`,`wks`,`wcm`,`wdb`]},"application/vnd.ms-wpl":{source:`iana`,extensions:[`wpl`]},"application/vnd.ms-xpsdocument":{source:`iana`,compressible:!1,extensions:[`xps`]},"application/vnd.msa-disk-image":{source:`iana`},"application/vnd.mseq":{source:`iana`,extensions:[`mseq`]},"application/vnd.msgpack":{source:`iana`},"application/vnd.msign":{source:`iana`},"application/vnd.multiad.creator":{source:`iana`},"application/vnd.multiad.creator.cif":{source:`iana`},"application/vnd.music-niff":{source:`iana`},"application/vnd.musician":{source:`iana`,extensions:[`mus`]},"application/vnd.muvee.style":{source:`iana`,extensions:[`msty`]},"application/vnd.mynfc":{source:`iana`,extensions:[`taglet`]},"application/vnd.nacamar.ybrid+json":{source:`iana`,compressible:!0},"application/vnd.nato.bindingdataobject+cbor":{source:`iana`},"application/vnd.nato.bindingdataobject+json":{source:`iana`,compressible:!0},"application/vnd.nato.bindingdataobject+xml":{source:`iana`,compressible:!0,extensions:[`bdo`]},"application/vnd.nato.openxmlformats-package.iepd+zip":{source:`iana`,compressible:!1},"application/vnd.ncd.control":{source:`iana`},"application/vnd.ncd.reference":{source:`iana`},"application/vnd.nearst.inv+json":{source:`iana`,compressible:!0},"application/vnd.nebumind.line":{source:`iana`},"application/vnd.nervana":{source:`iana`},"application/vnd.netfpx":{source:`iana`},"application/vnd.neurolanguage.nlu":{source:`iana`,extensions:[`nlu`]},"application/vnd.nimn":{source:`iana`},"application/vnd.nintendo.nitro.rom":{source:`iana`},"application/vnd.nintendo.snes.rom":{source:`iana`},"application/vnd.nitf":{source:`iana`,extensions:[`ntf`,`nitf`]},"application/vnd.noblenet-directory":{source:`iana`,extensions:[`nnd`]},"application/vnd.noblenet-sealer":{source:`iana`,extensions:[`nns`]},"application/vnd.noblenet-web":{source:`iana`,extensions:[`nnw`]},"application/vnd.nokia.catalogs":{source:`iana`},"application/vnd.nokia.conml+wbxml":{source:`iana`},"application/vnd.nokia.conml+xml":{source:`iana`,compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:`iana`,compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:`iana`},"application/vnd.nokia.landmark+wbxml":{source:`iana`},"application/vnd.nokia.landmark+xml":{source:`iana`,compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:`iana`,compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:`iana`,compressible:!0,extensions:[`ac`]},"application/vnd.nokia.n-gage.data":{source:`iana`,extensions:[`ngdat`]},"application/vnd.nokia.n-gage.symbian.install":{source:`apache`,extensions:[`n-gage`]},"application/vnd.nokia.ncd":{source:`iana`},"application/vnd.nokia.pcd+wbxml":{source:`iana`},"application/vnd.nokia.pcd+xml":{source:`iana`,compressible:!0},"application/vnd.nokia.radio-preset":{source:`iana`,extensions:[`rpst`]},"application/vnd.nokia.radio-presets":{source:`iana`,extensions:[`rpss`]},"application/vnd.novadigm.edm":{source:`iana`,extensions:[`edm`]},"application/vnd.novadigm.edx":{source:`iana`,extensions:[`edx`]},"application/vnd.novadigm.ext":{source:`iana`,extensions:[`ext`]},"application/vnd.ntt-local.content-share":{source:`iana`},"application/vnd.ntt-local.file-transfer":{source:`iana`},"application/vnd.ntt-local.ogw_remote-access":{source:`iana`},"application/vnd.ntt-local.sip-ta_remote":{source:`iana`},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:`iana`},"application/vnd.oai.workflows":{source:`iana`},"application/vnd.oai.workflows+json":{source:`iana`,compressible:!0},"application/vnd.oai.workflows+yaml":{source:`iana`},"application/vnd.oasis.opendocument.base":{source:`iana`},"application/vnd.oasis.opendocument.chart":{source:`iana`,extensions:[`odc`]},"application/vnd.oasis.opendocument.chart-template":{source:`iana`,extensions:[`otc`]},"application/vnd.oasis.opendocument.database":{source:`apache`,extensions:[`odb`]},"application/vnd.oasis.opendocument.formula":{source:`iana`,extensions:[`odf`]},"application/vnd.oasis.opendocument.formula-template":{source:`iana`,extensions:[`odft`]},"application/vnd.oasis.opendocument.graphics":{source:`iana`,compressible:!1,extensions:[`odg`]},"application/vnd.oasis.opendocument.graphics-template":{source:`iana`,extensions:[`otg`]},"application/vnd.oasis.opendocument.image":{source:`iana`,extensions:[`odi`]},"application/vnd.oasis.opendocument.image-template":{source:`iana`,extensions:[`oti`]},"application/vnd.oasis.opendocument.presentation":{source:`iana`,compressible:!1,extensions:[`odp`]},"application/vnd.oasis.opendocument.presentation-template":{source:`iana`,extensions:[`otp`]},"application/vnd.oasis.opendocument.spreadsheet":{source:`iana`,compressible:!1,extensions:[`ods`]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:`iana`,extensions:[`ots`]},"application/vnd.oasis.opendocument.text":{source:`iana`,compressible:!1,extensions:[`odt`]},"application/vnd.oasis.opendocument.text-master":{source:`iana`,extensions:[`odm`]},"application/vnd.oasis.opendocument.text-master-template":{source:`iana`},"application/vnd.oasis.opendocument.text-template":{source:`iana`,extensions:[`ott`]},"application/vnd.oasis.opendocument.text-web":{source:`iana`,extensions:[`oth`]},"application/vnd.obn":{source:`iana`},"application/vnd.ocf+cbor":{source:`iana`},"application/vnd.oci.image.manifest.v1+json":{source:`iana`,compressible:!0},"application/vnd.oftn.l10n+json":{source:`iana`,compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:`iana`},"application/vnd.oipf.dae.svg+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.pae.gem":{source:`iana`},"application/vnd.oipf.spdiscovery+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.spdlist+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:`iana`,compressible:!0},"application/vnd.oipf.userprofile+xml":{source:`iana`,compressible:!0},"application/vnd.olpc-sugar":{source:`iana`,extensions:[`xo`]},"application/vnd.oma-scws-config":{source:`iana`},"application/vnd.oma-scws-http-request":{source:`iana`},"application/vnd.oma-scws-http-response":{source:`iana`},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:`iana`,compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:`apache`,compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:`iana`,compressible:!0},"application/vnd.oma.bcast.ltkm":{source:`iana`},"application/vnd.oma.bcast.notification+xml":{source:`iana`,compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:`iana`},"application/vnd.oma.bcast.sgboot":{source:`iana`},"application/vnd.oma.bcast.sgdd+xml":{source:`iana`,compressible:!0},"application/vnd.oma.bcast.sgdu":{source:`iana`},"application/vnd.oma.bcast.simple-symbol-container":{source:`iana`},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:`apache`,compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:`iana`,compressible:!0},"application/vnd.oma.bcast.stkm":{source:`iana`},"application/vnd.oma.cab-address-book+xml":{source:`iana`,compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:`iana`,compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:`iana`,compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:`iana`,compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:`iana`,compressible:!0},"application/vnd.oma.dcd":{source:`iana`},"application/vnd.oma.dcdc":{source:`iana`},"application/vnd.oma.dd2+xml":{source:`iana`,compressible:!0,extensions:[`dd2`]},"application/vnd.oma.drm.risd+xml":{source:`iana`,compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:`iana`,compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:`iana`},"application/vnd.oma.lwm2m+json":{source:`iana`,compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:`iana`},"application/vnd.oma.pal+xml":{source:`iana`,compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:`iana`,compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:`iana`,compressible:!0},"application/vnd.oma.poc.groups+xml":{source:`iana`,compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:`iana`,compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:`iana`,compressible:!0},"application/vnd.oma.push":{source:`iana`},"application/vnd.oma.scidm.messages+xml":{source:`iana`,compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:`iana`,compressible:!0},"application/vnd.omads-email+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/vnd.omads-file+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/vnd.omads-folder+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/vnd.omaloc-supl-init":{source:`iana`},"application/vnd.onepager":{source:`iana`},"application/vnd.onepagertamp":{source:`iana`},"application/vnd.onepagertamx":{source:`iana`},"application/vnd.onepagertat":{source:`iana`},"application/vnd.onepagertatp":{source:`iana`},"application/vnd.onepagertatx":{source:`iana`},"application/vnd.onvif.metadata":{source:`iana`},"application/vnd.openblox.game+xml":{source:`iana`,compressible:!0,extensions:[`obgx`]},"application/vnd.openblox.game-binary":{source:`iana`},"application/vnd.openeye.oeb":{source:`iana`},"application/vnd.openofficeorg.extension":{source:`apache`,extensions:[`oxt`]},"application/vnd.openstreetmap.data+xml":{source:`iana`,compressible:!0,extensions:[`osm`]},"application/vnd.opentimestamps.ots":{source:`iana`},"application/vnd.openvpi.dspx+json":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:`iana`,compressible:!1,extensions:[`pptx`]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:`iana`,extensions:[`sldx`]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:`iana`,extensions:[`ppsx`]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:`iana`,extensions:[`potx`]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:`iana`,compressible:!1,extensions:[`xlsx`]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:`iana`,extensions:[`xltx`]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:`iana`},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:`iana`,compressible:!1,extensions:[`docx`]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:`iana`,extensions:[`dotx`]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:`iana`,compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:`iana`,compressible:!0},"application/vnd.oracle.resource+json":{source:`iana`,compressible:!0},"application/vnd.orange.indata":{source:`iana`},"application/vnd.osa.netdeploy":{source:`iana`},"application/vnd.osgeo.mapguide.package":{source:`iana`,extensions:[`mgp`]},"application/vnd.osgi.bundle":{source:`iana`},"application/vnd.osgi.dp":{source:`iana`,extensions:[`dp`]},"application/vnd.osgi.subsystem":{source:`iana`,extensions:[`esa`]},"application/vnd.otps.ct-kip+xml":{source:`iana`,compressible:!0},"application/vnd.oxli.countgraph":{source:`iana`},"application/vnd.pagerduty+json":{source:`iana`,compressible:!0},"application/vnd.palm":{source:`iana`,extensions:[`pdb`,`pqa`,`oprc`]},"application/vnd.panoply":{source:`iana`},"application/vnd.paos.xml":{source:`iana`},"application/vnd.patentdive":{source:`iana`},"application/vnd.patientecommsdoc":{source:`iana`},"application/vnd.pawaafile":{source:`iana`,extensions:[`paw`]},"application/vnd.pcos":{source:`iana`},"application/vnd.pg.format":{source:`iana`,extensions:[`str`]},"application/vnd.pg.osasli":{source:`iana`,extensions:[`ei6`]},"application/vnd.piaccess.application-licence":{source:`iana`},"application/vnd.picsel":{source:`iana`,extensions:[`efif`]},"application/vnd.pmi.widget":{source:`iana`,extensions:[`wg`]},"application/vnd.poc.group-advertisement+xml":{source:`iana`,compressible:!0},"application/vnd.pocketlearn":{source:`iana`,extensions:[`plf`]},"application/vnd.powerbuilder6":{source:`iana`,extensions:[`pbd`]},"application/vnd.powerbuilder6-s":{source:`iana`},"application/vnd.powerbuilder7":{source:`iana`},"application/vnd.powerbuilder7-s":{source:`iana`},"application/vnd.powerbuilder75":{source:`iana`},"application/vnd.powerbuilder75-s":{source:`iana`},"application/vnd.preminet":{source:`iana`},"application/vnd.previewsystems.box":{source:`iana`,extensions:[`box`]},"application/vnd.procrate.brushset":{extensions:[`brushset`]},"application/vnd.procreate.brush":{extensions:[`brush`]},"application/vnd.procreate.dream":{extensions:[`drm`]},"application/vnd.proteus.magazine":{source:`iana`,extensions:[`mgz`]},"application/vnd.psfs":{source:`iana`},"application/vnd.pt.mundusmundi":{source:`iana`},"application/vnd.publishare-delta-tree":{source:`iana`,extensions:[`qps`]},"application/vnd.pvi.ptid1":{source:`iana`,extensions:[`ptid`]},"application/vnd.pwg-multiplexed":{source:`iana`},"application/vnd.pwg-xhtml-print+xml":{source:`iana`,compressible:!0,extensions:[`xhtm`]},"application/vnd.qualcomm.brew-app-res":{source:`iana`},"application/vnd.quarantainenet":{source:`iana`},"application/vnd.quark.quarkxpress":{source:`iana`,extensions:[`qxd`,`qxt`,`qwd`,`qwt`,`qxl`,`qxb`]},"application/vnd.quobject-quoxdocument":{source:`iana`},"application/vnd.radisys.moml+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:`iana`,compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:`iana`,compressible:!0},"application/vnd.rainstor.data":{source:`iana`},"application/vnd.rapid":{source:`iana`},"application/vnd.rar":{source:`iana`,extensions:[`rar`]},"application/vnd.realvnc.bed":{source:`iana`,extensions:[`bed`]},"application/vnd.recordare.musicxml":{source:`iana`,extensions:[`mxl`]},"application/vnd.recordare.musicxml+xml":{source:`iana`,compressible:!0,extensions:[`musicxml`]},"application/vnd.relpipe":{source:`iana`},"application/vnd.renlearn.rlprint":{source:`iana`},"application/vnd.resilient.logic":{source:`iana`},"application/vnd.restful+json":{source:`iana`,compressible:!0},"application/vnd.rig.cryptonote":{source:`iana`,extensions:[`cryptonote`]},"application/vnd.rim.cod":{source:`apache`,extensions:[`cod`]},"application/vnd.rn-realmedia":{source:`apache`,extensions:[`rm`]},"application/vnd.rn-realmedia-vbr":{source:`apache`,extensions:[`rmvb`]},"application/vnd.route66.link66+xml":{source:`iana`,compressible:!0,extensions:[`link66`]},"application/vnd.rs-274x":{source:`iana`},"application/vnd.ruckus.download":{source:`iana`},"application/vnd.s3sms":{source:`iana`},"application/vnd.sailingtracker.track":{source:`iana`,extensions:[`st`]},"application/vnd.sar":{source:`iana`},"application/vnd.sbm.cid":{source:`iana`},"application/vnd.sbm.mid2":{source:`iana`},"application/vnd.scribus":{source:`iana`},"application/vnd.sealed.3df":{source:`iana`},"application/vnd.sealed.csf":{source:`iana`},"application/vnd.sealed.doc":{source:`iana`},"application/vnd.sealed.eml":{source:`iana`},"application/vnd.sealed.mht":{source:`iana`},"application/vnd.sealed.net":{source:`iana`},"application/vnd.sealed.ppt":{source:`iana`},"application/vnd.sealed.tiff":{source:`iana`},"application/vnd.sealed.xls":{source:`iana`},"application/vnd.sealedmedia.softseal.html":{source:`iana`},"application/vnd.sealedmedia.softseal.pdf":{source:`iana`},"application/vnd.seemail":{source:`iana`,extensions:[`see`]},"application/vnd.seis+json":{source:`iana`,compressible:!0},"application/vnd.sema":{source:`iana`,extensions:[`sema`]},"application/vnd.semd":{source:`iana`,extensions:[`semd`]},"application/vnd.semf":{source:`iana`,extensions:[`semf`]},"application/vnd.shade-save-file":{source:`iana`},"application/vnd.shana.informed.formdata":{source:`iana`,extensions:[`ifm`]},"application/vnd.shana.informed.formtemplate":{source:`iana`,extensions:[`itp`]},"application/vnd.shana.informed.interchange":{source:`iana`,extensions:[`iif`]},"application/vnd.shana.informed.package":{source:`iana`,extensions:[`ipk`]},"application/vnd.shootproof+json":{source:`iana`,compressible:!0},"application/vnd.shopkick+json":{source:`iana`,compressible:!0},"application/vnd.shp":{source:`iana`},"application/vnd.shx":{source:`iana`},"application/vnd.sigrok.session":{source:`iana`},"application/vnd.simtech-mindmapper":{source:`iana`,extensions:[`twd`,`twds`]},"application/vnd.siren+json":{source:`iana`,compressible:!0},"application/vnd.sketchometry":{source:`iana`},"application/vnd.smaf":{source:`iana`,extensions:[`mmf`]},"application/vnd.smart.notebook":{source:`iana`},"application/vnd.smart.teacher":{source:`iana`,extensions:[`teacher`]},"application/vnd.smintio.portals.archive":{source:`iana`},"application/vnd.snesdev-page-table":{source:`iana`},"application/vnd.software602.filler.form+xml":{source:`iana`,compressible:!0,extensions:[`fo`]},"application/vnd.software602.filler.form-xml-zip":{source:`iana`},"application/vnd.solent.sdkm+xml":{source:`iana`,compressible:!0,extensions:[`sdkm`,`sdkd`]},"application/vnd.spotfire.dxp":{source:`iana`,extensions:[`dxp`]},"application/vnd.spotfire.sfs":{source:`iana`,extensions:[`sfs`]},"application/vnd.sqlite3":{source:`iana`},"application/vnd.sss-cod":{source:`iana`},"application/vnd.sss-dtf":{source:`iana`},"application/vnd.sss-ntf":{source:`iana`},"application/vnd.stardivision.calc":{source:`apache`,extensions:[`sdc`]},"application/vnd.stardivision.draw":{source:`apache`,extensions:[`sda`]},"application/vnd.stardivision.impress":{source:`apache`,extensions:[`sdd`]},"application/vnd.stardivision.math":{source:`apache`,extensions:[`smf`]},"application/vnd.stardivision.writer":{source:`apache`,extensions:[`sdw`,`vor`]},"application/vnd.stardivision.writer-global":{source:`apache`,extensions:[`sgl`]},"application/vnd.stepmania.package":{source:`iana`,extensions:[`smzip`]},"application/vnd.stepmania.stepchart":{source:`iana`,extensions:[`sm`]},"application/vnd.street-stream":{source:`iana`},"application/vnd.sun.wadl+xml":{source:`iana`,compressible:!0,extensions:[`wadl`]},"application/vnd.sun.xml.calc":{source:`apache`,extensions:[`sxc`]},"application/vnd.sun.xml.calc.template":{source:`apache`,extensions:[`stc`]},"application/vnd.sun.xml.draw":{source:`apache`,extensions:[`sxd`]},"application/vnd.sun.xml.draw.template":{source:`apache`,extensions:[`std`]},"application/vnd.sun.xml.impress":{source:`apache`,extensions:[`sxi`]},"application/vnd.sun.xml.impress.template":{source:`apache`,extensions:[`sti`]},"application/vnd.sun.xml.math":{source:`apache`,extensions:[`sxm`]},"application/vnd.sun.xml.writer":{source:`apache`,extensions:[`sxw`]},"application/vnd.sun.xml.writer.global":{source:`apache`,extensions:[`sxg`]},"application/vnd.sun.xml.writer.template":{source:`apache`,extensions:[`stw`]},"application/vnd.sus-calendar":{source:`iana`,extensions:[`sus`,`susp`]},"application/vnd.svd":{source:`iana`,extensions:[`svd`]},"application/vnd.swiftview-ics":{source:`iana`},"application/vnd.sybyl.mol2":{source:`iana`},"application/vnd.sycle+xml":{source:`iana`,compressible:!0},"application/vnd.syft+json":{source:`iana`,compressible:!0},"application/vnd.symbian.install":{source:`apache`,extensions:[`sis`,`sisx`]},"application/vnd.syncml+xml":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`xsm`]},"application/vnd.syncml.dm+wbxml":{source:`iana`,charset:`UTF-8`,extensions:[`bdm`]},"application/vnd.syncml.dm+xml":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`xdm`]},"application/vnd.syncml.dm.notification":{source:`iana`},"application/vnd.syncml.dmddf+wbxml":{source:`iana`},"application/vnd.syncml.dmddf+xml":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`ddf`]},"application/vnd.syncml.dmtnds+wbxml":{source:`iana`},"application/vnd.syncml.dmtnds+xml":{source:`iana`,charset:`UTF-8`,compressible:!0},"application/vnd.syncml.ds.notification":{source:`iana`},"application/vnd.tableschema+json":{source:`iana`,compressible:!0},"application/vnd.tao.intent-module-archive":{source:`iana`,extensions:[`tao`]},"application/vnd.tcpdump.pcap":{source:`iana`,extensions:[`pcap`,`cap`,`dmp`]},"application/vnd.think-cell.ppttc+json":{source:`iana`,compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:`iana`,compressible:!0},"application/vnd.tml":{source:`iana`},"application/vnd.tmobile-livetv":{source:`iana`,extensions:[`tmo`]},"application/vnd.tri.onesource":{source:`iana`},"application/vnd.trid.tpt":{source:`iana`,extensions:[`tpt`]},"application/vnd.triscape.mxs":{source:`iana`,extensions:[`mxs`]},"application/vnd.trueapp":{source:`iana`,extensions:[`tra`]},"application/vnd.truedoc":{source:`iana`},"application/vnd.ubisoft.webplayer":{source:`iana`},"application/vnd.ufdl":{source:`iana`,extensions:[`ufd`,`ufdl`]},"application/vnd.uic.osdm+json":{source:`iana`,compressible:!0},"application/vnd.uiq.theme":{source:`iana`,extensions:[`utz`]},"application/vnd.umajin":{source:`iana`,extensions:[`umj`]},"application/vnd.unity":{source:`iana`,extensions:[`unityweb`]},"application/vnd.uoml+xml":{source:`iana`,compressible:!0,extensions:[`uoml`,`uo`]},"application/vnd.uplanet.alert":{source:`iana`},"application/vnd.uplanet.alert-wbxml":{source:`iana`},"application/vnd.uplanet.bearer-choice":{source:`iana`},"application/vnd.uplanet.bearer-choice-wbxml":{source:`iana`},"application/vnd.uplanet.cacheop":{source:`iana`},"application/vnd.uplanet.cacheop-wbxml":{source:`iana`},"application/vnd.uplanet.channel":{source:`iana`},"application/vnd.uplanet.channel-wbxml":{source:`iana`},"application/vnd.uplanet.list":{source:`iana`},"application/vnd.uplanet.list-wbxml":{source:`iana`},"application/vnd.uplanet.listcmd":{source:`iana`},"application/vnd.uplanet.listcmd-wbxml":{source:`iana`},"application/vnd.uplanet.signal":{source:`iana`},"application/vnd.uri-map":{source:`iana`},"application/vnd.valve.source.material":{source:`iana`},"application/vnd.vcx":{source:`iana`,extensions:[`vcx`]},"application/vnd.vd-study":{source:`iana`},"application/vnd.vectorworks":{source:`iana`},"application/vnd.vel+json":{source:`iana`,compressible:!0},"application/vnd.veraison.tsm-report+cbor":{source:`iana`},"application/vnd.veraison.tsm-report+json":{source:`iana`,compressible:!0},"application/vnd.verimatrix.vcas":{source:`iana`},"application/vnd.veritone.aion+json":{source:`iana`,compressible:!0},"application/vnd.veryant.thin":{source:`iana`},"application/vnd.ves.encrypted":{source:`iana`},"application/vnd.vidsoft.vidconference":{source:`iana`},"application/vnd.visio":{source:`iana`,extensions:[`vsd`,`vst`,`vss`,`vsw`,`vsdx`,`vtx`]},"application/vnd.visionary":{source:`iana`,extensions:[`vis`]},"application/vnd.vividence.scriptfile":{source:`iana`},"application/vnd.vocalshaper.vsp4":{source:`iana`},"application/vnd.vsf":{source:`iana`,extensions:[`vsf`]},"application/vnd.wap.sic":{source:`iana`},"application/vnd.wap.slc":{source:`iana`},"application/vnd.wap.wbxml":{source:`iana`,charset:`UTF-8`,extensions:[`wbxml`]},"application/vnd.wap.wmlc":{source:`iana`,extensions:[`wmlc`]},"application/vnd.wap.wmlscriptc":{source:`iana`,extensions:[`wmlsc`]},"application/vnd.wasmflow.wafl":{source:`iana`},"application/vnd.webturbo":{source:`iana`,extensions:[`wtb`]},"application/vnd.wfa.dpp":{source:`iana`},"application/vnd.wfa.p2p":{source:`iana`},"application/vnd.wfa.wsc":{source:`iana`},"application/vnd.windows.devicepairing":{source:`iana`},"application/vnd.wmc":{source:`iana`},"application/vnd.wmf.bootstrap":{source:`iana`},"application/vnd.wolfram.mathematica":{source:`iana`},"application/vnd.wolfram.mathematica.package":{source:`iana`},"application/vnd.wolfram.player":{source:`iana`,extensions:[`nbp`]},"application/vnd.wordlift":{source:`iana`},"application/vnd.wordperfect":{source:`iana`,extensions:[`wpd`]},"application/vnd.wqd":{source:`iana`,extensions:[`wqd`]},"application/vnd.wrq-hp3000-labelled":{source:`iana`},"application/vnd.wt.stf":{source:`iana`,extensions:[`stf`]},"application/vnd.wv.csp+wbxml":{source:`iana`},"application/vnd.wv.csp+xml":{source:`iana`,compressible:!0},"application/vnd.wv.ssp+xml":{source:`iana`,compressible:!0},"application/vnd.xacml+json":{source:`iana`,compressible:!0},"application/vnd.xara":{source:`iana`,extensions:[`xar`]},"application/vnd.xarin.cpj":{source:`iana`},"application/vnd.xecrets-encrypted":{source:`iana`},"application/vnd.xfdl":{source:`iana`,extensions:[`xfdl`]},"application/vnd.xfdl.webform":{source:`iana`},"application/vnd.xmi+xml":{source:`iana`,compressible:!0},"application/vnd.xmpie.cpkg":{source:`iana`},"application/vnd.xmpie.dpkg":{source:`iana`},"application/vnd.xmpie.plan":{source:`iana`},"application/vnd.xmpie.ppkg":{source:`iana`},"application/vnd.xmpie.xlim":{source:`iana`},"application/vnd.yamaha.hv-dic":{source:`iana`,extensions:[`hvd`]},"application/vnd.yamaha.hv-script":{source:`iana`,extensions:[`hvs`]},"application/vnd.yamaha.hv-voice":{source:`iana`,extensions:[`hvp`]},"application/vnd.yamaha.openscoreformat":{source:`iana`,extensions:[`osf`]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:`iana`,compressible:!0,extensions:[`osfpvg`]},"application/vnd.yamaha.remote-setup":{source:`iana`},"application/vnd.yamaha.smaf-audio":{source:`iana`,extensions:[`saf`]},"application/vnd.yamaha.smaf-phrase":{source:`iana`,extensions:[`spf`]},"application/vnd.yamaha.through-ngn":{source:`iana`},"application/vnd.yamaha.tunnel-udpencap":{source:`iana`},"application/vnd.yaoweme":{source:`iana`},"application/vnd.yellowriver-custom-menu":{source:`iana`,extensions:[`cmp`]},"application/vnd.zul":{source:`iana`,extensions:[`zir`,`zirz`]},"application/vnd.zzazz.deck+xml":{source:`iana`,compressible:!0,extensions:[`zaz`]},"application/voicexml+xml":{source:`iana`,compressible:!0,extensions:[`vxml`]},"application/voucher-cms+json":{source:`iana`,compressible:!0},"application/voucher-jws+json":{source:`iana`,compressible:!0},"application/vp":{source:`iana`},"application/vp+cose":{source:`iana`},"application/vp+jwt":{source:`iana`},"application/vq-rtcpxr":{source:`iana`},"application/wasm":{source:`iana`,compressible:!0,extensions:[`wasm`]},"application/watcherinfo+xml":{source:`iana`,compressible:!0,extensions:[`wif`]},"application/webpush-options+json":{source:`iana`,compressible:!0},"application/whoispp-query":{source:`iana`},"application/whoispp-response":{source:`iana`},"application/widget":{source:`iana`,extensions:[`wgt`]},"application/winhlp":{source:`apache`,extensions:[`hlp`]},"application/wita":{source:`iana`},"application/wordperfect5.1":{source:`iana`},"application/wsdl+xml":{source:`iana`,compressible:!0,extensions:[`wsdl`]},"application/wspolicy+xml":{source:`iana`,compressible:!0,extensions:[`wspolicy`]},"application/x-7z-compressed":{source:`apache`,compressible:!1,extensions:[`7z`]},"application/x-abiword":{source:`apache`,extensions:[`abw`]},"application/x-ace-compressed":{source:`apache`,extensions:[`ace`]},"application/x-amf":{source:`apache`},"application/x-apple-diskimage":{source:`apache`,extensions:[`dmg`]},"application/x-arj":{compressible:!1,extensions:[`arj`]},"application/x-authorware-bin":{source:`apache`,extensions:[`aab`,`x32`,`u32`,`vox`]},"application/x-authorware-map":{source:`apache`,extensions:[`aam`]},"application/x-authorware-seg":{source:`apache`,extensions:[`aas`]},"application/x-bcpio":{source:`apache`,extensions:[`bcpio`]},"application/x-bdoc":{compressible:!1,extensions:[`bdoc`]},"application/x-bittorrent":{source:`apache`,extensions:[`torrent`]},"application/x-blender":{extensions:[`blend`]},"application/x-blorb":{source:`apache`,extensions:[`blb`,`blorb`]},"application/x-bzip":{source:`apache`,compressible:!1,extensions:[`bz`]},"application/x-bzip2":{source:`apache`,compressible:!1,extensions:[`bz2`,`boz`]},"application/x-cbr":{source:`apache`,extensions:[`cbr`,`cba`,`cbt`,`cbz`,`cb7`]},"application/x-cdlink":{source:`apache`,extensions:[`vcd`]},"application/x-cfs-compressed":{source:`apache`,extensions:[`cfs`]},"application/x-chat":{source:`apache`,extensions:[`chat`]},"application/x-chess-pgn":{source:`apache`,extensions:[`pgn`]},"application/x-chrome-extension":{extensions:[`crx`]},"application/x-cocoa":{source:`nginx`,extensions:[`cco`]},"application/x-compress":{source:`apache`},"application/x-compressed":{extensions:[`rar`]},"application/x-conference":{source:`apache`,extensions:[`nsc`]},"application/x-cpio":{source:`apache`,extensions:[`cpio`]},"application/x-csh":{source:`apache`,extensions:[`csh`]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:`apache`,extensions:[`deb`,`udeb`]},"application/x-dgc-compressed":{source:`apache`,extensions:[`dgc`]},"application/x-director":{source:`apache`,extensions:[`dir`,`dcr`,`dxr`,`cst`,`cct`,`cxt`,`w3d`,`fgd`,`swa`]},"application/x-doom":{source:`apache`,extensions:[`wad`]},"application/x-dtbncx+xml":{source:`apache`,compressible:!0,extensions:[`ncx`]},"application/x-dtbook+xml":{source:`apache`,compressible:!0,extensions:[`dtb`]},"application/x-dtbresource+xml":{source:`apache`,compressible:!0,extensions:[`res`]},"application/x-dvi":{source:`apache`,compressible:!1,extensions:[`dvi`]},"application/x-envoy":{source:`apache`,extensions:[`evy`]},"application/x-eva":{source:`apache`,extensions:[`eva`]},"application/x-font-bdf":{source:`apache`,extensions:[`bdf`]},"application/x-font-dos":{source:`apache`},"application/x-font-framemaker":{source:`apache`},"application/x-font-ghostscript":{source:`apache`,extensions:[`gsf`]},"application/x-font-libgrx":{source:`apache`},"application/x-font-linux-psf":{source:`apache`,extensions:[`psf`]},"application/x-font-pcf":{source:`apache`,extensions:[`pcf`]},"application/x-font-snf":{source:`apache`,extensions:[`snf`]},"application/x-font-speedo":{source:`apache`},"application/x-font-sunos-news":{source:`apache`},"application/x-font-type1":{source:`apache`,extensions:[`pfa`,`pfb`,`pfm`,`afm`]},"application/x-font-vfont":{source:`apache`},"application/x-freearc":{source:`apache`,extensions:[`arc`]},"application/x-futuresplash":{source:`apache`,extensions:[`spl`]},"application/x-gca-compressed":{source:`apache`,extensions:[`gca`]},"application/x-glulx":{source:`apache`,extensions:[`ulx`]},"application/x-gnumeric":{source:`apache`,extensions:[`gnumeric`]},"application/x-gramps-xml":{source:`apache`,extensions:[`gramps`]},"application/x-gtar":{source:`apache`,extensions:[`gtar`]},"application/x-gzip":{source:`apache`},"application/x-hdf":{source:`apache`,extensions:[`hdf`]},"application/x-httpd-php":{compressible:!0,extensions:[`php`]},"application/x-install-instructions":{source:`apache`,extensions:[`install`]},"application/x-ipynb+json":{compressible:!0,extensions:[`ipynb`]},"application/x-iso9660-image":{source:`apache`,extensions:[`iso`]},"application/x-iwork-keynote-sffkey":{extensions:[`key`]},"application/x-iwork-numbers-sffnumbers":{extensions:[`numbers`]},"application/x-iwork-pages-sffpages":{extensions:[`pages`]},"application/x-java-archive-diff":{source:`nginx`,extensions:[`jardiff`]},"application/x-java-jnlp-file":{source:`apache`,compressible:!1,extensions:[`jnlp`]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:[`kdbx`]},"application/x-latex":{source:`apache`,compressible:!1,extensions:[`latex`]},"application/x-lua-bytecode":{extensions:[`luac`]},"application/x-lzh-compressed":{source:`apache`,extensions:[`lzh`,`lha`]},"application/x-makeself":{source:`nginx`,extensions:[`run`]},"application/x-mie":{source:`apache`,extensions:[`mie`]},"application/x-mobipocket-ebook":{source:`apache`,extensions:[`prc`,`mobi`]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:`apache`,extensions:[`application`]},"application/x-ms-shortcut":{source:`apache`,extensions:[`lnk`]},"application/x-ms-wmd":{source:`apache`,extensions:[`wmd`]},"application/x-ms-wmz":{source:`apache`,extensions:[`wmz`]},"application/x-ms-xbap":{source:`apache`,extensions:[`xbap`]},"application/x-msaccess":{source:`apache`,extensions:[`mdb`]},"application/x-msbinder":{source:`apache`,extensions:[`obd`]},"application/x-mscardfile":{source:`apache`,extensions:[`crd`]},"application/x-msclip":{source:`apache`,extensions:[`clp`]},"application/x-msdos-program":{extensions:[`exe`]},"application/x-msdownload":{source:`apache`,extensions:[`exe`,`dll`,`com`,`bat`,`msi`]},"application/x-msmediaview":{source:`apache`,extensions:[`mvb`,`m13`,`m14`]},"application/x-msmetafile":{source:`apache`,extensions:[`wmf`,`wmz`,`emf`,`emz`]},"application/x-msmoney":{source:`apache`,extensions:[`mny`]},"application/x-mspublisher":{source:`apache`,extensions:[`pub`]},"application/x-msschedule":{source:`apache`,extensions:[`scd`]},"application/x-msterminal":{source:`apache`,extensions:[`trm`]},"application/x-mswrite":{source:`apache`,extensions:[`wri`]},"application/x-netcdf":{source:`apache`,extensions:[`nc`,`cdf`]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:[`pac`]},"application/x-nzb":{source:`apache`,extensions:[`nzb`]},"application/x-perl":{source:`nginx`,extensions:[`pl`,`pm`]},"application/x-pilot":{source:`nginx`,extensions:[`prc`,`pdb`]},"application/x-pkcs12":{source:`apache`,compressible:!1,extensions:[`p12`,`pfx`]},"application/x-pkcs7-certificates":{source:`apache`,extensions:[`p7b`,`spc`]},"application/x-pkcs7-certreqresp":{source:`apache`,extensions:[`p7r`]},"application/x-pki-message":{source:`iana`},"application/x-rar-compressed":{source:`apache`,compressible:!1,extensions:[`rar`]},"application/x-redhat-package-manager":{source:`nginx`,extensions:[`rpm`]},"application/x-research-info-systems":{source:`apache`,extensions:[`ris`]},"application/x-sea":{source:`nginx`,extensions:[`sea`]},"application/x-sh":{source:`apache`,compressible:!0,extensions:[`sh`]},"application/x-shar":{source:`apache`,extensions:[`shar`]},"application/x-shockwave-flash":{source:`apache`,compressible:!1,extensions:[`swf`]},"application/x-silverlight-app":{source:`apache`,extensions:[`xap`]},"application/x-sql":{source:`apache`,extensions:[`sql`]},"application/x-stuffit":{source:`apache`,compressible:!1,extensions:[`sit`]},"application/x-stuffitx":{source:`apache`,extensions:[`sitx`]},"application/x-subrip":{source:`apache`,extensions:[`srt`]},"application/x-sv4cpio":{source:`apache`,extensions:[`sv4cpio`]},"application/x-sv4crc":{source:`apache`,extensions:[`sv4crc`]},"application/x-t3vm-image":{source:`apache`,extensions:[`t3`]},"application/x-tads":{source:`apache`,extensions:[`gam`]},"application/x-tar":{source:`apache`,compressible:!0,extensions:[`tar`]},"application/x-tcl":{source:`apache`,extensions:[`tcl`,`tk`]},"application/x-tex":{source:`apache`,extensions:[`tex`]},"application/x-tex-tfm":{source:`apache`,extensions:[`tfm`]},"application/x-texinfo":{source:`apache`,extensions:[`texinfo`,`texi`]},"application/x-tgif":{source:`apache`,extensions:[`obj`]},"application/x-ustar":{source:`apache`,extensions:[`ustar`]},"application/x-virtualbox-hdd":{compressible:!0,extensions:[`hdd`]},"application/x-virtualbox-ova":{compressible:!0,extensions:[`ova`]},"application/x-virtualbox-ovf":{compressible:!0,extensions:[`ovf`]},"application/x-virtualbox-vbox":{compressible:!0,extensions:[`vbox`]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:[`vbox-extpack`]},"application/x-virtualbox-vdi":{compressible:!0,extensions:[`vdi`]},"application/x-virtualbox-vhd":{compressible:!0,extensions:[`vhd`]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:[`vmdk`]},"application/x-wais-source":{source:`apache`,extensions:[`src`]},"application/x-web-app-manifest+json":{compressible:!0,extensions:[`webapp`]},"application/x-www-form-urlencoded":{source:`iana`,compressible:!0},"application/x-x509-ca-cert":{source:`iana`,extensions:[`der`,`crt`,`pem`]},"application/x-x509-ca-ra-cert":{source:`iana`},"application/x-x509-next-ca-cert":{source:`iana`},"application/x-xfig":{source:`apache`,extensions:[`fig`]},"application/x-xliff+xml":{source:`apache`,compressible:!0,extensions:[`xlf`]},"application/x-xpinstall":{source:`apache`,compressible:!1,extensions:[`xpi`]},"application/x-xz":{source:`apache`,extensions:[`xz`]},"application/x-zip-compressed":{extensions:[`zip`]},"application/x-zmachine":{source:`apache`,extensions:[`z1`,`z2`,`z3`,`z4`,`z5`,`z6`,`z7`,`z8`]},"application/x400-bp":{source:`iana`},"application/xacml+xml":{source:`iana`,compressible:!0},"application/xaml+xml":{source:`apache`,compressible:!0,extensions:[`xaml`]},"application/xcap-att+xml":{source:`iana`,compressible:!0,extensions:[`xav`]},"application/xcap-caps+xml":{source:`iana`,compressible:!0,extensions:[`xca`]},"application/xcap-diff+xml":{source:`iana`,compressible:!0,extensions:[`xdf`]},"application/xcap-el+xml":{source:`iana`,compressible:!0,extensions:[`xel`]},"application/xcap-error+xml":{source:`iana`,compressible:!0},"application/xcap-ns+xml":{source:`iana`,compressible:!0,extensions:[`xns`]},"application/xcon-conference-info+xml":{source:`iana`,compressible:!0},"application/xcon-conference-info-diff+xml":{source:`iana`,compressible:!0},"application/xenc+xml":{source:`iana`,compressible:!0,extensions:[`xenc`]},"application/xfdf":{source:`iana`,extensions:[`xfdf`]},"application/xhtml+xml":{source:`iana`,compressible:!0,extensions:[`xhtml`,`xht`]},"application/xhtml-voice+xml":{source:`apache`,compressible:!0},"application/xliff+xml":{source:`iana`,compressible:!0,extensions:[`xlf`]},"application/xml":{source:`iana`,compressible:!0,extensions:[`xml`,`xsl`,`xsd`,`rng`]},"application/xml-dtd":{source:`iana`,compressible:!0,extensions:[`dtd`]},"application/xml-external-parsed-entity":{source:`iana`},"application/xml-patch+xml":{source:`iana`,compressible:!0},"application/xmpp+xml":{source:`iana`,compressible:!0},"application/xop+xml":{source:`iana`,compressible:!0,extensions:[`xop`]},"application/xproc+xml":{source:`apache`,compressible:!0,extensions:[`xpl`]},"application/xslt+xml":{source:`iana`,compressible:!0,extensions:[`xsl`,`xslt`]},"application/xspf+xml":{source:`apache`,compressible:!0,extensions:[`xspf`]},"application/xv+xml":{source:`iana`,compressible:!0,extensions:[`mxml`,`xhvml`,`xvml`,`xvm`]},"application/yaml":{source:`iana`},"application/yang":{source:`iana`,extensions:[`yang`]},"application/yang-data+cbor":{source:`iana`},"application/yang-data+json":{source:`iana`,compressible:!0},"application/yang-data+xml":{source:`iana`,compressible:!0},"application/yang-patch+json":{source:`iana`,compressible:!0},"application/yang-patch+xml":{source:`iana`,compressible:!0},"application/yang-sid+json":{source:`iana`,compressible:!0},"application/yin+xml":{source:`iana`,compressible:!0,extensions:[`yin`]},"application/zip":{source:`iana`,compressible:!1,extensions:[`zip`]},"application/zip+dotlottie":{extensions:[`lottie`]},"application/zlib":{source:`iana`},"application/zstd":{source:`iana`},"audio/1d-interleaved-parityfec":{source:`iana`},"audio/32kadpcm":{source:`iana`},"audio/3gpp":{source:`iana`,compressible:!1,extensions:[`3gpp`]},"audio/3gpp2":{source:`iana`},"audio/aac":{source:`iana`,extensions:[`adts`,`aac`]},"audio/ac3":{source:`iana`},"audio/adpcm":{source:`apache`,extensions:[`adp`]},"audio/amr":{source:`iana`,extensions:[`amr`]},"audio/amr-wb":{source:`iana`},"audio/amr-wb+":{source:`iana`},"audio/aptx":{source:`iana`},"audio/asc":{source:`iana`},"audio/atrac-advanced-lossless":{source:`iana`},"audio/atrac-x":{source:`iana`},"audio/atrac3":{source:`iana`},"audio/basic":{source:`iana`,compressible:!1,extensions:[`au`,`snd`]},"audio/bv16":{source:`iana`},"audio/bv32":{source:`iana`},"audio/clearmode":{source:`iana`},"audio/cn":{source:`iana`},"audio/dat12":{source:`iana`},"audio/dls":{source:`iana`},"audio/dsr-es201108":{source:`iana`},"audio/dsr-es202050":{source:`iana`},"audio/dsr-es202211":{source:`iana`},"audio/dsr-es202212":{source:`iana`},"audio/dv":{source:`iana`},"audio/dvi4":{source:`iana`},"audio/eac3":{source:`iana`},"audio/encaprtp":{source:`iana`},"audio/evrc":{source:`iana`},"audio/evrc-qcp":{source:`iana`},"audio/evrc0":{source:`iana`},"audio/evrc1":{source:`iana`},"audio/evrcb":{source:`iana`},"audio/evrcb0":{source:`iana`},"audio/evrcb1":{source:`iana`},"audio/evrcnw":{source:`iana`},"audio/evrcnw0":{source:`iana`},"audio/evrcnw1":{source:`iana`},"audio/evrcwb":{source:`iana`},"audio/evrcwb0":{source:`iana`},"audio/evrcwb1":{source:`iana`},"audio/evs":{source:`iana`},"audio/flac":{source:`iana`},"audio/flexfec":{source:`iana`},"audio/fwdred":{source:`iana`},"audio/g711-0":{source:`iana`},"audio/g719":{source:`iana`},"audio/g722":{source:`iana`},"audio/g7221":{source:`iana`},"audio/g723":{source:`iana`},"audio/g726-16":{source:`iana`},"audio/g726-24":{source:`iana`},"audio/g726-32":{source:`iana`},"audio/g726-40":{source:`iana`},"audio/g728":{source:`iana`},"audio/g729":{source:`iana`},"audio/g7291":{source:`iana`},"audio/g729d":{source:`iana`},"audio/g729e":{source:`iana`},"audio/gsm":{source:`iana`},"audio/gsm-efr":{source:`iana`},"audio/gsm-hr-08":{source:`iana`},"audio/ilbc":{source:`iana`},"audio/ip-mr_v2.5":{source:`iana`},"audio/isac":{source:`apache`},"audio/l16":{source:`iana`},"audio/l20":{source:`iana`},"audio/l24":{source:`iana`,compressible:!1},"audio/l8":{source:`iana`},"audio/lpc":{source:`iana`},"audio/matroska":{source:`iana`},"audio/melp":{source:`iana`},"audio/melp1200":{source:`iana`},"audio/melp2400":{source:`iana`},"audio/melp600":{source:`iana`},"audio/mhas":{source:`iana`},"audio/midi":{source:`apache`,extensions:[`mid`,`midi`,`kar`,`rmi`]},"audio/midi-clip":{source:`iana`},"audio/mobile-xmf":{source:`iana`,extensions:[`mxmf`]},"audio/mp3":{compressible:!1,extensions:[`mp3`]},"audio/mp4":{source:`iana`,compressible:!1,extensions:[`m4a`,`mp4a`,`m4b`]},"audio/mp4a-latm":{source:`iana`},"audio/mpa":{source:`iana`},"audio/mpa-robust":{source:`iana`},"audio/mpeg":{source:`iana`,compressible:!1,extensions:[`mpga`,`mp2`,`mp2a`,`mp3`,`m2a`,`m3a`]},"audio/mpeg4-generic":{source:`iana`},"audio/musepack":{source:`apache`},"audio/ogg":{source:`iana`,compressible:!1,extensions:[`oga`,`ogg`,`spx`,`opus`]},"audio/opus":{source:`iana`},"audio/parityfec":{source:`iana`},"audio/pcma":{source:`iana`},"audio/pcma-wb":{source:`iana`},"audio/pcmu":{source:`iana`},"audio/pcmu-wb":{source:`iana`},"audio/prs.sid":{source:`iana`},"audio/qcelp":{source:`iana`},"audio/raptorfec":{source:`iana`},"audio/red":{source:`iana`},"audio/rtp-enc-aescm128":{source:`iana`},"audio/rtp-midi":{source:`iana`},"audio/rtploopback":{source:`iana`},"audio/rtx":{source:`iana`},"audio/s3m":{source:`apache`,extensions:[`s3m`]},"audio/scip":{source:`iana`},"audio/silk":{source:`apache`,extensions:[`sil`]},"audio/smv":{source:`iana`},"audio/smv-qcp":{source:`iana`},"audio/smv0":{source:`iana`},"audio/sofa":{source:`iana`},"audio/sp-midi":{source:`iana`},"audio/speex":{source:`iana`},"audio/t140c":{source:`iana`},"audio/t38":{source:`iana`},"audio/telephone-event":{source:`iana`},"audio/tetra_acelp":{source:`iana`},"audio/tetra_acelp_bb":{source:`iana`},"audio/tone":{source:`iana`},"audio/tsvcis":{source:`iana`},"audio/uemclip":{source:`iana`},"audio/ulpfec":{source:`iana`},"audio/usac":{source:`iana`},"audio/vdvi":{source:`iana`},"audio/vmr-wb":{source:`iana`},"audio/vnd.3gpp.iufp":{source:`iana`},"audio/vnd.4sb":{source:`iana`},"audio/vnd.audiokoz":{source:`iana`},"audio/vnd.celp":{source:`iana`},"audio/vnd.cisco.nse":{source:`iana`},"audio/vnd.cmles.radio-events":{source:`iana`},"audio/vnd.cns.anp1":{source:`iana`},"audio/vnd.cns.inf1":{source:`iana`},"audio/vnd.dece.audio":{source:`iana`,extensions:[`uva`,`uvva`]},"audio/vnd.digital-winds":{source:`iana`,extensions:[`eol`]},"audio/vnd.dlna.adts":{source:`iana`},"audio/vnd.dolby.heaac.1":{source:`iana`},"audio/vnd.dolby.heaac.2":{source:`iana`},"audio/vnd.dolby.mlp":{source:`iana`},"audio/vnd.dolby.mps":{source:`iana`},"audio/vnd.dolby.pl2":{source:`iana`},"audio/vnd.dolby.pl2x":{source:`iana`},"audio/vnd.dolby.pl2z":{source:`iana`},"audio/vnd.dolby.pulse.1":{source:`iana`},"audio/vnd.dra":{source:`iana`,extensions:[`dra`]},"audio/vnd.dts":{source:`iana`,extensions:[`dts`]},"audio/vnd.dts.hd":{source:`iana`,extensions:[`dtshd`]},"audio/vnd.dts.uhd":{source:`iana`},"audio/vnd.dvb.file":{source:`iana`},"audio/vnd.everad.plj":{source:`iana`},"audio/vnd.hns.audio":{source:`iana`},"audio/vnd.lucent.voice":{source:`iana`,extensions:[`lvp`]},"audio/vnd.ms-playready.media.pya":{source:`iana`,extensions:[`pya`]},"audio/vnd.nokia.mobile-xmf":{source:`iana`},"audio/vnd.nortel.vbk":{source:`iana`},"audio/vnd.nuera.ecelp4800":{source:`iana`,extensions:[`ecelp4800`]},"audio/vnd.nuera.ecelp7470":{source:`iana`,extensions:[`ecelp7470`]},"audio/vnd.nuera.ecelp9600":{source:`iana`,extensions:[`ecelp9600`]},"audio/vnd.octel.sbc":{source:`iana`},"audio/vnd.presonus.multitrack":{source:`iana`},"audio/vnd.qcelp":{source:`apache`},"audio/vnd.rhetorex.32kadpcm":{source:`iana`},"audio/vnd.rip":{source:`iana`,extensions:[`rip`]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:`iana`},"audio/vnd.vmx.cvsd":{source:`iana`},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:`iana`,compressible:!1},"audio/vorbis-config":{source:`iana`},"audio/wav":{compressible:!1,extensions:[`wav`]},"audio/wave":{compressible:!1,extensions:[`wav`]},"audio/webm":{source:`apache`,compressible:!1,extensions:[`weba`]},"audio/x-aac":{source:`apache`,compressible:!1,extensions:[`aac`]},"audio/x-aiff":{source:`apache`,extensions:[`aif`,`aiff`,`aifc`]},"audio/x-caf":{source:`apache`,compressible:!1,extensions:[`caf`]},"audio/x-flac":{source:`apache`,extensions:[`flac`]},"audio/x-m4a":{source:`nginx`,extensions:[`m4a`]},"audio/x-matroska":{source:`apache`,extensions:[`mka`]},"audio/x-mpegurl":{source:`apache`,extensions:[`m3u`]},"audio/x-ms-wax":{source:`apache`,extensions:[`wax`]},"audio/x-ms-wma":{source:`apache`,extensions:[`wma`]},"audio/x-pn-realaudio":{source:`apache`,extensions:[`ram`,`ra`]},"audio/x-pn-realaudio-plugin":{source:`apache`,extensions:[`rmp`]},"audio/x-realaudio":{source:`nginx`,extensions:[`ra`]},"audio/x-tta":{source:`apache`},"audio/x-wav":{source:`apache`,extensions:[`wav`]},"audio/xm":{source:`apache`,extensions:[`xm`]},"chemical/x-cdx":{source:`apache`,extensions:[`cdx`]},"chemical/x-cif":{source:`apache`,extensions:[`cif`]},"chemical/x-cmdf":{source:`apache`,extensions:[`cmdf`]},"chemical/x-cml":{source:`apache`,extensions:[`cml`]},"chemical/x-csml":{source:`apache`,extensions:[`csml`]},"chemical/x-pdb":{source:`apache`},"chemical/x-xyz":{source:`apache`,extensions:[`xyz`]},"font/collection":{source:`iana`,extensions:[`ttc`]},"font/otf":{source:`iana`,compressible:!0,extensions:[`otf`]},"font/sfnt":{source:`iana`},"font/ttf":{source:`iana`,compressible:!0,extensions:[`ttf`]},"font/woff":{source:`iana`,extensions:[`woff`]},"font/woff2":{source:`iana`,extensions:[`woff2`]},"image/aces":{source:`iana`,extensions:[`exr`]},"image/apng":{source:`iana`,compressible:!1,extensions:[`apng`]},"image/avci":{source:`iana`,extensions:[`avci`]},"image/avcs":{source:`iana`,extensions:[`avcs`]},"image/avif":{source:`iana`,compressible:!1,extensions:[`avif`]},"image/bmp":{source:`iana`,compressible:!0,extensions:[`bmp`,`dib`]},"image/cgm":{source:`iana`,extensions:[`cgm`]},"image/dicom-rle":{source:`iana`,extensions:[`drle`]},"image/dpx":{source:`iana`,extensions:[`dpx`]},"image/emf":{source:`iana`,extensions:[`emf`]},"image/fits":{source:`iana`,extensions:[`fits`]},"image/g3fax":{source:`iana`,extensions:[`g3`]},"image/gif":{source:`iana`,compressible:!1,extensions:[`gif`]},"image/heic":{source:`iana`,extensions:[`heic`]},"image/heic-sequence":{source:`iana`,extensions:[`heics`]},"image/heif":{source:`iana`,extensions:[`heif`]},"image/heif-sequence":{source:`iana`,extensions:[`heifs`]},"image/hej2k":{source:`iana`,extensions:[`hej2`]},"image/ief":{source:`iana`,extensions:[`ief`]},"image/j2c":{source:`iana`},"image/jaii":{source:`iana`,extensions:[`jaii`]},"image/jais":{source:`iana`,extensions:[`jais`]},"image/jls":{source:`iana`,extensions:[`jls`]},"image/jp2":{source:`iana`,compressible:!1,extensions:[`jp2`,`jpg2`]},"image/jpeg":{source:`iana`,compressible:!1,extensions:[`jpg`,`jpeg`,`jpe`]},"image/jph":{source:`iana`,extensions:[`jph`]},"image/jphc":{source:`iana`,extensions:[`jhc`]},"image/jpm":{source:`iana`,compressible:!1,extensions:[`jpm`,`jpgm`]},"image/jpx":{source:`iana`,compressible:!1,extensions:[`jpx`,`jpf`]},"image/jxl":{source:`iana`,extensions:[`jxl`]},"image/jxr":{source:`iana`,extensions:[`jxr`]},"image/jxra":{source:`iana`,extensions:[`jxra`]},"image/jxrs":{source:`iana`,extensions:[`jxrs`]},"image/jxs":{source:`iana`,extensions:[`jxs`]},"image/jxsc":{source:`iana`,extensions:[`jxsc`]},"image/jxsi":{source:`iana`,extensions:[`jxsi`]},"image/jxss":{source:`iana`,extensions:[`jxss`]},"image/ktx":{source:`iana`,extensions:[`ktx`]},"image/ktx2":{source:`iana`,extensions:[`ktx2`]},"image/naplps":{source:`iana`},"image/pjpeg":{compressible:!1,extensions:[`jfif`]},"image/png":{source:`iana`,compressible:!1,extensions:[`png`]},"image/prs.btif":{source:`iana`,extensions:[`btif`,`btf`]},"image/prs.pti":{source:`iana`,extensions:[`pti`]},"image/pwg-raster":{source:`iana`},"image/sgi":{source:`apache`,extensions:[`sgi`]},"image/svg+xml":{source:`iana`,compressible:!0,extensions:[`svg`,`svgz`]},"image/t38":{source:`iana`,extensions:[`t38`]},"image/tiff":{source:`iana`,compressible:!1,extensions:[`tif`,`tiff`]},"image/tiff-fx":{source:`iana`,extensions:[`tfx`]},"image/vnd.adobe.photoshop":{source:`iana`,compressible:!0,extensions:[`psd`]},"image/vnd.airzip.accelerator.azv":{source:`iana`,extensions:[`azv`]},"image/vnd.clip":{source:`iana`},"image/vnd.cns.inf2":{source:`iana`},"image/vnd.dece.graphic":{source:`iana`,extensions:[`uvi`,`uvvi`,`uvg`,`uvvg`]},"image/vnd.djvu":{source:`iana`,extensions:[`djvu`,`djv`]},"image/vnd.dvb.subtitle":{source:`iana`,extensions:[`sub`]},"image/vnd.dwg":{source:`iana`,extensions:[`dwg`]},"image/vnd.dxf":{source:`iana`,extensions:[`dxf`]},"image/vnd.fastbidsheet":{source:`iana`,extensions:[`fbs`]},"image/vnd.fpx":{source:`iana`,extensions:[`fpx`]},"image/vnd.fst":{source:`iana`,extensions:[`fst`]},"image/vnd.fujixerox.edmics-mmr":{source:`iana`,extensions:[`mmr`]},"image/vnd.fujixerox.edmics-rlc":{source:`iana`,extensions:[`rlc`]},"image/vnd.globalgraphics.pgb":{source:`iana`},"image/vnd.microsoft.icon":{source:`iana`,compressible:!0,extensions:[`ico`]},"image/vnd.mix":{source:`iana`},"image/vnd.mozilla.apng":{source:`iana`},"image/vnd.ms-dds":{compressible:!0,extensions:[`dds`]},"image/vnd.ms-modi":{source:`iana`,extensions:[`mdi`]},"image/vnd.ms-photo":{source:`apache`,extensions:[`wdp`]},"image/vnd.net-fpx":{source:`iana`,extensions:[`npx`]},"image/vnd.pco.b16":{source:`iana`,extensions:[`b16`]},"image/vnd.radiance":{source:`iana`},"image/vnd.sealed.png":{source:`iana`},"image/vnd.sealedmedia.softseal.gif":{source:`iana`},"image/vnd.sealedmedia.softseal.jpg":{source:`iana`},"image/vnd.svf":{source:`iana`},"image/vnd.tencent.tap":{source:`iana`,extensions:[`tap`]},"image/vnd.valve.source.texture":{source:`iana`,extensions:[`vtf`]},"image/vnd.wap.wbmp":{source:`iana`,extensions:[`wbmp`]},"image/vnd.xiff":{source:`iana`,extensions:[`xif`]},"image/vnd.zbrush.pcx":{source:`iana`,extensions:[`pcx`]},"image/webp":{source:`iana`,extensions:[`webp`]},"image/wmf":{source:`iana`,extensions:[`wmf`]},"image/x-3ds":{source:`apache`,extensions:[`3ds`]},"image/x-adobe-dng":{extensions:[`dng`]},"image/x-cmu-raster":{source:`apache`,extensions:[`ras`]},"image/x-cmx":{source:`apache`,extensions:[`cmx`]},"image/x-emf":{source:`iana`},"image/x-freehand":{source:`apache`,extensions:[`fh`,`fhc`,`fh4`,`fh5`,`fh7`]},"image/x-icon":{source:`apache`,compressible:!0,extensions:[`ico`]},"image/x-jng":{source:`nginx`,extensions:[`jng`]},"image/x-mrsid-image":{source:`apache`,extensions:[`sid`]},"image/x-ms-bmp":{source:`nginx`,compressible:!0,extensions:[`bmp`]},"image/x-pcx":{source:`apache`,extensions:[`pcx`]},"image/x-pict":{source:`apache`,extensions:[`pic`,`pct`]},"image/x-portable-anymap":{source:`apache`,extensions:[`pnm`]},"image/x-portable-bitmap":{source:`apache`,extensions:[`pbm`]},"image/x-portable-graymap":{source:`apache`,extensions:[`pgm`]},"image/x-portable-pixmap":{source:`apache`,extensions:[`ppm`]},"image/x-rgb":{source:`apache`,extensions:[`rgb`]},"image/x-tga":{source:`apache`,extensions:[`tga`]},"image/x-wmf":{source:`iana`},"image/x-xbitmap":{source:`apache`,extensions:[`xbm`]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:`apache`,extensions:[`xpm`]},"image/x-xwindowdump":{source:`apache`,extensions:[`xwd`]},"message/bhttp":{source:`iana`},"message/cpim":{source:`iana`},"message/delivery-status":{source:`iana`},"message/disposition-notification":{source:`iana`,extensions:[`disposition-notification`]},"message/external-body":{source:`iana`},"message/feedback-report":{source:`iana`},"message/global":{source:`iana`,extensions:[`u8msg`]},"message/global-delivery-status":{source:`iana`,extensions:[`u8dsn`]},"message/global-disposition-notification":{source:`iana`,extensions:[`u8mdn`]},"message/global-headers":{source:`iana`,extensions:[`u8hdr`]},"message/http":{source:`iana`,compressible:!1},"message/imdn+xml":{source:`iana`,compressible:!0},"message/mls":{source:`iana`},"message/news":{source:`apache`},"message/ohttp-req":{source:`iana`},"message/ohttp-res":{source:`iana`},"message/partial":{source:`iana`,compressible:!1},"message/rfc822":{source:`iana`,compressible:!0,extensions:[`eml`,`mime`,`mht`,`mhtml`]},"message/s-http":{source:`apache`},"message/sip":{source:`iana`},"message/sipfrag":{source:`iana`},"message/tracking-status":{source:`iana`},"message/vnd.si.simp":{source:`apache`},"message/vnd.wfa.wsc":{source:`iana`,extensions:[`wsc`]},"model/3mf":{source:`iana`,extensions:[`3mf`]},"model/e57":{source:`iana`},"model/gltf+json":{source:`iana`,compressible:!0,extensions:[`gltf`]},"model/gltf-binary":{source:`iana`,compressible:!0,extensions:[`glb`]},"model/iges":{source:`iana`,compressible:!1,extensions:[`igs`,`iges`]},"model/jt":{source:`iana`,extensions:[`jt`]},"model/mesh":{source:`iana`,compressible:!1,extensions:[`msh`,`mesh`,`silo`]},"model/mtl":{source:`iana`,extensions:[`mtl`]},"model/obj":{source:`iana`,extensions:[`obj`]},"model/prc":{source:`iana`,extensions:[`prc`]},"model/step":{source:`iana`,extensions:[`step`,`stp`,`stpnc`,`p21`,`210`]},"model/step+xml":{source:`iana`,compressible:!0,extensions:[`stpx`]},"model/step+zip":{source:`iana`,compressible:!1,extensions:[`stpz`]},"model/step-xml+zip":{source:`iana`,compressible:!1,extensions:[`stpxz`]},"model/stl":{source:`iana`,extensions:[`stl`]},"model/u3d":{source:`iana`,extensions:[`u3d`]},"model/vnd.bary":{source:`iana`,extensions:[`bary`]},"model/vnd.cld":{source:`iana`,extensions:[`cld`]},"model/vnd.collada+xml":{source:`iana`,compressible:!0,extensions:[`dae`]},"model/vnd.dwf":{source:`iana`,extensions:[`dwf`]},"model/vnd.flatland.3dml":{source:`iana`},"model/vnd.gdl":{source:`iana`,extensions:[`gdl`]},"model/vnd.gs-gdl":{source:`apache`},"model/vnd.gs.gdl":{source:`iana`},"model/vnd.gtw":{source:`iana`,extensions:[`gtw`]},"model/vnd.moml+xml":{source:`iana`,compressible:!0},"model/vnd.mts":{source:`iana`,extensions:[`mts`]},"model/vnd.opengex":{source:`iana`,extensions:[`ogex`]},"model/vnd.parasolid.transmit.binary":{source:`iana`,extensions:[`x_b`]},"model/vnd.parasolid.transmit.text":{source:`iana`,extensions:[`x_t`]},"model/vnd.pytha.pyox":{source:`iana`,extensions:[`pyo`,`pyox`]},"model/vnd.rosette.annotated-data-model":{source:`iana`},"model/vnd.sap.vds":{source:`iana`,extensions:[`vds`]},"model/vnd.usda":{source:`iana`,extensions:[`usda`]},"model/vnd.usdz+zip":{source:`iana`,compressible:!1,extensions:[`usdz`]},"model/vnd.valve.source.compiled-map":{source:`iana`,extensions:[`bsp`]},"model/vnd.vtu":{source:`iana`,extensions:[`vtu`]},"model/vrml":{source:`iana`,compressible:!1,extensions:[`wrl`,`vrml`]},"model/x3d+binary":{source:`apache`,compressible:!1,extensions:[`x3db`,`x3dbz`]},"model/x3d+fastinfoset":{source:`iana`,extensions:[`x3db`]},"model/x3d+vrml":{source:`apache`,compressible:!1,extensions:[`x3dv`,`x3dvz`]},"model/x3d+xml":{source:`iana`,compressible:!0,extensions:[`x3d`,`x3dz`]},"model/x3d-vrml":{source:`iana`,extensions:[`x3dv`]},"multipart/alternative":{source:`iana`,compressible:!1},"multipart/appledouble":{source:`iana`},"multipart/byteranges":{source:`iana`},"multipart/digest":{source:`iana`},"multipart/encrypted":{source:`iana`,compressible:!1},"multipart/form-data":{source:`iana`,compressible:!1},"multipart/header-set":{source:`iana`},"multipart/mixed":{source:`iana`},"multipart/multilingual":{source:`iana`},"multipart/parallel":{source:`iana`},"multipart/related":{source:`iana`,compressible:!1},"multipart/report":{source:`iana`},"multipart/signed":{source:`iana`,compressible:!1},"multipart/vnd.bint.med-plus":{source:`iana`},"multipart/voice-message":{source:`iana`},"multipart/x-mixed-replace":{source:`iana`},"text/1d-interleaved-parityfec":{source:`iana`},"text/cache-manifest":{source:`iana`,compressible:!0,extensions:[`appcache`,`manifest`]},"text/calendar":{source:`iana`,extensions:[`ics`,`ifb`]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:[`coffee`,`litcoffee`]},"text/cql":{source:`iana`},"text/cql-expression":{source:`iana`},"text/cql-identifier":{source:`iana`},"text/css":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`css`]},"text/csv":{source:`iana`,compressible:!0,extensions:[`csv`]},"text/csv-schema":{source:`iana`},"text/directory":{source:`iana`},"text/dns":{source:`iana`},"text/ecmascript":{source:`apache`},"text/encaprtp":{source:`iana`},"text/enriched":{source:`iana`},"text/fhirpath":{source:`iana`},"text/flexfec":{source:`iana`},"text/fwdred":{source:`iana`},"text/gff3":{source:`iana`},"text/grammar-ref-list":{source:`iana`},"text/hl7v2":{source:`iana`},"text/html":{source:`iana`,compressible:!0,extensions:[`html`,`htm`,`shtml`]},"text/jade":{extensions:[`jade`]},"text/javascript":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`js`,`mjs`]},"text/jcr-cnd":{source:`iana`},"text/jsx":{compressible:!0,extensions:[`jsx`]},"text/less":{compressible:!0,extensions:[`less`]},"text/markdown":{source:`iana`,compressible:!0,extensions:[`md`,`markdown`]},"text/mathml":{source:`nginx`,extensions:[`mml`]},"text/mdx":{compressible:!0,extensions:[`mdx`]},"text/mizar":{source:`iana`},"text/n3":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`n3`]},"text/parameters":{source:`iana`,charset:`UTF-8`},"text/parityfec":{source:`iana`},"text/plain":{source:`iana`,compressible:!0,extensions:[`txt`,`text`,`conf`,`def`,`list`,`log`,`in`,`ini`]},"text/provenance-notation":{source:`iana`,charset:`UTF-8`},"text/prs.fallenstein.rst":{source:`iana`},"text/prs.lines.tag":{source:`iana`,extensions:[`dsc`]},"text/prs.prop.logic":{source:`iana`},"text/prs.texi":{source:`iana`},"text/raptorfec":{source:`iana`},"text/red":{source:`iana`},"text/rfc822-headers":{source:`iana`},"text/richtext":{source:`iana`,compressible:!0,extensions:[`rtx`]},"text/rtf":{source:`iana`,compressible:!0,extensions:[`rtf`]},"text/rtp-enc-aescm128":{source:`iana`},"text/rtploopback":{source:`iana`},"text/rtx":{source:`iana`},"text/sgml":{source:`iana`,extensions:[`sgml`,`sgm`]},"text/shaclc":{source:`iana`},"text/shex":{source:`iana`,extensions:[`shex`]},"text/slim":{extensions:[`slim`,`slm`]},"text/spdx":{source:`iana`,extensions:[`spdx`]},"text/strings":{source:`iana`},"text/stylus":{extensions:[`stylus`,`styl`]},"text/t140":{source:`iana`},"text/tab-separated-values":{source:`iana`,compressible:!0,extensions:[`tsv`]},"text/troff":{source:`iana`,extensions:[`t`,`tr`,`roff`,`man`,`me`,`ms`]},"text/turtle":{source:`iana`,charset:`UTF-8`,extensions:[`ttl`]},"text/ulpfec":{source:`iana`},"text/uri-list":{source:`iana`,compressible:!0,extensions:[`uri`,`uris`,`urls`]},"text/vcard":{source:`iana`,compressible:!0,extensions:[`vcard`]},"text/vnd.a":{source:`iana`},"text/vnd.abc":{source:`iana`},"text/vnd.ascii-art":{source:`iana`},"text/vnd.curl":{source:`iana`,extensions:[`curl`]},"text/vnd.curl.dcurl":{source:`apache`,extensions:[`dcurl`]},"text/vnd.curl.mcurl":{source:`apache`,extensions:[`mcurl`]},"text/vnd.curl.scurl":{source:`apache`,extensions:[`scurl`]},"text/vnd.debian.copyright":{source:`iana`,charset:`UTF-8`},"text/vnd.dmclientscript":{source:`iana`},"text/vnd.dvb.subtitle":{source:`iana`,extensions:[`sub`]},"text/vnd.esmertec.theme-descriptor":{source:`iana`,charset:`UTF-8`},"text/vnd.exchangeable":{source:`iana`},"text/vnd.familysearch.gedcom":{source:`iana`,extensions:[`ged`]},"text/vnd.ficlab.flt":{source:`iana`},"text/vnd.fly":{source:`iana`,extensions:[`fly`]},"text/vnd.fmi.flexstor":{source:`iana`,extensions:[`flx`]},"text/vnd.gml":{source:`iana`},"text/vnd.graphviz":{source:`iana`,extensions:[`gv`]},"text/vnd.hans":{source:`iana`},"text/vnd.hgl":{source:`iana`},"text/vnd.in3d.3dml":{source:`iana`,extensions:[`3dml`]},"text/vnd.in3d.spot":{source:`iana`,extensions:[`spot`]},"text/vnd.iptc.newsml":{source:`iana`},"text/vnd.iptc.nitf":{source:`iana`},"text/vnd.latex-z":{source:`iana`},"text/vnd.motorola.reflex":{source:`iana`},"text/vnd.ms-mediapackage":{source:`iana`},"text/vnd.net2phone.commcenter.command":{source:`iana`},"text/vnd.radisys.msml-basic-layout":{source:`iana`},"text/vnd.senx.warpscript":{source:`iana`},"text/vnd.si.uricatalogue":{source:`apache`},"text/vnd.sosi":{source:`iana`},"text/vnd.sun.j2me.app-descriptor":{source:`iana`,charset:`UTF-8`,extensions:[`jad`]},"text/vnd.trolltech.linguist":{source:`iana`,charset:`UTF-8`},"text/vnd.vcf":{source:`iana`},"text/vnd.wap.si":{source:`iana`},"text/vnd.wap.sl":{source:`iana`},"text/vnd.wap.wml":{source:`iana`,extensions:[`wml`]},"text/vnd.wap.wmlscript":{source:`iana`,extensions:[`wmls`]},"text/vnd.zoo.kcl":{source:`iana`},"text/vtt":{source:`iana`,charset:`UTF-8`,compressible:!0,extensions:[`vtt`]},"text/wgsl":{source:`iana`,extensions:[`wgsl`]},"text/x-asm":{source:`apache`,extensions:[`s`,`asm`]},"text/x-c":{source:`apache`,extensions:[`c`,`cc`,`cxx`,`cpp`,`h`,`hh`,`dic`]},"text/x-component":{source:`nginx`,extensions:[`htc`]},"text/x-fortran":{source:`apache`,extensions:[`f`,`for`,`f77`,`f90`]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:[`hbs`]},"text/x-java-source":{source:`apache`,extensions:[`java`]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:[`lua`]},"text/x-markdown":{compressible:!0,extensions:[`mkd`]},"text/x-nfo":{source:`apache`,extensions:[`nfo`]},"text/x-opml":{source:`apache`,extensions:[`opml`]},"text/x-org":{compressible:!0,extensions:[`org`]},"text/x-pascal":{source:`apache`,extensions:[`p`,`pas`]},"text/x-processing":{compressible:!0,extensions:[`pde`]},"text/x-sass":{extensions:[`sass`]},"text/x-scss":{extensions:[`scss`]},"text/x-setext":{source:`apache`,extensions:[`etx`]},"text/x-sfv":{source:`apache`,extensions:[`sfv`]},"text/x-suse-ymp":{compressible:!0,extensions:[`ymp`]},"text/x-uuencode":{source:`apache`,extensions:[`uu`]},"text/x-vcalendar":{source:`apache`,extensions:[`vcs`]},"text/x-vcard":{source:`apache`,extensions:[`vcf`]},"text/xml":{source:`iana`,compressible:!0,extensions:[`xml`]},"text/xml-external-parsed-entity":{source:`iana`},"text/yaml":{compressible:!0,extensions:[`yaml`,`yml`]},"video/1d-interleaved-parityfec":{source:`iana`},"video/3gpp":{source:`iana`,extensions:[`3gp`,`3gpp`]},"video/3gpp-tt":{source:`iana`},"video/3gpp2":{source:`iana`,extensions:[`3g2`]},"video/av1":{source:`iana`},"video/bmpeg":{source:`iana`},"video/bt656":{source:`iana`},"video/celb":{source:`iana`},"video/dv":{source:`iana`},"video/encaprtp":{source:`iana`},"video/evc":{source:`iana`},"video/ffv1":{source:`iana`},"video/flexfec":{source:`iana`},"video/h261":{source:`iana`,extensions:[`h261`]},"video/h263":{source:`iana`,extensions:[`h263`]},"video/h263-1998":{source:`iana`},"video/h263-2000":{source:`iana`},"video/h264":{source:`iana`,extensions:[`h264`]},"video/h264-rcdo":{source:`iana`},"video/h264-svc":{source:`iana`},"video/h265":{source:`iana`},"video/h266":{source:`iana`},"video/iso.segment":{source:`iana`,extensions:[`m4s`]},"video/jpeg":{source:`iana`,extensions:[`jpgv`]},"video/jpeg2000":{source:`iana`},"video/jpm":{source:`apache`,extensions:[`jpm`,`jpgm`]},"video/jxsv":{source:`iana`},"video/lottie+json":{source:`iana`,compressible:!0},"video/matroska":{source:`iana`},"video/matroska-3d":{source:`iana`},"video/mj2":{source:`iana`,extensions:[`mj2`,`mjp2`]},"video/mp1s":{source:`iana`},"video/mp2p":{source:`iana`},"video/mp2t":{source:`iana`,extensions:[`ts`,`m2t`,`m2ts`,`mts`]},"video/mp4":{source:`iana`,compressible:!1,extensions:[`mp4`,`mp4v`,`mpg4`]},"video/mp4v-es":{source:`iana`},"video/mpeg":{source:`iana`,compressible:!1,extensions:[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`]},"video/mpeg4-generic":{source:`iana`},"video/mpv":{source:`iana`},"video/nv":{source:`iana`},"video/ogg":{source:`iana`,compressible:!1,extensions:[`ogv`]},"video/parityfec":{source:`iana`},"video/pointer":{source:`iana`},"video/quicktime":{source:`iana`,compressible:!1,extensions:[`qt`,`mov`]},"video/raptorfec":{source:`iana`},"video/raw":{source:`iana`},"video/rtp-enc-aescm128":{source:`iana`},"video/rtploopback":{source:`iana`},"video/rtx":{source:`iana`},"video/scip":{source:`iana`},"video/smpte291":{source:`iana`},"video/smpte292m":{source:`iana`},"video/ulpfec":{source:`iana`},"video/vc1":{source:`iana`},"video/vc2":{source:`iana`},"video/vnd.cctv":{source:`iana`},"video/vnd.dece.hd":{source:`iana`,extensions:[`uvh`,`uvvh`]},"video/vnd.dece.mobile":{source:`iana`,extensions:[`uvm`,`uvvm`]},"video/vnd.dece.mp4":{source:`iana`},"video/vnd.dece.pd":{source:`iana`,extensions:[`uvp`,`uvvp`]},"video/vnd.dece.sd":{source:`iana`,extensions:[`uvs`,`uvvs`]},"video/vnd.dece.video":{source:`iana`,extensions:[`uvv`,`uvvv`]},"video/vnd.directv.mpeg":{source:`iana`},"video/vnd.directv.mpeg-tts":{source:`iana`},"video/vnd.dlna.mpeg-tts":{source:`iana`},"video/vnd.dvb.file":{source:`iana`,extensions:[`dvb`]},"video/vnd.fvt":{source:`iana`,extensions:[`fvt`]},"video/vnd.hns.video":{source:`iana`},"video/vnd.iptvforum.1dparityfec-1010":{source:`iana`},"video/vnd.iptvforum.1dparityfec-2005":{source:`iana`},"video/vnd.iptvforum.2dparityfec-1010":{source:`iana`},"video/vnd.iptvforum.2dparityfec-2005":{source:`iana`},"video/vnd.iptvforum.ttsavc":{source:`iana`},"video/vnd.iptvforum.ttsmpeg2":{source:`iana`},"video/vnd.motorola.video":{source:`iana`},"video/vnd.motorola.videop":{source:`iana`},"video/vnd.mpegurl":{source:`iana`,extensions:[`mxu`,`m4u`]},"video/vnd.ms-playready.media.pyv":{source:`iana`,extensions:[`pyv`]},"video/vnd.nokia.interleaved-multimedia":{source:`iana`},"video/vnd.nokia.mp4vr":{source:`iana`},"video/vnd.nokia.videovoip":{source:`iana`},"video/vnd.objectvideo":{source:`iana`},"video/vnd.planar":{source:`iana`},"video/vnd.radgamettools.bink":{source:`iana`},"video/vnd.radgamettools.smacker":{source:`apache`},"video/vnd.sealed.mpeg1":{source:`iana`},"video/vnd.sealed.mpeg4":{source:`iana`},"video/vnd.sealed.swf":{source:`iana`},"video/vnd.sealedmedia.softseal.mov":{source:`iana`},"video/vnd.uvvu.mp4":{source:`iana`,extensions:[`uvu`,`uvvu`]},"video/vnd.vivo":{source:`iana`,extensions:[`viv`]},"video/vnd.youtube.yt":{source:`iana`},"video/vp8":{source:`iana`},"video/vp9":{source:`iana`},"video/webm":{source:`apache`,compressible:!1,extensions:[`webm`]},"video/x-f4v":{source:`apache`,extensions:[`f4v`]},"video/x-fli":{source:`apache`,extensions:[`fli`]},"video/x-flv":{source:`apache`,compressible:!1,extensions:[`flv`]},"video/x-m4v":{source:`apache`,extensions:[`m4v`]},"video/x-matroska":{source:`apache`,compressible:!1,extensions:[`mkv`,`mk3d`,`mks`]},"video/x-mng":{source:`apache`,extensions:[`mng`]},"video/x-ms-asf":{source:`apache`,extensions:[`asf`,`asx`]},"video/x-ms-vob":{source:`apache`,extensions:[`vob`]},"video/x-ms-wm":{source:`apache`,extensions:[`wm`]},"video/x-ms-wmv":{source:`apache`,compressible:!1,extensions:[`wmv`]},"video/x-ms-wmx":{source:`apache`,extensions:[`wmx`]},"video/x-ms-wvx":{source:`apache`,extensions:[`wvx`]},"video/x-msvideo":{source:`apache`,extensions:[`avi`]},"video/x-sgi-movie":{source:`apache`,extensions:[`movie`]},"video/x-smv":{source:`apache`,extensions:[`smv`]},"x-conference/x-cooltalk":{source:`apache`,extensions:[`ice`]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}})),yC=r(((e,t)=>{
319
+ /*!
320
+ * mime-db
321
+ * Copyright(c) 2014 Jonathan Ong
322
+ * Copyright(c) 2015-2022 Douglas Christopher Wilson
323
+ * MIT Licensed
324
+ */
325
+ t.exports=vC()})),bC=r(((e,t)=>{var n={"prs.":100,"x-":200,"x.":300,"vnd.":400,default:900},r={nginx:10,apache:20,iana:40,default:30},i={application:1,font:2,default:0};t.exports=function(e,t=`default`){if(e===`application/octet-stream`)return 0;let[a,o]=e.split(`/`),s=n[o.replace(/(\.|x-).*/,`$1`)]||n.default,c=r[t]||r.default,l=i[a]||i.default,u=1-e.length/100;return s+c+l+u}})),xC=r((t=>{var n=yC(),r=e(`path`).extname,i=bC(),a=/^\s*([^;\s]*)(?:;|\s|$)/,o=/^text\//i;t.charset=s,t.charsets={lookup:s},t.contentType=c,t.extension=l,t.extensions=Object.create(null),t.lookup=u,t.types=Object.create(null),t._extensionConflicts=[],d(t.extensions,t.types);function s(e){if(!e||typeof e!=`string`)return!1;var t=a.exec(e),r=t&&n[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&o.test(t[1])?`UTF-8`:!1}function c(e){if(!e||typeof e!=`string`)return!1;var n=e.indexOf(`/`)===-1?t.lookup(e):e;if(!n)return!1;if(n.indexOf(`charset`)===-1){var r=t.charset(n);r&&(n+=`; charset=`+r.toLowerCase())}return n}function l(e){if(!e||typeof e!=`string`)return!1;var n=a.exec(e),r=n&&t.extensions[n[1].toLowerCase()];return!r||!r.length?!1:r[0]}function u(e){if(!e||typeof e!=`string`)return!1;var n=r(`x.`+e).toLowerCase().slice(1);return n&&t.types[n]||!1}function d(e,r){Object.keys(n).forEach(function(i){var a=n[i].extensions;if(!(!a||!a.length)){e[i]=a;for(var o=0;o<a.length;o++){var s=a[o];r[s]=f(s,r[s],i);let e=p(s,r[s],i);e!==r[s]&&t._extensionConflicts.push([s,e,r[s]])}}})}function f(e,t,r){return(t?i(t,n[t].source):0)>(r?i(r,n[r].source):0)?t:r}function p(e,r,i){var a=[`nginx`,`apache`,void 0,`iana`],o=r?a.indexOf(n[r].source):0,s=i?a.indexOf(n[i].source):0;return t.types[l]!==`application/octet-stream`&&(o>s||o===s&&t.types[l]?.slice(0,12)===`application/`)||o>s?r:i}}));_C(),xC(),f(`flydrive:fs`),f(`flydrive:core`),xC(),f(`flydrive:s3`);const SC=wr(),CC=wg(),{accounts:wC,apiKeys:TC,invitations:EC,members:DC,organizations:OC,sessions:kC,ssoProviders:AC,teamMembers:jC,teams:MC,twoFactors:NC,users:PC,verifications:FC,storageAttachments:IC,storageBlobs:LC,storageVariantRecords:RC}={...SC.tables,...CC.tables};et({...SC.tables,...CC.tables},e=>({...SC.relations(e),...CC.relations(e)}));const zC=cg.object({width:cg.number().optional(),height:cg.number().optional(),fit:cg.enum([`cover`,`contain`,`fill`,`inside`,`outside`]).optional(),position:cg.enum([`top`,`right top`,`right`,`right bottom`,`bottom`,`left bottom`,`left`,`left top`,`centre`]).optional(),kernel:cg.enum([`nearest`,`linear`,`cubic`,`mitchell`,`lanczos2`,`lanczos3`]).optional()}),BC=cg.object({resize:zC.optional(),rotate:cg.number().optional(),flip:cg.boolean().optional(),flop:cg.boolean().optional(),sharpen:cg.boolean().optional(),blur:cg.number().optional(),grayscale:cg.boolean().optional(),format:cg.enum([`jpeg`,`png`,`webp`,`avif`,`gif`]).optional(),quality:cg.number().min(1).max(100).optional()});var VC=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},HC={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},UC=new class{#e=HC;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!==`production`&&this.#t&&e!==this.#e&&console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!==`production`&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!==`production`&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!==`production`&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function WC(e){setTimeout(e,0)}var GC=typeof window>`u`||`Deno`in globalThis;function KC(){}function qC(e){return typeof e==`number`&&e>=0&&e!==1/0}function JC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function YC(e,t){return typeof e==`function`?e(t):e}function XC(e,t){return typeof e==`function`?e(t):e}function ZC(e){return JSON.stringify(e,(e,t)=>nw(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}var QC=Object.prototype.hasOwnProperty;function $C(e,t){if(e===t)return e;let n=tw(e)&&tw(t);if(!n&&!(nw(e)&&nw(t)))return t;let r=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?Array(a):{},s=0;for(let c=0;c<a;c++){let a=n?c:i[c],l=e[a],u=t[a];if(l===u){o[a]=l,(n?c<r:QC.call(e,a))&&s++;continue}if(l===null||u===null||typeof l!=`object`||typeof u!=`object`){o[a]=u;continue}let d=$C(l,u);o[a]=d,d===l&&s++}return r===a&&s===r?e:o}function ew(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function tw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function nw(e){if(!rw(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!rw(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function rw(e){return Object.prototype.toString.call(e)===`[object Object]`}function iw(e,t,n){if(typeof n.structuralSharing==`function`)return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!==`production`)try{return $C(e,t)}catch(e){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`),e}return $C(e,t)}return t}function aw(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ow(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sw=Symbol();function cw(e,t){return process.env.NODE_ENV!==`production`&&e.queryFn===sw&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===sw?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lw(e,t){return typeof e==`function`?e(...t):!!e}var uw=new class extends VC{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!GC&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function dw(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var fw=WC;function pw(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=fw,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var mw=pw(),hw=new class extends VC{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!GC&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function gw(e){return(e??`online`)===`online`?hw.isOnline():!0}function _w(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gw(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}var vw=class extends VC{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=dw(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),bw(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xw(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xw(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof XC(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ew(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Sw(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||XC(this.options.enabled,this.#t)!==XC(t.enabled,this.#t)||YC(this.options.staleTime,this.#t)!==YC(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||XC(this.options.enabled,this.#t)!==XC(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ww(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(KC)),t}#g(){this.#b();let e=YC(this.options.staleTime,this.#t);if(GC||this.#r.isStale||!qC(e))return;let t=JC(this.#r.dataUpdatedAt,e)+1;this.#d=UC.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(GC||XC(this.options.enabled,this.#t)===!1||!qC(this.#p)||this.#p===0)&&(this.#f=UC.setInterval(()=>{(this.options.refetchIntervalInBackground||uw.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(UC.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(UC.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&bw(e,t),o=i&&Sw(e,n,t,r);(a||o)&&(l={...l,..._w(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=iw(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=iw(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Cw(e,t),refetch:this.refetch,promise:this.#o,isEnabled:XC(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=dw())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!ew(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){mw.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function yw(e,t){return XC(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function bw(e,t){return yw(e,t)||e.state.data!==void 0&&xw(e,t,t.refetchOnMount)}function xw(e,t,n){if(XC(t.enabled,e)!==!1&&YC(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Cw(e,t)}return!1}function Sw(e,t,n,r){return(e!==t||XC(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Cw(e,n)}function Cw(e,t){return XC(t.enabled,e)!==!1&&e.isStaleByTime(YC(t.staleTime,e))}function ww(e,t){return!ew(e.getCurrentResult(),t)}function Tw(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener(`abort`,()=>{n=!0}),t.signal)})},u=cw(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ow:aw;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Dw:Ew,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ew(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Ew(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Dw(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ow(e,t){return t?Ew(e,t)!=null:!1}function kw(e,t){return!t||!e.getPreviousPageParam?!1:Dw(e,t)!=null}var Aw=class extends vw{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Tw()})}getOptimisticResult(e){return e.behavior=Tw(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ow(t,n.data),hasPreviousPage:kw(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}};function jw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Mw=class extends VC{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ew(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ZC(t.mutationKey)!==ZC(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??jw();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){mw.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n,r),this.#r.onSettled?.(e.data,null,t,n,r)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n,r),this.#r.onSettled?.(void 0,e.error,t,n,r))}this.listeners.forEach(e=>{e(this.#t)})})}};function Nw(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Pw(e,t,n){let r=e.slice(0);return r[t]=n,r}var Fw=class extends VC{#e;#t;#n;#r;#i;#a;#o;#s;#c=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#f(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){if(this.#n=e,this.#r=t,process.env.NODE_ENV!==`production`){let t=e.map(e=>this.#e.defaultQueryOptions(e).queryHash);new Set(t).size!==t.length&&console.warn(`[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior.`)}mw.batch(()=>{let e=this.#i,t=this.#d(this.#n);this.#c=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ew(e,n)});!o&&!s||(o&&(this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Nw(e,n).forEach(e=>{e.destroy()}),Nw(n,e).forEach(e=>{e.subscribe(t=>{this.#f(e,t)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#d(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[r,e=>this.#u(e??r,t),()=>this.#l(r,n)]}#l(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#u(e,t){return t?((!this.#a||this.#t!==this.#s||t!==this.#o)&&(this.#o=t,this.#s=this.#t,this.#a=$C(this.#a,t(e))),this.#a):e}#d(e){let t=new Map(this.#i.map(e=>[e.options.queryHash,e])),n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash);i?n.push({defaultedQueryOptions:r,observer:i}):n.push({defaultedQueryOptions:r,observer:new vw(this.#e,r)})}),n}#f(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Pw(this.#t,n,t),this.#p())}#p(){if(this.hasListeners()){let e=this.#a,t=this.#l(this.#t,this.#c);e!==this.#u(t,this.#r?.combine)&&mw.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Z=t(i(),1),Iw=a(),Lw=Z.createContext(void 0),Rw=e=>{let t=Z.useContext(Lw);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},zw=Z.createContext(!1),Bw=()=>Z.useContext(zw);zw.Provider;function Vw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hw=Z.createContext(Vw()),Uw=()=>Z.useContext(Hw),Ww=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Gw=e=>{Z.useEffect(()=>{e.clearReset()},[e])},Kw=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||lw(n,[e.error,r])),qw=(e,t)=>t.state.data===void 0,Jw=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Yw=(e,t)=>e.isLoading&&e.isFetching&&!t,Xw=(e,t)=>e?.suspense&&t.isPending,Zw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Qw({queries:e,...t},n){let r=Rw(n),i=Bw(),a=Uw(),o=Z.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Jw(e),Ww(e,a)}),Gw(a);let[s]=Z.useState(()=>new Fw(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;Z.useSyncExternalStore(Z.useCallback(e=>d?s.subscribe(mw.batchCalls(e)):KC,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),Z.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Xw(o[t],e))?c.flatMap((e,t)=>{let n=o[t];if(n){let t=new vw(r,n);if(Xw(n,e))return Zw(n,t,a);Yw(e,i)&&Zw(n,t,a)}return[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&Kw({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function $w(e,t,n){if(process.env.NODE_ENV!==`production`&&(typeof e!=`object`||Array.isArray(e)))throw Error(`Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object`);let r=Bw(),i=Uw(),a=Rw(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),process.env.NODE_ENV!==`production`&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),o._optimisticResults=r?`isRestoring`:`optimistic`,Jw(o),Ww(o,i),Gw(i);let s=!a.getQueryCache().get(o.queryHash),[c]=Z.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(Z.useSyncExternalStore(Z.useCallback(e=>{let t=u?c.subscribe(mw.batchCalls(e)):KC;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),Z.useEffect(()=>{c.setOptions(o)},[o,c]),Xw(o,l))throw Zw(o,c,i);if(Kw({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!GC&&Yw(l,r)&&(s?Zw(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(KC).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function eT(e,t){return $w(e,vw,t)}function tT(e,t){return process.env.NODE_ENV!==`production`&&e.queryFn===sw&&console.error(`skipToken is not allowed for useSuspenseQuery`),$w({...e,enabled:!0,suspense:!0,throwOnError:qw,placeholderData:void 0},vw,t)}function nT(e,t){return process.env.NODE_ENV!==`production`&&e.queryFn===sw&&console.error(`skipToken is not allowed for useSuspenseInfiniteQuery`),$w({...e,enabled:!0,suspense:!0,throwOnError:qw},Aw,t)}function rT(e,t){return Qw({...e,queries:e.queries.map(e=>(process.env.NODE_ENV!==`production`&&e.queryFn===sw&&console.error(`skipToken is not allowed for useSuspenseQueries`),{...e,suspense:!0,throwOnError:qw,enabled:!0,placeholderData:void 0}))},t)}function iT(e,t){let n=Rw(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function aT(e,t){let n=Rw(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function oT(e){return e}function sT(e){return e}function cT(e,t){let n=Rw(t),[r]=Z.useState(()=>new Mw(n,e));Z.useEffect(()=>{r.setOptions(e)},[r,e]);let i=Z.useSyncExternalStore(Z.useCallback(e=>r.subscribe(mw.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=Z.useCallback((e,t)=>{r.mutate(e,t).catch(KC)},[r]);if(i.error&&lw(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function lT(e,t){return $w(e,Aw,t)}var uT=Object.create,dT=Object.defineProperty,fT=Object.getOwnPropertyDescriptor,pT=Object.getOwnPropertyNames,mT=Object.getPrototypeOf,hT=Object.prototype.hasOwnProperty,gT=(e,t)=>function(){return t||(0,e[pT(e)[0]])((t={exports:{}}).exports,t),t.exports},_T=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=pT(t),a=0,o=i.length,s;a<o;a++)s=i[a],!hT.call(e,s)&&s!==n&&dT(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=fT(t,s))||r.enumerable});return e},vT=(e,t,n)=>(n=e==null?{}:uT(mT(e)),_T(t||!e||!e.__esModule?dT(n,`default`,{value:e,enumerable:!0}):n,e)),yT=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),bT=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=yT().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),xT=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=yT().default,r=bT();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),ST=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=xT();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),CT=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=ST();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}});function wT(e){let t={subscribe(t){let n=null,r=!1,i=!1,a=!1;function o(){if(n===null){a=!0;return}i||(i=!0,typeof n==`function`?n():n&&n.unsubscribe())}return n=e({next(e){var n;r||(n=t.next)==null||n.call(t,e)},error(e){var n;r||(r=!0,(n=t.error)==null||n.call(t,e),o())},complete(){var e;r||(r=!0,(e=t.complete)==null||e.call(t),o())}}),a&&o(),{unsubscribe:o}},pipe(...e){return e.reduce(TT,t)}};return t}function TT(e,t){return t(e)}function ET(e){let t=new AbortController;return new Promise((n,r)=>{let i=!1;function a(){i||(i=!0,o.unsubscribe())}t.signal.addEventListener(`abort`,()=>{r(t.signal.reason)});let o=e.subscribe({next(e){i=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})})}function DT(e){return e=>{let t=0,n=null,r=[];function i(){n||=e.subscribe({next(e){for(let n of r){var t;(t=n.next)==null||t.call(n,e)}},error(e){for(let n of r){var t;(t=n.error)==null||t.call(n,e)}},complete(){for(let t of r){var e;(e=t.complete)==null||e.call(t)}}})}function a(){if(t===0&&n){let e=n;n=null,e.unsubscribe()}}return wT(e=>(t++,r.push(e),i(),{unsubscribe(){t--,a();let n=r.findIndex(t=>t===e);n>-1&&r.splice(n,1)}}))}}function OT(e){let t=e,n=[],r=e=>{t!==void 0&&e.next(t),n.push(e)},i=e=>{n.splice(n.indexOf(e),1)},a=wT(e=>(r(e),()=>{i(e)}));return a.next=e=>{if(t!==e){t=e;for(let t of n)t.next(e)}},a.get=()=>t,a}function kT(e){return wT(t=>{function n(t=0,r=e.op){let i=e.links[t];if(!i)throw Error(`No more links to execute - did you forget to add an ending link?`);return i({op:r,next(e){return n(t+1,e)}})}return n().subscribe(t)})}var AT=vT(ST(),1),jT=vT(CT(),1);function MT(e){return e instanceof FT}function NT(e){return Dg(e)&&Dg(e.error)&&typeof e.error.code==`number`&&typeof e.error.message==`string`}function PT(e,t){return typeof e==`string`?e:Dg(e)&&typeof e.message==`string`?e.message:t}var FT=class e extends Error{constructor(t,n){var r,i;let a=n?.cause;super(t,{cause:a}),(0,AT.default)(this,`cause`,void 0),(0,AT.default)(this,`shape`,void 0),(0,AT.default)(this,`data`,void 0),(0,AT.default)(this,`meta`,void 0),this.meta=n?.meta,this.cause=a,this.shape=n==null||(r=n.result)==null?void 0:r.error,this.data=n==null||(i=n.result)==null?void 0:i.error.data,this.name=`TRPCClientError`,Object.setPrototypeOf(this,e.prototype)}static from(t,n={}){let r=t;return MT(r)?(n.meta&&(r.meta=(0,jT.default)((0,jT.default)({},r.meta),n.meta)),r):NT(r)?new e(r.error.message,(0,jT.default)((0,jT.default)({},n),{},{result:r})):new e(PT(r,`Unknown error`),(0,jT.default)((0,jT.default)({},n),{},{cause:r}))}};vT(CT(),1),vT(CT(),1),vT(CT(),1),vT(CT(),1);const IT=(e,...t)=>typeof e==`function`?e(...t):e;vT(ST(),1);function LT(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function RT(e){let t=await IT(e.url);return e.connectionParams?t+`${t.includes(`?`)?`&`:`?`}connectionParams=1`:t}async function zT(e){let t={method:`connectionParams`,data:await IT(e)};return JSON.stringify(t)}vT(ST(),1);var BT=vT(ST(),1);function VT(e){let{promise:t,resolve:n,reject:r}=LT();return e.addEventListener(`open`,()=>{e.removeEventListener(`error`,r),n()}),e.addEventListener(`error`,r),t}function HT(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function a(){r=setTimeout(()=>{e.send(`PING`),i=setTimeout(()=>{e.close()},n)},t)}function o(){clearTimeout(r),a()}function s(){clearTimeout(i),o()}e.addEventListener(`open`,a),e.addEventListener(`message`,({data:e})=>{clearTimeout(r),a(),e===`PONG`&&s()}),e.addEventListener(`close`,()=>{clearTimeout(r),clearTimeout(i)})}var UT=class e{constructor(t){if((0,BT.default)(this,`id`,++e.connectCount),(0,BT.default)(this,`WebSocketPonyfill`,void 0),(0,BT.default)(this,`urlOptions`,void 0),(0,BT.default)(this,`keepAliveOpts`,void 0),(0,BT.default)(this,`wsObservable`,OT(null)),(0,BT.default)(this,`openPromise`,null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++e.connectCount,t.openPromise=RT(t.urlOptions).then(e=>new t.WebSocketPonyfill(e)).then(async e=>{t.ws=e,e.addEventListener(`message`,function({data:e}){e===`PING`&&this.send(`PONG`)}),t.keepAliveOpts.enabled&&HT(e,t.keepAliveOpts),e.addEventListener(`close`,()=>{t.ws===e&&(t.ws=null)}),await VT(e),t.urlOptions.connectionParams&&e.send(await zT(t.urlOptions.connectionParams))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var t;(t=e.ws)==null||t.close()}}};(0,BT.default)(UT,`connectCount`,0),vT(ST(),1),vT(CT(),1);var WT=vT(ST(),1),GT=vT(CT(),1),KT=class{constructor(e){(0,WT.default)(this,`links`,void 0),(0,WT.default)(this,`runtime`,void 0),(0,WT.default)(this,`requestId`,void 0),this.requestId=0,this.runtime={},this.links=e.links.map(e=>e(this.runtime))}$request(e){return kT({links:this.links,op:(0,GT.default)((0,GT.default)({},e),{},{context:e.context??{},id:++this.requestId})}).pipe(DT())}async requestAsPromise(e){var t=this;try{return(await ET(t.$request(e))).result.data}catch(e){throw FT.from(e)}}query(e,t,n){return this.requestAsPromise({type:`query`,path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:`mutation`,path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:`subscription`,path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case`state`:var t;(t=n.onConnectionStateChange)==null||t.call(n,e.result);break;case`started`:var r;(r=n.onStarted)==null||r.call(n,{context:e.context});break;case`stopped`:var i;(i=n.onStopped)==null||i.call(n);break;case`data`:case void 0:var a;(a=n.onData)==null||a.call(n,e.result.data);break}},error(e){var t;(t=n.onError)==null||t.call(n,e)},complete(){var e;(e=n.onComplete)==null||e.call(n)}})}};const qT=Symbol.for(`trpc_untypedClient`),JT={query:`query`,mutate:`mutation`,subscribe:`subscription`},YT=e=>JT[e];function XT(e){let t=Wg(({path:t,args:n})=>{let r=[...t],i=YT(r.pop()),a=r.join(`.`);return e[i](a,...n)});return Gg(n=>n===qT?e:t[n])}function ZT(e){return XT(new KT(e))}function QT(e){return e[qT]}vT(CT(),1),vT(CT(),1),vT(gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1),vT(CT(),1);var $T=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),eE=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(e,t){this.v=e,this.k=t}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),tE=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=eE();function r(e){return new n(e,0)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),nE=gT({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=eE();function r(e){return function(){return new i(e.apply(this,arguments))}}function i(e){var t,r;function i(t,r){try{var o=e[t](r),s=o.value,c=s instanceof n;Promise.resolve(c?s.v:s).then(function(n){if(c){var r=t===`return`?`return`:`next`;if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?`return`:`normal`,n)},function(e){i(`throw`,e)})}catch(e){a(`throw`,e)}}function a(e,n){switch(e){case`return`:t.resolve({value:n,done:!0});break;case`throw`:t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise(function(a,o){var s={key:e,arg:n,resolve:a,reject:o,next:null};r?r=r.next=s:(t=r=s,i(e,n))})},typeof e.return!=`function`&&(this.return=void 0)}i.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},i.prototype.next=function(e){return this._invoke(`next`,e)},i.prototype.throw=function(e){return this._invoke(`throw`,e)},i.prototype.return=function(e){return this._invoke(`return`,e)},t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}});vT($T(),1),vT(tE(),1),vT(nE(),1),vT(CT(),1);var rE=Object.create,iE=Object.defineProperty,aE=Object.getOwnPropertyDescriptor,oE=Object.getOwnPropertyNames,sE=Object.getPrototypeOf,cE=Object.prototype.hasOwnProperty,lE=(e,t)=>function(){return t||(0,e[oE(e)[0]])((t={exports:{}}).exports,t),t.exports},uE=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=oE(t),a=0,o=i.length,s;a<o;a++)s=i[a],!cE.call(e,s)&&s!==n&&iE(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=aE(t,s))||r.enumerable});return e},dE=(e,t,n)=>(n=e==null?{}:rE(sE(e)),uE(t||!e||!e.__esModule?iE(n,`default`,{value:e,enumerable:!0}):n,e)),fE=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),pE=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=fE();function r(e,t){if(e==null)return{};var r,i,a=n(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),mE=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(e){"@babel/helpers - typeof";return t.exports=n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),hE=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=mE().default;function r(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),gE=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=mE().default,r=hE();function i(e){var t=r(e,`string`);return n(t)==`symbol`?t:t+``}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),_E=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=gE();function r(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}}),vE=lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=_E();function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]==null?{}:arguments[t];t%2?r(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports}}),yE=dE(pE(),1),bE=dE(vE(),1);const xE=[`cursor`,`direction`];function SE(e,t,n){let r=e.flatMap(e=>e.split(`.`));if(!t&&(!n||n===`any`))return r.length?[r]:[];if(n===`infinite`&&Dg(t)&&(`direction`in t||`cursor`in t)){let{cursor:e,direction:n}=t;return[r,{input:(0,yE.default)(t,xE),type:`infinite`}]}return[r,(0,bE.default)((0,bE.default)({},t!==void 0&&t!==sw&&{input:t}),n&&n!==`any`&&{type:n})]}function CE(e){return SE(e,void 0,`any`)}function wE(e){return Wg(({path:t,args:n})=>{let r=[...t],i=r.pop();if(i===`useMutation`)return e[i](r,...n);if(i===`_def`)return{path:r};let[a,...o]=n,s=o[0]??{};return e[i](r,a,s)})}const TE=[`client`,`ssrContext`,`ssrState`,`abortOnUnmount`],EE=Z.createContext?.call(Z,null),DE=e=>{switch(e){case`queryOptions`:case`fetch`:case`ensureData`:case`prefetch`:case`getData`:case`setData`:case`setQueriesData`:return`query`;case`infiniteQueryOptions`:case`fetchInfinite`:case`prefetchInfinite`:case`getInfiniteData`:case`setInfiniteData`:return`infinite`;case`setMutationDefaults`:case`getMutationDefaults`:case`isMutating`:case`cancel`:case`invalidate`:case`refetch`:case`reset`:return`any`}};function OE(e){return Wg(t=>{let n=[...t.path],r=n.pop(),i=[...t.args],a=i.shift(),o=SE(n,a,DE(r));return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,o,i[0]),queryOptions:()=>e.queryOptions(n,o,...i),fetch:()=>e.fetchQuery(o,...i),fetchInfinite:()=>e.fetchInfiniteQuery(o,i[0]),prefetch:()=>e.prefetchQuery(o,...i),prefetchInfinite:()=>e.prefetchInfiniteQuery(o,i[0]),ensureData:()=>e.ensureQueryData(o,...i),invalidate:()=>e.invalidateQueries(o,...i),reset:()=>e.resetQueries(o,...i),refetch:()=>e.refetchQueries(o,...i),cancel:()=>e.cancelQuery(o,...i),setData:()=>{e.setQueryData(o,i[0],i[1])},setQueriesData:()=>e.setQueriesData(o,i[0],i[1],i[2]),setInfiniteData:()=>{e.setInfiniteQueryData(o,i[0],i[1])},getData:()=>e.getQueryData(o),getInfiniteData:()=>e.getInfiniteQueryData(o),setMutationDefaults:()=>e.setMutationDefaults(CE(n),a),getMutationDefaults:()=>e.getMutationDefaults(CE(n)),isMutating:()=>e.isMutating({mutationKey:CE(n)})}[r]()})}function kE(e){let t=XT(e.client),n=OE(e);return Gg(r=>{let i=r;return i===`client`?t:TE.includes(i)?e[i]:n[r]})}var AE=dE(vE(),1);function jE(e){let t=e instanceof KT?e:QT(e);return Wg(e=>{let n=e.path,r=n.join(`.`),[i,a]=e.args;return(0,AE.default)({queryKey:SE(n,i,`query`),queryFn:()=>t.query(r,i,a?.trpc)},a)})}var ME=dE(vE(),1);function NE(e,t,n){let r=e[0],i=e[1]?.input;return n&&(i=(0,ME.default)((0,ME.default)((0,ME.default)({},i??{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})),[r.join(`.`),i,t?.trpc]}var PE=dE(lE({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(e){var t,n,i,a=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,i=Symbol.iterator);a--;){if(n&&(t=e[n])!=null)return t.call(e);if(i&&(t=e[i])!=null)return new r(t.call(e));n=`@@asyncIterator`,i=`@@iterator`}throw TypeError(`Object is not async iterable`)}function r(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return r=function(e){this.s=e,this.n=e.next},r.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new r(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}})(),1);function FE(e){return{path:e.path.join(`.`)}}function IE(e){let t=FE(e);return Z.useMemo(()=>t,[t])}async function LE(e,t,n){let r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:`success`});let i=[];var a=!1,o=!1,s;try{for(var c=(0,PE.default)(e),l;a=!(l=await c.next()).done;a=!1){let e=l.value;i.push(e),r.setState({data:[...i]})}}catch(e){o=!0,s=e}finally{try{a&&c.return!=null&&await c.return()}finally{if(o)throw s}}return i}var Q=dE(vE(),1);function RE(e){let{client:t,queryClient:n}=e,r=t instanceof KT?t:QT(t);return{infiniteQueryOptions:(e,t,n)=>{let i=t[1]?.input===sw;return Object.assign(sT((0,Q.default)((0,Q.default)({},n),{},{initialData:n?.initialData,queryKey:t,queryFn:i?sw:async e=>{var i;let a=(0,Q.default)((0,Q.default)({},n),{},{trpc:(0,Q.default)((0,Q.default)({},n?.trpc),!(n==null||(i=n.trpc)==null)&&i.abortOnUnmount?{signal:e.signal}:{signal:null})});return await r.query(...NE(t,a,{direction:e.direction,pageParam:e.pageParam}))},initialPageParam:n?.initialCursor??null})),{trpc:FE({path:e})})},queryOptions:(e,t,i)=>{let a=t[1]?.input===sw;return Object.assign(oT((0,Q.default)((0,Q.default)({},i),{},{initialData:i?.initialData,queryKey:t,queryFn:a?sw:async e=>{var a;let o=(0,Q.default)((0,Q.default)({},i),{},{trpc:(0,Q.default)((0,Q.default)({},i?.trpc),!(i==null||(a=i.trpc)==null)&&a.abortOnUnmount?{signal:e.signal}:{signal:null})}),s=await r.query(...NE(t,o));return jg(s)?LE(s,n,t):s}})),{trpc:FE({path:e})})},fetchQuery:(e,t)=>n.fetchQuery((0,Q.default)((0,Q.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...NE(e,t))})),fetchInfiniteQuery:(e,t)=>n.fetchInfiniteQuery((0,Q.default)((0,Q.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...NE(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null})),prefetchQuery:(e,t)=>n.prefetchQuery((0,Q.default)((0,Q.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...NE(e,t))})),prefetchInfiniteQuery:(e,t)=>n.prefetchInfiniteQuery((0,Q.default)((0,Q.default)({},t),{},{queryKey:e,queryFn:({pageParam:n,direction:i})=>r.query(...NE(e,t,{pageParam:n,direction:i})),initialPageParam:t?.initialCursor??null})),ensureQueryData:(e,t)=>n.ensureQueryData((0,Q.default)((0,Q.default)({},t),{},{queryKey:e,queryFn:()=>r.query(...NE(e,t))})),invalidateQueries:(e,t,r)=>n.invalidateQueries((0,Q.default)((0,Q.default)({},t),{},{queryKey:e}),r),resetQueries:(e,t,r)=>n.resetQueries((0,Q.default)((0,Q.default)({},t),{},{queryKey:e}),r),refetchQueries:(e,t,r)=>n.refetchQueries((0,Q.default)((0,Q.default)({},t),{},{queryKey:e}),r),cancelQuery:(e,t)=>n.cancelQueries({queryKey:e},t),setQueryData:(e,t,r)=>n.setQueryData(e,t,r),setQueriesData:(e,t,r,i)=>n.setQueriesData((0,Q.default)((0,Q.default)({},t),{},{queryKey:e}),r,i),getQueryData:e=>n.getQueryData(e),setInfiniteQueryData:(e,t,r)=>n.setQueryData(e,t,r),getInfiniteQueryData:e=>n.getQueryData(e),setMutationDefaults:(t,i)=>{let a=t[0];return n.setMutationDefaults(t,typeof i==`function`?i({canonicalMutationFn:t=>r.mutation(...NE([a,{input:t}],e))}):i)},getMutationDefaults:e=>n.getMutationDefaults(e),isMutating:e=>n.isMutating((0,Q.default)((0,Q.default)({},e),{},{exact:!0}))}}var $=dE(vE());const zE=(e,t)=>new Proxy(e,{get(e,n){return t(n),e[n]}});function BE(e){var t;let n=(e==null||(t=e.overrides)==null||(t=t.useMutation)==null?void 0:t.onSuccess)??(e=>e.originalFn()),r=e?.context??EE,i=ZT,a=e=>{let{abortOnUnmount:t=!1,queryClient:n,ssrContext:i}=e,[a,o]=Z.useState(e.ssrState??!1),s=e.client instanceof KT?e.client:QT(e.client),c=Z.useMemo(()=>RE({client:s,queryClient:n}),[s,n]),l=Z.useMemo(()=>(0,$.default)({abortOnUnmount:t,queryClient:n,client:s,ssrContext:i??null,ssrState:a},c),[t,s,c,n,i,a]);return Z.useEffect(()=>{o(e=>e?`mounted`:!1)},[]),(0,Iw.jsx)(r.Provider,{value:l,children:e.children})};function o(){let e=Z.useContext(r);if(!e)throw Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return e}function s(e,t){let{queryClient:n,ssrState:r}=o();return r&&r!==`mounted`&&n.getQueryCache().find({queryKey:e})?.state.status===`error`?(0,$.default)({retryOnMount:!1},t):t}function c(t,n,r){var i,a;let{abortOnUnmount:c,client:l,ssrState:u,queryClient:d,prefetchQuery:f}=o(),p=SE(t,n,`query`),m=d.getQueryDefaults(p),h=n===sw;typeof window>`u`&&u===`prepass`&&(r==null||(i=r.trpc)==null?void 0:i.ssr)!==!1&&(r?.enabled??m?.enabled)!==!1&&!h&&!d.getQueryCache().find({queryKey:p})&&f(p,r);let g=s(p,(0,$.default)((0,$.default)({},m),r)),_=(r==null||(a=r.trpc)==null?void 0:a.abortOnUnmount)??e?.abortOnUnmount??c,v=eT((0,$.default)((0,$.default)({},g),{},{queryKey:p,queryFn:h?n:async e=>{let t=(0,$.default)((0,$.default)({},g),{},{trpc:(0,$.default)((0,$.default)({},g?.trpc),_?{signal:e.signal}:{signal:null})}),n=await l.query(...NE(p,t));return jg(n)?LE(n,d,p):n}}),d);return v.trpc=IE({path:t}),v}function l(t,n,r){var i;let a=o(),s=SE(t,n,`query`),c=n===sw,l=(r==null||(i=r.trpc)==null?void 0:i.abortOnUnmount)??e?.abortOnUnmount??a.abortOnUnmount;iT((0,$.default)((0,$.default)({},r),{},{queryKey:s,queryFn:c?n:e=>{let t={trpc:(0,$.default)((0,$.default)({},r?.trpc),l?{signal:e.signal}:{})};return a.client.query(...NE(s,t))}}))}function u(t,n,r){var i;let a=o(),s=SE(t,n,`query`),c=(r==null||(i=r.trpc)==null?void 0:i.abortOnUnmount)??e?.abortOnUnmount??a.abortOnUnmount,l=tT((0,$.default)((0,$.default)({},r),{},{queryKey:s,queryFn:e=>{let t=(0,$.default)((0,$.default)({},r),{},{trpc:(0,$.default)((0,$.default)({},r?.trpc),c?{signal:e.signal}:{signal:null})});return a.client.query(...NE(s,t))}}),a.queryClient);return l.trpc=IE({path:t}),[l.data,l]}function d(e,t){let{client:r,queryClient:i}=o(),a=CE(e),s=i.defaultMutationOptions(i.getMutationDefaults(a)),c=cT((0,$.default)((0,$.default)({},t),{},{mutationKey:a,mutationFn:n=>r.mutation(...NE([e,{input:n}],t)),onSuccess(...e){return n({originalFn:()=>{var n,r;return(t==null||(n=t.onSuccess)==null?void 0:n.call(t,...e))??(s==null||(r=s.onSuccess)==null?void 0:r.call(s,...e))},queryClient:i,meta:t?.meta??s?.meta??{}})}}),i);return c.trpc=IE({path:e}),c}let f={data:void 0,error:null,status:`idle`},p={data:void 0,error:null,status:`connecting`};function m(e,t,n){let r=n?.enabled??t!==sw,i=ZC(SE(e,t,`any`)),{client:a}=o(),s=Z.useRef(n);Z.useEffect(()=>{s.current=n});let[c]=Z.useState(new Set([])),l=Z.useCallback(e=>{c.add(e)},[c]),u=Z.useRef(null),d=Z.useCallback(e=>{let t=h.current,n=h.current=e(t),r=!1;for(let e of c)if(t[e]!==n[e]){r=!0;break}r&&_(zE(n,l))},[l,c]),m=Z.useCallback(()=>{var n;if((n=u.current)==null||n.unsubscribe(),!r){d(()=>(0,$.default)((0,$.default)({},f),{},{reset:m}));return}d(()=>(0,$.default)((0,$.default)({},p),{},{reset:m})),u.current=a.subscription(e.join(`.`),t??void 0,{onStarted:()=>{var e,t;(e=(t=s.current).onStarted)==null||e.call(t),d(e=>(0,$.default)((0,$.default)({},e),{},{status:`pending`,error:null}))},onData:e=>{var t,n;(t=(n=s.current).onData)==null||t.call(n,e),d(t=>(0,$.default)((0,$.default)({},t),{},{status:`pending`,data:e,error:null}))},onError:e=>{var t,n;(t=(n=s.current).onError)==null||t.call(n,e),d(t=>(0,$.default)((0,$.default)({},t),{},{status:`error`,error:e}))},onConnectionStateChange:e=>{d(t=>{switch(e.state){case`idle`:return(0,$.default)((0,$.default)({},t),{},{status:e.state,error:null,data:void 0});case`connecting`:return(0,$.default)((0,$.default)({},t),{},{error:e.error,status:e.state});case`pending`:return t}})},onComplete:()=>{var e,t;(e=(t=s.current).onComplete)==null||e.call(t),d(e=>(0,$.default)((0,$.default)({},e),{},{status:`idle`,error:null,data:void 0}))}})},[a,i,r,d]);Z.useEffect(()=>(m(),()=>{var e;(e=u.current)==null||e.unsubscribe()}),[m]);let h=Z.useRef(r?(0,$.default)((0,$.default)({},p),{},{reset:m}):(0,$.default)((0,$.default)({},f),{},{reset:m})),[g,_]=Z.useState(zE(h.current,l));return g}function h(e,t,n){var r,i;let{client:a,ssrState:c,prefetchInfiniteQuery:l,queryClient:u,abortOnUnmount:d}=o(),f=SE(e,t,`infinite`),p=u.getQueryDefaults(f),m=t===sw;typeof window>`u`&&c===`prepass`&&(n==null||(r=n.trpc)==null?void 0:r.ssr)!==!1&&(n?.enabled??p?.enabled)!==!1&&!m&&!u.getQueryCache().find({queryKey:f})&&l(f,(0,$.default)((0,$.default)({},p),n));let h=s(f,(0,$.default)((0,$.default)({},p),n)),g=(n==null||(i=n.trpc)==null?void 0:i.abortOnUnmount)??d,_=lT((0,$.default)((0,$.default)({},h),{},{initialPageParam:n.initialCursor??null,persister:n.persister,queryKey:f,queryFn:m?t:e=>{let t=(0,$.default)((0,$.default)({},h),{},{trpc:(0,$.default)((0,$.default)({},h?.trpc),g?{signal:e.signal}:{signal:null})});return a.query(...NE(f,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),u);return _.trpc=IE({path:e}),_}function g(e,t,n){var r;let i=o(),a=SE(e,t,`infinite`),c=i.queryClient.getQueryDefaults(a),l=t===sw,u=s(a,(0,$.default)((0,$.default)({},c),n)),d=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??i.abortOnUnmount;aT((0,$.default)((0,$.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:a,queryFn:l?t:e=>{let t=(0,$.default)((0,$.default)({},u),{},{trpc:(0,$.default)((0,$.default)({},u?.trpc),d?{signal:e.signal}:{})});return i.client.query(...NE(a,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}))}function _(e,t,n){var r;let i=o(),a=SE(e,t,`infinite`),c=i.queryClient.getQueryDefaults(a),l=s(a,(0,$.default)((0,$.default)({},c),n)),u=(n==null||(r=n.trpc)==null?void 0:r.abortOnUnmount)??i.abortOnUnmount,d=nT((0,$.default)((0,$.default)({},n),{},{initialPageParam:n.initialCursor??null,queryKey:a,queryFn:e=>{let t=(0,$.default)((0,$.default)({},l),{},{trpc:(0,$.default)((0,$.default)({},l?.trpc),u?{signal:e.signal}:{})});return i.client.query(...NE(a,t,{pageParam:e.pageParam??n.initialCursor,direction:e.direction}))}}),i.queryClient);return d.trpc=IE({path:e}),[d.data,d]}return{Provider:a,createClient:i,useContext:o,useUtils:o,useQuery:c,usePrefetchQuery:l,useSuspenseQuery:u,useQueries:(e,t)=>{let{ssrState:n,queryClient:r,prefetchQuery:i,client:a}=o(),s=e(jE(a));if(typeof window>`u`&&n===`prepass`)for(let e of s){let t=e;t.trpc?.ssr!==!1&&!r.getQueryCache().find({queryKey:t.queryKey})&&i(t.queryKey,t)}return Qw({queries:s.map(e=>(0,$.default)((0,$.default)({},e),{},{queryKey:e.queryKey})),combine:t?.combine},r)},useSuspenseQueries:e=>{let{queryClient:t,client:n}=o(),r=rT({queries:e(jE(n)).map(e=>(0,$.default)((0,$.default)({},e),{},{queryFn:e.queryFn,queryKey:e.queryKey}))},t);return[r.map(e=>e.data),r]},useMutation:d,useSubscription:m,useInfiniteQuery:h,usePrefetchInfiniteQuery:g,useSuspenseInfiniteQuery:_}}function VE(e){let t=wE(e);return Gg(n=>n===`useContext`||n===`useUtils`?()=>{let t=e.useUtils();return Z.useMemo(()=>kE(t),[t])}:e.hasOwnProperty(n)?e[n]:t[n])}function HE(e){return VE(BE(e))}HE();const UE={allowedExtensions:[`jpg`,`jpeg`,`png`,`gif`,`svg`,`webp`,`mp4`,`webm`,`mp3`,`wav`,`pdf`,`doc`,`docx`,`xls`,`xlsx`,`ppt`,`pptx`,`txt`,`md`,`csv`],allowedContentTypes:[`image/`,`video/`,`audio/`,`application/pdf`,`application/msword`,`application/vnd.ms-`,`application/vnd.openxmlformats`,`text/`],maxFileSizes:{direct:100*1024*1024,server:10*1024*1024}};function WE(e){return UE.allowedContentTypes.some(t=>e.startsWith(t))}function GE(e){let t=e||UE.allowedExtensions,n=[],r=[];for(let e of t)r.push(`.${e}`),[`jpg`,`jpeg`].includes(e)?n.push(`image/jpeg`):e===`png`?n.push(`image/png`):e===`gif`?n.push(`image/gif`):e===`svg`?n.push(`image/svg+xml`):e===`webp`?n.push(`image/webp`):e===`mp4`?n.push(`video/mp4`):e===`webm`?n.push(`video/webm`):e===`mp3`?n.push(`audio/mpeg`):e===`wav`?n.push(`audio/wav`):e===`pdf`?n.push(`application/pdf`):e===`doc`?n.push(`application/msword`):e===`docx`?n.push(`application/vnd.openxmlformats-officedocument.wordprocessingml.document`):e===`xls`?n.push(`application/vnd.ms-excel`):e===`xlsx`?n.push(`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`):e===`ppt`?n.push(`application/vnd.ms-powerpoint`):e===`pptx`?n.push(`application/vnd.openxmlformats-officedocument.presentationml.presentation`):e===`txt`?n.push(`text/plain`):e===`md`?n.push(`text/markdown`):e===`csv`&&n.push(`text/csv`);return[...new Set([...n,...r])].join(`,`)}function KE(e,t){let n=e.split(`.`).pop()?.toLowerCase(),r=n===`xml`&&t===`image/svg+xml`?`svg`:n;if(!r||!UE.allowedExtensions.includes(r))throw Error(`File extension ".${n}" is not allowed. Allowed extensions: ${UE.allowedExtensions.join(`, `)}`);if(!WE(t))throw Error(`Content type "${t}" is not allowed. Allowed types: ${UE.allowedContentTypes.join(`, `)}`)}GE([`jpg`,`jpeg`,`png`]),GE([`jpg`,`jpeg`,`png`,`gif`,`svg`,`webp`]),UE.maxFileSizes.server,GE([`pdf`,`doc`,`docx`,`xls`,`xlsx`,`ppt`,`pptx`]),UE.maxFileSizes.direct,GE(),s();function qE(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}Array(12).fill(0);let JE=1;const YE=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:JE++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],Z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ZE(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!Z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!Z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||JE++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},XE=(e,t)=>{let n=t?.id||JE++;return YE.addToast({title:e,...t,id:n}),n},ZE=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,QE=XE;Object.assign(QE,{success:YE.success,info:YE.info,warning:YE.warning,error:YE.error,custom:YE.custom,message:YE.message,promise:YE.promise,dismiss:YE.dismiss,loading:YE.loading},{getHistory:()=>YE.toasts,getToasts:()=>YE.getActiveToasts()}),qE(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function $E(e){return{key:`download`,label:`translation:admin.storage.actions.download`,bulk:!1,icon:`download`,onSuccess:e=>({type:`download`,url:e.url,filename:e.filename}),...e}}function eD(e){return{key:`preview`,label:`translation:admin.storage.actions.preview`,bulk:!1,icon:`eye`,onSuccess:e=>import(`./file-preview-dialog-Cugg8tEc.mjs`).then(t=>({type:`modal`,component:t.FilePreviewDialog,props:{url:e.url,contentType:e.contentType,filename:e.filename}})),...e}}function tD(e){return{key:`delete`,label:`translation:admin.storage.actions.delete`,bulk:!0,confirmation:!0,icon:`trash`,standalone:!0,onSuccess:()=>({type:`message`,message:`translation:admin.storage.actions.deleteSuccess`,variant:`success`}),...e}}const nD={pagination:{type:`cursor`,defaultPageSize:25,pageSizeOptions:[25,50,100],cursorColumn:`createdAt`,tiebreaker:`id`},fields:[{key:`filename`,label:`translation:admin.storage.fields.filename`,searchable:!0,sortable:!0},{key:`contentType`,label:`translation:admin.storage.fields.contentType`},{key:`byteSize`,label:`translation:admin.storage.fields.byteSize`,sortable:!0,format:`bytes`},{key:`serviceName`,label:`translation:admin.storage.fields.serviceName`},{key:`createdAt`,label:`translation:admin.storage.fields.createdAt`,sortable:!0,format:`datetime`}],filters:[{key:`contentType`,label:`translation:admin.storage.filters.contentType.label`,type:`select`,options:[{value:`image/%`,label:`translation:admin.storage.filters.contentType.options.images`},{value:`video/%`,label:`translation:admin.storage.filters.contentType.options.videos`},{value:`audio/%`,label:`translation:admin.storage.filters.contentType.options.audio`},{value:`application/pdf`,label:`translation:admin.storage.filters.contentType.options.pdfs`},{value:`text/markdown`,label:`translation:admin.storage.filters.contentType.options.markdown`},{value:`text/%`,label:`translation:admin.storage.filters.contentType.options.text`}]},{key:`serviceName`,label:`translation:admin.storage.filters.serviceName.label`,type:`select`,options:[{value:`private`,label:`translation:admin.storage.filters.serviceName.options.private`},{value:`public`,label:`translation:admin.storage.filters.serviceName.options.public`}]}],actions:[$E(),eD(),tD()]},rD=Wh(e=>typeof e==`string`),iD=jS({table:LC,...nD}),aD={getUploadUrl:Qv.input(J({filename:K().min(1).max(255),contentType:K(),serviceName:rh([`private`,`public`]).optional(),metadata:Xm(K(),Em()).optional()})).mutation(async({input:e,ctx:t})=>{KE(e.filename,e.contentType);let n=await t.container.storage.getDirectUploadUrl(e);return n?{...n,method:`PUT`}:{method:`POST`}}),finalizeUpload:Qv.input(J({blobId:K(),actualSize:am().positive().max(UE.maxFileSizes.direct)})).mutation(async({input:e,ctx:t})=>(await t.container.storage.finalizeDirectUpload(e.blobId,e.actualSize),t.workflows&&await t.workflows.extractBlobMetadata({blobId:e.blobId}),{success:!0})),createBlob:Qv.input(J({contentType:K().optional(),file:K().max(14e6),filename:K().min(1).max(255),metadata:Xm(K(),Em()).optional(),serviceName:rh([`private`,`public`]).optional()})).mutation(async({input:e,ctx:t})=>{if(e.contentType?.trim())KE(e.filename,e.contentType);else{let t=e.filename.split(`.`).pop()?.toLowerCase();if(!t||!UE.allowedExtensions.includes(t))throw Error(`File extension ".${t}" is not allowed. Allowed extensions: ${UE.allowedExtensions.join(`, `)}`)}let n=Buffer.from(e.file,`base64`),r=UE.maxFileSizes.server;if(n.byteLength>r)throw Error(`File size ${n.byteLength} exceeds maximum ${r} bytes`);let i=await t.container.storage.createBlob(n,{contentType:e.contentType,filename:e.filename,metadata:e.metadata,serviceName:e.serviceName});return t.workflows&&await t.workflows.extractBlobMetadata({blobId:i.id}),i}),attach:Qv.input(J({tableName:rD,recordId:K(),blobId:K().or(Im(K())),name:K(),type:rh([`one`,`many`]).default(`one`)})).mutation(async({input:e,ctx:t})=>{let{attachments:n}=t.container;if(e.type===`one`){let t=Array.isArray(e.blobId)?e.blobId[0]:e.blobId;return n.one(e.tableName,e.recordId,e.name).attach(t)}let r=Array.isArray(e.blobId)?e.blobId:[e.blobId];return n.many(e.tableName,e.recordId,e.name).attach(r)}),getAttachmentUrls:Qv.input(J({tableName:rD,recordId:K(),name:K(),type:rh([`one`,`many`]),expiresIn:am().optional()})).query(async({input:e,ctx:t})=>{let{attachments:n}=t.container;return e.type===`one`?{type:`one`,url:await n.one(e.tableName,e.recordId,e.name).url(e.expiresIn)}:{type:`many`,urls:await n.many(e.tableName,e.recordId,e.name).urls(e.expiresIn)}}),getAttachments:Qv.input(J({tableName:rD,recordId:K(),name:K(),type:rh([`one`,`many`])})).query(async({input:e,ctx:t})=>{let{attachments:n}=t.container;return e.type===`one`?{type:`one`,blob:await n.one(e.tableName,e.recordId,e.name).get()}:{type:`many`,blobs:await n.many(e.tableName,e.recordId,e.name).list()}}),detach:Qv.input(J({tableName:rD,recordId:K(),name:K(),type:rh([`one`,`many`]),blobId:K().optional()})).mutation(async({input:e,ctx:t})=>{let{attachments:n}=t.container;if(e.type===`one`)return{success:await n.one(e.tableName,e.recordId,e.name).detach()};let r=await n.many(e.tableName,e.recordId,e.name).detach(e.blobId);return{success:r>0,count:r}}),getSignedUrl:Qv.input(J({blobId:K(),expiresIn:am().optional()})).query(async({input:e,ctx:t})=>t.container.storage.getSignedUrl(e.blobId,{expiresIn:e.expiresIn})),deleteBlob:Qv.input(J({blobId:K()})).mutation(async({input:e,ctx:t})=>({success:await t.container.storage.deleteBlob(e.blobId)})),getVariant:Qv.input(J({blobId:K(),transformations:BC,expiresIn:am().optional()})).query(async({input:e,ctx:t})=>{let n=await t.container.storage.getVariant(e.blobId,e.transformations);return n?{status:`ready`,url:await t.container.storage.getSignedUrl(n.id,{expiresIn:e.expiresIn})}:(t.workflows&&await t.workflows.generateImageVariant({blobId:e.blobId,transformations:e.transformations}),{status:`generating`,url:null})}),requestVariant:Qv.input(J({blobId:K(),transformations:BC})).mutation(async({input:e,ctx:t})=>await t.container.storage.getVariant(e.blobId,e.transformations)?{status:`ready`}:(t.workflows&&await t.workflows.generateImageVariant({blobId:e.blobId,transformations:e.transformations}),{status:`enqueued`})),getMetadata:Qv.input(J({blobId:K()})).query(async({input:e,ctx:t})=>(await t.container.storage.getBlob(e.blobId))?.metadata||null)},oD={storage:{listCursor:$v.input(J({cursor:K().optional(),cursorBefore:K().optional(),pageSize:am().min(1).max(200).optional(),filters:Xm(K(),Hm([K(),am()])).optional(),search:K().optional(),orderBy:J({column:rh(Object.keys(nt(LC))),direction:rh([`asc`,`desc`])}).optional()})).query(async({input:e,ctx:t})=>iD.createQueryBuilder(t.container.db.appos).listCursor(e)),listOffset:$v.input(J({page:am().min(1).optional(),pageSize:am().min(1).max(200).optional(),filters:Xm(K(),Hm([K(),am()])).optional(),search:K().optional(),orderBy:J({column:rh(Object.keys(nt(LC))),direction:rh([`asc`,`desc`])}).optional()})).query(async({input:e,ctx:t})=>iD.createQueryBuilder(t.container.db.appos).listOffset(e)),get:$v.input(J({id:K()})).query(async({input:e,ctx:t})=>(await t.container.db.appos.select().from(LC).where(Ae(LC.id,e.id)).limit(1))[0]||null),actions:{download:$v.input(J({id:K().nullable().optional(),ids:Im(K()).nullable().optional()})).mutation(async({input:e,ctx:t})=>{if(!e.id)throw Error(`ID required`);let n=(await t.container.db.appos.select().from(LC).where(Ae(LC.id,e.id)).limit(1))[0];if(!n)throw Error(`Blob not found`);return{url:await t.container.storage.getSignedUrl(e.id,{expiresIn:3600,disposition:`attachment`,filename:n.filename}),filename:n.filename}}),preview:$v.input(J({id:K().nullable().optional(),ids:Im(K()).nullable().optional()})).mutation(async({input:e,ctx:t})=>{if(!e.id)throw Error(`ID required`);let n=(await t.container.db.appos.select().from(LC).where(Ae(LC.id,e.id)).limit(1))[0];if(!n)throw Error(`File not found`);if(![`image/`,`video/`,`audio/`,`application/pdf`,`text/markdown`,`text/`].some(e=>n.contentType?.startsWith(e)))throw Error(`Preview not available for this file type. Supported: images, videos, audio, PDFs, markdown, and text files.`);return{contentType:n.contentType,filename:n.filename,url:await t.container.storage.getSignedUrl(e.id,{disposition:`inline`,filename:n.filename})}}),delete:$v.input(J({id:K().nullable().optional(),ids:Im(K()).nullable().optional()})).mutation(async({input:e,ctx:t})=>{let n=e.ids||(e.id?[e.id]:[]);return await Promise.all(n.map(e=>t.container.storage.deleteBlob(e))),{deleted:n.length}})}}},sD={me:Qv.query(async({ctx:e})=>({user:e.user,session:e.session})),updateProfile:Qv.input(J({name:K().min(1).max(255).optional(),image:xp().optional()})).mutation(async()=>({success:!0,message:`Profile updated successfully`})),listSessions:Qv.query(async()=>({sessions:[]})),revokeSession:Qv.input(J({sessionId:K()})).mutation(async()=>({success:!0,message:`Session revoked successfully`})),listApiKeys:Qv.query(async()=>({apiKeys:[]})),createApiKey:Qv.input(J({name:K().min(1).max(255),expiresIn:am().optional()})).mutation(async()=>({success:!0,message:`API key created successfully`})),revokeApiKey:Qv.input(J({keyId:K()})).mutation(async()=>({success:!0,message:`API key revoked successfully`}))},cD={},lD={},uD={},dD={};async function fD(){let e=lg(),t=l(process.cwd(),e,`trpc`);try{let e=await c(t),n={};for(let r of e.filter(e=>/\.(ts|js)$/.test(e)&&!e.includes(`.test.`))){let e=r.replace(/\.(ts|js)$/,``),i=l(t,r),a=(await(ug()?import(`${i}?t=${Date.now()}`):import(i))).default;a&&(n[e]=a)}return n}catch{return{}}}const pD=Yv({admin:oD,auth:sD,billing:cD,docs:lD,notifications:uD,site:dD,storage:aD,...await fD()});var mD=wS.DBOS;export{mD as Workflow,$v as adminProcedure,pD as appRouter,ty as createProcedure,wr as defineAuthSchema,Sg as defineOpenAPI,Cg as defineOpenAPIConfig,pg as defineOpenAPIEndpoint,ES as defineScheduledWorkflow,wg as defineStorageSchema,TS as defineWorkflow,Xv as middleware,ey as orgMemberProcedure,Qv as protectedProcedure,Zv as publicProcedure,Yv as router};