@verdocs/web-sdk 2.3.86 → 2.3.88

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 (73) hide show
  1. package/dist/cjs/{utils-13f8ed3f.js → utils-e2bd04bf.js} +2 -4
  2. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  3. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-field-attachment_15.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-preview_8.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-sign.cjs.entry.js +56 -34
  11. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
  13. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +55 -33
  14. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +3 -3
  15. package/dist/collection/utils/utils.js +2 -4
  16. package/dist/components/utils.js +2 -4
  17. package/dist/components/verdocs-sign.js +55 -33
  18. package/dist/custom-elements.json +2147 -0
  19. package/dist/docs.json +1 -1
  20. package/dist/esm/{utils-a56ee5e9.js → utils-f35325fe.js} +2 -4
  21. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  22. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  23. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  24. package/dist/esm/verdocs-field-attachment_15.entry.js +1 -1
  25. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  26. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  27. package/dist/esm/verdocs-preview_8.entry.js +1 -1
  28. package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
  29. package/dist/esm/verdocs-sign.entry.js +56 -34
  30. package/dist/esm/verdocs-template-fields_4.entry.js +1 -1
  31. package/dist/esm/verdocs-view.entry.js +1 -1
  32. package/dist/esm-es5/{utils-a56ee5e9.js → utils-f35325fe.js} +1 -1
  33. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  34. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  35. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  36. package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -1
  37. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  38. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  39. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  40. package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
  41. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  42. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  43. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  44. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +2 -0
  45. package/dist/types/utils/utils.d.ts +1 -1
  46. package/dist/verdocs-web-sdk/{p-e63fe8b9.system.entry.js → p-078e5b77.system.entry.js} +1 -1
  47. package/dist/verdocs-web-sdk/{p-0ef04e14.system.entry.js → p-1a2d3a78.system.entry.js} +1 -1
  48. package/dist/verdocs-web-sdk/{p-dd9dba09.entry.js → p-1acb7da0.entry.js} +1 -1
  49. package/dist/verdocs-web-sdk/p-2ad3ba4f.entry.js +1 -0
  50. package/dist/verdocs-web-sdk/{p-bb983c03.entry.js → p-2b874610.entry.js} +1 -1
  51. package/dist/verdocs-web-sdk/{p-be7390d8.system.entry.js → p-33c284a7.system.entry.js} +1 -1
  52. package/dist/verdocs-web-sdk/{p-964f83ef.entry.js → p-43bdeda7.entry.js} +1 -1
  53. package/dist/verdocs-web-sdk/{p-5c67e9f6.system.entry.js → p-473926f1.system.entry.js} +1 -1
  54. package/dist/verdocs-web-sdk/{p-7f487279.entry.js → p-55e47f7d.entry.js} +1 -1
  55. package/dist/verdocs-web-sdk/{p-69422d8f.system.entry.js → p-621549c9.system.entry.js} +1 -1
  56. package/dist/verdocs-web-sdk/{p-b72328af.js → p-632bdc29.js} +1 -1
  57. package/dist/verdocs-web-sdk/{p-3dc2013b.system.entry.js → p-64974b4f.system.entry.js} +1 -1
  58. package/dist/verdocs-web-sdk/{p-1fa5ef9a.entry.js → p-683e778c.entry.js} +1 -1
  59. package/dist/verdocs-web-sdk/{p-1823e8cd.entry.js → p-81acd17f.entry.js} +1 -1
  60. package/dist/verdocs-web-sdk/{p-e1b527eb.entry.js → p-851737fb.entry.js} +1 -1
  61. package/dist/verdocs-web-sdk/{p-bb2b0122.entry.js → p-8a5ef117.entry.js} +1 -1
  62. package/dist/verdocs-web-sdk/{p-21294863.system.entry.js → p-907de1bb.system.entry.js} +1 -1
  63. package/dist/verdocs-web-sdk/{p-98c9b7d7.entry.js → p-9d8e63ea.entry.js} +1 -1
  64. package/dist/verdocs-web-sdk/{p-b55a122e.system.entry.js → p-a5499e42.system.entry.js} +1 -1
  65. package/dist/verdocs-web-sdk/{p-cf6a9502.entry.js → p-c0e43c7f.entry.js} +1 -1
  66. package/dist/verdocs-web-sdk/{p-8de34628.system.entry.js → p-d0a110f1.system.entry.js} +1 -1
  67. package/dist/verdocs-web-sdk/{p-0cafdb16.system.js → p-e041e991.system.js} +1 -1
  68. package/dist/verdocs-web-sdk/{p-04bef805.system.entry.js → p-ee408daa.system.entry.js} +1 -1
  69. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  70. package/dist/verdocs-web-sdk/{p-012d2533.system.entry.js → p-f461f285.system.entry.js} +1 -1
  71. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  72. package/package.json +1 -1
  73. package/dist/verdocs-web-sdk/p-a5f94a3f.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,h as s,H as i}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as n}from"./p-2415be91.js";import{a as r,c as a,b as o}from"./p-5e808a0b.js";import{V as l}from"./p-ed416acf.js";import{S as c}from"./p-7a1b2643.js";import{g as d,a as u,u as h}from"./p-3e607686.js";import{f as m}from"./p-c220af42.js";import{c as p}from"./p-b72328af.js";import"./p-eab67c09.js";import"./p-dc2ad047.js";import"./p-1b4e7078.js";var v=function(e,t){return e.api.get("/organizations/".concat(t,"/profiles")).then((function(e){return e.data}))};const f=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.keys=[],this.creatingKey=!1,this.createdKey=null,this.deletingKey=null,this.rotatingKey=null,this.newApiKeyName="",this.newApiKeyProfileId="",this.members=[]}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.newApiKeyProfileId=this.endpoint.session.profile_id,v(this.endpoint,this.endpoint.session.organization_id).then((e=>{this.members=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Error loading organization members",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})})),this.loadKeys()}loadKeys(){var e,t;(e=this.endpoint,t=this.endpoint.session.organization_id,e.api.get("/organizations/".concat(t,"/api_key")).then((function(e){return e.data}))).then((e=>{this.keys=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Unable to load API keys",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})}))}async handleDeleteKey(){var e,t,s;(e=this.endpoint,t=this.deletingKey.organization_id,s=this.deletingKey.client_id,e.api.delete("/organizations/".concat(t,"/api_key/").concat(s)).then((function(e){return e.data}))).then((()=>{this.deletingKey=null,l("API key deleted",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.deletingKey=null,console.log("[SETTINGS] Unable to delete API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to delete API key. Please try again later",{style:"error"})}))}async handleRotateKey(){var e,t,s;(e=this.endpoint,t=this.rotatingKey.organization_id,s=this.rotatingKey.client_id,e.api.put("/organizations/".concat(t,"/api_key/").concat(s,"/rotate")).then((function(e){return e.data}))).then((e=>{this.rotatingKey=null,l("API key rotated",{style:"success"}),this.loadKeys(),this.createdKey=e})).catch((e=>{var t,s,i;this.rotatingKey=null,console.log("[SETTINGS] Unable to rotate API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to rotate API key. Please try again later",{style:"error"})}))}async handleCreateKey(){var e,t,s;(e=this.endpoint,t=this.endpoint.session.organization_id,s={name:this.newApiKeyName,profile_id:this.newApiKeyProfileId},e.api.post("/organizations/".concat(t,"/api_key"),s).then((function(e){return e.data}))).then((e=>{this.creatingKey=!1,this.createdKey=e,l("API key created",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.creatingKey=!1,console.log("[SETTINGS] Unable to create API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to create API key. Please try again later",{style:"error"})}))}render(){var e,t,n,a;const o=this.members.map((e=>({label:r(e),value:e.id})));return this.endpoint.session?s(i,null,s("verdocs-table",{data:this.keys,columns:[{id:"name",header:"Name",renderCell:(e,t)=>s("div",null,s("div",null,t.name))},{id:"client_id",header:"Client ID",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<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>'}),s("div",null,t.client_id))},{id:"profile_id",header:"Acts as",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<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>'}),s("div",null,r(t.profile)))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<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>',onClick:()=>this.deletingKey=t}),s("div",{innerHTML:'<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>',onClick:()=>this.rotatingKey=t}))}]}),s("verdocs-button",{label:"Add API Key",size:"normal",onClick:()=>this.creatingKey=!0}),this.deletingKey&&s("verdocs-dialog",{onExit:()=>this.deletingKey=null},s("div",{slot:"title",class:"heading"},'Delete API key "',this.deletingKey.name,'"?'),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this key? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.deletingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleDeleteKey()})))),this.rotatingKey&&s("verdocs-dialog",{onExit:()=>this.rotatingKey=null},s("div",{slot:"title",class:"heading"},'Rotate API key "',this.rotatingKey.name,'"?'),s("div",{class:"content"},s("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."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.rotatingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleRotateKey()})))),this.creatingKey&&s("verdocs-dialog",{onExit:()=>this.creatingKey=!1},s("div",{slot:"title",class:"heading"},"Create API Key"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",placeholder:"API key name...",id:"verdocs-api-key-name",value:this.newApiKeyName,autocomplete:"off",required:!0,onInput:e=>this.newApiKeyName=e.target.value,onFocusout:e=>{this.newApiKeyName=e.target.value.trim()}}),s("p",null,'API keys must be associated with a profile. Actions performed via API calls using this key will "act as" this profile.'),s("verdocs-select-input",{options:o,label:"Act as Profile",onInput:e=>{this.newApiKeyProfileId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.creatingKey=!1}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleCreateKey()})))),this.createdKey&&s("verdocs-dialog",{onExit:()=>this.createdKey=null},s("div",{slot:"title",class:"heading"},"API Key Details"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",disabled:!0,value:null===(e=this.createdKey)||void 0===e?void 0:e.name}),s("verdocs-text-input",{label:"Profile",disabled:!0,value:r(null===(t=this.createdKey)||void 0===t?void 0:t.profile)}),s("p",null,"Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"),s("verdocs-text-input",{label:"Client ID",disabled:!0,value:null===(n=this.createdKey)||void 0===n?void 0:n.client_id,copyable:!0}),s("verdocs-text-input",{label:"Secret Key",disabled:!0,value:null===(a=this.createdKey)||void 0===a?void 0:a.client_secret,copyable:!0}),s("div",{class:"buttons"},s("verdocs-button",{size:"small",label:"Done",onClick:()=>this.createdKey=null}))))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};f.style='@-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}}';const g='<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>',b=e=>void 0!==e.find((e=>"owner"===e.name))?"Owner":void 0!==e.find((e=>"admin"===e.name))?"Admin":void 0!==e.find((e=>"member"===e.name))?"Member":void 0!==e.find((e=>"basic_user"===e.name))?"Basic User":void 0!==e.find((e=>"contact"===e.name))?"Contact":void 0,y=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.members=[],this.invited=[],this.roles=[],this.selectedTab=0,this.invitingMember=!1,this.newEmailAddress="",this.newRoleId="",this.submitting=!1,this.deletingInvitation=null,this.resendingInvitation=null,this.deletingMember=null}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.loadMembers().catch((e=>console.log("Unknown Error",e)))}async loadMembers(){var e,t,s,i,n,r;try{const[t,s,i]=await Promise.all([d(this.endpoint),v(this.endpoint,this.endpoint.session.organization_id),(n=this.endpoint,r=this.endpoint.session.organization_id,n.api.get("/organizations/".concat(r,"/invitation")).then((function(e){return e.data})))]);this.roles=t,this.members=s,this.invited=i,this.newRoleId=(null===(e=t.find((e=>"member"===e.name)))||void 0===e?void 0:e.id)||""}catch(e){null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load members. Please try again later")}}async handleInviteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.endpoint.session.organization_id,s={email:this.newEmailAddress,role_id:this.newRoleId,organization_id:this.endpoint.session.organization_id},e.api.post("/organizations/".concat(t,"/invitation"),s).then((function(e){return e.data}))).then((e=>{console.log("[SETTINGS] Invited member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Invitation sent!",{style:"success"}),this.loadMembers()})).catch((e=>{console.log("[SETTINGS] Unable to invite member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Unable to invite member. Please try again later",{style:"error"})}))}async handleDeleteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingMember.organization_id,s=this.deletingMember.email,e.api.delete("/organizations/".concat(t,"/profiles/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingMember=null,l("The member has been deleted.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingMember=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleDeleteInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingInvitation.organization_id,s=this.deletingInvitation.email,e.api.delete("/organizations/".concat(t,"/invitation/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingInvitation=null,l("The invitation has been cancelled.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingInvitation=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleResendInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.resendingInvitation.organization_id,s=this.resendingInvitation.email,e.api.post("/organizations/".concat(t,"/invitation/").concat(s,"/resend")).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.resendingInvitation=null,l("The invitation has been resent.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.resendingInvitation=null,console.log("REsend error",e),l("Unable to resend invitation. Please try again later",{style:"error"})}))}render(){if(!this.endpoint.session)return console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated");const e=this.roles.map((e=>({label:b([{name:e.name}]),value:e.id})));return s(i,null,s("verdocs-tabs",{tabs:[{label:`Members (${this.members.length})`},{label:`Pending Invitations (${this.invited.length})`}],onSelectTab:e=>this.selectedTab=e.detail.index}),0===this.selectedTab&&s("verdocs-table",{data:this.members,columns:[{id:"name",renderHeader:()=>"Member",renderCell:(e,t)=>{return s("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},s("div",{class:"role",style:{backgroundColor:(i=t.roles,void 0!==i.find((e=>"owner"===e.name))?"#9333ea":void 0!==i.find((e=>"admin"===e.name))?"#2563eb":void 0!==i.find((e=>"member"===e.name))?"#16a34a":void 0!==i.find((e=>"basic_user"===e.name))?"#ea580c":void 0!==i.find((e=>"contact"===e.name))?"#52525B":void 0)}},o(t)),s("span",null,r(t)));var i}},{id:"email",header:"E-mail Address"},{id:"phone",header:"Phone Number"},{id:"roles",header:"Role",renderCell:(e,t)=>`${b(t.roles)}`},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,t.id!==this.endpoint.session.profile_id&&s("div",{innerHTML:g,onClick:()=>this.deletingMember=t}))}]}),1===this.selectedTab&&s("verdocs-table",{data:this.invited,columns:[{id:"email",header:"E-mail Address"},{id:"generated_at",header:"Invited",renderCell:(e,t)=>s("div",null,m(new Date(t.generated_at),"MMM d, Y"))},{id:"role_id",header:"Role",renderCell:(e,t)=>{var i;return s("div",null,b([{name:null===(i=this.roles.find((e=>e.id===t.role_id)))||void 0===i?void 0:i.name}]))}},{id:"status",header:"Status",renderCell:(e,t)=>s("div",null,a(t.status))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:g,onClick:()=>this.deletingInvitation=t}),s("div",{innerHTML:'<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>',onClick:()=>this.resendingInvitation=t}))}]}),s("verdocs-button",{label:"Invite New Member",size:"normal",disabled:this.submitting,onClick:()=>this.invitingMember=!0}),this.invitingMember&&s("verdocs-dialog",{onExit:()=>this.invitingMember=!1},s("div",{slot:"title",class:"heading"},"Invite New Member"),s("div",{class:"content"},s("verdocs-text-input",{label:"E-mail Address",placeholder:"Enter the user's email address...",id:"verdocs-invite-email",value:this.newEmailAddress,autocomplete:"off",required:!0,onInput:e=>this.newEmailAddress=e.target.value,onFocusout:e=>{this.newEmailAddress=e.target.value.trim()}}),s("div",{style:{marginBottom:"20px"}}),s("verdocs-select-input",{options:e,label:"Role",onInput:e=>{this.newRoleId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",disabled:this.submitting,onClick:()=>this.invitingMember=!1}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting||!this.newEmailAddress||!this.newRoleId,onClick:()=>this.handleInviteMember()})))),this.deletingMember&&s("verdocs-dialog",{onExit:()=>this.deletingMember=null},s("div",{slot:"title",class:"heading"},"Delete Member?"),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this member? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingMember=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteMember()})))),this.deletingInvitation&&s("verdocs-dialog",{onExit:()=>this.deletingInvitation=null},s("div",{slot:"title",class:"heading"},"Cancel Invitation?"),s("div",{class:"content"},s("p",null,"Are you sure you want to cancel this invitation? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteInvitation()})))),this.resendingInvitation&&s("verdocs-dialog",{onExit:()=>this.resendingInvitation=null},s("div",{slot:"title",class:"heading"},"Resend Invitation?"),s("div",{class:"content"},s("p",null,"The user will receive an email reminder to join your organization."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.resendingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleResendInvitation()})))))}};var T,M;y.style='@-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}}',function(e){e.assertEqual=e=>e,e.assertIs=function(){},e.assertNever=function(){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of s)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(T||(T={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(M||(M={}));const x=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),w=e=>{switch(typeof e){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(e)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(e)?x.array:null===e?x.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?x.promise:"undefined"!=typeof Map&&e instanceof Map?x.map:"undefined"!=typeof Set&&e instanceof Set?x.set:"undefined"!=typeof Date&&e instanceof Date?x.date:x.object;default:return x.unknown}},G=T.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"]);class k extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},s={_errors:[]},i=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)s._errors.push(t(n));else{let e=s,i=0;for(;i<n.path.length;){const s=n.path[i];i===n.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(n))):e[s]=e[s]||{_errors:[]},e=e[s],i++}}};return i(this),s}static assert(e){if(!(e instanceof k))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},s=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}k.create=e=>new k(e);const I=(e,t)=>{let s;switch(e.code){case G.invalid_type:s=e.received===x.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,T.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:s=`Unrecognized key(s) in object: ${T.joinValues(e.keys,", ")}`;break;case G.invalid_union:s="Invalid input";break;case G.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${T.joinValues(e.options)}`;break;case G.invalid_enum_value:s=`Invalid enum value. Expected ${T.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:s="Invalid function arguments";break;case G.invalid_return_type:s="Invalid function return type";break;case G.invalid_date:s="Invalid date";break;case G.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:T.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case G.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case G.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case G.custom:s="Invalid input";break;case G.invalid_intersection_types:s="Intersection results could not be merged";break;case G.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:s="Number must be finite";break;default:s=t.defaultError,T.assertNever(e)}return{message:s}};let _=I;function N(){return _}const S=e=>{const{data:t,path:s,errorMaps:i,issueData:n}=e,r=[...s,...n.path||[]],a={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const l=i.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(a,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function E(e,t){const s=N(),i=S({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===I?void 0:I].filter((e=>!!e))});e.common.issues.push(i)}class C{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const i of t){if("aborted"===i.status)return A;"dirty"===i.status&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t){const t=await e.key,i=await e.value;s.push({key:t,value:i})}return C.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const i of t){const{key:t,value:n}=i;if("aborted"===t.status)return A;if("aborted"===n.status)return A;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!i.alwaysSet||(s[t.value]=n.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),P=e=>({status:"dirty",value:e}),Z=e=>({status:"valid",value:e}),z=e=>"aborted"===e.status,$=e=>"dirty"===e.status,D=e=>"valid"===e.status,j=e=>"undefined"!=typeof Promise&&e instanceof Promise;function B(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function L(e,t,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,s):n?n.value=s:t.set(e,s),s}var U,K,O;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(U||(U={}));class R{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const q=(e,t)=>{if(D(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new k(e.common.issues);return this._error=t,this._error}}};function V(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:i,description:n}=e;if(t&&(s||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var r,a;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!==(r=null!=o?o:i)&&void 0!==r?r:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(a=null!=o?o:s)&&void 0!==a?a:n.defaultError}},description:n}}class F{constructor(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)}get description(){return this._def.description}_getType(e){return w(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:w(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:w(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(j(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const i={common:{issues:[],async:null!==(s=null==t?void 0:t.async)&&void 0!==s&&s,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:w(e)},n=this._parseSync({data:e,path:i.path,parent:i});return q(i,n)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:w(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(j(i)?i:Promise.resolve(i));return q(s,n)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const n=e(t),r=()=>i.addIssue({code:G.custom,...s(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(r(),!1))):!!n||(r(),!1)}))}refinement(e,t){return this._refinement(((s,i)=>!!e(s)||(i.addIssue("function"==typeof t?t(s,i):t),!1)))}_refinement(e){return new Ue({schema:this,typeName:Xe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ke.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xe.create(this,this._def)}promise(){return Le.create(this,this._def)}or(e){return ke.create([this,e],this._def)}and(e){return Se.create(this,e,this._def)}transform(e){return new Ue({...V(this._def),schema:this,typeName:Xe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Re({...V(this._def),innerType:this,defaultValue:t,typeName:Xe.ZodDefault})}brand(){return new We({typeName:Xe.ZodBranded,type:this,...V(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new qe({...V(this._def),innerType:this,catchValue:t,typeName:Xe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return He.create(this,e)}readonly(){return Je.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const W=/^c[^\s-]{8,}$/i,H=/^[0-9a-z]+$/,J=/^[0-9A-HJKMNP-TV-Z]{26}$/,Y=/^[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,Q=/^[a-z0-9_-]{21}$/i,X=/^[-+]?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)?)??$/,ee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let te;const se=/^(?:(?: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])$/,ie=/^(([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})))$/,ne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,re="((\\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])))",ae=new RegExp(`^${re}$`);function oe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function le(e){let t=`${re}T${oe(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}class ce extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.string,received:t.parsedType}),A}const t=new C;let s;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const i=e.data.length>r.value,n=e.data.length<r.value;(i||n)&&(s=this._getOrReturnCtx(e,s),i?E(s,{code:G.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&E(s,{code:G.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)ee.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"email",code:G.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)te||(te=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),te.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"emoji",code:G.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)Y.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"uuid",code:G.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)Q.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"nanoid",code:G.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)W.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid",code:G.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)H.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid2",code:G.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)J.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ulid",code:G.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(i){s=this._getOrReturnCtx(e,s),E(s,{validation:"url",code:G.invalid_string,message:r.message}),t.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"regex",code:G.invalid_string,message:r.message}),t.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):"datetime"===r.kind?le(r).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"date"===r.kind?ae.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:"date",message:r.message}),t.dirty()):"time"===r.kind?new RegExp(`^${oe(r)}$`).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:"time",message:r.message}),t.dirty()):"duration"===r.kind?X.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"duration",code:G.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?(i=e.data,("v4"!==(n=r.version)&&n||!se.test(i))&&("v6"!==n&&n||!ie.test(i))&&(s=this._getOrReturnCtx(e,s),E(s,{validation:"ip",code:G.invalid_string,message:r.message}),t.dirty())):"base64"===r.kind?ne.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"base64",code:G.invalid_string,message:r.message}),t.dirty()):T.assertNever(r);var i,n;return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement((t=>e.test(t)),{validation:t,code:G.invalid_string,...U.errToObj(s)})}_addCheck(e){return new ce({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}datetime(e){var t,s;return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(s=null==e?void 0:e.local)&&void 0!==s&&s,...U.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...U.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...U.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function de(e,t){const s=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=s>i?s:i;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}ce.create=e=>{var t;return new ce({checks:[],typeName:Xe.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...V(e)})};class ue extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.number,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"int"===i.kind?T.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:G.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"multipleOf"===i.kind?0!==de(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:G.not_finite,message:i.message}),s.dirty()):T.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new ue({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new ue({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&T.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ue.create=e=>new ue({checks:[],typeName:Xe.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...V(e)});class he extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.bigint,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):T.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new he({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new he({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}he.create=e=>{var t;return new he({checks:[],typeName:Xe.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...V(e)})};class me extends F{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==x.boolean){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.boolean,received:t.parsedType}),A}return Z(e.data)}}me.create=e=>new me({typeName:Xe.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...V(e)});class pe extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.date,received:t.parsedType}),A}if(isNaN(e.data.getTime()))return E(this._getOrReturnCtx(e),{code:G.invalid_date}),A;const t=new C;let s;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),t.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):T.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}pe.create=e=>new pe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Xe.ZodDate,...V(e)});class ve extends F{_parse(e){if(this._getType(e)!==x.symbol){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.symbol,received:t.parsedType}),A}return Z(e.data)}}ve.create=e=>new ve({typeName:Xe.ZodSymbol,...V(e)});class fe extends F{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.undefined,received:t.parsedType}),A}return Z(e.data)}}fe.create=e=>new fe({typeName:Xe.ZodUndefined,...V(e)});class ge extends F{_parse(e){if(this._getType(e)!==x.null){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.null,received:t.parsedType}),A}return Z(e.data)}}ge.create=e=>new ge({typeName:Xe.ZodNull,...V(e)});class be extends F{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}be.create=e=>new be({typeName:Xe.ZodAny,...V(e)});class ye extends F{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}ye.create=e=>new ye({typeName:Xe.ZodUnknown,...V(e)});class Te extends F{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.never,received:t.parsedType}),A}}Te.create=e=>new Te({typeName:Xe.ZodNever,...V(e)});class Me extends F{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.void,received:t.parsedType}),A}return Z(e.data)}}Me.create=e=>new Me({typeName:Xe.ZodVoid,...V(e)});class xe extends F{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==x.array)return E(t,{code:G.invalid_type,expected:x.array,received:t.parsedType}),A;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,n=t.data.length<i.exactLength.value;(e||n)&&(E(t,{code:e?G.too_big:G.too_small,minimum:n?i.exactLength.value:void 0,maximum:e?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&(E(t,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&(E(t,{code:G.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map(((e,s)=>i.type._parseAsync(new R(t,e,t.path,s))))).then((e=>C.mergeArray(s,e)));const n=[...t.data].map(((e,s)=>i.type._parseSync(new R(t,e,t.path,s))));return C.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new xe({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new xe({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new xe({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}}function we(e){if(e instanceof Ge){const t={};for(const s in e.shape)t[s]=Ke.create(we(e.shape[s]));return new Ge({...e._def,shape:()=>t})}return e instanceof xe?new xe({...e._def,type:we(e.element)}):e instanceof Ke?Ke.create(we(e.unwrap())):e instanceof Oe?Oe.create(we(e.unwrap())):e instanceof Ee?Ee.create(e.items.map((e=>we(e)))):e}xe.create=(e,t)=>new xe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Xe.ZodArray,...V(t)});class Ge extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=T.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.object,received:t.parsedType}),A}const{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),r=[];if(!(this._def.catchall instanceof Te&&"strip"===this._def.unknownKeys))for(const e in s.data)n.includes(e)||r.push(e);const a=[];for(const e of n)a.push({key:{status:"valid",value:e},value:i[e]._parse(new R(s,s.data[e],s.path,e)),alwaysSet:e in s.data});if(this._def.catchall instanceof Te){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)r.length>0&&(E(s,{code:G.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r)a.push({key:{status:"valid",value:t},value:e._parse(new R(s,s.data[t],s.path,t)),alwaysSet:t in s.data})}return s.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const s=await t.key,i=await t.value;e.push({key:s,value:i,alwaysSet:t.alwaysSet})}return e})).then((e=>C.mergeObjectSync(t,e))):C.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return new Ge({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var i,n,r,a;const o=null!==(r=null===(n=(i=this._def).errorMap)||void 0===n?void 0:n.call(i,t,s).message)&&void 0!==r?r:s.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=U.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new Ge({...this._def,unknownKeys:"strip"})}passthrough(){return new Ge({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ge({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ge({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Xe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ge({...this._def,catchall:e})}pick(e){const t={};return T.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new Ge({...this._def,shape:()=>t})}omit(e){const t={};return T.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new Ge({...this._def,shape:()=>t})}deepPartial(){return we(this)}partial(e){const t={};return T.objectKeys(this.shape).forEach((s=>{const i=this.shape[s];t[s]=e&&!e[s]?i:i.optional()})),new Ge({...this._def,shape:()=>t})}required(e){const t={};return T.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof Ke;)e=e._def.innerType;t[s]=e}})),new Ge({...this._def,shape:()=>t})}keyof(){return De(T.objectKeys(this.shape))}}Ge.create=(e,t)=>new Ge({shape:()=>e,unknownKeys:"strip",catchall:Te.create(),typeName:Xe.ZodObject,...V(t)}),Ge.strictCreate=(e,t)=>new Ge({shape:()=>e,unknownKeys:"strict",catchall:Te.create(),typeName:Xe.ZodObject,...V(t)}),Ge.lazycreate=(e,t)=>new Ge({shape:e,unknownKeys:"strip",catchall:Te.create(),typeName:Xe.ZodObject,...V(t)});class ke extends F{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map((e=>new k(e.ctx.common.issues)));return E(t,{code:G.invalid_union,unionErrors:s}),A}));{let e;const i=[];for(const n of s){const s={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:s}),s.common.issues.length&&i.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=i.map((e=>new k(e)));return E(t,{code:G.invalid_union,unionErrors:n}),A}}get options(){return this._def.options}}ke.create=(e,t)=>new ke({options:e,typeName:Xe.ZodUnion,...V(t)});const Ie=e=>e instanceof ze?Ie(e.schema):e instanceof Ue?Ie(e.innerType()):e instanceof $e?[e.value]:e instanceof je?e.options:e instanceof Be?T.objectValues(e.enum):e instanceof Re?Ie(e._def.innerType):e instanceof fe?[void 0]:e instanceof ge?[null]:e instanceof Ke?[void 0,...Ie(e.unwrap())]:e instanceof Oe?[null,...Ie(e.unwrap())]:e instanceof We||e instanceof Je?Ie(e.unwrap()):e instanceof qe?Ie(e._def.innerType):[];class _e extends F{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return E(t,{code:G.invalid_type,expected:x.object,received:t.parsedType}),A;const s=this.discriminator,i=this.optionsMap.get(t.data[s]);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const i=new Map;for(const s of t){const t=Ie(s.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,s)}}return new _e({typeName:Xe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...V(s)})}}function Ne(e,t){const s=w(e),i=w(t);if(e===t)return{valid:!0,data:e};if(s===x.object&&i===x.object){const s=T.objectKeys(t),i=T.objectKeys(e).filter((e=>-1!==s.indexOf(e))),n={...e,...t};for(const s of i){const i=Ne(e[s],t[s]);if(!i.valid)return{valid:!1};n[s]=i.data}return{valid:!0,data:n}}if(s===x.array&&i===x.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const n=Ne(e[i],t[i]);if(!n.valid)return{valid:!1};s.push(n.data)}return{valid:!0,data:s}}return s===x.date&&i===x.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Se extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=(e,i)=>{if(z(e)||z(i))return A;const n=Ne(e.value,i.value);return n.valid?(($(e)||$(i))&&t.dirty(),{status:t.value,value:n.data}):(E(s,{code:G.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Se.create=(e,t,s)=>new Se({left:e,right:t,typeName:Xe.ZodIntersection,...V(s)});class Ee extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return E(s,{code:G.invalid_type,expected:x.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return E(s,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(E(s,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new R(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(i).then((e=>C.mergeArray(t,e))):C.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Ee({...this._def,rest:e})}}Ee.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ee({items:e,typeName:Xe.ZodTuple,rest:null,...V(t)})};class Ce extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.object)return E(s,{code:G.invalid_type,expected:x.object,received:s.parsedType}),A;const i=[],n=this._def.keyType,r=this._def.valueType;for(const e in s.data)i.push({key:n._parse(new R(s,e,s.path,e)),value:r._parse(new R(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?C.mergeObjectAsync(t,i):C.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return new Ce(t instanceof F?{keyType:e,valueType:t,typeName:Xe.ZodRecord,...V(s)}:{keyType:ce.create(),valueType:e,typeName:Xe.ZodRecord,...V(t)})}}class Ae extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return E(s,{code:G.invalid_type,expected:x.map,received:s.parsedType}),A;const i=this._def.keyType,n=this._def.valueType,r=[...s.data.entries()].map((([e,t],r)=>({key:i._parse(new R(s,e,s.path,[r,"key"])),value:n._parse(new R(s,t,s.path,[r,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of r){const i=await s.key,n=await s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const s of r){const i=s.key,n=s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}Ae.create=(e,t,s)=>new Ae({valueType:t,keyType:e,typeName:Xe.ZodMap,...V(s)});class Pe extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return E(s,{code:G.invalid_type,expected:x.set,received:s.parsedType}),A;const i=this._def;null!==i.minSize&&s.data.size<i.minSize.value&&(E(s,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&s.data.size>i.maxSize.value&&(E(s,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const n=this._def.valueType;function r(e){const s=new Set;for(const i of e){if("aborted"===i.status)return A;"dirty"===i.status&&t.dirty(),s.add(i.value)}return{status:t.value,value:s}}const a=[...s.data.values()].map(((e,t)=>n._parse(new R(s,e,s.path,t))));return s.common.async?Promise.all(a).then((e=>r(e))):r(a)}min(e,t){return new Pe({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new Pe({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Pe.create=(e,t)=>new Pe({valueType:e,minSize:null,maxSize:null,typeName:Xe.ZodSet,...V(t)});class Ze extends F{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return E(t,{code:G.invalid_type,expected:x.function,received:t.parsedType}),A;function s(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:G.invalid_arguments,argumentsError:s}})}function i(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:G.invalid_return_type,returnTypeError:s}})}const n={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Le){const e=this;return Z((async function(...t){const a=new k([]),o=await e._def.args.parseAsync(t,n).catch((e=>{throw a.addIssue(s(t,e)),a})),l=await Reflect.apply(r,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch((e=>{throw a.addIssue(i(l,e)),a}))}))}{const e=this;return Z((function(...t){const a=e._def.args.safeParse(t,n);if(!a.success)throw new k([s(t,a.error)]);const o=Reflect.apply(r,this,a.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new k([i(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ze({...this._def,args:Ee.create(e).rest(ye.create())})}returns(e){return new Ze({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Ze({args:e||Ee.create([]).rest(ye.create()),returns:t||ye.create(),typeName:Xe.ZodFunction,...V(s)})}}class ze extends F{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ze.create=(e,t)=>new ze({getter:e,typeName:Xe.ZodLazy,...V(t)});class $e extends F{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:G.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}function De(e,t){return new je({values:e,typeName:Xe.ZodEnum,...V(t)})}$e.create=(e,t)=>new $e({value:e,typeName:Xe.ZodLiteral,...V(t)});class je extends F{constructor(){super(...arguments),K.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return E(t,{expected:T.joinValues(this._def.values),received:t.parsedType,code:G.invalid_type}),A}if(B(this,K,"f")||L(this,K,new Set(this._def.values),"f"),!B(this,K,"f").has(e.data)){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:G.invalid_enum_value,options:this._def.values}),A}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return je.create(e,{...this._def,...t})}exclude(e,t=this._def){return je.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}K=new WeakMap,je.create=De;class Be extends F{constructor(){super(...arguments),O.set(this,void 0)}_parse(e){const t=T.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const e=T.objectValues(t);return E(s,{expected:T.joinValues(e),received:s.parsedType,code:G.invalid_type}),A}if(B(this,O,"f")||L(this,O,new Set(T.getValidEnumValues(this._def.values)),"f"),!B(this,O,"f").has(e.data)){const e=T.objectValues(t);return E(s,{received:s.data,code:G.invalid_enum_value,options:e}),A}return Z(e.data)}get enum(){return this._def.values}}O=new WeakMap,Be.create=(e,t)=>new Be({values:e,typeName:Xe.ZodNativeEnum,...V(t)});class Le extends F{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&!1===t.common.async)return E(t,{code:G.invalid_type,expected:x.promise,received:t.parsedType}),A;const s=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return Z(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Le.create=(e,t)=>new Le({type:e,typeName:Xe.ZodPromise,...V(t)});class Ue extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{E(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const e=i.transform(s.data,n);if(s.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return A;const i=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===i.status?A:"dirty"===i.status||"dirty"===t.value?P(i.value):i}));{if("aborted"===t.value)return A;const i=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===i.status?A:"dirty"===i.status||"dirty"===t.value?P(i.value):i}}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,n);if(s.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(!1===s.common.async){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===i.status?A:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?A:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===i.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(e))return e;const r=i.transform(e.value,n);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>D(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}T.assertNever(i)}}Ue.create=(e,t,s)=>new Ue({schema:e,typeName:Xe.ZodEffects,effect:t,...V(s)}),Ue.createWithPreprocess=(e,t,s)=>new Ue({schema:t,effect:{type:"preprocess",transform:e},typeName:Xe.ZodEffects,...V(s)});class Ke extends F{_parse(e){return this._getType(e)===x.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ke.create=(e,t)=>new Ke({innerType:e,typeName:Xe.ZodOptional,...V(t)});class Oe extends F{_parse(e){return this._getType(e)===x.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Xe.ZodNullable,...V(t)});class Re extends F{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Re.create=(e,t)=>new Re({innerType:e,typeName:Xe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...V(t)});class qe extends F{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return j(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}qe.create=(e,t)=>new qe({innerType:e,typeName:Xe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...V(t)});class Ve extends F{_parse(e){if(this._getType(e)!==x.nan){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.nan,received:t.parsedType}),A}return{status:"valid",value:e.data}}}Ve.create=e=>new Ve({typeName:Xe.ZodNaN,...V(e)});const Fe=Symbol("zod_brand");class We extends F{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class He extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),P(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new He({in:e,out:t,typeName:Xe.ZodPipeline})}}class Je extends F{_parse(e){const t=this._def.innerType._parse(e),s=e=>(D(e)&&(e.value=Object.freeze(e.value)),e);return j(t)?t.then((e=>s(e))):s(t)}unwrap(){return this._def.innerType}}function Ye(e,t={},s){return e?be.create().superRefine(((i,n)=>{var r,a;if(!e(i)){const e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,o=null===(a=null!==(r=e.fatal)&&void 0!==r?r:s)||void 0===a||a;n.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:o})}})):be.create()}Je.create=(e,t)=>new Je({innerType:e,typeName:Xe.ZodReadonly,...V(t)});const Qe={object:Ge.lazycreate};var Xe;!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"}(Xe||(Xe={}));const et=ce.create,tt=ue.create,st=me.create,it=Ue.create,nt={string:e=>ce.create({...e,coerce:!0}),number:e=>ue.create({...e,coerce:!0}),boolean:e=>me.create({...e,coerce:!0}),bigint:e=>he.create({...e,coerce:!0}),date:e=>pe.create({...e,coerce:!0})};var rt=Object.freeze({__proto__:null,defaultErrorMap:I,setErrorMap:function(e){_=e},getErrorMap:N,makeIssue:S,EMPTY_PATH:[],addIssueToContext:E,ParseStatus:C,INVALID:A,DIRTY:P,OK:Z,isAborted:z,isDirty:$,isValid:D,isAsync:j,get util(){return T},get objectUtil(){return M},ZodParsedType:x,getParsedType:w,ZodType:F,datetimeRegex:le,ZodString:ce,ZodNumber:ue,ZodBigInt:he,ZodBoolean:me,ZodDate:pe,ZodSymbol:ve,ZodUndefined:fe,ZodNull:ge,ZodAny:be,ZodUnknown:ye,ZodNever:Te,ZodVoid:Me,ZodArray:xe,ZodObject:Ge,ZodUnion:ke,ZodDiscriminatedUnion:_e,ZodIntersection:Se,ZodTuple:Ee,ZodRecord:Ce,ZodMap:Ae,ZodSet:Pe,ZodFunction:Ze,ZodLazy:ze,ZodLiteral:$e,ZodEnum:je,ZodNativeEnum:Be,ZodPromise:Le,ZodEffects:Ue,ZodTransformer:Ue,ZodOptional:Ke,ZodNullable:Oe,ZodDefault:Re,ZodCatch:qe,ZodNaN:Ve,BRAND:Fe,ZodBranded:We,ZodPipeline:He,ZodReadonly:Je,custom:Ye,Schema:F,ZodSchema:F,late:Qe,get ZodFirstPartyTypeKind(){return Xe},coerce:nt,any:be.create,array:xe.create,bigint:he.create,boolean:st,date:pe.create,discriminatedUnion:_e.create,effect:it,enum:je.create,function:Ze.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Ye((t=>t instanceof e),t),intersection:Se.create,lazy:ze.create,literal:$e.create,map:Ae.create,nan:Ve.create,nativeEnum:Be.create,never:Te.create,null:ge.create,nullable:Oe.create,number:tt,object:Ge.create,oboolean:()=>st().optional(),onumber:()=>tt().optional(),optional:Ke.create,ostring:()=>et().optional(),pipeline:He.create,preprocess:Ue.createWithPreprocess,promise:Le.create,record:Ce.create,set:Pe.create,strictObject:Ge.strictCreate,string:et,symbol:ve.create,transformer:it,tuple:Ee.create,undefined:fe.create,union:ke.create,unknown:ye.create,void:Me.create,NEVER:A,ZodIssueCode:G,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:k});const at=[["International Date Line West","GMT-11:00","(GMT-11:00) International Date Line West"],["Midway Island","GMT-11:00","(GMT-11:00) Midway Island"],["Samoa","GMT-11:00","(GMT-11:00) Samoa"],["Hawaii","GMT-10:00","(GMT-10:00) Hawaii"],["Alaska","GMT-09:00","(GMT-09:00) Alaska"],["Pacific Time (US & Canada)","GMT-08:00","(GMT-08:00) Pacific Time (US & Canada)"],["Tijuana","GMT-08:00","(GMT-08:00) Tijuana"],["Arizona","GMT-07:00","(GMT-07:00) Arizona"],["Chihuahua","GMT-07:00","(GMT-07:00) Chihuahua"],["Mazatlan","GMT-07:00","(GMT-07:00) Mazatlan"],["Mountain Time (US & Canada)","GMT-07:00","(GMT-07:00) Mountain Time (US & Canada)"],["Central America","GMT-06:00","(GMT-06:00) Central America"],["Central Time (US & Canada)","GMT-06:00","(GMT-06:00) Central Time (US & Canada)"],["Guadalajara","GMT-06:00","(GMT-06:00) Guadalajara"],["Mexico City","GMT-06:00","(GMT-06:00) Mexico City"],["Monterrey","GMT-06:00","(GMT-06:00) Monterrey"],["Saskatchewan","GMT-06:00","(GMT-06:00) Saskatchewan"],["Bogota","GMT-05:00","(GMT-05:00) Bogota"],["Eastern Time (US & Canada)","GMT-05:00","(GMT-05:00) Eastern Time (US & Canada)"],["Indiana (East)","GMT-05:00","(GMT-05:00) Indiana (East)"],["Lima","GMT-05:00","(GMT-05:00) Lima"],["Quito","GMT-05:00","(GMT-05:00) Quito"],["Caracas","GMT-04:30","(GMT-04:30) Caracas"],["Atlantic Time (Canada)","GMT-04:00","(GMT-04:00) Atlantic Time (Canada)"],["Georgetown","GMT-04:00","(GMT-04:00) Georgetown"],["La Paz","GMT-04:00","(GMT-04:00) La Paz"],["Santiago","GMT-04:00","(GMT-04:00) Santiago"],["Newfoundland","GMT-03:30","(GMT-03:30) Newfoundland"],["Brasilia","GMT-03:00","(GMT-03:00) Brasilia"],["Buenos Aires","GMT-03:00","(GMT-03:00) Buenos Aires"],["Greenland","GMT-03:00","(GMT-03:00) Greenland"],["Mid-Atlantic","GMT-02:00","(GMT-02:00) Mid-Atlantic"],["Azores","GMT-01:00","(GMT-01:00) Azores"],["Cape Verde Is.","GMT-01:00","(GMT-01:00) Cape Verde Is."],["Casablanca","GMT+00:00","(GMT+00:00) Casablanca"],["Dublin","GMT+00:00","(GMT+00:00) Dublin"],["Edinburgh","GMT+00:00","(GMT+00:00) Edinburgh"],["Lisbon","GMT+00:00","(GMT+00:00) Lisbon"],["London","GMT+00:00","(GMT+00:00) London"],["Monrovia","GMT+00:00","(GMT+00:00) Monrovia"],["UTC","GMT+00:00","(GMT+00:00) UTC"],["Amsterdam","GMT+01:00","(GMT+01:00) Amsterdam"],["Belgrade","GMT+01:00","(GMT+01:00) Belgrade"],["Berlin","GMT+01:00","(GMT+01:00) Berlin"],["Bern","GMT+01:00","(GMT+01:00) Bern"],["Bratislava","GMT+01:00","(GMT+01:00) Bratislava"],["Brussels","GMT+01:00","(GMT+01:00) Brussels"],["Budapest","GMT+01:00","(GMT+01:00) Budapest"],["Copenhagen","GMT+01:00","(GMT+01:00) Copenhagen"],["Ljubljana","GMT+01:00","(GMT+01:00) Ljubljana"],["Madrid","GMT+01:00","(GMT+01:00) Madrid"],["Paris","GMT+01:00","(GMT+01:00) Paris"],["Prague","GMT+01:00","(GMT+01:00) Prague"],["Rome","GMT+01:00","(GMT+01:00) Rome"],["Sarajevo","GMT+01:00","(GMT+01:00) Sarajevo"],["Skopje","GMT+01:00","(GMT+01:00) Skopje"],["Stockholm","GMT+01:00","(GMT+01:00) Stockholm"],["Vienna","GMT+01:00","(GMT+01:00) Vienna"],["Warsaw","GMT+01:00","(GMT+01:00) Warsaw"],["West Central Africa","(GMT+01:00","(GMT+01:00) West Central Africa"],["Zagreb","GMT+01:00","(GMT+01:00) Zagreb"],["Athens","GMT+02:00","(GMT+02:00) Athens"],["Bucharest","GMT+02:00","(GMT+02:00) Bucharest"],["Cairo","GMT+02:00","(GMT+02:00) Cairo"],["Harare","GMT+02:00","(GMT+02:00) Harare"],["Helsinki","GMT+02:00","(GMT+02:00) Helsinki"],["Istanbul","GMT+02:00","(GMT+02:00) Istanbul"],["Jerusalem","GMT+02:00","(GMT+02:00) Jerusalem"],["Kyiv","GMT+02:00","(GMT+02:00) Kyiv"],["Minsk","GMT+02:00","(GMT+02:00) Minsk"],["Pretoria","GMT+02:00","(GMT+02:00) Pretoria"],["Riga","GMT+02:00","(GMT+02:00) Riga"],["Sofia","GMT+02:00","(GMT+02:00) Sofia"],["Tallinn","GMT+02:00","(GMT+02:00) Tallinn"],["Vilnius","GMT+02:00","(GMT+02:00) Vilnius"],["Baghdad","GMT+03:00","(GMT+03:00) Baghdad"],["Kuwait","GMT+03:00","(GMT+03:00) Kuwait"],["Moscow","GMT+03:00","(GMT+03:00) Moscow"],["Nairobi","GMT+03:00","(GMT+03:00) Nairobi"],["Riyadh","GMT+03:00","(GMT+03:00) Riyadh"],["St. Petersburg","GMT+03:00","(GMT+03:00) St. Petersburg"],["Volgograd","GMT+03:00","(GMT+03:00) Volgograd"],["Tehran","GMT+03:30","(GMT+03:30) Tehran"],["Abu Dhabi","GMT+04:00","(GMT+04:00) Abu Dhabi"],["Baku","GMT+04:00","(GMT+04:00) Baku"],["Muscat","GMT+04:00","(GMT+04:00) Muscat"],["Tbilisi","GMT+04:00","(GMT+04:00) Tbilisi"],["Yerevan","GMT+04:00","(GMT+04:00) Yerevan"],["Kabul","GMT+04:30","(GMT+04:30) Kabul"],["Ekaterinburg","GMT+05:00","(GMT+05:00) Ekaterinburg"],["Islamabad","GMT+05:00","(GMT+05:00) Islamabad"],["Karachi","GMT+05:00","(GMT+05:00) Karachi"],["Tashkent","GMT+05:00","(GMT+05:00) Tashkent"],["Chennai","GMT+05:30","(GMT+05:30) Chennai"],["Kolkata","GMT+05:30","(GMT+05:30) Kolkata"],["Mumbai","GMT+05:30","(GMT+05:30) Mumbai"],["New Delhi","GMT+05:30","(GMT+05:30) New Delhi"],["Sri Jayawardenepura","GMT+05:30","(GMT+05:30) Sri Jayawardenepura"],["Kathmandu","GMT+05:45","(GMT+05:45) Kathmandu"],["Almaty","GMT+06:00","(GMT+06:00) Almaty"],["Astana","GMT+06:00","(GMT+06:00) Astana"],["Dhaka","GMT+06:00","(GMT+06:00) Dhaka"],["Novosibirsk","GMT+06:00","(GMT+06:00) Novosibirsk"],["Rangoon","GMT+06:30","(GMT+06:30) Rangoon"],["Bangkok","GMT+07:00","(GMT+07:00) Bangkok"],["Hanoi","GMT+07:00","(GMT+07:00) Hanoi"],["Jakarta","GMT+07:00","(GMT+07:00) Jakarta"],["Krasnoyarsk","GMT+07:00","(GMT+07:00) Krasnoyarsk"],["Beijing","GMT+08:00","(GMT+08:00) Beijing"],["Chongqing","GMT+08:00","(GMT+08:00) Chongqing"],["Hong Kong","GMT+08:00","(GMT+08:00) Hong Kong"],["Irkutsk","GMT+08:00","(GMT+08:00) Irkutsk"],["Kuala Lumpur","GMT+08:00","(GMT+08:00) Kuala Lumpur"],["Perth","GMT+08:00","(GMT+08:00) Perth"],["Singapore","GMT+08:00","(GMT+08:00) Singapore"],["Taipei","GMT+08:00","(GMT+08:00) Taipei"],["Ulaan Bataar","GMT+08:00","(GMT+08:00) Ulaan Bataar"],["Urumqi","GMT+08:00","(GMT+08:00) Urumqi"],["Osaka","GMT+09:00","(GMT+09:00) Osaka"],["Sapporo","GMT+09:00","(GMT+09:00) Sapporo"],["Seoul","GMT+09:00","(GMT+09:00) Seoul"],["Tokyo","GMT+09:00","(GMT+09:00) Tokyo"],["Yakutsk","GMT+09:00","(GMT+09:00) Yakutsk"],["Adelaide","GMT+09:30","(GMT+09:30) Adelaide"],["Darwin","GMT+09:30","(GMT+09:30) Darwin"],["Brisbane","GMT+10:00","(GMT+10:00) Brisbane"],["Canberra","GMT+10:00","(GMT+10:00) Canberra"],["Guam","GMT+10:00","(GMT+10:00) Guam"],["Hobart","GMT+10:00","(GMT+10:00) Hobart"],["Melbourne","GMT+10:00","(GMT+10:00) Melbourne"],["Port Moresby","GMT+10:00","(GMT+10:00) Port Moresby"],["Sydney","GMT+10:00","(GMT+10:00) Sydney"],["Vladivostok","GMT+10:00","(GMT+10:00) Vladivostok"],["Kamchatka","GMT+11:00","(GMT+11:00) Kamchatka"],["Magadan","GMT+11:00","(GMT+11:00) Magadan"],["New Caledonia","GMT+11:00","(GMT+11:00) New Caledonia"],["Solomon Is.","GMT+11:00","(GMT+11:00) Solomon Is."],["Auckland","GMT+12:00","(GMT+12:00) Auckland"],["Fiji","GMT+12:00","(GMT+12:00) Fiji"],["Marshall Is.","GMT+12:00","(GMT+12:00) Marshall Is."],["Wellington","GMT+12:00","(GMT+12:00) Wellington"],["Nuku'alofa","GMT+13:00","(GMT+13:00) Nuku'alofa"]].map((e=>({value:e[2],label:e[2]}))),ot=rt.object({business_name:rt.string().trim().max(30).optional(),contact_email:rt.string().trim().email("Invalid email").optional().or(rt.literal("")),phone:rt.preprocess((e=>p(String(e).trim())),rt.string().optional()),timezone:rt.string().trim().optional(),url:rt.string().trim().optional()}),lt=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.organizationUpdated=t(this,"organizationUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.name="",this.business_name="",this.contact_email="",this.phone="",this.address="",this.address2="",this.timezone="",this.url=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await(t=this.endpoint,s=this.endpoint.session.organization_id,t.api.get("/organizations/".concat(s)).then((function(e){return e.data})));var t,s;console.log("[SETTINGS] Loaded organization",e),this.resetForm(e)}resetForm(e){this.name=e.name,this.business_name=e.business_name,this.contact_email=e.contact_email,this.phone=e.phone,this.address=e.address,this.address2=e.address2,this.timezone=e.timezone,this.url=e.url,this.dirty=!1,this.valid=!0}handleSubmit(e){var t,s,i;e.preventDefault(),e.stopPropagation(),(t=n.getDefault(),s=this.endpoint.session.organization_id,i={name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url},t.api.patch("/organizations/".concat(s),i).then((function(e){return e.data}))).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.organizationUpdated)||void 0===t||t.emit({endpoint:this.endpoint,organization:e}),this.resetForm(e)})).catch((e=>l(`Error updating organization: ${e.message}`,{style:"error"})))}processFields(){const e=ot.safeParse({name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url});console.log("[SETTINGS] Validation result",e),this.valid=e.success,this.dirty=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"Organization Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-name",value:this.name,autocomplete:"off",label:"Name",required:!1,disabled:!1,placeholder:"Enter your organization's name...",onInput:e=>this.name=e.target.value,onFocusout:e=>{this.name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-business-name",value:this.business_name,autocomplete:"off",label:"Display Name",placeholder:"The name to display on communications...",onInput:e=>this.business_name=e.target.value,onFocusout:e=>{this.business_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-url",value:this.url,autocomplete:"off",label:"Web URL",placeholder:"Enter your Web URL...",onInput:e=>this.url=e.target.value,onFocusout:e=>{this.url=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-phone",value:this.phone,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-email",value:this.contact_email,clearable:!0,autocomplete:"off",label:"Contact Email",placeholder:"Enter your contact email address...",onInput:e=>this.contact_email=e.target.value,onFocusout:e=>{this.contact_email=e.target.value.trim(),this.processFields()}}),s("verdocs-select-input",{options:at,value:this.timezone,label:"Time Zone"}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};lt.style='@-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}}';const ct=rt.object({first_name:rt.string().trim().min(1,"First name is required").max(30),last_name:rt.string().trim().min(1,"Last name is required").max(30),email:rt.string().trim().email("Invalid email").min(1,"Email is required"),phone:rt.preprocess((e=>p(String(e).trim())),rt.string())}),dt=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.profileUpdated=t(this,"profileUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.first_name="",this.last_name="",this.email="",this.phone=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await u(this.endpoint);console.log("[SETTINGS] Loaded profile",e),this.resetForm(e)}resetForm(e){this.first_name=e.first_name,this.last_name=e.last_name,this.email=e.email,this.phone=e.phone,this.dirty=!1,this.valid=!0}handleSubmit(e){e.preventDefault(),e.stopPropagation(),h(n.getDefault(),this.endpoint.session.profile_id,{first_name:this.first_name,last_name:this.last_name,phone:this.phone}).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.profileUpdated)||void 0===t||t.emit({endpoint:this.endpoint,profile:e}),this.resetForm(e)})).catch((e=>l(`Error updating profile: ${e.message}`,{style:"error"})))}processFields(){const e=ct.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=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"My Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-first-name",value:this.first_name,autocomplete:"off",label:"First Name",required:!0,placeholder:"Enter your first name...",onInput:e=>this.first_name=e.target.value,onFocusout:e=>{this.first_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-last-name",value:this.last_name,autocomplete:"off",label:"Last Name",required:!0,placeholder:"Enter your last name...",onInput:e=>this.last_name=e.target.value,onFocusout:e=>{this.last_name=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-email",value:this.email,autocomplete:"off",label:"Email Address",required:!0,disabled:!0,placeholder:"Enter your email address...",onInput:e=>this.email=e.target.value,onFocusout:e=>{this.email=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-phone",value:this.phone,clearable:!0,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};dt.style='@-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}}';export{f as verdocs_settings_api_keys,y as verdocs_settings_members,lt as verdocs_settings_organization,dt as verdocs_settings_profile}
1
+ import{r as e,c as t,h as s,H as i}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as n}from"./p-2415be91.js";import{a as r,c as a,b as o}from"./p-5e808a0b.js";import{V as l}from"./p-ed416acf.js";import{S as c}from"./p-7a1b2643.js";import{g as d,a as u,u as h}from"./p-3e607686.js";import{f as m}from"./p-c220af42.js";import{c as p}from"./p-632bdc29.js";import"./p-eab67c09.js";import"./p-dc2ad047.js";import"./p-1b4e7078.js";var v=function(e,t){return e.api.get("/organizations/".concat(t,"/profiles")).then((function(e){return e.data}))};const f=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.keys=[],this.creatingKey=!1,this.createdKey=null,this.deletingKey=null,this.rotatingKey=null,this.newApiKeyName="",this.newApiKeyProfileId="",this.members=[]}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.newApiKeyProfileId=this.endpoint.session.profile_id,v(this.endpoint,this.endpoint.session.organization_id).then((e=>{this.members=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Error loading organization members",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})})),this.loadKeys()}loadKeys(){var e,t;(e=this.endpoint,t=this.endpoint.session.organization_id,e.api.get("/organizations/".concat(t,"/api_key")).then((function(e){return e.data}))).then((e=>{this.keys=e})).catch((e=>{var t,s,i;console.log("[SETTINGS] Unable to load API keys",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load API keys. Please try again later",{style:"error"})}))}async handleDeleteKey(){var e,t,s;(e=this.endpoint,t=this.deletingKey.organization_id,s=this.deletingKey.client_id,e.api.delete("/organizations/".concat(t,"/api_key/").concat(s)).then((function(e){return e.data}))).then((()=>{this.deletingKey=null,l("API key deleted",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.deletingKey=null,console.log("[SETTINGS] Unable to delete API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to delete API key. Please try again later",{style:"error"})}))}async handleRotateKey(){var e,t,s;(e=this.endpoint,t=this.rotatingKey.organization_id,s=this.rotatingKey.client_id,e.api.put("/organizations/".concat(t,"/api_key/").concat(s,"/rotate")).then((function(e){return e.data}))).then((e=>{this.rotatingKey=null,l("API key rotated",{style:"success"}),this.loadKeys(),this.createdKey=e})).catch((e=>{var t,s,i;this.rotatingKey=null,console.log("[SETTINGS] Unable to rotate API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to rotate API key. Please try again later",{style:"error"})}))}async handleCreateKey(){var e,t,s;(e=this.endpoint,t=this.endpoint.session.organization_id,s={name:this.newApiKeyName,profile_id:this.newApiKeyProfileId},e.api.post("/organizations/".concat(t,"/api_key"),s).then((function(e){return e.data}))).then((e=>{this.creatingKey=!1,this.createdKey=e,l("API key created",{style:"success"}),this.loadKeys()})).catch((e=>{var t,s,i;this.creatingKey=!1,console.log("[SETTINGS] Unable to create API key",e),null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to create API key. Please try again later",{style:"error"})}))}render(){var e,t,n,a;const o=this.members.map((e=>({label:r(e),value:e.id})));return this.endpoint.session?s(i,null,s("verdocs-table",{data:this.keys,columns:[{id:"name",header:"Name",renderCell:(e,t)=>s("div",null,s("div",null,t.name))},{id:"client_id",header:"Client ID",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<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>'}),s("div",null,t.client_id))},{id:"profile_id",header:"Acts as",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<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>'}),s("div",null,r(t.profile)))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:'<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>',onClick:()=>this.deletingKey=t}),s("div",{innerHTML:'<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>',onClick:()=>this.rotatingKey=t}))}]}),s("verdocs-button",{label:"Add API Key",size:"normal",onClick:()=>this.creatingKey=!0}),this.deletingKey&&s("verdocs-dialog",{onExit:()=>this.deletingKey=null},s("div",{slot:"title",class:"heading"},'Delete API key "',this.deletingKey.name,'"?'),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this key? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.deletingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleDeleteKey()})))),this.rotatingKey&&s("verdocs-dialog",{onExit:()=>this.rotatingKey=null},s("div",{slot:"title",class:"heading"},'Rotate API key "',this.rotatingKey.name,'"?'),s("div",{class:"content"},s("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."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.rotatingKey=null}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleRotateKey()})))),this.creatingKey&&s("verdocs-dialog",{onExit:()=>this.creatingKey=!1},s("div",{slot:"title",class:"heading"},"Create API Key"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",placeholder:"API key name...",id:"verdocs-api-key-name",value:this.newApiKeyName,autocomplete:"off",required:!0,onInput:e=>this.newApiKeyName=e.target.value,onFocusout:e=>{this.newApiKeyName=e.target.value.trim()}}),s("p",null,'API keys must be associated with a profile. Actions performed via API calls using this key will "act as" this profile.'),s("verdocs-select-input",{options:o,label:"Act as Profile",onInput:e=>{this.newApiKeyProfileId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",onClick:()=>this.creatingKey=!1}),s("verdocs-button",{size:"small",label:"OK",onClick:()=>this.handleCreateKey()})))),this.createdKey&&s("verdocs-dialog",{onExit:()=>this.createdKey=null},s("div",{slot:"title",class:"heading"},"API Key Details"),s("div",{class:"content"},s("verdocs-text-input",{label:"Name",disabled:!0,value:null===(e=this.createdKey)||void 0===e?void 0:e.name}),s("verdocs-text-input",{label:"Profile",disabled:!0,value:r(null===(t=this.createdKey)||void 0===t?void 0:t.profile)}),s("p",null,"Please save the Client ID and Secret below. Be sure to never expose your secret key in insecure (Web or mobile environments)!"),s("verdocs-text-input",{label:"Client ID",disabled:!0,value:null===(n=this.createdKey)||void 0===n?void 0:n.client_id,copyable:!0}),s("verdocs-text-input",{label:"Secret Key",disabled:!0,value:null===(a=this.createdKey)||void 0===a?void 0:a.client_secret,copyable:!0}),s("div",{class:"buttons"},s("verdocs-button",{size:"small",label:"Done",onClick:()=>this.createdKey=null}))))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};f.style='@-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}}';const g='<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>',b=e=>void 0!==e.find((e=>"owner"===e.name))?"Owner":void 0!==e.find((e=>"admin"===e.name))?"Admin":void 0!==e.find((e=>"member"===e.name))?"Member":void 0!==e.find((e=>"basic_user"===e.name))?"Basic User":void 0!==e.find((e=>"contact"===e.name))?"Contact":void 0,y=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.memberInvited=t(this,"memberInvited",7),this.memberUpdated=t(this,"memberUpdated",7),this.memberRemoved=t(this,"memberRemoved",7),this.endpoint=n.getDefault(),this.members=[],this.invited=[],this.roles=[],this.selectedTab=0,this.invitingMember=!1,this.newEmailAddress="",this.newRoleId="",this.submitting=!1,this.deletingInvitation=null,this.resendingInvitation=null,this.deletingMember=null}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){this.loadMembers().catch((e=>console.log("Unknown Error",e)))}async loadMembers(){var e,t,s,i,n,r;try{const[t,s,i]=await Promise.all([d(this.endpoint),v(this.endpoint,this.endpoint.session.organization_id),(n=this.endpoint,r=this.endpoint.session.organization_id,n.api.get("/organizations/".concat(r,"/invitation")).then((function(e){return e.data})))]);this.roles=t,this.members=s,this.invited=i,this.newRoleId=(null===(e=t.find((e=>"member"===e.name)))||void 0===e?void 0:e.id)||""}catch(e){null===(t=this.sdkError)||void 0===t||t.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(i=e.response)||void 0===i?void 0:i.data)),l("Unable to load members. Please try again later")}}async handleInviteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.endpoint.session.organization_id,s={email:this.newEmailAddress,role_id:this.newRoleId,organization_id:this.endpoint.session.organization_id},e.api.post("/organizations/".concat(t,"/invitation"),s).then((function(e){return e.data}))).then((e=>{console.log("[SETTINGS] Invited member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Invitation sent!",{style:"success"}),this.loadMembers()})).catch((e=>{console.log("[SETTINGS] Unable to invite member",e),this.invitingMember=!1,this.submitting=!1,this.newRoleId="",this.newEmailAddress="",l("Unable to invite member. Please try again later",{style:"error"})}))}async handleDeleteMember(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingMember.organization_id,s=this.deletingMember.email,e.api.delete("/organizations/".concat(t,"/profiles/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingMember=null,l("The member has been deleted.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingMember=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleDeleteInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.deletingInvitation.organization_id,s=this.deletingInvitation.email,e.api.delete("/organizations/".concat(t,"/invitation/").concat(s)).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.deletingInvitation=null,l("The invitation has been cancelled.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.deletingInvitation=null,console.log("Delete error",e),l("Unable to cancel invitation. Please try again later",{style:"error"})}))}async handleResendInvitation(){var e,t,s;this.submitting=!0,(e=n.getDefault(),t=this.resendingInvitation.organization_id,s=this.resendingInvitation.email,e.api.post("/organizations/".concat(t,"/invitation/").concat(s,"/resend")).then((function(e){return e.data}))).then((()=>{this.submitting=!1,this.resendingInvitation=null,l("The invitation has been resent.",{style:"success"}),this.loadMembers()})).catch((e=>{this.submitting=!1,this.resendingInvitation=null,console.log("REsend error",e),l("Unable to resend invitation. Please try again later",{style:"error"})}))}render(){if(!this.endpoint.session)return console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated");const e=this.roles.map((e=>({label:b([{name:e.name}]),value:e.id})));return s(i,null,s("verdocs-tabs",{tabs:[{label:`Members (${this.members.length})`},{label:`Pending Invitations (${this.invited.length})`}],onSelectTab:e=>this.selectedTab=e.detail.index}),0===this.selectedTab&&s("verdocs-table",{data:this.members,columns:[{id:"name",renderHeader:()=>"Member",renderCell:(e,t)=>{return s("div",{style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},s("div",{class:"role",style:{backgroundColor:(i=t.roles,void 0!==i.find((e=>"owner"===e.name))?"#9333ea":void 0!==i.find((e=>"admin"===e.name))?"#2563eb":void 0!==i.find((e=>"member"===e.name))?"#16a34a":void 0!==i.find((e=>"basic_user"===e.name))?"#ea580c":void 0!==i.find((e=>"contact"===e.name))?"#52525B":void 0)}},o(t)),s("span",null,r(t)));var i}},{id:"email",header:"E-mail Address"},{id:"phone",header:"Phone Number"},{id:"roles",header:"Role",renderCell:(e,t)=>`${b(t.roles)}`},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,t.id!==this.endpoint.session.profile_id&&s("div",{innerHTML:g,onClick:()=>this.deletingMember=t}))}]}),1===this.selectedTab&&s("verdocs-table",{data:this.invited,columns:[{id:"email",header:"E-mail Address"},{id:"generated_at",header:"Invited",renderCell:(e,t)=>s("div",null,m(new Date(t.generated_at),"MMM d, Y"))},{id:"role_id",header:"Role",renderCell:(e,t)=>{var i;return s("div",null,b([{name:null===(i=this.roles.find((e=>e.id===t.role_id)))||void 0===i?void 0:i.name}]))}},{id:"status",header:"Status",renderCell:(e,t)=>s("div",null,a(t.status))},{id:"actions",header:"Actions",renderCell:(e,t)=>s("div",null,s("div",{innerHTML:g,onClick:()=>this.deletingInvitation=t}),s("div",{innerHTML:'<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>',onClick:()=>this.resendingInvitation=t}))}]}),s("verdocs-button",{label:"Invite New Member",size:"normal",disabled:this.submitting,onClick:()=>this.invitingMember=!0}),this.invitingMember&&s("verdocs-dialog",{onExit:()=>this.invitingMember=!1},s("div",{slot:"title",class:"heading"},"Invite New Member"),s("div",{class:"content"},s("verdocs-text-input",{label:"E-mail Address",placeholder:"Enter the user's email address...",id:"verdocs-invite-email",value:this.newEmailAddress,autocomplete:"off",required:!0,onInput:e=>this.newEmailAddress=e.target.value,onFocusout:e=>{this.newEmailAddress=e.target.value.trim()}}),s("div",{style:{marginBottom:"20px"}}),s("verdocs-select-input",{options:e,label:"Role",onInput:e=>{this.newRoleId=e.target.value}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",label:"Cancel",disabled:this.submitting,onClick:()=>this.invitingMember=!1}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting||!this.newEmailAddress||!this.newRoleId,onClick:()=>this.handleInviteMember()})))),this.deletingMember&&s("verdocs-dialog",{onExit:()=>this.deletingMember=null},s("div",{slot:"title",class:"heading"},"Delete Member?"),s("div",{class:"content"},s("p",null,"Are you sure you want to delete this member? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingMember=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteMember()})))),this.deletingInvitation&&s("verdocs-dialog",{onExit:()=>this.deletingInvitation=null},s("div",{slot:"title",class:"heading"},"Cancel Invitation?"),s("div",{class:"content"},s("p",null,"Are you sure you want to cancel this invitation? This action cannot be undone."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.deletingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleDeleteInvitation()})))),this.resendingInvitation&&s("verdocs-dialog",{onExit:()=>this.resendingInvitation=null},s("div",{slot:"title",class:"heading"},"Resend Invitation?"),s("div",{class:"content"},s("p",null,"The user will receive an email reminder to join your organization."),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",size:"small",disabled:this.submitting,label:"Cancel",onClick:()=>this.resendingInvitation=null}),s("verdocs-button",{size:"small",label:"OK",disabled:this.submitting,onClick:()=>this.handleResendInvitation()})))))}};var T,M;y.style='@-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}}',function(e){e.assertEqual=e=>e,e.assertIs=function(){},e.assertNever=function(){throw new Error},e.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},e.getValidEnumValues=t=>{const s=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),i={};for(const e of s)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},e.find=(e,t)=>{for(const s of e)if(t(s))return s},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(T||(T={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(M||(M={}));const x=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),w=e=>{switch(typeof e){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(e)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(e)?x.array:null===e?x.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?x.promise:"undefined"!=typeof Map&&e instanceof Map?x.map:"undefined"!=typeof Set&&e instanceof Set?x.set:"undefined"!=typeof Date&&e instanceof Date?x.date:x.object;default:return x.unknown}},G=T.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"]);class k extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},s={_errors:[]},i=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)s._errors.push(t(n));else{let e=s,i=0;for(;i<n.path.length;){const s=n.path[i];i===n.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(n))):e[s]=e[s]||{_errors:[]},e=e[s],i++}}};return i(this),s}static assert(e){if(!(e instanceof k))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},s=[];for(const i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}k.create=e=>new k(e);const I=(e,t)=>{let s;switch(e.code){case G.invalid_type:s=e.received===x.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,T.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:s=`Unrecognized key(s) in object: ${T.joinValues(e.keys,", ")}`;break;case G.invalid_union:s="Invalid input";break;case G.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${T.joinValues(e.options)}`;break;case G.invalid_enum_value:s=`Invalid enum value. Expected ${T.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:s="Invalid function arguments";break;case G.invalid_return_type:s="Invalid function return type";break;case G.invalid_date:s="Invalid date";break;case G.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:T.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case G.too_small:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case G.too_big:s="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case G.custom:s="Invalid input";break;case G.invalid_intersection_types:s="Intersection results could not be merged";break;case G.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:s="Number must be finite";break;default:s=t.defaultError,T.assertNever(e)}return{message:s}};let _=I;function N(){return _}const S=e=>{const{data:t,path:s,errorMaps:i,issueData:n}=e,r=[...s,...n.path||[]],a={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const l=i.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(a,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function E(e,t){const s=N(),i=S({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===I?void 0:I].filter((e=>!!e))});e.common.issues.push(i)}class C{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const i of t){if("aborted"===i.status)return A;"dirty"===i.status&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const e of t){const t=await e.key,i=await e.value;s.push({key:t,value:i})}return C.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const i of t){const{key:t,value:n}=i;if("aborted"===t.status)return A;if("aborted"===n.status)return A;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!i.alwaysSet||(s[t.value]=n.value)}return{status:e.value,value:s}}}const A=Object.freeze({status:"aborted"}),P=e=>({status:"dirty",value:e}),Z=e=>({status:"valid",value:e}),z=e=>"aborted"===e.status,$=e=>"dirty"===e.status,D=e=>"valid"===e.status,j=e=>"undefined"!=typeof Promise&&e instanceof Promise;function B(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function L(e,t,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,s):n?n.value=s:t.set(e,s),s}var U,K,O;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(U||(U={}));class R{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const q=(e,t)=>{if(D(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new k(e.common.issues);return this._error=t,this._error}}};function V(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:i,description:n}=e;if(t&&(s||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var r,a;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!==(r=null!=o?o:i)&&void 0!==r?r:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!==(a=null!=o?o:s)&&void 0!==a?a:n.defaultError}},description:n}}class F{constructor(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)}get description(){return this._def.description}_getType(e){return w(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:w(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new C,ctx:{common:e.parent.common,data:e.data,parsedType:w(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(j(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;const i={common:{issues:[],async:null!==(s=null==t?void 0:t.async)&&void 0!==s&&s,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:w(e)},n=this._parseSync({data:e,path:i.path,parent:i});return q(i,n)}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:w(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(j(i)?i:Promise.resolve(i));return q(s,n)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,i)=>{const n=e(t),r=()=>i.addIssue({code:G.custom,...s(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then((e=>!!e||(r(),!1))):!!n||(r(),!1)}))}refinement(e,t){return this._refinement(((s,i)=>!!e(s)||(i.addIssue("function"==typeof t?t(s,i):t),!1)))}_refinement(e){return new Ue({schema:this,typeName:Xe.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Ke.create(this,this._def)}nullable(){return Oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return xe.create(this,this._def)}promise(){return Le.create(this,this._def)}or(e){return ke.create([this,e],this._def)}and(e){return Se.create(this,e,this._def)}transform(e){return new Ue({...V(this._def),schema:this,typeName:Xe.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Re({...V(this._def),innerType:this,defaultValue:t,typeName:Xe.ZodDefault})}brand(){return new We({typeName:Xe.ZodBranded,type:this,...V(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new qe({...V(this._def),innerType:this,catchValue:t,typeName:Xe.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return He.create(this,e)}readonly(){return Je.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const W=/^c[^\s-]{8,}$/i,H=/^[0-9a-z]+$/,J=/^[0-9A-HJKMNP-TV-Z]{26}$/,Y=/^[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,Q=/^[a-z0-9_-]{21}$/i,X=/^[-+]?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)?)??$/,ee=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let te;const se=/^(?:(?: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])$/,ie=/^(([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})))$/,ne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,re="((\\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])))",ae=new RegExp(`^${re}$`);function oe(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function le(e){let t=`${re}T${oe(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}class ce extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.string,received:t.parsedType}),A}const t=new C;let s;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const i=e.data.length>r.value,n=e.data.length<r.value;(i||n)&&(s=this._getOrReturnCtx(e,s),i?E(s,{code:G.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):n&&E(s,{code:G.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)ee.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"email",code:G.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)te||(te=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),te.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"emoji",code:G.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)Y.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"uuid",code:G.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)Q.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"nanoid",code:G.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)W.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid",code:G.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)H.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"cuid2",code:G.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)J.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"ulid",code:G.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(i){s=this._getOrReturnCtx(e,s),E(s,{validation:"url",code:G.invalid_string,message:r.message}),t.dirty()}else"regex"===r.kind?(r.regex.lastIndex=0,r.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"regex",code:G.invalid_string,message:r.message}),t.dirty())):"trim"===r.kind?e.data=e.data.trim():"includes"===r.kind?e.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):"toLowerCase"===r.kind?e.data=e.data.toLowerCase():"toUpperCase"===r.kind?e.data=e.data.toUpperCase():"startsWith"===r.kind?e.data.startsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):"endsWith"===r.kind?e.data.endsWith(r.value)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):"datetime"===r.kind?le(r).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:"datetime",message:r.message}),t.dirty()):"date"===r.kind?ae.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:"date",message:r.message}),t.dirty()):"time"===r.kind?new RegExp(`^${oe(r)}$`).test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{code:G.invalid_string,validation:"time",message:r.message}),t.dirty()):"duration"===r.kind?X.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"duration",code:G.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?(i=e.data,("v4"!==(n=r.version)&&n||!se.test(i))&&("v6"!==n&&n||!ie.test(i))&&(s=this._getOrReturnCtx(e,s),E(s,{validation:"ip",code:G.invalid_string,message:r.message}),t.dirty())):"base64"===r.kind?ne.test(e.data)||(s=this._getOrReturnCtx(e,s),E(s,{validation:"base64",code:G.invalid_string,message:r.message}),t.dirty()):T.assertNever(r);var i,n;return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement((t=>e.test(t)),{validation:t,code:G.invalid_string,...U.errToObj(s)})}_addCheck(e){return new ce({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...U.errToObj(e)})}url(e){return this._addCheck({kind:"url",...U.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...U.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...U.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...U.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...U.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...U.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...U.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...U.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...U.errToObj(e)})}datetime(e){var t,s;return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(s=null==e?void 0:e.local)&&void 0!==s&&s,...U.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...U.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...U.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...U.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...U.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...U.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...U.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...U.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...U.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...U.errToObj(t)})}nonempty(e){return this.min(1,U.errToObj(e))}trim(){return new ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function de(e,t){const s=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=s>i?s:i;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}ce.create=e=>{var t;return new ce({checks:[],typeName:Xe.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...V(e)})};class ue extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.number,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"int"===i.kind?T.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:G.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):"multipleOf"===i.kind?0!==de(e.data,i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),E(t,{code:G.not_finite,message:i.message}),s.dirty()):T.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new ue({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new ue({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:U.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:U.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:U.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:U.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&T.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ue.create=e=>new ue({checks:[],typeName:Xe.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...V(e)});class he extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.bigint,received:t.parsedType}),A}let t;const s=new C;for(const i of this._def.checks)"min"===i.kind?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"max"===i.kind?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),E(t,{code:G.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):T.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,U.toString(t))}gt(e,t){return this.setLimit("min",e,!1,U.toString(t))}lte(e,t){return this.setLimit("max",e,!0,U.toString(t))}lt(e,t){return this.setLimit("max",e,!1,U.toString(t))}setLimit(e,t,s,i){return new he({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:U.toString(i)}]})}_addCheck(e){return new he({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:U.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:U.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:U.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:U.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:U.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}he.create=e=>{var t;return new he({checks:[],typeName:Xe.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...V(e)})};class me extends F{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==x.boolean){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.boolean,received:t.parsedType}),A}return Z(e.data)}}me.create=e=>new me({typeName:Xe.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...V(e)});class pe extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.date,received:t.parsedType}),A}if(isNaN(e.data.getTime()))return E(this._getOrReturnCtx(e),{code:G.invalid_date}),A;const t=new C;let s;for(const i of this._def.checks)"min"===i.kind?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),t.dirty()):"max"===i.kind?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),E(s,{code:G.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):T.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:U.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:U.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}pe.create=e=>new pe({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Xe.ZodDate,...V(e)});class ve extends F{_parse(e){if(this._getType(e)!==x.symbol){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.symbol,received:t.parsedType}),A}return Z(e.data)}}ve.create=e=>new ve({typeName:Xe.ZodSymbol,...V(e)});class fe extends F{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.undefined,received:t.parsedType}),A}return Z(e.data)}}fe.create=e=>new fe({typeName:Xe.ZodUndefined,...V(e)});class ge extends F{_parse(e){if(this._getType(e)!==x.null){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.null,received:t.parsedType}),A}return Z(e.data)}}ge.create=e=>new ge({typeName:Xe.ZodNull,...V(e)});class be extends F{constructor(){super(...arguments),this._any=!0}_parse(e){return Z(e.data)}}be.create=e=>new be({typeName:Xe.ZodAny,...V(e)});class ye extends F{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Z(e.data)}}ye.create=e=>new ye({typeName:Xe.ZodUnknown,...V(e)});class Te extends F{_parse(e){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.never,received:t.parsedType}),A}}Te.create=e=>new Te({typeName:Xe.ZodNever,...V(e)});class Me extends F{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.void,received:t.parsedType}),A}return Z(e.data)}}Me.create=e=>new Me({typeName:Xe.ZodVoid,...V(e)});class xe extends F{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==x.array)return E(t,{code:G.invalid_type,expected:x.array,received:t.parsedType}),A;if(null!==i.exactLength){const e=t.data.length>i.exactLength.value,n=t.data.length<i.exactLength.value;(e||n)&&(E(t,{code:e?G.too_big:G.too_small,minimum:n?i.exactLength.value:void 0,maximum:e?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(null!==i.minLength&&t.data.length<i.minLength.value&&(E(t,{code:G.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),null!==i.maxLength&&t.data.length>i.maxLength.value&&(E(t,{code:G.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map(((e,s)=>i.type._parseAsync(new R(t,e,t.path,s))))).then((e=>C.mergeArray(s,e)));const n=[...t.data].map(((e,s)=>i.type._parseSync(new R(t,e,t.path,s))));return C.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new xe({...this._def,minLength:{value:e,message:U.toString(t)}})}max(e,t){return new xe({...this._def,maxLength:{value:e,message:U.toString(t)}})}length(e,t){return new xe({...this._def,exactLength:{value:e,message:U.toString(t)}})}nonempty(e){return this.min(1,e)}}function we(e){if(e instanceof Ge){const t={};for(const s in e.shape)t[s]=Ke.create(we(e.shape[s]));return new Ge({...e._def,shape:()=>t})}return e instanceof xe?new xe({...e._def,type:we(e.element)}):e instanceof Ke?Ke.create(we(e.unwrap())):e instanceof Oe?Oe.create(we(e.unwrap())):e instanceof Ee?Ee.create(e.items.map((e=>we(e)))):e}xe.create=(e,t)=>new xe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Xe.ZodArray,...V(t)});class Ge extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=T.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==x.object){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.object,received:t.parsedType}),A}const{status:t,ctx:s}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),r=[];if(!(this._def.catchall instanceof Te&&"strip"===this._def.unknownKeys))for(const e in s.data)n.includes(e)||r.push(e);const a=[];for(const e of n)a.push({key:{status:"valid",value:e},value:i[e]._parse(new R(s,s.data[e],s.path,e)),alwaysSet:e in s.data});if(this._def.catchall instanceof Te){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of r)a.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)r.length>0&&(E(s,{code:G.unrecognized_keys,keys:r}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of r)a.push({key:{status:"valid",value:t},value:e._parse(new R(s,s.data[t],s.path,t)),alwaysSet:t in s.data})}return s.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of a){const s=await t.key,i=await t.value;e.push({key:s,value:i,alwaysSet:t.alwaysSet})}return e})).then((e=>C.mergeObjectSync(t,e))):C.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return new Ge({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var i,n,r,a;const o=null!==(r=null===(n=(i=this._def).errorMap)||void 0===n?void 0:n.call(i,t,s).message)&&void 0!==r?r:s.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=U.errToObj(e).message)&&void 0!==a?a:o}:{message:o}}}:{}})}strip(){return new Ge({...this._def,unknownKeys:"strip"})}passthrough(){return new Ge({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ge({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ge({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Xe.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ge({...this._def,catchall:e})}pick(e){const t={};return T.objectKeys(e).forEach((s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])})),new Ge({...this._def,shape:()=>t})}omit(e){const t={};return T.objectKeys(this.shape).forEach((s=>{e[s]||(t[s]=this.shape[s])})),new Ge({...this._def,shape:()=>t})}deepPartial(){return we(this)}partial(e){const t={};return T.objectKeys(this.shape).forEach((s=>{const i=this.shape[s];t[s]=e&&!e[s]?i:i.optional()})),new Ge({...this._def,shape:()=>t})}required(e){const t={};return T.objectKeys(this.shape).forEach((s=>{if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof Ke;)e=e._def.innerType;t[s]=e}})),new Ge({...this._def,shape:()=>t})}keyof(){return De(T.objectKeys(this.shape))}}Ge.create=(e,t)=>new Ge({shape:()=>e,unknownKeys:"strip",catchall:Te.create(),typeName:Xe.ZodObject,...V(t)}),Ge.strictCreate=(e,t)=>new Ge({shape:()=>e,unknownKeys:"strict",catchall:Te.create(),typeName:Xe.ZodObject,...V(t)}),Ge.lazycreate=(e,t)=>new Ge({shape:e,unknownKeys:"strip",catchall:Te.create(),typeName:Xe.ZodObject,...V(t)});class ke extends F{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map((async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const s of e)if("dirty"===s.result.status)return t.common.issues.push(...s.ctx.common.issues),s.result;const s=e.map((e=>new k(e.ctx.common.issues)));return E(t,{code:G.invalid_union,unionErrors:s}),A}));{let e;const i=[];for(const n of s){const s={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:s}),s.common.issues.length&&i.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=i.map((e=>new k(e)));return E(t,{code:G.invalid_union,unionErrors:n}),A}}get options(){return this._def.options}}ke.create=(e,t)=>new ke({options:e,typeName:Xe.ZodUnion,...V(t)});const Ie=e=>e instanceof ze?Ie(e.schema):e instanceof Ue?Ie(e.innerType()):e instanceof $e?[e.value]:e instanceof je?e.options:e instanceof Be?T.objectValues(e.enum):e instanceof Re?Ie(e._def.innerType):e instanceof fe?[void 0]:e instanceof ge?[null]:e instanceof Ke?[void 0,...Ie(e.unwrap())]:e instanceof Oe?[null,...Ie(e.unwrap())]:e instanceof We||e instanceof Je?Ie(e.unwrap()):e instanceof qe?Ie(e._def.innerType):[];class _e extends F{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return E(t,{code:G.invalid_type,expected:x.object,received:t.parsedType}),A;const s=this.discriminator,i=this.optionsMap.get(t.data[s]);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(E(t,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const i=new Map;for(const s of t){const t=Ie(s.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,s)}}return new _e({typeName:Xe.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...V(s)})}}function Ne(e,t){const s=w(e),i=w(t);if(e===t)return{valid:!0,data:e};if(s===x.object&&i===x.object){const s=T.objectKeys(t),i=T.objectKeys(e).filter((e=>-1!==s.indexOf(e))),n={...e,...t};for(const s of i){const i=Ne(e[s],t[s]);if(!i.valid)return{valid:!1};n[s]=i.data}return{valid:!0,data:n}}if(s===x.array&&i===x.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const n=Ne(e[i],t[i]);if(!n.valid)return{valid:!1};s.push(n.data)}return{valid:!0,data:s}}return s===x.date&&i===x.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Se extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=(e,i)=>{if(z(e)||z(i))return A;const n=Ne(e.value,i.value);return n.valid?(($(e)||$(i))&&t.dirty(),{status:t.value,value:n.data}):(E(s,{code:G.invalid_intersection_types}),A)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then((([e,t])=>i(e,t))):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Se.create=(e,t,s)=>new Se({left:e,right:t,typeName:Xe.ZodIntersection,...V(s)});class Ee extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return E(s,{code:G.invalid_type,expected:x.array,received:s.parsedType}),A;if(s.data.length<this._def.items.length)return E(s,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&s.data.length>this._def.items.length&&(E(s,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map(((e,t)=>{const i=this._def.items[t]||this._def.rest;return i?i._parse(new R(s,e,s.path,t)):null})).filter((e=>!!e));return s.common.async?Promise.all(i).then((e=>C.mergeArray(t,e))):C.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Ee({...this._def,rest:e})}}Ee.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ee({items:e,typeName:Xe.ZodTuple,rest:null,...V(t)})};class Ce extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.object)return E(s,{code:G.invalid_type,expected:x.object,received:s.parsedType}),A;const i=[],n=this._def.keyType,r=this._def.valueType;for(const e in s.data)i.push({key:n._parse(new R(s,e,s.path,e)),value:r._parse(new R(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?C.mergeObjectAsync(t,i):C.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return new Ce(t instanceof F?{keyType:e,valueType:t,typeName:Xe.ZodRecord,...V(s)}:{keyType:ce.create(),valueType:e,typeName:Xe.ZodRecord,...V(t)})}}class Ae extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return E(s,{code:G.invalid_type,expected:x.map,received:s.parsedType}),A;const i=this._def.keyType,n=this._def.valueType,r=[...s.data.entries()].map((([e,t],r)=>({key:i._parse(new R(s,e,s.path,[r,"key"])),value:n._parse(new R(s,t,s.path,[r,"value"]))})));if(s.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const s of r){const i=await s.key,n=await s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const s of r){const i=s.key,n=s.value;if("aborted"===i.status||"aborted"===n.status)return A;"dirty"!==i.status&&"dirty"!==n.status||t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}Ae.create=(e,t,s)=>new Ae({valueType:t,keyType:e,typeName:Xe.ZodMap,...V(s)});class Pe extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return E(s,{code:G.invalid_type,expected:x.set,received:s.parsedType}),A;const i=this._def;null!==i.minSize&&s.data.size<i.minSize.value&&(E(s,{code:G.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),null!==i.maxSize&&s.data.size>i.maxSize.value&&(E(s,{code:G.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const n=this._def.valueType;function r(e){const s=new Set;for(const i of e){if("aborted"===i.status)return A;"dirty"===i.status&&t.dirty(),s.add(i.value)}return{status:t.value,value:s}}const a=[...s.data.values()].map(((e,t)=>n._parse(new R(s,e,s.path,t))));return s.common.async?Promise.all(a).then((e=>r(e))):r(a)}min(e,t){return new Pe({...this._def,minSize:{value:e,message:U.toString(t)}})}max(e,t){return new Pe({...this._def,maxSize:{value:e,message:U.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Pe.create=(e,t)=>new Pe({valueType:e,minSize:null,maxSize:null,typeName:Xe.ZodSet,...V(t)});class Ze extends F{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return E(t,{code:G.invalid_type,expected:x.function,received:t.parsedType}),A;function s(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:G.invalid_arguments,argumentsError:s}})}function i(e,s){return S({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,N(),I].filter((e=>!!e)),issueData:{code:G.invalid_return_type,returnTypeError:s}})}const n={errorMap:t.common.contextualErrorMap},r=t.data;if(this._def.returns instanceof Le){const e=this;return Z((async function(...t){const a=new k([]),o=await e._def.args.parseAsync(t,n).catch((e=>{throw a.addIssue(s(t,e)),a})),l=await Reflect.apply(r,this,o);return await e._def.returns._def.type.parseAsync(l,n).catch((e=>{throw a.addIssue(i(l,e)),a}))}))}{const e=this;return Z((function(...t){const a=e._def.args.safeParse(t,n);if(!a.success)throw new k([s(t,a.error)]);const o=Reflect.apply(r,this,a.data),l=e._def.returns.safeParse(o,n);if(!l.success)throw new k([i(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ze({...this._def,args:Ee.create(e).rest(ye.create())})}returns(e){return new Ze({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new Ze({args:e||Ee.create([]).rest(ye.create()),returns:t||ye.create(),typeName:Xe.ZodFunction,...V(s)})}}class ze extends F{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ze.create=(e,t)=>new ze({getter:e,typeName:Xe.ZodLazy,...V(t)});class $e extends F{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:G.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}}function De(e,t){return new je({values:e,typeName:Xe.ZodEnum,...V(t)})}$e.create=(e,t)=>new $e({value:e,typeName:Xe.ZodLiteral,...V(t)});class je extends F{constructor(){super(...arguments),K.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return E(t,{expected:T.joinValues(this._def.values),received:t.parsedType,code:G.invalid_type}),A}if(B(this,K,"f")||L(this,K,new Set(this._def.values),"f"),!B(this,K,"f").has(e.data)){const t=this._getOrReturnCtx(e);return E(t,{received:t.data,code:G.invalid_enum_value,options:this._def.values}),A}return Z(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return je.create(e,{...this._def,...t})}exclude(e,t=this._def){return je.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}K=new WeakMap,je.create=De;class Be extends F{constructor(){super(...arguments),O.set(this,void 0)}_parse(e){const t=T.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const e=T.objectValues(t);return E(s,{expected:T.joinValues(e),received:s.parsedType,code:G.invalid_type}),A}if(B(this,O,"f")||L(this,O,new Set(T.getValidEnumValues(this._def.values)),"f"),!B(this,O,"f").has(e.data)){const e=T.objectValues(t);return E(s,{received:s.data,code:G.invalid_enum_value,options:e}),A}return Z(e.data)}get enum(){return this._def.values}}O=new WeakMap,Be.create=(e,t)=>new Be({values:e,typeName:Xe.ZodNativeEnum,...V(t)});class Le extends F{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&!1===t.common.async)return E(t,{code:G.invalid_type,expected:x.promise,received:t.parsedType}),A;const s=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return Z(s.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Le.create=(e,t)=>new Le({type:e,typeName:Xe.ZodPromise,...V(t)});class Ue extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{E(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const e=i.transform(s.data,n);if(s.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return A;const i=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===i.status?A:"dirty"===i.status||"dirty"===t.value?P(i.value):i}));{if("aborted"===t.value)return A;const i=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===i.status?A:"dirty"===i.status||"dirty"===t.value?P(i.value):i}}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,n);if(s.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(!1===s.common.async){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===i.status?A:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((s=>"aborted"===s.status?A:("dirty"===s.status&&t.dirty(),e(s.value).then((()=>({status:t.value,value:s.value}))))))}if("transform"===i.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!D(e))return e;const r=i.transform(e.value,n);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then((e=>D(e)?Promise.resolve(i.transform(e.value,n)).then((e=>({status:t.value,value:e}))):e))}T.assertNever(i)}}Ue.create=(e,t,s)=>new Ue({schema:e,typeName:Xe.ZodEffects,effect:t,...V(s)}),Ue.createWithPreprocess=(e,t,s)=>new Ue({schema:t,effect:{type:"preprocess",transform:e},typeName:Xe.ZodEffects,...V(s)});class Ke extends F{_parse(e){return this._getType(e)===x.undefined?Z(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ke.create=(e,t)=>new Ke({innerType:e,typeName:Xe.ZodOptional,...V(t)});class Oe extends F{_parse(e){return this._getType(e)===x.null?Z(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(e,t)=>new Oe({innerType:e,typeName:Xe.ZodNullable,...V(t)});class Re extends F{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Re.create=(e,t)=>new Re({innerType:e,typeName:Xe.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...V(t)});class qe extends F{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return j(i)?i.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}))):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new k(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}qe.create=(e,t)=>new qe({innerType:e,typeName:Xe.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...V(t)});class Ve extends F{_parse(e){if(this._getType(e)!==x.nan){const t=this._getOrReturnCtx(e);return E(t,{code:G.invalid_type,expected:x.nan,received:t.parsedType}),A}return{status:"valid",value:e.data}}}Ve.create=e=>new Ve({typeName:Xe.ZodNaN,...V(e)});const Fe=Symbol("zod_brand");class We extends F{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class He extends F{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),P(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?A:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new He({in:e,out:t,typeName:Xe.ZodPipeline})}}class Je extends F{_parse(e){const t=this._def.innerType._parse(e),s=e=>(D(e)&&(e.value=Object.freeze(e.value)),e);return j(t)?t.then((e=>s(e))):s(t)}unwrap(){return this._def.innerType}}function Ye(e,t={},s){return e?be.create().superRefine(((i,n)=>{var r,a;if(!e(i)){const e="function"==typeof t?t(i):"string"==typeof t?{message:t}:t,o=null===(a=null!==(r=e.fatal)&&void 0!==r?r:s)||void 0===a||a;n.addIssue({code:"custom",..."string"==typeof e?{message:e}:e,fatal:o})}})):be.create()}Je.create=(e,t)=>new Je({innerType:e,typeName:Xe.ZodReadonly,...V(t)});const Qe={object:Ge.lazycreate};var Xe;!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"}(Xe||(Xe={}));const et=ce.create,tt=ue.create,st=me.create,it=Ue.create,nt={string:e=>ce.create({...e,coerce:!0}),number:e=>ue.create({...e,coerce:!0}),boolean:e=>me.create({...e,coerce:!0}),bigint:e=>he.create({...e,coerce:!0}),date:e=>pe.create({...e,coerce:!0})};var rt=Object.freeze({__proto__:null,defaultErrorMap:I,setErrorMap:function(e){_=e},getErrorMap:N,makeIssue:S,EMPTY_PATH:[],addIssueToContext:E,ParseStatus:C,INVALID:A,DIRTY:P,OK:Z,isAborted:z,isDirty:$,isValid:D,isAsync:j,get util(){return T},get objectUtil(){return M},ZodParsedType:x,getParsedType:w,ZodType:F,datetimeRegex:le,ZodString:ce,ZodNumber:ue,ZodBigInt:he,ZodBoolean:me,ZodDate:pe,ZodSymbol:ve,ZodUndefined:fe,ZodNull:ge,ZodAny:be,ZodUnknown:ye,ZodNever:Te,ZodVoid:Me,ZodArray:xe,ZodObject:Ge,ZodUnion:ke,ZodDiscriminatedUnion:_e,ZodIntersection:Se,ZodTuple:Ee,ZodRecord:Ce,ZodMap:Ae,ZodSet:Pe,ZodFunction:Ze,ZodLazy:ze,ZodLiteral:$e,ZodEnum:je,ZodNativeEnum:Be,ZodPromise:Le,ZodEffects:Ue,ZodTransformer:Ue,ZodOptional:Ke,ZodNullable:Oe,ZodDefault:Re,ZodCatch:qe,ZodNaN:Ve,BRAND:Fe,ZodBranded:We,ZodPipeline:He,ZodReadonly:Je,custom:Ye,Schema:F,ZodSchema:F,late:Qe,get ZodFirstPartyTypeKind(){return Xe},coerce:nt,any:be.create,array:xe.create,bigint:he.create,boolean:st,date:pe.create,discriminatedUnion:_e.create,effect:it,enum:je.create,function:Ze.create,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Ye((t=>t instanceof e),t),intersection:Se.create,lazy:ze.create,literal:$e.create,map:Ae.create,nan:Ve.create,nativeEnum:Be.create,never:Te.create,null:ge.create,nullable:Oe.create,number:tt,object:Ge.create,oboolean:()=>st().optional(),onumber:()=>tt().optional(),optional:Ke.create,ostring:()=>et().optional(),pipeline:He.create,preprocess:Ue.createWithPreprocess,promise:Le.create,record:Ce.create,set:Pe.create,strictObject:Ge.strictCreate,string:et,symbol:ve.create,transformer:it,tuple:Ee.create,undefined:fe.create,union:ke.create,unknown:ye.create,void:Me.create,NEVER:A,ZodIssueCode:G,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:k});const at=[["International Date Line West","GMT-11:00","(GMT-11:00) International Date Line West"],["Midway Island","GMT-11:00","(GMT-11:00) Midway Island"],["Samoa","GMT-11:00","(GMT-11:00) Samoa"],["Hawaii","GMT-10:00","(GMT-10:00) Hawaii"],["Alaska","GMT-09:00","(GMT-09:00) Alaska"],["Pacific Time (US & Canada)","GMT-08:00","(GMT-08:00) Pacific Time (US & Canada)"],["Tijuana","GMT-08:00","(GMT-08:00) Tijuana"],["Arizona","GMT-07:00","(GMT-07:00) Arizona"],["Chihuahua","GMT-07:00","(GMT-07:00) Chihuahua"],["Mazatlan","GMT-07:00","(GMT-07:00) Mazatlan"],["Mountain Time (US & Canada)","GMT-07:00","(GMT-07:00) Mountain Time (US & Canada)"],["Central America","GMT-06:00","(GMT-06:00) Central America"],["Central Time (US & Canada)","GMT-06:00","(GMT-06:00) Central Time (US & Canada)"],["Guadalajara","GMT-06:00","(GMT-06:00) Guadalajara"],["Mexico City","GMT-06:00","(GMT-06:00) Mexico City"],["Monterrey","GMT-06:00","(GMT-06:00) Monterrey"],["Saskatchewan","GMT-06:00","(GMT-06:00) Saskatchewan"],["Bogota","GMT-05:00","(GMT-05:00) Bogota"],["Eastern Time (US & Canada)","GMT-05:00","(GMT-05:00) Eastern Time (US & Canada)"],["Indiana (East)","GMT-05:00","(GMT-05:00) Indiana (East)"],["Lima","GMT-05:00","(GMT-05:00) Lima"],["Quito","GMT-05:00","(GMT-05:00) Quito"],["Caracas","GMT-04:30","(GMT-04:30) Caracas"],["Atlantic Time (Canada)","GMT-04:00","(GMT-04:00) Atlantic Time (Canada)"],["Georgetown","GMT-04:00","(GMT-04:00) Georgetown"],["La Paz","GMT-04:00","(GMT-04:00) La Paz"],["Santiago","GMT-04:00","(GMT-04:00) Santiago"],["Newfoundland","GMT-03:30","(GMT-03:30) Newfoundland"],["Brasilia","GMT-03:00","(GMT-03:00) Brasilia"],["Buenos Aires","GMT-03:00","(GMT-03:00) Buenos Aires"],["Greenland","GMT-03:00","(GMT-03:00) Greenland"],["Mid-Atlantic","GMT-02:00","(GMT-02:00) Mid-Atlantic"],["Azores","GMT-01:00","(GMT-01:00) Azores"],["Cape Verde Is.","GMT-01:00","(GMT-01:00) Cape Verde Is."],["Casablanca","GMT+00:00","(GMT+00:00) Casablanca"],["Dublin","GMT+00:00","(GMT+00:00) Dublin"],["Edinburgh","GMT+00:00","(GMT+00:00) Edinburgh"],["Lisbon","GMT+00:00","(GMT+00:00) Lisbon"],["London","GMT+00:00","(GMT+00:00) London"],["Monrovia","GMT+00:00","(GMT+00:00) Monrovia"],["UTC","GMT+00:00","(GMT+00:00) UTC"],["Amsterdam","GMT+01:00","(GMT+01:00) Amsterdam"],["Belgrade","GMT+01:00","(GMT+01:00) Belgrade"],["Berlin","GMT+01:00","(GMT+01:00) Berlin"],["Bern","GMT+01:00","(GMT+01:00) Bern"],["Bratislava","GMT+01:00","(GMT+01:00) Bratislava"],["Brussels","GMT+01:00","(GMT+01:00) Brussels"],["Budapest","GMT+01:00","(GMT+01:00) Budapest"],["Copenhagen","GMT+01:00","(GMT+01:00) Copenhagen"],["Ljubljana","GMT+01:00","(GMT+01:00) Ljubljana"],["Madrid","GMT+01:00","(GMT+01:00) Madrid"],["Paris","GMT+01:00","(GMT+01:00) Paris"],["Prague","GMT+01:00","(GMT+01:00) Prague"],["Rome","GMT+01:00","(GMT+01:00) Rome"],["Sarajevo","GMT+01:00","(GMT+01:00) Sarajevo"],["Skopje","GMT+01:00","(GMT+01:00) Skopje"],["Stockholm","GMT+01:00","(GMT+01:00) Stockholm"],["Vienna","GMT+01:00","(GMT+01:00) Vienna"],["Warsaw","GMT+01:00","(GMT+01:00) Warsaw"],["West Central Africa","(GMT+01:00","(GMT+01:00) West Central Africa"],["Zagreb","GMT+01:00","(GMT+01:00) Zagreb"],["Athens","GMT+02:00","(GMT+02:00) Athens"],["Bucharest","GMT+02:00","(GMT+02:00) Bucharest"],["Cairo","GMT+02:00","(GMT+02:00) Cairo"],["Harare","GMT+02:00","(GMT+02:00) Harare"],["Helsinki","GMT+02:00","(GMT+02:00) Helsinki"],["Istanbul","GMT+02:00","(GMT+02:00) Istanbul"],["Jerusalem","GMT+02:00","(GMT+02:00) Jerusalem"],["Kyiv","GMT+02:00","(GMT+02:00) Kyiv"],["Minsk","GMT+02:00","(GMT+02:00) Minsk"],["Pretoria","GMT+02:00","(GMT+02:00) Pretoria"],["Riga","GMT+02:00","(GMT+02:00) Riga"],["Sofia","GMT+02:00","(GMT+02:00) Sofia"],["Tallinn","GMT+02:00","(GMT+02:00) Tallinn"],["Vilnius","GMT+02:00","(GMT+02:00) Vilnius"],["Baghdad","GMT+03:00","(GMT+03:00) Baghdad"],["Kuwait","GMT+03:00","(GMT+03:00) Kuwait"],["Moscow","GMT+03:00","(GMT+03:00) Moscow"],["Nairobi","GMT+03:00","(GMT+03:00) Nairobi"],["Riyadh","GMT+03:00","(GMT+03:00) Riyadh"],["St. Petersburg","GMT+03:00","(GMT+03:00) St. Petersburg"],["Volgograd","GMT+03:00","(GMT+03:00) Volgograd"],["Tehran","GMT+03:30","(GMT+03:30) Tehran"],["Abu Dhabi","GMT+04:00","(GMT+04:00) Abu Dhabi"],["Baku","GMT+04:00","(GMT+04:00) Baku"],["Muscat","GMT+04:00","(GMT+04:00) Muscat"],["Tbilisi","GMT+04:00","(GMT+04:00) Tbilisi"],["Yerevan","GMT+04:00","(GMT+04:00) Yerevan"],["Kabul","GMT+04:30","(GMT+04:30) Kabul"],["Ekaterinburg","GMT+05:00","(GMT+05:00) Ekaterinburg"],["Islamabad","GMT+05:00","(GMT+05:00) Islamabad"],["Karachi","GMT+05:00","(GMT+05:00) Karachi"],["Tashkent","GMT+05:00","(GMT+05:00) Tashkent"],["Chennai","GMT+05:30","(GMT+05:30) Chennai"],["Kolkata","GMT+05:30","(GMT+05:30) Kolkata"],["Mumbai","GMT+05:30","(GMT+05:30) Mumbai"],["New Delhi","GMT+05:30","(GMT+05:30) New Delhi"],["Sri Jayawardenepura","GMT+05:30","(GMT+05:30) Sri Jayawardenepura"],["Kathmandu","GMT+05:45","(GMT+05:45) Kathmandu"],["Almaty","GMT+06:00","(GMT+06:00) Almaty"],["Astana","GMT+06:00","(GMT+06:00) Astana"],["Dhaka","GMT+06:00","(GMT+06:00) Dhaka"],["Novosibirsk","GMT+06:00","(GMT+06:00) Novosibirsk"],["Rangoon","GMT+06:30","(GMT+06:30) Rangoon"],["Bangkok","GMT+07:00","(GMT+07:00) Bangkok"],["Hanoi","GMT+07:00","(GMT+07:00) Hanoi"],["Jakarta","GMT+07:00","(GMT+07:00) Jakarta"],["Krasnoyarsk","GMT+07:00","(GMT+07:00) Krasnoyarsk"],["Beijing","GMT+08:00","(GMT+08:00) Beijing"],["Chongqing","GMT+08:00","(GMT+08:00) Chongqing"],["Hong Kong","GMT+08:00","(GMT+08:00) Hong Kong"],["Irkutsk","GMT+08:00","(GMT+08:00) Irkutsk"],["Kuala Lumpur","GMT+08:00","(GMT+08:00) Kuala Lumpur"],["Perth","GMT+08:00","(GMT+08:00) Perth"],["Singapore","GMT+08:00","(GMT+08:00) Singapore"],["Taipei","GMT+08:00","(GMT+08:00) Taipei"],["Ulaan Bataar","GMT+08:00","(GMT+08:00) Ulaan Bataar"],["Urumqi","GMT+08:00","(GMT+08:00) Urumqi"],["Osaka","GMT+09:00","(GMT+09:00) Osaka"],["Sapporo","GMT+09:00","(GMT+09:00) Sapporo"],["Seoul","GMT+09:00","(GMT+09:00) Seoul"],["Tokyo","GMT+09:00","(GMT+09:00) Tokyo"],["Yakutsk","GMT+09:00","(GMT+09:00) Yakutsk"],["Adelaide","GMT+09:30","(GMT+09:30) Adelaide"],["Darwin","GMT+09:30","(GMT+09:30) Darwin"],["Brisbane","GMT+10:00","(GMT+10:00) Brisbane"],["Canberra","GMT+10:00","(GMT+10:00) Canberra"],["Guam","GMT+10:00","(GMT+10:00) Guam"],["Hobart","GMT+10:00","(GMT+10:00) Hobart"],["Melbourne","GMT+10:00","(GMT+10:00) Melbourne"],["Port Moresby","GMT+10:00","(GMT+10:00) Port Moresby"],["Sydney","GMT+10:00","(GMT+10:00) Sydney"],["Vladivostok","GMT+10:00","(GMT+10:00) Vladivostok"],["Kamchatka","GMT+11:00","(GMT+11:00) Kamchatka"],["Magadan","GMT+11:00","(GMT+11:00) Magadan"],["New Caledonia","GMT+11:00","(GMT+11:00) New Caledonia"],["Solomon Is.","GMT+11:00","(GMT+11:00) Solomon Is."],["Auckland","GMT+12:00","(GMT+12:00) Auckland"],["Fiji","GMT+12:00","(GMT+12:00) Fiji"],["Marshall Is.","GMT+12:00","(GMT+12:00) Marshall Is."],["Wellington","GMT+12:00","(GMT+12:00) Wellington"],["Nuku'alofa","GMT+13:00","(GMT+13:00) Nuku'alofa"]].map((e=>({value:e[2],label:e[2]}))),ot=rt.object({business_name:rt.string().trim().max(30).optional(),contact_email:rt.string().trim().email("Invalid email").optional().or(rt.literal("")),phone:rt.preprocess((e=>p(String(e).trim())),rt.string().optional()),timezone:rt.string().trim().optional(),url:rt.string().trim().optional()}),lt=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.organizationUpdated=t(this,"organizationUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.name="",this.business_name="",this.contact_email="",this.phone="",this.address="",this.address2="",this.timezone="",this.url=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await(t=this.endpoint,s=this.endpoint.session.organization_id,t.api.get("/organizations/".concat(s)).then((function(e){return e.data})));var t,s;console.log("[SETTINGS] Loaded organization",e),this.resetForm(e)}resetForm(e){this.name=e.name,this.business_name=e.business_name,this.contact_email=e.contact_email,this.phone=e.phone,this.address=e.address,this.address2=e.address2,this.timezone=e.timezone,this.url=e.url,this.dirty=!1,this.valid=!0}handleSubmit(e){var t,s,i;e.preventDefault(),e.stopPropagation(),(t=n.getDefault(),s=this.endpoint.session.organization_id,i={name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url},t.api.patch("/organizations/".concat(s),i).then((function(e){return e.data}))).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.organizationUpdated)||void 0===t||t.emit({endpoint:this.endpoint,organization:e}),this.resetForm(e)})).catch((e=>l(`Error updating organization: ${e.message}`,{style:"error"})))}processFields(){const e=ot.safeParse({name:this.name,business_name:this.business_name,contact_email:this.contact_email,phone:this.phone,address:this.address,address2:this.address2,timezone:this.timezone,url:this.url});console.log("[SETTINGS] Validation result",e),this.valid=e.success,this.dirty=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"Organization Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-name",value:this.name,autocomplete:"off",label:"Name",required:!1,disabled:!1,placeholder:"Enter your organization's name...",onInput:e=>this.name=e.target.value,onFocusout:e=>{this.name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-business-name",value:this.business_name,autocomplete:"off",label:"Display Name",placeholder:"The name to display on communications...",onInput:e=>this.business_name=e.target.value,onFocusout:e=>{this.business_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-url",value:this.url,autocomplete:"off",label:"Web URL",placeholder:"Enter your Web URL...",onInput:e=>this.url=e.target.value,onFocusout:e=>{this.url=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-organization-phone",value:this.phone,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-organization-email",value:this.contact_email,clearable:!0,autocomplete:"off",label:"Contact Email",placeholder:"Enter your contact email address...",onInput:e=>this.contact_email=e.target.value,onFocusout:e=>{this.contact_email=e.target.value.trim(),this.processFields()}}),s("verdocs-select-input",{options:at,value:this.timezone,label:"Time Zone"}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};lt.style='@-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}}';const ct=rt.object({first_name:rt.string().trim().min(1,"First name is required").max(30),last_name:rt.string().trim().min(1,"Last name is required").max(30),email:rt.string().trim().email("Invalid email").min(1,"Email is required"),phone:rt.preprocess((e=>p(String(e).trim())),rt.string())}),dt=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.profileUpdated=t(this,"profileUpdated",7),this.endpoint=n.getDefault(),this.valid=!1,this.dirty=!1,this.submitting=!1,this.first_name="",this.last_name="",this.email="",this.phone=""}componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[SETTINGS] Must be authenticated")}async componentDidLoad(){const e=await u(this.endpoint);console.log("[SETTINGS] Loaded profile",e),this.resetForm(e)}resetForm(e){this.first_name=e.first_name,this.last_name=e.last_name,this.email=e.email,this.phone=e.phone,this.dirty=!1,this.valid=!0}handleSubmit(e){e.preventDefault(),e.stopPropagation(),h(n.getDefault(),this.endpoint.session.profile_id,{first_name:this.first_name,last_name:this.last_name,phone:this.phone}).then((e=>{var t;console.log("[SETTINGS] Update result",e),null===(t=this.profileUpdated)||void 0===t||t.emit({endpoint:this.endpoint,profile:e}),this.resetForm(e)})).catch((e=>l(`Error updating profile: ${e.message}`,{style:"error"})))}processFields(){const e=ct.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=!0}render(){return this.endpoint.session?s(i,null,s("h1",null,"My Profile"),s("form",{onSubmit:e=>this.handleSubmit(e)},s("div",{class:"columns"},s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-first-name",value:this.first_name,autocomplete:"off",label:"First Name",required:!0,placeholder:"Enter your first name...",onInput:e=>this.first_name=e.target.value,onFocusout:e=>{this.first_name=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-last-name",value:this.last_name,autocomplete:"off",label:"Last Name",required:!0,placeholder:"Enter your last name...",onInput:e=>this.last_name=e.target.value,onFocusout:e=>{this.last_name=e.target.value.trim(),this.processFields()}})),s("div",{class:"column"},s("verdocs-text-input",{id:"verdocs-profile-email",value:this.email,autocomplete:"off",label:"Email Address",required:!0,disabled:!0,placeholder:"Enter your email address...",onInput:e=>this.email=e.target.value,onFocusout:e=>{this.email=e.target.value.trim(),this.processFields()}}),s("verdocs-text-input",{id:"verdocs-profile-phone",value:this.phone,clearable:!0,autocomplete:"off",label:"Phone Number",placeholder:"Enter your phone number...",onInput:e=>this.phone=e.target.value,onFocusout:e=>{this.phone=e.target.value.trim(),this.processFields()}}))),s("verdocs-button",{type:"submit",label:"Save",size:"normal",disabled:this.submitting||!this.dirty}))):(console.log("[SETTINGS] Must be authenticated"),s(i,{class:"authentication-required"},"Must be authenticated"))}};dt.style='@-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}}';export{f as verdocs_settings_api_keys,y as verdocs_settings_members,lt as verdocs_settings_organization,dt as verdocs_settings_profile}
@@ -1 +1 @@
1
- System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-235b4a0b.system.js","./p-0cafdb16.system.js","./p-bbee73c8.system.js","./p-8aae8d16.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,o,n,i,s,a;return{setters:[function(e){t=e.r;o=e.c;n=e.h;i=e.H},function(){},function(e){s=e.V},function(e){a=e.c},function(){},function(){},function(){},function(){}],execute:function(){var c='@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var r='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var l='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';var d='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AccountCircleIcon" tabindex="-1" title="AccountCircle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var u=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=o(this,"searchContacts",7);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.endpoint=s.getDefault();this.templateRole=null;this.contactSuggestions=[];this.name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){this.name=this.templateRole.full_name||"";this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!==""}};e.prototype.handleNameChange=function(e){var t;this.name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=a(e.target.value)};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({full_name:this.name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.name=t.name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("div",{class:"row"},n("label",{htmlFor:this.nameFieldId},"Name:"),n("input",{id:this.nameFieldId,name:this.nameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.name,placeholder:"Recipient Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleNameChange(t)}}),this.showSuggestions&&n("div",{class:"dropdown"},this.contactSuggestions.map((function(t){var o;return n("div",{key:(o=t.id)!==null&&o!==void 0?o:t.name,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.avatar?n("img",{alt:"Avatar",class:"avatar",src:t.avatar}):n("div",{class:"avatar",innerHTML:d}),n("div",{class:"details"},n("div",{class:"name"},t.name),t.email&&n("div",{class:"destination"},t.email),t.phone&&n("div",{class:"destination"},t.phone)))})))),n("div",{class:"row"},n("label",{htmlFor:this.emailFieldId},"Email:"),n("input",{id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),n("div",{class:"row"},n("label",{htmlFor:this.phoneFieldId},"Phone:"),n("input",{id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showMessage&&n("div",{class:"row"},n("label",{htmlFor:"verdocs-contact-picker-message"},"Message:"),n("input",{id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),n("div",{class:"buttons"},n("verdocs-toggle-button",{icon:r,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),n("verdocs-toggle-button",{icon:l,size:"small",active:this.delegator,onToggle:function(t){e.delegator=t.detail.active;e.showSuggestions=false}}),n("div",{class:"flex-fill"}),n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}());u.style=c;var g='@-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-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var p=e("verdocs_toggle_button",function(){function e(e){t(this,e);this.toggle=o(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return n(i,{class:"size-".concat(this.size)},this.icon?n("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):n("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}());p.style=g}}}));
1
+ System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-235b4a0b.system.js","./p-e041e991.system.js","./p-bbee73c8.system.js","./p-8aae8d16.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,o,n,i,s,a;return{setters:[function(e){t=e.r;o=e.c;n=e.h;i=e.H},function(){},function(e){s=e.V},function(e){a=e.c},function(){},function(){},function(){},function(){}],execute:function(){var c='@-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-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var r='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiBox-root css-1om0hkc" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var l='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AssignmentIndIcon" tabindex="-1" title="AssignmentInd"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';var d='<svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium MuiSvgIcon-root MuiSvgIcon-fontSizeLarge css-zjt8k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="AccountCircleIcon" tabindex="-1" title="AccountCircle"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var u=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=o(this,"searchContacts",7);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.endpoint=s.getDefault();this.templateRole=null;this.contactSuggestions=[];this.name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){this.name=this.templateRole.full_name||"";this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!==""}};e.prototype.handleNameChange=function(e){var t;this.name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=a(e.target.value)};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({full_name:this.name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.name=t.name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("div",{class:"row"},n("label",{htmlFor:this.nameFieldId},"Name:"),n("input",{id:this.nameFieldId,name:this.nameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.name,placeholder:"Recipient Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleNameChange(t)}}),this.showSuggestions&&n("div",{class:"dropdown"},this.contactSuggestions.map((function(t){var o;return n("div",{key:(o=t.id)!==null&&o!==void 0?o:t.name,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.avatar?n("img",{alt:"Avatar",class:"avatar",src:t.avatar}):n("div",{class:"avatar",innerHTML:d}),n("div",{class:"details"},n("div",{class:"name"},t.name),t.email&&n("div",{class:"destination"},t.email),t.phone&&n("div",{class:"destination"},t.phone)))})))),n("div",{class:"row"},n("label",{htmlFor:this.emailFieldId},"Email:"),n("input",{id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),n("div",{class:"row"},n("label",{htmlFor:this.phoneFieldId},"Phone:"),n("input",{id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showMessage&&n("div",{class:"row"},n("label",{htmlFor:"verdocs-contact-picker-message"},"Message:"),n("input",{id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),n("div",{class:"buttons"},n("verdocs-toggle-button",{icon:r,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),n("verdocs-toggle-button",{icon:l,size:"small",active:this.delegator,onToggle:function(t){e.delegator=t.detail.active;e.showSuggestions=false}}),n("div",{class:"flex-fill"}),n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}());u.style=c;var g='@-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-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var p=e("verdocs_toggle_button",function(){function e(e){t(this,e);this.toggle=o(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return n(i,{class:"size-".concat(this.size)},this.icon?n("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):n("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}());p.style=g}}}));