From 2f9c4616bb19dca5b76800fa4c8ce525d5ae6d75 Mon Sep 17 00:00:00 2001 From: Eirik Bruland Date: Thu, 31 Mar 2022 10:23:45 +0200 Subject: [PATCH] build --- dist/Fields/Address.js | 2 +- dist/Fields/Buckarooideal.js | 2 +- dist/Fields/Checkbox.js | 2 +- dist/Fields/Consent.js | 2 +- dist/Fields/Custom.js | 2 +- dist/Fields/Date/Date.js | 2 +- dist/Fields/Date/DatePicker.js | 2 +- dist/Fields/Date/DateSelect.js | 2 +- dist/Fields/Email.js | 2 +- dist/Fields/Fileupload/Fileupload.js | 2 +- dist/Fields/Fileupload/GFDropzone.js | 2 +- dist/Fields/Hidden.js | 2 +- dist/Fields/List.js | 2 +- dist/Fields/Multiselect.js | 2 +- dist/Fields/Name.js | 2 +- dist/Fields/Number.js | 2 +- dist/Fields/Option.js | 2 +- dist/Fields/Password.js | 2 +- dist/Fields/Phone.js | 2 +- dist/Fields/Posttitle.js | 2 +- dist/Fields/Quantity.js | 2 +- dist/Fields/Radio.js | 2 +- dist/Fields/Select.js | 2 +- dist/Fields/Shipping.js | 2 +- dist/Fields/Text.js | 2 +- dist/Fields/Textarea.js | 2 +- dist/Fields/Website.js | 2 +- dist/Fields/index.js | 2 +- dist/FormElements/FormConfirmation.js | 2 +- dist/FormElements/RenderField.js | 2 +- dist/FormElements/RenderFields.js | 2 +- dist/Helpers/form/calculateProduct.js | 2 +- dist/Helpers/form/fetchForm.js | 2 +- dist/Helpers/form/index.js | 2 +- dist/Helpers/form/onSubmitHandler.js | 2 +- dist/Helpers/form/updateFormHandler.js | 2 +- dist/Helpers/validation.js | 2 +- dist/index.js | 2 +- 38 files changed, 38 insertions(+), 38 deletions(-) diff --git a/dist/Fields/Address.js b/dist/Fields/Address.js index c373558..3d0137b 100644 --- a/dist/Fields/Address.js +++ b/dist/Fields/Address.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _react=_interopRequireDefault(require("react")),_i18nIsoCountries=_interopRequireDefault(require("i18n-iso-countries")),_InputLabel=_interopRequireDefault(require("../FormElements/InputLabel")),_excluded=["field","value","validationMessage","touched","setTouched","hideField","updateForm","styledComponents","error","unsetError","setFocusClass","cssClass","language"];function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);c=a.length?"blank":4>a.length?"short":(a.match(/[0-9]/)&&(g+=10),a.match(/[a-z]/)&&(g+=26),a.match(/[A-Z]/)&&(g+=26),a.match(/[^a-zA-Z0-9]/)&&(g+=31),e=c(d(g,a.length)),f=e/b,40>f?"bad":56>f?"good":"strong")},T=function(a){var b=S(a);Q(b)};return _react["default"].createElement(I,{width:w,className:d&&e||j?"form-field error ".concat(z):"form-field ".concat(z),style:{display:g?"none":void 0}},_react["default"].createElement("div",{className:o},_react["default"].createElement(_InputLabel["default"],{formId:n,id:m,label:p,labelPlacement:v,isRequired:r,styledComponent:i}),"above"===u&&t&&_react["default"].createElement("div",{className:"description",dangerouslySetInnerHTML:{__html:t.replace(/\n/g,"
")}}),_react["default"].createElement("div",{className:"ginput_container ginput_container_password"},y&&y.length&&y.map(function(a,g){return!a.isHidden&&_react["default"].createElement("span",{key:"input_".concat(n,"_").concat(a.id),className:"".concat(1")}}),!(d&&e||j)&&A&&_react["default"].createElement(_react["default"].Fragment,null,_react["default"].createElement("div",{id:"input_".concat(n,"_").concat(m,"_strength_indicator"),className:"gfield_password_strength ".concat(P)},P&&"blank"!==P?P:"Strength indicator"),_react["default"].createElement("input",{type:"hidden",className:"gform_hidden",id:"input_".concat(n,"_").concat(m,"_strength"),name:"input_".concat(m,"_strength"),value:P}))))};exports["default"]=_default; \ No newline at end of file +"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _react=_interopRequireWildcard(require("react")),_InputLabel=_interopRequireDefault(require("../FormElements/InputLabel"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var a=new WeakMap;return _getRequireWildcardCache=function(){return a},a}function _interopRequireWildcard(a){if(a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var b=_getRequireWildcardCache();if(b&&b.has(a))return b.get(a);var c={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var e in a)if(Object.prototype.hasOwnProperty.call(a,e)){var f=d?Object.getOwnPropertyDescriptor(a,e):null;f&&(f.get||f.set)?Object.defineProperty(c,e,f):c[e]=a[e]}return c["default"]=a,b&&b.set(a,c),c}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;ca.length)&&(b=a.length);for(var c=0,d=Array(b);c=a.length?"blank":4>a.length?"short":(a.match(/[0-9]/)&&(g+=10),a.match(/[a-z]/)&&(g+=26),a.match(/[A-Z]/)&&(g+=26),a.match(/[^a-zA-Z0-9]/)&&(g+=31),e=c(d(g,a.length)),f=e/b,40>f?"bad":56>f?"good":"strong")},T=function(a){var b=S(a);Q(b)};return _react["default"].createElement(I,{width:w,className:d&&e||j?"form-field error ".concat(z):"form-field ".concat(z),style:{display:g?"none":void 0}},_react["default"].createElement("div",{className:o},_react["default"].createElement(_InputLabel["default"],{formId:n,id:m,label:p,labelPlacement:v,isRequired:r,styledComponent:i}),"above"===u&&t&&_react["default"].createElement("div",{className:"description",dangerouslySetInnerHTML:{__html:t.replace(/\n/g,"
")}}),_react["default"].createElement("div",{className:"ginput_container ginput_container_password"},y&&y.length&&y.map(function(a,g){return!a.isHidden&&_react["default"].createElement("span",{key:"input_".concat(n,"_").concat(a.id),className:"".concat(1")}}),!(d&&e||j)&&A&&_react["default"].createElement(_react["default"].Fragment,null,_react["default"].createElement("div",{id:"input_".concat(n,"_").concat(m,"_strength_indicator"),className:"gfield_password_strength ".concat(P)},P&&"blank"!==P?P:"Strength indicator"),_react["default"].createElement("input",{type:"hidden",className:"gform_hidden",id:"input_".concat(n,"_").concat(m,"_strength"),name:"input_".concat(m,"_strength"),value:P}))))};exports["default"]=_default; \ No newline at end of file diff --git a/dist/Fields/Phone.js b/dist/Fields/Phone.js index c1ac215..7f1fdf2 100644 --- a/dist/Fields/Phone.js +++ b/dist/Fields/Phone.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _react=_interopRequireDefault(require("react")),_InputLabel=_interopRequireDefault(require("../FormElements/InputLabel")),_excluded=["field","value","validationMessage","touched","setTouched","hideField","updateForm","styledComponents","error","unsetError","setFocusClass","cssClass"];function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;da?"-":"",g=parseInt(a=b(+a||0).toFixed(c)).toString(),h=3a?"-":"",g=parseInt(a=b(+a||0).toFixed(c)).toString(),h=3a.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);c(.+)<\/script>/gi.exec(a);b?(a=a.replace(b[0],""),this.setState({confirmation:a},function(){return window.eval(b[1])})):this.setState({confirmation:a})}},{key:"render",value:function render(){var a=this.state.confirmation,b=this.props.SFormConfirmation;return b?_react["default"].createElement(b,{success:!0,message:a}):_react["default"].createElement("div",{className:"form-confirmation",dangerouslySetInnerHTML:{__html:a}})}}]),b}(_react["default"].Component),_default=Confirmation;exports["default"]=_default; \ No newline at end of file +"use strict";var _react=_interopRequireDefault(require("react"));Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d(.+)<\/script>/gi.exec(a);b?(a=a.replace(b[0],""),this.setState({confirmation:a},function(){return window.eval(b[1])})):this.setState({confirmation:a})}},{key:"render",value:function render(){var a=this.state.confirmation,b=this.props.SFormConfirmation;return b?_react["default"].createElement(b,{success:!0,message:a}):_react["default"].createElement("div",{className:"form-confirmation",dangerouslySetInnerHTML:{__html:a}})}}]),b}(_react["default"].Component),_default=Confirmation;exports["default"]=_default; \ No newline at end of file diff --git a/dist/FormElements/RenderField.js b/dist/FormElements/RenderField.js index 75167cb..a3e35dd 100644 --- a/dist/FormElements/RenderField.js +++ b/dist/FormElements/RenderField.js @@ -1 +1 @@ -"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _react=_interopRequireWildcard(require("react")),FormFields=_interopRequireWildcard(require("../Fields"));function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){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 _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);cb&&(b=parseInt(a[c].id));return b+1},fieldTypes=["checkbox","email","hidden","html","number","phone","radio","select","multiselect","text","textarea","website","page","date","fileupload","consent","password","section","scustom","name","address","buckarooideal","postcode","post_title","list","product","quantity","total","shipping","option"],honeyPotLables=["Name","Email","Phone","Comments"],honeypotLabel=honeyPotLables[Math.floor(Math.random()*Math.floor(4))],_default=function(a){function b(a){return _react["default"].createElement(_RenderField["default"],{key:"".concat(a.formId,"-").concat(a.id),field:a,formValues:d,submitFailed:f,setTouched:i,setErrorMessages:j,submitSuccess:g,updateForm:e,touched:h,pages:k&&k.pages.length,prevStep:m,nextStep:n,isNextDisabled:o,checkConditionalLogic:p,calculateProduct:q,saveStateToHtmlField:r,styledComponents:t,customComponents:u,error:!!(w&&w[a.id])&&w[a.id],unsetError:v,dropzoneText:x,language:z,apiKeys:A})}var c=a.fields,d=a.formValues,e=a.updateForm,f=a.submitFailed,g=a.submitSuccess,h=a.touched,i=a.setTouched,j=a.setErrorMessages,k=a.pagination,l=a.activePage,m=a.prevStep,n=a.nextStep,o=a.isNextDisabled,p=a.checkConditionalLogic,q=a.calculateProduct,r=a.saveStateToHtmlField,s=a.enableHoneypot,t=a.styledComponents,u=a.customComponents,v=a.unsetError,w=a.errors,x=a.dropzoneText,y=a.pageClicked,z=a.language,A=a.apiKeys,B=k?divideFieldsIntoPages(c,k.pages):void 0,C=getMaxFieldId(c),D=(0,_react.useState)(""),E=_slicedToArray(D,2),F=E[0],G=E[1],H=(0,_react.useRef)();(0,_react.useEffect)(function(){H.current=l});var I=H.current;return _react["default"].createElement("div",{className:"form-fields".concat(k&&1a.length)&&(b=a.length);for(var c=0,d=Array(b);cb&&(b=parseInt(a[c].id));return b+1},fieldTypes=["checkbox","email","hidden","html","number","phone","radio","select","multiselect","text","textarea","website","page","date","fileupload","consent","password","section","scustom","name","address","buckarooideal","postcode","post_title","list","product","quantity","total","shipping","option"],honeyPotLables=["Name","Email","Phone","Comments"],honeypotLabel=honeyPotLables[Math.floor(Math.random()*Math.floor(4))],_default=function(a){function b(a){return _react["default"].createElement(_RenderField["default"],{key:"".concat(a.formId,"-").concat(a.id),field:a,formValues:d,submitFailed:f,setTouched:i,setErrorMessages:j,submitSuccess:g,updateForm:e,touched:h,pages:k&&k.pages.length,prevStep:m,nextStep:n,isNextDisabled:o,checkConditionalLogic:p,calculateProduct:q,saveStateToHtmlField:r,styledComponents:t,customComponents:u,error:!!(w&&w[a.id])&&w[a.id],unsetError:v,dropzoneText:x,language:z,apiKeys:A})}var c=a.fields,d=a.formValues,e=a.updateForm,f=a.submitFailed,g=a.submitSuccess,h=a.touched,i=a.setTouched,j=a.setErrorMessages,k=a.pagination,l=a.activePage,m=a.prevStep,n=a.nextStep,o=a.isNextDisabled,p=a.checkConditionalLogic,q=a.calculateProduct,r=a.saveStateToHtmlField,s=a.enableHoneypot,t=a.styledComponents,u=a.customComponents,v=a.unsetError,w=a.errors,x=a.dropzoneText,y=a.pageClicked,z=a.language,A=a.apiKeys,B=k?divideFieldsIntoPages(c,k.pages):void 0,C=getMaxFieldId(c),D=(0,_react.useState)(""),E=_slicedToArray(D,2),F=E[0],G=E[1],H=(0,_react.useRef)();(0,_react.useEffect)(function(){H.current=l});var I=H.current;return _react["default"].createElement("div",{className:"form-fields".concat(k&&1=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}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 f,g=!0,h=!1;return{s:function s(){c=c.call(a)},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c=a.length?{done:!0}:{done:!1,value:a[d++]}},e:function e(a){throw a},f:e}}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 f,g=!0,h=!1;return{s:function s(){c=a[Symbol.iterator]()},n:function n(){var a=c.next();return g=a.done,a},e:function e(a){h=!0,f=a},f:function f(){try{g||null==c["return"]||c["return"]()}finally{if(h)throw f}}}}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);c()\[\]\\.,;:\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(a)){var d=getMessage(c,"email");return d||"Enter a valid email"}return!1};exports.isEmail=isEmail;var isUrl=function(a,b,c){if(!/^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i.test(a)){var d=getMessage(c,"url");return d||"Enter a valid url"}return!1};exports.isUrl=isUrl;var isEmpty=function(a){return!a};exports.isEmpty=isEmpty;var isRequired=function(a,b,c){if(a&&b){var d=getMessage(c,"required");return d||"This field is required"}return!1};exports.isRequired=isRequired;var selectValidation=function(a,b,c){return!(b===c&&a)};exports.selectValidation=selectValidation;var checkboxValidation=function(a,b){return!!(1>a.length)&&(b||"This field is required")};exports.checkboxValidation=checkboxValidation;var emailValidation=function(a,b){var c=b||!1,d=c.inputs,e=c.isRequired,f=c.errorMessage,g=f||!1,h=g.required,j=g.mismatch,k=a&&a.filter(function(a){return a&&""===a.val}).length;if((a&&2>a.length||0!==k)&&e)return h||"This field is required";if(a&&0m;m++)if(l=isEmail(a[m].val),l)return l;return!!(a&&2===a.length&&d&&2===d.length&&a[1]&&a[0]&&""!==a[1].val&&a[1].val!==a[0].val)&&(j||"Mismatch")},passwordValidation=function(a,b){var c=b||!1,d=c.inputs,e=c.isRequired,f=c.errorMessage,g=f||!1,h=g.required,i=g.mismatch,j=d.filter(function(a){return!a.isHidden}),k=a&&a.filter(function(a){return a&&""===a.val}).length;return(a&&0===a.length||k===j.length)&&e?h||"This field is required":!!(a&&2===a.length&&j&&2===j.length&&a[1]&&a[0]&&""!==a[1].val&&a[1].val!==a[0].val)&&(i||"Mismatch")},isPostcode=function(a,b,c){if(!/^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(a)){var d=getMessage(c,"email");return d||"Enter a valid postcode"}return!1},isDate=function(a,b){for(var c=[],d=0;d2||f<1||f>12)&&(c[d]={index:d,message:getMessage(h,"date")||"Enter a valid month"})}else if("DD"===g){var j=b.errorMessage.date;(f.length>2||f<1||f>31)&&(c[d]={index:d,message:getMessage(j,"date")||"Enter a valid date"})}else if("YYYY"===g){var k=b.errorMessage.year,l=new Date().getFullYear()+1;(f.length>4||f<1920||f>l)&&(c[d]={index:d,message:getMessage(k,"date")||"Enter a valid year"})}}return c},validateField=function(a,b){var c=b.type,d=b.isRequired;if(("checkbox"===c||"radio"===c)&&d)return checkboxValidation(a,b.errorMessage);if("password"===c)return passwordValidation(a,b);if("email"===c&&b.emailConfirmEnabled)return emailValidation(a,b);var e=isEmpty(a),f="",g=!!(b&&b.errorMessage)&&b.errorMessage;if(f=!!d&&isRequired(d,e,g),!f&&!e)if("email"===c)f=isEmail(a,b,g);else if("website"===c)f=isUrl(a,b,g);else if("date"===c){var h=!0;h=b.dateType&&"datepicker"===b.dateType?!!d&&isRequired(d,e,g):isDate(a,b),f=!!(0()\[\]\\.,;:\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(a)){var d=getMessage(c,"email");return d||"Enter a valid email"}return!1};exports.isEmail=isEmail;var isUrl=function(a,b,c){if(!/^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[-a-z\d%_.~+]*)*(\?[;&a-z\d%_.~+=-]*)?(\#[-a-z\d_]*)?$/i.test(a)){var d=getMessage(c,"url");return d||"Enter a valid url"}return!1};exports.isUrl=isUrl;var isEmpty=function(a){return!a};exports.isEmpty=isEmpty;var isRequired=function(a,b,c){if(a&&b){var d=getMessage(c,"required");return d||"This field is required"}return!1};exports.isRequired=isRequired;var selectValidation=function(a,b,c){return!(b===c&&a)};exports.selectValidation=selectValidation;var checkboxValidation=function(a,b){return!!(1>a.length)&&(b||"This field is required")};exports.checkboxValidation=checkboxValidation;var emailValidation=function(a,b){var c=b||!1,d=c.inputs,e=c.isRequired,f=c.errorMessage,g=f||!1,h=g.required,j=g.mismatch,k=a&&a.filter(function(a){return a&&""===a.val}).length;if((a&&2>a.length||0!==k)&&e)return h||"This field is required";if(a&&0m;m++)if(l=isEmail(a[m].val),l)return l;return!!(a&&2===a.length&&d&&2===d.length&&a[1]&&a[0]&&""!==a[1].val&&a[1].val!==a[0].val)&&(j||"Mismatch")},passwordValidation=function(a,b){var c=b||!1,d=c.inputs,e=c.isRequired,f=c.errorMessage,g=f||!1,h=g.required,i=g.mismatch,j=d.filter(function(a){return!a.isHidden}),k=a&&a.filter(function(a){return a&&""===a.val}).length;return(a&&0===a.length||k===j.length)&&e?h||"This field is required":!!(a&&2===a.length&&j&&2===j.length&&a[1]&&a[0]&&""!==a[1].val&&a[1].val!==a[0].val)&&(i||"Mismatch")},isPostcode=function(a,b,c){if(!/^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(a)){var d=getMessage(c,"email");return d||"Enter a valid postcode"}return!1},isDate=function(a,b){for(var c=[],d=0;d2||f<1||f>12)&&(c[d]={index:d,message:getMessage(h,"date")||"Enter a valid month"})}else if("DD"===g){var j=b.errorMessage.date;(f.length>2||f<1||f>31)&&(c[d]={index:d,message:getMessage(j,"date")||"Enter a valid date"})}else if("YYYY"===g){var k=b.errorMessage.year,l=new Date().getFullYear()+1;(f.length>4||f<1920||f>l)&&(c[d]={index:d,message:getMessage(k,"date")||"Enter a valid year"})}}return c},validateField=function(a,b){var c=b.type,d=b.isRequired;if(("checkbox"===c||"radio"===c)&&d)return checkboxValidation(a,b.errorMessage);if("password"===c)return passwordValidation(a,b);if("email"===c&&b.emailConfirmEnabled)return emailValidation(a,b);var e=isEmpty(a),f="",g=!!(b&&b.errorMessage)&&b.errorMessage;if(f=!!d&&isRequired(d,e,g),!f&&!e)if("email"===c)f=isEmail(a,b,g);else if("website"===c)f=isUrl(a,b,g);else if("date"===c){var h=!0;h=b.dateType&&"datepicker"===b.dateType?!!d&&isRequired(d,e,g):isDate(a,b),f=!!(0a.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);c