@documenso/embed-webcomponent 0.0.1 → 0.0.2-rc.1
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/index.js +1 -1
- package/dist/index.mjs +238 -247
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var L,h,ye,C,re,ge,V,Z,G,K,S={},be=[],Ue=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ee=Array.isArray;function $(e,t){for(var n in t)e[n]=t[n];return e}function ke(e){var t=e.parentNode;t&&t.removeChild(e)}function P(e,t,n){var r,_,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?_=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?L.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return N(e,l,r,_,null)}function N(e,t,n,r,_){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:_??++ye,__i:-1,__u:0};return _==null&&h.vnode!=null&&h.vnode(o),o}function q(e){return e.children}function M(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?x(e):null}function we(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return we(e)}}function ie(e){(!e.__d&&(e.__d=!0)&&C.push(e)&&!R.__r++||re!==h.debounceRendering)&&((re=h.debounceRendering)||ge)(R)}function R(){var e,t,n,r,_,o,l,c;for(C.sort(V);e=C.shift();)e.__d&&(t=C.length,r=void 0,o=(_=(n=e).__v).__e,l=[],c=[],n.__P&&((r=$({},_)).__v=_.__v+1,h.vnode&&h.vnode(r),te(n.__P,r,_,n.__n,n.__P.namespaceURI,32&_.__u?[o]:null,l,o??x(_),!!(32&_.__u),c),r.__v=_.__v,r.__.__k[r.__i]=r,Ce(l,r,c),r.__e!=o&&we(r)),C.length>t&&C.sort(V));R.__r=0}function $e(e,t,n,r,_,o,l,c,a,s,f){var i,g,u,v,k,y=r&&r.__k||be,d=t.length;for(n.__d=a,Ae(n,t,y),a=n.__d,i=0;i<d;i++)(u=n.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?S:y[u.__i]||S,u.__i=i,te(e,u,g,_,o,l,c,a,s,f),v=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&ne(g.ref,null,u),f.push(u.ref,u.__c||v,u)),k==null&&v!=null&&(k=v),65536&u.__u||g.__k===u.__k?a=Ee(u,a,e):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:v&&(a=v.nextSibling),u.__d=void 0,u.__u&=-196609);n.__d=a,n.__e=k}function Ae(e,t,n){var r,_,o,l,c,a=t.length,s=n.length,f=s,i=0;for(e.__k=[],r=0;r<a;r++)l=r+i,(_=e.__k[r]=(_=t[r])==null||typeof _=="boolean"||typeof _=="function"?null:typeof _=="string"||typeof _=="number"||typeof _=="bigint"||_.constructor==String?N(null,_,null,null,null):ee(_)?N(q,{children:_},null,null,null):_.constructor===void 0&&_.__b>0?N(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_)!=null?(_.__=e,_.__b=e.__b+1,c=Me(_,n,l,f),_.__i=c,o=null,c!==-1&&(f--,(o=n[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&i--,typeof _.type!="function"&&(_.__u|=65536)):c!==l&&(c==l-1?i--:c==l+1?i++:c>l?f>a-l?i+=c-l:i--:c<l&&(c==l-i?i-=c-l:i++),c!==r+i&&(_.__u|=65536))):(o=n[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),Q(o,o,!1),n[l]=null,f--);if(f)for(r=0;r<s;r++)(o=n[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),Q(o,o))}function Ee(e,t,n){var r,_;if(typeof e.type=="function"){for(r=e.__k,_=0;r&&_<r.length;_++)r[_]&&(r[_].__=e,t=Ee(r[_],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=x(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Me(e,t,n,r){var _=e.key,o=e.type,l=n-1,c=n+1,a=t[n];if(a===null||a&&_==a.key&&o===a.type&&!(131072&a.__u))return n;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;l>=0||c<t.length;){if(l>=0){if((a=t[l])&&!(131072&a.__u)&&_==a.key&&o===a.type)return l;l--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&_==a.key&&o===a.type)return c;c++}}return-1}function le(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Ue.test(t)?n:n+"px"}function A(e,t,n,r,_){var o;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||le(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||le(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Z,e.addEventListener(t,o?K:G,o)):e.removeEventListener(t,o?K:G,o);else{if(_=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function ce(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Z++;else if(t.t<n.u)return;return n(h.event?h.event(t):t)}}}function te(e,t,n,r,_,o,l,c,a,s){var f,i,g,u,v,k,y,d,p,D,E,T,H,oe,F,z,w=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),o=[c=t.__e=n.__e]),(f=h.__b)&&f(t);e:if(typeof w=="function")try{if(d=t.props,p="prototype"in w&&w.prototype.render,D=(f=w.contextType)&&r[f.__c],E=f?D?D.props.value:f.__:r,n.__c?y=(i=t.__c=n.__c).__=i.__E:(p?t.__c=i=new w(d,E):(t.__c=i=new M(d,E),i.constructor=w,i.render=Re),D&&D.sub(i),i.props=d,i.state||(i.state={}),i.context=E,i.__n=r,g=i.__d=!0,i.__h=[],i._sb=[]),p&&i.__s==null&&(i.__s=i.state),p&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(d,i.__s))),u=i.props,v=i.state,i.__v=t,g)p&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),p&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(p&&w.getDerivedStateFromProps==null&&d!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,E),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,E)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(i.props=d,i.state=i.__s,i.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(U){U&&(U.__=t)}),T=0;T<i._sb.length;T++)i.__h.push(i._sb[T]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,E),p&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=E,i.props=d,i.__P=e,i.__e=!1,H=h.__r,oe=0,p){for(i.state=i.__s,i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),F=0;F<i._sb.length;F++)i.__h.push(i._sb[F]);i._sb=[]}else do i.__d=!1,H&&H(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++oe<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),p&&!g&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(u,v)),$e(e,ee(z=f!=null&&f.type===q&&f.key==null?f.props.children:f)?z:[z],t,n,r,_,o,l,c,a,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),y&&(i.__E=i.__=null)}catch(U){if(t.__v=null,a||o!=null){for(t.__u|=a?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=n.__e,t.__k=n.__k;h.__e(U,t,n)}else o==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Oe(n.__e,t,n,r,_,o,l,a,s);(f=h.diffed)&&f(t)}function Ce(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)ne(n[r],n[++r],n[++r]);h.__c&&h.__c(t,e),e.some(function(_){try{e=_.__h,_.__h=[],e.some(function(o){o.call(_)})}catch(o){h.__e(o,_.__v)}})}function Oe(e,t,n,r,_,o,l,c,a){var s,f,i,g,u,v,k,y=n.props,d=t.props,p=t.type;if(p==="svg"?_="http://www.w3.org/2000/svg":p==="math"?_="http://www.w3.org/1998/Math/MathML":_||(_="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((u=o[s])&&"setAttribute"in u==!!p&&(p?u.localName===p:u.nodeType===3)){e=u,o[s]=null;break}}if(e==null){if(p===null)return document.createTextNode(d);e=document.createElementNS(_,p,d.is&&d),o=null,c=!1}if(p===null)y===d||c&&e.data===d||(e.data=d);else{if(o=o&&L.call(e.childNodes),y=n.props||S,!c&&o!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)if(u=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=u;else if(s!=="key"&&!(s in d)){if(s=="value"&&"defaultValue"in d||s=="checked"&&"defaultChecked"in d)continue;A(e,s,null,u,_)}}for(s in d)u=d[s],s=="children"?g=u:s=="dangerouslySetInnerHTML"?f=u:s=="value"?v=u:s=="checked"?k=u:s==="key"||c&&typeof u!="function"||y[s]===u||A(e,s,u,y[s],_);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),$e(e,ee(g)?g:[g],t,n,r,p==="foreignObject"?"http://www.w3.org/1999/xhtml":_,o,l,o?o[0]:n.__k&&x(n,0),c,a),o!=null)for(s=o.length;s--;)o[s]!=null&&ke(o[s]);c||(s="value",v!==void 0&&(v!==e[s]||p==="progress"&&!v||p==="option"&&v!==y[s])&&A(e,s,v,y[s],_),s="checked",k!==void 0&&k!==e[s]&&A(e,s,k,y[s],_))}return e}function ne(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(_){h.__e(_,n)}}function Q(e,t,n){var r,_;if(h.unmount&&h.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||ne(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){h.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(_=0;_<r.length;_++)r[_]&&Q(r[_],t,n||typeof e.type!="function");n||e.__e==null||ke(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Re(e,t,n){return this.constructor(e,n)}function B(e,t,n){var r,_,o,l;h.__&&h.__(e,t),_=(r=typeof n=="function")?null:n&&n.__k||t.__k,o=[],l=[],te(t,e=(!r&&n||t).__k=P(q,null,[e]),_||S,S,t.namespaceURI,!r&&n?[n]:_?null:t.firstChild?L.call(t.childNodes):null,o,!r&&n?n:_?_.__e:t.firstChild,r,l),Ce(o,e,l)}function xe(e,t){B(e,t,xe)}function Pe(e,t,n){var r,_,o,l,c=$({},e.props);for(o in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?_=t[o]:c[o]=t[o]===void 0&&l!==void 0?l[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?L.call(arguments,2):n),N(e.type,c,r||e.key,_||e.ref,null)}L=be.slice,h={__e:function(e,t,n,r){for(var _,o,l;t=t.__;)if((_=t.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(e)),l=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(e,r||{}),l=_.__d),l)return _.__E=_}catch(c){e=c}throw e}},ye=0,M.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},n),this.props)),e&&$(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ie(this))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ie(this))},M.prototype.render=q,C=[],ge=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,V=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,Z=0,G=ce(!1),K=ce(!0);function _e(){return(_e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ie=["context","children"];function We(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,_){if(r==null)return{};var o,l,c={},a=Object.keys(r);for(l=0;l<a.length;l++)_.indexOf(o=a[l])>=0||(c[o]=r[o]);return c}(e,Ie);return Pe(t,n)}function je(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=P(We,_e({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var _=[],o={},l=0,c=n.attributes,a=n.childNodes;for(l=c.length;l--;)c[l].name!=="slot"&&(o[c[l].name]=c[l].value,o[De(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=P(se,{name:f},s):_[l]=s}var i=r?P(se,null,_):_;return P(r||n.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?xe:B)(this._vdom,this._root)}function De(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function qe(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[De(e)]=n,this._vdom=Pe(this._vdom,r),B(this._vdom,this._root)}}function Be(){B(this._vdom=null,this._root)}function se(e,t){var n=this;return P("slot",_e({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(_){_.stopPropagation(),_.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function He(e,t,n,r){function _(){var o=Reflect.construct(HTMLElement,[],_);return o._vdomComponent=e,o._root=o,o}return(_.prototype=Object.create(HTMLElement.prototype)).constructor=_,_.prototype.connectedCallback=je,_.prototype.attributeChangedCallback=qe,_.prototype.disconnectedCallback=Be,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),_.observedAttributes=n,n.forEach(function(o){Object.defineProperty(_.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var c=typeof l;l!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(o,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,_)}var I;I={__e:function(e,t,n,r){for(var _,o,l;t=t.__;)if((_=t.__c)&&!_.__)try{if((o=_.constructor)&&o.getDerivedStateFromError!=null&&(_.setState(o.getDerivedStateFromError(e)),l=_.__d),_.componentDidCatch!=null&&(_.componentDidCatch(e,r||{}),l=_.__d),l)return _.__E=_}catch(c){e=c}throw e}},typeof Promise=="function"&&Promise.prototype.then.bind(Promise.resolve());var ze=0;function Ne(e,t,n,r,_,o){t||(t={});var l,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ze,__i:-1,__u:0,__source:_,__self:o};return I.vnode&&I.vnode(s),s}var W,b,J,ae,X=0,Se=[],m=I,ue=m.__b,fe=m.__r,de=m.diffed,pe=m.__c,he=m.unmount,me=m.__;function Le(e,t){m.__h&&m.__h(b,e,X||t),X=0;var n=b.__H||(b.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function j(e,t){var n=Le(W++,3);!m.__s&&Fe(n.__H,t)&&(n.__=e,n.i=t,b.__H.__h.push(n))}function Te(e){return X=5,Je(function(){return{current:e}},[])}function Je(e,t){var n=Le(W++,7);return Fe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ve(){for(var e;e=Se.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(Y),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,ue&&ue(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),me&&me(e,t)},m.__r=function(e){fe&&fe(e),W=0;var t=(b=e.__c).__H;t&&(J===b?(t.__h=[],b.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(O),t.__h.forEach(Y),t.__h=[],W=0)),J=b},m.diffed=function(e){de&&de(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Se.push(t)!==1&&ae===m.requestAnimationFrame||((ae=m.requestAnimationFrame)||Ge)(Ve)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),J=b=null},m.__c=function(e,t){t.some(function(n){try{n.__h.forEach(O),n.__h=n.__h.filter(function(r){return!r.__||Y(r)})}catch(r){t.some(function(_){_.__h&&(_.__h=[])}),t=[],m.__e(r,n.__v)}}),pe&&pe(e,t)},m.unmount=function(e){he&&he(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{O(r)}catch(_){t=_}}),n.__H=void 0,t&&m.__e(t,n.__v))};var ve=typeof requestAnimationFrame=="function";function Ge(e){var t,n=function(){clearTimeout(r),ve&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ve&&(t=requestAnimationFrame(n))}function O(e){var t=b,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),b=t}function Y(e){var t=b;e.__c=e.__(),b=t}function Fe(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Ke(e){const t=Te(null);function n(){const _=e.host||"https://app.documenso.com",o=btoa(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css})),l=new URL(`/embed/direct/${e.token}`,_);return e.externalId&&l.searchParams.set("externalId",e.externalId),`${l}#${o}`}function r(_){var o,l,c,a,s,f;if(((o=t.current)==null?void 0:o.contentWindow)===_.source)switch(_.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,_.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,_.data.data);break;case"field-signed":(s=e.onFieldSigned)==null||s.call(e);break;case"field-unsigned":(f=e.onFieldUnsigned)==null||f.call(e);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Ne("iframe",{ref:t,className:e.className,src:n()})}function Qe(e){const t=Te(null);function n(){const _=e.host||"https://app.documenso.com",o=btoa(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css}));return`${new URL(`/embed/sign/${e.token}`,_)}#${o}`}function r(_){var o,l,c,a;if(((o=t.current)==null?void 0:o.contentWindow)===_.source)switch(_.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,_.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,_.data.data);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Ne("iframe",{ref:t,className:e.className,src:n()})}He(Ke,"documenso-embed-direct-template",["token","host","externalId","css","email","lockEmail","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);He(Qe,"documenso-embed-sign-document",["token","host","css","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);
|
|
1
|
+
"use strict";var T,p,ve,C,oe,ye,J,Y,V,G,S={},ge=[],Ue=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Z=Array.isArray;function $(e,t){for(var _ in t)e[_]=t[_];return e}function be(e){var t=e.parentNode;t&&t.removeChild(e)}function H(e,t,_){var r,n,o,l={};for(o in t)o=="key"?r=t[o]:o=="ref"?n=t[o]:l[o]=t[o];if(arguments.length>2&&(l.children=arguments.length>3?T.call(arguments,2):_),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)l[o]===void 0&&(l[o]=e.defaultProps[o]);return D(e,l,r,n,null)}function D(e,t,_,r,n){var o={type:e,props:t,key:_,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++ve,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(o),o}function W(e){return e.children}function M(e,t){this.props=e,this.context=t}function x(e,t){if(t==null)return e.__?x(e.__,e.__i+1):null;for(var _;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null)return _.__e;return typeof e.type=="function"?x(e):null}function ke(e){var t,_;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((_=e.__k[t])!=null&&_.__e!=null){e.__e=e.__c.base=_.__e;break}return ke(e)}}function re(e){(!e.__d&&(e.__d=!0)&&C.push(e)&&!R.__r++||oe!==p.debounceRendering)&&((oe=p.debounceRendering)||ye)(R)}function R(){var e,t,_,r,n,o,l,c;for(C.sort(J);e=C.shift();)e.__d&&(t=C.length,r=void 0,o=(n=(_=e).__v).__e,l=[],c=[],_.__P&&((r=$({},n)).__v=n.__v+1,p.vnode&&p.vnode(r),ee(_.__P,r,n,_.__n,_.__P.namespaceURI,32&n.__u?[o]:null,l,o??x(n),!!(32&n.__u),c),r.__v=n.__v,r.__.__k[r.__i]=r,Ee(l,r,c),r.__e!=o&&ke(r)),C.length>t&&C.sort(J));R.__r=0}function we(e,t,_,r,n,o,l,c,a,s,f){var i,g,u,v,k,y=r&&r.__k||ge,d=t.length;for(_.__d=a,Ae(_,t,y),a=_.__d,i=0;i<d;i++)(u=_.__k[i])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?S:y[u.__i]||S,u.__i=i,ee(e,u,g,n,o,l,c,a,s,f),v=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&te(g.ref,null,u),f.push(u.ref,u.__c||v,u)),k==null&&v!=null&&(k=v),65536&u.__u||g.__k===u.__k?a=$e(u,a,e):typeof u.type=="function"&&u.__d!==void 0?a=u.__d:v&&(a=v.nextSibling),u.__d=void 0,u.__u&=-196609);_.__d=a,_.__e=k}function Ae(e,t,_){var r,n,o,l,c,a=t.length,s=_.length,f=s,i=0;for(e.__k=[],r=0;r<a;r++)l=r+i,(n=e.__k[r]=(n=t[r])==null||typeof n=="boolean"||typeof n=="function"?null:typeof n=="string"||typeof n=="number"||typeof n=="bigint"||n.constructor==String?D(null,n,null,null,null):Z(n)?D(W,{children:n},null,null,null):n.constructor===void 0&&n.__b>0?D(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=Fe(n,_,l,f),n.__i=c,o=null,c!==-1&&(f--,(o=_[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&i--,typeof n.type!="function"&&(n.__u|=65536)):c!==l&&(c==l-1?i--:c==l+1?i++:c>l?f>a-l?i+=c-l:i--:c<l&&(c==l-i?i-=c-l:i++),c!==r+i&&(n.__u|=65536))):(o=_[l])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o,!1),_[l]=null,f--);if(f)for(r=0;r<s;r++)(o=_[r])!=null&&!(131072&o.__u)&&(o.__e==e.__d&&(e.__d=x(o)),K(o,o))}function $e(e,t,_){var r,n;if(typeof e.type=="function"){for(r=e.__k,n=0;r&&n<r.length;n++)r[n]&&(r[n].__=e,t=$e(r[n],t,_));return t}e.__e!=t&&(t&&e.type&&!_.contains(t)&&(t=x(e)),_.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Fe(e,t,_,r){var n=e.key,o=e.type,l=_-1,c=_+1,a=t[_];if(a===null||a&&n==a.key&&o===a.type&&!(131072&a.__u))return _;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;l>=0||c<t.length;){if(l>=0){if((a=t[l])&&!(131072&a.__u)&&n==a.key&&o===a.type)return l;l--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&n==a.key&&o===a.type)return c;c++}}return-1}function ie(e,t,_){t[0]==="-"?e.setProperty(t,_??""):e[t]=_==null?"":typeof _!="number"||Ue.test(t)?_:_+"px"}function F(e,t,_,r,n){var o;e:if(t==="style")if(typeof _=="string")e.style.cssText=_;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)_&&t in _||ie(e.style,t,"");if(_)for(t in _)r&&_[t]===r[t]||ie(e.style,t,_[t])}else if(t[0]==="o"&&t[1]==="n")o=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=_,_?r?_.u=r.u:(_.u=Y,e.addEventListener(t,o?G:V,o)):e.removeEventListener(t,o?G:V,o);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=_??"";break e}catch{}typeof _=="function"||(_==null||_===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&_==1?"":_))}}function le(e){return function(t){if(this.l){var _=this.l[t.type+e];if(t.t==null)t.t=Y++;else if(t.t<_.u)return;return _(p.event?p.event(t):t)}}}function ee(e,t,_,r,n,o,l,c,a,s){var f,i,g,u,v,k,y,d,h,P,E,L,N,ne,U,B,w=t.type;if(t.constructor!==void 0)return null;128&_.__u&&(a=!!(32&_.__u),o=[c=t.__e=_.__e]),(f=p.__b)&&f(t);e:if(typeof w=="function")try{if(d=t.props,h="prototype"in w&&w.prototype.render,P=(f=w.contextType)&&r[f.__c],E=f?P?P.props.value:f.__:r,_.__c?y=(i=t.__c=_.__c).__=i.__E:(h?t.__c=i=new w(d,E):(t.__c=i=new M(d,E),i.constructor=w,i.render=Oe),P&&P.sub(i),i.props=d,i.state||(i.state={}),i.context=E,i.__n=r,g=i.__d=!0,i.__h=[],i._sb=[]),h&&i.__s==null&&(i.__s=i.state),h&&w.getDerivedStateFromProps!=null&&(i.__s==i.state&&(i.__s=$({},i.__s)),$(i.__s,w.getDerivedStateFromProps(d,i.__s))),u=i.props,v=i.state,i.__v=t,g)h&&w.getDerivedStateFromProps==null&&i.componentWillMount!=null&&i.componentWillMount(),h&&i.componentDidMount!=null&&i.__h.push(i.componentDidMount);else{if(h&&w.getDerivedStateFromProps==null&&d!==u&&i.componentWillReceiveProps!=null&&i.componentWillReceiveProps(d,E),!i.__e&&(i.shouldComponentUpdate!=null&&i.shouldComponentUpdate(d,i.__s,E)===!1||t.__v===_.__v)){for(t.__v!==_.__v&&(i.props=d,i.state=i.__s,i.__d=!1),t.__e=_.__e,t.__k=_.__k,t.__k.forEach(function(A){A&&(A.__=t)}),L=0;L<i._sb.length;L++)i.__h.push(i._sb[L]);i._sb=[],i.__h.length&&l.push(i);break e}i.componentWillUpdate!=null&&i.componentWillUpdate(d,i.__s,E),h&&i.componentDidUpdate!=null&&i.__h.push(function(){i.componentDidUpdate(u,v,k)})}if(i.context=E,i.props=d,i.__P=e,i.__e=!1,N=p.__r,ne=0,h){for(i.state=i.__s,i.__d=!1,N&&N(t),f=i.render(i.props,i.state,i.context),U=0;U<i._sb.length;U++)i.__h.push(i._sb[U]);i._sb=[]}else do i.__d=!1,N&&N(t),f=i.render(i.props,i.state,i.context),i.state=i.__s;while(i.__d&&++ne<25);i.state=i.__s,i.getChildContext!=null&&(r=$($({},r),i.getChildContext())),h&&!g&&i.getSnapshotBeforeUpdate!=null&&(k=i.getSnapshotBeforeUpdate(u,v)),we(e,Z(B=f!=null&&f.type===W&&f.key==null?f.props.children:f)?B:[B],t,_,r,n,o,l,c,a,s),i.base=t.__e,t.__u&=-161,i.__h.length&&l.push(i),y&&(i.__E=i.__=null)}catch(A){if(t.__v=null,a||o!=null){for(t.__u|=a?160:32;c&&c.nodeType===8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else t.__e=_.__e,t.__k=_.__k;p.__e(A,t,_)}else o==null&&t.__v===_.__v?(t.__k=_.__k,t.__e=_.__e):t.__e=Me(_.__e,t,_,r,n,o,l,a,s);(f=p.diffed)&&f(t)}function Ee(e,t,_){t.__d=void 0;for(var r=0;r<_.length;r++)te(_[r],_[++r],_[++r]);p.__c&&p.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(o){o.call(n)})}catch(o){p.__e(o,n.__v)}})}function Me(e,t,_,r,n,o,l,c,a){var s,f,i,g,u,v,k,y=_.props,d=t.props,h=t.type;if(h==="svg"?n="http://www.w3.org/2000/svg":h==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),o!=null){for(s=0;s<o.length;s++)if((u=o[s])&&"setAttribute"in u==!!h&&(h?u.localName===h:u.nodeType===3)){e=u,o[s]=null;break}}if(e==null){if(h===null)return document.createTextNode(d);e=document.createElementNS(n,h,d.is&&d),o=null,c=!1}if(h===null)y===d||c&&e.data===d||(e.data=d);else{if(o=o&&T.call(e.childNodes),y=_.props||S,!c&&o!=null)for(y={},s=0;s<e.attributes.length;s++)y[(u=e.attributes[s]).name]=u.value;for(s in y)if(u=y[s],s!="children"){if(s=="dangerouslySetInnerHTML")i=u;else if(s!=="key"&&!(s in d)){if(s=="value"&&"defaultValue"in d||s=="checked"&&"defaultChecked"in d)continue;F(e,s,null,u,n)}}for(s in d)u=d[s],s=="children"?g=u:s=="dangerouslySetInnerHTML"?f=u:s=="value"?v=u:s=="checked"?k=u:s==="key"||c&&typeof u!="function"||y[s]===u||F(e,s,u,y[s],n);if(f)c||i&&(f.__html===i.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(i&&(e.innerHTML=""),we(e,Z(g)?g:[g],t,_,r,h==="foreignObject"?"http://www.w3.org/1999/xhtml":n,o,l,o?o[0]:_.__k&&x(_,0),c,a),o!=null)for(s=o.length;s--;)o[s]!=null&&be(o[s]);c||(s="value",v!==void 0&&(v!==e[s]||h==="progress"&&!v||h==="option"&&v!==y[s])&&F(e,s,v,y[s],n),s="checked",k!==void 0&&k!==e[s]&&F(e,s,k,y[s],n))}return e}function te(e,t,_){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(n){p.__e(n,_)}}function K(e,t,_){var r,n;if(p.unmount&&p.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||te(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){p.__e(o,t)}r.base=r.__P=null}if(r=e.__k)for(n=0;n<r.length;n++)r[n]&&K(r[n],t,_||typeof e.type!="function");_||e.__e==null||be(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Oe(e,t,_){return this.constructor(e,_)}function q(e,t,_){var r,n,o,l;p.__&&p.__(e,t),n=(r=typeof _=="function")?null:_&&_.__k||t.__k,o=[],l=[],ee(t,e=(!r&&_||t).__k=H(W,null,[e]),n||S,S,t.namespaceURI,!r&&_?[_]:n?null:t.firstChild?T.call(t.childNodes):null,o,!r&&_?_:n?n.__e:t.firstChild,r,l),Ee(o,e,l)}function Ce(e,t){q(e,t,Ce)}function xe(e,t,_){var r,n,o,l,c=$({},e.props);for(o in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)o=="key"?r=t[o]:o=="ref"?n=t[o]:c[o]=t[o]===void 0&&l!==void 0?l[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?T.call(arguments,2):_),D(e.type,c,r||e.key,n||e.ref,null)}T=ge.slice,p={__e:function(e,t,_,r){for(var n,o,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,r||{}),l=n.__d),l)return n.__E=n}catch(c){e=c}throw e}},ve=0,M.prototype.setState=function(e,t){var _;_=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$({},this.state),typeof e=="function"&&(e=e($({},_),this.props)),e&&$(_,e),e!=null&&this.__v&&(t&&this._sb.push(t),re(this))},M.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),re(this))},M.prototype.render=W,C=[],ye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,J=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,Y=0,V=le(!1),G=le(!0);function _e(){return(_e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var _=arguments[t];for(var r in _)Object.prototype.hasOwnProperty.call(_,r)&&(e[r]=_[r])}return e}).apply(this,arguments)}var Re=["context","children"];function Ie(e){this.getChildContext=function(){return e.context};var t=e.children,_=function(r,n){if(r==null)return{};var o,l,c={},a=Object.keys(r);for(l=0;l<a.length;l++)n.indexOf(o=a[l])>=0||(c[o]=r[o]);return c}(e,Re);return xe(t,_)}function je(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=H(Ie,_e({},this._props,{context:e.detail.context}),function t(_,r){if(_.nodeType===3)return _.data;if(_.nodeType!==1)return null;var n=[],o={},l=0,c=_.attributes,a=_.childNodes;for(l=c.length;l--;)c[l].name!=="slot"&&(o[c[l].name]=c[l].value,o[He(c[l].name)]=c[l].value);for(l=a.length;l--;){var s=t(a[l],null),f=a[l].slot;f?o[f]=H(ce,{name:f},s):n[l]=s}var i=r?H(ce,null,n):n;return H(r||_.nodeName.toLowerCase(),o,i)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Ce:q)(this._vdom,this._root)}function He(e){return e.replace(/-(\w)/g,function(t,_){return _?_.toUpperCase():""})}function We(e,t,_){if(this._vdom){var r={};r[e]=_=_??void 0,r[He(e)]=_,this._vdom=xe(this._vdom,r),q(this._vdom,this._root)}}function qe(){q(this._vdom=null,this._root)}function ce(e,t){var _=this;return H("slot",_e({},e,{ref:function(r){r?(_.ref=r,_._listener||(_._listener=function(n){n.stopPropagation(),n.detail.context=t},r.addEventListener("_preact",_._listener))):_.ref.removeEventListener("_preact",_._listener)}}))}function Pe(e,t,_,r){function n(){var o=Reflect.construct(HTMLElement,[],n);return o._vdomComponent=e,o._root=o,o}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=je,n.prototype.attributeChangedCallback=We,n.prototype.disconnectedCallback=qe,_=_||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=_,_.forEach(function(o){Object.defineProperty(n.prototype,o,{get:function(){return this._vdom.props[o]},set:function(l){this._vdom?this.attributeChangedCallback(o,null,l):(this._props||(this._props={}),this._props[o]=l,this.connectedCallback());var c=typeof l;l!=null&&c!=="string"&&c!=="boolean"&&c!=="number"||this.setAttribute(o,l)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var I,b,z,se,Q=0,Ne=[],m=p,ae=m.__b,ue=m.__r,fe=m.diffed,de=m.__c,pe=m.unmount,he=m.__;function De(e,t){m.__h&&m.__h(b,e,Q||t),Q=0;var _=b.__H||(b.__H={__:[],__h:[]});return e>=_.__.length&&_.__.push({}),_.__[e]}function j(e,t){var _=De(I++,3);!m.__s&&Te(_.__H,t)&&(_.__=e,_.i=t,b.__H.__h.push(_))}function Se(e){return Q=5,Be(function(){return{current:e}},[])}function Be(e,t){var _=De(I++,7);return Te(_.__H,t)&&(_.__=e(),_.__H=t,_.__h=e),_.__}function ze(){for(var e;e=Ne.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(X),e.__H.__h=[]}catch(t){e.__H.__h=[],m.__e(t,e.__v)}}m.__b=function(e){b=null,ae&&ae(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),he&&he(e,t)},m.__r=function(e){ue&&ue(e),I=0;var t=(b=e.__c).__H;t&&(z===b?(t.__h=[],b.__h=[],t.__.forEach(function(_){_.__N&&(_.__=_.__N),_.i=_.__N=void 0})):(t.__h.forEach(O),t.__h.forEach(X),t.__h=[],I=0)),z=b},m.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ne.push(t)!==1&&se===m.requestAnimationFrame||((se=m.requestAnimationFrame)||Je)(ze)),t.__H.__.forEach(function(_){_.i&&(_.__H=_.i),_.i=void 0})),z=b=null},m.__c=function(e,t){t.some(function(_){try{_.__h.forEach(O),_.__h=_.__h.filter(function(r){return!r.__||X(r)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],m.__e(r,_.__v)}}),de&&de(e,t)},m.unmount=function(e){pe&&pe(e);var t,_=e.__c;_&&_.__H&&(_.__H.__.forEach(function(r){try{O(r)}catch(n){t=n}}),_.__H=void 0,t&&m.__e(t,_.__v))};var me=typeof requestAnimationFrame=="function";function Je(e){var t,_=function(){clearTimeout(r),me&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(_,100);me&&(t=requestAnimationFrame(_))}function O(e){var t=b,_=e.__c;typeof _=="function"&&(e.__c=void 0,_()),b=t}function X(e){var t=b;e.__c=e.__(),b=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(_,r){return _!==e[r]})}var Ve=0;function Le(e,t,_,r,n,o){t||(t={});var l,c,a=t;if("ref"in a)for(c in a={},t)c=="ref"?l=t[c]:a[c]=t[c];var s={type:e,props:a,key:_,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ve,__i:-1,__u:0,__source:n,__self:o};return p.vnode&&p.vnode(s),s}function Ge(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(JSON.stringify({name:e.name,lockName:e.lockName,email:e.email,lockEmail:e.lockEmail,css:e.css})),l=new URL(`/embed/direct/${e.token}`,n);return e.externalId&&l.searchParams.set("externalId",e.externalId),`${l}#${o}`}function r(n){var o,l,c,a,s,f;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break;case"field-signed":(s=e.onFieldSigned)==null||s.call(e);break;case"field-unsigned":(f=e.onFieldUnsigned)==null||f.call(e);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}function Ke(e){const t=Se(null);function _(){const n=e.host||"https://app.documenso.com",o=btoa(JSON.stringify({name:e.name,lockName:e.lockName,css:e.css}));return`${new URL(`/embed/sign/${e.token}`,n)}#${o}`}function r(n){var o,l,c,a;if(((o=t.current)==null?void 0:o.contentWindow)===n.source)switch(n.data.action){case"document-ready":(l=e.onDocumentReady)==null||l.call(e);break;case"document-completed":(c=e.onDocumentCompleted)==null||c.call(e,n.data.data);break;case"document-error":(a=e.onDocumentError)==null||a.call(e,n.data.data);break}}return j(()=>{window.addEventListener("message",r)},[]),j(()=>()=>{window.removeEventListener("message",r)},[]),Le("iframe",{ref:t,className:e.className,src:_()})}Pe(Ge,"documenso-embed-direct-template",["token","host","externalId","css","email","lockEmail","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);Pe(Ke,"documenso-embed-sign-document",["token","host","css","name","lockName","onDocumentReady","onDocumentCompleted","onDocumentError"]);
|
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
1
|
+
var T, p, ve, C, oe, ye, J, Y, V, G, S = {}, ge = [], Ue = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Z = Array.isArray;
|
|
2
2
|
function $(e, t) {
|
|
3
|
-
for (var
|
|
3
|
+
for (var _ in t) e[_] = t[_];
|
|
4
4
|
return e;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function be(e) {
|
|
7
7
|
var t = e.parentNode;
|
|
8
8
|
t && t.removeChild(e);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
var r,
|
|
12
|
-
for (o in t) o == "key" ? r = t[o] : o == "ref" ?
|
|
13
|
-
if (arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
14
|
-
return
|
|
10
|
+
function H(e, t, _) {
|
|
11
|
+
var r, n, o, l = {};
|
|
12
|
+
for (o in t) o == "key" ? r = t[o] : o == "ref" ? n = t[o] : l[o] = t[o];
|
|
13
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? T.call(arguments, 2) : _), typeof e == "function" && e.defaultProps != null) for (o in e.defaultProps) l[o] === void 0 && (l[o] = e.defaultProps[o]);
|
|
14
|
+
return D(e, l, r, n, null);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
var o = { type: e, props: t, key:
|
|
18
|
-
return
|
|
16
|
+
function D(e, t, _, r, n) {
|
|
17
|
+
var o = { type: e, props: t, key: _, ref: r, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: n ?? ++ve, __i: -1, __u: 0 };
|
|
18
|
+
return n == null && p.vnode != null && p.vnode(o), o;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function W(e) {
|
|
21
21
|
return e.children;
|
|
22
22
|
}
|
|
23
23
|
function M(e, t) {
|
|
@@ -25,405 +25,396 @@ function M(e, t) {
|
|
|
25
25
|
}
|
|
26
26
|
function x(e, t) {
|
|
27
27
|
if (t == null) return e.__ ? x(e.__, e.__i + 1) : null;
|
|
28
|
-
for (var
|
|
28
|
+
for (var _; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) return _.__e;
|
|
29
29
|
return typeof e.type == "function" ? x(e) : null;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
var t,
|
|
31
|
+
function ke(e) {
|
|
32
|
+
var t, _;
|
|
33
33
|
if ((e = e.__) != null && e.__c != null) {
|
|
34
|
-
for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((
|
|
35
|
-
e.__e = e.__c.base =
|
|
34
|
+
for (e.__e = e.__c.base = null, t = 0; t < e.__k.length; t++) if ((_ = e.__k[t]) != null && _.__e != null) {
|
|
35
|
+
e.__e = e.__c.base = _.__e;
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return ke(e);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
(!e.__d && (e.__d = !0) && C.push(e) && !R.__r++ ||
|
|
41
|
+
function re(e) {
|
|
42
|
+
(!e.__d && (e.__d = !0) && C.push(e) && !R.__r++ || oe !== p.debounceRendering) && ((oe = p.debounceRendering) || ye)(R);
|
|
43
43
|
}
|
|
44
44
|
function R() {
|
|
45
|
-
var e, t,
|
|
46
|
-
for (C.sort(
|
|
45
|
+
var e, t, _, r, n, o, l, c;
|
|
46
|
+
for (C.sort(J); e = C.shift(); ) e.__d && (t = C.length, r = void 0, o = (n = (_ = e).__v).__e, l = [], c = [], _.__P && ((r = $({}, n)).__v = n.__v + 1, p.vnode && p.vnode(r), ee(_.__P, r, n, _.__n, _.__P.namespaceURI, 32 & n.__u ? [o] : null, l, o ?? x(n), !!(32 & n.__u), c), r.__v = n.__v, r.__.__k[r.__i] = r, Ee(l, r, c), r.__e != o && ke(r)), C.length > t && C.sort(J));
|
|
47
47
|
R.__r = 0;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
var i, g, u, v, k, y = r && r.__k ||
|
|
51
|
-
for (
|
|
52
|
-
|
|
49
|
+
function we(e, t, _, r, n, o, l, c, a, s, f) {
|
|
50
|
+
var i, g, u, v, k, y = r && r.__k || ge, d = t.length;
|
|
51
|
+
for (_.__d = a, Ae(_, t, y), a = _.__d, i = 0; i < d; i++) (u = _.__k[i]) != null && typeof u != "boolean" && typeof u != "function" && (g = u.__i === -1 ? S : y[u.__i] || S, u.__i = i, ee(e, u, g, n, o, l, c, a, s, f), v = u.__e, u.ref && g.ref != u.ref && (g.ref && te(g.ref, null, u), f.push(u.ref, u.__c || v, u)), k == null && v != null && (k = v), 65536 & u.__u || g.__k === u.__k ? a = $e(u, a, e) : typeof u.type == "function" && u.__d !== void 0 ? a = u.__d : v && (a = v.nextSibling), u.__d = void 0, u.__u &= -196609);
|
|
52
|
+
_.__d = a, _.__e = k;
|
|
53
53
|
}
|
|
54
|
-
function Ae(e, t,
|
|
55
|
-
var r,
|
|
56
|
-
for (e.__k = [], r = 0; r < a; r++) l = r + i, (
|
|
57
|
-
if (f) for (r = 0; r < s; r++) (o =
|
|
54
|
+
function Ae(e, t, _) {
|
|
55
|
+
var r, n, o, l, c, a = t.length, s = _.length, f = s, i = 0;
|
|
56
|
+
for (e.__k = [], r = 0; r < a; r++) l = r + i, (n = e.__k[r] = (n = t[r]) == null || typeof n == "boolean" || typeof n == "function" ? null : typeof n == "string" || typeof n == "number" || typeof n == "bigint" || n.constructor == String ? D(null, n, null, null, null) : Z(n) ? D(W, { children: n }, null, null, null) : n.constructor === void 0 && n.__b > 0 ? D(n.type, n.props, n.key, n.ref ? n.ref : null, n.__v) : n) != null ? (n.__ = e, n.__b = e.__b + 1, c = Fe(n, _, l, f), n.__i = c, o = null, c !== -1 && (f--, (o = _[c]) && (o.__u |= 131072)), o == null || o.__v === null ? (c == -1 && i--, typeof n.type != "function" && (n.__u |= 65536)) : c !== l && (c == l - 1 ? i-- : c == l + 1 ? i++ : c > l ? f > a - l ? i += c - l : i-- : c < l && (c == l - i ? i -= c - l : i++), c !== r + i && (n.__u |= 65536))) : (o = _[l]) && o.key == null && o.__e && !(131072 & o.__u) && (o.__e == e.__d && (e.__d = x(o)), K(o, o, !1), _[l] = null, f--);
|
|
57
|
+
if (f) for (r = 0; r < s; r++) (o = _[r]) != null && !(131072 & o.__u) && (o.__e == e.__d && (e.__d = x(o)), K(o, o));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
var r,
|
|
59
|
+
function $e(e, t, _) {
|
|
60
|
+
var r, n;
|
|
61
61
|
if (typeof e.type == "function") {
|
|
62
|
-
for (r = e.__k,
|
|
62
|
+
for (r = e.__k, n = 0; r && n < r.length; n++) r[n] && (r[n].__ = e, t = $e(r[n], t, _));
|
|
63
63
|
return t;
|
|
64
64
|
}
|
|
65
|
-
e.__e != t && (t && e.type && !
|
|
65
|
+
e.__e != t && (t && e.type && !_.contains(t) && (t = x(e)), _.insertBefore(e.__e, t || null), t = e.__e);
|
|
66
66
|
do
|
|
67
67
|
t = t && t.nextSibling;
|
|
68
68
|
while (t != null && t.nodeType === 8);
|
|
69
69
|
return t;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
var
|
|
73
|
-
if (a === null || a &&
|
|
71
|
+
function Fe(e, t, _, r) {
|
|
72
|
+
var n = e.key, o = e.type, l = _ - 1, c = _ + 1, a = t[_];
|
|
73
|
+
if (a === null || a && n == a.key && o === a.type && !(131072 & a.__u)) return _;
|
|
74
74
|
if (r > (a != null && !(131072 & a.__u) ? 1 : 0)) for (; l >= 0 || c < t.length; ) {
|
|
75
75
|
if (l >= 0) {
|
|
76
|
-
if ((a = t[l]) && !(131072 & a.__u) &&
|
|
76
|
+
if ((a = t[l]) && !(131072 & a.__u) && n == a.key && o === a.type) return l;
|
|
77
77
|
l--;
|
|
78
78
|
}
|
|
79
79
|
if (c < t.length) {
|
|
80
|
-
if ((a = t[c]) && !(131072 & a.__u) &&
|
|
80
|
+
if ((a = t[c]) && !(131072 & a.__u) && n == a.key && o === a.type) return c;
|
|
81
81
|
c++;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
return -1;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
t[0] === "-" ? e.setProperty(t,
|
|
86
|
+
function ie(e, t, _) {
|
|
87
|
+
t[0] === "-" ? e.setProperty(t, _ ?? "") : e[t] = _ == null ? "" : typeof _ != "number" || Ue.test(t) ? _ : _ + "px";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function F(e, t, _, r, n) {
|
|
90
90
|
var o;
|
|
91
|
-
e: if (t === "style") if (typeof
|
|
91
|
+
e: if (t === "style") if (typeof _ == "string") e.style.cssText = _;
|
|
92
92
|
else {
|
|
93
|
-
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r)
|
|
94
|
-
if (
|
|
93
|
+
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) _ && t in _ || ie(e.style, t, "");
|
|
94
|
+
if (_) for (t in _) r && _[t] === r[t] || ie(e.style, t, _[t]);
|
|
95
95
|
}
|
|
96
|
-
else if (t[0] === "o" && t[1] === "n") o = t !== (t = t.replace(/(PointerCapture)$|Capture$/i, "$1")), t = t.toLowerCase() in e || t === "onFocusOut" || t === "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] =
|
|
96
|
+
else if (t[0] === "o" && t[1] === "n") o = t !== (t = t.replace(/(PointerCapture)$|Capture$/i, "$1")), t = t.toLowerCase() in e || t === "onFocusOut" || t === "onFocusIn" ? t.toLowerCase().slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] = _, _ ? r ? _.u = r.u : (_.u = Y, e.addEventListener(t, o ? G : V, o)) : e.removeEventListener(t, o ? G : V, o);
|
|
97
97
|
else {
|
|
98
|
-
if (
|
|
98
|
+
if (n == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
99
99
|
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
100
|
-
e[t] =
|
|
100
|
+
e[t] = _ ?? "";
|
|
101
101
|
break e;
|
|
102
102
|
} catch {
|
|
103
103
|
}
|
|
104
|
-
typeof
|
|
104
|
+
typeof _ == "function" || (_ == null || _ === !1 && t[4] !== "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && _ == 1 ? "" : _));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function le(e) {
|
|
108
108
|
return function(t) {
|
|
109
109
|
if (this.l) {
|
|
110
|
-
var
|
|
111
|
-
if (t.t == null) t.t =
|
|
112
|
-
else if (t.t <
|
|
113
|
-
return
|
|
110
|
+
var _ = this.l[t.type + e];
|
|
111
|
+
if (t.t == null) t.t = Y++;
|
|
112
|
+
else if (t.t < _.u) return;
|
|
113
|
+
return _(p.event ? p.event(t) : t);
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
var f, i, g, u, v, k, y, d,
|
|
117
|
+
function ee(e, t, _, r, n, o, l, c, a, s) {
|
|
118
|
+
var f, i, g, u, v, k, y, d, h, P, E, L, N, ne, U, B, w = t.type;
|
|
119
119
|
if (t.constructor !== void 0) return null;
|
|
120
|
-
128 &
|
|
120
|
+
128 & _.__u && (a = !!(32 & _.__u), o = [c = t.__e = _.__e]), (f = p.__b) && f(t);
|
|
121
121
|
e: if (typeof w == "function") try {
|
|
122
|
-
if (d = t.props,
|
|
122
|
+
if (d = t.props, h = "prototype" in w && w.prototype.render, P = (f = w.contextType) && r[f.__c], E = f ? P ? P.props.value : f.__ : r, _.__c ? y = (i = t.__c = _.__c).__ = i.__E : (h ? t.__c = i = new w(d, E) : (t.__c = i = new M(d, E), i.constructor = w, i.render = Oe), P && P.sub(i), i.props = d, i.state || (i.state = {}), i.context = E, i.__n = r, g = i.__d = !0, i.__h = [], i._sb = []), h && i.__s == null && (i.__s = i.state), h && w.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = $({}, i.__s)), $(i.__s, w.getDerivedStateFromProps(d, i.__s))), u = i.props, v = i.state, i.__v = t, g) h && w.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), h && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
123
123
|
else {
|
|
124
|
-
if (
|
|
125
|
-
for (t.__v !==
|
|
126
|
-
|
|
127
|
-
}),
|
|
124
|
+
if (h && w.getDerivedStateFromProps == null && d !== u && i.componentWillReceiveProps != null && i.componentWillReceiveProps(d, E), !i.__e && (i.shouldComponentUpdate != null && i.shouldComponentUpdate(d, i.__s, E) === !1 || t.__v === _.__v)) {
|
|
125
|
+
for (t.__v !== _.__v && (i.props = d, i.state = i.__s, i.__d = !1), t.__e = _.__e, t.__k = _.__k, t.__k.forEach(function(A) {
|
|
126
|
+
A && (A.__ = t);
|
|
127
|
+
}), L = 0; L < i._sb.length; L++) i.__h.push(i._sb[L]);
|
|
128
128
|
i._sb = [], i.__h.length && l.push(i);
|
|
129
129
|
break e;
|
|
130
130
|
}
|
|
131
|
-
i.componentWillUpdate != null && i.componentWillUpdate(d, i.__s, E),
|
|
131
|
+
i.componentWillUpdate != null && i.componentWillUpdate(d, i.__s, E), h && i.componentDidUpdate != null && i.__h.push(function() {
|
|
132
132
|
i.componentDidUpdate(u, v, k);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
if (i.context = E, i.props = d, i.__P = e, i.__e = !1,
|
|
136
|
-
for (i.state = i.__s, i.__d = !1,
|
|
135
|
+
if (i.context = E, i.props = d, i.__P = e, i.__e = !1, N = p.__r, ne = 0, h) {
|
|
136
|
+
for (i.state = i.__s, i.__d = !1, N && N(t), f = i.render(i.props, i.state, i.context), U = 0; U < i._sb.length; U++) i.__h.push(i._sb[U]);
|
|
137
137
|
i._sb = [];
|
|
138
138
|
} else do
|
|
139
|
-
i.__d = !1,
|
|
140
|
-
while (i.__d && ++
|
|
141
|
-
i.state = i.__s, i.getChildContext != null && (r = $($({}, r), i.getChildContext())),
|
|
142
|
-
} catch (
|
|
139
|
+
i.__d = !1, N && N(t), f = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
140
|
+
while (i.__d && ++ne < 25);
|
|
141
|
+
i.state = i.__s, i.getChildContext != null && (r = $($({}, r), i.getChildContext())), h && !g && i.getSnapshotBeforeUpdate != null && (k = i.getSnapshotBeforeUpdate(u, v)), we(e, Z(B = f != null && f.type === W && f.key == null ? f.props.children : f) ? B : [B], t, _, r, n, o, l, c, a, s), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), y && (i.__E = i.__ = null);
|
|
142
|
+
} catch (A) {
|
|
143
143
|
if (t.__v = null, a || o != null) {
|
|
144
144
|
for (t.__u |= a ? 160 : 32; c && c.nodeType === 8 && c.nextSibling; ) c = c.nextSibling;
|
|
145
145
|
o[o.indexOf(c)] = null, t.__e = c;
|
|
146
|
-
} else t.__e =
|
|
147
|
-
|
|
146
|
+
} else t.__e = _.__e, t.__k = _.__k;
|
|
147
|
+
p.__e(A, t, _);
|
|
148
148
|
}
|
|
149
|
-
else o == null && t.__v ===
|
|
150
|
-
(f =
|
|
149
|
+
else o == null && t.__v === _.__v ? (t.__k = _.__k, t.__e = _.__e) : t.__e = Me(_.__e, t, _, r, n, o, l, a, s);
|
|
150
|
+
(f = p.diffed) && f(t);
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function Ee(e, t, _) {
|
|
153
153
|
t.__d = void 0;
|
|
154
|
-
for (var r = 0; r <
|
|
155
|
-
|
|
154
|
+
for (var r = 0; r < _.length; r++) te(_[r], _[++r], _[++r]);
|
|
155
|
+
p.__c && p.__c(t, e), e.some(function(n) {
|
|
156
156
|
try {
|
|
157
|
-
e =
|
|
158
|
-
o.call(
|
|
157
|
+
e = n.__h, n.__h = [], e.some(function(o) {
|
|
158
|
+
o.call(n);
|
|
159
159
|
});
|
|
160
160
|
} catch (o) {
|
|
161
|
-
|
|
161
|
+
p.__e(o, n.__v);
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
var s, f, i, g, u, v, k, y =
|
|
167
|
-
if (
|
|
168
|
-
for (s = 0; s < o.length; s++) if ((u = o[s]) && "setAttribute" in u == !!
|
|
165
|
+
function Me(e, t, _, r, n, o, l, c, a) {
|
|
166
|
+
var s, f, i, g, u, v, k, y = _.props, d = t.props, h = t.type;
|
|
167
|
+
if (h === "svg" ? n = "http://www.w3.org/2000/svg" : h === "math" ? n = "http://www.w3.org/1998/Math/MathML" : n || (n = "http://www.w3.org/1999/xhtml"), o != null) {
|
|
168
|
+
for (s = 0; s < o.length; s++) if ((u = o[s]) && "setAttribute" in u == !!h && (h ? u.localName === h : u.nodeType === 3)) {
|
|
169
169
|
e = u, o[s] = null;
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
if (e == null) {
|
|
174
|
-
if (
|
|
175
|
-
e = document.createElementNS(
|
|
174
|
+
if (h === null) return document.createTextNode(d);
|
|
175
|
+
e = document.createElementNS(n, h, d.is && d), o = null, c = !1;
|
|
176
176
|
}
|
|
177
|
-
if (
|
|
177
|
+
if (h === null) y === d || c && e.data === d || (e.data = d);
|
|
178
178
|
else {
|
|
179
|
-
if (o = o &&
|
|
179
|
+
if (o = o && T.call(e.childNodes), y = _.props || S, !c && o != null) for (y = {}, s = 0; s < e.attributes.length; s++) y[(u = e.attributes[s]).name] = u.value;
|
|
180
180
|
for (s in y) if (u = y[s], s != "children") {
|
|
181
181
|
if (s == "dangerouslySetInnerHTML") i = u;
|
|
182
182
|
else if (s !== "key" && !(s in d)) {
|
|
183
183
|
if (s == "value" && "defaultValue" in d || s == "checked" && "defaultChecked" in d) continue;
|
|
184
|
-
|
|
184
|
+
F(e, s, null, u, n);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
for (s in d) u = d[s], s == "children" ? g = u : s == "dangerouslySetInnerHTML" ? f = u : s == "value" ? v = u : s == "checked" ? k = u : s === "key" || c && typeof u != "function" || y[s] === u ||
|
|
187
|
+
for (s in d) u = d[s], s == "children" ? g = u : s == "dangerouslySetInnerHTML" ? f = u : s == "value" ? v = u : s == "checked" ? k = u : s === "key" || c && typeof u != "function" || y[s] === u || F(e, s, u, y[s], n);
|
|
188
188
|
if (f) c || i && (f.__html === i.__html || f.__html === e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
|
|
189
|
-
else if (i && (e.innerHTML = ""),
|
|
190
|
-
c || (s = "value", v !== void 0 && (v !== e[s] ||
|
|
189
|
+
else if (i && (e.innerHTML = ""), we(e, Z(g) ? g : [g], t, _, r, h === "foreignObject" ? "http://www.w3.org/1999/xhtml" : n, o, l, o ? o[0] : _.__k && x(_, 0), c, a), o != null) for (s = o.length; s--; ) o[s] != null && be(o[s]);
|
|
190
|
+
c || (s = "value", v !== void 0 && (v !== e[s] || h === "progress" && !v || h === "option" && v !== y[s]) && F(e, s, v, y[s], n), s = "checked", k !== void 0 && k !== e[s] && F(e, s, k, y[s], n));
|
|
191
191
|
}
|
|
192
192
|
return e;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function te(e, t, _) {
|
|
195
195
|
try {
|
|
196
196
|
if (typeof e == "function") {
|
|
197
197
|
var r = typeof e.__u == "function";
|
|
198
198
|
r && e.__u(), r && t == null || (e.__u = e(t));
|
|
199
199
|
} else e.current = t;
|
|
200
|
-
} catch (
|
|
201
|
-
|
|
200
|
+
} catch (n) {
|
|
201
|
+
p.__e(n, _);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
var r,
|
|
206
|
-
if (
|
|
204
|
+
function K(e, t, _) {
|
|
205
|
+
var r, n;
|
|
206
|
+
if (p.unmount && p.unmount(e), (r = e.ref) && (r.current && r.current !== e.__e || te(r, null, t)), (r = e.__c) != null) {
|
|
207
207
|
if (r.componentWillUnmount) try {
|
|
208
208
|
r.componentWillUnmount();
|
|
209
209
|
} catch (o) {
|
|
210
|
-
|
|
210
|
+
p.__e(o, t);
|
|
211
211
|
}
|
|
212
212
|
r.base = r.__P = null;
|
|
213
213
|
}
|
|
214
|
-
if (r = e.__k) for (
|
|
215
|
-
|
|
214
|
+
if (r = e.__k) for (n = 0; n < r.length; n++) r[n] && K(r[n], t, _ || typeof e.type != "function");
|
|
215
|
+
_ || e.__e == null || be(e.__e), e.__c = e.__ = e.__e = e.__d = void 0;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
return this.constructor(e,
|
|
217
|
+
function Oe(e, t, _) {
|
|
218
|
+
return this.constructor(e, _);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
var r,
|
|
222
|
-
|
|
220
|
+
function q(e, t, _) {
|
|
221
|
+
var r, n, o, l;
|
|
222
|
+
p.__ && p.__(e, t), n = (r = typeof _ == "function") ? null : _ && _.__k || t.__k, o = [], l = [], ee(t, e = (!r && _ || t).__k = H(W, null, [e]), n || S, S, t.namespaceURI, !r && _ ? [_] : n ? null : t.firstChild ? T.call(t.childNodes) : null, o, !r && _ ? _ : n ? n.__e : t.firstChild, r, l), Ee(o, e, l);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
224
|
+
function Ce(e, t) {
|
|
225
|
+
q(e, t, Ce);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
228
|
-
var r,
|
|
229
|
-
for (o in e.type && e.type.defaultProps && (l = e.type.defaultProps), t) o == "key" ? r = t[o] : o == "ref" ?
|
|
230
|
-
return arguments.length > 2 && (c.children = arguments.length > 3 ?
|
|
227
|
+
function xe(e, t, _) {
|
|
228
|
+
var r, n, o, l, c = $({}, e.props);
|
|
229
|
+
for (o in e.type && e.type.defaultProps && (l = e.type.defaultProps), t) o == "key" ? r = t[o] : o == "ref" ? n = t[o] : c[o] = t[o] === void 0 && l !== void 0 ? l[o] : t[o];
|
|
230
|
+
return arguments.length > 2 && (c.children = arguments.length > 3 ? T.call(arguments, 2) : _), D(e.type, c, r || e.key, n || e.ref, null);
|
|
231
231
|
}
|
|
232
|
-
|
|
233
|
-
for (var
|
|
234
|
-
if ((o =
|
|
232
|
+
T = ge.slice, p = { __e: function(e, t, _, r) {
|
|
233
|
+
for (var n, o, l; t = t.__; ) if ((n = t.__c) && !n.__) try {
|
|
234
|
+
if ((o = n.constructor) && o.getDerivedStateFromError != null && (n.setState(o.getDerivedStateFromError(e)), l = n.__d), n.componentDidCatch != null && (n.componentDidCatch(e, r || {}), l = n.__d), l) return n.__E = n;
|
|
235
235
|
} catch (c) {
|
|
236
236
|
e = c;
|
|
237
237
|
}
|
|
238
238
|
throw e;
|
|
239
|
-
} },
|
|
240
|
-
var
|
|
241
|
-
|
|
239
|
+
} }, ve = 0, M.prototype.setState = function(e, t) {
|
|
240
|
+
var _;
|
|
241
|
+
_ = this.__s != null && this.__s !== this.state ? this.__s : this.__s = $({}, this.state), typeof e == "function" && (e = e($({}, _), this.props)), e && $(_, e), e != null && this.__v && (t && this._sb.push(t), re(this));
|
|
242
242
|
}, M.prototype.forceUpdate = function(e) {
|
|
243
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
244
|
-
}, M.prototype.render =
|
|
243
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), re(this));
|
|
244
|
+
}, M.prototype.render = W, C = [], ye = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, J = function(e, t) {
|
|
245
245
|
return e.__v.__b - t.__v.__b;
|
|
246
|
-
}, R.__r = 0,
|
|
246
|
+
}, R.__r = 0, Y = 0, V = le(!1), G = le(!0);
|
|
247
247
|
function _e() {
|
|
248
248
|
return (_e = Object.assign ? Object.assign.bind() : function(e) {
|
|
249
249
|
for (var t = 1; t < arguments.length; t++) {
|
|
250
|
-
var
|
|
251
|
-
for (var r in
|
|
250
|
+
var _ = arguments[t];
|
|
251
|
+
for (var r in _) Object.prototype.hasOwnProperty.call(_, r) && (e[r] = _[r]);
|
|
252
252
|
}
|
|
253
253
|
return e;
|
|
254
254
|
}).apply(this, arguments);
|
|
255
255
|
}
|
|
256
|
-
var
|
|
257
|
-
function
|
|
256
|
+
var Re = ["context", "children"];
|
|
257
|
+
function Ie(e) {
|
|
258
258
|
this.getChildContext = function() {
|
|
259
259
|
return e.context;
|
|
260
260
|
};
|
|
261
|
-
var t = e.children,
|
|
261
|
+
var t = e.children, _ = function(r, n) {
|
|
262
262
|
if (r == null) return {};
|
|
263
263
|
var o, l, c = {}, a = Object.keys(r);
|
|
264
|
-
for (l = 0; l < a.length; l++)
|
|
264
|
+
for (l = 0; l < a.length; l++) n.indexOf(o = a[l]) >= 0 || (c[o] = r[o]);
|
|
265
265
|
return c;
|
|
266
|
-
}(e,
|
|
267
|
-
return
|
|
266
|
+
}(e, Re);
|
|
267
|
+
return xe(t, _);
|
|
268
268
|
}
|
|
269
269
|
function je() {
|
|
270
270
|
var e = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
271
|
-
this.dispatchEvent(e), this._vdom =
|
|
272
|
-
if (
|
|
273
|
-
if (
|
|
274
|
-
var
|
|
275
|
-
for (l = c.length; l--; ) c[l].name !== "slot" && (o[c[l].name] = c[l].value, o[
|
|
271
|
+
this.dispatchEvent(e), this._vdom = H(Ie, _e({}, this._props, { context: e.detail.context }), function t(_, r) {
|
|
272
|
+
if (_.nodeType === 3) return _.data;
|
|
273
|
+
if (_.nodeType !== 1) return null;
|
|
274
|
+
var n = [], o = {}, l = 0, c = _.attributes, a = _.childNodes;
|
|
275
|
+
for (l = c.length; l--; ) c[l].name !== "slot" && (o[c[l].name] = c[l].value, o[He(c[l].name)] = c[l].value);
|
|
276
276
|
for (l = a.length; l--; ) {
|
|
277
277
|
var s = t(a[l], null), f = a[l].slot;
|
|
278
|
-
f ? o[f] =
|
|
278
|
+
f ? o[f] = H(ce, { name: f }, s) : n[l] = s;
|
|
279
279
|
}
|
|
280
|
-
var i = r ?
|
|
281
|
-
return
|
|
282
|
-
}(this, this._vdomComponent)), (this.hasAttribute("hydrate") ?
|
|
280
|
+
var i = r ? H(ce, null, n) : n;
|
|
281
|
+
return H(r || _.nodeName.toLowerCase(), o, i);
|
|
282
|
+
}(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Ce : q)(this._vdom, this._root);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return e.replace(/-(\w)/g, function(t,
|
|
286
|
-
return
|
|
284
|
+
function He(e) {
|
|
285
|
+
return e.replace(/-(\w)/g, function(t, _) {
|
|
286
|
+
return _ ? _.toUpperCase() : "";
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function We(e, t, _) {
|
|
290
290
|
if (this._vdom) {
|
|
291
291
|
var r = {};
|
|
292
|
-
r[e] =
|
|
292
|
+
r[e] = _ = _ ?? void 0, r[He(e)] = _, this._vdom = xe(this._vdom, r), q(this._vdom, this._root);
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
295
|
+
function qe() {
|
|
296
|
+
q(this._vdom = null, this._root);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
var
|
|
300
|
-
return
|
|
301
|
-
r ? (
|
|
302
|
-
|
|
303
|
-
}, r.addEventListener("_preact",
|
|
298
|
+
function ce(e, t) {
|
|
299
|
+
var _ = this;
|
|
300
|
+
return H("slot", _e({}, e, { ref: function(r) {
|
|
301
|
+
r ? (_.ref = r, _._listener || (_._listener = function(n) {
|
|
302
|
+
n.stopPropagation(), n.detail.context = t;
|
|
303
|
+
}, r.addEventListener("_preact", _._listener))) : _.ref.removeEventListener("_preact", _._listener);
|
|
304
304
|
} }));
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
function
|
|
308
|
-
var o = Reflect.construct(HTMLElement, [],
|
|
306
|
+
function Pe(e, t, _, r) {
|
|
307
|
+
function n() {
|
|
308
|
+
var o = Reflect.construct(HTMLElement, [], n);
|
|
309
309
|
return o._vdomComponent = e, o._root = o, o;
|
|
310
310
|
}
|
|
311
|
-
return (
|
|
312
|
-
Object.defineProperty(
|
|
311
|
+
return (n.prototype = Object.create(HTMLElement.prototype)).constructor = n, n.prototype.connectedCallback = je, n.prototype.attributeChangedCallback = We, n.prototype.disconnectedCallback = qe, _ = _ || e.observedAttributes || Object.keys(e.propTypes || {}), n.observedAttributes = _, _.forEach(function(o) {
|
|
312
|
+
Object.defineProperty(n.prototype, o, { get: function() {
|
|
313
313
|
return this._vdom.props[o];
|
|
314
314
|
}, set: function(l) {
|
|
315
315
|
this._vdom ? this.attributeChangedCallback(o, null, l) : (this._props || (this._props = {}), this._props[o] = l, this.connectedCallback());
|
|
316
316
|
var c = typeof l;
|
|
317
317
|
l != null && c !== "string" && c !== "boolean" && c !== "number" || this.setAttribute(o, l);
|
|
318
318
|
} });
|
|
319
|
-
}), customElements.define(t || e.tagName || e.displayName || e.name,
|
|
320
|
-
}
|
|
321
|
-
var I;
|
|
322
|
-
I = { __e: function(e, t, n, r) {
|
|
323
|
-
for (var _, o, l; t = t.__; ) if ((_ = t.__c) && !_.__) try {
|
|
324
|
-
if ((o = _.constructor) && o.getDerivedStateFromError != null && (_.setState(o.getDerivedStateFromError(e)), l = _.__d), _.componentDidCatch != null && (_.componentDidCatch(e, r || {}), l = _.__d), l) return _.__E = _;
|
|
325
|
-
} catch (c) {
|
|
326
|
-
e = c;
|
|
327
|
-
}
|
|
328
|
-
throw e;
|
|
329
|
-
} }, typeof Promise == "function" && Promise.prototype.then.bind(Promise.resolve());
|
|
330
|
-
var ze = 0;
|
|
331
|
-
function Ne(e, t, n, r, _, o) {
|
|
332
|
-
t || (t = {});
|
|
333
|
-
var l, c, a = t;
|
|
334
|
-
if ("ref" in a) for (c in a = {}, t) c == "ref" ? l = t[c] : a[c] = t[c];
|
|
335
|
-
var s = { type: e, props: a, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --ze, __i: -1, __u: 0, __source: _, __self: o };
|
|
336
|
-
return I.vnode && I.vnode(s), s;
|
|
319
|
+
}), customElements.define(t || e.tagName || e.displayName || e.name, n);
|
|
337
320
|
}
|
|
338
|
-
var
|
|
339
|
-
function
|
|
340
|
-
m.__h && m.__h(b, e,
|
|
341
|
-
var
|
|
342
|
-
return e >=
|
|
321
|
+
var I, b, z, se, Q = 0, Ne = [], m = p, ae = m.__b, ue = m.__r, fe = m.diffed, de = m.__c, pe = m.unmount, he = m.__;
|
|
322
|
+
function De(e, t) {
|
|
323
|
+
m.__h && m.__h(b, e, Q || t), Q = 0;
|
|
324
|
+
var _ = b.__H || (b.__H = { __: [], __h: [] });
|
|
325
|
+
return e >= _.__.length && _.__.push({}), _.__[e];
|
|
343
326
|
}
|
|
344
327
|
function j(e, t) {
|
|
345
|
-
var
|
|
346
|
-
!m.__s &&
|
|
328
|
+
var _ = De(I++, 3);
|
|
329
|
+
!m.__s && Te(_.__H, t) && (_.__ = e, _.i = t, b.__H.__h.push(_));
|
|
347
330
|
}
|
|
348
|
-
function
|
|
349
|
-
return
|
|
331
|
+
function Se(e) {
|
|
332
|
+
return Q = 5, Be(function() {
|
|
350
333
|
return { current: e };
|
|
351
334
|
}, []);
|
|
352
335
|
}
|
|
353
|
-
function
|
|
354
|
-
var
|
|
355
|
-
return
|
|
336
|
+
function Be(e, t) {
|
|
337
|
+
var _ = De(I++, 7);
|
|
338
|
+
return Te(_.__H, t) && (_.__ = e(), _.__H = t, _.__h = e), _.__;
|
|
356
339
|
}
|
|
357
|
-
function
|
|
358
|
-
for (var e; e =
|
|
359
|
-
e.__H.__h.forEach(O), e.__H.__h.forEach(
|
|
340
|
+
function ze() {
|
|
341
|
+
for (var e; e = Ne.shift(); ) if (e.__P && e.__H) try {
|
|
342
|
+
e.__H.__h.forEach(O), e.__H.__h.forEach(X), e.__H.__h = [];
|
|
360
343
|
} catch (t) {
|
|
361
344
|
e.__H.__h = [], m.__e(t, e.__v);
|
|
362
345
|
}
|
|
363
346
|
}
|
|
364
347
|
m.__b = function(e) {
|
|
365
|
-
b = null,
|
|
348
|
+
b = null, ae && ae(e);
|
|
366
349
|
}, m.__ = function(e, t) {
|
|
367
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
350
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), he && he(e, t);
|
|
368
351
|
}, m.__r = function(e) {
|
|
369
|
-
|
|
352
|
+
ue && ue(e), I = 0;
|
|
370
353
|
var t = (b = e.__c).__H;
|
|
371
|
-
t && (
|
|
372
|
-
|
|
373
|
-
})) : (t.__h.forEach(O), t.__h.forEach(
|
|
354
|
+
t && (z === b ? (t.__h = [], b.__h = [], t.__.forEach(function(_) {
|
|
355
|
+
_.__N && (_.__ = _.__N), _.i = _.__N = void 0;
|
|
356
|
+
})) : (t.__h.forEach(O), t.__h.forEach(X), t.__h = [], I = 0)), z = b;
|
|
374
357
|
}, m.diffed = function(e) {
|
|
375
|
-
|
|
358
|
+
fe && fe(e);
|
|
376
359
|
var t = e.__c;
|
|
377
|
-
t && t.__H && (t.__H.__h.length && (
|
|
378
|
-
|
|
379
|
-
})),
|
|
360
|
+
t && t.__H && (t.__H.__h.length && (Ne.push(t) !== 1 && se === m.requestAnimationFrame || ((se = m.requestAnimationFrame) || Je)(ze)), t.__H.__.forEach(function(_) {
|
|
361
|
+
_.i && (_.__H = _.i), _.i = void 0;
|
|
362
|
+
})), z = b = null;
|
|
380
363
|
}, m.__c = function(e, t) {
|
|
381
|
-
t.some(function(
|
|
364
|
+
t.some(function(_) {
|
|
382
365
|
try {
|
|
383
|
-
|
|
384
|
-
return !r.__ ||
|
|
366
|
+
_.__h.forEach(O), _.__h = _.__h.filter(function(r) {
|
|
367
|
+
return !r.__ || X(r);
|
|
385
368
|
});
|
|
386
369
|
} catch (r) {
|
|
387
|
-
t.some(function(
|
|
388
|
-
|
|
389
|
-
}), t = [], m.__e(r,
|
|
370
|
+
t.some(function(n) {
|
|
371
|
+
n.__h && (n.__h = []);
|
|
372
|
+
}), t = [], m.__e(r, _.__v);
|
|
390
373
|
}
|
|
391
|
-
}),
|
|
374
|
+
}), de && de(e, t);
|
|
392
375
|
}, m.unmount = function(e) {
|
|
393
|
-
|
|
394
|
-
var t,
|
|
395
|
-
|
|
376
|
+
pe && pe(e);
|
|
377
|
+
var t, _ = e.__c;
|
|
378
|
+
_ && _.__H && (_.__H.__.forEach(function(r) {
|
|
396
379
|
try {
|
|
397
380
|
O(r);
|
|
398
|
-
} catch (
|
|
399
|
-
t =
|
|
381
|
+
} catch (n) {
|
|
382
|
+
t = n;
|
|
400
383
|
}
|
|
401
|
-
}),
|
|
384
|
+
}), _.__H = void 0, t && m.__e(t, _.__v));
|
|
402
385
|
};
|
|
403
|
-
var
|
|
404
|
-
function
|
|
405
|
-
var t,
|
|
406
|
-
clearTimeout(r),
|
|
407
|
-
}, r = setTimeout(
|
|
408
|
-
|
|
386
|
+
var me = typeof requestAnimationFrame == "function";
|
|
387
|
+
function Je(e) {
|
|
388
|
+
var t, _ = function() {
|
|
389
|
+
clearTimeout(r), me && cancelAnimationFrame(t), setTimeout(e);
|
|
390
|
+
}, r = setTimeout(_, 100);
|
|
391
|
+
me && (t = requestAnimationFrame(_));
|
|
409
392
|
}
|
|
410
393
|
function O(e) {
|
|
411
|
-
var t = b,
|
|
412
|
-
typeof
|
|
394
|
+
var t = b, _ = e.__c;
|
|
395
|
+
typeof _ == "function" && (e.__c = void 0, _()), b = t;
|
|
413
396
|
}
|
|
414
|
-
function
|
|
397
|
+
function X(e) {
|
|
415
398
|
var t = b;
|
|
416
399
|
e.__c = e.__(), b = t;
|
|
417
400
|
}
|
|
418
|
-
function
|
|
419
|
-
return !e || e.length !== t.length || t.some(function(
|
|
420
|
-
return
|
|
401
|
+
function Te(e, t) {
|
|
402
|
+
return !e || e.length !== t.length || t.some(function(_, r) {
|
|
403
|
+
return _ !== e[r];
|
|
421
404
|
});
|
|
422
405
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
406
|
+
var Ve = 0;
|
|
407
|
+
function Le(e, t, _, r, n, o) {
|
|
408
|
+
t || (t = {});
|
|
409
|
+
var l, c, a = t;
|
|
410
|
+
if ("ref" in a) for (c in a = {}, t) c == "ref" ? l = t[c] : a[c] = t[c];
|
|
411
|
+
var s = { type: e, props: a, key: _, ref: l, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --Ve, __i: -1, __u: 0, __source: n, __self: o };
|
|
412
|
+
return p.vnode && p.vnode(s), s;
|
|
413
|
+
}
|
|
414
|
+
function Ge(e) {
|
|
415
|
+
const t = Se(null);
|
|
416
|
+
function _() {
|
|
417
|
+
const n = e.host || "https://app.documenso.com", o = btoa(
|
|
427
418
|
JSON.stringify({
|
|
428
419
|
name: e.name,
|
|
429
420
|
lockName: e.lockName,
|
|
@@ -431,21 +422,21 @@ function Ke(e) {
|
|
|
431
422
|
lockEmail: e.lockEmail,
|
|
432
423
|
css: e.css
|
|
433
424
|
})
|
|
434
|
-
), l = new URL(`/embed/direct/${e.token}`,
|
|
425
|
+
), l = new URL(`/embed/direct/${e.token}`, n);
|
|
435
426
|
return e.externalId && l.searchParams.set("externalId", e.externalId), `${l}#${o}`;
|
|
436
427
|
}
|
|
437
|
-
function r(
|
|
428
|
+
function r(n) {
|
|
438
429
|
var o, l, c, a, s, f;
|
|
439
|
-
if (((o = t.current) == null ? void 0 : o.contentWindow) ===
|
|
440
|
-
switch (
|
|
430
|
+
if (((o = t.current) == null ? void 0 : o.contentWindow) === n.source)
|
|
431
|
+
switch (n.data.action) {
|
|
441
432
|
case "document-ready":
|
|
442
433
|
(l = e.onDocumentReady) == null || l.call(e);
|
|
443
434
|
break;
|
|
444
435
|
case "document-completed":
|
|
445
|
-
(c = e.onDocumentCompleted) == null || c.call(e,
|
|
436
|
+
(c = e.onDocumentCompleted) == null || c.call(e, n.data.data);
|
|
446
437
|
break;
|
|
447
438
|
case "document-error":
|
|
448
|
-
(a = e.onDocumentError) == null || a.call(e,
|
|
439
|
+
(a = e.onDocumentError) == null || a.call(e, n.data.data);
|
|
449
440
|
break;
|
|
450
441
|
case "field-signed":
|
|
451
442
|
(s = e.onFieldSigned) == null || s.call(e);
|
|
@@ -459,32 +450,32 @@ function Ke(e) {
|
|
|
459
450
|
window.addEventListener("message", r);
|
|
460
451
|
}, []), j(() => () => {
|
|
461
452
|
window.removeEventListener("message", r);
|
|
462
|
-
}, []), /* @__PURE__ */
|
|
453
|
+
}, []), /* @__PURE__ */ Le("iframe", { ref: t, className: e.className, src: _() });
|
|
463
454
|
}
|
|
464
|
-
function
|
|
465
|
-
const t =
|
|
466
|
-
function
|
|
467
|
-
const
|
|
455
|
+
function Ke(e) {
|
|
456
|
+
const t = Se(null);
|
|
457
|
+
function _() {
|
|
458
|
+
const n = e.host || "https://app.documenso.com", o = btoa(
|
|
468
459
|
JSON.stringify({
|
|
469
460
|
name: e.name,
|
|
470
461
|
lockName: e.lockName,
|
|
471
462
|
css: e.css
|
|
472
463
|
})
|
|
473
464
|
);
|
|
474
|
-
return `${new URL(`/embed/sign/${e.token}`,
|
|
465
|
+
return `${new URL(`/embed/sign/${e.token}`, n)}#${o}`;
|
|
475
466
|
}
|
|
476
|
-
function r(
|
|
467
|
+
function r(n) {
|
|
477
468
|
var o, l, c, a;
|
|
478
|
-
if (((o = t.current) == null ? void 0 : o.contentWindow) ===
|
|
479
|
-
switch (
|
|
469
|
+
if (((o = t.current) == null ? void 0 : o.contentWindow) === n.source)
|
|
470
|
+
switch (n.data.action) {
|
|
480
471
|
case "document-ready":
|
|
481
472
|
(l = e.onDocumentReady) == null || l.call(e);
|
|
482
473
|
break;
|
|
483
474
|
case "document-completed":
|
|
484
|
-
(c = e.onDocumentCompleted) == null || c.call(e,
|
|
475
|
+
(c = e.onDocumentCompleted) == null || c.call(e, n.data.data);
|
|
485
476
|
break;
|
|
486
477
|
case "document-error":
|
|
487
|
-
(a = e.onDocumentError) == null || a.call(e,
|
|
478
|
+
(a = e.onDocumentError) == null || a.call(e, n.data.data);
|
|
488
479
|
break;
|
|
489
480
|
}
|
|
490
481
|
}
|
|
@@ -492,9 +483,9 @@ function Qe(e) {
|
|
|
492
483
|
window.addEventListener("message", r);
|
|
493
484
|
}, []), j(() => () => {
|
|
494
485
|
window.removeEventListener("message", r);
|
|
495
|
-
}, []), /* @__PURE__ */
|
|
486
|
+
}, []), /* @__PURE__ */ Le("iframe", { ref: t, className: e.className, src: _() });
|
|
496
487
|
}
|
|
497
|
-
|
|
488
|
+
Pe(Ge, "documenso-embed-direct-template", [
|
|
498
489
|
"token",
|
|
499
490
|
"host",
|
|
500
491
|
"externalId",
|
|
@@ -507,7 +498,7 @@ He(Ke, "documenso-embed-direct-template", [
|
|
|
507
498
|
"onDocumentCompleted",
|
|
508
499
|
"onDocumentError"
|
|
509
500
|
]);
|
|
510
|
-
|
|
501
|
+
Pe(Ke, "documenso-embed-sign-document", [
|
|
511
502
|
"token",
|
|
512
503
|
"host",
|
|
513
504
|
"css",
|