operp-print-designer 1.1.0 → 1.1.2
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 +10 -0
- package/dist/components/Canvas.d.ts +2 -0
- package/dist/components/PrintDesigner/index.d.ts +3 -1
- package/dist/components/PrintPreview.d.ts +4 -1
- package/dist/constants/index.d.ts +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/operp-print-designer.es.js +4095 -3965
- package/dist/operp-print-designer.umd.js +21 -21
- package/dist/types/index.d.ts +6 -0
- package/dist/utils/dataHelper.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Ae,se){typeof exports=="object"&&typeof module<"u"?se(exports,require("react"),require("antd"),require("@ant-design/icons"),require("react-to-print"),require("zustand"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons","react-to-print","zustand","react-dom"],se):(Ae=typeof globalThis<"u"?globalThis:Ae||self,se(Ae.PrintDesigner={},Ae.React,Ae.antd,Ae.icons,Ae.ReactToPrint,Ae.zustand,Ae.ReactDOM))})(this,(function(Ae,se,E,Oe,nr,un,It){"use strict";function dn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function fn(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var i=n.default;if(typeof i=="function"){var o=function a(){return this instanceof a?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};o.prototype=i.prototype}else o={};return Object.defineProperty(o,"__esModule",{value:!0}),Object.keys(n).forEach(function(a){var c=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(o,a,c.get?c:{enumerable:!0,get:function(){return n[a]}})}),o}var vt={exports:{}},it={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var or;function pn(){if(or)return it;or=1;var n=se,i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function x(_,b,v){var R,P={},C=null,L=null;v!==void 0&&(C=""+v),b.key!==void 0&&(C=""+b.key),b.ref!==void 0&&(L=b.ref);for(R in b)a.call(b,R)&&!u.hasOwnProperty(R)&&(P[R]=b[R]);if(_&&_.defaultProps)for(R in b=_.defaultProps,b)P[R]===void 0&&(P[R]=b[R]);return{$$typeof:i,type:_,key:C,ref:L,props:P,_owner:c.current}}return it.Fragment=o,it.jsx=x,it.jsxs=x,it}var st={},ir;function hn(){if(ir)return st;ir=1;var n={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,54 +14,54 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/return n.NODE_ENV!=="production"&&(function(){var
|
|
18
|
-
`+A+
|
|
17
|
+
*/return n.NODE_ENV!=="production"&&(function(){var i=se,o=Symbol.for("react.element"),a=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),b=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),y=Symbol.iterator,d="@@iterator";function r(h){if(h===null||typeof h!="object")return null;var F=y&&h[y]||h[d];return typeof F=="function"?F:null}var t=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function s(h){{for(var F=arguments.length,te=new Array(F>1?F-1:0),de=1;de<F;de++)te[de-1]=arguments[de];f("error",h,te)}}function f(h,F,te){{var de=t.ReactDebugCurrentFrame,Pe=de.getStackAddendum();Pe!==""&&(F+="%s",te=te.concat([Pe]));var ze=te.map(function(Se){return String(Se)});ze.unshift("Warning: "+F),Function.prototype.apply.call(console[h],console,ze)}}var l=!1,w=!1,O=!1,D=!1,M=!1,H;H=Symbol.for("react.module.reference");function T(h){return!!(typeof h=="string"||typeof h=="function"||h===c||h===x||M||h===u||h===R||h===P||D||h===k||l||w||O||typeof h=="object"&&h!==null&&(h.$$typeof===L||h.$$typeof===C||h.$$typeof===_||h.$$typeof===b||h.$$typeof===v||h.$$typeof===H||h.getModuleId!==void 0))}function N(h,F,te){var de=h.displayName;if(de)return de;var Pe=F.displayName||F.name||"";return Pe!==""?te+"("+Pe+")":te}function G(h){return h.displayName||"Context"}function X(h){if(h==null)return null;if(typeof h.tag=="number"&&s("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case c:return"Fragment";case a:return"Portal";case x:return"Profiler";case u:return"StrictMode";case R:return"Suspense";case P:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case b:var F=h;return G(F)+".Consumer";case _:var te=h;return G(te._context)+".Provider";case v:return N(h,h.render,"ForwardRef");case C:var de=h.displayName||null;return de!==null?de:X(h.type)||"Memo";case L:{var Pe=h,ze=Pe._payload,Se=Pe._init;try{return X(Se(ze))}catch{return null}}}return null}var V=Object.assign,J=0,K,re,be,ge,I,W,ie;function oe(){}oe.__reactDisabledLog=!0;function ae(){{if(J===0){K=console.log,re=console.info,be=console.warn,ge=console.error,I=console.group,W=console.groupCollapsed,ie=console.groupEnd;var h={configurable:!0,enumerable:!0,value:oe,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}J++}}function fe(){{if(J--,J===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},h,{value:K}),info:V({},h,{value:re}),warn:V({},h,{value:be}),error:V({},h,{value:ge}),group:V({},h,{value:I}),groupCollapsed:V({},h,{value:W}),groupEnd:V({},h,{value:ie})})}J<0&&s("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=t.ReactCurrentDispatcher,A;function U(h,F,te){{if(A===void 0)try{throw Error()}catch(Pe){var de=Pe.stack.trim().match(/\n( *(at )?)/);A=de&&de[1]||""}return`
|
|
18
|
+
`+A+h}}var ee=!1,Z;{var ce=typeof WeakMap=="function"?WeakMap:Map;Z=new ce}function B(h,F){if(!h||ee)return"";{var te=Z.get(h);if(te!==void 0)return te}var de;ee=!0;var Pe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ze;ze=ue.current,ue.current=null,ae();try{if(F){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(He){de=He}Reflect.construct(h,[],Se)}else{try{Se.call()}catch(He){de=He}h.call(Se.prototype)}}else{try{throw Error()}catch(He){de=He}h()}}catch(He){if(He&&de&&typeof He.stack=="string"){for(var ve=He.stack.split(`
|
|
19
19
|
`),We=de.stack.split(`
|
|
20
|
-
`),Ie=
|
|
21
|
-
`+
|
|
20
|
+
`),Ie=ve.length-1,Ne=We.length-1;Ie>=1&&Ne>=0&&ve[Ie]!==We[Ne];)Ne--;for(;Ie>=1&&Ne>=0;Ie--,Ne--)if(ve[Ie]!==We[Ne]){if(Ie!==1||Ne!==1)do if(Ie--,Ne--,Ne<0||ve[Ie]!==We[Ne]){var Be=`
|
|
21
|
+
`+ve[Ie].replace(" at new "," at ");return h.displayName&&Be.includes("<anonymous>")&&(Be=Be.replace("<anonymous>",h.displayName)),typeof h=="function"&&Z.set(h,Be),Be}while(Ie>=1&&Ne>=0);break}}}finally{ee=!1,ue.current=ze,fe(),Error.prepareStackTrace=Pe}var ot=h?h.displayName||h.name:"",Je=ot?U(ot):"";return typeof h=="function"&&Z.set(h,Je),Je}function he(h,F,te){return B(h,!1)}function ke(h){var F=h.prototype;return!!(F&&F.isReactComponent)}function we(h,F,te){if(h==null)return"";if(typeof h=="function")return B(h,ke(h));if(typeof h=="string")return U(h);switch(h){case R:return U("Suspense");case P:return U("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case v:return he(h.render);case C:return we(h.type,F,te);case L:{var de=h,Pe=de._payload,ze=de._init;try{return we(ze(Pe),F,te)}catch{}}}return""}var Le=Object.prototype.hasOwnProperty,g={},m=t.ReactDebugCurrentFrame;function j(h){if(h){var F=h._owner,te=we(h.type,h._source,F?F.type:null);m.setExtraStackFrame(te)}else m.setExtraStackFrame(null)}function q(h,F,te,de,Pe){{var ze=Function.call.bind(Le);for(var Se in h)if(ze(h,Se)){var ve=void 0;try{if(typeof h[Se]!="function"){var We=Error((de||"React class")+": "+te+" type `"+Se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[Se]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw We.name="Invariant Violation",We}ve=h[Se](F,Se,de,te,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ie){ve=Ie}ve&&!(ve instanceof Error)&&(j(Pe),s("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",de||"React class",te,Se,typeof ve),j(null)),ve instanceof Error&&!(ve.message in g)&&(g[ve.message]=!0,j(Pe),s("Failed %s type: %s",te,ve.message),j(null))}}}var ne=Array.isArray;function Q(h){return ne(h)}function le(h){{var F=typeof Symbol=="function"&&Symbol.toStringTag,te=F&&h[Symbol.toStringTag]||h.constructor.name||"Object";return te}}function ye(h){try{return Ce(h),!1}catch{return!0}}function Ce(h){return""+h}function p(h){if(ye(h))return s("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",le(h)),Ce(h)}var S=t.ReactCurrentOwner,z={key:!0,ref:!0,__self:!0,__source:!0},Y,$;function Ee(h){if(Le.call(h,"ref")){var F=Object.getOwnPropertyDescriptor(h,"ref").get;if(F&&F.isReactWarning)return!1}return h.ref!==void 0}function me(h){if(Le.call(h,"key")){var F=Object.getOwnPropertyDescriptor(h,"key").get;if(F&&F.isReactWarning)return!1}return h.key!==void 0}function Te(h,F){typeof h.ref=="string"&&S.current}function Me(h,F){{var te=function(){Y||(Y=!0,s("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",F))};te.isReactWarning=!0,Object.defineProperty(h,"key",{get:te,configurable:!0})}}function Ge(h,F){{var te=function(){$||($=!0,s("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",F))};te.isReactWarning=!0,Object.defineProperty(h,"ref",{get:te,configurable:!0})}}var $e=function(h,F,te,de,Pe,ze,Se){var ve={$$typeof:o,type:h,key:F,ref:te,props:Se,_owner:ze};return ve._store={},Object.defineProperty(ve._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ve,"_self",{configurable:!1,enumerable:!1,writable:!1,value:de}),Object.defineProperty(ve,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Pe}),Object.freeze&&(Object.freeze(ve.props),Object.freeze(ve)),ve};function mt(h,F,te,de,Pe){{var ze,Se={},ve=null,We=null;te!==void 0&&(p(te),ve=""+te),me(F)&&(p(F.key),ve=""+F.key),Ee(F)&&(We=F.ref,Te(F,Pe));for(ze in F)Le.call(F,ze)&&!z.hasOwnProperty(ze)&&(Se[ze]=F[ze]);if(h&&h.defaultProps){var Ie=h.defaultProps;for(ze in Ie)Se[ze]===void 0&&(Se[ze]=Ie[ze])}if(ve||We){var Ne=typeof h=="function"?h.displayName||h.name||"Unknown":h;ve&&Me(Se,Ne),We&&Ge(Se,Ne)}return $e(h,ve,We,Pe,de,S.current,Se)}}var et=t.ReactCurrentOwner,er=t.ReactDebugCurrentFrame;function Ve(h){if(h){var F=h._owner,te=we(h.type,h._source,F?F.type:null);er.setExtraStackFrame(te)}else er.setExtraStackFrame(null)}var tt;tt=!1;function rt(h){return typeof h=="object"&&h!==null&&h.$$typeof===o}function nt(){{if(et.current){var h=X(et.current.type);if(h)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+h+"`."}return""}}function tr(h){return""}var on={};function vo(h){{var F=nt();if(!F){var te=typeof h=="string"?h:h.displayName||h.name;te&&(F=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+te+">.")}return F}}function sn(h,F){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var te=vo(F);if(on[te])return;on[te]=!0;var de="";h&&h._owner&&h._owner!==et.current&&(de=" It was passed a child from "+X(h._owner.type)+"."),Ve(h),s('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',te,de),Ve(null)}}function an(h,F){{if(typeof h!="object")return;if(Q(h))for(var te=0;te<h.length;te++){var de=h[te];rt(de)&&sn(de,F)}else if(rt(h))h._store&&(h._store.validated=!0);else if(h){var Pe=r(h);if(typeof Pe=="function"&&Pe!==h.entries)for(var ze=Pe.call(h),Se;!(Se=ze.next()).done;)rt(Se.value)&&sn(Se.value,F)}}}function bo(h){{var F=h.type;if(F==null||typeof F=="string")return;var te;if(typeof F=="function")te=F.propTypes;else if(typeof F=="object"&&(F.$$typeof===v||F.$$typeof===C))te=F.propTypes;else return;if(te){var de=X(F);q(te,h.props,"prop",de,h)}else if(F.PropTypes!==void 0&&!tt){tt=!0;var Pe=X(F);s("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Pe||"Unknown")}typeof F.getDefaultProps=="function"&&!F.getDefaultProps.isReactClassApproved&&s("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xo(h){{for(var F=Object.keys(h.props),te=0;te<F.length;te++){var de=F[te];if(de!=="children"&&de!=="key"){Ve(h),s("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",de),Ve(null);break}}h.ref!==null&&(Ve(h),s("Invalid attribute `ref` supplied to `React.Fragment`."),Ve(null))}}var ln={};function cn(h,F,te,de,Pe,ze){{var Se=T(h);if(!Se){var ve="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(ve+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var We=tr();We?ve+=We:ve+=nt();var Ie;h===null?Ie="null":Q(h)?Ie="array":h!==void 0&&h.$$typeof===o?(Ie="<"+(X(h.type)||"Unknown")+" />",ve=" Did you accidentally export a JSX literal instead of a component?"):Ie=typeof h,s("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ie,ve)}var Ne=mt(h,F,te,Pe,ze);if(Ne==null)return Ne;if(Se){var Be=F.children;if(Be!==void 0)if(de)if(Q(Be)){for(var ot=0;ot<Be.length;ot++)an(Be[ot],h);Object.freeze&&Object.freeze(Be)}else s("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else an(Be,h)}if(Le.call(F,"key")){var Je=X(h),He=Object.keys(F).filter(function(Ro){return Ro!=="key"}),rr=He.length>0?"{key: someKey, "+He.join(": ..., ")+": ...}":"{key: someKey}";if(!ln[Je+rr]){var Oo=He.length>0?"{"+He.join(": ..., ")+": ...}":"{}";s(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,tr,Je,So,Je),an[Je+tr]=!0}}return g===h?mo(Le):yo(Le),Le}}function vo(g,B,ee){return ln(g,B,ee,!0)}function bo(g,B,ee){return ln(g,B,ee,!1)}var xo=bo,wo=vo;st.Fragment=h,st.jsx=xo,st.jsxs=wo})(),st}var ir;function hn(){if(ir)return vt.exports;ir=1;var n={};return n.NODE_ENV==="production"?vt.exports=fn():vt.exports=pn(),vt.exports}var r=hn();const bt={A4:{width:210,height:297},A3:{width:297,height:420},A5:{width:148,height:210},Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6}},sr={paperSize:"A4",customWidth:210,customHeight:297,orientation:"portrait",marginTop:10,marginRight:10,marginBottom:10,marginLeft:10,showHeader:!1,headerContent:"页眉文字",showFooter:!1,footerContent:"页脚文字",showPageNumber:!0,pageNumberFormat:"第 {page} 页"},Pe=3,xt={cellSize:1,cols:100},ar={text:"文本",image:"图片",table:"表格",barcode:"条形码",qrcode:"二维码",line:"分割线"},gn={text:{content:"双击编辑文字",fontSize:14,fontWeight:"normal",fontStyle:"normal",textAlign:"left",color:"#000000",backgroundColor:"transparent"},image:{src:"",fit:"contain",content:""},table:{rows:3,cols:3,borderWidth:1,borderColor:"#000000",content:""},barcode:{value:"1234567890",format:"CODE128",content:""},qrcode:{value:"https://example.com",errorLevel:"M",color:"#000000",backgroundColor:"#ffffff",content:""},line:{color:"#000000",thickness:1,style:"solid",content:""}};let It=0,At=0;function lr(){return`comp_${++It}`}function cr(){return`ds_${++At}`}const fe=cn.create((n,o)=>({components:[],selectedId:null,pageSettings:{...sr},gridSettings:{...xt},previewVisible:!1,templateName:"未命名模板",headerFooterVisible:!1,dataSources:[],activeDataSourceId:null,addComponent:(s,i,h)=>{const u=lr(),b=ar[s]||s,O={...gn[s]||{}};s==="text"&&(O.content=b);const m={id:u,type:s,x:i??0,y:h??0,w:s==="line"?20:s==="qrcode"?12:15,h:s==="line"?1:s==="qrcode"?12:8,props:O,...s==="table"?{tableColumns:[{title:"列1"},{title:"列2"},{title:"列3"}]}:{}};n(j=>({components:[...j.components,m],selectedId:u}))},updateComponent:(s,i)=>{n(h=>({components:h.components.map(u=>u.id===s?{...u,...i}:u)}))},selectComponent:s=>{n({selectedId:s})},removeComponent:s=>{n(i=>({components:i.components.filter(h=>h.id!==s),selectedId:i.selectedId===s?null:i.selectedId}))},setComponents:s=>{n({components:s})},setPageSettings:s=>{n(i=>({pageSettings:{...i.pageSettings,...s}}))},setPreviewVisible:s=>{n({previewVisible:s})},setTemplateName:s=>{n({templateName:s})},setHeaderFooterVisible:s=>{n({headerFooterVisible:s})},addDataSource:(s,i,h)=>{const b={id:cr(),name:s,type:i,data:h,createdAt:Date.now()};n(O=>({dataSources:[...O.dataSources,b]}))},updateDataSource:(s,i)=>{n(h=>({dataSources:h.dataSources.map(u=>u.id===s?{...u,...i}:u)}))},removeDataSource:s=>{n(i=>({dataSources:i.dataSources.filter(h=>h.id!==s),activeDataSourceId:i.activeDataSourceId===s?null:i.activeDataSourceId}))},setActiveDataSourceId:s=>{n({activeDataSourceId:s})},updateComponentTableColumns:(s,i)=>{n(h=>({components:h.components.map(u=>u.id===s?{...u,tableColumns:i}:u)}))},exportJSON:()=>{const s=o(),i={version:"1.0",templateName:s.templateName,pageSettings:s.pageSettings,components:s.components.map(({id:h,...u})=>u),dataSources:s.dataSources.map(({id:h,...u})=>u)};return JSON.stringify(i,null,2)},importJSON:s=>{try{const i=JSON.parse(s);if(!i.version||!i.pageSettings||!Array.isArray(i.components))return"JSON 格式不正确,缺少必要字段";It=0,At=0;const h=i.components.map(b=>({...b,id:lr()})),u=(i.dataSources||[]).map(b=>({...b,id:cr()}));return n({components:h,dataSources:u,pageSettings:i.pageSettings,templateName:i.templateName||"导入的模板",selectedId:null,activeDataSourceId:null}),null}catch{return"JSON 解析失败,请检查文件内容"}},reset:()=>{It=0,At=0,n({components:[],selectedId:null,pageSettings:{...sr},gridSettings:{...xt},templateName:"未命名模板",headerFooterVisible:!1,previewVisible:!1,dataSources:[],activeDataSourceId:null})}})),{Text:Oo}=T.Typography,yn=({onCustomSave:n,onCustomPrint:o})=>{const s=fe(t=>t.templateName),i=fe(t=>t.setTemplateName),h=fe(t=>t.setPreviewVisible),u=fe(t=>t.setHeaderFooterVisible),b=fe(t=>t.selectedId),O=fe(t=>t.removeComponent),m=fe(t=>t.exportJSON),j=fe(t=>t.importJSON),R=fe(t=>t.reset),P=oe.useRef(null),{message:E}=T.App.useApp(),N=oe.useCallback(()=>{b&&O(b)},[b,O]),I=oe.useCallback(()=>{const t=m(),c=new Blob([t],{type:"application/json"}),f=URL.createObjectURL(c),a=document.createElement("a");a.href=f,a.download=`${s||"模板"}.json`,a.click(),URL.revokeObjectURL(f),E.success("模板已导出")},[m,s,E]),p=oe.useCallback(()=>{var t;(t=P.current)==null||t.click()},[]),l=oe.useCallback(t=>{var a;const c=(a=t.target.files)==null?void 0:a[0];if(!c)return;const f=new FileReader;f.onload=()=>{const S=j(f.result);S?E.error(S):E.success("模板已导入")},f.readAsText(c),t.target.value=""},[j,E]),e=oe.useCallback(()=>{R(),E.info("已新建空白模板")},[R,E]);return r.jsxs("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:[r.jsx(T.Space,{children:r.jsx(T.Input,{value:s,onChange:t=>i(t.target.value),variant:"borderless",style:{width:200,fontSize:16,fontWeight:600},placeholder:"模板名称"})}),r.jsxs(T.Space,{children:[r.jsx(T.Button,{icon:r.jsx(Oe.PlusOutlined,{}),onClick:e,children:"新建"}),r.jsx("input",{ref:P,type:"file",accept:".json",style:{display:"none"},onChange:l}),n?r.jsx(T.Button,{icon:r.jsx(Oe.SaveOutlined,{}),onClick:n,type:"primary",children:"保存"}):r.jsx(T.Button,{icon:r.jsx(Oe.DownloadOutlined,{}),onClick:I,children:"导出"}),r.jsx(T.Button,{icon:r.jsx(Oe.UploadOutlined,{}),onClick:p,children:"导入"}),r.jsx(T.Button,{icon:r.jsx(Oe.SettingOutlined,{}),onClick:()=>u(!0),children:"页眉页脚"}),r.jsx(T.Button,{danger:!0,icon:r.jsx(Oe.DeleteOutlined,{}),disabled:!b,onClick:N,children:"删除"}),o?r.jsx(T.Button,{type:"primary",icon:r.jsx(Oe.PrinterOutlined,{}),onClick:o,children:"打印"}):r.jsx(T.Button,{type:"primary",icon:r.jsx(Oe.EyeOutlined,{}),onClick:()=>h(!0),children:"预览"})]})]})},{Text:Be}=T.Typography,mn=()=>{const n=fe(u=>u.pageSettings),o=fe(u=>u.setPageSettings),s=n.paperSize==="custom",i=oe.useCallback(u=>{o({paperSize:u})},[o]),h=oe.useCallback(u=>{o({orientation:u})},[o]);return r.jsx(T.Card,{title:"页面设置",size:"small",children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:12},children:"纸张大小"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:n.paperSize,onChange:i,options:[...Object.keys(bt).map(u=>({value:u,label:u})),{value:"custom",label:"自定义"}]})]}),s&&r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsxs("div",{style:{flex:1},children:[r.jsx(Be,{style:{fontSize:12},children:"宽度 (mm)"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:n.customWidth,min:10,max:2e3,onChange:u=>o({customWidth:u??210})})]}),r.jsxs("div",{style:{flex:1},children:[r.jsx(Be,{style:{fontSize:12},children:"高度 (mm)"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:n.customHeight,min:10,max:2e3,onChange:u=>o({customHeight:u??297})})]})]}),r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:12},children:"方向"}),r.jsxs(T.Radio.Group,{value:n.orientation,onChange:u=>h(u.target.value),size:"small",style:{width:"100%",display:"flex"},children:[r.jsx(T.Radio.Button,{value:"portrait",style:{flex:1,textAlign:"center"},children:"纵向"}),r.jsx(T.Radio.Button,{value:"landscape",style:{flex:1,textAlign:"center"},children:"横向"})]})]}),r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:12},children:"页边距 (mm)"}),r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:11},children:"上"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:n.marginTop,min:0,max:100,onChange:u=>o({marginTop:u??10})})]}),r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:11},children:"右"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:n.marginRight,min:0,max:100,onChange:u=>o({marginRight:u??10})})]}),r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:11},children:"下"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:n.marginBottom,min:0,max:100,onChange:u=>o({marginBottom:u??10})})]}),r.jsxs("div",{children:[r.jsx(Be,{style:{fontSize:11},children:"左"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:n.marginLeft,min:0,max:100,onChange:u=>o({marginLeft:u??10})})]})]})]})]})})},{Text:vn}=T.Typography,bn=[{type:"text",icon:r.jsx(Oe.FontSizeOutlined,{}),label:"文本"},{type:"image",icon:r.jsx(Oe.PictureOutlined,{}),label:"图片"},{type:"table",icon:r.jsx(Oe.TableOutlined,{}),label:"表格"},{type:"barcode",icon:r.jsx(Oe.BarcodeOutlined,{}),label:"条形码"},{type:"qrcode",icon:r.jsx(Oe.QrcodeOutlined,{}),label:"二维码"},{type:"line",icon:r.jsx(Oe.MinusOutlined,{}),label:"分割线"}],xn=()=>{const n=fe(i=>i.addComponent),o=oe.useCallback((i,h)=>{i.dataTransfer.setData("componentType",h),i.dataTransfer.effectAllowed="copy"},[]),s=oe.useCallback(i=>{n(i)},[n]);return r.jsx(T.Card,{title:"组件面板",size:"small",children:r.jsx(T.Space,{direction:"vertical",style:{width:"100%"},size:4,children:bn.map(i=>r.jsxs("div",{draggable:!0,onDragStart:h=>o(h,i.type),onClick:()=>s(i.type),style:{cursor:"grab",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:6,display:"flex",alignItems:"center",gap:8,background:"#fafafa",userSelect:"none",transition:"all 0.2s"},onMouseEnter:h=>{h.currentTarget.style.background="#e6f4ff",h.currentTarget.style.borderColor="#1677ff"},onMouseLeave:h=>{h.currentTarget.style.background="#fafafa",h.currentTarget.style.borderColor="#d9d9d9"},children:[i.icon,r.jsx(vn,{children:i.label})]},i.type))})})};function at(n){try{return JSON.parse(n)}catch{return null}}function Ke(n,o,s){const i=`${o}Binding`,h=n.props[i];if(h&&h.dataSourceId&&h.fieldPath){const b=s.find(O=>O.id===h.dataSourceId);if(b){const O=St(b);if(O){const m=wt(O,h.fieldPath);if(m)return m}}}return n.props[o]||(h==null?void 0:h.staticValue)||""}function wt(n,o){if(!n||!o)return"";try{const s=o.split(".");let i=n;for(const h of s){if(typeof i!="object"||i===null)return"";i=i[h]}return i!=null?String(i):""}catch{return""}}function St(n){const o=at(n.data);return n.type==="object"&&o&&typeof o=="object"&&!Array.isArray(o)?o:null}function jt(n){const o=at(n.data);return n.type==="array"&&Array.isArray(o)?o:null}const{TextArea:wn}=T.Input,{Text:Ot,Title:Ro}=T.Typography,ur=JSON.stringify({name:"张三",age:28,department:"技术部",email:"zhangsan@example.com"},null,2),Sn=JSON.stringify([{id:1,product:"商品A",quantity:2,price:100},{id:2,product:"商品B",quantity:5,price:80},{id:3,product:"商品C",quantity:1,price:200}],null,2),jn=()=>{const n=fe(E=>E.dataSources),o=fe(E=>E.addDataSource),s=fe(E=>E.updateDataSource),i=fe(E=>E.removeDataSource),[h,u]=oe.useState(!1),[b,O]=oe.useState(null),[m,j]=oe.useState({name:"",type:"object",data:""}),R=E=>{E?(O(E.id),j({name:E.name,type:E.type,data:E.data})):(O(null),j({name:"新数据源",type:"object",data:ur})),u(!0)},P=()=>{const E=at(m.data);if(E===null){T.message.error("JSON 格式不正确");return}if(m.type==="object"&&(Array.isArray(E)||typeof E!="object")){T.message.error("对象类型数据源必须为对象格式");return}if(m.type==="array"&&!Array.isArray(E)){T.message.error("数组类型数据源必须为数组格式");return}b?(s(b,m),T.message.success("数据源已更新")):(o(m.name,m.type,m.data),T.message.success("数据源已添加")),u(!1)};return r.jsxs(T.Card,{title:"数据源",size:"small",extra:r.jsx(T.Button,{type:"link",size:"small",icon:r.jsx(Oe.PlusOutlined,{}),onClick:()=>R(),children:"添加"}),children:[r.jsx(T.List,{size:"small",dataSource:n,locale:{emptyText:"暂无数据源"},renderItem:E=>r.jsx(T.List.Item,{actions:[r.jsx(T.Dropdown,{menu:{items:[{key:"edit",label:"编辑",icon:r.jsx(Oe.EditOutlined,{}),onClick:()=>R(E)},{type:"divider"},{key:"delete",label:r.jsx(T.Popconfirm,{title:"确定要删除这个数据源吗?",onConfirm:N=>{N==null||N.stopPropagation(),i(E.id),T.message.success("已删除")},okText:"确定",cancelText:"取消",onCancel:N=>N==null?void 0:N.stopPropagation(),children:r.jsx("span",{style:{color:"#ff4d4f",cursor:"pointer"},children:"删除"})}),icon:r.jsx(Oe.DeleteOutlined,{style:{color:"#ff4d4f"}})}]},placement:"bottomRight",children:r.jsx(T.Button,{type:"text",size:"small",icon:r.jsx(Oe.MoreOutlined,{})})})],children:r.jsx(T.List.Item.Meta,{avatar:r.jsx(Oe.DatabaseOutlined,{}),title:r.jsx(Ot,{ellipsis:!0,strong:!0,children:E.name}),description:r.jsx(T.Space,{size:4,children:r.jsx(T.Tag,{color:E.type==="object"?"blue":"green",children:E.type==="object"?"对象":"数组"})})})})}),r.jsx(T.Modal,{title:b?"编辑数据源":"添加数据源",open:h,onOk:P,onCancel:()=>u(!1),okText:"保存",cancelText:"取消",children:r.jsxs(T.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[r.jsxs("div",{children:[r.jsx(Ot,{strong:!0,style:{display:"block",marginBottom:4},children:"名称"}),r.jsx(T.Input,{placeholder:"请输入数据源名称",value:m.name,onChange:E=>j({...m,name:E.target.value})})]}),r.jsxs("div",{children:[r.jsx(Ot,{strong:!0,style:{display:"block",marginBottom:4},children:"类型"}),r.jsx(T.Select,{options:[{label:"对象",value:"object"},{label:"数组",value:"array"}],style:{width:"100%"},value:m.type,onChange:E=>{j({...m,type:E,data:E==="object"?ur:Sn})}})]}),r.jsx(T.Divider,{style:{margin:"8px 0"}}),r.jsxs("div",{children:[r.jsx(Ot,{strong:!0,style:{display:"block",marginBottom:4},children:"JSON 数据"}),r.jsx(wn,{rows:12,placeholder:"请输入 JSON 数据",value:m.data,onChange:E=>j({...m,data:E.target.value})})]})]})})]})},On=()=>r.jsx(T.Collapse,{bordered:!1,accordion:!0,defaultActiveKey:["1"],expandIcon:({isActive:n})=>r.jsx(Oe.CaretRightOutlined,{rotate:n?90:0}),style:{height:"100%",overflowY:"auto"},items:[{key:"1",label:"页面设置",children:r.jsx(mn,{})},{key:"2",label:"组件",children:r.jsx(xn,{})},{key:"3",label:"数据源",children:r.jsx(jn,{})}]});var Lt={exports:{}},lt={},ct={exports:{}},Rn=ct.exports,dr;function Nt(){return dr||(dr=1,(function(n,o){(function(s,i){i(o)})(Rn,(function(s){function i(A){return function(Z,X,ae,H,ye,ze,we){return A(Z,X,we)}}function h(A){return function(Z,X,ae,H){if(!Z||!X||typeof Z!="object"||typeof X!="object")return A(Z,X,ae,H);var ye=H.get(Z),ze=H.get(X);if(ye&&ze)return ye===X&&ze===Z;H.set(Z,X),H.set(X,Z);var we=A(Z,X,ae,H);return H.delete(Z),H.delete(X),we}}function u(A,G){var Z={};for(var X in A)Z[X]=A[X];for(var X in G)Z[X]=G[X];return Z}function b(A){return A.constructor===Object||A.constructor==null}function O(A){return typeof A.then=="function"}function m(A,G){return A===G||A!==A&&G!==G}var j="[object Arguments]",R="[object Boolean]",P="[object Date]",E="[object RegExp]",N="[object Map]",I="[object Number]",p="[object Object]",l="[object Set]",e="[object String]",t=Object.prototype.toString;function c(A){var G=A.areArraysEqual,Z=A.areDatesEqual,X=A.areMapsEqual,ae=A.areObjectsEqual,H=A.areRegExpsEqual,ye=A.areSetsEqual,ze=A.createIsNestedEqual,we=ze(Ae);function Ae(y,v,w){if(y===v)return!0;if(!y||!v||typeof y!="object"||typeof v!="object")return y!==y&&v!==v;if(b(y)&&b(v))return ae(y,v,we,w);var q=Array.isArray(y),ne=Array.isArray(v);if(q||ne)return q===ne&&G(y,v,we,w);var $=t.call(y);return $!==t.call(v)?!1:$===P?Z(y,v,we,w):$===E?H(y,v,we,w):$===N?X(y,v,we,w):$===l?ye(y,v,we,w):$===p||$===j?O(y)||O(v)?!1:ae(y,v,we,w):$===R||$===I||$===e?m(y.valueOf(),v.valueOf()):!1}return Ae}function f(A,G,Z,X){var ae=A.length;if(G.length!==ae)return!1;for(;ae-- >0;)if(!Z(A[ae],G[ae],ae,ae,A,G,X))return!1;return!0}var a=h(f);function S(A,G){return m(A.valueOf(),G.valueOf())}function C(A,G,Z,X){var ae=A.size===G.size;if(!ae)return!1;if(!A.size)return!0;var H={},ye=0;return A.forEach(function(ze,we){if(ae){var Ae=!1,y=0;G.forEach(function(v,w){!Ae&&!H[y]&&(Ae=Z(we,w,ye,y,A,G,X)&&Z(ze,v,we,w,A,G,X))&&(H[y]=!0),y++}),ye++,ae=Ae}}),ae}var D=h(C),_="_owner",k=Object.prototype.hasOwnProperty;function W(A,G,Z,X){var ae=Object.keys(A),H=ae.length;if(Object.keys(G).length!==H)return!1;for(var ye;H-- >0;){if(ye=ae[H],ye===_){var ze=!!A.$$typeof,we=!!G.$$typeof;if((ze||we)&&ze!==we)return!1}if(!k.call(G,ye)||!Z(A[ye],G[ye],ye,ye,A,G,X))return!1}return!0}var U=h(W);function J(A,G){return A.source===G.source&&A.flags===G.flags}function re(A,G,Z,X){var ae=A.size===G.size;if(!ae)return!1;if(!A.size)return!0;var H={};return A.forEach(function(ye,ze){if(ae){var we=!1,Ae=0;G.forEach(function(y,v){!we&&!H[Ae]&&(we=Z(ye,y,ze,v,A,G,X))&&(H[Ae]=!0),Ae++}),ae=we}}),ae}var V=h(re),K=Object.freeze({areArraysEqual:f,areDatesEqual:S,areMapsEqual:C,areObjectsEqual:W,areRegExpsEqual:J,areSetsEqual:re,createIsNestedEqual:i}),Q=Object.freeze({areArraysEqual:a,areDatesEqual:S,areMapsEqual:D,areObjectsEqual:U,areRegExpsEqual:J,areSetsEqual:V,createIsNestedEqual:i}),te=c(K);function he(A,G){return te(A,G,void 0)}var ge=c(u(K,{createIsNestedEqual:function(){return m}}));function M(A,G){return ge(A,G,void 0)}var L=c(Q);function le(A,G){return L(A,G,new WeakMap)}var ie=c(u(Q,{createIsNestedEqual:function(){return m}}));function ce(A,G){return ie(A,G,new WeakMap)}function pe(A){return c(u(K,A(K)))}function ue(A){var G=c(u(Q,A(Q)));return(function(Z,X,ae){return ae===void 0&&(ae=new WeakMap),G(Z,X,ae)})}s.circularDeepEqual=le,s.circularShallowEqual=ce,s.createCustomCircularEqual=ue,s.createCustomEqual=pe,s.deepEqual=he,s.sameValueZeroEqual=m,s.shallowEqual=M,Object.defineProperty(s,"__esModule",{value:!0})}))})(ct,ct.exports)),ct.exports}var Rt={exports:{}},fr;function Ct(){if(fr)return Rt.exports;fr=1;function n(s){var i,h,u="";if(typeof s=="string"||typeof s=="number")u+=s;else if(typeof s=="object")if(Array.isArray(s)){var b=s.length;for(i=0;i<b;i++)s[i]&&(h=n(s[i]))&&(u&&(u+=" "),u+=h)}else for(h in s)s[h]&&(u&&(u+=" "),u+=h);return u}function o(){for(var s,i,h=0,u="",b=arguments.length;h<b;h++)(s=arguments[h])&&(i=n(s))&&(u&&(u+=" "),u+=i);return u}return Rt.exports=o,Rt.exports.clsx=o,Rt.exports}var xe={},Wt,pr;function Cn(){return pr||(pr=1,Wt=function(o,s,i){return o===s?!0:o.className===s.className&&i(o.style,s.style)&&o.width===s.width&&o.autoSize===s.autoSize&&o.cols===s.cols&&o.draggableCancel===s.draggableCancel&&o.draggableHandle===s.draggableHandle&&i(o.verticalCompact,s.verticalCompact)&&i(o.compactType,s.compactType)&&i(o.layout,s.layout)&&i(o.margin,s.margin)&&i(o.containerPadding,s.containerPadding)&&o.rowHeight===s.rowHeight&&o.maxRows===s.maxRows&&o.isBounded===s.isBounded&&o.isDraggable===s.isDraggable&&o.isResizable===s.isResizable&&o.allowOverlap===s.allowOverlap&&o.preventCollision===s.preventCollision&&o.useCSSTransforms===s.useCSSTransforms&&o.transformScale===s.transformScale&&o.isDroppable===s.isDroppable&&i(o.resizeHandles,s.resizeHandles)&&i(o.resizeHandle,s.resizeHandle)&&o.onLayoutChange===s.onLayoutChange&&o.onDragStart===s.onDragStart&&o.onDrag===s.onDrag&&o.onDragStop===s.onDragStop&&o.onResizeStart===s.onResizeStart&&o.onResize===s.onResize&&o.onResizeStop===s.onResizeStop&&o.onDrop===s.onDrop&&i(o.droppingItem,s.droppingItem)&&i(o.innerRef,s.innerRef)}),Wt}var hr;function Qe(){if(hr)return xe;hr=1;var n={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.bottom=R,xe.childrenEqual=p,xe.cloneLayout=P,xe.cloneLayoutItem=I,xe.collides=e,xe.compact=t,xe.compactItem=a,xe.compactType=ze,xe.correctBounds=S,xe.fastPositionEqual=l,xe.fastRGLPropsEqual=void 0,xe.getAllCollisions=_,xe.getFirstCollision=D,xe.getLayoutItem=C,xe.getStatics=k,xe.modifyLayout=E,xe.moveElement=W,xe.moveElementAwayFromCollision=U,xe.noop=void 0,xe.perc=J,xe.resizeItemInDirection=ue,xe.setTopLeft=G,xe.setTransform=A,xe.sortLayoutItems=Z,xe.sortLayoutItemsByColRow=ae,xe.sortLayoutItemsByRowCol=X,xe.synchronizeLayoutWithChildren=H,xe.validateLayout=ye,xe.withLayoutItem=N;var o=Nt(),s=i(oe);function i(y){return y&&y.__esModule?y:{default:y}}function h(y,v){var w=Object.keys(y);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(y);v&&(q=q.filter(function(ne){return Object.getOwnPropertyDescriptor(y,ne).enumerable})),w.push.apply(w,q)}return w}function u(y){for(var v=1;v<arguments.length;v++){var w=arguments[v]!=null?arguments[v]:{};v%2?h(Object(w),!0).forEach(function(q){b(y,q,w[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(w)):h(Object(w)).forEach(function(q){Object.defineProperty(y,q,Object.getOwnPropertyDescriptor(w,q))})}return y}function b(y,v,w){return(v=O(v))in y?Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}):y[v]=w,y}function O(y){var v=m(y,"string");return typeof v=="symbol"?v:v+""}function m(y,v){if(typeof y!="object"||!y)return y;var w=y[Symbol.toPrimitive];if(w!==void 0){var q=w.call(y,v);if(typeof q!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(y)}const j=n.NODE_ENV==="production";function R(y){let v=0,w;for(let q=0,ne=y.length;q<ne;q++)w=y[q].y+y[q].h,w>v&&(v=w);return v}function P(y){const v=Array(y.length);for(let w=0,q=y.length;w<q;w++)v[w]=I(y[w]);return v}function E(y,v){const w=Array(y.length);for(let q=0,ne=y.length;q<ne;q++)v.i===y[q].i?w[q]=v:w[q]=y[q];return w}function N(y,v,w){let q=C(y,v);return q?(q=w(I(q)),y=E(y,q),[y,q]):[y,null]}function I(y){return{w:y.w,h:y.h,x:y.x,y:y.y,i:y.i,minW:y.minW,maxW:y.maxW,minH:y.minH,maxH:y.maxH,moved:!!y.moved,static:!!y.static,isDraggable:y.isDraggable,isResizable:y.isResizable,resizeHandles:y.resizeHandles,isBounded:y.isBounded}}function p(y,v){return(0,o.deepEqual)(s.default.Children.map(y,w=>w==null?void 0:w.key),s.default.Children.map(v,w=>w==null?void 0:w.key))&&(0,o.deepEqual)(s.default.Children.map(y,w=>w==null?void 0:w.props["data-grid"]),s.default.Children.map(v,w=>w==null?void 0:w.props["data-grid"]))}xe.fastRGLPropsEqual=Cn();function l(y,v){return y.left===v.left&&y.top===v.top&&y.width===v.width&&y.height===v.height}function e(y,v){return!(y.i===v.i||y.x+y.w<=v.x||y.x>=v.x+v.w||y.y+y.h<=v.y||y.y>=v.y+v.h)}function t(y,v,w,q){const ne=k(y);let $=R(ne);const se=Z(y,v),me=Array(y.length);for(let je=0,d=se.length;je<d;je++){let x=I(se[je]);x.static||(x=a(ne,x,v,w,se,q,$),$=Math.max($,x.y+x.h),ne.push(x)),me[y.indexOf(se[je])]=x,x.moved=!1}return me}const c={x:"w",y:"h"};function f(y,v,w,q){const ne=c[q];v[q]+=1;const $=y.map(se=>se.i).indexOf(v.i);for(let se=$+1;se<y.length;se++){const me=y[se];if(!me.static){if(me.y>v.y+v.h)break;e(v,me)&&f(y,me,w+v[ne],q)}}v[q]=w}function a(y,v,w,q,ne,$,se){const me=w==="vertical",je=w==="horizontal";if(me)for(typeof se=="number"?v.y=Math.min(se,v.y):v.y=Math.min(R(y),v.y);v.y>0&&!D(y,v);)v.y--;else if(je)for(;v.x>0&&!D(y,v);)v.x--;let d;for(;(d=D(y,v))&&!(w===null&&$);)if(je?f(ne,v,d.x+d.w,"x"):f(ne,v,d.y+d.h,"y"),je&&v.x+v.w>q)for(v.x=q-v.w,v.y++;v.x>0&&!D(y,v);)v.x--;return v.y=Math.max(v.y,0),v.x=Math.max(v.x,0),v}function S(y,v){const w=k(y);for(let q=0,ne=y.length;q<ne;q++){const $=y[q];if($.x+$.w>v.cols&&($.x=v.cols-$.w),$.x<0&&($.x=0,$.w=v.cols),!$.static)w.push($);else for(;D(w,$);)$.y++}return y}function C(y,v){for(let w=0,q=y.length;w<q;w++)if(y[w].i===v)return y[w]}function D(y,v){for(let w=0,q=y.length;w<q;w++)if(e(y[w],v))return y[w]}function _(y,v){return y.filter(w=>e(w,v))}function k(y){return y.filter(v=>v.static)}function W(y,v,w,q,ne,$,se,me,je){if(v.static&&v.isDraggable!==!0||v.y===q&&v.x===w)return y;"Moving element ".concat(v.i," to [").concat(String(w),",").concat(String(q),"] from [").concat(v.x,",").concat(v.y,"]");const d=v.x,x=v.y;typeof w=="number"&&(v.x=w),typeof q=="number"&&(v.y=q),v.moved=!0;let z=Z(y,se);(se==="vertical"&&typeof q=="number"?x>=q:se==="horizontal"&&typeof w=="number"?d>=w:!1)&&(z=z.reverse());const Y=_(z,v),_e=Y.length>0;if(_e&&je)return P(y);if(_e&&$)return"Collision prevented on ".concat(v.i,", reverting."),v.x=d,v.y=x,v.moved=!1,y;for(let ve=0,De=Y.length;ve<De;ve++){const Me=Y[ve];"Resolving collision between ".concat(v.i," at [").concat(v.x,",").concat(v.y,"] and ").concat(Me.i," at [").concat(Me.x,",").concat(Me.y,"]"),!Me.moved&&(Me.static?y=U(y,Me,v,ne,se):y=U(y,v,Me,ne,se))}return y}function U(y,v,w,q,ne,$){const se=ne==="horizontal",me=ne==="vertical",je=v.static;if(q){q=!1;const z={x:se?Math.max(v.x-w.w,0):w.x,y:me?Math.max(v.y-w.h,0):w.y,w:w.w,h:w.h,i:"-1"},F=D(y,z),Y=F&&F.y+F.h>v.y,_e=F&&v.x+v.w>F.x;if(F){if(Y&&me)return W(y,w,void 0,w.y+1,q,je,ne);if(Y&&ne==null)return v.y=w.y,w.y=w.y+w.h,y;if(_e&&se)return W(y,v,w.x,void 0,q,je,ne)}else return"Doing reverse collision on ".concat(w.i," up to [").concat(z.x,",").concat(z.y,"]."),W(y,w,se?z.x:void 0,me?z.y:void 0,q,je,ne)}const d=se?w.x+1:void 0,x=me?w.y+1:void 0;return d==null&&x==null?y:W(y,w,se?w.x+1:void 0,me?w.y+1:void 0,q,je,ne)}function J(y){return y*100+"%"}const re=(y,v,w,q)=>y+w>q?v:w,V=(y,v,w)=>y<0?v:w,K=y=>Math.max(0,y),Q=y=>Math.max(0,y),te=(y,v,w)=>{let{left:q,height:ne,width:$}=v;const se=y.top-(ne-y.height);return{left:q,width:$,height:V(se,y.height,ne),top:Q(se)}},he=(y,v,w)=>{let{top:q,left:ne,height:$,width:se}=v;return{top:q,height:$,width:re(y.left,y.width,se,w),left:K(ne)}},ge=(y,v,w)=>{let{top:q,height:ne,width:$}=v;const se=y.left-($-y.width);return{height:ne,width:se<0?y.width:re(y.left,y.width,$,w),top:Q(q),left:K(se)}},M=(y,v,w)=>{let{top:q,left:ne,height:$,width:se}=v;return{width:se,left:ne,height:V(q,y.height,$),top:Q(q)}},pe={n:te,ne:function(){return te(arguments.length<=0?void 0:arguments[0],he(...arguments))},e:he,se:function(){return M(arguments.length<=0?void 0:arguments[0],he(...arguments))},s:M,sw:function(){return M(arguments.length<=0?void 0:arguments[0],ge(...arguments))},w:ge,nw:function(){return te(arguments.length<=0?void 0:arguments[0],ge(...arguments))}};function ue(y,v,w,q){const ne=pe[y];return ne?ne(v,u(u({},v),w),q):w}function A(y){let{top:v,left:w,width:q,height:ne}=y;const $="translate(".concat(w,"px,").concat(v,"px)");return{transform:$,WebkitTransform:$,MozTransform:$,msTransform:$,OTransform:$,width:"".concat(q,"px"),height:"".concat(ne,"px"),position:"absolute"}}function G(y){let{top:v,left:w,width:q,height:ne}=y;return{top:"".concat(v,"px"),left:"".concat(w,"px"),width:"".concat(q,"px"),height:"".concat(ne,"px"),position:"absolute"}}function Z(y,v){return v==="horizontal"?ae(y):v==="vertical"?X(y):y}function X(y){return y.slice(0).sort(function(v,w){return v.y>w.y||v.y===w.y&&v.x>w.x?1:v.y===w.y&&v.x===w.x?0:-1})}function ae(y){return y.slice(0).sort(function(v,w){return v.x>w.x||v.x===w.x&&v.y>w.y?1:-1})}function H(y,v,w,q,ne){y=y||[];const $=[];s.default.Children.forEach(v,me=>{if((me==null?void 0:me.key)==null)return;const je=C(y,String(me.key)),d=me.props["data-grid"];je&&d==null?$.push(I(je)):d?(j||ye([d],"ReactGridLayout.children"),$.push(I(u(u({},d),{},{i:me.key})))):$.push(I({w:1,h:1,x:0,y:R($),i:String(me.key)}))});const se=S($,{cols:w});return ne?se:t(se,q,w)}function ye(y){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const w=["x","y","w","h"];if(!Array.isArray(y))throw new Error(v+" must be an array!");for(let q=0,ne=y.length;q<ne;q++){const $=y[q];for(let se=0;se<w.length;se++){const me=w[se],je=$[me];if(typeof je!="number"||Number.isNaN(je))throw new Error("ReactGridLayout: ".concat(v,"[").concat(q,"].").concat(me," must be a number! Received: ").concat(je," (").concat(typeof je,")"))}if(typeof $.i<"u"&&typeof $.i!="string")throw new Error("ReactGridLayout: ".concat(v,"[").concat(q,"].i must be a string! Received: ").concat($.i," (").concat(typeof $.i,")"))}}function ze(y){const{verticalCompact:v,compactType:w}=y||{};return v===!1?null:w}function we(){}const Ae=()=>{};return xe.noop=Ae,xe}var Fe={},gr;function Ht(){if(gr)return Fe;gr=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.calcGridColWidth=n,Fe.calcGridItemPosition=s,Fe.calcGridItemWHPx=o,Fe.calcWH=h,Fe.calcXY=i,Fe.clamp=u;function n(b){const{margin:O,containerPadding:m,containerWidth:j,cols:R}=b;return(j-O[0]*(R-1)-m[0]*2)/R}function o(b,O,m){return Number.isFinite(b)?Math.round(O*b+Math.max(0,b-1)*m):b}function s(b,O,m,j,R,P){const{margin:E,containerPadding:N,rowHeight:I}=b,p=n(b),l={};return P&&P.resizing?(l.width=Math.round(P.resizing.width),l.height=Math.round(P.resizing.height)):(l.width=o(j,p,E[0]),l.height=o(R,I,E[1])),P&&P.dragging?(l.top=Math.round(P.dragging.top),l.left=Math.round(P.dragging.left)):P&&P.resizing&&typeof P.resizing.top=="number"&&typeof P.resizing.left=="number"?(l.top=Math.round(P.resizing.top),l.left=Math.round(P.resizing.left)):(l.top=Math.round((I+E[1])*m+N[1]),l.left=Math.round((p+E[0])*O+N[0])),l}function i(b,O,m,j,R){const{margin:P,containerPadding:E,cols:N,rowHeight:I,maxRows:p}=b,l=n(b);let e=Math.round((m-E[0])/(l+P[0])),t=Math.round((O-E[1])/(I+P[1]));return e=u(e,0,N-j),t=u(t,0,p-R),{x:e,y:t}}function h(b,O,m,j,R,P){const{margin:E,maxRows:N,cols:I,rowHeight:p}=b,l=n(b);let e=Math.round((O+E[0])/(l+E[0])),t=Math.round((m+E[1])/(p+E[1])),c=u(e,0,I-j),f=u(t,0,N-R);return["sw","w","nw"].indexOf(P)!==-1&&(c=u(e,0,I)),["nw","n","ne"].indexOf(P)!==-1&&(f=u(t,0,N)),{w:c,h:f}}function u(b,O,m){return Math.max(Math.min(b,m),O)}return Fe}var ut={},_t={exports:{}},Et={exports:{}},Re={};/** @license React v16.13.1
|
|
30
|
+
<%s key={someKey} {...props} />`,rr,Je,Oo,Je),ln[Je+rr]=!0}}return h===c?xo(Ne):bo(Ne),Ne}}function wo(h,F,te){return cn(h,F,te,!0)}function So(h,F,te){return cn(h,F,te,!1)}var jo=So,Co=wo;st.Fragment=c,st.jsx=jo,st.jsxs=Co})(),st}var sr;function gn(){if(sr)return vt.exports;sr=1;var n={};return n.NODE_ENV==="production"?vt.exports=pn():vt.exports=hn(),vt.exports}var e=gn();const bt={A4:{width:210,height:297},A3:{width:297,height:420},A5:{width:148,height:210},Letter:{width:215.9,height:279.4},Legal:{width:215.9,height:355.6}},ar={paperSize:"A4",customWidth:210,customHeight:297,orientation:"portrait",marginTop:10,marginRight:10,marginBottom:10,marginLeft:10,showHeader:!1,headerContent:"页眉文字",showFooter:!1,footerContent:"页脚文字",showPageNumber:!0,pageNumberFormat:"第 {page} 页"},De=3,xt={cellSize:1,cols:100},lr={text:"文本",image:"图片",table:"表格",barcode:"条形码",qrcode:"二维码",line:"分割线"},yn={text:{content:"双击编辑文字",fontSize:14,fontWeight:"normal",fontStyle:"normal",textAlign:"left",color:"#000000",backgroundColor:"transparent",format:""},image:{src:"",fit:"contain",content:""},table:{rows:3,cols:3,borderWidth:1,borderColor:"#000000",headerBackgroundColor:"#f5f5f5",headerColor:"#000000",headerFontSize:12,content:""},barcode:{value:"1234567890",format:"CODE128",content:""},qrcode:{value:"https://example.com",errorLevel:"M",color:"#000000",backgroundColor:"#ffffff",content:""},line:{color:"#000000",thickness:1,style:"solid",content:""}};let At=0,Lt=0;function cr(){return`comp_${++At}`}function ur(){return`ds_${++Lt}`}const pe=un.create((n,i)=>({components:[],selectedId:null,pageSettings:{...ar},gridSettings:{...xt},previewVisible:!1,templateName:"未命名模板",headerFooterVisible:!1,dataSources:[],activeDataSourceId:null,addComponent:(o,a,c)=>{const u=cr(),x=lr[o]||o,_={...yn[o]||{}};o==="text"&&(_.content=x);const b={id:u,type:o,x:a??0,y:c??0,w:o==="line"?20:o==="qrcode"?12:15,h:o==="line"?1:o==="qrcode"?12:8,props:_,...o==="table"?{tableColumns:[{title:"列1"},{title:"列2"},{title:"列3"}]}:{}};n(v=>({components:[...v.components,b],selectedId:u}))},updateComponent:(o,a)=>{n(c=>({components:c.components.map(u=>u.id===o?{...u,...a}:u)}))},selectComponent:o=>{n({selectedId:o})},removeComponent:o=>{n(a=>({components:a.components.filter(c=>c.id!==o),selectedId:a.selectedId===o?null:a.selectedId}))},setComponents:o=>{n({components:o})},setPageSettings:o=>{n(a=>({pageSettings:{...a.pageSettings,...o}}))},setPreviewVisible:o=>{n({previewVisible:o})},setTemplateName:o=>{n({templateName:o})},setHeaderFooterVisible:o=>{n({headerFooterVisible:o})},addDataSource:(o,a,c)=>{const x={id:ur(),name:o,type:a,data:c,createdAt:Date.now()};n(_=>({dataSources:[..._.dataSources,x]}))},updateDataSource:(o,a)=>{n(c=>({dataSources:c.dataSources.map(u=>u.id===o?{...u,...a}:u)}))},removeDataSource:o=>{n(a=>({dataSources:a.dataSources.filter(c=>c.id!==o),activeDataSourceId:a.activeDataSourceId===o?null:a.activeDataSourceId}))},setActiveDataSourceId:o=>{n({activeDataSourceId:o})},updateComponentTableColumns:(o,a)=>{n(c=>({components:c.components.map(u=>u.id===o?{...u,tableColumns:a}:u)}))},exportJSON:()=>{const o=i(),a={version:"1.0",templateName:o.templateName,pageSettings:o.pageSettings,components:o.components.map(({id:c,...u})=>u),dataSources:o.dataSources.map(({id:c,...u})=>u)};return JSON.stringify(a,null,2)},importJSON:o=>{try{const a=JSON.parse(o);if(!a.version||!a.pageSettings||!Array.isArray(a.components))return"JSON 格式不正确,缺少必要字段";At=0,Lt=0;const c=a.components.map(x=>({...x,id:cr()})),u=(a.dataSources||[]).map(x=>({...x,id:ur()}));return n({components:c,dataSources:u,pageSettings:a.pageSettings,templateName:a.templateName||"导入的模板",selectedId:null,activeDataSourceId:null}),null}catch{return"JSON 解析失败,请检查文件内容"}},reset:()=>{At=0,Lt=0,n({components:[],selectedId:null,pageSettings:{...ar},gridSettings:{...xt},templateName:"未命名模板",headerFooterVisible:!1,previewVisible:!1,dataSources:[],activeDataSourceId:null})}})),{Text:_o}=E.Typography,mn=({onCustomSave:n,onCustomPrint:i})=>{const o=pe(t=>t.templateName),a=pe(t=>t.setTemplateName),c=pe(t=>t.setPreviewVisible),u=pe(t=>t.setHeaderFooterVisible),x=pe(t=>t.selectedId),_=pe(t=>t.removeComponent),b=pe(t=>t.exportJSON),v=pe(t=>t.importJSON),R=pe(t=>t.reset),P=se.useRef(null),{message:C}=E.App.useApp(),L=se.useCallback(()=>{x&&_(x)},[x,_]),k=se.useCallback(()=>{const t=b(),s=new Blob([t],{type:"application/json"}),f=URL.createObjectURL(s),l=document.createElement("a");l.href=f,l.download=`${o||"模板"}.json`,l.click(),URL.revokeObjectURL(f),C.success("模板已导出")},[b,o,C]),y=se.useCallback(()=>{var t;(t=P.current)==null||t.click()},[]),d=se.useCallback(t=>{var l;const s=(l=t.target.files)==null?void 0:l[0];if(!s)return;const f=new FileReader;f.onload=()=>{const w=v(f.result);w?C.error(w):C.success("模板已导入")},f.readAsText(s),t.target.value=""},[v,C]),r=se.useCallback(()=>{R(),C.info("已新建空白模板")},[R,C]);return e.jsxs("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:[e.jsx(E.Space,{children:e.jsx(E.Input,{value:o,onChange:t=>a(t.target.value),variant:"borderless",style:{width:200,fontSize:16,fontWeight:600},placeholder:"模板名称"})}),e.jsxs(E.Space,{children:[e.jsx(E.Button,{icon:e.jsx(Oe.PlusOutlined,{}),onClick:r,children:"新建"}),e.jsx("input",{ref:P,type:"file",accept:".json",style:{display:"none"},onChange:d}),n?e.jsx(E.Button,{icon:e.jsx(Oe.SaveOutlined,{}),onClick:n,type:"primary",children:"保存"}):e.jsx(E.Button,{icon:e.jsx(Oe.DownloadOutlined,{}),onClick:k,children:"导出"}),e.jsx(E.Button,{icon:e.jsx(Oe.UploadOutlined,{}),onClick:y,children:"导入"}),e.jsx(E.Button,{icon:e.jsx(Oe.SettingOutlined,{}),onClick:()=>u(!0),children:"页眉页脚"}),e.jsx(E.Button,{danger:!0,icon:e.jsx(Oe.DeleteOutlined,{}),disabled:!x,onClick:L,children:"删除"}),i?e.jsx(E.Button,{type:"primary",icon:e.jsx(Oe.PrinterOutlined,{}),onClick:i,children:"打印"}):e.jsx(E.Button,{type:"primary",icon:e.jsx(Oe.EyeOutlined,{}),onClick:()=>c(!0),children:"预览"})]})]})},{Text:qe}=E.Typography,vn=()=>{const n=pe(u=>u.pageSettings),i=pe(u=>u.setPageSettings),o=n.paperSize==="custom",a=se.useCallback(u=>{i({paperSize:u})},[i]),c=se.useCallback(u=>{i({orientation:u})},[i]);return e.jsx(E.Card,{title:"页面设置",size:"small",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:12},children:"纸张大小"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:n.paperSize,onChange:a,options:[...Object.keys(bt).map(u=>({value:u,label:u})),{value:"custom",label:"自定义"}]})]}),o&&e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(qe,{style:{fontSize:12},children:"宽度 (mm)"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:n.customWidth,min:10,max:2e3,onChange:u=>i({customWidth:u??210})})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(qe,{style:{fontSize:12},children:"高度 (mm)"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:n.customHeight,min:10,max:2e3,onChange:u=>i({customHeight:u??297})})]})]}),e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:12},children:"方向"}),e.jsxs(E.Radio.Group,{value:n.orientation,onChange:u=>c(u.target.value),size:"small",style:{width:"100%",display:"flex"},children:[e.jsx(E.Radio.Button,{value:"portrait",style:{flex:1,textAlign:"center"},children:"纵向"}),e.jsx(E.Radio.Button,{value:"landscape",style:{flex:1,textAlign:"center"},children:"横向"})]})]}),e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:12},children:"页边距 (mm)"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:11},children:"上"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:n.marginTop,min:0,max:100,onChange:u=>i({marginTop:u??10})})]}),e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:11},children:"右"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:n.marginRight,min:0,max:100,onChange:u=>i({marginRight:u??10})})]}),e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:11},children:"下"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:n.marginBottom,min:0,max:100,onChange:u=>i({marginBottom:u??10})})]}),e.jsxs("div",{children:[e.jsx(qe,{style:{fontSize:11},children:"左"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:n.marginLeft,min:0,max:100,onChange:u=>i({marginLeft:u??10})})]})]})]})]})})},{Text:bn}=E.Typography,xn=[{type:"text",icon:e.jsx(Oe.FontSizeOutlined,{}),label:"文本"},{type:"image",icon:e.jsx(Oe.PictureOutlined,{}),label:"图片"},{type:"table",icon:e.jsx(Oe.TableOutlined,{}),label:"表格"},{type:"barcode",icon:e.jsx(Oe.BarcodeOutlined,{}),label:"条形码"},{type:"qrcode",icon:e.jsx(Oe.QrcodeOutlined,{}),label:"二维码"},{type:"line",icon:e.jsx(Oe.MinusOutlined,{}),label:"分割线"}],wn=()=>{const n=pe(a=>a.addComponent),i=se.useCallback((a,c)=>{a.dataTransfer.setData("componentType",c),a.dataTransfer.effectAllowed="copy"},[]),o=se.useCallback(a=>{n(a)},[n]);return e.jsx(E.Card,{title:"组件面板",size:"small",children:e.jsx(E.Space,{direction:"vertical",style:{width:"100%"},size:4,children:xn.map(a=>e.jsxs("div",{draggable:!0,onDragStart:c=>i(c,a.type),onClick:()=>o(a.type),style:{cursor:"grab",padding:"8px 12px",border:"1px solid #d9d9d9",borderRadius:6,display:"flex",alignItems:"center",gap:8,background:"#fafafa",userSelect:"none",transition:"all 0.2s"},onMouseEnter:c=>{c.currentTarget.style.background="#e6f4ff",c.currentTarget.style.borderColor="#1677ff"},onMouseLeave:c=>{c.currentTarget.style.background="#fafafa",c.currentTarget.style.borderColor="#d9d9d9"},children:[a.icon,e.jsx(bn,{children:a.label})]},a.type))})})};function at(n){try{return JSON.parse(n)}catch{return null}}function Ke(n,i,o){const a=`${i}Binding`,c=n.props[a];if(c&&c.dataSourceId&&c.fieldPath){const x=o.find(_=>_.id===c.dataSourceId);if(x){const _=jt(x);if(_){const b=St(_,c.fieldPath);if(b)return b}}}return n.props[i]||(c==null?void 0:c.staticValue)||""}function wt(n,i){if(!i||!n)return n;const o=Sn(n);if(!o)return n;const a=(u,x=2)=>String(u).padStart(x,"0"),c={yyyy:String(o.getFullYear()),yy:String(o.getFullYear()).slice(-2),MM:a(o.getMonth()+1),M:String(o.getMonth()+1),dd:a(o.getDate()),d:String(o.getDate()),HH:a(o.getHours()),H:String(o.getHours()),mm:a(o.getMinutes()),m:String(o.getMinutes()),ss:a(o.getSeconds()),s:String(o.getSeconds())};return i.replace(/yyyy|yy|MM|M|dd|d|HH|H|mm|m|ss|s/g,u=>c[u])}function Sn(n){const i=n.trim();if(!i)return null;if(/^\d{8}$/.test(i)){const a=Number(i.slice(0,4)),c=Number(i.slice(4,6)),u=Number(i.slice(6,8));return jn(a,c,u)}const o=new Date(i);return Number.isNaN(o.getTime())?null:o}function jn(n,i,o){const a=new Date(n,i-1,o);return a.getFullYear()!==n||a.getMonth()!==i-1||a.getDate()!==o?null:a}function St(n,i){if(!n||!i)return"";try{const o=i.split(".");let a=n;for(const c of o){if(typeof a!="object"||a===null)return"";a=a[c]}return a!=null?String(a):""}catch{return""}}function jt(n){const i=at(n.data);return n.type==="object"&&i&&typeof i=="object"&&!Array.isArray(i)?i:null}function Ct(n){const i=at(n.data);return n.type==="array"&&Array.isArray(i)?i:null}const{TextArea:Cn}=E.Input,{Text:Ot,Title:Eo}=E.Typography,dr=JSON.stringify({name:"张三",age:28,department:"技术部",email:"zhangsan@example.com"},null,2),On=JSON.stringify([{id:1,product:"商品A",quantity:2,price:100},{id:2,product:"商品B",quantity:5,price:80},{id:3,product:"商品C",quantity:1,price:200}],null,2),Rn=()=>{const n=pe(C=>C.dataSources),i=pe(C=>C.addDataSource),o=pe(C=>C.updateDataSource),a=pe(C=>C.removeDataSource),[c,u]=se.useState(!1),[x,_]=se.useState(null),[b,v]=se.useState({name:"",type:"object",data:""}),R=C=>{C?(_(C.id),v({name:C.name,type:C.type,data:C.data})):(_(null),v({name:"新数据源",type:"object",data:dr})),u(!0)},P=()=>{const C=at(b.data);if(C===null){E.message.error("JSON 格式不正确");return}if(b.type==="object"&&(Array.isArray(C)||typeof C!="object")){E.message.error("对象类型数据源必须为对象格式");return}if(b.type==="array"&&!Array.isArray(C)){E.message.error("数组类型数据源必须为数组格式");return}x?(o(x,b),E.message.success("数据源已更新")):(i(b.name,b.type,b.data),E.message.success("数据源已添加")),u(!1)};return e.jsxs(E.Card,{title:"数据源",size:"small",extra:e.jsx(E.Button,{type:"link",size:"small",icon:e.jsx(Oe.PlusOutlined,{}),onClick:()=>R(),children:"添加"}),children:[e.jsx(E.List,{size:"small",dataSource:n,locale:{emptyText:"暂无数据源"},renderItem:C=>e.jsx(E.List.Item,{actions:[e.jsx(E.Dropdown,{menu:{items:[{key:"edit",label:"编辑",icon:e.jsx(Oe.EditOutlined,{}),onClick:()=>R(C)},{type:"divider"},{key:"delete",label:e.jsx(E.Popconfirm,{title:"确定要删除这个数据源吗?",onConfirm:L=>{L==null||L.stopPropagation(),a(C.id),E.message.success("已删除")},okText:"确定",cancelText:"取消",onCancel:L=>L==null?void 0:L.stopPropagation(),children:e.jsx("span",{style:{color:"#ff4d4f",cursor:"pointer"},children:"删除"})}),icon:e.jsx(Oe.DeleteOutlined,{style:{color:"#ff4d4f"}})}]},placement:"bottomRight",children:e.jsx(E.Button,{type:"text",size:"small",icon:e.jsx(Oe.MoreOutlined,{})})})],children:e.jsx(E.List.Item.Meta,{avatar:e.jsx(Oe.DatabaseOutlined,{}),title:e.jsx(Ot,{ellipsis:!0,strong:!0,children:C.name}),description:e.jsx(E.Space,{size:4,children:e.jsx(E.Tag,{color:C.type==="object"?"blue":"green",children:C.type==="object"?"对象":"数组"})})})})}),e.jsx(E.Modal,{title:x?"编辑数据源":"添加数据源",open:c,onOk:P,onCancel:()=>u(!1),okText:"保存",cancelText:"取消",children:e.jsxs(E.Space,{direction:"vertical",style:{width:"100%"},size:"middle",children:[e.jsxs("div",{children:[e.jsx(Ot,{strong:!0,style:{display:"block",marginBottom:4},children:"名称"}),e.jsx(E.Input,{placeholder:"请输入数据源名称",value:b.name,onChange:C=>v({...b,name:C.target.value})})]}),e.jsxs("div",{children:[e.jsx(Ot,{strong:!0,style:{display:"block",marginBottom:4},children:"类型"}),e.jsx(E.Select,{options:[{label:"对象",value:"object"},{label:"数组",value:"array"}],style:{width:"100%"},value:b.type,onChange:C=>{v({...b,type:C,data:C==="object"?dr:On})}})]}),e.jsx(E.Divider,{style:{margin:"8px 0"}}),e.jsxs("div",{children:[e.jsx(Ot,{strong:!0,style:{display:"block",marginBottom:4},children:"JSON 数据"}),e.jsx(Cn,{rows:12,placeholder:"请输入 JSON 数据",value:b.data,onChange:C=>v({...b,data:C.target.value})})]})]})})]})},_n=()=>e.jsx(E.Collapse,{bordered:!1,accordion:!0,defaultActiveKey:["1"],expandIcon:({isActive:n})=>e.jsx(Oe.CaretRightOutlined,{rotate:n?90:0}),style:{height:"100%",overflowY:"auto"},items:[{key:"1",label:"页面设置",children:e.jsx(vn,{})},{key:"2",label:"组件",children:e.jsx(wn,{})},{key:"3",label:"数据源",children:e.jsx(Rn,{})}]});var Nt={exports:{}},lt={},ct={exports:{}},En=ct.exports,fr;function Wt(){return fr||(fr=1,(function(n,i){(function(o,a){a(i)})(En,(function(o){function a(A){return function(ee,Z,ce,B,he,ke,we){return A(ee,Z,we)}}function c(A){return function(ee,Z,ce,B){if(!ee||!Z||typeof ee!="object"||typeof Z!="object")return A(ee,Z,ce,B);var he=B.get(ee),ke=B.get(Z);if(he&&ke)return he===Z&&ke===ee;B.set(ee,Z),B.set(Z,ee);var we=A(ee,Z,ce,B);return B.delete(ee),B.delete(Z),we}}function u(A,U){var ee={};for(var Z in A)ee[Z]=A[Z];for(var Z in U)ee[Z]=U[Z];return ee}function x(A){return A.constructor===Object||A.constructor==null}function _(A){return typeof A.then=="function"}function b(A,U){return A===U||A!==A&&U!==U}var v="[object Arguments]",R="[object Boolean]",P="[object Date]",C="[object RegExp]",L="[object Map]",k="[object Number]",y="[object Object]",d="[object Set]",r="[object String]",t=Object.prototype.toString;function s(A){var U=A.areArraysEqual,ee=A.areDatesEqual,Z=A.areMapsEqual,ce=A.areObjectsEqual,B=A.areRegExpsEqual,he=A.areSetsEqual,ke=A.createIsNestedEqual,we=ke(Le);function Le(g,m,j){if(g===m)return!0;if(!g||!m||typeof g!="object"||typeof m!="object")return g!==g&&m!==m;if(x(g)&&x(m))return ce(g,m,we,j);var q=Array.isArray(g),ne=Array.isArray(m);if(q||ne)return q===ne&&U(g,m,we,j);var Q=t.call(g);return Q!==t.call(m)?!1:Q===P?ee(g,m,we,j):Q===C?B(g,m,we,j):Q===L?Z(g,m,we,j):Q===d?he(g,m,we,j):Q===y||Q===v?_(g)||_(m)?!1:ce(g,m,we,j):Q===R||Q===k||Q===r?b(g.valueOf(),m.valueOf()):!1}return Le}function f(A,U,ee,Z){var ce=A.length;if(U.length!==ce)return!1;for(;ce-- >0;)if(!ee(A[ce],U[ce],ce,ce,A,U,Z))return!1;return!0}var l=c(f);function w(A,U){return b(A.valueOf(),U.valueOf())}function O(A,U,ee,Z){var ce=A.size===U.size;if(!ce)return!1;if(!A.size)return!0;var B={},he=0;return A.forEach(function(ke,we){if(ce){var Le=!1,g=0;U.forEach(function(m,j){!Le&&!B[g]&&(Le=ee(we,j,he,g,A,U,Z)&&ee(ke,m,we,j,A,U,Z))&&(B[g]=!0),g++}),he++,ce=Le}}),ce}var D=c(O),M="_owner",H=Object.prototype.hasOwnProperty;function T(A,U,ee,Z){var ce=Object.keys(A),B=ce.length;if(Object.keys(U).length!==B)return!1;for(var he;B-- >0;){if(he=ce[B],he===M){var ke=!!A.$$typeof,we=!!U.$$typeof;if((ke||we)&&ke!==we)return!1}if(!H.call(U,he)||!ee(A[he],U[he],he,he,A,U,Z))return!1}return!0}var N=c(T);function G(A,U){return A.source===U.source&&A.flags===U.flags}function X(A,U,ee,Z){var ce=A.size===U.size;if(!ce)return!1;if(!A.size)return!0;var B={};return A.forEach(function(he,ke){if(ce){var we=!1,Le=0;U.forEach(function(g,m){!we&&!B[Le]&&(we=ee(he,g,ke,m,A,U,Z))&&(B[Le]=!0),Le++}),ce=we}}),ce}var V=c(X),J=Object.freeze({areArraysEqual:f,areDatesEqual:w,areMapsEqual:O,areObjectsEqual:T,areRegExpsEqual:G,areSetsEqual:X,createIsNestedEqual:a}),K=Object.freeze({areArraysEqual:l,areDatesEqual:w,areMapsEqual:D,areObjectsEqual:N,areRegExpsEqual:G,areSetsEqual:V,createIsNestedEqual:a}),re=s(J);function be(A,U){return re(A,U,void 0)}var ge=s(u(J,{createIsNestedEqual:function(){return b}}));function I(A,U){return ge(A,U,void 0)}var W=s(K);function ie(A,U){return W(A,U,new WeakMap)}var oe=s(u(K,{createIsNestedEqual:function(){return b}}));function ae(A,U){return oe(A,U,new WeakMap)}function fe(A){return s(u(J,A(J)))}function ue(A){var U=s(u(K,A(K)));return(function(ee,Z,ce){return ce===void 0&&(ce=new WeakMap),U(ee,Z,ce)})}o.circularDeepEqual=ie,o.circularShallowEqual=ae,o.createCustomCircularEqual=ue,o.createCustomEqual=fe,o.deepEqual=be,o.sameValueZeroEqual=b,o.shallowEqual=I,Object.defineProperty(o,"__esModule",{value:!0})}))})(ct,ct.exports)),ct.exports}var Rt={exports:{}},pr;function _t(){if(pr)return Rt.exports;pr=1;function n(o){var a,c,u="";if(typeof o=="string"||typeof o=="number")u+=o;else if(typeof o=="object")if(Array.isArray(o)){var x=o.length;for(a=0;a<x;a++)o[a]&&(c=n(o[a]))&&(u&&(u+=" "),u+=c)}else for(c in o)o[c]&&(u&&(u+=" "),u+=c);return u}function i(){for(var o,a,c=0,u="",x=arguments.length;c<x;c++)(o=arguments[c])&&(a=n(o))&&(u&&(u+=" "),u+=a);return u}return Rt.exports=i,Rt.exports.clsx=i,Rt.exports}var xe={},Ht,hr;function Pn(){return hr||(hr=1,Ht=function(i,o,a){return i===o?!0:i.className===o.className&&a(i.style,o.style)&&i.width===o.width&&i.autoSize===o.autoSize&&i.cols===o.cols&&i.draggableCancel===o.draggableCancel&&i.draggableHandle===o.draggableHandle&&a(i.verticalCompact,o.verticalCompact)&&a(i.compactType,o.compactType)&&a(i.layout,o.layout)&&a(i.margin,o.margin)&&a(i.containerPadding,o.containerPadding)&&i.rowHeight===o.rowHeight&&i.maxRows===o.maxRows&&i.isBounded===o.isBounded&&i.isDraggable===o.isDraggable&&i.isResizable===o.isResizable&&i.allowOverlap===o.allowOverlap&&i.preventCollision===o.preventCollision&&i.useCSSTransforms===o.useCSSTransforms&&i.transformScale===o.transformScale&&i.isDroppable===o.isDroppable&&a(i.resizeHandles,o.resizeHandles)&&a(i.resizeHandle,o.resizeHandle)&&i.onLayoutChange===o.onLayoutChange&&i.onDragStart===o.onDragStart&&i.onDrag===o.onDrag&&i.onDragStop===o.onDragStop&&i.onResizeStart===o.onResizeStart&&i.onResize===o.onResize&&i.onResizeStop===o.onResizeStop&&i.onDrop===o.onDrop&&a(i.droppingItem,o.droppingItem)&&a(i.innerRef,o.innerRef)}),Ht}var gr;function Qe(){if(gr)return xe;gr=1;var n={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.bottom=R,xe.childrenEqual=y,xe.cloneLayout=P,xe.cloneLayoutItem=k,xe.collides=r,xe.compact=t,xe.compactItem=l,xe.compactType=ke,xe.correctBounds=w,xe.fastPositionEqual=d,xe.fastRGLPropsEqual=void 0,xe.getAllCollisions=M,xe.getFirstCollision=D,xe.getLayoutItem=O,xe.getStatics=H,xe.modifyLayout=C,xe.moveElement=T,xe.moveElementAwayFromCollision=N,xe.noop=void 0,xe.perc=G,xe.resizeItemInDirection=ue,xe.setTopLeft=U,xe.setTransform=A,xe.sortLayoutItems=ee,xe.sortLayoutItemsByColRow=ce,xe.sortLayoutItemsByRowCol=Z,xe.synchronizeLayoutWithChildren=B,xe.validateLayout=he,xe.withLayoutItem=L;var i=Wt(),o=a(se);function a(g){return g&&g.__esModule?g:{default:g}}function c(g,m){var j=Object.keys(g);if(Object.getOwnPropertySymbols){var q=Object.getOwnPropertySymbols(g);m&&(q=q.filter(function(ne){return Object.getOwnPropertyDescriptor(g,ne).enumerable})),j.push.apply(j,q)}return j}function u(g){for(var m=1;m<arguments.length;m++){var j=arguments[m]!=null?arguments[m]:{};m%2?c(Object(j),!0).forEach(function(q){x(g,q,j[q])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(j)):c(Object(j)).forEach(function(q){Object.defineProperty(g,q,Object.getOwnPropertyDescriptor(j,q))})}return g}function x(g,m,j){return(m=_(m))in g?Object.defineProperty(g,m,{value:j,enumerable:!0,configurable:!0,writable:!0}):g[m]=j,g}function _(g){var m=b(g,"string");return typeof m=="symbol"?m:m+""}function b(g,m){if(typeof g!="object"||!g)return g;var j=g[Symbol.toPrimitive];if(j!==void 0){var q=j.call(g,m);if(typeof q!="object")return q;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(g)}const v=n.NODE_ENV==="production";function R(g){let m=0,j;for(let q=0,ne=g.length;q<ne;q++)j=g[q].y+g[q].h,j>m&&(m=j);return m}function P(g){const m=Array(g.length);for(let j=0,q=g.length;j<q;j++)m[j]=k(g[j]);return m}function C(g,m){const j=Array(g.length);for(let q=0,ne=g.length;q<ne;q++)m.i===g[q].i?j[q]=m:j[q]=g[q];return j}function L(g,m,j){let q=O(g,m);return q?(q=j(k(q)),g=C(g,q),[g,q]):[g,null]}function k(g){return{w:g.w,h:g.h,x:g.x,y:g.y,i:g.i,minW:g.minW,maxW:g.maxW,minH:g.minH,maxH:g.maxH,moved:!!g.moved,static:!!g.static,isDraggable:g.isDraggable,isResizable:g.isResizable,resizeHandles:g.resizeHandles,isBounded:g.isBounded}}function y(g,m){return(0,i.deepEqual)(o.default.Children.map(g,j=>j==null?void 0:j.key),o.default.Children.map(m,j=>j==null?void 0:j.key))&&(0,i.deepEqual)(o.default.Children.map(g,j=>j==null?void 0:j.props["data-grid"]),o.default.Children.map(m,j=>j==null?void 0:j.props["data-grid"]))}xe.fastRGLPropsEqual=Pn();function d(g,m){return g.left===m.left&&g.top===m.top&&g.width===m.width&&g.height===m.height}function r(g,m){return!(g.i===m.i||g.x+g.w<=m.x||g.x>=m.x+m.w||g.y+g.h<=m.y||g.y>=m.y+m.h)}function t(g,m,j,q){const ne=H(g);let Q=R(ne);const le=ee(g,m),ye=Array(g.length);for(let Ce=0,p=le.length;Ce<p;Ce++){let S=k(le[Ce]);S.static||(S=l(ne,S,m,j,le,q,Q),Q=Math.max(Q,S.y+S.h),ne.push(S)),ye[g.indexOf(le[Ce])]=S,S.moved=!1}return ye}const s={x:"w",y:"h"};function f(g,m,j,q){const ne=s[q];m[q]+=1;const Q=g.map(le=>le.i).indexOf(m.i);for(let le=Q+1;le<g.length;le++){const ye=g[le];if(!ye.static){if(ye.y>m.y+m.h)break;r(m,ye)&&f(g,ye,j+m[ne],q)}}m[q]=j}function l(g,m,j,q,ne,Q,le){const ye=j==="vertical",Ce=j==="horizontal";if(ye)for(typeof le=="number"?m.y=Math.min(le,m.y):m.y=Math.min(R(g),m.y);m.y>0&&!D(g,m);)m.y--;else if(Ce)for(;m.x>0&&!D(g,m);)m.x--;let p;for(;(p=D(g,m))&&!(j===null&&Q);)if(Ce?f(ne,m,p.x+p.w,"x"):f(ne,m,p.y+p.h,"y"),Ce&&m.x+m.w>q)for(m.x=q-m.w,m.y++;m.x>0&&!D(g,m);)m.x--;return m.y=Math.max(m.y,0),m.x=Math.max(m.x,0),m}function w(g,m){const j=H(g);for(let q=0,ne=g.length;q<ne;q++){const Q=g[q];if(Q.x+Q.w>m.cols&&(Q.x=m.cols-Q.w),Q.x<0&&(Q.x=0,Q.w=m.cols),!Q.static)j.push(Q);else for(;D(j,Q);)Q.y++}return g}function O(g,m){for(let j=0,q=g.length;j<q;j++)if(g[j].i===m)return g[j]}function D(g,m){for(let j=0,q=g.length;j<q;j++)if(r(g[j],m))return g[j]}function M(g,m){return g.filter(j=>r(j,m))}function H(g){return g.filter(m=>m.static)}function T(g,m,j,q,ne,Q,le,ye,Ce){if(m.static&&m.isDraggable!==!0||m.y===q&&m.x===j)return g;"Moving element ".concat(m.i," to [").concat(String(j),",").concat(String(q),"] from [").concat(m.x,",").concat(m.y,"]");const p=m.x,S=m.y;typeof j=="number"&&(m.x=j),typeof q=="number"&&(m.y=q),m.moved=!0;let z=ee(g,le);(le==="vertical"&&typeof q=="number"?S>=q:le==="horizontal"&&typeof j=="number"?p>=j:!1)&&(z=z.reverse());const $=M(z,m),Ee=$.length>0;if(Ee&&Ce)return P(g);if(Ee&&Q)return"Collision prevented on ".concat(m.i,", reverting."),m.x=p,m.y=S,m.moved=!1,g;for(let me=0,Te=$.length;me<Te;me++){const Me=$[me];"Resolving collision between ".concat(m.i," at [").concat(m.x,",").concat(m.y,"] and ").concat(Me.i," at [").concat(Me.x,",").concat(Me.y,"]"),!Me.moved&&(Me.static?g=N(g,Me,m,ne,le):g=N(g,m,Me,ne,le))}return g}function N(g,m,j,q,ne,Q){const le=ne==="horizontal",ye=ne==="vertical",Ce=m.static;if(q){q=!1;const z={x:le?Math.max(m.x-j.w,0):j.x,y:ye?Math.max(m.y-j.h,0):j.y,w:j.w,h:j.h,i:"-1"},Y=D(g,z),$=Y&&Y.y+Y.h>m.y,Ee=Y&&m.x+m.w>Y.x;if(Y){if($&&ye)return T(g,j,void 0,j.y+1,q,Ce,ne);if($&&ne==null)return m.y=j.y,j.y=j.y+j.h,g;if(Ee&&le)return T(g,m,j.x,void 0,q,Ce,ne)}else return"Doing reverse collision on ".concat(j.i," up to [").concat(z.x,",").concat(z.y,"]."),T(g,j,le?z.x:void 0,ye?z.y:void 0,q,Ce,ne)}const p=le?j.x+1:void 0,S=ye?j.y+1:void 0;return p==null&&S==null?g:T(g,j,le?j.x+1:void 0,ye?j.y+1:void 0,q,Ce,ne)}function G(g){return g*100+"%"}const X=(g,m,j,q)=>g+j>q?m:j,V=(g,m,j)=>g<0?m:j,J=g=>Math.max(0,g),K=g=>Math.max(0,g),re=(g,m,j)=>{let{left:q,height:ne,width:Q}=m;const le=g.top-(ne-g.height);return{left:q,width:Q,height:V(le,g.height,ne),top:K(le)}},be=(g,m,j)=>{let{top:q,left:ne,height:Q,width:le}=m;return{top:q,height:Q,width:X(g.left,g.width,le,j),left:J(ne)}},ge=(g,m,j)=>{let{top:q,height:ne,width:Q}=m;const le=g.left-(Q-g.width);return{height:ne,width:le<0?g.width:X(g.left,g.width,Q,j),top:K(q),left:J(le)}},I=(g,m,j)=>{let{top:q,left:ne,height:Q,width:le}=m;return{width:le,left:ne,height:V(q,g.height,Q),top:K(q)}},fe={n:re,ne:function(){return re(arguments.length<=0?void 0:arguments[0],be(...arguments))},e:be,se:function(){return I(arguments.length<=0?void 0:arguments[0],be(...arguments))},s:I,sw:function(){return I(arguments.length<=0?void 0:arguments[0],ge(...arguments))},w:ge,nw:function(){return re(arguments.length<=0?void 0:arguments[0],ge(...arguments))}};function ue(g,m,j,q){const ne=fe[g];return ne?ne(m,u(u({},m),j),q):j}function A(g){let{top:m,left:j,width:q,height:ne}=g;const Q="translate(".concat(j,"px,").concat(m,"px)");return{transform:Q,WebkitTransform:Q,MozTransform:Q,msTransform:Q,OTransform:Q,width:"".concat(q,"px"),height:"".concat(ne,"px"),position:"absolute"}}function U(g){let{top:m,left:j,width:q,height:ne}=g;return{top:"".concat(m,"px"),left:"".concat(j,"px"),width:"".concat(q,"px"),height:"".concat(ne,"px"),position:"absolute"}}function ee(g,m){return m==="horizontal"?ce(g):m==="vertical"?Z(g):g}function Z(g){return g.slice(0).sort(function(m,j){return m.y>j.y||m.y===j.y&&m.x>j.x?1:m.y===j.y&&m.x===j.x?0:-1})}function ce(g){return g.slice(0).sort(function(m,j){return m.x>j.x||m.x===j.x&&m.y>j.y?1:-1})}function B(g,m,j,q,ne){g=g||[];const Q=[];o.default.Children.forEach(m,ye=>{if((ye==null?void 0:ye.key)==null)return;const Ce=O(g,String(ye.key)),p=ye.props["data-grid"];Ce&&p==null?Q.push(k(Ce)):p?(v||he([p],"ReactGridLayout.children"),Q.push(k(u(u({},p),{},{i:ye.key})))):Q.push(k({w:1,h:1,x:0,y:R(Q),i:String(ye.key)}))});const le=w(Q,{cols:j});return ne?le:t(le,q,j)}function he(g){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const j=["x","y","w","h"];if(!Array.isArray(g))throw new Error(m+" must be an array!");for(let q=0,ne=g.length;q<ne;q++){const Q=g[q];for(let le=0;le<j.length;le++){const ye=j[le],Ce=Q[ye];if(typeof Ce!="number"||Number.isNaN(Ce))throw new Error("ReactGridLayout: ".concat(m,"[").concat(q,"].").concat(ye," must be a number! Received: ").concat(Ce," (").concat(typeof Ce,")"))}if(typeof Q.i<"u"&&typeof Q.i!="string")throw new Error("ReactGridLayout: ".concat(m,"[").concat(q,"].i must be a string! Received: ").concat(Q.i," (").concat(typeof Q.i,")"))}}function ke(g){const{verticalCompact:m,compactType:j}=g||{};return m===!1?null:j}function we(){}const Le=()=>{};return xe.noop=Le,xe}var Fe={},yr;function Bt(){if(yr)return Fe;yr=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.calcGridColWidth=n,Fe.calcGridItemPosition=o,Fe.calcGridItemWHPx=i,Fe.calcWH=c,Fe.calcXY=a,Fe.clamp=u;function n(x){const{margin:_,containerPadding:b,containerWidth:v,cols:R}=x;return(v-_[0]*(R-1)-b[0]*2)/R}function i(x,_,b){return Number.isFinite(x)?Math.round(_*x+Math.max(0,x-1)*b):x}function o(x,_,b,v,R,P){const{margin:C,containerPadding:L,rowHeight:k}=x,y=n(x),d={};return P&&P.resizing?(d.width=Math.round(P.resizing.width),d.height=Math.round(P.resizing.height)):(d.width=i(v,y,C[0]),d.height=i(R,k,C[1])),P&&P.dragging?(d.top=Math.round(P.dragging.top),d.left=Math.round(P.dragging.left)):P&&P.resizing&&typeof P.resizing.top=="number"&&typeof P.resizing.left=="number"?(d.top=Math.round(P.resizing.top),d.left=Math.round(P.resizing.left)):(d.top=Math.round((k+C[1])*b+L[1]),d.left=Math.round((y+C[0])*_+L[0])),d}function a(x,_,b,v,R){const{margin:P,containerPadding:C,cols:L,rowHeight:k,maxRows:y}=x,d=n(x);let r=Math.round((b-C[0])/(d+P[0])),t=Math.round((_-C[1])/(k+P[1]));return r=u(r,0,L-v),t=u(t,0,y-R),{x:r,y:t}}function c(x,_,b,v,R,P){const{margin:C,maxRows:L,cols:k,rowHeight:y}=x,d=n(x);let r=Math.round((_+C[0])/(d+C[0])),t=Math.round((b+C[1])/(y+C[1])),s=u(r,0,k-v),f=u(t,0,L-R);return["sw","w","nw"].indexOf(P)!==-1&&(s=u(r,0,k)),["nw","n","ne"].indexOf(P)!==-1&&(f=u(t,0,L)),{w:s,h:f}}function u(x,_,b){return Math.max(Math.min(x,b),_)}return Fe}var ut={},Et={exports:{}},Pt={exports:{}},Re={};/** @license React v16.13.1
|
|
31
31
|
* react-is.production.min.js
|
|
32
32
|
*
|
|
33
33
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/var
|
|
37
|
+
*/var mr;function Dn(){if(mr)return Re;mr=1;var n=typeof Symbol=="function"&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,c=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,x=n?Symbol.for("react.provider"):60109,_=n?Symbol.for("react.context"):60110,b=n?Symbol.for("react.async_mode"):60111,v=n?Symbol.for("react.concurrent_mode"):60111,R=n?Symbol.for("react.forward_ref"):60112,P=n?Symbol.for("react.suspense"):60113,C=n?Symbol.for("react.suspense_list"):60120,L=n?Symbol.for("react.memo"):60115,k=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,d=n?Symbol.for("react.fundamental"):60117,r=n?Symbol.for("react.responder"):60118,t=n?Symbol.for("react.scope"):60119;function s(l){if(typeof l=="object"&&l!==null){var w=l.$$typeof;switch(w){case i:switch(l=l.type,l){case b:case v:case a:case u:case c:case P:return l;default:switch(l=l&&l.$$typeof,l){case _:case R:case k:case L:case x:return l;default:return w}}case o:return w}}}function f(l){return s(l)===v}return Re.AsyncMode=b,Re.ConcurrentMode=v,Re.ContextConsumer=_,Re.ContextProvider=x,Re.Element=i,Re.ForwardRef=R,Re.Fragment=a,Re.Lazy=k,Re.Memo=L,Re.Portal=o,Re.Profiler=u,Re.StrictMode=c,Re.Suspense=P,Re.isAsyncMode=function(l){return f(l)||s(l)===b},Re.isConcurrentMode=f,Re.isContextConsumer=function(l){return s(l)===_},Re.isContextProvider=function(l){return s(l)===x},Re.isElement=function(l){return typeof l=="object"&&l!==null&&l.$$typeof===i},Re.isForwardRef=function(l){return s(l)===R},Re.isFragment=function(l){return s(l)===a},Re.isLazy=function(l){return s(l)===k},Re.isMemo=function(l){return s(l)===L},Re.isPortal=function(l){return s(l)===o},Re.isProfiler=function(l){return s(l)===u},Re.isStrictMode=function(l){return s(l)===c},Re.isSuspense=function(l){return s(l)===P},Re.isValidElementType=function(l){return typeof l=="string"||typeof l=="function"||l===a||l===v||l===u||l===c||l===P||l===C||typeof l=="object"&&l!==null&&(l.$$typeof===k||l.$$typeof===L||l.$$typeof===x||l.$$typeof===_||l.$$typeof===R||l.$$typeof===d||l.$$typeof===r||l.$$typeof===t||l.$$typeof===y)},Re.typeOf=s,Re}var _e={},vr;function Tn(){if(vr)return _e;vr=1;var n={};/** @license React v16.13.1
|
|
38
38
|
* react-is.development.js
|
|
39
39
|
*
|
|
40
40
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
41
|
*
|
|
42
42
|
* This source code is licensed under the MIT license found in the
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/return n.NODE_ENV!=="production"&&(function(){var
|
|
44
|
+
*/return n.NODE_ENV!=="production"&&(function(){var i=typeof Symbol=="function"&&Symbol.for,o=i?Symbol.for("react.element"):60103,a=i?Symbol.for("react.portal"):60106,c=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,x=i?Symbol.for("react.profiler"):60114,_=i?Symbol.for("react.provider"):60109,b=i?Symbol.for("react.context"):60110,v=i?Symbol.for("react.async_mode"):60111,R=i?Symbol.for("react.concurrent_mode"):60111,P=i?Symbol.for("react.forward_ref"):60112,C=i?Symbol.for("react.suspense"):60113,L=i?Symbol.for("react.suspense_list"):60120,k=i?Symbol.for("react.memo"):60115,y=i?Symbol.for("react.lazy"):60116,d=i?Symbol.for("react.block"):60121,r=i?Symbol.for("react.fundamental"):60117,t=i?Symbol.for("react.responder"):60118,s=i?Symbol.for("react.scope"):60119;function f(B){return typeof B=="string"||typeof B=="function"||B===c||B===R||B===x||B===u||B===C||B===L||typeof B=="object"&&B!==null&&(B.$$typeof===y||B.$$typeof===k||B.$$typeof===_||B.$$typeof===b||B.$$typeof===P||B.$$typeof===r||B.$$typeof===t||B.$$typeof===s||B.$$typeof===d)}function l(B){if(typeof B=="object"&&B!==null){var he=B.$$typeof;switch(he){case o:var ke=B.type;switch(ke){case v:case R:case c:case x:case u:case C:return ke;default:var we=ke&&ke.$$typeof;switch(we){case b:case P:case y:case k:case _:return we;default:return he}}case a:return he}}}var w=v,O=R,D=b,M=_,H=o,T=P,N=c,G=y,X=k,V=a,J=x,K=u,re=C,be=!1;function ge(B){return be||(be=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),I(B)||l(B)===v}function I(B){return l(B)===R}function W(B){return l(B)===b}function ie(B){return l(B)===_}function oe(B){return typeof B=="object"&&B!==null&&B.$$typeof===o}function ae(B){return l(B)===P}function fe(B){return l(B)===c}function ue(B){return l(B)===y}function A(B){return l(B)===k}function U(B){return l(B)===a}function ee(B){return l(B)===x}function Z(B){return l(B)===u}function ce(B){return l(B)===C}_e.AsyncMode=w,_e.ConcurrentMode=O,_e.ContextConsumer=D,_e.ContextProvider=M,_e.Element=H,_e.ForwardRef=T,_e.Fragment=N,_e.Lazy=G,_e.Memo=X,_e.Portal=V,_e.Profiler=J,_e.StrictMode=K,_e.Suspense=re,_e.isAsyncMode=ge,_e.isConcurrentMode=I,_e.isContextConsumer=W,_e.isContextProvider=ie,_e.isElement=oe,_e.isForwardRef=ae,_e.isFragment=fe,_e.isLazy=ue,_e.isMemo=A,_e.isPortal=U,_e.isProfiler=ee,_e.isStrictMode=Z,_e.isSuspense=ce,_e.isValidElementType=f,_e.typeOf=l})(),_e}var br;function xr(){if(br)return Pt.exports;br=1;var n={};return n.NODE_ENV==="production"?Pt.exports=Dn():Pt.exports=Tn(),Pt.exports}/*
|
|
45
45
|
object-assign
|
|
46
46
|
(c) Sindre Sorhus
|
|
47
47
|
@license MIT
|
|
48
|
-
*/var qt,
|
|
49
|
-
Valid keys: `+JSON.stringify(Object.keys(
|
|
50
|
-
`,
|
|
51
|
-
`,d.getElementsByTagName("head")[0].appendChild(x)),d.body&&A(d.body,"react-draggable-transparent-selection")}function pe(d){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ue(d)}):ue(d)}function ue(d){if(d)try{d.body&&G(d.body,"react-draggable-transparent-selection");const x=d.selection;if(x)x.empty();else{const z=(d.defaultView||window).getSelection();z&&z.type!=="Caret"&&z.removeAllRanges()}}catch{}}function A(d,x){d.classList?d.classList.add(x):d.className.match(new RegExp(`(?:^|\\s)${x}(?!\\S)`))||(d.className+=` ${x}`)}function G(d,x){d.classList?d.classList.remove(x):d.className=d.className.replace(new RegExp(`(?:^|\\s)${x}(?!\\S)`,"g"),"")}function Z(d,x,z){if(!d.props.bounds)return[x,z];let{bounds:F}=d.props;F=typeof F=="string"?F:Ae(F);const Y=y(d);if(typeof F=="string"){const{ownerDocument:_e}=Y,ve=_e.defaultView;if(!ve)throw new Error("Cannot resolve the owner window of the draggable node.");let De;if(F==="parent"?De=Y.parentNode:De=Y.getRootNode().querySelector(F),!(De instanceof ve.HTMLElement))throw new Error('Bounds selector "'+F+'" could not find an element.');const Me=De,Ye=ve.getComputedStyle(Y),$e=ve.getComputedStyle(Me);F={left:-Y.offsetLeft+c($e.paddingLeft)+c(Ye.marginLeft),top:-Y.offsetTop+c($e.paddingTop)+c(Ye.marginTop),right:te(Me)-K(Y)-Y.offsetLeft+c($e.paddingRight)-c(Ye.marginRight),bottom:Q(Me)-V(Y)-Y.offsetTop+c($e.paddingBottom)-c(Ye.marginBottom)}}return t(F.right)&&(x=Math.min(x,F.right)),t(F.bottom)&&(z=Math.min(z,F.bottom)),t(F.left)&&(x=Math.max(x,F.left)),t(F.top)&&(z=Math.max(z,F.top)),[x,z]}function X(d,x,z){const F=Math.round(x/d[0])*d[0],Y=Math.round(z/d[1])*d[1];return[F,Y]}function ae(d){return d.props.axis==="both"||d.props.axis==="x"}function H(d){return d.props.axis==="both"||d.props.axis==="y"}function ye(d,x,z){const F=typeof x=="number"?le(d,x):null;if(typeof x=="number"&&!F)return null;const Y=y(z),_e=z.props.offsetParent||Y.offsetParent||Y.ownerDocument.body;return he(F||d,_e,z.props.scale)}function ze(d,x,z){const F=!t(d.lastX),Y=y(d);return F?{node:Y,deltaX:0,deltaY:0,lastX:x,lastY:z,x,y:z}:{node:Y,deltaX:x-d.lastX,deltaY:z-d.lastY,lastX:d.lastX,lastY:d.lastY,x,y:z}}function we(d,x){const z=d.props.scale;return{node:x.node,x:d.state.x+x.deltaX/z,y:d.state.y+x.deltaY/z,deltaX:x.deltaX/z,deltaY:x.deltaY/z,lastX:d.state.x,lastY:d.state.y}}function Ae(d){return{left:d.left,top:d.top,right:d.right,bottom:d.bottom}}function y(d){const x=d.findDOMNode();if(!x)throw new Error("<DraggableCore>: Unmounted during event!");return x}var v=j(oe),w=j(Ue()),q=j(Mt);function ne(...d){n.DRAGGABLE_DEBUG&&console.log(...d)}var $={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},se=$.mouse,me=class extends v.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=d=>{if(this.props.onMouseDown(d),!this.props.allowAnyClick&&(typeof d.button=="number"&&d.button!==0||d.ctrlKey))return!1;const x=this.findDOMNode();if(!x||!x.ownerDocument||!x.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:z}=x;if(this.props.disabled||!(d.target instanceof z.defaultView.Node)||this.props.handle&&!U(d.target,this.props.handle,x)||this.props.cancel&&U(d.target,this.props.cancel,x))return;d.type==="touchstart"&&!this.props.allowMobileScroll&&d.preventDefault();const F=ie(d);this.touchIdentifier=F;const Y=ye(d,F,this);if(Y==null)return;const{x:_e,y:ve}=Y,De=ze(this,_e,ve);ne("DraggableCore: handleDragStart: %j",De),ne("calling",this.props.onStart),!(this.props.onStart(d,De)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ce(z),this.dragging=!0,this.lastX=_e,this.lastY=ve,J(z,se.move,this.handleDrag),J(z,se.stop,this.handleDragStop))},this.handleDrag=d=>{const x=ye(d,this.touchIdentifier,this);if(x==null)return;let{x:z,y:F}=x;if(Array.isArray(this.props.grid)){let ve=z-this.lastX,De=F-this.lastY;if([ve,De]=X(this.props.grid,ve,De),!ve&&!De)return;z=this.lastX+ve,F=this.lastY+De}const Y=ze(this,z,F);if(ne("DraggableCore: handleDrag: %j",Y),this.props.onDrag(d,Y)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const ve=document.createEvent("MouseEvents");ve.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(ve)}return}this.lastX=z,this.lastY=F},this.handleDragStop=d=>{if(!this.dragging)return;const x=ye(d,this.touchIdentifier,this);if(x==null)return;let{x:z,y:F}=x;if(Array.isArray(this.props.grid)){let De=z-this.lastX||0,Me=F-this.lastY||0;[De,Me]=X(this.props.grid,De,Me),z=this.lastX+De,F=this.lastY+Me}const Y=ze(this,z,F);if(this.props.onStop(d,Y)===!1||this.mounted===!1)return!1;const ve=this.findDOMNode();ve&&this.props.enableUserSelectHack&&pe(ve.ownerDocument),ne("DraggableCore: handleDragStop: %j",Y),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,ve&&(ne("DraggableCore: Removing handlers"),re(ve.ownerDocument,se.move,this.handleDrag),re(ve.ownerDocument,se.stop,this.handleDragStop))},this.onMouseDown=d=>(se=$.mouse,this.handleDragStart(d)),this.onMouseUp=d=>(se=$.mouse,this.handleDragStop(d)),this.onTouchStart=d=>(se=$.touch,this.handleDragStart(d)),this.onTouchEnd=d=>(se=$.touch,this.handleDragStop(d))}componentDidMount(){this.mounted=!0;const d=this.findDOMNode();d&&J(d,$.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const d=this.findDOMNode();if(d){const{ownerDocument:x}=d;re(x,$.mouse.move,this.handleDrag),re(x,$.touch.move,this.handleDrag),re(x,$.mouse.stop,this.handleDragStop),re(x,$.touch.stop,this.handleDragStop),re(d,$.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&pe(x)}}findDOMNode(){var d;if((d=this.props)!=null&&d.nodeRef)return this.props.nodeRef.current;const x=q.default;return typeof x.findDOMNode=="function"?x.findDOMNode(this):(ne("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return v.cloneElement(v.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};me.displayName="DraggableCore",me.propTypes={allowAnyClick:w.default.bool,allowMobileScroll:w.default.bool,children:w.default.node.isRequired,disabled:w.default.bool,enableUserSelectHack:w.default.bool,offsetParent:function(d,x){if(d[x]&&d[x].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:w.default.arrayOf(w.default.number),handle:w.default.string,cancel:w.default.string,nodeRef:w.default.object,onStart:w.default.func,onDrag:w.default.func,onStop:w.default.func,onMouseDown:w.default.func,scale:w.default.number,className:f,style:f,transform:f},me.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var je=class extends E.Component{constructor(d){super(d),this.onDragStart=(x,z)=>{if(ne("Draggable: onDragStart: %j",z),this.props.onStart(x,we(this,z))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(x,z)=>{if(!this.state.dragging)return!1;ne("Draggable: onDrag: %j",z);const F=we(this,z),Y={x:F.x,y:F.y,slackX:0,slackY:0};if(this.props.bounds){const{x:ve,y:De}=Y;Y.x+=this.state.slackX,Y.y+=this.state.slackY;const[Me,Ye]=Z(this,Y.x,Y.y);Y.x=Me,Y.y=Ye,Y.slackX=this.state.slackX+(ve-Y.x),Y.slackY=this.state.slackY+(De-Y.y),F.x=Y.x,F.y=Y.y,F.deltaX=Y.x-this.state.x,F.deltaY=Y.y-this.state.y}if(this.props.onDrag(x,F)===!1)return!1;this.setState(Y)},this.onDragStop=(x,z)=>{if(!this.state.dragging||this.props.onStop(x,we(this,z))===!1)return!1;ne("Draggable: onDragStop: %j",z);const Y={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:ve,y:De}=this.props.position;Y.x=ve,Y.y=De}this.setState(Y)},this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:d},{prevPropsPosition:x}){return d&&(!x||d.x!==x.x||d.y!==x.y)?(ne("Draggable: getDerivedStateFromProps %j",{position:d,prevPropsPosition:x}),{x:d.x,y:d.y,prevPropsPosition:{...d}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var d;if((d=this.props)!=null&&d.nodeRef)return this.props.nodeRef.current;const x=I.default;return typeof x.findDOMNode=="function"?x.findDOMNode(this):null}render(){const{axis:d,bounds:x,children:z,defaultPosition:F,defaultClassName:Y,defaultClassNameDragging:_e,defaultClassNameDragged:ve,position:De,positionOffset:Me,scale:Ye,...$e}=this.props;let mt={},et=null;const Ve=!!!De||this.state.dragging,tt=De||F,rt={x:ae(this)&&Ve?this.state.x:tt.x,y:H(this)&&Ve?this.state.y:tt.y};this.state.isElementSVG?et=M(rt,Me):mt=ge(rt,Me);const nt=E.Children.only(z),er=(0,p.clsx)(nt.props.className||"",Y,{[_e]:this.state.dragging,[ve]:this.state.dragged});return E.createElement(me,{...$e,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},E.cloneElement(nt,{className:er,style:{...nt.props.style,...mt},transform:et}))}};return je.displayName="Draggable",je.propTypes={...me.propTypes,axis:N.default.oneOf(["both","x","y","none"]),bounds:N.default.oneOfType([N.default.shape({left:N.default.number,right:N.default.number,top:N.default.number,bottom:N.default.number}),N.default.string,N.default.oneOf([!1])]),defaultClassName:N.default.string,defaultClassNameDragging:N.default.string,defaultClassNameDragged:N.default.string,defaultPosition:N.default.shape({x:N.default.number,y:N.default.number}),positionOffset:N.default.shape({x:N.default.oneOfType([N.default.number,N.default.string]),y:N.default.oneOfType([N.default.number,N.default.string])}),position:N.default.shape({x:N.default.number,y:N.default.number}),className:f,style:f,transform:f},je.defaultProps={...me.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1},$t}var Pr;function Xt(){if(Pr)return dt.exports;Pr=1;const n=kn(),o=n.DraggableCore,s=n.default||n;return dt.exports=s,dt.exports.default=s,dt.exports.DraggableCore=o,dt.exports}var ft={exports:{}},pt={},Pt={},Dr;function Mn(){if(Dr)return Pt;Dr=1,Pt.__esModule=!0,Pt.cloneElement=O;var n=o(oe);function o(m){return m&&m.__esModule?m:{default:m}}function s(m,j){var R=Object.keys(m);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(m);j&&(P=P.filter(function(E){return Object.getOwnPropertyDescriptor(m,E).enumerable})),R.push.apply(R,P)}return R}function i(m){for(var j=1;j<arguments.length;j++){var R=arguments[j]!=null?arguments[j]:{};j%2?s(Object(R),!0).forEach(function(P){h(m,P,R[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(R)):s(Object(R)).forEach(function(P){Object.defineProperty(m,P,Object.getOwnPropertyDescriptor(R,P))})}return m}function h(m,j,R){return(j=u(j))in m?Object.defineProperty(m,j,{value:R,enumerable:!0,configurable:!0,writable:!0}):m[j]=R,m}function u(m){var j=b(m,"string");return typeof j=="symbol"?j:j+""}function b(m,j){if(typeof m!="object"||!m)return m;var R=m[Symbol.toPrimitive];if(R!==void 0){var P=R.call(m,j);if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(j==="string"?String:Number)(m)}function O(m,j){return j.style&&m.props.style&&(j.style=i(i({},m.props.style),j.style)),j.className&&m.props.className&&(j.className=m.props.className+" "+j.className),n.default.cloneElement(m,j)}return Pt}var ht={},Tr;function zr(){if(Tr)return ht;Tr=1,ht.__esModule=!0,ht.resizableProps=void 0;var n=o(Ue());Xt();function o(s){return s&&s.__esModule?s:{default:s}}return ht.resizableProps={axis:n.default.oneOf(["both","x","y","none"]),className:n.default.string,children:n.default.element.isRequired,draggableOpts:n.default.shape({allowAnyClick:n.default.bool,cancel:n.default.string,children:n.default.node,disabled:n.default.bool,enableUserSelectHack:n.default.bool,offsetParent:typeof Element<"u"?n.default.instanceOf(Element):n.default.any,grid:n.default.arrayOf(n.default.number),handle:n.default.string,nodeRef:n.default.object,onStart:n.default.func,onDrag:n.default.func,onStop:n.default.func,onMouseDown:n.default.func,scale:n.default.number}),height:function(){for(var s=arguments.length,i=new Array(s),h=0;h<s;h++)i[h]=arguments[h];const u=i[0];return u.axis==="both"||u.axis==="y"?n.default.number.isRequired(...i):n.default.number(...i)},handle:n.default.oneOfType([n.default.node,n.default.func]),handleSize:n.default.arrayOf(n.default.number),lockAspectRatio:n.default.bool,maxConstraints:n.default.arrayOf(n.default.number),minConstraints:n.default.arrayOf(n.default.number),onResizeStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,resizeHandles:n.default.arrayOf(n.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:n.default.number,width:function(){for(var s=arguments.length,i=new Array(s),h=0;h<s;h++)i[h]=arguments[h];const u=i[0];return u.axis==="both"||u.axis==="x"?n.default.number.isRequired(...i):n.default.number(...i)}},ht}var kr;function Mr(){if(kr)return pt;kr=1,pt.__esModule=!0,pt.default=void 0;var n=u(oe),o=Xt(),s=Mn(),i=zr();const h=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function u(I,p){if(typeof WeakMap=="function")var l=new WeakMap,e=new WeakMap;return(u=function(t,c){if(!c&&t&&t.__esModule)return t;var f,a,S={__proto__:null,default:t};if(t===null||typeof t!="object"&&typeof t!="function")return S;if(f=c?e:l){if(f.has(t))return f.get(t);f.set(t,S)}for(const C in t)C!=="default"&&{}.hasOwnProperty.call(t,C)&&((a=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,C))&&(a.get||a.set)?f(S,C,a):S[C]=t[C]);return S})(I,p)}function b(){return b=Object.assign?Object.assign.bind():function(I){for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var e in l)({}).hasOwnProperty.call(l,e)&&(I[e]=l[e])}return I},b.apply(null,arguments)}function O(I,p){if(I==null)return{};var l={};for(var e in I)if({}.hasOwnProperty.call(I,e)){if(p.indexOf(e)!==-1)continue;l[e]=I[e]}return l}function m(I,p){var l=Object.keys(I);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(I);p&&(e=e.filter(function(t){return Object.getOwnPropertyDescriptor(I,t).enumerable})),l.push.apply(l,e)}return l}function j(I){for(var p=1;p<arguments.length;p++){var l=arguments[p]!=null?arguments[p]:{};p%2?m(Object(l),!0).forEach(function(e){R(I,e,l[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(l)):m(Object(l)).forEach(function(e){Object.defineProperty(I,e,Object.getOwnPropertyDescriptor(l,e))})}return I}function R(I,p,l){return(p=P(p))in I?Object.defineProperty(I,p,{value:l,enumerable:!0,configurable:!0,writable:!0}):I[p]=l,I}function P(I){var p=E(I,"string");return typeof p=="symbol"?p:p+""}function E(I,p){if(typeof I!="object"||!I)return I;var l=I[Symbol.toPrimitive];if(l!==void 0){var e=l.call(I,p);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(I)}let N=class extends n.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(p,l){const e=this.props,t=e.minConstraints,c=e.maxConstraints,f=e.lockAspectRatio;if(!t&&!c&&!f)return[p,l];if(f){const k=this.props.width/this.props.height,W=p-this.props.width,U=l-this.props.height;Math.abs(W)>Math.abs(U*k)?l=p/k:p=l*k}const a=p,S=l;let C=this.slack||[0,0],D=C[0],_=C[1];return p+=D,l+=_,t&&(p=Math.max(t[0],p),l=Math.max(t[1],l)),c&&(p=Math.min(c[0],p),l=Math.min(c[1],l)),this.slack=[D+(a-p),_+(S-l)],[p,l]}resizeHandler(p,l){return(e,t)=>{var c,f,a,S;let C=t.node,D=t.deltaX,_=t.deltaY;p==="onResizeStart"&&this.resetData();const k=(this.props.axis==="both"||this.props.axis==="x")&&l!=="n"&&l!=="s",W=(this.props.axis==="both"||this.props.axis==="y")&&l!=="e"&&l!=="w";if(!k&&!W)return;const U=l[0],J=l[l.length-1],re=C.getBoundingClientRect();if(this.lastHandleRect!=null){if(J==="w"){const ie=re.left-this.lastHandleRect.left;D+=ie}if(U==="n"){const ie=re.top-this.lastHandleRect.top;_+=ie}}this.lastHandleRect=re,J==="w"&&(D=-D),U==="n"&&(_=-_);const V=(c=(f=this.lastSize)==null?void 0:f.width)!=null?c:this.props.width,K=(a=(S=this.lastSize)==null?void 0:S.height)!=null?a:this.props.height;let Q=V+(k?D/this.props.transformScale:0),te=K+(W?_/this.props.transformScale:0);var he=this.runConstraints(Q,te);if(Q=he[0],te=he[1],p==="onResizeStop"&&this.lastSize){var ge=this.lastSize;Q=ge.width,te=ge.height}const M=Q!==V||te!==K;p!=="onResizeStop"&&(this.lastSize={width:Q,height:te});const L=typeof this.props[p]=="function"?this.props[p]:null;L&&!(p==="onResize"&&!M)&&(e.persist==null||e.persist(),L(e,{node:C,size:{width:Q,height:te},handle:l})),p==="onResizeStop"&&this.resetData()}}renderResizeHandle(p,l){const e=this.props.handle;if(!e)return n.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+p,ref:l});if(typeof e=="function")return e(p,l);const t=typeof e.type=="string",c=j({ref:l},t?{}:{handleAxis:p});return n.cloneElement(e,c)}render(){const p=this.props,l=p.children,e=p.className,t=p.draggableOpts;p.width,p.height,p.handle,p.handleSize,p.lockAspectRatio,p.axis,p.minConstraints,p.maxConstraints,p.onResize,p.onResizeStop,p.onResizeStart;const c=p.resizeHandles;p.transformScale;const f=O(p,h);return(0,s.cloneElement)(l,j(j({},f),{},{className:(e?e+" ":"")+"react-resizable",children:[...n.Children.toArray(l.props.children),...c.map(a=>{var S;const C=(S=this.handleRefs[a])!=null?S:this.handleRefs[a]=n.createRef();return n.createElement(o.DraggableCore,b({},t,{nodeRef:C,key:"resizableHandle-"+a,onStop:this.resizeHandler("onResizeStop",a),onStart:this.resizeHandler("onResizeStart",a),onDrag:this.resizeHandler("onResize",a)}),this.renderResizeHandle(a,C))})]}))}};return pt.default=N,N.propTypes=i.resizableProps,N.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},pt}var gt={},Ir;function In(){if(Ir)return gt;Ir=1,gt.__esModule=!0,gt.default=void 0;var n=b(oe),o=u(Ue()),s=u(Mr()),i=zr();const h=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function u(p){return p&&p.__esModule?p:{default:p}}function b(p,l){if(typeof WeakMap=="function")var e=new WeakMap,t=new WeakMap;return(b=function(c,f){if(!f&&c&&c.__esModule)return c;var a,S,C={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return C;if(a=f?t:e){if(a.has(c))return a.get(c);a.set(c,C)}for(const D in c)D!=="default"&&{}.hasOwnProperty.call(c,D)&&((S=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,D))&&(S.get||S.set)?a(C,D,S):C[D]=c[D]);return C})(p,l)}function O(){return O=Object.assign?Object.assign.bind():function(p){for(var l=1;l<arguments.length;l++){var e=arguments[l];for(var t in e)({}).hasOwnProperty.call(e,t)&&(p[t]=e[t])}return p},O.apply(null,arguments)}function m(p,l){var e=Object.keys(p);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(p);l&&(t=t.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),e.push.apply(e,t)}return e}function j(p){for(var l=1;l<arguments.length;l++){var e=arguments[l]!=null?arguments[l]:{};l%2?m(Object(e),!0).forEach(function(t){R(p,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(e)):m(Object(e)).forEach(function(t){Object.defineProperty(p,t,Object.getOwnPropertyDescriptor(e,t))})}return p}function R(p,l,e){return(l=P(l))in p?Object.defineProperty(p,l,{value:e,enumerable:!0,configurable:!0,writable:!0}):p[l]=e,p}function P(p){var l=E(p,"string");return typeof l=="symbol"?l:l+""}function E(p,l){if(typeof p!="object"||!p)return p;var e=p[Symbol.toPrimitive];if(e!==void 0){var t=e.call(p,l);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(p)}function N(p,l){if(p==null)return{};var e={};for(var t in p)if({}.hasOwnProperty.call(p,t)){if(l.indexOf(t)!==-1)continue;e[t]=p[t]}return e}let I=class extends n.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(l,e)=>{const t=e.size;this.props.onResize?(l.persist==null||l.persist(),this.setState(t,()=>this.props.onResize&&this.props.onResize(l,e))):this.setState(t)}}static getDerivedStateFromProps(l,e){return e.propsWidth!==l.width||e.propsHeight!==l.height?{width:l.width,height:l.height,propsWidth:l.width,propsHeight:l.height}:null}render(){const l=this.props,e=l.handle,t=l.handleSize;l.onResize;const c=l.onResizeStart,f=l.onResizeStop,a=l.draggableOpts,S=l.minConstraints,C=l.maxConstraints,D=l.lockAspectRatio,_=l.axis;l.width,l.height;const k=l.resizeHandles,W=l.style,U=l.transformScale,J=N(l,h);return n.createElement(s.default,{axis:_,draggableOpts:a,handle:e,handleSize:t,height:this.state.height,lockAspectRatio:D,maxConstraints:C,minConstraints:S,onResizeStart:c,onResize:this.onResize,onResizeStop:f,resizeHandles:k,transformScale:U,width:this.state.width},n.createElement("div",O({},J,{style:j(j({},W),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return gt.default=I,I.propTypes=j(j({},i.resizableProps),{},{children:o.default.element}),gt}var Ar;function An(){return Ar||(Ar=1,ft.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ft.exports.Resizable=Mr().default,ft.exports.ResizableBox=In().default),ft.exports}var Ge={},Lr;function Nr(){if(Lr)return Ge;Lr=1;var n={};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.resizeHandleType=Ge.resizeHandleAxesType=Ge.default=void 0;var o=i(Ue()),s=i(oe);function i(b){return b&&b.__esModule?b:{default:b}}const h=Ge.resizeHandleAxesType=o.default.arrayOf(o.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),u=Ge.resizeHandleType=o.default.oneOfType([o.default.node,o.default.func]);return Ge.default={className:o.default.string,style:o.default.object,width:o.default.number,autoSize:o.default.bool,cols:o.default.number,draggableCancel:o.default.string,draggableHandle:o.default.string,verticalCompact:function(b){b.verticalCompact===!1&&n.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:o.default.oneOf(["vertical","horizontal"]),layout:function(b){var O=b.layout;O!==void 0&&Qe().validateLayout(O,"layout")},margin:o.default.arrayOf(o.default.number),containerPadding:o.default.arrayOf(o.default.number),rowHeight:o.default.number,maxRows:o.default.number,isBounded:o.default.bool,isDraggable:o.default.bool,isResizable:o.default.bool,allowOverlap:o.default.bool,preventCollision:o.default.bool,useCSSTransforms:o.default.bool,transformScale:o.default.number,isDroppable:o.default.bool,resizeHandles:h,resizeHandle:u,onLayoutChange:o.default.func,onDragStart:o.default.func,onDrag:o.default.func,onDragStop:o.default.func,onResizeStart:o.default.func,onResize:o.default.func,onResizeStop:o.default.func,onDrop:o.default.func,droppingItem:o.default.shape({i:o.default.string.isRequired,w:o.default.number.isRequired,h:o.default.number.isRequired}),children:function(b,O){const m=b[O],j={};s.default.Children.forEach(m,function(R){if((R==null?void 0:R.key)!=null){if(j[R.key])throw new Error('Duplicate child key "'+R.key+'" found! This will cause problems in ReactGridLayout.');j[R.key]=!0}})},innerRef:o.default.any},Ge}var Wr;function Ln(){if(Wr)return ut;Wr=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.default=void 0;var n=j(oe),o=Mt,s=j(Ue()),i=Xt(),h=An(),u=Qe(),b=Ht(),O=Nr(),m=j(Ct());function j(l){return l&&l.__esModule?l:{default:l}}function R(l,e){var t=Object.keys(l);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(l);e&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(l,f).enumerable})),t.push.apply(t,c)}return t}function P(l){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?R(Object(t),!0).forEach(function(c){E(l,c,t[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(t)):R(Object(t)).forEach(function(c){Object.defineProperty(l,c,Object.getOwnPropertyDescriptor(t,c))})}return l}function E(l,e,t){return(e=N(e))in l?Object.defineProperty(l,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):l[e]=t,l}function N(l){var e=I(l,"string");return typeof e=="symbol"?e:e+""}function I(l,e){if(typeof l!="object"||!l)return l;var t=l[Symbol.toPrimitive];if(t!==void 0){var c=t.call(l,e);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(l)}let p=class extends n.default.Component{constructor(){super(...arguments),E(this,"state",{resizing:null,dragging:null,className:""}),E(this,"elementRef",n.default.createRef()),E(this,"onDragStart",(e,t)=>{let{node:c}=t;const{onDragStart:f,transformScale:a}=this.props;if(!f)return;const S={top:0,left:0},{offsetParent:C}=c;if(!C)return;const D=C.getBoundingClientRect(),_=c.getBoundingClientRect(),k=_.left/a,W=D.left/a,U=_.top/a,J=D.top/a;S.left=k-W+C.scrollLeft,S.top=U-J+C.scrollTop,this.setState({dragging:S});const{x:re,y:V}=(0,b.calcXY)(this.getPositionParams(),S.top,S.left,this.props.w,this.props.h);return f.call(this,this.props.i,re,V,{e,node:c,newPosition:S})}),E(this,"onDrag",(e,t,c)=>{let{node:f,deltaX:a,deltaY:S}=t;const{onDrag:C}=this.props;if(!C)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let D=this.state.dragging.top+S,_=this.state.dragging.left+a;const{isBounded:k,i:W,w:U,h:J,containerWidth:re}=this.props,V=this.getPositionParams();if(k){const{offsetParent:he}=f;if(he){const{margin:ge,rowHeight:M}=this.props,L=he.clientHeight-(0,b.calcGridItemWHPx)(J,M,ge[1]);D=(0,b.clamp)(D,0,L);const le=(0,b.calcGridColWidth)(V),ie=re-(0,b.calcGridItemWHPx)(U,le,ge[0]);_=(0,b.clamp)(_,0,ie)}}const K={top:D,left:_};c?this.setState({dragging:K}):(0,o.flushSync)(()=>{this.setState({dragging:K})});const{x:Q,y:te}=(0,b.calcXY)(V,D,_,U,J);return C.call(this,W,Q,te,{e,node:f,newPosition:K})}),E(this,"onDragStop",(e,t)=>{let{node:c}=t;const{onDragStop:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:a,h:S,i:C}=this.props,{left:D,top:_}=this.state.dragging,k={top:_,left:D};this.setState({dragging:null});const{x:W,y:U}=(0,b.calcXY)(this.getPositionParams(),_,D,a,S);return f.call(this,C,W,U,{e,node:c,newPosition:k})}),E(this,"onResizeStop",(e,t,c)=>this.onResizeHandler(e,t,c,"onResizeStop")),E(this,"onResizeStart",(e,t,c)=>this.onResizeHandler(e,t,c,"onResizeStart")),E(this,"onResize",(e,t,c)=>this.onResizeHandler(e,t,c,"onResize"))}shouldComponentUpdate(e,t){if(this.props.children!==e.children||this.props.droppingPosition!==e.droppingPosition)return!0;const c=(0,b.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),f=(0,b.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,t);return!(0,u.fastPositionEqual)(c,f)||this.props.useCSSTransforms!==e.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(e){this.moveDroppingItem(e)}moveDroppingItem(e){const{droppingPosition:t}=this.props;if(!t)return;const c=this.elementRef.current;if(!c)return;const f=e.droppingPosition||{left:0,top:0},{dragging:a}=this.state,S=a&&t.left!==f.left||t.top!==f.top;if(!a)this.onDragStart(t.e,{node:c,deltaX:t.left,deltaY:t.top});else if(S){const C=t.left-a.left,D=t.top-a.top;this.onDrag(t.e,{node:c,deltaX:C,deltaY:D},!0)}}getPositionParams(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}createStyle(e){const{usePercentages:t,containerWidth:c,useCSSTransforms:f}=this.props;let a;return f?a=(0,u.setTransform)(e):(a=(0,u.setTopLeft)(e),t&&(a.left=(0,u.perc)(e.left/c),a.width=(0,u.perc)(e.width/c))),a}mixinDraggable(e,t){return n.default.createElement(i.DraggableCore,{disabled:!t,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},e)}curryResizeHandler(e,t){return(c,f)=>t(c,f,e)}mixinResizable(e,t,c){const{cols:f,minW:a,minH:S,maxW:C,maxH:D,transformScale:_,resizeHandles:k,resizeHandle:W}=this.props,U=this.getPositionParams(),J=(0,b.calcGridItemPosition)(U,0,0,f,0).width,re=(0,b.calcGridItemPosition)(U,0,0,a,S),V=(0,b.calcGridItemPosition)(U,0,0,C,D),K=[re.width,re.height],Q=[Math.min(V.width,J),Math.min(V.height,1/0)];return n.default.createElement(h.Resizable,{draggableOpts:{disabled:!c},className:c?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:K,maxConstraints:Q,onResizeStop:this.curryResizeHandler(t,this.onResizeStop),onResizeStart:this.curryResizeHandler(t,this.onResizeStart),onResize:this.curryResizeHandler(t,this.onResize),transformScale:_,resizeHandles:k,handle:W},e)}onResizeHandler(e,t,c,f){let{node:a,size:S,handle:C}=t;const D=this.props[f];if(!D)return;const{x:_,y:k,i:W,maxH:U,minH:J,containerWidth:re}=this.props,{minW:V,maxW:K}=this.props;let Q=S;a&&(Q=(0,u.resizeItemInDirection)(C,c,S,re),(0,o.flushSync)(()=>{this.setState({resizing:f==="onResizeStop"?null:Q})}));let{w:te,h:he}=(0,b.calcWH)(this.getPositionParams(),Q.width,Q.height,_,k,C);te=(0,b.clamp)(te,Math.max(V,1),K),he=(0,b.clamp)(he,J,U),D.call(this,W,te,he,{e,node:a,size:Q,handle:C})}render(){const{x:e,y:t,w:c,h:f,isDraggable:a,isResizable:S,droppingPosition:C,useCSSTransforms:D}=this.props,_=(0,b.calcGridItemPosition)(this.getPositionParams(),e,t,c,f,this.state),k=n.default.Children.only(this.props.children);let W=n.default.cloneElement(k,{ref:this.elementRef,className:(0,m.default)("react-grid-item",k.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"react-draggable-dragging":!!this.state.dragging,dropping:!!C,cssTransforms:D}),style:P(P(P({},this.props.style),k.props.style),this.createStyle(_))});return W=this.mixinResizable(W,_,S),W=this.mixinDraggable(W,a),W}};return ut.default=p,E(p,"propTypes",{children:s.default.element,cols:s.default.number.isRequired,containerWidth:s.default.number.isRequired,rowHeight:s.default.number.isRequired,margin:s.default.array.isRequired,maxRows:s.default.number.isRequired,containerPadding:s.default.array.isRequired,x:s.default.number.isRequired,y:s.default.number.isRequired,w:s.default.number.isRequired,h:s.default.number.isRequired,minW:function(l,e){const t=l[e];if(typeof t!="number")return new Error("minWidth not Number");if(t>l.w||t>l.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(l,e){const t=l[e];if(typeof t!="number")return new Error("maxWidth not Number");if(t<l.w||t<l.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(l,e){const t=l[e];if(typeof t!="number")return new Error("minHeight not Number");if(t>l.h||t>l.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(l,e){const t=l[e];if(typeof t!="number")return new Error("maxHeight not Number");if(t<l.h||t<l.minH)return new Error("maxHeight smaller than item height/minHeight")},i:s.default.string.isRequired,resizeHandles:O.resizeHandleAxesType,resizeHandle:O.resizeHandleType,onDragStop:s.default.func,onDragStart:s.default.func,onDrag:s.default.func,onResizeStop:s.default.func,onResizeStart:s.default.func,onResize:s.default.func,isDraggable:s.default.bool.isRequired,isResizable:s.default.bool.isRequired,isBounded:s.default.bool.isRequired,static:s.default.bool,useCSSTransforms:s.default.bool.isRequired,transformScale:s.default.number,className:s.default.string,handle:s.default.string,cancel:s.default.string,droppingPosition:s.default.shape({e:s.default.object.isRequired,left:s.default.number.isRequired,top:s.default.number.isRequired})}),E(p,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),ut}var Hr;function qr(){if(Hr)return lt;Hr=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;var n=m(oe),o=Nt(),s=O(Ct()),i=Qe(),h=Ht(),u=O(Ln()),b=O(Nr());function O(e){return e&&e.__esModule?e:{default:e}}function m(e,t){if(typeof WeakMap=="function")var c=new WeakMap,f=new WeakMap;return(m=function(a,S){if(!S&&a&&a.__esModule)return a;var C,D,_={__proto__:null,default:a};if(a===null||typeof a!="object"&&typeof a!="function")return _;if(C=S?f:c){if(C.has(a))return C.get(a);C.set(a,_)}for(const k in a)k!=="default"&&{}.hasOwnProperty.call(a,k)&&((D=(C=Object.defineProperty)&&Object.getOwnPropertyDescriptor(a,k))&&(D.get||D.set)?C(_,k,D):_[k]=a[k]);return _})(e,t)}function j(e,t){var c=Object.keys(e);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);t&&(f=f.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),c.push.apply(c,f)}return c}function R(e){for(var t=1;t<arguments.length;t++){var c=arguments[t]!=null?arguments[t]:{};t%2?j(Object(c),!0).forEach(function(f){P(e,f,c[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(c)):j(Object(c)).forEach(function(f){Object.defineProperty(e,f,Object.getOwnPropertyDescriptor(c,f))})}return e}function P(e,t,c){return(t=E(t))in e?Object.defineProperty(e,t,{value:c,enumerable:!0,configurable:!0,writable:!0}):e[t]=c,e}function E(e){var t=N(e,"string");return typeof t=="symbol"?t:t+""}function N(e,t){if(typeof e!="object"||!e)return e;var c=e[Symbol.toPrimitive];if(c!==void 0){var f=c.call(e,t);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const I="react-grid-layout";let p=!1;try{p=/firefox/i.test(navigator.userAgent)}catch{}let l=class extends n.Component{constructor(){super(...arguments),P(this,"state",{activeDrag:null,layout:(0,i.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,i.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),P(this,"dragEnterCounter",0),P(this,"onDragStart",(t,c,f,a)=>{let{e:S,node:C}=a;const{layout:D}=this.state,_=(0,i.getLayoutItem)(D,t);if(!_)return;const k={w:_.w,h:_.h,x:_.x,y:_.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,i.cloneLayoutItem)(_),oldLayout:D,activeDrag:k}),this.props.onDragStart(D,_,_,null,S,C)}),P(this,"onDrag",(t,c,f,a)=>{let{e:S,node:C}=a;const{oldDragItem:D}=this.state;let{layout:_}=this.state;const{cols:k,allowOverlap:W,preventCollision:U}=this.props,J=(0,i.getLayoutItem)(_,t);if(!J)return;const re={w:J.w,h:J.h,x:J.x,y:J.y,placeholder:!0,i:t};_=(0,i.moveElement)(_,J,c,f,!0,U,(0,i.compactType)(this.props),k,W),this.props.onDrag(_,D,J,re,S,C),this.setState({layout:W?_:(0,i.compact)(_,(0,i.compactType)(this.props),k),activeDrag:re})}),P(this,"onDragStop",(t,c,f,a)=>{let{e:S,node:C}=a;if(!this.state.activeDrag)return;const{oldDragItem:D}=this.state;let{layout:_}=this.state;const{cols:k,preventCollision:W,allowOverlap:U}=this.props,J=(0,i.getLayoutItem)(_,t);if(!J)return;_=(0,i.moveElement)(_,J,c,f,!0,W,(0,i.compactType)(this.props),k,U);const V=U?_:(0,i.compact)(_,(0,i.compactType)(this.props),k);this.props.onDragStop(V,D,J,null,S,C);const{oldLayout:K}=this.state;this.setState({activeDrag:null,layout:V,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(V,K)}),P(this,"onResizeStart",(t,c,f,a)=>{let{e:S,node:C}=a;const{layout:D}=this.state,_=(0,i.getLayoutItem)(D,t);_&&(this.setState({oldResizeItem:(0,i.cloneLayoutItem)(_),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(D,_,_,null,S,C))}),P(this,"onResize",(t,c,f,a)=>{let{e:S,node:C,size:D,handle:_}=a;const{oldResizeItem:k}=this.state,{layout:W}=this.state,{cols:U,preventCollision:J,allowOverlap:re}=this.props;let V=!1,K,Q,te;const[he,ge]=(0,i.withLayoutItem)(W,t,L=>{let le;return Q=L.x,te=L.y,["sw","w","nw","n","ne"].indexOf(_)!==-1&&(["sw","nw","w"].indexOf(_)!==-1&&(Q=L.x+(L.w-c),c=L.x!==Q&&Q<0?L.w:c,Q=Q<0?0:Q),["ne","n","nw"].indexOf(_)!==-1&&(te=L.y+(L.h-f),f=L.y!==te&&te<0?L.h:f,te=te<0?0:te),V=!0),J&&!re&&(le=(0,i.getAllCollisions)(W,R(R({},L),{},{w:c,h:f,x:Q,y:te})).filter(ce=>ce.i!==L.i).length>0,le&&(te=L.y,f=L.h,Q=L.x,c=L.w,V=!1)),L.w=c,L.h=f,L});if(!ge)return;K=he,V&&(K=(0,i.moveElement)(he,ge,Q,te,!0,this.props.preventCollision,(0,i.compactType)(this.props),U,re));const M={w:ge.w,h:ge.h,x:ge.x,y:ge.y,static:!0,i:t};this.props.onResize(K,k,ge,M,S,C),this.setState({layout:re?K:(0,i.compact)(K,(0,i.compactType)(this.props),U),activeDrag:M})}),P(this,"onResizeStop",(t,c,f,a)=>{let{e:S,node:C}=a;const{layout:D,oldResizeItem:_}=this.state,{cols:k,allowOverlap:W}=this.props,U=(0,i.getLayoutItem)(D,t),J=W?D:(0,i.compact)(D,(0,i.compactType)(this.props),k);this.props.onResizeStop(J,_,U,null,S,C);const{oldLayout:re}=this.state;this.setState({activeDrag:null,layout:J,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(J,re)}),P(this,"onDragOver",t=>{var c;if(t.preventDefault(),t.stopPropagation(),p&&!((c=t.nativeEvent.target)!==null&&c!==void 0&&c.classList.contains(I)))return!1;const{droppingItem:f,onDropDragOver:a,margin:S,cols:C,rowHeight:D,maxRows:_,width:k,containerPadding:W,transformScale:U}=this.props,J=a==null?void 0:a(t);if(J===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const re=R(R({},f),J),{layout:V}=this.state,K=t.currentTarget.getBoundingClientRect(),Q=t.clientX-K.left,te=t.clientY-K.top,he={left:Q/U,top:te/U,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ge,top:M}=this.state.droppingPosition;(ge!=Q||M!=te)&&this.setState({droppingPosition:he})}}else{const ge={cols:C,margin:S,maxRows:_,rowHeight:D,containerWidth:k,containerPadding:W||S},M=(0,h.calcXY)(ge,te,Q,re.w,re.h);this.setState({droppingDOMNode:n.createElement("div",{key:re.i}),droppingPosition:he,layout:[...V,R(R({},re),{},{x:M.x,y:M.y,static:!1,isDraggable:!0})]})}}),P(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:c}=this.props,{layout:f}=this.state,a=(0,i.compact)(f.filter(S=>S.i!==t.i),(0,i.compactType)(this.props),c,this.props.allowOverlap);this.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),P(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),P(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),P(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:c}=this.props,{layout:f}=this.state,a=f.find(S=>S.i===c.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,a,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,c){let f;return c.activeDrag?null:(!(0,o.deepEqual)(t.layout,c.propsLayout)||t.compactType!==c.compactType?f=t.layout:(0,i.childrenEqual)(t.children,c.children)||(f=c.layout),f?{layout:(0,i.synchronizeLayoutWithChildren)(f,t.children,t.cols,(0,i.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,c){return this.props.children!==t.children||!(0,i.fastRGLPropsEqual)(this.props,t,o.deepEqual)||this.state.activeDrag!==c.activeDrag||this.state.mounted!==c.mounted||this.state.droppingPosition!==c.droppingPosition}componentDidUpdate(t,c){if(!this.state.activeDrag){const f=this.state.layout,a=c.layout;this.onLayoutMaybeChanged(f,a)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,i.bottom)(this.state.layout),c=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+c*2+"px"}onLayoutMaybeChanged(t,c){c||(c=this.state.layout),(0,o.deepEqual)(c,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:c,cols:f,margin:a,containerPadding:S,rowHeight:C,maxRows:D,useCSSTransforms:_,transformScale:k}=this.props;return n.createElement(u.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:c,cols:f,margin:a,containerPadding:S||a,maxRows:D,rowHeight:C,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:_,transformScale:k},n.createElement("div",null))}processGridItem(t,c){if(!t||!t.key)return;const f=(0,i.getLayoutItem)(this.state.layout,String(t.key));if(!f)return null;const{width:a,cols:S,margin:C,containerPadding:D,rowHeight:_,maxRows:k,isDraggable:W,isResizable:U,isBounded:J,useCSSTransforms:re,transformScale:V,draggableCancel:K,draggableHandle:Q,resizeHandles:te,resizeHandle:he}=this.props,{mounted:ge,droppingPosition:M}=this.state,L=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&W,le=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&U,ie=f.resizeHandles||te,ce=L&&J&&f.isBounded!==!1;return n.createElement(u.default,{containerWidth:a,cols:S,margin:C,containerPadding:D||C,maxRows:k,rowHeight:_,cancel:K,handle:Q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:L,isResizable:le,isBounded:ce,useCSSTransforms:re&&ge,usePercentages:!ge,transformScale:V,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:c?M:void 0,resizeHandles:ie,resizeHandle:he},t)}render(){const{className:t,style:c,isDroppable:f,innerRef:a}=this.props,S=(0,s.default)(I,t),C=R({height:this.containerHeight()},c);return n.createElement("div",{ref:a,className:S,style:C,onDrop:f?this.onDrop:i.noop,onDragLeave:f?this.onDragLeave:i.noop,onDragEnter:f?this.onDragEnter:i.noop,onDragOver:f?this.onDragOver:i.noop},n.Children.map(this.props.children,D=>this.processGridItem(D)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return lt.default=l,P(l,"displayName","ReactGridLayout"),P(l,"propTypes",b.default),P(l,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:i.noop,onDragStart:i.noop,onDrag:i.noop,onDragStop:i.noop,onResizeStart:i.noop,onResize:i.noop,onResizeStop:i.noop,onDrop:i.noop,onDropDragOver:i.noop}),lt}var yt={},Xe={},Br;function Fr(){if(Br)return Xe;Br=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.findOrGenerateResponsiveLayout=i,Xe.getBreakpointFromWidth=o,Xe.getColsFromBreakpoint=s,Xe.sortBreakpoints=h;var n=Qe();function o(u,b){const O=h(u);let m=O[0];for(let j=1,R=O.length;j<R;j++){const P=O[j];b>u[P]&&(m=P)}return m}function s(u,b){if(!b[u])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+u+" is missing!");return b[u]}function i(u,b,O,m,j,R){if(u[O])return(0,n.cloneLayout)(u[O]);let P=u[m];const E=h(b),N=E.slice(E.indexOf(O));for(let I=0,p=N.length;I<p;I++){const l=N[I];if(u[l]){P=u[l];break}}return P=(0,n.cloneLayout)(P||[]),(0,n.compact)((0,n.correctBounds)(P,{cols:j}),R,j)}function h(u){return Object.keys(u).sort(function(O,m){return u[O]-u[m]})}return Xe}var Gr;function Nn(){if(Gr)return yt;Gr=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=void 0;var n=m(oe),o=O(Ue()),s=Nt(),i=Qe(),h=Fr(),u=O(qr());const b=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function O(f){return f&&f.__esModule?f:{default:f}}function m(f,a){if(typeof WeakMap=="function")var S=new WeakMap,C=new WeakMap;return(m=function(D,_){if(!_&&D&&D.__esModule)return D;var k,W,U={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return U;if(k=_?C:S){if(k.has(D))return k.get(D);k.set(D,U)}for(const J in D)J!=="default"&&{}.hasOwnProperty.call(D,J)&&((W=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,J))&&(W.get||W.set)?k(U,J,W):U[J]=D[J]);return U})(f,a)}function j(){return j=Object.assign?Object.assign.bind():function(f){for(var a=1;a<arguments.length;a++){var S=arguments[a];for(var C in S)({}).hasOwnProperty.call(S,C)&&(f[C]=S[C])}return f},j.apply(null,arguments)}function R(f,a){if(f==null)return{};var S,C,D=P(f,a);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(f);for(C=0;C<_.length;C++)S=_[C],a.indexOf(S)===-1&&{}.propertyIsEnumerable.call(f,S)&&(D[S]=f[S])}return D}function P(f,a){if(f==null)return{};var S={};for(var C in f)if({}.hasOwnProperty.call(f,C)){if(a.indexOf(C)!==-1)continue;S[C]=f[C]}return S}function E(f,a){var S=Object.keys(f);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(f);a&&(C=C.filter(function(D){return Object.getOwnPropertyDescriptor(f,D).enumerable})),S.push.apply(S,C)}return S}function N(f){for(var a=1;a<arguments.length;a++){var S=arguments[a]!=null?arguments[a]:{};a%2?E(Object(S),!0).forEach(function(C){I(f,C,S[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(S)):E(Object(S)).forEach(function(C){Object.defineProperty(f,C,Object.getOwnPropertyDescriptor(S,C))})}return f}function I(f,a,S){return(a=p(a))in f?Object.defineProperty(f,a,{value:S,enumerable:!0,configurable:!0,writable:!0}):f[a]=S,f}function p(f){var a=l(f,"string");return typeof a=="symbol"?a:a+""}function l(f,a){if(typeof f!="object"||!f)return f;var S=f[Symbol.toPrimitive];if(S!==void 0){var C=S.call(f,a);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(f)}const e=f=>Object.prototype.toString.call(f);function t(f,a){return f==null?null:Array.isArray(f)?f:f[a]}let c=class extends n.Component{constructor(){super(...arguments),I(this,"state",this.generateInitialState()),I(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,N(N({},this.props.layouts),{},{[this.state.breakpoint]:a}))})}generateInitialState(){const{width:a,breakpoints:S,layouts:C,cols:D}=this.props,_=(0,h.getBreakpointFromWidth)(S,a),k=(0,h.getColsFromBreakpoint)(_,D),W=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,h.findOrGenerateResponsiveLayout)(C,S,_,_,k,W),breakpoint:_,cols:k}}static getDerivedStateFromProps(a,S){if(!(0,s.deepEqual)(a.layouts,S.layouts)){const{breakpoint:C,cols:D}=S;return{layout:(0,h.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,C,C,D,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,s.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,s.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:S,cols:C,layouts:D,compactType:_}=this.props,k=this.props.breakpoint||(0,h.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),W=this.state.breakpoint,U=(0,h.getColsFromBreakpoint)(k,C),J=N({},D);if(W!==k||a.breakpoints!==S||a.cols!==C){W in J||(J[W]=(0,i.cloneLayout)(this.state.layout));let K=(0,h.findOrGenerateResponsiveLayout)(J,S,k,W,U,_);K=(0,i.synchronizeLayoutWithChildren)(K,this.props.children,U,_,this.props.allowOverlap),J[k]=K,this.props.onBreakpointChange(k,U),this.props.onLayoutChange(K,J),this.setState({breakpoint:k,layout:K,cols:U})}const re=t(this.props.margin,k),V=t(this.props.containerPadding,k);this.props.onWidthChange(this.props.width,re,U,V)}render(){const a=this.props,{breakpoint:S,breakpoints:C,cols:D,layouts:_,margin:k,containerPadding:W,onBreakpointChange:U,onLayoutChange:J,onWidthChange:re}=a,V=R(a,b);return n.createElement(u.default,j({},V,{margin:t(k,this.state.breakpoint),containerPadding:t(W,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return yt.default=c,I(c,"propTypes",{breakpoint:o.default.string,breakpoints:o.default.object,allowOverlap:o.default.bool,cols:o.default.object,margin:o.default.oneOfType([o.default.array,o.default.object]),containerPadding:o.default.oneOfType([o.default.array,o.default.object]),layouts(f,a){if(e(f[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+e(f[a]));Object.keys(f[a]).forEach(S=>{if(!(S in f.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,i.validateLayout)(f.layouts[S],"layouts."+S)})},width:o.default.number.isRequired,onBreakpointChange:o.default.func,onLayoutChange:o.default.func,onWidthChange:o.default.func}),I(c,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:i.noop,onLayoutChange:i.noop,onWidthChange:i.noop}),yt}var Dt={},Yr=(function(){if(typeof Map<"u")return Map;function n(o,s){var i=-1;return o.some(function(h,u){return h[0]===s?(i=u,!0):!1}),i}return(function(){function o(){this.__entries__=[]}return Object.defineProperty(o.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),o.prototype.get=function(s){var i=n(this.__entries__,s),h=this.__entries__[i];return h&&h[1]},o.prototype.set=function(s,i){var h=n(this.__entries__,s);~h?this.__entries__[h][1]=i:this.__entries__.push([s,i])},o.prototype.delete=function(s){var i=this.__entries__,h=n(i,s);~h&&i.splice(h,1)},o.prototype.has=function(s){return!!~n(this.__entries__,s)},o.prototype.clear=function(){this.__entries__.splice(0)},o.prototype.forEach=function(s,i){i===void 0&&(i=null);for(var h=0,u=this.__entries__;h<u.length;h++){var b=u[h];s.call(i,b[1],b[0])}},o})()})(),Jt=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),Wn=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}})(),Hn=2;function qn(n,o){var s=!1,i=!1,h=0;function u(){s&&(s=!1,n()),i&&O()}function b(){Wn(u)}function O(){var m=Date.now();if(s){if(m-h<Hn)return;i=!0}else s=!0,i=!1,setTimeout(b,o);h=m}return O}var Bn=20,Fn=["top","right","bottom","left","width","height","size","weight"],Gn=typeof MutationObserver<"u",Yn=(function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=qn(this.refresh.bind(this),Bn)}return n.prototype.addObserver=function(o){~this.observers_.indexOf(o)||this.observers_.push(o),this.connected_||this.connect_()},n.prototype.removeObserver=function(o){var s=this.observers_,i=s.indexOf(o);~i&&s.splice(i,1),!s.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var o=this.updateObservers_();o&&this.refresh()},n.prototype.updateObservers_=function(){var o=this.observers_.filter(function(s){return s.gatherActive(),s.hasActive()});return o.forEach(function(s){return s.broadcastActive()}),o.length>0},n.prototype.connect_=function(){!Jt||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Gn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!Jt||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(o){var s=o.propertyName,i=s===void 0?"":s,h=Fn.some(function(u){return!!~i.indexOf(u)});h&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n})(),Vr=(function(n,o){for(var s=0,i=Object.keys(o);s<i.length;s++){var h=i[s];Object.defineProperty(n,h,{value:o[h],enumerable:!1,writable:!1,configurable:!0})}return n}),Ze=(function(n){var o=n&&n.ownerDocument&&n.ownerDocument.defaultView;return o||Tt}),Ur=kt(0,0,0,0);function zt(n){return parseFloat(n)||0}function $r(n){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];return o.reduce(function(i,h){var u=n["border-"+h+"-width"];return i+zt(u)},0)}function Vn(n){for(var o=["top","right","bottom","left"],s={},i=0,h=o;i<h.length;i++){var u=h[i],b=n["padding-"+u];s[u]=zt(b)}return s}function Un(n){var o=n.getBBox();return kt(0,0,o.width,o.height)}function $n(n){var o=n.clientWidth,s=n.clientHeight;if(!o&&!s)return Ur;var i=Ze(n).getComputedStyle(n),h=Vn(i),u=h.left+h.right,b=h.top+h.bottom,O=zt(i.width),m=zt(i.height);if(i.boxSizing==="border-box"&&(Math.round(O+u)!==o&&(O-=$r(i,"left","right")+u),Math.round(m+b)!==s&&(m-=$r(i,"top","bottom")+b)),!Jn(n)){var j=Math.round(O+u)-o,R=Math.round(m+b)-s;Math.abs(j)!==1&&(O-=j),Math.abs(R)!==1&&(m-=R)}return kt(h.left,h.top,O,m)}var Xn=(function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof Ze(n).SVGGraphicsElement}:function(n){return n instanceof Ze(n).SVGElement&&typeof n.getBBox=="function"}})();function Jn(n){return n===Ze(n).document.documentElement}function Kn(n){return Jt?Xn(n)?Un(n):$n(n):Ur}function Qn(n){var o=n.x,s=n.y,i=n.width,h=n.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,b=Object.create(u.prototype);return Vr(b,{x:o,y:s,width:i,height:h,top:s,right:o+i,bottom:h+s,left:o}),b}function kt(n,o,s,i){return{x:n,y:o,width:s,height:i}}var Zn=(function(){function n(o){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=kt(0,0,0,0),this.target=o}return n.prototype.isActive=function(){var o=Kn(this.target);return this.contentRect_=o,o.width!==this.broadcastWidth||o.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var o=this.contentRect_;return this.broadcastWidth=o.width,this.broadcastHeight=o.height,o},n})(),eo=(function(){function n(o,s){var i=Qn(s);Vr(this,{target:o,contentRect:i})}return n})(),to=(function(){function n(o,s,i){if(this.activeObservations_=[],this.observations_=new Yr,typeof o!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=o,this.controller_=s,this.callbackCtx_=i}return n.prototype.observe=function(o){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(o instanceof Ze(o).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(o)||(s.set(o,new Zn(o)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(o){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(o instanceof Ze(o).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(o)&&(s.delete(o),s.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var o=this;this.clearActive(),this.observations_.forEach(function(s){s.isActive()&&o.activeObservations_.push(s)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var o=this.callbackCtx_,s=this.activeObservations_.map(function(i){return new eo(i.target,i.broadcastRect())});this.callback_.call(o,s,o),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n})(),Xr=typeof WeakMap<"u"?new WeakMap:new Yr,Jr=(function(){function n(o){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var s=Yn.getInstance(),i=new to(o,s,this);Xr.set(this,i)}return n})();["observe","unobserve","disconnect"].forEach(function(n){Jr.prototype[n]=function(){var o;return(o=Xr.get(this))[n].apply(o,arguments)}});var ro=(function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:Jr})();const no=dn(Object.freeze(Object.defineProperty({__proto__:null,default:ro},Symbol.toStringTag,{value:"Module"})));var Kr;function oo(){if(Kr)return Dt;Kr=1,Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.default=I;var n=b(oe),o=u(Ue()),s=u(no),i=u(Ct());const h=["measureBeforeMount"];function u(p){return p&&p.__esModule?p:{default:p}}function b(p,l){if(typeof WeakMap=="function")var e=new WeakMap,t=new WeakMap;return(b=function(c,f){if(!f&&c&&c.__esModule)return c;var a,S,C={__proto__:null,default:c};if(c===null||typeof c!="object"&&typeof c!="function")return C;if(a=f?t:e){if(a.has(c))return a.get(c);a.set(c,C)}for(const D in c)D!=="default"&&{}.hasOwnProperty.call(c,D)&&((S=(a=Object.defineProperty)&&Object.getOwnPropertyDescriptor(c,D))&&(S.get||S.set)?a(C,D,S):C[D]=c[D]);return C})(p,l)}function O(){return O=Object.assign?Object.assign.bind():function(p){for(var l=1;l<arguments.length;l++){var e=arguments[l];for(var t in e)({}).hasOwnProperty.call(e,t)&&(p[t]=e[t])}return p},O.apply(null,arguments)}function m(p,l){if(p==null)return{};var e,t,c=j(p,l);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(p);for(t=0;t<f.length;t++)e=f[t],l.indexOf(e)===-1&&{}.propertyIsEnumerable.call(p,e)&&(c[e]=p[e])}return c}function j(p,l){if(p==null)return{};var e={};for(var t in p)if({}.hasOwnProperty.call(p,t)){if(l.indexOf(t)!==-1)continue;e[t]=p[t]}return e}function R(p,l,e){return(l=P(l))in p?Object.defineProperty(p,l,{value:e,enumerable:!0,configurable:!0,writable:!0}):p[l]=e,p}function P(p){var l=E(p,"string");return typeof l=="symbol"?l:l+""}function E(p,l){if(typeof p!="object"||!p)return p;var e=p[Symbol.toPrimitive];if(e!==void 0){var t=e.call(p,l);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(p)}const N="react-grid-layout";function I(p){var l;return l=class extends n.Component{constructor(){super(...arguments),R(this,"state",{width:1280}),R(this,"elementRef",n.createRef()),R(this,"mounted",!1),R(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new s.default(c=>{if(this.elementRef.current instanceof HTMLElement){const a=c[0].contentRect.width;this.setState({width:a})}});const t=this.elementRef.current;t instanceof HTMLElement&&this.resizeObserver.observe(t)}componentWillUnmount(){this.mounted=!1;const t=this.elementRef.current;t instanceof HTMLElement&&this.resizeObserver.unobserve(t),this.resizeObserver.disconnect()}render(){const t=this.props,{measureBeforeMount:c}=t,f=m(t,h);return c&&!this.mounted?n.createElement("div",{className:(0,i.default)(this.props.className,N),style:this.props.style,ref:this.elementRef}):n.createElement(p,O({innerRef:this.elementRef},f,this.state))}},R(l,"defaultProps",{measureBeforeMount:!1}),R(l,"propTypes",{measureBeforeMount:o.default.bool}),l}return Dt}var Qr;function io(){return Qr||(Qr=1,(function(n){n.exports=qr().default,n.exports.utils=Qe(),n.exports.calculateUtils=Ht(),n.exports.Responsive=Nn().default,n.exports.Responsive.utils=Fr(),n.exports.WidthProvider=oo().default})(Lt)),Lt.exports}var so=io();const ao=un(so);function Zr(n){const o=[];o.push(1,1,0,1,1,0,1,1);for(let s=0;s<n.length;s++){const h=(n.charCodeAt(s)%103).toString(2).padStart(7,"0");for(const u of h)o.push(u==="1"?1:0)}return o.push(1,1,0,0,0,1,1,0,0,0,1,1),o}const Kt=({value:n,format:o})=>{const s=oe.useMemo(()=>Zr(n),[n,o]);if(!n)return r.jsx("div",{style:{fontSize:11,color:"#999"},children:"请设置条形码值"});const i=2,h=44,u=s.length*i;return r.jsxs("div",{style:{textAlign:"center",overflow:"hidden",maxWidth:"100%"},children:[r.jsx("canvas",{ref:b=>{if(!b)return;const O=b.getContext("2d");O&&(b.width=u,b.height=h,O.clearRect(0,0,u,h),s.forEach((m,j)=>{O.fillStyle=m===1?"#000":"#fff",O.fillRect(j*i,0,i,h)}))},style:{width:"100%",maxWidth:u,height:h}}),r.jsx("div",{style:{fontSize:10,marginTop:1,letterSpacing:1},children:n})]})},Qt=({value:n,errorLevel:o="M",color:s="#000000",backgroundColor:i="#ffffff"})=>n?r.jsx(T.QRCode,{value:n,type:"svg",bordered:!1,errorLevel:o,color:s,bgColor:i,style:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%"}}):r.jsx("div",{style:{fontSize:11,color:"#999"},children:"请设置二维码内容"}),lo=ao,en=oe.memo(({comp:n,selected:o,isPreview:s=!1,dataSources:i=[]})=>{const h={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",outline:s?"none":o?"2px solid #1677ff":"1px dashed #d9d9d9",outlineOffset:-1},u=b=>Ke(n,b,i);switch(n.type){case"text":return r.jsx("div",{style:{...h,fontSize:n.props.fontSize||14,fontWeight:n.props.fontWeight||"normal",fontStyle:n.props.fontStyle||"normal",textAlign:n.props.textAlign||"left",color:n.props.color||"#000",backgroundColor:n.props.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:u("content")||""});case"image":const b=u("src")||n.props.src;return r.jsx("div",{style:h,children:b?r.jsx("img",{src:b,style:{width:"100%",height:"100%",objectFit:n.props.fit||"contain"},alt:""}):r.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#bbb",fontSize:12},children:"请在属性中设置图片地址"})});case"table":return r.jsx(co,{comp:n,style:h,dataSources:i});case"barcode":const O=u("value")||n.props.value||"123456";return r.jsx("div",{style:{...h,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:r.jsx(Kt,{value:O,format:n.props.format||"CODE128"})});case"qrcode":const m=u("value")||n.props.value||"https://example.com";return r.jsx("div",{style:{...h,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:r.jsx(Qt,{value:m,errorLevel:n.props.errorLevel||"M",color:n.props.color||"#000000",backgroundColor:n.props.backgroundColor||"#ffffff"})});case"line":return r.jsx("div",{style:{...h,display:"flex",alignItems:"center",border:"none",outline:o?"2px solid #1677ff":"1px dashed transparent"},children:r.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${n.props.thickness||1}px ${n.props.style||"solid"} ${n.props.color||"#000"}`,margin:0}})});default:return r.jsx("div",{style:h,children:n.type})}}),co=({comp:n,style:o,dataSources:s=[]})=>{const i=n.props.borderWidth||1,h=n.props.borderColor||"#000",u=n.tableColumns||[],b=n.props.tableDataSourceId,O=b?s.find(P=>P.id===b):null,m=O?jt(O):null;if(m&&m.length>0)return r.jsxs("table",{style:{...o,borderCollapse:"collapse",width:"100%",height:"100%"},children:[u.length>0&&r.jsx("thead",{children:r.jsx("tr",{style:{backgroundColor:"#f5f5f5"},children:u.map((P,E)=>r.jsx("th",{style:{border:`${i}px solid ${h}`,padding:4,fontSize:12,fontWeight:"bold",textAlign:"center"},children:P.title},E))})}),r.jsx("tbody",{children:m.map((P,E)=>r.jsx("tr",{children:u.map((N,I)=>r.jsx("td",{style:{border:`${i}px solid ${h}`,padding:4,fontSize:12,textAlign:"center"},children:N.fieldPath?P[N.fieldPath]:""},I))},E))})]});const j=n.props.rows||3,R=Math.max(n.props.cols||3,u.length||3);return r.jsx("table",{style:{...o,borderCollapse:"collapse",width:"100%",height:"100%"},children:r.jsx("tbody",{children:Array.from({length:j}).map((P,E)=>r.jsx("tr",{children:Array.from({length:R}).map((N,I)=>r.jsx("td",{style:{border:`${i}px solid ${h}`,padding:2,fontSize:12,textAlign:"center"},children:" "},I))},E))})})},tn=({isPreview:n=!1})=>{const o=fe(e=>e.components),s=fe(e=>e.selectedId),i=fe(e=>e.pageSettings),h=fe(e=>e.selectComponent);fe(e=>e.updateComponent);const u=fe(e=>e.setComponents),b=fe(e=>e.addComponent),O=fe(e=>e.gridSettings),m=fe(e=>e.dataSources),j=oe.useMemo(()=>{const e=bt[i.paperSize];if(!e)return{width:i.customWidth*Pe,height:i.customHeight*Pe};const t=e.width*Pe,c=e.height*Pe;return i.orientation==="landscape"?{width:c,height:t}:{width:t,height:c}},[i]),R=oe.useMemo(()=>({top:i.marginTop*Pe,right:i.marginRight*Pe,bottom:i.marginBottom*Pe,left:i.marginLeft*Pe}),[i]),P=j.width-R.left-R.right,E=j.height-R.top-R.bottom,N=oe.useMemo(()=>o.map(e=>({i:e.id,x:e.x,y:e.y,w:e.w,h:e.h})),[o]),I=oe.useCallback(e=>{const t=o.map((c,f)=>{const a=e[f];return a?{...c,x:a.x,y:a.y,w:a.w,h:a.h}:c});u(t)},[o,u]),p=oe.useCallback((e,t,c)=>{var C,D;const f=c,a=(C=f.dataTransfer)==null?void 0:C.getData("componentType");if(!a)return;const S=(D=c.target.closest(".react-grid-layout"))==null?void 0:D.getBoundingClientRect();if(S){const _=Math.floor((f.clientX-S.left)/(P/O.cols)),k=Math.floor((f.clientY-S.top)/(P/O.cols));b(a,Math.max(0,_),Math.max(0,k))}else b(a)},[b,P,O.cols]),l=oe.useCallback(e=>{h(e===s?null:e)},[h,s]);return r.jsx("div",{style:{flex:1,overflow:"auto",background:"#e8e8e8",display:"flex",justifyContent:"center",padding:"24px 0"},children:r.jsxs("div",{id:"print-paper",style:{width:j.width,height:j.height,background:"#fff",boxShadow:"0 2px 12px rgba(0,0,0,0.15)",position:"relative",flexShrink:0},children:[i.showHeader&&r.jsx("div",{style:{position:"absolute",top:0,left:R.left,right:R.right,height:R.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#999",borderBottom:"1px dashed #ddd",overflow:"hidden"},children:i.headerContent}),i.showFooter&&r.jsxs("div",{style:{position:"absolute",bottom:0,left:R.left,right:R.right,height:R.bottom,display:"flex",alignItems:"center",justifyContent:i.showPageNumber?"space-between":"center",fontSize:12,color:"#999",borderTop:"1px dashed #ddd",overflow:"hidden",padding:"0 8px"},children:[r.jsx("span",{children:i.footerContent}),i.showPageNumber&&r.jsx("span",{children:i.pageNumberFormat.replace("{page}","1")})]}),r.jsx("div",{style:{position:"absolute",top:R.top,left:R.left,width:P,height:E},children:n?r.jsx("div",{style:{width:"100%",height:"100%",position:"relative"},children:o.map(e=>{const t=P/O.cols,c=P/O.cols,f={position:"absolute",left:e.x*t,top:e.y*c,width:e.w*t,height:e.h*c};return r.jsx("div",{style:f,children:r.jsx(en,{comp:e,selected:!1,isPreview:!0,dataSources:m})},e.id)})}):r.jsx(lo,{className:"canvas-grid",layout:N,cols:O.cols,rowHeight:P/O.cols,width:P,margin:[0,0],containerPadding:[0,0],onLayoutChange:I,onDrop:p,isDroppable:!0,isResizable:!0,isDraggable:!0,compactType:null,preventCollision:!0,draggableHandle:".grid-item-drag-handle",style:{minHeight:E},children:o.map(e=>r.jsx("div",{className:"grid-item-drag-handle",onClick:()=>l(e.id),style:{cursor:"move"},children:r.jsx(en,{comp:e,selected:e.id===s,dataSources:m})},e.id))})})]})})},{Text:ke,Title:_o}=T.Typography,{TextArea:uo}=T.Input,fo=()=>{const n=fe(e=>e.components),o=fe(e=>e.selectedId),s=fe(e=>e.dataSources),i=fe(e=>e.updateComponent),h=fe(e=>e.updateComponentTableColumns),u=oe.useMemo(()=>n.find(e=>e.id===o)||null,[n,o]),[b,O]=oe.useState([]),m=oe.useMemo(()=>[{label:"无(使用静态值)",value:""},...s.map(e=>({label:e.name,value:e.id,type:e.type}))],[s]),j=oe.useCallback((e,t)=>{o&&i(o,{props:{...u==null?void 0:u.props,[e]:t}})},[o,u,i]),R=oe.useCallback((e,t,c,f)=>{if(!o)return;let a=f;t&&c&&(a=f);const S=`${e}Binding`;i(o,{props:{...u==null?void 0:u.props,[e]:a,[S]:{dataSourceId:t,fieldPath:c,staticValue:f}}})},[o,u,i]),P=oe.useCallback(e=>{const t=u==null?void 0:u.props[`${e}Binding`],c=String((u==null?void 0:u.props[e])||"");return t?{field:e,dataSourceId:t.dataSourceId||null,fieldPath:t.fieldPath||"",staticValue:t.staticValue??c}:{field:e,dataSourceId:null,fieldPath:"",staticValue:c}},[u]);if(!u)return r.jsx(T.Card,{title:"属性面板",size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16}},children:r.jsx(T.Empty,{description:"请选择画布中的组件",image:T.Empty.PRESENTED_IMAGE_SIMPLE})});const E=ar[u.type]||u.type,N=r.jsxs(r.Fragment,{children:[r.jsx(ke,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"位置和大小"}),r.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"X"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:u.x,onChange:e=>i(o,{x:e??0})})]}),r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"Y"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:u.y,onChange:e=>i(o,{y:e??0})})]}),r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"宽度"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:u.w,min:1,onChange:e=>i(o,{w:e??1})})]}),r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"高度"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:u.h,min:1,onChange:e=>i(o,{h:e??1})})]})]})]}),I=({field:e,label:t,placeholder:c,isTextarea:f=!1})=>{const a=P(e),S=s.find(W=>W.id===a.dataSourceId),C=S?St(S):null,D=C?Object.keys(C):[],[_,k]=oe.useState(a.staticValue);return oe.useEffect(()=>{k(a.staticValue)},[a.staticValue,a.dataSourceId]),r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12,display:"block",marginBottom:4},children:t}),r.jsx("div",{style:{marginBottom:4},children:r.jsx(T.Select,{size:"small",style:{width:"100%"},placeholder:"选择数据源",value:a.dataSourceId||"",onChange:W=>{R(e,W||null,W&&a.fieldPath||"",a.staticValue)},options:m})}),a.dataSourceId&&r.jsx("div",{style:{marginBottom:4},children:r.jsx(T.Select,{size:"small",style:{width:"100%"},placeholder:"选择字段",value:a.fieldPath,onChange:W=>{R(e,a.dataSourceId,W||"",a.staticValue)},options:[{label:"请选择字段",value:""},...D.map(W=>({label:W,value:W}))]})}),a.dataSourceId?r.jsxs("div",{style:{padding:6,background:"#f0f5ff",border:"1px solid #adc6ff",borderRadius:4,fontSize:12},children:[r.jsx(Oe.DatabaseOutlined,{style:{marginRight:4,color:"#1890ff"}}),r.jsx("span",{style:{fontWeight:500},children:"数据绑定已启用"}),S&&a.fieldPath&&r.jsxs("span",{style:{marginLeft:8},children:[r.jsx(T.Tag,{color:"blue",children:S.name}),r.jsx(T.Tag,{color:"green",children:a.fieldPath})]})]}):f?r.jsx(uo,{rows:3,placeholder:c,value:_,onChange:W=>k(W.target.value),onBlur:()=>{R(e,null,"",_)}}):r.jsx(T.Input,{placeholder:c,value:_,onChange:W=>k(W.target.value),onBlur:()=>{R(e,null,"",_)}})]})},p=()=>{const e=u.tableColumns||[],t=s.filter(V=>V.type==="array"),c=u.props.tableDataSourceId||"",f=t.find(V=>V.id===c),a=b.length>0?b:e,[S,C]=oe.useState({}),D=()=>{h(o,a)},_=()=>{const V=[...a,{title:`列${a.length+1}`}];O(V)},k=V=>{const K=a.filter((Q,te)=>te!==V);O(K)},W=(V,K,Q)=>{const te=[...a];te[V]={...te[V],[K]:Q},O(te)};let U=[];if(f){const V=at(f.data);Array.isArray(V)&&V.length>0&&typeof V[0]=="object"&&(U=Object.keys(V[0]))}const J=[{title:"列标题",dataIndex:"title",width:100,render:(V,K)=>{const Q=K.key in S?S[K.key]:K.title;return r.jsx(T.Input,{size:"small",value:Q,placeholder:"列标题",onChange:te=>{C({...S,[K.key]:te.target.value})},onBlur:()=>{if(K.key in S){W(Number(K.key),"title",S[K.key]);const te={...S};delete te[K.key],C(te),D()}}})}},{title:"绑定字段",dataIndex:"fieldPath",width:120,render:(V,K)=>r.jsx(T.Select,{size:"small",style:{width:"100%"},value:K.fieldPath||"",placeholder:f?"绑定字段":"选择数据源先",disabled:!f,onChange:Q=>{W(Number(K.key),"fieldPath",Q||""),D()},options:[{label:"无绑定",value:""},...U.map(Q=>({label:Q,value:Q}))]})},{title:"操作",width:60,render:(V,K)=>r.jsx(T.Popconfirm,{title:"确定要删除吗?",onConfirm:()=>{k(Number(K.key)),D()},okText:"确定",cancelText:"取消",children:r.jsx(T.Button,{type:"text",danger:!0,size:"small",icon:r.jsx(Oe.DeleteOutlined,{})})})}],re=a.map((V,K)=>({...V,key:String(K)}));return r.jsxs("div",{children:[r.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:r.jsx(ke,{style:{fontSize:12},children:"表格数据源"})}),r.jsx(T.Select,{size:"small",style:{width:"100%",marginBottom:8},placeholder:"选择数组类型数据源",value:c,onChange:V=>j("tableDataSourceId",V||""),options:[{label:"无(仅静态展示)",value:""},...t.map(V=>({label:V.name,value:V.id}))]}),r.jsx(T.Divider,{}),r.jsxs(T.Space,{style:{marginBottom:8},children:[r.jsx(ke,{style:{fontSize:12},children:"列配置"}),r.jsx(T.Button,{size:"small",type:"dashed",icon:r.jsx(Oe.PlusOutlined,{}),onClick:_}),r.jsx(T.Button,{size:"small",type:"primary",onClick:D,icon:r.jsx(Oe.SaveOutlined,{})})]}),r.jsx(T.Table,{dataSource:re,columns:J,pagination:!1,size:"small",bordered:!0,rowKey:"key"})]})},l=()=>{switch(u.type){case"text":return r.jsxs(r.Fragment,{children:[r.jsx(I,{field:"content",label:"内容",placeholder:"请输入文本内容",isTextarea:!0}),r.jsx(T.Divider,{style:{margin:"4px 0"}}),r.jsx(ke,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"文字样式"}),r.jsxs(T.Space,{style:{width:"100%"},direction:"vertical",size:4,children:[r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsxs("div",{style:{flex:1},children:[r.jsx(ke,{style:{fontSize:12},children:"字号"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:u.props.fontSize||14,min:6,max:200,onChange:e=>j("fontSize",e??14)})]}),r.jsxs("div",{style:{flex:1},children:[r.jsx(ke,{style:{fontSize:12},children:"对齐"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.textAlign||"left",onChange:e=>j("textAlign",e),options:[{value:"left",label:"左"},{value:"center",label:"中"},{value:"right",label:"右"}]})]})]}),r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsxs("div",{style:{flex:1},children:[r.jsx(ke,{style:{fontSize:12},children:"字重"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.fontWeight||"normal",onChange:e=>j("fontWeight",e),options:[{value:"normal",label:"常规"},{value:"bold",label:"加粗"}]})]}),r.jsxs("div",{style:{flex:1},children:[r.jsx(ke,{style:{fontSize:12},children:"样式"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.fontStyle||"normal",onChange:e=>j("fontStyle",e),options:[{value:"normal",label:"常规"},{value:"italic",label:"斜体"}]})]})]}),r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"字体颜色"}),r.jsx(T.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(e,t)=>j("color",t)})]}),r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"背景色"}),r.jsx(T.ColorPicker,{size:"small",value:u.props.backgroundColor||"transparent",onChange:(e,t)=>j("backgroundColor",t)})]})]})]})]});case"image":return r.jsxs(r.Fragment,{children:[r.jsx(I,{field:"src",label:"图片地址",placeholder:"输入图片 URL"}),r.jsx(T.Divider,{style:{margin:"4px 0"}}),r.jsx(ke,{style:{fontSize:12,marginTop:8,display:"block"},children:"适应方式"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.fit||"contain",onChange:e=>j("fit",e),options:[{value:"contain",label:"适应"},{value:"cover",label:"填充"},{value:"fill",label:"拉伸"}]})]});case"table":return r.jsx(p,{});case"barcode":return r.jsxs(r.Fragment,{children:[r.jsx(I,{field:"value",label:"条码值",placeholder:"输入条码内容"}),r.jsx(T.Divider,{style:{margin:"4px 0"}}),r.jsx(ke,{style:{fontSize:12,marginTop:8,display:"block"},children:"格式"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.format||"CODE128",onChange:e=>j("format",e),options:[{value:"CODE128",label:"CODE128"}]})]});case"qrcode":return r.jsxs(r.Fragment,{children:[r.jsx(I,{field:"value",label:"二维码内容",placeholder:"输入二维码内容"}),r.jsx(T.Divider,{style:{margin:"4px 0"}}),r.jsx(ke,{style:{fontSize:12,marginTop:8,display:"block"},children:"纠错级别"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.errorLevel||"M",onChange:e=>j("errorLevel",e),options:[{value:"L",label:"L - 低"},{value:"M",label:"M - 中"},{value:"Q",label:"Q - 较高"},{value:"H",label:"H - 高"}]}),r.jsxs("div",{style:{display:"flex",gap:16,marginTop:8},children:[r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"前景色"}),r.jsx(T.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(e,t)=>j("color",t)})]}),r.jsxs("div",{children:[r.jsx(ke,{style:{fontSize:12},children:"背景色"}),r.jsx(T.ColorPicker,{size:"small",value:u.props.backgroundColor||"#ffffff",onChange:(e,t)=>j("backgroundColor",t)})]})]})]});case"line":return r.jsxs(r.Fragment,{children:[r.jsxs("div",{style:{display:"flex",gap:8},children:[r.jsxs("div",{style:{flex:1},children:[r.jsx(ke,{style:{fontSize:12},children:"粗细"}),r.jsx(T.InputNumber,{size:"small",style:{width:"100%"},value:u.props.thickness||1,min:1,max:20,onChange:e=>j("thickness",e??1)})]}),r.jsxs("div",{style:{flex:1},children:[r.jsx(ke,{style:{fontSize:12},children:"样式"}),r.jsx(T.Select,{size:"small",style:{width:"100%"},value:u.props.style||"solid",onChange:e=>j("style",e),options:[{value:"solid",label:"实线"},{value:"dashed",label:"虚线"},{value:"dotted",label:"点线"}]})]})]}),r.jsxs("div",{style:{marginTop:8},children:[r.jsx(ke,{style:{fontSize:12},children:"颜色"}),r.jsx(T.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(e,t)=>j("color",t)})]})]});default:return null}};return r.jsx(T.Card,{title:`属性 - ${E}`,size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16,overflowY:"auto"}},children:r.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[N,r.jsx(T.Divider,{style:{margin:"4px 0"}}),l()]})})},{Text:Eo}=T.Typography,po=()=>{const n=fe(p=>p.previewVisible),o=fe(p=>p.setPreviewVisible),s=fe(p=>p.components),i=fe(p=>p.pageSettings),h=fe(p=>p.gridSettings)||xt,u=fe(p=>p.dataSources),b=oe.useRef(null),O=oe.useMemo(()=>{const p=bt[i.paperSize];if(!p)return{width:i.customWidth*Pe,height:i.customHeight*Pe};const l=p.width*Pe,e=p.height*Pe;return i.orientation==="landscape"?{width:e,height:l}:{width:l,height:e}},[i]),m=oe.useMemo(()=>({top:i.marginTop*Pe,right:i.marginRight*Pe,bottom:i.marginBottom*Pe,left:i.marginLeft*Pe}),[i]),j=O.width-m.left-m.right,R=j/h.cols,P=rr.useReactToPrint({contentRef:b,documentTitle:"打印模板",pageStyle:`
|
|
48
|
+
*/var qt,wr;function zn(){if(wr)return qt;wr=1;var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(u){if(u==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(u)}function c(){try{if(!Object.assign)return!1;var u=new String("abc");if(u[5]="de",Object.getOwnPropertyNames(u)[0]==="5")return!1;for(var x={},_=0;_<10;_++)x["_"+String.fromCharCode(_)]=_;var b=Object.getOwnPropertyNames(x).map(function(R){return x[R]});if(b.join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(R){v[R]=R}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return qt=c()?Object.assign:function(u,x){for(var _,b=a(u),v,R=1;R<arguments.length;R++){_=Object(arguments[R]);for(var P in _)i.call(_,P)&&(b[P]=_[P]);if(n){v=n(_);for(var C=0;C<v.length;C++)o.call(_,v[C])&&(b[v[C]]=_[v[C]])}}return b},qt}var Ft,Sr;function Yt(){if(Sr)return Ft;Sr=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ft=n,Ft}var Gt,jr;function Cr(){return jr||(jr=1,Gt=Function.call.bind(Object.prototype.hasOwnProperty)),Gt}var Vt,Or;function kn(){if(Or)return Vt;Or=1;var n={},i=function(){};if(n.NODE_ENV!=="production"){var o=Yt(),a={},c=Cr();i=function(x){var _="Warning: "+x;typeof console<"u"&&console.error(_);try{throw new Error(_)}catch{}}}function u(x,_,b,v,R){if(n.NODE_ENV!=="production"){for(var P in x)if(c(x,P)){var C;try{if(typeof x[P]!="function"){var L=Error((v||"React class")+": "+b+" type `"+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof x[P]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw L.name="Invariant Violation",L}C=x[P](_,P,v,b,null,o)}catch(y){C=y}if(C&&!(C instanceof Error)&&i((v||"React class")+": type specification of "+b+" `"+P+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof C+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),C instanceof Error&&!(C.message in a)){a[C.message]=!0;var k=R?R():"";i("Failed "+b+" type: "+C.message+(k??""))}}}}return u.resetWarningCache=function(){n.NODE_ENV!=="production"&&(a={})},Vt=u,Vt}var Ut,Rr;function Mn(){if(Rr)return Ut;Rr=1;var n={},i=xr(),o=zn(),a=Yt(),c=Cr(),u=kn(),x=function(){};n.NODE_ENV!=="production"&&(x=function(b){var v="Warning: "+b;typeof console<"u"&&console.error(v);try{throw new Error(v)}catch{}});function _(){return null}return Ut=function(b,v){var R=typeof Symbol=="function"&&Symbol.iterator,P="@@iterator";function C(I){var W=I&&(R&&I[R]||I[P]);if(typeof W=="function")return W}var L="<<anonymous>>",k={array:t("array"),bigint:t("bigint"),bool:t("boolean"),func:t("function"),number:t("number"),object:t("object"),string:t("string"),symbol:t("symbol"),any:s(),arrayOf:f,element:l(),elementType:w(),instanceOf:O,node:T(),objectOf:M,oneOf:D,oneOfType:H,shape:G,exact:X};function y(I,W){return I===W?I!==0||1/I===1/W:I!==I&&W!==W}function d(I,W){this.message=I,this.data=W&&typeof W=="object"?W:{},this.stack=""}d.prototype=Error.prototype;function r(I){if(n.NODE_ENV!=="production")var W={},ie=0;function oe(fe,ue,A,U,ee,Z,ce){if(U=U||L,Z=Z||A,ce!==a){if(v){var B=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw B.name="Invariant Violation",B}else if(n.NODE_ENV!=="production"&&typeof console<"u"){var he=U+":"+A;!W[he]&&ie<3&&(x("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+U+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),W[he]=!0,ie++)}}return ue[A]==null?fe?ue[A]===null?new d("The "+ee+" `"+Z+"` is marked as required "+("in `"+U+"`, but its value is `null`.")):new d("The "+ee+" `"+Z+"` is marked as required in "+("`"+U+"`, but its value is `undefined`.")):null:I(ue,A,U,ee,Z)}var ae=oe.bind(null,!1);return ae.isRequired=oe.bind(null,!0),ae}function t(I){function W(ie,oe,ae,fe,ue,A){var U=ie[oe],ee=K(U);if(ee!==I){var Z=re(U);return new d("Invalid "+fe+" `"+ue+"` of type "+("`"+Z+"` supplied to `"+ae+"`, expected ")+("`"+I+"`."),{expectedType:I})}return null}return r(W)}function s(){return r(_)}function f(I){function W(ie,oe,ae,fe,ue){if(typeof I!="function")return new d("Property `"+ue+"` of component `"+ae+"` has invalid PropType notation inside arrayOf.");var A=ie[oe];if(!Array.isArray(A)){var U=K(A);return new d("Invalid "+fe+" `"+ue+"` of type "+("`"+U+"` supplied to `"+ae+"`, expected an array."))}for(var ee=0;ee<A.length;ee++){var Z=I(A,ee,ae,fe,ue+"["+ee+"]",a);if(Z instanceof Error)return Z}return null}return r(W)}function l(){function I(W,ie,oe,ae,fe){var ue=W[ie];if(!b(ue)){var A=K(ue);return new d("Invalid "+ae+" `"+fe+"` of type "+("`"+A+"` supplied to `"+oe+"`, expected a single ReactElement."))}return null}return r(I)}function w(){function I(W,ie,oe,ae,fe){var ue=W[ie];if(!i.isValidElementType(ue)){var A=K(ue);return new d("Invalid "+ae+" `"+fe+"` of type "+("`"+A+"` supplied to `"+oe+"`, expected a single ReactElement type."))}return null}return r(I)}function O(I){function W(ie,oe,ae,fe,ue){if(!(ie[oe]instanceof I)){var A=I.name||L,U=ge(ie[oe]);return new d("Invalid "+fe+" `"+ue+"` of type "+("`"+U+"` supplied to `"+ae+"`, expected ")+("instance of `"+A+"`."))}return null}return r(W)}function D(I){if(!Array.isArray(I))return n.NODE_ENV!=="production"&&(arguments.length>1?x("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):x("Invalid argument supplied to oneOf, expected an array.")),_;function W(ie,oe,ae,fe,ue){for(var A=ie[oe],U=0;U<I.length;U++)if(y(A,I[U]))return null;var ee=JSON.stringify(I,function(ce,B){var he=re(B);return he==="symbol"?String(B):B});return new d("Invalid "+fe+" `"+ue+"` of value `"+String(A)+"` "+("supplied to `"+ae+"`, expected one of "+ee+"."))}return r(W)}function M(I){function W(ie,oe,ae,fe,ue){if(typeof I!="function")return new d("Property `"+ue+"` of component `"+ae+"` has invalid PropType notation inside objectOf.");var A=ie[oe],U=K(A);if(U!=="object")return new d("Invalid "+fe+" `"+ue+"` of type "+("`"+U+"` supplied to `"+ae+"`, expected an object."));for(var ee in A)if(c(A,ee)){var Z=I(A,ee,ae,fe,ue+"."+ee,a);if(Z instanceof Error)return Z}return null}return r(W)}function H(I){if(!Array.isArray(I))return n.NODE_ENV!=="production"&&x("Invalid argument supplied to oneOfType, expected an instance of array."),_;for(var W=0;W<I.length;W++){var ie=I[W];if(typeof ie!="function")return x("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+be(ie)+" at index "+W+"."),_}function oe(ae,fe,ue,A,U){for(var ee=[],Z=0;Z<I.length;Z++){var ce=I[Z],B=ce(ae,fe,ue,A,U,a);if(B==null)return null;B.data&&c(B.data,"expectedType")&&ee.push(B.data.expectedType)}var he=ee.length>0?", expected one of type ["+ee.join(", ")+"]":"";return new d("Invalid "+A+" `"+U+"` supplied to "+("`"+ue+"`"+he+"."))}return r(oe)}function T(){function I(W,ie,oe,ae,fe){return V(W[ie])?null:new d("Invalid "+ae+" `"+fe+"` supplied to "+("`"+oe+"`, expected a ReactNode."))}return r(I)}function N(I,W,ie,oe,ae){return new d((I||"React class")+": "+W+" type `"+ie+"."+oe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ae+"`.")}function G(I){function W(ie,oe,ae,fe,ue){var A=ie[oe],U=K(A);if(U!=="object")return new d("Invalid "+fe+" `"+ue+"` of type `"+U+"` "+("supplied to `"+ae+"`, expected `object`."));for(var ee in I){var Z=I[ee];if(typeof Z!="function")return N(ae,fe,ue,ee,re(Z));var ce=Z(A,ee,ae,fe,ue+"."+ee,a);if(ce)return ce}return null}return r(W)}function X(I){function W(ie,oe,ae,fe,ue){var A=ie[oe],U=K(A);if(U!=="object")return new d("Invalid "+fe+" `"+ue+"` of type `"+U+"` "+("supplied to `"+ae+"`, expected `object`."));var ee=o({},ie[oe],I);for(var Z in ee){var ce=I[Z];if(c(I,Z)&&typeof ce!="function")return N(ae,fe,ue,Z,re(ce));if(!ce)return new d("Invalid "+fe+" `"+ue+"` key `"+Z+"` supplied to `"+ae+"`.\nBad object: "+JSON.stringify(ie[oe],null," ")+`
|
|
49
|
+
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var B=ce(A,Z,ae,fe,ue+"."+Z,a);if(B)return B}return null}return r(W)}function V(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(V);if(I===null||b(I))return!0;var W=C(I);if(W){var ie=W.call(I),oe;if(W!==I.entries){for(;!(oe=ie.next()).done;)if(!V(oe.value))return!1}else for(;!(oe=ie.next()).done;){var ae=oe.value;if(ae&&!V(ae[1]))return!1}}else return!1;return!0;default:return!1}}function J(I,W){return I==="symbol"?!0:W?W["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&W instanceof Symbol:!1}function K(I){var W=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":J(W,I)?"symbol":W}function re(I){if(typeof I>"u"||I===null)return""+I;var W=K(I);if(W==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return W}function be(I){var W=re(I);switch(W){case"array":case"object":return"an "+W;case"boolean":case"date":case"regexp":return"a "+W;default:return W}}function ge(I){return!I.constructor||!I.constructor.name?L:I.constructor.name}return k.checkPropTypes=u,k.resetWarningCache=u.resetWarningCache,k.PropTypes=k,k},Ut}var $t,_r;function In(){if(_r)return $t;_r=1;var n=Yt();function i(){}function o(){}return o.resetWarningCache=i,$t=function(){function a(x,_,b,v,R,P){if(P!==n){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}a.isRequired=a;function c(){return a}var u={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:c,element:a,elementType:a,instanceOf:c,node:a,objectOf:c,oneOf:c,oneOfType:c,shape:c,exact:c,checkPropTypes:o,resetWarningCache:i};return u.PropTypes=u,u},$t}var Er;function Ue(){if(Er)return Et.exports;Er=1;var n={};if(n.NODE_ENV!=="production"){var i=xr(),o=!0;Et.exports=Mn()(i.isElement,o)}else Et.exports=In()();return Et.exports}var dt={exports:{}},Xt,Pr;function An(){if(Pr)return Xt;Pr=1;var n={},i=Object.create,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,u=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,_=(p,S)=>{for(var z in S)o(p,z,{get:S[z],enumerable:!0})},b=(p,S,z,Y)=>{if(S&&typeof S=="object"||typeof S=="function")for(let $ of c(S))!x.call(p,$)&&$!==z&&o(p,$,{get:()=>S[$],enumerable:!(Y=a(S,$))||Y.enumerable});return p},v=(p,S,z)=>(z=p!=null?i(u(p)):{},b(!p||!p.__esModule?o(z,"default",{value:p,enumerable:!0}):z,p)),R=p=>b(o({},"__esModule",{value:!0}),p),P={};_(P,{DraggableCore:()=>ye,default:()=>Ce}),Xt=R(P);var C=v(se),L=v(Ue()),k=v(It),y=_t();function d(p,S){for(let z=0,Y=p.length;z<Y;z++)if(S.apply(S,[p[z],z,p]))return p[z]}function r(p){return typeof p=="function"||Object.prototype.toString.call(p)==="[object Function]"}function t(p){return typeof p=="number"&&!isNaN(p)}function s(p){return parseInt(p,10)}function f(p,S,z){if(p[S])return new Error(`Invalid prop ${S} passed to ${z} - do not set this, set it on the child.`)}var l=["Moz","Webkit","O","ms"];function w(p="transform"){var S,z;if(typeof window>"u")return"";const Y=(z=(S=window.document)==null?void 0:S.documentElement)==null?void 0:z.style;if(!Y||p in Y)return"";for(let $=0;$<l.length;$++)if(O(p,l[$])in Y)return l[$];return""}function O(p,S){return S?`${S}${D(p)}`:p}function D(p){let S="",z=!0;for(let Y=0;Y<p.length;Y++)z?(S+=p[Y].toUpperCase(),z=!1):p[Y]==="-"?z=!0:S+=p[Y];return S}var M=w(),H="";function T(p,S){var z;H||(H=(z=d(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function($){return r(p[$])}))!=null?z:"");const Y=p[H];return r(Y)?!!Y.call(p,S):!1}function N(p,S,z){let Y=p;do{if(T(Y,S))return!0;if(Y===z)return!1;Y=Y.parentNode}while(Y);return!1}function G(p,S,z,Y){if(!p)return;const $={capture:!0,...Y},Ee=z;p.addEventListener?p.addEventListener(S,Ee,$):p.attachEvent?p.attachEvent("on"+S,Ee):p["on"+S]=Ee}function X(p,S,z,Y){if(!p)return;const $={capture:!0,...Y},Ee=z;p.removeEventListener?p.removeEventListener(S,Ee,$):p.detachEvent?p.detachEvent("on"+S,Ee):p["on"+S]=null}function V(p){let S=p.clientHeight;const z=p.ownerDocument.defaultView.getComputedStyle(p);return S+=s(z.borderTopWidth),S+=s(z.borderBottomWidth),S}function J(p){let S=p.clientWidth;const z=p.ownerDocument.defaultView.getComputedStyle(p);return S+=s(z.borderLeftWidth),S+=s(z.borderRightWidth),S}function K(p){let S=p.clientHeight;const z=p.ownerDocument.defaultView.getComputedStyle(p);return S-=s(z.paddingTop),S-=s(z.paddingBottom),S}function re(p){let S=p.clientWidth;const z=p.ownerDocument.defaultView.getComputedStyle(p);return S-=s(z.paddingLeft),S-=s(z.paddingRight),S}function be(p,S,z){const $=S===S.ownerDocument.body?{left:0,top:0}:S.getBoundingClientRect(),Ee=(p.clientX+S.scrollLeft-$.left)/z,me=(p.clientY+S.scrollTop-$.top)/z;return{x:Ee,y:me}}function ge(p,S){const z=W(p,S,"px");return{[O("transform",M)]:z}}function I(p,S){return W(p,S,"")}function W({x:p,y:S},z,Y){let $=`translate(${p}${Y},${S}${Y})`;if(z){const Ee=`${typeof z.x=="string"?z.x:z.x+Y}`,me=`${typeof z.y=="string"?z.y:z.y+Y}`;$=`translate(${Ee}, ${me})`+$}return $}function ie(p,S){return p.targetTouches&&d(p.targetTouches,z=>S===z.identifier)||p.changedTouches&&d(p.changedTouches,z=>S===z.identifier)}function oe(p){if(p.targetTouches&&p.targetTouches[0])return p.targetTouches[0].identifier;if(p.changedTouches&&p.changedTouches[0])return p.changedTouches[0].identifier}function ae(p){if(!p)return;let S=p.getElementById("react-draggable-style-el");S||(S=p.createElement("style"),S.type="text/css",S.id="react-draggable-style-el",S.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
50
|
+
`,S.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
51
|
+
`,p.getElementsByTagName("head")[0].appendChild(S)),p.body&&A(p.body,"react-draggable-transparent-selection")}function fe(p){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ue(p)}):ue(p)}function ue(p){if(p)try{p.body&&U(p.body,"react-draggable-transparent-selection");const S=p.selection;if(S)S.empty();else{const z=(p.defaultView||window).getSelection();z&&z.type!=="Caret"&&z.removeAllRanges()}}catch{}}function A(p,S){p.classList?p.classList.add(S):p.className.match(new RegExp(`(?:^|\\s)${S}(?!\\S)`))||(p.className+=` ${S}`)}function U(p,S){p.classList?p.classList.remove(S):p.className=p.className.replace(new RegExp(`(?:^|\\s)${S}(?!\\S)`,"g"),"")}function ee(p,S,z){if(!p.props.bounds)return[S,z];let{bounds:Y}=p.props;Y=typeof Y=="string"?Y:Le(Y);const $=g(p);if(typeof Y=="string"){const{ownerDocument:Ee}=$,me=Ee.defaultView;if(!me)throw new Error("Cannot resolve the owner window of the draggable node.");let Te;if(Y==="parent"?Te=$.parentNode:Te=$.getRootNode().querySelector(Y),!(Te instanceof me.HTMLElement))throw new Error('Bounds selector "'+Y+'" could not find an element.');const Me=Te,Ge=me.getComputedStyle($),$e=me.getComputedStyle(Me);Y={left:-$.offsetLeft+s($e.paddingLeft)+s(Ge.marginLeft),top:-$.offsetTop+s($e.paddingTop)+s(Ge.marginTop),right:re(Me)-J($)-$.offsetLeft+s($e.paddingRight)-s(Ge.marginRight),bottom:K(Me)-V($)-$.offsetTop+s($e.paddingBottom)-s(Ge.marginBottom)}}return t(Y.right)&&(S=Math.min(S,Y.right)),t(Y.bottom)&&(z=Math.min(z,Y.bottom)),t(Y.left)&&(S=Math.max(S,Y.left)),t(Y.top)&&(z=Math.max(z,Y.top)),[S,z]}function Z(p,S,z){const Y=Math.round(S/p[0])*p[0],$=Math.round(z/p[1])*p[1];return[Y,$]}function ce(p){return p.props.axis==="both"||p.props.axis==="x"}function B(p){return p.props.axis==="both"||p.props.axis==="y"}function he(p,S,z){const Y=typeof S=="number"?ie(p,S):null;if(typeof S=="number"&&!Y)return null;const $=g(z),Ee=z.props.offsetParent||$.offsetParent||$.ownerDocument.body;return be(Y||p,Ee,z.props.scale)}function ke(p,S,z){const Y=!t(p.lastX),$=g(p);return Y?{node:$,deltaX:0,deltaY:0,lastX:S,lastY:z,x:S,y:z}:{node:$,deltaX:S-p.lastX,deltaY:z-p.lastY,lastX:p.lastX,lastY:p.lastY,x:S,y:z}}function we(p,S){const z=p.props.scale;return{node:S.node,x:p.state.x+S.deltaX/z,y:p.state.y+S.deltaY/z,deltaX:S.deltaX/z,deltaY:S.deltaY/z,lastX:p.state.x,lastY:p.state.y}}function Le(p){return{left:p.left,top:p.top,right:p.right,bottom:p.bottom}}function g(p){const S=p.findDOMNode();if(!S)throw new Error("<DraggableCore>: Unmounted during event!");return S}var m=v(se),j=v(Ue()),q=v(It);function ne(...p){n.DRAGGABLE_DEBUG&&console.log(...p)}var Q={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}},le=Q.mouse,ye=class extends m.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=p=>{if(this.props.onMouseDown(p),!this.props.allowAnyClick&&(typeof p.button=="number"&&p.button!==0||p.ctrlKey))return!1;const S=this.findDOMNode();if(!S||!S.ownerDocument||!S.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:z}=S;if(this.props.disabled||!(p.target instanceof z.defaultView.Node)||this.props.handle&&!N(p.target,this.props.handle,S)||this.props.cancel&&N(p.target,this.props.cancel,S))return;p.type==="touchstart"&&!this.props.allowMobileScroll&&p.preventDefault();const Y=oe(p);this.touchIdentifier=Y;const $=he(p,Y,this);if($==null)return;const{x:Ee,y:me}=$,Te=ke(this,Ee,me);ne("DraggableCore: handleDragStart: %j",Te),ne("calling",this.props.onStart),!(this.props.onStart(p,Te)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&ae(z),this.dragging=!0,this.lastX=Ee,this.lastY=me,G(z,le.move,this.handleDrag),G(z,le.stop,this.handleDragStop))},this.handleDrag=p=>{const S=he(p,this.touchIdentifier,this);if(S==null)return;let{x:z,y:Y}=S;if(Array.isArray(this.props.grid)){let me=z-this.lastX,Te=Y-this.lastY;if([me,Te]=Z(this.props.grid,me,Te),!me&&!Te)return;z=this.lastX+me,Y=this.lastY+Te}const $=ke(this,z,Y);if(ne("DraggableCore: handleDrag: %j",$),this.props.onDrag(p,$)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const me=document.createEvent("MouseEvents");me.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(me)}return}this.lastX=z,this.lastY=Y},this.handleDragStop=p=>{if(!this.dragging)return;const S=he(p,this.touchIdentifier,this);if(S==null)return;let{x:z,y:Y}=S;if(Array.isArray(this.props.grid)){let Te=z-this.lastX||0,Me=Y-this.lastY||0;[Te,Me]=Z(this.props.grid,Te,Me),z=this.lastX+Te,Y=this.lastY+Me}const $=ke(this,z,Y);if(this.props.onStop(p,$)===!1||this.mounted===!1)return!1;const me=this.findDOMNode();me&&this.props.enableUserSelectHack&&fe(me.ownerDocument),ne("DraggableCore: handleDragStop: %j",$),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,me&&(ne("DraggableCore: Removing handlers"),X(me.ownerDocument,le.move,this.handleDrag),X(me.ownerDocument,le.stop,this.handleDragStop))},this.onMouseDown=p=>(le=Q.mouse,this.handleDragStart(p)),this.onMouseUp=p=>(le=Q.mouse,this.handleDragStop(p)),this.onTouchStart=p=>(le=Q.touch,this.handleDragStart(p)),this.onTouchEnd=p=>(le=Q.touch,this.handleDragStop(p))}componentDidMount(){this.mounted=!0;const p=this.findDOMNode();p&&G(p,Q.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const p=this.findDOMNode();if(p){const{ownerDocument:S}=p;X(S,Q.mouse.move,this.handleDrag),X(S,Q.touch.move,this.handleDrag),X(S,Q.mouse.stop,this.handleDragStop),X(S,Q.touch.stop,this.handleDragStop),X(p,Q.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&fe(S)}}findDOMNode(){var p;if((p=this.props)!=null&&p.nodeRef)return this.props.nodeRef.current;const S=q.default;return typeof S.findDOMNode=="function"?S.findDOMNode(this):(ne("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"),null)}render(){return m.cloneElement(m.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ye.displayName="DraggableCore",ye.propTypes={allowAnyClick:j.default.bool,allowMobileScroll:j.default.bool,children:j.default.node.isRequired,disabled:j.default.bool,enableUserSelectHack:j.default.bool,offsetParent:function(p,S){if(p[S]&&p[S].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:j.default.arrayOf(j.default.number),handle:j.default.string,cancel:j.default.string,nodeRef:j.default.object,onStart:j.default.func,onDrag:j.default.func,onStop:j.default.func,onMouseDown:j.default.func,scale:j.default.number,className:f,style:f,transform:f},ye.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Ce=class extends C.Component{constructor(p){super(p),this.onDragStart=(S,z)=>{if(ne("Draggable: onDragStart: %j",z),this.props.onStart(S,we(this,z))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(S,z)=>{if(!this.state.dragging)return!1;ne("Draggable: onDrag: %j",z);const Y=we(this,z),$={x:Y.x,y:Y.y,slackX:0,slackY:0};if(this.props.bounds){const{x:me,y:Te}=$;$.x+=this.state.slackX,$.y+=this.state.slackY;const[Me,Ge]=ee(this,$.x,$.y);$.x=Me,$.y=Ge,$.slackX=this.state.slackX+(me-$.x),$.slackY=this.state.slackY+(Te-$.y),Y.x=$.x,Y.y=$.y,Y.deltaX=$.x-this.state.x,Y.deltaY=$.y-this.state.y}if(this.props.onDrag(S,Y)===!1)return!1;this.setState($)},this.onDragStop=(S,z)=>{if(!this.state.dragging||this.props.onStop(S,we(this,z))===!1)return!1;ne("Draggable: onDragStop: %j",z);const $={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:me,y:Te}=this.props.position;$.x=me,$.y=Te}this.setState($)},this.state={dragging:!1,dragged:!1,x:p.position?p.position.x:p.defaultPosition.x,y:p.position?p.position.y:p.defaultPosition.y,prevPropsPosition:{...p.position},slackX:0,slackY:0,isElementSVG:!1},p.position&&!(p.onDrag||p.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:p},{prevPropsPosition:S}){return p&&(!S||p.x!==S.x||p.y!==S.y)?(ne("Draggable: getDerivedStateFromProps %j",{position:p,prevPropsPosition:S}),{x:p.x,y:p.y,prevPropsPosition:{...p}}):null}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var p;if((p=this.props)!=null&&p.nodeRef)return this.props.nodeRef.current;const S=k.default;return typeof S.findDOMNode=="function"?S.findDOMNode(this):null}render(){const{axis:p,bounds:S,children:z,defaultPosition:Y,defaultClassName:$,defaultClassNameDragging:Ee,defaultClassNameDragged:me,position:Te,positionOffset:Me,scale:Ge,...$e}=this.props;let mt={},et=null;const Ve=!!!Te||this.state.dragging,tt=Te||Y,rt={x:ce(this)&&Ve?this.state.x:tt.x,y:B(this)&&Ve?this.state.y:tt.y};this.state.isElementSVG?et=I(rt,Me):mt=ge(rt,Me);const nt=C.Children.only(z),tr=(0,y.clsx)(nt.props.className||"",$,{[Ee]:this.state.dragging,[me]:this.state.dragged});return C.createElement(ye,{...$e,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},C.cloneElement(nt,{className:tr,style:{...nt.props.style,...mt},transform:et}))}};return Ce.displayName="Draggable",Ce.propTypes={...ye.propTypes,axis:L.default.oneOf(["both","x","y","none"]),bounds:L.default.oneOfType([L.default.shape({left:L.default.number,right:L.default.number,top:L.default.number,bottom:L.default.number}),L.default.string,L.default.oneOf([!1])]),defaultClassName:L.default.string,defaultClassNameDragging:L.default.string,defaultClassNameDragged:L.default.string,defaultPosition:L.default.shape({x:L.default.number,y:L.default.number}),positionOffset:L.default.shape({x:L.default.oneOfType([L.default.number,L.default.string]),y:L.default.oneOfType([L.default.number,L.default.string])}),position:L.default.shape({x:L.default.number,y:L.default.number}),className:f,style:f,transform:f},Ce.defaultProps={...ye.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1},Xt}var Dr;function Jt(){if(Dr)return dt.exports;Dr=1;const n=An(),i=n.DraggableCore,o=n.default||n;return dt.exports=o,dt.exports.default=o,dt.exports.DraggableCore=i,dt.exports}var ft={exports:{}},pt={},Dt={},Tr;function Ln(){if(Tr)return Dt;Tr=1,Dt.__esModule=!0,Dt.cloneElement=_;var n=i(se);function i(b){return b&&b.__esModule?b:{default:b}}function o(b,v){var R=Object.keys(b);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(b);v&&(P=P.filter(function(C){return Object.getOwnPropertyDescriptor(b,C).enumerable})),R.push.apply(R,P)}return R}function a(b){for(var v=1;v<arguments.length;v++){var R=arguments[v]!=null?arguments[v]:{};v%2?o(Object(R),!0).forEach(function(P){c(b,P,R[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(R)):o(Object(R)).forEach(function(P){Object.defineProperty(b,P,Object.getOwnPropertyDescriptor(R,P))})}return b}function c(b,v,R){return(v=u(v))in b?Object.defineProperty(b,v,{value:R,enumerable:!0,configurable:!0,writable:!0}):b[v]=R,b}function u(b){var v=x(b,"string");return typeof v=="symbol"?v:v+""}function x(b,v){if(typeof b!="object"||!b)return b;var R=b[Symbol.toPrimitive];if(R!==void 0){var P=R.call(b,v);if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(b)}function _(b,v){return v.style&&b.props.style&&(v.style=a(a({},b.props.style),v.style)),v.className&&b.props.className&&(v.className=b.props.className+" "+v.className),n.default.cloneElement(b,v)}return Dt}var ht={},zr;function kr(){if(zr)return ht;zr=1,ht.__esModule=!0,ht.resizableProps=void 0;var n=i(Ue());Jt();function i(o){return o&&o.__esModule?o:{default:o}}return ht.resizableProps={axis:n.default.oneOf(["both","x","y","none"]),className:n.default.string,children:n.default.element.isRequired,draggableOpts:n.default.shape({allowAnyClick:n.default.bool,cancel:n.default.string,children:n.default.node,disabled:n.default.bool,enableUserSelectHack:n.default.bool,offsetParent:typeof Element<"u"?n.default.instanceOf(Element):n.default.any,grid:n.default.arrayOf(n.default.number),handle:n.default.string,nodeRef:n.default.object,onStart:n.default.func,onDrag:n.default.func,onStop:n.default.func,onMouseDown:n.default.func,scale:n.default.number}),height:function(){for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];const u=a[0];return u.axis==="both"||u.axis==="y"?n.default.number.isRequired(...a):n.default.number(...a)},handle:n.default.oneOfType([n.default.node,n.default.func]),handleSize:n.default.arrayOf(n.default.number),lockAspectRatio:n.default.bool,maxConstraints:n.default.arrayOf(n.default.number),minConstraints:n.default.arrayOf(n.default.number),onResizeStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,resizeHandles:n.default.arrayOf(n.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:n.default.number,width:function(){for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];const u=a[0];return u.axis==="both"||u.axis==="x"?n.default.number.isRequired(...a):n.default.number(...a)}},ht}var Mr;function Ir(){if(Mr)return pt;Mr=1,pt.__esModule=!0,pt.default=void 0;var n=u(se),i=Jt(),o=Ln(),a=kr();const c=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function u(k,y){if(typeof WeakMap=="function")var d=new WeakMap,r=new WeakMap;return(u=function(t,s){if(!s&&t&&t.__esModule)return t;var f,l,w={__proto__:null,default:t};if(t===null||typeof t!="object"&&typeof t!="function")return w;if(f=s?r:d){if(f.has(t))return f.get(t);f.set(t,w)}for(const O in t)O!=="default"&&{}.hasOwnProperty.call(t,O)&&((l=(f=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,O))&&(l.get||l.set)?f(w,O,l):w[O]=t[O]);return w})(k,y)}function x(){return x=Object.assign?Object.assign.bind():function(k){for(var y=1;y<arguments.length;y++){var d=arguments[y];for(var r in d)({}).hasOwnProperty.call(d,r)&&(k[r]=d[r])}return k},x.apply(null,arguments)}function _(k,y){if(k==null)return{};var d={};for(var r in k)if({}.hasOwnProperty.call(k,r)){if(y.indexOf(r)!==-1)continue;d[r]=k[r]}return d}function b(k,y){var d=Object.keys(k);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(k);y&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(k,t).enumerable})),d.push.apply(d,r)}return d}function v(k){for(var y=1;y<arguments.length;y++){var d=arguments[y]!=null?arguments[y]:{};y%2?b(Object(d),!0).forEach(function(r){R(k,r,d[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(r){Object.defineProperty(k,r,Object.getOwnPropertyDescriptor(d,r))})}return k}function R(k,y,d){return(y=P(y))in k?Object.defineProperty(k,y,{value:d,enumerable:!0,configurable:!0,writable:!0}):k[y]=d,k}function P(k){var y=C(k,"string");return typeof y=="symbol"?y:y+""}function C(k,y){if(typeof k!="object"||!k)return k;var d=k[Symbol.toPrimitive];if(d!==void 0){var r=d.call(k,y);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(k)}let L=class extends n.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(y,d){const r=this.props,t=r.minConstraints,s=r.maxConstraints,f=r.lockAspectRatio;if(!t&&!s&&!f)return[y,d];if(f){const H=this.props.width/this.props.height,T=y-this.props.width,N=d-this.props.height;Math.abs(T)>Math.abs(N*H)?d=y/H:y=d*H}const l=y,w=d;let O=this.slack||[0,0],D=O[0],M=O[1];return y+=D,d+=M,t&&(y=Math.max(t[0],y),d=Math.max(t[1],d)),s&&(y=Math.min(s[0],y),d=Math.min(s[1],d)),this.slack=[D+(l-y),M+(w-d)],[y,d]}resizeHandler(y,d){return(r,t)=>{var s,f,l,w;let O=t.node,D=t.deltaX,M=t.deltaY;y==="onResizeStart"&&this.resetData();const H=(this.props.axis==="both"||this.props.axis==="x")&&d!=="n"&&d!=="s",T=(this.props.axis==="both"||this.props.axis==="y")&&d!=="e"&&d!=="w";if(!H&&!T)return;const N=d[0],G=d[d.length-1],X=O.getBoundingClientRect();if(this.lastHandleRect!=null){if(G==="w"){const oe=X.left-this.lastHandleRect.left;D+=oe}if(N==="n"){const oe=X.top-this.lastHandleRect.top;M+=oe}}this.lastHandleRect=X,G==="w"&&(D=-D),N==="n"&&(M=-M);const V=(s=(f=this.lastSize)==null?void 0:f.width)!=null?s:this.props.width,J=(l=(w=this.lastSize)==null?void 0:w.height)!=null?l:this.props.height;let K=V+(H?D/this.props.transformScale:0),re=J+(T?M/this.props.transformScale:0);var be=this.runConstraints(K,re);if(K=be[0],re=be[1],y==="onResizeStop"&&this.lastSize){var ge=this.lastSize;K=ge.width,re=ge.height}const I=K!==V||re!==J;y!=="onResizeStop"&&(this.lastSize={width:K,height:re});const W=typeof this.props[y]=="function"?this.props[y]:null;W&&!(y==="onResize"&&!I)&&(r.persist==null||r.persist(),W(r,{node:O,size:{width:K,height:re},handle:d})),y==="onResizeStop"&&this.resetData()}}renderResizeHandle(y,d){const r=this.props.handle;if(!r)return n.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+y,ref:d});if(typeof r=="function")return r(y,d);const t=typeof r.type=="string",s=v({ref:d},t?{}:{handleAxis:y});return n.cloneElement(r,s)}render(){const y=this.props,d=y.children,r=y.className,t=y.draggableOpts;y.width,y.height,y.handle,y.handleSize,y.lockAspectRatio,y.axis,y.minConstraints,y.maxConstraints,y.onResize,y.onResizeStop,y.onResizeStart;const s=y.resizeHandles;y.transformScale;const f=_(y,c);return(0,o.cloneElement)(d,v(v({},f),{},{className:(r?r+" ":"")+"react-resizable",children:[...n.Children.toArray(d.props.children),...s.map(l=>{var w;const O=(w=this.handleRefs[l])!=null?w:this.handleRefs[l]=n.createRef();return n.createElement(i.DraggableCore,x({},t,{nodeRef:O,key:"resizableHandle-"+l,onStop:this.resizeHandler("onResizeStop",l),onStart:this.resizeHandler("onResizeStart",l),onDrag:this.resizeHandler("onResize",l)}),this.renderResizeHandle(l,O))})]}))}};return pt.default=L,L.propTypes=a.resizableProps,L.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},pt}var gt={},Ar;function Nn(){if(Ar)return gt;Ar=1,gt.__esModule=!0,gt.default=void 0;var n=x(se),i=u(Ue()),o=u(Ir()),a=kr();const c=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function u(y){return y&&y.__esModule?y:{default:y}}function x(y,d){if(typeof WeakMap=="function")var r=new WeakMap,t=new WeakMap;return(x=function(s,f){if(!f&&s&&s.__esModule)return s;var l,w,O={__proto__:null,default:s};if(s===null||typeof s!="object"&&typeof s!="function")return O;if(l=f?t:r){if(l.has(s))return l.get(s);l.set(s,O)}for(const D in s)D!=="default"&&{}.hasOwnProperty.call(s,D)&&((w=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,D))&&(w.get||w.set)?l(O,D,w):O[D]=s[D]);return O})(y,d)}function _(){return _=Object.assign?Object.assign.bind():function(y){for(var d=1;d<arguments.length;d++){var r=arguments[d];for(var t in r)({}).hasOwnProperty.call(r,t)&&(y[t]=r[t])}return y},_.apply(null,arguments)}function b(y,d){var r=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(s){return Object.getOwnPropertyDescriptor(y,s).enumerable})),r.push.apply(r,t)}return r}function v(y){for(var d=1;d<arguments.length;d++){var r=arguments[d]!=null?arguments[d]:{};d%2?b(Object(r),!0).forEach(function(t){R(y,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(r,t))})}return y}function R(y,d,r){return(d=P(d))in y?Object.defineProperty(y,d,{value:r,enumerable:!0,configurable:!0,writable:!0}):y[d]=r,y}function P(y){var d=C(y,"string");return typeof d=="symbol"?d:d+""}function C(y,d){if(typeof y!="object"||!y)return y;var r=y[Symbol.toPrimitive];if(r!==void 0){var t=r.call(y,d);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}function L(y,d){if(y==null)return{};var r={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)!==-1)continue;r[t]=y[t]}return r}let k=class extends n.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(d,r)=>{const t=r.size;this.props.onResize?(d.persist==null||d.persist(),this.setState(t,()=>this.props.onResize&&this.props.onResize(d,r))):this.setState(t)}}static getDerivedStateFromProps(d,r){return r.propsWidth!==d.width||r.propsHeight!==d.height?{width:d.width,height:d.height,propsWidth:d.width,propsHeight:d.height}:null}render(){const d=this.props,r=d.handle,t=d.handleSize;d.onResize;const s=d.onResizeStart,f=d.onResizeStop,l=d.draggableOpts,w=d.minConstraints,O=d.maxConstraints,D=d.lockAspectRatio,M=d.axis;d.width,d.height;const H=d.resizeHandles,T=d.style,N=d.transformScale,G=L(d,c);return n.createElement(o.default,{axis:M,draggableOpts:l,handle:r,handleSize:t,height:this.state.height,lockAspectRatio:D,maxConstraints:O,minConstraints:w,onResizeStart:s,onResize:this.onResize,onResizeStop:f,resizeHandles:H,transformScale:N,width:this.state.width},n.createElement("div",_({},G,{style:v(v({},T),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return gt.default=k,k.propTypes=v(v({},a.resizableProps),{},{children:i.default.element}),gt}var Lr;function Wn(){return Lr||(Lr=1,ft.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ft.exports.Resizable=Ir().default,ft.exports.ResizableBox=Nn().default),ft.exports}var Ye={},Nr;function Wr(){if(Nr)return Ye;Nr=1;var n={};Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.resizeHandleType=Ye.resizeHandleAxesType=Ye.default=void 0;var i=a(Ue()),o=a(se);function a(x){return x&&x.__esModule?x:{default:x}}const c=Ye.resizeHandleAxesType=i.default.arrayOf(i.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),u=Ye.resizeHandleType=i.default.oneOfType([i.default.node,i.default.func]);return Ye.default={className:i.default.string,style:i.default.object,width:i.default.number,autoSize:i.default.bool,cols:i.default.number,draggableCancel:i.default.string,draggableHandle:i.default.string,verticalCompact:function(x){x.verticalCompact===!1&&n.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:i.default.oneOf(["vertical","horizontal"]),layout:function(x){var _=x.layout;_!==void 0&&Qe().validateLayout(_,"layout")},margin:i.default.arrayOf(i.default.number),containerPadding:i.default.arrayOf(i.default.number),rowHeight:i.default.number,maxRows:i.default.number,isBounded:i.default.bool,isDraggable:i.default.bool,isResizable:i.default.bool,allowOverlap:i.default.bool,preventCollision:i.default.bool,useCSSTransforms:i.default.bool,transformScale:i.default.number,isDroppable:i.default.bool,resizeHandles:c,resizeHandle:u,onLayoutChange:i.default.func,onDragStart:i.default.func,onDrag:i.default.func,onDragStop:i.default.func,onResizeStart:i.default.func,onResize:i.default.func,onResizeStop:i.default.func,onDrop:i.default.func,droppingItem:i.default.shape({i:i.default.string.isRequired,w:i.default.number.isRequired,h:i.default.number.isRequired}),children:function(x,_){const b=x[_],v={};o.default.Children.forEach(b,function(R){if((R==null?void 0:R.key)!=null){if(v[R.key])throw new Error('Duplicate child key "'+R.key+'" found! This will cause problems in ReactGridLayout.');v[R.key]=!0}})},innerRef:i.default.any},Ye}var Hr;function Hn(){if(Hr)return ut;Hr=1,Object.defineProperty(ut,"__esModule",{value:!0}),ut.default=void 0;var n=v(se),i=It,o=v(Ue()),a=Jt(),c=Wn(),u=Qe(),x=Bt(),_=Wr(),b=v(_t());function v(d){return d&&d.__esModule?d:{default:d}}function R(d,r){var t=Object.keys(d);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(d);r&&(s=s.filter(function(f){return Object.getOwnPropertyDescriptor(d,f).enumerable})),t.push.apply(t,s)}return t}function P(d){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?R(Object(t),!0).forEach(function(s){C(d,s,t[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(t)):R(Object(t)).forEach(function(s){Object.defineProperty(d,s,Object.getOwnPropertyDescriptor(t,s))})}return d}function C(d,r,t){return(r=L(r))in d?Object.defineProperty(d,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):d[r]=t,d}function L(d){var r=k(d,"string");return typeof r=="symbol"?r:r+""}function k(d,r){if(typeof d!="object"||!d)return d;var t=d[Symbol.toPrimitive];if(t!==void 0){var s=t.call(d,r);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(d)}let y=class extends n.default.Component{constructor(){super(...arguments),C(this,"state",{resizing:null,dragging:null,className:""}),C(this,"elementRef",n.default.createRef()),C(this,"onDragStart",(r,t)=>{let{node:s}=t;const{onDragStart:f,transformScale:l}=this.props;if(!f)return;const w={top:0,left:0},{offsetParent:O}=s;if(!O)return;const D=O.getBoundingClientRect(),M=s.getBoundingClientRect(),H=M.left/l,T=D.left/l,N=M.top/l,G=D.top/l;w.left=H-T+O.scrollLeft,w.top=N-G+O.scrollTop,this.setState({dragging:w});const{x:X,y:V}=(0,x.calcXY)(this.getPositionParams(),w.top,w.left,this.props.w,this.props.h);return f.call(this,this.props.i,X,V,{e:r,node:s,newPosition:w})}),C(this,"onDrag",(r,t,s)=>{let{node:f,deltaX:l,deltaY:w}=t;const{onDrag:O}=this.props;if(!O)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let D=this.state.dragging.top+w,M=this.state.dragging.left+l;const{isBounded:H,i:T,w:N,h:G,containerWidth:X}=this.props,V=this.getPositionParams();if(H){const{offsetParent:be}=f;if(be){const{margin:ge,rowHeight:I}=this.props,W=be.clientHeight-(0,x.calcGridItemWHPx)(G,I,ge[1]);D=(0,x.clamp)(D,0,W);const ie=(0,x.calcGridColWidth)(V),oe=X-(0,x.calcGridItemWHPx)(N,ie,ge[0]);M=(0,x.clamp)(M,0,oe)}}const J={top:D,left:M};s?this.setState({dragging:J}):(0,i.flushSync)(()=>{this.setState({dragging:J})});const{x:K,y:re}=(0,x.calcXY)(V,D,M,N,G);return O.call(this,T,K,re,{e:r,node:f,newPosition:J})}),C(this,"onDragStop",(r,t)=>{let{node:s}=t;const{onDragStop:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:l,h:w,i:O}=this.props,{left:D,top:M}=this.state.dragging,H={top:M,left:D};this.setState({dragging:null});const{x:T,y:N}=(0,x.calcXY)(this.getPositionParams(),M,D,l,w);return f.call(this,O,T,N,{e:r,node:s,newPosition:H})}),C(this,"onResizeStop",(r,t,s)=>this.onResizeHandler(r,t,s,"onResizeStop")),C(this,"onResizeStart",(r,t,s)=>this.onResizeHandler(r,t,s,"onResizeStart")),C(this,"onResize",(r,t,s)=>this.onResizeHandler(r,t,s,"onResize"))}shouldComponentUpdate(r,t){if(this.props.children!==r.children||this.props.droppingPosition!==r.droppingPosition)return!0;const s=(0,x.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),f=(0,x.calcGridItemPosition)(this.getPositionParams(r),r.x,r.y,r.w,r.h,t);return!(0,u.fastPositionEqual)(s,f)||this.props.useCSSTransforms!==r.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(r){this.moveDroppingItem(r)}moveDroppingItem(r){const{droppingPosition:t}=this.props;if(!t)return;const s=this.elementRef.current;if(!s)return;const f=r.droppingPosition||{left:0,top:0},{dragging:l}=this.state,w=l&&t.left!==f.left||t.top!==f.top;if(!l)this.onDragStart(t.e,{node:s,deltaX:t.left,deltaY:t.top});else if(w){const O=t.left-l.left,D=t.top-l.top;this.onDrag(t.e,{node:s,deltaX:O,deltaY:D},!0)}}getPositionParams(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:r.cols,containerPadding:r.containerPadding,containerWidth:r.containerWidth,margin:r.margin,maxRows:r.maxRows,rowHeight:r.rowHeight}}createStyle(r){const{usePercentages:t,containerWidth:s,useCSSTransforms:f}=this.props;let l;return f?l=(0,u.setTransform)(r):(l=(0,u.setTopLeft)(r),t&&(l.left=(0,u.perc)(r.left/s),l.width=(0,u.perc)(r.width/s))),l}mixinDraggable(r,t){return n.default.createElement(a.DraggableCore,{disabled:!t,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},r)}curryResizeHandler(r,t){return(s,f)=>t(s,f,r)}mixinResizable(r,t,s){const{cols:f,minW:l,minH:w,maxW:O,maxH:D,transformScale:M,resizeHandles:H,resizeHandle:T}=this.props,N=this.getPositionParams(),G=(0,x.calcGridItemPosition)(N,0,0,f,0).width,X=(0,x.calcGridItemPosition)(N,0,0,l,w),V=(0,x.calcGridItemPosition)(N,0,0,O,D),J=[X.width,X.height],K=[Math.min(V.width,G),Math.min(V.height,1/0)];return n.default.createElement(c.Resizable,{draggableOpts:{disabled:!s},className:s?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:J,maxConstraints:K,onResizeStop:this.curryResizeHandler(t,this.onResizeStop),onResizeStart:this.curryResizeHandler(t,this.onResizeStart),onResize:this.curryResizeHandler(t,this.onResize),transformScale:M,resizeHandles:H,handle:T},r)}onResizeHandler(r,t,s,f){let{node:l,size:w,handle:O}=t;const D=this.props[f];if(!D)return;const{x:M,y:H,i:T,maxH:N,minH:G,containerWidth:X}=this.props,{minW:V,maxW:J}=this.props;let K=w;l&&(K=(0,u.resizeItemInDirection)(O,s,w,X),(0,i.flushSync)(()=>{this.setState({resizing:f==="onResizeStop"?null:K})}));let{w:re,h:be}=(0,x.calcWH)(this.getPositionParams(),K.width,K.height,M,H,O);re=(0,x.clamp)(re,Math.max(V,1),J),be=(0,x.clamp)(be,G,N),D.call(this,T,re,be,{e:r,node:l,size:K,handle:O})}render(){const{x:r,y:t,w:s,h:f,isDraggable:l,isResizable:w,droppingPosition:O,useCSSTransforms:D}=this.props,M=(0,x.calcGridItemPosition)(this.getPositionParams(),r,t,s,f,this.state),H=n.default.Children.only(this.props.children);let T=n.default.cloneElement(H,{ref:this.elementRef,className:(0,b.default)("react-grid-item",H.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":l,"react-draggable-dragging":!!this.state.dragging,dropping:!!O,cssTransforms:D}),style:P(P(P({},this.props.style),H.props.style),this.createStyle(M))});return T=this.mixinResizable(T,M,w),T=this.mixinDraggable(T,l),T}};return ut.default=y,C(y,"propTypes",{children:o.default.element,cols:o.default.number.isRequired,containerWidth:o.default.number.isRequired,rowHeight:o.default.number.isRequired,margin:o.default.array.isRequired,maxRows:o.default.number.isRequired,containerPadding:o.default.array.isRequired,x:o.default.number.isRequired,y:o.default.number.isRequired,w:o.default.number.isRequired,h:o.default.number.isRequired,minW:function(d,r){const t=d[r];if(typeof t!="number")return new Error("minWidth not Number");if(t>d.w||t>d.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(d,r){const t=d[r];if(typeof t!="number")return new Error("maxWidth not Number");if(t<d.w||t<d.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(d,r){const t=d[r];if(typeof t!="number")return new Error("minHeight not Number");if(t>d.h||t>d.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(d,r){const t=d[r];if(typeof t!="number")return new Error("maxHeight not Number");if(t<d.h||t<d.minH)return new Error("maxHeight smaller than item height/minHeight")},i:o.default.string.isRequired,resizeHandles:_.resizeHandleAxesType,resizeHandle:_.resizeHandleType,onDragStop:o.default.func,onDragStart:o.default.func,onDrag:o.default.func,onResizeStop:o.default.func,onResizeStart:o.default.func,onResize:o.default.func,isDraggable:o.default.bool.isRequired,isResizable:o.default.bool.isRequired,isBounded:o.default.bool.isRequired,static:o.default.bool,useCSSTransforms:o.default.bool.isRequired,transformScale:o.default.number,className:o.default.string,handle:o.default.string,cancel:o.default.string,droppingPosition:o.default.shape({e:o.default.object.isRequired,left:o.default.number.isRequired,top:o.default.number.isRequired})}),C(y,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),ut}var Br;function qr(){if(Br)return lt;Br=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.default=void 0;var n=b(se),i=Wt(),o=_(_t()),a=Qe(),c=Bt(),u=_(Hn()),x=_(Wr());function _(r){return r&&r.__esModule?r:{default:r}}function b(r,t){if(typeof WeakMap=="function")var s=new WeakMap,f=new WeakMap;return(b=function(l,w){if(!w&&l&&l.__esModule)return l;var O,D,M={__proto__:null,default:l};if(l===null||typeof l!="object"&&typeof l!="function")return M;if(O=w?f:s){if(O.has(l))return O.get(l);O.set(l,M)}for(const H in l)H!=="default"&&{}.hasOwnProperty.call(l,H)&&((D=(O=Object.defineProperty)&&Object.getOwnPropertyDescriptor(l,H))&&(D.get||D.set)?O(M,H,D):M[H]=l[H]);return M})(r,t)}function v(r,t){var s=Object.keys(r);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(r);t&&(f=f.filter(function(l){return Object.getOwnPropertyDescriptor(r,l).enumerable})),s.push.apply(s,f)}return s}function R(r){for(var t=1;t<arguments.length;t++){var s=arguments[t]!=null?arguments[t]:{};t%2?v(Object(s),!0).forEach(function(f){P(r,f,s[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(s)):v(Object(s)).forEach(function(f){Object.defineProperty(r,f,Object.getOwnPropertyDescriptor(s,f))})}return r}function P(r,t,s){return(t=C(t))in r?Object.defineProperty(r,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[t]=s,r}function C(r){var t=L(r,"string");return typeof t=="symbol"?t:t+""}function L(r,t){if(typeof r!="object"||!r)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var f=s.call(r,t);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}const k="react-grid-layout";let y=!1;try{y=/firefox/i.test(navigator.userAgent)}catch{}let d=class extends n.Component{constructor(){super(...arguments),P(this,"state",{activeDrag:null,layout:(0,a.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,a.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),P(this,"dragEnterCounter",0),P(this,"onDragStart",(t,s,f,l)=>{let{e:w,node:O}=l;const{layout:D}=this.state,M=(0,a.getLayoutItem)(D,t);if(!M)return;const H={w:M.w,h:M.h,x:M.x,y:M.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,a.cloneLayoutItem)(M),oldLayout:D,activeDrag:H}),this.props.onDragStart(D,M,M,null,w,O)}),P(this,"onDrag",(t,s,f,l)=>{let{e:w,node:O}=l;const{oldDragItem:D}=this.state;let{layout:M}=this.state;const{cols:H,allowOverlap:T,preventCollision:N}=this.props,G=(0,a.getLayoutItem)(M,t);if(!G)return;const X={w:G.w,h:G.h,x:G.x,y:G.y,placeholder:!0,i:t};M=(0,a.moveElement)(M,G,s,f,!0,N,(0,a.compactType)(this.props),H,T),this.props.onDrag(M,D,G,X,w,O),this.setState({layout:T?M:(0,a.compact)(M,(0,a.compactType)(this.props),H),activeDrag:X})}),P(this,"onDragStop",(t,s,f,l)=>{let{e:w,node:O}=l;if(!this.state.activeDrag)return;const{oldDragItem:D}=this.state;let{layout:M}=this.state;const{cols:H,preventCollision:T,allowOverlap:N}=this.props,G=(0,a.getLayoutItem)(M,t);if(!G)return;M=(0,a.moveElement)(M,G,s,f,!0,T,(0,a.compactType)(this.props),H,N);const V=N?M:(0,a.compact)(M,(0,a.compactType)(this.props),H);this.props.onDragStop(V,D,G,null,w,O);const{oldLayout:J}=this.state;this.setState({activeDrag:null,layout:V,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(V,J)}),P(this,"onResizeStart",(t,s,f,l)=>{let{e:w,node:O}=l;const{layout:D}=this.state,M=(0,a.getLayoutItem)(D,t);M&&(this.setState({oldResizeItem:(0,a.cloneLayoutItem)(M),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(D,M,M,null,w,O))}),P(this,"onResize",(t,s,f,l)=>{let{e:w,node:O,size:D,handle:M}=l;const{oldResizeItem:H}=this.state,{layout:T}=this.state,{cols:N,preventCollision:G,allowOverlap:X}=this.props;let V=!1,J,K,re;const[be,ge]=(0,a.withLayoutItem)(T,t,W=>{let ie;return K=W.x,re=W.y,["sw","w","nw","n","ne"].indexOf(M)!==-1&&(["sw","nw","w"].indexOf(M)!==-1&&(K=W.x+(W.w-s),s=W.x!==K&&K<0?W.w:s,K=K<0?0:K),["ne","n","nw"].indexOf(M)!==-1&&(re=W.y+(W.h-f),f=W.y!==re&&re<0?W.h:f,re=re<0?0:re),V=!0),G&&!X&&(ie=(0,a.getAllCollisions)(T,R(R({},W),{},{w:s,h:f,x:K,y:re})).filter(ae=>ae.i!==W.i).length>0,ie&&(re=W.y,f=W.h,K=W.x,s=W.w,V=!1)),W.w=s,W.h=f,W});if(!ge)return;J=be,V&&(J=(0,a.moveElement)(be,ge,K,re,!0,this.props.preventCollision,(0,a.compactType)(this.props),N,X));const I={w:ge.w,h:ge.h,x:ge.x,y:ge.y,static:!0,i:t};this.props.onResize(J,H,ge,I,w,O),this.setState({layout:X?J:(0,a.compact)(J,(0,a.compactType)(this.props),N),activeDrag:I})}),P(this,"onResizeStop",(t,s,f,l)=>{let{e:w,node:O}=l;const{layout:D,oldResizeItem:M}=this.state,{cols:H,allowOverlap:T}=this.props,N=(0,a.getLayoutItem)(D,t),G=T?D:(0,a.compact)(D,(0,a.compactType)(this.props),H);this.props.onResizeStop(G,M,N,null,w,O);const{oldLayout:X}=this.state;this.setState({activeDrag:null,layout:G,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(G,X)}),P(this,"onDragOver",t=>{var s;if(t.preventDefault(),t.stopPropagation(),y&&!((s=t.nativeEvent.target)!==null&&s!==void 0&&s.classList.contains(k)))return!1;const{droppingItem:f,onDropDragOver:l,margin:w,cols:O,rowHeight:D,maxRows:M,width:H,containerPadding:T,transformScale:N}=this.props,G=l==null?void 0:l(t);if(G===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const X=R(R({},f),G),{layout:V}=this.state,J=t.currentTarget.getBoundingClientRect(),K=t.clientX-J.left,re=t.clientY-J.top,be={left:K/N,top:re/N,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ge,top:I}=this.state.droppingPosition;(ge!=K||I!=re)&&this.setState({droppingPosition:be})}}else{const ge={cols:O,margin:w,maxRows:M,rowHeight:D,containerWidth:H,containerPadding:T||w},I=(0,c.calcXY)(ge,re,K,X.w,X.h);this.setState({droppingDOMNode:n.createElement("div",{key:X.i}),droppingPosition:be,layout:[...V,R(R({},X),{},{x:I.x,y:I.y,static:!1,isDraggable:!0})]})}}),P(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:s}=this.props,{layout:f}=this.state,l=(0,a.compact)(f.filter(w=>w.i!==t.i),(0,a.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:l,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),P(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),P(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),P(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,l=f.find(w=>w.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,l,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,s){let f;return s.activeDrag?null:(!(0,i.deepEqual)(t.layout,s.propsLayout)||t.compactType!==s.compactType?f=t.layout:(0,a.childrenEqual)(t.children,s.children)||(f=s.layout),f?{layout:(0,a.synchronizeLayoutWithChildren)(f,t.children,t.cols,(0,a.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,s){return this.props.children!==t.children||!(0,a.fastRGLPropsEqual)(this.props,t,i.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(t,s){if(!this.state.activeDrag){const f=this.state.layout,l=s.layout;this.onLayoutMaybeChanged(f,l)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,a.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(t,s){s||(s=this.state.layout),(0,i.deepEqual)(s,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:s,cols:f,margin:l,containerPadding:w,rowHeight:O,maxRows:D,useCSSTransforms:M,transformScale:H}=this.props;return n.createElement(u.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:s,cols:f,margin:l,containerPadding:w||l,maxRows:D,rowHeight:O,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:M,transformScale:H},n.createElement("div",null))}processGridItem(t,s){if(!t||!t.key)return;const f=(0,a.getLayoutItem)(this.state.layout,String(t.key));if(!f)return null;const{width:l,cols:w,margin:O,containerPadding:D,rowHeight:M,maxRows:H,isDraggable:T,isResizable:N,isBounded:G,useCSSTransforms:X,transformScale:V,draggableCancel:J,draggableHandle:K,resizeHandles:re,resizeHandle:be}=this.props,{mounted:ge,droppingPosition:I}=this.state,W=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&T,ie=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&N,oe=f.resizeHandles||re,ae=W&&G&&f.isBounded!==!1;return n.createElement(u.default,{containerWidth:l,cols:w,margin:O,containerPadding:D||O,maxRows:H,rowHeight:M,cancel:J,handle:K,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:W,isResizable:ie,isBounded:ae,useCSSTransforms:X&&ge,usePercentages:!ge,transformScale:V,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?I:void 0,resizeHandles:oe,resizeHandle:be},t)}render(){const{className:t,style:s,isDroppable:f,innerRef:l}=this.props,w=(0,o.default)(k,t),O=R({height:this.containerHeight()},s);return n.createElement("div",{ref:l,className:w,style:O,onDrop:f?this.onDrop:a.noop,onDragLeave:f?this.onDragLeave:a.noop,onDragEnter:f?this.onDragEnter:a.noop,onDragOver:f?this.onDragOver:a.noop},n.Children.map(this.props.children,D=>this.processGridItem(D)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return lt.default=d,P(d,"displayName","ReactGridLayout"),P(d,"propTypes",x.default),P(d,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:a.noop,onDragStart:a.noop,onDrag:a.noop,onDragStop:a.noop,onResizeStart:a.noop,onResize:a.noop,onResizeStop:a.noop,onDrop:a.noop,onDropDragOver:a.noop}),lt}var yt={},Xe={},Fr;function Yr(){if(Fr)return Xe;Fr=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.findOrGenerateResponsiveLayout=a,Xe.getBreakpointFromWidth=i,Xe.getColsFromBreakpoint=o,Xe.sortBreakpoints=c;var n=Qe();function i(u,x){const _=c(u);let b=_[0];for(let v=1,R=_.length;v<R;v++){const P=_[v];x>u[P]&&(b=P)}return b}function o(u,x){if(!x[u])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+u+" is missing!");return x[u]}function a(u,x,_,b,v,R){if(u[_])return(0,n.cloneLayout)(u[_]);let P=u[b];const C=c(x),L=C.slice(C.indexOf(_));for(let k=0,y=L.length;k<y;k++){const d=L[k];if(u[d]){P=u[d];break}}return P=(0,n.cloneLayout)(P||[]),(0,n.compact)((0,n.correctBounds)(P,{cols:v}),R,v)}function c(u){return Object.keys(u).sort(function(_,b){return u[_]-u[b]})}return Xe}var Gr;function Bn(){if(Gr)return yt;Gr=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.default=void 0;var n=b(se),i=_(Ue()),o=Wt(),a=Qe(),c=Yr(),u=_(qr());const x=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function _(f){return f&&f.__esModule?f:{default:f}}function b(f,l){if(typeof WeakMap=="function")var w=new WeakMap,O=new WeakMap;return(b=function(D,M){if(!M&&D&&D.__esModule)return D;var H,T,N={__proto__:null,default:D};if(D===null||typeof D!="object"&&typeof D!="function")return N;if(H=M?O:w){if(H.has(D))return H.get(D);H.set(D,N)}for(const G in D)G!=="default"&&{}.hasOwnProperty.call(D,G)&&((T=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(D,G))&&(T.get||T.set)?H(N,G,T):N[G]=D[G]);return N})(f,l)}function v(){return v=Object.assign?Object.assign.bind():function(f){for(var l=1;l<arguments.length;l++){var w=arguments[l];for(var O in w)({}).hasOwnProperty.call(w,O)&&(f[O]=w[O])}return f},v.apply(null,arguments)}function R(f,l){if(f==null)return{};var w,O,D=P(f,l);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(f);for(O=0;O<M.length;O++)w=M[O],l.indexOf(w)===-1&&{}.propertyIsEnumerable.call(f,w)&&(D[w]=f[w])}return D}function P(f,l){if(f==null)return{};var w={};for(var O in f)if({}.hasOwnProperty.call(f,O)){if(l.indexOf(O)!==-1)continue;w[O]=f[O]}return w}function C(f,l){var w=Object.keys(f);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(f);l&&(O=O.filter(function(D){return Object.getOwnPropertyDescriptor(f,D).enumerable})),w.push.apply(w,O)}return w}function L(f){for(var l=1;l<arguments.length;l++){var w=arguments[l]!=null?arguments[l]:{};l%2?C(Object(w),!0).forEach(function(O){k(f,O,w[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(w)):C(Object(w)).forEach(function(O){Object.defineProperty(f,O,Object.getOwnPropertyDescriptor(w,O))})}return f}function k(f,l,w){return(l=y(l))in f?Object.defineProperty(f,l,{value:w,enumerable:!0,configurable:!0,writable:!0}):f[l]=w,f}function y(f){var l=d(f,"string");return typeof l=="symbol"?l:l+""}function d(f,l){if(typeof f!="object"||!f)return f;var w=f[Symbol.toPrimitive];if(w!==void 0){var O=w.call(f,l);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(f)}const r=f=>Object.prototype.toString.call(f);function t(f,l){return f==null?null:Array.isArray(f)?f:f[l]}let s=class extends n.Component{constructor(){super(...arguments),k(this,"state",this.generateInitialState()),k(this,"onLayoutChange",l=>{this.props.onLayoutChange(l,L(L({},this.props.layouts),{},{[this.state.breakpoint]:l}))})}generateInitialState(){const{width:l,breakpoints:w,layouts:O,cols:D}=this.props,M=(0,c.getBreakpointFromWidth)(w,l),H=(0,c.getColsFromBreakpoint)(M,D),T=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,c.findOrGenerateResponsiveLayout)(O,w,M,M,H,T),breakpoint:M,cols:H}}static getDerivedStateFromProps(l,w){if(!(0,o.deepEqual)(l.layouts,w.layouts)){const{breakpoint:O,cols:D}=w;return{layout:(0,c.findOrGenerateResponsiveLayout)(l.layouts,l.breakpoints,O,O,D,l.compactType),layouts:l.layouts}}return null}componentDidUpdate(l){(this.props.width!=l.width||this.props.breakpoint!==l.breakpoint||!(0,o.deepEqual)(this.props.breakpoints,l.breakpoints)||!(0,o.deepEqual)(this.props.cols,l.cols))&&this.onWidthChange(l)}onWidthChange(l){const{breakpoints:w,cols:O,layouts:D,compactType:M}=this.props,H=this.props.breakpoint||(0,c.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),T=this.state.breakpoint,N=(0,c.getColsFromBreakpoint)(H,O),G=L({},D);if(T!==H||l.breakpoints!==w||l.cols!==O){T in G||(G[T]=(0,a.cloneLayout)(this.state.layout));let J=(0,c.findOrGenerateResponsiveLayout)(G,w,H,T,N,M);J=(0,a.synchronizeLayoutWithChildren)(J,this.props.children,N,M,this.props.allowOverlap),G[H]=J,this.props.onBreakpointChange(H,N),this.props.onLayoutChange(J,G),this.setState({breakpoint:H,layout:J,cols:N})}const X=t(this.props.margin,H),V=t(this.props.containerPadding,H);this.props.onWidthChange(this.props.width,X,N,V)}render(){const l=this.props,{breakpoint:w,breakpoints:O,cols:D,layouts:M,margin:H,containerPadding:T,onBreakpointChange:N,onLayoutChange:G,onWidthChange:X}=l,V=R(l,x);return n.createElement(u.default,v({},V,{margin:t(H,this.state.breakpoint),containerPadding:t(T,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return yt.default=s,k(s,"propTypes",{breakpoint:i.default.string,breakpoints:i.default.object,allowOverlap:i.default.bool,cols:i.default.object,margin:i.default.oneOfType([i.default.array,i.default.object]),containerPadding:i.default.oneOfType([i.default.array,i.default.object]),layouts(f,l){if(r(f[l])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+r(f[l]));Object.keys(f[l]).forEach(w=>{if(!(w in f.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,a.validateLayout)(f.layouts[w],"layouts."+w)})},width:i.default.number.isRequired,onBreakpointChange:i.default.func,onLayoutChange:i.default.func,onWidthChange:i.default.func}),k(s,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:a.noop,onLayoutChange:a.noop,onWidthChange:a.noop}),yt}var Tt={},Vr=(function(){if(typeof Map<"u")return Map;function n(i,o){var a=-1;return i.some(function(c,u){return c[0]===o?(a=u,!0):!1}),a}return(function(){function i(){this.__entries__=[]}return Object.defineProperty(i.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),i.prototype.get=function(o){var a=n(this.__entries__,o),c=this.__entries__[a];return c&&c[1]},i.prototype.set=function(o,a){var c=n(this.__entries__,o);~c?this.__entries__[c][1]=a:this.__entries__.push([o,a])},i.prototype.delete=function(o){var a=this.__entries__,c=n(a,o);~c&&a.splice(c,1)},i.prototype.has=function(o){return!!~n(this.__entries__,o)},i.prototype.clear=function(){this.__entries__.splice(0)},i.prototype.forEach=function(o,a){a===void 0&&(a=null);for(var c=0,u=this.__entries__;c<u.length;c++){var x=u[c];o.call(a,x[1],x[0])}},i})()})(),Kt=typeof window<"u"&&typeof document<"u"&&window.document===document,zt=(function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()})(),qn=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(zt):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}})(),Fn=2;function Yn(n,i){var o=!1,a=!1,c=0;function u(){o&&(o=!1,n()),a&&_()}function x(){qn(u)}function _(){var b=Date.now();if(o){if(b-c<Fn)return;a=!0}else o=!0,a=!1,setTimeout(x,i);c=b}return _}var Gn=20,Vn=["top","right","bottom","left","width","height","size","weight"],Un=typeof MutationObserver<"u",$n=(function(){function n(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Yn(this.refresh.bind(this),Gn)}return n.prototype.addObserver=function(i){~this.observers_.indexOf(i)||this.observers_.push(i),this.connected_||this.connect_()},n.prototype.removeObserver=function(i){var o=this.observers_,a=o.indexOf(i);~a&&o.splice(a,1),!o.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var i=this.updateObservers_();i&&this.refresh()},n.prototype.updateObservers_=function(){var i=this.observers_.filter(function(o){return o.gatherActive(),o.hasActive()});return i.forEach(function(o){return o.broadcastActive()}),i.length>0},n.prototype.connect_=function(){!Kt||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Un?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){!Kt||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(i){var o=i.propertyName,a=o===void 0?"":o,c=Vn.some(function(u){return!!~a.indexOf(u)});c&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n})(),Ur=(function(n,i){for(var o=0,a=Object.keys(i);o<a.length;o++){var c=a[o];Object.defineProperty(n,c,{value:i[c],enumerable:!1,writable:!1,configurable:!0})}return n}),Ze=(function(n){var i=n&&n.ownerDocument&&n.ownerDocument.defaultView;return i||zt}),$r=Mt(0,0,0,0);function kt(n){return parseFloat(n)||0}function Xr(n){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return i.reduce(function(a,c){var u=n["border-"+c+"-width"];return a+kt(u)},0)}function Xn(n){for(var i=["top","right","bottom","left"],o={},a=0,c=i;a<c.length;a++){var u=c[a],x=n["padding-"+u];o[u]=kt(x)}return o}function Jn(n){var i=n.getBBox();return Mt(0,0,i.width,i.height)}function Kn(n){var i=n.clientWidth,o=n.clientHeight;if(!i&&!o)return $r;var a=Ze(n).getComputedStyle(n),c=Xn(a),u=c.left+c.right,x=c.top+c.bottom,_=kt(a.width),b=kt(a.height);if(a.boxSizing==="border-box"&&(Math.round(_+u)!==i&&(_-=Xr(a,"left","right")+u),Math.round(b+x)!==o&&(b-=Xr(a,"top","bottom")+x)),!Zn(n)){var v=Math.round(_+u)-i,R=Math.round(b+x)-o;Math.abs(v)!==1&&(_-=v),Math.abs(R)!==1&&(b-=R)}return Mt(c.left,c.top,_,b)}var Qn=(function(){return typeof SVGGraphicsElement<"u"?function(n){return n instanceof Ze(n).SVGGraphicsElement}:function(n){return n instanceof Ze(n).SVGElement&&typeof n.getBBox=="function"}})();function Zn(n){return n===Ze(n).document.documentElement}function eo(n){return Kt?Qn(n)?Jn(n):Kn(n):$r}function to(n){var i=n.x,o=n.y,a=n.width,c=n.height,u=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,x=Object.create(u.prototype);return Ur(x,{x:i,y:o,width:a,height:c,top:o,right:i+a,bottom:c+o,left:i}),x}function Mt(n,i,o,a){return{x:n,y:i,width:o,height:a}}var ro=(function(){function n(i){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Mt(0,0,0,0),this.target=i}return n.prototype.isActive=function(){var i=eo(this.target);return this.contentRect_=i,i.width!==this.broadcastWidth||i.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var i=this.contentRect_;return this.broadcastWidth=i.width,this.broadcastHeight=i.height,i},n})(),no=(function(){function n(i,o){var a=to(o);Ur(this,{target:i,contentRect:a})}return n})(),oo=(function(){function n(i,o,a){if(this.activeObservations_=[],this.observations_=new Vr,typeof i!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=i,this.controller_=o,this.callbackCtx_=a}return n.prototype.observe=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof Ze(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var o=this.observations_;o.has(i)||(o.set(i,new ro(i)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(i){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(i instanceof Ze(i).Element))throw new TypeError('parameter 1 is not of type "Element".');var o=this.observations_;o.has(i)&&(o.delete(i),o.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var i=this;this.clearActive(),this.observations_.forEach(function(o){o.isActive()&&i.activeObservations_.push(o)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var i=this.callbackCtx_,o=this.activeObservations_.map(function(a){return new no(a.target,a.broadcastRect())});this.callback_.call(i,o,i),this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n})(),Jr=typeof WeakMap<"u"?new WeakMap:new Vr,Kr=(function(){function n(i){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var o=$n.getInstance(),a=new oo(i,o,this);Jr.set(this,a)}return n})();["observe","unobserve","disconnect"].forEach(function(n){Kr.prototype[n]=function(){var i;return(i=Jr.get(this))[n].apply(i,arguments)}});var io=(function(){return typeof zt.ResizeObserver<"u"?zt.ResizeObserver:Kr})();const so=fn(Object.freeze(Object.defineProperty({__proto__:null,default:io},Symbol.toStringTag,{value:"Module"})));var Qr;function ao(){if(Qr)return Tt;Qr=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.default=k;var n=x(se),i=u(Ue()),o=u(so),a=u(_t());const c=["measureBeforeMount"];function u(y){return y&&y.__esModule?y:{default:y}}function x(y,d){if(typeof WeakMap=="function")var r=new WeakMap,t=new WeakMap;return(x=function(s,f){if(!f&&s&&s.__esModule)return s;var l,w,O={__proto__:null,default:s};if(s===null||typeof s!="object"&&typeof s!="function")return O;if(l=f?t:r){if(l.has(s))return l.get(s);l.set(s,O)}for(const D in s)D!=="default"&&{}.hasOwnProperty.call(s,D)&&((w=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,D))&&(w.get||w.set)?l(O,D,w):O[D]=s[D]);return O})(y,d)}function _(){return _=Object.assign?Object.assign.bind():function(y){for(var d=1;d<arguments.length;d++){var r=arguments[d];for(var t in r)({}).hasOwnProperty.call(r,t)&&(y[t]=r[t])}return y},_.apply(null,arguments)}function b(y,d){if(y==null)return{};var r,t,s=v(y,d);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(y);for(t=0;t<f.length;t++)r=f[t],d.indexOf(r)===-1&&{}.propertyIsEnumerable.call(y,r)&&(s[r]=y[r])}return s}function v(y,d){if(y==null)return{};var r={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)!==-1)continue;r[t]=y[t]}return r}function R(y,d,r){return(d=P(d))in y?Object.defineProperty(y,d,{value:r,enumerable:!0,configurable:!0,writable:!0}):y[d]=r,y}function P(y){var d=C(y,"string");return typeof d=="symbol"?d:d+""}function C(y,d){if(typeof y!="object"||!y)return y;var r=y[Symbol.toPrimitive];if(r!==void 0){var t=r.call(y,d);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}const L="react-grid-layout";function k(y){var d;return d=class extends n.Component{constructor(){super(...arguments),R(this,"state",{width:1280}),R(this,"elementRef",n.createRef()),R(this,"mounted",!1),R(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new o.default(s=>{if(this.elementRef.current instanceof HTMLElement){const l=s[0].contentRect.width;this.setState({width:l})}});const t=this.elementRef.current;t instanceof HTMLElement&&this.resizeObserver.observe(t)}componentWillUnmount(){this.mounted=!1;const t=this.elementRef.current;t instanceof HTMLElement&&this.resizeObserver.unobserve(t),this.resizeObserver.disconnect()}render(){const t=this.props,{measureBeforeMount:s}=t,f=b(t,c);return s&&!this.mounted?n.createElement("div",{className:(0,a.default)(this.props.className,L),style:this.props.style,ref:this.elementRef}):n.createElement(y,_({innerRef:this.elementRef},f,this.state))}},R(d,"defaultProps",{measureBeforeMount:!1}),R(d,"propTypes",{measureBeforeMount:i.default.bool}),d}return Tt}var Zr;function lo(){return Zr||(Zr=1,(function(n){n.exports=qr().default,n.exports.utils=Qe(),n.exports.calculateUtils=Bt(),n.exports.Responsive=Bn().default,n.exports.Responsive.utils=Yr(),n.exports.WidthProvider=ao().default})(Nt)),Nt.exports}var co=lo();const uo=dn(co);function en(n){const i=[];i.push(1,1,0,1,1,0,1,1);for(let o=0;o<n.length;o++){const c=(n.charCodeAt(o)%103).toString(2).padStart(7,"0");for(const u of c)i.push(u==="1"?1:0)}return i.push(1,1,0,0,0,1,1,0,0,0,1,1),i}const Qt=({value:n,format:i})=>{const o=se.useMemo(()=>en(n),[n,i]);if(!n)return e.jsx("div",{style:{fontSize:11,color:"#999"},children:"请设置条形码值"});const a=2,c=44,u=o.length*a;return e.jsxs("div",{style:{textAlign:"center",overflow:"hidden",maxWidth:"100%"},children:[e.jsx("canvas",{ref:x=>{if(!x)return;const _=x.getContext("2d");_&&(x.width=u,x.height=c,_.clearRect(0,0,u,c),o.forEach((b,v)=>{_.fillStyle=b===1?"#000":"#fff",_.fillRect(v*a,0,a,c)}))},style:{width:"100%",maxWidth:u,height:c}}),e.jsx("div",{style:{fontSize:10,marginTop:1,letterSpacing:1},children:n})]})},Zt=({value:n,errorLevel:i="M",color:o="#000000",backgroundColor:a="#ffffff"})=>n?e.jsx(E.QRCode,{value:n,type:"svg",bordered:!1,errorLevel:i,color:o,bgColor:a,style:{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%"}}):e.jsx("div",{style:{fontSize:11,color:"#999"},children:"请设置二维码内容"}),fo=uo,tn=se.memo(({comp:n,selected:i,isPreview:o=!1,dataSources:a=[]})=>{const c={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",outline:o?"none":i?"2px solid #1677ff":"1px dashed #d9d9d9",outlineOffset:-1},u=x=>Ke(n,x,a);switch(n.type){case"text":return e.jsx("div",{style:{...c,fontSize:n.props.fontSize||14,fontWeight:n.props.fontWeight||"normal",fontStyle:n.props.fontStyle||"normal",textAlign:n.props.textAlign||"left",color:n.props.color||"#000",backgroundColor:n.props.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:wt(u("content")||"",n.props.format)});case"image":const x=u("src")||n.props.src;return e.jsx("div",{style:c,children:x?e.jsx("img",{src:x,style:{width:"100%",height:"100%",objectFit:n.props.fit||"contain"},alt:""}):e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#bbb",fontSize:12},children:"请在属性中设置图片地址"})});case"table":return e.jsx(po,{comp:n,style:c,dataSources:a});case"barcode":const _=u("value")||n.props.value||"123456";return e.jsx("div",{style:{...c,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(Qt,{value:_,format:n.props.format||"CODE128"})});case"qrcode":const b=u("value")||n.props.value||"https://example.com";return e.jsx("div",{style:{...c,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(Zt,{value:b,errorLevel:n.props.errorLevel||"M",color:n.props.color||"#000000",backgroundColor:n.props.backgroundColor||"#ffffff"})});case"line":return e.jsx("div",{style:{...c,display:"flex",alignItems:"center",border:"none",outline:i?"2px solid #1677ff":"1px dashed transparent"},children:e.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${n.props.thickness||1}px ${n.props.style||"solid"} ${n.props.color||"#000"}`,margin:0}})});default:return e.jsx("div",{style:c,children:n.type})}}),po=({comp:n,style:i,dataSources:o=[]})=>{const a=n.props.borderWidth||1,c=n.props.borderColor||"#000",u=n.props.headerBackgroundColor||"#f5f5f5",x=n.props.headerColor||"#000000",_=n.props.headerFontSize||12,b=n.tableColumns||[],v=n.props.tableDataSourceId,R=v?o.find(k=>k.id===v):null,P=R?Ct(R):null;if(P&&P.length>0)return e.jsxs("table",{style:{...i,borderCollapse:"collapse",width:"100%",height:"100%"},children:[b.length>0&&e.jsx("thead",{children:e.jsx("tr",{style:{backgroundColor:u},children:b.map((k,y)=>e.jsx("th",{style:{border:`${a}px solid ${c}`,padding:4,fontSize:_,fontWeight:"bold",textAlign:"center",color:x},children:k.title},y))})}),e.jsx("tbody",{children:P.map((k,y)=>e.jsx("tr",{children:b.map((d,r)=>e.jsx("td",{style:{border:`${a}px solid ${c}`,padding:4,fontSize:12,textAlign:"center"},children:d.fieldPath?k[d.fieldPath]:""},r))},y))})]});const C=n.props.rows||3,L=Math.max(n.props.cols||3,b.length||3);return e.jsx("table",{style:{...i,borderCollapse:"collapse",width:"100%",height:"100%"},children:e.jsx("tbody",{children:Array.from({length:C}).map((k,y)=>e.jsx("tr",{children:Array.from({length:L}).map((d,r)=>e.jsx("td",{style:{border:`${a}px solid ${c}`,padding:2,fontSize:12,textAlign:"center"},children:" "},r))},y))})})},rn=({isPreview:n=!1,dataSources:i})=>{const o=pe(s=>s.components),a=pe(s=>s.selectedId),c=pe(s=>s.pageSettings),u=pe(s=>s.selectComponent);pe(s=>s.updateComponent);const x=pe(s=>s.setComponents),_=pe(s=>s.addComponent),b=pe(s=>s.gridSettings),v=pe(s=>s.dataSources),R=i||v,P=se.useMemo(()=>{const s=bt[c.paperSize];if(!s)return{width:c.customWidth*De,height:c.customHeight*De};const f=s.width*De,l=s.height*De;return c.orientation==="landscape"?{width:l,height:f}:{width:f,height:l}},[c]),C=se.useMemo(()=>({top:c.marginTop*De,right:c.marginRight*De,bottom:c.marginBottom*De,left:c.marginLeft*De}),[c]),L=P.width-C.left-C.right,k=P.height-C.top-C.bottom,y=se.useMemo(()=>o.map(s=>({i:s.id,x:s.x,y:s.y,w:s.w,h:s.h})),[o]),d=se.useCallback(s=>{const f=o.map((l,w)=>{const O=s[w];return O?{...l,x:O.x,y:O.y,w:O.w,h:O.h}:l});x(f)},[o,x]),r=se.useCallback((s,f,l)=>{var M,H;const w=l,O=(M=w.dataTransfer)==null?void 0:M.getData("componentType");if(!O)return;const D=(H=l.target.closest(".react-grid-layout"))==null?void 0:H.getBoundingClientRect();if(D){const T=Math.floor((w.clientX-D.left)/(L/b.cols)),N=Math.floor((w.clientY-D.top)/(L/b.cols));_(O,Math.max(0,T),Math.max(0,N))}else _(O)},[_,L,b.cols]),t=se.useCallback(s=>{u(s===a?null:s)},[u,a]);return e.jsx("div",{style:{flex:1,overflow:"auto",background:"#e8e8e8",display:"flex",justifyContent:"center",padding:"24px 0"},children:e.jsxs("div",{id:"print-paper",style:{width:P.width,height:P.height,background:"#fff",boxShadow:"0 2px 12px rgba(0,0,0,0.15)",position:"relative",flexShrink:0},children:[c.showHeader&&e.jsx("div",{style:{position:"absolute",top:0,left:C.left,right:C.right,height:C.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,color:"#999",borderBottom:"1px dashed #ddd",overflow:"hidden"},children:c.headerContent}),c.showFooter&&e.jsxs("div",{style:{position:"absolute",bottom:0,left:C.left,right:C.right,height:C.bottom,display:"flex",alignItems:"center",justifyContent:c.showPageNumber?"space-between":"center",fontSize:12,color:"#999",borderTop:"1px dashed #ddd",overflow:"hidden",padding:"0 8px"},children:[e.jsx("span",{children:c.footerContent}),c.showPageNumber&&e.jsx("span",{children:c.pageNumberFormat.replace("{page}","1")})]}),e.jsx("div",{style:{position:"absolute",top:C.top,left:C.left,width:L,height:k},children:n?e.jsx("div",{style:{width:"100%",height:"100%",position:"relative"},children:o.map(s=>{const f=L/b.cols,l=L/b.cols,w={position:"absolute",left:s.x*f,top:s.y*l,width:s.w*f,height:s.h*l};return e.jsx("div",{style:w,children:e.jsx(tn,{comp:s,selected:!1,isPreview:!0,dataSources:R})},s.id)})}):e.jsx(fo,{className:"canvas-grid",layout:y,cols:b.cols,rowHeight:L/b.cols,width:L,margin:[0,0],containerPadding:[0,0],onLayoutChange:d,onDrop:r,isDroppable:!0,isResizable:!0,isDraggable:!0,compactType:null,preventCollision:!0,draggableHandle:".grid-item-drag-handle",style:{minHeight:k},children:o.map(s=>e.jsx("div",{className:"grid-item-drag-handle",onClick:()=>t(s.id),style:{cursor:"move"},children:e.jsx(tn,{comp:s,selected:s.id===a,dataSources:R})},s.id))})})]})})},{Text:je,Title:Do}=E.Typography,{TextArea:ho}=E.Input,go=()=>{const n=pe(r=>r.components),i=pe(r=>r.selectedId),o=pe(r=>r.dataSources),a=pe(r=>r.updateComponent),c=pe(r=>r.updateComponentTableColumns),u=se.useMemo(()=>n.find(r=>r.id===i)||null,[n,i]),[x,_]=se.useState([]),b=se.useMemo(()=>[{label:"无(使用静态值)",value:""},...o.map(r=>({label:r.name,value:r.id,type:r.type}))],[o]),v=se.useCallback((r,t)=>{i&&a(i,{props:{...u==null?void 0:u.props,[r]:t}})},[i,u,a]),R=se.useCallback((r,t,s,f)=>{if(!i)return;let l=f;t&&s&&(l=f);const w=`${r}Binding`;a(i,{props:{...u==null?void 0:u.props,[r]:l,[w]:{dataSourceId:t,fieldPath:s,staticValue:f}}})},[i,u,a]),P=se.useCallback(r=>{const t=u==null?void 0:u.props[`${r}Binding`],s=String((u==null?void 0:u.props[r])||"");return t?{field:r,dataSourceId:t.dataSourceId||null,fieldPath:t.fieldPath||"",staticValue:t.staticValue??s}:{field:r,dataSourceId:null,fieldPath:"",staticValue:s}},[u]);if(!u)return e.jsx(E.Card,{title:"属性面板",size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16}},children:e.jsx(E.Empty,{description:"请选择画布中的组件",image:E.Empty.PRESENTED_IMAGE_SIMPLE})});const C=lr[u.type]||u.type,L=e.jsxs(e.Fragment,{children:[e.jsx(je,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:8},children:"位置和大小"}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12},children:"X"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:u.x,onChange:r=>a(i,{x:r??0})})]}),e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12},children:"Y"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:u.y,onChange:r=>a(i,{y:r??0})})]}),e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12},children:"宽度"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:u.w,min:1,onChange:r=>a(i,{w:r??1})})]}),e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12},children:"高度"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:u.h,min:1,onChange:r=>a(i,{h:r??1})})]})]})]}),k=({field:r,label:t,placeholder:s,isTextarea:f=!1})=>{const l=P(r),w=o.find(T=>T.id===l.dataSourceId),O=w?jt(w):null,D=O?Object.keys(O):[],[M,H]=se.useState(l.staticValue);return se.useEffect(()=>{H(l.staticValue)},[l.staticValue,l.dataSourceId]),e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12,display:"block",marginBottom:4},children:t}),e.jsx("div",{style:{marginBottom:4},children:e.jsx(E.Select,{size:"small",style:{width:"100%"},placeholder:"选择数据源",value:l.dataSourceId||"",onChange:T=>{R(r,T||null,T&&l.fieldPath||"",l.staticValue)},options:b})}),l.dataSourceId&&e.jsx("div",{style:{marginBottom:4},children:e.jsx(E.Select,{size:"small",style:{width:"100%"},placeholder:"选择字段",value:l.fieldPath,onChange:T=>{R(r,l.dataSourceId,T||"",l.staticValue)},options:[{label:"请选择字段",value:""},...D.map(T=>({label:T,value:T}))]})}),l.dataSourceId?e.jsxs("div",{style:{padding:6,background:"#f0f5ff",border:"1px solid #adc6ff",borderRadius:4,fontSize:12},children:[e.jsx(Oe.DatabaseOutlined,{style:{marginRight:4,color:"#1890ff"}}),e.jsx("span",{style:{fontWeight:500},children:"数据绑定已启用"}),w&&l.fieldPath&&e.jsxs("span",{style:{marginLeft:8},children:[e.jsx(E.Tag,{color:"blue",children:w.name}),e.jsx(E.Tag,{color:"green",children:l.fieldPath})]})]}):f?e.jsx(ho,{rows:3,placeholder:s,value:M,onChange:T=>H(T.target.value),onBlur:()=>{R(r,null,"",M)}}):e.jsx(E.Input,{placeholder:s,value:M,onChange:T=>H(T.target.value),onBlur:()=>{R(r,null,"",M)}})]})},y=()=>{const r=u.tableColumns||[],t=o.filter(V=>V.type==="array"),s=u.props.tableDataSourceId||"",f=t.find(V=>V.id===s),l=x.length>0?x:r,[w,O]=se.useState({}),D=()=>{c(i,l)},M=()=>{const V=[...l,{title:`列${l.length+1}`}];_(V)},H=V=>{const J=l.filter((K,re)=>re!==V);_(J)},T=(V,J,K)=>{const re=[...l];re[V]={...re[V],[J]:K},_(re)};let N=[];if(f){const V=at(f.data);Array.isArray(V)&&V.length>0&&typeof V[0]=="object"&&(N=Object.keys(V[0]))}const G=[{title:"列标题",dataIndex:"title",width:100,render:(V,J)=>{const K=J.key in w?w[J.key]:J.title;return e.jsx(E.Input,{size:"small",value:K,placeholder:"列标题",onChange:re=>{O({...w,[J.key]:re.target.value})},onBlur:()=>{if(J.key in w){T(Number(J.key),"title",w[J.key]);const re={...w};delete re[J.key],O(re),D()}}})}},{title:"绑定字段",dataIndex:"fieldPath",width:120,render:(V,J)=>e.jsx(E.Select,{size:"small",style:{width:"100%"},value:J.fieldPath||"",placeholder:f?"绑定字段":"选择数据源先",disabled:!f,onChange:K=>{T(Number(J.key),"fieldPath",K||""),D()},options:[{label:"无绑定",value:""},...N.map(K=>({label:K,value:K}))]})},{title:"操作",width:60,render:(V,J)=>e.jsx(E.Popconfirm,{title:"确定要删除吗?",onConfirm:()=>{H(Number(J.key)),D()},okText:"确定",cancelText:"取消",children:e.jsx(E.Button,{type:"text",danger:!0,size:"small",icon:e.jsx(Oe.DeleteOutlined,{})})})}],X=l.map((V,J)=>({...V,key:String(J)}));return e.jsxs("div",{children:[e.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:e.jsx(je,{style:{fontSize:12},children:"表格数据源"})}),e.jsx(E.Select,{size:"small",style:{width:"100%",marginBottom:8},placeholder:"选择数组类型数据源",value:s,onChange:V=>v("tableDataSourceId",V||""),options:[{label:"无(仅静态展示)",value:""},...t.map(V=>({label:V.name,value:V.id}))]}),e.jsx(E.Divider,{}),e.jsxs(E.Space,{style:{marginBottom:8},children:[e.jsx(je,{style:{fontSize:12},children:"列配置"}),e.jsx(E.Button,{size:"small",type:"dashed",icon:e.jsx(Oe.PlusOutlined,{}),onClick:M}),e.jsx(E.Button,{size:"small",type:"primary",onClick:D,icon:e.jsx(Oe.SaveOutlined,{})})]}),e.jsx(E.Table,{dataSource:X,columns:G,pagination:!1,size:"small",style:{width:"280px"},bordered:!0,rowKey:"key"})]})},d=()=>{switch(u.type){case"text":return e.jsxs(e.Fragment,{children:[e.jsx(k,{field:"content",label:"内容",placeholder:"请输入文本内容",isTextarea:!0}),e.jsx(je,{style:{fontSize:12,marginTop:8,display:"block"},children:"格式"}),e.jsx(E.Input,{size:"small",placeholder:"例如 yyyyMMdd 或 yyyy-MM-dd HH:mm:ss",value:u.props.format||"",onChange:r=>v("format",r.target.value)}),e.jsx(E.Divider,{style:{margin:"4px 0"}}),e.jsx(je,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"文字样式"}),e.jsxs(E.Space,{style:{width:"100%"},direction:"vertical",size:4,children:[e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:12},children:"字号"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:u.props.fontSize||14,min:6,max:200,onChange:r=>v("fontSize",r??14)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:12},children:"对齐"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.textAlign||"left",onChange:r=>v("textAlign",r),options:[{value:"left",label:"左"},{value:"center",label:"中"},{value:"right",label:"右"}]})]})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:12},children:"字重"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.fontWeight||"normal",onChange:r=>v("fontWeight",r),options:[{value:"normal",label:"常规"},{value:"bold",label:"加粗"}]})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:12},children:"样式"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.fontStyle||"normal",onChange:r=>v("fontStyle",r),options:[{value:"normal",label:"常规"},{value:"italic",label:"斜体"}]})]})]}),e.jsxs(E.Space,{children:[e.jsx(je,{style:{fontSize:12},children:"字体颜色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(r,t)=>v("color",t)}),e.jsx(je,{style:{fontSize:12},children:"背景色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.backgroundColor||"transparent",onChange:(r,t)=>v("backgroundColor",t)})]})]})]});case"image":return e.jsxs(e.Fragment,{children:[e.jsx(k,{field:"src",label:"图片地址",placeholder:"输入图片 URL"}),e.jsx(E.Divider,{style:{margin:"4px 0"}}),e.jsx(je,{style:{fontSize:12,marginTop:8,display:"block"},children:"适应方式"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.fit||"contain",onChange:r=>v("fit",r),options:[{value:"contain",label:"适应"},{value:"cover",label:"填充"},{value:"fill",label:"拉伸"}]})]});case"table":return e.jsxs(e.Fragment,{children:[e.jsx(je,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"边框样式"}),e.jsxs(E.Space,{children:[e.jsx(je,{style:{fontSize:12},children:"粗细"}),e.jsx(E.InputNumber,{size:"small",value:u.props.borderWidth||1,min:0,max:20,onChange:r=>v("borderWidth",r??1)}),e.jsx(je,{style:{fontSize:12},children:"颜色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.borderColor||"#000000",onChange:(r,t)=>v("borderColor",t)})]}),e.jsx(E.Divider,{style:{margin:"4px 0"}}),e.jsx(je,{type:"secondary",style:{fontSize:12,display:"block",marginBottom:4},children:"列标题样式"}),e.jsxs(E.Space,{children:[e.jsx(je,{style:{fontSize:12},children:"字号"}),e.jsx(E.InputNumber,{size:"small",value:u.props.headerFontSize||12,min:6,max:200,onChange:r=>v("headerFontSize",r??12)})]}),e.jsxs(E.Space,{children:[e.jsx(je,{style:{fontSize:12},children:"背景色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.headerBackgroundColor||"#f5f5f5",onChange:(r,t)=>v("headerBackgroundColor",t)}),e.jsx(je,{style:{fontSize:12},children:"字体颜色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.headerColor||"#000000",onChange:(r,t)=>v("headerColor",t)})]}),e.jsx(E.Divider,{style:{margin:"4px 0"}}),e.jsx(y,{})]});case"barcode":return e.jsxs(e.Fragment,{children:[e.jsx(k,{field:"value",label:"条码值",placeholder:"输入条码内容"}),e.jsx(E.Divider,{style:{margin:"4px 0"}}),e.jsx(je,{style:{fontSize:12,marginTop:8,display:"block"},children:"格式"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.format||"CODE128",onChange:r=>v("format",r),options:[{value:"CODE128",label:"CODE128"}]})]});case"qrcode":return e.jsxs(e.Fragment,{children:[e.jsx(k,{field:"value",label:"二维码内容",placeholder:"输入二维码内容"}),e.jsx(E.Divider,{style:{margin:"4px 0"}}),e.jsx(je,{style:{fontSize:12,marginTop:8,display:"block"},children:"纠错级别"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.errorLevel||"M",onChange:r=>v("errorLevel",r),options:[{value:"L",label:"L - 低"},{value:"M",label:"M - 中"},{value:"Q",label:"Q - 较高"},{value:"H",label:"H - 高"}]}),e.jsxs("div",{style:{display:"flex",gap:16,marginTop:8},children:[e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12},children:"前景色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(r,t)=>v("color",t)})]}),e.jsxs("div",{children:[e.jsx(je,{style:{fontSize:12},children:"背景色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.backgroundColor||"#ffffff",onChange:(r,t)=>v("backgroundColor",t)})]})]})]});case"line":return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:12},children:"粗细"}),e.jsx(E.InputNumber,{size:"small",style:{width:"100%"},value:u.props.thickness||1,min:1,max:20,onChange:r=>v("thickness",r??1)})]}),e.jsxs("div",{style:{flex:1},children:[e.jsx(je,{style:{fontSize:12},children:"样式"}),e.jsx(E.Select,{size:"small",style:{width:"100%"},value:u.props.style||"solid",onChange:r=>v("style",r),options:[{value:"solid",label:"实线"},{value:"dashed",label:"虚线"},{value:"dotted",label:"点线"}]})]})]}),e.jsxs("div",{style:{marginTop:8},children:[e.jsx(je,{style:{fontSize:12},children:"颜色"}),e.jsx(E.ColorPicker,{size:"small",value:u.props.color||"#000000",onChange:(r,t)=>v("color",t)})]})]});default:return null}};return e.jsx(E.Card,{title:`属性 - ${C}`,size:"small",style:{height:"100%",borderRadius:0,borderLeft:0},styles:{body:{padding:16,overflowY:"auto"}},children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[L,e.jsx(E.Divider,{style:{margin:"4px 0"}}),d()]})})},{Text:To}=E.Typography,yo=({dataSources:n})=>{const i=pe(r=>r.previewVisible),o=pe(r=>r.setPreviewVisible),a=pe(r=>r.components),c=pe(r=>r.pageSettings),u=pe(r=>r.gridSettings)||xt,x=pe(r=>r.dataSources),_=n||x,b=se.useRef(null),v=se.useMemo(()=>{const r=bt[c.paperSize];if(!r)return{width:c.customWidth*De,height:c.customHeight*De};const t=r.width*De,s=r.height*De;return c.orientation==="landscape"?{width:s,height:t}:{width:t,height:s}},[c]),R=se.useMemo(()=>({top:c.marginTop*De,right:c.marginRight*De,bottom:c.marginBottom*De,left:c.marginLeft*De}),[c]),P=v.width-R.left-R.right,C=P/u.cols,L=nr.useReactToPrint({contentRef:b,documentTitle:"打印模板",pageStyle:`
|
|
52
52
|
@page {
|
|
53
|
-
size: ${
|
|
54
|
-
margin: ${
|
|
53
|
+
size: ${v.width/De}mm ${v.height/De}mm;
|
|
54
|
+
margin: ${c.marginTop}mm ${c.marginRight}mm ${c.marginBottom}mm ${c.marginLeft}mm;
|
|
55
55
|
}
|
|
56
56
|
@media print {
|
|
57
57
|
html, body { margin: 0; padding: 0; }
|
|
58
58
|
}
|
|
59
|
-
`}),
|
|
59
|
+
`}),k=(r,t)=>{const s=r.props[`${t}Binding`];if(s&&s.dataSourceId&&s.fieldPath){const f=_.find(l=>l.id===s.dataSourceId);if(f&&f.type==="object"){const l=jt(f);if(l){const w=St(l,s.fieldPath);if(w!=="")return w}}}return(s==null?void 0:s.staticValue)??String(r.props[t]||"")},y=r=>{const t=r.props.tableDataSourceId,s=t?_.find(N=>N.id===t):null,f=s?Ct(s):null,l=r.tableColumns||[],w=r.props.borderWidth||1,O=r.props.borderColor||"#000000",D=r.props.headerBackgroundColor||"#f5f5f5",M=r.props.headerColor||"#000000",H=r.props.headerFontSize||12,T=f||Array.from({length:r.props.rows||3}).map(()=>({}));return e.jsxs("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsx("tr",{children:l.map((N,G)=>e.jsx("th",{style:{border:`${w}px solid ${O}`,padding:4,textAlign:"center",fontSize:H,fontWeight:"bold",backgroundColor:D,color:M},children:N.title||`列${G+1}`},G))})}),e.jsx("tbody",{children:T.map((N,G)=>e.jsx("tr",{children:l.map((X,V)=>e.jsx("td",{style:{border:`${w}px solid ${O}`,padding:4,textAlign:"center",fontSize:12},children:X.fieldPath?St(N,X.fieldPath):""},V))},G))})]})},d=r=>{const t=r.props,s={position:"absolute",left:r.x*C,top:r.y*C,width:r.w*C,height:r.h*C,overflow:"hidden"},f={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box"};switch(r.type){case"text":return e.jsx("div",{style:s,children:e.jsx("div",{style:{...f,fontSize:t.fontSize||14,fontWeight:t.fontWeight||"normal",fontStyle:t.fontStyle||"normal",textAlign:t.textAlign||"left",color:t.color||"#000",backgroundColor:t.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:wt(k(r,"content"),t.format)})},r.id);case"image":return e.jsx("div",{style:s,children:e.jsx("div",{style:f,children:t.src?e.jsx("img",{src:k(r,"src"),style:{width:"100%",height:"100%",objectFit:t.fit||"contain"},alt:""}):null})},r.id);case"table":return e.jsx("div",{style:s,children:y(r)},r.id);case"barcode":return e.jsx("div",{style:s,children:e.jsx("div",{style:{...f,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(Qt,{value:k(r,"value"),format:t.format||"CODE128"})})},r.id);case"qrcode":return e.jsx("div",{style:s,children:e.jsx("div",{style:{...f,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(Zt,{value:k(r,"value"),errorLevel:t.errorLevel||"M",color:t.color||"#000000",backgroundColor:t.backgroundColor||"#ffffff"})})},r.id);case"line":return e.jsx("div",{style:s,children:e.jsx("div",{style:{...f,display:"flex",alignItems:"center",border:"none"},children:e.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${t.thickness||1}px ${t.style||"solid"} ${t.color||"#000"}`,margin:0}})})},r.id);default:return null}};return e.jsxs(E.Modal,{title:"打印预览",open:i,onCancel:()=>o(!1),width:v.width+80,footer:e.jsxs(E.Space,{children:[e.jsx(E.Button,{onClick:()=>o(!1),children:"关闭"}),e.jsx(E.Button,{type:"primary",icon:e.jsx(Oe.PrinterOutlined,{}),onClick:()=>L(),children:"打印"})]}),styles:{body:{padding:16,display:"flex",flexDirection:"column",alignItems:"center"}},children:[e.jsx(E.Divider,{style:{margin:"4px 0 12px 0"}}),e.jsxs("div",{ref:b,style:{width:v.width,height:v.height,background:"#fff",border:"1px solid #d9d9d9",position:"relative",overflow:"hidden",flexShrink:0},children:[c.showHeader&&e.jsx("div",{style:{position:"absolute",top:0,left:R.left,right:R.right,height:R.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,overflow:"hidden"},children:c.headerContent}),c.showFooter&&e.jsxs("div",{style:{position:"absolute",bottom:0,left:R.left,right:R.right,height:R.bottom,display:"flex",alignItems:"center",justifyContent:c.showPageNumber?"space-between":"center",fontSize:12,overflow:"hidden",padding:"0 8px"},children:[e.jsx("span",{children:c.footerContent}),c.showPageNumber&&e.jsx("span",{children:c.pageNumberFormat.replace("{page}","1")})]}),e.jsx("div",{style:{position:"absolute",top:R.top,left:R.left,width:P,height:v.height-R.top-R.bottom},children:a.map(d)})]})]})},mo=()=>{const n=pe(c=>c.headerFooterVisible),i=pe(c=>c.pageSettings),o=pe(c=>c.setPageSettings),a=pe(c=>c.setHeaderFooterVisible);return e.jsx(E.Modal,{title:"页眉页脚设置",open:n,onCancel:()=>a(!1),onOk:()=>a(!1),width:480,children:e.jsxs(E.Form,{layout:"vertical",style:{marginTop:8},children:[e.jsx(E.Form.Item,{label:"显示页眉",children:e.jsx(E.Switch,{checked:i.showHeader,onChange:c=>o({showHeader:c})})}),i.showHeader&&e.jsx(E.Form.Item,{label:"页眉内容",children:e.jsx(E.Input,{value:i.headerContent,onChange:c=>o({headerContent:c.target.value})})}),e.jsx(E.Form.Item,{label:"显示页脚",children:e.jsx(E.Switch,{checked:i.showFooter,onChange:c=>o({showFooter:c})})}),i.showFooter&&e.jsxs(e.Fragment,{children:[e.jsx(E.Form.Item,{label:"页脚内容",children:e.jsx(E.Input,{value:i.footerContent,onChange:c=>o({footerContent:c.target.value})})}),e.jsx(E.Form.Item,{label:"显示页码",children:e.jsx(E.Switch,{checked:i.showPageNumber,onChange:c=>o({showPageNumber:c})})}),i.showPageNumber&&e.jsx(E.Form.Item,{label:"页码格式",children:e.jsx(E.Input,{value:i.pageNumberFormat,onChange:c=>o({pageNumberFormat:c.target.value}),placeholder:"第 {page} 页"})})]})]})})},nn=({isPreview:n=!1,initialTemplateData:i,dataSource:o,onSave:a,onPrint:c})=>{const{importJSON:u,exportJSON:x,reset:_,components:b,pageSettings:v,gridSettings:R,dataSources:P}=pe(),C=se.useRef(null),[L,k]=se.useState(!1),[y,d]=se.useState(!1);se.useEffect(()=>{if(i){const T=JSON.stringify(i),N=u(T);N&&(console.error("导入失败:",N),_())}},[i,u,_]);const r=()=>{if(a)try{const T=x();a(JSON.parse(T))}catch(T){console.error("导出失败:",T)}},t=se.useMemo(()=>{const T=bt[v.paperSize];if(!T)return{width:v.customWidth*De,height:v.customHeight*De};const N=T.width*De,G=T.height*De;return v.orientation==="landscape"?{width:G,height:N}:{width:N,height:G}},[v]),s=se.useMemo(()=>({top:v.marginTop*De,right:v.marginRight*De,bottom:v.marginBottom*De,left:v.marginLeft*De}),[v]),f=t.width-s.left-s.right,l=f/((R==null?void 0:R.cols)||xt.cols),w=se.useMemo(()=>{if(!o)return P;const T=o.data&&typeof o.data=="object",N=Array.isArray(o.list),G=T?JSON.stringify(o.data):null,X=N?JSON.stringify(o.list):null;let V=!1,J=!1;const K=P.map(re=>re.type==="object"&&G!==null?(V=!0,{...re,data:G}):re.type==="array"&&X!==null?(J=!0,{...re,data:X}):re);return G!==null&&!V&&K.push({id:"external_data",name:"外部对象数据",type:"object",data:G,createdAt:0}),X!==null&&!J&&K.push({id:"external_list",name:"外部列表数据",type:"array",data:X,createdAt:0}),K},[o,P]),O=nr.useReactToPrint({contentRef:C,documentTitle:"打印模板",pageStyle:`
|
|
60
60
|
@page {
|
|
61
|
-
size: ${
|
|
62
|
-
margin: ${
|
|
61
|
+
size: ${t.width/De}mm ${t.height/De}mm;
|
|
62
|
+
margin: ${v.marginTop}mm ${v.marginRight}mm ${v.marginBottom}mm ${v.marginLeft}mm;
|
|
63
63
|
}
|
|
64
64
|
@media print {
|
|
65
65
|
html, body { margin: 0; padding: 0; }
|
|
66
66
|
}
|
|
67
|
-
`}),
|
|
67
|
+
`}),D=()=>{c?c():O()},M=T=>{const N=T.props,G={position:"absolute",left:T.x*l,top:T.y*l,width:T.w*l,height:T.h*l,overflow:"hidden"},X={width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box"};switch(T.type){case"text":return e.jsx("div",{style:G,children:e.jsx("div",{style:{...X,fontSize:N.fontSize||14,fontWeight:N.fontWeight||"normal",fontStyle:N.fontStyle||"normal",textAlign:N.textAlign||"left",color:N.color||"#000",backgroundColor:N.backgroundColor||"transparent",padding:4,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:wt(Ke(T,"content",w),N.format)})},T.id);case"image":return e.jsx("div",{style:G,children:e.jsx("div",{style:X,children:N.src?e.jsx("img",{src:Ke(T,"src",w),style:{width:"100%",height:"100%",objectFit:N.fit||"contain"},alt:""}):null})},T.id);case"table":return e.jsx("div",{style:G,children:H(T)},T.id);case"barcode":return e.jsx("div",{style:G,children:e.jsx("div",{style:{...X,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(Qt,{value:Ke(T,"value",w),format:N.format||"CODE128"})})},T.id);case"qrcode":return e.jsx("div",{style:G,children:e.jsx("div",{style:{...X,display:"flex",alignItems:"center",justifyContent:"center",padding:4},children:e.jsx(Zt,{value:Ke(T,"value",w),errorLevel:N.errorLevel||"M",color:N.color||"#000000",backgroundColor:N.backgroundColor||"#ffffff"})})},T.id);case"line":return e.jsx("div",{style:G,children:e.jsx("div",{style:{...X,display:"flex",alignItems:"center",border:"none"},children:e.jsx("hr",{style:{width:"100%",border:"none",borderTop:`${N.thickness||1}px ${N.style||"solid"} ${N.color||"#000"}`,margin:0}})})},T.id);default:return null}},H=T=>{const N=T.props.tableDataSourceId,G=N?w.find(ie=>ie.id===N):null,X=G?Ct(G):null,V=T.tableColumns||[],J=T.props.borderWidth||1,K=T.props.borderColor||"#000000",re=T.props.headerBackgroundColor||"#f5f5f5",be=T.props.headerColor||"#000000",ge=T.props.headerFontSize||12;if(X&&X.length>0)return e.jsxs("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:[V.length>0&&e.jsx("thead",{children:e.jsx("tr",{style:{backgroundColor:re},children:V.map((ie,oe)=>e.jsx("th",{style:{border:`${J}px solid ${K}`,padding:4,fontSize:ge,fontWeight:"bold",textAlign:"center",color:be},children:ie.title},oe))})}),e.jsx("tbody",{children:X.map((ie,oe)=>e.jsx("tr",{children:V.map((ae,fe)=>e.jsx("td",{style:{border:`${J}px solid ${K}`,padding:4,fontSize:12,textAlign:"center"},children:ae.fieldPath?ie[ae.fieldPath]:""},fe))},oe))})]});const I=T.props.rows||3,W=Math.max(T.props.cols||3,V.length||3);return e.jsx("table",{style:{width:"100%",height:"100%",borderCollapse:"collapse"},children:e.jsx("tbody",{children:Array.from({length:I}).map((ie,oe)=>e.jsx("tr",{children:Array.from({length:W}).map((ae,fe)=>e.jsx("td",{style:{border:`${J}px solid ${K}`,padding:2,fontSize:12,textAlign:"center"},children:" "},fe))},oe))})})};return n?e.jsx(E.App,{children:e.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[e.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid #e8e8e8",background:"#fff"},children:e.jsx(E.Space,{children:e.jsx(E.Button,{type:"primary",icon:e.jsx(Oe.PrinterOutlined,{}),onClick:D,children:"打印"})})}),e.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"16px",boxSizing:"border-box",overflowY:"auto",background:"#e8e8e8"},children:e.jsx("div",{style:{flexShrink:0},children:e.jsx(rn,{isPreview:!0,dataSources:w})})}),e.jsx("div",{style:{position:"absolute",left:"-9999px",top:"-9999px"},children:e.jsxs("div",{ref:C,style:{width:t.width,height:t.height,background:"#fff",position:"relative",overflow:"hidden"},children:[v.showHeader&&e.jsx("div",{style:{position:"absolute",top:0,left:s.left,right:s.right,height:s.top,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,overflow:"hidden"},children:v.headerContent}),v.showFooter&&e.jsxs("div",{style:{position:"absolute",bottom:0,left:s.left,right:s.right,height:s.bottom,display:"flex",alignItems:"center",justifyContent:v.showPageNumber?"space-between":"center",fontSize:12,overflow:"hidden",padding:"0 8px"},children:[e.jsx("span",{children:v.footerContent}),v.showPageNumber&&e.jsx("span",{children:v.pageNumberFormat.replace("{page}","1")})]}),e.jsx("div",{style:{position:"absolute",top:s.top,left:s.left,width:f,height:t.height-s.top-s.bottom},children:b.map(M)})]})})]})}):e.jsx(E.App,{children:e.jsxs("div",{className:"app-container",children:[e.jsx(mn,{onCustomSave:a?r:void 0,onCustomPrint:c}),e.jsxs("div",{className:"app-body",children:[e.jsx("div",{className:`app-left-panel ${L?"collapsed":""}`,children:L?e.jsx(E.Button,{type:"text",className:"panel-collapsed-trigger",icon:e.jsx(Oe.MenuUnfoldOutlined,{}),onClick:()=>k(!1),title:"展开左侧面板"}):e.jsxs(e.Fragment,{children:[e.jsx(E.Button,{type:"text",className:"panel-collapse-trigger panel-collapse-trigger-left",icon:e.jsx(Oe.MenuFoldOutlined,{}),onClick:()=>k(!0),title:"折叠左侧面板"}),e.jsx(_n,{})]})}),e.jsx(rn,{dataSources:w}),e.jsx("div",{className:`app-right-panel ${y?"collapsed":""}`,children:y?e.jsx(E.Button,{type:"text",className:"panel-collapsed-trigger",icon:e.jsx(Oe.MenuFoldOutlined,{}),onClick:()=>d(!1),title:"展开属性面板"}):e.jsxs(e.Fragment,{children:[e.jsx(E.Button,{type:"text",className:"panel-collapse-trigger panel-collapse-trigger-right",icon:e.jsx(Oe.MenuUnfoldOutlined,{}),onClick:()=>d(!0),title:"折叠属性面板"}),e.jsx(go,{})]})})]}),e.jsx(yo,{dataSources:w}),e.jsx(mo,{})]})})};Ae.PrintDesigner=nn,Ae.default=nn,Ae.formatRenderValue=wt,Ae.getArrayFromDataSource=Ct,Ae.getObjectFromDataSource=jt,Ae.getRenderValue=Ke,Ae.getValueByPath=St,Ae.safeParseJSON=at,Ae.useDesignerStore=pe,Object.defineProperties(Ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|