diff --git a/dist/formulate.esm.js b/dist/formulate.esm.js index 5523574..6e6fd33 100644 --- a/dist/formulate.esm.js +++ b/dist/formulate.esm.js @@ -1,5 +1 @@ -<<<<<<< HEAD -import t from"is-url";import e from"nanoid/non-secure";import r from"is-plain-object";import{en as o}from"@braid/vue-formulate-i18n";var i=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},n=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=i("text"),r))}),{}),{range:i("slider"),textarea:i("textarea","TextArea"),checkbox:i("box"),radio:i("box"),submit:i("button"),button:i("button"),select:i("select"),file:i("file"),image:i("file"),group:i("group")}),s=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function a(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),i=r.length;if(o.length!==i)return!1;for(var n=0;n=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},s.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},s.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},s.prototype.getFileList=function(){return this.fileList},s.prototype.getFiles=function(){return this.files},s.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var h={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof s)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof s?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(e){var r=e.value;return Promise.resolve(t(r))}},m="image/",v={csv:"text/csv",gif:m+"gif",jpg:m+"jpeg",jpeg:m+"jpeg",png:m+"png",pdf:"application/pdf",svg:m+"svg+xml"};function y(t,e,r,o){return new Promise((function(r,i){var n=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var o=performance.now()-s,i=Math.min(100,Math.round(o/n*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function g(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var b={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,o=e.data,i=e.parent,n=e.children,s=i,a=(r.name,r.forceWrap),l=r.context,u=g(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},l,u));if(Array.isArray(n)&&(n.length>1||a&&n.length>0)){var c=o.attrs,d=(c.name,c.context,g(c,["name","context"]));return t("div",Object.assign({},o,{attrs:d}),n)}return Array.isArray(n)&&1===n.length?n[0]:null}},x=function(t){this.registry=new Map,this.ctx=t};function E(t){return new x(t).dataProps()}function _(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return f(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):f(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function w(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;Object.assign(this.proxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.proxy))},getFormValues:function(){return this.proxy},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))}};return Object.keys(e).reduce((function(r,o){var i;return t.includes(o)?r:Object.assign({},r,((i={})[o]=e[o],i))}),{})}function F(t){return{formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.getFormValues}}x.prototype.add=function(t,e){return this.registry.set(t,e),this},x.prototype.remove=function(t){return this.registry.delete(t),this},x.prototype.has=function(t){return this.registry.has(t)},x.prototype.get=function(t){return this.registry.get(t)},x.prototype.map=function(t){var e={};return this.registry.forEach((function(r,o){var i;return Object.assign(e,((i={})[o]=t(r,o),i))})),e},x.prototype.keys=function(){return Array.from(this.registry.keys())},x.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=f(e.$options.propsData,"formulateValue"),o=f(e.$options.propsData,"value");!r&&this.ctx.hasInitialValue&&this.ctx.initialValues[t]?e.context.model=this.ctx.initialValues[t]:!r&&!o||l(e.internalModelProxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.internalModelProxy),this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},x.prototype.reduce=function(t,e){return this.registry.forEach((function(r,o){e=t(e,r,o)})),e},x.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.registry.delete(e)},childrenShouldShowErrors:!1}};var V=function(t){this.form=t};function O(t,e,r,o,i,n,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),o&&(d._scopeId=o),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}V.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},V.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],i=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var o in e)e[o]instanceof s||p(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.proxy),n=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof s&&o.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var a in i)n(a);Promise.all(o).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var P={provide:function(){return Object.assign({},F(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return Object.assign({},E(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},_(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=c(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=c(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.has(r)||l(t[r],this.proxy[r])||l(t[r],this.registry.get(r).internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry.get(r).context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},w(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):f(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new V(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},$=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};$._withStripped=!0;var S=O({render:$,staticRenderFns:[]},void 0,P,void 0,!1,void 0,!1,void 0,void 0,void 0),A={context:function(){return k.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:C.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit,name:this.nameOrFallback,performValidation:this.performValidation.bind(this),preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:j.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,r){return j.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:j.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return c(this.errors).concat(this.localErrors).concat(c(this.error))},allErrors:function(){return this.explicitErrors.concat(c(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&R.call(this))return!0;return this.behavioralErrorVisibility},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){return{label:this.$formulate.slotComponent(this.type,"label"),help:this.$formulate.slotComponent(this.type,"help"),errors:this.$formulate.slotComponent(this.type,"errors"),repeatable:this.$formulate.slotComponent(this.type,"repeatable"),addMore:this.$formulate.slotComponent(this.type,"addMore")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel}};function j(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function C(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function k(t){return Object.defineProperty(t,"model",{get:R.bind(this),set:N.bind(this)})}function R(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function N(t){l(t,this.internalModelProxy)||(this.internalModelProxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t)}var I={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:Number,default:1/0},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:e(9),localAttributes:{},localErrors:[],internalModelProxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},A,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[u(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[u(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[u(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||l(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!l(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},destroyed:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:f(this.$options.propsData,"value")&&"box"!==t?this.value:f(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!l(this.context.model,this.internalModelProxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.internalModelProxy)},updateLocalAttributes:function(t){l(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=d(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?e.concat(this.ruleRegistry):e,this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],o=e[1],i=e[2],n=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(o));return(n=n instanceof Promise?n:Promise.resolve(n)).then((function(e){return!e&&t.getMessage(i,o)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){return t.didValidate(e)})),this.pendingValidation},didValidate:function(t){var e=!l(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=u(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=c(t)},registerRule:function(t,e,r,o){void 0===o&&(o=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==o&&(this.messageRegistry[r]=o))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},D=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,{tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}})],null,t.context)],2)};D._withStripped=!0;var L=O({render:D,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),U={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=c(t)}}},B=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};B._withStripped=!0;var M=O({render:B,staticRenderFns:[]},void 0,U,void 0,!1,void 0,!1,void 0,void 0,void 0),G={props:{context:{type:Object,required:!0}}},H=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:"formulate-input-help formulate-input-help--"+this.context.helpPosition,domProps:{textContent:this._s(this.context.help)}}):this._e()};H._withStripped=!0;var T=O({render:H,staticRenderFns:[]},void 0,G,void 0,!1,void 0,!1,void 0,void 0,void 0),q={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0}}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)&&(this.context.repeatable||0!==this.context.model.length)?this.context.model:[{}]},providers:function(){var t=this;return this.items.map((function(e,r){return!!Array.isArray(t.$refs["provider-"+r])&&t.$refs["provider-"+r][0]}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{setFieldValue:function(t,e,r){var o,i=Array.isArray(this.context.model)?this.context.model:[];i.splice(t,1,Object.assign({},"object"==typeof this.context.model[t]?this.context.model[t]:{},((o={})[e]=r,o))),this.context.model=i},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.map((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.splice(t,1)}}},W=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{staticClass:"formulate-input-grouping",attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,o){return r("FormulateRepeatableProvider",{key:o,ref:"provider-"+o,refInFor:!0,attrs:{index:o,"set-field-value":function(e,r){return t.setFieldValue(o,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};W._withStripped=!0;var Y=O({render:W,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),z={props:{context:{type:Object,required:!0}}},K=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:"formulate-input-label formulate-input-label--"+this.context.labelPosition,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};K._withStripped=!0;var Z=O({render:K,staticRenderFns:[]},void 0,z,void 0,!1,void 0,!1,void 0,void 0,void 0),J={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},X=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"formulate-input-group-add-more"},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};X._withStripped=!0;var Q=O({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),tt={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},et={name:"FormulateInputBox",mixins:[tt]},rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t.context.value,s=t._i(r,n);o.checked?s<0&&t.$set(t.context,"model",r.concat([n])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};rt._withStripped=!0;var ot=O({render:rt,staticRenderFns:[]},void 0,et,void 0,!1,void 0,!1,void 0,void 0,void 0),it={name:"FormulateInputText",mixins:[tt]},nt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};nt._withStripped=!0;var st=O({render:nt,staticRenderFns:[]},void 0,it,void 0,!1,void 0,!1,void 0,void 0,void 0),at={name:"FormulateFiles",props:{files:{type:s,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},lt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};lt._withStripped=!0;var ut={name:"FormulateInputFile",components:{FormulateFiles:O({render:lt,staticRenderFns:[]},void 0,at,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[tt],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof s&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof s&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},ct=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};ct._withStripped=!0;var dt=O({render:ct,staticRenderFns:[]},void 0,ut,void 0,!1,void 0,!1,void 0,void 0,void 0),pt={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},ft=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group-repeatable"},[t.context.repeatable?r("a",{staticClass:"formulate-input-group-repeatable-remove",attrs:{role:"button"},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e(),t._v(" "),t._t("default")],2)};ft._withStripped=!0;var ht=O({render:ft,staticRenderFns:[]},void 0,pt,void 0,!1,void 0,!1,void 0,void 0,void 0);function mt(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var vt={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes),o=(r.id,mt(r,["id"])),i=(e.classification,e.blurHandler,e.performValidation,e.hasValidationErrors,e.getValidationErrors,e.validationErrors,e.setErrors,e.visibleValidationErrors,e.component,e.hasLabel,e.slotComponents,e.isSubField,mt(e,["options","labelPosition","attributes","classification","blurHandler","performValidation","hasValidationErrors","getValidationErrors","validationErrors","setErrors","visibleValidationErrors","component","hasLabel","slotComponents","isSubField"]));return this.options.map((function(e){return t.groupItemContext(i,e,o)}))},canAddMore:function(){return this.context.repeatable&&this.items.length-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Ot._withStripped=!0;var Pt=O({render:Ot,staticRenderFns:[]},void 0,Vt,void 0,!1,void 0,!1,void 0,void 0,void 0),$t={name:"FormulateInputTextArea",mixins:[tt]},St=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};St._withStripped=!0;var At=O({render:St,staticRenderFns:[]},void 0,$t,void 0,!1,void 0,!1,void 0,void 0,void 0),jt={provide:function(){var t=this;return Object.assign({},F(this),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},E(this),{isGrouping:!0})},computed:Object.assign({},_()),methods:Object.assign({},w(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Ct=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,{tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Ct._withStripped=!0;var kt=O({render:Ct,staticRenderFns:[]},void 0,jt,void 0,!1,void 0,!1,void 0,void 0,void 0),Rt=function(){this.options={},this.defaults={components:{FormulateSlot:b,FormulateForm:S,FormulateHelp:T,FormulateLabel:Z,FormulateInput:L,FormulateErrors:M,FormulateAddMore:Q,FormulateGrouping:Y,FormulateInputBox:ot,FormulateInputText:st,FormulateInputFile:dt,FormulateRepeatable:ht,FormulateInputGroup:gt,FormulateInputButton:Et,FormulateInputSelect:Ft,FormulateInputSlider:Pt,FormulateInputTextArea:At,FormulateRepeatableProvider:kt},slotDefaults:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore"},library:n,rules:h,mimes:v,locale:!1,uploader:y,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[o],locales:{}},this.registry=new Map};Rt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},Rt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},Rt.prototype.merge=function(t,e,o){void 0===o&&(o=!0);var i={};for(var n in t)e.hasOwnProperty(n)?r(e[n])&&r(t[n])?i[n]=this.merge(t[n],e[n],o):o&&Array.isArray(t[n])&&Array.isArray(e[n])?i[n]=t[n].concat(e[n]):i[n]=e[n]:i[n]=t[n];for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i},Rt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Rt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Rt.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotDefaults[e]},Rt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Rt.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Rt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return f(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},Rt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},Rt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Rt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Rt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:c(o.formErrors),inputErrors:o.inputErrors||{}}),o},Rt.prototype.getUploader=function(){return this.options.uploader||!1},Rt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Rt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Rt.prototype.createUpload=function(t,e){return new s(t,e,this.options)};var Nt=new Rt;export default Nt; -======= -import t from"is-url";import e from"nanoid/non-secure";import r from"is-plain-object";import{en as o}from"@braid/vue-formulate-i18n";var i=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},n=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=i("text"),r))}),{}),{range:i("slider"),textarea:i("textarea","TextArea"),checkbox:i("box"),radio:i("box"),submit:i("button"),button:i("button"),select:i("select"),file:i("file"),image:i("file")}),a=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function s(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),i=r.length;if(o.length!==i)return!1;for(var n=0;n=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},a.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},a.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},a.prototype.getFileList=function(){return this.fileList},a.prototype.getFiles=function(){return this.files},a.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var f={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof a)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof a?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(e){var r=e.value;return Promise.resolve(t(r))}},h="image/",m={csv:"text/csv",gif:h+"gif",jpg:h+"jpeg",jpeg:h+"jpeg",png:h+"png",pdf:"application/pdf",svg:h+"svg+xml"};function v(t,e,r,o){return new Promise((function(r,i){var n=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var o=performance.now()-a,i=Math.min(100,Math.round(o/n*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var y={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,hasGivenName:this.hasGivenName,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,performValidation:this.performValidation.bind(this),blurHandler:b.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:g.call(this,this.options),optionGroups:!!this.optionGroups&&s(this.optionGroups,(function(e,r){return g.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:g.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return c(this.errors).concat(c(this.error))},allErrors:function(){return this.explicitErrors.concat(c(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&this.context.model)return!0;return this.behavioralErrorVisibility}};function g(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function b(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:w.bind(this),set:F.bind(this)})}function w(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function F(t){l(t,this.internalModelProxy)||(this.internalModelProxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function _(t,e,r,o,i,n,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),o&&(d._scopeId=o),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}var E={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},formulateFormDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},internalModelProxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},y,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[u(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[u(r)]=t.validationMessages[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||l(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!l(t,e)&&(this.context.model=t)}},created:function(){this.applyInitialValue(),this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.formulateFormDeregister&&"function"==typeof this.formulateFormDeregister&&this.formulateFormDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:Object.prototype.hasOwnProperty.call(this.$options.propsData,"value")&&"box"!==t?this.value:Object.prototype.hasOwnProperty.call(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!l(this.context.model,this.internalModelProxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.internalModelProxy)},updateLocalAttributes:function(t){l(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=d(this.validation,this.$formulate.rules(this.parsedValidationRules));return this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],o=e[1],i=e[2],n=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(o));return(n=n instanceof Promise?n:Promise.resolve(n)).then((function(e){return!e&&t.getMessage(i,o)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=u(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},P=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?r("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.disableErrors?t._e():r("FormulateErrors",{attrs:{type:"input",errors:t.explicitErrors,"field-name":t.nameOrFallback,"validation-errors":t.validationErrors,"show-validation-errors":t.showValidationErrors}})],1)};P._withStripped=!0;var O=_({render:P,staticRenderFns:[]},void 0,E,void 0,!1,void 0,!1,void 0,void 0,void 0),V=function(t){this.form=t};V.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},V.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],i=function t(e){var r={};for(var o in e)e[o]instanceof a||p(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.internalFormModelProxy),n=function(e){"object"==typeof t.form.internalFormModelProxy[e]&&t.form.internalFormModelProxy[e]instanceof a&&o.push(t.form.internalFormModelProxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var s in i)n(s);Promise.all(o).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var $={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,formulateFormDeregister:this.deregister,getFormValues:this.getFormValues,observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}}},computed:{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return Object.prototype.hasOwnProperty.call(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):Object.prototype.hasOwnProperty.call(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):{}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=c(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=c(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.hasOwnProperty(r)||l(t[r],this.internalFormModelProxy[r])||l(t[r],this.registry[r].internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry[r].context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:{applyInitialValues:function(){this.hasInitialValue&&(this.internalFormModelProxy=this.initialValues)},applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):Object.prototype.hasOwnProperty.call(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},setFieldValue:function(t,e){var r;Object.assign(this.internalFormModelProxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},getUniqueRegistryName:function(t,e){return void 0===e&&(e=0),Object.prototype.hasOwnProperty.call(this.registry,t+(e||""))?this.getUniqueRegistryName(t,e+1):t+(e||"")},register:function(t,e){if(Object.prototype.hasOwnProperty.call(this.registry,t))return!1;this.registry[t]=e;var r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),o=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!r&&this.hasInitialValue&&this.initialValues[t]?e.context.model=this.initialValues[t]:!r&&!o||l(e.internalModelProxy,this.initialValues[t])||this.setFieldValue(t,e.internalModelProxy)},deregister:function(t){delete this.registry[t]},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new V(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},j=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{type:"form",errors:t.mergedFormErrors,"prevent-registration":!0}}),t._v(" "),t._t("default")],2)};j._withStripped=!0;var A=_({render:j,staticRenderFns:[]},void 0,$,void 0,!1,void 0,!1,void 0,void 0,void 0),N={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{showValidationErrors:{type:Boolean,default:!1},errors:{type:[Array,Boolean],default:!1},validationErrors:{type:[Array],default:function(){return[]}},type:{type:String,default:"form"},preventRegistration:{type:Boolean,default:!1},fieldName:{type:[String,Boolean],default:!1}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{mergedErrors:function(){return c(this.errors).concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.showValidationErrors?this.validationErrors:[])))}},created:function(){this.preventRegistration||"function"!=typeof this.observeErrors||"form"!==this.type&&!this.fieldName||this.observeErrors({callback:this.boundSetErrors,type:this.type,field:this.fieldName})},destroyed:function(){this.preventRegistration||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=c(t)}}},S=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};S._withStripped=!0;var D=_({render:S,staticRenderFns:[]},void 0,N,void 0,!1,void 0,!1,void 0,void 0,void 0);function k(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var C={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subComponent:function(){return"FormulateInput"},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes),o=(r.id,k(r,["id"])),i=(e.classification,e.blurHandler,e.performValidation,e.hasValidationErrors,e.component,e.hasLabel,k(e,["options","labelPosition","attributes","classification","blurHandler","performValidation","hasValidationErrors","component","hasLabel"]));return this.options.map((function(e){return t.groupItemContext(i,e,o)}))}},methods:{groupItemContext:function(t,e,r){return Object.assign({},t,e,r,{},t.hasGivenName?{}:{name:!0})}}},U=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return r(t.subComponent,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",attrs:{"disable-errors":!0},on:{blur:t.context.blurHandler},model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};U._withStripped=!0;var I=_({render:U,staticRenderFns:[]},void 0,C,void 0,!1,void 0,!1,void 0,void 0,void 0),B={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},R={name:"FormulateInputBox",mixins:[B]},L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t.context.value,a=t._i(r,n);o.checked?a<0&&t.$set(t.context,"model",r.concat([n])):a>-1&&t.$set(t.context,"model",r.slice(0,a).concat(r.slice(a+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};L._withStripped=!0;var M=_({render:L,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0),H={name:"FormulateInputText",mixins:[B]},T=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};T._withStripped=!0;var G=_({render:T,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateFiles",props:{files:{type:a,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},q=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};q._withStripped=!0;var Y={name:"FormulateInputFile",components:{FormulateFiles:_({render:q,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[B],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof a&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof a&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},z=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};z._withStripped=!0;var K=_({render:z,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),Z={name:"FormulateInputButton",mixins:[B]},J=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[r("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};J._withStripped=!0;var X=_({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateInputSelect",mixins:[B],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},tt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?r:r[0])}}},"select",t.attributes,!1),[t.context.placeholder?r("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,o){return r("optgroup",{key:o,attrs:{label:o}},t._l(e,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};tt._withStripped=!0;var et=_({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),rt={name:"FormulateInputSlider",mixins:[B]},ot=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};ot._withStripped=!0;var it=_({render:ot,staticRenderFns:[]},void 0,rt,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputTextArea",mixins:[B]},at=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};at._withStripped=!0;var st=_({render:at,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),lt=function(){this.options={},this.defaults={components:{FormulateForm:A,FormulateInput:O,FormulateErrors:D,FormulateInputBox:M,FormulateInputText:G,FormulateInputFile:K,FormulateInputGroup:I,FormulateInputButton:X,FormulateInputSelect:et,FormulateInputSlider:it,FormulateInputTextArea:st},library:n,rules:f,mimes:m,locale:!1,uploader:v,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[o],locales:{},idPrefix:"formulate-"},this.registry=new Map,this.idRegistry={}};lt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},lt.prototype.nextId=function(t){var e=t.$route&&t.$route.path||!1?t.$route.path.replace(/[\/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},lt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},lt.prototype.merge=function(t,e,o){void 0===o&&(o=!0);var i={};for(var n in t)e.hasOwnProperty(n)?r(e[n])&&r(t[n])?i[n]=this.merge(t[n],e[n],o):o&&Array.isArray(t[n])&&Array.isArray(e[n])?i[n]=t[n].concat(e[n]):i[n]=e[n]:i[n]=t[n];for(var a in e)i.hasOwnProperty(a)||(i[a]=e[a]);return i},lt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},lt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},lt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},lt.prototype.i18n=function(t){return!(!t.$i18n||!t.$i18n.locale)&&t.$i18n.locale},lt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return Object.prototype.hasOwnProperty.call(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},lt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},lt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},lt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},lt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:c(o.formErrors),inputErrors:o.inputErrors||{}}),o},lt.prototype.getUploader=function(){return this.options.uploader||!1},lt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},lt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},lt.prototype.createUpload=function(t,e){return new a(t,e,this.options)};var ut=new lt;export default ut; ->>>>>>> 63d3ca71484a9587faef39d0fb462ecf229cc442 +import t from"is-url";import e from"nanoid/non-secure";import r from"is-plain-object";import{en as o}from"@braid/vue-formulate-i18n";var i=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},n=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=i("text"),r))}),{}),{range:i("slider"),textarea:i("textarea","TextArea"),checkbox:i("box"),radio:i("box"),submit:i("button"),button:i("button"),select:i("select"),file:i("file"),image:i("file"),group:i("group")}),s=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function a(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),i=r.length;if(o.length!==i)return!1;for(var n=0;n=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},s.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},s.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},s.prototype.getFileList=function(){return this.fileList},s.prototype.getFiles=function(){return this.files},s.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var m={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof s)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof s?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(e){var r=e.value;return Promise.resolve(t(r))},bail:function(){return Promise.resolve(!0)}},v="image/",y={csv:"text/csv",gif:v+"gif",jpg:v+"jpeg",jpeg:v+"jpeg",png:v+"png",pdf:"application/pdf",svg:v+"svg+xml"};function g(t,e,r,o){return new Promise((function(r,i){var n=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var o=performance.now()-s,i=Math.min(100,Math.round(o/n*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function b(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var x={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,o=e.data,i=e.parent,n=e.children,s=i,a=(r.name,r.forceWrap),l=r.context,u=b(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},l,u));if(Array.isArray(n)&&(n.length>1||a&&n.length>0)){var c=o.attrs,d=(c.name,c.context,b(c,["name","context"]));return t("div",Object.assign({},o,{attrs:d}),n)}return Array.isArray(n)&&1===n.length?n[0]:null}};var E=function(t){this.registry=new Map,this.ctx=t};function w(t){return new E(t).dataProps()}function _(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return f(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):f(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function F(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;Object.assign(this.proxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.proxy))},getFormValues:function(){return this.proxy},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))}};return Object.keys(e).reduce((function(r,o){var i;return t.includes(o)?r:Object.assign({},r,((i={})[o]=e[o],i))}),{})}function O(t){return{formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.getFormValues}}E.prototype.add=function(t,e){return this.registry.set(t,e),this},E.prototype.remove=function(t){this.registry.delete(t);var e=this.ctx.proxy,r=(e[t],function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}(e,[String(t)]));return this.ctx.proxy=r,this},E.prototype.has=function(t){return this.registry.has(t)},E.prototype.get=function(t){return this.registry.get(t)},E.prototype.map=function(t){var e={};return this.registry.forEach((function(r,o){var i;return Object.assign(e,((i={})[o]=t(r,o),i))})),e},E.prototype.keys=function(){return Array.from(this.registry.keys())},E.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=f(e.$options.propsData,"formulateValue"),o=f(e.$options.propsData,"value");!r&&this.ctx.hasInitialValue&&this.ctx.initialValues[t]?e.context.model=this.ctx.initialValues[t]:!r&&!o||l(e.proxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.proxy),this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},E.prototype.reduce=function(t,e){return this.registry.forEach((function(r,o){e=t(e,r,o)})),e},E.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1}};var V=function(t){this.form=t};function P(t,e,r,o,i,n,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),o&&(d._scopeId=o),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var h=d.beforeCreate;d.beforeCreate=h?[].concat(h,c):[c]}return r}V.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},V.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],i=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var o in e)e[o]instanceof s||h(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.proxy),n=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof s&&o.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var a in i)n(a);Promise.all(o).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var A={provide:function(){return Object.assign({},O(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return Object.assign({},w(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},_(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=c(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=c(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.has(r)||l(t[r],this.proxy[r])||l(t[r],this.registry.get(r).proxy[r])||(this.setFieldValue(r,t[r]),this.registry.get(r).context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},F(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):f(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new V(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},$=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};$._withStripped=!0;var S=P({render:$,staticRenderFns:[]},void 0,A,void 0,!1,void 0,!1,void 0,void 0,void 0),j={context:function(){return k.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:R.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasGivenName:this.hasGivenName,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit,name:this.nameOrFallback,performValidation:this.performValidation.bind(this),preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:C.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,r){return C.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:C.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return c(this.errors).concat(this.localErrors).concat(c(this.error))},allErrors:function(){return this.explicitErrors.concat(c(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&N.call(this))return!0;return this.behavioralErrorVisibility},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){return{label:this.$formulate.slotComponent(this.type,"label"),help:this.$formulate.slotComponent(this.type,"help"),errors:this.$formulate.slotComponent(this.type,"errors"),repeatable:this.$formulate.slotComponent(this.type,"repeatable"),addMore:this.$formulate.slotComponent(this.type,"addMore")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel}};function C(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function R(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function k(t){return Object.defineProperty(t,"model",{get:N.bind(this),set:I.bind(this)})}function N(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function I(t){l(t,this.proxy)||(this.proxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t)}var D={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:Number,default:1/0},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},j,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[u(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[u(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[u(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:function(t,e){this.performValidation(),this.isVmodeled||l(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!l(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:f(this.$options.propsData,"value")&&"box"!==t?this.value:f(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!l(this.context.model,this.proxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.proxy)},updateLocalAttributes:function(t){l(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=d(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],o=t[1],i=t[2],n=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:e.getFormValues.bind(e),name:e.context.name}].concat(o)));return(n=n instanceof Promise?n:Promise.resolve(n)).then((function(t){return!t&&e.getMessage(i,o)}))};return new Promise((function(e){var o=function(t,i){void 0===i&&(i=[]);var n=t.shift();Array.isArray(n)&&n.length?Promise.all(n.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&n.bail||!t.length?e(i.concat(r)):o(t,i.concat(r))})):e([])};o(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()}));if(r>=0){var o=t.splice(0,r+1).slice(0,-1);o.length&&e.push(o),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var o=[],i=t.findIndex((function(t){return"^"===t[3]}));if(i>=0){var n=t.splice(0,i);n.length&&o.push.apply(o,r(n,e)),o.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&o.push.apply(o,r(t,e))}else o.push(t);return o};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!l(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=u(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=c(t)},registerRule:function(t,e,r,o){void 0===o&&(o=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==o&&(this.messageRegistry[r]=o))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,{tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}})],null,t.context)],2)};L._withStripped=!0;var U=P({render:L,staticRenderFns:[]},void 0,D,void 0,!1,void 0,!1,void 0,void 0,void 0),B={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=c(t)}}},M=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};M._withStripped=!0;var G=P({render:M,staticRenderFns:[]},void 0,B,void 0,!1,void 0,!1,void 0,void 0,void 0),H={props:{context:{type:Object,required:!0}}},T=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:"formulate-input-help formulate-input-help--"+this.context.helpPosition,domProps:{textContent:this._s(this.context.help)}}):this._e()};T._withStripped=!0;var q=P({render:T,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0}}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)&&(this.context.repeatable||0!==this.context.model.length)?this.context.model:[{}]},providers:function(){var t=this;return this.items.map((function(e,r){return!!Array.isArray(t.$refs["provider-"+r])&&t.$refs["provider-"+r][0]}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{setFieldValue:function(t,e,r){var o,i=Array.isArray(this.context.model)?this.context.model:[];i.splice(t,1,Object.assign({},"object"==typeof this.context.model[t]?this.context.model[t]:{},((o={})[e]=r,o))),this.context.model=i},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.map((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.splice(t,1)}}},Y=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{staticClass:"formulate-input-grouping",attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,o){return r("FormulateRepeatableProvider",{key:o,ref:"provider-"+o,refInFor:!0,attrs:{index:o,"set-field-value":function(e,r){return t.setFieldValue(o,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};Y._withStripped=!0;var z=P({render:Y,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),K={props:{context:{type:Object,required:!0}}},Z=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:"formulate-input-label formulate-input-label--"+this.context.labelPosition,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};Z._withStripped=!0;var J=P({render:Z,staticRenderFns:[]},void 0,K,void 0,!1,void 0,!1,void 0,void 0,void 0),X={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},Q=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"formulate-input-group-add-more"},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};Q._withStripped=!0;var tt=P({render:Q,staticRenderFns:[]},void 0,X,void 0,!1,void 0,!1,void 0,void 0,void 0),et={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},rt={name:"FormulateInputBox",mixins:[et]},ot=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t.context.value,s=t._i(r,n);o.checked?s<0&&t.$set(t.context,"model",r.concat([n])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};ot._withStripped=!0;var it=P({render:ot,staticRenderFns:[]},void 0,rt,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputText",mixins:[et]},st=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};st._withStripped=!0;var at=P({render:st,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),lt={name:"FormulateFiles",props:{files:{type:s,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},ut=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};ut._withStripped=!0;var ct={name:"FormulateInputFile",components:{FormulateFiles:P({render:ut,staticRenderFns:[]},void 0,lt,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[et],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof s&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof s&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},dt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};dt._withStripped=!0;var pt=P({render:dt,staticRenderFns:[]},void 0,ct,void 0,!1,void 0,!1,void 0,void 0,void 0),ht={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},ft=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group-repeatable"},[t.context.repeatable?r("a",{staticClass:"formulate-input-group-repeatable-remove",attrs:{role:"button"},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e(),t._v(" "),t._t("default")],2)};ft._withStripped=!0;var mt=P({render:ft,staticRenderFns:[]},void 0,ht,void 0,!1,void 0,!1,void 0,void 0,void 0);function vt(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var yt={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,o=(r.id,vt(r,["id"])),i=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.validationErrors,e.visibleValidationErrors,vt(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","labelPosition","options","performValidation","setErrors","slotComponents","validationErrors","visibleValidationErrors"]));return this.options.map((function(e){return t.groupItemContext(i,e,o)}))},canAddMore:function(){return this.context.repeatable&&this.items.length-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Pt._withStripped=!0;var At=P({render:Pt,staticRenderFns:[]},void 0,Vt,void 0,!1,void 0,!1,void 0,void 0,void 0),$t={name:"FormulateInputTextArea",mixins:[et]},St=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};St._withStripped=!0;var jt=P({render:St,staticRenderFns:[]},void 0,$t,void 0,!1,void 0,!1,void 0,void 0,void 0),Ct={provide:function(){var t=this;return Object.assign({},O(this),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},w(this),{isGrouping:!0})},computed:Object.assign({},_()),methods:Object.assign({},F(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,{tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Rt._withStripped=!0;var kt=P({render:Rt,staticRenderFns:[]},void 0,Ct,void 0,!1,void 0,!1,void 0,void 0,void 0),Nt=function(){this.options={},this.defaults={components:{FormulateSlot:x,FormulateForm:S,FormulateHelp:q,FormulateLabel:J,FormulateInput:U,FormulateErrors:G,FormulateAddMore:tt,FormulateGrouping:z,FormulateInputBox:it,FormulateInputText:at,FormulateInputFile:pt,FormulateRepeatable:mt,FormulateInputGroup:bt,FormulateInputButton:wt,FormulateInputSelect:Ot,FormulateInputSlider:At,FormulateInputTextArea:jt,FormulateRepeatableProvider:kt},slotComponents:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore"},library:n,rules:m,mimes:y,locale:!1,uploader:g,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[o],locales:{},idPrefix:"formulate-"},this.registry=new Map,this.idRegistry={}};Nt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},Nt.prototype.nextId=function(t){var e=t.$route&&t.$route.path||!1?t.$route.path.replace(/[\/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},Nt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},Nt.prototype.merge=function(t,e,o){void 0===o&&(o=!0);var i={};for(var n in t)e.hasOwnProperty(n)?r(e[n])&&r(t[n])?i[n]=this.merge(t[n],e[n],o):o&&Array.isArray(t[n])&&Array.isArray(e[n])?i[n]=t[n].concat(e[n]):i[n]=e[n]:i[n]=t[n];for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i},Nt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Nt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Nt.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},Nt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Nt.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Nt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return f(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},Nt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},Nt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Nt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Nt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:c(o.formErrors),inputErrors:o.inputErrors||{}}),o},Nt.prototype.getUploader=function(){return this.options.uploader||!1},Nt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Nt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Nt.prototype.createUpload=function(t,e){return new s(t,e,this.options)};var It=new Nt;export default It; diff --git a/dist/formulate.min.js b/dist/formulate.min.js index a825495..9295136 100644 --- a/dist/formulate.min.js +++ b/dist/formulate.min.js @@ -1,19 +1,15 @@ -var VueFormulate=function(){"use strict";var t=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},e=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(e,r){var o;return Object.assign({},e,((o={})[r]=t("text"),o))}),{}),{range:t("slider"),textarea:t("textarea","TextArea"),checkbox:t("box"),radio:t("box"),submit:t("button"),button:t("button"),select:t("select"),file:t("file"),image:t("file"),group:t("group")}),r=function(t){if("string"!=typeof t)return!1;var e=t.match(o);if(!e)return!1;var r=e[1];if(!r)return!1;if(n.test(r)||i.test(r))return!0;return!1},o=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,i=/^[^\s\.]+\.\S{2,}$/;for(var s="-_",a=36;a--;)s+=a.toString(36);for(a=36;a---10;)s+=a.toString(36).toUpperCase();var l=function(t){var e="";for(a=t||21;a--;)e+=s[64*Math.random()|0];return e},u=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function c(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function d(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),n=r.length;if(o.length!==n)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},u.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},u.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},u.prototype.getFileList=function(){return this.fileList},u.prototype.getFiles=function(){return this.files},u.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var y={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),n=Date.parse(r);return Promise.resolve(!isNaN(n)&&n>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},n=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[n].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},n=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[n].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),n=Date.parse(r);return Promise.resolve(!isNaN(n)&&ne&&ne&&n.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?d(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof u)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?d(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof u?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(t){var e=t.value;return Promise.resolve(r(e))}},g="image/",b={csv:"text/csv",gif:g+"gif",jpg:g+"jpeg",jpeg:g+"jpeg",png:g+"png",pdf:"application/pdf",svg:g+"svg+xml"}; +var VueFormulate=function(){"use strict";var t=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},e=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(e,r){var o;return Object.assign({},e,((o={})[r]=t("text"),o))}),{}),{range:t("slider"),textarea:t("textarea","TextArea"),checkbox:t("box"),radio:t("box"),submit:t("button"),button:t("button"),select:t("select"),file:t("file"),image:t("file"),group:t("group")}),r=function(t){if("string"!=typeof t)return!1;var e=t.match(o);if(!e)return!1;var r=e[1];if(!r)return!1;if(n.test(r)||i.test(r))return!0;return!1},o=/^(?:\w+:)?\/\/(\S+)$/,n=/^localhost[\:?\d]*(?:[^\:?\d]\S*)?$/,i=/^[^\s\.]+\.\S{2,}$/;for(var s="-_",a=36;a--;)s+=a.toString(36);for(a=36;a---10;)s+=a.toString(36).toUpperCase();var l=function(t){var e="";for(a=t||21;a--;)e+=s[64*Math.random()|0];return e},u=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function c(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function d(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),n=r.length;if(o.length!==n)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},u.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},u.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},u.prototype.getFileList=function(){return this.fileList},u.prototype.getFiles=function(){return this.files},u.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var g={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),n=Date.parse(r);return Promise.resolve(!isNaN(n)&&n>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},n=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[n].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},n=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[n].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),n=Date.parse(r);return Promise.resolve(!isNaN(n)&&ne&&ne&&n.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?d(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof u)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?d(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof u?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(t){var e=t.value;return Promise.resolve(r(e))},bail:function(){return Promise.resolve(!0)}},b="image/",x={csv:"text/csv",gif:b+"gif",jpg:b+"jpeg",jpeg:b+"jpeg",png:b+"png",pdf:"application/pdf",svg:b+"svg+xml"}; /*! * is-plain-object * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function x(t){return!0==(null!=(e=t)&&"object"==typeof e&&!1===Array.isArray(e))&&"[object Object]"===Object.prototype.toString.call(t); +function E(t){return!0==(null!=(e=t)&&"object"==typeof e&&!1===Array.isArray(e))&&"[object Object]"===Object.prototype.toString.call(t); /*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -<<<<<<< HEAD -var e}function E(t){var e,r;return!1!==x(t)&&("function"==typeof(e=t.constructor)&&(!1!==x(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function w(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}var _={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?w(e)+" must be after "+r[0]+".":w(e)+" must be a later date."},alpha:function(t){return w(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return w(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?w(e)+" must be before "+r[0]+".":w(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,o=t.args,n=!(!Array.isArray(o)||!o[2])&&o[2];return!isNaN(r)&&"length"!==n||"value"===n?w(e)+" must be between "+o[0]+" and "+o[1]+".":w(e)+" must be between "+o[0]+" and "+o[1]+" characters long."},confirm:function(t){var e=t.name;return t.args,w(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?w(e)+" is not a valid, please use the format "+r[0]:w(e)+" is not a valid date."},default:function(t){return t.name,"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},endsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t end with a valid value.":"This field doesn’t end with a valid value."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+w(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return w(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,o=t.args;if(Array.isArray(r))return"You may only select "+o[0]+" "+e+".";var n=!(!Array.isArray(o)||!o[1])&&o[1];return!isNaN(r)&&"length"!==n||"value"===n?w(e)+" must be less than or equal to "+o[0]+".":w(e)+" must be less than or equal to "+o[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return w(e)+" must be of the the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,o=t.args;if(Array.isArray(r))return"You must select at least "+o[0]+" "+e+".";var n=!(!Array.isArray(o)||!o[1])&&o[1];return!isNaN(r)&&"length"!==n||"value"===n?w(e)+" must be more than "+o[0]+".":w(e)+" must be more than "+o[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return w(t.name)+" must be a number."},required:function(t){return w(t.name)+" is required."},startsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t start with a valid value.":"This field doesn’t start with a valid value."},url:function(t){return t.name,"Please include a valid url."}};function F(t){var e;t.extend({locales:(e={},e.en=_,e)})}function V(t,e,r,o){return new Promise((function(r,n){var i=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var o=performance.now()-s,n=Math.min(100,Math.round(o/i*100));if(e(n),n>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function O(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var A={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,o=e.data,n=e.parent,i=e.children,s=n,a=(r.name,r.forceWrap),l=r.context,u=O(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},l,u));if(Array.isArray(i)&&(i.length>1||a&&i.length>0)){var c=o.attrs,d=(c.name,c.context,O(c,["name","context"]));return t("div",Object.assign({},o,{attrs:d}),i)}return Array.isArray(i)&&1===i.length?i[0]:null}},P=function(t){this.registry=new Map,this.ctx=t};function S(t){return new P(t).dataProps()}function $(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return v(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):v(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function j(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;Object.assign(this.proxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.proxy))},getFormValues:function(){return this.proxy},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))}};return Object.keys(e).reduce((function(r,o){var n;return t.includes(o)?r:Object.assign({},r,((n={})[o]=e[o],n))}),{})}function C(t){return{formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.getFormValues}}P.prototype.add=function(t,e){return this.registry.set(t,e),this},P.prototype.remove=function(t){return this.registry.delete(t),this},P.prototype.has=function(t){return this.registry.has(t)},P.prototype.get=function(t){return this.registry.get(t)},P.prototype.map=function(t){var e={};return this.registry.forEach((function(r,o){var n;return Object.assign(e,((n={})[o]=t(r,o),n))})),e},P.prototype.keys=function(){return Array.from(this.registry.keys())},P.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=v(e.$options.propsData,"formulateValue"),o=v(e.$options.propsData,"value");!r&&this.ctx.hasInitialValue&&this.ctx.initialValues[t]?e.context.model=this.ctx.initialValues[t]:!r&&!o||d(e.internalModelProxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.internalModelProxy),this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},P.prototype.reduce=function(t,e){return this.registry.forEach((function(r,o){e=t(e,r,o)})),e},P.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.registry.delete(e)},childrenShouldShowErrors:!1}};var k=function(t){this.form=t};function N(t,e,r,o,n,i,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,n&&(d.functional=!0)),o&&(d._scopeId=o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}k.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},k.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],n=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var o in e)e[o]instanceof u||m(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.proxy),i=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof u&&o.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(n,((r={})[e]=t,r))})))};for(var s in n)i(s);Promise.all(o).then((function(){return e(n)})).catch((function(t){return r(t)}))}))};var R={provide:function(){return Object.assign({},C(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return Object.assign({},S(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},$(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=f(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=f(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.has(r)||d(t[r],this.proxy[r])||d(t[r],this.registry.get(r).internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry.get(r).context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},j(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):v(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new k(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},I=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};I._withStripped=!0;var D=N({render:I,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0),U={context:function(){return M.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:B.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit,name:this.nameOrFallback,performValidation:this.performValidation.bind(this),preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:L.call(this,this.options),optionGroups:!!this.optionGroups&&c(this.optionGroups,(function(e,r){return L.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:L.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return f(this.errors).concat(this.localErrors).concat(f(this.error))},allErrors:function(){return this.explicitErrors.concat(f(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&T.call(this))return!0;return this.behavioralErrorVisibility},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){return{label:this.$formulate.slotComponent(this.type,"label"),help:this.$formulate.slotComponent(this.type,"help"),errors:this.$formulate.slotComponent(this.type,"errors"),repeatable:this.$formulate.slotComponent(this.type,"repeatable"),addMore:this.$formulate.slotComponent(this.type,"addMore")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel}};function L(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function B(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function M(t){return Object.defineProperty(t,"model",{get:T.bind(this),set:q.bind(this)})}function T(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function q(t){d(t,this.internalModelProxy)||(this.internalModelProxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t)}var G={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:Number,default:1/0},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:l(9),localAttributes:{},localErrors:[],internalModelProxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},U,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[p(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[p(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[p(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||d(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!d(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},destroyed:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:v(this.$options.propsData,"value")&&"box"!==t?this.value:v(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!d(this.context.model,this.internalModelProxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.internalModelProxy)},updateLocalAttributes:function(t){d(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=h(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?e.concat(this.ruleRegistry):e,this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],o=e[1],n=e[2],i=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(o));return(i=i instanceof Promise?i:Promise.resolve(i)).then((function(e){return!e&&t.getMessage(n,o)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){return t.didValidate(e)})),this.pendingValidation},didValidate:function(t){var e=!d(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=p(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=f(t)},registerRule:function(t,e,r,o){void 0===o&&(o=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==o&&(this.messageRegistry[r]=o))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},H=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,{tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}})],null,t.context)],2)};H._withStripped=!0;var W=N({render:H,staticRenderFns:[]},void 0,G,void 0,!1,void 0,!1,void 0,void 0,void 0),Y={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=f(t)}}},z=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};z._withStripped=!0;var K=N({render:z,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),Z={props:{context:{type:Object,required:!0}}},J=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:"formulate-input-help formulate-input-help--"+this.context.helpPosition,domProps:{textContent:this._s(this.context.help)}}):this._e()};J._withStripped=!0;var X=N({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0}}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)&&(this.context.repeatable||0!==this.context.model.length)?this.context.model:[{}]},providers:function(){var t=this;return this.items.map((function(e,r){return!!Array.isArray(t.$refs["provider-"+r])&&t.$refs["provider-"+r][0]}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{setFieldValue:function(t,e,r){var o,n=Array.isArray(this.context.model)?this.context.model:[];n.splice(t,1,Object.assign({},"object"==typeof this.context.model[t]?this.context.model[t]:{},((o={})[e]=r,o))),this.context.model=n},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.map((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.splice(t,1)}}},tt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{staticClass:"formulate-input-grouping",attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,o){return r("FormulateRepeatableProvider",{key:o,ref:"provider-"+o,refInFor:!0,attrs:{index:o,"set-field-value":function(e,r){return t.setFieldValue(o,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};tt._withStripped=!0;var et=N({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),rt={props:{context:{type:Object,required:!0}}},ot=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:"formulate-input-label formulate-input-label--"+this.context.labelPosition,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};ot._withStripped=!0;var nt=N({render:ot,staticRenderFns:[]},void 0,rt,void 0,!1,void 0,!1,void 0,void 0,void 0),it={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},st=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"formulate-input-group-add-more"},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};st._withStripped=!0;var at=N({render:st,staticRenderFns:[]},void 0,it,void 0,!1,void 0,!1,void 0,void 0,void 0),lt={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},ut={name:"FormulateInputBox",mixins:[lt]},ct=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t.context.value,s=t._i(r,i);o.checked?s<0&&t.$set(t.context,"model",r.concat([i])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};ct._withStripped=!0;var dt=N({render:ct,staticRenderFns:[]},void 0,ut,void 0,!1,void 0,!1,void 0,void 0,void 0),pt={name:"FormulateInputText",mixins:[lt]},ft=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t._i(r,null);o.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};ft._withStripped=!0;var ht=N({render:ft,staticRenderFns:[]},void 0,pt,void 0,!1,void 0,!1,void 0,void 0,void 0),mt={name:"FormulateFiles",props:{files:{type:u,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},vt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};vt._withStripped=!0;var yt={name:"FormulateInputFile",components:{FormulateFiles:N({render:vt,staticRenderFns:[]},void 0,mt,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[lt],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof u&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof u&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},gt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};gt._withStripped=!0;var bt=N({render:gt,staticRenderFns:[]},void 0,yt,void 0,!1,void 0,!1,void 0,void 0,void 0),xt={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},Et=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group-repeatable"},[t.context.repeatable?r("a",{staticClass:"formulate-input-group-repeatable-remove",attrs:{role:"button"},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e(),t._v(" "),t._t("default")],2)};Et._withStripped=!0;var wt=N({render:Et,staticRenderFns:[]},void 0,xt,void 0,!1,void 0,!1,void 0,void 0,void 0);function _t(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var Ft={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes),o=(r.id,_t(r,["id"])),n=(e.classification,e.blurHandler,e.performValidation,e.hasValidationErrors,e.getValidationErrors,e.validationErrors,e.setErrors,e.visibleValidationErrors,e.component,e.hasLabel,e.slotComponents,e.isSubField,_t(e,["options","labelPosition","attributes","classification","blurHandler","performValidation","hasValidationErrors","getValidationErrors","validationErrors","setErrors","visibleValidationErrors","component","hasLabel","slotComponents","isSubField"]));return this.options.map((function(e){return t.groupItemContext(n,e,o)}))},canAddMore:function(){return this.context.repeatable&&this.items.length-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t._i(r,null);o.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Nt._withStripped=!0;var Rt=N({render:Nt,staticRenderFns:[]},void 0,kt,void 0,!1,void 0,!1,void 0,void 0,void 0),It={name:"FormulateInputTextArea",mixins:[lt]},Dt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};Dt._withStripped=!0;var Ut=N({render:Dt,staticRenderFns:[]},void 0,It,void 0,!1,void 0,!1,void 0,void 0,void 0),Lt={provide:function(){var t=this;return Object.assign({},C(this),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},S(this),{isGrouping:!0})},computed:Object.assign({},$()),methods:Object.assign({},j(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Bt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,{tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Bt._withStripped=!0;var Mt=N({render:Bt,staticRenderFns:[]},void 0,Lt,void 0,!1,void 0,!1,void 0,void 0,void 0),Tt=function(){this.options={},this.defaults={components:{FormulateSlot:A,FormulateForm:D,FormulateHelp:X,FormulateLabel:nt,FormulateInput:W,FormulateErrors:K,FormulateAddMore:at,FormulateGrouping:et,FormulateInputBox:dt,FormulateInputText:ht,FormulateInputFile:bt,FormulateRepeatable:wt,FormulateInputGroup:Ot,FormulateInputButton:St,FormulateInputSelect:Ct,FormulateInputSlider:Rt,FormulateInputTextArea:Ut,FormulateRepeatableProvider:Mt},slotDefaults:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore"},library:e,rules:y,mimes:b,locale:!1,uploader:V,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[F],locales:{}},this.registry=new Map};return Tt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var n in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(n,this.options.components[n])},Tt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},Tt.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var o={};for(var n in t)e.hasOwnProperty(n)?E(e[n])&&E(t[n])?o[n]=this.merge(t[n],e[n],r):r&&Array.isArray(t[n])&&Array.isArray(e[n])?o[n]=t[n].concat(e[n]):o[n]=e[n]:o[n]=t[n];for(var i in e)o.hasOwnProperty(i)||(o[i]=e[i]);return o},Tt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Tt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Tt.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotDefaults[e]},Tt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Tt.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Tt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return v(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},Tt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},Tt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Tt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Tt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:f(o.formErrors),inputErrors:o.inputErrors||{}}),o},Tt.prototype.getUploader=function(){return this.options.uploader||!1},Tt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Tt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Tt.prototype.createUpload=function(t,e){return new u(t,e,this.options)},new Tt}(); -======= -var e}function x(t){var e,r;return!1!==b(t)&&("function"==typeof(e=t.constructor)&&(!1!==b(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function w(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}var F={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?w(e)+" must be after "+r[0]+".":w(e)+" must be a later date."},alpha:function(t){return w(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return w(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?w(e)+" must be before "+r[0]+".":w(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,o=t.args,n=!(!Array.isArray(o)||!o[2])&&o[2];return!isNaN(r)&&"length"!==n||"value"===n?w(e)+" must be between "+o[0]+" and "+o[1]+".":w(e)+" must be between "+o[0]+" and "+o[1]+" characters long."},confirm:function(t){var e=t.name;return t.args,w(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?w(e)+" is not a valid, please use the format "+r[0]:w(e)+" is not a valid date."},default:function(t){return t.name,"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},endsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t end with a valid value.":"This field doesn’t end with a valid value."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+w(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return w(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,o=t.args;if(Array.isArray(r))return"You may only select "+o[0]+" "+e+".";var n=!(!Array.isArray(o)||!o[1])&&o[1];return!isNaN(r)&&"length"!==n||"value"===n?w(e)+" must be less than or equal to "+o[0]+".":w(e)+" must be less than or equal to "+o[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return w(e)+" must be of the the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,o=t.args;if(Array.isArray(r))return"You must select at least "+o[0]+" "+e+".";var n=!(!Array.isArray(o)||!o[1])&&o[1];return!isNaN(r)&&"length"!==n||"value"===n?w(e)+" must be more than "+o[0]+".":w(e)+" must be more than "+o[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return w(t.name)+" must be a number."},required:function(t){return w(t.name)+" is required."},startsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t start with a valid value.":"This field doesn’t start with a valid value."},url:function(t){return t.name,"Please include a valid url."}};function _(t){var e;t.extend({locales:(e={},e.en=F,e)})}function E(t,e,r,o){return new Promise((function(r,n){var i=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var o=performance.now()-a,n=Math.min(100,Math.round(o/i*100));if(e(n),n>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var P={context:function(){return A.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,hasGivenName:this.hasGivenName,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,performValidation:this.performValidation.bind(this),blurHandler:V.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:O.call(this,this.options),optionGroups:!!this.optionGroups&&c(this.optionGroups,(function(e,r){return O.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:O.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return f(this.errors).concat(f(this.error))},allErrors:function(){return this.explicitErrors.concat(f(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&this.context.model)return!0;return this.behavioralErrorVisibility}};function O(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function V(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function A(t){return Object.defineProperty(t,"model",{get:$.bind(this),set:N.bind(this)})}function $(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function N(t){d(t,this.internalModelProxy)||(this.internalModelProxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function j(t,e,r,o,n,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,n&&(d.functional=!0)),o&&(d._scopeId=o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}var S={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},formulateFormDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},internalModelProxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},P,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[p(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[p(r)]=t.validationMessages[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||d(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!d(t,e)&&(this.context.model=t)}},created:function(){this.applyInitialValue(),this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.formulateFormDeregister&&"function"==typeof this.formulateFormDeregister&&this.formulateFormDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:Object.prototype.hasOwnProperty.call(this.$options.propsData,"value")&&"box"!==t?this.value:Object.prototype.hasOwnProperty.call(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!d(this.context.model,this.internalModelProxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.internalModelProxy)},updateLocalAttributes:function(t){d(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=h(this.validation,this.$formulate.rules(this.parsedValidationRules));return this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],o=e[1],n=e[2],i=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(o));return(i=i instanceof Promise?i:Promise.resolve(i)).then((function(e){return!e&&t.getMessage(n,o)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=p(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},D=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?r("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.disableErrors?t._e():r("FormulateErrors",{attrs:{type:"input",errors:t.explicitErrors,"field-name":t.nameOrFallback,"validation-errors":t.validationErrors,"show-validation-errors":t.showValidationErrors}})],1)};D._withStripped=!0;var C=j({render:D,staticRenderFns:[]},void 0,S,void 0,!1,void 0,!1,void 0,void 0,void 0),k=function(t){this.form=t};k.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},k.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],n=function t(e){var r={};for(var o in e)e[o]instanceof u||m(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.internalFormModelProxy),i=function(e){"object"==typeof t.form.internalFormModelProxy[e]&&t.form.internalFormModelProxy[e]instanceof u&&o.push(t.form.internalFormModelProxy[e].upload().then((function(t){var r;return Object.assign(n,((r={})[e]=t,r))})))};for(var a in n)i(a);Promise.all(o).then((function(){return e(n)})).catch((function(t){return r(t)}))}))};var U={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,formulateFormDeregister:this.deregister,getFormValues:this.getFormValues,observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}}},computed:{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return Object.prototype.hasOwnProperty.call(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):Object.prototype.hasOwnProperty.call(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):{}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=f(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=f(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.hasOwnProperty(r)||d(t[r],this.internalFormModelProxy[r])||d(t[r],this.registry[r].internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry[r].context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:{applyInitialValues:function(){this.hasInitialValue&&(this.internalFormModelProxy=this.initialValues)},applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):Object.prototype.hasOwnProperty.call(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},setFieldValue:function(t,e){var r;Object.assign(this.internalFormModelProxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},getUniqueRegistryName:function(t,e){return void 0===e&&(e=0),Object.prototype.hasOwnProperty.call(this.registry,t+(e||""))?this.getUniqueRegistryName(t,e+1):t+(e||"")},register:function(t,e){if(Object.prototype.hasOwnProperty.call(this.registry,t))return!1;this.registry[t]=e;var r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),o=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!r&&this.hasInitialValue&&this.initialValues[t]?e.context.model=this.initialValues[t]:!r&&!o||d(e.internalModelProxy,this.initialValues[t])||this.setFieldValue(t,e.internalModelProxy)},deregister:function(t){delete this.registry[t]},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new k(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},I=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{type:"form",errors:t.mergedFormErrors,"prevent-registration":!0}}),t._v(" "),t._t("default")],2)};I._withStripped=!0;var B=j({render:I,staticRenderFns:[]},void 0,U,void 0,!1,void 0,!1,void 0,void 0,void 0),R={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{showValidationErrors:{type:Boolean,default:!1},errors:{type:[Array,Boolean],default:!1},validationErrors:{type:[Array],default:function(){return[]}},type:{type:String,default:"form"},preventRegistration:{type:Boolean,default:!1},fieldName:{type:[String,Boolean],default:!1}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{mergedErrors:function(){return f(this.errors).concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.showValidationErrors?this.validationErrors:[])))}},created:function(){this.preventRegistration||"function"!=typeof this.observeErrors||"form"!==this.type&&!this.fieldName||this.observeErrors({callback:this.boundSetErrors,type:this.type,field:this.fieldName})},destroyed:function(){this.preventRegistration||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=f(t)}}},L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};L._withStripped=!0;var M=j({render:L,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0);function T(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var H={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subComponent:function(){return"FormulateInput"},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes),o=(r.id,T(r,["id"])),n=(e.classification,e.blurHandler,e.performValidation,e.hasValidationErrors,e.component,e.hasLabel,T(e,["options","labelPosition","attributes","classification","blurHandler","performValidation","hasValidationErrors","component","hasLabel"]));return this.options.map((function(e){return t.groupItemContext(n,e,o)}))}},methods:{groupItemContext:function(t,e,r){return Object.assign({},t,e,r,{},t.hasGivenName?{}:{name:!0})}}},G=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return r(t.subComponent,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",attrs:{"disable-errors":!0},on:{blur:t.context.blurHandler},model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};G._withStripped=!0;var q=j({render:G,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),W={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},Y={name:"FormulateInputBox",mixins:[W]},z=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t.context.value,a=t._i(r,i);o.checked?a<0&&t.$set(t.context,"model",r.concat([i])):a>-1&&t.$set(t.context,"model",r.slice(0,a).concat(r.slice(a+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};z._withStripped=!0;var K=j({render:z,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),Z={name:"FormulateInputText",mixins:[W]},J=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t._i(r,null);o.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};J._withStripped=!0;var X=j({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateFiles",props:{files:{type:u,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},tt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};tt._withStripped=!0;var et={name:"FormulateInputFile",components:{FormulateFiles:j({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[W],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof u&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof u&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};rt._withStripped=!0;var ot=j({render:rt,staticRenderFns:[]},void 0,et,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputButton",mixins:[W]},it=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[r("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};it._withStripped=!0;var at=j({render:it,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),st={name:"FormulateInputSelect",mixins:[W],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},lt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?r:r[0])}}},"select",t.attributes,!1),[t.context.placeholder?r("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,o){return r("optgroup",{key:o,attrs:{label:o}},t._l(e,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};lt._withStripped=!0;var ut=j({render:lt,staticRenderFns:[]},void 0,st,void 0,!1,void 0,!1,void 0,void 0,void 0),ct={name:"FormulateInputSlider",mixins:[W]},dt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t._i(r,null);o.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};dt._withStripped=!0;var pt=j({render:dt,staticRenderFns:[]},void 0,ct,void 0,!1,void 0,!1,void 0,void 0,void 0),ft={name:"FormulateInputTextArea",mixins:[W]},ht=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};ht._withStripped=!0;var mt=j({render:ht,staticRenderFns:[]},void 0,ft,void 0,!1,void 0,!1,void 0,void 0,void 0),vt=function(){this.options={},this.defaults={components:{FormulateForm:B,FormulateInput:C,FormulateErrors:M,FormulateInputBox:K,FormulateInputText:X,FormulateInputFile:ot,FormulateInputGroup:q,FormulateInputButton:at,FormulateInputSelect:ut,FormulateInputSlider:pt,FormulateInputTextArea:mt},library:e,rules:v,mimes:g,locale:!1,uploader:E,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[_],locales:{},idPrefix:"formulate-"},this.registry=new Map,this.idRegistry={}};return vt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var n in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(n,this.options.components[n])},vt.prototype.nextId=function(t){var e=t.$route&&t.$route.path||!1?t.$route.path.replace(/[\/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},vt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},vt.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var o={};for(var n in t)e.hasOwnProperty(n)?x(e[n])&&x(t[n])?o[n]=this.merge(t[n],e[n],r):r&&Array.isArray(t[n])&&Array.isArray(e[n])?o[n]=t[n].concat(e[n]):o[n]=e[n]:o[n]=t[n];for(var i in e)o.hasOwnProperty(i)||(o[i]=e[i]);return o},vt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},vt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},vt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},vt.prototype.i18n=function(t){return!(!t.$i18n||!t.$i18n.locale)&&t.$i18n.locale},vt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return Object.prototype.hasOwnProperty.call(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},vt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},vt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},vt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},vt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:f(o.formErrors),inputErrors:o.inputErrors||{}}),o},vt.prototype.getUploader=function(){return this.options.uploader||!1},vt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},vt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},vt.prototype.createUpload=function(t,e){return new u(t,e,this.options)},new vt}(); ->>>>>>> 63d3ca71484a9587faef39d0fb462ecf229cc442 +var e}function w(t){var e,r;return!1!==E(t)&&("function"==typeof(e=t.constructor)&&(!1!==E(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}function _(t){return"string"==typeof t?t[0].toUpperCase()+t.substr(1):t}var F={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?_(e)+" must be after "+r[0]+".":_(e)+" must be a later date."},alpha:function(t){return _(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return _(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?_(e)+" must be before "+r[0]+".":_(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,o=t.args,n=!(!Array.isArray(o)||!o[2])&&o[2];return!isNaN(r)&&"length"!==n||"value"===n?_(e)+" must be between "+o[0]+" and "+o[1]+".":_(e)+" must be between "+o[0]+" and "+o[1]+" characters long."},confirm:function(t){var e=t.name;return t.args,_(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?_(e)+" is not a valid date, please use the format "+r[0]:_(e)+" is not a valid date."},default:function(t){return t.name,"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},endsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t end with a valid value.":"This field doesn’t end with a valid value."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+_(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return _(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,o=t.args;if(Array.isArray(r))return"You may only select "+o[0]+" "+e+".";var n=!(!Array.isArray(o)||!o[1])&&o[1];return!isNaN(r)&&"length"!==n||"value"===n?_(e)+" must be less than or equal to "+o[0]+".":_(e)+" must be less than or equal to "+o[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return _(e)+" must be of the the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,o=t.args;if(Array.isArray(r))return"You need at least "+o[0]+" "+e+".";var n=!(!Array.isArray(o)||!o[1])&&o[1];return!isNaN(r)&&"length"!==n||"value"===n?_(e)+" must be more than "+o[0]+".":_(e)+" must be more than "+o[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return _(t.name)+" must be a number."},required:function(t){return _(t.name)+" is required."},startsWith:function(t){t.name;var e=t.value;return e?"“"+e+"” doesn’t start with a valid value.":"This field doesn’t start with a valid value."},url:function(t){return t.name,"Please include a valid url."}};function O(t){var e;t.extend({locales:(e={},e.en=F,e)})}function V(t,e,r,o){return new Promise((function(r,n){var i=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var o=performance.now()-s,n=Math.min(100,Math.round(o/i*100));if(e(n),n>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function A(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var P={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,o=e.data,n=e.parent,i=e.children,s=n,a=(r.name,r.forceWrap),l=r.context,u=A(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},l,u));if(Array.isArray(i)&&(i.length>1||a&&i.length>0)){var c=o.attrs,d=(c.name,c.context,A(c,["name","context"]));return t("div",Object.assign({},o,{attrs:d}),i)}return Array.isArray(i)&&1===i.length?i[0]:null}};var $=function(t){this.registry=new Map,this.ctx=t};function S(t){return new $(t).dataProps()}function j(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return y(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):y(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function C(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;Object.assign(this.proxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.proxy))},getFormValues:function(){return this.proxy},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))}};return Object.keys(e).reduce((function(r,o){var n;return t.includes(o)?r:Object.assign({},r,((n={})[o]=e[o],n))}),{})}function R(t){return{formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.getFormValues}}$.prototype.add=function(t,e){return this.registry.set(t,e),this},$.prototype.remove=function(t){this.registry.delete(t);var e=this.ctx.proxy,r=(e[t],function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}(e,[String(t)]));return this.ctx.proxy=r,this},$.prototype.has=function(t){return this.registry.has(t)},$.prototype.get=function(t){return this.registry.get(t)},$.prototype.map=function(t){var e={};return this.registry.forEach((function(r,o){var n;return Object.assign(e,((n={})[o]=t(r,o),n))})),e},$.prototype.keys=function(){return Array.from(this.registry.keys())},$.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=y(e.$options.propsData,"formulateValue"),o=y(e.$options.propsData,"value");!r&&this.ctx.hasInitialValue&&this.ctx.initialValues[t]?e.context.model=this.ctx.initialValues[t]:!r&&!o||d(e.proxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.proxy),this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},$.prototype.reduce=function(t,e){return this.registry.forEach((function(r,o){e=t(e,r,o)})),e},$.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1}};var N=function(t){this.form=t};function k(t,e,r,o,n,i,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,n&&(d.functional=!0)),o&&(d._scopeId=o),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}N.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},N.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],n=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var o in e)e[o]instanceof u||v(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.proxy),i=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof u&&o.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(n,((r={})[e]=t,r))})))};for(var s in n)i(s);Promise.all(o).then((function(){return e(n)})).catch((function(t){return r(t)}))}))};var I={provide:function(){return Object.assign({},R(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return Object.assign({},S(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},j(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=f(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=f(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.has(r)||d(t[r],this.proxy[r])||d(t[r],this.registry.get(r).proxy[r])||(this.setFieldValue(r,t[r]),this.registry.get(r).context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},C(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):y(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new N(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},D=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};D._withStripped=!0;var L=k({render:D,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),U={context:function(){return G.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:M.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasGivenName:this.hasGivenName,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit,name:this.nameOrFallback,performValidation:this.performValidation.bind(this),preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:B.call(this,this.options),optionGroups:!!this.optionGroups&&c(this.optionGroups,(function(e,r){return B.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:B.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return f(this.errors).concat(this.localErrors).concat(f(this.error))},allErrors:function(){return this.explicitErrors.concat(f(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&T.call(this))return!0;return this.behavioralErrorVisibility},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){return{label:this.$formulate.slotComponent(this.type,"label"),help:this.$formulate.slotComponent(this.type,"help"),errors:this.$formulate.slotComponent(this.type,"errors"),repeatable:this.$formulate.slotComponent(this.type,"repeatable"),addMore:this.$formulate.slotComponent(this.type,"addMore")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel}};function B(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function M(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function G(t){return Object.defineProperty(t,"model",{get:T.bind(this),set:q.bind(this)})}function T(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function q(t){d(t,this.proxy)||(this.proxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t)}var H={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:Number,default:1/0},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},U,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[p(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[p(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[p(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:function(t,e){this.performValidation(),this.isVmodeled||d(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!d(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:y(this.$options.propsData,"value")&&"box"!==t?this.value:y(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!d(this.context.model,this.proxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.proxy)},updateLocalAttributes:function(t){d(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=h(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],o=t[1],n=t[2],i=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:e.getFormValues.bind(e),name:e.context.name}].concat(o)));return(i=i instanceof Promise?i:Promise.resolve(i)).then((function(t){return!t&&e.getMessage(n,o)}))};return new Promise((function(e){var o=function(t,n){void 0===n&&(n=[]);var i=t.shift();Array.isArray(i)&&i.length?Promise.all(i.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&i.bail||!t.length?e(n.concat(r)):o(t,n.concat(r))})):e([])};o(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()}));if(r>=0){var o=t.splice(0,r+1).slice(0,-1);o.length&&e.push(o),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var o=[],n=t.findIndex((function(t){return"^"===t[3]}));if(n>=0){var i=t.splice(0,n);i.length&&o.push.apply(o,r(i,e)),o.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&o.push.apply(o,r(t,e))}else o.push(t);return o};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!d(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=p(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=f(t)},registerRule:function(t,e,r,o){void 0===o&&(o=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==o&&(this.messageRegistry[r]=o))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},W=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,{tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}})],null,t.context)],2)};W._withStripped=!0;var Y=k({render:W,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),z={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=f(t)}}},K=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};K._withStripped=!0;var Z=k({render:K,staticRenderFns:[]},void 0,z,void 0,!1,void 0,!1,void 0,void 0,void 0),J={props:{context:{type:Object,required:!0}}},X=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:"formulate-input-help formulate-input-help--"+this.context.helpPosition,domProps:{textContent:this._s(this.context.help)}}):this._e()};X._withStripped=!0;var Q=k({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),tt={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0}}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)&&(this.context.repeatable||0!==this.context.model.length)?this.context.model:[{}]},providers:function(){var t=this;return this.items.map((function(e,r){return!!Array.isArray(t.$refs["provider-"+r])&&t.$refs["provider-"+r][0]}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{setFieldValue:function(t,e,r){var o,n=Array.isArray(this.context.model)?this.context.model:[];n.splice(t,1,Object.assign({},"object"==typeof this.context.model[t]?this.context.model[t]:{},((o={})[e]=r,o))),this.context.model=n},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.map((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.splice(t,1)}}},et=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{staticClass:"formulate-input-grouping",attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,o){return r("FormulateRepeatableProvider",{key:o,ref:"provider-"+o,refInFor:!0,attrs:{index:o,"set-field-value":function(e,r){return t.setFieldValue(o,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};et._withStripped=!0;var rt=k({render:et,staticRenderFns:[]},void 0,tt,void 0,!1,void 0,!1,void 0,void 0,void 0),ot={props:{context:{type:Object,required:!0}}},nt=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:"formulate-input-label formulate-input-label--"+this.context.labelPosition,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};nt._withStripped=!0;var it=k({render:nt,staticRenderFns:[]},void 0,ot,void 0,!1,void 0,!1,void 0,void 0,void 0),st={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},at=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"formulate-input-group-add-more"},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};at._withStripped=!0;var lt=k({render:at,staticRenderFns:[]},void 0,st,void 0,!1,void 0,!1,void 0,void 0,void 0),ut={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},ct={name:"FormulateInputBox",mixins:[ut]},dt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t.context.value,s=t._i(r,i);o.checked?s<0&&t.$set(t.context,"model",r.concat([i])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};dt._withStripped=!0;var pt=k({render:dt,staticRenderFns:[]},void 0,ct,void 0,!1,void 0,!1,void 0,void 0,void 0),ft={name:"FormulateInputText",mixins:[ut]},ht=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t._i(r,null);o.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};ht._withStripped=!0;var mt=k({render:ht,staticRenderFns:[]},void 0,ft,void 0,!1,void 0,!1,void 0,void 0,void 0),vt={name:"FormulateFiles",props:{files:{type:u,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},yt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};yt._withStripped=!0;var gt={name:"FormulateInputFile",components:{FormulateFiles:k({render:yt,staticRenderFns:[]},void 0,vt,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[ut],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof u&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof u&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},bt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};bt._withStripped=!0;var xt=k({render:bt,staticRenderFns:[]},void 0,gt,void 0,!1,void 0,!1,void 0,void 0,void 0),Et={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},wt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group-repeatable"},[t.context.repeatable?r("a",{staticClass:"formulate-input-group-repeatable-remove",attrs:{role:"button"},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e(),t._v(" "),t._t("default")],2)};wt._withStripped=!0;var _t=k({render:wt,staticRenderFns:[]},void 0,Et,void 0,!1,void 0,!1,void 0,void 0,void 0);function Ft(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var Ot={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,o=(r.id,Ft(r,["id"])),n=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.validationErrors,e.visibleValidationErrors,Ft(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","labelPosition","options","performValidation","setErrors","slotComponents","validationErrors","visibleValidationErrors"]));return this.options.map((function(e){return t.groupItemContext(n,e,o)}))},canAddMore:function(){return this.context.repeatable&&this.items.length-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,n=!!o.checked;if(Array.isArray(r)){var i=t._i(r,null);o.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",n)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};kt._withStripped=!0;var It=k({render:kt,staticRenderFns:[]},void 0,Nt,void 0,!1,void 0,!1,void 0,void 0,void 0),Dt={name:"FormulateInputTextArea",mixins:[ut]},Lt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};Lt._withStripped=!0;var Ut=k({render:Lt,staticRenderFns:[]},void 0,Dt,void 0,!1,void 0,!1,void 0,void 0,void 0),Bt={provide:function(){var t=this;return Object.assign({},R(this),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},S(this),{isGrouping:!0})},computed:Object.assign({},j()),methods:Object.assign({},C(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Mt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,{tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Mt._withStripped=!0;var Gt=k({render:Mt,staticRenderFns:[]},void 0,Bt,void 0,!1,void 0,!1,void 0,void 0,void 0),Tt=function(){this.options={},this.defaults={components:{FormulateSlot:P,FormulateForm:L,FormulateHelp:Q,FormulateLabel:it,FormulateInput:Y,FormulateErrors:Z,FormulateAddMore:lt,FormulateGrouping:rt,FormulateInputBox:pt,FormulateInputText:mt,FormulateInputFile:xt,FormulateRepeatable:_t,FormulateInputGroup:At,FormulateInputButton:St,FormulateInputSelect:Rt,FormulateInputSlider:It,FormulateInputTextArea:Ut,FormulateRepeatableProvider:Gt},slotComponents:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore"},library:e,rules:g,mimes:x,locale:!1,uploader:V,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[O],locales:{},idPrefix:"formulate-"},this.registry=new Map,this.idRegistry={}};return Tt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var n in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(n,this.options.components[n])},Tt.prototype.nextId=function(t){var e=t.$route&&t.$route.path||!1?t.$route.path.replace(/[\/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},Tt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},Tt.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var o={};for(var n in t)e.hasOwnProperty(n)?w(e[n])&&w(t[n])?o[n]=this.merge(t[n],e[n],r):r&&Array.isArray(t[n])&&Array.isArray(e[n])?o[n]=t[n].concat(e[n]):o[n]=e[n]:o[n]=t[n];for(var i in e)o.hasOwnProperty(i)||(o[i]=e[i]);return o},Tt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Tt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Tt.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},Tt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Tt.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Tt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return y(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},Tt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},Tt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Tt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Tt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:f(o.formErrors),inputErrors:o.inputErrors||{}}),o},Tt.prototype.getUploader=function(){return this.options.uploader||!1},Tt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Tt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Tt.prototype.createUpload=function(t,e){return new u(t,e,this.options)},new Tt}(); diff --git a/dist/formulate.umd.js b/dist/formulate.umd.js index c647ea1..49dc73b 100644 --- a/dist/formulate.umd.js +++ b/dist/formulate.umd.js @@ -1,5 +1 @@ -<<<<<<< HEAD -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("is-url"),require("nanoid/non-secure"),require("is-plain-object"),require("@braid/vue-formulate-i18n")):"function"==typeof define&&define.amd?define(["is-url","nanoid/non-secure","is-plain-object","@braid/vue-formulate-i18n"],e):(t=t||self).Formulate=e(t.isUrl,t.nanoid,t.isPlainObject,t.VueFormulateI18n)}(this,(function(t,e,r,o){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var i=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},n=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=i("text"),r))}),{}),{range:i("slider"),textarea:i("textarea","TextArea"),checkbox:i("box"),radio:i("box"),submit:i("button"),button:i("button"),select:i("select"),file:i("file"),image:i("file"),group:i("group")}),s=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function a(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),i=r.length;if(o.length!==i)return!1;for(var n=0;n=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},s.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},s.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},s.prototype.getFileList=function(){return this.fileList},s.prototype.getFiles=function(){return this.files},s.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var h={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof s)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof s?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(e){var r=e.value;return Promise.resolve(t(r))}},m="image/",v={csv:"text/csv",gif:m+"gif",jpg:m+"jpeg",jpeg:m+"jpeg",png:m+"png",pdf:"application/pdf",svg:m+"svg+xml"};function y(t,e,r,o){return new Promise((function(r,i){var n=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var o=performance.now()-s,i=Math.min(100,Math.round(o/n*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function g(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var b={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,o=e.data,i=e.parent,n=e.children,s=i,a=(r.name,r.forceWrap),l=r.context,u=g(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},l,u));if(Array.isArray(n)&&(n.length>1||a&&n.length>0)){var c=o.attrs,d=(c.name,c.context,g(c,["name","context"]));return t("div",Object.assign({},o,{attrs:d}),n)}return Array.isArray(n)&&1===n.length?n[0]:null}},x=function(t){this.registry=new Map,this.ctx=t};function E(t){return new x(t).dataProps()}function _(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return f(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):f(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function w(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;Object.assign(this.proxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.proxy))},getFormValues:function(){return this.proxy},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))}};return Object.keys(e).reduce((function(r,o){var i;return t.includes(o)?r:Object.assign({},r,((i={})[o]=e[o],i))}),{})}function F(t){return{formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.getFormValues}}x.prototype.add=function(t,e){return this.registry.set(t,e),this},x.prototype.remove=function(t){return this.registry.delete(t),this},x.prototype.has=function(t){return this.registry.has(t)},x.prototype.get=function(t){return this.registry.get(t)},x.prototype.map=function(t){var e={};return this.registry.forEach((function(r,o){var i;return Object.assign(e,((i={})[o]=t(r,o),i))})),e},x.prototype.keys=function(){return Array.from(this.registry.keys())},x.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=f(e.$options.propsData,"formulateValue"),o=f(e.$options.propsData,"value");!r&&this.ctx.hasInitialValue&&this.ctx.initialValues[t]?e.context.model=this.ctx.initialValues[t]:!r&&!o||l(e.internalModelProxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.internalModelProxy),this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},x.prototype.reduce=function(t,e){return this.registry.forEach((function(r,o){e=t(e,r,o)})),e},x.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.registry.delete(e)},childrenShouldShowErrors:!1}};var O=function(t){this.form=t};function V(t,e,r,o,i,n,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),o&&(d._scopeId=o),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}O.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},O.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],i=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var o in e)e[o]instanceof s||p(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.proxy),n=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof s&&o.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var a in i)n(a);Promise.all(o).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var P={provide:function(){return Object.assign({},F(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return Object.assign({},E(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},_(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=c(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=c(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.has(r)||l(t[r],this.proxy[r])||l(t[r],this.registry.get(r).internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry.get(r).context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},w(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):f(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new O(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},$=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};$._withStripped=!0;var S=V({render:$,staticRenderFns:[]},void 0,P,void 0,!1,void 0,!1,void 0,void 0,void 0),A={context:function(){return k.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:C.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit,name:this.nameOrFallback,performValidation:this.performValidation.bind(this),preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:j.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,r){return j.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:j.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return c(this.errors).concat(this.localErrors).concat(c(this.error))},allErrors:function(){return this.explicitErrors.concat(c(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&R.call(this))return!0;return this.behavioralErrorVisibility},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){return{label:this.$formulate.slotComponent(this.type,"label"),help:this.$formulate.slotComponent(this.type,"help"),errors:this.$formulate.slotComponent(this.type,"errors"),repeatable:this.$formulate.slotComponent(this.type,"repeatable"),addMore:this.$formulate.slotComponent(this.type,"addMore")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel}};function j(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function C(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function k(t){return Object.defineProperty(t,"model",{get:R.bind(this),set:N.bind(this)})}function R(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function N(t){l(t,this.internalModelProxy)||(this.internalModelProxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t)}var I={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:Number,default:1/0},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:e(9),localAttributes:{},localErrors:[],internalModelProxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},A,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[u(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[u(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[u(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||l(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!l(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},destroyed:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:f(this.$options.propsData,"value")&&"box"!==t?this.value:f(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!l(this.context.model,this.internalModelProxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.internalModelProxy)},updateLocalAttributes:function(t){l(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=d(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?e.concat(this.ruleRegistry):e,this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],o=e[1],i=e[2],n=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(o));return(n=n instanceof Promise?n:Promise.resolve(n)).then((function(e){return!e&&t.getMessage(i,o)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){return t.didValidate(e)})),this.pendingValidation},didValidate:function(t){var e=!l(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=u(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=c(t)},registerRule:function(t,e,r,o){void 0===o&&(o=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==o&&(this.messageRegistry[r]=o))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},D=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,{tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}})],null,t.context)],2)};D._withStripped=!0;var L=V({render:D,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),U={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=c(t)}}},B=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};B._withStripped=!0;var M=V({render:B,staticRenderFns:[]},void 0,U,void 0,!1,void 0,!1,void 0,void 0,void 0),q={props:{context:{type:Object,required:!0}}},G=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:"formulate-input-help formulate-input-help--"+this.context.helpPosition,domProps:{textContent:this._s(this.context.help)}}):this._e()};G._withStripped=!0;var H=V({render:G,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),T={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0}}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)&&(this.context.repeatable||0!==this.context.model.length)?this.context.model:[{}]},providers:function(){var t=this;return this.items.map((function(e,r){return!!Array.isArray(t.$refs["provider-"+r])&&t.$refs["provider-"+r][0]}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{setFieldValue:function(t,e,r){var o,i=Array.isArray(this.context.model)?this.context.model:[];i.splice(t,1,Object.assign({},"object"==typeof this.context.model[t]?this.context.model[t]:{},((o={})[e]=r,o))),this.context.model=i},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.map((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.splice(t,1)}}},W=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{staticClass:"formulate-input-grouping",attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,o){return r("FormulateRepeatableProvider",{key:o,ref:"provider-"+o,refInFor:!0,attrs:{index:o,"set-field-value":function(e,r){return t.setFieldValue(o,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};W._withStripped=!0;var Y=V({render:W,staticRenderFns:[]},void 0,T,void 0,!1,void 0,!1,void 0,void 0,void 0),z={props:{context:{type:Object,required:!0}}},K=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:"formulate-input-label formulate-input-label--"+this.context.labelPosition,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};K._withStripped=!0;var Z=V({render:K,staticRenderFns:[]},void 0,z,void 0,!1,void 0,!1,void 0,void 0,void 0),J={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},X=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"formulate-input-group-add-more"},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};X._withStripped=!0;var Q=V({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),tt={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},et={name:"FormulateInputBox",mixins:[tt]},rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t.context.value,s=t._i(r,n);o.checked?s<0&&t.$set(t.context,"model",r.concat([n])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};rt._withStripped=!0;var ot=V({render:rt,staticRenderFns:[]},void 0,et,void 0,!1,void 0,!1,void 0,void 0,void 0),it={name:"FormulateInputText",mixins:[tt]},nt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};nt._withStripped=!0;var st=V({render:nt,staticRenderFns:[]},void 0,it,void 0,!1,void 0,!1,void 0,void 0,void 0),at={name:"FormulateFiles",props:{files:{type:s,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},lt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};lt._withStripped=!0;var ut={name:"FormulateInputFile",components:{FormulateFiles:V({render:lt,staticRenderFns:[]},void 0,at,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[tt],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof s&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof s&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},ct=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};ct._withStripped=!0;var dt=V({render:ct,staticRenderFns:[]},void 0,ut,void 0,!1,void 0,!1,void 0,void 0,void 0),pt={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},ft=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group-repeatable"},[t.context.repeatable?r("a",{staticClass:"formulate-input-group-repeatable-remove",attrs:{role:"button"},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e(),t._v(" "),t._t("default")],2)};ft._withStripped=!0;var ht=V({render:ft,staticRenderFns:[]},void 0,pt,void 0,!1,void 0,!1,void 0,void 0,void 0);function mt(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var vt={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes),o=(r.id,mt(r,["id"])),i=(e.classification,e.blurHandler,e.performValidation,e.hasValidationErrors,e.getValidationErrors,e.validationErrors,e.setErrors,e.visibleValidationErrors,e.component,e.hasLabel,e.slotComponents,e.isSubField,mt(e,["options","labelPosition","attributes","classification","blurHandler","performValidation","hasValidationErrors","getValidationErrors","validationErrors","setErrors","visibleValidationErrors","component","hasLabel","slotComponents","isSubField"]));return this.options.map((function(e){return t.groupItemContext(i,e,o)}))},canAddMore:function(){return this.context.repeatable&&this.items.length-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Vt._withStripped=!0;var Pt=V({render:Vt,staticRenderFns:[]},void 0,Ot,void 0,!1,void 0,!1,void 0,void 0,void 0),$t={name:"FormulateInputTextArea",mixins:[tt]},St=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};St._withStripped=!0;var At=V({render:St,staticRenderFns:[]},void 0,$t,void 0,!1,void 0,!1,void 0,void 0,void 0),jt={provide:function(){var t=this;return Object.assign({},F(this),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},E(this),{isGrouping:!0})},computed:Object.assign({},_()),methods:Object.assign({},w(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Ct=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,{tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Ct._withStripped=!0;var kt=V({render:Ct,staticRenderFns:[]},void 0,jt,void 0,!1,void 0,!1,void 0,void 0,void 0),Rt=function(){this.options={},this.defaults={components:{FormulateSlot:b,FormulateForm:S,FormulateHelp:H,FormulateLabel:Z,FormulateInput:L,FormulateErrors:M,FormulateAddMore:Q,FormulateGrouping:Y,FormulateInputBox:ot,FormulateInputText:st,FormulateInputFile:dt,FormulateRepeatable:ht,FormulateInputGroup:gt,FormulateInputButton:Et,FormulateInputSelect:Ft,FormulateInputSlider:Pt,FormulateInputTextArea:At,FormulateRepeatableProvider:kt},slotDefaults:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore"},library:n,rules:h,mimes:v,locale:!1,uploader:y,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[o.en],locales:{}},this.registry=new Map};return Rt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},Rt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},Rt.prototype.merge=function(t,e,o){void 0===o&&(o=!0);var i={};for(var n in t)e.hasOwnProperty(n)?r(e[n])&&r(t[n])?i[n]=this.merge(t[n],e[n],o):o&&Array.isArray(t[n])&&Array.isArray(e[n])?i[n]=t[n].concat(e[n]):i[n]=e[n]:i[n]=t[n];for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i},Rt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Rt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Rt.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotDefaults[e]},Rt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Rt.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Rt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return f(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},Rt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},Rt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Rt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Rt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:c(o.formErrors),inputErrors:o.inputErrors||{}}),o},Rt.prototype.getUploader=function(){return this.options.uploader||!1},Rt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Rt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Rt.prototype.createUpload=function(t,e){return new s(t,e,this.options)},new Rt})); -======= -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("is-url"),require("nanoid/non-secure"),require("is-plain-object"),require("@braid/vue-formulate-i18n")):"function"==typeof define&&define.amd?define(["is-url","nanoid/non-secure","is-plain-object","@braid/vue-formulate-i18n"],e):(t=t||self).Formulate=e(t.isUrl,t.nanoid,t.isPlainObject,t.VueFormulateI18n)}(this,(function(t,e,r,o){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var i=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},n=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=i("text"),r))}),{}),{range:i("slider"),textarea:i("textarea","TextArea"),checkbox:i("box"),radio:i("box"),submit:i("button"),button:i("button"),select:i("select"),file:i("file"),image:i("file")}),a=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function s(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),i=r.length;if(o.length!==i)return!1;for(var n=0;n=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},a.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},a.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},a.prototype.getFileList=function(){return this.fileList},a.prototype.getFiles=function(){return this.files},a.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var f={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof a)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof a?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(e){var r=e.value;return Promise.resolve(t(r))}},h="image/",m={csv:"text/csv",gif:h+"gif",jpg:h+"jpeg",jpeg:h+"jpeg",png:h+"png",pdf:"application/pdf",svg:h+"svg+xml"};function v(t,e,r,o){return new Promise((function(r,i){var n=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var o=performance.now()-a,i=Math.min(100,Math.round(o/n*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var y={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,hasGivenName:this.hasGivenName,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,performValidation:this.performValidation.bind(this),blurHandler:b.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:g.call(this,this.options),optionGroups:!!this.optionGroups&&s(this.optionGroups,(function(e,r){return g.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:g.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return c(this.errors).concat(c(this.error))},allErrors:function(){return this.explicitErrors.concat(c(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&this.context.model)return!0;return this.behavioralErrorVisibility}};function g(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function b(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:w.bind(this),set:F.bind(this)})}function w(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function F(t){l(t,this.internalModelProxy)||(this.internalModelProxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function _(t,e,r,o,i,n,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),o&&(d._scopeId=o),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}var E={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},formulateFormDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},internalModelProxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},y,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[u(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[u(r)]=t.validationMessages[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||l(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!l(t,e)&&(this.context.model=t)}},created:function(){this.applyInitialValue(),this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.formulateFormDeregister&&"function"==typeof this.formulateFormDeregister&&this.formulateFormDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:Object.prototype.hasOwnProperty.call(this.$options.propsData,"value")&&"box"!==t?this.value:Object.prototype.hasOwnProperty.call(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!l(this.context.model,this.internalModelProxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.internalModelProxy)},updateLocalAttributes:function(t){l(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=d(this.validation,this.$formulate.rules(this.parsedValidationRules));return this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],o=e[1],i=e[2],n=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(o));return(n=n instanceof Promise?n:Promise.resolve(n)).then((function(e){return!e&&t.getMessage(i,o)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=u(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},P=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?r("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.disableErrors?t._e():r("FormulateErrors",{attrs:{type:"input",errors:t.explicitErrors,"field-name":t.nameOrFallback,"validation-errors":t.validationErrors,"show-validation-errors":t.showValidationErrors}})],1)};P._withStripped=!0;var O=_({render:P,staticRenderFns:[]},void 0,E,void 0,!1,void 0,!1,void 0,void 0,void 0),V=function(t){this.form=t};V.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},V.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],i=function t(e){var r={};for(var o in e)e[o]instanceof a||p(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.internalFormModelProxy),n=function(e){"object"==typeof t.form.internalFormModelProxy[e]&&t.form.internalFormModelProxy[e]instanceof a&&o.push(t.form.internalFormModelProxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var s in i)n(s);Promise.all(o).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var $={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,formulateFormDeregister:this.deregister,getFormValues:this.getFormValues,observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}}},computed:{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return Object.prototype.hasOwnProperty.call(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):Object.prototype.hasOwnProperty.call(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):{}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=c(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=c(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.hasOwnProperty(r)||l(t[r],this.internalFormModelProxy[r])||l(t[r],this.registry[r].internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry[r].context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:{applyInitialValues:function(){this.hasInitialValue&&(this.internalFormModelProxy=this.initialValues)},applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):Object.prototype.hasOwnProperty.call(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},setFieldValue:function(t,e){var r;Object.assign(this.internalFormModelProxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},getUniqueRegistryName:function(t,e){return void 0===e&&(e=0),Object.prototype.hasOwnProperty.call(this.registry,t+(e||""))?this.getUniqueRegistryName(t,e+1):t+(e||"")},register:function(t,e){if(Object.prototype.hasOwnProperty.call(this.registry,t))return!1;this.registry[t]=e;var r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),o=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!r&&this.hasInitialValue&&this.initialValues[t]?e.context.model=this.initialValues[t]:!r&&!o||l(e.internalModelProxy,this.initialValues[t])||this.setFieldValue(t,e.internalModelProxy)},deregister:function(t){delete this.registry[t]},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new V(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},j=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{type:"form",errors:t.mergedFormErrors,"prevent-registration":!0}}),t._v(" "),t._t("default")],2)};j._withStripped=!0;var A=_({render:j,staticRenderFns:[]},void 0,$,void 0,!1,void 0,!1,void 0,void 0,void 0),N={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{showValidationErrors:{type:Boolean,default:!1},errors:{type:[Array,Boolean],default:!1},validationErrors:{type:[Array],default:function(){return[]}},type:{type:String,default:"form"},preventRegistration:{type:Boolean,default:!1},fieldName:{type:[String,Boolean],default:!1}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{mergedErrors:function(){return c(this.errors).concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.showValidationErrors?this.validationErrors:[])))}},created:function(){this.preventRegistration||"function"!=typeof this.observeErrors||"form"!==this.type&&!this.fieldName||this.observeErrors({callback:this.boundSetErrors,type:this.type,field:this.fieldName})},destroyed:function(){this.preventRegistration||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=c(t)}}},S=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};S._withStripped=!0;var D=_({render:S,staticRenderFns:[]},void 0,N,void 0,!1,void 0,!1,void 0,void 0,void 0);function k(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var C={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subComponent:function(){return"FormulateInput"},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes),o=(r.id,k(r,["id"])),i=(e.classification,e.blurHandler,e.performValidation,e.hasValidationErrors,e.component,e.hasLabel,k(e,["options","labelPosition","attributes","classification","blurHandler","performValidation","hasValidationErrors","component","hasLabel"]));return this.options.map((function(e){return t.groupItemContext(i,e,o)}))}},methods:{groupItemContext:function(t,e,r){return Object.assign({},t,e,r,{},t.hasGivenName?{}:{name:!0})}}},U=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return r(t.subComponent,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",attrs:{"disable-errors":!0},on:{blur:t.context.blurHandler},model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};U._withStripped=!0;var I=_({render:U,staticRenderFns:[]},void 0,C,void 0,!1,void 0,!1,void 0,void 0,void 0),B={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},R={name:"FormulateInputBox",mixins:[B]},L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t.context.value,a=t._i(r,n);o.checked?a<0&&t.$set(t.context,"model",r.concat([n])):a>-1&&t.$set(t.context,"model",r.slice(0,a).concat(r.slice(a+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};L._withStripped=!0;var M=_({render:L,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0),H={name:"FormulateInputText",mixins:[B]},T=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};T._withStripped=!0;var G=_({render:T,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),q={name:"FormulateFiles",props:{files:{type:a,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},W=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};W._withStripped=!0;var Y={name:"FormulateInputFile",components:{FormulateFiles:_({render:W,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[B],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof a&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof a&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},z=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};z._withStripped=!0;var K=_({render:z,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),Z={name:"FormulateInputButton",mixins:[B]},J=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[r("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};J._withStripped=!0;var X=_({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateInputSelect",mixins:[B],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},tt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?r:r[0])}}},"select",t.attributes,!1),[t.context.placeholder?r("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,o){return r("optgroup",{key:o,attrs:{label:o}},t._l(e,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};tt._withStripped=!0;var et=_({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),rt={name:"FormulateInputSlider",mixins:[B]},ot=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};ot._withStripped=!0;var it=_({render:ot,staticRenderFns:[]},void 0,rt,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputTextArea",mixins:[B]},at=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};at._withStripped=!0;var st=_({render:at,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),lt=function(){this.options={},this.defaults={components:{FormulateForm:A,FormulateInput:O,FormulateErrors:D,FormulateInputBox:M,FormulateInputText:G,FormulateInputFile:K,FormulateInputGroup:I,FormulateInputButton:X,FormulateInputSelect:et,FormulateInputSlider:it,FormulateInputTextArea:st},library:n,rules:f,mimes:m,locale:!1,uploader:v,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[o.en],locales:{},idPrefix:"formulate-"},this.registry=new Map,this.idRegistry={}};return lt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},lt.prototype.nextId=function(t){var e=t.$route&&t.$route.path||!1?t.$route.path.replace(/[\/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},lt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},lt.prototype.merge=function(t,e,o){void 0===o&&(o=!0);var i={};for(var n in t)e.hasOwnProperty(n)?r(e[n])&&r(t[n])?i[n]=this.merge(t[n],e[n],o):o&&Array.isArray(t[n])&&Array.isArray(e[n])?i[n]=t[n].concat(e[n]):i[n]=e[n]:i[n]=t[n];for(var a in e)i.hasOwnProperty(a)||(i[a]=e[a]);return i},lt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},lt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},lt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},lt.prototype.i18n=function(t){return!(!t.$i18n||!t.$i18n.locale)&&t.$i18n.locale},lt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return Object.prototype.hasOwnProperty.call(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},lt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},lt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},lt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},lt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:c(o.formErrors),inputErrors:o.inputErrors||{}}),o},lt.prototype.getUploader=function(){return this.options.uploader||!1},lt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},lt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},lt.prototype.createUpload=function(t,e){return new a(t,e,this.options)},new lt})); ->>>>>>> 63d3ca71484a9587faef39d0fb462ecf229cc442 +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("is-url"),require("nanoid/non-secure"),require("is-plain-object"),require("@braid/vue-formulate-i18n")):"function"==typeof define&&define.amd?define(["is-url","nanoid/non-secure","is-plain-object","@braid/vue-formulate-i18n"],e):(t=t||self).Formulate=e(t.isUrl,t.nanoid,t.isPlainObject,t.VueFormulateI18n)}(this,(function(t,e,r,o){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var i=function(t,e){return{classification:t,component:"FormulateInput"+(e||t[0].toUpperCase()+t.substr(1))}},n=Object.assign({},["text","email","number","color","date","hidden","month","password","search","tel","time","url","week","datetime-local"].reduce((function(t,e){var r;return Object.assign({},t,((r={})[e]=i("text"),r))}),{}),{range:i("slider"),textarea:i("textarea","TextArea"),checkbox:i("box"),radio:i("box"),submit:i("button"),button:i("button"),select:i("select"),file:i("file"),image:i("file"),group:i("group")}),s=function(t,e,r){void 0===r&&(r={}),this.input=t,this.fileList=t.files,this.files=[],this.options=Object.assign({},{mimes:{}},r),this.results=!1,this.context=e,Array.isArray(this.fileList)?this.rehydrateFileList(this.fileList):this.addFileList(this.fileList)};function a(t,e){var r={};for(var o in t)r[o]=e(o,t[o]);return r}function l(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),o=Object.keys(e),i=r.length;if(o.length!==i)return!1;for(var n=0;n=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(r){t.results=r,e(r)})).catch((function(t){throw new Error(t)}))}))},s.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),this.context.performValidation(),window&&this.fileList instanceof FileList){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},s.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},s.prototype.getFileList=function(){return this.fileList},s.prototype.getFiles=function(){return this.files},s.prototype.toString=function(){var t=this.files.length?this.files.length+" files":"empty";return this.results?JSON.stringify(this.results,null," "):"FileUpload("+t+")"};var m={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&i>o)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var o={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},i=o.hasOwnProperty(e)?e:"default";return Promise.resolve(o[i].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var o=Date.parse(e||new Date),i=Date.parse(r);return Promise.resolve(!isNaN(i)&&ie&&ie&&i.length()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},endsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.endsWith(t)})):"string"==typeof e&&0===r.length)},in:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(!!r.find((function(t){return"string"==typeof t&&"/"===t.substr(0,1)&&"/"===t.substr(-1)&&(t=new RegExp(t.substr(1,t.length-2))),t instanceof RegExp?t.test(e):t===e})))},mime:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(function(){if(e instanceof s)for(var t=e.getFiles(),o=0;o=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))>=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length>=e)},max:function(t,e,r){var o=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(o)?(e=isNaN(e)?e:Number(e),o.length<=e):!isNaN(o)&&"length"!==r||"value"===r?(o=isNaN(o)?o:Number(o))<=e:("string"==typeof o||"length"===r)&&(o=isNaN(o)?o:o.toString()).length<=e)},not:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?l(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e))||(Array.isArray(r)?!!r.length:r instanceof s?r.getFiles().length>0:"string"==typeof r?!!r:"object"!=typeof r||!!r&&!!Object.keys(r).length))},startsWith:function(t){for(var e=t.value,r=[],o=arguments.length-1;o-- >0;)r[o]=arguments[o+1];return Promise.resolve("string"==typeof e&&r.length?void 0!==r.find((function(t){return e.startsWith(t)})):"string"==typeof e&&0===r.length)},url:function(e){var r=e.value;return Promise.resolve(t(r))},bail:function(){return Promise.resolve(!0)}},v="image/",y={csv:"text/csv",gif:v+"gif",jpg:v+"jpeg",jpeg:v+"jpeg",png:v+"png",pdf:"application/pdf",svg:v+"svg+xml"};function g(t,e,r,o){return new Promise((function(r,i){var n=(o.fauxUploaderDuration||2e3)*(.5+Math.random()),s=performance.now(),a=function(){return setTimeout((function(){var o=performance.now()-s,i=Math.min(100,Math.round(o/n*100));if(e(i),i>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});a()}),20)};a()}))}function b(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var x={inheritAttrs:!1,functional:!0,render:function(t,e){for(var r=e.props,o=e.data,i=e.parent,n=e.children,s=i,a=(r.name,r.forceWrap),l=r.context,u=b(r,["name","forceWrap","context"]);s&&"FormulateInput"!==s.$options.name;)s=s.$parent;if(!s)return null;if(s.$scopedSlots&&s.$scopedSlots[r.name])return s.$scopedSlots[r.name](Object.assign({},l,u));if(Array.isArray(n)&&(n.length>1||a&&n.length>0)){var c=o.attrs,d=(c.name,c.context,b(c,["name","context"]));return t("div",Object.assign({},o,{attrs:d}),n)}return Array.isArray(n)&&1===n.length?n[0]:null}};var E=function(t){this.registry=new Map,this.ctx=t};function w(t){return new E(t).dataProps()}function _(){return{hasInitialValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue||this.values&&"object"==typeof this.values||this.isGrouping&&"object"==typeof this.context.model[this.index]},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},initialValues:function(){return h(this.$options.propsData,"formulateValue")&&"object"==typeof this.formulateValue?Object.assign({},this.formulateValue):h(this.$options.propsData,"values")&&"object"==typeof this.values?Object.assign({},this.values):this.isGrouping&&"object"==typeof this.context.model[this.index]?this.context.model[this.index]:{}}}}function F(t){void 0===t&&(t=[]);var e={applyInitialValues:function(){this.hasInitialValue&&(this.proxy=this.initialValues)},setFieldValue:function(t,e){var r;Object.assign(this.proxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.proxy))},getFormValues:function(){return this.proxy},hasValidationErrors:function(){return Promise.all(this.registry.reduce((function(t,e,r){return t.push(e.performValidation()&&e.getValidationErrors()),t}),[])).then((function(t){return t.some((function(t){return t.hasErrors}))}))},showErrors:function(){this.childrenShouldShowErrors=!0,this.registry.map((function(t){t.formShouldShowErrors=!0}))}};return Object.keys(e).reduce((function(r,o){var i;return t.includes(o)?r:Object.assign({},r,((i={})[o]=e[o],i))}),{})}function O(t){return{formulateSetter:t.setFieldValue,formulateRegister:t.register,formulateDeregister:t.deregister,getFormValues:t.getFormValues}}E.prototype.add=function(t,e){return this.registry.set(t,e),this},E.prototype.remove=function(t){this.registry.delete(t);var e=this.ctx.proxy,r=(e[t],function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}(e,[String(t)]));return this.ctx.proxy=r,this},E.prototype.has=function(t){return this.registry.has(t)},E.prototype.get=function(t){return this.registry.get(t)},E.prototype.map=function(t){var e={};return this.registry.forEach((function(r,o){var i;return Object.assign(e,((i={})[o]=t(r,o),i))})),e},E.prototype.keys=function(){return Array.from(this.registry.keys())},E.prototype.register=function(t,e){if(this.registry.has(t))return!1;this.registry.set(t,e);var r=h(e.$options.propsData,"formulateValue"),o=h(e.$options.propsData,"value");!r&&this.ctx.hasInitialValue&&this.ctx.initialValues[t]?e.context.model=this.ctx.initialValues[t]:!r&&!o||l(e.proxy,this.ctx.initialValues[t])||this.ctx.setFieldValue(t,e.proxy),this.childrenShouldShowErrors&&(e.formShouldShowErrors=!0)},E.prototype.reduce=function(t,e){return this.registry.forEach((function(r,o){e=t(e,r,o)})),e},E.prototype.dataProps=function(){var t=this;return{proxy:{},registry:this,register:this.register.bind(this),deregister:function(e){return t.remove(e)},childrenShouldShowErrors:!1}};var V=function(t){this.form=t};function P(t,e,r,o,i,n,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,i&&(d.functional=!0)),o&&(d._scopeId=o),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(n)},d._ssrRegister=c):e&&(c=s?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return r}V.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},V.prototype.values=function(){var t=this;return new Promise((function(e,r){var o=[],i=function t(e){if("object"!=typeof e)return e;var r=Array.isArray(e)?[]:{};for(var o in e)e[o]instanceof s||f(e[o])?r[o]=e[o]:r[o]=t(e[o]);return r}(t.form.proxy),n=function(e){"object"==typeof t.form.proxy[e]&&t.form.proxy[e]instanceof s&&o.push(t.form.proxy[e].upload().then((function(t){var r;return Object.assign(i,((r={})[e]=t,r))})))};for(var a in i)n(a);Promise.all(o).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var A={provide:function(){return Object.assign({},O(this),{observeErrors:this.addErrorObserver,removeErrorObserver:this.removeErrorObserver,formulateFieldValidation:this.formulateFieldValidation})},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}},values:{type:[Object,Boolean],default:!1},errors:{type:[Object,Boolean],default:!1},formErrors:{type:Array,default:function(){return[]}}},data:function(){return Object.assign({},w(this),{formShouldShowErrors:!1,errorObservers:[],namedErrors:[],namedFieldErrors:{}})},computed:Object.assign({},_(),{formContext:function(){return{errors:this.mergedFormErrors}},classes:function(){var t={"formulate-form":!0};return this.name&&(t["formulate-form--"+this.name]=!0),t},mergedFormErrors:function(){return this.formErrors.concat(this.namedErrors)},mergedFieldErrors:function(){var t={};if(this.errors)for(var e in this.errors)t[e]=c(this.errors[e]);for(var r in this.namedFieldErrors)t[r]=c(this.namedFieldErrors[r]);return t},hasFormErrorObservers:function(){return!!this.errorObservers.filter((function(t){return"form"===t.type})).length}}),watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.has(r)||l(t[r],this.proxy[r])||l(t[r],this.registry.get(r).proxy[r])||(this.setFieldValue(r,t[r]),this.registry.get(r).context.model=t[r])},deep:!0},mergedFormErrors:function(t){this.errorObservers.filter((function(t){return"form"===t.type})).forEach((function(e){return e.callback(t)}))},mergedFieldErrors:{handler:function(t){this.errorObservers.filter((function(t){return"input"===t.type})).forEach((function(e){return e.callback(t[e.field]||[])}))},immediate:!0}},created:function(){this.$formulate.register(this),this.applyInitialValues()},destroyed:function(){this.$formulate.deregister(this)},methods:Object.assign({},F(),{applyErrors:function(t){var e=t.formErrors,r=t.inputErrors;this.namedErrors=e,this.namedFieldErrors=r},addErrorObserver:function(t){this.errorObservers.find((function(e){return t.callback===e.callback}))||(this.errorObservers.push(t),"form"===t.type?t.callback(this.mergedFormErrors):h(this.mergedFieldErrors,t.field)&&t.callback(this.mergedFieldErrors[t.field]))},removeErrorObserver:function(t){this.errorObservers=this.errorObservers.filter((function(e){return e.callback!==t}))},registerErrorComponent:function(t){this.errorComponents.includes(t)||this.errorComponents.push(t)},formSubmitted:function(){var t=this;this.showErrors();var e=new V(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},formulateFieldValidation:function(t){this.$emit("validation",t)}})},$=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{class:t.classes,on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t.hasFormErrorObservers?t._e():r("FormulateErrors",{attrs:{context:t.formContext}}),t._v(" "),t._t("default")],2)};$._withStripped=!0;var S=P({render:$,staticRenderFns:[]},void 0,A,void 0,!1,void 0,!1,void 0,void 0,void 0),j={context:function(){return k.call(this,Object.assign({},{addLabel:this.logicalAddLabel,attributes:this.elementAttributes,blurHandler:R.bind(this),classification:this.classification,component:this.component,disableErrors:this.disableErrors,errors:this.explicitErrors,formShouldShowErrors:this.formShouldShowErrors,getValidationErrors:this.getValidationErrors.bind(this),hasGivenName:this.hasGivenName,hasLabel:this.label&&"button"!==this.classification,hasValidationErrors:this.hasValidationErrors.bind(this),help:this.help,helpPosition:this.logicalHelpPosition,id:this.id||this.defaultId,imageBehavior:this.imageBehavior,label:this.label,labelPosition:this.logicalLabelPosition,limit:this.limit,name:this.nameOrFallback,performValidation:this.performValidation.bind(this),preventWindowDrops:this.preventWindowDrops,repeatable:this.repeatable,setErrors:this.setErrors.bind(this),showValidationErrors:this.showValidationErrors,slotComponents:this.slotComponents,type:this.type,uploadBehavior:this.uploadBehavior,uploadUrl:this.mergedUploadUrl,uploader:this.uploader||this.$formulate.getUploader(),validationErrors:this.validationErrors,value:this.value,visibleValidationErrors:this.visibleValidationErrors,isSubField:this.isSubField},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},hasGivenName:function(){return"boolean"!=typeof this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:C.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,r){return C.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:C.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;this.hasGivenName&&(t.name=this.name);return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},logicalHelpPosition:function(){if(this.helpPosition)return this.helpPosition;switch(this.classification){case"group":return"before";default:return"after"}},mergedUploadUrl:function(){return this.uploadUrl||this.$formulate.getUploadUrl()},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type},explicitErrors:function(){return c(this.errors).concat(this.localErrors).concat(c(this.error))},allErrors:function(){return this.explicitErrors.concat(c(this.validationErrors))},hasErrors:function(){return!!this.allErrors.length},hasVisibleErrors:function(){return this.validationErrors&&this.showValidationErrors||!!this.explicitErrors.length},showValidationErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;if("file"===this.classification&&"live"===this.uploadBehavior&&N.call(this))return!0;return this.behavioralErrorVisibility},visibleValidationErrors:function(){return this.showValidationErrors&&this.validationErrors.length?this.validationErrors:[]},slotComponents:function(){return{label:this.$formulate.slotComponent(this.type,"label"),help:this.$formulate.slotComponent(this.type,"help"),errors:this.$formulate.slotComponent(this.type,"errors"),repeatable:this.$formulate.slotComponent(this.type,"repeatable"),addMore:this.$formulate.slotComponent(this.type,"addMore")}},logicalAddLabel:function(){if("boolean"==typeof this.addLabel)return"+ "+(this.label||this.name||"Add");return this.addLabel}};function C(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return t}function R(){this.$emit("blur"),"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function k(t){return Object.defineProperty(t,"model",{get:N.bind(this),set:I.bind(this)})}function N(){var t=this.isVmodeled?"formulateValue":"proxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function I(t){l(t,this.proxy)||(this.proxy=t),this.$emit("input",t),this.context.name&&"function"==typeof this.formulateSetter&&this.formulateSetter(this.context.name,t)}var D={name:"FormulateInput",inheritAttrs:!1,provide:function(){return{formulateRegisterRule:this.registerRule,formulateRemoveRule:this.removeRule}},inject:{formulateSetter:{default:void 0},formulateFieldValidation:{default:function(){return function(){return{}}}},formulateRegister:{default:void 0},formulateDeregister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}},observeErrors:{default:void 0},removeErrorObserver:{default:void 0},isSubField:{default:function(){return function(){return!1}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},limit:{type:Number,default:1/0},help:{type:[String,Boolean],default:!1},helpPosition:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},repeatable:{type:Boolean,default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}},checked:{type:[String,Boolean],default:!1},disableErrors:{type:Boolean,default:!1},addLabel:{type:[Boolean,String],default:!1}},data:function(){return{defaultId:this.$formulate.nextId(this),localAttributes:{},localErrors:[],proxy:this.getInitialValue(),behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve(),ruleRegistry:[],messageRegistry:{}}},computed:Object.assign({},j,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)},parsedValidationRules:function(){var t=this,e={};return Object.keys(this.validationRules).forEach((function(r){e[u(r)]=t.validationRules[r]})),e},messages:function(){var t=this,e={};return Object.keys(this.validationMessages).forEach((function(r){e[u(r)]=t.validationMessages[r]})),Object.keys(this.messageRegistry).forEach((function(r){e[u(r)]=t.messageRegistry[r]})),e}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},proxy:function(t,e){this.performValidation(),this.isVmodeled||l(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!l(t,e)&&(this.context.model=t)},showValidationErrors:{handler:function(t){this.$emit("error-visibility",t)},immediate:!0}},created:function(){this.applyInitialValue(),this.formulateRegister&&"function"==typeof this.formulateRegister&&this.formulateRegister(this.nameOrFallback,this),this.disableErrors||"function"!=typeof this.observeErrors||this.observeErrors({callback:this.setErrors,type:"input",field:this.nameOrFallback}),this.updateLocalAttributes(this.$attrs),this.performValidation()},beforeDestroy:function(){this.disableErrors||"function"!=typeof this.removeErrorObserver||this.removeErrorObserver(this.setErrors),"function"==typeof this.formulateDeregister&&this.formulateDeregister(this.nameOrFallback)},methods:{getInitialValue:function(){var t=this.$formulate.classify(this.type);return"box"===(t="box"===t&&this.options?"group":t)&&this.checked?this.value||!0:h(this.$options.propsData,"value")&&"box"!==t?this.value:h(this.$options.propsData,"formulateValue")?this.formulateValue:""},applyInitialValue:function(){!l(this.context.model,this.proxy)&&Object.prototype.hasOwnProperty(this.$options.propsData,"options")&&"box"===this.classification&&(this.context.model=this.proxy)},updateLocalAttributes:function(t){l(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=d(this.validation,this.$formulate.rules(this.parsedValidationRules));return e=this.ruleRegistry.length?this.ruleRegistry.concat(e):e,this.pendingValidation=this.runRules(e).then((function(e){return t.didValidate(e)})),this.pendingValidation},runRules:function(t){var e=this,r=function(t){var r=t[0],o=t[1],i=t[2],n=(t[3],r.apply(void 0,[{value:e.context.model,getFormValues:e.getFormValues.bind(e),name:e.context.name}].concat(o)));return(n=n instanceof Promise?n:Promise.resolve(n)).then((function(t){return!t&&e.getMessage(i,o)}))};return new Promise((function(e){var o=function(t,i){void 0===i&&(i=[]);var n=t.shift();Array.isArray(n)&&n.length?Promise.all(n.map(r)).then((function(t){return t.filter((function(t){return!!t}))})).then((function(r){return(r=Array.isArray(r)?r:[]).length&&n.bail||!t.length?e(i.concat(r)):o(t,i.concat(r))})):e([])};o(function(t){var e=[],r=t.findIndex((function(t){return"bail"===t[2].toLowerCase()}));if(r>=0){var o=t.splice(0,r+1).slice(0,-1);o.length&&e.push(o),t.map((function(t){return e.push(Object.defineProperty([t],"bail",{value:!0}))}))}else e.push(t);return e.reduce((function(t,e){var r=function(t,e){if(void 0===e&&(e=!1),t.length<2)return Object.defineProperty([t],"bail",{value:e});var o=[],i=t.findIndex((function(t){return"^"===t[3]}));if(i>=0){var n=t.splice(0,i);n.length&&o.push.apply(o,r(n,e)),o.push(Object.defineProperty([t.shift()],"bail",{value:!0})),t.length&&o.push.apply(o,r(t,e))}else o.push(t);return o};return t.concat(r(e))}),[])}(t))}))},didValidate:function(t){var e=!l(t,this.validationErrors);if(this.validationErrors=t,e){var r=this.getErrorObject();this.$emit("validation",r),this.formulateFieldValidation&&"function"==typeof this.formulateFieldValidation&&this.formulateFieldValidation(r)}},getMessage:function(t,e){return this.getMessageFunc(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getMessageFunc:function(t){var e=this;if(t=u(t),this.messages&&void 0!==this.messages[t])switch(typeof this.messages[t]){case"function":return this.messages[t];case"string":case"boolean":return function(){return e.messages[t]}}return function(r){return e.$formulate.validationMessage(t,r,e)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))},getValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){return t.pendingValidation.then((function(){return e(t.getErrorObject())}))}))}))},getErrorObject:function(){return{name:this.context.nameOrFallback||this.context.name,errors:this.validationErrors.filter((function(t){return"string"==typeof t})),hasErrors:!!this.validationErrors.length}},setErrors:function(t){this.localErrors=c(t)},registerRule:function(t,e,r,o){void 0===o&&(o=null),this.ruleRegistry.some((function(t){return t[2]===r}))||(this.ruleRegistry.push([t,e,r]),null!==o&&(this.messageRegistry[r]=o))},removeRule:function(t){var e=this.ruleRegistry.findIndex((function(e){return e[2]===t}));e>=0&&(this.ruleRegistry.splice(e,1),delete this.messageRegistry[t])}}},L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasVisibleErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},["before"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),"before"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context},on:{click:function(e){return t.$emit("click",e)}}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),"after"===t.context.labelPosition?t._t("label",[t.context.hasLabel?r(t.context.slotComponents.label,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e()],2),t._v(" "),"after"===t.context.helpPosition?t._t("help",[t.context.help?r(t.context.slotComponents.help,{tag:"component",attrs:{context:t.context}}):t._e()],null,t.context):t._e(),t._v(" "),t._t("errors",[t.context.disableErrors?t._e():r(t.context.slotComponents.errors,{tag:"component",attrs:{type:"FormulateErrors"===t.context.slotComponents.errors&&"input",context:t.context}})],null,t.context)],2)};L._withStripped=!0;var U=P({render:L,staticRenderFns:[]},void 0,D,void 0,!1,void 0,!1,void 0,void 0,void 0),B={inject:{observeErrors:{default:!1},removeErrorObserver:{default:!1}},props:{context:{type:Object,default:function(){return{}}},type:{type:String,default:"form"}},data:function(){return{boundSetErrors:this.setErrors.bind(this),localErrors:[]}},computed:{visibleValidationErrors:function(){return Array.isArray(this.context.visibleValidationErrors)?this.context.visibleValidationErrors:[]},errors:function(){return Array.isArray(this.context.errors)?this.context.errors:[]},mergedErrors:function(){return this.errors.concat(this.localErrors)},visibleErrors:function(){return Array.from(new Set(this.mergedErrors.concat(this.visibleValidationErrors))).filter((function(t){return"string"==typeof t}))}},created:function(){"form"!==this.type||"function"!=typeof this.observeErrors||Array.isArray(this.context.errors)||this.observeErrors({callback:this.boundSetErrors,type:this.type})},destroyed:function(){"form"!==this.type||"function"!=typeof this.removeErrorObserver||Array.isArray(this.context.errors)||this.removeErrorObserver(this.boundSetErrors)},methods:{setErrors:function(t){this.localErrors=c(t)}}},M=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.visibleErrors.length?r("ul",{class:"formulate-"+t.type+"-errors"},t._l(t.visibleErrors,(function(e){return r("li",{key:e,class:"formulate-"+t.type+"-error",domProps:{textContent:t._s(e)}})})),0):t._e()};M._withStripped=!0;var G=P({render:M,staticRenderFns:[]},void 0,B,void 0,!1,void 0,!1,void 0,void 0,void 0),q={props:{context:{type:Object,required:!0}}},H=function(){var t=this.$createElement,e=this._self._c||t;return this.context.help?e("div",{class:"formulate-input-help formulate-input-help--"+this.context.helpPosition,domProps:{textContent:this._s(this.context.help)}}):this._e()};H._withStripped=!0;var T=P({render:H,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateGrouping",props:{context:{type:Object,required:!0}},provide:function(){return{isSubField:function(){return!0}}},inject:["formulateRegisterRule","formulateRemoveRule"],computed:{items:function(){return Array.isArray(this.context.model)&&(this.context.repeatable||0!==this.context.model.length)?this.context.model:[{}]},providers:function(){var t=this;return this.items.map((function(e,r){return!!Array.isArray(t.$refs["provider-"+r])&&t.$refs["provider-"+r][0]}))},formShouldShowErrors:function(){return this.context.formShouldShowErrors}},watch:{providers:function(){this.formShouldShowErrors&&this.showErrors()},formShouldShowErrors:function(t){t&&this.showErrors()}},created:function(){this.formulateRegisterRule(this.validateGroup.bind(this),[],"formulateGrouping",!0)},destroyed:function(){this.formulateRemoveRule("formulateGrouping")},methods:{setFieldValue:function(t,e,r){var o,i=Array.isArray(this.context.model)?this.context.model:[];i.splice(t,1,Object.assign({},"object"==typeof this.context.model[t]?this.context.model[t]:{},((o={})[e]=r,o))),this.context.model=i},validateGroup:function(){return Promise.all(this.providers.reduce((function(t,e){return e&&"function"==typeof e.hasValidationErrors&&t.push(e.hasValidationErrors()),t}),[])).then((function(t){return!t.some((function(t){return!!t}))}))},showErrors:function(){this.providers.map((function(t){return t&&"function"==typeof t.showErrors&&t.showErrors()}))},removeItem:function(t){Array.isArray(this.context.model)&&this.context.model.splice(t,1)}}},Y=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{staticClass:"formulate-input-grouping",attrs:{name:"grouping",context:t.context,"force-wrap":t.context.repeatable}},t._l(t.items,(function(e,o){return r("FormulateRepeatableProvider",{key:o,ref:"provider-"+o,refInFor:!0,attrs:{index:o,"set-field-value":function(e,r){return t.setFieldValue(o,e,r)},context:t.context},on:{remove:t.removeItem}},[t._t("default")],2)})),1)};Y._withStripped=!0;var z=P({render:Y,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),K={props:{context:{type:Object,required:!0}}},Z=function(){var t=this.$createElement;return(this._self._c||t)("label",{class:"formulate-input-label formulate-input-label--"+this.context.labelPosition,attrs:{for:this.context.id},domProps:{textContent:this._s(this.context.label)}})};Z._withStripped=!0;var J=P({render:Z,staticRenderFns:[]},void 0,K,void 0,!1,void 0,!1,void 0,void 0,void 0),X={props:{context:{type:Object,required:!0},addMore:{type:Function,required:!0}}},Q=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"formulate-input-group-add-more"},[e("FormulateInput",{attrs:{type:"button",label:this.context.addLabel,"data-minor":"","data-ghost":""},on:{click:this.addMore}})],1)};Q._withStripped=!0;var tt=P({render:Q,staticRenderFns:[]},void 0,X,void 0,!1,void 0,!1,void 0,void 0,void 0),et={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},rt={name:"FormulateInputBox",mixins:[et]},ot=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t.context.value,s=t._i(r,n);o.checked?s<0&&t.$set(t.context,"model",r.concat([n])):s>-1&&t.$set(t.context,"model",r.slice(0,s).concat(r.slice(s+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};ot._withStripped=!0;var it=P({render:ot,staticRenderFns:[]},void 0,rt,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputText",mixins:[et]},st=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};st._withStripped=!0;var at=P({render:st,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),lt={name:"FormulateFiles",props:{files:{type:s,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},ut=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":!(!t.imagePreview||!e.previewData)}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formulate-file-name",attrs:{title:e.name},domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};ut._withStripped=!0;var ct={name:"FormulateInputFile",components:{FormulateFiles:P({render:ut,staticRenderFns:[]},void 0,lt,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[et],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof s&&this.context.model.files.length)}},created:function(){Array.isArray(this.context.model)&&"string"==typeof this.context.model[0][this.$formulate.getFileUrlKey()]&&(this.context.model=this.$formulate.createUpload({files:this.context.model},this.context))},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){var t=this;this.isOver=!1;var e=this.$refs.file;e.files.length&&(this.context.model=this.$formulate.createUpload(e,this.context),this.$nextTick((function(){return t.attemptImmediateUpload()})))},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof s&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},dt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};dt._withStripped=!0;var pt=P({render:dt,staticRenderFns:[]},void 0,ct,void 0,!1,void 0,!1,void 0,void 0,void 0),ft={props:{context:{type:Object,required:!0},removeItem:{type:Function,required:!0},index:{type:Number,required:!0}}},ht=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group-repeatable"},[t.context.repeatable?r("a",{staticClass:"formulate-input-group-repeatable-remove",attrs:{role:"button"},on:{click:function(e){return e.preventDefault(),t.removeItem(e)},keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.removeItem(e)}}}):t._e(),t._v(" "),t._t("default")],2)};ht._withStripped=!0;var mt=P({render:ht,staticRenderFns:[]},void 0,ft,void 0,!1,void 0,!1,void 0,void 0,void 0);function vt(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}var yt={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},subType:function(){return"group"===this.context.type?"grouping":"inputs"},optionsWithContext:function(){var t=this,e=this.context,r=e.attributes,o=(r.id,vt(r,["id"])),i=(e.blurHandler,e.classification,e.component,e.getValidationErrors,e.hasLabel,e.hasValidationErrors,e.isSubField,e.labelPosition,e.options,e.performValidation,e.setErrors,e.slotComponents,e.validationErrors,e.visibleValidationErrors,vt(e,["attributes","blurHandler","classification","component","getValidationErrors","hasLabel","hasValidationErrors","isSubField","labelPosition","options","performValidation","setErrors","slotComponents","validationErrors","visibleValidationErrors"]));return this.options.map((function(e){return t.groupItemContext(i,e,o)}))},canAddMore:function(){return this.context.repeatable&&this.items.length-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,o=e.target,i=!!o.checked;if(Array.isArray(r)){var n=t._i(r,null);o.checked?n<0&&t.$set(t.context,"model",r.concat([null])):n>-1&&t.$set(t.context,"model",r.slice(0,n).concat(r.slice(n+1)))}else t.$set(t.context,"model",i)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Pt._withStripped=!0;var At=P({render:Pt,staticRenderFns:[]},void 0,Vt,void 0,!1,void 0,!1,void 0,void 0,void 0),$t={name:"FormulateInputTextArea",mixins:[et]},St=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};St._withStripped=!0;var jt=P({render:St,staticRenderFns:[]},void 0,$t,void 0,!1,void 0,!1,void 0,void 0,void 0),Ct={provide:function(){var t=this;return Object.assign({},O(this),{formulateSetter:function(e,r){return t.setFieldValue(e,r)}})},props:{index:{type:Number,required:!0},context:{type:Object,required:!0},setFieldValue:{type:Function,required:!0}},data:function(){return Object.assign({},w(this),{isGrouping:!0})},computed:Object.assign({},_()),methods:Object.assign({},F(["setFieldValue"]),{removeItem:function(){this.$emit("remove",this.index)}})},Rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("FormulateSlot",{attrs:{name:"repeatable",context:t.context,index:t.index,"remove-item":t.removeItem}},[r(t.context.slotComponents.repeatable,{tag:"component",attrs:{context:t.context,index:t.index,"remove-item":t.removeItem}},[r("FormulateSlot",{attrs:{context:t.context,index:t.index,name:"default"}})],1)],1)};Rt._withStripped=!0;var kt=P({render:Rt,staticRenderFns:[]},void 0,Ct,void 0,!1,void 0,!1,void 0,void 0,void 0),Nt=function(){this.options={},this.defaults={components:{FormulateSlot:x,FormulateForm:S,FormulateHelp:T,FormulateLabel:J,FormulateInput:U,FormulateErrors:G,FormulateAddMore:tt,FormulateGrouping:z,FormulateInputBox:it,FormulateInputText:at,FormulateInputFile:pt,FormulateRepeatable:mt,FormulateInputGroup:bt,FormulateInputButton:wt,FormulateInputSelect:Ot,FormulateInputSlider:At,FormulateInputTextArea:jt,FormulateRepeatableProvider:kt},slotComponents:{label:"FormulateLabel",help:"FormulateHelp",errors:"FormulateErrors",repeatable:"FormulateRepeatable",addMore:"FormulateAddMore"},library:n,rules:m,mimes:y,locale:!1,uploader:g,uploadUrl:!1,fileUrlKey:"url",uploadJustCompleteDuration:1e3,errorHandler:function(t){return t},plugins:[o.en],locales:{},idPrefix:"formulate-"},this.registry=new Map,this.idRegistry={}};return Nt.prototype.install=function(t,e){var r=this;t.prototype.$formulate=this,this.options=this.defaults;var o=this.defaults.plugins;for(var i in e&&Array.isArray(e.plugins)&&e.plugins.length&&(o=o.concat(e.plugins)),o.forEach((function(t){return"function"==typeof t?t(r):null})),this.extend(e||{}),this.options.components)t.component(i,this.options.components[i])},Nt.prototype.nextId=function(t){var e=t.$route&&t.$route.path||!1?t.$route.path.replace(/[\/\\.\s]/g,"-"):"global";return Object.prototype.hasOwnProperty.call(this.idRegistry,e)||(this.idRegistry[e]=0),""+this.options.idPrefix+e+"-"+ ++this.idRegistry[e]},Nt.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},Nt.prototype.merge=function(t,e,o){void 0===o&&(o=!0);var i={};for(var n in t)e.hasOwnProperty(n)?r(e[n])&&r(t[n])?i[n]=this.merge(t[n],e[n],o):o&&Array.isArray(t[n])&&Array.isArray(e[n])?i[n]=t[n].concat(e[n]):i[n]=e[n]:i[n]=t[n];for(var s in e)i.hasOwnProperty(s)||(i[s]=e[s]);return i},Nt.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},Nt.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},Nt.prototype.slotComponent=function(t,e){var r=this.options.library[t];return r.slotComponents&&r.slotComponents[e]?r.slotComponents[e]:this.options.slotComponents[e]},Nt.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},Nt.prototype.i18n=function(t){if(t.$i18n)switch(typeof t.$i18n.locale){case"string":return t.$i18n.locale;case"function":return t.$i18n.locale()}return!1},Nt.prototype.getLocale=function(t){var e=this;return this.selectedLocale||(this.selectedLocale=[this.options.locale,this.i18n(t),"en"].reduce((function(t,r){if(t)return t;if(r){var o=function(t){return t.split("-").reduce((function(t,e){return t.length&&t.unshift(t[0]+"-"+e),t.length?t:[e]}),[])}(r).find((function(t){return h(e.options.locales,t)}));o&&(t=o)}return t}),!1)),this.selectedLocale},Nt.prototype.validationMessage=function(t,e,r){var o=this.options.locales[this.getLocale(r)];return o.hasOwnProperty(t)?o[t](e):"_"===t[0]&&o.hasOwnProperty(t.substr(1))?o[t.substr(1)](e):o.hasOwnProperty("default")?o.default(e):"This field does not have a valid value"},Nt.prototype.register=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.set(t.name,t)},Nt.prototype.deregister=function(t){"FormulateForm"===t.$options.name&&t.name&&this.registry.has(t.name)&&this.registry.delete(t.name)},Nt.prototype.handle=function(t,e,r){void 0===r&&(r=!1);var o=r?t:this.options.errorHandler(t,e);return e&&this.registry.has(e)&&this.registry.get(e).applyErrors({formErrors:c(o.formErrors),inputErrors:o.inputErrors||{}}),o},Nt.prototype.getUploader=function(){return this.options.uploader||!1},Nt.prototype.getUploadUrl=function(){return this.options.uploadUrl||!1},Nt.prototype.getFileUrlKey=function(){return this.options.fileUrlKey||"url"},Nt.prototype.createUpload=function(t,e){return new s(t,e,this.options)},new Nt})); diff --git a/dist/snow.min.css b/dist/snow.min.css index c816089..7ed7e40 100644 --- a/dist/snow.min.css +++ b/dist/snow.min.css @@ -1,5 +1 @@ -<<<<<<< HEAD -.formulate-input{margin-bottom:1.5em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.formulate-input .formulate-input-label{display:block;line-height:1.5;font-size:.9em;font-weight:600;margin-bottom:.1em}.formulate-input .formulate-input-label--before+.formulate-input-help--before{margin-top:-.25em;margin-bottom:.75em}.formulate-input .formulate-input-element{max-width:20em;margin-bottom:.1em}.formulate-input .formulate-input-help{color:#6d6d6d;font-size:.7em;font-weight:400;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-errors{list-style-type:none;padding:0;margin:0}.formulate-input .formulate-file-upload-error,.formulate-input .formulate-input-error{color:#960505;font-size:.8em;font-weight:300;line-height:1.5;margin-bottom:.25em}.formulate-input:last-child{margin-bottom:0}.formulate-input[data-classification=text] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0}.formulate-input[data-classification=text] input::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=text] .formulate-input-element--date input,.formulate-input[data-classification=text] .formulate-input-element--datetime-local input,.formulate-input[data-classification=text] .formulate-input-element--month input,.formulate-input[data-classification=text] .formulate-input-element--week input{min-height:2.2em}.formulate-input[data-classification=text] .formulate-input-element--search{position:relative}.formulate-input[data-classification=text] .formulate-input-element--search:before{content:"";width:2em;height:100%;position:absolute;left:0;top:0;background-image:url('data:image/svg+xml;utf8,');background-size:1em 1em;background-repeat:no-repeat;background-position:50%;pointer-events:none}.formulate-input[data-classification=text] .formulate-input-element--search input{padding-left:2em}.formulate-input[data-classification=text] input[type=color]{height:1.1em;box-sizing:content-box}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch-wrapper{padding:0 0 0 1.5em;display:flex;align-items:center;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-size:.9em .9em;background-position:left .1em}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=text] input[type=color]::-moz-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=slider] .formulate-input-element--range{display:flex;align-items:center}.formulate-input[data-classification=slider] .formulate-input-element-range-value{font-size:.9em;line-height:1;margin-left:.5em;background-color:#efefef;padding:.25em .3em;border-radius:.25em;color:#6d6d6d;font-variant-numeric:tabular-nums}.formulate-input[data-classification=slider] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;font-size:1em;padding:.5em 0}.formulate-input[data-classification=slider] input:focus{outline:0}.formulate-input[data-classification=slider] input::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-moz-range-thumb{cursor:pointer;-moz-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-ms-thumb{cursor:pointer;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=textarea] textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0}.formulate-input[data-classification=textarea] textarea::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0;border:1px solid #41b883;background-color:#41b883;color:#fff;min-width:0;width:auto;font-weight:700;cursor:pointer;display:inline-flex;align-items:center}.formulate-input[data-classification=button] button::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button[disabled]{background-color:#cecece;border-color:#cecece}.formulate-input[data-classification=button] button[data-ghost]{color:#41b883;background-color:transparent;border-color:currentColor}.formulate-input[data-classification=button] button[data-minor]{font-size:.75em;display:inline-block}.formulate-input[data-classification=button] button[data-danger]{background-color:#960505;border-color:#960505}.formulate-input[data-classification=button] button[data-danger][data-ghost]{color:#960505;background-color:transparent}.formulate-input[data-classification=button] button:active{background-color:#64c89b;border-color:#64c89b}.formulate-input[data-classification=select] .formulate-input-element{position:relative}.formulate-input[data-classification=select] .formulate-input-element:before{content:"";width:0;height:0;border-color:#cecece transparent transparent;border-style:solid;border-width:.3em .3em 0;top:50%;margin-top:-.1em;right:1em;position:absolute}.formulate-input[data-classification=select] select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0;padding:.75em 2em .75em .75em}.formulate-input[data-classification=select] select::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=select] select[data-placeholder-selected]{color:#a8a8a8}.formulate-input[data-classification=box] .formulate-input-wrapper{display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element{overflow:hidden;display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element input{position:absolute;left:-999px}.formulate-input[data-classification=box] .formulate-input-element-decorator{display:block;width:1em;height:1em;border-radius:.25em;border:1px solid #cecece;position:relative}.formulate-input[data-classification=box] .formulate-input-element-decorator:before{content:"";display:block;background-size:contain;background-position:100%;width:calc(100% - .125em);height:calc(100% - .125em);box-sizing:border-box;position:absolute;top:.0625em;left:.0625em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator{border-radius:1em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator:before{border-radius:1em;width:calc(100% - .5em);height:calc(100% - .5em);top:.25em;left:.25em}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator:before{background-color:#41b883;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator:before{background-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input:focus~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-label--after{margin-left:.5em}.formulate-input[data-classification=box] .formulate-input-label--before{margin-right:.5em}.formulate-input[data-classification=group] .formulate-input-group-item,.formulate-input[data-classification=group]>.formulate-input-wrapper>.formulate-input-label{margin-bottom:.5em}.formulate-input[data-classification=group] [data-is-repeatable]{padding:1em;border:1px solid #efefef;border-radius:.3em}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-grouping{margin:-1em -1em 0}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable{padding:1em 3em 1em 1em;border-bottom:1px solid #efefef;position:relative}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove{position:absolute;display:block;top:calc(50% - .75em);width:1.5em;height:1.5em;background-color:#cecece;right:.75em;border-radius:1.5em;cursor:pointer;transition:background-color .2s}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:after,.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:before{content:"";position:absolute;top:calc(50% - .125em);left:.375em;display:block;width:.75em;height:.25em;background-color:#fff;transform-origin:center center;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover{background-color:#dc2c2c}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:after,.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:before{height:.2em;width:.9em;left:.3em;top:calc(50% - .075em)}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:after{transform:rotate(45deg)}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:before{transform:rotate(-45deg)}}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable:last-child{margin-bottom:1em}.formulate-input[data-classification=file] .formulate-input-upload-area{width:100%;position:relative;padding:2em 0}.formulate-input[data-classification=file] .formulate-input-upload-area input{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0;position:absolute;left:0;right:0;bottom:0;top:0;width:100%;height:100%;z-index:5}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files]{padding:0}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files] input{display:none}.formulate-input[data-classification=file] .formulate-input-upload-area-mask{border-radius:.4em;pointer-events:none;position:absolute;display:flex;justify-content:center;align-items:center;left:0;right:0;top:0;bottom:0;border:2px dashed #a8a8a8;z-index:2}.formulate-input[data-classification=file] .formulate-input-upload-area-mask:before{content:"";background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;width:2em;height:2em;position:absolute;pointer-events:none}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask{border-color:#41b883}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask:before{background-color:#41b883}.formulate-input[data-classification=file] .formulate-files{list-style-type:none;margin:0;padding:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress{background-color:#cecece;height:.3em;border-radius:1.25em;width:5em;overflow:hidden;position:relative;flex:0 0 5em;right:.75em;transition:height .25s,width .25s,flex-basis .25s;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;display:block;opacity:0;transform:scale(.08);background-color:#fff;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:77%;mask-size:77%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;z-index:3}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]{width:1.25em;height:1.25em;flex:0 0 1.25em}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]:before{transition:transform .25s .2s,opacity .25s .2s;transform:scale(1);opacity:1}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]{transition:height .25s,width .25s,left .25s,top,.25s,border-radius .25s;width:.3em;flex:0 0 .3em;height:100%;right:0;border-radius:0 .23em .23em 0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]:before{transition:opacity .1s;opacity:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress .formulate-file-progress-inner{background-color:#41b883;width:1%;position:absolute;left:0;bottom:0;top:0;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-name{padding-left:1.5em;padding-right:2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.formulate-input[data-classification=file] .formulate-files .formulate-file-name:before{position:absolute;left:.7em;top:50%;margin-top:-.7em;background-color:#a8a8a8;content:"";-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.25em;height:1.25em;display:inline-block;margin-right:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file-remove{width:1.25em;height:1.25em;border-radius:1em;border:1px solid #a8a8a8;background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:.6em;mask-size:.6em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;cursor:pointer;position:absolute;right:.75em;z-index:1;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-remove:hover{transform:scale(1.5)}}.formulate-input[data-classification=file] .formulate-files li{display:block}.formulate-input[data-classification=file] .formulate-files li[data-has-error] .formulate-file-progress{background-color:#dc2c2c}.formulate-input[data-classification=file] .formulate-files li[data-has-preview] .formulate-file-name:before{display:none}.formulate-input[data-classification=file] .formulate-files li+li{margin-top:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;font-weight:400;line-height:1.2em;margin:0;display:block;width:100%;display:flex;justify-content:flex-start;align-items:center;position:relative}.formulate-input[data-classification=file] .formulate-files .formulate-file::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=file] .formulate-files .formulate-file ::-webkit-progress-bar{-webkit-appearance:none;appearance:none;height:.5em;border-radius:.5em;overflow:hidden}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview{width:3em;height:3em;flex:0 0 3em;position:relative;z-index:2;left:-1px;box-shadow:0 0 0 1px #efefef;transition:transform .25s,box-shadow .25s,background-color .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview:hover{transition-delay:.2s;transform:scale(3);background-color:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.1)}}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview img{display:block;position:absolute;width:100%;height:100%;left:0;right:0;bottom:0;top:0;-o-object-fit:contain;object-fit:contain;transition:all .25s}.formulate-input[data-classification=file] [data-type=image] .formulate-input-upload-area .formulate-input-upload-area-mask:before{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-form-errors{margin:.75em 0;padding:0;list-style-type:none}.formulate-form-errors:first-child{margin-top:0}.formulate-form-errors:last-child{margin-bottom:0}.formulate-form-errors .formulate-form-error{color:#960505;font-size:.9em;font-weight:300;line-height:1.5;margin-bottom:.25em} -======= -.formulate-input{margin-bottom:1.5em}.formulate-input .formulate-input-label{display:block;line-height:1.5;font-size:.9em;font-weight:600;margin-bottom:.1em}.formulate-input .formulate-input-element{max-width:20em;margin-bottom:.1em}.formulate-input .formulate-input-help{color:#6d6d6d;font-size:.7em;font-weight:400;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-errors{list-style-type:none;padding:0;margin:0}.formulate-input .formulate-file-upload-error,.formulate-input .formulate-input-error{color:#960505;font-size:.8em;font-weight:300;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-group-item{margin-bottom:.5em}.formulate-input:last-child{margin-bottom:0}.formulate-input[data-classification=text] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0}.formulate-input[data-classification=text] input::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=text] .formulate-input-element--date input,.formulate-input[data-classification=text] .formulate-input-element--datetime-local input,.formulate-input[data-classification=text] .formulate-input-element--month input,.formulate-input[data-classification=text] .formulate-input-element--week input{min-height:2.2em}.formulate-input[data-classification=text] .formulate-input-element--search{position:relative}.formulate-input[data-classification=text] .formulate-input-element--search:before{content:"";width:2em;height:100%;position:absolute;left:0;top:0;background-image:url('data:image/svg+xml;utf8,');background-size:1em 1em;background-repeat:no-repeat;background-position:50%;pointer-events:none}.formulate-input[data-classification=text] .formulate-input-element--search input{padding-left:2em}.formulate-input[data-classification=text] input[type=color]{height:1.1em;box-sizing:content-box}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch-wrapper{padding:0 0 0 1.5em;display:flex;align-items:center;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-size:.9em .9em;background-position:left .1em}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=text] input[type=color]::-moz-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=slider] .formulate-input-element--range{display:flex;align-items:center}.formulate-input[data-classification=slider] .formulate-input-element-range-value{font-size:.9em;line-height:1;margin-left:.5em;background-color:#efefef;padding:.25em .3em;border-radius:.25em;color:#6d6d6d;font-variant-numeric:tabular-nums}.formulate-input[data-classification=slider] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;font-size:1em;padding:.5em 0}.formulate-input[data-classification=slider] input:focus{outline:0}.formulate-input[data-classification=slider] input::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;border:0;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-moz-range-thumb{cursor:pointer;-moz-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;border:0;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-ms-thumb{cursor:pointer;appearance:none;width:1em;height:1em;border-radius:1em;border:0;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=slider] input::-moz-range-track{-moz-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=textarea] textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0}.formulate-input[data-classification=textarea] textarea::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0;border:1px solid #41b883;background-color:#41b883;color:#fff;min-width:0;width:auto;font-weight:700;cursor:pointer;display:inline-flex;align-items:center}.formulate-input[data-classification=button] button::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button[disabled]{background-color:#cecece;border-color:#cecece}.formulate-input[data-classification=button] button:active{background-color:#64c89b;border-color:#64c89b}.formulate-input[data-classification=select] .formulate-input-element{position:relative}.formulate-input[data-classification=select] .formulate-input-element:before{content:"";width:0;height:0;border-color:#cecece transparent transparent;border-style:solid;border-width:.3em .3em 0;top:50%;margin-top:-.1em;right:1em;position:absolute}.formulate-input[data-classification=select] select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0;padding:.75em 2em .75em .75em}.formulate-input[data-classification=select] select::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=select] select[data-placeholder-selected]{color:#a8a8a8}.formulate-input[data-classification=box] .formulate-input-wrapper{display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element{overflow:hidden;display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element input{position:absolute;left:-999px}.formulate-input[data-classification=box] .formulate-input-element-decorator{display:block;width:1em;height:1em;border-radius:.25em;border:1px solid #cecece;position:relative}.formulate-input[data-classification=box] .formulate-input-element-decorator:before{content:"";display:block;background-size:contain;background-position:100%;width:calc(100% - .125em);height:calc(100% - .125em);box-sizing:border-box;position:absolute;top:.0625em;left:.0625em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator{border-radius:1em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator:before{border-radius:1em;width:calc(100% - .5em);height:calc(100% - .5em);top:.25em;left:.25em}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator:before{background-color:#41b883;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator:before{background-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input:focus~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-label--after{margin-left:.5em}.formulate-input[data-classification=box] .formulate-input-label--before{margin-right:.5em}.formulate-input[data-classification=group]>.formulate-input-wrapper>.formulate-input-label{margin-bottom:.5em}.formulate-input[data-classification=file] .formulate-input-upload-area{width:100%;position:relative;padding:2em 0}.formulate-input[data-classification=file] .formulate-input-upload-area input{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0;position:absolute;left:0;right:0;bottom:0;top:0;width:100%;height:100%;z-index:5}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files]{padding:0}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files] input{display:none}.formulate-input[data-classification=file] .formulate-input-upload-area-mask{border-radius:.4em;pointer-events:none;position:absolute;display:flex;justify-content:center;align-items:center;left:0;right:0;top:0;bottom:0;border:2px dashed #a8a8a8;z-index:2}.formulate-input[data-classification=file] .formulate-input-upload-area-mask:before{content:"";background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;width:2em;height:2em;position:absolute;pointer-events:none}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask{border-color:#41b883}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask:before{background-color:#41b883}.formulate-input[data-classification=file] .formulate-files{list-style-type:none;margin:0;padding:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress{background-color:#cecece;height:.3em;border-radius:1.25em;width:5em;overflow:hidden;position:relative;flex:0 0 5em;right:.75em;transition:height .25s,width .25s,flex-basis .25s;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;display:block;opacity:0;transform:scale(.08);background-color:#fff;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:77%;mask-size:77%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;z-index:3}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]{width:1.25em;height:1.25em;flex:0 0 1.25em}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]:before{transition:transform .25s .2s,opacity .25s .2s;transform:scale(1);opacity:1}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]{transition:height .25s,width .25s,left .25s,top,.25s,border-radius .25s;width:.3em;flex:0 0 .3em;height:100%;right:0;border-radius:0 .23em .23em 0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]:before{transition:opacity .1s;opacity:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress .formulate-file-progress-inner{background-color:#41b883;width:1%;position:absolute;left:0;bottom:0;top:0;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-name{padding-left:1.5em;padding-right:2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.formulate-input[data-classification=file] .formulate-files .formulate-file-name:before{position:absolute;left:.7em;top:50%;margin-top:-.7em;background-color:#a8a8a8;content:"";-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.25em;height:1.25em;display:inline-block;margin-right:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file-remove{width:1.25em;height:1.25em;border-radius:1em;border:1px solid #a8a8a8;background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:.6em;mask-size:.6em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;cursor:pointer;position:absolute;right:.75em;z-index:1;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-remove:hover{transform:scale(1.5)}}.formulate-input[data-classification=file] .formulate-files li{display:block}.formulate-input[data-classification=file] .formulate-files li[data-has-error] .formulate-file-progress{background-color:#dc2c2c}.formulate-input[data-classification=file] .formulate-files li[data-has-preview] .formulate-file-name:before{display:none}.formulate-input[data-classification=file] .formulate-files li+li{margin-top:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;font-weight:400;line-height:1.2em;margin:0;display:block;width:100%;display:flex;justify-content:flex-start;align-items:center;position:relative}.formulate-input[data-classification=file] .formulate-files .formulate-file::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=file] .formulate-files .formulate-file ::-webkit-progress-bar{-webkit-appearance:none;appearance:none;height:.5em;border-radius:.5em;overflow:hidden}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview{width:3em;height:3em;flex:0 0 3em;position:relative;z-index:2;left:-1px;box-shadow:0 0 0 1px #efefef;transition:transform .25s,box-shadow .25s,background-color .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview:hover{transition-delay:.2s;transform:scale(3);background-color:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.1)}}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview img{display:block;position:absolute;width:100%;height:100%;left:0;right:0;bottom:0;top:0;-o-object-fit:contain;object-fit:contain;transition:all .25s}.formulate-input[data-classification=file] [data-type=image] .formulate-input-upload-area .formulate-input-upload-area-mask:before{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-form-errors{margin:.75em 0;padding:0;list-style-type:none}.formulate-form-errors:first-child{margin-top:0}.formulate-form-errors:last-child{margin-bottom:0}.formulate-form-errors .formulate-form-error{color:#960505;font-size:.9em;font-weight:300;line-height:1.5;margin-bottom:.25em} ->>>>>>> 63d3ca71484a9587faef39d0fb462ecf229cc442 +.formulate-input{margin-bottom:1.5em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.formulate-input .formulate-input-label{display:block;line-height:1.5;font-size:.9em;font-weight:600;margin-bottom:.1em}.formulate-input .formulate-input-label--before+.formulate-input-help--before{margin-top:-.25em;margin-bottom:.75em}.formulate-input .formulate-input-element{max-width:20em;margin-bottom:.1em}.formulate-input .formulate-input-help{color:#6d6d6d;font-size:.7em;font-weight:400;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-errors{list-style-type:none;padding:0;margin:0}.formulate-input .formulate-file-upload-error,.formulate-input .formulate-input-error{color:#960505;font-size:.8em;font-weight:300;line-height:1.5;margin-bottom:.25em}.formulate-input:last-child{margin-bottom:0}.formulate-input[data-classification=text] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0}.formulate-input[data-classification=text] input::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=text] input:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=text] .formulate-input-element--date input,.formulate-input[data-classification=text] .formulate-input-element--datetime-local input,.formulate-input[data-classification=text] .formulate-input-element--month input,.formulate-input[data-classification=text] .formulate-input-element--week input{min-height:2.2em}.formulate-input[data-classification=text] .formulate-input-element--search{position:relative}.formulate-input[data-classification=text] .formulate-input-element--search:before{content:"";width:2em;height:100%;position:absolute;left:0;top:0;background-image:url('data:image/svg+xml;utf8,');background-size:1em 1em;background-repeat:no-repeat;background-position:50%;pointer-events:none}.formulate-input[data-classification=text] .formulate-input-element--search input{padding-left:2em}.formulate-input[data-classification=text] input[type=color]{height:1.1em;box-sizing:content-box}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch-wrapper{padding:0 0 0 1.5em;display:flex;align-items:center;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-size:.9em .9em;background-position:left .1em}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=text] input[type=color]::-moz-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=slider] .formulate-input-element--range{display:flex;align-items:center}.formulate-input[data-classification=slider] .formulate-input-element-range-value{font-size:.9em;line-height:1;margin-left:.5em;background-color:#efefef;padding:.25em .3em;border-radius:.25em;color:#6d6d6d;font-variant-numeric:tabular-nums}.formulate-input[data-classification=slider] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;font-size:1em;padding:.5em 0}.formulate-input[data-classification=slider] input:focus{outline:0}.formulate-input[data-classification=slider] input::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;border:0;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-moz-range-thumb{cursor:pointer;-moz-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;border:0;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-ms-thumb{cursor:pointer;appearance:none;width:1em;height:1em;border-radius:1em;border:0;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=slider] input::-moz-range-track{-moz-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=textarea] textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0}.formulate-input[data-classification=textarea] textarea::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=textarea] textarea:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0;border:1px solid #41b883;background-color:#41b883;color:#fff;min-width:0;width:auto;font-weight:700;cursor:pointer;display:inline-flex;align-items:center}.formulate-input[data-classification=button] button::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=button] button:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button[disabled]{background-color:#cecece;border-color:#cecece}.formulate-input[data-classification=button] button[data-ghost]{color:#41b883;background-color:transparent;border-color:currentColor}.formulate-input[data-classification=button] button[data-minor]{font-size:.75em;display:inline-block}.formulate-input[data-classification=button] button[data-danger]{background-color:#960505;border-color:#960505}.formulate-input[data-classification=button] button[data-danger][data-ghost]{color:#960505;background-color:transparent}.formulate-input[data-classification=button] button:active{background-color:#64c89b;border-color:#64c89b}.formulate-input[data-classification=select] .formulate-input-element{position:relative}.formulate-input[data-classification=select] .formulate-input-element:before{content:"";width:0;height:0;border-color:#cecece transparent transparent;border-style:solid;border-width:.3em .3em 0;top:50%;margin-top:-.1em;right:1em;position:absolute}.formulate-input[data-classification=select] select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;display:block;width:100%;font-weight:400;line-height:1.2em;margin:0;padding:.75em 2em .75em .75em}.formulate-input[data-classification=select] select::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=select] select:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=select] select[data-placeholder-selected]{color:#a8a8a8}.formulate-input[data-classification=box] .formulate-input-wrapper{display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element{overflow:hidden;display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element input{position:absolute;left:-999px}.formulate-input[data-classification=box] .formulate-input-element-decorator{display:block;width:1em;height:1em;border-radius:.25em;border:1px solid #cecece;position:relative}.formulate-input[data-classification=box] .formulate-input-element-decorator:before{content:"";display:block;background-size:contain;background-position:100%;width:calc(100% - .125em);height:calc(100% - .125em);box-sizing:border-box;position:absolute;top:.0625em;left:.0625em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator{border-radius:1em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator:before{border-radius:1em;width:calc(100% - .5em);height:calc(100% - .5em);top:.25em;left:.25em}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator:before{background-color:#41b883;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator:before{background-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input:focus~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-label--after{margin-left:.5em}.formulate-input[data-classification=box] .formulate-input-label--before{margin-right:.5em}.formulate-input[data-classification=group] .formulate-input-group-item,.formulate-input[data-classification=group]>.formulate-input-wrapper>.formulate-input-label{margin-bottom:.5em}.formulate-input[data-classification=group] [data-is-repeatable]{padding:1em;border:1px solid #efefef;border-radius:.3em}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-grouping{margin:-1em -1em 0}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable{padding:1em 3em 1em 1em;border-bottom:1px solid #efefef;position:relative}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove{position:absolute;display:block;top:calc(50% - .75em);width:1.5em;height:1.5em;background-color:#cecece;right:.75em;border-radius:1.5em;cursor:pointer;transition:background-color .2s}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:after,.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:before{content:"";position:absolute;top:calc(50% - .125em);left:.375em;display:block;width:.75em;height:.25em;background-color:#fff;transform-origin:center center;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover{background-color:#dc2c2c}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:after,.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:before{height:.2em;width:.9em;left:.3em;top:calc(50% - .075em)}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:after{transform:rotate(45deg)}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable-remove:hover:before{transform:rotate(-45deg)}}.formulate-input[data-classification=group] [data-is-repeatable] .formulate-input-group-repeatable:last-child{margin-bottom:1em}.formulate-input[data-classification=file] .formulate-input-upload-area{width:100%;position:relative;padding:2em 0}.formulate-input[data-classification=file] .formulate-input-upload-area input{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0;position:absolute;left:0;right:0;bottom:0;top:0;width:100%;height:100%;z-index:5}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files]{padding:0}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files] input{display:none}.formulate-input[data-classification=file] .formulate-input-upload-area-mask{border-radius:.4em;pointer-events:none;position:absolute;display:flex;justify-content:center;align-items:center;left:0;right:0;top:0;bottom:0;border:2px dashed #a8a8a8;z-index:2}.formulate-input[data-classification=file] .formulate-input-upload-area-mask:before{content:"";background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;width:2em;height:2em;position:absolute;pointer-events:none}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask{border-color:#41b883}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask:before{background-color:#41b883}.formulate-input[data-classification=file] .formulate-files{list-style-type:none;margin:0;padding:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress{background-color:#cecece;height:.3em;border-radius:1.25em;width:5em;overflow:hidden;position:relative;flex:0 0 5em;right:.75em;transition:height .25s,width .25s,flex-basis .25s;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;display:block;opacity:0;transform:scale(.08);background-color:#fff;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:77%;mask-size:77%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;z-index:3}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]{width:1.25em;height:1.25em;flex:0 0 1.25em}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]:before{transition:transform .25s .2s,opacity .25s .2s;transform:scale(1);opacity:1}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]{transition:height .25s,width .25s,left .25s,top,.25s,border-radius .25s;width:.3em;flex:0 0 .3em;height:100%;right:0;border-radius:0 .23em .23em 0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]:before{transition:opacity .1s;opacity:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress .formulate-file-progress-inner{background-color:#41b883;width:1%;position:absolute;left:0;bottom:0;top:0;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-name{padding-left:1.5em;padding-right:2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.formulate-input[data-classification=file] .formulate-files .formulate-file-name:before{position:absolute;left:.7em;top:50%;margin-top:-.7em;background-color:#a8a8a8;content:"";-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.25em;height:1.25em;display:inline-block;margin-right:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file-remove{width:1.25em;height:1.25em;border-radius:1em;border:1px solid #a8a8a8;background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:.6em;mask-size:.6em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;cursor:pointer;position:absolute;right:.75em;z-index:1;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-remove:hover{transform:scale(1.5)}}.formulate-input[data-classification=file] .formulate-files li{display:block}.formulate-input[data-classification=file] .formulate-files li[data-has-error] .formulate-file-progress{background-color:#dc2c2c}.formulate-input[data-classification=file] .formulate-files li[data-has-preview] .formulate-file-name:before{display:none}.formulate-input[data-classification=file] .formulate-files li+li{margin-top:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;font-weight:400;line-height:1.2em;margin:0;display:block;width:100%;display:flex;justify-content:flex-start;align-items:center;position:relative}.formulate-input[data-classification=file] .formulate-files .formulate-file::-webkit-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::-moz-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file:-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::-ms-input-placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file::placeholder{color:#a8a8a8;line-height:normal}.formulate-input[data-classification=file] .formulate-files .formulate-file:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=file] .formulate-files .formulate-file ::-webkit-progress-bar{-webkit-appearance:none;appearance:none;height:.5em;border-radius:.5em;overflow:hidden}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview{width:3em;height:3em;flex:0 0 3em;position:relative;z-index:2;left:-1px;box-shadow:0 0 0 1px #efefef;transition:transform .25s,box-shadow .25s,background-color .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview:hover{transition-delay:.2s;transform:scale(3);background-color:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.1)}}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview img{display:block;position:absolute;width:100%;height:100%;left:0;right:0;bottom:0;top:0;-o-object-fit:contain;object-fit:contain;transition:all .25s}.formulate-input[data-classification=file] [data-type=image] .formulate-input-upload-area .formulate-input-upload-area-mask:before{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-form-errors{margin:.75em 0;padding:0;list-style-type:none}.formulate-form-errors:first-child{margin-top:0}.formulate-form-errors:last-child{margin-bottom:0}.formulate-form-errors .formulate-form-error{color:#960505;font-size:.9em;font-weight:300;line-height:1.5;margin-bottom:.25em} \ No newline at end of file diff --git a/src/FormulateInput.vue b/src/FormulateInput.vue index 8d4e406..954be10 100644 --- a/src/FormulateInput.vue +++ b/src/FormulateInput.vue @@ -80,7 +80,7 @@