@verdocs/web-sdk 1.10.5 → 1.10.6

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 (149) hide show
  1. package/dist/cjs/{Templates-a46d2fe8.js → Templates-a75b133d.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{templateStore-97e17e58.js → templateStore-81ad25a7.js} +1 -0
  4. package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
  5. package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +2 -2
  6. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-field-signature.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-preview.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-send.cjs.entry.js +3 -4
  19. package/dist/cjs/verdocs-template-attachments.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-template-create_2.cjs.entry.js +7 -4
  21. package/dist/cjs/verdocs-template-name.cjs.entry.js +2 -2
  22. package/dist/cjs/verdocs-template-properties.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-template-recipients.cjs.entry.js +2 -2
  24. package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -2
  25. package/dist/cjs/verdocs-template-role-properties_2.cjs.entry.js +2 -2
  26. package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
  27. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  28. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +6 -3
  29. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.css +1 -0
  30. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +6 -2
  31. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.stories.js +4 -28
  32. package/dist/collection/utils/templateStore.js +1 -0
  33. package/dist/components/templateStore.js +1 -0
  34. package/dist/components/verdocs-send.js +1 -2
  35. package/dist/components/verdocs-template-create2.js +7 -3
  36. package/dist/docs.json +1 -1
  37. package/dist/esm/{Templates-2522e194.js → Templates-7595bdbf.js} +1 -1
  38. package/dist/esm/loader.js +1 -1
  39. package/dist/esm/{templateStore-da902ad4.js → templateStore-fd4beaae.js} +1 -0
  40. package/dist/esm/verdocs-build.entry.js +2 -2
  41. package/dist/esm/verdocs-button-panel_3.entry.js +2 -2
  42. package/dist/esm/verdocs-field-attachment.entry.js +1 -1
  43. package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
  44. package/dist/esm/verdocs-field-date.entry.js +1 -1
  45. package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
  46. package/dist/esm/verdocs-field-initial.entry.js +1 -1
  47. package/dist/esm/verdocs-field-payment.entry.js +1 -1
  48. package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
  49. package/dist/esm/verdocs-field-signature.entry.js +1 -1
  50. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  51. package/dist/esm/verdocs-field-textbox.entry.js +1 -1
  52. package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
  53. package/dist/esm/verdocs-preview.entry.js +2 -2
  54. package/dist/esm/verdocs-send.entry.js +3 -4
  55. package/dist/esm/verdocs-template-attachments.entry.js +2 -2
  56. package/dist/esm/verdocs-template-create_2.entry.js +7 -4
  57. package/dist/esm/verdocs-template-name.entry.js +2 -2
  58. package/dist/esm/verdocs-template-properties.entry.js +1 -1
  59. package/dist/esm/verdocs-template-recipients.entry.js +2 -2
  60. package/dist/esm/verdocs-template-reminders.entry.js +2 -2
  61. package/dist/esm/verdocs-template-role-properties_2.entry.js +2 -2
  62. package/dist/esm/verdocs-template-visibility.entry.js +2 -2
  63. package/dist/esm/verdocs-web-sdk.js +1 -1
  64. package/dist/esm-es5/{Templates-2522e194.js → Templates-7595bdbf.js} +1 -1
  65. package/dist/esm-es5/loader.js +1 -1
  66. package/dist/esm-es5/{templateStore-da902ad4.js → templateStore-fd4beaae.js} +0 -0
  67. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  68. package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  73. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  77. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  78. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  79. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  82. package/dist/esm-es5/verdocs-template-attachments.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-template-properties.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-template-recipients.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-template-role-properties_2.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  91. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +1 -1
  92. package/dist/types/components/templates/verdocs-template-create/verdocs-template-create.d.ts +1 -0
  93. package/dist/types/components/templates/verdocs-template-create/verdocs-template-create.stories.d.ts +3 -6
  94. package/dist/verdocs-web-sdk/{p-8edafff8.entry.js → p-01117b44.entry.js} +1 -1
  95. package/dist/verdocs-web-sdk/{p-1aa8ed0f.entry.js → p-0e1f1b27.entry.js} +1 -1
  96. package/dist/verdocs-web-sdk/{p-1dbbf991.system.entry.js → p-0e5274d0.system.entry.js} +1 -1
  97. package/dist/verdocs-web-sdk/{p-8d65016c.system.entry.js → p-19f6e8c8.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/{p-74f703ae.entry.js → p-1b58f506.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/{p-ea9497e5.entry.js → p-2037252b.entry.js} +1 -1
  100. package/dist/verdocs-web-sdk/p-26bfe095.entry.js +1 -0
  101. package/dist/verdocs-web-sdk/{p-80f0cd72.system.entry.js → p-34efc869.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/{p-75921846.system.entry.js → p-36fd1c28.system.entry.js} +1 -1
  103. package/dist/verdocs-web-sdk/{p-cd49eb2b.system.entry.js → p-3a04acf4.system.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-99b80f74.js → p-3cb8a7f4.js} +0 -0
  105. package/dist/verdocs-web-sdk/{p-d7d096dc.system.entry.js → p-50892057.system.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-465288c0.system.entry.js → p-51a99eed.system.entry.js} +1 -1
  107. package/dist/verdocs-web-sdk/{p-2f1e01f3.entry.js → p-584e4fca.entry.js} +1 -1
  108. package/dist/verdocs-web-sdk/{p-677cf03e.system.js → p-5b62f239.system.js} +0 -0
  109. package/dist/verdocs-web-sdk/{p-67231081.system.entry.js → p-628aef1d.system.entry.js} +1 -1
  110. package/dist/verdocs-web-sdk/{p-57d14138.system.entry.js → p-6c2d3b0f.system.entry.js} +1 -1
  111. package/dist/verdocs-web-sdk/{p-f1a671d5.entry.js → p-6cb274e3.entry.js} +1 -1
  112. package/dist/verdocs-web-sdk/{p-b6e20078.system.js → p-7067adce.system.js} +1 -1
  113. package/dist/verdocs-web-sdk/{p-52c73272.entry.js → p-72f4b40b.entry.js} +1 -1
  114. package/dist/verdocs-web-sdk/{p-d48d5f49.entry.js → p-7417cdc7.entry.js} +1 -1
  115. package/dist/verdocs-web-sdk/{p-9eaf02d1.system.entry.js → p-875f9455.system.entry.js} +1 -1
  116. package/dist/verdocs-web-sdk/p-8c3d48c1.entry.js +1 -0
  117. package/dist/verdocs-web-sdk/{p-2a5021ab.entry.js → p-9345346d.entry.js} +1 -1
  118. package/dist/verdocs-web-sdk/{p-af4fd8da.system.entry.js → p-996008f6.system.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/{p-1d2eb3fb.system.entry.js → p-9f52748a.system.entry.js} +1 -1
  120. package/dist/verdocs-web-sdk/{p-6183a4e4.entry.js → p-a7c75902.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-bb90788b.entry.js → p-a802a598.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-dbdfbcd2.entry.js → p-abffbbaf.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-370903ee.entry.js → p-af657dd3.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-b79ab2a9.system.entry.js → p-b22a2c9a.system.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-477301b7.system.entry.js → p-b39df234.system.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/{p-48ac051a.system.entry.js → p-b40a50a8.system.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/{p-2ae4af9b.entry.js → p-c11a7c7e.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
  129. package/dist/verdocs-web-sdk/{p-757e73bc.system.entry.js → p-c86a40a3.system.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/{p-a62f9f22.system.entry.js → p-c9216df9.system.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-ad1da3a4.system.entry.js → p-ccaa35ac.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-a259853e.system.entry.js → p-cd4270a9.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/p-cf9883c7.system.entry.js +1 -0
  134. package/dist/verdocs-web-sdk/{p-3fd9305c.js → p-d1393a1a.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-29dd37a7.entry.js → p-d27a02b5.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-8fa14890.system.entry.js → p-d95b1215.system.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-33361647.entry.js → p-e1754b47.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-d8fd179b.system.entry.js → p-e179e3de.system.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-d176aad6.entry.js → p-e6f3735e.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-1d683b4f.entry.js → p-e845dc2c.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-6170a128.entry.js → p-ef4603fd.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-bbcfdcdb.system.entry.js → p-efa9bfa2.system.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-c84f9b23.entry.js → p-f2ae6ed5.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-79776f10.entry.js → p-f69cdc41.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  146. package/package.json +1 -1
  147. package/dist/verdocs-web-sdk/p-20a0588c.entry.js +0 -1
  148. package/dist/verdocs-web-sdk/p-489a657e.entry.js +0 -1
  149. package/dist/verdocs-web-sdk/p-c8133122.system.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as t,c as e,h as o,H as s}from"./p-ff1278ed.js";import{g as i}from"./p-6de76553.js";import{s as n}from"./p-99b80f74.js";import{g as r}from"./p-d6e07c20.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-880b619d.js";import"./p-21603661.js";import"./p-aa124212.js";const l=class{constructor(o){t(this,o),this.settingsChanged=e(this,"settingsChanged",7),this.field=null,this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.roleindex=0}async focusField(){this.el.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel(),n.updateCount++}render(){var t,e,l,d;const a=r(this.field);let c=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:a.disabled)&&void 0!==e&&e;const p=this.field.rgba||i(this.roleindex),h=(null==a?void 0:a.result)||"";return this.done?o(s,{class:{done:this.done}},h):o(s,{class:{required:null===(l=this.field)||void 0===l?void 0:l.required,disabled:c,done:this.done},style:{backgroundColor:p}},o("input",{type:"text",placeholder:null==a?void 0:a.placeholder,tabIndex:null==a?void 0:a.order,value:h,disabled:c,required:null===(d=this.field)||void 0===d?void 0:d.required,ref:t=>this.el=t}),this.editable&&o("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},o("h6",null,"Field Settings"),o("verdocs-template-field-properties",{templateId:n.templateId,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()}})))}};l.style='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{width:100%;height:100%;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);border:none;outline:none}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}';export{l as verdocs_field_textbox}
1
+ import{r as t,c as e,h as o,H as s}from"./p-ff1278ed.js";import{g as i}from"./p-6de76553.js";import{s as n}from"./p-3cb8a7f4.js";import{g as r}from"./p-d6e07c20.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-880b619d.js";import"./p-21603661.js";import"./p-aa124212.js";const l=class{constructor(o){t(this,o),this.settingsChanged=e(this,"settingsChanged",7),this.field=null,this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.roleindex=0}async focusField(){this.el.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel(),n.updateCount++}render(){var t,e,l,d;const a=r(this.field);let c=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:a.disabled)&&void 0!==e&&e;const p=this.field.rgba||i(this.roleindex),h=(null==a?void 0:a.result)||"";return this.done?o(s,{class:{done:this.done}},h):o(s,{class:{required:null===(l=this.field)||void 0===l?void 0:l.required,disabled:c,done:this.done},style:{backgroundColor:p}},o("input",{type:"text",placeholder:null==a?void 0:a.placeholder,tabIndex:null==a?void 0:a.order,value:h,disabled:c,required:null===(d=this.field)||void 0===d?void 0:d.required,ref:t=>this.el=t}),this.editable&&o("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},o("h6",null,"Field Settings"),o("verdocs-template-field-properties",{templateId:n.templateId,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()}})))}};l.style='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{width:100%;height:100%;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);border:none;outline:none}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}';export{l as verdocs_field_textbox}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function l(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):s(e.value).then(r,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=r[0]&2?s["return"]:r[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,r[1])).done)return n;if(s=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];s=0}finally{o=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-97329951.system.js","./p-69912cbf.system.js","./p-261dcea1.system.js","./p-677cf03e.system.js","./p-b6e20078.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-0f6da8c7.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,i,o,s,n,r,l,a,c;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H},function(e){n=e.u},function(e){r=e.V},function(e){l=e.s},function(e){a=e.l},function(e){c=e.S},function(){},function(){},function(){}],execute:function(){var p='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var u=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.endpoint=r.getDefault();this.templateId="";this.dirty=false;this.loading=true;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();return[4,a(this.endpoint,this.templateId)];case 1:s.sent();this.loading=false;this.personal=l.template.is_personal;this.public=l.template.is_public;this.dirty=false;return[3,3];case 2:o=s.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",o);this.loading=false;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.personal=l.template.is_personal;this.public=l.template.is_public;this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:e.stopPropagation();return[4,n(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:i.sent();l.template.is_personal=this.personal;l.template.is_public=this.public;this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!l.template){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());u.style=p}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function l(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):s(e.value).then(r,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=r[0]&2?s["return"]:r[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,r[1])).done)return n;if(s=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];s=0}finally{o=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-97329951.system.js","./p-69912cbf.system.js","./p-261dcea1.system.js","./p-5b62f239.system.js","./p-7067adce.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-0f6da8c7.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,i,o,s,n,r,l,a,c;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H},function(e){n=e.u},function(e){r=e.V},function(e){l=e.s},function(e){a=e.l},function(e){c=e.S},function(){},function(){},function(){}],execute:function(){var p='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var u=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.endpoint=r.getDefault();this.templateId="";this.dirty=false;this.loading=true;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();return[4,a(this.endpoint,this.templateId)];case 1:s.sent();this.loading=false;this.personal=l.template.is_personal;this.public=l.template.is_public;this.dirty=false;return[3,3];case 2:o=s.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",o);this.loading=false;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new c(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.personal=l.template.is_personal;this.public=l.template.is_public;this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:e.stopPropagation();return[4,n(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:i.sent();l.template.is_personal=this.personal;l.template.is_public=this.public;this.dirty=false;(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!l.template){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());u.style=p}}}));
@@ -1 +1 @@
1
- import{r as i,c as e,h as t,H as s}from"./p-ff1278ed.js";import{u as o}from"./p-b28ef4bb.js";import{V as l}from"./p-2d4712ea.js";import{s as a}from"./p-99b80f74.js";import{l as r}from"./p-3fd9305c.js";import{S as n}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";const c=class{constructor(t){i(this,t),this.close=e(this,"close",7),this.sdkError=e(this,"sdkError",7),this.endpoint=l.getDefault(),this.templateId="",this.dirty=!1,this.loading=!0,this.personal=!1,this.public=!1}async componentWillLoad(){var i,e,t;try{this.endpoint.loadSession(),await r(this.endpoint,this.templateId),this.loading=!1,this.personal=a.template.is_personal,this.public=a.template.is_public,this.dirty=!1}catch(s){console.log("[TEMPLATE VISIBILITY] Error loading template",s),this.loading=!1,null===(i=this.sdkError)||void 0===i||i.emit(new n(s.message,null===(e=s.response)||void 0===e?void 0:e.status,null===(t=s.response)||void 0===t?void 0:t.data))}}handleCancel(i){var e;i.stopPropagation(),this.personal=a.template.is_personal,this.public=a.template.is_public,this.dirty=!1,null===(e=this.close)||void 0===e||e.emit()}async handleSave(i){var e;i.stopPropagation(),await o(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),a.template.is_personal=this.personal,a.template.is_public=this.public,this.dirty=!1,null===(e=this.close)||void 0===e||e.emit()}render(){return this.endpoint.session?this.endpoint.session&&a.template?t(s,null,t("form",{onSubmit:i=>i.preventDefault(),onClick:i=>i.stopPropagation(),autocomplete:"off"},t("h5",null,"Visibility"),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-shared"},"Shared"),t("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:i=>{this.personal=!i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-public"},"Public"),t("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:i=>{this.public=i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),t("div",{class:"buttons"},t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:i=>this.handleCancel(i)}),t("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:i=>this.handleSave(i)})))):t(s,{class:"empty"}):t(s,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};c.style='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{c as verdocs_template_visibility}
1
+ import{r as i,c as e,h as t,H as s}from"./p-ff1278ed.js";import{u as o}from"./p-b28ef4bb.js";import{V as l}from"./p-2d4712ea.js";import{s as a}from"./p-3cb8a7f4.js";import{l as r}from"./p-d1393a1a.js";import{S as n}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";const c=class{constructor(t){i(this,t),this.close=e(this,"close",7),this.sdkError=e(this,"sdkError",7),this.endpoint=l.getDefault(),this.templateId="",this.dirty=!1,this.loading=!0,this.personal=!1,this.public=!1}async componentWillLoad(){var i,e,t;try{this.endpoint.loadSession(),await r(this.endpoint,this.templateId),this.loading=!1,this.personal=a.template.is_personal,this.public=a.template.is_public,this.dirty=!1}catch(s){console.log("[TEMPLATE VISIBILITY] Error loading template",s),this.loading=!1,null===(i=this.sdkError)||void 0===i||i.emit(new n(s.message,null===(e=s.response)||void 0===e?void 0:e.status,null===(t=s.response)||void 0===t?void 0:t.data))}}handleCancel(i){var e;i.stopPropagation(),this.personal=a.template.is_personal,this.public=a.template.is_public,this.dirty=!1,null===(e=this.close)||void 0===e||e.emit()}async handleSave(i){var e;i.stopPropagation(),await o(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public}),a.template.is_personal=this.personal,a.template.is_public=this.public,this.dirty=!1,null===(e=this.close)||void 0===e||e.emit()}render(){return this.endpoint.session?this.endpoint.session&&a.template?t(s,null,t("form",{onSubmit:i=>i.preventDefault(),onClick:i=>i.stopPropagation(),autocomplete:"off"},t("h5",null,"Visibility"),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-shared"},"Shared"),t("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:i=>{this.personal=!i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),t("div",{class:"input-row"},t("label",{htmlFor:"verdocs-is-public"},"Public"),t("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:i=>{this.public=i.target.checked,this.dirty=!0}})),t("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),t("div",{class:"buttons"},t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:i=>this.handleCancel(i)}),t("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:i=>this.handleSave(i)})))):t(s,{class:"empty"}):t(s,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};c.style='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';export{c as verdocs_template_visibility}
@@ -1 +1 @@
1
- import{r as e,c as i,h as t,F as o,H as s,a as r}from"./p-ff1278ed.js";import{i as a}from"./p-4f12a8a7.js";import{u as l,c as n}from"./p-ffe60abd.js";import{V as p,T as d}from"./p-2d4712ea.js";import{g as c}from"./p-6de76553.js";import{s as m}from"./p-99b80f74.js";import{l as f}from"./p-3fd9305c.js";import{a as h}from"./p-d6e07c20.js";import{S as x}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";import"./p-880b619d.js";import"./p-aa124212.js";const v={[d.EVERYONE]:"Everyone",[d.EVERYONE_AS_CREATOR]:"Everyone as Me",[d.ORGANIZATION_MEMBER]:"Organization member",[d.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[d.CREATOR]:"Me"},g='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',b=class{constructor(t){e(this,t),this.cancel=i(this,"cancel",7),this.sdkError=i(this,"sdkError",7),this.sequences=[],this.endpoint=p.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.forceRerender=1}async componentWillLoad(){var e,i,t,o,s,r;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[RECIPIENTS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[RECIPIENTS] Unable to start builder session, must be authenticated");try{console.log(`[RECIPIENTS] Loading template ${this.templateId}`,this.endpoint.session),await f(this.endpoint,this.templateId)}catch(o){console.log("[RECIPIENTS] Error loading template",o),null===(e=this.sdkError)||void 0===e||e.emit(new x(o.message,null===(i=o.response)||void 0===i?void 0:i.status,null===(t=o.response)||void 0===t?void 0:t.data))}this.sortTemplateRoles(),this.renumberTemplateRoles()}catch(e){console.log("[FIELDS] Error with preview session",e),null===(o=this.sdkError)||void 0===o||o.emit(new x(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){a.dynamicDrop(!0),a(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const i=+(e.target.getAttribute("posX")||0),t=+(e.target.getAttribute("posY")||0),o=e.dx+i,s=e.dy+t;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),a(".dropzone").dropzone({overlap:.05,ondrop:function(e){e.target.classList.remove("active");const i=e.relatedTarget.dataset.rolename,t=+e.target.dataset.sequence,o=+e.target.dataset.order,s=m.template.roles.find((e=>e.name===i));s&&(s.sequence=t,s.order=o,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(m.template.roles.map((e=>l(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>console.log("[RECIPIENTS] Updated roles"))).catch((e=>console.log("[RECIPIENTS] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(e){var i;e.stopPropagation(),null===(i=this.cancel)||void 0===i||i.emit()}handleSubmit(e){e.stopPropagation()}sortTemplateRoles(){m.template.roles.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}extractSequenceNumbers(){this.sequences=[],m.template.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,i)=>e-i)),this.sequences.forEach(((i,t)=>{m.template.roles.filter((e=>e.sequence===i)).forEach(((i,o)=>{e.includes(i.name)||(i.sequence=t+1,i.order=o+1,e.push(i.name))}))})),this.extractSequenceNumbers()}handleAddRole(e,i){e.stopPropagation();const t=m.template.roles.filter((e=>e.sequence===i)).length+1;let o="",s=m.template.roles.length;do{s++,o=`Recipient ${s}`}while(!o||m.template.roles.some((e=>e.name===o)));console.log("Will create",o,i,t),n(this.endpoint,this.templateId,{template_id:this.templateId,name:o,full_name:"",email:"",phone:"",sequence:i,order:t,type:"signer",delegator:!1}).then((e=>{console.log("Created role",e),m.template.roles.push(e),this.renumberTemplateRoles(),this.forceRerender++})).catch((e=>{console.log("Error creating role",e)}))}render(){const e=m.template.roles.map((e=>e.name));return t(s,null,t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":this.forceRerender},t("h5",null,"Recipients"),t("div",{class:"participants"},t("div",{class:"left-line"}),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"sender"},t("span",{class:"label"},"Sender:")," ",v[m.template.sender]," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),t("div",{class:"row add-sequence","data-sequence":0},t("div",{class:"icon",innerHTML:u}),t("div",{class:"row-recipients"},t("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((i=>t(o,null,t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"dropzone","data-order":.5,"data-sequence":i}),m.template.roles.filter((e=>e.sequence===i)).map((s=>t(o,null,t("div",{class:"recipient",style:{backgroundColor:c(h(e,s.name))},"data-rolename":s.name},t("span",{class:"type-icon",innerHTML:"signer"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>':"cc"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>'}),s.name," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingRoleDialog=s.name,"aria-role":"button"})),t("div",{class:"dropzone","data-order":s.order+.5,"data-sequence":i})))),t("button",{class:"add-role",innerHTML:u,onClick:e=>this.handleAddRole(e,i)}))),t("div",{class:"row add-sequence","data-sequence":i},t("div",{class:"row-recipients"},t("div",{class:"icon",innerHTML:u}),t("div",{class:"dropzone","data-sequence":i+1,"data-order":1},"Add Step")))))),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"complete"},"Document Complete")))),t("div",{class:"buttons"},t("div",{class:"flex-fill"}),t("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),t("verdocs-button",{label:"OK",size:"small",onClick:e=>this.handleSubmit(e)}))),this.showingRoleDialog&&t("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null,this.forceRerender++},onDelete:e=>{console.log("deleted",e.detail),this.renumberTemplateRoles(),this.showingRoleDialog=null,this.forceRerender++}}),this.showingSenderDialog&&t("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return r(this)}};b.style='verdocs-template-recipients{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .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-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}';export{b as verdocs_template_recipients}
1
+ import{r as e,c as i,h as t,F as o,H as s,a as r}from"./p-ff1278ed.js";import{i as a}from"./p-4f12a8a7.js";import{u as l,c as n}from"./p-ffe60abd.js";import{V as p,T as d}from"./p-2d4712ea.js";import{g as c}from"./p-6de76553.js";import{s as m}from"./p-3cb8a7f4.js";import{l as f}from"./p-d1393a1a.js";import{a as h}from"./p-d6e07c20.js";import{S as x}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";import"./p-880b619d.js";import"./p-aa124212.js";const v={[d.EVERYONE]:"Everyone",[d.EVERYONE_AS_CREATOR]:"Everyone as Me",[d.ORGANIZATION_MEMBER]:"Organization member",[d.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[d.CREATOR]:"Me"},g='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',b=class{constructor(t){e(this,t),this.cancel=i(this,"cancel",7),this.sdkError=i(this,"sdkError",7),this.sequences=[],this.endpoint=p.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.forceRerender=1}async componentWillLoad(){var e,i,t,o,s,r;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[RECIPIENTS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[RECIPIENTS] Unable to start builder session, must be authenticated");try{console.log(`[RECIPIENTS] Loading template ${this.templateId}`,this.endpoint.session),await f(this.endpoint,this.templateId)}catch(o){console.log("[RECIPIENTS] Error loading template",o),null===(e=this.sdkError)||void 0===e||e.emit(new x(o.message,null===(i=o.response)||void 0===i?void 0:i.status,null===(t=o.response)||void 0===t?void 0:t.data))}this.sortTemplateRoles(),this.renumberTemplateRoles()}catch(e){console.log("[FIELDS] Error with preview session",e),null===(o=this.sdkError)||void 0===o||o.emit(new x(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){a.dynamicDrop(!0),a(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const i=+(e.target.getAttribute("posX")||0),t=+(e.target.getAttribute("posY")||0),o=e.dx+i,s=e.dy+t;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),a(".dropzone").dropzone({overlap:.05,ondrop:function(e){e.target.classList.remove("active");const i=e.relatedTarget.dataset.rolename,t=+e.target.dataset.sequence,o=+e.target.dataset.order,s=m.template.roles.find((e=>e.name===i));s&&(s.sequence=t,s.order=o,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(m.template.roles.map((e=>l(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>console.log("[RECIPIENTS] Updated roles"))).catch((e=>console.log("[RECIPIENTS] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(e){var i;e.stopPropagation(),null===(i=this.cancel)||void 0===i||i.emit()}handleSubmit(e){e.stopPropagation()}sortTemplateRoles(){m.template.roles.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}extractSequenceNumbers(){this.sequences=[],m.template.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,i)=>e-i)),this.sequences.forEach(((i,t)=>{m.template.roles.filter((e=>e.sequence===i)).forEach(((i,o)=>{e.includes(i.name)||(i.sequence=t+1,i.order=o+1,e.push(i.name))}))})),this.extractSequenceNumbers()}handleAddRole(e,i){e.stopPropagation();const t=m.template.roles.filter((e=>e.sequence===i)).length+1;let o="",s=m.template.roles.length;do{s++,o=`Recipient ${s}`}while(!o||m.template.roles.some((e=>e.name===o)));console.log("Will create",o,i,t),n(this.endpoint,this.templateId,{template_id:this.templateId,name:o,full_name:"",email:"",phone:"",sequence:i,order:t,type:"signer",delegator:!1}).then((e=>{console.log("Created role",e),m.template.roles.push(e),this.renumberTemplateRoles(),this.forceRerender++})).catch((e=>{console.log("Error creating role",e)}))}render(){const e=m.template.roles.map((e=>e.name));return t(s,null,t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":this.forceRerender},t("h5",null,"Recipients"),t("div",{class:"participants"},t("div",{class:"left-line"}),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"sender"},t("span",{class:"label"},"Sender:")," ",v[m.template.sender]," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),t("div",{class:"row add-sequence","data-sequence":0},t("div",{class:"icon",innerHTML:u}),t("div",{class:"row-recipients"},t("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((i=>t(o,null,t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"dropzone","data-order":.5,"data-sequence":i}),m.template.roles.filter((e=>e.sequence===i)).map((s=>t(o,null,t("div",{class:"recipient",style:{backgroundColor:c(h(e,s.name))},"data-rolename":s.name},t("span",{class:"type-icon",innerHTML:"signer"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>':"cc"===s.type?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>'}),s.name," ",t("div",{class:"settings-button",innerHTML:g,onClick:()=>this.showingRoleDialog=s.name,"aria-role":"button"})),t("div",{class:"dropzone","data-order":s.order+.5,"data-sequence":i})))),t("button",{class:"add-role",innerHTML:u,onClick:e=>this.handleAddRole(e,i)}))),t("div",{class:"row add-sequence","data-sequence":i},t("div",{class:"row-recipients"},t("div",{class:"icon",innerHTML:u}),t("div",{class:"dropzone","data-sequence":i+1,"data-order":1},"Add Step")))))),t("div",{class:"row"},t("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),t("div",{class:"row-recipients"},t("div",{class:"complete"},"Document Complete")))),t("div",{class:"buttons"},t("div",{class:"flex-fill"}),t("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),t("verdocs-button",{label:"OK",size:"small",onClick:e=>this.handleSubmit(e)}))),this.showingRoleDialog&&t("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null,this.forceRerender++},onDelete:e=>{console.log("deleted",e.detail),this.renumberTemplateRoles(),this.showingRoleDialog=null,this.forceRerender++}}),this.showingSenderDialog&&t("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return r(this)}};b.style='verdocs-template-recipients{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-recipients>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-recipients>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-recipients>form .participants{position:relative}verdocs-template-recipients>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-recipients>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-recipients>form .row .row-recipients{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-recipients>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-recipients>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 5px 0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-recipients>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-recipients>form .row .settings-button{margin:4px 0 0 9px;cursor:pointer}verdocs-template-recipients>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:1px solid #aeb4bf}verdocs-template-recipients>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:4px 12px 0 0}verdocs-template-recipients>form .row .recipient.dragging{position:absolute}verdocs-template-recipients>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-recipients>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-recipients>form .row .dropzone svg{fill:#cccccc}verdocs-template-recipients>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-recipients>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-recipients>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-recipients>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-recipients>form input:focus{outline:none}verdocs-template-recipients .row.add-sequence{display:none}verdocs-template-recipients .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-recipients .add-role:hover{opacity:1}verdocs-template-recipients .add-role svg{width:32px;height:32px}verdocs-template-recipients.dragging .add-role{display:none}verdocs-template-recipients.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-recipients.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-recipients.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-recipients .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-template-recipients ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-moz-placeholder{color:#aaaaaa}verdocs-template-recipients :-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-recipients ::placeholder{color:#aaaaaa}';export{b as verdocs_template_recipients}
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-ff1278ed.js";(()=>{const t=import.meta.url,d={};return""!==t&&(d.resourcesUrl=new URL(".",t).href),e(d)})().then((e=>t([["p-2ae4af9b",[[0,"verdocs-field-initial",{field:[16],disabled:[4],initials:[1],editable:[4],moveable:[4],done:[4],roleindex:[2],tempInitials:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-74f703ae",[[0,"verdocs-field-signature",{field:[16],name:[1],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],tempSignature:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-2f1e01f3",[[0,"verdocs-build",{endpoint:[16],templateId:[1,"template-id"],step:[32],pdfUrl:[32],template:[32]}]]],["p-ea9497e5",[[0,"verdocs-field-checkbox",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-2a5021ab",[[0,"verdocs-field-date",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],containerId:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-1d683b4f",[[0,"verdocs-field-radio-button",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-d176aad6",[[0,"verdocs-field-textarea",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-6170a128",[[0,"verdocs-field-textbox",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-dbdfbcd2",[[0,"verdocs-field-timestamp",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-79776f10",[[0,"verdocs-template-recipients",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],showingSenderDialog:[32],sender:[32],forceRerender:[32]}]]],["p-25256749",[[0,"verdocs-sign",{envelopeId:[1,"envelope-id"],roleId:[1,"role-id"],inviteCode:[1,"invite-code"],recipient:[32],signerToken:[32],hasSignature:[32],nextButtonLabel:[32],nextSubmits:[32],errorMessage:[32],focusedField:[32],isDone:[32],showDone:[32],finishLater:[32],showFinishLater:[32],agreed:[32],documentsSingularPlural:[32]}]]],["p-29dd37a7",[[0,"verdocs-template-properties",{endpoint:[16],templateId:[1,"template-id"],template:[32],name:[32],visibility:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32]}]]],["p-6183a4e4",[[0,"verdocs-template-reminders",{endpoint:[16],templateId:[1,"template-id"],showPlanBlocker:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32],dirty:[32],loading:[32]}]]],["p-37a493a6",[[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["p-1aa8ed0f",[[0,"verdocs-template-name",{endpoint:[16],templateId:[1,"template-id"],name:[32],dirty:[32],loading:[32]}]]],["p-34db97b7",[[0,"verdocs-search",{endpoint:[16]}]]],["p-489a657e",[[0,"verdocs-send",{endpoint:[16],templateId:[1,"template-id"],containerId:[32],rolesAtLevel:[32],showPickerForId:[32],sessionContacts:[32],rolesCompleted:[32],reset:[64]}]]],["p-c84f9b23",[[0,"verdocs-template-visibility",{endpoint:[16],templateId:[1,"template-id"],dirty:[32],loading:[32],personal:[32],public:[32]}]]],["p-fedfe011",[[0,"verdocs-upload-dialog",{draggingOver:[32],decodedFiles:[32]}]]],["p-370903ee",[[0,"verdocs-field-attachment",{field:[16],disabled:[4],roleIndex:[2,"role-index"],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-bb90788b",[[0,"verdocs-preview",{endpoint:[16],templateId:[1,"template-id"]}]]],["p-bda7353b",[[0,"verdocs-envelope-sidebar",{endpoint:[16],envelopeId:[1,"envelope-id"],activeTab:[32],panelOpen:[32]}]]],["p-b365612a",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],response:[32]}]]],["p-d48d5f49",[[0,"verdocs-template-attachments",{endpoint:[16],templateId:[1,"template-id"],loading:[32]}]]],["p-33361647",[[0,"verdocs-field-dropdown",{field:[16],disabled:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-52c73272",[[0,"verdocs-field-payment",{field:[16],disabled:[4],fields:[16],pageNum:[2,"page-num"],roleName:[1,"role-name"],fieldId:[1,"field-id"],recipients:[8],selectedRoleName:[1,"selected-role-name"],pdfPages:[16],currentSignature:[1,"current-signature"],currentSignatureId:[1,"current-signature-id"],currentInitial:[1,"current-initial"],currentInitialId:[1,"current-initial-id"],focused:[4],signed:[4],roleindex:[2],preparedMessage:[32],signatureUrl:[32],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-2783520a",[[0,"verdocs-organization-card",{organization:[16]}]]],["p-dc8aa1f0",[[0,"verdocs-search-tabs",{selected:[32]}]]],["p-9f6b4f8c",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],envelope:[16],isOpen:[32],recipientStatusIcons:[32],containerId:[32]}]]],["p-896f1614",[[0,"verdocs-template-card",{template:[16]}]]],["p-7efc60cc",[[0,"verdocs-template-tags",{tags:[16]}]]],["p-2b86f106",[[0,"verdocs-toggle",{options:[16],theme:[1],selectedOption:[32]}]]],["p-40dfb545",[[0,"verdocs-initial-dialog",{initials:[1],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["p-d36ae684",[[0,"verdocs-signature-dialog",{name:[1],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["p-f81a559c",[[0,"verdocs-view",{endpoint:[16],envelopeId:[1,"envelope-id"]}]]],["p-b859bbb4",[[0,"verdocs-toggle-button",{active:[4],icon:[1],label:[1],size:[1],_active:[32]}]]],["p-fc208e71",[[0,"verdocs-contact-picker",{endpoint:[16],templateRole:[16],contactSuggestions:[16],name:[32],email:[32],phone:[32],message:[32],showSuggestions:[32],showMessage:[32],delegator:[32]}]]],["p-7d909ce4",[[0,"verdocs-radio-button",{checked:[4],name:[1],value:[1],disabled:[4]}]]],["p-fba99ad6",[[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["p-8edafff8",[[0,"verdocs-template-role-properties",{endpoint:[16],templateId:[1,"template-id"],roleName:[1,"role-name"],sender:[1],dirty:[32],saving:[32],name:[32],type:[32],fullName:[32],email:[32],phone:[32],allowDelegation:[32]}],[0,"verdocs-template-sender",{endpoint:[16],templateId:[1,"template-id"],sender:[1],saving:[32]}]]],["p-d946b1b6",[[0,"verdocs-floating-menu",{options:[16]}],[0,"verdocs-toolbar-icon",{text:[1],icon:[1],placement:[1],containerId:[32]}]]],["p-20a0588c",[[0,"verdocs-template-fields",{endpoint:[16],templateId:[1,"template-id"],placing:[32],selectedRoleName:[32]}],[0,"verdocs-template-create",{endpoint:[16],file:[32]}]]],["p-d250b3b4",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],showCancel:[4,"show-cancel"]}]]],["p-205027db",[[0,"verdocs-quick-functions",{endpoint:[16]}],[0,"verdocs-search-activity",{endpoint:[16],type:[1],options:[8],emptyMessage:[32],authFailure:[32],title:[32],recent:[32],saved:[32],starred:[32]}],[0,"verdocs-search-box",{endpoint:[16],placeholder:[1],type:[1],query:[1],grabsFocus:[4,"grabs-focus"],focusField:[64]}]]],["p-0eb992eb",[[0,"verdocs-dropdown",{options:[16],open:[32]}]]],["p-b981d415",[[0,"verdocs-document-page",{pageImageUri:[1,"page-image-uri"],pageNumber:[2,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32]}],[0,"verdocs-loader"]]],["p-587f4405",[[0,"verdocs-checkbox",{checked:[4],name:[1],label:[1],value:[1],theme:[1],disabled:[4]}],[0,"verdocs-component-error",{message:[1]}],[0,"verdocs-text-input",{value:[1],label:[1],placeholder:[1],autocomplete:[1],helpText:[1,"help-text"],type:[1],disabled:[4]}],[0,"verdocs-help-icon",{text:[1],containerId:[32]}]]],["p-f1a671d5",[[0,"verdocs-template-field-properties",{endpoint:[16],templateId:[1,"template-id"],fieldName:[1,"field-name"],dirty:[32],loading:[32],type:[32],name:[32],roleName:[32],required:[32],placeholder:[32],defaultValue:[32]}],[4,"verdocs-button-panel",{icon:[1],showPanel:[64],hidePanel:[64],toggle:[64]}],[0,"verdocs-select-input",{value:[1],label:[1],options:[16],disabled:[4]}]]]],e)));
1
+ import{p as e,b as t}from"./p-ff1278ed.js";(()=>{const t=import.meta.url,d={};return""!==t&&(d.resourcesUrl=new URL(".",t).href),e(d)})().then((e=>t([["p-c11a7c7e",[[0,"verdocs-field-initial",{field:[16],disabled:[4],initials:[1],editable:[4],moveable:[4],done:[4],roleindex:[2],tempInitials:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-1b58f506",[[0,"verdocs-field-signature",{field:[16],name:[1],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],tempSignature:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-584e4fca",[[0,"verdocs-build",{endpoint:[16],templateId:[1,"template-id"],step:[32],pdfUrl:[32],template:[32]}]]],["p-2037252b",[[0,"verdocs-field-checkbox",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-9345346d",[[0,"verdocs-field-date",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],containerId:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-e845dc2c",[[0,"verdocs-field-radio-button",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-e6f3735e",[[0,"verdocs-field-textarea",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-ef4603fd",[[0,"verdocs-field-textbox",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-abffbbaf",[[0,"verdocs-field-timestamp",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-f69cdc41",[[0,"verdocs-template-recipients",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],showingSenderDialog:[32],sender:[32],forceRerender:[32]}]]],["p-25256749",[[0,"verdocs-sign",{envelopeId:[1,"envelope-id"],roleId:[1,"role-id"],inviteCode:[1,"invite-code"],recipient:[32],signerToken:[32],hasSignature:[32],nextButtonLabel:[32],nextSubmits:[32],errorMessage:[32],focusedField:[32],isDone:[32],showDone:[32],finishLater:[32],showFinishLater:[32],agreed:[32],documentsSingularPlural:[32]}]]],["p-d27a02b5",[[0,"verdocs-template-properties",{endpoint:[16],templateId:[1,"template-id"],template:[32],name:[32],visibility:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32]}]]],["p-a7c75902",[[0,"verdocs-template-reminders",{endpoint:[16],templateId:[1,"template-id"],showPlanBlocker:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32],dirty:[32],loading:[32]}]]],["p-37a493a6",[[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["p-0e1f1b27",[[0,"verdocs-template-name",{endpoint:[16],templateId:[1,"template-id"],name:[32],dirty:[32],loading:[32]}]]],["p-34db97b7",[[0,"verdocs-search",{endpoint:[16]}]]],["p-26bfe095",[[0,"verdocs-send",{endpoint:[16],templateId:[1,"template-id"],containerId:[32],rolesAtLevel:[32],showPickerForId:[32],sessionContacts:[32],rolesCompleted:[32],reset:[64]}]]],["p-f2ae6ed5",[[0,"verdocs-template-visibility",{endpoint:[16],templateId:[1,"template-id"],dirty:[32],loading:[32],personal:[32],public:[32]}]]],["p-fedfe011",[[0,"verdocs-upload-dialog",{draggingOver:[32],decodedFiles:[32]}]]],["p-af657dd3",[[0,"verdocs-field-attachment",{field:[16],disabled:[4],roleIndex:[2,"role-index"],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-a802a598",[[0,"verdocs-preview",{endpoint:[16],templateId:[1,"template-id"]}]]],["p-bda7353b",[[0,"verdocs-envelope-sidebar",{endpoint:[16],envelopeId:[1,"envelope-id"],activeTab:[32],panelOpen:[32]}]]],["p-b365612a",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],response:[32]}]]],["p-7417cdc7",[[0,"verdocs-template-attachments",{endpoint:[16],templateId:[1,"template-id"],loading:[32]}]]],["p-e1754b47",[[0,"verdocs-field-dropdown",{field:[16],disabled:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-72f4b40b",[[0,"verdocs-field-payment",{field:[16],disabled:[4],fields:[16],pageNum:[2,"page-num"],roleName:[1,"role-name"],fieldId:[1,"field-id"],recipients:[8],selectedRoleName:[1,"selected-role-name"],pdfPages:[16],currentSignature:[1,"current-signature"],currentSignatureId:[1,"current-signature-id"],currentInitial:[1,"current-initial"],currentInitialId:[1,"current-initial-id"],focused:[4],signed:[4],roleindex:[2],preparedMessage:[32],signatureUrl:[32],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-2783520a",[[0,"verdocs-organization-card",{organization:[16]}]]],["p-dc8aa1f0",[[0,"verdocs-search-tabs",{selected:[32]}]]],["p-9f6b4f8c",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],envelope:[16],isOpen:[32],recipientStatusIcons:[32],containerId:[32]}]]],["p-896f1614",[[0,"verdocs-template-card",{template:[16]}]]],["p-7efc60cc",[[0,"verdocs-template-tags",{tags:[16]}]]],["p-2b86f106",[[0,"verdocs-toggle",{options:[16],theme:[1],selectedOption:[32]}]]],["p-40dfb545",[[0,"verdocs-initial-dialog",{initials:[1],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["p-d36ae684",[[0,"verdocs-signature-dialog",{name:[1],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["p-f81a559c",[[0,"verdocs-view",{endpoint:[16],envelopeId:[1,"envelope-id"]}]]],["p-b859bbb4",[[0,"verdocs-toggle-button",{active:[4],icon:[1],label:[1],size:[1],_active:[32]}]]],["p-fc208e71",[[0,"verdocs-contact-picker",{endpoint:[16],templateRole:[16],contactSuggestions:[16],name:[32],email:[32],phone:[32],message:[32],showSuggestions:[32],showMessage:[32],delegator:[32]}]]],["p-7d909ce4",[[0,"verdocs-radio-button",{checked:[4],name:[1],value:[1],disabled:[4]}]]],["p-fba99ad6",[[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["p-01117b44",[[0,"verdocs-template-role-properties",{endpoint:[16],templateId:[1,"template-id"],roleName:[1,"role-name"],sender:[1],dirty:[32],saving:[32],name:[32],type:[32],fullName:[32],email:[32],phone:[32],allowDelegation:[32]}],[0,"verdocs-template-sender",{endpoint:[16],templateId:[1,"template-id"],sender:[1],saving:[32]}]]],["p-d946b1b6",[[0,"verdocs-floating-menu",{options:[16]}],[0,"verdocs-toolbar-icon",{text:[1],icon:[1],placement:[1],containerId:[32]}]]],["p-8c3d48c1",[[0,"verdocs-template-fields",{endpoint:[16],templateId:[1,"template-id"],placing:[32],selectedRoleName:[32]}],[0,"verdocs-template-create",{endpoint:[16],file:[32],creating:[32]}]]],["p-d250b3b4",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],showCancel:[4,"show-cancel"]}]]],["p-205027db",[[0,"verdocs-quick-functions",{endpoint:[16]}],[0,"verdocs-search-activity",{endpoint:[16],type:[1],options:[8],emptyMessage:[32],authFailure:[32],title:[32],recent:[32],saved:[32],starred:[32]}],[0,"verdocs-search-box",{endpoint:[16],placeholder:[1],type:[1],query:[1],grabsFocus:[4,"grabs-focus"],focusField:[64]}]]],["p-0eb992eb",[[0,"verdocs-dropdown",{options:[16],open:[32]}]]],["p-b981d415",[[0,"verdocs-document-page",{pageImageUri:[1,"page-image-uri"],pageNumber:[2,"page-number"],virtualWidth:[2,"virtual-width"],virtualHeight:[1026,"virtual-height"],layers:[16],containerId:[32],renderedWidth:[32],renderedHeight:[32],naturalWidth:[32],naturalHeight:[32],aspectRatio:[32],skipFirstNotification:[32]}],[0,"verdocs-loader"]]],["p-587f4405",[[0,"verdocs-checkbox",{checked:[4],name:[1],label:[1],value:[1],theme:[1],disabled:[4]}],[0,"verdocs-component-error",{message:[1]}],[0,"verdocs-text-input",{value:[1],label:[1],placeholder:[1],autocomplete:[1],helpText:[1,"help-text"],type:[1],disabled:[4]}],[0,"verdocs-help-icon",{text:[1],containerId:[32]}]]],["p-6cb274e3",[[0,"verdocs-template-field-properties",{endpoint:[16],templateId:[1,"template-id"],fieldName:[1,"field-name"],dirty:[32],loading:[32],type:[32],name:[32],roleName:[32],required:[32],placeholder:[32],defaultValue:[32]}],[4,"verdocs-button-panel",{icon:[1],showPanel:[64],hidePanel:[64],toggle:[64]}],[0,"verdocs-select-input",{value:[1],label:[1],options:[16],disabled:[4]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdocs/web-sdk",
3
- "version": "1.10.5",
3
+ "version": "1.10.6",
4
4
  "private": false,
5
5
  "description": "Verdocs Web SDK",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i,H as s}from"./p-ff1278ed.js";import{c as o,g as a}from"./p-b28ef4bb.js";import{V as l}from"./p-2d4712ea.js";import{S as r}from"./p-7a1b2643.js";import{i as n}from"./p-4f12a8a7.js";import{u as d,c as h}from"./p-feb442b1.js";import{a as p,r as m,c,d as g,e as v}from"./p-d6e07c20.js";import{s as u}from"./p-99b80f74.js";import{l as x}from"./p-3fd9305c.js";import"./p-21603661.js";import"./p-880b619d.js";import"./p-aa124212.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";const w=class{constructor(i){t(this,i),this.cancel=e(this,"cancel",7),this.next=e(this,"next",7),this.sdkError=e(this,"sdkError",7),this.endpoint=l.getDefault(),this.file=void 0}componentWillLoad(){this.endpoint.loadSession()}handleFileChanged(t){var e;console.log("files",t.target.files),this.file=(null===(e=t.target.files)||void 0===e?void 0:e[0])||null,console.log("Selected file",this.file)}handleUpload(t){t.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(t){var e;t.stopPropagation(),null===(e=this.cancel)||void 0===e||e.emit()}async handleSubmit(t){var e,i,s,l,n,d,h,p;if(t.stopPropagation(),this.file)try{const t=await o(this.endpoint,{name:this.file.name});console.log("created template",t);const i=await(n=this.endpoint,d=t.id,h=this.file,p=new FormData,p.append("document",h,h.name),n.api.post("/templates/".concat(d,"/documents"),p,{timeout:1e4,onUploadProgress:function(){}}).then((function(t){return t.data})));console.log("created document",i);const s=await a(this.endpoint,t.id);console.log("[CREATE] Created template",s),null===(e=this.next)||void 0===e||e.emit(s)}catch(t){console.log("[TEMPLATE-CREATE] Error creating template",t),null===(i=this.sdkError)||void 0===i||i.emit(new r(t.message,null===(s=t.response)||void 0===s?void 0:s.status,null===(l=t.response)||void 0===l?void 0:l.data))}}render(){return this.endpoint.session?i("form",{onSubmit:t=>t.preventDefault(),onClick:t=>t.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:t=>this.handleFileChanged(t)}),i("div",{class:"upload-box"},i("div",null,i("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold"}},"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px"}},"Or, if you prefer..."),i("verdocs-button",{label:"Select a file from your computer",size:"small",onClick:t=>this.handleUpload(t)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:t=>this.handleCancel(t)}),i("verdocs-button",{label:"Next",size:"small",onClick:t=>this.handleSubmit(t),disabled:!this.file}))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};w.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{max-width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const f=[{id:"attachment",tooltip:"Attachment",icon:"A"},{id:"checkbox",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:"O"},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"payment",tooltip:"Payment",icon:"P"},{id:"radio",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:"X"}],b=class{constructor(i){t(this,i),this.next=e(this,"next",7),this.cancel=e(this,"cancel",7),this.sdkError=e(this,"sdkError",7),this.pageHeights={},this.cachedPageInfo={},this.endpoint=l.getDefault(),this.templateId=null,this.placing=null,this.selectedRoleName=""}async componentWillLoad(){var t,e,i,s,o,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");try{console.log(`[FIELDS] Loading template ${this.templateId}`,this.endpoint.session),await x(this.endpoint,this.templateId),this.selectedRoleName=u.roleNames[0],console.log("Starting with role",this.selectedRoleName)}catch(s){console.log("[FIELDS] Error loading template",s),null===(t=this.sdkError)||void 0===t||t.emit(new r(s.message,null===(e=s.response)||void 0===e?void 0:e.status,null===(i=s.response)||void 0===i?void 0:i.data))}}catch(t){console.log("[FIELDS] Error with preview session",t),null===(s=this.sdkError)||void 0===s||s.emit(new r(t.message,null===(o=t.response)||void 0===o?void 0:o.status,null===(a=t.response)||void 0===a?void 0:a.data))}}componentDidRender(){n.dynamicDrop(!0)}async handleFieldChange(t,e,i){console.log("[FIELDS] handleFieldChange",t,e,i)}attachFieldAttributes(t,e,i,s){s.addEventListener("input",(t=>this.handleFieldChange(e,t))),s.addEventListener("settingsChanged",(()=>{s.setAttribute("roleindex",p(u.roleNames,e.role_name))})),s.setAttribute("roleindex",i),s.setAttribute("pageNumber",t.pageNumber),s.setAttribute("xScale",t.xScale),s.setAttribute("yScale",t.yScale),s.setAttribute("name",e.name)}handlePageRendered(t){const e=t.detail;console.log("[FIELDS] Page rendered",e),this.cachedPageInfo[e.pageNumber]=e,this.pageHeights[e.pageNumber]=e.naturalHeight;const i=u.fields.filter((t=>t.page_sequence===e.pageNumber));console.log("[FIELDS] Fields on page",i),i.forEach((t=>{const i=p(u.roleNames,t.role_name),s=m(t,e,i,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(e,t,i,s))):this.attachFieldAttributes(e,t,i,s),n(s).draggable({listeners:{start(t){console.log("[FIELDS] Drag started",t.type,t.target)},move(t){const e=+(t.target.getAttribute("posX")||0),i=+(t.target.getAttribute("posY")||0),s=+(t.target.getAttribute("xScale")||1),o=+(t.target.getAttribute("yScale")||1),a=t.dx/s+e,l=t.dy/o+i;t.target.setAttribute("posX",a),t.target.setAttribute("posy",l),c(t.target,"translate",`${a}px, ${l}px`)},end:this.handleMoveField.bind(this)}}))}))}async handleMoveField(t){const e=t.target.getAttribute("pageNumber"),{naturalWidth:i=612,naturalHeight:s=792,renderedHeight:o=792}=this.cachedPageInfo[e];console.log("[FIELDS] Drag ended",e,t.target);const a=t.target.getBoundingClientRect(),l=t.target.parentElement.getBoundingClientRect(),r=Math.max(a.left-l.left,0),n=Math.max(o-(l.bottom-a.bottom),0),{x:h,y:p}=this.viewCoordinatesToPageCoordinates(r,n,e,i-t.rect.width,s-t.rect.height),m=t.target.getAttribute("name"),c=u.fields.find((t=>t.name===m));c&&(c.setting.x=h,c.setting.y=p,await d(this.endpoint,this.templateId,m,c),this.handlePageRendered({detail:this.cachedPageInfo[e]}))}generateFieldName(t,e){var i;const s=null===(i=u.template.pages)||void 0===i?void 0:i[e-1];return`${t}P${e}-${((null==s?void 0:s.fields)||[]).length}`}viewCoordinatesToPageCoordinates(t,e,i,s,o){const{xScale:a=1,yScale:l=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(t/a,s)),y:Math.floor(Math.min(Math.max(r-e,0)/l,o))}}async handleClickPage(t,e){if(this.placing){const i=e.sequence,s=t.offsetX,o=t.offsetY,a=g(this.placing),l=v(this.placing),{naturalWidth:r=612,naturalHeight:n=792}=this.cachedPageInfo[i],{x:d,y:p}=this.viewCoordinatesToPageCoordinates(s,o,i,r-a,n-l),m={name:this.generateFieldName(this.placing,i),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:!0,page_sequence:i,validator:null,setting:{width:a,height:l,x:d,y:p,result:""}},c=await h(this.endpoint,this.templateId,m);console.log("Saved field",c),u.fields.push(c),this.placing=null,this.handlePageRendered({detail:this.cachedPageInfo[i]})}}render(){if(console.log("rendering",u.updateCount),!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(u.loading||!u.template)return i(s,null,i("verdocs-loader",null));const t=[...u.template.pages];return t.sort(((t,e)=>t.sequence-e.sequence)),i(s,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-updated":u.updateCount,onSubmit:()=>{console.log("onSubmit")}},i("div",{class:"pages"},t.map((t=>i("verdocs-document-page",{pageImageUri:t.display_uri,virtualWidth:612,virtualHeight:792,onClick:e=>this.handleClickPage(e,t),pageNumber:t.sequence,onPageRendered:t=>this.handlePageRendered(t),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))),i("verdocs-floating-menu",{options:f,onOptionSelected:t=>{this.placing=t.detail.id}}))}};b.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}";export{w as verdocs_template_create,b as verdocs_template_fields}
@@ -1 +0,0 @@
1
- import{r as e,c as i,h as s,H as t}from"./p-ff1278ed.js";import{V as o}from"./p-2d4712ea.js";import{i as l,a as n}from"./p-e662f81b.js";import{g as d}from"./p-6de76553.js";import{s as a}from"./p-99b80f74.js";import{l as r}from"./p-3fd9305c.js";import{a as p}from"./p-d6e07c20.js";import{S as c}from"./p-7a1b2643.js";import"./p-21603661.js";import"./p-5ea05a1d.js";import"./p-7291906c.js";import"./p-b28ef4bb.js";import"./p-880b619d.js";import"./p-aa124212.js";const x=class{constructor(s){e(this,s),this.send=i(this,"send",7),this.cancel=i(this,"cancel",7),this.sdkError=i(this,"sdkError",7),this.levels=[],this.endpoint=o.getDefault(),this.templateId=null,this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`,this.rolesAtLevel={},this.showPickerForId="",this.sessionContacts=[],this.rolesCompleted={}}reset(){this.rolesCompleted={}}async componentWillLoad(){var e,i,s,t,o;const l=this.endpoint.loadSession();if(this.templateId){try{if(console.log(`[SEND] Loading template ${this.templateId}`),await r(this.endpoint,this.templateId),null===(e=a.template)||void 0===e?void 0:e.roles){const e={};this.rolesCompleted={},a.template.roles.forEach((i=>{const s=i.sequence-1;e[s]||(e[s]=[]);const t=`r-${s}-${e[s].length}`;e[s].push({...i,id:t})})),this.rolesAtLevel=e,this.levels=Object.keys(e).map((e=>+e)),this.levels.sort(((e,i)=>e-i))}}catch(e){console.log("[SEND] Error loading template",e),null===(i=this.sdkError)||void 0===i||i.emit(new c(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(t=e.response)||void 0===t?void 0:t.data))}(null===(o=l.session)||void 0===o?void 0:o.profile)&&this.sessionContacts.push({id:l.session.profile.id,name:`${l.session.profile.first_name} ${l.session.profile.last_name}`,email:l.session.profile.email,phone:l.session.profile.phone})}else console.log(`[SEND] Missing required template ID ${this.templateId}`)}getLevelIcon(e){return s("div",e<0?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}:e>=this.levels.length?{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}:{class:"level-icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'})}handleSelectContact(e,i){e.preventDefault(),this.rolesCompleted[i.id]={...i,...e.detail},this.showPickerForId=""}handleClickRole(e,i){e.stopPropagation(),this.showPickerForId=i.id}handleSend(e){var i;e.stopPropagation(),null===(i=this.send)||void 0===i||i.emit({roles:Object.values(this.rolesCompleted),name:a.template.name,template_id:this.templateId})}handleCancel(e){var i;e.stopPropagation(),null===(i=this.cancel)||void 0===i||i.emit()}render(){const e=a.template.roles.map((e=>e.name))||[],i=Object.values(this.rolesCompleted).filter((e=>l(e.email)||n(e.phone))),o=i.length>=e.length;return console.log("r",this.rolesCompleted,o,i),s(t,{class:{}},s("div",{class:"recipients"},s("div",{class:"left-line"}),s("div",{class:"level level-start"},this.getLevelIcon(-1),s("div",{class:"complete"},"Send Envelope")),this.levels.map((i=>s("div",{class:`level level-${i}`},this.getLevelIcon(i),this.rolesAtLevel[i].map((i=>{var t,o,l;return s("div",{class:"recipient",style:{backgroundColor:d(p(e,i.name))},onClick:e=>this.handleClickRole(e,i)},null!==(o=null===(t=this.rolesCompleted[i.id])||void 0===t?void 0:t.full_name)&&void 0!==o?o:i.name,s("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>'}),this.showPickerForId===i.id&&s("verdocs-contact-picker",{onCancel:()=>this.showPickerForId="",onNext:e=>this.handleSelectContact(e,i),contactSuggestions:this.sessionContacts,templateRole:null!==(l=this.rolesCompleted[i.id])&&void 0!==l?l:i,onSearchContacts:e=>console.log("Search",e.detail)}))}))))),s("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),s("div",{class:"complete"},"Signing Complete"))),s("div",{class:"buttons"},s("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e)}),s("verdocs-button",{label:"Send",size:"small",disabled:!o,onClick:e=>this.handleSend(e)})))}};x.style='verdocs-send{display:-ms-flexbox;display:flex;padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';export{x as verdocs_send}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function a(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?i(e.value):a(e.value).then(r,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,a,o,r;return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(e){return function(t){return l([e,t])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,a&&(o=r[0]&2?a["return"]:r[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,r[1])).done)return o;if(a=0,o)r=[r[0]&2,o.value];switch(r[0]){case 0:case 1:o=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;a=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(r[0]===6&&i.label<o[1]){i.label=o[1];o=r;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(r);break}if(o[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];a=0}finally{n=o=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,a=t.length,o;n<a;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-97329951.system.js","./p-69912cbf.system.js","./p-261dcea1.system.js","./p-187b20b7.system.js","./p-d122cadd.system.js","./p-b1288daf.system.js","./p-e090d5e1.system.js","./p-677cf03e.system.js","./p-b6e20078.system.js","./p-af2c2f79.system.js","./p-e0cfad01.system.js","./p-327858f0.system.js","./p-0f6da8c7.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,i,n,a,o,r,s,l,d,c,p,u,h,g,m,v,f,w;return{setters:[function(e){t=e.r;i=e.c;n=e.h;a=e.H},function(e){o=e.c;r=e.g},function(e){s=e.V},function(e){l=e.S},function(e){d=e.i},function(e){c=e.u;p=e.c},function(e){u=e.a;h=e.r;g=e.c;m=e.d;v=e.e},function(e){f=e.s},function(e){w=e.l},function(){},function(){},function(){},function(){},function(){}],execute:function(){var x=function(e,t,i,n){var a=new FormData;a.append("document",i,i.name);return e.api.post("/templates/".concat(t,"/documents"),a,{timeout:1e4,onUploadProgress:function(e){var t=e.total||1;var i=e.loaded||0;n===null||n===void 0?void 0:n(Math.floor(i*100/(t||1)),i,t||1)}}).then((function(e){return e.data}))};var b='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{max-width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var y='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var q=e("verdocs_template_create",function(){function e(e){t(this,e);this.cancel=i(this,"cancel",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.endpoint=s.getDefault();this.file=undefined}e.prototype.componentWillLoad=function(){this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;console.log("files",e.target.files);this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.cancel)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,a,s,d,c,p;return __generator(this,(function(u){switch(u.label){case 0:e.stopPropagation();if(!this.file){return[2]}u.label=1;case 1:u.trys.push([1,5,,6]);return[4,o(this.endpoint,{name:this.file.name})];case 2:s=u.sent();console.log("created template",s);return[4,x(this.endpoint,s.id,this.file)];case 3:d=u.sent();console.log("created document",d);return[4,r(this.endpoint,s.id)];case 4:c=u.sent();console.log("[CREATE] Created template",c);(t=this.next)===null||t===void 0?void 0:t.emit(c);return[3,6];case 5:p=u.sent();console.log("[TEMPLATE-CREATE] Error creating template",p);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new l(p.message,(n=p.response)===null||n===void 0?void 0:n.status,(a=p.response)===null||a===void 0?void 0:a.data));return[3,6];case 6:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return n(a,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return n("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},n("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),n("div",{class:"upload-box"},n("div",null,n("span",{innerHTML:y})),n("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold"}},"Drag a file here"),n("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px"}},"Or, if you prefer..."),n("verdocs-button",{label:"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),n("div",{class:"buttons"},n("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),n("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file})))};return e}());q.style=b;var Z="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}";var C='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';var E='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>';var _='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';var V='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';var S='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';var L='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var I='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';var k=[{id:"attachment",tooltip:"Attachment",icon:"A"},{id:"checkbox",tooltip:"Check Box",icon:_},{id:"date",tooltip:"Date",icon:S},{id:"dropdown",tooltip:"Dropdown",icon:"O"},{id:"initial",tooltip:"Initials",icon:I},{id:"payment",tooltip:"Payment",icon:"P"},{id:"radio",tooltip:"Radio Button",icon:V},{id:"signature",tooltip:"Signature",icon:L},{id:"textarea",tooltip:"Text Area",icon:E},{id:"textbox",tooltip:"Text Box",icon:C},{id:"timestamp",tooltip:"Timestamp",icon:"X"}];var H=e("verdocs_template_fields",function(){function e(e){t(this,e);this.next=i(this,"next",7);this.cancel=i(this,"cancel",7);this.sdkError=i(this,"sdkError",7);this.pageHeights={};this.cachedPageInfo={};this.endpoint=s.getDefault();this.templateId=null;this.placing=null;this.selectedRoleName=""}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,a,o,r,s;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,5,,6]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}d.label=1;case 1:d.trys.push([1,3,,4]);console.log("[FIELDS] Loading template ".concat(this.templateId),this.endpoint.session);return[4,w(this.endpoint,this.templateId)];case 2:d.sent();this.selectedRoleName=f.roleNames[0];console.log("Starting with role",this.selectedRoleName);return[3,4];case 3:r=d.sent();console.log("[FIELDS] Error loading template",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(r.message,(t=r.response)===null||t===void 0?void 0:t.status,(i=r.response)===null||i===void 0?void 0:i.data));return[3,4];case 4:return[3,6];case 5:s=d.sent();console.log("[FIELDS] Error with preview session",s);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new l(s.message,(a=s.response)===null||a===void 0?void 0:a.status,(o=s.response)===null||o===void 0?void 0:o.data));return[3,6];case 6:return[2]}}))}))};e.prototype.componentDidRender=function(){d.dynamicDrop(true)};e.prototype.handleFieldChange=function(e,t,i){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){console.log("[FIELDS] handleFieldChange",e,t,i);return[2]}))}))};e.prototype.attachFieldAttributes=function(e,t,i,n){var a=this;n.addEventListener("input",(function(e){return a.handleFieldChange(t,e)}));n.addEventListener("settingsChanged",(function(){n.setAttribute("roleindex",u(f.roleNames,t.role_name))}));n.setAttribute("roleindex",i);n.setAttribute("pageNumber",e.pageNumber);n.setAttribute("xScale",e.xScale);n.setAttribute("yScale",e.yScale);n.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;console.log("[FIELDS] Page rendered",i);this.cachedPageInfo[i.pageNumber]=i;this.pageHeights[i.pageNumber]=i.naturalHeight;var n=f.fields.filter((function(e){return e.page_sequence===i.pageNumber}));console.log("[FIELDS] Fields on page",n);n.forEach((function(e){var n=u(f.roleNames,e.role_name);var a=h(e,i,n,{disabled:true,editable:true,draggable:true});if(!a){return}if(Array.isArray(a)){a.map((function(a){return t.attachFieldAttributes(i,e,n,a)}))}else{t.attachFieldAttributes(i,e,n,a)}d(a).draggable({listeners:{start:function(e){console.log("[FIELDS] Drag started",e.type,e.target)},move:function(e){var t=+(e.target.getAttribute("posX")||0);var i=+(e.target.getAttribute("posY")||0);var n=+(e.target.getAttribute("xScale")||1);var a=+(e.target.getAttribute("yScale")||1);var o=e.dx/n+t;var r=e.dy/a+i;e.target.setAttribute("posX",o);e.target.setAttribute("posy",r);g(e.target,"translate","".concat(o,"px, ").concat(r,"px"))},end:t.handleMoveField.bind(t)}})}))};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,a,o,r,s,l,d,p,u,h,g,m,v,w,x,b;return __generator(this,(function(y){switch(y.label){case 0:t=e.target.getAttribute("pageNumber");i=this.cachedPageInfo[t],n=i.naturalWidth,a=n===void 0?612:n,o=i.naturalHeight,r=o===void 0?792:o,s=i.renderedHeight,l=s===void 0?792:s;console.log("[FIELDS] Drag ended",t,e.target);d=e.target.getBoundingClientRect();p=e.target.parentElement;u=p.getBoundingClientRect();h=Math.max(d.left-u.left,0);g=Math.max(l-(u.bottom-d.bottom),0);m=this.viewCoordinatesToPageCoordinates(h,g,t,a-e.rect.width,r-e.rect.height),v=m.x,w=m.y;x=e.target.getAttribute("name");b=f.fields.find((function(e){return e.name===x}));if(!b)return[3,2];b.setting.x=v;b.setting.y=w;return[4,c(this.endpoint,this.templateId,x,b)];case 1:y.sent();this.handlePageRendered({detail:this.cachedPageInfo[t]});y.label=2;case 2:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var i;var n=(i=f.template.pages)===null||i===void 0?void 0:i[t-1];var a=(n===null||n===void 0?void 0:n.fields)||[];return"".concat(e,"P").concat(t,"-").concat(a.length)};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,i,n,a){var o=this.cachedPageInfo[i],r=o.xScale,s=r===void 0?1:r,l=o.yScale,d=l===void 0?1:l,c=o.renderedHeight,p=c===void 0?792:c;var u=Math.floor(Math.min(e/s,n));var h=Math.floor(Math.min(Math.max(p-t,0)/d,a));return{x:u,y:h}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,a,o,r,s,l,d,c,u,h,g,w,x,b;return __generator(this,(function(y){switch(y.label){case 0:if(!this.placing)return[3,2];i=t.sequence;n=e.offsetX;a=e.offsetY;o=m(this.placing);r=v(this.placing);s=this.cachedPageInfo[i],l=s.naturalWidth,d=l===void 0?612:l,c=s.naturalHeight,u=c===void 0?792:c;h=this.viewCoordinatesToPageCoordinates(n,a,i,d-o,u-r),g=h.x,w=h.y;x={name:this.generateFieldName(this.placing,i),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:true,page_sequence:i,validator:null,setting:{width:o,height:r,x:g,y:w,result:""}};return[4,p(this.endpoint,this.templateId,x)];case 1:b=y.sent();console.log("Saved field",b);f.fields.push(b);this.placing=null;this.handlePageRendered({detail:this.cachedPageInfo[i]});y.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;console.log("rendering",f.updateCount);if(!this.endpoint.session){return n(a,null,n("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(f.loading||!f.template){return n(a,null,n("verdocs-loader",null))}var i=__spreadArray([],f.template.pages,true);i.sort((function(e,t){return e.sequence-t.sequence}));return n(a,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},"data-updated":f.updateCount,onSubmit:function(){console.log("onSubmit")}},n("div",{class:"pages"},i.map((function(e){return n("verdocs-document-page",{pageImageUri:e.display_uri,virtualWidth:612,virtualHeight:792,onClick:function(i){return t.handleClickPage(i,e)},pageNumber:e.sequence,onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))),n("verdocs-floating-menu",{options:k,onOptionSelected:function(e){t.placing=e.detail.id}}))};return e}());H.style=Z}}}));