import{V as e}from"./vue-ROl3rvO--v4.6.0.js";import{V as i}from"./VariationMixin-Dc76uqDN-v4.6.0.js";import{t as r}from"./Toaster-kJWPoJWx-v4.6.0.js";import"./vuedraggable-wexgooZQ-v4.6.0.js";import"./@popperjs-DMMwm23M-v4.6.0.js";import"./Errors-CLl7ZKxD-v4.6.0.js";import"./@melloware-BTYRaMki-v4.6.0.js";import"./vue-toast-notification-mZWJjkD3-v4.6.0.js";new e({el:"#app",mixins:[i],created(){this.form=this.prepareFormData(FleetCart.data.variation)},mounted(){this.initColorPicker()},methods:{prepareFormData(t){return t.uid=this.uid(),t.values.forEach(s=>{s.uid=this.uid()}),t},submit(){this.formSubmitting=!0,$.ajax({type:"PUT",url:route("admin.variations.update",this.form.id),data:this.transformData(this.form),dataType:"json",success:t=>{r(t.message,{type:"success"}),this.errors.reset()}}).catch(t=>{r(t.responseJSON.message,{type:"default"}),this.errors.reset(),this.errors.record(t.responseJSON.errors),this.focusFirstErrorField(this.$refs.form.elements)}).always(()=>{this.formSubmitting=!1})}}});
