@verdocs/web-sdk 1.4.6 → 1.4.7
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.
- package/dist/cjs/{Auth-e68977a3.js → Auth-4ec35ac7.js} +10 -3
- package/dist/cjs/{Token-1ec62bd3.js → Token-ac80819a.js} +1 -0
- package/dist/cjs/verdocs-auth.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/components/Auth.js +10 -3
- package/dist/components/Token.js +1 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{Auth-b330f209.js → Auth-15cd42a8.js} +10 -3
- package/dist/esm/{Token-a587e3ad.js → Token-ce37bd9d.js} +1 -1
- package/dist/esm/verdocs-auth.entry.js +2 -2
- package/dist/esm/verdocs-search-activity_2.entry.js +2 -2
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/Auth-15cd42a8.js +1 -0
- package/dist/esm-es5/{Token-a587e3ad.js → Token-ce37bd9d.js} +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-203fd748.system.entry.js → p-0c0b4a10.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9428614b.system.entry.js → p-2b57857d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0b1fb53f.entry.js → p-69ef22bd.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6348272c.js → p-737b2e99.js} +1 -1
- package/dist/verdocs-web-sdk/p-8730dc92.system.js +1 -0
- package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-0c30002e.entry.js → p-a7cfe6fc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-216a4759.system.entry.js → p-b9164c4b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e3659c64.system.js → p-cec13589.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-e6e2894e.js +1 -0
- package/dist/verdocs-web-sdk/{p-da850d97.entry.js → p-ea6d6dc7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/Auth-b330f209.js +0 -1
- package/dist/verdocs-web-sdk/p-3820c9a2.js +0 -1
- package/dist/verdocs-web-sdk/p-e93ac86f.system.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-caed7818.system.js","./p-e3659c64.system.js","./p-5dfd73f9.system.js"],(function(e){"use strict";var t,n,o,i,r,a,c,s;return{setters:[function(e){t=e.r;n=e.h;o=e.H},function(e){i=e.g;r=e.d;a=e.V;c=e.s},function(e){s=e.B}],execute:function(){function l(e){switch(e%10){case 0:return e===0?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function d(e,t){return e*t}var u=undefined&&undefined.__assign||function(){u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return u.apply(this,arguments)};var f=undefined&&undefined.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var p=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var h=function(e,t,n,o){return f(void 0,void 0,void 0,(function(){return p(this,(function(r){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),u({role_name:t,action:n},o||{})).then((function(e){return e.data}))]}))}))};var v=new RegExp(/\+[1-9]\d{6,14}/g);function g(e){return e!==null&&e.length<16&&e.length>6&&v.test(e)||e===""||e===null}var b=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var x=function(e){return b.test(e)};var m=function(e){return g(e)};var y=undefined&&undefined.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var w=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var k=function(e){return y(void 0,void 0,void 0,(function(){return w(this,(function(t){return[2,i().api.get("/documents/".concat(e.documentId,"/recipients/").concat(encodeURIComponent(e.roleId),"/invitation/").concat(e.inviteCode)).then((function(e){var t,n;var o=((t=e.headers)===null||t===void 0?void 0:t.signer_token)||"";var a=r(o);i().setAuthorization((n=e.headers)===null||n===void 0?void 0:n.signer_token);return{recipient:e.data,session:a,signerToken:o}}))]}))}))};var _=function(e){return y(void 0,void 0,void 0,(function(){return w(this,(function(t){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))}))};var I=function(e,t){return y(void 0,void 0,void 0,(function(){return w(this,(function(n){return[2,i().api.get("/documents/".concat(e,"/envelope_documents/").concat(t,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return s.from(e.data,"binary").toString("base64")}))]}))}))};var R=function(e,t,n){return y(void 0,void 0,void 0,(function(){return w(this,(function(o){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),n).then((function(e){return e.data}))]}))}))};var S='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';var C="https://stage-api.verdocs.com";var F=e("verdocs_sign",function(){function e(e){t(this,e);this.documentid=null;this.roleid=null;this.invitecode=null;this.endpoint=null;this.recipient=null;this.signerToken=null;this.pdfUrl=null;this.recipientIndex=-1;this.document=null;this.fields=[];this.hasSignature=false;this.nextButtonLabel="Start";this.focusedField=""}e.prototype.componentWillLoad=function(){var e=(new a).setBaseURL(C);c(e)};e.prototype.componentDidLoad=function(){return y(this,void 0,void 0,(function(){var e,t,n,o,r,a;var c=this;return w(this,(function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);return[4,k({documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode})];case 1:e=s.sent(),t=e.session,n=e.recipient,o=e.signerToken;console.log("[SIGN] Got signing session",t);console.log("[SIGN] Recipient",n);this.recipient=n;this.signerToken=o;i().setSigningAuthorization(o);if(this.recipient.agreed){this.nextButtonLabel="Next"}return[4,_(this.documentid)];case 2:r=s.sent();this.document=r;console.log("[SIGN] Document",r);this.pdfUrl="".concat(C,"/documents/").concat(this.documentid,"/envelope_documents/").concat(r.envelope_document_id,"?file=true");this.recipientIndex=this.document.recipients.findIndex((function(e){return e.role_name==c.roleid}));if(this.recipientIndex>-1){console.log("Found recipient",this.document.recipients[this.recipientIndex])}this.fields=this.document.fields.filter((function(e){return e.recipient_role===c.roleid}));console.log("Loaded fields",this.fields);return[3,4];case 3:a=s.sent();console.log("Error with signing session",a);return[3,4];case 4:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;console.log("agree clicked");h(this.documentid,this.roleid,"update",{agreed:true}).then((function(t){console.log("update result",t);e.nextButtonLabel="Next";e.recipient=t})).catch((function(e){console.log("update failure",e)}))};e.prototype.savePDF=function(){return y(this,void 0,void 0,(function(){var e,t,n,o;return w(this,(function(i){switch(i.label){case 0:e="".concat(this.document.name," - ").concat(this.document.updated_at.split("T")[0],".pdf");return[4,I(this.documentid,this.document.envelope_document_id)];case 1:t=i.sent();n=new XMLHttpRequest;n.responseType="blob";n.onload=function(){var t=document.createElement("a");t.href=window.URL.createObjectURL(n.response);t.download=e;t.style.display="none";document.body.appendChild(t);t.click();t.remove()};o="data:application/pdf;base64,".concat(t);console.log("url",o.length,o);n.open("GET","data:application/pdf;base64,".concat(t));n.send();return[2]}}))}))};e.prototype.handleOptionSelected=function(e){return y(this,void 0,void 0,(function(){return w(this,(function(t){switch(e.detail.id){case"later":if(!(window===null||window===void 0?void 0:window["STORYBOOK_ENV"])){window.alert("User intends to sign later.")}break;case"claim":break;case"decline":break;case"print":break;case"download":this.savePDF().catch((function(){}));break}return[2]}))}))};e.prototype.handleFieldChange=function(e,t,n){return y(this,void 0,void 0,(function(){var o;return w(this,(function(i){console.log("fieldChange",e,t.detail);switch(e.type){case"textbox":R(this.documentid,e.name,{prepared:false,value:t.detail}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"checkbox_group":R(this.documentid,e.name,{prepared:false,value:{options:[{id:n,checked:t.detail}]}}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"radio_button_group":o=e.settings.options.map((function(e){return{id:e.id,selected:n===e.id}}));R(this.documentid,e.name,{prepared:false,value:{options:o}}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"dropdown":R(this.documentid,e.name,{prepared:false,value:t.detail}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail);break}return[2]}))}))};e.prototype.renderCheckboxGroupOption=function(e,t,o,i){var r=this;var a=d(e.xRatio,o.x);var c=d(e.yRatio,o.y);var s={left:"".concat(a,"px"),bottom:"".concat(c,"px"),position:"absolute",transform:"scale(".concat(e.xRatio,", ").concat(e.yRatio,")"),backgroundColor:l(this.recipientIndex)};return n("verdocs-field-checkbox",{style:s,order:i,value:o.checked,onFieldChange:function(e){return r.handleFieldChange(t,e,o.id)}})};e.prototype.renderRadioGroupOption=function(e,t,o,i){var r=this;var a=d(e.xRatio,o.x);var c=d(e.yRatio,o.y);var s={left:"".concat(a,"px"),bottom:"".concat(c,"px"),position:"absolute",transform:"scale(".concat(e.xRatio,", ").concat(e.yRatio,")"),backgroundColor:l(this.recipientIndex)};return n("verdocs-field-radio-button",{style:s,order:i,value:o.id,name:t.name,checked:o.selected,onFieldChange:function(e){return r.handleFieldChange(t,e,o.id)}})};e.prototype.renderField=function(e,t){var o=this;var i=e.required,r=i===void 0?false:i,a=e.settings,c=a===void 0?{}:a;var s=c.x,u=s===void 0?0:s,f=c.y,p=f===void 0?0:f,h=c.base64,v=h===void 0?"":h,g=c.placeholder,b=g===void 0?"":g,x=c.options,m=x===void 0?[]:x,y=c.value,w=y===void 0?"":y,k=c.result,_=k===void 0?"":k;var I=this.pdfPageInfo.pages.find((function(t){return t.pageNumber===e.page}));if(!I){console.log("Unable to render invalid field",e);return n("div",{class:"invalid-field"},"Invalid field.")}var R=d(I.xRatio,u);var S=d(I.yRatio,p);var C={left:"".concat(R,"px"),bottom:"".concat(S,"px"),position:"absolute",transform:"scale(".concat(I.xRatio,", ").concat(I.yRatio,")"),backgroundColor:e.settings.rgba||l(this.recipientIndex)};if(e.settings.height){C.height="".concat(e.settings.height,"px")}if(e.settings.width){C.width="".concat(e.settings.width,"px")}console.log("rendering field",e.type,e);var F="field-".concat(e.name);switch(e.type){case"signature":return n("verdocs-field-signature",{style:C,value:v,required:r,id:F});case"initial":return n("verdocs-field-initial",{style:C,required:r,id:F});case"textbox":return n("verdocs-field-textbox",{style:C,order:t,value:_||"",placeholder:b,id:F,onFieldChange:function(t){return o.handleFieldChange(e,t)}});case"textarea":return n("verdocs-field-textarea",{style:C,placeholder:b||"",id:F});case"date":return n("verdocs-field-date",{style:C,order:t,value:_||"",placeholder:b,required:r,id:F});case"dropdown":return n("verdocs-field-dropdown",{style:C,options:m,value:w,required:r,id:F,onFieldChange:function(t){return o.handleFieldChange(e,t)}});case"checkbox":return n("verdocs-field-checkbox",{style:C,value:_||"",id:F});case"checkbox_group":return e.settings.options.map((function(t,n){return o.renderCheckboxGroupOption(I,e,t,n)}));case"radio_button_group":return e.settings.options.map((function(t,n){return o.renderRadioGroupOption(I,e,t,n)}));case"attachment":return n("verdocs-field-attachment",{style:C,value:_||"",id:F});case"payment":return n("verdocs-field-payment",{style:C,field:e,id:F});default:console.log("[SIGN] Skipping unsupported field type",e)}return n("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')};e.prototype.isFieldValid=function(e){var t,n,o,i,r,a,c,s,l,d,u,f;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return x(((n=e.settings)===null||n===void 0?void 0:n.result)||"");case"phone":return m(((o=e.settings)===null||o===void 0?void 0:o.result)||"");default:return!!((i=e.settings)===null||i===void 0?void 0:i.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!((r=e.settings)===null||r===void 0?void 0:r.result);case"dropdown":return!!((a=e.settings)===null||a===void 0?void 0:a.value);case"checkbox_group":var p=(((s=(c=e.settings)===null||c===void 0?void 0:c.options)===null||s===void 0?void 0:s.filter((function(e){return e.checked})))||[]).length;return p>=(((l=e.settings)===null||l===void 0?void 0:l.minimum_checked)||0)&&p<=(((d=e.settings)===null||d===void 0?void 0:d.maximum_checked)||999);case"radio_button_group":return(((f=(u=e.settings)===null||u===void 0?void 0:u.options)===null||f===void 0?void 0:f.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleDocumentRendered=function(e){console.log("[SIGN] Document rendered",e.detail);this.pdfPageInfo=e.detail};e.prototype.handleNext=function(){var e=this;var t=this.fields.filter((function(e){return e.required}));console.log("required Fields",t);var n=t.findIndex((function(t){return t.name===e.focusedField}));console.log("focused Index",n);var o=n+1;if(o>=t.length){o=0}var i=t[o];console.log("next required fielod",i);if(i){var r=document.getElementById("field-".concat(i.name));r===null||r===void 0?void 0:r.focusField();this.focusedField=i.name}};e.prototype.render=function(){var e=this;var t,i,r,a,c;var s=[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:true},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];return n(o,{class:{storybook:!!(window===null||window===void 0?void 0:window["STORYBOOK_ENV"]),agreed:(t=this.recipient)===null||t===void 0?void 0:t.agreed}},n("div",{class:"header"},n("div",{class:"intro"},"Please review and act on these documents."),n("div",{class:"toolbar"},n("div",{class:"tools"},n("verdocs-dropdown",{options:s,onOptionSelected:function(t){return e.handleOptionSelected(t)}}),!((i=this.recipient)===null||i===void 0?void 0:i.agreed)?n("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},n("div",{class:"agree-checkbox"},n("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:function(){return e.handleClickAgree()}}),n("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."):n("div",{style:{flex:"1"}}),n("verdocs-button",{label:this.nextButtonLabel,disabled:!((r=this.recipient)===null||r===void 0?void 0:r.agreed),onClick:function(){return e.handleNext()}})))),!((a=this.recipient)===null||a===void 0?void 0:a.agreed)?n("div",{class:"cover"}):n("div",{style:{display:"none"}}),n("div",{class:"document"},this.pdfUrl?n("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:function(t){return e.handleDocumentRendered(t)}}):n("verdocs-loader",null),(((c=this.pdfPageInfo)===null||c===void 0?void 0:c.pages)||[]).map((function(t){var o;return n("div",{class:"page-controls",style:{height:"".concat(t.height,"px"),width:"".concat(t.width,"px"),top:"".concat(t.canvasTop,"px"),margin:"0 auto"}},((o=e.pdfPageInfo)===null||o===void 0?void 0:o.numRendered)>0?e.fields.filter((function(e){return e.page===t.pageNumber})).map((function(t,n){return e.renderField(t,n)})):n("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))};return e}());F.style=S}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-caed7818.system.js","./p-cec13589.system.js","./p-5dfd73f9.system.js"],(function(e){"use strict";var t,n,o,i,r,a,c,s;return{setters:[function(e){t=e.r;n=e.h;o=e.H},function(e){i=e.a;r=e.d;a=e.V;c=e.s},function(e){s=e.B}],execute:function(){function l(e){switch(e%10){case 0:return e===0?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function d(e,t){return e*t}var u=undefined&&undefined.__assign||function(){u=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return u.apply(this,arguments)};var f=undefined&&undefined.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var p=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var h=function(e,t,n,o){return f(void 0,void 0,void 0,(function(){return p(this,(function(r){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),u({role_name:t,action:n},o||{})).then((function(e){return e.data}))]}))}))};var v=new RegExp(/\+[1-9]\d{6,14}/g);function g(e){return e!==null&&e.length<16&&e.length>6&&v.test(e)||e===""||e===null}var b=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;var x=function(e){return b.test(e)};var m=function(e){return g(e)};var y=undefined&&undefined.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function c(e){try{s(o["throw"](e))}catch(e){r(e)}}function s(e){e.done?n(e.value):i(e.value).then(a,c)}s((o=o.apply(e,t||[])).next())}))};var w=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(a){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];i=0}finally{o=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var k=function(e){return y(void 0,void 0,void 0,(function(){return w(this,(function(t){return[2,i().api.get("/documents/".concat(e.documentId,"/recipients/").concat(encodeURIComponent(e.roleId),"/invitation/").concat(e.inviteCode)).then((function(e){var t,n;var o=((t=e.headers)===null||t===void 0?void 0:t.signer_token)||"";var a=r(o);i().setAuthorization((n=e.headers)===null||n===void 0?void 0:n.signer_token);return{recipient:e.data,session:a,signerToken:o}}))]}))}))};var _=function(e){return y(void 0,void 0,void 0,(function(){return w(this,(function(t){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))}))};var I=function(e,t){return y(void 0,void 0,void 0,(function(){return w(this,(function(n){return[2,i().api.get("/documents/".concat(e,"/envelope_documents/").concat(t,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return s.from(e.data,"binary").toString("base64")}))]}))}))};var R=function(e,t,n){return y(void 0,void 0,void 0,(function(){return w(this,(function(o){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),n).then((function(e){return e.data}))]}))}))};var S='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';var C="https://stage-api.verdocs.com";var F=e("verdocs_sign",function(){function e(e){t(this,e);this.documentid=null;this.roleid=null;this.invitecode=null;this.endpoint=null;this.recipient=null;this.signerToken=null;this.pdfUrl=null;this.recipientIndex=-1;this.document=null;this.fields=[];this.hasSignature=false;this.nextButtonLabel="Start";this.focusedField=""}e.prototype.componentWillLoad=function(){var e=(new a).setBaseURL(C);c(e)};e.prototype.componentDidLoad=function(){return y(this,void 0,void 0,(function(){var e,t,n,o,r,a;var c=this;return w(this,(function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);return[4,k({documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode})];case 1:e=s.sent(),t=e.session,n=e.recipient,o=e.signerToken;console.log("[SIGN] Got signing session",t);console.log("[SIGN] Recipient",n);this.recipient=n;this.signerToken=o;i().setSigningAuthorization(o);if(this.recipient.agreed){this.nextButtonLabel="Next"}return[4,_(this.documentid)];case 2:r=s.sent();this.document=r;console.log("[SIGN] Document",r);this.pdfUrl="".concat(C,"/documents/").concat(this.documentid,"/envelope_documents/").concat(r.envelope_document_id,"?file=true");this.recipientIndex=this.document.recipients.findIndex((function(e){return e.role_name==c.roleid}));if(this.recipientIndex>-1){console.log("Found recipient",this.document.recipients[this.recipientIndex])}this.fields=this.document.fields.filter((function(e){return e.recipient_role===c.roleid}));console.log("Loaded fields",this.fields);return[3,4];case 3:a=s.sent();console.log("Error with signing session",a);return[3,4];case 4:return[2]}}))}))};e.prototype.handleClickAgree=function(){var e=this;console.log("agree clicked");h(this.documentid,this.roleid,"update",{agreed:true}).then((function(t){console.log("update result",t);e.nextButtonLabel="Next";e.recipient=t})).catch((function(e){console.log("update failure",e)}))};e.prototype.savePDF=function(){return y(this,void 0,void 0,(function(){var e,t,n,o;return w(this,(function(i){switch(i.label){case 0:e="".concat(this.document.name," - ").concat(this.document.updated_at.split("T")[0],".pdf");return[4,I(this.documentid,this.document.envelope_document_id)];case 1:t=i.sent();n=new XMLHttpRequest;n.responseType="blob";n.onload=function(){var t=document.createElement("a");t.href=window.URL.createObjectURL(n.response);t.download=e;t.style.display="none";document.body.appendChild(t);t.click();t.remove()};o="data:application/pdf;base64,".concat(t);console.log("url",o.length,o);n.open("GET","data:application/pdf;base64,".concat(t));n.send();return[2]}}))}))};e.prototype.handleOptionSelected=function(e){return y(this,void 0,void 0,(function(){return w(this,(function(t){switch(e.detail.id){case"later":if(!(window===null||window===void 0?void 0:window["STORYBOOK_ENV"])){window.alert("User intends to sign later.")}break;case"claim":break;case"decline":break;case"print":break;case"download":this.savePDF().catch((function(){}));break}return[2]}))}))};e.prototype.handleFieldChange=function(e,t,n){return y(this,void 0,void 0,(function(){var o;return w(this,(function(i){console.log("fieldChange",e,t.detail);switch(e.type){case"textbox":R(this.documentid,e.name,{prepared:false,value:t.detail}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"checkbox_group":R(this.documentid,e.name,{prepared:false,value:{options:[{id:n,checked:t.detail}]}}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"radio_button_group":o=e.settings.options.map((function(e){return{id:e.id,selected:n===e.id}}));R(this.documentid,e.name,{prepared:false,value:{options:o}}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"dropdown":R(this.documentid,e.name,{prepared:false,value:t.detail}).then((function(e){return console.log("Update result",e)})).catch((function(e){return console.log("Error updating",e)}));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail);break}return[2]}))}))};e.prototype.renderCheckboxGroupOption=function(e,t,o,i){var r=this;var a=d(e.xRatio,o.x);var c=d(e.yRatio,o.y);var s={left:"".concat(a,"px"),bottom:"".concat(c,"px"),position:"absolute",transform:"scale(".concat(e.xRatio,", ").concat(e.yRatio,")"),backgroundColor:l(this.recipientIndex)};return n("verdocs-field-checkbox",{style:s,order:i,value:o.checked,onFieldChange:function(e){return r.handleFieldChange(t,e,o.id)}})};e.prototype.renderRadioGroupOption=function(e,t,o,i){var r=this;var a=d(e.xRatio,o.x);var c=d(e.yRatio,o.y);var s={left:"".concat(a,"px"),bottom:"".concat(c,"px"),position:"absolute",transform:"scale(".concat(e.xRatio,", ").concat(e.yRatio,")"),backgroundColor:l(this.recipientIndex)};return n("verdocs-field-radio-button",{style:s,order:i,value:o.id,name:t.name,checked:o.selected,onFieldChange:function(e){return r.handleFieldChange(t,e,o.id)}})};e.prototype.renderField=function(e,t){var o=this;var i=e.required,r=i===void 0?false:i,a=e.settings,c=a===void 0?{}:a;var s=c.x,u=s===void 0?0:s,f=c.y,p=f===void 0?0:f,h=c.base64,v=h===void 0?"":h,g=c.placeholder,b=g===void 0?"":g,x=c.options,m=x===void 0?[]:x,y=c.value,w=y===void 0?"":y,k=c.result,_=k===void 0?"":k;var I=this.pdfPageInfo.pages.find((function(t){return t.pageNumber===e.page}));if(!I){console.log("Unable to render invalid field",e);return n("div",{class:"invalid-field"},"Invalid field.")}var R=d(I.xRatio,u);var S=d(I.yRatio,p);var C={left:"".concat(R,"px"),bottom:"".concat(S,"px"),position:"absolute",transform:"scale(".concat(I.xRatio,", ").concat(I.yRatio,")"),backgroundColor:e.settings.rgba||l(this.recipientIndex)};if(e.settings.height){C.height="".concat(e.settings.height,"px")}if(e.settings.width){C.width="".concat(e.settings.width,"px")}console.log("rendering field",e.type,e);var F="field-".concat(e.name);switch(e.type){case"signature":return n("verdocs-field-signature",{style:C,value:v,required:r,id:F});case"initial":return n("verdocs-field-initial",{style:C,required:r,id:F});case"textbox":return n("verdocs-field-textbox",{style:C,order:t,value:_||"",placeholder:b,id:F,onFieldChange:function(t){return o.handleFieldChange(e,t)}});case"textarea":return n("verdocs-field-textarea",{style:C,placeholder:b||"",id:F});case"date":return n("verdocs-field-date",{style:C,order:t,value:_||"",placeholder:b,required:r,id:F});case"dropdown":return n("verdocs-field-dropdown",{style:C,options:m,value:w,required:r,id:F,onFieldChange:function(t){return o.handleFieldChange(e,t)}});case"checkbox":return n("verdocs-field-checkbox",{style:C,value:_||"",id:F});case"checkbox_group":return e.settings.options.map((function(t,n){return o.renderCheckboxGroupOption(I,e,t,n)}));case"radio_button_group":return e.settings.options.map((function(t,n){return o.renderRadioGroupOption(I,e,t,n)}));case"attachment":return n("verdocs-field-attachment",{style:C,value:_||"",id:F});case"payment":return n("verdocs-field-payment",{style:C,field:e,id:F});default:console.log("[SIGN] Skipping unsupported field type",e)}return n("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')};e.prototype.isFieldValid=function(e){var t,n,o,i,r,a,c,s,l,d,u,f;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return x(((n=e.settings)===null||n===void 0?void 0:n.result)||"");case"phone":return m(((o=e.settings)===null||o===void 0?void 0:o.result)||"");default:return!!((i=e.settings)===null||i===void 0?void 0:i.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!((r=e.settings)===null||r===void 0?void 0:r.result);case"dropdown":return!!((a=e.settings)===null||a===void 0?void 0:a.value);case"checkbox_group":var p=(((s=(c=e.settings)===null||c===void 0?void 0:c.options)===null||s===void 0?void 0:s.filter((function(e){return e.checked})))||[]).length;return p>=(((l=e.settings)===null||l===void 0?void 0:l.minimum_checked)||0)&&p<=(((d=e.settings)===null||d===void 0?void 0:d.maximum_checked)||999);case"radio_button_group":return(((f=(u=e.settings)===null||u===void 0?void 0:u.options)===null||f===void 0?void 0:f.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleDocumentRendered=function(e){console.log("[SIGN] Document rendered",e.detail);this.pdfPageInfo=e.detail};e.prototype.handleNext=function(){var e=this;var t=this.fields.filter((function(e){return e.required}));console.log("required Fields",t);var n=t.findIndex((function(t){return t.name===e.focusedField}));console.log("focused Index",n);var o=n+1;if(o>=t.length){o=0}var i=t[o];console.log("next required fielod",i);if(i){var r=document.getElementById("field-".concat(i.name));r===null||r===void 0?void 0:r.focusField();this.focusedField=i.name}};e.prototype.render=function(){var e=this;var t,i,r,a,c;var s=[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:true},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];return n(o,{class:{storybook:!!(window===null||window===void 0?void 0:window["STORYBOOK_ENV"]),agreed:(t=this.recipient)===null||t===void 0?void 0:t.agreed}},n("div",{class:"header"},n("div",{class:"intro"},"Please review and act on these documents."),n("div",{class:"toolbar"},n("div",{class:"tools"},n("verdocs-dropdown",{options:s,onOptionSelected:function(t){return e.handleOptionSelected(t)}}),!((i=this.recipient)===null||i===void 0?void 0:i.agreed)?n("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},n("div",{class:"agree-checkbox"},n("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:function(){return e.handleClickAgree()}}),n("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."):n("div",{style:{flex:"1"}}),n("verdocs-button",{label:this.nextButtonLabel,disabled:!((r=this.recipient)===null||r===void 0?void 0:r.agreed),onClick:function(){return e.handleNext()}})))),!((a=this.recipient)===null||a===void 0?void 0:a.agreed)?n("div",{class:"cover"}):n("div",{style:{display:"none"}}),n("div",{class:"document"},this.pdfUrl?n("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:function(t){return e.handleDocumentRendered(t)}}):n("verdocs-loader",null),(((c=this.pdfPageInfo)===null||c===void 0?void 0:c.pages)||[]).map((function(t){var o;return n("div",{class:"page-controls",style:{height:"".concat(t.height,"px"),width:"".concat(t.width,"px"),top:"".concat(t.canvasTop,"px"),margin:"0 auto"}},((o=e.pdfPageInfo)===null||o===void 0?void 0:o.numRendered)>0?e.fields.filter((function(e){return e.page===t.pageNumber})).map((function(t,n){return e.renderField(t,n)})):n("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))};return e}());F.style=S}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js","./p-
|
|
1
|
+
System.register(["./p-caed7818.system.js","./p-8730dc92.system.js","./p-cec13589.system.js","./p-5dfd73f9.system.js"],(function(t){"use strict";var e,n,s,i,o,a,r,l,u;return{setters:[function(t){e=t.r;n=t.c;s=t.h},function(t){i=t.l;o=t.a;a=t.s;r=t.e},function(t){l=t.V;u=t.s},function(){}],execute:function(){var d='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;background-color:#4c56cb;padding:40px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .login-form,verdocs-auth .signup-form{background:#f5f5fa;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:8px;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}';var c="https://stage-api.verdocs.com/";var g="verdocs-stage";var h=t("verdocs_auth",function(){function t(t){e(this,t);this.authenticated=n(this,"authenticated",7);this.visible=true;this.logo="https://verdocs.com/assets/blue-logo.svg";this.debug=false;this.isAuthenticated=false;this.displayMode="login";this.username="";this.password="";this.loggingIn=false;this.activeSession=null;this.loginError=null}t.prototype.componentWillLoad=function(){var t=(new l).setBaseURL(c);u(t)};t.prototype.componentDidLoad=function(){var t=i(g);if(t!==null){this.isAuthenticated=true;this.activeSession=t;this.authenticated.emit({authenticated:true,session:t})}else{this.authenticated.emit({authenticated:false,session:null})}};t.prototype.handleLogin=function(){var t=this;this.loggingIn=true;o({username:this.username,password:this.password}).then((function(e){t.loggingIn=false;var n=a(g,e.accessToken,true);t.activeSession=n;t.isAuthenticated=true;t.authenticated.emit({authenticated:true,session:n})})).catch((function(e){var n;console.log("[VERDOCS] Login error",e.response,JSON.stringify(e));t.loggingIn=false;t.activeSession=null;t.authenticated.emit({authenticated:false,session:null});if(((n=e===null||e===void 0?void 0:e.response)===null||n===void 0?void 0:n.status)===403){t.loginError="Please check your username and password and try again."}}))};t.prototype.handleLogout=function(){r(g);this.isAuthenticated=false;this.authenticated.emit({authenticated:false,session:null})};t.prototype.handleClearError=function(){this.loginError=null};t.prototype.render=function(){var t=this;if(!this.visible){return s("div",{style:{display:"none"}},"Verdocs Auth Placeholder")}if(this.isAuthenticated){if(this.debug){return s("div",{class:"status-result debug"},s("verdocs-button",{label:"Logout",disabled:this.loggingIn,onPress:function(){return t.handleLogout()}}))}return s("div",{class:"status-result"},"Authenticated")}if(this.displayMode==="signup"){return s("div",{class:"signup-form"},s("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),s("h3",null,"Sign up for an account"),s("h4",null,"Already have an account?",s("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return t.displayMode="login"},disabled:this.loggingIn})),s("form",{onSubmit:function(){return t.handleLogin()}},s("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),s("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),s("verdocs-button",{label:"Signup",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}return s("div",{class:"login-form"},s("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),s("h3",null,"Log in to your account"),s("h4",null,"Don't have an account?",s("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn})),s("form",{onSubmit:function(){return t.handleLogin()}},s("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),s("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),s("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),s("verdocs-button",{label:"Login",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})),this.loginError?s("verdocs-ok-dialog",{open:true,heading:"Login Error",message:this.loginError,onClosed:function(){return t.handleClearError()}}):s("div",null))};return t}());h.style=d}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-2bc58746.js";import{l as r}from"./p-3820c9a2.js";import{g as o}from"./p-6348272c.js";import"./p-ef932a87.js";var s=function(){return e=void 0,t=void 0,r=function(){return function(e,t){var i,r,o,s,n={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,r=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(!((o=(o=n.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){n=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(6===s[0]&&n.label<o[1]){n.label=o[1],o=s;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(s);break}o[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],r=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(){return[2,o().api.get("/search/history").then((function(e){return e.data}))]}))},new((i=void 0)||(i=Promise))((function(o,s){function n(e){try{a(r.next(e))}catch(e){s(e)}}function c(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(n,c)}a((r=r.apply(e,t||[])).next())}));var e,t,i,r};const n='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>',c=class{constructor(i){e(this,i),this.entrySelected=t(this,"entrySelected",7),this.type="recent",this.emptyMessage="You do not have any starred searches.",this.authFailure=!1,this.title="Recent Searches",this.recent=[],this.saved=[],this.starred=[]}componentWillLoad(){r("verdocs-stage");const e=e=>{var t;console.warn("[Verdocs/search-activity] Error getting search data",e),401===(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)&&(this.authFailure=!0)};switch(this.type){case"recent":this.title="Recent Searches",this.emptyMessage="You do not have any recent searches.",s().then((e=>this.recent=e.recent)).catch(e);break;case"saved":this.title="Saved Searches",this.emptyMessage="You do not have any saved searches.",s().then((e=>this.saved=e.saved)).catch(e);break;case"starred":this.title="My Starred items",this.emptyMessage="You do not have any starred templates.",(t={is_starred:!0},o().api.get("/templates/",{params:t}).then((function(e){return e.data}))).then((e=>this.starred=e)).catch(e)}var t}handleSelectEntry(e){this.entrySelected.emit(e)}computePagesText(e){return e<2?`${e} Page`:`${e} Pages`}computeRecipientsText(e){return"object"==typeof e?e.join(", "):e>1?`${e} Recipients`:`${e} Recipient`}render(){const e=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return i("div",{class:"container"},i("p",{class:"title"},this.title),i("div",{class:"items"},this.recent.map((e=>i("button",{class:"item",onClick:()=>this.handleSelectEntry(e)},i("div",{class:"icon",innerHTML:n}),i("div",{class:"details"},i("div",{class:"item-title"},e.params.q),i("div",{class:"info"},"Test"))))),this.saved.map((e=>i("button",{class:"item",onClick:()=>this.handleSelectEntry(e)},i("div",{class:"icon",innerHTML:n}),i("div",{class:"details"},i("div",{class:"item-title"},e.params.q),i("div",{class:"info"}))))),e&&i("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))}};c.style='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:var(--verdocs-background-dark)}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#ccc}';const a=class{constructor(i){e(this,i),this.searchClicked=t(this,"searchClicked",7),this.typeChanged=t(this,"typeChanged",7),this.queryChanged=t(this,"queryChanged",7),this.placeholder="search documents, templates, people...",this.type="all",this.query=""}handleSearch(e){return this.searchClicked.emit({type:this.type,query:this.query}),e.preventDefault(),!1}handleChange(e){this.queryChanged.emit(e.target.value)}handleClearFilter(){this.typeChanged.emit("all")}handleKeyUp(e){"Enter"===e.key&&this.searchClicked.emit({type:this.type,query:this.query})}render(){return i("form",{onSubmit:e=>this.handleSearch(e)},void 0!==this.type&&"all"!==this.type&&i("span",{class:"type"},this.type,"s ",i("button",{class:"remove",innerHTML:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n',onClick:()=>this.handleClearFilter()})),i("input",{type:"text",placeholder:this.placeholder,value:this.query,onInput:e=>this.handleChange(e),onKeyUp:e=>this.handleKeyUp(e)}),i("button",{onClick:e=>this.handleSearch(e),class:"search"},i("span",{innerHTML:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n'}),"Search"))}};a.style='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:var(--verdocs-container-border-color)}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#50be80;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';export{c as verdocs_search_activity,a as verdocs_search_box}
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-2bc58746.js";import{l as r}from"./p-e6e2894e.js";import{a as o}from"./p-737b2e99.js";import"./p-ef932a87.js";var s=function(){return e=void 0,t=void 0,r=function(){return function(e,t){var i,r,o,s,n={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(s){return function(c){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,r=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(!((o=(o=n.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){n=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(6===s[0]&&n.label<o[1]){n.label=o[1],o=s;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(s);break}o[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],r=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,(function(){return[2,o().api.get("/search/history").then((function(e){return e.data}))]}))},new((i=void 0)||(i=Promise))((function(o,s){function n(e){try{a(r.next(e))}catch(e){s(e)}}function c(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(n,c)}a((r=r.apply(e,t||[])).next())}));var e,t,i,r};const n='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>',c=class{constructor(i){e(this,i),this.entrySelected=t(this,"entrySelected",7),this.type="recent",this.emptyMessage="You do not have any starred searches.",this.authFailure=!1,this.title="Recent Searches",this.recent=[],this.saved=[],this.starred=[]}componentWillLoad(){r("verdocs-stage");const e=e=>{var t;console.warn("[Verdocs/search-activity] Error getting search data",e),401===(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status)&&(this.authFailure=!0)};switch(this.type){case"recent":this.title="Recent Searches",this.emptyMessage="You do not have any recent searches.",s().then((e=>this.recent=e.recent)).catch(e);break;case"saved":this.title="Saved Searches",this.emptyMessage="You do not have any saved searches.",s().then((e=>this.saved=e.saved)).catch(e);break;case"starred":this.title="My Starred items",this.emptyMessage="You do not have any starred templates.",(t={is_starred:!0},o().api.get("/templates/",{params:t}).then((function(e){return e.data}))).then((e=>this.starred=e)).catch(e)}var t}handleSelectEntry(e){this.entrySelected.emit(e)}computePagesText(e){return e<2?`${e} Page`:`${e} Pages`}computeRecipientsText(e){return"object"==typeof e?e.join(", "):e>1?`${e} Recipients`:`${e} Recipient`}render(){const e=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return i("div",{class:"container"},i("p",{class:"title"},this.title),i("div",{class:"items"},this.recent.map((e=>i("button",{class:"item",onClick:()=>this.handleSelectEntry(e)},i("div",{class:"icon",innerHTML:n}),i("div",{class:"details"},i("div",{class:"item-title"},e.params.q),i("div",{class:"info"},"Test"))))),this.saved.map((e=>i("button",{class:"item",onClick:()=>this.handleSelectEntry(e)},i("div",{class:"icon",innerHTML:n}),i("div",{class:"details"},i("div",{class:"item-title"},e.params.q),i("div",{class:"info"}))))),e&&i("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))}};c.style='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:var(--verdocs-background-dark)}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#ccc}';const a=class{constructor(i){e(this,i),this.searchClicked=t(this,"searchClicked",7),this.typeChanged=t(this,"typeChanged",7),this.queryChanged=t(this,"queryChanged",7),this.placeholder="search documents, templates, people...",this.type="all",this.query=""}handleSearch(e){return this.searchClicked.emit({type:this.type,query:this.query}),e.preventDefault(),!1}handleChange(e){this.queryChanged.emit(e.target.value)}handleClearFilter(){this.typeChanged.emit("all")}handleKeyUp(e){"Enter"===e.key&&this.searchClicked.emit({type:this.type,query:this.query})}render(){return i("form",{onSubmit:e=>this.handleSearch(e)},void 0!==this.type&&"all"!==this.type&&i("span",{class:"type"},this.type,"s ",i("button",{class:"remove",innerHTML:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n',onClick:()=>this.handleClearFilter()})),i("input",{type:"text",placeholder:this.placeholder,value:this.query,onInput:e=>this.handleChange(e),onKeyUp:e=>this.handleKeyUp(e)}),i("button",{onClick:e=>this.handleSearch(e),class:"search"},i("span",{innerHTML:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n'}),"Search"))}};a.style='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:var(--verdocs-container-border-color)}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#50be80;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';export{c as verdocs_search_activity,a as verdocs_search_box}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as t,p as n}from"./p-ef932a87.js";var e,r=function(t,n){return function(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];return t.apply(n,e)}},i=Object.prototype.toString,o=(e=Object.create(null),function(t){var n=i.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())});function u(t){return t=t.toLowerCase(),function(n){return o(n)===t}}function f(t){return Array.isArray(t)}function a(t){return void 0===t}var c=u("ArrayBuffer");function s(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==o(t))return!1;var n=Object.getPrototypeOf(t);return null===n||n===Object.prototype}var h=u("Date"),d=u("File"),v=u("Blob"),p=u("FileList");function m(t){return"[object Function]"===i.call(t)}var b=u("URLSearchParams");function w(t,n){if(null!=t)if("object"!=typeof t&&(t=[t]),f(t))for(var e=0,r=t.length;e<r;e++)n.call(null,t[e],e,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.call(null,t[i],i,t)}var y,g=(y="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return y&&t instanceof y}),O={isArray:f,isArrayBuffer:c,isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var n="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||i.call(t)===n||m(t.toString)&&t.toString()===n)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&c(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:l,isUndefined:a,isDate:h,isFile:d,isBlob:v,isFunction:m,isStream:function(t){return s(t)&&m(t.pipe)},isURLSearchParams:b,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:w,merge:function t(){var n={};function e(e,r){n[r]=l(n[r])&&l(e)?t(n[r],e):l(e)?t({},e):f(e)?e.slice():e}for(var r=0,i=arguments.length;r<i;r++)w(arguments[r],e);return n},extend:function(t,n,e){return w(n,(function(n,i){t[i]=e&&"function"==typeof n?r(n,e):n})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,n,e,r){t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,e&&Object.assign(t.prototype,e)},toFlatObject:function(t,n,e){var r,i,o,u={};n=n||{};do{for(i=(r=Object.getOwnPropertyNames(t)).length;i-- >0;)u[o=r[i]]||(n[o]=t[o],u[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!e||e(t,n))&&t!==Object.prototype);return n},kindOf:o,kindOfTest:u,endsWith:function(t,n,e){t=String(t),(void 0===e||e>t.length)&&(e=t.length);var r=t.indexOf(n,e-=n.length);return-1!==r&&r===e},toArray:function(t){if(!t)return null;var n=t.length;if(a(n))return null;for(var e=new Array(n);n-- >0;)e[n]=t[n];return e},isTypedArray:g,isFileList:p};function j(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var E=function(t,n,e){if(!n)return t;var r;if(e)r=e(n);else if(O.isURLSearchParams(n))r=n.toString();else{var i=[];O.forEach(n,(function(t,n){null!=t&&(O.isArray(t)?n+="[]":t=[t],O.forEach(t,(function(t){O.isDate(t)?t=t.toISOString():O.isObject(t)&&(t=JSON.stringify(t)),i.push(j(n)+"="+j(t))})))})),r=i.join("&")}if(r){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t};function R(){this.handlers=[]}R.prototype.use=function(t,n,e){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!e&&e.synchronous,runWhen:e?e.runWhen:null}),this.handlers.length-1},R.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},R.prototype.forEach=function(t){O.forEach(this.handlers,(function(n){null!==n&&t(n)}))};var S=R,A=function(t,n){O.forEach(t,(function(e,r){r!==n&&r.toUpperCase()===n.toUpperCase()&&(t[n]=e,delete t[r])}))};function N(t,n,e,r,i){Error.call(this),this.message=t,this.name="AxiosError",n&&(this.code=n),e&&(this.config=e),r&&(this.request=r),i&&(this.response=i)}O.inherits(N,Error,{toJSON:function(){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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var T=N.prototype,x={};["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"].forEach((function(t){x[t]={value:t}})),Object.defineProperties(N,x),Object.defineProperty(T,"isAxiosError",{value:!0}),N.from=function(t,n,e,r,i,o){var u=Object.create(T);return O.toFlatObject(t,u,(function(t){return t!==Error.prototype})),N.call(u,t.message,n,e,r,i),u.name=t.name,o&&Object.assign(u,o),u};var _=N,B={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},D=function(n,e){e=e||new FormData;var r=[];function i(n){return null===n?"":O.isDate(n)?n.toISOString():O.isArrayBuffer(n)||O.isTypedArray(n)?"function"==typeof Blob?new Blob([n]):t.from(n):n}return function t(n,o){if(O.isPlainObject(n)||O.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+o);r.push(n),O.forEach(n,(function(n,r){if(!O.isUndefined(n)){var u,f=o?o+"."+r:r;if(n&&!o&&"object"==typeof n)if(O.endsWith(r,"{}"))n=JSON.stringify(n);else if(O.endsWith(r,"[]")&&(u=O.toArray(n)))return void u.forEach((function(t){!O.isUndefined(t)&&e.append(f,i(t))}));t(n,f)}})),r.pop()}else e.append(o,i(n))}(n),e},C=O.isStandardBrowserEnv()?{write:function(t,n,e,r,i,o){var u=[];u.push(t+"="+encodeURIComponent(n)),O.isNumber(e)&&u.push("expires="+new Date(e).toGMTString()),O.isString(r)&&u.push("path="+r),O.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},P=function(t,n){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)?function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}(t,n):n},F=["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"],U=O.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");function r(t){var r=t;return n&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return t=r(window.location.href),function(n){var e=O.isString(n)?r(n):n;return e.protocol===t.protocol&&e.host===t.host}}():function(){return!0};function L(t){_.call(this,null==t?"canceled":t,_.ERR_CANCELED),this.name="CanceledError"}O.inherits(L,_,{__CANCEL__:!0});var J=L,k={"Content-Type":"application/x-www-form-urlencoded"};function q(t,n){!O.isUndefined(t)&&O.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}var z,I={transitional:B,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(z=function(t){return new Promise((function(n,e){var r,i=t.data,o=t.headers,u=t.responseType;function f(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}O.isFormData(i)&&O.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"",s=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(c+":"+s)}var l=P(t.baseURL,t.url);function h(){if(a){var r,i,o,c,s,l="getAllResponseHeaders"in a?(r=a.getAllResponseHeaders(),s={},r?(O.forEach(r.split("\n"),(function(t){if(c=t.indexOf(":"),i=O.trim(t.substr(0,c)).toLowerCase(),o=O.trim(t.substr(c+1)),i){if(s[i]&&F.indexOf(i)>=0)return;s[i]="set-cookie"===i?(s[i]?s[i]:[]).concat([o]):s[i]?s[i]+", "+o:o}})),s):s):null;!function(t,n,e){var r=e.config.validateStatus;e.status&&r&&!r(e.status)?n(new _("Request failed with status code "+e.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e)):t(e)}((function(t){n(t),f()}),(function(t){e(t),f()}),{data:u&&"text"!==u&&"json"!==u?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:l,config:t,request:a}),a=null}}if(a.open(t.method.toUpperCase(),E(l,t.params,t.paramsSerializer),!0),a.timeout=t.timeout,"onloadend"in a?a.onloadend=h:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(h)},a.onabort=function(){a&&(e(new _("Request aborted",_.ECONNABORTED,t,a)),a=null)},a.onerror=function(){e(new _("Network Error",_.ERR_NETWORK,t,a,a)),a=null},a.ontimeout=function(){var n=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";t.timeoutErrorMessage&&(n=t.timeoutErrorMessage),e(new _(n,(t.transitional||B).clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,t,a)),a=null},O.isStandardBrowserEnv()){var d=(t.withCredentials||U(l))&&t.xsrfCookieName?C.read(t.xsrfCookieName):void 0;d&&(o[t.xsrfHeaderName]=d)}"setRequestHeader"in a&&O.forEach(o,(function(t,n){void 0===i&&"content-type"===n.toLowerCase()?delete o[n]:a.setRequestHeader(n,t)})),O.isUndefined(t.withCredentials)||(a.withCredentials=!!t.withCredentials),u&&"json"!==u&&(a.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&a.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(t){a&&(e(!t||t&&t.type?new J:t),a.abort(),a=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),i||(i=null);var v,p=(v=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l))&&v[1]||"";p&&-1===["http","https","file"].indexOf(p)?e(new _("Unsupported protocol "+p+":",_.ERR_BAD_REQUEST,t)):a.send(i)}))}),z),transformRequest:[function(t,n){if(A(n,"Accept"),A(n,"Content-Type"),O.isFormData(t)||O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return q(n,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var e,r=O.isObject(t),i=n&&n["Content-Type"];if((e=O.isFileList(t))||r&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return D(e?{"files[]":t}:t,o&&new o)}return r||"application/json"===i?(q(n,"application/json"),function(t){if(O.isString(t))try{return(0,JSON.parse)(t),O.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var n=this.transitional||I.transitional,e=!(n&&n.silentJSONParsing)&&"json"===this.responseType;if(e||n&&n.forcedJSONParsing&&O.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(e){if("SyntaxError"===t.name)throw _.from(t,_.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};O.forEach(["delete","get","head"],(function(t){I.headers[t]={}})),O.forEach(["post","put","patch"],(function(t){I.headers[t]=O.merge(k)}));var M=I,H=function(t,n,e){var r=this||M;return O.forEach(e,(function(e){t=e.call(r,t,n)})),t},X=function(t){return!(!t||!t.__CANCEL__)};function K(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new J}var W=function(t){return K(t),t.headers=t.headers||{},t.data=H.call(t,t.data,t.headers,t.transformRequest),t.headers=O.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),O.forEach(["delete","get","head","post","put","patch","common"],(function(n){delete t.headers[n]})),(t.adapter||M.adapter)(t).then((function(n){return K(t),n.data=H.call(t,n.data,n.headers,t.transformResponse),n}),(function(n){return X(n)||(K(t),n&&n.response&&(n.response.data=H.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)}))},$=function(t,n){n=n||{};var e={};function r(t,n){return O.isPlainObject(t)&&O.isPlainObject(n)?O.merge(t,n):O.isPlainObject(n)?O.merge({},n):O.isArray(n)?n.slice():n}function i(e){return O.isUndefined(n[e])?O.isUndefined(t[e])?void 0:r(void 0,t[e]):r(t[e],n[e])}function o(t){if(!O.isUndefined(n[t]))return r(void 0,n[t])}function u(e){return O.isUndefined(n[e])?O.isUndefined(t[e])?void 0:r(void 0,t[e]):r(void 0,n[e])}function f(e){return e in n?r(t[e],n[e]):e in t?r(void 0,t[e]):void 0}var a={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f};return O.forEach(Object.keys(t).concat(Object.keys(n)),(function(t){var n=a[t]||i,r=n(t);O.isUndefined(r)&&n!==f||(e[t]=r)})),e},V={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){V[t]=function(e){return typeof e===t||"a"+(n<1?"n ":" ")+t}}));var Z={};V.transitional=function(t,n,e){function r(t,n){return"[Axios v0.27.2] Transitional option '"+t+"'"+n+(e?". "+e:"")}return function(e,i,o){if(!1===t)throw new _(r(i," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!Z[i]&&(Z[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(e,i,o)}};var Q={assertOptions:function(t,n,e){if("object"!=typeof t)throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],u=n[o];if(u){var f=t[o],a=void 0===f||u(f,o,t);if(!0!==a)throw new _("option "+o+" must be "+a,_.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new _("Unknown option "+o,_.ERR_BAD_OPTION)}},validators:V},Y=Q.validators;function G(t){this.defaults=t,this.interceptors={request:new S,response:new S}}G.prototype.request=function(t,n){"string"==typeof t?(n=n||{}).url=t:n=t||{},(n=$(this.defaults,n)).method=n.method?n.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var e=n.transitional;void 0!==e&&Q.assertOptions(e,{silentJSONParsing:Y.transitional(Y.boolean),forcedJSONParsing:Y.transitional(Y.boolean),clarifyTimeoutError:Y.transitional(Y.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(n)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var f=[W,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(u),o=Promise.resolve(n);f.length;)o=o.then(f.shift(),f.shift());return o}for(var a=n;r.length;){var c=r.shift(),s=r.shift();try{a=c(a)}catch(t){s(t);break}}try{o=W(a)}catch(t){return Promise.reject(t)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},G.prototype.getUri=function(t){t=$(this.defaults,t);var n=P(t.baseURL,t.url);return E(n,t.params,t.paramsSerializer)},O.forEach(["delete","get","head","options"],(function(t){G.prototype[t]=function(n,e){return this.request($(e||{},{method:t,url:n,data:(e||{}).data}))}})),O.forEach(["post","put","patch"],(function(t){function n(n){return function(e,r,i){return this.request($(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:r}))}}G.prototype[t]=n(),G.prototype[t+"Form"]=n(!0)}));var tt=G;function nt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var e=this;this.promise.then((function(t){if(e._listeners){var n,r=e._listeners.length;for(n=0;n<r;n++)e._listeners[n](t);e._listeners=null}})),this.promise.then=function(t){var n,r=new Promise((function(t){e.subscribe(t),n=t})).then(t);return r.cancel=function(){e.unsubscribe(n)},r},t((function(t){e.reason||(e.reason=new J(t),n(e.reason))}))}nt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},nt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},nt.prototype.unsubscribe=function(t){if(this._listeners){var n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}},nt.source=function(){var t;return{token:new nt((function(n){t=n})),cancel:t}};var et=nt,rt=function t(n){var e=new tt(n),i=r(tt.prototype.request,e);return O.extend(i,tt.prototype,e),O.extend(i,e),i.create=function(e){return t($(n,e))},i}(M);rt.Axios=tt,rt.CanceledError=J,rt.CancelToken=et,rt.isCancel=X,rt.VERSION="0.27.2",rt.toFormData=D,rt.AxiosError=_,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=function(t){return function(n){return t.apply(null,n)}},rt.isAxiosError=function(t){return O.isObject(t)&&!0===t.isAxiosError};var it=rt;it.default=rt;var ot=it,ut=function(t){return console.debug("[JS-SDK] ".concat(t.method.toUpperCase()," ").concat(t.baseURL).concat(t.url),t.data?JSON.stringify(t.data):""),t},ft=function(){function t(){this.requestLoggerId=null,this.api=ot.create({baseURL:"https://api.verdocs.com",timeout:3e3})}return t.prototype.setTimeout=function(t){return this.api.defaults.timeout=t,this},t.prototype.setClientID=function(t){return this.api.defaults.headers.common["X-Client-ID"]=t,this},t.prototype.setAuthorization=function(t){return t?this.api.defaults.headers.common.Authorization="Bearer ".concat(t):delete this.api.defaults.headers.common.Authorization,this},t.prototype.setSigningAuthorization=function(t){return t?this.api.defaults.headers.common.signer="Bearer ".concat(t):delete this.api.defaults.headers.common.signer,this},t.prototype.setBaseURL=function(t){return this.api.defaults.baseURL=t,this},t.prototype.logRequests=function(t){return t&&null===this.requestLoggerId?this.requestLoggerId=this.api.interceptors.request.use(ut):t||null===this.requestLoggerId||this.api.interceptors.request.eject(this.requestLoggerId),this},t}(),at=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")},ct=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return at()}try{return __global__||at()}finally{delete Object.prototype.__global__}}(),st=Symbol.for("verdocs-api-endpoint");ct[st]||(ct[st]=new ft);var lt=ct[st],ht=lt,dt=function(){return ht},vt=function(t){ht=t||lt},pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,bt=function(t){var n;try{if(null===(n=function(t){return JSON.parse(function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!mt.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var n;t+="==".slice(2-(3&t.length));for(var e,r,i="",o=0;o<t.length;)n=pt.indexOf(t.charAt(o++))<<18|pt.indexOf(t.charAt(o++))<<12|(e=pt.indexOf(t.charAt(o++)))<<6|(r=pt.indexOf(t.charAt(o++))),i+=64===e?String.fromCharCode(n>>16&255):64===r?String.fromCharCode(n>>16&255,n>>8&255):String.fromCharCode(n>>16&255,n>>8&255,255&n);return i}((t||"").split(".")[1]||""))}(t)))return null}catch(t){return null}return Object.keys(n).forEach((function(t){"string"==typeof t&&t.startsWith("https://verdocs.com/")&&(n[t.replace("https://verdocs.com/","")]=n[t],delete n[t])})),n};export{ft as V,bt as d,dt as g,vt as s}
|
|
1
|
+
import{B as t,p as n}from"./p-ef932a87.js";var e,r=function(t,n){return function(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];return t.apply(n,e)}},i=Object.prototype.toString,o=(e=Object.create(null),function(t){var n=i.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())});function u(t){return t=t.toLowerCase(),function(n){return o(n)===t}}function f(t){return Array.isArray(t)}function a(t){return void 0===t}var c=u("ArrayBuffer");function s(t){return null!==t&&"object"==typeof t}function l(t){if("object"!==o(t))return!1;var n=Object.getPrototypeOf(t);return null===n||n===Object.prototype}var h=u("Date"),d=u("File"),v=u("Blob"),p=u("FileList");function m(t){return"[object Function]"===i.call(t)}var b=u("URLSearchParams");function w(t,n){if(null!=t)if("object"!=typeof t&&(t=[t]),f(t))for(var e=0,r=t.length;e<r;e++)n.call(null,t[e],e,t);else for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.call(null,t[i],i,t)}var y,g=(y="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(t){return y&&t instanceof y}),O={isArray:f,isArrayBuffer:c,isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){var n="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||i.call(t)===n||m(t.toString)&&t.toString()===n)},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&c(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:l,isUndefined:a,isDate:h,isFile:d,isBlob:v,isFunction:m,isStream:function(t){return s(t)&&m(t.pipe)},isURLSearchParams:b,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:w,merge:function t(){var n={};function e(e,r){n[r]=l(n[r])&&l(e)?t(n[r],e):l(e)?t({},e):f(e)?e.slice():e}for(var r=0,i=arguments.length;r<i;r++)w(arguments[r],e);return n},extend:function(t,n,e){return w(n,(function(n,i){t[i]=e&&"function"==typeof n?r(n,e):n})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,n,e,r){t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,e&&Object.assign(t.prototype,e)},toFlatObject:function(t,n,e){var r,i,o,u={};n=n||{};do{for(i=(r=Object.getOwnPropertyNames(t)).length;i-- >0;)u[o=r[i]]||(n[o]=t[o],u[o]=!0);t=Object.getPrototypeOf(t)}while(t&&(!e||e(t,n))&&t!==Object.prototype);return n},kindOf:o,kindOfTest:u,endsWith:function(t,n,e){t=String(t),(void 0===e||e>t.length)&&(e=t.length);var r=t.indexOf(n,e-=n.length);return-1!==r&&r===e},toArray:function(t){if(!t)return null;var n=t.length;if(a(n))return null;for(var e=new Array(n);n-- >0;)e[n]=t[n];return e},isTypedArray:g,isFileList:p};function j(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var E=function(t,n,e){if(!n)return t;var r;if(e)r=e(n);else if(O.isURLSearchParams(n))r=n.toString();else{var i=[];O.forEach(n,(function(t,n){null!=t&&(O.isArray(t)?n+="[]":t=[t],O.forEach(t,(function(t){O.isDate(t)?t=t.toISOString():O.isObject(t)&&(t=JSON.stringify(t)),i.push(j(n)+"="+j(t))})))})),r=i.join("&")}if(r){var o=t.indexOf("#");-1!==o&&(t=t.slice(0,o)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t};function R(){this.handlers=[]}R.prototype.use=function(t,n,e){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!e&&e.synchronous,runWhen:e?e.runWhen:null}),this.handlers.length-1},R.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},R.prototype.forEach=function(t){O.forEach(this.handlers,(function(n){null!==n&&t(n)}))};var S=R,A=function(t,n){O.forEach(t,(function(e,r){r!==n&&r.toUpperCase()===n.toUpperCase()&&(t[n]=e,delete t[r])}))};function N(t,n,e,r,i){Error.call(this),this.message=t,this.name="AxiosError",n&&(this.code=n),e&&(this.config=e),r&&(this.request=r),i&&(this.response=i)}O.inherits(N,Error,{toJSON:function(){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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var T=N.prototype,x={};["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"].forEach((function(t){x[t]={value:t}})),Object.defineProperties(N,x),Object.defineProperty(T,"isAxiosError",{value:!0}),N.from=function(t,n,e,r,i,o){var u=Object.create(T);return O.toFlatObject(t,u,(function(t){return t!==Error.prototype})),N.call(u,t.message,n,e,r,i),u.name=t.name,o&&Object.assign(u,o),u};var _=N,B={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},D=function(n,e){e=e||new FormData;var r=[];function i(n){return null===n?"":O.isDate(n)?n.toISOString():O.isArrayBuffer(n)||O.isTypedArray(n)?"function"==typeof Blob?new Blob([n]):t.from(n):n}return function t(n,o){if(O.isPlainObject(n)||O.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+o);r.push(n),O.forEach(n,(function(n,r){if(!O.isUndefined(n)){var u,f=o?o+"."+r:r;if(n&&!o&&"object"==typeof n)if(O.endsWith(r,"{}"))n=JSON.stringify(n);else if(O.endsWith(r,"[]")&&(u=O.toArray(n)))return void u.forEach((function(t){!O.isUndefined(t)&&e.append(f,i(t))}));t(n,f)}})),r.pop()}else e.append(o,i(n))}(n),e},C=O.isStandardBrowserEnv()?{write:function(t,n,e,r,i,o){var u=[];u.push(t+"="+encodeURIComponent(n)),O.isNumber(e)&&u.push("expires="+new Date(e).toGMTString()),O.isString(r)&&u.push("path="+r),O.isString(i)&&u.push("domain="+i),!0===o&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},P=function(t,n){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)?function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t}(t,n):n},F=["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"],U=O.isStandardBrowserEnv()?function(){var t,n=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");function r(t){var r=t;return n&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return t=r(window.location.href),function(n){var e=O.isString(n)?r(n):n;return e.protocol===t.protocol&&e.host===t.host}}():function(){return!0};function L(t){_.call(this,null==t?"canceled":t,_.ERR_CANCELED),this.name="CanceledError"}O.inherits(L,_,{__CANCEL__:!0});var J=L,k={"Content-Type":"application/x-www-form-urlencoded"};function q(t,n){!O.isUndefined(t)&&O.isUndefined(t["Content-Type"])&&(t["Content-Type"]=n)}var z,I={transitional:B,adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==n&&"[object process]"===Object.prototype.toString.call(n))&&(z=function(t){return new Promise((function(n,e){var r,i=t.data,o=t.headers,u=t.responseType;function f(){t.cancelToken&&t.cancelToken.unsubscribe(r),t.signal&&t.signal.removeEventListener("abort",r)}O.isFormData(i)&&O.isStandardBrowserEnv()&&delete o["Content-Type"];var a=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"",s=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(c+":"+s)}var l=P(t.baseURL,t.url);function h(){if(a){var r,i,o,c,s,l="getAllResponseHeaders"in a?(r=a.getAllResponseHeaders(),s={},r?(O.forEach(r.split("\n"),(function(t){if(c=t.indexOf(":"),i=O.trim(t.substr(0,c)).toLowerCase(),o=O.trim(t.substr(c+1)),i){if(s[i]&&F.indexOf(i)>=0)return;s[i]="set-cookie"===i?(s[i]?s[i]:[]).concat([o]):s[i]?s[i]+", "+o:o}})),s):s):null;!function(t,n,e){var r=e.config.validateStatus;e.status&&r&&!r(e.status)?n(new _("Request failed with status code "+e.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e)):t(e)}((function(t){n(t),f()}),(function(t){e(t),f()}),{data:u&&"text"!==u&&"json"!==u?a.response:a.responseText,status:a.status,statusText:a.statusText,headers:l,config:t,request:a}),a=null}}if(a.open(t.method.toUpperCase(),E(l,t.params,t.paramsSerializer),!0),a.timeout=t.timeout,"onloadend"in a?a.onloadend=h:a.onreadystatechange=function(){a&&4===a.readyState&&(0!==a.status||a.responseURL&&0===a.responseURL.indexOf("file:"))&&setTimeout(h)},a.onabort=function(){a&&(e(new _("Request aborted",_.ECONNABORTED,t,a)),a=null)},a.onerror=function(){e(new _("Network Error",_.ERR_NETWORK,t,a,a)),a=null},a.ontimeout=function(){var n=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";t.timeoutErrorMessage&&(n=t.timeoutErrorMessage),e(new _(n,(t.transitional||B).clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,t,a)),a=null},O.isStandardBrowserEnv()){var d=(t.withCredentials||U(l))&&t.xsrfCookieName?C.read(t.xsrfCookieName):void 0;d&&(o[t.xsrfHeaderName]=d)}"setRequestHeader"in a&&O.forEach(o,(function(t,n){void 0===i&&"content-type"===n.toLowerCase()?delete o[n]:a.setRequestHeader(n,t)})),O.isUndefined(t.withCredentials)||(a.withCredentials=!!t.withCredentials),u&&"json"!==u&&(a.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&a.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&a.upload&&a.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(r=function(t){a&&(e(!t||t&&t.type?new J:t),a.abort(),a=null)},t.cancelToken&&t.cancelToken.subscribe(r),t.signal&&(t.signal.aborted?r():t.signal.addEventListener("abort",r))),i||(i=null);var v,p=(v=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l))&&v[1]||"";p&&-1===["http","https","file"].indexOf(p)?e(new _("Unsupported protocol "+p+":",_.ERR_BAD_REQUEST,t)):a.send(i)}))}),z),transformRequest:[function(t,n){if(A(n,"Accept"),A(n,"Content-Type"),O.isFormData(t)||O.isArrayBuffer(t)||O.isBuffer(t)||O.isStream(t)||O.isFile(t)||O.isBlob(t))return t;if(O.isArrayBufferView(t))return t.buffer;if(O.isURLSearchParams(t))return q(n,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var e,r=O.isObject(t),i=n&&n["Content-Type"];if((e=O.isFileList(t))||r&&"multipart/form-data"===i){var o=this.env&&this.env.FormData;return D(e?{"files[]":t}:t,o&&new o)}return r||"application/json"===i?(q(n,"application/json"),function(t){if(O.isString(t))try{return(0,JSON.parse)(t),O.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var n=this.transitional||I.transitional,e=!(n&&n.silentJSONParsing)&&"json"===this.responseType;if(e||n&&n.forcedJSONParsing&&O.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(e){if("SyntaxError"===t.name)throw _.from(t,_.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};O.forEach(["delete","get","head"],(function(t){I.headers[t]={}})),O.forEach(["post","put","patch"],(function(t){I.headers[t]=O.merge(k)}));var M=I,H=function(t,n,e){var r=this||M;return O.forEach(e,(function(e){t=e.call(r,t,n)})),t},X=function(t){return!(!t||!t.__CANCEL__)};function K(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new J}var W=function(t){return K(t),t.headers=t.headers||{},t.data=H.call(t,t.data,t.headers,t.transformRequest),t.headers=O.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),O.forEach(["delete","get","head","post","put","patch","common"],(function(n){delete t.headers[n]})),(t.adapter||M.adapter)(t).then((function(n){return K(t),n.data=H.call(t,n.data,n.headers,t.transformResponse),n}),(function(n){return X(n)||(K(t),n&&n.response&&(n.response.data=H.call(t,n.response.data,n.response.headers,t.transformResponse))),Promise.reject(n)}))},$=function(t,n){n=n||{};var e={};function r(t,n){return O.isPlainObject(t)&&O.isPlainObject(n)?O.merge(t,n):O.isPlainObject(n)?O.merge({},n):O.isArray(n)?n.slice():n}function i(e){return O.isUndefined(n[e])?O.isUndefined(t[e])?void 0:r(void 0,t[e]):r(t[e],n[e])}function o(t){if(!O.isUndefined(n[t]))return r(void 0,n[t])}function u(e){return O.isUndefined(n[e])?O.isUndefined(t[e])?void 0:r(void 0,t[e]):r(void 0,n[e])}function f(e){return e in n?r(t[e],n[e]):e in t?r(void 0,t[e]):void 0}var a={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:f};return O.forEach(Object.keys(t).concat(Object.keys(n)),(function(t){var n=a[t]||i,r=n(t);O.isUndefined(r)&&n!==f||(e[t]=r)})),e},V={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){V[t]=function(e){return typeof e===t||"a"+(n<1?"n ":" ")+t}}));var Z={};V.transitional=function(t,n,e){function r(t,n){return"[Axios v0.27.2] Transitional option '"+t+"'"+n+(e?". "+e:"")}return function(e,i,o){if(!1===t)throw new _(r(i," has been removed"+(n?" in "+n:"")),_.ERR_DEPRECATED);return n&&!Z[i]&&(Z[i]=!0,console.warn(r(i," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(e,i,o)}};var Q={assertOptions:function(t,n,e){if("object"!=typeof t)throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],u=n[o];if(u){var f=t[o],a=void 0===f||u(f,o,t);if(!0!==a)throw new _("option "+o+" must be "+a,_.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new _("Unknown option "+o,_.ERR_BAD_OPTION)}},validators:V},Y=Q.validators;function G(t){this.defaults=t,this.interceptors={request:new S,response:new S}}G.prototype.request=function(t,n){"string"==typeof t?(n=n||{}).url=t:n=t||{},(n=$(this.defaults,n)).method=n.method?n.method.toLowerCase():this.defaults.method?this.defaults.method.toLowerCase():"get";var e=n.transitional;void 0!==e&&Q.assertOptions(e,{silentJSONParsing:Y.transitional(Y.boolean),forcedJSONParsing:Y.transitional(Y.boolean),clarifyTimeoutError:Y.transitional(Y.boolean)},!1);var r=[],i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(n)||(i=i&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var o,u=[];if(this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)})),!i){var f=[W,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(u),o=Promise.resolve(n);f.length;)o=o.then(f.shift(),f.shift());return o}for(var a=n;r.length;){var c=r.shift(),s=r.shift();try{a=c(a)}catch(t){s(t);break}}try{o=W(a)}catch(t){return Promise.reject(t)}for(;u.length;)o=o.then(u.shift(),u.shift());return o},G.prototype.getUri=function(t){t=$(this.defaults,t);var n=P(t.baseURL,t.url);return E(n,t.params,t.paramsSerializer)},O.forEach(["delete","get","head","options"],(function(t){G.prototype[t]=function(n,e){return this.request($(e||{},{method:t,url:n,data:(e||{}).data}))}})),O.forEach(["post","put","patch"],(function(t){function n(n){return function(e,r,i){return this.request($(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:e,data:r}))}}G.prototype[t]=n(),G.prototype[t+"Form"]=n(!0)}));var tt=G;function nt(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var e=this;this.promise.then((function(t){if(e._listeners){var n,r=e._listeners.length;for(n=0;n<r;n++)e._listeners[n](t);e._listeners=null}})),this.promise.then=function(t){var n,r=new Promise((function(t){e.subscribe(t),n=t})).then(t);return r.cancel=function(){e.unsubscribe(n)},r},t((function(t){e.reason||(e.reason=new J(t),n(e.reason))}))}nt.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},nt.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},nt.prototype.unsubscribe=function(t){if(this._listeners){var n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}},nt.source=function(){var t;return{token:new nt((function(n){t=n})),cancel:t}};var et=nt,rt=function t(n){var e=new tt(n),i=r(tt.prototype.request,e);return O.extend(i,tt.prototype,e),O.extend(i,e),i.create=function(e){return t($(n,e))},i}(M);rt.Axios=tt,rt.CanceledError=J,rt.CancelToken=et,rt.isCancel=X,rt.VERSION="0.27.2",rt.toFormData=D,rt.AxiosError=_,rt.Cancel=rt.CanceledError,rt.all=function(t){return Promise.all(t)},rt.spread=function(t){return function(n){return t.apply(null,n)}},rt.isAxiosError=function(t){return O.isObject(t)&&!0===t.isAxiosError};var it=rt;it.default=rt;var ot=it,ut=function(t){return console.debug("[JS-SDK] ".concat(t.method.toUpperCase()," ").concat(t.baseURL).concat(t.url),t.data?JSON.stringify(t.data):""),t},ft=function(){function t(){this.requestLoggerId=null,this.api=ot.create({baseURL:"https://api.verdocs.com",timeout:3e3})}return t.prototype.setTimeout=function(t){return this.api.defaults.timeout=t,this},t.prototype.setClientID=function(t){return this.api.defaults.headers.common["X-Client-ID"]=t,this},t.prototype.setAuthorization=function(t){return t?this.api.defaults.headers.common.Authorization="Bearer ".concat(t):delete this.api.defaults.headers.common.Authorization,this},t.prototype.setSigningAuthorization=function(t){return t?this.api.defaults.headers.common.signer="Bearer ".concat(t):delete this.api.defaults.headers.common.signer,this},t.prototype.setBaseURL=function(t){return this.api.defaults.baseURL=t,this},t.prototype.logRequests=function(t){return t&&null===this.requestLoggerId?this.requestLoggerId=this.api.interceptors.request.use(ut):t||null===this.requestLoggerId||this.api.interceptors.request.eject(this.requestLoggerId),this},t}(),at=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")},ct=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return at()}try{return __global__||at()}finally{delete Object.prototype.__global__}}(),st=Symbol.for("verdocs-api-endpoint");ct[st]||(ct[st]=new ft);var lt=ct[st],ht=lt,dt=function(){return ht},vt=function(t){ht=t||lt},pt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mt=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,bt=function(t){var n;try{if(null===(n=function(t){return JSON.parse(function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!mt.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var n;t+="==".slice(2-(3&t.length));for(var e,r,i="",o=0;o<t.length;)n=pt.indexOf(t.charAt(o++))<<18|pt.indexOf(t.charAt(o++))<<12|(e=pt.indexOf(t.charAt(o++)))<<6|(r=pt.indexOf(t.charAt(o++))),i+=64===e?String.fromCharCode(n>>16&255):64===r?String.fromCharCode(n>>16&255,n>>8&255):String.fromCharCode(n>>16&255,n>>8&255,255&n);return i}((t||"").split(".")[1]||""))}(t)))return null}catch(t){return null}return Object.keys(n).forEach((function(t){"string"==typeof t&&t.startsWith("https://verdocs.com/")&&(n[t.replace("https://verdocs.com/","")]=n[t],delete n[t])})),n};export{ft as V,dt as a,bt as d,ct as g,vt as s}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-cec13589.system.js"],(function(e){"use strict";var t,r,n;return{setters:[function(e){t=e.g;r=e.a;n=e.d}],execute:function(){var i=e("a",(function(e){return r().api.post("/authentication/login",e).then((function(e){return e.data}))}));var o=function(e,t){r().setAuthorization(null);if(t){localStorage.removeItem(e)}c(e,null);return null};var a=e("s",(function(e,t,i){if(i===void 0){i=false}if(t===null){return o(e,i)}var a=n(t||"");if(a===null||a.exp&&a.exp*1e3<(new Date).getTime()){return o(e,i)}if(i){localStorage.setItem(e,t)}r().setAuthorization(t);c(e,a);return a}));var u=e("l",(function(e){var t=localStorage.getItem(e);if(!t){return null}var i=n(t);if(!i){return null}if(i.exp&&i.exp*1e3<(new Date).getTime()){localStorage.removeItem(e);return null}r().setAuthorization(t);c(e,i);return i}));var l=e("e",(function(e,t){if(t===void 0){t=false}return o(e,t)}));var s=Symbol.for("verdocs-session-listeners");if(!t[s]){t[s]=new Map}var f=Symbol.for("verdocs-session-listener-id");if(!t[f]){t[f]=0}var c=function(e,r){t[s].forEach((function(t){try{t(e,r)}catch(e){}}))}}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js"],(function(e,d){"use strict";var s,r;return{setters:[function(e){s=e.p;r=e.b}],execute:function(){var e=function(){var e=d.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return s(r)};e().then((function(e){return r([["p-
|
|
1
|
+
System.register(["./p-caed7818.system.js"],(function(e,d){"use strict";var s,r;return{setters:[function(e){s=e.p;r=e.b}],execute:function(){var e=function(){var e=d.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return s(r)};e().then((function(e){return r([["p-0c0b4a10.system",[[0,"verdocs-sign",{documentid:[1],roleid:[1],invitecode:[1],endpoint:[32],recipient:[32],signerToken:[32],pdfUrl:[32],recipientIndex:[32],document:[32],fields:[32],pdfPageInfo:[32],hasSignature:[32],nextButtonLabel:[32],focusedField:[32]}]]],["p-2b57857d.system",[[0,"verdocs-auth",{visible:[4],logo:[1],debug:[4],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["p-fd853e54.system",[[0,"verdocs-search"]]],["p-e2e643c5.system",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],open:[4],response:[32]}]]],["p-e719f9ca.system",[[0,"verdocs-organization-card",{organization:[16]}]]],["p-2c161242.system",[[0,"verdocs-quick-functions"]]],["p-d14a6057.system",[[0,"verdocs-search-tabs",{selected:[32]}]]],["p-f814d5cc.system",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],document:[16],isOpen:[32],recipientStatusIcons:[32]}]]],["p-1f55d8ac.system",[[0,"verdocs-template-card",{template:[16]}]]],["p-cc127684.system",[[0,"verdocs-template-tags",{tags:[16]}]]],["p-6802ef91.system",[[0,"verdocs-toggle",{options:[16],theme:[1]},[[6,"click","handleClick"]]]]],["p-cd6a2c40.system",[[0,"verdocs-text-input",{value:[1],label:[1],placeholder:[1],autocomplete:[1],type:[1],disabled:[4],_value:[32]}],[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["p-432c3151.system",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],open:[4],cancel:[4]}]]],["p-d6206c17.system",[[0,"verdocs-initial-dialog",{fullname:[1],open:[4],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["p-c2f97ef9.system",[[0,"verdocs-signature-dialog",{fullname:[1],open:[4],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["p-f0d0f959.system",[[0,"verdocs-upload-dialog",{open:[4],draggingOver:[32],decodedFiles:[32]}]]],["p-b9164c4b.system",[[0,"verdocs-search-activity",{type:[1],options:[8],emptyMessage:[32],authFailure:[32],title:[32],recent:[32],saved:[32],starred:[32]}],[0,"verdocs-search-box",{placeholder:[1],type:[1],query:[1]}]]],["p-144e0842.system",[[0,"verdocs-loader"]]],["p-4368df79.system",[[0,"verdocs-field-initial",{required:[4],fullName:[1,"full-name"],value:[1],focusField:[64]}],[0,"verdocs-field-signature",{required:[4],fullName:[1,"full-name"],value:[1],focusField:[64]}],[0,"verdocs-field-attachment",{order:[2],value:[1],required:[4],disabled:[4],focusField:[64]}],[0,"verdocs-view",{rotation:[2],source:[1],token:[1],loadProgress:[32]}],[0,"verdocs-dropdown",{options:[16],open:[4],isOpen:[32]}],[0,"verdocs-field-checkbox",{order:[2],value:[4],required:[4],disabled:[4]}],[0,"verdocs-field-date",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}],[0,"verdocs-field-dropdown",{options:[16],required:[4],order:[2],disabled:[4],value:[1],focused:[32],focusField:[64]}],[0,"verdocs-field-payment",{field:[16],fields:[16],pageNum:[2,"page-num"],roleName:[1,"role-name"],fieldId:[1,"field-id"],recipients:[8],selectedRoleName:[1,"selected-role-name"],pdfPages:[16],currentSignature:[1,"current-signature"],currentSignatureId:[1,"current-signature-id"],currentInitial:[1,"current-initial"],currentInitialId:[1,"current-initial-id"],focused:[4],signed:[4],preparedMessage:[32],signatureUrl:[32]}],[0,"verdocs-field-radio-button",{order:[2],checked:[4],value:[1],name:[1],required:[4],disabled:[4]}],[0,"verdocs-field-textarea",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}],[0,"verdocs-field-textbox",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}]]]],e)}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as o}from"./p-2bc58746.js";import{g as i,d as n,V as r,s}from"./p-6348272c.js";import{B as a}from"./p-ef932a87.js";function c(e){switch(e%10){case 0:return 0===e?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function l(e,t){return e*t}var d=function(){return(d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},u=new RegExp(/\+[1-9]\d{6,14}/g),h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,p=function(e,t,o,i){return new(o||(o=Promise))((function(n,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))},f=function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},v=function(e,t,o){return p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),o).then((function(e){return e.data}))]}))}))};const b="https://stage-api.verdocs.com",g=class{constructor(t){e(this,t),this.documentid=null,this.roleid=null,this.invitecode=null,this.endpoint=null,this.recipient=null,this.signerToken=null,this.pdfUrl=null,this.recipientIndex=-1,this.document=null,this.fields=[],this.hasSignature=!1,this.nextButtonLabel="Start",this.focusedField=""}componentWillLoad(){const e=(new r).setBaseURL(b);s(e)}async componentDidLoad(){try{console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);const{session:o,recipient:r,signerToken:s}=await(t={documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode},p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(t.documentId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(e){var t,o,r=(null===(t=e.headers)||void 0===t?void 0:t.signer_token)||"",s=n(r);return i().setAuthorization(null===(o=e.headers)||void 0===o?void 0:o.signer_token),{recipient:e.data,session:s,signerToken:r}}))]}))})));console.log("[SIGN] Got signing session",o),console.log("[SIGN] Recipient",r),this.recipient=r,this.signerToken=s,i().setSigningAuthorization(s),this.recipient.agreed&&(this.nextButtonLabel="Next");const a=await(e=this.documentid,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))})));this.document=a,console.log("[SIGN] Document",a),this.pdfUrl=`${b}/documents/${this.documentid}/envelope_documents/${a.envelope_document_id}?file=true`,this.recipientIndex=this.document.recipients.findIndex((e=>e.role_name==this.roleid)),this.recipientIndex>-1&&console.log("Found recipient",this.document.recipients[this.recipientIndex]),this.fields=this.document.fields.filter((e=>e.recipient_role===this.roleid)),console.log("Loaded fields",this.fields)}catch(e){console.log("Error with signing session",e)}var e,t}handleClickAgree(){var e,t,o,n,r,s,a;console.log("agree clicked"),(e=this.documentid,t=this.roleid,"update",o={agreed:!0},n=void 0,r=void 0,s=void 0,a=function(){return function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,(function(){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),d({role_name:t,action:"update"},o||{})).then((function(e){return e.data}))]}))},new(s||(s=Promise))((function(e,t){function o(e){try{c(a.next(e))}catch(e){t(e)}}function i(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(o,i)}c((a=a.apply(n,r||[])).next())}))).then((e=>{console.log("update result",e),this.nextButtonLabel="Next",this.recipient=e})).catch((e=>{console.log("update failure",e)}))}async savePDF(){const e=`${this.document.name} - ${this.document.updated_at.split("T")[0]}.pdf`,t=await(o=this.documentid,n=this.document.envelope_document_id,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(o,"/envelope_documents/").concat(n,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return a.from(e.data,"binary").toString("base64")}))]}))})));var o,n;let r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){let t=document.createElement("a");t.href=window.URL.createObjectURL(r.response),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),t.remove()};const s=`data:application/pdf;base64,${t}`;console.log("url",s.length,s),r.open("GET",`data:application/pdf;base64,${t}`),r.send()}async handleOptionSelected(e){switch(e.detail.id){case"later":(null===window||void 0===window?void 0:window.STORYBOOK_ENV)||window.alert("User intends to sign later.");break;case"claim":case"decline":case"print":break;case"download":this.savePDF().catch((()=>{}))}}async handleFieldChange(e,t,o){switch(console.log("fieldChange",e,t.detail),e.type){case"textbox":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"checkbox_group":v(this.documentid,e.name,{prepared:!1,value:{options:[{id:o,checked:t.detail}]}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"radio_button_group":const i=e.settings.options.map((e=>({id:e.id,selected:o===e.id})));v(this.documentid,e.name,{prepared:!1,value:{options:i}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"dropdown":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail)}}renderCheckboxGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-checkbox",{style:r,order:n,value:i.checked,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderRadioGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-radio-button",{style:r,order:n,value:i.id,name:o.name,checked:i.selected,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderField(e,o){const{required:i=!1,settings:n={}}=e,{x:r=0,y:s=0,base64:a="",placeholder:d="",options:u=[],value:h="",result:p=""}=n,f=this.pdfPageInfo.pages.find((t=>t.pageNumber===e.page));if(!f)return console.log("Unable to render invalid field",e),t("div",{class:"invalid-field"},"Invalid field.");const v={left:`${l(f.xRatio,r)}px`,bottom:`${l(f.yRatio,s)}px`,position:"absolute",transform:`scale(${f.xRatio}, ${f.yRatio})`,backgroundColor:e.settings.rgba||c(this.recipientIndex)};e.settings.height&&(v.height=`${e.settings.height}px`),e.settings.width&&(v.width=`${e.settings.width}px`),console.log("rendering field",e.type,e);const b=`field-${e.name}`;switch(e.type){case"signature":return t("verdocs-field-signature",{style:v,value:a,required:i,id:b});case"initial":return t("verdocs-field-initial",{style:v,required:i,id:b});case"textbox":return t("verdocs-field-textbox",{style:v,order:o,value:p||"",placeholder:d,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"textarea":return t("verdocs-field-textarea",{style:v,placeholder:d||"",id:b});case"date":return t("verdocs-field-date",{style:v,order:o,value:p||"",placeholder:d,required:i,id:b});case"dropdown":return t("verdocs-field-dropdown",{style:v,options:u,value:h,required:i,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"checkbox":return t("verdocs-field-checkbox",{style:v,value:p||"",id:b});case"checkbox_group":return e.settings.options.map(((t,o)=>this.renderCheckboxGroupOption(f,e,t,o)));case"radio_button_group":return e.settings.options.map(((t,o)=>this.renderRadioGroupOption(f,e,t,o)));case"attachment":return t("verdocs-field-attachment",{style:v,value:p||"",id:b});case"payment":return t("verdocs-field-payment",{style:v,field:e,id:b});default:console.log("[SIGN] Skipping unsupported field type",e)}return t("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')}isFieldValid(e){var t,o,i,n,r,s,a,c,l,d,p,f,v;switch(e.type){case"textbox":switch((null===(t=e.settings)||void 0===t?void 0:t.validator)||""){case"email":return v=(null===(o=e.settings)||void 0===o?void 0:o.result)||"",h.test(v);case"phone":return function(e){return null!==(t=e)&&t.length<16&&t.length>6&&u.test(t)||""===t||null===t;var t}((null===(i=e.settings)||void 0===i?void 0:i.result)||"");default:return!!(null===(n=e.settings)||void 0===n?void 0:n.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!(null===(r=e.settings)||void 0===r?void 0:r.result);case"dropdown":return!!(null===(s=e.settings)||void 0===s?void 0:s.value);case"checkbox_group":const b=((null===(c=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===c?void 0:c.filter((e=>e.checked)))||[]).length;return b>=((null===(l=e.settings)||void 0===l?void 0:l.minimum_checked)||0)&&b<=((null===(d=e.settings)||void 0===d?void 0:d.maximum_checked)||999);case"radio_button_group":return((null===(f=null===(p=e.settings)||void 0===p?void 0:p.options)||void 0===f?void 0:f.filter((e=>e.selected)))||[]).length>0;default:return!1}}handleDocumentRendered(e){console.log("[SIGN] Document rendered",e.detail),this.pdfPageInfo=e.detail}handleNext(){const e=this.fields.filter((e=>e.required));console.log("required Fields",e);const t=e.findIndex((e=>e.name===this.focusedField));console.log("focused Index",t);let o=t+1;o>=e.length&&(o=0);const i=e[o];if(console.log("next required fielod",i),i){const e=document.getElementById(`field-${i.name}`);null==e||e.focusField(),this.focusedField=i.name}}render(){var e,i,n,r,s;return t(o,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),agreed:null===(e=this.recipient)||void 0===e?void 0:e.agreed}},t("div",{class:"header"},t("div",{class:"intro"},"Please review and act on these documents."),t("div",{class:"toolbar"},t("div",{class:"tools"},t("verdocs-dropdown",{options:[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:!0},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],onOptionSelected:e=>this.handleOptionSelected(e)}),(null===(i=this.recipient)||void 0===i?void 0:i.agreed)?t("div",{style:{flex:"1"}}):t("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},t("div",{class:"agree-checkbox"},t("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:()=>this.handleClickAgree()}),t("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."),t("verdocs-button",{label:this.nextButtonLabel,disabled:!(null===(n=this.recipient)||void 0===n?void 0:n.agreed),onClick:()=>this.handleNext()})))),(null===(r=this.recipient)||void 0===r?void 0:r.agreed)?t("div",{style:{display:"none"}}):t("div",{class:"cover"}),t("div",{class:"document"},this.pdfUrl?t("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:e=>this.handleDocumentRendered(e)}):t("verdocs-loader",null),((null===(s=this.pdfPageInfo)||void 0===s?void 0:s.pages)||[]).map((e=>{var o;return t("div",{class:"page-controls",style:{height:`${e.height}px`,width:`${e.width}px`,top:`${e.canvasTop}px`,margin:"0 auto"}},(null===(o=this.pdfPageInfo)||void 0===o?void 0:o.numRendered)>0?this.fields.filter((t=>t.page===e.pageNumber)).map(((e,t)=>this.renderField(e,t))):t("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))}};g.style='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';export{g as verdocs_sign}
|
|
1
|
+
import{r as e,h as t,H as o}from"./p-2bc58746.js";import{a as i,d as n,V as r,s}from"./p-737b2e99.js";import{B as a}from"./p-ef932a87.js";function c(e){switch(e%10){case 0:return 0===e?"rgba(255, 193, 7, 0.4)":"rgba(134, 134, 134, 0.3)";case 1:return"rgba(156, 39, 176, .4)";case 2:return"rgba(33, 150, 243, .4)";case 3:return"rgba(220, 231, 117, 0.3)";case 4:return"rgba(121, 134, 203, 0.3)";case 5:return"rgba(77, 182, 172, 0.3)";case 6:return"rgba(255, 202, 165, 0.3)";case 7:return"rgba(2, 247, 190, 0.3)";case 8:return"rgba(255, 138, 101, 0.3)";case 9:return"rgba(82, 255, 79, 0.3)";default:return"rgba(229, 115, 155, 0.3)"}}function l(e,t){return e*t}var d=function(){return(d=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},u=new RegExp(/\+[1-9]\d{6,14}/g),h=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,p=function(e,t,o,i){return new(o||(o=Promise))((function(n,r){function s(e){try{c(i.next(e))}catch(e){r(e)}}function a(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))},f=function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}},v=function(e,t,o){return p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.put("/documents/".concat(e,"/fields/").concat(t),o).then((function(e){return e.data}))]}))}))};const b="https://stage-api.verdocs.com",g=class{constructor(t){e(this,t),this.documentid=null,this.roleid=null,this.invitecode=null,this.endpoint=null,this.recipient=null,this.signerToken=null,this.pdfUrl=null,this.recipientIndex=-1,this.document=null,this.fields=[],this.hasSignature=!1,this.nextButtonLabel="Start",this.focusedField=""}componentWillLoad(){const e=(new r).setBaseURL(b);s(e)}async componentDidLoad(){try{console.log("[SIGN] Processing invite code",this.documentid,this.roleid,this.invitecode);const{session:o,recipient:r,signerToken:s}=await(t={documentId:this.documentid,roleId:this.roleid,inviteCode:this.invitecode},p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(t.documentId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(e){var t,o,r=(null===(t=e.headers)||void 0===t?void 0:t.signer_token)||"",s=n(r);return i().setAuthorization(null===(o=e.headers)||void 0===o?void 0:o.signer_token),{recipient:e.data,session:s,signerToken:r}}))]}))})));console.log("[SIGN] Got signing session",o),console.log("[SIGN] Recipient",r),this.recipient=r,this.signerToken=s,i().setSigningAuthorization(s),this.recipient.agreed&&(this.nextButtonLabel="Next");const a=await(e=this.documentid,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(e)).then((function(e){return e.data}))]}))})));this.document=a,console.log("[SIGN] Document",a),this.pdfUrl=`${b}/documents/${this.documentid}/envelope_documents/${a.envelope_document_id}?file=true`,this.recipientIndex=this.document.recipients.findIndex((e=>e.role_name==this.roleid)),this.recipientIndex>-1&&console.log("Found recipient",this.document.recipients[this.recipientIndex]),this.fields=this.document.fields.filter((e=>e.recipient_role===this.roleid)),console.log("Loaded fields",this.fields)}catch(e){console.log("Error with signing session",e)}var e,t}handleClickAgree(){var e,t,o,n,r,s,a;console.log("agree clicked"),(e=this.documentid,t=this.roleid,"update",o={agreed:!0},n=void 0,r=void 0,s=void 0,a=function(){return function(e,t){var o,i,n,r,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,i&&(n=2&r[0]?i.return:r[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,r[1])).done)return n;switch(i=0,n&&(r=[2&r[0],n.value]),r[0]){case 0:case 1:n=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!n||r[1]>n[0]&&r[1]<n[3])){s.label=r[1];break}if(6===r[0]&&s.label<n[1]){s.label=n[1],n=r;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(r);break}n[2]&&s.ops.pop(),s.trys.pop();continue}r=t.call(e,s)}catch(e){r=[6,e],i=0}finally{o=n=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}(this,(function(){return[2,i().api.put("/documents/".concat(e,"/recipients/").concat(t),d({role_name:t,action:"update"},o||{})).then((function(e){return e.data}))]}))},new(s||(s=Promise))((function(e,t){function o(e){try{c(a.next(e))}catch(e){t(e)}}function i(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof s?n:new s((function(e){e(n)}))).then(o,i)}c((a=a.apply(n,r||[])).next())}))).then((e=>{console.log("update result",e),this.nextButtonLabel="Next",this.recipient=e})).catch((e=>{console.log("update failure",e)}))}async savePDF(){const e=`${this.document.name} - ${this.document.updated_at.split("T")[0]}.pdf`,t=await(o=this.documentid,n=this.document.envelope_document_id,p(void 0,void 0,void 0,(function(){return f(this,(function(){return[2,i().api.get("/documents/".concat(o,"/envelope_documents/").concat(n,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return a.from(e.data,"binary").toString("base64")}))]}))})));var o,n;let r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){let t=document.createElement("a");t.href=window.URL.createObjectURL(r.response),t.download=e,t.style.display="none",document.body.appendChild(t),t.click(),t.remove()};const s=`data:application/pdf;base64,${t}`;console.log("url",s.length,s),r.open("GET",`data:application/pdf;base64,${t}`),r.send()}async handleOptionSelected(e){switch(e.detail.id){case"later":(null===window||void 0===window?void 0:window.STORYBOOK_ENV)||window.alert("User intends to sign later.");break;case"claim":case"decline":case"print":break;case"download":this.savePDF().catch((()=>{}))}}async handleFieldChange(e,t,o){switch(console.log("fieldChange",e,t.detail),e.type){case"textbox":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"checkbox_group":v(this.documentid,e.name,{prepared:!1,value:{options:[{id:o,checked:t.detail}]}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"radio_button_group":const i=e.settings.options.map((e=>({id:e.id,selected:o===e.id})));v(this.documentid,e.name,{prepared:!1,value:{options:i}}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"dropdown":v(this.documentid,e.name,{prepared:!1,value:t.detail}).then((e=>console.log("Update result",e))).catch((e=>console.log("Error updating",e)));break;case"initial":console.log("Got initial",t.detail);break;case"signature":console.log("Got signature",t.detail)}}renderCheckboxGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-checkbox",{style:r,order:n,value:i.checked,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderRadioGroupOption(e,o,i,n){const r={left:`${l(e.xRatio,i.x)}px`,bottom:`${l(e.yRatio,i.y)}px`,position:"absolute",transform:`scale(${e.xRatio}, ${e.yRatio})`,backgroundColor:c(this.recipientIndex)};return t("verdocs-field-radio-button",{style:r,order:n,value:i.id,name:o.name,checked:i.selected,onFieldChange:e=>this.handleFieldChange(o,e,i.id)})}renderField(e,o){const{required:i=!1,settings:n={}}=e,{x:r=0,y:s=0,base64:a="",placeholder:d="",options:u=[],value:h="",result:p=""}=n,f=this.pdfPageInfo.pages.find((t=>t.pageNumber===e.page));if(!f)return console.log("Unable to render invalid field",e),t("div",{class:"invalid-field"},"Invalid field.");const v={left:`${l(f.xRatio,r)}px`,bottom:`${l(f.yRatio,s)}px`,position:"absolute",transform:`scale(${f.xRatio}, ${f.yRatio})`,backgroundColor:e.settings.rgba||c(this.recipientIndex)};e.settings.height&&(v.height=`${e.settings.height}px`),e.settings.width&&(v.width=`${e.settings.width}px`),console.log("rendering field",e.type,e);const b=`field-${e.name}`;switch(e.type){case"signature":return t("verdocs-field-signature",{style:v,value:a,required:i,id:b});case"initial":return t("verdocs-field-initial",{style:v,required:i,id:b});case"textbox":return t("verdocs-field-textbox",{style:v,order:o,value:p||"",placeholder:d,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"textarea":return t("verdocs-field-textarea",{style:v,placeholder:d||"",id:b});case"date":return t("verdocs-field-date",{style:v,order:o,value:p||"",placeholder:d,required:i,id:b});case"dropdown":return t("verdocs-field-dropdown",{style:v,options:u,value:h,required:i,id:b,onFieldChange:t=>this.handleFieldChange(e,t)});case"checkbox":return t("verdocs-field-checkbox",{style:v,value:p||"",id:b});case"checkbox_group":return e.settings.options.map(((t,o)=>this.renderCheckboxGroupOption(f,e,t,o)));case"radio_button_group":return e.settings.options.map(((t,o)=>this.renderRadioGroupOption(f,e,t,o)));case"attachment":return t("verdocs-field-attachment",{style:v,value:p||"",id:b});case"payment":return t("verdocs-field-payment",{style:v,field:e,id:b});default:console.log("[SIGN] Skipping unsupported field type",e)}return t("div",{style:{display:"none"}},'Unsupported field type "',e.type,'"')}isFieldValid(e){var t,o,i,n,r,s,a,c,l,d,p,f,v;switch(e.type){case"textbox":switch((null===(t=e.settings)||void 0===t?void 0:t.validator)||""){case"email":return v=(null===(o=e.settings)||void 0===o?void 0:o.result)||"",h.test(v);case"phone":return function(e){return null!==(t=e)&&t.length<16&&t.length>6&&u.test(t)||""===t||null===t;var t}((null===(i=e.settings)||void 0===i?void 0:i.result)||"");default:return!!(null===(n=e.settings)||void 0===n?void 0:n.result)}case"signature":case"initial":case"textarea":case"date":case"attachment":return!!(null===(r=e.settings)||void 0===r?void 0:r.result);case"dropdown":return!!(null===(s=e.settings)||void 0===s?void 0:s.value);case"checkbox_group":const b=((null===(c=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===c?void 0:c.filter((e=>e.checked)))||[]).length;return b>=((null===(l=e.settings)||void 0===l?void 0:l.minimum_checked)||0)&&b<=((null===(d=e.settings)||void 0===d?void 0:d.maximum_checked)||999);case"radio_button_group":return((null===(f=null===(p=e.settings)||void 0===p?void 0:p.options)||void 0===f?void 0:f.filter((e=>e.selected)))||[]).length>0;default:return!1}}handleDocumentRendered(e){console.log("[SIGN] Document rendered",e.detail),this.pdfPageInfo=e.detail}handleNext(){const e=this.fields.filter((e=>e.required));console.log("required Fields",e);const t=e.findIndex((e=>e.name===this.focusedField));console.log("focused Index",t);let o=t+1;o>=e.length&&(o=0);const i=e[o];if(console.log("next required fielod",i),i){const e=document.getElementById(`field-${i.name}`);null==e||e.focusField(),this.focusedField=i.name}}render(){var e,i,n,r,s;return t(o,{class:{storybook:!!(null===window||void 0===window?void 0:window.STORYBOOK_ENV),agreed:null===(e=this.recipient)||void 0===e?void 0:e.agreed}},t("div",{class:"header"},t("div",{class:"intro"},"Please review and act on these documents."),t("div",{class:"toolbar"},t("div",{class:"tools"},t("verdocs-dropdown",{options:[{id:"later",label:"Finish Later"},{id:"claim",label:"Claim the Document",disabled:!0},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],onOptionSelected:e=>this.handleOptionSelected(e)}),(null===(i=this.recipient)||void 0===i?void 0:i.agreed)?t("div",{style:{flex:"1"}}):t("div",{style:{flex:"1",flexDirection:"row",display:"flex",alignItems:"center"}},t("div",{class:"agree-checkbox"},t("input",{type:"checkbox",value:"None",id:"agree-checkbox-element",name:"agree",onChange:()=>this.handleClickAgree()}),t("label",{htmlFor:"agree-checkbox-element"})),"I agree to use electronic records and signatures."),t("verdocs-button",{label:this.nextButtonLabel,disabled:!(null===(n=this.recipient)||void 0===n?void 0:n.agreed),onClick:()=>this.handleNext()})))),(null===(r=this.recipient)||void 0===r?void 0:r.agreed)?t("div",{style:{display:"none"}}):t("div",{class:"cover"}),t("div",{class:"document"},this.pdfUrl?t("verdocs-view",{source:this.pdfUrl,token:this.signerToken,onDocumentRendered:e=>this.handleDocumentRendered(e)}):t("verdocs-loader",null),((null===(s=this.pdfPageInfo)||void 0===s?void 0:s.pages)||[]).map((e=>{var o;return t("div",{class:"page-controls",style:{height:`${e.height}px`,width:`${e.width}px`,top:`${e.canvasTop}px`,margin:"0 auto"}},(null===(o=this.pdfPageInfo)||void 0===o?void 0:o.numRendered)>0?this.fields.filter((t=>t.page===e.pageNumber)).map(((e,t)=>this.renderField(e,t))):t("div",{style:{display:"none"}},"Waiting for PDF to render..."))}))))}};g.style='verdocs-sign{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:600px;-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}verdocs-sign.storybook{max-height:600px}verdocs-sign div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign .header{-ms-flex:0 0 115px;flex:0 0 115px;z-index:1000;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);-webkit-transition:all 0.25s;transition:all 0.25s}verdocs-sign .intro{background-color:#ffffff;width:100%;margin:0 auto;padding:20px;max-width:1028px;color:rgba(0, 0, 0, 0.87)}verdocs-sign .toolbar{width:100%;margin:0 auto;padding:0 20px;max-width:1028px;position:relative}verdocs-sign .tools{width:100%;color:#fff;height:56px;padding:4px;display:-ms-flexbox;display:flex;font-size:12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;background-color:#33354c}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign .document{-ms-flex:1;flex:1;height:100%;position:relative;overflow-y:scroll}verdocs-sign .agree-checkbox{-ms-flex:0 0 20px;flex:0 0 20px;display:-ms-flexbox;display:flex;width:20px;height:20px;border-radius:3px;background:#ffffff;position:relative;margin:0 10px 0 30px}verdocs-sign .agree-checkbox label{left:2px;top:2px;width:16px;height:16px;cursor:pointer;position:absolute;background:#33354c;-webkit-box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8);box-shadow:inset 0 -1px 1px rgba(255, 255, 255, 0.8)}verdocs-sign .agree-checkbox label:after{top:2px;left:3px;width:8px;opacity:0;height:5px;content:"";position:absolute;background:transparent;filter:alpha(opacity=0);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);border:2px solid #fcfff4;border-top:none;border-right:none}verdocs-sign .agree-checkbox label:hover::after{filter:alpha(opacity=30);opacity:0.3}verdocs-sign .agree-checkbox input[type=checkbox]:checked+label:after{filter:alpha(opacity=100);opacity:1}verdocs-sign.agreed .intro{display:none}verdocs-sign.agreed .header{-ms-flex:0 0 56px;flex:0 0 56px}verdocs-sign.agreed .agree-checkbox{background:#ccc}verdocs-sign.agreed .agree-checkbox label{cursor:default}verdocs-sign .page-controls{position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:500}';export{g as verdocs_sign}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-caed7818.system.js","./p-e93ac86f.system.js","./p-e3659c64.system.js","./p-5dfd73f9.system.js"],(function(e){"use strict";var t,r,n,i,o;return{setters:[function(e){t=e.r;r=e.c;n=e.h},function(e){i=e.l},function(e){o=e.g},function(){}],execute:function(){var s=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))};var a=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var c=function(){return s(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,o().api.get("/search/history").then((function(e){return e.data}))]}))}))};var l=function(e){return o().api.get("/templates/",{params:e}).then((function(e){return e.data}))};var h='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var d='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:var(--verdocs-background-dark)}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#ccc}';var p="verdocs-stage";var f=e("verdocs_search_activity",function(){function e(e){t(this,e);this.entrySelected=r(this,"entrySelected",7);this.type="recent";this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;i(p);var t=function(t){var r;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((r=t===null||t===void 0?void 0:t.response)===null||r===void 0?void 0:r.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";c().then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";c().then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";l({is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return n("div",{class:"container"},n("p",{class:"title"},this.title),n("div",{class:"items"},this.recent.map((function(t){return n("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},n("div",{class:"icon",innerHTML:h}),n("div",{class:"details"},n("div",{class:"item-title"},t.params.q),n("div",{class:"info"},"Test")))})),this.saved.map((function(t){return n("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},n("div",{class:"icon",innerHTML:h}),n("div",{class:"details"},n("div",{class:"item-title"},t.params.q),n("div",{class:"info"})))})),t&&n("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}());f.style=d;var u='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n';var v='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n';var x='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:var(--verdocs-container-border-color)}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#50be80;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var y=e("verdocs_search_box",function(){function e(e){t(this,e);this.searchClicked=r(this,"searchClicked",7);this.typeChanged=r(this,"typeChanged",7);this.queryChanged=r(this,"queryChanged",7);this.placeholder="search documents, templates, people...";this.type="all";this.query=""}e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return n("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&n("span",{class:"type"},this.type,"s ",n("button",{class:"remove",innerHTML:v,onClick:function(){return e.handleClearFilter()}})),n("input",{type:"text",placeholder:this.placeholder,value:this.query,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)}}),n("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},n("span",{innerHTML:u}),"Search"))};return e}());y.style=x}}}));
|
|
1
|
+
System.register(["./p-caed7818.system.js","./p-8730dc92.system.js","./p-cec13589.system.js","./p-5dfd73f9.system.js"],(function(e){"use strict";var t,r,n,i,o;return{setters:[function(e){t=e.r;r=e.c;n=e.h},function(e){i=e.l},function(e){o=e.a},function(){}],execute:function(){var s=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))};var a=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var c=function(){return s(void 0,void 0,void 0,(function(){return a(this,(function(e){return[2,o().api.get("/search/history").then((function(e){return e.data}))]}))}))};var l=function(e){return o().api.get("/templates/",{params:e}).then((function(e){return e.data}))};var h='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var d='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:var(--verdocs-background-dark)}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#ccc}';var p="verdocs-stage";var f=e("verdocs_search_activity",function(){function e(e){t(this,e);this.entrySelected=r(this,"entrySelected",7);this.type="recent";this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;i(p);var t=function(t){var r;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((r=t===null||t===void 0?void 0:t.response)===null||r===void 0?void 0:r.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";c().then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";c().then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";l({is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return n("div",{class:"container"},n("p",{class:"title"},this.title),n("div",{class:"items"},this.recent.map((function(t){return n("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},n("div",{class:"icon",innerHTML:h}),n("div",{class:"details"},n("div",{class:"item-title"},t.params.q),n("div",{class:"info"},"Test")))})),this.saved.map((function(t){return n("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},n("div",{class:"icon",innerHTML:h}),n("div",{class:"details"},n("div",{class:"item-title"},t.params.q),n("div",{class:"info"})))})),t&&n("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}());f.style=d;var u='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n';var v='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n';var x='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:var(--verdocs-container-border-color)}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#50be80;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var y=e("verdocs_search_box",function(){function e(e){t(this,e);this.searchClicked=r(this,"searchClicked",7);this.typeChanged=r(this,"typeChanged",7);this.queryChanged=r(this,"queryChanged",7);this.placeholder="search documents, templates, people...";this.type="all";this.query=""}e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return n("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&n("span",{class:"type"},this.type,"s ",n("button",{class:"remove",innerHTML:v,onClick:function(){return e.handleClearFilter()}})),n("input",{type:"text",placeholder:this.placeholder,value:this.query,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)}}),n("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},n("span",{innerHTML:u}),"Search"))};return e}());y.style=x}}}));
|