@form-create/element-ui 3.2.38 → 3.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/form-create.esm.js +10 -5
- package/dist/form-create.esm.min.js +2 -2
- package/dist/form-create.js +10 -5
- package/dist/form-create.min.js +2 -2
- package/package.json +5 -5
- package/src/core/manager.js +1 -1
package/dist/form-create.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @form-create/element-ui v3.2.
|
|
2
|
+
* @form-create/element-ui v3.2.39
|
|
3
3
|
* (c) 2018-2026 xaboy
|
|
4
4
|
* Github https://github.com/xaboy/form-create
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).formCreate={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){return Object.keys(e).reduce((function(n,r){return t&&-1!==t.indexOf(r)||(n[r]=e[r]),n}),{})}function v(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}var g=t.defineComponent({name:"fcCheckbox",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:function(){return[]}},type:String,options:Array,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t.toRef(e.formCreateInject,"options",[]),i=t.toRef(e,"options"),o=t.toRef(e,"modelValue"),a=t.toRef(e,"inputValue",""),u=t.ref(a.value),c=t.toRef(e,"input",!1),l=function(e){var t=d(v(o.value)),n=t.indexOf(u.value);u.value=e,n>-1&&(t.splice(n,1),t.push(e),f(t))};t.watch(a,(function(e){c.value?l(e):u.value=e}));var s=t.computed((function(){var e=r.value||[];return i.value&&(e=i.value||[]),Array.isArray(e)?e:[]}));t.watch(o,(function(e){var t=null;if(!a.value&&null!=e&&Array.isArray(e)&&e.length>0&&c.value){var n=s.value.map((function(e){return e.value}));e.forEach((function(e){-1===n.indexOf(e)&&(t=e)}))}null!=t&&(u.value=t)}),{immediate:!0});var f=function(e){n.emit("update:modelValue",e)};return{options:s,value:o,onInput:f,updateCustomValue:l,makeInput:function(e){if(c.value)return t.createVNode(e,{value:u.value||void 0,label:u.value||void 0},{default:function(){return[t.createVNode(t.resolveComponent("ElInput"),{size:"small",modelValue:u.value,"onUpdate:modelValue":l},null)]}})}}},render:function(){var e,n,i=this,o="button"===this.type?"ElCheckboxButton":"ElCheckbox",a=t.resolveComponent(o);return t.createVNode(t.resolveComponent("ElCheckboxGroup"),t.mergeProps(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),r({default:function(){return[i.options.map((function(e,n){var i=r({},e),u=i.value,c=i.label;return delete i.value,delete i.label,t.createVNode(a,t.mergeProps(i,{label:u,value:u,key:o+n+"-"+u}),{default:function(){return[c||u||""]}})})),null===(e=(n=i.$slots).default)||void 0===e?void 0:e.call(n),i.makeInput(a)]}},m(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}});function y(e){e=e||new Map;var t={$on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},$once:function(e,n){n._once=!0,t.$on(e,n)},$off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},$emit:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e.get(n)||[]).slice().map((function(e){e._once&&(t.$off(n,e),delete e._once),e.apply(void 0,i)})),(e.get("*")||[]).slice().map((function(e){e(n,i)}))}};return t}function b(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}b("._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}");var _={name:"IconCircleClose"},x={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},w=[t.createElementVNode("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),t.createElementVNode("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)];_.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",x,w)};var k={name:"IconDocument"},$={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},C=[t.createElementVNode("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)];k.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",$,C)};var V={name:"IconDelete"},O={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},S=[t.createElementVNode("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)];V.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",O,S)};var R={name:"IconView"},j={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},E=[t.createElementVNode("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)];R.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",j,E)};var F={name:"IconFolderOpened"},D={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},A=[t.createElementVNode("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)];F.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",D,A)};var P=t.defineComponent({name:"fcFrame",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:""},closeBtnText:{type:String,default:""},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:F,IconView:R},data:function(){return{fileList:v(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new y}},watch:{modelValue:function(e){this.fileList=v(e)}},methods:{close:function(){this.closeModel(!0)},closeModel:function(e){this.bus.$emit(e?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModel:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},input:function(){var e=this.fileList,t=1===this.maxLength?e[0]||"":e;this.$emit("update:modelValue",t),this.$emit("change",t)},makeInput:function(){var e=this;return t.createVNode(t.resolveComponent("ElInput"),t.mergeProps({type:"text",modelValue:this.fileList.map((function(t){return e.getSrc(t)})).toString(),readonly:!0},{key:1}),{append:function(){return t.createVNode(t.resolveComponent("ElButton"),{icon:t.resolveComponent(e.icon),onClick:function(){return e.showModel()}},null)},suffix:function(){return e.fileList.length&&!e.disabled?t.createVNode(t.resolveComponent("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:function(){e.fileList=[],e.input()}},{default:function(){return[t.createVNode(_,null,null)]}}):null}})},makeGroup:function(e){return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),t.createVNode("div",{key:2},[e])},makeItem:function(e,n){return t.createVNode("div",{class:"_fc-files",key:"3"+e},[n])},valid:function(e){var t=this.formCreateInject.field||this.field;if(t&&e!==t)throw new Error("[frame]无效的字段值")},makeIcons:function(e,n){if(!1!==this.handleIcon||!0===this.allowRemove){var r=[];return("file"!==this.type&&!1!==this.handleIcon||"file"===this.type&&this.handleIcon)&&r.push(this.makeHandleIcon(e,n)),this.allowRemove&&r.push(this.makeRemoveIcon(e,n)),t.createVNode("div",{class:"_fc-upload-cover",key:4},[r])}},makeHandleIcon:function(e,n){var r=this,i=t.resolveComponent(!0===this.handleIcon||void 0===this.handleIcon?"icon-view":this.handleIcon);return t.createVNode(t.resolveComponent("ElIcon"),{onClick:function(){return r.handleClick(e)},key:"5"+n},{default:function(){return[t.createVNode(i,null,null)]}})},makeRemoveIcon:function(e,n){var r=this;return t.createVNode(t.resolveComponent("ElIcon"),{onClick:function(){return r.handleRemove(e)},key:"6"+n},{default:function(){return[t.createVNode(V,null,null)]}})},makeFiles:function(){var e=this;return this.makeGroup(this.fileList.map((function(n,r){return e.makeItem(r,[t.createVNode(t.resolveComponent("ElIcon"),{onClick:function(){return e.handleClick(n)}},{default:function(){return[t.createVNode(k,null,null)]}}),e.makeIcons(n,r)])})))},makeImages:function(){var e=this;return this.makeGroup(this.fileList.map((function(n,r){return e.makeItem(r,[t.createVNode("img",{src:e.getSrc(n)},null),e.makeIcons(n,r)])})))},makeBtn:function(){var e=this,n=t.resolveComponent(this.icon);return t.createVNode("div",{class:"_fc-upload-btn",onClick:function(){return e.showModel()},key:7},[t.createVNode(t.resolveComponent("ElIcon"),null,{default:function(){return[t.createVNode(n,null,null)]}})])},handleClick:function(e){if(this.onHandle)return this.onHandle(e);this.previewImage=this.getSrc(e),this.previewVisible=!0},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),this.input(),this.onRemove(e))},getSrc:function(e){return this.srcKey?e[this.srcKey]:e},frameLoad:function(e){var t=this;this.onLoad(e);try{!0===this.helper&&(e.form_create_helper={api:this.formCreateInject.api,close:function(e){t.valid(e),t.closeModel()},set:function(e,n){t.valid(e),!t.disabled&&t.$emit("update:modelValue",n)},get:function(e){return t.valid(e),t.modelValue},onOk:function(e){return t.bus.$on("$ok",e)},onClose:function(e){return t.bus.$on("$close",e)}})}catch(e){console.error(e)}},makeFooter:function(){var e=this,n=this.$props,r=n.okBtnText,i=n.closeBtnText,o=n.closeBtn,a=n.okBtn;if(n.footer)return t.createVNode("div",null,[o?t.createVNode(t.resolveComponent("ElButton"),{onClick:function(){return!1!==e.onCancel()&&(e.frameVisible=!1)}},{default:function(){return[i||e.formCreateInject.t("close")||"关闭"]}}):null,a?t.createVNode(t.resolveComponent("ElButton"),{type:"primary",onClick:function(){return!1!==e.onOk()&&e.closeModel()}},{default:function(){return[r||e.formCreateInject.t("ok")||"确定"]}}):null])}},render:function(){var e,n=this,i=this.type;e="input"===i?this.makeInput():"image"===i?this.makeImages():this.makeFiles();var o=this.$props,a=o.width,u=void 0===a?"30%":a,c=o.height,l=o.src,s=o.title,f=o.modalTitle;return t.nextTick((function(){n.$refs.frame&&n.frameLoad(n.$refs.frame.contentWindow||{})})),t.createVNode("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,t.createVNode(t.resolveComponent("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:f,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[t.createVNode("img",{style:"width: 100%",src:n.previewImage},null)]}}),t.createVNode(t.resolveComponent("ElDialog"),t.mergeProps({appendToBody:!0},r({width:u,title:s},this.modal),{modelValue:this.frameVisible,onClose:function(){return n.closeModel(!0)}}),{default:function(){return[n.frameVisible||!n.reload?t.createVNode("iframe",{ref:"frame",src:l,frameBorder:"0",style:{height:c,border:"0 none",width:"100%"}},null):null]},footer:function(){return n.makeFooter()}})])},beforeMount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.on("fc:closeModal:"+t,this.close),n&&r.on("fc:closeModal:"+n,this.close)},beforeUnmount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.off("fc:closeModal:"+t,this.close),n&&r.off("fc:closeModal:"+n,this.close)}}),I=t.defineComponent({name:"fcRadio",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},options:Array,type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t.toRef(e.formCreateInject,"options",[]),i=t.toRef(e,"options"),o=t.toRef(e,"modelValue"),a=t.toRef(e,"inputValue",""),u=t.ref(a.value),c=t.toRef(e,"input",!1);t.watch(a,(function(e){c.value?f(e):u.value=e}));var l=t.computed((function(){var e=r.value||[];return i.value&&(e=i.value||[]),Array.isArray(e)?e:[]}));t.watch(o,(function(e){var t=!1;!a.value&&null!=e&&c.value&&(t=-1===l.value.map((function(e){return e.value})).indexOf(e)),t&&(u.value=e)}),{immediate:!0});var s=function(e){n.emit("update:modelValue",e)},f=function(e){var t=u.value;u.value=e,o.value===t&&s(e)};return{options:l,value:o,onInput:s,updateCustomValue:f,customValue:u,makeInput:function(e){if(c.value)return t.createVNode(e,{checked:!1,value:u.value||void 0,label:u.value||void 0},{default:function(){return[t.createVNode(t.resolveComponent("ElInput"),{size:"small",modelValue:u.value,"onUpdate:modelValue":f},null)]}})}}},render:function(){var e,n,i=this,o="button"===this.type?"ElRadioButton":"ElRadio",a=t.resolveComponent(o);return t.createVNode(t.resolveComponent("ElRadioGroup"),t.mergeProps(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),r({default:function(){return[i.options.map((function(e,n){var i=r({},e),u=i.value,c=i.label;return delete i.value,delete i.label,t.createVNode(a,t.mergeProps(i,{label:u,value:u,key:o+n+"-"+u}),{default:function(){return[c||u||""]}})})),null===(e=(n=i.$slots).default)||void 0===e?void 0:e.call(n),i.makeInput(a)]}},m(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),N={type:function(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef:function(e){return null==e},Element:function(e){return"object"===i(e)&&null!==e&&1===e.nodeType&&!N.Object(e)},trueArray:function(e){return Array.isArray(e)&&e.length>0},Function:function(e){var t=this.getType(e);return"Function"===t||"AsyncFunction"===t},getType:function(e){var t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty:function(e){return null==e||(!(!Array.isArray(e)||!Array.isArray(e)||e.length)||"string"==typeof e&&!e)}};function B(e,t){return{}.hasOwnProperty.call(e,t)}["Date","Object","String","Boolean","Array","Number"].forEach((function(e){N[e]=function(t){return N.type(t,e)}}));var T=t.defineComponent({name:"fcSelect",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=n.emit,i=t.toRef(e.formCreateInject,"options",[]),o=t.toRef(e,"modelValue");return{options:t.computed((function(){return Array.isArray(i.value)?i.value:[]})),value:o,handleUpdate:function(e){r("update:modelValue",e)},hasProperty:B,is:N}},mounted:function(){this.$emit("fc.el",this.$refs.el)}});T.render=function(e,n,r,i,o,u){var c=t.resolveComponent("el-option"),l=t.resolveComponent("el-option-group"),s=t.resolveComponent("el-select");return t.openBlock(),t.createBlock(s,t.mergeProps(e.$attrs,{"model-value":e.value,"onUpdate:modelValue":e.handleUpdate,ref:"el"}),{default:t.withCtx((function(){return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.options,(function(n,r){return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.hasProperty(n,"options")?(t.openBlock(),t.createBlock(l,{label:n.label,key:"".concat(r,"-").concat(n.label)},{default:t.withCtx((function(){return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.is.trueArray(n.options)?n.options:[],(function(e,n){return t.openBlock(),t.createBlock(c,t.mergeProps({key:"".concat(n,"-").concat(e.value)},e),null,16)})),128))]})),_:2},1032,["label"])):(t.openBlock(),t.createBlock(c,t.mergeProps(a({key:1},"key","".concat(r,"-").concat(n.value)),n),null,16))],64)})),256)),t.renderSlot(e.$slots,"default")]})),_:3},16,["model-value","onUpdate:modelValue"])};var L=t.defineComponent({name:"fcTree",inheritAttrs:!1,formCreateParser:{mergeProp:function(e){var t=e.prop.props;t.nodeKey||(t.nodeKey="id"),t.props||(t.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(){var e;this.$refs.tree&&(e="selected"===this.type?this.$refs.tree.getCurrentKey():this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",e))},setValue:function(){this.$refs.tree&&("selected"===this.type?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(v(this.modelValue)))}},render:function(){return t.createVNode(t.resolveComponent("ElTree"),t.mergeProps(this.$attrs,{ref:"tree",onCheck:this.updateValue,onNodeClick:this.updateValue}),this.$slots)},mounted:function(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}});b("._fc-upload{width:100%}._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}");var M={name:"IconUpload"},U={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},q=[t.createElementVNode("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)];function z(e,t){return"object"===i(e)?e:{url:e,is_string:!0,name:Y(e),uid:t}}function H(e){return r(r({},e),{},{file:e,value:e})}function Y(e){return(""+e).split("/").pop()}M.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",U,q)};var G=t.defineComponent({name:"fcUpload",inheritAttrs:!1,formCreateParser:{toFormValue:function(e){return v(e)},toValue:function(e,t){return 1===t.prop.props.limit?e[0]||"":e}},props:{previewMask:void 0,onPreview:Function,httpRequest:Function,modalTitle:String,listType:String,uploadText:String,formCreateInject:Object,modelValue:[Array,String,Object]},emits:["update:modelValue","change","remove","fc.el"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=v(this.modelValue).map(z).map(H)},watch:{modelValue:function(e){this.fileList=v(e).map(z).map(H)}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):"text"===this.listType?window.open(e.url):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.is_string?e.url:e.value||e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)},doHttpRequest:function(e){if(this.httpRequest)return this.httpRequest(e);e.source="upload",this.formCreateInject.api.fetch(e)}},render:function(){var e,n,i=this,o=v(this.modelValue).length;return t.createVNode("div",{class:"_fc-upload"},[t.createVNode(t.resolveComponent("ElUpload"),t.mergeProps({key:o},this.$attrs,{listType:this.listType||"picture-card",class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=o},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,httpRequest:this.doHttpRequest,fileList:this.fileList,ref:"upload"}),r({default:function(){return[(null===(e=(n=i.$slots).default)||void 0===e?void 0:e.call(n))||(-1===["text","picture"].indexOf(i.listType)?t.createVNode(t.resolveComponent("ElIcon"),null,{default:function(){return[t.createVNode(M,null,null)]}}):t.createVNode(t.resolveComponent("ElButton"),{type:"primary"},{default:function(){return[i.formCreateInject.t("clickToUpload")||i.uploadText||"点击上传"]}}))]}},m(this.$slots,["default"]))),t.createVNode(t.resolveComponent("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[t.createVNode("img",{style:"width: 100%",src:i.previewImage},null)]}})])},mounted:function(){this.$emit("fc.el",this.$refs.upload)}});function J(e,t,n){e[t]=n}function W(e,t){delete e[t]}function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];if((r=Array.isArray(o))||N.Object(o)){var a=void 0===e[i];if(r)r=!1,a&&J(e,i,[]);else if(o._clone&&void 0!==n){if(!n){J(e,i,o._clone());continue}o=o.getRule(),a&&J(e,i,{})}else a&&J(e,i,{});e[i]=K(e[i],o,n)}else J(e,i,o),N.Undef(o)||(N.Undef(o.__json)||(e[i].__json=o.__json),N.Undef(o.__origin)||(e[i].__origin=o.__origin))}return void 0!==n&&Array.isArray(e)?e.filter((function(e){return!e||!e.__ctrl})):e}function X(e){return K({},{value:e}).value}var Z=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&J(e,r,t[r]);return e};function Q(){return Z.apply(this,arguments)}function ee(e){return"object"!==i(e)||null===e?e:e instanceof Array?d(e):r({},e)}function te(e,t){var n=null;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];null!==n&&clearTimeout(n),n=setTimeout((function(){return e.call.apply(e,[r].concat(o))}),t)}}function ne(e){return null==e?"":"object"===i(e)?JSON.stringify(e,null,2):String(e)}function re(e){return function(e){return e&&"object"===i(e)&&"function"==typeof e.then}(e)?e:Promise.resolve(e)}function ie(e){var t=e.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}function oe(e){return e.replace(e[0],e[0].toLocaleUpperCase())}function ae(e,t,n){return"[form-create ".concat(e,"]: ").concat(t)+(n?"\n\nrule: "+JSON.stringify(n.getRule?n.getRule():n):"")}function ue(e,t){console.error(ae("err",e,t))}b('._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%}._fc-group._fc-group-card{display:flex;flex-direction:column;gap:16px;width:100%}._fc-group._fc-group-card._fc-group-disabled ._fc-group-add,._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{background:#fff;border:1px solid #f0f0f0;border-radius:6px;display:flex;flex-direction:column;margin:0;overflow:hidden;padding:0;position:relative}._fc-group._fc-group-card ._fc-group-header{align-items:center;background:#fafafa;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;padding:16px 20px 12px}._fc-group._fc-group-card ._fc-group-idx{align-items:center;background:#f0f0f0;border:1px solid #e0e0e0;border-radius:6px;color:#666;display:flex;flex-shrink:0;font-size:12px;font-weight:500;height:24px;justify-content:center;margin-right:12px;position:static;width:24px}._fc-group._fc-group-card ._fc-group-title{color:rgba(0,0,0,.85);flex:1;font-size:14px;font-weight:500;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{align-items:center;background-color:transparent;border:none;border-radius:0;bottom:auto;display:flex;flex-direction:row;flex-shrink:0;gap:4px;margin-left:12px;padding:0;position:static;right:auto}._fc-group._fc-group-card ._fc-group-btn{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-btn:hover{background:#f0f8ff;border-color:#1890ff;color:#1890ff}._fc-group._fc-group-card ._fc-group-btn:active{border-color:#096dd9;color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{border-left:1px solid;border-top:1px solid;content:"";height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%) rotate(45deg);width:5px}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{align-items:center;display:flex;flex-direction:column;height:24px;justify-content:center;position:relative}._fc-group._fc-group-card ._fc-group-sort:after,._fc-group._fc-group-card ._fc-group-sort:before{border-left:1px solid;border-top:1px solid;content:"";height:4px;left:50%;position:absolute;transform:translateX(-50%);width:4px}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translateX(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translateX(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-down,._fc-group._fc-group-card ._fc-group-sort-up{cursor:pointer;height:12px;left:0;position:absolute;right:0;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-down:hover,._fc-group._fc-group-card ._fc-group-sort-up:hover{background:rgba(24,144,255,.1)}._fc-group._fc-group-card ._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-plus-minus:before{background-color:currentColor;content:"";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-add:hover{background:#f0f8ff;border-color:#409eff;color:#409eff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;width:24px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{background-color:currentColor;content:"";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{color:rgba(0,0,0,.45);font-size:14px;padding:40px 20px;text-align:center}@media (max-width:768px){._fc-group._fc-group-card ._fc-group-container{border-left:none;border-radius:0;border-right:none;margin:0 -8px}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{height:22px;width:22px}}');var ce="[[FORM-CREATE-PREFIX-",le="-FORM-CREATE-SUFFIX]]";function se(e,t){return JSON.stringify(K(Array.isArray(e)?[]:{},e,!0),(function(e,t){if(!t||!0!==t._isVue){if("function"!=typeof t)return t;if(t.__json)return t.__json;if(t.__origin&&(t=t.__origin),!t.__emit)return ce+t+le}}),t)}function fe(e){return new Function("return "+e)()}function de(e,t){if(e&&N.String(e)&&e.length>4){var n=e.trim(),r=!1;try{if(n.indexOf(le)>0&&0===n.indexOf(ce))n=n.replace(le,"").replace(ce,""),r=!0;else if(0===n.indexOf("$FN:"))n=n.substring(4),r=!0;else if(0===n.indexOf("$EXEC:"))n=n.substring(6),r=!0;else{if(0===n.indexOf("$GLOBAL:")){var i=n.substring(8);return n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0].api.getGlobalEvent(i);if(r)return r.call.apply(r,[this].concat(t))},n.__json=e,n.__inject=!0,n}if(0===n.indexOf("$FNX:"))return(n=fe("function($inject){\n"+n.substring(5)+"\n}")).__json=e,n.__inject=!0,n;(t||0!==n.indexOf("function ")||"function "===n)&&(t||0!==n.indexOf("function(")||"function("===n)||(r=!0)}if(!r)return e;var o;try{o=fe(n)}catch(e){o=fe("function "+n)}return o.__json=e,o}catch(e){return void ue("解析失败:".concat(n,"\n\nerr: ").concat(e))}}return e}function pe(e,t){return JSON.parse(e,(function(e,n){return N.Undef(n)||!n.indexOf?n:de(n,t)}))}var he=0;function me(){var e=370+ ++he;return"F"+Math.random().toString(36).substr(3,3)+Number("".concat(Date.now())).toString(36)+e.toString(36)+"c"}function ve(e,t,n){var r,o=e;return(t||"").split(".").forEach((function(e){r&&(o[r]&&"object"==i(o[r])||(o[r]={}),o=o[r]),r=e})),o[r]=n,o}var ge=t.defineComponent({name:"fcGroup",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},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}},formCreateInject:Object,parse:Function},data:function(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:t.markRaw(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler:function(e,t){var n=this;Object.keys(this.cacheRule).forEach((function(r){var i=n.cacheRule[r];if(i.$f){var o=i.$f.formData();if(e===t)i.$f.deferSyncValue((function(){K(i.rule,e),i.$f.setValue(o)}),!0);else{var a=i.$f.formData();i.$f.once("reloading",(function(){i.$f.setValue(a)})),i.rule=X(e)}}}))},deep:!0},expand:function(e){var t=e-this.modelValue.length;t>0&&this.expandRule(t)},modelValue:{handler:function(e){var t=this;e=e||[];var n=this.sort,r=n.length,i=r-e.length;if(i<0){for(var o=i;o<0;o++)this.addRule(e.length+o,!0);for(var a=0;a<r;a++)this.setValue(n[a],e[a])}else{if(i>0)for(var u=0;u<i;u++)this.removeRule(n[r-u-1]);e.forEach((function(r,i){t.setValue(n[i],e[i])}))}},deep:!0}},methods:{_value:function(e){return e&&B(e,this.field)?e[this.field]:e},cache:function(e,t){this.cacheValue[e]=JSON.stringify(t)},input:function(e){this.$emit("update:modelValue",e),this.$emit("change",e)},formData:function(e,t){var n=this,i=this.cacheRule,o=this.sort;if(o.filter((function(e){return i[e]&&i[e].$f})).length===o.length){var a=o.map((function(i){var o=e===i?t:r({},n.cacheRule[i].$f.form),a=n.field?o[n.field]||null:o;return n.cache(i,a),a}));this.input(a)}},setValue:function(e,t){var n=this.field;n&&(t=a({},n,this._value(t))),this.cacheValue[e]!==JSON.stringify(n?t[n]:t)&&(this.cacheRule[e].$f&&this.cacheRule[e].$f.coverValue(t),this.cache(e,t))},addRule:function(e,n){var i=this,o=this.formCreateInject.form.copyRules(this.rule||[]),u=this.options?r({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){u.formData||(u.formData={});var c=X(this.defaultValue);Q(u.formData,this.field?a({},this.field,c):c)}this.parse&&this.parse({rule:o,options:u,index:this.sort.length}),this.cacheRule[++this.len]={rule:o,options:u},this.sort=Object.keys(this.cacheRule),n&&t.nextTick((function(){return i.$emit("add",o,Object.keys(i.cacheRule).length-1)}))},add$f:function(e,n,r){var i=this;this.cacheRule[n].$f=r,t.nextTick((function(){i.$emit("itemMounted",r,Object.keys(i.cacheRule).indexOf(n))}))},removeRule:function(e,n){var r=this,i=Object.keys(this.cacheRule).indexOf(e);delete this.cacheRule[e],delete this.cacheValue[e],this.sort=Object.keys(this.cacheRule),n&&t.nextTick((function(){return r.$emit("remove",i)}))},add:function(e){if(!this.disabled&&!1!==this.onBeforeAdd(this.modelValue)){var t=d(this.modelValue);t.push(this.defaultValue?X(this.defaultValue):this.field?null:{}),this.input(t)}},del:function(e,t){var n=this;if(!this.disabled){var r=function(){n.removeRule(t,!0);var r=d(n.modelValue);r.splice(e,1),n.input(r)};re(this.onBeforeRemove(this.modelValue,e)).then((function(e){!1!==e&&r()}))}},addIcon:function(e){return t.createVNode("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon:function(e,n){var r=this;return t.createVNode("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:function(){return r.del(e,n)}},null)},sortUpIcon:function(e){var n=this;return t.createVNode("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:function(){return n.changeSort(e,-1)}},null)},sortDownIcon:function(e){var n=this;return t.createVNode("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:function(){return n.changeSort(e,1)}},null)},changeSort:function(e,t){var n=this,r=this.sort[e];this.sort[e]=this.sort[e+t],this.sort[e+t]=r,this.formCreateInject.subForm(this.sort.map((function(e){return n.cacheRule[e].$f}))),this.formData(0)},sortIcon:function(e,n){var r=this,i=e>0,o=e<n-1,a=[];return i||o?"card"===this.type&&i&&o?(a.push(t.createVNode("div",{class:"_fc-group-btn _fc-group-sort"},[t.createVNode("div",{class:" _fc-group-sort-up",onClick:function(){return r.changeSort(e,-1)}},null),t.createVNode("div",{class:" _fc-group-sort-down",onClick:function(){return r.changeSort(e,1)}},null)])),a):(i&&a.push(this.sortUpIcon(e)),o&&a.push(this.sortDownIcon(e)),a):a},makeIcon:function(e,t,n){var r=this;if(this.$slots.button)return this.$slots.button({total:e,index:t,vm:this,key:n,del:function(){return r.del(t,n)},add:this.add});var i=[];if((!this.max||e<this.max)&&e===t+1&&i.push(this.addIcon(n)),e>this.min&&i.push(this.delIcon(t,n)),this.sortBtn){var o=this.sortIcon(t,e);o&&i.push.apply(i,d(o))}return i},expandRule:function(e){for(var t=0;t<e;t++)this.modelValue.push(this.field?null:{});this.input(d(this.modelValue))},getTitle:function(e,t){return"function"==typeof this.title?this.title(e,this.modelValue[e],t):"string"==typeof this.title&&this.title.replace("{index}",e+1)}},created:function(){for(var e=(this.expand||0)-this.modelValue.length,t=0;t<this.modelValue.length;t++)this.addRule(t);e>0&&this.expandRule(e)},render:function(){var e=this,n=this.sort,i=this.button,o=this.form,u=this.disabled,c="card"===this.type,l=0===n.length?this.$slots.default?this.$slots.default({vm:this,add:this.add}):t.createVNode("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):n.map((function(l,s){var f=e.cacheRule[l],d=f.rule,p=f.options,h=i&&!u?e.makeIcon(n.length,s,l):[],m=e.getTitle(s,l);return c?t.createVNode("div",{class:"_fc-group-container",key:l},[t.createVNode("div",{class:"_fc-group-header"},[!1===m?t.createVNode("div",{class:"_fc-group-idx"},[s+1]):null,!1!==m?t.createVNode("div",{class:"_fc-group-title"},[m]):null,t.createVNode("div",{class:"_fc-group-handle fc-clock"},[h.length?h:null])]),t.createVNode("div",{class:"_fc-group-content"},[t.createVNode(o,t.mergeProps({key:l},r(r({},e.$attrs),{},{disabled:u,"onUpdate:modelValue":function(t){return e.formData(l,t)},"onUpdate:api":function(t){return e.add$f(s,l,t)},inFor:!0,modelValue:e.field?a({},e.field,e._value(e.modelValue[s])):e.modelValue[s],rule:d,option:p,extendOption:!0})),null)])]):t.createVNode("div",{class:"_fc-group-container",key:l},[t.createVNode(o,t.mergeProps({key:l},r(r({},e.$attrs),{},{disabled:u,"onUpdate:modelValue":function(t){return e.formData(l,t)},"onUpdate:api":function(t){return e.add$f(s,l,t)},inFor:!0,modelValue:e.field?a({},e.field,e._value(e.modelValue[s])):e.modelValue[s],rule:d,option:p,extendOption:!0})),null),t.createVNode("div",{class:"_fc-group-idx"},[s+1]),h.length?t.createVNode("div",{class:"_fc-group-handle fc-clock"},[h]):null])}));return t.createVNode("div",{key:"con",class:"_fc-group "+(u?"_fc-group-disabled":"")+(c?" _fc-group-card":"")},[l])}}),ye=t.defineComponent({name:"fcSubForm",props:{rule:Array,options:{type:Object,default:function(){return t.reactive({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:t.markRaw(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue:function(e){this.setValue(e)}},methods:{formData:function(e){this.cacheValue=JSON.stringify(e),this.$emit("update:modelValue",e),this.$emit("change",e)},setValue:function(e){var t=JSON.stringify(e);this.cacheValue!==t&&(this.cacheValue=t,this.subApi.coverValue(e||{}))},add$f:function(e){var n=this;this.subApi=e,t.nextTick((function(){n.$emit("itemMounted",e)}))}},render:function(){var e=this.form;return t.createVNode(e,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),be={name:"IconWarning"},_e={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},xe=[t.createElementVNode("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)];be.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",_e,xe)};var we=[g,P,I,T,L,G,ge,ye,be],ke=["props"],$e=["class","style","directives"],Ce=["on","hook"],Ve=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[].concat(ke,d(o.normal||[])),u=[].concat($e,d(o.array||[])),c=[].concat(Ce,d(o.functional||[])),l=o.props||[];return t.reduce((function(t,n){for(var o in n)if(t[o])if(l.indexOf(o)>-1)t[o]=e([n[o]],t[o]);else if(a.indexOf(o)>-1)t[o]=r(r({},t[o]),n[o]);else if(u.indexOf(o)>-1){var s=t[o]instanceof Array?t[o]:[t[o]],f=n[o]instanceof Array?n[o]:[n[o]];t[o]=[].concat(d(s),d(f))}else if(c.indexOf(o)>-1)for(var p in n[o])if(t[o][p]){var h=t[o][p]instanceof Array?t[o][p]:[t[o][p]],m=n[o][p]instanceof Array?n[o][p]:[n[o][p]];t[o][p]=[].concat(d(h),d(m))}else t[o][p]=n[o][p];else if("hook"===o)for(var v in n[o])t[o][v]?t[o][v]=Oe(t[o][v],n[o][v]):t[o][v]=n[o][v];else t[o]=n[o];else a.indexOf(o)>-1||c.indexOf(o)>-1||l.indexOf(o)>-1?t[o]=r({},n[o]):u.indexOf(o)>-1?t[o]=n[o]instanceof Array?d(n[o]):"object"===i(n[o])?r({},n[o]):n[o]:t[o]=n[o];return t}),n)},Oe=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},Se=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],Re=["validate","children","control"],je=["effect","deep","renderSlots"];function Ee(){return[].concat(Se,d(ke),d($e),d(Ce),Re,je)}function Fe(e){return De(e.replace(/(-[a-z])/g,(function(e){return e.replace("-","").toLocaleUpperCase()})))}function De(e){return e.replace(e[0],e[0].toLowerCase())}function Ae(e,t){return{value:e,enumerable:!1,configurable:!1,writable:!!t}}function Pe(e,t){return Ie([e],t||!1)[0]}function Ie(e,t){return K([],d(e),t||!1)}function Ne(e,t){return Ve(Array.isArray(t)?t:[t],e,{array:Re,normal:je}),e}function Be(e){var t=N.Function(e.getRule)?e.getRule():e;return t.type||(t.type="input"),t}function Te(e,t){Object.defineProperties(e,Object.keys(t).reduce((function(e,n){return e[n]={get:function(){return t[n]()}},e}),{}))}function Le(e){return e.__fc__||(e.__origin__?e.__origin__.__fc__:null)}function Me(e,t){try{t=e()}catch(e){!function(e){ue(e.toString()),console.error(e)}(e)}return t}function Ue(){var e={},n=function(e){return e||"default"};return{setSlot:function(t,r){t=n(t),!r||Array.isArray(r)&&r.length||(e[t]||(e[t]=[]),e[t].push(r))},getSlot:function(t,r){t=n(t);var i=[];return(e[t]||[]).forEach((function(e){if(Array.isArray(e))i.push.apply(i,d(e));else if(N.Function(e)){var t=e.apply(void 0,d(r||[]));Array.isArray(t)?i.push.apply(i,d(t)):i.push(t)}else N.Undef(e)||i.push(e)})),i},getSlots:function(){var t=this,n={};return Object.keys(e).forEach((function(e){n[e]=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.getSlot(e,r)}})),n},slotLen:function(t){return t=n(t),e[t]?e[t].length:0},mergeBag:function(e){var n=this;if(!e)return this;var r=N.Function(e.getSlots)?e.getSlots():e;return Array.isArray(e)||t.isVNode(e)?this.setSlot(void 0,(function(){return e})):Object.keys(r).forEach((function(e){n.setSlot(e,r[e])})),this}}}function qe(e){var t=r({},e.props||{});return Object.keys(e.on||{}).forEach((function(n){n.indexOf("-")>0&&(n=Fe(n));var r="on".concat(oe(n));Array.isArray(t[r])?t[r]=[].concat(d(t[r]),[e.on[n]]):t[r]?t[r]=[t[r],e.on[n]]:t[r]=e.on[n]})),t.key=e.key,t.ref=e.ref,t.class=e.class,t.id=e.id,t.style=e.style,t.slot&&delete t.slot,t}function ze(e,t){return Object.setPrototypeOf(e,t),e}var He=function(e,t){return"string"==typeof e?String(t):"number"==typeof e?Number(t):t},Ye={"==":function(e,t){return JSON.stringify(e)===JSON.stringify(He(e,t))},"!=":function(e,t){return!Ye["=="](e,t)},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},on:function(e,t){return e&&e.indexOf&&e.indexOf(He(e[0],t))>-1},notOn:function(e,t){return!Ye.on(e,t)},in:function(e,t){return t&&t.indexOf&&t.indexOf(e)>-1},notIn:function(e,t){return!Ye.in(e,t)},between:function(e,t){return e>t[0]&&e<t[1]},notBetween:function(e,t){return e<t[0]||e>t[1]},empty:function(e){return N.empty(e)},notEmpty:function(e){return!N.empty(e)},pattern:function(e,t){return new RegExp(t,"g").test(e)}};function Ge(e,t){return(Array.isArray(t)?t:(t||"").split(".")).forEach((function(t){null!=e&&(e=e[t])})),e}function Je(e){var t=e.split("."),n=[],r="";return t.forEach((function(e,t){0===t?r=e:r+="."+e,n.push(r)})),n.join(" && ")}function We(e){for(var t=[],n="",r=0,i=0;i<e.length;i++){var o=e[i];"["===o?(0===r&&n&&(t.push({type:"key",value:n}),n=""),r++,n+=o):"]"===o?(n+=o,0===--r&&(t.push({type:"bracket",value:We(n.slice(1,-1))}),n="")):"."===o&&0===r?n&&(t.push({type:"key",value:n}),n=""):n+=o}return n&&t.push({type:"key",value:n}),t.map((function(e){return"key"===e.type?{key:e.value}:{children:e.value}}))}var Ke=function(e,t){if(e&&e!==t)return e.props.formCreateInject?e.props.formCreateInject:e.parent?Ke(e.parent,t):void 0};function Xe(e,n,i){return t.defineComponent({name:"FormCreate"+(e.isMobile?"Mobile":""),components:n,directives:i,props:{rule:{type:Array,required:!0,default:function(){return[]}},option:{type:Object,default:function(){return{}}},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","submit","reset","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(n){var i=t.getCurrentInstance();t.provide("parentFC",i);var o=t.inject("parentFC",null),a=o;if(o)for(;a.setupState.parent;)a=a.setupState.parent;else a=i;var u=t.toRefs(n),c=u.rule,l=u.modelValue,s=u.subForm,f=u.inFor,p=t.reactive({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:d(c.value||[]),updateValue:JSON.stringify(l.value||{})}),h=new e(i),m=h.api(),g=f.value,y=null;t.onBeforeMount((function(){t.watchEffect((function(){var e="",t=n.option&&n.option.globalClass||{};Object.keys(t).forEach((function(n){var r="";t[n].style&&Object.keys(t[n].style).forEach((function(e){r+=ie(e)+":"+t[n].style[e]+";"})),t[n].content&&(r+=t[n].content+";"),r&&(e+=".".concat(n,"{").concat(r,"}"))})),n.option&&n.option.style&&(e+=n.option.style),y||((y=document.createElement("style")).type="text/css",document.head.appendChild(y)),y.innerHTML=e||""}))}));var b=te((function(){h.bus.$emit("$loadData.$topForm")}),100),_=te((function(){h.bus.$emit("$loadData.$scopeForm")}),100),x=te((function(){h.bus.$emit("$loadData.$form")}),100),w=function(e){h.bus.$emit("change-$form."+e)};return t.onMounted((function(){o&&(m.top.bus.$on("$loadData.$form",b),m.top.bus.$on("change",w)),m!==m.scope&&m.scope.bus.$on("$loadData.$scopeForm",_),h.mounted()})),t.onBeforeUnmount((function(){o&&(m.top.bus.$off("$loadData.$form",b),m.top.bus.$off("change",w)),m!==m.scope&&m.scope.bus.$off("$loadData.$scopeForm",_),function(){var e=Ke(i,o);if(e)if(g){var t=v(e.getSubForm()),n=t.indexOf(m);n>-1&&t.splice(n,1)}else e.subForm()}(),p.destroyed=!0,h.unmount(),y&&(y.parentNode||y.parentElement)&&document.head.removeChild(y)})),t.onUpdated((function(){h.updated()})),function(){if(o){var e,t=Ke(i,o);if(t)g?(e=v(t.getSubForm())).push(m):e=m,t.subForm(e)}}(),t.watch((function(){return n.option}),(function(){h.initOptions(),m.refresh()}),{deep:!0,flush:"sync"}),t.watch((function(){return d(c.value)}),(function(e){h.$handle.isBreakWatch()||e.length===p.renderRule.length&&e.every((function(e){return p.renderRule.indexOf(e)>-1}))||(h.$handle.updateAppendData(),h.$handle.reloadRule(c.value),i.setupState.renderRule())})),t.watch((function(){return[n.disabled,n.preview]}),(function(){m.refresh()})),t.watch(l,(function(e){se(e||{})!==p.updateValue&&(m.config.forceCoverValue?m.coverValue(e||{}):m.setValue(e||{}))}),{deep:!0,flush:"post"}),t.watch((function(){return n.index}),(function(){m.coverValue({}),h.$handle.updateAppendData(),t.nextTick((function(){t.nextTick((function(){m.clearValidateState()}))}))}),{flush:"sync"}),r(r({fc:t.markRaw(h),parent:o?t.markRaw(o):o,top:t.markRaw(a),fapi:t.markRaw(m)},t.toRefs(p)),{},{getGroupInject:function(){return Ke(i,o)},refresh:function(){++p.unique},renderRule:function(){p.renderRule=d(c.value||[])},updateValue:function(e){if(!p.destroyed){var n=se(e);p.updateValue!==n&&(p.updateValue=n,i.emit("update:modelValue",e),t.nextTick((function(){x(),o?s.value||_():(b(),_())})))}}})},created:function(){var e=t.getCurrentInstance();e.emit("update:api",e.setupState.fapi),e.setupState.fc.init()}})}function Ze(e,t){return function(n,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=new Qe(e,n,r,i,o);return t&&(N.Function(t)?t(a):a.props(t)),a}}function Qe(e,t,n,r,i){this._data=Q({props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0},{type:e,title:t,field:n,value:r,props:i||{}}),this.event=this.on}function et(e){e.forEach((function(e){Qe.prototype[e]=function(t){return Ne(this._data,a({},e,arguments.length<2?t:a({},t,arguments[1]))),this}}))}Q(Qe.prototype,{getRule:function(){return this._data},setProp:function(e,t){return J(this._data,e,t),this},modelField:function(e){return this._data.modelField=e,this},_clone:function(){var e=new this.constructor;return e._data=Pe(this._data),e}}),et(Ee());var tt=Ze("");function nt(e,t,n){var r=tt("",t);return r._data.type=e,r._data.title=n,r}function rt(){return{create:nt,factory:Ze}}function it(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function ot(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,r=e.action||"";if(n.upload&&e.onProgress&&n.upload.addEventListener("progress",(function(t){t.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(t)})),e.query){var i=N.String(e.query)?e.query:Object.keys(e.query).reduce((function(t,n){return t[n]=null===e.query[n]||void 0===e.query[n]?"":e.query[n],t}),{}),o=new URLSearchParams(i).toString();o&&(r.includes("?")?r+="&".concat(o):r+="?".concat(o))}n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||n.status>=300)return e.onError(function(e,t,n){var r="fail to ".concat(e," ").concat(n.status,"'"),i=new Error(r);return i.status=n.status,i.url=e,i}(r,0,n),it(n));e.onSuccess(it(n))},n.open(e.method||"get",r,!0),(e.data||e.file)&&(e.file||"json"!==(e.dataType||"").toLowerCase()?(t=new FormData,Object.keys(e.data||{}).map((function(n){t.append(n,e.data[n])}))):(t=JSON.stringify(e.data||{}),n.setRequestHeader("content-type","application/json"))),e.file&&t.append(e.filename,e.file,e.file.name),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var a=e.headers||{};Object.keys(a).forEach((function(e){null!=a[e]&&n.setRequestHeader(e,a[e])})),n.send(t)}}function at(e,t,n){return new Promise((function(i,o){(t||ot)(r(r({},e),{},{onSuccess:function(t){var r=function(e){return e},o=de(e.parse);N.Function(o)?r=o:o&&N.String(o)&&(r=function(e){return Ge(e,o)}),re(r(t,e.targetRule,n)).then((function(e){i(e)}))},onError:function(e){o(e)}}))}))}function ut(e){return X(e)}var ct=1;function lt(e){Q(this,{$handle:e,fc:e.fc,vm:e.vm,$manager:e.$manager,vNode:new e.fc.CreateNode(e),force:!1,tmpInput:null,id:ct++}),Te(this,{options:function(){return e.options},sort:function(){return e.sort}}),this.initCache(),this.initRender()}!function(e){Q(e.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){e.rule.cache||(this.cache[e.id]?((!0===this.cache[e.id].use||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):e.parent&&this.clearCache(e.parent))},clearCacheAll:function(){this.cache={}},setCache:function(e,t,n){this.cache[e.id]={vnode:t,use:!1,parent:n,slot:e.rule.slot}},getCache:function(e){var t=this.cache[e.id];if(t)return t.use=!0,t.vnode}})}(lt),function(e){Q(e.prototype,{initRender:function(){this.cacheConfig={}},getTypeSlot:function(e){return function t(n){if(n){var r=void 0;return e.rule.field&&(r=n.slots["field-"+ie(e.rule.field)]||n.slots["field-"+e.rule.field]),r||(r=n.slots["type-"+ie(e.type)]||n.slots["type-"+e.type]),r||t(n.setupState.parent)}}(this.vm)},render:function(){var e=this;if(this.vm.setupState.isShow){this.$manager.beforeRender();var t=Ue();return this.sort.forEach((function(n){e.renderSlot(t,e.$handle.ctxs[n])})),this.$manager.render(t)}},renderSlot:function(e,t,n){if(this.isFragment(t)){t.initProp(),this.mergeGlobal(t),t.initNone();var r=this.renderChildren(t.loadChildrenPending(),t),i=r.default;i&&e.setSlot(t.rule.slot,(function(){return i()})),delete r.default,e.mergeBag(r)}else e.setSlot(t.rule.slot,this.renderCtx(t,n))},mergeGlobal:function(e){var n=this;this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=t.computed((function(){var t=n.$handle.options.global;return Ne({},[t["*"]||t.default||{},t[e.originType]||t[e.type]||t[e.type]||{}])}))),e.prop=Ne({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions:function(e){var t=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=t,e.prop.optionsTo&&t&&ve(e.prop,e.prop.optionsTo,t)},deepSet:function(e){var t=e.prop.deep;t&&Object.keys(t).sort((function(e,t){return e.length<t.length?-1:1})).forEach((function(n){ve(e.prop,n,t[n])}))},parseSide:function(e,t){return N.Object(e)?Ne({props:{formCreateInject:t.prop.props.formCreateInject}},e):e},renderSides:function(e,t,n){var r=t[n?"rule":"prop"];return[this.renderRule(this.parseSide(r.prefix,t)),e,this.renderRule(this.parseSide(r.suffix,t))]},renderId:function(e,t){var n=this,r=this.$handle["field"===t?"fieldCtx":"nameCtx"][e];return r?r.map((function(e){return n.renderCtx(e,e.parent)})):void 0},renderCtx:function(e,t){var n=this;try{if("hidden"===e.type)return;var r=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==r.slot){var i;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var o=e.prop;o.preview=!!(null!=o.preview?o.preview:this.$handle.preview),o.props.formCreateInject=this.injectProp(e);var a=!1!==o.cache,u=o.preview;if(o.hidden)return void this.setCache(e,void 0,t);i=function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];var s={rule:r,prop:o,preview:u,api:n.$handle.api,model:o.model||{},slotValue:c};c.length&&r.slotUpdate&&Me((function(){return r.slotUpdate(s)}));var f={},d=e.loadChildrenPending();e.parser.renderChildren?f=e.parser.renderChildren(d,e):!1!==e.parser.loadChildren&&(f=n.renderChildren(d,e)),Object.keys(o.renderSlots||{}).forEach((function(t){f[t]=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];if(N.Function(o.renderSlots[t]))return Me((function(){var e;return(e=o.renderSlots)[t].apply(e,i)}));var u=n.parseSide(o.renderSlots[t],e);return n.renderRule(u)}}));var p,h=n.getTypeSlot(e);return h?(s.children=f,p=h(s)):p=u?e.parser.preview(ee(f),e):e.parser.render(ee(f),e),p=n.renderSides(p,e),!e.input&&N.Undef(o.native)||!0===o.native||(n.fc.targetFormDriver("updateWrap",e),p=n.$manager.makeWrap(e,p)),e.none&&(p=Array.isArray(p)?p.map((function(e){return e&&e.__v_isVNode?n.none(e):e})):n.none(p)),a&&n.setCache(e,(function(){return n.stable(p)}),t),p},this.setCache(e,i,t)}return function(){var t=n.getCache(e);if(t)return t.apply(void 0,arguments);if(!n.cache[e.id]){var r=n.renderCtx(e,e.parent);return r?r():void 0}}}catch(e){return void console.error(e)}},none:function(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass:function(e,t){return Array.isArray(e)?(e.push(t),e):e?[e,t]:t},stable:function(e){var t=this;return(Array.isArray(e)?e:[e]).forEach((function(e){e&&e.__v_isVNode&&e.children&&"object"===i(e.children)&&(e.children.$stable=!0,t.stable(e.children))})),e},getModelField:function(e){return e.prop.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"fragment"===e.type||"template"===e.type},injectProp:function(e){var t=this,n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:function(n){t.$handle.addSubForm(e,n)},getSubForm:function(){return t.$handle.subForm[e.id]},slots:function(){return t.vm.setupState.top.slots},getWrap:function(){return t.vm.refs[e.wrapRef]},options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:function(){var e;return(e=t.$handle.api).t.apply(e,arguments)},updateValue:function(n){t.$handle.onUpdateValue(e,n)}});var r=n.ctxInject[e.id];return Q(r,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),r},ctxProp:function(e){var t=this,n=e.ref,i=e.key,o=e.rule;this.$manager.mergeProp(e),e.parser.mergeProp(e);var u=[{ref:n,key:o.key||"".concat(i,"fc"),slot:void 0,on:{vnodeMounted:function(n){n.el.__rule__=e.rule,t.onMounted(e,n.el)},"fc.updateValue":function(n){t.$handle.onUpdateValue(e,n)},"fc.el":function(t){e.exportEl=t,t&&((t.$el||t).__rule__=e.rule)}}}];if(e.input){var c=this.tmpInput;!0===this.vm.props.disabled&&(e.prop.props.disabled=!0);var l=this.getModelField(e),s={callback:function(n){c&&c(e.field,n,e.rule),t.onInput(e,n)},modelField:l,value:this.$handle.getFormData(e)};u.push({on:r(a({},"update:".concat(l),s.callback),e.prop.modelEmit?a({},e.prop.modelEmit,(function(){return t.onEmitInput(e)})):{}),props:a({},l,s.value)}),e.prop.model=s}return Ve(u,e.prop),e.prop},onMounted:function(e,t){e.el=this.vm.refs[e.ref]||t,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput:function(e,t){e.prop.modelEmit?this.$handle.onBaseInput(e,t):this.$handle.onInput(e,t)},onEmitInput:function(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren:function(e,n){var r=this;if(!N.trueArray(e))return{};var i=Ue();return e.map((function(o){if(o)return N.String(o)||N.Number(o)?i.setSlot(null,"".concat(o)):o.__fc__?r.renderSlot(i,o.__fc__,n):void(o.type&&t.nextTick((function(){r.$handle.loadChildren(e,n),r.$handle.refresh()})))})),i.getSlots()},defaultRender:function(e,t){var n=e.prop;return n.component?"string"==typeof n.component?this.vNode.make(n.component,n,t):this.vNode.makeComponent(n.component,n,t):this.vNode[e.type]?this.vNode[e.type](n,t):this.vNode[e.originType]?this.vNode[e.originType](n,t):this.vNode.make(De(n.type),n,t)},createChildrenVnodes:function(e,t,n){this.force=!1!==n,this.tmpInput=t;var r=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,r},createRuleVnode:function(e,t,n){this.force=!1!==n,this.tmpInput=t;var r=Ue();return this.renderSlot(r,e,e.parent),this.force=!1,this.tmpInput=null,r.getSlots()},renderRule:function(e,t,n){var i=this;if(e){if(N.String(e)||N.Number(e))return"".concat(e);var o;if(n)o=e.type;else if(o=e.is,e.type){o=Fe(e.type);var a=this.vNode.aliasMap[o];a&&(o=Fe(a))}if(o){var u=Ue();N.trueArray(e.children)&&e.children.forEach((function(e){e&&u.setSlot(null==e?void 0:e.slot,(function(){return i.renderRule(e)}))}));var c=r({},e);return delete c.type,delete c.is,this.vNode.make(o,c,u.mergeBag(t).getSlots())}}}})}(lt);var st=["hook:updated","hook:mounted"];function ft(e,n,i){var o,a=me(),u=!!n.field;Q(this,{id:a,ref:a,wrapRef:a+"fi",rule:n,origin:n.__origin__||n,name:n.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:n.subRule?this:null,cacheConfig:null,prop:r({},n),computed:{},payload:{},refRule:{},input:u,el:void 0,exportEl:void 0,defaultValue:u?X(i):void 0,field:n.field||void 0}),this.updateKey(),o=this,Object.defineProperties(o.origin,{__fc__:Ae(t.markRaw(o),!0)}),o.rule!==o.origin&&Object.defineProperties(o.rule,{__fc__:Ae(t.markRaw(o),!0)}),this.update(e,!0)}function dt(e,t){for(var n=0;n<e.ctrlRule.length;n++){var r=e.ctrlRule[n];if(r.children===t)return r}}function pt(e){return!!e.rule.__ctrl}function ht(e,t){return"function"==typeof t?""+t:t}Q(ft.prototype,{getParentGroup:function(){for(var e=this.parent;e;){if(e.group)return e;e=e.parent}},loadChildrenPending:function(){var e=this,t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:function(t){e.$handle&&e.$handle.loadChildren(t,e)},onUpdate:function(t,n){e.$handle&&(t===n?e.$handle.loadChildren(t,e):e.$handle.updateChildren(e,t,n))},onReload:function(t){e.$handle?e.$handle.updateChildren(e,[],t):delete e.pending.children}})},loadPending:function(e){var t=this,n=e.key,r=e.origin,i=e.def,o=e.onLoad,a=e.onReload,u=e.onUpdate;if(this.pending[n]&&this.pending[n].origin===r)return this.getPending(n,i);delete this.pending[n];var c=r;if(N.Function(r)){var l=Me((function(){return r({rule:t.rule,api:t.$api,update:function(e){var o=e||i,a=t.getPending(n,i);t.setPending(n,r,o),u&&u(o,a)},reload:function(){var e=t.getPending(n,i);delete t.pending[n],a&&a(e),t.$api&&t.$api.sync(t.rule)}})}));l&&N.Function(l.then)?(l.then((function(e){var a=e||i;t.setPending(n,r,a),o&&o(a),t.$api&&t.$api.sync(t.rule)})).catch((function(e){console.error(e)})),c=i,this.setPending(n,r,c)):(c=l||i,this.setPending(n,r,c),o&&o(c))}return c},getPending:function(e,t){return this.pending[e]&&this.pending[e].value||t},setPending:function(e,n,r){this.pending[e]={origin:n,value:t.reactive(r)}},effectData:function(e){return this.payload[e]||(this.payload[e]={}),this.payload[e]},clearEffectData:function(e){void 0===e?this.payload={}:delete this.payload[e]},updateKey:function(e){this.key=me(),e&&this.parent&&this.parent.updateKey(e)},updateType:function(){this.originType=this.rule.type,this.type=Fe(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser:function(e){this.parser=e,e.init(this)},initProp:function(){var e,t,n=this,i=r({},this.rule);delete i.children,delete i.validate,this.prop=Ne({},[i].concat(d(Object.keys(this.payload).map((function(e){return n.payload[e]}))),[this.computed])),this.prop.validate=[].concat(d((null===(e=this.refRule)||void 0===e||null===(t=e.__$validate)||void 0===t?void 0:t.value)||[]),d(this.prop.validate||[]))},initNone:function(){this.none=!(N.Undef(this.prop.display)||this.prop.display)},hasHidden:function(){return!!this.rule.hidden||!!this.parent&&this.parent.hasHidden()},injectValidate:function(){return this.prop.validate},check:function(e){return this.vm===e.vm},unwatch:function(){var e=this;this.watch.forEach((function(e){return e()})),this.watch=[],Object.keys(this.refRule).forEach((function(t){0!==t.indexOf("__$")&&delete e.refRule[t]}))},unlink:function(){this.linkOn.forEach((function(e){return e()})),this.linkOn=[]},link:function(){this.unlink(),this.$handle.appendLink(this)},watchTo:function(){this.$handle.watchCtx(this)},delete:function(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),Q(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl:function(){this.ctrlRule.forEach((function(e){return e.__fc__&&e.__fc__.rm()})),this.ctrlRule=[]},rm:function(){var e=this,t=function(){var t=e.root.indexOf(e.origin);t>-1&&(e.root.splice(t,1),e.$handle&&e.$handle.refresh())};this.deleted?t():this.$handle.noWatch((function(){e.$handle.deferSyncValue((function(){e.rmCtrl(),t(),e.$handle.rmCtx(e),Q(e,{root:[]})}),e.input)}))},update:function(e,t){Q(this,{deleted:!1,$handle:e,$render:e.$render,$api:e.api,vm:e.vm,vNode:e.$render.vNode,updated:!1,cacheValue:this.rule.value}),!t&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});var mt={init:function(e){},toFormValue:function(e,t){return e},toValue:function(e,t){return e},mounted:function(e){},render:function(e,t){return t.$handle.fc.renderDriver&&t.$handle.fc.renderDriver.defaultRender?t.$handle.fc.renderDriver.defaultRender(t,e):t.$render.defaultRender(t,e)},preview:function(e,t){return t.$handle.fc.renderDriver&&t.$handle.fc.renderDriver.defaultPreview?t.$handle.fc.renderDriver.defaultPreview(t,e):this.render(e,t)},mergeProp:function(e){}},vt=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],gt=Symbol("oldValue");function yt(e){var n=this;Te(this,{options:function(){return e.options.value||{}},bus:function(){return e.bus},preview:function(){return null!=e.vm.props.preview?e.vm.props.preview:e.vm.setupState.parent&&null!=e.vm.setupState.parent.props.preview?e.vm.setupState.parent.props.preview:e.options.value.preview||!1}}),Q(this,{fc:e,vm:e.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:t.reactive({}),subRuleData:t.reactive({}),subForm:{},form:t.reactive({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:function(){n.lifecycle("reload")}}),this.initData(e.rules),this.$manager=new e.manager(this),this.$render=new lt(this),this.api=e.extendApiFn.reduce((function(e,t){var r=Me((function(){return t(e,n)}));return r&&r!==e&&Q(e,r),e}),function(e){function n(t){return N.Undef(t)?t=e.fields():Array.isArray(t)||(t=[t]),t}function o(t,n,i){N.Undef(t)?t=Object.keys(r(r({},e.fieldCtx),e.nameCtx)):Array.isArray(t)||(t=[t]),t.forEach((function(t){var r=e.fieldCtx[t]||e.nameCtx[t];r&&r.forEach((function(t){J(t.rule,n,i),e.$render.clearCache(t)}))}))}function u(){var t=e.subForm;return Object.keys(t).reduce((function(e,n){var r=t[n];return r?(Array.isArray(r)?e.push.apply(e,d(r)):e.push(r),e):e}),[])}var c={get isScope(){return!1===e.vm.props.subForm},get isPreview(){return e.preview},get config(){return e.options},set config(t){e.fc.options.value=t},get options(){return e.options},set options(t){e.fc.options.value=t},get form(){return e.form},get rule(){return e.rules},get parent(){return e.vm.setupState.parent&&e.vm.setupState.parent.setupState.fapi},get top(){return c.parent?c.parent.top:c},get scope(){for(var t=e.vm;t&&t.setupState.fapi;){if(!t.props.subForm)return t.setupState.fapi;t=t.setupState.parent}return c.top},get children(){return u()},get siblings(){var t=e.vm.setupState.getGroupInject();if(t){var n=t.getSubForm();if(Array.isArray(n))return d(n)}},get index(){var e=c.siblings;if(e){var t=e.indexOf(c);return t>-1?t:void 0}},get formulas(){return r({},e.fc.formulas)},formData:function(t){if(null==t||"boolean"==typeof t){var r={};return Object.keys(e.form).forEach((function(n){!0!==t&&-1!==e.ignoreFields.indexOf(n)||(r[n]=ut(e.form[n]))})),r}return n(t).reduce((function(e,t){return e[t]=c.getValue(t),e}),{})},getValue:function(t){var n=e.getFieldCtx(t);return n?ut(n.rule.value):!1!==e.options.appendValue&&B(e.appendData,t)?ut(e.appendData[t]):void 0},coverValue:function(t){var n=r({},t||{});e.deferSyncValue((function(){e.appendData={},c.fields().forEach((function(r){var i=e.fieldCtx[r];if(i){var o=B(t,r);i.forEach((function(e){e.rule.value=o?t[r]:void 0})),delete n[r]}})),Q(e.appendData,n)}),!0)},setValue:function(t){var n=t;arguments.length>=2&&(n=a({},t,arguments[1])),e.deferSyncValue((function(){Object.keys(n).forEach((function(t){var r=e.fieldCtx[t];if(!r)return e.appendData[t]=n[t];r.forEach((function(e){e.rule.value=n[t]}))}))}),!0)},removeField:function(t){var n=e.getCtx(t);return e.deferSyncValue((function(){e.getCtxs(t).forEach((function(e){e.rm()}))}),!0),n?n.origin:void 0},removeRule:function(e){var t=e&&Le(e);if(t)return t.rm(),t.origin},fields:function(){return e.fields()},append:function(t,n,r){var i,o=e.sort.length-1,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return;o=a.rule.children.length-1}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o+1,0,t)},prepend:function(t,n,r){var i,o=0,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o,0,t)},hidden:function(t,n){o(n,"hidden",!!t),e.refresh()},hiddenStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.hidden},display:function(t,n){o(n,"display",!!t),e.refresh()},displayStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.display},disabled:function(t,r){n(r).forEach((function(n){e.getCtxs(n).forEach((function(e){J(e.rule.props,"disabled",!!t)}))})),e.refresh()},all:function(t){return Object.keys(e.ctxs).map((function(n){var r=e.ctxs[n];return t?r.origin:r.rule}))},model:function(t){return e.fields().reduce((function(n,r){var i=e.fieldCtx[r][0];return n[r]=t?i.origin:i.rule,n}),{})},component:function(t){return Object.keys(e.nameCtx).reduce((function(n,r){var i=e.nameCtx[r].map((function(e){return t?e.origin:e.rule}));return n[r]=1===i.length?i[0]:i,n}),{})},bind:function(){return c.form},reload:function(t){e.reloadRule(t)},updateOptions:function(t){e.fc.updateOptions(t),c.refresh()},onSubmit:function(e){c.updateOptions({onSubmit:e})},sync:function(t){if(Array.isArray(t))t.forEach((function(e){return c.sync(e)}));else{var n=N.Object(t)?Le(t):e.getCtxs(t);n&&((n=Array.isArray(n)?n:[n]).forEach((function(t){if(!t.deleted){var n=e.subForm[t.id];n&&(Array.isArray(n)?n.forEach((function(e){e.refresh()})):n&&n.refresh()),e.$render.clearCache(t)}})),e.refresh())}},refresh:function(){u().forEach((function(e){e.refresh()})),e.$render.clearCacheAll(),e.refresh()},refreshOptions:function(){e.$manager.updateOptions(e.options),c.refresh()},hideForm:function(t){e.vm.setupState.isShow=!t},changeStatus:function(){return e.changeStatus},clearChangeStatus:function(){e.changeStatus=!1},updateRule:function(t,n){e.getCtxs(t).forEach((function(e){Q(e.rule,n)}))},updateRules:function(e){Object.keys(e).forEach((function(t){c.updateRule(t,e[t])}))},mergeRule:function(t,n){e.getCtxs(t).forEach((function(e){Ne(e.rule,n)}))},mergeRules:function(e){Object.keys(e).forEach((function(t){c.mergeRule(t,e[t])}))},getRule:function(t,n){var r=e.getCtx(t);if(r)return n?r.origin:r.rule},findType:function(t,n){var r=void 0;return Object.keys(e.ctxs).forEach((function(i){var o=e.ctxs[i];o.rule.type===t&&(r=n?o.origin:o.rule)})),r},findTypes:function(t,n){var r=[];return Object.keys(e.ctxs).forEach((function(i){var o=e.ctxs[i];o.rule.type===t&&r.push(n?o.origin:o.rule)})),r},getRenderRule:function(t){var n=e.getCtx(t);if(n)return n.prop},getRefRule:function(t){var n=e.getCtxs(t);if(n){var r=n.map((function(e){return e.rule}));return 1===r.length?r[0]:r}},setEffect:function(t,n,r){var i=e.getCtx(t);i&&n&&("$"===n[0]&&(n=n.substr(1)),B(i.rule,"$"+n)&&J(i.rule,"$"+n,r),B(i.rule,"effect")||(i.rule.effect={}),J(i.rule.effect,n,r))},clearEffectData:function(t,n){var r=e.getCtx(t);r&&(n&&"$"===n[0]&&(n=n.substr(1)),r.clearEffectData(n),c.sync(t))},updateValidate:function(e,t,n){n?c.mergeRule(e,{validate:t}):o(e,"validate",t)},updateValidates:function(e,t){Object.keys(e).forEach((function(n){c.updateValidate(n,e[n],t)}))},refreshValidate:function(){c.refresh()},resetFields:function(r){n(r).forEach((function(t){e.getCtxs(t).forEach((function(t){e.$render.clearCache(t),t.rule.value=ut(t.defaultValue)}))})),t.nextTick((function(){t.nextTick((function(){t.nextTick((function(){c.clearValidateState(r)}))}))})),null==r&&(N.Function(e.options.onReset)&&Me((function(){return e.options.onReset(c)})),e.vm.emit("reset",c))},method:function(e,t){var n=c.el(e);if(!n||!n[t])throw new Error(ae("err","".concat(t," 方法不存在")));return function(){return n[t].apply(n,arguments)}},exec:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return Me((function(){return c.method(e,t).apply(void 0,r)}))},toJson:function(e){return se(c.rule,e)},trigger:function(e,t){for(var n=c.el(e),r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];n&&n.$emit.apply(n,[t].concat(i))},el:function(t){var n=e.getCtx(t);if(n)return n.el||e.vm.refs[n.ref]},closeModal:function(t){e.bus.$emit("fc:closeModal:"+t)},getSubForm:function(t){var n=e.getCtx(t);return n?e.subForm[n.id]:void 0},getChildrenRuleList:function(t){var n="object"===i(t),r=n?Le(t):e.getCtx(t),o=r?r.rule:n?t:c.getRule(t);if(!o)return[];var a,u=[];return(a=r?r.loadChildrenPending():o.children)&&a.forEach((function(e){"object"===i(e)&&(e.field&&u.push(e),u.push.apply(u,d(c.getChildrenRuleList(e))))})),u},getParentRule:function(t){return("object"===i(t)?Le(t):e.getCtx(t)).parent.rule},getParentSubRule:function(t){var n="object"===i(t)?Le(t):e.getCtx(t);if(n){var r=n.getParentGroup();if(r)return r.rule}},getChildrenFormData:function(e,t){return c.getChildrenRuleList(e).reduce((function(e,n){return!0===n.ignore&&!0!==t||(e[n.field]=ut(n.value)),e}),{})},setChildrenFormData:function(t,n,r){var i=c.getChildrenRuleList(t);e.deferSyncValue((function(){i.forEach((function(e){B(n,e.field)?e.value=n[e.field]:r&&(e.value=void 0)}))}))},getGlobalEvent:function(e){var t=c.options.globalEvent[e];if(t)return"object"===i(t)&&(t=t.handle),de(t)},getGlobalData:function(t){return new Promise((function(n,r){var i=c.options.globalData[t];i?"fetch"===i.type?c.fetch(i).then((function(e){n(e)})).catch(r):n(i.data):n(e.fc.loadData[t])}))},emitGlobalEvent:function(t){var n=c.getGlobalEvent(t);if(n){for(var r=e.getInjectData({},void 0),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return r.args=[].concat(o),o.unshift(r),n.apply(null,o)}},setGlobalData:function(e,t){c.setData("$globalData."+e,t)},setGlobalVar:function(e,t){c.setData("$var."+e,t)},renderRule:function(t,n,r){var o="object"===i(t)?Le(t):e.getCtx(t);return o?e.$render.createRuleVnode(o,n,r):void 0},renderChildren:function(t,n,r){var o="object"===i(t)?Le(t):e.getCtx(t);return o?e.$render.createChildrenVnodes(o,n,r):void 0},nextTick:function(t){e.bus.$once("next-tick",t),e.refresh()},nextRefresh:function(t){e.nextRefresh(),t&&Me(t)},deferSyncValue:function(t,n){e.deferSyncValue(t,n)},emit:function(t){var n;e.vm.emitsOptions&&!e.vm.emitsOptions[t]&&(e.vm.emitsOptions[t]=null);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=e.vm).emit.apply(n,[t].concat(i))},bus:e.bus,getCurrentFormRule:function(){var t;return null===(t=e.vm.setupState.getGroupInject())||void 0===t?void 0:t.rule},fetch:function(t){return new Promise((function(n,r){t=X(t),t=e.loadFetchVar(t);var i=function(e){Me((function(){return t.onError&&t.onError(e)})),r(e)};e.beforeFetch(t).then((function(){return at(t,e.fc.create.fetch,c).then((function(e){Me((function(){return t.onSuccess&&t.onSuccess(e)})),n(e)})).catch((function(e){i(e)}))})).catch((function(e){i(e)}))}))},watchFetch:function(t,n,r,i){return e.fc.watchLoadData((function(o,a){var u=X(t);if(u=e.loadFetchVar(u,o),!i||!1!==i(u,a)){var l=function(e){Me((function(){return u.onError&&u.onError(e)})),r&&r(e)};e.beforeFetch(u).then((function(){return at(u,e.fc.create.fetch,c).then((function(e){Me((function(){return u.onSuccess&&u.onSuccess(e)})),n&&n(e,a)})).catch((function(e){l(e)}))})).catch((function(e){l(e)}))}}),null==t.wait?1e3:t.wait)},getData:function(t,n){return e.fc.get?e.fc.get(t,n):e.fc.getLoadData(t,n)},watchData:function(t){return e.fc.watchLoadData((function(e,n){Me((function(){return t(e,n)}))}))},setData:function(t,n,r){return e.fc.setData(t,n,r)},refreshData:function(t){return e.fc.refreshData(t)},t:function(t,n){return e.fc.t(t,n)},getLocale:function(){return e.fc.getLocale()},helper:{tidyFields:n,props:o}};return["on","once","off"].forEach((function(t){c[t]=function(){var n;(n=e.bus)["$".concat(t)].apply(n,arguments)}})),c.changeValue=c.changeField=c.setValue,c}(this))}Q(yt.prototype,{initData:function(e){Q(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:e})},init:function(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData:function(){this.appendData=r(r(r({},X(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch:function(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch:function(e){var t=this;return new Promise((function(n,r){var i=t.options.beforeFetch&&Me((function(){return t.options.beforeFetch(e,{api:t.api})}));i&&N.Function(i.then)?i.then(n).catch(r):n()}))},beforeFetch:function(e){var t=this;return new Promise((function(n,r){var i=e&&e.beforeFetch&&Me((function(){return e.beforeFetch(e,{api:t.api})}));i&&N.Function(i.then)?i.then(n).catch(r):!1===i?r():n()})).then((function(){return t.globalBeforeFetch(e)}))},beforeSubmit:function(e){var t=this;return new Promise((function(n,r){var i=t.options.beforeSubmit&&Me((function(){return t.options.beforeSubmit(e,{api:t.api})}));i&&N.Function(i.then)?i.then(n).catch(r):!1===i?r():n()}))}}),function(e){Q(e.prototype,{parseInjectEvent:function(e,t){var n=e.inject||this.options.injectEvent;return this.parseEventLst(e,t,n)},parseEventLst:function(e,t,n,r){var i=this;return Object.keys(t).forEach((function(o){var a=i.parseEvent(e,t[o],n,r);a&&(t[o]=a)})),t},parseEvent:function(e,t,n,r){if(N.Function(t)&&(!1!==n&&!N.Undef(n)||t.__inject))return this.inject(e,t,n);if(!r&&Array.isArray(t)&&t[0]&&(N.String(t[0])||N.Function(t[0])))return this.parseEventLst(e,t,n,!0);if(N.String(t)){var i=de(t);if(i&&t!==i)return i.__inject?this.parseEvent(e,i,n,!0):i}},parseEmit:function(e){var t=this,n={},r=e.rule,i=r.emitPrefix,o=r.field,a=r.name,u=r.inject,c=r.emit||[];return N.trueArray(c)&&c.forEach((function(e){if(e){var c,l=i||o||a;if(N.Object(e)&&(c=e.inject,l=(e=e.name).prefix||l),l){var s=ie("".concat(l,"-").concat(e)),f=function(){var e,n,r;t.vm.emitsOptions&&!t.vm.emitsOptions[s]&&(t.vm.emitsOptions[s]=null);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(e=t.vm).emit.apply(e,[s].concat(o)),(n=t.vm).emit.apply(n,["emit-event",s].concat(o)),(r=t.bus).$emit.apply(r,[s].concat(o))};if(f.__emit=!0,c||!1!==u){var d=c||u||t.options.injectEvent;n[Fe(e)]=N.Undef(d)?f:t.inject(r,f,d)}else n[Fe(e)]=f}}})),e.computed.on=n,n},getInjectData:function(e,t){var n=e.__fc__&&e.__fc__.$api,r=(e.__fc__&&e.__fc__.$handle.vm||this.vm).props,i=r.option,o=r.rule;return{$f:n||this.api,api:n||this.api,rule:o,self:e.__origin__,option:i,inject:t}},inject:function(e,t,n){if(t.__origin){if(this.watching&&!this.loading)return t;t=t.__origin}var r=this,i=function(){for(var i=r.getInjectData(e,n),o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return i.args=[].concat(a),a.unshift(i),t.apply(this,a)};return i.__origin=t,i.__json=t.__json,i},loadStrVar:function(e,t,n){var r=this;if(e&&"string"==typeof e&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){var i,o=e,a=function(e){for(var t,n=/{{\s*(.*?)\s*}}/g,r={};null!==(t=n.exec(e));)t[1]&&(r[t[1]]=!0);return Object.keys(r)}(e),u=function e(i){var o=[];i.forEach((function(t){t.key?o.push(t.key):t.children&&o.push(e(t.children))}));var a=!1;return o.forEach((function(e,t){null==e||0!==e.indexOf("'")&&0!==e.indexOf('"')||(o[t]=e.slice(1,-1),a=!0)})),1!==o.length||!a&&isNaN(Number(o[0]))?function(e){var i,o=!1;if(n&&0===e.indexOf("$form.")){var a=e.split(".");a.shift(),B(n.value,a[0])&&(o=!0,i=t?t({id:"$form."+a[0]+"_"+n.rule.__fc__.id,getValue:function(){return Ge(n.value,a)}}):Ge(n.value,a))}return o||(i=t?t(e):r.fc.getLoadData(e)),i}(o.join(".")):o[0]};if(a.forEach((function(t){var n=t.split("||"),r=n[0].trim();if(r){var o=(n[1]||"").trim(),a=We(r),c=Me((function(){return u(a)}));(null==c||""===c)&&n.length>1&&(c=o),i=c,e=e.replaceAll("{{".concat(t,"}}"),null==c?"":c)}})),1===a.length&&o==="{{".concat(a[0],"}}"))return i}return e},loadFetchVar:function(e,t,n){var r,i=this;n&&n.__fc__&&(r=n.__fc__.getParentGroup());var o=function(e){return i.loadStrVar(e,t,r?{rule:n,value:i.subRuleData[r.id]||{}}:null)};return e.action=o(e.action||""),["headers","data","query"].forEach((function(t){if(e[t]){var n=Array.isArray(e[t])?[]:{};Object.keys(e[t]).forEach((function(r){n[o(r)]=o(e[t][r])})),e[t]=n}})),e}})}(yt),function(e){Q(e.prototype,{usePage:function(){var e=this,t=this.options.page;if(t){var n,r=25,i=(n=this.rules).length<31?31:Math.ceil(n.length/3);N.Object(t)&&(t.first&&(r=parseInt(t.first,10)||r),t.limit&&(i=parseInt(t.limit,10)||i)),Q(this,{first:r,limit:i,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",(function(){return e.vm.emit("page-end",e.api)})),this.pageLoad()}},pageLoad:function(){var e=this;this.bus.$on(st,(function t(){e.pageEnd?(e.bus.$off(st,t),e.bus.$emit("page-end")):(e.first+=e.limit,e.pageEnd=e.rules.length<=e.first,e.loadRule(),e.refresh())}))}})}(yt),function(e){Q(e.prototype,{clearNextTick:function(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick:function(e){var t=this;this.clearNextTick(),this.nextTick=setTimeout((function(){e(),t.nextTick=null}),10)},render:function(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}(yt),function(e){Q(e.prototype,{nextRefresh:function(e){var n=this,r=this.loadedId;t.nextTick((function(){r===n.loadedId&&(e?e():n.refresh())}))},parseRule:function(e){var t=this,n=Be(e);return Object.defineProperties(n,{__origin__:Ae(e,!0)}),function(e){var t={props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0};Object.keys(t).forEach((function(n){B(e,n)||(e[n]=t[n])}))}(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach((function(e){e&&t.loadFn(e,n)})),this.loadCtrl(n),n.update&&(n.update=de(n.update)),n},loadFn:function(e,t){var n=this;["on","props","deep"].forEach((function(r){e[r]&&n.parseInjectEvent(t,e[r])}))},loadCtrl:function(e){e.control&&e.control.forEach((function(e){e.handle&&(e.handle=de(e.handle))}))},syncProp:function(e){var t=this,n=e.rule;N.trueArray(n.sync)&&Ve([{on:n.sync.reduce((function(e,r){return e["object"===i(r)&&r.event||"update:".concat(r)]=function(e){n.props["object"===i(r)&&r.prop||r]=e,t.vm.emit("sync",r,e,n,t.fapi)},e}),{})}],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,t){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,t),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(t)},_loadRule:function(e,t){var n=this,r=function t(r){var i=e[r-1];if(!i||!i.__fc__)return r>0?t(r-1):-1;var o=n.sort.indexOf(i.__fc__.id);return o>-1?o:t(r-1)},i=function(e,t){N.trueArray(e)&&n._loadRule(e,t)},o=e.map((function(o,a){if((!t||N.Object(o))&&(n.pageEnd||t||!(a>=n.first))){if(o.__fc__&&o.__fc__.root===e&&n.ctxs[o.__fc__.id])return i(o.__fc__.loadChildrenPending(),o.__fc__),o.__fc__;var u,c=Be(o),l=function(){return!(!c.field||!n.fieldCtx[c.field]||n.fieldCtx[c.field][0]===o.__fc__)};n.fc.targetFormDriver("loadRule",{rule:c,api:n.api},n.fc),n.ruleEffect(c,"init",{repeat:l()}),l()&&n.vm.emit("repeat-field",o,n.api);var s=!1,f=!!o.__fc__,d=c.value;if(f)if(d=(u=o.__fc__).defaultValue,u.deleted){if(pt(u))return;u.update(n)}else if(!u.check(n)){if(pt(u))return;e[a]=o=o._clone?o._clone():pe(se(o)),u=null,s=!0}if(u)u.originType!==u.rule.type&&u.updateType(),n.bindParser(u),n.appendValue(u.rule),u.parent&&u.parent!==t&&n.rmSubRuleData(u);else{var p=n.parseRule(o);u=new ft(n,p,d),n.bindParser(u)}n.parseEmit(u),n.syncProp(u),u.parent=t||null,u.root=e,n.setCtx(u),s||f||(n.effect(u,"load"),n.targetHook(u,"load")),n.effect(u,"created");var h=u.loadChildrenPending();if(!1===u.parser.loadChildren||i(h,u),!t){var m=r(a);m>-1||!a?n.sort.splice(m+1,0,u.id):n.sort.push(u.id)}var v=u.rule;return u.updated||(u.updated=!0,N.Function(v.update)&&n.bus.$once("load-end",(function(){n.refreshUpdate(u,v.value,"init")})),n.effect(u,"loaded")),n.refreshControl(u)&&(n.cycleLoad=!0),u}})).filter((function(e){return!!e}));t&&(t.children=o)},refreshControl:function(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl:function(e){var n=this,i=function(e){var t=e.rule.control||[];return N.Object(t)?[t]:t}(e),o=[],a=this.api;if(!i.length)return!1;for(var u=function(t){var n=i[t],u=n.handle||function(e){return(Ye[n.condition||"=="]||Ye["=="])(e,n.value)};if(!N.trueArray(n.rule))return"continue";var c=r(r({},n),{},{valid:Me((function(){return u(e.rule.value,a)})),ctrl:dt(e,n.rule),isHidden:N.String(n.rule[0])});if(c.valid&&c.ctrl||!c.valid&&!c.ctrl&&!c.isHidden)return"continue";o.push(c)},c=0;c<i.length;c++)u(c);if(!o.length)return!1;var l=[],s=!1;return this.deferSyncValue((function(){o.reverse().forEach((function(t){var r=t.isHidden,i=t.valid,o=t.rule,u=t.prepend,c=t.append,f=t.child,d=t.ctrl,p=t.method;if(r)return i?e.ctrlRule.push({__ctrl:!0,children:o,valid:i}):d&&e.ctrlRule.splice(e.ctrlRule.indexOf(d)>>>0,1),void l[i?"push":"unshift"]((function(){"disabled"===p||"enabled"===p?n.api.disabled(!i,o):"display"===p||"show"===p?n.api.display(i,o):"required"===p?(o.forEach((function(e){n.api.setEffect(e,"required",i)})),i||n.api.clearValidateState(o)):n.api.hidden(!i,o)}));if(i){s=!0;var h={type:"fragment",native:!0,__ctrl:!0,children:o};e.ctrlRule.push(h),n.bus.$once("load-start",(function(){u?a.prepend(h,u,f):c||f?a.append(h,c||e.id,f):e.root.splice(e.root.indexOf(e.origin)+1,0,h)}))}else{e.ctrlRule.splice(e.ctrlRule.indexOf(d),1);var m=Le(d);m&&m.rm()}}))})),l.length&&(this.loading?l.length&&this.bus.$once("load-end",(function(){l.forEach((function(e){return e()}))})):l.length&&t.nextTick((function(){l.forEach((function(e){return e()}))}))),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule:function(e){return this._reloadRule(e)},_reloadRule:function(e){var t=this;e||(e=this.rules);var n=r({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue((function(){t.bus.$once("load-end",(function(){Object.keys(n).filter((function(e){return void 0===t.ctxs[e]})).forEach((function(e){return t.rmCtx(n[e])})),t.$render.clearCacheAll()})),t.reloading=!0,t.loadRule(),t.reloading=!1,t.refresh(),t.bus.$emit("reloading",t.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()}})}(yt),function(e){Q(e.prototype,{setValue:function(e,n,r,i){var o=this;e.deleted||(e.rule.value=n,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,r),this.syncValue(),this.valueChange(e,n),this.vm.emit("change",e.field,n,e.origin,this.api,i||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:n}),this.emitEvent("change",e.field,n,{rule:e.origin,api:this.api,setFlag:i||!1}),i&&t.nextTick((function(){t.nextTick((function(){t.nextTick((function(){o.api.clearValidateState(e.id)}))}))})),this.$manager.fieldChange(e,n,r,i))},onInput:function(e,t){var n;e.input&&(this.isQuote(e,n=e.parser.toValue(t,e))||this.isChange(e,t))&&this.setValue(e,n,t)},onUpdateValue:function(e,t){var n=this;this.deferSyncValue((function(){var r=e.getParentGroup(),i=r?n.subRuleData[r.id]:null,o={};Object.keys(t||{}).forEach((function(e){i&&B(i,e)?o[e]=t[e]:B(n.api.form,e)?n.api.form[e]=t[e]:n.api.top!==n.api&&B(n.api.top.form,e)&&(n.api.top.form[e]=t[e])})),Object.keys(o).length&&n.api.setChildrenFormData(r.rule,o)}))},onBaseInput:function(e,t){this.setFormData(e,t),e.modelValue=t,this.nextRefresh(),this.$render.clearCache(e)},setFormData:function(e,t){e.modelValue=t;var n=e.getParentGroup();n&&(this.subRuleData[n.id]||(this.subRuleData[n.id]={}),this.subRuleData[n.id][e.field]=e.rule.value),J(this.formData,e.id,t)},rmSubRuleData:function(e){var t=e.getParentGroup();t&&this.subRuleData[t.id]&&delete this.subRuleData[t.id][e.field]},getFormData:function(e){return this.formData[e.id]},syncForm:function(){var e=this,n=t.reactive({}),r=this.fields(),i=[];!1!==this.options.appendValue&&Object.keys(this.appendData).reduce((function(n,i){return-1===r.indexOf(i)&&(n[i]=t.toRef(e.appendData,i)),n}),n),r.reduce((function(n,r){var o=(e.fieldCtx[r]||[]).filter((function(t){return!e.isIgnore(t)}))[0];return o||(o=e.fieldCtx[r][0],i.push(r)),n[r]=t.toRef(o.rule,"value"),n}),n),this.form=n,this.ignoreFields=i,this.syncValue()},isIgnore:function(e){return!0===e.rule.ignore||("hidden"===e.rule.ignore||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue:function(e){(e.field&&B(this.appendData,e.field)||N.Undef(e.value)&&this.options.forceCoverValue)&&(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm:function(e,t){this.subForm[e.id]=t},deferSyncValue:function(e,t){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=t),Me(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue:function(){var e=this;if(this.deferSyncFn)return this.deferSyncFn.sync=!0;var t={};Object.keys(this.form).forEach((function(n){-1===e.ignoreFields.indexOf(n)&&(t[n]=e.form[n])})),this.vm.setupState.updateValue(t)},isChange:function(e,t){return JSON.stringify(this.getFormData(e),ht)!==JSON.stringify(t,ht)},isQuote:function(e,t){return(t instanceof Function||N.Object(t)||Array.isArray(t))&&t===e.rule.value},refreshUpdate:function(e,t,n,r){var i=this;if(N.Function(e.rule.update)){var o=Me((function(){return e.rule.update(t,e.origin,i.api,{origin:n||"change",linkField:r})}));if(void 0===o)return;e.rule.hidden=!0===o}},valueChange:function(e,t){this.refreshRule(e,t),this.bus.$emit("change-"+e.field,t)},refreshRule:function(e,t,n,r){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,t,n,r)},appendLink:function(e){var t=this,n=e.rule.link;N.trueArray(n)&&n.forEach((function(n){var r=function(){return t.refreshRule(e,e.rule.value,"link",n)};t.bus.$on("change-"+n,r),e.linkOn.push((function(){return t.bus.$off("change-"+n,r)}))}))},fields:function(){return Object.keys(this.fieldCtx)}})}(yt),function(e){Q(e.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,t,n){var r="".concat(n,"Ctx");this[r][t]?this[r][t].push(e):this[r][t]=[e]},rmIdCtx:function(e,t,n){var r="".concat(n,"Ctx"),i=this[r][t];if(!i)return!1;var o=i.splice(i.indexOf(e)>>>0,1).length>0;return i.length||delete this[r][t],o},getFieldCtx:function(e){return(this.fieldCtx[e]||[])[0]},getNameCtx:function(e){return this.nameCtx[e]||[]},setCtx:function(e){var t=e.id,n=e.field,r=e.name,i=e.rule;this.ctxs[t]=e,r&&this.setIdCtx(e,r,"name"),e.input&&(this.setIdCtx(e,n,"field"),this.setFormData(e,e.parser.toFormValue(i.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,i.value,e.origin,this.api,!1,!0))},getParser:function(e){var t=this.fc.parsers,n=this.fc.renderDriver;if(n){var r=n.parsers||{},i=r[e.originType]||r[Fe(e.type)]||r[e.trueType];if(i)return i}return t[e.originType]||t[Fe(e.type)]||t[e.trueType]||mt},bindParser:function(e){e.setParser(this.getParser(e))},getType:function(e){var t=this.fc.CreateNode.aliasMap,n=t[e]||t[Fe(e)]||e;return Fe(n)},noWatch:function(e){this.noWatchFn||(this.noWatchFn=e),Me(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx:function(e){var n=this;if(Ee().filter((function(e){return"_"!==e[0]&&"$"!==e[0]&&-1===vt.indexOf(e)})).forEach((function(r){var i=t.toRef(e.rule,r),o="children"===r;e.refRule[r]=i,e.watch.push(t.watch(o?function(){return N.Function(i.value)?i.value:d(i.value||[])}:function(){return i.value},(function(a,u){var c=i.value;if(!n.isBreakWatch()){if(o&&!1===e.parser.loadChildren)return n.$render.clearCache(e),void n.nextRefresh();if(n.watching=!0,t.nextTick((function(){n.targetHook(e,"watch",{key:r,oldValue:u,newValue:c})})),"hidden"===r&&Boolean(c)!==Boolean(u)&&(n.$render.clearCacheAll(),t.nextTick((function(){n.targetHook(e,"hidden",{value:c})}))),"ignore"===r&&e.input||"hidden"===r&&("hidden"===e.rule.ignore||n.options.ignoreHiddenFields))n.syncForm();else{if("link"===r)return void e.link();["props","on","deep"].indexOf(r)>-1?(n.parseInjectEvent(e.rule,c||{}),"props"===r&&e.input&&n.setFormData(e,e.parser.toFormValue(e.rule.value,e))):"emit"===r?n.parseEmit(e):["prefix","suffix"].indexOf(r)>-1?c&&n.loadFn(c,e.rule):"type"===r?(e.updateType(),n.bindParser(e)):o&&(N.Function(u)&&(u=e.getPending("children",[])),N.Function(c)&&(c=e.loadChildrenPending()),n.updateChildren(e,c,u))}n.$render.clearCache(e),n.refresh(),n.watching=!1}}),{deep:!o,sync:o}))})),e.refRule.__$title=t.computed((function(){var t=("object"===i(e.rule.title)?e.rule.title.title:e.rule.title)||"";if(t){var r=t.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);r&&(t=n.api.t(r[1]))}return t})),e.refRule.__$info=t.computed((function(){var t=("object"===i(e.rule.info)?e.rule.info.info:e.rule.info)||"";if(t){var r=t.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);r&&(t=n.api.t(r[1]))}return t})),e.refRule.__$validate=t.computed((function(){var t=function(t){var r,i,o=t.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return o?n.api.t(o[1],{title:null===(r=e.refRule)||void 0===r||null===(i=r.__$title)||void 0===i?void 0:i.value}):t};return v(e.rule.validate).map((function(o){var a=r({},o);if(a.message&&(a.message=t(a.message)),N.Function(a.validator)){var u=e;a.validator=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.validator).call.apply(e,[{that:this,id:u.id,field:u.field,rule:u.rule,api:u.$handle.api}].concat(n))}}if(a.adapter){if("object"===i(a.error)){var c=r({},a.error);Object.keys(c).forEach((function(e){c[e]=t(c[e])})),a.error=c}return n.adapterValidate(a,e)}return a}))})),e.input){var o=t.toRef(e.rule,"value");e.watch.push(t.watch((function(){return o.value}),(function(){var t=e.parser.toFormValue(o.value,e);n.isChange(e,t)&&n.setValue(e,o.value,t,!0)})))}this.bus.$once("load-end",(function(){var r=e.rule.computed;r&&("object"!==i(r)&&(r={value:r}),Object.keys(r).forEach((function(i){var o=t.computed((function(){var t=r[i];if(t){var o=n.compute(e,t);return(t.linkage||t.linkageVariable)&&o===gt?gt:o}})),a=function(t){"value"===i?n.onInput(e,t):"$"===i[0]?n.api.setEffect(e.id,i,t):ve(e.rule,i,t)};("value"===i?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==Ge(e.rule,i))&&a(o.value),e.watch.push(t.watch(o,(function(e){e!==gt&&setTimeout((function(){a(e)}))}),{deep:!0}))})))})),this.watchEffect(e)},adapterValidate:function(e,t){var n=this;return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},(function(r,o){if(!1===(e.beforeValidate&&Me((function(){return e.beforeValidate({value:r,api:n.api,validate:e,rule:t.rule})}))))o();else{var a=n.validator(t,r,e);if(a){var u="";"object"===i(e.error)&&(u=e.error[a]||e.error.default),u||"string"!=typeof e.message||(u=e.message),u||(u=n.getValidateMessage(t,{key:a,rule:e[a]})),o(u)}else if(e.validator){var c=e.validator&&Me((function(){return e.validator(r,o)}));c&&N.Function(c.then)&&c.then((function(){return o()})).catch((function(e){return o(e)}))}else o()}}))},getValidateMessage:function(e,t){var n,r,i,o=Array.isArray(t.rule)?t.rule.join(","):""+t.rule;return this.api.t("required"===t.key?t.key:"validate."+t.key,(a(i={},t.key,o),a(i,"title",null===(n=e.refRule)||void 0===n||null===(r=n.__$title)||void 0===r?void 0:r.value),i))},validator:function(e,t,n){var r=this;if(N.empty(t))return n.required?"required":void 0;for(var o=function(){var n=f(u[a],2),o=n[0],c=n[1];switch(o){case"len":case"maxLen":case"minLen":var l=function(e){return"len"===o?e===c:"maxLen"===o?e<=c:e>=c};if(Array.isArray(t)){if(!l(t.length))return{v:o}}else{if("object"===i(t))return{v:o};if(!l((""+t).length))return{v:o}}break;case"pattern":if(!("string"==typeof c?new RegExp(c):c).test(""+t))return{v:o};break;case"uppercase":if(c&&("string"!=typeof t||!/^[A-Z]*$/.test(t)))return{v:o};break;case"lowercase":if(c&&("string"!=typeof t||!/^[a-z]*$/.test(t)))return{v:o};break;case"min":case"max":case"positive":case"negative":case"integer":case"number":var s=Number(t);if(Number.isNaN(s))return{v:o};if("min"===o&&s<c)return{v:o};if("max"===o&&s>c)return{v:o};if("positive"===o&&s<=0)return{v:o};if("negative"===o&&s>=0)return{v:o};if("integer"===o&&!Number.isInteger(s))return{v:o};break;case"equal":if(t!==c)return{v:o};break;case"enum":if(Array.isArray(c)&&!c.includes(t))return{v:o};break;case"hasKeys":if("object"!==i(t)||Array.isArray(c)&&c.some((function(e){return!(e in t)})))return{v:o};break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+t))return{v:o};break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+t))return{v:o};break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+t))return{v:o};break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+t))return{v:o};break;case"computed":if(!r.compute(e,c))return{v:o}}},a=0,u=Object.entries(n);a<u.length;a++){var c=o();if("object"===i(c))return c.v}},compute:function(e,t){var n,r=this;if("object"===i(t)){var o=e.getParentGroup(),a=function t(n){if(n=Array.isArray(n)?{mode:"AND",group:n}:n,!N.trueArray(n.group))return!0;for(var a="OR"===n.mode,u=!0,c=function(i){var c=n.group[i],l=void 0,s=null,f=null;if(c.variable)f=r.fc.getLoadData(c.variable);else if(c.field)s=Je(c.field||"");else if(!c.mode)return{v:!0};var d=c.compare;if(d&&(d=Je(d||"")),l=c.mode?t(c):!!Ye[c.condition]&&(N.Function(c.handler)?Me((function(){return c.handler(r.api,e.rule)})):Me((function(){return new Function("$condition","$variableVal","$val","$form","$scope","$group","$rule","with($form){with($scope){with(this){with($group){ return $condition['".concat(c.condition,"'](").concat(c.variable?"$variableVal":s,", ").concat(d||"$val","); }}}}")).call(r.api.form,Ye,f,c.value,r.api.top.form,r.api.top===r.api.scope?{}:r.api.scope.form,o&&r.subRuleData[o.id]||{},e.rule)}))),a&&l)return{v:!0};a||(u=u&&l)},l=0;l<n.group.length;l++){var s=c(l);if("object"===i(s))return s.v}return!a&&u}(t);return a=!0===t.invert?!a:a,t.linkage?a?Me((function(){return r.computeValue(t.linkage,e,o)}),void 0):gt:t.linkageVariable?a?Me((function(){return r.fc.getLoadData(t.linkageVariable)}),void 0):gt:a}if(N.Function(t))n=function(){return t(r.api.form,r.api,e.rule)};else{var u=e.getParentGroup();n=function(){return r.computeValue(t,e,u)}}return Me(n,void 0)},computeValue:function(e,t,n){var r=this,i=this,o=Object.keys(this.fc.formulas).reduce((function(e,n){return e[n]=function(){for(var e,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(e=i.fc.formulas[n]).call.apply(e,[{that:this,rule:t.rule,api:i.api,fc:i.fc}].concat(o))},e}),{});return Me((function(){return new Function("$formulas","$form","$scope","$group","$rule","$api","with($form){with($scope){with(this){with($group){with($formulas){ return ".concat(e," }}}}}")).call(r.api.form,o,r.api.top.form,r.api.top===r.api.scope?{}:r.api.scope.form,n&&r.subRuleData[n.id]||{},t.rule,r.api)}),void 0)},updateChildren:function(e,t,n){var r=this;this.deferSyncValue((function(){n&&n.forEach((function(n){-1===(t||[]).indexOf(n)&&n&&!N.String(n)&&n.__fc__&&n.__fc__.parent===e&&r.rmCtx(n.__fc__)})),N.trueArray(t)&&(r.loadChildren(t,e),r.bus.$emit("update",r.api))}))},rmSub:function(e){var t=this;N.trueArray(e)&&e.forEach((function(e){e&&e.__fc__&&t.rmCtx(e.__fc__)}))},rmCtx:function(e){var t=this;if(!e.deleted){var n=e.id,r=e.field,i=e.input,o=e.name;W(this.ctxs,n),W(this.formData,n),W(this.subForm,n),W(this.vm.setupState.ctxInject,n);var a=e.getParentGroup();a&&this.subRuleData[a.id]&&W(this.subRuleData[a.id],r),e.group&&W(this.subRuleData,n),i&&this.rmIdCtx(e,r,"field"),o&&this.rmIdCtx(e,o,"name"),i&&!B(this.fieldCtx,r)&&W(this.form,r),this.deferSyncValue((function(){if(!t.reloading){if(!1!==e.parser.loadChildren){var n=e.getPending("children",e.rule.children);N.trueArray(n)&&n.forEach((function(e){return e&&e.__fc__&&t.rmCtx(e.__fc__)}))}e.root===t.rules&&t.vm.setupState.renderRule()}}),i);var u=this.sort.indexOf(n);return u>-1&&this.sort.splice(u,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),i&&!this.fieldCtx[r]&&this.vm.emit("remove-field",r,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}}})}(yt),function(e){Q(e.prototype,{mounted:function(){var e=this,t=function(){e.isMounted=!0,e.lifecycle("mounted")};this.pageEnd?t():this.bus.$once("page-end",t)},lifecycle:function(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=this.options[e]||this.options[Fe("on-"+e)];if(o){var a=de(o);N.Function(a)&&Me((function(){return a.apply(void 0,r)}))}(t=this.bus).$emit.apply(t,[e].concat(r))},targetHook:function(e,t,n){var i,o,a=this,u=function(t,i){t&&(t=Array.isArray(t)?t:[t]).forEach((function(t){Me((function(){return t(r(r({args:Object.values(n||{})},n||{}),{},{self:e.rule,rule:e.rule,parent:null==i?void 0:i.rule,$f:a.api,api:a.api,option:a.vm.props.option}))}))}))};u(null===(i=e.prop)||void 0===i||null===(o=i.hook)||void 0===o?void 0:o[t]);for(var c="deep"+oe(t),l=e.parent;l;){var s,f;u(null===(s=l.prop)||void 0===s||null===(f=s.hook)||void 0===f?void 0:f[c],l),l=l.parent}}})}(yt),function(e){Q(e.prototype,{useProvider:function(){var e=this,t=this.fc.providers;Object.keys(t).forEach((function(n){var r=t[n];N.Function(r)&&(r=r(e.fc)),r._c=function(e){var t=e.components;if(Array.isArray(t)){var n=function(e){return e.filter((function(e,t,n){return n.indexOf(e,0)===t}))}(t.filter((function(e){return"*"!==e})));return!!n.length&&n}return!!N.String(t)&&[t]}(r),e.onEffect(r,n),e.providers[n]=r}))},onEffect:function(e,t){var n=this,r=[];(e._c||["*"]).forEach((function(i){var o="*"===i?"*":n.getType(i);r.indexOf(o)>-1||(r.push(o),n.bus.$on("p:".concat(t||e.name,":").concat(o,":").concat(e.input?1:0),(function(t,n){e[t]&&e[t].apply(e,d(n))})))})),e._used=r},watchEffect:function(e){var n=this,r={required:function(){var t,n;return(B(e.rule,"$required")?e.rule.$required:null===(t=e.rule)||void 0===t||null===(n=t.effect)||void 0===n?void 0:n.required)||!1}};Object.keys(e.rule.effect||{}).forEach((function(t){r[t]=function(){return e.rule.effect[t]}})),Object.keys(e.rule).forEach((function(t){"$"===t[0]&&(r[t.substr(1)]=function(){return e.rule[t]})})),Object.keys(r).forEach((function(i){e.watch.push(t.watch(r[i],(function(t){n.effect(e,"watch",a({},i,t))}),{deep:!0}))}))},ruleEffect:function(e,t,n){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},t,n)},effect:function(e,t,n){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:n},t)},getEffect:function(e,t){return B(e,"$"+t)?e["$"+t]:B(e,"effect")&&B(e.effect,t)?e.effect[t]:void 0},emitEffect:function(e,t,n){var i=this,o=e.ctx,a=e.rule,u=e.input,c=e.type,l=e.custom;if(c&&!(["fcFragment","fragment"].indexOf(c)>-1)){var s=l||Object.keys(a).reduce((function(e,t){return"$"===t[0]&&(e[t.substr(1)]=a[t]),e}),r({},a.effect||{}));Object.keys(s).forEach((function(e){var l=i.providers[e];if(l&&(!l.input||u)){var f;if(l._c){if(!(l._used.indexOf(c)>-1))return;f=c}else f="*";var d=r({value:s[e],getValue:function(){return i.getEffect(a,e)}},n||{});o&&(d.getProp=function(){return o.effectData(e)},d.clearProp=function(){return o.clearEffectData(e)},d.mergeProp=function(e){return Ne(d.getProp(),[e])},d.id=o.id),i.bus.$emit("p:".concat(e,":").concat(f,":").concat(l.input?1:0),t,[d,a,i.api])}}))}}})}(yt);var bt=t.defineComponent({name:"fcFragment",inheritAttrs:!1,props:["vnode"],render:function(){return this.vnode}});function _t(e,n){var r=e.directives;return r?(Array.isArray(r)||(r=[r]),t.withDirectives(n,r.reduce((function(e,n){return e.concat(function(e){return Object.keys(e).map((function(n){var r=e[n],i=t.resolveDirective(n);if(i)return[i,r.value,r.arg,r.modifiers]})).filter((function(e){return!!e}))}(n))}),[]))):n}function xt(e){var t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,e);var t=s(n);function n(){return o(this,n),t.apply(this,arguments)}return n}(wt);return Object.assign(t.prototype,e),t}function wt(e){Q(this,{$handle:e,vm:e.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}Q(wt.prototype,{__init:function(){var e=this;this.$render=this.$handle.$render,this.$r=function(){var t;return(t=e.$render).renderRule.apply(t,arguments)}},updateKey:function(){this.key=me()},init:function(){},update:function(){},beforeRender:function(){},form:function(){return this.vm.refs[this.ref]},adapterValidate:function(e,t){return e.validator=function(e,n,r){return t(n,r)},e},getSlot:function(e){return function t(n){if(n){var r=n.slots[e];return r||t(n.setupState.parent)}}(this.vm)},mergeOptions:function(e,t){var n=this;return Ve(e.map((function(e){return n.tidyOptions(e)})),t,this.mergeOptionsRule)},updateOptions:function(e){this.$handle.fc.targetFormDriver("updateOptions",e,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([e],this.getDefaultOptions()),this.update()},tidyOptions:function(e){return e},tidyRule:function(e){},mergeProp:function(e){},getDefaultOptions:function(){return{}},fieldChange:function(e,t,n,r){},render:function(e){}});var kt={name:"componentValidate",load:function(e,t,n){var i=e.getValue();if(i&&!1!==i.method){N.Object(i)||(i={method:i});var o=i.method,a=r(r({},i),{},{validator:function(){var r=Le(t);if(r){for(var i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];return n.exec.apply(n,[r.id,N.String(o)?o:"formCreateValidate"].concat(a,[{attr:e,rule:t,api:n}]))}}});delete a.method,e.getProp().validate=[a]}else e.clearProp(),n.clearValidateState([t.field])},watch:function(){kt.load.apply(kt,arguments)}},$t={fetch:function(e){function t(t,i,o){var a=t.value;n.deleted(t),N.Function(a)&&(a=a(i,o)),a=function(e){return N.String(e)&&(e={action:e,to:"options"}),e}(a);var u=function(n){void 0===n?t.clearProp():ve(t.getProp(),a.to||"options",n),null!=n&&a&&a.key&&e.$handle.options.globalData[a.key]&&e.fetchCache.set(e.$handle.options.globalData[a.key],{status:!0,data:n}),o.sync(i)};if(a&&(a.action||a.key)){(a=X(a)).to||(a.to="options");var c=a.onError,l=function(){if(!t.getValue())return t.clearProp(),o.sync(i),!0};n._fn[t.id]=e.watchLoadData(te((function(s,f){if(f&&!1===a.watch)return n._fn[t.id]();if(a.key){e.targetRule=i;var d=s("$globalData."+a.key);if(delete e.targetRule,d){if(l())return;u(d)}}else{var p=e.$handle.loadFetchVar(X(a),s,i),h=r(r({headers:{}},p),{},{onSuccess:function(e,t){if(!l()){var n=function(e){return t?e:B(e,"data")?e.data:e},r=de(p.parse);N.Function(r)?n=r:r&&N.String(r)&&(n=function(e){return Ge(e,r)}),re(n(e,i,o)).then((function(e){u(e)}))}},onError:function(e){u(void 0),l()||(c||function(e){return ue(e.message||"fetch fail "+p.action)})(e,i,o)}});e.$handle.beforeFetch(h,{rule:i,api:o}).then((function(){N.Function(p.action)?re(p.action(i,o)).then((function(e){h.onSuccess(e,!0)})).catch((function(e){h.onError(e)})):Me((function(){return e.create.fetch(h,{inject:t,rule:i,api:o})}))})).catch((function(e){}))}}),a.wait||600))}else u(void 0)}var n={name:"fetch",_fn:[],loaded:function(){t.apply(void 0,arguments)},watch:function(){t.apply(void 0,arguments)},deleted:function(e){this._fn[e.id]&&(this._fn[e.id](),delete this._fn[e.id]),e.clearProp()}};return n},loadData:function(e){var n={name:"loadData",_fn:[],loaded:function(n,r,i){var o=this;this.deleted(n),t.nextTick((function(){var t=v(n.getValue()),a=[];t.forEach((function(t){if(t&&(t.attr||t.template)){var o=function(o){var a,u;r&&r.__fc__&&(a=r.__fc__.getParentGroup()),null!=(u=t.template?e.$handle.loadStrVar(t.template,o,a?{rule:r,value:e.$handle.subRuleData[a.id]||{}}:null):t.handler&&N.Function(t.handler)?t.handler(o,r,i):e.$handle.loadStrVar("{{".concat(t.attr,"}}"),o,a?{rule:r,value:e.$handle.subRuleData[a.id]||{}}:null))&&""!==u||null==t.default||(u=t.default),!1!==t.copy&&(u=X(u));var c=t.modify?r:n.getProp();"child"===t.to?c.children?c.children[0]=u:c.children=[u]:ve(c,t.to||"options",u),i.sync(r)},u=e.watchLoadData((function(e){return o(e)}));o=te(o,t.wait||300),!1!==t.watch?a.push(u):u()}})),o._fn[n.id]=a}))},deleted:function(e){this._fn[e.id]&&(this._fn[e.id].forEach((function(e){e()})),delete this._fn[e.id]),e.clearProp()}};return n.watch=n.loaded,n},t:function(e){var t={name:"t",_fn:[],loaded:function(t,n,r){this.deleted(t);var o=t.getValue()||{},a=[];Object.keys(o).forEach((function(u){var c=o[u];if(c){var l="object"===i(c),s=function(i){var o=e.t(l?c.attr:c,l?c.params:null,i),a=l&&c.modify?n:t.getProp();"child"===u?a.children?a.children[0]=o:a.children=[o]:ve(a,u,o),r.sync(n)},f=e.watchLoadData((function(e){return s(e)}));s=te(s,c.wait||300),!1!==c.watch?a.push(f):f()}})),this._fn[t.id]=a},deleted:function(e){this._fn[e.id]&&(this._fn[e.id].forEach((function(e){e()})),delete this._fn[e.id]),e.clearProp()}};return t.watch=t.loaded,t},componentValidate:kt},Ct={name:"html",loadChildren:!1,render:function(e,t){return t.prop.props.innerHTML=e.default(),t.vNode.make(t.prop.props.tag||"div",t.prop)},renderChildren:function(e){return{default:function(){return e.filter((function(e){return N.String(e)})).join("")}}}};function Vt(e){e+="=";for(var t=decodeURIComponent(document.cookie).split(";"),n=0;n<t.length;n++){for(var r=t[n];" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(e)){r=r.substring(e.length,r.length);try{return JSON.parse(r)}catch(e){return r}}}return null}function Ot(e){var t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return t}return null}function St(e){var t=sessionStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return t}return null}function Rt(e,t){if(!t)return null;var n=t.split("."),r=e(n.shift());return n.length?null==r?null:Ge(r,n):r}function jt(e){return Rt(Vt,e)}function Et(e){return Rt(Ot,e)}function Ft(e){return Rt(St,e)}var Dt={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function At(e,t){var n;return 2===arguments.length?t=(n=arguments[1])[e]:n=arguments[2],{id:t,prop:n}}function Pt(){return At.apply(void 0,["name"].concat(Array.prototype.slice.call(arguments)))}var It=1,Nt={},Bt=Symbol("defValue");function Tt(e){var n,o=a({},bt.name,bt),u={},c={},l={},s={},f=[],p=[],h=[e.extendApi],m=r({},$t),v=rt(),g={global:{}},b=!0===e.isMobile,_=t.reactive({$mobile:b}),x=function(){var e={};function n(e){this.vm=e.vm,this.handle=e}return Q(n.prototype,{make:function(e,t,n){return _t(t,this.h(e,qe(t),n))},makeComponent:function(e,n,r){try{return _t(n,t.createVNode(e,qe(n),r))}catch(e){return console.error(e),t.createVNode("")}},h:function(e,n,r){var i=(this.vm||t.getCurrentInstance()).appContext.config.isNativeTag(e),o=this.handle.fc.prop.components[e];!o&&i&&delete n.formCreateInject;try{return t.createVNode(o||(i?e:t.resolveComponent(e)),n,r)}catch(e){return console.error(e),t.createVNode("")}},aliasMap:e}),Q(n,{aliasMap:e,alias:function(t,n){e[t]=n},use:function(t){Object.keys(t).forEach((function(r){var i=ie(r),o=ne(r).toLocaleLowerCase(),a=t[r];n.alias(r,a),[r,i,o].forEach((function(t){n.prototype[t]=function(n,i){return this.make(e[r]||t,n,i)}}))}))}}),n}(),w={},k={};function $(e){var t=Nt[e];return Array.isArray(t)?t.map((function(e){return e.api()})):t?t.api():void 0}function C(e){f.push(e)}function V(){var e=Pt.apply(void 0,arguments);e.id&&e.prop&&(c[e.id]=e.prop)}function O(){var e=Pt.apply(void 0,arguments);e.id&&e.prop&&(m[e.id]=N.Function(e.prop)?e.prop:r(r({},e.prop),{},{name:e.id}))}function S(e){x.use(e)}function R(e){if(0===arguments.length)return mt;if("string"==typeof e&&1===arguments.length)return u[Fe(e)];var t=Pt.apply(void 0,arguments);if(!t.id||!t.prop)return mt;var n=Fe(t.id),r=t.prop,i=!0===r.merge?u[n]:void 0;u[n]=ze(r,i||mt),v[n]=Ze(n),r.maker&&Q(v,r.maker)}function j(e,t){var n;if(N.String(e)){if(n=e,void 0===t)return o[n]}else n=e.displayName||e.name,t=e;if(n&&t){var r=Fe(n);o[n]=t,o[r]=t,delete x.aliasMap[n],delete x.aliasMap[r],delete u[n],delete u[r],t.formCreateParser&&R(n,t.formCreateParser)}}function E(){return Xe(J,o,c)}function F(){return bt}function D(e,t){return N.Function(e.install)?e.install(A,t):N.Function(e)&&e(A,t),this}function A(e,n){var i=function(e,n){var i=E();return t.createApp({data:function(){return t.reactive({rule:e,option:n})},render:function(){return t.h(i,r({ref:"fc"},this.$data))}})}(e,n||{});f.forEach((function(e){Me((function(){return e(A,i)}))}));var o=document.createElement("div");return((null==n?void 0:n.el)||document.body).appendChild(o),i.mount(o).$refs.fc.fapi}function P(t){var n=r({},e);return t?n.inherit={components:o,parsers:u,directives:c,modelFields:l,providers:m,useApps:f,maker:v,formulas:w,loadData:_}:delete n.inherit,Tt(n)}function I(e,t){l[e]=t}function T(e,t){w[e]=t}function L(e,t){var n=s[e]||{},i=n.parsers||{};t.parsers&&Object.keys(t.parsers).forEach((function(e){i[e]=ze(t.parsers[e],mt)})),t.name=e,s[e]=r(r(r({},n),t),{},{parsers:i})}function M(e){e&&Object.keys(Nt).forEach((function(t){(Array.isArray(Nt[t])?Nt[t]:[Nt[t]]).forEach((function(t){t.bus.$emit("$loadData."+e)}))}))}function U(e,t){ve(_,e,t),M(e)}function q(e,t){var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Me((function(){return t.apply(void 0,n)}))};n._driver=!0,U(e,n)}function z(e,t){var n=(e||"").split(".");e=n.shift();var r=n.join(".");if(B(_,e)||(_[e]=Bt),_[e]!==Bt){var i=_[e];return i&&i._driver?i=i(r):n.length&&(i=Ge(i,n)),null==i||""===i?t:i}return t}function H(e){h.push(e)}function Y(e){delete _[e],M(e)}function G(e,t){p.push({name:e,callback:t})}function J(n){var r=this;Q(this,{id:It++,create:A,vm:n,manager:xt(e.manager),parsers:u,providers:m,modelFields:l,formulas:w,isMobile:b,rules:n.props.rule,name:n.props.name||me(),inFor:n.props.inFor,prop:{components:o,directives:c},get:null,drivers:s,renderDriver:null,refreshData:M,loadData:_,CreateNode:x,bus:new y,unwatch:[],options:t.ref({}),extendApiFn:h,fetchCache:new WeakMap,tmpData:t.reactive({})}),p.forEach((function(e){r.bus.$on(e.name,e.callback)})),t.nextTick((function(){t.watch(r.options,(function(){r.$handle.$manager.updateOptions(r.options.value),r.api().refresh()}),{deep:!0})})),Q(n.appContext.components,o),Q(n.appContext.directives,c),this.$handle=new yt(this),this.name&&(this.inFor?(Nt[this.name]||(Nt[this.name]=[]),Nt[this.name].push(this)):Nt[this.name]=this)}function W(t){Q(t,{version:e.version,ui:e.ui,isMobile:b,extendApi:H,getData:z,setDataDriver:q,setData:U,removeData:Y,refreshData:M,maker:v,component:j,directive:V,setModelField:I,setFormula:T,setDriver:L,register:O,$vnode:F,parser:R,use:D,factory:P,componentAlias:S,copyRule:Pe,copyRules:Ie,mergeRule:Ne,fetch:ot,$form:E,parseFn:de,parseJson:pe,toJson:se,useApp:C,getApi:$,on:G})}if(function(e){var t=e.key||[],n=e.array||[],r=e.normal||[];Se.push.apply(Se,d(t)),Re.push.apply(Re,d(n)),je.push.apply(je,d(r)),et([].concat(d(t),d(n),d(r)))}(e.attrs||{}),ze(A,k),J.isMobile=b,Q(J.prototype,{init:function(){var e=this;this.isSub()&&this.unwatch.push(t.watch((function(){return e.vm.setupState.parent.setupState.fc.options.value}),(function(){e.initOptions(),e.$handle.api.refresh()}),{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver="object"===i(this.vm.props.driver)?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver:function(e){for(var t,n=this,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if((t=this.bus).$emit.apply(t,[e].concat(i)),this.renderDriver&&this.renderDriver[e])return Me((function(){var t;return(t=n.renderDriver)[e].apply(t,i)}))},t:function(e,t,n){var r=n?n("$t."+e):this.globalLanguageDriver(e);return null==r&&(r=""),r&&t&&Object.keys(t).forEach((function(e){var n=new RegExp("{".concat(e,"}"),"g");r=r.replace(n,t[e])})),r},globalDataDriver:function(e){var t=this,n=e.split("."),r=n.shift(),i=this.options.value.globalData&&this.options.value.globalData[r];if(i){if("static"===i.type)return Ge(i.data,n);var o,a=this.fetchCache.get(i);if(a){if(a.status&&(o=Ge(a.data,n)),!a.loading)return o;a.loading=!1,this.fetchCache.set(i,a)}else this.fetchCache.set(i,{status:!1});var u=te((function(){l();var e=t.fetchCache.get(i);t.options.value.globalData&&-1!==Object.values(t.options.value.globalData).indexOf(i)?(e&&(e.loading=!0,t.fetchCache.set(i,e)),t.bus.$emit("$loadData.$globalData."+r)):t.fetchCache.delete(i)}),i.wait||600),c=function(e){t.fetchCache.set(i,{status:!0,data:e}),t.bus.$emit("$loadData.$globalData."+r)},l=this.watchLoadData((function(e,n){if(n&&!1===i.watch)return l();if(n)u();else{var r=t.$handle.loadFetchVar(ee(i),e);r.targetRule=t.targetRule,t.$handle.api.fetch(r).then((function(e){c(e)})).catch((function(e){c(null)}))}}));return!1===i.watch&&l(),this.unwatch.push(l),o}},getLocale:function(){var e=this.vm.setupState.top.props.locale;return e&&"object"===i(e)?e.name:"string"==typeof e?e:"zh-cn"},globalLanguageDriver:function(e){var t=this.vm.setupState.top.props.t,n=this.vm.setupState.top.props.locale,r=void 0;if(t&&(r=Me((function(){return t(e)}))),null==r&&n&&"object"===i(n)&&(r=Ge(n,e)),null==r){var o=this.options.value.language||{},a=this.getLocale();null==(r=Ge(o[a]||{},e))&&(r=Ge(Dt[a]||{},e))}return r},globalVarDriver:function(e){var t=this,n=e.split("."),r=n.shift(),i=this.options.value.globalVariable&&this.options.value.globalVariable[r];if(i){var o=N.Function(i)?i:de(i.handle);if(o){var a=o((function(){var e;return(e=t.$handle.api).getData.apply(e,arguments)}),this.$handle.api);return Ge(a,n)}}},setData:function(e,t,n){n?U(e,t):(ve(this.vm.setupState.top.setupState.fc.tmpData,e,t),this.bus.$emit("$loadData."+e))},getLoadData:function(e,t){var n=null;if(null!=e){var r=e.split("."),i=r.shift();if(null!=(n=Ge(this.vm.setupState.top.setupState.fc.tmpData,e)))return n;if("$topForm"===i)n=this.$handle.api.top.formData(!0);else if("$scopeForm"===i)n=this.$handle.api.scope.formData(!0);else if("$form"===i)n=this.$handle.api.formData(!0);else if("$options"===i)n=this.options.value;else if("$globalData"===i)n=this.globalDataDriver(r.join(".")),r=[];else if("$var"===i)n=this.globalVarDriver(r.join(".")),r=[];else if("$locale"===i)n=this.getLocale(),r=[];else if("$t"===i)n=this.globalLanguageDriver(r.join(".")),r=[];else{if("$preview"===i)return this.$handle.preview;n=z(e),r=[]}n&&r.length&&(n=Ge(n,r))}return null==n||""===n?t:n},watchLoadData:function(e,n){var r=this,o={},a=function(t){r.get||(r.get=u),Me((function(){e(u,t)})),r.get===u&&(r.get=void 0)},u=function(e,u){var c;if("object"===i(e)&&(c=e.getValue,e=e.id),o[e])return o[e].val;var l=t.computed((function(){return c?c():r.getLoadData(e,u)})),s=e.split("."),f=s.shift(),d=s.shift()||"",p=te((function(){var t=c?c():r.getLoadData(e,u);o[e]&&((t instanceof Function||N.Object(t)||Array.isArray(t))&&t===o[e].val||JSON.stringify(t)!==JSON.stringify(o[e].val))&&(o[e].val=t,a(!0))}),n||0),h=t.watch(l,(function(e){p()}));return r.bus.$on("$loadData."+f,p),d&&r.bus.$on("$loadData."+f+"."+d,p),o[e]={fn:function(){r.bus.$off("$loadData."+f,p),d&&r.bus.$off("$loadData."+f+"."+d,p),h()},val:l.value},l.value};a(!1);var c=function(){Object.keys(o).forEach((function(e){return o[e].fn()})),o={}};return this.unwatch.push(c),c},isSub:function(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions:function(){this.options.value={};var e=r({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},X(g)),t=this.isSub();t&&(e=this.mergeOptions(e,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),e=this.mergeOptions(e,this.vm.props.option);var n=this.api();this.targetFormDriver("initOptions",e,{api:n,isSubForm:t}),this.updateOptions(e)},mergeOptions:function(e,t,n){return t=r({},t||{}),n&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","onReload","reload","formData","el","globalClass","style"].forEach((function(e){delete t[e]})),t.global&&(e.global=function(e,t){return e?(Object.keys(t||{}).forEach((function(n){t[n]&&(e[n]=Ne(e[n]||{},t[n]))})),e):t}(e.global,t.global),delete t.global),this.$handle.$manager.mergeOptions([t],e),e},updateOptions:function(e){this.options.value=this.mergeOptions(this.options.value,e),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api:function(){return this.$handle.api},render:function(){return this.$handle.render()},mounted:function(){this.$handle.mounted()},unmount:function(){var e=this;if(this.name)if(this.inFor){var t=Nt[this.name].indexOf(this);Nt[this.name].splice(t,1)}else delete Nt[this.name];p.forEach((function(t){e.bus.$off(t.name,t.callback)})),this.tmpData={},this.unwatch.forEach((function(e){return e()})),this.unwatch=[],this.$handle.reloadRule([])},updated:function(){var e=this;this.$handle.bindNextTick((function(){return e.bus.$emit("next-tick",e.$handle.api)}))}}),W(k),Q(n=k,{create:A,install:function(t,i){g=r(r({},g),i||{});var o="_installedFormCreate".concat(b?"Mobile":"","_").concat(e.ui);if(!0!==t[o]){t[o]=!0;var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e,t)};W(a),t.config.globalProperties.$formCreate=a;var u=E();t.component(u.name,u),f.forEach((function(e){Me((function(){return e(n,t)}))}))}}}),q("$cookie",jt),q("$localStorage",Et),q("$sessionStorage",Ft),x.use({fragment:"fcFragment"}),e.install&&A.use(e),C((function(e,t){t.mixin({props:["formCreateInject"]})})),R(Ct),e.inherit){var K=e.inherit;K.components&&Q(o,K.components),K.parsers&&Q(u,K.parsers),K.directives&&Q(c,K.directives),K.modelFields&&Q(l,K.modelFields),K.providers&&Q(m,K.providers),K.useApps&&Q(f,K.useApps),K.maker&&Q(v,K.maker),K.loadData&&Q(_,K.loadData),K.formulas&&Q(w,K.formulas)}var Z=E();return ze(Z,k),Object.defineProperties(Z,{fetch:{get:function(){return k.fetch},set:function(e){k.fetch=e}}}),Z.util=k,Z}var Lt={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",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"},Mt="datePicker",Ut={name:Mt,maker:["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((function(e,t){return e[t]=Ze(Mt,{type:t.toLowerCase()}),e}),{}),mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat=Lt[t.type]||Lt.date)}},qt="hidden",zt={name:qt,maker:a({},qt,(function(e,t){return Ze(qt)("",e,t)})),render:function(){return[]}},Ht="input",Yt={name:Ht,maker:function(){var e=["password","url","email","text","textarea"].reduce((function(e,t){return e[t]=Ze(Ht,{type:t}),e}),{});return e.idate=Ze(Ht,{type:"date"}),e}(),mergeProp:function(e){var t=e.prop.props;t&&t.autosize&&t.autosize.minRows&&(t.rows=t.autosize.minRows||2)}},Gt="slider",Jt="timePicker",Wt=[Ut,zt,Yt,{name:"textarea",mergeProp:function(e){var t=e.prop.props;t.type="textarea",t&&t.autosize&&t.autosize.minRows&&(t.rows=t.autosize.minRows||2)}},{name:Gt,maker:{sliderRange:Ze(Gt,{range:!0})},toFormValue:function(e,t){var n=Array.isArray(e),r=t.prop.props,i=r.min||0;return!0===r.range?n?e:[i,parseFloat(e)||i]:n?parseFloat(e[0])||i:parseFloat(e)}},{name:Jt,maker:{time:Ze(Jt,(function(e){return e.props.isRange=!1})),timeRange:Ze(Jt,(function(e){return e.props.isRange=!0}))},mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}},{name:"FcRow",render:function(e,t){return t.vNode.col({props:{span:24}},{default:function(){return[t.vNode.row(t.prop,e)]}})}},{name:"select",toFormValue:function(e,t){return t.prop.props.multiple&&!Array.isArray(e)?v(e):e}}],Kt={button:"el-button",icon:"el-icon",slider:"el-slider",rate:"el-rate",upload:"fc-upload",cascader:"el-cascader",popover:"el-popover",tooltip:"el-tooltip",colorPicker:"el-colorPicker",timePicker:"el-time-picker",timeSelect:"el-time-select",datePicker:"el-date-picker",switch:"el-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:"el-input-number",number:"el-input-number",input:"el-input",textarea:"el-input",formItem:"el-form-item",form:"el-form",frame:"fc-frame",col:"el-col",row:"el-row",tree:"fc-tree",autoComplete:"el-autocomplete",auto:"el-autocomplete",group:"fc-group",array:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function Xt(e,t){var n;B(e,t)&&(N.String(e[t])&&(e[t]=(a(n={},t,e[t]),a(n,"show",!0),n)))}function Zt(e){return!1===e}function Qt(e){var t=r({},e);return delete t.children,t}var en={validate:function(){var e=this.form();return e?e.validate():new Promise((function(e){return e()}))},validateField:function(e){var t=this;return new Promise((function(n,r){var i=t.form();i?i.validateField(e,(function(e,t){t?r(t):n(e)})):n()}))},clearValidateState:function(e){var t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},fieldChange:function(e,t,n,r){var i,o;r||(null===(i=this.vm.refs[e.wrapRef])||void 0===i||null===(o=i.validate("change"))||void 0===o||o.catch((function(){})))},tidyOptions:function(e){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach((function(t){!function(e,t){B(e,t)&&!N.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)})),e},tidyRule:function(e){var t=e.prop;return Xt(t,"title"),Xt(t,"info"),t},mergeProp:function(e){var t=this,n={info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach((function(r){e.prop[r]=Ve([t.options[r]||{},e.prop[r]||{}],n[r])}))},getDefaultOptions:function(){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:"",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"",show:!1,col:void 0,click:void 0}}},update:function(){var e=this.options.form;this.rule={props:r({},e),on:{submit:function(e){e.preventDefault()}},style:e.style,type:"form"}},beforeRender:function(){var e=this.key,t=this.ref,n=this.$handle,r=this.options.form;Q(this.rule,{key:e,ref:t,class:[r.className,r.class,"form-create",this.$handle.preview?"is-preview":""]}),Q(this.rule.props,{model:n.formData})},render:function(e){var t=this;return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,(function(){return t.makeFormBtn()})),this.$r(this.rule,Zt(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap:function(e,t){var n=this,i=e.prop,o="".concat(this.key).concat(e.key),a=i.col,u=this.isTitle(i)&&!1!==i.wrap.title,c=a.labelWidth||u?a.labelWidth:0,l=this.rule.props,s=l.inline,f=l.col,d=i.wrap.class;delete i.wrap.class,delete i.wrap.title;var p=Zt(i.wrap.show)?t:this.$r(Ve([i.wrap,{props:r(r({labelWidth:void 0===c?c:ne(c),label:u?i.title.title:void 0},Qt(i.wrap||{})),{},{prop:e.id,rules:e.injectValidate()}),class:this.$render.mergeClass(d||i.className,"fc-form-item"),key:"".concat(o,"fi"),ref:e.wrapRef,type:"formItem"}]),r({default:function(){return t}},u?{label:function(){return n.makeInfo(i,o,e)}}:{}));return!0===s||Zt(f)||Zt(a.show)?p:this.makeCol(i,o,[p])},isTitle:function(e){if(!1===this.options.form.title)return!1;var t=e.title;return!(!t.title&&!t.native||Zt(t.show))},makeInfo:function(e,t,n){var i,o,u,c,l=this,s=r({},e.title),f=r({},e.info),d="tooltip"===f.type,p=this.options.form,h=this.getSlot("title"),m=[h?h({title:null===(i=n.refRule)||void 0===i||null===(o=i.__$title)||void 0===o?void 0:o.value,rule:n.rule,options:this.options}):(null===(u=n.refRule)||void 0===u||null===(c=u.__$title)||void 0===c?void 0:c.value)+(p.labelSuffix||p["label-suffix"]||"")];if(!Zt(f.show)&&(f.info||f.native)&&!Zt(f.icon)){var v={type:f.type||"popover",props:Qt(f),key:"".concat(t,"pop")};delete v.props.icon,delete v.props.show,delete v.props.info,delete v.props.align,delete v.props.native;var g,y,b="content";if(f.info&&!B(v.props,b))v.props[b]=null===(g=n.refRule)||void 0===g||null===(y=g.__$info)||void 0===y?void 0:y.value;m["left"!==f.align?"unshift":"push"](this.$r(Ve([f,v]),a({},s.slot||(d?"default":"reference"),(function(){return l.$r({type:"ElIcon",style:"top:2px",key:"".concat(t,"i")},{default:function(){return l.$r({type:!0===f.icon?"icon-warning":f.icon})}},!0)}))))}var _=Ve([s,{props:Qt(s),key:"".concat(t,"tit"),class:"fc-form-title",type:s.type||"span",on:{click:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.$handle.targetHook(n,"titleClick",{args:t})}}}]);return delete _.props.show,delete _.props.title,delete _.props.native,this.$r(_,m)},makeCol:function(e,t,n){var r=e.col;return this.$r({class:this.$render.mergeClass(r.class,"fc-form-col"),type:"col",props:r||{span:24},key:"".concat(t,"col")},n)},makeRow:function(e){var t=this.options.row||{};return this.$r({type:"row",props:t,class:this.$render.mergeClass(t.class,"fc-form-row"),key:"".concat(this.key,"row")},e)},makeFormBtn:function(){var e=[];if(Zt(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),Zt(this.options.resetBtn.show)||e.push(this.makeResetBtn()),e.length){var t=this.$r({type:"formItem",class:"fc-form-item",key:"".concat(this.key,"fb")},e);return!0===this.rule.props.inline?t:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:"".concat(this.key,"fc")},[t])}},makeResetBtn:function(){var e=this,t=r({},this.options.resetBtn),n=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.resetBtn.click?e.options.resetBtn.click(t):t.resetFields()}},key:"".concat(this.key,"b2")},[n])},makeSubmitBtn:function(){var e=this,t=r({},this.options.submitBtn),n=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.submitBtn.click?e.options.submitBtn.click(t):t.submit().catch((function(){}))}},key:"".concat(this.key,"b1")},[n])}},tn={};!function(e){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate"].forEach((function(t){e[t]=Ze(t)})),e.auto=e.autoComplete,e.number=e.inputNumber,e.color=e.colorPicker}(tn),function(e){var t="select",n="multiple";e.selectMultiple=Ze(t,a({},n,!0)),e.selectOne=Ze(t,a({},n,!1))}(tn),function(e){var t={treeSelected:"selected",treeChecked:"checked"};Object.keys(t).reduce((function(e,n){return e[n]=Ze("tree",{type:t[n]}),e}),e)}(tn),function(e){var t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=Ze("upload",(function(e){return e.props({uploadType:t[n][0],maxLength:t[n][1]})})),e}),e),e.uploadImage=e.image,e.uploadFile=e.file}(tn),function(e){var t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=Ze("frame",(function(e){return e.props({type:t[n][0],maxLength:t[n][1]})})),e}),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(tn);function nn(e,t){return N.Boolean(e)?e={show:e}:N.Undef(e)||N.Object(e)||(e={show:t}),e}function rn(e,t){return{formEl:function(){return t.$manager.form()},wrapEl:function(e){var n=t.getFieldCtx(e);if(n)return t.vm.refs[n.wrapRef]},validate:function(n){return new Promise((function(r,i){var o=e.children,a=[t.$manager.validate()];o.filter((function(e){return!e.isScope})).forEach((function(e){a.push(e.validate())})),Promise.all(a).then((function(){r(!0),n&&n(!0)})).catch((function(r){i(r),n&&n(r),t.vm.emit("validate-fail",r,{api:e}),t.emitEvent("validate-fail",r,{api:e})}))}))},validateField:function(n,r){return new Promise((function(i,o){var a=t.getFieldCtx(n);if(a){var u=t.subForm[a.id],c=[t.$manager.validateField(a.id)];v(u).filter((function(e){return!e.isScope})).forEach((function(e){c.push(e.validate())})),Promise.all(c).then((function(){i(null),r&&r(null)})).catch((function(i){o(i),r&&r(i),t.vm.emit("validate-field-fail",i,{field:n,api:e})}))}}))},clearValidateState:function(n){var r=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.helper.tidyFields(n).forEach((function(e){i&&r.clearSubValidateState(e),t.getCtxs(e).forEach((function(e){t.$manager.clearValidateState(e)}))}))},clearSubValidateState:function(n){e.helper.tidyFields(n).forEach((function(e){t.getCtxs(e).forEach((function(e){var n=t.subForm[e.id];n&&(Array.isArray(n)?n.forEach((function(e){e.clearValidateState()})):n&&n.clearValidateState())}))}))},btn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({show:!!t})}},resetBtn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({show:!!t})}},submitBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=nn(t.options.submitBtn,!0);Q(r,n),t.options.submitBtn=r,e.refreshOptions()},resetBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=nn(t.options.resetBtn,!1);Q(r,n),t.options.resetBtn=r,e.refreshOptions()},submit:function(n,r){return new Promise((function(i,o){(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then((function(){var r=e.formData();t.beforeSubmit(r).then((function(){N.Function(n)&&Me((function(){return n(r,e)})),N.Function(t.options.onSubmit)&&Me((function(){return t.options.onSubmit(r,e)})),t.vm.emit("submit",r,e),i(r)})).catch((function(e){}))})).catch((function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];N.Function(r)&&Me((function(){return r.apply(void 0,[e].concat(n))})),o.apply(void 0,n)}))}))}}}b(".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}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;float:unset;height:auto;line-height:22px;margin-bottom:8px;text-align:left}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}");var on={name:"required",load:function(e,t,n){var i=function(e){return N.Boolean(e)?{required:e}:N.String(e)?{message:e}:N.Undef(e)?{required:!1}:N.Function(e)?{validator:e}:N.Object(e)?e:{}}(e.getValue()),o=void 0;if(!1===i.required)e.clearProp(),n.clearValidateState([t.field]);else{var a=r({required:!0,validator:function(e,t,n){u(),N.empty(t)?n(a.message):n()}},i),u=function(){var e,r=null===(e=t.__fc__.refRule.__$title)||void 0===e?void 0:e.value;if(o!==r)if(o=r,i.message){var u=i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);u&&(a.message=n.t(u[1],{title:r}))}else a.message=n.t("required",{title:r})||r+("en"===n.getLocale()?" is required":"不能为空")};u(),e.getProp().validate=[a]}n.sync(t)},watch:function(){on.load.apply(on,arguments)}};function an(e){e.componentAlias(Kt),we.forEach((function(t){e.component(t.name,t)})),e.register(on),Wt.forEach((function(t){e.parser(t)})),Object.keys(tn).forEach((function(t){e.maker[t]=tn[t]})),"undefined"!=typeof window&&window.ElementPlus&&e.useApp((function(e,t){t.use(window.ElementPlus)}))}var un=Tt({ui:"element-ui",version:"3.2.38",manager:en,extendApi:rn,install:an,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=un);var cn=un.maker;e.default=un,e.maker=cn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
7
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).formCreate={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){u=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw i}}return o}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){return Object.keys(e).reduce((function(n,r){return t&&-1!==t.indexOf(r)||(n[r]=e[r]),n}),{})}function v(e){return Array.isArray(e)?e:[null,void 0,""].indexOf(e)>-1?[]:[e]}var g=t.defineComponent({name:"fcCheckbox",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:Array,default:function(){return[]}},type:String,options:Array,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t.toRef(e.formCreateInject,"options",[]),i=t.toRef(e,"options"),o=t.toRef(e,"modelValue"),a=t.toRef(e,"inputValue",""),u=t.ref(a.value),c=t.toRef(e,"input",!1),l=function(e){var t=d(v(o.value)),n=t.indexOf(u.value);u.value=e,n>-1&&(t.splice(n,1),t.push(e),f(t))};t.watch(a,(function(e){c.value?l(e):u.value=e}));var s=t.computed((function(){var e=r.value||[];return i.value&&(e=i.value||[]),Array.isArray(e)?e:[]}));t.watch(o,(function(e){var t=null;if(!a.value&&null!=e&&Array.isArray(e)&&e.length>0&&c.value){var n=s.value.map((function(e){return e.value}));e.forEach((function(e){-1===n.indexOf(e)&&(t=e)}))}null!=t&&(u.value=t)}),{immediate:!0});var f=function(e){n.emit("update:modelValue",e)};return{options:s,value:o,onInput:f,updateCustomValue:l,makeInput:function(e){if(c.value)return t.createVNode(e,{value:u.value||void 0,label:u.value||void 0},{default:function(){return[t.createVNode(t.resolveComponent("ElInput"),{size:"small",modelValue:u.value,"onUpdate:modelValue":l},null)]}})}}},render:function(){var e,n,i=this,o="button"===this.type?"ElCheckboxButton":"ElCheckbox",a=t.resolveComponent(o);return t.createVNode(t.resolveComponent("ElCheckboxGroup"),t.mergeProps(this.$attrs,{modelValue:null===this.value?void 0:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),r({default:function(){return[i.options.map((function(e,n){var i=r({},e),u=i.value,c=i.label;return delete i.value,delete i.label,t.createVNode(a,t.mergeProps(i,{label:u,value:u,key:o+n+"-"+u}),{default:function(){return[c||u||""]}})})),null===(e=(n=i.$slots).default)||void 0===e?void 0:e.call(n),i.makeInput(a)]}},m(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}});function y(e){e=e||new Map;var t={$on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},$once:function(e,n){n._once=!0,t.$on(e,n)},$off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},$emit:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(e.get(n)||[]).slice().map((function(e){e._once&&(t.$off(n,e),delete e._once),e.apply(void 0,i)})),(e.get("*")||[]).slice().map((function(e){e(n,i)}))}};return t}function b(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}b("._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}");var _={name:"IconCircleClose"},x={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},w=[t.createElementVNode("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),t.createElementVNode("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)];_.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",x,w)};var k={name:"IconDocument"},$={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},C=[t.createElementVNode("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)];k.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",$,C)};var V={name:"IconDelete"},O={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},S=[t.createElementVNode("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)];V.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",O,S)};var R={name:"IconView"},j={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},E=[t.createElementVNode("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)];R.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",j,E)};var F={name:"IconFolderOpened"},D={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},A=[t.createElementVNode("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)];F.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",D,A)};var P=t.defineComponent({name:"fcFrame",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:""},closeBtnText:{type:String,default:""},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:F,IconView:R},data:function(){return{fileList:v(this.modelValue),previewVisible:!1,frameVisible:!1,previewImage:"",bus:new y}},watch:{modelValue:function(e){this.fileList=v(e)}},methods:{close:function(){this.closeModel(!0)},closeModel:function(e){this.bus.$emit(e?"$close":"$ok"),this.reload&&(this.bus.$off("$ok"),this.bus.$off("$close")),this.frameVisible=!1},handleCancel:function(){this.previewVisible=!1},showModel:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},input:function(){var e=this.fileList,t=1===this.maxLength?e[0]||"":e;this.$emit("update:modelValue",t),this.$emit("change",t)},makeInput:function(){var e=this;return t.createVNode(t.resolveComponent("ElInput"),t.mergeProps({type:"text",modelValue:this.fileList.map((function(t){return e.getSrc(t)})).toString(),readonly:!0},{key:1}),{append:function(){return t.createVNode(t.resolveComponent("ElButton"),{icon:t.resolveComponent(e.icon),onClick:function(){return e.showModel()}},null)},suffix:function(){return e.fileList.length&&!e.disabled?t.createVNode(t.resolveComponent("ElIcon"),{class:"el-input__icon _fc-upload-icon",onClick:function(){e.fileList=[],e.input()}},{default:function(){return[t.createVNode(_,null,null)]}}):null}})},makeGroup:function(e){return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),t.createVNode("div",{key:2},[e])},makeItem:function(e,n){return t.createVNode("div",{class:"_fc-files",key:"3"+e},[n])},valid:function(e){var t=this.formCreateInject.field||this.field;if(t&&e!==t)throw new Error("[frame]无效的字段值")},makeIcons:function(e,n){if(!1!==this.handleIcon||!0===this.allowRemove){var r=[];return("file"!==this.type&&!1!==this.handleIcon||"file"===this.type&&this.handleIcon)&&r.push(this.makeHandleIcon(e,n)),this.allowRemove&&r.push(this.makeRemoveIcon(e,n)),t.createVNode("div",{class:"_fc-upload-cover",key:4},[r])}},makeHandleIcon:function(e,n){var r=this,i=t.resolveComponent(!0===this.handleIcon||void 0===this.handleIcon?"icon-view":this.handleIcon);return t.createVNode(t.resolveComponent("ElIcon"),{onClick:function(){return r.handleClick(e)},key:"5"+n},{default:function(){return[t.createVNode(i,null,null)]}})},makeRemoveIcon:function(e,n){var r=this;return t.createVNode(t.resolveComponent("ElIcon"),{onClick:function(){return r.handleRemove(e)},key:"6"+n},{default:function(){return[t.createVNode(V,null,null)]}})},makeFiles:function(){var e=this;return this.makeGroup(this.fileList.map((function(n,r){return e.makeItem(r,[t.createVNode(t.resolveComponent("ElIcon"),{onClick:function(){return e.handleClick(n)}},{default:function(){return[t.createVNode(k,null,null)]}}),e.makeIcons(n,r)])})))},makeImages:function(){var e=this;return this.makeGroup(this.fileList.map((function(n,r){return e.makeItem(r,[t.createVNode("img",{src:e.getSrc(n)},null),e.makeIcons(n,r)])})))},makeBtn:function(){var e=this,n=t.resolveComponent(this.icon);return t.createVNode("div",{class:"_fc-upload-btn",onClick:function(){return e.showModel()},key:7},[t.createVNode(t.resolveComponent("ElIcon"),null,{default:function(){return[t.createVNode(n,null,null)]}})])},handleClick:function(e){if(this.onHandle)return this.onHandle(e);this.previewImage=this.getSrc(e),this.previewVisible=!0},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),this.input(),this.onRemove(e))},getSrc:function(e){return this.srcKey?e[this.srcKey]:e},frameLoad:function(e){var t=this;this.onLoad(e);try{!0===this.helper&&(e.form_create_helper={api:this.formCreateInject.api,close:function(e){t.valid(e),t.closeModel()},set:function(e,n){t.valid(e),!t.disabled&&t.$emit("update:modelValue",n)},get:function(e){return t.valid(e),t.modelValue},onOk:function(e){return t.bus.$on("$ok",e)},onClose:function(e){return t.bus.$on("$close",e)}})}catch(e){console.error(e)}},makeFooter:function(){var e=this,n=this.$props,r=n.okBtnText,i=n.closeBtnText,o=n.closeBtn,a=n.okBtn;if(n.footer)return t.createVNode("div",null,[o?t.createVNode(t.resolveComponent("ElButton"),{onClick:function(){return!1!==e.onCancel()&&(e.frameVisible=!1)}},{default:function(){return[i||e.formCreateInject.t("close")||"关闭"]}}):null,a?t.createVNode(t.resolveComponent("ElButton"),{type:"primary",onClick:function(){return!1!==e.onOk()&&e.closeModel()}},{default:function(){return[r||e.formCreateInject.t("ok")||"确定"]}}):null])}},render:function(){var e,n=this,i=this.type;e="input"===i?this.makeInput():"image"===i?this.makeImages():this.makeFiles();var o=this.$props,a=o.width,u=void 0===a?"30%":a,c=o.height,l=o.src,s=o.title,f=o.modalTitle;return t.nextTick((function(){n.$refs.frame&&n.frameLoad(n.$refs.frame.contentWindow||{})})),t.createVNode("div",{class:{"_fc-frame":!0,"_fc-disabled":this.disabled}},[e,t.createVNode(t.resolveComponent("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:f,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[t.createVNode("img",{style:"width: 100%",src:n.previewImage},null)]}}),t.createVNode(t.resolveComponent("ElDialog"),t.mergeProps({appendToBody:!0},r({width:u,title:s},this.modal),{modelValue:this.frameVisible,onClose:function(){return n.closeModel(!0)}}),{default:function(){return[n.frameVisible||!n.reload?t.createVNode("iframe",{ref:"frame",src:l,frameBorder:"0",style:{height:c,border:"0 none",width:"100%"}},null):null]},footer:function(){return n.makeFooter()}})])},beforeMount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.on("fc:closeModal:"+t,this.close),n&&r.on("fc:closeModal:"+n,this.close)},beforeUnmount:function(){var e=this.formCreateInject,t=e.name,n=e.field,r=e.api;t&&r.off("fc:closeModal:"+t,this.close),n&&r.off("fc:closeModal:"+n,this.close)}}),I=t.defineComponent({name:"fcRadio",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[String,Number,Boolean],default:""},options:Array,type:String,input:Boolean,inputValue:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=t.toRef(e.formCreateInject,"options",[]),i=t.toRef(e,"options"),o=t.toRef(e,"modelValue"),a=t.toRef(e,"inputValue",""),u=t.ref(a.value),c=t.toRef(e,"input",!1);t.watch(a,(function(e){c.value?f(e):u.value=e}));var l=t.computed((function(){var e=r.value||[];return i.value&&(e=i.value||[]),Array.isArray(e)?e:[]}));t.watch(o,(function(e){var t=!1;!a.value&&null!=e&&c.value&&(t=-1===l.value.map((function(e){return e.value})).indexOf(e)),t&&(u.value=e)}),{immediate:!0});var s=function(e){n.emit("update:modelValue",e)},f=function(e){var t=u.value;u.value=e,o.value===t&&s(e)};return{options:l,value:o,onInput:s,updateCustomValue:f,customValue:u,makeInput:function(e){if(c.value)return t.createVNode(e,{checked:!1,value:u.value||void 0,label:u.value||void 0},{default:function(){return[t.createVNode(t.resolveComponent("ElInput"),{size:"small",modelValue:u.value,"onUpdate:modelValue":f},null)]}})}}},render:function(){var e,n,i=this,o="button"===this.type?"ElRadioButton":"ElRadio",a=t.resolveComponent(o);return t.createVNode(t.resolveComponent("ElRadioGroup"),t.mergeProps(this.$attrs,{modelValue:this.value,"onUpdate:modelValue":this.onInput,ref:"el"}),r({default:function(){return[i.options.map((function(e,n){var i=r({},e),u=i.value,c=i.label;return delete i.value,delete i.label,t.createVNode(a,t.mergeProps(i,{label:u,value:u,key:o+n+"-"+u}),{default:function(){return[c||u||""]}})})),null===(e=(n=i.$slots).default)||void 0===e?void 0:e.call(n),i.makeInput(a)]}},m(this.$slots,["default"])))},mounted:function(){this.$emit("fc.el",this.$refs.el)}}),N={type:function(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"},Undef:function(e){return null==e},Element:function(e){return"object"===i(e)&&null!==e&&1===e.nodeType&&!N.Object(e)},trueArray:function(e){return Array.isArray(e)&&e.length>0},Function:function(e){var t=this.getType(e);return"Function"===t||"AsyncFunction"===t},getType:function(e){var t=Object.prototype.toString.call(e);return/^\[object (.*)\]$/.exec(t)[1]},empty:function(e){return null==e||(!(!Array.isArray(e)||!Array.isArray(e)||e.length)||"string"==typeof e&&!e)}};function B(e,t){return{}.hasOwnProperty.call(e,t)}["Date","Object","String","Boolean","Array","Number"].forEach((function(e){N[e]=function(t){return N.type(t,e)}}));var T=t.defineComponent({name:"fcSelect",inheritAttrs:!1,props:{formCreateInject:Object,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},type:String},emits:["update:modelValue","fc.el"],setup:function(e,n){var r=n.emit,i=t.toRef(e.formCreateInject,"options",[]),o=t.toRef(e,"modelValue");return{options:t.computed((function(){return Array.isArray(i.value)?i.value:[]})),value:o,handleUpdate:function(e){r("update:modelValue",e)},hasProperty:B,is:N}},mounted:function(){this.$emit("fc.el",this.$refs.el)}});T.render=function(e,n,r,i,o,u){var c=t.resolveComponent("el-option"),l=t.resolveComponent("el-option-group"),s=t.resolveComponent("el-select");return t.openBlock(),t.createBlock(s,t.mergeProps(e.$attrs,{"model-value":e.value,"onUpdate:modelValue":e.handleUpdate,ref:"el"}),{default:t.withCtx((function(){return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.options,(function(n,r){return t.openBlock(),t.createElementBlock(t.Fragment,null,[e.hasProperty(n,"options")?(t.openBlock(),t.createBlock(l,{label:n.label,key:"".concat(r,"-").concat(n.label)},{default:t.withCtx((function(){return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.is.trueArray(n.options)?n.options:[],(function(e,n){return t.openBlock(),t.createBlock(c,t.mergeProps({key:"".concat(n,"-").concat(e.value)},e),null,16)})),128))]})),_:2},1032,["label"])):(t.openBlock(),t.createBlock(c,t.mergeProps(a({key:1},"key","".concat(r,"-").concat(n.value)),n),null,16))],64)})),256)),t.renderSlot(e.$slots,"default")]})),_:3},16,["model-value","onUpdate:modelValue"])};var L=t.defineComponent({name:"fcTree",inheritAttrs:!1,formCreateParser:{mergeProp:function(e){var t=e.prop.props;t.nodeKey||(t.nodeKey="id"),t.props||(t.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(){var e;this.$refs.tree&&(e="selected"===this.type?this.$refs.tree.getCurrentKey():this.$refs.tree.getCheckedKeys(),this.$emit("update:modelValue",e))},setValue:function(){this.$refs.tree&&("selected"===this.type?this.$refs.tree.setCurrentKey(this.modelValue):this.$refs.tree.setCheckedKeys(v(this.modelValue)))}},render:function(){return t.createVNode(t.resolveComponent("ElTree"),t.mergeProps(this.$attrs,{ref:"tree",onCheck:this.updateValue,onNodeClick:this.updateValue}),this.$slots)},mounted:function(){this.setValue(),this.$emit("fc.el",this.$refs.tree)}});b("._fc-upload{width:100%}._fc-exceed .el-upload{display:none}.el-upload-list.is-disabled .el-upload{cursor:not-allowed!important}");var M={name:"IconUpload"},U={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},q=[t.createElementVNode("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)];function H(e,t){return"object"===i(e)?e:{url:e,is_string:!0,name:Y(e),uid:t}}function z(e){return r(r({},e),{},{file:e,value:e})}function Y(e){return(""+e).split("/").pop()}M.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",U,q)};var G=t.defineComponent({name:"fcUpload",inheritAttrs:!1,formCreateParser:{toFormValue:function(e){return v(e)},toValue:function(e,t){return 1===t.prop.props.limit?e[0]||"":e}},props:{previewMask:void 0,onPreview:Function,httpRequest:Function,modalTitle:String,listType:String,uploadText:String,formCreateInject:Object,modelValue:[Array,String,Object]},emits:["update:modelValue","change","remove","fc.el"],data:function(){return{previewVisible:!1,previewImage:"",fileList:[]}},created:function(){this.fileList=v(this.modelValue).map(H).map(z)},watch:{modelValue:function(e){this.fileList=v(e).map(H).map(z)}},methods:{handlePreview:function(e){this.onPreview?this.onPreview.apply(this,arguments):"text"===this.listType?window.open(e.url):(this.previewImage=e.url,this.previewVisible=!0)},update:function(e){var t=e.map((function(e){return e.is_string?e.url:e.value||e.url})).filter((function(e){return void 0!==e}));this.$emit("update:modelValue",t)},handleCancel:function(){this.previewVisible=!1},handleChange:function(e,t){this.$emit.apply(this,["change"].concat(Array.prototype.slice.call(arguments))),"success"===e.status&&this.update(t)},handleRemove:function(e,t){this.$emit.apply(this,["remove"].concat(Array.prototype.slice.call(arguments))),this.update(t)},doHttpRequest:function(e){if(this.httpRequest)return this.httpRequest(e);e.source="upload",this.formCreateInject.api.fetch(e)}},render:function(){var e,n,i=this,o=v(this.modelValue).length;return t.createVNode("div",{class:"_fc-upload"},[t.createVNode(t.resolveComponent("ElUpload"),t.mergeProps({key:o},this.$attrs,{listType:this.listType||"picture-card",class:{"_fc-exceed":!!this.$attrs.limit&&this.$attrs.limit<=o},onPreview:this.handlePreview,onChange:this.handleChange,onRemove:this.handleRemove,httpRequest:this.doHttpRequest,fileList:this.fileList,ref:"upload"}),r({default:function(){return[(null===(e=(n=i.$slots).default)||void 0===e?void 0:e.call(n))||(-1===["text","picture"].indexOf(i.listType)?t.createVNode(t.resolveComponent("ElIcon"),null,{default:function(){return[t.createVNode(M,null,null)]}}):t.createVNode(t.resolveComponent("ElButton"),{type:"primary"},{default:function(){return[i.formCreateInject.t("clickToUpload")||i.uploadText||"点击上传"]}}))]}},m(this.$slots,["default"]))),t.createVNode(t.resolveComponent("ElDialog"),{appendToBody:!0,modal:this.previewMask,title:this.modalTitle,modelValue:this.previewVisible,onClose:this.handleCancel},{default:function(){return[t.createVNode("img",{style:"width: 100%",src:i.previewImage},null)]}})])},mounted:function(){this.$emit("fc.el",this.$refs.upload)}});function J(e,t,n){e[t]=n}function W(e,t){delete e[t]}function K(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=t[i];if((r=Array.isArray(o))||N.Object(o)){var a=void 0===e[i];if(r)r=!1,a&&J(e,i,[]);else if(o._clone&&void 0!==n){if(!n){J(e,i,o._clone());continue}o=o.getRule(),a&&J(e,i,{})}else a&&J(e,i,{});e[i]=K(e[i],o,n)}else J(e,i,o),N.Undef(o)||(N.Undef(o.__json)||(e[i].__json=o.__json),N.Undef(o.__origin)||(e[i].__origin=o.__origin))}return void 0!==n&&Array.isArray(e)?e.filter((function(e){return!e||!e.__ctrl})):e}function X(e){return K({},{value:e}).value}var Z=Object.assign||function(e){for(var t,n=1;n<arguments.length;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&J(e,r,t[r]);return e};function Q(){return Z.apply(this,arguments)}function ee(e){return"object"!==i(e)||null===e?e:e instanceof Array?d(e):r({},e)}function te(e,t){var n=null;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];null!==n&&clearTimeout(n),n=setTimeout((function(){return e.call.apply(e,[r].concat(o))}),t)}}function ne(e){return null==e?"":"object"===i(e)?JSON.stringify(e,null,2):String(e)}function re(e){return function(e){return e&&"object"===i(e)&&"function"==typeof e.then}(e)?e:Promise.resolve(e)}function ie(e){var t=e.replace(/([A-Z])/g,"-$1").toLocaleLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}function oe(e){return e.replace(e[0],e[0].toLocaleUpperCase())}function ae(e,t,n){return"[form-create ".concat(e,"]: ").concat(t)+(n?"\n\nrule: "+JSON.stringify(n.getRule?n.getRule():n):"")}function ue(e,t){console.error(ae("err",e,t))}b('._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%}._fc-group._fc-group-card{display:flex;flex-direction:column;gap:16px;width:100%}._fc-group._fc-group-card._fc-group-disabled ._fc-group-add,._fc-group._fc-group-card._fc-group-disabled ._fc-group-btn{cursor:not-allowed;opacity:.5}._fc-group._fc-group-card ._fc-group-container{background:#fff;border:1px solid #f0f0f0;border-radius:6px;display:flex;flex-direction:column;margin:0;overflow:hidden;padding:0;position:relative}._fc-group._fc-group-card ._fc-group-header{align-items:center;background:#fafafa;border-bottom:1px solid #f0f0f0;display:flex;justify-content:space-between;padding:16px 20px 12px}._fc-group._fc-group-card ._fc-group-idx{align-items:center;background:#f0f0f0;border:1px solid #e0e0e0;border-radius:6px;color:#666;display:flex;flex-shrink:0;font-size:12px;font-weight:500;height:24px;justify-content:center;margin-right:12px;position:static;width:24px}._fc-group._fc-group-card ._fc-group-title{color:rgba(0,0,0,.85);flex:1;font-size:14px;font-weight:500;line-height:1.5715}._fc-group._fc-group-card ._fc-group-handle{align-items:center;background-color:transparent;border:none;border-radius:0;bottom:auto;display:flex;flex-direction:row;flex-shrink:0;gap:4px;margin-left:12px;padding:0;position:static;right:auto}._fc-group._fc-group-card ._fc-group-btn{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-btn:hover{background:#f0f8ff;border-color:#1890ff;color:#1890ff}._fc-group._fc-group-card ._fc-group-btn:active{border-color:#096dd9;color:#096dd9}._fc-group._fc-group-card ._fc-group-arrow{position:relative}._fc-group._fc-group-card ._fc-group-arrow:before{border-left:1px solid;border-top:1px solid;content:"";height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%) rotate(45deg);width:5px}._fc-group._fc-group-card ._fc-group-arrow._fc-group-down{transform:rotate(180deg)}._fc-group._fc-group-card ._fc-group-sort{align-items:center;display:flex;flex-direction:column;height:24px;justify-content:center;position:relative}._fc-group._fc-group-card ._fc-group-sort:after,._fc-group._fc-group-card ._fc-group-sort:before{border-left:1px solid;border-top:1px solid;content:"";height:4px;left:50%;position:absolute;transform:translateX(-50%);width:4px}._fc-group._fc-group-card ._fc-group-sort:before{top:6px;transform:translateX(-50%) rotate(45deg)}._fc-group._fc-group-card ._fc-group-sort:after{bottom:6px;transform:translateX(-50%) rotate(225deg)}._fc-group._fc-group-card ._fc-group-sort-down,._fc-group._fc-group-card ._fc-group-sort-up{cursor:pointer;height:12px;left:0;position:absolute;right:0;z-index:1}._fc-group._fc-group-card ._fc-group-sort-up{top:0}._fc-group._fc-group-card ._fc-group-sort-down{bottom:0}._fc-group._fc-group-card ._fc-group-sort-down:hover,._fc-group._fc-group-card ._fc-group-sort-up:hover{background:rgba(24,144,255,.1)}._fc-group._fc-group-card ._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-plus-minus:before{background-color:currentColor;content:"";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus{background:#f56c6c;border-color:#f56c6c}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:hover{background:#f78989;border-color:#f78989}._fc-group._fc-group-card ._fc-group-plus-minus._fc-group-minus:before{display:none}._fc-group._fc-group-card ._fc-group-content{padding:20px}._fc-group._fc-group-card ._fc-group-add{align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:4px;color:rgba(0,0,0,.45);cursor:pointer;display:flex;height:24px;justify-content:center;position:relative;width:24px}._fc-group._fc-group-card ._fc-group-add:hover{background:#f0f8ff;border-color:#409eff;color:#409eff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus{background:#409eff;border-color:#409eff;color:#fff;height:24px;width:24px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:after,._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{background-color:currentColor;content:"";height:1px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:8px}._fc-group._fc-group-card ._fc-group-add._fc-group-plus-minus:before{transform:translate(-50%,-50%) rotate(90deg)}._fc-group._fc-group-card ._fc-group-empty{color:rgba(0,0,0,.45);font-size:14px;padding:40px 20px;text-align:center}@media (max-width:768px){._fc-group._fc-group-card ._fc-group-container{border-left:none;border-radius:0;border-right:none;margin:0 -8px}._fc-group._fc-group-card ._fc-group-header{padding:12px 16px 8px}._fc-group._fc-group-card ._fc-group-content{padding:16px}._fc-group._fc-group-card ._fc-group-handle{gap:2px}._fc-group._fc-group-card ._fc-group-btn{height:22px;width:22px}}');var ce="[[FORM-CREATE-PREFIX-",le="-FORM-CREATE-SUFFIX]]";function se(e,t){return JSON.stringify(K(Array.isArray(e)?[]:{},e,!0),(function(e,t){if(!t||!0!==t._isVue){if("function"!=typeof t)return t;if(t.__json)return t.__json;if(t.__origin&&(t=t.__origin),!t.__emit)return ce+t+le}}),t)}function fe(e){return new Function("return "+e)()}function de(e,t){if(e&&N.String(e)&&e.length>4){var n=e.trim(),r=!1;try{if(n.indexOf(le)>0&&0===n.indexOf(ce))n=n.replace(le,"").replace(ce,""),r=!0;else if(0===n.indexOf("$FN:"))n=n.substring(4),r=!0;else if(0===n.indexOf("$EXEC:"))n=n.substring(6),r=!0;else{if(0===n.indexOf("$GLOBAL:")){var i=n.substring(8);return n=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0].api.getGlobalEvent(i);if(r)return r.call.apply(r,[this].concat(t))},n.__json=e,n.__inject=!0,n}if(0===n.indexOf("$FNX:"))return(n=fe("function($inject){\n"+n.substring(5)+"\n}")).__json=e,n.__inject=!0,n;(t||0!==n.indexOf("function ")||"function "===n)&&(t||0!==n.indexOf("function(")||"function("===n)||(r=!0)}if(!r)return e;var o;try{o=fe(n)}catch(e){o=fe("function "+n)}return o.__json=e,o}catch(e){return void ue("解析失败:".concat(n,"\n\nerr: ").concat(e))}}return e}function pe(e,t){return JSON.parse(e,(function(e,n){return N.Undef(n)||!n.indexOf?n:de(n,t)}))}var he=0;function me(){var e=370+ ++he;return"F"+Math.random().toString(36).substr(3,3)+Number("".concat(Date.now())).toString(36)+e.toString(36)+"c"}function ve(e,t,n){var r,o=e;return(t||"").split(".").forEach((function(e){r&&(o[r]&&"object"==i(o[r])||(o[r]={}),o=o[r]),r=e})),o[r]=n,o}var ge=t.defineComponent({name:"fcGroup",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},title:{type:[String,Function],default:null},type:{type:String,default:"default"},onBeforeRemove:{type:Function,default:function(){}},onBeforeAdd:{type:Function,default:function(){}},formCreateInject:Object,parse:Function},data:function(){return{len:0,cacheRule:{},cacheValue:{},sort:[],form:t.markRaw(this.formCreateInject.form.$form())}},emits:["update:modelValue","change","itemMounted","remove","add"],watch:{rule:{handler:function(e,t){var n=this;Object.keys(this.cacheRule).forEach((function(r){var i=n.cacheRule[r];if(i.$f){var o=i.$f.formData();if(e===t)i.$f.deferSyncValue((function(){K(i.rule,e),i.$f.setValue(o)}),!0);else{var a=i.$f.formData();i.$f.once("reloading",(function(){i.$f.setValue(a)})),i.rule=X(e)}}}))},deep:!0},expand:function(e){var t=e-this.modelValue.length;t>0&&this.expandRule(t)},modelValue:{handler:function(e){var t=this;e=e||[];var n=this.sort,r=n.length,i=r-e.length;if(i<0){for(var o=i;o<0;o++)this.addRule(e.length+o,!0);for(var a=0;a<r;a++)this.setValue(n[a],e[a])}else{if(i>0)for(var u=0;u<i;u++)this.removeRule(n[r-u-1]);e.forEach((function(r,i){t.setValue(n[i],e[i])}))}},deep:!0}},methods:{_value:function(e){return e&&B(e,this.field)?e[this.field]:e},cache:function(e,t){this.cacheValue[e]=JSON.stringify(t)},input:function(e){this.$emit("update:modelValue",e),this.$emit("change",e)},formData:function(e,t){var n=this,i=this.cacheRule,o=this.sort;if(o.filter((function(e){return i[e]&&i[e].$f})).length===o.length){var a=o.map((function(i){var o=e===i?t:r({},n.cacheRule[i].$f.form),a=n.field?o[n.field]||null:o;return n.cache(i,a),a}));this.input(a)}},setValue:function(e,t){var n=this.field;n&&(t=a({},n,this._value(t))),this.cacheValue[e]!==JSON.stringify(n?t[n]:t)&&(this.cacheRule[e].$f&&this.cacheRule[e].$f.coverValue(t),this.cache(e,t))},addRule:function(e,n){var i=this,o=this.formCreateInject.form.copyRules(this.rule||[]),u=this.options?r({},this.options):{submitBtn:!1,resetBtn:!1};if(this.defaultValue){u.formData||(u.formData={});var c=X(this.defaultValue);Q(u.formData,this.field?a({},this.field,c):c)}this.parse&&this.parse({rule:o,options:u,index:this.sort.length}),this.cacheRule[++this.len]={rule:o,options:u},this.sort=Object.keys(this.cacheRule),n&&t.nextTick((function(){return i.$emit("add",o,Object.keys(i.cacheRule).length-1)}))},add$f:function(e,n,r){var i=this;this.cacheRule[n].$f=r,t.nextTick((function(){i.$emit("itemMounted",r,Object.keys(i.cacheRule).indexOf(n))}))},removeRule:function(e,n){var r=this,i=Object.keys(this.cacheRule).indexOf(e);delete this.cacheRule[e],delete this.cacheValue[e],this.sort=Object.keys(this.cacheRule),n&&t.nextTick((function(){return r.$emit("remove",i)}))},add:function(e){if(!this.disabled&&!1!==this.onBeforeAdd(this.modelValue)){var t=d(this.modelValue);t.push(this.defaultValue?X(this.defaultValue):this.field?null:{}),this.input(t)}},del:function(e,t){var n=this;if(!this.disabled){var r=function(){n.removeRule(t,!0);var r=d(n.modelValue);r.splice(e,1),n.input(r)};re(this.onBeforeRemove(this.modelValue,e)).then((function(e){!1!==e&&r()}))}},addIcon:function(e){return t.createVNode("div",{class:"_fc-group-btn _fc-group-plus-minus",onClick:this.add},null)},delIcon:function(e,n){var r=this;return t.createVNode("div",{class:"_fc-group-btn _fc-group-plus-minus _fc-group-minus",onClick:function(){return r.del(e,n)}},null)},sortUpIcon:function(e){var n=this;return t.createVNode("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-up",onClick:function(){return n.changeSort(e,-1)}},null)},sortDownIcon:function(e){var n=this;return t.createVNode("div",{class:"_fc-group-btn _fc-group-arrow _fc-group-down",onClick:function(){return n.changeSort(e,1)}},null)},changeSort:function(e,t){var n=this,r=this.sort[e];this.sort[e]=this.sort[e+t],this.sort[e+t]=r,this.formCreateInject.subForm(this.sort.map((function(e){return n.cacheRule[e].$f}))),this.formData(0)},sortIcon:function(e,n){var r=this,i=e>0,o=e<n-1,a=[];return i||o?"card"===this.type&&i&&o?(a.push(t.createVNode("div",{class:"_fc-group-btn _fc-group-sort"},[t.createVNode("div",{class:" _fc-group-sort-up",onClick:function(){return r.changeSort(e,-1)}},null),t.createVNode("div",{class:" _fc-group-sort-down",onClick:function(){return r.changeSort(e,1)}},null)])),a):(i&&a.push(this.sortUpIcon(e)),o&&a.push(this.sortDownIcon(e)),a):a},makeIcon:function(e,t,n){var r=this;if(this.$slots.button)return this.$slots.button({total:e,index:t,vm:this,key:n,del:function(){return r.del(t,n)},add:this.add});var i=[];if((!this.max||e<this.max)&&e===t+1&&i.push(this.addIcon(n)),e>this.min&&i.push(this.delIcon(t,n)),this.sortBtn){var o=this.sortIcon(t,e);o&&i.push.apply(i,d(o))}return i},expandRule:function(e){for(var t=0;t<e;t++)this.modelValue.push(this.field?null:{});this.input(d(this.modelValue))},getTitle:function(e,t){return"function"==typeof this.title?this.title(e,this.modelValue[e],t):"string"==typeof this.title&&this.title.replace("{index}",e+1)}},created:function(){for(var e=(this.expand||0)-this.modelValue.length,t=0;t<this.modelValue.length;t++)this.addRule(t);e>0&&this.expandRule(e)},render:function(){var e=this,n=this.sort,i=this.button,o=this.form,u=this.disabled,c="card"===this.type,l=0===n.length?this.$slots.default?this.$slots.default({vm:this,add:this.add}):t.createVNode("div",{key:"a_def",class:"_fc-group-plus-minus _fc-group-add fc-clock",onClick:this.add},null):n.map((function(l,s){var f=e.cacheRule[l],d=f.rule,p=f.options,h=i&&!u?e.makeIcon(n.length,s,l):[],m=e.getTitle(s,l);return c?t.createVNode("div",{class:"_fc-group-container",key:l},[t.createVNode("div",{class:"_fc-group-header"},[!1===m?t.createVNode("div",{class:"_fc-group-idx"},[s+1]):null,!1!==m?t.createVNode("div",{class:"_fc-group-title"},[m]):null,t.createVNode("div",{class:"_fc-group-handle fc-clock"},[h.length?h:null])]),t.createVNode("div",{class:"_fc-group-content"},[t.createVNode(o,t.mergeProps({key:l},r(r({},e.$attrs),{},{disabled:u,"onUpdate:modelValue":function(t){return e.formData(l,t)},"onUpdate:api":function(t){return e.add$f(s,l,t)},inFor:!0,modelValue:e.field?a({},e.field,e._value(e.modelValue[s])):e.modelValue[s],rule:d,option:p,extendOption:!0})),null)])]):t.createVNode("div",{class:"_fc-group-container",key:l},[t.createVNode(o,t.mergeProps({key:l},r(r({},e.$attrs),{},{disabled:u,"onUpdate:modelValue":function(t){return e.formData(l,t)},"onUpdate:api":function(t){return e.add$f(s,l,t)},inFor:!0,modelValue:e.field?a({},e.field,e._value(e.modelValue[s])):e.modelValue[s],rule:d,option:p,extendOption:!0})),null),t.createVNode("div",{class:"_fc-group-idx"},[s+1]),h.length?t.createVNode("div",{class:"_fc-group-handle fc-clock"},[h]):null])}));return t.createVNode("div",{key:"con",class:"_fc-group "+(u?"_fc-group-disabled":"")+(c?" _fc-group-card":"")},[l])}}),ye=t.defineComponent({name:"fcSubForm",props:{rule:Array,options:{type:Object,default:function(){return t.reactive({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:t.markRaw(this.formCreateInject.form.$form())}},emits:["fc:subform","update:modelValue","change","itemMounted"],watch:{modelValue:function(e){this.setValue(e)}},methods:{formData:function(e){this.cacheValue=JSON.stringify(e),this.$emit("update:modelValue",e),this.$emit("change",e)},setValue:function(e){var t=JSON.stringify(e);this.cacheValue!==t&&(this.cacheValue=t,this.subApi.coverValue(e||{}))},add$f:function(e){var n=this;this.subApi=e,t.nextTick((function(){n.$emit("itemMounted",e)}))}},render:function(){var e=this.form;return t.createVNode(e,{disabled:this.disabled,"onUpdate:modelValue":this.formData,modelValue:this.modelValue,"onUpdate:api":this.add$f,rule:this.rule,option:this.options,extendOption:!0},null)}}),be={name:"IconWarning"},_e={class:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},xe=[t.createElementVNode("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)];be.render=function(e,n,r,i,o,a){return t.openBlock(),t.createElementBlock("svg",_e,xe)};var we=[g,P,I,T,L,G,ge,ye,be],ke=["props"],$e=["class","style","directives"],Ce=["on","hook"],Ve=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[].concat(ke,d(o.normal||[])),u=[].concat($e,d(o.array||[])),c=[].concat(Ce,d(o.functional||[])),l=o.props||[];return t.reduce((function(t,n){for(var o in n)if(t[o])if(l.indexOf(o)>-1)t[o]=e([n[o]],t[o]);else if(a.indexOf(o)>-1)t[o]=r(r({},t[o]),n[o]);else if(u.indexOf(o)>-1){var s=t[o]instanceof Array?t[o]:[t[o]],f=n[o]instanceof Array?n[o]:[n[o]];t[o]=[].concat(d(s),d(f))}else if(c.indexOf(o)>-1)for(var p in n[o])if(t[o][p]){var h=t[o][p]instanceof Array?t[o][p]:[t[o][p]],m=n[o][p]instanceof Array?n[o][p]:[n[o][p]];t[o][p]=[].concat(d(h),d(m))}else t[o][p]=n[o][p];else if("hook"===o)for(var v in n[o])t[o][v]?t[o][v]=Oe(t[o][v],n[o][v]):t[o][v]=n[o][v];else t[o]=n[o];else a.indexOf(o)>-1||c.indexOf(o)>-1||l.indexOf(o)>-1?t[o]=r({},n[o]):u.indexOf(o)>-1?t[o]=n[o]instanceof Array?d(n[o]):"object"===i(n[o])?r({},n[o]):n[o]:t[o]=n[o];return t}),n)},Oe=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},Se=["type","slot","ignore","emitPrefix","value","name","native","hidden","display","inject","options","emit","link","prefix","suffix","update","sync","optionsTo","key","slotUpdate","computed","preview","component","cache","modelEmit"],Re=["validate","children","control"],je=["effect","deep","renderSlots"];function Ee(){return[].concat(Se,d(ke),d($e),d(Ce),Re,je)}function Fe(e){return De(e.replace(/(-[a-z])/g,(function(e){return e.replace("-","").toLocaleUpperCase()})))}function De(e){return e.replace(e[0],e[0].toLowerCase())}function Ae(e,t){return{value:e,enumerable:!1,configurable:!1,writable:!!t}}function Pe(e,t){return Ie([e],t||!1)[0]}function Ie(e,t){return K([],d(e),t||!1)}function Ne(e,t){return Ve(Array.isArray(t)?t:[t],e,{array:Re,normal:je}),e}function Be(e){var t=N.Function(e.getRule)?e.getRule():e;return t.type||(t.type="input"),t}function Te(e,t){Object.defineProperties(e,Object.keys(t).reduce((function(e,n){return e[n]={get:function(){return t[n]()}},e}),{}))}function Le(e){return e.__fc__||(e.__origin__?e.__origin__.__fc__:null)}function Me(e,t){try{t=e()}catch(e){!function(e){ue(e.toString()),console.error(e)}(e)}return t}function Ue(){var e={},n=function(e){return e||"default"};return{setSlot:function(t,r){t=n(t),!r||Array.isArray(r)&&r.length||(e[t]||(e[t]=[]),e[t].push(r))},getSlot:function(t,r){t=n(t);var i=[];return(e[t]||[]).forEach((function(e){if(Array.isArray(e))i.push.apply(i,d(e));else if(N.Function(e)){var t=e.apply(void 0,d(r||[]));Array.isArray(t)?i.push.apply(i,d(t)):i.push(t)}else N.Undef(e)||i.push(e)})),i},getSlots:function(){var t=this,n={};return Object.keys(e).forEach((function(e){n[e]=function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.getSlot(e,r)}})),n},slotLen:function(t){return t=n(t),e[t]?e[t].length:0},mergeBag:function(e){var n=this;if(!e)return this;var r=N.Function(e.getSlots)?e.getSlots():e;return Array.isArray(e)||t.isVNode(e)?this.setSlot(void 0,(function(){return e})):Object.keys(r).forEach((function(e){n.setSlot(e,r[e])})),this}}}function qe(e){var t=r({},e.props||{});return Object.keys(e.on||{}).forEach((function(n){n.indexOf("-")>0&&(n=Fe(n));var r="on".concat(oe(n));Array.isArray(t[r])?t[r]=[].concat(d(t[r]),[e.on[n]]):t[r]?t[r]=[t[r],e.on[n]]:t[r]=e.on[n]})),t.key=e.key,t.ref=e.ref,t.class=e.class,t.id=e.id,t.style=e.style,t.slot&&delete t.slot,t}function He(e,t){return Object.setPrototypeOf(e,t),e}var ze=function(e,t){return"string"==typeof e?String(t):"number"==typeof e?Number(t):t},Ye={"==":function(e,t){return JSON.stringify(e)===JSON.stringify(ze(e,t))},"!=":function(e,t){return!Ye["=="](e,t)},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},on:function(e,t){return e&&e.indexOf&&e.indexOf(ze(e[0],t))>-1},notOn:function(e,t){return!Ye.on(e,t)},in:function(e,t){return t&&t.indexOf&&t.indexOf(e)>-1},notIn:function(e,t){return!Ye.in(e,t)},between:function(e,t){return e>t[0]&&e<t[1]},notBetween:function(e,t){return e<t[0]||e>t[1]},empty:function(e){return N.empty(e)},notEmpty:function(e){return!N.empty(e)},pattern:function(e,t){return new RegExp(t,"g").test(e)}};function Ge(e,t){return(Array.isArray(t)?t:(t||"").split(".")).forEach((function(t){null!=e&&(e=e[t])})),e}function Je(e){var t=e.split("."),n=[],r="";return t.forEach((function(e,t){0===t?r=e:r+="."+e,n.push(r)})),n.join(" && ")}function We(e){for(var t=[],n="",r=0,i=0;i<e.length;i++){var o=e[i];"["===o?(0===r&&n&&(t.push({type:"key",value:n}),n=""),r++,n+=o):"]"===o?(n+=o,0===--r&&(t.push({type:"bracket",value:We(n.slice(1,-1))}),n="")):"."===o&&0===r?n&&(t.push({type:"key",value:n}),n=""):n+=o}return n&&t.push({type:"key",value:n}),t.map((function(e){return"key"===e.type?{key:e.value}:{children:e.value}}))}var Ke=function(e,t){if(e&&e!==t)return e.props.formCreateInject?e.props.formCreateInject:e.parent?Ke(e.parent,t):void 0};function Xe(e,n,i){return t.defineComponent({name:"FormCreate"+(e.isMobile?"Mobile":""),components:n,directives:i,props:{rule:{type:Array,required:!0,default:function(){return[]}},option:{type:Object,default:function(){return{}}},extendOption:Boolean,driver:[String,Object],modelValue:Object,disabled:{type:Boolean,default:void 0},preview:{type:Boolean,default:void 0},index:[String,Number],api:Object,locale:[String,Object],t:Function,name:String,subForm:{type:Boolean,default:!0},inFor:Boolean},emits:["update:api","update:modelValue","mounted","submit","reset","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(n){var i=t.getCurrentInstance();t.provide("parentFC",i);var o=t.inject("parentFC",null),a=o;if(o)for(;a.setupState.parent;)a=a.setupState.parent;else a=i;var u=t.toRefs(n),c=u.rule,l=u.modelValue,s=u.subForm,f=u.inFor,p=t.reactive({ctxInject:{},destroyed:!1,isShow:!0,unique:1,renderRule:d(c.value||[]),updateValue:JSON.stringify(l.value||{})}),h=new e(i),m=h.api(),g=f.value,y=null;t.onBeforeMount((function(){t.watchEffect((function(){var e="",t=n.option&&n.option.globalClass||{};Object.keys(t).forEach((function(n){var r="";t[n].style&&Object.keys(t[n].style).forEach((function(e){r+=ie(e)+":"+t[n].style[e]+";"})),t[n].content&&(r+=t[n].content+";"),r&&(e+=".".concat(n,"{").concat(r,"}"))})),n.option&&n.option.style&&(e+=n.option.style),y||((y=document.createElement("style")).type="text/css",document.head.appendChild(y)),y.innerHTML=e||""}))}));var b=te((function(){h.bus.$emit("$loadData.$topForm")}),100),_=te((function(){h.bus.$emit("$loadData.$scopeForm")}),100),x=te((function(){h.bus.$emit("$loadData.$form")}),100),w=function(e){h.bus.$emit("change-$form."+e)};return t.onMounted((function(){o&&(m.top.bus.$on("$loadData.$form",b),m.top.bus.$on("change",w)),m!==m.scope&&m.scope.bus.$on("$loadData.$scopeForm",_),h.mounted()})),t.onBeforeUnmount((function(){o&&(m.top.bus.$off("$loadData.$form",b),m.top.bus.$off("change",w)),m!==m.scope&&m.scope.bus.$off("$loadData.$scopeForm",_),function(){var e=Ke(i,o);if(e)if(g){var t=v(e.getSubForm()),n=t.indexOf(m);n>-1&&t.splice(n,1)}else e.subForm()}(),p.destroyed=!0,h.unmount(),y&&(y.parentNode||y.parentElement)&&document.head.removeChild(y)})),t.onUpdated((function(){h.updated()})),function(){if(o){var e,t=Ke(i,o);if(t)g?(e=v(t.getSubForm())).push(m):e=m,t.subForm(e)}}(),t.watch((function(){return n.option}),(function(){h.initOptions(),m.refresh()}),{deep:!0,flush:"sync"}),t.watch((function(){return d(c.value)}),(function(e){h.$handle.isBreakWatch()||e.length===p.renderRule.length&&e.every((function(e){return p.renderRule.indexOf(e)>-1}))||(h.$handle.updateAppendData(),h.$handle.reloadRule(c.value),i.setupState.renderRule())})),t.watch((function(){return[n.disabled,n.preview]}),(function(){m.refresh()})),t.watch(l,(function(e){se(e||{})!==p.updateValue&&(m.config.forceCoverValue?m.coverValue(e||{}):m.setValue(e||{}))}),{deep:!0,flush:"post"}),t.watch((function(){return n.index}),(function(){m.coverValue({}),h.$handle.updateAppendData(),t.nextTick((function(){t.nextTick((function(){m.clearValidateState()}))}))}),{flush:"sync"}),r(r({fc:t.markRaw(h),parent:o?t.markRaw(o):o,top:t.markRaw(a),fapi:t.markRaw(m)},t.toRefs(p)),{},{getGroupInject:function(){return Ke(i,o)},refresh:function(){++p.unique},renderRule:function(){p.renderRule=d(c.value||[])},updateValue:function(e){if(!p.destroyed){var n=se(e);p.updateValue!==n&&(p.updateValue=n,i.emit("update:modelValue",e),t.nextTick((function(){x(),o?s.value||_():(b(),_())})))}}})},created:function(){var e=t.getCurrentInstance();e.emit("update:api",e.setupState.fapi),e.setupState.fc.init()}})}function Ze(e,t){return function(n,r,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=new Qe(e,n,r,i,o);return t&&(N.Function(t)?t(a):a.props(t)),a}}function Qe(e,t,n,r,i){this._data=Q({props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0},{type:e,title:t,field:n,value:r,props:i||{}}),this.event=this.on}function et(e){e.forEach((function(e){Qe.prototype[e]=function(t){return Ne(this._data,a({},e,arguments.length<2?t:a({},t,arguments[1]))),this}}))}Q(Qe.prototype,{getRule:function(){return this._data},setProp:function(e,t){return J(this._data,e,t),this},modelField:function(e){return this._data.modelField=e,this},_clone:function(){var e=new this.constructor;return e._data=Pe(this._data),e}}),et(Ee());var tt=Ze("");function nt(e,t,n){var r=tt("",t);return r._data.type=e,r._data.title=n,r}function rt(){return{create:nt,factory:Ze}}function it(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function ot(e){if("undefined"!=typeof XMLHttpRequest){var t,n=new XMLHttpRequest,r=e.action||"";if(n.upload&&e.onProgress&&n.upload.addEventListener("progress",(function(t){t.percent=t.total>0?t.loaded/t.total*100:0,e.onProgress(t)})),e.query){var i=N.String(e.query)?e.query:Object.keys(e.query).reduce((function(t,n){return t[n]=null===e.query[n]||void 0===e.query[n]?"":e.query[n],t}),{}),o=new URLSearchParams(i).toString();o&&(r.includes("?")?r+="&".concat(o):r+="?".concat(o))}n.onerror=function(t){e.onError(t)},n.onload=function(){if(n.status<200||n.status>=300)return e.onError(function(e,t,n){var r="fail to ".concat(e," ").concat(n.status,"'"),i=new Error(r);return i.status=n.status,i.url=e,i}(r,0,n),it(n));e.onSuccess(it(n))},n.open(e.method||"get",r,!0),(e.data||e.file)&&(e.file||"json"!==(e.dataType||"").toLowerCase()?(t=new FormData,Object.keys(e.data||{}).map((function(n){t.append(n,e.data[n])}))):(t=JSON.stringify(e.data||{}),n.setRequestHeader("content-type","application/json"))),e.file&&t.append(e.filename,e.file,e.file.name),e.withCredentials&&"withCredentials"in n&&(n.withCredentials=!0);var a=e.headers||{};Object.keys(a).forEach((function(e){null!=a[e]&&n.setRequestHeader(e,a[e])})),n.send(t)}}function at(e,t,n){return new Promise((function(i,o){(t||ot)(r(r({},e),{},{onSuccess:function(t){var r=function(e){return e},o=de(e.parse);N.Function(o)?r=o:o&&N.String(o)&&(r=function(e){return Ge(e,o)}),re(r(t,e.targetRule,n)).then((function(e){i(e)}))},onError:function(e){o(e)}}))}))}function ut(e){return X(e)}var ct=1;function lt(e){Q(this,{$handle:e,fc:e.fc,vm:e.vm,$manager:e.$manager,vNode:new e.fc.CreateNode(e),force:!1,tmpInput:null,id:ct++}),Te(this,{options:function(){return e.options},sort:function(){return e.sort}}),this.initCache(),this.initRender()}!function(e){Q(e.prototype,{initCache:function(){this.clearCacheAll()},clearCache:function(e){e.rule.cache||(this.cache[e.id]?((!0===this.cache[e.id].use||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):e.parent&&this.clearCache(e.parent))},clearCacheAll:function(){this.cache={}},setCache:function(e,t,n){this.cache[e.id]={vnode:t,use:!1,parent:n,slot:e.rule.slot}},getCache:function(e){var t=this.cache[e.id];if(t)return t.use=!0,t.vnode}})}(lt),function(e){Q(e.prototype,{initRender:function(){this.cacheConfig={}},getTypeSlot:function(e){return function t(n){if(n){var r=void 0;return e.rule.field&&(r=n.slots["field-"+ie(e.rule.field)]||n.slots["field-"+e.rule.field]),r||(r=n.slots["type-"+ie(e.type)]||n.slots["type-"+e.type]),r||t(n.setupState.parent)}}(this.vm)},render:function(){var e=this;if(this.vm.setupState.isShow){this.$manager.beforeRender();var t=Ue();return this.sort.forEach((function(n){e.renderSlot(t,e.$handle.ctxs[n])})),this.$manager.render(t)}},renderSlot:function(e,t,n){if(this.isFragment(t)){t.initProp(),this.mergeGlobal(t),t.initNone();var r=this.renderChildren(t.loadChildrenPending(),t),i=r.default;i&&e.setSlot(t.rule.slot,(function(){return i()})),delete r.default,e.mergeBag(r)}else e.setSlot(t.rule.slot,this.renderCtx(t,n))},mergeGlobal:function(e){var n=this;this.$handle.options.global&&(this.cacheConfig[e.trueType]||(this.cacheConfig[e.trueType]=t.computed((function(){var t=n.$handle.options.global;return Ne({},[t["*"]||t.default||{},t[e.originType]||t[e.type]||t[e.type]||{}])}))),e.prop=Ne({},[this.cacheConfig[e.trueType].value,e.prop]))},setOptions:function(e){var t=e.loadPending({key:"options",origin:e.prop.options,def:[]});e.prop.options=t,e.prop.optionsTo&&t&&ve(e.prop,e.prop.optionsTo,t)},deepSet:function(e){var t=e.prop.deep;t&&Object.keys(t).sort((function(e,t){return e.length<t.length?-1:1})).forEach((function(n){ve(e.prop,n,t[n])}))},parseSide:function(e,t){return N.Object(e)?Ne({props:{formCreateInject:t.prop.props.formCreateInject}},e):e},renderSides:function(e,t,n){var r=t[n?"rule":"prop"];return[this.renderRule(this.parseSide(r.prefix,t)),e,this.renderRule(this.parseSide(r.suffix,t))]},renderId:function(e,t){var n=this,r=this.$handle["field"===t?"fieldCtx":"nameCtx"][e];return r?r.map((function(e){return n.renderCtx(e,e.parent)})):void 0},renderCtx:function(e,t){var n=this;try{if("hidden"===e.type)return;var r=e.rule;if(this.force||!this.cache[e.id]||this.cache[e.id].slot!==r.slot){var i;e.initProp(),this.mergeGlobal(e),e.initNone(),this.$manager.tidyRule(e),this.deepSet(e),this.setOptions(e),this.ctxProp(e);var o=e.prop;o.preview=!!(null!=o.preview?o.preview:this.$handle.preview),o.props.formCreateInject=this.injectProp(e);var a=!1!==o.cache,u=o.preview;if(o.hidden)return void this.setCache(e,void 0,t);i=function(){for(var i=arguments.length,c=new Array(i),l=0;l<i;l++)c[l]=arguments[l];var s={rule:r,prop:o,preview:u,api:n.$handle.api,model:o.model||{},slotValue:c};c.length&&r.slotUpdate&&Me((function(){return r.slotUpdate(s)}));var f={},d=e.loadChildrenPending();e.parser.renderChildren?f=e.parser.renderChildren(d,e):!1!==e.parser.loadChildren&&(f=n.renderChildren(d,e)),Object.keys(o.renderSlots||{}).forEach((function(t){f[t]=function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];if(N.Function(o.renderSlots[t]))return Me((function(){var e;return(e=o.renderSlots)[t].apply(e,i)}));var u=n.parseSide(o.renderSlots[t],e);return n.renderRule(u)}}));var p,h=n.getTypeSlot(e);return h?(s.children=f,p=h(s)):p=u?e.parser.preview(ee(f),e):e.parser.render(ee(f),e),p=n.renderSides(p,e),!e.input&&N.Undef(o.native)&&!1===o.col.show||!0===o.native||(n.fc.targetFormDriver("updateWrap",e),p=n.$manager.makeWrap(e,p)),e.none&&(p=Array.isArray(p)?p.map((function(e){return e&&e.__v_isVNode?n.none(e):e})):n.none(p)),a&&n.setCache(e,(function(){return n.stable(p)}),t),p},this.setCache(e,i,t)}return function(){var t=n.getCache(e);if(t)return t.apply(void 0,arguments);if(!n.cache[e.id]){var r=n.renderCtx(e,e.parent);return r?r():void 0}}}catch(e){return void console.error(e)}},none:function(e){if(e)return e.props.class=this.mergeClass(e.props.class,"fc-none"),e},mergeClass:function(e,t){return Array.isArray(e)?(e.push(t),e):e?[e,t]:t},stable:function(e){var t=this;return(Array.isArray(e)?e:[e]).forEach((function(e){e&&e.__v_isVNode&&e.children&&"object"===i(e.children)&&(e.children.$stable=!0,t.stable(e.children))})),e},getModelField:function(e){return e.prop.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"fragment"===e.type||"template"===e.type},injectProp:function(e){var t=this,n=this.vm.setupState;n.ctxInject[e.id]||(n.ctxInject[e.id]={api:this.$handle.api,form:this.fc.create,subForm:function(n){t.$handle.addSubForm(e,n)},getSubForm:function(){return t.$handle.subForm[e.id]},slots:function(){return t.vm.setupState.top.slots},getWrap:function(){return t.vm.refs[e.wrapRef]},options:[],children:[],preview:!1,id:e.id,field:e.field,rule:e.rule,input:e.input,t:function(){var e;return(e=t.$handle.api).t.apply(e,arguments)},updateValue:function(n){t.$handle.onUpdateValue(e,n)}});var r=n.ctxInject[e.id];return Q(r,{preview:e.prop.preview,options:e.prop.options,children:e.loadChildrenPending()}),r},ctxProp:function(e){var t=this,n=e.ref,i=e.key,o=e.rule;this.$manager.mergeProp(e),e.parser.mergeProp(e);var u=[{ref:n,key:o.key||"".concat(i,"fc"),slot:void 0,on:{vnodeMounted:function(n){n.el.__rule__=e.rule,t.onMounted(e,n.el)},vnodeBeforeUnmount:function(){t.$handle.effect(e,"beforeUnmount"),t.$handle.targetHook(e,"beforeUnmount")},"fc.updateValue":function(n){t.$handle.onUpdateValue(e,n)},"fc.el":function(t){e.exportEl=t,t&&((t.$el||t).__rule__=e.rule)}}}];if(e.input){var c=this.tmpInput;!0===this.vm.props.disabled&&(e.prop.props.disabled=!0);var l=this.getModelField(e),s={callback:function(n){c&&c(e.field,n,e.rule),t.onInput(e,n)},modelField:l,value:this.$handle.getFormData(e)};u.push({on:r(a({},"update:".concat(l),s.callback),e.prop.modelEmit?a({},e.prop.modelEmit,(function(){return t.onEmitInput(e)})):{}),props:a({},l,s.value)}),e.prop.model=s}return Ve(u,e.prop),e.prop},onMounted:function(e,t){e.el=this.vm.refs[e.ref]||t,e.parser.mounted(e),this.$handle.effect(e,"mounted"),this.$handle.targetHook(e,"mounted")},onInput:function(e,t){e.prop.modelEmit?this.$handle.onBaseInput(e,t):this.$handle.onInput(e,t)},onEmitInput:function(e){this.$handle.setValue(e,e.parser.toValue(e.modelValue,e),e.modelValue)},renderChildren:function(e,n){var r=this;if(!N.trueArray(e))return{};var i=Ue();return e.map((function(o){if(o)return N.String(o)||N.Number(o)?i.setSlot(null,"".concat(o)):o.__fc__?r.renderSlot(i,o.__fc__,n):void(o.type&&t.nextTick((function(){r.$handle.loadChildren(e,n),r.$handle.refresh()})))})),i.getSlots()},defaultRender:function(e,t){var n=e.prop;return n.component?"string"==typeof n.component?this.vNode.make(n.component,n,t):this.vNode.makeComponent(n.component,n,t):this.vNode[e.type]?this.vNode[e.type](n,t):this.vNode[e.originType]?this.vNode[e.originType](n,t):this.vNode.make(De(n.type),n,t)},createChildrenVnodes:function(e,t,n){this.force=!1!==n,this.tmpInput=t;var r=this.renderChildren(e.rule.children,e);return this.force=!1,this.tmpInput=null,r},createRuleVnode:function(e,t,n){this.force=!1!==n,this.tmpInput=t;var r=Ue();return this.renderSlot(r,e,e.parent),this.force=!1,this.tmpInput=null,r.getSlots()},renderRule:function(e,t,n){var i=this;if(e){if(N.String(e)||N.Number(e))return"".concat(e);var o;if(n)o=e.type;else if(o=e.is,e.type){o=Fe(e.type);var a=this.vNode.aliasMap[o];a&&(o=Fe(a))}if(o){var u=Ue();N.trueArray(e.children)&&e.children.forEach((function(e){e&&u.setSlot(null==e?void 0:e.slot,(function(){return i.renderRule(e)}))}));var c=r({},e);return delete c.type,delete c.is,this.vNode.make(o,c,u.mergeBag(t).getSlots())}}}})}(lt);var st=["hook:updated","hook:mounted"];function ft(e,n,i){var o,a=me(),u=!!n.field;Q(this,{id:a,ref:a,wrapRef:a+"fi",rule:n,origin:n.__origin__||n,name:n.name,pending:{},none:!1,watch:[],linkOn:[],root:[],ctrlRule:[],children:[],parent:null,group:n.subRule?this:null,cacheConfig:null,prop:r({},n),computed:{},payload:{},refRule:{},input:u,el:void 0,exportEl:void 0,defaultValue:u?X(i):void 0,field:n.field||void 0}),this.updateKey(),o=this,Object.defineProperties(o.origin,{__fc__:Ae(t.markRaw(o),!0)}),o.rule!==o.origin&&Object.defineProperties(o.rule,{__fc__:Ae(t.markRaw(o),!0)}),this.update(e,!0)}function dt(e,t){for(var n=0;n<e.ctrlRule.length;n++){var r=e.ctrlRule[n];if(r.children===t)return r}}function pt(e){return!!e.rule.__ctrl}function ht(e,t){return"function"==typeof t?""+t:t}Q(ft.prototype,{getParentGroup:function(){for(var e=this.parent;e;){if(e.group)return e;e=e.parent}},loadChildrenPending:function(){var e=this,t=this.rule.children||[];return Array.isArray(t)?t:this.loadPending({key:"children",origin:t,def:[],onLoad:function(t){e.$handle&&e.$handle.loadChildren(t,e)},onUpdate:function(t,n){e.$handle&&(t===n?e.$handle.loadChildren(t,e):e.$handle.updateChildren(e,t,n))},onReload:function(t){e.$handle?e.$handle.updateChildren(e,[],t):delete e.pending.children}})},loadPending:function(e){var t=this,n=e.key,r=e.origin,i=e.def,o=e.onLoad,a=e.onReload,u=e.onUpdate;if(this.pending[n]&&this.pending[n].origin===r)return this.getPending(n,i);delete this.pending[n];var c=r;if(N.Function(r)){var l=Me((function(){return r({rule:t.rule,api:t.$api,update:function(e){var o=e||i,a=t.getPending(n,i);t.setPending(n,r,o),u&&u(o,a)},reload:function(){var e=t.getPending(n,i);delete t.pending[n],a&&a(e),t.$api&&t.$api.sync(t.rule)}})}));l&&N.Function(l.then)?(l.then((function(e){var a=e||i;t.setPending(n,r,a),o&&o(a),t.$api&&t.$api.sync(t.rule)})).catch((function(e){console.error(e)})),c=i,this.setPending(n,r,c)):(c=l||i,this.setPending(n,r,c),o&&o(c))}return c},getPending:function(e,t){return this.pending[e]&&this.pending[e].value||t},setPending:function(e,n,r){this.pending[e]={origin:n,value:t.reactive(r)}},effectData:function(e){return this.payload[e]||(this.payload[e]={}),this.payload[e]},clearEffectData:function(e){void 0===e?this.payload={}:delete this.payload[e]},updateKey:function(e){this.key=me(),e&&this.parent&&this.parent.updateKey(e)},updateType:function(){this.originType=this.rule.type,this.type=Fe(this.rule.type),this.trueType=this.$handle.getType(this.originType)},setParser:function(e){this.parser=e,e.init(this)},initProp:function(){var e,t,n=this,i=r({},this.rule);delete i.children,delete i.validate,this.prop=Ne({},[i].concat(d(Object.keys(this.payload).map((function(e){return n.payload[e]}))),[this.computed])),this.prop.validate=[].concat(d((null===(e=this.refRule)||void 0===e||null===(t=e.__$validate)||void 0===t?void 0:t.value)||[]),d(this.prop.validate||[]))},initNone:function(){this.none=!(N.Undef(this.prop.display)||this.prop.display)},hasHidden:function(){return!!this.rule.hidden||!!this.parent&&this.parent.hasHidden()},injectValidate:function(){return this.prop.validate},check:function(e){return this.vm===e.vm},unwatch:function(){var e=this;this.watch.forEach((function(e){return e()})),this.watch=[],Object.keys(this.refRule).forEach((function(t){0!==t.indexOf("__$")&&delete e.refRule[t]}))},unlink:function(){this.linkOn.forEach((function(e){return e()})),this.linkOn=[]},link:function(){this.unlink(),this.$handle.appendLink(this)},watchTo:function(){this.$handle.watchCtx(this)},delete:function(){this.unwatch(),this.unlink(),this.rmCtrl(),this.parent&&this.parent.children.splice(this.parent.children.indexOf(this)>>>0,1),Q(this,{deleted:!0,computed:{},parent:null,children:[],cacheConfig:null,none:!1})},rmCtrl:function(){this.ctrlRule.forEach((function(e){return e.__fc__&&e.__fc__.rm()})),this.ctrlRule=[]},rm:function(){var e=this,t=function(){var t=e.root.indexOf(e.origin);t>-1&&(e.root.splice(t,1),e.$handle&&e.$handle.refresh())};this.deleted?t():this.$handle.noWatch((function(){e.$handle.deferSyncValue((function(){e.rmCtrl(),t(),e.$handle.rmCtx(e),Q(e,{root:[]})}),e.input)}))},update:function(e,t){Q(this,{deleted:!1,$handle:e,$render:e.$render,$api:e.api,vm:e.vm,vNode:e.$render.vNode,updated:!1,cacheValue:this.rule.value}),!t&&this.unwatch(),this.watchTo(),this.link(),this.updateType()}});var mt={init:function(e){},toFormValue:function(e,t){return e},toValue:function(e,t){return e},mounted:function(e){},render:function(e,t){return t.$handle.fc.renderDriver&&t.$handle.fc.renderDriver.defaultRender?t.$handle.fc.renderDriver.defaultRender(t,e):t.$render.defaultRender(t,e)},preview:function(e,t){return t.$handle.fc.renderDriver&&t.$handle.fc.renderDriver.defaultPreview?t.$handle.fc.renderDriver.defaultPreview(t,e):this.render(e,t)},mergeProp:function(e){}},vt=["field","value","vm","template","name","config","control","inject","sync","payload","optionsTo","update","slotUpdate","computed","component","cache"],gt=Symbol("oldValue");function yt(e){var n=this;Te(this,{options:function(){return e.options.value||{}},bus:function(){return e.bus},preview:function(){return null!=e.vm.props.preview?e.vm.props.preview:e.vm.setupState.parent&&null!=e.vm.setupState.parent.props.preview?e.vm.setupState.parent.props.preview:e.options.value.preview||!1}}),Q(this,{fc:e,vm:e.vm,watching:!1,loading:!1,reloading:!1,noWatchFn:null,deferSyncFn:null,isMounted:!1,formData:t.reactive({}),subRuleData:t.reactive({}),subForm:{},form:t.reactive({}),appendData:{},ignoreFields:[],providers:{},cycleLoad:null,loadedId:1,nextTick:null,changeStatus:!1,pageEnd:!0,nextReload:function(){n.lifecycle("reload")}}),this.initData(e.rules),this.$manager=new e.manager(this),this.$render=new lt(this),this.api=e.extendApiFn.reduce((function(e,t){var r=Me((function(){return t(e,n)}));return r&&r!==e&&Q(e,r),e}),function(e){function n(t){return N.Undef(t)?t=e.fields():Array.isArray(t)||(t=[t]),t}function o(t,n,i){N.Undef(t)?t=Object.keys(r(r({},e.fieldCtx),e.nameCtx)):Array.isArray(t)||(t=[t]),t.forEach((function(t){var r=e.fieldCtx[t]||e.nameCtx[t];r&&r.forEach((function(t){J(t.rule,n,i),e.$render.clearCache(t)}))}))}function u(){var t=e.subForm;return Object.keys(t).reduce((function(e,n){var r=t[n];return r?(Array.isArray(r)?e.push.apply(e,d(r)):e.push(r),e):e}),[])}var c={get isScope(){return!1===e.vm.props.subForm},get isPreview(){return e.preview},get config(){return e.options},set config(t){e.fc.options.value=t},get options(){return e.options},set options(t){e.fc.options.value=t},get form(){return e.form},get rule(){return e.rules},get parent(){return e.vm.setupState.parent&&e.vm.setupState.parent.setupState.fapi},get top(){return c.parent?c.parent.top:c},get scope(){for(var t=e.vm;t&&t.setupState.fapi;){if(!t.props.subForm)return t.setupState.fapi;t=t.setupState.parent}return c.top},get children(){return u()},get siblings(){var t=e.vm.setupState.getGroupInject();if(t){var n=t.getSubForm();if(Array.isArray(n))return d(n)}},get index(){var e=c.siblings;if(e){var t=e.indexOf(c);return t>-1?t:void 0}},get formulas(){return r({},e.fc.formulas)},formData:function(t){if(null==t||"boolean"==typeof t){var r={};return Object.keys(e.form).forEach((function(n){!0!==t&&-1!==e.ignoreFields.indexOf(n)||(r[n]=ut(e.form[n]))})),r}return n(t).reduce((function(e,t){return e[t]=c.getValue(t),e}),{})},getValue:function(t){var n=e.getFieldCtx(t);return n?ut(n.rule.value):!1!==e.options.appendValue&&B(e.appendData,t)?ut(e.appendData[t]):void 0},coverValue:function(t){var n=r({},t||{});e.deferSyncValue((function(){e.appendData={},c.fields().forEach((function(r){var i=e.fieldCtx[r];if(i){var o=B(t,r);i.forEach((function(e){e.rule.value=o?t[r]:void 0})),delete n[r]}})),Q(e.appendData,n)}),!0)},setValue:function(t){var n=t;arguments.length>=2&&(n=a({},t,arguments[1])),e.deferSyncValue((function(){Object.keys(n).forEach((function(t){var r=e.fieldCtx[t];if(!r)return e.appendData[t]=n[t];r.forEach((function(e){e.rule.value=n[t]}))}))}),!0)},removeField:function(t){var n=e.getCtx(t);return e.deferSyncValue((function(){e.getCtxs(t).forEach((function(e){e.rm()}))}),!0),n?n.origin:void 0},removeRule:function(e){var t=e&&Le(e);if(t)return t.rm(),t.origin},fields:function(){return e.fields()},append:function(t,n,r){var i,o=e.sort.length-1,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return;o=a.rule.children.length-1}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o+1,0,t)},prepend:function(t,n,r){var i,o=0,a=e.getCtx(n);if(a)if(r){if(i=a.getPending("children",a.rule.children),!Array.isArray(i))return}else o=a.root.indexOf(a.origin),i=a.root;else i=e.rules;i.splice(o,0,t)},hidden:function(t,n){o(n,"hidden",!!t),e.refresh()},hiddenStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.hidden},display:function(t,n){o(n,"display",!!t),e.refresh()},displayStatus:function(t){var n=e.getCtx(t);if(n)return!!n.rule.display},disabled:function(t,r){n(r).forEach((function(n){e.getCtxs(n).forEach((function(e){J(e.rule.props,"disabled",!!t)}))})),e.refresh()},all:function(t){return Object.keys(e.ctxs).map((function(n){var r=e.ctxs[n];return t?r.origin:r.rule}))},model:function(t){return e.fields().reduce((function(n,r){var i=e.fieldCtx[r][0];return n[r]=t?i.origin:i.rule,n}),{})},component:function(t){return Object.keys(e.nameCtx).reduce((function(n,r){var i=e.nameCtx[r].map((function(e){return t?e.origin:e.rule}));return n[r]=1===i.length?i[0]:i,n}),{})},bind:function(){return c.form},reload:function(t){e.reloadRule(t)},updateOptions:function(t){e.fc.updateOptions(t),c.refresh()},onSubmit:function(e){c.updateOptions({onSubmit:e})},sync:function(t){if(Array.isArray(t))t.forEach((function(e){return c.sync(e)}));else{var n=N.Object(t)?Le(t):e.getCtxs(t);n&&((n=Array.isArray(n)?n:[n]).forEach((function(t){if(!t.deleted){var n=e.subForm[t.id];n&&(Array.isArray(n)?n.forEach((function(e){e.refresh()})):n&&n.refresh()),e.$render.clearCache(t)}})),e.refresh())}},refresh:function(){u().forEach((function(e){e.refresh()})),e.$render.clearCacheAll(),e.refresh()},refreshOptions:function(){e.$manager.updateOptions(e.options),c.refresh()},hideForm:function(t){e.vm.setupState.isShow=!t},changeStatus:function(){return e.changeStatus},clearChangeStatus:function(){e.changeStatus=!1},updateRule:function(t,n){e.getCtxs(t).forEach((function(e){Q(e.rule,n)}))},updateRules:function(e){Object.keys(e).forEach((function(t){c.updateRule(t,e[t])}))},mergeRule:function(t,n){e.getCtxs(t).forEach((function(e){Ne(e.rule,n)}))},mergeRules:function(e){Object.keys(e).forEach((function(t){c.mergeRule(t,e[t])}))},getRule:function(t,n){var r=e.getCtx(t);if(r)return n?r.origin:r.rule},findType:function(t,n){var r=void 0;return Object.keys(e.ctxs).forEach((function(i){var o=e.ctxs[i];o.rule.type===t&&(r=n?o.origin:o.rule)})),r},findTypes:function(t,n){var r=[];return Object.keys(e.ctxs).forEach((function(i){var o=e.ctxs[i];o.rule.type===t&&r.push(n?o.origin:o.rule)})),r},getRenderRule:function(t){var n=e.getCtx(t);if(n)return n.prop},getRefRule:function(t){var n=e.getCtxs(t);if(n){var r=n.map((function(e){return e.rule}));return 1===r.length?r[0]:r}},setEffect:function(t,n,r){var i=e.getCtx(t);i&&n&&("$"===n[0]&&(n=n.substr(1)),B(i.rule,"$"+n)&&J(i.rule,"$"+n,r),B(i.rule,"effect")||(i.rule.effect={}),J(i.rule.effect,n,r))},clearEffectData:function(t,n){var r=e.getCtx(t);r&&(n&&"$"===n[0]&&(n=n.substr(1)),r.clearEffectData(n),c.sync(t))},updateValidate:function(e,t,n){n?c.mergeRule(e,{validate:t}):o(e,"validate",t)},updateValidates:function(e,t){Object.keys(e).forEach((function(n){c.updateValidate(n,e[n],t)}))},refreshValidate:function(){c.refresh()},resetFields:function(r){n(r).forEach((function(t){e.getCtxs(t).forEach((function(t){e.$render.clearCache(t),t.rule.value=ut(t.defaultValue)}))})),t.nextTick((function(){t.nextTick((function(){t.nextTick((function(){c.clearValidateState(r)}))}))})),null==r&&(N.Function(e.options.onReset)&&Me((function(){return e.options.onReset(c)})),e.vm.emit("reset",c))},method:function(e,t){var n=c.el(e);if(!n||!n[t])throw new Error(ae("err","".concat(t," 方法不存在")));return function(){return n[t].apply(n,arguments)}},exec:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return Me((function(){return c.method(e,t).apply(void 0,r)}))},toJson:function(e){return se(c.rule,e)},trigger:function(e,t){for(var n=c.el(e),r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];n&&n.$emit.apply(n,[t].concat(i))},el:function(t){var n=e.getCtx(t);if(n)return n.el||e.vm.refs[n.ref]},closeModal:function(t){e.bus.$emit("fc:closeModal:"+t)},getSubForm:function(t){var n=e.getCtx(t);return n?e.subForm[n.id]:void 0},getChildrenRuleList:function(t){var n="object"===i(t),r=n?Le(t):e.getCtx(t),o=r?r.rule:n?t:c.getRule(t);if(!o)return[];var a,u=[];return(a=r?r.loadChildrenPending():o.children)&&a.forEach((function(e){"object"===i(e)&&(e.field&&u.push(e),u.push.apply(u,d(c.getChildrenRuleList(e))))})),u},getParentRule:function(t){return("object"===i(t)?Le(t):e.getCtx(t)).parent.rule},getParentSubRule:function(t){var n="object"===i(t)?Le(t):e.getCtx(t);if(n){var r=n.getParentGroup();if(r)return r.rule}},getChildrenFormData:function(e,t){return c.getChildrenRuleList(e).reduce((function(e,n){return!0===n.ignore&&!0!==t||(e[n.field]=ut(n.value)),e}),{})},setChildrenFormData:function(t,n,r){var i=c.getChildrenRuleList(t);e.deferSyncValue((function(){i.forEach((function(e){B(n,e.field)?e.value=n[e.field]:r&&(e.value=void 0)}))}))},getGlobalEvent:function(e){var t=c.options.globalEvent[e];if(t)return"object"===i(t)&&(t=t.handle),de(t)},getGlobalData:function(t){return new Promise((function(n,r){var i=c.options.globalData[t];i?"fetch"===i.type?c.fetch(i).then((function(e){n(e)})).catch(r):n(i.data):n(e.fc.loadData[t])}))},emitGlobalEvent:function(t){var n=c.getGlobalEvent(t);if(n){for(var r=e.getInjectData({},void 0),i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return r.args=[].concat(o),o.unshift(r),n.apply(null,o)}},setGlobalData:function(e,t){c.setData("$globalData."+e,t)},setGlobalVar:function(e,t){c.setData("$var."+e,t)},renderRule:function(t,n,r){var o="object"===i(t)?Le(t):e.getCtx(t);return o?e.$render.createRuleVnode(o,n,r):void 0},renderChildren:function(t,n,r){var o="object"===i(t)?Le(t):e.getCtx(t);return o?e.$render.createChildrenVnodes(o,n,r):void 0},nextTick:function(t){e.bus.$once("next-tick",t),e.refresh()},nextRefresh:function(t){e.nextRefresh(),t&&Me(t)},deferSyncValue:function(t,n){e.deferSyncValue(t,n)},emit:function(t){var n;e.vm.emitsOptions&&!e.vm.emitsOptions[t]&&(e.vm.emitsOptions[t]=null);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];(n=e.vm).emit.apply(n,[t].concat(i))},bus:e.bus,getCurrentFormRule:function(){var t;return null===(t=e.vm.setupState.getGroupInject())||void 0===t?void 0:t.rule},fetch:function(t){return new Promise((function(n,r){t=X(t),t=e.loadFetchVar(t);var i=function(e){Me((function(){return t.onError&&t.onError(e)})),r(e)};e.beforeFetch(t).then((function(){return at(t,e.fc.create.fetch,c).then((function(e){Me((function(){return t.onSuccess&&t.onSuccess(e)})),n(e)})).catch((function(e){i(e)}))})).catch((function(e){i(e)}))}))},watchFetch:function(t,n,r,i){return e.fc.watchLoadData((function(o,a){var u=X(t);if(u=e.loadFetchVar(u,o),!i||!1!==i(u,a)){var l=function(e){Me((function(){return u.onError&&u.onError(e)})),r&&r(e)};e.beforeFetch(u).then((function(){return at(u,e.fc.create.fetch,c).then((function(e){Me((function(){return u.onSuccess&&u.onSuccess(e)})),n&&n(e,a)})).catch((function(e){l(e)}))})).catch((function(e){l(e)}))}}),null==t.wait?1e3:t.wait)},getData:function(t,n){return e.fc.get?e.fc.get(t,n):e.fc.getLoadData(t,n)},watchData:function(t){return e.fc.watchLoadData((function(e,n){Me((function(){return t(e,n)}))}))},setData:function(t,n,r){return e.fc.setData(t,n,r)},refreshData:function(t){return e.fc.refreshData(t)},t:function(t,n){return e.fc.t(t,n)},getLocale:function(){return e.fc.getLocale()},helper:{tidyFields:n,props:o}};return["on","once","off"].forEach((function(t){c[t]=function(){var n;(n=e.bus)["$".concat(t)].apply(n,arguments)}})),c.changeValue=c.changeField=c.setValue,c}(this))}Q(yt.prototype,{initData:function(e){Q(this,{ctxs:{},fieldCtx:{},nameCtx:{},sort:[],rules:e})},init:function(){this.updateAppendData(),this.useProvider(),this.usePage(),this.loadRule(),this.$manager.__init(),this.lifecycle("created")},updateAppendData:function(){this.appendData=r(r(r({},X(this.options.formData||{})),this.fc.vm.props.modelValue||{}),this.appendData)},isBreakWatch:function(){return this.loading||this.noWatchFn||this.reloading},globalBeforeFetch:function(e){var t=this;return new Promise((function(n,r){var i=t.options.beforeFetch&&Me((function(){return t.options.beforeFetch(e,{api:t.api})}));i&&N.Function(i.then)?i.then(n).catch(r):n()}))},beforeFetch:function(e){var t=this;return new Promise((function(n,r){var i=e&&e.beforeFetch&&Me((function(){return e.beforeFetch(e,{api:t.api})}));i&&N.Function(i.then)?i.then(n).catch(r):!1===i?r():n()})).then((function(){return t.globalBeforeFetch(e)}))},beforeSubmit:function(e){var t=this;return new Promise((function(n,r){var i=t.options.beforeSubmit&&Me((function(){return t.options.beforeSubmit(e,{api:t.api})}));i&&N.Function(i.then)?i.then(n).catch(r):!1===i?r():n()}))}}),function(e){Q(e.prototype,{parseInjectEvent:function(e,t){var n=e.inject||this.options.injectEvent;return this.parseEventLst(e,t,n)},parseEventLst:function(e,t,n,r){var i=this;return Object.keys(t).forEach((function(o){var a=i.parseEvent(e,t[o],n,r);a&&(t[o]=a)})),t},parseEvent:function(e,t,n,r){if(N.Function(t)&&(!1!==n&&!N.Undef(n)||t.__inject))return this.inject(e,t,n);if(!r&&Array.isArray(t)&&t[0]&&(N.String(t[0])||N.Function(t[0])))return this.parseEventLst(e,t,n,!0);if(N.String(t)){var i=de(t);if(i&&t!==i)return i.__inject?this.parseEvent(e,i,n,!0):i}},parseEmit:function(e){var t=this,n={},r=e.rule,i=r.emitPrefix,o=r.field,a=r.name,u=r.inject,c=r.emit||[];return N.trueArray(c)&&c.forEach((function(e){if(e){var c,l=i||o||a;if(N.Object(e)&&(c=e.inject,l=(e=e.name).prefix||l),l){var s=ie("".concat(l,"-").concat(e)),f=function(){var e,n,r;t.vm.emitsOptions&&!t.vm.emitsOptions[s]&&(t.vm.emitsOptions[s]=null);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];(e=t.vm).emit.apply(e,[s].concat(o)),(n=t.vm).emit.apply(n,["emit-event",s].concat(o)),(r=t.bus).$emit.apply(r,[s].concat(o))};if(f.__emit=!0,c||!1!==u){var d=c||u||t.options.injectEvent;n[Fe(e)]=N.Undef(d)?f:t.inject(r,f,d)}else n[Fe(e)]=f}}})),e.computed.on=n,n},getInjectData:function(e,t){var n=e.__fc__&&e.__fc__.$api,r=(e.__fc__&&e.__fc__.$handle.vm||this.vm).props,i=r.option,o=r.rule;return{$f:n||this.api,api:n||this.api,rule:o,self:e.__origin__,option:i,inject:t}},inject:function(e,t,n){if(t.__origin){if(this.watching&&!this.loading)return t;t=t.__origin}var r=this,i=function(){for(var i=r.getInjectData(e,n),o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];return i.args=[].concat(a),a.unshift(i),t.apply(this,a)};return i.__origin=t,i.__json=t.__json,i},loadStrVar:function(e,t,n){var r=this;if(e&&"string"==typeof e&&e.indexOf("{{")>-1&&e.indexOf("}}")>-1){var i,o=e,a=function(e){for(var t,n=/{{\s*(.*?)\s*}}/g,r={};null!==(t=n.exec(e));)t[1]&&(r[t[1]]=!0);return Object.keys(r)}(e),u=function e(i){var o=[];i.forEach((function(t){t.key?o.push(t.key):t.children&&o.push(e(t.children))}));var a=!1;return o.forEach((function(e,t){null==e||0!==e.indexOf("'")&&0!==e.indexOf('"')||(o[t]=e.slice(1,-1),a=!0)})),1!==o.length||!a&&isNaN(Number(o[0]))?function(e){var i,o=!1;if(n&&0===e.indexOf("$form.")){var a=e.split(".");a.shift(),B(n.value,a[0])&&(o=!0,i=t?t({id:"$form."+a[0]+"_"+n.rule.__fc__.id,getValue:function(){return Ge(n.value,a)}}):Ge(n.value,a))}return o||(i=t?t(e):r.fc.getLoadData(e)),i}(o.join(".")):o[0]};if(a.forEach((function(t){var n=t.split("||"),r=n[0].trim();if(r){var o=(n[1]||"").trim(),a=We(r),c=Me((function(){return u(a)}));(null==c||""===c)&&n.length>1&&(c=o),i=c,e=e.replaceAll("{{".concat(t,"}}"),null==c?"":c)}})),1===a.length&&o==="{{".concat(a[0],"}}"))return i}return e},loadFetchVar:function(e,t,n){var r,i=this;n&&n.__fc__&&(r=n.__fc__.getParentGroup());var o=function(e){return i.loadStrVar(e,t,r?{rule:n,value:i.subRuleData[r.id]||{}}:null)};return e.action=o(e.action||""),["headers","data","query"].forEach((function(t){if(e[t]){var n=Array.isArray(e[t])?[]:{};Object.keys(e[t]).forEach((function(r){n[o(r)]=o(e[t][r])})),e[t]=n}})),e}})}(yt),function(e){Q(e.prototype,{usePage:function(){var e=this,t=this.options.page;if(t){var n,r=25,i=(n=this.rules).length<31?31:Math.ceil(n.length/3);N.Object(t)&&(t.first&&(r=parseInt(t.first,10)||r),t.limit&&(i=parseInt(t.limit,10)||i)),Q(this,{first:r,limit:i,pageEnd:this.rules.length<=r}),this.bus.$on("page-end",(function(){return e.vm.emit("page-end",e.api)})),this.pageLoad()}},pageLoad:function(){var e=this;this.bus.$on(st,(function t(){e.pageEnd?(e.bus.$off(st,t),e.bus.$emit("page-end")):(e.first+=e.limit,e.pageEnd=e.rules.length<=e.first,e.loadRule(),e.refresh())}))}})}(yt),function(e){Q(e.prototype,{clearNextTick:function(){this.nextTick&&clearTimeout(this.nextTick),this.nextTick=null},bindNextTick:function(e){var t=this;this.clearNextTick(),this.nextTick=setTimeout((function(){e(),t.nextTick=null}),10)},render:function(){return++this.loadedId,this.vm.setupState.unique>0?this.$render.render():(this.vm.setupState.unique=1,[])}})}(yt),function(e){Q(e.prototype,{nextRefresh:function(e){var n=this,r=this.loadedId;t.nextTick((function(){r===n.loadedId&&(e?e():n.refresh())}))},parseRule:function(e){var t=this,n=Be(e);return Object.defineProperties(n,{__origin__:Ae(e,!0)}),function(e){var t={props:{},on:{},options:[],children:[],hidden:!1,display:!0,value:void 0};Object.keys(t).forEach((function(n){B(e,n)||(e[n]=t[n])}))}(n),this.appendValue(n),[n,n.prefix,n.suffix].forEach((function(e){e&&t.loadFn(e,n)})),this.loadCtrl(n),n.update&&(n.update=de(n.update)),n},loadFn:function(e,t){var n=this;["on","props","deep"].forEach((function(r){e[r]&&n.parseInjectEvent(t,e[r])}))},loadCtrl:function(e){e.control&&e.control.forEach((function(e){e.handle&&(e.handle=de(e.handle))}))},syncProp:function(e){var t=this,n=e.rule;N.trueArray(n.sync)&&Ve([{on:n.sync.reduce((function(e,r){return e["object"===i(r)&&r.event||"update:".concat(r)]=function(e){n.props["object"===i(r)&&r.prop||r]=e,t.vm.emit("sync",r,e,n,t.fapi)},e}),{})}],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,t){if(this.cycleLoad=!1,this.loading=!0,this.bus.$emit("load-start"),this._loadRule(e,t),this.loading=!1,this.cycleLoad)return this.loadRule();this.syncForm(),this.bus.$emit("load-end"),this.$render.clearCache(t)},_loadRule:function(e,t){var n=this,r=function t(r){var i=e[r-1];if(!i||!i.__fc__)return r>0?t(r-1):-1;var o=n.sort.indexOf(i.__fc__.id);return o>-1?o:t(r-1)},i=function(e,t){N.trueArray(e)&&n._loadRule(e,t)},o=e.map((function(o,a){if((!t||N.Object(o))&&(n.pageEnd||t||!(a>=n.first))){if(o.__fc__&&o.__fc__.root===e&&n.ctxs[o.__fc__.id])return i(o.__fc__.loadChildrenPending(),o.__fc__),o.__fc__;var u,c=Be(o),l=function(){return!(!c.field||!n.fieldCtx[c.field]||n.fieldCtx[c.field][0]===o.__fc__)};n.fc.targetFormDriver("loadRule",{rule:c,api:n.api},n.fc),n.ruleEffect(c,"init",{repeat:l()}),l()&&n.vm.emit("repeat-field",o,n.api);var s=!1,f=!!o.__fc__,d=c.value;if(f)if(d=(u=o.__fc__).defaultValue,u.deleted){if(pt(u))return;u.update(n)}else if(!u.check(n)){if(pt(u))return;e[a]=o=o._clone?o._clone():pe(se(o)),u=null,s=!0}if(u)u.originType!==u.rule.type&&u.updateType(),n.bindParser(u),n.appendValue(u.rule),u.parent&&u.parent!==t&&n.rmSubRuleData(u);else{var p=n.parseRule(o);u=new ft(n,p,d),n.bindParser(u)}n.parseEmit(u),n.syncProp(u),u.parent=t||null,u.root=e,n.setCtx(u),s||f||(n.effect(u,"load"),n.targetHook(u,"load")),n.effect(u,"created");var h=u.loadChildrenPending();if(!1===u.parser.loadChildren||i(h,u),!t){var m=r(a);m>-1||!a?n.sort.splice(m+1,0,u.id):n.sort.push(u.id)}var v=u.rule;return u.updated||(u.updated=!0,N.Function(v.update)&&n.bus.$once("load-end",(function(){n.refreshUpdate(u,v.value,"init")})),n.effect(u,"loaded")),n.refreshControl(u)&&(n.cycleLoad=!0),u}})).filter((function(e){return!!e}));t&&(t.children=o)},refreshControl:function(e){return e.input&&e.rule.control&&this.useCtrl(e)},useCtrl:function(e){var n=this,i=function(e){var t=e.rule.control||[];return N.Object(t)?[t]:t}(e),o=[],a=this.api;if(!i.length)return!1;for(var u=function(t){var n=i[t],u=n.handle||function(e){return(Ye[n.condition||"=="]||Ye["=="])(e,n.value)};if(!N.trueArray(n.rule))return"continue";var c=r(r({},n),{},{valid:Me((function(){return u(e.rule.value,a)})),ctrl:dt(e,n.rule),isHidden:N.String(n.rule[0])});if(c.valid&&c.ctrl||!c.valid&&!c.ctrl&&!c.isHidden)return"continue";o.push(c)},c=0;c<i.length;c++)u(c);if(!o.length)return!1;var l=[],s=!1;return this.deferSyncValue((function(){o.reverse().forEach((function(t){var r=t.isHidden,i=t.valid,o=t.rule,u=t.prepend,c=t.append,f=t.child,d=t.ctrl,p=t.method;if(r)return i?e.ctrlRule.push({__ctrl:!0,children:o,valid:i}):d&&e.ctrlRule.splice(e.ctrlRule.indexOf(d)>>>0,1),void l[i?"push":"unshift"]((function(){"disabled"===p||"enabled"===p?n.api.disabled(!i,o):"display"===p||"show"===p?n.api.display(i,o):"required"===p?(o.forEach((function(e){n.api.setEffect(e,"required",i)})),i||n.api.clearValidateState(o)):n.api.hidden(!i,o)}));if(i){s=!0;var h={type:"fragment",native:!0,__ctrl:!0,children:o};e.ctrlRule.push(h),n.bus.$once("load-start",(function(){u?a.prepend(h,u,f):c||f?a.append(h,c||e.id,f):e.root.splice(e.root.indexOf(e.origin)+1,0,h)}))}else{e.ctrlRule.splice(e.ctrlRule.indexOf(d),1);var m=Le(d);m&&m.rm()}}))})),l.length&&(this.loading?l.length&&this.bus.$once("load-end",(function(){l.forEach((function(e){return e()}))})):l.length&&t.nextTick((function(){l.forEach((function(e){return e()}))}))),this.vm.emit("control",e.origin,this.api),this.effect(e,"control"),s},reloadRule:function(e){return this._reloadRule(e)},_reloadRule:function(e){var t=this;e||(e=this.rules);var n=r({},this.ctxs);this.clearNextTick(),this.initData(e),this.fc.rules=e,this.deferSyncValue((function(){t.bus.$once("load-end",(function(){Object.keys(n).filter((function(e){return void 0===t.ctxs[e]})).forEach((function(e){return t.rmCtx(n[e])})),t.$render.clearCacheAll()})),t.reloading=!0,t.loadRule(),t.reloading=!1,t.refresh(),t.bus.$emit("reloading",t.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()}})}(yt),function(e){Q(e.prototype,{setValue:function(e,n,r,i){var o=this;e.deleted||(e.rule.value=n,this.changeStatus=!0,this.nextRefresh(),this.$render.clearCache(e),this.setFormData(e,r),this.syncValue(),this.valueChange(e,n),this.vm.emit("change",e.field,n,e.origin,this.api,i||!1),this.effect(e,"value"),this.targetHook(e,"value",{value:n}),this.emitEvent("change",e.field,n,{rule:e.origin,api:this.api,setFlag:i||!1}),i&&t.nextTick((function(){t.nextTick((function(){t.nextTick((function(){o.api.clearValidateState(e.id)}))}))})),this.$manager.fieldChange(e,n,r,i))},onInput:function(e,t){var n;e.input&&(this.isQuote(e,n=e.parser.toValue(t,e))||this.isChange(e,t))&&this.setValue(e,n,t)},onUpdateValue:function(e,t){var n=this;this.deferSyncValue((function(){var r=e.getParentGroup(),i=r?n.subRuleData[r.id]:null,o={};Object.keys(t||{}).forEach((function(e){i&&B(i,e)?o[e]=t[e]:B(n.api.form,e)?n.api.form[e]=t[e]:n.api.top!==n.api&&B(n.api.top.form,e)&&(n.api.top.form[e]=t[e])})),Object.keys(o).length&&n.api.setChildrenFormData(r.rule,o)}))},onBaseInput:function(e,t){this.setFormData(e,t),e.modelValue=t,this.nextRefresh(),this.$render.clearCache(e)},setFormData:function(e,t){e.modelValue=t;var n=e.getParentGroup();n&&(this.subRuleData[n.id]||(this.subRuleData[n.id]={}),this.subRuleData[n.id][e.field]=e.rule.value),J(this.formData,e.id,t)},rmSubRuleData:function(e){var t=e.getParentGroup();t&&this.subRuleData[t.id]&&delete this.subRuleData[t.id][e.field]},getFormData:function(e){return this.formData[e.id]},syncForm:function(){var e=this,n=t.reactive({}),r=this.fields(),i=[];!1!==this.options.appendValue&&Object.keys(this.appendData).reduce((function(n,i){return-1===r.indexOf(i)&&(n[i]=t.toRef(e.appendData,i)),n}),n),r.reduce((function(n,r){var o=(e.fieldCtx[r]||[]).filter((function(t){return!e.isIgnore(t)}))[0];return o||(o=e.fieldCtx[r][0],i.push(r)),n[r]=t.toRef(o.rule,"value"),n}),n),this.form=n,this.ignoreFields=i,this.syncValue()},isIgnore:function(e){return!0===e.rule.ignore||("hidden"===e.rule.ignore||this.options.ignoreHiddenFields)&&e.hasHidden()},appendValue:function(e){(e.field&&B(this.appendData,e.field)||N.Undef(e.value)&&this.options.forceCoverValue)&&(e.value=this.appendData[e.field],delete this.appendData[e.field])},addSubForm:function(e,t){this.subForm[e.id]=t},deferSyncValue:function(e,t){this.deferSyncFn||(this.deferSyncFn=e),this.deferSyncFn.sync||(this.deferSyncFn.sync=t),Me(e),this.deferSyncFn===e&&(this.deferSyncFn=null,e.sync&&this.syncForm())},syncValue:function(){var e=this;if(this.deferSyncFn)return this.deferSyncFn.sync=!0;var t={};Object.keys(this.form).forEach((function(n){-1===e.ignoreFields.indexOf(n)&&(t[n]=e.form[n])})),this.vm.setupState.updateValue(t)},isChange:function(e,t){return JSON.stringify(this.getFormData(e),ht)!==JSON.stringify(t,ht)},isQuote:function(e,t){return(t instanceof Function||N.Object(t)||Array.isArray(t))&&t===e.rule.value},refreshUpdate:function(e,t,n,r){var i=this;if(N.Function(e.rule.update)){var o=Me((function(){return e.rule.update(t,e.origin,i.api,{origin:n||"change",linkField:r})}));if(void 0===o)return;e.rule.hidden=!0===o}},valueChange:function(e,t){this.refreshRule(e,t),this.bus.$emit("change-"+e.field,t)},refreshRule:function(e,t,n,r){this.refreshControl(e)&&(this.$render.clearCacheAll(),this.loadRule(),this.bus.$emit("update",this.api),this.refresh()),this.refreshUpdate(e,t,n,r)},appendLink:function(e){var t=this,n=e.rule.link;N.trueArray(n)&&n.forEach((function(n){var r=function(){return t.refreshRule(e,e.rule.value,"link",n)};t.bus.$on("change-"+n,r),e.linkOn.push((function(){return t.bus.$off("change-"+n,r)}))}))},fields:function(){return Object.keys(this.fieldCtx)}})}(yt),function(e){Q(e.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,t,n){var r="".concat(n,"Ctx");this[r][t]?this[r][t].push(e):this[r][t]=[e]},rmIdCtx:function(e,t,n){var r="".concat(n,"Ctx"),i=this[r][t];if(!i)return!1;var o=i.splice(i.indexOf(e)>>>0,1).length>0;return i.length||delete this[r][t],o},getFieldCtx:function(e){return(this.fieldCtx[e]||[])[0]},getNameCtx:function(e){return this.nameCtx[e]||[]},setCtx:function(e){var t=e.id,n=e.field,r=e.name,i=e.rule;this.ctxs[t]=e,r&&this.setIdCtx(e,r,"name"),e.input&&(this.setIdCtx(e,n,"field"),this.setFormData(e,e.parser.toFormValue(i.value,e)),this.isMounted&&!this.reloading&&this.vm.emit("change",e.field,i.value,e.origin,this.api,!1,!0))},getParser:function(e){var t=this.fc.parsers,n=this.fc.renderDriver;if(n){var r=n.parsers||{},i=r[e.originType]||r[Fe(e.type)]||r[e.trueType];if(i)return i}return t[e.originType]||t[Fe(e.type)]||t[e.trueType]||mt},bindParser:function(e){e.setParser(this.getParser(e))},getType:function(e){var t=this.fc.CreateNode.aliasMap,n=t[e]||t[Fe(e)]||e;return Fe(n)},noWatch:function(e){this.noWatchFn||(this.noWatchFn=e),Me(e),this.noWatchFn===e&&(this.noWatchFn=null)},watchCtx:function(e){var n=this;if(Ee().filter((function(e){return"_"!==e[0]&&"$"!==e[0]&&-1===vt.indexOf(e)})).forEach((function(r){var i=t.toRef(e.rule,r),o="children"===r;e.refRule[r]=i,e.watch.push(t.watch(o?function(){return N.Function(i.value)?i.value:d(i.value||[])}:function(){return i.value},(function(a,u){var c=i.value;if(!n.isBreakWatch()){if(o&&!1===e.parser.loadChildren)return n.$render.clearCache(e),void n.nextRefresh();if(n.watching=!0,t.nextTick((function(){n.targetHook(e,"watch",{key:r,oldValue:u,newValue:c})})),"hidden"===r&&Boolean(c)!==Boolean(u)&&(n.$render.clearCacheAll(),t.nextTick((function(){n.targetHook(e,"hidden",{value:c})}))),"ignore"===r&&e.input||"hidden"===r&&("hidden"===e.rule.ignore||n.options.ignoreHiddenFields))n.syncForm();else{if("link"===r)return void e.link();["props","on","deep"].indexOf(r)>-1?(n.parseInjectEvent(e.rule,c||{}),"props"===r&&e.input&&n.setFormData(e,e.parser.toFormValue(e.rule.value,e))):"emit"===r?n.parseEmit(e):["prefix","suffix"].indexOf(r)>-1?c&&n.loadFn(c,e.rule):"type"===r?(e.updateType(),n.bindParser(e)):o&&(N.Function(u)&&(u=e.getPending("children",[])),N.Function(c)&&(c=e.loadChildrenPending()),n.updateChildren(e,c,u))}n.$render.clearCache(e),n.refresh(),n.watching=!1}}),{deep:!o,sync:o}))})),e.refRule.__$title=t.computed((function(){var t=("object"===i(e.rule.title)?e.rule.title.title:e.rule.title)||"";if(t){var r=t.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);r&&(t=n.api.t(r[1]))}return t})),e.refRule.__$info=t.computed((function(){var t=("object"===i(e.rule.info)?e.rule.info.info:e.rule.info)||"";if(t){var r=t.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);r&&(t=n.api.t(r[1]))}return t})),e.refRule.__$validate=t.computed((function(){var t=function(t){var r,i,o=t.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);return o?n.api.t(o[1],{title:null===(r=e.refRule)||void 0===r||null===(i=r.__$title)||void 0===i?void 0:i.value}):t};return v(e.rule.validate).map((function(o){var a=r({},o);if(a.message&&(a.message=t(a.message)),N.Function(a.validator)){var u=e;a.validator=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=o.validator).call.apply(e,[{that:this,id:u.id,field:u.field,rule:u.rule,api:u.$handle.api}].concat(n))}}if(a.adapter){if("object"===i(a.error)){var c=r({},a.error);Object.keys(c).forEach((function(e){c[e]=t(c[e])})),a.error=c}return n.adapterValidate(a,e)}return a}))})),e.input){var o=t.toRef(e.rule,"value");e.watch.push(t.watch((function(){return o.value}),(function(){var t=e.parser.toFormValue(o.value,e);n.isChange(e,t)&&n.setValue(e,o.value,t,!0)})))}this.bus.$once("load-end",(function(){var r=e.rule.computed;r&&("object"!==i(r)&&(r={value:r}),Object.keys(r).forEach((function(i){var o=t.computed((function(){var t=r[i];if(t){var o=n.compute(e,t);return(t.linkage||t.linkageVariable)&&o===gt?gt:o}})),a=function(t){"value"===i?n.onInput(e,t):"$"===i[0]?n.api.setEffect(e.id,i,t):ve(e.rule,i,t)};("value"===i?[void 0,null,""].indexOf(e.rule.value)>-1:o.value!==Ge(e.rule,i))&&a(o.value),e.watch.push(t.watch(o,(function(e){e!==gt&&setTimeout((function(){a(e)}))}),{deep:!0}))})))})),this.watchEffect(e)},adapterValidate:function(e,t){var n=this;return this.$manager.adapterValidate({required:e.required,message:e.message,trigger:e.trigger},(function(r,o){if(!1===(e.beforeValidate&&Me((function(){return e.beforeValidate({value:r,api:n.api,validate:e,rule:t.rule})}))))o();else{var a=n.validator(t,r,e);if(a){var u="";"object"===i(e.error)&&(u=e.error[a]||e.error.default),u||"string"!=typeof e.message||(u=e.message),u||(u=n.getValidateMessage(t,{key:a,rule:e[a]})),o(u)}else if(e.validator){var c=e.validator&&Me((function(){return e.validator(r,o)}));c&&N.Function(c.then)&&c.then((function(){return o()})).catch((function(e){return o(e)}))}else o()}}))},getValidateMessage:function(e,t){var n,r,i,o=Array.isArray(t.rule)?t.rule.join(","):""+t.rule;return this.api.t("required"===t.key?t.key:"validate."+t.key,(a(i={},t.key,o),a(i,"title",null===(n=e.refRule)||void 0===n||null===(r=n.__$title)||void 0===r?void 0:r.value),i))},validator:function(e,t,n){var r=this;if(N.empty(t))return n.required?"required":void 0;for(var o=function(){var n=f(u[a],2),o=n[0],c=n[1];switch(o){case"len":case"maxLen":case"minLen":var l=function(e){return"len"===o?e===c:"maxLen"===o?e<=c:e>=c};if(Array.isArray(t)){if(!l(t.length))return{v:o}}else{if("object"===i(t))return{v:o};if(!l((""+t).length))return{v:o}}break;case"pattern":if(!("string"==typeof c?new RegExp(c):c).test(""+t))return{v:o};break;case"uppercase":if(c&&("string"!=typeof t||!/^[A-Z]*$/.test(t)))return{v:o};break;case"lowercase":if(c&&("string"!=typeof t||!/^[a-z]*$/.test(t)))return{v:o};break;case"min":case"max":case"positive":case"negative":case"integer":case"number":var s=Number(t);if(Number.isNaN(s))return{v:o};if("min"===o&&s<c)return{v:o};if("max"===o&&s>c)return{v:o};if("positive"===o&&s<=0)return{v:o};if("negative"===o&&s>=0)return{v:o};if("integer"===o&&!Number.isInteger(s))return{v:o};break;case"equal":if(t!==c)return{v:o};break;case"enum":if(Array.isArray(c)&&!c.includes(t))return{v:o};break;case"hasKeys":if("object"!==i(t)||Array.isArray(c)&&c.some((function(e){return!(e in t)})))return{v:o};break;case"email":if(!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(""+t))return{v:o};break;case"url":if(!new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i").test(""+t))return{v:o};break;case"ip":if(!/^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/.test(""+t))return{v:o};break;case"phone":if(!/^(?:(?:\+|00)86)?1[3-9]\d{9}$/.test(""+t))return{v:o};break;case"computed":if(!r.compute(e,c))return{v:o}}},a=0,u=Object.entries(n);a<u.length;a++){var c=o();if("object"===i(c))return c.v}},compute:function(e,t){var n,r=this;if("object"===i(t)){var o=e.getParentGroup(),a=function t(n){if(n=Array.isArray(n)?{mode:"AND",group:n}:n,!N.trueArray(n.group))return!0;for(var a="OR"===n.mode,u=!0,c=function(i){var c=n.group[i],l=void 0,s=null,f=null;if(c.variable)f=r.fc.getLoadData(c.variable);else if(c.field)s=Je(c.field||"");else if(!c.mode)return{v:!0};var d=c.compare;if(d&&(d=Je(d||"")),l=c.mode?t(c):!!Ye[c.condition]&&(N.Function(c.handler)?Me((function(){return c.handler(r.api,e.rule)})):Me((function(){return new Function("$condition","$variableVal","$val","$form","$scope","$group","$rule","with($form){with($scope){with(this){with($group){ return $condition['".concat(c.condition,"'](").concat(c.variable?"$variableVal":s,", ").concat(d||"$val","); }}}}")).call(r.api.form,Ye,f,c.value,r.api.top.form,r.api.top===r.api.scope?{}:r.api.scope.form,o&&r.subRuleData[o.id]||{},e.rule)}))),a&&l)return{v:!0};a||(u=u&&l)},l=0;l<n.group.length;l++){var s=c(l);if("object"===i(s))return s.v}return!a&&u}(t);return a=!0===t.invert?!a:a,t.linkage?a?Me((function(){return r.computeValue(t.linkage,e,o)}),void 0):gt:t.linkageVariable?a?Me((function(){return r.fc.getLoadData(t.linkageVariable)}),void 0):gt:a}if(N.Function(t))n=function(){return t(r.api.form,r.api,e.rule)};else{var u=e.getParentGroup();n=function(){return r.computeValue(t,e,u)}}return Me(n,void 0)},computeValue:function(e,t,n){var r=this,i=this,o=Object.keys(this.fc.formulas).reduce((function(e,n){return e[n]=function(){for(var e,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(e=i.fc.formulas[n]).call.apply(e,[{that:this,rule:t.rule,api:i.api,fc:i.fc}].concat(o))},e}),{});return Me((function(){return new Function("$formulas","$form","$scope","$group","$rule","$api","with($form){with($scope){with(this){with($group){with($formulas){ return ".concat(e," }}}}}")).call(r.api.form,o,r.api.top.form,r.api.top===r.api.scope?{}:r.api.scope.form,n&&r.subRuleData[n.id]||{},t.rule,r.api)}),void 0)},updateChildren:function(e,t,n){var r=this;this.deferSyncValue((function(){n&&n.forEach((function(n){-1===(t||[]).indexOf(n)&&n&&!N.String(n)&&n.__fc__&&n.__fc__.parent===e&&r.rmCtx(n.__fc__)})),N.trueArray(t)&&(r.loadChildren(t,e),r.bus.$emit("update",r.api))}))},rmSub:function(e){var t=this;N.trueArray(e)&&e.forEach((function(e){e&&e.__fc__&&t.rmCtx(e.__fc__)}))},rmCtx:function(e){var t=this;if(!e.deleted){var n=e.id,r=e.field,i=e.input,o=e.name;W(this.ctxs,n),W(this.formData,n),W(this.subForm,n),W(this.vm.setupState.ctxInject,n);var a=e.getParentGroup();a&&this.subRuleData[a.id]&&W(this.subRuleData[a.id],r),e.group&&W(this.subRuleData,n),i&&this.rmIdCtx(e,r,"field"),o&&this.rmIdCtx(e,o,"name"),i&&!B(this.fieldCtx,r)&&W(this.form,r),this.deferSyncValue((function(){if(!t.reloading){if(!1!==e.parser.loadChildren){var n=e.getPending("children",e.rule.children);N.trueArray(n)&&n.forEach((function(e){return e&&e.__fc__&&t.rmCtx(e.__fc__)}))}e.root===t.rules&&t.vm.setupState.renderRule()}}),i);var u=this.sort.indexOf(n);return u>-1&&this.sort.splice(u,1),this.$render.clearCache(e),e.delete(),this.effect(e,"deleted"),this.targetHook(e,"deleted"),i&&!this.fieldCtx[r]&&this.vm.emit("remove-field",r,e.rule,this.api),e.rule.__ctrl||this.vm.emit("remove-rule",e.rule,this.api),e}}})}(yt),function(e){Q(e.prototype,{mounted:function(){var e=this,t=function(){e.isMounted=!0,e.lifecycle("mounted")};this.pageEnd?t():this.bus.$once("page-end",t)},lifecycle:function(e){this.fc.targetFormDriver(e,this.api,this.fc),this.vm.emit(e,this.api),this.emitEvent(e,this.api)},emitEvent:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=this.options[e]||this.options[Fe("on-"+e)];if(o){var a=de(o);N.Function(a)&&Me((function(){return a.apply(void 0,r)}))}(t=this.bus).$emit.apply(t,[e].concat(r))},targetHook:function(e,t,n){var i,o,a=this,u=function(t,i){t&&(t=Array.isArray(t)?t:[t]).forEach((function(t){Me((function(){return t(r(r({args:Object.values(n||{})},n||{}),{},{self:e.rule,rule:e.rule,parent:null==i?void 0:i.rule,$f:a.api,api:a.api,option:a.vm.props.option}))}))}))};u(null===(i=e.prop)||void 0===i||null===(o=i.hook)||void 0===o?void 0:o[t]);for(var c="deep"+oe(t),l=e.parent;l;){var s,f;u(null===(s=l.prop)||void 0===s||null===(f=s.hook)||void 0===f?void 0:f[c],l),l=l.parent}}})}(yt),function(e){Q(e.prototype,{useProvider:function(){var e=this,t=this.fc.providers;Object.keys(t).forEach((function(n){var r=t[n];N.Function(r)&&(r=r(e.fc)),r._c=function(e){var t=e.components;if(Array.isArray(t)){var n=function(e){return e.filter((function(e,t,n){return n.indexOf(e,0)===t}))}(t.filter((function(e){return"*"!==e})));return!!n.length&&n}return!!N.String(t)&&[t]}(r),e.onEffect(r,n),e.providers[n]=r}))},onEffect:function(e,t){var n=this,r=[];(e._c||["*"]).forEach((function(i){var o="*"===i?"*":n.getType(i);r.indexOf(o)>-1||(r.push(o),n.bus.$on("p:".concat(t||e.name,":").concat(o,":").concat(e.input?1:0),(function(t,n){e[t]&&e[t].apply(e,d(n))})))})),e._used=r},watchEffect:function(e){var n=this,r={required:function(){var t,n;return(B(e.rule,"$required")?e.rule.$required:null===(t=e.rule)||void 0===t||null===(n=t.effect)||void 0===n?void 0:n.required)||!1}};Object.keys(e.rule.effect||{}).forEach((function(t){r[t]=function(){return e.rule.effect[t]}})),Object.keys(e.rule).forEach((function(t){"$"===t[0]&&(r[t.substr(1)]=function(){return e.rule[t]})})),Object.keys(r).forEach((function(i){e.watch.push(t.watch(r[i],(function(t){n.effect(e,"watch",a({},i,t))}),{deep:!0}))}))},ruleEffect:function(e,t,n){this.emitEffect({rule:e,input:!!e.field,type:this.getType(e.type)},t,n)},effect:function(e,t,n){this.emitEffect({rule:e.rule,input:e.input,type:e.trueType,ctx:e,custom:n},t)},getEffect:function(e,t){return B(e,"$"+t)?e["$"+t]:B(e,"effect")&&B(e.effect,t)?e.effect[t]:void 0},emitEffect:function(e,t,n){var i=this,o=e.ctx,a=e.rule,u=e.input,c=e.type,l=e.custom;if(c&&!(["fcFragment","fragment"].indexOf(c)>-1)){var s=l||Object.keys(a).reduce((function(e,t){return"$"===t[0]&&(e[t.substr(1)]=a[t]),e}),r({},a.effect||{}));Object.keys(s).forEach((function(e){var l=i.providers[e];if(l&&(!l.input||u)){var f;if(l._c){if(!(l._used.indexOf(c)>-1))return;f=c}else f="*";var d=r({value:s[e],getValue:function(){return i.getEffect(a,e)}},n||{});o&&(d.getProp=function(){return o.effectData(e)},d.clearProp=function(){return o.clearEffectData(e)},d.mergeProp=function(e){return Ne(d.getProp(),[e])},d.id=o.id),i.bus.$emit("p:".concat(e,":").concat(f,":").concat(l.input?1:0),t,[d,a,i.api])}}))}}})}(yt);var bt=t.defineComponent({name:"fcFragment",inheritAttrs:!1,props:["vnode"],render:function(){return this.vnode}});function _t(e,n){var r=e.directives;return r?(Array.isArray(r)||(r=[r]),t.withDirectives(n,r.reduce((function(e,n){return e.concat(function(e){return Object.keys(e).map((function(n){var r=e[n],i=t.resolveDirective(n);if(i)return[i,r.value,r.arg,r.modifiers]})).filter((function(e){return!!e}))}(n))}),[]))):n}function xt(e){var t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(n,e);var t=s(n);function n(){return o(this,n),t.apply(this,arguments)}return n}(wt);return Object.assign(t.prototype,e),t}function wt(e){Q(this,{$handle:e,vm:e.vm,options:{},ref:"fcForm",mergeOptionsRule:{normal:["form","row","info","submitBtn","resetBtn"]}}),this.updateKey(),this.init()}Q(wt.prototype,{__init:function(){var e=this;this.$render=this.$handle.$render,this.$r=function(){var t;return(t=e.$render).renderRule.apply(t,arguments)}},updateKey:function(){this.key=me()},init:function(){},update:function(){},beforeRender:function(){},form:function(){return this.vm.refs[this.ref]},adapterValidate:function(e,t){return e.validator=function(e,n,r){return t(n,r)},e},getSlot:function(e){return function t(n){if(n){var r=n.slots[e];return r||t(n.setupState.parent)}}(this.vm)},mergeOptions:function(e,t){var n=this;return Ve(e.map((function(e){return n.tidyOptions(e)})),t,this.mergeOptionsRule)},updateOptions:function(e){this.$handle.fc.targetFormDriver("updateOptions",e,{handle:this.$handle,api:this.$handle.api}),this.options=this.mergeOptions([e],this.getDefaultOptions()),this.update()},tidyOptions:function(e){return e},tidyRule:function(e){},mergeProp:function(e){},getDefaultOptions:function(){return{}},fieldChange:function(e,t,n,r){},render:function(e){}});var kt={name:"componentValidate",load:function(e,t,n){var i=e.getValue();if(i&&!1!==i.method){N.Object(i)||(i={method:i});var o=i.method,a=r(r({},i),{},{validator:function(){var r=Le(t);if(r){for(var i=arguments.length,a=new Array(i),u=0;u<i;u++)a[u]=arguments[u];return n.exec.apply(n,[r.id,N.String(o)?o:"formCreateValidate"].concat(a,[{attr:e,rule:t,api:n}]))}}});delete a.method,e.getProp().validate=[a]}else e.clearProp(),n.clearValidateState([t.field])},watch:function(){kt.load.apply(kt,arguments)}},$t={fetch:function(e){function t(t,i,o){var a=t.value;n.deleted(t),N.Function(a)&&(a=a(i,o)),a=function(e){return N.String(e)&&(e={action:e,to:"options"}),e}(a);var u=function(n){void 0===n?t.clearProp():ve(t.getProp(),a.to||"options",n),null!=n&&a&&a.key&&e.$handle.options.globalData[a.key]&&e.fetchCache.set(e.$handle.options.globalData[a.key],{status:!0,data:n}),o.sync(i)};if(a&&(a.action||a.key)){(a=X(a)).to||(a.to="options");var c=a.onError,l=function(){if(!t.getValue())return t.clearProp(),o.sync(i),!0};n._fn[t.id]=e.watchLoadData(te((function(s,f){if(f&&!1===a.watch)return n._fn[t.id]();if(a.key){e.targetRule=i;var d=s("$globalData."+a.key);if(delete e.targetRule,d){if(l())return;u(d)}}else{var p=e.$handle.loadFetchVar(X(a),s,i),h=r(r({headers:{}},p),{},{onSuccess:function(e,t){if(!l()){var n=function(e){return t?e:B(e,"data")?e.data:e},r=de(p.parse);N.Function(r)?n=r:r&&N.String(r)&&(n=function(e){return Ge(e,r)}),re(n(e,i,o)).then((function(e){u(e)}))}},onError:function(e){u(void 0),l()||(c||function(e){return ue(e.message||"fetch fail "+p.action)})(e,i,o)}});e.$handle.beforeFetch(h,{rule:i,api:o}).then((function(){N.Function(p.action)?re(p.action(i,o)).then((function(e){h.onSuccess(e,!0)})).catch((function(e){h.onError(e)})):Me((function(){return e.create.fetch(h,{inject:t,rule:i,api:o})}))})).catch((function(e){}))}}),a.wait||600))}else u(void 0)}var n={name:"fetch",_fn:[],loaded:function(){t.apply(void 0,arguments)},watch:function(){t.apply(void 0,arguments)},deleted:function(e){this._fn[e.id]&&(this._fn[e.id](),delete this._fn[e.id]),e.clearProp()}};return n},loadData:function(e){var n={name:"loadData",_fn:[],loaded:function(n,r,i){var o=this;this.deleted(n),t.nextTick((function(){var t=v(n.getValue()),a=[];t.forEach((function(t){if(t&&(t.attr||t.template)){var o=function(o){var a,u;r&&r.__fc__&&(a=r.__fc__.getParentGroup()),null!=(u=t.template?e.$handle.loadStrVar(t.template,o,a?{rule:r,value:e.$handle.subRuleData[a.id]||{}}:null):t.handler&&N.Function(t.handler)?t.handler(o,r,i):e.$handle.loadStrVar("{{".concat(t.attr,"}}"),o,a?{rule:r,value:e.$handle.subRuleData[a.id]||{}}:null))&&""!==u||null==t.default||(u=t.default),!1!==t.copy&&(u=X(u));var c=t.modify?r:n.getProp();"child"===t.to?c.children?c.children[0]=u:c.children=[u]:ve(c,t.to||"options",u),i.sync(r)},u=e.watchLoadData((function(e){return o(e)}));o=te(o,t.wait||300),!1!==t.watch?a.push(u):u()}})),o._fn[n.id]=a}))},deleted:function(e){this._fn[e.id]&&(this._fn[e.id].forEach((function(e){e()})),delete this._fn[e.id]),e.clearProp()}};return n.watch=n.loaded,n},t:function(e){var t={name:"t",_fn:[],loaded:function(t,n,r){this.deleted(t);var o=t.getValue()||{},a=[];Object.keys(o).forEach((function(u){var c=o[u];if(c){var l="object"===i(c),s=function(i){var o=e.t(l?c.attr:c,l?c.params:null,i),a=l&&c.modify?n:t.getProp();"child"===u?a.children?a.children[0]=o:a.children=[o]:ve(a,u,o),r.sync(n)},f=e.watchLoadData((function(e){return s(e)}));s=te(s,c.wait||300),!1!==c.watch?a.push(f):f()}})),this._fn[t.id]=a},deleted:function(e){this._fn[e.id]&&(this._fn[e.id].forEach((function(e){e()})),delete this._fn[e.id]),e.clearProp()}};return t.watch=t.loaded,t},componentValidate:kt},Ct={name:"html",loadChildren:!1,render:function(e,t){return t.prop.props.innerHTML=e.default(),t.vNode.make(t.prop.props.tag||"div",t.prop)},renderChildren:function(e){return{default:function(){return e.filter((function(e){return N.String(e)})).join("")}}}};function Vt(e){e+="=";for(var t=decodeURIComponent(document.cookie).split(";"),n=0;n<t.length;n++){for(var r=t[n];" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(e)){r=r.substring(e.length,r.length);try{return JSON.parse(r)}catch(e){return r}}}return null}function Ot(e){var t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return t}return null}function St(e){var t=sessionStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return t}return null}function Rt(e,t){if(!t)return null;var n=t.split("."),r=e(n.shift());return n.length?null==r?null:Ge(r,n):r}function jt(e){return Rt(Vt,e)}function Et(e){return Rt(Ot,e)}function Ft(e){return Rt(St,e)}var Dt={en:{required:"{title} is required",validate:{url:"{title} is not a valid url",email:"{title} is not a valid email",ip:"{title} {title} is not a valid ip",phone:"{title} {title} is not a valid phone",pattern:"{title} does not match pattern {pattern}",uppercase:"{title} must be all uppercase",lowercase:"{title} must be all lowercased",positive:"{title} is not a positive number",negative:"{title} is not a negative number",equal:"{title} is not equal to {equal}",min:"{title} cannot be less than {min}",max:"{title} cannot be greater than {max}",enum:"{title} must be one of {enum}",hasKeys:"{title} does not contain required fields {hasKeys}",minLen:"{title} must be at least {minLen}",maxLen:"{title} cannot be longer than {maxLen}",len:"{title} must be exactly {len}",integer:"{title} is not an integer",number:"{title} is not an number"}},"zh-cn":{required:"{title}不能为空",validate:{url:"{title}不是有效的 url 地址",email:"{title}不是有效的邮箱地址",ip:"{title}不是有效的 IP 地址",phone:"{title}不是正确的手机号",pattern:"{title}必须匹配 {pattern}",uppercase:"{title}必须全大写",lowercase:"{title}必须全小写",positive:"{title}不是正数",negative:"{title}不是负数",equal:"{title}必须等于 {equal}",min:"{title}必须大于等于 {min}",max:"{title}必须小于等于 {max}",enum:"{title}必须是 {enum} 之一",hasKeys:"{title}必须包含 {hasKeys} 字段",minLen:"{title}长度必须大于 {minLen}",maxLen:"{title}长度必须小于 {maxLen}",len:"{title}长度必须为 {len}",integer:"{title}必须为整数",number:"{title}必须为数字"}}};function At(e,t){var n;return 2===arguments.length?t=(n=arguments[1])[e]:n=arguments[2],{id:t,prop:n}}function Pt(){return At.apply(void 0,["name"].concat(Array.prototype.slice.call(arguments)))}var It=1,Nt={},Bt=Symbol("defValue");function Tt(e){var n,o=a({},bt.name,bt),u={},c={},l={},s={},f=[],p=[],h=[e.extendApi],m=r({},$t),v=rt(),g={global:{}},b=!0===e.isMobile,_=t.reactive({$mobile:b}),x=function(){var e={};function n(e){this.vm=e.vm,this.handle=e}return Q(n.prototype,{make:function(e,t,n){return _t(t,this.h(e,qe(t),n))},makeComponent:function(e,n,r){try{return _t(n,t.createVNode(e,qe(n),r))}catch(e){return console.error(e),t.createVNode("")}},h:function(e,n,r){var i=(this.vm||t.getCurrentInstance()).appContext.config.isNativeTag(e),o=this.handle.fc.prop.components[e];!o&&i&&delete n.formCreateInject;try{return t.createVNode(o||(i?e:t.resolveComponent(e)),n,r)}catch(e){return console.error(e),t.createVNode("")}},aliasMap:e}),Q(n,{aliasMap:e,alias:function(t,n){e[t]=n},use:function(t){Object.keys(t).forEach((function(r){var i=ie(r),o=ne(r).toLocaleLowerCase(),a=t[r];n.alias(r,a),[r,i,o].forEach((function(t){n.prototype[t]=function(n,i){return this.make(e[r]||t,n,i)}}))}))}}),n}(),w={},k={};function $(e){var t=Nt[e];return Array.isArray(t)?t.map((function(e){return e.api()})):t?t.api():void 0}function C(e){f.push(e)}function V(){var e=Pt.apply(void 0,arguments);e.id&&e.prop&&(c[e.id]=e.prop)}function O(){var e=Pt.apply(void 0,arguments);e.id&&e.prop&&(m[e.id]=N.Function(e.prop)?e.prop:r(r({},e.prop),{},{name:e.id}))}function S(e){x.use(e)}function R(e){if(0===arguments.length)return mt;if("string"==typeof e&&1===arguments.length)return u[Fe(e)];var t=Pt.apply(void 0,arguments);if(!t.id||!t.prop)return mt;var n=Fe(t.id),r=t.prop,i=!0===r.merge?u[n]:void 0;u[n]=He(r,i||mt),v[n]=Ze(n),r.maker&&Q(v,r.maker)}function j(e,t){var n;if(N.String(e)){if(n=e,void 0===t)return o[n]}else n=e.displayName||e.name,t=e;if(n&&t){var r=Fe(n);o[n]=t,o[r]=t,delete x.aliasMap[n],delete x.aliasMap[r],delete u[n],delete u[r],t.formCreateParser&&R(n,t.formCreateParser)}}function E(){return Xe(J,o,c)}function F(){return bt}function D(e,t){return N.Function(e.install)?e.install(A,t):N.Function(e)&&e(A,t),this}function A(e,n){var i=function(e,n){var i=E();return t.createApp({data:function(){return t.reactive({rule:e,option:n})},render:function(){return t.h(i,r({ref:"fc"},this.$data))}})}(e,n||{});f.forEach((function(e){Me((function(){return e(A,i)}))}));var o=document.createElement("div");return((null==n?void 0:n.el)||document.body).appendChild(o),i.mount(o).$refs.fc.fapi}function P(t){var n=r({},e);return t?n.inherit={components:o,parsers:u,directives:c,modelFields:l,providers:m,useApps:f,maker:v,formulas:w,loadData:_}:delete n.inherit,Tt(n)}function I(e,t){l[e]=t}function T(e,t){w[e]=t}function L(e,t){var n=s[e]||{},i=n.parsers||{};t.parsers&&Object.keys(t.parsers).forEach((function(e){i[e]=He(t.parsers[e],mt)})),t.name=e,s[e]=r(r(r({},n),t),{},{parsers:i})}function M(e){e&&Object.keys(Nt).forEach((function(t){(Array.isArray(Nt[t])?Nt[t]:[Nt[t]]).forEach((function(t){t.bus.$emit("$loadData."+e)}))}))}function U(e,t){ve(_,e,t),M(e)}function q(e,t){var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Me((function(){return t.apply(void 0,n)}))};n._driver=!0,U(e,n)}function H(e,t){var n=(e||"").split(".");e=n.shift();var r=n.join(".");if(B(_,e)||(_[e]=Bt),_[e]!==Bt){var i=_[e];return i&&i._driver?i=i(r):n.length&&(i=Ge(i,n)),null==i||""===i?t:i}return t}function z(e){h.push(e)}function Y(e){delete _[e],M(e)}function G(e,t){p.push({name:e,callback:t})}function J(n){var r=this;Q(this,{id:It++,create:A,vm:n,manager:xt(e.manager),parsers:u,providers:m,modelFields:l,formulas:w,isMobile:b,rules:n.props.rule,name:n.props.name||me(),inFor:n.props.inFor,prop:{components:o,directives:c},get:null,drivers:s,renderDriver:null,refreshData:M,loadData:_,CreateNode:x,bus:new y,unwatch:[],options:t.ref({}),extendApiFn:h,fetchCache:new WeakMap,tmpData:t.reactive({})}),p.forEach((function(e){r.bus.$on(e.name,e.callback)})),t.nextTick((function(){t.watch(r.options,(function(){r.$handle.$manager.updateOptions(r.options.value),r.api().refresh()}),{deep:!0})})),Q(n.appContext.components,o),Q(n.appContext.directives,c),this.$handle=new yt(this),this.name&&(this.inFor?(Nt[this.name]||(Nt[this.name]=[]),Nt[this.name].push(this)):Nt[this.name]=this)}function W(t){Q(t,{version:e.version,ui:e.ui,isMobile:b,extendApi:z,getData:H,setDataDriver:q,setData:U,removeData:Y,refreshData:M,maker:v,component:j,directive:V,setModelField:I,setFormula:T,setDriver:L,register:O,$vnode:F,parser:R,use:D,factory:P,componentAlias:S,copyRule:Pe,copyRules:Ie,mergeRule:Ne,fetch:ot,$form:E,parseFn:de,parseJson:pe,toJson:se,useApp:C,getApi:$,on:G})}if(function(e){var t=e.key||[],n=e.array||[],r=e.normal||[];Se.push.apply(Se,d(t)),Re.push.apply(Re,d(n)),je.push.apply(je,d(r)),et([].concat(d(t),d(n),d(r)))}(e.attrs||{}),He(A,k),J.isMobile=b,Q(J.prototype,{init:function(){var e=this;this.isSub()&&this.unwatch.push(t.watch((function(){return e.vm.setupState.parent.setupState.fc.options.value}),(function(){e.initOptions(),e.$handle.api.refresh()}),{deep:!0,flush:"sync"})),this.vm.props.driver&&(this.renderDriver="object"===i(this.vm.props.driver)?this.vm.props.driver:this.drivers[this.vm.props.driver]),!this.renderDriver&&this.vm.setupState.parent&&(this.renderDriver=this.vm.setupState.parent.setupState.fc.renderDriver),this.renderDriver||(this.renderDriver=this.drivers.default),this.initOptions(),this.$handle.init()},targetFormDriver:function(e){for(var t,n=this,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if((t=this.bus).$emit.apply(t,[e].concat(i)),this.renderDriver&&this.renderDriver[e])return Me((function(){var t;return(t=n.renderDriver)[e].apply(t,i)}))},t:function(e,t,n){var r=n?n("$t."+e):this.globalLanguageDriver(e);return null==r&&(r=""),r&&t&&Object.keys(t).forEach((function(e){var n=new RegExp("{".concat(e,"}"),"g");r=r.replace(n,t[e])})),r},globalDataDriver:function(e){var t=this,n=e.split("."),r=n.shift(),i=this.options.value.globalData&&this.options.value.globalData[r];if(i){if("static"===i.type)return Ge(i.data,n);var o,a=this.fetchCache.get(i);if(a){if(a.status&&(o=Ge(a.data,n)),!a.loading)return o;a.loading=!1,this.fetchCache.set(i,a)}else this.fetchCache.set(i,{status:!1});var u=te((function(){l();var e=t.fetchCache.get(i);t.options.value.globalData&&-1!==Object.values(t.options.value.globalData).indexOf(i)?(e&&(e.loading=!0,t.fetchCache.set(i,e)),t.bus.$emit("$loadData.$globalData."+r)):t.fetchCache.delete(i)}),i.wait||600),c=function(e){t.fetchCache.set(i,{status:!0,data:e}),t.bus.$emit("$loadData.$globalData."+r)},l=this.watchLoadData((function(e,n){if(n&&!1===i.watch)return l();if(n)u();else{var r=t.$handle.loadFetchVar(ee(i),e);r.targetRule=t.targetRule,t.$handle.api.fetch(r).then((function(e){c(e)})).catch((function(e){c(null)}))}}));return!1===i.watch&&l(),this.unwatch.push(l),o}},getLocale:function(){var e=this.vm.setupState.top.props.locale;return e&&"object"===i(e)?e.name:"string"==typeof e?e:"zh-cn"},globalLanguageDriver:function(e){var t=this.vm.setupState.top.props.t,n=this.vm.setupState.top.props.locale,r=void 0;if(t&&(r=Me((function(){return t(e)}))),null==r&&n&&"object"===i(n)&&(r=Ge(n,e)),null==r){var o=this.options.value.language||{},a=this.getLocale();null==(r=Ge(o[a]||{},e))&&(r=Ge(Dt[a]||{},e))}return r},globalVarDriver:function(e){var t=this,n=e.split("."),r=n.shift(),i=this.options.value.globalVariable&&this.options.value.globalVariable[r];if(i){var o=N.Function(i)?i:de(i.handle);if(o){var a=o((function(){var e;return(e=t.$handle.api).getData.apply(e,arguments)}),this.$handle.api);return Ge(a,n)}}},setData:function(e,t,n){n?U(e,t):(ve(this.vm.setupState.top.setupState.fc.tmpData,e,t),this.bus.$emit("$loadData."+e))},getLoadData:function(e,t){var n=null;if(null!=e){var r=e.split("."),i=r.shift();if(null!=(n=Ge(this.vm.setupState.top.setupState.fc.tmpData,e)))return n;if("$topForm"===i)n=this.$handle.api.top.formData(!0);else if("$scopeForm"===i)n=this.$handle.api.scope.formData(!0);else if("$form"===i)n=this.$handle.api.formData(!0);else if("$options"===i)n=this.options.value;else if("$globalData"===i)n=this.globalDataDriver(r.join(".")),r=[];else if("$var"===i)n=this.globalVarDriver(r.join(".")),r=[];else if("$locale"===i)n=this.getLocale(),r=[];else if("$t"===i)n=this.globalLanguageDriver(r.join(".")),r=[];else{if("$preview"===i)return this.$handle.preview;n=H(e),r=[]}n&&r.length&&(n=Ge(n,r))}return null==n||""===n?t:n},watchLoadData:function(e,n){var r=this,o={},a=function(t){r.get||(r.get=u),Me((function(){e(u,t)})),r.get===u&&(r.get=void 0)},u=function(e,u){var c;if("object"===i(e)&&(c=e.getValue,e=e.id),o[e])return o[e].val;var l=t.computed((function(){return c?c():r.getLoadData(e,u)})),s=e.split("."),f=s.shift(),d=s.shift()||"",p=te((function(){var t=c?c():r.getLoadData(e,u);o[e]&&((t instanceof Function||N.Object(t)||Array.isArray(t))&&t===o[e].val||JSON.stringify(t)!==JSON.stringify(o[e].val))&&(o[e].val=t,a(!0))}),n||0),h=t.watch(l,(function(e){p()}));return r.bus.$on("$loadData."+f,p),d&&r.bus.$on("$loadData."+f+"."+d,p),o[e]={fn:function(){r.bus.$off("$loadData."+f,p),d&&r.bus.$off("$loadData."+f+"."+d,p),h()},val:l.value},l.value};a(!1);var c=function(){Object.keys(o).forEach((function(e){return o[e].fn()})),o={}};return this.unwatch.push(c),c},isSub:function(){return this.vm.setupState.parent&&this.vm.props.extendOption},initOptions:function(){this.options.value={};var e=r({formData:{},submitBtn:{},resetBtn:{},globalEvent:{},globalData:{}},X(g)),t=this.isSub();t&&(e=this.mergeOptions(e,this.vm.setupState.parent.setupState.fc.options.value||{},!0)),e=this.mergeOptions(e,this.vm.props.option);var n=this.api();this.targetFormDriver("initOptions",e,{api:n,isSubForm:t}),this.updateOptions(e)},mergeOptions:function(e,t,n){return t=r({},t||{}),n&&["page","onSubmit","onReset","onCreated","onChange","onMounted","mounted","onReload","reload","formData","el","globalClass","style"].forEach((function(e){delete t[e]})),t.global&&(e.global=function(e,t){return e?(Object.keys(t||{}).forEach((function(n){t[n]&&(e[n]=Ne(e[n]||{},t[n]))})),e):t}(e.global,t.global),delete t.global),this.$handle.$manager.mergeOptions([t],e),e},updateOptions:function(e){this.options.value=this.mergeOptions(this.options.value,e),this.$handle.$manager.updateOptions(this.options.value),this.bus.$emit("$loadData.$options")},api:function(){return this.$handle.api},render:function(){return this.$handle.render()},mounted:function(){this.$handle.mounted()},unmount:function(){var e=this;if(this.name)if(this.inFor){var t=Nt[this.name].indexOf(this);Nt[this.name].splice(t,1)}else delete Nt[this.name];p.forEach((function(t){e.bus.$off(t.name,t.callback)})),this.tmpData={},this.unwatch.forEach((function(e){return e()})),this.unwatch=[],this.$handle.reloadRule([])},updated:function(){var e=this;this.$handle.bindNextTick((function(){return e.bus.$emit("next-tick",e.$handle.api)}))}}),W(k),Q(n=k,{create:A,install:function(t,i){g=r(r({},g),i||{});var o="_installedFormCreate".concat(b?"Mobile":"","_").concat(e.ui);if(!0!==t[o]){t[o]=!0;var a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e,t)};W(a),t.config.globalProperties.$formCreate=a;var u=E();t.component(u.name,u),f.forEach((function(e){Me((function(){return e(n,t)}))}))}}}),q("$cookie",jt),q("$localStorage",Et),q("$sessionStorage",Ft),x.use({fragment:"fcFragment"}),e.install&&A.use(e),C((function(e,t){t.mixin({props:["formCreateInject"]})})),R(Ct),e.inherit){var K=e.inherit;K.components&&Q(o,K.components),K.parsers&&Q(u,K.parsers),K.directives&&Q(c,K.directives),K.modelFields&&Q(l,K.modelFields),K.providers&&Q(m,K.providers),K.useApps&&Q(f,K.useApps),K.maker&&Q(v,K.maker),K.loadData&&Q(_,K.loadData),K.formulas&&Q(w,K.formulas)}var Z=E();return He(Z,k),Object.defineProperties(Z,{fetch:{get:function(){return k.fetch},set:function(e){k.fetch=e}}}),Z.util=k,Z}var Lt={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",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"},Mt="datePicker",Ut={name:Mt,maker:["year","month","date","dates","week","datetime","datetimeRange","dateRange","monthRange"].reduce((function(e,t){return e[t]=Ze(Mt,{type:t.toLowerCase()}),e}),{}),mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat=Lt[t.type]||Lt.date)}},qt="hidden",Ht={name:qt,maker:a({},qt,(function(e,t){return Ze(qt)("",e,t)})),render:function(){return[]}},zt="input",Yt={name:zt,maker:function(){var e=["password","url","email","text","textarea"].reduce((function(e,t){return e[t]=Ze(zt,{type:t}),e}),{});return e.idate=Ze(zt,{type:"date"}),e}(),mergeProp:function(e){var t=e.prop.props;t&&t.autosize&&t.autosize.minRows&&(t.rows=t.autosize.minRows||2)}},Gt="slider",Jt="timePicker",Wt=[Ut,Ht,Yt,{name:"textarea",mergeProp:function(e){var t=e.prop.props;t.type="textarea",t&&t.autosize&&t.autosize.minRows&&(t.rows=t.autosize.minRows||2)}},{name:Gt,maker:{sliderRange:Ze(Gt,{range:!0})},toFormValue:function(e,t){var n=Array.isArray(e),r=t.prop.props,i=r.min||0;return!0===r.range?n?e:[i,parseFloat(e)||i]:n?parseFloat(e[0])||i:parseFloat(e)}},{name:Jt,maker:{time:Ze(Jt,(function(e){return e.props.isRange=!1})),timeRange:Ze(Jt,(function(e){return e.props.isRange=!0}))},mergeProp:function(e){var t=e.prop.props;t.valueFormat||(t.valueFormat="HH:mm:ss")}},{name:"FcRow",render:function(e,t){return t.vNode.col({props:{span:24}},{default:function(){return[t.vNode.row(t.prop,e)]}})}},{name:"select",toFormValue:function(e,t){return t.prop.props.multiple&&!Array.isArray(e)?v(e):e}}],Kt={button:"el-button",icon:"el-icon",slider:"el-slider",rate:"el-rate",upload:"fc-upload",cascader:"el-cascader",popover:"el-popover",tooltip:"el-tooltip",colorPicker:"el-colorPicker",timePicker:"el-time-picker",timeSelect:"el-time-select",datePicker:"el-date-picker",switch:"el-switch",select:"fc-select",checkbox:"fc-checkbox",radio:"fc-radio",inputNumber:"el-input-number",number:"el-input-number",input:"el-input",textarea:"el-input",formItem:"el-form-item",form:"el-form",frame:"fc-frame",col:"el-col",row:"el-row",tree:"fc-tree",autoComplete:"el-autocomplete",auto:"el-autocomplete",group:"fc-group",array:"fc-group",object:"fc-sub-form",subForm:"fc-sub-form"};function Xt(e,t){var n;B(e,t)&&(N.String(e[t])&&(e[t]=(a(n={},t,e[t]),a(n,"show",!0),n)))}function Zt(e){return!1===e}function Qt(e){var t=r({},e);return delete t.children,t}var en={validate:function(){var e=this.form();return e?e.validate():new Promise((function(e){return e()}))},validateField:function(e){var t=this;return new Promise((function(n,r){var i=t.form();i?i.validateField(e,(function(e,t){t?r(t):n(e)})):n()}))},clearValidateState:function(e){var t=this.vm.refs[e.wrapRef];t&&t.clearValidate()},fieldChange:function(e,t,n,r){var i,o;r||(null===(i=this.vm.refs[e.wrapRef])||void 0===i||null===(o=i.validate("change"))||void 0===o||o.catch((function(){})))},tidyOptions:function(e){return["submitBtn","resetBtn","row","info","wrap","col","title"].forEach((function(t){!function(e,t){B(e,t)&&!N.Object(e[t])&&(e[t]={show:!!e[t]})}(e,t)})),e},tidyRule:function(e){var t=e.prop;return Xt(t,"title"),Xt(t,"info"),t},mergeProp:function(e){var t=this,n={info:{trigger:"hover",placement:"top-start",icon:!0},title:{},col:{span:24},wrap:{}};["info","wrap","col","title"].forEach((function(r){e.prop[r]=Ve([t.options[r]||{},e.prop[r]||{}],n[r])}))},getDefaultOptions:function(){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:"",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",loading:!1,disabled:!1,innerText:"",show:!1,col:void 0,click:void 0}}},update:function(){var e=this.options.form;this.rule={props:r({},e),on:{submit:function(e){e.preventDefault()}},style:e.style,type:"form"}},beforeRender:function(){var e=this.key,t=this.ref,n=this.$handle,r=this.options.form;Q(this.rule,{key:e,ref:t,class:[r.className,r.class,"form-create",this.$handle.preview?"is-preview":""]}),Q(this.rule.props,{model:n.formData})},render:function(e){var t=this;return e.slotLen()&&!this.$handle.preview&&e.setSlot(void 0,(function(){return t.makeFormBtn()})),this.$r(this.rule,Zt(this.options.row.show)?e.getSlots():[this.makeRow(e)])},makeWrap:function(e,t){var n=this,i=e.prop,o="".concat(this.key).concat(e.key),a=i.col,u=this.isTitle(i)&&!1!==i.wrap.title,c=a.labelWidth||u?a.labelWidth:0,l=this.rule.props,s=l.inline,f=l.col,d=i.wrap.class;delete i.wrap.class,delete i.wrap.title;var p=(N.Undef(i.wrap.show)?!e.input:Zt(i.wrap.show))?t:this.$r(Ve([i.wrap,{props:r(r({labelWidth:void 0===c?c:ne(c),label:u?i.title.title:void 0},Qt(i.wrap||{})),{},{prop:e.id,rules:e.injectValidate()}),class:this.$render.mergeClass(d||i.className,"fc-form-item"),key:"".concat(o,"fi"),ref:e.wrapRef,type:"formItem"}]),r({default:function(){return t}},u?{label:function(){return n.makeInfo(i,o,e)}}:{}));return!0===s||Zt(f)||Zt(a.show)?p:this.makeCol(i,o,[p])},isTitle:function(e){if(!1===this.options.form.title)return!1;var t=e.title;return!(!t.title&&!t.native||Zt(t.show))},makeInfo:function(e,t,n){var i,o,u,c,l=this,s=r({},e.title),f=r({},e.info),d="tooltip"===f.type,p=this.options.form,h=this.getSlot("title"),m=[h?h({title:null===(i=n.refRule)||void 0===i||null===(o=i.__$title)||void 0===o?void 0:o.value,rule:n.rule,options:this.options}):(null===(u=n.refRule)||void 0===u||null===(c=u.__$title)||void 0===c?void 0:c.value)+(p.labelSuffix||p["label-suffix"]||"")];if(!Zt(f.show)&&(f.info||f.native)&&!Zt(f.icon)){var v={type:f.type||"popover",props:Qt(f),key:"".concat(t,"pop")};delete v.props.icon,delete v.props.show,delete v.props.info,delete v.props.align,delete v.props.native;var g,y,b="content";if(f.info&&!B(v.props,b))v.props[b]=null===(g=n.refRule)||void 0===g||null===(y=g.__$info)||void 0===y?void 0:y.value;m["left"!==f.align?"unshift":"push"](this.$r(Ve([f,v]),a({},s.slot||(d?"default":"reference"),(function(){return l.$r({type:"ElIcon",style:"top:2px",key:"".concat(t,"i")},{default:function(){return l.$r({type:!0===f.icon?"icon-warning":f.icon})}},!0)}))))}var _=Ve([s,{props:Qt(s),key:"".concat(t,"tit"),class:"fc-form-title",type:s.type||"span",on:{click:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.$handle.targetHook(n,"titleClick",{args:t})}}}]);return delete _.props.show,delete _.props.title,delete _.props.native,this.$r(_,m)},makeCol:function(e,t,n){var r=e.col;return this.$r({class:this.$render.mergeClass(r.class,"fc-form-col"),type:"col",props:r||{span:24},key:"".concat(t,"col")},n)},makeRow:function(e){var t=this.options.row||{};return this.$r({type:"row",props:t,class:this.$render.mergeClass(t.class,"fc-form-row"),key:"".concat(this.key,"row")},e)},makeFormBtn:function(){var e=[];if(Zt(this.options.submitBtn.show)||e.push(this.makeSubmitBtn()),Zt(this.options.resetBtn.show)||e.push(this.makeResetBtn()),e.length){var t=this.$r({type:"formItem",class:"fc-form-item",key:"".concat(this.key,"fb")},e);return!0===this.rule.props.inline?t:this.$r({type:"col",class:"fc-form-col fc-form-footer",props:{span:24},key:"".concat(this.key,"fc")},[t])}},makeResetBtn:function(){var e=this,t=r({},this.options.resetBtn),n=t.innerText||this.$handle.api.t("reset")||"重置";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-reset-btn",style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.resetBtn.click?e.options.resetBtn.click(t):t.resetFields()}},key:"".concat(this.key,"b2")},[n])},makeSubmitBtn:function(){var e=this,t=r({},this.options.submitBtn),n=t.innerText||this.$handle.api.t("submit")||"提交";return delete t.innerText,delete t.click,delete t.col,delete t.show,this.$r({type:"button",props:t,class:"fc-submit-btn",style:{width:t.width},on:{click:function(){var t=e.$handle.api;e.options.submitBtn.click?e.options.submitBtn.click(t):t.submit().catch((function(){}))}},key:"".concat(this.key,"b1")},[n])}},tn={};!function(e){["group","tree","switch","upload","autoComplete","checkbox","cascader","colorPicker","datePicker","frame","inputNumber","radio","rate"].forEach((function(t){e[t]=Ze(t)})),e.auto=e.autoComplete,e.number=e.inputNumber,e.color=e.colorPicker}(tn),function(e){var t="select",n="multiple";e.selectMultiple=Ze(t,a({},n,!0)),e.selectOne=Ze(t,a({},n,!1))}(tn),function(e){var t={treeSelected:"selected",treeChecked:"checked"};Object.keys(t).reduce((function(e,n){return e[n]=Ze("tree",{type:t[n]}),e}),e)}(tn),function(e){var t={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=Ze("upload",(function(e){return e.props({uploadType:t[n][0],maxLength:t[n][1]})})),e}),e),e.uploadImage=e.image,e.uploadFile=e.file}(tn),function(e){var t={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]};Object.keys(t).reduce((function(e,n){return e[n]=Ze("frame",(function(e){return e.props({type:t[n][0],maxLength:t[n][1]})})),e}),e),e.frameInput=e.frameInputs,e.frameFile=e.frameFiles,e.frameImage=e.frameImages}(tn);function nn(e,t){return N.Boolean(e)?e={show:e}:N.Undef(e)||N.Object(e)||(e={show:t}),e}function rn(e,t){return{formEl:function(){return t.$manager.form()},wrapEl:function(e){var n=t.getFieldCtx(e);if(n)return t.vm.refs[n.wrapRef]},validate:function(n){return new Promise((function(r,i){var o=e.children,a=[t.$manager.validate()];o.filter((function(e){return!e.isScope})).forEach((function(e){a.push(e.validate())})),Promise.all(a).then((function(){r(!0),n&&n(!0)})).catch((function(r){i(r),n&&n(r),t.vm.emit("validate-fail",r,{api:e}),t.emitEvent("validate-fail",r,{api:e})}))}))},validateField:function(n,r){return new Promise((function(i,o){var a=t.getFieldCtx(n);if(a){var u=t.subForm[a.id],c=[t.$manager.validateField(a.id)];v(u).filter((function(e){return!e.isScope})).forEach((function(e){c.push(e.validate())})),Promise.all(c).then((function(){i(null),r&&r(null)})).catch((function(i){o(i),r&&r(i),t.vm.emit("validate-field-fail",i,{field:n,api:e})}))}}))},clearValidateState:function(n){var r=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.helper.tidyFields(n).forEach((function(e){i&&r.clearSubValidateState(e),t.getCtxs(e).forEach((function(e){t.$manager.clearValidateState(e)}))}))},clearSubValidateState:function(n){e.helper.tidyFields(n).forEach((function(e){t.getCtxs(e).forEach((function(e){var n=t.subForm[e.id];n&&(Array.isArray(n)?n.forEach((function(e){e.clearValidateState()})):n&&n.clearValidateState())}))}))},btn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.submitBtnProps({show:!!t})}},resetBtn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.resetBtnProps({show:!!t})}},submitBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=nn(t.options.submitBtn,!0);Q(r,n),t.options.submitBtn=r,e.refreshOptions()},resetBtnProps:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=nn(t.options.resetBtn,!1);Q(r,n),t.options.resetBtn=r,e.refreshOptions()},submit:function(n,r){return new Promise((function(i,o){(!1===t.options.validateOnSubmit?Promise.resolve():e.validate()).then((function(){var r=e.formData();t.beforeSubmit(r).then((function(){N.Function(n)&&Me((function(){return n(r,e)})),N.Function(t.options.onSubmit)&&Me((function(){return t.options.onSubmit(r,e)})),t.vm.emit("submit",r,e),i(r)})).catch((function(e){}))})).catch((function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];N.Function(r)&&Me((function(){return r.apply(void 0,[e].concat(n))})),o.apply(void 0,n)}))}))}}}b(".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}.fc-wrap-right>.el-form-item__label{display:flex;justify-content:flex-end}.fc-wrap-left>.el-form-item__label{display:flex;justify-content:flex-start}.fc-wrap-top.el-form-item{display:block}.fc-wrap-top.el-form-item>.el-form-item__label{display:block;float:unset;height:auto;line-height:22px;margin-bottom:8px;text-align:left}.el-form--large .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:12px}.el-form--default .fc-wrap-top.el-form-item>.el-form-item__label{line-height:22px;margin-bottom:8px}.el-form--small .fc-wrap-top.el-form-item>.el-form-item__label{line-height:20px;margin-bottom:4px}.fc-form-footer{margin-top:12px}");var on={name:"required",load:function(e,t,n){var i=function(e){return N.Boolean(e)?{required:e}:N.String(e)?{message:e}:N.Undef(e)?{required:!1}:N.Function(e)?{validator:e}:N.Object(e)?e:{}}(e.getValue()),o=void 0;if(!1===i.required)e.clearProp(),n.clearValidateState([t.field]);else{var a=r({required:!0,validator:function(e,t,n){u(),N.empty(t)?n(a.message):n()}},i),u=function(){var e,r=null===(e=t.__fc__.refRule.__$title)||void 0===e?void 0:e.value;if(o!==r)if(o=r,i.message){var u=i.message.match(/^\{\{\s*\$t\.(.+)\s*\}\}$/);u&&(a.message=n.t(u[1],{title:r}))}else a.message=n.t("required",{title:r})||r+("en"===n.getLocale()?" is required":"不能为空")};u(),e.getProp().validate=[a]}n.sync(t)},watch:function(){on.load.apply(on,arguments)}};function an(e){e.componentAlias(Kt),we.forEach((function(t){e.component(t.name,t)})),e.register(on),Wt.forEach((function(t){e.parser(t)})),Object.keys(tn).forEach((function(t){e.maker[t]=tn[t]})),"undefined"!=typeof window&&window.ElementPlus&&e.useApp((function(e,t){t.use(window.ElementPlus)}))}var un=Tt({ui:"element-ui",version:"3.2.39",manager:en,extendApi:rn,install:an,attrs:{normal:["col","wrap"],array:["className"],key:["title","info"]}});"undefined"!=typeof window&&(window.formCreate=un);var cn=un.maker;e.default=un,e.maker=cn,Object.defineProperty(e,"__esModule",{value:!0})}));
|