(()=>{var e={2948:(e,t,n)=>{"use strict";var r=n(8643);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},5762:(e,t,n)=>{e.exports=n(2948)()},8643:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9473:function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){"use strict";function n(e){var t=e.getContext("2d"),n=e.width,r=e.height,i=t.getImageData(0,0,n,r).data,s=o(!0,n,r,i),u=o(!1,n,r,i),c=a(!0,n,r,i),l=a(!1,n,r,i)-c+1,d=u-s+1,f=t.getImageData(c,s,l,d);return e.width=l,e.height=d,t.clearRect(0,0,l,d),t.putImageData(f,0,0),e}function r(e,t,n,r){return{red:r[4*(n*t+e)],green:r[4*(n*t+e)+1],blue:r[4*(n*t+e)+2],alpha:r[4*(n*t+e)+3]}}function i(e,t,n,i){return r(e,t,n,i).alpha}function o(e,t,n,r){for(var o=e?1:-1,a=e?0:n-1;e?a<n:a>-1;a+=o)for(var s=0;s<t;s++)if(i(s,a,t,r))return a;return null}function a(e,t,n,r){for(var o=e?1:-1,a=e?0:t-1;e?a<t:a>-1;a+=o)for(var s=0;s<n;s++)if(i(a,s,t,r))return a;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n}])},7167:(e,t,n)=>{"use strict";n.d(t,{D4:()=>s,GB:()=>i,RV:()=>o,Ui:()=>c,gh:()=>r,st:()=>u,x3:()=>a});const r="draw",i="type",o="full",a="initials",s=i,u=fg_legalsigning_signature.constants.fonts,c="legalsigning/signature"},6395:(e,t,n)=>{"use strict";n.d(t,{D:()=>on});var r={};n.r(r),n.d(r,{setSignature:()=>Ke});var i={};function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(null,arguments)}n.r(i),n.d(i,{getDefaultSignatureData:()=>Xe,getSignature:()=>Qe});const a=React;var s=n.n(a),u="data-focus-lock",c="data-focus-lock-disabled";function l(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var d="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,f=new WeakMap;function g(e,t){var n,r,i,o=(n=t||null,r=function(t){return e.forEach((function(e){return l(e,t)}))},(i=(0,a.useState)((function(){return{value:n,callback:r,facade:{get current(){return i.value},set current(e){var t=i.value;t!==e&&(i.value=e,i.callback(e,t))}}}}))[0]).callback=r,i.facade);return d((function(){var t=f.get(o);if(t){var n=new Set(t),r=new Set(e),i=o.current;n.forEach((function(e){r.has(e)||l(e,null)})),r.forEach((function(e){n.has(e)||l(e,i)}))}f.set(o,e)}),[e]),o}var h={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},p=function(e){var t=e.children,n=void 0===t?null:t;return a.createElement(a.Fragment,null,a.createElement("div",{key:"guard-first","data-focus-guard":!0,"data-focus-auto-guard":!0,style:h}),n,n&&a.createElement("div",{key:"guard-last","data-focus-guard":!0,"data-focus-auto-guard":!0,style:h}))};p.propTypes={};var m=function(){return m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},m.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function v(e){return e}function y(e,t){void 0===t&&(t=v);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter((function(e){return e!==i}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(o)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}}}function b(e,t){return void 0===t&&(t=v),y(e,t)}var _=b({},(function(e){return{target:e.target,currentTarget:e.currentTarget}})),w=b(),E=b(),x=function(e){void 0===e&&(e={});var t=y(null);return t.options=m({async:!0,ssr:!1},e),t}({async:!0,ssr:"undefined"!=typeof document}),O=(0,a.createContext)(void 0),P=[],R=a.forwardRef((function(e,t){var n,r=a.useState(),i=r[0],s=r[1],l=a.useRef(),d=a.useRef(!1),f=a.useRef(null),p=a.useState({})[1],m=e.children,v=e.disabled,y=void 0!==v&&v,b=e.noFocusGuards,E=void 0!==b&&b,R=e.persistentFocus,S=void 0!==R&&R,k=e.crossFrame,D=void 0===k||k,T=e.autoFocus,N=void 0===T||T,C=(e.allowTextSelection,e.group),j=e.className,M=e.whiteList,F=e.hasPositiveIndices,L=e.shards,B=void 0===L?P:L,I=e.as,A=void 0===I?"div":I,W=e.lockProps,U=void 0===W?{}:W,z=e.sideCar,G=e.returnFocus,$=void 0!==G&&G,q=e.focusOptions,V=e.onActivation,H=e.onDeactivation,Y=a.useState({})[0],J=a.useCallback((function(e){var t=e.captureFocusRestore;if(!f.current){var n,r=null==(n=document)?void 0:n.activeElement;f.current=r,r!==document.body&&(f.current=t(r))}l.current&&V&&V(l.current),d.current=!0,p()}),[V]),K=a.useCallback((function(){d.current=!1,H&&H(l.current),p()}),[H]),Q=a.useCallback((function(e){var t=f.current;if(t){var n=("function"==typeof t?t():t)||document.body,r="function"==typeof $?$(n):$;if(r){var i="object"==typeof r?r:void 0;f.current=null,e?Promise.resolve().then((function(){return n.focus(i)})):n.focus(i)}}}),[$]),X=a.useCallback((function(e){d.current&&_.useMedium(e)}),[]),Z=w.useMedium,ee=a.useCallback((function(e){l.current!==e&&(l.current=e,s(e))}),[]);var te=o(((n={})[c]=y&&"disabled",n[u]=C,n),U),ne=!0!==E,re=ne&&"tail"!==E,ie=g([t,ee]),oe=a.useMemo((function(){return{observed:l,shards:B,enabled:!y,active:d.current}}),[y,d.current,B,i]);return a.createElement(a.Fragment,null,ne&&[a.createElement("div",{key:"guard-first","data-focus-guard":!0,tabIndex:y?-1:0,style:h}),F?a.createElement("div",{key:"guard-nearest","data-focus-guard":!0,tabIndex:y?-1:1,style:h}):null],!y&&a.createElement(z,{id:Y,sideCar:x,observed:i,disabled:y,persistentFocus:S,crossFrame:D,autoFocus:N,whiteList:M,shards:B,onActivation:J,onDeactivation:K,returnFocus:Q,focusOptions:q}),a.createElement(A,o({ref:ie},te,{className:j,onBlur:Z,onFocus:X}),a.createElement(O.Provider,{value:oe},m)),re&&a.createElement("div",{"data-focus-guard":!0,tabIndex:y?-1:0,style:h}))}));R.propTypes={};const S=R;function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}function T(e){var t=function(e,t){if("object"!=D(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==D(t)?t:t+""}const N=function(e,t){return function(n){var r,i=[];function o(){r=e(i.map((function(e){return e.props}))),t(r)}var u,c,l,d=function(e){var t,a;function u(){return e.apply(this,arguments)||this}a=e,(t=u).prototype=Object.create(a.prototype),t.prototype.constructor=t,k(t,a),u.peek=function(){return r};var c=u.prototype;return c.componentDidMount=function(){i.push(this),o()},c.componentDidUpdate=function(){o()},c.componentWillUnmount=function(){var e=i.indexOf(this);i.splice(e,1),o()},c.render=function(){return s().createElement(n,this.props)},u}(a.PureComponent);return u=d,c="displayName",l="SideEffect("+function(e){return e.displayName||e.name||"Component"}(n)+")",(c=T(c))in u?Object.defineProperty(u,c,{value:l,enumerable:!0,configurable:!0,writable:!0}):u[c]=l,d}};var C=function(e){for(var t=Array(e.length),n=0;n<e.length;++n)t[n]=e[n];return t},j=function(e){return Array.isArray(e)?e:[e]},M=function(e){return Array.isArray(e)?e[0]:e},F=function(e){return e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode},L=function(e){return e===document||e&&e.nodeType===Node.DOCUMENT_NODE},B=function(e,t){return!e||L(e)||!function(e){if(e.nodeType!==Node.ELEMENT_NODE)return!1;var t=window.getComputedStyle(e,null);return!(!t||!t.getPropertyValue||"none"!==t.getPropertyValue("display")&&"hidden"!==t.getPropertyValue("visibility"))}(e)&&!function(e){return e.hasAttribute("inert")}(e)&&t(F(e))},I=function(e,t){var n=e.get(t);if(void 0!==n)return n;var r=B(t,I.bind(void 0,e));return e.set(t,r),r},A=function(e,t){var n=e.get(t);if(void 0!==n)return n;var r=function(e,t){return!(e&&!L(e))||!!G(e)&&t(F(e))}(t,A.bind(void 0,e));return e.set(t,r),r},W=function(e){return e.dataset},U=function(e){return"INPUT"===e.tagName},z=function(e){return U(e)&&"radio"===e.type},G=function(e){var t=e.getAttribute("data-no-autofocus");return![!0,"true",""].includes(t)},$=function(e){var t;return Boolean(e&&(null===(t=W(e))||void 0===t?void 0:t.focusGuard))},q=function(e){return!$(e)},V=function(e){return Boolean(e)},H=function(e,t){var n=Math.max(0,e.tabIndex),r=Math.max(0,t.tabIndex),i=n-r,o=e.index-t.index;if(i){if(!n)return 1;if(!r)return-1}return i||o},Y=function(e,t,n){return C(e).map((function(e,t){var r=function(e){return e.tabIndex<0&&!e.hasAttribute("tabindex")?0:e.tabIndex}(e);return{node:e,index:t,tabIndex:n&&-1===r?(e.dataset||{}).focusGuard?0:-1:r}})).filter((function(e){return!t||e.tabIndex>=0})).sort(H)},J=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"].join(","),K="".concat(J,", [data-focus-guard]"),Q=function(e,t){return C((e.shadowRoot||e).children).reduce((function(e,n){return e.concat(n.matches(t?K:J)?[n]:[],Q(n))}),[])},X=function(e,t){return e.reduce((function(e,n){var r,i=Q(n,t),o=(r=[]).concat.apply(r,i.map((function(e){return function(e,t){var n;return e instanceof HTMLIFrameElement&&(null===(n=e.contentDocument)||void 0===n?void 0:n.body)?X([e.contentDocument.body],t):[e]}(e,t)})));return e.concat(o,n.parentNode?C(n.parentNode.querySelectorAll(J)).filter((function(e){return e===n})):[])}),[])},Z=function(e,t){return C(e).filter((function(e){return I(t,e)})).filter((function(e){return function(e){return!((U(e)||function(e){return"BUTTON"===e.tagName}(e))&&("hidden"===e.type||e.disabled))}(e)}))},ee=function(e,t){return void 0===t&&(t=new Map),C(e).filter((function(e){return A(t,e)}))},te=function(e,t,n){return Y(Z(X(e,n),t),!0,n)},ne=function(e,t){return Y(Z(X(e),t),!1)},re=function(e,t){return Z((n=e.querySelectorAll("[".concat("data-autofocus-inside","]")),C(n).map((function(e){return X([e])})).reduce((function(e,t){return e.concat(t)}),[])),t);var n},ie=function(e,t){return e.shadowRoot?ie(e.shadowRoot,t):!(void 0===Object.getPrototypeOf(e).contains||!Object.getPrototypeOf(e).contains.call(e,t))||C(e.children).some((function(e){var n;if(e instanceof HTMLIFrameElement){var r=null===(n=e.contentDocument)||void 0===n?void 0:n.body;return!!r&&ie(r,t)}return ie(e,t)}))},oe=function(e){if(void 0===e&&(e=document),e&&e.activeElement){var t=e.activeElement;return t.shadowRoot?oe(t.shadowRoot):t instanceof HTMLIFrameElement&&function(e){try{return e()}catch(e){return}}((function(){return t.contentWindow.document}))?oe(t.contentWindow.document):t}},ae=function(e){return e.parentNode?ae(e.parentNode):e},se=function(e){return j(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(u);return e.push.apply(e,n?function(e){for(var t=new Set,n=e.length,r=0;r<n;r+=1)for(var i=r+1;i<n;i+=1){var o=e[r].compareDocumentPosition(e[i]);(o&Node.DOCUMENT_POSITION_CONTAINED_BY)>0&&t.add(i),(o&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter((function(e,n){return!t.has(n)}))}(C(ae(t).querySelectorAll("[".concat(u,'="').concat(n,'"]:not([').concat(c,'="disabled"])')))):[t]),e}),[])},ue=function(e,t){return void 0===t&&(t=oe(M(e).ownerDocument)),!(!t||t.dataset&&t.dataset.focusGuard)&&se(e).some((function(e){return ie(e,t)||function(e,t){return Boolean(C(e.querySelectorAll("iframe")).some((function(e){return function(e,t){return e===t}(e,t)})))}(e,t)}))},ce=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},le=function(e,t){return z(e)&&e.name?function(e,t){return t.filter(z).filter((function(t){return t.name===e.name})).filter((function(e){return e.checked}))[0]||e}(e,t):e},de=function(e){return e[0]&&e.length>1?le(e[0],e):e[0]},fe=function(e,t){return e.indexOf(le(t,e))},ge="NEW_FOCUS",he=function(e,t,n,r,i){var o=e.length,a=e[0],s=e[o-1],u=$(r);if(!(r&&e.indexOf(r)>=0)){var c=void 0!==r?n.indexOf(r):-1,l=i?n.indexOf(i):c,d=i?e.indexOf(i):-1;if(-1===c)return-1!==d?d:ge;if(-1===d)return ge;var f,g,h=c-l,p=n.indexOf(a),m=n.indexOf(s),v=(f=n,g=new Set,f.forEach((function(e){return g.add(le(e,f))})),f.filter((function(e){return g.has(e)}))),y=(void 0!==r?v.indexOf(r):-1)-(i?v.indexOf(i):c);if(!h&&d>=0)return d;if(0===t.length)return d;var b=fe(e,t[0]),_=fe(e,t[t.length-1]);return c<=p&&u&&Math.abs(h)>1?_:c>=m&&u&&Math.abs(h)>1?b:h&&Math.abs(y)>1?d:c<=p?_:c>m?b:h?Math.abs(h)>1?d:(o+d+h)%o:void 0}},pe=function(e,t,n){var r,i=e.map((function(e){return e.node})),o=ee(i.filter((r=n,function(e){var t,n=null===(t=W(e))||void 0===t?void 0:t.autofocus;return e.autofocus||void 0!==n&&"false"!==n||r.indexOf(e)>=0})));return o&&o.length?de(o):de(ee(t))},me=function(e,t){return void 0===t&&(t=[]),t.push(e),e.parentNode&&me(e.parentNode.host||e.parentNode,t),t},ve=function(e,t){for(var n=me(e),r=me(t),i=0;i<n.length;i+=1){var o=n[i];if(r.indexOf(o)>=0)return o}return!1},ye=function(e,t,n){var r=j(e),i=j(t),o=r[0],a=!1;return i.filter(Boolean).forEach((function(e){a=ve(a||e,e)||a,n.filter(Boolean).forEach((function(e){var t=ve(o,e);t&&(a=!a||ie(t,a)?t:ve(t,a))}))})),a},be=function(e,t){return e.reduce((function(e,n){return e.concat(re(n,t))}),[])},_e=function(e,t){var n=oe(j(e).length>0?document:M(e).ownerDocument),r=se(e).filter(q),i=ye(n||e,e,r),o=new Map,a=ne(r,o),s=a.filter((function(e){var t=e.node;return q(t)}));if(s[0]){var u,c,l,d=ne([i],o).map((function(e){return e.node})),f=(u=d,c=s,l=new Map,c.forEach((function(e){return l.set(e.node,e)})),u.map((function(e){return l.get(e)})).filter(V)),g=f.map((function(e){return e.node})),h=f.filter((function(e){return e.tabIndex>=0})).map((function(e){return e.node})),p=he(g,h,d,n,t);if(p===ge){var m=pe(a,h,be(r,o))||pe(a,g,be(r,o));return m?{node:m}:void console.warn("focus-lock: cannot find any node to move focus into")}return void 0===p?p:f[p]}},we=0,Ee=!1,xe=function(e,t,n){void 0===n&&(n={});var r=_e(e,t);if(!Ee&&r){if(we>2)return console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),Ee=!0,void setTimeout((function(){Ee=!1}),1);we++,ce(r.node,n.focusOptions),we--}},Oe=function(e,t,n){void 0===t&&(t={});var r=function(e){return Object.assign({scope:document.body,cycle:!0,onlyTabbable:!0},e)}(t),i=function(e,t,n){if(!e||!t)return console.error("no element or scope given"),{};var r=j(t);if(r.every((function(t){return!ie(t,e)})))return console.error("Active element is not contained in the scope"),{};var i=n?te(r,new Map):ne(r,new Map),o=i.findIndex((function(t){return t.node===e}));return-1!==o?{prev:i[o-1],next:i[o+1],first:i[0],last:i[i.length-1]}:void 0}(e,r.scope,r.onlyTabbable);if(i){var o=n(i,r.cycle);o&&ce(o.node,r.focusOptions)}},Pe=function(e,t,n){var r,i,o,a,s=(i=e,o=null===(r=t.onlyTabbable)||void 0===r||r,{first:(a=o?te(j(i),new Map):ne(j(i),new Map))[0],last:a[a.length-1]})[n];s&&ce(s.node,t.focusOptions)};function Re(e){if(!e)return null;if("undefined"==typeof WeakRef)return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(null==t?void 0:t.deref())||null}}function Se(e){setTimeout(e,1)}var ke=function(e){return e&&"current"in e?e.current:e},De=function(){return document&&document.activeElement===document.body||function(e){void 0===e&&(e=document);var t=oe(e);return!!t&&C(e.querySelectorAll("[".concat("data-no-focus-lock","]"))).some((function(e){return ie(e,t)}))}()},Te=null,Ne=null,Ce=null,je=!1,Me=function(){return!0};function Fe(e,t,n,r){var i=null,o=e;do{var a=r[o];if(a.guard)a.node.dataset.focusAutoGuard&&(i=a);else{if(!a.lockItem)break;if(o!==e)return;i=null}}while((o+=n)!==t);i&&(i.node.tabIndex=0)}var Le=function e(t,n,r){return n&&(n.host===t&&(!n.activeElement||r.contains(n.activeElement))||n.parentNode&&e(t,n.parentNode,r))},Be=function(){var e,t,n,r,i,o,a=!1;if(Te){var s=Te,u=s.observed,c=s.persistentFocus,l=s.autoFocus,d=s.shards,f=s.crossFrame,g=s.focusOptions,h=u||Ce&&Ce.portaledElement,p=document&&document.activeElement;if(h){var m=[h].concat(d.map(ke).filter(Boolean));if(p&&!function(e){return(Te.whiteList||Me)(e)}(p)||(c||(f?Boolean(je):"meanwhile"===je)||!De()||!Ne&&l)&&(h&&!(ue(m)||p&&function(e,t){return t.some((function(t){return Le(e,t,t)}))}(p,m)||(o=p,Ce&&Ce.portaledElement===o))&&(document&&!Ne&&p&&!l?(p.blur&&p.blur(),document.body.focus()):(a=xe(m,Ne,{focusOptions:g}),Ce={})),je=!1,Ne=document&&document.activeElement),document&&p!==document.activeElement&&document.querySelector("[data-focus-auto-guard]")){var v=document&&document.activeElement,y=(t=se(e=m).filter(q),n=ye(e,e,t),r=Y(X([n],!0),!0,!0),i=X(t,!1),r.map((function(e){var t=e.node;return{node:t,index:e.index,lockItem:i.indexOf(t)>=0,guard:$(t)}}))),b=y.map((function(e){return e.node})).indexOf(v);b>-1&&(y.filter((function(e){var t=e.guard,n=e.node;return t&&n.dataset.focusAutoGuard})).forEach((function(e){return e.node.removeAttribute("tabIndex")})),Fe(b,y.length,1,y),Fe(b,-1,-1,y))}}}return a},Ie=function(e){Be()&&e&&(e.stopPropagation(),e.preventDefault())},Ae=function(){return Se(Be)},We=function(e){var t=e.target,n=e.currentTarget;n.contains(t)||(Ce={observerNode:n,portaledElement:t})},Ue=function(){je="just",Se((function(){je="meanwhile"}))};var ze={moveFocusInside:xe,focusInside:ue,focusNextElement:function(e,t){void 0===t&&(t={}),Oe(e,t,(function(e,t){var n=e.next,r=e.first;return n||t&&r}))},focusPrevElement:function(e,t){void 0===t&&(t={}),Oe(e,t,(function(e,t){var n=e.prev,r=e.last;return n||t&&r}))},focusFirstElement:function(e,t){void 0===t&&(t={}),Pe(e,t,"first")},focusLastElement:function(e,t){void 0===t&&(t={}),Pe(e,t,"last")},captureFocusRestore:function(e){var t=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:Re(n),parent:Re(n.parentElement),left:Re(n.previousElementSibling),right:Re(n.nextElementSibling)}),n=n.parentElement;return{element:Re(e),stack:t,ownerDocument:e.ownerDocument}}(e);return function(){return function(e){var t,n,r,i,o;if(e)for(var a=e.stack,s=e.ownerDocument,u=new Map,c=0,l=a;c<l.length;c++){var d=l[c],f=null===(t=d.parent)||void 0===t?void 0:t.call(d);if(f&&s.contains(f)){for(var g=null===(n=d.left)||void 0===n?void 0:n.call(d),h=d.current(),p=f.contains(h)?h:void 0,m=null===(r=d.right)||void 0===r?void 0:r.call(d),v=te([f],u),y=null!==(o=null!==(i=null!=p?p:null==g?void 0:g.nextElementSibling)&&void 0!==i?i:m)&&void 0!==o?o:g;y;){for(var b=0,_=v;b<_.length;b++){var w=_[b];if(null==y?void 0:y.contains(w.node))return w.node}y=y.nextElementSibling}if(v.length)return v[0].node}}}(t)}}};_.assignSyncMedium(We),w.assignMedium(Ae),E.assignMedium((function(e){return e(ze)}));const Ge=N((function(e){return e.filter((function(e){return!e.disabled}))}),(function(e){var t=e.slice(-1)[0];t&&!Te&&(document.addEventListener("focusin",Ie),document.addEventListener("focusout",Ae),window.addEventListener("blur",Ue));var n=Te,r=n&&t&&t.id===n.id;Te=t,n&&!r&&(n.onDeactivation(),e.filter((function(e){return e.id===n.id})).length||n.returnFocus(!t)),t?(Ne=null,r&&n.observed===t.observed||t.onActivation(ze),Be(),Se(Be)):(document.removeEventListener("focusin",Ie),document.removeEventListener("focusout",Ae),window.removeEventListener("blur",Ue),Ne=null)}))((function(){return null}));var $e=a.forwardRef((function(e,t){return a.createElement(S,o({sideCar:Ge,ref:t},e))})),qe=S.propTypes||{};qe.sideCar,function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}}(qe,["sideCar"]);$e.propTypes={};const Ve=$e,He={SET:"SET"};var Ye=n(7167);const{SET:Je}=He,Ke=(e,t)=>({type:Je,nameType:e,signatureData:t}),Qe=(e,t)=>e[t],Xe=e=>{switch(e){case Ye.gh:return{data:[],image:""};case Ye.GB:return{font:Ye.st[0],name:""}}};function Ze(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function et(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{SET:tt}=He,nt=(e={full:{},initials:{}},t)=>{if(t.type===tt){let n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ze(Object(n),!0).forEach((function(t){et(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ze(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e);return n[t.nameType]=t.signatureData,n}return e},{registerStore:rt}=wp.data;rt(Ye.Ui,{selectors:i,actions:r,reducer:nt});const{useEffect:it,useRef:ot}=wp.element,at=({id:e,insertNextTo:t,appendTo:n})=>{const r=ot(null);return it((()=>{const i=document.querySelector(`#${e}`),o=i||(e=>{const t=document.createElement("div");return t.setAttribute("id",e),t})(e);return i||(e=>{if(n)document.querySelector(n).append(e);else if(t){const n=document.getElementById(t);n.parentNode.insertBefore(e,n.nextSibling)}})(o),o.appendChild(r.current),()=>{r.current.remove(),o.childElementCount||o.remove()}}),[e]),r.current||(r.current=document.createElement("div")),r.current},{createPortal:st}=wp.element,ut=({id:e="legalsigning-field-assigning__modal",insertNextTo:t,appendTo:n,children:r})=>st(r,at({id:e,insertNextTo:t,appendTo:n}));var ct=n(3368),lt=n.n(ct);const dt=React.createElement("svg",{height:"21",viewBox:"0 0 21 21",width:"21",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,transform:"translate(1 1)"},React.createElement("path",{d:"m0 19h19"}),React.createElement("path",{d:"m1 15 1.25-5 10-10 3.75 3.75-10 10z",fill:"#fff"}),React.createElement("path",{d:"m15.5 6 2.5 2.66666667-5 5.33333333"}))),ft=React.createElement("svg",{enableBackground:"new 0 0 10 10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{fill:"none",stroke:"#2a2a4d",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"},React.createElement("path",{d:"m9 1-8 8"}),React.createElement("path",{d:"m9 9-8-8"}))),gt=React.createElement("svg",{height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1.5)"},React.createElement("path",{d:"m14 10.3c-1.1269825 2.4724-3.7008556 4.2-6.69616027 4.2-4.03391068 0-7.30383973-3.1339-7.30383973-7s3.26992905-7 7.30383973-7c1.99102671 0 3.79653587.7637 5.11414857 2.002",stroke:"#FFF",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),React.createElement("path",{d:"m9 4.16666667 4.1666667-4.16666667.8333333 5z",stroke:"#FFF",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"}),React.createElement("path",{d:"m9 4.16666667 4.1666667-4.16666667.8333333 5z",fill:"#FFF",fillRule:"nonzero"}))),ht=React.createElement("svg",{height:"14",viewBox:"0 0 24 14",width:"24",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{strokeWidth:2,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},React.createElement("rect",{height:"12",rx:"2",width:"22",x:"1",y:"1"}),React.createElement("path",{d:"m4 5h1"}),React.createElement("path",{d:"m9 5h1"}),React.createElement("path",{d:"m14 5h1"}),React.createElement("path",{d:"m19 5h1"}),React.createElement("path",{d:"m4 9h1"}),React.createElement("path",{d:"m9 9h6"}),React.createElement("path",{d:"m19 9h1"})));function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach((function(t){vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{__:yt}=wp.i18n,bt=({actionBarRef:e,signatureData:t,setSignatureData:n,signatureMode:r,availableModes:i,canTakeAction:o,onChangeMode:a,onReset:s})=>{const u=()=>{const e=(Ye.st.indexOf(t.font)+1)%Ye.st.length;return Ye.st[e]},c=[[r===Ye.GB&&React.createElement("button",{key:"control-action--font",type:"button",className:"legalsigning-field-signature__control-action legalsigning-field-signature__control-action--font",disabled:!t.name,onClick:e=>n(mt(mt({},t),{},{font:u()}))},yt("Change Font","forgravity_legalsigning")),React.createElement("button",{key:"control-action--reset",type:"button",className:"legalsigning-field-signature__control-action legalsigning-field-signature__control-action--reset",disabled:o,onClick:e=>{confirm(yt("Are you sure you want to reset your signature?","forgravity_legalsigning"))&&s()}},React.createElement("span",{className:"screen-reader-text"},yt("Reset Signature","forgravity_legalsigning")),gt)]];return React.createElement("div",{className:"legalsigning-field-signature__controls",ref:e},React.createElement("div",{className:"legalsigning-field-signature__controls-group legalsigning-field-signature__controls-group--modes"},[{name:Ye.GB,icon:ht,label:yt("Type","forgravity_legalsigning"),class:lt()("legalsigning-field-signature__control-mode",`legalsigning-field-signature__control-mode--${Ye.GB}`,r===Ye.GB&&"legalsigning-field-signature__control-mode--active")},{name:Ye.gh,icon:dt,label:yt("Draw","forgravity_legalsigning"),class:lt()("legalsigning-field-signature__control-mode",`legalsigning-field-signature__control-mode--${Ye.gh}`,r===Ye.gh&&"legalsigning-field-signature__control-mode--active")}].map((e=>i.includes(e.name)&&React.createElement("button",{key:`control-mode--${e.name}`,type:"button",className:e.class,onClick:()=>a(e.name)},e.icon,e.label)))),React.createElement("div",{className:"legalsigning-field-signature__controls-group legalsigning-field-signature__controls-group--actions"},c))};function _t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(n),!0).forEach((function(t){Et(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Et(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Fragment:xt}=wp.element,{__:Ot}=wp.i18n,Pt=({fieldId:e,signatureData:t,nameType:n,height:r=150,width:i=600,penColor:o="#000",backgroundColor:a="#FFF",onChange:s})=>React.createElement(xt,null,React.createElement("div",{className:"legalsigning-field-signature__type"},"full"===n&&[React.createElement("label",{key:`legalsigning-field-type-full-${e}-label`,htmlFor:`legalsigning-field-type-full-${e}`},Ot("Type Your Name","forgravity_legalsigning")),React.createElement("input",{type:"text",id:`legalsigning-field-type-full-${e}`,key:`legalsigning-field-type-full-${e}-input`,value:t.name,className:"legalsigning-field-signature__type-input legalsigning-field-signature__type-input--name",placeholder:Ot("Full Name","forgravity_legalsigning"),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),onChange:e=>s(wt(wt({},t),{},{name:e.target.value}))})],"initials"===n&&[React.createElement("label",{key:`legalsigning-field-type-initials-${e}-label`,htmlFor:`legalsigning-field-type-initials-${e}`},Ot("Type Your Initials","forgravity_legalsigning")),React.createElement("input",{type:"text",id:`legalsigning-field-type-initials-${e}`,key:`legalsigning-field-type-initials-${e}-input`,value:t.name,className:"legalsigning-field-signature__type-input legalsigning-field-signature__type-input--initials",placeholder:Ot("Initials","forgravity_legalsigning"),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),onChange:e=>s(wt(wt({},t),{},{name:e.target.value}))})]),React.createElement("div",{className:`legalsigning-field-signature__type-signature legalsigning-field-signature__type-signature--${t.font}`,style:{backgroundColor:a,color:o,height:`${r}px`,width:`${i}px`}},t.name));var Rt=n(5762),St=n.n(Rt);
/*!
 * Signature Pad v2.3.2
 * https://github.com/szimek/signature_pad
 *
 * Copyright 2017 Szymon Nowak
 * Released under the MIT license
 *
 * The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
 * http://corner.squareup.com/2012/07/smoother-signatures.html
 *
 * Implementation of interpolation using cubic Bézier curves is taken from:
 * http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
 *
 * Algorithm for approximated length of a Bézier curve is taken from:
 * http://www.lemoda.net/maths/bezier-length/index.html
 *
 */
function kt(e,t,n){this.x=e,this.y=t,this.time=n||(new Date).getTime()}function Dt(e,t,n,r){this.startPoint=e,this.control1=t,this.control2=n,this.endPoint=r}function Tt(e,t){var n=this,r=t||{};this.velocityFilterWeight=r.velocityFilterWeight||.7,this.minWidth=r.minWidth||.5,this.maxWidth=r.maxWidth||2.5,this.throttle="throttle"in r?r.throttle:16,this.minDistance="minDistance"in r?r.minDistance:5,this.throttle?this._strokeMoveUpdate=function(e,t,n){var r,i,o,a=null,s=0;n||(n={});var u=function(){s=!1===n.leading?0:Date.now(),a=null,o=e.apply(r,i),a||(r=i=null)};return function(){var c=Date.now();s||!1!==n.leading||(s=c);var l=t-(c-s);return r=this,i=arguments,l<=0||l>t?(a&&(clearTimeout(a),a=null),s=c,o=e.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(u,l)),o}}(Tt.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=Tt.prototype._strokeUpdate,this.dotSize=r.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=r.penColor||"black",this.backgroundColor=r.backgroundColor||"rgba(0,0,0,0)",this.onBegin=r.onBegin,this.onEnd=r.onEnd,this._canvas=e,this._ctx=e.getContext("2d"),this.clear(),this._handleMouseDown=function(e){1===e.which&&(n._mouseButtonDown=!0,n._strokeBegin(e))},this._handleMouseMove=function(e){n._mouseButtonDown&&n._strokeMoveUpdate(e)},this._handleMouseUp=function(e){1===e.which&&n._mouseButtonDown&&(n._mouseButtonDown=!1,n._strokeEnd(e))},this._handleTouchStart=function(e){if(1===e.targetTouches.length){var t=e.changedTouches[0];n._strokeBegin(t)}},this._handleTouchMove=function(e){e.preventDefault();var t=e.targetTouches[0];n._strokeMoveUpdate(t)},this._handleTouchEnd=function(e){e.target===n._canvas&&(e.preventDefault(),n._strokeEnd(e))},this.on()}kt.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):1},kt.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},kt.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time},Dt.prototype.length=function(){for(var e=0,t=void 0,n=void 0,r=0;r<=10;r+=1){var i=r/10,o=this._point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this._point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){var s=o-t,u=a-n;e+=Math.sqrt(s*s+u*u)}t=o,n=a}return e},Dt.prototype._point=function(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e},Tt.prototype.clear=function(){var e=this._ctx,t=this._canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0},Tt.prototype.fromDataURL=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new Image,i=n.ratio||window.devicePixelRatio||1,o=n.width||this._canvas.width/i,a=n.height||this._canvas.height/i;this._reset(),r.src=e,r.onload=function(){t._ctx.drawImage(r,0,0,o,a)},this._isEmpty=!1},Tt.prototype.toDataURL=function(e){var t;if("image/svg+xml"===e)return this._toSVG();for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(t=this._canvas).toDataURL.apply(t,[e].concat(r))},Tt.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},Tt.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},Tt.prototype.isEmpty=function(){return this._isEmpty},Tt.prototype._strokeBegin=function(e){this._data.push([]),this._reset(),this._strokeUpdate(e),"function"==typeof this.onBegin&&this.onBegin(e)},Tt.prototype._strokeUpdate=function(e){var t=e.clientX,n=e.clientY,r=this._createPoint(t,n),i=this._data[this._data.length-1],o=i&&i[i.length-1],a=o&&r.distanceTo(o)<this.minDistance;if(!o||!a){var s=this._addPoint(r),u=s.curve,c=s.widths;u&&c&&this._drawCurve(u,c.start,c.end),this._data[this._data.length-1].push({x:r.x,y:r.y,time:r.time,color:this.penColor})}},Tt.prototype._strokeEnd=function(e){var t=this.points.length>2,n=this.points[0];if(!t&&n&&this._drawDot(n),n){var r=this._data[this._data.length-1],i=r[r.length-1];n.equals(i)||r.push({x:n.x,y:n.y,time:n.time,color:this.penColor})}"function"==typeof this.onEnd&&this.onEnd(e)},Tt.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},Tt.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},Tt.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},Tt.prototype._createPoint=function(e,t,n){var r=this._canvas.getBoundingClientRect();return new kt(e-r.left,t-r.top,n||(new Date).getTime())},Tt.prototype._addPoint=function(e){var t=this.points;if(t.push(e),t.length>2){3===t.length&&t.unshift(t[0]);var n=this._calculateCurveControlPoints(t[0],t[1],t[2]).c2,r=this._calculateCurveControlPoints(t[1],t[2],t[3]).c1,i=new Dt(t[1],n,r,t[2]),o=this._calculateCurveWidths(i);return t.shift(),{curve:i,widths:o}}return{}},Tt.prototype._calculateCurveControlPoints=function(e,t,n){var r=e.x-t.x,i=e.y-t.y,o=t.x-n.x,a=t.y-n.y,s=(e.x+t.x)/2,u=(e.y+t.y)/2,c=(t.x+n.x)/2,l=(t.y+n.y)/2,d=Math.sqrt(r*r+i*i),f=Math.sqrt(o*o+a*a),g=f/(d+f),h=c+(s-c)*g,p=l+(u-l)*g,m=t.x-h,v=t.y-p;return{c1:new kt(s+m,u+v),c2:new kt(c+m,l+v)}},Tt.prototype._calculateCurveWidths=function(e){var t=e.startPoint,n=e.endPoint,r={start:null,end:null},i=this.velocityFilterWeight*n.velocityFrom(t)+(1-this.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(i);return r.start=this._lastWidth,r.end=o,this._lastVelocity=i,this._lastWidth=o,r},Tt.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)},Tt.prototype._drawPoint=function(e,t,n){var r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1},Tt.prototype._drawCurve=function(e,t,n){var r=this._ctx,i=n-t,o=Math.floor(e.length());r.beginPath();for(var a=0;a<o;a+=1){var s=a/o,u=s*s,c=u*s,l=1-s,d=l*l,f=d*l,g=f*e.startPoint.x;g+=3*d*s*e.control1.x,g+=3*l*u*e.control2.x,g+=c*e.endPoint.x;var h=f*e.startPoint.y;h+=3*d*s*e.control1.y,h+=3*l*u*e.control2.y,h+=c*e.endPoint.y;var p=t+c*i;this._drawPoint(g,h,p)}r.closePath(),r.fill()},Tt.prototype._drawDot=function(e){var t=this._ctx,n="function"==typeof this.dotSize?this.dotSize():this.dotSize;t.beginPath(),this._drawPoint(e.x,e.y,n),t.closePath(),t.fill()},Tt.prototype._fromData=function(e,t,n){for(var r=0;r<e.length;r+=1){var i=e[r];if(i.length>1)for(var o=0;o<i.length;o+=1){var a=i[o],s=new kt(a.x,a.y,a.time),u=a.color;if(0===o)this.penColor=u,this._reset(),this._addPoint(s);else if(o!==i.length-1){var c=this._addPoint(s),l=c.curve,d=c.widths;l&&d&&t(l,d,u)}}else this._reset(),n(i[0])}},Tt.prototype._toSVG=function(){var e=this,t=this._data,n=this._canvas,r=Math.max(window.devicePixelRatio||1,1),i=n.width/r,o=n.height/r,a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"width",n.width),a.setAttributeNS(null,"height",n.height),this._fromData(t,(function(e,t,n){var r=document.createElement("path");if(!(isNaN(e.control1.x)||isNaN(e.control1.y)||isNaN(e.control2.x)||isNaN(e.control2.y))){var i="M "+e.startPoint.x.toFixed(3)+","+e.startPoint.y.toFixed(3)+" C "+e.control1.x.toFixed(3)+","+e.control1.y.toFixed(3)+" "+e.control2.x.toFixed(3)+","+e.control2.y.toFixed(3)+" "+e.endPoint.x.toFixed(3)+","+e.endPoint.y.toFixed(3);r.setAttribute("d",i),r.setAttribute("stroke-width",(2.25*t.end).toFixed(3)),r.setAttribute("stroke",n),r.setAttribute("fill","none"),r.setAttribute("stroke-linecap","round"),a.appendChild(r)}}),(function(t){var n=document.createElement("circle"),r="function"==typeof e.dotSize?e.dotSize():e.dotSize;n.setAttribute("r",r),n.setAttribute("cx",t.x),n.setAttribute("cy",t.y),n.setAttribute("fill",t.color),a.appendChild(n)}));var s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 '+i+" "+o+'" width="'+i+'" height="'+o+'">',u=a.innerHTML;if(void 0===u){var c=document.createElement("dummy"),l=a.childNodes;c.innerHTML="";for(var d=0;d<l.length;d+=1)c.appendChild(l[d].cloneNode(!0));u=c.innerHTML}return"data:image/svg+xml;base64,"+btoa(s+u+"</svg>")},Tt.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,(function(e,n){return t._drawCurve(e,n.start,n.end)}),(function(e){return t._drawDot(e)})),this._data=e},Tt.prototype.toData=function(){return this._data};const Nt=Tt;var Ct=n(9473),jt=n.n(Ct);const Mt=["canvasProps","clearOnResize"];function Ft(){return Ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ft.apply(null,arguments)}function Lt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Bt extends a.Component{constructor(...e){super(...e),Lt(this,"_sigPad",null),Lt(this,"_excludeOurProps",(()=>{const e=this.props,{canvasProps:t,clearOnResize:n}=e;return function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Mt)})),Lt(this,"getCanvas",(()=>this._canvas)),Lt(this,"getTrimmedCanvas",(()=>{const e=document.createElement("canvas");return e.width=this._canvas.width,e.height=this._canvas.height,e.getContext("2d").drawImage(this._canvas,0,0),jt()(e)})),Lt(this,"getSignaturePad",(()=>this._sigPad)),Lt(this,"_checkClearOnResize",(()=>{this.props.clearOnResize&&this._resizeCanvas()})),Lt(this,"_resizeCanvas",(()=>{const e=this.props.canvasProps||{},{width:t,height:n}=e;if(t&&n)return;const r=this._canvas,i=Math.max(window.devicePixelRatio||1,1);t||(r.width=r.offsetWidth*i),n||(r.height=r.offsetHeight*i),r.getContext("2d").scale(i,i),this.clear()})),Lt(this,"on",(()=>(window.addEventListener("resize",this._checkClearOnResize),this._sigPad.on()))),Lt(this,"off",(()=>(window.removeEventListener("resize",this._checkClearOnResize),this._sigPad.off()))),Lt(this,"clear",(()=>this._sigPad.clear())),Lt(this,"isEmpty",(()=>this._sigPad.isEmpty())),Lt(this,"fromDataURL",((e,t)=>this._sigPad.fromDataURL(e,t))),Lt(this,"toDataURL",((e,t)=>this._sigPad.toDataURL(e,t))),Lt(this,"fromData",(e=>this._sigPad.fromData(e))),Lt(this,"toData",(()=>this._sigPad.toData()))}componentDidMount(){this._sigPad=new Nt(this._canvas,this._excludeOurProps()),this._resizeCanvas(),this.on()}componentWillUnmount(){this.off()}componentDidUpdate(){Object.assign(this._sigPad,this._excludeOurProps())}render(){const{canvasProps:e}=this.props;return s().createElement("canvas",Ft({ref:e=>{this._canvas=e}},e))}}Lt(Bt,"propTypes",{velocityFilterWeight:St().number,minWidth:St().number,maxWidth:St().number,minDistance:St().number,dotSize:St().oneOfType([St().number,St().func]),penColor:St().string,throttle:St().number,onEnd:St().func,onBegin:St().func,canvasProps:St().object,clearOnResize:St().bool}),Lt(Bt,"defaultProps",{clearOnResize:!0});const{useEffect:It,useState:At}=wp.element,{__:Wt}=wp.i18n,Ut=({signatureData:e,sigPadRef:t,actionBarRef:n,onEndStroke:r,height:i=150,width:o=600,dotSize:a=1,penColor:s="#000",backgroundColor:u="#FFF",nameType:c})=>{const[l,d]=At(e.data.length>0),[f,g]=At({width:o,height:i}),h=()=>{const e=n.current.offsetWidth;0!==e&&g(e>=o?{width:o,height:i}:{width:e,height:e*i/o})};return It((()=>(h(),window.addEventListener("resize",h),()=>window.removeEventListener("resize",h))),[]),It((()=>d(e.data.length>0)),[e]),React.createElement("div",{className:lt()("legalsigning-field-signature__draw",!l&&"legalsigning-field-signature__draw--empty")},React.createElement("div",{className:"legalsigning-field-signature__draw-label"},c===Ye.RV&&Wt("Draw Your Signature","forgravity_legalsigning"),c===Ye.x3&&Wt("Draw Your Initials","forgravity_legalsigning")),React.createElement("div",{className:"legalsigning-field-signature__draw-canvas"},React.createElement(Bt,{ref:e=>t.current=e,canvasProps:{width:f.width,height:f.height,style:{width:`${f.width}px`}},dotSize:Number(a),minWidth:.5*Number(a),maxWidth:1.5*Number(a),backgroundColor:u,penColor:s,onEnd:r,onBegin:()=>d(!0)})))};function zt(){return zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zt.apply(null,arguments)}const{useEffect:Gt,useRef:$t,useState:qt}=wp.element,{__:Vt}=wp.i18n,Ht=({currentSignatureMode:e,availableModes:t,fieldId:n,nameType:r,onCancel:i,onSigned:o,signatureData:a,sigPadConfig:s,sigPadRef:u})=>{const c=$t(null),[l,d]=qt(window.scrollY),[f,g]=qt(!1),[h,p]=qt(e),[m,v]=qt((()=>a.data?a:Xe(Ye.gh))),[y,b]=qt((()=>a.name?a:Xe(Ye.GB)));Gt((()=>(document.documentElement.classList.add("legalsigning-modal"),document.body.style.top=`-${l}px`,w(),()=>{document.documentElement.classList.remove("legalsigning-modal"),document.body.style.top="",window.scrollTo(0,parseInt(l||"0"))})),[]),Gt((()=>{switch(h){case Ye.gh:g(0===m.data.length);break;case Ye.GB:g(!y.name.trim().length>0)}}),[m,h,y]),Gt((()=>w()),[h]);const _=()=>{switch(h){case Ye.gh:return m;case Ye.GB:return y}},w=()=>{u.current&&m.data&&u.current.fromData(m.data)};return React.createElement("div",{className:"legalsigning-field-signature__container gform-theme-no-framework"},React.createElement("header",{className:"legalsigning-field-signature__header"},Vt("Adopt a Signature","forgravity_legalsigning")),React.createElement(bt,{actionBarRef:c,signatureData:_(),setSignatureData:(()=>{switch(h){case Ye.gh:return v;case Ye.GB:return b}})(),signatureMode:h,availableModes:t,canTakeAction:f,onChangeMode:e=>p(e),onReset:()=>{u.current&&u.current.clear(),v(Xe(Ye.gh)),b(Xe(Ye.GB))}}),h===Ye.GB&&React.createElement(Pt,zt({fieldId:n,signatureData:y,nameType:r,onChange:b},s)),h===Ye.gh&&React.createElement(Ut,zt({},s,{actionBarRef:c,signatureData:m,nameType:r,sigPadRef:u,onEndStroke:()=>v({data:u.current.toData(),image:u.current.toDataURL()})})),React.createElement("aside",{className:"legalsigning-field-signature__disclaimer"},Vt("By selecting Adopt and Sign, I agree that the signature will be the electronic representation of my signature.","forgravity_legalsigning")),React.createElement("footer",{className:"legalsigning-field-signature__footer"},React.createElement("button",{type:"button",className:"legalsigning-field-signature__footer-button legalsigning-field-signature__footer-button--secondary",onClick:()=>i()},Vt("Cancel","forgravity_legalsigning")),React.createElement("button",{type:"button",className:"legalsigning-field-signature__footer-button legalsigning-field-signature__footer-button--primary",onClick:()=>o(_()),disabled:f},Vt("Adopt and Sign","forgravity_legalsigning"))))},{__:Yt}=wp.i18n,Jt=({onReset:e,onEdit:t,nameType:n,signatureMode:r,signatureData:i,sigPadConfig:o})=>{let a={};return r===Ye.GB&&(a={backgroundColor:o.backgroundColor,color:o.penColor,height:`${o.height}px`,width:`${o.width}px`}),React.createElement("div",{className:"legalsigning-field-signature__signed legalsigning-field-signature__signed--editable gform-theme__no-reset--el gform-theme__no-reset--children"},React.createElement("div",{className:"legalsigning-field-signature__signed-wrapper"},React.createElement("button",{type:"button",className:"legalsigning-field-signature__signed-reset gform-theme-no-framework",onClick:e},React.createElement("span",{className:"screen-reader-text"},Yt("Reset Signature","forgravity_legalsigning")),ft),React.createElement("span",{className:"legalsigning-field-signature__signed-by"},n===Ye.RV&&Yt("Signed By","forgravity_legalsigning"),n===Ye.x3&&Yt("Initialed By","forgravity_legalsigning")),React.createElement("div",{className:lt()("legalsigning-field-signature__signed-signature","type"===r&&`legalsigning-field-signature__signed-signature--${i.font}`),style:a},(()=>{switch(r){case Ye.gh:return React.createElement("img",{src:i.image,alt:Yt("Signature Preview","forgravity_legalsigning")});case Ye.GB:return i.name}})()),React.createElement("span",{className:"legalsigning-field-signature__signed-verification"},Yt("Signed using Legal Signing","forgravity_legalsigning"))),React.createElement("button",{type:"button",className:"legalsigning-field-signature__signed-edit gform-theme-no-framework",onClick:t},Yt("Edit","forgravity_legalsigning")))};var Kt=n(9127);const{useDispatch:Qt,useSelect:Xt}=wp.data,{createRef:Zt,useEffect:en,useRef:tn,useState:nn}=wp.element,{__:rn}=wp.i18n,on=({fieldId:e,dataInput:t,dotSize:n=1,backgroundColor:r="#FFF",penColor:i="#000",width:o=600,height:a=150,availableModes:s=[Ye.gh,Ye.GB],nameType:u=Ye.RV})=>{const c=Zt(),l=tn(t),d=Xt((e=>e(Ye.Ui).getSignature(u))),{setSignature:f}=Qt(Ye.Ui),[g,h]=nn(s.includes(Ye.D4)?Ye.D4:s[0]),[p,m]=nn(Xe(g)),[v,y]=nn(!1),[b,_]=nn((()=>p.data?p.data.length>0:p.name.length>0)),[w,E]=nn({backgroundColor:r,dotSize:n,penColor:i,height:a,width:o}),x=e=>e.data?Ye.gh:Ye.GB,O=d.data&&s.includes(Ye.gh)||d.name&&s.includes(Ye.GB),P=(e="")=>((e,t="")=>{"object"==typeof t&&(t=JSON.stringify(t)),e.value=t})(l.current,e);en((()=>{const e=(e=>{if(0===e.value.trim().length)return!1;try{return JSON.parse(e.value)}catch(e){return!1}})(l.current),t=!!e&&x(e);e&&(m(e),h(t),_(!0),0===Object.keys(d).length&&f(u,e))}),[]),en((()=>{if(!b||!O)return;const e=x(d);m(d),h(e),P(d)}),[d]);const R=React.createElement("button",{type:"button",key:`legalsigning-field-signature-adopt-${e}`,className:"legalsigning-field-signature__adopt gform-theme-no-framework",onClick:()=>{(d.image||d.name)&&O?(P(d),m(d),h(x(d)),_(!0)):y(!0)}},React.createElement("span",null,rn("Click to Sign","forgravity_legalsigning"))),S=React.createElement(Jt,{key:`legalsigning-field-signature-preview-${e}`,nameType:u,signatureMode:g,signatureData:p,sigPadConfig:w,onReset:()=>{P(),_(!1),y(!1)},onEdit:()=>{y(!0)}});return v?[b&&S,!b&&R,React.createElement(ut,{id:"legalsigning-field-signature__modal",key:`legalsigning-field-signature-modal-${e}`,appendTo:"body"},React.createElement(Ve,null,React.createElement(Ht,{currentSignatureMode:g,availableModes:s,fieldId:e,nameType:u,onCancel:()=>{y(!1)},onSigned:e=>{m(e),h(x(e)),f(u,e),_(!0),y(!1)},signatureData:p,sigPadRef:c,sigPadConfig:w})))]:b?S:R};document.addEventListener("DOMContentLoaded",(()=>{jQuery(document).on("gform_post_render",Kt.A)}))},9127:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(6395),i=n(4064);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o.apply(null,arguments)}const a=()=>{const e=document.querySelectorAll(".legalsigning-field-signature");if(0!==e.length)for(let t=0;t<e.length;t++){const n=e[t],a=n.dataset.config?JSON.parse(n.dataset.config):{},s=n.parentNode.id.split("_").at(-1);delete n.dataset.config,(0,i.A)(React.createElement(r.D,o({},a,{fieldId:s,key:`signature-field-${s}`,dataInput:n.nextSibling})),n)}}},4064:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});const{createRoot:r,render:i}=wp.element,o=(e,t)=>{t&&(r?r(t).render(e):i(e,t))}},3368:(e,t)=>{var n;
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=a(e,o(n)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=a(t,n));return t}function a(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(n=function(){return i}.apply(t,[]))||(e.exports=n)}()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};n(6395)})();