@univerjs/preset-sheets-conditional-formatting 0.5.4 → 0.6.0-alpha.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/lib/umd/index.js +132 -141
- package/package.json +5 -5
package/lib/umd/index.js
CHANGED
|
@@ -7,190 +7,181 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
10
|
-
(function($,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],v):($=typeof globalThis<"u"?globalThis:$||self,v($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,v,c,q,ge,j,ie,qt,de,In,Re,Ge,wn,qe){"use strict";var ka=Object.defineProperty;var Ba=($,v,c)=>v in $?ka($,v,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[v]=c;var Pe=($,v,c)=>Ba($,typeof v!="symbol"?v+"":v,c);const Xt={type:v.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a}=e,l=t.get(c.ConditionalFormattingRuleModel),S=t.get(v.ICommandService),f=t.get(v.IUniverInstanceService),b=q.getSheetCommandTarget(f);if(!b)return!1;const{unitId:m,subUnitId:T}=b,_=l.createCfId(m,T),I={ranges:r,cfId:_,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:a,style:n}};return S.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:I})}},Xe={type:v.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(v.IUndoRedoService),i=t.get(v.ICommandService),a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.IUniverInstanceService),S=q.getSheetCommandTarget(l);if(!S)return!1;const{unitId:f,subUnitId:b}=S,m=a.createCfId(f,b),T={unitId:f,subUnitId:b,rule:{...r,cfId:r.cfId||m}},_=c.AddConditionalRuleMutationUndoFactory(t,T),I=i.syncExecuteCommand(c.AddConditionalRuleMutation.id,T);return I&&n.pushUndoRedo({unitID:f,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:T}],undoMutations:[_]}),I}},Yt={type:v.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:i}=e,a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.ICommandService),S=t.get(v.IUniverInstanceService),f=q.getSheetCommandTarget(S);if(!f)return!1;const{unitId:b,subUnitId:m}=f,T=a.createCfId(b,m),_={ranges:r,cfId:T,stopIfTrue:!!i,rule:{type:c.CFRuleType.colorScale,config:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},Kt={type:v.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:i,nativeColor:a,positiveColor:l,isGradient:S,stopIfTrue:f,isShowValue:b}=e,m=t.get(c.ConditionalFormattingRuleModel),T=t.get(v.IUniverInstanceService),_=q.getSheetCommandTarget(T);if(!_)return!1;const{unitId:I,subUnitId:R}=_,w=t.get(v.ICommandService),h=m.createCfId(I,R),o={ranges:r,cfId:h,stopIfTrue:!!f,rule:{type:c.CFRuleType.dataBar,isShowValue:b,config:{min:n,max:i,nativeColor:a,positiveColor:l,isGradient:S}}};return w.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:R,rule:o})}},$t={type:v.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i}=e,a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.ICommandService),S=t.get(v.IUniverInstanceService),f=q.getSheetCommandTarget(S);if(!f)return!1;const{unitId:b,subUnitId:m}=f,T=a.createCfId(b,m),_={ranges:r,cfId:T,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},Zt={type:v.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a,value:l}=e,S=t.get(c.ConditionalFormattingRuleModel),f=t.get(v.ICommandService),b=t.get(v.IUniverInstanceService),m=q.getSheetCommandTarget(b);if(!m)return!1;const{unitId:T,subUnitId:_}=m,I=S.createCfId(T,_);let R;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(a)){const w=l;if(w.length!==2||!Array.isArray(w))return!1;R={ranges:r,cfId:I,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:a,style:n,value:w}}}else{const w=l;if(typeof w!="number")return!1;R={ranges:r,cfId:I,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:a,style:n,value:w}}}return f.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:_,rule:R})}},Jt={type:v.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,isPercent:a,isBottom:l,value:S}=e,f=t.get(c.ConditionalFormattingRuleModel),b=t.get(v.IUniverInstanceService),m=t.get(v.ICommandService),T=q.getSheetCommandTarget(b);if(!T)return!1;const{unitId:_,subUnitId:I}=T,R=f.createCfId(_,I),w={ranges:r,cfId:R,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:a,isBottom:l,style:n,value:S}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:I,rule:w})}},Qt={type:v.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a,value:l}=e,S=t.get(c.ConditionalFormattingRuleModel),f=t.get(v.IUniverInstanceService),b=q.getSheetCommandTarget(f);if(!b)return!1;const{unitId:m,subUnitId:T}=b,_=t.get(v.ICommandService),I=S.createCfId(m,T),R={ranges:r,cfId:I,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:a,style:n,value:l}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:R})}},en={type:v.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a}=e,l=t.get(c.ConditionalFormattingRuleModel),S=t.get(v.IUniverInstanceService),f=t.get(v.ICommandService),b=q.getSheetCommandTarget(S);if(!b)return!1;const{unitId:m,subUnitId:T}=b,_=l.createCfId(m,T),I={ranges:r,cfId:_,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:a,style:n}};return f.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:I})}},tn={type:v.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i}=e,a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.IUniverInstanceService),S=t.get(v.ICommandService),f=q.getSheetCommandTarget(l);if(!f)return!1;const{unitId:b,subUnitId:m}=f,T=a.createCfId(b,m),_={ranges:r,cfId:T,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return S.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},St={type:v.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var w;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(v.IUniverInstanceService),i=t.get(v.ICommandService),a=t.get(v.IUndoRedoService),l=t.get(q.SheetsSelectionsService),S=q.getSheetCommandTarget(n,e);if(!S)return!1;const{unitId:f,subUnitId:b}=S,m=((w=l.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],T=r.getSubunitRules(f,b);if(!(T!=null&&T.length)||!m.length)return!1;const _=[],I=[];T.forEach(h=>{const o=new v.ObjectMatrix;h.ranges.forEach(d=>{v.Range.foreach(d,(C,u)=>{o.setValue(C,u,1)})}),m.forEach(d=>{v.Range.foreach(d,(C,u)=>{o.realDeleteValue(C,u)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(o));if(s.length){const d={...h,ranges:s},C={unitId:f,subUnitId:b,rule:d},u=c.setConditionalRuleMutationUndoFactory(t,C);_.push({id:c.SetConditionalRuleMutation.id,params:C}),I.push(...u)}else{const d={unitId:f,subUnitId:b,cfId:h.cfId},C=c.DeleteConditionalRuleMutationUndoFactory(t,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),I.push(...C)}});const R=v.sequenceExecute(_,i).result;return R&&a.pushUndoRedo({unitID:f,redoMutations:_,undoMutations:I}),R}},Ye={type:v.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(v.IUniverInstanceService),i=t.get(v.ICommandService),a=t.get(v.IUndoRedoService),l=q.getSheetCommandTarget(n,e);if(!l)return!1;const{unitId:S,subUnitId:f}=l,b=r.getSubunitRules(S,f);if(!(b!=null&&b.length))return!1;const m=b.map(R=>({cfId:R.cfId,unitId:S,subUnitId:f})),T=m.map(R=>({id:c.DeleteConditionalRuleMutation.id,params:R})),_=m.map(R=>c.DeleteConditionalRuleMutationUndoFactory(t,R)[0]),I=v.sequenceExecute(T,i).result;return I&&a.pushUndoRedo({unitID:S,redoMutations:T,undoMutations:_}),I}},Ke={type:v.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),i=t.get(v.IUniverInstanceService),a=q.getSheetCommandTarget(i,e);if(!a)return!1;const{unitId:l,subUnitId:S}=a,f={unitId:l,subUnitId:S,cfId:e.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(t,f),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,f);return m&&r.pushUndoRedo({unitID:l,undoMutations:b,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:f}]}),m}},bt={type:v.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),i=t.get(v.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),l=q.getSheetCommandTarget(i,e);if(!l)return!1;const{unitId:S,subUnitId:f}=l,b=c.transformSupportSymmetryAnchor(e.start,e.end,a.getSubunitRules(S,f)||[],w=>w.cfId);if(!b)return!1;const[m,T]=b,_={unitId:S,subUnitId:f,start:m,end:T},I=c.MoveConditionalRuleMutationUndoFactory(_),R=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return R&&r.pushUndoRedo({unitID:S,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:I}),R}},Rt={type:v.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),i=t.get(v.IUniverInstanceService),a=q.getSheetCommandTarget(i,e);if(!a)return!1;const{unitId:l,subUnitId:S}=a,f={unitId:l,subUnitId:S,rule:e.rule},b=c.setConditionalRuleMutationUndoFactory(t,f),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,f);return m&&r.pushUndoRedo({unitID:l,undoMutations:b,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:f}]}),m}};function Ar(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _n(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var nn={exports:{}},$e={};/**
|
|
11
|
-
|
|
12
|
-
* react-jsx-runtime.production.min.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var xn;function Wr(){if(xn)return $e;xn=1;var t=j,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(S,f,b){var m,T={},_=null,I=null;b!==void 0&&(_=""+b),f.key!==void 0&&(_=""+f.key),f.ref!==void 0&&(I=f.ref);for(m in f)n.call(f,m)&&!a.hasOwnProperty(m)&&(T[m]=f[m]);if(S&&S.defaultProps)for(m in f=S.defaultProps,f)T[m]===void 0&&(T[m]=f[m]);return{$$typeof:e,type:S,key:_,ref:I,props:T,_owner:i.current}}return $e.Fragment=r,$e.jsx=l,$e.jsxs=l,$e}var En;function Hr(){return En||(En=1,nn.exports=Wr()),nn.exports}var x=Hr();const A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var Se=function(){return Se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Se.apply(this,arguments)},kr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},Ue=j.forwardRef(function(t,e){var r=t.icon,n=t.id,i=t.className,a=t.extend,l=kr(t,["icon","id","className","extend"]),S="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),f=j.useRef("_".concat(Gr()));return On(r,"".concat(n),{defIds:r.defIds,idSuffix:f.current},Se({ref:e,className:S},l),a)});function On(t,e,r,n,i){return j.createElement(t.tag,Se(Se({key:e},Br(t,r,i)),n),(Fr(t,r).children||[]).map(function(a,l){return On(a,"".concat(e,"-").concat(t.tag,"-").concat(l),r,void 0,i)}))}function Br(t,e,r){var n=Se({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=e.defIds;return!i||i.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(a){var l=a[0],S=a[1];typeof S=="string"&&(n[l]=S.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Fr(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Se(Se({},t),{children:t.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?Se(Se({},i),{attrs:Se(Se({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):t}function Gr(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var qr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ct=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:qr}))});Ct.displayName="DeleteSingle";var Xr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Pn=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Xr}))});Pn.displayName="IncreaseSingle";var Yr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tt=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:Yr}))});Tt.displayName="MoreDownSingle";var Kr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},Mn=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Kr}))});Mn.displayName="SequenceSingle";var $r={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Ze=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:$r}))});Ze.displayName="SlashSingle";var rn={exports:{}},Je={},Qe={exports:{}},Zr=Qe.exports,Dn;function an(){return Dn||(Dn=1,function(t,e){(function(r,n){n(e)})(Zr,function(r){function n(k){return function(se,O,P,N,z,K,B){return k(se,O,B)}}function i(k){return function(se,O,P,N){if(!se||!O||typeof se!="object"||typeof O!="object")return k(se,O,P,N);var z=N.get(se),K=N.get(O);if(z&&K)return z===O&&K===se;N.set(se,O),N.set(O,se);var B=k(se,O,P,N);return N.delete(se),N.delete(O),B}}function a(k,Q){var se={};for(var O in k)se[O]=k[O];for(var O in Q)se[O]=Q[O];return se}function l(k){return k.constructor===Object||k.constructor==null}function S(k){return typeof k.then=="function"}function f(k,Q){return k===Q||k!==k&&Q!==Q}var b="[object Arguments]",m="[object Boolean]",T="[object Date]",_="[object RegExp]",I="[object Map]",R="[object Number]",w="[object Object]",h="[object Set]",o="[object String]",s=Object.prototype.toString;function d(k){var Q=k.areArraysEqual,se=k.areDatesEqual,O=k.areMapsEqual,P=k.areObjectsEqual,N=k.areRegExpsEqual,z=k.areSetsEqual,K=k.createIsNestedEqual,B=K(J);function J(Z,te,ce){if(Z===te)return!0;if(!Z||!te||typeof Z!="object"||typeof te!="object")return Z!==Z&&te!==te;if(l(Z)&&l(te))return P(Z,te,B,ce);var je=Array.isArray(Z),be=Array.isArray(te);if(je||be)return je===be&&Q(Z,te,B,ce);var me=s.call(Z);return me!==s.call(te)?!1:me===T?se(Z,te,B,ce):me===_?N(Z,te,B,ce):me===I?O(Z,te,B,ce):me===h?z(Z,te,B,ce):me===w||me===b?S(Z)||S(te)?!1:P(Z,te,B,ce):me===m||me===R||me===o?f(Z.valueOf(),te.valueOf()):!1}return J}function C(k,Q,se,O){var P=k.length;if(Q.length!==P)return!1;for(;P-- >0;)if(!se(k[P],Q[P],P,P,k,Q,O))return!1;return!0}var u=i(C);function g(k,Q){return f(k.valueOf(),Q.valueOf())}function p(k,Q,se,O){var P=k.size===Q.size;if(!P)return!1;if(!k.size)return!0;var N={},z=0;return k.forEach(function(K,B){if(P){var J=!1,Z=0;Q.forEach(function(te,ce){!J&&!N[Z]&&(J=se(B,ce,z,Z,k,Q,O)&&se(K,te,B,ce,k,Q,O))&&(N[Z]=!0),Z++}),z++,P=J}}),P}var y=i(p),M="_owner",L=Object.prototype.hasOwnProperty;function V(k,Q,se,O){var P=Object.keys(k),N=P.length;if(Object.keys(Q).length!==N)return!1;for(var z;N-- >0;){if(z=P[N],z===M){var K=!!k.$$typeof,B=!!Q.$$typeof;if((K||B)&&K!==B)return!1}if(!L.call(Q,z)||!se(k[z],Q[z],z,z,k,Q,O))return!1}return!0}var U=i(V);function E(k,Q){return k.source===Q.source&&k.flags===Q.flags}function D(k,Q,se,O){var P=k.size===Q.size;if(!P)return!1;if(!k.size)return!0;var N={};return k.forEach(function(z,K){if(P){var B=!1,J=0;Q.forEach(function(Z,te){!B&&!N[J]&&(B=se(z,Z,K,te,k,Q,O))&&(N[J]=!0),J++}),P=B}}),P}var W=i(D),X=Object.freeze({areArraysEqual:C,areDatesEqual:g,areMapsEqual:p,areObjectsEqual:V,areRegExpsEqual:E,areSetsEqual:D,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:u,areDatesEqual:g,areMapsEqual:y,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:W,createIsNestedEqual:n}),ne=d(X);function ee(k,Q){return ne(k,Q,void 0)}var F=d(a(X,{createIsNestedEqual:function(){return f}}));function H(k,Q){return F(k,Q,void 0)}var re=d(Y);function oe(k,Q){return re(k,Q,new WeakMap)}var ue=d(a(Y,{createIsNestedEqual:function(){return f}}));function he(k,Q){return ue(k,Q,new WeakMap)}function ye(k){return d(a(X,k(X)))}function Ce(k){var Q=d(a(Y,k(Y)));return function(se,O,P){return P===void 0&&(P=new WeakMap),Q(se,O,P)}}r.circularDeepEqual=oe,r.circularShallowEqual=he,r.createCustomCircularEqual=Ce,r.createCustomEqual=ye,r.deepEqual=ee,r.sameValueZeroEqual=f,r.shallowEqual=H,Object.defineProperty(r,"__esModule",{value:!0})})}(Qe,Qe.exports)),Qe.exports}var It={exports:{}},Nn;function on(){if(Nn)return It.exports;Nn=1;function t(r){var n,i,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var l=r.length;for(n=0;n<l;n++)r[n]&&(i=t(r[n]))&&(a&&(a+=" "),a+=i)}else for(i in r)r[i]&&(a&&(a+=" "),a+=i);return a}function e(){for(var r,n,i=0,a="",l=arguments.length;i<l;i++)(r=arguments[i])&&(n=t(r))&&(a&&(a+=" "),a+=n);return a}return It.exports=e,It.exports.clsx=e,It.exports}var ae={},sn,jn;function Jr(){return jn||(jn=1,sn=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),sn}var Ln;function Ve(){if(Ln)return ae;Ln=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=n,ae.childrenEqual=f,ae.cloneLayout=i,ae.cloneLayoutItem=S,ae.collides=m,ae.compact=T,ae.compactItem=R,ae.compactType=k,ae.correctBounds=w,ae.fastPositionEqual=b,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=o,ae.getLayoutItem=h,ae.getStatics=d,ae.modifyLayout=a,ae.moveElement=C,ae.moveElementAwayFromCollision=u,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=F,ae.setTopLeft=re,ae.setTransform=H,ae.sortLayoutItems=oe,ae.sortLayoutItemsByColRow=he,ae.sortLayoutItemsByRowCol=ue,ae.synchronizeLayoutWithChildren=ye,ae.validateLayout=Ce,ae.withLayoutItem=l;var t=an(),e=r(j);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,N;for(let z=0,K=O.length;z<K;z++)N=O[z].y+O[z].h,N>P&&(P=N);return P}function i(O){const P=Array(O.length);for(let N=0,z=O.length;N<z;N++)P[N]=S(O[N]);return P}function a(O,P){const N=Array(O.length);for(let z=0,K=O.length;z<K;z++)P.i===O[z].i?N[z]=P:N[z]=O[z];return N}function l(O,P,N){let z=h(O,P);return z?(z=N(S(z)),O=a(O,z),[O,z]):[O,null]}function S(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function f(O,P){return(0,t.deepEqual)(e.default.Children.map(O,N=>N==null?void 0:N.key),e.default.Children.map(P,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(O,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]))}ae.fastRGLPropsEqual=Jr();function b(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function m(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function T(O,P,N,z){const K=d(O),B=oe(O,P),J=Array(O.length);for(let Z=0,te=B.length;Z<te;Z++){let ce=S(B[Z]);ce.static||(ce=R(K,ce,P,N,B,z),K.push(ce)),J[O.indexOf(B[Z])]=ce,ce.moved=!1}return J}const _={x:"w",y:"h"};function I(O,P,N,z){const K=_[z];P[z]+=1;const B=O.map(J=>J.i).indexOf(P.i);for(let J=B+1;J<O.length;J++){const Z=O[J];if(!Z.static){if(Z.y>P.y+P.h)break;m(P,Z)&&I(O,Z,N+P[K],z)}}P[z]=N}function R(O,P,N,z,K,B){const J=N==="vertical",Z=N==="horizontal";if(J)for(P.y=Math.min(n(O),P.y);P.y>0&&!o(O,P);)P.y--;else if(Z)for(;P.x>0&&!o(O,P);)P.x--;let te;for(;(te=o(O,P))&&!(N===null&&B);)if(Z?I(K,P,te.x+te.w,"x"):I(K,P,te.y+te.h,"y"),Z&&P.x+P.w>z)for(P.x=z-P.w,P.y++;P.x>0&&!o(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function w(O,P){const N=d(O);for(let z=0,K=O.length;z<K;z++){const B=O[z];if(B.x+B.w>P.cols&&(B.x=P.cols-B.w),B.x<0&&(B.x=0,B.w=P.cols),!B.static)N.push(B);else for(;o(N,B);)B.y++}return O}function h(O,P){for(let N=0,z=O.length;N<z;N++)if(O[N].i===P)return O[N]}function o(O,P){for(let N=0,z=O.length;N<z;N++)if(m(O[N],P))return O[N]}function s(O,P){return O.filter(N=>m(N,P))}function d(O){return O.filter(P=>P.static)}function C(O,P,N,z,K,B,J,Z,te){if(P.static&&P.isDraggable!==!0||P.y===z&&P.x===N)return O;`${P.i}${String(N)}${String(z)}${P.x}${P.y}`;const ce=P.x,je=P.y;typeof N=="number"&&(P.x=N),typeof z=="number"&&(P.y=z),P.moved=!0;let be=oe(O,J);(J==="vertical"&&typeof z=="number"?je>=z:J==="horizontal"&&typeof N=="number"?ce>=N:!1)&&(be=be.reverse());const Fe=s(be,P),Gt=Fe.length>0;if(Gt&&te)return i(O);if(Gt&&B)return`${P.i}`,P.x=ce,P.y=je,P.moved=!1,O;for(let Tn=0,Ha=Fe.length;Tn<Ha;Tn++){const Le=Fe[Tn];`${P.i}${P.x}${P.y}${Le.i}${Le.x}${Le.y}`,!Le.moved&&(Le.static?O=u(O,Le,P,K,J):O=u(O,P,Le,K,J))}return O}function u(O,P,N,z,K,B){const J=K==="horizontal",Z=K==="vertical",te=P.static;if(z){z=!1;const be={x:J?Math.max(P.x-N.w,0):N.x,y:Z?Math.max(P.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},me=o(O,be),Fe=me&&me.y+me.h>P.y,Gt=me&&P.x+P.w>me.x;if(me){if(Fe&&Z)return C(O,N,void 0,P.y+1,z,te,K);if(Fe&&K==null)return P.y=N.y,N.y=N.y+N.h,O;if(Gt&&J)return C(O,P,N.x,void 0,z,te,K)}else return`${N.i}${be.x}${be.y}`,C(O,N,J?be.x:void 0,Z?be.y:void 0,z,te,K)}const ce=J?N.x+1:void 0,je=Z?N.y+1:void 0;return ce==null&&je==null?O:C(O,N,J?N.x+1:void 0,Z?N.y+1:void 0,z,te,K)}function g(O){return O*100+"%"}const p=(O,P,N,z)=>O+N>z?P:N,y=(O,P,N)=>O<0?P:N,M=O=>Math.max(0,O),L=O=>Math.max(0,O),V=(O,P,N)=>{let{left:z,height:K,width:B}=P;const J=O.top-(K-O.height);return{left:z,width:B,height:y(J,O.height,K),top:L(J)}},U=(O,P,N)=>{let{top:z,left:K,height:B,width:J}=P;return{top:z,height:B,width:p(O.left,O.width,J,N),left:M(K)}},E=(O,P,N)=>{let{top:z,height:K,width:B}=P;const J=O.left-(B-O.width);return{height:K,width:J<0?O.width:p(O.left,O.width,B,N),top:L(z),left:M(J)}},D=(O,P,N)=>{let{top:z,left:K,height:B,width:J}=P;return{width:J,left:K,height:y(z,O.height,B),top:L(z)}},ee={n:V,ne:function(){return V(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return D(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:D,sw:function(){return D(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return V(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function F(O,P,N,z){const K=ee[O];return K?K(P,{...P,...N},z):N}function H(O){let{top:P,left:N,width:z,height:K}=O;const B=`translate(${N}px,${P}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${z}px`,height:`${K}px`,position:"absolute"}}function re(O){let{top:P,left:N,width:z,height:K}=O;return{top:`${P}px`,left:`${N}px`,width:`${z}px`,height:`${K}px`,position:"absolute"}}function oe(O,P){return P==="horizontal"?he(O):P==="vertical"?ue(O):O}function ue(O){return O.slice(0).sort(function(P,N){return P.y>N.y||P.y===N.y&&P.x>N.x?1:P.y===N.y&&P.x===N.x?0:-1})}function he(O){return O.slice(0).sort(function(P,N){return P.x>N.x||P.x===N.x&&P.y>N.y?1:-1})}function ye(O,P,N,z,K){O=O||[];const B=[];e.default.Children.forEach(P,Z=>{if((Z==null?void 0:Z.key)==null)return;const te=h(O,String(Z.key)),ce=Z.props["data-grid"];te&&ce==null?B.push(S(te)):ce?B.push(S({...ce,i:Z.key})):B.push(S({w:1,h:1,x:0,y:n(B),i:String(Z.key)}))});const J=w(B,{cols:N});return K?J:T(J,z,N)}function Ce(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let z=0,K=O.length;z<K;z++){const B=O[z];for(let J=0;J<N.length;J++)if(typeof B[N[J]]!="number")throw new Error("ReactGridLayout: "+P+"["+z+"]."+N[J]+" must be a number!")}}function k(O){const{verticalCompact:P,compactType:N}=O||{};return P===!1?null:N}function Q(){}const se=()=>{};return ae.noop=se,ae}var Ie={},Un;function ln(){if(Un)return Ie;Un=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=r,Ie.calcGridItemWHPx=e,Ie.calcWH=i,Ie.calcXY=n,Ie.clamp=a;function t(l){const{margin:S,containerPadding:f,containerWidth:b,cols:m}=l;return(b-S[0]*(m-1)-f[0]*2)/m}function e(l,S,f){return Number.isFinite(l)?Math.round(S*l+Math.max(0,l-1)*f):l}function r(l,S,f,b,m,T){const{margin:_,containerPadding:I,rowHeight:R}=l,w=t(l),h={};return T&&T.resizing?(h.width=Math.round(T.resizing.width),h.height=Math.round(T.resizing.height)):(h.width=e(b,w,_[0]),h.height=e(m,R,_[1])),T&&T.dragging?(h.top=Math.round(T.dragging.top),h.left=Math.round(T.dragging.left)):T&&T.resizing&&typeof T.resizing.top=="number"&&typeof T.resizing.left=="number"?(h.top=Math.round(T.resizing.top),h.left=Math.round(T.resizing.left)):(h.top=Math.round((R+_[1])*f+I[1]),h.left=Math.round((w+_[0])*S+I[0])),h}function n(l,S,f,b,m){const{margin:T,cols:_,rowHeight:I,maxRows:R}=l,w=t(l);let h=Math.round((f-T[0])/(w+T[0])),o=Math.round((S-T[1])/(I+T[1]));return h=a(h,0,_-b),o=a(o,0,R-m),{x:h,y:o}}function i(l,S,f,b,m,T){const{margin:_,maxRows:I,cols:R,rowHeight:w}=l,h=t(l);let o=Math.round((S+_[0])/(h+_[0])),s=Math.round((f+_[1])/(w+_[1])),d=a(o,0,R-b),C=a(s,0,I-m);return["sw","w","nw"].indexOf(T)!==-1&&(d=a(o,0,R)),["nw","n","ne"].indexOf(T)!==-1&&(C=a(s,0,I)),{w:d,h:C}}function a(l,S,f){return Math.max(Math.min(l,f),S)}return Ie}var et={},un={exports:{}},cn,Vn;function Qr(){if(Vn)return cn;Vn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cn=t,cn}var dn,zn;function ei(){if(zn)return dn;zn=1;var t=Qr();function e(){}function r(){}return r.resetWarningCache=e,dn=function(){function n(l,S,f,b,m,T){if(T!==t){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",_}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},dn}var An;function xe(){return An||(An=1,un.exports=ei()()),un.exports}var tt={exports:{}},fn={};function Wn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Wn(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Hn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Wn(t))&&(n&&(n+=" "),n+=e);return n}const ti=_n(Object.freeze(Object.defineProperty({__proto__:null,clsx:Hn,default:Hn},Symbol.toStringTag,{value:"Module"})));var fe={},Ee={},kn;function wt(){if(kn)return Ee;kn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.dontSetMe=i,Ee.findInArray=t,Ee.int=n,Ee.isFunction=e,Ee.isNum=r;function t(a,l){for(let S=0,f=a.length;S<f;S++)if(l.apply(l,[a[S],S,a]))return a[S]}function e(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"}function r(a){return typeof a=="number"&&!isNaN(a)}function n(a){return parseInt(a,10)}function i(a,l,S){if(a[l])return new Error("Invalid prop ".concat(l," passed to ").concat(S," - do not set this, set it on the child."))}return Ee}var Oe={},Bn;function ni(){if(Bn)return Oe;Bn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.browserPrefixToKey=r,Oe.browserPrefixToStyle=n,Oe.default=void 0,Oe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var a;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const S=(a=window.document)===null||a===void 0||(a=a.documentElement)===null||a===void 0?void 0:a.style;if(!S||l in S)return"";for(let f=0;f<t.length;f++)if(r(l,t[f])in S)return t[f];return""}function r(a,l){return l?"".concat(l).concat(i(a)):a}function n(a,l){return l?"-".concat(l.toLowerCase(),"-").concat(a):a}function i(a){let l="",S=!0;for(let f=0;f<a.length;f++)S?(l+=a[f].toUpperCase(),S=!1):a[f]==="-"?S=!0:l+=a[f];return l}return Oe.default=e(),Oe}var Fn;function pn(){if(Fn)return fe;Fn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=u,fe.addEvent=S,fe.addUserSelectStyles=d,fe.createCSSTransform=R,fe.createSVGTransform=w,fe.getTouch=o,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=T,fe.innerWidth=_,fe.matchesSelector=a,fe.matchesSelectorAndParentsTo=l,fe.offsetXYFromParent=I,fe.outerHeight=b,fe.outerWidth=m,fe.removeClassName=g,fe.removeEvent=f,fe.removeUserSelectStyles=C;var t=wt(),e=n(ni());function r(p){if(typeof WeakMap!="function")return null;var y=new WeakMap,M=new WeakMap;return(r=function(L){return L?M:y})(p)}function n(p,y){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var M=r(y);if(M&&M.has(p))return M.get(p);var L={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in p)if(U!=="default"&&Object.prototype.hasOwnProperty.call(p,U)){var E=V?Object.getOwnPropertyDescriptor(p,U):null;E&&(E.get||E.set)?Object.defineProperty(L,U,E):L[U]=p[U]}return L.default=p,M&&M.set(p,L),L}let i="";function a(p,y){return i||(i=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(p[M])})),(0,t.isFunction)(p[i])?p[i](y):!1}function l(p,y,M){let L=p;do{if(a(L,y))return!0;if(L===M)return!1;L=L.parentNode}while(L);return!1}function S(p,y,M,L){if(!p)return;const V={capture:!0,...L};p.addEventListener?p.addEventListener(y,M,V):p.attachEvent?p.attachEvent("on"+y,M):p["on"+y]=M}function f(p,y,M,L){if(!p)return;const V={capture:!0,...L};p.removeEventListener?p.removeEventListener(y,M,V):p.detachEvent?p.detachEvent("on"+y,M):p["on"+y]=null}function b(p){let y=p.clientHeight;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y+=(0,t.int)(M.borderTopWidth),y+=(0,t.int)(M.borderBottomWidth),y}function m(p){let y=p.clientWidth;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y+=(0,t.int)(M.borderLeftWidth),y+=(0,t.int)(M.borderRightWidth),y}function T(p){let y=p.clientHeight;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y-=(0,t.int)(M.paddingTop),y-=(0,t.int)(M.paddingBottom),y}function _(p){let y=p.clientWidth;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y-=(0,t.int)(M.paddingLeft),y-=(0,t.int)(M.paddingRight),y}function I(p,y,M){const V=y===y.ownerDocument.body?{left:0,top:0}:y.getBoundingClientRect(),U=(p.clientX+y.scrollLeft-V.left)/M,E=(p.clientY+y.scrollTop-V.top)/M;return{x:U,y:E}}function R(p,y){const M=h(p,y,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function w(p,y){return h(p,y,"")}function h(p,y,M){let{x:L,y:V}=p,U="translate(".concat(L).concat(M,",").concat(V).concat(M,")");if(y){const E="".concat(typeof y.x=="string"?y.x:y.x+M),D="".concat(typeof y.y=="string"?y.y:y.y+M);U="translate(".concat(E,", ").concat(D,")")+U}return U}function o(p,y){return p.targetTouches&&(0,t.findInArray)(p.targetTouches,M=>y===M.identifier)||p.changedTouches&&(0,t.findInArray)(p.changedTouches,M=>y===M.identifier)}function s(p){if(p.targetTouches&&p.targetTouches[0])return p.targetTouches[0].identifier;if(p.changedTouches&&p.changedTouches[0])return p.changedTouches[0].identifier}function d(p){if(!p)return;let y=p.getElementById("react-draggable-style-el");y||(y=p.createElement("style"),y.type="text/css",y.id="react-draggable-style-el",y.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
19
|
-
`,y.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
20
|
-
`,p.getElementsByTagName("head")[0].appendChild(y)),p.body&&u(p.body,"react-draggable-transparent-selection")}function C(p){if(p)try{if(p.body&&g(p.body,"react-draggable-transparent-selection"),p.selection)p.selection.empty();else{const y=(p.defaultView||window).getSelection();y&&y.type!=="Caret"&&y.removeAllRanges()}}catch{}}function u(p,y){p.classList?p.classList.add(y):p.className.match(new RegExp("(?:^|\\s)".concat(y,"(?!\\S)")))||(p.className+=" ".concat(y))}function g(p,y){p.classList?p.classList.remove(y):p.className=p.className.replace(new RegExp("(?:^|\\s)".concat(y,"(?!\\S)"),"g"),"")}return fe}var Te={},Gn;function qn(){if(Gn)return Te;Gn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.canDragX=i,Te.canDragY=a,Te.createCoreData=S,Te.createDraggableData=f,Te.getBoundPosition=r,Te.getControlPosition=l,Te.snapToGrid=n;var t=wt(),e=pn();function r(T,_,I){if(!T.props.bounds)return[_,I];let{bounds:R}=T.props;R=typeof R=="string"?R:b(R);const w=m(T);if(typeof R=="string"){const{ownerDocument:h}=w,o=h.defaultView;let s;if(R==="parent"?s=w.parentNode:s=h.querySelector(R),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+R+'" could not find an element.');const d=s,C=o.getComputedStyle(w),u=o.getComputedStyle(d);R={left:-w.offsetLeft+(0,t.int)(u.paddingLeft)+(0,t.int)(C.marginLeft),top:-w.offsetTop+(0,t.int)(u.paddingTop)+(0,t.int)(C.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(w)-w.offsetLeft+(0,t.int)(u.paddingRight)-(0,t.int)(C.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(w)-w.offsetTop+(0,t.int)(u.paddingBottom)-(0,t.int)(C.marginBottom)}}return(0,t.isNum)(R.right)&&(_=Math.min(_,R.right)),(0,t.isNum)(R.bottom)&&(I=Math.min(I,R.bottom)),(0,t.isNum)(R.left)&&(_=Math.max(_,R.left)),(0,t.isNum)(R.top)&&(I=Math.max(I,R.top)),[_,I]}function n(T,_,I){const R=Math.round(_/T[0])*T[0],w=Math.round(I/T[1])*T[1];return[R,w]}function i(T){return T.props.axis==="both"||T.props.axis==="x"}function a(T){return T.props.axis==="both"||T.props.axis==="y"}function l(T,_,I){const R=typeof _=="number"?(0,e.getTouch)(T,_):null;if(typeof _=="number"&&!R)return null;const w=m(I),h=I.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,e.offsetXYFromParent)(R||T,h,I.props.scale)}function S(T,_,I){const R=!(0,t.isNum)(T.lastX),w=m(T);return R?{node:w,deltaX:0,deltaY:0,lastX:_,lastY:I,x:_,y:I}:{node:w,deltaX:_-T.lastX,deltaY:I-T.lastY,lastX:T.lastX,lastY:T.lastY,x:_,y:I}}function f(T,_){const I=T.props.scale;return{node:_.node,x:T.state.x+_.deltaX/I,y:T.state.y+_.deltaY/I,deltaX:_.deltaX/I,deltaY:_.deltaY/I,lastX:T.state.x,lastY:T.state.y}}function b(T){return{left:T.left,top:T.top,right:T.right,bottom:T.bottom}}function m(T){const _=T.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Te}var nt={},_t={},Xn;function Yn(){if(Xn)return _t;Xn=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=t;function t(){}return _t}var Kn;function ri(){if(Kn)return nt;Kn=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=b(j),e=S(xe()),r=S(In),n=pn(),i=qn(),a=wt(),l=S(Yn());function S(h){return h&&h.__esModule?h:{default:h}}function f(h){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(f=function(d){return d?s:o})(h)}function b(h,o){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=f(o);if(s&&s.has(h))return s.get(h);var d={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=C?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(d,u,g):d[u]=h[u]}return d.default=h,s&&s.set(h,d),d}function m(h,o,s){return o=T(o),o in h?Object.defineProperty(h,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[o]=s,h}function T(h){var o=_(h,"string");return typeof o=="symbol"?o:String(o)}function _(h,o){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,o||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let R=I.mouse,w=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",o=>{if(this.props.onMouseDown(o),!this.props.allowAnyClick&&typeof o.button=="number"&&o.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:d}=s;if(this.props.disabled||!(o.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(o.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(o.target,this.props.cancel,s))return;o.type==="touchstart"&&o.preventDefault();const C=(0,n.getTouchIdentifier)(o);this.touchIdentifier=C;const u=(0,i.getControlPosition)(o,C,this);if(u==null)return;const{x:g,y:p}=u,y=(0,i.createCoreData)(this,g,p);(0,l.default)("DraggableCore: handleDragStart: %j",y),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(o,y)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=p,(0,n.addEvent)(d,R.move,this.handleDrag),(0,n.addEvent)(d,R.stop,this.handleDragStop))}),m(this,"handleDrag",o=>{const s=(0,i.getControlPosition)(o,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let p=d-this.lastX,y=C-this.lastY;if([p,y]=(0,i.snapToGrid)(this.props.grid,p,y),!p&&!y)return;d=this.lastX+p,C=this.lastY+y}const u=(0,i.createCoreData)(this,d,C);if((0,l.default)("DraggableCore: handleDrag: %j",u),this.props.onDrag(o,u)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const y=document.createEvent("MouseEvents");y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(y)}return}this.lastX=d,this.lastY=C}),m(this,"handleDragStop",o=>{if(!this.dragging)return;const s=(0,i.getControlPosition)(o,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let y=d-this.lastX||0,M=C-this.lastY||0;[y,M]=(0,i.snapToGrid)(this.props.grid,y,M),d=this.lastX+y,C=this.lastY+M}const u=(0,i.createCoreData)(this,d,C);if(this.props.onStop(o,u)===!1||this.mounted===!1)return!1;const p=this.findDOMNode();p&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(p.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",u),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,p&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(p.ownerDocument,R.move,this.handleDrag),(0,n.removeEvent)(p.ownerDocument,R.stop,this.handleDragStop))}),m(this,"onMouseDown",o=>(R=I.mouse,this.handleDragStart(o))),m(this,"onMouseUp",o=>(R=I.mouse,this.handleDragStop(o))),m(this,"onTouchStart",o=>(R=I.touch,this.handleDragStart(o))),m(this,"onTouchEnd",o=>(R=I.touch,this.handleDragStop(o)))}componentDidMount(){this.mounted=!0;const o=this.findDOMNode();o&&(0,n.addEvent)(o,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const o=this.findDOMNode();if(o){const{ownerDocument:s}=o;(0,n.removeEvent)(s,I.mouse.move,this.handleDrag),(0,n.removeEvent)(s,I.touch.move,this.handleDrag),(0,n.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,n.removeEvent)(o,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var o,s;return(o=this.props)!==null&&o!==void 0&&o.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return nt.default=w,m(w,"displayName","DraggableCore"),m(w,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,o){if(h[o]&&h[o].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel: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,className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),nt}var $n;function ii(){return $n||($n=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),t.default=void 0;var e=_(j),r=m(xe()),n=m(In),i=m(ti),a=pn(),l=qn(),S=wt(),f=m(ri()),b=m(Yn());function m(s){return s&&s.__esModule?s:{default:s}}function T(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(T=function(u){return u?C:d})(s)}function _(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=T(d);if(C&&C.has(s))return C.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in s)if(p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)){var y=g?Object.getOwnPropertyDescriptor(s,p):null;y&&(y.get||y.set)?Object.defineProperty(u,p,y):u[p]=s[p]}return u.default=s,C&&C.set(s,u),u}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var u in C)Object.prototype.hasOwnProperty.call(C,u)&&(s[u]=C[u])}return s},I.apply(this,arguments)}function R(s,d,C){return d=w(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function w(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var u=C.call(s,d||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class o extends e.Component{static getDerivedStateFromProps(d,C){let{position:u}=d,{prevPropsPosition:g}=C;return u&&(!g||u.x!==g.x||u.y!==g.y)?((0,b.default)("Draggable: getDerivedStateFromProps %j",{position:u,prevPropsPosition:g}),{x:u.x,y:u.y,prevPropsPosition:{...u}}):null}constructor(d){super(d),R(this,"onDragStart",(C,u)=>{if((0,b.default)("Draggable: onDragStart: %j",u),this.props.onStart(C,(0,l.createDraggableData)(this,u))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),R(this,"onDrag",(C,u)=>{if(!this.state.dragging)return!1;(0,b.default)("Draggable: onDrag: %j",u);const g=(0,l.createDraggableData)(this,u),p={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:L}=p;p.x+=this.state.slackX,p.y+=this.state.slackY;const[V,U]=(0,l.getBoundPosition)(this,p.x,p.y);p.x=V,p.y=U,p.slackX=this.state.slackX+(M-p.x),p.slackY=this.state.slackY+(L-p.y),g.x=p.x,g.y=p.y,g.deltaX=p.x-this.state.x,g.deltaY=p.y-this.state.y}if(this.props.onDrag(C,g)===!1)return!1;this.setState(p)}),R(this,"onDragStop",(C,u)=>{if(!this.state.dragging||this.props.onStop(C,(0,l.createDraggableData)(this,u))===!1)return!1;(0,b.default)("Draggable: onDragStop: %j",u);const p={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:L}=this.props.position;p.x=M,p.y=L}this.setState(p)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var d,C;return(d=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:C,children:u,defaultPosition:g,defaultClassName:p,defaultClassNameDragging:y,defaultClassNameDragged:M,position:L,positionOffset:V,scale:U,...E}=this.props;let D={},W=null;const Y=!!!L||this.state.dragging,ne=L||g,ee={x:(0,l.canDragX)(this)&&Y?this.state.x:ne.x,y:(0,l.canDragY)(this)&&Y?this.state.y:ne.y};this.state.isElementSVG?W=(0,a.createSVGTransform)(ee,V):D=(0,a.createCSSTransform)(ee,V);const F=(0,i.default)(u.props.className||"",p,{[y]:this.state.dragging,[M]:this.state.dragged});return e.createElement(f.default,I({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(u),{className:F,style:{...u.props.style,...D},transform:W}))}}t.default=o,R(o,"displayName","Draggable"),R(o,"propTypes",{...f.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:S.dontSetMe,style:S.dontSetMe,transform:S.dontSetMe}),R(o,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(fn)),fn}var Zn;function hn(){if(Zn)return tt.exports;Zn=1;const{default:t,DraggableCore:e}=ii();return tt.exports=t,tt.exports.default=t,tt.exports.DraggableCore=e,tt.exports}var rt={exports:{}},it={},xt={},Jn;function ai(){if(Jn)return xt;Jn=1,xt.__esModule=!0,xt.cloneElement=S;var t=e(j);function e(f){return f&&f.__esModule?f:{default:f}}function r(f,b){var m=Object.keys(f);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(f);b&&(T=T.filter(function(_){return Object.getOwnPropertyDescriptor(f,_).enumerable})),m.push.apply(m,T)}return m}function n(f){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?r(Object(m),!0).forEach(function(T){i(f,T,m[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(T){Object.defineProperty(f,T,Object.getOwnPropertyDescriptor(m,T))})}return f}function i(f,b,m){return b=a(b),b in f?Object.defineProperty(f,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[b]=m,f}function a(f){var b=l(f,"string");return typeof b=="symbol"?b:String(b)}function l(f,b){if(typeof f!="object"||f===null)return f;var m=f[Symbol.toPrimitive];if(m!==void 0){var T=m.call(f,b||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(f)}function S(f,b){return b.style&&f.props.style&&(b.style=n(n({},f.props.style),b.style)),b.className&&f.props.className&&(b.className=f.props.className+" "+b.className),t.default.cloneElement(f,b)}return xt}var at={},Qn;function er(){if(Qn)return at;Qn=1,at.__esModule=!0,at.resizableProps=void 0;var t=e(xe());hn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle: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}),height:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];var S=a[0];if(S.axis==="both"||S.axis==="y"){var f;return(f=t.default.number).isRequired.apply(f,a)}return t.default.number.apply(t.default,a)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];var S=a[0];if(S.axis==="both"||S.axis==="x"){var f;return(f=t.default.number).isRequired.apply(f,a)}return t.default.number.apply(t.default,a)}};return at.resizableProps=r,at}var tr;function nr(){if(tr)return it;tr=1,it.__esModule=!0,it.default=void 0;var t=l(j),e=hn(),r=ai(),n=er(),i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a(o){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(a=function(u){return u?d:s})(o)}function l(o,s){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var d=a(s);if(d&&d.has(o))return d.get(o);var C={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in o)if(g!=="default"&&Object.prototype.hasOwnProperty.call(o,g)){var p=u?Object.getOwnPropertyDescriptor(o,g):null;p&&(p.get||p.set)?Object.defineProperty(C,g,p):C[g]=o[g]}return C.default=o,d&&d.set(o,C),C}function S(){return S=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(o[C]=d[C])}return o},S.apply(this,arguments)}function f(o,s){if(o==null)return{};var d={},C=Object.keys(o),u,g;for(g=0;g<C.length;g++)u=C[g],!(s.indexOf(u)>=0)&&(d[u]=o[u]);return d}function b(o,s){var d=Object.keys(o);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(o);s&&(C=C.filter(function(u){return Object.getOwnPropertyDescriptor(o,u).enumerable})),d.push.apply(d,C)}return d}function m(o){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?b(Object(d),!0).forEach(function(C){T(o,C,d[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(C){Object.defineProperty(o,C,Object.getOwnPropertyDescriptor(d,C))})}return o}function T(o,s,d){return s=_(s),s in o?Object.defineProperty(o,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):o[s]=d,o}function _(o){var s=I(o,"string");return typeof s=="symbol"?s:String(s)}function I(o,s){if(typeof o!="object"||o===null)return o;var d=o[Symbol.toPrimitive];if(d!==void 0){var C=d.call(o,s||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}function R(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,w(o,s)}function w(o,s){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,u){return C.__proto__=u,C},w(o,s)}var h=function(o){R(s,o);function s(){for(var C,u=arguments.length,g=new Array(u),p=0;p<u;p++)g[p]=arguments[p];return C=o.call.apply(o,[this].concat(g))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(u,g){var p=this.props,y=p.minConstraints,M=p.maxConstraints,L=p.lockAspectRatio;if(!y&&!M&&!L)return[u,g];if(L){var V=this.props.width/this.props.height,U=u-this.props.width,E=g-this.props.height;Math.abs(U)>Math.abs(E*V)?g=u/V:u=g*V}var D=u,W=g,X=this.slack||[0,0],Y=X[0],ne=X[1];return u+=Y,g+=ne,y&&(u=Math.max(y[0],u),g=Math.max(y[1],g)),M&&(u=Math.min(M[0],u),g=Math.min(M[1],g)),this.slack=[Y+(D-u),ne+(W-g)],[u,g]},d.resizeHandler=function(u,g){var p=this;return function(y,M){var L=M.node,V=M.deltaX,U=M.deltaY;u==="onResizeStart"&&p.resetData();var E=(p.props.axis==="both"||p.props.axis==="x")&&g!=="n"&&g!=="s",D=(p.props.axis==="both"||p.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!E&&!D)){var W=g[0],X=g[g.length-1],Y=L.getBoundingClientRect();if(p.lastHandleRect!=null){if(X==="w"){var ne=Y.left-p.lastHandleRect.left;V+=ne}if(W==="n"){var ee=Y.top-p.lastHandleRect.top;U+=ee}}p.lastHandleRect=Y,X==="w"&&(V=-V),W==="n"&&(U=-U);var F=p.props.width+(E?V/p.props.transformScale:0),H=p.props.height+(D?U/p.props.transformScale:0),re=p.runConstraints(F,H);F=re[0],H=re[1];var oe=F!==p.props.width||H!==p.props.height,ue=typeof p.props[u]=="function"?p.props[u]:null,he=u==="onResize"&&!oe;ue&&!he&&(y.persist==null||y.persist(),ue(y,{node:L,size:{width:F,height:H},handle:g})),u==="onResizeStop"&&p.resetData()}}},d.renderResizeHandle=function(u,g){var p=this.props.handle;if(!p)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+u,ref:g});if(typeof p=="function")return p(u,g);var y=typeof p.type=="string",M=m({ref:g},y?{}:{handleAxis:u});return t.cloneElement(p,M)},d.render=function(){var u=this,g=this.props,p=g.children,y=g.className,M=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var L=g.resizeHandles;g.transformScale;var V=f(g,i);return(0,r.cloneElement)(p,m(m({},V),{},{className:(y?y+" ":"")+"react-resizable",children:[].concat(p.props.children,L.map(function(U){var E,D=(E=u.handleRefs[U])!=null?E:u.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,S({},M,{nodeRef:D,key:"resizableHandle-"+U,onStop:u.resizeHandler("onResizeStop",U),onStart:u.resizeHandler("onResizeStart",U),onDrag:u.resizeHandler("onResize",U)}),u.renderResizeHandle(U,D))}))}))},s}(t.Component);return it.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},it}var ot={},rr;function oi(){if(rr)return ot;rr=1,ot.__esModule=!0,ot.default=void 0;var t=S(j),e=a(xe()),r=a(nr()),n=er(),i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a(s){return s&&s.__esModule?s:{default:s}}function l(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(l=function(g){return g?C:d})(s)}function S(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=l(d);if(C&&C.has(s))return C.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in s)if(p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)){var y=g?Object.getOwnPropertyDescriptor(s,p):null;y&&(y.get||y.set)?Object.defineProperty(u,p,y):u[p]=s[p]}return u.default=s,C&&C.set(s,u),u}function f(){return f=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var u in C)Object.prototype.hasOwnProperty.call(C,u)&&(s[u]=C[u])}return s},f.apply(this,arguments)}function b(s,d){var C=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);d&&(u=u.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),C.push.apply(C,u)}return C}function m(s){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?b(Object(C),!0).forEach(function(u){T(s,u,C[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(C)):b(Object(C)).forEach(function(u){Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(C,u))})}return s}function T(s,d,C){return d=_(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function _(s){var d=I(s,"string");return typeof d=="symbol"?d:String(d)}function I(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var u=C.call(s,d||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function R(s,d){if(s==null)return{};var C={},u=Object.keys(s),g,p;for(p=0;p<u.length;p++)g=u[p],!(d.indexOf(g)>=0)&&(C[g]=s[g]);return C}function w(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,g){return u.__proto__=g,u},h(s,d)}var o=function(s){w(d,s);function d(){for(var u,g=arguments.length,p=new Array(g),y=0;y<g;y++)p[y]=arguments[y];return u=s.call.apply(s,[this].concat(p))||this,u.state={width:u.props.width,height:u.props.height,propsWidth:u.props.width,propsHeight:u.props.height},u.onResize=function(M,L){var V=L.size;u.props.onResize?(M.persist==null||M.persist(),u.setState(V,function(){return u.props.onResize&&u.props.onResize(M,L)})):u.setState(V)},u}d.getDerivedStateFromProps=function(g,p){return p.propsWidth!==g.width||p.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var C=d.prototype;return C.render=function(){var g=this.props,p=g.handle,y=g.handleSize;g.onResize;var M=g.onResizeStart,L=g.onResizeStop,V=g.draggableOpts,U=g.minConstraints,E=g.maxConstraints,D=g.lockAspectRatio,W=g.axis;g.width,g.height;var X=g.resizeHandles,Y=g.style,ne=g.transformScale,ee=R(g,i);return t.createElement(r.default,{axis:W,draggableOpts:V,handle:p,handleSize:y,height:this.state.height,lockAspectRatio:D,maxConstraints:E,minConstraints:U,onResizeStart:M,onResize:this.onResize,onResizeStop:L,resizeHandles:X,transformScale:ne,width:this.state.width},t.createElement("div",f({},ee,{style:m(m({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return ot.default=o,o.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),ot}var ir;function si(){return ir||(ir=1,rt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},rt.exports.Resizable=nr().default,rt.exports.ResizableBox=oi().default),rt.exports}var we={},ar;function or(){if(ar)return we;ar=1,Object.defineProperty(we,"__esModule",{value:!0}),we.resizeHandleType=we.resizeHandleAxesType=we.default=void 0;var t=r(xe()),e=r(j);function r(a){return a&&a.__esModule?a:{default:a}}const n=we.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),i=we.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return we.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(a){a.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(a){var l=a.layout;l!==void 0&&Ve().validateLayout(l,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:i,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(a,l){const S=a[l],f={};e.default.Children.forEach(S,function(b){if((b==null?void 0:b.key)!=null){if(f[b.key])throw new Error('Duplicate child key "'+b.key+'" found! This will cause problems in ReactGridLayout.');f[b.key]=!0}})},innerRef:t.default.any},we}var sr;function li(){if(sr)return et;sr=1,Object.defineProperty(et,"__esModule",{value:!0}),et.default=void 0;var t=f(j),e=f(xe()),r=hn(),n=si(),i=Ve(),a=ln(),l=or(),S=f(on());function f(I){return I&&I.__esModule?I:{default:I}}function b(I,R,w){return R=m(R),R in I?Object.defineProperty(I,R,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[R]=w,I}function m(I){var R=T(I,"string");return typeof R=="symbol"?R:String(R)}function T(I,R){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,R||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(I)}let _=class extends t.default.Component{constructor(){super(...arguments),b(this,"state",{resizing:null,dragging:null,className:""}),b(this,"elementRef",t.default.createRef()),b(this,"onDragStart",(R,w)=>{let{node:h}=w;const{onDragStart:o,transformScale:s}=this.props;if(!o)return;const d={top:0,left:0},{offsetParent:C}=h;if(!C)return;const u=C.getBoundingClientRect(),g=h.getBoundingClientRect(),p=g.left/s,y=u.left/s,M=g.top/s,L=u.top/s;d.left=p-y+C.scrollLeft,d.top=M-L+C.scrollTop,this.setState({dragging:d});const{x:V,y:U}=(0,a.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return o.call(this,this.props.i,V,U,{e:R,node:h,newPosition:d})}),b(this,"onDrag",(R,w)=>{let{node:h,deltaX:o,deltaY:s}=w;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let C=this.state.dragging.top+s,u=this.state.dragging.left+o;const{isBounded:g,i:p,w:y,h:M,containerWidth:L}=this.props,V=this.getPositionParams();if(g){const{offsetParent:X}=h;if(X){const{margin:Y,rowHeight:ne,containerPadding:ee}=this.props,F=X.clientHeight-(0,a.calcGridItemWHPx)(M,ne,Y[1]);C=(0,a.clamp)(C-ee[1],0,F);const H=(0,a.calcGridColWidth)(V),re=L-(0,a.calcGridItemWHPx)(y,H,Y[0]);u=(0,a.clamp)(u-ee[0],0,re)}}const U={top:C,left:u};this.setState({dragging:U});const{containerPadding:E}=this.props,{x:D,y:W}=(0,a.calcXY)(V,C-E[1],u-E[0],y,M);return d.call(this,p,D,W,{e:R,node:h,newPosition:U})}),b(this,"onDragStop",(R,w)=>{let{node:h}=w;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:C,containerPadding:u}=this.props,{left:g,top:p}=this.state.dragging,y={top:p,left:g};this.setState({dragging:null});const{x:M,y:L}=(0,a.calcXY)(this.getPositionParams(),p-u[1],g-u[0],s,d);return o.call(this,C,M,L,{e:R,node:h,newPosition:y})}),b(this,"onResizeStop",(R,w,h)=>this.onResizeHandler(R,w,h,"onResizeStop")),b(this,"onResizeStart",(R,w,h)=>this.onResizeHandler(R,w,h,"onResizeStart")),b(this,"onResize",(R,w,h)=>this.onResizeHandler(R,w,h,"onResize"))}shouldComponentUpdate(R,w){if(this.props.children!==R.children||this.props.droppingPosition!==R.droppingPosition)return!0;const h=(0,a.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,a.calcGridItemPosition)(this.getPositionParams(R),R.x,R.y,R.w,R.h,w);return!(0,i.fastPositionEqual)(h,o)||this.props.useCSSTransforms!==R.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(R){this.moveDroppingItem(R)}moveDroppingItem(R){const{droppingPosition:w}=this.props;if(!w)return;const h=this.elementRef.current;if(!h)return;const o=R.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&w.left!==o.left||w.top!==o.top;if(!s)this.onDragStart(w.e,{node:h,deltaX:w.left,deltaY:w.top});else if(d){const C=w.left-s.left,u=w.top-s.top;this.onDrag(w.e,{node:h,deltaX:C,deltaY:u})}}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:w,containerWidth:h,useCSSTransforms:o}=this.props;let s;return o?s=(0,i.setTransform)(R):(s=(0,i.setTopLeft)(R),w&&(s.left=(0,i.perc)(R.left/h),s.width=(0,i.perc)(R.width/h))),s}mixinDraggable(R,w){return t.default.createElement(r.DraggableCore,{disabled:!w,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,w){return(h,o)=>w(h,o,R)}mixinResizable(R,w,h){const{cols:o,minW:s,minH:d,maxW:C,maxH:u,transformScale:g,resizeHandles:p,resizeHandle:y}=this.props,M=this.getPositionParams(),L=(0,a.calcGridItemPosition)(M,0,0,o,0).width,V=(0,a.calcGridItemPosition)(M,0,0,s,d),U=(0,a.calcGridItemPosition)(M,0,0,C,u),E=[V.width,V.height],D=[Math.min(U.width,L),Math.min(U.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:w.width,height:w.height,minConstraints:E,maxConstraints:D,onResizeStop:this.curryResizeHandler(w,this.onResizeStop),onResizeStart:this.curryResizeHandler(w,this.onResizeStart),onResize:this.curryResizeHandler(w,this.onResize),transformScale:g,resizeHandles:p,handle:y},R)}onResizeHandler(R,w,h,o){let{node:s,size:d,handle:C}=w;const u=this.props[o];if(!u)return;const{x:g,y:p,i:y,maxH:M,minH:L,containerWidth:V}=this.props,{minW:U,maxW:E}=this.props;let D=d;s&&(D=(0,i.resizeItemInDirection)(C,h,d,V),this.setState({resizing:o==="onResizeStop"?null:D}));let{w:W,h:X}=(0,a.calcWH)(this.getPositionParams(),D.width,D.height,g,p,C);W=(0,a.clamp)(W,Math.max(U,1),E),X=(0,a.clamp)(X,L,M),u.call(this,y,W,X,{e:R,node:s,size:D,handle:C})}render(){const{x:R,y:w,w:h,h:o,isDraggable:s,isResizable:d,droppingPosition:C,useCSSTransforms:u}=this.props,g=(0,a.calcGridItemPosition)(this.getPositionParams(),R,w,h,o,this.state),p=t.default.Children.only(this.props.children);let y=t.default.cloneElement(p,{ref:this.elementRef,className:(0,S.default)("react-grid-item",p.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!C,cssTransforms:u}),style:{...this.props.style,...p.props.style,...this.createStyle(g)}});return y=this.mixinResizable(y,g,d),y=this.mixinDraggable(y,s),y}};return et.default=_,b(_,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,R){const w=I[R];if(typeof w!="number")return new Error("minWidth not Number");if(w>I.w||w>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,R){const w=I[R];if(typeof w!="number")return new Error("maxWidth not Number");if(w<I.w||w<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,R){const w=I[R];if(typeof w!="number")return new Error("minHeight not Number");if(w>I.h||w>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,R){const w=I[R];if(typeof w!="number")return new Error("maxHeight not Number");if(w<I.h||w<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:l.resizeHandleAxesType,resizeHandle:l.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),b(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),et}var lr;function ur(){if(lr)return Je;lr=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=b(j),e=an(),r=S(on()),n=Ve(),i=ln(),a=S(li()),l=S(or());function S(h){return h&&h.__esModule?h:{default:h}}function f(h){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(f=function(d){return d?s:o})(h)}function b(h,o){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=f(o);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=C?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(d,u,g):d[u]=h[u]}return d.default=h,s&&s.set(h,d),d}function m(h,o,s){return o=T(o),o in h?Object.defineProperty(h,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[o]=s,h}function T(h){var o=_(h,"string");return typeof o=="symbol"?o:String(o)}function _(h,o){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,o||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(h)}const I="react-grid-layout";let R=!1;try{R=/firefox/i.test(navigator.userAgent)}catch{}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(o,s,d,C)=>{let{e:u,node:g}=C;const{layout:p}=this.state,y=(0,n.getLayoutItem)(p,o);if(!y)return;const M={w:y.w,h:y.h,x:y.x,y:y.y,placeholder:!0,i:o};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(y),oldLayout:p,activeDrag:M}),this.props.onDragStart(p,y,y,null,u,g)}),m(this,"onDrag",(o,s,d,C)=>{let{e:u,node:g}=C;const{oldDragItem:p}=this.state;let{layout:y}=this.state;const{cols:M,allowOverlap:L,preventCollision:V}=this.props,U=(0,n.getLayoutItem)(y,o);if(!U)return;const E={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i:o};y=(0,n.moveElement)(y,U,s,d,!0,V,(0,n.compactType)(this.props),M,L),this.props.onDrag(y,p,U,E,u,g),this.setState({layout:L?y:(0,n.compact)(y,(0,n.compactType)(this.props),M),activeDrag:E})}),m(this,"onDragStop",(o,s,d,C)=>{let{e:u,node:g}=C;if(!this.state.activeDrag)return;const{oldDragItem:p}=this.state;let{layout:y}=this.state;const{cols:M,preventCollision:L,allowOverlap:V}=this.props,U=(0,n.getLayoutItem)(y,o);if(!U)return;y=(0,n.moveElement)(y,U,s,d,!0,L,(0,n.compactType)(this.props),M,V);const D=V?y:(0,n.compact)(y,(0,n.compactType)(this.props),M);this.props.onDragStop(D,p,U,null,u,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:D,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(D,W)}),m(this,"onResizeStart",(o,s,d,C)=>{let{e:u,node:g}=C;const{layout:p}=this.state,y=(0,n.getLayoutItem)(p,o);y&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(y),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(p,y,y,null,u,g))}),m(this,"onResize",(o,s,d,C)=>{let{e:u,node:g,size:p,handle:y}=C;const{oldResizeItem:M}=this.state,{layout:L}=this.state,{cols:V,preventCollision:U,allowOverlap:E}=this.props;let D=!1,W,X,Y;const[ne,ee]=(0,n.withLayoutItem)(L,o,H=>{let re;return X=H.x,Y=H.y,["sw","w","nw","n","ne"].indexOf(y)!==-1&&(["sw","nw","w"].indexOf(y)!==-1&&(X=H.x+(H.w-s),s=H.x!==X&&X<0?H.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(y)!==-1&&(Y=H.y+(H.h-d),d=H.y!==Y&&Y<0?H.h:d,Y=Y<0?0:Y),D=!0),U&&!E&&(re=(0,n.getAllCollisions)(L,{...H,w:s,h:d,x:X,y:Y}).filter(ue=>ue.i!==H.i).length>0,re&&(Y=H.y,d=H.h,X=H.x,s=H.w,D=!1)),H.w=s,H.h=d,H});if(!ee)return;W=ne,D&&(W=(0,n.moveElement)(ne,ee,X,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),V,E));const F={w:ee.w,h:ee.h,x:ee.x,y:ee.y,static:!0,i:o};this.props.onResize(W,M,ee,F,u,g),this.setState({layout:E?W:(0,n.compact)(W,(0,n.compactType)(this.props),V),activeDrag:F})}),m(this,"onResizeStop",(o,s,d,C)=>{let{e:u,node:g}=C;const{layout:p,oldResizeItem:y}=this.state,{cols:M,allowOverlap:L}=this.props,V=(0,n.getLayoutItem)(p,o),U=L?p:(0,n.compact)(p,(0,n.compactType)(this.props),M);this.props.onResizeStop(U,y,V,null,u,g);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,E)}),m(this,"onDragOver",o=>{var ne;if(o.preventDefault(),o.stopPropagation(),R&&!((ne=o.nativeEvent.target)!=null&&ne.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:d,margin:C,cols:u,rowHeight:g,maxRows:p,width:y,containerPadding:M,transformScale:L}=this.props,V=d==null?void 0:d(o);if(V===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...V},{layout:E}=this.state,D=o.currentTarget.getBoundingClientRect(),W=o.clientX-D.left,X=o.clientY-D.top,Y={left:W/L,top:X/L,e:o};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ee,top:F}=this.state.droppingPosition;(ee!=W||F!=X)&&this.setState({droppingPosition:Y})}}else{const ee={cols:u,margin:C,maxRows:p,rowHeight:g,containerWidth:y,containerPadding:M||C},F=(0,i.calcXY)(ee,X,W,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:Y,layout:[...E,{...U,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:o,cols:s}=this.props,{layout:d}=this.state,C=(0,n.compact)(d.filter(u=>u.i!==o.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",o=>{o.preventDefault(),o.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",o=>{o.preventDefault(),o.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",o=>{o.preventDefault(),o.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,C=d.find(u=>u.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,C,o)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(o,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(o.layout,s.propsLayout)||o.compactType!==s.compactType?d=o.layout:(0,n.childrenEqual)(o.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,o.children,o.cols,(0,n.compactType)(o),o.allowOverlap),compactType:o.compactType,children:o.children,propsLayout:o.layout}:null)}shouldComponentUpdate(o,s){return this.props.children!==o.children||!(0,n.fastRGLPropsEqual)(this.props,o,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(o,s){if(!this.state.activeDrag){const d=this.state.layout,C=s.layout;this.onLayoutMaybeChanged(d,C)}}containerHeight(){if(!this.props.autoSize)return;const o=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return o*this.props.rowHeight+(o-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(o,s){s||(s=this.state.layout),(0,e.deepEqual)(s,o)||this.props.onLayoutChange(o)}placeholder(){const{activeDrag:o}=this.state;if(!o)return null;const{width:s,cols:d,margin:C,containerPadding:u,rowHeight:g,maxRows:p,useCSSTransforms:y,transformScale:M}=this.props;return t.createElement(a.default,{w:o.w,h:o.h,x:o.x,y:o.y,i:o.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:C,containerPadding:u||C,maxRows:p,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:y,transformScale:M},t.createElement("div",null))}processGridItem(o,s){if(!o||!o.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(o.key));if(!d)return null;const{width:C,cols:u,margin:g,containerPadding:p,rowHeight:y,maxRows:M,isDraggable:L,isResizable:V,isBounded:U,useCSSTransforms:E,transformScale:D,draggableCancel:W,draggableHandle:X,resizeHandles:Y,resizeHandle:ne}=this.props,{mounted:ee,droppingPosition:F}=this.state,H=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&L,re=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&V,oe=d.resizeHandles||Y,ue=H&&U&&d.isBounded!==!1;return t.createElement(a.default,{containerWidth:C,cols:u,margin:g,containerPadding:p||g,maxRows:M,rowHeight:y,cancel:W,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:H,isResizable:re,isBounded:ue,useCSSTransforms:E&&ee,usePercentages:!ee,transformScale:D,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:oe,resizeHandle:ne},o)}render(){const{className:o,style:s,isDroppable:d,innerRef:C}=this.props,u=(0,r.default)(I,o),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:C,className:u,style:g,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},t.Children.map(this.props.children,p=>this.processGridItem(p)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Je.default=w,m(w,"displayName","ReactGridLayout"),m(w,"propTypes",l.default),m(w,"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:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Je}var st={},Me={},cr;function dr(){if(cr)return Me;cr=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.findOrGenerateResponsiveLayout=n,Me.getBreakpointFromWidth=e,Me.getColsFromBreakpoint=r,Me.sortBreakpoints=i;var t=Ve();function e(a,l){const S=i(a);let f=S[0];for(let b=1,m=S.length;b<m;b++){const T=S[b];l>a[T]&&(f=T)}return f}function r(a,l){if(!l[a])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+a+" is missing!");return l[a]}function n(a,l,S,f,b,m){if(a[S])return(0,t.cloneLayout)(a[S]);let T=a[f];const _=i(l),I=_.slice(_.indexOf(S));for(let R=0,w=I.length;R<w;R++){const h=I[R];if(a[h]){T=a[h];break}}return T=(0,t.cloneLayout)(T||[]),(0,t.compact)((0,t.correctBounds)(T,{cols:b}),m,b)}function i(a){return Object.keys(a).sort(function(S,f){return a[S]-a[f]})}return Me}var fr;function ui(){if(fr)return st;fr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;var t=f(j),e=l(xe()),r=an(),n=Ve(),i=dr(),a=l(ur());function l(h){return h&&h.__esModule?h:{default:h}}function S(h){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(S=function(d){return d?s:o})(h)}function f(h,o){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=S(o);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=C?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(d,u,g):d[u]=h[u]}return d.default=h,s&&s.set(h,d),d}function b(){return b=Object.assign?Object.assign.bind():function(h){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},b.apply(this,arguments)}function m(h,o,s){return o=T(o),o in h?Object.defineProperty(h,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[o]=s,h}function T(h){var o=_(h,"string");return typeof o=="symbol"?o:String(o)}function _(h,o){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,o||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function R(h,o){return h==null?null:Array.isArray(h)?h:h[o]}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",o=>{this.props.onLayoutChange(o,{...this.props.layouts,[this.state.breakpoint]:o})})}generateInitialState(){const{width:o,breakpoints:s,layouts:d,cols:C}=this.props,u=(0,i.getBreakpointFromWidth)(s,o),g=(0,i.getColsFromBreakpoint)(u,C),p=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,i.findOrGenerateResponsiveLayout)(d,s,u,u,g,p),breakpoint:u,cols:g}}static getDerivedStateFromProps(o,s){if(!(0,r.deepEqual)(o.layouts,s.layouts)){const{breakpoint:d,cols:C}=s;return{layout:(0,i.findOrGenerateResponsiveLayout)(o.layouts,o.breakpoints,d,d,C,o.compactType),layouts:o.layouts}}return null}componentDidUpdate(o){(this.props.width!=o.width||this.props.breakpoint!==o.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,o.breakpoints)||!(0,r.deepEqual)(this.props.cols,o.cols))&&this.onWidthChange(o)}onWidthChange(o){const{breakpoints:s,cols:d,layouts:C,compactType:u}=this.props,g=this.props.breakpoint||(0,i.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),p=this.state.breakpoint,y=(0,i.getColsFromBreakpoint)(g,d),M={...C};if(p!==g||o.breakpoints!==s||o.cols!==d){p in M||(M[p]=(0,n.cloneLayout)(this.state.layout));let U=(0,i.findOrGenerateResponsiveLayout)(M,s,g,p,y,u);U=(0,n.synchronizeLayoutWithChildren)(U,this.props.children,y,u,this.props.allowOverlap),M[g]=U,this.props.onLayoutChange(U,M),this.props.onBreakpointChange(g,y),this.setState({breakpoint:g,layout:U,cols:y})}const L=R(this.props.margin,g),V=R(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,L,y,V)}render(){const{breakpoint:o,breakpoints:s,cols:d,layouts:C,margin:u,containerPadding:g,onBreakpointChange:p,onLayoutChange:y,onWidthChange:M,...L}=this.props;return t.createElement(a.default,b({},L,{margin:R(u,this.state.breakpoint),containerPadding:R(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return st.default=w,m(w,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,o){if(I(h[o])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[o]));Object.keys(h[o]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(w,"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:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),st}var Et={},pr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(i,a){return i[0]===r?(n=a,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(r,n){var i=t(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,i=t(n,r);~i&&n.splice(i,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,a=this.__entries__;i<a.length;i++){var l=a[i];r.call(n,l[1],l[0])}},e}()}(),mn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=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")()}(),ci=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),di=2;function fi(t,e){var r=!1,n=!1,i=0;function a(){r&&(r=!1,t()),n&&S()}function l(){ci(a)}function S(){var f=Date.now();if(r){if(f-i<di)return;n=!0}else r=!0,n=!1,setTimeout(l,e);i=f}return S}var pi=20,hi=["top","right","bottom","left","width","height","size","weight"],mi=typeof MutationObserver<"u",gi=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=fi(this.refresh.bind(this),pi)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!mn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mi?(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)},t.prototype.disconnect_=function(){!mn||!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)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,i=hi.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),hr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},ze=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Ot},mr=Mt(0,0,0,0);function Pt(t){return parseFloat(t)||0}function gr(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,i){var a=t["border-"+i+"-width"];return n+Pt(a)},0)}function vi(t){for(var e=["top","right","bottom","left"],r={},n=0,i=e;n<i.length;n++){var a=i[n],l=t["padding-"+a];r[a]=Pt(l)}return r}function yi(t){var e=t.getBBox();return Mt(0,0,e.width,e.height)}function Si(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return mr;var n=ze(t).getComputedStyle(t),i=vi(n),a=i.left+i.right,l=i.top+i.bottom,S=Pt(n.width),f=Pt(n.height);if(n.boxSizing==="border-box"&&(Math.round(S+a)!==e&&(S-=gr(n,"left","right")+a),Math.round(f+l)!==r&&(f-=gr(n,"top","bottom")+l)),!Ri(t)){var b=Math.round(S+a)-e,m=Math.round(f+l)-r;Math.abs(b)!==1&&(S-=b),Math.abs(m)!==1&&(f-=m)}return Mt(i.left,i.top,S,f)}var bi=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ze(t).SVGGraphicsElement}:function(t){return t instanceof ze(t).SVGElement&&typeof t.getBBox=="function"}}();function Ri(t){return t===ze(t).document.documentElement}function Ci(t){return mn?bi(t)?yi(t):Si(t):mr}function Ti(t){var e=t.x,r=t.y,n=t.width,i=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(a.prototype);return hr(l,{x:e,y:r,width:n,height:i,top:r,right:e+n,bottom:i+r,left:e}),l}function Mt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var Ii=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Mt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Ci(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),wi=function(){function t(e,r){var n=Ti(r);hr(this,{target:e,contentRect:n})}return t}(),_i=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new pr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new Ii(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new wi(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),vr=typeof WeakMap<"u"?new WeakMap:new pr,yr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=gi.getInstance(),n=new _i(e,r,this);vr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){yr.prototype[t]=function(){var e;return(e=vr.get(this))[t].apply(e,arguments)}});var xi=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:yr}();const Ei=_n(Object.freeze(Object.defineProperty({__proto__:null,default:xi},Symbol.toStringTag,{value:"Module"})));var Sr;function Oi(){if(Sr)return Et;Sr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=_;var t=l(j),e=i(xe()),r=i(Ei),n=i(on());function i(I){return I&&I.__esModule?I:{default:I}}function a(I){if(typeof WeakMap!="function")return null;var R=new WeakMap,w=new WeakMap;return(a=function(h){return h?w:R})(I)}function l(I,R){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var w=a(R);if(w&&w.has(I))return w.get(I);var h={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var d=o?Object.getOwnPropertyDescriptor(I,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=I[s]}return h.default=I,w&&w.set(I,h),h}function S(){return S=Object.assign?Object.assign.bind():function(I){for(var R=1;R<arguments.length;R++){var w=arguments[R];for(var h in w)Object.prototype.hasOwnProperty.call(w,h)&&(I[h]=w[h])}return I},S.apply(this,arguments)}function f(I,R,w){return R=b(R),R in I?Object.defineProperty(I,R,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[R]=w,I}function b(I){var R=m(I,"string");return typeof R=="symbol"?R:String(R)}function m(I,R){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,R||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(I)}const T="react-grid-layout";function _(I){var R;return R=class extends t.Component{constructor(){super(...arguments),f(this,"state",{width:1280}),f(this,"elementRef",t.createRef()),f(this,"mounted",!1),f(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(o=>{if(this.elementRef.current instanceof HTMLElement){const d=o[0].contentRect.width;this.setState({width:d})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...o}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,T),style:this.props.style,ref:this.elementRef}):t.createElement(I,S({innerRef:this.elementRef},o,this.state))}},f(R,"defaultProps",{measureBeforeMount:!1}),f(R,"propTypes",{measureBeforeMount:e.default.bool}),R}return Et}var br;function Pi(){return br||(br=1,function(t){t.exports=ur().default,t.exports.utils=Ve(),t.exports.calculateUtils=ln(),t.exports.Responsive=ui().default,t.exports.Responsive.utils=dr(),t.exports.WidthProvider=Oi().default}(rn)),rn.exports}var Mi=Pi();const Di=Ar(Mi);var Ni=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,Li=(t,e,r,n)=>{for(var i=n>1?void 0:n?ji(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ni(e,r,i),i},Ui=(t,e)=>(r,n)=>e(r,n,t);let Ae=class extends v.Disposable{constructor(e){super();Pe(this,"_initLocal",()=>{});Pe(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let i=r.exec(e);for(;i;)n.push({startIndex:i.index,key:Number(i[1]),endIndex:i.index+i[0].length-1}),i=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),i=e.split("."),a=n&&this._localeService.resolveKeyPath(n,i);if(typeof a=="string"){const l=[];return this._findReplaceIndex(a).forEach((S,f,b)=>{const m=b[f-1]||{startIndex:0,endIndex:-1};if(m.endIndex+1<S.startIndex){const T=a.slice(m.endIndex+1,S.startIndex);T&&l.push(T)}if(r[S.key]&&l.push(r[S.key]),f===b.length-1){const T=a.slice(S.endIndex+1);T&&l.push(T)}}),l}return[]}};Ae=Li([Ui(0,v.Inject(v.LocaleService))],Ae);const Dt={cfPreview:"univer-cf-preview"},We=t=>{var i,a;const e=t.rule;if(!e)return null;const r=j.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const l=e.config.map((b,m)=>({color:new v.ColorKit(b.color),value:m})),S=l.length-1;return new Array(5).fill("").map((b,m,T)=>m*S/(T.length-1)).map(b=>c.getColorScaleFromValue(l,b))}return null},[e]),n=j.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(l=>{const S=c.iconMap[l.iconType];return S&&S[Number(l.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:l}=e.config,S={width:"50%",height:"100%"},f=l?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,b=l?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return x.jsxs("div",{className:Dt.cfPreview,children:[x.jsx("div",{style:{...S,background:b,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),x.jsx("div",{style:{...S,background:f,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&x.jsx("div",{className:Dt.cfPreview,children:r.map((l,S)=>x.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:l}},S))});case c.CFRuleType.iconSet:return n&&x.jsx("div",{className:Dt.cfPreview,children:n.map((l,S)=>l?x.jsx("img",{style:{height:"100%"},src:l},S):x.jsx(Ze,{},S))});case c.CFRuleType.highlightCell:{const{ul:l,st:S,it:f,bl:b,bg:m,cl:T}=e.style,_=(l==null?void 0:l.s)===v.BooleanNumber.TRUE,I=(S==null?void 0:S.s)===v.BooleanNumber.TRUE,R=f===v.BooleanNumber.TRUE,w=b===v.BooleanNumber.TRUE,h=(i=m==null?void 0:m.rgb)!=null?i:c.DEFAULT_BG_COLOR,o=(a=T==null?void 0:T.rgb)!=null?a:c.DEFAULT_FONT_COLOR,s={fontWeight:w?"bold":void 0,fontStyle:R?"italic":void 0,textDecoration:`${_?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:o};return x.jsx("div",{style:s,className:Dt.cfPreview,children:"123"})}}return null},pe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},Vi=(t,e)=>{const r=t.rule;switch(r.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(i=>String(i)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let Rr=0;const zi=t=>{const{onClick:e}=t,r=v.useDependency(c.ConditionalFormattingRuleModel),n=v.useDependency(v.IUniverInstanceService),i=v.useDependency(q.SheetsSelectionsService),a=v.useDependency(v.ICommandService),l=v.useDependency(v.LocaleService),S=v.useDependency(v.Injector),f=v.useDependency(Ae),b=ge.useObservable(()=>n.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=b.getUnitId(),T=b.getActiveSheet();if(!T)throw new Error("No active sheet found");const _=T.getSheetId(),[I,R]=j.useState([]),[w,h]=j.useState("2"),[o,s]=j.useState(0),[d,C]=j.useState(-1),[u,g]=j.useState(Rr),p=j.useRef(null),y=[{label:l.t("sheet.cf.panel.workSheet"),value:"2"},{label:l.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const F=r.getSubunitRules(m,_);if(!F||!F.length)return[];if(w==="1"){const H=i.getCurrentLastSelection();if(!H)return[];const re=H.range;return F.filter(ue=>ue.ranges.some(he=>v.Rectangle.intersects(he,re)))}else if(w==="2")return[...F];return[]},[L,V]=j.useState(M);de.useHighlightRange(I),j.useEffect(()=>{const F=a.onCommandExecuted(H=>{H.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),j.useEffect(()=>{V(M)},[w,o,m,_]),j.useEffect(()=>{if(w==="2")return;const F=new Re.Observable(H=>{const re=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],oe=a.onCommandExecuted(ue=>{const{id:he,params:ye}=ue,Ce=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId();re.includes(he)&&ye.unitId===Ce&&H.next(null)});return()=>oe.dispose()}).pipe(Re.debounceTime(16)).subscribe(()=>{V(M)});return()=>{F.unsubscribe()}},[n,w,m,_]),j.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),j.useEffect(()=>{const F=()=>{var ue;const oe=Math.max(0,(((ue=p.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return Rr=oe,oe},re=new Re.Observable(oe=>{const ue=document.querySelector(".univer-sidebar");if(ue){let he=setTimeout(()=>{oe.next()},150);const ye=()=>{he&&clearTimeout(he),he=null},Ce=k=>{k.propertyName==="width"&&(ye(),oe.next())};return ue.addEventListener("transitionend",Ce),()=>{ye(),ue.removeEventListener("transitionend",Ce)}}}).pipe(Re.debounceTime(16)).subscribe(()=>{g(F())});return()=>{re.unsubscribe()}},[]);const U=F=>{var oe;const H=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),re=(oe=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:oe.getSheetId();if(!H||!re)throw new Error("No active sheet found");a.executeCommand(Ke.id,{unitId:H,subUnitId:re,cfId:F.cfId})},E=(F,H)=>{C(H.y)},D=(F,H,re)=>{var k;C(-1);const oe=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(k=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:k.getSheetId();if(!oe||!ue)throw new Error("No active sheet found");const he=Q=>{const se=L.length;return Math.min(se-1,Math.max(0,Q))},ye=L[he(H.y)].cfId,Ce=L[he(re.y)].cfId;ye!==Ce&&a.executeCommand(bt.id,{unitId:oe,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Ce,type:re.y>H.y?"after":"before"}})},W=()=>{t.onCreate()},X=()=>{w==="2"?a.executeCommand(Ye.id):w==="1"&&L.map(H=>({unitId:m,subUnitId:_,cfId:H.cfId})).forEach(H=>{a.executeCommand(Ke.id,H)})},Y=j.useMemo(()=>{const F=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return L.filter(re=>{const oe=re.ranges;return q.checkRangesEditablePermission(S,F.getUnitId(),H.getSheetId(),oe)})},[L]),ne=Y.map((F,H)=>({i:F.cfId,x:0,w:12,y:H,h:1,isResizable:!1})),ee=j.useMemo(()=>{const F=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return L.every(re=>{const oe=re.ranges;return q.checkRangesEditablePermission(S,F.getUnitId(),H.getSheetId(),oe)})},[L]);return x.jsxs("div",{className:pe.cfRuleList,children:[x.jsxs("div",{className:pe.ruleSelector,children:[x.jsx("div",{children:f.tWithReactNode("sheet.cf.panel.managerRuleSelect",x.jsx(ie.Select,{className:pe.select,options:y,value:w,onChange:F=>{h(F)}})).map((F,H)=>x.jsx("span",{children:F},H))}),x.jsxs("div",{className:pe.btnList,children:[x.jsx(ie.Tooltip,{title:l.t("sheet.cf.panel.createRule"),placement:"bottom",children:x.jsx("div",{className:`
|
|
10
|
+
(function($,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],m):($=typeof globalThis<"u"?globalThis:$||self,m($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,m,c,q,me,E,L,ae,Gt,de,Tn,Ce,Ge,In,qe){"use strict";var zo=Object.defineProperty;var Ao=($,m,c)=>m in $?zo($,m,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[m]=c;var Me=($,m,c)=>Ao($,typeof m!="symbol"?m+"":m,c);const qt={type:m.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),S=t.get(m.ICommandService),p=t.get(m.IUniverInstanceService),T=q.getSheetCommandTarget(p);if(!T)return!1;const{unitId:y,subUnitId:I}=T,_=u.createCfId(y,I),w={ranges:r,cfId:_,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:n}};return S.executeCommand(c.AddConditionalRuleMutation.id,{unitId:y,subUnitId:I,rule:w})}},Xe={type:m.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(m.IUndoRedoService),a=t.get(m.ICommandService),o=t.get(c.ConditionalFormattingRuleModel),u=t.get(m.IUniverInstanceService),S=q.getSheetCommandTarget(u);if(!S)return!1;const{unitId:p,subUnitId:T}=S,y=o.createCfId(p,T),I={unitId:p,subUnitId:T,rule:{...r,cfId:r.cfId||y}},_=c.AddConditionalRuleMutationUndoFactory(t,I),w=a.syncExecuteCommand(c.AddConditionalRuleMutation.id,I);return w&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:I}],undoMutations:[_]}),w}},Xt={type:m.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(m.ICommandService),S=t.get(m.IUniverInstanceService),p=q.getSheetCommandTarget(S);if(!p)return!1;const{unitId:T,subUnitId:y}=p,I=o.createCfId(T,y),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:y,rule:_})}},Yt={type:m.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:a,nativeColor:o,positiveColor:u,isGradient:S,stopIfTrue:p,isShowValue:T}=e,y=t.get(c.ConditionalFormattingRuleModel),I=t.get(m.IUniverInstanceService),_=q.getSheetCommandTarget(I);if(!_)return!1;const{unitId:w,subUnitId:b}=_,R=t.get(m.ICommandService),h=y.createCfId(w,b),i={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:T,config:{min:n,max:a,nativeColor:o,positiveColor:u,isGradient:S}}};return R.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:b,rule:i})}},Kt={type:m.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(m.ICommandService),S=t.get(m.IUniverInstanceService),p=q.getSheetCommandTarget(S);if(!p)return!1;const{unitId:T,subUnitId:y}=p,I=o.createCfId(T,y),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:y,rule:_})}},$t={type:m.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=e,S=t.get(c.ConditionalFormattingRuleModel),p=t.get(m.ICommandService),T=t.get(m.IUniverInstanceService),y=q.getSheetCommandTarget(T);if(!y)return!1;const{unitId:I,subUnitId:_}=y,w=S.createCfId(I,_);let b;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const R=u;if(R.length!==2||!Array.isArray(R))return!1;b={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}else{const R=u;if(typeof R!="number")return!1;b={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:_,rule:b})}},Zt={type:m.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,isPercent:o,isBottom:u,value:S}=e,p=t.get(c.ConditionalFormattingRuleModel),T=t.get(m.IUniverInstanceService),y=t.get(m.ICommandService),I=q.getSheetCommandTarget(T);if(!I)return!1;const{unitId:_,subUnitId:w}=I,b=p.createCfId(_,w),R={ranges:r,cfId:b,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:n,value:S}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:w,rule:R})}},Jt={type:m.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=e,S=t.get(c.ConditionalFormattingRuleModel),p=t.get(m.IUniverInstanceService),T=q.getSheetCommandTarget(p);if(!T)return!1;const{unitId:y,subUnitId:I}=T,_=t.get(m.ICommandService),w=S.createCfId(y,I),b={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:n,value:u}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:y,subUnitId:I,rule:b})}},Qt={type:m.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),S=t.get(m.IUniverInstanceService),p=t.get(m.ICommandService),T=q.getSheetCommandTarget(S);if(!T)return!1;const{unitId:y,subUnitId:I}=T,_=u.createCfId(y,I),w={ranges:r,cfId:_,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:y,subUnitId:I,rule:w})}},en={type:m.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(m.IUniverInstanceService),S=t.get(m.ICommandService),p=q.getSheetCommandTarget(u);if(!p)return!1;const{unitId:T,subUnitId:y}=p,I=o.createCfId(T,y),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return S.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:y,rule:_})}},yt={type:m.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var R;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(m.IUniverInstanceService),a=t.get(m.ICommandService),o=t.get(m.IUndoRedoService),u=t.get(q.SheetsSelectionsService),S=q.getSheetCommandTarget(n,e);if(!S)return!1;const{unitId:p,subUnitId:T}=S,y=((R=u.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],I=r.getSubunitRules(p,T);if(!(I!=null&&I.length)||!y.length)return!1;const _=[],w=[];I.forEach(h=>{const i=new m.ObjectMatrix;h.ranges.forEach(d=>{m.Range.foreach(d,(C,l)=>{i.setValue(C,l,1)})}),y.forEach(d=>{m.Range.foreach(d,(C,l)=>{i.realDeleteValue(C,l)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(i));if(s.length){const d={...h,ranges:s},C={unitId:p,subUnitId:T,rule:d},l=c.setConditionalRuleMutationUndoFactory(t,C);_.push({id:c.SetConditionalRuleMutation.id,params:C}),w.push(...l)}else{const d={unitId:p,subUnitId:T,cfId:h.cfId},C=c.DeleteConditionalRuleMutationUndoFactory(t,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),w.push(...C)}});const b=m.sequenceExecute(_,a).result;return b&&o.pushUndoRedo({unitID:p,redoMutations:_,undoMutations:w}),b}},Ye={type:m.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(m.IUniverInstanceService),a=t.get(m.ICommandService),o=t.get(m.IUndoRedoService),u=q.getSheetCommandTarget(n,e);if(!u)return!1;const{unitId:S,subUnitId:p}=u,T=r.getSubunitRules(S,p);if(!(T!=null&&T.length))return!1;const y=T.map(b=>({cfId:b.cfId,unitId:S,subUnitId:p})),I=y.map(b=>({id:c.DeleteConditionalRuleMutation.id,params:b})),_=y.map(b=>c.DeleteConditionalRuleMutationUndoFactory(t,b)[0]),w=m.sequenceExecute(I,a).result;return w&&o.pushUndoRedo({unitID:S,redoMutations:I,undoMutations:_}),w}},Ke={type:m.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(m.IUndoRedoService),n=t.get(m.ICommandService),a=t.get(m.IUniverInstanceService),o=q.getSheetCommandTarget(a,e);if(!o)return!1;const{unitId:u,subUnitId:S}=o,p={unitId:u,subUnitId:S,cfId:e.cfId},T=c.DeleteConditionalRuleMutationUndoFactory(t,p),y=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return y&&r.pushUndoRedo({unitID:u,undoMutations:T,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),y}},St={type:m.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(m.IUndoRedoService),n=t.get(m.ICommandService),a=t.get(m.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),u=q.getSheetCommandTarget(a,e);if(!u)return!1;const{unitId:S,subUnitId:p}=u,T=c.transformSupportSymmetryAnchor(e.start,e.end,o.getSubunitRules(S,p)||[],R=>R.cfId);if(!T)return!1;const[y,I]=T,_={unitId:S,subUnitId:p,start:y,end:I},w=c.MoveConditionalRuleMutationUndoFactory(_),b=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return b&&r.pushUndoRedo({unitID:S,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:w}),b}},bt={type:m.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(m.IUndoRedoService),n=t.get(m.ICommandService),a=t.get(m.IUniverInstanceService),o=q.getSheetCommandTarget(a,e);if(!o)return!1;const{unitId:u,subUnitId:S}=o,p={unitId:u,subUnitId:S,rule:e.rule},T=c.setConditionalRuleMutationUndoFactory(t,p),y=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return y&&r.pushUndoRedo({unitID:u,undoMutations:T,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),y}},j={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var Se=function(){return Se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},Se.apply(this,arguments)},Ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r},Ve=L.forwardRef(function(t,e){var r=t.icon,n=t.id,a=t.className,o=t.extend,u=Ur(t,["icon","id","className","extend"]),S="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),p=L.useRef("_".concat(Ar()));return wn(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Se({ref:e,className:S},u),o)});function wn(t,e,r,n,a){return L.createElement(t.tag,Se(Se({key:e},Vr(t,r,a)),n),(zr(t,r).children||[]).map(function(o,u){return wn(o,"".concat(e,"-").concat(t.tag,"-").concat(u),r,void 0,a)}))}function Vr(t,e,r){var n=Se({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(o){var u=o[0],S=o[1];typeof S=="string"&&(n[u]=S.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function zr(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Se(Se({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&n&&n.indexOf(a.attrs.id)>-1?Se(Se({},a),{attrs:Se(Se({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function Ar(){return Math.random().toString(36).substring(2,8)}Ve.displayName="UniverIcon";var jr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ct=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"delete-single",ref:e,icon:jr}))});Ct.displayName="DeleteSingle";var Wr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Rn=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"increase-single",ref:e,icon:Wr}))});Rn.displayName="IncreaseSingle";var Hr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tt=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"more-down-single",ref:e,icon:Hr}))});Tt.displayName="MoreDownSingle";var kr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},_n=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"sequence-single",ref:e,icon:kr}))});_n.displayName="SequenceSingle";var Br={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},$e=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"slash-single",ref:e,icon:Br}))});$e.displayName="SlashSingle";function Fr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function En(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var tn={exports:{}},Ze={},Je={exports:{}},Gr=Je.exports,On;function nn(){return On||(On=1,function(t,e){(function(r,n){n(e)})(Gr,function(r){function n(k){return function(se,P,M,N,A,K,B){return k(se,P,B)}}function a(k){return function(se,P,M,N){if(!se||!P||typeof se!="object"||typeof P!="object")return k(se,P,M,N);var A=N.get(se),K=N.get(P);if(A&&K)return A===P&&K===se;N.set(se,P),N.set(P,se);var B=k(se,P,M,N);return N.delete(se),N.delete(P),B}}function o(k,Q){var se={};for(var P in k)se[P]=k[P];for(var P in Q)se[P]=Q[P];return se}function u(k){return k.constructor===Object||k.constructor==null}function S(k){return typeof k.then=="function"}function p(k,Q){return k===Q||k!==k&&Q!==Q}var T="[object Arguments]",y="[object Boolean]",I="[object Date]",_="[object RegExp]",w="[object Map]",b="[object Number]",R="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function d(k){var Q=k.areArraysEqual,se=k.areDatesEqual,P=k.areMapsEqual,M=k.areObjectsEqual,N=k.areRegExpsEqual,A=k.areSetsEqual,K=k.createIsNestedEqual,B=K(J);function J(Z,te,ce){if(Z===te)return!0;if(!Z||!te||typeof Z!="object"||typeof te!="object")return Z!==Z&&te!==te;if(u(Z)&&u(te))return M(Z,te,B,ce);var Le=Array.isArray(Z),be=Array.isArray(te);if(Le||be)return Le===be&&Q(Z,te,B,ce);var ge=s.call(Z);return ge!==s.call(te)?!1:ge===I?se(Z,te,B,ce):ge===_?N(Z,te,B,ce):ge===w?P(Z,te,B,ce):ge===h?A(Z,te,B,ce):ge===R||ge===T?S(Z)||S(te)?!1:M(Z,te,B,ce):ge===y||ge===b||ge===i?p(Z.valueOf(),te.valueOf()):!1}return J}function C(k,Q,se,P){var M=k.length;if(Q.length!==M)return!1;for(;M-- >0;)if(!se(k[M],Q[M],M,M,k,Q,P))return!1;return!0}var l=a(C);function g(k,Q){return p(k.valueOf(),Q.valueOf())}function f(k,Q,se,P){var M=k.size===Q.size;if(!M)return!1;if(!k.size)return!0;var N={},A=0;return k.forEach(function(K,B){if(M){var J=!1,Z=0;Q.forEach(function(te,ce){!J&&!N[Z]&&(J=se(B,ce,A,Z,k,Q,P)&&se(K,te,B,ce,k,Q,P))&&(N[Z]=!0),Z++}),A++,M=J}}),M}var v=a(f),D="_owner",U=Object.prototype.hasOwnProperty;function z(k,Q,se,P){var M=Object.keys(k),N=M.length;if(Object.keys(Q).length!==N)return!1;for(var A;N-- >0;){if(A=M[N],A===D){var K=!!k.$$typeof,B=!!Q.$$typeof;if((K||B)&&K!==B)return!1}if(!U.call(Q,A)||!se(k[A],Q[A],A,A,k,Q,P))return!1}return!0}var V=a(z);function O(k,Q){return k.source===Q.source&&k.flags===Q.flags}function x(k,Q,se,P){var M=k.size===Q.size;if(!M)return!1;if(!k.size)return!0;var N={};return k.forEach(function(A,K){if(M){var B=!1,J=0;Q.forEach(function(Z,te){!B&&!N[J]&&(B=se(A,Z,K,te,k,Q,P))&&(N[J]=!0),J++}),M=B}}),M}var W=a(x),X=Object.freeze({areArraysEqual:C,areDatesEqual:g,areMapsEqual:f,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:x,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:V,areRegExpsEqual:O,areSetsEqual:W,createIsNestedEqual:n}),ne=d(X);function ee(k,Q){return ne(k,Q,void 0)}var F=d(o(X,{createIsNestedEqual:function(){return p}}));function H(k,Q){return F(k,Q,void 0)}var re=d(Y);function ie(k,Q){return re(k,Q,new WeakMap)}var ue=d(o(Y,{createIsNestedEqual:function(){return p}}));function he(k,Q){return ue(k,Q,new WeakMap)}function ye(k){return d(o(X,k(X)))}function Te(k){var Q=d(o(Y,k(Y)));return function(se,P,M){return M===void 0&&(M=new WeakMap),Q(se,P,M)}}r.circularDeepEqual=ie,r.circularShallowEqual=he,r.createCustomCircularEqual=Te,r.createCustomEqual=ye,r.deepEqual=ee,r.sameValueZeroEqual=p,r.shallowEqual=H,Object.defineProperty(r,"__esModule",{value:!0})})}(Je,Je.exports)),Je.exports}var It={exports:{}},Pn;function rn(){if(Pn)return It.exports;Pn=1;function t(r){var n,a,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(n=0;n<u;n++)r[n]&&(a=t(r[n]))&&(o&&(o+=" "),o+=a)}else for(a in r)r[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var r,n,a=0,o="",u=arguments.length;a<u;a++)(r=arguments[a])&&(n=t(r))&&(o&&(o+=" "),o+=n);return o}return It.exports=e,It.exports.clsx=e,It.exports}var oe={},an,Mn;function qr(){return Mn||(Mn=1,an=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),an}var Dn;function ze(){if(Dn)return oe;Dn=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.bottom=n,oe.childrenEqual=p,oe.cloneLayout=a,oe.cloneLayoutItem=S,oe.collides=y,oe.compact=I,oe.compactItem=b,oe.compactType=k,oe.correctBounds=R,oe.fastPositionEqual=T,oe.fastRGLPropsEqual=void 0,oe.getAllCollisions=s,oe.getFirstCollision=i,oe.getLayoutItem=h,oe.getStatics=d,oe.modifyLayout=o,oe.moveElement=C,oe.moveElementAwayFromCollision=l,oe.noop=void 0,oe.perc=g,oe.resizeItemInDirection=F,oe.setTopLeft=re,oe.setTransform=H,oe.sortLayoutItems=ie,oe.sortLayoutItemsByColRow=he,oe.sortLayoutItemsByRowCol=ue,oe.synchronizeLayoutWithChildren=ye,oe.validateLayout=Te,oe.withLayoutItem=u;var t=nn(),e=r(L);function r(P){return P&&P.__esModule?P:{default:P}}function n(P){let M=0,N;for(let A=0,K=P.length;A<K;A++)N=P[A].y+P[A].h,N>M&&(M=N);return M}function a(P){const M=Array(P.length);for(let N=0,A=P.length;N<A;N++)M[N]=S(P[N]);return M}function o(P,M){const N=Array(P.length);for(let A=0,K=P.length;A<K;A++)M.i===P[A].i?N[A]=M:N[A]=P[A];return N}function u(P,M,N){let A=h(P,M);return A?(A=N(S(A)),P=o(P,A),[P,A]):[P,null]}function S(P){return{w:P.w,h:P.h,x:P.x,y:P.y,i:P.i,minW:P.minW,maxW:P.maxW,minH:P.minH,maxH:P.maxH,moved:!!P.moved,static:!!P.static,isDraggable:P.isDraggable,isResizable:P.isResizable,resizeHandles:P.resizeHandles,isBounded:P.isBounded}}function p(P,M){return(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.key),e.default.Children.map(M,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(M,N=>N==null?void 0:N.props["data-grid"]))}oe.fastRGLPropsEqual=qr();function T(P,M){return P.left===M.left&&P.top===M.top&&P.width===M.width&&P.height===M.height}function y(P,M){return!(P.i===M.i||P.x+P.w<=M.x||P.x>=M.x+M.w||P.y+P.h<=M.y||P.y>=M.y+M.h)}function I(P,M,N,A){const K=d(P),B=ie(P,M),J=Array(P.length);for(let Z=0,te=B.length;Z<te;Z++){let ce=S(B[Z]);ce.static||(ce=b(K,ce,M,N,B,A),K.push(ce)),J[P.indexOf(B[Z])]=ce,ce.moved=!1}return J}const _={x:"w",y:"h"};function w(P,M,N,A){const K=_[A];M[A]+=1;const B=P.map(J=>J.i).indexOf(M.i);for(let J=B+1;J<P.length;J++){const Z=P[J];if(!Z.static){if(Z.y>M.y+M.h)break;y(M,Z)&&w(P,Z,N+M[K],A)}}M[A]=N}function b(P,M,N,A,K,B){const J=N==="vertical",Z=N==="horizontal";if(J)for(M.y=Math.min(n(P),M.y);M.y>0&&!i(P,M);)M.y--;else if(Z)for(;M.x>0&&!i(P,M);)M.x--;let te;for(;(te=i(P,M))&&!(N===null&&B);)if(Z?w(K,M,te.x+te.w,"x"):w(K,M,te.y+te.h,"y"),Z&&M.x+M.w>A)for(M.x=A-M.w,M.y++;M.x>0&&!i(P,M);)M.x--;return M.y=Math.max(M.y,0),M.x=Math.max(M.x,0),M}function R(P,M){const N=d(P);for(let A=0,K=P.length;A<K;A++){const B=P[A];if(B.x+B.w>M.cols&&(B.x=M.cols-B.w),B.x<0&&(B.x=0,B.w=M.cols),!B.static)N.push(B);else for(;i(N,B);)B.y++}return P}function h(P,M){for(let N=0,A=P.length;N<A;N++)if(P[N].i===M)return P[N]}function i(P,M){for(let N=0,A=P.length;N<A;N++)if(y(P[N],M))return P[N]}function s(P,M){return P.filter(N=>y(N,M))}function d(P){return P.filter(M=>M.static)}function C(P,M,N,A,K,B,J,Z,te){if(M.static&&M.isDraggable!==!0||M.y===A&&M.x===N)return P;`${M.i}${String(N)}${String(A)}${M.x}${M.y}`;const ce=M.x,Le=M.y;typeof N=="number"&&(M.x=N),typeof A=="number"&&(M.y=A),M.moved=!0;let be=ie(P,J);(J==="vertical"&&typeof A=="number"?Le>=A:J==="horizontal"&&typeof N=="number"?ce>=N:!1)&&(be=be.reverse());const Fe=s(be,M),Ft=Fe.length>0;if(Ft&&te)return a(P);if(Ft&&B)return`${M.i}`,M.x=ce,M.y=Le,M.moved=!1,P;for(let Cn=0,Vo=Fe.length;Cn<Vo;Cn++){const Ue=Fe[Cn];`${M.i}${M.x}${M.y}${Ue.i}${Ue.x}${Ue.y}`,!Ue.moved&&(Ue.static?P=l(P,Ue,M,K,J):P=l(P,M,Ue,K,J))}return P}function l(P,M,N,A,K,B){const J=K==="horizontal",Z=K==="vertical",te=M.static;if(A){A=!1;const be={x:J?Math.max(M.x-N.w,0):N.x,y:Z?Math.max(M.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ge=i(P,be),Fe=ge&&ge.y+ge.h>M.y,Ft=ge&&M.x+M.w>ge.x;if(ge){if(Fe&&Z)return C(P,N,void 0,M.y+1,A,te,K);if(Fe&&K==null)return M.y=N.y,N.y=N.y+N.h,P;if(Ft&&J)return C(P,M,N.x,void 0,A,te,K)}else return`${N.i}${be.x}${be.y}`,C(P,N,J?be.x:void 0,Z?be.y:void 0,A,te,K)}const ce=J?N.x+1:void 0,Le=Z?N.y+1:void 0;return ce==null&&Le==null?P:C(P,N,J?N.x+1:void 0,Z?N.y+1:void 0,A,te,K)}function g(P){return P*100+"%"}const f=(P,M,N,A)=>P+N>A?M:N,v=(P,M,N)=>P<0?M:N,D=P=>Math.max(0,P),U=P=>Math.max(0,P),z=(P,M,N)=>{let{left:A,height:K,width:B}=M;const J=P.top-(K-P.height);return{left:A,width:B,height:v(J,P.height,K),top:U(J)}},V=(P,M,N)=>{let{top:A,left:K,height:B,width:J}=M;return{top:A,height:B,width:f(P.left,P.width,J,N),left:D(K)}},O=(P,M,N)=>{let{top:A,height:K,width:B}=M;const J=P.left-(B-P.width);return{height:K,width:J<0?P.width:f(P.left,P.width,B,N),top:U(A),left:D(J)}},x=(P,M,N)=>{let{top:A,left:K,height:B,width:J}=M;return{width:J,left:K,height:v(A,P.height,B),top:U(A)}},ee={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],V(...arguments))},e:V,se:function(){return x(arguments.length<=0?void 0:arguments[0],V(...arguments))},s:x,sw:function(){return x(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return z(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function F(P,M,N,A){const K=ee[P];return K?K(M,{...M,...N},A):N}function H(P){let{top:M,left:N,width:A,height:K}=P;const B=`translate(${N}px,${M}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${A}px`,height:`${K}px`,position:"absolute"}}function re(P){let{top:M,left:N,width:A,height:K}=P;return{top:`${M}px`,left:`${N}px`,width:`${A}px`,height:`${K}px`,position:"absolute"}}function ie(P,M){return M==="horizontal"?he(P):M==="vertical"?ue(P):P}function ue(P){return P.slice(0).sort(function(M,N){return M.y>N.y||M.y===N.y&&M.x>N.x?1:M.y===N.y&&M.x===N.x?0:-1})}function he(P){return P.slice(0).sort(function(M,N){return M.x>N.x||M.x===N.x&&M.y>N.y?1:-1})}function ye(P,M,N,A,K){P=P||[];const B=[];e.default.Children.forEach(M,Z=>{if((Z==null?void 0:Z.key)==null)return;const te=h(P,String(Z.key)),ce=Z.props["data-grid"];te&&ce==null?B.push(S(te)):ce?B.push(S({...ce,i:Z.key})):B.push(S({w:1,h:1,x:0,y:n(B),i:String(Z.key)}))});const J=R(B,{cols:N});return K?J:I(J,A,N)}function Te(P){let M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(P))throw new Error(M+" must be an array!");for(let A=0,K=P.length;A<K;A++){const B=P[A];for(let J=0;J<N.length;J++)if(typeof B[N[J]]!="number")throw new Error("ReactGridLayout: "+M+"["+A+"]."+N[J]+" must be a number!")}}function k(P){const{verticalCompact:M,compactType:N}=P||{};return M===!1?null:N}function Q(){}const se=()=>{};return oe.noop=se,oe}var we={},xn;function on(){if(xn)return we;xn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.calcGridColWidth=t,we.calcGridItemPosition=r,we.calcGridItemWHPx=e,we.calcWH=a,we.calcXY=n,we.clamp=o;function t(u){const{margin:S,containerPadding:p,containerWidth:T,cols:y}=u;return(T-S[0]*(y-1)-p[0]*2)/y}function e(u,S,p){return Number.isFinite(u)?Math.round(S*u+Math.max(0,u-1)*p):u}function r(u,S,p,T,y,I){const{margin:_,containerPadding:w,rowHeight:b}=u,R=t(u),h={};return I&&I.resizing?(h.width=Math.round(I.resizing.width),h.height=Math.round(I.resizing.height)):(h.width=e(T,R,_[0]),h.height=e(y,b,_[1])),I&&I.dragging?(h.top=Math.round(I.dragging.top),h.left=Math.round(I.dragging.left)):I&&I.resizing&&typeof I.resizing.top=="number"&&typeof I.resizing.left=="number"?(h.top=Math.round(I.resizing.top),h.left=Math.round(I.resizing.left)):(h.top=Math.round((b+_[1])*p+w[1]),h.left=Math.round((R+_[0])*S+w[0])),h}function n(u,S,p,T,y){const{margin:I,cols:_,rowHeight:w,maxRows:b}=u,R=t(u);let h=Math.round((p-I[0])/(R+I[0])),i=Math.round((S-I[1])/(w+I[1]));return h=o(h,0,_-T),i=o(i,0,b-y),{x:h,y:i}}function a(u,S,p,T,y,I){const{margin:_,maxRows:w,cols:b,rowHeight:R}=u,h=t(u);let i=Math.round((S+_[0])/(h+_[0])),s=Math.round((p+_[1])/(R+_[1])),d=o(i,0,b-T),C=o(s,0,w-y);return["sw","w","nw"].indexOf(I)!==-1&&(d=o(i,0,b)),["nw","n","ne"].indexOf(I)!==-1&&(C=o(s,0,w)),{w:d,h:C}}function o(u,S,p){return Math.max(Math.min(u,p),S)}return we}var Qe={},sn={exports:{}},ln,Nn;function Xr(){if(Nn)return ln;Nn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ln=t,ln}var un,Ln;function Yr(){if(Ln)return un;Ln=1;var t=Xr();function e(){}function r(){}return r.resetWarningCache=e,un=function(){function n(u,S,p,T,y,I){if(I!==t){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",_}}n.isRequired=n;function a(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:e};return o.PropTypes=o,o},un}var Un;function Ee(){return Un||(Un=1,sn.exports=Yr()()),sn.exports}var et={exports:{}},cn={};function Vn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Vn(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function zn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Vn(t))&&(n&&(n+=" "),n+=e);return n}const Kr=En(Object.freeze(Object.defineProperty({__proto__:null,clsx:zn,default:zn},Symbol.toStringTag,{value:"Module"})));var fe={},Oe={},An;function wt(){if(An)return Oe;An=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=n,Oe.isFunction=e,Oe.isNum=r;function t(o,u){for(let S=0,p=o.length;S<p;S++)if(u.apply(u,[o[S],S,o]))return o[S]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function r(o){return typeof o=="number"&&!isNaN(o)}function n(o){return parseInt(o,10)}function a(o,u,S){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(S," - do not set this, set it on the child."))}return Oe}var Pe={},jn;function $r(){if(jn)return Pe;jn=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=r,Pe.browserPrefixToStyle=n,Pe.default=void 0,Pe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var o;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const S=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!S||u in S)return"";for(let p=0;p<t.length;p++)if(r(u,t[p])in S)return t[p];return""}function r(o,u){return u?"".concat(u).concat(a(o)):o}function n(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",S=!0;for(let p=0;p<o.length;p++)S?(u+=o[p].toUpperCase(),S=!1):o[p]==="-"?S=!0:u+=o[p];return u}return Pe.default=e(),Pe}var Wn;function dn(){if(Wn)return fe;Wn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=l,fe.addEvent=S,fe.addUserSelectStyles=d,fe.createCSSTransform=b,fe.createSVGTransform=R,fe.getTouch=i,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=I,fe.innerWidth=_,fe.matchesSelector=o,fe.matchesSelectorAndParentsTo=u,fe.offsetXYFromParent=w,fe.outerHeight=T,fe.outerWidth=y,fe.removeClassName=g,fe.removeEvent=p,fe.removeUserSelectStyles=C;var t=wt(),e=n($r());function r(f){if(typeof WeakMap!="function")return null;var v=new WeakMap,D=new WeakMap;return(r=function(U){return U?D:v})(f)}function n(f,v){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var D=r(v);if(D&&D.has(f))return D.get(f);var U={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in f)if(V!=="default"&&Object.prototype.hasOwnProperty.call(f,V)){var O=z?Object.getOwnPropertyDescriptor(f,V):null;O&&(O.get||O.set)?Object.defineProperty(U,V,O):U[V]=f[V]}return U.default=f,D&&D.set(f,U),U}let a="";function o(f,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(D){return(0,t.isFunction)(f[D])})),(0,t.isFunction)(f[a])?f[a](v):!1}function u(f,v,D){let U=f;do{if(o(U,v))return!0;if(U===D)return!1;U=U.parentNode}while(U);return!1}function S(f,v,D,U){if(!f)return;const z={capture:!0,...U};f.addEventListener?f.addEventListener(v,D,z):f.attachEvent?f.attachEvent("on"+v,D):f["on"+v]=D}function p(f,v,D,U){if(!f)return;const z={capture:!0,...U};f.removeEventListener?f.removeEventListener(v,D,z):f.detachEvent?f.detachEvent("on"+v,D):f["on"+v]=null}function T(f){let v=f.clientHeight;const D=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,t.int)(D.borderTopWidth),v+=(0,t.int)(D.borderBottomWidth),v}function y(f){let v=f.clientWidth;const D=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,t.int)(D.borderLeftWidth),v+=(0,t.int)(D.borderRightWidth),v}function I(f){let v=f.clientHeight;const D=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,t.int)(D.paddingTop),v-=(0,t.int)(D.paddingBottom),v}function _(f){let v=f.clientWidth;const D=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,t.int)(D.paddingLeft),v-=(0,t.int)(D.paddingRight),v}function w(f,v,D){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),V=(f.clientX+v.scrollLeft-z.left)/D,O=(f.clientY+v.scrollTop-z.top)/D;return{x:V,y:O}}function b(f,v){const D=h(f,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:D}}function R(f,v){return h(f,v,"")}function h(f,v,D){let{x:U,y:z}=f,V="translate(".concat(U).concat(D,",").concat(z).concat(D,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+D),x="".concat(typeof v.y=="string"?v.y:v.y+D);V="translate(".concat(O,", ").concat(x,")")+V}return V}function i(f,v){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,D=>v===D.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,D=>v===D.identifier)}function s(f){if(f.targetTouches&&f.targetTouches[0])return f.targetTouches[0].identifier;if(f.changedTouches&&f.changedTouches[0])return f.changedTouches[0].identifier}function d(f){if(!f)return;let v=f.getElementById("react-draggable-style-el");v||(v=f.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
11
|
+
`,v.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
12
|
+
`,f.getElementsByTagName("head")[0].appendChild(v)),f.body&&l(f.body,"react-draggable-transparent-selection")}function C(f){if(f)try{if(f.body&&g(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const v=(f.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(f,v){f.classList?f.classList.add(v):f.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(f.className+=" ".concat(v))}function g(f,v){f.classList?f.classList.remove(v):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return fe}var Ie={},Hn;function kn(){if(Hn)return Ie;Hn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=a,Ie.canDragY=o,Ie.createCoreData=S,Ie.createDraggableData=p,Ie.getBoundPosition=r,Ie.getControlPosition=u,Ie.snapToGrid=n;var t=wt(),e=dn();function r(I,_,w){if(!I.props.bounds)return[_,w];let{bounds:b}=I.props;b=typeof b=="string"?b:T(b);const R=y(I);if(typeof b=="string"){const{ownerDocument:h}=R,i=h.defaultView;let s;if(b==="parent"?s=R.parentNode:s=h.querySelector(b),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+b+'" could not find an element.');const d=s,C=i.getComputedStyle(R),l=i.getComputedStyle(d);b={left:-R.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(C.marginLeft),top:-R.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(C.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(R)-R.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(C.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(R)-R.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(C.marginBottom)}}return(0,t.isNum)(b.right)&&(_=Math.min(_,b.right)),(0,t.isNum)(b.bottom)&&(w=Math.min(w,b.bottom)),(0,t.isNum)(b.left)&&(_=Math.max(_,b.left)),(0,t.isNum)(b.top)&&(w=Math.max(w,b.top)),[_,w]}function n(I,_,w){const b=Math.round(_/I[0])*I[0],R=Math.round(w/I[1])*I[1];return[b,R]}function a(I){return I.props.axis==="both"||I.props.axis==="x"}function o(I){return I.props.axis==="both"||I.props.axis==="y"}function u(I,_,w){const b=typeof _=="number"?(0,e.getTouch)(I,_):null;if(typeof _=="number"&&!b)return null;const R=y(w),h=w.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,e.offsetXYFromParent)(b||I,h,w.props.scale)}function S(I,_,w){const b=!(0,t.isNum)(I.lastX),R=y(I);return b?{node:R,deltaX:0,deltaY:0,lastX:_,lastY:w,x:_,y:w}:{node:R,deltaX:_-I.lastX,deltaY:w-I.lastY,lastX:I.lastX,lastY:I.lastY,x:_,y:w}}function p(I,_){const w=I.props.scale;return{node:_.node,x:I.state.x+_.deltaX/w,y:I.state.y+_.deltaY/w,deltaX:_.deltaX/w,deltaY:_.deltaY/w,lastX:I.state.x,lastY:I.state.y}}function T(I){return{left:I.left,top:I.top,right:I.right,bottom:I.bottom}}function y(I){const _=I.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Ie}var tt={},Rt={},Bn;function Fn(){if(Bn)return Rt;Bn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=t;function t(){}return Rt}var Gn;function Zr(){if(Gn)return tt;Gn=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var t=T(L),e=S(Ee()),r=S(Tn),n=dn(),a=kn(),o=wt(),u=S(Fn());function S(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:i})(h)}function T(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var d={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=C?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function y(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let b=w.mouse,R=class extends t.Component{constructor(){super(...arguments),y(this,"dragging",!1),y(this,"lastX",NaN),y(this,"lastY",NaN),y(this,"touchIdentifier",null),y(this,"mounted",!1),y(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:d}=s;if(this.props.disabled||!(i.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const C=(0,n.getTouchIdentifier)(i);this.touchIdentifier=C;const l=(0,a.getControlPosition)(i,C,this);if(l==null)return;const{x:g,y:f}=l,v=(0,a.createCoreData)(this,g,f);(0,u.default)("DraggableCore: handleDragStart: %j",v),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=f,(0,n.addEvent)(d,b.move,this.handleDrag),(0,n.addEvent)(d,b.stop,this.handleDragStop))}),y(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,v=C-this.lastY;if([f,v]=(0,a.snapToGrid)(this.props.grid,f,v),!f&&!v)return;d=this.lastX+f,C=this.lastY+v}const l=(0,a.createCoreData)(this,d,C);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=d,this.lastY=C}),y(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let v=d-this.lastX||0,D=C-this.lastY||0;[v,D]=(0,a.snapToGrid)(this.props.grid,v,D),d=this.lastX+v,C=this.lastY+D}const l=(0,a.createCoreData)(this,d,C);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const f=this.findDOMNode();f&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(f.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,f&&((0,u.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(f.ownerDocument,b.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,b.stop,this.handleDragStop))}),y(this,"onMouseDown",i=>(b=w.mouse,this.handleDragStart(i))),y(this,"onMouseUp",i=>(b=w.mouse,this.handleDragStop(i))),y(this,"onTouchStart",i=>(b=w.touch,this.handleDragStart(i))),y(this,"onTouchEnd",i=>(b=w.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,n.addEvent)(i,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,n.removeEvent)(s,w.mouse.move,this.handleDrag),(0,n.removeEvent)(s,w.touch.move,this.handleDrag),(0,n.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,n.removeEvent)(i,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return tt.default=R,y(R,"displayName","DraggableCore"),y(R,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,i){if(h[i]&&h[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel: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,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),y(R,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),tt}var qn;function Jr(){return qn||(qn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=_(L),r=y(Ee()),n=y(Tn),a=y(Kr),o=dn(),u=kn(),S=wt(),p=y(Zr()),T=y(Fn());function y(s){return s&&s.__esModule?s:{default:s}}function I(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(I=function(l){return l?C:d})(s)}function _(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=I(d);if(C&&C.has(s))return C.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,C&&C.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},w.apply(this,arguments)}function b(s,d,C){return d=R(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function R(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,d||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(d,C){let{position:l}=d,{prevPropsPosition:g}=C;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,T.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),b(this,"onDragStart",(C,l)=>{if((0,T.default)("Draggable: onDragStart: %j",l),this.props.onStart(C,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(C,l)=>{if(!this.state.dragging)return!1;(0,T.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),f={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:U}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[z,V]=(0,u.getBoundPosition)(this,f.x,f.y);f.x=z,f.y=V,f.slackX=this.state.slackX+(D-f.x),f.slackY=this.state.slackY+(U-f.y),g.x=f.x,g.y=f.y,g.deltaX=f.x-this.state.x,g.deltaY=f.y-this.state.y}if(this.props.onDrag(C,g)===!1)return!1;this.setState(f)}),b(this,"onDragStop",(C,l)=>{if(!this.state.dragging||this.props.onStop(C,(0,u.createDraggableData)(this,l))===!1)return!1;(0,T.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:U}=this.props.position;f.x=D,f.y=U}this.setState(f)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var d,C;return(d=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:C,children:l,defaultPosition:g,defaultClassName:f,defaultClassNameDragging:v,defaultClassNameDragged:D,position:U,positionOffset:z,scale:V,...O}=this.props;let x={},W=null;const Y=!!!U||this.state.dragging,ne=U||g,ee={x:(0,u.canDragX)(this)&&Y?this.state.x:ne.x,y:(0,u.canDragY)(this)&&Y?this.state.y:ne.y};this.state.isElementSVG?W=(0,o.createSVGTransform)(ee,z):x=(0,o.createCSSTransform)(ee,z);const F=(0,a.default)(l.props.className||"",f,{[v]:this.state.dragging,[D]:this.state.dragged});return e.createElement(p.default,w({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:F,style:{...l.props.style,...x},transform:W}))}}t.default=i,b(i,"displayName","Draggable"),b(i,"propTypes",{...p.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:S.dontSetMe,style:S.dontSetMe,transform:S.dontSetMe}),b(i,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(cn)),cn}var Xn;function fn(){if(Xn)return et.exports;Xn=1;const{default:t,DraggableCore:e}=Jr();return et.exports=t,et.exports.default=t,et.exports.DraggableCore=e,et.exports}var nt={exports:{}},rt={},_t={},Yn;function Qr(){if(Yn)return _t;Yn=1,_t.__esModule=!0,_t.cloneElement=S;var t=e(L);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,T){var y=Object.keys(p);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(p);T&&(I=I.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),y.push.apply(y,I)}return y}function n(p){for(var T=1;T<arguments.length;T++){var y=arguments[T]!=null?arguments[T]:{};T%2?r(Object(y),!0).forEach(function(I){a(p,I,y[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(y)):r(Object(y)).forEach(function(I){Object.defineProperty(p,I,Object.getOwnPropertyDescriptor(y,I))})}return p}function a(p,T,y){return T=o(T),T in p?Object.defineProperty(p,T,{value:y,enumerable:!0,configurable:!0,writable:!0}):p[T]=y,p}function o(p){var T=u(p,"string");return typeof T=="symbol"?T:String(T)}function u(p,T){if(typeof p!="object"||p===null)return p;var y=p[Symbol.toPrimitive];if(y!==void 0){var I=y.call(p,T||"default");if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(p)}function S(p,T){return T.style&&p.props.style&&(T.style=n(n({},p.props.style),T.style)),T.className&&p.props.className&&(T.className=p.props.className+" "+T.className),t.default.cloneElement(p,T)}return _t}var at={},Kn;function $n(){if(Kn)return at;Kn=1,at.__esModule=!0,at.resizableProps=void 0;var t=e(Ee());fn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle: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}),height:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var S=o[0];if(S.axis==="both"||S.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var S=o[0];if(S.axis==="both"||S.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)}};return at.resizableProps=r,at}var Zn;function Jn(){if(Zn)return rt;Zn=1,rt.__esModule=!0,rt.default=void 0;var t=u(L),e=fn(),r=Qr(),n=$n(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(o=function(l){return l?d:s})(i)}function u(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var d=o(s);if(d&&d.has(i))return d.get(i);var C={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var f=l?Object.getOwnPropertyDescriptor(i,g):null;f&&(f.get||f.set)?Object.defineProperty(C,g,f):C[g]=i[g]}return C.default=i,d&&d.set(i,C),C}function S(){return S=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(i[C]=d[C])}return i},S.apply(this,arguments)}function p(i,s){if(i==null)return{};var d={},C=Object.keys(i),l,g;for(g=0;g<C.length;g++)l=C[g],!(s.indexOf(l)>=0)&&(d[l]=i[l]);return d}function T(i,s){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(i);s&&(C=C.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),d.push.apply(d,C)}return d}function y(i){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?T(Object(d),!0).forEach(function(C){I(i,C,d[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):T(Object(d)).forEach(function(C){Object.defineProperty(i,C,Object.getOwnPropertyDescriptor(d,C))})}return i}function I(i,s,d){return s=_(s),s in i?Object.defineProperty(i,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[s]=d,i}function _(i){var s=w(i,"string");return typeof s=="symbol"?s:String(s)}function w(i,s){if(typeof i!="object"||i===null)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var C=d.call(i,s||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function b(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,R(i,s)}function R(i,s){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,l){return C.__proto__=l,C},R(i,s)}var h=function(i){b(s,i);function s(){for(var C,l=arguments.length,g=new Array(l),f=0;f<l;f++)g[f]=arguments[f];return C=i.call.apply(i,[this].concat(g))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(l,g){var f=this.props,v=f.minConstraints,D=f.maxConstraints,U=f.lockAspectRatio;if(!v&&!D&&!U)return[l,g];if(U){var z=this.props.width/this.props.height,V=l-this.props.width,O=g-this.props.height;Math.abs(V)>Math.abs(O*z)?g=l/z:l=g*z}var x=l,W=g,X=this.slack||[0,0],Y=X[0],ne=X[1];return l+=Y,g+=ne,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),D&&(l=Math.min(D[0],l),g=Math.min(D[1],g)),this.slack=[Y+(x-l),ne+(W-g)],[l,g]},d.resizeHandler=function(l,g){var f=this;return function(v,D){var U=D.node,z=D.deltaX,V=D.deltaY;l==="onResizeStart"&&f.resetData();var O=(f.props.axis==="both"||f.props.axis==="x")&&g!=="n"&&g!=="s",x=(f.props.axis==="both"||f.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!x)){var W=g[0],X=g[g.length-1],Y=U.getBoundingClientRect();if(f.lastHandleRect!=null){if(X==="w"){var ne=Y.left-f.lastHandleRect.left;z+=ne}if(W==="n"){var ee=Y.top-f.lastHandleRect.top;V+=ee}}f.lastHandleRect=Y,X==="w"&&(z=-z),W==="n"&&(V=-V);var F=f.props.width+(O?z/f.props.transformScale:0),H=f.props.height+(x?V/f.props.transformScale:0),re=f.runConstraints(F,H);F=re[0],H=re[1];var ie=F!==f.props.width||H!==f.props.height,ue=typeof f.props[l]=="function"?f.props[l]:null,he=l==="onResize"&&!ie;ue&&!he&&(v.persist==null||v.persist(),ue(v,{node:U,size:{width:F,height:H},handle:g})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,g){var f=this.props.handle;if(!f)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof f=="function")return f(l,g);var v=typeof f.type=="string",D=y({ref:g},v?{}:{handleAxis:l});return t.cloneElement(f,D)},d.render=function(){var l=this,g=this.props,f=g.children,v=g.className,D=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var U=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,r.cloneElement)(f,y(y({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(f.props.children,U.map(function(V){var O,x=(O=l.handleRefs[V])!=null?O:l.handleRefs[V]=t.createRef();return t.createElement(e.DraggableCore,S({},D,{nodeRef:x,key:"resizableHandle-"+V,onStop:l.resizeHandler("onResizeStop",V),onStart:l.resizeHandler("onResizeStart",V),onDrag:l.resizeHandler("onResize",V)}),l.renderResizeHandle(V,x))}))}))},s}(t.Component);return rt.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},rt}var ot={},Qn;function ea(){if(Qn)return ot;Qn=1,ot.__esModule=!0,ot.default=void 0;var t=S(L),e=o(Ee()),r=o(Jn()),n=$n(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(u=function(g){return g?C:d})(s)}function S(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=u(d);if(C&&C.has(s))return C.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,C&&C.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var l in C)Object.prototype.hasOwnProperty.call(C,l)&&(s[l]=C[l])}return s},p.apply(this,arguments)}function T(s,d){var C=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),C.push.apply(C,l)}return C}function y(s){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?T(Object(C),!0).forEach(function(l){I(s,l,C[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(C)):T(Object(C)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(C,l))})}return s}function I(s,d,C){return d=_(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function _(s){var d=w(s,"string");return typeof d=="symbol"?d:String(d)}function w(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var l=C.call(s,d||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function b(s,d){if(s==null)return{};var C={},l=Object.keys(s),g,f;for(f=0;f<l.length;f++)g=l[f],!(d.indexOf(g)>=0)&&(C[g]=s[g]);return C}function R(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,d)}var i=function(s){R(d,s);function d(){for(var l,g=arguments.length,f=new Array(g),v=0;v<g;v++)f[v]=arguments[v];return l=s.call.apply(s,[this].concat(f))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(D,U){var z=U.size;l.props.onResize?(D.persist==null||D.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(D,U)})):l.setState(z)},l}d.getDerivedStateFromProps=function(g,f){return f.propsWidth!==g.width||f.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var C=d.prototype;return C.render=function(){var g=this.props,f=g.handle,v=g.handleSize;g.onResize;var D=g.onResizeStart,U=g.onResizeStop,z=g.draggableOpts,V=g.minConstraints,O=g.maxConstraints,x=g.lockAspectRatio,W=g.axis;g.width,g.height;var X=g.resizeHandles,Y=g.style,ne=g.transformScale,ee=b(g,a);return t.createElement(r.default,{axis:W,draggableOpts:z,handle:f,handleSize:v,height:this.state.height,lockAspectRatio:x,maxConstraints:O,minConstraints:V,onResizeStart:D,onResize:this.onResize,onResizeStop:U,resizeHandles:X,transformScale:ne,width:this.state.width},t.createElement("div",p({},ee,{style:y(y({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return ot.default=i,i.propTypes=y(y({},n.resizableProps),{},{children:e.default.element}),ot}var er;function ta(){return er||(er=1,nt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},nt.exports.Resizable=Jn().default,nt.exports.ResizableBox=ea().default),nt.exports}var Re={},tr;function nr(){if(tr)return Re;tr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.resizeHandleType=Re.resizeHandleAxesType=Re.default=void 0;var t=r(Ee()),e=r(L);function r(o){return o&&o.__esModule?o:{default:o}}const n=Re.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=Re.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Re.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(o){o.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:a,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(o,u){const S=o[u],p={};e.default.Children.forEach(S,function(T){if((T==null?void 0:T.key)!=null){if(p[T.key])throw new Error('Duplicate child key "'+T.key+'" found! This will cause problems in ReactGridLayout.');p[T.key]=!0}})},innerRef:t.default.any},Re}var rr;function na(){if(rr)return Qe;rr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var t=p(L),e=p(Ee()),r=fn(),n=ta(),a=ze(),o=on(),u=nr(),S=p(rn());function p(w){return w&&w.__esModule?w:{default:w}}function T(w,b,R){return b=y(b),b in w?Object.defineProperty(w,b,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[b]=R,w}function y(w){var b=I(w,"string");return typeof b=="symbol"?b:String(b)}function I(w,b){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,b||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(w)}let _=class extends t.default.Component{constructor(){super(...arguments),T(this,"state",{resizing:null,dragging:null,className:""}),T(this,"elementRef",t.default.createRef()),T(this,"onDragStart",(b,R)=>{let{node:h}=R;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const d={top:0,left:0},{offsetParent:C}=h;if(!C)return;const l=C.getBoundingClientRect(),g=h.getBoundingClientRect(),f=g.left/s,v=l.left/s,D=g.top/s,U=l.top/s;d.left=f-v+C.scrollLeft,d.top=D-U+C.scrollTop,this.setState({dragging:d});const{x:z,y:V}=(0,o.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,V,{e:b,node:h,newPosition:d})}),T(this,"onDrag",(b,R)=>{let{node:h,deltaX:i,deltaY:s}=R;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let C=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:f,w:v,h:D,containerWidth:U}=this.props,z=this.getPositionParams();if(g){const{offsetParent:X}=h;if(X){const{margin:Y,rowHeight:ne,containerPadding:ee}=this.props,F=X.clientHeight-(0,o.calcGridItemWHPx)(D,ne,Y[1]);C=(0,o.clamp)(C-ee[1],0,F);const H=(0,o.calcGridColWidth)(z),re=U-(0,o.calcGridItemWHPx)(v,H,Y[0]);l=(0,o.clamp)(l-ee[0],0,re)}}const V={top:C,left:l};this.setState({dragging:V});const{containerPadding:O}=this.props,{x,y:W}=(0,o.calcXY)(z,C-O[1],l-O[0],v,D);return d.call(this,f,x,W,{e:b,node:h,newPosition:V})}),T(this,"onDragStop",(b,R)=>{let{node:h}=R;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:C,containerPadding:l}=this.props,{left:g,top:f}=this.state.dragging,v={top:f,left:g};this.setState({dragging:null});const{x:D,y:U}=(0,o.calcXY)(this.getPositionParams(),f-l[1],g-l[0],s,d);return i.call(this,C,D,U,{e:b,node:h,newPosition:v})}),T(this,"onResizeStop",(b,R,h)=>this.onResizeHandler(b,R,h,"onResizeStop")),T(this,"onResizeStart",(b,R,h)=>this.onResizeHandler(b,R,h,"onResizeStart")),T(this,"onResize",(b,R,h)=>this.onResizeHandler(b,R,h,"onResize"))}shouldComponentUpdate(b,R){if(this.props.children!==b.children||this.props.droppingPosition!==b.droppingPosition)return!0;const h=(0,o.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,o.calcGridItemPosition)(this.getPositionParams(b),b.x,b.y,b.w,b.h,R);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==b.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(b){this.moveDroppingItem(b)}moveDroppingItem(b){const{droppingPosition:R}=this.props;if(!R)return;const h=this.elementRef.current;if(!h)return;const i=b.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&R.left!==i.left||R.top!==i.top;if(!s)this.onDragStart(R.e,{node:h,deltaX:R.left,deltaY:R.top});else if(d){const C=R.left-s.left,l=R.top-s.top;this.onDrag(R.e,{node:h,deltaX:C,deltaY:l})}}getPositionParams(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:b.cols,containerPadding:b.containerPadding,containerWidth:b.containerWidth,margin:b.margin,maxRows:b.maxRows,rowHeight:b.rowHeight}}createStyle(b){const{usePercentages:R,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(b):(s=(0,a.setTopLeft)(b),R&&(s.left=(0,a.perc)(b.left/h),s.width=(0,a.perc)(b.width/h))),s}mixinDraggable(b,R){return t.default.createElement(r.DraggableCore,{disabled:!R,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},b)}curryResizeHandler(b,R){return(h,i)=>R(h,i,b)}mixinResizable(b,R,h){const{cols:i,minW:s,minH:d,maxW:C,maxH:l,transformScale:g,resizeHandles:f,resizeHandle:v}=this.props,D=this.getPositionParams(),U=(0,o.calcGridItemPosition)(D,0,0,i,0).width,z=(0,o.calcGridItemPosition)(D,0,0,s,d),V=(0,o.calcGridItemPosition)(D,0,0,C,l),O=[z.width,z.height],x=[Math.min(V.width,U),Math.min(V.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:R.width,height:R.height,minConstraints:O,maxConstraints:x,onResizeStop:this.curryResizeHandler(R,this.onResizeStop),onResizeStart:this.curryResizeHandler(R,this.onResizeStart),onResize:this.curryResizeHandler(R,this.onResize),transformScale:g,resizeHandles:f,handle:v},b)}onResizeHandler(b,R,h,i){let{node:s,size:d,handle:C}=R;const l=this.props[i];if(!l)return;const{x:g,y:f,i:v,maxH:D,minH:U,containerWidth:z}=this.props,{minW:V,maxW:O}=this.props;let x=d;s&&(x=(0,a.resizeItemInDirection)(C,h,d,z),this.setState({resizing:i==="onResizeStop"?null:x}));let{w:W,h:X}=(0,o.calcWH)(this.getPositionParams(),x.width,x.height,g,f,C);W=(0,o.clamp)(W,Math.max(V,1),O),X=(0,o.clamp)(X,U,D),l.call(this,v,W,X,{e:b,node:s,size:x,handle:C})}render(){const{x:b,y:R,w:h,h:i,isDraggable:s,isResizable:d,droppingPosition:C,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),b,R,h,i,this.state),f=t.default.Children.only(this.props.children);let v=t.default.cloneElement(f,{ref:this.elementRef,className:(0,S.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!C,cssTransforms:l}),style:{...this.props.style,...f.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,d),v=this.mixinDraggable(v,s),v}};return Qe.default=_,T(_,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(w,b){const R=w[b];if(typeof R!="number")return new Error("minWidth not Number");if(R>w.w||R>w.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(w,b){const R=w[b];if(typeof R!="number")return new Error("maxWidth not Number");if(R<w.w||R<w.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(w,b){const R=w[b];if(typeof R!="number")return new Error("minHeight not Number");if(R>w.h||R>w.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(w,b){const R=w[b];if(typeof R!="number")return new Error("maxHeight not Number");if(R<w.h||R<w.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),T(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Qe}var ar;function or(){if(ar)return Ze;ar=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=T(L),e=nn(),r=S(rn()),n=ze(),a=on(),o=S(na()),u=S(nr());function S(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:i})(h)}function T(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=C?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function y(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w="react-grid-layout";let b=!1;try{b=/firefox/i.test(navigator.userAgent)}catch{}let R=class extends t.Component{constructor(){super(...arguments),y(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),y(this,"dragEnterCounter",0),y(this,"onDragStart",(i,s,d,C)=>{let{e:l,node:g}=C;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);if(!v)return;const D={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(v),oldLayout:f,activeDrag:D}),this.props.onDragStart(f,v,v,null,l,g)}),y(this,"onDrag",(i,s,d,C)=>{let{e:l,node:g}=C;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:D,allowOverlap:U,preventCollision:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;const O={w:V.w,h:V.h,x:V.x,y:V.y,placeholder:!0,i};v=(0,n.moveElement)(v,V,s,d,!0,z,(0,n.compactType)(this.props),D,U),this.props.onDrag(v,f,V,O,l,g),this.setState({layout:U?v:(0,n.compact)(v,(0,n.compactType)(this.props),D),activeDrag:O})}),y(this,"onDragStop",(i,s,d,C)=>{let{e:l,node:g}=C;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:D,preventCollision:U,allowOverlap:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;v=(0,n.moveElement)(v,V,s,d,!0,U,(0,n.compactType)(this.props),D,z);const x=z?v:(0,n.compact)(v,(0,n.compactType)(this.props),D);this.props.onDragStop(x,f,V,null,l,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:x,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(x,W)}),y(this,"onResizeStart",(i,s,d,C)=>{let{e:l,node:g}=C;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);v&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,v,v,null,l,g))}),y(this,"onResize",(i,s,d,C)=>{let{e:l,node:g,size:f,handle:v}=C;const{oldResizeItem:D}=this.state,{layout:U}=this.state,{cols:z,preventCollision:V,allowOverlap:O}=this.props;let x=!1,W,X,Y;const[ne,ee]=(0,n.withLayoutItem)(U,i,H=>{let re;return X=H.x,Y=H.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(X=H.x+(H.w-s),s=H.x!==X&&X<0?H.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(v)!==-1&&(Y=H.y+(H.h-d),d=H.y!==Y&&Y<0?H.h:d,Y=Y<0?0:Y),x=!0),V&&!O&&(re=(0,n.getAllCollisions)(U,{...H,w:s,h:d,x:X,y:Y}).filter(ue=>ue.i!==H.i).length>0,re&&(Y=H.y,d=H.h,X=H.x,s=H.w,x=!1)),H.w=s,H.h=d,H});if(!ee)return;W=ne,x&&(W=(0,n.moveElement)(ne,ee,X,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),z,O));const F={w:ee.w,h:ee.h,x:ee.x,y:ee.y,static:!0,i};this.props.onResize(W,D,ee,F,l,g),this.setState({layout:O?W:(0,n.compact)(W,(0,n.compactType)(this.props),z),activeDrag:F})}),y(this,"onResizeStop",(i,s,d,C)=>{let{e:l,node:g}=C;const{layout:f,oldResizeItem:v}=this.state,{cols:D,allowOverlap:U}=this.props,z=(0,n.getLayoutItem)(f,i),V=U?f:(0,n.compact)(f,(0,n.compactType)(this.props),D);this.props.onResizeStop(V,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:V,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(V,O)}),y(this,"onDragOver",i=>{var ne;if(i.preventDefault(),i.stopPropagation(),b&&!((ne=i.nativeEvent.target)!=null&&ne.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:d,margin:C,cols:l,rowHeight:g,maxRows:f,width:v,containerPadding:D,transformScale:U}=this.props,z=d==null?void 0:d(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const V={...s,...z},{layout:O}=this.state,x=i.currentTarget.getBoundingClientRect(),W=i.clientX-x.left,X=i.clientY-x.top,Y={left:W/U,top:X/U,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ee,top:F}=this.state.droppingPosition;(ee!=W||F!=X)&&this.setState({droppingPosition:Y})}}else{const ee={cols:l,margin:C,maxRows:f,rowHeight:g,containerWidth:v,containerPadding:D||C},F=(0,a.calcXY)(ee,X,W,V.w,V.h);this.setState({droppingDOMNode:t.createElement("div",{key:V.i}),droppingPosition:Y,layout:[...O,{...V,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),y(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:d}=this.state,C=(0,n.compact)(d.filter(l=>l.i!==i.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),y(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),y(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),y(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,C=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,C,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?d=i.layout:(0,n.childrenEqual)(i.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,i.children,i.cols,(0,n.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,n.fastRGLPropsEqual)(this.props,i,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const d=this.state.layout,C=s.layout;this.onLayoutMaybeChanged(d,C)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,e.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:d,margin:C,containerPadding:l,rowHeight:g,maxRows:f,useCSSTransforms:v,transformScale:D}=this.props;return t.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:C,containerPadding:l||C,maxRows:f,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:D},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(i.key));if(!d)return null;const{width:C,cols:l,margin:g,containerPadding:f,rowHeight:v,maxRows:D,isDraggable:U,isResizable:z,isBounded:V,useCSSTransforms:O,transformScale:x,draggableCancel:W,draggableHandle:X,resizeHandles:Y,resizeHandle:ne}=this.props,{mounted:ee,droppingPosition:F}=this.state,H=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&U,re=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&z,ie=d.resizeHandles||Y,ue=H&&V&&d.isBounded!==!1;return t.createElement(o.default,{containerWidth:C,cols:l,margin:g,containerPadding:f||g,maxRows:D,rowHeight:v,cancel:W,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:H,isResizable:re,isBounded:ue,useCSSTransforms:O&&ee,usePercentages:!ee,transformScale:x,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:ie,resizeHandle:ne},i)}render(){const{className:i,style:s,isDroppable:d,innerRef:C}=this.props,l=(0,r.default)(w,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:C,className:l,style:g,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},t.Children.map(this.props.children,f=>this.processGridItem(f)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ze.default=R,y(R,"displayName","ReactGridLayout"),y(R,"propTypes",u.default),y(R,"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:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Ze}var it={},De={},ir;function sr(){if(ir)return De;ir=1,Object.defineProperty(De,"__esModule",{value:!0}),De.findOrGenerateResponsiveLayout=n,De.getBreakpointFromWidth=e,De.getColsFromBreakpoint=r,De.sortBreakpoints=a;var t=ze();function e(o,u){const S=a(o);let p=S[0];for(let T=1,y=S.length;T<y;T++){const I=S[T];u>o[I]&&(p=I)}return p}function r(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function n(o,u,S,p,T,y){if(o[S])return(0,t.cloneLayout)(o[S]);let I=o[p];const _=a(u),w=_.slice(_.indexOf(S));for(let b=0,R=w.length;b<R;b++){const h=w[b];if(o[h]){I=o[h];break}}return I=(0,t.cloneLayout)(I||[]),(0,t.compact)((0,t.correctBounds)(I,{cols:T}),y,T)}function a(o){return Object.keys(o).sort(function(S,p){return o[S]-o[p]})}return De}var lr;function ra(){if(lr)return it;lr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var t=p(L),e=u(Ee()),r=nn(),n=ze(),a=sr(),o=u(or());function u(h){return h&&h.__esModule?h:{default:h}}function S(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(S=function(d){return d?s:i})(h)}function p(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=S(i);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=C?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function T(){return T=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},T.apply(this,arguments)}function y(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w=h=>Object.prototype.toString.call(h);function b(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let R=class extends t.Component{constructor(){super(...arguments),y(this,"state",this.generateInitialState()),y(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:d,cols:C}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,C),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(d,s,l,l,g,f),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,r.deepEqual)(i.layouts,s.layouts)){const{breakpoint:d,cols:C}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,d,d,C,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,r.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:d,layouts:C,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,d),D={...C};if(f!==g||i.breakpoints!==s||i.cols!==d){f in D||(D[f]=(0,n.cloneLayout)(this.state.layout));let V=(0,a.findOrGenerateResponsiveLayout)(D,s,g,f,v,l);V=(0,n.synchronizeLayoutWithChildren)(V,this.props.children,v,l,this.props.allowOverlap),D[g]=V,this.props.onLayoutChange(V,D),this.props.onBreakpointChange(g,v),this.setState({breakpoint:g,layout:V,cols:v})}const U=b(this.props.margin,g),z=b(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,U,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:d,layouts:C,margin:l,containerPadding:g,onBreakpointChange:f,onLayoutChange:v,onWidthChange:D,...U}=this.props;return t.createElement(o.default,T({},U,{margin:b(l,this.state.breakpoint),containerPadding:b(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return it.default=R,y(R,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,i){if(w(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+w(h[i]));Object.keys(h[i]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),y(R,"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:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),it}var Et={},ur=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(a,o){return a[0]===r?(n=o,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),a=this.__entries__[n];return a&&a[1]},e.prototype.set=function(r,n){var a=t(this.__entries__,r);~a?this.__entries__[a][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,a=t(n,r);~a&&n.splice(a,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];r.call(n,u[1],u[0])}},e}()}(),pn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=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")()}(),aa=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),oa=2;function ia(t,e){var r=!1,n=!1,a=0;function o(){r&&(r=!1,t()),n&&S()}function u(){aa(o)}function S(){var p=Date.now();if(r){if(p-a<oa)return;n=!0}else r=!0,n=!1,setTimeout(u,e);a=p}return S}var sa=20,la=["top","right","bottom","left","width","height","size","weight"],ua=typeof MutationObserver<"u",ca=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ia(this.refresh.bind(this),sa)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!pn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ua?(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)},t.prototype.disconnect_=function(){!pn||!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)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,a=la.some(function(o){return!!~n.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),cr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var a=n[r];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},Ae=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Ot},dr=Mt(0,0,0,0);function Pt(t){return parseFloat(t)||0}function fr(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,a){var o=t["border-"+a+"-width"];return n+Pt(o)},0)}function da(t){for(var e=["top","right","bottom","left"],r={},n=0,a=e;n<a.length;n++){var o=a[n],u=t["padding-"+o];r[o]=Pt(u)}return r}function fa(t){var e=t.getBBox();return Mt(0,0,e.width,e.height)}function pa(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return dr;var n=Ae(t).getComputedStyle(t),a=da(n),o=a.left+a.right,u=a.top+a.bottom,S=Pt(n.width),p=Pt(n.height);if(n.boxSizing==="border-box"&&(Math.round(S+o)!==e&&(S-=fr(n,"left","right")+o),Math.round(p+u)!==r&&(p-=fr(n,"top","bottom")+u)),!ga(t)){var T=Math.round(S+o)-e,y=Math.round(p+u)-r;Math.abs(T)!==1&&(S-=T),Math.abs(y)!==1&&(p-=y)}return Mt(a.left,a.top,S,p)}var ha=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof Ae(t).SVGGraphicsElement}:function(t){return t instanceof Ae(t).SVGElement&&typeof t.getBBox=="function"}}();function ga(t){return t===Ae(t).document.documentElement}function ma(t){return pn?ha(t)?fa(t):pa(t):dr}function va(t){var e=t.x,r=t.y,n=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return cr(u,{x:e,y:r,width:n,height:a,top:r,right:e+n,bottom:a+r,left:e}),u}function Mt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var ya=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Mt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ma(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Sa=function(){function t(e,r){var n=va(r);cr(this,{target:e,contentRect:n})}return t}(),ba=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new ur,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ae(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new ya(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof Ae(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new Sa(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),pr=typeof WeakMap<"u"?new WeakMap:new ur,hr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=ca.getInstance(),n=new ba(e,r,this);pr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){hr.prototype[t]=function(){var e;return(e=pr.get(this))[t].apply(e,arguments)}});var Ca=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:hr}();const Ta=En(Object.freeze(Object.defineProperty({__proto__:null,default:Ca},Symbol.toStringTag,{value:"Module"})));var gr;function Ia(){if(gr)return Et;gr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=_;var t=u(L),e=a(Ee()),r=a(Ta),n=a(rn());function a(w){return w&&w.__esModule?w:{default:w}}function o(w){if(typeof WeakMap!="function")return null;var b=new WeakMap,R=new WeakMap;return(o=function(h){return h?R:b})(w)}function u(w,b){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=o(b);if(R&&R.has(w))return R.get(w);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in w)if(s!=="default"&&Object.prototype.hasOwnProperty.call(w,s)){var d=i?Object.getOwnPropertyDescriptor(w,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=w[s]}return h.default=w,R&&R.set(w,h),h}function S(){return S=Object.assign?Object.assign.bind():function(w){for(var b=1;b<arguments.length;b++){var R=arguments[b];for(var h in R)Object.prototype.hasOwnProperty.call(R,h)&&(w[h]=R[h])}return w},S.apply(this,arguments)}function p(w,b,R){return b=T(b),b in w?Object.defineProperty(w,b,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[b]=R,w}function T(w){var b=y(w,"string");return typeof b=="symbol"?b:String(b)}function y(w,b){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,b||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(w)}const I="react-grid-layout";function _(w){var b;return b=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(i=>{if(this.elementRef.current instanceof HTMLElement){const d=i[0].contentRect.width;this.setState({width:d})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...i}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,I),style:this.props.style,ref:this.elementRef}):t.createElement(w,S({innerRef:this.elementRef},i,this.state))}},p(b,"defaultProps",{measureBeforeMount:!1}),p(b,"propTypes",{measureBeforeMount:e.default.bool}),b}return Et}var mr;function wa(){return mr||(mr=1,function(t){t.exports=or().default,t.exports.utils=ze(),t.exports.calculateUtils=on(),t.exports.Responsive=ra().default,t.exports.Responsive.utils=sr(),t.exports.WidthProvider=Ia().default}(tn)),tn.exports}var Ra=wa();const _a=Fr(Ra);var Ea=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Pa=(t,e,r,n)=>{for(var a=n>1?void 0:n?Oa(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Ea(e,r,a),a},Ma=(t,e)=>(r,n)=>e(r,n,t);let je=class extends m.Disposable{constructor(e){super();Me(this,"_initLocal",()=>{});Me(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let a=r.exec(e);for(;a;)n.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),a=e.split("."),o=n&&this._localeService.resolveKeyPath(n,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((S,p,T)=>{const y=T[p-1]||{startIndex:0,endIndex:-1};if(y.endIndex+1<S.startIndex){const I=o.slice(y.endIndex+1,S.startIndex);I&&u.push(I)}if(r[S.key]&&u.push(r[S.key]),p===T.length-1){const I=o.slice(S.endIndex+1);I&&u.push(I)}}),u}return[]}};je=Pa([Ma(0,m.Inject(m.LocaleService))],je);const Dt={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const r=L.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((T,y)=>({color:new m.ColorKit(T.color),value:y})),S=u.length-1;return new Array(5).fill("").map((T,y,I)=>y*S/(I.length-1)).map(T=>c.getColorScaleFromValue(u,T))}return null},[e]),n=L.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const S=c.iconMap[u.iconType];return S&&S[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,S={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,T=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return E.jsxs("div",{className:Dt.cfPreview,children:[E.jsx("div",{style:{...S,background:T,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),E.jsx("div",{style:{...S,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&E.jsx("div",{className:Dt.cfPreview,children:r.map((u,S)=>E.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},S))});case c.CFRuleType.iconSet:return n&&E.jsx("div",{className:Dt.cfPreview,children:n.map((u,S)=>u?E.jsx("img",{style:{height:"100%"},src:u},S):E.jsx($e,{},S))});case c.CFRuleType.highlightCell:{const{ul:u,st:S,it:p,bl:T,bg:y,cl:I}=e.style,_=(u==null?void 0:u.s)===m.BooleanNumber.TRUE,w=(S==null?void 0:S.s)===m.BooleanNumber.TRUE,b=p===m.BooleanNumber.TRUE,R=T===m.BooleanNumber.TRUE,h=(a=y==null?void 0:y.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=I==null?void 0:I.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:R?"bold":void 0,fontStyle:b?"italic":void 0,textDecoration:`${_?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return E.jsx("div",{style:s,className:Dt.cfPreview,children:"123"})}}return null},pe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},Da=(t,e)=>{const r=t.rule;switch(r.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(a=>String(a)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let vr=0;const xa=t=>{const{onClick:e}=t,r=m.useDependency(c.ConditionalFormattingRuleModel),n=m.useDependency(m.IUniverInstanceService),a=m.useDependency(q.SheetsSelectionsService),o=m.useDependency(m.ICommandService),u=m.useDependency(m.LocaleService),S=m.useDependency(m.Injector),p=m.useDependency(je),T=me.useObservable(()=>n.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),y=T.getUnitId(),I=T.getActiveSheet();if(!I)throw new Error("No active sheet found");const _=I.getSheetId(),[w,b]=L.useState([]),[R,h]=L.useState("2"),[i,s]=L.useState(0),[d,C]=L.useState(-1),[l,g]=L.useState(vr),f=L.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],D=()=>{const F=r.getSubunitRules(y,_);if(!F||!F.length)return[];if(R==="1"){const H=a.getCurrentLastSelection();if(!H)return[];const re=H.range;return F.filter(ue=>ue.ranges.some(he=>m.Rectangle.intersects(he,re)))}else if(R==="2")return[...F];return[]},[U,z]=L.useState(D);de.useHighlightRange(w),L.useEffect(()=>{const F=o.onCommandExecuted(H=>{H.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),L.useEffect(()=>{z(D)},[R,i,y,_]),L.useEffect(()=>{if(R==="2")return;const F=new Ce.Observable(H=>{const re=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=o.onCommandExecuted(ue=>{const{id:he,params:ye}=ue,Te=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();re.includes(he)&&ye.unitId===Te&&H.next(null)});return()=>ie.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(D)});return()=>{F.unsubscribe()}},[n,R,y,_]),L.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),L.useEffect(()=>{const F=()=>{var ue;const ie=Math.max(0,(((ue=f.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return vr=ie,ie},re=new Ce.Observable(ie=>{const ue=document.querySelector(".univer-sidebar");if(ue){let he=setTimeout(()=>{ie.next()},150);const ye=()=>{he&&clearTimeout(he),he=null},Te=k=>{k.propertyName==="width"&&(ye(),ie.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(F())});return()=>{re.unsubscribe()}},[]);const V=F=>{var ie;const H=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),re=(ie=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!H||!re)throw new Error("No active sheet found");o.executeCommand(Ke.id,{unitId:H,subUnitId:re,cfId:F.cfId})},O=(F,H)=>{C(H.y)},x=(F,H,re)=>{var k;C(-1);const ie=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(k=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:k.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const he=Q=>{const se=U.length;return Math.min(se-1,Math.max(0,Q))},ye=U[he(H.y)].cfId,Te=U[he(re.y)].cfId;ye!==Te&&o.executeCommand(St.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:re.y>H.y?"after":"before"}})},W=()=>{t.onCreate()},X=()=>{R==="2"?o.executeCommand(Ye.id):R==="1"&&U.map(H=>({unitId:y,subUnitId:_,cfId:H.cfId})).forEach(H=>{o.executeCommand(Ke.id,H)})},Y=L.useMemo(()=>{const F=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.filter(re=>{const ie=re.ranges;return q.checkRangesEditablePermission(S,F.getUnitId(),H.getSheetId(),ie)})},[U]),ne=Y.map((F,H)=>({i:F.cfId,x:0,w:12,y:H,h:1,isResizable:!1})),ee=L.useMemo(()=>{const F=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.every(re=>{const ie=re.ranges;return q.checkRangesEditablePermission(S,F.getUnitId(),H.getSheetId(),ie)})},[U]);return E.jsxs("div",{className:pe.cfRuleList,children:[E.jsxs("div",{className:pe.ruleSelector,children:[E.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",E.jsx(ae.Select,{className:pe.select,options:v,value:R,onChange:F=>{h(F)}})).map((F,H)=>E.jsx("span",{children:F},H))}),E.jsxs("div",{className:pe.btnList,children:[E.jsx(ae.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:E.jsx("div",{className:`
|
|
21
13
|
${pe.icon}
|
|
22
|
-
`,onClick:W,children:
|
|
14
|
+
`,onClick:W,children:E.jsx(Rn,{})})}),U.length&&ee?E.jsx(ae.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:E.jsx("div",{className:`
|
|
23
15
|
${pe.gap}
|
|
24
16
|
${pe.icon}
|
|
25
|
-
`,onClick:X,children:
|
|
17
|
+
`,onClick:X,children:E.jsx(Ct,{})})}):E.jsx("div",{className:`
|
|
26
18
|
${pe.gap}
|
|
27
19
|
${pe.disabled}
|
|
28
|
-
`,children:
|
|
20
|
+
`,children:E.jsx(Ct,{})})]})]}),E.jsx("div",{ref:f,className:pe.gridLayoutWrap,children:l?E.jsx(_a,{onDragStop:x,onDragStart:O,layout:ne,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:Y==null?void 0:Y.map((F,H)=>E.jsx("div",{children:E.jsxs("div",{onMouseMove:()=>{F.ranges!==w&&b(F.ranges)},onMouseLeave:()=>b([]),onClick:()=>{e(F)},className:`
|
|
29
21
|
${pe.ruleItem}
|
|
30
22
|
${d===H?pe.active:""}
|
|
31
|
-
`,children:[
|
|
23
|
+
`,children:[E.jsx("div",{className:`
|
|
32
24
|
${pe.draggableHandle}
|
|
33
|
-
|
|
34
25
|
draggableHandle
|
|
35
|
-
`,onClick:re=>re.stopPropagation(),children:
|
|
26
|
+
`,onClick:re=>re.stopPropagation(),children:E.jsx(_n,{})}),E.jsxs("div",{className:pe.ruleDescribe,children:[E.jsx("div",{className:pe.ruleType,children:Da(F,u)}),E.jsx("div",{className:pe.ruleRange,children:F.ranges.map(re=>Gt.serializeRange(re)).join(",")})]}),E.jsx("div",{className:pe.preview,children:E.jsx(We,{rule:F.rule})}),E.jsx("div",{className:`
|
|
36
27
|
${pe.deleteItem}
|
|
37
28
|
${d===H?pe.active:""}
|
|
38
|
-
`,onClick:re=>{re.stopPropagation(),
|
|
39
|
-
${
|
|
40
|
-
`,children:
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
`,children:[
|
|
29
|
+
`,onClick:re=>{re.stopPropagation(),V(F),b([])},children:E.jsx(Ct,{})})]})},`${F.cfId}`))}):null})]})},hn={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},xe=t=>{const{color:e,onChange:r,disable:n=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:u=!0}=t,S=m.useDependency(me.ComponentManager),p=L.useMemo(()=>new m.ColorKit(e),[e]),T=S.get(a);return T&&(n?E.jsx(T,{className:o,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):E.jsx(ae.DropdownLegacy,{overlay:E.jsx("div",{className:`
|
|
30
|
+
${hn.cfColorPicker}
|
|
31
|
+
`,children:E.jsx(ae.ColorPicker,{value:e,onChange:r})}),children:E.jsxs("span",{className:`
|
|
32
|
+
${hn.cfColorPickerIcon}
|
|
33
|
+
${o}
|
|
34
|
+
`,children:[E.jsx(T,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&E.jsx(Tt,{className:hn.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),gn=t=>{var b;const{type:e,className:r,onChange:n,id:a,value:o}=t,u=m.useDependency(m.IUniverInstanceService),S=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(b=u.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId(),T=L.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),y=L.useMemo(()=>[c.CFValueType.max,c.CFValueType.min,"none"].includes(e)?{disabled:!0}:[c.CFValueType.percent,c.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),I=L.useRef({}),[_,w]=L.useState(!1);return me.useSidebarClick(R=>{var i;const h=(i=I.current)==null?void 0:i.handleOutClick;h&&h(R,()=>w(!1))}),e===c.CFValueType.formula?E.jsx("div",{style:{width:"100%",marginLeft:4},children:E.jsx(Ge.FormulaEditor,{initValue:T,unitId:S,subUnitId:p,isFocus:_,onChange:(R="")=>{n(R||"")},onFocus:()=>w(!0),actions:I.current})}):E.jsx(ae.InputNumber,{className:r,value:Number(t.value)||0,onChange:R=>t.onChange(R||0),...y})},Na=t=>{var V;const{interceptorManager:e}=t,r=m.useDependency(m.LocaleService),n=((V=t.rule)==null?void 0:V.type)===c.CFRuleType.colorScale?t.rule:void 0,a=[Ne(c.CFValueType.num,r),Ne(c.CFValueType.percent,r),Ne(c.CFValueType.percentile,r),Ne(c.CFValueType.formula,r)],o=[Ne(c.CFValueType.min,r),...a],u=[Ne("none",r),...a],S=[Ne(c.CFValueType.max,r),...a],[p,T]=L.useState(()=>{var x;const O=c.CFValueType.min;return n&&((x=n.config[0])==null?void 0:x.value.type)||O}),[y,I]=L.useState(()=>{var x;const O="none";return!n||n.config.length!==3?O:((x=n.config[1])==null?void 0:x.value.type)||O}),[_,w]=L.useState(()=>{var x;const O=c.CFValueType.max;return n&&((x=n.config[n.config.length-1])==null?void 0:x.value.type)||O}),[b,R]=L.useState(()=>{if(!n)return 10;const x=n.config[0];return(x==null?void 0:x.value.value)===void 0?10:x==null?void 0:x.value.value}),[h,i]=L.useState(()=>{var W;if(!n||n.config.length!==3)return 50;const x=(W=n.config[1])==null?void 0:W.value.value;return x===void 0?50:x}),[s,d]=L.useState(()=>{var W;if(!n)return 90;const x=(W=n.config[n.config.length-1])==null?void 0:W.value.value;return x===void 0?90:x}),[C,l]=L.useState(()=>{var x;const O="#d0d9fb";return n&&((x=n.config[0])==null?void 0:x.color)||O}),[g,f]=L.useState(()=>{var x;const O="#7790f3";return!n||n.config.length!==3?O:((x=n.config[1])==null?void 0:x.color)||O}),[v,D]=L.useState(()=>{var x;const O="#2e55ef";return n&&((x=n.config[n.config.length-1])==null?void 0:x.color)||O}),U=L.useMemo(()=>O=>{const{minType:x,medianType:W,maxType:X,minValue:Y,medianValue:ne,maxValue:ee,minColor:F,medianColor:H,maxColor:re}=O,ie=[];return ie.push({color:F,value:{type:x,value:Y}}),W!=="none"&&ie.push({color:H,value:{type:W,value:ne}}),ie.push({color:re,value:{type:X,value:ee}}),{config:ie.map((he,ye)=>({...he,index:ye})),type:c.CFRuleType.colorScale}},[]);L.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return U({minType:p,medianType:y,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:v})}}),[U,p,y,_,b,h,s,C,g,v,e]);const z=O=>{t.onChange(U(O))};return E.jsxs("div",{children:[E.jsx("div",{className:j.title,children:r.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
|
|
44
35
|
${G.cfPreviewWrap}
|
|
45
|
-
`,children:
|
|
46
|
-
${
|
|
47
|
-
${
|
|
48
|
-
`,children:[
|
|
49
|
-
${
|
|
50
|
-
`,value:
|
|
51
|
-
${
|
|
52
|
-
${
|
|
53
|
-
`,children:[
|
|
54
|
-
${
|
|
55
|
-
`,value:h,type:
|
|
56
|
-
${
|
|
57
|
-
${
|
|
58
|
-
`,children:[
|
|
59
|
-
${
|
|
60
|
-
`,value:s,type:_,onChange:
|
|
36
|
+
`,children:E.jsx(We,{rule:U({minType:p,medianType:y,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:v})})}),E.jsx("div",{className:j.label,children:r.t("sheet.cf.valueType.min")}),E.jsxs("div",{className:`
|
|
37
|
+
${j.labelContainer}
|
|
38
|
+
${j.mTSm}
|
|
39
|
+
`,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{T(O);const x=c.createDefaultValueByValueType(O,10);R(x),z({minType:O,medianType:y,maxType:_,minValue:x,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"min",className:`
|
|
40
|
+
${j.mLXxs}
|
|
41
|
+
`,value:b,type:p,onChange:O=>{R(O),z({minType:p,medianType:y,maxType:_,minValue:O,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:v})}}),E.jsx(xe,{className:j.mLXxs,color:C,onChange:O=>{l(O),z({minType:p,medianType:y,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),E.jsx("div",{className:j.label,children:r.t("sheet.cf.panel.medianValue")}),E.jsxs("div",{className:`
|
|
42
|
+
${j.labelContainer}
|
|
43
|
+
${j.mTSm}
|
|
44
|
+
`,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:u,value:y,onChange:O=>{I(O);const x=c.createDefaultValueByValueType(O,50);i(x),z({minType:p,medianType:O,maxType:_,minValue:b,medianValue:x,maxValue:s,minColor:C,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"median",className:`
|
|
45
|
+
${j.mLXxs}
|
|
46
|
+
`,value:h,type:y,onChange:O=>{i(O),z({minType:p,medianType:y,maxType:_,minValue:b,medianValue:O,maxValue:s,minColor:C,medianColor:g,maxColor:v})}}),y!=="none"&&E.jsx(xe,{className:j.mLXxs,color:g,onChange:O=>{f(O),z({minType:p,medianType:y,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:O,maxColor:v})}})]}),E.jsx("div",{className:j.label,children:r.t("sheet.cf.valueType.max")}),E.jsxs("div",{className:`
|
|
47
|
+
${j.labelContainer}
|
|
48
|
+
${j.mTSm}
|
|
49
|
+
`,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:S,value:_,onChange:O=>{w(O);const x=c.createDefaultValueByValueType(O,90);d(x),z({minType:p,medianType:y,maxType:O,minValue:b,medianValue:h,maxValue:x,minColor:C,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"max",className:`
|
|
50
|
+
${j.mLXxs}
|
|
51
|
+
`,value:s,type:_,onChange:O=>{d(O),z({minType:p,medianType:y,maxType:_,minValue:b,medianValue:h,maxValue:O,minColor:C,medianColor:g,maxColor:v})}}),E.jsx(xe,{className:j.mLXxs,color:v,onChange:O=>{D(O),z({minType:p,medianType:y,maxType:_,minValue:b,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:O})}})]})]})},He=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),yr=t=>{var R;const{onChange:e,className:r,value:n,type:a,id:o,disabled:u=!1}=t,S=m.useDependency(m.IUniverInstanceService),p=S.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),T=(R=S.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:R.getSheetId(),y=L.useRef({}),[I,_]=L.useState(!1);me.useSidebarClick(h=>{var s;const i=(s=y.current)==null?void 0:s.handleOutClick;i&&i(h,()=>_(!1))});const w=L.useRef(n),b=L.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===c.CFValueType.formula){const h=String(w.current).startsWith("=")?String(w.current)||"":"=";return E.jsx("div",{style:{width:"100%",marginLeft:12},children:E.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:T,isFocus:I,onChange:(i="")=>{e(i||"")},onFocus:()=>_(!0),actions:y.current})})}return E.jsx(ae.InputNumber,{className:r,value:Number(n)||0,disabled:u,onChange:h=>{e(h||0)},...b})},La=t=>{var V;const{interceptorManager:e}=t,r=m.useDependency(m.LocaleService),n=((V=t.rule)==null?void 0:V.type)===c.CFRuleType.dataBar?t.rule:void 0,[a,o]=L.useState(()=>{var x;const O="0";return n?(x=n.config)!=null&&x.isGradient?"1":"0":O}),[u,S]=L.useState(()=>{var O;return n&&((O=n.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,T]=L.useState(()=>{var O;return n&&((O=n.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),y=[He(c.CFValueType.num,r),He(c.CFValueType.percent,r),He(c.CFValueType.percentile,r),He(c.CFValueType.formula,r)],I=[He(c.CFValueType.min,r),...y],_=[He(c.CFValueType.max,r),...y],[w,b]=L.useState(()=>{var x;const O=I[0].value;return n&&((x=n.config)==null?void 0:x.min.type)||O}),[R,h]=L.useState(()=>{var x;const O=_[0].value;return n&&((x=n.config)==null?void 0:x.max.type)||O}),[i,s]=L.useState(()=>{var W;if(!n)return 0;const x=((W=n.config)==null?void 0:W.min)||{};return x.type===c.CFValueType.formula?x.value||"=":x.value||0}),[d,C]=L.useState(()=>{var W;if(!n)return 100;const x=((W=n.config)==null?void 0:W.max)||{};return x.type===c.CFValueType.formula?x.value||"=":x.value===void 0?100:x.value}),[l,g]=L.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),f=O=>({config:{min:{type:O.minValueType,value:O.minValue},max:{type:O.maxValueType,value:O.maxValue},isGradient:O.isGradient==="1",positiveColor:O.positiveColor||c.defaultDataBarPositiveColor,nativeColor:O.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:O.isShowValue});L.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return f({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,w,d,R,u,p,e,l]);const v=O=>{t.onChange(f(O))},D=O=>{S(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:O,nativeColor:p,isShowValue:l})},U=O=>{T(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:O,isShowValue:l})},z=O=>y.map(x=>x.value).includes(O);return E.jsxs("div",{children:[E.jsx("div",{className:j.title,children:r.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
|
|
61
52
|
${G.cfPreviewWrap}
|
|
62
|
-
`,children:
|
|
63
|
-
${
|
|
64
|
-
${
|
|
65
|
-
${
|
|
66
|
-
`,children:[
|
|
53
|
+
`,children:E.jsx(We,{rule:f({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})})}),E.jsxs("div",{children:[E.jsx("div",{className:j.label,children:r.t("sheet.cf.panel.fillType")}),E.jsxs("div",{className:`
|
|
54
|
+
${j.mTSm}
|
|
55
|
+
${j.mLXxs}
|
|
56
|
+
${j.labelContainer}
|
|
57
|
+
`,children:[E.jsxs(ae.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})},children:[E.jsx(ae.Radio,{value:"0",children:E.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.pureColor")})}),E.jsx(ae.Radio,{value:"1",children:E.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.gradient")})})]}),E.jsxs("div",{className:`
|
|
67
58
|
${G.utilItem}
|
|
68
|
-
${
|
|
69
|
-
`,children:[
|
|
70
|
-
${
|
|
71
|
-
${
|
|
72
|
-
${
|
|
73
|
-
`,children:[
|
|
74
|
-
${
|
|
75
|
-
`,children:[
|
|
59
|
+
${j.mLXl}
|
|
60
|
+
`,children:[E.jsx(ae.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:!O})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),E.jsxs("div",{children:[E.jsx("div",{className:j.label,children:r.t("sheet.cf.panel.colorSet")}),E.jsxs("div",{className:`
|
|
61
|
+
${j.labelContainer}
|
|
62
|
+
${j.mTSm}
|
|
63
|
+
${j.mLXxs}
|
|
64
|
+
`,children:[E.jsxs("div",{className:`
|
|
65
|
+
${j.labelContainer}
|
|
66
|
+
`,children:[E.jsx("div",{className:`
|
|
76
67
|
${G.text}
|
|
77
|
-
`,children:r.t("sheet.cf.panel.native")}),
|
|
78
|
-
${
|
|
79
|
-
${
|
|
80
|
-
`,children:[
|
|
68
|
+
`,children:r.t("sheet.cf.panel.native")}),E.jsx(xe,{color:p,onChange:U})]}),E.jsxs("div",{className:`
|
|
69
|
+
${j.labelContainer}
|
|
70
|
+
${j.mLSm}
|
|
71
|
+
`,children:[E.jsx("div",{className:`
|
|
81
72
|
${G.text}
|
|
82
|
-
`,children:r.t("sheet.cf.panel.positive")}),
|
|
83
|
-
${
|
|
84
|
-
${
|
|
85
|
-
`,children:[
|
|
86
|
-
${
|
|
87
|
-
${
|
|
88
|
-
`,children:[
|
|
73
|
+
`,children:r.t("sheet.cf.panel.positive")}),E.jsx(xe,{color:u,onChange:D})]})]})]}),E.jsxs("div",{children:[E.jsx("div",{className:j.label,children:r.t("sheet.cf.valueType.min")}),E.jsxs("div",{className:`
|
|
74
|
+
${j.mTSm}
|
|
75
|
+
${j.labelContainer}
|
|
76
|
+
`,children:[E.jsx(ae.Select,{style:{width:"50%",flexShrink:0},options:I,value:w,onChange:O=>{b(O);const x=c.createDefaultValueByValueType(O,10);s(x),v({isGradient:a,minValue:x,minValueType:O,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}}),E.jsx(yr,{disabled:!z(w),id:"min",type:w,className:j.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),E.jsx("div",{className:j.label,children:r.t("sheet.cf.valueType.max")}),E.jsxs("div",{className:`
|
|
77
|
+
${j.mTSm}
|
|
78
|
+
${j.labelContainer}
|
|
79
|
+
`,children:[E.jsx(ae.Select,{style:{width:"50%",flexShrink:0},options:_,value:R,onChange:O=>{h(O);const x=c.createDefaultValueByValueType(O,90);C(x),v({isGradient:a,minValue:i,minValueType:w,maxValue:x,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),E.jsx(yr,{disabled:!z(R),id:"max",type:R,className:j.mLSm,value:d,onChange:O=>{C(O||0),v({isGradient:a,minValue:i,minValueType:w,maxValue:O||0,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})};function Sr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=Sr(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function xt(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Sr(t))&&(n&&(n+=" "),n+=e);return n}const _e={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Nt=t=>[m.BooleanNumber.FALSE,void 0].includes(t)?m.BooleanNumber.TRUE:m.BooleanNumber.FALSE,Lt=t=>t!==m.BooleanNumber.FALSE,mn=t=>{const{style:e,onChange:r,className:n}=t,a=m.useDependency(me.ComponentManager),[o,u]=L.useState(()=>{if(e!=null&&e.bl)return e.bl}),[S,p]=L.useState(()=>{if(e!=null&&e.it)return e.it}),[T,y]=L.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[I,_]=L.useState(()=>{if(e!=null&&e.st)return e.st.s}),[w,b]=L.useState(()=>{var g;const l="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:l}),[R,h]=L.useState(()=>{var g;const l="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:l}),i=a.get("BoldSingle"),s=a.get("ItalicSingle"),d=a.get("UnderlineSingle"),C=a.get("StrikethroughSingle");return L.useEffect(()=>{const l={bl:o,it:S};w!==void 0&&(l.cl={rgb:w}),R!==void 0&&(l.bg={rgb:R}),I!==void 0&&(l.st={s:I}),T!==void 0&&(l.ul={s:T}),r(c.removeUndefinedAttr(l))},[o,S,T,I,w,R]),E.jsxs("div",{className:`
|
|
89
80
|
${_e.cfStyleEdit}
|
|
90
81
|
${n}
|
|
91
|
-
`,children:[
|
|
92
|
-
${
|
|
93
|
-
${
|
|
94
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),
|
|
95
|
-
${
|
|
96
|
-
`,children:
|
|
82
|
+
`,children:[i&&E.jsx("div",{className:xt({[_e.isActive]:Lt(o||m.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>u(Nt(o)),children:E.jsx(i,{})}),s&&E.jsx("div",{className:xt({[_e.isActive]:Lt(S||m.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>p(Nt(S)),children:E.jsx(s,{})}),d&&E.jsx("div",{className:xt({[_e.isActive]:Lt(T||m.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>y(Nt(T)),children:E.jsx(d,{})}),C&&E.jsx("div",{className:xt({[_e.isActive]:Lt(I||m.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>_(Nt(I)),children:E.jsx(C,{})}),E.jsx(xe,{color:w,onChange:b,iconId:"FontColor"}),E.jsx(xe,{color:R,onChange:h,iconId:"PaintBucket"})]})},Ua=t=>{var C;const{onChange:e,interceptorManager:r}=t,n=m.useDependency(m.LocaleService),o=m.useDependency(m.IUniverInstanceService).getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),S=((C=t.rule)==null?void 0:C.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=L.useRef(null),[T,y]=L.useState(!1),I=L.useRef({}),[_,w]=L.useState({}),[b,R]=L.useState(()=>(S==null?void 0:S.subType)===c.CFSubRuleType.formula?S.value:"="),[h,i]=L.useState(void 0),s=l=>({style:l.style,value:b,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});L.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:_,formula:b})}}),[_,b,r]),L.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,f,v)=>h||b.length===1||!b.startsWith("=")?(i(n.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,b]);const d=l=>{e(s(l))};return me.useSidebarClick(l=>{var f;const g=(f=I.current)==null?void 0:f.handleOutClick;g&&g(l,()=>y(!1))}),E.jsxs("div",{ref:p,children:[E.jsx("div",{className:`
|
|
83
|
+
${j.title}
|
|
84
|
+
${j.mTBase}
|
|
85
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
|
|
86
|
+
${j.mTSm}
|
|
87
|
+
`,children:E.jsx(Ge.FormulaEditor,{onChange:l=>{R(l),d({style:_,formula:l})},onVerify:(l,g)=>{!l||g.length===1?i(n.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{y(!0)},actions:I.current,isFocus:T,initValue:b,unitId:o.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),E.jsx("div",{className:`
|
|
97
88
|
${G.cfPreviewWrap}
|
|
98
|
-
`,children:
|
|
99
|
-
${
|
|
100
|
-
`,onChange:
|
|
101
|
-
${
|
|
102
|
-
`,children:
|
|
103
|
-
${
|
|
104
|
-
`,children:
|
|
105
|
-
${
|
|
106
|
-
${
|
|
107
|
-
`,children:[
|
|
108
|
-
${
|
|
109
|
-
`,value:d,onChange:
|
|
110
|
-
${
|
|
111
|
-
${
|
|
112
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),
|
|
113
|
-
${
|
|
89
|
+
`,children:E.jsx(We,{rule:s({style:_,formula:b})})}),E.jsx(mn,{style:S==null?void 0:S.style,className:`
|
|
90
|
+
${j.mTSm}
|
|
91
|
+
`,onChange:l=>{w(l),d({style:l,formula:b})}})]})},Ut=t=>E.jsxs("div",{style:{position:"relative"},children:[E.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),le=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),Va=t=>{const{type:e,operator:r,onChange:n,value:a,interceptorManager:o}=t,u=m.useDependency(m.LocaleService),[S,p]=L.useState(()=>typeof a=="number"?a:0),[T,y]=L.useState(""),[I,_]=L.useState(()=>typeof a=="string"?a:""),[w,b]=L.useState(""),[R,h]=L.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=L.useState(""),[d,C]=L.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=L.useState("");switch(L.useEffect(()=>{switch(e){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)&&n(I);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)&&n(S),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)&&n([R,d]);break}}},[e]),L.useEffect(()=>{const f=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,D,U)=>{switch(e){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(r))return I?U(v):(b(u.t("sheet.cf.errorMessage.notBlank")),!1)}return U(v)}});return()=>{f()}},[e,S,I,r]),e){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)){const f=v=>{_(v),n(v)};return E.jsx("div",{className:`
|
|
92
|
+
${j.mTSm}
|
|
93
|
+
`,children:E.jsx(Ut,{errorText:w,children:E.jsx(ae.Input,{className:G.width100,value:I,onChange:v=>{b(""),f(v)}})})})}break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)){const f=v=>{p(v||0),n(v||0),y("")};return E.jsx("div",{className:`
|
|
94
|
+
${j.mTSm}
|
|
95
|
+
`,children:E.jsx(Ut,{errorText:T,children:E.jsx(ae.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:S,onChange:f})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)){const f=D=>{h(D||0),n([D||0,d]),s("")},v=D=>{C(D||0),n([R,D||0]),g("")};return E.jsxs("div",{className:`
|
|
96
|
+
${j.mTSm}
|
|
97
|
+
${j.labelContainer}
|
|
98
|
+
`,children:[E.jsx(Ut,{errorText:i,children:E.jsx(ae.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:R,onChange:f})}),E.jsx(Ut,{errorText:l,children:E.jsx(ae.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
99
|
+
${j.mLSm}
|
|
100
|
+
`,value:d,onChange:v})})]})}}}return null},br=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[le(c.CFTextOperator.containsText,e),le(c.CFTextOperator.notContainsText,e),le(c.CFTextOperator.beginsWith,e),le(c.CFTextOperator.endsWith,e),le(c.CFTextOperator.equal,e),le(c.CFTextOperator.notEqual,e),le(c.CFTextOperator.containsBlanks,e),le(c.CFTextOperator.notContainsBlanks,e),le(c.CFTextOperator.containsErrors,e),le(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[le(c.CFNumberOperator.between,e),le(c.CFNumberOperator.notBetween,e),le(c.CFNumberOperator.equal,e),le(c.CFNumberOperator.notEqual,e),le(c.CFNumberOperator.greaterThan,e),le(c.CFNumberOperator.greaterThanOrEqual,e),le(c.CFNumberOperator.lessThan,e),le(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[le(c.CFTimePeriodOperator.yesterday,e),le(c.CFTimePeriodOperator.today,e),le(c.CFTimePeriodOperator.tomorrow,e),le(c.CFTimePeriodOperator.last7Days,e),le(c.CFTimePeriodOperator.lastWeek,e),le(c.CFTimePeriodOperator.thisWeek,e),le(c.CFTimePeriodOperator.nextWeek,e),le(c.CFTimePeriodOperator.lastMonth,e),le(c.CFTimePeriodOperator.thisMonth,e),le(c.CFTimePeriodOperator.nextMonth,e)]}},Cr=t=>{var C;const{interceptorManager:e,onChange:r}=t,n=m.useDependency(m.LocaleService),a=((C=t.rule)==null?void 0:C.type)===c.CFRuleType.highlightCell?t.rule:void 0,[o,u]=L.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),S=[{value:c.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=L.useMemo(()=>br(o,n),[o]),[T,y]=L.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[I,_]=L.useState(()=>{var f;const l="";return a?(f=a.value)!=null?f:c.createDefaultValue(a.subType,a.operator):l}),[w,b]=L.useState({}),R=L.useMemo(()=>l=>{var g,f,v,D,U,z,V,O,x,W,X,Y,ne,ee,F;switch(l.subType||o){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(T))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(f=l.operator)!=null?f:T,style:(v=l.style)!=null?v:w,value:(D=l.value)!=null?D:I};break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(T))return{type:c.CFRuleType.highlightCell,subType:(U=l.subType)!=null?U:o,operator:(z=l.operator)!=null?z:T,style:(V=l.style)!=null?V:w,value:(O=l.value)!=null?O:I};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(T))return{type:c.CFRuleType.highlightCell,subType:(x=l.subType)!=null?x:o,operator:(W=l.operator)!=null?W:T,style:(X=l.style)!=null?X:w,value:(Y=l.value)!=null?Y:I};break}}return{type:c.CFRuleType.highlightCell,subType:(ne=l.subType)!=null?ne:o,operator:(ee=l.operator)!=null?ee:T,style:(F=l.style)!=null?F:w}},[o,T,I,w]);L.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return R({})}}),[R,e]),L.useEffect(()=>{S.some(l=>l.value===o)||u(S[0].value)},[S]);const h=l=>{const g=l,f=br(g,n),v=f&&f[0].value;u(g),y(v),v&&_(c.createDefaultValue(g,v)),r(R({subType:g,operator:v}))},i=l=>{const g=l;y(g),r(R({operator:g}))},s=l=>{_(l),r(R({value:l}))},d=L.useMemo(()=>`${o}_${T}_${Math.random()}`,[o,T]);return E.jsxs("div",{children:[E.jsx("div",{className:`
|
|
101
|
+
${j.title}
|
|
102
|
+
${j.mTBase}
|
|
103
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),E.jsx(ae.Select,{className:`
|
|
104
|
+
${j.mTSm}
|
|
114
105
|
${G.width100}
|
|
115
|
-
`,onChange:h,value:
|
|
116
|
-
${
|
|
106
|
+
`,onChange:h,value:o,options:S}),(p==null?void 0:p.length)&&E.jsx(ae.Select,{className:`
|
|
107
|
+
${j.mTSm}
|
|
117
108
|
${G.width100}
|
|
118
|
-
`,onChange:
|
|
109
|
+
`,onChange:i,value:T||"",options:p}),E.jsx(Va,{value:I,interceptorManager:e,type:o,operator:T,rule:a,onChange:s},d),E.jsx("div",{className:`
|
|
119
110
|
${G.cfPreviewWrap}
|
|
120
|
-
`,children:
|
|
121
|
-
${
|
|
122
|
-
`,onChange:
|
|
111
|
+
`,children:E.jsx(We,{rule:R({})})}),E.jsx(mn,{style:a==null?void 0:a.style,className:`
|
|
112
|
+
${j.mLXxs}
|
|
113
|
+
`,onChange:l=>{b(l),r(R({style:l}))}})]})},Tr=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",za=t=>{var p;const e=m.useDependency(m.IUniverInstanceService),r=e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=L.useMemo(()=>t.error?G.errorInput:"",[t.error]),o=L.useRef({}),[u,S]=L.useState(!1);return me.useSidebarClick(T=>{var I;const y=(I=o.current)==null?void 0:I.handleOutClick;y&&y(T,()=>S(!1))}),E.jsx("div",{className:G.positionRelative,children:t.type!==c.CFValueType.formula?E.jsxs(E.Fragment,{children:[E.jsx(ae.InputNumber,{className:a,value:Number(t.value)||0,onChange:T=>t.onChange(T!=null?T:0)}),t.error&&E.jsx("div",{className:G.errorText,children:t.error})]}):E.jsx("div",{style:{width:"100%"},children:E.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:u,onChange:(T="")=>{const y=T||"";t.onChange(y)},onFocus:()=>S(!0),actions:o.current})})})},Ir=(t,e,r)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),Aa=L.forwardRef((t,e)=>{const r=m.useDependency(m.LocaleService),n=a=>{t.onClick(a)};return E.jsx("div",{ref:e,className:G.iconGroupList,children:c.iconGroup.map((a,o)=>E.jsxs("div",{className:G.group,children:[E.jsx("div",{className:G.title,children:r.t(a.title)}),E.jsx("div",{className:G.itemContent,children:a.group.map(u=>E.jsx("div",{className:G.itemWrap,onClick:()=>{n(u.name)},children:E.jsx("div",{className:G.item,children:u.list.map((S,p)=>E.jsx("img",{className:G.icon,src:S},p))})},u.name))})]},o))})}),ja=t=>{const e=L.useMemo(()=>{const n=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((S,p)=>{n.push({iconType:u,base64:S,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return E.jsxs("div",{className:G.iconItemListWrap,children:[E.jsxs("div",{className:G.none,onClick:()=>r({iconType:c.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[E.jsx($e,{className:G.icon}),E.jsx("span",{children:"无单元格图标"})]}),E.jsx("div",{className:G.iconItemList,children:e.map(n=>E.jsx("div",{className:G.item,children:E.jsx("img",{onClick:()=>r(n),className:`
|
|
123
114
|
${G.icon}
|
|
124
|
-
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},
|
|
125
|
-
${_?
|
|
126
|
-
`,children:[
|
|
127
|
-
${
|
|
115
|
+
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},Wa=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,a=m.useDependency(m.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],u=[{label:a.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],S=(I,_)=>{e([String(_),"value","value"],I)},p=(I,_)=>{e([String(_),"operator"],I);const w=c.createDefaultValue(c.CFSubRuleType.number,I);S(w,_)},T=(I,_)=>{e([String(_),"value","type"],I);const w=r[_],b=c.createDefaultValue(c.CFSubRuleType.number,w.operator);S(b,_)};return L.useMemo(()=>r.map((I,_)=>{const w=n[_],b=Tr(I.iconType,I.iconId),R=_===r.length-1,h=_===0,i=r[_-1],s=(i==null?void 0:i.value.type)===c.CFValueType.formula?a.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,d=(C,l)=>{const g={...I,iconId:l,iconType:C};e([String(_)],g)};return E.jsxs("div",{className:`
|
|
116
|
+
${_?j.mTXl:j.mTSm}
|
|
117
|
+
`,children:[E.jsxs("div",{className:`
|
|
118
|
+
${j.label}
|
|
128
119
|
${G.flex}
|
|
129
|
-
`,children:[
|
|
120
|
+
`,children:[E.jsxs("div",{className:`
|
|
130
121
|
${G.width45}
|
|
131
|
-
`,children:[
|
|
122
|
+
`,children:[a.t("sheet.cf.iconSet.icon"),_+1]}),E.jsx("div",{className:`
|
|
132
123
|
${G.width45}
|
|
133
|
-
`,children:
|
|
124
|
+
`,children:E.jsxs(E.Fragment,{children:[!h&&!R&&a.t("sheet.cf.iconSet.rule"),!h&&!R&&E.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,R?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),E.jsxs("div",{className:`
|
|
134
125
|
${G.flex}
|
|
135
|
-
${
|
|
136
|
-
`,children:[
|
|
126
|
+
${j.mTSm}
|
|
127
|
+
`,children:[E.jsx("div",{className:`
|
|
137
128
|
${G.iconWrap}
|
|
138
129
|
${G.width45}
|
|
139
|
-
`,children:
|
|
130
|
+
`,children:E.jsx(ae.DropdownLegacy,{overlay:E.jsx(ja,{onClick:d,iconId:I.iconId,iconType:I.iconType}),children:E.jsxs("div",{className:G.dropdownIcon,children:[b?E.jsx("img",{src:b,className:G.icon}):E.jsx($e,{className:G.icon}),E.jsx(Tt,{})]})})}),R?E.jsxs("div",{className:`
|
|
140
131
|
${G.width45}
|
|
141
|
-
${
|
|
142
|
-
`,style:{marginTop:0},children:[
|
|
143
|
-
${
|
|
132
|
+
${j.label}
|
|
133
|
+
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),E.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,R?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):E.jsx(ae.Select,{className:`
|
|
134
|
+
${j.mL0}
|
|
144
135
|
${G.width45}
|
|
145
|
-
${
|
|
146
|
-
`,options:
|
|
147
|
-
${
|
|
148
|
-
${
|
|
136
|
+
${j.mR0}
|
|
137
|
+
`,options:o,value:I.operator,onChange:C=>{p(C,_)}})]}),R?E.jsx("div",{}):E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:`
|
|
138
|
+
${j.mTSm}
|
|
139
|
+
${j.label}
|
|
149
140
|
${G.flex}
|
|
150
|
-
`,children:[
|
|
141
|
+
`,children:[E.jsx("div",{className:`
|
|
151
142
|
${G.width45}
|
|
152
|
-
`,children:
|
|
143
|
+
`,children:a.t("sheet.cf.iconSet.type")}),E.jsx("div",{className:`
|
|
153
144
|
${G.width45}
|
|
154
|
-
`,children:
|
|
155
|
-
${
|
|
145
|
+
`,children:a.t("sheet.cf.iconSet.value")})]}),E.jsxs("div",{className:`
|
|
146
|
+
${j.mTSm}
|
|
156
147
|
${G.flex}
|
|
157
|
-
`,children:[
|
|
148
|
+
`,children:[E.jsx(ae.Select,{style:{flexShrink:0},className:`
|
|
158
149
|
${G.width45}
|
|
159
|
-
${
|
|
160
|
-
`,options:
|
|
161
|
-
${
|
|
150
|
+
${j.mL0}
|
|
151
|
+
`,options:u,value:I.value.type,onChange:C=>{T(C,_)}}),E.jsx("div",{className:`
|
|
152
|
+
${j.mL0}
|
|
162
153
|
${G.width45}
|
|
163
|
-
`,children:
|
|
164
|
-
${
|
|
165
|
-
`,children:
|
|
166
|
-
${
|
|
154
|
+
`,children:E.jsx(za,{id:_,type:I.value.type,error:w,value:I.value.value||"",onChange:C=>S(C,_)})})]})]})]},_)}),[r,n])},Ha=t=>{var C;const{interceptorManager:e}=t,r=((C=t.rule)==null?void 0:C.type)===c.CFRuleType.iconSet?t.rule:void 0,n=m.useDependency(m.LocaleService),[a,o]=L.useState({}),[u,S]=L.useState(()=>{const l=Object.keys(c.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(v=>v.iconType!==g))return g}return l}),[p,T]=L.useState(()=>{if(r&&r.config.length)return m.Tools.deepClone(r==null?void 0:r.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,f,v)=>f===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(f)}:Ir(u,f,v))}),[y,I]=L.useState(()=>r?!!r.isShowValue:!0),_=L.useMemo(()=>{const l=p.map(g=>Tr(g.iconType,g.iconId));return E.jsx("div",{className:G.iconWrap,children:l.map((g,f)=>g?E.jsx("img",{className:G.icon,src:g},f):E.jsx($e,{className:G.icon},f))})},[p]),w=l=>{if(l.reduce((f,v,D)=>f.preType&&!f.result||l.length-1===D?f:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:f.preType?{result:f.preType===v.value.type,preType:v.value.type}:{result:!0,preType:v.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(l[0].value.type)){const f={};return l.forEach((v,D,U)=>{if(D-1<0||D===U.length-1)return;const V=l[D-1],O=c.getOppositeOperator(V.operator);c.compareWithNumber({operator:O,value:V.value.value},v.value.value)||(f[D]=`${n.t(`sheet.cf.form.${O}`,String(V.value.value))} `)}),f}return{}},b=(l,g)=>{m.get(p,l)!==g&&(m.set(p,l,g),T([...p]),o(w(p)))},R=l=>{S(l);const g=c.iconMap[l]||[],f=new Array(g.length).fill("").map((v,D,U)=>Ir(l,D,U));T(f),o(w(f))};L.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:y,config:p}}});return()=>{l()}},[y,p,e]),L.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[y,p,e,a]);const h=()=>{const l=p.map(g=>({...g}));p.forEach((g,f)=>{const v=p.length-1-f,D=l[v];g.iconId=D.iconId,g.iconType=D.iconType}),T([...p])},i=m.useDependency(me.ILayoutService),[s,d]=L.useState();return me.useScrollYOverContainer(s,i.rootContainerElement),E.jsxs("div",{className:G.iconSet,children:[E.jsx("div",{className:j.title,children:n.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
|
|
155
|
+
${j.mTSm}
|
|
156
|
+
`,children:E.jsx(ae.DropdownLegacy,{placement:"bottomLeft",overlay:E.jsx(Aa,{ref:l=>{!s&&l&&d(l)},iconType:u,onClick:R}),children:E.jsxs("div",{className:G.dropdownIcon,style:{width:"unset"},children:[_,E.jsx(Tt,{})]})})}),E.jsxs("div",{className:`
|
|
157
|
+
${j.mTSm}
|
|
167
158
|
${G.renderConfig}
|
|
168
|
-
`,children:[
|
|
159
|
+
`,children:[E.jsxs("div",{className:G.utilItem,children:[E.jsx(ae.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),E.jsxs("div",{className:`
|
|
169
160
|
${G.utilItem}
|
|
170
|
-
${
|
|
171
|
-
`,children:[
|
|
172
|
-
${
|
|
173
|
-
${
|
|
174
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),
|
|
161
|
+
${j.mLXl}
|
|
162
|
+
`,children:[E.jsx(ae.Checkbox,{checked:!y,onChange:l=>{I(!l)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),E.jsx(Wa,{errorMap:a,onChange:b,configList:p})]})},ka=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=m.useDependency(m.LocaleService),a=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,o=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[u,S]=L.useState(()=>{const i=o[0].value,s=a==null?void 0:a.type;if(!a)return i;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":i;case c.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return i}),[p,T]=L.useState(()=>{const s=a==null?void 0:a.type;if(!a)return 10;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.value||10}}return 10}),[y,I]=L.useState(()=>{const s=a==null?void 0:a.type;if(!a)return!1;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[_,w]=L.useState({}),b=i=>{const{type:s,isPercent:d,value:C,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!1,value:C,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!0,value:C,style:l};if(s==="greaterThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.lessThan,style:l}};L.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return b({type:u,isPercent:y,value:p,style:_})}}),[u,y,p,_,r]);const R=i=>{e(b(i))};return E.jsxs("div",{children:[E.jsx("div",{className:`
|
|
163
|
+
${j.title}
|
|
164
|
+
${j.mTBase}
|
|
165
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),E.jsx(ae.Select,{className:`
|
|
175
166
|
${G.width100}
|
|
176
|
-
${
|
|
177
|
-
`,value:
|
|
178
|
-
${
|
|
179
|
-
${
|
|
180
|
-
`,children:[
|
|
181
|
-
${
|
|
182
|
-
${
|
|
167
|
+
${j.mTSm}
|
|
168
|
+
`,value:u,options:o,onChange:i=>{S(i),R({type:i,isPercent:y,value:p,style:_})}}),["isNotBottom","isBottom"].includes(u)&&E.jsxs("div",{className:`
|
|
169
|
+
${j.labelContainer}
|
|
170
|
+
${j.mTSm}
|
|
171
|
+
`,children:[E.jsx(ae.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;T(s),R({type:u,isPercent:y,value:s,style:_})}}),E.jsxs("div",{className:`
|
|
172
|
+
${j.mLSm}
|
|
173
|
+
${j.labelContainer}
|
|
183
174
|
${G.text}
|
|
184
|
-
`,children:[
|
|
175
|
+
`,children:[E.jsx(ae.Checkbox,{checked:y,onChange:i=>{I(!!i),R({type:u,isPercent:!!i,value:p,style:_})}}),n.t("sheet.cf.valueType.percent")]})]}),E.jsx("div",{className:`
|
|
185
176
|
${G.cfPreviewWrap}
|
|
186
|
-
`,children:
|
|
187
|
-
${
|
|
188
|
-
`,onChange:
|
|
189
|
-
${
|
|
190
|
-
`,children:
|
|
191
|
-
${
|
|
177
|
+
`,children:E.jsx(We,{rule:b({type:u,isPercent:y,value:p,style:_})})}),E.jsx(mn,{style:a==null?void 0:a.style,className:`
|
|
178
|
+
${j.mTSm}
|
|
179
|
+
`,onChange:i=>{w(i),R({type:u,isPercent:y,value:p,style:i})}})]})},Ba=m.createInterceptorKey("beforeSubmit"),Fa=m.createInterceptorKey("submit"),wr=t=>t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),Rr=t=>{var e;return(e=t.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},Ga=t=>{var U,z,V;const e=m.useDependency(m.LocaleService),r=m.useDependency(m.ICommandService),n=m.useDependency(m.IUniverInstanceService),a=m.useDependency(c.ConditionalFormattingRuleModel),o=m.useDependency(q.SheetsSelectionsService),u=wr(n),S=Rr(n),[p,T]=L.useState(!0),y=L.useRef({}),[I,_]=L.useState(void 0),w=L.useRef((z=(U=t.rule)==null?void 0:U.ranges)!=null?z:[]),b=L.useMemo(()=>{var x,W,X;let O=(x=t.rule)==null?void 0:x.ranges;return O!=null&&O.length||(O=(X=(W=o.getCurrentSelections())==null?void 0:W.map(Y=>Y.range))!=null?X:[]),w.current=O,O!=null&&O.length?O.map(Y=>{const ne=Gt.serializeRange(Y);return ne==="NaN"?"":ne}).filter(Y=>!!Y).join(","):""},[t.rule]),R=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,i]=L.useState(()=>{var W,X;const O=(W=t.rule)==null?void 0:W.rule.type,x=R[0].value;if(!O)return x;switch(O){case c.CFRuleType.highlightCell:{switch((X=t.rule)==null?void 0:X.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return x}),s=L.useRef(void 0),d=L.useMemo(()=>new m.InterceptorManager({beforeSubmit:Ba,submit:Fa}),[]),C=L.useMemo(()=>{switch(h){case"1":return Cr;case"2":return ka;case"3":return La;case"4":return Na;case"5":return Ua;case"6":return Ha;default:return Cr}},[h]);L.useEffect(()=>{const O=r.onCommandExecuted(x=>{if(x.id===q.RemoveSheetMutation.id){const W=x.params;W.subUnitId===S&&W.unitId===u&&t.onCancel()}x.id===q.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>O.dispose()},[]);const l=O=>{s.current=O},g=O=>{const x=O.split(",").filter(W=>!!W).map(Gt.deserializeRangeWithSheet).map(W=>W.range);w.current=x},f=()=>{if(I)return;const x=(()=>{const X=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!X)throw new Error("No active sheet found");return w.current.map(ee=>q.setEndForRange(ee,X.getRowCount(),X.getColumnCount())).filter(ee=>!(Number.isNaN(ee.startRow)||Number.isNaN(ee.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const X=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(X){const Y=wr(n),ne=Rr(n);if(!Y||!ne)throw new Error("No active sheet found");let ee={};t.rule&&t.rule.cfId?(ee={...t.rule,ranges:x,rule:X},r.executeCommand(bt.id,{unitId:Y,subUnitId:ne,rule:ee}),t.onCancel()):(ee={cfId:a.createCfId(Y,ne),ranges:x,rule:X,stopIfTrue:!1},r.executeCommand(Xe.id,{unitId:Y,subUnitId:ne,rule:ee}),t.onCancel())}}},v=()=>{t.onCancel()},D=(O,x)=>{O?x.length<1?_(e.t("sheet.cf.errorMessage.rangeError")):_(void 0):_(e.t("sheet.cf.errorMessage.rangeError"))};return me.useSidebarClick(O=>{var W;const x=(W=y.current)==null?void 0:W.handleOutClick;x&&x(O,()=>T(!1))}),E.jsxs("div",{className:G.cfRuleStyleEditor,children:[E.jsx("div",{className:j.title,children:e.t("sheet.cf.panel.range")}),E.jsx("div",{className:`
|
|
180
|
+
${j.mTBase}
|
|
181
|
+
`,children:E.jsx(Ge.RangeSelector,{unitId:u,errorText:I,subUnitId:S,initValue:b,onChange:g,onVerify:D,onFocus:()=>T(!0),isFocus:p,actions:y.current})}),E.jsx("div",{className:j.title,children:e.t("sheet.cf.panel.styleType")}),E.jsx("div",{className:j.mTBase,children:E.jsx(ae.Select,{className:G.width100,value:h,options:R,onChange:O=>i(O)})}),E.jsx(C,{interceptorManager:d,rule:(V=t.rule)==null?void 0:V.rule,onChange:l}),E.jsxs("div",{className:`
|
|
182
|
+
${j.mTBase}
|
|
192
183
|
${G.btnList}
|
|
193
|
-
`,children:[x.jsx(ie.Button,{size:"small",onClick:y,children:e.t("sheet.cf.panel.cancel")}),x.jsx(ie.Button,{className:A.mLSm,size:"small",type:"primary",onClick:p,children:e.t("sheet.cf.panel.submit")})]})]})},Ji=t=>{const[e,r]=j.useState(t.rule),[n,i]=j.useState(!!t.rule),a=()=>{i(!0)},l=()=>{i(!1),r(void 0)},S=f=>{r(f),i(!0)};return x.jsx("div",{className:A.conditionalFormattingWrap,children:n?x.jsx(Zi,{onCancel:l,rule:e}):x.jsx(zi,{onClick:S,onCreate:a})})};var Qi=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,ta=(t,e,r,n)=>{for(var i=n>1?void 0:n?ea(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Qi(e,r,i),i},lt=(t,e)=>(r,n)=>e(r,n,t);const Vt="sheet.conditional.formatting.panel";let ut=class extends v.Disposable{constructor(e,r,n,i,a){super();Pe(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=i,this._localeService=a,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var S;l||(S=this._sidebarDisposable)==null||S.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(l=>{l.id===Vt&&(l.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:e,key:v.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Ji)}};ut=ta([lt(0,v.IUniverInstanceService),lt(1,v.Inject(v.Injector)),lt(2,v.Inject(ge.ComponentManager)),lt(3,v.Inject(ge.ISidebarService)),lt(4,v.Inject(v.LocaleService))],ut);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const ct={id:"sheet.operation.open.conditional.formatting.panel",type:v.CommandType.OPERATION,handler:(t,e)=>{var S;const r=t.get(ut),n=t.get(q.SheetsSelectionsService),i=t.get(v.ICommandService),a=((S=n.getCurrentSelections())==null?void 0:S.map(f=>f.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:a});break}case 4:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(f);break}case 5:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(f);break}case 6:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(f);break}case 7:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(f);break}case 8:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(f);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:a});break}case 9:{i.executeCommand(St.id,{ranges:a});break}case 10:{i.executeCommand(Ye.id);break}}return!0}};var na=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,ia=(t,e,r,n)=>{for(var i=n>1?void 0:n?ra(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&na(e,r,i),i},dt=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends v.Disposable{constructor(e,r,n,i,a){super();Pe(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=i,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,i)=>{const{copyType:a=de.COPY_TYPE.COPY,pasteType:l}=i,{range:S}=e||{},{range:f}=r;return this._generateConditionalFormattingMutations(f,{copyType:a,pasteType:l,copyRange:S})}}))}_collectConditionalRule(e,r,n){const i=new v.ObjectMatrix,a={};this._copyInfo={matrix:i,info:{unitId:e,subUnitId:r,cfMap:a}};const l=this._injector.invoke(m=>de.rangeToDiscreteRange(n,m,e,r));if(!l)return;const{rows:S,cols:f}=l,b=new Set;S.forEach((m,T)=>{f.forEach((_,I)=>{const R=this._conditionalFormattingViewModel.getCellCfs(e,r,m,_);R&&(R.forEach(w=>b.add(w.cfId)),i.setValue(T,I,R.map(w=>w.cfId)))})}),b.forEach(m=>{const T=this._conditionalFormattingRuleModel.getRule(e,r,m);T&&(a[m]=T.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),i=n.getActiveSheet(),a=n.getUnitId();if(!i)return{redos:[],undos:[]};const l=i.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[f,b],mapFunc:m}=de.virtualizeDiscreteRanges([r.copyRange,e]),T=de.getRepeatRange(f,b,!0),_={};v.Range.foreach(b,(u,g)=>{const{row:p,col:y}=m(u,g),M=this._conditionalFormattingViewModel.getCellCfs(a,l,p,y);M&&M.forEach(L=>{if(!_[L.cfId]){const V=new v.ObjectMatrix;_[L.cfId]=V;const U=this._conditionalFormattingRuleModel.getRule(a,l,L.cfId);U==null||U.ranges.forEach(E=>{v.Range.foreach(E,(D,W)=>{V.setValue(D,W,1)})})}_[L.cfId].realDeleteValue(p,y)})});const{matrix:I,info:R}=this._copyInfo,w=[];let h=this._conditionalFormattingRuleModel.createCfId(a,l);const o={},s=u=>{if(o[u])return o[u];const g=R==null?void 0:R.cfMap[u],p=[...this._conditionalFormattingRuleModel.getSubunitRules(a,l)||[],...w].find(y=>v.Tools.diffValue(y.rule,g));if(p)return o[u]=p,p;{const y={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return o[u]=y,w.push(y),h=`${Number(h)+1}`,y}};T.forEach(u=>{I&&I.forValue((g,p,y)=>{const M=v.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:p,endColumn:p},u.startRange),{row:L,col:V}=m(M.startRow,M.startColumn);y.forEach(U=>{if(!_[U]){const E=s(U),D=new v.ObjectMatrix;_[U]=D,E.ranges.forEach(W=>{v.Range.foreach(W,(X,Y)=>{D.setValue(X,Y,1)})})}_[U].setValue(L,V,1)})})});const d=[],C=[];for(const u in _){const g=_[u],p=q.findAllRectangle(q.createTopMatrixFromMatrix(g));if(!p.length){const y={unitId:a,subUnitId:l,cfId:u};d.push({id:c.DeleteConditionalRuleMutation.id,params:y}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,y))}if(w.some(y=>y.cfId===u)){const y=s(u),M={unitId:a,subUnitId:l,rule:{...y,ranges:p}};d.push({id:c.AddConditionalRuleMutation.id,params:M}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,M))}else{const y=this._conditionalFormattingRuleModel.getRule(a,l,u);if(!y)continue;const M={unitId:a,subUnitId:l,rule:{...y,ranges:p}};d.push({id:c.SetConditionalRuleMutation.id,params:M}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,M))}}return{redos:d,undos:C}}};ft=ia([dt(0,v.Inject(de.ISheetClipboardService)),dt(1,v.Inject(c.ConditionalFormattingRuleModel)),dt(2,v.Inject(v.Injector)),dt(3,v.Inject(c.ConditionalFormattingViewModel)),dt(4,v.Inject(v.IUniverInstanceService))],ft);var aa=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,sa=(t,e,r,n)=>{for(var i=n>1?void 0:n?oa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&aa(e,r,i),i},Sn=(t,e)=>(r,n)=>e(r,n,t);let pt=class extends v.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===Xe.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[q.WorkbookEditablePermission],rangeTypes:[q.RangeProtectionPermissionEditPoint],worksheetTypes:[q.WorksheetEditPermission,q.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};pt=sa([Sn(0,v.Inject(v.LocaleService)),Sn(1,v.ICommandService),Sn(2,v.Inject(q.SheetPermissionCheckController))],pt);var la=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?ua(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&la(e,r,i),i},zt=(t,e)=>(r,n)=>e(r,n,t);let ht=class extends v.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,i,a)=>`${n}_${i}_${a}`,r=(n,i,a)=>{const l=f=>{const b=[...a.ranges],m=b.map(_=>q.handleDefaultRangeChangeWithEffectRefCommands(_,f)).filter(_=>!!_);if(c.isRangesEqual(m,b))return{redos:[],undos:[]};if(m.length){const _={unitId:n,subUnitId:i,rule:{...a,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:_}],R=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:I,undos:R}}else{const _={unitId:n,subUnitId:i,cfId:a.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:_}],R=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:I,undos:R}}},S=[];a.ranges.forEach(f=>{const b=this._refRangeService.registerRefRange(f,l);S.push(()=>b.dispose())}),t.set(e(n,i,a.cfId),()=>S.forEach(f=>f()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:i,subUnitId:a,rule:l}=n,S=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),f=S.getActiveSheet();if(!(n.unitId!==S.getUnitId()||n.subUnitId!==(f==null?void 0:f.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const b=t.get(e(i,a,l.cfId));b&&b();break}case"set":{const b=t.get(e(i,a,l.cfId));b&&b(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(v.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ht=ca([zt(0,v.Inject(c.ConditionalFormattingRuleModel)),zt(1,v.Inject(v.IUniverInstanceService)),zt(2,v.Inject(v.Injector)),zt(3,v.Inject(q.RefRangeService))],ht);var da=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?fa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&da(e,r,i),i},ke=(t,e)=>(r,n)=>e(r,n,t);let mt=class extends v.Disposable{constructor(e,r,n,i,a,l){super();Pe(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=i,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=l,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,i;const e=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(i=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||i.makeDirty()}_initSkeleton(){this.disposeWithMe(Re.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(i=>i.unitId===r.getUnitId()&&i.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(q.INTERCEPTOR_POINT.CELL_CONTENT,{effect:v.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const i=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!i)return n(e);const a=r.workbook.getStyles(),S={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},f={...e,s:S};return i.style&&Object.assign(S,i.style),f.fontRenderExtension||(f.fontRenderExtension={},i.isShowValue!==void 0&&(f.fontRenderExtension.isSkip=!i.isShowValue)),i.dataBar&&(f.dataBar=i.dataBar),i.iconSet&&(f.iconSet=i.iconSet,f.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(f)},priority:10}))}};mt=pa([ke(0,v.Inject(q.SheetInterceptorService)),ke(1,v.Inject(c.ConditionalFormattingService)),ke(2,v.Inject(v.IUniverInstanceService)),ke(3,v.Inject(wn.IRenderManagerService)),ke(4,v.Inject(c.ConditionalFormattingViewModel)),ke(5,v.Inject(c.ConditionalFormattingRuleModel))],mt);const Pr="sheets-conditional-formatting-ui.config",At={};var Mr=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,ma=(t,e,r)=>e in t?Mr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ga=(t,e,r,n)=>{for(var i=n>1?void 0:n?ha(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Mr(e,r,i),i},bn=(t,e)=>(r,n)=>e(r,n,t),Dr=(t,e,r)=>ma(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends v.Plugin{constructor(e=At,r,n,i){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=i;const{menu:a,...l}=v.merge({},At,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Pr,l),this._initCommand(),this._injector.add([mt]),this._injector.add([ht]),this._injector.add([ft]),this._injector.add([pt]),this._injector.add([Ae])}_initCommand(){[Xt,Yt,Kt,$t,Zt,Jt,Qt,en,tn,ct,Ke,Rt,bt,Xe,St,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Dr($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Dr($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",v.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=ga([v.DependentOn(c.UniverSheetsConditionalFormattingPlugin),bn(1,v.Inject(v.Injector)),bn(2,v.Inject(v.ICommandService)),bn(3,v.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var va=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,Sa=(t,e,r,n)=>{for(var i=n>1?void 0:n?ya(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&va(e,r,i),i},gt=(t,e)=>(r,n)=>e(r,n,t);let Wt=class extends v.Disposable{constructor(t,e,r,n,i){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=i,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(i,a,l,S,f)=>{var I;const b=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!b||!m)return;const T={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},_={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};v.Range.foreach(l,(R,w)=>{const h=v.Rectangle.getPositionRange({startRow:R,startColumn:w,endColumn:w,endRow:R},T),o=v.Rectangle.getPositionRange({startRow:R,startColumn:w,endColumn:w,endRow:R},_),{row:s,col:d}=f(h.startRow,h.startColumn),C=this._conditionalFormattingViewModel.getCellCfs(b,m,s,d),{row:u,col:g}=f(o.startRow,o.startColumn),p=this._conditionalFormattingViewModel.getCellCfs(b,m,u,g);p&&p.forEach(y=>{let M=S.get(y.cfId);if(!S.get(y.cfId)){const L=this._conditionalFormattingRuleModel.getRule(b,m,y.cfId);if(!L)return;M=new v.ObjectMatrix,L.ranges.forEach(V=>{v.Range.foreach(V,(U,E)=>{M.setValue(U,E,1)})}),S.set(y.cfId,M)}M.realDeleteValue(u,g)}),C&&C.forEach(y=>{let M=S.get(y.cfId);if(!S.get(y.cfId)){const L=this._conditionalFormattingRuleModel.getRule(b,m,y.cfId);if(!L)return;M=new v.ObjectMatrix,L.ranges.forEach(V=>{v.Range.foreach(V,(U,E)=>{M.setValue(U,E,1)})}),S.set(y.cfId,M)}M.setValue(u,g,1)})})},r=(i,a)=>{var o,s,d;const l=(o=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:o.getUnitId(),S=(d=(s=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),f=new Map,b=[],m=[];if(!l||!S)return t();const T=de.virtualizeDiscreteRanges([i,a]),[_,I]=T.ranges,{mapFunc:R}=T,w={row:_.startRow,col:_.startColumn};return de.getAutoFillRepeatRange(_,I).forEach(C=>{e(w,C.repeatStartCell,C.relativeRange,f,R)}),f.forEach((C,u)=>{const g=this._conditionalFormattingRuleModel.getRule(l,S,u);if(!g)return;const p=q.findAllRectangle(q.createTopMatrixFromMatrix(C));if(p.length){const y={unitId:l,subUnitId:S,rule:{...g,ranges:p}};b.push({id:c.SetConditionalRuleMutation.id,params:y}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,y))}else{const y={unitId:l,subUnitId:S,cfId:g.cfId};b.push({id:c.DeleteConditionalRuleMutation.id,params:y}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,y))}}),{undos:m,redos:b}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(i,a,l)=>{if(l===de.APPLY_TYPE.COPY||l===de.APPLY_TYPE.ONLY_FORMAT||l===de.APPLY_TYPE.SERIES){const{source:S,target:f}=i;return r(S,f)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Wt=Sa([gt(0,v.Inject(v.Injector)),gt(1,v.Inject(v.IUniverInstanceService)),gt(2,v.Inject(de.IAutoFillService)),gt(3,v.Inject(c.ConditionalFormattingRuleModel)),gt(4,v.Inject(c.ConditionalFormattingViewModel))],Wt);var ba=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ra(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&ba(e,r,i),i},vt=(t,e)=>(r,n)=>e(r,n,t);$.ConditionalFormattingClearController=class extends v.Disposable{constructor(e,r,n,i,a){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=i,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var a;const r=[],n=[],i={redos:r,undos:n};if([q.ClearSelectionFormatCommand.id,q.ClearSelectionAllCommand.id].includes(e.id)){const l=(a=this._selectionManagerService.getCurrentSelections())==null?void 0:a.map(R=>R.range);if(!l)return i;const S=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),f=S.getActiveSheet();if(!f)return i;const b=S.getUnitId(),m=f.getSheetId(),T=this._conditionalFormattingRuleModel.getSubunitRules(b,m);if(!T||!T.length)return i;const{redos:_,undos:I}=Nr(this._injector,T,l,b,m);r.push(..._),n.push(...I)}return i}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const i=[],a=[],l={redos:i,undos:a};if(!n||!n.length)return l;const S=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!S||!S.length)return l;const{redos:f,undos:b}=Nr(this._injector,S,n,e,r);return i.push(...f),a.push(...b),l}}))}},$.ConditionalFormattingClearController=Ca([vt(0,v.Inject(v.Injector)),vt(1,v.Inject(v.IUniverInstanceService)),vt(2,v.Inject(q.SheetInterceptorService)),vt(3,v.Inject(q.SheetsSelectionsService)),vt(4,v.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Nr(t,e,r,n,i){const a=[],l=[];return e.filter(S=>r.some(f=>S.ranges.some(b=>v.Rectangle.getIntersects(b,f)))).forEach(S=>{const b=new q.RangeMergeUtil().add(...S.ranges).subtract(...r).merge();if(b.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:i,rule:{...S,ranges:b}}},T=c.setConditionalRuleMutationUndoFactory(t,m.params);a.push(m),l.push(...T)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:i,cfId:S.cfId}},T=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);a.push(m),l.push(...T)}}),{redos:a,undos:l}}var Ta=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ia(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ta(e,r,i),i},jr=(t,e)=>(r,n)=>e(r,n,t);let Ht=class extends v.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(v.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var l,S,f;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),i=(l=n==null?void 0:n.style)!=null?l:{},a=Object.keys(i);if(t!=null&&t.p)return(f=(S=t.p.body)==null?void 0:S.textRuns)==null||f.forEach(b=>{b.ts&&a.forEach(m=>{var T;(T=b.ts)==null||delete T[m]})}),r(t);{const b={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};a.forEach(T=>{delete b[T]});const m={...t,s:{...b}};return r(m)}}})))}};Ht=wa([jr(0,v.Inject(q.SheetInterceptorService)),jr(1,v.Inject(c.ConditionalFormattingService))],Ht);const Lr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],yt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],_a=t=>{const e=t.get(q.SheetsSelectionsService),r=t.get(v.ICommandService),n=t.get(v.IUniverInstanceService),i=t.get(c.ConditionalFormattingRuleModel),a=new Re.Observable(f=>Re.merge(e.selectionMoveEnd$,e.selectionSet$,new Re.Observable(b=>{const m=r.onCommandExecuted(T=>{var w;const{id:_,params:I}=T,R=(w=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();Lr.includes(_)&&I.unitId===R&&b.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var w;const b=((w=e.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],m=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!m)return;const T=m.getActiveSheet();if(!T)return;const R=(i.getSubunitRules(m.getUnitId(),T.getSheetId())||[]).filter(h=>h.ranges.some(o=>b.some(s=>v.Rectangle.intersects(s,o)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(t,m.getUnitId(),T.getSheetId(),h));f.next(R)})),l=new Re.Observable(f=>new Re.Observable(b=>{const m=r.onCommandExecuted(T=>{var w;const{id:_,params:I}=T,R=(w=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();Lr.includes(_)&&I.unitId===R&&b.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const b=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!b)return;const m=b.getActiveSheet();if(!m)return;const T=i.getSubunitRules(b.getUnitId(),m.getSheetId())||[];if(!T.length)return f.next(!1),!1;const _=T.map(I=>I.ranges).every(I=>q.checkRangesEditablePermission(t,b.getUnitId(),m.getSheetId(),I));f.next(_)})),S=new Re.Observable(f=>{a.subscribe(b=>{const m=yt.find(T=>T.value===ve.clearRangeRules);m&&(m.disabled=!b,f.next(yt))}),l.subscribe(b=>{const m=yt.find(T=>T.value===ve.clearWorkSheetRules);m&&(m.disabled=!b,f.next(yt))}),f.next(yt)});return{id:ct.id,type:ge.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:S,hidden$:ge.getMenuHiddenObservable(t,v.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},xa={[ge.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:_a}}};var Ea=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?Oa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ea(e,r,i),i},Ur=(t,e)=>(r,n)=>e(r,n,t);let kt=class extends v.Disposable{constructor(e,r){super();Pe(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(xa)}};kt=Pa([Ur(0,v.Inject(v.Injector)),Ur(1,ge.IMenuManagerService)],kt);var Ma=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,Na=(t,e,r,n)=>{for(var i=n>1?void 0:n?Da(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ma(e,r,i),i},Be=(t,e)=>(r,n)=>e(r,n,t);const ja=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,i=r(e)%r(t),a=n(e)%n(t),l=Math.floor(r(e)/r(t)),S=Math.floor(n(e)/n(t)),f=[],b={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return f.push({repeatRelativeRange:b,startRange:m}),f}for(let m=0;m<l+(i?.1:0);m++)for(let T=0;T<S+(a?.1:0);T++){const _=r(t)*m,I=n(t)*T,R={startRow:_+e.startRow,endRow:_+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let w=b;m===l&&i&&(w={...w},w.endRow=w.endRow-(r(t)-i)),T===S&&a&&(w={...w},w.endColumn=w.endColumn-(n(t)-a)),f.push({repeatRelativeRange:w,startRange:R})}return f};let Bt=class extends v.Disposable{constructor(e,r,n,i,a,l){super();Pe(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=i,this._conditionalFormattingRuleModel=a,this._conditionalFormattingViewModel=l,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(a,l,S,f,b)=>{const{unitId:m,subUnitId:T}=this._painterConfig,{targetUnitId:_,targetSubUnitId:I}=b,R={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},w={startRow:l.row,startColumn:l.col,endColumn:l.col,endRow:l.row};v.Range.foreach(S,(h,o)=>{const s=v.Rectangle.getPositionRange({startRow:h,startColumn:o,endColumn:o,endRow:h},R),d=v.Rectangle.getPositionRange({startRow:h,startColumn:o,endColumn:o,endRow:h},w),C=this._conditionalFormattingViewModel.getCellCfs(m,T,s.startRow,s.startColumn),u=this._conditionalFormattingViewModel.getCellCfs(_,I,d.startRow,d.startColumn);u&&u.forEach(g=>{let p=f.get(g.cfId);if(!f.get(g.cfId)){const y=this._conditionalFormattingRuleModel.getRule(_,I,g.cfId);if(!y)return;p=new v.ObjectMatrix,y.ranges.forEach(M=>{v.Range.foreach(M,(L,V)=>{p.setValue(L,V,1)})}),f.set(g.cfId,p)}p.realDeleteValue(d.startRow,d.startColumn)}),C&&C.forEach(g=>{const p=f.get(g.cfId);p&&p.setValue(d.startRow,d.startColumn,1)})})},n=(a,l,S)=>{var s;const{range:f,unitId:b,subUnitId:m}=this._painterConfig,T=a!==b||m!==l,_=new Map,I=[],R=[];if(!a||!l||!b||!m)return e();const w=(s=this._conditionalFormattingRuleModel.getSubunitRules(b,m))!=null?s:[];w==null||w.forEach(d=>{const{ranges:C,cfId:u}=d;if(C.some(g=>v.Rectangle.intersects(f,g))){const g=new v.ObjectMatrix;T||C.forEach(p=>{v.Range.foreach(p,(y,M)=>{g.setValue(y,M,1)})}),_.set(u,g)}});const h={row:f.startRow,col:f.startColumn};return ja(f,S).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:a,targetSubUnitId:l})}),_.forEach((d,C)=>{if(T){const u=this._conditionalFormattingRuleModel.getRule(a,l,C),g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(u)if(g.length){const p={unitId:a,subUnitId:l,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:p}),R.push(...c.setConditionalRuleMutationUndoFactory(this._injector,p))}else{const p={unitId:a,subUnitId:l,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:p}),R.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,p))}else if(g.length){const p=this._conditionalFormattingRuleModel.getRule(b,m,C);if(p){const y={unitId:a,subUnitId:l,rule:{...v.Tools.deepClone(p),cfId:this._conditionalFormattingRuleModel.createCfId(a,l),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:y}),R.push(c.AddConditionalRuleMutationUndoFactory(this._injector,y))}}}else{const u=this._conditionalFormattingRuleModel.getRule(b,m,C);if(!u)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const p={unitId:b,subUnitId:m,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:p}),R.push(...c.setConditionalRuleMutationUndoFactory(this._injector,p))}else{const p={unitId:b,subUnitId:m,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:p}),R.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,p))}}}),{undos:R,redos:I}},i={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:a=>{var l,S,f;switch(a){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const b=(l=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:l.getUnitId(),m=(f=(S=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getActiveSheet())==null?void 0:f.getSheetId(),T=this._sheetsSelectionsService.getCurrentLastSelection(),_=T==null?void 0:T.range;b&&m&&_&&(this._painterConfig={unitId:b,subUnitId:m,range:_});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(a,l,S)=>this._painterConfig?n(a,l,S):{redos:[],undos:[]}};this._formatPainterService.addHook(i)}};Bt=Na([Be(0,v.Inject(v.Injector)),Be(1,v.Inject(v.IUniverInstanceService)),Be(2,v.Inject(de.IFormatPainterService)),Be(3,v.Inject(q.SheetsSelectionsService)),Be(4,v.Inject(c.ConditionalFormattingRuleModel)),Be(5,v.Inject(c.ConditionalFormattingViewModel))],Bt);var La=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Va=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ua(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&La(e,r,i),i},Rn=(t,e)=>(r,n)=>e(r,n,t);let Ft=class extends v.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),i=this._renderManagerService.getRenderById(n);if(!i)return;const a=i.with(de.SheetSkeletonManagerService);this.disposeWithMe(a.currentSkeleton$.subscribe(l=>{if(l){const S=l.skeleton.rowColumnSegment,f=S.endColumn-S.startColumn+1,m=(S.endRow-S.startRow+1)*f*9,T=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(T)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ft=Va([Rn(0,v.Inject(c.ConditionalFormattingViewModel)),Rn(1,v.IUniverInstanceService),Rn(2,wn.IRenderManagerService)],Ft);var Vr=Object.defineProperty,za=Object.getOwnPropertyDescriptor,Aa=(t,e,r)=>e in t?Vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?za(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Vr(e,r,i),i},Cn=(t,e)=>(r,n)=>e(r,n,t),zr=(t,e,r)=>Aa(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingUIPlugin=class extends v.Plugin{constructor(e=At,r,n,i){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=i;const{menu:a,...l}=v.merge({},At,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Pr,l),this._initCommand()}onStarting(){v.registerDependencies(this._injector,[[mt],[ht],[ft],[Wt],[pt],[ut],[kt],[Ae],[Ht],[$.ConditionalFormattingClearController],[Bt],[Ft]]),v.touchDependencies(this._injector,[[mt]])}onReady(){v.touchDependencies(this._injector,[[kt],[ut]])}onRendered(){v.touchDependencies(this._injector,[[Wt],[$.ConditionalFormattingClearController],[ft],[Ht],[Ae],[Bt],[pt],[ht],[Ft]])}_initCommand(){[Xt,Yt,Kt,$t,Zt,Jt,Qt,en,tn,ct,Ke,Rt,bt,Xe,St,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},zr($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),zr($.UniverSheetsConditionalFormattingUIPlugin,"type",v.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=Wa([v.DependentOn(c.UniverSheetsConditionalFormattingPlugin),Cn(1,v.Inject(v.Injector)),Cn(2,v.Inject(v.ICommandService)),Cn(3,v.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=Xt,$.AddCfCommand=Xe,$.AddColorScaleConditionalRuleCommand=Yt,$.AddDataBarConditionalRuleCommand=Kt,$.AddDuplicateValuesCfCommand=$t,$.AddNumberCfCommand=Zt,$.AddRankCfCommand=Jt,$.AddTextCfCommand=Qt,$.AddTimePeriodCfCommand=en,$.AddUniqueValuesCfCommand=tn,$.ClearRangeCfCommand=St,$.ClearWorksheetCfCommand=Ye,$.DeleteCfCommand=Ke,$.MoveCfCommand=bt,$.OpenConditionalFormattingOperator=ct,$.SetCfCommand=Rt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
184
|
+
`,children:[E.jsx(ae.Button,{size:"small",onClick:v,children:e.t("sheet.cf.panel.cancel")}),E.jsx(ae.Button,{className:j.mLSm,size:"small",type:"primary",onClick:f,children:e.t("sheet.cf.panel.submit")})]})]})},qa=t=>{const[e,r]=L.useState(t.rule),[n,a]=L.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),r(void 0)},S=p=>{r(p),a(!0)};return E.jsx("div",{className:j.conditionalFormattingWrap,children:n?E.jsx(Ga,{onCancel:u,rule:e}):E.jsx(xa,{onClick:S,onCreate:o})})};var Xa=Object.defineProperty,Ya=Object.getOwnPropertyDescriptor,Ka=(t,e,r,n)=>{for(var a=n>1?void 0:n?Ya(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Xa(e,r,a),a},st=(t,e)=>(r,n)=>e(r,n,t);const Vt="sheet.conditional.formatting.panel";let lt=class extends m.Disposable{constructor(e,r,n,a,o){super();Me(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var S;u||(S=this._sidebarDisposable)==null||S.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Vt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:e,key:m.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,qa)}};lt=Ka([st(0,m.IUniverInstanceService),st(1,m.Inject(m.Injector)),st(2,m.Inject(me.ComponentManager)),st(3,m.Inject(me.ISidebarService)),st(4,m.Inject(m.LocaleService))],lt);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const ut={id:"sheet.operation.open.conditional.formatting.panel",type:m.CommandType.OPERATION,handler:(t,e)=>{var S;const r=t.get(lt),n=t.get(q.SheetsSelectionsService),a=t.get(m.ICommandService),o=((S=n.getCurrentSelections())==null?void 0:S.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(yt.id,{ranges:o});break}case 10:{a.executeCommand(Ye.id);break}}return!0}};var $a=Object.defineProperty,Za=Object.getOwnPropertyDescriptor,Ja=(t,e,r,n)=>{for(var a=n>1?void 0:n?Za(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&$a(e,r,a),a},ct=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends m.Disposable{constructor(e,r,n,a,o){super();Me(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,a)=>{const{copyType:o=de.COPY_TYPE.COPY,pasteType:u}=a,{range:S}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:S})}}))}_collectConditionalRule(e,r,n){const a=new m.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:r,cfMap:o}};const u=this._injector.invoke(y=>de.rangeToDiscreteRange(n,y,e,r));if(!u)return;const{rows:S,cols:p}=u,T=new Set;S.forEach((y,I)=>{p.forEach((_,w)=>{const b=this._conditionalFormattingViewModel.getCellCfs(e,r,y,_);b&&(b.forEach(R=>T.add(R.cfId)),a.setValue(I,w,b.map(R=>R.cfId)))})}),T.forEach(y=>{const I=this._conditionalFormattingRuleModel.getRule(e,r,y);I&&(o[y]=I.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),o=n.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,T],mapFunc:y}=de.virtualizeDiscreteRanges([r.copyRange,e]),I=de.getRepeatRange(p,T,!0),_={};m.Range.foreach(T,(l,g)=>{const{row:f,col:v}=y(l,g),D=this._conditionalFormattingViewModel.getCellCfs(o,u,f,v);D&&D.forEach(U=>{if(!_[U.cfId]){const z=new m.ObjectMatrix;_[U.cfId]=z;const V=this._conditionalFormattingRuleModel.getRule(o,u,U.cfId);V==null||V.ranges.forEach(O=>{m.Range.foreach(O,(x,W)=>{z.setValue(x,W,1)})})}_[U.cfId].realDeleteValue(f,v)})});const{matrix:w,info:b}=this._copyInfo,R=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=b==null?void 0:b.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...R].find(v=>m.Tools.diffValue(v.rule,g));if(f)return i[l]=f,f;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,R.push(v),h=`${Number(h)+1}`,v}};I.forEach(l=>{w&&w.forValue((g,f,v)=>{const D=m.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:f,endColumn:f},l.startRange),{row:U,col:z}=y(D.startRow,D.startColumn);v.forEach(V=>{if(!_[V]){const O=s(V),x=new m.ObjectMatrix;_[V]=x,O.ranges.forEach(W=>{m.Range.foreach(W,(X,Y)=>{x.setValue(X,Y,1)})})}_[V].setValue(U,z,1)})})});const d=[],C=[];for(const l in _){const g=_[l],f=q.findAllRectangle(q.createTopMatrixFromMatrix(g));if(!f.length){const v={unitId:o,subUnitId:u,cfId:l};d.push({id:c.DeleteConditionalRuleMutation.id,params:v}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(R.some(v=>v.cfId===l)){const v=s(l),D={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:D}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,D))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const D={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:D}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,D))}}return{redos:d,undos:C}}};dt=Ja([ct(0,m.Inject(de.ISheetClipboardService)),ct(1,m.Inject(c.ConditionalFormattingRuleModel)),ct(2,m.Inject(m.Injector)),ct(3,m.Inject(c.ConditionalFormattingViewModel)),ct(4,m.Inject(m.IUniverInstanceService))],dt);var Qa=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,to=(t,e,r,n)=>{for(var a=n>1?void 0:n?eo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Qa(e,r,a),a},vn=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends m.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===Xe.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[q.WorkbookEditablePermission],rangeTypes:[q.RangeProtectionPermissionEditPoint],worksheetTypes:[q.WorksheetEditPermission,q.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ft=to([vn(0,m.Inject(m.LocaleService)),vn(1,m.ICommandService),vn(2,m.Inject(q.SheetPermissionCheckController))],ft);var no=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,ao=(t,e,r,n)=>{for(var a=n>1?void 0:n?ro(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&no(e,r,a),a},zt=(t,e)=>(r,n)=>e(r,n,t);let pt=class extends m.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,a,o)=>`${n}_${a}_${o}`,r=(n,a,o)=>{const u=p=>{const T=[...o.ranges],y=T.map(_=>q.handleDefaultRangeChangeWithEffectRefCommands(_,p)).filter(_=>!!_);if(c.isRangesEqual(y,T))return{redos:[],undos:[]};if(y.length){const _={unitId:n,subUnitId:a,rule:{...o,ranges:y}},w=[{id:c.SetConditionalRuleMutation.id,params:_}],b=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:b}}else{const _={unitId:n,subUnitId:a,cfId:o.cfId},w=[{id:c.DeleteConditionalRuleMutation.id,params:_}],b=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:b}}},S=[];o.ranges.forEach(p=>{const T=this._refRangeService.registerRefRange(p,u);S.push(()=>T.dispose())}),t.set(e(n,a,o.cfId),()=>S.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:o,rule:u}=n,S=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),p=S.getActiveSheet();if(!(n.unitId!==S.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const T=t.get(e(a,o,u.cfId));T&&T();break}case"set":{const T=t.get(e(a,o,u.cfId));T&&T(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(m.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};pt=ao([zt(0,m.Inject(c.ConditionalFormattingRuleModel)),zt(1,m.Inject(m.IUniverInstanceService)),zt(2,m.Inject(m.Injector)),zt(3,m.Inject(q.RefRangeService))],pt);var oo=Object.defineProperty,io=Object.getOwnPropertyDescriptor,so=(t,e,r,n)=>{for(var a=n>1?void 0:n?io(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&oo(e,r,a),a},ke=(t,e)=>(r,n)=>e(r,n,t);let ht=class extends m.Disposable{constructor(e,r,n,a,o,u){super();Me(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,a;const e=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(a=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(a=>a.unitId===r.getUnitId()&&a.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(q.INTERCEPTOR_POINT.CELL_CONTENT,{effect:m.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const a=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!a)return n(e);const o=r.workbook.getStyles(),S={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:S};return a.style&&Object.assign(S,a.style),p.fontRenderExtension||(p.fontRenderExtension={},a.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(p.dataBar=a.dataBar),a.iconSet&&(p.iconSet=a.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(p)},priority:10}))}};ht=so([ke(0,m.Inject(q.SheetInterceptorService)),ke(1,m.Inject(c.ConditionalFormattingService)),ke(2,m.Inject(m.IUniverInstanceService)),ke(3,m.Inject(In.IRenderManagerService)),ke(4,m.Inject(c.ConditionalFormattingViewModel)),ke(5,m.Inject(c.ConditionalFormattingRuleModel))],ht);const _r="sheets-conditional-formatting-ui.config",At={};var Er=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,uo=(t,e,r)=>e in t?Er(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,co=(t,e,r,n)=>{for(var a=n>1?void 0:n?lo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Er(e,r,a),a},yn=(t,e)=>(r,n)=>e(r,n,t),Or=(t,e,r)=>uo(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends m.Plugin{constructor(e=At,r,n,a){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=m.merge({},At,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand(),this._injector.add([ht]),this._injector.add([pt]),this._injector.add([dt]),this._injector.add([ft]),this._injector.add([je])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ut,Ke,bt,St,Xe,yt,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Or($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Or($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",m.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=co([m.DependentOn(c.UniverSheetsConditionalFormattingPlugin),yn(1,m.Inject(m.Injector)),yn(2,m.Inject(m.ICommandService)),yn(3,m.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(t,e,r,n)=>{for(var a=n>1?void 0:n?po(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&fo(e,r,a),a},gt=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends m.Disposable{constructor(t,e,r,n,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,S,p)=>{var w;const T=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getUnitId(),y=(w=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!T||!y)return;const I={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},_={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};m.Range.foreach(u,(b,R)=>{const h=m.Rectangle.getPositionRange({startRow:b,startColumn:R,endColumn:R,endRow:b},I),i=m.Rectangle.getPositionRange({startRow:b,startColumn:R,endColumn:R,endRow:b},_),{row:s,col:d}=p(h.startRow,h.startColumn),C=this._conditionalFormattingViewModel.getCellCfs(T,y,s,d),{row:l,col:g}=p(i.startRow,i.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(T,y,l,g);f&&f.forEach(v=>{let D=S.get(v.cfId);if(!S.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(T,y,v.cfId);if(!U)return;D=new m.ObjectMatrix,U.ranges.forEach(z=>{m.Range.foreach(z,(V,O)=>{D.setValue(V,O,1)})}),S.set(v.cfId,D)}D.realDeleteValue(l,g)}),C&&C.forEach(v=>{let D=S.get(v.cfId);if(!S.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(T,y,v.cfId);if(!U)return;D=new m.ObjectMatrix,U.ranges.forEach(z=>{m.Range.foreach(z,(V,O)=>{D.setValue(V,O,1)})}),S.set(v.cfId,D)}D.setValue(l,g,1)})})},r=(a,o)=>{var i,s,d;const u=(i=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),S=(d=(s=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,T=[],y=[];if(!u||!S)return t();const I=de.virtualizeDiscreteRanges([a,o]),[_,w]=I.ranges,{mapFunc:b}=I,R={row:_.startRow,col:_.startColumn};return de.getAutoFillRepeatRange(_,w).forEach(C=>{e(R,C.repeatStartCell,C.relativeRange,p,b)}),p.forEach((C,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,S,l);if(!g)return;const f=q.findAllRectangle(q.createTopMatrixFromMatrix(C));if(f.length){const v={unitId:u,subUnitId:S,rule:{...g,ranges:f}};T.push({id:c.SetConditionalRuleMutation.id,params:v}),y.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:S,cfId:g.cfId};T.push({id:c.DeleteConditionalRuleMutation.id,params:v}),y.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:y,redos:T}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===de.APPLY_TYPE.COPY||u===de.APPLY_TYPE.ONLY_FORMAT||u===de.APPLY_TYPE.SERIES){const{source:S,target:p}=a;return r(S,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};jt=ho([gt(0,m.Inject(m.Injector)),gt(1,m.Inject(m.IUniverInstanceService)),gt(2,m.Inject(de.IAutoFillService)),gt(3,m.Inject(c.ConditionalFormattingRuleModel)),gt(4,m.Inject(c.ConditionalFormattingViewModel))],jt);var go=Object.defineProperty,mo=Object.getOwnPropertyDescriptor,vo=(t,e,r,n)=>{for(var a=n>1?void 0:n?mo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&go(e,r,a),a},mt=(t,e)=>(r,n)=>e(r,n,t);$.ConditionalFormattingClearController=class extends m.Disposable{constructor(e,r,n,a,o){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const r=[],n=[],a={redos:r,undos:n};if([q.ClearSelectionFormatCommand.id,q.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(b=>b.range);if(!u)return a;const S=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),p=S.getActiveSheet();if(!p)return a;const T=S.getUnitId(),y=p.getSheetId(),I=this._conditionalFormattingRuleModel.getSubunitRules(T,y);if(!I||!I.length)return a;const{redos:_,undos:w}=Pr(this._injector,I,u,T,y);r.push(..._),n.push(...w)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const a=[],o=[],u={redos:a,undos:o};if(!n||!n.length)return u;const S=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!S||!S.length)return u;const{redos:p,undos:T}=Pr(this._injector,S,n,e,r);return a.push(...p),o.push(...T),u}}))}},$.ConditionalFormattingClearController=vo([mt(0,m.Inject(m.Injector)),mt(1,m.Inject(m.IUniverInstanceService)),mt(2,m.Inject(q.SheetInterceptorService)),mt(3,m.Inject(q.SheetsSelectionsService)),mt(4,m.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Pr(t,e,r,n,a){const o=[],u=[];return e.filter(S=>r.some(p=>S.ranges.some(T=>m.Rectangle.getIntersects(T,p)))).forEach(S=>{const T=new q.RangeMergeUtil().add(...S.ranges).subtract(...r).merge();if(T.length){const y={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...S,ranges:T}}},I=c.setConditionalRuleMutationUndoFactory(t,y.params);o.push(y),u.push(...I)}else{const y={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:S.cfId}},I=c.DeleteConditionalRuleMutationUndoFactory(t,y.params);o.push(y),u.push(...I)}}),{redos:o,undos:u}}var yo=Object.defineProperty,So=Object.getOwnPropertyDescriptor,bo=(t,e,r,n)=>{for(var a=n>1?void 0:n?So(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&yo(e,r,a),a},Mr=(t,e)=>(r,n)=>e(r,n,t);let Wt=class extends m.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(m.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var u,S,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=n==null?void 0:n.style)!=null?u:{},o=Object.keys(a);if(t!=null&&t.p)return(p=(S=t.p.body)==null?void 0:S.textRuns)==null||p.forEach(T=>{T.ts&&o.forEach(y=>{var I;(I=T.ts)==null||delete I[y]})}),r(t);{const T={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(I=>{delete T[I]});const y={...t,s:{...T}};return r(y)}}})))}};Wt=bo([Mr(0,m.Inject(q.SheetInterceptorService)),Mr(1,m.Inject(c.ConditionalFormattingService))],Wt);const Dr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],vt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],Co=t=>{const e=t.get(q.SheetsSelectionsService),r=t.get(m.ICommandService),n=t.get(m.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(T=>{const y=r.onCommandExecuted(I=>{var R;const{id:_,params:w}=I,b=(R=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(_)&&w.unitId===b&&T.next(null)});return()=>y.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var R;const T=((R=e.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],y=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!y)return;const I=y.getActiveSheet();if(!I)return;const b=(a.getSubunitRules(y.getUnitId(),I.getSheetId())||[]).filter(h=>h.ranges.some(i=>T.some(s=>m.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(t,y.getUnitId(),I.getSheetId(),h));p.next(b)})),u=new Ce.Observable(p=>new Ce.Observable(T=>{const y=r.onCommandExecuted(I=>{var R;const{id:_,params:w}=I,b=(R=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(_)&&w.unitId===b&&T.next(null)});return()=>y.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const T=n.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET);if(!T)return;const y=T.getActiveSheet();if(!y)return;const I=a.getSubunitRules(T.getUnitId(),y.getSheetId())||[];if(!I.length)return p.next(!1),!1;const _=I.map(w=>w.ranges).every(w=>q.checkRangesEditablePermission(t,T.getUnitId(),y.getSheetId(),w));p.next(_)})),S=new Ce.Observable(p=>{o.subscribe(T=>{const y=vt.find(I=>I.value===ve.clearRangeRules);y&&(y.disabled=!T,p.next(vt))}),u.subscribe(T=>{const y=vt.find(I=>I.value===ve.clearWorkSheetRules);y&&(y.disabled=!T,p.next(vt))}),p.next(vt)});return{id:ut.id,type:me.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:S,hidden$:me.getMenuHiddenObservable(t,m.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},To={[me.RibbonStartGroup.FORMULAS_INSERT]:{[ut.id]:{order:0,menuItemFactory:Co}}};var Io=Object.defineProperty,wo=Object.getOwnPropertyDescriptor,Ro=(t,e,r,n)=>{for(var a=n>1?void 0:n?wo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Io(e,r,a),a},xr=(t,e)=>(r,n)=>e(r,n,t);let Ht=class extends m.Disposable{constructor(e,r){super();Me(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(To)}};Ht=Ro([xr(0,m.Inject(m.Injector)),xr(1,me.IMenuManagerService)],Ht);var _o=Object.defineProperty,Eo=Object.getOwnPropertyDescriptor,Oo=(t,e,r,n)=>{for(var a=n>1?void 0:n?Eo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&_o(e,r,a),a},Be=(t,e)=>(r,n)=>e(r,n,t);const Po=(t,e)=>{const r=y=>y.endRow-y.startRow+1,n=y=>y.endColumn-y.startColumn+1,a=r(e)%r(t),o=n(e)%n(t),u=Math.floor(r(e)/r(t)),S=Math.floor(n(e)/n(t)),p=[],T={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const y={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:T,startRange:y}),p}for(let y=0;y<u+(a?.1:0);y++)for(let I=0;I<S+(o?.1:0);I++){const _=r(t)*y,w=n(t)*I,b={startRow:_+e.startRow,endRow:_+e.startRow,startColumn:w+e.startColumn,endColumn:w+e.startColumn};let R=T;y===u&&a&&(R={...R},R.endRow=R.endRow-(r(t)-a)),I===S&&o&&(R={...R},R.endColumn=R.endColumn-(n(t)-o)),p.push({repeatRelativeRange:R,startRange:b})}return p};let kt=class extends m.Disposable{constructor(e,r,n,a,o,u){super();Me(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(o,u,S,p,T)=>{const{unitId:y,subUnitId:I}=this._painterConfig,{targetUnitId:_,targetSubUnitId:w}=T,b={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},R={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};m.Range.foreach(S,(h,i)=>{const s=m.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},b),d=m.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},R),C=this._conditionalFormattingViewModel.getCellCfs(y,I,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(_,w,d.startRow,d.startColumn);l&&l.forEach(g=>{let f=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(_,w,g.cfId);if(!v)return;f=new m.ObjectMatrix,v.ranges.forEach(D=>{m.Range.foreach(D,(U,z)=>{f.setValue(U,z,1)})}),p.set(g.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),C&&C.forEach(g=>{const f=p.get(g.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(o,u,S)=>{var s;const{range:p,unitId:T,subUnitId:y}=this._painterConfig,I=o!==T||y!==u,_=new Map,w=[],b=[];if(!o||!u||!T||!y)return e();const R=(s=this._conditionalFormattingRuleModel.getSubunitRules(T,y))!=null?s:[];R==null||R.forEach(d=>{const{ranges:C,cfId:l}=d;if(C.some(g=>m.Rectangle.intersects(p,g))){const g=new m.ObjectMatrix;I||C.forEach(f=>{m.Range.foreach(f,(v,D)=>{g.setValue(v,D,1)})}),_.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return Po(p,S).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:o,targetSubUnitId:u})}),_.forEach((d,C)=>{if(I){const l=this._conditionalFormattingRuleModel.getRule(o,u,C),g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(l)if(g.length){const f={unitId:o,subUnitId:u,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:o,subUnitId:u,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(g.length){const f=this._conditionalFormattingRuleModel.getRule(T,y,C);if(f){const v={unitId:o,subUnitId:u,rule:{...m.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};w.push({id:c.AddConditionalRuleMutation.id,params:v}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(T,y,C);if(!l)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const f={unitId:T,subUnitId:y,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:T,subUnitId:y,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:b,redos:w}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,S,p;switch(o){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const T=(u=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),y=(p=(S=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getActiveSheet())==null?void 0:p.getSheetId(),I=this._sheetsSelectionsService.getCurrentLastSelection(),_=I==null?void 0:I.range;T&&y&&_&&(this._painterConfig={unitId:T,subUnitId:y,range:_});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,S)=>this._painterConfig?n(o,u,S):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};kt=Oo([Be(0,m.Inject(m.Injector)),Be(1,m.Inject(m.IUniverInstanceService)),Be(2,m.Inject(de.IFormatPainterService)),Be(3,m.Inject(q.SheetsSelectionsService)),Be(4,m.Inject(c.ConditionalFormattingRuleModel)),Be(5,m.Inject(c.ConditionalFormattingViewModel))],kt);var Mo=Object.defineProperty,Do=Object.getOwnPropertyDescriptor,xo=(t,e,r,n)=>{for(var a=n>1?void 0:n?Do(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Mo(e,r,a),a},Sn=(t,e)=>(r,n)=>e(r,n,t);let Bt=class extends m.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(m.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),a=this._renderManagerService.getRenderById(n);if(!a)return;const o=a.with(de.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const S=u.skeleton.rowColumnSegment,p=S.endColumn-S.startColumn+1,y=(S.endRow-S.startRow+1)*p*9,I=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,y);this._conditionalFormattingViewModel.setCacheLength(I)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(m.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Bt=xo([Sn(0,m.Inject(c.ConditionalFormattingViewModel)),Sn(1,m.IUniverInstanceService),Sn(2,In.IRenderManagerService)],Bt);var Nr=Object.defineProperty,No=Object.getOwnPropertyDescriptor,Lo=(t,e,r)=>e in t?Nr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Uo=(t,e,r,n)=>{for(var a=n>1?void 0:n?No(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=(n?u(e,r,a):u(a))||a);return n&&a&&Nr(e,r,a),a},bn=(t,e)=>(r,n)=>e(r,n,t),Lr=(t,e,r)=>Lo(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingUIPlugin=class extends m.Plugin{constructor(e=At,r,n,a){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=m.merge({},At,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand()}onStarting(){m.registerDependencies(this._injector,[[ht],[pt],[dt],[jt],[ft],[lt],[Ht],[je],[Wt],[$.ConditionalFormattingClearController],[kt],[Bt]]),m.touchDependencies(this._injector,[[ht]])}onReady(){m.touchDependencies(this._injector,[[Ht],[lt]])}onRendered(){m.touchDependencies(this._injector,[[jt],[$.ConditionalFormattingClearController],[dt],[Wt],[je],[kt],[ft],[pt],[Bt]])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ut,Ke,bt,St,Xe,yt,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Lr($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),Lr($.UniverSheetsConditionalFormattingUIPlugin,"type",m.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=Uo([m.DependentOn(c.UniverSheetsConditionalFormattingPlugin),bn(1,m.Inject(m.Injector)),bn(2,m.Inject(m.ICommandService)),bn(3,m.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=qt,$.AddCfCommand=Xe,$.AddColorScaleConditionalRuleCommand=Xt,$.AddDataBarConditionalRuleCommand=Yt,$.AddDuplicateValuesCfCommand=Kt,$.AddNumberCfCommand=$t,$.AddRankCfCommand=Zt,$.AddTextCfCommand=Jt,$.AddTimePeriodCfCommand=Qt,$.AddUniqueValuesCfCommand=en,$.ClearRangeCfCommand=yt,$.ClearWorksheetCfCommand=Ye,$.DeleteCfCommand=Ke,$.MoveCfCommand=St,$.OpenConditionalFormattingOperator=ut,$.SetCfCommand=bt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
194
185
|
|
|
195
186
|
|
|
196
187
|
// index
|