@verdocs/web-sdk 4.1.14 → 4.1.16

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 (175) hide show
  1. package/dist/cjs/{EnvelopeStore-db4f3f17.js → EnvelopeStore-4aeb54e1.js} +1 -1
  2. package/dist/cjs/{TemplateStore-037833e5.js → TemplateStore-7c7f1c50.js} +1 -1
  3. package/dist/cjs/{index-a5472099.js → index-2a189d85.js} +0 -517
  4. package/dist/cjs/index-cfdfab36.js +12 -24
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  7. package/dist/cjs/{verdocs-button-panel.cjs.entry.js → verdocs-button-panel_2.cjs.entry.js} +21 -0
  8. package/dist/cjs/{verdocs-checkbox_3.cjs.entry.js → verdocs-checkbox_4.cjs.entry.js} +17 -2
  9. package/dist/cjs/{verdocs-dialog_2.cjs.entry.js → verdocs-dialog.cjs.entry.js} +0 -22
  10. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +2 -2
  11. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +3 -4
  12. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +10 -11
  13. package/dist/cjs/verdocs-preview_10.cjs.entry.js +15 -13
  14. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-table.cjs.entry.js +28 -0
  16. package/dist/cjs/verdocs-templates-list.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  18. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +0 -5
  20. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +13 -11
  21. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +1 -1
  22. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -2
  23. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +10 -11
  24. package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +2 -2
  25. package/dist/components/EnvelopeStore.js +2 -2
  26. package/dist/components/TemplateFieldStore.js +1 -1
  27. package/dist/components/TemplateRoleStore.js +1 -1
  28. package/dist/components/TemplateStore.js +2 -2
  29. package/dist/components/index.js +0 -10
  30. package/dist/components/index3.js +166 -4207
  31. package/dist/components/index4.js +3692 -167
  32. package/dist/components/verdocs-dialog.js +37 -1
  33. package/dist/components/verdocs-envelope-sidebar.js +1 -2
  34. package/dist/components/verdocs-envelopes-list.js +10 -11
  35. package/dist/components/verdocs-send2.js +13 -11
  36. package/dist/components/verdocs-table.js +39 -1
  37. package/dist/components/verdocs-templates-list.js +2 -2
  38. package/dist/components/verdocs-view2.js +1 -1
  39. package/dist/custom-elements.json +2086 -0
  40. package/dist/esm/{EnvelopeStore-9df042b5.js → EnvelopeStore-1ed5dc8f.js} +1 -1
  41. package/dist/esm/{TemplateStore-78ad24d7.js → TemplateStore-7d41d941.js} +1 -1
  42. package/dist/esm/{index-7456b04f.js → index-7588a071.js} +1 -517
  43. package/dist/esm/index-b89cf6a4.js +12 -24
  44. package/dist/esm/loader.js +1 -1
  45. package/dist/esm/verdocs-build.entry.js +2 -2
  46. package/dist/esm/{verdocs-button-panel.entry.js → verdocs-button-panel_2.entry.js} +22 -2
  47. package/dist/esm/{verdocs-checkbox_3.entry.js → verdocs-checkbox_4.entry.js} +17 -3
  48. package/dist/{components/verdocs-dialog2.js → esm/verdocs-dialog.entry.js} +7 -21
  49. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +2 -2
  50. package/dist/esm/verdocs-envelope-sidebar.entry.js +3 -4
  51. package/dist/esm/verdocs-envelopes-list.entry.js +10 -11
  52. package/dist/esm/verdocs-preview_10.entry.js +15 -13
  53. package/dist/esm/verdocs-radio-button_3.entry.js +2 -2
  54. package/dist/{components/verdocs-table2.js → esm/verdocs-table.entry.js} +7 -24
  55. package/dist/esm/verdocs-templates-list.entry.js +2 -2
  56. package/dist/esm/verdocs-view.entry.js +1 -1
  57. package/dist/esm/verdocs-web-sdk.js +1 -1
  58. package/dist/esm-es5/{EnvelopeStore-9df042b5.js → EnvelopeStore-1ed5dc8f.js} +1 -1
  59. package/dist/esm-es5/{TemplateStore-78ad24d7.js → TemplateStore-7d41d941.js} +1 -1
  60. package/dist/esm-es5/index-7588a071.js +1 -0
  61. package/dist/esm-es5/index-b89cf6a4.js +1 -1
  62. package/dist/esm-es5/loader.js +1 -1
  63. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  64. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -0
  65. package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -0
  66. package/dist/esm-es5/{verdocs-dialog_2.entry.js → verdocs-dialog.entry.js} +1 -1
  67. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-table.entry.js +1 -0
  73. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  76. package/dist/types/components.d.ts +2 -322
  77. package/dist/verdocs-web-sdk/{p-5961ce51.entry.js → p-0d54abe5.entry.js} +1 -1
  78. package/dist/verdocs-web-sdk/p-1f771dad.entry.js +1 -0
  79. package/dist/verdocs-web-sdk/{p-95e90092.system.entry.js → p-2be9ba53.system.entry.js} +1 -1
  80. package/dist/verdocs-web-sdk/p-30513f94.entry.js +1 -0
  81. package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
  82. package/dist/verdocs-web-sdk/p-3f4b3548.system.entry.js +1 -0
  83. package/dist/verdocs-web-sdk/{p-5309a156.system.entry.js → p-413ab8a1.system.entry.js} +1 -1
  84. package/dist/verdocs-web-sdk/{p-16850eac.system.entry.js → p-48fce604.system.entry.js} +1 -1
  85. package/dist/verdocs-web-sdk/p-61257cb2.entry.js +1 -0
  86. package/dist/verdocs-web-sdk/{p-225418c7.entry.js → p-687c07ad.entry.js} +1 -1
  87. package/dist/verdocs-web-sdk/p-73f45012.system.entry.js +1 -0
  88. package/dist/verdocs-web-sdk/{p-7fe48d2e.entry.js → p-78908c67.entry.js} +1 -1
  89. package/dist/verdocs-web-sdk/{p-5e3e9c4a.system.js → p-889cc411.system.js} +1 -1
  90. package/dist/verdocs-web-sdk/p-9440752e.system.entry.js +1 -0
  91. package/dist/verdocs-web-sdk/{p-f05a3654.system.entry.js → p-977a5a4b.system.entry.js} +1 -1
  92. package/dist/verdocs-web-sdk/{p-540d9467.entry.js → p-9d36d2ad.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/p-a706bac9.js +1 -0
  94. package/dist/verdocs-web-sdk/p-b3017cd6.entry.js +1 -0
  95. package/dist/verdocs-web-sdk/{p-316b550f.entry.js → p-b61842bd.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/{p-03aedbe9.system.entry.js → p-b6b6f12a.system.entry.js} +1 -1
  97. package/dist/verdocs-web-sdk/{p-0e022e75.system.entry.js → p-b7397955.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/p-ba6570b4.system.entry.js +1 -0
  99. package/dist/verdocs-web-sdk/{p-afbbdc2f.system.js → p-c8de3052.system.js} +1 -1
  100. package/dist/verdocs-web-sdk/p-cf7f4475.entry.js +1 -0
  101. package/dist/verdocs-web-sdk/{p-8a820b88.system.entry.js → p-d2feac5b.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/p-e7578fac.entry.js +1 -0
  103. package/dist/verdocs-web-sdk/{p-c28c4e43.js → p-f02e08da.js} +1 -1
  104. package/dist/verdocs-web-sdk/p-f5064e0c.system.js +1 -0
  105. package/dist/verdocs-web-sdk/{p-5df130eb.entry.js → p-f632ffac.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-9ec464df.js → p-fc2ae858.js} +1 -1
  107. package/dist/verdocs-web-sdk/p-fc5e568d.system.entry.js +1 -0
  108. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  109. package/package.json +2 -3
  110. package/dist/cjs/verdocs-component-error.cjs.entry.js +0 -21
  111. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +0 -542
  112. package/dist/cjs/verdocs-settings.cjs.entry.js +0 -42
  113. package/dist/cjs/verdocs-tabs.cjs.entry.js +0 -27
  114. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.css +0 -40
  115. package/dist/collection/components/embeds/verdocs-settings/verdocs-settings.js +0 -104
  116. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.css +0 -64
  117. package/dist/collection/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.js +0 -292
  118. package/dist/collection/components/settings/verdocs-settings-members/verdocs-settings-members.css +0 -80
  119. package/dist/collection/components/settings/verdocs-settings-members/verdocs-settings-members.js +0 -349
  120. package/dist/collection/components/settings/verdocs-settings-organization/TimeZones.js +0 -144
  121. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.css +0 -44
  122. package/dist/collection/components/settings/verdocs-settings-organization/verdocs-settings-organization.js +0 -192
  123. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.css +0 -44
  124. package/dist/collection/components/settings/verdocs-settings-profile/verdocs-settings-profile.js +0 -190
  125. package/dist/components/verdocs-settings-api-keys.d.ts +0 -11
  126. package/dist/components/verdocs-settings-api-keys.js +0 -6
  127. package/dist/components/verdocs-settings-api-keys2.js +0 -209
  128. package/dist/components/verdocs-settings-members.d.ts +0 -11
  129. package/dist/components/verdocs-settings-members.js +0 -6
  130. package/dist/components/verdocs-settings-members2.js +0 -273
  131. package/dist/components/verdocs-settings-organization.d.ts +0 -11
  132. package/dist/components/verdocs-settings-organization.js +0 -6
  133. package/dist/components/verdocs-settings-organization2.js +0 -142
  134. package/dist/components/verdocs-settings-profile.d.ts +0 -11
  135. package/dist/components/verdocs-settings-profile.js +0 -6
  136. package/dist/components/verdocs-settings-profile2.js +0 -140
  137. package/dist/components/verdocs-settings.d.ts +0 -11
  138. package/dist/components/verdocs-settings.js +0 -130
  139. package/dist/esm/verdocs-component-error.entry.js +0 -17
  140. package/dist/esm/verdocs-dialog_2.entry.js +0 -46
  141. package/dist/esm/verdocs-settings-api-keys_4.entry.js +0 -535
  142. package/dist/esm/verdocs-settings.entry.js +0 -38
  143. package/dist/esm/verdocs-tabs.entry.js +0 -23
  144. package/dist/esm-es5/index-7456b04f.js +0 -1
  145. package/dist/esm-es5/verdocs-button-panel.entry.js +0 -1
  146. package/dist/esm-es5/verdocs-checkbox_3.entry.js +0 -1
  147. package/dist/esm-es5/verdocs-component-error.entry.js +0 -1
  148. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +0 -1
  149. package/dist/esm-es5/verdocs-settings.entry.js +0 -1
  150. package/dist/esm-es5/verdocs-tabs.entry.js +0 -1
  151. package/dist/types/components/embeds/verdocs-settings/verdocs-settings.d.ts +0 -26
  152. package/dist/types/components/settings/verdocs-settings-api-keys/verdocs-settings-api-keys.d.ts +0 -54
  153. package/dist/types/components/settings/verdocs-settings-members/verdocs-settings-members.d.ts +0 -58
  154. package/dist/types/components/settings/verdocs-settings-organization/TimeZones.d.ts +0 -1
  155. package/dist/types/components/settings/verdocs-settings-organization/verdocs-settings-organization.d.ts +0 -37
  156. package/dist/types/components/settings/verdocs-settings-profile/verdocs-settings-profile.d.ts +0 -37
  157. package/dist/verdocs-web-sdk/p-03f8d33f.entry.js +0 -1
  158. package/dist/verdocs-web-sdk/p-12c26b19.system.entry.js +0 -1
  159. package/dist/verdocs-web-sdk/p-141a992e.system.entry.js +0 -1
  160. package/dist/verdocs-web-sdk/p-3ecaea8a.system.entry.js +0 -1
  161. package/dist/verdocs-web-sdk/p-45cf0ab5.entry.js +0 -1
  162. package/dist/verdocs-web-sdk/p-4df630c2.system.entry.js +0 -1
  163. package/dist/verdocs-web-sdk/p-515ee177.system.entry.js +0 -1
  164. package/dist/verdocs-web-sdk/p-6fa08e21.system.entry.js +0 -1
  165. package/dist/verdocs-web-sdk/p-708b5430.system.entry.js +0 -1
  166. package/dist/verdocs-web-sdk/p-753d0e16.entry.js +0 -1
  167. package/dist/verdocs-web-sdk/p-952b88fb.system.js +0 -1
  168. package/dist/verdocs-web-sdk/p-971ab2d1.entry.js +0 -1
  169. package/dist/verdocs-web-sdk/p-e42587b7.entry.js +0 -1
  170. package/dist/verdocs-web-sdk/p-efc547dc.entry.js +0 -1
  171. package/dist/verdocs-web-sdk/p-f3b47dfc.js +0 -1
  172. package/dist/verdocs-web-sdk/p-f44b9bd0.entry.js +0 -1
  173. package/dist/verdocs-web-sdk/p-f73b68fb.entry.js +0 -1
  174. package/dist/verdocs-web-sdk/p-fbfdfcd4.system.entry.js +0 -1
  175. package/dist/verdocs-web-sdk/p-fe0c473d.entry.js +0 -1
@@ -1 +0,0 @@
1
- var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function a(e){try{u(n.next(e))}catch(e){s(e)}}function o(e){try{u(n["throw"](e))}catch(e){s(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,o)}u((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(r=0)),r)try{if(n=1,i&&(s=o[0]&2?i["return"]:o[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,o[1])).done)return s;if(i=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;i=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(s=r.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){r.label=o[1];break}if(o[0]===6&&r.label<s[1]){r.label=s[1];s=o;break}if(s&&r.label<s[2]){r.label=s[2];r.ops.push(o);break}if(s[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];i=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++){if(s||!(n in t)){if(!s)s=Array.prototype.slice.call(t,0,n);s[n]=t[n]}}return e.concat(s||Array.prototype.slice.call(t))};var util;(function(e){e.assertEqual=function(e){return e};function t(e){}e.assertIs=t;function r(e){throw new Error}e.assertNever=r;e.arrayToEnum=function(e){var t={};for(var r=0,n=e;r<n.length;r++){var i=n[r];t[i]=i}return t};e.getValidEnumValues=function(t){var r=e.objectKeys(t).filter((function(e){return typeof t[t[e]]!=="number"}));var n={};for(var i=0,s=r;i<s.length;i++){var a=s[i];n[a]=t[a]}return e.objectValues(n)};e.objectValues=function(t){return e.objectKeys(t).map((function(e){return t[e]}))};e.objectKeys=typeof Object.keys==="function"?function(e){return Object.keys(e)}:function(e){var t=[];for(var r in e){if(Object.prototype.hasOwnProperty.call(e,r)){t.push(r)}}return t};e.find=function(e,t){for(var r=0,n=e;r<n.length;r++){var i=n[r];if(t(i))return i}return undefined};e.isInteger=typeof Number.isInteger==="function"?function(e){return Number.isInteger(e)}:function(e){return typeof e==="number"&&isFinite(e)&&Math.floor(e)===e};function n(e,t){if(t===void 0){t=" | "}return e.map((function(e){return typeof e==="string"?"'".concat(e,"'"):e})).join(t)}e.joinValues=n;e.jsonStringifyReplacer=function(e,t){if(typeof t==="bigint"){return t.toString()}return t}})(util||(util={}));var objectUtil;(function(e){e.mergeShapes=function(e,t){return __assign(__assign({},e),t)}})(objectUtil||(objectUtil={}));var ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);var getParsedType=function(e){var t=typeof e;switch(t){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(e)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":if(Array.isArray(e)){return ZodParsedType.array}if(e===null){return ZodParsedType.null}if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function"){return ZodParsedType.promise}if(typeof Map!=="undefined"&&e instanceof Map){return ZodParsedType.map}if(typeof Set!=="undefined"&&e instanceof Set){return ZodParsedType.set}if(typeof Date!=="undefined"&&e instanceof Date){return ZodParsedType.date}return ZodParsedType.object;default:return ZodParsedType.unknown}};var ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);var quotelessJson=function(e){var t=JSON.stringify(e,null,2);return t.replace(/"([^"]+)":/g,"$1:")};var ZodError=function(e){__extends(t,e);function t(t){var r=this.constructor;var n=e.call(this)||this;n.issues=[];n.addIssue=function(e){n.issues=__spreadArray(__spreadArray([],n.issues,true),[e],false)};n.addIssues=function(e){if(e===void 0){e=[]}n.issues=__spreadArray(__spreadArray([],n.issues,true),e,true)};var i=r.prototype;if(Object.setPrototypeOf){Object.setPrototypeOf(n,i)}else{n.__proto__=i}n.name="ZodError";n.issues=t;return n}Object.defineProperty(t.prototype,"errors",{get:function(){return this.issues},enumerable:false,configurable:true});t.prototype.format=function(e){var t=e||function(e){return e.message};var r={_errors:[]};var n=function(e){for(var i=0,s=e.issues;i<s.length;i++){var a=s[i];if(a.code==="invalid_union"){a.unionErrors.map(n)}else if(a.code==="invalid_return_type"){n(a.returnTypeError)}else if(a.code==="invalid_arguments"){n(a.argumentsError)}else if(a.path.length===0){r._errors.push(t(a))}else{var o=r;var u=0;while(u<a.path.length){var d=a.path[u];var c=u===a.path.length-1;if(!c){o[d]=o[d]||{_errors:[]}}else{o[d]=o[d]||{_errors:[]};o[d]._errors.push(t(a))}o=o[d];u++}}}};n(this);return r};t.assert=function(e){if(!(e instanceof t)){throw new Error("Not a ZodError: ".concat(e))}};t.prototype.toString=function(){return this.message};Object.defineProperty(t.prototype,"message",{get:function(){return JSON.stringify(this.issues,util.jsonStringifyReplacer,2)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmpty",{get:function(){return this.issues.length===0},enumerable:false,configurable:true});t.prototype.flatten=function(e){if(e===void 0){e=function(e){return e.message}}var t={};var r=[];for(var n=0,i=this.issues;n<i.length;n++){var s=i[n];if(s.path.length>0){t[s.path[0]]=t[s.path[0]]||[];t[s.path[0]].push(e(s))}else{r.push(e(s))}}return{formErrors:r,fieldErrors:t}};Object.defineProperty(t.prototype,"formErrors",{get:function(){return this.flatten()},enumerable:false,configurable:true});return t}(Error);ZodError.create=function(e){var t=new ZodError(e);return t};var errorMap=function(e,t){var r;switch(e.code){case ZodIssueCode.invalid_type:if(e.received===ZodParsedType.undefined){r="Required"}else{r="Expected ".concat(e.expected,", received ").concat(e.received)}break;case ZodIssueCode.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(e.expected,util.jsonStringifyReplacer));break;case ZodIssueCode.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(util.joinValues(e.keys,", "));break;case ZodIssueCode.invalid_union:r="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(util.joinValues(e.options));break;case ZodIssueCode.invalid_enum_value:r="Invalid enum value. Expected ".concat(util.joinValues(e.options),", received '").concat(e.received,"'");break;case ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case ZodIssueCode.invalid_date:r="Invalid date";break;case ZodIssueCode.invalid_string:if(typeof e.validation==="object"){if("includes"in e.validation){r='Invalid input: must include "'.concat(e.validation.includes,'"');if(typeof e.validation.position==="number"){r="".concat(r," at one or more positions greater than or equal to ").concat(e.validation.position)}}else if("startsWith"in e.validation){r='Invalid input: must start with "'.concat(e.validation.startsWith,'"')}else if("endsWith"in e.validation){r='Invalid input: must end with "'.concat(e.validation.endsWith,'"')}else{util.assertNever(e.validation)}}else if(e.validation!=="regex"){r="Invalid ".concat(e.validation)}else{r="Invalid"}break;case ZodIssueCode.too_small:if(e.type==="array")r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"more than"," ").concat(e.minimum," element(s)");else if(e.type==="string")r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at least":"over"," ").concat(e.minimum," character(s)");else if(e.type==="number")r="Number must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(e.minimum);else if(e.type==="date")r="Date must be ".concat(e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(e.minimum)));else r="Invalid input";break;case ZodIssueCode.too_big:if(e.type==="array")r="Array must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"less than"," ").concat(e.maximum," element(s)");else if(e.type==="string")r="String must contain ".concat(e.exact?"exactly":e.inclusive?"at most":"under"," ").concat(e.maximum," character(s)");else if(e.type==="number")r="Number must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum);else if(e.type==="bigint")r="BigInt must be ".concat(e.exact?"exactly":e.inclusive?"less than or equal to":"less than"," ").concat(e.maximum);else if(e.type==="date")r="Date must be ".concat(e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(e.maximum)));else r="Invalid input";break;case ZodIssueCode.custom:r="Invalid input";break;case ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:r="Number must be a multiple of ".concat(e.multipleOf);break;case ZodIssueCode.not_finite:r="Number must be finite";break;default:r=t.defaultError;util.assertNever(e)}return{message:r}};var overrideErrorMap=errorMap;function setErrorMap(e){overrideErrorMap=e}function getErrorMap(){return overrideErrorMap}var makeIssue=function(e){var t=e.data,r=e.path,n=e.errorMaps,i=e.issueData;var s=__spreadArray(__spreadArray([],r,true),i.path||[],true);var a=__assign(__assign({},i),{path:s});if(i.message!==undefined){return __assign(__assign({},i),{path:s,message:i.message})}var o="";var u=n.filter((function(e){return!!e})).slice().reverse();for(var d=0,c=u;d<c.length;d++){var f=c[d];o=f(a,{data:t,defaultError:o}).message}return __assign(__assign({},i),{path:s,message:o})};var EMPTY_PATH=[];function addIssueToContext(e,t){var r=getErrorMap();var n=makeIssue({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===errorMap?undefined:errorMap].filter((function(e){return!!e}))});e.common.issues.push(n)}var ParseStatus=function(){function e(){this.value="valid"}e.prototype.dirty=function(){if(this.value==="valid")this.value="dirty"};e.prototype.abort=function(){if(this.value!=="aborted")this.value="aborted"};e.mergeArray=function(e,t){var r=[];for(var n=0,i=t;n<i.length;n++){var s=i[n];if(s.status==="aborted")return INVALID;if(s.status==="dirty")e.dirty();r.push(s.value)}return{status:e.value,value:r}};e.mergeObjectAsync=function(t,r){return __awaiter(this,void 0,void 0,(function(){var n,i,s,a,o,u;return __generator(this,(function(d){switch(d.label){case 0:n=[];i=0,s=r;d.label=1;case 1:if(!(i<s.length))return[3,5];a=s[i];return[4,a.key];case 2:o=d.sent();return[4,a.value];case 3:u=d.sent();n.push({key:o,value:u});d.label=4;case 4:i++;return[3,1];case 5:return[2,e.mergeObjectSync(t,n)]}}))}))};e.mergeObjectSync=function(e,t){var r={};for(var n=0,i=t;n<i.length;n++){var s=i[n];var a=s.key,o=s.value;if(a.status==="aborted")return INVALID;if(o.status==="aborted")return INVALID;if(a.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(a.value!=="__proto__"&&(typeof o.value!=="undefined"||s.alwaysSet)){r[a.value]=o.value}}return{status:e.value,value:r}};return e}();var INVALID=Object.freeze({status:"aborted"});var DIRTY=function(e){return{status:"dirty",value:e}};var OK=function(e){return{status:"valid",value:e}};var isAborted=function(e){return e.status==="aborted"};var isDirty=function(e){return e.status==="dirty"};var isValid=function(e){return e.status==="valid"};var isAsync=function(e){return typeof Promise!=="undefined"&&e instanceof Promise};function __classPrivateFieldGet(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function __classPrivateFieldSet(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}typeof SuppressedError==="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};var errorUtil;(function(e){e.errToObj=function(e){return typeof e==="string"?{message:e}:e||{}};e.toString=function(e){return typeof e==="string"?e:e===null||e===void 0?void 0:e.message}})(errorUtil||(errorUtil={}));var _ZodEnum_cache,_ZodNativeEnum_cache;var ParseInputLazyPath=function(){function e(e,t,r,n){this._cachedPath=[];this.parent=e;this.data=t;this._path=r;this._key=n}Object.defineProperty(e.prototype,"path",{get:function(){var e,t;if(!this._cachedPath.length){if(this._key instanceof Array){(e=this._cachedPath).push.apply(e,__spreadArray(__spreadArray([],this._path,false),this._key,false))}else{(t=this._cachedPath).push.apply(t,__spreadArray(__spreadArray([],this._path,false),[this._key],false))}}return this._cachedPath},enumerable:false,configurable:true});return e}();var handleResult=function(e,t){if(isValid(t)){return{success:true,data:t.value}}else{if(!e.common.issues.length){throw new Error("Validation failed but no issues detected.")}return{success:false,get error(){if(this._error)return this._error;var t=new ZodError(e.common.issues);this._error=t;return this._error}}}};function processCreateParams(e){if(!e)return{};var t=e.errorMap,r=e.invalid_type_error,n=e.required_error,i=e.description;if(t&&(r||n)){throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.')}if(t)return{errorMap:t,description:i};var s=function(t,i){var s,a;var o=e.message;if(t.code==="invalid_enum_value"){return{message:o!==null&&o!==void 0?o:i.defaultError}}if(typeof i.data==="undefined"){return{message:(s=o!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:i.defaultError}}if(t.code!=="invalid_type")return{message:i.defaultError};return{message:(a=o!==null&&o!==void 0?o:r)!==null&&a!==void 0?a:i.defaultError}};return{errorMap:s,description:i}}var ZodType=function(){function e(e){this.spa=this.safeParseAsync;this._def=e;this.parse=this.parse.bind(this);this.safeParse=this.safeParse.bind(this);this.parseAsync=this.parseAsync.bind(this);this.safeParseAsync=this.safeParseAsync.bind(this);this.spa=this.spa.bind(this);this.refine=this.refine.bind(this);this.refinement=this.refinement.bind(this);this.superRefine=this.superRefine.bind(this);this.optional=this.optional.bind(this);this.nullable=this.nullable.bind(this);this.nullish=this.nullish.bind(this);this.array=this.array.bind(this);this.promise=this.promise.bind(this);this.or=this.or.bind(this);this.and=this.and.bind(this);this.transform=this.transform.bind(this);this.brand=this.brand.bind(this);this.default=this.default.bind(this);this.catch=this.catch.bind(this);this.describe=this.describe.bind(this);this.pipe=this.pipe.bind(this);this.readonly=this.readonly.bind(this);this.isNullable=this.isNullable.bind(this);this.isOptional=this.isOptional.bind(this)}Object.defineProperty(e.prototype,"description",{get:function(){return this._def.description},enumerable:false,configurable:true});e.prototype._getType=function(e){return getParsedType(e.data)};e.prototype._getOrReturnCtx=function(e,t){return t||{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}};e.prototype._processInputParams=function(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:getParsedType(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}};e.prototype._parseSync=function(e){var t=this._parse(e);if(isAsync(t)){throw new Error("Synchronous parse encountered promise.")}return t};e.prototype._parseAsync=function(e){var t=this._parse(e);return Promise.resolve(t)};e.prototype.parse=function(e,t){var r=this.safeParse(e,t);if(r.success)return r.data;throw r.error};e.prototype.safeParse=function(e,t){var r;var n={common:{issues:[],async:(r=t===null||t===void 0?void 0:t.async)!==null&&r!==void 0?r:false,contextualErrorMap:t===null||t===void 0?void 0:t.errorMap},path:(t===null||t===void 0?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};var i=this._parseSync({data:e,path:n.path,parent:n});return handleResult(n,i)};e.prototype.parseAsync=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.safeParseAsync(e,t)];case 1:r=n.sent();if(r.success)return[2,r.data];throw r.error}}))}))};e.prototype.safeParseAsync=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(s){switch(s.label){case 0:r={common:{issues:[],contextualErrorMap:t===null||t===void 0?void 0:t.errorMap,async:true},path:(t===null||t===void 0?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:getParsedType(e)};n=this._parse({data:e,path:r.path,parent:r});return[4,isAsync(n)?n:Promise.resolve(n)];case 1:i=s.sent();return[2,handleResult(r,i)]}}))}))};e.prototype.refine=function(e,t){var r=function(e){if(typeof t==="string"||typeof t==="undefined"){return{message:t}}else if(typeof t==="function"){return t(e)}else{return t}};return this._refinement((function(t,n){var i=e(t);var s=function(){return n.addIssue(__assign({code:ZodIssueCode.custom},r(t)))};if(typeof Promise!=="undefined"&&i instanceof Promise){return i.then((function(e){if(!e){s();return false}else{return true}}))}if(!i){s();return false}else{return true}}))};e.prototype.refinement=function(e,t){return this._refinement((function(r,n){if(!e(r)){n.addIssue(typeof t==="function"?t(r,n):t);return false}else{return true}}))};e.prototype._refinement=function(e){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:e}})};e.prototype.superRefine=function(e){return this._refinement(e)};e.prototype.optional=function(){return ZodOptional.create(this,this._def)};e.prototype.nullable=function(){return ZodNullable.create(this,this._def)};e.prototype.nullish=function(){return this.nullable().optional()};e.prototype.array=function(){return ZodArray.create(this,this._def)};e.prototype.promise=function(){return ZodPromise.create(this,this._def)};e.prototype.or=function(e){return ZodUnion.create([this,e],this._def)};e.prototype.and=function(e){return ZodIntersection.create(this,e,this._def)};e.prototype.transform=function(e){return new ZodEffects(__assign(__assign({},processCreateParams(this._def)),{schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:e}}))};e.prototype.default=function(e){var t=typeof e==="function"?e:function(){return e};return new ZodDefault(__assign(__assign({},processCreateParams(this._def)),{innerType:this,defaultValue:t,typeName:ZodFirstPartyTypeKind.ZodDefault}))};e.prototype.brand=function(){return new ZodBranded(__assign({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this},processCreateParams(this._def)))};e.prototype.catch=function(e){var t=typeof e==="function"?e:function(){return e};return new ZodCatch(__assign(__assign({},processCreateParams(this._def)),{innerType:this,catchValue:t,typeName:ZodFirstPartyTypeKind.ZodCatch}))};e.prototype.describe=function(e){var t=this.constructor;return new t(__assign(__assign({},this._def),{description:e}))};e.prototype.pipe=function(e){return ZodPipeline.create(this,e)};e.prototype.readonly=function(){return ZodReadonly.create(this)};e.prototype.isOptional=function(){return this.safeParse(undefined).success};e.prototype.isNullable=function(){return this.safeParse(null).success};return e}();var cuidRegex=/^c[^\s-]{8,}$/i;var cuid2Regex=/^[0-9a-z]+$/;var ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/;var uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;var nanoidRegex=/^[a-z0-9_-]{21}$/i;var durationRegex=/^[-+]?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)?)??$/;var emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;var _emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";var emojiRegex;var ipv4Regex=/^(?:(?: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])$/;var ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;var base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;var dateRegexSource="((\\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])))";var dateRegex=new RegExp("^".concat(dateRegexSource,"$"));function timeRegexSource(e){var t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";if(e.precision){t="".concat(t,"\\.\\d{").concat(e.precision,"}")}else if(e.precision==null){t="".concat(t,"(\\.\\d+)?")}return t}function timeRegex(e){return new RegExp("^".concat(timeRegexSource(e),"$"))}function datetimeRegex(e){var t="".concat(dateRegexSource,"T").concat(timeRegexSource(e));var r=[];r.push(e.local?"Z?":"Z");if(e.offset)r.push("([+-]\\d{2}:?\\d{2})");t="".concat(t,"(").concat(r.join("|"),")");return new RegExp("^".concat(t,"$"))}function isValidIP(e,t){if((t==="v4"||!t)&&ipv4Regex.test(e)){return true}if((t==="v6"||!t)&&ipv6Regex.test(e)){return true}return false}var ZodString=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){if(this._def.coerce){e.data=String(e.data)}var t=this._getType(e);if(t!==ZodParsedType.string){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:r.parsedType});return INVALID}var n=new ParseStatus;var i=undefined;for(var s=0,a=this._def.checks;s<a.length;s++){var o=a[s];if(o.kind==="min"){if(e.data.length<o.value){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:true,exact:false,message:o.message});n.dirty()}}else if(o.kind==="max"){if(e.data.length>o.value){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:true,exact:false,message:o.message});n.dirty()}}else if(o.kind==="length"){var u=e.data.length>o.value;var d=e.data.length<o.value;if(u||d){i=this._getOrReturnCtx(e,i);if(u){addIssueToContext(i,{code:ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:true,exact:true,message:o.message})}else if(d){addIssueToContext(i,{code:ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:true,exact:true,message:o.message})}n.dirty()}}else if(o.kind==="email"){if(!emailRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"email",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="emoji"){if(!emojiRegex){emojiRegex=new RegExp(_emojiRegex,"u")}if(!emojiRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"emoji",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="uuid"){if(!uuidRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"uuid",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="nanoid"){if(!nanoidRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"nanoid",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="cuid"){if(!cuidRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"cuid",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="cuid2"){if(!cuid2Regex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"cuid2",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="ulid"){if(!ulidRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"ulid",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="url"){try{new URL(e.data)}catch(t){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"url",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="regex"){o.regex.lastIndex=0;var c=o.regex.test(e.data);if(!c){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"regex",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="trim"){e.data=e.data.trim()}else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.invalid_string,validation:{includes:o.value,position:o.position},message:o.message});n.dirty()}}else if(o.kind==="toLowerCase"){e.data=e.data.toLowerCase()}else if(o.kind==="toUpperCase"){e.data=e.data.toUpperCase()}else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.invalid_string,validation:{startsWith:o.value},message:o.message});n.dirty()}}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.invalid_string,validation:{endsWith:o.value},message:o.message});n.dirty()}}else if(o.kind==="datetime"){var f=datetimeRegex(o);if(!f.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.invalid_string,validation:"datetime",message:o.message});n.dirty()}}else if(o.kind==="date"){var f=dateRegex;if(!f.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.invalid_string,validation:"date",message:o.message});n.dirty()}}else if(o.kind==="time"){var f=timeRegex(o);if(!f.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{code:ZodIssueCode.invalid_string,validation:"time",message:o.message});n.dirty()}}else if(o.kind==="duration"){if(!durationRegex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"duration",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="ip"){if(!isValidIP(e.data,o.version)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"ip",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else if(o.kind==="base64"){if(!base64Regex.test(e.data)){i=this._getOrReturnCtx(e,i);addIssueToContext(i,{validation:"base64",code:ZodIssueCode.invalid_string,message:o.message});n.dirty()}}else{util.assertNever(o)}}return{status:n.value,value:e.data}};t.prototype._regex=function(e,t,r){return this.refinement((function(t){return e.test(t)}),__assign({validation:t,code:ZodIssueCode.invalid_string},errorUtil.errToObj(r)))};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.email=function(e){return this._addCheck(__assign({kind:"email"},errorUtil.errToObj(e)))};t.prototype.url=function(e){return this._addCheck(__assign({kind:"url"},errorUtil.errToObj(e)))};t.prototype.emoji=function(e){return this._addCheck(__assign({kind:"emoji"},errorUtil.errToObj(e)))};t.prototype.uuid=function(e){return this._addCheck(__assign({kind:"uuid"},errorUtil.errToObj(e)))};t.prototype.nanoid=function(e){return this._addCheck(__assign({kind:"nanoid"},errorUtil.errToObj(e)))};t.prototype.cuid=function(e){return this._addCheck(__assign({kind:"cuid"},errorUtil.errToObj(e)))};t.prototype.cuid2=function(e){return this._addCheck(__assign({kind:"cuid2"},errorUtil.errToObj(e)))};t.prototype.ulid=function(e){return this._addCheck(__assign({kind:"ulid"},errorUtil.errToObj(e)))};t.prototype.base64=function(e){return this._addCheck(__assign({kind:"base64"},errorUtil.errToObj(e)))};t.prototype.ip=function(e){return this._addCheck(__assign({kind:"ip"},errorUtil.errToObj(e)))};t.prototype.datetime=function(e){var t,r;if(typeof e==="string"){return this._addCheck({kind:"datetime",precision:null,offset:false,local:false,message:e})}return this._addCheck(__assign({kind:"datetime",precision:typeof(e===null||e===void 0?void 0:e.precision)==="undefined"?null:e===null||e===void 0?void 0:e.precision,offset:(t=e===null||e===void 0?void 0:e.offset)!==null&&t!==void 0?t:false,local:(r=e===null||e===void 0?void 0:e.local)!==null&&r!==void 0?r:false},errorUtil.errToObj(e===null||e===void 0?void 0:e.message)))};t.prototype.date=function(e){return this._addCheck({kind:"date",message:e})};t.prototype.time=function(e){if(typeof e==="string"){return this._addCheck({kind:"time",precision:null,message:e})}return this._addCheck(__assign({kind:"time",precision:typeof(e===null||e===void 0?void 0:e.precision)==="undefined"?null:e===null||e===void 0?void 0:e.precision},errorUtil.errToObj(e===null||e===void 0?void 0:e.message)))};t.prototype.duration=function(e){return this._addCheck(__assign({kind:"duration"},errorUtil.errToObj(e)))};t.prototype.regex=function(e,t){return this._addCheck(__assign({kind:"regex",regex:e},errorUtil.errToObj(t)))};t.prototype.includes=function(e,t){return this._addCheck(__assign({kind:"includes",value:e,position:t===null||t===void 0?void 0:t.position},errorUtil.errToObj(t===null||t===void 0?void 0:t.message)))};t.prototype.startsWith=function(e,t){return this._addCheck(__assign({kind:"startsWith",value:e},errorUtil.errToObj(t)))};t.prototype.endsWith=function(e,t){return this._addCheck(__assign({kind:"endsWith",value:e},errorUtil.errToObj(t)))};t.prototype.min=function(e,t){return this._addCheck(__assign({kind:"min",value:e},errorUtil.errToObj(t)))};t.prototype.max=function(e,t){return this._addCheck(__assign({kind:"max",value:e},errorUtil.errToObj(t)))};t.prototype.length=function(e,t){return this._addCheck(__assign({kind:"length",value:e},errorUtil.errToObj(t)))};t.prototype.nonempty=function(e){return this.min(1,errorUtil.errToObj(e))};t.prototype.trim=function(){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:"trim"}],false)}))};t.prototype.toLowerCase=function(){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:"toLowerCase"}],false)}))};t.prototype.toUpperCase=function(){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:"toUpperCase"}],false)}))};Object.defineProperty(t.prototype,"isDatetime",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="datetime"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDate",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="date"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTime",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="time"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDuration",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="duration"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmail",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="email"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isURL",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="url"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isEmoji",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="emoji"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isUUID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="uuid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isNANOID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="nanoid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isCUID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="cuid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isCUID2",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="cuid2"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isULID",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="ulid"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isIP",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="ip"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isBase64",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="base64"}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"minLength",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="min"){if(e===null||n.value>e)e=n.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxLength",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="max"){if(e===null||n.value<e)e=n.value}}return e},enumerable:false,configurable:true});return t}(ZodType);ZodString.create=function(e){var t;return new ZodString(__assign({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(t=e===null||e===void 0?void 0:e.coerce)!==null&&t!==void 0?t:false},processCreateParams(e)))};function floatSafeRemainder(e,t){var r=(e.toString().split(".")[1]||"").length;var n=(t.toString().split(".")[1]||"").length;var i=r>n?r:n;var s=parseInt(e.toFixed(i).replace(".",""));var a=parseInt(t.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}var ZodNumber=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.min=t.gte;t.max=t.lte;t.step=t.multipleOf;return t}t.prototype._parse=function(e){if(this._def.coerce){e.data=Number(e.data)}var t=this._getType(e);if(t!==ZodParsedType.number){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:r.parsedType});return INVALID}var n=undefined;var i=new ParseStatus;for(var s=0,a=this._def.checks;s<a.length;s++){var o=a[s];if(o.kind==="int"){if(!util.isInteger(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message});i.dirty()}}else if(o.kind==="min"){var u=o.inclusive?e.data<o.value:e.data<=o.value;if(u){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message});i.dirty()}}else if(o.kind==="max"){var d=o.inclusive?e.data>o.value:e.data>=o.value;if(d){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:false,message:o.message});i.dirty()}}else if(o.kind==="multipleOf"){if(floatSafeRemainder(e.data,o.value)!==0){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message});i.dirty()}}else if(o.kind==="finite"){if(!Number.isFinite(e.data)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.not_finite,message:o.message});i.dirty()}}else{util.assertNever(o)}}return{status:i.value,value:e.data}};t.prototype.gte=function(e,t){return this.setLimit("min",e,true,errorUtil.toString(t))};t.prototype.gt=function(e,t){return this.setLimit("min",e,false,errorUtil.toString(t))};t.prototype.lte=function(e,t){return this.setLimit("max",e,true,errorUtil.toString(t))};t.prototype.lt=function(e,t){return this.setLimit("max",e,false,errorUtil.toString(t))};t.prototype.setLimit=function(e,r,n,i){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:e,value:r,inclusive:n,message:errorUtil.toString(i)}],false)}))};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.int=function(e){return this._addCheck({kind:"int",message:errorUtil.toString(e)})};t.prototype.positive=function(e){return this._addCheck({kind:"min",value:0,inclusive:false,message:errorUtil.toString(e)})};t.prototype.negative=function(e){return this._addCheck({kind:"max",value:0,inclusive:false,message:errorUtil.toString(e)})};t.prototype.nonpositive=function(e){return this._addCheck({kind:"max",value:0,inclusive:true,message:errorUtil.toString(e)})};t.prototype.nonnegative=function(e){return this._addCheck({kind:"min",value:0,inclusive:true,message:errorUtil.toString(e)})};t.prototype.multipleOf=function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})};t.prototype.finite=function(e){return this._addCheck({kind:"finite",message:errorUtil.toString(e)})};t.prototype.safe=function(e){return this._addCheck({kind:"min",inclusive:true,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(e)})._addCheck({kind:"max",inclusive:true,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(e)})};Object.defineProperty(t.prototype,"minValue",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="min"){if(e===null||n.value>e)e=n.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxValue",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="max"){if(e===null||n.value<e)e=n.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isInt",{get:function(){return!!this._def.checks.find((function(e){return e.kind==="int"||e.kind==="multipleOf"&&util.isInteger(e.value)}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isFinite",{get:function(){var e=null,t=null;for(var r=0,n=this._def.checks;r<n.length;r++){var i=n[r];if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf"){return true}else if(i.kind==="min"){if(t===null||i.value>t)t=i.value}else if(i.kind==="max"){if(e===null||i.value<e)e=i.value}}return Number.isFinite(t)&&Number.isFinite(e)},enumerable:false,configurable:true});return t}(ZodType);ZodNumber.create=function(e){return new ZodNumber(__assign({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(e===null||e===void 0?void 0:e.coerce)||false},processCreateParams(e)))};var ZodBigInt=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.min=t.gte;t.max=t.lte;return t}t.prototype._parse=function(e){if(this._def.coerce){e.data=BigInt(e.data)}var t=this._getType(e);if(t!==ZodParsedType.bigint){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:r.parsedType});return INVALID}var n=undefined;var i=new ParseStatus;for(var s=0,a=this._def.checks;s<a.length;s++){var o=a[s];if(o.kind==="min"){var u=o.inclusive?e.data<o.value:e.data<=o.value;if(u){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message});i.dirty()}}else if(o.kind==="max"){var d=o.inclusive?e.data>o.value:e.data>=o.value;if(d){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message});i.dirty()}}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0)){n=this._getOrReturnCtx(e,n);addIssueToContext(n,{code:ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message});i.dirty()}}else{util.assertNever(o)}}return{status:i.value,value:e.data}};t.prototype.gte=function(e,t){return this.setLimit("min",e,true,errorUtil.toString(t))};t.prototype.gt=function(e,t){return this.setLimit("min",e,false,errorUtil.toString(t))};t.prototype.lte=function(e,t){return this.setLimit("max",e,true,errorUtil.toString(t))};t.prototype.lt=function(e,t){return this.setLimit("max",e,false,errorUtil.toString(t))};t.prototype.setLimit=function(e,r,n,i){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[{kind:e,value:r,inclusive:n,message:errorUtil.toString(i)}],false)}))};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.positive=function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:false,message:errorUtil.toString(e)})};t.prototype.negative=function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:false,message:errorUtil.toString(e)})};t.prototype.nonpositive=function(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:true,message:errorUtil.toString(e)})};t.prototype.nonnegative=function(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:true,message:errorUtil.toString(e)})};t.prototype.multipleOf=function(e,t){return this._addCheck({kind:"multipleOf",value:e,message:errorUtil.toString(t)})};Object.defineProperty(t.prototype,"minValue",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="min"){if(e===null||n.value>e)e=n.value}}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxValue",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="max"){if(e===null||n.value<e)e=n.value}}return e},enumerable:false,configurable:true});return t}(ZodType);ZodBigInt.create=function(e){var t;return new ZodBigInt(__assign({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(t=e===null||e===void 0?void 0:e.coerce)!==null&&t!==void 0?t:false},processCreateParams(e)))};var ZodBoolean=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){if(this._def.coerce){e.data=Boolean(e.data)}var t=this._getType(e);if(t!==ZodParsedType.boolean){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:r.parsedType});return INVALID}return OK(e.data)};return t}(ZodType);ZodBoolean.create=function(e){return new ZodBoolean(__assign({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(e===null||e===void 0?void 0:e.coerce)||false},processCreateParams(e)))};var ZodDate=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){if(this._def.coerce){e.data=new Date(e.data)}var t=this._getType(e);if(t!==ZodParsedType.date){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:r.parsedType});return INVALID}if(isNaN(e.data.getTime())){var n=this._getOrReturnCtx(e);addIssueToContext(n,{code:ZodIssueCode.invalid_date});return INVALID}var i=new ParseStatus;var s=undefined;for(var a=0,o=this._def.checks;a<o.length;a++){var u=o[a];if(u.kind==="min"){if(e.data.getTime()<u.value){s=this._getOrReturnCtx(e,s);addIssueToContext(s,{code:ZodIssueCode.too_small,message:u.message,inclusive:true,exact:false,minimum:u.value,type:"date"});i.dirty()}}else if(u.kind==="max"){if(e.data.getTime()>u.value){s=this._getOrReturnCtx(e,s);addIssueToContext(s,{code:ZodIssueCode.too_big,message:u.message,inclusive:true,exact:false,maximum:u.value,type:"date"});i.dirty()}}else{util.assertNever(u)}}return{status:i.value,value:new Date(e.data.getTime())}};t.prototype._addCheck=function(e){return new t(__assign(__assign({},this._def),{checks:__spreadArray(__spreadArray([],this._def.checks,true),[e],false)}))};t.prototype.min=function(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:errorUtil.toString(t)})};t.prototype.max=function(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:errorUtil.toString(t)})};Object.defineProperty(t.prototype,"minDate",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="min"){if(e===null||n.value>e)e=n.value}}return e!=null?new Date(e):null},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxDate",{get:function(){var e=null;for(var t=0,r=this._def.checks;t<r.length;t++){var n=r[t];if(n.kind==="max"){if(e===null||n.value<e)e=n.value}}return e!=null?new Date(e):null},enumerable:false,configurable:true});return t}(ZodType);ZodDate.create=function(e){return new ZodDate(__assign({checks:[],coerce:(e===null||e===void 0?void 0:e.coerce)||false,typeName:ZodFirstPartyTypeKind.ZodDate},processCreateParams(e)))};var ZodSymbol=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t!==ZodParsedType.symbol){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:r.parsedType});return INVALID}return OK(e.data)};return t}(ZodType);ZodSymbol.create=function(e){return new ZodSymbol(__assign({typeName:ZodFirstPartyTypeKind.ZodSymbol},processCreateParams(e)))};var ZodUndefined=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t!==ZodParsedType.undefined){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:r.parsedType});return INVALID}return OK(e.data)};return t}(ZodType);ZodUndefined.create=function(e){return new ZodUndefined(__assign({typeName:ZodFirstPartyTypeKind.ZodUndefined},processCreateParams(e)))};var ZodNull=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t!==ZodParsedType.null){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:r.parsedType});return INVALID}return OK(e.data)};return t}(ZodType);ZodNull.create=function(e){return new ZodNull(__assign({typeName:ZodFirstPartyTypeKind.ZodNull},processCreateParams(e)))};var ZodAny=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t._any=true;return t}t.prototype._parse=function(e){return OK(e.data)};return t}(ZodType);ZodAny.create=function(e){return new ZodAny(__assign({typeName:ZodFirstPartyTypeKind.ZodAny},processCreateParams(e)))};var ZodUnknown=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t._unknown=true;return t}t.prototype._parse=function(e){return OK(e.data)};return t}(ZodType);ZodUnknown.create=function(e){return new ZodUnknown(__assign({typeName:ZodFirstPartyTypeKind.ZodUnknown},processCreateParams(e)))};var ZodNever=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getOrReturnCtx(e);addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:t.parsedType});return INVALID};return t}(ZodType);ZodNever.create=function(e){return new ZodNever(__assign({typeName:ZodFirstPartyTypeKind.ZodNever},processCreateParams(e)))};var ZodVoid=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t!==ZodParsedType.undefined){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:r.parsedType});return INVALID}return OK(e.data)};return t}(ZodType);ZodVoid.create=function(e){return new ZodVoid(__assign({typeName:ZodFirstPartyTypeKind.ZodVoid},processCreateParams(e)))};var ZodArray=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._processInputParams(e),r=t.ctx,n=t.status;var i=this._def;if(r.parsedType!==ZodParsedType.array){addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:r.parsedType});return INVALID}if(i.exactLength!==null){var s=r.data.length>i.exactLength.value;var a=r.data.length<i.exactLength.value;if(s||a){addIssueToContext(r,{code:s?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:a?i.exactLength.value:undefined,maximum:s?i.exactLength.value:undefined,type:"array",inclusive:true,exact:true,message:i.exactLength.message});n.dirty()}}if(i.minLength!==null){if(r.data.length<i.minLength.value){addIssueToContext(r,{code:ZodIssueCode.too_small,minimum:i.minLength.value,type:"array",inclusive:true,exact:false,message:i.minLength.message});n.dirty()}}if(i.maxLength!==null){if(r.data.length>i.maxLength.value){addIssueToContext(r,{code:ZodIssueCode.too_big,maximum:i.maxLength.value,type:"array",inclusive:true,exact:false,message:i.maxLength.message});n.dirty()}}if(r.common.async){return Promise.all(__spreadArray([],r.data,true).map((function(e,t){return i.type._parseAsync(new ParseInputLazyPath(r,e,r.path,t))}))).then((function(e){return ParseStatus.mergeArray(n,e)}))}var o=__spreadArray([],r.data,true).map((function(e,t){return i.type._parseSync(new ParseInputLazyPath(r,e,r.path,t))}));return ParseStatus.mergeArray(n,o)};Object.defineProperty(t.prototype,"element",{get:function(){return this._def.type},enumerable:false,configurable:true});t.prototype.min=function(e,r){return new t(__assign(__assign({},this._def),{minLength:{value:e,message:errorUtil.toString(r)}}))};t.prototype.max=function(e,r){return new t(__assign(__assign({},this._def),{maxLength:{value:e,message:errorUtil.toString(r)}}))};t.prototype.length=function(e,r){return new t(__assign(__assign({},this._def),{exactLength:{value:e,message:errorUtil.toString(r)}}))};t.prototype.nonempty=function(e){return this.min(1,e)};return t}(ZodType);ZodArray.create=function(e,t){return new ZodArray(__assign({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray},processCreateParams(t)))};function deepPartialify(e){if(e instanceof ZodObject){var t={};for(var r in e.shape){var n=e.shape[r];t[r]=ZodOptional.create(deepPartialify(n))}return new ZodObject(__assign(__assign({},e._def),{shape:function(){return t}}))}else if(e instanceof ZodArray){return new ZodArray(__assign(__assign({},e._def),{type:deepPartialify(e.element)}))}else if(e instanceof ZodOptional){return ZodOptional.create(deepPartialify(e.unwrap()))}else if(e instanceof ZodNullable){return ZodNullable.create(deepPartialify(e.unwrap()))}else if(e instanceof ZodTuple){return ZodTuple.create(e.items.map((function(e){return deepPartialify(e)})))}else{return e}}var ZodObject=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t._cached=null;t.nonstrict=t.passthrough;t.augment=t.extend;return t}t.prototype._getCached=function(){if(this._cached!==null)return this._cached;var e=this._def.shape();var t=util.objectKeys(e);return this._cached={shape:e,keys:t}};t.prototype._parse=function(e){var t=this;var r=this._getType(e);if(r!==ZodParsedType.object){var n=this._getOrReturnCtx(e);addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType});return INVALID}var i=this._processInputParams(e),s=i.status,a=i.ctx;var o=this._getCached(),u=o.shape,d=o.keys;var c=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip")){for(var f in a.data){if(!d.includes(f)){c.push(f)}}}var l=[];for(var v=0,p=d;v<p.length;v++){var f=p[v];var h=u[f];var y=a.data[f];l.push({key:{status:"valid",value:f},value:h._parse(new ParseInputLazyPath(a,y,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof ZodNever){var m=this._def.unknownKeys;if(m==="passthrough"){for(var _=0,Z=c;_<Z.length;_++){var f=Z[_];l.push({key:{status:"valid",value:f},value:{status:"valid",value:a.data[f]}})}}else if(m==="strict"){if(c.length>0){addIssueToContext(a,{code:ZodIssueCode.unrecognized_keys,keys:c});s.dirty()}}else if(m==="strip");else{throw new Error("Internal ZodObject error: invalid unknownKeys value.")}}else{var g=this._def.catchall;for(var T=0,b=c;T<b.length;T++){var f=b[T];var y=a.data[f];l.push({key:{status:"valid",value:f},value:g._parse(new ParseInputLazyPath(a,y,a.path,f)),alwaysSet:f in a.data})}}if(a.common.async){return Promise.resolve().then((function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,n,i,s;return __generator(this,(function(a){switch(a.label){case 0:e=[];t=0,r=l;a.label=1;case 1:if(!(t<r.length))return[3,5];n=r[t];return[4,n.key];case 2:i=a.sent();return[4,n.value];case 3:s=a.sent();e.push({key:i,value:s,alwaysSet:n.alwaysSet});a.label=4;case 4:t++;return[3,1];case 5:return[2,e]}}))}))})).then((function(e){return ParseStatus.mergeObjectSync(s,e)}))}else{return ParseStatus.mergeObjectSync(s,l)}};Object.defineProperty(t.prototype,"shape",{get:function(){return this._def.shape()},enumerable:false,configurable:true});t.prototype.strict=function(e){var r=this;return new t(__assign(__assign(__assign({},this._def),{unknownKeys:"strict"}),e!==undefined?{errorMap:function(t,n){var i,s,a,o;var u=(a=(s=(i=r._def).errorMap)===null||s===void 0?void 0:s.call(i,t,n).message)!==null&&a!==void 0?a:n.defaultError;if(t.code==="unrecognized_keys")return{message:(o=errorUtil.errToObj(e).message)!==null&&o!==void 0?o:u};return{message:u}}}:{}))};t.prototype.strip=function(){return new t(__assign(__assign({},this._def),{unknownKeys:"strip"}))};t.prototype.passthrough=function(){return new t(__assign(__assign({},this._def),{unknownKeys:"passthrough"}))};t.prototype.extend=function(e){var r=this;return new t(__assign(__assign({},this._def),{shape:function(){return __assign(__assign({},r._def.shape()),e)}}))};t.prototype.merge=function(e){var r=this;var n=new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:function(){return __assign(__assign({},r._def.shape()),e._def.shape())},typeName:ZodFirstPartyTypeKind.ZodObject});return n};t.prototype.setKey=function(e,t){var r;return this.augment((r={},r[e]=t,r))};t.prototype.catchall=function(e){return new t(__assign(__assign({},this._def),{catchall:e}))};t.prototype.pick=function(e){var r=this;var n={};util.objectKeys(e).forEach((function(t){if(e[t]&&r.shape[t]){n[t]=r.shape[t]}}));return new t(__assign(__assign({},this._def),{shape:function(){return n}}))};t.prototype.omit=function(e){var r=this;var n={};util.objectKeys(this.shape).forEach((function(t){if(!e[t]){n[t]=r.shape[t]}}));return new t(__assign(__assign({},this._def),{shape:function(){return n}}))};t.prototype.deepPartial=function(){return deepPartialify(this)};t.prototype.partial=function(e){var r=this;var n={};util.objectKeys(this.shape).forEach((function(t){var i=r.shape[t];if(e&&!e[t]){n[t]=i}else{n[t]=i.optional()}}));return new t(__assign(__assign({},this._def),{shape:function(){return n}}))};t.prototype.required=function(e){var r=this;var n={};util.objectKeys(this.shape).forEach((function(t){if(e&&!e[t]){n[t]=r.shape[t]}else{var i=r.shape[t];var s=i;while(s instanceof ZodOptional){s=s._def.innerType}n[t]=s}}));return new t(__assign(__assign({},this._def),{shape:function(){return n}}))};t.prototype.keyof=function(){return createZodEnum(util.objectKeys(this.shape))};return t}(ZodType);ZodObject.create=function(e,t){return new ZodObject(__assign({shape:function(){return e},unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject},processCreateParams(t)))};ZodObject.strictCreate=function(e,t){return new ZodObject(__assign({shape:function(){return e},unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject},processCreateParams(t)))};ZodObject.lazycreate=function(e,t){return new ZodObject(__assign({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject},processCreateParams(t)))};var ZodUnion=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t;var r=this;var n=this._processInputParams(e).ctx;var i=this._def.options;function s(e){var t;for(var r=0,i=e;r<i.length;r++){var s=i[r];if(s.result.status==="valid"){return s.result}}for(var a=0,o=e;a<o.length;a++){var s=o[a];if(s.result.status==="dirty"){(t=n.common.issues).push.apply(t,s.ctx.common.issues);return s.result}}var u=e.map((function(e){return new ZodError(e.ctx.common.issues)}));addIssueToContext(n,{code:ZodIssueCode.invalid_union,unionErrors:u});return INVALID}if(n.common.async){return Promise.all(i.map((function(e){return __awaiter(r,void 0,void 0,(function(){var t;var r;return __generator(this,(function(i){switch(i.label){case 0:t=__assign(__assign({},n),{common:__assign(__assign({},n.common),{issues:[]}),parent:null});r={};return[4,e._parseAsync({data:n.data,path:n.path,parent:t})];case 1:return[2,(r.result=i.sent(),r.ctx=t,r)]}}))}))}))).then(s)}else{var a=undefined;var o=[];for(var u=0,d=i;u<d.length;u++){var c=d[u];var f=__assign(__assign({},n),{common:__assign(__assign({},n.common),{issues:[]}),parent:null});var l=c._parseSync({data:n.data,path:n.path,parent:f});if(l.status==="valid"){return l}else if(l.status==="dirty"&&!a){a={result:l,ctx:f}}if(f.common.issues.length){o.push(f.common.issues)}}if(a){(t=n.common.issues).push.apply(t,a.ctx.common.issues);return a.result}var v=o.map((function(e){return new ZodError(e)}));addIssueToContext(n,{code:ZodIssueCode.invalid_union,unionErrors:v});return INVALID}};Object.defineProperty(t.prototype,"options",{get:function(){return this._def.options},enumerable:false,configurable:true});return t}(ZodType);ZodUnion.create=function(e,t){return new ZodUnion(__assign({options:e,typeName:ZodFirstPartyTypeKind.ZodUnion},processCreateParams(t)))};var getDiscriminator=function(e){if(e instanceof ZodLazy){return getDiscriminator(e.schema)}else if(e instanceof ZodEffects){return getDiscriminator(e.innerType())}else if(e instanceof ZodLiteral){return[e.value]}else if(e instanceof ZodEnum){return e.options}else if(e instanceof ZodNativeEnum){return util.objectValues(e.enum)}else if(e instanceof ZodDefault){return getDiscriminator(e._def.innerType)}else if(e instanceof ZodUndefined){return[undefined]}else if(e instanceof ZodNull){return[null]}else if(e instanceof ZodOptional){return __spreadArray([undefined],getDiscriminator(e.unwrap()),true)}else if(e instanceof ZodNullable){return __spreadArray([null],getDiscriminator(e.unwrap()),true)}else if(e instanceof ZodBranded){return getDiscriminator(e.unwrap())}else if(e instanceof ZodReadonly){return getDiscriminator(e.unwrap())}else if(e instanceof ZodCatch){return getDiscriminator(e._def.innerType)}else{return[]}};var ZodDiscriminatedUnion=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==ZodParsedType.object){addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:t.parsedType});return INVALID}var r=this.discriminator;var n=t.data[r];var i=this.optionsMap.get(n);if(!i){addIssueToContext(t,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]});return INVALID}if(t.common.async){return i._parseAsync({data:t.data,path:t.path,parent:t})}else{return i._parseSync({data:t.data,path:t.path,parent:t})}};Object.defineProperty(t.prototype,"discriminator",{get:function(){return this._def.discriminator},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"options",{get:function(){return this._def.options},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"optionsMap",{get:function(){return this._def.optionsMap},enumerable:false,configurable:true});t.create=function(e,r,n){var i=new Map;for(var s=0,a=r;s<a.length;s++){var o=a[s];var u=getDiscriminator(o.shape[e]);if(!u.length){throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"))}for(var d=0,c=u;d<c.length;d++){var f=c[d];if(i.has(f)){throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(f)))}i.set(f,o)}}return new t(__assign({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i},processCreateParams(n)))};return t}(ZodType);function mergeValues(e,t){var r=getParsedType(e);var n=getParsedType(t);if(e===t){return{valid:true,data:e}}else if(r===ZodParsedType.object&&n===ZodParsedType.object){var i=util.objectKeys(t);var s=util.objectKeys(e).filter((function(e){return i.indexOf(e)!==-1}));var a=__assign(__assign({},e),t);for(var o=0,u=s;o<u.length;o++){var d=u[o];var c=mergeValues(e[d],t[d]);if(!c.valid){return{valid:false}}a[d]=c.data}return{valid:true,data:a}}else if(r===ZodParsedType.array&&n===ZodParsedType.array){if(e.length!==t.length){return{valid:false}}var f=[];for(var l=0;l<e.length;l++){var v=e[l];var p=t[l];var c=mergeValues(v,p);if(!c.valid){return{valid:false}}f.push(c.data)}return{valid:true,data:f}}else if(r===ZodParsedType.date&&n===ZodParsedType.date&&+e===+t){return{valid:true,data:e}}else{return{valid:false}}}var ZodIntersection=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._processInputParams(e),r=t.status,n=t.ctx;var i=function(e,t){if(isAborted(e)||isAborted(t)){return INVALID}var i=mergeValues(e.value,t.value);if(!i.valid){addIssueToContext(n,{code:ZodIssueCode.invalid_intersection_types});return INVALID}if(isDirty(e)||isDirty(t)){r.dirty()}return{status:r.value,value:i.data}};if(n.common.async){return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((function(e){var t=e[0],r=e[1];return i(t,r)}))}else{return i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};return t}(ZodType);ZodIntersection.create=function(e,t,r){return new ZodIntersection(__assign({left:e,right:t,typeName:ZodFirstPartyTypeKind.ZodIntersection},processCreateParams(r)))};var ZodTuple=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e),n=r.status,i=r.ctx;if(i.parsedType!==ZodParsedType.array){addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:i.parsedType});return INVALID}if(i.data.length<this._def.items.length){addIssueToContext(i,{code:ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:true,exact:false,type:"array"});return INVALID}var s=this._def.rest;if(!s&&i.data.length>this._def.items.length){addIssueToContext(i,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:true,exact:false,type:"array"});n.dirty()}var a=__spreadArray([],i.data,true).map((function(e,r){var n=t._def.items[r]||t._def.rest;if(!n)return null;return n._parse(new ParseInputLazyPath(i,e,i.path,r))})).filter((function(e){return!!e}));if(i.common.async){return Promise.all(a).then((function(e){return ParseStatus.mergeArray(n,e)}))}else{return ParseStatus.mergeArray(n,a)}};Object.defineProperty(t.prototype,"items",{get:function(){return this._def.items},enumerable:false,configurable:true});t.prototype.rest=function(e){return new t(__assign(__assign({},this._def),{rest:e}))};return t}(ZodType);ZodTuple.create=function(e,t){if(!Array.isArray(e)){throw new Error("You must pass an array of schemas to z.tuple([ ... ])")}return new ZodTuple(__assign({items:e,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null},processCreateParams(t)))};var ZodRecord=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(t.prototype,"keySchema",{get:function(){return this._def.keyType},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"valueSchema",{get:function(){return this._def.valueType},enumerable:false,configurable:true});t.prototype._parse=function(e){var t=this._processInputParams(e),r=t.status,n=t.ctx;if(n.parsedType!==ZodParsedType.object){addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:n.parsedType});return INVALID}var i=[];var s=this._def.keyType;var a=this._def.valueType;for(var o in n.data){i.push({key:s._parse(new ParseInputLazyPath(n,o,n.path,o)),value:a._parse(new ParseInputLazyPath(n,n.data[o],n.path,o)),alwaysSet:o in n.data})}if(n.common.async){return ParseStatus.mergeObjectAsync(r,i)}else{return ParseStatus.mergeObjectSync(r,i)}};Object.defineProperty(t.prototype,"element",{get:function(){return this._def.valueType},enumerable:false,configurable:true});t.create=function(e,r,n){if(r instanceof ZodType){return new t(__assign({keyType:e,valueType:r,typeName:ZodFirstPartyTypeKind.ZodRecord},processCreateParams(n)))}return new t(__assign({keyType:ZodString.create(),valueType:e,typeName:ZodFirstPartyTypeKind.ZodRecord},processCreateParams(r)))};return t}(ZodType);var ZodMap=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(t.prototype,"keySchema",{get:function(){return this._def.keyType},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"valueSchema",{get:function(){return this._def.valueType},enumerable:false,configurable:true});t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e),n=r.status,i=r.ctx;if(i.parsedType!==ZodParsedType.map){addIssueToContext(i,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:i.parsedType});return INVALID}var s=this._def.keyType;var a=this._def.valueType;var o=__spreadArray([],i.data.entries(),true).map((function(e,t){var r=e[0],n=e[1];return{key:s._parse(new ParseInputLazyPath(i,r,i.path,[t,"key"])),value:a._parse(new ParseInputLazyPath(i,n,i.path,[t,"value"]))}}));if(i.common.async){var u=new Map;return Promise.resolve().then((function(){return __awaiter(t,void 0,void 0,(function(){var e,t,r,i,s;return __generator(this,(function(a){switch(a.label){case 0:e=0,t=o;a.label=1;case 1:if(!(e<t.length))return[3,5];r=t[e];return[4,r.key];case 2:i=a.sent();return[4,r.value];case 3:s=a.sent();if(i.status==="aborted"||s.status==="aborted"){return[2,INVALID]}if(i.status==="dirty"||s.status==="dirty"){n.dirty()}u.set(i.value,s.value);a.label=4;case 4:e++;return[3,1];case 5:return[2,{status:n.value,value:u}]}}))}))}))}else{var d=new Map;for(var c=0,f=o;c<f.length;c++){var l=f[c];var v=l.key;var p=l.value;if(v.status==="aborted"||p.status==="aborted"){return INVALID}if(v.status==="dirty"||p.status==="dirty"){n.dirty()}d.set(v.value,p.value)}return{status:n.value,value:d}}};return t}(ZodType);ZodMap.create=function(e,t,r){return new ZodMap(__assign({valueType:t,keyType:e,typeName:ZodFirstPartyTypeKind.ZodMap},processCreateParams(r)))};var ZodSet=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._processInputParams(e),r=t.status,n=t.ctx;if(n.parsedType!==ZodParsedType.set){addIssueToContext(n,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:n.parsedType});return INVALID}var i=this._def;if(i.minSize!==null){if(n.data.size<i.minSize.value){addIssueToContext(n,{code:ZodIssueCode.too_small,minimum:i.minSize.value,type:"set",inclusive:true,exact:false,message:i.minSize.message});r.dirty()}}if(i.maxSize!==null){if(n.data.size>i.maxSize.value){addIssueToContext(n,{code:ZodIssueCode.too_big,maximum:i.maxSize.value,type:"set",inclusive:true,exact:false,message:i.maxSize.message});r.dirty()}}var s=this._def.valueType;function a(e){var t=new Set;for(var n=0,i=e;n<i.length;n++){var s=i[n];if(s.status==="aborted")return INVALID;if(s.status==="dirty")r.dirty();t.add(s.value)}return{status:r.value,value:t}}var o=__spreadArray([],n.data.values(),true).map((function(e,t){return s._parse(new ParseInputLazyPath(n,e,n.path,t))}));if(n.common.async){return Promise.all(o).then((function(e){return a(e)}))}else{return a(o)}};t.prototype.min=function(e,r){return new t(__assign(__assign({},this._def),{minSize:{value:e,message:errorUtil.toString(r)}}))};t.prototype.max=function(e,r){return new t(__assign(__assign({},this._def),{maxSize:{value:e,message:errorUtil.toString(r)}}))};t.prototype.size=function(e,t){return this.min(e,t).max(e,t)};t.prototype.nonempty=function(e){return this.min(1,e)};return t}(ZodType);ZodSet.create=function(e,t){return new ZodSet(__assign({valueType:e,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet},processCreateParams(t)))};var ZodFunction=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;t.validate=t.implement;return t}t.prototype._parse=function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==ZodParsedType.function){addIssueToContext(t,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:t.parsedType});return INVALID}function r(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((function(e){return!!e})),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:r}})}function n(e,r){return makeIssue({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,getErrorMap(),errorMap].filter((function(e){return!!e})),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:r}})}var i={errorMap:t.common.contextualErrorMap};var s=t.data;if(this._def.returns instanceof ZodPromise){var a=this;return OK((function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return __awaiter(this,void 0,void 0,(function(){var t,o,u,d;return __generator(this,(function(c){switch(c.label){case 0:t=new ZodError([]);return[4,a._def.args.parseAsync(e,i).catch((function(n){t.addIssue(r(e,n));throw t}))];case 1:o=c.sent();return[4,Reflect.apply(s,this,o)];case 2:u=c.sent();return[4,a._def.returns._def.type.parseAsync(u,i).catch((function(e){t.addIssue(n(u,e));throw t}))];case 3:d=c.sent();return[2,d]}}))}))}))}else{var o=this;return OK((function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}var a=o._def.args.safeParse(e,i);if(!a.success){throw new ZodError([r(e,a.error)])}var u=Reflect.apply(s,this,a.data);var d=o._def.returns.safeParse(u,i);if(!d.success){throw new ZodError([n(u,d.error)])}return d.data}))}};t.prototype.parameters=function(){return this._def.args};t.prototype.returnType=function(){return this._def.returns};t.prototype.args=function(){var e=[];for(var r=0;r<arguments.length;r++){e[r]=arguments[r]}return new t(__assign(__assign({},this._def),{args:ZodTuple.create(e).rest(ZodUnknown.create())}))};t.prototype.returns=function(e){return new t(__assign(__assign({},this._def),{returns:e}))};t.prototype.implement=function(e){var t=this.parse(e);return t};t.prototype.strictImplement=function(e){var t=this.parse(e);return t};t.create=function(e,r,n){return new t(__assign({args:e?e:ZodTuple.create([]).rest(ZodUnknown.create()),returns:r||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction},processCreateParams(n)))};return t}(ZodType);var ZodLazy=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}Object.defineProperty(t.prototype,"schema",{get:function(){return this._def.getter()},enumerable:false,configurable:true});t.prototype._parse=function(e){var t=this._processInputParams(e).ctx;var r=this._def.getter();return r._parse({data:t.data,path:t.path,parent:t})};return t}(ZodType);ZodLazy.create=function(e,t){return new ZodLazy(__assign({getter:e,typeName:ZodFirstPartyTypeKind.ZodLazy},processCreateParams(t)))};var ZodLiteral=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){if(e.data!==this._def.value){var t=this._getOrReturnCtx(e);addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_literal,expected:this._def.value});return INVALID}return{status:"valid",value:e.data}};Object.defineProperty(t.prototype,"value",{get:function(){return this._def.value},enumerable:false,configurable:true});return t}(ZodType);ZodLiteral.create=function(e,t){return new ZodLiteral(__assign({value:e,typeName:ZodFirstPartyTypeKind.ZodLiteral},processCreateParams(t)))};function createZodEnum(e,t){return new ZodEnum(__assign({values:e,typeName:ZodFirstPartyTypeKind.ZodEnum},processCreateParams(t)))}var ZodEnum=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;_ZodEnum_cache.set(t,void 0);return t}t.prototype._parse=function(e){if(typeof e.data!=="string"){var t=this._getOrReturnCtx(e);var r=this._def.values;addIssueToContext(t,{expected:util.joinValues(r),received:t.parsedType,code:ZodIssueCode.invalid_type});return INVALID}if(!__classPrivateFieldGet(this,_ZodEnum_cache,"f")){__classPrivateFieldSet(this,_ZodEnum_cache,new Set(this._def.values),"f")}if(!__classPrivateFieldGet(this,_ZodEnum_cache,"f").has(e.data)){var t=this._getOrReturnCtx(e);var r=this._def.values;addIssueToContext(t,{received:t.data,code:ZodIssueCode.invalid_enum_value,options:r});return INVALID}return OK(e.data)};Object.defineProperty(t.prototype,"options",{get:function(){return this._def.values},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"enum",{get:function(){var e={};for(var t=0,r=this._def.values;t<r.length;t++){var n=r[t];e[n]=n}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"Values",{get:function(){var e={};for(var t=0,r=this._def.values;t<r.length;t++){var n=r[t];e[n]=n}return e},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"Enum",{get:function(){var e={};for(var t=0,r=this._def.values;t<r.length;t++){var n=r[t];e[n]=n}return e},enumerable:false,configurable:true});t.prototype.extract=function(e,r){if(r===void 0){r=this._def}return t.create(e,__assign(__assign({},this._def),r))};t.prototype.exclude=function(e,r){if(r===void 0){r=this._def}return t.create(this.options.filter((function(t){return!e.includes(t)})),__assign(__assign({},this._def),r))};return t}(ZodType);_ZodEnum_cache=new WeakMap;ZodEnum.create=createZodEnum;var ZodNativeEnum=function(e){__extends(t,e);function t(){var t=e.apply(this,arguments)||this;_ZodNativeEnum_cache.set(t,void 0);return t}t.prototype._parse=function(e){var t=util.getValidEnumValues(this._def.values);var r=this._getOrReturnCtx(e);if(r.parsedType!==ZodParsedType.string&&r.parsedType!==ZodParsedType.number){var n=util.objectValues(t);addIssueToContext(r,{expected:util.joinValues(n),received:r.parsedType,code:ZodIssueCode.invalid_type});return INVALID}if(!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f")){__classPrivateFieldSet(this,_ZodNativeEnum_cache,new Set(util.getValidEnumValues(this._def.values)),"f")}if(!__classPrivateFieldGet(this,_ZodNativeEnum_cache,"f").has(e.data)){var n=util.objectValues(t);addIssueToContext(r,{received:r.data,code:ZodIssueCode.invalid_enum_value,options:n});return INVALID}return OK(e.data)};Object.defineProperty(t.prototype,"enum",{get:function(){return this._def.values},enumerable:false,configurable:true});return t}(ZodType);_ZodNativeEnum_cache=new WeakMap;ZodNativeEnum.create=function(e,t){return new ZodNativeEnum(__assign({values:e,typeName:ZodFirstPartyTypeKind.ZodNativeEnum},processCreateParams(t)))};var ZodPromise=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.unwrap=function(){return this._def.type};t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e).ctx;if(r.parsedType!==ZodParsedType.promise&&r.common.async===false){addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:r.parsedType});return INVALID}var n=r.parsedType===ZodParsedType.promise?r.data:Promise.resolve(r.data);return OK(n.then((function(e){return t._def.type.parseAsync(e,{path:r.path,errorMap:r.common.contextualErrorMap})})))};return t}(ZodType);ZodPromise.create=function(e,t){return new ZodPromise(__assign({type:e,typeName:ZodFirstPartyTypeKind.ZodPromise},processCreateParams(t)))};var ZodEffects=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.innerType=function(){return this._def.schema};t.prototype.sourceType=function(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema};t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e),n=r.status,i=r.ctx;var s=this._def.effect||null;var a={addIssue:function(e){addIssueToContext(i,e);if(e.fatal){n.abort()}else{n.dirty()}},get path(){return i.path}};a.addIssue=a.addIssue.bind(a);if(s.type==="preprocess"){var o=s.transform(i.data,a);if(i.common.async){return Promise.resolve(o).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:if(n.value==="aborted")return[2,INVALID];return[4,this._def.schema._parseAsync({data:e,path:i.path,parent:i})];case 1:t=r.sent();if(t.status==="aborted")return[2,INVALID];if(t.status==="dirty")return[2,DIRTY(t.value)];if(n.value==="dirty")return[2,DIRTY(t.value)];return[2,t]}}))}))}))}else{if(n.value==="aborted")return INVALID;var u=this._def.schema._parseSync({data:o,path:i.path,parent:i});if(u.status==="aborted")return INVALID;if(u.status==="dirty")return DIRTY(u.value);if(n.value==="dirty")return DIRTY(u.value);return u}}if(s.type==="refinement"){var d=function(e){var t=s.refinement(e,a);if(i.common.async){return Promise.resolve(t)}if(t instanceof Promise){throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.")}return e};if(i.common.async===false){var c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(c.status==="aborted")return INVALID;if(c.status==="dirty")n.dirty();d(c.value);return{status:n.value,value:c.value}}else{return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((function(e){if(e.status==="aborted")return INVALID;if(e.status==="dirty")n.dirty();return d(e.value).then((function(){return{status:n.value,value:e.value}}))}))}}if(s.type==="transform"){if(i.common.async===false){var f=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!isValid(f))return f;var u=s.transform(f.value,a);if(u instanceof Promise){throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.")}return{status:n.value,value:u}}else{return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then((function(e){if(!isValid(e))return e;return Promise.resolve(s.transform(e.value,a)).then((function(e){return{status:n.value,value:e}}))}))}}util.assertNever(s)};return t}(ZodType);ZodEffects.create=function(e,t,r){return new ZodEffects(__assign({schema:e,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:t},processCreateParams(r)))};ZodEffects.createWithPreprocess=function(e,t,r){return new ZodEffects(__assign({schema:t,effect:{type:"preprocess",transform:e},typeName:ZodFirstPartyTypeKind.ZodEffects},processCreateParams(r)))};var ZodOptional=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t===ZodParsedType.undefined){return OK(undefined)}return this._def.innerType._parse(e)};t.prototype.unwrap=function(){return this._def.innerType};return t}(ZodType);ZodOptional.create=function(e,t){return new ZodOptional(__assign({innerType:e,typeName:ZodFirstPartyTypeKind.ZodOptional},processCreateParams(t)))};var ZodNullable=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t===ZodParsedType.null){return OK(null)}return this._def.innerType._parse(e)};t.prototype.unwrap=function(){return this._def.innerType};return t}(ZodType);ZodNullable.create=function(e,t){return new ZodNullable(__assign({innerType:e,typeName:ZodFirstPartyTypeKind.ZodNullable},processCreateParams(t)))};var ZodDefault=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._processInputParams(e).ctx;var r=t.data;if(t.parsedType===ZodParsedType.undefined){r=this._def.defaultValue()}return this._def.innerType._parse({data:r,path:t.path,parent:t})};t.prototype.removeDefault=function(){return this._def.innerType};return t}(ZodType);ZodDefault.create=function(e,t){return new ZodDefault(__assign({innerType:e,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof t.default==="function"?t.default:function(){return t.default}},processCreateParams(t)))};var ZodCatch=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e).ctx;var n=__assign(__assign({},r),{common:__assign(__assign({},r.common),{issues:[]})});var i=this._def.innerType._parse({data:n.data,path:n.path,parent:__assign({},n)});if(isAsync(i)){return i.then((function(e){return{status:"valid",value:e.status==="valid"?e.value:t._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}))}else{return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ZodError(n.common.issues)},input:n.data})}}};t.prototype.removeCatch=function(){return this._def.innerType};return t}(ZodType);ZodCatch.create=function(e,t){return new ZodCatch(__assign({innerType:e,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:function(){return t.catch}},processCreateParams(t)))};var ZodNaN=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._getType(e);if(t!==ZodParsedType.nan){var r=this._getOrReturnCtx(e);addIssueToContext(r,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:r.parsedType});return INVALID}return{status:"valid",value:e.data}};return t}(ZodType);ZodNaN.create=function(e){return new ZodNaN(__assign({typeName:ZodFirstPartyTypeKind.ZodNaN},processCreateParams(e)))};var BRAND=Symbol("zod_brand");var ZodBranded=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._processInputParams(e).ctx;var r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})};t.prototype.unwrap=function(){return this._def.type};return t}(ZodType);var ZodPipeline=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this;var r=this._processInputParams(e),n=r.status,i=r.ctx;if(i.common.async){var s=function(){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,this._def.in._parseAsync({data:i.data,path:i.path,parent:i})];case 1:e=t.sent();if(e.status==="aborted")return[2,INVALID];if(e.status==="dirty"){n.dirty();return[2,DIRTY(e.value)]}else{return[2,this._def.out._parseAsync({data:e.value,path:i.path,parent:i})]}return[2]}}))}))};return s()}else{var a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});if(a.status==="aborted")return INVALID;if(a.status==="dirty"){n.dirty();return{status:"dirty",value:a.value}}else{return this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}};t.create=function(e,r){return new t({in:e,out:r,typeName:ZodFirstPartyTypeKind.ZodPipeline})};return t}(ZodType);var ZodReadonly=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._parse=function(e){var t=this._def.innerType._parse(e);var r=function(e){if(isValid(e)){e.value=Object.freeze(e.value)}return e};return isAsync(t)?t.then((function(e){return r(e)})):r(t)};t.prototype.unwrap=function(){return this._def.innerType};return t}(ZodType);ZodReadonly.create=function(e,t){return new ZodReadonly(__assign({innerType:e,typeName:ZodFirstPartyTypeKind.ZodReadonly},processCreateParams(t)))};function custom(e,t,r){if(t===void 0){t={}}if(e)return ZodAny.create().superRefine((function(n,i){var s,a;if(!e(n)){var o=typeof t==="function"?t(n):typeof t==="string"?{message:t}:t;var u=(a=(s=o.fatal)!==null&&s!==void 0?s:r)!==null&&a!==void 0?a:true;var d=typeof o==="string"?{message:o}:o;i.addIssue(__assign(__assign({code:"custom"},d),{fatal:u}))}}));return ZodAny.create()}var late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(e){e["ZodString"]="ZodString";e["ZodNumber"]="ZodNumber";e["ZodNaN"]="ZodNaN";e["ZodBigInt"]="ZodBigInt";e["ZodBoolean"]="ZodBoolean";e["ZodDate"]="ZodDate";e["ZodSymbol"]="ZodSymbol";e["ZodUndefined"]="ZodUndefined";e["ZodNull"]="ZodNull";e["ZodAny"]="ZodAny";e["ZodUnknown"]="ZodUnknown";e["ZodNever"]="ZodNever";e["ZodVoid"]="ZodVoid";e["ZodArray"]="ZodArray";e["ZodObject"]="ZodObject";e["ZodUnion"]="ZodUnion";e["ZodDiscriminatedUnion"]="ZodDiscriminatedUnion";e["ZodIntersection"]="ZodIntersection";e["ZodTuple"]="ZodTuple";e["ZodRecord"]="ZodRecord";e["ZodMap"]="ZodMap";e["ZodSet"]="ZodSet";e["ZodFunction"]="ZodFunction";e["ZodLazy"]="ZodLazy";e["ZodLiteral"]="ZodLiteral";e["ZodEnum"]="ZodEnum";e["ZodEffects"]="ZodEffects";e["ZodNativeEnum"]="ZodNativeEnum";e["ZodOptional"]="ZodOptional";e["ZodNullable"]="ZodNullable";e["ZodDefault"]="ZodDefault";e["ZodCatch"]="ZodCatch";e["ZodPromise"]="ZodPromise";e["ZodBranded"]="ZodBranded";e["ZodPipeline"]="ZodPipeline";e["ZodReadonly"]="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));var instanceOfType=function(e,t){if(t===void 0){t={message:"Input not instance of ".concat(e.name)}}return custom((function(t){return t instanceof e}),t)};var stringType=ZodString.create;var numberType=ZodNumber.create;var nanType=ZodNaN.create;var bigIntType=ZodBigInt.create;var booleanType=ZodBoolean.create;var dateType=ZodDate.create;var symbolType=ZodSymbol.create;var undefinedType=ZodUndefined.create;var nullType=ZodNull.create;var anyType=ZodAny.create;var unknownType=ZodUnknown.create;var neverType=ZodNever.create;var voidType=ZodVoid.create;var arrayType=ZodArray.create;var objectType=ZodObject.create;var strictObjectType=ZodObject.strictCreate;var unionType=ZodUnion.create;var discriminatedUnionType=ZodDiscriminatedUnion.create;var intersectionType=ZodIntersection.create;var tupleType=ZodTuple.create;var recordType=ZodRecord.create;var mapType=ZodMap.create;var setType=ZodSet.create;var functionType=ZodFunction.create;var lazyType=ZodLazy.create;var literalType=ZodLiteral.create;var enumType=ZodEnum.create;var nativeEnumType=ZodNativeEnum.create;var promiseType=ZodPromise.create;var effectsType=ZodEffects.create;var optionalType=ZodOptional.create;var nullableType=ZodNullable.create;var preprocessType=ZodEffects.createWithPreprocess;var pipelineType=ZodPipeline.create;var ostring=function(){return stringType().optional()};var onumber=function(){return numberType().optional()};var oboolean=function(){return booleanType().optional()};var coerce={string:function(e){return ZodString.create(__assign(__assign({},e),{coerce:true}))},number:function(e){return ZodNumber.create(__assign(__assign({},e),{coerce:true}))},boolean:function(e){return ZodBoolean.create(__assign(__assign({},e),{coerce:true}))},bigint:function(e){return ZodBigInt.create(__assign(__assign({},e),{coerce:true}))},date:function(e){return ZodDate.create(__assign(__assign({},e),{coerce:true}))}};var NEVER=INVALID;var z=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap:setErrorMap,getErrorMap:getErrorMap,makeIssue:makeIssue,EMPTY_PATH:EMPTY_PATH,addIssueToContext:addIssueToContext,ParseStatus:ParseStatus,INVALID:INVALID,DIRTY:DIRTY,OK:OK,isAborted:isAborted,isDirty:isDirty,isValid:isValid,isAsync:isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType:ZodParsedType,getParsedType:getParsedType,ZodType:ZodType,datetimeRegex:datetimeRegex,ZodString:ZodString,ZodNumber:ZodNumber,ZodBigInt:ZodBigInt,ZodBoolean:ZodBoolean,ZodDate:ZodDate,ZodSymbol:ZodSymbol,ZodUndefined:ZodUndefined,ZodNull:ZodNull,ZodAny:ZodAny,ZodUnknown:ZodUnknown,ZodNever:ZodNever,ZodVoid:ZodVoid,ZodArray:ZodArray,ZodObject:ZodObject,ZodUnion:ZodUnion,ZodDiscriminatedUnion:ZodDiscriminatedUnion,ZodIntersection:ZodIntersection,ZodTuple:ZodTuple,ZodRecord:ZodRecord,ZodMap:ZodMap,ZodSet:ZodSet,ZodFunction:ZodFunction,ZodLazy:ZodLazy,ZodLiteral:ZodLiteral,ZodEnum:ZodEnum,ZodNativeEnum:ZodNativeEnum,ZodPromise:ZodPromise,ZodEffects:ZodEffects,ZodTransformer:ZodEffects,ZodOptional:ZodOptional,ZodNullable:ZodNullable,ZodDefault:ZodDefault,ZodCatch:ZodCatch,ZodNaN:ZodNaN,BRAND:BRAND,ZodBranded:ZodBranded,ZodPipeline:ZodPipeline,ZodReadonly:ZodReadonly,custom:custom,Schema:ZodType,ZodSchema:ZodType,late:late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce:coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean:oboolean,onumber:onumber,optional:optionalType,ostring:ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER:NEVER,ZodIssueCode:ZodIssueCode,quotelessJson:quotelessJson,ZodError:ZodError});export{undefinedType as u,z};
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,o){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{s(o.next(t))}catch(t){i(t)}}function c(t){try{s(o["throw"](t))}catch(t){i(t)}}function s(t){t.done?n(t.value):r(t.value).then(a,c)}s((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(e){return s([t,e])}}function s(c){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(n=0)),n)try{if(o=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;r=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1];i=c;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(c);break}if(i[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];r=0}finally{o=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-b89cf6a4.js";import{c as createPopper}from"./popper-0fbeff6d.js";var verdocsButtonPanelCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var VerdocsButtonPanelStyle0=verdocsButtonPanelCss;var VerdocsButtonPanel=function(){function t(t){registerInstance(this,t);this.showing=false;this.icon=""}t.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=createPopper(this.iconEl,this.panelEl,{})};t.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};t.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;var n=this;return __generator(this,(function(o){(t=this.panelEl)===null||t===void 0?void 0:t.setAttribute("data-show","");(e=this.popperInstance)===null||e===void 0?void 0:e.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(t){t.stopPropagation();n.toggle()};document.body.appendChild(this.hiderEl);return[2]}))}))};t.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((function(t){t.removeAttribute("data-show")}));(t=document.getElementById("verdocs-button-panel-hider"))===null||t===void 0?void 0:t.remove();this.showing=false;return[2]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.showing)return[3,2];return[4,this.hidePanel()];case 1:t.sent();return[3,4];case 2:return[4,this.showPanel()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};t.prototype.render=function(){var t=this;return h(Host,{key:"997291ad3f463fff0932490fdab478345757b2e4"},h("div",{key:"02c1929038bcf9f9d3b433b95f9badcfbc3d6a48",class:"icon",innerHTML:this.icon,onClick:function(e){e.stopPropagation();return t.toggle()},ref:function(e){return t.iconEl=e}}),h("div",{key:"6c89badb41660bbe7b826b0f2758c8a6f7525b78",role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:function(e){return t.panelEl=e}},h("div",{key:"069ae9f31df8fdb08d4cdf37526f22494a4108f8","data-popper-arrow":"true",class:"arrow"}),h("slot",{key:"fc5af74e822ca9e0c4c2620585c66e1dcda8f237"})))};return t}();VerdocsButtonPanel.style=VerdocsButtonPanelStyle0;export{VerdocsButtonPanel as verdocs_button_panel};
@@ -1 +0,0 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,o,i){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function n(e){try{a(i.next(e))}catch(e){s(e)}}function l(e){try{a(i["throw"](e))}catch(e){s(e)}}function a(e){e.done?o(e.value):r(e.value).then(n,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,n;return n={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function l(e){return function(t){return a([e,t])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,l[0]&&(o=0)),o)try{if(i=1,r&&(s=l[0]&2?r["return"]:l[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;if(r=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;r=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){o.label=l[1];break}if(l[0]===6&&o.label<s[1]){o.label=s[1];s=l;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(l);break}if(s[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,r=t.length,s;i<r;i++){if(s||!(i in t)){if(!s)s=Array.prototype.slice.call(t,0,i);s[i]=t[i]}}return e.concat(s||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent,g as getElement}from"./index-b89cf6a4.js";import{VerdocsEndpoint,updateField,deleteField}from"@verdocs/js-sdk";import{g as getTemplateFieldStore,u as updateStoreField}from"./TemplateFieldStore-32329b5a.js";import{g as getTemplateRoleStore}from"./TemplateRoleStore-0a4f98cb.js";import{g as getTemplateStore}from"./TemplateStore-78ad24d7.js";import{S as SDKError}from"./errors-887f1e88.js";import"./index-296aabaf.js";import"./index-7456b04f.js";var verdocsCheckboxCss='@charset "UTF-8";@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-checkbox{line-height:18px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-checkbox label>input[type=checkbox]{display:none}verdocs-checkbox label>input[type=checkbox]+*::before{content:"";width:20px;height:20px;-ms-flex-negative:0;flex-shrink:0;margin-right:8px;line-height:20px;border-radius:2px;border-style:solid;border-width:0.1rem;display:inline-block;vertical-align:bottom;border-color:#aeb4bf}verdocs-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-checkbox.dark label>input[type=checkbox]+*::before{border-color:#ffffff}verdocs-checkbox.dark label>input[type=checkbox]:checked+*::before{background:#55bc81;border-color:#55bc81}';var VerdocsCheckboxStyle0=verdocsCheckboxCss;var VerdocsCheckbox=function(){function e(e){registerInstance(this,e);this.checked=false;this.name="";this.label="";this.value="";this.theme="light";this.disabled=false}e.prototype.render=function(){var e;return h(Host,{key:"02a992ff0c9365a18637ccd7b0acc34a16c95b0e",class:(e={disabled:this.disabled},e[this.theme]=true,e)},h("label",{key:"897f8d9d3f3365087a00ab0bb12b741c944a66a3"},h("input",{key:"1e82031b5febc2cea4920e2c374a5f3cbff07889",type:"checkbox",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled}),h("span",{key:"a5b8a8518301ce6866228d7a66029abdc802e092"},this.label)))};return e}();VerdocsCheckbox.style=VerdocsCheckboxStyle0;var verdocsSelectInputCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-select-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;border:1px solid #cccccc;border-radius:4px;background:#ffffff;color:#092c4c;width:100%;font-size:16px;height:28px;padding:2px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';var VerdocsSelectInputStyle0=verdocsSelectInputCss;var VerdocsSelectInput=function(){function e(e){registerInstance(this,e);this.value="";this.label="";this.options=undefined;this.disabled=false}e.prototype.render=function(){var e=this;return h(Host,{key:"49b233e1dcda5c8ffd51453654fa88bdec73bd82",class:"input-field"},h("label",{key:"53ec0b8c1823a9e992c04e554bb33752ed676ad3"},this.label?h("div",{class:"input-label"},this.label+":"):h("div",null),h("select",{key:"e7e0ef4dc4ab8aae9cc81d39010cfa335d37b291",class:"input-element",disabled:this.disabled},this.options.map((function(t){return h("option",{value:t.value,selected:t.value===e.value},t.label)})))))};return e}();VerdocsSelectInput.style=VerdocsSelectInputStyle0;var verdocsTemplateFieldPropertiesCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-field-properties{padding:20px;display:block;border-radius:4px;background:#ffffff;border:1px solid #ccc;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:2px 2px 10px 0px rgba(0, 0, 0, 0.1215686275);box-shadow:2px 2px 10px 0px rgba(0, 0, 0, 0.1215686275)}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:rgb(165, 0, 33)}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var VerdocsTemplateFieldPropertiesStyle0=verdocsTemplateFieldPropertiesCss;var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var HelpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';function generateWeakGuid(){var e=function(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}var VerdocsTemplateFieldProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.settingsChanged=createEvent(this,"settingsChanged",7);this.sdkError=createEvent(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.setting=null;this.label="";this.type="textbox";this.name="";this.required=false;this.roleName="";this.group="";this.fieldType="";this.options=[];this.placeholder="";this.value="";this.leading=0;this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,r,s,n,l,a,c,d,p;var u=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,4,,5]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,getTemplateStore(this.endpoint,this.templateId)];case 1:l.templateStore=h.sent();a=this;return[4,getTemplateFieldStore(this.templateId)];case 2:a.fieldStore=h.sent();c=this;return[4,getTemplateRoleStore(this.templateId)];case 3:c.roleStore=h.sent();d=this.fieldStore.get("fields").find((function(e){return e.name===u.fieldName}));if(!d){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in fields'))}else{console.log("props",d)}this.type=d.type;this.name=d.name;this.label=d.label;this.group=d.name;this.roleName=d.role_name;this.required=d.required;this.fieldType=d.type;this.placeholder=((e=d.settings)===null||e===void 0?void 0:e.placeholder)||"";this.value=((t=d.settings)===null||t===void 0?void 0:t.result)||"";this.leading=((o=d.settings)===null||o===void 0?void 0:o.leading)||0;this.setting=d.settings||{};this.options=((i=d.settings)===null||i===void 0?void 0:i.options)||[];this.dirty=false;this.loading=false;console.log("Displaying settings for",this.setting);return[3,5];case 4:p=h.sent();console.log("[FIELD PROPERTIES] Error loading template",p);this.loading=false;(r=this.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(p.message,(s=p.response)===null||s===void 0?void 0:s.status,(n=p.response)===null||n===void 0?void 0:n.data));return[3,5];case 5:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var o,i,r,s,n;e.stopPropagation();var l=this.fieldStore.get("fields").find((function(e){return e.name===t.fieldName}));if(l){this.name=l.name;this.label=l.label;this.roleName=l.role_name;this.required=l.required;this.placeholder=((o=l.settings)===null||o===void 0?void 0:o.placeholder)||"";this.value=((i=l.settings)===null||i===void 0?void 0:i.result)||"";this.leading=((r=l.settings)===null||r===void 0?void 0:r.leading)||0}this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit();(n=document.getElementById("verdocs-template-field-properties"))===null||n===void 0?void 0:n.remove()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,label:this.label||null,required:this.required,role_name:this.roleName};if(this.type==="checkbox_group"||this.type==="radio_button_group"){o.settings=this.setting;o.settings.options=this.options}else if(this.type==="textarea"||this.type==="textbox"){o.settings=__assign({},this.setting);o.settings.result=(this.value||"").trim()}else if(this.type==="dropdown"){o.settings={x:this.setting.x,y:this.setting.y,options:this.options}}console.log("FP: Will update",this.fieldName,o);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,r,s;t.dirty=false;updateStoreField(t.fieldStore,t.fieldName,e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(r=t.close)===null||r===void 0?void 0:r.emit();(s=document.getElementById("verdocs-template-field-properties"))===null||s===void 0?void 0:s.remove()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleAddOption=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};this.options.push(this.type==="radio_button_group"?{id:generateWeakGuid(),value:"Option ".concat(this.options.length+1),selected:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20}:{id:generateWeakGuid(),value:"Option ".concat(this.options.length+1),checked:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20});o.settings=__assign({},this.setting);delete o.settings.result;o.settings.options=__spreadArray([],this.options,true);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,r,s;t.dirty=false;updateStoreField(t.fieldStore,t.fieldName,e);t.fieldName=e.name;(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(r=t.close)===null||r===void 0?void 0:r.emit();(s=document.getElementById("verdocs-template-field-properties"))===null||s===void 0?void 0:s.remove()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){deleteField(this.endpoint,this.templateId,this.fieldName).then((function(){var e,o;t.fieldStore.set("fields",t.fieldStore.get("fields").filter((function(e){return e.name!==t.fieldName})));(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName});(o=document.getElementById("verdocs-template-field-properties"))===null||o===void 0?void 0:o.remove()})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!this.fieldStore.get("fields").some((function(t){return t.name===e.fieldName}))){return h(Host,{class:"empty"})}if(this.helpText&&this.showingHelp){return h(Host,null,h("h6",null,capitalize(this.fieldType)," Settings ",h("div",{style:{flex:"1"}}),h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=false}})),h("p",{class:"instructions",innerHTML:this.helpText}))}return h(Host,{id:"verdocs-template-field-properties"},h("h6",null,capitalize(this.fieldType.replace(/_/g," "))," Settings ",h("div",{style:{flex:"1"}}),this.helpText&&h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=true}})),h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:function(t){e.label=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("div",{class:"input-label"},"Role:"),h("verdocs-select-input",{value:this.roleName,options:(t=this.roleStore.state)===null||t===void 0?void 0:t.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-value",label:"Value",value:this.value,autocomplete:"off",placeholder:"Pre-defined value...",onInput:function(t){e.value=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),h("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["checkbox_group","radio_button_group"].includes(this.type)&&h("verdocs-button",{size:"small",onClick:function(t){return e.handleAddOption(t)},label:"Add Option"}),["dropdown"].includes(this.type)&&h("div",{class:"options"},h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options"),h("div",{class:"row-header"},h("h6",null,"ID"),h("h6",null,"Label"),h("div",{style:{width:"34px"}})),this.options.map((function(t,o){return h("div",{class:"row option-row",key:o},h("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[o].id=t.target.value;e.dirty=true}}),h("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[o].value=t.target.value;e.dirty=true}}),h("button",{innerHTML:TrashIcon,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),h("div",{class:"row-header"},h("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateFieldProperties.style=VerdocsTemplateFieldPropertiesStyle0;export{VerdocsCheckbox as verdocs_checkbox,VerdocsSelectInput as verdocs_select_input,VerdocsTemplateFieldProperties as verdocs_template_field_properties};
@@ -1 +0,0 @@
1
- import{r as registerInstance,h,H as Host}from"./index-b89cf6a4.js";var verdocsComponentErrorCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-component-error{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-component-error .inner{-ms-flex:1;flex:1;height:300px;display:-ms-flexbox;display:flex;font-size:18px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px;background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}';var VerdocsComponentErrorStyle0=verdocsComponentErrorCss;var VerdocsComponentError=function(){function e(e){registerInstance(this,e);this.message=""}e.prototype.render=function(){return h(Host,{key:"572b854146e540ecb3fecdab0abe7a89bdc5f6e5"},h("div",{key:"b531eabc052b083f9a99b20d57df4dc0992a1ef0",class:"inner"},this.message))};return e}();VerdocsComponentError.style=VerdocsComponentErrorStyle0;export{VerdocsComponentError as verdocs_component_error};
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";import{VerdocsEndpoint,getOrganizationMembers,getApiKeys,deleteApiKey,rotateApiKey,createApiKey,formatFullName,getOrganizationInvitations,createOrganizationInvitation,deleteOrganizationMember,deleteOrganizationInvitation,resendOrganizationInvitation,capitalize,formatInitials,getOrganization,updateOrganization,getCurrentProfile,updateProfile}from"@verdocs/js-sdk";import{V as VerdocsToast}from"./Toast-b71de686.js";import{S as SDKError}from"./errors-887f1e88.js";import{d as dateFns}from"./index-0329eed3.js";import{z}from"./index-7456b04f.js";import{i as convertToE164}from"./utils-d1c95309.js";import"./Types-e4a6eba5.js";var verdocsSettingsApiKeysCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-api-keys{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-api-keys .table{margin:12px 0}verdocs-settings-api-keys .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-api-keys .data-col svg{width:24px;height:24px}verdocs-settings-api-keys .col-name svg,verdocs-settings-api-keys .col-client_id svg,verdocs-settings-api-keys .col-profile_id svg{fill:#a1a1aa}verdocs-settings-api-keys .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-api-keys .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-api-keys .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-api-keys .header-col.col-actions{text-align:center}verdocs-settings-api-keys verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-api-keys .col-client_id,verdocs-settings-api-keys .col-actions{display:none}}';var VerdocsSettingsApiKeysStyle0=verdocsSettingsApiKeysCss;var TagIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" /></svg>';var UserIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-5.5-2.5a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zM10 12a5.99 5.99 0 00-4.793 2.39A6.483 6.483 0 0010 16.5a6.483 6.483 0 004.793-2.11A5.99 5.99 0 0010 12z" clip-rule="evenodd" /></svg>';var TrashIcon$1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var ArrowPathIcon$1='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>';var VerdocsSettingsApiKeys=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.memberInvited=createEvent(this,"memberInvited",7);this.memberUpdated=createEvent(this,"memberUpdated",7);this.memberRemoved=createEvent(this,"memberRemoved",7);this.endpoint=VerdocsEndpoint.getDefault();this.keys=[];this.creatingKey=false;this.createdKey=null;this.deletingKey=null;this.rotatingKey=null;this.newApiKeyName="";this.newApiKeyProfileId="";this.members=[]}e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.newApiKeyProfileId=this.endpoint.session.profile_id;getOrganizationMembers(this.endpoint).then((function(t){e.members=t})).catch((function(t){var n,i,r;console.log("[SETTINGS] Error loading organization members",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data));VerdocsToast("Unable to load API keys. Please try again later",{style:"error"})}));this.loadKeys();return[2]}))}))};e.prototype.loadKeys=function(){var e=this;getApiKeys(this.endpoint).then((function(t){e.keys=t})).catch((function(t){var n,i,r;console.log("[SETTINGS] Unable to load API keys",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data));VerdocsToast("Unable to load API keys. Please try again later",{style:"error"})}))};e.prototype.handleDeleteKey=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){deleteApiKey(this.endpoint,this.deletingKey.client_id).then((function(){e.deletingKey=null;VerdocsToast("API key deleted",{style:"success"});e.loadKeys()})).catch((function(t){var n,i,r;e.deletingKey=null;console.log("[SETTINGS] Unable to delete API key",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data));VerdocsToast("Unable to delete API key. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.handleRotateKey=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){rotateApiKey(this.endpoint,this.rotatingKey.client_id).then((function(t){e.rotatingKey=null;VerdocsToast("API key rotated",{style:"success"});e.loadKeys();e.createdKey=t})).catch((function(t){var n,i,r;e.rotatingKey=null;console.log("[SETTINGS] Unable to rotate API key",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data));VerdocsToast("Unable to rotate API key. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.handleCreateKey=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){createApiKey(this.endpoint,{permission:"personal",name:this.newApiKeyName,profile_id:this.newApiKeyProfileId}).then((function(t){e.creatingKey=false;e.createdKey=t;VerdocsToast("API key created",{style:"success"});e.loadKeys()})).catch((function(t){var n,i,r;e.creatingKey=false;console.log("[SETTINGS] Unable to create API key",t);(n=e.sdkError)===null||n===void 0?void 0:n.emit(new SDKError(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data));VerdocsToast("Unable to create API key. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.render=function(){var e=this;var t,n,i,r;var o=this.members.map((function(e){return{label:formatFullName(e),value:e.id}}));if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return h(Host,{class:"authentication-required"},"Must be authenticated")}return h(Host,null,h("verdocs-table",{data:this.keys,columns:[{id:"name",header:"Name",renderCell:function(e,t){return h("div",null,h("div",null,t.name))}},{id:"client_id",header:"Client ID",renderCell:function(e,t){return h("div",null,h("div",{innerHTML:TagIcon}),h("div",null,t.client_id))}},{id:"profile_id",header:"Acts as",renderCell:function(e,t){return h("div",null,h("div",{innerHTML:UserIcon}),h("div",null,formatFullName(t.profile)))}},{id:"actions",header:"Actions",renderCell:function(t,n){return h("div",null,h("div",{innerHTML:TrashIcon$1,onClick:function(){return e.deletingKey=n}}),h("div",{innerHTML:ArrowPathIcon$1,onClick:function(){return e.rotatingKey=n}}))}}]}),h("verdocs-button",{label:"Add API Key",size:"normal",onClick:function(){return e.creatingKey=true}}),this.deletingKey&&h("verdocs-dialog",{onExit:function(){return e.deletingKey=null}},h("div",{slot:"title",class:"heading"},'Delete API key "',this.deletingKey.name,'"?'),h("div",{class:"content"},h("p",null,"Are you sure you want to delete this key? This action cannot be undone."),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:function(){return e.deletingKey=null}}),h("verdocs-button",{size:"small",label:"OK",onClick:function(){return e.handleDeleteKey()}})))),this.rotatingKey&&h("verdocs-dialog",{onExit:function(){return e.rotatingKey=null}},h("div",{slot:"title",class:"heading"},'Rotate API key "',this.rotatingKey.name,'"?'),h("div",{class:"content"},h("p",null,"Are you sure you want to rotate this key? A new client secret will be generated, and the old value will become unusable. This action cannot be undone."),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:function(){return e.rotatingKey=null}}),h("verdocs-button",{size:"small",label:"OK",onClick:function(){return e.handleRotateKey()}})))),this.creatingKey&&h("verdocs-dialog",{onExit:function(){return e.creatingKey=false}},h("div",{slot:"title",class:"heading"},"Create API Key"),h("div",{class:"content"},h("verdocs-text-input",{label:"Name",placeholder:"API key name...",id:"verdocs-api-key-name",value:this.newApiKeyName,autocomplete:"off",required:true,onInput:function(t){return e.newApiKeyName=t.target.value},onFocusout:function(t){e.newApiKeyName=t.target.value.trim()}}),h("p",null,'API keys must be associated with a profile. Actions performed via API calls using this key will "act as" this profile.'),h("verdocs-select-input",{options:o,label:"Act as Profile",onInput:function(t){e.newApiKeyProfileId=t.target.value}}),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:function(){return e.creatingKey=false}}),h("verdocs-button",{size:"small",label:"OK",onClick:function(){return e.handleCreateKey()}})))),this.createdKey&&h("verdocs-dialog",{onExit:function(){return e.createdKey=null}},h("div",{slot:"title",class:"heading"},"API Key Details"),h("div",{class:"content"},h("verdocs-text-input",{label:"Name",disabled:true,value:(t=this.createdKey)===null||t===void 0?void 0:t.name}),h("verdocs-text-input",{label:"Profile",disabled:true,value:formatFullName((n=this.createdKey)===null||n===void 0?void 0:n.profile)}),h("p",null,"Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"),h("verdocs-text-input",{label:"Client ID",disabled:true,value:(i=this.createdKey)===null||i===void 0?void 0:i.client_id,copyable:true}),h("verdocs-text-input",{label:"Secret Key",disabled:true,value:(r=this.createdKey)===null||r===void 0?void 0:r.client_secret,copyable:true}),h("div",{class:"buttons"},h("verdocs-button",{size:"small",label:"Done",onClick:function(){return e.createdKey=null}})))))};return e}();VerdocsSettingsApiKeys.style=VerdocsSettingsApiKeysStyle0;var verdocsSettingsMembersCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-members{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .role{font-size:12px;width:32px;height:32px;border-radius:32px;background:#777777;color:#ffffff;font-weight:700;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-settings-members .table{margin:12px 0}verdocs-settings-members .data-col div{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-settings-members .data-col svg{width:24px;height:24px}verdocs-settings-members .col-name svg,verdocs-settings-members .col-client_id svg,verdocs-settings-members .col-profile_id svg{fill:#a1a1aa}verdocs-settings-members .col-actions svg{fill:#ffffff;stroke:#a1a1aa}verdocs-settings-members .col-actions svg:hover{cursor:pointer;stroke:red}verdocs-settings-members .col-actions>div{-ms-flex-pack:center;justify-content:center}verdocs-settings-members .header-col.col-actions{text-align:center}verdocs-settings-members verdocs-dialog p{font-size:16px;line-height:18px;margin:0 0 1em 0}@media all and (max-width: 450px){verdocs-settings-members .col-email,verdocs-settings-members .col-phone,verdocs-settings-members .col-actions{display:none}}';var VerdocsSettingsMembersStyle0=verdocsSettingsMembersCss;var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var ArrowPathIcon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>';var getRoleColor=function(e){if(e.find((function(e){return e.name==="owner"}))!==undefined)return"#9333ea";if(e.find((function(e){return e.name==="admin"}))!==undefined)return"#2563eb";if(e.find((function(e){return e.name==="member"}))!==undefined)return"#16a34a";if(e.find((function(e){return e.name==="basic_user"}))!==undefined)return"#ea580c";if(e.find((function(e){return e.name==="contact"}))!==undefined)return"#52525B"};var roleOptions=[{label:"Contact",value:"contact"},{label:"Basic User",value:"basic_user"},{label:"Member",value:"member"},{label:"Admin",value:"admin"},{label:"Owner",value:"owner"}];var VerdocsSettingsMembers=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.memberInvited=createEvent(this,"memberInvited",7);this.memberUpdated=createEvent(this,"memberUpdated",7);this.memberRemoved=createEvent(this,"memberRemoved",7);this.endpoint=VerdocsEndpoint.getDefault();this.members=[];this.invited=[];this.selectedTab=0;this.invitingMember=false;this.newEmailAddress="";this.newFirst="";this.newLast="";this.newRole="member";this.submitting=false;this.deletingInvitation=null;this.resendingInvitation=null;this.deletingMember=null}e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.loadMembers().catch((function(e){return console.log("Unknown Error",e)}));return[2]}))}))};e.prototype.loadMembers=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i,r,o,s;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);return[4,Promise.all([getOrganizationMembers(this.endpoint),getOrganizationInvitations(this.endpoint)])];case 1:i=a.sent(),r=i[0],o=i[1];this.members=r;this.invited=o;this.newRole="member";return[3,3];case 2:s=a.sent();(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(n=s.response)===null||n===void 0?void 0:n.data));VerdocsToast("Unable to load members. Please try again later");return[3,3];case 3:return[2]}}))}))};e.prototype.handleInviteMember=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.submitting=true;createOrganizationInvitation(VerdocsEndpoint.getDefault(),{email:this.newEmailAddress,first_name:this.newFirst,last_name:this.newLast,role:this.newRole}).then((function(t){console.log("[SETTINGS] Invited member",t);e.invitingMember=false;e.submitting=false;e.newRole="member";e.newEmailAddress="";e.newFirst="";e.newLast="";VerdocsToast("Invitation sent!",{style:"success"});e.loadMembers()})).catch((function(t){console.log("[SETTINGS] Unable to invite member",t);e.invitingMember=false;e.submitting=false;e.newRole="member";e.newEmailAddress="";e.newFirst="";e.newLast="";VerdocsToast("Unable to invite member. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.handleDeleteMember=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.submitting=true;deleteOrganizationMember(VerdocsEndpoint.getDefault(),this.deletingMember.email).then((function(){e.submitting=false;e.deletingMember=null;VerdocsToast("The member has been deleted.",{style:"success"});e.loadMembers()})).catch((function(t){e.submitting=false;e.deletingMember=null;console.log("Delete error",t);VerdocsToast("Unable to cancel invitation. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.handleDeleteInvitation=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.submitting=true;deleteOrganizationInvitation(VerdocsEndpoint.getDefault(),this.deletingInvitation.email).then((function(){e.submitting=false;e.deletingInvitation=null;VerdocsToast("The invitation has been cancelled.",{style:"success"});e.loadMembers()})).catch((function(t){e.submitting=false;e.deletingInvitation=null;console.log("Delete error",t);VerdocsToast("Unable to cancel invitation. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.handleResendInvitation=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.submitting=true;resendOrganizationInvitation(VerdocsEndpoint.getDefault(),this.resendingInvitation.email).then((function(){e.submitting=false;e.resendingInvitation=null;VerdocsToast("The invitation has been resent.",{style:"success"});e.loadMembers()})).catch((function(t){e.submitting=false;e.resendingInvitation=null;console.log("REsend error",t);VerdocsToast("Unable to resend invitation. Please try again later",{style:"error"})}));return[2]}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return h(Host,{class:"authentication-required"},"Must be authenticated")}return h(Host,null,h("verdocs-tabs",{tabs:[{label:"Members (".concat(this.members.length,")")},{label:"Pending Invitations (".concat(this.invited.length,")")}],onSelectTab:function(t){return e.selectedTab=t.detail.index}}),this.selectedTab===0&&h("verdocs-table",{data:this.members,columns:[{id:"name",renderHeader:function(){return"Member"},renderCell:function(e,t){return h("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},h("div",{class:"role",style:{backgroundColor:getRoleColor(t.roles)}},formatInitials(t)),h("span",null,formatFullName(t)))}},{id:"email",header:"E-mail Address"},{id:"phone",header:"Phone Number"},{id:"roles",header:"Role",renderCell:function(e,t){return"".concat(t.roles)}},{id:"actions",header:"Actions",renderCell:function(t,n){return h("div",null,n.id!==e.endpoint.session.profile_id&&h("div",{innerHTML:TrashIcon,onClick:function(){return e.deletingMember=n}}))}}]}),this.selectedTab===1&&h("verdocs-table",{data:this.invited,columns:[{id:"email",header:"E-mail Address"},{id:"generated_at",header:"Invited",renderCell:function(e,t){return h("div",null,dateFns.format(new Date(t.generated_at),"MMM d, Y"))}},{id:"role",header:"Role",renderCell:function(e,t){return h("div",null,t.role)}},{id:"status",header:"Status",renderCell:function(e,t){return h("div",null,capitalize(t.status))}},{id:"actions",header:"Actions",renderCell:function(t,n){return h("div",null,h("div",{innerHTML:TrashIcon,onClick:function(){return e.deletingInvitation=n}}),h("div",{innerHTML:ArrowPathIcon,onClick:function(){return e.resendingInvitation=n}}))}}]}),h("verdocs-button",{label:"Invite New Member",size:"normal",disabled:this.submitting,onClick:function(){return e.invitingMember=true}}),this.invitingMember&&h("verdocs-dialog",{onExit:function(){return e.invitingMember=false}},h("div",{slot:"title",class:"heading"},"Invite New Member"),h("div",{class:"content"},h("verdocs-text-input",{label:"E-mail Address",placeholder:"Enter the user's email address...",id:"verdocs-invite-email",value:this.newEmailAddress,autocomplete:"off",required:true,onInput:function(t){return e.newEmailAddress=t.target.value},onFocusout:function(t){e.newEmailAddress=t.target.value.trim()}}),h("verdocs-text-input",{label:"First",placeholder:"First name...",id:"verdocs-invite-first",value:this.newFirst,autocomplete:"off",required:true,onInput:function(t){return e.newFirst=t.target.value},onFocusout:function(t){e.newFirst=t.target.value.trim()}}),h("verdocs-text-input",{label:"Last",placeholder:"Enter the user's last name...",id:"verdocs-invite-last",value:this.newLast,autocomplete:"off",required:true,onInput:function(t){return e.newLast=t.target.value},onFocusout:function(t){e.newLast=t.target.value.trim()}}),h("div",{style:{marginBottom:"20px"}}),h("verdocs-select-input",{options:roleOptions,label:"Role",onInput:function(t){e.newRole=t.target.value}}),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",label:"Cancel",disabled:this.submitting,onClick:function(){return e.invitingMember=false}}),h("verdocs-button",{size:"small",label:"OK",disabled:this.submitting||!this.newEmailAddress||!this.newRole,onClick:function(){return e.handleInviteMember()}})))),this.deletingMember&&h("verdocs-dialog",{onExit:function(){return e.deletingMember=null}},h("div",{slot:"title",class:"heading"},"Delete Member?"),h("div",{class:"content"},h("p",null,"Are you sure you want to delete this member? This action cannot be undone."),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:function(){return e.deletingMember=null}}),h("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:function(){return e.handleDeleteMember()}})))),this.deletingInvitation&&h("verdocs-dialog",{onExit:function(){return e.deletingInvitation=null}},h("div",{slot:"title",class:"heading"},"Cancel Invitation?"),h("div",{class:"content"},h("p",null,"Are you sure you want to cancel this invitation? This action cannot be undone."),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:function(){return e.deletingInvitation=null}}),h("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:function(){return e.handleDeleteInvitation()}})))),this.resendingInvitation&&h("verdocs-dialog",{onExit:function(){return e.resendingInvitation=null}},h("div",{slot:"title",class:"heading"},"Resend Invitation?"),h("div",{class:"content"},h("p",null,"The user will receive an email reminder to join your organization."),h("div",{class:"buttons"},h("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:function(){return e.resendingInvitation=null}}),h("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:function(){return e.handleResendInvitation()}})))))};return e}();VerdocsSettingsMembers.style=VerdocsSettingsMembersStyle0;var verdocsSettingsOrganizationCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-organization{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-organization .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-organization .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-organization verdocs-text-input{margin:10px 0}verdocs-settings-organization verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-organization .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}';var VerdocsSettingsOrganizationStyle0=verdocsSettingsOrganizationCss;var schema$1=z.object({business_name:z.string().trim().max(30).optional(),contact_email:z.string().trim().email("Invalid email").optional().or(z.literal("")),phone:z.preprocess((function(e){return convertToE164(String(e).trim())}),z.string().optional()),url:z.string().trim().optional()});var VerdocsSettingsOrganization=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.organizationUpdated=createEvent(this,"organizationUpdated",7);this.endpoint=VerdocsEndpoint.getDefault();this.valid=false;this.dirty=false;this.submitting=false;this.name="";this.contact_email="";this.phone="";this.url=""}e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,getOrganization(this.endpoint,this.endpoint.session.organization_id)];case 1:e=t.sent();console.log("[SETTINGS] Loaded organization",e);this.resetForm(e);return[2]}}))}))};e.prototype.resetForm=function(e){this.name=e.name;this.contact_email=e.contact_email;this.phone=e.phone;this.url=e.url;this.dirty=false;this.valid=true};e.prototype.handleSubmit=function(e){var t=this;e.preventDefault();e.stopPropagation();updateOrganization(VerdocsEndpoint.getDefault(),this.endpoint.session.organization_id,{name:this.name,contact_email:this.contact_email,phone:this.phone,url:this.url}).then((function(e){var n;console.log("[SETTINGS] Update result",e);(n=t.organizationUpdated)===null||n===void 0?void 0:n.emit({endpoint:t.endpoint,organization:e});t.resetForm(e)})).catch((function(e){return VerdocsToast("Error updating organization: ".concat(e.message),{style:"error"})}))};e.prototype.processFields=function(){var e=schema$1.safeParse({name:this.name,contact_email:this.contact_email,phone:this.phone,url:this.url});console.log("[SETTINGS] Validation result",e);this.valid=e.success;this.dirty=true};e.prototype.render=function(){var e=this;if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return h(Host,{class:"authentication-required"},"Must be authenticated")}return h(Host,null,h("h1",null,"Organization Profile"),h("form",{onSubmit:function(t){return e.handleSubmit(t)}},h("div",{class:"columns"},h("div",{class:"column"},h("verdocs-text-input",{id:"verdocs-organization-name",value:this.name,autocomplete:"off",label:"Name",required:false,disabled:false,placeholder:"Enter your organization's name...",onInput:function(t){return e.name=t.target.value},onFocusout:function(t){e.name=t.target.value.trim();e.processFields()}}),h("verdocs-text-input",{id:"verdocs-organization-url",value:this.url,autocomplete:"off",label:"Web URL",placeholder:"Enter your Web URL...",onInput:function(t){return e.url=t.target.value},onFocusout:function(t){e.url=t.target.value.trim();e.processFields()}}),h("verdocs-text-input",{id:"verdocs-organization-phone",value:this.phone,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:function(t){return e.phone=t.target.value},onFocusout:function(t){e.phone=t.target.value.trim();e.processFields()}})),h("div",{class:"column"},h("verdocs-text-input",{id:"verdocs-organization-email",value:this.contact_email,clearable:true,autocomplete:"off",label:"Contact Email",placeholder:"Enter your contact email address...",onInput:function(t){return e.contact_email=t.target.value},onFocusout:function(t){e.contact_email=t.target.value.trim();e.processFields()}}))),h("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty})))};return e}();VerdocsSettingsOrganization.style=VerdocsSettingsOrganizationStyle0;var verdocsSettingsProfileCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings-profile{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-settings-profile .columns{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-settings-profile .column{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-settings-profile verdocs-text-input{margin:10px 0}verdocs-settings-profile verdocs-text-input input{height:32px}@media screen and (max-width: 600px){verdocs-settings-profile .columns{gap:0;-ms-flex-direction:column;flex-direction:column}}';var VerdocsSettingsProfileStyle0=verdocsSettingsProfileCss;var schema=z.object({first_name:z.string().trim().min(1,"First name is required").max(30),last_name:z.string().trim().min(1,"Last name is required").max(30),email:z.string().trim().email("Invalid email").min(1,"Email is required"),phone:z.preprocess((function(e){return convertToE164(String(e).trim())}),z.string())});var VerdocsSettingsProfile=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.profileUpdated=createEvent(this,"profileUpdated",7);this.endpoint=VerdocsEndpoint.getDefault();this.valid=false;this.dirty=false;this.submitting=false;this.first_name="";this.last_name="";this.email="";this.phone=""}e.prototype.componentWillLoad=function(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,getCurrentProfile(this.endpoint)];case 1:e=t.sent();console.log("[SETTINGS] Loaded profile",e);this.resetForm(e);return[2]}}))}))};e.prototype.resetForm=function(e){this.first_name=e.first_name;this.last_name=e.last_name;this.email=e.email;this.phone=e.phone;this.dirty=false;this.valid=true};e.prototype.handleSubmit=function(e){var t=this;e.preventDefault();e.stopPropagation();updateProfile(VerdocsEndpoint.getDefault(),this.endpoint.session.profile_id,{first_name:this.first_name,last_name:this.last_name,phone:this.phone}).then((function(e){var n;console.log("[SETTINGS] Update result",e);(n=t.profileUpdated)===null||n===void 0?void 0:n.emit({endpoint:t.endpoint,profile:e});t.resetForm(e)})).catch((function(e){return VerdocsToast("Error updating profile: ".concat(e.message),{style:"error"})}))};e.prototype.processFields=function(){var e=schema.safeParse({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone});console.log("[SETTINGS] Validation result",e);this.valid=e.success;this.dirty=true};e.prototype.render=function(){var e=this;if(!this.endpoint.session){console.log("[SETTINGS] Must be authenticated");return h(Host,{class:"authentication-required"},"Must be authenticated")}return h(Host,null,h("h1",null,"My Profile"),h("form",{onSubmit:function(t){return e.handleSubmit(t)}},h("div",{class:"columns"},h("div",{class:"column"},h("verdocs-text-input",{id:"verdocs-profile-first-name",value:this.first_name,autocomplete:"off",label:"First Name",required:true,placeholder:"Enter your first name...",onInput:function(t){return e.first_name=t.target.value},onFocusout:function(t){e.first_name=t.target.value.trim();e.processFields()}}),h("verdocs-text-input",{id:"verdocs-profile-last-name",value:this.last_name,autocomplete:"off",label:"Last Name",required:true,placeholder:"Enter your last name...",onInput:function(t){return e.last_name=t.target.value},onFocusout:function(t){e.last_name=t.target.value.trim();e.processFields()}})),h("div",{class:"column"},h("verdocs-text-input",{id:"verdocs-profile-email",value:this.email,autocomplete:"off",label:"Email Address",required:true,disabled:true,placeholder:"Enter your email address...",onInput:function(t){return e.email=t.target.value},onFocusout:function(t){e.email=t.target.value.trim();e.processFields()}}),h("verdocs-text-input",{id:"verdocs-profile-phone",value:this.phone,clearable:true,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:function(t){return e.phone=t.target.value},onFocusout:function(t){e.phone=t.target.value.trim();e.processFields()}}))),h("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty})))};return e}();VerdocsSettingsProfile.style=VerdocsSettingsProfileStyle0;export{VerdocsSettingsApiKeys as verdocs_settings_api_keys,VerdocsSettingsMembers as verdocs_settings_members,VerdocsSettingsOrganization as verdocs_settings_organization,VerdocsSettingsProfile as verdocs_settings_profile};
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,r,i){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function s(t){try{c(i.next(t))}catch(t){n(t)}}function a(t){try{c(i["throw"](t))}catch(t){n(t)}}function c(t){t.done?r(t.value):o(t.value).then(s,a)}c((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,o,n,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return c([t,e])}}function c(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(i=1,o&&(n=a[0]&2?o["return"]:a[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;if(o=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;o=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){r.label=a[1];break}if(a[0]===6&&r.label<n[1]){r.label=n[1];n=a;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(a);break}if(n[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];o=0}finally{i=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";import{VerdocsEndpoint}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";var verdocsSettingsCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-settings{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-settings .tabs{gap:4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid #654dcb}verdocs-settings .tabs .tab{cursor:pointer;padding:5px 10px;color:#ffffff;background-color:#777777}verdocs-settings .tabs .tab.active{color:#ffffff;background-color:#654dcb}';var VerdocsSettingsStyle0=verdocsSettingsCss;var VerdocsSettings=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.tab="profile"}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,r;return __generator(this,(function(i){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SETTINGS] Unable to start session, must be authenticated");return[2]}}catch(i){console.log("[SETTINGS] Error with session",i);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(i.message,(e=i.response)===null||e===void 0?void 0:e.status,(r=i.response)===null||r===void 0?void 0:r.data))}return[2]}))}))};t.prototype.render=function(){var t=this;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return h(Host,null,h("div",{class:"tabs"},h("div",{class:"tab ".concat(this.tab==="profile"?"active":""),onClick:function(){return t.tab="profile"}},"Profile"),h("div",{class:"tab ".concat(this.tab==="organization"?"active":""),onClick:function(){return t.tab="organization"}},"Organization"),h("div",{class:"tab ".concat(this.tab==="members"?"active":""),onClick:function(){return t.tab="members"}},"Members"),h("div",{class:"tab ".concat(this.tab==="apikeys"?"active":""),onClick:function(){return t.tab="apikeys"}},"API Keys")),this.tab==="profile"&&h("verdocs-settings-profile",{endpoint:this.endpoint}),this.tab==="organization"&&h("verdocs-settings-organization",{endpoint:this.endpoint}),this.tab==="members"&&h("verdocs-settings-members",{endpoint:this.endpoint}),this.tab==="apikeys"&&h("verdocs-settings-api-keys",{endpoint:this.endpoint}))};return t}();VerdocsSettings.style=VerdocsSettingsStyle0;export{VerdocsSettings as verdocs_settings};
@@ -1 +0,0 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";var verdocsTabsCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-tabs{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-tabs .tab{display:-ms-flexbox;display:flex;color:#111111;cursor:pointer;font-size:14px;font-weight:400;padding:5px 10px;-ms-flex-align:center;align-items:center;text-transform:none;-ms-flex-pack:center;justify-content:center;border-bottom:4px solid transparent}verdocs-tabs .tab:focus{border:none;outline:none}verdocs-tabs .tab.active{color:#000000;font-weight:500;border-bottom:4px solid #654dcb}verdocs-tabs .tab.disabled{color:#aaaaaa;cursor:default}';var VerdocsTabsStyle0=verdocsTabsCss;var VerdocsTabs=function(){function e(e){registerInstance(this,e);this.selectTab=createEvent(this,"selectTab",7);this.tabs=[];this.selectedTab=0}e.prototype.handleSelectTab=function(e){var r;(r=this.selectTab)===null||r===void 0?void 0:r.emit({tab:this.tabs[e],index:e})};e.prototype.render=function(){var e=this;return h(Host,{key:"40357821a495d7b0c94b205ed90e5fd83b4a5146"},this.tabs.map((function(r,a){return h("div",{class:"tab ".concat(a===e.selectedTab?"active":""," ").concat(r.disabled?"disabled":""),onClick:r.disabled?function(){}:function(){return e.handleSelectTab(a)}},r.label)})),h("div",{key:"dd9e2a621082bd61f62b161830c6fd1138f0e8c1",class:"flex flex-1"}),h("slot",{key:"4e64f7e7221fd9d5613f83db4067f71f2c4c1f12"},h("div",{key:"4926afa57bb87a838b66807837f3b71c436a4586"})))};return e}();VerdocsTabs.style=VerdocsTabsStyle0;export{VerdocsTabs as verdocs_tabs};
@@ -1,26 +0,0 @@
1
- import { VerdocsEndpoint } from '@verdocs/js-sdk';
2
- import { EventEmitter } from '../../../stencil-public-runtime';
3
- import { SDKError } from '../../../utils/errors';
4
- /**
5
- * Display a template preview experience. This will display the template's attached
6
- * documents with signing fields overlaid on each page. Fields will be color-coded
7
- * by recipient, and will be read-only (cannot be filled, moved, or altered).
8
- *
9
- * ```ts
10
- * <verdocs-settings />
11
- * ```
12
- */
13
- export declare class VerdocsSettings {
14
- /**
15
- * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
16
- */
17
- endpoint: VerdocsEndpoint;
18
- /**
19
- * Event fired if an error occurs. The event details will contain information about the error. Most errors will
20
- * terminate the process, and the calling application should correct the condition and re-render the component.
21
- */
22
- sdkError: EventEmitter<SDKError>;
23
- tab: string;
24
- componentWillLoad(): Promise<void>;
25
- render(): any;
26
- }
@@ -1,54 +0,0 @@
1
- import { IApiKey } from '@verdocs/js-sdk';
2
- import { EventEmitter } from '../../../stencil-public-runtime';
3
- import { IProfile, VerdocsEndpoint } from '@verdocs/js-sdk';
4
- import { SDKError } from '../../../utils/errors';
5
- /**
6
- * Displays a settings form that allows the user to manage their API keys.
7
- */
8
- export declare class VerdocsSettingsApiKeys {
9
- /**
10
- * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
11
- */
12
- endpoint: VerdocsEndpoint;
13
- /**
14
- * Event fired if an error occurs. The event details will contain information about the error. Most errors will
15
- * terminate the process, and the calling application should correct the condition and re-render the component.
16
- */
17
- sdkError: EventEmitter<SDKError>;
18
- /**
19
- * Event fired when the user chooses to invite a new member.
20
- */
21
- memberInvited: EventEmitter<{
22
- endpoint: VerdocsEndpoint;
23
- member: IProfile;
24
- }>;
25
- /**
26
- * Event fired when the user chooses to invite a new member.
27
- */
28
- memberUpdated: EventEmitter<{
29
- endpoint: VerdocsEndpoint;
30
- member: IProfile;
31
- }>;
32
- /**
33
- * Event fired when the user chooses to invite a new member.
34
- */
35
- memberRemoved: EventEmitter<{
36
- endpoint: VerdocsEndpoint;
37
- member: IProfile;
38
- }>;
39
- keys: IApiKey[];
40
- creatingKey: boolean;
41
- createdKey: IApiKey | null;
42
- deletingKey: IApiKey | null;
43
- rotatingKey: IApiKey | null;
44
- newApiKeyName: string;
45
- newApiKeyProfileId: string;
46
- members: IProfile[];
47
- componentWillLoad(): void;
48
- componentDidLoad(): Promise<void>;
49
- loadKeys(): void;
50
- handleDeleteKey(): Promise<void>;
51
- handleRotateKey(): Promise<void>;
52
- handleCreateKey(): Promise<void>;
53
- render(): any;
54
- }
@@ -1,58 +0,0 @@
1
- import { IOrganizationInvitation, VerdocsEndpoint, IProfile, TRole } from '@verdocs/js-sdk';
2
- import { EventEmitter } from '../../../stencil-public-runtime';
3
- import { SDKError } from '../../../utils/errors';
4
- /**
5
- * Displays a settings form that allows the user to manage their Verdocs profile.
6
- */
7
- export declare class VerdocsSettingsMembers {
8
- /**
9
- * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
10
- */
11
- endpoint: VerdocsEndpoint;
12
- /**
13
- * Event fired if an error occurs. The event details will contain information about the error. Most errors will
14
- * terminate the process, and the calling application should correct the condition and re-render the component.
15
- */
16
- sdkError: EventEmitter<SDKError>;
17
- /**
18
- * Event fired when the user chooses to invite a new member.
19
- */
20
- memberInvited: EventEmitter<{
21
- endpoint: VerdocsEndpoint;
22
- member: IProfile;
23
- }>;
24
- /**
25
- * Event fired when the user chooses to invite a new member.
26
- */
27
- memberUpdated: EventEmitter<{
28
- endpoint: VerdocsEndpoint;
29
- member: IProfile;
30
- }>;
31
- /**
32
- * Event fired when the user chooses to invite a new member.
33
- */
34
- memberRemoved: EventEmitter<{
35
- endpoint: VerdocsEndpoint;
36
- member: IProfile;
37
- }>;
38
- members: IProfile[];
39
- invited: IOrganizationInvitation[];
40
- selectedTab: number;
41
- invitingMember: boolean;
42
- newEmailAddress: string;
43
- newFirst: string;
44
- newLast: string;
45
- newRole: TRole;
46
- submitting: boolean;
47
- deletingInvitation: IOrganizationInvitation | null;
48
- resendingInvitation: IOrganizationInvitation | null;
49
- deletingMember: IProfile | null;
50
- componentWillLoad(): void;
51
- componentDidLoad(): Promise<void>;
52
- loadMembers(): Promise<void>;
53
- handleInviteMember(): Promise<void>;
54
- handleDeleteMember(): Promise<void>;
55
- handleDeleteInvitation(): Promise<void>;
56
- handleResendInvitation(): Promise<void>;
57
- render(): any;
58
- }
@@ -1 +0,0 @@
1
- export declare const TimeZones: string[][];