@univerjs/preset-sheets-conditional-formatting 0.6.1-nightly.202502251606 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/umd/index.js +72 -75
- package/package.json +8 -8
package/lib/umd/index.js
CHANGED
|
@@ -1,185 +1,182 @@
|
|
|
1
1
|
// @univerjs/sheets-conditional-formatting/index
|
|
2
|
-
(function(g,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@univerjs/core"),require("rxjs"),require("rxjs/operators"),require("@univerjs/engine-formula"),require("@univerjs/engine-render"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs","rxjs/operators","@univerjs/engine-formula","@univerjs/engine-render","@univerjs/sheets"],c):(g=typeof globalThis<"u"?globalThis:g||self,c(g.UniverSheetsConditionalFormatting={},g.UniverCore,g.rxjs,g.rxjs.operators,g.UniverEngineFormula,g.UniverEngineRender,g.UniverSheets))})(this,function(g,c,L,J,U,W,S){"use strict";var f0=Object.defineProperty;var m0=(g,c,L)=>c in g?f0(g,c,{enumerable:!0,configurable:!0,writable:!0,value:L}):g[c]=L;var w=(g,c,L)=>m0(g,typeof c!="symbol"?c+"":c,L);var s2;const u2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var M=(r=>(r.beginsWith="beginsWith",r.endsWith="endsWith",r.containsText="containsText",r.notContainsText="notContainsText",r.equal="equal",r.notEqual="notEqual",r.containsBlanks="containsBlanks",r.notContainsBlanks="notContainsBlanks",r.containsErrors="containsErrors",r.notContainsErrors="notContainsErrors",r))(M||{}),x=(r=>(r.today="today",r.yesterday="yesterday",r.tomorrow="tomorrow",r.last7Days="last7Days",r.thisMonth="thisMonth",r.lastMonth="lastMonth",r.nextMonth="nextMonth",r.thisWeek="thisWeek",r.lastWeek="lastWeek",r.nextWeek="nextWeek",r))(x||{}),v=(r=>(r.greaterThan="greaterThan",r.greaterThanOrEqual="greaterThanOrEqual",r.lessThan="lessThan",r.lessThanOrEqual="lessThanOrEqual",r.notBetween="notBetween",r.between="between",r.equal="equal",r.notEqual="notEqual",r))(v||{}),_=(r=>(r.highlightCell="highlightCell",r.dataBar="dataBar",r.colorScale="colorScale",r.iconSet="iconSet",r))(_||{}),p=(r=>(r.uniqueValues="uniqueValues",r.duplicateValues="duplicateValues",r.rank="rank",r.text="text",r.timePeriod="timePeriod",r.number="number",r.average="average",r.formula="formula",r))(p||{}),y=(r=>(r.num="num",r.min="min",r.max="max",r.percent="percent",r.percentile="percentile",r.formula="formula",r))(y||{});const O2="#fff",j2="#000000",$2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),P2=(r,a)=>{switch(r){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(a))return"";break}case"number":return["between","notBetween"].includes(a)?[10,100]:10}return""},W2=(r,a)=>{switch(r){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return a!==void 0?a:10}return""},V=(r,a,n)=>{if(!a)return null;const e=a.findIndex(t=>n(t)===r.id);if(e<0)return null;switch(r.type){case"after":return e+1;case"before":return e-1;case"self":return e}},F2=(r,a,n,e)=>{if(!n)return null;const t=V(r,n,e);let i=V(a,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=V(a,n,e)),a.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},w2=(r,a,n,e)=>{if(r.type==="after"&&["after","before"].includes(a.type))return[r,a];const t={...r},i={...a};if(t.type!=="after"){const s=V(t,n,e);if(s===null)return null;if(s-1<0){const o=n[s+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[s-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const s=V(i,n,e);if(s===null)return null;if(s===0)i.type="before";else if(s-1>=0){const o=e(n[s-1]);i.id=o,i.type="after"}else if(s+1<=n.length-1){const o=e(n[s+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},v2=(r,a)=>{if(["after","before"].includes(a.type)){if(r.type==="after")return[a,r];if(r.type==="before")return[a,{...r,type:"self"}]}return null},q2=(r,a)=>r.id===a.id&&r.type===a.type,E2=()=>`${c.Tools.generateRandomId(8)}`;class b{constructor(){w(this,"_model",new Map);w(this,"_ruleChange$",new L.Subject);w(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(a,n){let e=this.getSubunitRules(a,n);if(!e){e=[];let t=this._model.get(a);t||(t=new Map,this._model.set(a,t)),t.set(n,e)}return e}getRule(a,n,e){const t=this.getSubunitRules(a,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(a){return this._model.get(a)||null}getSubunitRules(a,n){var t;return((t=this._model.get(a))==null?void 0:t.get(n))||null}deleteRule(a,n,e){const t=this.getSubunitRules(a,n);if(t){const i=t.findIndex(o=>o.cfId===e),s=t[i];s&&(t.splice(i,1),this._ruleChange$.next({rule:s,subUnitId:n,unitId:a,type:"delete"}))}}setRule(a,n,e,t){const s=this._ensureList(a,n).find(o=>o.cfId===t);if(s){const o=c.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:a,type:"set",oldRule:o})}}addRule(a,n,e){const t=this._ensureList(a,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:a,type:"add"})}moveRulePriority(a,n,e,t){const i=this._ensureList(a,n),s=V(e,i,l=>l.cfId),o=V(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const h=i[s];h&&(F2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:h,subUnitId:n,unitId:a,type:"sort"}))}createCfId(a,n){return E2()}deleteUnitId(a){this._model.delete(a)}}const H={type:c.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var Z2=Object.getOwnPropertyDescriptor,G2=(r,a,n,e)=>{for(var t=e>1?void 0:e?Z2(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},c2=(r,a)=>(n,e)=>a(n,e,r),R=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(R||{});const H2=r=>{const a=r&&r[0]&&r[0][0];return(a==null?void 0:a.t)===c.CellValueType.BOOLEAN?a.v===c.BooleanNumber.TRUE||a.v===!0:a?a.v:!1};g.ConditionalFormattingFormulaService=class extends c.Disposable{constructor(n,e,t){super();w(this,"_formulaMap",new Map);w(this,"_result$",new L.Subject);w(this,"result$",this._result$.asObservable());this._commandService=n,this._activeDirtyManagerService=e,this._conditionalFormattingRuleModel=t,this._initFormulaCalculationResultChange(),this._initRuleChange()}_initRuleChange(){const n=e=>{switch(e.type){case _.colorScale:return e.config.some(t=>t.value.type===y.formula);case _.dataBar:return[e.config.max,e.config.min].some(t=>t.type===y.formula);case _.iconSet:return e.config.some(t=>t.value.type===y.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:s,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,s.cfId),e.type==="set"&&(n(s.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===U.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const s in e.unitOtherData[t][i]){const o=new c.ObjectMatrix(e.unitOtherData[t][i][s]),h=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!h)continue;const l=h.ranges;if(!l)continue;const u=h.result,d=l[0].startRow,C=l[0].startColumn;o.forValue((F,E,A)=>{u.setValue(d+F,C+E,H2(A))}),h.status=2;const m=this._getAllFormulaResultByCfId(t,i,h.cfId).every(F=>F.status===2);this._result$.next({...h,isAllFinished:m})}}})),this._activeDirtyManagerService.register(H.id,{commandId:H.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}})}_ensureSubunitFormulaMap(n,e){let t=this._formulaMap.get(n);t||(t=new Map,this._formulaMap.set(n,t));let i=t.get(e);return i||(i=new c.RefAlias([],["formulaId","id"]),t.set(e,i)),i}getSubUnitFormulaMap(n,e){var t;return(t=this._formulaMap.get(n))==null?void 0:t.get(e)}registerFormulaWithRange(n,e,t,i,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),h=this.createCFormulaId(t,i);if(o.getValue(h,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:h,ranges:s,formulaId:l,status:3,result:new c.ObjectMatrix});const u={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(U.SetOtherFormulaMutation.id,u,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(H.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const s=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(U.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const h=this.getSubUnitFormulaMap(n,e);if(!h)return{status:1};const l=h.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(s,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return{status:1};const o=s.getValue(this.createCFormulaId(t,i),["id"]);if(!o)return{status:1};if(o.status===2&&o.result)return{result:o.result,status:2}}deleteCache(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return[];if(i){const o=this.createCFormulaId(t,i);return s.deleteValue(o,["id"]),[]}else{const o=s.getValues().filter(h=>h.cfId===t);return o.forEach(h=>{s.deleteValue(h.formulaId,["formulaId"])}),o}}_getAllFormulaResultByCfId(n,e,t){const i=this.getSubUnitFormulaMap(n,e);return i?i.getValues().filter(o=>o.cfId===t):[]}_createFormulaId(n,e){return`sheet.cf_${n}_${e}_${c.Tools.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},g.ConditionalFormattingFormulaService=G2([c2(0,c.Inject(c.ICommandService)),c2(1,c.Inject(U.IActiveDirtyManagerService)),c2(2,c.Inject(b))],g.ConditionalFormattingFormulaService);var T=(r=>(r.preComputingStart="preComputingStart",r.preComputing="preComputing",r.preComputingEnd="preComputingEnd",r.preComputingError="preComputingError",r))(T||{});class z{constructor(a){w(this,"_cache");w(this,"_preComputingStatus$",new L.BehaviorSubject("preComputingStart"));w(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(J.distinctUntilChanged()));w(this,"_preComputingCache");w(this,"_rule");this._context=a,this._cache=new c.LRUMap(a.limit),this._rule=a.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(a){this._cache.limit=a}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(a){this._rule=a,this.resetPreComputingCache()}getCell(a,n){const e=this._createKey(a,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(a,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(a,n,this._getContext()),t=this.getPreComputingResult(a,n),t===null))return this._cache.get(e);if(this._preComputingStatus$.next("preComputingEnd"),this._cache.has(e))return this._cache.get(e);const i=this.getCellResult(a,n,t,this._getContext());return i!==null&&this._setCache(a,n,i),i}setPreComputingCache(a){this._preComputingCache=a}getPreComputingResult(a,n){return this._preComputingCache}_createKey(a,n){return`${a}_${n}`}_setCache(a,n,e){const t=this._createKey(a,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(a=>{a==="preComputingEnd"&&this.clearCache()})}}function X(r,a){return Math.abs(r-a)<Number.EPSILON}const I=r=>[void 0,null].includes(r),B=r=>{var e,t;if(!r)return null;if(r.t===c.CellValueType.BOOLEAN)return r.v===c.BooleanNumber.TRUE?U.BooleanValue.TRUE:U.BooleanValue.FALSE;const a=r.v,n=(t=(e=r.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return I(a)?I(n)?null:n:a},d2=86400;function p2(r,a=!0){if(a&&r>=0){if(r===0)return[1900,1,0];if(r===60)return[1900,2,29];if(r<60)return[1900,r<32?1:2,(r-1)%31+1]}let n=r+68569+2415019;const e=Math.floor(4*n/146097);n=n-Math.floor((146097*e+3)/4);const t=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*t/4)+31;const i=Math.floor(80*n/2447),s=n-Math.floor(2447*i/80);n=Math.floor(i/11);const o=i+2-12*n;return[100*(e-49)+t+n|0,o|0,s|0]}const A2=r=>{let a=r|0;const n=d2*(r-a);let e=Math.floor(n);n-e>.9999&&(e+=1,e===d2&&(e=0,a+=1));const t=e<0?d2+e:e,[i,s,o]=p2(r,!0),h=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,u=Math.floor(t)%60;return c.dayjs(`${i}/${s}/${o} ${h}:${l}:${u}`).valueOf()},Y=(r,a,n)=>{switch(r.type){case y.max:{let e=0;return a.forValue((t,i,s)=>{s>e&&(e=s)}),{status:R.SUCCESS,result:e}}case y.min:{let e;return a.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:R.SUCCESS,result:e}}case y.percent:{let e,t;a.forValue((o,h,l)=>{(e===void 0||t===void 0)&&(e=l,t=l),l>e&&(e=l),l<t&&(t=l)});const i=(e||0)-(t||0),s=Math.max(Math.min(Number(r.value)||0,100),0);return{status:R.SUCCESS,result:i*(s/100)+(t||0)}}case y.percentile:{const e=a.toNativeArray().sort((l,u)=>l-u),t=Math.max(Math.min(Number(r.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,h=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:R.SUCCESS,result:h}}case y.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(r.value),h=e.get(g.ConditionalFormattingFormulaService);return h.registerFormulaWithRange(t,i,s,o),h.getFormulaResultWithCoords(t,i,s,o)}case y.num:{const e=Number(r.value);return{status:R.SUCCESS,result:Number.isNaN(e)?0:e}}}},X2=(r,a,n,e)=>{const{accessor:t}=e,i=t.get(g.ConditionalFormattingViewModel),s=new c.ObjectMatrix;return n.ranges.forEach(o=>{c.Range.foreach(o,(h,l)=>{const u=i.getCellCfs(r,a,h,l);if(u){const d=u.find(C=>C.cfId===n.cfId);d!=null&&d.result&&s.setValue(h,l,d.result)}})}),s},q=(r,a)=>{switch(r.operator){case v.between:{if(typeof r.value!="object"||!r.value.length)return;const n=Math.min(...r.value),e=Math.max(...r.value);return a>=n&&a<=e}case v.notBetween:{if(typeof r.value!="object"||!r.value.length)return;const n=Math.min(...r.value),e=Math.max(...r.value);return!(a>=n&&a<=e)}case v.equal:{const n=r.value||0;return X(n,a)}case v.notEqual:{const n=r.value||0;return!X(n,a)}case v.greaterThan:{const n=r.value||0;return a>n}case v.greaterThanOrEqual:{const n=r.value||0;return a>=n}case v.lessThan:{const n=r.value||0;return a<n}case v.lessThanOrEqual:{const n=r.value||0;return a<=n}default:return!1}},_2=r=>{switch(r){case v.greaterThan:return v.lessThanOrEqual;case v.greaterThanOrEqual:return v.lessThan;case v.lessThan:return v.greaterThanOrEqual;case v.lessThanOrEqual:return v.greaterThan}return r},y2=(r,a)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=r.findIndex(i=>i.value>=a),t=e-1;if(e===0)return r[0].color.toRgbString();if(t>=0){const i=r[t],s=r[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),h=n(s.color.toRgb()),l=s.value-i.value,u=(a-i.value)/l,d=["r","g","b","a"].reduce((f,m)=>{const F=o[m];return f[m]=(h[m]-F)*u+F,f},{});return new c.ColorKit(d).toRgbString()}}else return r[r.length-1].color.toRgbString()},Q=(r,a,n)=>r.map(e=>{if(e.startColumn>n||e.startRow>a)return null;const t={...e};return t.endRow=Math.min(t.endRow,a),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function Y2(r){let a=0;return new c.ObjectMatrix(r).forValue((n,e,t)=>{a=Math.max(Number.isNaN(a)?0:a,Number(t))}),a}class K2 extends z{preComputing(a,n,e){const t=e.rule,i=e.worksheet,s=new c.ObjectMatrix;!t.rule.config.every(u=>u.value.type===y.num)&&Q(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(d=>{c.Range.foreach(d,(C,f)=>{const m=e.getCellValue(C,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&s.setValue(C,f,E)}})});const h=[...t.rule.config].sort((u,d)=>u.index-d.index).map(u=>({value:Y(u.value,s,{...e,cfId:t.cfId}),color:new c.ColorKit(u.color)}));if(!h.some(u=>W.isObject(u.value)?u.value.status!==R.SUCCESS:!1)){const u=h.map(d=>d.color).reduce((d,C,f)=>(d.result.push({color:C,value:d.sortValue[f]}),d),{result:[],sortValue:h.map(d=>d.value.result).sort((d,C)=>d-C)}).result;this.setPreComputingCache(u),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=t.getCellValue(a,n);if(i.t===c.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return y2(e,s)}}}const M2="sheet-conditional-rule-data-bar",h2="#ffbe38",g2="#abd91a",x2="#000",J2=34;class R2 extends W.SheetExtension{constructor(){super(...arguments);w(this,"_paddingRightAndLeft",2);w(this,"_paddingTopAndBottom",2);w(this,"uKey",M2);w(this,"Z_INDEX",J2);w(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!s.getRowVisible(o)||!s.getColVisible(h))return;const l=s.getCell(o,h);if(l&&l.dataBar){const{color:u,value:d,startPoint:C,isGradient:f}=l.dataBar,m=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:F,isMergedMainCell:E,mergeInfo:A,startY:k,endY:N,startX:O,endX:a2}=m;if(F||(E&&(k=A.startY,N=A.endY,O=A.startX,a2=A.endX),!this.isRenderDiffRangesByCell(A,i)))return;const l2=a2-O,m2=N+W.FIX_ONE_PIXEL_BLUR_OFFSET-k,o2=l2-this._paddingRightAndLeft*2,V2=m2-this._paddingTopAndBottom*2;if(d>0){const G=Math.max(o2*(1-C/100)*d/100,1),j=O+this._paddingRightAndLeft+C/100*o2,$=k+this._paddingTopAndBottom;if(f){const P=n.createLinearGradient(j,$,j+G,$);P.addColorStop(0,u),P.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=P,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,$,G,V2,!1,!0,!0,!1),f&&n.stroke()}else{const G=Math.max(o2*C/100*Math.abs(d)/100,1),j=O+this._paddingRightAndLeft+C/100*o2-G,$=k+this._paddingTopAndBottom;if(f){const P=n.createLinearGradient(j,$,j+G,$);P.addColorStop(0,"rgb(255 255 255)"),P.addColorStop(1,u),n.fillStyle=P,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,$,G,V2,!0,!1,!1,!0),f&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,h,l,u){const d=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+d,t),n.lineTo(e+i-d,t),h?n.arcTo(e+i,t,e+i,t+d,d):n.lineTo(e+i,t),n.lineTo(e+i,t+s-d),l?n.arcTo(e+i,t+s,e+i-d,t+s,d):n.lineTo(e+i,t+s),n.lineTo(e+d,t+s),u?n.arcTo(e,t+s,e,t+s-d,d):n.lineTo(e,t+s),n.lineTo(e,t+d),o?n.arcTo(e,t,e+d,t,d):n.lineTo(e,t),n.closePath(),n.fill())}}W.SpreadsheetExtensionRegistry.add(R2);const e2=r=>Math.max(Math.min(100,r),0),z2=(r,a,n)=>{const e=n(r,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class Q2 extends z{preComputing(a,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new c.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(f=>f.type===y.num)&&Q(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(m=>{c.Range.foreach(m,(F,E)=>{const A=e.getCellValue(F,E),k=A&&A.v;if(!I(k)&&(A==null?void 0:A.t)===c.CellValueType.NUMBER){const N=Number(k);!Number.isNaN(N)&&o.setValue(F,E,N)}})});const l=Y(i.config.min,o,{...e,cfId:t.cfId}),u=Y(i.config.max,o,{...e,cfId:t.cfId});let d=0,C=0;if(l.status===R.SUCCESS){const f=Number(l.result);d=Number.isNaN(f)?0:f}else{this._preComputingStatus$.next(T.preComputing);return}if(u.status===R.SUCCESS){const f=Number(u.result),m=Number.isNaN(f)?0:f;C=Math.max(m,d),d=Math.min(m,d);let F=50;if(d<0&&C<=0)F=100;else if(d<0&&C>0){const E=Math.abs(C)+Math.abs(d);F=Math.abs(d)/E*100}else d>=0&&C>0&&(F=0);this.setPreComputingCache({min:d,max:C,startPoint:F}),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,u=l.isShowValue,d=l.config.isGradient,C=z2(a,n,t.getCellValue);if(!(C===null||C<i||i===s||s<i)){if(C===0)return{color:x2,startPoint:o,value:0,isGradient:d,isShowValue:u};if(i<0&&s<=0){const f=s-i,m=e2((s-C)/f*100);return m===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-m,isGradient:d,isShowValue:u}}else if(i<0&&s>0)if(C>0){const f=e2(Math.min(C/s,1)*100);return f===0?void 0:{color:l.config.positiveColor||h2,startPoint:o,value:f,isGradient:d,isShowValue:u}}else{const f=e2(Math.min(Math.abs(C)/Math.abs(i),1)*100);return f===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-f,isGradient:d,isShowValue:u}}else if(i>=0&&s>0){const f=s-i,m=0,F=e2((1-(s-C)/f)*100);return F===0?void 0:{color:l.config.positiveColor||h2,startPoint:m,value:F,isGradient:d,isShowValue:u}}}}}class e0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case p.average:{let h=0,l=0;return i.forEach(u=>{c.Range.foreach(u,(d,C)=>{const f=e.getCellValue(d,C),m=B(f||void 0);f&&f.t===c.CellValueType.NUMBER&&m!==void 0&&(h+=Number(m)||0,l++)})}),{value:h/l,type:t.subType}}case p.uniqueValues:case p.duplicateValues:{const h=new Map;return i.forEach(l=>{c.Range.foreach(l,(u,d)=>{const C=e.getCellValue(u,d),f=B(C||void 0);if(f!==void 0){const m=h.get(f);m?h.set(f,m+1):h.set(f,1)}})}),{value:h,type:t.subType}}case p.rank:{const h=[];i.forEach(d=>{c.Range.foreach(d,(C,f)=>{const m=e.getCellValue(C,f),F=B(m||void 0);m&&m.t===c.CellValueType.NUMBER&&F!==void 0&&h.push(Number(F)||0)})}),h.sort((d,C)=>C-d);const l=e.rule.rule,u=l.isPercent?Math.floor(Math.max(Math.min(l.value,100),0)/100*h.length):Math.floor(Math.max(Math.min(l.isBottom?l.value-1:l.value,h.length),0));return l.isBottom?{value:h[h.length-u-1],type:t.subType}:{value:h[Math.max(u-1,0)],type:t.subType}}case p.formula:{const h=t,l=e.accessor.get(g.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,h.value,e.rule.ranges);const u=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,h.value);return u&&u.status===R.SUCCESS?(this._preComputingStatus$.next(T.preComputingEnd),{value:u.result,type:t.subType}):(this._preComputingStatus$.next(T.preComputing),null)}case p.timePeriod:switch(t.operator){case x.last7Days:return{value:{start:c.dayjs().subtract(7,"day").valueOf(),end:c.dayjs().valueOf()},type:t.subType};case x.lastMonth:return{value:{start:c.dayjs().startOf("month").subtract(1,"month").valueOf(),end:c.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case x.lastWeek:return{value:{start:c.dayjs().startOf("week").subtract(1,"week").valueOf(),end:c.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case x.nextMonth:return{value:{start:c.dayjs().startOf("month").add(1,"month").valueOf(),end:c.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case x.nextWeek:return{value:{start:c.dayjs().startOf("week").add(1,"week").valueOf(),end:c.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case x.thisMonth:return{value:{start:c.dayjs().startOf("month").valueOf(),end:c.dayjs().endOf("month").valueOf()},type:t.subType};case x.thisWeek:return{value:{start:c.dayjs().startOf("week").valueOf(),end:c.dayjs().endOf("week").valueOf()},type:t.subType};case x.today:return{value:{start:c.dayjs().startOf("day").valueOf(),end:c.dayjs().endOf("day").valueOf()},type:t.subType};case x.tomorrow:return{value:{start:c.dayjs().startOf("day").add(1,"day").valueOf(),end:c.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case x.yesterday:return{value:{start:c.dayjs().startOf("day").subtract(1,"day").valueOf(),end:c.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(a,n,e,t){const i=t.getCellValue(a,n),s=t.rule.rule;return(()=>{switch(s.subType){case p.number:{const l=i&&Number(i.v),u=(i==null?void 0:i.t)===c.CellValueType.NUMBER,d=s;return u?I(l)||Number.isNaN(l)?void 0:q({operator:d.operator,value:d.value||0},l||0):!![v.notEqual,v.notBetween].includes(d.operator)}case p.text:{const l=s,u=B(i),d=u===null?"":String(u),C=l.value||"";switch(l.operator){case M.beginsWith:return d.startsWith(C);case M.containsBlanks:return/^\s*$/.test(d);case M.notContainsBlanks:return!/^\s*$/.test(d);case M.containsErrors:return U.ERROR_TYPE_SET.has(d);case M.notContainsErrors:return!U.ERROR_TYPE_SET.has(d);case M.containsText:return d.indexOf(C)>-1;case M.notContainsText:return d.indexOf(C)===-1;case M.endsWith:return d.endsWith(C);case M.equal:return d===C;case M.notEqual:return d!==C;default:return!1}}case p.timePeriod:{const l=B(i);if(I(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return;const u=A2(Number(l)),{start:d,end:C}=e.value;return u>=d&&u<=C}case p.average:{const l=i&&i.v,u=Number(l),d=(i==null?void 0:i.t)===c.CellValueType.NUMBER,C=s;if(!d)return v.notEqual===C.operator;if(I(l)||Number.isNaN(u)||!e)return!1;const f=e.value;switch(C.operator){case v.greaterThan:return u>f;case v.greaterThanOrEqual:return u>=f;case v.lessThan:return u<f;case v.lessThanOrEqual:return u<=f;case v.equal:return X(u,f);case v.notEqual:return!X(u,f);default:return!1}}case p.rank:{const l=B(i),u=Number(l);if(I(l)||Number.isNaN(u)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return!1;const d=e.value;return s.isBottom?u<=d:u>=d}case p.uniqueValues:{const l=B(i);return I(l)||!e?!1:e.value.get(l)===1}case p.duplicateValues:{const l=B(i);return I(l)||!e?!1:e.value.get(l)!==1}case p.formula:{const l=e==null?void 0:e.value;return l?l.getValue(a,n)===!0:!1}}})()?s.style:{}}}const t0=(r,a,n)=>{const e=n(r,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class n0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.worksheet,s=new c.ObjectMatrix;!t.config.every(u=>u.value.type===y.num)&&Q(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(d=>{c.Range.foreach(d,(C,f)=>{const m=e.getCellValue(C,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&s.setValue(C,f,E)}})});const h=t.config.map(u=>Y(u.value,s,{...e,cfId:e.rule.cfId}));if(!h.some(u=>u.status!==R.SUCCESS)){const u=h.map((d,C)=>({operator:t.config[C].operator,value:Number(d.result)||0})).reduce((d,C,f,m)=>{const F=t.config[f];if(!f||f===m.length-1)d.push({...C,iconId:F.iconId,iconType:F.iconType});else{const E=m[f-1];q(E,C.value)||d.push({...C,iconId:F.iconId,iconType:F.iconType})}return d},[]);this.setPreComputingCache(u),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=t0(a,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let h=0;h<e.length;h++){const l=e[h],u={...l},d={...l},{iconId:C,iconType:f}=l;if(h===0){if(q(l,i))return{iconId:C,iconType:f,isShowValue:o}}else{if(h===e.length-1)return{iconId:C,iconType:f,isShowValue:o};{const m=e[h-1];if(d.operator=_2(m.operator),d.value=m.value,q(u,i)&&q(d,i))return{iconId:C,iconType:f,isShowValue:o}}}}}}var i0=Object.getOwnPropertyDescriptor,r0=(r,a,n,e)=>{for(var t=e>1?void 0:e?i0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},t2=(r,a)=>(n,e)=>a(n,e,r);const n2=50*20*3*3;g.ConditionalFormattingViewModel=class extends c.Disposable{constructor(n,e,t,i){super();w(this,"_calculateUnitManagers",new Map);w(this,"_rTreeManager",new c.RTree);w(this,"_cellCache",new c.LRUMap(n2));w(this,"_markDirty$",new L.Subject);w(this,"markDirty$",this._markDirty$.asObservable());w(this,"_markRuleDirtyAtOnce",(n,e,t,i=!0)=>{if(this._cellCache.clear(),i){const o=this._ensureCalculateUnitManager(n,e).get(t);o&&o.resetPreComputingCache()}this._markDirty$.next({unitId:n,subUnitId:e,cfId:t})});w(this,"markRuleDirty",(()=>{const n=new L.Subject;return this.disposeWithMe(n.pipe(J.bufferTime(100),J.filter(e=>!!e.length),J.map(e=>{const t=new Set,i=[];return e.forEach(s=>{const o=`${s.unitId}_${s.subUnitId}_${s.cfId}`;if(t.has(o)){if(s.isNeedResetPreComputingCache){const h=i.find(l=>l.cfId===s.cfId);h.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...s})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,s=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:s})}})());this._injector=n,this._conditionalFormattingRuleModel=e,this._conditionalFormattingFormulaService=t,this._univerInstanceService=i,this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:n,subUnitId:e,cfId:t,isAllFinished:i})=>{i&&this._markRuleDirtyAtOnce(n,e,t,i)}))}getCellCfs(n,e,t,i){const s=this._createCacheKey(n,e,t,i);if(this._cellCache.has(s))return this._cellCache.get(s);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(s,o),o}_getCellCfs(n,e,t,i){var d;const s=(d=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?d:[],o=this._ensureCalculateUnitManager(n,e),h=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(C=>h.has(C.cfId));return l.length?l.map(C=>{const f=o.get(C.cfId);return f?{cfId:C.cfId,result:f.getCell(t,i)}:null}).filter(C=>!!C).map((C,f)=>({...C,priority:f})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===_.highlightCell&&i.rule.subType===p.formula&&this._conditionalFormattingFormulaService.deleteCache(e,t,i.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:e,subUnitId:t,rule:i}=n,{cfId:s,ranges:o}=i,h=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:s,range:u})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;h.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),h.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(u=>({unitId:e,sheetId:t,id:l.cfId,range:u}))),this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:s,range:u}))),l.rule.type!==i.rule.type){const u=this._createRuleCalculateUnitInstance(e,t,i);if(!u)return;h.delete(l.cfId),h.set(i.cfId,u)}else{const u=h.get(l.cfId);if(!u)return;u.updateRule(i)}}}}))}_ensureCalculateUnitManager(n,e){let t=this._calculateUnitManagers.get(n);t||(t=new Map,this._calculateUnitManagers.set(n,t));let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_createRuleCalculateUnitInstance(n,e,t){const i=this._univerInstanceService.getUnit(n),s=i==null?void 0:i.getSheetBySheetId(e);if(!i||!s)return;const o={workbook:i,worksheet:s,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:n2,getCellValue:(h,l)=>s.getCellRaw(h,l)||{}};switch(t.rule.type){case _.colorScale:return new K2(o);case _.dataBar:return new Q2(o);case _.highlightCell:return new e0(o);case _.iconSet:return new n0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=n2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},g.ConditionalFormattingViewModel=r0([t2(0,c.Inject(c.Injector)),t2(1,c.Inject(b)),t2(2,c.Inject(g.ConditionalFormattingFormulaService)),t2(3,c.IUniverInstanceService)],g.ConditionalFormattingViewModel);const D={feedback:{mistake:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.87359%206.87332C6.6146%207.13231%206.6146%207.55221%206.87359%207.8112L9.062%209.99961L6.87356%2012.188C6.61457%2012.447%206.61457%2012.8669%206.87356%2013.1259C7.13255%2013.3849%207.55245%2013.3849%207.81144%2013.1259L9.99987%2010.9375L12.1882%2013.1258C12.4472%2013.3848%2012.8671%2013.3848%2013.1261%2013.1258C13.3851%2012.8669%2013.3851%2012.447%2013.1261%2012.188L10.9378%209.99961L13.1261%207.81127C13.3851%207.55228%2013.3851%207.13238%2013.1261%206.87339C12.8671%206.61441%2012.4472%206.61441%2012.1882%206.87339L9.99987%209.06173L7.81147%206.87332C7.55248%206.61433%207.13257%206.61433%206.87359%206.87332Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Cpath%20d%3D%22M9.16817%206.67735C9.16646%206.61745%209.1656%206.5875%209.16653%206.56236C9.18103%206.16817%209.49136%205.84883%209.88497%205.82306C9.91008%205.82141%209.94004%205.82141%209.99996%205.82141V5.82141C10.0599%205.82141%2010.0899%205.82141%2010.115%205.82306C10.5086%205.84883%2010.8189%206.16817%2010.8334%206.56236C10.8343%206.5875%2010.8335%206.61745%2010.8318%206.67735L10.7043%2011.131C10.6934%2011.5121%2010.3812%2011.8154%209.99995%2011.8154V11.8154C9.61866%2011.8154%209.30655%2011.5121%209.29564%2011.131L9.16817%206.67735Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3Crect%20x%3D%229.31488%22%20y%3D%2212.8086%22%20width%3D%221.37006%22%20height%3D%221.37006%22%20rx%3D%220.685032%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.037%2010C17.037%2013.8865%2013.8864%2017.0371%209.99999%2017.0371C6.11354%2017.0371%202.96295%2013.8865%202.96295%2010C2.96295%206.1136%206.11354%202.96301%209.99999%202.96301C13.8864%202.96301%2017.037%206.1136%2017.037%2010Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3Cpath%20d%3D%22M13.9239%207.17477C13.6638%206.91472%2013.2422%206.91472%2012.9821%207.17477L8.74433%2011.4126L7.01786%209.6861C6.75781%209.42606%206.33619%209.42606%206.07614%209.6861C5.81609%209.94615%205.81609%2010.3678%206.07614%2010.6278L8.27349%2012.8252C8.53354%2013.0852%208.95516%2013.0852%209.21521%2012.8252L9.2195%2012.8209L13.9239%208.1165C14.1839%207.85645%2014.1839%207.43482%2013.9239%207.17477Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A"},star:{starEmpty:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",starIncomplete:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_177)%22%3E%0A%3Cmask%20id%3D%22mask0_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2210%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20x%3D%2210.3704%22%20y%3D%220.37037%22%20width%3D%229.25926%22%20height%3D%2219.2593%22%20fill%3D%22%23C4C4C4%22%20stroke%3D%22%23F7D564%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3Cmask%20id%3D%22mask1_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20width%3D%2210%22%20height%3D%2220%22%20fill%3D%22%23C4C4C4%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask1_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_177%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A",starFull:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A"},progress:{progress0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M16.2963%209.99991C16.2963%209.17307%2016.1335%208.35432%2015.8171%207.59042C15.5006%206.82652%2015.0369%206.13242%2014.4522%205.54776C13.8675%204.96309%2013.1734%204.49931%2012.4095%204.18289C11.6456%203.86647%2010.8269%203.70361%2010%203.70361L10%209.99991H16.2963Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M10%2016.2962C11.6699%2016.2962%2013.2714%2015.6328%2014.4522%2014.4521C15.633%2013.2713%2016.2963%2011.6698%2016.2963%209.99991C16.2963%208.33003%2015.633%206.72854%2014.4522%205.54776C13.2714%204.36697%2011.6699%203.70361%2010%203.70361L10%209.99991L10%2016.2962Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M3.70374%209.99991C3.70374%2011.2452%204.07301%2012.4625%204.76485%2013.4979C5.4567%2014.5334%206.44005%2015.3404%207.59054%2015.8169C8.74104%2016.2935%2010.007%2016.4182%2011.2284%2016.1752C12.4497%2015.9323%2013.5716%2015.3326%2014.4522%2014.4521C15.3327%2013.5715%2015.9324%2012.4496%2016.1753%2011.2283C16.4183%2010.0069%2016.2936%208.74092%2015.8171%207.59042C15.3405%206.43992%2014.5335%205.45658%2013.4981%204.76473C12.4626%204.07288%2011.2453%203.70361%2010%203.70361L10%209.99991L3.70374%209.99991Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99991%22%20r%3D%226.2963%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A"},signal:{signal0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93933%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70447%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feeling:{guffaw:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.887%2010C16.887%2013.8037%2013.8036%2016.8871%209.99999%2016.8871C6.19638%2016.8871%203.11295%2013.8037%203.11295%2010C3.11295%206.19644%206.19638%203.11301%209.99999%203.11301C13.8036%203.11301%2016.887%206.19644%2016.887%2010Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M12.5355%2013.5821C13.0482%2013.1841%2013.3951%2012.6107%2013.5405%2012.0327C13.5934%2011.8226%2013.5051%2011.6349%2013.3518%2011.5331C13.2036%2011.4346%2013.0031%2011.4203%2012.8265%2011.5131C11.0615%2012.4407%208.94609%2012.4427%207.1828%2011.513C7.00629%2011.4199%206.80602%2011.4343%206.65798%2011.5329C6.50518%2011.6346%206.41701%2011.8217%206.46844%2012.0312C6.61029%2012.609%206.95079%2013.1833%207.46449%2013.5821C8.14361%2014.1093%209.05608%2014.3999%2010%2014.3999C10.9439%2014.3999%2011.8564%2014.1093%2012.5355%2013.5821Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A",smile:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2011.8518C7.03705%2011.8518%207.77779%2013.7037%2010%2013.7037C12.2222%2013.7037%2012.963%2011.8518%2012.963%2011.8518%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",noninductive:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2012.5927C7.03705%2012.5927%208.14816%2012.5927%2010.3704%2012.5927C12.5926%2012.5927%2012.963%2012.5927%2012.963%2012.5927%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",dissatisfied:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2013.7037C7.03705%2013.7037%207.77779%2011.8519%2010%2011.8519C12.2222%2011.8519%2012.963%2013.7037%2012.963%2013.7037%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",impatient:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.47573%2011.731C6.96306%2012.129%206.61613%2012.7024%206.47071%2013.2804C6.41784%2013.4905%206.50617%2013.6782%206.65942%2013.78C6.80761%2013.8785%207.00813%2013.8928%207.18477%2013.8C8.9498%2012.8724%2011.0652%2012.8704%2012.8285%2013.8002C13.005%2013.8932%2013.2052%2013.8788%2013.3533%2013.7802C13.5061%2013.6785%2013.5942%2013.4914%2013.5428%2013.2819C13.401%2012.7041%2013.0605%2012.1298%2012.5468%2011.731C11.8676%2011.2038%2010.9552%2010.9132%2010.0112%2010.9132C9.06732%2010.9132%208.15485%2011.2038%207.47573%2011.731Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A"},arrow:JSON.parse('{"down-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","down-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A"}'),shape:{cross:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%223.70374%22%20y%3D%228.14795%22%20width%3D%2212.5926%22%20height%3D%223.7037%22%20rx%3D%220.740741%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",up:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M9.44533%205.81157C9.74012%205.47858%2010.2598%205.47858%2010.5546%205.81157L16.2868%2012.2867C16.71%2012.7647%2016.3706%2013.5184%2015.7322%2013.5184H4.26776C3.62933%2013.5184%203.28995%2012.7647%203.71313%2012.2867L9.44533%205.81157Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A",down:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.5547%2014.1884C10.2599%2014.5214%209.74019%2014.5214%209.4454%2014.1884L3.71321%207.71335C3.29002%207.23532%203.6294%206.48161%204.26784%206.48161L15.7322%206.48161C16.3707%206.48161%2016.7101%207.23532%2016.2869%207.71335L10.5547%2014.1884Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","rhomboid-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2.1415%2011.1984C1.8412%2010.9074%201.8412%2010.4256%202.1415%2010.1346L9.48467%203.01785C9.77196%202.73942%2010.2284%202.73942%2010.5157%203.01786L17.8586%2010.1346C18.1589%2010.4256%2018.1589%2010.9074%2017.8586%2011.1984L10.5157%2018.3151C10.2284%2018.5936%209.77196%2018.5936%209.48467%2018.3152L2.1415%2011.1984Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-pink":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FB9D9D%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-black":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A","triangle-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_237)%22%3E%0A%3Cpath%20d%3D%22M9.32308%204.41301C9.58368%203.82623%2010.4164%203.82623%2010.677%204.413L15.9526%2016.2917C16.1701%2016.7815%2015.8115%2017.3331%2015.2756%2017.3331H4.72454C4.18858%2017.3331%203.83002%2016.7815%204.04756%2016.2917L9.32308%204.41301Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_237%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A","indicate-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feedback2:{mistake2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.12194%206.33702C4.1805%206.47839%204.30722%206.6051%204.56066%206.85854L8.36822%2010.6661L4.56062%2014.4737C4.30718%2014.7272%204.18046%2014.8539%204.12191%2014.9952C4.04384%2015.1837%204.04384%2015.3955%204.12191%2015.584C4.18046%2015.7253%204.30718%2015.8521%204.56062%2016.1055C4.81406%2016.3589%204.94078%2016.4857%205.08214%2016.5442C5.27062%2016.6223%205.4824%2016.6223%205.67089%2016.5442C5.81225%2016.4857%205.93897%2016.3589%206.19241%2016.1055L10%2012.2979L13.8074%2016.1053C14.0609%2016.3588%2014.1876%2016.4855%2014.329%2016.544C14.5174%2016.6221%2014.7292%2016.6221%2014.9177%2016.544C15.0591%2016.4855%2015.1858%2016.3588%2015.4392%2016.1053L15.4392%2016.1053C15.6927%2015.8519%2015.8194%2015.7252%2015.8779%2015.5838C15.956%2015.3953%2015.956%2015.1835%2015.8779%2014.9951C15.8194%2014.8537%2015.6927%2014.727%2015.4392%2014.4735L15.4392%2014.4735L11.6318%2010.6661L15.4392%206.85872C15.6926%206.60528%2015.8193%206.47856%2015.8779%206.3372C15.956%206.14871%2015.956%205.93694%2015.8779%205.74845C15.8193%205.60709%2015.6926%205.48037%2015.4392%205.22693C15.1857%204.97349%2015.059%204.84677%2014.9177%204.78822C14.7292%204.71015%2014.5174%204.71015%2014.3289%204.78822C14.1876%204.84677%2014.0608%204.97349%2013.8074%205.22693L10%209.03433L6.19244%205.22676C5.939%204.97332%205.81228%204.8466%205.67092%204.78805C5.48244%204.70997%205.27066%204.70997%205.08218%204.78805C4.94082%204.8466%204.8141%204.97332%204.56066%205.22676L4.56066%205.22676C4.30722%205.4802%204.1805%205.60692%204.12194%205.74828C4.04387%205.93676%204.04387%206.14854%204.12194%206.33702Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M8.49778%205.00963C8.48513%204.56774%208.47881%204.3468%208.56086%204.17746C8.63301%204.02856%208.75124%203.90689%208.89802%203.83052C9.06494%203.74365%209.28597%203.74365%209.72805%203.74365H10.272C10.714%203.74365%2010.9351%203.74365%2011.102%203.83052C11.2488%203.9069%2011.367%204.02856%2011.4392%204.17746C11.5212%204.3468%2011.5149%204.56775%2011.5022%205.00964L11.2644%2013.3173C11.2524%2013.737%2011.2464%2013.9468%2011.1609%2014.1065C11.0857%2014.2471%2010.9687%2014.3609%2010.826%2014.432C10.6639%2014.5129%2010.454%2014.5129%2010.0342%2014.5129H9.96582C9.54601%2014.5129%209.33611%2014.5129%209.17397%2014.432C9.0313%2014.3609%208.91426%2014.2471%208.83904%2014.1065C8.75357%2013.9468%208.74756%2013.737%208.73555%2013.3173L8.49778%205.00963Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Crect%20x%3D%228.76917%22%20y%3D%2215.2817%22%20width%3D%222.46154%22%20height%3D%222.46154%22%20rx%3D%220.769231%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_248)%22%3E%0A%3Cpath%20d%3D%22M15.689%205.69723C15.5476%205.75578%2015.4209%205.8825%2015.1675%206.13594L7.82436%2013.4791L4.83279%2010.4875C4.57935%2010.2341%204.45263%2010.1073%204.31127%2010.0488C4.12278%209.97071%203.91101%209.97071%203.72252%2010.0488C3.58116%2010.1073%203.45444%2010.2341%203.201%2010.4875C2.94756%2010.7409%202.82084%2010.8676%202.76229%2011.009C2.68422%2011.1975%202.68422%2011.4093%202.76229%2011.5978C2.82084%2011.7391%202.94756%2011.8658%203.201%2012.1193L7.0085%2015.9268C7.26194%2016.1802%207.38866%2016.3069%207.53002%2016.3655C7.7185%2016.4436%207.93028%2016.4436%208.11876%2016.3655C8.26013%2016.3069%208.38685%2016.1802%208.64028%2015.9268C8.66387%2015.9032%208.68636%2015.8807%208.7078%2015.8592L16.7993%207.76772C17.0527%207.51428%2017.1794%207.38756%2017.238%207.2462C17.3161%207.05772%2017.3161%206.84594%2017.238%206.65746C17.1794%206.5161%2017.0527%206.38938%2016.7993%206.13594C16.5458%205.8825%2016.4191%205.75578%2016.2777%205.69723C16.0893%205.61915%2015.8775%205.61915%2015.689%205.69723Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_248%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A"},flag:{"flag-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},cell:{"cell-0":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-25":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-50":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-75":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-100":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A"}},I2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[D.arrow["up-green"],D.arrow["right-gold"],D.arrow["down-red"]]},{name:"3ArrowsGray",list:[D.arrow["up-gray"],D.arrow["right-gray"],D.arrow["down-gray"]]},{name:"4Arrows",list:[D.arrow["up-green"],D.arrow["rightAndUp-gold"],D.arrow["rightAndDown-gold"],D.arrow["down-red"]]},{name:"4ArrowsGray",list:[D.arrow["up-gray"],D.arrow["rightAndUp-gray"],D.arrow["rightAndDown-gray"],D.arrow["down-gray"]]},{name:"5Arrows",list:[D.arrow["up-green"],D.arrow["rightAndUp-gold"],D.arrow["right-gold"],D.arrow["rightAndDown-gold"],D.arrow["down-red"]]},{name:"5ArrowsGray",list:[D.arrow["up-gray"],D.arrow["rightAndUp-gray"],D.arrow["right-gray"],D.arrow["rightAndDown-gray"],D.arrow["down-gray"]]},{name:"3Triangles",list:[D.shape.up,D.shape.cross,D.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[D.shape["roundness-greed"],D.shape["roundness-gold"],D.shape["roundness-red"]]},{name:"3Signs",list:[D.shape["roundness-greed"],D.shape["triangle-gold"],D.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[D.shape["indicate-greed"],D.shape["indicate-gold"],D.shape["indicate-red"]]},{name:"4RedToBlack",list:[D.shape["roundness-red"],D.shape["roundness-pink"],D.shape["roundness-gray"],D.shape["roundness-black"]]},{name:"4TrafficLights",list:[D.shape["roundness-greed"],D.shape["roundness-gold"],D.shape["roundness-red"],D.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[D.feedback.correct,D.feedback.warn,D.feedback.mistake]},{name:"3Symbols2",list:[D.feedback2.correct2,D.feedback2.warn2,D.feedback2.mistake2]},{name:"3Flags",list:[D.flag["flag-green"],D.flag["flag-gold"],D.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[D.signal.signal25,D.signal.signal50,D.signal.signal75,D.signal.signal100]},{name:"5Rating",list:[D.signal.signal0,D.signal.signal25,D.signal.signal50,D.signal.signal75,D.signal.signal100]},{name:"5Quarters",list:[D.progress.progress100,D.progress.progress75,D.progress.progress50,D.progress.progress25,D.progress.progress0]},{name:"_5Felling",list:[D.feeling.guffaw,D.feeling.smile,D.feeling.noninductive,D.feeling.dissatisfied,D.feeling.impatient]},{name:"5Boxes",list:[D.cell["cell-100"],D.cell["cell-75"],D.cell["cell-50"],D.cell["cell-25"],D.cell["cell-0"]]},{name:"3Stars",list:[D.star.starFull,D.star.starIncomplete,D.star.starEmpty]}]}],K=I2.reduce((r,a)=>{const{group:n}=a;for(const e of n)r[e.name]=e.list;return r},{});for(const r in K){const a=K[r];Object.freeze(a)}const S2="EMPTY_ICON_TYPE",i2={type:c.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=a;return r.get(b).moveRulePriority(n,e,t,i),!0}},s0=r=>{const{unitId:a,subUnitId:n}=r,e=v2(r.start,r.end);if(!e)return[];const[t,i]=e;return[{id:i2.id,params:{unitId:a,subUnitId:n,start:t,end:i}}]},b2=(r,a)=>{const n=r.get(b),{unitId:e,subUnitId:t,cfId:i}=a,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),h=s[o-1];if(o>-1){const l=s[o],u=[{id:C2.id,params:{unitId:e,subUnitId:t,rule:c.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const d=s[0];if(d){const C=w2({id:d.cfId,type:"before"},{id:h.cfId,type:"after"},s,E=>E.cfId);if(!C)return u;const[f,m]=C,F={unitId:e,subUnitId:t,start:f,end:m};u.push({id:i2.id,params:F})}}return u}return[]},r2={type:c.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,cfId:t}=a;return r.get(b).deleteRule(n,e,t),!0}},a0=(r,a)=>({id:r2.id,params:{unitId:a.unitId,subUnitId:a.subUnitId,cfId:a.rule.cfId}}),C2={type:c.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a;return r.get(b).addRule(n,e,t),!0}},D2={type:c.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a,i=a.cfId||a.rule.cfId;return r.get(b).setRule(n,e,t,i),!0}},l0=(r,a)=>{const n=r.get(b),{unitId:e,subUnitId:t}=a,i=a.cfId||a.rule.cfId,s=n.getRule(e,t,i);return s?[{id:D2.id,params:{unitId:e,subUnitId:t,cfId:i,rule:c.Tools.deepClone(s)}}]:[]},o0="ssheets-conditional-formatting.config",L2={};var u0=Object.getOwnPropertyDescriptor,c0=(r,a,n,e)=>{for(var t=e>1?void 0:e?u0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},Z=(r,a)=>(n,e)=>a(n,e,r);g.ConditionalFormattingService=class extends c.Disposable{constructor(a,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=a,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=s,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(g.ConditionalFormattingViewModel)}composeStyle(a,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(a,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(a,n,l.cfId)).filter(l=>!!l).reverse(),o=s.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&s.splice(o+1),s.reduce((l,u)=>{var f;const d=u.rule.type,C=i.find(m=>m.cfId===u.cfId);if(d===_.highlightCell)C.result&&c.Tools.deepMerge(l,{style:C.result});else if(d===_.colorScale){const m=C==null?void 0:C.result;m&&typeof m=="string"&&(l.style={...(f=l.style)!=null?f:{},bg:{rgb:m}})}else if(d===_.dataBar){const m=C==null?void 0:C.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(d===_.iconSet){const m=C==null?void 0:C.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const a=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((s,o)=>{i[o]=s}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:u2,businesses:[c.UniverInstanceType.UNIVER_SHEET],toJson:e=>a(e),parseJson:e=>n(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e)},onLoad:(e,t)=>{Object.keys(t).forEach(i=>{[...t[i]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,i,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:a=>{if(a.id===S.RemoveSheetCommand.id){const n=a.params,e=n.unitId||d0(this._univerInstanceService),t=n.subUnitId||h0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const s=[],o=[];return i.forEach(h=>{const l={unitId:e,subUnitId:t,cfId:h.cfId};s.push({id:r2.id,params:l}),o.push(...b2(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,h])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,h);l==null||l.forEach(u=>s.add(u.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(a.id){case S.SetRangeValuesMutation.id:{const e=a.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new c.ObjectMatrix(s).forValue((l,u,d)=>{d&&Object.keys(d).some(f=>["p","v"].includes(f))&&o.push([l,u])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case S.InsertColMutation.id:case S.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(u=>c.Rectangle.intersects(u,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case S.RemoveRowMutation.id:case S.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(u=>c.Rectangle.intersects(u,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case S.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),h={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(u=>u.ranges.some(d=>c.Rectangle.intersects(d,h))).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,u.cfId)});break}case S.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),h={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(u=>u.ranges.some(d=>c.Rectangle.intersects(d,h))).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,u.cfId)});break}case S.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=a.params,s=o=>{const h=[];new c.ObjectMatrix(o.value).forValue((u,d)=>{h.push([u,d])}),n(e,o.subUnitId,h).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,u.cfId)})};s(t),s(i);break}case S.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(h=>h.ranges.some(l=>c.Rectangle.intersects(l,e))).forEach(h=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,h.cfId)});break}}}))}},g.ConditionalFormattingService=c0([Z(0,c.Inject(b)),Z(1,c.Inject(c.Injector)),Z(2,c.Inject(c.IUniverInstanceService)),Z(3,c.Inject(c.IResourceManagerService)),Z(4,c.Inject(S.SheetInterceptorService)),Z(5,c.Inject(c.ICommandService))],g.ConditionalFormattingService);const d0=r=>r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getUnitId(),h0=r=>{var a;return(a=r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:a.getSheetId()};var g0=Object.getOwnPropertyDescriptor,C0=(r,a,n,e)=>{for(var t=e>1?void 0:e?g0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},f2=(r,a)=>(n,e)=>a(n,e,r);g.UniverSheetsConditionalFormattingPlugin=(s2=class extends c.Plugin{constructor(a=L2,n,e,t){super(),this._config=a,this._injector=n,this._commandService=e,this._configService=t;const{...i}=c.merge({},L2,this._config);this._configService.setConfig(o0,i),[[g.ConditionalFormattingService],[g.ConditionalFormattingFormulaService],[b],[g.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[C2,r2,D2,i2,H].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(g.ConditionalFormattingService),c.touchDependencies(this._injector,[[g.ConditionalFormattingService],[g.ConditionalFormattingViewModel]])}},w(s2,"pluginName",u2),w(s2,"type",c.UniverInstanceType.UNIVER_SHEET),s2),g.UniverSheetsConditionalFormattingPlugin=C0([f2(1,c.Inject(c.Injector)),f2(2,c.Inject(c.ICommandService)),f2(3,c.IConfigService)],g.UniverSheetsConditionalFormattingPlugin);const T2="sheet-conditional-rule-icon",D0=35,k2=15,B2=2;class N2 extends W.SheetExtension{constructor(){super();w(this,"_paddingRightAndLeft",B2);w(this,"_width",k2);w(this,"_imageMap",new Map);w(this,"uKey",T2);w(this,"Z_INDEX",D0);w(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!s.getRowVisible(o)||!s.getColVisible(h))return;const l=s.getCell(o,h);if(l!=null&&l.iconSet){const{iconType:u,iconId:d}=l.iconSet;if(u===S2)return;const C=this._imageMap.get(this._createKey(u,d));if(!C)return;const f=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:m,isMergedMainCell:F,mergeInfo:E,startY:A,endY:k,startX:N,endX:O}=f;if(m||(F&&(A=E.startY,k=E.endY,N=E.startX,O=E.endX),!this.isRenderDiffRangesByCell(E,i)))return;const a2=O-N,l2=k-A;if(this._width>l2||this._width>a2+this._paddingRightAndLeft*2)return;const m2=(l2-this._width)/2+A;n.drawImage(C,N+this._paddingRightAndLeft,m2,this._width,this._width)}}),n.restore()}_init(){for(const n in K)K[n].forEach((t,i)=>{const s=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(s,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}W.SpreadsheetExtensionRegistry.add(N2);function U2(r){if(typeof r!="object"||r===null)return r;const a={};for(const n in r)if(r.hasOwnProperty(n)){const e=U2(r[n]);e!==void 0&&(a[n]=e)}return a}Object.defineProperty(g,"isRangesEqual",{enumerable:!0,get:()=>c.isRangesEqual}),g.AddConditionalRuleMutation=C2,g.AddConditionalRuleMutationUndoFactory=a0,g.CFNumberOperator=v,g.CFRuleType=_,g.CFSubRuleType=p,g.CFTextOperator=M,g.CFTimePeriodOperator=x,g.CFValueType=y,g.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=n2,g.ConditionalFormattingFormulaMarkDirty=H,g.ConditionalFormattingIcon=N2,g.ConditionalFormattingRuleModel=b,g.DEFAULT_BG_COLOR=O2,g.DEFAULT_FONT_COLOR=j2,g.DEFAULT_PADDING=B2,g.DEFAULT_WIDTH=k2,g.DataBar=R2,g.DeleteConditionalRuleMutation=r2,g.DeleteConditionalRuleMutationUndoFactory=b2,g.EMPTY_ICON_TYPE=S2,g.FormulaResultStatus=R,g.IconUKey=T2,g.MoveConditionalRuleMutation=i2,g.MoveConditionalRuleMutationUndoFactory=s0,g.SHEET_CONDITIONAL_FORMATTING_PLUGIN=u2,g.SetConditionalRuleMutation=D2,g.anchorUndoFactory=v2,g.compareWithNumber=q,g.createCfId=E2,g.createDefaultRule=$2,g.createDefaultValue=P2,g.createDefaultValueByValueType=W2,g.dataBarUKey=M2,g.defaultDataBarNativeColor=g2,g.defaultDataBarPositiveColor=h2,g.defaultPlaceholderColor=x2,g.filterRange=Q,g.findIndexByAnchor=V,g.getCacheStyleMatrix=X2,g.getCellValue=B,g.getColorScaleFromValue=y2,g.getMaxInFormulaResult=Y2,g.getOppositeOperator=_2,g.getValueByType=Y,g.iconGroup=I2,g.iconMap=K,g.isAnchorEqual=q2,g.isFloatsEqual=X,g.isNullable=I,g.moveByAnchor=F2,g.removeUndefinedAttr=U2,g.serialTimeToTimestamp=A2,g.setConditionalRuleMutationUndoFactory=l0,g.toYMD_1900=p2,g.transformSupportSymmetryAnchor=w2,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
(function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("rxjs"),require("rxjs/operators"),require("@univerjs/engine-formula"),require("@univerjs/engine-render"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs","rxjs/operators","@univerjs/engine-formula","@univerjs/engine-render","@univerjs/sheets"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.rxjs,C.rxjs.operators,C.UniverEngineFormula,C.UniverEngineRender,C.UniverSheets))})(this,function(C,u,B,i2,O,Z,A){"use strict";var p0=Object.defineProperty;var A0=(C,u,B)=>u in C?p0(C,u,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[u]=B;var v=(C,u,B)=>A0(C,typeof u!="symbol"?u+"":u,B);var u2;const h2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var b=(a=>(a.beginsWith="beginsWith",a.endsWith="endsWith",a.containsText="containsText",a.notContainsText="notContainsText",a.equal="equal",a.notEqual="notEqual",a.containsBlanks="containsBlanks",a.notContainsBlanks="notContainsBlanks",a.containsErrors="containsErrors",a.notContainsErrors="notContainsErrors",a))(b||{}),L=(a=>(a.today="today",a.yesterday="yesterday",a.tomorrow="tomorrow",a.last7Days="last7Days",a.thisMonth="thisMonth",a.lastMonth="lastMonth",a.nextMonth="nextMonth",a.thisWeek="thisWeek",a.lastWeek="lastWeek",a.nextWeek="nextWeek",a))(L||{}),E=(a=>(a.greaterThan="greaterThan",a.greaterThanOrEqual="greaterThanOrEqual",a.lessThan="lessThan",a.lessThanOrEqual="lessThanOrEqual",a.notBetween="notBetween",a.between="between",a.equal="equal",a.notEqual="notEqual",a))(E||{}),x=(a=>(a.highlightCell="highlightCell",a.dataBar="dataBar",a.colorScale="colorScale",a.iconSet="iconSet",a))(x||{}),_=(a=>(a.uniqueValues="uniqueValues",a.duplicateValues="duplicateValues",a.rank="rank",a.text="text",a.timePeriod="timePeriod",a.number="number",a.average="average",a.formula="formula",a))(_||{}),R=(a=>(a.num="num",a.min="min",a.max="max",a.percent="percent",a.percentile="percentile",a.formula="formula",a))(R||{});const X2="#fff",Y2="#000000",K2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),J2=(a,r)=>{switch(a){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(r))return"";break}case"number":return["between","notBetween"].includes(r)?[10,100]:10}return""},z2=(a,r)=>{switch(a){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return r!==void 0?r:10}return""},j=(a,r,n)=>{if(!r)return null;const e=r.findIndex(t=>n(t)===a.id);if(e<0)return null;switch(a.type){case"after":return e+1;case"before":return e-1;case"self":return e}},E2=(a,r,n,e)=>{if(!n)return null;const t=j(a,n,e);let i=j(r,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=j(r,n,e)),r.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},g2=(a,r,n,e)=>{if(a.type==="after"&&["after","before"].includes(r.type))return[a,r];const t={...a},i={...r};if(t.type!=="after"){const s=j(t,n,e);if(s===null)return null;if(s-1<0){const o=n[s+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[s-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const s=j(i,n,e);if(s===null)return null;if(s===0)i.type="before";else if(s-1>=0){const o=e(n[s-1]);i.id=o,i.type="after"}else if(s+1<=n.length-1){const o=e(n[s+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},p2=(a,r)=>{if(["after","before"].includes(r.type)){if(a.type==="after")return[r,a];if(a.type==="before")return[r,{...a,type:"self"}]}return null},Q2=(a,r)=>a.id===r.id&&a.type===r.type,A2=()=>`${u.Tools.generateRandomId(8)}`;class I{constructor(){v(this,"_model",new Map);v(this,"_ruleChange$",new B.Subject);v(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(r,n){let e=this.getSubunitRules(r,n);if(!e){e=[];let t=this._model.get(r);t||(t=new Map,this._model.set(r,t)),t.set(n,e)}return e}getRule(r,n,e){const t=this.getSubunitRules(r,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(r){return this._model.get(r)||null}getSubunitRules(r,n){var t;return((t=this._model.get(r))==null?void 0:t.get(n))||null}deleteRule(r,n,e){const t=this.getSubunitRules(r,n);if(t){const i=t.findIndex(o=>o.cfId===e),s=t[i];s&&(t.splice(i,1),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"delete"}))}}setRule(r,n,e,t){const s=this._ensureList(r,n).find(o=>o.cfId===t);if(s){const o=u.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"set",oldRule:o})}}addRule(r,n,e){const t=this._ensureList(r,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:r,type:"add"})}moveRulePriority(r,n,e,t){const i=this._ensureList(r,n),s=j(e,i,l=>l.cfId),o=j(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const d=i[s];d&&(E2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:d,subUnitId:n,unitId:r,type:"sort"}))}createCfId(r,n){return A2()}deleteUnitId(r){this._model.delete(r)}}const J={type:u.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var e0=Object.getOwnPropertyDescriptor,t0=(a,r,n,e)=>{for(var t=e>1?void 0:e?e0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},C2=(a,r)=>(n,e)=>r(n,e,a),T=(a=>(a[a.NOT_REGISTER=1]="NOT_REGISTER",a[a.SUCCESS=2]="SUCCESS",a[a.WAIT=3]="WAIT",a[a.ERROR=4]="ERROR",a))(T||{});const n0=a=>{const r=a&&a[0]&&a[0][0];return(r==null?void 0:r.t)===u.CellValueType.BOOLEAN?r.v===u.BooleanNumber.TRUE||r.v===!0:r?r.v:!1};C.ConditionalFormattingFormulaService=class extends u.Disposable{constructor(n,e,t){super();v(this,"_formulaMap",new Map);v(this,"_result$",new B.Subject);v(this,"result$",this._result$.asObservable());this._commandService=n,this._activeDirtyManagerService=e,this._conditionalFormattingRuleModel=t,this._initFormulaCalculationResultChange(),this._initRuleChange()}_initRuleChange(){const n=e=>{switch(e.type){case x.colorScale:return e.config.some(t=>t.value.type===R.formula);case x.dataBar:return[e.config.max,e.config.min].some(t=>t.type===R.formula);case x.iconSet:return e.config.some(t=>t.value.type===R.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:s,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,s.cfId),e.type==="set"&&(n(s.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===O.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const s in e.unitOtherData[t][i]){const o=new u.ObjectMatrix(e.unitOtherData[t][i][s]),d=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!d)continue;const l=d.ranges;if(!l)continue;const c=d.result,h=l[0].startRow,g=l[0].startColumn;o.forValue((F,w,p)=>{c.setValue(h+F,g+w,n0(p))}),d.status=2;const m=this._getAllFormulaResultByCfId(t,i,d.cfId).every(F=>F.status===2);this._result$.next({...d,isAllFinished:m})}}})),this._activeDirtyManagerService.register(J.id,{commandId:J.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}})}_ensureSubunitFormulaMap(n,e){let t=this._formulaMap.get(n);t||(t=new Map,this._formulaMap.set(n,t));let i=t.get(e);return i||(i=new u.RefAlias([],["formulaId","id"]),t.set(e,i)),i}getSubUnitFormulaMap(n,e){var t;return(t=this._formulaMap.get(n))==null?void 0:t.get(e)}registerFormulaWithRange(n,e,t,i,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),d=this.createCFormulaId(t,i);if(o.getValue(d,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:d,ranges:s,formulaId:l,status:3,result:new u.ObjectMatrix});const c={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(O.SetOtherFormulaMutation.id,c,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(J.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const s=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(O.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const d=this.getSubUnitFormulaMap(n,e);if(!d)return{status:1};const l=d.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(s,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return{status:1};const o=s.getValue(this.createCFormulaId(t,i),["id"]);if(!o)return{status:1};if(o.status===2&&o.result)return{result:o.result,status:2}}deleteCache(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return[];if(i){const o=this.createCFormulaId(t,i);return s.deleteValue(o,["id"]),[]}else{const o=s.getValues().filter(d=>d.cfId===t);return o.forEach(d=>{s.deleteValue(d.formulaId,["formulaId"])}),o}}_getAllFormulaResultByCfId(n,e,t){const i=this.getSubUnitFormulaMap(n,e);return i?i.getValues().filter(o=>o.cfId===t):[]}_createFormulaId(n,e){return`sheet.cf_${n}_${e}_${u.Tools.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},C.ConditionalFormattingFormulaService=t0([C2(0,u.Inject(u.ICommandService)),C2(1,u.Inject(O.IActiveDirtyManagerService)),C2(2,u.Inject(I))],C.ConditionalFormattingFormulaService);var N=(a=>(a.preComputingStart="preComputingStart",a.preComputing="preComputing",a.preComputingEnd="preComputingEnd",a.preComputingError="preComputingError",a))(N||{});class a2{constructor(r){v(this,"_cache");v(this,"_preComputingStatus$",new B.BehaviorSubject("preComputingStart"));v(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(i2.distinctUntilChanged()));v(this,"_preComputingCache");v(this,"_rule");this._context=r,this._cache=new u.LRUMap(r.limit),this._rule=r.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(r){this._cache.limit=r}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(r){this._rule=r,this.resetPreComputingCache()}getCell(r,n){const e=this._createKey(r,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(r,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(r,n,this._getContext()),t=this.getPreComputingResult(r,n),t===null))return this._cache.get(e);if(this._preComputingStatus$.next("preComputingEnd"),this._cache.has(e))return this._cache.get(e);const i=this.getCellResult(r,n,t,this._getContext());return i!==null&&this._setCache(r,n,i),i}setPreComputingCache(r){this._preComputingCache=r}getPreComputingResult(r,n){return this._preComputingCache}_createKey(r,n){return`${r}_${n}`}_setCache(r,n,e){const t=this._createKey(r,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(r=>{r==="preComputingEnd"&&this.clearCache()})}}function z(a,r){return Math.abs(a-r)<Number.EPSILON}const k=a=>[void 0,null].includes(a),V=a=>{var e,t;if(!a)return null;if(a.t===u.CellValueType.BOOLEAN)return a.v===u.BooleanNumber.TRUE?O.BooleanValue.TRUE:O.BooleanValue.FALSE;const r=a.v,n=(t=(e=a.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return k(r)?k(n)?null:n:r},D2=86400;function y2(a,r=!0){if(r&&a>=0){if(a===0)return[1900,1,0];if(a===60)return[1900,2,29];if(a<60)return[1900,a<32?1:2,(a-1)%31+1]}let n=a+68569+2415019;const e=Math.floor(4*n/146097);n=n-Math.floor((146097*e+3)/4);const t=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*t/4)+31;const i=Math.floor(80*n/2447),s=n-Math.floor(2447*i/80);n=Math.floor(i/11);const o=i+2-12*n;return[100*(e-49)+t+n|0,o|0,s|0]}const _2=a=>{let r=a|0;const n=D2*(a-r);let e=Math.floor(n);n-e>.9999&&(e+=1,e===D2&&(e=0,r+=1));const t=e<0?D2+e:e,[i,s,o]=y2(a,!0),d=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,c=Math.floor(t)%60;return u.dayjs(`${i}/${s}/${o} ${d}:${l}:${c}`).valueOf()},Q=(a,r,n)=>{switch(a.type){case R.max:{let e=0;return r.forValue((t,i,s)=>{s>e&&(e=s)}),{status:T.SUCCESS,result:e}}case R.min:{let e;return r.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:T.SUCCESS,result:e}}case R.percent:{let e,t;r.forValue((o,d,l)=>{(e===void 0||t===void 0)&&(e=l,t=l),l>e&&(e=l),l<t&&(t=l)});const i=(e||0)-(t||0),s=Math.max(Math.min(Number(a.value)||0,100),0);return{status:T.SUCCESS,result:i*(s/100)+(t||0)}}case R.percentile:{const e=r.toNativeArray().sort((l,c)=>l-c),t=Math.max(Math.min(Number(a.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,d=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:T.SUCCESS,result:d}}case R.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(a.value),d=e.get(C.ConditionalFormattingFormulaService);return d.registerFormulaWithRange(t,i,s,o),d.getFormulaResultWithCoords(t,i,s,o)}case R.num:{const e=Number(a.value);return{status:T.SUCCESS,result:Number.isNaN(e)?0:e}}}},i0=(a,r,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),s=new u.ObjectMatrix;return n.ranges.forEach(o=>{u.Range.foreach(o,(d,l)=>{const c=i.getCellCfs(a,r,d,l);if(c){const h=c.find(g=>g.cfId===n.cfId);h!=null&&h.result&&s.setValue(d,l,h.result)}})}),s},G=(a,r)=>{switch(a.operator){case E.between:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return r>=n&&r<=e}case E.notBetween:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return!(r>=n&&r<=e)}case E.equal:{const n=a.value||0;return z(n,r)}case E.notEqual:{const n=a.value||0;return!z(n,r)}case E.greaterThan:{const n=a.value||0;return r>n}case E.greaterThanOrEqual:{const n=a.value||0;return r>=n}case E.lessThan:{const n=a.value||0;return r<n}case E.lessThanOrEqual:{const n=a.value||0;return r<=n}default:return!1}},M2=a=>{switch(a){case E.greaterThan:return E.lessThanOrEqual;case E.greaterThanOrEqual:return E.lessThan;case E.lessThan:return E.greaterThanOrEqual;case E.lessThanOrEqual:return E.greaterThan}return a},I2=(a,r)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=a.findIndex(i=>i.value>=r),t=e-1;if(e===0)return a[0].color.toRgbString();if(t>=0){const i=a[t],s=a[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),d=n(s.color.toRgb()),l=s.value-i.value,c=(r-i.value)/l,h=["r","g","b","a"].reduce((D,m)=>{const F=o[m];return D[m]=(d[m]-F)*c+F,D},{});return new u.ColorKit(h).toRgbString()}}else return a[a.length-1].color.toRgbString()},r2=(a,r,n)=>a.map(e=>{if(e.startColumn>n||e.startRow>r)return null;const t={...e};return t.endRow=Math.min(t.endRow,r),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function a0(a){let r=0;return new u.ObjectMatrix(a).forValue((n,e,t)=>{r=Math.max(Number.isNaN(r)?0:r,Number(t))}),r}class r0 extends a2{preComputing(r,n,e){const t=e.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.rule.config.every(c=>c.value.type===R.num)&&r2(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),F=m&&m.v;if(!k(F)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(F);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=[...t.rule.config].sort((c,h)=>c.index-h.index).map(c=>({value:Q(c.value,s,{...e,cfId:t.cfId}),color:new u.ColorKit(c.color)}));if(!d.some(c=>Z.isObject(c.value)?c.value.status!==T.SUCCESS:!1)){const c=d.map(h=>h.color).reduce((h,g,D)=>(h.result.push({color:g,value:h.sortValue[D]}),h),{result:[],sortValue:d.map(h=>h.value.result).sort((h,g)=>h-g)}).result;this.setPreComputingCache(c),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=t.getCellValue(r,n);if(i.t===u.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return I2(e,s)}}}const x2="sheet-conditional-rule-data-bar",f2="#ffbe38",m2="#abd91a",R2="#000",s0=34;class S2 extends Z.SheetExtension{constructor(){super(...arguments);v(this,"_paddingRightAndLeft",2);v(this,"_paddingTopAndBottom",2);v(this,"uKey",x2);v(this,"Z_INDEX",s0);v(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l&&l.dataBar){const{color:c,value:h,startPoint:g,isGradient:D}=l.dataBar,m=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:F,isMergedMainCell:w,mergeInfo:p,startY:S,endY:y,startX:M,endX:U}=m;if(F||(w&&(S=p.startY,y=p.endY,M=p.startX,U=p.endX),!this.isRenderDiffRangesByCell(p,i)))return;const c2=U-M,w2=y+Z.FIX_ONE_PIXEL_BLUR_OFFSET-S,d2=c2-this._paddingRightAndLeft*2,H2=w2-this._paddingTopAndBottom*2;if(h>0){const K=Math.max(d2*(1-g/100)*h/100,1),P=M+this._paddingRightAndLeft+g/100*d2,W=S+this._paddingTopAndBottom;if(D){const q=n.createLinearGradient(P,W,P+K,W);q.addColorStop(0,c),q.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=q,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,P,W,K,H2,!1,!0,!0,!1),D&&n.stroke()}else{const K=Math.max(d2*g/100*Math.abs(h)/100,1),P=M+this._paddingRightAndLeft+g/100*d2-K,W=S+this._paddingTopAndBottom;if(D){const q=n.createLinearGradient(P,W,P+K,W);q.addColorStop(0,"rgb(255 255 255)"),q.addColorStop(1,c),n.fillStyle=q,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,P,W,K,H2,!0,!1,!1,!0),D&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,d,l,c){const h=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+h,t),n.lineTo(e+i-h,t),d?n.arcTo(e+i,t,e+i,t+h,h):n.lineTo(e+i,t),n.lineTo(e+i,t+s-h),l?n.arcTo(e+i,t+s,e+i-h,t+s,h):n.lineTo(e+i,t+s),n.lineTo(e+h,t+s),c?n.arcTo(e,t+s,e,t+s-h,h):n.lineTo(e,t+s),n.lineTo(e,t+h),o?n.arcTo(e,t,e+h,t,h):n.lineTo(e,t),n.closePath(),n.fill())}}Z.SpreadsheetExtensionRegistry.add(S2);const s2=a=>Math.max(Math.min(100,a),0),l0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class o0 extends a2{preComputing(r,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new u.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(D=>D.type===R.num)&&r2(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(m=>{u.Range.foreach(m,(F,w)=>{const p=e.getCellValue(F,w),S=p&&p.v;if(!k(S)&&(p==null?void 0:p.t)===u.CellValueType.NUMBER){const y=Number(S);!Number.isNaN(y)&&o.setValue(F,w,y)}})});const l=Q(i.config.min,o,{...e,cfId:t.cfId}),c=Q(i.config.max,o,{...e,cfId:t.cfId});let h=0,g=0;if(l.status===T.SUCCESS){const D=Number(l.result);h=Number.isNaN(D)?0:D}else{this._preComputingStatus$.next(N.preComputing);return}if(c.status===T.SUCCESS){const D=Number(c.result),m=Number.isNaN(D)?0:D;g=Math.max(m,h),h=Math.min(m,h);let F=50;if(h<0&&g<=0)F=100;else if(h<0&&g>0){const w=Math.abs(g)+Math.abs(h);F=Math.abs(h)/w*100}else h>=0&&g>0&&(F=0);this.setPreComputingCache({min:h,max:g,startPoint:F}),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,c=l.isShowValue,h=l.config.isGradient,g=l0(r,n,t.getCellValue);if(!(g===null||g<i||i===s||s<i)){if(g===0)return{color:R2,startPoint:o,value:0,isGradient:h,isShowValue:c};if(i<0&&s<=0){const D=s-i,m=s2((s-g)/D*100);return m===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-m,isGradient:h,isShowValue:c}}else if(i<0&&s>0)if(g>0){const D=s2(Math.min(g/s,1)*100);return D===0?void 0:{color:l.config.positiveColor||f2,startPoint:o,value:D,isGradient:h,isShowValue:c}}else{const D=s2(Math.min(Math.abs(g)/Math.abs(i),1)*100);return D===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-D,isGradient:h,isShowValue:c}}else if(i>=0&&s>0){const D=s-i,m=0,F=s2((1-(s-g)/D)*100);return F===0?void 0:{color:l.config.positiveColor||f2,startPoint:m,value:F,isGradient:h,isShowValue:c}}}}}class u0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case _.average:{let d=0,l=0;return i.forEach(c=>{u.Range.foreach(c,(h,g)=>{const D=e.getCellValue(h,g),m=V(D||void 0);D&&D.t===u.CellValueType.NUMBER&&m!==void 0&&(d+=Number(m)||0,l++)})}),{value:d/l,type:t.subType}}case _.uniqueValues:case _.duplicateValues:{const d=new Map;return i.forEach(l=>{u.Range.foreach(l,(c,h)=>{const g=e.getCellValue(c,h),D=V(g||void 0);if(D!==void 0){const m=d.get(D);m?d.set(D,m+1):d.set(D,1)}})}),{value:d,type:t.subType}}case _.rank:{const d=[];i.forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),F=V(m||void 0);m&&m.t===u.CellValueType.NUMBER&&F!==void 0&&d.push(Number(F)||0)})}),d.sort((h,g)=>g-h);const l=e.rule.rule,c=l.isPercent?Math.floor(Math.max(Math.min(l.value,100),0)/100*d.length):Math.floor(Math.max(Math.min(l.isBottom?l.value-1:l.value,d.length),0));return l.isBottom?{value:d[d.length-c-1],type:t.subType}:{value:d[Math.max(c-1,0)],type:t.subType}}case _.formula:{const d=t,l=e.accessor.get(C.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,d.value,e.rule.ranges);const c=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,d.value);return c&&c.status===T.SUCCESS?(this._preComputingStatus$.next(N.preComputingEnd),{value:c.result,type:t.subType}):(this._preComputingStatus$.next(N.preComputing),null)}case _.timePeriod:switch(t.operator){case L.last7Days:return{value:{start:u.dayjs().subtract(7,"day").valueOf(),end:u.dayjs().valueOf()},type:t.subType};case L.lastMonth:return{value:{start:u.dayjs().startOf("month").subtract(1,"month").valueOf(),end:u.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case L.lastWeek:return{value:{start:u.dayjs().startOf("week").subtract(1,"week").valueOf(),end:u.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case L.nextMonth:return{value:{start:u.dayjs().startOf("month").add(1,"month").valueOf(),end:u.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case L.nextWeek:return{value:{start:u.dayjs().startOf("week").add(1,"week").valueOf(),end:u.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case L.thisMonth:return{value:{start:u.dayjs().startOf("month").valueOf(),end:u.dayjs().endOf("month").valueOf()},type:t.subType};case L.thisWeek:return{value:{start:u.dayjs().startOf("week").valueOf(),end:u.dayjs().endOf("week").valueOf()},type:t.subType};case L.today:return{value:{start:u.dayjs().startOf("day").valueOf(),end:u.dayjs().endOf("day").valueOf()},type:t.subType};case L.tomorrow:return{value:{start:u.dayjs().startOf("day").add(1,"day").valueOf(),end:u.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case L.yesterday:return{value:{start:u.dayjs().startOf("day").subtract(1,"day").valueOf(),end:u.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(r,n,e,t){const i=t.getCellValue(r,n),s=t.rule.rule;return(()=>{switch(s.subType){case _.number:{const l=i&&Number(i.v),c=(i==null?void 0:i.t)===u.CellValueType.NUMBER,h=s;return c?k(l)||Number.isNaN(l)?void 0:G({operator:h.operator,value:h.value||0},l||0):!![E.notEqual,E.notBetween].includes(h.operator)}case _.text:{const l=s,c=V(i),h=c===null?"":String(c),g=l.value||"";switch(l.operator){case b.beginsWith:return h.startsWith(g);case b.containsBlanks:return/^\s*$/.test(h);case b.notContainsBlanks:return!/^\s*$/.test(h);case b.containsErrors:return O.ERROR_TYPE_SET.has(h);case b.notContainsErrors:return!O.ERROR_TYPE_SET.has(h);case b.containsText:return h.indexOf(g)>-1;case b.notContainsText:return h.indexOf(g)===-1;case b.endsWith:return h.endsWith(g);case b.equal:return h===g;case b.notEqual:return h!==g;default:return!1}}case _.timePeriod:{const l=V(i);if(k(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return;const c=_2(Number(l)),{start:h,end:g}=e.value;return c>=h&&c<=g}case _.average:{const l=i&&i.v,c=Number(l),h=(i==null?void 0:i.t)===u.CellValueType.NUMBER,g=s;if(!h)return E.notEqual===g.operator;if(k(l)||Number.isNaN(c)||!e)return!1;const D=e.value;switch(g.operator){case E.greaterThan:return c>D;case E.greaterThanOrEqual:return c>=D;case E.lessThan:return c<D;case E.lessThanOrEqual:return c<=D;case E.equal:return z(c,D);case E.notEqual:return!z(c,D);default:return!1}}case _.rank:{const l=V(i),c=Number(l);if(k(l)||Number.isNaN(c)||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return!1;const h=e.value;return s.isBottom?c<=h:c>=h}case _.uniqueValues:{const l=V(i);return k(l)||!e?!1:e.value.get(l)===1}case _.duplicateValues:{const l=V(i);return k(l)||!e?!1:e.value.get(l)!==1}case _.formula:{const l=e==null?void 0:e.value;return l?l.getValue(r,n)===!0:!1}}})()?s.style:{}}}const c0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class d0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.config.every(c=>c.value.type===R.num)&&r2(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),F=m&&m.v;if(!k(F)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(F);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=t.config.map(c=>Q(c.value,s,{...e,cfId:e.rule.cfId}));if(!d.some(c=>c.status!==T.SUCCESS)){const c=d.map((h,g)=>({operator:t.config[g].operator,value:Number(h.result)||0})).reduce((h,g,D,m)=>{const F=t.config[D];if(!D||D===m.length-1)h.push({...g,iconId:F.iconId,iconType:F.iconType});else{const w=m[D-1];G(w,g.value)||h.push({...g,iconId:F.iconId,iconType:F.iconType})}return h},[]);this.setPreComputingCache(c),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=c0(r,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let d=0;d<e.length;d++){const l=e[d],c={...l},h={...l},{iconId:g,iconType:D}=l;if(d===0){if(G(l,i))return{iconId:g,iconType:D,isShowValue:o}}else{if(d===e.length-1)return{iconId:g,iconType:D,isShowValue:o};{const m=e[d-1];if(h.operator=M2(m.operator),h.value=m.value,G(c,i)&&G(h,i))return{iconId:g,iconType:D,isShowValue:o}}}}}}var h0=Object.getOwnPropertyDescriptor,g0=(a,r,n,e)=>{for(var t=e>1?void 0:e?h0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},l2=(a,r)=>(n,e)=>r(n,e,a);const o2=50*20*3*3;C.ConditionalFormattingViewModel=class extends u.Disposable{constructor(n,e,t,i){super();v(this,"_calculateUnitManagers",new Map);v(this,"_rTreeManager",new u.RTree);v(this,"_cellCache",new u.LRUMap(o2));v(this,"_markDirty$",new B.Subject);v(this,"markDirty$",this._markDirty$.asObservable());v(this,"_markRuleDirtyAtOnce",(n,e,t,i=!0)=>{if(this._cellCache.clear(),i){const o=this._ensureCalculateUnitManager(n,e).get(t);o&&o.resetPreComputingCache()}this._markDirty$.next({unitId:n,subUnitId:e,cfId:t})});v(this,"markRuleDirty",(()=>{const n=new B.Subject;return this.disposeWithMe(n.pipe(i2.bufferTime(100),i2.filter(e=>!!e.length),i2.map(e=>{const t=new Set,i=[];return e.forEach(s=>{const o=`${s.unitId}_${s.subUnitId}_${s.cfId}`;if(t.has(o)){if(s.isNeedResetPreComputingCache){const d=i.find(l=>l.cfId===s.cfId);d.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...s})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,s=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:s})}})());this._injector=n,this._conditionalFormattingRuleModel=e,this._conditionalFormattingFormulaService=t,this._univerInstanceService=i,this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:n,subUnitId:e,cfId:t,isAllFinished:i})=>{i&&this._markRuleDirtyAtOnce(n,e,t,i)}))}getCellCfs(n,e,t,i){const s=this._createCacheKey(n,e,t,i);if(this._cellCache.has(s))return this._cellCache.get(s);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(s,o),o}_getCellCfs(n,e,t,i){var h;const s=(h=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?h:[],o=this._ensureCalculateUnitManager(n,e),d=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(g=>d.has(g.cfId));return l.length?l.map(g=>{const D=o.get(g.cfId);return D?{cfId:g.cfId,result:D.getCell(t,i)}:null}).filter(g=>!!g).map((g,D)=>({...g,priority:D})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===x.highlightCell&&i.rule.subType===_.formula&&this._conditionalFormattingFormulaService.deleteCache(e,t,i.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:e,subUnitId:t,rule:i}=n,{cfId:s,ranges:o}=i,d=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;d.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),d.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(c=>({unitId:e,sheetId:t,id:l.cfId,range:c}))),this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c}))),l.rule.type!==i.rule.type){const c=this._createRuleCalculateUnitInstance(e,t,i);if(!c)return;d.delete(l.cfId),d.set(i.cfId,c)}else{const c=d.get(l.cfId);if(!c)return;c.updateRule(i)}}}}))}_ensureCalculateUnitManager(n,e){let t=this._calculateUnitManagers.get(n);t||(t=new Map,this._calculateUnitManagers.set(n,t));let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_createRuleCalculateUnitInstance(n,e,t){const i=this._univerInstanceService.getUnit(n),s=i==null?void 0:i.getSheetBySheetId(e);if(!i||!s)return;const o={workbook:i,worksheet:s,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:o2,getCellValue:(d,l)=>s.getCellRaw(d,l)||{}};switch(t.rule.type){case x.colorScale:return new r0(o);case x.dataBar:return new o0(o);case x.highlightCell:return new u0(o);case x.iconSet:return new d0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=o2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},C.ConditionalFormattingViewModel=g0([l2(0,u.Inject(u.Injector)),l2(1,u.Inject(I)),l2(2,u.Inject(C.ConditionalFormattingFormulaService)),l2(3,u.IUniverInstanceService)],C.ConditionalFormattingViewModel);const f={feedback:{mistake:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.87359%206.87332C6.6146%207.13231%206.6146%207.55221%206.87359%207.8112L9.062%209.99961L6.87356%2012.188C6.61457%2012.447%206.61457%2012.8669%206.87356%2013.1259C7.13255%2013.3849%207.55245%2013.3849%207.81144%2013.1259L9.99987%2010.9375L12.1882%2013.1258C12.4472%2013.3848%2012.8671%2013.3848%2013.1261%2013.1258C13.3851%2012.8669%2013.3851%2012.447%2013.1261%2012.188L10.9378%209.99961L13.1261%207.81127C13.3851%207.55228%2013.3851%207.13238%2013.1261%206.87339C12.8671%206.61441%2012.4472%206.61441%2012.1882%206.87339L9.99987%209.06173L7.81147%206.87332C7.55248%206.61433%207.13257%206.61433%206.87359%206.87332Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Cpath%20d%3D%22M9.16817%206.67735C9.16646%206.61745%209.1656%206.5875%209.16653%206.56236C9.18103%206.16817%209.49136%205.84883%209.88497%205.82306C9.91008%205.82141%209.94004%205.82141%209.99996%205.82141V5.82141C10.0599%205.82141%2010.0899%205.82141%2010.115%205.82306C10.5086%205.84883%2010.8189%206.16817%2010.8334%206.56236C10.8343%206.5875%2010.8335%206.61745%2010.8318%206.67735L10.7043%2011.131C10.6934%2011.5121%2010.3812%2011.8154%209.99995%2011.8154V11.8154C9.61866%2011.8154%209.30655%2011.5121%209.29564%2011.131L9.16817%206.67735Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3Crect%20x%3D%229.31488%22%20y%3D%2212.8086%22%20width%3D%221.37006%22%20height%3D%221.37006%22%20rx%3D%220.685032%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.037%2010C17.037%2013.8865%2013.8864%2017.0371%209.99999%2017.0371C6.11354%2017.0371%202.96295%2013.8865%202.96295%2010C2.96295%206.1136%206.11354%202.96301%209.99999%202.96301C13.8864%202.96301%2017.037%206.1136%2017.037%2010Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3Cpath%20d%3D%22M13.9239%207.17477C13.6638%206.91472%2013.2422%206.91472%2012.9821%207.17477L8.74433%2011.4126L7.01786%209.6861C6.75781%209.42606%206.33619%209.42606%206.07614%209.6861C5.81609%209.94615%205.81609%2010.3678%206.07614%2010.6278L8.27349%2012.8252C8.53354%2013.0852%208.95516%2013.0852%209.21521%2012.8252L9.2195%2012.8209L13.9239%208.1165C14.1839%207.85645%2014.1839%207.43482%2013.9239%207.17477Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A"},star:{starEmpty:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",starIncomplete:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_177)%22%3E%0A%3Cmask%20id%3D%22mask0_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2210%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20x%3D%2210.3704%22%20y%3D%220.37037%22%20width%3D%229.25926%22%20height%3D%2219.2593%22%20fill%3D%22%23C4C4C4%22%20stroke%3D%22%23F7D564%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3Cmask%20id%3D%22mask1_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20width%3D%2210%22%20height%3D%2220%22%20fill%3D%22%23C4C4C4%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask1_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_177%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A",starFull:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A"},progress:{progress0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M16.2963%209.99991C16.2963%209.17307%2016.1335%208.35432%2015.8171%207.59042C15.5006%206.82652%2015.0369%206.13242%2014.4522%205.54776C13.8675%204.96309%2013.1734%204.49931%2012.4095%204.18289C11.6456%203.86647%2010.8269%203.70361%2010%203.70361L10%209.99991H16.2963Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M10%2016.2962C11.6699%2016.2962%2013.2714%2015.6328%2014.4522%2014.4521C15.633%2013.2713%2016.2963%2011.6698%2016.2963%209.99991C16.2963%208.33003%2015.633%206.72854%2014.4522%205.54776C13.2714%204.36697%2011.6699%203.70361%2010%203.70361L10%209.99991L10%2016.2962Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M3.70374%209.99991C3.70374%2011.2452%204.07301%2012.4625%204.76485%2013.4979C5.4567%2014.5334%206.44005%2015.3404%207.59054%2015.8169C8.74104%2016.2935%2010.007%2016.4182%2011.2284%2016.1752C12.4497%2015.9323%2013.5716%2015.3326%2014.4522%2014.4521C15.3327%2013.5715%2015.9324%2012.4496%2016.1753%2011.2283C16.4183%2010.0069%2016.2936%208.74092%2015.8171%207.59042C15.3405%206.43992%2014.5335%205.45658%2013.4981%204.76473C12.4626%204.07288%2011.2453%203.70361%2010%203.70361L10%209.99991L3.70374%209.99991Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99991%22%20r%3D%226.2963%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A"},signal:{signal0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93933%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70447%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feeling:{guffaw:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.887%2010C16.887%2013.8037%2013.8036%2016.8871%209.99999%2016.8871C6.19638%2016.8871%203.11295%2013.8037%203.11295%2010C3.11295%206.19644%206.19638%203.11301%209.99999%203.11301C13.8036%203.11301%2016.887%206.19644%2016.887%2010Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M12.5355%2013.5821C13.0482%2013.1841%2013.3951%2012.6107%2013.5405%2012.0327C13.5934%2011.8226%2013.5051%2011.6349%2013.3518%2011.5331C13.2036%2011.4346%2013.0031%2011.4203%2012.8265%2011.5131C11.0615%2012.4407%208.94609%2012.4427%207.1828%2011.513C7.00629%2011.4199%206.80602%2011.4343%206.65798%2011.5329C6.50518%2011.6346%206.41701%2011.8217%206.46844%2012.0312C6.61029%2012.609%206.95079%2013.1833%207.46449%2013.5821C8.14361%2014.1093%209.05608%2014.3999%2010%2014.3999C10.9439%2014.3999%2011.8564%2014.1093%2012.5355%2013.5821Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A",smile:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2011.8518C7.03705%2011.8518%207.77779%2013.7037%2010%2013.7037C12.2222%2013.7037%2012.963%2011.8518%2012.963%2011.8518%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",noninductive:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2012.5927C7.03705%2012.5927%208.14816%2012.5927%2010.3704%2012.5927C12.5926%2012.5927%2012.963%2012.5927%2012.963%2012.5927%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",dissatisfied:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2013.7037C7.03705%2013.7037%207.77779%2011.8519%2010%2011.8519C12.2222%2011.8519%2012.963%2013.7037%2012.963%2013.7037%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",impatient:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.47573%2011.731C6.96306%2012.129%206.61613%2012.7024%206.47071%2013.2804C6.41784%2013.4905%206.50617%2013.6782%206.65942%2013.78C6.80761%2013.8785%207.00813%2013.8928%207.18477%2013.8C8.9498%2012.8724%2011.0652%2012.8704%2012.8285%2013.8002C13.005%2013.8932%2013.2052%2013.8788%2013.3533%2013.7802C13.5061%2013.6785%2013.5942%2013.4914%2013.5428%2013.2819C13.401%2012.7041%2013.0605%2012.1298%2012.5468%2011.731C11.8676%2011.2038%2010.9552%2010.9132%2010.0112%2010.9132C9.06732%2010.9132%208.15485%2011.2038%207.47573%2011.731Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A"},arrow:JSON.parse('{"down-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","down-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A"}'),shape:{cross:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%223.70374%22%20y%3D%228.14795%22%20width%3D%2212.5926%22%20height%3D%223.7037%22%20rx%3D%220.740741%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",up:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M9.44533%205.81157C9.74012%205.47858%2010.2598%205.47858%2010.5546%205.81157L16.2868%2012.2867C16.71%2012.7647%2016.3706%2013.5184%2015.7322%2013.5184H4.26776C3.62933%2013.5184%203.28995%2012.7647%203.71313%2012.2867L9.44533%205.81157Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A",down:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.5547%2014.1884C10.2599%2014.5214%209.74019%2014.5214%209.4454%2014.1884L3.71321%207.71335C3.29002%207.23532%203.6294%206.48161%204.26784%206.48161L15.7322%206.48161C16.3707%206.48161%2016.7101%207.23532%2016.2869%207.71335L10.5547%2014.1884Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","rhomboid-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2.1415%2011.1984C1.8412%2010.9074%201.8412%2010.4256%202.1415%2010.1346L9.48467%203.01785C9.77196%202.73942%2010.2284%202.73942%2010.5157%203.01786L17.8586%2010.1346C18.1589%2010.4256%2018.1589%2010.9074%2017.8586%2011.1984L10.5157%2018.3151C10.2284%2018.5936%209.77196%2018.5936%209.48467%2018.3152L2.1415%2011.1984Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-pink":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FB9D9D%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-black":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A","triangle-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_237)%22%3E%0A%3Cpath%20d%3D%22M9.32308%204.41301C9.58368%203.82623%2010.4164%203.82623%2010.677%204.413L15.9526%2016.2917C16.1701%2016.7815%2015.8115%2017.3331%2015.2756%2017.3331H4.72454C4.18858%2017.3331%203.83002%2016.7815%204.04756%2016.2917L9.32308%204.41301Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_237%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A","indicate-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feedback2:{mistake2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.12194%206.33702C4.1805%206.47839%204.30722%206.6051%204.56066%206.85854L8.36822%2010.6661L4.56062%2014.4737C4.30718%2014.7272%204.18046%2014.8539%204.12191%2014.9952C4.04384%2015.1837%204.04384%2015.3955%204.12191%2015.584C4.18046%2015.7253%204.30718%2015.8521%204.56062%2016.1055C4.81406%2016.3589%204.94078%2016.4857%205.08214%2016.5442C5.27062%2016.6223%205.4824%2016.6223%205.67089%2016.5442C5.81225%2016.4857%205.93897%2016.3589%206.19241%2016.1055L10%2012.2979L13.8074%2016.1053C14.0609%2016.3588%2014.1876%2016.4855%2014.329%2016.544C14.5174%2016.6221%2014.7292%2016.6221%2014.9177%2016.544C15.0591%2016.4855%2015.1858%2016.3588%2015.4392%2016.1053L15.4392%2016.1053C15.6927%2015.8519%2015.8194%2015.7252%2015.8779%2015.5838C15.956%2015.3953%2015.956%2015.1835%2015.8779%2014.9951C15.8194%2014.8537%2015.6927%2014.727%2015.4392%2014.4735L15.4392%2014.4735L11.6318%2010.6661L15.4392%206.85872C15.6926%206.60528%2015.8193%206.47856%2015.8779%206.3372C15.956%206.14871%2015.956%205.93694%2015.8779%205.74845C15.8193%205.60709%2015.6926%205.48037%2015.4392%205.22693C15.1857%204.97349%2015.059%204.84677%2014.9177%204.78822C14.7292%204.71015%2014.5174%204.71015%2014.3289%204.78822C14.1876%204.84677%2014.0608%204.97349%2013.8074%205.22693L10%209.03433L6.19244%205.22676C5.939%204.97332%205.81228%204.8466%205.67092%204.78805C5.48244%204.70997%205.27066%204.70997%205.08218%204.78805C4.94082%204.8466%204.8141%204.97332%204.56066%205.22676L4.56066%205.22676C4.30722%205.4802%204.1805%205.60692%204.12194%205.74828C4.04387%205.93676%204.04387%206.14854%204.12194%206.33702Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M8.49778%205.00963C8.48513%204.56774%208.47881%204.3468%208.56086%204.17746C8.63301%204.02856%208.75124%203.90689%208.89802%203.83052C9.06494%203.74365%209.28597%203.74365%209.72805%203.74365H10.272C10.714%203.74365%2010.9351%203.74365%2011.102%203.83052C11.2488%203.9069%2011.367%204.02856%2011.4392%204.17746C11.5212%204.3468%2011.5149%204.56775%2011.5022%205.00964L11.2644%2013.3173C11.2524%2013.737%2011.2464%2013.9468%2011.1609%2014.1065C11.0857%2014.2471%2010.9687%2014.3609%2010.826%2014.432C10.6639%2014.5129%2010.454%2014.5129%2010.0342%2014.5129H9.96582C9.54601%2014.5129%209.33611%2014.5129%209.17397%2014.432C9.0313%2014.3609%208.91426%2014.2471%208.83904%2014.1065C8.75357%2013.9468%208.74756%2013.737%208.73555%2013.3173L8.49778%205.00963Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Crect%20x%3D%228.76917%22%20y%3D%2215.2817%22%20width%3D%222.46154%22%20height%3D%222.46154%22%20rx%3D%220.769231%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_248)%22%3E%0A%3Cpath%20d%3D%22M15.689%205.69723C15.5476%205.75578%2015.4209%205.8825%2015.1675%206.13594L7.82436%2013.4791L4.83279%2010.4875C4.57935%2010.2341%204.45263%2010.1073%204.31127%2010.0488C4.12278%209.97071%203.91101%209.97071%203.72252%2010.0488C3.58116%2010.1073%203.45444%2010.2341%203.201%2010.4875C2.94756%2010.7409%202.82084%2010.8676%202.76229%2011.009C2.68422%2011.1975%202.68422%2011.4093%202.76229%2011.5978C2.82084%2011.7391%202.94756%2011.8658%203.201%2012.1193L7.0085%2015.9268C7.26194%2016.1802%207.38866%2016.3069%207.53002%2016.3655C7.7185%2016.4436%207.93028%2016.4436%208.11876%2016.3655C8.26013%2016.3069%208.38685%2016.1802%208.64028%2015.9268C8.66387%2015.9032%208.68636%2015.8807%208.7078%2015.8592L16.7993%207.76772C17.0527%207.51428%2017.1794%207.38756%2017.238%207.2462C17.3161%207.05772%2017.3161%206.84594%2017.238%206.65746C17.1794%206.5161%2017.0527%206.38938%2016.7993%206.13594C16.5458%205.8825%2016.4191%205.75578%2016.2777%205.69723C16.0893%205.61915%2015.8775%205.61915%2015.689%205.69723Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_248%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A"},flag:{"flag-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},cell:{"cell-0":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-25":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-50":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-75":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-100":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A"}},b2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[f.arrow["up-green"],f.arrow["right-gold"],f.arrow["down-red"]]},{name:"3ArrowsGray",list:[f.arrow["up-gray"],f.arrow["right-gray"],f.arrow["down-gray"]]},{name:"4Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"4ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"5Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["right-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"5ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["right-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"3Triangles",list:[f.shape.up,f.shape.cross,f.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"]]},{name:"3Signs",list:[f.shape["roundness-greed"],f.shape["triangle-gold"],f.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[f.shape["indicate-greed"],f.shape["indicate-gold"],f.shape["indicate-red"]]},{name:"4RedToBlack",list:[f.shape["roundness-red"],f.shape["roundness-pink"],f.shape["roundness-gray"],f.shape["roundness-black"]]},{name:"4TrafficLights",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"],f.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[f.feedback.correct,f.feedback.warn,f.feedback.mistake]},{name:"3Symbols2",list:[f.feedback2.correct2,f.feedback2.warn2,f.feedback2.mistake2]},{name:"3Flags",list:[f.flag["flag-green"],f.flag["flag-gold"],f.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Rating",list:[f.signal.signal0,f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Quarters",list:[f.progress.progress100,f.progress.progress75,f.progress.progress50,f.progress.progress25,f.progress.progress0]},{name:"_5Felling",list:[f.feeling.guffaw,f.feeling.smile,f.feeling.noninductive,f.feeling.dissatisfied,f.feeling.impatient]},{name:"5Boxes",list:[f.cell["cell-100"],f.cell["cell-75"],f.cell["cell-50"],f.cell["cell-25"],f.cell["cell-0"]]},{name:"3Stars",list:[f.star.starFull,f.star.starIncomplete,f.star.starEmpty]}]}],e2=b2.reduce((a,r)=>{const{group:n}=r;for(const e of n)a[e.name]=e.list;return a},{});for(const a in e2){const r=e2[a];Object.freeze(r)}const L2="EMPTY_ICON_TYPE",H={type:u.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=r;return a.get(I).moveRulePriority(n,e,t,i),!0}},T2=a=>{const{unitId:r,subUnitId:n}=a,e=p2(a.start,a.end);if(!e)return[];const[t,i]=e;return[{id:H.id,params:{unitId:r,subUnitId:n,start:t,end:i}}]},t2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t,cfId:i}=r,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),d=s[o-1];if(o>-1){const l=s[o],c=[{id:n2.id,params:{unitId:e,subUnitId:t,rule:u.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const h=s[0];if(h){const g=g2({id:h.cfId,type:"before"},{id:d.cfId,type:"after"},s,w=>w.cfId);if(!g)return c;const[D,m]=g,F={unitId:e,subUnitId:t,start:D,end:m};c.push({id:H.id,params:F})}}return c}return[]},$={type:u.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,cfId:t}=r;return a.get(I).deleteRule(n,e,t),!0}},k2=(a,r)=>({id:$.id,params:{unitId:r.unitId,subUnitId:r.subUnitId,cfId:r.rule.cfId}}),n2={type:u.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r;return a.get(I).addRule(n,e,t),!0}},B2={type:u.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(a,r){if(!r)return!1;const{rule:n}=r,e=a.get(u.IUndoRedoService),t=a.get(u.ICommandService),i=a.get(I),s=a.get(u.IUniverInstanceService),o=A.getSheetCommandTarget(s);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=i.createCfId(d,l),h={unitId:d,subUnitId:l,rule:{...n,cfId:n.cfId||c}},g=k2(a,h),D=t.syncExecuteCommand(n2.id,h);return D&&e.pushUndoRedo({unitID:d,redoMutations:[{id:n2.id,params:h}],undoMutations:[g]}),D}},X={type:u.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r,i=r.cfId||r.rule.cfId;return a.get(I).setRule(n,e,t,i),!0}},F2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t}=r,i=r.cfId||r.rule.cfId,s=n.getRule(e,t,i);return s?[{id:X.id,params:{unitId:e,subUnitId:t,cfId:i,rule:u.Tools.deepClone(s)}}]:[]},N2={type:u.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(a,r){var F;if(!r)return!1;const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=a.get(A.SheetsSelectionsService),o=A.getSheetCommandTarget(e,r);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=((F=s.getCurrentSelections())==null?void 0:F.map(w=>w.range))||[],h=n.getSubunitRules(d,l);if(!(h!=null&&h.length)||!c.length)return!1;const g=[],D=[];h.forEach(w=>{const p=new u.ObjectMatrix;w.ranges.forEach(y=>{u.Range.foreach(y,(M,U)=>{p.setValue(M,U,1)})}),c.forEach(y=>{u.Range.foreach(y,(M,U)=>{p.realDeleteValue(M,U)})});const S=A.findAllRectangle(A.createTopMatrixFromMatrix(p));if(S.length){const y={...w,ranges:S},M={unitId:d,subUnitId:l,rule:y},U=F2(a,M);g.push({id:X.id,params:M}),D.push(...U)}else{const y={unitId:d,subUnitId:l,cfId:w.cfId},M=t2(a,y);g.push({id:$.id,params:y}),D.push(...M)}});const m=u.sequenceExecute(g,t).result;return m&&i.pushUndoRedo({unitID:d,redoMutations:g,undoMutations:D}),m}},U2={type:u.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(a,r){const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=A.getSheetCommandTarget(e,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=n.getSubunitRules(o,d);if(!(l!=null&&l.length))return!1;const c=l.map(m=>({cfId:m.cfId,unitId:o,subUnitId:d})),h=c.map(m=>({id:$.id,params:m})),g=c.map(m=>t2(a,m)[0]),D=u.sequenceExecute(h,t).result;return D&&i.pushUndoRedo({unitID:o,redoMutations:h,undoMutations:g}),D}},V2={type:u.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=A.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,cfId:r.cfId},l=t2(a,d),c=e.syncExecuteCommand($.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:$.id,params:d}]}),c}},O2={type:u.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=a.get(I),s=A.getSheetCommandTarget(t,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=g2(r.start,r.end,i.getSubunitRules(o,d)||[],F=>F.cfId);if(!l)return!1;const[c,h]=l,g={unitId:o,subUnitId:d,start:c,end:h},D=T2(g),m=e.syncExecuteCommand(H.id,g);return m&&n.pushUndoRedo({unitID:o,redoMutations:[{id:H.id,params:g}],undoMutations:D}),m}},j2={type:u.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=A.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,rule:r.rule,cfId:r.cfId},l=F2(a,d),c=e.syncExecuteCommand(X.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:X.id,params:d}]}),c}},C0="ssheets-conditional-formatting.config",$2={};var D0=Object.getOwnPropertyDescriptor,f0=(a,r,n,e)=>{for(var t=e>1?void 0:e?D0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},Y=(a,r)=>(n,e)=>r(n,e,a);C.ConditionalFormattingService=class extends u.Disposable{constructor(r,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=r,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=s,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(r,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(r,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(r,n,l.cfId)).filter(l=>!!l).reverse(),o=s.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&s.splice(o+1),s.reduce((l,c)=>{var D;const h=c.rule.type,g=i.find(m=>m.cfId===c.cfId);if(h===x.highlightCell)g.result&&u.Tools.deepMerge(l,{style:g.result});else if(h===x.colorScale){const m=g==null?void 0:g.result;m&&typeof m=="string"&&(l.style={...(D=l.style)!=null?D:{},bg:{rgb:m}})}else if(h===x.dataBar){const m=g==null?void 0:g.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(h===x.iconSet){const m=g==null?void 0:g.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const r=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((s,o)=>{i[o]=s}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:h2,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>r(e),parseJson:e=>n(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e)},onLoad:(e,t)=>{Object.keys(t).forEach(i=>{[...t[i]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,i,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{if(r.id===A.RemoveSheetCommand.id){const n=r.params,e=n.unitId||m0(this._univerInstanceService),t=n.subUnitId||F0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const s=[],o=[];return i.forEach(d=>{const l={unitId:e,subUnitId:t,cfId:d.cfId};s.push({id:$.id,params:l}),o.push(...t2(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,d])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,d);l==null||l.forEach(c=>s.add(c.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(r.id){case A.SetRangeValuesMutation.id:{const e=r.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new u.ObjectMatrix(s).forValue((l,c,h)=>{h&&Object.keys(h).some(D=>["p","v"].includes(D))&&o.push([l,c])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case A.InsertColMutation.id:case A.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case A.RemoveRowMutation.id:case A.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case A.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case A.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case A.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=r.params,s=o=>{const d=[];new u.ObjectMatrix(o.value).forValue((c,h)=>{d.push([c,h])}),n(e,o.subUnitId,d).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,c.cfId)})};s(t),s(i);break}case A.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(d=>d.ranges.some(l=>u.Rectangle.intersects(l,e))).forEach(d=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,d.cfId)});break}}}))}},C.ConditionalFormattingService=f0([Y(0,u.Inject(I)),Y(1,u.Inject(u.Injector)),Y(2,u.Inject(u.IUniverInstanceService)),Y(3,u.Inject(u.IResourceManagerService)),Y(4,u.Inject(A.SheetInterceptorService)),Y(5,u.Inject(u.ICommandService))],C.ConditionalFormattingService);const m0=a=>a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getUnitId(),F0=a=>{var r;return(r=a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:r.getSheetId()};var v0=Object.getOwnPropertyDescriptor,w0=(a,r,n,e)=>{for(var t=e>1?void 0:e?v0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},v2=(a,r)=>(n,e)=>r(n,e,a);C.UniverSheetsConditionalFormattingPlugin=(u2=class extends u.Plugin{constructor(r=$2,n,e,t){super(),this._config=r,this._injector=n,this._commandService=e,this._configService=t;const{...i}=u.merge({},$2,this._config);this._configService.setConfig(C0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[I],[C.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[B2,N2,U2,V2,O2,j2,n2,$,X,H,J].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(C.ConditionalFormattingService),u.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},v(u2,"pluginName",h2),v(u2,"type",u.UniverInstanceType.UNIVER_SHEET),u2),C.UniverSheetsConditionalFormattingPlugin=w0([v2(1,u.Inject(u.Injector)),v2(2,u.Inject(u.ICommandService)),v2(3,u.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const P2="sheet-conditional-rule-icon",E0=35,W2=15,q2=2;class Z2 extends Z.SheetExtension{constructor(){super();v(this,"_paddingRightAndLeft",q2);v(this,"_width",W2);v(this,"_imageMap",new Map);v(this,"uKey",P2);v(this,"Z_INDEX",E0);v(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l!=null&&l.iconSet){const{iconType:c,iconId:h}=l.iconSet;if(c===L2)return;const g=this._imageMap.get(this._createKey(c,h));if(!g)return;const D=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:m,isMergedMainCell:F,mergeInfo:w,startY:p,endY:S,startX:y,endX:M}=D;if(m||(F&&(p=w.startY,S=w.endY,y=w.startX,M=w.endX),!this.isRenderDiffRangesByCell(w,i)))return;const U=M-y,c2=S-p;if(this._width>c2||this._width>U+this._paddingRightAndLeft*2)return;const w2=(c2-this._width)/2+p;n.drawImage(g,y+this._paddingRightAndLeft,w2,this._width,this._width)}}),n.restore()}_init(){for(const n in e2)e2[n].forEach((t,i)=>{const s=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(s,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}Z.SpreadsheetExtensionRegistry.add(Z2);function G2(a){if(typeof a!="object"||a===null)return a;const r={};for(const n in a)if(a.hasOwnProperty(n)){const e=G2(a[n]);e!==void 0&&(r[n]=e)}return r}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>u.isRangesEqual}),C.AddCfCommand=B2,C.AddConditionalRuleMutation=n2,C.AddConditionalRuleMutationUndoFactory=k2,C.CFNumberOperator=E,C.CFRuleType=x,C.CFSubRuleType=_,C.CFTextOperator=b,C.CFTimePeriodOperator=L,C.CFValueType=R,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=o2,C.ClearRangeCfCommand=N2,C.ClearWorksheetCfCommand=U2,C.ConditionalFormattingFormulaMarkDirty=J,C.ConditionalFormattingIcon=Z2,C.ConditionalFormattingRuleModel=I,C.DEFAULT_BG_COLOR=X2,C.DEFAULT_FONT_COLOR=Y2,C.DEFAULT_PADDING=q2,C.DEFAULT_WIDTH=W2,C.DataBar=S2,C.DeleteCfCommand=V2,C.DeleteConditionalRuleMutation=$,C.DeleteConditionalRuleMutationUndoFactory=t2,C.EMPTY_ICON_TYPE=L2,C.FormulaResultStatus=T,C.IconUKey=P2,C.MoveCfCommand=O2,C.MoveConditionalRuleMutation=H,C.MoveConditionalRuleMutationUndoFactory=T2,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=h2,C.SetCfCommand=j2,C.SetConditionalRuleMutation=X,C.anchorUndoFactory=p2,C.compareWithNumber=G,C.createCfId=A2,C.createDefaultRule=K2,C.createDefaultValue=J2,C.createDefaultValueByValueType=z2,C.dataBarUKey=x2,C.defaultDataBarNativeColor=m2,C.defaultDataBarPositiveColor=f2,C.defaultPlaceholderColor=R2,C.filterRange=r2,C.findIndexByAnchor=j,C.getCacheStyleMatrix=i0,C.getCellValue=V,C.getColorScaleFromValue=I2,C.getMaxInFormulaResult=a0,C.getOppositeOperator=M2,C.getValueByType=Q,C.iconGroup=b2,C.iconMap=e2,C.isAnchorEqual=Q2,C.isFloatsEqual=z,C.isNullable=k,C.moveByAnchor=E2,C.removeUndefinedAttr=G2,C.serialTimeToTimestamp=_2,C.setConditionalRuleMutationUndoFactory=F2,C.toYMD_1900=y2,C.transformSupportSymmetryAnchor=g2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// @univerjs/sheets-conditional-formatting/facade
|
|
6
|
-
(function(i,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets/facade"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.UniverSheetsConditionalFormattingFacade={},i.UniverCore,i.UniverSheetsConditionalFormatting,i.UniverSheetsFacade))})(this,function(i,r,u,p){"use strict";var w=Object.defineProperty;var R=(i,r,u)=>r in i?w(i,r,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[r]=u;var _=(i,r,u)=>R(i,typeof r!="symbol"?r+"":r,u);class o{constructor(e={}){_(this,"_rule",{});this._rule=e,this._ensureAttr(this._rule,["rule"])}get _ruleConfig(){return this._rule.rule||null}_getDefaultConfig(e=u.CFRuleType.highlightCell){switch(e){case u.CFRuleType.colorScale:return{type:e,config:[{index:0,color:new r.ColorKit("").toRgbString(),value:{type:u.CFValueType.min}},{index:0,color:new r.ColorKit("green").toRgbString(),value:{type:u.CFValueType.max}}]};case u.CFRuleType.dataBar:return{type:e,isShowValue:!0,config:{min:{type:u.CFValueType.min},max:{type:u.CFValueType.max},positiveColor:new r.ColorKit("green").toRgbString(),nativeColor:new r.ColorKit("").toRgbString(),isGradient:!1}};case u.CFRuleType.highlightCell:return{type:e,subType:u.CFSubRuleType.text,operator:u.CFTextOperator.containsText,value:"abc",style:{}};case u.CFRuleType.iconSet:return{type:e,isShowValue:!0,config:[{operator:u.CFNumberOperator.greaterThanOrEqual,value:{type:u.CFValueType.min},iconType:u.EMPTY_ICON_TYPE,iconId:""},{operator:u.CFNumberOperator.greaterThanOrEqual,value:{type:u.CFValueType.percentile,value:.5},iconType:u.EMPTY_ICON_TYPE,iconId:""},{operator:u.CFNumberOperator.lessThanOrEqual,value:{type:u.CFValueType.max},iconType:u.EMPTY_ICON_TYPE,iconId:""}]}}}_ensureAttr(e,t){return t.reduce((l,s)=>(l[s]||(l[s]={}),l[s]),e),e}build(){var l;this._rule.cfId||(this._rule.cfId=u.createCfId()),this._rule.ranges||(this._rule.ranges=[]),this._rule.stopIfTrue===void 0&&(this._rule.stopIfTrue=!1),(l=this._rule.rule)!=null&&l.type||(this._rule.rule.type=u.CFRuleType.highlightCell,this._ensureAttr(this._rule,["rule","style"]));const e=this._getDefaultConfig(this._rule.rule.type);return{...this._rule,rule:{...e,...this._rule.rule}}}copy(){return new o(r.Tools.deepClone(this._rule))}getRanges(){return this._rule.ranges||[]}getIconMap(){return u.iconMap}createCfId(){return u.createCfId()}setRanges(e){return this._rule.ranges=e,this}}class n extends o{constructor(e={}){super(e),this._ensureAttr(this._rule,["rule","style"])}copy(){return new n(r.Tools.deepClone(this._rule))}setAverage(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.average,t.operator=e,this}setUniqueValues(){const e=this._ruleConfig;return e.type=u.CFRuleType.highlightCell,e.subType=u.CFSubRuleType.uniqueValues,this}setDuplicateValues(){const e=this._ruleConfig;return e.type=u.CFRuleType.highlightCell,e.subType=u.CFSubRuleType.duplicateValues,this}setRank(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.rank,t.isBottom=e.isBottom,t.isPercent=e.isPercent,t.value=e.value,this}setBackground(e){var t;if(((t=this._ruleConfig)==null?void 0:t.type)===u.CFRuleType.highlightCell)if(e){this._ensureAttr(this._ruleConfig,["style","bg"]);const l=new r.ColorKit(e);this._ruleConfig.style.bg.rgb=l.toRgbString()}else delete this._ruleConfig.style.bg;return this}setBold(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===u.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.bl=e?r.BooleanNumber.TRUE:r.BooleanNumber.FALSE),this}setFontColor(e){var t;if(((t=this._ruleConfig)==null?void 0:t.type)===u.CFRuleType.highlightCell)if(e){const l=new r.ColorKit(e);this._ensureAttr(this._ruleConfig,["style","cl"]),this._ruleConfig.style.cl.rgb=l.toRgbString()}else delete this._ruleConfig.style.cl;return this}setItalic(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===u.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.it=e?r.BooleanNumber.TRUE:r.BooleanNumber.FALSE),this}setStrikethrough(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===u.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","st"]),this._ruleConfig.style.st.s=e?r.BooleanNumber.TRUE:r.BooleanNumber.FALSE),this}setUnderline(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===u.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","ul"]),this._ruleConfig.style.ul.s=e?r.BooleanNumber.TRUE:r.BooleanNumber.FALSE),this}whenCellEmpty(){const e=this._ruleConfig;return e.type=u.CFRuleType.highlightCell,e.subType=u.CFSubRuleType.text,e.value="",e.operator=u.CFTextOperator.equal,this}whenCellNotEmpty(){const e=this._ruleConfig;return e.type=u.CFRuleType.highlightCell,e.subType=u.CFSubRuleType.text,e.value="",e.operator=u.CFTextOperator.notEqual,this}whenDate(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.timePeriod,t.operator=e,this}whenFormulaSatisfied(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.formula,t.value=e,this}whenNumberBetween(e,t){const l=Math.min(e,t),s=Math.max(e,t),h=this._ruleConfig;return h.type=u.CFRuleType.highlightCell,h.subType=u.CFSubRuleType.number,h.value=[l,s],h.operator=u.CFNumberOperator.between,this}whenNumberEqualTo(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.number,t.value=e,t.operator=u.CFNumberOperator.equal,this}whenNumberGreaterThan(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.number,t.value=e,t.operator=u.CFNumberOperator.greaterThan,this}whenNumberGreaterThanOrEqualTo(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.number,t.value=e,t.operator=u.CFNumberOperator.greaterThanOrEqual,this}whenNumberLessThan(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.number,t.value=e,t.operator=u.CFNumberOperator.lessThan,this}whenNumberLessThanOrEqualTo(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.number,t.value=e,t.operator=u.CFNumberOperator.lessThanOrEqual,this}whenNumberNotBetween(e,t){const l=Math.min(e,t),s=Math.max(e,t),h=this._ruleConfig;return h.type=u.CFRuleType.highlightCell,h.subType=u.CFSubRuleType.number,h.value=[l,s],h.operator=u.CFNumberOperator.notBetween,this}whenNumberNotEqualTo(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.number,t.value=e,t.operator=u.CFNumberOperator.notEqual,this}whenTextContains(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.text,t.value=e,t.operator=u.CFTextOperator.containsText,this}whenTextDoesNotContain(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.text,t.value=e,t.operator=u.CFTextOperator.notContainsText,this}whenTextEndsWith(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.text,t.value=e,t.operator=u.CFTextOperator.endsWith,this}whenTextEqualTo(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.text,t.value=e,t.operator=u.CFTextOperator.equal,this}whenTextStartsWith(e){const t=this._ruleConfig;return t.type=u.CFRuleType.highlightCell,t.subType=u.CFSubRuleType.text,t.value=e,t.operator=u.CFTextOperator.beginsWith,this}}class a extends o{copy(){return new a(r.Tools.deepClone(this._rule))}setDataBar(e){const t=this._ruleConfig;return t.type=u.CFRuleType.dataBar,t.isShowValue=!!e.isShowValue,t.config={min:e.min,max:e.max,positiveColor:e.positiveColor,nativeColor:e.nativeColor,isGradient:!!e.isGradient},this}}class g extends o{copy(){return new g(r.Tools.deepClone(this._rule))}setColorScale(e){const t=this._ruleConfig;return t.type=u.CFRuleType.colorScale,t.config=e,this}}class T extends o{copy(){return new T(r.Tools.deepClone(this._rule))}setIconSet(e){const t=this._ruleConfig;return t.type=u.CFRuleType.iconSet,t.config=e.iconConfigs,t.isShowValue=e.isShowValue,this}}class C{constructor(e={}){this._initConfig=e}build(){return new o(this._initConfig).build()}setAverage(e){return new n(this._initConfig).setAverage(e)}setUniqueValues(){return new n(this._initConfig).setUniqueValues()}setDuplicateValues(){return new n(this._initConfig).setDuplicateValues()}setRank(e){return new n(this._initConfig).setRank(e)}setIconSet(e){return new T(this._initConfig).setIconSet(e)}setColorScale(e){return new g(this._initConfig).setColorScale(e)}setDataBar(e){return new a(this._initConfig).setDataBar(e)}setBackground(e){return new n(this._initConfig).setBackground(e)}setBold(e){return new n(this._initConfig).setBold(e)}setFontColor(e){return new n(this._initConfig).setFontColor(e)}setItalic(e){return new n(this._initConfig).setItalic(e)}setStrikethrough(e){return new n(this._initConfig).setStrikethrough(e)}setUnderline(e){return new n(this._initConfig).setUnderline(e)}whenCellEmpty(){return new n(this._initConfig).whenCellEmpty()}whenCellNotEmpty(){return new n(this._initConfig).whenCellNotEmpty()}whenDate(e){return new n(this._initConfig).whenDate(e)}whenFormulaSatisfied(e){return new n(this._initConfig).whenFormulaSatisfied(e)}whenNumberBetween(e,t){return new n(this._initConfig).whenNumberBetween(e,t)}whenNumberEqualTo(e){return new n(this._initConfig).whenNumberEqualTo(e)}whenNumberGreaterThan(e){return new n(this._initConfig).whenNumberGreaterThan(e)}whenNumberGreaterThanOrEqualTo(e){return new n(this._initConfig).whenNumberGreaterThanOrEqualTo(e)}whenNumberLessThan(e){return new n(this._initConfig).whenNumberLessThan(e)}whenNumberLessThanOrEqualTo(e){return new n(this._initConfig).whenNumberLessThanOrEqualTo(e)}whenNumberNotBetween(e,t){return new n(this._initConfig).whenNumberNotBetween(e,t)}whenNumberNotEqualTo(e){return new n(this._initConfig).whenNumberNotEqualTo(e)}whenTextContains(e){return new n(this._initConfig).whenTextContains(e)}whenTextDoesNotContain(e){return new n(this._initConfig).whenTextDoesNotContain(e)}whenTextEndsWith(e){return new n(this._initConfig).whenTextEndsWith(e)}whenTextEqualTo(e){return new n(this._initConfig).whenTextEqualTo(e)}whenTextStartsWith(e){return new n(this._initConfig).whenTextStartsWith(e)}}class f extends p.FRange{_getConditionalFormattingRuleModel(){return this._injector.get(u.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]].filter(t=>t.ranges.some(l=>r.Rectangle.intersects(l,this._range)))}createConditionalFormattingRule(){return new C({ranges:[this._range]})}addConditionalFormattingRule(e){const t={rule:e,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(u.AddConditionalRuleMutation.id,t),this}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(u.DeleteConditionalRuleMutation.id,t),this}moveConditionalFormattingRule(e,t,l="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:l}};return this._commandService.syncExecuteCommand(u.MoveConditionalRuleMutation.id,s),this}setConditionalFormattingRule(e,t){const l={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:t,cfId:e};return this._commandService.syncExecuteCommand(u.SetConditionalRuleMutation.id,l),this}}p.FRange.extend(f);class c extends p.FWorkbook{newColor(){return new r.ColorBuilder}}p.FWorkbook.extend(c);class b extends p.FWorksheet{_getConditionalFormattingRuleModel(){return this._injector.get(u.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]]}createConditionalFormattingRule(){return new C}newConditionalFormattingRule(){return new C}addConditionalFormattingRule(e){const t={rule:e,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(u.AddConditionalRuleMutation.id,t),this}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(u.DeleteConditionalRuleMutation.id,t),this}moveConditionalFormattingRule(e,t,l="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:l}};return this._commandService.syncExecuteCommand(u.MoveConditionalRuleMutation.id,s),this}setConditionalFormattingRule(e,t){const l={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:t,cfId:e};return this._commandService.syncExecuteCommand(u.SetConditionalRuleMutation.id,l),this}}p.FWorksheet.extend(b),i.FConditionalFormattingBuilder=C,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
(function(l,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets/facade"],u):(l=typeof globalThis<"u"?globalThis:l||self,u(l.UniverSheetsConditionalFormattingFacade={},l.UniverCore,l.UniverSheetsConditionalFormatting,l.UniverSheetsFacade))})(this,function(l,u,r,C){"use strict";var w=Object.defineProperty;var R=(l,u,r)=>u in l?w(l,u,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[u]=r;var _=(l,u,r)=>R(l,typeof u!="symbol"?u+"":u,r);class o{constructor(e={}){_(this,"_rule",{});this._rule=e,this._ensureAttr(this._rule,["rule"])}get _ruleConfig(){return this._rule.rule||null}_getDefaultConfig(e=r.CFRuleType.highlightCell){switch(e){case r.CFRuleType.colorScale:return{type:e,config:[{index:0,color:new u.ColorKit("").toRgbString(),value:{type:r.CFValueType.min}},{index:0,color:new u.ColorKit("green").toRgbString(),value:{type:r.CFValueType.max}}]};case r.CFRuleType.dataBar:return{type:e,isShowValue:!0,config:{min:{type:r.CFValueType.min},max:{type:r.CFValueType.max},positiveColor:new u.ColorKit("green").toRgbString(),nativeColor:new u.ColorKit("").toRgbString(),isGradient:!1}};case r.CFRuleType.highlightCell:return{type:e,subType:r.CFSubRuleType.text,operator:r.CFTextOperator.containsText,value:"abc",style:{}};case r.CFRuleType.iconSet:return{type:e,isShowValue:!0,config:[{operator:r.CFNumberOperator.greaterThanOrEqual,value:{type:r.CFValueType.min},iconType:r.EMPTY_ICON_TYPE,iconId:""},{operator:r.CFNumberOperator.greaterThanOrEqual,value:{type:r.CFValueType.percentile,value:.5},iconType:r.EMPTY_ICON_TYPE,iconId:""},{operator:r.CFNumberOperator.lessThanOrEqual,value:{type:r.CFValueType.max},iconType:r.EMPTY_ICON_TYPE,iconId:""}]}}}_ensureAttr(e,t){return t.reduce((i,s)=>(i[s]||(i[s]={}),i[s]),e),e}build(){var i;this._rule.cfId||(this._rule.cfId=r.createCfId()),this._rule.ranges||(this._rule.ranges=[]),this._rule.stopIfTrue===void 0&&(this._rule.stopIfTrue=!1),(i=this._rule.rule)!=null&&i.type||(this._rule.rule.type=r.CFRuleType.highlightCell,this._ensureAttr(this._rule,["rule","style"]));const e=this._getDefaultConfig(this._rule.rule.type);return{...this._rule,rule:{...e,...this._rule.rule}}}copy(){return new o(u.Tools.deepClone(this._rule))}getRanges(){return this._rule.ranges||[]}getIconMap(){return r.iconMap}createCfId(){return r.createCfId()}setRanges(e){return this._rule.ranges=e,this}}class n extends o{constructor(e={}){super(e),this._ensureAttr(this._rule,["rule","style"])}copy(){return new n(u.Tools.deepClone(this._rule))}setAverage(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.average,t.operator=e,this}setUniqueValues(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.uniqueValues,this}setDuplicateValues(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.duplicateValues,this}setRank(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.rank,t.isBottom=e.isBottom,t.isPercent=e.isPercent,t.value=e.value,this}setBackground(e){var t;if(((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell)if(e){this._ensureAttr(this._ruleConfig,["style","bg"]);const i=new u.ColorKit(e);this._ruleConfig.style.bg.rgb=i.toRgbString()}else delete this._ruleConfig.style.bg;return this}setBold(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.bl=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setFontColor(e){var t;if(((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell)if(e){const i=new u.ColorKit(e);this._ensureAttr(this._ruleConfig,["style","cl"]),this._ruleConfig.style.cl.rgb=i.toRgbString()}else delete this._ruleConfig.style.cl;return this}setItalic(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.it=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setStrikethrough(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","st"]),this._ruleConfig.style.st.s=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setUnderline(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","ul"]),this._ruleConfig.style.ul.s=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}whenCellEmpty(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.text,e.value="",e.operator=r.CFTextOperator.equal,this}whenCellNotEmpty(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.text,e.value="",e.operator=r.CFTextOperator.notEqual,this}whenDate(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.timePeriod,t.operator=e,this}whenFormulaSatisfied(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.formula,t.value=e,this}whenNumberBetween(e,t){const i=Math.min(e,t),s=Math.max(e,t),h=this._ruleConfig;return h.type=r.CFRuleType.highlightCell,h.subType=r.CFSubRuleType.number,h.value=[i,s],h.operator=r.CFNumberOperator.between,this}whenNumberEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.equal,this}whenNumberGreaterThan(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.greaterThan,this}whenNumberGreaterThanOrEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.greaterThanOrEqual,this}whenNumberLessThan(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.lessThan,this}whenNumberLessThanOrEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.lessThanOrEqual,this}whenNumberNotBetween(e,t){const i=Math.min(e,t),s=Math.max(e,t),h=this._ruleConfig;return h.type=r.CFRuleType.highlightCell,h.subType=r.CFSubRuleType.number,h.value=[i,s],h.operator=r.CFNumberOperator.notBetween,this}whenNumberNotEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.notEqual,this}whenTextContains(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.containsText,this}whenTextDoesNotContain(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.notContainsText,this}whenTextEndsWith(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.endsWith,this}whenTextEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.equal,this}whenTextStartsWith(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.beginsWith,this}}class a extends o{copy(){return new a(u.Tools.deepClone(this._rule))}setDataBar(e){const t=this._ruleConfig;return t.type=r.CFRuleType.dataBar,t.isShowValue=!!e.isShowValue,t.config={min:e.min,max:e.max,positiveColor:e.positiveColor,nativeColor:e.nativeColor,isGradient:!!e.isGradient},this}}class g extends o{copy(){return new g(u.Tools.deepClone(this._rule))}setColorScale(e){const t=this._ruleConfig;return t.type=r.CFRuleType.colorScale,t.config=e,this}}class y extends o{copy(){return new y(u.Tools.deepClone(this._rule))}setIconSet(e){const t=this._ruleConfig;return t.type=r.CFRuleType.iconSet,t.config=e.iconConfigs,t.isShowValue=e.isShowValue,this}}class p{constructor(e={}){this._initConfig=e}build(){return new o(this._initConfig).build()}setAverage(e){return new n(this._initConfig).setAverage(e)}setUniqueValues(){return new n(this._initConfig).setUniqueValues()}setDuplicateValues(){return new n(this._initConfig).setDuplicateValues()}setRank(e){return new n(this._initConfig).setRank(e)}setIconSet(e){return new y(this._initConfig).setIconSet(e)}setColorScale(e){return new g(this._initConfig).setColorScale(e)}setDataBar(e){return new a(this._initConfig).setDataBar(e)}setBackground(e){return new n(this._initConfig).setBackground(e)}setBold(e){return new n(this._initConfig).setBold(e)}setFontColor(e){return new n(this._initConfig).setFontColor(e)}setItalic(e){return new n(this._initConfig).setItalic(e)}setStrikethrough(e){return new n(this._initConfig).setStrikethrough(e)}setUnderline(e){return new n(this._initConfig).setUnderline(e)}whenCellEmpty(){return new n(this._initConfig).whenCellEmpty()}whenCellNotEmpty(){return new n(this._initConfig).whenCellNotEmpty()}whenDate(e){return new n(this._initConfig).whenDate(e)}whenFormulaSatisfied(e){return new n(this._initConfig).whenFormulaSatisfied(e)}whenNumberBetween(e,t){return new n(this._initConfig).whenNumberBetween(e,t)}whenNumberEqualTo(e){return new n(this._initConfig).whenNumberEqualTo(e)}whenNumberGreaterThan(e){return new n(this._initConfig).whenNumberGreaterThan(e)}whenNumberGreaterThanOrEqualTo(e){return new n(this._initConfig).whenNumberGreaterThanOrEqualTo(e)}whenNumberLessThan(e){return new n(this._initConfig).whenNumberLessThan(e)}whenNumberLessThanOrEqualTo(e){return new n(this._initConfig).whenNumberLessThanOrEqualTo(e)}whenNumberNotBetween(e,t){return new n(this._initConfig).whenNumberNotBetween(e,t)}whenNumberNotEqualTo(e){return new n(this._initConfig).whenNumberNotEqualTo(e)}whenTextContains(e){return new n(this._initConfig).whenTextContains(e)}whenTextDoesNotContain(e){return new n(this._initConfig).whenTextDoesNotContain(e)}whenTextEndsWith(e){return new n(this._initConfig).whenTextEndsWith(e)}whenTextEqualTo(e){return new n(this._initConfig).whenTextEqualTo(e)}whenTextStartsWith(e){return new n(this._initConfig).whenTextStartsWith(e)}}class f extends C.FRange{_getConditionalFormattingRuleModel(){return this._injector.get(r.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]].filter(t=>t.ranges.some(i=>u.Rectangle.intersects(i,this._range)))}createConditionalFormattingRule(){return new p({ranges:[this._range]})}addConditionalFormattingRule(e){const t={rule:e,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(r.AddConditionalRuleMutation.id,t),this}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(r.DeleteConditionalRuleMutation.id,t),this}moveConditionalFormattingRule(e,t,i="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:i}};return this._commandService.syncExecuteCommand(r.MoveConditionalRuleMutation.id,s),this}setConditionalFormattingRule(e,t){const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:t,cfId:e};return this._commandService.syncExecuteCommand(r.SetConditionalRuleMutation.id,i),this}clearConditionalFormatRules(){const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]};return this._commandService.syncExecuteCommand(r.ClearRangeCfCommand.id,e),this}}C.FRange.extend(f);class c extends C.FWorkbook{newColor(){return new u.ColorBuilder}}C.FWorkbook.extend(c);class b extends C.FWorksheet{_getConditionalFormattingRuleModel(){return this._injector.get(r.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]]}createConditionalFormattingRule(){return new p}newConditionalFormattingRule(){return new p}addConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:e};return this._commandService.syncExecuteCommand(r.AddCfCommand.id,t),this}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(r.DeleteCfCommand.id,t),this}moveConditionalFormattingRule(e,t,i="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:i}};return this._commandService.syncExecuteCommand(r.MoveCfCommand.id,s),this}setConditionalFormattingRule(e,t){const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e,rule:t};return this._commandService.syncExecuteCommand(r.SetCfCommand.id,i),this}clearConditionalFormatRules(){const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(r.ClearWorksheetCfCommand.id,e),this}}C.FWorksheet.extend(b),l.FConditionalFormattingBuilder=p,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
10
|
-
(function(K,T){typeof exports=="object"&&typeof module<"u"?T(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"],T):(K=typeof globalThis<"u"?globalThis:K||self,T(K.UniverSheetsConditionalFormattingUi={},K.UniverCore,K.UniverSheetsConditionalFormatting,K.UniverSheets,K.UniverUi,K.React,K.React,K.UniverDesign,K.UniverEngineFormula,K.UniverSheetsUi,K.ReactDOM,K.rxjs,K.UniverSheetsFormulaUi,K.UniverEngineRender,K.rxjs.operators))})(this,function(K,T,c,q,te,_,U,ne,Gt,fe,Cn,Ce,Ge,Tn,qe){"use strict";var Ro=Object.defineProperty;var _o=(K,T,c)=>T in K?Ro(K,T,{enumerable:!0,configurable:!0,writable:!0,value:c}):K[T]=c;var De=(K,T,c)=>_o(K,typeof T!="symbol"?T+"":T,c);const qt={type:T.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),y=t.get(T.ICommandService),p=t.get(T.IUniverInstanceService),S=q.getSheetCommandTarget(p);if(!S)return!1;const{unitId:m,subUnitId:I}=S,E=u.createCfId(m,I),w={ranges:r,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},Xe={type:T.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(T.IUndoRedoService),a=t.get(T.ICommandService),o=t.get(c.ConditionalFormattingRuleModel),u=t.get(T.IUniverInstanceService),y=q.getSheetCommandTarget(u);if(!y)return!1;const{unitId:p,subUnitId:S}=y,m=o.createCfId(p,S),I={unitId:p,subUnitId:S,rule:{...r,cfId:r.cfId||m}},E=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:[E]}),w}},Xt={type:T.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(T.ICommandService),y=t.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:S,subUnitId:m}=p,I=o.createCfId(S,m),E={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:S,subUnitId:m,rule:E})}},Yt={type:T.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:y,stopIfTrue:p,isShowValue:S}=e,m=t.get(c.ConditionalFormattingRuleModel),I=t.get(T.IUniverInstanceService),E=q.getSheetCommandTarget(I);if(!E)return!1;const{unitId:w,subUnitId:C}=E,R=t.get(T.ICommandService),h=m.createCfId(w,C),i={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:S,config:{min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return R.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:C,rule:i})}},Kt={type:T.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(T.ICommandService),y=t.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:S,subUnitId:m}=p,I=o.createCfId(S,m),E={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:S,subUnitId:m,rule:E})}},$t={type:T.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,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(T.ICommandService),S=t.get(T.IUniverInstanceService),m=q.getSheetCommandTarget(S);if(!m)return!1;const{unitId:I,subUnitId:E}=m,w=y.createCfId(I,E);let C;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const R=u;if(R.length!==2||!Array.isArray(R))return!1;C={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;C={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:E,rule:C})}},Zt={type:T.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:y}=e,p=t.get(c.ConditionalFormattingRuleModel),S=t.get(T.IUniverInstanceService),m=t.get(T.ICommandService),I=q.getSheetCommandTarget(S);if(!I)return!1;const{unitId:E,subUnitId:w}=I,C=p.createCfId(E,w),R={ranges:r,cfId:C,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:n,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:w,rule:R})}},Jt={type:T.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,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(T.IUniverInstanceService),S=q.getSheetCommandTarget(p);if(!S)return!1;const{unitId:m,subUnitId:I}=S,E=t.get(T.ICommandService),w=y.createCfId(m,I),C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:n,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:C})}},Qt={type:T.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),y=t.get(T.IUniverInstanceService),p=t.get(T.ICommandService),S=q.getSheetCommandTarget(y);if(!S)return!1;const{unitId:m,subUnitId:I}=S,E=u.createCfId(m,I),w={ranges:r,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},en={type:T.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(T.IUniverInstanceService),y=t.get(T.ICommandService),p=q.getSheetCommandTarget(u);if(!p)return!1;const{unitId:S,subUnitId:m}=p,I=o.createCfId(S,m),E={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:S,subUnitId:m,rule:E})}},yt={type:T.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(T.IUniverInstanceService),a=t.get(T.ICommandService),o=t.get(T.IUndoRedoService),u=t.get(q.SheetsSelectionsService),y=q.getSheetCommandTarget(n,e);if(!y)return!1;const{unitId:p,subUnitId:S}=y,m=((R=u.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],I=r.getSubunitRules(p,S);if(!(I!=null&&I.length)||!m.length)return!1;const E=[],w=[];I.forEach(h=>{const i=new T.ObjectMatrix;h.ranges.forEach(d=>{T.Range.foreach(d,(b,l)=>{i.setValue(b,l,1)})}),m.forEach(d=>{T.Range.foreach(d,(b,l)=>{i.realDeleteValue(b,l)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(i));if(s.length){const d={...h,ranges:s},b={unitId:p,subUnitId:S,rule:d},l=c.setConditionalRuleMutationUndoFactory(t,b);E.push({id:c.SetConditionalRuleMutation.id,params:b}),w.push(...l)}else{const d={unitId:p,subUnitId:S,cfId:h.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(t,d);E.push({id:c.DeleteConditionalRuleMutation.id,params:d}),w.push(...b)}});const C=T.sequenceExecute(E,a).result;return C&&o.pushUndoRedo({unitID:p,redoMutations:E,undoMutations:w}),C}},Ye={type:T.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(T.IUniverInstanceService),a=t.get(T.ICommandService),o=t.get(T.IUndoRedoService),u=q.getSheetCommandTarget(n,e);if(!u)return!1;const{unitId:y,subUnitId:p}=u,S=r.getSubunitRules(y,p);if(!(S!=null&&S.length))return!1;const m=S.map(C=>({cfId:C.cfId,unitId:y,subUnitId:p})),I=m.map(C=>({id:c.DeleteConditionalRuleMutation.id,params:C})),E=m.map(C=>c.DeleteConditionalRuleMutationUndoFactory(t,C)[0]),w=T.sequenceExecute(I,a).result;return w&&o.pushUndoRedo({unitID:y,redoMutations:I,undoMutations:E}),w}},Ke={type:T.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(T.IUndoRedoService),n=t.get(T.ICommandService),a=t.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,e);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,cfId:e.cfId},S=c.DeleteConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:S,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),m}},St={type:T.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(T.IUndoRedoService),n=t.get(T.ICommandService),a=t.get(T.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),u=q.getSheetCommandTarget(a,e);if(!u)return!1;const{unitId:y,subUnitId:p}=u,S=c.transformSupportSymmetryAnchor(e.start,e.end,o.getSubunitRules(y,p)||[],R=>R.cfId);if(!S)return!1;const[m,I]=S,E={unitId:y,subUnitId:p,start:m,end:I},w=c.MoveConditionalRuleMutationUndoFactory(E),C=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,E);return C&&r.pushUndoRedo({unitID:y,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:E}],undoMutations:w}),C}},bt={type:T.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(T.IUndoRedoService),n=t.get(T.ICommandService),a=t.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,e);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,rule:e.rule},S=c.setConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:S,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),m}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",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)},Nr=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=U.forwardRef(function(t,e){var r=t.icon,n=t.id,a=t.className,o=t.extend,u=Nr(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),p=U.useRef("_".concat(Vr()));return In(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Se({ref:e,className:y},u),o)});function In(t,e,r,n,a){return U.createElement(t.tag,Se(Se({key:e},Lr(t,r,a)),n),(Ur(t,r).children||[]).map(function(o,u){return In(o,"".concat(e,"-").concat(t.tag,"-").concat(u),r,void 0,a)}))}function Lr(t,e,r){var n=Se({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),t.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});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],y=o[1];typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Ur(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 Vr(){return Math.random().toString(36).substring(2,8)}Ve.displayName="UniverIcon";var zr={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=U.forwardRef(function(t,e){return U.createElement(Ve,Object.assign({},t,{id:"delete-single",ref:e,icon:zr}))});Ct.displayName="DeleteSingle";var kr={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"}}]},wn=U.forwardRef(function(t,e){return U.createElement(Ve,Object.assign({},t,{id:"increase-single",ref:e,icon:kr}))});wn.displayName="IncreaseSingle";var Ar={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=U.forwardRef(function(t,e){return U.createElement(Ve,Object.assign({},t,{id:"more-down-single",ref:e,icon:Ar}))});Tt.displayName="MoreDownSingle";var Wr={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"}}]}]},Rn=U.forwardRef(function(t,e){return U.createElement(Ve,Object.assign({},t,{id:"sequence-single",ref:e,icon:Wr}))});Rn.displayName="SequenceSingle";var jr={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=U.forwardRef(function(t,e){return U.createElement(Ve,Object.assign({},t,{id:"slash-single",ref:e,icon:jr}))});$e.displayName="SlashSingle";function Hr(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 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:{}},Br=Je.exports,En;function nn(){return En||(En=1,function(t,e){(function(r,n){n(e)})(Br,function(r){function n(H){return function(se,M,D,N,k,Y,W){return H(se,M,W)}}function a(H){return function(se,M,D,N){if(!se||!M||typeof se!="object"||typeof M!="object")return H(se,M,D,N);var k=N.get(se),Y=N.get(M);if(k&&Y)return k===M&&Y===se;N.set(se,M),N.set(M,se);var W=H(se,M,D,N);return N.delete(se),N.delete(M),W}}function o(H,Q){var se={};for(var M in H)se[M]=H[M];for(var M in Q)se[M]=Q[M];return se}function u(H){return H.constructor===Object||H.constructor==null}function y(H){return typeof H.then=="function"}function p(H,Q){return H===Q||H!==H&&Q!==Q}var S="[object Arguments]",m="[object Boolean]",I="[object Date]",E="[object RegExp]",w="[object Map]",C="[object Number]",R="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function d(H){var Q=H.areArraysEqual,se=H.areDatesEqual,M=H.areMapsEqual,D=H.areObjectsEqual,N=H.areRegExpsEqual,k=H.areSetsEqual,Y=H.createIsNestedEqual,W=Y(Z);function Z($,ee,de){if($===ee)return!0;if(!$||!ee||typeof $!="object"||typeof ee!="object")return $!==$&&ee!==ee;if(u($)&&u(ee))return D($,ee,W,de);var Le=Array.isArray($),be=Array.isArray(ee);if(Le||be)return Le===be&&Q($,ee,W,de);var ve=s.call($);return ve!==s.call(ee)?!1:ve===I?se($,ee,W,de):ve===E?N($,ee,W,de):ve===w?M($,ee,W,de):ve===h?k($,ee,W,de):ve===R||ve===S?y($)||y(ee)?!1:D($,ee,W,de):ve===m||ve===C||ve===i?p($.valueOf(),ee.valueOf()):!1}return Z}function b(H,Q,se,M){var D=H.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!se(H[D],Q[D],D,D,H,Q,M))return!1;return!0}var l=a(b);function g(H,Q){return p(H.valueOf(),Q.valueOf())}function f(H,Q,se,M){var D=H.size===Q.size;if(!D)return!1;if(!H.size)return!0;var N={},k=0;return H.forEach(function(Y,W){if(D){var Z=!1,$=0;Q.forEach(function(ee,de){!Z&&!N[$]&&(Z=se(W,de,k,$,H,Q,M)&&se(Y,ee,W,de,H,Q,M))&&(N[$]=!0),$++}),k++,D=Z}}),D}var v=a(f),P="_owner",x=Object.prototype.hasOwnProperty;function z(H,Q,se,M){var D=Object.keys(H),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===P){var Y=!!H.$$typeof,W=!!Q.$$typeof;if((Y||W)&&Y!==W)return!1}if(!x.call(Q,k)||!se(H[k],Q[k],k,k,H,Q,M))return!1}return!0}var V=a(z);function O(H,Q){return H.source===Q.source&&H.flags===Q.flags}function L(H,Q,se,M){var D=H.size===Q.size;if(!D)return!1;if(!H.size)return!0;var N={};return H.forEach(function(k,Y){if(D){var W=!1,Z=0;Q.forEach(function($,ee){!W&&!N[Z]&&(W=se(k,$,Y,ee,H,Q,M))&&(N[Z]=!0),Z++}),D=W}}),D}var B=a(L),X=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:f,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:n}),J=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:V,areRegExpsEqual:O,areSetsEqual:B,createIsNestedEqual:n}),le=d(X);function oe(H,Q){return le(H,Q,void 0)}var F=d(o(X,{createIsNestedEqual:function(){return p}}));function j(H,Q){return F(H,Q,void 0)}var re=d(J);function ie(H,Q){return re(H,Q,new WeakMap)}var ue=d(o(J,{createIsNestedEqual:function(){return p}}));function ge(H,Q){return ue(H,Q,new WeakMap)}function ye(H){return d(o(X,H(X)))}function Te(H){var Q=d(o(J,H(J)));return function(se,M,D){return D===void 0&&(D=new WeakMap),Q(se,M,D)}}r.circularDeepEqual=ie,r.circularShallowEqual=ge,r.createCustomCircularEqual=Te,r.createCustomEqual=ye,r.deepEqual=oe,r.sameValueZeroEqual=p,r.shallowEqual=j,Object.defineProperty(r,"__esModule",{value:!0})})}(Je,Je.exports)),Je.exports}var It={exports:{}},On;function rn(){if(On)return It.exports;On=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 ae={},an,Mn;function Fr(){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 ae;Dn=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=n,ae.childrenEqual=p,ae.cloneLayout=a,ae.cloneLayoutItem=y,ae.collides=m,ae.compact=I,ae.compactItem=C,ae.compactType=H,ae.correctBounds=R,ae.fastPositionEqual=S,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=i,ae.getLayoutItem=h,ae.getStatics=d,ae.modifyLayout=o,ae.moveElement=b,ae.moveElementAwayFromCollision=l,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=F,ae.setTopLeft=re,ae.setTransform=j,ae.sortLayoutItems=ie,ae.sortLayoutItemsByColRow=ge,ae.sortLayoutItemsByRowCol=ue,ae.synchronizeLayoutWithChildren=ye,ae.validateLayout=Te,ae.withLayoutItem=u;var t=nn(),e=r(U);function r(M){return M&&M.__esModule?M:{default:M}}function n(M){let D=0,N;for(let k=0,Y=M.length;k<Y;k++)N=M[k].y+M[k].h,N>D&&(D=N);return D}function a(M){const D=Array(M.length);for(let N=0,k=M.length;N<k;N++)D[N]=y(M[N]);return D}function o(M,D){const N=Array(M.length);for(let k=0,Y=M.length;k<Y;k++)D.i===M[k].i?N[k]=D:N[k]=M[k];return N}function u(M,D,N){let k=h(M,D);return k?(k=N(y(k)),M=o(M,k),[M,k]):[M,null]}function y(M){return{w:M.w,h:M.h,x:M.x,y:M.y,i:M.i,minW:M.minW,maxW:M.maxW,minH:M.minH,maxH:M.maxH,moved:!!M.moved,static:!!M.static,isDraggable:M.isDraggable,isResizable:M.isResizable,resizeHandles:M.resizeHandles,isBounded:M.isBounded}}function p(M,D){return(0,t.deepEqual)(e.default.Children.map(M,N=>N==null?void 0:N.key),e.default.Children.map(D,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(M,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}ae.fastRGLPropsEqual=Fr();function S(M,D){return M.left===D.left&&M.top===D.top&&M.width===D.width&&M.height===D.height}function m(M,D){return!(M.i===D.i||M.x+M.w<=D.x||M.x>=D.x+D.w||M.y+M.h<=D.y||M.y>=D.y+D.h)}function I(M,D,N,k){const Y=d(M),W=ie(M,D),Z=Array(M.length);for(let $=0,ee=W.length;$<ee;$++){let de=y(W[$]);de.static||(de=C(Y,de,D,N,W,k),Y.push(de)),Z[M.indexOf(W[$])]=de,de.moved=!1}return Z}const E={x:"w",y:"h"};function w(M,D,N,k){const Y=E[k];D[k]+=1;const W=M.map(Z=>Z.i).indexOf(D.i);for(let Z=W+1;Z<M.length;Z++){const $=M[Z];if(!$.static){if($.y>D.y+D.h)break;m(D,$)&&w(M,$,N+D[Y],k)}}D[k]=N}function C(M,D,N,k,Y,W){const Z=N==="vertical",$=N==="horizontal";if(Z)for(D.y=Math.min(n(M),D.y);D.y>0&&!i(M,D);)D.y--;else if($)for(;D.x>0&&!i(M,D);)D.x--;let ee;for(;(ee=i(M,D))&&!(N===null&&W);)if($?w(Y,D,ee.x+ee.w,"x"):w(Y,D,ee.y+ee.h,"y"),$&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(M,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function R(M,D){const N=d(M);for(let k=0,Y=M.length;k<Y;k++){const W=M[k];if(W.x+W.w>D.cols&&(W.x=D.cols-W.w),W.x<0&&(W.x=0,W.w=D.cols),!W.static)N.push(W);else for(;i(N,W);)W.y++}return M}function h(M,D){for(let N=0,k=M.length;N<k;N++)if(M[N].i===D)return M[N]}function i(M,D){for(let N=0,k=M.length;N<k;N++)if(m(M[N],D))return M[N]}function s(M,D){return M.filter(N=>m(N,D))}function d(M){return M.filter(D=>D.static)}function b(M,D,N,k,Y,W,Z,$,ee){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return M;`${D.i}${String(N)}${String(k)}${D.x}${D.y}`;const de=D.x,Le=D.y;typeof N=="number"&&(D.x=N),typeof k=="number"&&(D.y=k),D.moved=!0;let be=ie(M,Z);(Z==="vertical"&&typeof k=="number"?Le>=k:Z==="horizontal"&&typeof N=="number"?de>=N:!1)&&(be=be.reverse());const Fe=s(be,D),Ft=Fe.length>0;if(Ft&&ee)return a(M);if(Ft&&W)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,M;for(let bn=0,wo=Fe.length;bn<wo;bn++){const Ue=Fe[bn];`${D.i}${D.x}${D.y}${Ue.i}${Ue.x}${Ue.y}`,!Ue.moved&&(Ue.static?M=l(M,Ue,D,Y,Z):M=l(M,D,Ue,Y,Z))}return M}function l(M,D,N,k,Y,W){const Z=Y==="horizontal",$=Y==="vertical",ee=D.static;if(k){k=!1;const be={x:Z?Math.max(D.x-N.w,0):N.x,y:$?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(M,be),Fe=ve&&ve.y+ve.h>D.y,Ft=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&$)return b(M,N,void 0,D.y+1,k,ee,Y);if(Fe&&Y==null)return D.y=N.y,N.y=N.y+N.h,M;if(Ft&&Z)return b(M,D,N.x,void 0,k,ee,Y)}else return`${N.i}${be.x}${be.y}`,b(M,N,Z?be.x:void 0,$?be.y:void 0,k,ee,Y)}const de=Z?N.x+1:void 0,Le=$?N.y+1:void 0;return de==null&&Le==null?M:b(M,N,Z?N.x+1:void 0,$?N.y+1:void 0,k,ee,Y)}function g(M){return M*100+"%"}const f=(M,D,N,k)=>M+N>k?D:N,v=(M,D,N)=>M<0?D:N,P=M=>Math.max(0,M),x=M=>Math.max(0,M),z=(M,D,N)=>{let{left:k,height:Y,width:W}=D;const Z=M.top-(Y-M.height);return{left:k,width:W,height:v(Z,M.height,Y),top:x(Z)}},V=(M,D,N)=>{let{top:k,left:Y,height:W,width:Z}=D;return{top:k,height:W,width:f(M.left,M.width,Z,N),left:P(Y)}},O=(M,D,N)=>{let{top:k,height:Y,width:W}=D;const Z=M.left-(W-M.width);return{height:Y,width:Z<0?M.width:f(M.left,M.width,W,N),top:x(k),left:P(Z)}},L=(M,D,N)=>{let{top:k,left:Y,height:W,width:Z}=D;return{width:Z,left:Y,height:v(k,M.height,W),top:x(k)}},oe={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],V(...arguments))},e:V,se:function(){return L(arguments.length<=0?void 0:arguments[0],V(...arguments))},s:L,sw:function(){return L(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(M,D,N,k){const Y=oe[M];return Y?Y(D,{...D,...N},k):N}function j(M){let{top:D,left:N,width:k,height:Y}=M;const W=`translate(${N}px,${D}px)`;return{transform:W,WebkitTransform:W,MozTransform:W,msTransform:W,OTransform:W,width:`${k}px`,height:`${Y}px`,position:"absolute"}}function re(M){let{top:D,left:N,width:k,height:Y}=M;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${Y}px`,position:"absolute"}}function ie(M,D){return D==="horizontal"?ge(M):D==="vertical"?ue(M):M}function ue(M){return M.slice(0).sort(function(D,N){return D.y>N.y||D.y===N.y&&D.x>N.x?1:D.y===N.y&&D.x===N.x?0:-1})}function ge(M){return M.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(M,D,N,k,Y){M=M||[];const W=[];e.default.Children.forEach(D,$=>{if(($==null?void 0:$.key)==null)return;const ee=h(M,String($.key)),de=$.props["data-grid"];ee&&de==null?W.push(y(ee)):de?W.push(y({...de,i:$.key})):W.push(y({w:1,h:1,x:0,y:n(W),i:String($.key)}))});const Z=R(W,{cols:N});return Y?Z:I(Z,k,N)}function Te(M){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(M))throw new Error(D+" must be an array!");for(let k=0,Y=M.length;k<Y;k++){const W=M[k];for(let Z=0;Z<N.length;Z++){const $=N[Z],ee=W[$];if(typeof ee!="number"||Number.isNaN(ee))throw new Error(`ReactGridLayout: ${D}[${k}].${$} must be a number! Received: ${ee} (${typeof ee})`)}if(typeof W.i<"u"&&typeof W.i!="string")throw new Error(`ReactGridLayout: ${D}[${k}].i must be a string! Received: ${W.i} (${typeof W.i})`)}}function H(M){const{verticalCompact:D,compactType:N}=M||{};return D===!1?null:N}function Q(){}const se=()=>{};return ae.noop=se,ae}var we={},Pn;function on(){if(Pn)return we;Pn=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:y,containerPadding:p,containerWidth:S,cols:m}=u;return(S-y[0]*(m-1)-p[0]*2)/m}function e(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function r(u,y,p,S,m,I){const{margin:E,containerPadding:w,rowHeight:C}=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(S,R,E[0]),h.height=e(m,C,E[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((C+E[1])*p+w[1]),h.left=Math.round((R+E[0])*y+w[0])),h}function n(u,y,p,S,m){const{margin:I,containerPadding:E,cols:w,rowHeight:C,maxRows:R}=u,h=t(u);let i=Math.round((p-E[0])/(h+I[0])),s=Math.round((y-E[1])/(C+I[1]));return i=o(i,0,w-S),s=o(s,0,R-m),{x:i,y:s}}function a(u,y,p,S,m,I){const{margin:E,maxRows:w,cols:C,rowHeight:R}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(R+E[1])),d=o(i,0,C-S),b=o(s,0,w-m);return["sw","w","nw"].indexOf(I)!==-1&&(d=o(i,0,C)),["nw","n","ne"].indexOf(I)!==-1&&(b=o(s,0,w)),{w:d,h:b}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return we}var Qe={},sn={exports:{}},ln,xn;function Gr(){if(xn)return ln;xn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ln=t,ln}var cn,Nn;function qr(){if(Nn)return cn;Nn=1;var t=Gr();function e(){}function r(){}return r.resetWarningCache=e,cn=function(){function n(u,y,p,S,m,I){if(I!==t){var E=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 E.name="Invariant Violation",E}}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},cn}var Ln;function Ee(){return Ln||(Ln=1,sn.exports=qr()()),sn.exports}var et={exports:{}},un={};function Un(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=Un(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Vn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Un(t))&&(n&&(n+=" "),n+=e);return n}const Xr=_n(Object.freeze(Object.defineProperty({__proto__:null,clsx:Vn,default:Vn},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},zn;function wt(){if(zn)return Oe;zn=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 y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}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,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Me={},kn;function Yr(){if(kn)return Me;kn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.browserPrefixToKey=r,Me.browserPrefixToStyle=n,Me.default=void 0,Me.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 y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<t.length;p++)if(r(u,t[p])in y)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="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Me.default=e(),Me}var An;function dn(){if(An)return pe;An=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=d,pe.createCSSTransform=C,pe.createSVGTransform=R,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=I,pe.innerWidth=E,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=w,pe.outerHeight=S,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=b;var t=wt(),e=n(Yr());function r(f){if(typeof WeakMap!="function")return null;var v=new WeakMap,P=new WeakMap;return(r=function(x){return x?P: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 P=r(v);if(P&&P.has(f))return P.get(f);var x={},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(x,V,O):x[V]=f[V]}return x.default=f,P&&P.set(f,x),x}let a="";function o(f,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,t.isFunction)(f[P])})),(0,t.isFunction)(f[a])?f[a](v):!1}function u(f,v,P){let x=f;do{if(o(x,v))return!0;if(x===P)return!1;x=x.parentNode}while(x);return!1}function y(f,v,P,x){if(!f)return;const z={capture:!0,...x};f.addEventListener?f.addEventListener(v,P,z):f.attachEvent?f.attachEvent("on"+v,P):f["on"+v]=P}function p(f,v,P,x){if(!f)return;const z={capture:!0,...x};f.removeEventListener?f.removeEventListener(v,P,z):f.detachEvent?f.detachEvent("on"+v,P):f["on"+v]=null}function S(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,t.int)(P.borderTopWidth),v+=(0,t.int)(P.borderBottomWidth),v}function m(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,t.int)(P.borderLeftWidth),v+=(0,t.int)(P.borderRightWidth),v}function I(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,t.int)(P.paddingTop),v-=(0,t.int)(P.paddingBottom),v}function E(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,t.int)(P.paddingLeft),v-=(0,t.int)(P.paddingRight),v}function w(f,v,P){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),V=(f.clientX+v.scrollLeft-z.left)/P,O=(f.clientY+v.scrollTop-z.top)/P;return{x:V,y:O}}function C(f,v){const P=h(f,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:P}}function R(f,v){return h(f,v,"")}function h(f,v,P){let{x,y:z}=f,V="translate(".concat(x).concat(P,",").concat(z).concat(P,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+P),L="".concat(typeof v.y=="string"?v.y:v.y+P);V="translate(".concat(O,", ").concat(L,")")+V}return V}function i(f,v){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,P=>v===P.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,P=>v===P.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;}
|
|
10
|
+
(function($,_){typeof exports=="object"&&typeof module<"u"?_(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"],_):($=typeof globalThis<"u"?globalThis:$||self,_($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,_,c,Y,te,R,V,ee,kt,fe,pr,Ce,Ge,hr,qe){"use strict";var mo=Object.defineProperty;var yo=($,_,c)=>_ in $?mo($,_,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[_]=c;var De=($,_,c)=>yo($,typeof _!="symbol"?_+"":_,c);const At={type:_.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.ICommandService),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Wt={type:_.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},jt={type:_.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:C}=e,m=t.get(c.ConditionalFormattingRuleModel),w=t.get(_.IUniverInstanceService),E=Y.getSheetCommandTarget(w);if(!E)return!1;const{unitId:I,subUnitId:S}=E,T=t.get(_.ICommandService),h=m.createCfId(I,S),i={ranges:n,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:C,config:{min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return T.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:S,rule:i})}},Ht={type:_.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},Bt={type:_.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.ICommandService),C=t.get(_.IUniverInstanceService),m=Y.getSheetCommandTarget(C);if(!m)return!1;const{unitId:w,subUnitId:E}=m,I=y.createCfId(w,E);let S;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const T=u;if(T.length!==2||!Array.isArray(T))return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}else{const T=u;if(typeof T!="number")return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:E,rule:S})}},Ft={type:_.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),C=t.get(_.IUniverInstanceService),m=t.get(_.ICommandService),w=Y.getSheetCommandTarget(C);if(!w)return!1;const{unitId:E,subUnitId:I}=w,S=p.createCfId(E,I),T={ranges:n,cfId:S,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:r,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:I,rule:T})}},Gt={type:_.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=t.get(_.ICommandService),I=y.createCfId(m,w),S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:r,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:S})}},qt={type:_.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.IUniverInstanceService),p=t.get(_.ICommandService),C=Y.getSheetCommandTarget(y);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:r}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Xt={type:_.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.IUniverInstanceService),y=t.get(_.ICommandService),p=Y.getSheetCommandTarget(u);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",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 be=function(){return be=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},be.apply(this,arguments)},_n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n},Ue=V.forwardRef(function(t,e){var n=t.icon,r=t.id,a=t.className,o=t.extend,u=_n(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),p=V.useRef("_".concat(On()));return gr(n,"".concat(r),{defIds:n.defIds,idSuffix:p.current},be({ref:e,className:y},u),o)});function gr(t,e,n,r,a){return V.createElement(t.tag,be(be({key:e},Rn(t,n,a)),r),(En(t,n).children||[]).map(function(o,u){return gr(o,"".concat(e,"-").concat(t.tag,"-").concat(u),n,void 0,a)}))}function Rn(t,e,n){var r=be({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),t.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function En(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?be(be({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?be(be({},a),{attrs:be(be({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function On(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var Pn={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"}}]},gt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:Pn}))});gt.displayName="DeleteSingle";var Dn={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"}}]},vr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Dn}))});vr.displayName="IncreaseSingle";var xn={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"}}]},vt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:xn}))});vt.displayName="MoreDownSingle";var Mn={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"}}]}]},mr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Mn}))});mr.displayName="SequenceSingle";var Nn={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"}}]}]},Xe=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:Nn}))});Xe.displayName="SlashSingle";function Ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var Yt={exports:{}},Ye={},Ke={exports:{}},Vn=Ke.exports,br;function Kt(){return br||(br=1,function(t,e){(function(n,r){r(e)})(Vn,function(n){function r(j){return function(se,P,D,N,k,X,H){return j(se,P,H)}}function a(j){return function(se,P,D,N){if(!se||!P||typeof se!="object"||typeof P!="object")return j(se,P,D,N);var k=N.get(se),X=N.get(P);if(k&&X)return k===P&&X===se;N.set(se,P),N.set(P,se);var H=j(se,P,D,N);return N.delete(se),N.delete(P),H}}function o(j,Q){var se={};for(var P in j)se[P]=j[P];for(var P in Q)se[P]=Q[P];return se}function u(j){return j.constructor===Object||j.constructor==null}function y(j){return typeof j.then=="function"}function p(j,Q){return j===Q||j!==j&&Q!==Q}var C="[object Arguments]",m="[object Boolean]",w="[object Date]",E="[object RegExp]",I="[object Map]",S="[object Number]",T="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function f(j){var Q=j.areArraysEqual,se=j.areDatesEqual,P=j.areMapsEqual,D=j.areObjectsEqual,N=j.areRegExpsEqual,k=j.areSetsEqual,X=j.createIsNestedEqual,H=X(Z);function Z(K,re,de){if(K===re)return!0;if(!K||!re||typeof K!="object"||typeof re!="object")return K!==K&&re!==re;if(u(K)&&u(re))return D(K,re,H,de);var Le=Array.isArray(K),Se=Array.isArray(re);if(Le||Se)return Le===Se&&Q(K,re,H,de);var ve=s.call(K);return ve!==s.call(re)?!1:ve===w?se(K,re,H,de):ve===E?N(K,re,H,de):ve===I?P(K,re,H,de):ve===h?k(K,re,H,de):ve===T||ve===C?y(K)||y(re)?!1:D(K,re,H,de):ve===m||ve===S||ve===i?p(K.valueOf(),re.valueOf()):!1}return Z}function b(j,Q,se,P){var D=j.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!se(j[D],Q[D],D,D,j,Q,P))return!1;return!0}var l=a(b);function g(j,Q){return p(j.valueOf(),Q.valueOf())}function d(j,Q,se,P){var D=j.size===Q.size;if(!D)return!1;if(!j.size)return!0;var N={},k=0;return j.forEach(function(X,H){if(D){var Z=!1,K=0;Q.forEach(function(re,de){!Z&&!N[K]&&(Z=se(H,de,k,K,j,Q,P)&&se(X,re,H,de,j,Q,P))&&(N[K]=!0),K++}),k++,D=Z}}),D}var v=a(d),x="_owner",M=Object.prototype.hasOwnProperty;function z(j,Q,se,P){var D=Object.keys(j),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===x){var X=!!j.$$typeof,H=!!Q.$$typeof;if((X||H)&&X!==H)return!1}if(!M.call(Q,k)||!se(j[k],Q[k],k,k,j,Q,P))return!1}return!0}var U=a(z);function O(j,Q){return j.source===Q.source&&j.flags===Q.flags}function L(j,Q,se,P){var D=j.size===Q.size;if(!D)return!1;if(!j.size)return!0;var N={};return j.forEach(function(k,X){if(D){var H=!1,Z=0;Q.forEach(function(K,re){!H&&!N[Z]&&(H=se(k,K,X,re,j,Q,P))&&(N[Z]=!0),Z++}),D=H}}),D}var F=a(L),q=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:r}),J=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:U,areRegExpsEqual:O,areSetsEqual:F,createIsNestedEqual:r}),le=f(q);function ae(j,Q){return le(j,Q,void 0)}var B=f(o(q,{createIsNestedEqual:function(){return p}}));function W(j,Q){return B(j,Q,void 0)}var ne=f(J);function ie(j,Q){return ne(j,Q,new WeakMap)}var ue=f(o(J,{createIsNestedEqual:function(){return p}}));function ge(j,Q){return ue(j,Q,new WeakMap)}function ye(j){return f(o(q,j(q)))}function Te(j){var Q=f(o(J,j(J)));return function(se,P,D){return D===void 0&&(D=new WeakMap),Q(se,P,D)}}n.circularDeepEqual=ie,n.circularShallowEqual=ge,n.createCustomCircularEqual=Te,n.createCustomEqual=ye,n.deepEqual=ae,n.sameValueZeroEqual=p,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})}(Ke,Ke.exports)),Ke.exports}var mt={exports:{}},Sr;function Zt(){if(Sr)return mt.exports;Sr=1;function t(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(a=t(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var n,r,a=0,o="",u=arguments.length;a<u;a++)(n=arguments[a])&&(r=t(n))&&(o&&(o+=" "),o+=r);return o}return mt.exports=e,mt.exports.clsx=e,mt.exports}var oe={},$t,Cr;function Un(){return Cr||(Cr=1,$t=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)}),$t}var Tr;function ze(){if(Tr)return oe;Tr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.bottom=r,oe.childrenEqual=p,oe.cloneLayout=a,oe.cloneLayoutItem=y,oe.collides=m,oe.compact=w,oe.compactItem=S,oe.compactType=j,oe.correctBounds=T,oe.fastPositionEqual=C,oe.fastRGLPropsEqual=void 0,oe.getAllCollisions=s,oe.getFirstCollision=i,oe.getLayoutItem=h,oe.getStatics=f,oe.modifyLayout=o,oe.moveElement=b,oe.moveElementAwayFromCollision=l,oe.noop=void 0,oe.perc=g,oe.resizeItemInDirection=B,oe.setTopLeft=ne,oe.setTransform=W,oe.sortLayoutItems=ie,oe.sortLayoutItemsByColRow=ge,oe.sortLayoutItemsByRowCol=ue,oe.synchronizeLayoutWithChildren=ye,oe.validateLayout=Te,oe.withLayoutItem=u;var t=Kt(),e=n(V);function n(P){return P&&P.__esModule?P:{default:P}}function r(P){let D=0,N;for(let k=0,X=P.length;k<X;k++)N=P[k].y+P[k].h,N>D&&(D=N);return D}function a(P){const D=Array(P.length);for(let N=0,k=P.length;N<k;N++)D[N]=y(P[N]);return D}function o(P,D){const N=Array(P.length);for(let k=0,X=P.length;k<X;k++)D.i===P[k].i?N[k]=D:N[k]=P[k];return N}function u(P,D,N){let k=h(P,D);return k?(k=N(y(k)),P=o(P,k),[P,k]):[P,null]}function y(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,D){return(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.key),e.default.Children.map(D,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(D,N=>N==null?void 0:N.props["data-grid"]))}oe.fastRGLPropsEqual=Un();function C(P,D){return P.left===D.left&&P.top===D.top&&P.width===D.width&&P.height===D.height}function m(P,D){return!(P.i===D.i||P.x+P.w<=D.x||P.x>=D.x+D.w||P.y+P.h<=D.y||P.y>=D.y+D.h)}function w(P,D,N,k){const X=f(P),H=ie(P,D),Z=Array(P.length);for(let K=0,re=H.length;K<re;K++){let de=y(H[K]);de.static||(de=S(X,de,D,N,H,k),X.push(de)),Z[P.indexOf(H[K])]=de,de.moved=!1}return Z}const E={x:"w",y:"h"};function I(P,D,N,k){const X=E[k];D[k]+=1;const H=P.map(Z=>Z.i).indexOf(D.i);for(let Z=H+1;Z<P.length;Z++){const K=P[Z];if(!K.static){if(K.y>D.y+D.h)break;m(D,K)&&I(P,K,N+D[X],k)}}D[k]=N}function S(P,D,N,k,X,H){const Z=N==="vertical",K=N==="horizontal";if(Z)for(D.y=Math.min(r(P),D.y);D.y>0&&!i(P,D);)D.y--;else if(K)for(;D.x>0&&!i(P,D);)D.x--;let re;for(;(re=i(P,D))&&!(N===null&&H);)if(K?I(X,D,re.x+re.w,"x"):I(X,D,re.y+re.h,"y"),K&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(P,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function T(P,D){const N=f(P);for(let k=0,X=P.length;k<X;k++){const H=P[k];if(H.x+H.w>D.cols&&(H.x=D.cols-H.w),H.x<0&&(H.x=0,H.w=D.cols),!H.static)N.push(H);else for(;i(N,H);)H.y++}return P}function h(P,D){for(let N=0,k=P.length;N<k;N++)if(P[N].i===D)return P[N]}function i(P,D){for(let N=0,k=P.length;N<k;N++)if(m(P[N],D))return P[N]}function s(P,D){return P.filter(N=>m(N,D))}function f(P){return P.filter(D=>D.static)}function b(P,D,N,k,X,H,Z,K,re){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return P;`${D.i}${String(N)}${String(k)}${D.x}${D.y}`;const de=D.x,Le=D.y;typeof N=="number"&&(D.x=N),typeof k=="number"&&(D.y=k),D.moved=!0;let Se=ie(P,Z);(Z==="vertical"&&typeof k=="number"?Le>=k:Z==="horizontal"&&typeof N=="number"?de>=N:!1)&&(Se=Se.reverse());const Fe=s(Se,D),zt=Fe.length>0;if(zt&&re)return a(P);if(zt&&H)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,P;for(let fr=0,vo=Fe.length;fr<vo;fr++){const Ve=Fe[fr];`${D.i}${D.x}${D.y}${Ve.i}${Ve.x}${Ve.y}`,!Ve.moved&&(Ve.static?P=l(P,Ve,D,X,Z):P=l(P,D,Ve,X,Z))}return P}function l(P,D,N,k,X,H){const Z=X==="horizontal",K=X==="vertical",re=D.static;if(k){k=!1;const Se={x:Z?Math.max(D.x-N.w,0):N.x,y:K?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(P,Se),Fe=ve&&ve.y+ve.h>D.y,zt=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&K)return b(P,N,void 0,D.y+1,k,re,X);if(Fe&&X==null)return D.y=N.y,N.y=N.y+N.h,P;if(zt&&Z)return b(P,D,N.x,void 0,k,re,X)}else return`${N.i}${Se.x}${Se.y}`,b(P,N,Z?Se.x:void 0,K?Se.y:void 0,k,re,X)}const de=Z?N.x+1:void 0,Le=K?N.y+1:void 0;return de==null&&Le==null?P:b(P,N,Z?N.x+1:void 0,K?N.y+1:void 0,k,re,X)}function g(P){return P*100+"%"}const d=(P,D,N,k)=>P+N>k?D:N,v=(P,D,N)=>P<0?D:N,x=P=>Math.max(0,P),M=P=>Math.max(0,P),z=(P,D,N)=>{let{left:k,height:X,width:H}=D;const Z=P.top-(X-P.height);return{left:k,width:H,height:v(Z,P.height,X),top:M(Z)}},U=(P,D,N)=>{let{top:k,left:X,height:H,width:Z}=D;return{top:k,height:H,width:d(P.left,P.width,Z,N),left:x(X)}},O=(P,D,N)=>{let{top:k,height:X,width:H}=D;const Z=P.left-(H-P.width);return{height:X,width:Z<0?P.width:d(P.left,P.width,H,N),top:M(k),left:x(Z)}},L=(P,D,N)=>{let{top:k,left:X,height:H,width:Z}=D;return{width:Z,left:X,height:v(k,P.height,H),top:M(k)}},ae={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return L(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:L,sw:function(){return L(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 B(P,D,N,k){const X=ae[P];return X?X(D,{...D,...N},k):N}function W(P){let{top:D,left:N,width:k,height:X}=P;const H=`translate(${N}px,${D}px)`;return{transform:H,WebkitTransform:H,MozTransform:H,msTransform:H,OTransform:H,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ne(P){let{top:D,left:N,width:k,height:X}=P;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ie(P,D){return D==="horizontal"?ge(P):D==="vertical"?ue(P):P}function ue(P){return P.slice(0).sort(function(D,N){return D.y>N.y||D.y===N.y&&D.x>N.x?1:D.y===N.y&&D.x===N.x?0:-1})}function ge(P){return P.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(P,D,N,k,X){P=P||[];const H=[];e.default.Children.forEach(D,K=>{if((K==null?void 0:K.key)==null)return;const re=h(P,String(K.key)),de=K.props["data-grid"];re&&de==null?H.push(y(re)):de?H.push(y({...de,i:K.key})):H.push(y({w:1,h:1,x:0,y:r(H),i:String(K.key)}))});const Z=T(H,{cols:N});return X?Z:w(Z,k,N)}function Te(P){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(P))throw new Error(D+" must be an array!");for(let k=0,X=P.length;k<X;k++){const H=P[k];for(let Z=0;Z<N.length;Z++)if(typeof H[N[Z]]!="number")throw new Error("ReactGridLayout: "+D+"["+k+"]."+N[Z]+" must be a number!")}}function j(P){const{verticalCompact:D,compactType:N}=P||{};return D===!1?null:N}function Q(){}const se=()=>{};return oe.noop=se,oe}var Ie={},wr;function Jt(){if(wr)return Ie;wr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=n,Ie.calcGridItemWHPx=e,Ie.calcWH=a,Ie.calcXY=r,Ie.clamp=o;function t(u){const{margin:y,containerPadding:p,containerWidth:C,cols:m}=u;return(C-y[0]*(m-1)-p[0]*2)/m}function e(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function n(u,y,p,C,m,w){const{margin:E,containerPadding:I,rowHeight:S}=u,T=t(u),h={};return w&&w.resizing?(h.width=Math.round(w.resizing.width),h.height=Math.round(w.resizing.height)):(h.width=e(C,T,E[0]),h.height=e(m,S,E[1])),w&&w.dragging?(h.top=Math.round(w.dragging.top),h.left=Math.round(w.dragging.left)):w&&w.resizing&&typeof w.resizing.top=="number"&&typeof w.resizing.left=="number"?(h.top=Math.round(w.resizing.top),h.left=Math.round(w.resizing.left)):(h.top=Math.round((S+E[1])*p+I[1]),h.left=Math.round((T+E[0])*y+I[0])),h}function r(u,y,p,C,m){const{margin:w,cols:E,rowHeight:I,maxRows:S}=u,T=t(u);let h=Math.round((p-w[0])/(T+w[0])),i=Math.round((y-w[1])/(I+w[1]));return h=o(h,0,E-C),i=o(i,0,S-m),{x:h,y:i}}function a(u,y,p,C,m,w){const{margin:E,maxRows:I,cols:S,rowHeight:T}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(T+E[1])),f=o(i,0,S-C),b=o(s,0,I-m);return["sw","w","nw"].indexOf(w)!==-1&&(f=o(i,0,S)),["nw","n","ne"].indexOf(w)!==-1&&(b=o(s,0,I)),{w:f,h:b}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return Ie}var Ze={},Qt={exports:{}},er,Ir;function zn(){if(Ir)return er;Ir=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return er=t,er}var tr,_r;function kn(){if(_r)return tr;_r=1;var t=zn();function e(){}function n(){}return n.resetWarningCache=e,tr=function(){function r(u,y,p,C,m,w){if(w!==t){var E=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 E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},tr}var Rr;function Ee(){return Rr||(Rr=1,Qt.exports=kn()()),Qt.exports}var $e={exports:{}},rr={};function Er(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Er(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Or(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Er(t))&&(r&&(r+=" "),r+=e);return r}const An=yr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Or,default:Or},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},Pr;function yt(){if(Pr)return Oe;Pr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=r,Oe.isFunction=e,Oe.isNum=n;function t(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,u,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Pe={},Dr;function Wn(){if(Dr)return Pe;Dr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=n,Pe.browserPrefixToStyle=r,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 y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<t.length;p++)if(n(u,t[p])in y)return t[p];return""}function n(o,u){return u?"".concat(u).concat(a(o)):o}function r(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Pe.default=e(),Pe}var xr;function nr(){if(xr)return pe;xr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=f,pe.createCSSTransform=S,pe.createSVGTransform=T,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=w,pe.innerWidth=E,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=I,pe.outerHeight=C,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=b;var t=yt(),e=r(Wn());function n(d){if(typeof WeakMap!="function")return null;var v=new WeakMap,x=new WeakMap;return(n=function(M){return M?x:v})(d)}function r(d,v){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var x=n(v);if(x&&x.has(d))return x.get(d);var M={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in d)if(U!=="default"&&Object.prototype.hasOwnProperty.call(d,U)){var O=z?Object.getOwnPropertyDescriptor(d,U):null;O&&(O.get||O.set)?Object.defineProperty(M,U,O):M[U]=d[U]}return M.default=d,x&&x.set(d,M),M}let a="";function o(d,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(x){return(0,t.isFunction)(d[x])})),(0,t.isFunction)(d[a])?d[a](v):!1}function u(d,v,x){let M=d;do{if(o(M,v))return!0;if(M===x)return!1;M=M.parentNode}while(M);return!1}function y(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.addEventListener?d.addEventListener(v,x,z):d.attachEvent?d.attachEvent("on"+v,x):d["on"+v]=x}function p(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.removeEventListener?d.removeEventListener(v,x,z):d.detachEvent?d.detachEvent("on"+v,x):d["on"+v]=null}function C(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderTopWidth),v+=(0,t.int)(x.borderBottomWidth),v}function m(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderLeftWidth),v+=(0,t.int)(x.borderRightWidth),v}function w(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingTop),v-=(0,t.int)(x.paddingBottom),v}function E(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingLeft),v-=(0,t.int)(x.paddingRight),v}function I(d,v,x){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),U=(d.clientX+v.scrollLeft-z.left)/x,O=(d.clientY+v.scrollTop-z.top)/x;return{x:U,y:O}}function S(d,v){const x=h(d,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:x}}function T(d,v){return h(d,v,"")}function h(d,v,x){let{x:M,y:z}=d,U="translate(".concat(M).concat(x,",").concat(z).concat(x,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+x),L="".concat(typeof v.y=="string"?v.y:v.y+x);U="translate(".concat(O,", ").concat(L,")")+U}return U}function i(d,v){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,x=>v===x.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,x=>v===x.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let v=d.getElementById("react-draggable-style-el");v||(v=d.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
11
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 b(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 pe}var Ie={},Wn;function jn(){if(Wn)return Ie;Wn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=a,Ie.canDragY=o,Ie.createCoreData=y,Ie.createDraggableData=p,Ie.getBoundPosition=r,Ie.getControlPosition=u,Ie.snapToGrid=n;var t=wt(),e=dn();function r(I,E,w){if(!I.props.bounds)return[E,w];let{bounds:C}=I.props;C=typeof C=="string"?C:S(C);const R=m(I);if(typeof C=="string"){const{ownerDocument:h}=R,i=h.defaultView;let s;if(C==="parent"?s=R.parentNode:s=h.querySelector(C),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const d=s,b=i.getComputedStyle(R),l=i.getComputedStyle(d);C={left:-R.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-R.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(R)-R.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(R)-R.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(C.right)&&(E=Math.min(E,C.right)),(0,t.isNum)(C.bottom)&&(w=Math.min(w,C.bottom)),(0,t.isNum)(C.left)&&(E=Math.max(E,C.left)),(0,t.isNum)(C.top)&&(w=Math.max(w,C.top)),[E,w]}function n(I,E,w){const C=Math.round(E/I[0])*I[0],R=Math.round(w/I[1])*I[1];return[C,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,E,w){const C=typeof E=="number"?(0,e.getTouch)(I,E):null;if(typeof E=="number"&&!C)return null;const R=m(w),h=w.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,e.offsetXYFromParent)(C||I,h,w.props.scale)}function y(I,E,w){const C=!(0,t.isNum)(I.lastX),R=m(I);return C?{node:R,deltaX:0,deltaY:0,lastX:E,lastY:w,x:E,y:w}:{node:R,deltaX:E-I.lastX,deltaY:w-I.lastY,lastX:I.lastX,lastY:I.lastY,x:E,y:w}}function p(I,E){const w=I.props.scale;return{node:E.node,x:I.state.x+E.deltaX/w,y:I.state.y+E.deltaY/w,deltaX:E.deltaX/w,deltaY:E.deltaY/w,lastX:I.state.x,lastY:I.state.y}}function S(I){return{left:I.left,top:I.top,right:I.right,bottom:I.bottom}}function m(I){const E=I.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return Ie}var tt={},Rt={},Hn;function Bn(){if(Hn)return Rt;Hn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=t;function t(){}return Rt}var Fn;function Kr(){if(Fn)return tt;Fn=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var t=S(U),e=y(Ee()),r=y(Cn),n=dn(),a=jn(),o=wt(),u=y(Bn());function y(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 S(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={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?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 m(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=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(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);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 C=w.mouse,R=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",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 b=(0,n.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,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,C.move,this.handleDrag),(0,n.addEvent)(d,C.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:b}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,v=b-this.lastY;if([f,v]=(0,a.snapToGrid)(this.props.grid,f,v),!f&&!v)return;d=this.lastX+f,b=this.lastY+v}const l=(0,a.createCoreData)(this,d,b);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=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:b}=s;if(Array.isArray(this.props.grid)){let v=d-this.lastX||0,P=b-this.lastY||0;[v,P]=(0,a.snapToGrid)(this.props.grid,v,P),d=this.lastX+v,b=this.lastY+P}const l=(0,a.createCoreData)(this,d,b);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,C.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,C.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(C=w.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(C=w.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(C=w.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(C=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,m(R,"displayName","DraggableCore"),m(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}),m(R,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),tt}var Gn;function $r(){return Gn||(Gn=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=E(U),r=m(Ee()),n=m(Cn),a=m(Xr),o=dn(),u=jn(),y=wt(),p=m(Kr()),S=m(Bn());function m(s){return s&&s.__esModule?s:{default:s}}function I(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,b=new WeakMap;return(I=function(l){return l?b:d})(s)}function E(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=I(d);if(b&&b.has(s))return b.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,b&&b.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var b=arguments[d];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},w.apply(this,arguments)}function C(s,d,b){return d=R(d),d in s?Object.defineProperty(s,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[d]=b,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 b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,d);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,b){let{position:l}=d,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,S.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),C(this,"onDragStart",(b,l)=>{if((0,S.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,S.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:P,y:x}=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+(P-f.x),f.slackY=this.state.slackY+(x-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(b,g)===!1)return!1;this.setState(f)}),C(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,S.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:x}=this.props.position;f.x=P,f.y=x}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,b;return(d=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:b,children:l,defaultPosition:g,defaultClassName:f,defaultClassNameDragging:v,defaultClassNameDragged:P,position:x,positionOffset:z,scale:V,...O}=this.props;let L={},B=null;const J=!!!x||this.state.dragging,le=x||g,oe={x:(0,u.canDragX)(this)&&J?this.state.x:le.x,y:(0,u.canDragY)(this)&&J?this.state.y:le.y};this.state.isElementSVG?B=(0,o.createSVGTransform)(oe,z):L=(0,o.createCSSTransform)(oe,z);const F=(0,a.default)(l.props.className||"",f,{[v]:this.state.dragging,[P]: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,...L},transform:B}))}}t.default=i,C(i,"displayName","Draggable"),C(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:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),C(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})}(un)),un}var qn;function fn(){if(qn)return et.exports;qn=1;const{default:t,DraggableCore:e}=$r();return et.exports=t,et.exports.default=t,et.exports.DraggableCore=e,et.exports}var nt={exports:{}},rt={},_t={},Xn;function Zr(){if(Xn)return _t;Xn=1,_t.__esModule=!0,_t.cloneElement=y;var t=e(U);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,S){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(p);S&&(I=I.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,I)}return m}function n(p){for(var S=1;S<arguments.length;S++){var m=arguments[S]!=null?arguments[S]:{};S%2?r(Object(m),!0).forEach(function(I){a(p,I,m[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(I){Object.defineProperty(p,I,Object.getOwnPropertyDescriptor(m,I))})}return p}function a(p,S,m){return S=o(S),S in p?Object.defineProperty(p,S,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[S]=m,p}function o(p){var S=u(p,"string");return typeof S=="symbol"?S:String(S)}function u(p,S){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var I=m.call(p,S);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(p)}function y(p,S){return S.style&&p.props.style&&(S.style=n(n({},p.props.style),S.style)),S.className&&p.props.className&&(S.className=p.props.className+" "+S.className),t.default.cloneElement(p,S)}return _t}var at={},Yn;function Kn(){if(Yn)return at;Yn=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 y=o[0];if(y.axis==="both"||y.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 y=o[0];if(y.axis==="both"||y.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 $n;function Zn(){if($n)return rt;$n=1,rt.__esModule=!0,rt.default=void 0;var t=u(U),e=fn(),r=Zr(),n=Kn(),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 b={},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(b,g,f):b[g]=i[g]}return b.default=i,d&&d.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&(i[b]=d[b])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var d={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(d[l]=i[l]);return d}function S(i,s){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),d.push.apply(d,b)}return d}function m(i){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?S(Object(d),!0).forEach(function(b){I(i,b,d[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):S(Object(d)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(d,b))})}return i}function I(i,s,d){return s=E(s),s in i?Object.defineProperty(i,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[s]=d,i}function E(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 b=d.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function C(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(b,l){return b.__proto__=l,b},R(i,s)}var h=function(i){C(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),f=0;f<l;f++)g[f]=arguments[f];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}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,P=f.maxConstraints,x=f.lockAspectRatio;if(!v&&!P&&!x)return[l,g];if(x){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 L=l,B=g,X=this.slack||[0,0],J=X[0],le=X[1];return l+=J,g+=le,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),P&&(l=Math.min(P[0],l),g=Math.min(P[1],g)),this.slack=[J+(L-l),le+(B-g)],[l,g]},d.resizeHandler=function(l,g){var f=this;return function(v,P){var x=P.node,z=P.deltaX,V=P.deltaY;l==="onResizeStart"&&f.resetData();var O=(f.props.axis==="both"||f.props.axis==="x")&&g!=="n"&&g!=="s",L=(f.props.axis==="both"||f.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var B=g[0],X=g[g.length-1],J=x.getBoundingClientRect();if(f.lastHandleRect!=null){if(X==="w"){var le=J.left-f.lastHandleRect.left;z+=le}if(B==="n"){var oe=J.top-f.lastHandleRect.top;V+=oe}}f.lastHandleRect=J,X==="w"&&(z=-z),B==="n"&&(V=-V);var F=f.props.width+(O?z/f.props.transformScale:0),j=f.props.height+(L?V/f.props.transformScale:0),re=f.runConstraints(F,j);F=re[0],j=re[1];var ie=F!==f.props.width||j!==f.props.height,ue=typeof f.props[l]=="function"?f.props[l]:null,ge=l==="onResize"&&!ie;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:x,size:{width:F,height:j},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",P=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(f,P)},d.render=function(){var l=this,g=this.props,f=g.children,v=g.className,P=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 x=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,r.cloneElement)(f,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(f.props.children,x.map(function(V){var O,L=(O=l.handleRefs[V])!=null?O:l.handleRefs[V]=t.createRef();return t.createElement(e.DraggableCore,y({},P,{nodeRef:L,key:"resizableHandle-"+V,onStop:l.resizeHandler("onResizeStop",V),onStart:l.resizeHandler("onResizeStart",V),onDrag:l.resizeHandler("onResize",V)}),l.renderResizeHandle(V,L))}))}))},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={},Jn;function Jr(){if(Jn)return ot;Jn=1,ot.__esModule=!0,ot.default=void 0;var t=y(U),e=o(Ee()),r=o(Zn()),n=Kn(),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,b=new WeakMap;return(u=function(g){return g?b:d})(s)}function y(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(d);if(b&&b.has(s))return b.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,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var b=arguments[d];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function S(s,d){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var d=1;d<arguments.length;d++){var b=arguments[d]!=null?arguments[d]:{};d%2?S(Object(b),!0).forEach(function(l){I(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):S(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function I(s,d,b){return d=E(d),d in s?Object.defineProperty(s,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[d]=b,s}function E(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 b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function C(s,d){if(s==null)return{};var b={},l=Object.keys(s),g,f;for(f=0;f<l.length;f++)g=l[f],!(d.indexOf(g)>=0)&&(b[g]=s[g]);return b}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(P,x){var z=x.size;l.props.onResize?(P.persist==null||P.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(P,x)})):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 b=d.prototype;return b.render=function(){var g=this.props,f=g.handle,v=g.handleSize;g.onResize;var P=g.onResizeStart,x=g.onResizeStop,z=g.draggableOpts,V=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,B=g.axis;g.width,g.height;var X=g.resizeHandles,J=g.style,le=g.transformScale,oe=C(g,a);return t.createElement(r.default,{axis:B,draggableOpts:z,handle:f,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:V,onResizeStart:P,onResize:this.onResize,onResizeStop:x,resizeHandles:X,transformScale:le,width:this.state.width},t.createElement("div",p({},oe,{style:m(m({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return ot.default=i,i.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),ot}var Qn;function Qr(){return Qn||(Qn=1,nt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},nt.exports.Resizable=Zn().default,nt.exports.ResizableBox=Jr().default),nt.exports}var Re={},er;function tr(){if(er)return Re;er=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.resizeHandleType=Re.resizeHandleAxesType=Re.default=void 0;var t=r(Ee()),e=r(U);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 y=o[u],p={};e.default.Children.forEach(y,function(S){if((S==null?void 0:S.key)!=null){if(p[S.key])throw new Error('Duplicate child key "'+S.key+'" found! This will cause problems in ReactGridLayout.');p[S.key]=!0}})},innerRef:t.default.any},Re}var nr;function ea(){if(nr)return Qe;nr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var t=p(U),e=p(Ee()),r=fn(),n=Qr(),a=ze(),o=on(),u=tr(),y=p(rn());function p(w){return w&&w.__esModule?w:{default:w}}function S(w,C,R){return C=m(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function m(w){var C=I(w,"string");return typeof C=="symbol"?C:String(C)}function I(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}let E=class extends t.default.Component{constructor(){super(...arguments),S(this,"state",{resizing:null,dragging:null,className:""}),S(this,"elementRef",t.default.createRef()),S(this,"onDragStart",(C,R)=>{let{node:h}=R;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const d={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),g=h.getBoundingClientRect(),f=g.left/s,v=l.left/s,P=g.top/s,x=l.top/s;d.left=f-v+b.scrollLeft,d.top=P-x+b.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:C,node:h,newPosition:d})}),S(this,"onDrag",(C,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 b=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:f,w:v,h:P,containerWidth:x}=this.props,z=this.getPositionParams();if(g){const{offsetParent:B}=h;if(B){const{margin:X,rowHeight:J,containerPadding:le}=this.props,oe=B.clientHeight-(0,o.calcGridItemWHPx)(P,J,X[1]);b=(0,o.clamp)(b-le[1],0,oe);const F=(0,o.calcGridColWidth)(z),j=x-(0,o.calcGridItemWHPx)(v,F,X[0]);l=(0,o.clamp)(l-le[0],0,j)}}const V={top:b,left:l};this.setState({dragging:V});const{x:O,y:L}=(0,o.calcXY)(z,b,l,v,P);return d.call(this,f,O,L,{e:C,node:h,newPosition:V})}),S(this,"onDragStop",(C,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:b}=this.props,{left:l,top:g}=this.state.dragging,f={top:g,left:l};this.setState({dragging:null});const{x:v,y:P}=(0,o.calcXY)(this.getPositionParams(),g,l,s,d);return i.call(this,b,v,P,{e:C,node:h,newPosition:f})}),S(this,"onResizeStop",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStop")),S(this,"onResizeStart",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStart")),S(this,"onResize",(C,R,h)=>this.onResizeHandler(C,R,h,"onResize"))}shouldComponentUpdate(C,R){if(this.props.children!==C.children||this.props.droppingPosition!==C.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(C),C.x,C.y,C.w,C.h,R);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==C.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(C){this.moveDroppingItem(C)}moveDroppingItem(C){const{droppingPosition:R}=this.props;if(!R)return;const h=this.elementRef.current;if(!h)return;const i=C.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 b=R.left-s.left,l=R.top-s.top;this.onDrag(R.e,{node:h,deltaX:b,deltaY:l})}}getPositionParams(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:C.cols,containerPadding:C.containerPadding,containerWidth:C.containerWidth,margin:C.margin,maxRows:C.maxRows,rowHeight:C.rowHeight}}createStyle(C){const{usePercentages:R,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(C):(s=(0,a.setTopLeft)(C),R&&(s.left=(0,a.perc)(C.left/h),s.width=(0,a.perc)(C.width/h))),s}mixinDraggable(C,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},C)}curryResizeHandler(C,R){return(h,i)=>R(h,i,C)}mixinResizable(C,R,h){const{cols:i,minW:s,minH:d,maxW:b,maxH:l,transformScale:g,resizeHandles:f,resizeHandle:v}=this.props,P=this.getPositionParams(),x=(0,o.calcGridItemPosition)(P,0,0,i,0).width,z=(0,o.calcGridItemPosition)(P,0,0,s,d),V=(0,o.calcGridItemPosition)(P,0,0,b,l),O=[z.width,z.height],L=[Math.min(V.width,x),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:L,onResizeStop:this.curryResizeHandler(R,this.onResizeStop),onResizeStart:this.curryResizeHandler(R,this.onResizeStart),onResize:this.curryResizeHandler(R,this.onResize),transformScale:g,resizeHandles:f,handle:v},C)}onResizeHandler(C,R,h,i){let{node:s,size:d,handle:b}=R;const l=this.props[i];if(!l)return;const{x:g,y:f,i:v,maxH:P,minH:x,containerWidth:z}=this.props,{minW:V,maxW:O}=this.props;let L=d;s&&(L=(0,a.resizeItemInDirection)(b,h,d,z),this.setState({resizing:i==="onResizeStop"?null:L}));let{w:B,h:X}=(0,o.calcWH)(this.getPositionParams(),L.width,L.height,g,f,b);B=(0,o.clamp)(B,Math.max(V,1),O),X=(0,o.clamp)(X,x,P),l.call(this,v,B,X,{e:C,node:s,size:L,handle:b})}render(){const{x:C,y:R,w:h,h:i,isDraggable:s,isResizable:d,droppingPosition:b,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),C,R,h,i,this.state),f=t.default.Children.only(this.props.children);let v=t.default.cloneElement(f,{ref:this.elementRef,className:(0,y.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:!!b,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=E,S(E,"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,C){const R=w[C];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,C){const R=w[C];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,C){const R=w[C];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,C){const R=w[C];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})}),S(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Qe}var rr;function ar(){if(rr)return Ze;rr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=S(U),e=nn(),r=y(rn()),n=ze(),a=on(),o=y(ea()),u=y(tr());function y(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 S(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},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?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 m(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=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(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);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 C=!1;try{C=/firefox/i.test(navigator.userAgent)}catch{}let R=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",(i,s,d,b)=>{let{e:l,node:g}=b;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);if(!v)return;const P={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:P}),this.props.onDragStart(f,v,v,null,l,g)}),m(this,"onDrag",(i,s,d,b)=>{let{e:l,node:g}=b;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,allowOverlap:x,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),P,x),this.props.onDrag(v,f,V,O,l,g),this.setState({layout:x?v:(0,n.compact)(v,(0,n.compactType)(this.props),P),activeDrag:O})}),m(this,"onDragStop",(i,s,d,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,preventCollision:x,allowOverlap:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;v=(0,n.moveElement)(v,V,s,d,!0,x,(0,n.compactType)(this.props),P,z);const L=z?v:(0,n.compact)(v,(0,n.compactType)(this.props),P);this.props.onDragStop(L,f,V,null,l,g);const{oldLayout:B}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,B)}),m(this,"onResizeStart",(i,s,d,b)=>{let{e:l,node:g}=b;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))}),m(this,"onResize",(i,s,d,b)=>{let{e:l,node:g,size:f,handle:v}=b;const{oldResizeItem:P}=this.state,{layout:x}=this.state,{cols:z,preventCollision:V,allowOverlap:O}=this.props;let L=!1,B,X,J;const[le,oe]=(0,n.withLayoutItem)(x,i,j=>{let re;return X=j.x,J=j.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(X=j.x+(j.w-s),s=j.x!==X&&X<0?j.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(v)!==-1&&(J=j.y+(j.h-d),d=j.y!==J&&J<0?j.h:d,J=J<0?0:J),L=!0),V&&!O&&(re=(0,n.getAllCollisions)(x,{...j,w:s,h:d,x:X,y:J}).filter(ue=>ue.i!==j.i).length>0,re&&(J=j.y,d=j.h,X=j.x,s=j.w,L=!1)),j.w=s,j.h=d,j});if(!oe)return;B=le,L&&(B=(0,n.moveElement)(le,oe,X,J,!0,this.props.preventCollision,(0,n.compactType)(this.props),z,O));const F={w:oe.w,h:oe.h,x:oe.x,y:oe.y,static:!0,i};this.props.onResize(B,P,oe,F,l,g),this.setState({layout:O?B:(0,n.compact)(B,(0,n.compactType)(this.props),z),activeDrag:F})}),m(this,"onResizeStop",(i,s,d,b)=>{let{e:l,node:g}=b;const{layout:f,oldResizeItem:v}=this.state,{cols:P,allowOverlap:x}=this.props,z=(0,n.getLayoutItem)(f,i),V=x?f:(0,n.compact)(f,(0,n.compactType)(this.props),P);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)}),m(this,"onDragOver",i=>{var le;if(i.preventDefault(),i.stopPropagation(),C&&!((le=i.nativeEvent.target)!=null&&le.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:d,margin:b,cols:l,rowHeight:g,maxRows:f,width:v,containerPadding:P,transformScale:x}=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,L=i.currentTarget.getBoundingClientRect(),B=i.clientX-L.left,X=i.clientY-L.top,J={left:B/x,top:X/x,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:oe,top:F}=this.state.droppingPosition;(oe!=B||F!=X)&&this.setState({droppingPosition:J})}}else{const oe={cols:l,margin:b,maxRows:f,rowHeight:g,containerWidth:v,containerPadding:P||b},F=(0,a.calcXY)(oe,X,B,V.w,V.h);this.setState({droppingDOMNode:t.createElement("div",{key:V.i}),droppingPosition:J,layout:[...O,{...V,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:d}=this.state,b=(0,n.compact)(d.filter(l=>l.i!==i.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,b=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,b,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,b=s.layout;this.onLayoutMaybeChanged(d,b)}}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:b,containerPadding:l,rowHeight:g,maxRows:f,useCSSTransforms:v,transformScale:P}=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:b,containerPadding:l||b,maxRows:f,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:P},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:b,cols:l,margin:g,containerPadding:f,rowHeight:v,maxRows:P,isDraggable:x,isResizable:z,isBounded:V,useCSSTransforms:O,transformScale:L,draggableCancel:B,draggableHandle:X,resizeHandles:J,resizeHandle:le}=this.props,{mounted:oe,droppingPosition:F}=this.state,j=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&x,re=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&z,ie=d.resizeHandles||J,ue=j&&V&&d.isBounded!==!1;return t.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:f||g,maxRows:P,rowHeight:v,cancel:B,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:j,isResizable:re,isBounded:ue,useCSSTransforms:O&&oe,usePercentages:!oe,transformScale:L,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:le},i)}render(){const{className:i,style:s,isDroppable:d,innerRef:b}=this.props,l=(0,r.default)(w,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,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,m(R,"displayName","ReactGridLayout"),m(R,"propTypes",u.default),m(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={},Pe={},or;function ir(){if(or)return Pe;or=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.findOrGenerateResponsiveLayout=n,Pe.getBreakpointFromWidth=e,Pe.getColsFromBreakpoint=r,Pe.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let S=1,m=y.length;S<m;S++){const I=y[S];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,y,p,S,m){if(o[y])return(0,t.cloneLayout)(o[y]);let I=o[p];const E=a(u),w=E.slice(E.indexOf(y));for(let C=0,R=w.length;C<R;C++){const h=w[C];if(o[h]){I=o[h];break}}return I=(0,t.cloneLayout)(I||[]),(0,t.compact)((0,t.correctBounds)(I,{cols:S}),m,S)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return Pe}var sr;function ta(){if(sr)return it;sr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var t=p(U),e=u(Ee()),r=nn(),n=ze(),a=ir(),o=u(ar());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=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=y(i);if(s&&s.has(h))return s.get(h);var d={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?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 S(){return S=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},S.apply(this,arguments)}function m(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=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(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);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 C(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let R=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:d,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),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:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,d,d,b,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:b,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),P={...b};if(f!==g||i.breakpoints!==s||i.cols!==d){f in P||(P[f]=(0,n.cloneLayout)(this.state.layout));let V=(0,a.findOrGenerateResponsiveLayout)(P,s,g,f,v,l);V=(0,n.synchronizeLayoutWithChildren)(V,this.props.children,v,l,this.props.allowOverlap),P[g]=V,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(V,P),this.setState({breakpoint:g,layout:V,cols:v})}const x=C(this.props.margin,g),z=C(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,x,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:d,layouts:b,margin:l,containerPadding:g,onBreakpointChange:f,onLayoutChange:v,onWidthChange:P,...x}=this.props;return t.createElement(o.default,S({},x,{margin:C(l,this.state.breakpoint),containerPadding:C(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return it.default=R,m(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}),m(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={},lr=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")()}(),na=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),ra=2;function aa(t,e){var r=!1,n=!1,a=0;function o(){r&&(r=!1,t()),n&&y()}function u(){na(o)}function y(){var p=Date.now();if(r){if(p-a<ra)return;n=!0}else r=!0,n=!1,setTimeout(u,e);a=p}return y}var oa=20,ia=["top","right","bottom","left","width","height","size","weight"],sa=typeof MutationObserver<"u",la=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=aa(this.refresh.bind(this),oa)}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),sa?(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=ia.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},ke=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Ot},ur=Dt(0,0,0,0);function Mt(t){return parseFloat(t)||0}function dr(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+Mt(o)},0)}function ca(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]=Mt(u)}return r}function ua(t){var e=t.getBBox();return Dt(0,0,e.width,e.height)}function da(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return ur;var n=ke(t).getComputedStyle(t),a=ca(n),o=a.left+a.right,u=a.top+a.bottom,y=Mt(n.width),p=Mt(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=dr(n,"left","right")+o),Math.round(p+u)!==r&&(p-=dr(n,"top","bottom")+u)),!pa(t)){var S=Math.round(y+o)-e,m=Math.round(p+u)-r;Math.abs(S)!==1&&(y-=S),Math.abs(m)!==1&&(p-=m)}return Dt(a.left,a.top,y,p)}var fa=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&typeof t.getBBox=="function"}}();function pa(t){return t===ke(t).document.documentElement}function ha(t){return pn?fa(t)?ua(t):da(t):ur}function ga(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 Dt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var va=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ha(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}(),ma=function(){function t(e,r){var n=ga(r);cr(this,{target:e,contentRect:n})}return t}(),ya=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new lr,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 ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new va(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 ke(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 ma(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}(),fr=typeof WeakMap<"u"?new WeakMap:new lr,pr=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=la.getInstance(),n=new ya(e,r,this);fr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){pr.prototype[t]=function(){var e;return(e=fr.get(this))[t].apply(e,arguments)}});var Sa=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:pr}();const ba=_n(Object.freeze(Object.defineProperty({__proto__:null,default:Sa},Symbol.toStringTag,{value:"Module"})));var hr;function Ca(){if(hr)return Et;hr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=E;var t=u(U),e=a(Ee()),r=a(ba),n=a(rn());function a(w){return w&&w.__esModule?w:{default:w}}function o(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(o=function(h){return h?R:C})(w)}function u(w,C){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=o(C);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 y(){return y=Object.assign?Object.assign.bind():function(w){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var h in R)Object.prototype.hasOwnProperty.call(R,h)&&(w[h]=R[h])}return w},y.apply(this,arguments)}function p(w,C,R){return C=S(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function S(w){var C=m(w,"string");return typeof C=="symbol"?C:String(C)}function m(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}const I="react-grid-layout";function E(w){var C;return C=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,y({innerRef:this.elementRef},i,this.state))}},p(C,"defaultProps",{measureBeforeMount:!1}),p(C,"propTypes",{measureBeforeMount:e.default.bool}),C}return Et}var gr;function Ta(){return gr||(gr=1,function(t){t.exports=ar().default,t.exports.utils=ze(),t.exports.calculateUtils=on(),t.exports.Responsive=ta().default,t.exports.Responsive.utils=ir(),t.exports.WidthProvider=Ca().default}(tn)),tn.exports}var Ia=Ta();const wa=Hr(Ia);var Ra=Object.getOwnPropertyDescriptor,_a=(t,e,r,n)=>{for(var a=n>1?void 0:n?Ra(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Ea=(t,e)=>(r,n)=>e(r,n,t);let Ae=class extends T.Disposable{constructor(e){super();De(this,"_initLocal",()=>{});De(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((y,p,S)=>{const m=S[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const I=o.slice(m.endIndex+1,y.startIndex);I&&u.push(I)}if(r[y.key]&&u.push(r[y.key]),p===S.length-1){const I=o.slice(y.endIndex+1);I&&u.push(I)}}),u}return[]}};Ae=_a([Ea(0,T.Inject(T.LocaleService))],Ae);const Pt={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const r=U.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((S,m)=>({color:new T.ColorKit(S.color),value:m})),y=u.length-1;return new Array(5).fill("").map((S,m,I)=>m*y/(I.length-1)).map(S=>c.getColorScaleFromValue(u,S))}return null},[e]),n=U.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,S=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return _.jsxs("div",{className:Pt.cfPreview,children:[_.jsx("div",{style:{...y,background:S,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&_.jsx("div",{className:Pt.cfPreview,children:r.map((u,y)=>_.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return n&&_.jsx("div",{className:Pt.cfPreview,children:n.map((u,y)=>u?_.jsx("img",{style:{height:"100%"},src:u},y):_.jsx($e,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:S,bg:m,cl:I}=e.style,E=(u==null?void 0:u.s)===T.BooleanNumber.TRUE,w=(y==null?void 0:y.s)===T.BooleanNumber.TRUE,C=p===T.BooleanNumber.TRUE,R=S===T.BooleanNumber.TRUE,h=(a=m==null?void 0:m.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:C?"italic":void 0,textDecoration:`${E?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return _.jsx("div",{style:s,className:Pt.cfPreview,children:"123"})}}return null},he={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",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"},Oa=(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 Ma=t=>{const{onClick:e}=t,r=te.useDependency(c.ConditionalFormattingRuleModel),n=te.useDependency(T.IUniverInstanceService),a=te.useDependency(q.SheetsSelectionsService),o=te.useDependency(T.ICommandService),u=te.useDependency(T.LocaleService),y=te.useDependency(T.Injector),p=te.useDependency(Ae),S=te.useObservable(()=>n.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=S.getUnitId(),I=S.getActiveSheet();if(!I)throw new Error("No active sheet found");const E=I.getSheetId(),[w,C]=U.useState([]),[R,h]=U.useState("2"),[i,s]=U.useState(0),[d,b]=U.useState(-1),[l,g]=U.useState(vr),f=U.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],P=()=>{const F=r.getSubunitRules(m,E);if(!F||!F.length)return[];if(R==="1"){const j=a.getCurrentLastSelection();if(!j)return[];const re=j.range;return F.filter(ue=>ue.ranges.some(ge=>T.Rectangle.intersects(ge,re)))}else if(R==="2")return[...F];return[]},[x,z]=U.useState(P);fe.useHighlightRange(w),U.useEffect(()=>{const F=o.onCommandExecuted(j=>{j.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),U.useEffect(()=>{z(P)},[R,i,m,E]),U.useEffect(()=>{if(R==="2")return;const F=new Ce.Observable(j=>{const re=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();re.includes(ge)&&ye.unitId===Te&&j.next(null)});return()=>ie.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(P)});return()=>{F.unsubscribe()}},[n,R,m,E]),U.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),U.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 ge=setTimeout(()=>{ie.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=H=>{H.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 j=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),re=(ie=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!j||!re)throw new Error("No active sheet found");o.executeCommand(Ke.id,{unitId:j,subUnitId:re,cfId:F.cfId})},O=(F,j)=>{b(j.y)},L=(F,j,re)=>{var H;b(-1);const ie=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(H=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:H.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const ge=Q=>{const se=x.length;return Math.min(se-1,Math.max(0,Q))},ye=x[ge(j.y)].cfId,Te=x[ge(re.y)].cfId;ye!==Te&&o.executeCommand(St.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:re.y>j.y?"after":"before"}})},B=()=>{t.onCreate()},X=()=>{R==="2"?o.executeCommand(Ye.id):R==="1"&&x.map(j=>({unitId:m,subUnitId:E,cfId:j.cfId})).forEach(j=>{o.executeCommand(Ke.id,j)})},J=U.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),j=F.getActiveSheet();return x.filter(re=>{const ie=re.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),j.getSheetId(),ie)})},[x]),le=J.map((F,j)=>({i:F.cfId,x:0,w:12,y:j,h:1,isResizable:!1})),oe=U.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),j=F.getActiveSheet();return x.every(re=>{const ie=re.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),j.getSheetId(),ie)})},[x]);return _.jsxs("div",{className:he.cfRuleList,children:[_.jsxs("div",{className:he.ruleSelector,children:[_.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(ne.Select,{className:he.select,options:v,value:R,onChange:F=>{h(F)}})).map((F,j)=>_.jsx("span",{children:F},j))}),_.jsxs("div",{className:he.btnList,children:[_.jsx(ne.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:`
|
|
12
|
+
`,d.getElementsByTagName("head")[0].appendChild(v)),d.body&&l(d.body,"react-draggable-transparent-selection")}function b(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const v=(d.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(d,v){d.classList?d.classList.add(v):d.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(d.className+=" ".concat(v))}function g(d,v){d.classList?d.classList.remove(v):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var we={},Mr;function Nr(){if(Mr)return we;Mr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.canDragX=a,we.canDragY=o,we.createCoreData=y,we.createDraggableData=p,we.getBoundPosition=n,we.getControlPosition=u,we.snapToGrid=r;var t=yt(),e=nr();function n(w,E,I){if(!w.props.bounds)return[E,I];let{bounds:S}=w.props;S=typeof S=="string"?S:C(S);const T=m(w);if(typeof S=="string"){const{ownerDocument:h}=T,i=h.defaultView;let s;if(S==="parent"?s=T.parentNode:s=h.querySelector(S),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const f=s,b=i.getComputedStyle(T),l=i.getComputedStyle(f);S={left:-T.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-T.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(T)-T.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(T)-T.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(S.right)&&(E=Math.min(E,S.right)),(0,t.isNum)(S.bottom)&&(I=Math.min(I,S.bottom)),(0,t.isNum)(S.left)&&(E=Math.max(E,S.left)),(0,t.isNum)(S.top)&&(I=Math.max(I,S.top)),[E,I]}function r(w,E,I){const S=Math.round(E/w[0])*w[0],T=Math.round(I/w[1])*w[1];return[S,T]}function a(w){return w.props.axis==="both"||w.props.axis==="x"}function o(w){return w.props.axis==="both"||w.props.axis==="y"}function u(w,E,I){const S=typeof E=="number"?(0,e.getTouch)(w,E):null;if(typeof E=="number"&&!S)return null;const T=m(I),h=I.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,e.offsetXYFromParent)(S||w,h,I.props.scale)}function y(w,E,I){const S=!(0,t.isNum)(w.lastX),T=m(w);return S?{node:T,deltaX:0,deltaY:0,lastX:E,lastY:I,x:E,y:I}:{node:T,deltaX:E-w.lastX,deltaY:I-w.lastY,lastX:w.lastX,lastY:w.lastY,x:E,y:I}}function p(w,E){const I=w.props.scale;return{node:E.node,x:w.state.x+E.deltaX/I,y:w.state.y+E.deltaY/I,deltaX:E.deltaX/I,deltaY:E.deltaY/I,lastX:w.state.x,lastY:w.state.y}}function C(w){return{left:w.left,top:w.top,right:w.right,bottom:w.bottom}}function m(w){const E=w.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return we}var Je={},bt={},Lr;function Vr(){if(Lr)return bt;Lr=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=t;function t(){}return bt}var Ur;function jn(){if(Ur)return Je;Ur=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=C(V),e=y(Ee()),n=y(pr),r=nr(),a=Nr(),o=yt(),u=y(Vr());function y(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(f){return f?s:i})(h)}function C(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 f={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=I.mouse,T=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",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:f}=s;if(this.props.disabled||!(i.target instanceof f.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const b=(0,r.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,this);if(l==null)return;const{x:g,y:d}=l,v=(0,a.createCoreData)(this,g,d);(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,r.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,r.addEvent)(f,S.move,this.handleDrag),(0,r.addEvent)(f,S.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,v=b-this.lastY;if([d,v]=(0,a.snapToGrid)(this.props.grid,d,v),!d&&!v)return;f=this.lastX+d,b=this.lastY+v}const l=(0,a.createCoreData)(this,f,b);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=f,this.lastY=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let v=f-this.lastX||0,x=b-this.lastY||0;[v,x]=(0,a.snapToGrid)(this.props.grid,v,x),f=this.lastX+v,b=this.lastY+x}const l=(0,a.createCoreData)(this,f,b);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(d.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,u.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(d.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(d.ownerDocument,S.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(S=I.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(S=I.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(S=I.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(S=I.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,r.addEvent)(i,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,r.removeEvent)(s,I.mouse.move,this.handleDrag),(0,r.removeEvent)(s,I.touch.move,this.handleDrag),(0,r.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,r.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,r.removeEvent)(i,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.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:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Je.default=T,m(T,"displayName","DraggableCore"),m(T,"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}),m(T,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Je}var zr;function Hn(){return zr||(zr=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=E(V),n=m(Ee()),r=m(pr),a=m(An),o=nr(),u=Nr(),y=yt(),p=m(jn()),C=m(Vr());function m(s){return s&&s.__esModule?s:{default:s}}function w(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(w=function(l){return l?b:f})(s)}function E(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=w(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},I.apply(this,arguments)}function S(s,f,b){return f=T(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function T(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(f,b){let{position:l}=f,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,C.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),S(this,"onDragStart",(b,l)=>{if((0,C.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,C.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x,y:M}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[z,U]=(0,u.getBoundPosition)(this,d.x,d.y);d.x=z,d.y=U,d.slackX=this.state.slackX+(x-d.x),d.slackY=this.state.slackY+(M-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(b,g)===!1)return!1;this.setState(d)}),S(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,C.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x,y:M}=this.props.position;d.x=x,d.y=M}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.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 f,b;return(f=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&f!==void 0?f:r.default.findDOMNode(this)}render(){const{axis:f,bounds:b,children:l,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:v,defaultClassNameDragged:x,position:M,positionOffset:z,scale:U,...O}=this.props;let L={},F=null;const J=!!!M||this.state.dragging,le=M||g,ae={x:(0,u.canDragX)(this)&&J?this.state.x:le.x,y:(0,u.canDragY)(this)&&J?this.state.y:le.y};this.state.isElementSVG?F=(0,o.createSVGTransform)(ae,z):L=(0,o.createCSSTransform)(ae,z);const B=(0,a.default)(l.props.className||"",d,{[v]:this.state.dragging,[x]:this.state.dragged});return e.createElement(p.default,I({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:B,style:{...l.props.style,...L},transform:F}))}}t.default=i,S(i,"displayName","Draggable"),S(i,"propTypes",{...p.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),S(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})}(rr)),rr}var kr;function ar(){if(kr)return $e.exports;kr=1;const{default:t,DraggableCore:e}=Hn();return $e.exports=t,$e.exports.default=t,$e.exports.DraggableCore=e,$e.exports}var Qe={exports:{}},et={},St={},Ar;function Bn(){if(Ar)return St;Ar=1,St.__esModule=!0,St.cloneElement=y;var t=e(V);function e(p){return p&&p.__esModule?p:{default:p}}function n(p,C){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);C&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,w)}return m}function r(p){for(var C=1;C<arguments.length;C++){var m=arguments[C]!=null?arguments[C]:{};C%2?n(Object(m),!0).forEach(function(w){a(p,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(w){Object.defineProperty(p,w,Object.getOwnPropertyDescriptor(m,w))})}return p}function a(p,C,m){return C=o(C),C in p?Object.defineProperty(p,C,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[C]=m,p}function o(p){var C=u(p,"string");return typeof C=="symbol"?C:String(C)}function u(p,C){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var w=m.call(p,C);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(p)}function y(p,C){return C.style&&p.props.style&&(C.style=r(r({},p.props.style),C.style)),C.className&&p.props.className&&(C.className=p.props.className+" "+C.className),t.default.cloneElement(p,C)}return St}var tt={},Wr;function jr(){if(Wr)return tt;Wr=1,tt.__esModule=!0,tt.resizableProps=void 0;var t=e(Ee());ar();function e(r){return r&&r.__esModule?r:{default:r}}var n={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 y=o[0];if(y.axis==="both"||y.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 y=o[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)}};return tt.resizableProps=n,tt}var Hr;function Br(){if(Hr)return et;Hr=1,et.__esModule=!0,et.default=void 0;var t=u(V),e=ar(),n=Bn(),r=jr(),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,f=new WeakMap;return(o=function(l){return l?f: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 f=o(s);if(f&&f.has(i))return f.get(i);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var d=l?Object.getOwnPropertyDescriptor(i,g):null;d&&(d.get||d.set)?Object.defineProperty(b,g,d):b[g]=i[g]}return b.default=i,f&&f.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(i[b]=f[b])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var f={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(f[l]=i[l]);return f}function C(i,s){var f=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),f.push.apply(f,b)}return f}function m(i){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?C(Object(f),!0).forEach(function(b){w(i,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(f)):C(Object(f)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(f,b))})}return i}function w(i,s,f){return s=E(s),s in i?Object.defineProperty(i,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[s]=f,i}function E(i){var s=I(i,"string");return typeof s=="symbol"?s:String(s)}function I(i,s){if(typeof i!="object"||i===null)return i;var f=i[Symbol.toPrimitive];if(f!==void 0){var b=f.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function S(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,T(i,s)}function T(i,s){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},T(i,s)}var h=function(i){S(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),d=0;d<l;d++)g[d]=arguments[d];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,g){var d=this.props,v=d.minConstraints,x=d.maxConstraints,M=d.lockAspectRatio;if(!v&&!x&&!M)return[l,g];if(M){var z=this.props.width/this.props.height,U=l-this.props.width,O=g-this.props.height;Math.abs(U)>Math.abs(O*z)?g=l/z:l=g*z}var L=l,F=g,q=this.slack||[0,0],J=q[0],le=q[1];return l+=J,g+=le,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),x&&(l=Math.min(x[0],l),g=Math.min(x[1],g)),this.slack=[J+(L-l),le+(F-g)],[l,g]},f.resizeHandler=function(l,g){var d=this;return function(v,x){var M=x.node,z=x.deltaX,U=x.deltaY;l==="onResizeStart"&&d.resetData();var O=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",L=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var F=g[0],q=g[g.length-1],J=M.getBoundingClientRect();if(d.lastHandleRect!=null){if(q==="w"){var le=J.left-d.lastHandleRect.left;z+=le}if(F==="n"){var ae=J.top-d.lastHandleRect.top;U+=ae}}d.lastHandleRect=J,q==="w"&&(z=-z),F==="n"&&(U=-U);var B=d.props.width+(O?z/d.props.transformScale:0),W=d.props.height+(L?U/d.props.transformScale:0),ne=d.runConstraints(B,W);B=ne[0],W=ne[1];var ie=B!==d.props.width||W!==d.props.height,ue=typeof d.props[l]=="function"?d.props[l]:null,ge=l==="onResize"&&!ie;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:M,size:{width:B,height:W},handle:g})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof d=="function")return d(l,g);var v=typeof d.type=="string",x=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(d,x)},f.render=function(){var l=this,g=this.props,d=g.children,v=g.className,x=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 M=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,n.cloneElement)(d,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(d.props.children,M.map(function(U){var O,L=(O=l.handleRefs[U])!=null?O:l.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,y({},x,{nodeRef:L,key:"resizableHandle-"+U,onStop:l.resizeHandler("onResizeStop",U),onStart:l.resizeHandler("onResizeStart",U),onDrag:l.resizeHandler("onResize",U)}),l.renderResizeHandle(U,L))}))}))},s}(t.Component);return et.default=h,h.propTypes=r.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},et}var rt={},Fr;function Fn(){if(Fr)return rt;Fr=1,rt.__esModule=!0,rt.default=void 0;var t=y(V),e=o(Ee()),n=o(Br()),r=jr(),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 f=new WeakMap,b=new WeakMap;return(u=function(g){return g?b:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function C(s,f){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?C(Object(b),!0).forEach(function(l){w(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):C(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function w(s,f,b){return f=E(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function E(s){var f=I(s,"string");return typeof f=="symbol"?f:String(f)}function I(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function S(s,f){if(s==null)return{};var b={},l=Object.keys(s),g,d;for(d=0;d<l.length;d++)g=l[d],!(f.indexOf(g)>=0)&&(b[g]=s[g]);return b}function T(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,f)}var i=function(s){T(f,s);function f(){for(var l,g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(x,M){var z=M.size;l.props.onResize?(x.persist==null||x.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(x,M)})):l.setState(z)},l}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var b=f.prototype;return b.render=function(){var g=this.props,d=g.handle,v=g.handleSize;g.onResize;var x=g.onResizeStart,M=g.onResizeStop,z=g.draggableOpts,U=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,F=g.axis;g.width,g.height;var q=g.resizeHandles,J=g.style,le=g.transformScale,ae=S(g,a);return t.createElement(n.default,{axis:F,draggableOpts:z,handle:d,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:U,onResizeStart:x,onResize:this.onResize,onResizeStop:M,resizeHandles:q,transformScale:le,width:this.state.width},t.createElement("div",p({},ae,{style:m(m({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return rt.default=i,i.propTypes=m(m({},r.resizableProps),{},{children:e.default.element}),rt}var Gr;function Gn(){return Gr||(Gr=1,Qe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Qe.exports.Resizable=Br().default,Qe.exports.ResizableBox=Fn().default),Qe.exports}var _e={},qr;function Xr(){if(qr)return _e;qr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resizeHandleType=_e.resizeHandleAxesType=_e.default=void 0;var t=n(Ee()),e=n(V);function n(o){return o&&o.__esModule?o:{default:o}}const r=_e.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=_e.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return _e.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:r,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 y=o[u],p={};e.default.Children.forEach(y,function(C){if((C==null?void 0:C.key)!=null){if(p[C.key])throw new Error('Duplicate child key "'+C.key+'" found! This will cause problems in ReactGridLayout.');p[C.key]=!0}})},innerRef:t.default.any},_e}var Yr;function qn(){if(Yr)return Ze;Yr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=p(V),e=p(Ee()),n=ar(),r=Gn(),a=ze(),o=Jt(),u=Xr(),y=p(Zt());function p(I){return I&&I.__esModule?I:{default:I}}function C(I,S,T){return S=m(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function m(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 T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}let E=class extends t.default.Component{constructor(){super(...arguments),C(this,"state",{resizing:null,dragging:null,className:""}),C(this,"elementRef",t.default.createRef()),C(this,"onDragStart",(S,T)=>{let{node:h}=T;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const f={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,v=l.left/s,x=g.top/s,M=l.top/s;f.left=d-v+b.scrollLeft,f.top=x-M+b.scrollTop,this.setState({dragging:f});const{x:z,y:U}=(0,o.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,U,{e:S,node:h,newPosition:f})}),C(this,"onDrag",(S,T)=>{let{node:h,deltaX:i,deltaY:s}=T;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let b=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:d,w:v,h:x,containerWidth:M}=this.props,z=this.getPositionParams();if(g){const{offsetParent:q}=h;if(q){const{margin:J,rowHeight:le,containerPadding:ae}=this.props,B=q.clientHeight-(0,o.calcGridItemWHPx)(x,le,J[1]);b=(0,o.clamp)(b-ae[1],0,B);const W=(0,o.calcGridColWidth)(z),ne=M-(0,o.calcGridItemWHPx)(v,W,J[0]);l=(0,o.clamp)(l-ae[0],0,ne)}}const U={top:b,left:l};this.setState({dragging:U});const{containerPadding:O}=this.props,{x:L,y:F}=(0,o.calcXY)(z,b-O[1],l-O[0],v,x);return f.call(this,d,L,F,{e:S,node:h,newPosition:U})}),C(this,"onDragStop",(S,T)=>{let{node:h}=T;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:b,containerPadding:l}=this.props,{left:g,top:d}=this.state.dragging,v={top:d,left:g};this.setState({dragging:null});const{x,y:M}=(0,o.calcXY)(this.getPositionParams(),d-l[1],g-l[0],s,f);return i.call(this,b,x,M,{e:S,node:h,newPosition:v})}),C(this,"onResizeStop",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStop")),C(this,"onResizeStart",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStart")),C(this,"onResize",(S,T,h)=>this.onResizeHandler(S,T,h,"onResize"))}shouldComponentUpdate(S,T){if(this.props.children!==S.children||this.props.droppingPosition!==S.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(S),S.x,S.y,S.w,S.h,T);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:T}=this.props;if(!T)return;const h=this.elementRef.current;if(!h)return;const i=S.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&T.left!==i.left||T.top!==i.top;if(!s)this.onDragStart(T.e,{node:h,deltaX:T.left,deltaY:T.top});else if(f){const b=T.left-s.left,l=T.top-s.top;this.onDrag(T.e,{node:h,deltaX:b,deltaY:l})}}getPositionParams(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:S.cols,containerPadding:S.containerPadding,containerWidth:S.containerWidth,margin:S.margin,maxRows:S.maxRows,rowHeight:S.rowHeight}}createStyle(S){const{usePercentages:T,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(S):(s=(0,a.setTopLeft)(S),T&&(s.left=(0,a.perc)(S.left/h),s.width=(0,a.perc)(S.width/h))),s}mixinDraggable(S,T){return t.default.createElement(n.DraggableCore,{disabled:!T,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},S)}curryResizeHandler(S,T){return(h,i)=>T(h,i,S)}mixinResizable(S,T,h){const{cols:i,minW:s,minH:f,maxW:b,maxH:l,transformScale:g,resizeHandles:d,resizeHandle:v}=this.props,x=this.getPositionParams(),M=(0,o.calcGridItemPosition)(x,0,0,i,0).width,z=(0,o.calcGridItemPosition)(x,0,0,s,f),U=(0,o.calcGridItemPosition)(x,0,0,b,l),O=[z.width,z.height],L=[Math.min(U.width,M),Math.min(U.height,1/0)];return t.default.createElement(r.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:T.width,height:T.height,minConstraints:O,maxConstraints:L,onResizeStop:this.curryResizeHandler(T,this.onResizeStop),onResizeStart:this.curryResizeHandler(T,this.onResizeStart),onResize:this.curryResizeHandler(T,this.onResize),transformScale:g,resizeHandles:d,handle:v},S)}onResizeHandler(S,T,h,i){let{node:s,size:f,handle:b}=T;const l=this.props[i];if(!l)return;const{x:g,y:d,i:v,maxH:x,minH:M,containerWidth:z}=this.props,{minW:U,maxW:O}=this.props;let L=f;s&&(L=(0,a.resizeItemInDirection)(b,h,f,z),this.setState({resizing:i==="onResizeStop"?null:L}));let{w:F,h:q}=(0,o.calcWH)(this.getPositionParams(),L.width,L.height,g,d,b);F=(0,o.clamp)(F,Math.max(U,1),O),q=(0,o.clamp)(q,M,x),l.call(this,v,F,q,{e:S,node:s,size:L,handle:b})}render(){const{x:S,y:T,w:h,h:i,isDraggable:s,isResizable:f,droppingPosition:b,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),S,T,h,i,this.state),d=t.default.Children.only(this.props.children);let v=t.default.cloneElement(d,{ref:this.elementRef,className:(0,y.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!b,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,f),v=this.mixinDraggable(v,s),v}};return Ze.default=E,C(E,"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,S){const T=I[S];if(typeof T!="number")return new Error("minWidth not Number");if(T>I.w||T>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxWidth not Number");if(T<I.w||T<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minHeight not Number");if(T>I.h||T>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxHeight not Number");if(T<I.h||T<I.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})}),C(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Ze}var Kr;function Zr(){if(Kr)return Ye;Kr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var t=C(V),e=Kt(),n=y(Zt()),r=ze(),a=Jt(),o=y(qn()),u=y(Xr());function y(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(f){return f?s:i})(h)}function C(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 f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I="react-grid-layout";let S=!1;try{S=/firefox/i.test(navigator.userAgent)}catch{}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.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",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);if(!v)return;const x={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(v),oldLayout:d,activeDrag:x}),this.props.onDragStart(d,v,v,null,l,g)}),m(this,"onDrag",(i,s,f,b)=>{let{e:l,node:g}=b;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,allowOverlap:M,preventCollision:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;const O={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i};v=(0,r.moveElement)(v,U,s,f,!0,z,(0,r.compactType)(this.props),x,M),this.props.onDrag(v,d,U,O,l,g),this.setState({layout:M?v:(0,r.compact)(v,(0,r.compactType)(this.props),x),activeDrag:O})}),m(this,"onDragStop",(i,s,f,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,preventCollision:M,allowOverlap:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;v=(0,r.moveElement)(v,U,s,f,!0,M,(0,r.compactType)(this.props),x,z);const L=z?v:(0,r.compact)(v,(0,r.compactType)(this.props),x);this.props.onDragStop(L,d,U,null,l,g);const{oldLayout:F}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,F)}),m(this,"onResizeStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);v&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,v,v,null,l,g))}),m(this,"onResize",(i,s,f,b)=>{let{e:l,node:g,size:d,handle:v}=b;const{oldResizeItem:x}=this.state,{layout:M}=this.state,{cols:z,preventCollision:U,allowOverlap:O}=this.props;let L=!1,F,q,J;const[le,ae]=(0,r.withLayoutItem)(M,i,W=>{let ne;return q=W.x,J=W.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(q=W.x+(W.w-s),s=W.x!==q&&q<0?W.w:s,q=q<0?0:q),["ne","n","nw"].indexOf(v)!==-1&&(J=W.y+(W.h-f),f=W.y!==J&&J<0?W.h:f,J=J<0?0:J),L=!0),U&&!O&&(ne=(0,r.getAllCollisions)(M,{...W,w:s,h:f,x:q,y:J}).filter(ue=>ue.i!==W.i).length>0,ne&&(J=W.y,f=W.h,q=W.x,s=W.w,L=!1)),W.w=s,W.h=f,W});if(!ae)return;F=le,L&&(F=(0,r.moveElement)(le,ae,q,J,!0,this.props.preventCollision,(0,r.compactType)(this.props),z,O));const B={w:ae.w,h:ae.h,x:ae.x,y:ae.y,static:!0,i};this.props.onResize(F,x,ae,B,l,g),this.setState({layout:O?F:(0,r.compact)(F,(0,r.compactType)(this.props),z),activeDrag:B})}),m(this,"onResizeStop",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d,oldResizeItem:v}=this.state,{cols:x,allowOverlap:M}=this.props,z=(0,r.getLayoutItem)(d,i),U=M?d:(0,r.compact)(d,(0,r.compactType)(this.props),x);this.props.onResizeStop(U,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,O)}),m(this,"onDragOver",i=>{var le;if(i.preventDefault(),i.stopPropagation(),S&&!((le=i.nativeEvent.target)!=null&&le.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:f,margin:b,cols:l,rowHeight:g,maxRows:d,width:v,containerPadding:x,transformScale:M}=this.props,z=f==null?void 0:f(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...z},{layout:O}=this.state,L=i.currentTarget.getBoundingClientRect(),F=i.clientX-L.left,q=i.clientY-L.top,J={left:F/M,top:q/M,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ae,top:B}=this.state.droppingPosition;(ae!=F||B!=q)&&this.setState({droppingPosition:J})}}else{const ae={cols:l,margin:b,maxRows:d,rowHeight:g,containerWidth:v,containerPadding:x||b},B=(0,a.calcXY)(ae,q,F,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:J,layout:[...O,{...U,x:B.x,y:B.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:f}=this.state,b=(0,r.compact)(f.filter(l=>l.i!==i.i),(0,r.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,b=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,b,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?f=i.layout:(0,r.childrenEqual)(i.children,s.children)||(f=s.layout),f?{layout:(0,r.synchronizeLayoutWithChildren)(f,i.children,i.cols,(0,r.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,r.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 f=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(f,b)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,r.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:f,margin:b,containerPadding:l,rowHeight:g,maxRows:d,useCSSTransforms:v,transformScale:x}=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:f,margin:b,containerPadding:l||b,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:x},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const f=(0,r.getLayoutItem)(this.state.layout,String(i.key));if(!f)return null;const{width:b,cols:l,margin:g,containerPadding:d,rowHeight:v,maxRows:x,isDraggable:M,isResizable:z,isBounded:U,useCSSTransforms:O,transformScale:L,draggableCancel:F,draggableHandle:q,resizeHandles:J,resizeHandle:le}=this.props,{mounted:ae,droppingPosition:B}=this.state,W=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&M,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&z,ie=f.resizeHandles||J,ue=W&&U&&f.isBounded!==!1;return t.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:d||g,maxRows:x,rowHeight:v,cancel:F,handle:q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:W,isResizable:ne,isBounded:ue,useCSSTransforms:O&&ae,usePercentages:!ae,transformScale:L,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?B:void 0,resizeHandles:ie,resizeHandle:le},i)}render(){const{className:i,style:s,isDroppable:f,innerRef:b}=this.props,l=(0,n.default)(I,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,className:l,style:g,onDrop:f?this.onDrop:r.noop,onDragLeave:f?this.onDragLeave:r.noop,onDragEnter:f?this.onDragEnter:r.noop,onDragOver:f?this.onDragOver:r.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ye.default=T,m(T,"displayName","ReactGridLayout"),m(T,"propTypes",u.default),m(T,"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:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),Ye}var nt={},xe={},$r;function Jr(){if($r)return xe;$r=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.findOrGenerateResponsiveLayout=r,xe.getBreakpointFromWidth=e,xe.getColsFromBreakpoint=n,xe.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let C=1,m=y.length;C<m;C++){const w=y[C];u>o[w]&&(p=w)}return p}function n(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function r(o,u,y,p,C,m){if(o[y])return(0,t.cloneLayout)(o[y]);let w=o[p];const E=a(u),I=E.slice(E.indexOf(y));for(let S=0,T=I.length;S<T;S++){const h=I[S];if(o[h]){w=o[h];break}}return w=(0,t.cloneLayout)(w||[]),(0,t.compact)((0,t.correctBounds)(w,{cols:C}),m,C)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return xe}var Qr;function Xn(){if(Qr)return nt;Qr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=p(V),e=u(Ee()),n=Kt(),r=ze(),a=Jr(),o=u(Zr());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(f){return f?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=y(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function C(){return C=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},C.apply(this,arguments)}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function S(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:f,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(f,s,l,l,g,d),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,n.deepEqual)(i.layouts,s.layouts)){const{breakpoint:f,cols:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,f,f,b,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,n.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:f,layouts:b,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,f),x={...b};if(d!==g||i.breakpoints!==s||i.cols!==f){d in x||(x[d]=(0,r.cloneLayout)(this.state.layout));let U=(0,a.findOrGenerateResponsiveLayout)(x,s,g,d,v,l);U=(0,r.synchronizeLayoutWithChildren)(U,this.props.children,v,l,this.props.allowOverlap),x[g]=U,this.props.onLayoutChange(U,x),this.props.onBreakpointChange(g,v),this.setState({breakpoint:g,layout:U,cols:v})}const M=S(this.props.margin,g),z=S(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,M,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:f,layouts:b,margin:l,containerPadding:g,onBreakpointChange:d,onLayoutChange:v,onWidthChange:x,...M}=this.props;return t.createElement(o.default,C({},M,{margin:S(l,this.state.breakpoint),containerPadding:S(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return nt.default=T,m(T,"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(I(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(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,r.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(T,"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:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),nt}var Ct={},en=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}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(n){var r=t(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},e.prototype.set=function(n,r){var a=t(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,a=t(r,n);~a&&r.splice(a,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];n.call(r,u[1],u[0])}},e}()}(),or=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Yn=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Kn=2;function Zn(t,e){var n=!1,r=!1,a=0;function o(){n&&(n=!1,t()),r&&y()}function u(){Yn(o)}function y(){var p=Date.now();if(n){if(p-a<Kn)return;r=!0}else n=!0,r=!1,setTimeout(u,e);a=p}return y}var $n=20,Jn=["top","right","bottom","left","width","height","size","weight"],Qn=typeof MutationObserver<"u",ea=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Zn(this.refresh.bind(this),$n)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.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(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!or||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Qn?(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(){!or||!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 n=e.propertyName,r=n===void 0?"":n,a=Jn.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),tn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},ke=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Tt},rn=It(0,0,0,0);function wt(t){return parseFloat(t)||0}function nn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,a){var o=t["border-"+a+"-width"];return r+wt(o)},0)}function ta(t){for(var e=["top","right","bottom","left"],n={},r=0,a=e;r<a.length;r++){var o=a[r],u=t["padding-"+o];n[o]=wt(u)}return n}function ra(t){var e=t.getBBox();return It(0,0,e.width,e.height)}function na(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return rn;var r=ke(t).getComputedStyle(t),a=ta(r),o=a.left+a.right,u=a.top+a.bottom,y=wt(r.width),p=wt(r.height);if(r.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=nn(r,"left","right")+o),Math.round(p+u)!==n&&(p-=nn(r,"top","bottom")+u)),!oa(t)){var C=Math.round(y+o)-e,m=Math.round(p+u)-n;Math.abs(C)!==1&&(y-=C),Math.abs(m)!==1&&(p-=m)}return It(a.left,a.top,y,p)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&typeof t.getBBox=="function"}}();function oa(t){return t===ke(t).document.documentElement}function ia(t){return or?aa(t)?ra(t):na(t):rn}function sa(t){var e=t.x,n=t.y,r=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return tn(u,{x:e,y:n,width:r,height:a,top:n,right:e+r,bottom:a+n,left:e}),u}function It(t,e,n,r){return{x:t,y:e,width:n,height:r}}var la=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=It(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ia(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}(),ca=function(){function t(e,n){var r=sa(n);tn(this,{target:e,contentRect:r})}return t}(),ua=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new en,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}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 ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new la(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 ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.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(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ca(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),an=typeof WeakMap<"u"?new WeakMap:new en,on=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 n=ea.getInstance(),r=new ua(e,n,this);an.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){on.prototype[t]=function(){var e;return(e=an.get(this))[t].apply(e,arguments)}});var da=function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:on}();const fa=yr(Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})));var sn;function pa(){if(sn)return Ct;sn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=E;var t=u(V),e=a(Ee()),n=a(fa),r=a(Zt());function a(I){return I&&I.__esModule?I:{default:I}}function o(I){if(typeof WeakMap!="function")return null;var S=new WeakMap,T=new WeakMap;return(o=function(h){return h?T: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 T=o(S);if(T&&T.has(I))return T.get(I);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var f=i?Object.getOwnPropertyDescriptor(I,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=I[s]}return h.default=I,T&&T.set(I,h),h}function y(){return y=Object.assign?Object.assign.bind():function(I){for(var S=1;S<arguments.length;S++){var T=arguments[S];for(var h in T)Object.prototype.hasOwnProperty.call(T,h)&&(I[h]=T[h])}return I},y.apply(this,arguments)}function p(I,S,T){return S=C(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function C(I){var S=m(I,"string");return typeof S=="symbol"?S:String(S)}function m(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}const w="react-grid-layout";function E(I){var S;return S=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 n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const f=i[0].contentRect.width;this.setState({width:f})}});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,r.default)(this.props.className,w),style:this.props.style,ref:this.elementRef}):t.createElement(I,y({innerRef:this.elementRef},i,this.state))}},p(S,"defaultProps",{measureBeforeMount:!1}),p(S,"propTypes",{measureBeforeMount:e.default.bool}),S}return Ct}var ln;function ha(){return ln||(ln=1,function(t){t.exports=Zr().default,t.exports.utils=ze(),t.exports.calculateUtils=Jt(),t.exports.Responsive=Xn().default,t.exports.Responsive.utils=Jr(),t.exports.WidthProvider=pa().default}(Yt)),Yt.exports}var ga=ha();const va=Ln(ga);var ma=Object.getOwnPropertyDescriptor,ya=(t,e,n,r)=>{for(var a=r>1?void 0:r?ma(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ba=(t,e)=>(n,r)=>e(n,r,t);let Ae=class extends _.Disposable{constructor(e){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(e);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),a=e.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,C)=>{const m=C[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const w=o.slice(m.endIndex+1,y.startIndex);w&&u.push(w)}if(n[y.key]&&u.push(n[y.key]),p===C.length-1){const w=o.slice(y.endIndex+1);w&&u.push(w)}}),u}return[]}};Ae=ya([ba(0,_.Inject(_.LocaleService))],Ae);const _t={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const n=V.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((C,m)=>({color:new _.ColorKit(C.color),value:m})),y=u.length-1;return new Array(5).fill("").map((C,m,w)=>m*y/(w.length-1)).map(C=>c.getColorScaleFromValue(u,C))}return null},[e]),r=V.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,C=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return R.jsxs("div",{className:_t.cfPreview,children:[R.jsx("div",{style:{...y,background:C,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),R.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return n&&R.jsx("div",{className:_t.cfPreview,children:n.map((u,y)=>R.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return r&&R.jsx("div",{className:_t.cfPreview,children:r.map((u,y)=>u?R.jsx("img",{style:{height:"100%"},src:u},y):R.jsx(Xe,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:C,bg:m,cl:w}=e.style,E=(u==null?void 0:u.s)===_.BooleanNumber.TRUE,I=(y==null?void 0:y.s)===_.BooleanNumber.TRUE,S=p===_.BooleanNumber.TRUE,T=C===_.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=w==null?void 0:w.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:T?"bold":void 0,fontStyle:S?"italic":void 0,textDecoration:`${E?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return R.jsx("div",{style:s,className:_t.cfPreview,children:"123"})}}return null},he={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",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"},Sa=(t,e)=>{const n=t.rule;switch(n.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(n.subType){case c.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,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 r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case c.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case c.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case c.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let cn=0;const Ca=t=>{const{onClick:e}=t,n=te.useDependency(c.ConditionalFormattingRuleModel),r=te.useDependency(_.IUniverInstanceService),a=te.useDependency(Y.SheetsSelectionsService),o=te.useDependency(_.ICommandService),u=te.useDependency(_.LocaleService),y=te.useDependency(_.Injector),p=te.useDependency(Ae),C=te.useObservable(()=>r.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=C.getUnitId(),w=C.getActiveSheet();if(!w)throw new Error("No active sheet found");const E=w.getSheetId(),[I,S]=V.useState([]),[T,h]=V.useState("2"),[i,s]=V.useState(0),[f,b]=V.useState(-1),[l,g]=V.useState(cn),d=V.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],x=()=>{const B=n.getSubunitRules(m,E);if(!B||!B.length)return[];if(T==="1"){const W=a.getCurrentLastSelection();if(!W)return[];const ne=W.range;return B.filter(ue=>ue.ranges.some(ge=>_.Rectangle.intersects(ge,ne)))}else if(T==="2")return[...B];return[]},[M,z]=V.useState(x);fe.useHighlightRange(I),V.useEffect(()=>{const B=o.onCommandExecuted(W=>{W.id===Y.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>B.dispose()}),V.useEffect(()=>{z(x)},[T,i,m,E]),V.useEffect(()=>{if(T==="2")return;const B=new Ce.Observable(W=>{const ne=[Y.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(ge)&&ye.unitId===Te&&W.next(null)});return()=>ie.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(x)});return()=>{B.unsubscribe()}},[r,T,m,E]),V.useEffect(()=>{const B=n.$ruleChange.subscribe(()=>{s(Math.random())});return()=>B.unsubscribe()},[n]),V.useEffect(()=>{const B=()=>{var ue;const ie=Math.max(0,(((ue=d.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return cn=ie,ie},ne=new Ce.Observable(ie=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{ie.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=j=>{j.propertyName==="width"&&(ye(),ie.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(B())});return()=>{ne.unsubscribe()}},[]);const U=B=>{var ie;const W=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!W||!ne)throw new Error("No active sheet found");o.executeCommand(c.DeleteCfCommand.id,{unitId:W,subUnitId:ne,cfId:B.cfId})},O=(B,W)=>{b(W.y)},L=(B,W,ne)=>{var j;b(-1);const ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(j=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:j.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const ge=Q=>{const se=M.length;return Math.min(se-1,Math.max(0,Q))},ye=M[ge(W.y)].cfId,Te=M[ge(ne.y)].cfId;ye!==Te&&o.executeCommand(c.MoveCfCommand.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:ne.y>W.y?"after":"before"}})},F=()=>{t.onCreate()},q=()=>{T==="2"?o.executeCommand(c.ClearWorksheetCfCommand.id):T==="1"&&M.map(W=>({unitId:m,subUnitId:E,cfId:W.cfId})).forEach(W=>{o.executeCommand(c.DeleteCfCommand.id,W)})},J=V.useMemo(()=>{const B=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),W=B.getActiveSheet();return M.filter(ne=>{const ie=ne.ranges;return Y.checkRangesEditablePermission(y,B.getUnitId(),W.getSheetId(),ie)})},[M]),le=J.map((B,W)=>({i:B.cfId,x:0,w:12,y:W,h:1,isResizable:!1})),ae=V.useMemo(()=>{const B=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),W=B.getActiveSheet();return M.every(ne=>{const ie=ne.ranges;return Y.checkRangesEditablePermission(y,B.getUnitId(),W.getSheetId(),ie)})},[M]);return R.jsxs("div",{className:he.cfRuleList,children:[R.jsxs("div",{className:he.ruleSelector,children:[R.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",R.jsx(ee.Select,{className:he.select,options:v,value:T,onChange:B=>{h(B)}})).map((B,W)=>R.jsx("span",{children:B},W))}),R.jsxs("div",{className:he.btnList,children:[R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:R.jsx("div",{className:`
|
|
13
13
|
${he.icon}
|
|
14
|
-
`,onClick:
|
|
14
|
+
`,onClick:F,children:R.jsx(vr,{})})}),M.length&&ae?R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:R.jsx("div",{className:`
|
|
15
15
|
${he.gap}
|
|
16
16
|
${he.icon}
|
|
17
|
-
`,onClick:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
`,onClick:q,children:R.jsx(gt,{})})}):R.jsx("div",{className:`
|
|
18
|
+
${he.gap}
|
|
19
|
+
${he.disabled}
|
|
20
|
+
`,children:R.jsx(gt,{})})]})]}),R.jsx("div",{ref:d,className:he.gridLayoutWrap,children:l?R.jsx(va,{onDragStop:L,onDragStart:O,layout:le,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:J==null?void 0:J.map((B,W)=>R.jsx("div",{children:R.jsxs("div",{onMouseMove:()=>{B.ranges!==I&&S(B.ranges)},onMouseLeave:()=>S([]),onClick:()=>{e(B)},className:`
|
|
21
21
|
${he.ruleItem}
|
|
22
|
-
${
|
|
23
|
-
`,children:[
|
|
22
|
+
${f===W?he.active:""}
|
|
23
|
+
`,children:[R.jsx("div",{className:`
|
|
24
24
|
${he.draggableHandle}
|
|
25
25
|
draggableHandle
|
|
26
|
-
`,onClick:
|
|
26
|
+
`,onClick:ne=>ne.stopPropagation(),children:R.jsx(mr,{})}),R.jsxs("div",{className:he.ruleDescribe,children:[R.jsx("div",{className:he.ruleType,children:Sa(B,u)}),R.jsx("div",{className:he.ruleRange,children:B.ranges.map(ne=>kt.serializeRange(ne)).join(",")})]}),R.jsx("div",{className:he.preview,children:R.jsx(We,{rule:B.rule})}),R.jsx("div",{className:`
|
|
27
27
|
${he.deleteItem}
|
|
28
|
-
${
|
|
29
|
-
`,onClick:
|
|
30
|
-
${
|
|
28
|
+
${f===W?he.active:""}
|
|
29
|
+
`,onClick:ne=>{ne.stopPropagation(),U(B),S([])},children:R.jsx(gt,{})})]})},`${B.cfId}`))}):null})]})},un={cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Me=t=>{const{color:e,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:u=!0}=t,y=te.useDependency(te.ComponentManager),p=V.useMemo(()=>new _.ColorKit(e),[e]),C=y.get(a);return C&&(r?R.jsx(C,{className:o,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(ee.ColorPicker,{value:e,onChange:n})}),children:R.jsxs("span",{className:`
|
|
30
|
+
${un.cfColorPickerIcon}
|
|
31
31
|
${o}
|
|
32
|
-
`,children:[
|
|
32
|
+
`,children:[R.jsx(C,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&R.jsx(vt,{className:un.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfErrorText:"univer-cf-error-text",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}),ir=t=>{var S;const{type:e,className:n,onChange:r,id:a,value:o}=t,u=te.useDependency(_.IUniverInstanceService),y=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(S=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),C=V.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=V.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]),w=V.useRef({}),[E,I]=V.useState(!1);return te.useSidebarClick(T=>{var i;const h=(i=w.current)==null?void 0:i.handleOutClick;h&&h(T,()=>I(!1))}),e===c.CFValueType.formula?R.jsx("div",{style:{width:"100%",marginLeft:4},children:R.jsx(Ge.FormulaEditor,{initValue:C,unitId:y,subUnitId:p,isFocus:E,onChange:(T="")=>{r(T||"")},onFocus:()=>I(!0),actions:w.current})}):R.jsx(ee.InputNumber,{className:n,value:Number(t.value)||0,onChange:T=>t.onChange(T||0),...m})},Ta=t=>{var U;const{interceptorManager:e}=t,n=te.useDependency(_.LocaleService),r=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.colorScale?t.rule:void 0,a=[Ne(c.CFValueType.num,n),Ne(c.CFValueType.percent,n),Ne(c.CFValueType.percentile,n),Ne(c.CFValueType.formula,n)],o=[Ne(c.CFValueType.min,n),...a],u=[Ne("none",n),...a],y=[Ne(c.CFValueType.max,n),...a],[p,C]=V.useState(()=>{var L;const O=c.CFValueType.min;return r&&((L=r.config[0])==null?void 0:L.value.type)||O}),[m,w]=V.useState(()=>{var L;const O="none";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.value.type)||O}),[E,I]=V.useState(()=>{var L;const O=c.CFValueType.max;return r&&((L=r.config[r.config.length-1])==null?void 0:L.value.type)||O}),[S,T]=V.useState(()=>{if(!r)return 10;const L=r.config[0];return(L==null?void 0:L.value.value)===void 0?10:L==null?void 0:L.value.value}),[h,i]=V.useState(()=>{var F;if(!r||r.config.length!==3)return 50;const L=(F=r.config[1])==null?void 0:F.value.value;return L===void 0?50:L}),[s,f]=V.useState(()=>{var F;if(!r)return 90;const L=(F=r.config[r.config.length-1])==null?void 0:F.value.value;return L===void 0?90:L}),[b,l]=V.useState(()=>{var L;const O="#d0d9fb";return r&&((L=r.config[0])==null?void 0:L.color)||O}),[g,d]=V.useState(()=>{var L;const O="#7790f3";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.color)||O}),[v,x]=V.useState(()=>{var L;const O="#2e55ef";return r&&((L=r.config[r.config.length-1])==null?void 0:L.color)||O}),M=V.useMemo(()=>O=>{const{minType:L,medianType:F,maxType:q,minValue:J,medianValue:le,maxValue:ae,minColor:B,medianColor:W,maxColor:ne}=O,ie=[];return ie.push({color:B,value:{type:L,value:J}}),F!=="none"&&ie.push({color:W,value:{type:F,value:le}}),ie.push({color:ne,value:{type:q,value:ae}}),{config:ie.map((ge,ye)=>({...ge,index:ye})),type:c.CFRuleType.colorScale}},[]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return M({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),[M,p,m,E,S,h,s,b,g,v,e]);const z=O=>{t.onChange(M(O))};return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
33
33
|
${G.cfPreviewWrap}
|
|
34
|
-
`,children:
|
|
34
|
+
`,children:R.jsx(We,{rule:M({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})})}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:ee.clsx(`
|
|
35
35
|
${A.labelContainer}
|
|
36
36
|
${A.mTSm}
|
|
37
|
-
`,"univer-box-border univer-h-7"),children:[
|
|
37
|
+
`,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{C(O);const L=c.createDefaultValueByValueType(O,10);T(L),z({minType:O,medianType:m,maxType:E,minValue:L,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"min",className:`
|
|
38
38
|
${A.mLXxs}
|
|
39
|
-
`,value:
|
|
39
|
+
`,value:S,type:p,onChange:O=>{T(O),z({minType:p,medianType:m,maxType:E,minValue:O,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:b,onChange:O=>{l(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.medianValue")}),R.jsxs("div",{className:ee.clsx(`
|
|
40
40
|
${A.labelContainer}
|
|
41
41
|
${A.mTSm}
|
|
42
|
-
`,"univer-box-border univer-h-7"),children:[
|
|
42
|
+
`,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:u,value:m,onChange:O=>{w(O);const L=c.createDefaultValueByValueType(O,50);i(L),z({minType:p,medianType:O,maxType:E,minValue:S,medianValue:L,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"median",className:`
|
|
43
43
|
${A.mLXxs}
|
|
44
|
-
`,value:h,type:m,onChange:O=>{i(O),z({minType:p,medianType:m,maxType:E,minValue:
|
|
44
|
+
`,value:h,type:m,onChange:O=>{i(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:O,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),m!=="none"&&R.jsx(Me,{className:A.mLXxs,color:g,onChange:O=>{d(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:O,maxColor:v})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:ee.clsx(`
|
|
45
45
|
${A.labelContainer}
|
|
46
46
|
${A.mTSm}
|
|
47
|
-
`,"univer-box-border univer-h-7"),children:[
|
|
47
|
+
`,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:y,value:E,onChange:O=>{I(O);const L=c.createDefaultValueByValueType(O,90);f(L),z({minType:p,medianType:m,maxType:O,minValue:S,medianValue:h,maxValue:L,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"max",className:`
|
|
48
48
|
${A.mLXxs}
|
|
49
|
-
`,value:s,type:E,onChange:O=>{
|
|
49
|
+
`,value:s,type:E,onChange:O=>{f(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:O,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:v,onChange:O=>{x(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:O})}})]})]})},je=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),dn=t=>{var T;const{onChange:e,className:n,value:r,type:a,id:o,disabled:u=!1}=t,y=te.useDependency(_.IUniverInstanceService),p=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),C=(T=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId(),m=V.useRef({}),[w,E]=V.useState(!1);te.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>E(!1))});const I=V.useRef(r),S=V.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(I.current).startsWith("=")?String(I.current)||"":"=";return R.jsx("div",{style:{width:"100%",marginLeft:12},children:R.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:C,isFocus:w,onChange:(i="")=>{e(i||"")},onFocus:()=>E(!0),actions:m.current})})}return R.jsx(ee.InputNumber,{className:n,value:Number(r)||0,disabled:u,onChange:h=>{e(h||0)},...S})},wa=t=>{var U;const{interceptorManager:e}=t,n=te.useDependency(_.LocaleService),r=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.dataBar?t.rule:void 0,[a,o]=V.useState(()=>{var L;const O="0";return r?(L=r.config)!=null&&L.isGradient?"1":"0":O}),[u,y]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,C]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),m=[je(c.CFValueType.num,n),je(c.CFValueType.percent,n),je(c.CFValueType.percentile,n),je(c.CFValueType.formula,n)],w=[je(c.CFValueType.min,n),...m],E=[je(c.CFValueType.max,n),...m],[I,S]=V.useState(()=>{var L;const O=w[0].value;return r&&((L=r.config)==null?void 0:L.min.type)||O}),[T,h]=V.useState(()=>{var L;const O=E[0].value;return r&&((L=r.config)==null?void 0:L.max.type)||O}),[i,s]=V.useState(()=>{var F;if(!r)return 0;const L=((F=r.config)==null?void 0:F.min)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value||0}),[f,b]=V.useState(()=>{var F;if(!r)return 100;const L=((F=r.config)==null?void 0:F.max)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value===void 0?100:L.value}),[l,g]=V.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),d=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});V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return d({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,I,f,T,u,p,e,l]);const v=O=>{t.onChange(d(O))},x=O=>{y(O),v({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:O,nativeColor:p,isShowValue:l})},M=O=>{C(O),v({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:O,isShowValue:l})},z=O=>m.map(L=>L.value).includes(O);return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
50
50
|
${G.cfPreviewWrap}
|
|
51
|
-
`,children:
|
|
51
|
+
`,children:R.jsx(We,{rule:d({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})})}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.fillType")}),R.jsxs("div",{className:`
|
|
52
52
|
${A.mTSm}
|
|
53
53
|
${A.mLXxs}
|
|
54
54
|
${A.labelContainer}
|
|
55
|
-
`,children:[
|
|
55
|
+
`,children:[R.jsxs(ee.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})},children:[R.jsx(ee.Radio,{value:"0",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.pureColor")})}),R.jsx(ee.Radio,{value:"1",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.gradient")})})]}),R.jsxs("div",{className:`
|
|
56
56
|
${G.utilItem}
|
|
57
57
|
${A.mLXl}
|
|
58
|
-
`,children:[
|
|
58
|
+
`,children:[R.jsx(ee.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:!O})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.colorSet")}),R.jsxs("div",{className:`
|
|
59
59
|
${A.labelContainer}
|
|
60
60
|
${A.mTSm}
|
|
61
61
|
${A.mLXxs}
|
|
62
|
-
`,children:[
|
|
62
|
+
`,children:[R.jsxs("div",{className:`
|
|
63
63
|
${A.labelContainer}
|
|
64
|
-
`,children:[
|
|
64
|
+
`,children:[R.jsx("div",{className:`
|
|
65
65
|
${G.text}
|
|
66
|
-
`,children:
|
|
66
|
+
`,children:n.t("sheet.cf.panel.native")}),R.jsx(Me,{color:p,onChange:M})]}),R.jsxs("div",{className:`
|
|
67
67
|
${A.labelContainer}
|
|
68
68
|
${A.mLSm}
|
|
69
|
-
`,children:[
|
|
69
|
+
`,children:[R.jsx("div",{className:`
|
|
70
70
|
${G.text}
|
|
71
|
-
`,children:
|
|
71
|
+
`,children:n.t("sheet.cf.panel.positive")}),R.jsx(Me,{color:u,onChange:x})]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:`
|
|
72
72
|
${A.mTSm}
|
|
73
73
|
${A.labelContainer}
|
|
74
|
-
`,children:[
|
|
74
|
+
`,children:[R.jsx(ee.Select,{style:{width:"50%",flexShrink:0},options:w,value:I,onChange:O=>{S(O);const L=c.createDefaultValueByValueType(O,10);s(L),v({isGradient:a,minValue:L,minValueType:O,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!z(I),id:"min",type:I,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:`
|
|
75
75
|
${A.mTSm}
|
|
76
76
|
${A.labelContainer}
|
|
77
|
-
`,children:[
|
|
78
|
-
${_e.cfStyleEdit}
|
|
79
|
-
${n}
|
|
80
|
-
`,children:[i&&_.jsx("div",{className:xt({[_e.isActive]:Lt(o||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>u(Nt(o)),children:_.jsx(i,{})}),s&&_.jsx("div",{className:xt({[_e.isActive]:Lt(y||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>p(Nt(y)),children:_.jsx(s,{})}),d&&_.jsx("div",{className:xt({[_e.isActive]:Lt(S||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>m(Nt(S)),children:_.jsx(d,{})}),b&&_.jsx("div",{className:xt({[_e.isActive]:Lt(I||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>E(Nt(I)),children:_.jsx(b,{})}),_.jsx(xe,{color:w,onChange:C,iconId:"FontColor"}),_.jsx(xe,{color:R,onChange:h,iconId:"PaintBucket"})]})},xa=t=>{var b;const{onChange:e,interceptorManager:r}=t,n=te.useDependency(T.LocaleService),o=te.useDependency(T.IUniverInstanceService).getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=U.useRef(null),[S,m]=U.useState(!1),I=U.useRef({}),[E,w]=U.useState({}),[C,R]=U.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=U.useState(void 0),s=l=>({style:l.style,value:C,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});U.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,C,r]),U.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,f,v)=>h||C.length===1||!C.startsWith("=")?(i(n.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,C]);const d=l=>{e(s(l))};return te.useSidebarClick(l=>{var f;const g=(f=I.current)==null?void 0:f.handleOutClick;g&&g(l,()=>m(!1))}),_.jsxs("div",{ref:p,children:[_.jsx("div",{className:`
|
|
77
|
+
`,children:[R.jsx(ee.Select,{style:{width:"50%",flexShrink:0},options:E,value:T,onChange:O=>{h(O);const L=c.createDefaultValueByValueType(O,90);b(L),v({isGradient:a,minValue:i,minValueType:I,maxValue:L,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!z(T),id:"max",type:T,className:A.mLSm,value:f,onChange:O=>{b(O||0),v({isGradient:a,minValue:i,minValueType:I,maxValue:O||0,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})},Re={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Rt=t=>[_.BooleanNumber.FALSE,void 0].includes(t)?_.BooleanNumber.TRUE:_.BooleanNumber.FALSE,Et=t=>t!==_.BooleanNumber.FALSE,sr=t=>{const{style:e,onChange:n,className:r}=t,a=te.useDependency(te.ComponentManager),[o,u]=V.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=V.useState(()=>{if(e!=null&&e.it)return e.it}),[C,m]=V.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[w,E]=V.useState(()=>{if(e!=null&&e.st)return e.st.s}),[I,S]=V.useState(()=>{var g;const l="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:l}),[T,h]=V.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"),f=a.get("UnderlineSingle"),b=a.get("StrikethroughSingle");return V.useEffect(()=>{const l={bl:o,it:y};I!==void 0&&(l.cl={rgb:I}),T!==void 0&&(l.bg={rgb:T}),w!==void 0&&(l.st={s:w}),C!==void 0&&(l.ul={s:C}),n(c.removeUndefinedAttr(l))},[o,y,C,w,I,T]),R.jsxs("div",{className:ee.clsx(Re.cfStyleEdit,r),children:[i&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(o||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>u(Rt(o)),children:R.jsx(i,{})}),s&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(y||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>p(Rt(y)),children:R.jsx(s,{})}),f&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(C||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>m(Rt(C)),children:R.jsx(f,{})}),b&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(w||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>E(Rt(w)),children:R.jsx(b,{})}),R.jsx(Me,{color:I,onChange:S,iconId:"FontColor"}),R.jsx(Me,{color:T,onChange:h,iconId:"PaintBucket"})]})},Ia=t=>{var b;const{onChange:e,interceptorManager:n}=t,r=te.useDependency(_.LocaleService),o=te.useDependency(_.IUniverInstanceService).getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=V.useRef(null),[C,m]=V.useState(!1),w=V.useRef({}),[E,I]=V.useState({}),[S,T]=V.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=V.useState(void 0),s=l=>({style:l.style,value:S,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,S,n]),V.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(g,d,v)=>h||S.length===1||!S.startsWith("=")?(i(r.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,S]);const f=l=>{e(s(l))};return te.useSidebarClick(l=>{var d;const g=(d=w.current)==null?void 0:d.handleOutClick;g&&g(l,()=>m(!1))}),R.jsxs("div",{ref:p,children:[R.jsx("div",{className:`
|
|
81
78
|
${A.title}
|
|
82
79
|
${A.mTBase}
|
|
83
|
-
`,children:
|
|
80
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
84
81
|
${A.mTSm}
|
|
85
|
-
`,children:
|
|
82
|
+
`,children:R.jsx(Ge.FormulaEditor,{onChange:l=>{T(l),f({style:E})},onVerify:(l,g)=>{!l||g.length===1?i(r.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:w.current,isFocus:C,initValue:S,unitId:o.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),R.jsx("div",{className:`
|
|
86
83
|
${G.cfPreviewWrap}
|
|
87
|
-
`,children:
|
|
84
|
+
`,children:R.jsx(We,{rule:s({style:E})})}),R.jsx(sr,{style:y==null?void 0:y.style,className:`
|
|
88
85
|
${A.mTSm}
|
|
89
|
-
`,onChange:l=>{
|
|
86
|
+
`,onChange:l=>{I(l),f({style:l})}})]})},Ot=t=>R.jsxs("div",{style:{position:"relative"},children:[R.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ce=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),_a=t=>{const{type:e,operator:n,onChange:r,value:a,interceptorManager:o}=t,u=te.useDependency(_.LocaleService),[y,p]=V.useState(()=>typeof a=="number"?a:0),[C,m]=V.useState(""),[w,E]=V.useState(()=>typeof a=="string"?a:""),[I,S]=V.useState(""),[T,h]=V.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=V.useState(""),[f,b]=V.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=V.useState("");switch(V.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(n)&&r(w);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)&&r(y),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)&&r([T,f]);break}}},[e]),V.useEffect(()=>{const d=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,x,M)=>{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(n))return w?M(v):(S(u.t("sheet.cf.errorMessage.notBlank")),!1)}return M(v)}});return()=>{d()}},[e,y,w,n]),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(n)){const d=v=>{E(v),r(v)};return R.jsx("div",{className:`
|
|
90
87
|
${A.mTSm}
|
|
91
|
-
`,children:
|
|
88
|
+
`,children:R.jsx(Ot,{errorText:I,children:R.jsx(ee.Input,{className:G.width100,value:w,onChange:v=>{S(""),d(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(n)){const d=v=>{p(v||0),r(v||0),m("")};return R.jsx("div",{className:`
|
|
92
89
|
${A.mTSm}
|
|
93
|
-
`,children:
|
|
90
|
+
`,children:R.jsx(Ot,{errorText:C,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:y,onChange:d})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)){const d=x=>{h(x||0),r([x||0,f]),s("")},v=x=>{b(x||0),r([T,x||0]),g("")};return R.jsxs("div",{className:`
|
|
94
91
|
${A.mTSm}
|
|
95
92
|
${A.labelContainer}
|
|
96
|
-
`,children:[
|
|
93
|
+
`,children:[R.jsx(Ot,{errorText:i,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:T,onChange:d})}),R.jsx(Ot,{errorText:l,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
97
94
|
${A.mLSm}
|
|
98
|
-
`,value:
|
|
95
|
+
`,value:f,onChange:v})})]})}}}return null},fn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[ce(c.CFTextOperator.containsText,e),ce(c.CFTextOperator.notContainsText,e),ce(c.CFTextOperator.beginsWith,e),ce(c.CFTextOperator.endsWith,e),ce(c.CFTextOperator.equal,e),ce(c.CFTextOperator.notEqual,e),ce(c.CFTextOperator.containsBlanks,e),ce(c.CFTextOperator.notContainsBlanks,e),ce(c.CFTextOperator.containsErrors,e),ce(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[ce(c.CFNumberOperator.between,e),ce(c.CFNumberOperator.notBetween,e),ce(c.CFNumberOperator.equal,e),ce(c.CFNumberOperator.notEqual,e),ce(c.CFNumberOperator.greaterThan,e),ce(c.CFNumberOperator.greaterThanOrEqual,e),ce(c.CFNumberOperator.lessThan,e),ce(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[ce(c.CFTimePeriodOperator.yesterday,e),ce(c.CFTimePeriodOperator.today,e),ce(c.CFTimePeriodOperator.tomorrow,e),ce(c.CFTimePeriodOperator.last7Days,e),ce(c.CFTimePeriodOperator.lastWeek,e),ce(c.CFTimePeriodOperator.thisWeek,e),ce(c.CFTimePeriodOperator.nextWeek,e),ce(c.CFTimePeriodOperator.lastMonth,e),ce(c.CFTimePeriodOperator.thisMonth,e),ce(c.CFTimePeriodOperator.nextMonth,e)]}},pn=t=>{var b;const{interceptorManager:e,onChange:n}=t,r=te.useDependency(_.LocaleService),a=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,[o,u]=V.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:c.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],p=V.useMemo(()=>fn(o,r),[o]),[C,m]=V.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[w,E]=V.useState(()=>{var d;const l="";return a?(d=a.value)!=null?d:c.createDefaultValue(a.subType,a.operator):l}),[I,S]=V.useState({}),T=V.useMemo(()=>l=>{var g,d,v,x,M,z,U,O,L,F,q,J,le,ae,B;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(C))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(d=l.operator)!=null?d:C,style:(v=l.style)!=null?v:I,value:(x=l.value)!=null?x:w};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(C))return{type:c.CFRuleType.highlightCell,subType:(M=l.subType)!=null?M:o,operator:(z=l.operator)!=null?z:C,style:(U=l.style)!=null?U:I,value:(O=l.value)!=null?O:w};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(C))return{type:c.CFRuleType.highlightCell,subType:(L=l.subType)!=null?L:o,operator:(F=l.operator)!=null?F:C,style:(q=l.style)!=null?q:I,value:(J=l.value)!=null?J:w};break}}return{type:c.CFRuleType.highlightCell,subType:(le=l.subType)!=null?le:o,operator:(ae=l.operator)!=null?ae:C,style:(B=l.style)!=null?B:I}},[o,C,w,I]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return T({})}}),[T,e]),V.useEffect(()=>{y.some(l=>l.value===o)||u(y[0].value)},[y]);const h=l=>{const g=l,d=fn(g,r),v=d&&d[0].value;u(g),m(v),v&&E(c.createDefaultValue(g,v)),n(T({subType:g,operator:v}))},i=l=>{const g=l;m(g),n(T({operator:g}))},s=l=>{E(l),n(T({value:l}))},f=V.useMemo(()=>`${o}_${C}_${Math.random()}`,[o,C]);return R.jsxs("div",{children:[R.jsx("div",{className:`
|
|
99
96
|
${A.title}
|
|
100
97
|
${A.mTBase}
|
|
101
|
-
`,children:
|
|
98
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(ee.Select,{className:`
|
|
102
99
|
${A.mTSm}
|
|
103
100
|
${G.width100}
|
|
104
|
-
`,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&
|
|
101
|
+
`,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&R.jsx(ee.Select,{className:`
|
|
105
102
|
${A.mTSm}
|
|
106
103
|
${G.width100}
|
|
107
|
-
`,onChange:i,value:
|
|
104
|
+
`,onChange:i,value:C||"",options:p}),R.jsx(_a,{value:w,interceptorManager:e,type:o,operator:C,rule:a,onChange:s},f),R.jsx("div",{className:`
|
|
108
105
|
${G.cfPreviewWrap}
|
|
109
|
-
`,children:
|
|
106
|
+
`,children:R.jsx(We,{rule:T({})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
|
|
110
107
|
${A.mLXxs}
|
|
111
|
-
`,onChange:l=>{
|
|
108
|
+
`,onChange:l=>{S(l),n(T({style:l}))}})]})},hn=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",Ra=t=>{var p;const e=te.useDependency(_.IUniverInstanceService),n=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(p=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=V.useMemo(()=>t.error?G.errorInput:"",[t.error]),o=V.useRef({}),[u,y]=V.useState(!1);return te.useSidebarClick(C=>{var w;const m=(w=o.current)==null?void 0:w.handleOutClick;m&&m(C,()=>y(!1))}),R.jsx("div",{className:G.positionRelative,children:t.type!==c.CFValueType.formula?R.jsxs(R.Fragment,{children:[R.jsx(ee.InputNumber,{className:a,value:Number(t.value)||0,onChange:C=>t.onChange(C!=null?C:0)}),t.error&&R.jsx("div",{className:G.errorText,children:t.error})]}):R.jsx("div",{style:{width:"100%"},children:R.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:u,onChange:(C="")=>{const m=C||"";t.onChange(m)},onFocus:()=>y(!0),actions:o.current})})})},gn=(t,e,n)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),Ea=V.forwardRef((t,e)=>{const n=te.useDependency(_.LocaleService),r=a=>{t.onClick(a)};return R.jsx("div",{ref:e,className:G.iconGroupList,children:c.iconGroup.map((a,o)=>R.jsxs("div",{className:G.group,children:[R.jsx("div",{className:G.title,children:n.t(a.title)}),R.jsx("div",{className:G.itemContent,children:a.group.map(u=>R.jsx("div",{className:G.itemWrap,onClick:()=>{r(u.name)},children:R.jsx("div",{className:G.item,children:u.list.map((y,p)=>R.jsx("img",{className:G.icon,src:y},p))})},u.name))})]},o))})}),Oa=t=>{const e=V.useMemo(()=>{const r=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((y,p)=>{r.push({iconType:u,base64:y,iconId:String(p)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return R.jsxs("div",{className:G.iconItemListWrap,children:[R.jsxs("div",{className:G.none,onClick:()=>n({iconType:c.EMPTY_ICON_TYPE,iconId:""}),children:[R.jsx(Xe,{className:G.icon}),R.jsx("span",{children:"无单元格图标"})]}),R.jsx("div",{className:G.iconItemList,children:e.map(r=>R.jsx("div",{className:G.item,children:R.jsx("img",{onClick:()=>n(r),className:`
|
|
112
109
|
${G.icon}
|
|
113
|
-
`,src:
|
|
110
|
+
`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,a=te.useDependency(_.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}],y=(w,E)=>{e([String(E),"value","value"],w)},p=(w,E)=>{e([String(E),"operator"],w);const I=c.createDefaultValue(c.CFSubRuleType.number,w);y(I,E)},C=(w,E)=>{e([String(E),"value","type"],w);const I=n[E],S=c.createDefaultValue(c.CFSubRuleType.number,I.operator);y(S,E)};return V.useMemo(()=>n.map((w,E)=>{const I=r[E],S=hn(w.iconType,w.iconId),T=E===n.length-1,h=E===0,i=n[E-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,f=(b,l)=>{const g={...w,iconId:l,iconType:b};e([String(E)],g)};return R.jsxs("div",{className:`
|
|
114
111
|
${E?A.mTXl:A.mTSm}
|
|
115
|
-
`,children:[
|
|
112
|
+
`,children:[R.jsxs("div",{className:`
|
|
116
113
|
${A.label}
|
|
117
114
|
${G.flex}
|
|
118
|
-
`,children:[
|
|
115
|
+
`,children:[R.jsxs("div",{className:`
|
|
119
116
|
${G.width45}
|
|
120
|
-
`,children:[a.t("sheet.cf.iconSet.icon"),E+1]}),
|
|
117
|
+
`,children:[a.t("sheet.cf.iconSet.icon"),E+1]}),R.jsx("div",{className:`
|
|
121
118
|
${G.width45}
|
|
122
|
-
`,children:
|
|
119
|
+
`,children:R.jsxs(R.Fragment,{children:[!h&&!T&&a.t("sheet.cf.iconSet.rule"),!h&&!T&&R.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),R.jsxs("div",{className:`
|
|
123
120
|
${G.flex}
|
|
124
121
|
${A.mTSm}
|
|
125
|
-
`,children:[
|
|
122
|
+
`,children:[R.jsx("div",{className:`
|
|
126
123
|
${G.iconWrap}
|
|
127
124
|
${G.width45}
|
|
128
|
-
`,children:
|
|
125
|
+
`,children:R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Oa,{onClick:f,iconId:w.iconId,iconType:w.iconType})}),children:R.jsxs("div",{className:ee.clsx(G.dropdownIcon,"univer-box-border univer-h-7"),children:[S?R.jsx("img",{src:S,className:G.icon}):R.jsx(Xe,{className:G.icon}),R.jsx(vt,{})]})})}),T?R.jsxs("div",{className:`
|
|
129
126
|
${G.width45}
|
|
130
127
|
${A.label}
|
|
131
|
-
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),
|
|
128
|
+
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),R.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):R.jsx(ee.Select,{className:`
|
|
132
129
|
${A.mL0}
|
|
133
130
|
${G.width45}
|
|
134
131
|
${A.mR0}
|
|
135
|
-
`,options:o,value:
|
|
132
|
+
`,options:o,value:w.operator,onChange:b=>{p(b,E)}})]}),T?R.jsx("div",{}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:`
|
|
136
133
|
${A.mTSm}
|
|
137
134
|
${A.label}
|
|
138
135
|
${G.flex}
|
|
139
|
-
`,children:[
|
|
136
|
+
`,children:[R.jsx("div",{className:`
|
|
140
137
|
${G.width45}
|
|
141
|
-
`,children:a.t("sheet.cf.iconSet.type")}),
|
|
138
|
+
`,children:a.t("sheet.cf.iconSet.type")}),R.jsx("div",{className:`
|
|
142
139
|
${G.width45}
|
|
143
|
-
`,children:a.t("sheet.cf.iconSet.value")})]}),
|
|
140
|
+
`,children:a.t("sheet.cf.iconSet.value")})]}),R.jsxs("div",{className:`
|
|
144
141
|
${A.mTSm}
|
|
145
142
|
${G.flex}
|
|
146
|
-
`,children:[
|
|
143
|
+
`,children:[R.jsx(ee.Select,{style:{flexShrink:0},className:`
|
|
147
144
|
${G.width45}
|
|
148
145
|
${A.mL0}
|
|
149
|
-
`,options:u,value:
|
|
146
|
+
`,options:u,value:w.value.type,onChange:b=>{C(b,E)}}),R.jsx("div",{className:`
|
|
150
147
|
${A.mL0}
|
|
151
148
|
${G.width45}
|
|
152
|
-
`,children:
|
|
149
|
+
`,children:R.jsx(Ra,{id:E,type:w.value.type,error:I,value:w.value.value||"",onChange:b=>y(b,E)})})]})]})]},E)}),[n,r])},Da=t=>{var b;const{interceptorManager:e}=t,n=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.iconSet?t.rule:void 0,r=te.useDependency(_.LocaleService),[a,o]=V.useState({}),[u,y]=V.useState(()=>{const l=Object.keys(c.iconMap)[0];if(n&&n.config.length){const g=n.config[0].iconType;if(!n.config.some(v=>v.iconType!==g))return g}return l}),[p,C]=V.useState(()=>{if(n&&n.config.length)return _.Tools.deepClone(n==null?void 0:n.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,d,v)=>d===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(d)}:gn(u,d,v))}),[m,w]=V.useState(()=>n?!!n.isShowValue:!0),E=V.useMemo(()=>{const l=p.map(g=>hn(g.iconType,g.iconId));return R.jsx("div",{className:G.iconWrap,children:l.map((g,d)=>g?R.jsx("img",{className:G.icon,src:g},d):R.jsx(Xe,{className:G.icon},d))})},[p]),I=l=>{if(l.reduce((d,v,x)=>d.preType&&!d.result||l.length-1===x?d:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:d.preType?{result:d.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 d={};return l.forEach((v,x,M)=>{if(x-1<0||x===M.length-1)return;const U=l[x-1],O=c.getOppositeOperator(U.operator);c.compareWithNumber({operator:O,value:U.value.value},v.value.value)||(d[x]=`${r.t(`sheet.cf.form.${O}`,String(U.value.value))} `)}),d}return{}},S=(l,g)=>{_.get(p,l)!==g&&(_.set(p,l,g),C([...p]),o(I(p)))},T=l=>{y(l);const g=c.iconMap[l]||[],d=new Array(g.length).fill("").map((v,x,M)=>gn(l,x,M));C(d),o(I(d))};V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{l()}},[m,p,e]),V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[m,p,e,a]);const h=()=>{const l=p.map(g=>({...g}));p.forEach((g,d)=>{const v=p.length-1-d,x=l[v];g.iconId=x.iconId,g.iconType=x.iconType}),C([...p])},i=te.useDependency(te.ILayoutService),[s,f]=V.useState();return te.useScrollYOverContainer(s,i.rootContainerElement),R.jsxs("div",{className:G.iconSet,children:[R.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
153
150
|
${A.mTSm}
|
|
154
|
-
`,children:
|
|
151
|
+
`,children:R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Ea,{ref:l=>{!s&&l&&f(l)},iconType:u,onClick:T})}),children:R.jsxs("div",{className:ee.clsx(G.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[E,R.jsx(vt,{})]})})}),R.jsxs("div",{className:`
|
|
155
152
|
${A.mTSm}
|
|
156
153
|
${G.renderConfig}
|
|
157
|
-
`,children:[
|
|
154
|
+
`,children:[R.jsxs("div",{className:G.utilItem,children:[R.jsx(ee.Checkbox,{onChange:h}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),R.jsxs("div",{className:`
|
|
158
155
|
${G.utilItem}
|
|
159
156
|
${A.mLXl}
|
|
160
|
-
`,children:[
|
|
157
|
+
`,children:[R.jsx(ee.Checkbox,{checked:!m,onChange:l=>{w(!l)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),R.jsx(Pa,{errorMap:a,onChange:S,configList:p})]})},xa=t=>{var h;const{onChange:e,interceptorManager:n}=t,r=te.useDependency(_.LocaleService),a=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,o=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[u,y]=V.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,C]=V.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}),[m,w]=V.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}),[E,I]=V.useState({}),S=i=>{const{type:s,isPercent:f,value:b,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!1,value:b,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!0,value:b,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}};V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return S({type:u,isPercent:m,value:p,style:E})}}),[u,m,p,E,n]);const T=i=>{e(S(i))};return R.jsxs("div",{children:[R.jsx("div",{className:`
|
|
161
158
|
${A.title}
|
|
162
159
|
${A.mTBase}
|
|
163
|
-
`,children:
|
|
160
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(ee.Select,{className:`
|
|
164
161
|
${G.width100}
|
|
165
162
|
${A.mTSm}
|
|
166
|
-
`,value:u,options:o,onChange:i=>{y(i),
|
|
163
|
+
`,value:u,options:o,onChange:i=>{y(i),T({type:i,isPercent:m,value:p,style:E})}}),["isNotBottom","isBottom"].includes(u)&&R.jsxs("div",{className:`
|
|
167
164
|
${A.labelContainer}
|
|
168
165
|
${A.mTSm}
|
|
169
|
-
`,children:[
|
|
166
|
+
`,children:[R.jsx(ee.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;C(s),T({type:u,isPercent:m,value:s,style:E})}}),R.jsxs("div",{className:`
|
|
170
167
|
${A.mLSm}
|
|
171
168
|
${A.labelContainer}
|
|
172
169
|
${G.text}
|
|
173
|
-
`,children:[
|
|
170
|
+
`,children:[R.jsx(ee.Checkbox,{checked:m,onChange:i=>{w(!!i),T({type:u,isPercent:!!i,value:p,style:E})}}),r.t("sheet.cf.valueType.percent")]})]}),R.jsx("div",{className:`
|
|
174
171
|
${G.cfPreviewWrap}
|
|
175
|
-
`,children:
|
|
172
|
+
`,children:R.jsx(We,{rule:S({type:u,isPercent:m,value:p,style:E})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
|
|
176
173
|
${A.mTSm}
|
|
177
|
-
`,onChange:i=>{
|
|
174
|
+
`,onChange:i=>{I(i),T({type:u,isPercent:m,value:p,style:i})}})]})},Ma=_.createInterceptorKey("beforeSubmit"),Na=_.createInterceptorKey("submit"),vn=t=>t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),mn=t=>{var e;return(e=t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},La=t=>{var d,v,x;const e=te.useDependency(_.LocaleService),n=te.useDependency(_.ICommandService),r=te.useDependency(_.IUniverInstanceService),a=te.useDependency(c.ConditionalFormattingRuleModel),o=te.useDependency(Y.SheetsSelectionsService),u=vn(r),y=mn(r),[p,C]=V.useState(void 0),m=V.useRef((v=(d=t.rule)==null?void 0:d.ranges)!=null?v:[]),w=V.useMemo(()=>{var z,U,O;let M=(z=t.rule)==null?void 0:z.ranges;return M!=null&&M.length||(M=(O=(U=o.getCurrentSelections())==null?void 0:U.map(L=>L.range))!=null?O:[]),m.current=M,M!=null&&M.length?M.map(L=>{const F=kt.serializeRange(L);return F==="NaN"?"":F}).filter(L=>!!L).join(","):""},[t.rule]),E=[{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"}],[I,S]=V.useState(()=>{var U,O;const M=(U=t.rule)==null?void 0:U.rule.type,z=E[0].value;if(!M)return z;switch(M){case c.CFRuleType.highlightCell:{switch((O=t.rule)==null?void 0:O.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 z}),T=V.useRef(void 0),h=V.useMemo(()=>new _.InterceptorManager({beforeSubmit:Ma,submit:Na}),[]),i=V.useMemo(()=>{switch(I){case"1":return pn;case"2":return xa;case"3":return wa;case"4":return Ta;case"5":return Ia;case"6":return Da;default:return pn}},[I]);V.useEffect(()=>{const M=n.onCommandExecuted(z=>{if(z.id===Y.RemoveSheetMutation.id){const U=z.params;U.subUnitId===y&&U.unitId===u&&t.onCancel()}z.id===Y.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>M.dispose()},[]);const s=M=>{T.current=M},f=M=>{const z=M.split(",").filter(U=>!!U).map(kt.deserializeRangeWithSheet).map(U=>U.range);m.current=z},b=()=>{if(p)return;const z=(()=>{const O=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!O)throw new Error("No active sheet found");return m.current.map(q=>Y.setEndForRange(q,O.getRowCount(),O.getColumnCount())).filter(q=>!(Number.isNaN(q.startRow)||Number.isNaN(q.startColumn)))})();if(h.fetchThroughInterceptors(h.getInterceptPoints().beforeSubmit)(!0,null)){const O=h.fetchThroughInterceptors(h.getInterceptPoints().submit)(null,null);if(O){const L=vn(r),F=mn(r);if(!L||!F)throw new Error("No active sheet found");let q={};t.rule&&t.rule.cfId?(q={...t.rule,ranges:z,rule:O},n.executeCommand(c.SetCfCommand.id,{unitId:L,subUnitId:F,rule:q}),t.onCancel()):(q={cfId:a.createCfId(L,F),ranges:z,rule:O,stopIfTrue:!1},n.executeCommand(c.AddCfCommand.id,{unitId:L,subUnitId:F,rule:q}),t.onCancel())}}},l=()=>{t.onCancel()},g=(M,z)=>{M?z.length<1?C(e.t("sheet.cf.errorMessage.rangeError")):C(void 0):C(e.t("sheet.cf.errorMessage.rangeError"))};return R.jsxs("div",{className:G.cfRuleStyleEditor,children:[R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),R.jsxs("div",{className:`
|
|
178
175
|
${A.mTBase}
|
|
179
|
-
`,children:[
|
|
176
|
+
`,children:[R.jsx(Ge.RangeSelector,{unitId:u,subUnitId:y,initialValue:w,onChange:(M,z)=>f(z),onVerify:g}),p&&R.jsx("div",{className:G.cfErrorText,children:p})]}),R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),R.jsx("div",{className:A.mTBase,children:R.jsx(ee.Select,{className:G.width100,value:I,options:E,onChange:M=>S(M)})}),R.jsx(i,{interceptorManager:h,rule:(x=t.rule)==null?void 0:x.rule,onChange:s}),R.jsxs("div",{className:`
|
|
180
177
|
${A.mTBase}
|
|
181
178
|
${G.btnList}
|
|
182
|
-
`,children:[_.jsx(ne.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),_.jsx(ne.Button,{className:A.mLSm,size:"small",type:"primary",onClick:b,children:e.t("sheet.cf.panel.submit")})]})]})},Ba=t=>{const[e,r]=U.useState(t.rule),[n,a]=U.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),r(void 0)},y=p=>{r(p),a(!0)};return _.jsx("div",{className:A.conditionalFormattingWrap,children:n?_.jsx(Ha,{onCancel:u,rule:e}):_.jsx(Ma,{onClick:y,onCreate:o})})};var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,r,n)=>{for(var a=n>1?void 0:n?Fa(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(r,n)=>e(r,n,t);const Vt="sheet.conditional.formatting.panel";let lt=class extends T.Disposable{constructor(e,r,n,a,o){super();De(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$(T.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.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:T.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Ba)}};lt=Ga([st(0,T.IUniverInstanceService),st(1,T.Inject(T.Injector)),st(2,T.Inject(te.ComponentManager)),st(3,T.Inject(te.ISidebarService)),st(4,T.Inject(T.LocaleService))],lt);var me=(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))(me||{});const ct={id:"sheet.operation.open.conditional.formatting.panel",type:T.CommandType.OPERATION,handler:(t,e)=>{var y;const r=t.get(lt),n=t.get(q.SheetsSelectionsService),a=t.get(T.ICommandService),o=((y=n.getCurrentSelections())==null?void 0:y.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 qa=Object.getOwnPropertyDescriptor,Xa=(t,e,r,n)=>{for(var a=n>1?void 0:n?qa(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ut=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends T.Disposable{constructor(e,r,n,a,o){super();De(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=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,r,n){const a=new T.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:r,cfMap:o}};const u=this._injector.invoke(m=>q.rangeToDiscreteRange(n,m,e,r));if(!u)return;const{rows:y,cols:p}=u,S=new Set;y.forEach((m,I)=>{p.forEach((E,w)=>{const C=this._conditionalFormattingViewModel.getCellCfs(e,r,m,E);C&&(C.forEach(R=>S.add(R.cfId)),a.setValue(I,w,C.map(R=>R.cfId)))})}),S.forEach(m=>{const I=this._conditionalFormattingRuleModel.getRule(e,r,m);I&&(o[m]=I.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),o=n.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(r.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,fe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,S],mapFunc:m}=fe.virtualizeDiscreteRanges([r.copyRange,e]),I=fe.getRepeatRange(p,S,!0),E={};T.Range.foreach(S,(l,g)=>{const{row:f,col:v}=m(l,g),P=this._conditionalFormattingViewModel.getCellCfs(o,u,f,v);P&&P.forEach(x=>{if(!E[x.cfId]){const z=new T.ObjectMatrix;E[x.cfId]=z;const V=this._conditionalFormattingRuleModel.getRule(o,u,x.cfId);V==null||V.ranges.forEach(O=>{T.Range.foreach(O,(L,B)=>{z.setValue(L,B,1)})})}E[x.cfId].realDeleteValue(f,v)})});const{matrix:w,info:C}=this._copyInfo,R=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=C==null?void 0:C.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...R].find(v=>T.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 P=T.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:f,endColumn:f},l.startRange),{row:x,col:z}=m(P.startRow,P.startColumn);v.forEach(V=>{if(!E[V]){const O=s(V),L=new T.ObjectMatrix;E[V]=L,O.ranges.forEach(B=>{T.Range.foreach(B,(X,J)=>{L.setValue(X,J,1)})})}E[V].setValue(x,z,1)})})});const d=[],b=[];for(const l in E){const g=E[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}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(R.some(v=>v.cfId===l)){const v=s(l),P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:P}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,P))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:P}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,P))}}return{redos:d,undos:b}}};dt=Xa([ut(0,T.Inject(fe.ISheetClipboardService)),ut(1,T.Inject(c.ConditionalFormattingRuleModel)),ut(2,T.Inject(T.Injector)),ut(3,T.Inject(c.ConditionalFormattingViewModel)),ut(4,T.Inject(T.IUniverInstanceService))],dt);var 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=u(a)||a);return a},vn=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends T.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=Ka([vn(0,T.Inject(T.LocaleService)),vn(1,T.ICommandService),vn(2,T.Inject(q.SheetPermissionCheckController))],ft);var $a=Object.getOwnPropertyDescriptor,Za=(t,e,r,n)=>{for(var a=n>1?void 0:n?$a(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},zt=(t,e)=>(r,n)=>e(r,n,t);let pt=class extends T.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 S=[...o.ranges],m=S.map(E=>q.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,S))return{redos:[],undos:[]};if(m.length){const E={unitId:n,subUnitId:a,rule:{...o,ranges:m}},w=[{id:c.SetConditionalRuleMutation.id,params:E}],C=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:w,undos:C}}else{const E={unitId:n,subUnitId:a,cfId:o.cfId},w=[{id:c.DeleteConditionalRuleMutation.id,params:E}],C=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:w,undos:C}}},y=[];o.ranges.forEach(p=>{const S=this._refRangeService.registerRefRange(p,u);y.push(()=>S.dispose())}),t.set(e(n,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:o,rule:u}=n,y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(n.unitId!==y.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 S=t.get(e(a,o,u.cfId));S&&S();break}case"set":{const S=t.get(e(a,o,u.cfId));S&&S(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(T.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};pt=Za([zt(0,T.Inject(c.ConditionalFormattingRuleModel)),zt(1,T.Inject(T.IUniverInstanceService)),zt(2,T.Inject(T.Injector)),zt(3,T.Inject(q.RefRangeService))],pt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,r,n)=>{for(var a=n>1?void 0:n?Ja(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(r,n)=>e(r,n,t);let ht=class extends T.Disposable{constructor(e,r,n,a,o,u){super();De(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(T.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(fe.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(T.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:T.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(),y={...(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:y};return a.style&&Object.assign(y,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=Qa([He(0,T.Inject(q.SheetInterceptorService)),He(1,T.Inject(c.ConditionalFormattingService)),He(2,T.Inject(T.IUniverInstanceService)),He(3,T.Inject(Tn.IRenderManagerService)),He(4,T.Inject(c.ConditionalFormattingViewModel)),He(5,T.Inject(c.ConditionalFormattingRuleModel))],ht);const _r="sheets-conditional-formatting-ui.config",kt={};var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,no=(t,e,r)=>e in t?eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ro=(t,e,r,n)=>{for(var a=n>1?void 0:n?to(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},mn=(t,e)=>(r,n)=>e(r,n,t),Er=(t,e,r)=>no(t,typeof e!="symbol"?e+"":e,r);K.UniverSheetsConditionalFormattingMobileUIPlugin=class extends T.Plugin{constructor(e=kt,r,n,a){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,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([Ae])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Er(K.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Er(K.UniverSheetsConditionalFormattingMobileUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),K.UniverSheetsConditionalFormattingMobileUIPlugin=ro([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),mn(1,T.Inject(T.Injector)),mn(2,T.Inject(T.ICommandService)),mn(3,T.IConfigService)],K.UniverSheetsConditionalFormattingMobileUIPlugin);var ao=Object.getOwnPropertyDescriptor,oo=(t,e,r,n)=>{for(var a=n>1?void 0:n?ao(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},gt=(t,e)=>(r,n)=>e(r,n,t);let At=class extends T.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,y,p)=>{var w;const S=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(w=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!S||!m)return;const I={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};T.Range.foreach(u,(C,R)=>{const h=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},I),i=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},E),{row:s,col:d}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(S,m,s,d),{row:l,col:g}=p(i.startRow,i.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(S,m,l,g);f&&f.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const x=this._conditionalFormattingRuleModel.getRule(S,m,v.cfId);if(!x)return;P=new T.ObjectMatrix,x.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.realDeleteValue(l,g)}),b&&b.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const x=this._conditionalFormattingRuleModel.getRule(S,m,v.cfId);if(!x)return;P=new T.ObjectMatrix,x.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.setValue(l,g,1)})})},r=(a,o)=>{var i,s,d;const u=(i=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,S=[],m=[];if(!u||!y)return t();const I=fe.virtualizeDiscreteRanges([a,o]),[E,w]=I.ranges,{mapFunc:C}=I,R={row:E.startRow,col:E.startColumn};return fe.getAutoFillRepeatRange(E,w).forEach(b=>{e(R,b.repeatStartCell,b.relativeRange,p,C)}),p.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const f=q.findAllRectangle(q.createTopMatrixFromMatrix(b));if(f.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:f}};S.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};S.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:S}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===fe.APPLY_TYPE.COPY||u===fe.APPLY_TYPE.ONLY_FORMAT||u===fe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return r(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};At=oo([gt(0,T.Inject(T.Injector)),gt(1,T.Inject(T.IUniverInstanceService)),gt(2,T.Inject(fe.IAutoFillService)),gt(3,T.Inject(c.ConditionalFormattingRuleModel)),gt(4,T.Inject(c.ConditionalFormattingViewModel))],At);var 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=u(a)||a);return a},vt=(t,e)=>(r,n)=>e(r,n,t);K.ConditionalFormattingClearController=class extends T.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(C=>C.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const S=y.getUnitId(),m=p.getSheetId(),I=this._conditionalFormattingRuleModel.getSubunitRules(S,m);if(!I||!I.length)return a;const{redos:E,undos:w}=Or(this._injector,I,u,S,m);r.push(...E),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 y=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!y||!y.length)return u;const{redos:p,undos:S}=Or(this._injector,y,n,e,r);return a.push(...p),o.push(...S),u}}))}},K.ConditionalFormattingClearController=so([vt(0,T.Inject(T.Injector)),vt(1,T.Inject(T.IUniverInstanceService)),vt(2,T.Inject(q.SheetInterceptorService)),vt(3,T.Inject(q.SheetsSelectionsService)),vt(4,T.Inject(c.ConditionalFormattingRuleModel))],K.ConditionalFormattingClearController);function Or(t,e,r,n,a){const o=[],u=[];return e.filter(y=>r.some(p=>y.ranges.some(S=>T.Rectangle.getIntersects(S,p)))).forEach(y=>{const S=new q.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(S.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...y,ranges:S}}},I=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...I)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:y.cfId}},I=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...I)}}),{redos:o,undos:u}}var lo=Object.getOwnPropertyDescriptor,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=u(a)||a);return a},Mr=(t,e)=>(r,n)=>e(r,n,t);let Wt=class extends T.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(T.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var u,y,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=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(S=>{S.ts&&o.forEach(m=>{var I;(I=S.ts)==null||delete I[m]})}),r(t);{const S={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(I=>{delete S[I]});const m={...t,s:{...S}};return r(m)}}})))}};Wt=co([Mr(0,T.Inject(q.SheetInterceptorService)),Mr(1,T.Inject(c.ConditionalFormattingService))],Wt);const Dr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],mt=[{label:"sheet.cf.ruleType.highlightCell",value:me.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:me.rank},{label:"sheet.cf.ruleType.formula",value:me.formula},{label:"sheet.cf.ruleType.colorScale",value:me.colorScale},{label:"sheet.cf.ruleType.dataBar",value:me.dataBar},{label:"sheet.cf.ruleType.iconSet",value:me.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:me.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:me.createRule},{label:"sheet.cf.menu.clearRangeRules",value:me.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:me.clearWorkSheetRules}],uo=t=>{const e=t.get(q.SheetsSelectionsService),r=t.get(T.ICommandService),n=t.get(T.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(S=>{const m=r.onCommandExecuted(I=>{var R;const{id:E,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(E)&&w.unitId===C&&S.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var R;const S=((R=e.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],m=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!m)return;const I=m.getActiveSheet();if(!I)return;const C=(a.getSubunitRules(m.getUnitId(),I.getSheetId())||[]).filter(h=>h.ranges.some(i=>S.some(s=>T.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(t,m.getUnitId(),I.getSheetId(),h));p.next(C)})),u=new Ce.Observable(p=>new Ce.Observable(S=>{const m=r.onCommandExecuted(I=>{var R;const{id:E,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(E)&&w.unitId===C&&S.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const S=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!S)return;const m=S.getActiveSheet();if(!m)return;const I=a.getSubunitRules(S.getUnitId(),m.getSheetId())||[];if(!I.length)return p.next(!1),!1;const E=I.map(w=>w.ranges).every(w=>q.checkRangesEditablePermission(t,S.getUnitId(),m.getSheetId(),w));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(S=>{const m=mt.find(I=>I.value===me.clearRangeRules);m&&(m.disabled=!S,p.next(mt))}),u.subscribe(S=>{const m=mt.find(I=>I.value===me.clearWorkSheetRules);m&&(m.disabled=!S,p.next(mt))}),p.next(mt)});return{id:ct.id,type:te.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:te.getMenuHiddenObservable(t,T.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(t,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},fo={[te.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:uo}}};var 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=u(a)||a);return a},Pr=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends T.Disposable{constructor(e,r){super();De(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(fo)}};jt=ho([Pr(0,T.Inject(T.Injector)),Pr(1,te.IMenuManagerService)],jt);var go=Object.getOwnPropertyDescriptor,vo=(t,e,r,n)=>{for(var a=n>1?void 0:n?go(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(r,n)=>e(r,n,t);const mo=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,a=r(e)%r(t),o=n(e)%n(t),u=Math.floor(r(e)/r(t)),y=Math.floor(n(e)/n(t)),p=[],S={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 p.push({repeatRelativeRange:S,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let I=0;I<y+(o?.1:0);I++){const E=r(t)*m,w=n(t)*I,C={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:w+e.startColumn,endColumn:w+e.startColumn};let R=S;m===u&&a&&(R={...R},R.endRow=R.endRow-(r(t)-a)),I===y&&o&&(R={...R},R.endColumn=R.endColumn-(n(t)-o)),p.push({repeatRelativeRange:R,startRange:C})}return p};let Ht=class extends T.Disposable{constructor(e,r,n,a,o,u){super();De(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,y,p,S)=>{const{unitId:m,subUnitId:I}=this._painterConfig,{targetUnitId:E,targetSubUnitId:w}=S,C={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};T.Range.foreach(y,(h,i)=>{const s=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},C),d=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},R),b=this._conditionalFormattingViewModel.getCellCfs(m,I,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,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(E,w,g.cfId);if(!v)return;f=new T.ObjectMatrix,v.ranges.forEach(P=>{T.Range.foreach(P,(x,z)=>{f.setValue(x,z,1)})}),p.set(g.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),b&&b.forEach(g=>{const f=p.get(g.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(o,u,y)=>{var s;const{range:p,unitId:S,subUnitId:m}=this._painterConfig,I=o!==S||m!==u,E=new Map,w=[],C=[];if(!o||!u||!S||!m)return e();const R=(s=this._conditionalFormattingRuleModel.getSubunitRules(S,m))!=null?s:[];R==null||R.forEach(d=>{const{ranges:b,cfId:l}=d;if(b.some(g=>T.Rectangle.intersects(p,g))){const g=new T.ObjectMatrix;I||b.forEach(f=>{T.Range.foreach(f,(v,P)=>{g.setValue(v,P,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return mo(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((d,b)=>{if(I){const l=this._conditionalFormattingRuleModel.getRule(o,u,b),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}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:o,subUnitId:u,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(g.length){const f=this._conditionalFormattingRuleModel.getRule(S,m,b);if(f){const v={unitId:o,subUnitId:u,rule:{...T.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};w.push({id:c.AddConditionalRuleMutation.id,params:v}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(S,m,b);if(!l)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const f={unitId:S,subUnitId:m,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:S,subUnitId:m,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:C,redos:w}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const S=(u=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),I=this._sheetsSelectionsService.getCurrentLastSelection(),E=I==null?void 0:I.range;S&&m&&E&&(this._painterConfig={unitId:S,subUnitId:m,range:E});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?n(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Ht=vo([Be(0,T.Inject(T.Injector)),Be(1,T.Inject(T.IUniverInstanceService)),Be(2,T.Inject(fe.IFormatPainterService)),Be(3,T.Inject(q.SheetsSelectionsService)),Be(4,T.Inject(c.ConditionalFormattingRuleModel)),Be(5,T.Inject(c.ConditionalFormattingViewModel))],Ht);var yo=Object.getOwnPropertyDescriptor,So=(t,e,r,n)=>{for(var a=n>1?void 0:n?yo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},yn=(t,e)=>(r,n)=>e(r,n,t);let Bt=class extends T.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),a=this._renderManagerService.getRenderById(n);if(!a)return;const o=a.with(fe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,I=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(I)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Bt=So([yn(0,T.Inject(c.ConditionalFormattingViewModel)),yn(1,T.IUniverInstanceService),yn(2,Tn.IRenderManagerService)],Bt);var bo=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,To=(t,e,r)=>e in t?bo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Io=(t,e,r,n)=>{for(var a=n>1?void 0:n?Co(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Sn=(t,e)=>(r,n)=>e(r,n,t),xr=(t,e,r)=>To(t,typeof e!="symbol"?e+"":e,r);K.UniverSheetsConditionalFormattingUIPlugin=class extends T.Plugin{constructor(e=kt,r,n,a){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand()}onStarting(){T.registerDependencies(this._injector,[[ht],[pt],[dt],[At],[ft],[lt],[jt],[Ae],[Wt],[K.ConditionalFormattingClearController],[Ht],[Bt]]),T.touchDependencies(this._injector,[[ht]])}onReady(){T.touchDependencies(this._injector,[[jt],[lt]])}onRendered(){T.touchDependencies(this._injector,[[At],[K.ConditionalFormattingClearController],[dt],[Wt],[Ae],[Ht],[ft],[pt],[Bt]])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},xr(K.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),xr(K.UniverSheetsConditionalFormattingUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),K.UniverSheetsConditionalFormattingUIPlugin=Io([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),Sn(1,T.Inject(T.Injector)),Sn(2,T.Inject(T.ICommandService)),Sn(3,T.IConfigService)],K.UniverSheetsConditionalFormattingUIPlugin),K.AddAverageCfCommand=qt,K.AddCfCommand=Xe,K.AddColorScaleConditionalRuleCommand=Xt,K.AddDataBarConditionalRuleCommand=Yt,K.AddDuplicateValuesCfCommand=Kt,K.AddNumberCfCommand=$t,K.AddRankCfCommand=Zt,K.AddTextCfCommand=Jt,K.AddTimePeriodCfCommand=Qt,K.AddUniqueValuesCfCommand=en,K.ClearRangeCfCommand=yt,K.ClearWorksheetCfCommand=Ye,K.DeleteCfCommand=Ke,K.MoveCfCommand=St,K.OpenConditionalFormattingOperator=ct,K.SetCfCommand=bt,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
179
|
+
`,children:[R.jsx(ee.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),R.jsx(ee.Button,{className:A.mLSm,size:"small",type:"primary",onClick:b,children:e.t("sheet.cf.panel.submit")})]})]})},Va=t=>{const[e,n]=V.useState(t.rule),[r,a]=V.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),n(void 0)},y=p=>{n(p),a(!0)};return R.jsx("div",{className:A.conditionalFormattingWrap,children:r?R.jsx(La,{onCancel:u,rule:e}):R.jsx(Ca,{onClick:y,onCreate:o})})};var Ua=Object.getOwnPropertyDescriptor,za=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ua(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},at=(t,e)=>(n,r)=>e(n,r,t);const Pt="sheet.conditional.formatting.panel";let ot=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Pt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:Pt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Pt,rule:e,key:_.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(Pt,Va)}};ot=za([at(0,_.IUniverInstanceService),at(1,_.Inject(_.Injector)),at(2,_.Inject(te.ComponentManager)),at(3,_.Inject(te.ISidebarService)),at(4,_.Inject(_.LocaleService))],ot);var me=(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))(me||{});const it={id:"sheet.operation.open.conditional.formatting.panel",type:_.CommandType.OPERATION,handler:(t,e)=>{var y;const n=t.get(ot),r=t.get(Y.SheetsSelectionsService),a=t.get(_.ICommandService),o=((y=r.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};n.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};n.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};n.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(p);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(c.ClearRangeCfCommand.id,{ranges:o});break}case 10:{a.executeCommand(c.ClearWorksheetCfCommand.id);break}}return!0}};var ka=Object.getOwnPropertyDescriptor,Aa=(t,e,n,r)=>{for(var a=r>1?void 0:r?ka(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(n,r)=>e(n,r,t);let lt=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=n;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,n,r){const a=new _.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:n,cfMap:o}};const u=this._injector.invoke(m=>Y.rangeToDiscreteRange(r,m,e,n));if(!u)return;const{rows:y,cols:p}=u,C=new Set;y.forEach((m,w)=>{p.forEach((E,I)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,n,m,E);S&&(S.forEach(T=>C.add(T.cfId)),a.setValue(w,I,S.map(T=>T.cfId)))})}),C.forEach(m=>{const w=this._conditionalFormattingRuleModel.getRule(e,n,m);w&&(o[m]=w.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(n.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,fe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[p,C],mapFunc:m}=fe.virtualizeDiscreteRanges([n.copyRange,e]),w=fe.getRepeatRange(p,C,!0),E={};_.Range.foreach(C,(l,g)=>{const{row:d,col:v}=m(l,g),x=this._conditionalFormattingViewModel.getCellCfs(o,u,d,v);x&&x.forEach(M=>{if(!E[M.cfId]){const z=new _.ObjectMatrix;E[M.cfId]=z;const U=this._conditionalFormattingRuleModel.getRule(o,u,M.cfId);U==null||U.ranges.forEach(O=>{_.Range.foreach(O,(L,F)=>{z.setValue(L,F,1)})})}E[M.cfId].realDeleteValue(d,v)})});const{matrix:I,info:S}=this._copyInfo,T=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=S==null?void 0:S.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...T].find(v=>_.Tools.diffValue(v.rule,g));if(d)return i[l]=d,d;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,T.push(v),h=`${Number(h)+1}`,v}};w.forEach(l=>{I&&I.forValue((g,d,v)=>{const x=_.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:d,endColumn:d},l.startRange),{row:M,col:z}=m(x.startRow,x.startColumn);v.forEach(U=>{if(!E[U]){const O=s(U),L=new _.ObjectMatrix;E[U]=L,O.ranges.forEach(F=>{_.Range.foreach(F,(q,J)=>{L.setValue(q,J,1)})})}E[U].setValue(M,z,1)})})});const f=[],b=[];for(const l in E){const g=E[l],d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(g));if(!d.length){const v={unitId:o,subUnitId:u,cfId:l};f.push({id:c.DeleteConditionalRuleMutation.id,params:v}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(T.some(v=>v.cfId===l)){const v=s(l),x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.AddConditionalRuleMutation.id,params:x}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,x))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.SetConditionalRuleMutation.id,params:x}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,x))}}return{redos:f,undos:b}}};lt=Aa([st(0,_.Inject(fe.ISheetClipboardService)),st(1,_.Inject(c.ConditionalFormattingRuleModel)),st(2,_.Inject(_.Injector)),st(3,_.Inject(c.ConditionalFormattingViewModel)),st(4,_.Inject(_.IUniverInstanceService))],lt);var Wa=Object.getOwnPropertyDescriptor,ja=(t,e,n,r)=>{for(var a=r>1?void 0:r?Wa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},lr=(t,e)=>(n,r)=>e(n,r,t);let ct=class extends _.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===c.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Y.WorkbookEditablePermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint],worksheetTypes:[Y.WorksheetEditPermission,Y.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=ja([lr(0,_.Inject(_.LocaleService)),lr(1,_.ICommandService),lr(2,_.Inject(Y.SheetPermissionCheckController))],ct);var Ha=Object.getOwnPropertyDescriptor,Ba=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ha(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Dt=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends _.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const u=p=>{const C=[...o.ranges],m=C.map(E=>Y.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,C))return{redos:[],undos:[]};if(m.length){const E={unitId:r,subUnitId:a,rule:{...o,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:E}],S=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}else{const E={unitId:r,subUnitId:a,cfId:o.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:E}],S=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}},y=[];o.ranges.forEach(p=>{const C=this._refRangeService.registerRefRange(p,u);y.push(()=>C.dispose())}),t.set(e(r,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:a,subUnitId:o,rule:u}=r,y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(r.unitId!==y.getUnitId()||r.subUnitId!==(p==null?void 0:p.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const C=t.get(e(a,o,u.cfId));C&&C();break}case"set":{const C=t.get(e(a,o,u.cfId));C&&C(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(_.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};ut=Ba([Dt(0,_.Inject(c.ConditionalFormattingRuleModel)),Dt(1,_.Inject(_.IUniverInstanceService)),Dt(2,_.Inject(_.Injector)),Dt(3,_.Inject(Y.RefRangeService))],ut);var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,n,r)=>{for(var a=r>1?void 0:r?Fa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(n,r)=>e(n,r,t);let dt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var n,r,a;const e=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.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 n=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:_.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const a=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!a)return r(e);const o=n.workbook.getStyles(),y={...(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:y};return a.style&&Object.assign(y,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),r(p)},priority:10}))}};dt=Ga([He(0,_.Inject(Y.SheetInterceptorService)),He(1,_.Inject(c.ConditionalFormattingService)),He(2,_.Inject(_.IUniverInstanceService)),He(3,_.Inject(hr.IRenderManagerService)),He(4,_.Inject(c.ConditionalFormattingViewModel)),He(5,_.Inject(c.ConditionalFormattingRuleModel))],dt);const yn="sheets-conditional-formatting-ui.config",xt={};var qa=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Ya=(t,e,n)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ka=(t,e,n,r)=>{for(var a=r>1?void 0:r?Xa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},cr=(t,e)=>(n,r)=>e(n,r,t),bn=(t,e,n)=>Ya(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([lt]),this._injector.add([ct]),this._injector.add([Ae])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=Ka([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),cr(1,_.Inject(_.Injector)),cr(2,_.Inject(_.ICommandService)),cr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var Za=Object.getOwnPropertyDescriptor,$a=(t,e,n,r)=>{for(var a=r>1?void 0:r?Za(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ft=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends _.Disposable{constructor(t,e,n,r,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,y,p)=>{var I;const C=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!C||!m)return;const w={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};_.Range.foreach(u,(S,T)=>{const h=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},w),i=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},E),{row:s,col:f}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(C,m,s,f),{row:l,col:g}=p(i.startRow,i.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(C,m,l,g);d&&d.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.realDeleteValue(l,g)}),b&&b.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.setValue(l,g,1)})})},n=(a,o)=>{var i,s,f;const u=(i=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,C=[],m=[];if(!u||!y)return t();const w=fe.virtualizeDiscreteRanges([a,o]),[E,I]=w.ranges,{mapFunc:S}=w,T={row:E.startRow,col:E.startColumn};return fe.getAutoFillRepeatRange(E,I).forEach(b=>{e(T,b.repeatStartCell,b.relativeRange,p,S)}),p.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(b));if(d.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:d}};C.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};C.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:C}},r={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===fe.APPLY_TYPE.COPY||u===fe.APPLY_TYPE.ONLY_FORMAT||u===fe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return n(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};Mt=$a([ft(0,_.Inject(_.Injector)),ft(1,_.Inject(_.IUniverInstanceService)),ft(2,_.Inject(fe.IAutoFillService)),ft(3,_.Inject(c.ConditionalFormattingRuleModel)),ft(4,_.Inject(c.ConditionalFormattingViewModel))],Mt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ja(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},pt=(t,e)=>(n,r)=>e(n,r,t);$.ConditionalFormattingClearController=class extends _.Disposable{constructor(e,n,r,a,o){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const n=[],r=[],a={redos:n,undos:r};if([Y.ClearSelectionFormatCommand.id,Y.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(S=>S.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const C=y.getUnitId(),m=p.getSheetId(),w=this._conditionalFormattingRuleModel.getSubunitRules(C,m);if(!w||!w.length)return a;const{redos:E,undos:I}=Sn(this._injector,w,u,C,m);n.push(...E),r.push(...I)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const a=[],o=[],u={redos:a,undos:o};if(!r||!r.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!y||!y.length)return u;const{redos:p,undos:C}=Sn(this._injector,y,r,e,n);return a.push(...p),o.push(...C),u}}))}},$.ConditionalFormattingClearController=Qa([pt(0,_.Inject(_.Injector)),pt(1,_.Inject(_.IUniverInstanceService)),pt(2,_.Inject(Y.SheetInterceptorService)),pt(3,_.Inject(Y.SheetsSelectionsService)),pt(4,_.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Sn(t,e,n,r,a){const o=[],u=[];return e.filter(y=>n.some(p=>y.ranges.some(C=>_.Rectangle.getIntersects(C,p)))).forEach(y=>{const C=new Y.RangeMergeUtil().add(...y.ranges).subtract(...n).merge();if(C.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,rule:{...y,ranges:C}}},w=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,cfId:y.cfId}},w=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}}),{redos:o,undos:u}}var eo=Object.getOwnPropertyDescriptor,to=(t,e,n,r)=>{for(var a=r>1?void 0:r?eo(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Cn=(t,e)=>(n,r)=>e(n,r,t);let Nt=class extends _.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(_.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(Y.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var u,y,p;t||n(t);const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=r==null?void 0:r.style)!=null?u:{},o=Object.keys(a);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(C=>{C.ts&&o.forEach(m=>{var w;(w=C.ts)==null||delete w[m]})}),n(t);{const C={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(w=>{delete C[w]});const m={...t,s:{...C}};return n(m)}}})))}};Nt=to([Cn(0,_.Inject(Y.SheetInterceptorService)),Cn(1,_.Inject(c.ConditionalFormattingService))],Nt);const Tn=[Y.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ht=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:me.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:me.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:me.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:me.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:me.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:me.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:me.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:me.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:me.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:me.clearWorkSheetRules}],ro=t=>{const e=t.get(Y.SheetsSelectionsService),n=t.get(_.ICommandService),r=t.get(_.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var T;const C=((T=e.getCurrentSelections())==null?void 0:T.map(h=>h.range))||[],m=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!m)return;const w=m.getActiveSheet();if(!w)return;const S=(a.getSubunitRules(m.getUnitId(),w.getSheetId())||[]).filter(h=>h.ranges.some(i=>C.some(s=>_.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>Y.checkRangesEditablePermission(t,m.getUnitId(),w.getSheetId(),h));p.next(S)})),u=new Ce.Observable(p=>new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const C=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!C)return;const m=C.getActiveSheet();if(!m)return;const w=a.getSubunitRules(C.getUnitId(),m.getSheetId())||[];if(!w.length)return p.next(!1),!1;const E=w.map(I=>I.ranges).every(I=>Y.checkRangesEditablePermission(t,C.getUnitId(),m.getSheetId(),I));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(C=>{const m=ht.find(w=>w.value===me.clearRangeRules);m&&(m.disabled=!C,p.next(ht))}),u.subscribe(C=>{const m=ht.find(w=>w.value===me.clearWorkSheetRules);m&&(m.disabled=!C,p.next(ht))}),p.next(ht)});return{id:it.id,type:te.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:te.getMenuHiddenObservable(t,_.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(t,{workbookTypes:[Y.WorkbookEditablePermission],worksheetTypes:[Y.WorksheetSetCellStylePermission,Y.WorksheetEditPermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint]})}},no={[te.RibbonStartGroup.FORMULAS_INSERT]:{[it.id]:{order:0,menuItemFactory:ro}}};var ao=Object.getOwnPropertyDescriptor,oo=(t,e,n,r)=>{for(var a=r>1?void 0:r?ao(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},wn=(t,e)=>(n,r)=>e(n,r,t);let Lt=class extends _.Disposable{constructor(e,n){super();De(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(no)}};Lt=oo([wn(0,_.Inject(_.Injector)),wn(1,te.IMenuManagerService)],Lt);var io=Object.getOwnPropertyDescriptor,so=(t,e,n,r)=>{for(var a=r>1?void 0:r?io(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(n,r)=>e(n,r,t);const lo=(t,e)=>{const n=m=>m.endRow-m.startRow+1,r=m=>m.endColumn-m.startColumn+1,a=n(e)%n(t),o=r(e)%r(t),u=Math.floor(n(e)/n(t)),y=Math.floor(r(e)/r(t)),p=[],C={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:C,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let w=0;w<y+(o?.1:0);w++){const E=n(t)*m,I=r(t)*w,S={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let T=C;m===u&&a&&(T={...T},T.endRow=T.endRow-(n(t)-a)),w===y&&o&&(T={...T},T.endColumn=T.endColumn-(r(t)-o)),p.push({repeatRelativeRange:T,startRange:S})}return p};let Vt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(o,u,y,p,C)=>{const{unitId:m,subUnitId:w}=this._painterConfig,{targetUnitId:E,targetSubUnitId:I}=C,S={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},T={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};_.Range.foreach(y,(h,i)=>{const s=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},S),f=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},T),b=this._conditionalFormattingViewModel.getCellCfs(m,w,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,I,f.startRow,f.startColumn);l&&l.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,I,g.cfId);if(!v)return;d=new _.ObjectMatrix,v.ranges.forEach(x=>{_.Range.foreach(x,(M,z)=>{d.setValue(M,z,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),b&&b.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},r=(o,u,y)=>{var s;const{range:p,unitId:C,subUnitId:m}=this._painterConfig,w=o!==C||m!==u,E=new Map,I=[],S=[];if(!o||!u||!C||!m)return e();const T=(s=this._conditionalFormattingRuleModel.getSubunitRules(C,m))!=null?s:[];T==null||T.forEach(f=>{const{ranges:b,cfId:l}=f;if(b.some(g=>_.Rectangle.intersects(p,g))){const g=new _.ObjectMatrix;w||b.forEach(d=>{_.Range.foreach(d,(v,x)=>{g.setValue(v,x,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return lo(p,y).forEach(f=>{n(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((f,b)=>{if(w){const l=this._conditionalFormattingRuleModel.getRule(o,u,b),g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(l)if(g.length){const d={unitId:o,subUnitId:u,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:o,subUnitId:u,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(C,m,b);if(d){const v={unitId:o,subUnitId:u,rule:{..._.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:v}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(C,m,b);if(!l)return;const g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:C,subUnitId:m,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:C,subUnitId:m,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:S,redos:I}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const C=(u=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),w=this._sheetsSelectionsService.getCurrentLastSelection(),E=w==null?void 0:w.range;C&&m&&E&&(this._painterConfig={unitId:C,subUnitId:m,range:E});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?r(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Vt=so([Be(0,_.Inject(_.Injector)),Be(1,_.Inject(_.IUniverInstanceService)),Be(2,_.Inject(fe.IFormatPainterService)),Be(3,_.Inject(Y.SheetsSelectionsService)),Be(4,_.Inject(c.ConditionalFormattingRuleModel)),Be(5,_.Inject(c.ConditionalFormattingViewModel))],Vt);var co=Object.getOwnPropertyDescriptor,uo=(t,e,n,r)=>{for(var a=r>1?void 0:r?co(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ur=(t,e)=>(n,r)=>e(n,r,t);let Ut=class extends _.Disposable{constructor(t,e,n){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),e=n=>{const r=n.getUnitId(),a=this._renderManagerService.getRenderById(r);if(!a)return;const o=a.with(fe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,w=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(w)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{n&&e(n)})}};Ut=uo([ur(0,_.Inject(c.ConditionalFormattingViewModel)),ur(1,_.IUniverInstanceService),ur(2,hr.IRenderManagerService)],Ut);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,go=(t,e,n,r)=>{for(var a=r>1?void 0:r?po(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},dr=(t,e)=>(n,r)=>e(n,r,t),In=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand()}onStarting(){_.registerDependencies(this._injector,[[dt],[ut],[lt],[Mt],[ct],[ot],[Lt],[Ae],[Nt],[$.ConditionalFormattingClearController],[Vt],[Ut]]),_.touchDependencies(this._injector,[[dt]])}onReady(){_.touchDependencies(this._injector,[[Lt],[ot]])}onRendered(){_.touchDependencies(this._injector,[[Mt],[$.ConditionalFormattingClearController],[lt],[Nt],[Ae],[Vt],[ct],[ut],[Ut]])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},In($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),In($.UniverSheetsConditionalFormattingUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=go([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),dr(1,_.Inject(_.Injector)),dr(2,_.Inject(_.ICommandService)),dr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=At,$.AddColorScaleConditionalRuleCommand=Wt,$.AddDataBarConditionalRuleCommand=jt,$.AddDuplicateValuesCfCommand=Ht,$.AddNumberCfCommand=Bt,$.AddRankCfCommand=Ft,$.AddTextCfCommand=Gt,$.AddTimePeriodCfCommand=qt,$.AddUniqueValuesCfCommand=Xt,$.OpenConditionalFormattingOperator=it,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
183
180
|
|
|
184
181
|
|
|
185
182
|
// index
|