UNPKG

@bolttech/form-engine

Version:

A form engine based on form events for react projects

1 lines 108 kB
"use strict";var e=require("react/jsx-runtime"),t=require("react");require("./types.js");var r=require("credit-card-type");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),i=n(r),a=function(e,t,r){return t?e+"/"+t+(r?"/"+r:""):e},u=function(e){return new RegExp("^(".concat(e,").*$"),"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",ON_FIELD_BINDED:"ON_FIELD_BINDED",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",ON_FORM_DESTROY_FIELD:"ON_FORM_DESTROY_FIELD",NAVIGATE_STEP:"NAVIGATE_STEP",NAVIGATE_STEP_FORWARD:"NAVIGATE_STEP_FORWARD",NAVIGATE_STEP_BACK:"NAVIGATE_STEP_BACK",VALIDATE_FORM:"VALIDATE_FORM",BIND_FIELDS:"BIND_FIELDS",LOG:"LOG"},s="default_form_id",l="default_form_hook_id";function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(e,t)||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(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var p,v,h=function(){var e=f(t.useState(0),2),r=e[0],n=e[1];return[r,function(){return n((function(e){return e+1}))}]};function y(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function b(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function u(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(a,u)}c((n=n.apply(e,t||[])).next())}))}function m(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function g(e,t,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 t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}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 e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),u=new k(n||[]);return o(a,"_invoke",{value:I(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",p="suspendedYield",v="executing",h="completed",y={};function b(){}function m(){}function g(){}var _={};s(_,a,(function(){return this}));var S=Object.getPrototypeOf,j=S&&S(S(x([])));j&&j!==r&&n.call(j,a)&&(_=j);var w=g.prototype=b.prototype=Object.create(_);function A(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==O(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function I(t,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===h){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=F(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=f(t,r,n);if("normal"===s.type){if(o=n.done?h:p,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=h,n.method="throw",n.arg=s.arg)}}}function F(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,F(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(O(t)+" is not iterable")}return m.prototype=g,o(w,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=s(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},A(N.prototype),s(N.prototype,u,(function(){return this})),t.AsyncIterator=N,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new N(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},A(w),s(w,c,"Generator"),s(w,a,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=x,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(D),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),D(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;D(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S(n.key),n)}}function S(e){var t=function(e,t){if("object"!=O(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==O(t)?t:t+""}"function"==typeof SuppressedError&&SuppressedError;var j,w=function(){return e=function e(t){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),p.set(this,void 0),v.set(this,{}),this.debounceTime=50,this.debounce=function(e){var t=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,v,"f")[e]&&clearTimeout(m(n,v,"f")[e]),m(n,v,"f")[e]=setTimeout((function(){clearTimeout(m(n,v,"f")[e]),r(e())}),t)})));case 1:case"end":return r.stop()}}),r)})))},g(this,p,t,"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={}},t=[{key:"subscribe",value:function(e,t){this.subscriptions[e]&&this.subscriptions[e](),this.subscriptions[e]=m(this,p,"f").subscribe(e,t)}},{key:"subscribeBulk",value:function(e,t){var r=this;e.forEach((function(e){return r.subscribe(e,t)}))}},{key:"publish",value:function(e,t){m(this,p,"f").publish(e,t)}},{key:"publishFor",value:function(e){var t=this;return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b(t,void 0,void 0,E().mark((function t(){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,m(this,p,"f").publish(e,r);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}}},{key:"logError",value:function(e,t,r,n){m(this,p,"f").logError(e,t,r,n)}},{key:"logInfo",value:function(e,t,r,n){m(this,p,"f").logInfo(e,t,r,n)}}],t&&_(e.prototype,t),r&&_(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function N(e,t,r){return(t=F(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,F(n.key),n)}}function F(e){var t=function(e,t){if("object"!=A(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==A(t)?t:t+""}function L(e,t,r){return t=k(t),function(e,t){if(t&&("object"==A(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,D()?Reflect.construct(t,r||[],k(e).constructor):t.apply(e,r))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},k(e)}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}p=new WeakMap,v=new WeakMap;var T=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=L(this,t,[e]),j.set(r,{global:{},api:{},hooks:{},configs:{},fields:{}}),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(t,w),r=t,n=[{key:"scope",get:function(){return m(this,j,"f")||{}}},{key:"getGlobalScope",value:function(e,t){return e&&!t&&this.scope[e]?this.scope[e]:e&&t&&this.scope[e]?this.scope[e][t]:m(this,j,"f")}},{key:"initialScope",set:function(e){g(this,j,e||m(this,j,"f"),"f")}},{key:"globalScope",set:function(e){var t=e.namespace,r=e.key,n=e.data;r||(m(this,j,"f")[t]=n),r&&!m(this,j,"f")[t]&&(m(this,j,"f")[t]=N({},r,n)),m(this,j,"f")[t]&&r&&(m(this,j,"f")[t]=Object.assign(Object.assign({},m(this,j,"f")[t]),N({},r,n)));var o=r?a("ON_SCOPE_CHANGE",t,r):u(a("ON_SCOPE_CHANGE",t,r));this.publish(o,{scope:this.scope,namespace:t,key:r}),this.publish("ON_SCOPE_CHANGE")}}],n&&I(r.prototype,n),o&&I(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();j=new WeakMap;var C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"").split(".").reduce((function(e,t){return(e||{})[t]}),e)};function P(e){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(e)}function R(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return M(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function V(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=P(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==P(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var G="${",U="}",B="||",Y=function(e,t){return t?Object.keys(e).reduce((function(r,n){return t.includes(n)?Object.assign(Object.assign({},r),V({},n,e[n])):r}),{}):e},H=function(e,t,r){var n=(e=e.toString()).lastIndexOf(G);if(-1===n)return e;var o=e.substring(n+G.length,e.length),i=o.substring(0,o.indexOf(U)),a=i.length,u="",c=i.split(B);if(c.length>1){i=c[0];var s,l=R(c);try{for(l.s();!(s=l.n()).done;){var f=s.value;if(f.includes("api")||f.includes("global")||f.includes("fields")||f.includes("hooks")||f.includes("configs")){var d=C(r.getGlobalScope(),f);d&&(u=d)}else u=f}}catch(e){l.e(e)}finally{l.f()}}var p=C(t.getGlobalScope(),i),v=void 0===p?u:p;if("string"!=typeof v&&0===n)return v;try{v=JSON.stringify(v).replace(/^"(.*)"$/,"$1")}catch(e){}return e.substring(0,n)+v+e.substring(n+a+G.length+U.length,e.length)};function z(e){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z(e)}function $(e){return function(e){if(Array.isArray(e))return K(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return K(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(e,t):void 0}}(e)||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 K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function W(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=z(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==z(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J=function(e,t,r,n,o){var i=function(e){return"boolean"==typeof r&&"string"==typeof e?/true/.test(e):r.constructor(e)},a=t.split(".");if(1===a.length)return Object.assign(Object.assign({},e),W({},t,i(H(r,n.scope,o.scope))));return function e(t,a){var u=$(t);u.splice(0,1);var c=1!==t.length?e(u,a?a[t[0]]:{}):i(H(r,n.scope,o.scope));return Object.assign(Object.assign({},a),W({},t[0],c))}(a,e)};function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Z(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Z(e,t):void 0}}(e,t)||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 Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Q=function(e,t){var r=X(e.toString()),n=i.default(r);return[(null==t?void 0:t.length)?null==n?void 0:n.filter((function(e){var r=e.type;return t.some((function(e){return e===r}))}))[0]:n[0],r]},X=function(e){return null==e?void 0:e.replace(/ /g,"")},ee=function(e,t){return t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.reduce((function(e,r,n){var o=q(e,2),i=o[0],a=o[1],u=r-(t[n-1]||0);return["".concat(i,"([0-9]{0,").concat(u,"})"),"".concat(a,"$").concat(n+1," ")]}),["",""]),n=q(r,2),o=n[0],i=n[1];return e.replace(new RegExp(o),i).trim()}(e.slice(0,null==t?void 0:t.lengths[0]),t.gaps):e.slice(0,19)};function te(e){if("string"!=typeof e)return!1;try{var t=JSON.parse(e),r=Object.prototype.toString.call(t);return"[object Object]"===r||"[object Array]"===r}catch(e){return!1}}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ne(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ne(e,t):void 0}}(e,t)||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 ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var oe=function(e){var t=e.value,r=e.formatterValue;if(!t)return t;var n="",o=0;return r.forEach((function(e,i){var a=0===i?i:r[i-1].position+1;t[e.position]==e.value&&o++,n+=t.slice(a,e.position)})),n+=t.slice(n.length+o)},ie={splitter:function(e){var t=e.value,r=e.formatterValue;if(!t)return t;var n=oe({value:t,formatterValue:r});return r.forEach((function(e){e.position>=t.length||(n=n.slice(0,e.position)+e.value+n.slice(e.position,null==n?void 0:n.length))})),n},undo_splitter:oe,capitalize:function(e){var t=e.value;return t?t.charAt(0).toUpperCase()+t.slice(1):t},upperCase:function(e){var t=e.value;return t?t.toUpperCase():t},gapsCreditCard:function(e){var t=e.value,r=e.formatterValue;if(t){var n=re(Q(t,r),2),o=n[0],i=n[1];return ee(i,o)}},onlyNumbers:function(e){return e.value.replace(/([^\d])+/gim,"")},onlyLetters:function(e){return e.value.replace(/([0-9:\s/-])+/g,"")},regex:function(e){var t=e.value,r=e.formatterValue;return t.replace(new RegExp(r,"g"),"")},callback:function(e){var t=e.value;return(0,e.formatterValue)(t)}},ae=function(e,t,r){var n=e;return Object.keys(t).forEach((function(e){var o=t[e],i=ie[r?"undo_".concat(e):e];i&&(n=i({value:n,formatterValue:o}))})),n},ue=function(e){var t=e.value,r=void 0===t?"":t,n=e.maskValue,o=r;return n.forEach((function(e){var t=e.to,n=void 0===t?o.length:t,i=e.mask,a=e.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},ce={generic:ue,cardNumber:function(e){var t=e.value;return ue({value:t,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(e){var t=e.value;return ue({value:t,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(e){return e.value.replace(/[^\dA-Z]/g,"").replace(/(.{4})/g,"$1 ").trim()},cardDate:function(e){var t=e.value.replace(/\D/g,""),r=t.slice(0,2);return t.length>=5?"".concat(r,"/").concat(t.slice(2,4)):t.length>=3?"".concat(r,"/").concat(t.slice(2)):t},currencyMask:function(e){var t=e.value,r=void 0===t?"":t,n=e.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(e){var t=e.value.replace(/\D/g,""),r=t.slice(0,2);return t.length>=5?"".concat(r,"-").concat(t.slice(2,9)):t.length>=3?"".concat(r,"-").concat(t.slice(2)):t},replaceAll:function(e){var t=e.value,r=void 0===t?"":t,n=e.maskValue;return n&&"string"==typeof r?("number"==typeof n&&(n=null==n?void 0:n.toString()),new Array(r.length+1).join(n)):r},callback:function(e){var t=e.value;return(0,e.maskValue)(t)}};function se(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=le(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==le(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function le(e){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},le(e)}function fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,t)||de(e,t)||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 de(e,t){if(e){if("string"==typeof e)return pe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?pe(e,t):void 0}}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ve={DDMMYYYY:function(e){var t=e.split(e.includes("/")?"/":"-");return"".concat(t[1],"/").concat(t[0],"/").concat(t[2])},YYYYMMDD:function(e){var t=e.split(e.includes("/")?"/":"-");return"".concat(t[1],"/").concat(t[2],"/").concat(t[0])},YYYYDDMM:function(e){var t=e.split(e.includes("/")?"/":"-");return"".concat(t[2],"/").concat(t[1],"/").concat(t[0])},MMDDYYYY:function(e){return e},timestamp:function(e){return new Date(e).toString()}},he=function(e){var t=e.value,r=e.validationValue,n=new RegExp(r);return{fail:!n.test(t)}},ye=function(e){var t=e.value,r=void 0===t?"":t,n=e.validationValue.some((function(e){var t=e.to,n=e.from,o=e.validations,i=r.substring(t,n);return Oe(ge(i,o))}));return{fail:n}},be=function(e){var t,r,n,o,i,a=e.value,u=void 0===a?"":a,c=e.validationValue;if(!(null===(t=null==c?void 0:c.target)||void 0===t?void 0:t.value)&&!(null===(r=null==c?void 0:c.origin)||void 0===r?void 0:r.intervals))return{fail:!1};var s,l=c.origin.value||u,f=new Date(ve[null==c?void 0:c.origin.format](l).toString()),d=new Date;if((null===(n=null==c?void 0:c.target)||void 0===n?void 0:n.format)&&(d=s=new Date(ve[null===(o=null==c?void 0:c.target)||void 0===o?void 0:o.format](c.target.value).toString())),c.origin.intervals){d=function(e,t){var r={years:function(e,t){return new Date(e.setUTCFullYear(e.getUTCFullYear()+t))},months:function(e,t){return new Date(e.setUTCMonth(e.getUTCMonth()+t))},days:function(e,t){return new Date(e.setDate(e.getUTCDate()+t))}};return Object.keys(t).reduce((function(e,n){return r[n](e,t[n])}),new Date(e))}(f,c.origin.intervals);var p=new Date;(null===(i=c.target)||void 0===i?void 0:i.value)&&s&&(p.setDate(s.getDate()),p.setMonth(s.getMonth())),f=new Date("".concat(p.getUTCMonth()+1,"/").concat(p.getUTCDate(),"/").concat(p.getUTCFullYear()))}if(c.onlyValidDate&&(!(d instanceof Date&&isFinite(d))||!(d instanceof Date&&isFinite(f))||l.length<8))return{fail:!0};var v=f.getTime(),h=d.getTime();return{fail:{">":v>h,">=":v>=h,"<":v<h,"<=":v<=h,"===":v===h,"!==":v!==h}[null==c?void 0:c.operator]}},me={between:function(e){var t,r=e.value,n=e.validationValue,o=!1;if(!(2==(null===(t=null==n?void 0:n.dates)||void 0===t?void 0:t.length)||(null==n?void 0:n.start)&&(null==n?void 0:n.end)))return{fail:!1};if(n.dates){var i,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=de(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},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(be({value:r,validationValue:u}).fail){o=!0;break}}}catch(e){a.e(e)}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 e(t){var r=t.value,n=void 0===r?"":r,o=t.validationValue;if(!o)return{fail:!1};var i=function(e){if(e.forceDefinedOrigin&&void 0===e.origin||e.forceDefinedTarget&&void 0===e.target)return{fail:!1};var t=void 0===e.origin?n:e.origin,r=void 0===e.target?n:e.target;return{"!==":(t||n)!==(r||n),"===":(t||n)===(r||n),"<":(t||n)<(r||n),">":(t||n)>(r||n),"<=":(t||n)<=(r||n),">=":(t||n)>=(r||n),"!!origin":!!String(t||n).trim().length}[e.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&&e({value:n,validationValue:o.conditions}).fail:a||e({value:n,validationValue:o.conditions}).fail),{fail:a}},multipleValidations:function(e){var t=e.value,r=void 0===t?"":t,n=e.validationValue;if(!n)return{fail:!1};var o=Object.values(ge(r,n.validations));return{fail:{AND:function(){return!!o.every((function(e){return e.fail}))},OR:function(){return!!o.some((function(e){return e.fail}))},NOT:function(){return!o.every((function(e){return e.fail}))}}[n.rule]()}},date:be,validDate:function(e){var t=e.value,r=void 0===t?"":t,n=e.validationValue;if(!n)return{fail:!1};var o=ve[n](r).toString().split(/[/-]/),i=parseInt(o[2],10),a=parseInt(o[0],10)-1,u=parseInt(o[1],10),c=new Date(i,a,u);return{fail:!(c.getFullYear()===i&&c.getMonth()===a&&c.getDate()===u)}},length:function(e){var t=e.value,r=e.validationValue,n=t;return"string"!=typeof n&&(n=null==t?void 0:t.toString()),{fail:!t||(null==n?void 0:n.length)===r}},greaterThan:function(e){var t=e.value,r=e.validationValue;return{fail:!t||parseInt(t)<=parseInt(r)}},maxLength:function(e){var t=e.value,r=void 0===t?"":t,n=e.validationValue,o=r;return Number.isInteger(o)&&(o=r.toString()),{fail:o.length>n}},minLength:function(e){var t=e.value,r=void 0===t?"":t,n=e.validationValue,o=r;return Number.isInteger(o)&&(o=r.toString()),{fail:o.length<n}},required:function(e){var t=e.value;return{fail:e.validationValue&&!t}},value:function(e){var t=e.value;return{fail:t!==e.validationValue}},bool:function(e){var t=e.validationValue,r=!1;return"boolean"==typeof t&&(r=t),{fail:r}},regex:he,hasNoExtraSpaces:function(e){var t=e.value;return{fail:he({value:t,validationValue:"^[A-Za-z0-9.-]+(?: +[A-Za-z0-9.-]+)*$",errorMessage:""}).fail}},isCreditCard:function(e){var t,r,n=e.value,o=e.validationValue;if(!n)return{fail:!0};var i=fe(Q(n,o),1)[0];return{fail:!i,metadata:{typeCard:null==i?void 0:i.type,creditCardCC:null===(t=null==i?void 0:i.code)||void 0===t?void 0:t.name,creditCardCCSize:null===(r=null==i?void 0:i.code)||void 0===r?void 0:r.size}}},isCreditCardAndLength:function(e){var t=e.value,r=e.validationValue;if(!t)return{fail:!0};var n=fe(Q(t,r),2),o=n[0],i=n[1];return{fail:o&&!o.lengths.includes(i.length)}},isCreditCodeMatch:function(e){var t,r=e.value,n=e.validationValue;if(!r)return{fail:!0};var o=fe(Q(n.numberCard,n.availableOptions),1)[0];return{fail:(null===(t=null==o?void 0:o.code)||void 0===t?void 0:t.size)!==r.length}},onlyLetters:function(e){var t=e.value;return{fail:!/^[a-zA-Z\s]*$/.test(t)}},notAllowSpaces:function(e){var t=e.value;return{fail:/\s/.test(t)}},callback:function(e){var t=e.value,r=(0,e.validationValue)(t);return{message:r.errorMessage,fail:r.fail}},isNumber:function(e){var t=e.value;return{fail:!!t&&!/^[0-9\s]*$/.test(t)}},customValidation:function(e){var t=e.value,r=e.validationValue;return ye({value:t,validationValue:r})},notEmpty:function(e){return{fail:!e.value.trim().length}},numericRange:function(e){var t=e.value,r=e.validationValue,n=String(t).replace(/[^0-9]/g,"");return{fail:!n||!Number.isInteger(parseInt(n.toString()))||+n>r.end||+n<r.start}},email:function(e){var t=e.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(t)}},lessThan:function(e){var t=e.value,r=e.validationValue;return{fail:!t||parseInt(t)>=parseInt(r)}},sequentialNumber:function(e){var t=e.value,r=String(t).replace(/[^0-9]/g,"");return{fail:!(-1==="0123456789".indexOf(r)&&-1==="9876543210".indexOf(r))}},repeatedNumbers:function(e){var t=e.value,r=String(t).replace(/[^0-9]/g,"");return{fail:/\b(\d)\1+\b/gm.test(r)}},url:function(e){var t=e.value;return{fail:!/[(http(s)?)://(www.)?a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/gi.test(t)}},path:function(e){var t=e.value,r=e.validationValue,n=function(e){var n=C(t,e);if(r.preventUnMountValidation&&!(e in t))return{fail:!1};var o,i,a=ge(n,r);return i={fail:!1},(o=a)?Object.keys(o).reduce((function(e,t){return o[t].fail?o[t]:e}),i):i};return Array.isArray(r.paths)?r.paths.reduce((function(e,t){var r=n(t);return r.fail?r:e}),{}):n(r.path)},isInTheList:function(e){var t=e.value,r=e.validationValue;return t&&Array.isArray(r)?{fail:!r.some((function(e){return e===t||JSON.stringify(e)===t}))}:{fail:!0}},fields:function(e){var t=e.values,r=e.validationValue;return{fail:null==r?void 0:r.set[r.rule]((function(e){var r;return Oe(ge(null===(r=t[e.fieldName])||void 0===r?void 0:r.value,e.validations))}))}},customNameRule:function(e){var t=e.value,r=e.validationValue;return"object"!==le(r)?{fail:!1}:{fail:Oe(ge(t,r))}},exists:function(e){return{fail:!e.validationValue}}},ge=function(e,t){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(t).forEach((function(i){var a=t[i],u=me[i];u||(u=me.customNameRule);var c=r[i]||r.default,s=u({value:e,validationValue:a,errorMessage:c,values:n});o=Object.assign(Object.assign({},o),se({},i,Object.assign(Object.assign({},s),{validationValue:a,message:c})))})),o},Oe=function(e){return!!e&&!!Object.keys(e).find((function(t){return e&&e[t].fail}),[])},Ee=Object.freeze({__proto__:null,concatenate:function(e,t){return e+t},add:function(e,t){return((parseInt(e)||0)+(parseInt(t)||0)).toString()},subtract:function(e,t){return parseInt(e)-parseInt(t)},replaceAll:function(e,t,r){return e.replace(new RegExp(t,"g"),r)}}),_e=Object.freeze({__proto__:null,handler:function(e){var t=e.field,r=e.data;t.data.changed=!0,t.data.metadata=r.metadata,t.value=r.parsedEventValue}}),Se=Object.freeze({__proto__:null,handler:function(e){var t,r,n,o,i,u,c,s,l=e.form,f=e.field;f.subscribe(a("ON_SCOPE_CHANGE","configs","disable"),(function(){return f.rehydrate()}));var d=f.component.props,p=(void 0===d?{}:d)[null===(t=f.mappings)||void 0===t?void 0:t.setValue],v=f.component.group&&C(l.initialValues,f.component.group),h=C(l.initialValues,v===(null===(r=f.component.props)||void 0===r?void 0:r.value)&&v?f.component.group:f.component.name)||p;f.value=(null===(s=null===(o=null===(n=l.formData.form)||void 0===n?void 0:n.steps)||void 0===o?void 0:o.data[null===(c=null===(u=null===(i=l.formData)||void 0===i?void 0:i.form)||void 0===u?void 0:u.steps)||void 0===c?void 0:c.index])||void 0===s?void 0:s.formatted[f.component.name])||(f.data.mounted?void 0:h),f.data.mounted=!0}}),je=Object.freeze({__proto__:null,handler:function(e){e.field.data.blured=!0}}),we=Object.freeze({__proto__:null,handler:function(e){var t=e.field;t.data=Object.assign(Object.assign({},t.data),{focused:!0})}});function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}function Ne(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Ae(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ae(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ie(e){return function(e){if(Array.isArray(e))return Le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Fe(e)||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 Fe(e,t){if(e){if("string"==typeof e)return Le(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Le(e,t):void 0}}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var De=function(e){return/\$\{(.*)\}.*/g.test(e)},ke="varOps.",xe=")",Te="(",Ce=",",Pe=function(e){return e.includes(ke)},Re=Object.freeze({__proto__:null,handler:function(e){var t=e.field,r=e.form,n=function(){if(t){var e=t.component,r=e.children,n=e.wrapper,o=y(e,["children","wrapper"]),a=Object.assign({},i(o));t.scopedComponent=Object.assign(Object.assign(Object.assign({},o),a),{children:r,wrapper:n})}},o=function e(o){var i=(o=o.toString()).lastIndexOf(G);if(-1===i)return o;var u=o.substring(i+G.length,o.length),c=u.substring(0,u.indexOf(U)),s=c.length,l="",f=c.split(B);if(f.length>1){c=f[0];var d,p=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Fe(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(f);try{for(p.s();!(d=p.n()).done;){var v=d.value;if(v.includes("api")||v.includes("global")||v.includes("fields")||v.includes("hooks")||v.includes("configs")){var h=C(t.scope.getGlobalScope(),v);h&&(l=h)}else l=v}}catch(e){p.e(e)}finally{p.f()}}t&&function(e){var r,o,i,u,c=!(null===(u=null===(i=null===(o=null===(r=t.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(t.component.name)),s=e[0].split(".");c&&t.subscribe(a("ON_SCOPE_CHANGE",s[0],s[1]),(function(){n(),t.rehydrate()}))}(f);var y=C(r.scope.getGlobalScope(),c),b=void 0===y?l:y;if("string"!=typeof b&&0===i)return b;if(!b&&!/^\$\{.*\}$/.test(o))return o.substring(0,i)+o.substring(o.indexOf(G),o.lastIndexOf(U)+1);try{b=JSON.stringify(b).replace(/^"(.*)"$/,"$1")}catch(e){}var m=o.substring(0,i)+b+o.substring(i+s+G.length+U.length,o.length);return Pe(m)&&!De(m)?m.replace(/([^\s]+)/g,(function(e){if(!Pe(e))return e;var t=function(e){return Ee[e.split(ke)[1].split(Te)[0]]}(e);return t?t.apply(void 0,Ie(function(e){return e.split(ke)[1].split(Te)[1].split(xe)[0].split(Ce)}(e))):void 0})):e(m)},i=function e(t){if("string"==typeof t)return o(t);if("number"==typeof t)return t;var r=Object.assign({},t);return Object.keys(r).reduce((function(t,n){if(null===r[n])return t;if(Array.isArray(r[n]))return Object.assign(Object.assign({},t),Ne({},n,r[n].map(e)));if("object"===Ae(r[n]))return Object.assign(Object.assign({},t),Ne({},n,Object.assign({},e(Object.assign({},r[n])))));if("string"!=typeof r[n])return Object.assign(Object.assign({},t),Ne({},n,r[n]));if(!De(r[n]))return Object.assign(Object.assign({},t),Ne({},n,r[n]));var i=o(r[n]);try{te(i)&&(i=JSON.parse(i))}catch(e){}return Object.assign(Object.assign({},t),Ne({},n,i))}),{})};n(),function(){var e=r.schema||{};e.components;var t=y(e,["components"]),n=i(t);r.scopedSchema=n,r.rehydrate()}()}});function Me(e){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(e)}function Ve(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ve=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),u=new L(n||[]);return o(a,"_invoke",{value:A(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var d="suspendedStart",p="suspendedYield",v="executing",h="completed",y={};function b(){}function m(){}function g(){}var O={};s(O,a,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(D([])));_&&_!==r&&n.call(_,a)&&(O=_);var S=g.prototype=b.prototype=Object.create(O);function j(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==Me(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function A(t,r,n){var o=d;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===h){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=N(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=f(t,r,n);if("normal"===s.type){if(o=n.done?h:p,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=h,n.method="throw",n.arg=s.arg)}}}function N(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,N(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Me(t)+" is not iterable")}return m.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=s(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s(e,c,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},j(w.prototype),s(w.prototype,u,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},j(S),s(S,c,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=D,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(F),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),F(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Ge(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Me(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Me(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Me(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=