@object-ui/plugin-dashboard 0.5.0 → 2.0.0
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +14 -0
- package/dist/index.css +1 -1
- package/dist/index.js +3518 -4750
- package/dist/index.umd.cjs +5 -5
- package/dist/src/DashboardGridLayout.d.ts +1 -1
- package/dist/src/DashboardGridLayout.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -7
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/DashboardGridLayout.tsx +63 -62
- package/src/DashboardRenderer.tsx +4 -4
- package/src/index.tsx +2 -60
- package/dist/src/ReportBuilder.d.ts +0 -11
- package/dist/src/ReportBuilder.d.ts.map +0 -1
- package/dist/src/ReportRenderer.d.ts +0 -15
- package/dist/src/ReportRenderer.d.ts.map +0 -1
- package/dist/src/ReportViewer.d.ts +0 -11
- package/dist/src/ReportViewer.d.ts.map +0 -1
- package/src/ReportBuilder.tsx +0 -625
- package/src/ReportRenderer.tsx +0 -89
- package/src/ReportViewer.tsx +0 -232
- package/src/__tests__/ReportBuilder.test.tsx +0 -115
- package/src/__tests__/ReportViewer.test.tsx +0 -107
package/dist/index.umd.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(xe,Ye){typeof exports=="object"&&typeof module<"u"?Ye(exports,require("@object-ui/core"),require("react"),require("@object-ui/react"),require("@object-ui/components"),require("lucide-react"),require("react-dom"),require("clsx")):typeof define=="function"&&define.amd?define(["exports","@object-ui/core","react","@object-ui/react","@object-ui/components","lucide-react","react-dom","clsx"],Ye):(xe=typeof globalThis<"u"?globalThis:xe||self,Ye(xe.ObjectUIPluginDashboard={},xe.ObjectUICore,xe.React,xe.ObjectUIReact,xe.ObjectUIComponents,xe.LucideIcons,xe.ReactDOM,xe.clsx))})(this,(function(xe,Ye,C,wt,Q,Te,Cr,Gt){"use strict";function Er(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const tt=Er(C),Pr=Er(Te);var St={exports:{}},ut={};var Or;function Nn(){if(Or)return ut;Or=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var l=null;if(i!==void 0&&(l=""+i),o.key!==void 0&&(l=""+o.key),"key"in o){i={};for(var u in o)u!=="key"&&(i[u]=o[u])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:l,ref:o!==void 0?o:null,props:i}}return ut.Fragment=t,ut.jsx=r,ut.jsxs=r,ut}var ct={};var Rr;function An(){return Rr||(Rr=1,process.env.NODE_ENV!=="production"&&(function(){function e(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===q?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case a:return"Fragment";case h:return"Profiler";case s:return"StrictMode";case E:return"Suspense";case g:return"SuspenseList";case Y:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case c:return"Portal";case S:return f.displayName||"Context";case y:return(f._context.displayName||"Context")+".Consumer";case b:var j=f.render;return f=f.displayName,f||(f=j.displayName||j.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case x:return j=f.displayName||null,j!==null?j:e(f.type)||"Memo";case R:j=f._payload,f=f._init;try{return e(f(j))}catch{}}return null}function t(f){return""+f}function r(f){try{t(f);var j=!1}catch{j=!0}if(j){j=console;var k=j.error,M=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return k.call(j,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",M),t(f)}}function n(f){if(f===a)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===R)return"<...>";try{var j=e(f);return j?"<"+j+">":"<...>"}catch{return"<...>"}}function o(){var f=V.A;return f===null?null:f.getOwner()}function i(){return Error("react-stack-top-frame")}function l(f){if(A.call(f,"key")){var j=Object.getOwnPropertyDescriptor(f,"key").get;if(j&&j.isReactWarning)return!1}return f.key!==void 0}function u(f,j){function k(){U||(U=!0,console.error("%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://react.dev/link/special-props)",j))}k.isReactWarning=!0,Object.defineProperty(f,"key",{get:k,configurable:!0})}function d(){var f=e(this.type);return J[f]||(J[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function v(f,j,k,M,X,I){var T=k.ref;return f={$$typeof:_,type:f,key:j,props:k,_owner:M},(T!==void 0?T:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:d}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function m(f,j,k,M,X,I){var T=j.children;if(T!==void 0)if(M)if($(T)){for(M=0;M<T.length;M++)p(T[M]);Object.freeze&&Object.freeze(T)}else console.error("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 p(T);if(A.call(j,"key")){T=e(f);var W=Object.keys(j).filter(function(H){return H!=="key"});M=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",P[T+M]||(W=0<W.length?"{"+W.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,U,X,q,X),M[X+U]=!0)}if(X=null,Y!==void 0&&(a(Y),X=""+Y),m(k)&&(a(k.key),X=""+k.key),"key"in k){Y={};for(var F in k)F!=="key"&&(Y[F]=k[F])}else Y=k;return X&&w(Y,typeof b=="function"?b.displayName||b.name||"Unknown":b),P(b,X,Y,x(),te,re)}function j(b){R(b)?b._store&&(b._store.validated=1):typeof b=="object"&&b!==null&&b.$$typeof===O&&(b._payload.status==="fulfilled"?R(b._payload.value)&&b._payload.value._store&&(b._payload.value._store.validated=1):b._store&&(b._store.validated=1))}function R(b){return typeof b=="object"&&b!==null&&b.$$typeof===L}var C=me,L=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),G=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,V=Array.isArray,T=console.createTask?console.createTask:function(){return null};C={react_stack_bottom_frame:function(b){return b()}};var D,N={},K=C.react_stack_bottom_frame.bind(C,p)(),ie=T(u(p)),M={};Ae.Fragment=n,Ae.jsx=function(b,k,Y){var U=1e4>G.recentlyCreatedOwnerStacks++;return _(b,k,Y,!1,U?Error("react-stack-top-frame"):K,U?T(u(b)):ie)},Ae.jsxs=function(b,k,Y){var U=1e4>G.recentlyCreatedOwnerStacks++;return _(b,k,Y,!0,U?Error("react-stack-top-frame"):K,U?T(u(b)):ie)}})()),Ae}var zt;function zr(){return zt||(zt=1,process.env.NODE_ENV==="production"?Ve.exports=Tr():Ve.exports=Nr()),Ve.exports}var s=zr();const Mr=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],st=me.forwardRef(({schema:e,className:c,...a},u)=>{const x=e.columns||4,p=e.gap||4;return s.jsx("div",{ref:u,className:A.cn("grid auto-rows-min",c),style:{gridTemplateColumns:`repeat(${x}, minmax(0, 1fr))`,gap:`${p*.25}rem`},...a,children:e.widgets?.map(m=>{const S=(()=>{if(m.component)return m.component;const _=m.type;if(_==="bar"||_==="line"||_==="area"||_==="pie"||_==="donut"){const j=Array.isArray(m.data)?m.data:m.data?.items||[],R=m.options||{},C=R.xField||"name",L=R.yField||"value";return{type:"chart",chartType:_,data:j,xAxisKey:C,series:[{dataKey:L}],colors:Mr,className:"h-[300px]"}}return _==="table"?{type:"data-table",...m.options,data:m.data?.items||[],searchable:!1,pagination:!1,className:"border-0"}:{...m,...m.options||{}}})();return m.type==="metric"?s.jsx("div",{className:"h-full w-full",style:m.layout?{gridColumn:`span ${m.layout.w}`,gridRow:`span ${m.layout.h}`}:void 0,children:s.jsx(De.SchemaRenderer,{schema:S,className:"h-full w-full"})},m.id||m.title):s.jsxs(A.Card,{className:A.cn("overflow-hidden border-border/50 shadow-sm transition-all hover:shadow-md","bg-card/50 backdrop-blur-sm"),style:m.layout?{gridColumn:`span ${m.layout.w}`,gridRow:`span ${m.layout.h}`}:void 0,children:[m.title&&s.jsx(A.CardHeader,{className:"pb-2 border-b border-border/40 bg-muted/20",children:s.jsx(A.CardTitle,{className:"text-base font-medium tracking-tight truncate",title:m.title,children:m.title})}),s.jsx(A.CardContent,{className:"p-0",children:s.jsx("div",{className:A.cn("h-full w-full",(m.title,"p-4")),children:s.jsx(De.SchemaRenderer,{schema:S})})})]},m.id||m.title)})})});var lt={exports:{}},Le={},qe={exports:{}},kr=qe.exports,Mt;function ut(){return Mt||(Mt=1,(function(e,c){(function(a,u){u(c)})(kr,(function(a){function u(q){return function($,ee,W,ne,ce,ye,de){return q($,ee,de)}}function x(q){return function($,ee,W,ne){if(!$||!ee||typeof $!="object"||typeof ee!="object")return q($,ee,W,ne);var ce=ne.get($),ye=ne.get(ee);if(ce&&ye)return ce===ee&&ye===$;ne.set($,ee),ne.set(ee,$);var de=q($,ee,W,ne);return ne.delete($),ne.delete(ee),de}}function p(q,F){var $={};for(var ee in q)$[ee]=q[ee];for(var ee in F)$[ee]=F[ee];return $}function m(q){return q.constructor===Object||q.constructor==null}function w(q){return typeof q.then=="function"}function S(q,F){return q===F||q!==q&&F!==F}var P="[object Arguments]",_="[object Boolean]",j="[object Date]",R="[object RegExp]",C="[object Map]",L="[object Number]",g="[object Object]",n="[object Set]",r="[object String]",t=Object.prototype.toString;function i(q){var F=q.areArraysEqual,$=q.areDatesEqual,ee=q.areMapsEqual,W=q.areObjectsEqual,ne=q.areRegExpsEqual,ce=q.areSetsEqual,ye=q.createIsNestedEqual,de=ye(v);function v(h,E,H){if(h===E)return!0;if(!h||!E||typeof h!="object"||typeof E!="object")return h!==h&&E!==E;if(m(h)&&m(E))return W(h,E,de,H);var Q=Array.isArray(h),Z=Array.isArray(E);if(Q||Z)return Q===Z&&F(h,E,de,H);var J=t.call(h);return J!==t.call(E)?!1:J===j?$(h,E,de,H):J===R?ne(h,E,de,H):J===C?ee(h,E,de,H):J===n?ce(h,E,de,H):J===g||J===P?w(h)||w(E)?!1:W(h,E,de,H):J===_||J===L||J===r?S(h.valueOf(),E.valueOf()):!1}return v}function l(q,F,$,ee){var W=q.length;if(F.length!==W)return!1;for(;W-- >0;)if(!$(q[W],F[W],W,W,q,F,ee))return!1;return!0}var o=x(l);function y(q,F){return S(q.valueOf(),F.valueOf())}function d(q,F,$,ee){var W=q.size===F.size;if(!W)return!1;if(!q.size)return!0;var ne={},ce=0;return q.forEach(function(ye,de){if(W){var v=!1,h=0;F.forEach(function(E,H){!v&&!ne[h]&&(v=$(de,H,ce,h,q,F,ee)&&$(ye,E,de,H,q,F,ee))&&(ne[h]=!0),h++}),ce++,W=v}}),W}var f=x(d),O="_owner",z=Object.prototype.hasOwnProperty;function I(q,F,$,ee){var W=Object.keys(q),ne=W.length;if(Object.keys(F).length!==ne)return!1;for(var ce;ne-- >0;){if(ce=W[ne],ce===O){var ye=!!q.$$typeof,de=!!F.$$typeof;if((ye||de)&&ye!==de)return!1}if(!z.call(F,ce)||!$(q[ce],F[ce],ce,ce,q,F,ee))return!1}return!0}var G=x(I);function B(q,F){return q.source===F.source&&q.flags===F.flags}function V(q,F,$,ee){var W=q.size===F.size;if(!W)return!1;if(!q.size)return!0;var ne={};return q.forEach(function(ce,ye){if(W){var de=!1,v=0;F.forEach(function(h,E){!de&&!ne[v]&&(de=$(ce,h,ye,E,q,F,ee))&&(ne[v]=!0),v++}),W=de}}),W}var T=x(V),D=Object.freeze({areArraysEqual:l,areDatesEqual:y,areMapsEqual:d,areObjectsEqual:I,areRegExpsEqual:B,areSetsEqual:V,createIsNestedEqual:u}),N=Object.freeze({areArraysEqual:o,areDatesEqual:y,areMapsEqual:f,areObjectsEqual:G,areRegExpsEqual:B,areSetsEqual:T,createIsNestedEqual:u}),K=i(D);function ie(q,F){return K(q,F,void 0)}var M=i(p(D,{createIsNestedEqual:function(){return S}}));function b(q,F){return M(q,F,void 0)}var k=i(N);function Y(q,F){return k(q,F,new WeakMap)}var U=i(p(N,{createIsNestedEqual:function(){return S}}));function te(q,F){return U(q,F,new WeakMap)}function re(q){return i(p(D,q(D)))}function X(q){var F=i(p(N,q(N)));return(function($,ee,W){return W===void 0&&(W=new WeakMap),F($,ee,W)})}a.circularDeepEqual=Y,a.circularShallowEqual=te,a.createCustomCircularEqual=X,a.createCustomEqual=re,a.deepEqual=ie,a.sameValueZeroEqual=S,a.shallowEqual=b,Object.defineProperty(a,"__esModule",{value:!0})}))})(qe,qe.exports)),qe.exports}var ae={},ct,kt;function Ar(){return kt||(kt=1,ct=function(c,a,u){return c===a?!0:c.className===a.className&&u(c.style,a.style)&&c.width===a.width&&c.autoSize===a.autoSize&&c.cols===a.cols&&c.draggableCancel===a.draggableCancel&&c.draggableHandle===a.draggableHandle&&u(c.verticalCompact,a.verticalCompact)&&u(c.compactType,a.compactType)&&u(c.layout,a.layout)&&u(c.margin,a.margin)&&u(c.containerPadding,a.containerPadding)&&c.rowHeight===a.rowHeight&&c.maxRows===a.maxRows&&c.isBounded===a.isBounded&&c.isDraggable===a.isDraggable&&c.isResizable===a.isResizable&&c.allowOverlap===a.allowOverlap&&c.preventCollision===a.preventCollision&&c.useCSSTransforms===a.useCSSTransforms&&c.transformScale===a.transformScale&&c.isDroppable===a.isDroppable&&u(c.resizeHandles,a.resizeHandles)&&u(c.resizeHandle,a.resizeHandle)&&c.onLayoutChange===a.onLayoutChange&&c.onDragStart===a.onDragStart&&c.onDrag===a.onDrag&&c.onDragStop===a.onDragStop&&c.onResizeStart===a.onResizeStart&&c.onResize===a.onResize&&c.onResizeStop===a.onResizeStop&&c.onDrop===a.onDrop&&u(c.droppingItem,a.droppingItem)&&u(c.innerRef,a.innerRef)}),ct}var At;function Ne(){if(At)return ae;At=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=P,ae.childrenEqual=L,ae.cloneLayout=_,ae.cloneLayoutItem=C,ae.collides=n,ae.compact=r,ae.compactItem=l,ae.compactType=ce,ae.correctBounds=o,ae.fastPositionEqual=g,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=f,ae.getFirstCollision=d,ae.getLayoutItem=y,ae.getStatics=O,ae.modifyLayout=j,ae.moveElement=z,ae.moveElementAwayFromCollision=I,ae.noop=void 0,ae.perc=G,ae.resizeItemInDirection=re,ae.setTopLeft=q,ae.setTransform=X,ae.sortLayoutItems=F,ae.sortLayoutItemsByColRow=ee,ae.sortLayoutItemsByRowCol=$,ae.synchronizeLayoutWithChildren=W,ae.validateLayout=ne,ae.withLayoutItem=R;var e=ut(),c=a(me);function a(v){return v&&v.__esModule?v:{default:v}}function u(v,h){var E=Object.keys(v);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(v);h&&(H=H.filter(function(Q){return Object.getOwnPropertyDescriptor(v,Q).enumerable})),E.push.apply(E,H)}return E}function x(v){for(var h=1;h<arguments.length;h++){var E=arguments[h]!=null?arguments[h]:{};h%2?u(Object(E),!0).forEach(function(H){p(v,H,E[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(E)):u(Object(E)).forEach(function(H){Object.defineProperty(v,H,Object.getOwnPropertyDescriptor(E,H))})}return v}function p(v,h,E){return(h=m(h))in v?Object.defineProperty(v,h,{value:E,enumerable:!0,configurable:!0,writable:!0}):v[h]=E,v}function m(v){var h=w(v,"string");return typeof h=="symbol"?h:h+""}function w(v,h){if(typeof v!="object"||!v)return v;var E=v[Symbol.toPrimitive];if(E!==void 0){var H=E.call(v,h);if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(v)}const S=process.env.NODE_ENV==="production";function P(v){let h=0,E;for(let H=0,Q=v.length;H<Q;H++)E=v[H].y+v[H].h,E>h&&(h=E);return h}function _(v){const h=Array(v.length);for(let E=0,H=v.length;E<H;E++)h[E]=C(v[E]);return h}function j(v,h){const E=Array(v.length);for(let H=0,Q=v.length;H<Q;H++)h.i===v[H].i?E[H]=h:E[H]=v[H];return E}function R(v,h,E){let H=y(v,h);return H?(H=E(C(H)),v=j(v,H),[v,H]):[v,null]}function C(v){return{w:v.w,h:v.h,x:v.x,y:v.y,i:v.i,minW:v.minW,maxW:v.maxW,minH:v.minH,maxH:v.maxH,moved:!!v.moved,static:!!v.static,isDraggable:v.isDraggable,isResizable:v.isResizable,resizeHandles:v.resizeHandles,isBounded:v.isBounded}}function L(v,h){return(0,e.deepEqual)(c.default.Children.map(v,E=>E?.key),c.default.Children.map(h,E=>E?.key))&&(0,e.deepEqual)(c.default.Children.map(v,E=>E?.props["data-grid"]),c.default.Children.map(h,E=>E?.props["data-grid"]))}ae.fastRGLPropsEqual=Ar();function g(v,h){return v.left===h.left&&v.top===h.top&&v.width===h.width&&v.height===h.height}function n(v,h){return!(v.i===h.i||v.x+v.w<=h.x||v.x>=h.x+h.w||v.y+v.h<=h.y||v.y>=h.y+h.h)}function r(v,h,E,H){const Q=O(v);let Z=P(Q);const J=F(v,h),ue=Array(v.length);for(let fe=0,ge=J.length;fe<ge;fe++){let be=C(J[fe]);be.static||(be=l(Q,be,h,E,J,H,Z),Z=Math.max(Z,be.y+be.h),Q.push(be)),ue[v.indexOf(J[fe])]=be,be.moved=!1}return ue}const t={x:"w",y:"h"};function i(v,h,E,H){const Q=t[H];h[H]+=1;const Z=v.map(J=>J.i).indexOf(h.i);for(let J=Z+1;J<v.length;J++){const ue=v[J];if(!ue.static){if(ue.y>h.y+h.h)break;n(h,ue)&&i(v,ue,E+h[Q],H)}}h[H]=E}function l(v,h,E,H,Q,Z,J){const ue=E==="vertical",fe=E==="horizontal";if(ue)for(typeof J=="number"?h.y=Math.min(J,h.y):h.y=Math.min(P(v),h.y);h.y>0&&!d(v,h);)h.y--;else if(fe)for(;h.x>0&&!d(v,h);)h.x--;let ge;for(;(ge=d(v,h))&&!(E===null&&Z);)if(fe?i(Q,h,ge.x+ge.w,"x"):i(Q,h,ge.y+ge.h,"y"),fe&&h.x+h.w>H)for(h.x=H-h.w,h.y++;h.x>0&&!d(v,h);)h.x--;return h.y=Math.max(h.y,0),h.x=Math.max(h.x,0),h}function o(v,h){const E=O(v);for(let H=0,Q=v.length;H<Q;H++){const Z=v[H];if(Z.x+Z.w>h.cols&&(Z.x=h.cols-Z.w),Z.x<0&&(Z.x=0,Z.w=h.cols),!Z.static)E.push(Z);else for(;d(E,Z);)Z.y++}return v}function y(v,h){for(let E=0,H=v.length;E<H;E++)if(v[E].i===h)return v[E]}function d(v,h){for(let E=0,H=v.length;E<H;E++)if(n(v[E],h))return v[E]}function f(v,h){return v.filter(E=>n(E,h))}function O(v){return v.filter(h=>h.static)}function z(v,h,E,H,Q,Z,J,ue,fe){if(h.static&&h.isDraggable!==!0||h.y===H&&h.x===E)return v;"Moving element ".concat(h.i," to [").concat(String(E),",").concat(String(H),"] from [").concat(h.x,",").concat(h.y,"]");const ge=h.x,be=h.y;typeof E=="number"&&(h.x=E),typeof H=="number"&&(h.y=H),h.moved=!0;let Re=F(v,J);(J==="vertical"&&typeof H=="number"?be>=H:J==="horizontal"&&typeof E=="number"&&ge>=E)&&(Re=Re.reverse());const Me=f(Re,h),ot=Me.length>0;if(ot&&fe)return _(v);if(ot&&Z)return"Collision prevented on ".concat(h.i,", reverting."),h.x=ge,h.y=be,h.moved=!1,v;for(let Pt=0,jn=Me.length;Pt<jn;Pt++){const Ce=Me[Pt];"Resolving collision between ".concat(h.i," at [").concat(h.x,",").concat(h.y,"] and ").concat(Ce.i," at [").concat(Ce.x,",").concat(Ce.y,"]"),!Ce.moved&&(Ce.static?v=I(v,Ce,h,Q,J):v=I(v,h,Ce,Q,J))}return v}function I(v,h,E,H,Q,Z){const J=Q==="horizontal",ue=Q==="vertical",fe=h.static;if(H){H=!1;const Re={x:J?Math.max(h.x-E.w,0):E.x,y:ue?Math.max(h.y-E.h,0):E.y,w:E.w,h:E.h,i:"-1"},Pe=d(v,Re),Me=Pe&&Pe.y+Pe.h>h.y,ot=Pe&&h.x+h.w>Pe.x;if(Pe){if(Me&&ue)return z(v,E,void 0,E.y+1,H,fe,Q);if(Me&&Q==null)return h.y=E.y,E.y=E.y+E.h,v;if(ot&&J)return z(v,h,E.x,void 0,H,fe,Q)}else return"Doing reverse collision on ".concat(E.i," up to [").concat(Re.x,",").concat(Re.y,"]."),z(v,E,J?Re.x:void 0,ue?Re.y:void 0,H,fe,Q)}const ge=J?E.x+1:void 0,be=ue?E.y+1:void 0;return ge==null&&be==null?v:z(v,E,J?E.x+1:void 0,ue?E.y+1:void 0,H,fe,Q)}function G(v){return v*100+"%"}const B=(v,h,E,H)=>v+E>H?h:E,V=(v,h,E)=>v<0?h:E,T=v=>Math.max(0,v),D=v=>Math.max(0,v),N=(v,h,E)=>{let{left:H,height:Q,width:Z}=h;const J=v.top-(Q-v.height);return{left:H,width:Z,height:V(J,v.height,Q),top:D(J)}},K=(v,h,E)=>{let{top:H,left:Q,height:Z,width:J}=h;return{top:H,height:Z,width:B(v.left,v.width,J,E),left:T(Q)}},ie=(v,h,E)=>{let{top:H,height:Q,width:Z}=h;const J=v.left-(Z-v.width);return{height:Q,width:J<0?v.width:B(v.left,v.width,Z,E),top:D(H),left:T(J)}},M=(v,h,E)=>{let{top:H,left:Q,height:Z,width:J}=h;return{width:J,left:Q,height:V(H,v.height,Z),top:D(H)}},te={n:N,ne:function(){return N(arguments.length<=0?void 0:arguments[0],K(...arguments))},e:K,se:function(){return M(arguments.length<=0?void 0:arguments[0],K(...arguments))},s:M,sw:function(){return M(arguments.length<=0?void 0:arguments[0],ie(...arguments))},w:ie,nw:function(){return N(arguments.length<=0?void 0:arguments[0],ie(...arguments))}};function re(v,h,E,H){const Q=te[v];return Q?Q(h,x(x({},h),E),H):E}function X(v){let{top:h,left:E,width:H,height:Q}=v;const Z="translate(".concat(E,"px,").concat(h,"px)");return{transform:Z,WebkitTransform:Z,MozTransform:Z,msTransform:Z,OTransform:Z,width:"".concat(H,"px"),height:"".concat(Q,"px"),position:"absolute"}}function q(v){let{top:h,left:E,width:H,height:Q}=v;return{top:"".concat(h,"px"),left:"".concat(E,"px"),width:"".concat(H,"px"),height:"".concat(Q,"px"),position:"absolute"}}function F(v,h){return h==="horizontal"?ee(v):h==="vertical"?$(v):v}function $(v){return v.slice(0).sort(function(h,E){return h.y>E.y||h.y===E.y&&h.x>E.x?1:h.y===E.y&&h.x===E.x?0:-1})}function ee(v){return v.slice(0).sort(function(h,E){return h.x>E.x||h.x===E.x&&h.y>E.y?1:-1})}function W(v,h,E,H,Q){v=v||[];const Z=[];c.default.Children.forEach(h,ue=>{if(ue?.key==null)return;const fe=y(v,String(ue.key)),ge=ue.props["data-grid"];fe&&ge==null?Z.push(C(fe)):ge?(S||ne([ge],"ReactGridLayout.children"),Z.push(C(x(x({},ge),{},{i:ue.key})))):Z.push(C({w:1,h:1,x:0,y:P(Z),i:String(ue.key)}))});const J=o(Z,{cols:E});return Q?J:r(J,H,E)}function ne(v){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const E=["x","y","w","h"];if(!Array.isArray(v))throw new Error(h+" must be an array!");for(let H=0,Q=v.length;H<Q;H++){const Z=v[H];for(let J=0;J<E.length;J++){const ue=E[J],fe=Z[ue];if(typeof fe!="number"||Number.isNaN(fe))throw new Error("ReactGridLayout: ".concat(h,"[").concat(H,"].").concat(ue," must be a number! Received: ").concat(fe," (").concat(typeof fe,")"))}if(typeof Z.i<"u"&&typeof Z.i!="string")throw new Error("ReactGridLayout: ".concat(h,"[").concat(H,"].i must be a string! Received: ").concat(Z.i," (").concat(typeof Z.i,")"))}}function ce(v){const{verticalCompact:h,compactType:E}=v||{};return h===!1?null:E}function ye(){}const de=()=>{};return ae.noop=de,ae}var we={},Lt;function dt(){if(Lt)return we;Lt=1,Object.defineProperty(we,"__esModule",{value:!0}),we.calcGridColWidth=e,we.calcGridItemPosition=a,we.calcGridItemWHPx=c,we.calcWH=x,we.calcXY=u,we.clamp=p;function e(m){const{margin:w,containerPadding:S,containerWidth:P,cols:_}=m;return(P-w[0]*(_-1)-S[0]*2)/_}function c(m,w,S){return Number.isFinite(m)?Math.round(w*m+Math.max(0,m-1)*S):m}function a(m,w,S,P,_,j){const{margin:R,containerPadding:C,rowHeight:L}=m,g=e(m),n={};return j&&j.resizing?(n.width=Math.round(j.resizing.width),n.height=Math.round(j.resizing.height)):(n.width=c(P,g,R[0]),n.height=c(_,L,R[1])),j&&j.dragging?(n.top=Math.round(j.dragging.top),n.left=Math.round(j.dragging.left)):j&&j.resizing&&typeof j.resizing.top=="number"&&typeof j.resizing.left=="number"?(n.top=Math.round(j.resizing.top),n.left=Math.round(j.resizing.left)):(n.top=Math.round((L+R[1])*S+C[1]),n.left=Math.round((g+R[0])*w+C[0])),n}function u(m,w,S,P,_){const{margin:j,containerPadding:R,cols:C,rowHeight:L,maxRows:g}=m,n=e(m);let r=Math.round((S-R[0])/(n+j[0])),t=Math.round((w-R[1])/(L+j[1]));return r=p(r,0,C-P),t=p(t,0,g-_),{x:r,y:t}}function x(m,w,S,P,_,j){const{margin:R,maxRows:C,cols:L,rowHeight:g}=m,n=e(m);let r=Math.round((w+R[0])/(n+R[0])),t=Math.round((S+R[1])/(g+R[1])),i=p(r,0,L-P),l=p(t,0,C-_);return["sw","w","nw"].indexOf(j)!==-1&&(i=p(r,0,L)),["nw","n","ne"].indexOf(j)!==-1&&(l=p(t,0,C)),{w:i,h:l}}function p(m,w,S){return Math.max(Math.min(m,S),w)}return we}var We={},Xe={exports:{}},Ke={exports:{}},se={};var qt;function Lr(){if(qt)return se;qt=1;var e=typeof Symbol=="function"&&Symbol.for,c=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,u=e?Symbol.for("react.fragment"):60107,x=e?Symbol.for("react.strict_mode"):60108,p=e?Symbol.for("react.profiler"):60114,m=e?Symbol.for("react.provider"):60109,w=e?Symbol.for("react.context"):60110,S=e?Symbol.for("react.async_mode"):60111,P=e?Symbol.for("react.concurrent_mode"):60111,_=e?Symbol.for("react.forward_ref"):60112,j=e?Symbol.for("react.suspense"):60113,R=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,L=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,n=e?Symbol.for("react.fundamental"):60117,r=e?Symbol.for("react.responder"):60118,t=e?Symbol.for("react.scope"):60119;function i(o){if(typeof o=="object"&&o!==null){var y=o.$$typeof;switch(y){case c:switch(o=o.type,o){case S:case P:case u:case p:case x:case j:return o;default:switch(o=o&&o.$$typeof,o){case w:case _:case L:case C:case m:return o;default:return y}}case a:return y}}}function l(o){return i(o)===P}return se.AsyncMode=S,se.ConcurrentMode=P,se.ContextConsumer=w,se.ContextProvider=m,se.Element=c,se.ForwardRef=_,se.Fragment=u,se.Lazy=L,se.Memo=C,se.Portal=a,se.Profiler=p,se.StrictMode=x,se.Suspense=j,se.isAsyncMode=function(o){return l(o)||i(o)===S},se.isConcurrentMode=l,se.isContextConsumer=function(o){return i(o)===w},se.isContextProvider=function(o){return i(o)===m},se.isElement=function(o){return typeof o=="object"&&o!==null&&o.$$typeof===c},se.isForwardRef=function(o){return i(o)===_},se.isFragment=function(o){return i(o)===u},se.isLazy=function(o){return i(o)===L},se.isMemo=function(o){return i(o)===C},se.isPortal=function(o){return i(o)===a},se.isProfiler=function(o){return i(o)===p},se.isStrictMode=function(o){return i(o)===x},se.isSuspense=function(o){return i(o)===j},se.isValidElementType=function(o){return typeof o=="string"||typeof o=="function"||o===u||o===P||o===p||o===x||o===j||o===R||typeof o=="object"&&o!==null&&(o.$$typeof===L||o.$$typeof===C||o.$$typeof===m||o.$$typeof===w||o.$$typeof===_||o.$$typeof===n||o.$$typeof===r||o.$$typeof===t||o.$$typeof===g)},se.typeOf=i,se}var le={};var Wt;function qr(){return Wt||(Wt=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,c=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,u=e?Symbol.for("react.fragment"):60107,x=e?Symbol.for("react.strict_mode"):60108,p=e?Symbol.for("react.profiler"):60114,m=e?Symbol.for("react.provider"):60109,w=e?Symbol.for("react.context"):60110,S=e?Symbol.for("react.async_mode"):60111,P=e?Symbol.for("react.concurrent_mode"):60111,_=e?Symbol.for("react.forward_ref"):60112,j=e?Symbol.for("react.suspense"):60113,R=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,L=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,n=e?Symbol.for("react.fundamental"):60117,r=e?Symbol.for("react.responder"):60118,t=e?Symbol.for("react.scope"):60119;function i(W){return typeof W=="string"||typeof W=="function"||W===u||W===P||W===p||W===x||W===j||W===R||typeof W=="object"&&W!==null&&(W.$$typeof===L||W.$$typeof===C||W.$$typeof===m||W.$$typeof===w||W.$$typeof===_||W.$$typeof===n||W.$$typeof===r||W.$$typeof===t||W.$$typeof===g)}function l(W){if(typeof W=="object"&&W!==null){var ne=W.$$typeof;switch(ne){case c:var ce=W.type;switch(ce){case S:case P:case u:case p:case x:case j:return ce;default:var ye=ce&&ce.$$typeof;switch(ye){case w:case _:case L:case C:case m:return ye;default:return ne}}case a:return ne}}}var o=S,y=P,d=w,f=m,O=c,z=_,I=u,G=L,B=C,V=a,T=p,D=x,N=j,K=!1;function ie(W){return K||(K=!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.")),M(W)||l(W)===S}function M(W){return l(W)===P}function b(W){return l(W)===w}function k(W){return l(W)===m}function Y(W){return typeof W=="object"&&W!==null&&W.$$typeof===c}function U(W){return l(W)===_}function te(W){return l(W)===u}function re(W){return l(W)===L}function X(W){return l(W)===C}function q(W){return l(W)===a}function F(W){return l(W)===p}function $(W){return l(W)===x}function ee(W){return l(W)===j}le.AsyncMode=o,le.ConcurrentMode=y,le.ContextConsumer=d,le.ContextProvider=f,le.Element=O,le.ForwardRef=z,le.Fragment=I,le.Lazy=G,le.Memo=B,le.Portal=V,le.Profiler=T,le.StrictMode=D,le.Suspense=N,le.isAsyncMode=ie,le.isConcurrentMode=M,le.isContextConsumer=b,le.isContextProvider=k,le.isElement=Y,le.isForwardRef=U,le.isFragment=te,le.isLazy=re,le.isMemo=X,le.isPortal=q,le.isProfiler=F,le.isStrictMode=$,le.isSuspense=ee,le.isValidElementType=i,le.typeOf=l})()),le}var Ht;function It(){return Ht||(Ht=1,process.env.NODE_ENV==="production"?Ke.exports=Lr():Ke.exports=qr()),Ke.exports}var ft,Bt;function Wr(){if(Bt)return ft;Bt=1;var e=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function u(p){if(p==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(p)}function x(){try{if(!Object.assign)return!1;var p=new String("abc");if(p[5]="de",Object.getOwnPropertyNames(p)[0]==="5")return!1;for(var m={},w=0;w<10;w++)m["_"+String.fromCharCode(w)]=w;var S=Object.getOwnPropertyNames(m).map(function(_){return m[_]});if(S.join("")!=="0123456789")return!1;var P={};return"abcdefghijklmnopqrst".split("").forEach(function(_){P[_]=_}),Object.keys(Object.assign({},P)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ft=x()?Object.assign:function(p,m){for(var w,S=u(p),P,_=1;_<arguments.length;_++){w=Object(arguments[_]);for(var j in w)c.call(w,j)&&(S[j]=w[j]);if(e){P=e(w);for(var R=0;R<P.length;R++)a.call(w,P[R])&&(S[P[R]]=w[P[R]])}}return S},ft}var pt,Ft;function ht(){if(Ft)return pt;Ft=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pt=e,pt}var mt,Gt;function Yt(){return Gt||(Gt=1,mt=Function.call.bind(Object.prototype.hasOwnProperty)),mt}var gt,Ut;function Hr(){if(Ut)return gt;Ut=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var c=ht(),a={},u=Yt();e=function(p){var m="Warning: "+p;typeof console<"u"&&console.error(m);try{throw new Error(m)}catch{}}}function x(p,m,w,S,P){if(process.env.NODE_ENV!=="production"){for(var _ in p)if(u(p,_)){var j;try{if(typeof p[_]!="function"){var R=Error((S||"React class")+": "+w+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}j=p[_](m,_,S,w,null,c)}catch(L){j=L}if(j&&!(j instanceof Error)&&e((S||"React class")+": type specification of "+w+" `"+_+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof j+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),j instanceof Error&&!(j.message in a)){a[j.message]=!0;var C=P?P():"";e("Failed "+w+" type: "+j.message+(C??""))}}}}return x.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},gt=x,gt}var yt,$t;function Ir(){if($t)return yt;$t=1;var e=It(),c=Wr(),a=ht(),u=Yt(),x=Hr(),p=function(){};process.env.NODE_ENV!=="production"&&(p=function(w){var S="Warning: "+w;typeof console<"u"&&console.error(S);try{throw new Error(S)}catch{}});function m(){return null}return yt=function(w,S){var P=typeof Symbol=="function"&&Symbol.iterator,_="@@iterator";function j(M){var b=M&&(P&&M[P]||M[_]);if(typeof b=="function")return b}var R="<<anonymous>>",C={array:r("array"),bigint:r("bigint"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),symbol:r("symbol"),any:t(),arrayOf:i,element:l(),elementType:o(),instanceOf:y,node:z(),objectOf:f,oneOf:d,oneOfType:O,shape:G,exact:B};function L(M,b){return M===b?M!==0||1/M===1/b:M!==M&&b!==b}function g(M,b){this.message=M,this.data=b&&typeof b=="object"?b:{},this.stack=""}g.prototype=Error.prototype;function n(M){if(process.env.NODE_ENV!=="production")var b={},k=0;function Y(te,re,X,q,F,$,ee){if(q=q||R,$=$||X,ee!==a){if(S){var W=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 W.name="Invariant Violation",W}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=q+":"+X;!b[ne]&&k<3&&(p("You are manually calling a React.PropTypes validation function for the `"+$+"` prop on `"+q+"`. 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."),b[ne]=!0,k++)}}return re[X]==null?te?re[X]===null?new g("The "+F+" `"+$+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new g("The "+F+" `"+$+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:M(re,X,q,F,$)}var U=Y.bind(null,!1);return U.isRequired=Y.bind(null,!0),U}function r(M){function b(k,Y,U,te,re,X){var q=k[Y],F=D(q);if(F!==M){var $=N(q);return new g("Invalid "+te+" `"+re+"` of type "+("`"+$+"` supplied to `"+U+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return n(b)}function t(){return n(m)}function i(M){function b(k,Y,U,te,re){if(typeof M!="function")return new g("Property `"+re+"` of component `"+U+"` has invalid PropType notation inside arrayOf.");var X=k[Y];if(!Array.isArray(X)){var q=D(X);return new g("Invalid "+te+" `"+re+"` of type "+("`"+q+"` supplied to `"+U+"`, expected an array."))}for(var F=0;F<X.length;F++){var $=M(X,F,U,te,re+"["+F+"]",a);if($ instanceof Error)return $}return null}return n(b)}function l(){function M(b,k,Y,U,te){var re=b[k];if(!w(re)){var X=D(re);return new g("Invalid "+U+" `"+te+"` of type "+("`"+X+"` supplied to `"+Y+"`, expected a single ReactElement."))}return null}return n(M)}function o(){function M(b,k,Y,U,te){var re=b[k];if(!e.isValidElementType(re)){var X=D(re);return new g("Invalid "+U+" `"+te+"` of type "+("`"+X+"` supplied to `"+Y+"`, expected a single ReactElement type."))}return null}return n(M)}function y(M){function b(k,Y,U,te,re){if(!(k[Y]instanceof M)){var X=M.name||R,q=ie(k[Y]);return new g("Invalid "+te+" `"+re+"` of type "+("`"+q+"` supplied to `"+U+"`, expected ")+("instance of `"+X+"`."))}return null}return n(b)}function d(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?p("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])."):p("Invalid argument supplied to oneOf, expected an array.")),m;function b(k,Y,U,te,re){for(var X=k[Y],q=0;q<M.length;q++)if(L(X,M[q]))return null;var F=JSON.stringify(M,function(ee,W){var ne=N(W);return ne==="symbol"?String(W):W});return new g("Invalid "+te+" `"+re+"` of value `"+String(X)+"` "+("supplied to `"+U+"`, expected one of "+F+"."))}return n(b)}function f(M){function b(k,Y,U,te,re){if(typeof M!="function")return new g("Property `"+re+"` of component `"+U+"` has invalid PropType notation inside objectOf.");var X=k[Y],q=D(X);if(q!=="object")return new g("Invalid "+te+" `"+re+"` of type "+("`"+q+"` supplied to `"+U+"`, expected an object."));for(var F in X)if(u(X,F)){var $=M(X,F,U,te,re+"."+F,a);if($ instanceof Error)return $}return null}return n(b)}function O(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&p("Invalid argument supplied to oneOfType, expected an instance of array."),m;for(var b=0;b<M.length;b++){var k=M[b];if(typeof k!="function")return p("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+K(k)+" at index "+b+"."),m}function Y(U,te,re,X,q){for(var F=[],$=0;$<M.length;$++){var ee=M[$],W=ee(U,te,re,X,q,a);if(W==null)return null;W.data&&u(W.data,"expectedType")&&F.push(W.data.expectedType)}var ne=F.length>0?", expected one of type ["+F.join(", ")+"]":"";return new g("Invalid "+X+" `"+q+"` supplied to "+("`"+re+"`"+ne+"."))}return n(Y)}function z(){function M(b,k,Y,U,te){return V(b[k])?null:new g("Invalid "+U+" `"+te+"` supplied to "+("`"+Y+"`, expected a ReactNode."))}return n(M)}function I(M,b,k,Y,U){return new g((M||"React class")+": "+b+" type `"+k+"."+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+U+"`.")}function G(M){function b(k,Y,U,te,re){var X=k[Y],q=D(X);if(q!=="object")return new g("Invalid "+te+" `"+re+"` of type `"+q+"` "+("supplied to `"+U+"`, expected `object`."));for(var F in M){var $=M[F];if(typeof $!="function")return I(U,te,re,F,N($));var ee=$(X,F,U,te,re+"."+F,a);if(ee)return ee}return null}return n(b)}function B(M){function b(k,Y,U,te,re){var X=k[Y],q=D(X);if(q!=="object")return new g("Invalid "+te+" `"+re+"` of type `"+q+"` "+("supplied to `"+U+"`, expected `object`."));var F=c({},k[Y],M);for(var $ in F){var ee=M[$];if(u(M,$)&&typeof ee!="function")return I(U,te,re,$,N(ee));if(!ee)return new g("Invalid "+te+" `"+re+"` key `"+$+"` supplied to `"+U+"`.\nBad object: "+JSON.stringify(k[Y],null," ")+`
|
|
7
|
-
Valid keys: `+JSON.stringify(Object.keys(
|
|
8
|
-
`,
|
|
9
|
-
`,d.getElementsByTagName("head")[0].appendChild(f)),d.body&&o(d.body,"react-draggable-transparent-selection")}function i(d){window.requestAnimationFrame?window.requestAnimationFrame(()=>{l(d)}):l(d)}function l(d){if(d)try{if(d.body&&y(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const f=(d.defaultView||window).getSelection();f&&f.type!=="Caret"&&f.removeAllRanges()}}catch{}}function o(d,f){d.classList?d.classList.add(f):d.className.match(new RegExp(`(?:^|\\s)${f}(?!\\S)`))||(d.className+=` ${f}`)}function y(d,f){d.classList?d.classList.remove(f):d.className=d.className.replace(new RegExp(`(?:^|\\s)${f}(?!\\S)`,"g"),"")}return pe}var xe={},Qt;function er(){if(Qt)return xe;Qt=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.canDragX=x,xe.canDragY=p,xe.createCoreData=w,xe.createDraggableData=S,xe.getBoundPosition=a,xe.getControlPosition=m,xe.snapToGrid=u;var e=Je(),c=xt();function a(j,R,C){if(!j.props.bounds)return[R,C];let{bounds:L}=j.props;L=typeof L=="string"?L:P(L);const g=_(j);if(typeof L=="string"){const{ownerDocument:n}=g,r=n.defaultView;let t;if(L==="parent"?t=g.parentNode:t=g.getRootNode().querySelector(L),!(t instanceof r.HTMLElement))throw new Error('Bounds selector "'+L+'" could not find an element.');const i=t,l=r.getComputedStyle(g),o=r.getComputedStyle(i);L={left:-g.offsetLeft+(0,e.int)(o.paddingLeft)+(0,e.int)(l.marginLeft),top:-g.offsetTop+(0,e.int)(o.paddingTop)+(0,e.int)(l.marginTop),right:(0,c.innerWidth)(i)-(0,c.outerWidth)(g)-g.offsetLeft+(0,e.int)(o.paddingRight)-(0,e.int)(l.marginRight),bottom:(0,c.innerHeight)(i)-(0,c.outerHeight)(g)-g.offsetTop+(0,e.int)(o.paddingBottom)-(0,e.int)(l.marginBottom)}}return(0,e.isNum)(L.right)&&(R=Math.min(R,L.right)),(0,e.isNum)(L.bottom)&&(C=Math.min(C,L.bottom)),(0,e.isNum)(L.left)&&(R=Math.max(R,L.left)),(0,e.isNum)(L.top)&&(C=Math.max(C,L.top)),[R,C]}function u(j,R,C){const L=Math.round(R/j[0])*j[0],g=Math.round(C/j[1])*j[1];return[L,g]}function x(j){return j.props.axis==="both"||j.props.axis==="x"}function p(j){return j.props.axis==="both"||j.props.axis==="y"}function m(j,R,C){const L=typeof R=="number"?(0,c.getTouch)(j,R):null;if(typeof R=="number"&&!L)return null;const g=_(C),n=C.props.offsetParent||g.offsetParent||g.ownerDocument.body;return(0,c.offsetXYFromParent)(L||j,n,C.props.scale)}function w(j,R,C){const L=!(0,e.isNum)(j.lastX),g=_(j);return L?{node:g,deltaX:0,deltaY:0,lastX:R,lastY:C,x:R,y:C}:{node:g,deltaX:R-j.lastX,deltaY:C-j.lastY,lastX:j.lastX,lastY:j.lastY,x:R,y:C}}function S(j,R){const C=j.props.scale;return{node:R.node,x:j.state.x+R.deltaX/C,y:j.state.y+R.deltaY/C,deltaX:R.deltaX/C,deltaY:R.deltaY/C,lastX:j.state.x,lastY:j.state.y}}function P(j){return{left:j.left,top:j.top,right:j.right,bottom:j.bottom}}function _(j){const R=j.findDOMNode();if(!R)throw new Error("<DraggableCore>: Unmounted during event!");return R}return xe}var Ie={},Ze={},tr;function rr(){if(tr)return Ze;tr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=e;function e(){}return Ze}var nr;function Gr(){if(nr)return Ie;nr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.default=void 0;var e=S(me),c=w(Se()),a=w(it),u=xt(),x=er(),p=Je(),m=w(rr());function w(g){return g&&g.__esModule?g:{default:g}}function S(g,n){if(typeof WeakMap=="function")var r=new WeakMap,t=new WeakMap;return(S=function(i,l){if(!l&&i&&i.__esModule)return i;var o,y,d={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return d;if(o=l?t:r){if(o.has(i))return o.get(i);o.set(i,d)}for(const f in i)f!=="default"&&{}.hasOwnProperty.call(i,f)&&((y=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,f))&&(y.get||y.set)?o(d,f,y):d[f]=i[f]);return d})(g,n)}function P(g,n,r){return(n=_(n))in g?Object.defineProperty(g,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):g[n]=r,g}function _(g){var n=j(g,"string");return typeof n=="symbol"?n:n+""}function j(g,n){if(typeof g!="object"||!g)return g;var r=g[Symbol.toPrimitive];if(r!==void 0){var t=r.call(g,n);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(g)}const R={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=R.mouse,L=class extends e.Component{constructor(){super(...arguments),P(this,"dragging",!1),P(this,"lastX",NaN),P(this,"lastY",NaN),P(this,"touchIdentifier",null),P(this,"mounted",!1),P(this,"handleDragStart",n=>{if(this.props.onMouseDown(n),!this.props.allowAnyClick&&typeof n.button=="number"&&n.button!==0)return!1;const r=this.findDOMNode();if(!r||!r.ownerDocument||!r.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:t}=r;if(this.props.disabled||!(n.target instanceof t.defaultView.Node)||this.props.handle&&!(0,u.matchesSelectorAndParentsTo)(n.target,this.props.handle,r)||this.props.cancel&&(0,u.matchesSelectorAndParentsTo)(n.target,this.props.cancel,r))return;n.type==="touchstart"&&!this.props.allowMobileScroll&&n.preventDefault();const i=(0,u.getTouchIdentifier)(n);this.touchIdentifier=i;const l=(0,x.getControlPosition)(n,i,this);if(l==null)return;const{x:o,y}=l,d=(0,x.createCoreData)(this,o,y);(0,m.default)("DraggableCore: handleDragStart: %j",d),(0,m.default)("calling",this.props.onStart),!(this.props.onStart(n,d)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,u.addUserSelectStyles)(t),this.dragging=!0,this.lastX=o,this.lastY=y,(0,u.addEvent)(t,C.move,this.handleDrag),(0,u.addEvent)(t,C.stop,this.handleDragStop))}),P(this,"handleDrag",n=>{const r=(0,x.getControlPosition)(n,this.touchIdentifier,this);if(r==null)return;let{x:t,y:i}=r;if(Array.isArray(this.props.grid)){let y=t-this.lastX,d=i-this.lastY;if([y,d]=(0,x.snapToGrid)(this.props.grid,y,d),!y&&!d)return;t=this.lastX+y,i=this.lastY+d}const l=(0,x.createCoreData)(this,t,i);if((0,m.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(n,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const d=document.createEvent("MouseEvents");d.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(d)}return}this.lastX=t,this.lastY=i}),P(this,"handleDragStop",n=>{if(!this.dragging)return;const r=(0,x.getControlPosition)(n,this.touchIdentifier,this);if(r==null)return;let{x:t,y:i}=r;if(Array.isArray(this.props.grid)){let d=t-this.lastX||0,f=i-this.lastY||0;[d,f]=(0,x.snapToGrid)(this.props.grid,d,f),t=this.lastX+d,i=this.lastY+f}const l=(0,x.createCoreData)(this,t,i);if(this.props.onStop(n,l)===!1||this.mounted===!1)return!1;const y=this.findDOMNode();y&&this.props.enableUserSelectHack&&(0,u.scheduleRemoveUserSelectStyles)(y.ownerDocument),(0,m.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,y&&((0,m.default)("DraggableCore: Removing handlers"),(0,u.removeEvent)(y.ownerDocument,C.move,this.handleDrag),(0,u.removeEvent)(y.ownerDocument,C.stop,this.handleDragStop))}),P(this,"onMouseDown",n=>(C=R.mouse,this.handleDragStart(n))),P(this,"onMouseUp",n=>(C=R.mouse,this.handleDragStop(n))),P(this,"onTouchStart",n=>(C=R.touch,this.handleDragStart(n))),P(this,"onTouchEnd",n=>(C=R.touch,this.handleDragStop(n)))}componentDidMount(){this.mounted=!0;const n=this.findDOMNode();n&&(0,u.addEvent)(n,R.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const n=this.findDOMNode();if(n){const{ownerDocument:r}=n;(0,u.removeEvent)(r,R.mouse.move,this.handleDrag),(0,u.removeEvent)(r,R.touch.move,this.handleDrag),(0,u.removeEvent)(r,R.mouse.stop,this.handleDragStop),(0,u.removeEvent)(r,R.touch.stop,this.handleDragStop),(0,u.removeEvent)(n,R.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,u.scheduleRemoveUserSelectStyles)(r)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:a.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Ie.default=L,P(L,"displayName","DraggableCore"),P(L,"propTypes",{allowAnyClick:c.default.bool,allowMobileScroll:c.default.bool,children:c.default.node.isRequired,disabled:c.default.bool,enableUserSelectHack:c.default.bool,offsetParent:function(g,n){if(g[n]&&g[n].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:c.default.arrayOf(c.default.number),handle:c.default.string,cancel:c.default.string,nodeRef:c.default.object,onStart:c.default.func,onDrag:c.default.func,onStop:c.default.func,onMouseDown:c.default.func,scale:c.default.number,className:p.dontSetMe,style:p.dontSetMe,transform:p.dontSetMe}),P(L,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ie}var ar;function Yr(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return S.default}}),e.default=void 0;var c=j(me),a=_(Se()),u=_(it),x=$e,p=xt(),m=er(),w=Je(),S=_(Gr()),P=_(rr());function _(r){return r&&r.__esModule?r:{default:r}}function j(r,t){if(typeof WeakMap=="function")var i=new WeakMap,l=new WeakMap;return(j=function(o,y){if(!y&&o&&o.__esModule)return o;var d,f,O={__proto__:null,default:o};if(o===null||typeof o!="object"&&typeof o!="function")return O;if(d=y?l:i){if(d.has(o))return d.get(o);d.set(o,O)}for(const z in o)z!=="default"&&{}.hasOwnProperty.call(o,z)&&((f=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(o,z))&&(f.get||f.set)?d(O,z,f):O[z]=o[z]);return O})(r,t)}function R(){return R=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var l in i)({}).hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},R.apply(null,arguments)}function C(r,t,i){return(t=L(t))in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}function L(r){var t=g(r,"string");return typeof t=="symbol"?t:t+""}function g(r,t){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var l=i.call(r,t);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}class n extends c.Component{static getDerivedStateFromProps(t,i){let{position:l}=t,{prevPropsPosition:o}=i;return l&&(!o||l.x!==o.x||l.y!==o.y)?((0,P.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:o}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(t){super(t),C(this,"onDragStart",(i,l)=>{if((0,P.default)("Draggable: onDragStart: %j",l),this.props.onStart(i,(0,m.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(i,l)=>{if(!this.state.dragging)return!1;(0,P.default)("Draggable: onDrag: %j",l);const o=(0,m.createDraggableData)(this,l),y={x:o.x,y:o.y,slackX:0,slackY:0};if(this.props.bounds){const{x:f,y:O}=y;y.x+=this.state.slackX,y.y+=this.state.slackY;const[z,I]=(0,m.getBoundPosition)(this,y.x,y.y);y.x=z,y.y=I,y.slackX=this.state.slackX+(f-y.x),y.slackY=this.state.slackY+(O-y.y),o.x=y.x,o.y=y.y,o.deltaX=y.x-this.state.x,o.deltaY=y.y-this.state.y}if(this.props.onDrag(i,o)===!1)return!1;this.setState(y)}),C(this,"onDragStop",(i,l)=>{if(!this.state.dragging||this.props.onStop(i,(0,m.createDraggableData)(this,l))===!1)return!1;(0,P.default)("Draggable: onDragStop: %j",l);const y={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:f,y:O}=this.props.position;y.x=f,y.y=O}this.setState(y)}),this.state={dragging:!1,dragged:!1,x:t.position?t.position.x:t.defaultPosition.x,y:t.position?t.position.y:t.defaultPosition.y,prevPropsPosition:{...t.position},slackX:0,slackY:0,isElementSVG:!1},t.position&&!(t.onDrag||t.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.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??u.default.findDOMNode(this)}render(){const{axis:t,bounds:i,children:l,defaultPosition:o,defaultClassName:y,defaultClassNameDragging:d,defaultClassNameDragged:f,position:O,positionOffset:z,scale:I,...G}=this.props;let B={},V=null;const D=!!!O||this.state.dragging,N=O||o,K={x:(0,m.canDragX)(this)&&D?this.state.x:N.x,y:(0,m.canDragY)(this)&&D?this.state.y:N.y};this.state.isElementSVG?V=(0,p.createSVGTransform)(K,z):B=(0,p.createCSSTransform)(K,z);const ie=(0,x.clsx)(l.props.className||"",y,{[d]:this.state.dragging,[f]:this.state.dragged});return c.createElement(S.default,R({},G,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),c.cloneElement(c.Children.only(l),{className:ie,style:{...l.props.style,...B},transform:V}))}}e.default=n,C(n,"displayName","Draggable"),C(n,"propTypes",{...S.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:w.dontSetMe,style:w.dontSetMe,transform:w.dontSetMe}),C(n,"defaultProps",{...S.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(bt)),bt}var or;function wt(){if(or)return He.exports;or=1;const{default:e,DraggableCore:c}=Yr();return He.exports=e,He.exports.default=e,He.exports.DraggableCore=c,He.exports}var Be={exports:{}},Fe={},Qe={},ir;function Ur(){if(ir)return Qe;ir=1,Qe.__esModule=!0,Qe.cloneElement=w;var e=c(me);function c(S){return S&&S.__esModule?S:{default:S}}function a(S,P){var _=Object.keys(S);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(S);P&&(j=j.filter(function(R){return Object.getOwnPropertyDescriptor(S,R).enumerable})),_.push.apply(_,j)}return _}function u(S){for(var P=1;P<arguments.length;P++){var _=arguments[P]!=null?arguments[P]:{};P%2?a(Object(_),!0).forEach(function(j){x(S,j,_[j])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(_)):a(Object(_)).forEach(function(j){Object.defineProperty(S,j,Object.getOwnPropertyDescriptor(_,j))})}return S}function x(S,P,_){return(P=p(P))in S?Object.defineProperty(S,P,{value:_,enumerable:!0,configurable:!0,writable:!0}):S[P]=_,S}function p(S){var P=m(S,"string");return typeof P=="symbol"?P:P+""}function m(S,P){if(typeof S!="object"||!S)return S;var _=S[Symbol.toPrimitive];if(_!==void 0){var j=_.call(S,P);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(S)}function w(S,P){return P.style&&S.props.style&&(P.style=u(u({},S.props.style),P.style)),P.className&&S.props.className&&(P.className=`${S.props.className} ${P.className}`),e.default.cloneElement(S,P)}return Qe}var Ge={},sr;function lr(){if(sr)return Ge;sr=1,Ge.__esModule=!0,Ge.resizableProps=void 0;var e=c(Se());wt();function c(a){return a&&a.__esModule?a:{default:a}}return Ge.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var a=arguments.length,u=new Array(a),x=0;x<a;x++)u[x]=arguments[x];const[p]=u;return p.axis==="both"||p.axis==="y"?e.default.number.isRequired(...u):e.default.number(...u)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var a=arguments.length,u=new Array(a),x=0;x<a;x++)u[x]=arguments[x];const[p]=u;return p.axis==="both"||p.axis==="x"?e.default.number.isRequired(...u):e.default.number(...u)}},Ge}var ur;function cr(){if(ur)return Fe;ur=1,Fe.__esModule=!0,Fe.default=void 0;var e=p(me),c=wt(),a=Ur(),u=lr();const x=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function p(g,n){if(typeof WeakMap=="function")var r=new WeakMap,t=new WeakMap;return(p=function(i,l){if(!l&&i&&i.__esModule)return i;var o,y,d={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return d;if(o=l?t:r){if(o.has(i))return o.get(i);o.set(i,d)}for(const f in i)f!=="default"&&{}.hasOwnProperty.call(i,f)&&((y=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,f))&&(y.get||y.set)?o(d,f,y):d[f]=i[f]);return d})(g,n)}function m(){return m=Object.assign?Object.assign.bind():function(g){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(g[t]=r[t])}return g},m.apply(null,arguments)}function w(g,n){if(g==null)return{};var r,t,i=S(g,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(g);for(t=0;t<l.length;t++)r=l[t],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(g,r)&&(i[r]=g[r])}return i}function S(g,n){if(g==null)return{};var r={};for(var t in g)if({}.hasOwnProperty.call(g,t)){if(n.indexOf(t)!==-1)continue;r[t]=g[t]}return r}function P(g,n){var r=Object.keys(g);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(g);n&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(g,i).enumerable})),r.push.apply(r,t)}return r}function _(g){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?P(Object(r),!0).forEach(function(t){j(g,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach(function(t){Object.defineProperty(g,t,Object.getOwnPropertyDescriptor(r,t))})}return g}function j(g,n,r){return(n=R(n))in g?Object.defineProperty(g,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):g[n]=r,g}function R(g){var n=C(g,"string");return typeof n=="symbol"?n:n+""}function C(g,n){if(typeof g!="object"||!g)return g;var r=g[Symbol.toPrimitive];if(r!==void 0){var t=r.call(g,n);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(g)}let L=class extends e.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(n,r){const{minConstraints:t,maxConstraints:i,lockAspectRatio:l}=this.props;if(!t&&!i&&!l)return[n,r];if(l){const O=this.props.width/this.props.height,z=n-this.props.width,I=r-this.props.height;Math.abs(z)>Math.abs(I*O)?r=n/O:n=r*O}const[o,y]=[n,r];let[d,f]=this.slack||[0,0];return n+=d,r+=f,t&&(n=Math.max(t[0],n),r=Math.max(t[1],r)),i&&(n=Math.min(i[0],n),r=Math.min(i[1],r)),this.slack=[d+(o-n),f+(y-r)],[n,r]}resizeHandler(n,r){return(t,i)=>{let{node:l,deltaX:o,deltaY:y}=i;n==="onResizeStart"&&this.resetData();const d=(this.props.axis==="both"||this.props.axis==="x")&&r!=="n"&&r!=="s",f=(this.props.axis==="both"||this.props.axis==="y")&&r!=="e"&&r!=="w";if(!d&&!f)return;const O=r[0],z=r[r.length-1],I=l.getBoundingClientRect();if(this.lastHandleRect!=null){if(z==="w"){const N=I.left-this.lastHandleRect.left;o+=N}if(O==="n"){const N=I.top-this.lastHandleRect.top;y+=N}}this.lastHandleRect=I,z==="w"&&(o=-o),O==="n"&&(y=-y);let G=this.props.width+(d?o/this.props.transformScale:0),B=this.props.height+(f?y/this.props.transformScale:0);[G,B]=this.runConstraints(G,B),n==="onResizeStop"&&this.lastSize&&({width:G,height:B}=this.lastSize);const V=G!==this.props.width||B!==this.props.height;n!=="onResizeStop"&&(this.lastSize={width:G,height:B});const T=typeof this.props[n]=="function"?this.props[n]:null;T&&!(n==="onResize"&&!V)&&(t.persist?.(),T(t,{node:l,size:{width:G,height:B},handle:r})),n==="onResizeStop"&&this.resetData()}}renderResizeHandle(n,r){const{handle:t}=this.props;if(!t)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${n}`,ref:r});if(typeof t=="function")return t(n,r);const i=typeof t.type=="string",l=_({ref:r},i?{}:{handleAxis:n});return e.cloneElement(t,l)}render(){const n=this.props,{children:r,className:t,draggableOpts:i,width:l,height:o,handle:y,handleSize:d,lockAspectRatio:f,axis:O,minConstraints:z,maxConstraints:I,onResize:G,onResizeStop:B,onResizeStart:V,resizeHandles:T,transformScale:D}=n,N=w(n,x);return(0,a.cloneElement)(r,_(_({},N),{},{className:`${t?`${t} `:""}react-resizable`,children:[...e.Children.toArray(r.props.children),...T.map(K=>{const ie=this.handleRefs[K]??(this.handleRefs[K]=e.createRef());return e.createElement(c.DraggableCore,m({},i,{nodeRef:ie,key:`resizableHandle-${K}`,onStop:this.resizeHandler("onResizeStop",K),onStart:this.resizeHandler("onResizeStart",K),onDrag:this.resizeHandler("onResize",K)}),this.renderResizeHandle(K,ie))})]}))}};return Fe.default=L,L.propTypes=u.resizableProps,L.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Fe}var Ye={},dr;function $r(){if(dr)return Ye;dr=1,Ye.__esModule=!0,Ye.default=void 0;var e=m(me),c=p(Se()),a=p(cr()),u=lr();const x=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function p(n){return n&&n.__esModule?n:{default:n}}function m(n,r){if(typeof WeakMap=="function")var t=new WeakMap,i=new WeakMap;return(m=function(l,o){if(!o&&l&&l.__esModule)return l;var y,d,f={__proto__:null,default:l};if(l===null||typeof l!="object"&&typeof l!="function")return f;if(y=o?i:t){if(y.has(l))return y.get(l);y.set(l,f)}for(const O in l)O!=="default"&&{}.hasOwnProperty.call(l,O)&&((d=(y=Object.defineProperty)&&Object.getOwnPropertyDescriptor(l,O))&&(d.get||d.set)?y(f,O,d):f[O]=l[O]);return f})(n,r)}function w(){return w=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},w.apply(null,arguments)}function S(n,r){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);r&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),t.push.apply(t,i)}return t}function P(n){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?S(Object(t),!0).forEach(function(i){_(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function _(n,r,t){return(r=j(r))in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}function j(n){var r=R(n,"string");return typeof r=="symbol"?r:r+""}function R(n,r){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,r);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}function C(n,r){if(n==null)return{};var t,i,l=L(n,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(n);for(i=0;i<o.length;i++)t=o[i],r.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(l[t]=n[t])}return l}function L(n,r){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(r.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let g=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(r,t)=>{const{size:i}=t;this.props.onResize?(r.persist?.(),this.setState(i,()=>this.props.onResize&&this.props.onResize(r,t))):this.setState(i)}}static getDerivedStateFromProps(r,t){return t.propsWidth!==r.width||t.propsHeight!==r.height?{width:r.width,height:r.height,propsWidth:r.width,propsHeight:r.height}:null}render(){const r=this.props,{handle:t,handleSize:i,onResize:l,onResizeStart:o,onResizeStop:y,draggableOpts:d,minConstraints:f,maxConstraints:O,lockAspectRatio:z,axis:I,width:G,height:B,resizeHandles:V,style:T,transformScale:D}=r,N=C(r,x);return e.createElement(a.default,{axis:I,draggableOpts:d,handle:t,handleSize:i,height:this.state.height,lockAspectRatio:z,maxConstraints:O,minConstraints:f,onResizeStart:o,onResize:this.onResize,onResizeStop:y,resizeHandles:V,transformScale:D,width:this.state.width},e.createElement("div",w({},N,{style:P(P({},T),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return Ye.default=g,g.propTypes=P(P({},u.resizableProps),{},{children:c.default.element}),Ye}var fr;function Vr(){return fr||(fr=1,Be.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Be.exports.Resizable=cr().default,Be.exports.ResizableBox=$r().default),Be.exports}var je={},pr;function hr(){if(pr)return je;pr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.resizeHandleType=je.resizeHandleAxesType=je.default=void 0;var e=a(Se()),c=a(me);function a(p){return p&&p.__esModule?p:{default:p}}const u=je.resizeHandleAxesType=e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),x=je.resizeHandleType=e.default.oneOfType([e.default.node,e.default.func]);return je.default={className:e.default.string,style:e.default.object,width:e.default.number,autoSize:e.default.bool,cols:e.default.number,draggableCancel:e.default.string,draggableHandle:e.default.string,verticalCompact:function(p){p.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:e.default.oneOf(["vertical","horizontal"]),layout:function(p){var m=p.layout;m!==void 0&&Ne().validateLayout(m,"layout")},margin:e.default.arrayOf(e.default.number),containerPadding:e.default.arrayOf(e.default.number),rowHeight:e.default.number,maxRows:e.default.number,isBounded:e.default.bool,isDraggable:e.default.bool,isResizable:e.default.bool,allowOverlap:e.default.bool,preventCollision:e.default.bool,useCSSTransforms:e.default.bool,transformScale:e.default.number,isDroppable:e.default.bool,resizeHandles:u,resizeHandle:x,onLayoutChange:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onDragStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,onResizeStop:e.default.func,onDrop:e.default.func,droppingItem:e.default.shape({i:e.default.string.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired}),children:function(p,m){const w=p[m],S={};c.default.Children.forEach(w,function(P){if(P?.key!=null){if(S[P.key])throw new Error('Duplicate child key "'+P.key+'" found! This will cause problems in ReactGridLayout.');S[P.key]=!0}})},innerRef:e.default.any},je}var mr;function Xr(){if(mr)return We;mr=1,Object.defineProperty(We,"__esModule",{value:!0}),We.default=void 0;var e=P(me),c=it,a=P(Se()),u=wt(),x=Vr(),p=Ne(),m=dt(),w=hr(),S=P($e);function P(n){return n&&n.__esModule?n:{default:n}}function _(n,r){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);r&&(i=i.filter(function(l){return Object.getOwnPropertyDescriptor(n,l).enumerable})),t.push.apply(t,i)}return t}function j(n){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?_(Object(t),!0).forEach(function(i){R(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function R(n,r,t){return(r=C(r))in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}function C(n){var r=L(n,"string");return typeof r=="symbol"?r:r+""}function L(n,r){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,r);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}let g=class extends e.default.Component{constructor(){super(...arguments),R(this,"state",{resizing:null,dragging:null,className:""}),R(this,"elementRef",e.default.createRef()),R(this,"onDragStart",(r,t)=>{let{node:i}=t;const{onDragStart:l,transformScale:o}=this.props;if(!l)return;const y={top:0,left:0},{offsetParent:d}=i;if(!d)return;const f=d.getBoundingClientRect(),O=i.getBoundingClientRect(),z=O.left/o,I=f.left/o,G=O.top/o,B=f.top/o;y.left=z-I+d.scrollLeft,y.top=G-B+d.scrollTop,this.setState({dragging:y});const{x:V,y:T}=(0,m.calcXY)(this.getPositionParams(),y.top,y.left,this.props.w,this.props.h);return l.call(this,this.props.i,V,T,{e:r,node:i,newPosition:y})}),R(this,"onDrag",(r,t,i)=>{let{node:l,deltaX:o,deltaY:y}=t;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let f=this.state.dragging.top+y,O=this.state.dragging.left+o;const{isBounded:z,i:I,w:G,h:B,containerWidth:V}=this.props,T=this.getPositionParams();if(z){const{offsetParent:ie}=l;if(ie){const{margin:M,rowHeight:b}=this.props,k=ie.clientHeight-(0,m.calcGridItemWHPx)(B,b,M[1]);f=(0,m.clamp)(f,0,k);const Y=(0,m.calcGridColWidth)(T),U=V-(0,m.calcGridItemWHPx)(G,Y,M[0]);O=(0,m.clamp)(O,0,U)}}const D={top:f,left:O};i?this.setState({dragging:D}):(0,c.flushSync)(()=>{this.setState({dragging:D})});const{x:N,y:K}=(0,m.calcXY)(T,f,O,G,B);return d.call(this,I,N,K,{e:r,node:l,newPosition:D})}),R(this,"onDragStop",(r,t)=>{let{node:i}=t;const{onDragStop:l}=this.props;if(!l)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:o,h:y,i:d}=this.props,{left:f,top:O}=this.state.dragging,z={top:O,left:f};this.setState({dragging:null});const{x:I,y:G}=(0,m.calcXY)(this.getPositionParams(),O,f,o,y);return l.call(this,d,I,G,{e:r,node:i,newPosition:z})}),R(this,"onResizeStop",(r,t,i)=>this.onResizeHandler(r,t,i,"onResizeStop")),R(this,"onResizeStart",(r,t,i)=>this.onResizeHandler(r,t,i,"onResizeStart")),R(this,"onResize",(r,t,i)=>this.onResizeHandler(r,t,i,"onResize"))}shouldComponentUpdate(r,t){if(this.props.children!==r.children||this.props.droppingPosition!==r.droppingPosition)return!0;const i=(0,m.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),l=(0,m.calcGridItemPosition)(this.getPositionParams(r),r.x,r.y,r.w,r.h,t);return!(0,p.fastPositionEqual)(i,l)||this.props.useCSSTransforms!==r.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(r){this.moveDroppingItem(r)}moveDroppingItem(r){const{droppingPosition:t}=this.props;if(!t)return;const i=this.elementRef.current;if(!i)return;const l=r.droppingPosition||{left:0,top:0},{dragging:o}=this.state,y=o&&t.left!==l.left||t.top!==l.top;if(!o)this.onDragStart(t.e,{node:i,deltaX:t.left,deltaY:t.top});else if(y){const d=t.left-o.left,f=t.top-o.top;this.onDrag(t.e,{node:i,deltaX:d,deltaY:f},!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:i,useCSSTransforms:l}=this.props;let o;return l?o=(0,p.setTransform)(r):(o=(0,p.setTopLeft)(r),t&&(o.left=(0,p.perc)(r.left/i),o.width=(0,p.perc)(r.width/i))),o}mixinDraggable(r,t){return e.default.createElement(u.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(i,l)=>t(i,l,r)}mixinResizable(r,t,i){const{cols:l,minW:o,minH:y,maxW:d,maxH:f,transformScale:O,resizeHandles:z,resizeHandle:I}=this.props,G=this.getPositionParams(),B=(0,m.calcGridItemPosition)(G,0,0,l,0).width,V=(0,m.calcGridItemPosition)(G,0,0,o,y),T=(0,m.calcGridItemPosition)(G,0,0,d,f),D=[V.width,V.height],N=[Math.min(T.width,B),Math.min(T.height,1/0)];return e.default.createElement(x.Resizable,{draggableOpts:{disabled:!i},className:i?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:D,maxConstraints:N,onResizeStop:this.curryResizeHandler(t,this.onResizeStop),onResizeStart:this.curryResizeHandler(t,this.onResizeStart),onResize:this.curryResizeHandler(t,this.onResize),transformScale:O,resizeHandles:z,handle:I},r)}onResizeHandler(r,t,i,l){let{node:o,size:y,handle:d}=t;const f=this.props[l];if(!f)return;const{x:O,y:z,i:I,maxH:G,minH:B,containerWidth:V}=this.props,{minW:T,maxW:D}=this.props;let N=y;o&&(N=(0,p.resizeItemInDirection)(d,i,y,V),(0,c.flushSync)(()=>{this.setState({resizing:l==="onResizeStop"?null:N})}));let{w:K,h:ie}=(0,m.calcWH)(this.getPositionParams(),N.width,N.height,O,z,d);K=(0,m.clamp)(K,Math.max(T,1),D),ie=(0,m.clamp)(ie,B,G),f.call(this,I,K,ie,{e:r,node:o,size:N,handle:d})}render(){const{x:r,y:t,w:i,h:l,isDraggable:o,isResizable:y,droppingPosition:d,useCSSTransforms:f}=this.props,O=(0,m.calcGridItemPosition)(this.getPositionParams(),r,t,i,l,this.state),z=e.default.Children.only(this.props.children);let I=e.default.cloneElement(z,{ref:this.elementRef,className:(0,S.default)("react-grid-item",z.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":o,"react-draggable-dragging":!!this.state.dragging,dropping:!!d,cssTransforms:f}),style:j(j(j({},this.props.style),z.props.style),this.createStyle(O))});return I=this.mixinResizable(I,O,y),I=this.mixinDraggable(I,o),I}};return We.default=g,R(g,"propTypes",{children:a.default.element,cols:a.default.number.isRequired,containerWidth:a.default.number.isRequired,rowHeight:a.default.number.isRequired,margin:a.default.array.isRequired,maxRows:a.default.number.isRequired,containerPadding:a.default.array.isRequired,x:a.default.number.isRequired,y:a.default.number.isRequired,w:a.default.number.isRequired,h:a.default.number.isRequired,minW:function(n,r){const t=n[r];if(typeof t!="number")return new Error("minWidth not Number");if(t>n.w||t>n.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(n,r){const t=n[r];if(typeof t!="number")return new Error("maxWidth not Number");if(t<n.w||t<n.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(n,r){const t=n[r];if(typeof t!="number")return new Error("minHeight not Number");if(t>n.h||t>n.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(n,r){const t=n[r];if(typeof t!="number")return new Error("maxHeight not Number");if(t<n.h||t<n.minH)return new Error("maxHeight smaller than item height/minHeight")},i:a.default.string.isRequired,resizeHandles:w.resizeHandleAxesType,resizeHandle:w.resizeHandleType,onDragStop:a.default.func,onDragStart:a.default.func,onDrag:a.default.func,onResizeStop:a.default.func,onResizeStart:a.default.func,onResize:a.default.func,isDraggable:a.default.bool.isRequired,isResizable:a.default.bool.isRequired,isBounded:a.default.bool.isRequired,static:a.default.bool,useCSSTransforms:a.default.bool.isRequired,transformScale:a.default.number,className:a.default.string,handle:a.default.string,cancel:a.default.string,droppingPosition:a.default.shape({e:a.default.object.isRequired,left:a.default.number.isRequired,top:a.default.number.isRequired})}),R(g,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),We}var gr;function yr(){if(gr)return Le;gr=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.default=void 0;var e=S(me),c=ut(),a=w($e),u=Ne(),x=dt(),p=w(Xr()),m=w(hr());function w(r){return r&&r.__esModule?r:{default:r}}function S(r,t){if(typeof WeakMap=="function")var i=new WeakMap,l=new WeakMap;return(S=function(o,y){if(!y&&o&&o.__esModule)return o;var d,f,O={__proto__:null,default:o};if(o===null||typeof o!="object"&&typeof o!="function")return O;if(d=y?l:i){if(d.has(o))return d.get(o);d.set(o,O)}for(const z in o)z!=="default"&&{}.hasOwnProperty.call(o,z)&&((f=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(o,z))&&(f.get||f.set)?d(O,z,f):O[z]=o[z]);return O})(r,t)}function P(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);t&&(l=l.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,l)}return i}function _(r){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?P(Object(i),!0).forEach(function(l){j(r,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):P(Object(i)).forEach(function(l){Object.defineProperty(r,l,Object.getOwnPropertyDescriptor(i,l))})}return r}function j(r,t,i){return(t=R(t))in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}function R(r){var t=C(r,"string");return typeof t=="symbol"?t:t+""}function C(r,t){if(typeof r!="object"||!r)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var l=i.call(r,t);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}const L="react-grid-layout";let g=!1;try{g=/firefox/i.test(navigator.userAgent)}catch{}let n=class extends e.Component{constructor(){super(...arguments),j(this,"state",{activeDrag:null,layout:(0,u.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,u.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),j(this,"dragEnterCounter",0),j(this,"onDragStart",(t,i,l,o)=>{let{e:y,node:d}=o;const{layout:f}=this.state,O=(0,u.getLayoutItem)(f,t);if(!O)return;const z={w:O.w,h:O.h,x:O.x,y:O.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,u.cloneLayoutItem)(O),oldLayout:f,activeDrag:z}),this.props.onDragStart(f,O,O,null,y,d)}),j(this,"onDrag",(t,i,l,o)=>{let{e:y,node:d}=o;const{oldDragItem:f}=this.state;let{layout:O}=this.state;const{cols:z,allowOverlap:I,preventCollision:G}=this.props,B=(0,u.getLayoutItem)(O,t);if(!B)return;const V={w:B.w,h:B.h,x:B.x,y:B.y,placeholder:!0,i:t};O=(0,u.moveElement)(O,B,i,l,!0,G,(0,u.compactType)(this.props),z,I),this.props.onDrag(O,f,B,V,y,d),this.setState({layout:I?O:(0,u.compact)(O,(0,u.compactType)(this.props),z),activeDrag:V})}),j(this,"onDragStop",(t,i,l,o)=>{let{e:y,node:d}=o;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:O}=this.state;const{cols:z,preventCollision:I,allowOverlap:G}=this.props,B=(0,u.getLayoutItem)(O,t);if(!B)return;O=(0,u.moveElement)(O,B,i,l,!0,I,(0,u.compactType)(this.props),z,G);const T=G?O:(0,u.compact)(O,(0,u.compactType)(this.props),z);this.props.onDragStop(T,f,B,null,y,d);const{oldLayout:D}=this.state;this.setState({activeDrag:null,layout:T,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(T,D)}),j(this,"onResizeStart",(t,i,l,o)=>{let{e:y,node:d}=o;const{layout:f}=this.state,O=(0,u.getLayoutItem)(f,t);O&&(this.setState({oldResizeItem:(0,u.cloneLayoutItem)(O),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,O,O,null,y,d))}),j(this,"onResize",(t,i,l,o)=>{let{e:y,node:d,size:f,handle:O}=o;const{oldResizeItem:z}=this.state,{layout:I}=this.state,{cols:G,preventCollision:B,allowOverlap:V}=this.props;let T=!1,D,N,K;const[ie,M]=(0,u.withLayoutItem)(I,t,k=>{let Y;return N=k.x,K=k.y,["sw","w","nw","n","ne"].indexOf(O)!==-1&&(["sw","nw","w"].indexOf(O)!==-1&&(N=k.x+(k.w-i),i=k.x!==N&&N<0?k.w:i,N=N<0?0:N),["ne","n","nw"].indexOf(O)!==-1&&(K=k.y+(k.h-l),l=k.y!==K&&K<0?k.h:l,K=K<0?0:K),T=!0),B&&!V&&(Y=(0,u.getAllCollisions)(I,_(_({},k),{},{w:i,h:l,x:N,y:K})).filter(te=>te.i!==k.i).length>0,Y&&(K=k.y,l=k.h,N=k.x,i=k.w,T=!1)),k.w=i,k.h=l,k});if(!M)return;D=ie,T&&(D=(0,u.moveElement)(ie,M,N,K,!0,this.props.preventCollision,(0,u.compactType)(this.props),G,V));const b={w:M.w,h:M.h,x:M.x,y:M.y,static:!0,i:t};this.props.onResize(D,z,M,b,y,d),this.setState({layout:V?D:(0,u.compact)(D,(0,u.compactType)(this.props),G),activeDrag:b})}),j(this,"onResizeStop",(t,i,l,o)=>{let{e:y,node:d}=o;const{layout:f,oldResizeItem:O}=this.state,{cols:z,allowOverlap:I}=this.props,G=(0,u.getLayoutItem)(f,t),B=I?f:(0,u.compact)(f,(0,u.compactType)(this.props),z);this.props.onResizeStop(B,O,G,null,y,d);const{oldLayout:V}=this.state;this.setState({activeDrag:null,layout:B,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(B,V)}),j(this,"onDragOver",t=>{var i;if(t.preventDefault(),t.stopPropagation(),g&&!((i=t.nativeEvent.target)!==null&&i!==void 0&&i.classList.contains(L)))return!1;const{droppingItem:l,onDropDragOver:o,margin:y,cols:d,rowHeight:f,maxRows:O,width:z,containerPadding:I,transformScale:G}=this.props,B=o?.(t);if(B===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const V=_(_({},l),B),{layout:T}=this.state,D=t.currentTarget.getBoundingClientRect(),N=t.clientX-D.left,K=t.clientY-D.top,ie={left:N/G,top:K/G,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:M,top:b}=this.state.droppingPosition;(M!=N||b!=K)&&this.setState({droppingPosition:ie})}}else{const M={cols:d,margin:y,maxRows:O,rowHeight:f,containerWidth:z,containerPadding:I||y},b=(0,x.calcXY)(M,K,N,V.w,V.h);this.setState({droppingDOMNode:e.createElement("div",{key:V.i}),droppingPosition:ie,layout:[...T,_(_({},V),{},{x:b.x,y:b.y,static:!1,isDraggable:!0})]})}}),j(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:i}=this.props,{layout:l}=this.state,o=(0,u.compact)(l.filter(y=>y.i!==t.i),(0,u.compactType)(this.props),i,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),j(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),j(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),j(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:i}=this.props,{layout:l}=this.state,o=l.find(y=>y.i===i.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(l,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,i){let l;return i.activeDrag?null:(!(0,c.deepEqual)(t.layout,i.propsLayout)||t.compactType!==i.compactType?l=t.layout:(0,u.childrenEqual)(t.children,i.children)||(l=i.layout),l?{layout:(0,u.synchronizeLayoutWithChildren)(l,t.children,t.cols,(0,u.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,i){return this.props.children!==t.children||!(0,u.fastRGLPropsEqual)(this.props,t,c.deepEqual)||this.state.activeDrag!==i.activeDrag||this.state.mounted!==i.mounted||this.state.droppingPosition!==i.droppingPosition}componentDidUpdate(t,i){if(!this.state.activeDrag){const l=this.state.layout,o=i.layout;this.onLayoutMaybeChanged(l,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,u.bottom)(this.state.layout),i=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+i*2+"px"}onLayoutMaybeChanged(t,i){i||(i=this.state.layout),(0,c.deepEqual)(i,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:i,cols:l,margin:o,containerPadding:y,rowHeight:d,maxRows:f,useCSSTransforms:O,transformScale:z}=this.props;return e.createElement(p.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:i,cols:l,margin:o,containerPadding:y||o,maxRows:f,rowHeight:d,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:O,transformScale:z},e.createElement("div",null))}processGridItem(t,i){if(!t||!t.key)return;const l=(0,u.getLayoutItem)(this.state.layout,String(t.key));if(!l)return null;const{width:o,cols:y,margin:d,containerPadding:f,rowHeight:O,maxRows:z,isDraggable:I,isResizable:G,isBounded:B,useCSSTransforms:V,transformScale:T,draggableCancel:D,draggableHandle:N,resizeHandles:K,resizeHandle:ie}=this.props,{mounted:M,droppingPosition:b}=this.state,k=typeof l.isDraggable=="boolean"?l.isDraggable:!l.static&&I,Y=typeof l.isResizable=="boolean"?l.isResizable:!l.static&&G,U=l.resizeHandles||K,te=k&&B&&l.isBounded!==!1;return e.createElement(p.default,{containerWidth:o,cols:y,margin:d,containerPadding:f||d,maxRows:z,rowHeight:O,cancel:D,handle:N,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:k,isResizable:Y,isBounded:te,useCSSTransforms:V&&M,usePercentages:!M,transformScale:T,w:l.w,h:l.h,x:l.x,y:l.y,i:l.i,minH:l.minH,minW:l.minW,maxH:l.maxH,maxW:l.maxW,static:l.static,droppingPosition:i?b:void 0,resizeHandles:U,resizeHandle:ie},t)}render(){const{className:t,style:i,isDroppable:l,innerRef:o}=this.props,y=(0,a.default)(L,t),d=_({height:this.containerHeight()},i);return e.createElement("div",{ref:o,className:y,style:d,onDrop:l?this.onDrop:u.noop,onDragLeave:l?this.onDragLeave:u.noop,onDragEnter:l?this.onDragEnter:u.noop,onDragOver:l?this.onDragOver:u.noop},e.Children.map(this.props.children,f=>this.processGridItem(f)),l&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Le.default=n,j(n,"displayName","ReactGridLayout"),j(n,"propTypes",m.default),j(n,"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:u.noop,onDragStart:u.noop,onDrag:u.noop,onDragStop:u.noop,onResizeStart:u.noop,onResize:u.noop,onResizeStop:u.noop,onDrop:u.noop,onDropDragOver:u.noop}),Le}var Ue={},Ee={},vr;function br(){if(vr)return Ee;vr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.findOrGenerateResponsiveLayout=u,Ee.getBreakpointFromWidth=c,Ee.getColsFromBreakpoint=a,Ee.sortBreakpoints=x;var e=Ne();function c(p,m){const w=x(p);let S=w[0];for(let P=1,_=w.length;P<_;P++){const j=w[P];m>p[j]&&(S=j)}return S}function a(p,m){if(!m[p])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+p+" is missing!");return m[p]}function u(p,m,w,S,P,_){if(p[w])return(0,e.cloneLayout)(p[w]);let j=p[S];const R=x(m),C=R.slice(R.indexOf(w));for(let L=0,g=C.length;L<g;L++){const n=C[L];if(p[n]){j=p[n];break}}return j=(0,e.cloneLayout)(j||[]),(0,e.compact)((0,e.correctBounds)(j,{cols:P}),_,P)}function x(p){return Object.keys(p).sort(function(w,S){return p[w]-p[S]})}return Ee}var xr;function Kr(){if(xr)return Ue;xr=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.default=void 0;var e=S(me),c=w(Se()),a=ut(),u=Ne(),x=br(),p=w(yr());const m=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function w(l){return l&&l.__esModule?l:{default:l}}function S(l,o){if(typeof WeakMap=="function")var y=new WeakMap,d=new WeakMap;return(S=function(f,O){if(!O&&f&&f.__esModule)return f;var z,I,G={__proto__:null,default:f};if(f===null||typeof f!="object"&&typeof f!="function")return G;if(z=O?d:y){if(z.has(f))return z.get(f);z.set(f,G)}for(const B in f)B!=="default"&&{}.hasOwnProperty.call(f,B)&&((I=(z=Object.defineProperty)&&Object.getOwnPropertyDescriptor(f,B))&&(I.get||I.set)?z(G,B,I):G[B]=f[B]);return G})(l,o)}function P(){return P=Object.assign?Object.assign.bind():function(l){for(var o=1;o<arguments.length;o++){var y=arguments[o];for(var d in y)({}).hasOwnProperty.call(y,d)&&(l[d]=y[d])}return l},P.apply(null,arguments)}function _(l,o){if(l==null)return{};var y,d,f=j(l,o);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(l);for(d=0;d<O.length;d++)y=O[d],o.indexOf(y)===-1&&{}.propertyIsEnumerable.call(l,y)&&(f[y]=l[y])}return f}function j(l,o){if(l==null)return{};var y={};for(var d in l)if({}.hasOwnProperty.call(l,d)){if(o.indexOf(d)!==-1)continue;y[d]=l[d]}return y}function R(l,o){var y=Object.keys(l);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);o&&(d=d.filter(function(f){return Object.getOwnPropertyDescriptor(l,f).enumerable})),y.push.apply(y,d)}return y}function C(l){for(var o=1;o<arguments.length;o++){var y=arguments[o]!=null?arguments[o]:{};o%2?R(Object(y),!0).forEach(function(d){L(l,d,y[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(y)):R(Object(y)).forEach(function(d){Object.defineProperty(l,d,Object.getOwnPropertyDescriptor(y,d))})}return l}function L(l,o,y){return(o=g(o))in l?Object.defineProperty(l,o,{value:y,enumerable:!0,configurable:!0,writable:!0}):l[o]=y,l}function g(l){var o=n(l,"string");return typeof o=="symbol"?o:o+""}function n(l,o){if(typeof l!="object"||!l)return l;var y=l[Symbol.toPrimitive];if(y!==void 0){var d=y.call(l,o);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(l)}const r=l=>Object.prototype.toString.call(l);function t(l,o){return l==null?null:Array.isArray(l)?l:l[o]}let i=class extends e.Component{constructor(){super(...arguments),L(this,"state",this.generateInitialState()),L(this,"onLayoutChange",o=>{this.props.onLayoutChange(o,C(C({},this.props.layouts),{},{[this.state.breakpoint]:o}))})}generateInitialState(){const{width:o,breakpoints:y,layouts:d,cols:f}=this.props,O=(0,x.getBreakpointFromWidth)(y,o),z=(0,x.getColsFromBreakpoint)(O,f),I=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,x.findOrGenerateResponsiveLayout)(d,y,O,O,z,I),breakpoint:O,cols:z}}static getDerivedStateFromProps(o,y){if(!(0,a.deepEqual)(o.layouts,y.layouts)){const{breakpoint:d,cols:f}=y;return{layout:(0,x.findOrGenerateResponsiveLayout)(o.layouts,o.breakpoints,d,d,f,o.compactType),layouts:o.layouts}}return null}componentDidUpdate(o){(this.props.width!=o.width||this.props.breakpoint!==o.breakpoint||!(0,a.deepEqual)(this.props.breakpoints,o.breakpoints)||!(0,a.deepEqual)(this.props.cols,o.cols))&&this.onWidthChange(o)}onWidthChange(o){const{breakpoints:y,cols:d,layouts:f,compactType:O}=this.props,z=this.props.breakpoint||(0,x.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),I=this.state.breakpoint,G=(0,x.getColsFromBreakpoint)(z,d),B=C({},f);if(I!==z||o.breakpoints!==y||o.cols!==d){I in B||(B[I]=(0,u.cloneLayout)(this.state.layout));let D=(0,x.findOrGenerateResponsiveLayout)(B,y,z,I,G,O);D=(0,u.synchronizeLayoutWithChildren)(D,this.props.children,G,O,this.props.allowOverlap),B[z]=D,this.props.onBreakpointChange(z,G),this.props.onLayoutChange(D,B),this.setState({breakpoint:z,layout:D,cols:G})}const V=t(this.props.margin,z),T=t(this.props.containerPadding,z);this.props.onWidthChange(this.props.width,V,G,T)}render(){const o=this.props,{breakpoint:y,breakpoints:d,cols:f,layouts:O,margin:z,containerPadding:I,onBreakpointChange:G,onLayoutChange:B,onWidthChange:V}=o,T=_(o,m);return e.createElement(p.default,P({},T,{margin:t(z,this.state.breakpoint),containerPadding:t(I,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Ue.default=i,L(i,"propTypes",{breakpoint:c.default.string,breakpoints:c.default.object,allowOverlap:c.default.bool,cols:c.default.object,margin:c.default.oneOfType([c.default.array,c.default.object]),containerPadding:c.default.oneOfType([c.default.array,c.default.object]),layouts(l,o){if(r(l[o])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+r(l[o]));Object.keys(l[o]).forEach(y=>{if(!(y in l.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,u.validateLayout)(l.layouts[y],"layouts."+y)})},width:c.default.number.isRequired,onBreakpointChange:c.default.func,onLayoutChange:c.default.func,onWidthChange:c.default.func}),L(i,"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:u.noop,onLayoutChange:u.noop,onWidthChange:u.noop}),Ue}var et={},wr=(function(){if(typeof Map<"u")return Map;function e(c,a){var u=-1;return c.some(function(x,p){return x[0]===a?(u=p,!0):!1}),u}return(function(){function c(){this.__entries__=[]}return Object.defineProperty(c.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),c.prototype.get=function(a){var u=e(this.__entries__,a),x=this.__entries__[u];return x&&x[1]},c.prototype.set=function(a,u){var x=e(this.__entries__,a);~x?this.__entries__[x][1]=u:this.__entries__.push([a,u])},c.prototype.delete=function(a){var u=this.__entries__,x=e(u,a);~x&&u.splice(x,1)},c.prototype.has=function(a){return!!~e(this.__entries__,a)},c.prototype.clear=function(){this.__entries__.splice(0)},c.prototype.forEach=function(a,u){u===void 0&&(u=null);for(var x=0,p=this.__entries__;x<p.length;x++){var m=p[x];a.call(u,m[1],m[0])}},c})()})(),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")()})(),Jr=(function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(tt):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),Zr=2;function Qr(e,c){var a=!1,u=!1,x=0;function p(){a&&(a=!1,e()),u&&w()}function m(){Jr(p)}function w(){var S=Date.now();if(a){if(S-x<Zr)return;u=!0}else a=!0,u=!1,setTimeout(m,c);x=S}return w}var en=20,tn=["top","right","bottom","left","width","height","size","weight"],rn=typeof MutationObserver<"u",nn=(function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Qr(this.refresh.bind(this),en)}return e.prototype.addObserver=function(c){~this.observers_.indexOf(c)||this.observers_.push(c),this.connected_||this.connect_()},e.prototype.removeObserver=function(c){var a=this.observers_,u=a.indexOf(c);~u&&a.splice(u,1),!a.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var c=this.updateObservers_();c&&this.refresh()},e.prototype.updateObservers_=function(){var c=this.observers_.filter(function(a){return a.gatherActive(),a.hasActive()});return c.forEach(function(a){return a.broadcastActive()}),c.length>0},e.prototype.connect_=function(){!jt||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),rn?(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)},e.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)},e.prototype.onTransitionEnd_=function(c){var a=c.propertyName,u=a===void 0?"":a,x=tn.some(function(p){return!!~u.indexOf(p)});x&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e})(),jr=(function(e,c){for(var a=0,u=Object.keys(c);a<u.length;a++){var x=u[a];Object.defineProperty(e,x,{value:c[x],enumerable:!1,writable:!1,configurable:!0})}return e}),ze=(function(e){var c=e&&e.ownerDocument&&e.ownerDocument.defaultView;return c||tt}),Rr=nt(0,0,0,0);function rt(e){return parseFloat(e)||0}function Sr(e){for(var c=[],a=1;a<arguments.length;a++)c[a-1]=arguments[a];return c.reduce(function(u,x){var p=e["border-"+x+"-width"];return u+rt(p)},0)}function an(e){for(var c=["top","right","bottom","left"],a={},u=0,x=c;u<x.length;u++){var p=x[u],m=e["padding-"+p];a[p]=rt(m)}return a}function on(e){var c=e.getBBox();return nt(0,0,c.width,c.height)}function sn(e){var c=e.clientWidth,a=e.clientHeight;if(!c&&!a)return Rr;var u=ze(e).getComputedStyle(e),x=an(u),p=x.left+x.right,m=x.top+x.bottom,w=rt(u.width),S=rt(u.height);if(u.boxSizing==="border-box"&&(Math.round(w+p)!==c&&(w-=Sr(u,"left","right")+p),Math.round(S+m)!==a&&(S-=Sr(u,"top","bottom")+m)),!un(e)){var P=Math.round(w+p)-c,_=Math.round(S+m)-a;Math.abs(P)!==1&&(w-=P),Math.abs(_)!==1&&(S-=_)}return nt(x.left,x.top,w,S)}var ln=(function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ze(e).SVGGraphicsElement}:function(e){return e instanceof ze(e).SVGElement&&typeof e.getBBox=="function"}})();function un(e){return e===ze(e).document.documentElement}function cn(e){return jt?ln(e)?on(e):sn(e):Rr}function dn(e){var c=e.x,a=e.y,u=e.width,x=e.height,p=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,m=Object.create(p.prototype);return jr(m,{x:c,y:a,width:u,height:x,top:a,right:c+u,bottom:x+a,left:c}),m}function nt(e,c,a,u){return{x:e,y:c,width:a,height:u}}var fn=(function(){function e(c){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=nt(0,0,0,0),this.target=c}return e.prototype.isActive=function(){var c=cn(this.target);return this.contentRect_=c,c.width!==this.broadcastWidth||c.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var c=this.contentRect_;return this.broadcastWidth=c.width,this.broadcastHeight=c.height,c},e})(),pn=(function(){function e(c,a){var u=dn(a);jr(this,{target:c,contentRect:u})}return e})(),hn=(function(){function e(c,a,u){if(this.activeObservations_=[],this.observations_=new wr,typeof c!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=c,this.controller_=a,this.callbackCtx_=u}return e.prototype.observe=function(c){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(c instanceof ze(c).Element))throw new TypeError('parameter 1 is not of type "Element".');var a=this.observations_;a.has(c)||(a.set(c,new fn(c)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(c){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(c instanceof ze(c).Element))throw new TypeError('parameter 1 is not of type "Element".');var a=this.observations_;a.has(c)&&(a.delete(c),a.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var c=this;this.clearActive(),this.observations_.forEach(function(a){a.isActive()&&c.activeObservations_.push(a)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var c=this.callbackCtx_,a=this.activeObservations_.map(function(u){return new pn(u.target,u.broadcastRect())});this.callback_.call(c,a,c),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e})(),Or=typeof WeakMap<"u"?new WeakMap:new wr,_r=(function(){function e(c){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var a=nn.getInstance(),u=new hn(c,a,this);Or.set(this,u)}return e})();["observe","unobserve","disconnect"].forEach(function(e){_r.prototype[e]=function(){var c;return(c=Or.get(this))[e].apply(c,arguments)}});var mn=(function(){return typeof tt.ResizeObserver<"u"?tt.ResizeObserver:_r})();const gn=Dr(Object.freeze(Object.defineProperty({__proto__:null,default:mn},Symbol.toStringTag,{value:"Module"})));var Er;function yn(){if(Er)return et;Er=1,Object.defineProperty(et,"__esModule",{value:!0}),et.default=L;var e=m(me),c=p(Se()),a=p(gn),u=p($e);const x=["measureBeforeMount"];function p(g){return g&&g.__esModule?g:{default:g}}function m(g,n){if(typeof WeakMap=="function")var r=new WeakMap,t=new WeakMap;return(m=function(i,l){if(!l&&i&&i.__esModule)return i;var o,y,d={__proto__:null,default:i};if(i===null||typeof i!="object"&&typeof i!="function")return d;if(o=l?t:r){if(o.has(i))return o.get(i);o.set(i,d)}for(const f in i)f!=="default"&&{}.hasOwnProperty.call(i,f)&&((y=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,f))&&(y.get||y.set)?o(d,f,y):d[f]=i[f]);return d})(g,n)}function w(){return w=Object.assign?Object.assign.bind():function(g){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(g[t]=r[t])}return g},w.apply(null,arguments)}function S(g,n){if(g==null)return{};var r,t,i=P(g,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(g);for(t=0;t<l.length;t++)r=l[t],n.indexOf(r)===-1&&{}.propertyIsEnumerable.call(g,r)&&(i[r]=g[r])}return i}function P(g,n){if(g==null)return{};var r={};for(var t in g)if({}.hasOwnProperty.call(g,t)){if(n.indexOf(t)!==-1)continue;r[t]=g[t]}return r}function _(g,n,r){return(n=j(n))in g?Object.defineProperty(g,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):g[n]=r,g}function j(g){var n=R(g,"string");return typeof n=="symbol"?n:n+""}function R(g,n){if(typeof g!="object"||!g)return g;var r=g[Symbol.toPrimitive];if(r!==void 0){var t=r.call(g,n);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(g)}const C="react-grid-layout";function L(g){var n;return n=class extends e.Component{constructor(){super(...arguments),_(this,"state",{width:1280}),_(this,"elementRef",e.createRef()),_(this,"mounted",!1),_(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new a.default(i=>{if(this.elementRef.current instanceof HTMLElement){const o=i[0].contentRect.width;this.setState({width:o})}});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:i}=t,l=S(t,x);return i&&!this.mounted?e.createElement("div",{className:(0,u.default)(this.props.className,C),style:this.props.style,ref:this.elementRef}):e.createElement(g,w({innerRef:this.elementRef},l,this.state))}},_(n,"defaultProps",{measureBeforeMount:!1}),_(n,"propTypes",{measureBeforeMount:c.default.bool}),n}return et}var Pr;function vn(){return Pr||(Pr=1,(function(e){e.exports=yr().default,e.exports.utils=Ne(),e.exports.calculateUtils=dt(),e.exports.Responsive=Kr().default,e.exports.Responsive.utils=br(),e.exports.WidthProvider=yn().default})(lt)),lt.exports}var Cr=vn();const bn=Cr.WidthProvider(Cr.Responsive),xn=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],Rt=({schema:e,className:c,onLayoutChange:a,persistLayoutKey:u="dashboard-layout"})=>{const[x,p]=Te.useState(!1),[m,w]=Te.useState(()=>{if(typeof window<"u"&&u){const R=localStorage.getItem(u);if(R)try{return JSON.parse(R)}catch(C){console.error("Failed to parse saved layout:",C)}}return{lg:e.widgets?.map((R,C)=>({i:R.id||`widget-${C}`,x:R.layout?.x||C%4*3,y:R.layout?.y||Math.floor(C/4)*4,w:R.layout?.w||3,h:R.layout?.h||4}))||[]}}),S=Te.useCallback((R,C)=>{w(C),a?.(R)},[a]),P=Te.useCallback(()=>{typeof window<"u"&&u&&localStorage.setItem(u,JSON.stringify(m)),p(!1)},[m,u]),_=Te.useCallback(()=>{const R={lg:e.widgets?.map((C,L)=>({i:C.id||`widget-${L}`,x:C.layout?.x||L%4*3,y:C.layout?.y||Math.floor(L/4)*4,w:C.layout?.w||3,h:C.layout?.h||4}))||[]};w(R),typeof window<"u"&&u&&localStorage.removeItem(u)},[e.widgets,u]),j=Te.useCallback(R=>{if(R.component)return R.component;const C=R.type;if(C==="bar"||C==="line"||C==="area"||C==="pie"||C==="donut"){const L=Array.isArray(R.data)?R.data:R.data?.items||[],g=R.options||{},n=g.xField||"name",r=g.yField||"value";return{type:"chart",chartType:C,data:L,xAxisKey:n,series:[{dataKey:r}],colors:xn,className:"h-full"}}return C==="table"?{type:"data-table",...R.options,data:R.data?.items||[],searchable:!1,pagination:!1,className:"border-0"}:R},[]);return s.jsxs("div",{className:A.cn("w-full",c),"data-testid":"grid-layout",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[s.jsx("h2",{className:"text-2xl font-bold",children:e.title||"Dashboard"}),s.jsx("div",{className:"flex gap-2",children:x?s.jsxs(s.Fragment,{children:[s.jsxs(A.Button,{onClick:P,size:"sm",variant:"default",children:[s.jsx(oe.Save,{className:"h-4 w-4 mr-2"}),"Save Layout"]}),s.jsxs(A.Button,{onClick:_,size:"sm",variant:"outline",children:[s.jsx(oe.X,{className:"h-4 w-4 mr-2"}),"Reset"]}),s.jsx(A.Button,{onClick:()=>p(!1),size:"sm",variant:"ghost",children:"Cancel"})]}):s.jsxs(A.Button,{onClick:()=>p(!0),size:"sm",variant:"outline",children:[s.jsx(oe.Edit,{className:"h-4 w-4 mr-2"}),"Edit Layout"]})})]}),s.jsx(bn,{className:"layout",layouts:m,breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},rowHeight:60,isDraggable:x,isResizable:x,onLayoutChange:S,draggableHandle:".drag-handle",children:e.widgets?.map((R,C)=>{const L=R.id||`widget-${C}`,g=j(R),n=R.type==="metric";return s.jsx("div",{className:"h-full",children:n?s.jsxs("div",{className:"h-full w-full relative",children:[x&&s.jsx("div",{className:"drag-handle absolute top-2 right-2 z-10 cursor-move p-1 bg-background/80 rounded border border-border",children:s.jsx(oe.GripVertical,{className:"h-4 w-4"})}),s.jsx(De.SchemaRenderer,{schema:g,className:"h-full w-full"})]}):s.jsxs(A.Card,{className:A.cn("h-full overflow-hidden border-border/50 shadow-sm transition-all","bg-card/50 backdrop-blur-sm",x&&"ring-2 ring-primary/20"),children:[R.title&&s.jsxs(A.CardHeader,{className:"pb-2 border-b border-border/40 bg-muted/20 flex flex-row items-center justify-between",children:[s.jsx(A.CardTitle,{className:"text-base font-medium tracking-tight truncate",title:R.title,children:R.title}),x&&s.jsx("div",{className:"drag-handle cursor-move p-1 hover:bg-muted/40 rounded",children:s.jsx(oe.GripVertical,{className:"h-4 w-4"})})]}),s.jsx(A.CardContent,{className:"p-0 h-full",children:s.jsx("div",{className:A.cn("h-full w-full overflow-auto",(R.title,"p-4")),children:s.jsx(De.SchemaRenderer,{schema:g})})})]})},L)})})]})},St=({label:e,value:c,trend:a,icon:u,className:x,description:p,...m})=>{const w=me.useMemo(()=>{if(typeof u=="string"){const S=Dt[u];return S?s.jsx(S,{className:"h-4 w-4 text-muted-foreground"}):null}return u},[u]);return s.jsxs(A.Card,{className:A.cn("h-full",x),...m,children:[s.jsxs(A.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(A.CardTitle,{className:"text-sm font-medium",children:e}),w&&s.jsx("div",{className:"h-4 w-4 text-muted-foreground",children:w})]}),s.jsxs(A.CardContent,{children:[s.jsx("div",{className:"text-2xl font-bold",children:c}),(a||p)&&s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center mt-1",children:[a&&s.jsxs("span",{className:A.cn("flex items-center mr-2",a.direction==="up"&&"text-green-500",a.direction==="down"&&"text-red-500",a.direction==="neutral"&&"text-yellow-500"),children:[a.direction==="up"&&s.jsx(oe.ArrowUpIcon,{className:"h-3 w-3 mr-1"}),a.direction==="down"&&s.jsx(oe.ArrowDownIcon,{className:"h-3 w-3 mr-1"}),a.direction==="neutral"&&s.jsx(oe.MinusIcon,{className:"h-3 w-3 mr-1"}),a.value,"%"]}),p||a?.label]})]})]})},Ot=({title:e,value:c,icon:a,trend:u,trendValue:x,description:p,className:m,...w})=>{const S=a&&Dt[a];return s.jsxs(A.Card,{className:A.cn("h-full",m),...w,children:[s.jsxs(A.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(A.CardTitle,{className:"text-sm font-medium",children:e}),S&&s.jsx(S,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(A.CardContent,{children:[s.jsx("div",{className:"text-2xl font-bold",children:c}),(u||x||p)&&s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center mt-1",children:[u&&x&&s.jsxs("span",{className:A.cn("flex items-center mr-2",u==="up"&&"text-green-500",u==="down"&&"text-red-500",u==="neutral"&&"text-yellow-500"),children:[u==="up"&&s.jsx(oe.ArrowUpIcon,{className:"h-3 w-3 mr-1"}),u==="down"&&s.jsx(oe.ArrowDownIcon,{className:"h-3 w-3 mr-1"}),u==="neutral"&&s.jsx(oe.MinusIcon,{className:"h-3 w-3 mr-1"}),x]}),p]})]})]})},_t=({schema:e})=>{const{title:c,description:a,data:u,columns:x}=e,p=e.chart?.type||"chart",m=!!e.chart,S=!(process.env.NODE_ENV==="test");return s.jsxs(A.Card,{className:`h-full flex flex-col ${e.className||""}`,children:[s.jsxs(A.CardHeader,{children:[c&&s.jsx(A.CardTitle,{children:c}),a&&s.jsx(A.CardDescription,{children:a})]}),s.jsxs(A.CardContent,{className:"flex-1 overflow-auto space-y-4",children:[m&&(()=>{const P=ve.ComponentRegistry.get(p);return P?s.jsx("div",{className:"min-h-[300px] border rounded-md p-4 bg-white/50",children:s.jsx(P,{schema:{...e.chart,data:u}})}):null})(),u&&u.length>0&&s.jsx("div",{className:"border rounded-md",children:(()=>{const P=S?ve.ComponentRegistry.get("aggrid")||ve.ComponentRegistry.get("table"):null;return P?s.jsx(P,{schema:{type:"aggrid",rowData:u,columnDefs:x,domLayout:"autoHeight"}}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm text-left",children:[s.jsx("thead",{className:"text-xs uppercase bg-gray-50",children:s.jsx("tr",{children:x?.map(_=>s.jsx("th",{className:"px-6 py-3",children:_.headerName||_.label||_.field},_.field))})}),s.jsx("tbody",{children:u.map((_,j)=>s.jsx("tr",{className:"bg-white border-b",children:x?.map(R=>s.jsx("td",{className:"px-6 py-4",children:_[R.field]},R.field))},j))})]})})})()})]})]})},at=({schema:e})=>{const{report:c,data:a,showToolbar:u=!0,allowExport:x=!0,allowPrint:p=!0,loading:m=!1}=e,w=_=>{console.log("Export report as:",_),alert(`Export to ${_.toUpperCase()} - Feature coming soon!`)},S=()=>{console.log("Print report"),window.print()},P=()=>{console.log("Refresh report")};return c?s.jsxs("div",{className:"space-y-4",children:[u&&s.jsxs("div",{className:"flex items-center justify-between gap-2 p-4 bg-card rounded-lg border",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold",children:c.title}),c.description&&s.jsx("p",{className:"text-sm text-muted-foreground",children:c.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[c.refreshInterval&&s.jsxs(A.Button,{variant:"outline",size:"sm",onClick:P,children:[s.jsx(oe.RefreshCw,{className:"h-4 w-4 mr-2"}),"Refresh"]}),p&&s.jsxs(A.Button,{variant:"outline",size:"sm",onClick:S,children:[s.jsx(oe.Printer,{className:"h-4 w-4 mr-2"}),"Print"]}),x&&c.showExportButtons&&s.jsx(s.Fragment,{children:s.jsxs(A.Button,{variant:"outline",size:"sm",onClick:()=>w(c.defaultExportFormat||"pdf"),children:[s.jsx(oe.Download,{className:"h-4 w-4 mr-2"}),"Export"]})})]})]}),s.jsxs(A.Card,{children:[s.jsxs(A.CardHeader,{children:[!u&&c.title&&s.jsx(A.CardTitle,{children:c.title}),!u&&c.description&&s.jsx(A.CardDescription,{children:c.description})]}),s.jsxs(A.CardContent,{className:"space-y-6",children:[m&&s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Loading report data..."}),!m&&c.sections?.map((_,j)=>_.visible===!1?null:s.jsxs("div",{className:"space-y-2",children:[_.title&&s.jsx("h3",{className:"text-lg font-semibold border-b pb-2",children:_.title}),_.type==="header"&&_.title&&s.jsx("div",{className:"text-2xl font-bold py-4",children:_.title}),_.type==="summary"&&s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:c.fields?.filter(R=>R.showInSummary).map((R,C)=>s.jsx(A.Card,{children:s.jsxs(A.CardContent,{className:"p-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:R.label||R.name}),s.jsxs("div",{className:"text-2xl font-bold",children:[R.aggregation==="count"&&a?.length,R.aggregation==="sum"&&a?.reduce((L,g)=>L+(g[R.name]||0),0)]})]})},C))}),_.type==="chart"&&_.chart&&s.jsx("div",{className:"min-h-[300px]",children:s.jsx(De.SchemaRenderer,{schema:{..._.chart,data:a||_.chart.data}})}),_.type==="table"&&s.jsx("div",{className:"border rounded-lg overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-muted",children:s.jsx("tr",{children:_.columns?.map((R,C)=>s.jsx("th",{className:"px-4 py-2 text-left font-medium",children:R.label||R.name},C))})}),s.jsx("tbody",{children:a?.map((R,C)=>s.jsx("tr",{className:"border-t",children:_.columns?.map((L,g)=>s.jsx("td",{className:"px-4 py-2",children:R[L.name]},g))},C))})]})}),_.type==="text"&&_.text&&s.jsx("div",{className:"prose max-w-none",children:s.jsx("p",{children:_.text})}),_.type==="page-break"&&s.jsx("div",{className:"border-t-2 border-dashed my-8 print:page-break-after-always"}),_.content&&s.jsx(De.SchemaRenderer,{schema:_.content})]},j)),!c.sections&&a&&a.length>0&&s.jsx("div",{className:"border rounded-lg overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-muted",children:s.jsx("tr",{children:c.fields?.map((_,j)=>s.jsx("th",{className:"px-4 py-2 text-left font-medium",children:_.label||_.name},j))})}),s.jsx("tbody",{children:a.map((_,j)=>s.jsx("tr",{className:"border-t",children:c.fields?.map((R,C)=>s.jsx("td",{className:"px-4 py-2",children:_[R.name]},C))},j))})]})})]})]})]}):s.jsx(A.Card,{children:s.jsx(A.CardContent,{className:"p-8 text-center text-muted-foreground",children:"No report to display"})})},Et=({schema:e})=>{const{report:c,dataSources:a=[],availableFields:u=[],showPreview:x=!0,onSave:p,onCancel:m}=e,[w,S]=me.useState(c||{type:"report",title:"New Report",fields:[],filters:[],groupBy:[],sections:[],showExportButtons:!0,showPrintButton:!0}),[P,_]=me.useState(w.fields||[]),[j,R]=me.useState(w.filters||[]),[C,L]=me.useState(w.groupBy||[]),[g,n]=me.useState(w.sections||[]),r=()=>{if(u.length>0&&P.length<u.length){const T=u.find(D=>!P.some(N=>N.name===D.name));if(T){const D=[...P,T];_(D),S({...w,fields:D})}}},t=T=>{const D=P.filter((N,K)=>K!==T);_(D),S({...w,fields:D})},i=(T,D)=>{const N=[...P];N[T]=D,_(N),S({...w,fields:N})},l=()=>{const T={field:u[0]?.name||"",operator:"equals",value:""},D=[...j,T];R(D),S({...w,filters:D})},o=T=>{const D=j.filter((N,K)=>K!==T);R(D),S({...w,filters:D})},y=(T,D)=>{const N=[...j];N[T]=D,R(N),S({...w,filters:N})},d=()=>{const T={field:u[0]?.name||"",sort:"asc"},D=[...C,T];L(D),S({...w,groupBy:D})},f=T=>{const D=C.filter((N,K)=>K!==T);L(D),S({...w,groupBy:D})},O=(T,D)=>{const N=[...C];N[T]=D,L(N),S({...w,groupBy:N})},z=T=>{const D={type:T,title:`New ${T} Section`},N=[...g,D];n(N),S({...w,sections:N})},I=T=>{const D=g.filter((N,K)=>K!==T);n(D),S({...w,sections:D})},G=(T,D)=>{const N=[...g];N[T]=D,n(N),S({...w,sections:N})},B=()=>{console.log("Saving report:",w),p&&alert("Report saved! (Handler: "+p+")")},V=()=>{console.log("Canceling report builder")};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs(A.Card,{children:[s.jsxs(A.CardHeader,{children:[s.jsx(A.CardTitle,{children:"Report Builder"}),s.jsx(A.CardDescription,{children:"Configure your report settings, fields, filters, and sections"})]}),s.jsxs(A.CardContent,{children:[s.jsxs(A.Tabs,{defaultValue:"basic",className:"w-full",children:[s.jsxs(A.TabsList,{className:"grid w-full grid-cols-5",children:[s.jsxs(A.TabsTrigger,{value:"basic",children:[s.jsx(oe.Settings,{className:"h-4 w-4 mr-2"}),"Basic"]}),s.jsxs(A.TabsTrigger,{value:"fields",children:[s.jsx(oe.Layers,{className:"h-4 w-4 mr-2"}),"Fields"]}),s.jsxs(A.TabsTrigger,{value:"filters",children:[s.jsx(oe.Filter,{className:"h-4 w-4 mr-2"}),"Filters"]}),s.jsxs(A.TabsTrigger,{value:"grouping",children:[s.jsx(oe.Layers,{className:"h-4 w-4 mr-2"}),"Group By"]}),s.jsxs(A.TabsTrigger,{value:"sections",children:[s.jsx(oe.Layers,{className:"h-4 w-4 mr-2"}),"Sections"]})]}),s.jsx(A.TabsContent,{value:"basic",className:"space-y-4 mt-4",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(A.Label,{htmlFor:"report-title",children:"Report Title"}),s.jsx(A.Input,{id:"report-title",value:w.title||"",onChange:T=>S({...w,title:T.target.value}),placeholder:"Enter report title"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(A.Label,{htmlFor:"report-description",children:"Description"}),s.jsx(A.Input,{id:"report-description",value:w.description||"",onChange:T=>S({...w,description:T.target.value}),placeholder:"Enter report description"})]}),a.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(A.Label,{children:"Data Source"}),s.jsxs("select",{className:"w-full border rounded-md p-2",children:[s.jsx("option",{value:"",children:"Select a data source"}),a.map((T,D)=>s.jsxs("option",{value:D,children:["Data Source ",D+1]},D))]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(A.Label,{children:"Export Options"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",checked:w.showExportButtons||!1,onChange:T=>S({...w,showExportButtons:T.target.checked})}),s.jsx("span",{className:"text-sm",children:"Show Export Buttons"})]}),s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",checked:w.showPrintButton||!1,onChange:T=>S({...w,showPrintButton:T.target.checked})}),s.jsx("span",{className:"text-sm",children:"Show Print Button"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(A.Label,{htmlFor:"export-format",children:"Default Export Format"}),s.jsxs("select",{id:"export-format",className:"w-full border rounded-md p-2",value:w.defaultExportFormat||"pdf",onChange:T=>S({...w,defaultExportFormat:T.target.value}),children:[s.jsx("option",{value:"pdf",children:"PDF"}),s.jsx("option",{value:"excel",children:"Excel"}),s.jsx("option",{value:"csv",children:"CSV"}),s.jsx("option",{value:"json",children:"JSON"}),s.jsx("option",{value:"html",children:"HTML"})]})]})]})}),s.jsxs(A.TabsContent,{value:"fields",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(A.Label,{children:"Report Fields"}),s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:r,disabled:P.length>=u.length,children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Add Field"]})]}),s.jsxs("div",{className:"space-y-2",children:[P.map((T,D)=>s.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-4 gap-2",children:[s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Field Name"}),s.jsx("div",{className:"text-sm font-medium",children:T.name})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Label"}),s.jsx(A.Input,{className:"h-8 text-sm",value:T.label||T.name,onChange:N=>i(D,{...T,label:N.target.value})})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Aggregation"}),s.jsxs("select",{className:"w-full border rounded p-1 text-sm h-8",value:T.aggregation||"",onChange:N=>i(D,{...T,aggregation:N.target.value}),children:[s.jsx("option",{value:"",children:"None"}),s.jsx("option",{value:"sum",children:"Sum"}),s.jsx("option",{value:"avg",children:"Average"}),s.jsx("option",{value:"min",children:"Min"}),s.jsx("option",{value:"max",children:"Max"}),s.jsx("option",{value:"count",children:"Count"}),s.jsx("option",{value:"distinct",children:"Distinct"})]})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Show in Summary"}),s.jsx("input",{type:"checkbox",checked:T.showInSummary||!1,onChange:N=>i(D,{...T,showInSummary:N.target.checked}),className:"mt-2"})]})]}),s.jsx(A.Button,{size:"sm",variant:"ghost",onClick:()=>t(D),children:s.jsx(oe.Trash2,{className:"h-4 w-4 text-destructive"})})]},D)),P.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground border rounded-lg border-dashed",children:'No fields selected. Click "Add Field" to get started.'})]})]}),s.jsxs(A.TabsContent,{value:"filters",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(A.Label,{children:"Report Filters"}),s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:l,disabled:u.length===0,children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Add Filter"]})]}),s.jsxs("div",{className:"space-y-2",children:[j.map((T,D)=>s.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Field"}),s.jsx("select",{className:"w-full border rounded p-1 text-sm h-8",value:T.field,onChange:N=>y(D,{...T,field:N.target.value}),children:u.map(N=>s.jsx("option",{value:N.name,children:N.label||N.name},N.name))})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Operator"}),s.jsxs("select",{className:"w-full border rounded p-1 text-sm h-8",value:T.operator,onChange:N=>y(D,{...T,operator:N.target.value}),children:[s.jsx("option",{value:"equals",children:"Equals"}),s.jsx("option",{value:"not_equals",children:"Not Equals"}),s.jsx("option",{value:"contains",children:"Contains"}),s.jsx("option",{value:"greater_than",children:"Greater Than"}),s.jsx("option",{value:"less_than",children:"Less Than"}),s.jsx("option",{value:"between",children:"Between"}),s.jsx("option",{value:"in",children:"In"}),s.jsx("option",{value:"not_in",children:"Not In"})]})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Value"}),s.jsx(A.Input,{className:"h-8 text-sm",value:T.value||"",onChange:N=>y(D,{...T,value:N.target.value}),placeholder:"Enter value"})]})]}),s.jsx(A.Button,{size:"sm",variant:"ghost",onClick:()=>o(D),children:s.jsx(oe.Trash2,{className:"h-4 w-4 text-destructive"})})]},D)),j.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground border rounded-lg border-dashed",children:'No filters defined. Click "Add Filter" to filter your report data.'})]})]}),s.jsxs(A.TabsContent,{value:"grouping",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(A.Label,{children:"Group By Fields"}),s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:d,disabled:u.length===0,children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Add Group"]})]}),s.jsxs("div",{className:"space-y-2",children:[C.map((T,D)=>s.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[s.jsxs("div",{className:"flex-1 grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Field"}),s.jsx("select",{className:"w-full border rounded p-1 text-sm h-8",value:T.field,onChange:N=>O(D,{...T,field:N.target.value}),children:u.map(N=>s.jsx("option",{value:N.name,children:N.label||N.name},N.name))})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Label"}),s.jsx(A.Input,{className:"h-8 text-sm",value:T.label||"",onChange:N=>O(D,{...T,label:N.target.value}),placeholder:"Optional label"})]}),s.jsxs("div",{children:[s.jsx(A.Label,{className:"text-xs",children:"Sort"}),s.jsxs("select",{className:"w-full border rounded p-1 text-sm h-8",value:T.sort||"asc",onChange:N=>O(D,{...T,sort:N.target.value}),children:[s.jsx("option",{value:"asc",children:"Ascending"}),s.jsx("option",{value:"desc",children:"Descending"})]})]})]}),s.jsx(A.Button,{size:"sm",variant:"ghost",onClick:()=>f(D),children:s.jsx(oe.Trash2,{className:"h-4 w-4 text-destructive"})})]},D)),C.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground border rounded-lg border-dashed",children:'No grouping defined. Click "Add Group" to group your report data.'})]})]}),s.jsxs(A.TabsContent,{value:"sections",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(A.Label,{children:"Report Sections"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:()=>z("header"),children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Header"]}),s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:()=>z("summary"),children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Summary"]}),s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:()=>z("chart"),children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Chart"]}),s.jsxs(A.Button,{size:"sm",variant:"outline",onClick:()=>z("table"),children:[s.jsx(oe.Plus,{className:"h-4 w-4 mr-2"}),"Table"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[g.map((T,D)=>s.jsxs("div",{className:"flex items-center gap-2 p-3 border rounded-lg",children:[s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase",children:T.type}),s.jsx(A.Input,{className:"h-8 text-sm",value:T.title||"",onChange:N=>G(D,{...T,title:N.target.value}),placeholder:"Section title"})]}),T.type==="text"&&s.jsx(A.Input,{className:"h-8 text-sm",value:T.text||"",onChange:N=>G(D,{...T,text:N.target.value}),placeholder:"Text content"})]}),s.jsx(A.Button,{size:"sm",variant:"ghost",onClick:()=>I(D),children:s.jsx(oe.Trash2,{className:"h-4 w-4 text-destructive"})})]},D)),g.length===0&&s.jsx("div",{className:"text-center py-8 text-muted-foreground border rounded-lg border-dashed",children:"No sections defined. Click section buttons above to add report sections."})]})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-4 mt-6 border-t",children:[s.jsxs(A.Button,{variant:"outline",onClick:V,children:[s.jsx(oe.X,{className:"h-4 w-4 mr-2"}),"Cancel"]}),s.jsxs(A.Button,{onClick:B,children:[s.jsx(oe.Save,{className:"h-4 w-4 mr-2"}),"Save Report"]})]})]})]}),x&&s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Preview"}),s.jsx(at,{schema:{type:"report-viewer",report:w,data:[],showToolbar:!1,allowExport:!1,allowPrint:!1}})]})]})};ve.ComponentRegistry.register("dashboard",st,{namespace:"plugin-dashboard",label:"Dashboard",category:"Complex",icon:"layout-dashboard",inputs:[{name:"columns",type:"number",label:"Columns",defaultValue:3},{name:"gap",type:"number",label:"Gap",defaultValue:4},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:3,widgets:[]}}),ve.ComponentRegistry.register("metric",St,{namespace:"plugin-dashboard",label:"Metric Widget",category:"Dashboard",inputs:[{name:"label",type:"string",label:"Label"},{name:"value",type:"string",label:"Value"}]}),ve.ComponentRegistry.register("metric-card",Ot,{namespace:"plugin-dashboard",label:"Metric Card",category:"Dashboard",inputs:[{name:"title",type:"string",label:"Title"},{name:"value",type:"string",label:"Value",required:!0},{name:"icon",type:"string",label:"Icon (Lucide name)"},{name:"trend",type:"enum",label:"Trend",enum:[{label:"Up",value:"up"},{label:"Down",value:"down"},{label:"Neutral",value:"neutral"}]},{name:"trendValue",type:"string",label:"Trend Value (e.g., +12%)"},{name:"description",type:"string",label:"Description"}],defaultProps:{title:"Metric",value:"0"}}),ve.ComponentRegistry.register("report",_t,{namespace:"plugin-dashboard",label:"Report",category:"Dashboard",inputs:[{name:"title",type:"string",label:"Title"},{name:"description",type:"string",label:"Description"},{name:"chart",type:"code",label:"Chart Configuration"}]}),ve.ComponentRegistry.register("report-viewer",at,{namespace:"plugin-dashboard",label:"Report Viewer",category:"Reports",inputs:[{name:"report",type:"code",label:"Report Configuration",required:!0},{name:"data",type:"code",label:"Report Data"},{name:"showToolbar",type:"boolean",label:"Show Toolbar",defaultValue:!0},{name:"allowExport",type:"boolean",label:"Allow Export",defaultValue:!0},{name:"allowPrint",type:"boolean",label:"Allow Print",defaultValue:!0}]}),ve.ComponentRegistry.register("report-builder",Et,{namespace:"plugin-dashboard",label:"Report Builder",category:"Reports",inputs:[{name:"report",type:"code",label:"Initial Report Config"},{name:"dataSources",type:"code",label:"Available Data Sources"},{name:"availableFields",type:"code",label:"Available Fields"},{name:"showPreview",type:"boolean",label:"Show Preview",defaultValue:!0}]}),ve.ComponentRegistry.register("dashboard-grid",Rt,{namespace:"plugin-dashboard",label:"Dashboard Grid (Editable)",category:"Complex",icon:"layout-grid",inputs:[{name:"title",type:"string",label:"Title"},{name:"persistLayoutKey",type:"string",label:"Layout Storage Key",defaultValue:"dashboard-layout"},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{title:"Dashboard",widgets:[],persistLayoutKey:"dashboard-layout"}});const wn={DashboardRenderer:st,DashboardGridLayout:Rt,MetricWidget:St,MetricCard:Ot,ReportRenderer:_t,ReportViewer:at,ReportBuilder:Et};he.DashboardGridLayout=Rt,he.DashboardRenderer=st,he.MetricCard=Ot,he.MetricWidget=St,he.ReportBuilder=Et,he.ReportRenderer=_t,he.ReportViewer=at,he.dashboardComponents=wn,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
<%s key={someKey} {...props} />`,M,T,W,T),P[T+M]=!0)}if(T=null,k!==void 0&&(r(k),T=""+k),l(j)&&(r(j.key),T=""+j.key),"key"in j){k={};for(var N in j)N!=="key"&&(k[N]=j[N])}else k=j;return T&&u(k,typeof f=="function"?f.displayName||f.name||"Unknown":f),v(f,T,k,o(),X,I)}function p(f){w(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===R&&(f._payload.status==="fulfilled"?w(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function w(f){return typeof f=="object"&&f!==null&&f.$$typeof===_}var O=C,_=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),S=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),V=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,$=Array.isArray,K=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(f){return f()}};var U,J={},le=O.react_stack_bottom_frame.bind(O,i)(),me=K(n(i)),P={};ct.Fragment=a,ct.jsx=function(f,j,k){var M=1e4>V.recentlyCreatedOwnerStacks++;return m(f,j,k,!1,M?Error("react-stack-top-frame"):le,M?K(n(f)):me)},ct.jsxs=function(f,j,k){var M=1e4>V.recentlyCreatedOwnerStacks++;return m(f,j,k,!0,M?Error("react-stack-top-frame"):le,M?K(n(f)):me)}})()),ct}var _r;function In(){return _r||(_r=1,process.env.NODE_ENV==="production"?St.exports=Nn():St.exports=An()),St.exports}var z=In();const Ln=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],Vt=C.forwardRef(({schema:e,className:t,dataSource:r,...n},o)=>{const i=e.columns||4,l=e.gap||4;return z.jsx("div",{ref:o,className:Q.cn("grid auto-rows-min",t),style:{gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`,gap:`${l*.25}rem`},...n,children:e.widgets?.map(u=>{const v=(()=>{if(u.component)return u.component;const p=u.type;if(p==="bar"||p==="line"||p==="area"||p==="pie"||p==="donut"){const w=Array.isArray(u.data)?u.data:u.data?.items||[],O=u.options||{},_=O.xField||"name",c=O.yField||"value";return{type:"chart",chartType:p,data:w,xAxisKey:_,series:[{dataKey:c}],colors:Ln,className:"h-[300px]"}}return p==="table"?{type:"data-table",...u.options,data:u.data?.items||[],searchable:!1,pagination:!1,className:"border-0"}:{...u,...u.options||{}}})();return u.type==="metric"?z.jsx("div",{className:"h-full w-full",style:u.layout?{gridColumn:`span ${u.layout.w}`,gridRow:`span ${u.layout.h}`}:void 0,children:z.jsx(wt.SchemaRenderer,{schema:v,className:"h-full w-full"})},u.id||u.title):z.jsxs(Q.Card,{className:Q.cn("overflow-hidden border-border/50 shadow-sm transition-all hover:shadow-md","bg-card/50 backdrop-blur-sm"),style:u.layout?{gridColumn:`span ${u.layout.w}`,gridRow:`span ${u.layout.h}`}:void 0,children:[u.title&&z.jsx(Q.CardHeader,{className:"pb-2 border-b border-border/40 bg-muted/20",children:z.jsx(Q.CardTitle,{className:"text-base font-medium tracking-tight truncate",title:u.title,children:u.title})}),z.jsx(Q.CardContent,{className:"p-0",children:z.jsx("div",{className:Q.cn("h-full w-full",(u.title,"p-4")),children:z.jsx(wt.SchemaRenderer,{schema:v})})})]},u.id||u.title)})})});function rt(e){const{margin:t,containerPadding:r,containerWidth:n,cols:o}=e;return(n-t[0]*(o-1)-r[0]*2)/o}function nt(e,t,r){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*r):e}function ft(e,t,r,n,o,i,l){const{margin:u,containerPadding:d,rowHeight:v}=e,m=rt(e);let p,w,O,_;if(l?(p=Math.round(l.width),w=Math.round(l.height)):(p=nt(n,m,u[0]),w=nt(o,v,u[1])),i?(O=Math.round(i.top),_=Math.round(i.left)):l?(O=Math.round(l.top),_=Math.round(l.left)):(O=Math.round((v+u[1])*r+d[1]),_=Math.round((m+u[0])*t+d[0])),!i&&!l){if(Number.isFinite(n)){const a=Math.round((m+u[0])*(t+n)+d[0])-_-p;a!==u[0]&&(p+=a-u[0])}if(Number.isFinite(o)){const a=Math.round((v+u[1])*(r+o)+d[1])-O-w;a!==u[1]&&(w+=a-u[1])}}return{top:O,left:_,width:p,height:w}}function Wn(e,t,r,n,o){const{margin:i,containerPadding:l,cols:u,rowHeight:d,maxRows:v}=e,m=rt(e);let p=Math.round((r-l[0])/(m+i[0])),w=Math.round((t-l[1])/(d+i[1]));return p=Et(p,0,u-n),w=Et(w,0,v-o),{x:p,y:w}}function Ct(e,t,r){const{margin:n,containerPadding:o,rowHeight:i}=e,l=rt(e),u=Math.round((r-o[0])/(l+n[0])),d=Math.round((t-o[1])/(i+n[1]));return{x:u,y:d}}function qn(e,t,r){const{margin:n,rowHeight:o}=e,i=rt(e),l=Math.max(1,Math.round((t+n[0])/(i+n[0]))),u=Math.max(1,Math.round((r+n[1])/(o+n[1])));return{w:l,h:u}}function Et(e,t,r){return Math.max(Math.min(e,r),t)}function Jt(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Ke(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n!==void 0&&Jt(n,t))return n}}function Dr(e,t){return e.filter(r=>Jt(r,t))}function Hn(e,t){return t==="horizontal"?jr(e):t==="vertical"||t==="wrap"?Kt(e):[...e]}function Kt(e){return[...e].sort((t,r)=>t.y!==r.y?t.y-r.y:t.x-r.x)}function jr(e){return[...e].sort((t,r)=>t.x!==r.x?t.x-r.x:t.y-r.y)}function Pt(e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];if(n!==void 0){const o=n.y+n.h;o>t&&(t=o)}}return t}function Ze(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n!==void 0&&n.i===t)return n}}function Ot(e){return e.filter(t=>t.static===!0)}function Qe(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function $e(e){const t=new Array(e.length);for(let r=0;r<e.length;r++){const n=e[r];n!==void 0&&(t[r]=Qe(n))}return t}function Yn(e,t){const r=new Array(e.length);for(let n=0;n<e.length;n++){const o=e[n];o!==void 0&&(t.i===o.i?r[n]=t:r[n]=o)}return r}function $n(e,t,r){let n=Ze(e,t);return n?(n=r(Qe(n)),[Yn(e,n),n]):[[...e],null]}function Zt(e,t){const r=Ot(e);for(let n=0;n<e.length;n++){const o=e[n];if(o!==void 0)if(o.x+o.w>t.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),!o.static)r.push(o);else for(;Ke(r,o);)o.y++}return e}function et(e,t,r,n,o,i,l,u,d){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===n&&t.x===r)return[...e];const v=t.x,m=t.y;typeof r=="number"&&(t.x=r),typeof n=="number"&&(t.y=n),t.moved=!0;let p=Hn(e,l);(l==="vertical"&&typeof n=="number"?m>=n:l==="horizontal"&&typeof r=="number"&&v>=r)&&(p=p.reverse());const O=Dr(p,t),_=O.length>0;if(_&&d)return $e(e);if(_&&i)return t.x=v,t.y=m,t.moved=!1,e;let c=[...e];for(let a=0;a<O.length;a++){const s=O[a];s!==void 0&&(s.moved||(s.static?c=Tr(c,s,t,o,l):c=Tr(c,t,s,o,l)))}return c}function Tr(e,t,r,n,o,i){const l=o==="horizontal",u=o==="vertical",d=t.static;if(n){n=!1;const p={x:l?Math.max(t.x-r.w,0):r.x,y:u?Math.max(t.y-r.h,0):r.y,w:r.w,h:r.h,i:"-1"},w=Ke(e,p),O=w!==void 0&&w.y+w.h>t.y,_=w!==void 0&&t.x+t.w>w.x;if(!w)return et(e,r,l?p.x:void 0,u?p.y:void 0,n,d,o);if(O&&u)return et(e,r,void 0,r.y+1,n,d,o);if(O&&o===null)return t.y=r.y,r.y=r.y+r.h,[...e];if(_&&l)return et(e,t,r.x,void 0,n,d,o)}const v=l?r.x+1:void 0,m=u?r.y+1:void 0;return v===void 0&&m===void 0?[...e]:et(e,r,v,m,n,d,o)}function ot(e,t,r){return Math.max(t,Math.min(r,e))}var Bn={name:"gridBounds",constrainPosition(e,t,r,{cols:n,maxRows:o}){return{x:ot(t,0,Math.max(0,n-e.w)),y:ot(r,0,Math.max(0,o-e.h))}},constrainSize(e,t,r,n,{cols:o,maxRows:i}){const l=n==="w"||n==="nw"||n==="sw"?e.x+e.w:o-e.x,u=n==="n"||n==="nw"||n==="ne"?e.y+e.h:i-e.y;return{w:ot(t,1,Math.max(1,l)),h:ot(r,1,Math.max(1,u))}}},Fn={name:"minMaxSize",constrainSize(e,t,r){return{w:ot(t,e.minW??1,e.maxW??1/0),h:ot(r,e.minH??1,e.maxH??1/0)}}},Mr=[Bn,Fn];function Rt(e,t,r,n,o){let i={x:r,y:n};for(const l of e)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,o));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(i=l.constrainPosition(t,i.x,i.y,o));return i}function Xn(e,t,r,n,o,i){let l={w:r,h:n};for(const u of e)u.constrainSize&&(l=u.constrainSize(t,l.w,l.h,o,i));if(t.constraints)for(const u of t.constraints)u.constrainSize&&(l=u.constrainSize(t,l.w,l.h,o,i));return l}function zr({top:e,left:t,width:r,height:n}){const o=`translate(${t}px,${e}px)`;return{transform:o,WebkitTransform:o,MozTransform:o,msTransform:o,OTransform:o,width:`${r}px`,height:`${n}px`,position:"absolute"}}function Un({top:e,left:t,width:r,height:n}){return{top:`${e}px`,left:`${t}px`,width:`${r}px`,height:`${n}px`,position:"absolute"}}function kr(e){return e*100+"%"}function Gn(e,t,r,n){return e+r>n?t:r}function Nr(e,t,r){return e<0?t:r}function Vn(e){return Math.max(0,e)}function _t(e){return Math.max(0,e)}var Qt=(e,t,r)=>{const{left:n,height:o,width:i}=t,l=e.top-(o-e.height);return{left:n,width:i,height:Nr(l,e.height,o),top:_t(l)}},er=(e,t,r)=>{const{top:n,left:o,height:i,width:l}=t;return{top:n,height:i,width:Gn(e.left,e.width,l,r),left:Vn(o)}},tr=(e,t,r)=>{const{top:n,height:o,width:i}=t,l=e.left+e.width-i;return l<0?{height:o,width:e.left+e.width,top:_t(n),left:0}:{height:o,width:i,top:_t(n),left:l}},rr=(e,t,r)=>{const{top:n,left:o,height:i,width:l}=t;return{width:l,left:o,height:Nr(n,e.height,i),top:_t(n)}},Jn=(e,t,r)=>Qt(e,er(e,t,r)),Kn=(e,t,r)=>Qt(e,tr(e,t)),Zn=(e,t,r)=>rr(e,er(e,t,r)),Qn=(e,t,r)=>rr(e,tr(e,t)),eo={n:Qt,ne:Jn,e:er,se:Zn,s:rr,sw:Qn,w:tr,nw:Kn};function to(e,t,r,n){const o=eo[e];return o?o(t,{...t,...r},n):r}var ro={type:"transform",scale:1,calcStyle(e){return zr(e)}},no=ro,oo={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},ao={enabled:!0,bounded:!1,threshold:3},so={enabled:!0,handles:["se"]},io={enabled:!1,defaultItem:{w:1,h:1}};function nr(e,t,r,n,o){const i=n==="x"?"w":"h";t[n]+=1;const l=e.findIndex(d=>d.i===t.i),u=o??Ot(e).length>0;for(let d=l+1;d<e.length;d++){const v=e[d];if(v!==void 0&&!v.static){if(!u&&v.y>t.y+t.h)break;Jt(t,v)&&nr(e,v,r+t[i],n,u)}}t[n]=r}function lo(e,t,r,n){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(n,t.y);t.y>0&&!Ke(e,t);)t.y--;let o;for(;(o=Ke(e,t))!==void 0;)nr(r,t,o.y+o.h,"y");return t.y=Math.max(t.y,0),t}function uo(e,t,r,n){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Ke(e,t);)t.x--;let o;for(;(o=Ke(e,t))!==void 0;)if(nr(n,t,o.x+o.w,"x"),t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Ke(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Ar={type:"vertical",allowOverlap:!1,compact(e,t){const r=Ot(e);let n=Pt(r);const o=Kt(e),i=new Array(e.length);for(let l=0;l<o.length;l++){const u=o[l];if(u===void 0)continue;let d=Qe(u);d.static||(d=lo(r,d,o,n),n=Math.max(n,d.y+d.h),r.push(d));const v=e.indexOf(u);i[v]=d,d.moved=!1}return i}},Ir={type:"horizontal",allowOverlap:!1,compact(e,t){const r=Ot(e),n=jr(e),o=new Array(e.length);for(let i=0;i<n.length;i++){const l=n[i];if(l===void 0)continue;let u=Qe(l);u.static||(u=uo(r,u,t,n),r.push(u));const d=e.indexOf(l);o[d]=u,u.moved=!1}return o}},Lr={type:null,allowOverlap:!1,compact(e,t){return $e(e)}},co={...Ar,allowOverlap:!0,compact(e,t){return $e(e)}},fo={...Ir,allowOverlap:!0,compact(e,t){return $e(e)}},po={...Lr,allowOverlap:!0};function or(e,t=!1,r=!1){let n;return t?e==="vertical"?n=co:e==="horizontal"?n=fo:n=po:e==="vertical"?n=Ar:e==="horizontal"?n=Ir:n=Lr,r?{...n,preventCollision:r}:n}function Wr(e){return Object.keys(e).sort((r,n)=>e[r]-e[n])}function qr(e,t){const r=Wr(e);let n=r[0];if(n===void 0)throw new Error("No breakpoints defined");for(let o=1;o<r.length;o++){const i=r[o];if(i===void 0)continue;const l=e[i];t>l&&(n=i)}return n}function Hr(e,t){const r=t[e];if(r===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return r}function ar(e,t,r,n,o,i){const l=e[r];if(l)return $e(l);let u=e[n];const d=Wr(t),v=d.slice(d.indexOf(r));for(let O=0;O<v.length;O++){const _=v[O];if(_===void 0)continue;const c=e[_];if(c){u=c;break}}const m=$e(u||[]),p=Zt(m,{cols:o});return(typeof i=="object"&&i!==null?i:or(i)).compact(p,o)}function Dt(e,t){if(Array.isArray(e))return e;const r=e,n=r[t];if(n!==void 0)return n;const o=Object.keys(r);for(const i of o){const l=r[i];if(l!==void 0)return l}return[10,10]}function Yr(e){return function(r,n,o,i,l,u,d){return e(r,n,d)}}function jt(e){return function(r,n,o,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o,i);var l=i.get(r),u=i.get(n);if(l&&u)return l===n&&u===r;i.set(r,n),i.set(n,r);var d=e(r,n,o,i);return i.delete(r),i.delete(n),d}}function $r(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r}function Br(e){return e.constructor===Object||e.constructor==null}function Fr(e){return typeof e.then=="function"}function Tt(e,t){return e===t||e!==e&&t!==t}var ho="[object Arguments]",go="[object Boolean]",mo="[object Date]",yo="[object RegExp]",vo="[object Map]",bo="[object Number]",xo="[object Object]",wo="[object Set]",So="[object String]",Xr=Object.prototype.toString;function Mt(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,o=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,u=e.createIsNestedEqual,d=u(v);function v(m,p,w){if(m===p)return!0;if(!m||!p||typeof m!="object"||typeof p!="object")return m!==m&&p!==p;if(Br(m)&&Br(p))return o(m,p,d,w);var O=Array.isArray(m),_=Array.isArray(p);if(O||_)return O===_&&t(m,p,d,w);var c=Xr.call(m);return c!==Xr.call(p)?!1:c===mo?r(m,p,d,w):c===yo?i(m,p,d,w):c===vo?n(m,p,d,w):c===wo?l(m,p,d,w):c===xo||c===ho?Fr(m)||Fr(p)?!1:o(m,p,d,w):c===go||c===bo||c===So?Tt(m.valueOf(),p.valueOf()):!1}return v}function Ur(e,t,r,n){var o=e.length;if(t.length!==o)return!1;for(;o-- >0;)if(!r(e[o],t[o],o,o,e,t,n))return!1;return!0}var Co=jt(Ur);function Gr(e,t){return Tt(e.valueOf(),t.valueOf())}function Vr(e,t,r,n){var o=e.size===t.size;if(!o)return!1;if(!e.size)return!0;var i={},l=0;return e.forEach(function(u,d){if(o){var v=!1,m=0;t.forEach(function(p,w){!v&&!i[m]&&(v=r(d,w,l,m,e,t,n)&&r(u,p,d,w,e,t,n))&&(i[m]=!0),m++}),l++,o=v}}),o}var Eo=jt(Vr),Po="_owner",Oo=Object.prototype.hasOwnProperty;function Jr(e,t,r,n){var o=Object.keys(e),i=o.length;if(Object.keys(t).length!==i)return!1;for(var l;i-- >0;){if(l=o[i],l===Po){var u=!!e.$$typeof,d=!!t.$$typeof;if((u||d)&&u!==d)return!1}if(!Oo.call(t,l)||!r(e[l],t[l],l,l,e,t,n))return!1}return!0}var Ro=jt(Jr);function Kr(e,t){return e.source===t.source&&e.flags===t.flags}function Zr(e,t,r,n){var o=e.size===t.size;if(!o)return!1;if(!e.size)return!0;var i={};return e.forEach(function(l,u){if(o){var d=!1,v=0;t.forEach(function(m,p){!d&&!i[v]&&(d=r(l,m,u,p,e,t,n))&&(i[v]=!0),v++}),o=d}}),o}var _o=jt(Zr),Qr=Object.freeze({areArraysEqual:Ur,areDatesEqual:Gr,areMapsEqual:Vr,areObjectsEqual:Jr,areRegExpsEqual:Kr,areSetsEqual:Zr,createIsNestedEqual:Yr}),en=Object.freeze({areArraysEqual:Co,areDatesEqual:Gr,areMapsEqual:Eo,areObjectsEqual:Ro,areRegExpsEqual:Kr,areSetsEqual:_o,createIsNestedEqual:Yr}),Do=Mt(Qr);function We(e,t){return Do(e,t,void 0)}Mt($r(Qr,{createIsNestedEqual:function(){return Tt}})),Mt(en),Mt($r(en,{createIsNestedEqual:function(){return Tt}}));function jo(e={}){const{measureBeforeMount:t=!1,initialWidth:r=1280}=e,[n,o]=C.useState(r),[i,l]=C.useState(!t),u=C.useRef(null),d=C.useRef(null),v=C.useCallback(()=>{const m=u.current;if(m){const p=m.offsetWidth;o(p),i||l(!0)}},[i]);return C.useEffect(()=>{const m=u.current;if(m)return v(),typeof ResizeObserver<"u"&&(d.current=new ResizeObserver(p=>{const w=p[0];if(w){const O=w.contentRect.width;o(O)}}),d.current.observe(m)),()=>{d.current&&(d.current.disconnect(),d.current=null)}},[v]),{width:n,mounted:i,containerRef:u,measureWidth:v}}var dt={exports:{}},sr={},zt={exports:{}},kt={exports:{}},ee={};var tn;function To(){if(tn)return ee;tn=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,O=e?Symbol.for("react.memo"):60115,_=e?Symbol.for("react.lazy"):60116,c=e?Symbol.for("react.block"):60121,a=e?Symbol.for("react.fundamental"):60117,s=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function y(b){if(typeof b=="object"&&b!==null){var E=b.$$typeof;switch(E){case t:switch(b=b.type,b){case d:case v:case n:case i:case o:case p:return b;default:switch(b=b&&b.$$typeof,b){case u:case m:case _:case O:case l:return b;default:return E}}case r:return E}}}function S(b){return y(b)===v}return ee.AsyncMode=d,ee.ConcurrentMode=v,ee.ContextConsumer=u,ee.ContextProvider=l,ee.Element=t,ee.ForwardRef=m,ee.Fragment=n,ee.Lazy=_,ee.Memo=O,ee.Portal=r,ee.Profiler=i,ee.StrictMode=o,ee.Suspense=p,ee.isAsyncMode=function(b){return S(b)||y(b)===d},ee.isConcurrentMode=S,ee.isContextConsumer=function(b){return y(b)===u},ee.isContextProvider=function(b){return y(b)===l},ee.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===t},ee.isForwardRef=function(b){return y(b)===m},ee.isFragment=function(b){return y(b)===n},ee.isLazy=function(b){return y(b)===_},ee.isMemo=function(b){return y(b)===O},ee.isPortal=function(b){return y(b)===r},ee.isProfiler=function(b){return y(b)===i},ee.isStrictMode=function(b){return y(b)===o},ee.isSuspense=function(b){return y(b)===p},ee.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===v||b===i||b===o||b===p||b===w||typeof b=="object"&&b!==null&&(b.$$typeof===_||b.$$typeof===O||b.$$typeof===l||b.$$typeof===u||b.$$typeof===m||b.$$typeof===a||b.$$typeof===s||b.$$typeof===h||b.$$typeof===c)},ee.typeOf=y,ee}var te={};var rn;function Mo(){return rn||(rn=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,p=e?Symbol.for("react.suspense"):60113,w=e?Symbol.for("react.suspense_list"):60120,O=e?Symbol.for("react.memo"):60115,_=e?Symbol.for("react.lazy"):60116,c=e?Symbol.for("react.block"):60121,a=e?Symbol.for("react.fundamental"):60117,s=e?Symbol.for("react.responder"):60118,h=e?Symbol.for("react.scope"):60119;function y(D){return typeof D=="string"||typeof D=="function"||D===n||D===v||D===i||D===o||D===p||D===w||typeof D=="object"&&D!==null&&(D.$$typeof===_||D.$$typeof===O||D.$$typeof===l||D.$$typeof===u||D.$$typeof===m||D.$$typeof===a||D.$$typeof===s||D.$$typeof===h||D.$$typeof===c)}function S(D){if(typeof D=="object"&&D!==null){var ae=D.$$typeof;switch(ae){case t:var De=D.type;switch(De){case d:case v:case n:case i:case o:case p:return De;default:var Re=De&&De.$$typeof;switch(Re){case u:case m:case _:case O:case l:return Re;default:return ae}}case r:return ae}}}var b=d,E=v,g=u,x=l,R=t,Y=m,q=n,V=_,A=O,$=r,K=i,U=o,J=p,le=!1;function me(D){return le||(le=!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.")),P(D)||S(D)===d}function P(D){return S(D)===v}function f(D){return S(D)===u}function j(D){return S(D)===l}function k(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function M(D){return S(D)===m}function X(D){return S(D)===n}function I(D){return S(D)===_}function T(D){return S(D)===O}function W(D){return S(D)===r}function N(D){return S(D)===i}function H(D){return S(D)===o}function F(D){return S(D)===p}te.AsyncMode=b,te.ConcurrentMode=E,te.ContextConsumer=g,te.ContextProvider=x,te.Element=R,te.ForwardRef=Y,te.Fragment=q,te.Lazy=V,te.Memo=A,te.Portal=$,te.Profiler=K,te.StrictMode=U,te.Suspense=J,te.isAsyncMode=me,te.isConcurrentMode=P,te.isContextConsumer=f,te.isContextProvider=j,te.isElement=k,te.isForwardRef=M,te.isFragment=X,te.isLazy=I,te.isMemo=T,te.isPortal=W,te.isProfiler=N,te.isStrictMode=H,te.isSuspense=F,te.isValidElementType=y,te.typeOf=S})()),te}var nn;function on(){return nn||(nn=1,process.env.NODE_ENV==="production"?kt.exports=To():kt.exports=Mo()),kt.exports}var ir,an;function zo(){if(an)return ir;an=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var l={},u=0;u<10;u++)l["_"+String.fromCharCode(u)]=u;var d=Object.getOwnPropertyNames(l).map(function(m){return l[m]});if(d.join("")!=="0123456789")return!1;var v={};return"abcdefghijklmnopqrst".split("").forEach(function(m){v[m]=m}),Object.keys(Object.assign({},v)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ir=o()?Object.assign:function(i,l){for(var u,d=n(i),v,m=1;m<arguments.length;m++){u=Object(arguments[m]);for(var p in u)t.call(u,p)&&(d[p]=u[p]);if(e){v=e(u);for(var w=0;w<v.length;w++)r.call(u,v[w])&&(d[v[w]]=u[v[w]])}}return d},ir}var lr,sn;function ur(){if(sn)return lr;sn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return lr=e,lr}var cr,ln;function un(){return ln||(ln=1,cr=Function.call.bind(Object.prototype.hasOwnProperty)),cr}var fr,cn;function ko(){if(cn)return fr;cn=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ur(),r={},n=un();e=function(i){var l="Warning: "+i;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function o(i,l,u,d,v){if(process.env.NODE_ENV!=="production"){for(var m in i)if(n(i,m)){var p;try{if(typeof i[m]!="function"){var w=Error((d||"React class")+": "+u+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}p=i[m](l,m,d,u,null,t)}catch(_){p=_}if(p&&!(p instanceof Error)&&e((d||"React class")+": type specification of "+u+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in r)){r[p.message]=!0;var O=v?v():"";e("Failed "+u+" type: "+p.message+(O??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},fr=o,fr}var dr,fn;function No(){if(fn)return dr;fn=1;var e=on(),t=zo(),r=ur(),n=un(),o=ko(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(u){var d="Warning: "+u;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function l(){return null}return dr=function(u,d){var v=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function p(P){var f=P&&(v&&P[v]||P[m]);if(typeof f=="function")return f}var w="<<anonymous>>",O={array:s("array"),bigint:s("bigint"),bool:s("boolean"),func:s("function"),number:s("number"),object:s("object"),string:s("string"),symbol:s("symbol"),any:h(),arrayOf:y,element:S(),elementType:b(),instanceOf:E,node:Y(),objectOf:x,oneOf:g,oneOfType:R,shape:V,exact:A};function _(P,f){return P===f?P!==0||1/P===1/f:P!==P&&f!==f}function c(P,f){this.message=P,this.data=f&&typeof f=="object"?f:{},this.stack=""}c.prototype=Error.prototype;function a(P){if(process.env.NODE_ENV!=="production")var f={},j=0;function k(X,I,T,W,N,H,F){if(W=W||w,H=H||T,F!==r){if(d){var D=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 D.name="Invariant Violation",D}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ae=W+":"+T;!f[ae]&&j<3&&(i("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+W+"`. 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."),f[ae]=!0,j++)}}return I[T]==null?X?I[T]===null?new c("The "+N+" `"+H+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new c("The "+N+" `"+H+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:P(I,T,W,N,H)}var M=k.bind(null,!1);return M.isRequired=k.bind(null,!0),M}function s(P){function f(j,k,M,X,I,T){var W=j[k],N=U(W);if(N!==P){var H=J(W);return new c("Invalid "+X+" `"+I+"` of type "+("`"+H+"` supplied to `"+M+"`, expected ")+("`"+P+"`."),{expectedType:P})}return null}return a(f)}function h(){return a(l)}function y(P){function f(j,k,M,X,I){if(typeof P!="function")return new c("Property `"+I+"` of component `"+M+"` has invalid PropType notation inside arrayOf.");var T=j[k];if(!Array.isArray(T)){var W=U(T);return new c("Invalid "+X+" `"+I+"` of type "+("`"+W+"` supplied to `"+M+"`, expected an array."))}for(var N=0;N<T.length;N++){var H=P(T,N,M,X,I+"["+N+"]",r);if(H instanceof Error)return H}return null}return a(f)}function S(){function P(f,j,k,M,X){var I=f[j];if(!u(I)){var T=U(I);return new c("Invalid "+M+" `"+X+"` of type "+("`"+T+"` supplied to `"+k+"`, expected a single ReactElement."))}return null}return a(P)}function b(){function P(f,j,k,M,X){var I=f[j];if(!e.isValidElementType(I)){var T=U(I);return new c("Invalid "+M+" `"+X+"` of type "+("`"+T+"` supplied to `"+k+"`, expected a single ReactElement type."))}return null}return a(P)}function E(P){function f(j,k,M,X,I){if(!(j[k]instanceof P)){var T=P.name||w,W=me(j[k]);return new c("Invalid "+X+" `"+I+"` of type "+("`"+W+"` supplied to `"+M+"`, expected ")+("instance of `"+T+"`."))}return null}return a(f)}function g(P){if(!Array.isArray(P))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("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])."):i("Invalid argument supplied to oneOf, expected an array.")),l;function f(j,k,M,X,I){for(var T=j[k],W=0;W<P.length;W++)if(_(T,P[W]))return null;var N=JSON.stringify(P,function(F,D){var ae=J(D);return ae==="symbol"?String(D):D});return new c("Invalid "+X+" `"+I+"` of value `"+String(T)+"` "+("supplied to `"+M+"`, expected one of "+N+"."))}return a(f)}function x(P){function f(j,k,M,X,I){if(typeof P!="function")return new c("Property `"+I+"` of component `"+M+"` has invalid PropType notation inside objectOf.");var T=j[k],W=U(T);if(W!=="object")return new c("Invalid "+X+" `"+I+"` of type "+("`"+W+"` supplied to `"+M+"`, expected an object."));for(var N in T)if(n(T,N)){var H=P(T,N,M,X,I+"."+N,r);if(H instanceof Error)return H}return null}return a(f)}function R(P){if(!Array.isArray(P))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var f=0;f<P.length;f++){var j=P[f];if(typeof j!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(j)+" at index "+f+"."),l}function k(M,X,I,T,W){for(var N=[],H=0;H<P.length;H++){var F=P[H],D=F(M,X,I,T,W,r);if(D==null)return null;D.data&&n(D.data,"expectedType")&&N.push(D.data.expectedType)}var ae=N.length>0?", expected one of type ["+N.join(", ")+"]":"";return new c("Invalid "+T+" `"+W+"` supplied to "+("`"+I+"`"+ae+"."))}return a(k)}function Y(){function P(f,j,k,M,X){return $(f[j])?null:new c("Invalid "+M+" `"+X+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return a(P)}function q(P,f,j,k,M){return new c((P||"React class")+": "+f+" type `"+j+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+M+"`.")}function V(P){function f(j,k,M,X,I){var T=j[k],W=U(T);if(W!=="object")return new c("Invalid "+X+" `"+I+"` of type `"+W+"` "+("supplied to `"+M+"`, expected `object`."));for(var N in P){var H=P[N];if(typeof H!="function")return q(M,X,I,N,J(H));var F=H(T,N,M,X,I+"."+N,r);if(F)return F}return null}return a(f)}function A(P){function f(j,k,M,X,I){var T=j[k],W=U(T);if(W!=="object")return new c("Invalid "+X+" `"+I+"` of type `"+W+"` "+("supplied to `"+M+"`, expected `object`."));var N=t({},j[k],P);for(var H in N){var F=P[H];if(n(P,H)&&typeof F!="function")return q(M,X,I,H,J(F));if(!F)return new c("Invalid "+X+" `"+I+"` key `"+H+"` supplied to `"+M+"`.\nBad object: "+JSON.stringify(j[k],null," ")+`
|
|
7
|
+
Valid keys: `+JSON.stringify(Object.keys(P),null," "));var D=F(T,H,M,X,I+"."+H,r);if(D)return D}return null}return a(f)}function $(P){switch(typeof P){case"number":case"string":case"undefined":return!0;case"boolean":return!P;case"object":if(Array.isArray(P))return P.every($);if(P===null||u(P))return!0;var f=p(P);if(f){var j=f.call(P),k;if(f!==P.entries){for(;!(k=j.next()).done;)if(!$(k.value))return!1}else for(;!(k=j.next()).done;){var M=k.value;if(M&&!$(M[1]))return!1}}else return!1;return!0;default:return!1}}function K(P,f){return P==="symbol"?!0:f?f["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&f instanceof Symbol:!1}function U(P){var f=typeof P;return Array.isArray(P)?"array":P instanceof RegExp?"object":K(f,P)?"symbol":f}function J(P){if(typeof P>"u"||P===null)return""+P;var f=U(P);if(f==="object"){if(P instanceof Date)return"date";if(P instanceof RegExp)return"regexp"}return f}function le(P){var f=J(P);switch(f){case"array":case"object":return"an "+f;case"boolean":case"date":case"regexp":return"a "+f;default:return f}}function me(P){return!P.constructor||!P.constructor.name?w:P.constructor.name}return O.checkPropTypes=o,O.resetWarningCache=o.resetWarningCache,O.PropTypes=O,O},dr}var pr,dn;function Ao(){if(dn)return pr;dn=1;var e=ur();function t(){}function r(){}return r.resetWarningCache=t,pr=function(){function n(l,u,d,v,m,p){if(p!==e){var w=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 w.name="Invariant Violation",w}}n.isRequired=n;function o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i},pr}var pn;function Nt(){if(pn)return zt.exports;if(pn=1,process.env.NODE_ENV!=="production"){var e=on(),t=!0;zt.exports=No()(e.isElement,t)}else zt.exports=Ao()();return zt.exports}var ge={},Be={},hn;function At(){if(hn)return Be;hn=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.dontSetMe=o,Be.findInArray=e,Be.int=n,Be.isFunction=t,Be.isNum=r;function e(i,l){for(let u=0,d=i.length;u<d;u++)if(l.apply(l,[i[u],u,i]))return i[u]}function t(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,l,u){if(i[l])return new Error(`Invalid prop ${l} passed to ${u} - do not set this, set it on the child.`)}return Be}var Fe={},gn;function Io(){if(gn)return Fe;gn=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.browserPrefixToKey=r,Fe.browserPrefixToStyle=n,Fe.default=void 0,Fe.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=window.document?.documentElement?.style;if(!l||i in l)return"";for(let u=0;u<e.length;u++)if(r(i,e[u])in l)return e[u];return""}function r(i,l){return l?`${l}${o(i)}`:i}function n(i,l){return l?`-${l.toLowerCase()}-${i}`:i}function o(i){let l="",u=!0;for(let d=0;d<i.length;d++)u?(l+=i[d].toUpperCase(),u=!1):i[d]==="-"?u=!0:l+=i[d];return l}return Fe.default=t(),Fe}var mn;function hr(){if(mn)return ge;mn=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.addClassName=b,ge.addEvent=l,ge.addUserSelectStyles=h,ge.createCSSTransform=O,ge.createSVGTransform=_,ge.getTouch=a,ge.getTouchIdentifier=s,ge.getTranslation=c,ge.innerHeight=m,ge.innerWidth=p,ge.matchesSelector=o,ge.matchesSelectorAndParentsTo=i,ge.offsetXYFromParent=w,ge.outerHeight=d,ge.outerWidth=v,ge.removeClassName=E,ge.removeEvent=u,ge.scheduleRemoveUserSelectStyles=y;var e=At(),t=r(Io());function r(g,x){if(typeof WeakMap=="function")var R=new WeakMap,Y=new WeakMap;return(r=function(q,V){if(!V&&q&&q.__esModule)return q;var A,$,K={__proto__:null,default:q};if(q===null||typeof q!="object"&&typeof q!="function")return K;if(A=V?Y:R){if(A.has(q))return A.get(q);A.set(q,K)}for(const U in q)U!=="default"&&{}.hasOwnProperty.call(q,U)&&(($=(A=Object.defineProperty)&&Object.getOwnPropertyDescriptor(q,U))&&($.get||$.set)?A(K,U,$):K[U]=q[U]);return K})(g,x)}let n="";function o(g,x){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(R){return(0,e.isFunction)(g[R])})),(0,e.isFunction)(g[n])?g[n](x):!1}function i(g,x,R){let Y=g;do{if(o(Y,x))return!0;if(Y===R)return!1;Y=Y.parentNode}while(Y);return!1}function l(g,x,R,Y){if(!g)return;const q={capture:!0,...Y};g.addEventListener?g.addEventListener(x,R,q):g.attachEvent?g.attachEvent("on"+x,R):g["on"+x]=R}function u(g,x,R,Y){if(!g)return;const q={capture:!0,...Y};g.removeEventListener?g.removeEventListener(x,R,q):g.detachEvent?g.detachEvent("on"+x,R):g["on"+x]=null}function d(g){let x=g.clientHeight;const R=g.ownerDocument.defaultView.getComputedStyle(g);return x+=(0,e.int)(R.borderTopWidth),x+=(0,e.int)(R.borderBottomWidth),x}function v(g){let x=g.clientWidth;const R=g.ownerDocument.defaultView.getComputedStyle(g);return x+=(0,e.int)(R.borderLeftWidth),x+=(0,e.int)(R.borderRightWidth),x}function m(g){let x=g.clientHeight;const R=g.ownerDocument.defaultView.getComputedStyle(g);return x-=(0,e.int)(R.paddingTop),x-=(0,e.int)(R.paddingBottom),x}function p(g){let x=g.clientWidth;const R=g.ownerDocument.defaultView.getComputedStyle(g);return x-=(0,e.int)(R.paddingLeft),x-=(0,e.int)(R.paddingRight),x}function w(g,x,R){const q=x===x.ownerDocument.body?{left:0,top:0}:x.getBoundingClientRect(),V=(g.clientX+x.scrollLeft-q.left)/R,A=(g.clientY+x.scrollTop-q.top)/R;return{x:V,y:A}}function O(g,x){const R=c(g,x,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:R}}function _(g,x){return c(g,x,"")}function c(g,x,R){let{x:Y,y:q}=g,V=`translate(${Y}${R},${q}${R})`;if(x){const A=`${typeof x.x=="string"?x.x:x.x+R}`,$=`${typeof x.y=="string"?x.y:x.y+R}`;V=`translate(${A}, ${$})`+V}return V}function a(g,x){return g.targetTouches&&(0,e.findInArray)(g.targetTouches,R=>x===R.identifier)||g.changedTouches&&(0,e.findInArray)(g.changedTouches,R=>x===R.identifier)}function s(g){if(g.targetTouches&&g.targetTouches[0])return g.targetTouches[0].identifier;if(g.changedTouches&&g.changedTouches[0])return g.changedTouches[0].identifier}function h(g){if(!g)return;let x=g.getElementById("react-draggable-style-el");x||(x=g.createElement("style"),x.type="text/css",x.id="react-draggable-style-el",x.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
8
|
+
`,x.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
9
|
+
`,g.getElementsByTagName("head")[0].appendChild(x)),g.body&&b(g.body,"react-draggable-transparent-selection")}function y(g){window.requestAnimationFrame?window.requestAnimationFrame(()=>{S(g)}):S(g)}function S(g){if(g)try{if(g.body&&E(g.body,"react-draggable-transparent-selection"),g.selection)g.selection.empty();else{const x=(g.defaultView||window).getSelection();x&&x.type!=="Caret"&&x.removeAllRanges()}}catch{}}function b(g,x){g.classList?g.classList.add(x):g.className.match(new RegExp(`(?:^|\\s)${x}(?!\\S)`))||(g.className+=` ${x}`)}function E(g,x){g.classList?g.classList.remove(x):g.className=g.className.replace(new RegExp(`(?:^|\\s)${x}(?!\\S)`,"g"),"")}return ge}var Ae={},yn;function vn(){if(yn)return Ae;yn=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.canDragX=o,Ae.canDragY=i,Ae.createCoreData=u,Ae.createDraggableData=d,Ae.getBoundPosition=r,Ae.getControlPosition=l,Ae.snapToGrid=n;var e=At(),t=hr();function r(p,w,O){if(!p.props.bounds)return[w,O];let{bounds:_}=p.props;_=typeof _=="string"?_:v(_);const c=m(p);if(typeof _=="string"){const{ownerDocument:a}=c,s=a.defaultView;let h;if(_==="parent"?h=c.parentNode:h=c.getRootNode().querySelector(_),!(h instanceof s.HTMLElement))throw new Error('Bounds selector "'+_+'" could not find an element.');const y=h,S=s.getComputedStyle(c),b=s.getComputedStyle(y);_={left:-c.offsetLeft+(0,e.int)(b.paddingLeft)+(0,e.int)(S.marginLeft),top:-c.offsetTop+(0,e.int)(b.paddingTop)+(0,e.int)(S.marginTop),right:(0,t.innerWidth)(y)-(0,t.outerWidth)(c)-c.offsetLeft+(0,e.int)(b.paddingRight)-(0,e.int)(S.marginRight),bottom:(0,t.innerHeight)(y)-(0,t.outerHeight)(c)-c.offsetTop+(0,e.int)(b.paddingBottom)-(0,e.int)(S.marginBottom)}}return(0,e.isNum)(_.right)&&(w=Math.min(w,_.right)),(0,e.isNum)(_.bottom)&&(O=Math.min(O,_.bottom)),(0,e.isNum)(_.left)&&(w=Math.max(w,_.left)),(0,e.isNum)(_.top)&&(O=Math.max(O,_.top)),[w,O]}function n(p,w,O){const _=Math.round(w/p[0])*p[0],c=Math.round(O/p[1])*p[1];return[_,c]}function o(p){return p.props.axis==="both"||p.props.axis==="x"}function i(p){return p.props.axis==="both"||p.props.axis==="y"}function l(p,w,O){const _=typeof w=="number"?(0,t.getTouch)(p,w):null;if(typeof w=="number"&&!_)return null;const c=m(O),a=O.props.offsetParent||c.offsetParent||c.ownerDocument.body;return(0,t.offsetXYFromParent)(_||p,a,O.props.scale)}function u(p,w,O){const _=!(0,e.isNum)(p.lastX),c=m(p);return _?{node:c,deltaX:0,deltaY:0,lastX:w,lastY:O,x:w,y:O}:{node:c,deltaX:w-p.lastX,deltaY:O-p.lastY,lastX:p.lastX,lastY:p.lastY,x:w,y:O}}function d(p,w){const O=p.props.scale;return{node:w.node,x:p.state.x+w.deltaX/O,y:p.state.y+w.deltaY/O,deltaX:w.deltaX/O,deltaY:w.deltaY/O,lastX:p.state.x,lastY:p.state.y}}function v(p){return{left:p.left,top:p.top,right:p.right,bottom:p.bottom}}function m(p){const w=p.findDOMNode();if(!w)throw new Error("<DraggableCore>: Unmounted during event!");return w}return Ae}var pt={},It={},bn;function xn(){if(bn)return It;bn=1,Object.defineProperty(It,"__esModule",{value:!0}),It.default=e;function e(){}return It}var wn;function Lo(){if(wn)return pt;wn=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.default=void 0;var e=d(C),t=u(Nt()),r=u(Cr),n=hr(),o=vn(),i=At(),l=u(xn());function u(c){return c&&c.__esModule?c:{default:c}}function d(c,a){if(typeof WeakMap=="function")var s=new WeakMap,h=new WeakMap;return(d=function(y,S){if(!S&&y&&y.__esModule)return y;var b,E,g={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return g;if(b=S?h:s){if(b.has(y))return b.get(y);b.set(y,g)}for(const x in y)x!=="default"&&{}.hasOwnProperty.call(y,x)&&((E=(b=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,x))&&(E.get||E.set)?b(g,x,E):g[x]=y[x]);return g})(c,a)}function v(c,a,s){return(a=m(a))in c?Object.defineProperty(c,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):c[a]=s,c}function m(c){var a=p(c,"string");return typeof a=="symbol"?a:a+""}function p(c,a){if(typeof c!="object"||!c)return c;var s=c[Symbol.toPrimitive];if(s!==void 0){var h=s.call(c,a);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(c)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let O=w.mouse,_=class extends e.Component{constructor(){super(...arguments),v(this,"dragging",!1),v(this,"lastX",NaN),v(this,"lastY",NaN),v(this,"touchIdentifier",null),v(this,"mounted",!1),v(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:h}=s;if(this.props.disabled||!(a.target instanceof h.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&!this.props.allowMobileScroll&&a.preventDefault();const y=(0,n.getTouchIdentifier)(a);this.touchIdentifier=y;const S=(0,o.getControlPosition)(a,y,this);if(S==null)return;const{x:b,y:E}=S,g=(0,o.createCoreData)(this,b,E);(0,l.default)("DraggableCore: handleDragStart: %j",g),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(a,g)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(h),this.dragging=!0,this.lastX=b,this.lastY=E,(0,n.addEvent)(h,O.move,this.handleDrag),(0,n.addEvent)(h,O.stop,this.handleDragStop))}),v(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:h,y}=s;if(Array.isArray(this.props.grid)){let E=h-this.lastX,g=y-this.lastY;if([E,g]=(0,o.snapToGrid)(this.props.grid,E,g),!E&&!g)return;h=this.lastX+E,y=this.lastY+g}const S=(0,o.createCoreData)(this,h,y);if((0,l.default)("DraggableCore: handleDrag: %j",S),this.props.onDrag(a,S)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const g=document.createEvent("MouseEvents");g.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(g)}return}this.lastX=h,this.lastY=y}),v(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:h,y}=s;if(Array.isArray(this.props.grid)){let g=h-this.lastX||0,x=y-this.lastY||0;[g,x]=(0,o.snapToGrid)(this.props.grid,g,x),h=this.lastX+g,y=this.lastY+x}const S=(0,o.createCoreData)(this,h,y);if(this.props.onStop(a,S)===!1||this.mounted===!1)return!1;const E=this.findDOMNode();E&&this.props.enableUserSelectHack&&(0,n.scheduleRemoveUserSelectStyles)(E.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",S),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,E&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(E.ownerDocument,O.move,this.handleDrag),(0,n.removeEvent)(E.ownerDocument,O.stop,this.handleDragStop))}),v(this,"onMouseDown",a=>(O=w.mouse,this.handleDragStart(a))),v(this,"onMouseUp",a=>(O=w.mouse,this.handleDragStop(a))),v(this,"onTouchStart",a=>(O=w.touch,this.handleDragStart(a))),v(this,"onTouchEnd",a=>(O=w.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,w.mouse.move,this.handleDrag),(0,n.removeEvent)(s,w.touch.move,this.handleDrag),(0,n.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.scheduleRemoveUserSelectStyles)(s)}}findDOMNode(){return this.props?.nodeRef?this.props?.nodeRef?.current:r.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return pt.default=_,v(_,"displayName","DraggableCore"),v(_,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(c,a){if(c[a]&&c[a].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),v(_,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),pt}var Sn;function Wo(){return Sn||(Sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=p(C),r=m(Nt()),n=m(Cr),o=Gt,i=hr(),l=vn(),u=At(),d=m(Lo()),v=m(xn());function m(s){return s&&s.__esModule?s:{default:s}}function p(s,h){if(typeof WeakMap=="function")var y=new WeakMap,S=new WeakMap;return(p=function(b,E){if(!E&&b&&b.__esModule)return b;var g,x,R={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return R;if(g=E?S:y){if(g.has(b))return g.get(b);g.set(b,R)}for(const Y in b)Y!=="default"&&{}.hasOwnProperty.call(b,Y)&&((x=(g=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,Y))&&(x.get||x.set)?g(R,Y,x):R[Y]=b[Y]);return R})(s,h)}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var h=1;h<arguments.length;h++){var y=arguments[h];for(var S in y)({}).hasOwnProperty.call(y,S)&&(s[S]=y[S])}return s},w.apply(null,arguments)}function O(s,h,y){return(h=_(h))in s?Object.defineProperty(s,h,{value:y,enumerable:!0,configurable:!0,writable:!0}):s[h]=y,s}function _(s){var h=c(s,"string");return typeof h=="symbol"?h:h+""}function c(s,h){if(typeof s!="object"||!s)return s;var y=s[Symbol.toPrimitive];if(y!==void 0){var S=y.call(s,h);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(s)}class a extends t.Component{static getDerivedStateFromProps(h,y){let{position:S}=h,{prevPropsPosition:b}=y;return S&&(!b||S.x!==b.x||S.y!==b.y)?((0,v.default)("Draggable: getDerivedStateFromProps %j",{position:S,prevPropsPosition:b}),{x:S.x,y:S.y,prevPropsPosition:{...S}}):null}constructor(h){super(h),O(this,"onDragStart",(y,S)=>{if((0,v.default)("Draggable: onDragStart: %j",S),this.props.onStart(y,(0,l.createDraggableData)(this,S))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),O(this,"onDrag",(y,S)=>{if(!this.state.dragging)return!1;(0,v.default)("Draggable: onDrag: %j",S);const b=(0,l.createDraggableData)(this,S),E={x:b.x,y:b.y,slackX:0,slackY:0};if(this.props.bounds){const{x,y:R}=E;E.x+=this.state.slackX,E.y+=this.state.slackY;const[Y,q]=(0,l.getBoundPosition)(this,E.x,E.y);E.x=Y,E.y=q,E.slackX=this.state.slackX+(x-E.x),E.slackY=this.state.slackY+(R-E.y),b.x=E.x,b.y=E.y,b.deltaX=E.x-this.state.x,b.deltaY=E.y-this.state.y}if(this.props.onDrag(y,b)===!1)return!1;this.setState(E)}),O(this,"onDragStop",(y,S)=>{if(!this.state.dragging||this.props.onStop(y,(0,l.createDraggableData)(this,S))===!1)return!1;(0,v.default)("Draggable: onDragStop: %j",S);const E={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x,y:R}=this.props.position;E.x=x,E.y=R}this.setState(E)}),this.state={dragging:!1,dragged:!1,x:h.position?h.position.x:h.defaultPosition.x,y:h.position?h.position.y:h.defaultPosition.y,prevPropsPosition:{...h.position},slackX:0,slackY:0,isElementSVG:!1},h.position&&!(h.onDrag||h.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.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){return this.props?.nodeRef?.current??n.default.findDOMNode(this)}render(){const{axis:h,bounds:y,children:S,defaultPosition:b,defaultClassName:E,defaultClassNameDragging:g,defaultClassNameDragged:x,position:R,positionOffset:Y,scale:q,...V}=this.props;let A={},$=null;const U=!!!R||this.state.dragging,J=R||b,le={x:(0,l.canDragX)(this)&&U?this.state.x:J.x,y:(0,l.canDragY)(this)&&U?this.state.y:J.y};this.state.isElementSVG?$=(0,i.createSVGTransform)(le,Y):A=(0,i.createCSSTransform)(le,Y);const me=(0,o.clsx)(S.props.className||"",E,{[g]:this.state.dragging,[x]:this.state.dragged});return t.createElement(d.default,w({},V,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(S),{className:me,style:{...S.props.style,...A},transform:$}))}}e.default=a,O(a,"displayName","Draggable"),O(a,"propTypes",{...d.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),O(a,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(sr)),sr}var Cn;function gr(){if(Cn)return dt.exports;Cn=1;const{default:e,DraggableCore:t}=Wo();return dt.exports=e,dt.exports.default=e,dt.exports.DraggableCore=t,dt.exports}var qo=gr(),ht={exports:{}},gt={},Lt={},En;function Ho(){if(En)return Lt;En=1,Lt.__esModule=!0,Lt.cloneElement=u;var e=t(C);function t(d){return d&&d.__esModule?d:{default:d}}function r(d,v){var m=Object.keys(d);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(d);v&&(p=p.filter(function(w){return Object.getOwnPropertyDescriptor(d,w).enumerable})),m.push.apply(m,p)}return m}function n(d){for(var v=1;v<arguments.length;v++){var m=arguments[v]!=null?arguments[v]:{};v%2?r(Object(m),!0).forEach(function(p){o(d,p,m[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(p){Object.defineProperty(d,p,Object.getOwnPropertyDescriptor(m,p))})}return d}function o(d,v,m){return(v=i(v))in d?Object.defineProperty(d,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[v]=m,d}function i(d){var v=l(d,"string");return typeof v=="symbol"?v:v+""}function l(d,v){if(typeof d!="object"||!d)return d;var m=d[Symbol.toPrimitive];if(m!==void 0){var p=m.call(d,v);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(d)}function u(d,v){return v.style&&d.props.style&&(v.style=n(n({},d.props.style),v.style)),v.className&&d.props.className&&(v.className=`${d.props.className} ${v.className}`),e.default.cloneElement(d,v)}return Lt}var mt={},Pn;function On(){if(Pn)return mt;Pn=1,mt.__esModule=!0,mt.resizableProps=void 0;var e=t(Nt());gr();function t(r){return r&&r.__esModule?r:{default:r}}return mt.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const[i]=n;return i.axis==="both"||i.axis==="y"?e.default.number.isRequired(...n):e.default.number(...n)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const[i]=n;return i.axis==="both"||i.axis==="x"?e.default.number.isRequired(...n):e.default.number(...n)}},mt}var Rn;function _n(){if(Rn)return gt;Rn=1,gt.__esModule=!0,gt.default=void 0;var e=i(C),t=gr(),r=Ho(),n=On();const o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(c,a){if(typeof WeakMap=="function")var s=new WeakMap,h=new WeakMap;return(i=function(y,S){if(!S&&y&&y.__esModule)return y;var b,E,g={__proto__:null,default:y};if(y===null||typeof y!="object"&&typeof y!="function")return g;if(b=S?h:s){if(b.has(y))return b.get(y);b.set(y,g)}for(const x in y)x!=="default"&&{}.hasOwnProperty.call(y,x)&&((E=(b=Object.defineProperty)&&Object.getOwnPropertyDescriptor(y,x))&&(E.get||E.set)?b(g,x,E):g[x]=y[x]);return g})(c,a)}function l(){return l=Object.assign?Object.assign.bind():function(c){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var h in s)({}).hasOwnProperty.call(s,h)&&(c[h]=s[h])}return c},l.apply(null,arguments)}function u(c,a){if(c==null)return{};var s,h,y=d(c,a);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(c);for(h=0;h<S.length;h++)s=S[h],a.indexOf(s)===-1&&{}.propertyIsEnumerable.call(c,s)&&(y[s]=c[s])}return y}function d(c,a){if(c==null)return{};var s={};for(var h in c)if({}.hasOwnProperty.call(c,h)){if(a.indexOf(h)!==-1)continue;s[h]=c[h]}return s}function v(c,a){var s=Object.keys(c);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(c);a&&(h=h.filter(function(y){return Object.getOwnPropertyDescriptor(c,y).enumerable})),s.push.apply(s,h)}return s}function m(c){for(var a=1;a<arguments.length;a++){var s=arguments[a]!=null?arguments[a]:{};a%2?v(Object(s),!0).forEach(function(h){p(c,h,s[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(s)):v(Object(s)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(s,h))})}return c}function p(c,a,s){return(a=w(a))in c?Object.defineProperty(c,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):c[a]=s,c}function w(c){var a=O(c,"string");return typeof a=="symbol"?a:a+""}function O(c,a){if(typeof c!="object"||!c)return c;var s=c[Symbol.toPrimitive];if(s!==void 0){var h=s.call(c,a);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(c)}let _=class extends e.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(a,s){const{minConstraints:h,maxConstraints:y,lockAspectRatio:S}=this.props;if(!h&&!y&&!S)return[a,s];if(S){const R=this.props.width/this.props.height,Y=a-this.props.width,q=s-this.props.height;Math.abs(Y)>Math.abs(q*R)?s=a/R:a=s*R}const[b,E]=[a,s];let[g,x]=this.slack||[0,0];return a+=g,s+=x,h&&(a=Math.max(h[0],a),s=Math.max(h[1],s)),y&&(a=Math.min(y[0],a),s=Math.min(y[1],s)),this.slack=[g+(b-a),x+(E-s)],[a,s]}resizeHandler(a,s){return(h,y)=>{let{node:S,deltaX:b,deltaY:E}=y;a==="onResizeStart"&&this.resetData();const g=(this.props.axis==="both"||this.props.axis==="x")&&s!=="n"&&s!=="s",x=(this.props.axis==="both"||this.props.axis==="y")&&s!=="e"&&s!=="w";if(!g&&!x)return;const R=s[0],Y=s[s.length-1],q=S.getBoundingClientRect();if(this.lastHandleRect!=null){if(Y==="w"){const J=q.left-this.lastHandleRect.left;b+=J}if(R==="n"){const J=q.top-this.lastHandleRect.top;E+=J}}this.lastHandleRect=q,Y==="w"&&(b=-b),R==="n"&&(E=-E);let V=this.props.width+(g?b/this.props.transformScale:0),A=this.props.height+(x?E/this.props.transformScale:0);[V,A]=this.runConstraints(V,A),a==="onResizeStop"&&this.lastSize&&({width:V,height:A}=this.lastSize);const $=V!==this.props.width||A!==this.props.height;a!=="onResizeStop"&&(this.lastSize={width:V,height:A});const K=typeof this.props[a]=="function"?this.props[a]:null;K&&!(a==="onResize"&&!$)&&(h.persist?.(),K(h,{node:S,size:{width:V,height:A},handle:s})),a==="onResizeStop"&&this.resetData()}}renderResizeHandle(a,s){const{handle:h}=this.props;if(!h)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${a}`,ref:s});if(typeof h=="function")return h(a,s);const y=typeof h.type=="string",S=m({ref:s},y?{}:{handleAxis:a});return e.cloneElement(h,S)}render(){const a=this.props,{children:s,className:h,draggableOpts:y,width:S,height:b,handle:E,handleSize:g,lockAspectRatio:x,axis:R,minConstraints:Y,maxConstraints:q,onResize:V,onResizeStop:A,onResizeStart:$,resizeHandles:K,transformScale:U}=a,J=u(a,o);return(0,r.cloneElement)(s,m(m({},J),{},{className:`${h?`${h} `:""}react-resizable`,children:[...e.Children.toArray(s.props.children),...K.map(le=>{const me=this.handleRefs[le]??(this.handleRefs[le]=e.createRef());return e.createElement(t.DraggableCore,l({},y,{nodeRef:me,key:`resizableHandle-${le}`,onStop:this.resizeHandler("onResizeStop",le),onStart:this.resizeHandler("onResizeStart",le),onDrag:this.resizeHandler("onResize",le)}),this.renderResizeHandle(le,me))})]}))}};return gt.default=_,_.propTypes=n.resizableProps,_.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},gt}var yt={},Dn;function Yo(){if(Dn)return yt;Dn=1,yt.__esModule=!0,yt.default=void 0;var e=l(C),t=i(Nt()),r=i(_n()),n=On();const o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(a){return a&&a.__esModule?a:{default:a}}function l(a,s){if(typeof WeakMap=="function")var h=new WeakMap,y=new WeakMap;return(l=function(S,b){if(!b&&S&&S.__esModule)return S;var E,g,x={__proto__:null,default:S};if(S===null||typeof S!="object"&&typeof S!="function")return x;if(E=b?y:h){if(E.has(S))return E.get(S);E.set(S,x)}for(const R in S)R!=="default"&&{}.hasOwnProperty.call(S,R)&&((g=(E=Object.defineProperty)&&Object.getOwnPropertyDescriptor(S,R))&&(g.get||g.set)?E(x,R,g):x[R]=S[R]);return x})(a,s)}function u(){return u=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var h=arguments[s];for(var y in h)({}).hasOwnProperty.call(h,y)&&(a[y]=h[y])}return a},u.apply(null,arguments)}function d(a,s){var h=Object.keys(a);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(a);s&&(y=y.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),h.push.apply(h,y)}return h}function v(a){for(var s=1;s<arguments.length;s++){var h=arguments[s]!=null?arguments[s]:{};s%2?d(Object(h),!0).forEach(function(y){m(a,y,h[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(h)):d(Object(h)).forEach(function(y){Object.defineProperty(a,y,Object.getOwnPropertyDescriptor(h,y))})}return a}function m(a,s,h){return(s=p(s))in a?Object.defineProperty(a,s,{value:h,enumerable:!0,configurable:!0,writable:!0}):a[s]=h,a}function p(a){var s=w(a,"string");return typeof s=="symbol"?s:s+""}function w(a,s){if(typeof a!="object"||!a)return a;var h=a[Symbol.toPrimitive];if(h!==void 0){var y=h.call(a,s);if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function O(a,s){if(a==null)return{};var h,y,S=_(a,s);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(a);for(y=0;y<b.length;y++)h=b[y],s.indexOf(h)===-1&&{}.propertyIsEnumerable.call(a,h)&&(S[h]=a[h])}return S}function _(a,s){if(a==null)return{};var h={};for(var y in a)if({}.hasOwnProperty.call(a,y)){if(s.indexOf(y)!==-1)continue;h[y]=a[y]}return h}let c=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(s,h)=>{const{size:y}=h;this.props.onResize?(s.persist?.(),this.setState(y,()=>this.props.onResize&&this.props.onResize(s,h))):this.setState(y)}}static getDerivedStateFromProps(s,h){return h.propsWidth!==s.width||h.propsHeight!==s.height?{width:s.width,height:s.height,propsWidth:s.width,propsHeight:s.height}:null}render(){const s=this.props,{handle:h,handleSize:y,onResize:S,onResizeStart:b,onResizeStop:E,draggableOpts:g,minConstraints:x,maxConstraints:R,lockAspectRatio:Y,axis:q,width:V,height:A,resizeHandles:$,style:K,transformScale:U}=s,J=O(s,o);return e.createElement(r.default,{axis:q,draggableOpts:g,handle:h,handleSize:y,height:this.state.height,lockAspectRatio:Y,maxConstraints:R,minConstraints:x,onResizeStart:b,onResize:this.onResize,onResizeStop:E,resizeHandles:$,transformScale:U,width:this.state.width},e.createElement("div",u({},J,{style:v(v({},K),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return yt.default=c,c.propTypes=v(v({},n.resizableProps),{},{children:t.default.element}),yt}var jn;function $o(){return jn||(jn=1,ht.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},ht.exports.Resizable=_n().default,ht.exports.ResizableBox=Yo().default),ht.exports}var Bo=$o();function Tn(e){const{children:t,cols:r,containerWidth:n,margin:o,containerPadding:i,rowHeight:l,maxRows:u,isDraggable:d,isResizable:v,isBounded:m,static:p,useCSSTransforms:w=!0,usePercentages:O=!1,transformScale:_=1,positionStrategy:c,dragThreshold:a=0,droppingPosition:s,className:h="",style:y,handle:S="",cancel:b="",x:E,y:g,w:x,h:R,minW:Y=1,maxW:q=1/0,minH:V=1,maxH:A=1/0,i:$,resizeHandles:K,resizeHandle:U,constraints:J=Mr,layoutItem:le,layout:me=[],onDragStart:P,onDrag:f,onDragStop:j,onResizeStart:k,onResize:M,onResizeStop:X}=e,[I,T]=C.useState(!1),[W,N]=C.useState(!1),H=C.useRef(null),F=C.useRef({left:0,top:0}),D=C.useRef({top:0,left:0,width:0,height:0}),ae=C.useRef(void 0),De=C.useRef(me);De.current=me;const Re=C.useRef(null),ye=C.useRef(null),Ce=C.useRef(!1),at=C.useRef({x:0,y:0}),de=C.useRef(!1),ue=C.useMemo(()=>({cols:r,containerPadding:i,containerWidth:n,margin:o,maxRows:u,rowHeight:l}),[r,i,n,o,u,l]),Ee=C.useMemo(()=>({cols:r,maxRows:u,containerWidth:n,containerHeight:0,rowHeight:l,margin:o,layout:[]}),[r,u,n,l,o]),we=C.useCallback(()=>({...Ee,layout:De.current}),[Ee]),ke=C.useMemo(()=>le??{i:$,x:E,y:g,w:x,h:R,minW:Y,maxW:q,minH:V,maxH:A},[le,$,E,g,x,R,Y,q,V,A]),Wt=C.useCallback(re=>{if(c?.calcStyle)return c.calcStyle(re);if(w)return zr(re);const ne=Un(re);return O?{...ne,left:kr(re.left/n),width:kr(re.width/n)}:ne},[c,w,O,n]),Ie=C.useCallback((re,{node:ne})=>{if(!P)return;const{offsetParent:he}=ne;if(!he)return;const se=he.getBoundingClientRect(),ve=ne.getBoundingClientRect(),Pe=ve.left/_,_e=se.left/_,Oe=ve.top/_,Me=se.top/_;let ze;if(c?.calcDragPosition){const G=re;ze=c.calcDragPosition(G.clientX,G.clientY,G.clientX-ve.left,G.clientY-ve.top)}else ze={left:Pe-_e+he.scrollLeft,top:Oe-Me+he.scrollTop};if(F.current=ze,a>0){const G=re;at.current={x:G.clientX,y:G.clientY},Ce.current=!0,de.current=!1,T(!0);return}T(!0);const Ve=Ct(ue,ze.top,ze.left),{x:Je,y:L}=Rt(J,ke,Ve.x,Ve.y,we());P($,Je,L,{e:re,node:ne,newPosition:ze})},[P,_,ue,c,a,J,ke,we,$]),st=C.useCallback((re,{node:ne,deltaX:he,deltaY:se})=>{if(!f||!I)return;const ve=re;if(Ce.current&&!de.current){const Je=ve.clientX-at.current.x,L=ve.clientY-at.current.y;if(Math.hypot(Je,L)<a)return;if(de.current=!0,Ce.current=!1,P){const B=Ct(ue,F.current.top,F.current.left),{x:Z,y:ie}=Rt(J,ke,B.x,B.y,we());P($,Z,ie,{e:re,node:ne,newPosition:F.current})}}let Pe=F.current.top+se,_e=F.current.left+he;if(m){const{offsetParent:Je}=ne;if(Je){const L=Je.clientHeight-nt(R,l,o[1]);Pe=Et(Pe,0,L);const G=rt(ue),B=n-nt(x,G,o[0]);_e=Et(_e,0,B)}}const Oe={top:Pe,left:_e};F.current=Oe;const Me=Ct(ue,Pe,_e),{x:ze,y:Ve}=Rt(J,ke,Me.x,Me.y,we());f($,ze,Ve,{e:re,node:ne,newPosition:Oe})},[f,P,I,a,m,R,l,o,ue,n,x,$,J,ke,we]),Xe=C.useCallback((re,{node:ne})=>{if(!j||!I)return;const he=Ce.current;if(Ce.current=!1,de.current=!1,at.current={x:0,y:0},he){T(!1),F.current={left:0,top:0};return}const{left:se,top:ve}=F.current,Pe={top:ve,left:se};T(!1),F.current={left:0,top:0};const _e=Ct(ue,ve,se),{x:Oe,y:Me}=Rt(J,ke,_e.x,_e.y,we());j($,Oe,Me,{e:re,node:ne,newPosition:Pe})},[j,I,ue,J,ke,we,$]);Re.current=Ie,ye.current=st;const Ne=C.useCallback((re,{node:ne,size:he,handle:se},ve,Pe)=>{const _e=Pe==="onResizeStart"?k:Pe==="onResize"?M:X;if(!_e)return;let Oe;ne?Oe=to(se,ve,he,n):Oe={...he,top:ve.top,left:ve.left},D.current=Oe;const Me=qn(ue,Oe.width,Oe.height),{w:ze,h:Ve}=Xn(J,ke,Me.w,Me.h,se,we());_e($,ze,Ve,{e:re.nativeEvent,node:ne,size:Oe,handle:se})},[k,M,X,n,ue,$,J,ke,we]),it=C.useCallback((re,ne)=>{N(!0);const he=ft(ue,E,g,x,R),se={...ne,handle:ne.handle};Ne(re,se,he,"onResizeStart")},[Ne,ue,E,g,x,R]),lt=C.useCallback((re,ne)=>{const he=ft(ue,E,g,x,R),se={...ne,handle:ne.handle};Ne(re,se,he,"onResize")},[Ne,ue,E,g,x,R]),Ue=C.useCallback((re,ne)=>{N(!1),D.current={top:0,left:0,width:0,height:0};const he=ft(ue,E,g,x,R),se={...ne,handle:ne.handle};Ne(re,se,he,"onResizeStop")},[Ne,ue,E,g,x,R]);C.useEffect(()=>{if(!s)return;const re=H.current;if(!re)return;const ne=ae.current||{left:0,top:0},he=I&&(s.left!==ne.left||s.top!==ne.top);if(I){if(he){const se=s.left-F.current.left,ve=s.top-F.current.top,Pe={node:re,deltaX:se,deltaY:ve,lastX:F.current.left,lastY:F.current.top,x:s.left,y:s.top};ye.current?.(s.e,Pe)}}else{const se={node:re,deltaX:s.left,deltaY:s.top,lastX:0,lastY:0,x:s.left,y:s.top};Re.current?.(s.e,se)}ae.current=s},[s,I,$]);const Le=ft(ue,E,g,x,R,I?F.current:null,W?D.current:null),vt=C.Children.only(t),bt=ft(ue,0,0,1,1),qt=[bt.width,bt.height],Ht=[1/0,1/0],je=vt.props,xr=je.className,Yt=je.style;let Ge=C.cloneElement(vt,{ref:H,className:Gt("react-grid-item",xr,h,{static:p,resizing:W,"react-draggable":d,"react-draggable-dragging":I,dropping:!!s,cssTransforms:w}),style:{...y,...Yt,...Wt(Le)}});const $t=U;return Ge=z.jsx(Bo.Resizable,{draggableOpts:{disabled:!v},className:v?void 0:"react-resizable-hide",width:Le.width,height:Le.height,minConstraints:qt,maxConstraints:Ht,onResizeStart:it,onResize:lt,onResizeStop:Ue,transformScale:_,resizeHandles:K,handle:$t,children:Ge}),Ge=z.jsx(qo.DraggableCore,{disabled:!d,onStart:Ie,onDrag:st,onStop:Xe,handle:S,cancel:".react-resizable-handle"+(b?","+b:""),scale:_,nodeRef:H,children:Ge}),Ge}var qe=()=>{},Mn="react-grid-layout",zn=!1;try{zn=/firefox/i.test(navigator.userAgent)}catch{}function Fo(e,t){const r=C.Children.toArray(e),n=C.Children.toArray(t);if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const i=r[o],l=n[o];if(i?.key!==l?.key)return!1}return!0}function kn(e,t,r,n){const o=[],i=new Set;C.Children.forEach(t,u=>{if(!C.isValidElement(u)||u.key===null)return;const d=String(u.key);i.add(d);const v=e.find(m=>m.i===d);if(v)o.push(Qe(v));else{const p=u.props["data-grid"];p?o.push({i:d,x:p.x??0,y:p.y??0,w:p.w??1,h:p.h??1,minW:p.minW,maxW:p.maxW,minH:p.minH,maxH:p.maxH,static:p.static,isDraggable:p.isDraggable,isResizable:p.isResizable,resizeHandles:p.resizeHandles,isBounded:p.isBounded}):o.push({i:d,x:0,y:Pt(o),w:1,h:1})}});const l=Zt(o,{cols:r});return n.compact(l,r)}function Xo(e){const{children:t,width:r,gridConfig:n,dragConfig:o,resizeConfig:i,dropConfig:l,positionStrategy:u=no,compactor:d,constraints:v=Mr,layout:m=[],droppingItem:p,autoSize:w=!0,className:O="",style:_={},innerRef:c,onLayoutChange:a=qe,onDragStart:s=qe,onDrag:h=qe,onDragStop:y=qe,onResizeStart:S=qe,onResize:b=qe,onResizeStop:E=qe,onDrop:g=qe,onDropDragOver:x=qe}=e,R=C.useMemo(()=>({...oo,...n}),[n]),Y=C.useMemo(()=>({...ao,...o}),[o]),q=C.useMemo(()=>({...so,...i}),[i]),V=C.useMemo(()=>({...io,...l}),[l]),{cols:A,rowHeight:$,maxRows:K,margin:U,containerPadding:J}=R,{enabled:le,bounded:me,handle:P,cancel:f,threshold:j}=Y,{enabled:k,handles:M,handleComponent:X}=q,{enabled:I,defaultItem:T,onDragOver:W}=V,N=d??or("vertical"),H=N.type,F=N.allowOverlap,D=N.preventCollision??!1,ae=C.useMemo(()=>p??{i:"__dropping-elem__",...T},[p,T]),De=u.type==="transform",Re=u.scale,ye=J??U,[Ce,at]=C.useState(!1),[de,ue]=C.useState(()=>kn(m,t,A,N)),[Ee,we]=C.useState(null),[ke,Wt]=C.useState(!1),[Ie,st]=C.useState(null),[Xe,Ne]=C.useState(),it=C.useRef(null),lt=C.useRef(null),Ue=C.useRef(null),Le=C.useRef(0),vt=C.useRef(de),bt=C.useRef(m),qt=C.useRef(t),Ht=C.useRef(H),je=C.useRef(de);je.current=de,C.useEffect(()=>{at(!0),We(de,m)||a(de)},[]),C.useEffect(()=>{if(Ee||Ie)return;const L=!We(m,bt.current),G=!Fo(t,qt.current),B=H!==Ht.current;if(L||G||B){const ie=kn(L?m:de,t,A,N);We(ie,de)||ue(ie)}bt.current=m,qt.current=t,Ht.current=H},[m,t,A,H,N,Ee,Ie,de]),C.useEffect(()=>{if(!Ee&&!We(de,vt.current)){vt.current=de;const L=de.filter(G=>G.i!==ae.i);a(L)}},[de,Ee,a,ae.i]);const xr=C.useMemo(()=>{if(!w)return;const L=Pt(de),G=ye[1];return L*$+(L-1)*U[1]+G*2+"px"},[w,de,$,U,ye]),Yt=C.useCallback((L,G,B,Z)=>{const ie=je.current,oe=Ze(ie,L);if(!oe)return;const ce={w:oe.w,h:oe.h,x:oe.x,y:oe.y,i:L};it.current=Qe(oe),Ue.current=ie,we(ce),s(ie,oe,oe,null,Z.e,Z.node)},[s]),Ge=C.useCallback((L,G,B,Z)=>{const ie=je.current,oe=it.current,ce=Ze(ie,L);if(!ce)return;const be={w:ce.w,h:ce.h,x:ce.x,y:ce.y,i:L},fe=et(ie,ce,G,B,!0,D,H,A,F);h(fe,oe,ce,be,Z.e,Z.node),ue(N.compact(fe,A)),we(be)},[D,H,A,F,N,h]),$t=C.useCallback((L,G,B,Z)=>{if(!Ee)return;const ie=je.current,oe=it.current,ce=Ze(ie,L);if(!ce)return;const be=et(ie,ce,G,B,!0,D,H,A,F),fe=N.compact(be,A);y(fe,oe,ce,null,Z.e,Z.node);const Se=Ue.current;it.current=null,Ue.current=null,we(null),ue(fe),Se&&!We(Se,fe)&&a(fe)},[Ee,D,H,A,F,N,y,a]),re=C.useCallback((L,G,B,Z)=>{const ie=je.current,oe=Ze(ie,L);oe&&(lt.current=Qe(oe),Ue.current=ie,Wt(!0),S(ie,oe,oe,null,Z.e,Z.node))},[S]),ne=C.useCallback((L,G,B,Z)=>{const ie=je.current,oe=lt.current,{handle:ce}=Z;let be=!1,fe,Se;const[Bt,He]=$n(ie,L,pe=>(fe=pe.x,Se=pe.y,["sw","w","nw","n","ne"].includes(ce)&&(["sw","nw","w"].includes(ce)&&(fe=pe.x+(pe.w-G),G=pe.x!==fe&&fe<0?pe.w:G,fe=fe<0?0:fe),["ne","n","nw"].includes(ce)&&(Se=pe.y+(pe.h-B),B=pe.y!==Se&&Se<0?pe.h:B,Se=Se<0?0:Se),be=!0),D&&!F&&Dr(ie,{...pe,w:G,h:B,x:fe??pe.x,y:Se??pe.y}).filter(Xt=>Xt.i!==pe.i).length>0&&(Se=pe.y,B=pe.h,fe=pe.x,G=pe.w,be=!1),pe.w=G,pe.h=B,pe));if(!He)return;let xt=Bt;be&&fe!==void 0&&Se!==void 0&&(xt=et(Bt,He,fe,Se,!0,D,H,A,F));const Ft={w:He.w,h:He.h,x:He.x,y:He.y,i:L,static:!0};b(xt,oe,He,Ft,Z.e,Z.node),ue(N.compact(xt,A)),we(Ft)},[D,H,A,F,N,b]),he=C.useCallback((L,G,B,Z)=>{const ie=je.current,oe=lt.current,ce=Ze(ie,L),be=N.compact(ie,A);E(be,oe,ce??null,null,Z.e,Z.node);const fe=Ue.current;lt.current=null,Ue.current=null,we(null),Wt(!1),ue(be),fe&&!We(fe,be)&&a(be)},[A,N,E,a]),se=C.useCallback(()=>{const L=je.current;if(!L.some(Z=>Z.i===ae.i)){st(null),we(null),Ne(void 0);return}const B=N.compact(L.filter(Z=>Z.i!==ae.i),A);ue(B),st(null),we(null),Ne(void 0)},[ae.i,A,N]),ve=C.useCallback(L=>{if(L.preventDefault(),L.stopPropagation(),zn&&!L.nativeEvent.target?.classList.contains(Mn))return!1;const G=W?W(L.nativeEvent):x(L);if(G===!1)return Ie&&se(),!1;const{dragOffsetX:B=0,dragOffsetY:Z=0,...ie}=G??{},oe={...ae,...ie},ce=L.currentTarget.getBoundingClientRect(),be={cols:A,margin:U,maxRows:K,rowHeight:$,containerWidth:r,containerPadding:ye},fe=rt(be),Se=nt(oe.w,fe,U[0]),Bt=nt(oe.h,$,U[1]),He=Se/2,xt=Bt/2,Ft=L.clientX-ce.left+B-He,pe=L.clientY-ce.top+Z-xt,wr=Math.max(0,Ft),Xt=Math.max(0,pe),Ut={left:wr/Re,top:Xt/Re,e:L.nativeEvent};if(Ie)Xe&&(Xe.left!==Ut.left||Xe.top!==Ut.top)&&Ne(Ut);else{const Sr=Wn(be,Xt,wr,oe.w,oe.h);st(z.jsx("div",{},oe.i)),Ne(Ut),ue([...je.current,{...oe,x:Sr.x,y:Sr.y,static:!1,isDraggable:!0}])}},[Ie,Xe,ae,W,x,se,Re,A,U,K,$,r,ye]),Pe=C.useCallback(L=>{L.preventDefault(),L.stopPropagation(),Le.current--,Le.current<0&&(Le.current=0),Le.current===0&&se()},[se]),_e=C.useCallback(L=>{L.preventDefault(),L.stopPropagation(),Le.current++},[]),Oe=C.useCallback(L=>{L.preventDefault(),L.stopPropagation();const G=je.current,B=G.find(Z=>Z.i===ae.i);Le.current=0,se(),g(G,B,L.nativeEvent)},[ae.i,se,g]),Me=C.useCallback((L,G)=>{if(!L||!L.key)return null;const B=Ze(de,String(L.key));if(!B)return null;const Z=typeof B.isDraggable=="boolean"?B.isDraggable:!B.static&&le,ie=typeof B.isResizable=="boolean"?B.isResizable:!B.static&&k,oe=B.resizeHandles||[...M],ce=Z&&me&&B.isBounded!==!1,be=X;return z.jsx(Tn,{containerWidth:r,cols:A,margin:U,containerPadding:ye,maxRows:K,rowHeight:$,cancel:f,handle:P,onDragStart:Yt,onDrag:Ge,onDragStop:$t,onResizeStart:re,onResize:ne,onResizeStop:he,isDraggable:Z,isResizable:ie,isBounded:ce,useCSSTransforms:De&&Ce,usePercentages:!Ce,transformScale:Re,positionStrategy:u,dragThreshold:j,w:B.w,h:B.h,x:B.x,y:B.y,i:B.i,minH:B.minH,minW:B.minW,maxH:B.maxH,maxW:B.maxW,static:B.static,droppingPosition:G?Xe:void 0,resizeHandles:oe,resizeHandle:be,constraints:v,layoutItem:B,layout:de,children:L},B.i)},[de,r,A,U,ye,K,$,f,P,Yt,Ge,$t,re,ne,he,le,k,me,De,Ce,Re,u,j,Xe,M,X,v]),ze=()=>Ee?z.jsx(Tn,{w:Ee.w,h:Ee.h,x:Ee.x,y:Ee.y,i:Ee.i,className:`react-grid-placeholder ${ke?"placeholder-resizing":""}`,containerWidth:r,cols:A,margin:U,containerPadding:ye,maxRows:K,rowHeight:$,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:De,transformScale:Re,constraints:v,layout:de,children:z.jsx("div",{})}):null,Ve=Gt(Mn,O),Je={height:xr,..._};return z.jsxs("div",{ref:c,className:Ve,style:Je,onDrop:I?Oe:void 0,onDragLeave:I?Pe:void 0,onDragEnter:I?_e:void 0,onDragOver:I?ve:void 0,children:[C.Children.map(t,L=>C.isValidElement(L)?Me(L):null),I&&Ie&&Me(Ie,!0),ze()]})}var Uo={lg:1200,md:996,sm:768,xs:480,xxs:0},Go={lg:12,md:10,sm:6,xs:4,xxs:2},mr=()=>{};function Vo(e,t,r,n){const o=[];C.Children.forEach(t,l=>{if(!C.isValidElement(l)||l.key===null)return;const u=String(l.key),d=e.find(v=>v.i===u);if(d)o.push({...d,i:u});else{const m=l.props["data-grid"];m?o.push({i:u,x:m.x??0,y:m.y??0,w:m.w??1,h:m.h??1,minW:m.minW,maxW:m.maxW,minH:m.minH,maxH:m.maxH,static:m.static,isDraggable:m.isDraggable,isResizable:m.isResizable,resizeHandles:m.resizeHandles,isBounded:m.isBounded}):o.push({i:u,x:0,y:Pt(o),w:1,h:1})}});const i=Zt(o,{cols:r});return n.compact(i,r)}function Jo(e){const{children:t,width:r,breakpoint:n,breakpoints:o=Uo,cols:i=Go,layouts:l={},rowHeight:u=150,maxRows:d=1/0,margin:v=[10,10],containerPadding:m=null,compactor:p,onBreakpointChange:w=mr,onLayoutChange:O=mr,onWidthChange:_=mr,...c}=e,a=p??or("vertical"),s=a.type,h=a.allowOverlap,y=C.useMemo(()=>n??qr(o,r),[]),S=C.useMemo(()=>Hr(y,i),[y,i]),b=C.useMemo(()=>ar(l,o,y,y,S,s),[]),[E,g]=C.useState(y),[x,R]=C.useState(S),[Y,q]=C.useState(b),[V,A]=C.useState(l),$=C.useRef(r),K=C.useRef(n),U=C.useRef(o),J=C.useRef(i),le=C.useRef(l),me=C.useRef(s),P=C.useRef(V);C.useEffect(()=>{P.current=V},[V]);const f=C.useMemo(()=>We(l,le.current)?null:ar(l,o,E,E,x,a),[l,o,E,x,a]),j=f??Y;C.useEffect(()=>{f!==null&&(q(f),A(l),P.current=l,le.current=l)},[f,l]),C.useEffect(()=>{if(s!==me.current){const T=a.compact($e(j),x),W={...P.current,[E]:T};q(T),A(W),P.current=W,O(T,W),me.current=s}},[s,a,j,x,h,E,O]),C.useEffect(()=>{const T=r!==$.current,W=n!==K.current,N=!We(o,U.current),H=!We(i,J.current);if(T||W||N||H){const F=n??qr(o,r),D=Hr(F,i),ae=E;if(ae!==F||N||H){const ye={...P.current};ye[ae]||(ye[ae]=$e(Y));let Ce=ar(ye,o,F,ae,D,a);Ce=Vo(Ce,t,D,a),ye[F]=Ce,g(F),R(D),q(Ce),A(ye),P.current=ye,w(F,D),O(Ce,ye)}const De=Dt(v,F),Re=m?Dt(m,F):null;_(r,De,D,Re),$.current=r,K.current=n,U.current=o,J.current=i}},[r,n,o,i,E,x,Y,t,a,s,h,v,m,w,O,_]);const k=C.useCallback(T=>{const N={...P.current,[E]:T};q(T),A(N),P.current=N,O(T,N)},[E,O]),M=C.useMemo(()=>Dt(v,E),[v,E]),X=C.useMemo(()=>m===null?null:Dt(m,E),[m,E]),I=C.useMemo(()=>({cols:x,rowHeight:u,maxRows:d,margin:M,containerPadding:X}),[x,u,d,M,X]);return z.jsx(Xo,{...c,width:r,gridConfig:I,compactor:a,onLayoutChange:k,layout:j,children:t})}const Ko=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],yr=({schema:e,className:t,onLayoutChange:r,persistLayoutKey:n="dashboard-layout"})=>{const{width:o,containerRef:i,mounted:l}=jo(),[u,d]=tt.useState(!1),[v,m]=tt.useState(()=>{if(typeof window<"u"&&n){const c=localStorage.getItem(n);if(c)try{return JSON.parse(c)}catch(a){console.error("Failed to parse saved layout:",a)}}return{lg:e.widgets?.map((c,a)=>({i:c.id||`widget-${a}`,x:c.layout?.x||a%4*3,y:c.layout?.y||Math.floor(a/4)*4,w:c.layout?.w||3,h:c.layout?.h||4}))||[]}}),p=tt.useCallback((c,a)=>{m(a),r?.(c)},[r]),w=tt.useCallback(()=>{typeof window<"u"&&n&&localStorage.setItem(n,JSON.stringify(v)),d(!1)},[v,n]),O=tt.useCallback(()=>{const c={lg:e.widgets?.map((a,s)=>({i:a.id||`widget-${s}`,x:a.layout?.x||s%4*3,y:a.layout?.y||Math.floor(s/4)*4,w:a.layout?.w||3,h:a.layout?.h||4}))||[]};m(c),typeof window<"u"&&n&&localStorage.removeItem(n)},[e.widgets,n]),_=tt.useCallback(c=>{if(c.component)return c.component;const a=c.type;if(a==="bar"||a==="line"||a==="area"||a==="pie"||a==="donut"){const s=Array.isArray(c.data)?c.data:c.data?.items||[],h=c.options||{},y=h.xField||"name",S=h.yField||"value";return{type:"chart",chartType:a,data:s,xAxisKey:y,series:[{dataKey:S}],colors:Ko,className:"h-full"}}return a==="table"?{type:"data-table",...c.options,data:c.data?.items||[],searchable:!1,pagination:!1,className:"border-0"}:c},[]);return z.jsxs("div",{ref:i,className:Q.cn("w-full",t),"data-testid":"grid-layout",children:[z.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[z.jsx("h2",{className:"text-2xl font-bold",children:e.title||"Dashboard"}),z.jsx("div",{className:"flex gap-2",children:u?z.jsxs(z.Fragment,{children:[z.jsxs(Q.Button,{onClick:w,size:"sm",variant:"default",children:[z.jsx(Te.Save,{className:"h-4 w-4 mr-2"}),"Save Layout"]}),z.jsxs(Q.Button,{onClick:O,size:"sm",variant:"outline",children:[z.jsx(Te.X,{className:"h-4 w-4 mr-2"}),"Reset"]}),z.jsx(Q.Button,{onClick:()=>d(!1),size:"sm",variant:"ghost",children:"Cancel"})]}):z.jsxs(Q.Button,{onClick:()=>d(!0),size:"sm",variant:"outline",children:[z.jsx(Te.Edit,{className:"h-4 w-4 mr-2"}),"Edit Layout"]})})]}),l&&z.jsx(Jo,{className:"layout",width:o,layouts:v,breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},rowHeight:60,dragConfig:{enabled:u,handle:".drag-handle"},resizeConfig:{enabled:u},onLayoutChange:p,children:e.widgets?.map((c,a)=>{const s=c.id||`widget-${a}`,h=_(c),y=c.type==="metric";return z.jsx("div",{className:"h-full",children:y?z.jsxs("div",{className:"h-full w-full relative",children:[u&&z.jsx("div",{className:"drag-handle absolute top-2 right-2 z-10 cursor-move p-1 bg-background/80 rounded border border-border",children:z.jsx(Te.GripVertical,{className:"h-4 w-4"})}),z.jsx(wt.SchemaRenderer,{schema:h,className:"h-full w-full"})]}):z.jsxs(Q.Card,{className:Q.cn("h-full overflow-hidden border-border/50 shadow-sm transition-all","bg-card/50 backdrop-blur-sm",u&&"ring-2 ring-primary/20"),children:[c.title&&z.jsxs(Q.CardHeader,{className:"pb-2 border-b border-border/40 bg-muted/20 flex flex-row items-center justify-between",children:[z.jsx(Q.CardTitle,{className:"text-base font-medium tracking-tight truncate",title:c.title,children:c.title}),u&&z.jsx("div",{className:"drag-handle cursor-move p-1 hover:bg-muted/40 rounded",children:z.jsx(Te.GripVertical,{className:"h-4 w-4"})})]}),z.jsx(Q.CardContent,{className:"p-0 h-full",children:z.jsx("div",{className:Q.cn("h-full w-full overflow-auto p-4"),children:z.jsx(wt.SchemaRenderer,{schema:h})})})]})},s)})})]})},vr=({label:e,value:t,trend:r,icon:n,className:o,description:i,...l})=>{const u=C.useMemo(()=>{if(typeof n=="string"){const d=Pr[n];return d?z.jsx(d,{className:"h-4 w-4 text-muted-foreground"}):null}return n},[n]);return z.jsxs(Q.Card,{className:Q.cn("h-full",o),...l,children:[z.jsxs(Q.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[z.jsx(Q.CardTitle,{className:"text-sm font-medium",children:e}),u&&z.jsx("div",{className:"h-4 w-4 text-muted-foreground",children:u})]}),z.jsxs(Q.CardContent,{children:[z.jsx("div",{className:"text-2xl font-bold",children:t}),(r||i)&&z.jsxs("p",{className:"text-xs text-muted-foreground flex items-center mt-1",children:[r&&z.jsxs("span",{className:Q.cn("flex items-center mr-2",r.direction==="up"&&"text-green-500",r.direction==="down"&&"text-red-500",r.direction==="neutral"&&"text-yellow-500"),children:[r.direction==="up"&&z.jsx(Te.ArrowUpIcon,{className:"h-3 w-3 mr-1"}),r.direction==="down"&&z.jsx(Te.ArrowDownIcon,{className:"h-3 w-3 mr-1"}),r.direction==="neutral"&&z.jsx(Te.MinusIcon,{className:"h-3 w-3 mr-1"}),r.value,"%"]}),i||r?.label]})]})]})},br=({title:e,value:t,icon:r,trend:n,trendValue:o,description:i,className:l,...u})=>{const d=r&&Pr[r];return z.jsxs(Q.Card,{className:Q.cn("h-full",l),...u,children:[z.jsxs(Q.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[z.jsx(Q.CardTitle,{className:"text-sm font-medium",children:e}),d&&z.jsx(d,{className:"h-4 w-4 text-muted-foreground"})]}),z.jsxs(Q.CardContent,{children:[z.jsx("div",{className:"text-2xl font-bold",children:t}),(n||o||i)&&z.jsxs("p",{className:"text-xs text-muted-foreground flex items-center mt-1",children:[n&&o&&z.jsxs("span",{className:Q.cn("flex items-center mr-2",n==="up"&&"text-green-500",n==="down"&&"text-red-500",n==="neutral"&&"text-yellow-500"),children:[n==="up"&&z.jsx(Te.ArrowUpIcon,{className:"h-3 w-3 mr-1"}),n==="down"&&z.jsx(Te.ArrowDownIcon,{className:"h-3 w-3 mr-1"}),n==="neutral"&&z.jsx(Te.MinusIcon,{className:"h-3 w-3 mr-1"}),o]}),i]})]})]})};Ye.ComponentRegistry.register("dashboard",Vt,{namespace:"view",label:"Dashboard",category:"Complex",icon:"layout-dashboard",inputs:[{name:"columns",type:"number",label:"Columns",defaultValue:3},{name:"gap",type:"number",label:"Gap",defaultValue:4},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:3,widgets:[]}}),Ye.ComponentRegistry.register("metric",vr,{namespace:"plugin-dashboard",label:"Metric Widget",category:"Dashboard",inputs:[{name:"label",type:"string",label:"Label"},{name:"value",type:"string",label:"Value"}]}),Ye.ComponentRegistry.register("metric-card",br,{namespace:"plugin-dashboard",label:"Metric Card",category:"Dashboard",inputs:[{name:"title",type:"string",label:"Title"},{name:"value",type:"string",label:"Value",required:!0},{name:"icon",type:"string",label:"Icon (Lucide name)"},{name:"trend",type:"enum",label:"Trend",enum:[{label:"Up",value:"up"},{label:"Down",value:"down"},{label:"Neutral",value:"neutral"}]},{name:"trendValue",type:"string",label:"Trend Value (e.g., +12%)"},{name:"description",type:"string",label:"Description"}],defaultProps:{title:"Metric",value:"0"}}),Ye.ComponentRegistry.register("dashboard-grid",yr,{namespace:"plugin-dashboard",label:"Dashboard Grid (Editable)",category:"Complex",icon:"layout-grid",inputs:[{name:"title",type:"string",label:"Title"},{name:"persistLayoutKey",type:"string",label:"Layout Storage Key",defaultValue:"dashboard-layout"},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{title:"Dashboard",widgets:[],persistLayoutKey:"dashboard-layout"}});const Zo={DashboardRenderer:Vt,DashboardGridLayout:yr,MetricWidget:vr,MetricCard:br};xe.DashboardGridLayout=yr,xe.DashboardRenderer=Vt,xe.MetricCard=br,xe.MetricWidget=vr,xe.dashboardComponents=Zo,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})}));
|