forge/public/vendor/nova/vendor.js

3 lines
2.4 MiB
JavaScript
Raw Normal View History

2024-05-13 18:55:34 -04:00
/*! For license information please see vendor.js.LICENSE.txt */
(self.webpackChunklaravel_nova=self.webpackChunklaravel_nova||[]).push([[0],{26923:(e,t,n)=>{function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=r(n(44)),i=n(74032),a=r(n(59907)),l=n(5540);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(){var e=[].slice.call(arguments),t="string"==typeof e[0]?e[0]:null,n=("string"==typeof e[0]?e[1]:e[0])||{},r=t?l.Inertia.restore(t):null,c=a(n),u=null,d=null,p=function(e){return e},h=i.reactive(s({},r?r.data:n,{isDirty:!1,errors:r?r.errors:{},hasErrors:!1,processing:!1,progress:null,wasSuccessful:!1,recentlySuccessful:!1,data:function(){var e=this;return Object.keys(n).reduce((function(t,n){return t[n]=e[n],t}),{})},transform:function(e){return p=e,this},defaults:function(e,t){var n;return c=void 0===e?this.data():Object.assign({},a(c),t?((n={})[e]=t,n):e),this},reset:function(){var e=[].slice.call(arguments),t=a(c);return Object.assign(this,0===e.length?t:Object.keys(t).filter((function(t){return e.includes(t)})).reduce((function(e,n){return e[n]=t[n],e}),{})),this},setError:function(e,t){var n;return Object.assign(this.errors,t?((n={})[e]=t,n):e),this.hasErrors=Object.keys(this.errors).length>0,this},clearErrors:function(){var e=this,t=[].slice.call(arguments);return this.errors=Object.keys(this.errors).reduce((function(n,r){var o;return s({},n,t.length>0&&!t.includes(r)?((o={})[r]=e.errors[r],o):{})}),{}),this.hasErrors=Object.keys(this.errors).length>0,this},submit:function(e,t,n){var r=this,o=this;void 0===n&&(n={});var i=p(this.data()),h=s({},n,{onCancelToken:function(e){if(u=e,n.onCancelToken)return n.onCancelToken(e)},onBefore:function(e){if(o.wasSuccessful=!1,o.recentlySuccessful=!1,clearTimeout(d),n.onBefore)return n.onBefore(e)},onStart:function(e){if(o.processing=!0,n.onStart)return n.onStart(e)},onProgress:function(e){if(o.progress=e,n.onProgress)return n.onProgress(e)},onSuccess:function(e){try{var t=function(e){return c=a(r.data()),r.isDirty=!1,e};return r.processing=!1,r.progress=null,r.clearErrors(),r.wasSuccessful=!0,r.recentlySuccessful=!0,d=setTimeout((function(){return r.recentlySuccessful=!1}),2e3),Promise.resolve(n.onSuccess?Promise.resolve(n.onSuccess(e)).then(t):t(null))}catch(e){return Promise.reject(e)}},onError:function(e){if(o.processing=!1,o.progress=null,o.clearErrors().setError(e),n.onError)return n.onError(e)},onCancel:function(){if(o.processing=!1,o.progress=null,n.onCancel)return n.onCancel()},onFinish:function(){if(o.processing=!1,o.progress=null,u=null,n.onFinish)return n.onFinish()}});"delete"===e?l.Inertia.delete(t,s({},h,{data:i})):l.Inertia[e](t,i,h)},get:function(e,t){this.submit("get",e,t)},post:function(e,t){this.submit("post",e,t)},put:function(e,t){this.submit("put",e,t)},patch:function(e,t){this.submit("patch",e,t)},delete:function(e,t){this.submit("delete",e,t)},cancel:function(){u&&u.cancel()},__rememberable:null===t,__remember:function(){return{data:this.data(),errors:this.errors}},__restore:function(e){Object.assign(this,e.data),this.setError(e.errors)}}));return i.watch(h,(function(e){h.isDirty=!o(h.data(),c),t&&l.Inertia.remember(a(e.__remember()),t)}),{immediate:!0,deep:!0}),h}var u={created:function(){var e=this;if(this.$options.remember){Array.isArray(this.$options.remember)&&(this.$options.remember={data:this.$options.remember}),"string"==typeof this.$options.remember&&(this.$options.remember={data:[this.$options.remember]}),"string"==typeof this.$options.remember.data&&(this.$options.remember={data:[this.$options.remember.data]});var t=this.$options.remember.key instanceof Function?this.$options.remember.key.call(this):this.$options.remember.key,n=l.Inertia.restore(t),r=this.$options.remember.data.filter((function(t){return!(null!==e[t]&&"object"==typeof e[t]&&!1===e[t].__rememberable)})),o=function(t){return null!==e[t]&&"object"==typeof e[t]&&"function"==typeof e[t].__remember&&"function"==typeof e[t].__restore};r.forEach((function(i){vo
//# sourceMappingURL=vendor.js.map