@verdocs/web-sdk 5.0.52 → 5.0.54

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 (43) hide show
  1. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +3 -3
  2. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
  3. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
  5. package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +4 -1
  6. package/dist/components/{p-7957064d.js → p-0b46bfa1.js} +4 -4
  7. package/dist/components/p-0b46bfa1.js.map +1 -0
  8. package/dist/components/{p-edf89442.js → p-85b0a2e1.js} +2 -2
  9. package/dist/components/{p-edf89442.js.map → p-85b0a2e1.js.map} +1 -1
  10. package/dist/components/{p-bae61eb2.js → p-b6e5b0c3.js} +2 -2
  11. package/dist/components/p-b6e5b0c3.js.map +1 -0
  12. package/dist/components/{p-15ac7314.js → p-ebb16e24.js} +2 -2
  13. package/dist/components/{p-15ac7314.js.map → p-ebb16e24.js.map} +1 -1
  14. package/dist/components/verdocs-build.js +4 -4
  15. package/dist/components/verdocs-contact-picker.js +1 -1
  16. package/dist/components/verdocs-send.js +1 -1
  17. package/dist/components/verdocs-template-fields.js +1 -1
  18. package/dist/components/verdocs-toolbar-icon.js +1 -1
  19. package/dist/esm/verdocs-contact-picker_2.entry.js +3 -3
  20. package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
  21. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  22. package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
  23. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  24. package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
  25. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  26. package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
  27. package/dist/verdocs-web-sdk/{p-b8ccd4e5.entry.js → p-31e15b7b.entry.js} +2 -2
  28. package/dist/verdocs-web-sdk/{p-b8ccd4e5.entry.js.map → p-31e15b7b.entry.js.map} +1 -1
  29. package/dist/verdocs-web-sdk/p-688bd38f.entry.js +2 -0
  30. package/dist/verdocs-web-sdk/p-688bd38f.entry.js.map +1 -0
  31. package/dist/verdocs-web-sdk/{p-227fdd3a.system.entry.js → p-7a4d7c71.system.entry.js} +2 -2
  32. package/dist/verdocs-web-sdk/{p-227fdd3a.system.entry.js.map → p-7a4d7c71.system.entry.js.map} +1 -1
  33. package/dist/verdocs-web-sdk/p-8a6c7f95.system.js +1 -1
  34. package/dist/verdocs-web-sdk/p-b7a7be92.system.entry.js +2 -0
  35. package/dist/verdocs-web-sdk/p-b7a7be92.system.entry.js.map +1 -0
  36. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  37. package/package.json +4 -4
  38. package/dist/components/p-7957064d.js.map +0 -1
  39. package/dist/components/p-bae61eb2.js.map +0 -1
  40. package/dist/verdocs-web-sdk/p-366c2acc.system.entry.js +0 -2
  41. package/dist/verdocs-web-sdk/p-366c2acc.system.entry.js.map +0 -1
  42. package/dist/verdocs-web-sdk/p-eb70e2b3.entry.js +0 -2
  43. package/dist/verdocs-web-sdk/p-eb70e2b3.entry.js.map +0 -1
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function n(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):i(e.value).then(s,n)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(r=1,i&&(a=n[0]&2?i["return"]:n[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;if(i=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];i=0}finally{r=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-24c3207f.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,j as getControlStyles,g as getFieldId}from"./utils-bd656c37.js";import{S as Store}from"./Datastore-974a55a5.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsTemplateDocumentPageCss="@-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%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-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)}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(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=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,r=t;o<r.length;o++){var i=r[o];var a=i.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(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})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var r;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,r;var i=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var c=e,l=c.xScale,d=c.yScale,u=c.templateId,p=c.editable,f=c.disabled,b=c.done,m=c.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"textarea":return h("verdocs-field-textarea",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"date":return h("verdocs-field-date",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"attachment":return h("verdocs-field-attachment",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"dropdown":return h("verdocs-field-dropdown",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"initial":return h("verdocs-field-initial",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"signature":return h("verdocs-field-signature",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"checkbox":return h("verdocs-field-checkbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"radio":return h("verdocs-field-radio",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-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}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},h("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,a){function s(e){try{c(r.next(e))}catch(e){a(e)}}function n(e){try{c(r["throw"](e))}catch(e){a(e)}}function c(e){e.done?o(e.value):i(e.value).then(s,n)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,s;return s={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function n(e){return function(t){return c([e,t])}}function c(n){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,n[0]&&(o=0)),o)try{if(r=1,i&&(a=n[0]&2?i["return"]:n[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;if(i=0,a)n=[n[0]&2,a.value];switch(n[0]){case 0:case 1:a=n;break;case 4:o.label++;return{value:n[1],done:false};case 5:o.label++;i=n[1];n=[0];continue;case 7:n=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(n[0]===6||n[0]===2)){o=0;continue}if(n[0]===3&&(!a||n[1]>a[0]&&n[1]<a[3])){o.label=n[1];break}if(n[0]===6&&o.label<a[1]){o.label=a[1];a=n;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(n);break}if(a[2])o.ops.pop();o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e];i=0}finally{r=a=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment,g as getElement}from"./index-24c3207f.js";import{VerdocsEndpoint,getTemplateDocumentPageDisplayUri,getTemplate}from"@verdocs/js-sdk";import{t as throttle,j as getControlStyles,g as getFieldId}from"./utils-bd656c37.js";import{S as Store}from"./Datastore-974a55a5.js";import{c as createPopper}from"./popper-0fbeff6d.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsTemplateDocumentPageCss="@-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%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-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)}";var VerdocsTemplateDocumentPageStyle0=verdocsTemplateDocumentPageCss;var VerdocsTemplateDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=VerdocsEndpoint.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-document-page-".concat(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=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getTemplateDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var o=0,r=t;o<r.length;o++){var i=r[o];var a=i.contentRect.width;e.renderedWidth=a;e.renderedHeight=e.virtualHeight*(a/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();Store.subscribe("templates",this.templateId,(function(){return getTemplate(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){Store.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(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})};e.prototype.render=function(){var e=this;if(this.loading){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return h(Host,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(o){var r;return o.type==="div"?h("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(o.name),style:{height:t}},o.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.page===e.pageNumber})).map((function(t){var o,r;var i=getFieldId(t);var a=t.name,s=t.type,n=t.multiline;var c=e,l=c.xScale,d=c.yScale,u=c.templateId,p=c.editable,f=c.disabled,b=c.done,m=c.pageNumber;if(((o=t["setting"])===null||o===void 0?void 0:o.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){s="textarea";n=true}switch(s){case"textbox":return h("verdocs-field-textbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,multiline:n,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"textarea":return h("verdocs-field-textarea",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"date":return h("verdocs-field-date",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"attachment":return h("verdocs-field-attachment",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"dropdown":return h("verdocs-field-dropdown",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"initial":return h("verdocs-field-initial",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"signature":return h("verdocs-field-signature",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,e.xScale,e.yScale)});case"timestamp":return h("verdocs-field-timestamp",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"checkbox":return h("verdocs-field-checkbox",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});case"radio":return h("verdocs-field-radio",{id:i,fieldname:a,source:"template",sourceid:u,editable:p,disabled:f,done:b,xscale:l,yscale:d,pagenumber:m,style:getControlStyles(t,l,d)});default:return h(Fragment,null,a)}}))):e.pageDisplayUri?h("img",{class:"verdocs-template-document-page-layer img",id:"".concat(e.containerId,"-").concat(o.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateDocumentPage.style=VerdocsTemplateDocumentPageStyle0;var verdocsToolbarIconCss='@-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:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}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}';var VerdocsToolbarIconStyle0=verdocsToolbarIconCss;var VerdocsToolbarIcon=function(){function e(e){registerInstance(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},h("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),h("div",{key:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,h("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsToolbarIcon.style=VerdocsToolbarIconStyle0;export{VerdocsTemplateDocumentPage as verdocs_template_document_page,VerdocsToolbarIcon as verdocs_toolbar_icon};
2
2
  //# sourceMappingURL=verdocs-template-document-page_2.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n display: inline-block;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"o7DAAA,IAAMA,+BAAiC,i3BACvC,IAAAC,kCAAeD,+B,ICkBFE,4BAA2B,WALxC,SAAAC,EAAAC,G,8EAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,gBAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,KAAKY,cAC9BZ,KAAAwB,aAAuBxB,KAAKW,aAC5BX,KAAAyB,cAAwBzB,KAAKY,cAC7BZ,KAAA0B,YAAsB1B,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA2B,sBAAwB,KACxB3B,KAAA4B,eAAiB,GACjB5B,KAAA6B,OAAS,EACT7B,KAAA8B,OAAS,EAET9B,KAAA+B,QAAU,KACV/B,KAAAgC,SAA6B,I,CAEhClC,EAAAmC,UAAAC,kBAAN,W,kHACEC,EAAAnC,KAAsB,SAAMoC,kCAAkCpC,KAAKE,SAAUF,KAAKS,WAAYT,KAAKU,a,OAAnGyB,EAAKP,eAAiBS,EAAAC,OACtBtC,KAAKuC,mB,kBAGPzC,EAAAmC,UAAAO,iBAAA,eAAAC,EAAAzC,KACEA,KAAK0C,eAAiB,IAAIC,eACxBC,UAAS,SAAAC,GACP,IAAoB,IAAAC,EAAA,EAAAC,EAAAF,EAAAC,E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EAAE6D,gBAAgB,Y,EAOhCjB,EAAApE,UAAAkC,OAAA,eAAA1B,EAAAzC,KACE,OACEoE,EAACC,KAAI,CAAAkD,IAAA,2CAAChD,MAAO,IACXH,EAAA,OAAAmD,IAAA,8DACoBvH,KAAKgB,YACvBuD,MAAM,OACNiD,UAAWxH,KAAKuG,KAChBkB,aAAc,WAAM,OAAAhF,EAAKwE,MAAL,EACpBS,QAAS,WAAM,OAAAjF,EAAKwE,MAAL,EACfU,aAAc,WAAM,OAAAlF,EAAK4E,MAAL,EACpBO,OAAQ,WAAM,OAAAnF,EAAK4E,MAAL,EACdQ,IAAK,SAAAC,GAAE,OAAKrF,EAAKkE,OAASmB,CAAnB,IAET1D,EAAA,OAAAmD,IAAA,2CAAK7C,GAAI1E,KAAKgB,YAAa+G,KAAK,UAAUxD,MAAM,UAAS,wBAAwBvE,KAAKwG,UAAWqB,IAAK,SAAAC,GAAE,OAAKrF,EAAKmE,QAAUkB,CAApB,GACrG9H,KAAKsG,KACNlC,EAAA,OAAAmD,IAAA,+DAAuB,OAAOhD,MAAM,W,WAxEf,G","ignoreList":[]}
1
+ {"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"o7DAAA,IAAMA,+BAAiC,i3BACvC,IAAAC,kCAAeD,+B,ICkBFE,4BAA2B,WALxC,SAAAC,EAAAC,G,8EAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,gBAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,KAAKY,cAC9BZ,KAAAwB,aAAuBxB,KAAKW,aAC5BX,KAAAyB,cAAwBzB,KAAKY,cAC7BZ,KAAA0B,YAAsB1B,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA2B,sBAAwB,KACxB3B,KAAA4B,eAAiB,GACjB5B,KAAA6B,OAAS,EACT7B,KAAA8B,OAAS,EAET9B,KAAA+B,QAAU,KACV/B,KAAAgC,SAA6B,I,CAEhClC,EAAAmC,UAAAC,kBAAN,W,kHACEC,EAAAnC,KAAsB,S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EAAApE,UAAAgF,KAAA,W,SACExD,EAAAzD,KAAK4G,WAAO,MAAAnD,SAAA,SAAAA,EAAEyD,aAAa,YAAa,KACxC5B,EAAAtF,KAAKyG,kBAAc,MAAAnB,SAAA,SAAAA,EAAE6B,SAASC,OAAM,c,EAGtCf,EAAApE,UAAAoF,KAAA,W,OACE5D,EAAAzD,KAAK4G,WAAO,MAAAnD,SAAA,SAAAA,EAAE6D,gBAAgB,Y,EAOhCjB,EAAApE,UAAAkC,OAAA,eAAA1B,EAAAzC,KACE,OACEoE,EAACC,KAAI,CAAAkD,IAAA,2CAAChD,MAAO,IACXH,EAAA,OAAAmD,IAAA,8DACoBvH,KAAKgB,YACvBuD,MAAM,OACNiD,UAAWxH,KAAKuG,KAChBkB,aAAc,WAAM,OAAAhF,EAAKwE,MAAL,EACpBS,QAAS,WAAM,OAAAjF,EAAKwE,MAAL,EACfU,aAAc,WAAM,OAAAlF,EAAK4E,MAAL,EACpBO,OAAQ,WAAM,OAAAnF,EAAK4E,MAAL,EACdQ,IAAK,SAAAC,GAAE,OAAKrF,EAAKkE,OAASmB,CAAnB,IAET1D,EAAA,OAAAmD,IAAA,2CAAK7C,GAAI1E,KAAKgB,YAAa+G,KAAK,UAAUxD,MAAM,UAAS,wBAAwBvE,KAAKwG,UAAWqB,IAAK,SAAAC,GAAE,OAAKrF,EAAKmE,QAAUkB,CAApB,GACrG9H,KAAKsG,KACNlC,EAAA,OAAAmD,IAAA,+DAAuB,OAAOhD,MAAM,W,WAxEf,G","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-576f984d.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,j as n,g as p}from"./p-0c45b79c.js";import{S as h}from"./p-33300e3a.js";import{c as b}from"./p-68a5aaff.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const u="@-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%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-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)}";const m=u;const f=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;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=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}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;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(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(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,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":true,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 a(this)}};f.style=m;const g='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-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}';const v=g;const x=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=b(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")}render(){return i(o,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},i("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","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:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))}};x.style=v;export{f as verdocs_template_document_page,x as verdocs_toolbar_icon};
2
- //# sourceMappingURL=p-b8ccd4e5.entry.js.map
1
+ import{r as e,c as t,h as i,H as o,F as s,g as a}from"./p-576f984d.js";import{VerdocsEndpoint as r,getTemplateDocumentPageDisplayUri as d,getTemplate as l}from"@verdocs/js-sdk";import{t as c,j as n,g as p}from"./p-0c45b79c.js";import{S as h}from"./p-33300e3a.js";import{c as b}from"./p-68a5aaff.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const u="@-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%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-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)}";const m=u;const f=class{constructor(i){e(this,i);this.pageRendered=t(this,"pageRendered",7);this.templateListenerId=null;this.endpoint=r.getDefault();this.editable=false;this.disabled=false;this.done=false;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=true;this.pageDisplayUri="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}async componentWillLoad(){this.pageDisplayUri=await d(this.endpoint,this.documentId,this.pageNumber);this.listenToTemplate()}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;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}}notifyRenderedSize(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}const e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}const t=this.renderedHeight/this.virtualHeight;if(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(){if(this.loading){return i(o,null,i("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}const e=`${this.renderedHeight}px`;return i(o,{id:`${this.containerId}`,style:{height:e,flex:`0 0 ${e}`}},this.layers.map((t=>{var o;return t.type==="div"?i("div",{class:"verdocs-template-document-page-layer",id:`${this.containerId}-${t.name}`,style:{height:e}},t.name==="controls"&&(((o=this.template)===null||o===void 0?void 0:o.fields)||[]).filter((e=>e&&e.page===this.pageNumber)).map((e=>{var t,o;const a=p(e);let{name:r,type:d,multiline:l}=e;const{xScale:c,yScale:h,templateId:b,editable:u,disabled:m,done:f,pageNumber:g}=this;if(((t=e["setting"])===null||t===void 0?void 0:t.leading)>0||((o=e["settings"])===null||o===void 0?void 0:o.leading)>0){d="textarea";l=true}switch(d){case"textbox":return i("verdocs-field-textbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,multiline:l,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"textarea":return i("verdocs-field-textarea",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"date":return i("verdocs-field-date",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"attachment":return i("verdocs-field-attachment",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"dropdown":return i("verdocs-field-dropdown",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"initial":return i("verdocs-field-initial",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"signature":return i("verdocs-field-signature",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,this.xScale,this.yScale)});case"timestamp":return i("verdocs-field-timestamp",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"checkbox":return i("verdocs-field-checkbox",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});case"radio":return i("verdocs-field-radio",{id:a,fieldname:r,source:"template",sourceid:b,editable:u,disabled:m,done:f,xscale:c,yscale:h,pagenumber:g,style:n(e,c,h)});default:return i(s,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":true,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 a(this)}};f.style=m;const g='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toolbar-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}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}';const v=g;const x=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=b(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")}render(){return i(o,{key:"8163f7ebe7d2f3a13db305b411b454287a4b3729",class:{}},i("div",{key:"1782db14268643ad1620ebcd5efc6a27ff9fcc04","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:"54c1bb4abc22a943051ba2df8b557e6c02fdabef",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:e=>this.tooltip=e},this.text,i("div",{key:"4d2c884923f2e79b375ffcfa2592cd914bead68c","data-popper-arrow":"true",class:"arrow"})))}};x.style=v;export{f as verdocs_template_document_page,x as verdocs_toolbar_icon};
2
+ //# sourceMappingURL=p-31e15b7b.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","constructor","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","componentWillLoad","getTemplateDocumentPageDisplayUri","listenToTemplate","componentDidLoad","resizeObserver","ResizeObserver","throttle","entries","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n display: inline-block;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"mXAAA,MAAMA,EAAiC,i3BACvC,MAAAC,EAAeD,E,MCkBFE,EAA2B,MALxC,WAAAC,CAAAC,G,qDAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,EAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,MAC/EpB,KAAAqB,cAAwBrB,KAAKW,aAC7BX,KAAAsB,eAAyBtB,KAAKY,cAC9BZ,KAAAuB,aAAuBvB,KAAKW,aAC5BX,KAAAwB,cAAwBxB,KAAKY,cAC7BZ,KAAAyB,YAAsBzB,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA0B,sBAAwB,KACxB1B,KAAA2B,eAAiB,GACjB3B,KAAA4B,OAAS,EACT5B,KAAA6B,OAAS,EAET7B,KAAA8B,QAAU,KACV9B,KAAA+B,SAA6B,I,CAEtC,uBAAMC,GACJhC,KAAK2B,qBAAuBM,EAAkCjC,KAAKE,SAAUF,KAAKS,WAAYT,KAAKU,YACnGV,KAAKkC,kB,CAGP,gBAAAC,GACEnC,KAAKoC,eAAiB,IAAIC,eACxBC,GAASC,IACP,IAAK,MAAMC,KAASD,EAAS,CA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AAOhD,MAAM,W","ignoreList":[]}
1
+ {"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPageStyle0","VerdocsTemplateDocumentPage","constructor","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","componentWillLoad","getTemplateDocumentPageDisplayUri","listenToTemplate","componentDidLoad","resizeObserver","ResizeObserver","throttle","entries","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIconStyle0","VerdocsToolbarIcon","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"mXAAA,MAAMA,EAAiC,i3BACvC,MAAAC,EAAeD,E,MCkBFE,EAA2B,MALxC,WAAAC,CAAAC,G,qDAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,EAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKPP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMrBV,KAAAW,aAAuB,IAMRX,KAAAY,c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kBAAc,MAAAnB,SAAA,SAAAA,EAAE6B,SAASC,OAAM,Q,CAGtC,IAAAC,G,OACE5D,EAAAhD,KAAKmG,WAAO,MAAAnD,SAAA,SAAAA,EAAE6D,gBAAgB,Y,CAOhC,MAAAnD,GACE,OACEC,EAACC,EAAI,CAAAkD,IAAA,2CAAChD,MAAO,IACXH,EAAA,OAAAmD,IAAA,8DACoB9G,KAAKgB,YACvB8C,MAAM,OACNiD,UAAW/G,KAAK8F,KAChBkB,aAAc,IAAMhH,KAAKwG,OACzBS,QAAS,IAAMjH,KAAKwG,OACpBU,aAAc,IAAMlH,KAAK4G,OACzBO,OAAQ,IAAMnH,KAAK4G,OACnBQ,IAAKC,GAAOrH,KAAKkG,OAASmB,IAE5B1D,EAAA,OAAAmD,IAAA,2CAAK7C,GAAIjE,KAAKgB,YAAasG,KAAK,UAAUxD,MAAM,UAAS,wBAAwB9D,KAAK+F,UAAWqB,IAAKC,GAAOrH,KAAKmG,QAAUkB,GACzHrH,KAAK6F,KACNlC,EAAA,OAAAmD,IAAA,+DAAuB,OAAOhD,MAAM,W","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as e,c as t,h as n,F as o,H as s}from"./p-576f984d.js";import{VerdocsEndpoint as i,formatFullName as r,getActiveEntitlements as c,isValidEmail as a,randomString as l}from"@verdocs/js-sdk";import{B as u}from"./p-0aad02d5.js";import{h as f}from"./p-0c45b79c.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";function d(e,t){return function n(){return e.apply(t,arguments)}}const{toString:h}=Object.prototype;const{getPrototypeOf:p}=Object;const m=(e=>t=>{const n=h.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null));const b=e=>{e=e.toLowerCase();return t=>m(t)===e};const g=e=>t=>typeof t===e;const{isArray:w}=Array;const y=g("undefined");function v(e){return e!==null&&!y(e)&&e.constructor!==null&&!y(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const x=b("ArrayBuffer");function k(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&x(e.buffer)}return t}const R=g("string");const O=g("function");const S=g("number");const E=e=>e!==null&&typeof e==="object";const T=e=>e===true||e===false;const A=e=>{if(m(e)!=="object"){return false}const t=p(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};const C=b("Date");const j=b("File");const N=b("Blob");const F=b("FileList");const P=e=>E(e)&&O(e.pipe);const U=e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||O(e.append)&&((t=m(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))};const B=b("URLSearchParams");const[z,I,_,D]=["ReadableStream","Request","Response","Headers"].map(b);const L=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function q(e,t,{allOwnKeys:n=false}={}){if(e===null||typeof e==="undefined"){return}let o;let s;if(typeof e!=="object"){e=[e]}if(w(e)){for(o=0,s=e.length;o<s;o++){t.call(null,e[o],o,e)}}else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e);const i=s.length;let r;for(o=0;o<i;o++){r=s[o];t.call(null,e[r],r,e)}}}function M(e,t){t=t.toLowerCase();const n=Object.keys(e);let o=n.length;let s;while(o-- >0){s=n[o];if(t===s.toLowerCase()){return s}}return null}const H=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const $=e=>!y(e)&&e!==H;function K(){const{caseless:e}=$(this)&&this||{};const t={};const n=(n,o)=>{const s=e&&M(t,o)||o;if(A(t[s])&&A(n)){t[s]=K(t[s],n)}else if(A(n)){t[s]=K({},n)}else if(w(n)){t[s]=n.slice()}else{t[s]=n}};for(let e=0,t=arguments.length;e<t;e++){arguments[e]&&q(arguments[e],n)}return t}const J=(e,t,n,{allOwnKeys:o}={})=>{q(t,((t,o)=>{if(n&&O(t)){e[o]=d(t,n)}else{e[o]=t}}),{allOwnKeys:o});return e};const V=e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};const W=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});n&&Object.assign(e.prototype,n)};const X=(e,t,n,o)=>{let s;let i;let r;const c={};t=t||{};if(e==null)return t;do{s=Object.getOwnPropertyNames(e);i=s.length;while(i-- >0){r=s[i];if((!o||o(r,e,t))&&!c[r]){t[r]=e[r];c[r]=true}}e=n!==false&&p(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t};const G=(e,t,n)=>{e=String(e);if(n===undefined||n>e.length){n=e.length}n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n};const Z=e=>{if(!e)return null;if(w(e))return e;let t=e.length;if(!S(t))return null;const n=new Array(t);while(t-- >0){n[t]=e[t]}return n};const Q=(e=>t=>e&&t instanceof e)(typeof Uint8Array!=="undefined"&&p(Uint8Array));const Y=(e,t)=>{const n=e&&e[Symbol.iterator];const o=n.call(e);let s;while((s=o.next())&&!s.done){const n=s.value;t.call(e,n[0],n[1])}};const ee=(e,t)=>{let n;const o=[];while((n=e.exec(t))!==null){o.push(n)}return o};const te=b("HTMLFormElement");const ne=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,n,o){return n.toUpperCase()+o}));const oe=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype);const se=b("RegExp");const ie=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e);const o={};q(n,((n,s)=>{let i;if((i=t(n,s,e))!==false){o[s]=i||n}}));Object.defineProperties(e,o)};const re=e=>{ie(e,((t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=e[n];if(!O(o))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const ce=(e,t)=>{const n={};const o=e=>{e.forEach((e=>{n[e]=true}))};w(e)?o(e):o(String(e).split(t));return n};const ae=()=>{};const le=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ue(e){return!!(e&&O(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const fe=e=>{const t=new Array(10);const n=(e,o)=>{if(E(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[o]=e;const s=w(e)?[]:{};q(e,((e,t)=>{const i=n(e,o+1);!y(i)&&(s[t]=i)}));t[o]=undefined;return s}}return e};return n(e,0)};const de=b("AsyncFunction");const he=e=>e&&(E(e)||O(e))&&O(e.then)&&O(e.catch);const pe=((e,t)=>{if(e){return setImmediate}return t?((e,t)=>{H.addEventListener("message",(({source:n,data:o})=>{if(n===H&&o===e){t.length&&t.shift()()}}),false);return n=>{t.push(n);H.postMessage(e,"*")}})(`axios@${Math.random()}`,[]):e=>setTimeout(e)})(typeof setImmediate==="function",O(H.postMessage));const me=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(H):typeof process!=="undefined"&&process.nextTick||pe;const be={isArray:w,isArrayBuffer:x,isBuffer:v,isFormData:U,isArrayBufferView:k,isString:R,isNumber:S,isBoolean:T,isObject:E,isPlainObject:A,isReadableStream:z,isRequest:I,isResponse:_,isHeaders:D,isUndefined:y,isDate:C,isFile:j,isBlob:N,isRegExp:se,isFunction:O,isStream:P,isURLSearchParams:B,isTypedArray:Q,isFileList:F,forEach:q,merge:K,extend:J,trim:L,stripBOM:V,inherits:W,toFlatObject:X,kindOf:m,kindOfTest:b,endsWith:G,toArray:Z,forEachEntry:Y,matchAll:ee,isHTMLForm:te,hasOwnProperty:oe,hasOwnProp:oe,reduceDescriptors:ie,freezeMethods:re,toObjectSet:ce,toCamelCase:ne,noop:ae,toFiniteNumber:le,findKey:M,global:H,isContextDefined:$,isSpecCompliantForm:ue,toJSONObject:fe,isAsyncFn:de,isThenable:he,setImmediate:pe,asap:me};function ge(e,t,n,o,s){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);n&&(this.config=n);o&&(this.request=o);if(s){this.response=s;this.status=s.status?s.status:null}}be.inherits(ge,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.status}}});const we=ge.prototype;const ye={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{ye[e]={value:e}}));Object.defineProperties(ge,ye);Object.defineProperty(we,"isAxiosError",{value:true});ge.from=(e,t,n,o,s,i)=>{const r=Object.create(we);be.toFlatObject(e,r,(function e(t){return t!==Error.prototype}),(e=>e!=="isAxiosError"));ge.call(r,e.message,t,n,o,s);r.cause=e;r.name=e.name;i&&Object.assign(r,i);return r};const ve=null;function xe(e){return be.isPlainObject(e)||be.isArray(e)}function ke(e){return be.endsWith(e,"[]")?e.slice(0,-2):e}function Re(e,t,n){if(!e)return t;return e.concat(t).map((function e(t,o){t=ke(t);return!n&&o?"["+t+"]":t})).join(n?".":"")}function Oe(e){return be.isArray(e)&&!e.some(xe)}const Se=be.toFlatObject(be,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function Ee(e,t,n){if(!be.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;n=be.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function e(t,n){return!be.isUndefined(n[t])}));const o=n.metaTokens;const s=n.visitor||u;const i=n.dots;const r=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const a=c&&be.isSpecCompliantForm(t);if(!be.isFunction(s)){throw new TypeError("visitor must be a function")}function l(e){if(e===null)return"";if(be.isDate(e)){return e.toISOString()}if(!a&&be.isBlob(e)){throw new ge("Blob is not supported. Use a Buffer instead.")}if(be.isArrayBuffer(e)||be.isTypedArray(e)){return a&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function u(e,n,s){let c=e;if(e&&!s&&typeof e==="object"){if(be.endsWith(n,"{}")){n=o?n:n.slice(0,-2);e=JSON.stringify(e)}else if(be.isArray(e)&&Oe(e)||(be.isFileList(e)||be.endsWith(n,"[]"))&&(c=be.toArray(e))){n=ke(n);c.forEach((function e(o,s){!(be.isUndefined(o)||o===null)&&t.append(r===true?Re([n],s,i):r===null?n:n+"[]",l(o))}));return false}}if(xe(e)){return true}t.append(Re(s,n,i),l(e));return false}const f=[];const d=Object.assign(Se,{defaultVisitor:u,convertValue:l,isVisitable:xe});function h(e,n){if(be.isUndefined(e))return;if(f.indexOf(e)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(e);be.forEach(e,(function e(o,i){const r=!(be.isUndefined(o)||o===null)&&s.call(t,o,be.isString(i)?i.trim():i,n,d);if(r===true){h(o,n?n.concat(i):[i])}}));f.pop()}if(!be.isObject(e)){throw new TypeError("data must be an object")}h(e);return t}function Te(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(n){return t[n]}))}function Ae(e,t){this._pairs=[];e&&Ee(e,this,t)}const Ce=Ae.prototype;Ce.append=function e(t,n){this._pairs.push([t,n])};Ce.toString=function e(t){const n=t?function(e){return t.call(this,e,Te)}:Te;return this._pairs.map((function e(t){return n(t[0])+"="+n(t[1])}),"").join("&")};function je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ne(e,t,n){if(!t){return e}const o=n&&n.encode||je;if(be.isFunction(n)){n={serialize:n}}const s=n&&n.serialize;let i;if(s){i=s(t,n)}else{i=be.isURLSearchParams(t)?t.toString():new Ae(t,n).toString(o)}if(i){const t=e.indexOf("#");if(t!==-1){e=e.slice(0,t)}e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Fe{constructor(){this.handlers=[]}use(e,t,n){this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(e){if(this.handlers[e]){this.handlers[e]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(e){be.forEach(this.handlers,(function t(n){if(n!==null){e(n)}}))}}const Pe=Fe;const Ue={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Be=typeof URLSearchParams!=="undefined"?URLSearchParams:Ae;const ze=typeof FormData!=="undefined"?FormData:null;const Ie=typeof Blob!=="undefined"?Blob:null;const _e={isBrowser:true,classes:{URLSearchParams:Be,FormData:ze,Blob:Ie},protocols:["http","https","file","blob","url","data"]};const De=typeof window!=="undefined"&&typeof document!=="undefined";const Le=typeof navigator==="object"&&navigator||undefined;const qe=De&&(!Le||["ReactNative","NativeScript","NS"].indexOf(Le.product)<0);const Me=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const He=De&&window.location.href||"http://localhost";const $e=Object.freeze({__proto__:null,hasBrowserEnv:De,hasStandardBrowserWebWorkerEnv:Me,hasStandardBrowserEnv:qe,navigator:Le,origin:He});const Ke={...$e,..._e};function Je(e,t){return Ee(e,new Ke.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){if(Ke.isNode&&be.isBuffer(e)){this.append(t,e.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},t))}function Ve(e){return be.matchAll(/\w+|\[(\w*)]/g,e).map((e=>e[0]==="[]"?"":e[1]||e[0]))}function We(e){const t={};const n=Object.keys(e);let o;const s=n.length;let i;for(o=0;o<s;o++){i=n[o];t[i]=e[i]}return t}function Xe(e){function t(e,n,o,s){let i=e[s++];if(i==="__proto__")return true;const r=Number.isFinite(+i);const c=s>=e.length;i=!i&&be.isArray(o)?o.length:i;if(c){if(be.hasOwnProp(o,i)){o[i]=[o[i],n]}else{o[i]=n}return!r}if(!o[i]||!be.isObject(o[i])){o[i]=[]}const a=t(e,n,o[i],s);if(a&&be.isArray(o[i])){o[i]=We(o[i])}return!r}if(be.isFormData(e)&&be.isFunction(e.entries)){const n={};be.forEachEntry(e,((e,o)=>{t(Ve(e),o,n,0)}));return n}return null}function Ge(e,t,n){if(be.isString(e)){try{(t||JSON.parse)(e);return be.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(n||JSON.stringify)(e)}const Ze={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function e(t,n){const o=n.getContentType()||"";const s=o.indexOf("application/json")>-1;const i=be.isObject(t);if(i&&be.isHTMLForm(t)){t=new FormData(t)}const r=be.isFormData(t);if(r){return s?JSON.stringify(Xe(t)):t}if(be.isArrayBuffer(t)||be.isBuffer(t)||be.isStream(t)||be.isFile(t)||be.isBlob(t)||be.isReadableStream(t)){return t}if(be.isArrayBufferView(t)){return t.buffer}if(be.isURLSearchParams(t)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}let c;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1){return Je(t,this.formSerializer).toString()}if((c=be.isFileList(t))||o.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ee(c?{"files[]":t}:t,e&&new e,this.formSerializer)}}if(i||s){n.setContentType("application/json",false);return Ge(t)}return t}],transformResponse:[function e(t){const n=this.transitional||Ze.transitional;const o=n&&n.forcedJSONParsing;const s=this.responseType==="json";if(be.isResponse(t)||be.isReadableStream(t)){return t}if(t&&be.isString(t)&&(o&&!this.responseType||s)){const e=n&&n.silentJSONParsing;const o=!e&&s;try{return JSON.parse(t)}catch(e){if(o){if(e.name==="SyntaxError"){throw ge.from(e,ge.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ke.classes.FormData,Blob:Ke.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};be.forEach(["delete","get","head","post","put","patch"],(e=>{Ze.headers[e]={}}));const Qe=Ze;const Ye=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const et=e=>{const t={};let n;let o;let s;e&&e.split("\n").forEach((function e(i){s=i.indexOf(":");n=i.substring(0,s).trim().toLowerCase();o=i.substring(s+1).trim();if(!n||t[n]&&Ye[n]){return}if(n==="set-cookie"){if(t[n]){t[n].push(o)}else{t[n]=[o]}}else{t[n]=t[n]?t[n]+", "+o:o}}));return t};const tt=Symbol("internals");function nt(e){return e&&String(e).trim().toLowerCase()}function ot(e){if(e===false||e==null){return e}return be.isArray(e)?e.map(ot):String(e)}function st(e){const t=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;while(o=n.exec(e)){t[o[1]]=o[2]}return t}const it=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rt(e,t,n,o,s){if(be.isFunction(o)){return o.call(this,t,n)}if(s){t=n}if(!be.isString(t))return;if(be.isString(o)){return t.indexOf(o)!==-1}if(be.isRegExp(o)){return o.test(t)}}function ct(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}function at(e,t){const n=be.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,s){return this[o].call(this,t,e,n,s)},configurable:true})}))}class lt{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function s(e,t,n){const s=nt(t);if(!s){throw new Error("header name must be a non-empty string")}const i=be.findKey(o,s);if(!i||o[i]===undefined||n===true||n===undefined&&o[i]!==false){o[i||t]=ot(e)}}const i=(e,t)=>be.forEach(e,((e,n)=>s(e,n,t)));if(be.isPlainObject(e)||e instanceof this.constructor){i(e,t)}else if(be.isString(e)&&(e=e.trim())&&!it(e)){i(et(e),t)}else if(be.isHeaders(e)){for(const[t,o]of e.entries()){s(o,t,n)}}else{e!=null&&s(t,e,n)}return this}get(e,t){e=nt(e);if(e){const n=be.findKey(this,e);if(n){const e=this[n];if(!t){return e}if(t===true){return st(e)}if(be.isFunction(t)){return t.call(this,e,n)}if(be.isRegExp(t)){return t.exec(e)}throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){e=nt(e);if(e){const n=be.findKey(this,e);return!!(n&&this[n]!==undefined&&(!t||rt(this,this[n],n,t)))}return false}delete(e,t){const n=this;let o=false;function s(e){e=nt(e);if(e){const s=be.findKey(n,e);if(s&&(!t||rt(n,n[s],s,t))){delete n[s];o=true}}}if(be.isArray(e)){e.forEach(s)}else{s(e)}return o}clear(e){const t=Object.keys(this);let n=t.length;let o=false;while(n--){const s=t[n];if(!e||rt(this,this[s],s,e,true)){delete this[s];o=true}}return o}normalize(e){const t=this;const n={};be.forEach(this,((o,s)=>{const i=be.findKey(n,s);if(i){t[i]=ot(o);delete t[s];return}const r=e?ct(s):String(s).trim();if(r!==s){delete t[s]}t[r]=ot(o);n[r]=true}));return this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);be.forEach(this,((n,o)=>{n!=null&&n!==false&&(t[o]=e&&be.isArray(n)?n.join(", "):n)}));return t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);t.forEach((e=>n.set(e)));return n}static accessor(e){const t=this[tt]=this[tt]={accessors:{}};const n=t.accessors;const o=this.prototype;function s(e){const t=nt(e);if(!n[t]){at(o,e);n[t]=true}}be.isArray(e)?e.forEach(s):s(e);return this}}lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);be.reduceDescriptors(lt.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}));be.freezeMethods(lt);const ut=lt;function ft(e,t){const n=this||Qe;const o=t||n;const s=ut.from(o.headers);let i=o.data;be.forEach(e,(function e(o){i=o.call(n,i,s.normalize(),t?t.status:undefined)}));s.normalize();return i}function dt(e){return!!(e&&e.__CANCEL__)}function ht(e,t,n){ge.call(this,e==null?"canceled":e,ge.ERR_CANCELED,t,n);this.name="CanceledError"}be.inherits(ht,ge,{__CANCEL__:true});function pt(e,t,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){e(n)}else{t(new ge("Request failed with status code "+n.status,[ge.ERR_BAD_REQUEST,ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function mt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function bt(e,t){e=e||10;const n=new Array(e);const o=new Array(e);let s=0;let i=0;let r;t=t!==undefined?t:1e3;return function c(a){const l=Date.now();const u=o[i];if(!r){r=l}n[s]=a;o[s]=l;let f=i;let d=0;while(f!==s){d+=n[f++];f=f%e}s=(s+1)%e;if(s===i){i=(i+1)%e}if(l-r<t){return}const h=u&&l-u;return h?Math.round(d*1e3/h):undefined}}function gt(e,t){let n=0;let o=1e3/t;let s;let i;const r=(t,o=Date.now())=>{n=o;s=null;if(i){clearTimeout(i);i=null}e.apply(null,t)};const c=(...e)=>{const t=Date.now();const c=t-n;if(c>=o){r(e,t)}else{s=e;if(!i){i=setTimeout((()=>{i=null;r(s)}),o-c)}}};const a=()=>s&&r(s);return[c,a]}const wt=(e,t,n=3)=>{let o=0;const s=bt(50,250);return gt((n=>{const i=n.loaded;const r=n.lengthComputable?n.total:undefined;const c=i-o;const a=s(c);const l=i<=r;o=i;const u={loaded:i,total:r,progress:r?i/r:undefined,bytes:c,rate:a?a:undefined,estimated:a&&r&&l?(r-i)/a:undefined,event:n,lengthComputable:r!=null,[t?"download":"upload"]:true};e(u)}),n)};const yt=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]};const vt=e=>(...t)=>be.asap((()=>e(...t)));const xt=Ke.hasStandardBrowserEnv?((e,t)=>n=>{n=new URL(n,Ke.origin);return e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)})(new URL(Ke.origin),Ke.navigator&&/(msie|trident)/i.test(Ke.navigator.userAgent)):()=>true;const kt=Ke.hasStandardBrowserEnv?{write(e,t,n,o,s,i){const r=[e+"="+encodeURIComponent(t)];be.isNumber(n)&&r.push("expires="+new Date(n).toGMTString());be.isString(o)&&r.push("path="+o);be.isString(s)&&r.push("domain="+s);i===true&&r.push("secure");document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Rt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ot(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function St(e,t,n){let o=!Rt(t);if(e&&(o||n==false)){return Ot(e,t)}return t}const Et=e=>e instanceof ut?{...e}:e;function Tt(e,t){t=t||{};const n={};function o(e,t,n,o){if(be.isPlainObject(e)&&be.isPlainObject(t)){return be.merge.call({caseless:o},e,t)}else if(be.isPlainObject(t)){return be.merge({},t)}else if(be.isArray(t)){return t.slice()}return t}function s(e,t,n,s){if(!be.isUndefined(t)){return o(e,t,n,s)}else if(!be.isUndefined(e)){return o(undefined,e,n,s)}}function i(e,t){if(!be.isUndefined(t)){return o(undefined,t)}}function r(e,t){if(!be.isUndefined(t)){return o(undefined,t)}else if(!be.isUndefined(e)){return o(undefined,e)}}function c(n,s,i){if(i in t){return o(n,s)}else if(i in e){return o(undefined,n)}}const a={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:c,headers:(e,t,n)=>s(Et(e),Et(t),n,true)};be.forEach(Object.keys(Object.assign({},e,t)),(function o(i){const r=a[i]||s;const l=r(e[i],t[i],i);be.isUndefined(l)&&r!==c||(n[i]=l)}));return n}const At=e=>{const t=Tt({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:r,auth:c}=t;t.headers=r=ut.from(r);t.url=Ne(St(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer);if(c){r.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let a;if(be.isFormData(n)){if(Ke.hasStandardBrowserEnv||Ke.hasStandardBrowserWebWorkerEnv){r.setContentType(undefined)}else if((a=r.getContentType())!==false){const[e,...t]=a?a.split(";").map((e=>e.trim())).filter(Boolean):[];r.setContentType([e||"multipart/form-data",...t].join("; "))}}if(Ke.hasStandardBrowserEnv){o&&be.isFunction(o)&&(o=o(t));if(o||o!==false&&xt(t.url)){const e=s&&i&&kt.read(i);if(e){r.set(s,e)}}}return t};const Ct=typeof XMLHttpRequest!=="undefined";const jt=Ct&&function(e){return new Promise((function t(n,o){const s=At(e);let i=s.data;const r=ut.from(s.headers).normalize();let{responseType:c,onUploadProgress:a,onDownloadProgress:l}=s;let u;let f,d;let h,p;function m(){h&&h();p&&p();s.cancelToken&&s.cancelToken.unsubscribe(u);s.signal&&s.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,true);b.timeout=s.timeout;function g(){if(!b){return}const t=ut.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders());const s=!c||c==="text"||c==="json"?b.responseText:b.response;const i={data:s,status:b.status,statusText:b.statusText,headers:t,config:e,request:b};pt((function e(t){n(t);m()}),(function e(t){o(t);m()}),i);b=null}if("onloadend"in b){b.onloadend=g}else{b.onreadystatechange=function e(){if(!b||b.readyState!==4){return}if(b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)){return}setTimeout(g)}}b.onabort=function t(){if(!b){return}o(new ge("Request aborted",ge.ECONNABORTED,e,b));b=null};b.onerror=function t(){o(new ge("Network Error",ge.ERR_NETWORK,e,b));b=null};b.ontimeout=function t(){let n=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const i=s.transitional||Ue;if(s.timeoutErrorMessage){n=s.timeoutErrorMessage}o(new ge(n,i.clarifyTimeoutError?ge.ETIMEDOUT:ge.ECONNABORTED,e,b));b=null};i===undefined&&r.setContentType(null);if("setRequestHeader"in b){be.forEach(r.toJSON(),(function e(t,n){b.setRequestHeader(n,t)}))}if(!be.isUndefined(s.withCredentials)){b.withCredentials=!!s.withCredentials}if(c&&c!=="json"){b.responseType=s.responseType}if(l){[d,p]=wt(l,true);b.addEventListener("progress",d)}if(a&&b.upload){[f,h]=wt(a);b.upload.addEventListener("progress",f);b.upload.addEventListener("loadend",h)}if(s.cancelToken||s.signal){u=t=>{if(!b){return}o(!t||t.type?new ht(null,e,b):t);b.abort();b=null};s.cancelToken&&s.cancelToken.subscribe(u);if(s.signal){s.signal.aborted?u():s.signal.addEventListener("abort",u)}}const w=mt(s.url);if(w&&Ke.protocols.indexOf(w)===-1){o(new ge("Unsupported protocol "+w+":",ge.ERR_BAD_REQUEST,e));return}b.send(i||null)}))};const Nt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController;let o;const s=function(e){if(!o){o=true;r();const t=e instanceof Error?e:this.reason;n.abort(t instanceof ge?t:new ht(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null;s(new ge(`timeout ${t} of ms exceeded`,ge.ETIMEDOUT))}),t);const r=()=>{if(e){i&&clearTimeout(i);i=null;e.forEach((e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}));e=null}};e.forEach((e=>e.addEventListener("abort",s)));const{signal:c}=n;c.unsubscribe=()=>be.asap(r);return c}};const Ft=Nt;const Pt=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let o=0;let s;while(o<n){s=o+t;yield e.slice(o,s);o=s}};const Ut=async function*(e,t){for await(const n of Bt(e)){yield*Pt(n,t)}};const Bt=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e){break}yield n}}finally{await t.cancel()}};const zt=(e,t,n,o)=>{const s=Ut(e,t);let i=0;let r;let c=e=>{if(!r){r=true;o&&o(e)}};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await s.next();if(t){c();e.close();return}let r=o.byteLength;if(n){let e=i+=r;n(e)}e.enqueue(new Uint8Array(o))}catch(e){c(e);throw e}},cancel(e){c(e);return s.return()}},{highWaterMark:2})};const It=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const _t=It&&typeof ReadableStream==="function";const Dt=It&&(typeof TextEncoder==="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer()));const Lt=(e,...t)=>{try{return!!e(...t)}catch(e){return false}};const qt=_t&&Lt((()=>{let e=false;const t=new Request(Ke.origin,{body:new ReadableStream,method:"POST",get duplex(){e=true;return"half"}}).headers.has("Content-Type");return e&&!t}));const Mt=64*1024;const Ht=_t&&Lt((()=>be.isReadableStream(new Response("").body)));const $t={stream:Ht&&(e=>e.body)};It&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!$t[t]&&($t[t]=be.isFunction(e[t])?e=>e[t]():(e,n)=>{throw new ge(`Response type '${t}' is not supported`,ge.ERR_NOT_SUPPORT,n)})}))})(new Response);const Kt=async e=>{if(e==null){return 0}if(be.isBlob(e)){return e.size}if(be.isSpecCompliantForm(e)){const t=new Request(Ke.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}if(be.isArrayBufferView(e)||be.isArrayBuffer(e)){return e.byteLength}if(be.isURLSearchParams(e)){e=e+""}if(be.isString(e)){return(await Dt(e)).byteLength}};const Jt=async(e,t)=>{const n=be.toFiniteNumber(e.getContentLength());return n==null?Kt(t):n};const Vt=It&&(async e=>{let{url:t,method:n,data:o,signal:s,cancelToken:i,timeout:r,onDownloadProgress:c,onUploadProgress:a,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:d}=At(e);l=l?(l+"").toLowerCase():"text";let h=Ft([s,i&&i.toAbortSignal()],r);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let b;try{if(a&&qt&&n!=="get"&&n!=="head"&&(b=await Jt(u,o))!==0){let e=new Request(t,{method:"POST",body:o,duplex:"half"});let n;if(be.isFormData(o)&&(n=e.headers.get("content-type"))){u.setContentType(n)}if(e.body){const[t,n]=yt(b,wt(vt(a)));o=zt(e.body,Mt,t,n)}}if(!be.isString(f)){f=f?"include":"omit"}const s="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:o,duplex:"half",credentials:s?f:undefined});let i=await fetch(p);const r=Ht&&(l==="stream"||l==="response");if(Ht&&(c||r&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=be.toFiniteNumber(i.headers.get("content-length"));const[n,o]=c&&yt(t,wt(vt(c),true))||[];i=new Response(zt(i.body,Mt,n,(()=>{o&&o();m&&m()})),e)}l=l||"text";let g=await $t[be.findKey($t,l)||"text"](i,e);!r&&m&&m();return await new Promise(((t,n)=>{pt(t,n,{data:g,headers:ut.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(t){m&&m();if(t&&t.name==="TypeError"&&/fetch/i.test(t.message)){throw Object.assign(new ge("Network Error",ge.ERR_NETWORK,e,p),{cause:t.cause||t})}throw ge.from(t,t&&t.code,e,p)}});const Wt={http:ve,xhr:jt,fetch:Vt};be.forEach(Wt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Xt=e=>`- ${e}`;const Gt=e=>be.isFunction(e)||e===null||e===false;const Zt={getAdapter:e=>{e=be.isArray(e)?e:[e];const{length:t}=e;let n;let o;const s={};for(let i=0;i<t;i++){n=e[i];let t;o=n;if(!Gt(n)){o=Wt[(t=String(n)).toLowerCase()];if(o===undefined){throw new ge(`Unknown adapter '${t}'`)}}if(o){break}s[t||"#"+i]=o}if(!o){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(t===false?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Xt).join("\n"):" "+Xt(e[0]):"as no adapter specified";throw new ge(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:Wt};function Qt(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new ht(null,e)}}function Yt(e){Qt(e);e.headers=ut.from(e.headers);e.data=ft.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=Zt.getAdapter(e.adapter||Qe.adapter);return t(e).then((function t(n){Qt(e);n.data=ft.call(e,e.transformResponse,n);n.headers=ut.from(n.headers);return n}),(function t(n){if(!dt(n)){Qt(e);if(n&&n.response){n.response.data=ft.call(e,e.transformResponse,n.response);n.response.headers=ut.from(n.response.headers)}}return Promise.reject(n)}))}const en="1.8.4";const tn={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{tn[e]=function n(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const nn={};tn.transitional=function e(t,n,o){function s(e,t){return"[Axios v"+en+"] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(e,o,i)=>{if(t===false){throw new ge(s(o," has been removed"+(n?" in "+n:"")),ge.ERR_DEPRECATED)}if(n&&!nn[o]){nn[o]=true;console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))}return t?t(e,o,i):true}};tn.spelling=function e(t){return(e,n)=>{console.warn(`${n} is likely a misspelling of ${t}`);return true}};function on(e,t,n){if(typeof e!=="object"){throw new ge("options must be an object",ge.ERR_BAD_OPTION_VALUE)}const o=Object.keys(e);let s=o.length;while(s-- >0){const i=o[s];const r=t[i];if(r){const t=e[i];const n=t===undefined||r(t,i,e);if(n!==true){throw new ge("option "+i+" must be "+n,ge.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new ge("Unknown option "+i,ge.ERR_BAD_OPTION)}}}const sn={assertOptions:on,validators:tn};const rn=sn.validators;class cn{constructor(e){this.defaults=e;this.interceptors={request:new Pe,response:new Pe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{if(!e.stack){e.stack=n}else if(n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))){e.stack+="\n"+n}}catch(e){}}throw e}}_request(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=Tt(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:s}=t;if(n!==undefined){sn.assertOptions(n,{silentJSONParsing:rn.transitional(rn.boolean),forcedJSONParsing:rn.transitional(rn.boolean),clarifyTimeoutError:rn.transitional(rn.boolean)},false)}if(o!=null){if(be.isFunction(o)){t.paramsSerializer={serialize:o}}else{sn.assertOptions(o,{encode:rn.function,serialize:rn.function},true)}}if(t.allowAbsoluteUrls!==undefined);else if(this.defaults.allowAbsoluteUrls!==undefined){t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls}else{t.allowAbsoluteUrls=true}sn.assertOptions(t,{baseUrl:rn.spelling("baseURL"),withXsrfToken:rn.spelling("withXSRFToken")},true);t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&be.merge(s.common,s[t.method]);s&&be.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]}));t.headers=ut.concat(i,s);const r=[];let c=true;this.interceptors.request.forEach((function e(n){if(typeof n.runWhen==="function"&&n.runWhen(t)===false){return}c=c&&n.synchronous;r.unshift(n.fulfilled,n.rejected)}));const a=[];this.interceptors.response.forEach((function e(t){a.push(t.fulfilled,t.rejected)}));let l;let u=0;let f;if(!c){const e=[Yt.bind(this),undefined];e.unshift.apply(e,r);e.push.apply(e,a);f=e.length;l=Promise.resolve(t);while(u<f){l=l.then(e[u++],e[u++])}return l}f=r.length;let d=t;u=0;while(u<f){const e=r[u++];const t=r[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Yt.call(this,d)}catch(e){return Promise.reject(e)}u=0;f=a.length;while(u<f){l=l.then(a[u++],a[u++])}return l}getUri(e){e=Tt(this.defaults,e);const t=St(e.baseURL,e.url,e.allowAbsoluteUrls);return Ne(t,e.params,e.paramsSerializer)}}be.forEach(["delete","get","head","options"],(function e(t){cn.prototype[t]=function(e,n){return this.request(Tt(n||{},{method:t,url:e,data:(n||{}).data}))}}));be.forEach(["post","put","patch"],(function e(t){function n(e){return function n(o,s,i){return this.request(Tt(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}cn.prototype[t]=n();cn.prototype[t+"Form"]=n(true)}));const an=cn;class ln{constructor(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}let t;this.promise=new Promise((function e(n){t=n}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;while(t-- >0){n._listeners[t](e)}n._listeners=null}));this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e);t=e})).then(e);o.cancel=function e(){n.unsubscribe(t)};return o};e((function e(o,s,i){if(n.reason){return}n.reason=new ht(o,s,i);t(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}}unsubscribe(e){if(!this._listeners){return}const t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}}toAbortSignal(){const e=new AbortController;const t=t=>{e.abort(t)};this.subscribe(t);e.signal.unsubscribe=()=>this.unsubscribe(t);return e.signal}static source(){let e;const t=new ln((function t(n){e=n}));return{token:t,cancel:e}}}const un=ln;function fn(e){return function t(n){return e.apply(null,n)}}function dn(e){return be.isObject(e)&&e.isAxiosError===true}const hn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(hn).forEach((([e,t])=>{hn[t]=e}));const pn=hn;function mn(e){const t=new an(e);const n=d(an.prototype.request,t);be.extend(n,an.prototype,t,{allOwnKeys:true});be.extend(n,t,null,{allOwnKeys:true});n.create=function t(n){return mn(Tt(e,n))};return n}const bn=mn(Qe);bn.Axios=an;bn.CanceledError=ht;bn.CancelToken=un;bn.isCancel=dt;bn.VERSION=en;bn.toFormData=Ee;bn.AxiosError=ge;bn.Cancel=bn.CanceledError;bn.all=function e(t){return Promise.all(t)};bn.spread=fn;bn.isAxiosError=dn;bn.mergeConfig=Tt;bn.AxiosHeaders=ut;bn.formToJSON=e=>Xe(be.isHTMLForm(e)?new FormData(e):e);bn.getAdapter=Zt.getAdapter;bn.HttpStatusCode=pn;bn.default=bn;const gn=bn;const wn=u.includes(window.location.origin)?"default:development.6348f953f52485d19daf03992f2123a36e9eae59c5ca7f8736dc2b67":"default:production.4808a77b2a149e1796391b480b4fb501d73aa1e11123f60e07809ced";const yn=()=>gn.get("https://unleash.verdocs.com/api/frontend",{headers:{Accept:"application/json",Authorization:wn}}).then((e=>e.data)).catch((e=>{console.log("Unleash: Unable to fetch feature flags",e);throw e}));const vn='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{gap:12px;width:300px;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:88px}verdocs-contact-picker form .pin-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .pin-code>input{-ms-flex:0 0 197px;flex:0 0 197px;font-size:14px}verdocs-contact-picker form .address{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .address>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form .zip-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .zip-code>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 80px;flex:0 0 80px;font-size:13px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message textarea{width:100%;padding:5px 7px;border-radius:4px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-contact-picker form input{-ms-flex:1;flex:1;padding:6px;font-size:14px;border-radius:3px;border:1px solid rgba(112, 122, 229, 0.3725490196)}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}#verdocs-contact-picker-suggestions .dropdown{max-height:225px;overflow-y:scroll;background:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}#verdocs-contact-picker-suggestions .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-contact-picker-suggestions .dropdown .suggestion svg{width:32px;height:32px}#verdocs-contact-picker-suggestions .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}#verdocs-contact-picker-suggestions .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#verdocs-contact-picker-suggestions .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}#verdocs-contact-picker-suggestions .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}#verdocs-contact-picker-suggestions .dropdown .suggestion:hover{background:#eee;cursor:pointer}';const xn=vn;const kn=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>`;const Rn=class{constructor(n){e(this,n);this.searchContacts=t(this,"searchContacts",7);this.exit=t(this,"exit",7);this.next=t(this,"next",7);this.endpoint=i.getDefault();this.templateRole=null;this.contactSuggestions=[];this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.auth_methods=[];this.passcode="";this.firstNameFieldId=`verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2,11)}`;this.lastNameFieldId=`verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2,11)}`;this.emailFieldId=`verdocs-contact-picker-email-${Math.random().toString(36).substring(2,11)}`;this.phoneFieldId=`verdocs-contact-picker-phone-${Math.random().toString(36).substring(2,11)}`;this.featureFlags=null;this.activeEntitlements={}}componentWillLoad(){this.endpoint.loadSession();if(this.templateRole){const e=r(this.templateRole);const t=e.split(" ");const n=this.templateRole.first_name||t.shift()||"";const o=this.templateRole.last_name||t.join(" ")||"";this.first_name=n;this.last_name=o;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.auth_methods=this.templateRole.auth_methods||[];this.passcode=this.templateRole.passcode||""}c(this.endpoint).then((e=>{this.activeEntitlements=e;console.log("[CONTACT PICKER] Loaded entitlements",e)})).catch((e=>console.log("[CONTACT PICKER] Error loading entitlements, some features may be disabled.",e)));yn().then((e=>{this.featureFlags=e;console.log("[CONTACT PICKER] Loaded feature flags",e)})).catch((e=>{console.log("[CONTACT PICKER] Unable to fetch feature flags, some features may be disabled.",e)}))}handleFirstNameChange(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})}handleLastNameChange(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})}handleCancel(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()}handleSubmit(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator,auth_methods:this.auth_methods,passcode:this.passcode,address:this.address,zip:this.zip})}handleSelectSuggestion(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false}render(){var e,t,s,i,c,l,u,d,h,p,m,b,g,w,y,v,x,k;const R=this.first_name&&this.last_name&&a(this.email);const O=!this.auth_methods.length||this.auth_methods.includes("passcode")&&!!this.passcode||this.auth_methods.includes("kba")&&!!this.first_name&&!!this.last_name||this.auth_methods.includes("email")&&!!this.email||this.auth_methods.includes("sms")&&!!this.phone;const S=R&&O;const E=((s=(t=(e=this.featureFlags)===null||e===void 0?void 0:e.toggles)===null||t===void 0?void 0:t.find((e=>e.name==="sms")))===null||s===void 0?void 0:s.enabled)===true;const T=[];if(((l=(c=(i=this.featureFlags)===null||i===void 0?void 0:i.toggles)===null||c===void 0?void 0:c.find((e=>e.name==="passcode-verification")))===null||l===void 0?void 0:l.enabled)===true){T.push({label:"Passcode",value:"passcode"})}if(((h=(d=(u=this.featureFlags)===null||u===void 0?void 0:u.toggles)===null||d===void 0?void 0:d.find((e=>e.name==="email-verification")))===null||h===void 0?void 0:h.enabled)===true){T.push({label:"Email",value:"email"})}if(E&&((b=(m=(p=this.featureFlags)===null||p===void 0?void 0:p.toggles)===null||m===void 0?void 0:m.find((e=>e.name==="sms-verification")))===null||b===void 0?void 0:b.enabled)===true&&!!this.activeEntitlements.sms_auth){T.push({label:"SMS (One-Time Code)",value:"sms"})}if(((y=(w=(g=this.featureFlags)===null||g===void 0?void 0:g.toggles)===null||w===void 0?void 0:w.find((e=>e.name==="kba-verification")))===null||y===void 0?void 0:y.enabled)===true&&!!this.activeEntitlements.kba_auth){T.push({label:"Knowledge-Based (KBA)",value:"kba"})}if(((k=(x=(v=this.featureFlags)===null||v===void 0?void 0:v.toggles)===null||x===void 0?void 0:x.find((e=>e.name==="id-verification")))===null||k===void 0?void 0:k.enabled)===true&&!!this.activeEntitlements.id_auth){T.push({label:"ID Check",value:"id"})}return n("form",{key:"cba230aed78c493105a007d965938ef36c0676c5",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},n("div",{key:"436c7454a56df0f535f3aefdfff577a88dafa22c",class:"row"},n("label",{key:"b281d4c25f7b940d50700f808cdc9e7c3e235c63",htmlFor:this.firstNameFieldId},"Name:"),n("div",{key:"ef6316233086a5b6f7d5230e64134d3d4d370401",class:"names-row"},n("input",{key:"bb1114f98ee766c4da332c635e9aabfddb0ea0c5",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.first_name,placeholder:"First...",onFocus:()=>{setTimeout((()=>{var e;this.showSuggestions=((e=this.contactSuggestions)===null||e===void 0?void 0:e.length)>0}),100)},onInput:e=>this.handleFirstNameChange(e)}),n("input",{key:"8165b6a10ccec8cc699965a0e457c4984ba7e6d9",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.last_name,placeholder:"Last...",onFocus:()=>{setTimeout((()=>{var e;this.showSuggestions=((e=this.contactSuggestions)===null||e===void 0?void 0:e.length)>0}),100)},onInput:e=>this.handleLastNameChange(e)})),this.showSuggestions&&n("verdocs-portal",{key:"50bb3ba19b9ebedaf5dc6b42ab9ee56b49baf316",anchor:this.firstNameFieldId,onClickAway:()=>this.showSuggestions=false,id:"verdocs-contact-picker-suggestions"},n("div",{key:"06d909db8340e219f56520cba088f39d024e23c9",class:"dropdown"},this.contactSuggestions.filter((e=>!this.first_name||e.first_name.toLowerCase().includes(this.first_name.toLowerCase()))).map((e=>{var t;return n("div",{key:(t=e.id)!==null&&t!==void 0?t:e.email,class:"suggestion",onClick:t=>this.handleSelectSuggestion(t,e)},e.picture?n("img",{alt:"Avatar",class:"avatar",src:e.picture}):n("div",{class:"avatar",innerHTML:kn}),n("div",{class:"details"},n("div",{class:"name"},r(e)),e.email&&n("div",{class:"destination"},e.email),e.phone&&n("div",{class:"destination"},e.phone)))}))))),n("div",{key:"0fd66b40717c81b65a301ced6b6bf4b6ff7b6626",class:"row"},n("label",{key:"70956784b72087d8c1868595ec40dfbdee34ca87",htmlFor:this.emailFieldId},"Email:"),n("input",{key:"35582c90e48b6f532fc75cc51525ca06162ebcc8",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.email,placeholder:"Invite/verify via email...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.email=e.target.value})),E&&n("div",{key:"626950e0213dbc8fab07af0ac7682db19638c73c",class:"row"},n("label",{key:"12cfdd054564af5cc3573785d884c87b7b50bae4",htmlFor:this.phoneFieldId},"Phone:"),n("input",{key:"8ecb757d6ee8acf6041c75f4fc0621ece470fcdf",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.phone,placeholder:"Invite/verify via SMS...",onFocus:()=>this.showSuggestions=false,onInput:e=>{this.phone=f(e.target.value)}})),n(o,{key:"2023b0c925497df85590f0294597c38bde90b1da"},T.length>0&&n("div",{key:"eb16a51636c12027f228714283bc3a045b04f364",class:"row"},n("label",{key:"c53d976fa49aa4ff32d6e176aed1a425a19befca"},"Recipient Verification:"),n("verdocs-multiselect",{key:"6b84fd7b99c4b4f9e21242d444ead7238d3b12ec",label:"",placeholder:"None",options:T,selectedOptions:this.auth_methods,onSelectionChanged:e=>{this.auth_methods=e.detail.selectedOptions}})),this.auth_methods.includes("passcode")&&n("div",{key:"6e5059ea257eef3f44090348d5b264a0d4fca331",class:"row pin-code"},n("label",{key:"3c38728d9833d750e097c96b1df655d2c624cbaf",htmlFor:this.phoneFieldId},"Passcode:"),n("input",{key:"c067ad0b5e64554869d382b30034ad06f3f2287c",id:"verdocs-passcode",name:"verdocs-passcode",type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.passcode,placeholder:"4-8 digits recommended...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.passcode=e.target.value}))),n("div",{key:"aea4f4504c415602990370c74b8cbc4888cdb9c4",class:"row message"},n("label",{key:"293b04061121e45a161299a7c67742b35450f73e",htmlFor:"verdocs-contact-picker-message"},"Message:"),n("textarea",{key:"27b597556563377a843865cfa1205d28c5a35440",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message","data-lpignore":"true",autocomplete:"blocked",placeholder:"Optional message to include in invitation...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.message=e.target.value},this.message)),n("div",{key:"cd57ffae6c1fdb990b5cee5d2f93315b1e431ae2",class:"buttons"},n("div",{key:"229c636cd7d61eaeece868f1d64a787465913223",class:"flex-fill"}),n("verdocs-button",{key:"0014bda0bcef66e26df9cfad2e4ca09bad08419a",variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),n("verdocs-button",{key:"cc2456cc0e493b0449750e3950e28c6c3aa69fa2",label:"OK",size:"small",disabled:!S,onClick:!S?()=>{}:e=>this.handleSubmit(e)})))}};Rn.style=xn;const On='@-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-multiselect{width:100%;display:block;margin:0 0 10px 0;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-multiselect .input-wrapper{width:100%;position:relative}verdocs-multiselect .input-wrapper .icon{top:6px;right:6px;width:18px;height:18px;z-index:10;position:absolute}verdocs-multiselect.open .input-wrapper .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}verdocs-multiselect .trigger{gap:3px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;border-radius:4px;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px 32px 5px 7px;background:#ffffff;border:1px solid #707ae5}verdocs-multiselect .trigger::-webkit-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::-moz-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger:-ms-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::-ms-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .selected-option{color:white;font-size:12px;padding:2px 6px;border-radius:3px;display:inline-block;background:#46497d}verdocs-multiselect .input-label{display:block;font-weight:700;font-size:14px;margin:0 0 4px 0;color:#555570}#verdocs-multiselect-menu-items{width:200px;z-index:10000;position:absolute;border-radius:5px;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;border:1px solid #654dcb}#verdocs-multiselect-menu-items .option{display:-ms-flexbox;display:flex;gap:4px;padding:5px 8px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-multiselect-menu-items label{font-size:13px}';const Sn=On;const En=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /></svg>`;const Tn=class{constructor(n){e(this,n);this.selectionChanged=t(this,"selectionChanged",7);this.label="";this.placeholder="Select...";this.selectedOptions=[];this.showPicker=false}handleToggleOption(e,t){var n;if(e.target.checked){this.selectedOptions=[...this.selectedOptions,t.value]}else{this.selectedOptions=this.selectedOptions.filter((e=>e!==t.value))}(n=this.selectionChanged)===null||n===void 0?void 0:n.emit({selectedOptions:this.selectedOptions})}render(){const e=`verdocs-dropdown-${l(8)}`;return n(s,{key:"7fa4d31d423894e8caa3dffd1fb46752b7b87ee5",class:this.showPicker?"open":"closed"},n("label",{key:"891a7d7ee2867d598f2f3ea6609148a47a9a7166"},this.label?n("div",{class:"input-label"},this.label+":"):n("div",null),n("div",{key:"c165f68315aec9d1aca6e9f2214ece090f496363",class:"input-wrapper"},n("button",{key:"2297bfb9c84abd5da4c73dfcbae15fe2f5f04c1c",id:e,class:"trigger",value:"",onClick:()=>this.showPicker=true},this.selectedOptions.length===0?n("span",{class:"placeholder"},this.placeholder):this.selectedOptions.map((e=>{var t;return n("span",{class:"selected-option"},((t=this.options.find((t=>t.value===e)))===null||t===void 0?void 0:t.label)||"Unknown")}))),n("div",{key:"e4929befc449d9be400305ee3e0aeb1c171583fd",class:"icon",innerHTML:En}),this.showPicker&&n("verdocs-portal",{key:"42016ae18aa4acd4c5aac8f2ea3a7d6126116aa6",anchor:e,voffset:2,onClickAway:()=>this.showPicker=false,id:"verdocs-multiselect-menu-items"},this.options.map(((e,t)=>n("div",{class:"option",onClick:()=>this.showPicker=false},n("verdocs-checkbox",{size:"small",id:`verdocs-multi-select-opt-${t}`,value:e.value,checked:this.selectedOptions.includes(e.value),onInput:t=>this.handleToggleOption(t,e)}),n("label",{htmlFor:`verdocs-multi-select-option-${t}`},e.label))))))))}};Tn.style=Sn;export{Rn as verdocs_contact_picker,Tn as verdocs_multiselect};
2
+ //# sourceMappingURL=p-688bd38f.entry.js.map