@object-ui/plugin-dashboard 0.5.0 → 3.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 +34 -0
- package/dist/index.css +1 -1
- package/dist/index.js +3612 -4764
- package/dist/index.umd.cjs +5 -5
- package/dist/src/DashboardGridLayout.d.ts +3 -1
- package/dist/src/DashboardGridLayout.d.ts.map +1 -1
- package/dist/src/DashboardRenderer.d.ts +6 -3
- package/dist/src/DashboardRenderer.d.ts.map +1 -1
- package/dist/src/DashboardRenderer.stories.d.ts +24 -0
- package/dist/src/DashboardRenderer.stories.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -12
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/DashboardGridLayout.tsx +122 -68
- package/src/DashboardRenderer.stories.tsx +173 -0
- package/src/DashboardRenderer.tsx +161 -99
- package/src/__tests__/DashboardRenderer.autoRefresh.test.tsx +124 -0
- 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,E,rt,V,Re,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 ke=Er(E),Pr=Er(Re);var St={exports:{}},ct={};var Or;function Nn(){if(Or)return ct;Or=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,s){var l=null;if(s!==void 0&&(l=""+s),o.key!==void 0&&(l=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:n,key:l,ref:o!==void 0?o:null,props:s}}return ct.Fragment=t,ct.jsx=r,ct.jsxs=r,ct}var ft={};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 g:return"Profiler";case i:return"StrictMode";case w:return"Suspense";case p:return"SuspenseList";case H: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 y:return"Portal";case S:return f.displayName||"Context";case b:return(f._context.displayName||"Context")+".Consumer";case u: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,z=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.",z),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=J.A;return f===null?null:f.getOwner()}function s(){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 d(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 c(){var f=e(this.type);return K[f]||(K[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,z,X,I){var M=k.ref;return f={$$typeof:D,type:f,key:j,props:k,_owner:z},(M!==void 0?M:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:c}):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,z,X,I){var M=j.children;if(M!==void 0)if(z)if(Y(M)){for(z=0;z<M.length;z++)h(M[z]);Object.freeze&&Object.freeze(M)}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 h(M);if(A.call(j,"key")){M=e(f);var W=Object.keys(j).filter(function($){return $!=="key"});z=0<W.length?"{key: someKey, "+W.join(": ..., ")+": ...}":"{key: someKey}",O[M+z]||(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} />`,z,M,W,M),O[M+z]=!0)}if(M=null,k!==void 0&&(r(k),M=""+k),l(j)&&(r(j.key),M=""+j.key),"key"in j){k={};for(var N in j)N!=="key"&&(k[N]=j[N])}else k=j;return M&&d(k,typeof f=="function"?f.displayName||f.name||"Unknown":f),v(f,M,k,o(),X,I)}function h(f){C(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===R&&(f._payload.status==="fulfilled"?C(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function C(f){return typeof f=="object"&&f!==null&&f.$$typeof===D}var P=E,D=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),S=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),q=Symbol.for("react.client.reference"),J=P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,Y=Array.isArray,Z=console.createTask?console.createTask:function(){return null};P={react_stack_bottom_frame:function(f){return f()}};var U,K={},le=P.react_stack_bottom_frame.bind(P,s)(),me=Z(n(s)),O={};ft.Fragment=a,ft.jsx=function(f,j,k){var z=1e4>J.recentlyCreatedOwnerStacks++;return m(f,j,k,!1,z?Error("react-stack-top-frame"):le,z?Z(n(f)):me)},ft.jsxs=function(f,j,k){var z=1e4>J.recentlyCreatedOwnerStacks++;return m(f,j,k,!0,z?Error("react-stack-top-frame"):le,z?Z(n(f)):me)}})()),ft}var Dr;function In(){return Dr||(Dr=1,process.env.NODE_ENV==="production"?St.exports=Nn():St.exports=An()),St.exports}var T=In();const Ln=["hsl(var(--chart-1))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],Vt=E.forwardRef(({schema:e,className:t,dataSource:r,onRefresh:n,...o},s)=>{const l=e.columns||4,d=e.gap||4,[c,v]=E.useState(!1),[m,h]=E.useState(!1),C=E.useRef(null);E.useEffect(()=>{const a=()=>h(window.innerWidth<640);return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const P=E.useCallback(()=>{n&&(v(!0),n(),setTimeout(()=>v(!1),600))},[n]);E.useEffect(()=>{if(!(!e.refreshInterval||e.refreshInterval<=0||!n))return C.current=setInterval(P,e.refreshInterval*1e3),()=>{C.current&&clearInterval(C.current)}},[e.refreshInterval,n,P]);const D=a=>{const g=(()=>{if(a.component)return a.component;const S=a.type;if(S==="bar"||S==="line"||S==="area"||S==="pie"||S==="donut"){const u=Array.isArray(a.data)?a.data:a.data?.items||[],w=a.options||{},p=w.xField||"name",x=w.yField||"value";return{type:"chart",chartType:S,data:u,xAxisKey:p,series:[{dataKey:x}],colors:Ln,className:"h-[200px] sm:h-[250px] md:h-[300px]"}}return S==="table"?{type:"data-table",...a.options,data:a.data?.items||[],searchable:!1,pagination:!1,className:"border-0"}:{...a,...a.options||{}}})();return a.type==="metric"?T.jsx("div",{className:V.cn("h-full w-full",m&&"w-[85vw] shrink-0 snap-center"),style:!m&&a.layout?{gridColumn:`span ${a.layout.w}`,gridRow:`span ${a.layout.h}`}:void 0,children:T.jsx(rt.SchemaRenderer,{schema:g,className:"h-full w-full"})},a.id||a.title):T.jsxs(V.Card,{className:V.cn("overflow-hidden border-border/50 shadow-sm transition-all hover:shadow-md","bg-card/50 backdrop-blur-sm",m&&"w-[85vw] shrink-0 snap-center"),style:!m&&a.layout?{gridColumn:`span ${a.layout.w}`,gridRow:`span ${a.layout.h}`}:void 0,children:[a.title&&T.jsx(V.CardHeader,{className:"pb-2 border-b border-border/40 bg-muted/20 px-3 sm:px-6",children:T.jsx(V.CardTitle,{className:"text-sm sm:text-base font-medium tracking-tight truncate",title:a.title,children:a.title})}),T.jsx(V.CardContent,{className:"p-0",children:T.jsx("div",{className:V.cn("h-full w-full","p-3 sm:p-4 md:p-6"),children:T.jsx(rt.SchemaRenderer,{schema:g})})})]},a.id||a.title)},y=n&&T.jsx("div",{className:V.cn(m?"flex justify-end mb-2":"col-span-full flex justify-end mb-2"),children:T.jsxs(V.Button,{variant:"outline",size:"sm",onClick:P,disabled:c,"aria-label":"Refresh dashboard",children:[T.jsx(Re.RefreshCw,{className:V.cn("h-4 w-4 mr-2",c&&"animate-spin")}),c?"Refreshing…":"Refresh All"]})});return m?T.jsxs("div",{ref:s,className:V.cn("flex flex-col",t),...o,children:[y,T.jsx("div",{className:"flex overflow-x-auto snap-x snap-mandatory gap-3 pb-4 [-webkit-overflow-scrolling:touch]",style:{scrollPaddingLeft:"0.75rem"},children:e.widgets?.map(a=>D(a))})]}):T.jsxs("div",{ref:s,className:V.cn("grid auto-rows-min","grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",t),style:{...l>4&&{gridTemplateColumns:`repeat(${l}, minmax(0, 1fr))`},gap:`${d*.25}rem`},...o,children:[y,e.widgets?.map(a=>D(a))]})});function nt(e){const{margin:t,containerPadding:r,containerWidth:n,cols:o}=e;return(n-t[0]*(o-1)-r[0]*2)/o}function ot(e,t,r){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*r):e}function dt(e,t,r,n,o,s,l){const{margin:d,containerPadding:c,rowHeight:v}=e,m=nt(e);let h,C,P,D;if(l?(h=Math.round(l.width),C=Math.round(l.height)):(h=ot(n,m,d[0]),C=ot(o,v,d[1])),s?(P=Math.round(s.top),D=Math.round(s.left)):l?(P=Math.round(l.top),D=Math.round(l.left)):(P=Math.round((v+d[1])*r+c[1]),D=Math.round((m+d[0])*t+c[0])),!s&&!l){if(Number.isFinite(n)){const a=Math.round((m+d[0])*(t+n)+c[0])-D-h;a!==d[0]&&(h+=a-d[0])}if(Number.isFinite(o)){const a=Math.round((v+d[1])*(r+o)+c[1])-P-C;a!==d[1]&&(C+=a-d[1])}}return{top:P,left:D,width:h,height:C}}function Wn(e,t,r,n,o){const{margin:s,containerPadding:l,cols:d,rowHeight:c,maxRows:v}=e,m=nt(e);let h=Math.round((r-l[0])/(m+s[0])),C=Math.round((t-l[1])/(c+s[1]));return h=Et(h,0,d-n),C=Et(C,0,v-o),{x:h,y:C}}function Ct(e,t,r){const{margin:n,containerPadding:o,rowHeight:s}=e,l=nt(e),d=Math.round((r-o[0])/(l+n[0])),c=Math.round((t-o[1])/(s+n[1]));return{x:d,y:c}}function qn(e,t,r){const{margin:n,rowHeight:o}=e,s=nt(e),l=Math.max(1,Math.round((t+n[0])/(s+n[0]))),d=Math.max(1,Math.round((r+n[1])/(o+n[1])));return{w:l,h:d}}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 Ze(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n!==void 0&&Jt(n,t))return n}}function _r(e,t){return e.filter(r=>Jt(r,t))}function $n(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 Qe(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 et(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 Be(e){const t=new Array(e.length);for(let r=0;r<e.length;r++){const n=e[r];n!==void 0&&(t[r]=et(n))}return t}function Hn(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 Yn(e,t,r){let n=Qe(e,t);return n?(n=r(et(n)),[Hn(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(;Ze(r,o);)o.y++}return e}function tt(e,t,r,n,o,s,l,d,c){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 h=$n(e,l);(l==="vertical"&&typeof n=="number"?m>=n:l==="horizontal"&&typeof r=="number"&&v>=r)&&(h=h.reverse());const P=_r(h,t),D=P.length>0;if(D&&c)return Be(e);if(D&&s)return t.x=v,t.y=m,t.moved=!1,e;let y=[...e];for(let a=0;a<P.length;a++){const i=P[a];i!==void 0&&(i.moved||(i.static?y=Tr(y,i,t,o,l):y=Tr(y,t,i,o,l)))}return y}function Tr(e,t,r,n,o,s){const l=o==="horizontal",d=o==="vertical",c=t.static;if(n){n=!1;const h={x:l?Math.max(t.x-r.w,0):r.x,y:d?Math.max(t.y-r.h,0):r.y,w:r.w,h:r.h,i:"-1"},C=Ze(e,h),P=C!==void 0&&C.y+C.h>t.y,D=C!==void 0&&t.x+t.w>C.x;if(!C)return tt(e,r,l?h.x:void 0,d?h.y:void 0,n,c,o);if(P&&d)return tt(e,r,void 0,r.y+1,n,c,o);if(P&&o===null)return t.y=r.y,r.y=r.y+r.h,[...e];if(D&&l)return tt(e,t,r.x,void 0,n,c,o)}const v=l?r.x+1:void 0,m=d?r.y+1:void 0;return v===void 0&&m===void 0?[...e]:tt(e,r,v,m,n,c,o)}function at(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:at(t,0,Math.max(0,n-e.w)),y:at(r,0,Math.max(0,o-e.h))}},constrainSize(e,t,r,n,{cols:o,maxRows:s}){const l=n==="w"||n==="nw"||n==="sw"?e.x+e.w:o-e.x,d=n==="n"||n==="nw"||n==="ne"?e.y+e.h:s-e.y;return{w:at(t,1,Math.max(1,l)),h:at(r,1,Math.max(1,d))}}},Fn={name:"minMaxSize",constrainSize(e,t,r){return{w:at(t,e.minW??1,e.maxW??1/0),h:at(r,e.minH??1,e.maxH??1/0)}}},Mr=[Bn,Fn];function Rt(e,t,r,n,o){let s={x:r,y:n};for(const l of e)l.constrainPosition&&(s=l.constrainPosition(t,s.x,s.y,o));if(t.constraints)for(const l of t.constraints)l.constrainPosition&&(s=l.constrainPosition(t,s.x,s.y,o));return s}function Xn(e,t,r,n,o,s){let l={w:r,h:n};for(const d of e)d.constrainSize&&(l=d.constrainSize(t,l.w,l.h,o,s));if(t.constraints)for(const d of t.constraints)d.constrainSize&&(l=d.constrainSize(t,l.w,l.h,o,s));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 Dt(e){return Math.max(0,e)}var Qt=(e,t,r)=>{const{left:n,height:o,width:s}=t,l=e.top-(o-e.height);return{left:n,width:s,height:Nr(l,e.height,o),top:Dt(l)}},er=(e,t,r)=>{const{top:n,left:o,height:s,width:l}=t;return{top:n,height:s,width:Gn(e.left,e.width,l,r),left:Vn(o)}},tr=(e,t,r)=>{const{top:n,height:o,width:s}=t,l=e.left+e.width-s;return l<0?{height:o,width:e.left+e.width,top:Dt(n),left:0}:{height:o,width:s,top:Dt(n),left:l}},rr=(e,t,r)=>{const{top:n,left:o,height:s,width:l}=t;return{width:l,left:o,height:Nr(n,e.height,s),top:Dt(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 s=n==="x"?"w":"h";t[n]+=1;const l=e.findIndex(c=>c.i===t.i),d=o??Ot(e).length>0;for(let c=l+1;c<e.length;c++){const v=e[c];if(v!==void 0&&!v.static){if(!d&&v.y>t.y+t.h)break;Jt(t,v)&&nr(e,v,r+t[s],n,d)}}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&&!Ze(e,t);)t.y--;let o;for(;(o=Ze(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&&!Ze(e,t);)t.x--;let o;for(;(o=Ze(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&&!Ze(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),s=new Array(e.length);for(let l=0;l<o.length;l++){const d=o[l];if(d===void 0)continue;let c=et(d);c.static||(c=lo(r,c,o,n),n=Math.max(n,c.y+c.h),r.push(c));const v=e.indexOf(d);s[v]=c,c.moved=!1}return s}},Ir={type:"horizontal",allowOverlap:!1,compact(e,t){const r=Ot(e),n=jr(e),o=new Array(e.length);for(let s=0;s<n.length;s++){const l=n[s];if(l===void 0)continue;let d=et(l);d.static||(d=uo(r,d,t,n),r.push(d));const c=e.indexOf(l);o[c]=d,d.moved=!1}return o}},Lr={type:null,allowOverlap:!1,compact(e,t){return Be(e)}},co={...Ar,allowOverlap:!0,compact(e,t){return Be(e)}},fo={...Ir,allowOverlap:!0,compact(e,t){return Be(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 s=r[o];if(s===void 0)continue;const l=e[s];t>l&&(n=s)}return n}function $r(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,s){const l=e[r];if(l)return Be(l);let d=e[n];const c=Wr(t),v=c.slice(c.indexOf(r));for(let P=0;P<v.length;P++){const D=v[P];if(D===void 0)continue;const y=e[D];if(y){d=y;break}}const m=Be(d||[]),h=Zt(m,{cols:o});return(typeof s=="object"&&s!==null?s:or(s)).compact(h,o)}function _t(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 s of o){const l=r[s];if(l!==void 0)return l}return[10,10]}function Hr(e){return function(r,n,o,s,l,d,c){return e(r,n,c)}}function jt(e){return function(r,n,o,s){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o,s);var l=s.get(r),d=s.get(n);if(l&&d)return l===n&&d===r;s.set(r,n),s.set(n,r);var c=e(r,n,o,s);return s.delete(r),s.delete(n),c}}function Yr(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,s=e.areRegExpsEqual,l=e.areSetsEqual,d=e.createIsNestedEqual,c=d(v);function v(m,h,C){if(m===h)return!0;if(!m||!h||typeof m!="object"||typeof h!="object")return m!==m&&h!==h;if(Br(m)&&Br(h))return o(m,h,c,C);var P=Array.isArray(m),D=Array.isArray(h);if(P||D)return P===D&&t(m,h,c,C);var y=Xr.call(m);return y!==Xr.call(h)?!1:y===mo?r(m,h,c,C):y===yo?s(m,h,c,C):y===vo?n(m,h,c,C):y===wo?l(m,h,c,C):y===xo||y===ho?Fr(m)||Fr(h)?!1:o(m,h,c,C):y===go||y===bo||y===So?Tt(m.valueOf(),h.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 s={},l=0;return e.forEach(function(d,c){if(o){var v=!1,m=0;t.forEach(function(h,C){!v&&!s[m]&&(v=r(c,C,l,m,e,t,n)&&r(d,h,c,C,e,t,n))&&(s[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),s=o.length;if(Object.keys(t).length!==s)return!1;for(var l;s-- >0;){if(l=o[s],l===Po){var d=!!e.$$typeof,c=!!t.$$typeof;if((d||c)&&d!==c)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 s={};return e.forEach(function(l,d){if(o){var c=!1,v=0;t.forEach(function(m,h){!c&&!s[v]&&(c=r(l,m,d,h,e,t,n))&&(s[v]=!0),v++}),o=c}}),o}var Do=jt(Zr),Qr=Object.freeze({areArraysEqual:Ur,areDatesEqual:Gr,areMapsEqual:Vr,areObjectsEqual:Jr,areRegExpsEqual:Kr,areSetsEqual:Zr,createIsNestedEqual:Hr}),en=Object.freeze({areArraysEqual:Co,areDatesEqual:Gr,areMapsEqual:Eo,areObjectsEqual:Ro,areRegExpsEqual:Kr,areSetsEqual:Do,createIsNestedEqual:Hr}),_o=Mt(Qr);function qe(e,t){return _o(e,t,void 0)}Mt(Yr(Qr,{createIsNestedEqual:function(){return Tt}})),Mt(en),Mt(Yr(en,{createIsNestedEqual:function(){return Tt}}));function jo(e={}){const{measureBeforeMount:t=!1,initialWidth:r=1280}=e,[n,o]=E.useState(r),[s,l]=E.useState(!t),d=E.useRef(null),c=E.useRef(null),v=E.useCallback(()=>{const m=d.current;if(m){const h=m.offsetWidth;o(h),s||l(!0)}},[s]);return E.useEffect(()=>{const m=d.current;if(m)return v(),typeof ResizeObserver<"u"&&(c.current=new ResizeObserver(h=>{const C=h[0];if(C){const P=C.contentRect.width;o(P)}}),c.current.observe(m)),()=>{c.current&&(c.current.disconnect(),c.current=null)}},[v]),{width:n,mounted:s,containerRef:d,measureWidth:v}}var pt={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,s=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,C=e?Symbol.for("react.suspense_list"):60120,P=e?Symbol.for("react.memo"):60115,D=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,a=e?Symbol.for("react.fundamental"):60117,i=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(u){if(typeof u=="object"&&u!==null){var w=u.$$typeof;switch(w){case t:switch(u=u.type,u){case c:case v:case n:case s:case o:case h:return u;default:switch(u=u&&u.$$typeof,u){case d:case m:case D:case P:case l:return u;default:return w}}case r:return w}}}function S(u){return b(u)===v}return ee.AsyncMode=c,ee.ConcurrentMode=v,ee.ContextConsumer=d,ee.ContextProvider=l,ee.Element=t,ee.ForwardRef=m,ee.Fragment=n,ee.Lazy=D,ee.Memo=P,ee.Portal=r,ee.Profiler=s,ee.StrictMode=o,ee.Suspense=h,ee.isAsyncMode=function(u){return S(u)||b(u)===c},ee.isConcurrentMode=S,ee.isContextConsumer=function(u){return b(u)===d},ee.isContextProvider=function(u){return b(u)===l},ee.isElement=function(u){return typeof u=="object"&&u!==null&&u.$$typeof===t},ee.isForwardRef=function(u){return b(u)===m},ee.isFragment=function(u){return b(u)===n},ee.isLazy=function(u){return b(u)===D},ee.isMemo=function(u){return b(u)===P},ee.isPortal=function(u){return b(u)===r},ee.isProfiler=function(u){return b(u)===s},ee.isStrictMode=function(u){return b(u)===o},ee.isSuspense=function(u){return b(u)===h},ee.isValidElementType=function(u){return typeof u=="string"||typeof u=="function"||u===n||u===v||u===s||u===o||u===h||u===C||typeof u=="object"&&u!==null&&(u.$$typeof===D||u.$$typeof===P||u.$$typeof===l||u.$$typeof===d||u.$$typeof===m||u.$$typeof===a||u.$$typeof===i||u.$$typeof===g||u.$$typeof===y)},ee.typeOf=b,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,s=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,d=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,v=e?Symbol.for("react.concurrent_mode"):60111,m=e?Symbol.for("react.forward_ref"):60112,h=e?Symbol.for("react.suspense"):60113,C=e?Symbol.for("react.suspense_list"):60120,P=e?Symbol.for("react.memo"):60115,D=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,a=e?Symbol.for("react.fundamental"):60117,i=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function b(_){return typeof _=="string"||typeof _=="function"||_===n||_===v||_===s||_===o||_===h||_===C||typeof _=="object"&&_!==null&&(_.$$typeof===D||_.$$typeof===P||_.$$typeof===l||_.$$typeof===d||_.$$typeof===m||_.$$typeof===a||_.$$typeof===i||_.$$typeof===g||_.$$typeof===y)}function S(_){if(typeof _=="object"&&_!==null){var ae=_.$$typeof;switch(ae){case t:var je=_.type;switch(je){case c:case v:case n:case s:case o:case h:return je;default:var De=je&&je.$$typeof;switch(De){case d:case m:case D:case P:case l:return De;default:return ae}}case r:return ae}}}var u=c,w=v,p=d,x=l,R=t,H=m,q=n,J=D,A=P,Y=r,Z=s,U=o,K=h,le=!1;function me(_){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.")),O(_)||S(_)===c}function O(_){return S(_)===v}function f(_){return S(_)===d}function j(_){return S(_)===l}function k(_){return typeof _=="object"&&_!==null&&_.$$typeof===t}function z(_){return S(_)===m}function X(_){return S(_)===n}function I(_){return S(_)===D}function M(_){return S(_)===P}function W(_){return S(_)===r}function N(_){return S(_)===s}function $(_){return S(_)===o}function F(_){return S(_)===h}te.AsyncMode=u,te.ConcurrentMode=w,te.ContextConsumer=p,te.ContextProvider=x,te.Element=R,te.ForwardRef=H,te.Fragment=q,te.Lazy=J,te.Memo=A,te.Portal=Y,te.Profiler=Z,te.StrictMode=U,te.Suspense=K,te.isAsyncMode=me,te.isConcurrentMode=O,te.isContextConsumer=f,te.isContextProvider=j,te.isElement=k,te.isForwardRef=z,te.isFragment=X,te.isLazy=I,te.isMemo=M,te.isPortal=W,te.isProfiler=N,te.isStrictMode=$,te.isSuspense=F,te.isValidElementType=b,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(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function o(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var l={},d=0;d<10;d++)l["_"+String.fromCharCode(d)]=d;var c=Object.getOwnPropertyNames(l).map(function(m){return l[m]});if(c.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(s,l){for(var d,c=n(s),v,m=1;m<arguments.length;m++){d=Object(arguments[m]);for(var h in d)t.call(d,h)&&(c[h]=d[h]);if(e){v=e(d);for(var C=0;C<v.length;C++)r.call(d,v[C])&&(c[v[C]]=d[v[C]])}}return c},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(s){var l="Warning: "+s;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}}}function o(s,l,d,c,v){if(process.env.NODE_ENV!=="production"){for(var m in s)if(n(s,m)){var h;try{if(typeof s[m]!="function"){var C=Error((c||"React class")+": "+d+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw C.name="Invariant Violation",C}h=s[m](l,m,c,d,null,t)}catch(D){h=D}if(h&&!(h instanceof Error)&&e((c||"React class")+": type specification of "+d+" `"+m+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in r)){r[h.message]=!0;var P=v?v():"";e("Failed "+d+" type: "+h.message+(P??""))}}}}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(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(d){var c="Warning: "+d;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function l(){return null}return dr=function(d,c){var v=typeof Symbol=="function"&&Symbol.iterator,m="@@iterator";function h(O){var f=O&&(v&&O[v]||O[m]);if(typeof f=="function")return f}var C="<<anonymous>>",P={array:i("array"),bigint:i("bigint"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),symbol:i("symbol"),any:g(),arrayOf:b,element:S(),elementType:u(),instanceOf:w,node:H(),objectOf:x,oneOf:p,oneOfType:R,shape:J,exact:A};function D(O,f){return O===f?O!==0||1/O===1/f:O!==O&&f!==f}function y(O,f){this.message=O,this.data=f&&typeof f=="object"?f:{},this.stack=""}y.prototype=Error.prototype;function a(O){if(process.env.NODE_ENV!=="production")var f={},j=0;function k(X,I,M,W,N,$,F){if(W=W||C,$=$||M,F!==r){if(c){var _=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 _.name="Invariant Violation",_}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ae=W+":"+M;!f[ae]&&j<3&&(s("You are manually calling a React.PropTypes validation function for the `"+$+"` 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[M]==null?X?I[M]===null?new y("The "+N+" `"+$+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new y("The "+N+" `"+$+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:O(I,M,W,N,$)}var z=k.bind(null,!1);return z.isRequired=k.bind(null,!0),z}function i(O){function f(j,k,z,X,I,M){var W=j[k],N=U(W);if(N!==O){var $=K(W);return new y("Invalid "+X+" `"+I+"` of type "+("`"+$+"` supplied to `"+z+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return a(f)}function g(){return a(l)}function b(O){function f(j,k,z,X,I){if(typeof O!="function")return new y("Property `"+I+"` of component `"+z+"` has invalid PropType notation inside arrayOf.");var M=j[k];if(!Array.isArray(M)){var W=U(M);return new y("Invalid "+X+" `"+I+"` of type "+("`"+W+"` supplied to `"+z+"`, expected an array."))}for(var N=0;N<M.length;N++){var $=O(M,N,z,X,I+"["+N+"]",r);if($ instanceof Error)return $}return null}return a(f)}function S(){function O(f,j,k,z,X){var I=f[j];if(!d(I)){var M=U(I);return new y("Invalid "+z+" `"+X+"` of type "+("`"+M+"` supplied to `"+k+"`, expected a single ReactElement."))}return null}return a(O)}function u(){function O(f,j,k,z,X){var I=f[j];if(!e.isValidElementType(I)){var M=U(I);return new y("Invalid "+z+" `"+X+"` of type "+("`"+M+"` supplied to `"+k+"`, expected a single ReactElement type."))}return null}return a(O)}function w(O){function f(j,k,z,X,I){if(!(j[k]instanceof O)){var M=O.name||C,W=me(j[k]);return new y("Invalid "+X+" `"+I+"` of type "+("`"+W+"` supplied to `"+z+"`, expected ")+("instance of `"+M+"`."))}return null}return a(f)}function p(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("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])."):s("Invalid argument supplied to oneOf, expected an array.")),l;function f(j,k,z,X,I){for(var M=j[k],W=0;W<O.length;W++)if(D(M,O[W]))return null;var N=JSON.stringify(O,function(F,_){var ae=K(_);return ae==="symbol"?String(_):_});return new y("Invalid "+X+" `"+I+"` of value `"+String(M)+"` "+("supplied to `"+z+"`, expected one of "+N+"."))}return a(f)}function x(O){function f(j,k,z,X,I){if(typeof O!="function")return new y("Property `"+I+"` of component `"+z+"` has invalid PropType notation inside objectOf.");var M=j[k],W=U(M);if(W!=="object")return new y("Invalid "+X+" `"+I+"` of type "+("`"+W+"` supplied to `"+z+"`, expected an object."));for(var N in M)if(n(M,N)){var $=O(M,N,z,X,I+"."+N,r);if($ instanceof Error)return $}return null}return a(f)}function R(O){if(!Array.isArray(O))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var f=0;f<O.length;f++){var j=O[f];if(typeof j!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(j)+" at index "+f+"."),l}function k(z,X,I,M,W){for(var N=[],$=0;$<O.length;$++){var F=O[$],_=F(z,X,I,M,W,r);if(_==null)return null;_.data&&n(_.data,"expectedType")&&N.push(_.data.expectedType)}var ae=N.length>0?", expected one of type ["+N.join(", ")+"]":"";return new y("Invalid "+M+" `"+W+"` supplied to "+("`"+I+"`"+ae+"."))}return a(k)}function H(){function O(f,j,k,z,X){return Y(f[j])?null:new y("Invalid "+z+" `"+X+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return a(O)}function q(O,f,j,k,z){return new y((O||"React class")+": "+f+" type `"+j+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+z+"`.")}function J(O){function f(j,k,z,X,I){var M=j[k],W=U(M);if(W!=="object")return new y("Invalid "+X+" `"+I+"` of type `"+W+"` "+("supplied to `"+z+"`, expected `object`."));for(var N in O){var $=O[N];if(typeof $!="function")return q(z,X,I,N,K($));var F=$(M,N,z,X,I+"."+N,r);if(F)return F}return null}return a(f)}function A(O){function f(j,k,z,X,I){var M=j[k],W=U(M);if(W!=="object")return new y("Invalid "+X+" `"+I+"` of type `"+W+"` "+("supplied to `"+z+"`, expected `object`."));var N=t({},j[k],O);for(var $ in N){var F=O[$];if(n(O,$)&&typeof F!="function")return q(z,X,I,$,K(F));if(!F)return new y("Invalid "+X+" `"+I+"` key `"+$+"` supplied to `"+z+"`.\nBad object: "+JSON.stringify(j[k],null," ")+`
|
|
7
|
+
Valid keys: `+JSON.stringify(Object.keys(O),null," "));var _=F(M,$,z,X,I+"."+$,r);if(_)return _}return null}return a(f)}function Y(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(Y);if(O===null||d(O))return!0;var f=h(O);if(f){var j=f.call(O),k;if(f!==O.entries){for(;!(k=j.next()).done;)if(!Y(k.value))return!1}else for(;!(k=j.next()).done;){var z=k.value;if(z&&!Y(z[1]))return!1}}else return!1;return!0;default:return!1}}function Z(O,f){return O==="symbol"?!0:f?f["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&f instanceof Symbol:!1}function U(O){var f=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":Z(f,O)?"symbol":f}function K(O){if(typeof O>"u"||O===null)return""+O;var f=U(O);if(f==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return f}function le(O){var f=K(O);switch(f){case"array":case"object":return"an "+f;case"boolean":case"date":case"regexp":return"a "+f;default:return f}}function me(O){return!O.constructor||!O.constructor.name?C:O.constructor.name}return P.checkPropTypes=o,P.resetWarningCache=o.resetWarningCache,P.PropTypes=P,P},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,d,c,v,m,h){if(h!==e){var C=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw C.name="Invariant Violation",C}}n.isRequired=n;function o(){return n}var s={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 s.PropTypes=s,s},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={},Fe={},hn;function At(){if(hn)return Fe;hn=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.dontSetMe=o,Fe.findInArray=e,Fe.int=n,Fe.isFunction=t,Fe.isNum=r;function e(s,l){for(let d=0,c=s.length;d<c;d++)if(l.apply(l,[s[d],d,s]))return s[d]}function t(s){return typeof s=="function"||Object.prototype.toString.call(s)==="[object Function]"}function r(s){return typeof s=="number"&&!isNaN(s)}function n(s){return parseInt(s,10)}function o(s,l,d){if(s[l])return new Error(`Invalid prop ${l} passed to ${d} - do not set this, set it on the child.`)}return Fe}var Xe={},gn;function Io(){if(gn)return Xe;gn=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.browserPrefixToKey=r,Xe.browserPrefixToStyle=n,Xe.default=void 0,Xe.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const l=window.document?.documentElement?.style;if(!l||s in l)return"";for(let d=0;d<e.length;d++)if(r(s,e[d])in l)return e[d];return""}function r(s,l){return l?`${l}${o(s)}`:s}function n(s,l){return l?`-${l.toLowerCase()}-${s}`:s}function o(s){let l="",d=!0;for(let c=0;c<s.length;c++)d?(l+=s[c].toUpperCase(),d=!1):s[c]==="-"?d=!0:l+=s[c];return l}return Xe.default=t(),Xe}var mn;function hr(){if(mn)return ge;mn=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.addClassName=u,ge.addEvent=l,ge.addUserSelectStyles=g,ge.createCSSTransform=P,ge.createSVGTransform=D,ge.getTouch=a,ge.getTouchIdentifier=i,ge.getTranslation=y,ge.innerHeight=m,ge.innerWidth=h,ge.matchesSelector=o,ge.matchesSelectorAndParentsTo=s,ge.offsetXYFromParent=C,ge.outerHeight=c,ge.outerWidth=v,ge.removeClassName=w,ge.removeEvent=d,ge.scheduleRemoveUserSelectStyles=b;var e=At(),t=r(Io());function r(p,x){if(typeof WeakMap=="function")var R=new WeakMap,H=new WeakMap;return(r=function(q,J){if(!J&&q&&q.__esModule)return q;var A,Y,Z={__proto__:null,default:q};if(q===null||typeof q!="object"&&typeof q!="function")return Z;if(A=J?H:R){if(A.has(q))return A.get(q);A.set(q,Z)}for(const U in q)U!=="default"&&{}.hasOwnProperty.call(q,U)&&((Y=(A=Object.defineProperty)&&Object.getOwnPropertyDescriptor(q,U))&&(Y.get||Y.set)?A(Z,U,Y):Z[U]=q[U]);return Z})(p,x)}let n="";function o(p,x){return n||(n=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(R){return(0,e.isFunction)(p[R])})),(0,e.isFunction)(p[n])?p[n](x):!1}function s(p,x,R){let H=p;do{if(o(H,x))return!0;if(H===R)return!1;H=H.parentNode}while(H);return!1}function l(p,x,R,H){if(!p)return;const q={capture:!0,...H};p.addEventListener?p.addEventListener(x,R,q):p.attachEvent?p.attachEvent("on"+x,R):p["on"+x]=R}function d(p,x,R,H){if(!p)return;const q={capture:!0,...H};p.removeEventListener?p.removeEventListener(x,R,q):p.detachEvent?p.detachEvent("on"+x,R):p["on"+x]=null}function c(p){let x=p.clientHeight;const R=p.ownerDocument.defaultView.getComputedStyle(p);return x+=(0,e.int)(R.borderTopWidth),x+=(0,e.int)(R.borderBottomWidth),x}function v(p){let x=p.clientWidth;const R=p.ownerDocument.defaultView.getComputedStyle(p);return x+=(0,e.int)(R.borderLeftWidth),x+=(0,e.int)(R.borderRightWidth),x}function m(p){let x=p.clientHeight;const R=p.ownerDocument.defaultView.getComputedStyle(p);return x-=(0,e.int)(R.paddingTop),x-=(0,e.int)(R.paddingBottom),x}function h(p){let x=p.clientWidth;const R=p.ownerDocument.defaultView.getComputedStyle(p);return x-=(0,e.int)(R.paddingLeft),x-=(0,e.int)(R.paddingRight),x}function C(p,x,R){const q=x===x.ownerDocument.body?{left:0,top:0}:x.getBoundingClientRect(),J=(p.clientX+x.scrollLeft-q.left)/R,A=(p.clientY+x.scrollTop-q.top)/R;return{x:J,y:A}}function P(p,x){const R=y(p,x,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:R}}function D(p,x){return y(p,x,"")}function y(p,x,R){let{x:H,y:q}=p,J=`translate(${H}${R},${q}${R})`;if(x){const A=`${typeof x.x=="string"?x.x:x.x+R}`,Y=`${typeof x.y=="string"?x.y:x.y+R}`;J=`translate(${A}, ${Y})`+J}return J}function a(p,x){return p.targetTouches&&(0,e.findInArray)(p.targetTouches,R=>x===R.identifier)||p.changedTouches&&(0,e.findInArray)(p.changedTouches,R=>x===R.identifier)}function i(p){if(p.targetTouches&&p.targetTouches[0])return p.targetTouches[0].identifier;if(p.changedTouches&&p.changedTouches[0])return p.changedTouches[0].identifier}function g(p){if(!p)return;let x=p.getElementById("react-draggable-style-el");x||(x=p.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
|
+
`,p.getElementsByTagName("head")[0].appendChild(x)),p.body&&u(p.body,"react-draggable-transparent-selection")}function b(p){window.requestAnimationFrame?window.requestAnimationFrame(()=>{S(p)}):S(p)}function S(p){if(p)try{if(p.body&&w(p.body,"react-draggable-transparent-selection"),p.selection)p.selection.empty();else{const x=(p.defaultView||window).getSelection();x&&x.type!=="Caret"&&x.removeAllRanges()}}catch{}}function u(p,x){p.classList?p.classList.add(x):p.className.match(new RegExp(`(?:^|\\s)${x}(?!\\S)`))||(p.className+=` ${x}`)}function w(p,x){p.classList?p.classList.remove(x):p.className=p.className.replace(new RegExp(`(?:^|\\s)${x}(?!\\S)`,"g"),"")}return ge}var Ie={},yn;function vn(){if(yn)return Ie;yn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=o,Ie.canDragY=s,Ie.createCoreData=d,Ie.createDraggableData=c,Ie.getBoundPosition=r,Ie.getControlPosition=l,Ie.snapToGrid=n;var e=At(),t=hr();function r(h,C,P){if(!h.props.bounds)return[C,P];let{bounds:D}=h.props;D=typeof D=="string"?D:v(D);const y=m(h);if(typeof D=="string"){const{ownerDocument:a}=y,i=a.defaultView;let g;if(D==="parent"?g=y.parentNode:g=y.getRootNode().querySelector(D),!(g instanceof i.HTMLElement))throw new Error('Bounds selector "'+D+'" could not find an element.');const b=g,S=i.getComputedStyle(y),u=i.getComputedStyle(b);D={left:-y.offsetLeft+(0,e.int)(u.paddingLeft)+(0,e.int)(S.marginLeft),top:-y.offsetTop+(0,e.int)(u.paddingTop)+(0,e.int)(S.marginTop),right:(0,t.innerWidth)(b)-(0,t.outerWidth)(y)-y.offsetLeft+(0,e.int)(u.paddingRight)-(0,e.int)(S.marginRight),bottom:(0,t.innerHeight)(b)-(0,t.outerHeight)(y)-y.offsetTop+(0,e.int)(u.paddingBottom)-(0,e.int)(S.marginBottom)}}return(0,e.isNum)(D.right)&&(C=Math.min(C,D.right)),(0,e.isNum)(D.bottom)&&(P=Math.min(P,D.bottom)),(0,e.isNum)(D.left)&&(C=Math.max(C,D.left)),(0,e.isNum)(D.top)&&(P=Math.max(P,D.top)),[C,P]}function n(h,C,P){const D=Math.round(C/h[0])*h[0],y=Math.round(P/h[1])*h[1];return[D,y]}function o(h){return h.props.axis==="both"||h.props.axis==="x"}function s(h){return h.props.axis==="both"||h.props.axis==="y"}function l(h,C,P){const D=typeof C=="number"?(0,t.getTouch)(h,C):null;if(typeof C=="number"&&!D)return null;const y=m(P),a=P.props.offsetParent||y.offsetParent||y.ownerDocument.body;return(0,t.offsetXYFromParent)(D||h,a,P.props.scale)}function d(h,C,P){const D=!(0,e.isNum)(h.lastX),y=m(h);return D?{node:y,deltaX:0,deltaY:0,lastX:C,lastY:P,x:C,y:P}:{node:y,deltaX:C-h.lastX,deltaY:P-h.lastY,lastX:h.lastX,lastY:h.lastY,x:C,y:P}}function c(h,C){const P=h.props.scale;return{node:C.node,x:h.state.x+C.deltaX/P,y:h.state.y+C.deltaY/P,deltaX:C.deltaX/P,deltaY:C.deltaY/P,lastX:h.state.x,lastY:h.state.y}}function v(h){return{left:h.left,top:h.top,right:h.right,bottom:h.bottom}}function m(h){const C=h.findDOMNode();if(!C)throw new Error("<DraggableCore>: Unmounted during event!");return C}return Ie}var ht={},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 ht;wn=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.default=void 0;var e=c(E),t=d(Nt()),r=d(Cr),n=hr(),o=vn(),s=At(),l=d(xn());function d(y){return y&&y.__esModule?y:{default:y}}function c(y,a){if(typeof WeakMap=="function")var i=new WeakMap,g=new WeakMap;return(c=function(b,S){if(!S&&b&&b.__esModule)return b;var u,w,p={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return p;if(u=S?g:i){if(u.has(b))return u.get(b);u.set(b,p)}for(const x in b)x!=="default"&&{}.hasOwnProperty.call(b,x)&&((w=(u=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,x))&&(w.get||w.set)?u(p,x,w):p[x]=b[x]);return p})(y,a)}function v(y,a,i){return(a=m(a))in y?Object.defineProperty(y,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):y[a]=i,y}function m(y){var a=h(y,"string");return typeof a=="symbol"?a:a+""}function h(y,a){if(typeof y!="object"||!y)return y;var i=y[Symbol.toPrimitive];if(i!==void 0){var g=i.call(y,a);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(y)}const C={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let P=C.mouse,D=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 i=this.findDOMNode();if(!i||!i.ownerDocument||!i.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:g}=i;if(this.props.disabled||!(a.target instanceof g.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,i)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,i))return;a.type==="touchstart"&&!this.props.allowMobileScroll&&a.preventDefault();const b=(0,n.getTouchIdentifier)(a);this.touchIdentifier=b;const S=(0,o.getControlPosition)(a,b,this);if(S==null)return;const{x:u,y:w}=S,p=(0,o.createCoreData)(this,u,w);(0,l.default)("DraggableCore: handleDragStart: %j",p),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(a,p)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(g),this.dragging=!0,this.lastX=u,this.lastY=w,(0,n.addEvent)(g,P.move,this.handleDrag),(0,n.addEvent)(g,P.stop,this.handleDragStop))}),v(this,"handleDrag",a=>{const i=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(i==null)return;let{x:g,y:b}=i;if(Array.isArray(this.props.grid)){let w=g-this.lastX,p=b-this.lastY;if([w,p]=(0,o.snapToGrid)(this.props.grid,w,p),!w&&!p)return;g=this.lastX+w,b=this.lastY+p}const S=(0,o.createCoreData)(this,g,b);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 p=document.createEvent("MouseEvents");p.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(p)}return}this.lastX=g,this.lastY=b}),v(this,"handleDragStop",a=>{if(!this.dragging)return;const i=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(i==null)return;let{x:g,y:b}=i;if(Array.isArray(this.props.grid)){let p=g-this.lastX||0,x=b-this.lastY||0;[p,x]=(0,o.snapToGrid)(this.props.grid,p,x),g=this.lastX+p,b=this.lastY+x}const S=(0,o.createCoreData)(this,g,b);if(this.props.onStop(a,S)===!1||this.mounted===!1)return!1;const w=this.findDOMNode();w&&this.props.enableUserSelectHack&&(0,n.scheduleRemoveUserSelectStyles)(w.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",S),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,w&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(w.ownerDocument,P.move,this.handleDrag),(0,n.removeEvent)(w.ownerDocument,P.stop,this.handleDragStop))}),v(this,"onMouseDown",a=>(P=C.mouse,this.handleDragStart(a))),v(this,"onMouseUp",a=>(P=C.mouse,this.handleDragStop(a))),v(this,"onTouchStart",a=>(P=C.touch,this.handleDragStart(a))),v(this,"onTouchEnd",a=>(P=C.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,C.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:i}=a;(0,n.removeEvent)(i,C.mouse.move,this.handleDrag),(0,n.removeEvent)(i,C.touch.move,this.handleDrag),(0,n.removeEvent)(i,C.mouse.stop,this.handleDragStop),(0,n.removeEvent)(i,C.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,C.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.scheduleRemoveUserSelectStyles)(i)}}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 ht.default=D,v(D,"displayName","DraggableCore"),v(D,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(y,a){if(y[a]&&y[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:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),v(D,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),ht}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 c.default}}),e.default=void 0;var t=h(E),r=m(Nt()),n=m(Cr),o=Gt,s=hr(),l=vn(),d=At(),c=m(Lo()),v=m(xn());function m(i){return i&&i.__esModule?i:{default:i}}function h(i,g){if(typeof WeakMap=="function")var b=new WeakMap,S=new WeakMap;return(h=function(u,w){if(!w&&u&&u.__esModule)return u;var p,x,R={__proto__:null,default:u};if(u===null||typeof u!="object"&&typeof u!="function")return R;if(p=w?S:b){if(p.has(u))return p.get(u);p.set(u,R)}for(const H in u)H!=="default"&&{}.hasOwnProperty.call(u,H)&&((x=(p=Object.defineProperty)&&Object.getOwnPropertyDescriptor(u,H))&&(x.get||x.set)?p(R,H,x):R[H]=u[H]);return R})(i,g)}function C(){return C=Object.assign?Object.assign.bind():function(i){for(var g=1;g<arguments.length;g++){var b=arguments[g];for(var S in b)({}).hasOwnProperty.call(b,S)&&(i[S]=b[S])}return i},C.apply(null,arguments)}function P(i,g,b){return(g=D(g))in i?Object.defineProperty(i,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):i[g]=b,i}function D(i){var g=y(i,"string");return typeof g=="symbol"?g:g+""}function y(i,g){if(typeof i!="object"||!i)return i;var b=i[Symbol.toPrimitive];if(b!==void 0){var S=b.call(i,g);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(g==="string"?String:Number)(i)}class a extends t.Component{static getDerivedStateFromProps(g,b){let{position:S}=g,{prevPropsPosition:u}=b;return S&&(!u||S.x!==u.x||S.y!==u.y)?((0,v.default)("Draggable: getDerivedStateFromProps %j",{position:S,prevPropsPosition:u}),{x:S.x,y:S.y,prevPropsPosition:{...S}}):null}constructor(g){super(g),P(this,"onDragStart",(b,S)=>{if((0,v.default)("Draggable: onDragStart: %j",S),this.props.onStart(b,(0,l.createDraggableData)(this,S))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),P(this,"onDrag",(b,S)=>{if(!this.state.dragging)return!1;(0,v.default)("Draggable: onDrag: %j",S);const u=(0,l.createDraggableData)(this,S),w={x:u.x,y:u.y,slackX:0,slackY:0};if(this.props.bounds){const{x,y:R}=w;w.x+=this.state.slackX,w.y+=this.state.slackY;const[H,q]=(0,l.getBoundPosition)(this,w.x,w.y);w.x=H,w.y=q,w.slackX=this.state.slackX+(x-w.x),w.slackY=this.state.slackY+(R-w.y),u.x=w.x,u.y=w.y,u.deltaX=w.x-this.state.x,u.deltaY=w.y-this.state.y}if(this.props.onDrag(b,u)===!1)return!1;this.setState(w)}),P(this,"onDragStop",(b,S)=>{if(!this.state.dragging||this.props.onStop(b,(0,l.createDraggableData)(this,S))===!1)return!1;(0,v.default)("Draggable: onDragStop: %j",S);const w={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x,y:R}=this.props.position;w.x=x,w.y=R}this.setState(w)}),this.state={dragging:!1,dragged:!1,x:g.position?g.position.x:g.defaultPosition.x,y:g.position?g.position.y:g.defaultPosition.y,prevPropsPosition:{...g.position},slackX:0,slackY:0,isElementSVG:!1},g.position&&!(g.onDrag||g.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:g,bounds:b,children:S,defaultPosition:u,defaultClassName:w,defaultClassNameDragging:p,defaultClassNameDragged:x,position:R,positionOffset:H,scale:q,...J}=this.props;let A={},Y=null;const U=!!!R||this.state.dragging,K=R||u,le={x:(0,l.canDragX)(this)&&U?this.state.x:K.x,y:(0,l.canDragY)(this)&&U?this.state.y:K.y};this.state.isElementSVG?Y=(0,s.createSVGTransform)(le,H):A=(0,s.createCSSTransform)(le,H);const me=(0,o.clsx)(S.props.className||"",w,{[p]:this.state.dragging,[x]:this.state.dragged});return t.createElement(c.default,C({},J,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(S),{className:me,style:{...S.props.style,...A},transform:Y}))}}e.default=a,P(a,"displayName","Draggable"),P(a,"propTypes",{...c.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:d.dontSetMe,style:d.dontSetMe,transform:d.dontSetMe}),P(a,"defaultProps",{...c.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 pt.exports;Cn=1;const{default:e,DraggableCore:t}=Wo();return pt.exports=e,pt.exports.default=e,pt.exports.DraggableCore=t,pt.exports}var qo=gr(),gt={exports:{}},mt={},Lt={},En;function $o(){if(En)return Lt;En=1,Lt.__esModule=!0,Lt.cloneElement=d;var e=t(E);function t(c){return c&&c.__esModule?c:{default:c}}function r(c,v){var m=Object.keys(c);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(c);v&&(h=h.filter(function(C){return Object.getOwnPropertyDescriptor(c,C).enumerable})),m.push.apply(m,h)}return m}function n(c){for(var v=1;v<arguments.length;v++){var m=arguments[v]!=null?arguments[v]:{};v%2?r(Object(m),!0).forEach(function(h){o(c,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(m,h))})}return c}function o(c,v,m){return(v=s(v))in c?Object.defineProperty(c,v,{value:m,enumerable:!0,configurable:!0,writable:!0}):c[v]=m,c}function s(c){var v=l(c,"string");return typeof v=="symbol"?v:v+""}function l(c,v){if(typeof c!="object"||!c)return c;var m=c[Symbol.toPrimitive];if(m!==void 0){var h=m.call(c,v);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(c)}function d(c,v){return v.style&&c.props.style&&(v.style=n(n({},c.props.style),v.style)),v.className&&c.props.className&&(v.className=`${c.props.className} ${v.className}`),e.default.cloneElement(c,v)}return Lt}var yt={},Pn;function On(){if(Pn)return yt;Pn=1,yt.__esModule=!0,yt.resizableProps=void 0;var e=t(Nt());gr();function t(r){return r&&r.__esModule?r:{default:r}}return yt.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[s]=n;return s.axis==="both"||s.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[s]=n;return s.axis==="both"||s.axis==="x"?e.default.number.isRequired(...n):e.default.number(...n)}},yt}var Rn;function Dn(){if(Rn)return mt;Rn=1,mt.__esModule=!0,mt.default=void 0;var e=s(E),t=gr(),r=$o(),n=On();const o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function s(y,a){if(typeof WeakMap=="function")var i=new WeakMap,g=new WeakMap;return(s=function(b,S){if(!S&&b&&b.__esModule)return b;var u,w,p={__proto__:null,default:b};if(b===null||typeof b!="object"&&typeof b!="function")return p;if(u=S?g:i){if(u.has(b))return u.get(b);u.set(b,p)}for(const x in b)x!=="default"&&{}.hasOwnProperty.call(b,x)&&((w=(u=Object.defineProperty)&&Object.getOwnPropertyDescriptor(b,x))&&(w.get||w.set)?u(p,x,w):p[x]=b[x]);return p})(y,a)}function l(){return l=Object.assign?Object.assign.bind():function(y){for(var a=1;a<arguments.length;a++){var i=arguments[a];for(var g in i)({}).hasOwnProperty.call(i,g)&&(y[g]=i[g])}return y},l.apply(null,arguments)}function d(y,a){if(y==null)return{};var i,g,b=c(y,a);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(y);for(g=0;g<S.length;g++)i=S[g],a.indexOf(i)===-1&&{}.propertyIsEnumerable.call(y,i)&&(b[i]=y[i])}return b}function c(y,a){if(y==null)return{};var i={};for(var g in y)if({}.hasOwnProperty.call(y,g)){if(a.indexOf(g)!==-1)continue;i[g]=y[g]}return i}function v(y,a){var i=Object.keys(y);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(y);a&&(g=g.filter(function(b){return Object.getOwnPropertyDescriptor(y,b).enumerable})),i.push.apply(i,g)}return i}function m(y){for(var a=1;a<arguments.length;a++){var i=arguments[a]!=null?arguments[a]:{};a%2?v(Object(i),!0).forEach(function(g){h(y,g,i[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(i)):v(Object(i)).forEach(function(g){Object.defineProperty(y,g,Object.getOwnPropertyDescriptor(i,g))})}return y}function h(y,a,i){return(a=C(a))in y?Object.defineProperty(y,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):y[a]=i,y}function C(y){var a=P(y,"string");return typeof a=="symbol"?a:a+""}function P(y,a){if(typeof y!="object"||!y)return y;var i=y[Symbol.toPrimitive];if(i!==void 0){var g=i.call(y,a);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(y)}let D=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,i){const{minConstraints:g,maxConstraints:b,lockAspectRatio:S}=this.props;if(!g&&!b&&!S)return[a,i];if(S){const R=this.props.width/this.props.height,H=a-this.props.width,q=i-this.props.height;Math.abs(H)>Math.abs(q*R)?i=a/R:a=i*R}const[u,w]=[a,i];let[p,x]=this.slack||[0,0];return a+=p,i+=x,g&&(a=Math.max(g[0],a),i=Math.max(g[1],i)),b&&(a=Math.min(b[0],a),i=Math.min(b[1],i)),this.slack=[p+(u-a),x+(w-i)],[a,i]}resizeHandler(a,i){return(g,b)=>{let{node:S,deltaX:u,deltaY:w}=b;a==="onResizeStart"&&this.resetData();const p=(this.props.axis==="both"||this.props.axis==="x")&&i!=="n"&&i!=="s",x=(this.props.axis==="both"||this.props.axis==="y")&&i!=="e"&&i!=="w";if(!p&&!x)return;const R=i[0],H=i[i.length-1],q=S.getBoundingClientRect();if(this.lastHandleRect!=null){if(H==="w"){const K=q.left-this.lastHandleRect.left;u+=K}if(R==="n"){const K=q.top-this.lastHandleRect.top;w+=K}}this.lastHandleRect=q,H==="w"&&(u=-u),R==="n"&&(w=-w);let J=this.props.width+(p?u/this.props.transformScale:0),A=this.props.height+(x?w/this.props.transformScale:0);[J,A]=this.runConstraints(J,A),a==="onResizeStop"&&this.lastSize&&({width:J,height:A}=this.lastSize);const Y=J!==this.props.width||A!==this.props.height;a!=="onResizeStop"&&(this.lastSize={width:J,height:A});const Z=typeof this.props[a]=="function"?this.props[a]:null;Z&&!(a==="onResize"&&!Y)&&(g.persist?.(),Z(g,{node:S,size:{width:J,height:A},handle:i})),a==="onResizeStop"&&this.resetData()}}renderResizeHandle(a,i){const{handle:g}=this.props;if(!g)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${a}`,ref:i});if(typeof g=="function")return g(a,i);const b=typeof g.type=="string",S=m({ref:i},b?{}:{handleAxis:a});return e.cloneElement(g,S)}render(){const a=this.props,{children:i,className:g,draggableOpts:b,width:S,height:u,handle:w,handleSize:p,lockAspectRatio:x,axis:R,minConstraints:H,maxConstraints:q,onResize:J,onResizeStop:A,onResizeStart:Y,resizeHandles:Z,transformScale:U}=a,K=d(a,o);return(0,r.cloneElement)(i,m(m({},K),{},{className:`${g?`${g} `:""}react-resizable`,children:[...e.Children.toArray(i.props.children),...Z.map(le=>{const me=this.handleRefs[le]??(this.handleRefs[le]=e.createRef());return e.createElement(t.DraggableCore,l({},b,{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 mt.default=D,D.propTypes=n.resizableProps,D.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},mt}var vt={},_n;function Ho(){if(_n)return vt;_n=1,vt.__esModule=!0,vt.default=void 0;var e=l(E),t=s(Nt()),r=s(Dn()),n=On();const o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function s(a){return a&&a.__esModule?a:{default:a}}function l(a,i){if(typeof WeakMap=="function")var g=new WeakMap,b=new WeakMap;return(l=function(S,u){if(!u&&S&&S.__esModule)return S;var w,p,x={__proto__:null,default:S};if(S===null||typeof S!="object"&&typeof S!="function")return x;if(w=u?b:g){if(w.has(S))return w.get(S);w.set(S,x)}for(const R in S)R!=="default"&&{}.hasOwnProperty.call(S,R)&&((p=(w=Object.defineProperty)&&Object.getOwnPropertyDescriptor(S,R))&&(p.get||p.set)?w(x,R,p):x[R]=S[R]);return x})(a,i)}function d(){return d=Object.assign?Object.assign.bind():function(a){for(var i=1;i<arguments.length;i++){var g=arguments[i];for(var b in g)({}).hasOwnProperty.call(g,b)&&(a[b]=g[b])}return a},d.apply(null,arguments)}function c(a,i){var g=Object.keys(a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(a);i&&(b=b.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),g.push.apply(g,b)}return g}function v(a){for(var i=1;i<arguments.length;i++){var g=arguments[i]!=null?arguments[i]:{};i%2?c(Object(g),!0).forEach(function(b){m(a,b,g[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(g)):c(Object(g)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(g,b))})}return a}function m(a,i,g){return(i=h(i))in a?Object.defineProperty(a,i,{value:g,enumerable:!0,configurable:!0,writable:!0}):a[i]=g,a}function h(a){var i=C(a,"string");return typeof i=="symbol"?i:i+""}function C(a,i){if(typeof a!="object"||!a)return a;var g=a[Symbol.toPrimitive];if(g!==void 0){var b=g.call(a,i);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(a)}function P(a,i){if(a==null)return{};var g,b,S=D(a,i);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(a);for(b=0;b<u.length;b++)g=u[b],i.indexOf(g)===-1&&{}.propertyIsEnumerable.call(a,g)&&(S[g]=a[g])}return S}function D(a,i){if(a==null)return{};var g={};for(var b in a)if({}.hasOwnProperty.call(a,b)){if(i.indexOf(b)!==-1)continue;g[b]=a[b]}return g}let y=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=(i,g)=>{const{size:b}=g;this.props.onResize?(i.persist?.(),this.setState(b,()=>this.props.onResize&&this.props.onResize(i,g))):this.setState(b)}}static getDerivedStateFromProps(i,g){return g.propsWidth!==i.width||g.propsHeight!==i.height?{width:i.width,height:i.height,propsWidth:i.width,propsHeight:i.height}:null}render(){const i=this.props,{handle:g,handleSize:b,onResize:S,onResizeStart:u,onResizeStop:w,draggableOpts:p,minConstraints:x,maxConstraints:R,lockAspectRatio:H,axis:q,width:J,height:A,resizeHandles:Y,style:Z,transformScale:U}=i,K=P(i,o);return e.createElement(r.default,{axis:q,draggableOpts:p,handle:g,handleSize:b,height:this.state.height,lockAspectRatio:H,maxConstraints:R,minConstraints:x,onResizeStart:u,onResize:this.onResize,onResizeStop:w,resizeHandles:Y,transformScale:U,width:this.state.width},e.createElement("div",d({},K,{style:v(v({},Z),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return vt.default=y,y.propTypes=v(v({},n.resizableProps),{},{children:t.default.element}),vt}var jn;function Yo(){return jn||(jn=1,gt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},gt.exports.Resizable=Dn().default,gt.exports.ResizableBox=Ho().default),gt.exports}var Bo=Yo();function Tn(e){const{children:t,cols:r,containerWidth:n,margin:o,containerPadding:s,rowHeight:l,maxRows:d,isDraggable:c,isResizable:v,isBounded:m,static:h,useCSSTransforms:C=!0,usePercentages:P=!1,transformScale:D=1,positionStrategy:y,dragThreshold:a=0,droppingPosition:i,className:g="",style:b,handle:S="",cancel:u="",x:w,y:p,w:x,h:R,minW:H=1,maxW:q=1/0,minH:J=1,maxH:A=1/0,i:Y,resizeHandles:Z,resizeHandle:U,constraints:K=Mr,layoutItem:le,layout:me=[],onDragStart:O,onDrag:f,onDragStop:j,onResizeStart:k,onResize:z,onResizeStop:X}=e,[I,M]=E.useState(!1),[W,N]=E.useState(!1),$=E.useRef(null),F=E.useRef({left:0,top:0}),_=E.useRef({top:0,left:0,width:0,height:0}),ae=E.useRef(void 0),je=E.useRef(me);je.current=me;const De=E.useRef(null),ye=E.useRef(null),Ce=E.useRef(!1),st=E.useRef({x:0,y:0}),de=E.useRef(!1),ue=E.useMemo(()=>({cols:r,containerPadding:s,containerWidth:n,margin:o,maxRows:d,rowHeight:l}),[r,s,n,o,d,l]),Ee=E.useMemo(()=>({cols:r,maxRows:d,containerWidth:n,containerHeight:0,rowHeight:l,margin:o,layout:[]}),[r,d,n,l,o]),we=E.useCallback(()=>({...Ee,layout:je.current}),[Ee]),Ne=E.useMemo(()=>le??{i:Y,x:w,y:p,w:x,h:R,minW:H,maxW:q,minH:J,maxH:A},[le,Y,w,p,x,R,H,q,J,A]),Wt=E.useCallback(re=>{if(y?.calcStyle)return y.calcStyle(re);if(C)return zr(re);const ne=Un(re);return P?{...ne,left:kr(re.left/n),width:kr(re.width/n)}:ne},[y,C,P,n]),Le=E.useCallback((re,{node:ne})=>{if(!O)return;const{offsetParent:he}=ne;if(!he)return;const se=he.getBoundingClientRect(),ve=ne.getBoundingClientRect(),Pe=ve.left/D,_e=se.left/D,Oe=ve.top/D,Me=se.top/D;let ze;if(y?.calcDragPosition){const G=re;ze=y.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;st.current={x:G.clientX,y:G.clientY},Ce.current=!0,de.current=!1,M(!0);return}M(!0);const Je=Ct(ue,ze.top,ze.left),{x:Ke,y:L}=Rt(K,Ne,Je.x,Je.y,we());O(Y,Ke,L,{e:re,node:ne,newPosition:ze})},[O,D,ue,y,a,K,Ne,we,Y]),it=E.useCallback((re,{node:ne,deltaX:he,deltaY:se})=>{if(!f||!I)return;const ve=re;if(Ce.current&&!de.current){const Ke=ve.clientX-st.current.x,L=ve.clientY-st.current.y;if(Math.hypot(Ke,L)<a)return;if(de.current=!0,Ce.current=!1,O){const B=Ct(ue,F.current.top,F.current.left),{x:Q,y:ie}=Rt(K,Ne,B.x,B.y,we());O(Y,Q,ie,{e:re,node:ne,newPosition:F.current})}}let Pe=F.current.top+se,_e=F.current.left+he;if(m){const{offsetParent:Ke}=ne;if(Ke){const L=Ke.clientHeight-ot(R,l,o[1]);Pe=Et(Pe,0,L);const G=nt(ue),B=n-ot(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:Je}=Rt(K,Ne,Me.x,Me.y,we());f(Y,ze,Je,{e:re,node:ne,newPosition:Oe})},[f,O,I,a,m,R,l,o,ue,n,x,Y,K,Ne,we]),Ue=E.useCallback((re,{node:ne})=>{if(!j||!I)return;const he=Ce.current;if(Ce.current=!1,de.current=!1,st.current={x:0,y:0},he){M(!1),F.current={left:0,top:0};return}const{left:se,top:ve}=F.current,Pe={top:ve,left:se};M(!1),F.current={left:0,top:0};const _e=Ct(ue,ve,se),{x:Oe,y:Me}=Rt(K,Ne,_e.x,_e.y,we());j(Y,Oe,Me,{e:re,node:ne,newPosition:Pe})},[j,I,ue,K,Ne,we,Y]);De.current=Le,ye.current=it;const Ae=E.useCallback((re,{node:ne,size:he,handle:se},ve,Pe)=>{const _e=Pe==="onResizeStart"?k:Pe==="onResize"?z:X;if(!_e)return;let Oe;ne?Oe=to(se,ve,he,n):Oe={...he,top:ve.top,left:ve.left},_.current=Oe;const Me=qn(ue,Oe.width,Oe.height),{w:ze,h:Je}=Xn(K,Ne,Me.w,Me.h,se,we());_e(Y,ze,Je,{e:re.nativeEvent,node:ne,size:Oe,handle:se})},[k,z,X,n,ue,Y,K,Ne,we]),lt=E.useCallback((re,ne)=>{N(!0);const he=dt(ue,w,p,x,R),se={...ne,handle:ne.handle};Ae(re,se,he,"onResizeStart")},[Ae,ue,w,p,x,R]),ut=E.useCallback((re,ne)=>{const he=dt(ue,w,p,x,R),se={...ne,handle:ne.handle};Ae(re,se,he,"onResize")},[Ae,ue,w,p,x,R]),Ge=E.useCallback((re,ne)=>{N(!1),_.current={top:0,left:0,width:0,height:0};const he=dt(ue,w,p,x,R),se={...ne,handle:ne.handle};Ae(re,se,he,"onResizeStop")},[Ae,ue,w,p,x,R]);E.useEffect(()=>{if(!i)return;const re=$.current;if(!re)return;const ne=ae.current||{left:0,top:0},he=I&&(i.left!==ne.left||i.top!==ne.top);if(I){if(he){const se=i.left-F.current.left,ve=i.top-F.current.top,Pe={node:re,deltaX:se,deltaY:ve,lastX:F.current.left,lastY:F.current.top,x:i.left,y:i.top};ye.current?.(i.e,Pe)}}else{const se={node:re,deltaX:i.left,deltaY:i.top,lastX:0,lastY:0,x:i.left,y:i.top};De.current?.(i.e,se)}ae.current=i},[i,I,Y]);const We=dt(ue,w,p,x,R,I?F.current:null,W?_.current:null),bt=E.Children.only(t),xt=dt(ue,0,0,1,1),qt=[xt.width,xt.height],$t=[1/0,1/0],Te=bt.props,xr=Te.className,Ht=Te.style;let Ve=E.cloneElement(bt,{ref:$,className:Gt("react-grid-item",xr,g,{static:h,resizing:W,"react-draggable":c,"react-draggable-dragging":I,dropping:!!i,cssTransforms:C}),style:{...b,...Ht,...Wt(We)}});const Yt=U;return Ve=T.jsx(Bo.Resizable,{draggableOpts:{disabled:!v},className:v?void 0:"react-resizable-hide",width:We.width,height:We.height,minConstraints:qt,maxConstraints:$t,onResizeStart:lt,onResize:ut,onResizeStop:Ge,transformScale:D,resizeHandles:Z,handle:Yt,children:Ve}),Ve=T.jsx(qo.DraggableCore,{disabled:!c,onStart:Le,onDrag:it,onStop:Ue,handle:S,cancel:".react-resizable-handle"+(u?","+u:""),scale:D,nodeRef:$,children:Ve}),Ve}var $e=()=>{},Mn="react-grid-layout",zn=!1;try{zn=/firefox/i.test(navigator.userAgent)}catch{}function Fo(e,t){const r=E.Children.toArray(e),n=E.Children.toArray(t);if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++){const s=r[o],l=n[o];if(s?.key!==l?.key)return!1}return!0}function kn(e,t,r,n){const o=[],s=new Set;E.Children.forEach(t,d=>{if(!E.isValidElement(d)||d.key===null)return;const c=String(d.key);s.add(c);const v=e.find(m=>m.i===c);if(v)o.push(et(v));else{const h=d.props["data-grid"];h?o.push({i:c,x:h.x??0,y:h.y??0,w:h.w??1,h:h.h??1,minW:h.minW,maxW:h.maxW,minH:h.minH,maxH:h.maxH,static:h.static,isDraggable:h.isDraggable,isResizable:h.isResizable,resizeHandles:h.resizeHandles,isBounded:h.isBounded}):o.push({i:c,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:s,dropConfig:l,positionStrategy:d=no,compactor:c,constraints:v=Mr,layout:m=[],droppingItem:h,autoSize:C=!0,className:P="",style:D={},innerRef:y,onLayoutChange:a=$e,onDragStart:i=$e,onDrag:g=$e,onDragStop:b=$e,onResizeStart:S=$e,onResize:u=$e,onResizeStop:w=$e,onDrop:p=$e,onDropDragOver:x=$e}=e,R=E.useMemo(()=>({...oo,...n}),[n]),H=E.useMemo(()=>({...ao,...o}),[o]),q=E.useMemo(()=>({...so,...s}),[s]),J=E.useMemo(()=>({...io,...l}),[l]),{cols:A,rowHeight:Y,maxRows:Z,margin:U,containerPadding:K}=R,{enabled:le,bounded:me,handle:O,cancel:f,threshold:j}=H,{enabled:k,handles:z,handleComponent:X}=q,{enabled:I,defaultItem:M,onDragOver:W}=J,N=c??or("vertical"),$=N.type,F=N.allowOverlap,_=N.preventCollision??!1,ae=E.useMemo(()=>h??{i:"__dropping-elem__",...M},[h,M]),je=d.type==="transform",De=d.scale,ye=K??U,[Ce,st]=E.useState(!1),[de,ue]=E.useState(()=>kn(m,t,A,N)),[Ee,we]=E.useState(null),[Ne,Wt]=E.useState(!1),[Le,it]=E.useState(null),[Ue,Ae]=E.useState(),lt=E.useRef(null),ut=E.useRef(null),Ge=E.useRef(null),We=E.useRef(0),bt=E.useRef(de),xt=E.useRef(m),qt=E.useRef(t),$t=E.useRef($),Te=E.useRef(de);Te.current=de,E.useEffect(()=>{st(!0),qe(de,m)||a(de)},[]),E.useEffect(()=>{if(Ee||Le)return;const L=!qe(m,xt.current),G=!Fo(t,qt.current),B=$!==$t.current;if(L||G||B){const ie=kn(L?m:de,t,A,N);qe(ie,de)||ue(ie)}xt.current=m,qt.current=t,$t.current=$},[m,t,A,$,N,Ee,Le,de]),E.useEffect(()=>{if(!Ee&&!qe(de,bt.current)){bt.current=de;const L=de.filter(G=>G.i!==ae.i);a(L)}},[de,Ee,a,ae.i]);const xr=E.useMemo(()=>{if(!C)return;const L=Pt(de),G=ye[1];return L*Y+(L-1)*U[1]+G*2+"px"},[C,de,Y,U,ye]),Ht=E.useCallback((L,G,B,Q)=>{const ie=Te.current,oe=Qe(ie,L);if(!oe)return;const ce={w:oe.w,h:oe.h,x:oe.x,y:oe.y,i:L};lt.current=et(oe),Ge.current=ie,we(ce),i(ie,oe,oe,null,Q.e,Q.node)},[i]),Ve=E.useCallback((L,G,B,Q)=>{const ie=Te.current,oe=lt.current,ce=Qe(ie,L);if(!ce)return;const be={w:ce.w,h:ce.h,x:ce.x,y:ce.y,i:L},fe=tt(ie,ce,G,B,!0,_,$,A,F);g(fe,oe,ce,be,Q.e,Q.node),ue(N.compact(fe,A)),we(be)},[_,$,A,F,N,g]),Yt=E.useCallback((L,G,B,Q)=>{if(!Ee)return;const ie=Te.current,oe=lt.current,ce=Qe(ie,L);if(!ce)return;const be=tt(ie,ce,G,B,!0,_,$,A,F),fe=N.compact(be,A);b(fe,oe,ce,null,Q.e,Q.node);const Se=Ge.current;lt.current=null,Ge.current=null,we(null),ue(fe),Se&&!qe(Se,fe)&&a(fe)},[Ee,_,$,A,F,N,b,a]),re=E.useCallback((L,G,B,Q)=>{const ie=Te.current,oe=Qe(ie,L);oe&&(ut.current=et(oe),Ge.current=ie,Wt(!0),S(ie,oe,oe,null,Q.e,Q.node))},[S]),ne=E.useCallback((L,G,B,Q)=>{const ie=Te.current,oe=ut.current,{handle:ce}=Q;let be=!1,fe,Se;const[Bt,He]=Yn(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),_&&!F&&_r(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 wt=Bt;be&&fe!==void 0&&Se!==void 0&&(wt=tt(Bt,He,fe,Se,!0,_,$,A,F));const Ft={w:He.w,h:He.h,x:He.x,y:He.y,i:L,static:!0};u(wt,oe,He,Ft,Q.e,Q.node),ue(N.compact(wt,A)),we(Ft)},[_,$,A,F,N,u]),he=E.useCallback((L,G,B,Q)=>{const ie=Te.current,oe=ut.current,ce=Qe(ie,L),be=N.compact(ie,A);w(be,oe,ce??null,null,Q.e,Q.node);const fe=Ge.current;ut.current=null,Ge.current=null,we(null),Wt(!1),ue(be),fe&&!qe(fe,be)&&a(be)},[A,N,w,a]),se=E.useCallback(()=>{const L=Te.current;if(!L.some(Q=>Q.i===ae.i)){it(null),we(null),Ae(void 0);return}const B=N.compact(L.filter(Q=>Q.i!==ae.i),A);ue(B),it(null),we(null),Ae(void 0)},[ae.i,A,N]),ve=E.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 Le&&se(),!1;const{dragOffsetX:B=0,dragOffsetY:Q=0,...ie}=G??{},oe={...ae,...ie},ce=L.currentTarget.getBoundingClientRect(),be={cols:A,margin:U,maxRows:Z,rowHeight:Y,containerWidth:r,containerPadding:ye},fe=nt(be),Se=ot(oe.w,fe,U[0]),Bt=ot(oe.h,Y,U[1]),He=Se/2,wt=Bt/2,Ft=L.clientX-ce.left+B-He,pe=L.clientY-ce.top+Q-wt,wr=Math.max(0,Ft),Xt=Math.max(0,pe),Ut={left:wr/De,top:Xt/De,e:L.nativeEvent};if(Le)Ue&&(Ue.left!==Ut.left||Ue.top!==Ut.top)&&Ae(Ut);else{const Sr=Wn(be,Xt,wr,oe.w,oe.h);it(T.jsx("div",{},oe.i)),Ae(Ut),ue([...Te.current,{...oe,x:Sr.x,y:Sr.y,static:!1,isDraggable:!0}])}},[Le,Ue,ae,W,x,se,De,A,U,Z,Y,r,ye]),Pe=E.useCallback(L=>{L.preventDefault(),L.stopPropagation(),We.current--,We.current<0&&(We.current=0),We.current===0&&se()},[se]),_e=E.useCallback(L=>{L.preventDefault(),L.stopPropagation(),We.current++},[]),Oe=E.useCallback(L=>{L.preventDefault(),L.stopPropagation();const G=Te.current,B=G.find(Q=>Q.i===ae.i);We.current=0,se(),p(G,B,L.nativeEvent)},[ae.i,se,p]),Me=E.useCallback((L,G)=>{if(!L||!L.key)return null;const B=Qe(de,String(L.key));if(!B)return null;const Q=typeof B.isDraggable=="boolean"?B.isDraggable:!B.static&&le,ie=typeof B.isResizable=="boolean"?B.isResizable:!B.static&&k,oe=B.resizeHandles||[...z],ce=Q&&me&&B.isBounded!==!1,be=X;return T.jsx(Tn,{containerWidth:r,cols:A,margin:U,containerPadding:ye,maxRows:Z,rowHeight:Y,cancel:f,handle:O,onDragStart:Ht,onDrag:Ve,onDragStop:Yt,onResizeStart:re,onResize:ne,onResizeStop:he,isDraggable:Q,isResizable:ie,isBounded:ce,useCSSTransforms:je&&Ce,usePercentages:!Ce,transformScale:De,positionStrategy:d,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?Ue:void 0,resizeHandles:oe,resizeHandle:be,constraints:v,layoutItem:B,layout:de,children:L},B.i)},[de,r,A,U,ye,Z,Y,f,O,Ht,Ve,Yt,re,ne,he,le,k,me,je,Ce,De,d,j,Ue,z,X,v]),ze=()=>Ee?T.jsx(Tn,{w:Ee.w,h:Ee.h,x:Ee.x,y:Ee.y,i:Ee.i,className:`react-grid-placeholder ${Ne?"placeholder-resizing":""}`,containerWidth:r,cols:A,margin:U,containerPadding:ye,maxRows:Z,rowHeight:Y,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:je,transformScale:De,constraints:v,layout:de,children:T.jsx("div",{})}):null,Je=Gt(Mn,P),Ke={height:xr,...D};return T.jsxs("div",{ref:y,className:Je,style:Ke,onDrop:I?Oe:void 0,onDragLeave:I?Pe:void 0,onDragEnter:I?_e:void 0,onDragOver:I?ve:void 0,children:[E.Children.map(t,L=>E.isValidElement(L)?Me(L):null),I&&Le&&Me(Le,!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=[];E.Children.forEach(t,l=>{if(!E.isValidElement(l)||l.key===null)return;const d=String(l.key),c=e.find(v=>v.i===d);if(c)o.push({...c,i:d});else{const m=l.props["data-grid"];m?o.push({i:d,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:d,x:0,y:Pt(o),w:1,h:1})}});const s=Zt(o,{cols:r});return n.compact(s,r)}function Jo(e){const{children:t,width:r,breakpoint:n,breakpoints:o=Uo,cols:s=Go,layouts:l={},rowHeight:d=150,maxRows:c=1/0,margin:v=[10,10],containerPadding:m=null,compactor:h,onBreakpointChange:C=mr,onLayoutChange:P=mr,onWidthChange:D=mr,...y}=e,a=h??or("vertical"),i=a.type,g=a.allowOverlap,b=E.useMemo(()=>n??qr(o,r),[]),S=E.useMemo(()=>$r(b,s),[b,s]),u=E.useMemo(()=>ar(l,o,b,b,S,i),[]),[w,p]=E.useState(b),[x,R]=E.useState(S),[H,q]=E.useState(u),[J,A]=E.useState(l),Y=E.useRef(r),Z=E.useRef(n),U=E.useRef(o),K=E.useRef(s),le=E.useRef(l),me=E.useRef(i),O=E.useRef(J);E.useEffect(()=>{O.current=J},[J]);const f=E.useMemo(()=>qe(l,le.current)?null:ar(l,o,w,w,x,a),[l,o,w,x,a]),j=f??H;E.useEffect(()=>{f!==null&&(q(f),A(l),O.current=l,le.current=l)},[f,l]),E.useEffect(()=>{if(i!==me.current){const M=a.compact(Be(j),x),W={...O.current,[w]:M};q(M),A(W),O.current=W,P(M,W),me.current=i}},[i,a,j,x,g,w,P]),E.useEffect(()=>{const M=r!==Y.current,W=n!==Z.current,N=!qe(o,U.current),$=!qe(s,K.current);if(M||W||N||$){const F=n??qr(o,r),_=$r(F,s),ae=w;if(ae!==F||N||$){const ye={...O.current};ye[ae]||(ye[ae]=Be(H));let Ce=ar(ye,o,F,ae,_,a);Ce=Vo(Ce,t,_,a),ye[F]=Ce,p(F),R(_),q(Ce),A(ye),O.current=ye,C(F,_),P(Ce,ye)}const je=_t(v,F),De=m?_t(m,F):null;D(r,je,_,De),Y.current=r,Z.current=n,U.current=o,K.current=s}},[r,n,o,s,w,x,H,t,a,i,g,v,m,C,P,D]);const k=E.useCallback(M=>{const N={...O.current,[w]:M};q(M),A(N),O.current=N,P(M,N)},[w,P]),z=E.useMemo(()=>_t(v,w),[v,w]),X=E.useMemo(()=>m===null?null:_t(m,w),[m,w]),I=E.useMemo(()=>({cols:x,rowHeight:d,maxRows:c,margin:z,containerPadding:X}),[x,d,c,z,X]);return T.jsx(Xo,{...y,width:r,gridConfig:I,compactor:a,onLayoutChange:k,layout:j,children:t})}function Ko({editMode:e}){const t=rt.useDnd();return ke.useEffect(()=>{if(e)return t.startDrag({id:"dashboard-layout",type:"dashboard-widget",data:{}}),()=>{t.endDrag()};t.endDrag("dashboard")},[e,t]),null}const Zo=["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",onRefresh:o})=>{const{width:s,containerRef:l,mounted:d}=jo(),[c,v]=ke.useState(!1),[m,h]=ke.useState(!1),C=rt.useHasDndProvider(),P=ke.useRef(null),D=ke.useCallback(()=>{o&&(h(!0),o(),setTimeout(()=>h(!1),600))},[o]);ke.useEffect(()=>{if(!(!e.refreshInterval||e.refreshInterval<=0||!o))return P.current=setInterval(D,e.refreshInterval*1e3),()=>{P.current&&clearInterval(P.current)}},[e.refreshInterval,o,D]);const[y,a]=ke.useState(()=>{if(typeof window<"u"&&n){const u=localStorage.getItem(n);if(u)try{return JSON.parse(u)}catch(w){console.error("Failed to parse saved layout:",w)}}return{lg:e.widgets?.map((u,w)=>({i:u.id||`widget-${w}`,x:u.layout?.x||w%4*3,y:u.layout?.y||Math.floor(w/4)*4,w:u.layout?.w||3,h:u.layout?.h||4}))||[]}}),i=ke.useCallback((u,w)=>{a(w),r?.(u)},[r]),g=ke.useCallback(()=>{typeof window<"u"&&n&&localStorage.setItem(n,JSON.stringify(y)),v(!1)},[y,n]),b=ke.useCallback(()=>{const u={lg:e.widgets?.map((w,p)=>({i:w.id||`widget-${p}`,x:w.layout?.x||p%4*3,y:w.layout?.y||Math.floor(p/4)*4,w:w.layout?.w||3,h:w.layout?.h||4}))||[]};a(u),typeof window<"u"&&n&&localStorage.removeItem(n)},[e.widgets,n]),S=ke.useCallback(u=>{if(u.component)return u.component;const w=u.type;if(w==="bar"||w==="line"||w==="area"||w==="pie"||w==="donut"){const p=Array.isArray(u.data)?u.data:u.data?.items||[],x=u.options||{},R=x.xField||"name",H=x.yField||"value";return{type:"chart",chartType:w,data:p,xAxisKey:R,series:[{dataKey:H}],colors:Zo,className:"h-full"}}return w==="table"?{type:"data-table",...u.options,data:u.data?.items||[],searchable:!1,pagination:!1,className:"border-0"}:u},[]);return T.jsxs("div",{ref:l,className:V.cn("w-full",t),"data-testid":"grid-layout",children:[C&&T.jsx(Ko,{editMode:c}),T.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[T.jsx("h2",{className:"text-2xl font-bold",children:e.title||"Dashboard"}),T.jsx("div",{className:"flex gap-2",children:c?T.jsxs(T.Fragment,{children:[T.jsxs(V.Button,{onClick:g,size:"sm",variant:"default",children:[T.jsx(Re.Save,{className:"h-4 w-4 mr-2"}),"Save Layout"]}),T.jsxs(V.Button,{onClick:b,size:"sm",variant:"outline",children:[T.jsx(Re.X,{className:"h-4 w-4 mr-2"}),"Reset"]}),T.jsx(V.Button,{onClick:()=>v(!1),size:"sm",variant:"ghost",children:"Cancel"})]}):T.jsxs(T.Fragment,{children:[o&&T.jsxs(V.Button,{onClick:D,size:"sm",variant:"outline",disabled:m,"aria-label":"Refresh dashboard",children:[T.jsx(Re.RefreshCw,{className:V.cn("h-4 w-4 mr-2",m&&"animate-spin")}),m?"Refreshing…":"Refresh All"]}),T.jsxs(V.Button,{onClick:()=>v(!0),size:"sm",variant:"outline",children:[T.jsx(Re.Edit,{className:"h-4 w-4 mr-2"}),"Edit Layout"]})]})})]}),d&&T.jsx(Jo,{className:"layout",width:s,layouts:y,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:c,handle:".drag-handle"},resizeConfig:{enabled:c},onLayoutChange:i,children:e.widgets?.map((u,w)=>{const p=u.id||`widget-${w}`,x=S(u),R=u.type==="metric";return T.jsx("div",{className:"h-full",children:R?T.jsxs("div",{className:"h-full w-full relative",children:[c&&T.jsx("div",{className:"drag-handle absolute top-2 right-2 z-10 cursor-move p-1 bg-background/80 rounded border border-border",children:T.jsx(Re.GripVertical,{className:"h-4 w-4"})}),T.jsx(rt.SchemaRenderer,{schema:x,className:"h-full w-full"})]}):T.jsxs(V.Card,{className:V.cn("h-full overflow-hidden border-border/50 shadow-sm transition-all","bg-card/50 backdrop-blur-sm",c&&"ring-2 ring-primary/20"),children:[u.title&&T.jsxs(V.CardHeader,{className:"pb-2 border-b border-border/40 bg-muted/20 flex flex-row items-center justify-between",children:[T.jsx(V.CardTitle,{className:"text-base font-medium tracking-tight truncate",title:u.title,children:u.title}),c&&T.jsx("div",{className:"drag-handle cursor-move p-1 hover:bg-muted/40 rounded",children:T.jsx(Re.GripVertical,{className:"h-4 w-4"})})]}),T.jsx(V.CardContent,{className:"p-0 h-full",children:T.jsx("div",{className:V.cn("h-full w-full overflow-auto p-4"),children:T.jsx(rt.SchemaRenderer,{schema:x})})})]})},p)})})]})},vr=({label:e,value:t,trend:r,icon:n,className:o,description:s,...l})=>{const d=E.useMemo(()=>{if(typeof n=="string"){const c=Pr[n];return c?T.jsx(c,{className:"h-4 w-4 text-muted-foreground"}):null}return n},[n]);return T.jsxs(V.Card,{className:V.cn("h-full",o),...l,children:[T.jsxs(V.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[T.jsx(V.CardTitle,{className:"text-sm font-medium",children:e}),d&&T.jsx("div",{className:"h-4 w-4 text-muted-foreground",children:d})]}),T.jsxs(V.CardContent,{children:[T.jsx("div",{className:"text-2xl font-bold",children:t}),(r||s)&&T.jsxs("p",{className:"text-xs text-muted-foreground flex items-center mt-1",children:[r&&T.jsxs("span",{className:V.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"&&T.jsx(Re.ArrowUpIcon,{className:"h-3 w-3 mr-1"}),r.direction==="down"&&T.jsx(Re.ArrowDownIcon,{className:"h-3 w-3 mr-1"}),r.direction==="neutral"&&T.jsx(Re.MinusIcon,{className:"h-3 w-3 mr-1"}),r.value,"%"]}),s||r?.label]})]})]})},br=({title:e,value:t,icon:r,trend:n,trendValue:o,description:s,className:l,...d})=>{const c=r&&Pr[r];return T.jsxs(V.Card,{className:V.cn("h-full",l),...d,children:[T.jsxs(V.CardHeader,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[T.jsx(V.CardTitle,{className:"text-sm font-medium",children:e}),c&&T.jsx(c,{className:"h-4 w-4 text-muted-foreground"})]}),T.jsxs(V.CardContent,{children:[T.jsx("div",{className:"text-2xl font-bold",children:t}),(n||o||s)&&T.jsxs("p",{className:"text-xs text-muted-foreground flex items-center mt-1",children:[n&&o&&T.jsxs("span",{className:V.cn("flex items-center mr-2",n==="up"&&"text-green-500",n==="down"&&"text-red-500",n==="neutral"&&"text-yellow-500"),children:[n==="up"&&T.jsx(Re.ArrowUpIcon,{className:"h-3 w-3 mr-1"}),n==="down"&&T.jsx(Re.ArrowDownIcon,{className:"h-3 w-3 mr-1"}),n==="neutral"&&T.jsx(Re.MinusIcon,{className:"h-3 w-3 mr-1"}),o]}),s]})]})]})};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 Qo={DashboardRenderer:Vt,DashboardGridLayout:yr,MetricWidget:vr,MetricCard:br};xe.DashboardGridLayout=yr,xe.DashboardRenderer=Vt,xe.MetricCard=br,xe.MetricWidget=vr,xe.dashboardComponents=Qo,Object.defineProperty(xe,Symbol.toStringTag,{value:"Module"})}));
|