@documenso/embed-webcomponent 0.5.1 → 0.6.0

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