multiStoreAdmin/build/store/assets/index1.16123f64.js

12 lines
104 KiB
JavaScript

import{d as W,Z as U,r as Ue,w as N,W as y,ah as F,M as Y,n as X,F as on,am as ce,$ as Q,C as Ct,b as un,o as ie,c as ae,f as je,a as oe,R as sn,at as ln,h as fn,I as cn,G as dn,a0 as Ze,H as pn,i as hn,E as mn,a1 as vn,ap as gn}from"./@vue.340249d8.js";import{d as yn}from"./index.5ab034a5.js";import"./element-plus.ab0703f2.js";import"./lodash-es.edba6135.js";import"./@vueuse.e3650918.js";import"./@element-plus.558a564d.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.9886411c.js";import"./axios.45058a27.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./lodash.3d784a58.js";import"./vue-router.9ddb0e92.js";import"./pinia.97fe9b12.js";import"./css-color-function.5c1c877d.js";import"./color.97e03886.js";import"./clone.cfa55f7b.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.8c276ac9.js";import"./vue-clipboard3.44194d32.js";import"./clipboard.47836ecb.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.309a94da.js";/*!
* @form-create/element-ui v3.2.0
* (c) 2018-2024 xaboy
* Github https://github.com/xaboy/form-create
* Released under the MIT License.
*/function et(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),e.push.apply(e,r)}return e}function _(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?et(Object(e),!0).forEach(function(r){D(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):et(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}function T(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?T=function(t){return typeof t}:T=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(n)}function _n(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function D(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function bn(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&ke(n,t)}function _e(n){return _e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_e(n)}function ke(n,t){return ke=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},ke(n,t)}function $n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cn(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function wn(n,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cn(n)}function Sn(n){var t=$n();return function(){var r=_e(n),i;if(t){var a=_e(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return wn(this,i)}}function R(n){return On(n)||Vn(n)||Rn(n)||En()}function On(n){if(Array.isArray(n))return De(n)}function Vn(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Rn(n,t){if(!!n){if(typeof n=="string")return De(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return De(n,t)}}function De(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function En(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ce(n,t){return Object.keys(n).reduce(function(e,r){return(!t||t.indexOf(r)===-1)&&e.push(n[r]),e},[])}function L(n){return Array.isArray(n)?n:[null,void 0,""].indexOf(n)>-1?[]:[n]}var Fn="fcCheckbox",An=W({name:Fn,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:function(){return[]}},type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup:function(t,e){var r=U(t.formCreateInject,"options",[]),i=U(t,"modelValue"),a=U(t,"inputValue",""),o=Ue(a.value),u=U(t,"input",!1),s=function(d){var p=R(L(i.value)),m=p.indexOf(o.value);o.value=d,m>-1&&(p.splice(m,1),p.push(d),f(p))};N(a,function(c){if(!u.value){o.value=c;return}s(c)});var l=function(){return Array.isArray(r.value)?r.value:[]},f=function(d){e.emit("update:modelValue",d)};return{options:l,value:i,onInput:f,updateCustomValue:s,makeInput:function(d){if(!!u.value)return y(d,{value:o.value,label:o.value},{default:function(){return[y(F("ElInput"),{modelValue:o.value,"onUpdate:modelValue":s},null)]}})}}},render:function(){var t,e,r=this,i=this.type==="button"?"ElCheckboxButton":"ElCheckbox",a=F(i);return y(F("ElCheckboxGroup"),Y(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),_({default:function(){return[r.options().map(function(u,s){var l=_({},u),f=l.value,c=l.label;return delete l.value,delete l.label,y(a,Y(l,{label:f,value:f,key:i+s+"-"+f}),{default:function(){return[c||f||""]}})}),(t=(e=r.$slots).default)===null||t===void 0?void 0:t.call(e),r.makeInput(a)]}},Ce(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}});function wt(n){n=n||new Map;var t={$on:function(r,i){var a=n.get(r),o=a&&a.push(i);o||n.set(r,[i])},$once:function(r,i){i._once=!0,t.$on(r,i)},$off:function(r,i){var a=n.get(r);a&&a.splice(a.indexOf(i)>>>0,1)},$emit:function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];(n.get(r)||[]).slice().map(function(u){u._once&&(t.$off(r,u),delete u._once),u.apply(void 0,a)}),(n.get("*")||[]).slice().map(function(u){u(r,a)})}};return t}function we(n,t){t===void 0&&(t={});var e=t.insertAt;if(!(!n||typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",e==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}}var In="._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame._fc-disabled ._fc-upload-btn,._fc-frame._fc-disabled .el-button{color:#999;cursor:not-allowed!important}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";we(In);var St={name:"IconCircleClose"},Pn={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},jn=oe("path",{fill:"currentColor",d:"M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"},null,-1),kn=oe("path",{fill:"currentColor",d:"M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"},null,-1),Dn=[jn,kn];function Bn(n,t,e,r,i,a){return ie(),ae("svg",Pn,Dn)}St.render=Bn;var Ot={name:"IconDocument"},xn={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Tn=oe("path",{fill:"currentColor",d:"M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"},null,-1),Mn=[Tn];function Nn(n,t,e,r,i,a){return ie(),ae("svg",xn,Mn)}Ot.render=Nn;var Vt={name:"IconDelete"},Ln={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Un=oe("path",{fill:"currentColor",d:"M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"},null,-1),Hn=[Un];function zn(n,t,e,r,i,a){return ie(),ae("svg",Ln,Hn)}Vt.render=zn;var Rt={name:"IconView"},Gn={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Yn=oe("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"},null,-1),qn=[Yn];function Wn(n,t,e,r,i,a){return ie(),ae("svg",Gn,qn)}Rt.render=Wn;var Et={name:"IconFolderOpened"},Jn={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Kn=oe("path",{fill:"currentColor",d:"M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"},null,-1),Xn=[Kn];function Qn(n,t,e,r,i,a){return ie(),ae("svg",Jn,Xn)}Et.render=Qn;function tt(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Ct(n)}var Zn="fcFrame",er=W({name:Zn,props:{type:{type:String,default:"input"},field:String,helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"IconFolderOpened"},width:{type:String,default:"500px"},height:{type:String,default:"370px"},maxLength:{type:Number,default:0},okBtnText:{type:String,default:"\u786E\u5B9A"},closeBtnText:{type:String,default:"\u5173\u95ED"},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:function(){}},onOk:{type:Function,default:function(){}},onCancel:{type:Function,default:function(){}},onLoad:{type:Function,default:function(){}},onBeforeRemove:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},onHandle:Function,modal:{type:Object,default:function(){return{}}},srcKey:[String,Number],modelValue:[Array,String,Number,Object],previewMask:void 0,footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0},formCreateInject:Object},emits:["update:modelValue","change"],components:{IconFolderOpened:Et,IconView:Rt},data:function(){return{fileList:L(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new wt}},watch:{modelValue:function(t){this.fileList=L(t)}},methods:{close:function(){this.closeModel(!0)},closeModel:function(t){this.bus.$emit(t?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModel:function(){this.disabled||this.onOpen()===!1||(this.frameVisible=!0)},input:function(){var t=this.fileList,e=this.maxLength===1?t[0]||"":t;this.$emit("update:modelValue",e),this.$emit("change",e)},makeInput:function(){var t=this;return y(F("ElInput"),Y({type:"text",modelValue:this.fileList.map(function(e){return t.getSrc(e)}).toString(),readonly:!0},{key:1}),{append:function(){return y(F("ElButton"),{icon:F(t.icon),onClick:function(){return t.showModel()}},null)},suffix:function(){return t.fileList.length&&!t.disabled?y(F("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:function(){t.fileList=[],t.input()}},{default:function(){return[y(St,null,null)]}}):null}})},makeGroup:function(t){return(!this.maxLength||this.fileList.length<this.maxLength)&&t.push(this.makeBtn()),y("div",{key:2},[t])},makeItem:function(t,e){return y("div",{class:"_fc-files",key:"3"+t},[e])},valid:function(t){var e=this.formCreateInject.field||this.field;if(e&&t!==e)throw new Error("[frame]\u65E0\u6548\u7684\u5B57\u6BB5\u503C")},makeIcons:function(t,e){if(this.handleIcon!==!1||this.allowRemove===!0){var r=[];return(this.type!=="file"&&this.handleIcon!==!1||this.type==="file"&&this.handleIcon)&&r.push(this.makeHandleIcon(t,e)),this.allowRemove&&r.push(this.makeRemoveIcon(t,e)),y("div",{class:"_fc-upload-cover",key:4},[r])}},makeHandleIcon:function(t,e){var r=this,i=F(this.handleIcon===!0||this.handleIcon===void 0?"icon-view":this.handleIcon);return y(F("ElIcon"),{onClick:function(){return r.handleClick(t)},key:"5"+e},{default:function(){return[y(i,null,null)]}})},makeRemoveIcon:function(t,e){var r=this;return y(F("ElIcon"),{onClick:function(){return r.handleRemove(t)},key:"6"+e},{default:function(){return[y(Vt,null,null)]}})},makeFiles:function(){var t=this;return this.makeGroup(this.fileList.map(function(e,r){return t.makeItem(r,[y(F("ElIcon"),{onClick:function(){return t.handleClick(e)}},{default:function(){return[y(Ot,null,null)]}}),t.makeIcons(e,r)])}))},makeImages:function(){var t=this;return this.makeGroup(this.fileList.map(function(e,r){return t.makeItem(r,[y("img",{src:t.getSrc(e)},null),t.makeIcons(e,r)])}))},makeBtn:function(){var t=this,e=F(this.icon);return y("div",{class:"_fc-upload-btn",onClick:function(){return t.showModel()},key:7},[y(F("ElIcon"),null,{default:function(){return[y(e,null,null)]}})])},handleClick:function(t){if(this.onHandle)return this.onHandle(t);this.previewImage=this.getSrc(t),this.previewVisible=!0},handleRemove:function(t){this.disabled||this.onBeforeRemove(t)!==!1&&(this.fileList.splice(this.fileList.indexOf(t),1),this.input(),this.onRemove(t))},getSrc:function(t){return this.srcKey?t[this.srcKey]:t},frameLoad:function(t){var e=this;this.onLoad(t);try{this.helper===!0&&(t.form_create_helper={api:this.formCreateInject.api,close:function(i){e.valid(i),e.closeModel()},set:function(i,a){e.valid(i),!e.disabled&&e.$emit("update:modelValue",a)},get:function(i){return e.valid(i),e.modelValue},onOk:function(i){return e.bus.$on("$ok",i)},onClose:function(i){return e.bus.$on("$close",i)}})}catch(r){console.error(r)}},makeFooter:function(){var t=this,e=this.$props,r=e.okBtnText,i=e.closeBtnText,a=e.closeBtn,o=e.okBtn,u=e.footer;if(!!u)return y("div",null,[a?y(F("ElButton"),{onClick:function(){return t.onCancel()!==!1&&(t.frameVisible=!1)}},tt(i)?i:{default:function(){return[i]}}):null,o?y(F("ElButton"),{type:"primary",onClick:function(){return t.onOk()!==!1&&t.closeModel()}},tt(r)?r:{default:function(){return[r]}}):null])}},render:function(){var t=this,e=this.type,r;e==="input"?r=this.makeInput():e==="image"?r=this.makeImages():r=this.makeFiles();var i=this.$props,a=i.width,o=a===void 0?"30%":a,u=i.height,s=i.src,l=i.title,f=i.modalTitle;return X(function(){t.$refs.frame&&t.frameLoad(t.$refs.frame.contentWindow||{})}),y("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[r,y(F("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:f,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[y("img",{style:"width: 100%",src:t.previewImage},null)]}}),y(F("ElDialog"),Y({appendToBody:!0},_({width:o,title:l},this.modal),{modelValue:this.frameVisible,onClose:function(){return t.closeModel(!0)}}),{default:function(){return[t.frameVisible||!t.reload?y("iframe",{ref:"frame",src:s,frameBorder:"0",style:{height:u,border:"0 none",width:"100%"}},null):null]},footer:function(){return t.makeFooter()}})])},beforeMount:function(){var t=this.formCreateInject,e=t.name,r=t.field,i=t.api;e&&i.on("fc:closeModal:"+e,this.close),r&&i.on("fc:closeModal:"+r,this.close)},beforeUnmount:function(){var t=this.formCreateInject,e=t.name,r=t.field,i=t.api;e&&i.off("fc:closeModal:"+e,this.close),r&&i.off("fc:closeModal:"+r,this.close)}}),tr="fcRadio",nr=W({name:tr,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup:function(t,e){var r=U(t.formCreateInject,"options",[]),i=U(t,"modelValue"),a=U(t,"inputValue",""),o=Ue(a.value),u=U(t,"input",!1),s=function(){return Array.isArray(r.value)?r.value:[]};N(a,function(c){if(!u.value){o.value=c;return}f(c)});var l=function(d){e.emit("update:modelValue",d)},f=function(d){var p=o.value;o.value=d,i.value===p&&l(d)};return{options:s,value:i,onInput:l,updateCustomValue:f,customValue:o,makeInput:function(d){if(!!u.value)return y(d,{value:o.value,label:o.value},{default:function(){return[y(F("ElInput"),{modelValue:o.value,"onUpdate:modelValue":f},null)]}})}}},render:function(){var t,e,r=this,i=this.type==="button"?"ElRadioButton":"ElRadio",a=F(i);return y(F("ElRadioGroup"),Y(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),_({default:function(){return[r.options().map(function(u,s){var l=_({},u),f=l.value,c=l.label;return delete l.value,delete l.label,y(a,Y(l,{label:f,value:f,key:i+s+"-"+f}),{default:function(){return[c||f||""]}})}),(t=(e=r.$slots).default)===null||t===void 0?void 0:t.call(e),r.makeInput(a)]}},Ce(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),h={type:function(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"},Undef:function(t){return t==null},Element:function(t){return T(t)==="object"&&t!==null&&t.nodeType===1&&!h.Object(t)},trueArray:function(t){return Array.isArray(t)&&t.length>0},Function:function(t){var e=this.getType(t);return e==="Function"||e==="AsyncFunction"},getType:function(t){var e=Object.prototype.toString.call(t);return/^\[object (.*)\]$/.exec(e)[1]},empty:function(t){return t==null||Array.isArray(t)&&Array.isArray(t)&&!t.length?!0:typeof t=="string"&&!t}};["Date","Object","String","Boolean","Array","Number"].forEach(function(n){h[n]=function(t){return h.type(t,n)}});function k(n,t){return{}.hasOwnProperty.call(n,t)}var rr="fcSelect",ir=W({name:rr,inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup:function(t){var e=U(t.formCreateInject,"options",[]),r=U(t,"modelValue"),i=function(){return Array.isArray(e.value)?e.value:[]};return{options:i,value:r}},render:function(){var t=this,e,r,i=function(s,l){return y(F("ElOption"),Y(s,{key:""+l+"-"+s.value}),null)},a=function(s,l){return y(F("ElOptionGroup"),{label:s.label,key:""+l+"-"+s.label},{default:function(){return[h.trueArray(s.options)&&s.options.map(function(c,d){return i(c,d)})]}})},o=this.options();return y(F("ElSelect"),Y(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":function(s){return t.$emit("update:modelValue",s)},ref:"el"}),_({default:function(){return[o.map(function(s,l){return k(s||"","options")?a(s,l):i(s,l)}),(e=(r=t.$slots).default)===null||e===void 0?void 0:e.call(r)]}},Ce(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),ar="fcTree",or=W({name:ar,inheritAttrs:!1,formCreateParser:{mergeProp:function(t){var e=t.prop.props;e.nodeKey||(e.nodeKey="id"),e.props||(e.props={label:"title"})}},props:{type:String,modelValue:{type:[Array,String,Number],default:function(){return[]}}},emits:["update:modelValue","fc.el"],watch:{modelValue:function(){this.setValue()}},methods:{updateValue:function(){if(!!this.$refs.tree){var t;this.type==="selected"?t=this.$refs.tree.getCurrentKey():t=this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",t)}},setValue:function(){if(!!this.$refs.tree){var t=this.type;t==="selected"?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(L(this.modelValue))}}},render:function(){return y(F("ElTree"),Y(this.$attrs,{ref:"tree",onCheck:this.updateValue,"onNode-click":this.updateValue}),this.$slots)},mounted:function(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}}),ur="._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}";we(ur);var Ft={name:"IconUpload"},sr={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},lr=oe("path",{fill:"currentColor",d:"M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"},null,-1),fr=[lr];function cr(n,t,e,r,i,a){return ie(),ae("svg",sr,fr)}Ft.render=cr;function nt(n,t){return{url:n,name:dr(n),uid:t}}function dr(n){return(""+n).split("/").pop()}var pr="fcUpload",hr=W({name:pr,inheritAttrs:!1,formCreateParser:{toFormValue:function(t){return L(t)},toValue:function(t,e){return e.prop.props.limit===1?t[0]||"":t}},props:{previewMask:void 0,onPreview:Function,modalTitle:String,modelValue:[Array,String]},emits:["update:modelValue","change","remove","fc.el"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=L(this.modelValue).map(nt)},watch:{modelValue:function(t){this.fileList=L(t).map(nt)}},methods:{handlePreview:function(t){this.onPreview?this.onPreview.apply(this,arguments):(this.previewImage=t.url,this.previewVisible=!0)},update:function(t){var e=t.map(function(r){return r.url}).filter(function(r){return r!==void 0});this.$emit("update:modelValue",e)},handleCancel:function(){this.previewVisible=!1},handleChange:function(t,e){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),t.status==="success"&&this.update(e)},handleRemove:function(t,e){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(e)}},render:function(){var t,e,r=this,i=L(this.modelValue).length;return y(on,null,[y(F("ElUpload"),Y({key:i,"list-type":"picture-card"},this.$attrs,{class:{"_fc-exceed":this.$attrs.limit?this.$attrs.limit<=i:!1},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,fileList:this.fileList,ref:"upload"}),_({default:function(){return[((t=(e=r.$slots).default)===null||t===void 0?void 0:t.call(e))||y(F("ElIcon"),null,{default:function(){return[y(Ft,null,null)]}})]}},Ce(this.$slots,["default"]))),y(F("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[y("img",{style:"width: 100%",src:r.previewImage},null)]}})])},mounted:function(){this.$emit("fc.el",this.$refs.upload)}});function z(n,t,e){n[t]=e}function ue(n,t){delete n[t]}function ge(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0,r=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];if((r=Array.isArray(a))||h.Object(a)){var o=n[i]===void 0;if(r)r=!1,o&&z(n,i,[]);else if(a._clone&&e!==void 0)if(e)a=a.getRule(),o&&z(n,i,{});else{z(n,i,a._clone());continue}else o&&z(n,i,{});n[i]=ge(n[i],a,e)}else z(n,i,a),h.Undef(a)||(h.Undef(a.__json)||(n[i].__json=a.__json),h.Undef(a.__origin)||(n[i].__origin=a.__origin))}return e!==void 0&&Array.isArray(n)?n.filter(function(u){return!u||!u.__ctrl}):n}function Z(n){return ge({},{value:n}).value}var mr=Object.assign||function(n){for(var t,e=1;e<arguments.length;e++)for(var r in t=arguments[e],t)Object.prototype.hasOwnProperty.call(t,r)&&z(n,r,t[r]);return n};function $(){return mr.apply(this,arguments)}function rt(n){return T(n)!=="object"||n===null?n:n instanceof Array?R(n):_({},n)}var vr='._fc-group{display:flex;flex-direction:column;justify-content:center;min-height:38px;width:100%}._fc-group-disabled ._fc-group-add,._fc-group-disabled ._fc-group-btn{cursor:not-allowed}._fc-group-handle{background-color:#fff;border:1px dashed #d9d9d9;border-radius:15px;bottom:-15px;display:flex;flex-direction:row;padding:3px 8px;position:absolute;right:30px}._fc-group-btn{cursor:pointer}._fc-group-idx{align-items:center;background:#eee;border-radius:15px;bottom:-15px;display:flex;font-weight:700;height:30px;justify-content:center;left:10px;position:absolute;width:30px}._fc-group-handle ._fc-group-btn+._fc-group-btn{margin-left:7px}._fc-group-container{border:1px dashed #d9d9d9;border-radius:5px;display:flex;flex-direction:column;margin:5px 5px 25px;padding:20px 20px 25px;position:relative}._fc-group-arrow{height:20px;position:relative;width:20px}._fc-group-arrow:before{border-left:2px solid #999;border-top:2px solid #999;content:"";height:9px;left:5px;position:absolute;top:8px;transform:rotate(45deg);width:9px}._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group-plus-minus{cursor:pointer;height:20px;position:relative;width:20px}._fc-group-plus-minus:after,._fc-group-plus-minus:before{background-color:#409eff;content:"";height:2px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:60%}._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group-plus-minus._fc-group-minus:after{background-color:#f56c6c}._fc-group-add{border:1px solid rgba(64,158,255,.5);border-radius:15px;cursor:pointer;height:25px;width:25px}._fc-group-add._fc-group-plus-minus:after,._fc-group-add._fc-group-plus-minus:before{width:50%}';we(vr);var gr="fcGroup",yr=W({name:gr,props:{field:String,rule:Array,expand:Number,options:Object,button:{type:Boolean,default:!0},max:{type:Number,default:0},min:{type:Number,default:0},modelValue:{type:Array,default:function(){return[]}},defaultValue:Object,sortBtn:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}},formCreateInject:Object,parse:Function},data:function(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:ce(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler:function(t,e){var r=this;Object.keys(this.cacheRule).forEach(function(i){var a=r.cacheRule[i];if(a.$f){var o=a.$f.formData();if(t===e)a.$f.deferSyncValue(function(){ge(a.rule,t),a.$f.setValue(o)},!0);else{var u=a.$f.formData();a.$f.once("reloading",function(){a.$f.setValue(u)}),a.rule=Z(t)}}})},deep:!0},expand:function(t){var e=t-this.modelValue.length;e>0&&this.expandRule(e)},modelValue:{handler:function(t){var e=this;t=t||[];var r=Object.keys(this.sort),i=r.length,a=i-t.length;if(a<0){for(var o=a;o<0;o++)this.addRule(t.length+o,!0);for(var u=0;u<i;u++)this.setValue(r[u],t[u])}else{if(a>0)for(var s=0;s<a;s++)this.removeRule(r[i-s-1]);t.forEach(function(l,f){e.setValue(r[f],t[f])})}},deep:!0}},methods:{_value:function(t){return t&&k(t,this.field)?t[this.field]:t},cache:function(t,e){this.cacheValue[t]=JSON.stringify(e)},input:function(t){this.$emit("update:modelValue",t),this.$emit("change",t)},formData:function(t,e){var r=this,i=this.cacheRule,a=this.sort;if(a.filter(function(u){return i[u].$f}).length===a.length){var o=a.map(function(u){var s=t===u?e:_({},r.cacheRule[u].$f.form),l=r.field?s[r.field]||null:s;return r.cache(u,l),l});this.input(o)}},setValue:function(t,e){var r=this.field;r&&(e=D({},r,this._value(e))),this.cacheValue[t]!==JSON.stringify(r?e[r]:e)&&this.cache(t,e)},addRule:function(t,e){var r=this,i=this.formCreateInject.form.copyRules(this.rule||[]),a=this.options?_({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){a.formData||(a.formData={});var o=Z(this.defaultValue);$(a.formData,this.field?D({},this.field,o):o)}this.parse&&this.parse({rule:i,options:a,index:this.sort.length}),this.cacheRule[++this.len]={rule:i,options:a},e&&X(function(){return r.$emit("add",i,Object.keys(r.cacheRule).length-1)})},add$f:function(t,e,r){var i=this;this.cacheRule[e].$f=r,X(function(){i.$emit("itemMounted",r,Object.keys(i.cacheRule).indexOf(e))})},removeRule:function(t,e){var r=this,i=Object.keys(this.cacheRule).indexOf(t);delete this.cacheRule[t],delete this.cacheValue[t],e&&X(function(){return r.$emit("remove",i)})},add:function(t){if(!(this.disabled||this.onBeforeAdd(this.modelValue)===!1)){var e=R(this.modelValue);e.push(this.defaultValue?Z(this.defaultValue):this.field?null:{}),this.input(e)}},del:function(t,e){if(!(this.disabled||this.onBeforeRemove(this.modelValue,t)===!1)){this.removeRule(e,!0);var r=R(this.modelValue);r.splice(t,1),this.input(r)}},addIcon:function(t){return y("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon:function(t,e){var r=this;return y("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:function(){return r.del(t,e)}},null)},sortUpIcon:function(t){var e=this;return y("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:function(){return e.changeSort(t,-1)}},null)},sortDownIcon:function(t){var e=this;return y("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:function(){return e.changeSort(t,1)}},null)},changeSort:function(t,e){var r=this.sort[t];this.sort[t]=this.sort[t+e],this.sort[t+e]=r,this.formData(0)},makeIcon:function(t,e,r){var i=this;if(this.$slots.button)return this.$slots.button({total:t,index:e,vm:this,key:r,del:function(){return i.del(e,r)},add:this.add});var a=[];return(!this.max||t<this.max)&&t===e+1&&a.push(this.addIcon(r)),t>this.min&&a.push(this.delIcon(e,r)),this.sortBtn&&e&&a.push(this.sortUpIcon(e)),this.sortBtn&&e!==t-1&&a.push(this.sortDownIcon(e)),a},emitEvent:function(t,e,r,i){this.$emit.apply(this,[t].concat(R(e),[this.cacheRule[i].$f,r]))},expandRule:function(t){for(var e=0;e<t;e++)this.addRule(e)}},created:function(){var t=this;N(function(){return _({},t.cacheRule)},function(i){t.sort=Object.keys(i)},{immediate:!0});for(var e=(this.expand||0)-this.modelValue.length,r=0;r<this.modelValue.length;r++)this.addRule(r);e>0&&this.expandRule(e)},render:function(){var t=this,e=this.sort,r=this.button,i=this.form,a=this.disabled,o=e.length===0?this.$slots.default?this.$slots.default({vm:this,add:this.add}):y("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):e.map(function(u,s){var l=t.cacheRule[u],f=l.rule,c=l.options,d=r&&!a?t.makeIcon(e.length,s,u):[];return y("div",{class:"_fc-group-container",key:u},[y(i,Y({key:u},{disabled:a,"onUpdate:modelValue":function(m){return t.formData(u,m)},"onEmit-event":function(m){for(var C=arguments.length,w=new Array(C>1?C-1:0),E=1;E<C;E++)w[E-1]=arguments[E];return t.emitEvent(m,w,s,u)},"onUpdate:api":function(m){return t.add$f(s,u,m)},inFor:!0,modelValue:t.field?D({},t.field,t._value(t.modelValue[s])):t.modelValue[s],rule:f,option:c,extendOption:!0}),null),y("div",{class:"_fc-group-idx"},[s+1]),d.length?y("div",{class:"_fc-group-handle fc-clock"},[d]):null])});return y("div",{key:"con",class:"_fc-group "+(a?"_fc-group-disabled":"")},[o])}}),_r="fcSubForm",br=W({name:_r,props:{rule:Array,options:{type:Object,default:function(){return Q({submitBtn:!1,resetBtn:!1})}},modelValue:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},syncDisabled:{type:Boolean,default:!0},formCreateInject:Object},data:function(){return{cacheValue:{},subApi:{},form:ce(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue:function(t){this.setValue(t)}},methods:{formData:function(t){this.cacheValue=JSON.stringify(t),this.$emit("update:modelValue",t),this.$emit("change",t)},setValue:function(t){var e=JSON.stringify(t);this.cacheValue!==e&&(this.cacheValue=e,this.subApi.coverValue(t||{}))},add$f:function(t){var e=this;this.subApi=t,X(function(){e.$emit("itemMounted",t)})}},render:function(){var t=this.form;return y(t,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onEmit-event":this.$emit,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),At={name:"IconWarning"},$r={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},Cr=oe("path",{fill:"currentColor",d:"M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"},null,-1),wr=[Cr];function Sr(n,t,e,r,i,a){return ie(),ae("svg",$r,wr)}At.render=Sr;var Or=[An,er,nr,ir,or,hr,yr,br,At];function It(n){return n==null?"":T(n)==="object"?JSON.stringify(n,null,2):String(n)}function me(n){var t=n.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return t.indexOf("-")===0&&(t=t.substr(1)),t}function Vr(n){return n.replace(n[0],n[0].toLocaleUpperCase())}function Pt(n,t,e){return"[form-create ".concat(n,"]: ").concat(t)+(e?`
rule: `+JSON.stringify(e.getRule?e.getRule():e):"")}function He(n,t){console.error(Pt("err",n,t))}function Rr(n){He(n.toString()),console.error(n)}var Be="[[FORM-CREATE-PREFIX-",xe="-FORM-CREATE-SUFFIX]]",it="$FN:",at="$FNX:",ot="$GLOBAL:",pe="function";function jt(n,t){return JSON.stringify(ge(Array.isArray(n)?[]:{},n,!0),function(e,r){if(!(r&&r._isVue===!0)){if(T(r)!==pe)return r;if(r.__json)return r.__json;if(r.__origin&&(r=r.__origin),!r.__emit)return Be+r+xe}},t)}function ut(n){return new Function("return "+n)()}function te(n,t){if(n&&h.String(n)&&n.length>4){var e=n.trim(),r=!1;try{if(e.indexOf(xe)>0&&e.indexOf(Be)===0)e=e.replace(xe,"").replace(Be,""),r=!0;else if(e.indexOf(it)===0)e=e.replace(it,""),r=!0;else if(e.indexOf(ot)===0){var i=e.replace(ot,"");return e=function(){for(var u=arguments.length,s=new Array(u),l=0;l<u;l++)s[l]=arguments[l];var f=s[0].api.getGlobalEvent(i);if(f)return f.call.apply(f,[this].concat(s))},e.__json=n,e.__inject=!0,e}else{if(e.indexOf(at)===0)return e=ut("function($inject){"+e.replace(at,"")+"}"),e.__json=n,e.__inject=!0,e;!t&&e.indexOf(pe)===0&&e!==pe&&(r=!0)}if(!r)return n;var a=ut(e.indexOf(pe)===-1&&e.indexOf("(")!==0?pe+" "+e:e);return a.__json=n,a}catch(o){He("\u89E3\u6790\u5931\u8D25:".concat(e,`
err: `).concat(o));return}}return n}function Er(n,t){return JSON.parse(n,function(e,r){return h.Undef(r)||!r.indexOf?r:te(r,t)})}var Fr=0;function Se(){var n=370+ ++Fr;return"F"+Math.random().toString(36).substr(3,3)+Number("".concat(Date.now())).toString(36)+n.toString(36)+"c"}function ve(n,t,e){var r=n,i;return(t||"").split(".").forEach(function(a){i&&((!r[i]||T(r[i])!="object")&&(r[i]={}),r=r[i]),i=a}),r[i]=e,r}var st=function n(t,e){if(!(!t||t===e)){if(t.props.formCreateInject)return t.props.formCreateInject;if(t.parent)return n(t.parent,e)}};function Ar(n,t,e){return W({name:"FormCreate"+(n.isMobile?"Mobile":""),components:t,directives:e,props:{rule:{type:Array,required:!0,default:function(){return[]}},option:{type:Object,default:function(){return{}}},extendOption:Boolean,modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},api:Object,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","submit","change","emit-event","control","remove-rule","remove-field","sync","reload","repeat-field","update","validate-field-fail","validate-fail","created"],render:function(){return this.fc.render()},setup:function(i){var a=je();cn("parentFC",a);var o=dn("parentFC",null),u=Ze(i),s=u.rule,l=u.modelValue,f=u.subForm,c=u.inFor,d=Q({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:R(s.value||[]),updateValue:JSON.stringify(l.value||{})}),p=new n(a),m=p.api(),C=c.value,w=function(){if(o){var V=st(a,o);if(V){var A;C?(A=L(V.getSubForm()),A.push(m)):A=m,V.subForm(A)}}},E=function(){var V=st(a,o);if(V)if(C){var A=L(V.getSubForm()),P=A.indexOf(m);P>-1&&A.splice(P,1)}else V.subForm()},S=null;return pn(function(){var b="",V=i.option&&i.option.globalClass||{};Object.keys(V).forEach(function(A){var P="";V[A].style&&Object.keys(V[A].style).forEach(function(G){P+=me(G)+":"+V[A].style[G]+";"}),V[A].content&&(P+=V[A].content+";"),P&&(b+=".".concat(A,"{").concat(P,"}"))}),i.option&&i.option.style&&(b+=i.option.style),b&&(S=document.createElement("style"),S.type="text/css",S.innerHTML=b,document.head.appendChild(S))}),hn(function(){p.mounted()}),mn(function(){S&&document.head.removeChild(S),E(),d.destroyed=!0,p.unmount()}),vn(function(){p.updated()}),N(f,function(b){b?w():E()},{immediate:!0}),N(function(){return R(s.value)},function(b){p.$handle.isBreakWatch()||b.length===d.renderRule.length&&b.every(function(V){return d.renderRule.indexOf(V)>-1})||(p.$handle.reloadRule(s.value),a.setupState.renderRule())}),N(function(){return i.option},function(){p.initOptions(),m.refresh()},{deep:!0}),N(function(){return[i.disabled,i.preview]},function(){m.refresh()}),N(l,function(b){JSON.stringify(b||{})!==d.updateValue&&(m.config.forceCoverValue?m.coverValue(b||{}):m.setValue(b||{}))},{deep:!0}),_(_({fc:ce(p),parent:o&&ce(o),fapi:ce(m)},Ze(d)),{},{refresh:function(){++d.unique},renderRule:function(){d.renderRule=R(s.value||[])},updateValue:function(V){if(!d.destroyed){var A=JSON.stringify(V);d.updateValue!==A&&(d.updateValue=A,a.emit("update:modelValue",V))}}})},created:function(){var i=je();i.emit("update:api",i.setupState.fapi),i.setupState.fc.init()}})}var kt=["props"],Dt=["class","style","directives"],Bt=["on"],ne=function n(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=[].concat(kt,R(r.normal||[])),a=[].concat(Dt,R(r.array||[])),o=[].concat(Bt,R(r.functional||[])),u=r.props||[];return t.reduce(function(s,l){for(var f in l)if(s[f])if(u.indexOf(f)>-1)s[f]=n([l[f]],s[f]);else if(i.indexOf(f)>-1)s[f]=_(_({},s[f]),l[f]);else if(a.indexOf(f)>-1){var c=s[f]instanceof Array?s[f]:[s[f]],d=l[f]instanceof Array?l[f]:[l[f]];s[f]=[].concat(R(c),R(d))}else if(o.indexOf(f)>-1)for(var p in l[f])if(s[f][p]){var m=s[f][p]instanceof Array?s[f][p]:[s[f][p]],C=l[f][p]instanceof Array?l[f][p]:[l[f][p]];s[f][p]=[].concat(R(m),R(C))}else s[f][p]=l[f][p];else if(f==="hook")for(var w in l[f])s[f][w]?s[f][w]=Ir(s[f][w],l[f][w]):s[f][w]=l[f][w];else s[f]=l[f];else i.indexOf(f)>-1||o.indexOf(f)>-1||u.indexOf(f)>-1?s[f]=_({},l[f]):a.indexOf(f)>-1?s[f]=l[f]instanceof Array?R(l[f]):T(l[f])==="object"?_({},l[f]):l[f]:s[f]=l[f];return s},e)},Ir=function(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}},Te=["type","slot","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],be=["validate","children","control"],$e=["effect"];function xt(){return[].concat(Te,R(kt),R(Dt),R(Bt),be,$e)}function Tt(n,t){return{value:n,enumerable:!1,configurable:!1,writable:!!t}}function ze(n,t){return Mt([n],t||!1)[0]}function Mt(n,t){return ge([],R(n),t||!1)}function re(n,t){return ne(Array.isArray(t)?t:[t],n,{array:be,normal:$e}),n}function lt(n){var t=h.Function(n.getRule)?n.getRule():n;return t.type||(t.type="input"),t}function Pr(n,t){return n?(Object.keys(t||{}).forEach(function(e){t[e]&&(n[e]=re(n[e]||{},t[e]))}),n):t}function Nt(n,t){Object.defineProperties(n,Object.keys(t).reduce(function(e,r){return e[r]={get:function(){return t[r]()}},e},{}))}function he(n){return n.__fc__||(n.__origin__?n.__origin__.__fc__:null)}function B(n,t){try{t=n()}catch(e){Rr(e)}return t}function Ve(){var n={},t=function(r){return r||"default"};return{setSlot:function(r,i){r=t(r),!(!i||Array.isArray(i)&&i.length)&&(n[r]||(n[r]=[]),n[r].push(i))},getSlot:function(r,i){r=t(r);var a=[];return(n[r]||[]).forEach(function(o){if(Array.isArray(o))a.push.apply(a,R(o));else if(h.Function(o)){var u=o.apply(void 0,R(i||[]));Array.isArray(u)?a.push.apply(a,R(u)):a.push(u)}else h.Undef(o)||a.push(o)}),a},getSlots:function(){var r=this,i={};return Object.keys(n).forEach(function(a){i[a]=function(){for(var o=arguments.length,u=new Array(o),s=0;s<o;s++)u[s]=arguments[s];return r.getSlot(a,u)}}),i},slotLen:function(r){return r=t(r),n[r]?n[r].length:0},mergeBag:function(r){var i=this;if(!r)return this;var a=h.Function(r.getSlots)?r.getSlots():r;return Array.isArray(r)||Ct(r)?this.setSlot(void 0,function(){return r}):Object.keys(a).forEach(function(o){i.setSlot(o,a[o])}),this}}}function ft(n){var t=_({},n.props||{});return Object.keys(n.on||{}).forEach(function(e){var r="on".concat(Vr(e));Array.isArray(t[r])?t[r]=[].concat(R(t[r]),[n.on[e]]):t[r]?t[r]=[t[r],n.on[e]]:t[r]=n.on[e]}),t.key=n.key,t.ref=n.ref,t.class=n.class,t.style=n.style,t.slot&&delete t.slot,t}function jr(n,t){return Object.setPrototypeOf(n,t),n}var ct=function(t,e){return typeof t=="string"?String(e):typeof t=="number"?Number(e):e},se={"==":function(t,e){return JSON.stringify(t)===JSON.stringify(ct(t,e))},"!=":function(t,e){return!se["=="](t,e)},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},on:function(t,e){return t&&t.indexOf&&t.indexOf(ct(t[0],e))>-1},notOn:function(t,e){return!se.on(t,e)},in:function(t,e){return e&&e.indexOf&&e.indexOf(t)>-1},notIn:function(t,e){return!se.in(t,e)},between:function(t,e){return t>e[0]&&t<e[1]},notBetween:function(t,e){return t<e[0]||t>e[1]},empty:function(t){return h.empty(t)},notEmpty:function(t){return!h.empty(t)},pattern:function(t,e){return new RegExp(e,"g").test(t)}};function Lt(){return{props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0}}function M(n,t){return function(e,r,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=new Ge(n,e,r,i,a);return t&&(h.Function(t)?t(o):o.props(t)),o}}function Ge(n,t,e,r,i){this._data=$(Lt(),{type:n,title:t,field:e,value:r,props:i||{}}),this.event=this.on}$(Ge.prototype,{getRule:function(){return this._data},setProp:function(t,e){return z(this._data,t,e),this},modelField:function(t){return this._data.modelField=t,this},_clone:function(){var t=new this.constructor;return t._data=ze(this._data),t}});function Ut(n){n.forEach(function(t){Ge.prototype[t]=function(e){return re(this._data,D({},t,arguments.length<2?e:D({},e,arguments[1]))),this}})}Ut(xt());var kr=M("");function Dr(n,t,e){var r=kr("",t);return r._data.type=n,r._data.title=e,r}function Br(){return{create:Dr,factory:M}}function xr(n,t,e){var r="fail to ".concat(n," ").concat(e.status,"'"),i=new Error(r);return i.status=e.status,i.url=n,i}function dt(n){var t=n.responseText||n.response;if(!t)return t;try{return JSON.parse(t)}catch{return t}}function Ht(n){if(!(typeof XMLHttpRequest>"u")){var t=new XMLHttpRequest,e=n.action;t.onerror=function(o){n.onError(o)},t.onload=function(){if(t.status<200||t.status>=300)return n.onError(xr(e,n,t),dt(t));n.onSuccess(dt(t))},t.open(n.method||"get",e,!0);var r;n.data&&((n.dataType||"").toLowerCase()!=="json"?(r=new FormData,Object.keys(n.data).map(function(a){r.append(a,n.data[a])})):(r=JSON.stringify(n.data),t.setRequestHeader("content-type","application/json"))),n.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var i=n.headers||{};Object.keys(i).forEach(function(a){i[a]!==null&&t.setRequestHeader(a,i[a])}),t.send(r)}}function Tr(n){return new Promise(function(t,e){Ht(_(_({},n),{},{onSuccess:function(i){var a=function(s){return s},o=te(n.parse);h.Function(o)?a=o:o&&h.String(o)&&(a=function(s){return o.split(".").forEach(function(l){s&&(s=s[l])}),s}),t(a(i))},onError:function(i){e(i)}}))})}function de(n){return Z(n)}function Mr(n){function t(a){return h.Undef(a)?a=n.fields():Array.isArray(a)||(a=[a]),a}function e(a,o,u){t(a).forEach(function(s){n.getCtxs(s).forEach(function(l){z(l.rule,o,u),n.$render.clearCache(l)})})}function r(){var a=n.subForm;return Object.keys(a).reduce(function(o,u){var s=a[u];return s&&(Array.isArray(s)?o.push.apply(o,R(s)):o.push(s)),o},[])}var i={get config(){return n.options},set config(a){n.fc.options.value=a},get options(){return n.options},set options(a){n.fc.options.value=a},get form(){return n.form},get rule(){return n.rules},get parent(){return n.vm.setupState.parent&&n.vm.setupState.parent.setupState.fapi},get top(){return i.parent?i.parent.top:i},get children(){return r()},formData:function(o){return t(o).reduce(function(u,s){var l=n.getFieldCtx(s);return l&&(u[l.field]=de(l.rule.value)),u},n.options.appendValue!==!1?de(n.appendData):{})},getValue:function(o){var u=n.getFieldCtx(o);if(!!u)return de(u.rule.value)},coverValue:function(o){var u=_({},o||{});n.deferSyncValue(function(){i.fields().forEach(function(s){var l=n.fieldCtx[s];if(l){var f=k(o,s);l.forEach(function(c){c.rule.value=f?o[s]:void 0}),delete u[s]}}),$(n.appendData,u)})},setValue:function(o){var u=o;arguments.length>=2&&(u=D({},o,arguments[1])),n.deferSyncValue(function(){Object.keys(u).forEach(function(s){var l=n.fieldCtx[s];if(!l)return n.appendData[s]=u[s];l.forEach(function(f){f.rule.value=u[s]})})})},removeField:function(o){var u=n.getCtx(o);return n.deferSyncValue(function(){n.getCtxs(o).forEach(function(s){s.rm()})},!0),u?u.origin:void 0},removeRule:function(o){var u=o&&he(o);if(!!u)return u.rm(),u.origin},fields:function(){return n.fields()},append:function(o,u,s){var l=n.sort.length-1,f,c=n.getCtx(u);if(c)if(s){if(f=c.getPending("children",c.rule.children),!Array.isArray(f))return;l=c.rule.children.length-1}else l=c.root.indexOf(c.origin),f=c.root;else f=n.rules;f.splice(l+1,0,o)},prepend:function(o,u,s){var l=0,f,c=n.getCtx(u);if(c)if(s){if(f=c.getPending("children",c.rule.children),!Array.isArray(f))return}else l=c.root.indexOf(c.origin),f=c.root;else f=n.rules;f.splice(l,0,o)},hidden:function(o,u){e(u,"hidden",!!o),n.refresh()},hiddenStatus:function(o){var u=n.getCtx(o);if(!!u)return!!u.rule.hidden},display:function(o,u){e(u,"display",!!o),n.refresh()},displayStatus:function(o){var u=n.getCtx(o);if(!!u)return!!u.rule.display},disabled:function(o,u){t(u).forEach(function(s){n.getCtxs(s).forEach(function(l){z(l.rule.props,"disabled",!!o)})}),n.refresh()},all:function(o){return Object.keys(n.ctxs).map(function(u){var s=n.ctxs[u];return o?s.origin:s.rule})},model:function(o){return n.fields().reduce(function(u,s){var l=n.fieldCtx[s][0];return u[s]=o?l.origin:l.rule,u},{})},component:function(o){return Object.keys(n.nameCtx).reduce(function(u,s){var l=n.nameCtx[s].map(function(f){return o?f.origin:f.rule});return u[s]=l.length===1?l[0]:l,u},{})},bind:function(){return i.form},reload:function(o){n.reloadRule(o)},updateOptions:function(o){n.fc.updateOptions(o),i.refresh()},onSubmit:function(o){i.updateOptions({onSubmit:o})},sync:function(o){if(Array.isArray(o)){o.forEach(function(s){return i.sync(s)});return}var u=h.Object(o)?he(o):n.getCtxs(o);!u||(u=Array.isArray(u)?u:[u],u.forEach(function(s){if(!s.deleted){var l=n.subForm[s.id];l&&(Array.isArray(l)?l.forEach(function(f){f.refresh()}):l&&l.refresh()),n.$render.clearCache(s)}}),n.refresh())},refresh:function(){r().forEach(function(o){o.refresh()}),n.$render.clearCacheAll(),n.refresh()},refreshOptions:function(){n.$manager.updateOptions(n.options),i.refresh()},hideForm:function(o){n.vm.setupState.isShow=!o},changeStatus:function(){return n.changeStatus},clearChangeStatus:function(){n.changeStatus=!1},updateRule:function(o,u){n.getCtxs(o).forEach(function(s){$(s.rule,u)})},updateRules:function(o){Object.keys(o).forEach(function(u){i.updateRule(u,o[u])})},mergeRule:function(o,u){n.getCtxs(o).forEach(function(s){re(s.rule,u)})},mergeRules:function(o){Object.keys(o).forEach(function(u){i.mergeRule(u,o[u])})},getRule:function(o,u){var s=n.getCtx(o);if(s)return u?s.origin:s.rule},getRenderRule:function(o){var u=n.getCtx(o);if(u)return u.prop},getRefRule:function(o){var u=n.getCtxs(o);if(u){var s=u.map(function(l){return l.rule});return s.length===1?s[0]:s}},setEffect:function(o,u,s){var l=n.getCtx(o);l&&u&&(u[0]==="$"&&(u=u.substr(1)),k(l.rule,"$"+u)&&z(l.rule,"$"+u,s),k(l.rule,"effect")||(l.rule.effect={}),z(l.rule.effect,u,s))},clearEffectData:function(o,u){var s=n.getCtx(o);s&&(u&&u[0]==="$"&&(u=u.substr(1)),s.clearEffectData(u),i.sync(o))},updateValidate:function(o,u,s){s?i.mergeRule(o,{validate:u}):e(o,"validate",u)},updateValidates:function(o,u){Object.keys(o).forEach(function(s){i.updateValidate(s,o[s],u)})},refreshValidate:function(){i.refresh()},resetFields:function(o){t(o).forEach(function(u){n.getCtxs(u).forEach(function(s){n.$render.clearCache(s),s.rule.value=de(s.defaultValue)})})},method:function(o,u){var s=i.el(o);if(!s||!s[u])throw new Error(Pt("err","".concat(u,"\u65B9\u6CD5\u4E0D\u5B58\u5728")));return function(){return s[u].apply(s,arguments)}},exec:function(o,u){for(var s=arguments.length,l=new Array(s>2?s-2:0),f=2;f<s;f++)l[f-2]=arguments[f];return B(function(){return i.method(o,u).apply(void 0,l)})},toJson:function(o){return jt(i.rule,o)},trigger:function(o,u){for(var s=i.el(o),l=arguments.length,f=new Array(l>2?l-2:0),c=2;c<l;c++)f[c-2]=arguments[c];s&&s.$emit.apply(s,[u].concat(f))},el:function(o){var u=n.getCtx(o);if(u)return u.el||n.vm.refs[u.ref]},closeModal:function(o){n.bus.$emit("fc:closeModal:"+o)},getSubForm:function(o){var u=n.getCtx(o);return u?n.subForm[u.id]:void 0},getChildrenRuleList:function(o){var u=T(o)==="object",s=u?he(o):n.getCtx(o),l=s?s.rule:u?o:i.getRule(o);if(!l)return[];var f=[],c=function(p){p&&p.forEach(function(m){T(m)==="object"&&(m.field&&f.push(m),f.push.apply(f,R(i.getChildrenRuleList(m))))})};return c(s?s.loadChildrenPending():l.children),f},getChildrenFormData:function(o){var u=i.getChildrenRuleList(o);return u.reduce(function(s,l){return s[l.field]=de(l.value),s},{})},setChildrenFormData:function(o,u,s){var l=i.getChildrenRuleList(o);l.forEach(function(f){k(u,f.field)?f.value=u[f.field]:s&&(f.value=void 0)})},getGlobalEvent:function(o){var u=i.options.globalEvent[o];if(u)return T(u)==="object"&&(u=u.handle),te(u)},getGlobalData:function(o){return new Promise(function(u,s){var l=i.options.globalData[o];l||u(n.fc.loadData[o]),l.type==="fetch"?i.fetch(l).then(function(f){u(f)}).catch(s):u(l.data)})},nextTick:function(o){n.bus.$once("next-tick",o),n.refresh()},nextRefresh:function(o){n.nextRefresh(),o&&B(o)},deferSyncValue:function(o,u){n.deferSyncValue(o,u)},emit:function(o){for(var u,s=arguments.length,l=new Array(s>1?s-1:0),f=1;f<s;f++)l[f-1]=arguments[f];(u=n.vm).emit.apply(u,[o].concat(l))},bus:n.bus,fetch:function(o){return new Promise(function(u,s){n.beforeFetch(o).then(function(){return Tr(o).then(u).catch(s)})})},getData:function(o,u){return n.fc.getData(o,u)},setData:function(o,u){return n.fc.setData(o,u)},helper:{tidyFields:t,props:e}};return["on","once","off"].forEach(function(a){i[a]=function(){var o;(o=n.bus)["$".concat(a)].apply(o,arguments)}}),i.changeValue=i.changeField=i.setValue,i}function Nr(n){$(n.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){if(!e.rule.cache){if(!this.cache[e.id]){e.parent&&this.clearCache(e.parent);return}(this.cache[e.id].use===!0||this.cache[e.id].parent)&&this.$handle.refresh(),this.cache[e.id].parent&&this.clearCache(this.cache[e.id].parent),this.cache[e.id]=null}},clearCacheAll:function(){this.cache={}},setCache:function(e,r,i){this.cache[e.id]={vnode:r,use:!1,parent:i,slot:e.rule.slot}},getCache:function(e){var r=this.cache[e.id];if(r)return r.use=!0,r.vnode}})}function ee(n){var t=n.replace(/(-[a-z])/g,function(e){return e.replace("-","").toLocaleUpperCase()});return zt(t)}function zt(n){return n.replace(n[0],n[0].toLowerCase())}function Lr(n){$(n.prototype,{initRender:function(){this.cacheConfig={}},getTypeSlot:function(e){var r=function i(a){if(a){var o=void 0;return e.rule.field&&(o=a.slots["field-"+me(e.rule.field)]||a.slots["field-"+e.rule.field]),o||(o=a.slots["type-"+me(e.type)]||a.slots["type-"+e.type]),o||i(a.setupState.parent)}};return r(this.vm)},render:function(){var e=this;if(!!this.vm.setupState.isShow){this.$manager.beforeRender();var r=Ve();return this.sort.forEach(function(i){e.renderSlot(r,e.$handle.ctxs[i])}),this.$manager.render(r)}},renderSlot:function(e,r,i){if(this.isFragment(r)){r.initProp(),this.mergeGlobal(r),r.initNone();var a=this.renderChildren(r.loadChildrenPending(),r),o=a.default;o&&e.setSlot(r.rule.slot,function(){return o()}),delete a.default,e.mergeBag(a)}else e.setSlot(r.rule.slot,this.renderCtx(r,i))},mergeGlobal:function(e){var r=this,i=this.$handle.options.global;!i||(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=un(function(){var a=r.$handle.options.global;return re({},[a["*"],a[e.originType]||a[e.type]||a[e.type]||{}])})),e.prop=re({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions:function(e){var r=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=r,e.prop.optionsTo&&r&&ve(e.prop,e.prop.optionsTo,r)},deepSet:function(e){var r=e.rule.deep;r&&Object.keys(r).sort(function(i,a){return i.length<a.length?-1:1}).forEach(function(i){ve(e.prop,i,r[i])})},parseSide:function(e,r){return h.Object(e)?re({props:{formCreateInject:r.prop.props.formCreateInject}},e):e},renderSides:function(e,r,i){var a=r[i?"rule":"prop"];return[this.renderRule(this.parseSide(a.prefix,r)),e,this.renderRule(this.parseSide(a.suffix,r))]},renderId:function(e,r){var i=this,a=this.$handle[r==="field"?"fieldCtx":"nameCtx"][e];return a?a.map(function(o){return i.renderCtx(o,o.parent)}):void 0},renderCtx:function(e,r){var i=this;try{if(e.type==="hidden")return;var a=e.rule;if(!this.cache[e.id]||this.cache[e.id].slot!==a.slot){var o;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var u=e.prop;u.preview=!!(u.preview!=null?u.preview:this.vm.props.preview!==void 0?this.vm.props.preview:this.options.preview||!1),u.props.formCreateInject=this.injectProp(e);var s=u.cache!==!1,l=u.preview;if(u.hidden){this.setCache(e,void 0,r);return}o=function(){for(var c=arguments.length,d=new Array(c),p=0;p<c;p++)d[p]=arguments[p];var m={rule:a,prop:u,preview:l,api:i.$handle.api,model:u.model||{},slotValue:d};d.length&&a.slotUpdate&&B(function(){return a.slotUpdate(m)});var C={},w=e.loadChildrenPending();e.parser.renderChildren?C=e.parser.renderChildren(w,e):e.parser.loadChildren!==!1&&(C=i.renderChildren(w,e));var E=i.getTypeSlot(e),S;return E?(m.children=C,S=E(m)):S=l?e.parser.preview(rt(C),e):e.parser.render(rt(C),e),S=i.renderSides(S,e),!(!e.input&&h.Undef(u.native))&&u.native!==!0&&(S=i.$manager.makeWrap(e,S)),e.none&&(Array.isArray(S)?S=S.map(function(b){return!b||!b.__v_isVNode?b:i.none(b)}):S=i.none(S)),s&&i.setCache(e,function(){return i.stable(S)},r),S},this.setCache(e,o,r)}return function(){var f=i.getCache(e);if(f)return f.apply(void 0,arguments);if(i.cache[e.id])return;var c=i.renderCtx(e,e.parent);if(c)return c()}}catch(f){console.error(f);return}},none:function(e){if(e)return Array.isArray(e.props.class)?e.props.class.push("fc-none"):e.props.class=e.props.class?[e.props.class,"fc-none"]:"fc-none",e},stable:function(e){var r=this,i=Array.isArray(e)?e:[e];return i.forEach(function(a){a&&a.__v_isVNode&&a.children&&T(a.children)==="object"&&(a.children.$stable=!0,r.stable(a.children))}),e},getModelField:function(e){return e.rule.modelField||e.parser.modelField||this.fc.modelFields[this.vNode.aliasMap[e.type]]||this.fc.modelFields[e.type]||this.fc.modelFields[e.originType]||"modelValue"},isFragment:function(e){return e.type==="fragment"||e.type==="template"},injectProp:function(e){var r=this,i=this.vm.setupState;i.ctxInject[e.id]||(i.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:function(u){r.$handle.addSubForm(e,u)},getSubForm:function(){return r.$handle.subForm[e.id]},options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input});var a=i.ctxInject[e.id];return $(a,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),a},ctxProp:function(e){var r=this,i=e.ref,a=e.key,o=e.rule;this.$manager.mergeProp(e),e.parser.mergeProp(e);var u=[{ref:i,key:o.key||"".concat(a,"fc"),slot:void 0,on:{vnodeMounted:function(c){c.el.__rule__=e.rule,r.onMounted(e,c.el)},"fc.el":function(c){e.exportEl=c,c&&((c.$el||c).__rule__=e.rule)}}}];if(e.input){this.vm.props.disabled===!0&&(e.prop.props.disabled=!0);var s=this.getModelField(e),l={callback:function(c){r.onInput(e,c)},value:this.$handle.getFormData(e)};u.push({on:_(D({},"update:".concat(s),l.callback),e.prop.modelEmit?D({},e.prop.modelEmit,function(){return r.onEmitInput(e)}):{}),props:D({},s,l.value)}),e.prop.model=l}return ne(u,e.prop),e.prop},onMounted:function(e,r){e.el=this.vm.refs[e.ref]||r,e.parser.mounted(e),this.$handle.effect(e,"mounted")},onInput:function(e,r){if(e.prop.modelEmit){this.$handle.onBaseInput(e,r);return}this.$handle.onInput(e,r)},onEmitInput:function(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren:function(e,r){var i=this;if(!h.trueArray(e))return{};var a=Ve();return e.map(function(o){if(!!o){if(h.String(o))return a.setSlot(null,o);if(o.__fc__)return i.renderSlot(a,o.__fc__,r);o.type&&X(function(){i.$handle.loadChildren(e,r),i.$handle.refresh()})}}),a.getSlots()},defaultRender:function(e,r){var i=e.prop;return i.component?this.vNode.makeComponent(i.component,i,r):this.vNode[e.type]?this.vNode[e.type](i,r):this.vNode[e.originType]?this.vNode[e.originType](i,r):this.vNode.make(zt(e.originType),i,r)},renderRule:function(e,r,i){var a=this;if(!!e){if(h.String(e))return e;var o;if(i)o=e.type;else if(o=e.is,e.type){o=ee(e.type);var u=this.vNode.aliasMap[o];u&&(o=ee(u))}if(!!o){var s=Ve();h.trueArray(e.children)&&e.children.forEach(function(f){f&&s.setSlot(f==null?void 0:f.slot,function(){return a.renderRule(f)})});var l=_({},e);return delete l.type,delete l.is,this.vNode.make(o,l,s.mergeBag(r).getSlots())}}}})}var Ur=1;function Ye(n){$(this,{$handle:n,fc:n.fc,vm:n.vm,$manager:n.$manager,vNode:new n.fc.CreateNode(n.vm),id:Ur++}),Nt(this,{options:function(){return n.options},sort:function(){return n.sort}}),this.initCache(),this.initRender()}Nr(Ye);Lr(Ye);function Hr(n){$(n.prototype,{parseInjectEvent:function(e,r){var i=e.inject||this.options.injectEvent;return this.parseEventLst(e,r,i)},parseEventLst:function(e,r,i,a){var o=this;return Object.keys(r).forEach(function(u){var s=o.parseEvent(e,r[u],i,a);s&&(r[u]=s)}),r},parseEvent:function(e,r,i,a){if(h.Function(r)&&(i!==!1&&!h.Undef(i)||r.__inject))return this.inject(e,r,i);if(!a&&Array.isArray(r)&&r[0]&&(h.String(r[0])||h.Function(r[0])))return this.parseEventLst(e,r,i,!0);if(h.String(r)){var o=te(r);if(o&&r!==o)return o.__inject?this.parseEvent(e,o,i,!0):o}},parseEmit:function(e){var r=this,i={},a=e.rule,o=a.emitPrefix,u=a.field,s=a.name,l=a.inject,f=a.emit||[];return h.trueArray(f)&&f.forEach(function(c){if(!!c){var d,p=o||u||s;if(h.Object(c)&&(d=c.inject,c=c.name,p=c.prefix||p),p){var m=me("".concat(p,"-").concat(c)),C=function(){var S,b,V;r.vm.emitsOptions&&(r.vm.emitsOptions[m]=null);for(var A=arguments.length,P=new Array(A),G=0;G<A;G++)P[G]=arguments[G];(S=r.vm).emit.apply(S,[m].concat(P)),(b=r.vm).emit.apply(b,["emit-event",m].concat(P)),(V=r.bus).$emit.apply(V,[m].concat(P))};if(C.__emit=!0,!d&&l===!1)i[c]=C;else{var w=d||l||r.options.injectEvent;i[c]=h.Undef(w)?C:r.inject(a,C,w)}}}}),e.computed.on=i,i},getInjectData:function(e,r){var i=this.vm.props,a=i.option,o=i.rule;return{$f:this.api,api:this.api,rule:o,self:e.__origin__,option:a,inject:r}},inject:function(e,r,i){if(r.__origin){if(this.watching&&!this.loading)return r;r=r.__origin}var a=this,o=function(){for(var s=a.getInjectData(e,i),l=arguments.length,f=new Array(l),c=0;c<l;c++)f[c]=arguments[c];return s.args=[].concat(f),f.unshift(s),r.apply(this,f)};return o.__origin=r,o.__json=r.__json,o}})}var pt=["hook:updated","hook:mounted"];function zr(n){$(n.prototype,{usePage:function(){var e=this,r=this.options.page;if(!!r){var i=25,a=Gr(this.rules);h.Object(r)&&(r.first&&(i=parseInt(r.first,10)||i),r.limit&&(a=parseInt(r.limit,10)||a)),$(this,{first:i,limit:a,pageEnd:this.rules.length<=i}),this.bus.$on("page-end",function(){return e.vm.emit("page-end",e.api)}),this.pageLoad()}},pageLoad:function(){var e=this,r=function i(){e.pageEnd?(e.bus.$off(pt,i),e.bus.$emit("page-end")):(e.first+=e.limit,e.pageEnd=e.rules.length<=e.first,e.loadRule(),e.refresh())};this.bus.$on(pt,r)}})}function Gr(n){return n.length<31?31:Math.ceil(n.length/3)}function Yr(n){$(n.prototype,{clearNextTick:function(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick:function(e){var r=this;this.clearNextTick(),this.nextTick=setTimeout(function(){e(),r.nextTick=null},10)},render:function(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}function qr(n){Object.defineProperties(n.origin,{__fc__:Tt(ce(n),!0)})}function Gt(n,t,e){var r=Se(),i=!!t.field;$(this,{id:r,ref:r,wrapRef:r+"fi",rule:t,origin:t.__origin__||t,name:t.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:t.subRule?this:null,cacheConfig:null,prop:_({},t),computed:{},payload:{},refRule:{},input:i,el:void 0,exportEl:void 0,defaultValue:i?Z(e):void 0,field:t.field||void 0}),this.updateType(),this.updateKey(),qr(this),this.update(n,!0)}$(Gt.prototype,{getParentGroup:function(){for(var t=this.parent;t;){if(t.group)return t;t=t.parent}},loadChildrenPending:function(){var t=this,e=this.rule.children||[];return Array.isArray(e)?e:this.loadPending({key:"children",origin:e,def:[],onLoad:function(i){t.$handle&&t.$handle.loadChildren(i,t)},onUpdate:function(i,a){t.$handle&&(i===a?t.$handle.loadChildren(i,t):t.$handle.updateChildren(t,i,a))},onReload:function(i){t.$handle?t.$handle.updateChildren(t,[],i):delete t.pending.children}})},loadPending:function(t){var e=this,r=t.key,i=t.origin,a=t.def,o=t.onLoad,u=t.onReload,s=t.onUpdate;if(this.pending[r]&&this.pending[r].origin===i)return this.getPending(r,a);delete this.pending[r];var l=i;if(h.Function(i)){var f=B(function(){return i({rule:e.rule,api:e.$api,update:function(d){var p=d||a,m=e.getPending(r,a);e.setPending(r,i,p),s&&s(p,m)},reload:function(){var d=e.getPending(r,a);delete e.pending[r],u&&u(d),e.$api&&e.$api.sync(e.rule)}})});f&&h.Function(f.then)?(f.then(function(c){var d=c||a;e.setPending(r,i,d),o&&o(d),e.$api&&e.$api.sync(e.rule)}).catch(function(c){console.error(c)}),l=a,this.setPending(r,i,l)):(l=f||a,this.setPending(r,i,l),o&&o(l))}return l},getPending:function(t,e){return this.pending[t]&&this.pending[t].value||e},setPending:function(t,e,r){this.pending[t]={origin:e,value:Q(r)}},effectData:function(t){return this.payload[t]||(this.payload[t]={}),this.payload[t]},clearEffectData:function(t){t===void 0?this.payload={}:delete this.payload[t]},updateKey:function(t){this.key=Se(),t&&this.parent&&this.parent.updateKey(t)},updateType:function(){this.originType=this.rule.type,this.type=ee(this.rule.type)},setParser:function(t){this.parser=t,t.init(this)},initProp:function(){var t=this,e=_({},this.rule);delete e.children,this.prop=re({},[e].concat(R(Object.keys(this.payload).map(function(r){return t.payload[r]})),[this.computed]))},initNone:function(){this.none=!(h.Undef(this.prop.display)||!!this.prop.display)},injectValidate:function(){var t=this;return L(this.prop.validate).map(function(e){if(h.Function(e.validator)){var r=_({},e),i=t;return r.validator=function(){for(var a,o=arguments.length,u=new Array(o),s=0;s<o;s++)u[s]=arguments[s];return(a=e.validator).call.apply(a,[{that:this,id:i.id,field:i.field,rule:i.rule,api:i.$handle.api}].concat(u))},r}return e})},check:function(t){return this.vm===t.vm},unwatch:function(){this.watch.forEach(function(t){return t()}),this.watch=[],this.refRule={}},unlink:function(){this.linkOn.forEach(function(t){return t()}),this.linkOn=[]},link:function(){this.unlink(),this.$handle.appendLink(this)},watchTo:function(){this.$handle.watchCtx(this)},delete:function(){var t=void 0;this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),$(this,{deleted:!0,prop:_({},this.rule),computed:{},el:t,$handle:t,$render:t,$api:t,vm:t,vNode:t,parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl:function(){this.ctrlRule.forEach(function(t){return t.__fc__&&t.__fc__.rm()}),this.ctrlRule=[]},rm:function(){var t=this,e=function(){var i=t.root.indexOf(t.origin);i>-1&&(t.root.splice(i,1),t.$handle&&t.$handle.refresh())};if(this.deleted){e();return}this.$handle.noWatch(function(){t.$handle.deferSyncValue(function(){t.rmCtrl(),e(),t.$handle.rmCtx(t),$(t,{root:[]})},t.input)})},update:function(t,e){$(this,{deleted:!1,$handle:t,$render:t.$render,$api:t.api,vm:t.vm,trueType:t.getType(this.originType),vNode:t.$render.vNode,updated:!1,cacheValue:this.rule.value}),!e&&this.unwatch(),this.watchTo(),this.link()}});function Wr(n){$(n.prototype,{nextRefresh:function(e){var r=this,i=this.loadedId;X(function(){i===r.loadedId&&(e?e():r.refresh())})},parseRule:function(e){var r=this,i=lt(e);return Object.defineProperties(i,{__origin__:Tt(e,!0)}),Jr(i),this.appendValue(i),[i,i.prefix,i.suffix].forEach(function(a){!a||r.loadFn(a,i)}),this.loadCtrl(i),i.update&&(i.update=te(i.update)),i},loadFn:function(e,r){var i=this;["on","props","deep"].forEach(function(a){e[a]&&i.parseInjectEvent(r,e[a])})},loadCtrl:function(e){e.control&&e.control.forEach(function(r){r.handle&&(r.handle=te(r.handle))})},syncProp:function(e){var r=this,i=e.rule;h.trueArray(i.sync)&&ne([{on:i.sync.reduce(function(a,o){return a["update:".concat(o)]=function(u){i.props[o]=u,r.vm.emit("sync",o,u,i,r.fapi)},a},{})}],e.computed)},loadRule:function(){var e=this;this.cycleLoad=!1,this.loading=!0,this.pageEnd&&this.bus.$emit("load-start"),this.deferSyncValue(function(){if(e._loadRule(e.rules),e.loading=!1,e.cycleLoad&&e.pageEnd)return e.loadRule();e.syncForm(),e.pageEnd&&e.bus.$emit("load-end"),e.vm.setupState.renderRule()})},loadChildren:function(e,r){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,r),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(r)},_loadRule:function(e,r){var i=this,a=function s(l){var f=e[l-1];if(!f||!f.__fc__)return l>0?s(l-1):-1;var c=i.sort.indexOf(f.__fc__.id);return c>-1?c:s(l-1)},o=function(l,f){h.trueArray(l)&&i._loadRule(l,f)},u=e.map(function(s,l){if(!(r&&!h.Object(s))&&!(!i.pageEnd&&!r&&l>=i.first)){if(s.__fc__&&s.__fc__.root===e&&i.ctxs[s.__fc__.id])return o(s.__fc__.loadChildrenPending(),s.__fc__),s.__fc__;var f=lt(s),c=function(){return!!(f.field&&i.fieldCtx[f.field]&&i.fieldCtx[f.field][0]!==s.__fc__)};i.ruleEffect(f,"init",{repeat:c()}),c()&&i.vm.emit("repeat-field",s,i.api);var d,p=!1,m=!!s.__fc__,C=f.value;if(m){d=s.__fc__,C=d.defaultValue;var w=!d.check(i);if(d.deleted){if(w){if(ht(d))return;d.update(i)}}else if(w){if(ht(d))return;e[l]=s=s._clone?s._clone():ze(s),d=null,p=!0}}if(d)d.originType!==d.rule.type&&(d.updateType(),i.bindParser(d)),i.appendValue(d.rule),d.parent&&d.parent!==r&&i.rmSubRuleData(d);else{var E=i.parseRule(s);d=new Gt(i,E,C),i.bindParser(d)}i.parseEmit(d),i.syncProp(d),d.parent=r||null,d.root=e,i.setCtx(d),!p&&!m&&i.effect(d,"load"),i.effect(d,"created");var S=d.loadChildrenPending();if(d.parser.loadChildren===!1||o(S,d),!r){var b=a(l);b>-1||!l?i.sort.splice(b+1,0,d.id):i.sort.push(d.id)}var V=d.rule;return d.updated||(d.updated=!0,h.Function(V.update)&&i.bus.$once("load-end",function(){i.refreshUpdate(d,V.value,"init")}),i.effect(d,"loaded")),i.refreshControl(d)&&(i.cycleLoad=!0),d}}).filter(function(s){return!!s});r&&(r.children=u)},refreshControl:function(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl:function(e){var r=this,i=Kr(e),a=[],o=this.api;if(!i.length)return!1;for(var u=function(p){var m=i[p],C=m.handle||function(E){return(se[m.condition||"=="]||se["=="])(E,m.value)};if(!h.trueArray(m.rule))return"continue";var w=_(_({},m),{},{valid:B(function(){return C(e.rule.value,o)}),ctrl:Xr(e,m.rule),isHidden:h.String(m.rule[0])});if(w.valid&&w.ctrl||!w.valid&&!w.ctrl&&!w.isHidden)return"continue";a.push(w)},s=0;s<i.length;s++)var l=u(s);if(!a.length)return!1;var f=[],c=!1;return this.deferSyncValue(function(){a.reverse().forEach(function(d){var p=d.isHidden,m=d.valid,C=d.rule,w=d.prepend,E=d.append,S=d.child,b=d.ctrl,V=d.method;if(p){m?e.ctrlRule.push({__ctrl:!0,children:C,valid:m}):e.ctrlRule.splice(e.ctrlRule.indexOf(b),1),f[m?"push":"unshift"](function(){V==="disabled"?r.api.disabled(!m,C):V==="display"?r.api.display(m,C):V==="required"?(C.forEach(function(G){r.api.setEffect(G,"required",m)}),m||r.api.clearValidateState(C)):r.api.hidden(!m,C)});return}if(m){c=!0;var A={type:"fragment",native:!0,__ctrl:!0,children:C};e.ctrlRule.push(A),r.bus.$once("load-start",function(){w?o.prepend(A,w,S):E||S?o.append(A,E||e.id,S):e.root.splice(e.root.indexOf(e.origin)+1,0,A)})}else{e.ctrlRule.splice(e.ctrlRule.indexOf(b),1);var P=he(b);P&&P.rm()}})}),f.length&&X(function(){f.forEach(function(d){return d()})}),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),c},reloadRule:function(e){return this._reloadRule(e)},_reloadRule:function(e){var r=this;e||(e=this.rules);var i=_({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue(function(){r.bus.$once("load-end",function(){Object.keys(i).filter(function(a){return r.ctxs[a]===void 0}).forEach(function(a){return r.rmCtx(i[a])}),r.$render.clearCacheAll()}),r.reloading=!0,r.loadRule(),r.reloading=!1,r.refresh(),r.bus.$emit("reloading",r.api)}),this.bus.$off("next-tick",this.nextReload),this.bus.$once("next-tick",this.nextReload),this.bus.$emit("update",this.api)},refresh:function(){this.vm.setupState.refresh()}})}function Jr(n){var t=Lt();return Object.keys(t).forEach(function(e){k(n,e)||(n[e]=t[e])}),n}function Kr(n){var t=n.rule.control||[];return h.Object(t)?[t]:t}function Xr(n,t){for(var e=0;e<n.ctrlRule.length;e++){var r=n.ctrlRule[e];if(r.children===t)return r}}function ht(n){return!!n.rule.__ctrl}function Qr(n){$(n.prototype,{setValue:function(e,r,i,a){e.deleted||(e.rule.value=r,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,i),this.syncValue(),this.valueChange(e,r),this.vm.emit("change",e.field,r,e.origin,this.api,a||!1),this.effect(e,"value"),this.emitEvent("change",e.field,r,{rule:e.origin,api:this.api,setFlag:a||!1}))},onInput:function(e,r){var i;e.input&&(this.isQuote(e,i=e.parser.toValue(r,e))||this.isChange(e,r))&&this.setValue(e,i,r)},onBaseInput:function(e,r){this.setFormData(e,r),e.modelValue=r,this.nextRefresh(),this.$render.clearCache(e)},setFormData:function(e,r){e.modelValue=r;var i=e.getParentGroup();i&&(this.subRuleData[i.id]||(this.subRuleData[i.id]={}),this.subRuleData[i.id][e.field]=e.rule.value),z(this.formData,e.id,r)},rmSubRuleData:function(e){var r=e.getParentGroup();r&&this.subRuleData[r.id]&&delete this.subRuleData[r.id][e.field]},getFormData:function(e){return this.formData[e.id]},syncForm:function(){var e=this,r=Q({});this.fields().reduce(function(i,a){var o=e.getCtx(a);return i[a]=U(o.rule,"value"),i},r),this.form=r,this.syncValue()},appendValue:function(e){!e.field||!k(this.appendData,e.field)||(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm:function(e,r){this.subForm[e.id]=r},deferSyncValue:function(e,r){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=r),B(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncValue())},syncValue:function(){if(this.deferSyncFn)return this.deferSyncFn.sync=!0;this.vm.setupState.updateValue(_(_({},this.options.appendValue!==!1?this.appendData:{}),this.form))},isChange:function(e,r){return JSON.stringify(this.getFormData(e),mt)!==JSON.stringify(r,mt)},isQuote:function(e,r){return(h.Object(r)||Array.isArray(r))&&r===e.rule.value},refreshUpdate:function(e,r,i,a){var o=this;if(h.Function(e.rule.update)){var u=B(function(){return e.rule.update(r,e.origin,o.api,{origin:i||"change",linkField:a})});if(u===void 0)return;e.rule.hidden=u===!0}},valueChange:function(e,r){this.refreshRule(e,r),this.bus.$emit("change-"+e.field,r)},refreshRule:function(e,r,i,a){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,r,i,a)},appendLink:function(e){var r=this,i=e.rule.link;h.trueArray(i)&&i.forEach(function(a){var o=function(){return r.refreshRule(e,e.rule.value,"link",a)};r.bus.$on("change-"+a,o),e.linkOn.push(function(){return r.bus.$off("change-"+a,o)})})},fields:function(){return Object.keys(this.fieldCtx)}})}function mt(n,t){return typeof t=="function"?""+t:t}var Me={init:function(t){},toFormValue:function(t,e){return t},toValue:function(t,e){return t},mounted:function(t){},render:function(t,e){return e.$render.defaultRender(e,t)},preview:function(t,e){return this.render(t,e)},mergeProp:function(t){}},Zr=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"];function ei(n){$(n.prototype,{getCtx:function(e){return this.getFieldCtx(e)||this.getNameCtx(e)[0]||this.ctxs[e]},getCtxs:function(e){return this.fieldCtx[e]||this.nameCtx[e]||(this.ctxs[e]?[this.ctxs[e]]:[])},setIdCtx:function(e,r,i){var a="".concat(i,"Ctx");this[a][r]?this[a][r].push(e):this[a][r]=[e]},rmIdCtx:function(e,r,i){var a="".concat(i,"Ctx"),o=this[a][r];if(!o)return!1;var u=o.splice(o.indexOf(e)>>>0,1).length>0;return o.length||delete this[a][r],u},getFieldCtx:function(e){return(this.fieldCtx[e]||[])[0]},getNameCtx:function(e){return this.nameCtx[e]||[]},setCtx:function(e){var r=e.id,i=e.field,a=e.name,o=e.rule;this.ctxs[r]=e,a&&this.setIdCtx(e,a,"name"),e.input&&(this.setIdCtx(e,i,"field"),this.setFormData(e,e.parser.toFormValue(o.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,o.value,e.origin,this.api))},getParser:function(e){var r=this.fc.parsers;return r[e.originType]||r[ee(e.type)]||r[e.trueType]||Me},bindParser:function(e){e.setParser(this.getParser(e))},getType:function(e){var r=this.fc.CreateNode.aliasMap,i=r[e]||r[ee(e)]||e;return ee(i)},noWatch:function(e){this.noWatchFn||(this.noWatchFn=e),B(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx:function(e){var r=this,i=xt();if(i.filter(function(o){return o[0]!=="_"&&o[0]!=="$"&&Zr.indexOf(o)===-1}).forEach(function(o){var u=U(e.rule,o),s=o==="children";e.refRule[o]=u,e.watch.push(N(s?function(){return h.Function(u.value)?u.value:R(u.value||[])}:function(){return u.value},function(l,f){var c=u.value;if(!r.isBreakWatch()){if(s&&e.parser.loadChildren===!1){r.$render.clearCache(e),r.nextRefresh();return}if(r.watching=!0,o==="link"){e.link();return}else["props","on","deep"].indexOf(o)>-1?(r.parseInjectEvent(e.rule,c||{}),o==="props"&&e.input&&r.setFormData(e,e.parser.toFormValue(e.rule.value,e))):o==="emit"?r.parseEmit(e):o==="hidden"&&Boolean(c)!==Boolean(f)?r.$render.clearCacheAll():["prefix","suffix"].indexOf(o)>-1?c&&r.loadFn(c,e.rule):o==="type"?(e.updateType(),r.bindParser(e)):s&&(h.Function(f)&&(f=e.getPending("children",[])),h.Function(c)&&(c=e.loadChildrenPending()),r.updateChildren(e,c,f));r.$render.clearCache(e),r.refresh(),r.watching=!1}},{deep:!s,sync:s}))}),e.input){var a=U(e.rule,"value");e.watch.push(N(function(){return a.value},function(){var o=e.parser.toFormValue(a.value,e);r.isChange(e,o)&&r.setValue(e,a.value,o,!0)}))}this.bus.$once("load-end",function(){var o=e.rule.computed;!o||(T(o)!=="object"&&(o={value:o}),Object.keys(o).forEach(function(u){e.watch.push(N(function(){var s=o[u];if(!!s){var l;if(T(s)==="object"){var f=e.getParentGroup(),c=function p(m){if(m=Array.isArray(m)?{mode:"AND",group:m}:m,!h.trueArray(m.group))return!0;for(var C=m.mode==="OR",w=!0,E=0;E<m.group.length;E++){var S=m.group[E],b=void 0;if(S.mode?b=p(S):se[S.condition]?b=new Function("_$","_$val","top","group","with(top){with(this){with(group){ return _$['".concat(S.condition,"'](").concat(S.field,", ").concat(S.compare?S.compare:"_$val","); }}}")).call(r.api.form,se,S.value,r.api.top.form,f?r.subRuleData[f.id]||{}:{}):b=!1,C&&b)return!0;C||(w=w&&b)}return C?!1:w};return c(s)}else if(h.Function(s))l=function(){return s(r.api.form,r.api)};else{var d=e.getParentGroup();l=function(){return new Function("formulas","top","group","$rule","$api","with(top){with(this){with(group){with(formulas){ return ".concat(s," }}}}")).call(r.api.form,r.fc.formulas,r.api.top.form,d?r.subRuleData[d.id]||{}:{},e.rule,r.api)}}return B(l,void 0)}},function(s){setTimeout(function(){u==="value"?r.onInput(e,s):u[0]==="$"?r.api.setEffect(e.id,u,s):ve(e.rule,u,s)})},{immediate:!0}))}))}),this.watchEffect(e)},updateChildren:function(e,r,i){var a=this;this.deferSyncValue(function(){i&&i.forEach(function(o){(r||[]).indexOf(o)===-1&&o&&!h.String(o)&&o.__fc__&&o.__fc__.parent===e&&o.__fc__.root!==r&&a.rmCtx(o.__fc__)}),h.trueArray(r)&&(a.loadChildren(r,e),a.bus.$emit("update",a.api))})},rmSub:function(e){var r=this;h.trueArray(e)&&e.forEach(function(i){i&&i.__fc__&&r.rmCtx(i.__fc__)})},rmCtx:function(e){var r=this;if(!e.deleted){var i=e.id,a=e.field,o=e.input,u=e.name;ue(this.ctxs,i),ue(this.formData,i),ue(this.subForm,i),ue(this.vm.setupState.ctxInject,i);var s=e.getParentGroup();s&&this.subRuleData[s.id]&&ue(this.subRuleData[s.id],a),e.group&&ue(this.subRuleData,i),o&&this.rmIdCtx(e,a,"field"),u&&this.rmIdCtx(e,u,"name"),o&&!k(this.fieldCtx,a)&&ue(this.form,a),this.deferSyncValue(function(){if(!r.reloading){if(e.parser.loadChildren!==!1){var f=e.getPending("children",e.rule.children);h.trueArray(f)&&f.forEach(function(c){return c.__fc__&&r.rmCtx(c.__fc__)})}e.root===r.rules&&r.vm.setupState.renderRule()}},o);var l=this.sort.indexOf(i);return l>-1&&this.sort.splice(l,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),o&&!this.fieldCtx[a]&&this.vm.emit("remove-field",a,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}}})}function ti(n){$(n.prototype,{mounted:function(){var e=this,r=function(){e.isMounted=!0,e.lifecycle("mounted")};this.pageEnd?r():this.bus.$once("page-end",r)},lifecycle:function(e){this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent:function(e){for(var r,i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];var u=this.options[e]||this.options[ee("on-"+e)];if(u){var s=te(u);h.Function(s)&&B(function(){return s.apply(void 0,a)})}(r=this.bus).$emit.apply(r,[e].concat(a))}})}function ni(n){$(n.prototype,{useProvider:function(){var e=this,r=this.fc.providers;Object.keys(r).forEach(function(i){var a=r[i];h.Function(a)&&(a=a(e.fc)),a._c=ii(a),e.onEffect(a),e.providers[i]=a})},onEffect:function(e){var r=this,i=[];(e._c||["*"]).forEach(function(a){var o=a==="*"?"*":r.getType(a);i.indexOf(o)>-1||(i.push(o),r.bus.$on("p:".concat(e.name,":").concat(o,":").concat(e.input?1:0),function(u,s){e[u]&&e[u].apply(e,R(s))}))}),e._used=i},watchEffect:function(e){var r=this,i={required:function(){var o,u;return(k(e.rule,"$required")?e.rule.$required:(o=e.rule)===null||o===void 0||(u=o.effect)===null||u===void 0?void 0:u.required)||!1}};Object.keys(e.rule.effect||{}).forEach(function(a){i[a]=function(){return e.rule.effect[a]}}),Object.keys(e.rule).forEach(function(a){a[0]==="$"&&(i[a.substr(1)]=function(){return e.rule[a]})}),Object.keys(i).forEach(function(a){e.watch.push(N(i[a],function(o){r.effect(e,"watch",D({},a,o))},{deep:!0}))})},ruleEffect:function(e,r,i){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},r,i)},effect:function(e,r,i){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:i},r)},getEffect:function(e,r){if(k(e,"$"+r))return e["$"+r];if(k(e,"effect")&&k(e.effect,r))return e.effect[r]},emitEffect:function(e,r,i){var a=this,o=e.ctx,u=e.rule,s=e.input,l=e.type,f=e.custom;if(!(!l||["fcFragment","fragment"].indexOf(l)>-1)){var c=f||Object.keys(u).reduce(function(d,p){return p[0]==="$"&&(d[p.substr(1)]=u[p]),d},_({},u.effect||{}));Object.keys(c).forEach(function(d){var p=a.providers[d];if(!(!p||p.input&&!s)){var m;if(!p._c)m="*";else if(p._used.indexOf(l)>-1)m=l;else return;var C=_({value:c[d],getValue:function(){return a.getEffect(u,d)}},i||{});o&&(C.getProp=function(){return o.effectData(d)},C.clearProp=function(){return o.clearEffectData(d)},C.mergeProp=function(w){return re(C.getProp(),[w])},C.id=o.id),a.bus.$emit("p:".concat(d,":").concat(m,":").concat(p.input?1:0),r,[C,u,a.api])}})}}})}function ri(n){return n.filter(function(t,e,r){return r.indexOf(t,0)===e})}function ii(n){var t=n.components;if(Array.isArray(t)){var e=ri(t.filter(function(r){return r!=="*"}));return e.length?e:!1}else return h.String(t)?[t]:!1}function J(n){var t=this;Nt(this,{options:function(){return n.options.value||{}},bus:function(){return n.bus}}),$(this,{fc:n,vm:n.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:Q({}),subRuleData:Q({}),subForm:{},form:Q({}),appendData:{},providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:function(){t.lifecycle("reload")}}),this.initData(n.rules),this.$manager=new n.manager(this),this.$render=new Ye(this),this.api=n.extendApiFn.reduce(function(e,r){return $(e,B(function(){return r(e,t)},{})),e},Mr(this))}$(J.prototype,{initData:function(t){$(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:t})},init:function(){this.appendData=_(_(_({},this.options.formData||{}),this.fc.vm.props.modelValue||{}),this.appendData),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},isBreakWatch:function(){return this.loading||this.noWatchFn||this.reloading},beforeFetch:function(t){var e=this;return new Promise(function(r){var i=e.options.beforeFetch&&B(function(){return e.options.beforeFetch(t,{api:e.api})});i&&h.Function(i.then)?i.then(r):r()})}});Hr(J);zr(J);Yr(J);Wr(J);Qr(J);ei(J);ti(J);ni(J);var ai="fcFragment",Re=W({name:ai,inheritAttrs:!1,props:["vnode"],render:function(){return this.vnode}});function oi(n){return Object.keys(n).map(function(t){var e=n[t],r=gn(t);if(!!r)return[r,e.value,e.arg,e.modifiers]}).filter(function(t){return!!t})}function vt(n,t){var e=n.directives;return e?(Array.isArray(e)||(e=[e]),sn(t,e.reduce(function(r,i){return r.concat(oi(i))},[]))):t}function ui(){var n={};function t(){}return $(t.prototype,{make:function(r,i,a){return vt(i,this.h(r,ft(i),a))},makeComponent:function(r,i,a){try{return vt(i,y(r,ft(i),a))}catch(o){return console.error(o),y("")}},h:function(r,i,a){var o=je().appContext.config.isNativeTag(r);o&&delete i.formCreateInject;try{return y(o?r:F(r),i,a)}catch(u){return console.error(u),y("")}},aliasMap:n}),$(t,{aliasMap:n,alias:function(r,i){n[r]=i},use:function(r){Object.keys(r).forEach(function(i){var a=me(i),o=It(i).toLocaleLowerCase(),u=r[i];[i,a,o].forEach(function(s){t.alias(i,u),t.prototype[s]=function(l,f){return this.make(u,l,f)}})})}}),t}function si(n){var t=function(e){bn(i,e);var r=Sn(i);function i(){return _n(this,i),r.apply(this,arguments)}return i}(Yt);return Object.assign(t.prototype,n),t}function Yt(n){$(this,{$handle:n,vm:n.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}$(Yt.prototype,{__init:function(){var t=this;this.$render=this.$handle.$render,this.$r=function(){var e;return(e=t.$render).renderRule.apply(e,arguments)}},updateKey:function(){this.key=Se()},init:function(){},update:function(){},beforeRender:function(){},form:function(){return this.vm.refs[this.ref]},getSlot:function(t){var e=function r(i){if(i){var a=i.slots[t];return a||r(i.setupState.parent)}};return e(this.vm)},mergeOptions:function(t,e){var r=this;return ne(t.map(function(i){return r.tidyOptions(i)}),e,this.mergeOptionsRule)},updateOptions:function(t){this.options=this.mergeOptions([t],this.getDefaultOptions()),this.update()},tidyOptions:function(t){return t},tidyRule:function(t){},mergeProp:function(t){},getDefaultOptions:function(){return{}},render:function(t){}});var li=function(t){var e={name:"loadData",_fn:[],created:function(i,a,o){this.deleted(i);var u=L(i.getValue()),s=[];u.forEach(function(l){if(l){var f=function c(){l.watch!==!1&&(t.bus.$off("p.loadData."+l.attr,c),t.bus.$once("p.loadData."+l.attr,c));var d=void 0;l.attr&&(d=t.loadData[l.attr]||l.default,l.copy!==!1&&(d=Z(d))),ve(i.getProp(),l.to||"options",d),o.sync(a)};s.push(function(){return t.bus.$off("p.loadData."+l.attr,f)}),f()}}),this._fn[i.id]=s},deleted:function(i){this._fn[i.id]&&this._fn[i.id].forEach(function(a){a()}),i.clearProp()}};return e.watch=e.created,e},Ne={name:"componentValidate",load:function(t,e,r){var i=t.getValue();i?t.getProp().validate=[{validator:function(){var o=he(e);if(o){for(var u=arguments.length,s=new Array(u),l=0;l<u;l++)s[l]=arguments[l];return r.exec.apply(r,[o.id,i===!0?"formCreateValidate":i].concat(s,[{attr:t,rule:e,api:r}]))}}}]:(t.clearProp(),r.clearValidateState([e.field]))},watch:function(){Ne.load.apply(Ne,arguments)}},fi=function(t){function e(i){return h.String(i)&&(i={action:i,to:"options"}),i}function r(i,a,o){var u=i.value;h.Function(u)&&(u=u(a,o)),u=e(u);var s=function(m){m===void 0?i.clearProp():ve(i.getProp(),u.to||"options",m),o.sync(a)};if(!u||!u.action&&!u.key){s(void 0);return}if(u=Z(u),u.to||(u.to="options"),u.key){var l=t.$handle.options.globalData[u.key];if(!l){s(void 0);return}if(l.type==="static"){s(l.data);return}else u=_(_({},u),l)}var f=u.onError,c=function(){if(!i.getValue())return i.clearProp(),o.sync(a),!0},d=_(_({headers:{}},u),{},{onSuccess:function(m,C){if(!c()){var w=function(b){return C?b:k(b,"data")?b.data:b},E=te(u.parse);h.Function(E)?w=E:E&&h.String(E)&&(w=function(b){return E.split(".").forEach(function(V){b&&(b=b[V])}),b}),s(w(m,a,o)),o.sync(a)}},onError:function(m){s(void 0),!c()&&(f||function(C){return He(C.message||"fetch fail "+u.action)})(m,a,o)}});t.$handle.beforeFetch(d,{rule:a,api:o}).then(function(){if(h.Function(u.action)){u.action(a,o).then(function(p){d.onSuccess(p,!0)}).catch(function(p){d.onError(p)});return}B(function(){return t.create.fetch(d,{inject:i,rule:a,api:o})})})}return{name:"fetch",loaded:function(){r.apply(void 0,arguments)},watch:function(){r.apply(void 0,arguments)}}},ci={fetch:fi,loadData:li,componentValidate:Ne},di="html",pi={name:di,loadChildren:!1,render:function(t,e){return e.prop.props.innerHTML=t.default(),e.vNode.make(e.prop.props.tag||"div",e.prop)},renderChildren:function(t){return{default:function(){return t.filter(function(r){return h.String(r)}).join("")}}}};function hi(n,t){var e;return arguments.length===2?(e=arguments[1],t=e[n]):e=arguments[2],{id:t,prop:e}}function Ee(){return hi.apply(void 0,["name"].concat(Array.prototype.slice.call(arguments)))}function mi(n){var t=n.key||[],e=n.array||[],r=n.normal||[];Te.push.apply(Te,R(t)),be.push.apply(be,R(e)),$e.push.apply($e,R(r)),Ut([].concat(R(t),R(e),R(r)))}var vi=1,H={};function qt(n){var t=D({},Re.name,Re),e={},r={},i={},a=[],o=[],u=[n.extendApi],s=_({},ci),l=Br(),f={global:{}},c=Q({}),d=ui(),p={},m=n.isMobile===!0;mi(n.attrs||{});function C(v){var g=H[v];if(Array.isArray(g))return g.map(function(O){return O.api()});if(g)return g.api()}function w(v){a.push(v)}function E(){var v=Ee.apply(void 0,arguments);v.id&&v.prop&&(r[v.id]=v.prop)}function S(){var v=Ee.apply(void 0,arguments);v.id&&v.prop&&(s[v.id]=_(_({},v.prop),{},{name:v.id}))}function b(v){d.use(v)}function V(){var v=Ee.apply(void 0,arguments);if(!v.id||!v.prop)return Me;var g=ee(v.id),O=v.prop,x=O.merge===!0?e[g]:void 0;e[g]=jr(O,x||Me),l[g]=M(g),O.maker&&$(l,O.maker)}function A(v,g){var O;if(h.String(v)){if(O=v,g===void 0)return t[O]}else O=v.displayName||v.name,g=v;if(!(!O||!g)){var x=ee(O);t[O]=g,t[x]=g,delete d.aliasMap[O],delete d.aliasMap[x],delete e[O],delete e[x],g.formCreateParser&&V(O,g.formCreateParser)}}function P(){return Ar(Oe,t,r)}function G(v,g){var O=P();return ln({data:function(){return Q({rule:v,option:g})},render:function(){return fn(O,_({ref:"fc"},this.$data))}})}function Wt(){return Re}function Jt(v,g){return h.Function(v.install)?v.install(q,g):h.Function(v)&&v(q,g),this}function q(v,g){var O=G(v,g||{});a.forEach(function(ye){B(function(){return ye(q,O)})});var x=document.createElement("div");((g==null?void 0:g.el)||document.body).appendChild(x);var fe=O.mount(x);return fe.$refs.fc.fapi}function Kt(v){var g=_({},n);return v?g.inherit={components:t,parsers:e,directives:r,modelFields:i,providers:s,useApps:a,maker:l,formulas:p,loadData:c}:delete g.inherit,qt(g)}function Xt(v,g){i[v]=g}function Qt(v,g){p[v]=g}function We(v){Object.keys(H).forEach(function(g){var O=Array.isArray(H[g])?H[g]:[H[g]];O.forEach(function(x){x.bus.$emit("p.loadData."+v)})})}function Je(v,g){c[v]=g,We(v)}function Ke(v,g){return k(c,v)?c[v]:g}function Zt(v){u.push(v)}function en(v){delete c[v],We(v)}function tn(v,g){o.push({name:v,callback:g})}function Oe(v){var g=this;$(this,{id:vi++,create:q,vm:v,manager:si(n.manager),parsers:e,providers:s,modelFields:i,formulas:p,isMobile:m,rules:v.props.rule,name:v.props.name||Se(),inFor:v.props.inFor,prop:{components:t,directives:r},setData:Je,getData:Ke,loadData:c,CreateNode:d,bus:new wt,unwatch:null,options:Ue({}),extendApiFn:u}),o.forEach(function(O){g.bus.$on(O.name,O.callback)}),X(function(){N(g.options,function(){g.$handle.$manager.updateOptions(g.options.value),g.api().refresh()},{deep:!0})}),$(v.appContext.components,t),$(v.appContext.directives,r),this.$handle=new J(this),this.name&&(this.inFor?(H[this.name]||(H[this.name]=[]),H[this.name].push(this)):H[this.name]=this)}Oe.isMobile=m,$(Oe.prototype,{init:function(){var g=this;this.isSub()&&(this.unwatch=N(function(){return g.vm.setupState.parent.setupState.fc.options.value},function(){g.initOptions(),g.$handle.api.refresh()},{deep:!0})),this.initOptions(),this.$handle.init()},isSub:function(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions:function(){this.options.value={};var g=_({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},Z(f));this.isSub()&&(g=this.mergeOptions(g,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),g=this.mergeOptions(g,this.vm.props.option),this.updateOptions(g)},mergeOptions:function(g,O,x){return O=Z(O),x&&["page","onSubmit","mounted","reload","formData","el","globalClass","style"].forEach(function(fe){delete O[fe]}),O.global&&(g.global=Pr(g.global,O.global),delete O.global),this.$handle.$manager.mergeOptions([O],g),g},updateOptions:function(g){this.options.value=this.mergeOptions(this.options.value,g),this.$handle.$manager.updateOptions(this.options.value)},api:function(){return this.$handle.api},render:function(){return this.$handle.render()},mounted:function(){this.$handle.mounted()},unmount:function(){if(this.name)if(this.inFor){var g=H[this.name].indexOf(this);H[this.name].splice(g,1)}else delete H[this.name];this.unwatch&&this.unwatch(),this.$handle.reloadRule([])},updated:function(){var g=this;this.$handle.bindNextTick(function(){return g.bus.$emit("next-tick",g.$handle.api)})}});function Xe(v){$(v,{version:n.version,ui:n.ui,extendApi:Zt,getData:Ke,setData:Je,removeData:en,maker:l,component:A,directive:E,setModelField:Xt,setFormula:Qt,register:S,$vnode:Wt,parser:V,use:Jt,factory:Kt,componentAlias:b,copyRule:ze,copyRules:Mt,fetch:Ht,$form:P,parseFn:te,parseJson:Er,toJson:jt,useApp:w,getApi:C,on:tn})}function nn(v){$(v,{create:q,isMobile:m,install:function(O,x){if(f=_(_({},f),x||{}),O._installedFormCreate!==!0){O._installedFormCreate=!0;var fe=function(rn){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return q(rn,an)};Xe(fe),O.config.globalProperties.$formCreate=fe;var ye=P();O.component(ye.name,ye),a.forEach(function(Qe){B(function(){return Qe(v,O)})})}}})}if(Xe(q),nn(q),d.use({fragment:"fcFragment"}),n.install&&q.use(n),w(function(v,g){g.mixin({props:["formCreateInject"]})}),V(pi),n.inherit){var j=n.inherit;j.components&&$(t,j.components),j.parsers&&$(e,j.parsers),j.directives&&$(r,j.directives),j.modelFields&&$(i,j.modelFields),j.providers&&$(s,j.providers),j.useApps&&$(a,j.useApps),j.maker&&$(l,j.maker),j.loadData&&$(c,j.loadData),j.formulas&&$(p,j.formulas)}return q}var gt={date:"YYYY-MM-DD",month:"YYYY-MM",datetime:"YYYY-MM-DD HH:mm:ss",timerange:"HH:mm:ss",daterange:"YYYY-MM-DD",monthrange:"YYYY-MM",datetimerange:"YYYY-MM-DD HH:mm:ss",year:"YYYY"},yt="datePicker",gi={name:yt,maker:function(){return["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce(function(n,t){return n[t]=M(yt,{type:t.toLowerCase()}),n},{})}(),mergeProp:function(t){var e=t.prop.props;e.valueFormat||(e.valueFormat=gt[e.type]||gt.date)}},Fe="hidden",yi={name:Fe,maker:D({},Fe,function(n,t){return M(Fe)("",n,t)}),render:function(){return[]}},Ae="input",_i={name:Ae,maker:function(){var n=["password","url","email","text","textarea"].reduce(function(t,e){return t[e]=M(Ae,{type:e}),t},{});return n.idate=M(Ae,{type:"date"}),n}(),mergeProp:function(t){var e=t.prop.props;e&&e.autosize&&e.autosize.minRows&&(e.rows=e.autosize.minRows||2)}},_t="slider",bi={name:_t,maker:{sliderRange:M(_t,{range:!0})},toFormValue:function(t,e){var r=Array.isArray(t),i=e.prop.props,a=i.min||0,o;return i.range===!0?o=r?t:[a,parseFloat(t)||a]:o=r?parseFloat(t[0])||a:parseFloat(t),o}},Ie="timePicker",$i={name:Ie,maker:{time:M(Ie,function(n){return n.props.isRange=!1}),timeRange:M(Ie,function(n){return n.props.isRange=!0})},mergeProp:function(t){var e=t.prop.props;e.valueFormat||(e.valueFormat="HH:mm:ss")}},Ci={name:"FcRow",render:function(t,e){return e.vNode.col({props:{span:24}},{default:function(){return[e.vNode.row(e.prop,t)]}})}},wi="select",Si={name:wi,toFormValue:function(t,e){return e.prop.props.multiple&&!Array.isArray(t)?L(t):t}},Oi=[gi,yi,_i,bi,$i,Ci,Si],I="el",Vi={button:I+"-button",icon:I+"-icon",slider:I+"-slider",rate:I+"-rate",upload:"fc-upload",cascader:I+"-cascader",popover:I+"-popover",tooltip:I+"-tooltip",colorPicker:I+"-colorPicker",timePicker:I+"-time-picker",timeSelect:I+"-time-select",datePicker:I+"-date-picker",switch:I+"-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:I+"-input-number",number:I+"-input-number",input:I+"-input",formItem:I+"-form-item",form:I+"-form",frame:"fc-frame",col:I+"-col",row:I+"-row",tree:"fc-tree",autoComplete:I+"-autocomplete",auto:I+"-autocomplete",group:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function Ri(){return{form:{inline:!1,labelPosition:"right",labelWidth:"125px",disabled:!1,size:void 0},row:{show:!0,gutter:0},submitBtn:{type:"primary",loading:!1,disabled:!1,innerText:"\u63D0\u4EA4",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"\u91CD\u7F6E",show:!1,col:void 0,click:void 0}}}function Ei(n){return n.type==="tooltip"}function bt(n,t){if(!!k(n,t)&&h.String(n[t])){var e;n[t]=(e={},D(e,t,n[t]),D(e,"show",!0),e)}}function K(n){return n===!1}function Fi(n,t){k(n,t)&&!h.Object(n[t])&&(n[t]={show:!!n[t]})}function Pe(n){var t=_({},n);return delete t.children,t}var Ai={validate:function(){var t=this.form();return t?t.validate():new Promise(function(e){return e()})},validateField:function(t){var e=this;return new Promise(function(r,i){var a=e.form();a?a.validateField(t,function(o,u){u?i(u):r(o)}):r()})},clearValidateState:function(t){var e=this.vm.refs[t.wrapRef];e&&e.clearValidate()},tidyOptions:function(t){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach(function(e){Fi(t,e)}),t},tidyRule:function(t){var e=t.prop;return bt(e,"title"),bt(e,"info"),e},mergeProp:function(t){t.prop=ne([{info:this.options.info||{},wrap:this.options.wrap||{},col:this.options.col||{},title:this.options.title||{}},t.prop],{info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}},{normal:["title","info","col","wrap"]})},getDefaultOptions:function(){return Ri()},update:function(){var t=this.options.form;this.rule={props:_({},t),on:{submit:function(r){r.preventDefault()}},class:[t.className,t.class,"form-create",this.options.preview?"is-preview":""],style:t.style,type:"form"}},beforeRender:function(){var t=this.key,e=this.ref,r=this.$handle;$(this.rule,{key:t,ref:e}),$(this.rule.props,{model:r.formData})},render:function(t){var e=this;return t.slotLen()&&!this.options.preview&&t.setSlot(void 0,function(){return e.makeFormBtn()}),this.$r(this.rule,K(this.options.row.show)?t.getSlots():[this.makeRow(t)])},makeWrap:function(t,e){var r=this,i=t.prop,a="".concat(this.key).concat(t.key),o=i.col,u=this.isTitle(i),s=!o.labelWidth&&!u?0:o.labelWidth,l=this.rule.props,f=l.inline,c=l.col,d=K(i.wrap.show)?e:this.$r(ne([i.wrap,{props:_(_({labelWidth:s===void 0?s:It(s),label:u?i.title.title:void 0},Pe(i.wrap||{})),{},{prop:t.id,rules:t.injectValidate()}),class:i.className,key:"".concat(a,"fi"),ref:t.wrapRef,type:"formItem"}]),_({default:function(){return e}},u?{label:function(){return r.makeInfo(i,a,t)}}:{}));return f===!0||K(c)||K(o.show)?d:this.makeCol(i,a,[d])},isTitle:function(t){if(this.options.form.title===!1)return!1;var e=t.title;return!(!e.title&&!e.native||K(e.show))},makeInfo:function(t,e,r){var i=this,a=_({},t.title),o=_({},t.info),u=Ei(o),s=this.options.form,l=this.getSlot("title"),f=[l?l({title:a.title||"",rule:r.rule,options:this.options}):(a.title||"")+(s.labelSuffix||s["label-suffix"]||"")];if(!K(o.show)&&(o.info||o.native)&&!K(o.icon)){var c={type:o.type||"popover",props:Pe(o),key:"".concat(e,"pop")};delete c.props.icon,delete c.props.show,delete c.props.info,delete c.props.align,delete c.props.native;var d="content";o.info&&!k(c.props,d)&&(c.props[d]=o.info),f[o.align!=="left"?"unshift":"push"](this.$r(ne([o,c]),D({},a.slot||(u?"default":"reference"),function(){return i.$r({type:"ElIcon",style:"top:2px",key:"".concat(e,"i")},{default:function(){return i.$r({type:o.icon===!0?"icon-warning":o.icon})}},!0)})))}var p=ne([a,{props:Pe(a),key:"".concat(e,"tit"),type:a.type||"span"}]);return delete p.props.show,delete p.props.title,delete p.props.native,this.$r(p,f)},makeCol:function(t,e,r){var i=t.col;return this.$r({class:i.class,type:"col",props:i||{span:24},key:"".concat(e,"col")},r)},makeRow:function(t){var e=this.options.row||{};return this.$r({type:"row",props:e,class:e.class,key:"".concat(this.key,"row")},t)},makeFormBtn:function(){var t=[];if(K(this.options.submitBtn.show)||t.push(this.makeSubmitBtn()),K(this.options.resetBtn.show)||t.push(this.makeResetBtn()),!!t.length){var e=this.$r({type:"formItem",key:"".concat(this.key,"fb")},t);return this.rule.props.inline===!0?e:this.$r({type:"col",props:{span:24},key:"".concat(this.key,"fc")},[e])}},makeResetBtn:function(){var t=this,e=_({},this.options.resetBtn),r=e.innerText;return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"_fc-reset-btn",style:{width:e.width},on:{click:function(){var a=t.$handle.api;t.options.resetBtn.click?t.options.resetBtn.click(a):a.resetFields()}},key:"".concat(this.key,"b2")},[r])},makeSubmitBtn:function(){var t=this,e=_({},this.options.submitBtn),r=e.innerText;return delete e.innerText,delete e.click,delete e.col,delete e.show,this.$r({type:"button",props:e,class:"_fc-submit-btn",style:{width:e.width},on:{click:function(){var a=t.$handle.api;t.options.submitBtn.click?t.options.submitBtn.click(a):a.submit().catch(function(){})}},key:"".concat(this.key,"b1")},[r])}},le={};Ii(le);Pi(le);ji(le);ki(le);Di(le);function Ii(n){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate"].forEach(function(t){n[t]=M(t)}),n.auto=n.autoComplete,n.number=n.inputNumber,n.color=n.colorPicker}function Pi(n){var t="select",e="multiple";n.selectMultiple=M(t,D({},e,!0)),n.selectOne=M(t,D({},e,!1))}function ji(n){var t="tree",e={treeSelected:"selected",treeChecked:"checked"};Object.keys(e).reduce(function(r,i){return r[i]=M(t,{type:e[i]}),r},n)}function ki(n){var t="upload",e={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(e).reduce(function(r,i){return r[i]=M(t,function(a){return a.props({uploadType:e[i][0],maxLength:e[i][1]})}),r},n),n.uploadImage=n.image,n.uploadFile=n.file}function Di(n){var t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};return Object.keys(t).reduce(function(e,r){return e[r]=M("frame",function(i){return i.props({type:t[r][0],maxLength:t[r][1]})}),e},n),n.frameInput=n.frameInputs,n.frameFile=n.frameFiles,n.frameImage=n.frameImages,n}var Bi=".form-create .form-create .el-form-item{margin-bottom:22px}.form-create{width:100%}.form-create .fc-none,.form-create.is-preview .el-form-item.is-required>.el-form-item__label-wrap>.el-form-item__label:before,.form-create.is-preview .el-form-item.is-required>.el-form-item__label:before,.form-create.is-preview .fc-clock{display:none!important}";we(Bi);function $t(n,t){return h.Boolean(n)?n={show:n}:!h.Undef(n)&&!h.Object(n)&&(n={show:t}),n}function xi(n,t){return{formEl:function(){return t.$manager.form()},wrapEl:function(r){var i=t.getFieldCtx(r);if(!!i)return t.vm.refs[i.wrapRef]},validate:function(r){return new Promise(function(i,a){var o=n.children,u=[t.$manager.validate()];o.forEach(function(s){u.push(s.validate())}),Promise.all(u).then(function(){i(!0),r&&r(!0)}).catch(function(s){a(s),r&&r(s),t.vm.emit("validate-fail",s,{api:n})})})},validateField:function(r,i){return new Promise(function(a,o){var u=t.getFieldCtx(r);if(!!u){var s=t.subForm[u.id],l=[t.$manager.validateField(u.id)];L(s).forEach(function(f){l.push(f.validate())}),Promise.all(l).then(function(){a(null),i&&i(null)}).catch(function(f){o(f),i&&i(f),t.vm.emit("validate-field-fail",f,{field:r,api:n})})}})},clearValidateState:function(r){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n.helper.tidyFields(r).forEach(function(o){a&&i.clearSubValidateState(o),t.getCtxs(o).forEach(function(u){t.$manager.clearValidateState(u)})})},clearSubValidateState:function(r){n.helper.tidyFields(r).forEach(function(i){t.getCtxs(i).forEach(function(a){var o=t.subForm[a.id];!o||(Array.isArray(o)?o.forEach(function(u){u.clearValidateState()}):o&&o.clearValidateState())})})},btn:{loading:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.submitBtnProps({loading:!!r})},disabled:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.submitBtnProps({disabled:!!r})},show:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.submitBtnProps({show:!!r})}},resetBtn:{loading:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.resetBtnProps({loading:!!r})},disabled:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.resetBtnProps({disabled:!!r})},show:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;n.resetBtnProps({show:!!r})}},submitBtnProps:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=$t(t.options.submitBtn,!0);$(i,r),t.options.submitBtn=i,n.refreshOptions()},resetBtnProps:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=$t(t.options.resetBtn,!1);$(i,r),t.options.resetBtn=i,n.refreshOptions()},submit:function(r,i){return new Promise(function(a,o){n.validate().then(function(){var u=n.formData();h.Function(r)&&B(function(){return r(u,n)}),h.Function(t.options.onSubmit)&&B(function(){return t.options.onSubmit(u,n)}),t.vm.emit("submit",u,n),a(u)}).catch(function(){for(var u=arguments.length,s=new Array(u),l=0;l<u;l++)s[l]=arguments[l];h.Function(i)&&B(function(){return i.apply(void 0,[n].concat(s))}),o.apply(void 0,s)})})}}}var Le={name:"required",load:function(t,e,r){var i=Ti(t.getValue());if(i.required===!1)t.clearProp(),r.clearValidateState([e.field]);else{var a=_({required:!0,validator:function(s,l,f){h.empty(l)?f(a.message):f()}},i);if(!a.message){var o=e.title||"";a.message=((T(o)==="object"?o.title:o)||"")+"\u4E0D\u80FD\u4E3A\u7A7A"}t.getProp().validate=[a]}r.sync(e)},watch:function(){Le.load.apply(Le,arguments)}};function Ti(n){return h.Boolean(n)?{required:n}:h.String(n)?{message:n}:h.Undef(n)?{required:!1}:h.Function(n)?{validator:n}:h.Object(n)?n:{}}function Mi(n){n.componentAlias(Vi),Or.forEach(function(t){n.component(t.name,t)}),n.register(Le),Oi.forEach(function(t){n.parser(t)}),Object.keys(le).forEach(function(t){n.maker[t]=le[t]}),typeof window<"u"&&window.ElementPlus&&n.useApp(function(t,e){e.use(window.ElementPlus)})}function Ni(){return qt({ui:"element-ui",version:"3.2.0",manager:Ai,extendApi:xi,install:Mi,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}})}var qe=Ni();typeof window<"u"&&(window.formCreate=qe);qe.maker;const Li={components:{formCreate:qe.$form()},data(){return{fApi:{},formData:{},rule:[{type:"input",field:"goods_name",title:"\u5546\u54C1\u540D\u79F0"},{type:"datePicker",field:"created_at",title:"\u521B\u5EFA\u65F6\u95F4"}],option:{onSubmit:function(n){alert(JSON.stringify(n))}}}}};function Ui(n,t,e,r,i,a){const o=F("form-create");return ie(),ae("div",null,[y(o,{modelValue:i.formData,"onUpdate:modelValue":t[0]||(t[0]=u=>i.formData=u),api:i.fApi,"onUpdate:api":t[1]||(t[1]=u=>i.fApi=u),rule:i.rule,option:i.option},null,8,["modelValue","api","rule","option"])])}const Ca=yn(Li,[["render",Ui]]);export{Ca as default};