@bolttech/form-engine 0.10.5 → 0.10.6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.10.6](http://bitbucket.org/gofrank/bolttech-frontend/compare/form-engine-0.10.5...form-engine-0.10.6) (2024-02-05)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add on click event to another flows ([8bbe414](http://bitbucket.org/gofrank/bolttech-frontend/commit/8bbe41432b884c7d3f136363ea74cca6fbd3416e))
11
+
5
12
  ## [0.10.5](http://bitbucket.org/gofrank/bolttech-frontend/compare/form-engine-0.10.4...form-engine-0.10.5) (2024-02-05)
6
13
 
7
14
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Achieve form logic re-usage with forms expressed in json format.
4
4
 
5
- > stable version 0.10.5
5
+ > stable version 0.10.6
6
6
 
7
7
  ---
8
8
 
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("react/jsx-runtime"),e=require("react");require("./types.js");var r=require("credit-card-type");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(e),i=n(r),a=function(t,e,r){return e?t+"/"+e+(r?"/"+r:""):t},u=function(t){return new RegExp("^(".concat(t,").*$"),"g")},c={ON_FIELD_VALIDATION_TOGGLE:"ON_FIELD_VALIDATION_TOGGLE",ON_FIELD_MOUNT:"ON_FIELD_MOUNT",ON_FIELD_CHANGE:"ON_FIELD_CHANGE",ON_FIELD_BLUR:"ON_FIELD_BLUR",ON_FIELD_FOCUS:"ON_FIELD_FOCUS",ON_FIELD_REHYDRATE:"ON_FIELD_REHYDRATE",ON_FIELD_CLEARED:"ON_FIELD_CLEARED",ON_FIELD_CLICK:"ON_FIELD_CLICK",ON_FIELD_KEYUP:"ON_FIELD_KEYUP",ON_FIELD_KEYDOWN:"ON_FIELD_KEYDOWN",AFTER_FIELD_API_CALL:"AFTER_FIELD_API_CALL",RUN_FIELD_VALIDATIONS:"RUN_FIELD_VALIDATIONS",RUN_FIELD_FORMATTERS:"RUN_FIELD_FORMATTERS",RUN_FIELD_MASKS:"RUN_FIELD_MASKS",ON_SCOPE_CHANGE:"ON_SCOPE_CHANGE",ON_FORM_REHYDRATE:"ON_FORM_REHYDRATE",ON_FORM_SUBMIT:"ON_FORM_SUBMIT",ON_FORM_MOUNT:"ON_FORM_MOUNT",ON_FORM_UN_MOUNT:"ON_FORM_UN_MOUNT",ON_FORM_DATA:"ON_FORM_DATA",NAVIGATE_STEP:"NAVIGATE_STEP",NAVIGATE_STEP_FORWARD:"NAVIGATE_STEP_FORWARD",NAVIGATE_STEP_BACK:"NAVIGATE_STEP_BACK",VALIDATE_FORM:"VALIDATE_FORM",LOG:"LOG"},l="default_form_id",s="default_form_hook_id";function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var v,p,y=function(){var t=f(e.useState(0),2),r=t[0],n=t[1];return[r,function(){return n((function(t){return t+1}))}]};function h(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function b(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function m(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function g(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function E(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new N(o||[]);return n(a,"_invoke",{value:S(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function v(){}function p(){}var y={};c(y,i,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(I([])));b&&b!==e&&r.call(b,i)&&(y=b);var m=p.prototype=d.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==O(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return F()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function w(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:F}}function F(){return{value:void 0,done:!0}}return v.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:v,configurable:!0}),v.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==O(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===O(i)?i:String(i)),n)}var o,i}var S,w=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),v.set(this,void 0),p.set(this,{}),this.debounceTime=50,this.debounce=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.debounceTime;return b(r,void 0,void 0,E().mark((function r(){var n=this;return E().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r){m(n,p,"f")[t]&&clearTimeout(m(n,p,"f")[t]),m(n,p,"f")[t]=setTimeout((function(){clearTimeout(m(n,p,"f")[t]),r(t())}),e)})));case 1:case"end":return r.stop()}}),r)})))},g(this,v,e,"f"),this.publish=this.publish.bind(this),this.subscribe=this.subscribe.bind(this),this.debounce=this.debounce.bind(this),this.subscribeBulk=this.subscribeBulk.bind(this),this.subscriptions={}}var e,r,n;return e=t,r=[{key:"subscribe",value:function(t,e){this.subscriptions[t]&&this.subscriptions[t](),this.subscriptions[t]=m(this,v,"f").subscribe(t,e)}},{key:"subscribeBulk",value:function(t,e){var r=this;t.forEach((function(t){return r.subscribe(t,e)}))}},{key:"publish",value:function(t,e){m(this,v,"f").publish(t,e)}},{key:"publishFor",value:function(t){var e=this;return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(e,void 0,void 0,E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m(this,v,"f").publish(t,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}}},{key:"logError",value:function(t,e,r,n){m(this,v,"f").logError(t,e,r,n)}},{key:"logInfo",value:function(t,e,r,n){m(this,v,"f").logInfo(t,e,r,n)}}],r&&_(e.prototype,r),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function A(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function I(t){var e=function(t,e){if("object"!==j(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===j(e)?e:String(e)}function F(t,e){return F=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},F(t,e)}function L(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=x(t);if(e){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===j(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return k(t)}(this,r)}}function k(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}v=new WeakMap,p=new WeakMap;var D=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&F(t,e)}(i,w);var e,r,n,o=L(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),S.set(k(e),{global:{},api:{},hooks:{},configs:{},fields:{}}),e}return e=i,r=[{key:"scope",get:function(){return m(this,S,"f")||{}}},{key:"getGlobalScope",value:function(t,e){return t&&!e&&this.scope[t]?this.scope[t]:t&&e&&this.scope[t]?this.scope[t][e]:m(this,S,"f")}},{key:"initialScope",set:function(t){g(this,S,t||m(this,S,"f"),"f")}},{key:"globalScope",set:function(t){var e=t.namespace,r=t.key,n=t.data;r||(m(this,S,"f")[e]=n),r&&!m(this,S,"f")[e]&&(m(this,S,"f")[e]=A({},r,n)),m(this,S,"f")[e]&&r&&(m(this,S,"f")[e]=Object.assign(Object.assign({},m(this,S,"f")[e]),A({},r,n)));var o=r?a("ON_SCOPE_CHANGE",e,r):u(a("ON_SCOPE_CHANGE",e,r));this.publish(o,{scope:this.scope,namespace:e,key:r}),this.publish("ON_SCOPE_CHANGE")}}],r&&N(e.prototype,r),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function P(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==T(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===T(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t){return function(t){if(Array.isArray(t))return V(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||M(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=M(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function M(t,e){if(t){if("string"==typeof t)return V(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}S=new WeakMap;var G={BEGIN:"${",END:"}",DEFAULT_SPLITTER:"||"},U=function(t){return/\$\{(.*)\}.*/g.test(t)},B="varOps.",H=")",Y="(",$=",",z=function(t){return t.includes(B)},K=function(t,e,r){var n=(t=t.toString()).lastIndexOf(G.BEGIN);if(-1===n)return t;var o=t.substring(n+G.BEGIN.length,t.length),i=o.substring(0,o.indexOf(G.END)),a=i.length,u="",c=i.split(G.DEFAULT_SPLITTER);if(c.length>1){i=c[0];var l,s=R(c);try{for(s.s();!(l=s.n()).done;){var f=l.value;if(f.includes("api")||f.includes("global")||f.includes("fields")||f.includes("hooks")||f.includes("configs")){var d=tt(r.scope.getGlobalScope(),f);d&&(u=d)}else u=f}}catch(t){s.e(t)}finally{s.f()}}var v=tt(e.scope.getGlobalScope(),i),p=void 0===v?u:v;if("string"!=typeof p&&0===n)return p;try{p=JSON.stringify(p).replace(/^"(.*)"$/,"$1")}catch(t){}return t.substring(0,n)+p+t.substring(n+a+G.BEGIN.length+G.END.length,t.length)},W=Object.freeze({__proto__:null,template:G,extractTargetString:K,handler:function(t){var e=t.field,r=t.form,n=function(){if(e){var t=e.component,r=t.children,n=t.wrapper,o=h(t,["children","wrapper"]),a=Object.assign({},i(o));e.scopedComponent=Object.assign(Object.assign(Object.assign({},o),a),{children:r,wrapper:n})}},o=function t(o){var i=(o=o.toString()).lastIndexOf(G.BEGIN);if(-1===i)return o;var u=o.substring(i+G.BEGIN.length,o.length),c=u.substring(0,u.indexOf(G.END)),l=c.length,s="",f=c.split(G.DEFAULT_SPLITTER);if(f.length>1){c=f[0];var d,v=R(f);try{for(v.s();!(d=v.n()).done;){var p=d.value;if(p.includes("api")||p.includes("global")||p.includes("fields")||p.includes("hooks")||p.includes("configs")){var y=tt(e.scope.getGlobalScope(),p);y&&(s=y)}else s=p}}catch(t){v.e(t)}finally{v.f()}}e&&function(t){var r,o,i,u,c=!(null===(u=null===(i=null===(o=null===(r=e.scope.scope.configs)||void 0===r?void 0:r.observables)||void 0===o?void 0:o.templates)||void 0===i?void 0:i.exclude)||void 0===u?void 0:u.includes(e.component.name)),l=t[0].split(".");c&&e.subscribe(a("ON_SCOPE_CHANGE",l[0],l[1]),(function(){n(),e.rehydrate()}))}(f);var h=tt(r.scope.getGlobalScope(),c),b=void 0===h?s:h;if("string"!=typeof b&&0===i)return b;if(!b&&!/^\$\{.*\}$/.test(o))return o.substring(0,i)+o.substring(o.indexOf(G.BEGIN),o.lastIndexOf(G.END)+1);try{b=JSON.stringify(b).replace(/^"(.*)"$/,"$1")}catch(t){}var m=o.substring(0,i)+b+o.substring(i+l+G.BEGIN.length+G.END.length,o.length);return z(m)&&!U(m)?m.replace(/([^\s]+)/g,(function(t){if(!z(t))return t;var e=function(t){return jt[t.split(B)[1].split(Y)[0]]}(t);return e?e.apply(void 0,C(function(t){return t.split(B)[1].split(Y)[1].split(H)[0].split($)}(t))):void 0})):t(m)},i=function t(e){if("string"==typeof e)return o(e);if("number"==typeof e)return e;var r=Object.assign({},e);return Object.keys(r).reduce((function(e,n){if(null===r[n])return e;if(Array.isArray(r[n]))return Object.assign(Object.assign({},e),P({},n,r[n].map(t)));if("object"===T(r[n]))return Object.assign(Object.assign({},e),P({},n,Object.assign({},t(Object.assign({},r[n])))));if("string"!=typeof r[n])return Object.assign(Object.assign({},e),P({},n,r[n]));if(!U(r[n]))return Object.assign(Object.assign({},e),P({},n,r[n]));var i=o(r[n]);try{at(i)&&(i=JSON.parse(i))}catch(t){}return Object.assign(Object.assign({},e),P({},n,i))}),{})};n(),function(){var t=r.schema||{};t.components;var e=h(t,["components"]),n=i(e);r.scopedSchema=n,r.rehydrate()}()}});function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function q(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Q(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==J(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===J(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var X=function(t,e,r,n,o){var i=function(t){return r.constructor(t)},a=e.split(".");if(1===a.length)return Object.assign(Object.assign({},t),Q({},e,i(K(r,n,o))));return function t(e,a){var u=q(e);u.splice(0,1);var c=1!==e.length?t(u,a?a[e[0]]:{}):i(K(r,n,o));return Object.assign(Object.assign({},a),Q({},e[0],c))}(a,t)},tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split(".").reduce((function(t,e){return(t||{})[e]}),t)};function et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var nt=function(t,e){var r=ot(t.toString()),n=i.default(r);return[(null==e?void 0:e.length)?null==n?void 0:n.filter((function(t){var r=t.type;return e.some((function(t){return t===r}))}))[0]:n[0],r]},ot=function(t){return null==t?void 0:t.replace(/ /g,"")},it=function(t,e){return e?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.reduce((function(t,r,n){var o=et(t,2),i=o[0],a=o[1],u=r-(e[n-1]||0);return["".concat(i,"([0-9]{0,").concat(u,"})"),"".concat(a,"$").concat(n+1," ")]}),["",""]),n=et(r,2),o=n[0],i=n[1];return t.replace(new RegExp(o),i).trim()}(t.slice(0,null==e?void 0:e.lengths[0]),e.gaps):t.slice(0,19)};function at(t){if("string"!=typeof t)return!1;try{var e=JSON.parse(t),r=Object.prototype.toString.call(e);return"[object Object]"===r||"[object Array]"===r}catch(t){return!1}}function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ct(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ct(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var lt=function(t){var e=t.value,r=t.formatterValue;if(!e)return e;var n="",o=0;return r.forEach((function(t,i){var a=0===i?i:r[i-1].position+1;e[t.position]==t.value&&o++,n+=e.slice(a,t.position)})),n+=e.slice(n.length+o)},st={splitter:function(t){var e=t.value,r=t.formatterValue;if(!e)return e;var n=lt({value:e,formatterValue:r});return r.forEach((function(t){t.position>=e.length||(n=n.slice(0,t.position)+t.value+n.slice(t.position,null==n?void 0:n.length))})),n},undo_splitter:lt,capitalize:function(t){var e=t.value;return e?e.charAt(0).toUpperCase()+e.slice(1):e},upperCase:function(t){var e=t.value;return e?e.toUpperCase():e},gapsCreditCard:function(t){var e=t.value,r=t.formatterValue;if(e){var n=ut(nt(e,r),2),o=n[0],i=n[1];return it(i,o)}},onlyNumbers:function(t){return t.value.replace(/([^\d])+/gim,"")},onlyLetters:function(t){return t.value.replace(/([0-9:\s/-])+/g,"")},regex:function(t){var e=t.value,r=t.formatterValue;return e.replace(new RegExp(r,"g"),"")}},ft=function(t,e,r){var n=t;return Object.keys(e).forEach((function(t){var o=e[t],i=st[r?"undo_".concat(t):t];i&&(n=i({value:n,formatterValue:o}))})),n},dt=function(t){var e=t.value,r=void 0===e?"":e,n=t.maskValue,o=r;return n.forEach((function(t){var e=t.to,n=void 0===e?o.length:e,i=t.mask,a=t.from;if(!(n>r.length-1)){0===a&&(a=1);var u=new Array(n-a+2).join(i);o=o.slice(0,a-1)+u+o.slice(n)}})),o},vt={generic:dt,cardNumber:function(t){var e=t.value;return dt({value:e,maskValue:[{from:1,to:4,mask:"x"},{from:6,to:9,mask:"x"},{from:11,to:14,mask:"x"},{from:16,to:19,mask:"x"}]})},hideCardNumber:function(t){var e=t.value;return dt({value:e,maskValue:[{from:1,to:4,mask:"x"},{from:6,to:9,mask:"x"},{from:11,to:14,mask:"x"},{from:16,to:19,mask:"x"}]})},cardMask:function(t){return t.value.replace(/[^\dA-Z]/g,"").replace(/(.{4})/g,"$1 ").trim()},cardDate:function(t){var e=t.value.replace(/\D/g,""),r=e.slice(0,2);return e.length>=5?"".concat(r,"/").concat(e.slice(2,4)):e.length>=3?"".concat(r,"/").concat(e.slice(2)):e},currencyMask:function(t){var e=t.value,r=void 0===e?"":e,n=t.maskValue,o=r.replace(/[^0-9]/g,"");return new Intl.NumberFormat(n.locale,{minimumFractionDigits:0,maximumFractionDigits:0,style:"currency",currency:n.currency}).format(+o)},feinMask:function(t){var e=t.value.replace(/\D/g,""),r=e.slice(0,2);return e.length>=5?"".concat(r,"-").concat(e.slice(2,9)):e.length>=3?"".concat(r,"-").concat(e.slice(2)):e},replaceAll:function(t){var e=t.value,r=void 0===e?"":e,n=t.maskValue;return n&&"string"==typeof r?("number"==typeof n&&(n=null==n?void 0:n.toString()),new Array(r.length+1).join(n)):r}};function pt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==yt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===yt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||bt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(t,e){if(t){if("string"==typeof t)return mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mt(t,e):void 0}}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gt=function(t){var e=t.value,r=t.validationValue,n=new RegExp(r);return{fail:!n.test(e)}},Ot=function(t){var e=t.value,r=void 0===e?"":e,n=t.validationValue.some((function(t){var e=t.to,n=t.from,o=t.validations,i=r.substring(e,n);return wt(St(i,o))}));return{fail:n}},Et=function(t){var e,r,n,o,i,a=t.value,u=void 0===a?"":a,c=t.validationValue;if(!(null===(e=null==c?void 0:c.target)||void 0===e?void 0:e.value)&&!(null===(r=null==c?void 0:c.origin)||void 0===r?void 0:r.intervals))return{fail:!1};var l,s={DDMMYYYY:function(t){var e=t.split(t.includes("/")?"/":"-");return"".concat(e[1],"/").concat(e[0],"/").concat(e[2])},YYYYMMDD:function(t){var e=t.split(t.includes("/")?"/":"-");return"".concat(e[1],"/").concat(e[2],"/").concat(e[0])},YYYYDDMM:function(t){var e=t.split(t.includes("/")?"/":"-");return"".concat(e[2],"/").concat(e[1],"/").concat(e[0])},MMDDYYYY:function(t){return t},timestamp:function(t){return new Date(t).toString()}},f=c.origin.value||u,d=new Date(s[null==c?void 0:c.origin.format](f).toString()),v=new Date;if((null===(n=null==c?void 0:c.target)||void 0===n?void 0:n.format)&&(v=l=new Date(s[null===(o=null==c?void 0:c.target)||void 0===o?void 0:o.format](c.target.value).toString())),c.origin.intervals){v=function(t,e){var r={years:function(t,e){return new Date(t.setUTCFullYear(t.getUTCFullYear()+e))},months:function(t,e){return new Date(t.setUTCMonth(t.getUTCMonth()+e))},days:function(t,e){return new Date(t.setDate(t.getUTCDate()+e))}};return Object.keys(e).reduce((function(t,n){return r[n](t,e[n])}),new Date(t))}(d,c.origin.intervals);var p=new Date;(null===(i=c.target)||void 0===i?void 0:i.value)&&l&&(p.setDate(l.getDate()),p.setMonth(l.getMonth())),d=new Date("".concat(p.getUTCMonth()+1,"/").concat(p.getUTCDate(),"/").concat(p.getUTCFullYear()))}if(c.onlyValidDate&&(!(v instanceof Date&&isFinite(v))||!(v instanceof Date&&isFinite(d))||f.length<8))return{fail:!0};var y=d.getTime(),h=v.getTime();return{fail:{">":y>h,">=":y>=h,"<":y<h,"<=":y<=h,"===":y===h,"!==":y!==h}[null==c?void 0:c.operator]}},_t={between:function(t){var e,r=t.value,n=t.validationValue,o=!1;if(!(2==(null===(e=null==n?void 0:n.dates)||void 0===e?void 0:e.length)||(null==n?void 0:n.start)&&(null==n?void 0:n.end)))return{fail:!1};if(n.dates){var i,a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=bt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(n.dates);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(Et({value:r,validationValue:u}).fail){o=!0;break}}}catch(t){a.e(t)}finally{a.f()}}else{var c=parseInt(r);n.isIncludedBoundaries?(c<n.start||c>n.end)&&(o=!0):(c<=n.start||c>=n.end)&&(o=!0)}return{fail:o}},conditions:function t(e){var r=e.value,n=void 0===r?"":r,o=e.validationValue;if(!o)return{fail:!1};var i=function(t){if(t.forceDefinedOrigin&&void 0===t.origin||t.forceDefinedTarget&&void 0===t.target)return{fail:!1};var e=void 0===t.origin?n:t.origin,r=void 0===t.target?n:t.target;return{"!==":(e||n)!==(r||n),"===":(e||n)===(r||n),"<":(e||n)<(r||n),">":(e||n)>(r||n),"<=":(e||n)<=(r||n),">=":(e||n)>=(r||n)}[t.condition]},a={and:function(){return!!o.set.every(i)},or:function(){return!!o.set.some(i)}}[o.rule]();return o.conditions&&(a="and"===o.rule?a&&t({value:n,validationValue:o.conditions}).fail:a||t({value:n,validationValue:o.conditions}).fail),{fail:a}},date:Et,length:function(t){var e=t.value,r=t.validationValue,n=e;return"string"!=typeof n&&(n=null==e?void 0:e.toString()),{fail:!e||(null==n?void 0:n.length)===r}},greaterThan:function(t){var e=t.value,r=t.validationValue;return{fail:!e||parseInt(e)<=parseInt(r)}},maxLength:function(t){var e=t.value,r=void 0===e?"":e,n=t.validationValue,o=r;return Number.isInteger(o)&&(o=r.toString()),{fail:o.length>n}},minLength:function(t){var e=t.value,r=void 0===e?"":e,n=t.validationValue,o=r;return Number.isInteger(o)&&(o=r.toString()),{fail:o.length<n}},required:function(t){var e=t.value;return{fail:t.validationValue&&!e}},value:function(t){var e=t.value;return{fail:e!==t.validationValue}},bool:function(t){var e=t.validationValue,r=!1;return"boolean"==typeof e&&(r=e),{fail:r}},regex:gt,hasNoExtraSpaces:function(t){var e=t.value;return{fail:gt({value:e,validationValue:"^[A-Za-z0-9.-]+(?: +[A-Za-z0-9.-]+)*$",errorMessage:""}).fail}},isCreditCard:function(t){var e,r,n=t.value,o=t.validationValue;if(!n)return{fail:!0};var i=ht(nt(n,o),1)[0];return{fail:!i,metadata:{typeCard:null==i?void 0:i.type,creditCardCC:null===(e=null==i?void 0:i.code)||void 0===e?void 0:e.name,creditCardCCSize:null===(r=null==i?void 0:i.code)||void 0===r?void 0:r.size}}},isCreditCardAndLength:function(t){var e=t.value,r=t.validationValue;if(!e)return{fail:!0};var n=ht(nt(e,r),2),o=n[0],i=n[1];return{fail:o&&!o.lengths.includes(i.length)}},isCreditCodeMatch:function(t){var e,r=t.value,n=t.validationValue;if(!r)return{fail:!0};var o=ht(nt(n.numberCard,n.availableOptions),1)[0];return{fail:(null===(e=null==o?void 0:o.code)||void 0===e?void 0:e.size)!==r.length}},onlyLetters:function(t){var e=t.value;return{fail:!/^[a-zA-Z\s]*$/.test(e)}},notAllowSpaces:function(t){var e=t.value;return{fail:/\s/.test(e)}},callback:function(t){var e=t.value,r=(0,t.validationValue)(e);return{message:r.errorMessage,fail:r.fail}},isNumber:function(t){var e=t.value;return{fail:!!e&&!/^[0-9\s]*$/.test(e)}},customValidation:function(t){var e=t.value,r=t.validationValue;return Ot({value:e,validationValue:r})},notEmpty:function(t){return{fail:!t.value.trim().length}},numericRange:function(t){var e=t.value,r=t.validationValue,n=String(e).replace(/[^0-9]/g,"");return{fail:!n||!Number.isInteger(parseInt(n.toString()))||+n>r.end||+n<r.start}},email:function(t){var e=t.value;return{fail:!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}},lessThan:function(t){var e=t.value,r=t.validationValue;return{fail:!e||parseInt(e)>=parseInt(r)}},sequentialNumber:function(t){var e=t.value,r=String(e).replace(/[^0-9]/g,"");return{fail:!(-1==="0123456789".indexOf(r)&&-1==="9876543210".indexOf(r))}},repeatedNumbers:function(t){var e=t.value,r=String(e).replace(/[^0-9]/g,"");return{fail:/\b(\d)\1+\b/gm.test(r)}},url:function(t){var e=t.value;return{fail:!/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/gi.test(e)}},path:function(t){var e=t.value,r=t.validationValue,n=function(t){var n=tt(e,t);if(r.preventUnMountValidation&&!(t in e))return{fail:!1};var o,i,a=St(n,r);return i={fail:!1},(o=a)?Object.keys(o).reduce((function(t,e){return o[e].fail?o[e]:t}),i):i};return Array.isArray(r.paths)?r.paths.reduce((function(t,e){var r=n(e);return r.fail?r:t}),{}):n(r.path)},isInTheList:function(t){var e=t.value,r=t.validationValue;return e&&Array.isArray(r)?{fail:!r.some((function(t){return t===e||JSON.stringify(t)===e}))}:{fail:!0}},fields:function(t){var e=t.values,r=t.validationValue;return{fail:null==r?void 0:r.set[r.rule]((function(t){var r;return wt(St(null===(r=e[t.fieldName])||void 0===r?void 0:r.value,t.validations))}))}},customNameRule:function(t){var e=t.value,r=t.validationValue;return"object"!==yt(r)?{fail:!1}:{fail:wt(St(e,r))}},exists:function(t){return{fail:!t.validationValue}}},St=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={};return Object.keys(e).forEach((function(i){var a=e[i],u=_t[i];u||(u=_t.customNameRule);var c=r[i]||r.default,l=u({value:t,validationValue:a,errorMessage:c,values:n});o=Object.assign(Object.assign({},o),pt({},i,Object.assign(Object.assign({},l),{validationValue:a,message:c})))})),o},wt=function(t){return!!t&&!!Object.keys(t).find((function(e){return t&&t[e].fail}),[])},jt=Object.freeze({__proto__:null,concatenate:function(t,e){return t+e},add:function(t,e){return((parseInt(t)||0)+(parseInt(e)||0)).toString()},subtract:function(t,e){return parseInt(t)-parseInt(e)},replaceAll:function(t,e,r){return t.replace(new RegExp(e,"g"),r)}}),At=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data;e.data.changed=!0,e.data.metadata=r.metadata,e.value=r.parsedEventValue}}),Nt=Object.freeze({__proto__:null,handler:function(t){var e,r,n,o,i,u,c,l,s=t.form,f=t.field;f.subscribe(a("ON_SCOPE_CHANGE","configs","disable"),(function(){return f.rehydrate()}));var d=f.component.props,v=(void 0===d?{}:d)[null===(e=f.mappings)||void 0===e?void 0:e.setValue],p=f.component.group&&tt(s.initialValues,f.component.group),y=tt(s.initialValues,p===(null===(r=f.component.props)||void 0===r?void 0:r.value)&&p?f.component.group:f.component.name)||v;f.value=(null===(l=null===(o=null===(n=s.formData.form)||void 0===n?void 0:n.steps)||void 0===o?void 0:o.data[null===(c=null===(u=null===(i=s.formData)||void 0===i?void 0:i.form)||void 0===u?void 0:u.steps)||void 0===c?void 0:c.index])||void 0===l?void 0:l.formatted[f.component.name])||(f.data.mounted?void 0:y),f.data.mounted=!0}}),It=Object.freeze({__proto__:null,handler:function(t){t.field.data.blured=!0}}),Ft=Object.freeze({__proto__:null,handler:function(t){var e=t.field;e.data=Object.assign(Object.assign({},e.data),{focused:!0})}});function Lt(t){return Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(t)}function kt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */kt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:E(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function v(){}function p(){}var y={};c(y,i,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(A([])));b&&b!==e&&r.call(b,i)&&(y=b);var m=p.prototype=d.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==Lt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function A(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:v,configurable:!0}),v.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(O.prototype),c(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=A,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function xt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Lt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Lt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Pt=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.form;return t.eventReducedSchema.api.forEach((function(t){var n,o=e.scope,i=St(e.data.value,t.preConditions||{},e.scopedComponent.errorMessages,null===(n=null==r?void 0:r.formData)||void 0===n?void 0:n.fields);if(!(e.fieldHasError(i)||t.blockRequestWhenInvalid&&e.fieldValidationsHaveError(!1))){t.url.includes(G.BEGIN)&&(t.url=K(t.url,r,e));var u={},c=t.url;if(t.fieldValueAsPathParams){var l,s=Dt(t.fieldValueAsPathParams);try{for(s.s();!(l=s.n()).done;){var f=l.value;Object.prototype.hasOwnProperty.call(r.fields,f)&&(c="".concat(c,"/").concat(r.fields[f].data.value))}}catch(t){s.e(t)}finally{s.f()}}if(t.fieldValueAsParams){for(var d in t.fieldValueAsParams)if(Object.prototype.hasOwnProperty.call(r.fields,d)){var v=t.fieldValueAsParams[d]||d;u=Object.assign(Object.assign({},u),xt({},v,r.fields[d].data.value))}if(c.includes("?")){var p=c.split("?"),y=p.at(1).split("&");if(c=p.at(0),y.length>1){var h,m=Dt(y);try{for(m.s();!(h=m.n()).done;){var g=h.value.split("=");u=Object.assign(Object.assign({},u),xt({},g.at(0),g.at(1)))}}catch(t){m.e(t)}finally{m.f()}}else{var O=y.at(0).split("=");u=Object.assign(Object.assign({},u),xt({},O.at(0),O.at(1)))}}var E=new URLSearchParams(u);c="".concat(c,"?").concat(E.toString())}o.globalScope={namespace:"api",key:t.scope,data:{loading:!0}},e.debounce((function(){return fetch(c,Object.assign(Object.assign({method:t.method},t.body&&{body:JSON.stringify(t.body)}),{headers:t.headers||{"Content-type":"application/json; charset=UTF-8"}})).then((function(t){var e=t.json();if(t.status>=400)throw e;return e})).then((function(e){o.globalScope={namespace:"api",key:t.scope,data:Object.assign({loading:!1,response:e},e)}})).catch((function(e){return b(void 0,void 0,void 0,kt().mark((function r(){var n;return kt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e;case 2:n=r.sent,o.globalScope={namespace:"api",key:t.scope,data:{loading:!1,error:!0,err:n}};case 4:case"end":return r.stop()}}),r)})))})).finally((function(){return e.publish(a("AFTER_FIELD_API_CALL",e.component.name))}))}),t.debounceTime||200)}}))},events:function(t){return Object.keys(t.api||{})}});function Ct(t){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(t)}function Rt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Ct(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ct(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t){return function(t){if(Array.isArray(t))return Vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Gt,Ut,Bt=Object.freeze({__proto__:null,handler:function(t){var e=t.form,r=t.field,n=function(t){var n;return Object.keys(t).reduce((function(t,n){var o,i,a,u,c,l=e.fields[n],s=l.data;if(!l||!l.data.visible||!l.data.name)return t;var f="";(null===(o=l.component)||void 0===o?void 0:o.group)&&(r&&r.component.name===l.component.name||!r&&!e.formData.formatted[l.component.group])&&(f=l.component.group);var d=f||n,v=void 0===s.value?e.initialValues[n]||(null===(i=e.schema)||void 0===i?void 0:i.formattedDataDefaults)&&(null===(a=e.schema)||void 0===a?void 0:a.formattedDataDefaults[n]):s.value;return{erroredFields:l.fieldHasError()?[].concat(Mt(t.erroredFields),[n]):t.erroredFields,predictableErroredFields:l.fieldValidationsHaveError()?[].concat(Mt(t.predictableErroredFields),[n]):t.predictableErroredFields,fields:Object.assign(Object.assign({},t.fields),Rt({},n,s)),filteredFields:(null===(c=null===(u=e.schema)||void 0===u?void 0:u.filteredFields)||void 0===c?void 0:c.includes(d))?Object.assign(Object.assign(Object.assign({},t.filteredFields),void 0===v?{}:Rt({},d,v)),f?Rt({},f,v||t.formatted[f]):{}):t.filteredFields,formatted:Object.assign(Object.assign(Object.assign({},t.formatted),void 0===(null==s?void 0:s.value)||s.ignore?{}:X(t.formatted,n,null==s?void 0:s.value,e,l)||Rt({},n,v)),f?Rt({},f,v||t.formatted[f]):{})}}),{predictableErroredFields:[],erroredFields:[],fields:{},formatted:Object.assign({},null===(n=e.schema)||void 0===n?void 0:n.formattedDataDefaults),filteredFields:{}})},o=n(e.fields),i=n(e.steps[e.step.index]||{}),a=Object.assign(Object.assign({},o),{form:{scope:e.scope.getGlobalScope(),steps:Object.assign(Object.assign({},e.step),{data:Rt({},e.step.index,i),isValid:!i.predictableErroredFields.length}),isValid:!o.predictableErroredFields.length,messages:function(t){var r;return(null===(r=e.schema)||void 0===r?void 0:r.messages)?Object.keys(e.schema.messages).reduce((function(r,n){var o,i,a,u=tt(t,n);return(null===(o=e.schema)||void 0===o?void 0:o.messages)&&(null===(i=e.schema)||void 0===i?void 0:i.messages[n])&&((null===(a=e.schema.messages[n].values)||void 0===a?void 0:a.includes(u))||e.schema.messages[n].value===u||e.schema.messages[n].required&&!u)?[].concat(Mt(r),[e.schema.messages[n].name]):r}),[]):[]}(Object.assign(Object.assign({},e.initialValues),o.formatted))}});return e.formData=a,a}}),Ht=function(t,e){var r=e.clearedValue!==t.data.value;t.value=e.clearedValue,r&&t.publish(a("ON_FIELD_CLEARED",t.component.name)),t.rehydrate()},Yt=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.form,n=t.eventReducedSchema;null==n||n.clearFields.forEach((function(t){t.fields.forEach((function(n){var o=r.fields[n];if(o){if(!t.validations)return Ht(o,t);var i=St(t.useCurrentFieldValidation?e.data.value:o.value,t.validations);o.fieldHasError(i)&&Ht(o,t)}}))}))},events:function(t){return Object.keys(t.clearFields||{})}});function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function zt(t){return function(t){if(Array.isArray(t))return Kt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==$t(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$t(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t.AND="and",t.OR="or"}(Ut||(Ut={}));var Jt=(Wt(Gt={},Ut.OR,(function(t,e){return t.fieldHasError(St(t.value,e))})),Wt(Gt,Ut.AND,(function(t,e){var r=[];for(var n in e)r.push(t.fieldHasError(St(t.value,Wt({},n,e[n]))));return r.every((function(t){return t}))})),Gt),qt=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.field;null===(e=t.eventReducedSchema.visibilityConditions)||void 0===e||e.forEach((function(t){var e=t.validations,o=t.fieldName,i=t.fieldNames,u=t.rule,c=t.showOnlyIfTrue,l=zt(i||[o]),s=u||"or";l.forEach((function(t){if(t){var o=Jt[s](n,e),i=c?!0===Jt[s](n,e):!o;r.fields[t]?(r.fields[t].visibility=i,r.fields[t].rehydrate(),r.fields[t].visibility||(r.fields[t].errors={})):n.subscribe(a("ON_FIELD_MOUNT",t),(function(){r.fields[t].visibility=i,r.fields[t].rehydrate(),r.fields[t].visibility||(r.fields[t].errors={})}))}}))}))},events:function(t){return Object.keys(t.visibilityConditions||{})}});function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}var Qt=Object.freeze({__proto__:null,handler:function(t){var e,r,n,o,i,a,u=t.field,c=t.data.event,l=void 0,s=void 0,f={number:function(){var t;return parseInt(null===(t=null==c?void 0:c.target)||void 0===t?void 0:t.value)},checkbox:function(){var t;return!!(null===(t=null==c?void 0:c.target)||void 0===t?void 0:t.checked)}};l=f[null===(e=null==c?void 0:c.target)||void 0===e?void 0:e.type]?f[null===(r=null==c?void 0:c.target)||void 0===r?void 0:r.type]():null===(n=null==c?void 0:c.target)||void 0===n?void 0:n.value,(Array.isArray(c)||"object"!==Zt(c)||"string"==typeof c||"number"==typeof c)&&(l=c),(null==c?void 0:c.id)&&(l=null==c?void 0:c.id,s=c),(null==c?void 0:c.options)&&(l=null==c?void 0:c.options);var d=(null==l?void 0:l.toString().length)<((null===(a=null===(i=null===(o=u.data)||void 0===o?void 0:o.value)||void 0===i?void 0:i.toString())||void 0===a?void 0:a.length)||0);return{parsedEventValue:l,metadata:s,isDeletingValue:d}}}),Xt=Object.freeze({__proto__:null,handler:function(t){var e=t.data,r=t.field,n=t.eventReducedSchema.formatters;n&&!e.isDeletingValue&&(r.data.value=ft(r.data.value,n))},events:function(t){return Object.keys((null==t?void 0:t.formatters)||[])}});function te(t){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(t)}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==te(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===te(i)?i:String(i)),n)}var o,i}function re(t){var e=ie();return function(){var r,n=ue(t);if(e){var o=ue(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function ne(t){var e="function"==typeof Map?new Map:void 0;return ne=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return oe(t,arguments,ue(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ae(n,t)},ne(t)}function oe(t,e,r){return oe=ie()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&ae(o,r.prototype),o},oe.apply(null,arguments)}function ie(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function ae(t,e){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ae(t,e)}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}var ce=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ae(t,e)}(i,ne(Error));var e,r,n,o=re(i);function i(t,e){var r,n=e.breaksObservingChain;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this)).breaksObservingChain=!1,r.message=t,r.breaksObservingChain=n,r}return e=i,r&&ee(e.prototype,r),n&&ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),le=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data,n=t.eventReducedSchema.formatters,o=e.scopedComponent,i=o.errorMessages,a=o.filter;if(a&&r.parsedEventValue&&!r.isDeletingValue){var u=n&&ft(r.parsedEventValue,n,!0)||r.parsedEventValue,c=St(u,a,i);if(e.fieldHasError(c))throw new ce("Filter applied ".concat(JSON.stringify(a)),{breaksObservingChain:!0})}}}),se=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.eventReducedSchema.masks;r&&(e.data.mask=(null==r?void 0:r.cleanMask)?void 0:function(t,e){var r=t;return Object.keys(e).forEach((function(t){var n=e[t],o=vt[t];o&&(r=o({value:r,maskValue:n}))})),r}(e.data.value,r))},events:function(t){return Object.keys(t.masks||{})}}),fe=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.eventReducedSchema.validations,n=t.form;if(r){var o=St(e.data.value,r,e.scopedComponent.errorMessages,n.formData.fields);e.fieldHasError(o)!==e.fieldHasError()&&e.publish("ON_FIELD_VALIDATION_TOGGLE",{field:e.data}),e.errors=e.data.visible?o:{},e.data.failedErrorMessages=e.getFieldErrorMessages(e.data)}},events:function(t){return Object.keys(t.validations||{})}}),de=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data;e.data.keyup=!0,e.value=r.parsedEventValue}}),ve=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data;e.data.keydown=!0,e.value=r.parsedEventValue}}),pe=Object.freeze({__proto__:null,handler:function(t){var e=t.form;return{setScope:function(t){return e.scope.globalScope=t}}}});function ye(t){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(t)}function he(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==ye(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ye(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var be=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.event,o=t.payload,i=(he(e={},c.NAVIGATE_STEP_BACK,r.step.index-1),he(e,c.NAVIGATE_STEP_FORWARD,r.step.index+1),e),a=r.schema.components,u=i[n],l=o.constructor===Object?a[i[n]]:"string"==typeof o?(u=a.findIndex((function(t){return t.name===o})),a.find((function(t){return t.name===o}))):(u=o,a[o]);r.step=l?Object.assign(Object.assign({},r.step),{numSteps:a.length,navigated:!!l,index:l?u:r.step.index,currentStepSchema:l||r.step.currentStepSchema}):Object.assign(Object.assign({},r.step),{navigated:!1})}});function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ge(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==me(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===me(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Oe=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.payload,o=(e=function(t){if(t&&Object.keys(t).length&&(t.scopeBlurredChildren||t.scopeChangedChildren||t.childrenScope))return Object.keys(r.fields).filter((function(e){var n;return(null==t?void 0:t.scopeBlurredChildren)&&r.fields[e].data.blured||(null==t?void 0:t.scopeChangedChildren)&&r.fields[e].data.changed||(null===(n=null==t?void 0:t.childrenScope)||void 0===n?void 0:n.includes(e))}))}(n))?Object.keys(r.fields).reduce((function(t,n){return e.includes(n)?Object.assign(Object.assign({},t),ge({},n,r.fields[n])):t}),{}):r.fields;Object.keys(o).forEach((function(t){o[t].fieldValidationsHaveError(!0)&&o[t].rehydrate()}))}});function Ee(t){return function(t){if(Array.isArray(t))return _e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return _e(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _e(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Se=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.formEventDirectives;null===(e=null==n?void 0:n.visibilityConditions)||void 0===e||e.forEach((function(t){Ee(t.fieldNames||[t.fieldName]).forEach((function(e){if(e){var n=r.fields[e];r.fields[e].visibility=null==n?void 0:n.fieldHasError(St(n.value,t.validations)),r.fields[e].rehydrate()}}))}))},events:function(t){return Object.keys((null==t?void 0:t.visibilityConditions)||{})}});function we(t){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(t)}function je(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==we(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==we(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===we(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ae(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ie="${",Fe="}",Le="||",ke=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=function t(e){var n=(e=e.toString()).lastIndexOf(Ie);if(-1===n)return e;var o=e.substring(n+Ie.length,e.length),i=o.substring(0,o.indexOf(Fe)),a=i.length,u="",c=i.split(Le);if(c.length>1){i=c[0];var l,s=Ae(c);try{for(s.s();!(l=s.n()).done;){var f=l.value;if(f.includes("api")||f.includes("global")||f.includes("fields")||f.includes("hooks")||f.includes("configs")){var d=tt(r.scope.getGlobalScope(),f);d&&(u=d)}else u=f}}catch(t){s.e(t)}finally{s.f()}}var v=tt(r.scope.getGlobalScope(),i),p=void 0===v?u:v;if("string"!=typeof p&&0===n)return p;try{p=JSON.stringify(p).replace(/^"(.*)"$/,"$1")}catch(t){}return t(e.substring(0,n)+p+e.substring(n+a+Ie.length+Fe.length,e.length))};r.scopedSchema=Object.assign(Object.assign({},r.schema),function t(e){if("string"==typeof e)return n(e);if("number"==typeof e)return e;var r=Object.assign({},e);return Object.keys(r).reduce((function(e,o){if(null===r[o])return e;if(Array.isArray(r[o]))return Object.assign(Object.assign({},e),je({},o,r[o].map(t)));if("object"===we(r[o]))return Object.assign(Object.assign({},e),je({},o,Object.assign({},t(Object.assign({},r[o])))));if("string"!=typeof r[o])return Object.assign(Object.assign({},e),je({},o,r[o]));if(!function(t){return/\$\{(.*)\}.*/g.test(t)}(r[o]))return Object.assign(Object.assign({},e),je({},o,r[o]));var i=n(r[o]);try{at(i)&&(i=JSON.parse(i))}catch(t){}return Object.assign(Object.assign({},e),je({},o,i))}),{})}({visibilityConditions:null===(e=null==r?void 0:r.schema)||void 0===e?void 0:e.visibilityConditions}))}});function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function De(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==xe(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===xe(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Te,Pe,Ce,Re,Me=function(t,e,r){var n=e();Object.keys(n).forEach((function(e){n[e].forEach((function(n){if(n.events){var o=n.events(r);if(Array.isArray(o)&&!o.includes(e))return}t.subscribe(a(e,null==r?void 0:r.name),n.handler)}))}))},Ve=function(){var t;return De(t={},"ON_FIELD_MOUNT",[W,Nt,Pt,fe,Xt,qt,Yt,se,Bt]),De(t,"ON_FIELD_CHANGE",[Qt,le,At,fe,Xt,qt,Yt,Pt,Bt,se]),De(t,"ON_FIELD_KEYUP",[Qt,le,de,fe,Xt,qt,Yt,Pt,Bt,se]),De(t,"ON_FIELD_KEYDOWN",[Qt,le,ve,fe,Xt,qt,Yt,Pt,Bt,se]),De(t,"ON_FIELD_REHYDRATE",[fe]),De(t,"ON_FIELD_CLEARED",[Xt,se,le,fe,Pt]),De(t,"ON_FIELD_BLUR",[It,Xt,se,fe,Pt,qt,Yt,Bt]),De(t,"ON_FIELD_FOCUS",[Ft,se]),De(t,"AFTER_FIELD_API_CALL",[Qt,le,fe,Xt,se,Bt,qt,Yt]),t},Ge=function(){var t;return De(t={},"ON_SCOPE_CHANGE",[ke,Se]),De(t,"ON_FORM_MOUNT",[W,pe,be,Se]),De(t,"VALIDATE_FORM",[Oe]),De(t,"ON_FORM_SUBMIT",[pe]),De(t,"ON_FORM_UN_MOUNT",[pe]),De(t,"NAVIGATE_STEP",[be]),De(t,"NAVIGATE_STEP_BACK",[be]),De(t,"NAVIGATE_STEP_FORWARD",[be]),De(t,u("ON_SCOPE_CHANGE"),[Se,W]),De(t,"ON_FORM_REHYDRATE",[Se]),De(t,"ON_FIELD_CHANGE",[Se]),t};function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function Be(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return He(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return He(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$e(n.key),n)}}function $e(t){var e=function(t,e){if("object"!==Ue(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ue(e)?e:String(e)}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Je(t);if(e){var o=Je(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return We(t)}(this,r)}}function We(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Je(t){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Je(t)}var qe,Ze,Qe,Xe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ze(t,e)}(i,w);var e,r,n,o=Ke(i);function i(t,e,r,n){var a,u,c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),a=o.call(this,t),Te.set(We(a),void 0),Pe.set(We(a),void 0),Ce.set(We(a),void 0),Re.set(We(a),void 0),a.scopedComponent=e,g(We(a),Pe,e,"f"),g(We(a),Re,r,"f"),a.scope=n,g(We(a),Te,{blured:!1,changed:!1,mounted:!1,focused:!1,errors:{},failedErrorMessages:[],visible:!(null===(u=e.state)||void 0===u?void 0:u.hidden),ignore:null===(c=e.state)||void 0===c?void 0:c.ignoreValue,name:e.name},"f"),Me(t,Ve,e),a}return e=i,r=[{key:"value",get:function(){return m(this,Re,"f").setValue&&m(this,Pe,"f").props&&this.scopedComponent.props&&void 0!==this.scopedComponent.props[m(this,Re,"f").setValue]&&this.scopedComponent.props[m(this,Re,"f").setValue]!==m(this,Pe,"f").props[m(this,Re,"f").setValue]?void 0!==m(this,Te,"f").value&&m(this,Pe,"f").props[m(this,Re,"f").setValue]!==m(this,Te,"f").value?m(this,Te,"f").value:this.scopedComponent.props[m(this,Re,"f").setValue]:m(this,Te,"f").mask||m(this,Te,"f").value},set:function(t){m(this,Te,"f").value=t,this.scope.globalScope={namespace:"fields",key:m(this,Pe,"f").name,data:m(this,Te,"f")}}},{key:"component",get:function(){return m(this,Pe,"f")}},{key:"data",get:function(){return m(this,Te,"f")},set:function(t){g(this,Te,Object.assign(Object.assign({},m(this,Te,"f")),t),"f"),this.scope.globalScope={namespace:"fields",key:m(this,Pe,"f").name,data:m(this,Te,"f")}}},{key:"visibility",set:function(t){m(this,Te,"f").visible=t}},{key:"scopedComponent",get:function(){return m(this,Ce,"f")},set:function(t){g(this,Ce,t,"f")}},{key:"errors",get:function(){return m(this,Te,"f").errors},set:function(t){m(this,Te,"f").errors=t,this.scope.globalScope={namespace:"fields",key:m(this,Pe,"f").name,data:m(this,Te,"f")}}},{key:"props",get:function(){var t,e=this;if(!this.scopedComponent.name||!m(this,Re,"f"))return this.scopedComponent.props;var r={getValue:function(t){e.publish(a("ON_FIELD_CHANGE",e.component.name),{event:t}),e.publish("ON_FIELD_CHANGE",{component:e.component.name,event:t})},onBlur:function(t){return e.publish(a("ON_FIELD_BLUR",e.component.name),{event:t})},onClick:function(t){return e.publish(a("ON_FIELD_CLICK",e.component.name),{event:t})},onFocus:function(t){return e.publish(a("ON_FIELD_FOCUS",e.component.name),{event:t})},onKeyUp:function(t){return e.publish(a("ON_FIELD_KEYUP",e.component.name),{event:t})},onKeyDown:function(t){return e.publish(a("ON_FIELD_KEYDOWN",e.component.name),{event:t})},setValue:this.value,setErrorMessage:this.getFieldErrorMessages()[0],setErrorState:this.fieldHasError()};return Object.keys(m(this,Re,"f")).reduce((function(t,n){return void 0===r[n]?t:Object.assign(Object.assign({},t),function(t,e,r){return(e=$e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},m(e,Re,"f")[n],r[n]))}),Object.assign({disabled:null===(t=this.scope.scope.configs)||void 0===t?void 0:t.disable},m(this,Ce,"f").props))}},{key:"mappings",get:function(){return m(this,Re,"f")}},{key:"getFieldErrorMessages",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m(this,Te,"f");return e.errors?Object.keys(e.errors).reduce((function(r,n){var o=e.errors;return(void 0===o?{}:o)[n].fail&&t.scopedComponent.errorMessages?[].concat(Be(r),[t.scopedComponent.errorMessages[n]||t.scopedComponent.errorMessages.default]):r}),[]):[]}},{key:"fieldHasError",value:function(t){return t||(t=m(this,Te,"f").errors||{}),!!Object.keys(t).find((function(e){return t&&t[e].fail}),[])}},{key:"fieldValidationsHaveError",value:function(t,e){var r=this;return!(!m(this,Ce,"f").validations||!m(this,Te,"f").visible||!Object.keys(m(this,Ce,"f").validations).find((function(n){var o=m(r,Ce,"f"),i=o.validations,a=void 0===i?{}:i,u=o.errorMessages,c=St(m(r,Te,"f").value,a[e||n],u);return t&&(r.errors=c),r.fieldHasError(c)})))}},{key:"eventReducedSchema",value:function(t){return{api:m(this,Ce,"f").api&&m(this,Ce,"f").api[t],clearFields:m(this,Ce,"f").clearFields&&m(this,Ce,"f").clearFields[t],formatters:m(this,Ce,"f").formatters&&m(this,Ce,"f").formatters[t],masks:m(this,Ce,"f").masks&&m(this,Ce,"f").masks[t],validations:m(this,Ce,"f").validations&&m(this,Ce,"f").validations[t],visibilityConditions:m(this,Ce,"f").visibilityConditions&&m(this,Ce,"f").visibilityConditions[t]}}},{key:"rehydrate",value:function(){this.publish(a("ON_FIELD_REHYDRATE",m(this,Pe,"f").name),{checksum:JSON.stringify(this.data)+JSON.stringify(this.scopedComponent)})}}],r&&Ye(e.prototype,r),n&&Ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function tr(t){return tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(t)}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rr(n.key),n)}}function rr(t){var e=function(t,e){if("object"!==tr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tr(e)?e:String(e)}function nr(t,e){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nr(t,e)}function or(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ar(t);if(e){var o=ar(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===tr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ir(t)}(this,r)}}function ir(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ar(t){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ar(t)}Te=new WeakMap,Pe=new WeakMap,Ce=new WeakMap,Re=new WeakMap;var ur,cr,lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nr(t,e)}(i,w);var e,r,n,o=or(i);function i(t,e,r,n,a,u){var c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),c=o.call(this,e),qe.set(ir(c),{}),Ze.set(ir(c),void 0),Qe.set(ir(c),void 0),c.steps={},g(ir(c),Ze,e,"f"),c.schema=n,c.scopedSchema=n,c.scope=r,c.formId=t,c.initialValues=null==a?void 0:a.initialValues,c.group=u,g(ir(c),Qe,{numSteps:null==n?void 0:n.components.length,navigated:!1,index:0,currentStepSchema:null==n?void 0:n.components[0],isValid:!1,data:{}},"f"),c.formData={predictableErroredFields:[],erroredFields:[],fields:{},formatted:{},form:{scope:r.getGlobalScope(),steps:m(ir(c),Qe,"f"),isValid:!1,messages:[]}},Me(e,Ge,n),c}return e=i,r=[{key:"step",get:function(){return m(this,Qe,"f")},set:function(t){g(this,Qe,t,"f")}},{key:"fields",get:function(){return m(this,qe,"f")||{}}},{key:"eventReducedSchema",value:function(t){var e=this;return this.scopedSchema?Object.keys(this.scopedSchema).reduce((function(r,n){return e.scopedSchema[n]?Object.assign(Object.assign({},r),function(t,e,r){return(e=rr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},n,e.scopedSchema[n][t])):r}),{}):{}}},{key:"getFieldInstance",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.name=t.name||t.component+"_"+JSON.stringify(t.props),this.steps[m(this,Qe,"f").index]||(this.steps[m(this,Qe,"f").index]={}),this.fields[t.name]||(this.fields[t.name]=new Xe(m(this,Ze,"f"),t,e,this.scope),this.steps[m(this,Qe,"f").index][t.name]=this.fields[t.name]),this.fields[t.name]}},{key:"rehydrate",value:function(){var t=this.scopedSchema;t.components;var e=h(t,["components"]);this.publish("ON_FORM_REHYDRATE",{checksum:JSON.stringify(e)})}},{key:"destroyField",value:function(t){m(this,qe,"f")[t]&&(delete m(this,qe,"f")[t],delete this.steps[m(this,Qe,"f").index][t])}}],r&&er(e.prototype,r),n&&er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function sr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=pr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */fr=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:E(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function v(){}function p(){}var y={};c(y,i,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(A([])));b&&b!==e&&r.call(b,i)&&(y=b);var m=p.prototype=d.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==hr(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function A(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:v,configurable:!0}),v.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(O.prototype),c(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=A,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function dr(t,e,r){return(e=Or(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t){return function(t){if(Array.isArray(t))return yr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pr(t,e){if(t){if("string"==typeof t)return yr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yr(t,e):void 0}}function yr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hr(t){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hr(t)}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Or(n.key),n)}}function gr(t,e,r){return e&&mr(t.prototype,e),r&&mr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Or(t){var e=function(t,e){if("object"!==hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===hr(e)?e:String(e)}qe=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,function(t){t.OBSERVER="OBSERVER",t.REACT_FIELD_ADAPTER="REACT FIELD ADAPTER",t.FIELD_HANDLER="FIELD HANDLER"}(ur||(ur={}));var Er=function(){function t(){br(this,t),this.workers={},this.getFormInstance=this.getFormInstance.bind(this),this.getGroupFormsIds=this.getGroupFormsIds.bind(this)}return gr(t,[{key:"getGroupFormsIds",value:function(t){var e=this;return Object.keys(this.workers||{}).filter((function(r){return e.workers[r].group===t}),[])}},{key:"getFormInstance",value:function(){var t,e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,o=arguments.length>1?arguments[1]:void 0;if(this.workers[n]&&!(null==o?void 0:o.newInstance))return this.workers[n];var i=new _r(n,null===(e=null===(t=null==o?void 0:o.initialScope)||void 0===t?void 0:t.configs)||void 0===e?void 0:e.enableLogging),a=new D(i);return a.initialScope=Object.assign(Object.assign({},null==o?void 0:o.initialScope),null===(r=null==o?void 0:o.schema)||void 0===r?void 0:r.iVars),this.workers[n]=new lr(n,i,a,null==o?void 0:o.schema,{initialValues:(null==o?void 0:o.initialValues)||{}},null==o?void 0:o.group),this.workers[n]}}]),t}(),_r=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];br(this,t),this.regexBasedEvents={},this.events={},this.history={},cr.set(this,(function(t){var e=t.event,n=t.data,o=t.payload,i=function(t){return t.split("/")[1]||""}(e),a=wr(r.namespace,null==n?void 0:n.opts),u=a.fields[i],c=function(t){return Array.isArray(t.split("/"))?t.split("/")[0]:t}(e);return{eventReducedSchema:u&&u.eventReducedSchema(c),formEventDirectives:a&&a.eventReducedSchema(c),namespace:r.namespace,coreEvent:c,form:a,field:u,event:e,data:n,payload:o}})),this.namespace=e,this.enableLogging=n}return gr(t,[{key:"runForRegexBasedEvent",value:function(t,e){for(var r=!1,n=0,o=Object.keys(this.events);n<o.length;n++){var i=o[n];(r=t.test(i))&&e(i)}return r}},{key:"handleRegexSubscription",value:function(t,e){var r=this;this.runForRegexBasedEvent(t,(function(t){return r.subscribe(t,e)}))||(this.regexBasedEvents[t]={regex:t,handlers:Array.isArray(this.events[t])?[].concat(vr(this.events[t]),[e]):[e]})}},{key:"subscribe",value:function(t,e){var r=this;return"object"===hr(t)?(this.handleRegexSubscription(t,e),function(){}):(this.events=Object.assign(Object.assign({},this.events),dr({},t,Array.isArray(this.events[t])?[].concat(vr(this.events[t]),[e]):[e])),function(){r.unsubscribe(t,e)})}},{key:"unsubscribe",value:function(t,e){this.events=Object.assign(Object.assign({},this.events),dr({},t,this.events[t].filter((function(t){return t!==e}))))}},{key:"isAsyncFunction",value:function(t){var e=t.toString().trim();return!!("AsyncFunction"===t[Symbol.toStringTag]||"AsyncFunction"==t.constructor.name||e.match(/^async /)||e.match(/return _ref[^\\.]*\.apply/)||t instanceof Promise)}},{key:"publish",value:function(t,e){return b(this,void 0,void 0,fr().mark((function r(){var n,o,i,a=this;return fr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null==e?void 0:e.checksum)||this.history[t]!==(null==e?void 0:e.checksum)){r.next=2;break}return r.abrupt("return");case 2:if(this.history[t]=null==e?void 0:e.checksum,"object"!==hr(t)){r.next=6;break}return this.runForRegexBasedEvent(t,(function(t){return a.publish(t,e)})),r.abrupt("return");case 6:n=0,o=Object.keys(this.regexBasedEvents);case 7:if(!(n<o.length)){r.next=16;break}if(i=o[n],!new RegExp(this.regexBasedEvents[i].regex).test(t)){r.next=13;break}return r.next=13,this.publishForEvents(t,e,dr({},t,this.regexBasedEvents[i].handlers));case 13:n++,r.next=7;break;case 16:return r.abrupt("return",this.publishForEvents(t,e,this.events));case 17:case"end":return r.stop()}}),r,this)})))}},{key:"publishForEvents",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return b(this,void 0,void 0,fr().mark((function n(){var o,i,a,u,c,l=this;return fr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r[t]){n.next=2;break}return n.abrupt("return",{});case 2:o={},i=sr(r[t]),n.prev=4,u=fr().mark((function r(){var n,i,u;return fr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=a.value,r.prev=1,n){r.next=4;break}return r.abrupt("return",{v:void 0});case 4:if(i=m(l,cr,"f").call(l,{data:Object.assign(Object.assign({},e),o),payload:e,event:t,namespace:l.namespace}),!l.isAsyncFunction(n)){r.next=12;break}return r.next=9,n(i,(function(){return l.unsubscribe(t,n)}));case 9:r.t0=r.sent,r.next=13;break;case 12:r.t0=n(i,(function(){return l.unsubscribe(t,n)}));case 13:u=r.t0,o=Object.assign(Object.assign({},o),u),r.next=23;break;case 17:if(r.prev=17,r.t1=r.catch(1),!(r.t1 instanceof ce&&r.t1.breaksObservingChain)){r.next=22;break}return l.logError(ur.OBSERVER,t,"publish",r.t1),r.abrupt("return",{v:{}});case 22:throw r.t1;case 23:case"end":return r.stop()}}),r,null,[[1,17]])})),i.s();case 7:if((a=i.n()).done){n.next=14;break}return n.delegateYield(u(),"t0",9);case 9:if("object"!==hr(c=n.t0)){n.next=12;break}return n.abrupt("return",c.v);case 12:n.next=7;break;case 14:n.next=19;break;case 16:n.prev=16,n.t1=n.catch(4),i.e(n.t1);case 19:return n.prev=19,i.f(),n.finish(19);case 22:return n.abrupt("return",Object.assign(Object.assign({},o),wr(this.namespace).formData));case 23:case"end":return n.stop()}}),n,this,[[4,16,19,22]])})))}},{key:"logError",value:function(t,e,r,n){this.enableLogging&&"LOG"!==e&&this.publish("LOG",{level:"error",data:{event:e,error:n},action:r,flow:t})}},{key:"logInfo",value:function(t,e,r,n){this.enableLogging&&"LOG"!==e&&this.publish("LOG",{level:"info",data:Object.assign({event:e},n),action:r,flow:t})}}]),t}();cr=new WeakMap;var Sr=new Er,wr=Sr.getFormInstance,jr=Sr.getGroupFormsIds;const Ar=({children:r,component:n,wrapper:o,propsMapping:i={},formId:u,onMount:c,onChange:l,onFocus:s,onBlur:f,onClick:d,onRehydrate:v,afterApiCall:p})=>{const[h,b]=y(),[m,g]=y(),[O,E]=y(),[_,S]=y(),[w,j]=y(),[A,N]=y(),I=e.useMemo((()=>wr(u).getFieldInstance(n,i)),[]),F=e.useMemo((()=>o),[o]);return e.useMemo((()=>{I.publish(a("ON_FIELD_MOUNT",n.name)),c(I.data)}),[]),e.useEffect((()=>{m&&v(I.data)}),[m]),e.useEffect((()=>{h&&l(I.data)}),[h]),e.useEffect((()=>{O&&f(I.data)}),[O]),e.useEffect((()=>{_&&s(I.data)}),[_]),e.useEffect((()=>{w&&d(I.data)}),[w]),e.useEffect((()=>{A&&p(I.data)}),[A]),e.useEffect((()=>I.subscribe(a("ON_FIELD_REHYDRATE",n.name),(()=>g()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_BLUR",n.name),(()=>E()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_CHANGE",n.name),(()=>b()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_FOCUS",n.name),(()=>S()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_CLICK",n.name),(()=>j()))),[]),e.useEffect((()=>I.subscribe(a("AFTER_FIELD_API_CALL",n.name),(()=>N()))),[]),I.data.visible&&I.data.mounted?t.jsx(F,Object.assign({},I.props,{children:r})):null},Nr=e.forwardRef(((e,r)=>t.jsx("input",{ref:r,type:"submit",style:{display:"none"}})));Nr.displayName="Submit";const Ir=e.createContext({});Ir.displayName="FormContext";const Fr=o.default.forwardRef((({autoComplete:r,hooks:n,iVars:i,id:a=l,submitOnValidOnly:s=!0,initialValues:f={},className:d,schema:v,group:p,onData:y,onSubmit:h,onBlur:b,onClick:m,afterApiCall:g,onFormMount:O,onFieldMount:E,onStep:_,onFocus:S,onLog:w,onScopeChange:j,onFieldRehydrate:A,renderFieldWrapper:N,disable:I},F)=>{var L;const[,k]=e.useReducer((t=>t+1),0),x=e.useRef(null),D=e.useRef(null),{mapper:T,propsMapping:P}=e.useContext(Ir),C=e.useMemo((()=>wr(a,{group:p,schema:v,newInstance:!0,initialScope:{configs:Object.assign(Object.assign({},null==v?void 0:v.configs),{enableLogging:!!w,disable:I}),global:Object.assign(Object.assign({},null==v?void 0:v.iVars),i)},initialValues:f})),[]);e.useEffect((()=>{C.publish("ON_FORM_MOUNT")}),[]);const R=e.useMemo((()=>T.step?T.step.component:o.default.Fragment),[]),M=e.useMemo((()=>{if(!C.step.currentStepSchema)return;const e=(r,n=0)=>{var o;return null===(o=r.children)||void 0===o?void 0:o.map(((r,o)=>{var i;const u=null===(i=T[r.component])||void 0===i?void 0:i.component,c=t.jsx(Ar,Object.assign({component:r,wrapper:u,propsMapping:P[r.component]||P.__default__,formId:a,onMount:t=>{E&&E(C.formData,r,t)},onRehydrate:t=>{A&&A(C.formData,r,t)},onChange:t=>{y&&y(C.formData,r,t)},onBlur:t=>{b&&b(C.formData,r,t)},onClick:t=>{m&&m(C.formData,t)},afterApiCall:t=>{g&&g(C.formData,r,t)},onFocus:t=>{S&&S(C.formData,r,Object.assign(Object.assign({},t),{schemaLocation:{step:C.step.index,depth:n,index:o}}))}},{children:Array.isArray(r.children)?e(r,n++):r.children}),`${C.step.index}_${n}_${r.name}_${r.component}_${o}`);return N?N(r,c):c}))};return e(C.step.currentStepSchema)}),[C.step.index,a]);return e.useEffect((()=>{C.scope.globalScope={namespace:"configs",data:{disable:I}}}),[I]),e.useEffect((()=>{O&&O(C.formData)}),[]),e.useEffect((()=>{C.scope.globalScope={namespace:"configs",data:{disable:I}}}),[I]),e.useEffect((()=>{C.scope.globalScope={namespace:"global",data:Object.assign(Object.assign({},null==v?void 0:v.iVars),i)}}),[JSON.stringify(i)]),e.useEffect((()=>C.subscribe("ON_FORM_REHYDRATE",(()=>{k()}))),[]),e.useEffect((()=>C.subscribe("LOG",(({data:t})=>w&&w(t)))),[]),e.useMemo((()=>C.subscribe(u("ON_SCOPE_CHANGE"),(t=>j&&j(C.scope.scope,t.data.namespace,t.data.key)))),[]),e.useEffect((()=>C.subscribe("ON_FORM_SUBMIT",(({data:t})=>{const e=(null==n?void 0:n.preSubmit)&&(null==n?void 0:n.preSubmit(C.formData));!C.formData.form.isValid&&s||h&&h(t.event,Object.assign(Object.assign({},C.formData),{formatted:Object.assign(Object.assign({},C.formData.formatted),e)}))}))),[]),e.useEffect((()=>C.subscribeBulk([c.NAVIGATE_STEP_BACK,c.NAVIGATE_STEP_FORWARD,c.NAVIGATE_STEP],(()=>{_&&_(C.formData),k()}))),[]),e.useImperativeHandle(F,(()=>({values:()=>C.formData,step:C.publishFor(c.NAVIGATE_STEP),stepForward:C.publishFor(c.NAVIGATE_STEP_FORWARD),stepBack:C.publishFor(c.NAVIGATE_STEP_BACK),validateForm:C.publishFor(c.VALIDATE_FORM),submit:()=>{var t;return null===(t=D.current)||void 0===t?void 0:t.click()},schema:v})),[]),t.jsxs("form",Object.assign({action:C.scopedSchema.action,method:C.scopedSchema.method,className:d,ref:x,autoComplete:r,onSubmit:t=>{C.publish(c.ON_FORM_SUBMIT,{event:t})}},{children:[t.jsx(R,Object.assign({},null===(L=C.step.currentStepSchema)||void 0===L?void 0:L.props,{children:M})),!C.scopedSchema.disableFormSubmit&&t.jsx(Nr,{ref:D})]}))})),Lr=o.default.forwardRef(((e,r)=>e.schema?t.jsx(Fr,Object.assign({},e,{ref:r})):e.renderLoading?e.renderLoading():t.jsx(t.Fragment,{})));exports.ALL_NAMESPACE_EVENTS=u,exports.BUILD_EVENT=a,exports.CoreEvents=c,exports.FormProvider=({children:e,mapper:r,propsMapping:n})=>t.jsx(Ir.Provider,Object.assign({value:{mapper:r,propsMapping:n}},{children:e})),exports.SchemaGuard=Lr,exports.asFormField=({Comp:r,propsMapping:n})=>o=>{var{name:i,validations:u,errorMessages:c,masks:l,filter:f,formatters:d,visibilityConditions:v,formId:p=s,visibility:b=!0,value:m}=o,g=h(o,["name","validations","errorMessages","masks","filter","formatters","visibilityConditions","formId","visibility","value"]);const[,O]=y(),E=e.useMemo((()=>({state:{hidden:!b},component:"",name:i,validations:u,errorMessages:c,masks:l,filter:f,visibilityConditions:v,formatters:d})),[c,i,f,d,l,u,v]),_=e.useMemo((()=>wr(p).getFieldInstance(E,n)),[]);return e.useMemo((()=>{_.subscribeBulk([a("ON_FIELD_MOUNT",E.name),a("ON_FIELD_REHYDRATE",E.name)],O)}),[]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_CHANGE",E.name),(({data:t})=>{O(),g[n.getValue]&&g[n.getValue](t.event,_.data)}))}),[g[n.getValue]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_BLUR",E.name),(({data:t})=>{O(),g[n.onBlur]&&g[n.onBlur](t.event)}))}),[g[n.onBlur]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_FOCUS",E.name),(({data:t})=>{O(),g[n.onFocus]&&g[n.onFocus](t.event)}))}),[g[n.onFocus]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_KEYUP",E.name),(({data:t})=>{O(),g[n.onKeyUp]&&g[n.onKeyUp](t.event)}))}),[g[n.onKeyUp]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_KEYDOWN",E.name),(({data:t})=>{O(),g[n.onKeyDown]&&g[n.onKeyDown](t.event)}))}),[g[n.onKeyDown]]),e.useEffect((()=>{void 0!==m&&(_.value=m,_.rehydrate())}),[m]),e.useEffect((()=>{_.visibility=b,_.rehydrate()}),[b]),e.useEffect((()=>()=>wr(p).destroyField(i)),[]),_.data.visible?t.jsx(r,Object.assign({},g,_.props)):t.jsx(t.Fragment,{})},exports.getFormInstance=wr,exports.getGroupFormsIds=jr,exports.useForm=({onValid:t,onData:r,onSubmit:n,id:o=s,ids:i})=>{const a=(t,e)=>{e&&(i?i.map((r=>wr(r).subscribe(t,(({data:t})=>e(wr(r).formData,{field:t.field}))))):wr(o).subscribe(t,e))},l=()=>i?i.reduce(((t,e)=>Object.keys(t).reduce(((r,n)=>Object.assign(Object.assign({},r),{[n]:Object.assign(Object.assign({},t[n]),wr(e).formData[n])})),{})),{formatted:{},erroredFields:{},fields:{},form:{},predictableErroredFields:{},filteredFields:{}}):wr(o).formData,f=e.useCallback((()=>{let t=wr(o).formData;i&&(t=i.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:wr(e).formData})),{})),r&&r(t)}),[r,t]);e.useEffect((()=>a("ON_FIELD_VALIDATION_TOGGLE",t)),[t]),e.useEffect((()=>a(u(c.ON_FIELD_CHANGE),f)),[r,t]),e.useEffect((()=>a(u(c.ON_FIELD_REHYDRATE),f)),[r,t]),e.useEffect((()=>a(c.ON_FORM_SUBMIT,(()=>{n&&n(l())}))),[n]);return{submitForm:()=>wr(i?i[0]:o).publish(c.ON_FORM_SUBMIT),formData:l}};
2
- //# sourceMappingURL=asFormField-5d9fc0b1.js.map
1
+ "use strict";var t=require("react/jsx-runtime"),e=require("react");require("./types.js");var r=require("credit-card-type");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(e),i=n(r),a=function(t,e,r){return e?t+"/"+e+(r?"/"+r:""):t},u=function(t){return new RegExp("^(".concat(t,").*$"),"g")},c={ON_FIELD_VALIDATION_TOGGLE:"ON_FIELD_VALIDATION_TOGGLE",ON_FIELD_MOUNT:"ON_FIELD_MOUNT",ON_FIELD_CHANGE:"ON_FIELD_CHANGE",ON_FIELD_BLUR:"ON_FIELD_BLUR",ON_FIELD_FOCUS:"ON_FIELD_FOCUS",ON_FIELD_REHYDRATE:"ON_FIELD_REHYDRATE",ON_FIELD_CLEARED:"ON_FIELD_CLEARED",ON_FIELD_CLICK:"ON_FIELD_CLICK",ON_FIELD_KEYUP:"ON_FIELD_KEYUP",ON_FIELD_KEYDOWN:"ON_FIELD_KEYDOWN",AFTER_FIELD_API_CALL:"AFTER_FIELD_API_CALL",RUN_FIELD_VALIDATIONS:"RUN_FIELD_VALIDATIONS",RUN_FIELD_FORMATTERS:"RUN_FIELD_FORMATTERS",RUN_FIELD_MASKS:"RUN_FIELD_MASKS",ON_SCOPE_CHANGE:"ON_SCOPE_CHANGE",ON_FORM_REHYDRATE:"ON_FORM_REHYDRATE",ON_FORM_SUBMIT:"ON_FORM_SUBMIT",ON_FORM_MOUNT:"ON_FORM_MOUNT",ON_FORM_UN_MOUNT:"ON_FORM_UN_MOUNT",ON_FORM_DATA:"ON_FORM_DATA",NAVIGATE_STEP:"NAVIGATE_STEP",NAVIGATE_STEP_FORWARD:"NAVIGATE_STEP_FORWARD",NAVIGATE_STEP_BACK:"NAVIGATE_STEP_BACK",VALIDATE_FORM:"VALIDATE_FORM",LOG:"LOG"},l="default_form_id",s="default_form_hook_id";function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var v,p,y=function(){var t=f(e.useState(0),2),r=t[0],n=t[1];return[r,function(){return n((function(t){return t+1}))}]};function h(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function b(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))}function m(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function g(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}function O(t){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(t)}function E(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new N(o||[]);return n(a,"_invoke",{value:S(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function v(){}function p(){}var y={};c(y,i,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(I([])));b&&b!==e&&r.call(b,i)&&(y=b);var m=p.prototype=d.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==O(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function S(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return L()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function w(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function I(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return v.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:v,configurable:!0}),v.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(_.prototype),c(_.prototype,a,(function(){return this})),t.AsyncIterator=_,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=I,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:I(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function _(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==O(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===O(i)?i:String(i)),n)}var o,i}var S,w=function(){function t(e){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),v.set(this,void 0),p.set(this,{}),this.debounceTime=50,this.debounce=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.debounceTime;return b(r,void 0,void 0,E().mark((function r(){var n=this;return E().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r){m(n,p,"f")[t]&&clearTimeout(m(n,p,"f")[t]),m(n,p,"f")[t]=setTimeout((function(){clearTimeout(m(n,p,"f")[t]),r(t())}),e)})));case 1:case"end":return r.stop()}}),r)})))},g(this,v,e,"f"),this.publish=this.publish.bind(this),this.subscribe=this.subscribe.bind(this),this.debounce=this.debounce.bind(this),this.subscribeBulk=this.subscribeBulk.bind(this),this.subscriptions={}}var e,r,n;return e=t,r=[{key:"subscribe",value:function(t,e){this.subscriptions[t]&&this.subscriptions[t](),this.subscriptions[t]=m(this,v,"f").subscribe(t,e)}},{key:"subscribeBulk",value:function(t,e){var r=this;t.forEach((function(t){return r.subscribe(t,e)}))}},{key:"publish",value:function(t,e){m(this,v,"f").publish(t,e)}},{key:"publishFor",value:function(t){var e=this;return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(e,void 0,void 0,E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m(this,v,"f").publish(t,r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}}},{key:"logError",value:function(t,e,r,n){m(this,v,"f").logError(t,e,r,n)}},{key:"logInfo",value:function(t,e,r,n){m(this,v,"f").logInfo(t,e,r,n)}}],r&&_(e.prototype,r),n&&_(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function j(t){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},j(t)}function A(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function I(t){var e=function(t,e){if("object"!==j(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===j(e)?e:String(e)}function L(t,e){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},L(t,e)}function F(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=x(t);if(e){var o=x(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===j(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return k(t)}(this,r)}}function k(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}v=new WeakMap,p=new WeakMap;var D=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&L(t,e)}(i,w);var e,r,n,o=F(i);function i(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=o.call(this,t),S.set(k(e),{global:{},api:{},hooks:{},configs:{},fields:{}}),e}return e=i,r=[{key:"scope",get:function(){return m(this,S,"f")||{}}},{key:"getGlobalScope",value:function(t,e){return t&&!e&&this.scope[t]?this.scope[t]:t&&e&&this.scope[t]?this.scope[t][e]:m(this,S,"f")}},{key:"initialScope",set:function(t){g(this,S,t||m(this,S,"f"),"f")}},{key:"globalScope",set:function(t){var e=t.namespace,r=t.key,n=t.data;r||(m(this,S,"f")[e]=n),r&&!m(this,S,"f")[e]&&(m(this,S,"f")[e]=A({},r,n)),m(this,S,"f")[e]&&r&&(m(this,S,"f")[e]=Object.assign(Object.assign({},m(this,S,"f")[e]),A({},r,n)));var o=r?a("ON_SCOPE_CHANGE",e,r):u(a("ON_SCOPE_CHANGE",e,r));this.publish(o,{scope:this.scope,namespace:e,key:r}),this.publish("ON_SCOPE_CHANGE")}}],r&&N(e.prototype,r),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function C(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==T(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===T(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){return function(t){if(Array.isArray(t))return V(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||M(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=M(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function M(t,e){if(t){if("string"==typeof t)return V(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}S=new WeakMap;var G={BEGIN:"${",END:"}",DEFAULT_SPLITTER:"||"},U=function(t){return/\$\{(.*)\}.*/g.test(t)},B="varOps.",H=")",Y="(",$=",",z=function(t){return t.includes(B)},K=function(t,e,r){var n=(t=t.toString()).lastIndexOf(G.BEGIN);if(-1===n)return t;var o=t.substring(n+G.BEGIN.length,t.length),i=o.substring(0,o.indexOf(G.END)),a=i.length,u="",c=i.split(G.DEFAULT_SPLITTER);if(c.length>1){i=c[0];var l,s=R(c);try{for(s.s();!(l=s.n()).done;){var f=l.value;if(f.includes("api")||f.includes("global")||f.includes("fields")||f.includes("hooks")||f.includes("configs")){var d=tt(r.scope.getGlobalScope(),f);d&&(u=d)}else u=f}}catch(t){s.e(t)}finally{s.f()}}var v=tt(e.scope.getGlobalScope(),i),p=void 0===v?u:v;if("string"!=typeof p&&0===n)return p;try{p=JSON.stringify(p).replace(/^"(.*)"$/,"$1")}catch(t){}return t.substring(0,n)+p+t.substring(n+a+G.BEGIN.length+G.END.length,t.length)},W=Object.freeze({__proto__:null,template:G,extractTargetString:K,handler:function(t){var e=t.field,r=t.form,n=function(){if(e){var t=e.component,r=t.children,n=t.wrapper,o=h(t,["children","wrapper"]),a=Object.assign({},i(o));e.scopedComponent=Object.assign(Object.assign(Object.assign({},o),a),{children:r,wrapper:n})}},o=function t(o){var i=(o=o.toString()).lastIndexOf(G.BEGIN);if(-1===i)return o;var u=o.substring(i+G.BEGIN.length,o.length),c=u.substring(0,u.indexOf(G.END)),l=c.length,s="",f=c.split(G.DEFAULT_SPLITTER);if(f.length>1){c=f[0];var d,v=R(f);try{for(v.s();!(d=v.n()).done;){var p=d.value;if(p.includes("api")||p.includes("global")||p.includes("fields")||p.includes("hooks")||p.includes("configs")){var y=tt(e.scope.getGlobalScope(),p);y&&(s=y)}else s=p}}catch(t){v.e(t)}finally{v.f()}}e&&function(t){var r,o,i,u,c=!(null===(u=null===(i=null===(o=null===(r=e.scope.scope.configs)||void 0===r?void 0:r.observables)||void 0===o?void 0:o.templates)||void 0===i?void 0:i.exclude)||void 0===u?void 0:u.includes(e.component.name)),l=t[0].split(".");c&&e.subscribe(a("ON_SCOPE_CHANGE",l[0],l[1]),(function(){n(),e.rehydrate()}))}(f);var h=tt(r.scope.getGlobalScope(),c),b=void 0===h?s:h;if("string"!=typeof b&&0===i)return b;if(!b&&!/^\$\{.*\}$/.test(o))return o.substring(0,i)+o.substring(o.indexOf(G.BEGIN),o.lastIndexOf(G.END)+1);try{b=JSON.stringify(b).replace(/^"(.*)"$/,"$1")}catch(t){}var m=o.substring(0,i)+b+o.substring(i+l+G.BEGIN.length+G.END.length,o.length);return z(m)&&!U(m)?m.replace(/([^\s]+)/g,(function(t){if(!z(t))return t;var e=function(t){return jt[t.split(B)[1].split(Y)[0]]}(t);return e?e.apply(void 0,P(function(t){return t.split(B)[1].split(Y)[1].split(H)[0].split($)}(t))):void 0})):t(m)},i=function t(e){if("string"==typeof e)return o(e);if("number"==typeof e)return e;var r=Object.assign({},e);return Object.keys(r).reduce((function(e,n){if(null===r[n])return e;if(Array.isArray(r[n]))return Object.assign(Object.assign({},e),C({},n,r[n].map(t)));if("object"===T(r[n]))return Object.assign(Object.assign({},e),C({},n,Object.assign({},t(Object.assign({},r[n])))));if("string"!=typeof r[n])return Object.assign(Object.assign({},e),C({},n,r[n]));if(!U(r[n]))return Object.assign(Object.assign({},e),C({},n,r[n]));var i=o(r[n]);try{at(i)&&(i=JSON.parse(i))}catch(t){}return Object.assign(Object.assign({},e),C({},n,i))}),{})};n(),function(){var t=r.schema||{};t.components;var e=h(t,["components"]),n=i(e);r.scopedSchema=n,r.rehydrate()}()}});function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function q(t){return function(t){if(Array.isArray(t))return Z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Q(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==J(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===J(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var X=function(t,e,r,n,o){var i=function(t){return r.constructor(t)},a=e.split(".");if(1===a.length)return Object.assign(Object.assign({},t),Q({},e,i(K(r,n,o))));return function t(e,a){var u=q(e);u.splice(0,1);var c=1!==e.length?t(u,a?a[e[0]]:{}):i(K(r,n,o));return Object.assign(Object.assign({},a),Q({},e[0],c))}(a,t)},tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split(".").reduce((function(t,e){return(t||{})[e]}),t)};function et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rt(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var nt=function(t,e){var r=ot(t.toString()),n=i.default(r);return[(null==e?void 0:e.length)?null==n?void 0:n.filter((function(t){var r=t.type;return e.some((function(t){return t===r}))}))[0]:n[0],r]},ot=function(t){return null==t?void 0:t.replace(/ /g,"")},it=function(t,e){return e?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.reduce((function(t,r,n){var o=et(t,2),i=o[0],a=o[1],u=r-(e[n-1]||0);return["".concat(i,"([0-9]{0,").concat(u,"})"),"".concat(a,"$").concat(n+1," ")]}),["",""]),n=et(r,2),o=n[0],i=n[1];return t.replace(new RegExp(o),i).trim()}(t.slice(0,null==e?void 0:e.lengths[0]),e.gaps):t.slice(0,19)};function at(t){if("string"!=typeof t)return!1;try{var e=JSON.parse(t),r=Object.prototype.toString.call(e);return"[object Object]"===r||"[object Array]"===r}catch(t){return!1}}function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return ct(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ct(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var lt=function(t){var e=t.value,r=t.formatterValue;if(!e)return e;var n="",o=0;return r.forEach((function(t,i){var a=0===i?i:r[i-1].position+1;e[t.position]==t.value&&o++,n+=e.slice(a,t.position)})),n+=e.slice(n.length+o)},st={splitter:function(t){var e=t.value,r=t.formatterValue;if(!e)return e;var n=lt({value:e,formatterValue:r});return r.forEach((function(t){t.position>=e.length||(n=n.slice(0,t.position)+t.value+n.slice(t.position,null==n?void 0:n.length))})),n},undo_splitter:lt,capitalize:function(t){var e=t.value;return e?e.charAt(0).toUpperCase()+e.slice(1):e},upperCase:function(t){var e=t.value;return e?e.toUpperCase():e},gapsCreditCard:function(t){var e=t.value,r=t.formatterValue;if(e){var n=ut(nt(e,r),2),o=n[0],i=n[1];return it(i,o)}},onlyNumbers:function(t){return t.value.replace(/([^\d])+/gim,"")},onlyLetters:function(t){return t.value.replace(/([0-9:\s/-])+/g,"")},regex:function(t){var e=t.value,r=t.formatterValue;return e.replace(new RegExp(r,"g"),"")}},ft=function(t,e,r){var n=t;return Object.keys(e).forEach((function(t){var o=e[t],i=st[r?"undo_".concat(t):t];i&&(n=i({value:n,formatterValue:o}))})),n},dt=function(t){var e=t.value,r=void 0===e?"":e,n=t.maskValue,o=r;return n.forEach((function(t){var e=t.to,n=void 0===e?o.length:e,i=t.mask,a=t.from;if(!(n>r.length-1)){0===a&&(a=1);var u=new Array(n-a+2).join(i);o=o.slice(0,a-1)+u+o.slice(n)}})),o},vt={generic:dt,cardNumber:function(t){var e=t.value;return dt({value:e,maskValue:[{from:1,to:4,mask:"x"},{from:6,to:9,mask:"x"},{from:11,to:14,mask:"x"},{from:16,to:19,mask:"x"}]})},hideCardNumber:function(t){var e=t.value;return dt({value:e,maskValue:[{from:1,to:4,mask:"x"},{from:6,to:9,mask:"x"},{from:11,to:14,mask:"x"},{from:16,to:19,mask:"x"}]})},cardMask:function(t){return t.value.replace(/[^\dA-Z]/g,"").replace(/(.{4})/g,"$1 ").trim()},cardDate:function(t){var e=t.value.replace(/\D/g,""),r=e.slice(0,2);return e.length>=5?"".concat(r,"/").concat(e.slice(2,4)):e.length>=3?"".concat(r,"/").concat(e.slice(2)):e},currencyMask:function(t){var e=t.value,r=void 0===e?"":e,n=t.maskValue,o=r.replace(/[^0-9]/g,"");return new Intl.NumberFormat(n.locale,{minimumFractionDigits:0,maximumFractionDigits:0,style:"currency",currency:n.currency}).format(+o)},feinMask:function(t){var e=t.value.replace(/\D/g,""),r=e.slice(0,2);return e.length>=5?"".concat(r,"-").concat(e.slice(2,9)):e.length>=3?"".concat(r,"-").concat(e.slice(2)):e},replaceAll:function(t){var e=t.value,r=void 0===e?"":e,n=t.maskValue;return n&&"string"==typeof r?("number"==typeof n&&(n=null==n?void 0:n.toString()),new Array(r.length+1).join(n)):r}};function pt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==yt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===yt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function ht(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,e)||bt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(t,e){if(t){if("string"==typeof t)return mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mt(t,e):void 0}}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var gt=function(t){var e=t.value,r=t.validationValue,n=new RegExp(r);return{fail:!n.test(e)}},Ot=function(t){var e=t.value,r=void 0===e?"":e,n=t.validationValue.some((function(t){var e=t.to,n=t.from,o=t.validations,i=r.substring(e,n);return wt(St(i,o))}));return{fail:n}},Et=function(t){var e,r,n,o,i,a=t.value,u=void 0===a?"":a,c=t.validationValue;if(!(null===(e=null==c?void 0:c.target)||void 0===e?void 0:e.value)&&!(null===(r=null==c?void 0:c.origin)||void 0===r?void 0:r.intervals))return{fail:!1};var l,s={DDMMYYYY:function(t){var e=t.split(t.includes("/")?"/":"-");return"".concat(e[1],"/").concat(e[0],"/").concat(e[2])},YYYYMMDD:function(t){var e=t.split(t.includes("/")?"/":"-");return"".concat(e[1],"/").concat(e[2],"/").concat(e[0])},YYYYDDMM:function(t){var e=t.split(t.includes("/")?"/":"-");return"".concat(e[2],"/").concat(e[1],"/").concat(e[0])},MMDDYYYY:function(t){return t},timestamp:function(t){return new Date(t).toString()}},f=c.origin.value||u,d=new Date(s[null==c?void 0:c.origin.format](f).toString()),v=new Date;if((null===(n=null==c?void 0:c.target)||void 0===n?void 0:n.format)&&(v=l=new Date(s[null===(o=null==c?void 0:c.target)||void 0===o?void 0:o.format](c.target.value).toString())),c.origin.intervals){v=function(t,e){var r={years:function(t,e){return new Date(t.setUTCFullYear(t.getUTCFullYear()+e))},months:function(t,e){return new Date(t.setUTCMonth(t.getUTCMonth()+e))},days:function(t,e){return new Date(t.setDate(t.getUTCDate()+e))}};return Object.keys(e).reduce((function(t,n){return r[n](t,e[n])}),new Date(t))}(d,c.origin.intervals);var p=new Date;(null===(i=c.target)||void 0===i?void 0:i.value)&&l&&(p.setDate(l.getDate()),p.setMonth(l.getMonth())),d=new Date("".concat(p.getUTCMonth()+1,"/").concat(p.getUTCDate(),"/").concat(p.getUTCFullYear()))}if(c.onlyValidDate&&(!(v instanceof Date&&isFinite(v))||!(v instanceof Date&&isFinite(d))||f.length<8))return{fail:!0};var y=d.getTime(),h=v.getTime();return{fail:{">":y>h,">=":y>=h,"<":y<h,"<=":y<=h,"===":y===h,"!==":y!==h}[null==c?void 0:c.operator]}},_t={between:function(t){var e,r=t.value,n=t.validationValue,o=!1;if(!(2==(null===(e=null==n?void 0:n.dates)||void 0===e?void 0:e.length)||(null==n?void 0:n.start)&&(null==n?void 0:n.end)))return{fail:!1};if(n.dates){var i,a=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=bt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(n.dates);try{for(a.s();!(i=a.n()).done;){var u=i.value;if(Et({value:r,validationValue:u}).fail){o=!0;break}}}catch(t){a.e(t)}finally{a.f()}}else{var c=parseInt(r);n.isIncludedBoundaries?(c<n.start||c>n.end)&&(o=!0):(c<=n.start||c>=n.end)&&(o=!0)}return{fail:o}},conditions:function t(e){var r=e.value,n=void 0===r?"":r,o=e.validationValue;if(!o)return{fail:!1};var i=function(t){if(t.forceDefinedOrigin&&void 0===t.origin||t.forceDefinedTarget&&void 0===t.target)return{fail:!1};var e=void 0===t.origin?n:t.origin,r=void 0===t.target?n:t.target;return{"!==":(e||n)!==(r||n),"===":(e||n)===(r||n),"<":(e||n)<(r||n),">":(e||n)>(r||n),"<=":(e||n)<=(r||n),">=":(e||n)>=(r||n)}[t.condition]},a={and:function(){return!!o.set.every(i)},or:function(){return!!o.set.some(i)}}[o.rule]();return o.conditions&&(a="and"===o.rule?a&&t({value:n,validationValue:o.conditions}).fail:a||t({value:n,validationValue:o.conditions}).fail),{fail:a}},date:Et,length:function(t){var e=t.value,r=t.validationValue,n=e;return"string"!=typeof n&&(n=null==e?void 0:e.toString()),{fail:!e||(null==n?void 0:n.length)===r}},greaterThan:function(t){var e=t.value,r=t.validationValue;return{fail:!e||parseInt(e)<=parseInt(r)}},maxLength:function(t){var e=t.value,r=void 0===e?"":e,n=t.validationValue,o=r;return Number.isInteger(o)&&(o=r.toString()),{fail:o.length>n}},minLength:function(t){var e=t.value,r=void 0===e?"":e,n=t.validationValue,o=r;return Number.isInteger(o)&&(o=r.toString()),{fail:o.length<n}},required:function(t){var e=t.value;return{fail:t.validationValue&&!e}},value:function(t){var e=t.value;return{fail:e!==t.validationValue}},bool:function(t){var e=t.validationValue,r=!1;return"boolean"==typeof e&&(r=e),{fail:r}},regex:gt,hasNoExtraSpaces:function(t){var e=t.value;return{fail:gt({value:e,validationValue:"^[A-Za-z0-9.-]+(?: +[A-Za-z0-9.-]+)*$",errorMessage:""}).fail}},isCreditCard:function(t){var e,r,n=t.value,o=t.validationValue;if(!n)return{fail:!0};var i=ht(nt(n,o),1)[0];return{fail:!i,metadata:{typeCard:null==i?void 0:i.type,creditCardCC:null===(e=null==i?void 0:i.code)||void 0===e?void 0:e.name,creditCardCCSize:null===(r=null==i?void 0:i.code)||void 0===r?void 0:r.size}}},isCreditCardAndLength:function(t){var e=t.value,r=t.validationValue;if(!e)return{fail:!0};var n=ht(nt(e,r),2),o=n[0],i=n[1];return{fail:o&&!o.lengths.includes(i.length)}},isCreditCodeMatch:function(t){var e,r=t.value,n=t.validationValue;if(!r)return{fail:!0};var o=ht(nt(n.numberCard,n.availableOptions),1)[0];return{fail:(null===(e=null==o?void 0:o.code)||void 0===e?void 0:e.size)!==r.length}},onlyLetters:function(t){var e=t.value;return{fail:!/^[a-zA-Z\s]*$/.test(e)}},notAllowSpaces:function(t){var e=t.value;return{fail:/\s/.test(e)}},callback:function(t){var e=t.value,r=(0,t.validationValue)(e);return{message:r.errorMessage,fail:r.fail}},isNumber:function(t){var e=t.value;return{fail:!!e&&!/^[0-9\s]*$/.test(e)}},customValidation:function(t){var e=t.value,r=t.validationValue;return Ot({value:e,validationValue:r})},notEmpty:function(t){return{fail:!t.value.trim().length}},numericRange:function(t){var e=t.value,r=t.validationValue,n=String(e).replace(/[^0-9]/g,"");return{fail:!n||!Number.isInteger(parseInt(n.toString()))||+n>r.end||+n<r.start}},email:function(t){var e=t.value;return{fail:!/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}},lessThan:function(t){var e=t.value,r=t.validationValue;return{fail:!e||parseInt(e)>=parseInt(r)}},sequentialNumber:function(t){var e=t.value,r=String(e).replace(/[^0-9]/g,"");return{fail:!(-1==="0123456789".indexOf(r)&&-1==="9876543210".indexOf(r))}},repeatedNumbers:function(t){var e=t.value,r=String(e).replace(/[^0-9]/g,"");return{fail:/\b(\d)\1+\b/gm.test(r)}},url:function(t){var e=t.value;return{fail:!/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/gi.test(e)}},path:function(t){var e=t.value,r=t.validationValue,n=function(t){var n=tt(e,t);if(r.preventUnMountValidation&&!(t in e))return{fail:!1};var o,i,a=St(n,r);return i={fail:!1},(o=a)?Object.keys(o).reduce((function(t,e){return o[e].fail?o[e]:t}),i):i};return Array.isArray(r.paths)?r.paths.reduce((function(t,e){var r=n(e);return r.fail?r:t}),{}):n(r.path)},isInTheList:function(t){var e=t.value,r=t.validationValue;return e&&Array.isArray(r)?{fail:!r.some((function(t){return t===e||JSON.stringify(t)===e}))}:{fail:!0}},fields:function(t){var e=t.values,r=t.validationValue;return{fail:null==r?void 0:r.set[r.rule]((function(t){var r;return wt(St(null===(r=e[t.fieldName])||void 0===r?void 0:r.value,t.validations))}))}},customNameRule:function(t){var e=t.value,r=t.validationValue;return"object"!==yt(r)?{fail:!1}:{fail:wt(St(e,r))}},exists:function(t){return{fail:!t.validationValue}}},St=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o={};return Object.keys(e).forEach((function(i){var a=e[i],u=_t[i];u||(u=_t.customNameRule);var c=r[i]||r.default,l=u({value:t,validationValue:a,errorMessage:c,values:n});o=Object.assign(Object.assign({},o),pt({},i,Object.assign(Object.assign({},l),{validationValue:a,message:c})))})),o},wt=function(t){return!!t&&!!Object.keys(t).find((function(e){return t&&t[e].fail}),[])},jt=Object.freeze({__proto__:null,concatenate:function(t,e){return t+e},add:function(t,e){return((parseInt(t)||0)+(parseInt(e)||0)).toString()},subtract:function(t,e){return parseInt(t)-parseInt(e)},replaceAll:function(t,e,r){return t.replace(new RegExp(e,"g"),r)}}),At=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data;e.data.changed=!0,e.data.metadata=r.metadata,e.value=r.parsedEventValue}}),Nt=Object.freeze({__proto__:null,handler:function(t){var e,r,n,o,i,u,c,l,s=t.form,f=t.field;f.subscribe(a("ON_SCOPE_CHANGE","configs","disable"),(function(){return f.rehydrate()}));var d=f.component.props,v=(void 0===d?{}:d)[null===(e=f.mappings)||void 0===e?void 0:e.setValue],p=f.component.group&&tt(s.initialValues,f.component.group),y=tt(s.initialValues,p===(null===(r=f.component.props)||void 0===r?void 0:r.value)&&p?f.component.group:f.component.name)||v;f.value=(null===(l=null===(o=null===(n=s.formData.form)||void 0===n?void 0:n.steps)||void 0===o?void 0:o.data[null===(c=null===(u=null===(i=s.formData)||void 0===i?void 0:i.form)||void 0===u?void 0:u.steps)||void 0===c?void 0:c.index])||void 0===l?void 0:l.formatted[f.component.name])||(f.data.mounted?void 0:y),f.data.mounted=!0}}),It=Object.freeze({__proto__:null,handler:function(t){t.field.data.blured=!0}}),Lt=Object.freeze({__proto__:null,handler:function(t){var e=t.field;e.data=Object.assign(Object.assign({},e.data),{focused:!0})}});function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function kt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */kt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:E(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function v(){}function p(){}var y={};c(y,i,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(A([])));b&&b!==e&&r.call(b,i)&&(y=b);var m=p.prototype=d.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==Ft(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function A(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:v,configurable:!0}),v.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(O.prototype),c(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=A,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function xt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Ft(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ft(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Dt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ct=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.form;return t.eventReducedSchema.api.forEach((function(t){var n,o=e.scope,i=St(e.data.value,t.preConditions||{},e.scopedComponent.errorMessages,null===(n=null==r?void 0:r.formData)||void 0===n?void 0:n.fields);if(!(e.fieldHasError(i)||t.blockRequestWhenInvalid&&e.fieldValidationsHaveError(!1))){t.url.includes(G.BEGIN)&&(t.url=K(t.url,r,e));var u={},c=t.url;if(t.fieldValueAsPathParams){var l,s=Dt(t.fieldValueAsPathParams);try{for(s.s();!(l=s.n()).done;){var f=l.value;Object.prototype.hasOwnProperty.call(r.fields,f)&&(c="".concat(c,"/").concat(r.fields[f].data.value))}}catch(t){s.e(t)}finally{s.f()}}if(t.fieldValueAsParams){for(var d in t.fieldValueAsParams)if(Object.prototype.hasOwnProperty.call(r.fields,d)){var v=t.fieldValueAsParams[d]||d;u=Object.assign(Object.assign({},u),xt({},v,r.fields[d].data.value))}if(c.includes("?")){var p=c.split("?"),y=p.at(1).split("&");if(c=p.at(0),y.length>1){var h,m=Dt(y);try{for(m.s();!(h=m.n()).done;){var g=h.value.split("=");u=Object.assign(Object.assign({},u),xt({},g.at(0),g.at(1)))}}catch(t){m.e(t)}finally{m.f()}}else{var O=y.at(0).split("=");u=Object.assign(Object.assign({},u),xt({},O.at(0),O.at(1)))}}var E=new URLSearchParams(u);c="".concat(c,"?").concat(E.toString())}o.globalScope={namespace:"api",key:t.scope,data:{loading:!0}},e.debounce((function(){return fetch(c,Object.assign(Object.assign({method:t.method},t.body&&{body:JSON.stringify(t.body)}),{headers:t.headers||{"Content-type":"application/json; charset=UTF-8"}})).then((function(t){var e=t.json();if(t.status>=400)throw e;return e})).then((function(e){o.globalScope={namespace:"api",key:t.scope,data:Object.assign({loading:!1,response:e},e)}})).catch((function(e){return b(void 0,void 0,void 0,kt().mark((function r(){var n;return kt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e;case 2:n=r.sent,o.globalScope={namespace:"api",key:t.scope,data:{loading:!1,error:!0,err:n}};case 4:case"end":return r.stop()}}),r)})))})).finally((function(){return e.publish(a("AFTER_FIELD_API_CALL",e.component.name))}))}),t.debounceTime||200)}}))},events:function(t){return Object.keys(t.api||{})}});function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function Rt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Pt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Pt(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Mt(t){return function(t){if(Array.isArray(t))return Vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Gt,Ut,Bt=Object.freeze({__proto__:null,handler:function(t){var e=t.form,r=t.field,n=function(t){var n;return Object.keys(t).reduce((function(t,n){var o,i,a,u,c,l=e.fields[n],s=l.data;if(!l||!l.data.visible||!l.data.name)return t;var f="";(null===(o=l.component)||void 0===o?void 0:o.group)&&(r&&r.component.name===l.component.name||!r&&!e.formData.formatted[l.component.group])&&(f=l.component.group);var d=f||n,v=void 0===s.value?e.initialValues[n]||(null===(i=e.schema)||void 0===i?void 0:i.formattedDataDefaults)&&(null===(a=e.schema)||void 0===a?void 0:a.formattedDataDefaults[n]):s.value;return{erroredFields:l.fieldHasError()?[].concat(Mt(t.erroredFields),[n]):t.erroredFields,predictableErroredFields:l.fieldValidationsHaveError()?[].concat(Mt(t.predictableErroredFields),[n]):t.predictableErroredFields,fields:Object.assign(Object.assign({},t.fields),Rt({},n,s)),filteredFields:(null===(c=null===(u=e.schema)||void 0===u?void 0:u.filteredFields)||void 0===c?void 0:c.includes(d))?Object.assign(Object.assign(Object.assign({},t.filteredFields),void 0===v?{}:Rt({},d,v)),f?Rt({},f,v||t.formatted[f]):{}):t.filteredFields,formatted:Object.assign(Object.assign(Object.assign({},t.formatted),void 0===(null==s?void 0:s.value)||s.ignore?{}:X(t.formatted,n,null==s?void 0:s.value,e,l)||Rt({},n,v)),f?Rt({},f,v||t.formatted[f]):{})}}),{predictableErroredFields:[],erroredFields:[],fields:{},formatted:Object.assign({},null===(n=e.schema)||void 0===n?void 0:n.formattedDataDefaults),filteredFields:{}})},o=n(e.fields),i=n(e.steps[e.step.index]||{}),a=Object.assign(Object.assign({},o),{form:{scope:e.scope.getGlobalScope(),steps:Object.assign(Object.assign({},e.step),{data:Rt({},e.step.index,i),isValid:!i.predictableErroredFields.length}),isValid:!o.predictableErroredFields.length,messages:function(t){var r;return(null===(r=e.schema)||void 0===r?void 0:r.messages)?Object.keys(e.schema.messages).reduce((function(r,n){var o,i,a,u=tt(t,n);return(null===(o=e.schema)||void 0===o?void 0:o.messages)&&(null===(i=e.schema)||void 0===i?void 0:i.messages[n])&&((null===(a=e.schema.messages[n].values)||void 0===a?void 0:a.includes(u))||e.schema.messages[n].value===u||e.schema.messages[n].required&&!u)?[].concat(Mt(r),[e.schema.messages[n].name]):r}),[]):[]}(Object.assign(Object.assign({},e.initialValues),o.formatted))}});return e.formData=a,a}}),Ht=function(t,e){var r=e.clearedValue!==t.data.value;t.value=e.clearedValue,r&&t.publish(a("ON_FIELD_CLEARED",t.component.name)),t.rehydrate()},Yt=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.form,n=t.eventReducedSchema;null==n||n.clearFields.forEach((function(t){t.fields.forEach((function(n){var o=r.fields[n];if(o){if(!t.validations)return Ht(o,t);var i=St(t.useCurrentFieldValidation?e.data.value:o.value,t.validations);o.fieldHasError(i)&&Ht(o,t)}}))}))},events:function(t){return Object.keys(t.clearFields||{})}});function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}function zt(t){return function(t){if(Array.isArray(t))return Kt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Kt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Kt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Wt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==$t(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==$t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===$t(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t.AND="and",t.OR="or"}(Ut||(Ut={}));var Jt=(Wt(Gt={},Ut.OR,(function(t,e){return t.fieldHasError(St(t.value,e))})),Wt(Gt,Ut.AND,(function(t,e){var r=[];for(var n in e)r.push(t.fieldHasError(St(t.value,Wt({},n,e[n]))));return r.every((function(t){return t}))})),Gt),qt=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.field;null===(e=t.eventReducedSchema.visibilityConditions)||void 0===e||e.forEach((function(t){var e=t.validations,o=t.fieldName,i=t.fieldNames,u=t.rule,c=t.showOnlyIfTrue,l=zt(i||[o]),s=u||"or";l.forEach((function(t){if(t){var o=Jt[s](n,e),i=c?!0===Jt[s](n,e):!o;r.fields[t]?(r.fields[t].visibility=i,r.fields[t].rehydrate(),r.fields[t].visibility||(r.fields[t].errors={})):n.subscribe(a("ON_FIELD_MOUNT",t),(function(){r.fields[t].visibility=i,r.fields[t].rehydrate(),r.fields[t].visibility||(r.fields[t].errors={})}))}}))}))},events:function(t){return Object.keys(t.visibilityConditions||{})}});function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}var Qt=Object.freeze({__proto__:null,handler:function(t){var e,r,n,o,i,a,u=t.field,c=t.data.event,l=void 0,s=void 0,f={number:function(){var t;return parseInt(null===(t=null==c?void 0:c.target)||void 0===t?void 0:t.value)},checkbox:function(){var t;return!!(null===(t=null==c?void 0:c.target)||void 0===t?void 0:t.checked)}};l=f[null===(e=null==c?void 0:c.target)||void 0===e?void 0:e.type]?f[null===(r=null==c?void 0:c.target)||void 0===r?void 0:r.type]():null===(n=null==c?void 0:c.target)||void 0===n?void 0:n.value,(Array.isArray(c)||"object"!==Zt(c)||"string"==typeof c||"number"==typeof c)&&(l=c),(null==c?void 0:c.id)&&(l=null==c?void 0:c.id,s=c),(null==c?void 0:c.options)&&(l=null==c?void 0:c.options);var d=(null==l?void 0:l.toString().length)<((null===(a=null===(i=null===(o=u.data)||void 0===o?void 0:o.value)||void 0===i?void 0:i.toString())||void 0===a?void 0:a.length)||0);return{parsedEventValue:l,metadata:s,isDeletingValue:d}}}),Xt=Object.freeze({__proto__:null,handler:function(t){var e=t.data,r=t.field,n=t.eventReducedSchema.formatters;n&&!e.isDeletingValue&&(r.data.value=ft(r.data.value,n))},events:function(t){return Object.keys((null==t?void 0:t.formatters)||[])}});function te(t){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},te(t)}function ee(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(o=n.key,i=void 0,i=function(t,e){if("object"!==te(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(o,"string"),"symbol"===te(i)?i:String(i)),n)}var o,i}function re(t){var e=ie();return function(){var r,n=ue(t);if(e){var o=ue(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===te(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(this,r)}}function ne(t){var e="function"==typeof Map?new Map:void 0;return ne=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return oe(t,arguments,ue(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),ae(n,t)},ne(t)}function oe(t,e,r){return oe=ie()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&ae(o,r.prototype),o},oe.apply(null,arguments)}function ie(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function ae(t,e){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ae(t,e)}function ue(t){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(t)}var ce=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ae(t,e)}(i,ne(Error));var e,r,n,o=re(i);function i(t,e){var r,n=e.breaksObservingChain;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(r=o.call(this)).breaksObservingChain=!1,r.message=t,r.breaksObservingChain=n,r}return e=i,r&&ee(e.prototype,r),n&&ee(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(),le=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data,n=t.eventReducedSchema.formatters,o=e.scopedComponent,i=o.errorMessages,a=o.filter;if(a&&r.parsedEventValue&&!r.isDeletingValue){var u=n&&ft(r.parsedEventValue,n,!0)||r.parsedEventValue,c=St(u,a,i);if(e.fieldHasError(c))throw new ce("Filter applied ".concat(JSON.stringify(a)),{breaksObservingChain:!0})}}}),se=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.eventReducedSchema.masks;r&&(e.data.mask=(null==r?void 0:r.cleanMask)?void 0:function(t,e){var r=t;return Object.keys(e).forEach((function(t){var n=e[t],o=vt[t];o&&(r=o({value:r,maskValue:n}))})),r}(e.data.value,r))},events:function(t){return Object.keys(t.masks||{})}}),fe=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.eventReducedSchema.validations,n=t.form;if(r){var o=St(e.data.value,r,e.scopedComponent.errorMessages,n.formData.fields);e.fieldHasError(o)!==e.fieldHasError()&&e.publish("ON_FIELD_VALIDATION_TOGGLE",{field:e.data}),e.errors=e.data.visible?o:{},e.data.failedErrorMessages=e.getFieldErrorMessages(e.data)}},events:function(t){return Object.keys(t.validations||{})}}),de=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data;e.data.keyup=!0,e.value=r.parsedEventValue}}),ve=Object.freeze({__proto__:null,handler:function(t){var e=t.field,r=t.data;e.data.keydown=!0,e.value=r.parsedEventValue}}),pe=Object.freeze({__proto__:null,handler:function(t){var e=t.form;return{setScope:function(t){return e.scope.globalScope=t}}}});function ye(t){return ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(t)}function he(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==ye(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ye(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ye(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var be=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.event,o=t.payload,i=(he(e={},c.NAVIGATE_STEP_BACK,r.step.index-1),he(e,c.NAVIGATE_STEP_FORWARD,r.step.index+1),e),a=r.schema.components,u=i[n],l=o.constructor===Object?a[i[n]]:"string"==typeof o?(u=a.findIndex((function(t){return t.name===o})),a.find((function(t){return t.name===o}))):(u=o,a[o]);r.step=l?Object.assign(Object.assign({},r.step),{numSteps:a.length,navigated:!!l,index:l?u:r.step.index,currentStepSchema:l||r.step.currentStepSchema}):Object.assign(Object.assign({},r.step),{navigated:!1})}});function me(t){return me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},me(t)}function ge(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==me(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===me(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Oe=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.payload,o=(e=function(t){if(t&&Object.keys(t).length&&(t.scopeBlurredChildren||t.scopeChangedChildren||t.childrenScope))return Object.keys(r.fields).filter((function(e){var n;return(null==t?void 0:t.scopeBlurredChildren)&&r.fields[e].data.blured||(null==t?void 0:t.scopeChangedChildren)&&r.fields[e].data.changed||(null===(n=null==t?void 0:t.childrenScope)||void 0===n?void 0:n.includes(e))}))}(n))?Object.keys(r.fields).reduce((function(t,n){return e.includes(n)?Object.assign(Object.assign({},t),ge({},n,r.fields[n])):t}),{}):r.fields;Object.keys(o).forEach((function(t){o[t].fieldValidationsHaveError(!0)&&o[t].rehydrate()}))}});function Ee(t){return function(t){if(Array.isArray(t))return _e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return _e(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _e(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Se=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=t.formEventDirectives;null===(e=null==n?void 0:n.visibilityConditions)||void 0===e||e.forEach((function(t){Ee(t.fieldNames||[t.fieldName]).forEach((function(e){if(e){var n=r.fields[e];r.fields[e].visibility=null==n?void 0:n.fieldHasError(St(n.value,t.validations)),r.fields[e].rehydrate()}}))}))},events:function(t){return Object.keys((null==t?void 0:t.visibilityConditions)||{})}});function we(t){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(t)}function je(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==we(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==we(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===we(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ae(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Ie="${",Le="}",Fe="||",ke=Object.freeze({__proto__:null,handler:function(t){var e,r=t.form,n=function t(e){var n=(e=e.toString()).lastIndexOf(Ie);if(-1===n)return e;var o=e.substring(n+Ie.length,e.length),i=o.substring(0,o.indexOf(Le)),a=i.length,u="",c=i.split(Fe);if(c.length>1){i=c[0];var l,s=Ae(c);try{for(s.s();!(l=s.n()).done;){var f=l.value;if(f.includes("api")||f.includes("global")||f.includes("fields")||f.includes("hooks")||f.includes("configs")){var d=tt(r.scope.getGlobalScope(),f);d&&(u=d)}else u=f}}catch(t){s.e(t)}finally{s.f()}}var v=tt(r.scope.getGlobalScope(),i),p=void 0===v?u:v;if("string"!=typeof p&&0===n)return p;try{p=JSON.stringify(p).replace(/^"(.*)"$/,"$1")}catch(t){}return t(e.substring(0,n)+p+e.substring(n+a+Ie.length+Le.length,e.length))};r.scopedSchema=Object.assign(Object.assign({},r.schema),function t(e){if("string"==typeof e)return n(e);if("number"==typeof e)return e;var r=Object.assign({},e);return Object.keys(r).reduce((function(e,o){if(null===r[o])return e;if(Array.isArray(r[o]))return Object.assign(Object.assign({},e),je({},o,r[o].map(t)));if("object"===we(r[o]))return Object.assign(Object.assign({},e),je({},o,Object.assign({},t(Object.assign({},r[o])))));if("string"!=typeof r[o])return Object.assign(Object.assign({},e),je({},o,r[o]));if(!function(t){return/\$\{(.*)\}.*/g.test(t)}(r[o]))return Object.assign(Object.assign({},e),je({},o,r[o]));var i=n(r[o]);try{at(i)&&(i=JSON.parse(i))}catch(t){}return Object.assign(Object.assign({},e),je({},o,i))}),{})}({visibilityConditions:null===(e=null==r?void 0:r.schema)||void 0===e?void 0:e.visibilityConditions}))}});function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function De(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==xe(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==xe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===xe(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Te,Ce,Pe,Re,Me=function(t,e,r){var n=e();Object.keys(n).forEach((function(e){n[e].forEach((function(n){if(n.events){var o=n.events(r);if(Array.isArray(o)&&!o.includes(e))return}t.subscribe(a(e,null==r?void 0:r.name),n.handler)}))}))},Ve=function(){var t;return De(t={},"ON_FIELD_MOUNT",[W,Nt,Ct,fe,Xt,qt,Yt,se,Bt]),De(t,"ON_FIELD_CHANGE",[Qt,le,At,fe,Xt,qt,Yt,Ct,Bt,se]),De(t,"ON_FIELD_KEYUP",[Qt,le,de,fe,Xt,qt,Yt,Ct,Bt,se]),De(t,"ON_FIELD_KEYDOWN",[Qt,le,ve,fe,Xt,qt,Yt,Ct,Bt,se]),De(t,"ON_FIELD_REHYDRATE",[fe]),De(t,"ON_FIELD_CLEARED",[Xt,se,le,fe,Ct]),De(t,"ON_FIELD_CLICK",[fe,Ct,qt,Yt]),De(t,"ON_FIELD_BLUR",[It,Xt,se,fe,Ct,qt,Yt,Bt]),De(t,"ON_FIELD_FOCUS",[Lt,se]),De(t,"AFTER_FIELD_API_CALL",[Qt,le,fe,Xt,se,Bt,qt,Yt]),t},Ge=function(){var t;return De(t={},"ON_SCOPE_CHANGE",[ke,Se]),De(t,"ON_FORM_MOUNT",[W,pe,be,Se]),De(t,"VALIDATE_FORM",[Oe]),De(t,"ON_FORM_SUBMIT",[pe]),De(t,"ON_FORM_UN_MOUNT",[pe]),De(t,"NAVIGATE_STEP",[be]),De(t,"NAVIGATE_STEP_BACK",[be]),De(t,"NAVIGATE_STEP_FORWARD",[be]),De(t,u("ON_SCOPE_CHANGE"),[Se,W]),De(t,"ON_FORM_REHYDRATE",[Se]),De(t,"ON_FIELD_CHANGE",[Se]),t};function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function Be(t){return function(t){if(Array.isArray(t))return He(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return He(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return He(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$e(n.key),n)}}function $e(t){var e=function(t,e){if("object"!==Ue(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ue(e)?e:String(e)}function ze(t,e){return ze=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ze(t,e)}function Ke(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Je(t);if(e){var o=Je(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===Ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return We(t)}(this,r)}}function We(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Je(t){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Je(t)}var qe,Ze,Qe,Xe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ze(t,e)}(i,w);var e,r,n,o=Ke(i);function i(t,e,r,n){var a,u,c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),a=o.call(this,t),Te.set(We(a),void 0),Ce.set(We(a),void 0),Pe.set(We(a),void 0),Re.set(We(a),void 0),a.scopedComponent=e,g(We(a),Ce,e,"f"),g(We(a),Re,r,"f"),a.scope=n,g(We(a),Te,{blured:!1,changed:!1,mounted:!1,focused:!1,errors:{},failedErrorMessages:[],visible:!(null===(u=e.state)||void 0===u?void 0:u.hidden),ignore:null===(c=e.state)||void 0===c?void 0:c.ignoreValue,name:e.name},"f"),Me(t,Ve,e),a}return e=i,r=[{key:"value",get:function(){return m(this,Re,"f").setValue&&m(this,Ce,"f").props&&this.scopedComponent.props&&void 0!==this.scopedComponent.props[m(this,Re,"f").setValue]&&this.scopedComponent.props[m(this,Re,"f").setValue]!==m(this,Ce,"f").props[m(this,Re,"f").setValue]?void 0!==m(this,Te,"f").value&&m(this,Ce,"f").props[m(this,Re,"f").setValue]!==m(this,Te,"f").value?m(this,Te,"f").value:this.scopedComponent.props[m(this,Re,"f").setValue]:m(this,Te,"f").mask||m(this,Te,"f").value},set:function(t){m(this,Te,"f").value=t,this.scope.globalScope={namespace:"fields",key:m(this,Ce,"f").name,data:m(this,Te,"f")}}},{key:"component",get:function(){return m(this,Ce,"f")}},{key:"data",get:function(){return m(this,Te,"f")},set:function(t){g(this,Te,Object.assign(Object.assign({},m(this,Te,"f")),t),"f"),this.scope.globalScope={namespace:"fields",key:m(this,Ce,"f").name,data:m(this,Te,"f")}}},{key:"visibility",set:function(t){m(this,Te,"f").visible=t}},{key:"scopedComponent",get:function(){return m(this,Pe,"f")},set:function(t){g(this,Pe,t,"f")}},{key:"errors",get:function(){return m(this,Te,"f").errors},set:function(t){m(this,Te,"f").errors=t,this.scope.globalScope={namespace:"fields",key:m(this,Ce,"f").name,data:m(this,Te,"f")}}},{key:"props",get:function(){var t,e=this;if(!this.scopedComponent.name||!m(this,Re,"f"))return this.scopedComponent.props;var r={getValue:function(t){e.publish(a("ON_FIELD_CHANGE",e.component.name),{event:t}),e.publish("ON_FIELD_CHANGE",{component:e.component.name,event:t})},onBlur:function(t){return e.publish(a("ON_FIELD_BLUR",e.component.name),{event:t})},onClick:function(t){return e.publish(a("ON_FIELD_CLICK",e.component.name),{event:t})},onFocus:function(t){return e.publish(a("ON_FIELD_FOCUS",e.component.name),{event:t})},onKeyUp:function(t){return e.publish(a("ON_FIELD_KEYUP",e.component.name),{event:t})},onKeyDown:function(t){return e.publish(a("ON_FIELD_KEYDOWN",e.component.name),{event:t})},setValue:this.value,setErrorMessage:this.getFieldErrorMessages()[0],setErrorState:this.fieldHasError()};return Object.keys(m(this,Re,"f")).reduce((function(t,n){return void 0===r[n]?t:Object.assign(Object.assign({},t),function(t,e,r){return(e=$e(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},m(e,Re,"f")[n],r[n]))}),Object.assign({disabled:null===(t=this.scope.scope.configs)||void 0===t?void 0:t.disable},m(this,Pe,"f").props))}},{key:"mappings",get:function(){return m(this,Re,"f")}},{key:"getFieldErrorMessages",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m(this,Te,"f");return e.errors?Object.keys(e.errors).reduce((function(r,n){var o=e.errors;return(void 0===o?{}:o)[n].fail&&t.scopedComponent.errorMessages?[].concat(Be(r),[t.scopedComponent.errorMessages[n]||t.scopedComponent.errorMessages.default]):r}),[]):[]}},{key:"fieldHasError",value:function(t){return t||(t=m(this,Te,"f").errors||{}),!!Object.keys(t).find((function(e){return t&&t[e].fail}),[])}},{key:"fieldValidationsHaveError",value:function(t,e){var r=this;return!(!m(this,Pe,"f").validations||!m(this,Te,"f").visible||!Object.keys(m(this,Pe,"f").validations).find((function(n){var o=m(r,Pe,"f"),i=o.validations,a=void 0===i?{}:i,u=o.errorMessages,c=St(m(r,Te,"f").value,a[e||n],u);return t&&(r.errors=c),r.fieldHasError(c)})))}},{key:"eventReducedSchema",value:function(t){return{api:m(this,Pe,"f").api&&m(this,Pe,"f").api[t],clearFields:m(this,Pe,"f").clearFields&&m(this,Pe,"f").clearFields[t],formatters:m(this,Pe,"f").formatters&&m(this,Pe,"f").formatters[t],masks:m(this,Pe,"f").masks&&m(this,Pe,"f").masks[t],validations:m(this,Pe,"f").validations&&m(this,Pe,"f").validations[t],visibilityConditions:m(this,Pe,"f").visibilityConditions&&m(this,Pe,"f").visibilityConditions[t]}}},{key:"rehydrate",value:function(){this.publish(a("ON_FIELD_REHYDRATE",m(this,Ce,"f").name),{checksum:JSON.stringify(this.data)+JSON.stringify(this.scopedComponent)})}}],r&&Ye(e.prototype,r),n&&Ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function tr(t){return tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tr(t)}function er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rr(n.key),n)}}function rr(t){var e=function(t,e){if("object"!==tr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===tr(e)?e:String(e)}function nr(t,e){return nr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nr(t,e)}function or(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=ar(t);if(e){var o=ar(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(t,e){if(e&&("object"===tr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ir(t)}(this,r)}}function ir(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ar(t){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ar(t)}Te=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,Re=new WeakMap;var ur,cr,lr=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&nr(t,e)}(i,w);var e,r,n,o=or(i);function i(t,e,r,n,a,u){var c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),c=o.call(this,e),qe.set(ir(c),{}),Ze.set(ir(c),void 0),Qe.set(ir(c),void 0),c.steps={},g(ir(c),Ze,e,"f"),c.schema=n,c.scopedSchema=n,c.scope=r,c.formId=t,c.initialValues=null==a?void 0:a.initialValues,c.group=u,g(ir(c),Qe,{numSteps:null==n?void 0:n.components.length,navigated:!1,index:0,currentStepSchema:null==n?void 0:n.components[0],isValid:!1,data:{}},"f"),c.formData={predictableErroredFields:[],erroredFields:[],fields:{},formatted:{},form:{scope:r.getGlobalScope(),steps:m(ir(c),Qe,"f"),isValid:!1,messages:[]}},Me(e,Ge,n),c}return e=i,r=[{key:"step",get:function(){return m(this,Qe,"f")},set:function(t){g(this,Qe,t,"f")}},{key:"fields",get:function(){return m(this,qe,"f")||{}}},{key:"eventReducedSchema",value:function(t){var e=this;return this.scopedSchema?Object.keys(this.scopedSchema).reduce((function(r,n){return e.scopedSchema[n]?Object.assign(Object.assign({},r),function(t,e,r){return(e=rr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}({},n,e.scopedSchema[n][t])):r}),{}):{}}},{key:"getFieldInstance",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.name=t.name||t.component+"_"+JSON.stringify(t.props),this.steps[m(this,Qe,"f").index]||(this.steps[m(this,Qe,"f").index]={}),this.fields[t.name]||(this.fields[t.name]=new Xe(m(this,Ze,"f"),t,e,this.scope),this.steps[m(this,Qe,"f").index][t.name]=this.fields[t.name]),this.fields[t.name]}},{key:"rehydrate",value:function(){var t=this.scopedSchema;t.components;var e=h(t,["components"]);this.publish("ON_FORM_REHYDRATE",{checksum:JSON.stringify(e)})}},{key:"destroyField",value:function(t){m(this,qe,"f")[t]&&(delete m(this,qe,"f")[t],delete this.steps[m(this,Qe,"f").index][t])}}],r&&er(e.prototype,r),n&&er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),i}();function sr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=pr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function fr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */fr=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function l(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new j(o||[]);return n(a,"_invoke",{value:E(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function d(){}function v(){}function p(){}var y={};c(y,i,(function(){return this}));var h=Object.getPrototypeOf,b=h&&h(h(A([])));b&&b!==e&&r.call(b,i)&&(y=b);var m=p.prototype=d.prototype=Object.create(y);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==hr(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function E(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=_(a,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function _(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function A(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:v,configurable:!0}),v.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(O.prototype),c(O.prototype,a,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new O(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=A,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),w(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;w(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function dr(t,e,r){return(e=Or(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vr(t){return function(t){if(Array.isArray(t))return yr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pr(t,e){if(t){if("string"==typeof t)return yr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yr(t,e):void 0}}function yr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hr(t){return hr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hr(t)}function br(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Or(n.key),n)}}function gr(t,e,r){return e&&mr(t.prototype,e),r&&mr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Or(t){var e=function(t,e){if("object"!==hr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===hr(e)?e:String(e)}qe=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,function(t){t.OBSERVER="OBSERVER",t.REACT_FIELD_ADAPTER="REACT FIELD ADAPTER",t.FIELD_HANDLER="FIELD HANDLER"}(ur||(ur={}));var Er=function(){function t(){br(this,t),this.workers={},this.getFormInstance=this.getFormInstance.bind(this),this.getGroupFormsIds=this.getGroupFormsIds.bind(this)}return gr(t,[{key:"getGroupFormsIds",value:function(t){var e=this;return Object.keys(this.workers||{}).filter((function(r){return e.workers[r].group===t}),[])}},{key:"getFormInstance",value:function(){var t,e,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,o=arguments.length>1?arguments[1]:void 0;if(this.workers[n]&&!(null==o?void 0:o.newInstance))return this.workers[n];var i=new _r(n,null===(e=null===(t=null==o?void 0:o.initialScope)||void 0===t?void 0:t.configs)||void 0===e?void 0:e.enableLogging),a=new D(i);return a.initialScope=Object.assign(Object.assign({},null==o?void 0:o.initialScope),null===(r=null==o?void 0:o.schema)||void 0===r?void 0:r.iVars),this.workers[n]=new lr(n,i,a,null==o?void 0:o.schema,{initialValues:(null==o?void 0:o.initialValues)||{}},null==o?void 0:o.group),this.workers[n]}}]),t}(),_r=function(){function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];br(this,t),this.regexBasedEvents={},this.events={},this.history={},cr.set(this,(function(t){var e=t.event,n=t.data,o=t.payload,i=function(t){return t.split("/")[1]||""}(e),a=wr(r.namespace,null==n?void 0:n.opts),u=a.fields[i],c=function(t){return Array.isArray(t.split("/"))?t.split("/")[0]:t}(e);return{eventReducedSchema:u&&u.eventReducedSchema(c),formEventDirectives:a&&a.eventReducedSchema(c),namespace:r.namespace,coreEvent:c,form:a,field:u,event:e,data:n,payload:o}})),this.namespace=e,this.enableLogging=n}return gr(t,[{key:"runForRegexBasedEvent",value:function(t,e){for(var r=!1,n=0,o=Object.keys(this.events);n<o.length;n++){var i=o[n];(r=t.test(i))&&e(i)}return r}},{key:"handleRegexSubscription",value:function(t,e){var r=this;this.runForRegexBasedEvent(t,(function(t){return r.subscribe(t,e)}))||(this.regexBasedEvents[t]={regex:t,handlers:Array.isArray(this.events[t])?[].concat(vr(this.events[t]),[e]):[e]})}},{key:"subscribe",value:function(t,e){var r=this;return"object"===hr(t)?(this.handleRegexSubscription(t,e),function(){}):(this.events=Object.assign(Object.assign({},this.events),dr({},t,Array.isArray(this.events[t])?[].concat(vr(this.events[t]),[e]):[e])),function(){r.unsubscribe(t,e)})}},{key:"unsubscribe",value:function(t,e){this.events=Object.assign(Object.assign({},this.events),dr({},t,this.events[t].filter((function(t){return t!==e}))))}},{key:"isAsyncFunction",value:function(t){var e=t.toString().trim();return!!("AsyncFunction"===t[Symbol.toStringTag]||"AsyncFunction"==t.constructor.name||e.match(/^async /)||e.match(/return _ref[^\\.]*\.apply/)||t instanceof Promise)}},{key:"publish",value:function(t,e){return b(this,void 0,void 0,fr().mark((function r(){var n,o,i,a=this;return fr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null==e?void 0:e.checksum)||this.history[t]!==(null==e?void 0:e.checksum)){r.next=2;break}return r.abrupt("return");case 2:if(this.history[t]=null==e?void 0:e.checksum,"object"!==hr(t)){r.next=6;break}return this.runForRegexBasedEvent(t,(function(t){return a.publish(t,e)})),r.abrupt("return");case 6:n=0,o=Object.keys(this.regexBasedEvents);case 7:if(!(n<o.length)){r.next=16;break}if(i=o[n],!new RegExp(this.regexBasedEvents[i].regex).test(t)){r.next=13;break}return r.next=13,this.publishForEvents(t,e,dr({},t,this.regexBasedEvents[i].handlers));case 13:n++,r.next=7;break;case 16:return r.abrupt("return",this.publishForEvents(t,e,this.events));case 17:case"end":return r.stop()}}),r,this)})))}},{key:"publishForEvents",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return b(this,void 0,void 0,fr().mark((function n(){var o,i,a,u,c,l=this;return fr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r[t]){n.next=2;break}return n.abrupt("return",{});case 2:o={},i=sr(r[t]),n.prev=4,u=fr().mark((function r(){var n,i,u;return fr().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=a.value,r.prev=1,n){r.next=4;break}return r.abrupt("return",{v:void 0});case 4:if(i=m(l,cr,"f").call(l,{data:Object.assign(Object.assign({},e),o),payload:e,event:t,namespace:l.namespace}),!l.isAsyncFunction(n)){r.next=12;break}return r.next=9,n(i,(function(){return l.unsubscribe(t,n)}));case 9:r.t0=r.sent,r.next=13;break;case 12:r.t0=n(i,(function(){return l.unsubscribe(t,n)}));case 13:u=r.t0,o=Object.assign(Object.assign({},o),u),r.next=23;break;case 17:if(r.prev=17,r.t1=r.catch(1),!(r.t1 instanceof ce&&r.t1.breaksObservingChain)){r.next=22;break}return l.logError(ur.OBSERVER,t,"publish",r.t1),r.abrupt("return",{v:{}});case 22:throw r.t1;case 23:case"end":return r.stop()}}),r,null,[[1,17]])})),i.s();case 7:if((a=i.n()).done){n.next=14;break}return n.delegateYield(u(),"t0",9);case 9:if("object"!==hr(c=n.t0)){n.next=12;break}return n.abrupt("return",c.v);case 12:n.next=7;break;case 14:n.next=19;break;case 16:n.prev=16,n.t1=n.catch(4),i.e(n.t1);case 19:return n.prev=19,i.f(),n.finish(19);case 22:return n.abrupt("return",Object.assign(Object.assign({},o),wr(this.namespace).formData));case 23:case"end":return n.stop()}}),n,this,[[4,16,19,22]])})))}},{key:"logError",value:function(t,e,r,n){this.enableLogging&&"LOG"!==e&&this.publish("LOG",{level:"error",data:{event:e,error:n},action:r,flow:t})}},{key:"logInfo",value:function(t,e,r,n){this.enableLogging&&"LOG"!==e&&this.publish("LOG",{level:"info",data:Object.assign({event:e},n),action:r,flow:t})}}]),t}();cr=new WeakMap;var Sr=new Er,wr=Sr.getFormInstance,jr=Sr.getGroupFormsIds;const Ar=({children:r,component:n,wrapper:o,propsMapping:i={},formId:u,onMount:c,onChange:l,onFocus:s,onBlur:f,onClick:d,onRehydrate:v,afterApiCall:p})=>{const[h,b]=y(),[m,g]=y(),[O,E]=y(),[_,S]=y(),[w,j]=y(),[A,N]=y(),I=e.useMemo((()=>wr(u).getFieldInstance(n,i)),[]),L=e.useMemo((()=>o),[o]);return e.useMemo((()=>{I.publish(a("ON_FIELD_MOUNT",n.name)),c(I.data)}),[]),e.useEffect((()=>{m&&v(I.data)}),[m]),e.useEffect((()=>{h&&l(I.data)}),[h]),e.useEffect((()=>{O&&f(I.data)}),[O]),e.useEffect((()=>{_&&s(I.data)}),[_]),e.useEffect((()=>{w&&d(I.data)}),[w]),e.useEffect((()=>{A&&p(I.data)}),[A]),e.useEffect((()=>I.subscribe(a("ON_FIELD_REHYDRATE",n.name),(()=>g()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_BLUR",n.name),(()=>E()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_CHANGE",n.name),(()=>b()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_FOCUS",n.name),(()=>S()))),[]),e.useEffect((()=>I.subscribe(a("ON_FIELD_CLICK",n.name),(()=>j()))),[]),e.useEffect((()=>I.subscribe(a("AFTER_FIELD_API_CALL",n.name),(()=>N()))),[]),I.data.visible&&I.data.mounted?t.jsx(L,Object.assign({},I.props,{children:r})):null},Nr=e.forwardRef(((e,r)=>t.jsx("input",{ref:r,type:"submit",style:{display:"none"}})));Nr.displayName="Submit";const Ir=e.createContext({});Ir.displayName="FormContext";const Lr=o.default.forwardRef((({autoComplete:r,hooks:n,iVars:i,id:a=l,submitOnValidOnly:s=!0,initialValues:f={},className:d,schema:v,group:p,onData:y,onSubmit:h,onBlur:b,onClick:m,afterApiCall:g,onFormMount:O,onFieldMount:E,onStep:_,onFocus:S,onLog:w,onScopeChange:j,onFieldRehydrate:A,renderFieldWrapper:N,disable:I},L)=>{var F;const[,k]=e.useReducer((t=>t+1),0),x=e.useRef(null),D=e.useRef(null),{mapper:T,propsMapping:C}=e.useContext(Ir),P=e.useMemo((()=>wr(a,{group:p,schema:v,newInstance:!0,initialScope:{configs:Object.assign(Object.assign({},null==v?void 0:v.configs),{enableLogging:!!w,disable:I}),global:Object.assign(Object.assign({},null==v?void 0:v.iVars),i)},initialValues:f})),[]);e.useEffect((()=>{P.publish("ON_FORM_MOUNT")}),[]);const R=e.useMemo((()=>T.step?T.step.component:o.default.Fragment),[]),M=e.useMemo((()=>{if(!P.step.currentStepSchema)return;const e=(r,n=0)=>{var o;return null===(o=r.children)||void 0===o?void 0:o.map(((r,o)=>{var i;const u=null===(i=T[r.component])||void 0===i?void 0:i.component,c=t.jsx(Ar,Object.assign({component:r,wrapper:u,propsMapping:C[r.component]||C.__default__,formId:a,onMount:t=>{E&&E(P.formData,r,t)},onRehydrate:t=>{A&&A(P.formData,r,t)},onChange:t=>{y&&y(P.formData,r,t)},onBlur:t=>{b&&b(P.formData,r,t)},onClick:t=>{m&&m(P.formData,t)},afterApiCall:t=>{g&&g(P.formData,r,t)},onFocus:t=>{S&&S(P.formData,r,Object.assign(Object.assign({},t),{schemaLocation:{step:P.step.index,depth:n,index:o}}))}},{children:Array.isArray(r.children)?e(r,n++):r.children}),`${P.step.index}_${n}_${r.name}_${r.component}_${o}`);return N?N(r,c):c}))};return e(P.step.currentStepSchema)}),[P.step.index,a]);return e.useEffect((()=>{P.scope.globalScope={namespace:"configs",data:{disable:I}}}),[I]),e.useEffect((()=>{O&&O(P.formData)}),[]),e.useEffect((()=>{P.scope.globalScope={namespace:"configs",data:{disable:I}}}),[I]),e.useEffect((()=>{P.scope.globalScope={namespace:"global",data:Object.assign(Object.assign({},null==v?void 0:v.iVars),i)}}),[JSON.stringify(i)]),e.useEffect((()=>P.subscribe("ON_FORM_REHYDRATE",(()=>{k()}))),[]),e.useEffect((()=>P.subscribe("LOG",(({data:t})=>w&&w(t)))),[]),e.useMemo((()=>P.subscribe(u("ON_SCOPE_CHANGE"),(t=>j&&j(P.scope.scope,t.data.namespace,t.data.key)))),[]),e.useEffect((()=>P.subscribe("ON_FORM_SUBMIT",(({data:t})=>{const e=(null==n?void 0:n.preSubmit)&&(null==n?void 0:n.preSubmit(P.formData));!P.formData.form.isValid&&s||h&&h(t.event,Object.assign(Object.assign({},P.formData),{formatted:Object.assign(Object.assign({},P.formData.formatted),e)}))}))),[]),e.useEffect((()=>P.subscribeBulk([c.NAVIGATE_STEP_BACK,c.NAVIGATE_STEP_FORWARD,c.NAVIGATE_STEP],(()=>{_&&_(P.formData),k()}))),[]),e.useImperativeHandle(L,(()=>({values:()=>P.formData,step:P.publishFor(c.NAVIGATE_STEP),stepForward:P.publishFor(c.NAVIGATE_STEP_FORWARD),stepBack:P.publishFor(c.NAVIGATE_STEP_BACK),validateForm:P.publishFor(c.VALIDATE_FORM),submit:()=>{var t;return null===(t=D.current)||void 0===t?void 0:t.click()},schema:v})),[]),t.jsxs("form",Object.assign({action:P.scopedSchema.action,method:P.scopedSchema.method,className:d,ref:x,autoComplete:r,onSubmit:t=>{P.publish(c.ON_FORM_SUBMIT,{event:t})}},{children:[t.jsx(R,Object.assign({},null===(F=P.step.currentStepSchema)||void 0===F?void 0:F.props,{children:M})),!P.scopedSchema.disableFormSubmit&&t.jsx(Nr,{ref:D})]}))})),Fr=o.default.forwardRef(((e,r)=>e.schema?t.jsx(Lr,Object.assign({},e,{ref:r})):e.renderLoading?e.renderLoading():t.jsx(t.Fragment,{})));exports.ALL_NAMESPACE_EVENTS=u,exports.BUILD_EVENT=a,exports.CoreEvents=c,exports.FormProvider=({children:e,mapper:r,propsMapping:n})=>t.jsx(Ir.Provider,Object.assign({value:{mapper:r,propsMapping:n}},{children:e})),exports.SchemaGuard=Fr,exports.asFormField=({Comp:r,propsMapping:n})=>o=>{var{name:i,validations:u,errorMessages:c,masks:l,filter:f,formatters:d,visibilityConditions:v,formId:p=s,visibility:b=!0,value:m}=o,g=h(o,["name","validations","errorMessages","masks","filter","formatters","visibilityConditions","formId","visibility","value"]);const[,O]=y(),E=e.useMemo((()=>({state:{hidden:!b},component:"",name:i,validations:u,errorMessages:c,masks:l,filter:f,visibilityConditions:v,formatters:d})),[c,i,f,d,l,u,v]),_=e.useMemo((()=>wr(p).getFieldInstance(E,n)),[]);return e.useMemo((()=>{_.subscribeBulk([a("ON_FIELD_MOUNT",E.name),a("ON_FIELD_REHYDRATE",E.name)],O)}),[]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_CHANGE",E.name),(({data:t})=>{O(),g[n.getValue]&&g[n.getValue](t.event,_.data)}))}),[g[n.getValue]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_BLUR",E.name),(({data:t})=>{O(),g[n.onBlur]&&g[n.onBlur](t.event)}))}),[g[n.onBlur]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_FOCUS",E.name),(({data:t})=>{O(),g[n.onFocus]&&g[n.onFocus](t.event)}))}),[g[n.onFocus]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_KEYUP",E.name),(({data:t})=>{O(),g[n.onKeyUp]&&g[n.onKeyUp](t.event)}))}),[g[n.onKeyUp]]),e.useMemo((()=>{_.subscribe(a("ON_FIELD_KEYDOWN",E.name),(({data:t})=>{O(),g[n.onKeyDown]&&g[n.onKeyDown](t.event)}))}),[g[n.onKeyDown]]),e.useEffect((()=>{void 0!==m&&(_.value=m,_.rehydrate())}),[m]),e.useEffect((()=>{_.visibility=b,_.rehydrate()}),[b]),e.useEffect((()=>()=>wr(p).destroyField(i)),[]),_.data.visible?t.jsx(r,Object.assign({},g,_.props)):t.jsx(t.Fragment,{})},exports.getFormInstance=wr,exports.getGroupFormsIds=jr,exports.useForm=({onValid:t,onData:r,onSubmit:n,id:o=s,ids:i})=>{const a=(t,e)=>{e&&(i?i.map((r=>wr(r).subscribe(t,(({data:t})=>e(wr(r).formData,{field:t.field}))))):wr(o).subscribe(t,e))},l=()=>i?i.reduce(((t,e)=>Object.keys(t).reduce(((r,n)=>Object.assign(Object.assign({},r),{[n]:Object.assign(Object.assign({},t[n]),wr(e).formData[n])})),{})),{formatted:{},erroredFields:{},fields:{},form:{},predictableErroredFields:{},filteredFields:{}}):wr(o).formData,f=e.useCallback((()=>{let t=wr(o).formData;i&&(t=i.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:wr(e).formData})),{})),r&&r(t)}),[r,t]);e.useEffect((()=>a("ON_FIELD_VALIDATION_TOGGLE",t)),[t]),e.useEffect((()=>a(u(c.ON_FIELD_CHANGE),f)),[r,t]),e.useEffect((()=>a(u(c.ON_FIELD_REHYDRATE),f)),[r,t]),e.useEffect((()=>a(c.ON_FORM_SUBMIT,(()=>{n&&n(l())}))),[n]);return{submitForm:()=>wr(i?i[0]:o).publish(c.ON_FORM_SUBMIT),formData:l}};
2
+ //# sourceMappingURL=asFormField-473eb268.js.map