@verdocs/web-sdk 4.2.123 → 4.2.126

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 (126) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-checkbox_4.cjs.entry.js +3 -4
  3. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
  5. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +17 -10
  6. package/dist/cjs/verdocs-organization-card_2.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-preview_9.cjs.entry.js +42 -33
  8. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +9 -9
  10. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-sign.cjs.entry.js +4 -2
  12. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  13. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  15. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  17. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  18. package/dist/collection/components/controls/verdocs-portal/verdocs-portal.js +1 -1
  19. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +9 -1
  20. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +35 -5
  21. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  22. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  23. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +4 -2
  24. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  25. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  26. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  27. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +1 -5
  28. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  29. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +1 -1
  30. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +3 -4
  31. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +47 -35
  32. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +8 -8
  33. package/dist/collection/components/templates/verdocs-template-sender/verdocs-template-sender.js +1 -1
  34. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  35. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  36. package/dist/components/verdocs-envelope-document-page2.js +1 -1
  37. package/dist/components/verdocs-envelopes-list.js +6 -6
  38. package/dist/components/verdocs-field-dropdown2.js +1 -5
  39. package/dist/components/verdocs-portal2.js +1 -1
  40. package/dist/components/verdocs-quick-functions.js +1 -1
  41. package/dist/components/verdocs-search-tabs.js +1 -1
  42. package/dist/components/verdocs-sign.js +4 -2
  43. package/dist/components/verdocs-status-indicator2.js +2 -2
  44. package/dist/components/verdocs-template-card.js +1 -1
  45. package/dist/components/verdocs-template-document-page2.js +1 -1
  46. package/dist/components/verdocs-template-field-properties2.js +3 -4
  47. package/dist/components/verdocs-template-fields2.js +46 -35
  48. package/dist/components/verdocs-template-role-properties2.js +8 -8
  49. package/dist/components/verdocs-template-sender2.js +1 -1
  50. package/dist/components/verdocs-template-star2.js +1 -1
  51. package/dist/components/verdocs-template-tags.js +1 -1
  52. package/dist/components/verdocs-upload-dialog2.js +19 -6
  53. package/dist/esm/loader.js +1 -1
  54. package/dist/esm/verdocs-checkbox_4.entry.js +3 -4
  55. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  56. package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
  57. package/dist/esm/verdocs-field-attachment_13.entry.js +17 -10
  58. package/dist/esm/verdocs-organization-card_2.entry.js +1 -1
  59. package/dist/esm/verdocs-preview_9.entry.js +42 -33
  60. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  61. package/dist/esm/verdocs-radio-button_3.entry.js +9 -9
  62. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  63. package/dist/esm/verdocs-sign.entry.js +4 -2
  64. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  65. package/dist/esm/verdocs-template-card.entry.js +1 -1
  66. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  67. package/dist/esm/verdocs-template-star.entry.js +1 -1
  68. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  69. package/dist/esm/verdocs-web-sdk.js +1 -1
  70. package/dist/esm-es5/loader.js +1 -1
  71. package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  73. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  75. package/dist/esm-es5/verdocs-organization-card_2.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-preview_9.entry.js +1 -1
  77. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  78. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  79. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  82. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  84. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  85. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  87. package/dist/types/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.d.ts +3 -0
  88. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +3 -1
  89. package/dist/types/components.d.ts +2 -0
  90. package/dist/verdocs-web-sdk/{p-c9f545fe.entry.js → p-12a39d57.entry.js} +1 -1
  91. package/dist/verdocs-web-sdk/{p-4ee43d61.entry.js → p-1cd86ef4.entry.js} +1 -1
  92. package/dist/verdocs-web-sdk/{p-c43f5df7.system.entry.js → p-1dacf5e4.system.entry.js} +1 -1
  93. package/dist/verdocs-web-sdk/p-267df026.system.js +1 -1
  94. package/dist/verdocs-web-sdk/{p-43a7fce5.system.entry.js → p-2a1bed47.system.entry.js} +1 -1
  95. package/dist/verdocs-web-sdk/p-2adae827.system.entry.js +1 -0
  96. package/dist/verdocs-web-sdk/p-2c40b37a.entry.js +1 -0
  97. package/dist/verdocs-web-sdk/{p-2cc041aa.system.entry.js → p-377858e5.system.entry.js} +1 -1
  98. package/dist/verdocs-web-sdk/{p-2ee3549e.system.entry.js → p-4d071145.system.entry.js} +1 -1
  99. package/dist/verdocs-web-sdk/{p-cc5245b4.system.entry.js → p-53a3cdf3.system.entry.js} +1 -1
  100. package/dist/verdocs-web-sdk/{p-8f3ed4da.system.entry.js → p-54526558.system.entry.js} +1 -1
  101. package/dist/verdocs-web-sdk/{p-c5e65e9d.system.entry.js → p-5b5a0ba2.system.entry.js} +1 -1
  102. package/dist/verdocs-web-sdk/{p-77f12464.entry.js → p-5c9fd1e3.entry.js} +1 -1
  103. package/dist/verdocs-web-sdk/{p-5b7fd148.entry.js → p-5f61d897.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-98885cd8.entry.js → p-68a37526.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/p-766e30ab.entry.js +1 -0
  106. package/dist/verdocs-web-sdk/{p-aace040e.entry.js → p-77407be2.entry.js} +1 -1
  107. package/dist/verdocs-web-sdk/{p-779a342d.system.entry.js → p-808f956b.system.entry.js} +1 -1
  108. package/dist/verdocs-web-sdk/{p-c0018ff8.entry.js → p-965464db.entry.js} +1 -1
  109. package/dist/verdocs-web-sdk/{p-48c2f79b.entry.js → p-9750767c.entry.js} +1 -1
  110. package/dist/verdocs-web-sdk/{p-b52b2533.system.entry.js → p-a246dd98.system.entry.js} +1 -1
  111. package/dist/verdocs-web-sdk/{p-72b47a99.entry.js → p-ab385138.entry.js} +1 -1
  112. package/dist/verdocs-web-sdk/{p-3128b508.system.entry.js → p-ad8dfb2b.system.entry.js} +1 -1
  113. package/dist/verdocs-web-sdk/{p-d119854a.system.entry.js → p-aebb6858.system.entry.js} +1 -1
  114. package/dist/verdocs-web-sdk/{p-4fb62279.entry.js → p-b3c4d445.entry.js} +1 -1
  115. package/dist/verdocs-web-sdk/{p-8ce033ef.entry.js → p-c32f6de0.entry.js} +1 -1
  116. package/dist/verdocs-web-sdk/{p-55f49f87.entry.js → p-d1ec0c0e.entry.js} +1 -1
  117. package/dist/verdocs-web-sdk/{p-f96de332.system.entry.js → p-d775d674.system.entry.js} +1 -1
  118. package/dist/verdocs-web-sdk/{p-b5a223b6.system.entry.js → p-d7f0bb8b.system.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/p-dbce152e.entry.js +1 -0
  120. package/dist/verdocs-web-sdk/{p-826d6fb0.system.entry.js → p-fed1d58a.system.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  122. package/package.json +2 -2
  123. package/dist/verdocs-web-sdk/p-02af8123.entry.js +0 -1
  124. package/dist/verdocs-web-sdk/p-12608391.entry.js +0 -1
  125. package/dist/verdocs-web-sdk/p-5313e672.entry.js +0 -1
  126. package/dist/verdocs-web-sdk/p-7cad3ec7.system.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,c as t,h as i,F as o,H as a,g as s}from"./p-5207d80c.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d}from"@verdocs/js-sdk";import{g as l}from"./p-784ac100.js";import{t as c,i as n,g as p}from"./p-fae63f89.js";import{c as h}from"./p-68a5aaff.js";import"./p-83317d11.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const b=class{constructor(i){e(this,i),this.pageRendered=t(this,"pageRendered",7),this.fieldStore=null,this.endpoint=r.getDefault(),this.editable=!1,this.disabled=!1,this.done=!1,this.templateId="",this.documentId="",this.pageNumber=1,this.virtualWidth=612,this.virtualHeight=792,this.layers=[{name:"page",type:"canvas"}],this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`,this.renderedWidth=this.virtualWidth,this.renderedHeight=this.virtualHeight,this.naturalWidth=this.virtualWidth,this.naturalHeight=this.virtualHeight,this.aspectRatio=this.virtualWidth/this.virtualHeight,this.skipFirstNotification=!0,this.pageDisplayUri="",this.xScale=1,this.yScale=1}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber),this.fieldStore=l(this.templateId)}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e,this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100)),this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()}notifyRenderedSize(){if(this.skipFirstNotification)return void(this.skipFirstNotification=!1);const e=this.renderedWidth/this.virtualWidth;this.xScale!==e&&(this.xScale=e);const t=this.renderedHeight/this.virtualHeight;this.yScale!==t&&(this.yScale=t),this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){const e=`${this.renderedHeight}px`;return i(a,{key:"2c5cc60056b48fbcb7de1e1abffdbb3753b38e10",id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>"div"===t.type?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},"controls"===t.name&&this.fieldStore.get("fields").filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,a;const s=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:m,disabled:u,done:f,pageNumber:g}=this;switch(((null===(t=e.setting)||void 0===t?void 0:t.leading)>0||(null===(a=e.settings)||void 0===a?void 0:a.leading)>0)&&(d="textarea",l=!0),d){case"textbox":return i("verdocs-field-textbox",{id:s,fieldname:r,templateid:b,editable:m,multiline:l,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:s,fieldname:r,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(o,null,r)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":!0,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth,this.naturalHeight=e.target.naturalHeight,this.aspectRatio=this.naturalWidth/this.naturalHeight,this.virtualHeight=this.virtualWidth/this.aspectRatio,this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null))))}get container(){return s(this)}};b.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}";const m=class{constructor(t){e(this,t),this.text="",this.icon="",this.placement="bottom",this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=h(this.iconEl,this.tooltip,{placement:this.placement,modifiers:"left"===this.placement?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}show(){var e,t;null===(e=this.tooltip)||void 0===e||e.setAttribute("data-show",""),null===(t=this.popperInstance)||void 0===t||t.update().catch((()=>{}))}hide(){var e;null===(e=this.tooltip)||void 0===e||e.removeAttribute("data-show")}render(){return i(a,{key:"869ac7bc88e9985e3338183acfe2f794cb32f4b7",class:{}},i("div",{key:"a14eee006ba0eebacb118df48b3518e766be1c05","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:e=>this.iconEl=e}),i("div",{key:"2dc9c1cccc90348cb8355d46db3c6bfe4e0845b3",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"d062ddd320b47a7f1c397c56721cb544018b9434","data-popper-arrow":"true",class:"arrow"})))}};m.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';export{b as verdocs_template_document_page,m as verdocs_toolbar_icon}
1
+ import{r as e,c as t,h as i,F as o,H as a,g as s}from"./p-5207d80c.js";import{VerdocsEndpoint as d,getTemplateDocumentPageDisplayUri as r}from"@verdocs/js-sdk";import{g as l}from"./p-784ac100.js";import{t as c,i as n,g as p}from"./p-fae63f89.js";import{c as h}from"./p-68a5aaff.js";import"./p-83317d11.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const b=class{constructor(i){e(this,i),this.pageRendered=t(this,"pageRendered",7),this.fieldStore=null,this.endpoint=d.getDefault(),this.editable=!1,this.disabled=!1,this.done=!1,this.templateId="",this.documentId="",this.pageNumber=1,this.virtualWidth=612,this.virtualHeight=792,this.layers=[{name:"page",type:"canvas"}],this.containerId=`verdocs-document-page-${Math.random().toString(36).substring(2,11)}`,this.renderedWidth=this.virtualWidth,this.renderedHeight=this.virtualHeight,this.naturalWidth=this.virtualWidth,this.naturalHeight=this.virtualHeight,this.aspectRatio=this.virtualWidth/this.virtualHeight,this.skipFirstNotification=!0,this.pageDisplayUri="",this.xScale=1,this.yScale=1}async componentWillLoad(){this.pageDisplayUri=await r(this.endpoint,this.documentId,this.pageNumber),this.fieldStore=l(this.templateId)}componentDidLoad(){this.resizeObserver=new ResizeObserver(c((e=>{for(const t of e){const e=t.contentRect.width;this.renderedWidth=e,this.renderedHeight=this.virtualHeight*(e/this.virtualWidth)}this.notifyRenderedSize()}),100)),this.resizeObserver.observe(this.container)}componentDidUpdate(){this.notifyRenderedSize()}disconnectedCallback(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect()}notifyRenderedSize(){if(this.skipFirstNotification)return void(this.skipFirstNotification=!1);const e=this.renderedWidth/this.virtualWidth;this.xScale!==e&&(this.xScale=e);const t=this.renderedHeight/this.virtualHeight;this.yScale!==t&&(this.yScale=t),this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:e,yScale:t})}render(){const e=`${this.renderedHeight}px`;return i(a,{key:"ddeacbfbd9f38bddfbb5c9886df494881b4e38cf",id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>"div"===t.type?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},"controls"===t.name&&this.fieldStore.get("fields").filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,a;const s=p(e);let{name:d,type:r,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:m,disabled:u,done:f,pageNumber:g}=this;switch(((null===(t=e.setting)||void 0===t?void 0:t.leading)>0||(null===(a=e.settings)||void 0===a?void 0:a.leading)>0)&&(r="textarea",l=!0),r){case"textbox":return i("verdocs-field-textbox",{id:s,fieldname:d,templateid:b,editable:m,multiline:l,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:s,fieldname:d,templateid:b,editable:m,disabled:u,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(o,null,d)}}))):this.pageDisplayUri?i("img",{class:"verdocs-template-document-page-layer img",id:`${this.containerId}-${t.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":!0,loading:"lazy",onLoad:e=>{this.naturalWidth=e.target.naturalWidth,this.naturalHeight=e.target.naturalHeight,this.aspectRatio=this.naturalWidth/this.naturalHeight,this.virtualHeight=this.virtualWidth/this.aspectRatio,this.renderedHeight=e.target.offsetWidth/this.aspectRatio}}):i("div",null))))}get container(){return s(this)}};b.style="@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}";const m=class{constructor(t){e(this,t),this.text="",this.icon="",this.placement="bottom",this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=h(this.iconEl,this.tooltip,{placement:this.placement,modifiers:"left"===this.placement?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null)}show(){var e,t;null===(e=this.tooltip)||void 0===e||e.setAttribute("data-show",""),null===(t=this.popperInstance)||void 0===t||t.update().catch((()=>{}))}hide(){var e;null===(e=this.tooltip)||void 0===e||e.removeAttribute("data-show")}render(){return i(a,{key:"869ac7bc88e9985e3338183acfe2f794cb32f4b7",class:{}},i("div",{key:"a14eee006ba0eebacb118df48b3518e766be1c05","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:e=>this.iconEl=e}),i("div",{key:"2dc9c1cccc90348cb8355d46db3c6bfe4e0845b3",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"d062ddd320b47a7f1c397c56721cb544018b9434","data-popper-arrow":"true",class:"arrow"})))}};m.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}';export{b as verdocs_template_document_page,m as verdocs_toolbar_icon}
@@ -1 +1 @@
1
- import{r as t,c as e,h as r,H as s}from"./p-5207d80c.js";import{VerdocsEndpoint as a,toggleStar as o}from"@verdocs/js-sdk";const i=class{constructor(r){t(this,r),this.starChange=e(this,"starChange",7),this.sdkError=e(this,"sdkError",7),this.endpoint=a.getDefault(),this.template=void 0,this.updating=!1}async componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[TEMPLATES] Must be authenticated")}toggle(t){t.stopPropagation(),this.updating=!0,o(a.getDefault(),this.template.id).then((t=>{this.updating=!1,this.template.star_counter=t.star_counter,this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=!1,console.log("[STAR] Error toggling template star",t.message),this.sdkError.emit(t)}))}render(){return r(s,{key:"380d6e0aa5c8cda93b4d5ed1276da45dafc8c8b4"},r("div",{key:"04dd0b86049e0dd2ca756c6f209ecce0cda2e22b",class:"star "+(this.updating?"updating":""),innerHTML:this.template.star_counter?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>',onClick:t=>this.toggle(t)}),r("div",{key:"e26658e05d76b6d72fbd434d8b938f61cde39b2a",class:"count"},this.template.star_counter||"--"))}};i.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';export{i as verdocs_template_star}
1
+ import{r as t,c as e,h as r,H as s}from"./p-5207d80c.js";import{VerdocsEndpoint as a,toggleStar as o}from"@verdocs/js-sdk";const i=class{constructor(r){t(this,r),this.starChange=e(this,"starChange",7),this.sdkError=e(this,"sdkError",7),this.endpoint=a.getDefault(),this.template=void 0,this.updating=!1}async componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[TEMPLATES] Must be authenticated")}toggle(t){t.stopPropagation(),this.updating=!0,o(a.getDefault(),this.template.id).then((t=>{this.updating=!1,this.template.star_counter=t.star_counter,this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=!1,console.log("[STAR] Error toggling template star",t.message),this.sdkError.emit(t)}))}render(){return r(s,{key:"3bf76e18041a195c1bf050776cd465f7afde3c37"},r("div",{key:"566edf26b382ce4b758571f6470d1ac873d1e0b6",class:"star "+(this.updating?"updating":""),innerHTML:this.template.star_counter?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>',onClick:t=>this.toggle(t)}),r("div",{key:"602436f5d52db7118af35deccb264ccb331d1b72",class:"count"},this.template.star_counter||"--"))}};i.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';export{i as verdocs_template_star}
@@ -1 +1 @@
1
- import{r as e,h as a,H as o}from"./p-5207d80c.js";const c=class{constructor(a){e(this,a),this.template=void 0}render(){var e,c,t,s;return a(o,{key:"34dbb55f6c6b8afe8e2a27142d1edd560aa8123e"},a("span",{key:"83a70355f7d740968113d4b7c70223b8b1728199",class:"name"},this.template.name),a("span",{key:"daba1bec48afa7914db6812c092ecc9006f0c0fa",class:"org-name"},(null===(e=this.template.organization)||void 0===e?void 0:e.name)||"Public"),a("hr",{key:"f33a1caa30b0e73e490c353aeda95f03ccc8cdc9"}),a("div",{key:"132457e5862298418311e5630cf91ee4c388eb53",class:"controls"},a("div",{key:"4d6a907defae65e3e71468227ff01bf378349325",class:"control"},a("span",{key:"859bf9965d4d4d666b191410269c8e4733abdc3b",class:"icon",innerHTML:'<svg width="31" height="29" viewBox="0 0 31 29" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_31553_1553)"><path d="M30.886 11.4917C30.8916 11.0917 30.753 10.7034 30.4962 10.3993C30.2394 10.0953 29.882 9.8964 29.4908 9.83995L29.5182 9.65005L29.4908 9.83995L21.0938 8.60261L17.3412 0.912551C17.2067 0.638179 16.9992 0.407285 16.7421 0.245866C16.485 0.0844465 16.1885 -0.00111389 15.886 -0.00111389C15.5835 -0.00111389 15.287 0.0844465 15.0299 0.245866C14.7728 0.407285 14.5653 0.638179 14.4308 0.912551L10.6781 8.60261L2.28121 9.8392C1.89206 9.89475 1.53611 10.0916 1.2796 10.3931C1.02308 10.6945 0.88348 11.08 0.886776 11.4779C0.886447 11.6961 0.929977 11.912 1.01472 12.1125C1.09946 12.3131 1.22363 12.4941 1.37968 12.6445L7.45563 18.5744L6.01943 27.0241C6.00289 27.1258 5.99449 27.2287 5.99435 27.3317C5.99313 27.7717 6.16395 28.1943 6.4695 28.5071C6.77505 28.82 7.19045 28.9976 7.62496 29.0013C7.88846 29.0008 8.14779 28.9345 8.37992 28.8083L15.8883 24.8217L23.3967 28.8114C23.6287 28.9361 23.8873 29.0015 24.15 29.002C24.5752 28.9998 24.9832 28.8318 25.2893 28.5329C25.4452 28.3832 25.5695 28.2029 25.6544 28.003C25.7392 27.8031 25.783 27.5878 25.783 27.3702C25.7827 27.2731 25.7743 27.176 25.7579 27.0803L24.3209 18.6296L30.3931 12.7022C30.7094 12.3809 30.8867 11.9454 30.886 11.4917ZM22.0759 17.53L21.9437 17.3916L22.0759 17.53C22.0072 17.5977 21.9525 17.6787 21.9152 17.7681C21.8779 17.8575 21.8587 17.9536 21.8587 18.0506L21.8693 18.1737L23.2037 26.0237L16.2164 22.3148C16.1136 22.2602 15.9994 22.2317 15.8833 22.2317C15.7673 22.2317 15.653 22.2602 15.5503 22.3148L8.57132 26.0245L9.90651 18.1745L9.91712 18.0506C9.91696 17.9536 9.89768 17.8576 9.86038 17.7682C9.82308 17.6788 9.76851 17.5978 9.6999 17.53L4.05538 11.9724L11.8576 10.8258C11.9725 10.8088 12.0816 10.7638 12.1755 10.6947C12.2695 10.6256 12.3454 10.5344 12.3969 10.429L15.886 3.27721L19.3797 10.429C19.4313 10.5344 19.5074 10.6256 19.6014 10.6948C19.6955 10.7639 19.8047 10.8088 19.9197 10.8258L27.7197 11.9747L22.0759 17.53Z" fill="#ADB6BD"/></g><defs><clipPath id="clip0_31553_1553"><rect width="30" height="29" fill="white" transform="translate(0.886719)"/></clipPath></defs></svg>'}),a("span",{key:"bb2aa5c6f908aad15c3ffaec48786bf32e4afafe",class:"value"},this.template.star_counter)),a("div",{key:"f908946f9052972407ec26065774aeffe86fd370",class:"control secondary"},a("span",{key:"8703c428b3154521c3156b32a95267fcda3a73ab",class:"icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"/></svg>'}),a("span",{key:"811320f402296ac578418a0ae4a6b0403455fadc",class:"value"},(null===(s=null===(t=null===(c=this.template)||void 0===c?void 0:c.documents)||void 0===t?void 0:t[0])||void 0===s?void 0:s.pages)||1)),a("div",{key:"3fdbd916fd49d41b9c8254d78bce60eff644d008",class:"control secondary"},a("span",{key:"5ca32fdaa0f2fb7ea7a093169d2abc4a531462e3",class:"icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>'}),a("span",{key:"0e37528844b8097102ecd8c5a48fa59efe8a6705",class:"value"},this.template.counter)),a("span",{key:"8877d1faf766e75f1198a5842cf97ec6be28fb6b",class:"additional-controls",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'})))}};c.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-card{font-family:"Inter", "Barlow", sans-serif;width:320px;height:320px;display:-ms-flexbox;display:flex;padding:25px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;-webkit-box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05);box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05)}verdocs-template-card .thumbnail{width:272px;height:158px;-o-object-fit:cover;object-fit:cover;margin-bottom:22px;-o-object-position:-20% 0;object-position:-20% 0}verdocs-template-card .name{font-size:18px;font-weight:700;margin-bottom:7px}verdocs-template-card .org-name{font-size:14px;font-weight:700;margin-bottom:6px}verdocs-template-card hr{width:100%;margin-bottom:17px;background-color:#aeb4bf}verdocs-template-card .controls{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;text-align:center;font-size:16px}verdocs-template-card .controls .control{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;margin-right:8px;-ms-flex-align:start;align-items:flex-start;border-right:1px solid #aeb4bf}verdocs-template-card .controls .control.secondary{-ms-flex-pack:center;justify-content:center}verdocs-template-card .controls .control svg{fill:#aeb4bf;height:16px;max-width:16px;margin:0 8px -2px 0}verdocs-template-card .additional-controls svg{margin-right:0;fill:#654dcb}';export{c as verdocs_template_card}
1
+ import{r as e,h as a,H as o}from"./p-5207d80c.js";const c=class{constructor(a){e(this,a),this.template=void 0}render(){var e,c,t,s;return a(o,{key:"5d51a6309b35282260e0b5a9accb65368f66e137"},a("span",{key:"5077d1f9917cd63eba77d19efa46854000d2285d",class:"name"},this.template.name),a("span",{key:"3dfe49dbf90de379d47e6a4b9b1583ac38ff4abd",class:"org-name"},(null===(e=this.template.organization)||void 0===e?void 0:e.name)||"Public"),a("hr",{key:"9cf9967baf829422608934bb3cdc44e872655b6a"}),a("div",{key:"a778ca45266cf6915903885658914388e2fb6482",class:"controls"},a("div",{key:"3ac820a94080adccf68076cfd2c5acf795ad7fc8",class:"control"},a("span",{key:"0f852a590b4ea1c7c523aa2d132de6a502ca64a3",class:"icon",innerHTML:'<svg width="31" height="29" viewBox="0 0 31 29" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_31553_1553)"><path d="M30.886 11.4917C30.8916 11.0917 30.753 10.7034 30.4962 10.3993C30.2394 10.0953 29.882 9.8964 29.4908 9.83995L29.5182 9.65005L29.4908 9.83995L21.0938 8.60261L17.3412 0.912551C17.2067 0.638179 16.9992 0.407285 16.7421 0.245866C16.485 0.0844465 16.1885 -0.00111389 15.886 -0.00111389C15.5835 -0.00111389 15.287 0.0844465 15.0299 0.245866C14.7728 0.407285 14.5653 0.638179 14.4308 0.912551L10.6781 8.60261L2.28121 9.8392C1.89206 9.89475 1.53611 10.0916 1.2796 10.3931C1.02308 10.6945 0.88348 11.08 0.886776 11.4779C0.886447 11.6961 0.929977 11.912 1.01472 12.1125C1.09946 12.3131 1.22363 12.4941 1.37968 12.6445L7.45563 18.5744L6.01943 27.0241C6.00289 27.1258 5.99449 27.2287 5.99435 27.3317C5.99313 27.7717 6.16395 28.1943 6.4695 28.5071C6.77505 28.82 7.19045 28.9976 7.62496 29.0013C7.88846 29.0008 8.14779 28.9345 8.37992 28.8083L15.8883 24.8217L23.3967 28.8114C23.6287 28.9361 23.8873 29.0015 24.15 29.002C24.5752 28.9998 24.9832 28.8318 25.2893 28.5329C25.4452 28.3832 25.5695 28.2029 25.6544 28.003C25.7392 27.8031 25.783 27.5878 25.783 27.3702C25.7827 27.2731 25.7743 27.176 25.7579 27.0803L24.3209 18.6296L30.3931 12.7022C30.7094 12.3809 30.8867 11.9454 30.886 11.4917ZM22.0759 17.53L21.9437 17.3916L22.0759 17.53C22.0072 17.5977 21.9525 17.6787 21.9152 17.7681C21.8779 17.8575 21.8587 17.9536 21.8587 18.0506L21.8693 18.1737L23.2037 26.0237L16.2164 22.3148C16.1136 22.2602 15.9994 22.2317 15.8833 22.2317C15.7673 22.2317 15.653 22.2602 15.5503 22.3148L8.57132 26.0245L9.90651 18.1745L9.91712 18.0506C9.91696 17.9536 9.89768 17.8576 9.86038 17.7682C9.82308 17.6788 9.76851 17.5978 9.6999 17.53L4.05538 11.9724L11.8576 10.8258C11.9725 10.8088 12.0816 10.7638 12.1755 10.6947C12.2695 10.6256 12.3454 10.5344 12.3969 10.429L15.886 3.27721L19.3797 10.429C19.4313 10.5344 19.5074 10.6256 19.6014 10.6948C19.6955 10.7639 19.8047 10.8088 19.9197 10.8258L27.7197 11.9747L22.0759 17.53Z" fill="#ADB6BD"/></g><defs><clipPath id="clip0_31553_1553"><rect width="30" height="29" fill="white" transform="translate(0.886719)"/></clipPath></defs></svg>'}),a("span",{key:"b6d8ff745a148d734a443d6975546018c38d720c",class:"value"},this.template.star_counter)),a("div",{key:"66ad10b503b311b1e474ac5a757eda68d7c14da9",class:"control secondary"},a("span",{key:"5a799e82a7e982a3878267ba7142968a9ae57ed9",class:"icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"/></svg>'}),a("span",{key:"786f8e6e4c7d8050754d4c4879b7eb16c0f8616b",class:"value"},(null===(s=null===(t=null===(c=this.template)||void 0===c?void 0:c.documents)||void 0===t?void 0:t[0])||void 0===s?void 0:s.pages)||1)),a("div",{key:"8beaba61ba61c3d65b3b7f3e8a353ac4e851eeae",class:"control secondary"},a("span",{key:"af4de26fb0adc0b3dce0dd902b770870a1aeae50",class:"icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6zm-2 0l-8 5-8-5h16zm0 12H4V8l8 5 8-5v10z"/></svg>'}),a("span",{key:"98e12c32e97de73267f511ea736a9bcb1d63d027",class:"value"},this.template.counter)),a("span",{key:"df0f16420601b26ff1263370b92335df3fe0e80f",class:"additional-controls",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'})))}};c.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-card{font-family:"Inter", "Barlow", sans-serif;width:320px;height:320px;display:-ms-flexbox;display:flex;padding:25px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;-webkit-box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05);box-shadow:2px 2px 5px rgba(51, 54, 75, 0.05)}verdocs-template-card .thumbnail{width:272px;height:158px;-o-object-fit:cover;object-fit:cover;margin-bottom:22px;-o-object-position:-20% 0;object-position:-20% 0}verdocs-template-card .name{font-size:18px;font-weight:700;margin-bottom:7px}verdocs-template-card .org-name{font-size:14px;font-weight:700;margin-bottom:6px}verdocs-template-card hr{width:100%;margin-bottom:17px;background-color:#aeb4bf}verdocs-template-card .controls{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-pack:justify;justify-content:space-between;text-align:center;font-size:16px}verdocs-template-card .controls .control{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;margin-right:8px;-ms-flex-align:start;align-items:flex-start;border-right:1px solid #aeb4bf}verdocs-template-card .controls .control.secondary{-ms-flex-pack:center;justify-content:center}verdocs-template-card .controls .control svg{fill:#aeb4bf;height:16px;max-width:16px;margin:0 8px -2px 0}verdocs-template-card .additional-controls svg{margin-right:0;fill:#654dcb}';export{c as verdocs_template_card}
@@ -0,0 +1 @@
1
+ import{r as e,h as t,H as o,c as i,g as s}from"./p-5207d80c.js";import{VerdocsEndpoint as r,updateField as l,deleteField as a}from"@verdocs/js-sdk";import{g as d,u as c}from"./p-784ac100.js";import{g as n}from"./p-9e371467.js";import{g as p}from"./p-1b0294d4.js";import{S as f}from"./p-fd97809c.js";import"./p-83317d11.js";import"./p-a706bac9.js";const h=class{constructor(t){e(this,t),this.checked=!1,this.name="",this.label="",this.value="",this.theme="light",this.disabled=!1}render(){return t(o,{key:"7557fbb5f4b2b7c2f73cb70e92c47f72082f7345",class:{disabled:this.disabled,[this.theme]:!0}},t("label",{key:"525745e68d4688a0249a06ad0f86127dc32d8985"},t("input",{key:"a96e6f0816efa3f4780883e525441413226b7cb2",type:"checkbox",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled}),t("span",{key:"b76e4c1b66f48792db9c75577cb23031ce1cf09f"},this.label)))}};h.style='@charset "UTF-8";@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-checkbox{line-height:18px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-checkbox label>input[type=checkbox]{display:none}verdocs-checkbox label>input[type=checkbox]+*::before{content:"";width:20px;height:20px;-ms-flex-negative:0;flex-shrink:0;margin-right:8px;line-height:20px;border-radius:2px;border-style:solid;border-width:0.1rem;display:inline-block;vertical-align:bottom;border-color:#aeb4bf}verdocs-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-checkbox.dark label>input[type=checkbox]+*::before{border-color:#ffffff}verdocs-checkbox.dark label>input[type=checkbox]:checked+*::before{background:#55bc81;border-color:#55bc81}';const b=class{constructor(t){e(this,t),this.message=""}render(){return t(o,{key:"f04b367fe3bba058c058c12214e49256397d1d0b"},t("div",{key:"79520ee8597e0ffa075834719355241389a933ef",class:"inner"},this.message))}};b.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-component-error{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-component-error .inner{-ms-flex:1;flex:1;height:300px;display:-ms-flexbox;display:flex;font-size:18px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px;background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}';const m=class{constructor(t){e(this,t),this.value="",this.label="",this.options=void 0,this.disabled=!1}render(){return t(o,{key:"f1582304d06ac080c2a84f42a26756ccd72b7223",class:"input-field"},t("label",{key:"d25d6b05d23c5b709faf58541885e813a44e6978"},this.label?t("div",{class:"input-label"},this.label+":"):t("div",null),t("select",{key:"7c4c518c6946d4e79d5c04f029703f6367cf1aa4",class:"input-element",disabled:this.disabled},this.options.map((e=>t("option",{value:e.value,selected:e.value===this.value},e.label))))))}};m.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-select-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;border:1px solid #cccccc;border-radius:4px;background:#ffffff;color:#092c4c;width:100%;font-size:16px;height:28px;padding:2px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';const u=e=>e.charAt(0).toUpperCase()+e.slice(1),x='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>',v='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>',g=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.delete=i(this,"delete",7),this.settingsChanged=i(this,"settingsChanged",7),this.sdkError=i(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=r.getDefault(),this.templateId="",this.fieldName="",this.helpText="",this.dirty=!1,this.loading=!0,this.label="",this.type="textbox",this.name="",this.required=!1,this.roleName="",this.group="",this.fieldType="",this.options=[],this.placeholder="",this.defaultValue="",this.showingHelp=!1}async componentWillLoad(){var e,t,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELD PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.fieldName)return void console.error("[FIELD PROPERTIES] Missing required field name");if(!this.endpoint.session)return void console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");this.templateStore=await p(this.endpoint,this.templateId),this.fieldStore=d(this.templateId),this.roleStore=n(this.templateId),this.resetForm()}catch(i){console.log("[FIELD PROPERTIES] Error loading template",i),this.loading=!1,null===(e=this.sdkError)||void 0===e||e.emit(new f(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(o=i.response)||void 0===o?void 0:o.data))}}resetForm(){const e=this.fieldStore.get("fields").find((e=>e.name===this.fieldName));e?(this.type=e.type,this.name=e.name,this.label=e.label,this.group=e.group,this.roleName=e.role_name,this.required=e.required,this.fieldType=e.type,this.options=e.options||[],this.placeholder=e.placeholder||"",this.defaultValue=e.default||"",this.dirty=!1,this.loading=!1,this.cleanupOptions()):console.log(`[FIELD PROPERTIES] Unable to find field "${this.fieldName}" in fields`)}handleCancel(e){var t,o;e.stopPropagation(),this.resetForm(),null===(t=this.close)||void 0===t||t.emit(),null===(o=document.getElementById("verdocs-template-field-properties"))||void 0===o||o.remove()}handleSave(e){e.stopPropagation();const t={name:this.name,role_name:this.roleName,required:this.required,label:this.label,group:this.group,placeholder:this.placeholder,default:this.defaultValue,options:this.options};this.cleanupOptions(),console.log("[FIELD PROPERTIES] Will update",this.fieldName,t),l(this.endpoint,this.templateId,this.fieldName,t).then((e=>{var t,o,i;console.log("[FIELD PROPERTIES] Updated",e),c(this.fieldStore,this.fieldName,e),null===(t=this.settingsChanged)||void 0===t||t.emit({fieldName:this.fieldName,field:e}),null===(o=this.close)||void 0===o||o.emit(),null===(i=document.getElementById("verdocs-template-field-properties"))||void 0===i||i.remove()})).catch((()=>{console.log("[FIELD PROPERTIES] Update failed",e)}))}async handleDelete(e){e.stopPropagation(),a(this.endpoint,this.templateId,this.fieldName).then((()=>{var e,t;this.fieldStore.set("fields",this.fieldStore.get("fields").filter((e=>e.name!==this.fieldName))),null===(e=this.delete)||void 0===e||e.emit({templateId:this.templateId,roleName:this.roleName}),null===(t=document.getElementById("verdocs-template-field-properties"))||void 0===t||t.remove()})).catch((e=>{console.log("[FIELD PROPERTIES] Deletion error",e)}))}cleanupOptions(){this.options=[...this.options.filter((e=>""!==(e.id||"").trim()||""!==(e.label||"").trim()))],this.options.find((e=>!e.id&&!e.label))||(this.options=[...this.options,{id:"",label:""}])}render(){var e;if(!this.endpoint.session)return t(o,null,t("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!this.endpoint.session||!this.fieldStore.get("fields").some((e=>e.name===this.fieldName)))return t(o,{class:"empty"});if(this.helpText&&this.showingHelp)return t(o,null,t("h6",null,u(this.fieldType)," Settings ",t("div",{style:{flex:"1"}}),t("div",{class:"help-icon",innerHTML:v,onClick:()=>this.showingHelp=!1})),t("p",{class:"instructions",innerHTML:this.helpText}));const i=this.options.filter((e=>""!==(e.id||"").trim()||""!==(e.label||"").trim())).length>0,s=!this.dirty||"dropdown"===this.type&&!i;return t(o,{id:"verdocs-template-field-properties"},t("h6",null,u(this.fieldType.replace(/_/g," "))," Settings ",t("div",{style:{flex:"1"}}),this.helpText&&t("div",{class:"help-icon",innerHTML:v,onClick:()=>this.showingHelp=!0})),t("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},t("div",{class:"row"},t("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}})),t("div",{class:"row"},t("verdocs-text-input",{id:"verdocs-field-label",label:"Optional Label",value:this.label,autocomplete:"off",placeholder:"Optional Label...",onInput:e=>{this.label=e.target.value,this.dirty=!0}})),t("div",{class:"row"},t("div",{class:"input-label"},"Role:"),t("verdocs-select-input",{value:this.roleName,options:null===(e=this.roleStore.state)||void 0===e?void 0:e.roles.map((e=>({label:e.name,value:e.name}))),onInput:e=>{this.roleName=e.target.value,this.dirty=!0}})),["textbox","textarea"].includes(this.type)&&t("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},t("verdocs-text-input",{id:"verdocs-field-value",label:"Default Value",value:this.defaultValue,autocomplete:"off",placeholder:"Pre-filled value...",onInput:e=>{this.defaultValue=e.target.value,this.dirty=!0}})),"radio"===this.type&&t("div",{class:"row"},t("verdocs-text-input",{id:"verdocs-field-label",label:"Group",value:this.group,autocomplete:"off",helpText:"Enable exclusive selections. Only one option within the same group may be selected at a time.",placeholder:"Group...",onInput:e=>{this.group=(e.target.value||"").trim().toLowerCase().replace(/[^a-z0-9]/g,""),this.dirty=!0}})),["textbox","textarea"].includes(this.type)&&t("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},t("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:e=>{this.placeholder=e.target.value,this.dirty=!0}})),t("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},t("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),t("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:e=>{this.required=e.target.checked,this.dirty=!0}})),"dropdown"===this.type&&t("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},t("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Options")),"dropdown"===this.type&&t("div",{class:"options"},t("div",{class:"options-header"},t("div",{class:"options-header-label"},"ID"),t("dev",{class:"options-header-label"},"Label")),this.options.map(((e,o)=>t("div",{class:"row option-row",key:o},t("verdocs-text-input",{value:e.id,placeholder:"Unique ID",onInput:e=>{this.options[o].id=e.target.value,this.dirty=!0,this.cleanupOptions()}}),t("verdocs-text-input",{value:e.label,placeholder:"Display label",onInput:e=>{this.options[o].label=e.target.value,this.dirty=!0,this.cleanupOptions()}}),t("button",{innerHTML:x,class:"remove-button",onClick:()=>{this.options=this.options.filter((t=>t.id!==e.id)),this.dirty=!0,this.cleanupOptions()}}))))),t("div",{class:"buttons"},t("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:x}),t("div",{style:{flex:"1"}}),t("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),t("verdocs-button",{size:"small",label:"Save",disabled:s,onClick:e=>!s&&this.handleSave(e)}))))}get el(){return s(this)}};g.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-field-properties{padding:20px;display:block;border-radius:4px;background:#ffffff;border:1px solid #ccc;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:2px 2px 10px 0 rgba(0, 0, 0, 0.1215686275);box-shadow:2px 2px 10px 0 rgba(0, 0, 0, 0.1215686275)}@media all and (max-width: 600px){verdocs-template-field-properties{padding:10px;-webkit-transform:scale(0.8);transform:scale(0.8)}}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .options-header{gap:10px;margin:0 0 5px 0;display:-ms-flexbox;display:flex;color:#ffffff;font-size:14px;padding:5px 8px;font-weight:700;text-align:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;background-color:#333333}verdocs-template-field-properties .options-header-label{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;font-weight:700;font-size:14px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:rgb(165, 0, 33)}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 1px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';export{h as verdocs_checkbox,b as verdocs_component_error,m as verdocs_select_input,g as verdocs_template_field_properties}
@@ -1 +1 @@
1
- import{r as e,h as t,H as o,c as i}from"./p-5207d80c.js";import{VerdocsEndpoint as s,updateTemplateRole as a,deleteTemplateRole as r,updateTemplate as d}from"@verdocs/js-sdk";import{g as l,u as n,d as c}from"./p-9e371467.js";import{g as b}from"./p-784ac100.js";import{g as p}from"./p-1b0294d4.js";import{S as f}from"./p-fd97809c.js";import"./p-83317d11.js";import"./p-a706bac9.js";const h=class{constructor(t){e(this,t),this.checked=!1,this.name="",this.value="",this.disabled=!1}render(){return t(o,{key:"b8dc5d8e34deeaf6d67f8b38bcf485a66e6fe8c8",class:{disabled:this.disabled}},t("input",{key:"5e03859b9d3082add93aeba0eb626d8f41988f1c",type:"radio",value:this.value,name:this.name,id:`verdocs-radio-button-${this.name}-${this.value}`,checked:this.checked,disabled:this.disabled}),t("label",{key:"4caa876b9138003b5ff7d576fdc32fcf62858bca",htmlFor:`verdocs-radio-button-${this.name}-${this.value}`}))}};h.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:20px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-radio-button.disabled{opacity:0.5}verdocs-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-radio-button input[type=radio]+label:before{content:"";background:#f5f5fa;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:16px;height:16px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-radio-button.hide{display:none}verdocs-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';const m=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.delete=i(this,"delete",7),this.sdkError=i(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=s.getDefault(),this.templateId="",this.roleName="",this.sender="everyone",this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.first_name="",this.last_name="",this.email="",this.phone="",this.delegator=!1}async componentWillLoad(){var e,t,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.templateStore=await p(this.endpoint,this.templateId,!1),this.fieldStore=b(this.templateId),this.roleStore=l(this.templateId);const e=this.roleStore.state.roles.find((e=>e.name===this.roleName));e&&(this.name=e.name,this.type=e.type,this.first_name=e.first_name,this.last_name=e.last_name,this.email=e.email,this.phone=e.phone,this.delegator=e.delegator,console.log("[ROLE_PROPERTIES] Editing role",e))}catch(i){console.log("[ROLE_PROPERTIES Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new f(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(o=i.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t;e.stopPropagation();const o=this.roleStore.state.roles.find((e=>e.name===this.roleName));o&&(this.name=o.name,this.type=o.type,this.first_name=o.first_name,this.last_name=o.last_name,this.email=o.email,this.phone=o.phone,this.delegator=o.delegator),this.dirty=!1,null===(t=this.close)||void 0===t||t.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,a(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,n(this.roleStore,this.roleName,e),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("[ROLE_PROPERTIES Update error",e),this.saving=!1}))}async handleDelete(e){e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&r(this.endpoint,this.templateId,this.roleName).then((()=>{var e;c(this.roleStore,this.roleName),null===(e=this.delete)||void 0===e||e.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("[ROLE_PROPERTIES Deletion error",e)}))}render(){const e=this.fieldStore.get("fields").some((e=>e.role_name===this.roleName));return t(o,{key:"e1713fef30610985e7b198413152ba998aa3d400"},t("div",{key:"89ea386f74975c52b86fd6c78984edd49837b2de",class:"background-overlay",onClick:e=>this.handleCancel(e)},t("div",{key:"5676470ae1372df1418d7bb2bec1b6f7e25b7939",class:"dialog"},t("form",{key:"33d2922247d3a510ae4425f028ac9a795efac654",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},t("verdocs-text-input",{key:"768bc89e775f2d5214fa80b092e1eeee5b113432",id:"verdocs-role-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Role Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),t("div",{key:"776217b83bd5a63075c71659b866fc66dfa2e7c6",class:"row"},t("div",{key:"4e279080306d686e92c8a8dc51eb81ee8791a01b",class:"input-label"},"Type:"),t("verdocs-select-input",{key:"3fe5574371f47d33996e811902c44e4144acc134",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),t("verdocs-help-icon",{key:"53165bb74f7ee07445abb8c123c9b4111f16d48e",text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),t("verdocs-text-input",{key:"6b7b54ba54e6282f5de0bcaf3e55a6144ea02a1e",id:"verdocs-recipient-first",label:"First Name",value:this.first_name,autocomplete:"off",helpText:"The recipient's first name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"First Name...",onInput:e=>{this.first_name=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{key:"f950aa5ca8c6d60f099910b1e51a79bc12552112",id:"verdocs-recipient-first",label:"Last Name",value:this.last_name,autocomplete:"off",helpText:"The recipient's last name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Last Name...",onInput:e=>{this.last_name=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{key:"304ed1bf5528a7db9103e1cef62af2628cb09dab",id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{key:"7d5fb7b56d99a09dc1f4e61744786f23a766a142",id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),t("div",{key:"fdcffc8bcdb934b850e691b9f133fb0f009546a6",class:"row"},t("div",{key:"84e445026a799bad4ed33a6e1c7f470f9269249c",class:"input-label"},"May Delegate:"),t("div",{key:"ba99473e1b59b0c7977061f5e52a6dbeb017106b",class:"checkbox-wrapper"},t("verdocs-checkbox",{key:"b7041e784c399da331820a6b6eaecf98716c91a5",checked:this.delegator,onInput:e=>{this.delegator=e.target.checked,this.dirty=!0}})),t("verdocs-help-icon",{key:"e814cd3a3f7cd8b2a3fbe1470b83f8546fbd794d",text:"If enabled, this recipient may delegate their actions to another individual."})),t("div",{key:"e56e3368bcb7fa24e7b5ff826afbed91694ab377",class:"buttons"},t("button",{key:"57973ea3a7326bd368d1e555575da5f0c6c083e2",class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>'}),t("div",{key:"bf8ed30bc50bedc68a98cbcc338b06fdb912e430",style:{flex:"1"}}),t("verdocs-button",{key:"bd09a8ad07eb043bccb32cee9d1ac5e5d90e1c6b",size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),t("verdocs-button",{key:"68d8ff732f3190ef20225c1f50a4ab6425dcad6c",size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))))))}};m.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const u=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.sdkError=i(this,"sdkError",7),this.store=null,this.endpoint=s.getDefault(),this.templateId="",this.sender="everyone",this.saving=!1}async componentWillLoad(){var e,t,o,i,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await p(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(o=this.sdkError)||void 0===o||o.emit(new f(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var o;console.log("Update result",t),(null===(o=this.store)||void 0===o?void 0:o.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return t(o,{key:"11d6c9e8b28b149150dc2c8247a9897af3c5be8f"},t("div",{key:"3aa4135a95fada5ef5ae8dbd6e1f4d5103e331ab",class:"background-overlay",onClick:e=>this.handleDismiss(e)},t("div",{key:"82604c1d23b8da0e977f335cc5e91d3f50cf8b9e",class:"dialog"},t("div",{key:"f4e75b7ce50372317d39f36896ffb41a1ab62bc4",class:"options"},t("div",{key:"e6a53f521720750d9308c6f86b7ec1ce3da5d6f5",class:"option"},t("verdocs-radio-button",{key:"71a5dee2cdd1714a24b693e43b09a09fb390127a",name:"template-sender",value:"everyone",checked:"everyone"===this.sender,onInput:()=>this.handleSelectSetting("everyone")}),t("div",{key:"96ec93e3673df83d059068a7e6b26c893344b0e1",class:"description"},t("div",{key:"f96bec057a8e3813eb5d995a2c3318831dc8833c",class:"name"},"Anyone on the Web"),t("verdocs-help-icon",{key:"936f9fc0cf13fda75dcd8ba5b7be130a7d509feb",text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),t("div",{key:"ffd734f9e6b150c8473c73c569f5344db01b33d1",class:"option"},t("verdocs-radio-button",{key:"44c89ee4fd83268addc932681bac9cc5e4265b11",name:"template-sender",value:"everyone_as_creator",checked:"everyone_as_creator"===this.sender,onInput:()=>this.handleSelectSetting("everyone_as_creator")}),t("div",{key:"ac2717cceef39304a7a9b3d5b6cdbd7bac459831",class:"description"},t("div",{key:"95f4a2acb38164158e6de9d7920046a66c9b3edd",class:"name"},"Anyone on the Web as me"),t("verdocs-help-icon",{key:"977e40893b6660ddbcd3c278e5ae54ca49d61a4d",text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),t("div",{key:"67362c118307c90e5fd40b10321b8875bd771040",class:"option"},t("verdocs-radio-button",{key:"d582a6659c8be50cd118690fc91fea18af8026d8",name:"template-sender",value:"organization_member",checked:"organization_member"===this.sender,onInput:()=>this.handleSelectSetting("organization_member")}),t("div",{key:"e18b002f29dd3dfdcbe742599bfdbd0a20f43697",class:"description"},t("div",{key:"ed4ce6c890aa51883ee72e0aff5b296128da1fd9",class:"name"},"Anyone in my organization"),t("verdocs-help-icon",{key:"82cc8a2ee2da32cda56555d4484bf94ce9e230ed",text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),t("div",{key:"c6ea6745540bea7d20196fc4d96590f334387333",class:"option"},t("verdocs-radio-button",{key:"5d941faac5fd0ab09ed531141ab049248de97afd",name:"template-sender",value:"organization_member_as_creator",checked:"organization_member_as_creator"===this.sender,onInput:()=>this.handleSelectSetting("organization_member_as_creator")}),t("div",{key:"a57cb28c9609a2d6d583b5fb7022866354b95bb2",class:"description"},t("div",{key:"33561830437d8f604c7cda519617b687b1588e65",class:"name"},"Anyone in my organization as me"),t("verdocs-help-icon",{key:"65557a2d57bc56c248f13d1b4d1d72305728fb8c",text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),t("div",{key:"f6e19ddf05d5468b226a2767e05bdd83efe66e06",class:"option"},t("verdocs-radio-button",{key:"2d82a2104f9f5c209f560144b8fc6c28b3675889",name:"template-sender",value:"creator",checked:"creator"===this.sender,onInput:()=>this.handleSelectSetting("creator")}),t("div",{key:"8afe677cfca3535e2e372af8a227c91b880af4e4",class:"description"},t("div",{key:"d628e15e4223cae86a4152063b91a055b441328b",class:"name"},"Me"),t("verdocs-help-icon",{key:"d85b39030f38b05d2a8053950d64a00383a28ca6",text:"Only I can use this template."})))),t("div",{key:"575bdb57d53dac18f852f5f79c370cd186550402",class:"buttons"},t("verdocs-button",{key:"44f30d116ebfd5618b818b1170881566fadd1e68",label:"Close",onClick:()=>this.handleClose()})))))}};u.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{h as verdocs_radio_button,m as verdocs_template_role_properties,u as verdocs_template_sender}
1
+ import{r as e,h as t,H as o,c as i}from"./p-5207d80c.js";import{VerdocsEndpoint as s,updateTemplateRole as a,deleteTemplateRole as r,updateTemplate as d}from"@verdocs/js-sdk";import{g as l,u as n,d as c}from"./p-9e371467.js";import{g as b}from"./p-784ac100.js";import{g as p}from"./p-1b0294d4.js";import{S as f}from"./p-fd97809c.js";import"./p-83317d11.js";import"./p-a706bac9.js";const h=class{constructor(t){e(this,t),this.checked=!1,this.name="",this.value="",this.disabled=!1}render(){return t(o,{key:"b8dc5d8e34deeaf6d67f8b38bcf485a66e6fe8c8",class:{disabled:this.disabled}},t("input",{key:"5e03859b9d3082add93aeba0eb626d8f41988f1c",type:"radio",value:this.value,name:this.name,id:`verdocs-radio-button-${this.name}-${this.value}`,checked:this.checked,disabled:this.disabled}),t("label",{key:"4caa876b9138003b5ff7d576fdc32fcf62858bca",htmlFor:`verdocs-radio-button-${this.name}-${this.value}`}))}};h.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:20px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-radio-button.disabled{opacity:0.5}verdocs-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-radio-button input[type=radio]+label:before{content:"";background:#f5f5fa;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:16px;height:16px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-radio-button.hide{display:none}verdocs-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';const m=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.delete=i(this,"delete",7),this.sdkError=i(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=s.getDefault(),this.templateId="",this.roleName="",this.sender="everyone",this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.first_name="",this.last_name="",this.email="",this.phone="",this.delegator=!1}async componentWillLoad(){var e,t,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.templateStore=await p(this.endpoint,this.templateId,!1),this.fieldStore=b(this.templateId),this.roleStore=l(this.templateId);const e=this.roleStore.state.roles.find((e=>e.name===this.roleName));e&&(this.name=e.name,this.type=e.type,this.first_name=e.first_name,this.last_name=e.last_name,this.email=e.email,this.phone=e.phone,this.delegator=e.delegator,console.log("[ROLE_PROPERTIES] Editing role",e))}catch(i){console.log("[ROLE_PROPERTIES Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new f(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(o=i.response)||void 0===o?void 0:o.data))}}handleCancel(e){var t;e.stopPropagation();const o=this.roleStore.state.roles.find((e=>e.name===this.roleName));o&&(this.name=o.name,this.type=o.type,this.first_name=o.first_name,this.last_name=o.last_name,this.email=o.email,this.phone=o.phone,this.delegator=o.delegator),this.dirty=!1,null===(t=this.close)||void 0===t||t.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,a(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,n(this.roleStore,this.roleName,e),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("[ROLE_PROPERTIES Update error",e),this.saving=!1}))}async handleDelete(e){e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&r(this.endpoint,this.templateId,this.roleName).then((()=>{var e;c(this.roleStore,this.roleName),null===(e=this.delete)||void 0===e||e.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("[ROLE_PROPERTIES Deletion error",e)}))}render(){const e=this.fieldStore.get("fields").some((e=>e.role_name===this.roleName));return t(o,{key:"2344ca9e482f0a9e3d45226dcf60f3082f0b262a"},t("div",{key:"7f59190bffce63910b4ac8bbf3c18871ec7e07a5",class:"background-overlay",onClick:e=>this.handleCancel(e)},t("div",{key:"468001c9b9bdc563826173f96e5222a616f6f340",class:"dialog"},t("form",{key:"e4ff405dad0f312bf121e73aa9c6a6f6b937b768",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},t("verdocs-text-input",{key:"612dc771f957602284f24fa47b6a140ba02a0f56",id:"verdocs-role-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Role Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),t("div",{key:"f3b5472084032d07ec4b5fe6c83250bc93a2e99b",class:"row"},t("div",{key:"d13db6776d097fdc8594f127b0ce7a5f82b0d346",class:"input-label"},"Type:"),t("verdocs-select-input",{key:"35d3c3dfc5b07c8ba4e58a56bb20242b2893080c",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),t("verdocs-help-icon",{key:"e4f59b8e5afa43bf495985fbe890dbf782607afe",text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),t("verdocs-text-input",{key:"90a869359264a8add5c1b75f90ef827bde176c18",id:"verdocs-recipient-first",label:"First Name",value:this.first_name,autocomplete:"off",helpText:"The recipient's first name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"First Name...",onInput:e=>{this.first_name=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{key:"0290e4e4965c894a5171dc525c807b6ed79e8509",id:"verdocs-recipient-first",label:"Last Name",value:this.last_name,autocomplete:"off",helpText:"The recipient's last name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Last Name...",onInput:e=>{this.last_name=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{key:"9c0b81fe916d053f342b9864a003cee504ef8e28",id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),t("verdocs-text-input",{key:"e31ba5928aa9fa5cf294c583381c5a2c45fbe697",id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),t("div",{key:"de4d2996f7558203a157de4089bd08b03e3ccb4c",class:"row"},t("div",{key:"5204416e20532f20e7b8800da46af1a819262d47",class:"input-label"},"May Delegate:"),t("div",{key:"ea93e1f42e9748aad209a71de59648234c577a72",class:"checkbox-wrapper"},t("verdocs-checkbox",{key:"55a7d77e35c16bf3f669b62adffac9df4b57462e",checked:this.delegator,onInput:e=>{this.delegator=e.target.checked,this.dirty=!0}})),t("verdocs-help-icon",{key:"c10dd23ca7b7e47f836dd3839e5749a3c0c76794",text:"If enabled, this recipient may delegate their actions to another individual."})),t("div",{key:"8e2c8d88f213aca0d30dfdb3880b634d878a327e",class:"buttons"},t("button",{key:"68fc1d701b0519694fecf129ac40ea02bd2a3c5c",class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>'}),t("div",{key:"1c0f4b7f56d564c304cf728d1cc74c10cdb6a452",style:{flex:"1"}}),t("verdocs-button",{key:"cb4e24c4b49c1505da07b6341229b60e6cd33371",size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),t("verdocs-button",{key:"4a170cf772986625008e3550ba167db69d523baa",size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))))))}};m.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const u=class{constructor(t){e(this,t),this.close=i(this,"close",7),this.sdkError=i(this,"sdkError",7),this.store=null,this.endpoint=s.getDefault(),this.templateId="",this.sender="everyone",this.saving=!1}async componentWillLoad(){var e,t,o,i,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await p(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(o=this.sdkError)||void 0===o||o.emit(new f(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var o;console.log("Update result",t),(null===(o=this.store)||void 0===o?void 0:o.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return t(o,{key:"f9ebeecc2d0d2467718e1c54161fd8eee32ba5f6"},t("div",{key:"efc13020bd5674c874707cefea2384b52521a85f",class:"background-overlay",onClick:e=>this.handleDismiss(e)},t("div",{key:"3c85258b0ea837e4e78ad16eb6cec93cffa6e629",class:"dialog"},t("div",{key:"46a6eb1bed8de495d834faa73e48547a891aa00e",class:"options"},t("div",{key:"9425750a4508f6a6c176f0ee88a1674aceec8475",class:"option"},t("verdocs-radio-button",{key:"65d2059bb0b433e1b95a55273ad7a7ca4734ce51",name:"template-sender",value:"everyone",checked:"everyone"===this.sender,onInput:()=>this.handleSelectSetting("everyone")}),t("div",{key:"119b053c18bffd95451eed224132d1592ccf6004",class:"description"},t("div",{key:"c4a3fac447abea997dec0906221df87cc9014e4b",class:"name"},"Anyone on the Web"),t("verdocs-help-icon",{key:"1e8e078477cdd86100e3b73e275e856449eb84ee",text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),t("div",{key:"b91f257e6a6c702f2fa0ee147dda5642b6ff514a",class:"option"},t("verdocs-radio-button",{key:"00a900ef8a3a1e9cb7ca8e1de93bf3528f78b32d",name:"template-sender",value:"everyone_as_creator",checked:"everyone_as_creator"===this.sender,onInput:()=>this.handleSelectSetting("everyone_as_creator")}),t("div",{key:"f767a5d108262e22fb3f0936379f6b84481801ad",class:"description"},t("div",{key:"59f6f409b9f51a2ab597241a4052191e46a4d5c1",class:"name"},"Anyone on the Web as me"),t("verdocs-help-icon",{key:"0b90c72573e4b75c3294e8f95a709ee0559bdbef",text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),t("div",{key:"afd67488f38d33075a454476be475cd7801c4ed3",class:"option"},t("verdocs-radio-button",{key:"8c09dc41fbb371c3380a2ddf06a806a131aef8b6",name:"template-sender",value:"organization_member",checked:"organization_member"===this.sender,onInput:()=>this.handleSelectSetting("organization_member")}),t("div",{key:"caf2a20f93130262b878e9df13e0e569aacffb9c",class:"description"},t("div",{key:"430ccbe92e4b39a789d215886e9ecbfed0c30f3e",class:"name"},"Anyone in my organization"),t("verdocs-help-icon",{key:"21a2cec2a249f6e4d6f486f501a813e10bdd1497",text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),t("div",{key:"a48b2814e9b04e09f6661a754b52e739d0566200",class:"option"},t("verdocs-radio-button",{key:"e3f9885aa8215f79686555a1fb85c5b87aa4aa03",name:"template-sender",value:"organization_member_as_creator",checked:"organization_member_as_creator"===this.sender,onInput:()=>this.handleSelectSetting("organization_member_as_creator")}),t("div",{key:"99ea5cdc2c55b0e73d092a1df4fc728f30810059",class:"description"},t("div",{key:"79109d8cc3845c287fbffdd017695139cfb1a16f",class:"name"},"Anyone in my organization as me"),t("verdocs-help-icon",{key:"b093f771c7cf119cbf27c404562bf5029664bb1b",text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),t("div",{key:"1a250fdd2b385e70d27f0fb6895a5b673c24e655",class:"option"},t("verdocs-radio-button",{key:"526a88e4e339932623183ec5fa9218adcbb5d832",name:"template-sender",value:"creator",checked:"creator"===this.sender,onInput:()=>this.handleSelectSetting("creator")}),t("div",{key:"94a699f6c4c430cbd3e221c6baf4972ec188260f",class:"description"},t("div",{key:"b2c16bda7146c436cd90d919e7c7a7d912c90809",class:"name"},"Me"),t("verdocs-help-icon",{key:"360ad19358fd4ce6a6f8e3e3e47bb0ff0da18d37",text:"Only I can use this template."})))),t("div",{key:"059e9ebf124ffcd2d45ea4316d1fdd49c4ec36ae",class:"buttons"},t("verdocs-button",{key:"b0a0a519eb6b713fa334065de19021369e20ee0b",label:"Close",onClick:()=>this.handleClose()})))))}};u.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{h as verdocs_radio_button,m as verdocs_template_role_properties,u as verdocs_template_sender}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function n(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o["throw"](e))}catch(e){a(e)}}function c(e){e.done?i(e.value):r(e.value).then(n,s)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return c([e,t])}}function c(s){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(i=0)),i)try{if(o=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];r=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-59073837.system.js","@verdocs/js-sdk","./p-701b9cbd.system.js","./p-38c6897c.system.js","./p-1a663adf.system.js","./p-c8a15cb7.system.js","./p-38778553.system.js","./p-f5064e0c.system.js"],(function(e){"use strict";var t,i,o,r,a,n,s,c,d,l,f,b,u,p;return{setters:[function(e){t=e.r;i=e.h;o=e.H;r=e.c},function(e){a=e.VerdocsEndpoint;n=e.updateTemplateRole;s=e.deleteTemplateRole;c=e.updateTemplate},function(e){d=e.g;l=e.u;f=e.d},function(e){b=e.g},function(e){u=e.g},function(e){p=e.S},function(){},function(){}],execute:function(){var h='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:20px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-radio-button.disabled{opacity:0.5}verdocs-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-radio-button input[type=radio]+label:before{content:"";background:#f5f5fa;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:16px;height:16px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-radio-button.hide{display:none}verdocs-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';var v=h;var m=e("verdocs_radio_button",function(){function e(e){t(this,e);this.checked=false;this.name="";this.value="";this.disabled=false}e.prototype.render=function(){return i(o,{key:"b8dc5d8e34deeaf6d67f8b38bcf485a66e6fe8c8",class:{disabled:this.disabled}},i("input",{key:"5e03859b9d3082add93aeba0eb626d8f41988f1c",type:"radio",value:this.value,name:this.name,id:"verdocs-radio-button-".concat(this.name,"-").concat(this.value),checked:this.checked,disabled:this.disabled}),i("label",{key:"4caa876b9138003b5ff7d576fdc32fcf62858bca",htmlFor:"verdocs-radio-button-".concat(this.name,"-").concat(this.value)}))};return e}());m.style=v;var x='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';var y=x;var g='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var k=e("verdocs_template_role_properties",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.delete=r(this,"delete",7);this.sdkError=r(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=a.getDefault();this.templateId="";this.roleName="";this.sender="everyone";this.dirty=false;this.saving=false;this.name="";this.type="signer";this.first_name="";this.last_name="";this.email="";this.phone="";this.delegator=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,a;var n=this;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLE_PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");return[2]}o=this;return[4,u(this.endpoint,this.templateId,false)];case 1:o.templateStore=s.sent();this.fieldStore=b(this.templateId);this.roleStore=d(this.templateId);r=this.roleStore.state.roles.find((function(e){return e.name===n.roleName}));if(r){this.name=r.name;this.type=r.type;this.first_name=r.first_name;this.last_name=r.last_name;this.email=r.email;this.phone=r.phone;this.delegator=r.delegator;console.log("[ROLE_PROPERTIES] Editing role",r)}return[3,3];case 2:a=s.sent();console.log("[ROLE_PROPERTIES Error with preview session",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new p(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(i=a.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var i;e.stopPropagation();var o=this.roleStore.state.roles.find((function(e){return e.name===t.roleName}));if(o){this.name=o.name;this.type=o.type;this.first_name=o.first_name;this.last_name=o.last_name;this.email=o.email;this.phone=o.phone;this.delegator=o.delegator}this.dirty=false;(i=this.close)===null||i===void 0?void 0:i.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){e.stopPropagation();this.saving=true;n(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(i){console.log("[ROLE_PROPERTIES] Update result",e);this.saving=false;this.dirty=false;l(this.roleStore,this.roleName,e);(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}))}))})).catch((function(e){console.log("[ROLE_PROPERTIES Update error",e);t.saving=false}));return[2]}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")){s(this.endpoint,this.templateId,this.roleName).then((function(){var e;f(t.roleStore,t.roleName);(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("[ROLE_PROPERTIES Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.fieldStore.get("fields").some((function(t){return t.role_name===e.roleName}));return i(o,{key:"e1713fef30610985e7b198413152ba998aa3d400"},i("div",{key:"89ea386f74975c52b86fd6c78984edd49837b2de",class:"background-overlay",onClick:function(t){return e.handleCancel(t)}},i("div",{key:"5676470ae1372df1418d7bb2bec1b6f7e25b7939",class:"dialog"},i("form",{key:"33d2922247d3a510ae4425f028ac9a795efac654",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("verdocs-text-input",{key:"768bc89e775f2d5214fa80b092e1eeee5b113432",id:"verdocs-role-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:t,helpText:t?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Role Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),i("div",{key:"776217b83bd5a63075c71659b866fc66dfa2e7c6",class:"row"},i("div",{key:"4e279080306d686e92c8a8dc51eb81ee8791a01b",class:"input-label"},"Type:"),i("verdocs-select-input",{key:"3fe5574371f47d33996e811902c44e4144acc134",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:function(t){e.type=t.target.value;e.dirty=true}}),i("verdocs-help-icon",{key:"53165bb74f7ee07445abb8c123c9b4111f16d48e",text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{key:"6b7b54ba54e6282f5de0bcaf3e55a6144ea02a1e",id:"verdocs-recipient-first",label:"First Name",value:this.first_name,autocomplete:"off",helpText:"The recipient's first name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"First Name...",onInput:function(t){e.first_name=t.target.value;e.dirty=true}}),i("verdocs-text-input",{key:"f950aa5ca8c6d60f099910b1e51a79bc12552112",id:"verdocs-recipient-first",label:"Last Name",value:this.last_name,autocomplete:"off",helpText:"The recipient's last name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Last Name...",onInput:function(t){e.last_name=t.target.value;e.dirty=true}}),i("verdocs-text-input",{key:"304ed1bf5528a7db9103e1cef62af2628cb09dab",id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:function(t){e.email=t.target.value;e.dirty=true}}),i("verdocs-text-input",{key:"7d5fb7b56d99a09dc1f4e61744786f23a766a142",id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:function(t){e.phone=t.target.value;e.dirty=true}}),i("div",{key:"fdcffc8bcdb934b850e691b9f133fb0f009546a6",class:"row"},i("div",{key:"84e445026a799bad4ed33a6e1c7f470f9269249c",class:"input-label"},"May Delegate:"),i("div",{key:"ba99473e1b59b0c7977061f5e52a6dbeb017106b",class:"checkbox-wrapper"},i("verdocs-checkbox",{key:"b7041e784c399da331820a6b6eaecf98716c91a5",checked:this.delegator,onInput:function(t){e.delegator=t.target.checked;e.dirty=true}})),i("verdocs-help-icon",{key:"e814cd3a3f7cd8b2a3fbe1470b83f8546fbd794d",text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{key:"e56e3368bcb7fa24e7b5ff826afbed91694ab377",class:"buttons"},i("button",{key:"57973ea3a7326bd368d1e555575da5f0c6c083e2",class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:g}),i("div",{key:"bf8ed30bc50bedc68a98cbcc338b06fdb912e430",style:{flex:"1"}}),i("verdocs-button",{key:"bd09a8ad07eb043bccb32cee9d1ac5e5d90e1c6b",size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{key:"68d8ff732f3190ef20225c1f50a4ab6425dcad6c",size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))))};return e}());k.style=y;var w='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';var _=w;var E=e("verdocs_template_sender",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.sdkError=r(this,"sdkError",7);this.store=null;this.endpoint=a.getDefault();this.templateId="";this.sender="everyone";this.saving=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,a,n;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[SENDER] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SENDER] Unable to start builder session, must be authenticated");return[2]}a=this;return[4,u(this.endpoint,this.templateId,false)];case 1:a.store=s.sent();this.sender=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.sender;return[3,3];case 2:n=s.sent();console.log("[SENDER] Error with preview session",n);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new p(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleClose=function(){this.close.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleClose()}};e.prototype.handleSelectSetting=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.saving=true;c(this.endpoint,this.templateId,{sender:e}).then((function(i){var o;console.log("Update result",i);if((o=t.store)===null||o===void 0?void 0:o.state){t.store.state.sender=e}t.saving=false;t.sender=e})).catch((function(e){console.log("Error saving",e);t.saving=false}));return[2]}))}))};e.prototype.render=function(){var e=this;return i(o,{key:"11d6c9e8b28b149150dc2c8247a9897af3c5be8f"},i("div",{key:"3aa4135a95fada5ef5ae8dbd6e1f4d5103e331ab",class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},i("div",{key:"82604c1d23b8da0e977f335cc5e91d3f50cf8b9e",class:"dialog"},i("div",{key:"f4e75b7ce50372317d39f36896ffb41a1ab62bc4",class:"options"},i("div",{key:"e6a53f521720750d9308c6f86b7ec1ce3da5d6f5",class:"option"},i("verdocs-radio-button",{key:"71a5dee2cdd1714a24b693e43b09a09fb390127a",name:"template-sender",value:"everyone",checked:this.sender==="everyone",onInput:function(){return e.handleSelectSetting("everyone")}}),i("div",{key:"96ec93e3673df83d059068a7e6b26c893344b0e1",class:"description"},i("div",{key:"f96bec057a8e3813eb5d995a2c3318831dc8833c",class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{key:"936f9fc0cf13fda75dcd8ba5b7be130a7d509feb",text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{key:"ffd734f9e6b150c8473c73c569f5344db01b33d1",class:"option"},i("verdocs-radio-button",{key:"44c89ee4fd83268addc932681bac9cc5e4265b11",name:"template-sender",value:"everyone_as_creator",checked:this.sender==="everyone_as_creator",onInput:function(){return e.handleSelectSetting("everyone_as_creator")}}),i("div",{key:"ac2717cceef39304a7a9b3d5b6cdbd7bac459831",class:"description"},i("div",{key:"95f4a2acb38164158e6de9d7920046a66c9b3edd",class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{key:"977e40893b6660ddbcd3c278e5ae54ca49d61a4d",text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{key:"67362c118307c90e5fd40b10321b8875bd771040",class:"option"},i("verdocs-radio-button",{key:"d582a6659c8be50cd118690fc91fea18af8026d8",name:"template-sender",value:"organization_member",checked:this.sender==="organization_member",onInput:function(){return e.handleSelectSetting("organization_member")}}),i("div",{key:"e18b002f29dd3dfdcbe742599bfdbd0a20f43697",class:"description"},i("div",{key:"ed4ce6c890aa51883ee72e0aff5b296128da1fd9",class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{key:"82cc8a2ee2da32cda56555d4484bf94ce9e230ed",text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{key:"c6ea6745540bea7d20196fc4d96590f334387333",class:"option"},i("verdocs-radio-button",{key:"5d941faac5fd0ab09ed531141ab049248de97afd",name:"template-sender",value:"organization_member_as_creator",checked:this.sender==="organization_member_as_creator",onInput:function(){return e.handleSelectSetting("organization_member_as_creator")}}),i("div",{key:"a57cb28c9609a2d6d583b5fb7022866354b95bb2",class:"description"},i("div",{key:"33561830437d8f604c7cda519617b687b1588e65",class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{key:"65557a2d57bc56c248f13d1b4d1d72305728fb8c",text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{key:"f6e19ddf05d5468b226a2767e05bdd83efe66e06",class:"option"},i("verdocs-radio-button",{key:"2d82a2104f9f5c209f560144b8fc6c28b3675889",name:"template-sender",value:"creator",checked:this.sender==="creator",onInput:function(){return e.handleSelectSetting("creator")}}),i("div",{key:"8afe677cfca3535e2e372af8a227c91b880af4e4",class:"description"},i("div",{key:"d628e15e4223cae86a4152063b91a055b441328b",class:"name"},"Me"),i("verdocs-help-icon",{key:"d85b39030f38b05d2a8053950d64a00383a28ca6",text:"Only I can use this template."})))),i("div",{key:"575bdb57d53dac18f852f5f79c370cd186550402",class:"buttons"},i("verdocs-button",{key:"44f30d116ebfd5618b818b1170881566fadd1e68",label:"Close",onClick:function(){return e.handleClose()}})))))};return e}());E.style=_}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function n(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o["throw"](e))}catch(e){a(e)}}function c(e){e.done?i(e.value):r(e.value).then(n,s)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,r,a,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return c([e,t])}}function c(s){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(i=0)),i)try{if(o=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e];r=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-59073837.system.js","@verdocs/js-sdk","./p-701b9cbd.system.js","./p-38c6897c.system.js","./p-1a663adf.system.js","./p-c8a15cb7.system.js","./p-38778553.system.js","./p-f5064e0c.system.js"],(function(e){"use strict";var t,i,o,r,a,n,s,c,l,d,f,b,u,p;return{setters:[function(e){t=e.r;i=e.h;o=e.H;r=e.c},function(e){a=e.VerdocsEndpoint;n=e.updateTemplateRole;s=e.deleteTemplateRole;c=e.updateTemplate},function(e){l=e.g;d=e.u;f=e.d},function(e){b=e.g},function(e){u=e.g},function(e){p=e.S},function(){},function(){}],execute:function(){var h='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:20px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-radio-button.disabled{opacity:0.5}verdocs-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-radio-button input[type=radio]+label:before{content:"";background:#f5f5fa;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:16px;height:16px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-radio-button.hide{display:none}verdocs-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';var v=h;var m=e("verdocs_radio_button",function(){function e(e){t(this,e);this.checked=false;this.name="";this.value="";this.disabled=false}e.prototype.render=function(){return i(o,{key:"b8dc5d8e34deeaf6d67f8b38bcf485a66e6fe8c8",class:{disabled:this.disabled}},i("input",{key:"5e03859b9d3082add93aeba0eb626d8f41988f1c",type:"radio",value:this.value,name:this.name,id:"verdocs-radio-button-".concat(this.name,"-").concat(this.value),checked:this.checked,disabled:this.disabled}),i("label",{key:"4caa876b9138003b5ff7d576fdc32fcf62858bca",htmlFor:"verdocs-radio-button-".concat(this.name,"-").concat(this.value)}))};return e}());m.style=v;var x='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';var y=x;var g='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var k=e("verdocs_template_role_properties",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.delete=r(this,"delete",7);this.sdkError=r(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=a.getDefault();this.templateId="";this.roleName="";this.sender="everyone";this.dirty=false;this.saving=false;this.name="";this.type="signer";this.first_name="";this.last_name="";this.email="";this.phone="";this.delegator=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,a;var n=this;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLE_PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");return[2]}o=this;return[4,u(this.endpoint,this.templateId,false)];case 1:o.templateStore=s.sent();this.fieldStore=b(this.templateId);this.roleStore=l(this.templateId);r=this.roleStore.state.roles.find((function(e){return e.name===n.roleName}));if(r){this.name=r.name;this.type=r.type;this.first_name=r.first_name;this.last_name=r.last_name;this.email=r.email;this.phone=r.phone;this.delegator=r.delegator;console.log("[ROLE_PROPERTIES] Editing role",r)}return[3,3];case 2:a=s.sent();console.log("[ROLE_PROPERTIES Error with preview session",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new p(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(i=a.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var i;e.stopPropagation();var o=this.roleStore.state.roles.find((function(e){return e.name===t.roleName}));if(o){this.name=o.name;this.type=o.type;this.first_name=o.first_name;this.last_name=o.last_name;this.email=o.email;this.phone=o.phone;this.delegator=o.delegator}this.dirty=false;(i=this.close)===null||i===void 0?void 0:i.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){e.stopPropagation();this.saving=true;n(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(i){console.log("[ROLE_PROPERTIES] Update result",e);this.saving=false;this.dirty=false;d(this.roleStore,this.roleName,e);(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}))}))})).catch((function(e){console.log("[ROLE_PROPERTIES Update error",e);t.saving=false}));return[2]}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")){s(this.endpoint,this.templateId,this.roleName).then((function(){var e;f(t.roleStore,t.roleName);(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("[ROLE_PROPERTIES Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.fieldStore.get("fields").some((function(t){return t.role_name===e.roleName}));return i(o,{key:"2344ca9e482f0a9e3d45226dcf60f3082f0b262a"},i("div",{key:"7f59190bffce63910b4ac8bbf3c18871ec7e07a5",class:"background-overlay",onClick:function(t){return e.handleCancel(t)}},i("div",{key:"468001c9b9bdc563826173f96e5222a616f6f340",class:"dialog"},i("form",{key:"e4ff405dad0f312bf121e73aa9c6a6f6b937b768",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("verdocs-text-input",{key:"612dc771f957602284f24fa47b6a140ba02a0f56",id:"verdocs-role-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:t,helpText:t?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Role Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),i("div",{key:"f3b5472084032d07ec4b5fe6c83250bc93a2e99b",class:"row"},i("div",{key:"d13db6776d097fdc8594f127b0ce7a5f82b0d346",class:"input-label"},"Type:"),i("verdocs-select-input",{key:"35d3c3dfc5b07c8ba4e58a56bb20242b2893080c",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:function(t){e.type=t.target.value;e.dirty=true}}),i("verdocs-help-icon",{key:"e4f59b8e5afa43bf495985fbe890dbf782607afe",text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{key:"90a869359264a8add5c1b75f90ef827bde176c18",id:"verdocs-recipient-first",label:"First Name",value:this.first_name,autocomplete:"off",helpText:"The recipient's first name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"First Name...",onInput:function(t){e.first_name=t.target.value;e.dirty=true}}),i("verdocs-text-input",{key:"0290e4e4965c894a5171dc525c807b6ed79e8509",id:"verdocs-recipient-first",label:"Last Name",value:this.last_name,autocomplete:"off",helpText:"The recipient's last name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Last Name...",onInput:function(t){e.last_name=t.target.value;e.dirty=true}}),i("verdocs-text-input",{key:"9c0b81fe916d053f342b9864a003cee504ef8e28",id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:function(t){e.email=t.target.value;e.dirty=true}}),i("verdocs-text-input",{key:"e31ba5928aa9fa5cf294c583381c5a2c45fbe697",id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:function(t){e.phone=t.target.value;e.dirty=true}}),i("div",{key:"de4d2996f7558203a157de4089bd08b03e3ccb4c",class:"row"},i("div",{key:"5204416e20532f20e7b8800da46af1a819262d47",class:"input-label"},"May Delegate:"),i("div",{key:"ea93e1f42e9748aad209a71de59648234c577a72",class:"checkbox-wrapper"},i("verdocs-checkbox",{key:"55a7d77e35c16bf3f669b62adffac9df4b57462e",checked:this.delegator,onInput:function(t){e.delegator=t.target.checked;e.dirty=true}})),i("verdocs-help-icon",{key:"c10dd23ca7b7e47f836dd3839e5749a3c0c76794",text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{key:"8e2c8d88f213aca0d30dfdb3880b634d878a327e",class:"buttons"},i("button",{key:"68fc1d701b0519694fecf129ac40ea02bd2a3c5c",class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:g}),i("div",{key:"1c0f4b7f56d564c304cf728d1cc74c10cdb6a452",style:{flex:"1"}}),i("verdocs-button",{key:"cb4e24c4b49c1505da07b6341229b60e6cd33371",size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{key:"4a170cf772986625008e3550ba167db69d523baa",size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))))};return e}());k.style=y;var w='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';var _=w;var E=e("verdocs_template_sender",function(){function e(e){t(this,e);this.close=r(this,"close",7);this.sdkError=r(this,"sdkError",7);this.store=null;this.endpoint=a.getDefault();this.templateId="";this.sender="everyone";this.saving=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,r,a,n;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[SENDER] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SENDER] Unable to start builder session, must be authenticated");return[2]}a=this;return[4,u(this.endpoint,this.templateId,false)];case 1:a.store=s.sent();this.sender=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.sender;return[3,3];case 2:n=s.sent();console.log("[SENDER] Error with preview session",n);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new p(n.message,(o=n.response)===null||o===void 0?void 0:o.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleClose=function(){this.close.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleClose()}};e.prototype.handleSelectSetting=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(i){this.saving=true;c(this.endpoint,this.templateId,{sender:e}).then((function(i){var o;console.log("Update result",i);if((o=t.store)===null||o===void 0?void 0:o.state){t.store.state.sender=e}t.saving=false;t.sender=e})).catch((function(e){console.log("Error saving",e);t.saving=false}));return[2]}))}))};e.prototype.render=function(){var e=this;return i(o,{key:"f9ebeecc2d0d2467718e1c54161fd8eee32ba5f6"},i("div",{key:"efc13020bd5674c874707cefea2384b52521a85f",class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},i("div",{key:"3c85258b0ea837e4e78ad16eb6cec93cffa6e629",class:"dialog"},i("div",{key:"46a6eb1bed8de495d834faa73e48547a891aa00e",class:"options"},i("div",{key:"9425750a4508f6a6c176f0ee88a1674aceec8475",class:"option"},i("verdocs-radio-button",{key:"65d2059bb0b433e1b95a55273ad7a7ca4734ce51",name:"template-sender",value:"everyone",checked:this.sender==="everyone",onInput:function(){return e.handleSelectSetting("everyone")}}),i("div",{key:"119b053c18bffd95451eed224132d1592ccf6004",class:"description"},i("div",{key:"c4a3fac447abea997dec0906221df87cc9014e4b",class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{key:"1e8e078477cdd86100e3b73e275e856449eb84ee",text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{key:"b91f257e6a6c702f2fa0ee147dda5642b6ff514a",class:"option"},i("verdocs-radio-button",{key:"00a900ef8a3a1e9cb7ca8e1de93bf3528f78b32d",name:"template-sender",value:"everyone_as_creator",checked:this.sender==="everyone_as_creator",onInput:function(){return e.handleSelectSetting("everyone_as_creator")}}),i("div",{key:"f767a5d108262e22fb3f0936379f6b84481801ad",class:"description"},i("div",{key:"59f6f409b9f51a2ab597241a4052191e46a4d5c1",class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{key:"0b90c72573e4b75c3294e8f95a709ee0559bdbef",text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{key:"afd67488f38d33075a454476be475cd7801c4ed3",class:"option"},i("verdocs-radio-button",{key:"8c09dc41fbb371c3380a2ddf06a806a131aef8b6",name:"template-sender",value:"organization_member",checked:this.sender==="organization_member",onInput:function(){return e.handleSelectSetting("organization_member")}}),i("div",{key:"caf2a20f93130262b878e9df13e0e569aacffb9c",class:"description"},i("div",{key:"430ccbe92e4b39a789d215886e9ecbfed0c30f3e",class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{key:"21a2cec2a249f6e4d6f486f501a813e10bdd1497",text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{key:"a48b2814e9b04e09f6661a754b52e739d0566200",class:"option"},i("verdocs-radio-button",{key:"e3f9885aa8215f79686555a1fb85c5b87aa4aa03",name:"template-sender",value:"organization_member_as_creator",checked:this.sender==="organization_member_as_creator",onInput:function(){return e.handleSelectSetting("organization_member_as_creator")}}),i("div",{key:"99ea5cdc2c55b0e73d092a1df4fc728f30810059",class:"description"},i("div",{key:"79109d8cc3845c287fbffdd017695139cfb1a16f",class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{key:"b093f771c7cf119cbf27c404562bf5029664bb1b",text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{key:"1a250fdd2b385e70d27f0fb6895a5b673c24e655",class:"option"},i("verdocs-radio-button",{key:"526a88e4e339932623183ec5fa9218adcbb5d832",name:"template-sender",value:"creator",checked:this.sender==="creator",onInput:function(){return e.handleSelectSetting("creator")}}),i("div",{key:"94a699f6c4c430cbd3e221c6baf4972ec188260f",class:"description"},i("div",{key:"b2c16bda7146c436cd90d919e7c7a7d912c90809",class:"name"},"Me"),i("verdocs-help-icon",{key:"360ad19358fd4ce6a6f8e3e3e47bb0ff0da18d37",text:"Only I can use this template."})))),i("div",{key:"059e9ebf124ffcd2d45ea4316d1fdd49c4ec36ae",class:"buttons"},i("verdocs-button",{key:"b0a0a519eb6b713fa334065de19021369e20ee0b",label:"Close",onClick:function(){return e.handleClose()}})))))};return e}());E.style=_}}}));
@@ -1 +1 @@
1
- import{r as e,c as t,h as o}from"./p-5207d80c.js";import{VerdocsEndpoint as r}from"@verdocs/js-sdk";const n=class{constructor(o){e(this,o),this.createTemplate=t(this,"createTemplate",7),this.createDocument=t(this,"createDocument",7),this.endpoint=r.getDefault()}handleCreateTemplate(){this.createTemplate.emit()}handleCreateDocument(){this.createDocument.emit()}render(){return o("div",{key:"99840e81fe2f2b825efb6253f72a6583d0354504",class:"container"},o("p",{key:"7a814db57ae3bfad6aaba12cdab17b0e900e9080",class:"title"},"Quick Create"),o("button",{key:"84d518a21e8fb43818efbc26f94b545821465af1",onClick:()=>this.handleCreateTemplate(),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>'},"Template"),o("button",{key:"c7b9ea58cf880ef8356e2fdb80a1f76b4ab8b014",onClick:()=>this.handleCreateDocument(),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>'},"Document"))}};n.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}';export{n as verdocs_quick_functions}
1
+ import{r as e,c as t,h as o}from"./p-5207d80c.js";import{VerdocsEndpoint as r}from"@verdocs/js-sdk";const c=class{constructor(o){e(this,o),this.createTemplate=t(this,"createTemplate",7),this.createDocument=t(this,"createDocument",7),this.endpoint=r.getDefault()}handleCreateTemplate(){this.createTemplate.emit()}handleCreateDocument(){this.createDocument.emit()}render(){return o("div",{key:"0cff01678f477efbb74f37a070db94c6ffa195a1",class:"container"},o("p",{key:"2b781540591813f4955324bfb89084ad2b0a5132",class:"title"},"Quick Create"),o("button",{key:"1530472b7904a08465cb27e61b2adc84d0ff7560",onClick:()=>this.handleCreateTemplate(),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>'},"Template"),o("button",{key:"7f07268a4aaa6dbb610815af95f27025c0d91c41",onClick:()=>this.handleCreateDocument(),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>'},"Document"))}};c.style='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}';export{c as verdocs_quick_functions}