@univerjs/preset-sheets-conditional-formatting 0.5.0 → 0.5.1-nightly.202412271606
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/cjs/index.js +1 -1
- package/lib/cjs/locales/fr-FR.js +1 -0
- package/lib/es/index.js +10 -7
- package/lib/es/locales/fr-FR.js +9 -0
- package/lib/index.css +1 -1
- package/lib/types/index.d.ts +3 -3
- package/lib/types/locales/fr-FR.d.ts +2 -0
- package/lib/types/umd.d.ts +4 -0
- package/lib/umd/index.js +183 -6
- package/lib/umd/locales/fr-FR.js +6 -0
- package/package.json +10 -7
package/lib/umd/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
// @univerjs/sheets-conditional-formatting/index
|
|
2
|
-
(function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("rxjs"),require("rxjs/operators"),require("@univerjs/sheets"),require("@univerjs/engine-render"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs","rxjs/operators","@univerjs/sheets","@univerjs/engine-render","@univerjs/engine-formula"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.rxjs,C.rxjs.operators,C.UniverSheets,C.UniverEngineRender,C.UniverEngineFormula))})(this,function(C,u,T,Z,L,G,U){"use strict";var m0=Object.defineProperty;var F0=(C,u,T)=>u in C?m0(C,u,{enumerable:!0,configurable:!0,writable:!0,value:T}):C[u]=T;var p=(C,u,T)=>F0(C,typeof u!="symbol"?u+"":u,T);var a2;const r2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var I=(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))(I||{}),S=(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))(S||{}),A=(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))(A||{}),R=(a=>(a.highlightCell="highlightCell",a.dataBar="dataBar",a.colorScale="colorScale",a.iconSet="iconSet",a))(R||{}),y=(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))(y||{}),B=(a=>(a.num="num",a.min="min",a.max="max",a.percent="percent",a.percentile="percentile",a.formula="formula",a))(B||{});const B2="#fff",T2="#000000",k2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),U2=(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""},V2=(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""},C2=()=>`${u.Tools.generateRandomId(8)}`,V=(a,r,t)=>{if(!r)return null;const i=r.findIndex(e=>t(e)===a.id);if(i<0)return null;switch(a.type){case"after":return i+1;case"before":return i-1;case"self":return i}},D2=(a,r,t,i)=>{if(!t)return null;const e=V(a,t,i);let n=V(r,t,i);if(e===null||n===null||e===n)return;const s=t.splice(e,1)[0];switch(e<n&&(n=V(r,t,i)),r.type){case"before":{t.splice(n+1,0,s);break}case"self":case"after":{t.splice(n,0,s);break}}},f2=(a,r,t,i)=>{if(a.type==="after"&&["after","before"].includes(r.type))return[a,r];const e={...a},n={...r};if(e.type!=="after"){const s=V(e,t,i);if(s===null)return null;if(s-1<0){const l=t[s+1];if(l)e.id=i(l),e.type="before";else return null}else{const l=i(t[s-1]);e.id=l,e.type="after"}}if(!["after","before"].includes(n.type)){const s=V(n,t,i);if(s===null)return null;if(s===0)n.type="before";else if(s-1>=0){const l=i(t[s-1]);n.id=l,n.type="after"}else if(s+1<=t.length-1){const l=i(t[s+1]);n.id=l,n.type="before"}else return null}return e.id===n.id&&e.type===n.type?null:[e,n]},m2=(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},O2=(a,r)=>a.id===r.id&&a.type===r.type;var N2=Object.defineProperty,j2=Object.getOwnPropertyDescriptor,P2=(a,r,t,i)=>{for(var e=i>1?void 0:i?j2(r,t):r,n=a.length-1,s;n>=0;n--)(s=a[n])&&(e=(i?s(r,t,e):s(e))||e);return i&&e&&N2(r,t,e),e},$2=(a,r)=>(t,i)=>r(t,i,a);C.ConditionalFormattingRuleModel=class{constructor(r){p(this,"_model",new Map);p(this,"_ruleChange$",new T.Subject);p(this,"$ruleChange",this._ruleChange$.asObservable().pipe(Z.bufferTime(16),Z.filter(r=>!!r.length),r=>new T.Observable(t=>{r.subscribe({next:i=>{const e=o=>`${o.unitId}_${o.subUnitId}_${o.rule.cfId}`,n=o=>{const d=o.findIndex(h=>h.type==="add"),c=o.findIndex(h=>h.type==="delete");d!==-1&&c!==-1&&c>d&&o.splice(d,c-d+1)},s=i.reduce((o,d,c)=>{const h=e(d);return o[h]||(o[h]=[]),o[h].push({...d,_index:c}),o},{});for(const o in s){const d=s[o];d.length>=2&&n(d)}Object.keys(s).reduce((o,d)=>{const c=s[d];return o.push(...c),o},[]).sort((o,d)=>o._index-d._index).map(o=>o).forEach(o=>{t.next(o)})},error:i=>t.error(i),complete:()=>t.complete()})})));this._injector=r}_ensureList(r,t){let i=this.getSubunitRules(r,t);if(!i){i=[];let e=this._model.get(r);e||(e=new Map,this._model.set(r,e)),e.set(t,i)}return i}getRule(r,t,i){const e=this.getSubunitRules(r,t);return e?e.find(n=>n.cfId===i):null}getUnitRules(r){return this._model.get(r)||null}getSubunitRules(r,t){var e;return((e=this._model.get(r))==null?void 0:e.get(t))||null}deleteRule(r,t,i){const e=this.getSubunitRules(r,t);if(e){const n=e.findIndex(l=>l.cfId===i),s=e[n];s&&(e.splice(n,1),this._ruleChange$.next({rule:s,subUnitId:t,unitId:r,type:"delete"}))}}setRule(r,t,i,e){const s=this._ensureList(r,t).find(l=>l.cfId===e);if(s){const l=u.Tools.deepClone(s);Object.assign(s,i),this._ruleChange$.next({rule:s,subUnitId:t,unitId:r,type:"set",oldRule:l})}}addRule(r,t,i){const e=this._ensureList(r,t);e.find(s=>s.cfId===i.cfId)||e.unshift(i),this._ruleChange$.next({rule:i,subUnitId:t,unitId:r,type:"add"})}moveRulePriority(r,t,i,e){const n=this._ensureList(r,t),s=V(i,n,d=>d.cfId),l=V(e,n,d=>d.cfId);if(l===null||s===null||l===s)return;const o=n[s];o&&(D2(i,e,n,d=>d.cfId),this._ruleChange$.next({rule:o,subUnitId:t,unitId:r,type:"sort"}))}createCfId(r,t){return C2()}deleteUnitId(r){this._model.delete(r)}},C.ConditionalFormattingRuleModel=P2([$2(0,u.Inject(u.Injector))],C.ConditionalFormattingRuleModel);class X{constructor(){p(this,"_model",new Map);p(this,"_markDirty$",new T.Subject);p(this,"markDirty$",this._markDirty$.asObservable())}_ensureMatrix(r,t){let i=this.getMatrix(r,t);if(!i){i=new u.ObjectMatrix;let e=this._model.get(r);e||(e=new Map,this._model.set(r,e)),e.set(t,i)}return i}getMatrix(r,t){var i;return(i=this._model.get(r))==null?void 0:i.get(t)}getCellCf(r,t,i,e,n){const s=n!=null?n:this.getMatrix(r,t);return s?s.getValue(i,e):null}setCellCfRuleCache(r,t,i,e,n,s){const o=this._ensureMatrix(r,t).getValue(i,e),d=o==null?void 0:o.cfList.find(c=>c.cfId===n);d&&(d.ruleCache=s,d.isDirty=!1)}deleteCellCf(r,t,i,e,n,s){const l=s!=null?s:this.getMatrix(r,t);if(l){const o=l.getValue(i,e);if(o){const d=o.cfList,c=d.findIndex(h=>h.cfId===n);c>-1&&d.splice(c,1),d.length||l.realDeleteValue(i,e)}}}pushCellCf(r,t,i,e,n){const s=this._ensureMatrix(r,t);let l=s.getValue(i,e);if(!l)l={cfList:[{cfId:n,isDirty:!0}]};else{const o=l.cfList;if(o.findIndex(c=>c.cfId===n)>-1)return;o.push({cfId:n,isDirty:!0})}s.setValue(i,e,l)}sortCellCf(r,t,i,e,n){const s=this.getCellCf(r,t,i,e);if(s){const l=s.cfList.map(o=>{const d=n.get(o.cfId);return d===void 0?null:{...o,priority:d}}).filter(o=>!!o).sort((o,d)=>o.priority-d.priority);s.cfList=l}}markRuleDirty(r,t,i,e,n){const s=(l,o)=>{const d=this.getCellCf(r,t,l,o);if(d){const c=d.cfList.find(h=>h.cfId===i.cfId);c&&(c.isDirty=!0)}};e!==void 0&&n!==void 0?(s(e,n),this._markDirty$.next({rule:i,unitId:r,subUnitId:t})):(i.ranges.forEach(l=>{u.Range.foreach(l,(o,d)=>{s(o,d)})}),this._markDirty$.next({rule:i,unitId:r,subUnitId:t}))}}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:{"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","rhomboid-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%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%23FFBD37%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"}},F2=[{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]}]}],K=F2.reduce((a,r)=>{const{group:t}=r;for(const i of t)a[i.name]=i.list;return a},{});for(const a in K){const r=K[a];Object.freeze(r)}const w2="EMPTY_ICON_TYPE",i2={type:u.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:t,subUnitId:i,start:e,end:n}=r;return a.get(C.ConditionalFormattingRuleModel).moveRulePriority(t,i,e,n),!0}},W2=a=>{const{unitId:r,subUnitId:t}=a,i=m2(a.start,a.end);if(!i)return[];const[e,n]=i;return[{id:i2.id,params:{unitId:r,subUnitId:t,start:e,end:n}}]},v2=(a,r)=>{const t=a.get(C.ConditionalFormattingRuleModel),{unitId:i,subUnitId:e,cfId:n}=r,s=[...t.getSubunitRules(i,e)||[]],l=s.findIndex(d=>d.cfId===n),o=s[l-1];if(l>-1){const d=s[l],c=[{id:l2.id,params:{unitId:i,subUnitId:e,rule:u.Tools.deepClone(d)}}];if(s.splice(l,1),l!==0){const h=s[0];if(h){const f=f2({id:h.cfId,type:"before"},{id:o.cfId,type:"after"},s,w=>w.cfId);if(!f)return c;const[g,m]=f,D={unitId:i,subUnitId:e,start:g,end:m};c.push({id:i2.id,params:D})}}return c}return[]},n2={type:u.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:t,subUnitId:i,cfId:e}=r;return a.get(C.ConditionalFormattingRuleModel).deleteRule(t,i,e),!0}},q2=(a,r)=>({id:n2.id,params:{unitId:r.unitId,subUnitId:r.subUnitId,cfId:r.rule.cfId}}),l2={type:u.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:t,subUnitId:i,rule:e}=r;return a.get(C.ConditionalFormattingRuleModel).addRule(t,i,e),!0}},J={type:u.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}},o2={type:u.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:t,subUnitId:i,rule:e}=r,n=r.cfId||r.rule.cfId;return a.get(C.ConditionalFormattingRuleModel).setRule(t,i,e,n),!0}},Z2=(a,r)=>{const t=a.get(C.ConditionalFormattingRuleModel),{unitId:i,subUnitId:e}=r,n=r.cfId||r.rule.cfId,s=t.getRule(i,e,n);return s?[{id:o2.id,params:{unitId:i,subUnitId:e,cfId:n,rule:u.Tools.deepClone(s)}}]:[]},G2="ssheets-conditional-formatting.config",Y2={};var H2=Object.defineProperty,X2=Object.getOwnPropertyDescriptor,K2=(a,r,t,i)=>{for(var e=i>1?void 0:i?X2(r,t):r,n=a.length-1,s;n>=0;n--)(s=a[n])&&(e=(i?s(r,t,e):s(e))||e);return i&&e&&H2(r,t,e),e},z=(a,r)=>(t,i)=>r(t,i,a),x=(a=>(a[a.NOT_REGISTER=1]="NOT_REGISTER",a[a.SUCCESS=2]="SUCCESS",a[a.WAIT=3]="WAIT",a[a.ERROR=4]="ERROR",a))(x||{});const J2=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(t,i,e,n,s){super();p(this,"_formulaMap",new Map);p(this,"_cache",new Map);this._commandService=t,this._injector=i,this._activeDirtyManagerService=e,this._conditionalFormattingViewModel=n,this._conditionalFormattingRuleModel=s,this._initFormulaCalculationResultChange(),this._initRuleChange(),this._initCache(),this.disposeWithMe(u.toDisposable(()=>{this._cache.clear(),this._formulaMap.clear()}))}_initCache(){const t=this._injector.get(C.ConditionalFormattingService);this.disposeWithMe(t.ruleComputeStatus$.subscribe(i=>{const{unitId:e,subUnitId:n,status:s,result:l,cfId:o}=i;s==="end"&&l&&this._ensureCacheMap(e,n).set(o,l)})),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(i=>{if(i.type==="delete"){const{unitId:e,subUnitId:n,rule:s}=i;this._deleteCache(e,n,s.cfId)}}))}_initRuleChange(){const t=i=>{switch(i.type){case R.colorScale:return i.config.some(e=>e.value.type===B.formula);case R.highlightCell:return i.subType===y.formula;case R.dataBar:return[i.config.max,i.config.min].some(e=>e.type===B.formula);case R.iconSet:return i.config.some(e=>e.value.type===B.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(i=>{const{unitId:e,subUnitId:n,rule:s,oldRule:l}=i;i.type==="delete"&&this._removeFormulaByCfId(e,n,s.cfId),i.type==="set"&&(t(s.rule)||l&&t(l.rule))&&this._removeFormulaByCfId(e,n,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===U.SetFormulaCalculationResultMutation.id){const i=t.params;for(const e in i.unitOtherData)for(const n in i.unitOtherData[e]){const s=new Set;for(const l in i.unitOtherData[e][n]){const o=new u.ObjectMatrix(i.unitOtherData[e][n][l]),d=this._ensureSubunitFormulaMap(e,n).getValue(l,["formulaId"]);if(!d)continue;const c=d.ranges;if(!c)continue;const h=d.result,f=c[0].startRow,g=c[0].startColumn;o.forValue((m,D,w)=>{h.setValue(f+m,g+D,J2(w))}),d.status=2,s.add(d.cfId)}for(const l of s){const o=this._conditionalFormattingRuleModel.getRule(e,n,l);o&&this._conditionalFormattingViewModel.markRuleDirty(e,n,o)}}}})),this._activeDirtyManagerService.register(J.id,{commandId:J.id,getDirtyData(t){return{dirtyUnitOtherFormulaMap:t.params}}})}_ensureSubunitFormulaMap(t,i){let e=this._formulaMap.get(t);e||(e=new Map,this._formulaMap.set(t,e));let n=e.get(i);return n||(n=new u.RefAlias([],["formulaId","id"]),e.set(i,n)),n}_ensureCacheMap(t,i){let e=this._cache.get(t);e||(e=new Map,this._cache.set(t,e));let n=e.get(i);return n||(n=new Map,e.set(i,n)),n}_deleteCache(t,i,e){const n=this._cache.get(t);if(n){const s=n.get(i);s&&(e?s.delete(e):s.clear())}}getCache(t,i,e){return this._ensureCacheMap(t,i).get(e)}getSubUnitFormulaMap(t,i){var e;return(e=this._formulaMap.get(t))==null?void 0:e.get(i)}registerFormulaWithRange(t,i,e,n,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const l=this._ensureSubunitFormulaMap(t,i);if(l.getValue(this.createCFormulaId(e,n),["id"]))return;const o=this._createFormulaId(t,i);l.addValue({formulaText:n,cfId:e,id:this.createCFormulaId(e,n),ranges:s,formulaId:o,status:3,result:new u.ObjectMatrix});const d={unitId:t,subUnitId:i,formulaMap:{[o]:{f:n,ranges:s}}};this._commandService.executeCommand(U.SetOtherFormulaMutation.id,d).then(()=>{this._commandService.executeCommand(J.id,{[t]:{[i]:{[o]:!0}}})})}_removeFormulaByCfId(t,i,e){const n=this._ensureSubunitFormulaMap(t,i);n.deleteValue(e);const s=n.getValues().filter(o=>o.cfId===e);s.forEach(o=>{n.deleteValue(o.id,["id"])});const l=s.map(o=>o.formulaId);this._commandService.executeCommand(U.RemoveOtherFormulaMutation.id,{unitId:t,subUnitId:i,formulaIdList:l})}getFormulaResult(t,i,e,n,s=0,l=0){const o=this.getSubUnitFormulaMap(t,i);if(!o)return{status:1};const d=o.getValue(this.createCFormulaId(e,n),["id"]);return d?d.status===2&&d.result?{result:d.result.getValue(s,l),status:2}:d.status===3?{status:3}:{status:4}:{status:1}}_createFormulaId(t,i){return`sheet.cf_${t}_${i}_${u.Tools.generateRandomId(8)}`}createCFormulaId(t,i){return`${t}_${i}`}},C.ConditionalFormattingFormulaService=K2([z(0,u.Inject(u.ICommandService)),z(1,u.Inject(u.Injector)),z(2,u.Inject(U.IActiveDirtyManagerService)),z(3,u.Inject(X)),z(4,u.Inject(C.ConditionalFormattingRuleModel))],C.ConditionalFormattingFormulaService);function Q(a,r){return Math.abs(a-r)<Number.EPSILON}const b=a=>[void 0,null].includes(a),k=a=>{var i,e;if(!a)return null;if(a.t===u.CellValueType.BOOLEAN)return a.v===u.BooleanNumber.TRUE?U.BooleanValue.TRUE:U.BooleanValue.FALSE;const r=a.v,t=(e=(i=a.p)==null?void 0:i.body)==null?void 0:e.dataStream.replace(/\r\n$/,"");return b(r)?b(t)?null:t:r},c2=86400;function E2(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 t=a+68569+2415019;const i=Math.floor(4*t/146097);t=t-Math.floor((146097*i+3)/4);const e=Math.floor(4e3*(t+1)/1461001);t=t-Math.floor(1461*e/4)+31;const n=Math.floor(80*t/2447),s=t-Math.floor(2447*n/80);t=Math.floor(n/11);const l=n+2-12*t;return[100*(i-49)+e+t|0,l|0,s|0]}const p2=a=>{let r=a|0;const t=c2*(a-r);let i=Math.floor(t);t-i>.9999&&(i+=1,i===c2&&(i=0,r+=1));const e=i<0?c2+i:i,[n,s,l]=E2(a,!0),o=Math.floor(e/60/60)%60,d=Math.floor(e/60)%60,c=Math.floor(e)%60;return u.dayjs(`${n}/${s}/${l} ${o}:${d}:${c}`).valueOf()},t2=(a,r,t)=>{switch(a.type){case B.max:{let i=0;return r.forValue((e,n,s)=>{s>i&&(i=s)}),{status:x.SUCCESS,result:i}}case B.min:{let i;return r.forValue((e,n,s)=>{i===void 0&&(i=s),s<i&&(i=s)}),{status:x.SUCCESS,result:i}}case B.percent:{let i,e;r.forValue((l,o,d)=>{(i===void 0||e===void 0)&&(i=d,e=d),d>i&&(i=d),d<e&&(e=d)});const n=(i||0)-(e||0),s=Math.max(Math.min(Number(a.value)||0,100),0);return{status:x.SUCCESS,result:n*(s/100)+(e||0)}}case B.percentile:{const i=r.toNativeArray().sort((d,c)=>d-c),e=Math.max(Math.min(Number(a.value)||0,100),0),n=(i.length-1)*e/100,s=Math.floor(n),l=n-s,o=i[s]+(i[Math.min(s+1,i.length-1)]-i[s])*l;return{status:x.SUCCESS,result:o}}case B.formula:{const{accessor:i,unitId:e,subUnitId:n,cfId:s}=t,l=String(a.value),o=i.get(C.ConditionalFormattingFormulaService);return o.registerFormulaWithRange(e,n,s,l),o.getFormulaResult(e,n,s,l)}case B.num:{const i=Number(a.value);return{status:x.SUCCESS,result:Number.isNaN(i)?0:i}}}},z2=(a,r,t,i)=>{const{accessor:e}=i,n=e.get(X),s=new u.ObjectMatrix;return t.ranges.forEach(l=>{u.Range.foreach(l,(o,d)=>{const c=n.getCellCf(a,r,o,d);if(c){const h=c.cfList.find(f=>f.cfId===t.cfId);h!=null&&h.ruleCache&&s.setValue(o,d,h.ruleCache)}})}),s},Y=(a,r)=>{switch(a.operator){case A.between:{if(typeof a.value!="object"||!a.value.length)return;const t=Math.min(...a.value),i=Math.max(...a.value);return r>=t&&r<=i}case A.notBetween:{if(typeof a.value!="object"||!a.value.length)return;const t=Math.min(...a.value),i=Math.max(...a.value);return!(r>=t&&r<=i)}case A.equal:{const t=a.value||0;return Q(t,r)}case A.notEqual:{const t=a.value||0;return!Q(t,r)}case A.greaterThan:{const t=a.value||0;return r>t}case A.greaterThanOrEqual:{const t=a.value||0;return r>=t}case A.lessThan:{const t=a.value||0;return r<t}case A.lessThanOrEqual:{const t=a.value||0;return r<=t}default:return!1}},A2=a=>{switch(a){case A.greaterThan:return A.lessThanOrEqual;case A.greaterThanOrEqual:return A.lessThan;case A.lessThan:return A.greaterThanOrEqual;case A.lessThanOrEqual:return A.greaterThan}return a},_2=(a,r)=>{const t=n=>n.a!==void 0?n:{...n,a:1},i=a.findIndex(n=>n.value>=r),e=i-1;if(i===0)return a[0].color.toRgbString();if(e>=0){const n=a[e],s=a[i];if(n.color.isValid&&s.color.isValid){const l=t(n.color.toRgb()),o=t(s.color.toRgb()),d=s.value-n.value,c=(r-n.value)/d,h=["r","g","b","a"].reduce((g,m)=>{const D=l[m];return g[m]=(o[m]-D)*c+D,g},{});return new u.ColorKit(h).toRgbString()}}else return a[a.length-1].color.toRgbString()},e2=(a,r,t)=>a.map(i=>{if(i.startColumn>t||i.startRow>r)return null;const e={...i};return e.endRow=Math.min(e.endRow,r),e.endColumn=Math.min(e.endColumn,t),e}).filter(i=>!!i);function Q2(a){let r=0;return new u.ObjectMatrix(a).forValue((t,i,e)=>{r=Math.max(Number.isNaN(r)?0:r,Number(e))}),r}const t0="",e0={type:R.colorScale,handle:async(a,r)=>{var h;const t=a.rule,i=r.accessor.get(C.ConditionalFormattingFormulaService),{worksheet:e}=r,n=new u.ObjectMatrix,s=e2(a.ranges,e.getMaxRows()-1,e.getMaxColumns()-1);s.forEach(f=>{u.Range.foreach(f,(g,m)=>{const D=e==null?void 0:e.getCellRaw(g,m),w=D&&D.v;if(!b(w)&&(D==null?void 0:D.t)===u.CellValueType.NUMBER){const v=Number(w);!Number.isNaN(v)&&n.setValue(g,m,v)}})});const l=new u.ObjectMatrix;s.forEach(f=>{u.Range.foreach(f,(g,m)=>{l.setValue(g,m,t0)})});const o=[...t.config].sort((f,g)=>f.index-g.index).map(f=>({value:t2(f.value,n,{...r,cfId:a.cfId}),color:new u.ColorKit(f.color)}));if(o.some(f=>G.isObject(f.value)?f.value.status!==x.SUCCESS:!1))return(h=i.getCache(r.unitId,r.subUnitId,a.cfId))!=null?h:l;const c=o.map(f=>f.color).reduce((f,g,m)=>(f.result.push({color:g,value:f.sortValue[m]}),f),{result:[],sortValue:o.map(f=>f.value.result).sort((f,g)=>f-g)}).result;return c.length<=1||n.forValue((f,g,m)=>{const D=_2(c,m);D&&l.setValue(f,g,D)}),l}},M2="sheet-conditional-rule-data-bar",u2="#ffbe38",d2="#abd91a",i0=34;class y2 extends G.SheetExtension{constructor(){super(...arguments);p(this,"_paddingRightAndLeft",2);p(this,"_paddingTopAndBottom",2);p(this,"uKey",M2);p(this,"Z_INDEX",i0);p(this,"_radius",1)}draw(t,i,e,n){const{worksheet:s}=e;if(!s)return!1;t.save(),u.Range.foreach(e.rowColumnSegment,(l,o)=>{if(!s.getRowVisible(l)||!s.getColVisible(o))return;const d=s.getCell(l,o);if(d&&d.dataBar){const{color:c,value:h,startPoint:f,isGradient:g}=d.dataBar,m=e.getCellWithCoordByIndex(l,o,!1);let{isMerged:D,isMergedMainCell:w,mergeInfo:v,startY:E,endY:_,startX:M,endX:O}=m;if(D||(w&&(E=v.startY,_=v.endY,M=v.startX,O=v.endX),!this.isRenderDiffRangesByCell(v,n)))return;const P=O-M,g2=_+G.FIX_ONE_PIXEL_BLUR_OFFSET-E,s2=P-this._paddingRightAndLeft*2,L2=g2-this._paddingTopAndBottom*2;if(h>0){const H=Math.max(s2*(1-f/100)*h/100,1),$=M+this._paddingRightAndLeft+f/100*s2,W=E+this._paddingTopAndBottom;if(g){const q=t.createLinearGradient($,W,$+H,W);q.addColorStop(0,c),q.addColorStop(1,"rgb(255 255 255)"),t.fillStyle=q,t.strokeStyle=c,t.lineWidth=1}else t.fillStyle=c;this._drawRectWithRoundedCorner(t,$,W,H,L2,!1,!0,!0,!1),g&&t.stroke()}else{const H=Math.max(s2*f/100*Math.abs(h)/100,1),$=M+this._paddingRightAndLeft+f/100*s2-H,W=E+this._paddingTopAndBottom;if(g){const q=t.createLinearGradient($,W,$+H,W);q.addColorStop(0,"rgb(255 255 255)"),q.addColorStop(1,c),t.fillStyle=q,t.strokeStyle=c,t.lineWidth=1}else t.fillStyle=c;this._drawRectWithRoundedCorner(t,$,W,H,L2,!0,!1,!1,!0),g&&t.stroke()}}}),t.restore()}_drawRectWithRoundedCorner(t,i,e,n,s,l,o,d,c){const h=this._radius;!s||!n||(t.beginPath(),t.moveTo(i+h,e),t.lineTo(i+n-h,e),o?t.arcTo(i+n,e,i+n,e+h,h):t.lineTo(i+n,e),t.lineTo(i+n,e+s-h),d?t.arcTo(i+n,e+s,i+n-h,e+s,h):t.lineTo(i+n,e+s),t.lineTo(i+h,e+s),c?t.arcTo(i,e+s,i,e+s-h,h):t.lineTo(i,e+s),t.lineTo(i,e+h),l?t.arcTo(i,e,i+h,e,h):t.lineTo(i,e),t.closePath(),t.fill())}}G.SpreadsheetExtensionRegistry.add(y2);const N={};Object.freeze(N);const n0={type:R.dataBar,handle:async(a,r)=>{const t=a.rule,i=r.accessor.get(C.ConditionalFormattingFormulaService),{worksheet:e}=r,n=new u.ObjectMatrix,s=e2(a.ranges,e.getMaxRows()-1,e.getMaxColumns()-1);s.forEach(D=>{u.Range.foreach(D,(w,v)=>{const E=e==null?void 0:e.getCellRaw(w,v),_=E&&E.v;if(!b(_)&&(E==null?void 0:E.t)===u.CellValueType.NUMBER){const M=Number(_);!Number.isNaN(M)&&n.setValue(w,v,M)}})});const l=new u.ObjectMatrix;s.forEach(D=>{u.Range.foreach(D,(w,v)=>{l.setValue(w,v,N)})});const o=t2(t.config.min,n,{...r,cfId:a.cfId}),d=t2(t.config.max,n,{...r,cfId:a.cfId});let c=0,h=0;if(o.status===x.WAIT)return i.getCache(r.unitId,r.subUnitId,a.cfId)||l;if(o.status===x.SUCCESS){const D=Number(o.result);c=Number.isNaN(D)?0:D}else return l;if(d.status===x.WAIT)return i.getCache(r.unitId,r.subUnitId,a.cfId)||l;if(d.status===x.SUCCESS){const D=Number(d.result),w=Number.isNaN(D)?0:D;h=Math.max(w,c),c=Math.min(w,c)}else return l;const f=t.config.isGradient,g=t.isShowValue,m=D=>Math.max(Math.min(100,D),0);if(!(c===h||h<c)){if(c<0&&h<=0){const D=h-c,w=100;n.forValue((v,E,_)=>{if(_>h)return;const M=m((h-_)/D*100);l.setValue(v,E,{color:t.config.nativeColor||d2,startPoint:w,value:-M,isGradient:f,isShowValue:g})})}else if(c<0&&h>0){const D=Math.abs(h)+Math.abs(c),w=Math.abs(c)/D*100;n.forValue((v,E,_)=>{if(_)if(_>0){const M=m(Math.min(_/h,1)*100);l.setValue(v,E,{color:t.config.positiveColor||u2,startPoint:w,value:M,isGradient:f,isShowValue:g})}else{const M=m(Math.min(Math.abs(_)/Math.abs(c),1)*100);l.setValue(v,E,{color:t.config.nativeColor||d2,startPoint:w,value:-M,isGradient:f,isShowValue:g})}})}else if(c>=0&&h>0){const D=h-c,w=0;n.forValue((v,E,_)=>{if(_<c)return;const M=m((1-(h-_)/D)*100);l.setValue(v,E,{color:t.config.positiveColor||u2,startPoint:w,value:M,isGradient:f,isShowValue:g})})}}return l}},a0={type:R.highlightCell,handle:async(a,r)=>{const t=a.rule,{worksheet:i,unitId:e,subUnitId:n}=r,s=e2(a.ranges,i.getMaxRows()-1,i.getMaxColumns()-1),o=(()=>{switch(t.subType){case y.average:{let h=0,f=0;return s.forEach(g=>{u.Range.foreach(g,(m,D)=>{const w=i==null?void 0:i.getCellRaw(m,D),v=k(w||void 0);w&&w.t===u.CellValueType.NUMBER&&v!==void 0&&(h+=Number(v)||0,f++)})}),{average:h/f}}case y.uniqueValues:case y.duplicateValues:{const h=new Map;return s.forEach(f=>{u.Range.foreach(f,(g,m)=>{const D=i==null?void 0:i.getCellRaw(g,m),w=k(D||void 0);if(w!==void 0){const v=h.get(w);v?h.set(w,v+1):h.set(w,1)}})}),{count:h}}case y.rank:{const h=[];s.forEach(m=>{u.Range.foreach(m,(D,w)=>{const v=i==null?void 0:i.getCellRaw(D,w),E=k(v||void 0);v&&v.t===u.CellValueType.NUMBER&&E!==void 0&&h.push(Number(E)||0)})}),h.sort((m,D)=>D-m);const f=a.rule,g=f.isPercent?Math.floor(Math.max(Math.min(f.value,100),0)/100*h.length):Math.floor(Math.max(Math.min(f.isBottom?f.value-1:f.value,h.length),0));return f.isBottom?{rank:h[h.length-g-1]}:{rank:h[Math.max(g-1,0)]}}case y.formula:{const h=t;r.accessor.get(C.ConditionalFormattingFormulaService).registerFormulaWithRange(r.unitId,r.subUnitId,a.cfId,h.value,a.ranges);break}case y.timePeriod:switch(t.operator){case S.last7Days:return{timePeriod:{start:u.dayjs().subtract(7,"day").valueOf(),end:u.dayjs().valueOf()}};case S.lastMonth:return{timePeriod:{start:u.dayjs().startOf("month").subtract(1,"month").valueOf(),end:u.dayjs().endOf("month").subtract(1,"month").valueOf()}};case S.lastWeek:return{timePeriod:{start:u.dayjs().startOf("week").subtract(1,"week").valueOf(),end:u.dayjs().endOf("week").subtract(1,"week").valueOf()}};case S.nextMonth:return{timePeriod:{start:u.dayjs().startOf("month").add(1,"month").valueOf(),end:u.dayjs().endOf("month").add(1,"month").valueOf()}};case S.nextWeek:return{timePeriod:{start:u.dayjs().startOf("week").add(1,"week").valueOf(),end:u.dayjs().endOf("week").add(1,"week").valueOf()}};case S.thisMonth:return{timePeriod:{start:u.dayjs().startOf("month").valueOf(),end:u.dayjs().endOf("month").valueOf()}};case S.thisWeek:return{timePeriod:{start:u.dayjs().startOf("week").valueOf(),end:u.dayjs().endOf("week").valueOf()}};case S.today:return{timePeriod:{start:u.dayjs().startOf("day").valueOf(),end:u.dayjs().endOf("day").valueOf()}};case S.tomorrow:return{timePeriod:{start:u.dayjs().startOf("day").add(1,"day").valueOf(),end:u.dayjs().endOf("day").add(1,"day").valueOf()}};case S.yesterday:return{timePeriod:{start:u.dayjs().startOf("day").subtract(1,"day").valueOf(),end:u.dayjs().endOf("day").subtract(1,"day").valueOf()}}}}})(),d=(h,f)=>{const g=i==null?void 0:i.getCellRaw(h,f);switch(t.subType){case y.number:{const m=g&&Number(g.v);if(b(m)||Number.isNaN(m)||(g==null?void 0:g.t)!==u.CellValueType.NUMBER)return!1;const D=t;return Y({operator:D.operator,value:D.value||0},m||0)}case y.text:{const m=t,D=k(g),w=D===null?"":String(D),v=m.value||"";switch(m.operator){case I.beginsWith:return w.startsWith(v);case I.containsBlanks:return/^\s*$/.test(w);case I.notContainsBlanks:return!/^\s*$/.test(w);case I.containsErrors:return U.ERROR_TYPE_SET.has(w);case I.notContainsErrors:return!U.ERROR_TYPE_SET.has(w);case I.containsText:return w.indexOf(v)>-1;case I.notContainsText:return w.indexOf(v)===-1;case I.endsWith:return w.endsWith(v);case I.equal:return w===v;case I.notEqual:return w!==v;default:return!1}}case y.timePeriod:{const m=k(g);if(b(m)||Number.isNaN(Number(m))||(g==null?void 0:g.t)!==u.CellValueType.NUMBER)return!1;const D=p2(Number(m)),{start:w,end:v}=o.timePeriod;return D>=w&&D<=v}case y.average:{const m=g&&g.v,D=Number(m);if(b(m)||Number.isNaN(D)||(g==null?void 0:g.t)!==u.CellValueType.NUMBER)return!1;const w=t,v=o==null?void 0:o.average;switch(w.operator){case A.greaterThan:return D>v;case A.greaterThanOrEqual:return D>=v;case A.lessThan:return D<v;case A.lessThanOrEqual:return D<=v;case A.equal:return Q(D,v);case A.notEqual:return!Q(D,v);default:return!1}}case y.rank:{const m=k(g),D=Number(m);if(b(m)||Number.isNaN(D)||(g==null?void 0:g.t)!==u.CellValueType.NUMBER)return!1;const w=o.rank;return t.isBottom?D<=w:D>=w}case y.uniqueValues:{const m=k(g);return b(m)?!1:o.count.get(m)===1}case y.duplicateValues:{const m=k(g);return b(m)?!1:o.count.get(m)!==1}case y.formula:{const m=t,w=r.accessor.get(C.ConditionalFormattingFormulaService).getFormulaResult(e,n,a.cfId,m.value,h,f);return w&&w.status===x.SUCCESS?w.result===!0:!1}}},c=new u.ObjectMatrix;if(t.subType===y.formula){const h=t,f=r.accessor.get(C.ConditionalFormattingFormulaService),g=f.getSubUnitFormulaMap(e,n),m=g==null?void 0:g.getValue(f.createCFormulaId(a.cfId,h.value),["id"]);if(!m||m.status!==x.SUCCESS)return f.getCache(e,n,a.cfId)||c}return s.forEach(h=>{u.Range.foreach(h,(f,g)=>{d(f,g)?c.setValue(f,g,t.style):c.setValue(f,g,N)})}),c}},s0={type:R.iconSet,handle:async(a,r)=>{var f;const t=a.rule,i=r.accessor.get(C.ConditionalFormattingFormulaService),{worksheet:e}=r,n=new u.ObjectMatrix,s=e2(a.ranges,e.getMaxRows()-1,e.getMaxColumns()-1);s.forEach(g=>{u.Range.foreach(g,(m,D)=>{const w=e==null?void 0:e.getCellRaw(m,D),v=w&&w.v;if(!b(v)&&(w==null?void 0:w.t)===u.CellValueType.NUMBER){const E=Number(v);!Number.isNaN(E)&&n.setValue(m,D,E)}})});const l=new u.ObjectMatrix;s.forEach(g=>{u.Range.foreach(g,(m,D)=>{l.setValue(m,D,N)})});const o=t.config.map(g=>t2(g.value,n,{...r,cfId:a.cfId}));if(o.some(g=>g.status!==x.SUCCESS))return(f=i.getCache(r.unitId,r.subUnitId,a.cfId))!=null?f:l;const c=o.map((g,m)=>({operator:t.config[m].operator,value:Number(g.result)||0})).reduce((g,m,D,w)=>{const v=t.config[D];if(!D||D===w.length-1)g.push({...m,iconId:v.iconId,iconType:v.iconType});else{const E=w[D-1];Y(E,m.value)||g.push({...m,iconId:v.iconId,iconType:v.iconType})}return g},[]),h=t.isShowValue===void 0?!0:!!t.isShowValue;return n.forValue((g,m,D)=>{for(let w=0;w<c.length;w++){const v=c[w],E={...v},_={...v},{iconId:M,iconType:O}=v;if(w===0){if(Y(v,D)){l.setValue(g,m,{iconId:M,iconType:O,isShowValue:h});return}}else if(w===c.length-1){l.setValue(g,m,{iconId:M,iconType:O,isShowValue:h});return}else{const P=c[w-1];if(_.operator=A2(P.operator),_.value=P.value,Y(E,D)&&Y(_,D)){l.setValue(g,m,{iconId:M,iconType:O,isShowValue:h});return}}}}),l}};var r0=Object.defineProperty,l0=Object.getOwnPropertyDescriptor,o0=(a,r,t,i)=>{for(var e=i>1?void 0:i?l0(r,t):r,n=a.length-1,s;n>=0;n--)(s=a[n])&&(e=(i?s(r,t,e):s(e))||e);return i&&e&&r0(r,t,e),e},j=(a,r)=>(t,i)=>r(t,i,a);const c0=u.createInterceptorKey("conditional-formatting-before-update-rule-result");C.ConditionalFormattingService=class extends u.Disposable{constructor(t,i,e,n,s,l,o){super();p(this,"_ruleCacheMap",new Map);p(this,"_calculateUnit$",new T.Subject);p(this,"_ruleComputeStatus$",new T.Subject);p(this,"ruleComputeStatus$",this._ruleComputeStatus$.asObservable());p(this,"interceptorManager",new u.InterceptorManager({beforeUpdateRuleResult:c0}));p(this,"_calculationUnitMap",new Map);this._conditionalFormattingRuleModel=t,this._injector=i,this._conditionalFormattingViewModel=e,this._univerInstanceService=n,this._resourceManagerService=s,this._sheetInterceptorService=l,this._commandService=o,this._initCellChange(),this._initCacheManager(),this._initRemoteCalculate(),this._initSnapshot(),this._initSheetChange(),this._registerCalculationUnit(n0),this._registerCalculationUnit(e0),this._registerCalculationUnit(a0),this._registerCalculationUnit(s0),this._calculateUnit$.pipe(Z.bufferTime(100),Z.filter(d=>!!d.length),Z.map(d=>{const c=f=>`${f.unitId}_${f.subUnitId}_${f.rule.cfId}`;return d.reduce((f,g)=>{const m=c(g);return f.map[m]||(f.map[m]=g,f.list.push(g)),f},{map:{},list:[]}).list})).subscribe(d=>{d.forEach(c=>{this._handleCalculateUnit(c.unitId,c.subUnitId,c.rule)})}),this.disposeWithMe(()=>{this.interceptorManager.dispose()})}composeStyle(t,i,e,n){const s=this._conditionalFormattingViewModel.getCellCf(t,i,e,n);if(s){const l=s.cfList.map(c=>this._conditionalFormattingRuleModel.getRule(t,i,c.cfId)).filter(c=>!!c).reverse(),o=l.findIndex(c=>c==null?void 0:c.stopIfTrue);return o>-1&&l.splice(o+1),l.reduce((c,h)=>{var m;const f=h.rule.type,g=s.cfList.find(D=>D.cfId===h.cfId);if(g!=null&&g.isDirty&&this._calculateUnit$.next({unitId:t,subUnitId:i,rule:h}),f===R.highlightCell)g.ruleCache&&u.Tools.deepMerge(c,{style:g.ruleCache});else if(f===R.colorScale){const D=g==null?void 0:g.ruleCache;D&&typeof D=="string"&&(c.style={...(m=c.style)!=null?m:{},bg:{rgb:D}})}else if(f===R.dataBar){const D=g==null?void 0:g.ruleCache;D&&D!==N&&(c.dataBar=D,c.isShowValue=D.isShowValue)}else if(f===R.iconSet){const D=g==null?void 0:g.ruleCache;D&&D!==N&&(c.iconSet=D,c.isShowValue=D.isShowValue)}return c},{})}return null}_initSnapshot(){const t=e=>{const n=this._conditionalFormattingRuleModel.getUnitRules(e),s={};return n?(n.forEach((l,o)=>{s[o]=l}),JSON.stringify(s)):""},i=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:r2,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>t(e),parseJson:e=>i(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e)},onLoad:(e,n)=>{Object.keys(n).forEach(s=>{[...n[s]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,s,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:t=>{if(t.id===L.RemoveSheetCommand.id){const i=t.params,e=i.unitId||u0(this._univerInstanceService),n=i.subUnitId||d0(this._univerInstanceService);if(!n)return{redos:[],undos:[]};const s=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!s)return{redos:[],undos:[]};const l=[],o=[];return s.forEach(d=>{const c={unitId:e,subUnitId:n,cfId:d.cfId};l.push({id:n2.id,params:c}),o.push(...v2(this._injector,c))}),{redos:l,undos:o}}return{redos:[],undos:[]}}}))}_registerCalculationUnit(t){this._calculationUnitMap.set(t.type,t)}_getComputedCache(t,i,e){var n,s;return(s=(n=this._ruleCacheMap.get(t))==null?void 0:n.get(i))==null?void 0:s.get(e)}_setComputedCache(t,i,e,n){let s=this._ruleCacheMap.get(t);s||(s=new Map,this._ruleCacheMap.set(t,s));let l=s.get(i);l||(l=new Map,s.set(i,l)),l.set(e,n)}_deleteComputeCache(t,i,e){const n=this._ruleCacheMap.get(t),s=n==null?void 0:n.get(i);s&&(s.delete(e),s.size||n==null||n.delete(i))}_initCacheManager(){this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.subscribe(t=>{this._deleteComputeCache(t.unitId,t.subUnitId,t.rule.cfId)})),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(Z.filter(t=>t.type!=="sort")).subscribe(t=>{const{unitId:i,subUnitId:e,rule:n}=t;this._deleteComputeCache(i,e,n.cfId)}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(t=>{const i=(e,n,s)=>{const l=new Set;return s.forEach(([o,d])=>{const c=this._conditionalFormattingViewModel.getCellCf(e,n,o,d);c==null||c.cfList.forEach(h=>l.add(h.cfId))}),[...l].map(o=>this._conditionalFormattingRuleModel.getRule(e,n,o)).filter(o=>!!o)};switch(t.id){case L.SetRangeValuesMutation.id:{const e=t.params,{subUnitId:n,unitId:s,cellValue:l}=e,o=[];new u.ObjectMatrix(l).forValue((c,h,f)=>{f&&Object.keys(f).some(m=>["p","v"].includes(m))&&o.push([c,h])}),i(s,n,o).forEach(c=>{this._conditionalFormattingViewModel.markRuleDirty(s,n,c),this._deleteComputeCache(s,n,c.cfId)});break}case L.InsertColMutation.id:case L.RemoveColMutation.id:{const{range:e,unitId:n,subUnitId:s}=t.params,l=this._conditionalFormattingRuleModel.getSubunitRules(n,s),o={...e,endColumn:Number.MAX_SAFE_INTEGER};l&&l.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,o))).forEach(c=>{this._conditionalFormattingViewModel.markRuleDirty(n,s,c),this._deleteComputeCache(n,s,c.cfId)});break}case L.RemoveRowMutation.id:case L.InsertRowMutation.id:{const{range:e,unitId:n,subUnitId:s}=t.params,l=this._conditionalFormattingRuleModel.getSubunitRules(n,s),o={...e,endRow:Number.MAX_SAFE_INTEGER};l&&l.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,o))).forEach(c=>{this._conditionalFormattingViewModel.markRuleDirty(n,s,c),this._deleteComputeCache(n,s,c.cfId)});break}case L.MoveRowsMutation.id:{const{sourceRange:e,targetRange:n,unitId:s,subUnitId:l}=t.params,o=this._conditionalFormattingRuleModel.getSubunitRules(s,l),d={startRow:Math.min(e.startRow,n.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(h=>h.ranges.some(f=>u.Rectangle.intersects(f,d))).forEach(h=>{this._conditionalFormattingViewModel.markRuleDirty(s,l,h),this._deleteComputeCache(s,l,h.cfId)});break}case L.MoveColsMutation.id:{const{sourceRange:e,targetRange:n,unitId:s,subUnitId:l}=t.params,o=this._conditionalFormattingRuleModel.getSubunitRules(s,l),d={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,n.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(h=>h.ranges.some(f=>u.Rectangle.intersects(f,d))).forEach(h=>{this._conditionalFormattingViewModel.markRuleDirty(s,l,h),this._deleteComputeCache(s,l,h.cfId)});break}case L.MoveRangeMutation.id:{const{unitId:e,to:n,from:s}=t.params,l=o=>{const d=[];new u.ObjectMatrix(o.value).forValue((h,f)=>{d.push([h,f])}),i(e,o.subUnitId,d).forEach(h=>{this._conditionalFormattingViewModel.markRuleDirty(e,o.subUnitId,h),this._deleteComputeCache(e,o.subUnitId,h.cfId)})};l(n),l(s);break}case L.ReorderRangeMutation.id:{const{range:e,unitId:n,subUnitId:s}=t.params,l=this._conditionalFormattingRuleModel.getSubunitRules(n,s);l&&l.filter(d=>d.ranges.some(c=>u.Rectangle.intersects(c,e))).forEach(d=>{this._conditionalFormattingViewModel.markRuleDirty(n,s,d),this._deleteComputeCache(n,s,d.cfId)});break}}}))}_initRemoteCalculate(){this.disposeWithMe(this._ruleComputeStatus$.subscribe(({status:t,subUnitId:i,unitId:e,cfId:n,result:s})=>{const l=this._getComputedCache(e,i,n)||{};l.status=t,this._setComputedCache(e,i,n,l),t==="end"&&s&&(this.interceptorManager.fetchThroughInterceptors(this.interceptorManager.getInterceptPoints().beforeUpdateRuleResult)({subUnitId:i,unitId:e,cfId:n},void 0),s.forValue((o,d,c)=>{this._conditionalFormattingViewModel.setCellCfRuleCache(e,i,o,d,n,c)}))}))}async _handleCalculateUnit(t,i,e){if(!this._conditionalFormattingRuleModel.getRule(t,i,e.cfId))return;const n=this._univerInstanceService.getUnit(t),s=n==null?void 0:n.getSheetBySheetId(i);let l=this._getComputedCache(t,i,e.cfId);if(l&&["computing","end"].includes(l.status))return;l||(l={status:"computing"},this._setComputedCache(t,i,e.cfId,l));const o=this._calculationUnitMap.get(e.rule.type);if(!o||!s)return;const d={unitId:t,subUnitId:i,accessor:this._injector,workbook:n,worksheet:s},c=await o.handle(e,d);this._ruleComputeStatus$.next({status:"end",unitId:t,subUnitId:i,cfId:e.cfId,result:c})}},C.ConditionalFormattingService=o0([j(0,u.Inject(C.ConditionalFormattingRuleModel)),j(1,u.Inject(u.Injector)),j(2,u.Inject(X)),j(3,u.Inject(u.IUniverInstanceService)),j(4,u.Inject(u.IResourceManagerService)),j(5,u.Inject(L.SheetInterceptorService)),j(6,u.Inject(u.ICommandService))],C.ConditionalFormattingService);const u0=a=>a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getUnitId(),d0=a=>{var r;return(r=a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:r.getSheetId()};var h0=Object.defineProperty,g0=Object.getOwnPropertyDescriptor,C0=(a,r,t,i)=>{for(var e=i>1?void 0:i?g0(r,t):r,n=a.length-1,s;n>=0;n--)(s=a[n])&&(e=(i?s(r,t,e):s(e))||e);return i&&e&&h0(r,t,e),e},h2=(a,r)=>(t,i)=>r(t,i,a);C.UniverSheetsConditionalFormattingPlugin=(a2=class extends u.Plugin{constructor(r=Y2,t,i,e){super(),this._config=r,this._injector=t,this._commandService=i,this._configService=e;const{...n}=this._config;this._configService.setConfig(G2,n),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[C.ConditionalFormattingRuleModel],[X]].forEach(s=>{this._injector.add(s)}),[l2,n2,o2,i2,J].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(C.ConditionalFormattingService)}},p(a2,"pluginName",r2),p(a2,"type",u.UniverInstanceType.UNIVER_SHEET),a2),C.UniverSheetsConditionalFormattingPlugin=C0([h2(1,u.Inject(u.Injector)),h2(2,u.Inject(u.ICommandService)),h2(3,u.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const x2="sheet-conditional-rule-icon",D0=35,R2=15,I2=2;class S2 extends G.SheetExtension{constructor(){super();p(this,"_paddingRightAndLeft",I2);p(this,"_width",R2);p(this,"_imageMap",new Map);p(this,"uKey",x2);p(this,"Z_INDEX",D0);p(this,"_radius",1);this._init()}draw(t,i,e,n){const{worksheet:s}=e;if(!s)return!1;t.save(),u.Range.foreach(e.rowColumnSegment,(l,o)=>{if(!s.getRowVisible(l)||!s.getColVisible(o))return;const d=s.getCell(l,o);if(d!=null&&d.iconSet){const{iconType:c,iconId:h}=d.iconSet;if(c===w2)return;const f=this._imageMap.get(this._createKey(c,h));if(!f)return;const g=e.getCellWithCoordByIndex(l,o,!1);let{isMerged:m,isMergedMainCell:D,mergeInfo:w,startY:v,endY:E,startX:_,endX:M}=g;if(m||(D&&(v=w.startY,E=w.endY,_=w.startX,M=w.endX),!this.isRenderDiffRangesByCell(w,n)))return;const O=M-_,P=E-v;if(this._width>P||this._width>O+this._paddingRightAndLeft*2)return;const g2=(P-this._width)/2+v;t.drawImage(f,_+this._paddingRightAndLeft,g2,this._width,this._width)}}),t.restore()}_init(){for(const t in K)K[t].forEach((e,n)=>{const s=this._createKey(t,String(n)),l=new Image;l.onload=()=>{this._imageMap.set(s,l)},l.src=e})}_createKey(t,i){return`${t}_${i}`}}G.SpreadsheetExtensionRegistry.add(S2);const f0=(a,r)=>r.length===a.length&&!a.some(t=>r.some(i=>!u.Rectangle.equals(i,t)));function b2(a){if(typeof a!="object"||a===null)return a;const r={};for(const t in a)if(a.hasOwnProperty(t)){const i=b2(a[t]);i!==void 0&&(r[t]=i)}return r}C.AddConditionalRuleMutation=l2,C.AddConditionalRuleMutationUndoFactory=q2,C.CFNumberOperator=A,C.CFRuleType=R,C.CFSubRuleType=y,C.CFTextOperator=I,C.CFTimePeriodOperator=S,C.CFValueType=B,C.ConditionalFormattingFormulaMarkDirty=J,C.ConditionalFormattingIcon=S2,C.ConditionalFormattingViewModel=X,C.DEFAULT_BG_COLOR=B2,C.DEFAULT_FONT_COLOR=T2,C.DEFAULT_PADDING=I2,C.DEFAULT_WIDTH=R2,C.DataBar=y2,C.DeleteConditionalRuleMutation=n2,C.DeleteConditionalRuleMutationUndoFactory=v2,C.EMPTY_ICON_TYPE=w2,C.EMPTY_STYLE=N,C.FormulaResultStatus=x,C.IconUKey=x2,C.MoveConditionalRuleMutation=i2,C.MoveConditionalRuleMutationUndoFactory=W2,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=r2,C.SetConditionalRuleMutation=o2,C.anchorUndoFactory=m2,C.compareWithNumber=Y,C.createCfId=C2,C.createDefaultRule=k2,C.createDefaultValue=U2,C.createDefaultValueByValueType=V2,C.dataBarUKey=M2,C.defaultDataBarNativeColor=d2,C.defaultDataBarPositiveColor=u2,C.filterRange=e2,C.findIndexByAnchor=V,C.getCacheStyleMatrix=z2,C.getCellValue=k,C.getColorScaleFromValue=_2,C.getMaxInFormulaResult=Q2,C.getOppositeOperator=A2,C.getValueByType=t2,C.iconGroup=F2,C.iconMap=K,C.isAnchorEqual=O2,C.isFloatsEqual=Q,C.isNullable=b,C.isRangesEqual=f0,C.moveByAnchor=D2,C.removeUndefinedAttr=b2,C.serialTimeToTimestamp=p2,C.setConditionalRuleMutationUndoFactory=Z2,C.toYMD_1900=E2,C.transformSupportSymmetryAnchor=f2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
(function(C,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):(C=typeof globalThis<"u"?globalThis:C||self,c(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.rxjs,C.rxjs.operators,C.UniverEngineFormula,C.UniverEngineRender,C.UniverSheets))})(this,function(C,c,L,J,U,W,S){"use strict";var M0=Object.defineProperty;var x0=(C,c,L)=>c in C?M0(C,c,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[c]=L;var v=(C,c,L)=>x0(C,typeof c!="symbol"?c+"":c,L);var r2;const u2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var M=(s=>(s.beginsWith="beginsWith",s.endsWith="endsWith",s.containsText="containsText",s.notContainsText="notContainsText",s.equal="equal",s.notEqual="notEqual",s.containsBlanks="containsBlanks",s.notContainsBlanks="notContainsBlanks",s.containsErrors="containsErrors",s.notContainsErrors="notContainsErrors",s))(M||{}),x=(s=>(s.today="today",s.yesterday="yesterday",s.tomorrow="tomorrow",s.last7Days="last7Days",s.thisMonth="thisMonth",s.lastMonth="lastMonth",s.nextMonth="nextMonth",s.thisWeek="thisWeek",s.lastWeek="lastWeek",s.nextWeek="nextWeek",s))(x||{}),w=(s=>(s.greaterThan="greaterThan",s.greaterThanOrEqual="greaterThanOrEqual",s.lessThan="lessThan",s.lessThanOrEqual="lessThanOrEqual",s.notBetween="notBetween",s.between="between",s.equal="equal",s.notEqual="notEqual",s))(w||{}),_=(s=>(s.highlightCell="highlightCell",s.dataBar="dataBar",s.colorScale="colorScale",s.iconSet="iconSet",s))(_||{}),p=(s=>(s.uniqueValues="uniqueValues",s.duplicateValues="duplicateValues",s.rank="rank",s.text="text",s.timePeriod="timePeriod",s.number="number",s.average="average",s.formula="formula",s))(p||{}),y=(s=>(s.num="num",s.min="min",s.max="max",s.percent="percent",s.percentile="percentile",s.formula="formula",s))(y||{});const O2="#fff",j2="#000000",P2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),$2=(s,a)=>{switch(s){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=(s,a)=>{switch(s){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return a!==void 0?a:10}return""},V=(s,a,n)=>{if(!a)return null;const e=a.findIndex(t=>n(t)===s.id);if(e<0)return null;switch(s.type){case"after":return e+1;case"before":return e-1;case"self":return e}},F2=(s,a,n,e)=>{if(!n)return null;const t=V(s,n,e);let i=V(a,n,e);if(t===null||i===null||t===i)return;const r=n.splice(t,1)[0];switch(t<i&&(i=V(a,n,e)),a.type){case"before":{n.splice(i+1,0,r);break}case"self":case"after":{n.splice(i,0,r);break}}},v2=(s,a,n,e)=>{if(s.type==="after"&&["after","before"].includes(a.type))return[s,a];const t={...s},i={...a};if(t.type!=="after"){const r=V(t,n,e);if(r===null)return null;if(r-1<0){const o=n[r+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[r-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const r=V(i,n,e);if(r===null)return null;if(r===0)i.type="before";else if(r-1>=0){const o=e(n[r-1]);i.id=o,i.type="after"}else if(r+1<=n.length-1){const o=e(n[r+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},w2=(s,a)=>{if(["after","before"].includes(a.type)){if(s.type==="after")return[a,s];if(s.type==="before")return[a,{...s,type:"self"}]}return null},q2=(s,a)=>s.id===a.id&&s.type===a.type,E2=()=>`${c.Tools.generateRandomId(8)}`;class b{constructor(){v(this,"_model",new Map);v(this,"_ruleChange$",new L.Subject);v(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),r=t[i];r&&(t.splice(i,1),this._ruleChange$.next({rule:r,subUnitId:n,unitId:a,type:"delete"}))}}setRule(a,n,e,t){const r=this._ensureList(a,n).find(o=>o.cfId===t);if(r){const o=c.Tools.deepClone(r);Object.assign(r,e),this._ruleChange$.next({rule:r,subUnitId:n,unitId:a,type:"set",oldRule:o})}}addRule(a,n,e){const t=this._ensureList(a,n);t.find(r=>r.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),r=V(e,i,l=>l.cfId),o=V(t,i,l=>l.cfId);if(o===null||r===null||o===r)return;const h=i[r];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.defineProperty,G2=Object.getOwnPropertyDescriptor,H2=(s,a,n,e)=>{for(var t=e>1?void 0:e?G2(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&Z2(a,n,t),t},c2=(s,a)=>(n,e)=>a(n,e,s),R=(s=>(s[s.NOT_REGISTER=1]="NOT_REGISTER",s[s.SUCCESS=2]="SUCCESS",s[s.WAIT=3]="WAIT",s[s.ERROR=4]="ERROR",s))(R||{});const X2=s=>{const a=s&&s[0]&&s[0][0];return(a==null?void 0:a.t)===c.CellValueType.BOOLEAN?a.v===c.BooleanNumber.TRUE||a.v===!0:a?a.v:!1};C.ConditionalFormattingFormulaService=class extends c.Disposable{constructor(n,e,t){super();v(this,"_formulaMap",new Map);v(this,"_result$",new L.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 _.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:r,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,r.cfId),e.type==="set"&&(n(r.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,r.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 r in e.unitOtherData[t][i]){const o=new c.ObjectMatrix(e.unitOtherData[t][i][r]),h=this._ensureSubunitFormulaMap(t,i).getValue(r,["formulaId"]);if(!h)continue;const l=h.ranges;if(!l)continue;const u=h.result,d=l[0].startRow,g=l[0].startColumn;o.forValue((F,E,A)=>{u.setValue(d+F,g+E,X2(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,r=[{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:r,formulaId:l,status:3,result:new c.ObjectMatrix});const u={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:r}}};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 r=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(U.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:r},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,r=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(r,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const r=this.getSubUnitFormulaMap(n,e);if(!r)return{status:1};const o=r.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 r=this.getSubUnitFormulaMap(n,e);if(!r)return[];if(i){const o=this.createCFormulaId(t,i);return r.deleteValue(o,["id"]),[]}else{const o=r.getValues().filter(h=>h.cfId===t);return o.forEach(h=>{r.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}`}},C.ConditionalFormattingFormulaService=H2([c2(0,c.Inject(c.ICommandService)),c2(1,c.Inject(U.IActiveDirtyManagerService)),c2(2,c.Inject(b))],C.ConditionalFormattingFormulaService);var T=(s=>(s.preComputingStart="preComputingStart",s.preComputing="preComputing",s.preComputingEnd="preComputingEnd",s.preComputingError="preComputingError",s))(T||{});class z{constructor(a){v(this,"_cache");v(this,"_preComputingStatus$",new L.BehaviorSubject("preComputingStart"));v(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(J.distinctUntilChanged()));v(this,"_preComputingCache");v(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(s,a){return Math.abs(s-a)<Number.EPSILON}const I=s=>[void 0,null].includes(s),k=s=>{var e,t;if(!s)return null;if(s.t===c.CellValueType.BOOLEAN)return s.v===c.BooleanNumber.TRUE?U.BooleanValue.TRUE:U.BooleanValue.FALSE;const a=s.v,n=(t=(e=s.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(s,a=!0){if(a&&s>=0){if(s===0)return[1900,1,0];if(s===60)return[1900,2,29];if(s<60)return[1900,s<32?1:2,(s-1)%31+1]}let n=s+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),r=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,r|0]}const A2=s=>{let a=s|0;const n=d2*(s-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,r,o]=p2(s,!0),h=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,u=Math.floor(t)%60;return c.dayjs(`${i}/${r}/${o} ${h}:${l}:${u}`).valueOf()},Y=(s,a,n)=>{switch(s.type){case y.max:{let e=0;return a.forValue((t,i,r)=>{r>e&&(e=r)}),{status:R.SUCCESS,result:e}}case y.min:{let e;return a.forValue((t,i,r)=>{e===void 0&&(e=r),r<e&&(e=r)}),{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),r=Math.max(Math.min(Number(s.value)||0,100),0);return{status:R.SUCCESS,result:i*(r/100)+(t||0)}}case y.percentile:{const e=a.toNativeArray().sort((l,u)=>l-u),t=Math.max(Math.min(Number(s.value)||0,100),0),i=(e.length-1)*t/100,r=Math.floor(i),o=i-r,h=e[r]+(e[Math.min(r+1,e.length-1)]-e[r])*o;return{status:R.SUCCESS,result:h}}case y.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:r}=n,o=String(s.value),h=e.get(C.ConditionalFormattingFormulaService);return h.registerFormulaWithRange(t,i,r,o),h.getFormulaResultWithCoords(t,i,r,o)}case y.num:{const e=Number(s.value);return{status:R.SUCCESS,result:Number.isNaN(e)?0:e}}}},Y2=(s,a,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),r=new c.ObjectMatrix;return n.ranges.forEach(o=>{c.Range.foreach(o,(h,l)=>{const u=i.getCellCfs(s,a,h,l);if(u){const d=u.find(g=>g.cfId===n.cfId);d!=null&&d.result&&r.setValue(h,l,d.result)}})}),r},q=(s,a)=>{switch(s.operator){case w.between:{if(typeof s.value!="object"||!s.value.length)return;const n=Math.min(...s.value),e=Math.max(...s.value);return a>=n&&a<=e}case w.notBetween:{if(typeof s.value!="object"||!s.value.length)return;const n=Math.min(...s.value),e=Math.max(...s.value);return!(a>=n&&a<=e)}case w.equal:{const n=s.value||0;return X(n,a)}case w.notEqual:{const n=s.value||0;return!X(n,a)}case w.greaterThan:{const n=s.value||0;return a>n}case w.greaterThanOrEqual:{const n=s.value||0;return a>=n}case w.lessThan:{const n=s.value||0;return a<n}case w.lessThanOrEqual:{const n=s.value||0;return a<=n}default:return!1}},_2=s=>{switch(s){case w.greaterThan:return w.lessThanOrEqual;case w.greaterThanOrEqual:return w.lessThan;case w.lessThan:return w.greaterThanOrEqual;case w.lessThanOrEqual:return w.greaterThan}return s},y2=(s,a)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=s.findIndex(i=>i.value>=a),t=e-1;if(e===0)return s[0].color.toRgbString();if(t>=0){const i=s[t],r=s[e];if(i.color.isValid&&r.color.isValid){const o=n(i.color.toRgb()),h=n(r.color.toRgb()),l=r.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 s[s.length-1].color.toRgbString()},Q=(s,a,n)=>s.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 K2(s){let a=0;return new c.ObjectMatrix(s).forValue((n,e,t)=>{a=Math.max(Number.isNaN(a)?0:a,Number(t))}),a}class J2 extends z{preComputing(a,n,e){const t=e.rule,i=e.worksheet,r=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,(g,f)=>{const m=e.getCellValue(g,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&r.setValue(g,f,E)}})});const h=[...t.rule.config].sort((u,d)=>u.index-d.index).map(u=>({value:Y(u.value,r,{...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,g,f)=>(d.result.push({color:g,value:d.sortValue[f]}),d),{result:[],sortValue:h.map(d=>d.value.result).sort((d,g)=>d-g)}).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 r=Number(i.v);if(!Number.isNaN(r))return y2(e,r)}}}const M2="sheet-conditional-rule-data-bar",h2="#ffbe38",g2="#abd91a",x2="#000",z2=34;class R2 extends W.SheetExtension{constructor(){super(...arguments);v(this,"_paddingRightAndLeft",2);v(this,"_paddingTopAndBottom",2);v(this,"uKey",M2);v(this,"Z_INDEX",z2);v(this,"_radius",1)}draw(n,e,t,i){const{worksheet:r}=t;if(!r)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!r.getRowVisible(o)||!r.getColVisible(h))return;const l=r.getCell(o,h);if(l&&l.dataBar){const{color:u,value:d,startPoint:g,isGradient:f}=l.dataBar,m=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:F,isMergedMainCell:E,mergeInfo:A,startY:B,endY:N,startX:O,endX:a2}=m;if(F||(E&&(B=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-B,o2=l2-this._paddingRightAndLeft*2,V2=m2-this._paddingTopAndBottom*2;if(d>0){const G=Math.max(o2*(1-g/100)*d/100,1),j=O+this._paddingRightAndLeft+g/100*o2,P=B+this._paddingTopAndBottom;if(f){const $=n.createLinearGradient(j,P,j+G,P);$.addColorStop(0,u),$.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=$,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,P,G,V2,!1,!0,!0,!1),f&&n.stroke()}else{const G=Math.max(o2*g/100*Math.abs(d)/100,1),j=O+this._paddingRightAndLeft+g/100*o2-G,P=B+this._paddingTopAndBottom;if(f){const $=n.createLinearGradient(j,P,j+G,P);$.addColorStop(0,"rgb(255 255 255)"),$.addColorStop(1,u),n.fillStyle=$,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,P,G,V2,!0,!1,!1,!0),f&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,r,o,h,l,u){const d=this._radius;!r||!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+r-d),l?n.arcTo(e+i,t+r,e+i-d,t+r,d):n.lineTo(e+i,t+r),n.lineTo(e+d,t+r),u?n.arcTo(e,t+r,e,t+r-d,d):n.lineTo(e,t+r),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=s=>Math.max(Math.min(100,s),0),Q2=(s,a,n)=>{const e=n(s,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class e0 extends z{preComputing(a,n,e){const t=e.rule,i=t.rule,r=e.worksheet,o=new c.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(f=>f.type===y.num)&&Q(t.ranges,r.getMaxRows()-1,r.getMaxColumns()-1).forEach(m=>{c.Range.foreach(m,(F,E)=>{const A=e.getCellValue(F,E),B=A&&A.v;if(!I(B)&&(A==null?void 0:A.t)===c.CellValueType.NUMBER){const N=Number(B);!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,g=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;g=Math.max(m,d),d=Math.min(m,d);let F=50;if(d<0&&g<=0)F=100;else if(d<0&&g>0){const E=Math.abs(g)+Math.abs(d);F=Math.abs(d)/E*100}else d>=0&&g>0&&(F=0);this.setPreComputingCache({min:d,max:g,startPoint:F}),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){const{min:i,max:r,startPoint:o}=e,l=t.rule.rule,u=l.isShowValue,d=l.config.isGradient,g=Q2(a,n,t.getCellValue);if(!(g===null||g<i||i===r||r<i)){if(g===0)return{color:x2,startPoint:o,value:0,isGradient:d,isShowValue:u};if(i<0&&r<=0){const f=r-i,m=e2((r-g)/f*100);return m===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-m,isGradient:d,isShowValue:u}}else if(i<0&&r>0)if(g>0){const f=e2(Math.min(g/r,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(g)/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&&r>0){const f=r-i,m=0,F=e2((1-(r-g)/f)*100);return F===0?void 0:{color:l.config.positiveColor||h2,startPoint:m,value:F,isGradient:d,isShowValue:u}}}}}class t0 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,g)=>{const f=e.getCellValue(d,g),m=k(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 g=e.getCellValue(u,d),f=k(g||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,(g,f)=>{const m=e.getCellValue(g,f),F=k(m||void 0);m&&m.t===c.CellValueType.NUMBER&&F!==void 0&&h.push(Number(F)||0)})}),h.sort((d,g)=>g-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(C.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),r=t.rule.rule;return(()=>{switch(r.subType){case p.number:{const l=i&&Number(i.v);if(I(l)||Number.isNaN(l)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER)return;const u=r;return q({operator:u.operator,value:u.value||0},l||0)}case p.text:{const l=r,u=k(i),d=u===null?"":String(u),g=l.value||"";switch(l.operator){case M.beginsWith:return d.startsWith(g);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(g)>-1;case M.notContainsText:return d.indexOf(g)===-1;case M.endsWith:return d.endsWith(g);case M.equal:return d===g;case M.notEqual:return d!==g;default:return!1}}case p.timePeriod:{const l=k(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:g}=e.value;return u>=d&&u<=g}case p.average:{const l=i&&i.v,u=Number(l);if(I(l)||Number.isNaN(u)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return!1;const d=r,g=e.value;switch(d.operator){case w.greaterThan:return u>g;case w.greaterThanOrEqual:return u>=g;case w.lessThan:return u<g;case w.lessThanOrEqual:return u<=g;case w.equal:return X(u,g);case w.notEqual:return!X(u,g);default:return!1}}case p.rank:{const l=k(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 r.isBottom?u<=d:u>=d}case p.uniqueValues:{const l=k(i);return I(l)||!e?!1:e.value.get(l)===1}case p.duplicateValues:{const l=k(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}}})()?r.style:{}}}const n0=(s,a,n)=>{const e=n(s,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class i0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.worksheet,r=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,(g,f)=>{const m=e.getCellValue(g,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&r.setValue(g,f,E)}})});const h=t.config.map(u=>Y(u.value,r,{...e,cfId:e.rule.cfId}));if(!h.some(u=>u.status!==R.SUCCESS)){const u=h.map((d,g)=>({operator:t.config[g].operator,value:Number(d.result)||0})).reduce((d,g,f,m)=>{const F=t.config[f];if(!f||f===m.length-1)d.push({...g,iconId:F.iconId,iconType:F.iconType});else{const E=m[f-1];q(E,g.value)||d.push({...g,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=n0(a,n,t.getCellValue);if(i===null)return;const r=t.rule.rule,o=r.isShowValue===void 0?!0:!!r.isShowValue;for(let h=0;h<e.length;h++){const l=e[h],u={...l},d={...l},{iconId:g,iconType:f}=l;if(h===0){if(q(l,i))return{iconId:g,iconType:f,isShowValue:o}}else{if(h===e.length-1)return{iconId:g,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:g,iconType:f,isShowValue:o}}}}}}var s0=Object.defineProperty,r0=Object.getOwnPropertyDescriptor,a0=(s,a,n,e)=>{for(var t=e>1?void 0:e?r0(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&s0(a,n,t),t},t2=(s,a)=>(n,e)=>a(n,e,s);const n2=50*20*3*3;C.ConditionalFormattingViewModel=class extends c.Disposable{constructor(n,e,t,i){super();v(this,"_calculateUnitManagers",new Map);v(this,"_rTreeManager",new c.RTree);v(this,"_cellCache",new c.LRUMap(n2));v(this,"_markDirty$",new L.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 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(r=>{const o=`${r.unitId}_${r.subUnitId}_${r.cfId}`;if(t.has(o)){if(r.isNeedResetPreComputingCache){const h=i.find(l=>l.cfId===r.cfId);h.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...r})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,r=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:r})}})());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 r=this._createCacheKey(n,e,t,i);if(this._cellCache.has(r))return this._cellCache.get(r);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(r,o),o}_getCellCfs(n,e,t,i){var d;const r=(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=r.filter(g=>h.has(g.cfId));return l.length?l.map(g=>{const f=o.get(g.cfId);return f?{cfId:g.cfId,result:f.getCell(t,i)}:null}).filter(g=>!!g).map((g,f)=>({...g,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:r,ranges:o}=i,h=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,r),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:r,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:r,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:r,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),r=i==null?void 0:i.getSheetBySheetId(e);if(!i||!r)return;const o={workbook:i,worksheet:r,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:n2,getCellValue:(h,l)=>r.getCellRaw(h,l)||{}};switch(t.rule.type){case _.colorScale:return new J2(o);case _.dataBar:return new e0(o);case _.highlightCell:return new t0(o);case _.iconSet:return new i0(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)})})}))}},C.ConditionalFormattingViewModel=a0([t2(0,c.Inject(c.Injector)),t2(1,c.Inject(b)),t2(2,c.Inject(C.ConditionalFormattingFormulaService)),t2(3,c.IUniverInstanceService)],C.ConditionalFormattingViewModel);const l0={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"},o0={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"},u0={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"},c0={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"},d0={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"},h0=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"}'),D={feedback:l0,star:o0,progress:u0,signal:c0,feeling:d0,arrow:h0,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","rhomboid-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%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%23FFBD37%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((s,a)=>{const{group:n}=a;for(const e of n)s[e.name]=e.list;return s},{});for(const s in K){const a=K[s];Object.freeze(a)}const S2="EMPTY_ICON_TYPE",i2={type:c.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=a;return s.get(b).moveRulePriority(n,e,t,i),!0}},g0=s=>{const{unitId:a,subUnitId:n}=s,e=w2(s.start,s.end);if(!e)return[];const[t,i]=e;return[{id:i2.id,params:{unitId:a,subUnitId:n,start:t,end:i}}]},b2=(s,a)=>{const n=s.get(b),{unitId:e,subUnitId:t,cfId:i}=a,r=[...n.getSubunitRules(e,t)||[]],o=r.findIndex(l=>l.cfId===i),h=r[o-1];if(o>-1){const l=r[o],u=[{id:C2.id,params:{unitId:e,subUnitId:t,rule:c.Tools.deepClone(l)}}];if(r.splice(o,1),o!==0){const d=r[0];if(d){const g=v2({id:d.cfId,type:"before"},{id:h.cfId,type:"after"},r,E=>E.cfId);if(!g)return u;const[f,m]=g,F={unitId:e,subUnitId:t,start:f,end:m};u.push({id:i2.id,params:F})}}return u}return[]},s2={type:c.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,cfId:t}=a;return s.get(b).deleteRule(n,e,t),!0}},C0=(s,a)=>({id:s2.id,params:{unitId:a.unitId,subUnitId:a.subUnitId,cfId:a.rule.cfId}}),C2={type:c.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a;return s.get(b).addRule(n,e,t),!0}},D2={type:c.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a,i=a.cfId||a.rule.cfId;return s.get(b).setRule(n,e,t,i),!0}},D0=(s,a)=>{const n=s.get(b),{unitId:e,subUnitId:t}=a,i=a.cfId||a.rule.cfId,r=n.getRule(e,t,i);return r?[{id:D2.id,params:{unitId:e,subUnitId:t,cfId:i,rule:c.Tools.deepClone(r)}}]:[]},f0="ssheets-conditional-formatting.config",L2={};var m0=Object.defineProperty,F0=Object.getOwnPropertyDescriptor,v0=(s,a,n,e)=>{for(var t=e>1?void 0:e?F0(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&m0(a,n,t),t},Z=(s,a)=>(n,e)=>a(n,e,s);C.ConditionalFormattingService=class extends c.Disposable{constructor(a,n,e,t,i,r){super(),this._conditionalFormattingRuleModel=a,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=r,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(a,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(a,n,e,t);if(i&&(i!=null&&i.length)){const r=i.map(l=>this._conditionalFormattingRuleModel.getRule(a,n,l.cfId)).filter(l=>!!l).reverse(),o=r.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&r.splice(o+1),r.reduce((l,u)=>{var f;const d=u.rule.type,g=i.find(m=>m.cfId===u.cfId);if(d===_.highlightCell)g.result&&c.Tools.deepMerge(l,{style:g.result});else if(d===_.colorScale){const m=g==null?void 0:g.result;m&&typeof m=="string"&&(l.style={...(f=l.style)!=null?f:{},bg:{rgb:m}})}else if(d===_.dataBar){const m=g==null?void 0:g.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(d===_.iconSet){const m=g==null?void 0:g.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((r,o)=>{i[o]=r}),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||w0(this._univerInstanceService),t=n.subUnitId||E0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const r=[],o=[];return i.forEach(h=>{const l={unitId:e,subUnitId:t,cfId:h.cfId};r.push({id:s2.id,params:l}),o.push(...b2(this._injector,l))}),{redos:r,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{const n=(e,t,i)=>{const r=new Set;return i.forEach(([o,h])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,h);l==null||l.forEach(u=>r.add(u.cfId))}),[...r].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:r}=e,o=[];new c.ObjectMatrix(r).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,r=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};r&&r.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,r=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};r&&r.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:r}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,r),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,r,u.cfId)});break}case S.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:r}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,r),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,r,u.cfId)});break}case S.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=a.params,r=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)})};r(t),r(i);break}case S.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,r=this._conditionalFormattingRuleModel.getSubunitRules(t,i);r&&r.filter(h=>h.ranges.some(l=>c.Rectangle.intersects(l,e))).forEach(h=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,h.cfId)});break}}}))}},C.ConditionalFormattingService=v0([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))],C.ConditionalFormattingService);const w0=s=>s.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getUnitId(),E0=s=>{var a;return(a=s.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:a.getSheetId()};var p0=Object.defineProperty,A0=Object.getOwnPropertyDescriptor,_0=(s,a,n,e)=>{for(var t=e>1?void 0:e?A0(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&p0(a,n,t),t},f2=(s,a)=>(n,e)=>a(n,e,s);C.UniverSheetsConditionalFormattingPlugin=(r2=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(f0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[b],[C.ConditionalFormattingViewModel]].forEach(r=>{this._injector.add(r)}),[C2,s2,D2,i2,H].forEach(r=>{this._commandService.registerCommand(r)})}onStarting(){this._injector.get(C.ConditionalFormattingService),c.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},v(r2,"pluginName",u2),v(r2,"type",c.UniverInstanceType.UNIVER_SHEET),r2),C.UniverSheetsConditionalFormattingPlugin=_0([f2(1,c.Inject(c.Injector)),f2(2,c.Inject(c.ICommandService)),f2(3,c.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const T2="sheet-conditional-rule-icon",y0=35,B2=15,k2=2;class N2 extends W.SheetExtension{constructor(){super();v(this,"_paddingRightAndLeft",k2);v(this,"_width",B2);v(this,"_imageMap",new Map);v(this,"uKey",T2);v(this,"Z_INDEX",y0);v(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:r}=t;if(!r)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!r.getRowVisible(o)||!r.getColVisible(h))return;const l=r.getCell(o,h);if(l!=null&&l.iconSet){const{iconType:u,iconId:d}=l.iconSet;if(u===S2)return;const g=this._imageMap.get(this._createKey(u,d));if(!g)return;const f=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:m,isMergedMainCell:F,mergeInfo:E,startY:A,endY:B,startX:N,endX:O}=f;if(m||(F&&(A=E.startY,B=E.endY,N=E.startX,O=E.endX),!this.isRenderDiffRangesByCell(E,i)))return;const a2=O-N,l2=B-A;if(this._width>l2||this._width>a2+this._paddingRightAndLeft*2)return;const m2=(l2-this._width)/2+A;n.drawImage(g,N+this._paddingRightAndLeft,m2,this._width,this._width)}}),n.restore()}_init(){for(const n in K)K[n].forEach((t,i)=>{const r=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(r,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}W.SpreadsheetExtensionRegistry.add(N2);function U2(s){if(typeof s!="object"||s===null)return s;const a={};for(const n in s)if(s.hasOwnProperty(n)){const e=U2(s[n]);e!==void 0&&(a[n]=e)}return a}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>c.isRangesEqual}),C.AddConditionalRuleMutation=C2,C.AddConditionalRuleMutationUndoFactory=C0,C.CFNumberOperator=w,C.CFRuleType=_,C.CFSubRuleType=p,C.CFTextOperator=M,C.CFTimePeriodOperator=x,C.CFValueType=y,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=n2,C.ConditionalFormattingFormulaMarkDirty=H,C.ConditionalFormattingIcon=N2,C.ConditionalFormattingRuleModel=b,C.DEFAULT_BG_COLOR=O2,C.DEFAULT_FONT_COLOR=j2,C.DEFAULT_PADDING=k2,C.DEFAULT_WIDTH=B2,C.DataBar=R2,C.DeleteConditionalRuleMutation=s2,C.DeleteConditionalRuleMutationUndoFactory=b2,C.EMPTY_ICON_TYPE=S2,C.FormulaResultStatus=R,C.IconUKey=T2,C.MoveConditionalRuleMutation=i2,C.MoveConditionalRuleMutationUndoFactory=g0,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=u2,C.SetConditionalRuleMutation=D2,C.anchorUndoFactory=w2,C.compareWithNumber=q,C.createCfId=E2,C.createDefaultRule=P2,C.createDefaultValue=$2,C.createDefaultValueByValueType=W2,C.dataBarUKey=M2,C.defaultDataBarNativeColor=g2,C.defaultDataBarPositiveColor=h2,C.defaultPlaceholderColor=x2,C.filterRange=Q,C.findIndexByAnchor=V,C.getCacheStyleMatrix=Y2,C.getCellValue=k,C.getColorScaleFromValue=y2,C.getMaxInFormulaResult=K2,C.getOppositeOperator=_2,C.getValueByType=Y,C.iconGroup=I2,C.iconMap=K,C.isAnchorEqual=q2,C.isFloatsEqual=X,C.isNullable=I,C.moveByAnchor=F2,C.removeUndefinedAttr=U2,C.serialTimeToTimestamp=A2,C.setConditionalRuleMutationUndoFactory=D0,C.toYMD_1900=p2,C.transformSupportSymmetryAnchor=v2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
|
|
3
|
+
|
|
4
|
+
|
|
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 c=Object.defineProperty;var R=(i,r,u)=>r in i?c(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((n,s)=>(n[s]||(n[s]={}),n[s]),e),e}build(){var n;this._rule.cfId||(this._rule.cfId=u.createCfId()),this._rule.ranges||(this._rule.ranges=[]),this._rule.stopIfTrue===void 0&&(this._rule.stopIfTrue=!1),(n=this._rule.rule)!=null&&n.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 l extends o{constructor(e={}){super(e),this._ensureAttr(this._rule,["rule","style"])}copy(){return new l(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 n=new r.ColorKit(e);this._ruleConfig.style.bg.rgb=n.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 n=new r.ColorKit(e);this._ensureAttr(this._ruleConfig,["style","cl"]),this._ruleConfig.style.cl.rgb=n.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 n=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=[n,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 n=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=[n,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 C extends o{copy(){return new C(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 a extends o{copy(){return new a(r.Tools.deepClone(this._rule))}setColorScale(e){const t=this._ruleConfig;return t.type=u.CFRuleType.colorScale,t.config=e,this}}class g extends o{copy(){return new g(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 T{constructor(e={}){this._initConfig=e}build(){return new o(this._initConfig).build()}setAverage(e){return new l(this._initConfig).setAverage(e)}setUniqueValues(){return new l(this._initConfig).setUniqueValues()}setDuplicateValues(){return new l(this._initConfig).setDuplicateValues()}setRank(e){return new l(this._initConfig).setRank(e)}setIconSet(e){return new g(this._initConfig).setIconSet(e)}setColorScale(e){return new a(this._initConfig).setColorScale(e)}setDataBar(e){return new C(this._initConfig).setDataBar(e)}setBackground(e){return new l(this._initConfig).setBackground(e)}setBold(e){return new l(this._initConfig).setBold(e)}setFontColor(e){return new l(this._initConfig).setFontColor(e)}setItalic(e){return new l(this._initConfig).setItalic(e)}setStrikethrough(e){return new l(this._initConfig).setStrikethrough(e)}setUnderline(e){return new l(this._initConfig).setUnderline(e)}whenCellEmpty(){return new l(this._initConfig).whenCellEmpty()}whenCellNotEmpty(){return new l(this._initConfig).whenCellNotEmpty()}whenDate(e){return new l(this._initConfig).whenDate(e)}whenFormulaSatisfied(e){return new l(this._initConfig).whenFormulaSatisfied(e)}whenNumberBetween(e,t){return new l(this._initConfig).whenNumberBetween(e,t)}whenNumberEqualTo(e){return new l(this._initConfig).whenNumberEqualTo(e)}whenNumberGreaterThan(e){return new l(this._initConfig).whenNumberGreaterThan(e)}whenNumberGreaterThanOrEqualTo(e){return new l(this._initConfig).whenNumberGreaterThanOrEqualTo(e)}whenNumberLessThan(e){return new l(this._initConfig).whenNumberLessThan(e)}whenNumberLessThanOrEqualTo(e){return new l(this._initConfig).whenNumberLessThanOrEqualTo(e)}whenNumberNotBetween(e,t){return new l(this._initConfig).whenNumberNotBetween(e,t)}whenNumberNotEqualTo(e){return new l(this._initConfig).whenNumberNotEqualTo(e)}whenTextContains(e){return new l(this._initConfig).whenTextContains(e)}whenTextDoesNotContain(e){return new l(this._initConfig).whenTextDoesNotContain(e)}whenTextEndsWith(e){return new l(this._initConfig).whenTextEndsWith(e)}whenTextEqualTo(e){return new l(this._initConfig).whenTextEqualTo(e)}whenTextStartsWith(e){return new l(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(n=>r.Rectangle.intersects(n,this._range)))}createConditionalFormattingRule(){return new T({ranges:[this._range]})}addConditionalFormattingRule(e){const t={rule:e,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.executeCommand(u.AddConditionalRuleMutation.id,t)}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.executeCommand(u.DeleteConditionalRuleMutation.id,t)}moveConditionalFormattingRule(e,t,n="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:n}};return this._commandService.executeCommand(u.MoveConditionalRuleMutation.id,s)}setConditionalFormattingRule(e,t){const n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:t,cfId:e};return this._commandService.executeCommand(u.SetConditionalRuleMutation.id,n)}}p.FRange.extend(f);class b extends p.FWorkbook{newColor(){return new r.ColorBuilder}}p.FWorkbook.extend(b);class w extends p.FWorksheet{_getConditionalFormattingRuleModel(){return this._injector.get(u.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]]}createConditionalFormattingRule(){return new T}addConditionalFormattingRule(e){const t={rule:e,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.executeCommand(u.AddConditionalRuleMutation.id,t)}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.executeCommand(u.DeleteConditionalRuleMutation.id,t)}moveConditionalFormattingRule(e,t,n="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:n}};return this._commandService.executeCommand(u.MoveConditionalRuleMutation.id,s)}setConditionalFormattingRule(e,t){const n={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:t,cfId:e};return this._commandService.executeCommand(u.SetConditionalRuleMutation.id,n)}}p.FWorksheet.extend(w),i.FConditionalFormattingBuilder=T,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
|
3
7
|
|
|
4
8
|
|
|
5
9
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
6
|
-
(function(V,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react"),require("@univerjs/design"),require("@univerjs/sheets-ui"),require("@univerjs/engine-formula"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react","@univerjs/design","@univerjs/sheets-ui","@univerjs/engine-formula","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],d):(V=typeof globalThis<"u"?globalThis:V||self,d(V.UniverSheetsConditionalFormattingUi={},V.UniverCore,V.UniverSheetsConditionalFormatting,V.UniverSheets,V.UniverUi,V.React,V.UniverDesign,V.UniverSheetsUi,V.UniverEngineFormula,V.ReactDOM,V.rxjs,V.UniverSheetsFormulaUi,V.UniverEngineRender,V.rxjs.operators))})(this,function(V,d,l,L,ge,w,$,ae,bn,Ir,Me,pt,ta,We){"use strict";var eu=Object.defineProperty;var tu=(V,d,l)=>d in V?eu(V,d,{enumerable:!0,configurable:!0,writable:!0,value:l}):V[d]=l;var Ge=(V,d,l)=>tu(V,typeof d!="symbol"?d+"":d,l);const Rn={type:d.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a}=e,i=t.get(l.ConditionalFormattingRuleModel),u=t.get(d.ICommandService),s=t.get(d.IUniverInstanceService),c=L.getSheetCommandTarget(s);if(!c)return!1;const{unitId:f,subUnitId:p}=c,h=i.createCfId(f,p),v={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:a,style:r}};return u.executeCommand(l.AddConditionalRuleMutation.id,{unitId:f,subUnitId:p,rule:v})}},Cn={type:d.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:o}=e,a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.ICommandService),u=t.get(d.IUniverInstanceService),s=L.getSheetCommandTarget(u);if(!s)return!1;const{unitId:c,subUnitId:f}=s,p=a.createCfId(c,f),h={ranges:n,cfId:p,stopIfTrue:!!o,rule:{type:l.CFRuleType.colorScale,config:r}};return i.executeCommand(l.AddConditionalRuleMutation.id,{unitId:c,subUnitId:f,rule:h})}},Tn={type:d.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:o,nativeColor:a,positiveColor:i,isGradient:u,stopIfTrue:s,isShowValue:c}=e,f=t.get(l.ConditionalFormattingRuleModel),p=t.get(d.IUniverInstanceService),h=L.getSheetCommandTarget(p);if(!h)return!1;const{unitId:v,subUnitId:b}=h,y=t.get(d.ICommandService),O=f.createCfId(v,b),C={ranges:n,cfId:O,stopIfTrue:!!s,rule:{type:l.CFRuleType.dataBar,isShowValue:c,config:{min:r,max:o,nativeColor:a,positiveColor:i,isGradient:u}}};return y.executeCommand(l.AddConditionalRuleMutation.id,{unitId:v,subUnitId:b,rule:C})}},In={type:d.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o}=e,a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.ICommandService),u=t.get(d.IUniverInstanceService),s=L.getSheetCommandTarget(u);if(!s)return!1;const{unitId:c,subUnitId:f}=s,p=a.createCfId(c,f),h={ranges:n,cfId:p,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.duplicateValues,style:r}};return i.executeCommand(l.AddConditionalRuleMutation.id,{unitId:c,subUnitId:f,rule:h})}},wn={type:d.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a,value:i}=e,u=t.get(l.ConditionalFormattingRuleModel),s=t.get(d.ICommandService),c=t.get(d.IUniverInstanceService),f=L.getSheetCommandTarget(c);if(!f)return!1;const{unitId:p,subUnitId:h}=f,v=u.createCfId(p,h);let b;if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(a)){const y=i;if(y.length!==2||!Array.isArray(y))return!1;b={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.number,operator:a,style:r,value:y}}}else{const y=i;if(typeof y!="number")return!1;b={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.number,operator:a,style:r,value:y}}}return s.executeCommand(l.AddConditionalRuleMutation.id,{unitId:p,subUnitId:h,rule:b})}},_n={type:d.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,isPercent:a,isBottom:i,value:u}=e,s=t.get(l.ConditionalFormattingRuleModel),c=t.get(d.IUniverInstanceService),f=t.get(d.ICommandService),p=L.getSheetCommandTarget(c);if(!p)return!1;const{unitId:h,subUnitId:v}=p,b=s.createCfId(h,v),y={ranges:n,cfId:b,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:a,isBottom:i,style:r,value:u}};return f.executeCommand(l.AddConditionalRuleMutation.id,{unitId:h,subUnitId:v,rule:y})}},xn={type:d.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a,value:i}=e,u=t.get(l.ConditionalFormattingRuleModel),s=t.get(d.IUniverInstanceService),c=L.getSheetCommandTarget(s);if(!c)return!1;const{unitId:f,subUnitId:p}=c,h=t.get(d.ICommandService),v=u.createCfId(f,p),b={ranges:n,cfId:v,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.text,operator:a,style:r,value:i}};return h.executeCommand(l.AddConditionalRuleMutation.id,{unitId:f,subUnitId:p,rule:b})}},En={type:d.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o,operator:a}=e,i=t.get(l.ConditionalFormattingRuleModel),u=t.get(d.IUniverInstanceService),s=t.get(d.ICommandService),c=L.getSheetCommandTarget(u);if(!c)return!1;const{unitId:f,subUnitId:p}=c,h=i.createCfId(f,p),v={ranges:n,cfId:h,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.timePeriod,operator:a,style:r}};return s.executeCommand(l.AddConditionalRuleMutation.id,{unitId:f,subUnitId:p,rule:v})}},On={type:d.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:o}=e,a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.IUniverInstanceService),u=t.get(d.ICommandService),s=L.getSheetCommandTarget(i);if(!s)return!1;const{unitId:c,subUnitId:f}=s,p=a.createCfId(c,f),h={ranges:n,cfId:p,stopIfTrue:!!o,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.uniqueValues,style:r}};return u.executeCommand(l.AddConditionalRuleMutation.id,{unitId:c,subUnitId:f,rule:h})}},Vt={type:d.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var y;if(!e)return!1;const n=t.get(l.ConditionalFormattingRuleModel),r=t.get(d.IUniverInstanceService),o=t.get(d.ICommandService),a=t.get(d.IUndoRedoService),i=t.get(L.SheetsSelectionsService),u=L.getSheetCommandTarget(r,e);if(!u)return!1;const{unitId:s,subUnitId:c}=u,f=((y=i.getCurrentSelections())==null?void 0:y.map(O=>O.range))||[],p=n.getSubunitRules(s,c);if(!(p!=null&&p.length)||!f.length)return!1;const h=[],v=[];p.forEach(O=>{const C=new d.ObjectMatrix;O.ranges.forEach(R=>{d.Range.foreach(R,(x,m)=>{C.setValue(x,m,1)})}),f.forEach(R=>{d.Range.foreach(R,(x,m)=>{C.realDeleteValue(x,m)})});const _=L.findAllRectangle(L.createTopMatrixFromMatrix(C));if(_.length){const R={...O,ranges:_},x={unitId:s,subUnitId:c,rule:R},m=l.setConditionalRuleMutationUndoFactory(t,x);h.push({id:l.SetConditionalRuleMutation.id,params:x}),v.push(...m)}else{const R={unitId:s,subUnitId:c,cfId:O.cfId},x=l.DeleteConditionalRuleMutationUndoFactory(t,R);h.push({id:l.DeleteConditionalRuleMutation.id,params:R}),v.push(...x)}});const b=d.sequenceExecute(h,o).result;return b&&a.pushUndoRedo({unitID:s,redoMutations:h,undoMutations:v}),b}},ht={type:d.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const n=t.get(l.ConditionalFormattingRuleModel),r=t.get(d.IUniverInstanceService),o=t.get(d.ICommandService),a=t.get(d.IUndoRedoService),i=L.getSheetCommandTarget(r,e);if(!i)return!1;const{unitId:u,subUnitId:s}=i,c=n.getSubunitRules(u,s);if(!(c!=null&&c.length))return!1;const f=c.map(b=>({cfId:b.cfId,unitId:u,subUnitId:s})),p=f.map(b=>({id:l.DeleteConditionalRuleMutation.id,params:b})),h=f.map(b=>l.DeleteConditionalRuleMutationUndoFactory(t,b)[0]),v=d.sequenceExecute(p,o).result;return v&&a.pushUndoRedo({unitID:u,redoMutations:p,undoMutations:h}),v}};var na=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ra(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wr(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 o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var _r={exports:{}},Ut={};/**
|
|
10
|
+
(function(Z,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],v):(Z=typeof globalThis<"u"?globalThis:Z||self,v(Z.UniverSheetsConditionalFormattingUi={},Z.UniverCore,Z.UniverSheetsConditionalFormatting,Z.UniverSheets,Z.UniverUi,Z.React,Z.UniverDesign,Z.UniverEngineFormula,Z.UniverSheetsUi,Z.ReactDOM,Z.rxjs,Z.UniverSheetsFormulaUi,Z.UniverEngineRender,Z.rxjs.operators))})(this,function(Z,v,u,X,ge,j,re,qt,de,In,Re,Ge,wn,qe){"use strict";var Ba=Object.defineProperty;var Fa=(Z,v,u)=>v in Z?Ba(Z,v,{enumerable:!0,configurable:!0,writable:!0,value:u}):Z[v]=u;var Pe=(Z,v,u)=>Fa(Z,typeof v!="symbol"?v+"":v,u);const Xt={type:v.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:a}=e,l=t.get(u.ConditionalFormattingRuleModel),y=t.get(v.ICommandService),p=t.get(v.IUniverInstanceService),R=X.getSheetCommandTarget(p);if(!R)return!1;const{unitId:m,subUnitId:C}=R,x=l.createCfId(m,C),I={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:a,style:n}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:m,subUnitId:C,rule:I})}},Xe={type:v.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(v.IUndoRedoService),o=t.get(v.ICommandService),a=t.get(u.ConditionalFormattingRuleModel),l=t.get(v.IUniverInstanceService),y=X.getSheetCommandTarget(l);if(!y)return!1;const{unitId:p,subUnitId:R}=y,m=a.createCfId(p,R),C={unitId:p,subUnitId:R,rule:{...r,cfId:r.cfId||m}},x=u.AddConditionalRuleMutationUndoFactory(t,C),I=o.syncExecuteCommand(u.AddConditionalRuleMutation.id,C);return I&&n.pushUndoRedo({unitID:p,redoMutations:[{id:u.AddConditionalRuleMutation.id,params:C}],undoMutations:[x]}),I}},Yt={type:v.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,a=t.get(u.ConditionalFormattingRuleModel),l=t.get(v.ICommandService),y=t.get(v.IUniverInstanceService),p=X.getSheetCommandTarget(y);if(!p)return!1;const{unitId:R,subUnitId:m}=p,C=a.createCfId(R,m),x={ranges:r,cfId:C,stopIfTrue:!!o,rule:{type:u.CFRuleType.colorScale,config:n}};return l.executeCommand(u.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},$t={type:v.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:a,positiveColor:l,isGradient:y,stopIfTrue:p,isShowValue:R}=e,m=t.get(u.ConditionalFormattingRuleModel),C=t.get(v.IUniverInstanceService),x=X.getSheetCommandTarget(C);if(!x)return!1;const{unitId:I,subUnitId:T}=x,w=t.get(v.ICommandService),h=m.createCfId(I,T),i={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:u.CFRuleType.dataBar,isShowValue:R,config:{min:n,max:o,nativeColor:a,positiveColor:l,isGradient:y}}};return w.executeCommand(u.AddConditionalRuleMutation.id,{unitId:I,subUnitId:T,rule:i})}},Kt={type:v.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,a=t.get(u.ConditionalFormattingRuleModel),l=t.get(v.ICommandService),y=t.get(v.IUniverInstanceService),p=X.getSheetCommandTarget(y);if(!p)return!1;const{unitId:R,subUnitId:m}=p,C=a.createCfId(R,m),x={ranges:r,cfId:C,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.duplicateValues,style:n}};return l.executeCommand(u.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},Zt={type:v.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:a,value:l}=e,y=t.get(u.ConditionalFormattingRuleModel),p=t.get(v.ICommandService),R=t.get(v.IUniverInstanceService),m=X.getSheetCommandTarget(R);if(!m)return!1;const{unitId:C,subUnitId:x}=m,I=y.createCfId(C,x);let T;if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(a)){const w=l;if(w.length!==2||!Array.isArray(w))return!1;T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:a,style:n,value:w}}}else{const w=l;if(typeof w!="number")return!1;T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:a,style:n,value:w}}}return p.executeCommand(u.AddConditionalRuleMutation.id,{unitId:C,subUnitId:x,rule:T})}},Jt={type:v.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:a,isBottom:l,value:y}=e,p=t.get(u.ConditionalFormattingRuleModel),R=t.get(v.IUniverInstanceService),m=t.get(v.ICommandService),C=X.getSheetCommandTarget(R);if(!C)return!1;const{unitId:x,subUnitId:I}=C,T=p.createCfId(x,I),w={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:a,isBottom:l,style:n,value:y}};return m.executeCommand(u.AddConditionalRuleMutation.id,{unitId:x,subUnitId:I,rule:w})}},Qt={type:v.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:a,value:l}=e,y=t.get(u.ConditionalFormattingRuleModel),p=t.get(v.IUniverInstanceService),R=X.getSheetCommandTarget(p);if(!R)return!1;const{unitId:m,subUnitId:C}=R,x=t.get(v.ICommandService),I=y.createCfId(m,C),T={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.text,operator:a,style:n,value:l}};return x.executeCommand(u.AddConditionalRuleMutation.id,{unitId:m,subUnitId:C,rule:T})}},en={type:v.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:a}=e,l=t.get(u.ConditionalFormattingRuleModel),y=t.get(v.IUniverInstanceService),p=t.get(v.ICommandService),R=X.getSheetCommandTarget(y);if(!R)return!1;const{unitId:m,subUnitId:C}=R,x=l.createCfId(m,C),I={ranges:r,cfId:x,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.timePeriod,operator:a,style:n}};return p.executeCommand(u.AddConditionalRuleMutation.id,{unitId:m,subUnitId:C,rule:I})}},tn={type:v.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,a=t.get(u.ConditionalFormattingRuleModel),l=t.get(v.IUniverInstanceService),y=t.get(v.ICommandService),p=X.getSheetCommandTarget(l);if(!p)return!1;const{unitId:R,subUnitId:m}=p,C=a.createCfId(R,m),x={ranges:r,cfId:C,stopIfTrue:!!o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:R,subUnitId:m,rule:x})}},St={type:v.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var w;if(!e)return!1;const r=t.get(u.ConditionalFormattingRuleModel),n=t.get(v.IUniverInstanceService),o=t.get(v.ICommandService),a=t.get(v.IUndoRedoService),l=t.get(X.SheetsSelectionsService),y=X.getSheetCommandTarget(n,e);if(!y)return!1;const{unitId:p,subUnitId:R}=y,m=((w=l.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],C=r.getSubunitRules(p,R);if(!(C!=null&&C.length)||!m.length)return!1;const x=[],I=[];C.forEach(h=>{const i=new v.ObjectMatrix;h.ranges.forEach(d=>{v.Range.foreach(d,(S,c)=>{i.setValue(S,c,1)})}),m.forEach(d=>{v.Range.foreach(d,(S,c)=>{i.realDeleteValue(S,c)})});const s=X.findAllRectangle(X.createTopMatrixFromMatrix(i));if(s.length){const d={...h,ranges:s},S={unitId:p,subUnitId:R,rule:d},c=u.setConditionalRuleMutationUndoFactory(t,S);x.push({id:u.SetConditionalRuleMutation.id,params:S}),I.push(...c)}else{const d={unitId:p,subUnitId:R,cfId:h.cfId},S=u.DeleteConditionalRuleMutationUndoFactory(t,d);x.push({id:u.DeleteConditionalRuleMutation.id,params:d}),I.push(...S)}});const T=v.sequenceExecute(x,o).result;return T&&a.pushUndoRedo({unitID:p,redoMutations:x,undoMutations:I}),T}},Ye={type:v.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(u.ConditionalFormattingRuleModel),n=t.get(v.IUniverInstanceService),o=t.get(v.ICommandService),a=t.get(v.IUndoRedoService),l=X.getSheetCommandTarget(n,e);if(!l)return!1;const{unitId:y,subUnitId:p}=l,R=r.getSubunitRules(y,p);if(!(R!=null&&R.length))return!1;const m=R.map(T=>({cfId:T.cfId,unitId:y,subUnitId:p})),C=m.map(T=>({id:u.DeleteConditionalRuleMutation.id,params:T})),x=m.map(T=>u.DeleteConditionalRuleMutationUndoFactory(t,T)[0]),I=v.sequenceExecute(C,o).result;return I&&a.pushUndoRedo({unitID:y,redoMutations:C,undoMutations:x}),I}},$e={type:v.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),o=t.get(v.IUniverInstanceService),a=X.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:l,subUnitId:y}=a,p={unitId:l,subUnitId:y,cfId:e.cfId},R=u.DeleteConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(u.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:[{id:u.DeleteConditionalRuleMutation.id,params:p}]}),m}},bt={type:v.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),o=t.get(v.IUniverInstanceService),a=t.get(u.ConditionalFormattingRuleModel),l=X.getSheetCommandTarget(o,e);if(!l)return!1;const{unitId:y,subUnitId:p}=l,R=u.transformSupportSymmetryAnchor(e.start,e.end,a.getSubunitRules(y,p)||[],w=>w.cfId);if(!R)return!1;const[m,C]=R,x={unitId:y,subUnitId:p,start:m,end:C},I=u.MoveConditionalRuleMutationUndoFactory(x),T=n.syncExecuteCommand(u.MoveConditionalRuleMutation.id,x);return T&&r.pushUndoRedo({unitID:y,redoMutations:[{id:u.MoveConditionalRuleMutation.id,params:x}],undoMutations:I}),T}},Rt={type:v.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),o=t.get(v.IUniverInstanceService),a=X.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:l,subUnitId:y}=a,p={unitId:l,subUnitId:y,rule:e.rule},R=u.setConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(u.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:l,undoMutations:R,redoMutations:[{id:u.SetConditionalRuleMutation.id,params:p}]}),m}};function Ar(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _n(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var nn={exports:{}},Ke={};/**
|
|
7
11
|
* @license React
|
|
8
12
|
* react-jsx-runtime.production.min.js
|
|
9
13
|
*
|
|
@@ -11,10 +15,183 @@
|
|
|
11
15
|
*
|
|
12
16
|
* This source code is licensed under the MIT license found in the
|
|
13
17
|
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/var oa=w,aa=Symbol.for("react.element"),ia=Symbol.for("react.fragment"),sa=Object.prototype.hasOwnProperty,la=oa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ua={key:!0,ref:!0,__self:!0,__source:!0};function xr(t,e,n){var r,o={},a=null,i=null;n!==void 0&&(a=""+n),e.key!==void 0&&(a=""+e.key),e.ref!==void 0&&(i=e.ref);for(r in e)sa.call(e,r)&&!ua.hasOwnProperty(r)&&(o[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)o[r]===void 0&&(o[r]=e[r]);return{$$typeof:aa,type:t,key:a,ref:i,props:o,_owner:la.current}}Ut.Fragment=ia,Ut.jsx=xr,Ut.jsxs=xr,_r.exports=Ut;var g=_r.exports;const P={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var _e=function(){return _e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_e.apply(this,arguments)},ca=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 o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n},tt=w.forwardRef(function(t,e){var n=t.icon,r=t.id,o=t.className,a=t.extend,i=ca(t,["icon","id","className","extend"]),u="univerjs-icon univerjs-icon-".concat(r," ").concat(o||"").trim(),s=w.useRef("_".concat(pa()));return Er(n,"".concat(r),{defIds:n.defIds,idSuffix:s.current},_e({ref:e,className:u},i),a)});function Er(t,e,n,r,o){return w.createElement(t.tag,_e(_e({key:e},da(t,n,o)),r),(fa(t,n).children||[]).map(function(a,i){return Er(a,"".concat(e,"-").concat(t.tag,"-").concat(i),n,void 0,o)}))}function da(t,e,n){var r=_e({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(a){var i=a[0],u=a[1];typeof u=="string"&&(r[i]=u.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function fa(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)?_e(_e({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&r&&r.indexOf(o.attrs.id)>-1?_e(_e({},o),{attrs:_e(_e({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function pa(){return Math.random().toString(36).substring(2,8)}tt.displayName="UniverIcon";var ha={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"}}]},zt=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"delete-single",ref:e,icon:ha}))});zt.displayName="DeleteSingle";var ma={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"}}]},Or=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"increase-single",ref:e,icon:ma}))});Or.displayName="IncreaseSingle";var ga={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"}}]},At=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"more-down-single",ref:e,icon:ga}))});At.displayName="MoreDownSingle";var va={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=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"sequence-single",ref:e,icon:va}))});Mr.displayName="SequenceSingle";var ya={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"}}]}]},mt=w.forwardRef(function(t,e){return w.createElement(tt,Object.assign({},t,{id:"slash-single",ref:e,icon:ya}))});mt.displayName="SlashSingle";var Pr={exports:{}},gt={},Mn={exports:{}};(function(t,e){(function(n,r){r(e)})(na,function(n){function r(N){return function(Z,J,Q,le,he,xe,ue){return N(Z,J,ue)}}function o(N){return function(Z,J,Q,le){if(!Z||!J||typeof Z!="object"||typeof J!="object")return N(Z,J,Q,le);var he=le.get(Z),xe=le.get(J);if(he&&xe)return he===J&&xe===Z;le.set(Z,J),le.set(J,Z);var ue=N(Z,J,Q,le);return le.delete(Z),le.delete(J),ue}}function a(N,k){var Z={};for(var J in N)Z[J]=N[J];for(var J in k)Z[J]=k[J];return Z}function i(N){return N.constructor===Object||N.constructor==null}function u(N){return typeof N.then=="function"}function s(N,k){return N===k||N!==N&&k!==k}var c="[object Arguments]",f="[object Boolean]",p="[object Date]",h="[object RegExp]",v="[object Map]",b="[object Number]",y="[object Object]",O="[object Set]",C="[object String]",_=Object.prototype.toString;function R(N){var k=N.areArraysEqual,Z=N.areDatesEqual,J=N.areMapsEqual,Q=N.areObjectsEqual,le=N.areRegExpsEqual,he=N.areSetsEqual,xe=N.createIsNestedEqual,ue=xe(Le);function Le(oe,ce,Ve){if(oe===ce)return!0;if(!oe||!ce||typeof oe!="object"||typeof ce!="object")return oe!==oe&&ce!==ce;if(i(oe)&&i(ce))return Q(oe,ce,ue,Ve);var Qo=Array.isArray(oe),ea=Array.isArray(ce);if(Qo||ea)return Qo===ea&&k(oe,ce,ue,Ve);var Ue=_.call(oe);return Ue!==_.call(ce)?!1:Ue===p?Z(oe,ce,ue,Ve):Ue===h?le(oe,ce,ue,Ve):Ue===v?J(oe,ce,ue,Ve):Ue===O?he(oe,ce,ue,Ve):Ue===y||Ue===c?u(oe)||u(ce)?!1:Q(oe,ce,ue,Ve):Ue===f||Ue===b||Ue===C?s(oe.valueOf(),ce.valueOf()):!1}return Le}function x(N,k,Z,J){var Q=N.length;if(k.length!==Q)return!1;for(;Q-- >0;)if(!Z(N[Q],k[Q],Q,Q,N,k,J))return!1;return!0}var m=o(x);function T(N,k){return s(N.valueOf(),k.valueOf())}function I(N,k,Z,J){var Q=N.size===k.size;if(!Q)return!1;if(!N.size)return!0;var le={},he=0;return N.forEach(function(xe,ue){if(Q){var Le=!1,oe=0;k.forEach(function(ce,Ve){!Le&&!le[oe]&&(Le=Z(ue,Ve,he,oe,N,k,J)&&Z(xe,ce,ue,Ve,N,k,J))&&(le[oe]=!0),oe++}),he++,Q=Le}}),Q}var E=o(I),D="_owner",U=Object.prototype.hasOwnProperty;function F(N,k,Z,J){var Q=Object.keys(N),le=Q.length;if(Object.keys(k).length!==le)return!1;for(var he;le-- >0;){if(he=Q[le],he===D){var xe=!!N.$$typeof,ue=!!k.$$typeof;if((xe||ue)&&xe!==ue)return!1}if(!U.call(k,he)||!Z(N[he],k[he],he,he,N,k,J))return!1}return!0}var X=o(F);function S(N,k){return N.source===k.source&&N.flags===k.flags}function M(N,k,Z,J){var Q=N.size===k.size;if(!Q)return!1;if(!N.size)return!0;var le={};return N.forEach(function(he,xe){if(Q){var ue=!1,Le=0;k.forEach(function(oe,ce){!ue&&!le[Le]&&(ue=Z(he,oe,xe,ce,N,k,J))&&(le[Le]=!0),Le++}),Q=ue}}),Q}var W=o(M),te=Object.freeze({areArraysEqual:x,areDatesEqual:T,areMapsEqual:I,areObjectsEqual:F,areRegExpsEqual:S,areSetsEqual:M,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:m,areDatesEqual:T,areMapsEqual:E,areObjectsEqual:X,areRegExpsEqual:S,areSetsEqual:W,createIsNestedEqual:r}),de=R(te);function se(N,k){return de(N,k,void 0)}var z=R(a(te,{createIsNestedEqual:function(){return s}}));function Y(N,k){return z(N,k,void 0)}var ne=R(q);function re(N,k){return ne(N,k,new WeakMap)}var pe=R(a(q,{createIsNestedEqual:function(){return s}}));function Ce(N,k){return pe(N,k,new WeakMap)}function Oe(N){return R(a(te,N(te)))}function ke(N){var k=R(a(q,N(q)));return function(Z,J,Q){return Q===void 0&&(Q=new WeakMap),k(Z,J,Q)}}n.circularDeepEqual=re,n.circularShallowEqual=Ce,n.createCustomCircularEqual=ke,n.createCustomEqual=Oe,n.deepEqual=se,n.sameValueZeroEqual=s,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(Mn,Mn.exports);var Pn=Mn.exports,Dn={exports:{}};function Dr(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Dr(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Nr(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Dr(t))&&(r&&(r+=" "),r+=e);return r}Dn.exports=Nr,Dn.exports.clsx=Nr;var Nn=Dn.exports,G={},Sa=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)};Object.defineProperty(G,"__esModule",{value:!0}),G.bottom=jn,G.childrenEqual=Ca,G.cloneLayout=Lr,G.cloneLayoutItem=$e,G.collides=kt,G.compact=Ur,G.compactItem=zr,G.compactType=Da,G.correctBounds=Ar,G.fastPositionEqual=Ta,G.fastRGLPropsEqual=void 0,G.getAllCollisions=kr,G.getFirstCollision=Xe,G.getLayoutItem=Vn,G.getStatics=Un,G.modifyLayout=Vr,G.moveElement=yt,G.moveElementAwayFromCollision=zn,G.noop=void 0,G.perc=wa,G.resizeItemInDirection=xa,G.setTopLeft=Oa,G.setTransform=Ea,G.sortLayoutItems=Bn,G.sortLayoutItemsByColRow=Gr,G.sortLayoutItemsByRowCol=Br,G.synchronizeLayoutWithChildren=Ma,G.validateLayout=Pa,G.withLayoutItem=Ra;var jr=Pn,vt=ba(w);function ba(t){return t&&t.__esModule?t:{default:t}}function jn(t){let e=0,n;for(let r=0,o=t.length;r<o;r++)n=t[r].y+t[r].h,n>e&&(e=n);return e}function Lr(t){const e=Array(t.length);for(let n=0,r=t.length;n<r;n++)e[n]=$e(t[n]);return e}function Vr(t,e){const n=Array(t.length);for(let r=0,o=t.length;r<o;r++)e.i===t[r].i?n[r]=e:n[r]=t[r];return n}function Ra(t,e,n){let r=Vn(t,e);return r?(r=n($e(r)),t=Vr(t,r),[t,r]):[t,null]}function $e(t){return{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,isBounded:t.isBounded}}function Ca(t,e){return(0,jr.deepEqual)(vt.default.Children.map(t,n=>n==null?void 0:n.key),vt.default.Children.map(e,n=>n==null?void 0:n.key))&&(0,jr.deepEqual)(vt.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]),vt.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]))}G.fastRGLPropsEqual=Sa;function Ta(t,e){return t.left===e.left&&t.top===e.top&&t.width===e.width&&t.height===e.height}function kt(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function Ur(t,e,n,r){const o=Un(t),a=Bn(t,e),i=Array(t.length);for(let u=0,s=a.length;u<s;u++){let c=$e(a[u]);c.static||(c=zr(o,c,e,n,a,r),o.push(c)),i[t.indexOf(a[u])]=c,c.moved=!1}return i}const Ia={x:"w",y:"h"};function Ln(t,e,n,r){const o=Ia[r];e[r]+=1;const a=t.map(i=>i.i).indexOf(e.i);for(let i=a+1;i<t.length;i++){const u=t[i];if(!u.static){if(u.y>e.y+e.h)break;kt(e,u)&&Ln(t,u,n+e[o],r)}}e[r]=n}function zr(t,e,n,r,o,a){const i=n==="vertical",u=n==="horizontal";if(i)for(e.y=Math.min(jn(t),e.y);e.y>0&&!Xe(t,e);)e.y--;else if(u)for(;e.x>0&&!Xe(t,e);)e.x--;let s;for(;(s=Xe(t,e))&&!(n===null&&a);)if(u?Ln(o,e,s.x+s.w,"x"):Ln(o,e,s.y+s.h,"y"),u&&e.x+e.w>r)for(e.x=r-e.w,e.y++;e.x>0&&!Xe(t,e);)e.x--;return e.y=Math.max(e.y,0),e.x=Math.max(e.x,0),e}function Ar(t,e){const n=Un(t);for(let r=0,o=t.length;r<o;r++){const a=t[r];if(a.x+a.w>e.cols&&(a.x=e.cols-a.w),a.x<0&&(a.x=0,a.w=e.cols),!a.static)n.push(a);else for(;Xe(n,a);)a.y++}return t}function Vn(t,e){for(let n=0,r=t.length;n<r;n++)if(t[n].i===e)return t[n]}function Xe(t,e){for(let n=0,r=t.length;n<r;n++)if(kt(t[n],e))return t[n]}function kr(t,e){return t.filter(n=>kt(n,e))}function Un(t){return t.filter(e=>e.static)}function yt(t,e,n,r,o,a,i,u,s){if(e.static&&e.isDraggable!==!0||e.y===r&&e.x===n)return t;`${e.i}${String(n)}${String(r)}${e.x}${e.y}`;const c=e.x,f=e.y;typeof n=="number"&&(e.x=n),typeof r=="number"&&(e.y=r),e.moved=!0;let p=Bn(t,i);(i==="vertical"&&typeof r=="number"?f>=r:i==="horizontal"&&typeof n=="number"?c>=n:!1)&&(p=p.reverse());const v=kr(p,e),b=v.length>0;if(b&&s)return Lr(t);if(b&&a)return`${e.i}`,e.x=c,e.y=f,e.moved=!1,t;for(let y=0,O=v.length;y<O;y++){const C=v[y];`${e.i}${e.x}${e.y}${C.i}${C.x}${C.y}`,!C.moved&&(C.static?t=zn(t,C,e,o,i):t=zn(t,e,C,o,i))}return t}function zn(t,e,n,r,o,a){const i=o==="horizontal",u=o==="vertical",s=e.static;if(r){r=!1;const p={x:i?Math.max(e.x-n.w,0):n.x,y:u?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},h=Xe(t,p),v=h&&h.y+h.h>e.y,b=h&&e.x+e.w>h.x;if(h){if(v&&u)return yt(t,n,void 0,e.y+1,r,s,o);if(v&&o==null)return e.y=n.y,n.y=n.y+n.h,t;if(b&&i)return yt(t,e,n.x,void 0,r,s,o)}else return`${n.i}${p.x}${p.y}`,yt(t,n,i?p.x:void 0,u?p.y:void 0,r,s,o)}const c=i?n.x+1:void 0,f=u?n.y+1:void 0;return c==null&&f==null?t:yt(t,n,i?n.x+1:void 0,u?n.y+1:void 0,r,s,o)}function wa(t){return t*100+"%"}const Wr=(t,e,n,r)=>t+n>r?e:n,Hr=(t,e,n)=>t<0?e:n,Fr=t=>Math.max(0,t),An=t=>Math.max(0,t),kn=(t,e,n)=>{let{left:r,height:o,width:a}=e;const i=t.top-(o-t.height);return{left:r,width:a,height:Hr(i,t.height,o),top:An(i)}},Wn=(t,e,n)=>{let{top:r,left:o,height:a,width:i}=e;return{top:r,height:a,width:Wr(t.left,t.width,i,n),left:Fr(o)}},Hn=(t,e,n)=>{let{top:r,height:o,width:a}=e;const i=t.left-(a-t.width);return{height:o,width:i<0?t.width:Wr(t.left,t.width,a,n),top:An(r),left:Fr(i)}},Fn=(t,e,n)=>{let{top:r,left:o,height:a,width:i}=e;return{width:i,left:o,height:Hr(r,t.height,a),top:An(r)}},_a={n:kn,ne:function(){return kn(arguments.length<=0?void 0:arguments[0],Wn(...arguments))},e:Wn,se:function(){return Fn(arguments.length<=0?void 0:arguments[0],Wn(...arguments))},s:Fn,sw:function(){return Fn(arguments.length<=0?void 0:arguments[0],Hn(...arguments))},w:Hn,nw:function(){return kn(arguments.length<=0?void 0:arguments[0],Hn(...arguments))}};function xa(t,e,n,r){const o=_a[t];return o?o(e,{...e,...n},r):n}function Ea(t){let{top:e,left:n,width:r,height:o}=t;const a=`translate(${n}px,${e}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Oa(t){let{top:e,left:n,width:r,height:o}=t;return{top:`${e}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function Bn(t,e){return e==="horizontal"?Gr(t):e==="vertical"?Br(t):t}function Br(t){return t.slice(0).sort(function(e,n){return e.y>n.y||e.y===n.y&&e.x>n.x?1:e.y===n.y&&e.x===n.x?0:-1})}function Gr(t){return t.slice(0).sort(function(e,n){return e.x>n.x||e.x===n.x&&e.y>n.y?1:-1})}function Ma(t,e,n,r,o){t=t||[];const a=[];vt.default.Children.forEach(e,u=>{if((u==null?void 0:u.key)==null)return;const s=Vn(t,String(u.key)),c=u.props["data-grid"];s&&c==null?a.push($e(s)):c?a.push($e({...c,i:u.key})):a.push($e({w:1,h:1,x:0,y:jn(a),i:String(u.key)}))});const i=Ar(a,{cols:n});return o?i:Ur(i,r,n)}function Pa(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(t))throw new Error(e+" must be an array!");for(let r=0,o=t.length;r<o;r++){const a=t[r];for(let i=0;i<n.length;i++)if(typeof a[n[i]]!="number")throw new Error("ReactGridLayout: "+e+"["+r+"]."+n[i]+" must be a number!")}}function Da(t){const{verticalCompact:e,compactType:n}=t||{};return e===!1?null:n}function Tu(){}const Na=()=>{};G.noop=Na;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calcGridColWidth=Wt,Pe.calcGridItemPosition=ja,Pe.calcGridItemWHPx=Gn,Pe.calcWH=Va,Pe.calcXY=La,Pe.clamp=Ye;function Wt(t){const{margin:e,containerPadding:n,containerWidth:r,cols:o}=t;return(r-e[0]*(o-1)-n[0]*2)/o}function Gn(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function ja(t,e,n,r,o,a){const{margin:i,containerPadding:u,rowHeight:s}=t,c=Wt(t),f={};return a&&a.resizing?(f.width=Math.round(a.resizing.width),f.height=Math.round(a.resizing.height)):(f.width=Gn(r,c,i[0]),f.height=Gn(o,s,i[1])),a&&a.dragging?(f.top=Math.round(a.dragging.top),f.left=Math.round(a.dragging.left)):a&&a.resizing&&typeof a.resizing.top=="number"&&typeof a.resizing.left=="number"?(f.top=Math.round(a.resizing.top),f.left=Math.round(a.resizing.left)):(f.top=Math.round((s+i[1])*n+u[1]),f.left=Math.round((c+i[0])*e+u[0])),f}function La(t,e,n,r,o){const{margin:a,cols:i,rowHeight:u,maxRows:s}=t,c=Wt(t);let f=Math.round((n-a[0])/(c+a[0])),p=Math.round((e-a[1])/(u+a[1]));return f=Ye(f,0,i-r),p=Ye(p,0,s-o),{x:f,y:p}}function Va(t,e,n,r,o,a){const{margin:i,maxRows:u,cols:s,rowHeight:c}=t,f=Wt(t);let p=Math.round((e+i[0])/(f+i[0])),h=Math.round((n+i[1])/(c+i[1])),v=Ye(p,0,s-r),b=Ye(h,0,u-o);return["sw","w","nw"].indexOf(a)!==-1&&(v=Ye(p,0,s)),["nw","n","ne"].indexOf(a)!==-1&&(b=Ye(h,0,u)),{w:v,h:b}}function Ye(t,e,n){return Math.max(Math.min(t,n),e)}var Ht={},$r={exports:{}},Ua="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",za=Ua,Aa=za;function Xr(){}function Yr(){}Yr.resetWarningCache=Xr;var ka=function(){function t(r,o,a,i,u,s){if(s!==Aa){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Yr,resetWarningCache:Xr};return n.PropTypes=n,n};$r.exports=ka();var He=$r.exports,Ft={exports:{}},qr={};function Kr(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=Kr(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Zr(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Kr(t))&&(r&&(r+=" "),r+=e);return r}const Wa=wr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Zr,default:Zr},Symbol.toStringTag,{value:"Module"})));var ie={},De={};Object.defineProperty(De,"__esModule",{value:!0}),De.dontSetMe=$a,De.findInArray=Ha,De.int=Ga,De.isFunction=Fa,De.isNum=Ba;function Ha(t,e){for(let n=0,r=t.length;n<r;n++)if(e.apply(e,[t[n],n,t]))return t[n]}function Fa(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Function]"}function Ba(t){return typeof t=="number"&&!isNaN(t)}function Ga(t){return parseInt(t,10)}function $a(t,e,n){if(t[e])return new Error("Invalid prop ".concat(e," passed to ").concat(n," - do not set this, set it on the child."))}var qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.browserPrefixToKey=Qr,qe.browserPrefixToStyle=Xa,qe.default=void 0,qe.getPrefix=Jr;const $n=["Moz","Webkit","O","ms"];function Jr(){var t;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(t=window.document)===null||t===void 0||(t=t.documentElement)===null||t===void 0?void 0:t.style;if(!n||e in n)return"";for(let r=0;r<$n.length;r++)if(Qr(e,$n[r])in n)return $n[r];return""}function Qr(t,e){return e?"".concat(e).concat(Ya(t)):t}function Xa(t,e){return e?"-".concat(e.toLowerCase(),"-").concat(t):t}function Ya(t){let e="",n=!0;for(let r=0;r<t.length;r++)n?(e+=t[r].toUpperCase(),n=!1):t[r]==="-"?n=!0:e+=t[r];return e}qe.default=Jr(),Object.defineProperty(ie,"__esModule",{value:!0}),ie.addClassName=ro,ie.addEvent=Za,ie.addUserSelectStyles=li,ie.createCSSTransform=oi,ie.createSVGTransform=ai,ie.getTouch=ii,ie.getTouchIdentifier=si,ie.getTranslation=Xn,ie.innerHeight=ti,ie.innerWidth=ni,ie.matchesSelector=no,ie.matchesSelectorAndParentsTo=Ka,ie.offsetXYFromParent=ri,ie.outerHeight=Qa,ie.outerWidth=ei,ie.removeClassName=oo,ie.removeEvent=Ja,ie.removeUserSelectStyles=ui;var Te=De,eo=qa(qe);function to(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(to=function(r){return r?n:e})(t)}function qa(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=to(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}let Bt="";function no(t,e){return Bt||(Bt=(0,Te.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Te.isFunction)(t[n])})),(0,Te.isFunction)(t[Bt])?t[Bt](e):!1}function Ka(t,e,n){let r=t;do{if(no(r,e))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Za(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.addEventListener?t.addEventListener(e,n,o):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}function Ja(t,e,n,r){if(!t)return;const o={capture:!0,...r};t.removeEventListener?t.removeEventListener(e,n,o):t.detachEvent?t.detachEvent("on"+e,n):t["on"+e]=null}function Qa(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Te.int)(n.borderTopWidth),e+=(0,Te.int)(n.borderBottomWidth),e}function ei(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e+=(0,Te.int)(n.borderLeftWidth),e+=(0,Te.int)(n.borderRightWidth),e}function ti(t){let e=t.clientHeight;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Te.int)(n.paddingTop),e-=(0,Te.int)(n.paddingBottom),e}function ni(t){let e=t.clientWidth;const n=t.ownerDocument.defaultView.getComputedStyle(t);return e-=(0,Te.int)(n.paddingLeft),e-=(0,Te.int)(n.paddingRight),e}function ri(t,e,n){const o=e===e.ownerDocument.body?{left:0,top:0}:e.getBoundingClientRect(),a=(t.clientX+e.scrollLeft-o.left)/n,i=(t.clientY+e.scrollTop-o.top)/n;return{x:a,y:i}}function oi(t,e){const n=Xn(t,e,"px");return{[(0,eo.browserPrefixToKey)("transform",eo.default)]:n}}function ai(t,e){return Xn(t,e,"")}function Xn(t,e,n){let{x:r,y:o}=t,a="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(e){const i="".concat(typeof e.x=="string"?e.x:e.x+n),u="".concat(typeof e.y=="string"?e.y:e.y+n);a="translate(".concat(i,", ").concat(u,")")+a}return a}function ii(t,e){return t.targetTouches&&(0,Te.findInArray)(t.targetTouches,n=>e===n.identifier)||t.changedTouches&&(0,Te.findInArray)(t.changedTouches,n=>e===n.identifier)}function si(t){if(t.targetTouches&&t.targetTouches[0])return t.targetTouches[0].identifier;if(t.changedTouches&&t.changedTouches[0])return t.changedTouches[0].identifier}function li(t){if(!t)return;let e=t.getElementById("react-draggable-style-el");e||(e=t.createElement("style"),e.type="text/css",e.id="react-draggable-style-el",e.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
15
|
-
`,
|
|
16
|
-
`,t.getElementsByTagName("head")[0].appendChild(e)),t.body&&ro(t.body,"react-draggable-transparent-selection")}function ui(t){if(t)try{if(t.body&&oo(t.body,"react-draggable-transparent-selection"),t.selection)t.selection.empty();else{const e=(t.defaultView||window).getSelection();e&&e.type!=="Caret"&&e.removeAllRanges()}}catch{}}function ro(t,e){t.classList?t.classList.add(e):t.className.match(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)")))||(t.className+=" ".concat(e))}function oo(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(?:^|\\s)".concat(e,"(?!\\S)"),"g"),"")}var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.canDragX=fi,Ne.canDragY=pi,Ne.createCoreData=mi,Ne.createDraggableData=gi,Ne.getBoundPosition=ci,Ne.getControlPosition=hi,Ne.snapToGrid=di;var Ie=De,nt=ie;function ci(t,e,n){if(!t.props.bounds)return[e,n];let{bounds:r}=t.props;r=typeof r=="string"?r:vi(r);const o=Yn(t);if(typeof r=="string"){const{ownerDocument:a}=o,i=a.defaultView;let u;if(r==="parent"?u=o.parentNode:u=a.querySelector(r),!(u instanceof i.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const s=u,c=i.getComputedStyle(o),f=i.getComputedStyle(s);r={left:-o.offsetLeft+(0,Ie.int)(f.paddingLeft)+(0,Ie.int)(c.marginLeft),top:-o.offsetTop+(0,Ie.int)(f.paddingTop)+(0,Ie.int)(c.marginTop),right:(0,nt.innerWidth)(s)-(0,nt.outerWidth)(o)-o.offsetLeft+(0,Ie.int)(f.paddingRight)-(0,Ie.int)(c.marginRight),bottom:(0,nt.innerHeight)(s)-(0,nt.outerHeight)(o)-o.offsetTop+(0,Ie.int)(f.paddingBottom)-(0,Ie.int)(c.marginBottom)}}return(0,Ie.isNum)(r.right)&&(e=Math.min(e,r.right)),(0,Ie.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Ie.isNum)(r.left)&&(e=Math.max(e,r.left)),(0,Ie.isNum)(r.top)&&(n=Math.max(n,r.top)),[e,n]}function di(t,e,n){const r=Math.round(e/t[0])*t[0],o=Math.round(n/t[1])*t[1];return[r,o]}function fi(t){return t.props.axis==="both"||t.props.axis==="x"}function pi(t){return t.props.axis==="both"||t.props.axis==="y"}function hi(t,e,n){const r=typeof e=="number"?(0,nt.getTouch)(t,e):null;if(typeof e=="number"&&!r)return null;const o=Yn(n),a=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,nt.offsetXYFromParent)(r||t,a,n.props.scale)}function mi(t,e,n){const r=!(0,Ie.isNum)(t.lastX),o=Yn(t);return r?{node:o,deltaX:0,deltaY:0,lastX:e,lastY:n,x:e,y:n}:{node:o,deltaX:e-t.lastX,deltaY:n-t.lastY,lastX:t.lastX,lastY:t.lastY,x:e,y:n}}function gi(t,e){const n=t.props.scale;return{node:e.node,x:t.state.x+e.deltaX/n,y:t.state.y+e.deltaY/n,deltaX:e.deltaX/n,deltaY:e.deltaY/n,lastX:t.state.x,lastY:t.state.y}}function vi(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function Yn(t){const e=t.findDOMNode();if(!e)throw new Error("<DraggableCore>: Unmounted during event!");return e}var Gt={},$t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.default=yi;function yi(){}Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.default=void 0;var qn=bi(w),be=Zn(He),Si=Zn(Ir),ve=ie,Fe=Ne,Kn=De,St=Zn($t);function Zn(t){return t&&t.__esModule?t:{default:t}}function ao(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ao=function(r){return r?n:e})(t)}function bi(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ao(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function Se(t,e,n){return e=Ri(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ri(t){var e=Ci(t,"string");return typeof e=="symbol"?e:String(e)}function Ci(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ee={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Be=Ee.mouse,Xt=class extends qn.Component{constructor(){super(...arguments),Se(this,"dragging",!1),Se(this,"lastX",NaN),Se(this,"lastY",NaN),Se(this,"touchIdentifier",null),Se(this,"mounted",!1),Se(this,"handleDragStart",e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&typeof e.button=="number"&&e.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,ve.matchesSelectorAndParentsTo)(e.target,this.props.handle,n)||this.props.cancel&&(0,ve.matchesSelectorAndParentsTo)(e.target,this.props.cancel,n))return;e.type==="touchstart"&&e.preventDefault();const o=(0,ve.getTouchIdentifier)(e);this.touchIdentifier=o;const a=(0,Fe.getControlPosition)(e,o,this);if(a==null)return;const{x:i,y:u}=a,s=(0,Fe.createCoreData)(this,i,u);(0,St.default)("DraggableCore: handleDragStart: %j",s),(0,St.default)("calling",this.props.onStart),!(this.props.onStart(e,s)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ve.addUserSelectStyles)(r),this.dragging=!0,this.lastX=i,this.lastY=u,(0,ve.addEvent)(r,Be.move,this.handleDrag),(0,ve.addEvent)(r,Be.stop,this.handleDragStop))}),Se(this,"handleDrag",e=>{const n=(0,Fe.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let u=r-this.lastX,s=o-this.lastY;if([u,s]=(0,Fe.snapToGrid)(this.props.grid,u,s),!u&&!s)return;r=this.lastX+u,o=this.lastY+s}const a=(0,Fe.createCoreData)(this,r,o);if((0,St.default)("DraggableCore: handleDrag: %j",a),this.props.onDrag(e,a)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const s=document.createEvent("MouseEvents");s.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(s)}return}this.lastX=r,this.lastY=o}),Se(this,"handleDragStop",e=>{if(!this.dragging)return;const n=(0,Fe.getControlPosition)(e,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX||0,c=o-this.lastY||0;[s,c]=(0,Fe.snapToGrid)(this.props.grid,s,c),r=this.lastX+s,o=this.lastY+c}const a=(0,Fe.createCoreData)(this,r,o);if(this.props.onStop(e,a)===!1||this.mounted===!1)return!1;const u=this.findDOMNode();u&&this.props.enableUserSelectHack&&(0,ve.removeUserSelectStyles)(u.ownerDocument),(0,St.default)("DraggableCore: handleDragStop: %j",a),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,u&&((0,St.default)("DraggableCore: Removing handlers"),(0,ve.removeEvent)(u.ownerDocument,Be.move,this.handleDrag),(0,ve.removeEvent)(u.ownerDocument,Be.stop,this.handleDragStop))}),Se(this,"onMouseDown",e=>(Be=Ee.mouse,this.handleDragStart(e))),Se(this,"onMouseUp",e=>(Be=Ee.mouse,this.handleDragStop(e))),Se(this,"onTouchStart",e=>(Be=Ee.touch,this.handleDragStart(e))),Se(this,"onTouchEnd",e=>(Be=Ee.touch,this.handleDragStop(e)))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,ve.addEvent)(e,Ee.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:n}=e;(0,ve.removeEvent)(n,Ee.mouse.move,this.handleDrag),(0,ve.removeEvent)(n,Ee.touch.move,this.handleDrag),(0,ve.removeEvent)(n,Ee.mouse.stop,this.handleDragStop),(0,ve.removeEvent)(n,Ee.touch.stop,this.handleDragStop),(0,ve.removeEvent)(e,Ee.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ve.removeUserSelectStyles)(n)}}findDOMNode(){var e,n;return(e=this.props)!==null&&e!==void 0&&e.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Si.default.findDOMNode(this)}render(){return qn.cloneElement(qn.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Gt.default=Xt,Se(Xt,"displayName","DraggableCore"),Se(Xt,"propTypes",{allowAnyClick:be.default.bool,children:be.default.node.isRequired,disabled:be.default.bool,enableUserSelectHack:be.default.bool,offsetParent:function(t,e){if(t[e]&&t[e].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:be.default.arrayOf(be.default.number),handle:be.default.string,cancel:be.default.string,nodeRef:be.default.object,onStart:be.default.func,onDrag:be.default.func,onStop:be.default.func,onMouseDown:be.default.func,scale:be.default.number,className:Kn.dontSetMe,style:Kn.dontSetMe,transform:Kn.dontSetMe}),Se(Xt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return s.default}}),t.default=void 0;var e=h(w),n=f(He),r=f(Ir),o=f(Wa),a=ie,i=Ne,u=De,s=f(Gt),c=f($t);function f(_){return _&&_.__esModule?_:{default:_}}function p(_){if(typeof WeakMap!="function")return null;var R=new WeakMap,x=new WeakMap;return(p=function(m){return m?x:R})(_)}function h(_,R){if(_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var x=p(R);if(x&&x.has(_))return x.get(_);var m={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in _)if(I!=="default"&&Object.prototype.hasOwnProperty.call(_,I)){var E=T?Object.getOwnPropertyDescriptor(_,I):null;E&&(E.get||E.set)?Object.defineProperty(m,I,E):m[I]=_[I]}return m.default=_,x&&x.set(_,m),m}function v(){return v=Object.assign?Object.assign.bind():function(_){for(var R=1;R<arguments.length;R++){var x=arguments[R];for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(_[m]=x[m])}return _},v.apply(this,arguments)}function b(_,R,x){return R=y(R),R in _?Object.defineProperty(_,R,{value:x,enumerable:!0,configurable:!0,writable:!0}):_[R]=x,_}function y(_){var R=O(_,"string");return typeof R=="symbol"?R:String(R)}function O(_,R){if(typeof _!="object"||_===null)return _;var x=_[Symbol.toPrimitive];if(x!==void 0){var m=x.call(_,R||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(_)}class C extends e.Component{static getDerivedStateFromProps(R,x){let{position:m}=R,{prevPropsPosition:T}=x;return m&&(!T||m.x!==T.x||m.y!==T.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:m,prevPropsPosition:T}),{x:m.x,y:m.y,prevPropsPosition:{...m}}):null}constructor(R){super(R),b(this,"onDragStart",(x,m)=>{if((0,c.default)("Draggable: onDragStart: %j",m),this.props.onStart(x,(0,i.createDraggableData)(this,m))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(x,m)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",m);const T=(0,i.createDraggableData)(this,m),I={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:U}=I;I.x+=this.state.slackX,I.y+=this.state.slackY;const[F,X]=(0,i.getBoundPosition)(this,I.x,I.y);I.x=F,I.y=X,I.slackX=this.state.slackX+(D-I.x),I.slackY=this.state.slackY+(U-I.y),T.x=I.x,T.y=I.y,T.deltaX=I.x-this.state.x,T.deltaY=I.y-this.state.y}if(this.props.onDrag(x,T)===!1)return!1;this.setState(I)}),b(this,"onDragStop",(x,m)=>{if(!this.state.dragging||this.props.onStop(x,(0,i.createDraggableData)(this,m))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",m);const I={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:U}=this.props.position;I.x=D,I.y=U}this.setState(I)}),this.state={dragging:!1,dragged:!1,x:R.position?R.position.x:R.defaultPosition.x,y:R.position?R.position.y:R.defaultPosition.y,prevPropsPosition:{...R.position},slackX:0,slackY:0,isElementSVG:!1},R.position&&!(R.onDrag||R.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 R,x;return(R=(x=this.props)===null||x===void 0||(x=x.nodeRef)===null||x===void 0?void 0:x.current)!==null&&R!==void 0?R:r.default.findDOMNode(this)}render(){const{axis:R,bounds:x,children:m,defaultPosition:T,defaultClassName:I,defaultClassNameDragging:E,defaultClassNameDragged:D,position:U,positionOffset:F,scale:X,...S}=this.props;let M={},W=null;const q=!!!U||this.state.dragging,de=U||T,se={x:(0,i.canDragX)(this)&&q?this.state.x:de.x,y:(0,i.canDragY)(this)&&q?this.state.y:de.y};this.state.isElementSVG?W=(0,a.createSVGTransform)(se,F):M=(0,a.createCSSTransform)(se,F);const z=(0,o.default)(m.props.className||"",I,{[E]:this.state.dragging,[D]:this.state.dragged});return e.createElement(s.default,v({},S,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(m),{className:z,style:{...m.props.style,...M},transform:W}))}}t.default=C,b(C,"displayName","Draggable"),b(C,"propTypes",{...s.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:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),b(C,"defaultProps",{...s.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(qr);const{default:io,DraggableCore:Ti}=qr;Ft.exports=io,Ft.exports.default=io,Ft.exports.DraggableCore=Ti;var so=Ft.exports,Yt={exports:{}},bt={},Jn={};Jn.__esModule=!0,Jn.cloneElement=Oi;var Ii=wi(w);function wi(t){return t&&t.__esModule?t:{default:t}}function lo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function uo(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lo(Object(n),!0).forEach(function(r){_i(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _i(t,e,n){return e=xi(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xi(t){var e=Ei(t,"string");return typeof e=="symbol"?e:String(e)}function Ei(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Oi(t,e){return e.style&&t.props.style&&(e.style=uo(uo({},t.props.style),e.style)),e.className&&t.props.className&&(e.className=t.props.className+" "+e.className),Ii.default.cloneElement(t,e)}var Rt={};Rt.__esModule=!0,Rt.resizableProps=void 0;var H=Mi(He);function Mi(t){return t&&t.__esModule?t:{default:t}}var Pi={axis:H.default.oneOf(["both","x","y","none"]),className:H.default.string,children:H.default.element.isRequired,draggableOpts:H.default.shape({allowAnyClick:H.default.bool,cancel:H.default.string,children:H.default.node,disabled:H.default.bool,enableUserSelectHack:H.default.bool,offsetParent:H.default.node,grid:H.default.arrayOf(H.default.number),handle:H.default.string,nodeRef:H.default.object,onStart:H.default.func,onDrag:H.default.func,onStop:H.default.func,onMouseDown:H.default.func,scale:H.default.number}),height:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var a;return(a=H.default.number).isRequired.apply(a,n)}return H.default.number.apply(H.default,n)},handle:H.default.oneOfType([H.default.node,H.default.func]),handleSize:H.default.arrayOf(H.default.number),lockAspectRatio:H.default.bool,maxConstraints:H.default.arrayOf(H.default.number),minConstraints:H.default.arrayOf(H.default.number),onResizeStop:H.default.func,onResizeStart:H.default.func,onResize:H.default.func,resizeHandles:H.default.arrayOf(H.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:H.default.number,width:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var a;return(a=H.default.number).isRequired.apply(a,n)}return H.default.number.apply(H.default,n)}};Rt.resizableProps=Pi,bt.__esModule=!0,bt.default=void 0;var Ct=Vi(w),Di=so,Ni=Jn,ji=Rt,Li=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function co(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(co=function(o){return o?n:e})(t)}function Vi(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=co(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Qn.apply(this,arguments)}function Ui(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function er(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?fo(Object(n),!0).forEach(function(r){zi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):fo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function zi(t,e,n){return e=Ai(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ai(t){var e=ki(t,"string");return typeof e=="symbol"?e:String(e)}function ki(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wi(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,tr(t,e)}function tr(t,e){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},tr(t,e)}var nr=function(t){Wi(e,t);function e(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,[this].concat(a))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=e.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,a){var i=this.props,u=i.minConstraints,s=i.maxConstraints,c=i.lockAspectRatio;if(!u&&!s&&!c)return[o,a];if(c){var f=this.props.width/this.props.height,p=o-this.props.width,h=a-this.props.height;Math.abs(p)>Math.abs(h*f)?a=o/f:o=a*f}var v=o,b=a,y=this.slack||[0,0],O=y[0],C=y[1];return o+=O,a+=C,u&&(o=Math.max(u[0],o),a=Math.max(u[1],a)),s&&(o=Math.min(s[0],o),a=Math.min(s[1],a)),this.slack=[O+(v-o),C+(b-a)],[o,a]},n.resizeHandler=function(o,a){var i=this;return function(u,s){var c=s.node,f=s.deltaX,p=s.deltaY;o==="onResizeStart"&&i.resetData();var h=(i.props.axis==="both"||i.props.axis==="x")&&a!=="n"&&a!=="s",v=(i.props.axis==="both"||i.props.axis==="y")&&a!=="e"&&a!=="w";if(!(!h&&!v)){var b=a[0],y=a[a.length-1],O=c.getBoundingClientRect();if(i.lastHandleRect!=null){if(y==="w"){var C=O.left-i.lastHandleRect.left;f+=C}if(b==="n"){var _=O.top-i.lastHandleRect.top;p+=_}}i.lastHandleRect=O,y==="w"&&(f=-f),b==="n"&&(p=-p);var R=i.props.width+(h?f/i.props.transformScale:0),x=i.props.height+(v?p/i.props.transformScale:0),m=i.runConstraints(R,x);R=m[0],x=m[1];var T=R!==i.props.width||x!==i.props.height,I=typeof i.props[o]=="function"?i.props[o]:null,E=o==="onResize"&&!T;I&&!E&&(u.persist==null||u.persist(),I(u,{node:c,size:{width:R,height:x},handle:a})),o==="onResizeStop"&&i.resetData()}}},n.renderResizeHandle=function(o,a){var i=this.props.handle;if(!i)return Ct.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:a});if(typeof i=="function")return i(o,a);var u=typeof i.type=="string",s=er({ref:a},u?{}:{handleAxis:o});return Ct.cloneElement(i,s)},n.render=function(){var o=this,a=this.props,i=a.children,u=a.className,s=a.draggableOpts;a.width,a.height,a.handle,a.handleSize,a.lockAspectRatio,a.axis,a.minConstraints,a.maxConstraints,a.onResize,a.onResizeStop,a.onResizeStart;var c=a.resizeHandles;a.transformScale;var f=Ui(a,Li);return(0,Ni.cloneElement)(i,er(er({},f),{},{className:(u?u+" ":"")+"react-resizable",children:[].concat(i.props.children,c.map(function(p){var h,v=(h=o.handleRefs[p])!=null?h:o.handleRefs[p]=Ct.createRef();return Ct.createElement(Di.DraggableCore,Qn({},s,{nodeRef:v,key:"resizableHandle-"+p,onStop:o.resizeHandler("onResizeStop",p),onStart:o.resizeHandler("onResizeStart",p),onDrag:o.resizeHandler("onResize",p)}),o.renderResizeHandle(p,v))}))}))},e}(Ct.Component);bt.default=nr,nr.propTypes=ji.resizableProps,nr.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var qt={};qt.__esModule=!0,qt.default=void 0;var rr=$i(w),Hi=po(He),Fi=po(bt),Bi=Rt,Gi=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function po(t){return t&&t.__esModule?t:{default:t}}function ho(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(ho=function(o){return o?n:e})(t)}function $i(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=ho(e);if(n&&n.has(t))return n.get(t);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function or(){return or=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},or.apply(this,arguments)}function mo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mo(Object(n),!0).forEach(function(r){Xi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xi(t,e,n){return e=Yi(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yi(t){var e=qi(t,"string");return typeof e=="symbol"?e:String(e)}function qi(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ki(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}function Zi(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ar(t,e)}function ar(t,e){return ar=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},ar(t,e)}var go=function(t){Zi(e,t);function e(){for(var r,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];return r=t.call.apply(t,[this].concat(a))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(u,s){var c=s.size;r.props.onResize?(u.persist==null||u.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(u,s)})):r.setState(c)},r}e.getDerivedStateFromProps=function(o,a){return a.propsWidth!==o.width||a.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=e.prototype;return n.render=function(){var o=this.props,a=o.handle,i=o.handleSize;o.onResize;var u=o.onResizeStart,s=o.onResizeStop,c=o.draggableOpts,f=o.minConstraints,p=o.maxConstraints,h=o.lockAspectRatio,v=o.axis;o.width,o.height;var b=o.resizeHandles,y=o.style,O=o.transformScale,C=Ki(o,Gi);return rr.createElement(Fi.default,{axis:v,draggableOpts:c,handle:a,handleSize:i,height:this.state.height,lockAspectRatio:h,maxConstraints:p,minConstraints:f,onResizeStart:u,onResize:this.onResize,onResizeStop:s,resizeHandles:b,transformScale:O,width:this.state.width},rr.createElement("div",or({},C,{style:Kt(Kt({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},e}(rr.Component);qt.default=go,go.propTypes=Kt(Kt({},Bi.resizableProps),{},{children:Hi.default.element}),Yt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Yt.exports.Resizable=bt.default,Yt.exports.ResizableBox=qt.default;var Ji=Yt.exports,ze={};Object.defineProperty(ze,"__esModule",{value:!0}),ze.resizeHandleType=ze.resizeHandleAxesType=ze.default=void 0;var B=vo(He),Qi=vo(w);function vo(t){return t&&t.__esModule?t:{default:t}}const es=ze.resizeHandleAxesType=B.default.arrayOf(B.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),ts=ze.resizeHandleType=B.default.oneOfType([B.default.node,B.default.func]);ze.default={className:B.default.string,style:B.default.object,width:B.default.number,autoSize:B.default.bool,cols:B.default.number,draggableCancel:B.default.string,draggableHandle:B.default.string,verticalCompact:function(t){t.verticalCompact},compactType:B.default.oneOf(["vertical","horizontal"]),layout:function(t){var e=t.layout;e!==void 0&&G.validateLayout(e,"layout")},margin:B.default.arrayOf(B.default.number),containerPadding:B.default.arrayOf(B.default.number),rowHeight:B.default.number,maxRows:B.default.number,isBounded:B.default.bool,isDraggable:B.default.bool,isResizable:B.default.bool,allowOverlap:B.default.bool,preventCollision:B.default.bool,useCSSTransforms:B.default.bool,transformScale:B.default.number,isDroppable:B.default.bool,resizeHandles:es,resizeHandle:ts,onLayoutChange:B.default.func,onDragStart:B.default.func,onDrag:B.default.func,onDragStop:B.default.func,onResizeStart:B.default.func,onResize:B.default.func,onResizeStop:B.default.func,onDrop:B.default.func,droppingItem:B.default.shape({i:B.default.string.isRequired,w:B.default.number.isRequired,h:B.default.number.isRequired}),children:function(t,e){const n=t[e],r={};Qi.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:B.default.any},Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.default=void 0;var rt=ir(w),K=ir(He),ns=so,rs=Ji,ot=G,me=Pe,yo=ze,os=ir(Nn);function ir(t){return t&&t.__esModule?t:{default:t}}function je(t,e,n){return e=as(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function as(t){var e=is(t,"string");return typeof e=="symbol"?e:String(e)}function is(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sr extends rt.default.Component{constructor(){super(...arguments),je(this,"state",{resizing:null,dragging:null,className:""}),je(this,"elementRef",rt.default.createRef()),je(this,"onDragStart",(e,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:a}=this.props;if(!o)return;const i={top:0,left:0},{offsetParent:u}=r;if(!u)return;const s=u.getBoundingClientRect(),c=r.getBoundingClientRect(),f=c.left/a,p=s.left/a,h=c.top/a,v=s.top/a;i.left=f-p+u.scrollLeft,i.top=h-v+u.scrollTop,this.setState({dragging:i});const{x:b,y}=(0,me.calcXY)(this.getPositionParams(),i.top,i.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,y,{e,node:r,newPosition:i})}),je(this,"onDrag",(e,n)=>{let{node:r,deltaX:o,deltaY:a}=n;const{onDrag:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let u=this.state.dragging.top+a,s=this.state.dragging.left+o;const{isBounded:c,i:f,w:p,h,containerWidth:v}=this.props,b=this.getPositionParams();if(c){const{offsetParent:R}=r;if(R){const{margin:x,rowHeight:m,containerPadding:T}=this.props,I=R.clientHeight-(0,me.calcGridItemWHPx)(h,m,x[1]);u=(0,me.clamp)(u-T[1],0,I);const E=(0,me.calcGridColWidth)(b),D=v-(0,me.calcGridItemWHPx)(p,E,x[0]);s=(0,me.clamp)(s-T[0],0,D)}}const y={top:u,left:s};this.setState({dragging:y});const{containerPadding:O}=this.props,{x:C,y:_}=(0,me.calcXY)(b,u-O[1],s-O[0],p,h);return i.call(this,f,C,_,{e,node:r,newPosition:y})}),je(this,"onDragStop",(e,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:a,h:i,i:u,containerPadding:s}=this.props,{left:c,top:f}=this.state.dragging,p={top:f,left:c};this.setState({dragging:null});const{x:h,y:v}=(0,me.calcXY)(this.getPositionParams(),f-s[1],c-s[0],a,i);return o.call(this,u,h,v,{e,node:r,newPosition:p})}),je(this,"onResizeStop",(e,n,r)=>this.onResizeHandler(e,n,r,"onResizeStop")),je(this,"onResizeStart",(e,n,r)=>this.onResizeHandler(e,n,r,"onResizeStart")),je(this,"onResize",(e,n,r)=>this.onResizeHandler(e,n,r,"onResize"))}shouldComponentUpdate(e,n){if(this.props.children!==e.children||this.props.droppingPosition!==e.droppingPosition)return!0;const r=(0,me.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,me.calcGridItemPosition)(this.getPositionParams(e),e.x,e.y,e.w,e.h,n);return!(0,ot.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==e.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(e){this.moveDroppingItem(e)}moveDroppingItem(e){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=e.droppingPosition||{left:0,top:0},{dragging:a}=this.state,i=a&&n.left!==o.left||n.top!==o.top;if(!a)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(i){const u=n.left-a.left,s=n.top-a.top;this.onDrag(n.e,{node:r,deltaX:u,deltaY:s})}}getPositionParams(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}createStyle(e){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let a;return o?a=(0,ot.setTransform)(e):(a=(0,ot.setTopLeft)(e),n&&(a.left=(0,ot.perc)(e.left/r),a.width=(0,ot.perc)(e.width/r))),a}mixinDraggable(e,n){return rt.default.createElement(ns.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},e)}curryResizeHandler(e,n){return(r,o)=>n(r,o,e)}mixinResizable(e,n,r){const{cols:o,minW:a,minH:i,maxW:u,maxH:s,transformScale:c,resizeHandles:f,resizeHandle:p}=this.props,h=this.getPositionParams(),v=(0,me.calcGridItemPosition)(h,0,0,o,0).width,b=(0,me.calcGridItemPosition)(h,0,0,a,i),y=(0,me.calcGridItemPosition)(h,0,0,u,s),O=[b.width,b.height],C=[Math.min(y.width,v),Math.min(y.height,1/0)];return rt.default.createElement(rs.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:O,maxConstraints:C,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:f,handle:p},e)}onResizeHandler(e,n,r,o){let{node:a,size:i,handle:u}=n;const s=this.props[o];if(!s)return;const{x:c,y:f,i:p,maxH:h,minH:v,containerWidth:b}=this.props,{minW:y,maxW:O}=this.props;let C=i;a&&(C=(0,ot.resizeItemInDirection)(u,r,i,b),this.setState({resizing:o==="onResizeStop"?null:C}));let{w:_,h:R}=(0,me.calcWH)(this.getPositionParams(),C.width,C.height,c,f,u);_=(0,me.clamp)(_,Math.max(y,1),O),R=(0,me.clamp)(R,v,h),s.call(this,p,_,R,{e,node:a,size:C,handle:u})}render(){const{x:e,y:n,w:r,h:o,isDraggable:a,isResizable:i,droppingPosition:u,useCSSTransforms:s}=this.props,c=(0,me.calcGridItemPosition)(this.getPositionParams(),e,n,r,o,this.state),f=rt.default.Children.only(this.props.children);let p=rt.default.cloneElement(f,{ref:this.elementRef,className:(0,os.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":a,"react-draggable-dragging":!!this.state.dragging,dropping:!!u,cssTransforms:s}),style:{...this.props.style,...f.props.style,...this.createStyle(c)}});return p=this.mixinResizable(p,c,i),p=this.mixinDraggable(p,a),p}}Ht.default=sr,je(sr,"propTypes",{children:K.default.element,cols:K.default.number.isRequired,containerWidth:K.default.number.isRequired,rowHeight:K.default.number.isRequired,margin:K.default.array.isRequired,maxRows:K.default.number.isRequired,containerPadding:K.default.array.isRequired,x:K.default.number.isRequired,y:K.default.number.isRequired,w:K.default.number.isRequired,h:K.default.number.isRequired,minW:function(t,e){const n=t[e];if(typeof n!="number")return new Error("minWidth not Number");if(n>t.w||n>t.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(t,e){const n=t[e];if(typeof n!="number")return new Error("maxWidth not Number");if(n<t.w||n<t.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(t,e){const n=t[e];if(typeof n!="number")return new Error("minHeight not Number");if(n>t.h||n>t.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(t,e){const n=t[e];if(typeof n!="number")return new Error("maxHeight not Number");if(n<t.h||n<t.minH)return new Error("maxHeight smaller than item height/minHeight")},i:K.default.string.isRequired,resizeHandles:yo.resizeHandleAxesType,resizeHandle:yo.resizeHandleType,onDragStop:K.default.func,onDragStart:K.default.func,onDrag:K.default.func,onResizeStop:K.default.func,onResizeStart:K.default.func,onResize:K.default.func,isDraggable:K.default.bool.isRequired,isResizable:K.default.bool.isRequired,isBounded:K.default.bool.isRequired,static:K.default.bool,useCSSTransforms:K.default.bool.isRequired,transformScale:K.default.number,className:K.default.string,handle:K.default.string,cancel:K.default.string,droppingPosition:K.default.shape({e:K.default.object.isRequired,left:K.default.number.isRequired,top:K.default.number.isRequired})}),je(sr,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=void 0;var Ke=cs(w),lr=Pn,ss=ur(Nn),A=G,ls=Pe,So=ur(Ht),us=ur(ze);function ur(t){return t&&t.__esModule?t:{default:t}}function bo(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(bo=function(r){return r?n:e})(t)}function cs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=bo(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function ye(t,e,n){return e=ds(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ds(t){var e=fs(t,"string");return typeof e=="symbol"?e:String(e)}function fs(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Ro="react-grid-layout";let Co=!1;try{Co=/firefox/i.test(navigator.userAgent)}catch{}class Zt extends Ke.Component{constructor(){super(...arguments),ye(this,"state",{activeDrag:null,layout:(0,A.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,A.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),ye(this,"dragEnterCounter",0),ye(this,"onDragStart",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u}=this.state,s=(0,A.getLayoutItem)(u,e);if(!s)return;const c={w:s.w,h:s.h,x:s.x,y:s.y,placeholder:!0,i:e};return this.setState({oldDragItem:(0,A.cloneLayoutItem)(s),oldLayout:u,activeDrag:c}),this.props.onDragStart(u,s,s,null,a,i)}),ye(this,"onDrag",(e,n,r,o)=>{let{e:a,node:i}=o;const{oldDragItem:u}=this.state;let{layout:s}=this.state;const{cols:c,allowOverlap:f,preventCollision:p}=this.props,h=(0,A.getLayoutItem)(s,e);if(!h)return;const v={w:h.w,h:h.h,x:h.x,y:h.y,placeholder:!0,i:e};s=(0,A.moveElement)(s,h,n,r,!0,p,(0,A.compactType)(this.props),c,f),this.props.onDrag(s,u,h,v,a,i),this.setState({layout:f?s:(0,A.compact)(s,(0,A.compactType)(this.props),c),activeDrag:v})}),ye(this,"onDragStop",(e,n,r,o)=>{let{e:a,node:i}=o;if(!this.state.activeDrag)return;const{oldDragItem:u}=this.state;let{layout:s}=this.state;const{cols:c,preventCollision:f,allowOverlap:p}=this.props,h=(0,A.getLayoutItem)(s,e);if(!h)return;s=(0,A.moveElement)(s,h,n,r,!0,f,(0,A.compactType)(this.props),c,p);const b=p?s:(0,A.compact)(s,(0,A.compactType)(this.props),c);this.props.onDragStop(b,u,h,null,a,i);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,y)}),ye(this,"onResizeStart",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u}=this.state,s=(0,A.getLayoutItem)(u,e);s&&(this.setState({oldResizeItem:(0,A.cloneLayoutItem)(s),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(u,s,s,null,a,i))}),ye(this,"onResize",(e,n,r,o)=>{let{e:a,node:i,size:u,handle:s}=o;const{oldResizeItem:c}=this.state,{layout:f}=this.state,{cols:p,preventCollision:h,allowOverlap:v}=this.props;let b=!1,y,O,C;const[_,R]=(0,A.withLayoutItem)(f,e,m=>{let T;return O=m.x,C=m.y,["sw","w","nw","n","ne"].indexOf(s)!==-1&&(["sw","nw","w"].indexOf(s)!==-1&&(O=m.x+(m.w-n),n=m.x!==O&&O<0?m.w:n,O=O<0?0:O),["ne","n","nw"].indexOf(s)!==-1&&(C=m.y+(m.h-r),r=m.y!==C&&C<0?m.h:r,C=C<0?0:C),b=!0),h&&!v&&(T=(0,A.getAllCollisions)(f,{...m,w:n,h:r,x:O,y:C}).filter(E=>E.i!==m.i).length>0,T&&(C=m.y,r=m.h,O=m.x,n=m.w,b=!1)),m.w=n,m.h=r,m});if(!R)return;y=_,b&&(y=(0,A.moveElement)(_,R,O,C,!0,this.props.preventCollision,(0,A.compactType)(this.props),p,v));const x={w:R.w,h:R.h,x:R.x,y:R.y,static:!0,i:e};this.props.onResize(y,c,R,x,a,i),this.setState({layout:v?y:(0,A.compact)(y,(0,A.compactType)(this.props),p),activeDrag:x})}),ye(this,"onResizeStop",(e,n,r,o)=>{let{e:a,node:i}=o;const{layout:u,oldResizeItem:s}=this.state,{cols:c,allowOverlap:f}=this.props,p=(0,A.getLayoutItem)(u,e),h=f?u:(0,A.compact)(u,(0,A.compactType)(this.props),c);this.props.onResizeStop(h,s,p,null,a,i);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:h,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(h,v)}),ye(this,"onDragOver",e=>{var _;if(e.preventDefault(),e.stopPropagation(),Co&&!((_=e.nativeEvent.target)!=null&&_.classList.contains(Ro)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:a,rowHeight:i,maxRows:u,width:s,containerPadding:c,transformScale:f}=this.props,p=r==null?void 0:r(e);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const h={...n,...p},{layout:v}=this.state,b=e.currentTarget.getBoundingClientRect(),y=e.clientX-b.left,O=e.clientY-b.top,C={left:y/f,top:O/f,e};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:R,top:x}=this.state.droppingPosition;(R!=y||x!=O)&&this.setState({droppingPosition:C})}}else{const R={cols:a,margin:o,maxRows:u,rowHeight:i,containerWidth:s,containerPadding:c||o},x=(0,ls.calcXY)(R,O,y,h.w,h.h);this.setState({droppingDOMNode:Ke.createElement("div",{key:h.i}),droppingPosition:C,layout:[...v,{...h,x:x.x,y:x.y,static:!1,isDraggable:!0}]})}}),ye(this,"removeDroppingPlaceholder",()=>{const{droppingItem:e,cols:n}=this.props,{layout:r}=this.state,o=(0,A.compact)(r.filter(a=>a.i!==e.i),(0,A.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),ye(this,"onDragLeave",e=>{e.preventDefault(),e.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),ye(this,"onDragEnter",e=>{e.preventDefault(),e.stopPropagation(),this.dragEnterCounter++}),ye(this,"onDrop",e=>{e.preventDefault(),e.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(a=>a.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,e)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(e,n){let r;return n.activeDrag?null:(!(0,lr.deepEqual)(e.layout,n.propsLayout)||e.compactType!==n.compactType?r=e.layout:(0,A.childrenEqual)(e.children,n.children)||(r=n.layout),r?{layout:(0,A.synchronizeLayoutWithChildren)(r,e.children,e.cols,(0,A.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}shouldComponentUpdate(e,n){return this.props.children!==e.children||!(0,A.fastRGLPropsEqual)(this.props,e,lr.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(e,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const e=(0,A.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return e*this.props.rowHeight+(e-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(e,n){n||(n=this.state.layout),(0,lr.deepEqual)(n,e)||this.props.onLayoutChange(e)}placeholder(){const{activeDrag:e}=this.state;if(!e)return null;const{width:n,cols:r,margin:o,containerPadding:a,rowHeight:i,maxRows:u,useCSSTransforms:s,transformScale:c}=this.props;return Ke.createElement(So.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:n,cols:r,margin:o,containerPadding:a||o,maxRows:u,rowHeight:i,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:s,transformScale:c},Ke.createElement("div",null))}processGridItem(e,n){if(!e||!e.key)return;const r=(0,A.getLayoutItem)(this.state.layout,String(e.key));if(!r)return null;const{width:o,cols:a,margin:i,containerPadding:u,rowHeight:s,maxRows:c,isDraggable:f,isResizable:p,isBounded:h,useCSSTransforms:v,transformScale:b,draggableCancel:y,draggableHandle:O,resizeHandles:C,resizeHandle:_}=this.props,{mounted:R,droppingPosition:x}=this.state,m=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&f,T=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&p,I=r.resizeHandles||C,E=m&&h&&r.isBounded!==!1;return Ke.createElement(So.default,{containerWidth:o,cols:a,margin:i,containerPadding:u||i,maxRows:c,rowHeight:s,cancel:y,handle:O,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:m,isResizable:T,isBounded:E,useCSSTransforms:v&&R,usePercentages:!R,transformScale:b,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?x:void 0,resizeHandles:I,resizeHandle:_},e)}render(){const{className:e,style:n,isDroppable:r,innerRef:o}=this.props,a=(0,ss.default)(Ro,e),i={height:this.containerHeight(),...n};return Ke.createElement("div",{ref:o,className:a,style:i,onDrop:r?this.onDrop:A.noop,onDragLeave:r?this.onDragLeave:A.noop,onDragEnter:r?this.onDragEnter:A.noop,onDragOver:r?this.onDragOver:A.noop},Ke.Children.map(this.props.children,u=>this.processGridItem(u)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}gt.default=Zt,ye(Zt,"displayName","ReactGridLayout"),ye(Zt,"propTypes",us.default),ye(Zt,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:A.noop,onDragStart:A.noop,onDrag:A.noop,onDragStop:A.noop,onResizeStart:A.noop,onResize:A.noop,onResizeStop:A.noop,onDrop:A.noop,onDropDragOver:A.noop});var Jt={},Ze={};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.findOrGenerateResponsiveLayout=ms,Ze.getBreakpointFromWidth=ps,Ze.getColsFromBreakpoint=hs,Ze.sortBreakpoints=cr;var Qt=G;function ps(t,e){const n=cr(t);let r=n[0];for(let o=1,a=n.length;o<a;o++){const i=n[o];e>t[i]&&(r=i)}return r}function hs(t,e){if(!e[t])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+t+" is missing!");return e[t]}function ms(t,e,n,r,o,a){if(t[n])return(0,Qt.cloneLayout)(t[n]);let i=t[r];const u=cr(e),s=u.slice(u.indexOf(n));for(let c=0,f=s.length;c<f;c++){const p=s[c];if(t[p]){i=t[p];break}}return i=(0,Qt.cloneLayout)(i||[]),(0,Qt.compact)((0,Qt.correctBounds)(i,{cols:o}),a,o)}function cr(t){return Object.keys(t).sort(function(n,r){return t[n]-t[r]})}Object.defineProperty(Jt,"__esModule",{value:!0}),Jt.default=void 0;var To=vs(w),Re=Io(He),dr=Pn,at=G,Je=Ze,gs=Io(gt);function Io(t){return t&&t.__esModule?t:{default:t}}function wo(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(wo=function(r){return r?n:e})(t)}function vs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=wo(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function fr(){return fr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fr.apply(this,arguments)}function en(t,e,n){return e=ys(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ys(t){var e=Ss(t,"string");return typeof e=="symbol"?e:String(e)}function Ss(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const _o=t=>Object.prototype.toString.call(t);function tn(t,e){return t==null?null:Array.isArray(t)?t:t[e]}class pr extends To.Component{constructor(){super(...arguments),en(this,"state",this.generateInitialState()),en(this,"onLayoutChange",e=>{this.props.onLayoutChange(e,{...this.props.layouts,[this.state.breakpoint]:e})})}generateInitialState(){const{width:e,breakpoints:n,layouts:r,cols:o}=this.props,a=(0,Je.getBreakpointFromWidth)(n,e),i=(0,Je.getColsFromBreakpoint)(a,o),u=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Je.findOrGenerateResponsiveLayout)(r,n,a,a,i,u),breakpoint:a,cols:i}}static getDerivedStateFromProps(e,n){if(!(0,dr.deepEqual)(e.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Je.findOrGenerateResponsiveLayout)(e.layouts,e.breakpoints,r,r,o,e.compactType),layouts:e.layouts}}return null}componentDidUpdate(e){(this.props.width!=e.width||this.props.breakpoint!==e.breakpoint||!(0,dr.deepEqual)(this.props.breakpoints,e.breakpoints)||!(0,dr.deepEqual)(this.props.cols,e.cols))&&this.onWidthChange(e)}onWidthChange(e){const{breakpoints:n,cols:r,layouts:o,compactType:a}=this.props,i=this.props.breakpoint||(0,Je.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),u=this.state.breakpoint,s=(0,Je.getColsFromBreakpoint)(i,r),c={...o};if(u!==i||e.breakpoints!==n||e.cols!==r){u in c||(c[u]=(0,at.cloneLayout)(this.state.layout));let h=(0,Je.findOrGenerateResponsiveLayout)(c,n,i,u,s,a);h=(0,at.synchronizeLayoutWithChildren)(h,this.props.children,s,a,this.props.allowOverlap),c[i]=h,this.props.onLayoutChange(h,c),this.props.onBreakpointChange(i,s),this.setState({breakpoint:i,layout:h,cols:s})}const f=tn(this.props.margin,i),p=tn(this.props.containerPadding,i);this.props.onWidthChange(this.props.width,f,s,p)}render(){const{breakpoint:e,breakpoints:n,cols:r,layouts:o,margin:a,containerPadding:i,onBreakpointChange:u,onLayoutChange:s,onWidthChange:c,...f}=this.props;return To.createElement(gs.default,fr({},f,{margin:tn(a,this.state.breakpoint),containerPadding:tn(i,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}Jt.default=pr,en(pr,"propTypes",{breakpoint:Re.default.string,breakpoints:Re.default.object,allowOverlap:Re.default.bool,cols:Re.default.object,margin:Re.default.oneOfType([Re.default.array,Re.default.object]),containerPadding:Re.default.oneOfType([Re.default.array,Re.default.object]),layouts(t,e){if(_o(t[e])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+_o(t[e]));Object.keys(t[e]).forEach(n=>{if(!(n in t.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,at.validateLayout)(t.layouts[n],"layouts."+n)})},width:Re.default.number.isRequired,onBreakpointChange:Re.default.func,onLayoutChange:Re.default.func,onWidthChange:Re.default.func}),en(pr,"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:at.noop,onLayoutChange:at.noop,onWidthChange:at.noop});var hr={},xo=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(o,a){return o[0]===n?(r=a,!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),o=this.__entries__[r];return o&&o[1]},e.prototype.set=function(n,r){var o=t(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,o=t(r,n);~o&&r.splice(o,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 o=0,a=this.__entries__;o<a.length;o++){var i=a[o];n.call(r,i[1],i[0])}},e}()}(),mr=typeof window<"u"&&typeof document<"u"&&window.document===document,nn=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")()}(),bs=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(nn):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Rs=2;function Cs(t,e){var n=!1,r=!1,o=0;function a(){n&&(n=!1,t()),r&&u()}function i(){bs(a)}function u(){var s=Date.now();if(n){if(s-o<Rs)return;r=!0}else n=!0,r=!1,setTimeout(i,e);o=s}return u}var Ts=20,Is=["top","right","bottom","left","width","height","size","weight"],ws=typeof MutationObserver<"u",_s=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Cs(this.refresh.bind(this),Ts)}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(){!mr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ws?(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(){!mr||!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,o=Is.some(function(a){return!!~r.indexOf(a)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Eo=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},it=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||nn},Oo=on(0,0,0,0);function rn(t){return parseFloat(t)||0}function Mo(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,o){var a=t["border-"+o+"-width"];return r+rn(a)},0)}function xs(t){for(var e=["top","right","bottom","left"],n={},r=0,o=e;r<o.length;r++){var a=o[r],i=t["padding-"+a];n[a]=rn(i)}return n}function Es(t){var e=t.getBBox();return on(0,0,e.width,e.height)}function Os(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return Oo;var r=it(t).getComputedStyle(t),o=xs(r),a=o.left+o.right,i=o.top+o.bottom,u=rn(r.width),s=rn(r.height);if(r.boxSizing==="border-box"&&(Math.round(u+a)!==e&&(u-=Mo(r,"left","right")+a),Math.round(s+i)!==n&&(s-=Mo(r,"top","bottom")+i)),!Ps(t)){var c=Math.round(u+a)-e,f=Math.round(s+i)-n;Math.abs(c)!==1&&(u-=c),Math.abs(f)!==1&&(s-=f)}return on(o.left,o.top,u,s)}var Ms=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof it(t).SVGGraphicsElement}:function(t){return t instanceof it(t).SVGElement&&typeof t.getBBox=="function"}}();function Ps(t){return t===it(t).document.documentElement}function Ds(t){return mr?Ms(t)?Es(t):Os(t):Oo}function Ns(t){var e=t.x,n=t.y,r=t.width,o=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,i=Object.create(a.prototype);return Eo(i,{x:e,y:n,width:r,height:o,top:n,right:e+r,bottom:o+n,left:e}),i}function on(t,e,n,r){return{x:t,y:e,width:n,height:r}}var js=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=on(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Ds(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}(),Ls=function(){function t(e,n){var r=Ns(n);Eo(this,{target:e,contentRect:r})}return t}(),Vs=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new xo,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 it(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new js(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 it(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 Ls(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}(),Po=typeof WeakMap<"u"?new WeakMap:new xo,Do=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=_s.getInstance(),r=new Vs(e,n,this);Po.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){Do.prototype[t]=function(){var e;return(e=Po.get(this))[t].apply(e,arguments)}});var Us=function(){return typeof nn.ResizeObserver<"u"?nn.ResizeObserver:Do}();const zs=wr(Object.freeze(Object.defineProperty({__proto__:null,default:Us},Symbol.toStringTag,{value:"Module"})));Object.defineProperty(hr,"__esModule",{value:!0}),hr.default=$s;var an=Hs(w),As=gr(He),ks=gr(zs),Ws=gr(Nn);function gr(t){return t&&t.__esModule?t:{default:t}}function No(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(No=function(r){return r?n:e})(t)}function Hs(t,e){if(t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var n=No(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if(a!=="default"&&Object.prototype.hasOwnProperty.call(t,a)){var i=o?Object.getOwnPropertyDescriptor(t,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=t[a]}return r.default=t,n&&n.set(t,r),r}function vr(){return vr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},vr.apply(this,arguments)}function st(t,e,n){return e=Fs(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fs(t){var e=Bs(t,"string");return typeof e=="symbol"?e:String(e)}function Bs(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}const Gs="react-grid-layout";function $s(t){var e;return e=class extends an.Component{constructor(){super(...arguments),st(this,"state",{width:1280}),st(this,"elementRef",an.createRef()),st(this,"mounted",!1),st(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new ks.default(o=>{if(this.elementRef.current instanceof HTMLElement){const i=o[0].contentRect.width;this.setState({width:i})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?an.createElement("div",{className:(0,Ws.default)(this.props.className,Gs),style:this.props.style,ref:this.elementRef}):an.createElement(t,vr({innerRef:this.elementRef},o,this.state))}},st(e,"defaultProps",{measureBeforeMount:!1}),st(e,"propTypes",{measureBeforeMount:As.default.bool}),e}(function(t){t.exports=gt.default,t.exports.utils=G,t.exports.calculateUtils=Pe,t.exports.Responsive=Jt.default,t.exports.Responsive.utils=Ze,t.exports.WidthProvider=hr.default})(Pr);var Xs=Pr.exports;const Ys=ra(Xs),Tt={type:d.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=L.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:i,subUnitId:u}=a,s={unitId:i,subUnitId:u,cfId:e.cfId},c=l.DeleteConditionalRuleMutationUndoFactory(t,s),f=r.syncExecuteCommand(l.DeleteConditionalRuleMutation.id,s);return f&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:l.DeleteConditionalRuleMutation.id,params:s}]}),f}},sn={type:d.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=t.get(l.ConditionalFormattingRuleModel),i=L.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:s}=i,c=l.transformSupportSymmetryAnchor(e.start,e.end,a.getSubunitRules(u,s)||[],y=>y.cfId);if(!c)return!1;const[f,p]=c,h={unitId:u,subUnitId:s,start:f,end:p},v=l.MoveConditionalRuleMutationUndoFactory(h),b=r.syncExecuteCommand(l.MoveConditionalRuleMutation.id,h);return b&&n.pushUndoRedo({unitID:u,redoMutations:[{id:l.MoveConditionalRuleMutation.id,params:h}],undoMutations:v}),b}},ln={cfPreview:"univer-cf-preview"},lt=t=>{var o,a;const e=t.rule;if(!e)return null;const n=w.useMemo(()=>{if(e.type===l.CFRuleType.colorScale){const i=e.config.map((c,f)=>({color:new d.ColorKit(c.color),value:f})),u=i.length-1;return new Array(5).fill("").map((c,f,p)=>f*u/(p.length-1)).map(c=>l.getColorScaleFromValue(i,c))}return null},[e]),r=w.useMemo(()=>{if(e.type===l.CFRuleType.iconSet)return e.config.map(i=>{const u=l.iconMap[i.iconType];return u&&u[Number(i.iconId)]})},[e]);switch(e.type){case l.CFRuleType.dataBar:{const{isGradient:i}=e.config,u={width:"50%",height:"100%"},s=i?`linear-gradient(to right, ${e.config.positiveColor||l.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,c=i?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||l.defaultDataBarNativeColor})`:e.config.nativeColor;return g.jsxs("div",{className:ln.cfPreview,children:[g.jsx("div",{style:{...u,background:c,border:`1px solid ${e.config.nativeColor||l.defaultDataBarNativeColor}`}}),g.jsx("div",{style:{...u,background:s,border:`1px solid ${e.config.positiveColor||l.defaultDataBarPositiveColor}`}})]})}case l.CFRuleType.colorScale:return n&&g.jsx("div",{className:ln.cfPreview,children:n.map((i,u)=>g.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:i}},u))});case l.CFRuleType.iconSet:return r&&g.jsx("div",{className:ln.cfPreview,children:r.map((i,u)=>i?g.jsx("img",{style:{height:"100%"},src:i},u):g.jsx(mt,{},u))});case l.CFRuleType.highlightCell:{const{ul:i,st:u,it:s,bl:c,bg:f,cl:p}=e.style,h=(i==null?void 0:i.s)===d.BooleanNumber.TRUE,v=(u==null?void 0:u.s)===d.BooleanNumber.TRUE,b=s===d.BooleanNumber.TRUE,y=c===d.BooleanNumber.TRUE,O=(o=f==null?void 0:f.rgb)!=null?o:l.DEFAULT_BG_COLOR,C=(a=p==null?void 0:p.rgb)!=null?a:l.DEFAULT_FONT_COLOR,_={fontWeight:y?"bold":void 0,fontStyle:b?"italic":void 0,textDecoration:`${h?"underline":""} ${v?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:O,color:C};return g.jsx("div",{style:_,className:ln.cfPreview,children:"123"})}}return null};var qs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,Zs=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ks(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&qs(e,n,o),o},Js=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends d.Disposable{constructor(e){super();Ge(this,"_initLocal",()=>{});Ge(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let o=n.exec(e);for(;o;)r.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),o=e.split("."),a=r&&this._localeService.resolveKeyPath(r,o);if(typeof a=="string"){const i=[];return this._findReplaceIndex(a).forEach((u,s,c)=>{const f=c[s-1]||{startIndex:0,endIndex:-1};if(f.endIndex+1<u.startIndex){const p=a.slice(f.endIndex+1,u.startIndex);p&&i.push(p)}if(n[u.key]&&i.push(n[u.key]),s===c.length-1){const p=a.slice(u.endIndex+1);p&&i.push(p)}}),i}return[]}};ut=Zs([Js(0,d.Inject(d.LocaleService))],ut);const fe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},Qs=(t,e)=>{const n=t.rule;switch(n.type){case l.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case l.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case l.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case l.CFRuleType.highlightCell:switch(n.subType){case l.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case l.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case l.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case l.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(o=>String(o)):[String(n.value||"")])}case l.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case l.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case l.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 l.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let jo=0;const el=t=>{const{onClick:e}=t,n=d.useDependency(l.ConditionalFormattingRuleModel),r=d.useDependency(d.IUniverInstanceService),o=d.useDependency(L.SheetsSelectionsService),a=d.useDependency(d.ICommandService),i=d.useDependency(d.LocaleService),u=d.useDependency(d.Injector),s=d.useDependency(ut),c=ge.useObservable(()=>r.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),f=c.getUnitId(),p=c.getActiveSheet();if(!p)throw new Error("No active sheet found");const h=p.getSheetId(),[v,b]=w.useState([]),[y,O]=w.useState("2"),[C,_]=w.useState(0),[R,x]=w.useState(-1),[m,T]=w.useState(jo),I=w.useRef(null),E=[{label:i.t("sheet.cf.panel.workSheet"),value:"2"},{label:i.t("sheet.cf.panel.selectedRange"),value:"1"}],D=()=>{const z=n.getSubunitRules(f,h);if(!z||!z.length)return[];if(y==="1"){const Y=o.getCurrentLastSelection();if(!Y)return[];const ne=Y.range;return z.filter(pe=>pe.ranges.some(Ce=>d.Rectangle.intersects(Ce,ne)))}else if(y==="2")return[...z];return[]},[U,F]=w.useState(D);ae.useHighlightRange(v),w.useEffect(()=>{const z=a.onCommandExecuted(Y=>{Y.id===L.SetWorksheetActiveOperation.id&&_(Math.random())});return()=>z.dispose()}),w.useEffect(()=>{F(D)},[y,C,f,h]),w.useEffect(()=>{if(y==="2")return;const z=new Me.Observable(Y=>{const ne=[L.SetSelectionsOperation.id,l.AddConditionalRuleMutation.id,l.SetConditionalRuleMutation.id,l.DeleteConditionalRuleMutation.id,l.MoveConditionalRuleMutation.id],re=a.onCommandExecuted(pe=>{const{id:Ce,params:Oe}=pe,ke=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(Ce)&&Oe.unitId===ke&&Y.next(null)});return()=>re.dispose()}).pipe(Me.debounceTime(16)).subscribe(()=>{F(D)});return()=>{z.unsubscribe()}},[r,y,f,h]),w.useEffect(()=>{const z=n.$ruleChange.subscribe(()=>{_(Math.random())});return()=>z.unsubscribe()},[n]),w.useEffect(()=>{const z=()=>{var pe;const re=Math.max(0,(((pe=I.current)==null?void 0:pe.getBoundingClientRect().width)||0)-8);return jo=re,re},ne=new Me.Observable(re=>{const pe=document.querySelector(".univer-sidebar");if(pe){let Ce=setTimeout(()=>{re.next()},150);const Oe=()=>{Ce&&clearTimeout(Ce),Ce=null},ke=N=>{N.propertyName==="width"&&(Oe(),re.next())};return pe.addEventListener("transitionend",ke),()=>{Oe(),pe.removeEventListener("transitionend",ke)}}}).pipe(Me.debounceTime(16)).subscribe(()=>{T(z())});return()=>{ne.unsubscribe()}},[]);const X=z=>{var re;const Y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(re=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:re.getSheetId();if(!Y||!ne)throw new Error("No active sheet found");a.executeCommand(Tt.id,{unitId:Y,subUnitId:ne,cfId:z.cfId})},S=(z,Y)=>{x(Y.y)},M=(z,Y,ne)=>{var N;x(-1);const re=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),pe=(N=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:N.getSheetId();if(!re||!pe)throw new Error("No active sheet found");const Ce=k=>{const Z=U.length;return Math.min(Z-1,Math.max(0,k))},Oe=U[Ce(Y.y)].cfId,ke=U[Ce(ne.y)].cfId;Oe!==ke&&a.executeCommand(sn.id,{unitId:re,subUnitId:pe,start:{id:Oe,type:"self"},end:{id:ke,type:ne.y>Y.y?"after":"before"}})},W=()=>{t.onCreate()},te=()=>{y==="2"?a.executeCommand(ht.id):y==="1"&&U.map(Y=>({unitId:f,subUnitId:h,cfId:Y.cfId})).forEach(Y=>{a.executeCommand(Tt.id,Y)})},q=w.useMemo(()=>{const z=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),Y=z.getActiveSheet();return U.filter(ne=>{const re=ne.ranges;return L.checkRangesEditablePermission(u,z.getUnitId(),Y.getSheetId(),re)})},[U]),de=q.map((z,Y)=>({i:z.cfId,x:0,w:12,y:Y,h:1,isResizable:!1})),se=w.useMemo(()=>{const z=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),Y=z.getActiveSheet();return U.every(ne=>{const re=ne.ranges;return L.checkRangesEditablePermission(u,z.getUnitId(),Y.getSheetId(),re)})},[U]);return g.jsxs("div",{className:fe.cfRuleList,children:[g.jsxs("div",{className:fe.ruleSelector,children:[g.jsx("div",{children:s.tWithReactNode("sheet.cf.panel.managerRuleSelect",g.jsx($.Select,{className:fe.select,options:E,value:y,onChange:z=>{O(z)}})).map((z,Y)=>g.jsx("span",{children:z},Y))}),g.jsxs("div",{className:fe.btnList,children:[g.jsx($.Tooltip,{title:i.t("sheet.cf.panel.createRule"),placement:"bottom",children:g.jsx("div",{className:`${fe.icon}`,onClick:W,children:g.jsx(Or,{})})}),U.length&&se?g.jsx($.Tooltip,{title:i.t("sheet.cf.panel.clear"),placement:"bottom",children:g.jsx("div",{className:`${fe.gap} ${fe.icon}`,onClick:te,children:g.jsx(zt,{})})}):g.jsx("div",{className:`${fe.gap} ${fe.disabled}`,children:g.jsx(zt,{})})]})]}),g.jsx("div",{ref:I,className:fe.gridLayoutWrap,children:m?g.jsx(Ys,{onDragStop:M,onDragStart:S,layout:de,cols:12,rowHeight:60,width:m,margin:[0,10],draggableHandle:".draggableHandle",children:q==null?void 0:q.map((z,Y)=>g.jsx("div",{children:g.jsxs("div",{onMouseMove:()=>{z.ranges!==v&&b(z.ranges)},onMouseLeave:()=>b([]),onClick:()=>{e(z)},className:`${fe.ruleItem} ${R===Y?fe.active:""}`,children:[g.jsx("div",{className:`${fe.draggableHandle} draggableHandle`,onClick:ne=>ne.stopPropagation(),children:g.jsx(Mr,{})}),g.jsxs("div",{className:fe.ruleDescribe,children:[g.jsx("div",{className:fe.ruleType,children:Qs(z,i)}),g.jsx("div",{className:fe.ruleRange,children:z.ranges.map(ne=>bn.serializeRange(ne)).join(",")})]}),g.jsx("div",{className:fe.preview,children:g.jsx(lt,{rule:z.rule})}),g.jsx("div",{className:`${fe.deleteItem} ${R===Y?fe.active:""}`,onClick:ne=>{ne.stopPropagation(),X(z),b([])},children:g.jsx(zt,{})})]})},`${z.cfId}`))}):null})]})},It={type:d.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:n}=e,r=t.get(d.IUndoRedoService),o=t.get(d.ICommandService),a=t.get(l.ConditionalFormattingRuleModel),i=t.get(d.IUniverInstanceService),u=L.getSheetCommandTarget(i);if(!u)return!1;const{unitId:s,subUnitId:c}=u,f=a.createCfId(s,c),p={unitId:s,subUnitId:c,rule:{...n,cfId:n.cfId||f}},h=l.AddConditionalRuleMutationUndoFactory(t,p),v=o.syncExecuteCommand(l.AddConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:s,redoMutations:[{id:l.AddConditionalRuleMutation.id,params:p}],undoMutations:[h]}),v}},un={type:d.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const n=t.get(d.IUndoRedoService),r=t.get(d.ICommandService),o=t.get(d.IUniverInstanceService),a=L.getSheetCommandTarget(o,e);if(!a)return!1;const{unitId:i,subUnitId:u}=a,s={unitId:i,subUnitId:u,rule:e.rule},c=l.setConditionalRuleMutationUndoFactory(t,s),f=r.syncExecuteCommand(l.SetConditionalRuleMutation.id,s);return f&&n.pushUndoRedo({unitID:i,undoMutations:c,redoMutations:[{id:l.SetConditionalRuleMutation.id,params:s}]}),f}},yr={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Qe=t=>{const{color:e,onChange:n,disable:r=!1,iconId:o="PaintBucket",className:a,isNeedDropdownIcon:i=!0}=t,u=d.useDependency(ge.ComponentManager),s=w.useMemo(()=>new d.ColorKit(e),[e]),c=u.get(o);return c&&(r?g.jsx(c,{className:a,extend:{colorChannel1:s.isValid?e:"rgb(var(--primary-color))"}}):g.jsx($.Dropdown,{overlay:g.jsx("div",{className:`${yr.cfColorPicker} `,children:g.jsx($.ColorPicker,{color:e,onChange:n})}),children:g.jsxs("span",{className:`${yr.cfColorPickerIcon} ${a}`,children:[g.jsx(c,{extend:{colorChannel1:s.isValid?e:"rgb(var(--primary-color))"}}),i&&g.jsx(At,{className:yr.iconDropdown})]})}))},j={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},et=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Sr=t=>{var b;const{type:e,className:n,onChange:r,id:o,value:a}=t,i=d.useDependency(d.IUniverInstanceService),u=i.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),s=(b=i.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:b.getSheetId(),c=w.useMemo(()=>String(a).startsWith("=")?String(a):"=",[a]),f=w.useMemo(()=>[l.CFValueType.max,l.CFValueType.min,"none"].includes(e)?{disabled:!0}:[l.CFValueType.percent,l.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),p=w.useRef({}),[h,v]=w.useState(!1);return ge.useSidebarClick(y=>{var C;const O=(C=p.current)==null?void 0:C.handleOutClick;O&&O(y,()=>v(!1))}),e===l.CFValueType.formula?g.jsx("div",{style:{width:"100%",marginLeft:4},children:g.jsx(pt.FormulaEditor,{initValue:c,unitId:u,subUnitId:s,isFocus:h,onChange:(y="")=>{r(y||"")},onFocus:()=>v(!0),actions:p.current})}):g.jsx($.InputNumber,{className:n,value:Number(t.value)||0,onChange:y=>t.onChange(y||0),...f})},tl=t=>{var X;const{interceptorManager:e}=t,n=d.useDependency(d.LocaleService),r=((X=t.rule)==null?void 0:X.type)===l.CFRuleType.colorScale?t.rule:void 0,o=[et(l.CFValueType.num,n),et(l.CFValueType.percent,n),et(l.CFValueType.percentile,n),et(l.CFValueType.formula,n)],a=[et(l.CFValueType.min,n),...o],i=[et("none",n),...o],u=[et(l.CFValueType.max,n),...o],[s,c]=w.useState(()=>{var M;const S=l.CFValueType.min;return r&&((M=r.config[0])==null?void 0:M.value.type)||S}),[f,p]=w.useState(()=>{var M;const S="none";return!r||r.config.length!==3?S:((M=r.config[1])==null?void 0:M.value.type)||S}),[h,v]=w.useState(()=>{var M;const S=l.CFValueType.max;return r&&((M=r.config[r.config.length-1])==null?void 0:M.value.type)||S}),[b,y]=w.useState(()=>{if(!r)return 10;const M=r.config[0];return(M==null?void 0:M.value.value)===void 0?10:M==null?void 0:M.value.value}),[O,C]=w.useState(()=>{var W;if(!r||r.config.length!==3)return 50;const M=(W=r.config[1])==null?void 0:W.value.value;return M===void 0?50:M}),[_,R]=w.useState(()=>{var W;if(!r)return 90;const M=(W=r.config[r.config.length-1])==null?void 0:W.value.value;return M===void 0?90:M}),[x,m]=w.useState(()=>{var M;const S="#d0d9fb";return r&&((M=r.config[0])==null?void 0:M.color)||S}),[T,I]=w.useState(()=>{var M;const S="#7790f3";return!r||r.config.length!==3?S:((M=r.config[1])==null?void 0:M.color)||S}),[E,D]=w.useState(()=>{var M;const S="#2e55ef";return r&&((M=r.config[r.config.length-1])==null?void 0:M.color)||S}),U=w.useMemo(()=>S=>{const{minType:M,medianType:W,maxType:te,minValue:q,medianValue:de,maxValue:se,minColor:z,medianColor:Y,maxColor:ne}=S,re=[];return re.push({color:z,value:{type:M,value:q}}),W!=="none"&&re.push({color:Y,value:{type:W,value:de}}),re.push({color:ne,value:{type:te,value:se}}),{config:re.map((Ce,Oe)=>({...Ce,index:Oe})),type:l.CFRuleType.colorScale}},[]);w.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return U({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),[U,s,f,h,b,O,_,x,T,E,e]);const F=S=>{t.onChange(U(S))};return g.jsxs("div",{children:[g.jsx("div",{className:P.title,children:n.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:U({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})})}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.min")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:a,value:s,onChange:S=>{c(S);const M=l.createDefaultValueByValueType(S,10);y(M),F({minType:S,medianType:f,maxType:h,minValue:M,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Sr,{id:"min",className:`${P.mLXxs}`,value:b,type:s,onChange:S=>{y(S),F({minType:s,medianType:f,maxType:h,minValue:S,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Qe,{className:P.mLXxs,color:x,onChange:S=>{m(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:S,medianColor:T,maxColor:E})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.medianValue")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:i,value:f,onChange:S=>{p(S);const M=l.createDefaultValueByValueType(S,50);C(M),F({minType:s,medianType:S,maxType:h,minValue:b,medianValue:M,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Sr,{id:"median",className:` ${P.mLXxs}`,value:O,type:f,onChange:S=>{C(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:S,maxValue:_,minColor:x,medianColor:T,maxColor:E})}}),f!=="none"&&g.jsx(Qe,{className:P.mLXxs,color:T,onChange:S=>{I(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:S,maxColor:E})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.max")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.Select,{style:{flexShrink:0},options:u,value:h,onChange:S=>{v(S);const M=l.createDefaultValueByValueType(S,90);R(M),F({minType:s,medianType:f,maxType:S,minValue:b,medianValue:O,maxValue:M,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Sr,{id:"max",className:`${P.mLXxs}`,value:_,type:h,onChange:S=>{R(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:S,minColor:x,medianColor:T,maxColor:E})}}),g.jsx(Qe,{className:P.mLXxs,color:E,onChange:S=>{D(S),F({minType:s,medianType:f,maxType:h,minValue:b,medianValue:O,maxValue:_,minColor:x,medianColor:T,maxColor:S})}})]})]})},ct=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Lo=t=>{var y;const{onChange:e,className:n,value:r,type:o,id:a,disabled:i=!1}=t,u=d.useDependency(d.IUniverInstanceService),s=u.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),c=(y=u.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:y.getSheetId(),f=w.useRef({}),[p,h]=w.useState(!1);ge.useSidebarClick(O=>{var _;const C=(_=f.current)==null?void 0:_.handleOutClick;C&&C(O,()=>h(!1))});const v=w.useRef(r),b=w.useMemo(()=>[l.CFValueType.percentile,l.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===l.CFValueType.formula){const O=String(v.current).startsWith("=")?String(v.current)||"":"=";return g.jsx("div",{style:{width:"100%",marginLeft:12},children:g.jsx(pt.FormulaEditor,{initValue:O,unitId:s,subUnitId:c,isFocus:p,onChange:(C="")=>{e(C||"")},onFocus:()=>h(!0),actions:f.current})})}return g.jsx($.InputNumber,{className:n,value:Number(r)||0,disabled:i,onChange:O=>{e(O||0)},...b})},nl=t=>{var X;const{interceptorManager:e}=t,n=d.useDependency(d.LocaleService),r=((X=t.rule)==null?void 0:X.type)===l.CFRuleType.dataBar?t.rule:void 0,[o,a]=w.useState(()=>{var M;const S="0";return r?(M=r.config)!=null&&M.isGradient?"1":"0":S}),[i,u]=w.useState(()=>{var S;return r&&((S=r.config)==null?void 0:S.positiveColor)||l.defaultDataBarPositiveColor}),[s,c]=w.useState(()=>{var S;return r&&((S=r.config)==null?void 0:S.nativeColor)||l.defaultDataBarNativeColor}),f=[ct(l.CFValueType.num,n),ct(l.CFValueType.percent,n),ct(l.CFValueType.percentile,n),ct(l.CFValueType.formula,n)],p=[ct(l.CFValueType.min,n),...f],h=[ct(l.CFValueType.max,n),...f],[v,b]=w.useState(()=>{var M;const S=p[0].value;return r&&((M=r.config)==null?void 0:M.min.type)||S}),[y,O]=w.useState(()=>{var M;const S=h[0].value;return r&&((M=r.config)==null?void 0:M.max.type)||S}),[C,_]=w.useState(()=>{var W;if(!r)return 0;const M=((W=r.config)==null?void 0:W.min)||{};return M.type===l.CFValueType.formula?M.value||"=":M.value||0}),[R,x]=w.useState(()=>{var W;if(!r)return 100;const M=((W=r.config)==null?void 0:W.max)||{};return M.type===l.CFValueType.formula?M.value||"=":M.value===void 0?100:M.value}),[m,T]=w.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),I=S=>({config:{min:{type:S.minValueType,value:S.minValue},max:{type:S.maxValueType,value:S.maxValue},isGradient:S.isGradient==="1",positiveColor:S.positiveColor||l.defaultDataBarPositiveColor,nativeColor:S.nativeColor||l.defaultDataBarNativeColor},type:l.CFRuleType.dataBar,isShowValue:S.isShowValue});w.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return I({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}}),[o,C,v,R,y,i,s,e,m]);const E=S=>{t.onChange(I(S))},D=S=>{u(S),E({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:S,nativeColor:s,isShowValue:m})},U=S=>{c(S),E({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:S,isShowValue:m})},F=S=>f.map(M=>M.value).includes(S);return g.jsxs("div",{children:[g.jsx("div",{className:P.title,children:n.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:I({isGradient:o,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})})}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.fillType")}),g.jsxs("div",{className:`${P.mTSm} ${P.mLXxs} ${P.labelContainer} `,children:[g.jsxs($.RadioGroup,{value:o,onChange:S=>{a(S),E({isGradient:S,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})},children:[g.jsx($.Radio,{value:"0",children:g.jsx("span",{className:j.text,children:n.t("sheet.cf.panel.pureColor")})}),g.jsx($.Radio,{value:"1",children:g.jsx("span",{className:j.text,children:n.t("sheet.cf.panel.gradient")})})]}),g.jsxs("div",{className:`${j.utilItem} ${P.mLXl}`,children:[g.jsx($.Checkbox,{checked:!m,onChange:S=>{T(!S),E({isGradient:S,minValue:C,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:!S})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.panel.colorSet")}),g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm} ${P.mLXxs}`,children:[g.jsxs("div",{className:`${P.labelContainer}`,children:[g.jsx("div",{className:`${j.text}`,children:n.t("sheet.cf.panel.native")}),g.jsx(Qe,{color:s,onChange:U})]}),g.jsxs("div",{className:`${P.labelContainer} ${P.mLSm} `,children:[g.jsx("div",{className:`${j.text} `,children:n.t("sheet.cf.panel.positive")}),g.jsx(Qe,{color:i,onChange:D})]})]})]}),g.jsxs("div",{children:[g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.min")}),g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer}`,children:[g.jsx($.Select,{style:{width:"50%",flexShrink:0},options:p,value:v,onChange:S=>{b(S);const M=l.createDefaultValueByValueType(S,10);_(M),E({isGradient:o,minValue:M,minValueType:S,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}}),g.jsx(Lo,{disabled:!F(v),id:"min",type:v,className:P.mLSm,value:C,onChange:S=>{_(S||0),E({isGradient:o,minValue:S||0,minValueType:v,maxValue:R,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}})]}),g.jsx("div",{className:P.label,children:n.t("sheet.cf.valueType.max")}),g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer}`,children:[g.jsx($.Select,{style:{width:"50%",flexShrink:0},options:h,value:y,onChange:S=>{O(S);const M=l.createDefaultValueByValueType(S,90);x(M),E({isGradient:o,minValue:C,minValueType:v,maxValue:M,maxValueType:S,positiveColor:i,nativeColor:s,isShowValue:m})}}),g.jsx(Lo,{disabled:!F(y),id:"max",type:y,className:P.mLSm,value:R,onChange:S=>{x(S||0),E({isGradient:o,minValue:C,minValueType:v,maxValue:S||0,maxValueType:y,positiveColor:i,nativeColor:s,isShowValue:m})}})]})]})]})};function Vo(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=Vo(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function cn(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=Vo(t))&&(r&&(r+=" "),r+=e);return r}const Ae={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},dn=t=>[d.BooleanNumber.FALSE,void 0].includes(t)?d.BooleanNumber.TRUE:d.BooleanNumber.FALSE,fn=t=>t!==d.BooleanNumber.FALSE,br=t=>{const{style:e,onChange:n,className:r}=t,o=d.useDependency(ge.ComponentManager),[a,i]=w.useState(()=>{if(e!=null&&e.bl)return e.bl}),[u,s]=w.useState(()=>{if(e!=null&&e.it)return e.it}),[c,f]=w.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[p,h]=w.useState(()=>{if(e!=null&&e.st)return e.st.s}),[v,b]=w.useState(()=>{var T;const m="#2f56ef";return(T=e==null?void 0:e.cl)!=null&&T.rgb?e.cl.rgb:m}),[y,O]=w.useState(()=>{var T;const m="#e8ecfc";return(T=e==null?void 0:e.bg)!=null&&T.rgb?e.bg.rgb:m}),C=o.get("BoldSingle"),_=o.get("ItalicSingle"),R=o.get("UnderlineSingle"),x=o.get("StrikethroughSingle");return w.useEffect(()=>{const m={bl:a,it:u};v!==void 0&&(m.cl={rgb:v}),y!==void 0&&(m.bg={rgb:y}),p!==void 0&&(m.st={s:p}),c!==void 0&&(m.ul={s:c}),n(l.removeUndefinedAttr(m))},[a,u,c,p,v,y]),g.jsxs("div",{className:`${Ae.cfStyleEdit} ${r}`,children:[C&&g.jsx("div",{className:cn({[Ae.isActive]:fn(a||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>i(dn(a)),children:g.jsx(C,{})}),_&&g.jsx("div",{className:cn({[Ae.isActive]:fn(u||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>s(dn(u)),children:g.jsx(_,{})}),R&&g.jsx("div",{className:cn({[Ae.isActive]:fn(c||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>f(dn(c)),children:g.jsx(R,{})}),x&&g.jsx("div",{className:cn({[Ae.isActive]:fn(p||d.BooleanNumber.FALSE)},Ae.buttonItem),onClick:()=>h(dn(p)),children:g.jsx(x,{})}),g.jsx(Qe,{color:v,onChange:b,iconId:"FontColor"}),g.jsx(Qe,{color:y,onChange:O,iconId:"PaintBucket"})]})},rl=t=>{var x;const{onChange:e,interceptorManager:n}=t,r=d.useDependency(d.LocaleService),a=d.useDependency(d.IUniverInstanceService).getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),i=a.getActiveSheet(),u=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.highlightCell?t.rule:void 0,s=w.useRef(null),[c,f]=w.useState(!1),p=w.useRef({}),[h,v]=w.useState({}),[b,y]=w.useState(()=>(u==null?void 0:u.subType)===l.CFSubRuleType.formula?u.value:"="),[O,C]=w.useState(void 0),_=m=>({style:m.style,value:b,type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.formula});w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return _({style:h,formula:b})}}),[h,b,n]),w.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(T,I,E)=>O||b.length===1||!b.startsWith("=")?(C(r.t("sheet.cf.errorMessage.formulaError")),!1):E(T)}),[O,b]);const R=m=>{e(_(m))};return ge.useSidebarClick(m=>{var I;const T=(I=p.current)==null?void 0:I.handleOutClick;T&&T(m,()=>f(!1))}),g.jsxs("div",{ref:s,children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pt.FormulaEditor,{onChange:m=>{y(m),R({style:h,formula:m})},onVerify:(m,T)=>{!m||T.length===1?C(r.t("sheet.cf.errorMessage.formulaError")):C(void 0)},errorText:O,onFocus:()=>{f(!0)},actions:p.current,isFocus:c,initValue:b,unitId:a.getUnitId(),subUnitId:i==null?void 0:i.getSheetId()})}),g.jsx("div",{className:`${j.cfPreviewWrap} `,children:g.jsx(lt,{rule:_({style:h,formula:b})})}),g.jsx(br,{style:u==null?void 0:u.style,className:`${P.mTSm} `,onChange:m=>{v(m),R({style:m,formula:b})}})]})},pn=t=>g.jsxs("div",{style:{position:"relative"},children:[g.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ee=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),ol=t=>{const{type:e,operator:n,onChange:r,value:o,interceptorManager:a}=t,i=d.useDependency(d.LocaleService),[u,s]=w.useState(()=>typeof o=="number"?o:0),[c,f]=w.useState(""),[p,h]=w.useState(()=>typeof o=="string"?o:""),[v,b]=w.useState(""),[y,O]=w.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[C,_]=w.useState(""),[R,x]=w.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[m,T]=w.useState("");switch(w.useEffect(()=>{switch(e){case l.CFSubRuleType.text:{[l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(n)&&r(p);break}case l.CFSubRuleType.number:{[l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(n)&&r(u),[l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(n)&&r([y,R]);break}}},[e]),w.useEffect(()=>{const I=a.intercept(a.getInterceptPoints().beforeSubmit,{handler:(E,D,U)=>{switch(e){case l.CFSubRuleType.text:if([l.CFTextOperator.beginsWith,l.CFTextOperator.containsText,l.CFTextOperator.endsWith,l.CFTextOperator.notEqual,l.CFTextOperator.notContainsText,l.CFTextOperator.equal].includes(n))return p?U(E):(b(i.t("sheet.cf.errorMessage.notBlank")),!1)}return U(E)}});return()=>{I()}},[e,u,p,n]),e){case l.CFSubRuleType.text:{if([l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(n)){const I=E=>{h(E),r(E)};return g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pn,{errorText:v,children:g.jsx($.Input,{className:j.width100,value:p,onChange:E=>{b(""),I(E)}})})})}break}case l.CFSubRuleType.number:{if([l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(n)){const I=E=>{s(E||0),r(E||0),f("")};return g.jsx("div",{className:`${P.mTSm}`,children:g.jsx(pn,{errorText:c,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:j.width100,value:u,onChange:I})})})}if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(n)){const I=D=>{O(D||0),r([D||0,R]),_("")},E=D=>{x(D||0),r([y,D||0]),T("")};return g.jsxs("div",{className:`${P.mTSm} ${P.labelContainer} `,children:[g.jsx(pn,{errorText:C,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:y,onChange:I})}),g.jsx(pn,{errorText:m,children:g.jsx($.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`${P.mLSm}`,value:R,onChange:E})})]})}}}return null},Uo=(t,e)=>{switch(t){case l.CFSubRuleType.text:return[ee(l.CFTextOperator.containsText,e),ee(l.CFTextOperator.notContainsText,e),ee(l.CFTextOperator.beginsWith,e),ee(l.CFTextOperator.endsWith,e),ee(l.CFTextOperator.equal,e),ee(l.CFTextOperator.notEqual,e),ee(l.CFTextOperator.containsBlanks,e),ee(l.CFTextOperator.notContainsBlanks,e),ee(l.CFTextOperator.containsErrors,e),ee(l.CFTextOperator.notContainsErrors,e)];case l.CFSubRuleType.number:return[ee(l.CFNumberOperator.between,e),ee(l.CFNumberOperator.notBetween,e),ee(l.CFNumberOperator.equal,e),ee(l.CFNumberOperator.notEqual,e),ee(l.CFNumberOperator.greaterThan,e),ee(l.CFNumberOperator.greaterThanOrEqual,e),ee(l.CFNumberOperator.lessThan,e),ee(l.CFNumberOperator.lessThanOrEqual,e)];case l.CFSubRuleType.timePeriod:return[ee(l.CFTimePeriodOperator.yesterday,e),ee(l.CFTimePeriodOperator.today,e),ee(l.CFTimePeriodOperator.tomorrow,e),ee(l.CFTimePeriodOperator.last7Days,e),ee(l.CFTimePeriodOperator.lastWeek,e),ee(l.CFTimePeriodOperator.thisWeek,e),ee(l.CFTimePeriodOperator.nextWeek,e),ee(l.CFTimePeriodOperator.lastMonth,e),ee(l.CFTimePeriodOperator.thisMonth,e),ee(l.CFTimePeriodOperator.nextMonth,e)]}},zo=t=>{var x;const{interceptorManager:e,onChange:n}=t,r=d.useDependency(d.LocaleService),o=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.highlightCell?t.rule:void 0,[a,i]=w.useState(()=>{const m=l.CFSubRuleType.text;return o&&o.subType||m}),u=[{value:l.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:l.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:l.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:l.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:l.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],s=w.useMemo(()=>Uo(a,r),[a]),[c,f]=w.useState(()=>{const m=s?s[0].value:void 0;return o&&o.operator||m}),[p,h]=w.useState(()=>{var I;const m="";return o?(I=o.value)!=null?I:l.createDefaultValue(o.subType,o.operator):m}),[v,b]=w.useState({}),y=w.useMemo(()=>m=>{var T,I,E,D,U,F,X,S,M,W,te,q,de,se,z;switch(m.subType||a){case l.CFSubRuleType.text:{if([l.CFTextOperator.beginsWith,l.CFTextOperator.endsWith,l.CFTextOperator.containsText,l.CFTextOperator.notContainsText,l.CFTextOperator.equal,l.CFTextOperator.notEqual].includes(c))return{type:l.CFRuleType.highlightCell,subType:(T=m.subType)!=null?T:a,operator:(I=m.operator)!=null?I:c,style:(E=m.style)!=null?E:v,value:(D=m.value)!=null?D:p};break}case l.CFSubRuleType.number:{if([l.CFNumberOperator.equal,l.CFNumberOperator.notEqual,l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual,l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(c))return{type:l.CFRuleType.highlightCell,subType:(U=m.subType)!=null?U:a,operator:(F=m.operator)!=null?F:c,style:(X=m.style)!=null?X:v,value:(S=m.value)!=null?S:p};if([l.CFNumberOperator.between,l.CFNumberOperator.notBetween].includes(c))return{type:l.CFRuleType.highlightCell,subType:(M=m.subType)!=null?M:a,operator:(W=m.operator)!=null?W:c,style:(te=m.style)!=null?te:v,value:(q=m.value)!=null?q:p};break}}return{type:l.CFRuleType.highlightCell,subType:(de=m.subType)!=null?de:a,operator:(se=m.operator)!=null?se:c,style:(z=m.style)!=null?z:v}},[a,c,p,v]);w.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return y({})}}),[y,e]),w.useEffect(()=>{u.some(m=>m.value===a)||i(u[0].value)},[u]);const O=m=>{const T=m,I=Uo(T,r),E=I&&I[0].value;i(T),f(E),E&&h(l.createDefaultValue(T,E)),n(y({subType:T,operator:E}))},C=m=>{const T=m;f(T),n(y({operator:T}))},_=m=>{h(m),n(y({value:m}))},R=w.useMemo(()=>`${a}_${c}_${Math.random()}`,[a,c]);return g.jsxs("div",{children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx($.Select,{className:`${P.mTSm} ${j.width100}`,onChange:O,value:a,options:u}),(s==null?void 0:s.length)&&g.jsx($.Select,{className:`${P.mTSm} ${j.width100}`,onChange:C,value:c||"",options:s}),g.jsx(ol,{value:p,interceptorManager:e,type:a,operator:c,rule:o,onChange:_},R),g.jsx("div",{className:`${j.cfPreviewWrap}`,children:g.jsx(lt,{rule:y({})})}),g.jsx(br,{style:o==null?void 0:o.style,className:`${P.mLXxs}`,onChange:m=>{b(m),n(y({style:m}))}})]})},Ao=(t,e)=>(l.iconMap[t]||[])[Number(e)]||"",al=t=>{var s;const e=d.useDependency(d.IUniverInstanceService),n=e.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(s=e.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:s.getSheetId(),o=w.useMemo(()=>t.error?j.errorInput:"",[t.error]),a=w.useRef({}),[i,u]=w.useState(!1);return ge.useSidebarClick(c=>{var p;const f=(p=a.current)==null?void 0:p.handleOutClick;f&&f(c,()=>u(!1))}),g.jsx("div",{className:j.positionRelative,children:t.type!==l.CFValueType.formula?g.jsxs(g.Fragment,{children:[g.jsx($.InputNumber,{className:o,value:Number(t.value)||0,onChange:c=>t.onChange(c!=null?c:0)}),t.error&&g.jsx("div",{className:j.errorText,children:t.error})]}):g.jsx("div",{style:{width:"100%"},children:g.jsx(pt.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:i,onChange:(c="")=>{const f=c||"";t.onChange(f)},onFocus:()=>u(!0),actions:a.current})})})},ko=(t,e,n)=>({operator:l.CFNumberOperator.greaterThan,value:{type:l.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),il=w.forwardRef((t,e)=>{const n=d.useDependency(d.LocaleService),r=o=>{t.onClick(o)};return g.jsx("div",{ref:e,className:j.iconGroupList,children:l.iconGroup.map((o,a)=>g.jsxs("div",{className:j.group,children:[g.jsx("div",{className:j.title,children:n.t(o.title)}),g.jsx("div",{className:j.itemContent,children:o.group.map(i=>g.jsx("div",{className:j.itemWrap,onClick:()=>{r(i.name)},children:g.jsx("div",{className:j.item,children:i.list.map((u,s)=>g.jsx("img",{className:j.icon,src:u},s))})},i.name))})]},a))})}),sl=t=>{const e=w.useMemo(()=>{const r=[];for(const o in l.iconMap){const a=l.iconMap[o],i=o;a.forEach((u,s)=>{r.push({iconType:i,base64:u,iconId:String(s)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return g.jsxs("div",{className:j.iconItemListWrap,children:[g.jsxs("div",{className:j.none,onClick:()=>n({iconType:l.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[g.jsx(mt,{className:j.icon}),g.jsx("span",{children:"无单元格图标"})]}),g.jsx("div",{className:j.iconItemList,children:e.map(r=>g.jsx("div",{className:j.item,children:g.jsx("img",{onClick:()=>n(r),className:`${j.icon}`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},ll=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,o=d.useDependency(d.LocaleService),a=[{label:o.t(`sheet.cf.symbol.${l.CFNumberOperator.greaterThan}`),value:l.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${l.CFNumberOperator.greaterThanOrEqual}`),value:l.CFNumberOperator.greaterThanOrEqual}],i=[{label:o.t(`sheet.cf.valueType.${l.CFValueType.num}`),value:l.CFValueType.num},{label:o.t(`sheet.cf.valueType.${l.CFValueType.percent}`),value:l.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${l.CFValueType.percentile}`),value:l.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${l.CFValueType.formula}`),value:l.CFValueType.formula}],u=(p,h)=>{e([String(h),"value","value"],p)},s=(p,h)=>{e([String(h),"operator"],p);const v=l.createDefaultValue(l.CFSubRuleType.number,p);u(v,h)},c=(p,h)=>{e([String(h),"value","type"],p);const v=n[h],b=l.createDefaultValue(l.CFSubRuleType.number,v.operator);u(b,h)};return w.useMemo(()=>n.map((p,h)=>{const v=r[h],b=Ao(p.iconType,p.iconId),y=h===n.length-1,O=h===0,C=n[h-1],_=(C==null?void 0:C.value.type)===l.CFValueType.formula?o.t("sheet.cf.valueType.formula"):C==null?void 0:C.value.value,R=(x,m)=>{const T={...p,iconId:m,iconType:x};e([String(h)],T)};return g.jsxs("div",{className:`${h?P.mTXl:P.mTSm}`,children:[g.jsxs("div",{className:`${P.label} ${j.flex}`,children:[g.jsxs("div",{className:`${j.width45}`,children:[o.t("sheet.cf.iconSet.icon"),h+1]}),g.jsx("div",{className:`${j.width45}`,children:g.jsxs(g.Fragment,{children:[!O&&!y&&o.t("sheet.cf.iconSet.rule"),!O&&!y&&g.jsxs("span",{className:j.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${l.getOppositeOperator(C.operator)}`),_,y?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),g.jsxs("div",{className:`${j.flex} ${P.mTSm}`,children:[g.jsx("div",{className:`${j.iconWrap} ${j.width45}`,children:g.jsx($.Dropdown,{overlay:g.jsx(sl,{onClick:R,iconId:p.iconId,iconType:p.iconType}),children:g.jsxs("div",{className:j.dropdownIcon,children:[b?g.jsx("img",{src:b,className:j.icon}):g.jsx(mt,{className:j.icon}),g.jsx(At,{})]})})}),y?g.jsxs("div",{className:`${j.width45} ${P.label}`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),g.jsxs("span",{className:j.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${l.getOppositeOperator(C.operator)}`),_,y?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):g.jsx($.Select,{className:`${P.mL0} ${j.width45} ${P.mR0}`,options:a,value:p.operator,onChange:x=>{s(x,h)}})]}),y?g.jsx("div",{}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:`${P.mTSm} ${P.label} ${j.flex}`,children:[g.jsx("div",{className:`${j.width45}`,children:o.t("sheet.cf.iconSet.type")}),g.jsx("div",{className:`${j.width45}`,children:o.t("sheet.cf.iconSet.value")})]}),g.jsxs("div",{className:`${P.mTSm} ${j.flex}`,children:[g.jsx($.Select,{style:{flexShrink:0},className:`${j.width45} ${P.mL0}`,options:i,value:p.value.type,onChange:x=>{c(x,h)}}),g.jsx("div",{className:`${P.mL0} ${j.width45}`,children:g.jsx(al,{id:h,type:p.value.type,error:v,value:p.value.value||"",onChange:x=>u(x,h)})})]})]})]},h)}),[n,r])},ul=t=>{var x;const{interceptorManager:e}=t,n=((x=t.rule)==null?void 0:x.type)===l.CFRuleType.iconSet?t.rule:void 0,r=d.useDependency(d.LocaleService),[o,a]=w.useState({}),[i,u]=w.useState(()=>{const m=Object.keys(l.iconMap)[0];if(n&&n.config.length){const T=n.config[0].iconType;if(!n.config.some(E=>E.iconType!==T))return T}return m}),[s,c]=w.useState(()=>{if(n&&n.config.length)return d.Tools.deepClone(n==null?void 0:n.config);const m=l.iconMap[i]||[];return new Array(m.length).fill("").map((T,I,E)=>I===E.length-1?{operator:l.CFNumberOperator.lessThanOrEqual,value:{type:l.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:i,iconId:String(I)}:ko(i,I,E))}),[f,p]=w.useState(()=>n?!!n.isShowValue:!0),h=w.useMemo(()=>{const m=s.map(T=>Ao(T.iconType,T.iconId));return g.jsx("div",{className:j.iconWrap,children:m.map((T,I)=>T?g.jsx("img",{className:j.icon,src:T},I):g.jsx(mt,{className:j.icon},I))})},[s]),v=m=>{if(m.reduce((I,E,D)=>I.preType&&!I.result||m.length-1===D?I:E.value.type===l.CFValueType.formula?{preType:l.CFValueType.formula,result:!1}:I.preType?{result:I.preType===E.value.type,preType:E.value.type}:{result:!0,preType:E.value.type},{result:!0,preType:""}).result&&[l.CFValueType.num,l.CFValueType.percent,l.CFValueType.percentile].includes(m[0].value.type)){const I={};return m.forEach((E,D,U)=>{if(D-1<0||D===U.length-1)return;const X=m[D-1],S=l.getOppositeOperator(X.operator);l.compareWithNumber({operator:S,value:X.value.value},E.value.value)||(I[D]=`${r.t(`sheet.cf.form.${S}`,String(X.value.value))} `)}),I}return{}},b=(m,T)=>{d.get(s,m)!==T&&(d.set(s,m,T),c([...s]),a(v(s)))},y=m=>{u(m);const T=l.iconMap[m]||[],I=new Array(T.length).fill("").map((E,D,U)=>ko(m,D,U));c(I),a(v(I))};w.useEffect(()=>{const m=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:l.CFRuleType.iconSet,isShowValue:f,config:s}}});return()=>{m()}},[f,s,e]),w.useEffect(()=>{const m=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{m()}},[f,s,e,o]);const O=()=>{const m=s.map(T=>({...T}));s.forEach((T,I)=>{const E=s.length-1-I,D=m[E];T.iconId=D.iconId,T.iconType=D.iconType}),c([...s])},C=d.useDependency(ge.ILayoutService),[_,R]=w.useState();return ge.useScrollYOverContainer(_,C.rootContainerElement),g.jsxs("div",{className:j.iconSet,children:[g.jsx("div",{className:P.title,children:r.t("sheet.cf.panel.styleRule")}),g.jsx("div",{className:`${P.mTSm}`,children:g.jsx($.Dropdown,{placement:"bottomLeft",overlay:g.jsx(il,{ref:m=>!_&&m&&R(m),iconType:i,onClick:y}),children:g.jsxs("div",{className:j.dropdownIcon,style:{width:"unset"},children:[h,g.jsx(At,{})]})})}),g.jsxs("div",{className:`${P.mTSm} ${j.renderConfig}`,children:[g.jsxs("div",{className:j.utilItem,children:[g.jsx($.Checkbox,{onChange:O}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),g.jsxs("div",{className:`${j.utilItem} ${P.mLXl}`,children:[g.jsx($.Checkbox,{checked:!f,onChange:m=>{p(!m)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),g.jsx(ll,{errorMap:o,onChange:b,configList:s})]})},cl=t=>{var O;const{onChange:e,interceptorManager:n}=t,r=d.useDependency(d.LocaleService),o=((O=t.rule)==null?void 0:O.type)===l.CFRuleType.highlightCell?t.rule:void 0,a=[{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"}],[i,u]=w.useState(()=>{const C=a[0].value,_=o==null?void 0:o.type;if(!o)return C;switch(_){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.average:return[l.CFNumberOperator.greaterThan,l.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[l.CFNumberOperator.lessThan,l.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":C;case l.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return C}),[s,c]=w.useState(()=>{const _=o==null?void 0:o.type;if(!o)return 10;switch(_){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.rank:return o.value||10}}return 10}),[f,p]=w.useState(()=>{const _=o==null?void 0:o.type;if(!o)return!1;switch(_){case l.CFRuleType.highlightCell:switch(o.subType){case l.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[h,v]=w.useState({}),b=C=>{const{type:_,isPercent:R,value:x,style:m}=C;if(_==="isNotBottom")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:R,isBottom:!1,value:x,style:m};if(_==="isBottom")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank,isPercent:R,isBottom:!0,value:x,style:m};if(_==="greaterThanAverage")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:l.CFNumberOperator.greaterThan,style:m};if(_==="lessThanAverage")return{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.average,operator:l.CFNumberOperator.lessThan,style:m}};w.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return b({type:i,isPercent:f,value:s,style:h})}}),[i,f,s,h,n]);const y=C=>{e(b(C))};return g.jsxs("div",{children:[g.jsx("div",{className:`${P.title} ${P.mTBase}`,children:r.t("sheet.cf.panel.styleRule")}),g.jsx($.Select,{className:`${j.width100} ${P.mTSm}`,value:i,options:a,onChange:C=>{u(C),y({type:C,isPercent:f,value:s,style:h})}}),["isNotBottom","isBottom"].includes(i)&&g.jsxs("div",{className:`${P.labelContainer} ${P.mTSm}`,children:[g.jsx($.InputNumber,{min:1,max:1e3,value:s,onChange:C=>{const _=C||0;c(_),y({type:i,isPercent:f,value:_,style:h})}}),g.jsxs("div",{className:`${P.mLSm} ${P.labelContainer} ${j.text}`,children:[g.jsx($.Checkbox,{checked:f,onChange:C=>{p(!!C),y({type:i,isPercent:!!C,value:s,style:h})}}),r.t("sheet.cf.valueType.percent")]})]}),g.jsx("div",{className:`${j.cfPreviewWrap} `,children:g.jsx(lt,{rule:b({type:i,isPercent:f,value:s,style:h})})}),g.jsx(br,{style:o==null?void 0:o.style,className:`${P.mTSm} `,onChange:C=>{v(C),y({type:i,isPercent:f,value:s,style:C})}})]})},dl=d.createInterceptorKey("beforeSubmit"),fl=d.createInterceptorKey("submit"),Wo=t=>t.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),Ho=t=>{var e;return(e=t.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},pl=t=>{var U,F,X;const e=d.useDependency(d.LocaleService),n=d.useDependency(d.ICommandService),r=d.useDependency(d.IUniverInstanceService),o=d.useDependency(l.ConditionalFormattingRuleModel),a=d.useDependency(L.SheetsSelectionsService),i=Wo(r),u=Ho(r),[s,c]=w.useState(!0),f=w.useRef({}),[p,h]=w.useState(void 0),v=w.useRef((F=(U=t.rule)==null?void 0:U.ranges)!=null?F:[]),b=w.useMemo(()=>{var M,W,te;let S=(M=t.rule)==null?void 0:M.ranges;return S!=null&&S.length||(S=(te=(W=a.getCurrentSelections())==null?void 0:W.map(q=>q.range))!=null?te:[]),v.current=S,S!=null&&S.length?S.map(q=>{const de=bn.serializeRange(q);return de==="NaN"?"":de}).filter(q=>!!q).join(","):""},[t.rule]),y=[{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"}],[O,C]=w.useState(()=>{var W,te;const S=(W=t.rule)==null?void 0:W.rule.type,M=y[0].value;if(!S)return M;switch(S){case l.CFRuleType.highlightCell:{switch((te=t.rule)==null?void 0:te.rule.subType){case l.CFSubRuleType.number:case l.CFSubRuleType.text:case l.CFSubRuleType.duplicateValues:case l.CFSubRuleType.uniqueValues:case l.CFSubRuleType.timePeriod:return"1";case l.CFSubRuleType.average:case l.CFSubRuleType.rank:return"2";case l.CFSubRuleType.formula:return"5"}break}case l.CFRuleType.dataBar:return"3";case l.CFRuleType.colorScale:return"4";case l.CFRuleType.iconSet:return"6"}return M}),_=w.useRef(),R=w.useMemo(()=>new d.InterceptorManager({beforeSubmit:dl,submit:fl}),[]),x=w.useMemo(()=>{switch(O){case"1":return zo;case"2":return cl;case"3":return nl;case"4":return tl;case"5":return rl;case"6":return ul;default:return zo}},[O]);w.useEffect(()=>{const S=n.onCommandExecuted(M=>{if(M.id===L.RemoveSheetMutation.id){const W=M.params;W.subUnitId===u&&W.unitId===i&&t.onCancel()}M.id===L.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>S.dispose()},[]);const m=S=>{_.current=S},T=S=>{const M=S.split(",").filter(W=>!!W).map(bn.deserializeRangeWithSheet).map(W=>W.range);v.current=M},I=()=>{if(p)return;const M=(()=>{const te=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!te)throw new Error("No active sheet found");return v.current.map(se=>L.setEndForRange(se,te.getRowCount(),te.getColumnCount())).filter(se=>!(Number.isNaN(se.startRow)||Number.isNaN(se.startColumn)))})();if(R.fetchThroughInterceptors(R.getInterceptPoints().beforeSubmit)(!0,null)){const te=R.fetchThroughInterceptors(R.getInterceptPoints().submit)(null,null);if(te){const q=Wo(r),de=Ho(r);if(!q||!de)throw new Error("No active sheet found");let se={};t.rule&&t.rule.cfId?(se={...t.rule,ranges:M,rule:te},n.executeCommand(un.id,{unitId:q,subUnitId:de,rule:se}),t.onCancel()):(se={cfId:o.createCfId(q,de),ranges:M,rule:te,stopIfTrue:!1},n.executeCommand(It.id,{unitId:q,subUnitId:de,rule:se}),t.onCancel())}}},E=()=>{t.onCancel()},D=(S,M)=>{S?M.length<1?h(e.t("sheet.cf.errorMessage.rangeError")):h(void 0):h(e.t("sheet.cf.errorMessage.rangeError"))};return ge.useSidebarClick(S=>{var W;const M=(W=f.current)==null?void 0:W.handleOutClick;M&&M(S,()=>c(!1))}),g.jsxs("div",{className:j.cfRuleStyleEditor,children:[g.jsx("div",{className:P.title,children:e.t("sheet.cf.panel.range")}),g.jsx("div",{className:`${P.mTBase}`,children:g.jsx(pt.RangeSelector,{unitId:i,errorText:p,subUnitId:u,initValue:b,onChange:T,onVerify:D,onFocus:()=>c(!0),isFocus:s,actions:f.current})}),g.jsx("div",{className:P.title,children:e.t("sheet.cf.panel.styleType")}),g.jsx("div",{className:P.mTBase,children:g.jsx($.Select,{className:j.width100,value:O,options:y,onChange:S=>C(S)})}),g.jsx(x,{interceptorManager:R,rule:(X=t.rule)==null?void 0:X.rule,onChange:m}),g.jsxs("div",{className:`${P.mTBase} ${j.btnList}`,children:[g.jsx($.Button,{size:"small",onClick:E,children:e.t("sheet.cf.panel.cancel")}),g.jsx($.Button,{className:P.mLSm,size:"small",type:"primary",onClick:I,children:e.t("sheet.cf.panel.submit")})]})]})},hl=t=>{const[e,n]=w.useState(t.rule),[r,o]=w.useState(!!t.rule),a=()=>{o(!0)},i=()=>{o(!1),n(void 0)},u=s=>{n(s),o(!0)};return g.jsx("div",{className:P.conditionalFormattingWrap,children:r?g.jsx(pl,{onCancel:i,rule:e}):g.jsx(el,{onClick:u,onCreate:a})})};var ml=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,vl=(t,e,n,r)=>{for(var o=r>1?void 0:r?gl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&ml(e,n,o),o},wt=(t,e)=>(n,r)=>e(n,r,t);const hn="sheet.conditional.formatting.panel";let _t=class extends d.Disposable{constructor(e,n,r,o,a){super();Ge(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=o,this._localeService=a,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(d.UniverInstanceType.UNIVER_SHEET).subscribe(i=>{var u;i||(u=this._sidebarDisposable)==null||u.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(i=>{i.id===hn&&(i.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:hn,header:{title:this._localeService.t("sheet.cf.title")},children:{label:hn,rule:e,key:d.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(hn,hl)}};_t=vl([wt(0,d.IUniverInstanceService),wt(1,d.Inject(d.Injector)),wt(2,d.Inject(ge.ComponentManager)),wt(3,d.Inject(ge.ISidebarService)),wt(4,d.Inject(d.LocaleService))],_t);var we=(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))(we||{});const xt={id:"sheet.operation.open.conditional.formatting.panel",type:d.CommandType.OPERATION,handler:(t,e)=>{var u;const n=t.get(_t),r=t.get(L.SheetsSelectionsService),o=t.get(d.ICommandService),a=((u=r.getCurrentSelections())==null?void 0:u.map(s=>s.range))||[];switch(e.value){case 3:{n.openPanel({...l.createDefaultRule(),ranges:a});break}case 4:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.rank}};n.openPanel(s);break}case 5:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.highlightCell,subType:l.CFSubRuleType.formula,value:"="}};n.openPanel(s);break}case 6:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.colorScale,config:[]}};n.openPanel(s);break}case 7:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(s);break}case 8:{const s={...l.createDefaultRule,ranges:a,rule:{type:l.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(s);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...l.createDefaultRule(),ranges:a});break}case 9:{o.executeCommand(Vt.id,{ranges:a});break}case 10:{o.executeCommand(ht.id);break}}return!0}};var yl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,bl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Sl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&yl(e,n,o),o},dt=(t,e)=>(n,r)=>e(n,r,t);let Et=class extends d.Disposable{constructor(e,n,r,o,a,i){super();Ge(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=o,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=i,this._initViewModelInterceptor(),this._initViewModel(),this._initSkeleton(),this._initVmEffectByRule(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}markDirtySkeleton(){var n,r,o;const e=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(ae.SheetSkeletonManagerService).reCalculate(),(o=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton())),this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>["sort","delete"].includes(o.type)&&o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton())),this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(We.bufferTime(16),We.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(o=>o.unitId===n.getUnitId()&&o.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this.markDirtySkeleton()))}_initVmEffectByRule(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{rule:n,unitId:r,subUnitId:o}=e;switch(e.type){case"add":{this._handleRuleAdd(r,o,n);return}case"delete":{n.ranges.forEach(a=>{d.Range.foreach(a,(i,u)=>{this._conditionalFormattingViewModel.deleteCellCf(r,o,i,u,n.cfId)})}),this._conditionalFormattingViewModel.markRuleDirty(r,o,n);return}case"set":{this._handleRuleChange(r,o,n,e.oldRule);return}case"sort":{const i=this._conditionalFormattingRuleModel.getSubunitRules(r,o).map(u=>u.cfId).reduce((u,s,c)=>(u.set(s,c),u),new Map);n.ranges.forEach(u=>{d.Range.foreach(u,(s,c)=>{this._conditionalFormattingViewModel.sortCellCf(r,o,s,c,i)})})}}}))}_initViewModel(){let e=!1;this._univerInstanceService.getAllUnitsForType(d.UniverInstanceType.UNIVER_SHEET).forEach(r=>{const o=r.getUnitId(),a=this._conditionalFormattingRuleModel.getUnitRules(o);a&&[...a.keys()].forEach(i=>{a.get(i).forEach(s=>{this._handleRuleAdd(o,i,s),e=!0})})}),e&&this.markDirtySkeleton()}_handleRuleAdd(e,n,r){const a=this._conditionalFormattingRuleModel.getSubunitRules(e,n).map(i=>i.cfId).reduce((i,u,s)=>(i.set(u,s),i),new Map);r.ranges.forEach(i=>{d.Range.foreach(i,(u,s)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,u,s,r.cfId),this._conditionalFormattingViewModel.sortCellCf(e,n,u,s,a)})}),this._conditionalFormattingViewModel.markRuleDirty(e,n,r)}_handleRuleChange(e,n,r,o){const i=this._conditionalFormattingRuleModel.getSubunitRules(e,n).map(c=>c.cfId).reduce((c,f,p)=>(c.set(f,p),c),new Map),u=(c,f)=>{c.ranges.forEach(p=>{d.Range.foreach(p,(h,v)=>{this._conditionalFormattingViewModel.deleteCellCf(e,n,h,v,c.cfId)})}),f.ranges.forEach(p=>{d.Range.foreach(p,(h,v)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,h,v,c.cfId),this._conditionalFormattingViewModel.sortCellCf(e,n,h,v,i)})})},s=this._conditionalFormattingService.interceptorManager.intercept(this._conditionalFormattingService.interceptorManager.getInterceptPoints().beforeUpdateRuleResult,{handler:(c,f,p)=>{if(e===(c==null?void 0:c.unitId)&&n===c.subUnitId&&o.cfId===c.cfId){(this._ruleChangeCacheMap.get(c.cfId)||[]).forEach(v=>{u(v.oldRule,v.rule),v.dispose()}),this._ruleChangeCacheMap.delete(c.cfId);return}p(c)}});if(o.cfId===r.cfId){let c=this._ruleChangeCacheMap.get(o.cfId);c||(c=[],this._ruleChangeCacheMap.set(o.cfId,c)),c.push({oldRule:o,rule:r,dispose:s})}r.ranges.forEach(c=>{d.Range.foreach(c,(f,p)=>{this._conditionalFormattingViewModel.pushCellCf(e,n,f,p,o.cfId)})}),this._conditionalFormattingViewModel.markRuleDirty(e,n,r)}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(L.INTERCEPTOR_POINT.CELL_CONTENT,{effect:d.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const o=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!o)return r(e);const a=n.workbook.getStyles(),u={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},s={...e,s:u};return o.style&&Object.assign(u,o.style),s.fontRenderExtension||(s.fontRenderExtension={},o.isShowValue!==void 0&&(s.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(s.dataBar=o.dataBar),o.iconSet&&(s.iconSet=o.iconSet,s.fontRenderExtension.leftOffset=l.DEFAULT_PADDING+l.DEFAULT_WIDTH),r(s)},priority:10}))}};Et=bl([dt(0,d.Inject(L.SheetInterceptorService)),dt(1,d.Inject(l.ConditionalFormattingService)),dt(2,d.Inject(d.IUniverInstanceService)),dt(3,d.Inject(ta.IRenderManagerService)),dt(4,d.Inject(l.ConditionalFormattingViewModel)),dt(5,d.Inject(l.ConditionalFormattingRuleModel))],Et);var Rl=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,Tl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Cl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Rl(e,n,o),o},Ot=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends d.Disposable{constructor(e,n,r,o,a){super();Ge(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=o,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,o)=>{const{copyType:a=ae.COPY_TYPE.COPY,pasteType:i}=o,{range:u}=e||{},{range:s}=n;return this._generateConditionalFormattingMutations(s,{copyType:a,pasteType:i,copyRange:u})}}))}_collectConditionalRule(e,n,r){const o=new d.ObjectMatrix,a={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:n,cfMap:a}};const i=this._conditionalFormattingViewModel.getMatrix(e,n);if(!i)return;const u=this._injector.invoke(p=>ae.rangeToDiscreteRange(r,p,e,n));if(!u)return;const{rows:s,cols:c}=u,f=new Set;s.forEach((p,h)=>{c.forEach((v,b)=>{const y=this._conditionalFormattingViewModel.getCellCf(e,n,p,v,i);y&&(y.cfList.forEach(O=>f.add(O.cfId)),o.setValue(h,b,y.cfList.map(O=>O.cfId)))})}),f.forEach(p=>{const h=this._conditionalFormattingRuleModel.getRule(e,n,p);h&&(a[p]=h.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),o=r.getActiveSheet(),a=r.getUnitId();if(!o)return{redos:[],undos:[]};const i=o.getSheetId();if(n.copyType===ae.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![ae.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,ae.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,ae.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[u,s],mapFunc:c}=ae.virtualizeDiscreteRanges([n.copyRange,e]),f=ae.getRepeatRange(u,s,!0),p=this._conditionalFormattingViewModel.getMatrix(a,i),h={};d.Range.foreach(s,(m,T)=>{const{row:I,col:E}=c(m,T),D=this._conditionalFormattingViewModel.getCellCf(a,i,I,E,p);D&&D.cfList.forEach(U=>{if(!h[U.cfId]){const F=new d.ObjectMatrix;h[U.cfId]=F;const X=this._conditionalFormattingRuleModel.getRule(a,i,U.cfId);X==null||X.ranges.forEach(S=>{d.Range.foreach(S,(M,W)=>{F.setValue(M,W,1)})})}h[U.cfId].realDeleteValue(I,E)})});const{matrix:v,info:b}=this._copyInfo,y=[];let O=this._conditionalFormattingRuleModel.createCfId(a,i);const C={},_=m=>{if(C[m])return C[m];const T=b==null?void 0:b.cfMap[m],I=[...this._conditionalFormattingRuleModel.getSubunitRules(a,i)||[],...y].find(E=>d.Tools.diffValue(E.rule,T));if(I)return C[m]=I,I;{const E={rule:T,cfId:O,ranges:[],stopIfTrue:!1};return C[m]=E,y.push(E),O=`${Number(O)+1}`,E}};f.forEach(m=>{v&&v.forValue((T,I,E)=>{const D=d.Rectangle.getPositionRange({startRow:T,endRow:T,startColumn:I,endColumn:I},m.startRange),{row:U,col:F}=c(D.startRow,D.startColumn);E.forEach(X=>{if(!h[X]){const S=_(X),M=new d.ObjectMatrix;h[X]=M,S.ranges.forEach(W=>{d.Range.foreach(W,(te,q)=>{M.setValue(te,q,1)})})}h[X].setValue(U,F,1)})})});const R=[],x=[];for(const m in h){const T=h[m],I=L.findAllRectangle(L.createTopMatrixFromMatrix(T));if(!I.length){const E={unitId:a,subUnitId:i,cfId:m};R.push({id:l.DeleteConditionalRuleMutation.id,params:E}),x.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,E))}if(y.some(E=>E.cfId===m)){const E=_(m),D={unitId:a,subUnitId:i,rule:{...E,ranges:I}};R.push({id:l.AddConditionalRuleMutation.id,params:D}),x.push(l.AddConditionalRuleMutationUndoFactory(this._injector,D))}else{const E=this._conditionalFormattingRuleModel.getRule(a,i,m);if(!E)continue;const D={unitId:a,subUnitId:i,rule:{...E,ranges:I}};R.push({id:l.SetConditionalRuleMutation.id,params:D}),x.push(...l.setConditionalRuleMutationUndoFactory(this._injector,D))}}return{redos:R,undos:x}}};Mt=Tl([Ot(0,d.Inject(ae.ISheetClipboardService)),Ot(1,d.Inject(l.ConditionalFormattingRuleModel)),Ot(2,d.Inject(d.Injector)),Ot(3,d.Inject(l.ConditionalFormattingViewModel)),Ot(4,d.Inject(d.IUniverInstanceService))],Mt);var Il=Object.defineProperty,wl=Object.getOwnPropertyDescriptor,_l=(t,e,n,r)=>{for(var o=r>1?void 0:r?wl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Il(e,n,o),o},mn=(t,e)=>(n,r)=>e(n,r,t);let Pt=class extends d.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,o,a)=>`${r}_${o}_${a}`,n=(r,o,a)=>{const i=s=>{const c=[...a.ranges],f=c.map(h=>L.handleDefaultRangeChangeWithEffectRefCommands(h,s)).filter(h=>!!h);if(l.isRangesEqual(f,c))return{redos:[],undos:[]};if(f.length){const h={unitId:r,subUnitId:o,rule:{...a,ranges:f}},v=[{id:l.SetConditionalRuleMutation.id,params:h}],b=l.setConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:b}}else{const h={unitId:r,subUnitId:o,cfId:a.cfId},v=[{id:l.DeleteConditionalRuleMutation.id,params:h}],b=l.DeleteConditionalRuleMutationUndoFactory(this._injector,h);return{redos:v,undos:b}}},u=[];a.ranges.forEach(s=>{const c=this._refRangeService.registerRefRange(s,i);u.push(()=>c.dispose())}),t.set(e(r,o,a.cfId),()=>u.forEach(s=>s()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:o,subUnitId:a,rule:i}=r,u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet();if(!(r.unitId!==u.getUnitId()||r.subUnitId!==(s==null?void 0:s.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const c=t.get(e(o,a,i.cfId));c&&c();break}case"set":{const c=t.get(e(o,a,i.cfId));c&&c(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(d.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};Pt=_l([mn(0,d.Inject(l.ConditionalFormattingRuleModel)),mn(1,d.Inject(d.IUniverInstanceService)),mn(2,d.Inject(d.Injector)),mn(3,d.Inject(L.RefRangeService))],Pt);var xl=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Ol=(t,e,n,r)=>{for(var o=r>1?void 0:r?El(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&xl(e,n,o),o},Rr=(t,e)=>(n,r)=>e(n,r,t);let Dt=class extends d.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionInterceptorBaseController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===It.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[L.WorkbookEditablePermission],rangeTypes:[L.RangeProtectionPermissionEditPoint],worksheetTypes:[L.WorksheetEditPermission,L.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};Dt=Ol([Rr(0,d.Inject(d.LocaleService)),Rr(1,d.ICommandService),Rr(2,d.Inject(ae.SheetPermissionInterceptorBaseController))],Dt);const Fo="sheets-conditional-formatting-ui.config",Bo={};var Go=Object.defineProperty,Ml=Object.getOwnPropertyDescriptor,Pl=(t,e,n)=>e in t?Go(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Dl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ml(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Go(e,n,o),o},Cr=(t,e)=>(n,r)=>e(n,r,t),$o=(t,e,n)=>Pl(t,typeof e!="symbol"?e+"":e,n);V.UniverSheetsConditionalFormattingMobileUIPlugin=class extends d.Plugin{constructor(e=Bo,n,r,o){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=o;const{menu:a,...i}=this._config;a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Fo,i),this._initCommand(),this._injector.add([Et]),this._injector.add([Pt]),this._injector.add([Mt]),this._injector.add([Dt]),this._injector.add([ut])}_initCommand(){[Rn,Cn,Tn,In,wn,_n,xn,En,On,xt,Tt,un,sn,It,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}},$o(V.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${l.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),$o(V.UniverSheetsConditionalFormattingMobileUIPlugin,"type",d.UniverInstanceType.UNIVER_SHEET),V.UniverSheetsConditionalFormattingMobileUIPlugin=Dl([d.DependentOn(l.UniverSheetsConditionalFormattingPlugin),Cr(1,d.Inject(d.Injector)),Cr(2,d.Inject(d.ICommandService)),Cr(3,d.IConfigService)],V.UniverSheetsConditionalFormattingMobileUIPlugin);var Nl=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ll=(t,e,n,r)=>{for(var o=r>1?void 0:r?jl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Nl(e,n,o),o},Nt=(t,e)=>(n,r)=>e(n,r,t);let gn=class extends d.Disposable{constructor(t,e,n,r,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,a,i,u,s)=>{var v;const c=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getUnitId(),f=(v=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:v.getSheetId();if(!c||!f)return;const p={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},h={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};d.Range.foreach(i,(b,y)=>{const O=d.Rectangle.getPositionRange({startRow:b,startColumn:y,endColumn:y,endRow:b},p),C=d.Rectangle.getPositionRange({startRow:b,startColumn:y,endColumn:y,endRow:b},h),{row:_,col:R}=s(O.startRow,O.startColumn),x=this._conditionalFormattingViewModel.getCellCf(c,f,_,R),{row:m,col:T}=s(C.startRow,C.startColumn),I=this._conditionalFormattingViewModel.getCellCf(c,f,m,T);I&&I.cfList.forEach(E=>{let D=u.get(E.cfId);if(!u.get(E.cfId)){const U=this._conditionalFormattingRuleModel.getRule(c,f,E.cfId);if(!U)return;D=new d.ObjectMatrix,U.ranges.forEach(F=>{d.Range.foreach(F,(X,S)=>{D.setValue(X,S,1)})}),u.set(E.cfId,D)}D.realDeleteValue(m,T)}),x&&x.cfList.forEach(E=>{let D=u.get(E.cfId);if(!u.get(E.cfId)){const U=this._conditionalFormattingRuleModel.getRule(c,f,E.cfId);if(!U)return;D=new d.ObjectMatrix,U.ranges.forEach(F=>{d.Range.foreach(F,(X,S)=>{D.setValue(X,S,1)})}),u.set(E.cfId,D)}D.setValue(m,T,1)})})},n=(o,a)=>{var C,_,R;const i=(C=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getUnitId(),u=(R=(_=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:_.getActiveSheet())==null?void 0:R.getSheetId(),s=new Map,c=[],f=[];if(!i||!u)return t();const p=ae.virtualizeDiscreteRanges([o,a]),[h,v]=p.ranges,{mapFunc:b}=p,y={row:h.startRow,col:h.startColumn};return ae.getAutoFillRepeatRange(h,v).forEach(x=>{e(y,x.repeatStartCell,x.relativeRange,s,b)}),s.forEach((x,m)=>{const T=this._conditionalFormattingRuleModel.getRule(i,u,m);if(!T)return;const I=L.findAllRectangle(L.createTopMatrixFromMatrix(x));if(I.length){const E={unitId:i,subUnitId:u,rule:{...T,ranges:I}};c.push({id:l.SetConditionalRuleMutation.id,params:E}),f.push(...l.setConditionalRuleMutationUndoFactory(this._injector,E))}else{const E={unitId:i,subUnitId:u,cfId:T.cfId};c.push({id:l.DeleteConditionalRuleMutation.id,params:E}),f.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,E))}}),{undos:f,redos:c}},r={id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,a,i)=>{if(i===ae.APPLY_TYPE.COPY||i===ae.APPLY_TYPE.ONLY_FORMAT||i===ae.APPLY_TYPE.SERIES){const{source:u,target:s}=o;return n(u,s)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};gn=Ll([Nt(0,d.Inject(d.Injector)),Nt(1,d.Inject(d.IUniverInstanceService)),Nt(2,d.Inject(ae.IAutoFillService)),Nt(3,d.Inject(l.ConditionalFormattingRuleModel)),Nt(4,d.Inject(l.ConditionalFormattingViewModel))],gn);var Vl=Object.defineProperty,Ul=Object.getOwnPropertyDescriptor,zl=(t,e,n,r)=>{for(var o=r>1?void 0:r?Ul(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Vl(e,n,o),o},jt=(t,e)=>(n,r)=>e(n,r,t);V.ConditionalFormattingClearController=class extends d.Disposable{constructor(e,n,r,o,a){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=o,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var a;const n=[],r=[],o={redos:n,undos:r};if([L.ClearSelectionFormatCommand.id,L.ClearSelectionAllCommand.id].includes(e.id)){const i=(a=this._selectionManagerService.getCurrentSelections())==null?void 0:a.map(b=>b.range);if(!i)return o;const u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET),s=u.getActiveSheet();if(!s)return o;const c=u.getUnitId(),f=s.getSheetId(),p=this._conditionalFormattingRuleModel.getSubunitRules(c,f);if(!p||!p.length)return o;const{redos:h,undos:v}=Xo(this._injector,p,i,c,f);n.push(...h),r.push(...v)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const o=[],a=[],i={redos:o,undos:a};if(!r||!r.length)return i;const u=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!u||!u.length)return i;const{redos:s,undos:c}=Xo(this._injector,u,r,e,n);return o.push(...s),a.push(...c),i}}))}},V.ConditionalFormattingClearController=zl([jt(0,d.Inject(d.Injector)),jt(1,d.Inject(d.IUniverInstanceService)),jt(2,d.Inject(L.SheetInterceptorService)),jt(3,d.Inject(L.SheetsSelectionsService)),jt(4,d.Inject(l.ConditionalFormattingRuleModel))],V.ConditionalFormattingClearController);function Xo(t,e,n,r,o){const a=[],i=[];return e.filter(u=>n.some(s=>u.ranges.some(c=>d.Rectangle.getIntersects(c,s)))).forEach(u=>{const c=new L.RangeMergeUtil().add(...u.ranges).subtract(...n).merge();if(c.length){const f={id:l.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:o,rule:{...u,ranges:c}}},p=l.setConditionalRuleMutationUndoFactory(t,f.params);a.push(f),i.push(...p)}else{const f={id:l.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:o,cfId:u.cfId}},p=l.DeleteConditionalRuleMutationUndoFactory(t,f.params);a.push(f),i.push(...p)}}),{redos:a,undos:i}}var Al=Object.defineProperty,kl=Object.getOwnPropertyDescriptor,Wl=(t,e,n,r)=>{for(var o=r>1?void 0:r?kl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Al(e,n,o),o},Yo=(t,e)=>(n,r)=>e(n,r,t);let vn=class extends d.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(d.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(L.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var o,a;const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col);if(r!=null&&r.style&&(t!=null&&t.p)){const i=Object.keys(r==null?void 0:r.style);if(i.length>0){const u=d.BuildTextUtils.transform.getPlainText((a=(o=t.p.body)==null?void 0:o.dataStream)!=null?a:""),s={...(typeof t.s=="string"?e.workbook.getStyles().get(t.s):t.s)||{}};i.forEach(f=>{delete s[f]});const c={...t,s:{...s},v:u};return delete c.p,n(c)}}return n(t)}})))}};vn=Wl([Yo(0,d.Inject(L.SheetInterceptorService)),Yo(1,d.Inject(l.ConditionalFormattingService))],vn);const qo=[L.SetWorksheetActiveOperation.id,l.AddConditionalRuleMutation.id,l.SetConditionalRuleMutation.id,l.DeleteConditionalRuleMutation.id,l.MoveConditionalRuleMutation.id],Lt=[{label:"sheet.cf.ruleType.highlightCell",value:we.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:we.rank},{label:"sheet.cf.ruleType.formula",value:we.formula},{label:"sheet.cf.ruleType.colorScale",value:we.colorScale},{label:"sheet.cf.ruleType.dataBar",value:we.dataBar},{label:"sheet.cf.ruleType.iconSet",value:we.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:we.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:we.createRule},{label:"sheet.cf.menu.clearRangeRules",value:we.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:we.clearWorkSheetRules}],Hl=t=>{const e=t.get(L.SheetsSelectionsService),n=t.get(d.ICommandService),r=t.get(d.IUniverInstanceService),o=t.get(l.ConditionalFormattingRuleModel),a=new Me.Observable(s=>Me.merge(e.selectionMoveEnd$,new Me.Observable(c=>{const f=n.onCommandExecuted(p=>{var y;const{id:h,params:v}=p,b=(y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getUnitId();qo.includes(h)&&v.unitId===b&&c.next(null)});return()=>f.dispose()})).pipe(We.debounceTime(16)).subscribe(()=>{var y;const c=((y=e.getCurrentSelections())==null?void 0:y.map(O=>O.range))||[],f=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!f)return;const p=f.getActiveSheet();if(!p)return;const b=(o.getSubunitRules(f.getUnitId(),p.getSheetId())||[]).filter(O=>O.ranges.some(C=>c.some(_=>d.Rectangle.intersects(_,C)))).map(O=>O.ranges).every(O=>L.checkRangesEditablePermission(t,f.getUnitId(),p.getSheetId(),O));s.next(b)})),i=new Me.Observable(s=>new Me.Observable(c=>{const f=n.onCommandExecuted(p=>{var y;const{id:h,params:v}=p,b=(y=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getUnitId();qo.includes(h)&&v.unitId===b&&c.next(null)});return()=>f.dispose()}).pipe(We.debounceTime(16)).subscribe(()=>{const c=r.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET);if(!c)return;const f=c.getActiveSheet();if(!f)return;const p=o.getSubunitRules(c.getUnitId(),f.getSheetId())||[];if(!p.length)return s.next(!1),!1;const h=p.map(v=>v.ranges).every(v=>L.checkRangesEditablePermission(t,c.getUnitId(),f.getSheetId(),v));s.next(h)})),u=new Me.Observable(s=>{a.subscribe(c=>{const f=Lt.find(p=>p.value===we.clearRangeRules);f&&(f.disabled=!c,s.next(Lt))}),i.subscribe(c=>{const f=Lt.find(p=>p.value===we.clearWorkSheetRules);f&&(f.disabled=!c,s.next(Lt))}),s.next(Lt)});return{id:xt.id,type:ge.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:u,hidden$:ge.getMenuHiddenObservable(t,d.UniverInstanceType.UNIVER_SHEET),disabled$:ae.getCurrentRangeDisable$(t,{workbookTypes:[L.WorkbookEditablePermission],worksheetTypes:[L.WorksheetSetCellStylePermission,L.WorksheetEditPermission],rangeTypes:[L.RangeProtectionPermissionEditPoint]})}},Fl={[ge.RibbonStartGroup.FORMULAS_INSERT]:{[xt.id]:{order:0,menuItemFactory:Hl}}};var Bl=Object.defineProperty,Gl=Object.getOwnPropertyDescriptor,$l=(t,e,n,r)=>{for(var o=r>1?void 0:r?Gl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Bl(e,n,o),o},Ko=(t,e)=>(n,r)=>e(n,r,t);let yn=class extends d.Disposable{constructor(e,n){super();Ge(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(Fl)}};yn=$l([Ko(0,d.Inject(d.Injector)),Ko(1,ge.IMenuManagerService)],yn);var Xl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,ql=(t,e,n,r)=>{for(var o=r>1?void 0:r?Yl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Xl(e,n,o),o},ft=(t,e)=>(n,r)=>e(n,r,t);const Kl=(t,e)=>{const n=f=>f.endRow-f.startRow+1,r=f=>f.endColumn-f.startColumn+1,o=n(e)%n(t),a=r(e)%r(t),i=Math.floor(n(e)/n(t)),u=Math.floor(r(e)/r(t)),s=[],c={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const f={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return s.push({repeatRelativeRange:c,startRange:f}),s}for(let f=0;f<i+(o?.1:0);f++)for(let p=0;p<u+(a?.1:0);p++){const h=n(t)*f,v=r(t)*p,b={startRow:h+e.startRow,endRow:h+e.startRow,startColumn:v+e.startColumn,endColumn:v+e.startColumn};let y=c;f===i&&o&&(y={...y},y.endRow=y.endRow-(n(t)-o)),p===u&&a&&(y={...y},y.endColumn=y.endColumn-(r(t)-a)),s.push({repeatRelativeRange:y,startRange:b})}return s};let Sn=class extends d.Disposable{constructor(e,n,r,o,a,i){super();Ge(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=a,this._conditionalFormattingViewModel=i,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(a,i,u,s,c)=>{const{unitId:f,subUnitId:p}=this._painterConfig,{targetUnitId:h,targetSubUnitId:v}=c,b={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},y={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};d.Range.foreach(u,(O,C)=>{const _=d.Rectangle.getPositionRange({startRow:O,startColumn:C,endColumn:C,endRow:O},b),R=d.Rectangle.getPositionRange({startRow:O,startColumn:C,endColumn:C,endRow:O},y),x=this._conditionalFormattingViewModel.getCellCf(f,p,_.startRow,_.startColumn),m=this._conditionalFormattingViewModel.getCellCf(h,v,R.startRow,R.startColumn);m&&m.cfList.forEach(T=>{let I=s.get(T.cfId);if(!s.get(T.cfId)){const E=this._conditionalFormattingRuleModel.getRule(h,v,T.cfId);if(!E)return;I=new d.ObjectMatrix,E.ranges.forEach(D=>{d.Range.foreach(D,(U,F)=>{I.setValue(U,F,1)})}),s.set(T.cfId,I)}I.realDeleteValue(R.startRow,R.startColumn)}),x&&x.cfList.forEach(T=>{const I=s.get(T.cfId);I&&I.setValue(R.startRow,R.startColumn,1)})})},r=(a,i,u)=>{var _;const{range:s,unitId:c,subUnitId:f}=this._painterConfig,p=a!==c||f!==i,h=new Map,v=[],b=[];if(!a||!i||!c||!f)return e();const y=(_=this._conditionalFormattingRuleModel.getSubunitRules(c,f))!=null?_:[];y==null||y.forEach(R=>{const{ranges:x,cfId:m}=R;if(x.some(T=>d.Rectangle.intersects(s,T))){const T=new d.ObjectMatrix;p||x.forEach(I=>{d.Range.foreach(I,(E,D)=>{T.setValue(E,D,1)})}),h.set(m,T)}});const O={row:s.startRow,col:s.startColumn};return Kl(s,u).forEach(R=>{n(O,{row:R.startRange.startRow,col:R.startRange.startColumn},R.repeatRelativeRange,h,{targetUnitId:a,targetSubUnitId:i})}),h.forEach((R,x)=>{if(p){const m=this._conditionalFormattingRuleModel.getRule(a,i,x),T=L.findAllRectangle(L.createTopMatrixFromMatrix(R));if(m)if(T.length){const I={unitId:a,subUnitId:i,rule:{...m,ranges:T}};v.push({id:l.SetConditionalRuleMutation.id,params:I}),b.push(...l.setConditionalRuleMutationUndoFactory(this._injector,I))}else{const I={unitId:a,subUnitId:i,cfId:m.cfId};v.push({id:l.DeleteConditionalRuleMutation.id,params:I}),b.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}else if(T.length){const I=this._conditionalFormattingRuleModel.getRule(c,f,x);if(I){const E={unitId:a,subUnitId:i,rule:{...d.Tools.deepClone(I),cfId:this._conditionalFormattingRuleModel.createCfId(a,i),ranges:T}};v.push({id:l.AddConditionalRuleMutation.id,params:E}),b.push(l.AddConditionalRuleMutationUndoFactory(this._injector,E))}}}else{const m=this._conditionalFormattingRuleModel.getRule(c,f,x);if(!m)return;const T=L.findAllRectangle(L.createTopMatrixFromMatrix(R));if(T.length){const I={unitId:c,subUnitId:f,rule:{...m,ranges:T}};v.push({id:l.SetConditionalRuleMutation.id,params:I}),b.push(...l.setConditionalRuleMutationUndoFactory(this._injector,I))}else{const I={unitId:c,subUnitId:f,cfId:m.cfId};v.push({id:l.DeleteConditionalRuleMutation.id,params:I}),b.push(...l.DeleteConditionalRuleMutationUndoFactory(this._injector,I))}}}),{undos:b,redos:v}},o={id:l.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:a=>{var i,u,s;switch(a){case ae.FormatPainterStatus.INFINITE:case ae.FormatPainterStatus.ONCE:{const c=(i=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),f=(s=(u=this._univerInstanceService.getCurrentUnitForType(d.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getActiveSheet())==null?void 0:s.getSheetId(),p=this._sheetsSelectionsService.getCurrentLastSelection(),h=p==null?void 0:p.range;c&&f&&h&&(this._painterConfig={unitId:c,subUnitId:f,range:h});break}case ae.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(a,i,u)=>this._painterConfig?r(a,i,u):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Sn=ql([ft(0,d.Inject(d.Injector)),ft(1,d.Inject(d.IUniverInstanceService)),ft(2,d.Inject(ae.IFormatPainterService)),ft(3,d.Inject(L.SheetsSelectionsService)),ft(4,d.Inject(l.ConditionalFormattingRuleModel)),ft(5,d.Inject(l.ConditionalFormattingViewModel))],Sn);var Zo=Object.defineProperty,Zl=Object.getOwnPropertyDescriptor,Jl=(t,e,n)=>e in t?Zo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ql=(t,e,n,r)=>{for(var o=r>1?void 0:r?Zl(e,n):e,a=t.length-1,i;a>=0;a--)(i=t[a])&&(o=(r?i(e,n,o):i(o))||o);return r&&o&&Zo(e,n,o),o},Tr=(t,e)=>(n,r)=>e(n,r,t),Jo=(t,e,n)=>Jl(t,typeof e!="symbol"?e+"":e,n);V.UniverSheetsConditionalFormattingUIPlugin=class extends d.Plugin{constructor(e=Bo,n,r,o){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=o;const{menu:a,...i}=this._config;a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Fo,i),this._initCommand()}onStarting(){d.registerDependencies(this._injector,[[Et],[Pt],[Mt],[gn],[Dt],[_t],[yn],[ut],[vn],[V.ConditionalFormattingClearController],[Sn]]),d.touchDependencies(this._injector,[[Et]])}onReady(){d.touchDependencies(this._injector,[[yn],[_t]])}onRendered(){d.touchDependencies(this._injector,[[gn],[V.ConditionalFormattingClearController],[Mt],[vn],[ut],[Sn],[Dt],[Pt]])}_initCommand(){[Rn,Cn,Tn,In,wn,_n,xn,En,On,xt,Tt,un,sn,It,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}},Jo(V.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${l.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),Jo(V.UniverSheetsConditionalFormattingUIPlugin,"type",d.UniverInstanceType.UNIVER_SHEET),V.UniverSheetsConditionalFormattingUIPlugin=Ql([d.DependentOn(l.UniverSheetsConditionalFormattingPlugin),Tr(1,d.Inject(d.Injector)),Tr(2,d.Inject(d.ICommandService)),Tr(3,d.IConfigService)],V.UniverSheetsConditionalFormattingUIPlugin),V.AddAverageCfCommand=Rn,V.AddCfCommand=It,V.AddColorScaleConditionalRuleCommand=Cn,V.AddDataBarConditionalRuleCommand=Tn,V.AddDuplicateValuesCfCommand=In,V.AddNumberCfCommand=wn,V.AddRankCfCommand=_n,V.AddTextCfCommand=xn,V.AddTimePeriodCfCommand=En,V.AddUniqueValuesCfCommand=On,V.ClearRangeCfCommand=Vt,V.ClearWorksheetCfCommand=ht,V.DeleteCfCommand=Tt,V.MoveCfCommand=sn,V.OpenConditionalFormattingOperator=xt,V.SetCfCommand=un,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})});
|
|
18
|
+
*/var xn;function Wr(){if(xn)return Ke;xn=1;var t=j,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(y,p,R){var m,C={},x=null,I=null;R!==void 0&&(x=""+R),p.key!==void 0&&(x=""+p.key),p.ref!==void 0&&(I=p.ref);for(m in p)n.call(p,m)&&!a.hasOwnProperty(m)&&(C[m]=p[m]);if(y&&y.defaultProps)for(m in p=y.defaultProps,p)C[m]===void 0&&(C[m]=p[m]);return{$$typeof:e,type:y,key:x,ref:I,props:C,_owner:o.current}}return Ke.Fragment=r,Ke.jsx=l,Ke.jsxs=l,Ke}var En;function Hr(){return En||(En=1,nn.exports=Wr()),nn.exports}var _=Hr();const A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var Se=function(){return Se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Se.apply(this,arguments)},kr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},Ue=j.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,a=t.extend,l=kr(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=j.useRef("_".concat(Gr()));return On(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Se({ref:e,className:y},l),a)});function On(t,e,r,n,o){return j.createElement(t.tag,Se(Se({key:e},Br(t,r,o)),n),(Fr(t,r).children||[]).map(function(a,l){return On(a,"".concat(e,"-").concat(t.tag,"-").concat(l),r,void 0,o)}))}function Br(t,e,r){var n=Se({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(a){var l=a[0],y=a[1];typeof y=="string"&&(n[l]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Fr(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Se(Se({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Se(Se({},o),{attrs:Se(Se({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function Gr(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var qr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ct=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:qr}))});Ct.displayName="DeleteSingle";var Xr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Pn=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Xr}))});Pn.displayName="IncreaseSingle";var Yr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tt=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:Yr}))});Tt.displayName="MoreDownSingle";var $r={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},Mn=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:$r}))});Mn.displayName="SequenceSingle";var Kr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Ze=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:Kr}))});Ze.displayName="SlashSingle";var rn={exports:{}},Je={},Qe={exports:{}},Zr=Qe.exports,Dn;function on(){return Dn||(Dn=1,function(t,e){(function(r,n){n(e)})(Zr,function(r){function n(B){return function(se,O,P,N,z,$,H){return B(se,O,H)}}function o(B){return function(se,O,P,N){if(!se||!O||typeof se!="object"||typeof O!="object")return B(se,O,P,N);var z=N.get(se),$=N.get(O);if(z&&$)return z===O&&$===se;N.set(se,O),N.set(O,se);var H=B(se,O,P,N);return N.delete(se),N.delete(O),H}}function a(B,Q){var se={};for(var O in B)se[O]=B[O];for(var O in Q)se[O]=Q[O];return se}function l(B){return B.constructor===Object||B.constructor==null}function y(B){return typeof B.then=="function"}function p(B,Q){return B===Q||B!==B&&Q!==Q}var R="[object Arguments]",m="[object Boolean]",C="[object Date]",x="[object RegExp]",I="[object Map]",T="[object Number]",w="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function d(B){var Q=B.areArraysEqual,se=B.areDatesEqual,O=B.areMapsEqual,P=B.areObjectsEqual,N=B.areRegExpsEqual,z=B.areSetsEqual,$=B.createIsNestedEqual,H=$(J);function J(K,te,ce){if(K===te)return!0;if(!K||!te||typeof K!="object"||typeof te!="object")return K!==K&&te!==te;if(l(K)&&l(te))return P(K,te,H,ce);var je=Array.isArray(K),be=Array.isArray(te);if(je||be)return je===be&&Q(K,te,H,ce);var me=s.call(K);return me!==s.call(te)?!1:me===C?se(K,te,H,ce):me===x?N(K,te,H,ce):me===I?O(K,te,H,ce):me===h?z(K,te,H,ce):me===w||me===R?y(K)||y(te)?!1:P(K,te,H,ce):me===m||me===T||me===i?p(K.valueOf(),te.valueOf()):!1}return J}function S(B,Q,se,O){var P=B.length;if(Q.length!==P)return!1;for(;P-- >0;)if(!se(B[P],Q[P],P,P,B,Q,O))return!1;return!0}var c=o(S);function g(B,Q){return p(B.valueOf(),Q.valueOf())}function f(B,Q,se,O){var P=B.size===Q.size;if(!P)return!1;if(!B.size)return!0;var N={},z=0;return B.forEach(function($,H){if(P){var J=!1,K=0;Q.forEach(function(te,ce){!J&&!N[K]&&(J=se(H,ce,z,K,B,Q,O)&&se($,te,H,ce,B,Q,O))&&(N[K]=!0),K++}),z++,P=J}}),P}var b=o(f),M="_owner",L=Object.prototype.hasOwnProperty;function V(B,Q,se,O){var P=Object.keys(B),N=P.length;if(Object.keys(Q).length!==N)return!1;for(var z;N-- >0;){if(z=P[N],z===M){var $=!!B.$$typeof,H=!!Q.$$typeof;if(($||H)&&$!==H)return!1}if(!L.call(Q,z)||!se(B[z],Q[z],z,z,B,Q,O))return!1}return!0}var U=o(V);function E(B,Q){return B.source===Q.source&&B.flags===Q.flags}function D(B,Q,se,O){var P=B.size===Q.size;if(!P)return!1;if(!B.size)return!0;var N={};return B.forEach(function(z,$){if(P){var H=!1,J=0;Q.forEach(function(K,te){!H&&!N[J]&&(H=se(z,K,$,te,B,Q,O))&&(N[J]=!0),J++}),P=H}}),P}var W=o(D),q=Object.freeze({areArraysEqual:S,areDatesEqual:g,areMapsEqual:f,areObjectsEqual:V,areRegExpsEqual:E,areSetsEqual:D,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:c,areDatesEqual:g,areMapsEqual:b,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:W,createIsNestedEqual:n}),ne=d(q);function ee(B,Q){return ne(B,Q,void 0)}var F=d(a(q,{createIsNestedEqual:function(){return p}}));function k(B,Q){return F(B,Q,void 0)}var oe=d(Y);function ie(B,Q){return oe(B,Q,new WeakMap)}var ue=d(a(Y,{createIsNestedEqual:function(){return p}}));function he(B,Q){return ue(B,Q,new WeakMap)}function ye(B){return d(a(q,B(q)))}function Ce(B){var Q=d(a(Y,B(Y)));return function(se,O,P){return P===void 0&&(P=new WeakMap),Q(se,O,P)}}r.circularDeepEqual=ie,r.circularShallowEqual=he,r.createCustomCircularEqual=Ce,r.createCustomEqual=ye,r.deepEqual=ee,r.sameValueZeroEqual=p,r.shallowEqual=k,Object.defineProperty(r,"__esModule",{value:!0})})}(Qe,Qe.exports)),Qe.exports}var It={exports:{}},Nn;function an(){if(Nn)return It.exports;Nn=1;function t(r){var n,o,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var l=r.length;for(n=0;n<l;n++)r[n]&&(o=t(r[n]))&&(a&&(a+=" "),a+=o)}else for(o in r)r[o]&&(a&&(a+=" "),a+=o);return a}function e(){for(var r,n,o=0,a="",l=arguments.length;o<l;o++)(r=arguments[o])&&(n=t(r))&&(a&&(a+=" "),a+=n);return a}return It.exports=e,It.exports.clsx=e,It.exports}var ae={},sn,jn;function Jr(){return jn||(jn=1,sn=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),sn}var Ln;function Ve(){if(Ln)return ae;Ln=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=n,ae.childrenEqual=p,ae.cloneLayout=o,ae.cloneLayoutItem=y,ae.collides=m,ae.compact=C,ae.compactItem=T,ae.compactType=B,ae.correctBounds=w,ae.fastPositionEqual=R,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=i,ae.getLayoutItem=h,ae.getStatics=d,ae.modifyLayout=a,ae.moveElement=S,ae.moveElementAwayFromCollision=c,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=F,ae.setTopLeft=oe,ae.setTransform=k,ae.sortLayoutItems=ie,ae.sortLayoutItemsByColRow=he,ae.sortLayoutItemsByRowCol=ue,ae.synchronizeLayoutWithChildren=ye,ae.validateLayout=Ce,ae.withLayoutItem=l;var t=on(),e=r(j);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,N;for(let z=0,$=O.length;z<$;z++)N=O[z].y+O[z].h,N>P&&(P=N);return P}function o(O){const P=Array(O.length);for(let N=0,z=O.length;N<z;N++)P[N]=y(O[N]);return P}function a(O,P){const N=Array(O.length);for(let z=0,$=O.length;z<$;z++)P.i===O[z].i?N[z]=P:N[z]=O[z];return N}function l(O,P,N){let z=h(O,P);return z?(z=N(y(z)),O=a(O,z),[O,z]):[O,null]}function y(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,P){return(0,t.deepEqual)(e.default.Children.map(O,N=>N==null?void 0:N.key),e.default.Children.map(P,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(O,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]))}ae.fastRGLPropsEqual=Jr();function R(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function m(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function C(O,P,N,z){const $=d(O),H=ie(O,P),J=Array(O.length);for(let K=0,te=H.length;K<te;K++){let ce=y(H[K]);ce.static||(ce=T($,ce,P,N,H,z),$.push(ce)),J[O.indexOf(H[K])]=ce,ce.moved=!1}return J}const x={x:"w",y:"h"};function I(O,P,N,z){const $=x[z];P[z]+=1;const H=O.map(J=>J.i).indexOf(P.i);for(let J=H+1;J<O.length;J++){const K=O[J];if(!K.static){if(K.y>P.y+P.h)break;m(P,K)&&I(O,K,N+P[$],z)}}P[z]=N}function T(O,P,N,z,$,H){const J=N==="vertical",K=N==="horizontal";if(J)for(P.y=Math.min(n(O),P.y);P.y>0&&!i(O,P);)P.y--;else if(K)for(;P.x>0&&!i(O,P);)P.x--;let te;for(;(te=i(O,P))&&!(N===null&&H);)if(K?I($,P,te.x+te.w,"x"):I($,P,te.y+te.h,"y"),K&&P.x+P.w>z)for(P.x=z-P.w,P.y++;P.x>0&&!i(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function w(O,P){const N=d(O);for(let z=0,$=O.length;z<$;z++){const H=O[z];if(H.x+H.w>P.cols&&(H.x=P.cols-H.w),H.x<0&&(H.x=0,H.w=P.cols),!H.static)N.push(H);else for(;i(N,H);)H.y++}return O}function h(O,P){for(let N=0,z=O.length;N<z;N++)if(O[N].i===P)return O[N]}function i(O,P){for(let N=0,z=O.length;N<z;N++)if(m(O[N],P))return O[N]}function s(O,P){return O.filter(N=>m(N,P))}function d(O){return O.filter(P=>P.static)}function S(O,P,N,z,$,H,J,K,te){if(P.static&&P.isDraggable!==!0||P.y===z&&P.x===N)return O;`${P.i}${String(N)}${String(z)}${P.x}${P.y}`;const ce=P.x,je=P.y;typeof N=="number"&&(P.x=N),typeof z=="number"&&(P.y=z),P.moved=!0;let be=ie(O,J);(J==="vertical"&&typeof z=="number"?je>=z:J==="horizontal"&&typeof N=="number"?ce>=N:!1)&&(be=be.reverse());const Fe=s(be,P),Gt=Fe.length>0;if(Gt&&te)return o(O);if(Gt&&H)return`${P.i}`,P.x=ce,P.y=je,P.moved=!1,O;for(let Tn=0,ka=Fe.length;Tn<ka;Tn++){const Le=Fe[Tn];`${P.i}${P.x}${P.y}${Le.i}${Le.x}${Le.y}`,!Le.moved&&(Le.static?O=c(O,Le,P,$,J):O=c(O,P,Le,$,J))}return O}function c(O,P,N,z,$,H){const J=$==="horizontal",K=$==="vertical",te=P.static;if(z){z=!1;const be={x:J?Math.max(P.x-N.w,0):N.x,y:K?Math.max(P.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},me=i(O,be),Fe=me&&me.y+me.h>P.y,Gt=me&&P.x+P.w>me.x;if(me){if(Fe&&K)return S(O,N,void 0,P.y+1,z,te,$);if(Fe&&$==null)return P.y=N.y,N.y=N.y+N.h,O;if(Gt&&J)return S(O,P,N.x,void 0,z,te,$)}else return`${N.i}${be.x}${be.y}`,S(O,N,J?be.x:void 0,K?be.y:void 0,z,te,$)}const ce=J?N.x+1:void 0,je=K?N.y+1:void 0;return ce==null&&je==null?O:S(O,N,J?N.x+1:void 0,K?N.y+1:void 0,z,te,$)}function g(O){return O*100+"%"}const f=(O,P,N,z)=>O+N>z?P:N,b=(O,P,N)=>O<0?P:N,M=O=>Math.max(0,O),L=O=>Math.max(0,O),V=(O,P,N)=>{let{left:z,height:$,width:H}=P;const J=O.top-($-O.height);return{left:z,width:H,height:b(J,O.height,$),top:L(J)}},U=(O,P,N)=>{let{top:z,left:$,height:H,width:J}=P;return{top:z,height:H,width:f(O.left,O.width,J,N),left:M($)}},E=(O,P,N)=>{let{top:z,height:$,width:H}=P;const J=O.left-(H-O.width);return{height:$,width:J<0?O.width:f(O.left,O.width,H,N),top:L(z),left:M(J)}},D=(O,P,N)=>{let{top:z,left:$,height:H,width:J}=P;return{width:J,left:$,height:b(z,O.height,H),top:L(z)}},ee={n:V,ne:function(){return V(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return D(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:D,sw:function(){return D(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return V(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function F(O,P,N,z){const $=ee[O];return $?$(P,{...P,...N},z):N}function k(O){let{top:P,left:N,width:z,height:$}=O;const H=`translate(${N}px,${P}px)`;return{transform:H,WebkitTransform:H,MozTransform:H,msTransform:H,OTransform:H,width:`${z}px`,height:`${$}px`,position:"absolute"}}function oe(O){let{top:P,left:N,width:z,height:$}=O;return{top:`${P}px`,left:`${N}px`,width:`${z}px`,height:`${$}px`,position:"absolute"}}function ie(O,P){return P==="horizontal"?he(O):P==="vertical"?ue(O):O}function ue(O){return O.slice(0).sort(function(P,N){return P.y>N.y||P.y===N.y&&P.x>N.x?1:P.y===N.y&&P.x===N.x?0:-1})}function he(O){return O.slice(0).sort(function(P,N){return P.x>N.x||P.x===N.x&&P.y>N.y?1:-1})}function ye(O,P,N,z,$){O=O||[];const H=[];e.default.Children.forEach(P,K=>{if((K==null?void 0:K.key)==null)return;const te=h(O,String(K.key)),ce=K.props["data-grid"];te&&ce==null?H.push(y(te)):ce?H.push(y({...ce,i:K.key})):H.push(y({w:1,h:1,x:0,y:n(H),i:String(K.key)}))});const J=w(H,{cols:N});return $?J:C(J,z,N)}function Ce(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let z=0,$=O.length;z<$;z++){const H=O[z];for(let J=0;J<N.length;J++){const K=N[J],te=H[K];if(typeof te!="number"||Number.isNaN(te))throw new Error(`ReactGridLayout: ${P}[${z}].${K} must be a number! Received: ${te} (${typeof te})`)}if(typeof H.i<"u"&&typeof H.i!="string")throw new Error(`ReactGridLayout: ${P}[${z}].i must be a string! Received: ${H.i} (${typeof H.i})`)}}function B(O){const{verticalCompact:P,compactType:N}=O||{};return P===!1?null:N}function Q(){}const se=()=>{};return ae.noop=se,ae}var Ie={},Un;function ln(){if(Un)return Ie;Un=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=r,Ie.calcGridItemWHPx=e,Ie.calcWH=o,Ie.calcXY=n,Ie.clamp=a;function t(l){const{margin:y,containerPadding:p,containerWidth:R,cols:m}=l;return(R-y[0]*(m-1)-p[0]*2)/m}function e(l,y,p){return Number.isFinite(l)?Math.round(y*l+Math.max(0,l-1)*p):l}function r(l,y,p,R,m,C){const{margin:x,containerPadding:I,rowHeight:T}=l,w=t(l),h={};return C&&C.resizing?(h.width=Math.round(C.resizing.width),h.height=Math.round(C.resizing.height)):(h.width=e(R,w,x[0]),h.height=e(m,T,x[1])),C&&C.dragging?(h.top=Math.round(C.dragging.top),h.left=Math.round(C.dragging.left)):C&&C.resizing&&typeof C.resizing.top=="number"&&typeof C.resizing.left=="number"?(h.top=Math.round(C.resizing.top),h.left=Math.round(C.resizing.left)):(h.top=Math.round((T+x[1])*p+I[1]),h.left=Math.round((w+x[0])*y+I[0])),h}function n(l,y,p,R,m){const{margin:C,containerPadding:x,cols:I,rowHeight:T,maxRows:w}=l,h=t(l);let i=Math.round((p-x[0])/(h+C[0])),s=Math.round((y-x[1])/(T+C[1]));return i=a(i,0,I-R),s=a(s,0,w-m),{x:i,y:s}}function o(l,y,p,R,m,C){const{margin:x,maxRows:I,cols:T,rowHeight:w}=l,h=t(l);let i=Math.round((y+x[0])/(h+x[0])),s=Math.round((p+x[1])/(w+x[1])),d=a(i,0,T-R),S=a(s,0,I-m);return["sw","w","nw"].indexOf(C)!==-1&&(d=a(i,0,T)),["nw","n","ne"].indexOf(C)!==-1&&(S=a(s,0,I)),{w:d,h:S}}function a(l,y,p){return Math.max(Math.min(l,p),y)}return Ie}var et={},un={exports:{}},cn,Vn;function Qr(){if(Vn)return cn;Vn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cn=t,cn}var dn,zn;function eo(){if(zn)return dn;zn=1;var t=Qr();function e(){}function r(){}return r.resetWarningCache=e,dn=function(){function n(l,y,p,R,m,C){if(C!==t){var x=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 x.name="Invariant Violation",x}}n.isRequired=n;function o(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},dn}var An;function xe(){return An||(An=1,un.exports=eo()()),un.exports}var tt={exports:{}},fn={};function Wn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Wn(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Hn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Wn(t))&&(n&&(n+=" "),n+=e);return n}const to=_n(Object.freeze(Object.defineProperty({__proto__:null,clsx:Hn,default:Hn},Symbol.toStringTag,{value:"Module"})));var fe={},Ee={},kn;function wt(){if(kn)return Ee;kn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.dontSetMe=o,Ee.findInArray=t,Ee.int=n,Ee.isFunction=e,Ee.isNum=r;function t(a,l){for(let y=0,p=a.length;y<p;y++)if(l.apply(l,[a[y],y,a]))return a[y]}function e(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"}function r(a){return typeof a=="number"&&!isNaN(a)}function n(a){return parseInt(a,10)}function o(a,l,y){if(a[l])return new Error("Invalid prop ".concat(l," passed to ").concat(y," - do not set this, set it on the child."))}return Ee}var Oe={},Bn;function no(){if(Bn)return Oe;Bn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.browserPrefixToKey=r,Oe.browserPrefixToStyle=n,Oe.default=void 0,Oe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var a;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(a=window.document)===null||a===void 0||(a=a.documentElement)===null||a===void 0?void 0:a.style;if(!y||l in y)return"";for(let p=0;p<t.length;p++)if(r(l,t[p])in y)return t[p];return""}function r(a,l){return l?"".concat(l).concat(o(a)):a}function n(a,l){return l?"-".concat(l.toLowerCase(),"-").concat(a):a}function o(a){let l="",y=!0;for(let p=0;p<a.length;p++)y?(l+=a[p].toUpperCase(),y=!1):a[p]==="-"?y=!0:l+=a[p];return l}return Oe.default=e(),Oe}var Fn;function pn(){if(Fn)return fe;Fn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=c,fe.addEvent=y,fe.addUserSelectStyles=d,fe.createCSSTransform=T,fe.createSVGTransform=w,fe.getTouch=i,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=C,fe.innerWidth=x,fe.matchesSelector=a,fe.matchesSelectorAndParentsTo=l,fe.offsetXYFromParent=I,fe.outerHeight=R,fe.outerWidth=m,fe.removeClassName=g,fe.removeEvent=p,fe.removeUserSelectStyles=S;var t=wt(),e=n(no());function r(f){if(typeof WeakMap!="function")return null;var b=new WeakMap,M=new WeakMap;return(r=function(L){return L?M:b})(f)}function n(f,b){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var M=r(b);if(M&&M.has(f))return M.get(f);var L={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in f)if(U!=="default"&&Object.prototype.hasOwnProperty.call(f,U)){var E=V?Object.getOwnPropertyDescriptor(f,U):null;E&&(E.get||E.set)?Object.defineProperty(L,U,E):L[U]=f[U]}return L.default=f,M&&M.set(f,L),L}let o="";function a(f,b){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(f[M])})),(0,t.isFunction)(f[o])?f[o](b):!1}function l(f,b,M){let L=f;do{if(a(L,b))return!0;if(L===M)return!1;L=L.parentNode}while(L);return!1}function y(f,b,M,L){if(!f)return;const V={capture:!0,...L};f.addEventListener?f.addEventListener(b,M,V):f.attachEvent?f.attachEvent("on"+b,M):f["on"+b]=M}function p(f,b,M,L){if(!f)return;const V={capture:!0,...L};f.removeEventListener?f.removeEventListener(b,M,V):f.detachEvent?f.detachEvent("on"+b,M):f["on"+b]=null}function R(f){let b=f.clientHeight;const M=f.ownerDocument.defaultView.getComputedStyle(f);return b+=(0,t.int)(M.borderTopWidth),b+=(0,t.int)(M.borderBottomWidth),b}function m(f){let b=f.clientWidth;const M=f.ownerDocument.defaultView.getComputedStyle(f);return b+=(0,t.int)(M.borderLeftWidth),b+=(0,t.int)(M.borderRightWidth),b}function C(f){let b=f.clientHeight;const M=f.ownerDocument.defaultView.getComputedStyle(f);return b-=(0,t.int)(M.paddingTop),b-=(0,t.int)(M.paddingBottom),b}function x(f){let b=f.clientWidth;const M=f.ownerDocument.defaultView.getComputedStyle(f);return b-=(0,t.int)(M.paddingLeft),b-=(0,t.int)(M.paddingRight),b}function I(f,b,M){const V=b===b.ownerDocument.body?{left:0,top:0}:b.getBoundingClientRect(),U=(f.clientX+b.scrollLeft-V.left)/M,E=(f.clientY+b.scrollTop-V.top)/M;return{x:U,y:E}}function T(f,b){const M=h(f,b,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function w(f,b){return h(f,b,"")}function h(f,b,M){let{x:L,y:V}=f,U="translate(".concat(L).concat(M,",").concat(V).concat(M,")");if(b){const E="".concat(typeof b.x=="string"?b.x:b.x+M),D="".concat(typeof b.y=="string"?b.y:b.y+M);U="translate(".concat(E,", ").concat(D,")")+U}return U}function i(f,b){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,M=>b===M.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,M=>b===M.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 b=f.getElementById("react-draggable-style-el");b||(b=f.createElement("style"),b.type="text/css",b.id="react-draggable-style-el",b.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
19
|
+
`,b.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
20
|
+
`,f.getElementsByTagName("head")[0].appendChild(b)),f.body&&c(f.body,"react-draggable-transparent-selection")}function S(f){if(f)try{if(f.body&&g(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const b=(f.defaultView||window).getSelection();b&&b.type!=="Caret"&&b.removeAllRanges()}}catch{}}function c(f,b){f.classList?f.classList.add(b):f.className.match(new RegExp("(?:^|\\s)".concat(b,"(?!\\S)")))||(f.className+=" ".concat(b))}function g(f,b){f.classList?f.classList.remove(b):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(b,"(?!\\S)"),"g"),"")}return fe}var Te={},Gn;function qn(){if(Gn)return Te;Gn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.canDragX=o,Te.canDragY=a,Te.createCoreData=y,Te.createDraggableData=p,Te.getBoundPosition=r,Te.getControlPosition=l,Te.snapToGrid=n;var t=wt(),e=pn();function r(C,x,I){if(!C.props.bounds)return[x,I];let{bounds:T}=C.props;T=typeof T=="string"?T:R(T);const w=m(C);if(typeof T=="string"){const{ownerDocument:h}=w,i=h.defaultView;let s;if(T==="parent"?s=w.parentNode:s=h.querySelector(T),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+T+'" could not find an element.');const d=s,S=i.getComputedStyle(w),c=i.getComputedStyle(d);T={left:-w.offsetLeft+(0,t.int)(c.paddingLeft)+(0,t.int)(S.marginLeft),top:-w.offsetTop+(0,t.int)(c.paddingTop)+(0,t.int)(S.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(w)-w.offsetLeft+(0,t.int)(c.paddingRight)-(0,t.int)(S.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(w)-w.offsetTop+(0,t.int)(c.paddingBottom)-(0,t.int)(S.marginBottom)}}return(0,t.isNum)(T.right)&&(x=Math.min(x,T.right)),(0,t.isNum)(T.bottom)&&(I=Math.min(I,T.bottom)),(0,t.isNum)(T.left)&&(x=Math.max(x,T.left)),(0,t.isNum)(T.top)&&(I=Math.max(I,T.top)),[x,I]}function n(C,x,I){const T=Math.round(x/C[0])*C[0],w=Math.round(I/C[1])*C[1];return[T,w]}function o(C){return C.props.axis==="both"||C.props.axis==="x"}function a(C){return C.props.axis==="both"||C.props.axis==="y"}function l(C,x,I){const T=typeof x=="number"?(0,e.getTouch)(C,x):null;if(typeof x=="number"&&!T)return null;const w=m(I),h=I.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,e.offsetXYFromParent)(T||C,h,I.props.scale)}function y(C,x,I){const T=!(0,t.isNum)(C.lastX),w=m(C);return T?{node:w,deltaX:0,deltaY:0,lastX:x,lastY:I,x,y:I}:{node:w,deltaX:x-C.lastX,deltaY:I-C.lastY,lastX:C.lastX,lastY:C.lastY,x,y:I}}function p(C,x){const I=C.props.scale;return{node:x.node,x:C.state.x+x.deltaX/I,y:C.state.y+x.deltaY/I,deltaX:x.deltaX/I,deltaY:x.deltaY/I,lastX:C.state.x,lastY:C.state.y}}function R(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function m(C){const x=C.findDOMNode();if(!x)throw new Error("<DraggableCore>: Unmounted during event!");return x}return Te}var nt={},_t={},Xn;function Yn(){if(Xn)return _t;Xn=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=t;function t(){}return _t}var $n;function ro(){if($n)return nt;$n=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=R(j),e=y(xe()),r=y(In),n=pn(),o=qn(),a=wt(),l=y(Yn());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 R(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={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in h)if(c!=="default"&&Object.prototype.hasOwnProperty.call(h,c)){var g=S?Object.getOwnPropertyDescriptor(h,c):null;g&&(g.get||g.set)?Object.defineProperty(d,c,g):d[c]=h[c]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=C(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function C(h){var i=x(h,"string");return typeof i=="symbol"?i:String(i)}function x(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let T=I.mouse,w=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",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 S=(0,n.getTouchIdentifier)(i);this.touchIdentifier=S;const c=(0,o.getControlPosition)(i,S,this);if(c==null)return;const{x:g,y:f}=c,b=(0,o.createCoreData)(this,g,f);(0,l.default)("DraggableCore: handleDragStart: %j",b),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(i,b)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=f,(0,n.addEvent)(d,T.move,this.handleDrag),(0,n.addEvent)(d,T.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,o.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,b=S-this.lastY;if([f,b]=(0,o.snapToGrid)(this.props.grid,f,b),!f&&!b)return;d=this.lastX+f,S=this.lastY+b}const c=(0,o.createCoreData)(this,d,S);if((0,l.default)("DraggableCore: handleDrag: %j",c),this.props.onDrag(i,c)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const b=document.createEvent("MouseEvents");b.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(b)}return}this.lastX=d,this.lastY=S}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let b=d-this.lastX||0,M=S-this.lastY||0;[b,M]=(0,o.snapToGrid)(this.props.grid,b,M),d=this.lastX+b,S=this.lastY+M}const c=(0,o.createCoreData)(this,d,S);if(this.props.onStop(i,c)===!1||this.mounted===!1)return!1;const f=this.findDOMNode();f&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(f.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",c),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,f&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(f.ownerDocument,T.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,T.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(T=I.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(T=I.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(T=I.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(T=I.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,n.addEvent)(i,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,n.removeEvent)(s,I.mouse.move,this.handleDrag),(0,n.removeEvent)(s,I.touch.move,this.handleDrag),(0,n.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,n.removeEvent)(i,I.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 nt.default=w,m(w,"displayName","DraggableCore"),m(w,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,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:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),nt}var Kn;function oo(){return Kn||(Kn=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=x(j),r=m(xe()),n=m(In),o=m(to),a=pn(),l=qn(),y=wt(),p=m(ro()),R=m(Yn());function m(s){return s&&s.__esModule?s:{default:s}}function C(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(C=function(c){return c?S:d})(s)}function x(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=C(d);if(S&&S.has(s))return S.get(s);var c={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var b=g?Object.getOwnPropertyDescriptor(s,f):null;b&&(b.get||b.set)?Object.defineProperty(c,f,b):c[f]=s[f]}return c.default=s,S&&S.set(s,c),c}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var c in S)Object.prototype.hasOwnProperty.call(S,c)&&(s[c]=S[c])}return s},I.apply(this,arguments)}function T(s,d,S){return d=w(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function w(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var c=S.call(s,d||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(d,S){let{position:c}=d,{prevPropsPosition:g}=S;return c&&(!g||c.x!==g.x||c.y!==g.y)?((0,R.default)("Draggable: getDerivedStateFromProps %j",{position:c,prevPropsPosition:g}),{x:c.x,y:c.y,prevPropsPosition:{...c}}):null}constructor(d){super(d),T(this,"onDragStart",(S,c)=>{if((0,R.default)("Draggable: onDragStart: %j",c),this.props.onStart(S,(0,l.createDraggableData)(this,c))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),T(this,"onDrag",(S,c)=>{if(!this.state.dragging)return!1;(0,R.default)("Draggable: onDrag: %j",c);const g=(0,l.createDraggableData)(this,c),f={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:L}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[V,U]=(0,l.getBoundPosition)(this,f.x,f.y);f.x=V,f.y=U,f.slackX=this.state.slackX+(M-f.x),f.slackY=this.state.slackY+(L-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(S,g)===!1)return!1;this.setState(f)}),T(this,"onDragStop",(S,c)=>{if(!this.state.dragging||this.props.onStop(S,(0,l.createDraggableData)(this,c))===!1)return!1;(0,R.default)("Draggable: onDragStop: %j",c);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:L}=this.props.position;f.x=M,f.y=L}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,S;return(d=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:S,children:c,defaultPosition:g,defaultClassName:f,defaultClassNameDragging:b,defaultClassNameDragged:M,position:L,positionOffset:V,scale:U,...E}=this.props;let D={},W=null;const Y=!!!L||this.state.dragging,ne=L||g,ee={x:(0,l.canDragX)(this)&&Y?this.state.x:ne.x,y:(0,l.canDragY)(this)&&Y?this.state.y:ne.y};this.state.isElementSVG?W=(0,a.createSVGTransform)(ee,V):D=(0,a.createCSSTransform)(ee,V);const F=(0,o.default)(c.props.className||"",f,{[b]:this.state.dragging,[M]:this.state.dragged});return e.createElement(p.default,I({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(c),{className:F,style:{...c.props.style,...D},transform:W}))}}t.default=i,T(i,"displayName","Draggable"),T(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}),T(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})}(fn)),fn}var Zn;function hn(){if(Zn)return tt.exports;Zn=1;const{default:t,DraggableCore:e}=oo();return tt.exports=t,tt.exports.default=t,tt.exports.DraggableCore=e,tt.exports}var rt={exports:{}},ot={},xt={},Jn;function ao(){if(Jn)return xt;Jn=1,xt.__esModule=!0,xt.cloneElement=y;var t=e(j);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,R){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(p);R&&(C=C.filter(function(x){return Object.getOwnPropertyDescriptor(p,x).enumerable})),m.push.apply(m,C)}return m}function n(p){for(var R=1;R<arguments.length;R++){var m=arguments[R]!=null?arguments[R]:{};R%2?r(Object(m),!0).forEach(function(C){o(p,C,m[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(C){Object.defineProperty(p,C,Object.getOwnPropertyDescriptor(m,C))})}return p}function o(p,R,m){return R=a(R),R in p?Object.defineProperty(p,R,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[R]=m,p}function a(p){var R=l(p,"string");return typeof R=="symbol"?R:String(R)}function l(p,R){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var C=m.call(p,R||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(p)}function y(p,R){return R.style&&p.props.style&&(R.style=n(n({},p.props.style),R.style)),R.className&&p.props.className&&(R.className=p.props.className+" "+R.className),t.default.cloneElement(p,R)}return xt}var at={},Qn;function er(){if(Qn)return at;Qn=1,at.__esModule=!0,at.resizableProps=void 0;var t=e(xe());hn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var y=a[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,a)}return t.default.number.apply(t.default,a)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var o=arguments.length,a=new Array(o),l=0;l<o;l++)a[l]=arguments[l];var y=a[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,a)}return t.default.number.apply(t.default,a)}};return at.resizableProps=r,at}var tr;function nr(){if(tr)return ot;tr=1,ot.__esModule=!0,ot.default=void 0;var t=l(j),e=hn(),r=ao(),n=er(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(a=function(c){return c?d:s})(i)}function l(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var d=a(s);if(d&&d.has(i))return d.get(i);var S={},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var f=c?Object.getOwnPropertyDescriptor(i,g):null;f&&(f.get||f.set)?Object.defineProperty(S,g,f):S[g]=i[g]}return S.default=i,d&&d.set(i,S),S}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 S in d)Object.prototype.hasOwnProperty.call(d,S)&&(i[S]=d[S])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var d={},S=Object.keys(i),c,g;for(g=0;g<S.length;g++)c=S[g],!(s.indexOf(c)>=0)&&(d[c]=i[c]);return d}function R(i,s){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(i);s&&(S=S.filter(function(c){return Object.getOwnPropertyDescriptor(i,c).enumerable})),d.push.apply(d,S)}return d}function m(i){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?R(Object(d),!0).forEach(function(S){C(i,S,d[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):R(Object(d)).forEach(function(S){Object.defineProperty(i,S,Object.getOwnPropertyDescriptor(d,S))})}return i}function C(i,s,d){return s=x(s),s in i?Object.defineProperty(i,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[s]=d,i}function x(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 d=i[Symbol.toPrimitive];if(d!==void 0){var S=d.call(i,s||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function T(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,w(i,s)}function w(i,s){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,c){return S.__proto__=c,S},w(i,s)}var h=function(i){T(s,i);function s(){for(var S,c=arguments.length,g=new Array(c),f=0;f<c;f++)g[f]=arguments[f];return S=i.call.apply(i,[this].concat(g))||this,S.handleRefs={},S.lastHandleRect=null,S.slack=null,S}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(c,g){var f=this.props,b=f.minConstraints,M=f.maxConstraints,L=f.lockAspectRatio;if(!b&&!M&&!L)return[c,g];if(L){var V=this.props.width/this.props.height,U=c-this.props.width,E=g-this.props.height;Math.abs(U)>Math.abs(E*V)?g=c/V:c=g*V}var D=c,W=g,q=this.slack||[0,0],Y=q[0],ne=q[1];return c+=Y,g+=ne,b&&(c=Math.max(b[0],c),g=Math.max(b[1],g)),M&&(c=Math.min(M[0],c),g=Math.min(M[1],g)),this.slack=[Y+(D-c),ne+(W-g)],[c,g]},d.resizeHandler=function(c,g){var f=this;return function(b,M){var L=M.node,V=M.deltaX,U=M.deltaY;c==="onResizeStart"&&f.resetData();var E=(f.props.axis==="both"||f.props.axis==="x")&&g!=="n"&&g!=="s",D=(f.props.axis==="both"||f.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!E&&!D)){var W=g[0],q=g[g.length-1],Y=L.getBoundingClientRect();if(f.lastHandleRect!=null){if(q==="w"){var ne=Y.left-f.lastHandleRect.left;V+=ne}if(W==="n"){var ee=Y.top-f.lastHandleRect.top;U+=ee}}f.lastHandleRect=Y,q==="w"&&(V=-V),W==="n"&&(U=-U);var F=f.props.width+(E?V/f.props.transformScale:0),k=f.props.height+(D?U/f.props.transformScale:0),oe=f.runConstraints(F,k);F=oe[0],k=oe[1];var ie=F!==f.props.width||k!==f.props.height,ue=typeof f.props[c]=="function"?f.props[c]:null,he=c==="onResize"&&!ie;ue&&!he&&(b.persist==null||b.persist(),ue(b,{node:L,size:{width:F,height:k},handle:g})),c==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(c,g){var f=this.props.handle;if(!f)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+c,ref:g});if(typeof f=="function")return f(c,g);var b=typeof f.type=="string",M=m({ref:g},b?{}:{handleAxis:c});return t.cloneElement(f,M)},d.render=function(){var c=this,g=this.props,f=g.children,b=g.className,M=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var L=g.resizeHandles;g.transformScale;var V=p(g,o);return(0,r.cloneElement)(f,m(m({},V),{},{className:(b?b+" ":"")+"react-resizable",children:[].concat(f.props.children,L.map(function(U){var E,D=(E=c.handleRefs[U])!=null?E:c.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,y({},M,{nodeRef:D,key:"resizableHandle-"+U,onStop:c.resizeHandler("onResizeStop",U),onStart:c.resizeHandler("onResizeStart",U),onDrag:c.resizeHandler("onResize",U)}),c.renderResizeHandle(U,D))}))}))},s}(t.Component);return ot.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},ot}var it={},rr;function io(){if(rr)return it;rr=1,it.__esModule=!0,it.default=void 0;var t=y(j),e=a(xe()),r=a(nr()),n=er(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a(s){return s&&s.__esModule?s:{default:s}}function l(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(l=function(g){return g?S: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 S=l(d);if(S&&S.has(s))return S.get(s);var c={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var b=g?Object.getOwnPropertyDescriptor(s,f):null;b&&(b.get||b.set)?Object.defineProperty(c,f,b):c[f]=s[f]}return c.default=s,S&&S.set(s,c),c}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var c in S)Object.prototype.hasOwnProperty.call(S,c)&&(s[c]=S[c])}return s},p.apply(this,arguments)}function R(s,d){var S=Object.keys(s);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);d&&(c=c.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),S.push.apply(S,c)}return S}function m(s){for(var d=1;d<arguments.length;d++){var S=arguments[d]!=null?arguments[d]:{};d%2?R(Object(S),!0).forEach(function(c){C(s,c,S[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(S)):R(Object(S)).forEach(function(c){Object.defineProperty(s,c,Object.getOwnPropertyDescriptor(S,c))})}return s}function C(s,d,S){return d=x(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function x(s){var d=I(s,"string");return typeof d=="symbol"?d:String(d)}function I(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var c=S.call(s,d||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function T(s,d){if(s==null)return{};var S={},c=Object.keys(s),g,f;for(f=0;f<c.length;f++)g=c[f],!(d.indexOf(g)>=0)&&(S[g]=s[g]);return S}function w(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,g){return c.__proto__=g,c},h(s,d)}var i=function(s){w(d,s);function d(){for(var c,g=arguments.length,f=new Array(g),b=0;b<g;b++)f[b]=arguments[b];return c=s.call.apply(s,[this].concat(f))||this,c.state={width:c.props.width,height:c.props.height,propsWidth:c.props.width,propsHeight:c.props.height},c.onResize=function(M,L){var V=L.size;c.props.onResize?(M.persist==null||M.persist(),c.setState(V,function(){return c.props.onResize&&c.props.onResize(M,L)})):c.setState(V)},c}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 S=d.prototype;return S.render=function(){var g=this.props,f=g.handle,b=g.handleSize;g.onResize;var M=g.onResizeStart,L=g.onResizeStop,V=g.draggableOpts,U=g.minConstraints,E=g.maxConstraints,D=g.lockAspectRatio,W=g.axis;g.width,g.height;var q=g.resizeHandles,Y=g.style,ne=g.transformScale,ee=T(g,o);return t.createElement(r.default,{axis:W,draggableOpts:V,handle:f,handleSize:b,height:this.state.height,lockAspectRatio:D,maxConstraints:E,minConstraints:U,onResizeStart:M,onResize:this.onResize,onResizeStop:L,resizeHandles:q,transformScale:ne,width:this.state.width},t.createElement("div",p({},ee,{style:m(m({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return it.default=i,i.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),it}var or;function so(){return or||(or=1,rt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},rt.exports.Resizable=nr().default,rt.exports.ResizableBox=io().default),rt.exports}var we={},ar;function ir(){if(ar)return we;ar=1,Object.defineProperty(we,"__esModule",{value:!0}),we.resizeHandleType=we.resizeHandleAxesType=we.default=void 0;var t=r(xe()),e=r(j);function r(a){return a&&a.__esModule?a:{default:a}}const n=we.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=we.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return we.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(a){a.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(a){var l=a.layout;l!==void 0&&Ve().validateLayout(l,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:o,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(a,l){const y=a[l],p={};e.default.Children.forEach(y,function(R){if((R==null?void 0:R.key)!=null){if(p[R.key])throw new Error('Duplicate child key "'+R.key+'" found! This will cause problems in ReactGridLayout.');p[R.key]=!0}})},innerRef:t.default.any},we}var sr;function lo(){if(sr)return et;sr=1,Object.defineProperty(et,"__esModule",{value:!0}),et.default=void 0;var t=p(j),e=p(xe()),r=hn(),n=so(),o=Ve(),a=ln(),l=ir(),y=p(an());function p(I){return I&&I.__esModule?I:{default:I}}function R(I,T,w){return T=m(T),T in I?Object.defineProperty(I,T,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[T]=w,I}function m(I){var T=C(I,"string");return typeof T=="symbol"?T:String(T)}function C(I,T){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,T||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}let x=class extends t.default.Component{constructor(){super(...arguments),R(this,"state",{resizing:null,dragging:null,className:""}),R(this,"elementRef",t.default.createRef()),R(this,"onDragStart",(T,w)=>{let{node:h}=w;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const d={top:0,left:0},{offsetParent:S}=h;if(!S)return;const c=S.getBoundingClientRect(),g=h.getBoundingClientRect(),f=g.left/s,b=c.left/s,M=g.top/s,L=c.top/s;d.left=f-b+S.scrollLeft,d.top=M-L+S.scrollTop,this.setState({dragging:d});const{x:V,y:U}=(0,a.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return i.call(this,this.props.i,V,U,{e:T,node:h,newPosition:d})}),R(this,"onDrag",(T,w)=>{let{node:h,deltaX:i,deltaY:s}=w;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let S=this.state.dragging.top+s,c=this.state.dragging.left+i;const{isBounded:g,i:f,w:b,h:M,containerWidth:L}=this.props,V=this.getPositionParams();if(g){const{offsetParent:W}=h;if(W){const{margin:q,rowHeight:Y,containerPadding:ne}=this.props,ee=W.clientHeight-(0,a.calcGridItemWHPx)(M,Y,q[1]);S=(0,a.clamp)(S-ne[1],0,ee);const F=(0,a.calcGridColWidth)(V),k=L-(0,a.calcGridItemWHPx)(b,F,q[0]);c=(0,a.clamp)(c-ne[0],0,k)}}const U={top:S,left:c};this.setState({dragging:U});const{x:E,y:D}=(0,a.calcXY)(V,S,c,b,M);return d.call(this,f,E,D,{e:T,node:h,newPosition:U})}),R(this,"onDragStop",(T,w)=>{let{node:h}=w;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:S}=this.props,{left:c,top:g}=this.state.dragging,f={top:g,left:c};this.setState({dragging:null});const{x:b,y:M}=(0,a.calcXY)(this.getPositionParams(),g,c,s,d);return i.call(this,S,b,M,{e:T,node:h,newPosition:f})}),R(this,"onResizeStop",(T,w,h)=>this.onResizeHandler(T,w,h,"onResizeStop")),R(this,"onResizeStart",(T,w,h)=>this.onResizeHandler(T,w,h,"onResizeStart")),R(this,"onResize",(T,w,h)=>this.onResizeHandler(T,w,h,"onResize"))}shouldComponentUpdate(T,w){if(this.props.children!==T.children||this.props.droppingPosition!==T.droppingPosition)return!0;const h=(0,a.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,a.calcGridItemPosition)(this.getPositionParams(T),T.x,T.y,T.w,T.h,w);return!(0,o.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==T.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(T){this.moveDroppingItem(T)}moveDroppingItem(T){const{droppingPosition:w}=this.props;if(!w)return;const h=this.elementRef.current;if(!h)return;const i=T.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&w.left!==i.left||w.top!==i.top;if(!s)this.onDragStart(w.e,{node:h,deltaX:w.left,deltaY:w.top});else if(d){const S=w.left-s.left,c=w.top-s.top;this.onDrag(w.e,{node:h,deltaX:S,deltaY:c})}}getPositionParams(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:T.cols,containerPadding:T.containerPadding,containerWidth:T.containerWidth,margin:T.margin,maxRows:T.maxRows,rowHeight:T.rowHeight}}createStyle(T){const{usePercentages:w,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,o.setTransform)(T):(s=(0,o.setTopLeft)(T),w&&(s.left=(0,o.perc)(T.left/h),s.width=(0,o.perc)(T.width/h))),s}mixinDraggable(T,w){return t.default.createElement(r.DraggableCore,{disabled:!w,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},T)}curryResizeHandler(T,w){return(h,i)=>w(h,i,T)}mixinResizable(T,w,h){const{cols:i,minW:s,minH:d,maxW:S,maxH:c,transformScale:g,resizeHandles:f,resizeHandle:b}=this.props,M=this.getPositionParams(),L=(0,a.calcGridItemPosition)(M,0,0,i,0).width,V=(0,a.calcGridItemPosition)(M,0,0,s,d),U=(0,a.calcGridItemPosition)(M,0,0,S,c),E=[V.width,V.height],D=[Math.min(U.width,L),Math.min(U.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:w.width,height:w.height,minConstraints:E,maxConstraints:D,onResizeStop:this.curryResizeHandler(w,this.onResizeStop),onResizeStart:this.curryResizeHandler(w,this.onResizeStart),onResize:this.curryResizeHandler(w,this.onResize),transformScale:g,resizeHandles:f,handle:b},T)}onResizeHandler(T,w,h,i){let{node:s,size:d,handle:S}=w;const c=this.props[i];if(!c)return;const{x:g,y:f,i:b,maxH:M,minH:L,containerWidth:V}=this.props,{minW:U,maxW:E}=this.props;let D=d;s&&(D=(0,o.resizeItemInDirection)(S,h,d,V),this.setState({resizing:i==="onResizeStop"?null:D}));let{w:W,h:q}=(0,a.calcWH)(this.getPositionParams(),D.width,D.height,g,f,S);W=(0,a.clamp)(W,Math.max(U,1),E),q=(0,a.clamp)(q,L,M),c.call(this,b,W,q,{e:T,node:s,size:D,handle:S})}render(){const{x:T,y:w,w:h,h:i,isDraggable:s,isResizable:d,droppingPosition:S,useCSSTransforms:c}=this.props,g=(0,a.calcGridItemPosition)(this.getPositionParams(),T,w,h,i,this.state),f=t.default.Children.only(this.props.children);let b=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:!!S,cssTransforms:c}),style:{...this.props.style,...f.props.style,...this.createStyle(g)}});return b=this.mixinResizable(b,g,d),b=this.mixinDraggable(b,s),b}};return et.default=x,R(x,"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,T){const w=I[T];if(typeof w!="number")return new Error("minWidth not Number");if(w>I.w||w>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,T){const w=I[T];if(typeof w!="number")return new Error("maxWidth not Number");if(w<I.w||w<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,T){const w=I[T];if(typeof w!="number")return new Error("minHeight not Number");if(w>I.h||w>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,T){const w=I[T];if(typeof w!="number")return new Error("maxHeight not Number");if(w<I.h||w<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:l.resizeHandleAxesType,resizeHandle:l.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),R(x,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),et}var lr;function ur(){if(lr)return Je;lr=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=R(j),e=on(),r=y(an()),n=Ve(),o=ln(),a=y(lo()),l=y(ir());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 R(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},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in h)if(c!=="default"&&Object.prototype.hasOwnProperty.call(h,c)){var g=S?Object.getOwnPropertyDescriptor(h,c):null;g&&(g.get||g.set)?Object.defineProperty(d,c,g):d[c]=h[c]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=C(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function C(h){var i=x(h,"string");return typeof i=="symbol"?i:String(i)}function x(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I="react-grid-layout";let T=!1;try{T=/firefox/i.test(navigator.userAgent)}catch{}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,d,S)=>{let{e:c,node:g}=S;const{layout:f}=this.state,b=(0,n.getLayoutItem)(f,i);if(!b)return;const M={w:b.w,h:b.h,x:b.x,y:b.y,placeholder:!0,i};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(b),oldLayout:f,activeDrag:M}),this.props.onDragStart(f,b,b,null,c,g)}),m(this,"onDrag",(i,s,d,S)=>{let{e:c,node:g}=S;const{oldDragItem:f}=this.state;let{layout:b}=this.state;const{cols:M,allowOverlap:L,preventCollision:V}=this.props,U=(0,n.getLayoutItem)(b,i);if(!U)return;const E={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i};b=(0,n.moveElement)(b,U,s,d,!0,V,(0,n.compactType)(this.props),M,L),this.props.onDrag(b,f,U,E,c,g),this.setState({layout:L?b:(0,n.compact)(b,(0,n.compactType)(this.props),M),activeDrag:E})}),m(this,"onDragStop",(i,s,d,S)=>{let{e:c,node:g}=S;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:b}=this.state;const{cols:M,preventCollision:L,allowOverlap:V}=this.props,U=(0,n.getLayoutItem)(b,i);if(!U)return;b=(0,n.moveElement)(b,U,s,d,!0,L,(0,n.compactType)(this.props),M,V);const D=V?b:(0,n.compact)(b,(0,n.compactType)(this.props),M);this.props.onDragStop(D,f,U,null,c,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:D,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(D,W)}),m(this,"onResizeStart",(i,s,d,S)=>{let{e:c,node:g}=S;const{layout:f}=this.state,b=(0,n.getLayoutItem)(f,i);b&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(b),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,b,b,null,c,g))}),m(this,"onResize",(i,s,d,S)=>{let{e:c,node:g,size:f,handle:b}=S;const{oldResizeItem:M}=this.state,{layout:L}=this.state,{cols:V,preventCollision:U,allowOverlap:E}=this.props;let D=!1,W,q,Y;const[ne,ee]=(0,n.withLayoutItem)(L,i,k=>{let oe;return q=k.x,Y=k.y,["sw","w","nw","n","ne"].indexOf(b)!==-1&&(["sw","nw","w"].indexOf(b)!==-1&&(q=k.x+(k.w-s),s=k.x!==q&&q<0?k.w:s,q=q<0?0:q),["ne","n","nw"].indexOf(b)!==-1&&(Y=k.y+(k.h-d),d=k.y!==Y&&Y<0?k.h:d,Y=Y<0?0:Y),D=!0),U&&!E&&(oe=(0,n.getAllCollisions)(L,{...k,w:s,h:d,x:q,y:Y}).filter(ue=>ue.i!==k.i).length>0,oe&&(Y=k.y,d=k.h,q=k.x,s=k.w,D=!1)),k.w=s,k.h=d,k});if(!ee)return;W=ne,D&&(W=(0,n.moveElement)(ne,ee,q,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),V,E));const F={w:ee.w,h:ee.h,x:ee.x,y:ee.y,static:!0,i};this.props.onResize(W,M,ee,F,c,g),this.setState({layout:E?W:(0,n.compact)(W,(0,n.compactType)(this.props),V),activeDrag:F})}),m(this,"onResizeStop",(i,s,d,S)=>{let{e:c,node:g}=S;const{layout:f,oldResizeItem:b}=this.state,{cols:M,allowOverlap:L}=this.props,V=(0,n.getLayoutItem)(f,i),U=L?f:(0,n.compact)(f,(0,n.compactType)(this.props),M);this.props.onResizeStop(U,b,V,null,c,g);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,E)}),m(this,"onDragOver",i=>{var ne;if(i.preventDefault(),i.stopPropagation(),T&&!((ne=i.nativeEvent.target)!=null&&ne.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:d,margin:S,cols:c,rowHeight:g,maxRows:f,width:b,containerPadding:M,transformScale:L}=this.props,V=d==null?void 0:d(i);if(V===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...V},{layout:E}=this.state,D=i.currentTarget.getBoundingClientRect(),W=i.clientX-D.left,q=i.clientY-D.top,Y={left:W/L,top:q/L,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ee,top:F}=this.state.droppingPosition;(ee!=W||F!=q)&&this.setState({droppingPosition:Y})}}else{const ee={cols:c,margin:S,maxRows:f,rowHeight:g,containerWidth:b,containerPadding:M||S},F=(0,o.calcXY)(ee,q,W,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:Y,layout:[...E,{...U,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:d}=this.state,S=(0,n.compact)(d.filter(c=>c.i!==i.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:S,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,S=d.find(c=>c.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,S,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,S=s.layout;this.onLayoutMaybeChanged(d,S)}}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:S,containerPadding:c,rowHeight:g,maxRows:f,useCSSTransforms:b,transformScale:M}=this.props;return t.createElement(a.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:S,containerPadding:c||S,maxRows:f,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:b,transformScale:M},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:S,cols:c,margin:g,containerPadding:f,rowHeight:b,maxRows:M,isDraggable:L,isResizable:V,isBounded:U,useCSSTransforms:E,transformScale:D,draggableCancel:W,draggableHandle:q,resizeHandles:Y,resizeHandle:ne}=this.props,{mounted:ee,droppingPosition:F}=this.state,k=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&L,oe=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&V,ie=d.resizeHandles||Y,ue=k&&U&&d.isBounded!==!1;return t.createElement(a.default,{containerWidth:S,cols:c,margin:g,containerPadding:f||g,maxRows:M,rowHeight:b,cancel:W,handle:q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:k,isResizable:oe,isBounded:ue,useCSSTransforms:E&&ee,usePercentages:!ee,transformScale:D,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:ie,resizeHandle:ne},i)}render(){const{className:i,style:s,isDroppable:d,innerRef:S}=this.props,c=(0,r.default)(I,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:S,className:c,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 Je.default=w,m(w,"displayName","ReactGridLayout"),m(w,"propTypes",l.default),m(w,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Je}var st={},Me={},cr;function dr(){if(cr)return Me;cr=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.findOrGenerateResponsiveLayout=n,Me.getBreakpointFromWidth=e,Me.getColsFromBreakpoint=r,Me.sortBreakpoints=o;var t=Ve();function e(a,l){const y=o(a);let p=y[0];for(let R=1,m=y.length;R<m;R++){const C=y[R];l>a[C]&&(p=C)}return p}function r(a,l){if(!l[a])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+a+" is missing!");return l[a]}function n(a,l,y,p,R,m){if(a[y])return(0,t.cloneLayout)(a[y]);let C=a[p];const x=o(l),I=x.slice(x.indexOf(y));for(let T=0,w=I.length;T<w;T++){const h=I[T];if(a[h]){C=a[h];break}}return C=(0,t.cloneLayout)(C||[]),(0,t.compact)((0,t.correctBounds)(C,{cols:R}),m,R)}function o(a){return Object.keys(a).sort(function(y,p){return a[y]-a[p]})}return Me}var fr;function uo(){if(fr)return st;fr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;var t=p(j),e=l(xe()),r=on(),n=Ve(),o=dr(),a=l(ur());function l(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},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in h)if(c!=="default"&&Object.prototype.hasOwnProperty.call(h,c)){var g=S?Object.getOwnPropertyDescriptor(h,c):null;g&&(g.get||g.set)?Object.defineProperty(d,c,g):d[c]=h[c]}return d.default=h,s&&s.set(h,d),d}function R(){return R=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},R.apply(this,arguments)}function m(h,i,s){return i=C(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function C(h){var i=x(h,"string");return typeof i=="symbol"?i:String(i)}function x(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function T(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let w=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:S}=this.props,c=(0,o.getBreakpointFromWidth)(s,i),g=(0,o.getColsFromBreakpoint)(c,S),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(d,s,c,c,g,f),breakpoint:c,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,r.deepEqual)(i.layouts,s.layouts)){const{breakpoint:d,cols:S}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,d,d,S,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:S,compactType:c}=this.props,g=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,b=(0,o.getColsFromBreakpoint)(g,d),M={...S};if(f!==g||i.breakpoints!==s||i.cols!==d){f in M||(M[f]=(0,n.cloneLayout)(this.state.layout));let U=(0,o.findOrGenerateResponsiveLayout)(M,s,g,f,b,c);U=(0,n.synchronizeLayoutWithChildren)(U,this.props.children,b,c,this.props.allowOverlap),M[g]=U,this.props.onBreakpointChange(g,b),this.props.onLayoutChange(U,M),this.setState({breakpoint:g,layout:U,cols:b})}const L=T(this.props.margin,g),V=T(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,L,b,V)}render(){const{breakpoint:i,breakpoints:s,cols:d,layouts:S,margin:c,containerPadding:g,onBreakpointChange:f,onLayoutChange:b,onWidthChange:M,...L}=this.props;return t.createElement(a.default,R({},L,{margin:T(c,this.state.breakpoint),containerPadding:T(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return st.default=w,m(w,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,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,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(w,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),st}var Et={},pr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,a){return o[0]===r?(n=a,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,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 o=0,a=this.__entries__;o<a.length;o++){var l=a[o];r.call(n,l[1],l[0])}},e}()}(),mn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),co=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),fo=2;function po(t,e){var r=!1,n=!1,o=0;function a(){r&&(r=!1,t()),n&&y()}function l(){co(a)}function y(){var p=Date.now();if(r){if(p-o<fo)return;n=!0}else r=!0,n=!1,setTimeout(l,e);o=p}return y}var ho=20,mo=["top","right","bottom","left","width","height","size","weight"],go=typeof MutationObserver<"u",vo=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=po(this.refresh.bind(this),ho)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!mn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),go?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!mn||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,o=mo.some(function(a){return!!~n.indexOf(a)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),hr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},ze=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Ot},mr=Mt(0,0,0,0);function Pt(t){return parseFloat(t)||0}function gr(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var a=t["border-"+o+"-width"];return n+Pt(a)},0)}function yo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var a=o[n],l=t["padding-"+a];r[a]=Pt(l)}return r}function So(t){var e=t.getBBox();return Mt(0,0,e.width,e.height)}function bo(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return mr;var n=ze(t).getComputedStyle(t),o=yo(n),a=o.left+o.right,l=o.top+o.bottom,y=Pt(n.width),p=Pt(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+a)!==e&&(y-=gr(n,"left","right")+a),Math.round(p+l)!==r&&(p-=gr(n,"top","bottom")+l)),!Co(t)){var R=Math.round(y+a)-e,m=Math.round(p+l)-r;Math.abs(R)!==1&&(y-=R),Math.abs(m)!==1&&(p-=m)}return Mt(o.left,o.top,y,p)}var Ro=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ze(t).SVGGraphicsElement}:function(t){return t instanceof ze(t).SVGElement&&typeof t.getBBox=="function"}}();function Co(t){return t===ze(t).document.documentElement}function To(t){return mn?Ro(t)?So(t):bo(t):mr}function Io(t){var e=t.x,r=t.y,n=t.width,o=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(a.prototype);return hr(l,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),l}function Mt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var wo=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Mt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=To(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}(),_o=function(){function t(e,r){var n=Io(r);hr(this,{target:e,contentRect:n})}return t}(),xo=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new pr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new wo(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new _o(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),vr=typeof WeakMap<"u"?new WeakMap:new pr,yr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=vo.getInstance(),n=new xo(e,r,this);vr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){yr.prototype[t]=function(){var e;return(e=vr.get(this))[t].apply(e,arguments)}});var Eo=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:yr}();const Oo=_n(Object.freeze(Object.defineProperty({__proto__:null,default:Eo},Symbol.toStringTag,{value:"Module"})));var Sr;function Po(){if(Sr)return Et;Sr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=x;var t=l(j),e=o(xe()),r=o(Oo),n=o(an());function o(I){return I&&I.__esModule?I:{default:I}}function a(I){if(typeof WeakMap!="function")return null;var T=new WeakMap,w=new WeakMap;return(a=function(h){return h?w:T})(I)}function l(I,T){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var w=a(T);if(w&&w.has(I))return w.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 d=i?Object.getOwnPropertyDescriptor(I,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=I[s]}return h.default=I,w&&w.set(I,h),h}function y(){return y=Object.assign?Object.assign.bind():function(I){for(var T=1;T<arguments.length;T++){var w=arguments[T];for(var h in w)Object.prototype.hasOwnProperty.call(w,h)&&(I[h]=w[h])}return I},y.apply(this,arguments)}function p(I,T,w){return T=R(T),T in I?Object.defineProperty(I,T,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[T]=w,I}function R(I){var T=m(I,"string");return typeof T=="symbol"?T:String(T)}function m(I,T){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,T||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}const C="react-grid-layout";function x(I){var T;return T=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,C),style:this.props.style,ref:this.elementRef}):t.createElement(I,y({innerRef:this.elementRef},i,this.state))}},p(T,"defaultProps",{measureBeforeMount:!1}),p(T,"propTypes",{measureBeforeMount:e.default.bool}),T}return Et}var br;function Mo(){return br||(br=1,function(t){t.exports=ur().default,t.exports.utils=Ve(),t.exports.calculateUtils=ln(),t.exports.Responsive=uo().default,t.exports.Responsive.utils=dr(),t.exports.WidthProvider=Po().default}(rn)),rn.exports}var Do=Mo();const No=Ar(Do);var jo=Object.defineProperty,Lo=Object.getOwnPropertyDescriptor,Uo=(t,e,r,n)=>{for(var o=n>1?void 0:n?Lo(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&jo(e,r,o),o},Vo=(t,e)=>(r,n)=>e(r,n,t);let Ae=class extends v.Disposable{constructor(e){super();Pe(this,"_initLocal",()=>{});Pe(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),a=n&&this._localeService.resolveKeyPath(n,o);if(typeof a=="string"){const l=[];return this._findReplaceIndex(a).forEach((y,p,R)=>{const m=R[p-1]||{startIndex:0,endIndex:-1};if(m.endIndex+1<y.startIndex){const C=a.slice(m.endIndex+1,y.startIndex);C&&l.push(C)}if(r[y.key]&&l.push(r[y.key]),p===R.length-1){const C=a.slice(y.endIndex+1);C&&l.push(C)}}),l}return[]}};Ae=Uo([Vo(0,v.Inject(v.LocaleService))],Ae);const Dt={cfPreview:"univer-cf-preview"},We=t=>{var o,a;const e=t.rule;if(!e)return null;const r=j.useMemo(()=>{if(e.type===u.CFRuleType.colorScale){const l=e.config.map((R,m)=>({color:new v.ColorKit(R.color),value:m})),y=l.length-1;return new Array(5).fill("").map((R,m,C)=>m*y/(C.length-1)).map(R=>u.getColorScaleFromValue(l,R))}return null},[e]),n=j.useMemo(()=>{if(e.type===u.CFRuleType.iconSet)return e.config.map(l=>{const y=u.iconMap[l.iconType];return y&&y[Number(l.iconId)]})},[e]);switch(e.type){case u.CFRuleType.dataBar:{const{isGradient:l}=e.config,y={width:"50%",height:"100%"},p=l?`linear-gradient(to right, ${e.config.positiveColor||u.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,R=l?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||u.defaultDataBarNativeColor})`:e.config.nativeColor;return _.jsxs("div",{className:Dt.cfPreview,children:[_.jsx("div",{style:{...y,background:R,border:`1px solid ${e.config.nativeColor||u.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||u.defaultDataBarPositiveColor}`}})]})}case u.CFRuleType.colorScale:return r&&_.jsx("div",{className:Dt.cfPreview,children:r.map((l,y)=>_.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:l}},y))});case u.CFRuleType.iconSet:return n&&_.jsx("div",{className:Dt.cfPreview,children:n.map((l,y)=>l?_.jsx("img",{style:{height:"100%"},src:l},y):_.jsx(Ze,{},y))});case u.CFRuleType.highlightCell:{const{ul:l,st:y,it:p,bl:R,bg:m,cl:C}=e.style,x=(l==null?void 0:l.s)===v.BooleanNumber.TRUE,I=(y==null?void 0:y.s)===v.BooleanNumber.TRUE,T=p===v.BooleanNumber.TRUE,w=R===v.BooleanNumber.TRUE,h=(o=m==null?void 0:m.rgb)!=null?o:u.DEFAULT_BG_COLOR,i=(a=C==null?void 0:C.rgb)!=null?a:u.DEFAULT_FONT_COLOR,s={fontWeight:w?"bold":void 0,fontStyle:T?"italic":void 0,textDecoration:`${x?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return _.jsx("div",{style:s,className:Dt.cfPreview,children:"123"})}}return null},pe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap",reactGridItem:"univer-react-grid-item"},zo=(t,e)=>{const r=t.rule;switch(r.type){case u.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case u.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case u.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case u.CFRuleType.highlightCell:switch(r.subType){case u.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case u.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case u.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case u.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(o=>String(o)):[String(r.value||"")])}case u.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case u.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case u.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 u.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let Rr=0;const Ao=t=>{const{onClick:e}=t,r=v.useDependency(u.ConditionalFormattingRuleModel),n=v.useDependency(v.IUniverInstanceService),o=v.useDependency(X.SheetsSelectionsService),a=v.useDependency(v.ICommandService),l=v.useDependency(v.LocaleService),y=v.useDependency(v.Injector),p=v.useDependency(Ae),R=ge.useObservable(()=>n.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=R.getUnitId(),C=R.getActiveSheet();if(!C)throw new Error("No active sheet found");const x=C.getSheetId(),[I,T]=j.useState([]),[w,h]=j.useState("2"),[i,s]=j.useState(0),[d,S]=j.useState(-1),[c,g]=j.useState(Rr),f=j.useRef(null),b=[{label:l.t("sheet.cf.panel.workSheet"),value:"2"},{label:l.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const F=r.getSubunitRules(m,x);if(!F||!F.length)return[];if(w==="1"){const k=o.getCurrentLastSelection();if(!k)return[];const oe=k.range;return F.filter(ue=>ue.ranges.some(he=>v.Rectangle.intersects(he,oe)))}else if(w==="2")return[...F];return[]},[L,V]=j.useState(M);de.useHighlightRange(I),j.useEffect(()=>{const F=a.onCommandExecuted(k=>{k.id===X.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),j.useEffect(()=>{V(M)},[w,i,m,x]),j.useEffect(()=>{if(w==="2")return;const F=new Re.Observable(k=>{const oe=[X.SetSelectionsOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],ie=a.onCommandExecuted(ue=>{const{id:he,params:ye}=ue,Ce=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId();oe.includes(he)&&ye.unitId===Ce&&k.next(null)});return()=>ie.dispose()}).pipe(Re.debounceTime(16)).subscribe(()=>{V(M)});return()=>{F.unsubscribe()}},[n,w,m,x]),j.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),j.useEffect(()=>{const F=()=>{var ue;const ie=Math.max(0,(((ue=f.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return Rr=ie,ie},oe=new Re.Observable(ie=>{const ue=document.querySelector(".univer-sidebar");if(ue){let he=setTimeout(()=>{ie.next()},150);const ye=()=>{he&&clearTimeout(he),he=null},Ce=B=>{B.propertyName==="width"&&(ye(),ie.next())};return ue.addEventListener("transitionend",Ce),()=>{ye(),ue.removeEventListener("transitionend",Ce)}}}).pipe(Re.debounceTime(16)).subscribe(()=>{g(F())});return()=>{oe.unsubscribe()}},[]);const U=F=>{var ie;const k=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),oe=(ie=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!k||!oe)throw new Error("No active sheet found");a.executeCommand($e.id,{unitId:k,subUnitId:oe,cfId:F.cfId})},E=(F,k)=>{S(k.y)},D=(F,k,oe)=>{var B;S(-1);const ie=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(B=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:B.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const he=Q=>{const se=L.length;return Math.min(se-1,Math.max(0,Q))},ye=L[he(k.y)].cfId,Ce=L[he(oe.y)].cfId;ye!==Ce&&a.executeCommand(bt.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Ce,type:oe.y>k.y?"after":"before"}})},W=()=>{t.onCreate()},q=()=>{w==="2"?a.executeCommand(Ye.id):w==="1"&&L.map(k=>({unitId:m,subUnitId:x,cfId:k.cfId})).forEach(k=>{a.executeCommand($e.id,k)})},Y=j.useMemo(()=>{const F=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),k=F.getActiveSheet();return L.filter(oe=>{const ie=oe.ranges;return X.checkRangesEditablePermission(y,F.getUnitId(),k.getSheetId(),ie)})},[L]),ne=Y.map((F,k)=>({i:F.cfId,x:0,w:12,y:k,h:1,isResizable:!1})),ee=j.useMemo(()=>{const F=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),k=F.getActiveSheet();return L.every(oe=>{const ie=oe.ranges;return X.checkRangesEditablePermission(y,F.getUnitId(),k.getSheetId(),ie)})},[L]);return _.jsxs("div",{className:pe.cfRuleList,children:[_.jsxs("div",{className:pe.ruleSelector,children:[_.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(re.Select,{className:pe.select,options:b,value:w,onChange:F=>{h(F)}})).map((F,k)=>_.jsx("span",{children:F},k))}),_.jsxs("div",{className:pe.btnList,children:[_.jsx(re.Tooltip,{title:l.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:`
|
|
21
|
+
${pe.icon}
|
|
22
|
+
`,onClick:W,children:_.jsx(Pn,{})})}),L.length&&ee?_.jsx(re.Tooltip,{title:l.t("sheet.cf.panel.clear"),placement:"bottom",children:_.jsx("div",{className:`
|
|
23
|
+
${pe.gap}
|
|
24
|
+
${pe.icon}
|
|
25
|
+
`,onClick:q,children:_.jsx(Ct,{})})}):_.jsx("div",{className:`
|
|
26
|
+
${pe.gap}
|
|
27
|
+
${pe.disabled}
|
|
28
|
+
`,children:_.jsx(Ct,{})})]})]}),_.jsx("div",{ref:f,className:pe.gridLayoutWrap,children:c?_.jsx(No,{onDragStop:D,onDragStart:E,layout:ne,cols:12,rowHeight:60,width:c,margin:[0,10],draggableHandle:".draggableHandle",children:Y==null?void 0:Y.map((F,k)=>_.jsx("div",{children:_.jsxs("div",{onMouseMove:()=>{F.ranges!==I&&T(F.ranges)},onMouseLeave:()=>T([]),onClick:()=>{e(F)},className:`
|
|
29
|
+
${pe.ruleItem}
|
|
30
|
+
${d===k?pe.active:""}
|
|
31
|
+
`,children:[_.jsx("div",{className:`
|
|
32
|
+
${pe.draggableHandle}
|
|
33
|
+
|
|
34
|
+
draggableHandle
|
|
35
|
+
`,onClick:oe=>oe.stopPropagation(),children:_.jsx(Mn,{})}),_.jsxs("div",{className:pe.ruleDescribe,children:[_.jsx("div",{className:pe.ruleType,children:zo(F,l)}),_.jsx("div",{className:pe.ruleRange,children:F.ranges.map(oe=>qt.serializeRange(oe)).join(",")})]}),_.jsx("div",{className:pe.preview,children:_.jsx(We,{rule:F.rule})}),_.jsx("div",{className:`
|
|
36
|
+
${pe.deleteItem}
|
|
37
|
+
${d===k?pe.active:""}
|
|
38
|
+
`,onClick:oe=>{oe.stopPropagation(),U(F),T([])},children:_.jsx(Ct,{})})]})},`${F.cfId}`))}):null})]})},gn={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},De=t=>{const{color:e,onChange:r,disable:n=!1,iconId:o="PaintBucket",className:a,isNeedDropdownIcon:l=!0}=t,y=v.useDependency(ge.ComponentManager),p=j.useMemo(()=>new v.ColorKit(e),[e]),R=y.get(o);return R&&(n?_.jsx(R,{className:a,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):_.jsx(re.DropdownLegacy,{overlay:_.jsx("div",{className:`
|
|
39
|
+
${gn.cfColorPicker}
|
|
40
|
+
`,children:_.jsx(re.ColorPicker,{color:e,onChange:r})}),children:_.jsxs("span",{className:`
|
|
41
|
+
${gn.cfColorPickerIcon}
|
|
42
|
+
${a}
|
|
43
|
+
`,children:[_.jsx(R,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),l&&_.jsx(Tt,{className:gn.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),vn=t=>{var T;const{type:e,className:r,onChange:n,id:o,value:a}=t,l=v.useDependency(v.IUniverInstanceService),y=l.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(T=l.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId(),R=j.useMemo(()=>String(a).startsWith("=")?String(a):"=",[a]),m=j.useMemo(()=>[u.CFValueType.max,u.CFValueType.min,"none"].includes(e)?{disabled:!0}:[u.CFValueType.percent,u.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),C=j.useRef({}),[x,I]=j.useState(!1);return ge.useSidebarClick(w=>{var i;const h=(i=C.current)==null?void 0:i.handleOutClick;h&&h(w,()=>I(!1))}),e===u.CFValueType.formula?_.jsx("div",{style:{width:"100%",marginLeft:4},children:_.jsx(Ge.FormulaEditor,{initValue:R,unitId:y,subUnitId:p,isFocus:x,onChange:(w="")=>{n(w||"")},onFocus:()=>I(!0),actions:C.current})}):_.jsx(re.InputNumber,{className:r,value:Number(t.value)||0,onChange:w=>t.onChange(w||0),...m})},Wo=t=>{var U;const{interceptorManager:e}=t,r=v.useDependency(v.LocaleService),n=((U=t.rule)==null?void 0:U.type)===u.CFRuleType.colorScale?t.rule:void 0,o=[Ne(u.CFValueType.num,r),Ne(u.CFValueType.percent,r),Ne(u.CFValueType.percentile,r),Ne(u.CFValueType.formula,r)],a=[Ne(u.CFValueType.min,r),...o],l=[Ne("none",r),...o],y=[Ne(u.CFValueType.max,r),...o],[p,R]=j.useState(()=>{var D;const E=u.CFValueType.min;return n&&((D=n.config[0])==null?void 0:D.value.type)||E}),[m,C]=j.useState(()=>{var D;const E="none";return!n||n.config.length!==3?E:((D=n.config[1])==null?void 0:D.value.type)||E}),[x,I]=j.useState(()=>{var D;const E=u.CFValueType.max;return n&&((D=n.config[n.config.length-1])==null?void 0:D.value.type)||E}),[T,w]=j.useState(()=>{if(!n)return 10;const D=n.config[0];return(D==null?void 0:D.value.value)===void 0?10:D==null?void 0:D.value.value}),[h,i]=j.useState(()=>{var W;if(!n||n.config.length!==3)return 50;const D=(W=n.config[1])==null?void 0:W.value.value;return D===void 0?50:D}),[s,d]=j.useState(()=>{var W;if(!n)return 90;const D=(W=n.config[n.config.length-1])==null?void 0:W.value.value;return D===void 0?90:D}),[S,c]=j.useState(()=>{var D;const E="#d0d9fb";return n&&((D=n.config[0])==null?void 0:D.color)||E}),[g,f]=j.useState(()=>{var D;const E="#7790f3";return!n||n.config.length!==3?E:((D=n.config[1])==null?void 0:D.color)||E}),[b,M]=j.useState(()=>{var D;const E="#2e55ef";return n&&((D=n.config[n.config.length-1])==null?void 0:D.color)||E}),L=j.useMemo(()=>E=>{const{minType:D,medianType:W,maxType:q,minValue:Y,medianValue:ne,maxValue:ee,minColor:F,medianColor:k,maxColor:oe}=E,ie=[];return ie.push({color:F,value:{type:D,value:Y}}),W!=="none"&&ie.push({color:k,value:{type:W,value:ne}}),ie.push({color:oe,value:{type:q,value:ee}}),{config:ie.map((he,ye)=>({...he,index:ye})),type:u.CFRuleType.colorScale}},[]);j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return L({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:b})}}),[L,p,m,x,T,h,s,S,g,b,e]);const V=E=>{t.onChange(L(E))};return _.jsxs("div",{children:[_.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
44
|
+
${G.cfPreviewWrap}
|
|
45
|
+
`,children:_.jsx(We,{rule:L({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:b})})}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
|
|
46
|
+
${A.labelContainer}
|
|
47
|
+
${A.mTSm}
|
|
48
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:a,value:p,onChange:E=>{R(E);const D=u.createDefaultValueByValueType(E,10);w(D),V({minType:E,medianType:m,maxType:x,minValue:D,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:b})}}),_.jsx(vn,{id:"min",className:`
|
|
49
|
+
${A.mLXxs}
|
|
50
|
+
`,value:T,type:p,onChange:E=>{w(E),V({minType:p,medianType:m,maxType:x,minValue:E,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:b})}}),_.jsx(De,{className:A.mLXxs,color:S,onChange:E=>{c(E),V({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:E,medianColor:g,maxColor:b})}})]}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.medianValue")}),_.jsxs("div",{className:`
|
|
51
|
+
${A.labelContainer}
|
|
52
|
+
${A.mTSm}
|
|
53
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:l,value:m,onChange:E=>{C(E);const D=u.createDefaultValueByValueType(E,50);i(D),V({minType:p,medianType:E,maxType:x,minValue:T,medianValue:D,maxValue:s,minColor:S,medianColor:g,maxColor:b})}}),_.jsx(vn,{id:"median",className:`
|
|
54
|
+
${A.mLXxs}
|
|
55
|
+
`,value:h,type:m,onChange:E=>{i(E),V({minType:p,medianType:m,maxType:x,minValue:T,medianValue:E,maxValue:s,minColor:S,medianColor:g,maxColor:b})}}),m!=="none"&&_.jsx(De,{className:A.mLXxs,color:g,onChange:E=>{f(E),V({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:S,medianColor:E,maxColor:b})}})]}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
|
|
56
|
+
${A.labelContainer}
|
|
57
|
+
${A.mTSm}
|
|
58
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},options:y,value:x,onChange:E=>{I(E);const D=u.createDefaultValueByValueType(E,90);d(D),V({minType:p,medianType:m,maxType:E,minValue:T,medianValue:h,maxValue:D,minColor:S,medianColor:g,maxColor:b})}}),_.jsx(vn,{id:"max",className:`
|
|
59
|
+
${A.mLXxs}
|
|
60
|
+
`,value:s,type:x,onChange:E=>{d(E),V({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:E,minColor:S,medianColor:g,maxColor:b})}}),_.jsx(De,{className:A.mLXxs,color:b,onChange:E=>{M(E),V({minType:p,medianType:m,maxType:x,minValue:T,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:E})}})]})]})},He=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Cr=t=>{var w;const{onChange:e,className:r,value:n,type:o,id:a,disabled:l=!1}=t,y=v.useDependency(v.IUniverInstanceService),p=y.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),R=(w=y.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId(),m=j.useRef({}),[C,x]=j.useState(!1);ge.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>x(!1))});const I=j.useRef(n),T=j.useMemo(()=>[u.CFValueType.percentile,u.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===u.CFValueType.formula){const h=String(I.current).startsWith("=")?String(I.current)||"":"=";return _.jsx("div",{style:{width:"100%",marginLeft:12},children:_.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:R,isFocus:C,onChange:(i="")=>{e(i||"")},onFocus:()=>x(!0),actions:m.current})})}return _.jsx(re.InputNumber,{className:r,value:Number(n)||0,disabled:l,onChange:h=>{e(h||0)},...T})},Ho=t=>{var U;const{interceptorManager:e}=t,r=v.useDependency(v.LocaleService),n=((U=t.rule)==null?void 0:U.type)===u.CFRuleType.dataBar?t.rule:void 0,[o,a]=j.useState(()=>{var D;const E="0";return n?(D=n.config)!=null&&D.isGradient?"1":"0":E}),[l,y]=j.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.positiveColor)||u.defaultDataBarPositiveColor}),[p,R]=j.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.nativeColor)||u.defaultDataBarNativeColor}),m=[He(u.CFValueType.num,r),He(u.CFValueType.percent,r),He(u.CFValueType.percentile,r),He(u.CFValueType.formula,r)],C=[He(u.CFValueType.min,r),...m],x=[He(u.CFValueType.max,r),...m],[I,T]=j.useState(()=>{var D;const E=C[0].value;return n&&((D=n.config)==null?void 0:D.min.type)||E}),[w,h]=j.useState(()=>{var D;const E=x[0].value;return n&&((D=n.config)==null?void 0:D.max.type)||E}),[i,s]=j.useState(()=>{var W;if(!n)return 0;const D=((W=n.config)==null?void 0:W.min)||{};return D.type===u.CFValueType.formula?D.value||"=":D.value||0}),[d,S]=j.useState(()=>{var W;if(!n)return 100;const D=((W=n.config)==null?void 0:W.max)||{};return D.type===u.CFValueType.formula?D.value||"=":D.value===void 0?100:D.value}),[c,g]=j.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),f=E=>({config:{min:{type:E.minValueType,value:E.minValue},max:{type:E.maxValueType,value:E.maxValue},isGradient:E.isGradient==="1",positiveColor:E.positiveColor||u.defaultDataBarPositiveColor,nativeColor:E.nativeColor||u.defaultDataBarNativeColor},type:u.CFRuleType.dataBar,isShowValue:E.isShowValue});j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return f({isGradient:o,minValue:i,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:c})}}),[o,i,I,d,w,l,p,e,c]);const b=E=>{t.onChange(f(E))},M=E=>{y(E),b({isGradient:o,minValue:i,minValueType:I,maxValue:d,maxValueType:w,positiveColor:E,nativeColor:p,isShowValue:c})},L=E=>{R(E),b({isGradient:o,minValue:i,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:E,isShowValue:c})},V=E=>m.map(D=>D.value).includes(E);return _.jsxs("div",{children:[_.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
61
|
+
${G.cfPreviewWrap}
|
|
62
|
+
`,children:_.jsx(We,{rule:f({isGradient:o,minValue:i,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:c})})}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.fillType")}),_.jsxs("div",{className:`
|
|
63
|
+
${A.mTSm}
|
|
64
|
+
${A.mLXxs}
|
|
65
|
+
${A.labelContainer}
|
|
66
|
+
`,children:[_.jsxs(re.RadioGroup,{value:o,onChange:E=>{a(E),b({isGradient:E,minValue:i,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:c})},children:[_.jsx(re.Radio,{value:"0",children:_.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.pureColor")})}),_.jsx(re.Radio,{value:"1",children:_.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.gradient")})})]}),_.jsxs("div",{className:`
|
|
67
|
+
${G.utilItem}
|
|
68
|
+
${A.mLXl}
|
|
69
|
+
`,children:[_.jsx(re.Checkbox,{checked:!c,onChange:E=>{g(!E),b({isGradient:E,minValue:i,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:!E})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.colorSet")}),_.jsxs("div",{className:`
|
|
70
|
+
${A.labelContainer}
|
|
71
|
+
${A.mTSm}
|
|
72
|
+
${A.mLXxs}
|
|
73
|
+
`,children:[_.jsxs("div",{className:`
|
|
74
|
+
${A.labelContainer}
|
|
75
|
+
`,children:[_.jsx("div",{className:`
|
|
76
|
+
${G.text}
|
|
77
|
+
`,children:r.t("sheet.cf.panel.native")}),_.jsx(De,{color:p,onChange:L})]}),_.jsxs("div",{className:`
|
|
78
|
+
${A.labelContainer}
|
|
79
|
+
${A.mLSm}
|
|
80
|
+
`,children:[_.jsx("div",{className:`
|
|
81
|
+
${G.text}
|
|
82
|
+
`,children:r.t("sheet.cf.panel.positive")}),_.jsx(De,{color:l,onChange:M})]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
|
|
83
|
+
${A.mTSm}
|
|
84
|
+
${A.labelContainer}
|
|
85
|
+
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:C,value:I,onChange:E=>{T(E);const D=u.createDefaultValueByValueType(E,10);s(D),b({isGradient:o,minValue:D,minValueType:E,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:c})}}),_.jsx(Cr,{disabled:!V(I),id:"min",type:I,className:A.mLSm,value:i,onChange:E=>{s(E||0),b({isGradient:o,minValue:E||0,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:c})}})]}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
|
|
86
|
+
${A.mTSm}
|
|
87
|
+
${A.labelContainer}
|
|
88
|
+
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:x,value:w,onChange:E=>{h(E);const D=u.createDefaultValueByValueType(E,90);S(D),b({isGradient:o,minValue:i,minValueType:I,maxValue:D,maxValueType:E,positiveColor:l,nativeColor:p,isShowValue:c})}}),_.jsx(Cr,{disabled:!V(w),id:"max",type:w,className:A.mLSm,value:d,onChange:E=>{S(E||0),b({isGradient:o,minValue:i,minValueType:I,maxValue:E||0,maxValueType:w,positiveColor:l,nativeColor:p,isShowValue:c})}})]})]})]})};function Tr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=Tr(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Nt(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=Tr(t))&&(n&&(n+=" "),n+=e);return n}const _e={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},jt=t=>[v.BooleanNumber.FALSE,void 0].includes(t)?v.BooleanNumber.TRUE:v.BooleanNumber.FALSE,Lt=t=>t!==v.BooleanNumber.FALSE,yn=t=>{const{style:e,onChange:r,className:n}=t,o=v.useDependency(ge.ComponentManager),[a,l]=j.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=j.useState(()=>{if(e!=null&&e.it)return e.it}),[R,m]=j.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[C,x]=j.useState(()=>{if(e!=null&&e.st)return e.st.s}),[I,T]=j.useState(()=>{var g;const c="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:c}),[w,h]=j.useState(()=>{var g;const c="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:c}),i=o.get("BoldSingle"),s=o.get("ItalicSingle"),d=o.get("UnderlineSingle"),S=o.get("StrikethroughSingle");return j.useEffect(()=>{const c={bl:a,it:y};I!==void 0&&(c.cl={rgb:I}),w!==void 0&&(c.bg={rgb:w}),C!==void 0&&(c.st={s:C}),R!==void 0&&(c.ul={s:R}),r(u.removeUndefinedAttr(c))},[a,y,R,C,I,w]),_.jsxs("div",{className:`
|
|
89
|
+
${_e.cfStyleEdit}
|
|
90
|
+
${n}
|
|
91
|
+
`,children:[i&&_.jsx("div",{className:Nt({[_e.isActive]:Lt(a||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>l(jt(a)),children:_.jsx(i,{})}),s&&_.jsx("div",{className:Nt({[_e.isActive]:Lt(y||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>p(jt(y)),children:_.jsx(s,{})}),d&&_.jsx("div",{className:Nt({[_e.isActive]:Lt(R||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>m(jt(R)),children:_.jsx(d,{})}),S&&_.jsx("div",{className:Nt({[_e.isActive]:Lt(C||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>x(jt(C)),children:_.jsx(S,{})}),_.jsx(De,{color:I,onChange:T,iconId:"FontColor"}),_.jsx(De,{color:w,onChange:h,iconId:"PaintBucket"})]})},ko=t=>{var S;const{onChange:e,interceptorManager:r}=t,n=v.useDependency(v.LocaleService),a=v.useDependency(v.IUniverInstanceService).getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),l=a.getActiveSheet(),y=((S=t.rule)==null?void 0:S.type)===u.CFRuleType.highlightCell?t.rule:void 0,p=j.useRef(null),[R,m]=j.useState(!1),C=j.useRef({}),[x,I]=j.useState({}),[T,w]=j.useState(()=>(y==null?void 0:y.subType)===u.CFSubRuleType.formula?y.value:"="),[h,i]=j.useState(void 0),s=c=>({style:c.style,value:T,type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula});j.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:x,formula:T})}}),[x,T,r]),j.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,f,b)=>h||T.length===1||!T.startsWith("=")?(i(n.t("sheet.cf.errorMessage.formulaError")),!1):b(g)}),[h,T]);const d=c=>{e(s(c))};return ge.useSidebarClick(c=>{var f;const g=(f=C.current)==null?void 0:f.handleOutClick;g&&g(c,()=>m(!1))}),_.jsxs("div",{ref:p,children:[_.jsx("div",{className:`
|
|
92
|
+
${A.title}
|
|
93
|
+
${A.mTBase}
|
|
94
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
95
|
+
${A.mTSm}
|
|
96
|
+
`,children:_.jsx(Ge.FormulaEditor,{onChange:c=>{w(c),d({style:x,formula:c})},onVerify:(c,g)=>{!c||g.length===1?i(n.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:C.current,isFocus:R,initValue:T,unitId:a.getUnitId(),subUnitId:l==null?void 0:l.getSheetId()})}),_.jsx("div",{className:`
|
|
97
|
+
${G.cfPreviewWrap}
|
|
98
|
+
`,children:_.jsx(We,{rule:s({style:x,formula:T})})}),_.jsx(yn,{style:y==null?void 0:y.style,className:`
|
|
99
|
+
${A.mTSm}
|
|
100
|
+
`,onChange:c=>{I(c),d({style:c,formula:T})}})]})},Ut=t=>_.jsxs("div",{style:{position:"relative"},children:[_.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),le=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),Bo=t=>{const{type:e,operator:r,onChange:n,value:o,interceptorManager:a}=t,l=v.useDependency(v.LocaleService),[y,p]=j.useState(()=>typeof o=="number"?o:0),[R,m]=j.useState(""),[C,x]=j.useState(()=>typeof o=="string"?o:""),[I,T]=j.useState(""),[w,h]=j.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[i,s]=j.useState(""),[d,S]=j.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[c,g]=j.useState("");switch(j.useEffect(()=>{switch(e){case u.CFSubRuleType.text:{[u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(r)&&n(C);break}case u.CFSubRuleType.number:{[u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(r)&&n(y),[u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(r)&&n([w,d]);break}}},[e]),j.useEffect(()=>{const f=a.intercept(a.getInterceptPoints().beforeSubmit,{handler:(b,M,L)=>{switch(e){case u.CFSubRuleType.text:if([u.CFTextOperator.beginsWith,u.CFTextOperator.containsText,u.CFTextOperator.endsWith,u.CFTextOperator.notEqual,u.CFTextOperator.notContainsText,u.CFTextOperator.equal].includes(r))return C?L(b):(T(l.t("sheet.cf.errorMessage.notBlank")),!1)}return L(b)}});return()=>{f()}},[e,y,C,r]),e){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(r)){const f=b=>{x(b),n(b)};return _.jsx("div",{className:`
|
|
101
|
+
${A.mTSm}
|
|
102
|
+
`,children:_.jsx(Ut,{errorText:I,children:_.jsx(re.Input,{className:G.width100,value:C,onChange:b=>{T(""),f(b)}})})})}break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(r)){const f=b=>{p(b||0),n(b||0),m("")};return _.jsx("div",{className:`
|
|
103
|
+
${A.mTSm}
|
|
104
|
+
`,children:_.jsx(Ut,{errorText:R,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:y,onChange:f})})})}if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(r)){const f=M=>{h(M||0),n([M||0,d]),s("")},b=M=>{S(M||0),n([w,M||0]),g("")};return _.jsxs("div",{className:`
|
|
105
|
+
${A.mTSm}
|
|
106
|
+
${A.labelContainer}
|
|
107
|
+
`,children:[_.jsx(Ut,{errorText:i,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:w,onChange:f})}),_.jsx(Ut,{errorText:c,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
108
|
+
${A.mLSm}
|
|
109
|
+
`,value:d,onChange:b})})]})}}}return null},Ir=(t,e)=>{switch(t){case u.CFSubRuleType.text:return[le(u.CFTextOperator.containsText,e),le(u.CFTextOperator.notContainsText,e),le(u.CFTextOperator.beginsWith,e),le(u.CFTextOperator.endsWith,e),le(u.CFTextOperator.equal,e),le(u.CFTextOperator.notEqual,e),le(u.CFTextOperator.containsBlanks,e),le(u.CFTextOperator.notContainsBlanks,e),le(u.CFTextOperator.containsErrors,e),le(u.CFTextOperator.notContainsErrors,e)];case u.CFSubRuleType.number:return[le(u.CFNumberOperator.between,e),le(u.CFNumberOperator.notBetween,e),le(u.CFNumberOperator.equal,e),le(u.CFNumberOperator.notEqual,e),le(u.CFNumberOperator.greaterThan,e),le(u.CFNumberOperator.greaterThanOrEqual,e),le(u.CFNumberOperator.lessThan,e),le(u.CFNumberOperator.lessThanOrEqual,e)];case u.CFSubRuleType.timePeriod:return[le(u.CFTimePeriodOperator.yesterday,e),le(u.CFTimePeriodOperator.today,e),le(u.CFTimePeriodOperator.tomorrow,e),le(u.CFTimePeriodOperator.last7Days,e),le(u.CFTimePeriodOperator.lastWeek,e),le(u.CFTimePeriodOperator.thisWeek,e),le(u.CFTimePeriodOperator.nextWeek,e),le(u.CFTimePeriodOperator.lastMonth,e),le(u.CFTimePeriodOperator.thisMonth,e),le(u.CFTimePeriodOperator.nextMonth,e)]}},wr=t=>{var S;const{interceptorManager:e,onChange:r}=t,n=v.useDependency(v.LocaleService),o=((S=t.rule)==null?void 0:S.type)===u.CFRuleType.highlightCell?t.rule:void 0,[a,l]=j.useState(()=>{const c=u.CFSubRuleType.text;return o&&o.subType||c}),y=[{value:u.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:u.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:u.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:u.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:u.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=j.useMemo(()=>Ir(a,n),[a]),[R,m]=j.useState(()=>{const c=p?p[0].value:void 0;return o&&o.operator||c}),[C,x]=j.useState(()=>{var f;const c="";return o?(f=o.value)!=null?f:u.createDefaultValue(o.subType,o.operator):c}),[I,T]=j.useState({}),w=j.useMemo(()=>c=>{var g,f,b,M,L,V,U,E,D,W,q,Y,ne,ee,F;switch(c.subType||a){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(R))return{type:u.CFRuleType.highlightCell,subType:(g=c.subType)!=null?g:a,operator:(f=c.operator)!=null?f:R,style:(b=c.style)!=null?b:I,value:(M=c.value)!=null?M:C};break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(R))return{type:u.CFRuleType.highlightCell,subType:(L=c.subType)!=null?L:a,operator:(V=c.operator)!=null?V:R,style:(U=c.style)!=null?U:I,value:(E=c.value)!=null?E:C};if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(R))return{type:u.CFRuleType.highlightCell,subType:(D=c.subType)!=null?D:a,operator:(W=c.operator)!=null?W:R,style:(q=c.style)!=null?q:I,value:(Y=c.value)!=null?Y:C};break}}return{type:u.CFRuleType.highlightCell,subType:(ne=c.subType)!=null?ne:a,operator:(ee=c.operator)!=null?ee:R,style:(F=c.style)!=null?F:I}},[a,R,C,I]);j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return w({})}}),[w,e]),j.useEffect(()=>{y.some(c=>c.value===a)||l(y[0].value)},[y]);const h=c=>{const g=c,f=Ir(g,n),b=f&&f[0].value;l(g),m(b),b&&x(u.createDefaultValue(g,b)),r(w({subType:g,operator:b}))},i=c=>{const g=c;m(g),r(w({operator:g}))},s=c=>{x(c),r(w({value:c}))},d=j.useMemo(()=>`${a}_${R}_${Math.random()}`,[a,R]);return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
110
|
+
${A.title}
|
|
111
|
+
${A.mTBase}
|
|
112
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(re.Select,{className:`
|
|
113
|
+
${A.mTSm}
|
|
114
|
+
${G.width100}
|
|
115
|
+
`,onChange:h,value:a,options:y}),(p==null?void 0:p.length)&&_.jsx(re.Select,{className:`
|
|
116
|
+
${A.mTSm}
|
|
117
|
+
${G.width100}
|
|
118
|
+
`,onChange:i,value:R||"",options:p}),_.jsx(Bo,{value:C,interceptorManager:e,type:a,operator:R,rule:o,onChange:s},d),_.jsx("div",{className:`
|
|
119
|
+
${G.cfPreviewWrap}
|
|
120
|
+
`,children:_.jsx(We,{rule:w({})})}),_.jsx(yn,{style:o==null?void 0:o.style,className:`
|
|
121
|
+
${A.mLXxs}
|
|
122
|
+
`,onChange:c=>{T(c),r(w({style:c}))}})]})},_r=(t,e)=>(u.iconMap[t]||[])[Number(e)]||"",Fo=t=>{var p;const e=v.useDependency(v.IUniverInstanceService),r=e.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),o=j.useMemo(()=>t.error?G.errorInput:"",[t.error]),a=j.useRef({}),[l,y]=j.useState(!1);return ge.useSidebarClick(R=>{var C;const m=(C=a.current)==null?void 0:C.handleOutClick;m&&m(R,()=>y(!1))}),_.jsx("div",{className:G.positionRelative,children:t.type!==u.CFValueType.formula?_.jsxs(_.Fragment,{children:[_.jsx(re.InputNumber,{className:o,value:Number(t.value)||0,onChange:R=>t.onChange(R!=null?R:0)}),t.error&&_.jsx("div",{className:G.errorText,children:t.error})]}):_.jsx("div",{style:{width:"100%"},children:_.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:l,onChange:(R="")=>{const m=R||"";t.onChange(m)},onFocus:()=>y(!0),actions:a.current})})})},xr=(t,e,r)=>({operator:u.CFNumberOperator.greaterThan,value:{type:u.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),Go=j.forwardRef((t,e)=>{const r=v.useDependency(v.LocaleService),n=o=>{t.onClick(o)};return _.jsx("div",{ref:e,className:G.iconGroupList,children:u.iconGroup.map((o,a)=>_.jsxs("div",{className:G.group,children:[_.jsx("div",{className:G.title,children:r.t(o.title)}),_.jsx("div",{className:G.itemContent,children:o.group.map(l=>_.jsx("div",{className:G.itemWrap,onClick:()=>{n(l.name)},children:_.jsx("div",{className:G.item,children:l.list.map((y,p)=>_.jsx("img",{className:G.icon,src:y},p))})},l.name))})]},a))})}),qo=t=>{const e=j.useMemo(()=>{const n=[];for(const o in u.iconMap){const a=u.iconMap[o],l=o;a.forEach((y,p)=>{n.push({iconType:l,base64:y,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return _.jsxs("div",{className:G.iconItemListWrap,children:[_.jsxs("div",{className:G.none,onClick:()=>r({iconType:u.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[_.jsx(Ze,{className:G.icon}),_.jsx("span",{children:"无单元格图标"})]}),_.jsx("div",{className:G.iconItemList,children:e.map(n=>_.jsx("div",{className:G.item,children:_.jsx("img",{onClick:()=>r(n),className:`
|
|
123
|
+
${G.icon}
|
|
124
|
+
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},Xo=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=v.useDependency(v.LocaleService),a=[{label:o.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThan}`),value:u.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThanOrEqual}`),value:u.CFNumberOperator.greaterThanOrEqual}],l=[{label:o.t(`sheet.cf.valueType.${u.CFValueType.num}`),value:u.CFValueType.num},{label:o.t(`sheet.cf.valueType.${u.CFValueType.percent}`),value:u.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${u.CFValueType.percentile}`),value:u.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${u.CFValueType.formula}`),value:u.CFValueType.formula}],y=(C,x)=>{e([String(x),"value","value"],C)},p=(C,x)=>{e([String(x),"operator"],C);const I=u.createDefaultValue(u.CFSubRuleType.number,C);y(I,x)},R=(C,x)=>{e([String(x),"value","type"],C);const I=r[x],T=u.createDefaultValue(u.CFSubRuleType.number,I.operator);y(T,x)};return j.useMemo(()=>r.map((C,x)=>{const I=n[x],T=_r(C.iconType,C.iconId),w=x===r.length-1,h=x===0,i=r[x-1],s=(i==null?void 0:i.value.type)===u.CFValueType.formula?o.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,d=(S,c)=>{const g={...C,iconId:c,iconType:S};e([String(x)],g)};return _.jsxs("div",{className:`
|
|
125
|
+
${x?A.mTXl:A.mTSm}
|
|
126
|
+
`,children:[_.jsxs("div",{className:`
|
|
127
|
+
${A.label}
|
|
128
|
+
${G.flex}
|
|
129
|
+
`,children:[_.jsxs("div",{className:`
|
|
130
|
+
${G.width45}
|
|
131
|
+
`,children:[o.t("sheet.cf.iconSet.icon"),x+1]}),_.jsx("div",{className:`
|
|
132
|
+
${G.width45}
|
|
133
|
+
`,children:_.jsxs(_.Fragment,{children:[!h&&!w&&o.t("sheet.cf.iconSet.rule"),!h&&!w&&_.jsxs("span",{className:G.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${u.getOppositeOperator(i.operator)}`),s,w?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),_.jsxs("div",{className:`
|
|
134
|
+
${G.flex}
|
|
135
|
+
${A.mTSm}
|
|
136
|
+
`,children:[_.jsx("div",{className:`
|
|
137
|
+
${G.iconWrap}
|
|
138
|
+
${G.width45}
|
|
139
|
+
`,children:_.jsx(re.DropdownLegacy,{overlay:_.jsx(qo,{onClick:d,iconId:C.iconId,iconType:C.iconType}),children:_.jsxs("div",{className:G.dropdownIcon,children:[T?_.jsx("img",{src:T,className:G.icon}):_.jsx(Ze,{className:G.icon}),_.jsx(Tt,{})]})})}),w?_.jsxs("div",{className:`
|
|
140
|
+
${G.width45}
|
|
141
|
+
${A.label}
|
|
142
|
+
`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),_.jsxs("span",{className:G.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${u.getOppositeOperator(i.operator)}`),s,w?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):_.jsx(re.Select,{className:`
|
|
143
|
+
${A.mL0}
|
|
144
|
+
${G.width45}
|
|
145
|
+
${A.mR0}
|
|
146
|
+
`,options:a,value:C.operator,onChange:S=>{p(S,x)}})]}),w?_.jsx("div",{}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:`
|
|
147
|
+
${A.mTSm}
|
|
148
|
+
${A.label}
|
|
149
|
+
${G.flex}
|
|
150
|
+
`,children:[_.jsx("div",{className:`
|
|
151
|
+
${G.width45}
|
|
152
|
+
`,children:o.t("sheet.cf.iconSet.type")}),_.jsx("div",{className:`
|
|
153
|
+
${G.width45}
|
|
154
|
+
`,children:o.t("sheet.cf.iconSet.value")})]}),_.jsxs("div",{className:`
|
|
155
|
+
${A.mTSm}
|
|
156
|
+
${G.flex}
|
|
157
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},className:`
|
|
158
|
+
${G.width45}
|
|
159
|
+
${A.mL0}
|
|
160
|
+
`,options:l,value:C.value.type,onChange:S=>{R(S,x)}}),_.jsx("div",{className:`
|
|
161
|
+
${A.mL0}
|
|
162
|
+
${G.width45}
|
|
163
|
+
`,children:_.jsx(Fo,{id:x,type:C.value.type,error:I,value:C.value.value||"",onChange:S=>y(S,x)})})]})]})]},x)}),[r,n])},Yo=t=>{var S;const{interceptorManager:e}=t,r=((S=t.rule)==null?void 0:S.type)===u.CFRuleType.iconSet?t.rule:void 0,n=v.useDependency(v.LocaleService),[o,a]=j.useState({}),[l,y]=j.useState(()=>{const c=Object.keys(u.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(b=>b.iconType!==g))return g}return c}),[p,R]=j.useState(()=>{if(r&&r.config.length)return v.Tools.deepClone(r==null?void 0:r.config);const c=u.iconMap[l]||[];return new Array(c.length).fill("").map((g,f,b)=>f===b.length-1?{operator:u.CFNumberOperator.lessThanOrEqual,value:{type:u.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:l,iconId:String(f)}:xr(l,f,b))}),[m,C]=j.useState(()=>r?!!r.isShowValue:!0),x=j.useMemo(()=>{const c=p.map(g=>_r(g.iconType,g.iconId));return _.jsx("div",{className:G.iconWrap,children:c.map((g,f)=>g?_.jsx("img",{className:G.icon,src:g},f):_.jsx(Ze,{className:G.icon},f))})},[p]),I=c=>{if(c.reduce((f,b,M)=>f.preType&&!f.result||c.length-1===M?f:b.value.type===u.CFValueType.formula?{preType:u.CFValueType.formula,result:!1}:f.preType?{result:f.preType===b.value.type,preType:b.value.type}:{result:!0,preType:b.value.type},{result:!0,preType:""}).result&&[u.CFValueType.num,u.CFValueType.percent,u.CFValueType.percentile].includes(c[0].value.type)){const f={};return c.forEach((b,M,L)=>{if(M-1<0||M===L.length-1)return;const U=c[M-1],E=u.getOppositeOperator(U.operator);u.compareWithNumber({operator:E,value:U.value.value},b.value.value)||(f[M]=`${n.t(`sheet.cf.form.${E}`,String(U.value.value))} `)}),f}return{}},T=(c,g)=>{v.get(p,c)!==g&&(v.set(p,c,g),R([...p]),a(I(p)))},w=c=>{y(c);const g=u.iconMap[c]||[],f=new Array(g.length).fill("").map((b,M,L)=>xr(c,M,L));R(f),a(I(f))};j.useEffect(()=>{const c=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:u.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{c()}},[m,p,e]),j.useEffect(()=>{const c=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{c()}},[m,p,e,o]);const h=()=>{const c=p.map(g=>({...g}));p.forEach((g,f)=>{const b=p.length-1-f,M=c[b];g.iconId=M.iconId,g.iconType=M.iconType}),R([...p])},i=v.useDependency(ge.ILayoutService),[s,d]=j.useState();return ge.useScrollYOverContainer(s,i.rootContainerElement),_.jsxs("div",{className:G.iconSet,children:[_.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
164
|
+
${A.mTSm}
|
|
165
|
+
`,children:_.jsx(re.DropdownLegacy,{placement:"bottomLeft",overlay:_.jsx(Go,{ref:c=>!s&&c&&d(c),iconType:l,onClick:w}),children:_.jsxs("div",{className:G.dropdownIcon,style:{width:"unset"},children:[x,_.jsx(Tt,{})]})})}),_.jsxs("div",{className:`
|
|
166
|
+
${A.mTSm}
|
|
167
|
+
${G.renderConfig}
|
|
168
|
+
`,children:[_.jsxs("div",{className:G.utilItem,children:[_.jsx(re.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),_.jsxs("div",{className:`
|
|
169
|
+
${G.utilItem}
|
|
170
|
+
${A.mLXl}
|
|
171
|
+
`,children:[_.jsx(re.Checkbox,{checked:!m,onChange:c=>{C(!c)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),_.jsx(Xo,{errorMap:o,onChange:T,configList:p})]})},$o=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=v.useDependency(v.LocaleService),o=((h=t.rule)==null?void 0:h.type)===u.CFRuleType.highlightCell?t.rule:void 0,a=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[l,y]=j.useState(()=>{const i=a[0].value,s=o==null?void 0:o.type;if(!o)return i;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.average:return[u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":i;case u.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return i}),[p,R]=j.useState(()=>{const s=o==null?void 0:o.type;if(!o)return 10;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.rank:return o.value||10}}return 10}),[m,C]=j.useState(()=>{const s=o==null?void 0:o.type;if(!o)return!1;switch(s){case u.CFRuleType.highlightCell:switch(o.subType){case u.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[x,I]=j.useState({}),T=i=>{const{type:s,isPercent:d,value:S,style:c}=i;if(s==="isNotBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:d,isBottom:!1,value:S,style:c};if(s==="isBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:d,isBottom:!0,value:S,style:c};if(s==="greaterThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.greaterThan,style:c};if(s==="lessThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.lessThan,style:c}};j.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return T({type:l,isPercent:m,value:p,style:x})}}),[l,m,p,x,r]);const w=i=>{e(T(i))};return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
172
|
+
${A.title}
|
|
173
|
+
${A.mTBase}
|
|
174
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(re.Select,{className:`
|
|
175
|
+
${G.width100}
|
|
176
|
+
${A.mTSm}
|
|
177
|
+
`,value:l,options:a,onChange:i=>{y(i),w({type:i,isPercent:m,value:p,style:x})}}),["isNotBottom","isBottom"].includes(l)&&_.jsxs("div",{className:`
|
|
178
|
+
${A.labelContainer}
|
|
179
|
+
${A.mTSm}
|
|
180
|
+
`,children:[_.jsx(re.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;R(s),w({type:l,isPercent:m,value:s,style:x})}}),_.jsxs("div",{className:`
|
|
181
|
+
${A.mLSm}
|
|
182
|
+
${A.labelContainer}
|
|
183
|
+
${G.text}
|
|
184
|
+
`,children:[_.jsx(re.Checkbox,{checked:m,onChange:i=>{C(!!i),w({type:l,isPercent:!!i,value:p,style:x})}}),n.t("sheet.cf.valueType.percent")]})]}),_.jsx("div",{className:`
|
|
185
|
+
${G.cfPreviewWrap}
|
|
186
|
+
`,children:_.jsx(We,{rule:T({type:l,isPercent:m,value:p,style:x})})}),_.jsx(yn,{style:o==null?void 0:o.style,className:`
|
|
187
|
+
${A.mTSm}
|
|
188
|
+
`,onChange:i=>{I(i),w({type:l,isPercent:m,value:p,style:i})}})]})},Ko=v.createInterceptorKey("beforeSubmit"),Zo=v.createInterceptorKey("submit"),Er=t=>t.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),Or=t=>{var e;return(e=t.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},Jo=t=>{var L,V,U;const e=v.useDependency(v.LocaleService),r=v.useDependency(v.ICommandService),n=v.useDependency(v.IUniverInstanceService),o=v.useDependency(u.ConditionalFormattingRuleModel),a=v.useDependency(X.SheetsSelectionsService),l=Er(n),y=Or(n),[p,R]=j.useState(!0),m=j.useRef({}),[C,x]=j.useState(void 0),I=j.useRef((V=(L=t.rule)==null?void 0:L.ranges)!=null?V:[]),T=j.useMemo(()=>{var D,W,q;let E=(D=t.rule)==null?void 0:D.ranges;return E!=null&&E.length||(E=(q=(W=a.getCurrentSelections())==null?void 0:W.map(Y=>Y.range))!=null?q:[]),I.current=E,E!=null&&E.length?E.map(Y=>{const ne=qt.serializeRange(Y);return ne==="NaN"?"":ne}).filter(Y=>!!Y).join(","):""},[t.rule]),w=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,i]=j.useState(()=>{var W,q;const E=(W=t.rule)==null?void 0:W.rule.type,D=w[0].value;if(!E)return D;switch(E){case u.CFRuleType.highlightCell:{switch((q=t.rule)==null?void 0:q.rule.subType){case u.CFSubRuleType.number:case u.CFSubRuleType.text:case u.CFSubRuleType.duplicateValues:case u.CFSubRuleType.uniqueValues:case u.CFSubRuleType.timePeriod:return"1";case u.CFSubRuleType.average:case u.CFSubRuleType.rank:return"2";case u.CFSubRuleType.formula:return"5"}break}case u.CFRuleType.dataBar:return"3";case u.CFRuleType.colorScale:return"4";case u.CFRuleType.iconSet:return"6"}return D}),s=j.useRef(),d=j.useMemo(()=>new v.InterceptorManager({beforeSubmit:Ko,submit:Zo}),[]),S=j.useMemo(()=>{switch(h){case"1":return wr;case"2":return $o;case"3":return Ho;case"4":return Wo;case"5":return ko;case"6":return Yo;default:return wr}},[h]);j.useEffect(()=>{const E=r.onCommandExecuted(D=>{if(D.id===X.RemoveSheetMutation.id){const W=D.params;W.subUnitId===y&&W.unitId===l&&t.onCancel()}D.id===X.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>E.dispose()},[]);const c=E=>{s.current=E},g=E=>{const D=E.split(",").filter(W=>!!W).map(qt.deserializeRangeWithSheet).map(W=>W.range);I.current=D},f=()=>{if(C)return;const D=(()=>{const q=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!q)throw new Error("No active sheet found");return I.current.map(ee=>X.setEndForRange(ee,q.getRowCount(),q.getColumnCount())).filter(ee=>!(Number.isNaN(ee.startRow)||Number.isNaN(ee.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const q=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(q){const Y=Er(n),ne=Or(n);if(!Y||!ne)throw new Error("No active sheet found");let ee={};t.rule&&t.rule.cfId?(ee={...t.rule,ranges:D,rule:q},r.executeCommand(Rt.id,{unitId:Y,subUnitId:ne,rule:ee}),t.onCancel()):(ee={cfId:o.createCfId(Y,ne),ranges:D,rule:q,stopIfTrue:!1},r.executeCommand(Xe.id,{unitId:Y,subUnitId:ne,rule:ee}),t.onCancel())}}},b=()=>{t.onCancel()},M=(E,D)=>{E?D.length<1?x(e.t("sheet.cf.errorMessage.rangeError")):x(void 0):x(e.t("sheet.cf.errorMessage.rangeError"))};return ge.useSidebarClick(E=>{var W;const D=(W=m.current)==null?void 0:W.handleOutClick;D&&D(E,()=>R(!1))}),_.jsxs("div",{className:G.cfRuleStyleEditor,children:[_.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),_.jsx("div",{className:`
|
|
189
|
+
${A.mTBase}
|
|
190
|
+
`,children:_.jsx(Ge.RangeSelector,{unitId:l,errorText:C,subUnitId:y,initValue:T,onChange:g,onVerify:M,onFocus:()=>R(!0),isFocus:p,actions:m.current})}),_.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),_.jsx("div",{className:A.mTBase,children:_.jsx(re.Select,{className:G.width100,value:h,options:w,onChange:E=>i(E)})}),_.jsx(S,{interceptorManager:d,rule:(U=t.rule)==null?void 0:U.rule,onChange:c}),_.jsxs("div",{className:`
|
|
191
|
+
${A.mTBase}
|
|
192
|
+
${G.btnList}
|
|
193
|
+
`,children:[_.jsx(re.Button,{size:"small",onClick:b,children:e.t("sheet.cf.panel.cancel")}),_.jsx(re.Button,{className:A.mLSm,size:"small",type:"primary",onClick:f,children:e.t("sheet.cf.panel.submit")})]})]})},Qo=t=>{const[e,r]=j.useState(t.rule),[n,o]=j.useState(!!t.rule),a=()=>{o(!0)},l=()=>{o(!1),r(void 0)},y=p=>{r(p),o(!0)};return _.jsx("div",{className:A.conditionalFormattingWrap,children:n?_.jsx(Jo,{onCancel:l,rule:e}):_.jsx(Ao,{onClick:y,onCreate:a})})};var ea=Object.defineProperty,ta=Object.getOwnPropertyDescriptor,na=(t,e,r,n)=>{for(var o=n>1?void 0:n?ta(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ea(e,r,o),o},lt=(t,e)=>(r,n)=>e(r,n,t);const Vt="sheet.conditional.formatting.panel";let ut=class extends v.Disposable{constructor(e,r,n,o,a){super();Pe(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=a,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var y;l||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(l=>{l.id===Vt&&(l.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:e,key:v.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Qo)}};ut=na([lt(0,v.IUniverInstanceService),lt(1,v.Inject(v.Injector)),lt(2,v.Inject(ge.ComponentManager)),lt(3,v.Inject(ge.ISidebarService)),lt(4,v.Inject(v.LocaleService))],ut);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const ct={id:"sheet.operation.open.conditional.formatting.panel",type:v.CommandType.OPERATION,handler:(t,e)=>{var y;const r=t.get(ut),n=t.get(X.SheetsSelectionsService),o=t.get(v.ICommandService),a=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...u.createDefaultRule(),ranges:a});break}case 4:{const p={...u.createDefaultRule,ranges:a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...u.createDefaultRule,ranges:a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...u.createDefaultRule,ranges:a,rule:{type:u.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...u.createDefaultRule,ranges:a,rule:{type:u.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...u.createDefaultRule,ranges:a,rule:{type:u.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...u.createDefaultRule(),ranges:a});break}case 9:{o.executeCommand(St.id,{ranges:a});break}case 10:{o.executeCommand(Ye.id);break}}return!0}};var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,aa=(t,e,r,n)=>{for(var o=n>1?void 0:n?oa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ra(e,r,o),o},dt=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends v.Disposable{constructor(e,r,n,o,a){super();Pe(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,o)=>{const{copyType:a=de.COPY_TYPE.COPY,pasteType:l}=o,{range:y}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:a,pasteType:l,copyRange:y})}}))}_collectConditionalRule(e,r,n){const o=new v.ObjectMatrix,a={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:a}};const l=this._injector.invoke(m=>de.rangeToDiscreteRange(n,m,e,r));if(!l)return;const{rows:y,cols:p}=l,R=new Set;y.forEach((m,C)=>{p.forEach((x,I)=>{const T=this._conditionalFormattingViewModel.getCellCfs(e,r,m,x);T&&(T.forEach(w=>R.add(w.cfId)),o.setValue(C,I,T.map(w=>w.cfId)))})}),R.forEach(m=>{const C=this._conditionalFormattingRuleModel.getRule(e,r,m);C&&(a[m]=C.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),a=n.getUnitId();if(!o)return{redos:[],undos:[]};const l=o.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[y,p],mapFunc:R}=de.virtualizeDiscreteRanges([r.copyRange,e]),m=de.getRepeatRange(y,p,!0),C={};v.Range.foreach(p,(S,c)=>{const{row:g,col:f}=R(S,c),b=this._conditionalFormattingViewModel.getCellCfs(a,l,g,f);b&&b.forEach(M=>{if(!C[M.cfId]){const L=new v.ObjectMatrix;C[M.cfId]=L;const V=this._conditionalFormattingRuleModel.getRule(a,l,M.cfId);V==null||V.ranges.forEach(U=>{v.Range.foreach(U,(E,D)=>{L.setValue(E,D,1)})})}C[M.cfId].realDeleteValue(g,f)})});const{matrix:x,info:I}=this._copyInfo,T=[];let w=this._conditionalFormattingRuleModel.createCfId(a,l);const h={},i=S=>{if(h[S])return h[S];const c=I==null?void 0:I.cfMap[S],g=[...this._conditionalFormattingRuleModel.getSubunitRules(a,l)||[],...T].find(f=>v.Tools.diffValue(f.rule,c));if(g)return h[S]=g,g;{const f={rule:c,cfId:w,ranges:[],stopIfTrue:!1};return h[S]=f,T.push(f),w=`${Number(w)+1}`,f}};m.forEach(S=>{x&&x.forValue((c,g,f)=>{const b=v.Rectangle.getPositionRange({startRow:c,endRow:c,startColumn:g,endColumn:g},S.startRange),{row:M,col:L}=R(b.startRow,b.startColumn);f.forEach(V=>{if(!C[V]){const U=i(V),E=new v.ObjectMatrix;C[V]=E,U.ranges.forEach(D=>{v.Range.foreach(D,(W,q)=>{E.setValue(W,q,1)})})}C[V].setValue(M,L,1)})})});const s=[],d=[];for(const S in C){const c=C[S],g=X.findAllRectangle(X.createTopMatrixFromMatrix(c));if(!g.length){const f={unitId:a,subUnitId:l,cfId:S};s.push({id:u.DeleteConditionalRuleMutation.id,params:f}),d.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}if(T.some(f=>f.cfId===S)){const f=i(S),b={unitId:a,subUnitId:l,rule:{...f,ranges:g}};s.push({id:u.AddConditionalRuleMutation.id,params:b}),d.push(u.AddConditionalRuleMutationUndoFactory(this._injector,b))}else{const f=this._conditionalFormattingRuleModel.getRule(a,l,S);if(!f)continue;const b={unitId:a,subUnitId:l,rule:{...f,ranges:g}};s.push({id:u.SetConditionalRuleMutation.id,params:b}),d.push(...u.setConditionalRuleMutationUndoFactory(this._injector,b))}}return{redos:s,undos:d}}};ft=aa([dt(0,v.Inject(de.ISheetClipboardService)),dt(1,v.Inject(u.ConditionalFormattingRuleModel)),dt(2,v.Inject(v.Injector)),dt(3,v.Inject(u.ConditionalFormattingViewModel)),dt(4,v.Inject(v.IUniverInstanceService))],ft);var ia=Object.defineProperty,sa=Object.getOwnPropertyDescriptor,la=(t,e,r,n)=>{for(var o=n>1?void 0:n?sa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ia(e,r,o),o},Sn=(t,e)=>(r,n)=>e(r,n,t);let pt=class extends v.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionInterceptorBaseController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===Xe.id&&(this._sheetPermissionInterceptorBaseController.permissionCheckWithRanges({workbookTypes:[X.WorkbookEditablePermission],rangeTypes:[X.RangeProtectionPermissionEditPoint],worksheetTypes:[X.WorksheetEditPermission,X.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionInterceptorBaseController.haveNotPermissionHandle(this._localeService.t("permission.dialog.setStyleErr")))}))}};pt=la([Sn(0,v.Inject(v.LocaleService)),Sn(1,v.ICommandService),Sn(2,v.Inject(de.SheetPermissionInterceptorBaseController))],pt);var ua=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,da=(t,e,r,n)=>{for(var o=n>1?void 0:n?ca(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ua(e,r,o),o},zt=(t,e)=>(r,n)=>e(r,n,t);let ht=class extends v.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,o,a)=>`${n}_${o}_${a}`,r=(n,o,a)=>{const l=p=>{const R=[...a.ranges],m=R.map(x=>X.handleDefaultRangeChangeWithEffectRefCommands(x,p)).filter(x=>!!x);if(u.isRangesEqual(m,R))return{redos:[],undos:[]};if(m.length){const x={unitId:n,subUnitId:o,rule:{...a,ranges:m}},I=[{id:u.SetConditionalRuleMutation.id,params:x}],T=u.setConditionalRuleMutationUndoFactory(this._injector,x);return{redos:I,undos:T}}else{const x={unitId:n,subUnitId:o,cfId:a.cfId},I=[{id:u.DeleteConditionalRuleMutation.id,params:x}],T=u.DeleteConditionalRuleMutationUndoFactory(this._injector,x);return{redos:I,undos:T}}},y=[];a.ranges.forEach(p=>{const R=this._refRangeService.registerRefRange(p,l);y.push(()=>R.dispose())}),t.set(e(n,o,a.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:a,rule:l}=n,y=this._univerInstanceService.getCurrentUnitForType(v.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 R=t.get(e(o,a,l.cfId));R&&R();break}case"set":{const R=t.get(e(o,a,l.cfId));R&&R(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(v.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ht=da([zt(0,v.Inject(u.ConditionalFormattingRuleModel)),zt(1,v.Inject(v.IUniverInstanceService)),zt(2,v.Inject(v.Injector)),zt(3,v.Inject(X.RefRangeService))],ht);var fa=Object.defineProperty,pa=Object.getOwnPropertyDescriptor,ha=(t,e,r,n)=>{for(var o=n>1?void 0:n?pa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&fa(e,r,o),o},ke=(t,e)=>(r,n)=>e(r,n,t);let mt=class extends v.Disposable{constructor(e,r,n,o,a,l){super();Pe(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=l,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(Re.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(X.INTERCEPTOR_POINT.CELL_CONTENT,{effect:v.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const a=r.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return o.style&&Object.assign(y,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=u.DEFAULT_PADDING+u.DEFAULT_WIDTH),n(p)},priority:10}))}};mt=ha([ke(0,v.Inject(X.SheetInterceptorService)),ke(1,v.Inject(u.ConditionalFormattingService)),ke(2,v.Inject(v.IUniverInstanceService)),ke(3,v.Inject(wn.IRenderManagerService)),ke(4,v.Inject(u.ConditionalFormattingViewModel)),ke(5,v.Inject(u.ConditionalFormattingRuleModel))],mt);const Pr="sheets-conditional-formatting-ui.config",At={};var Mr=Object.defineProperty,ma=Object.getOwnPropertyDescriptor,ga=(t,e,r)=>e in t?Mr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,va=(t,e,r,n)=>{for(var o=n>1?void 0:n?ma(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Mr(e,r,o),o},bn=(t,e)=>(r,n)=>e(r,n,t),Dr=(t,e,r)=>ga(t,typeof e!="symbol"?e+"":e,r);Z.UniverSheetsConditionalFormattingMobileUIPlugin=class extends v.Plugin{constructor(e=At,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:a,...l}=v.merge({},At,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Pr,l),this._initCommand(),this._injector.add([mt]),this._injector.add([ht]),this._injector.add([ft]),this._injector.add([pt]),this._injector.add([Ae])}_initCommand(){[Xt,Yt,$t,Kt,Zt,Jt,Qt,en,tn,ct,$e,Rt,bt,Xe,St,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Dr(Z.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Dr(Z.UniverSheetsConditionalFormattingMobileUIPlugin,"type",v.UniverInstanceType.UNIVER_SHEET),Z.UniverSheetsConditionalFormattingMobileUIPlugin=va([v.DependentOn(u.UniverSheetsConditionalFormattingPlugin),bn(1,v.Inject(v.Injector)),bn(2,v.Inject(v.ICommandService)),bn(3,v.IConfigService)],Z.UniverSheetsConditionalFormattingMobileUIPlugin);var ya=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var o=n>1?void 0:n?Sa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&ya(e,r,o),o},gt=(t,e)=>(r,n)=>e(r,n,t);let Wt=class extends v.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,a,l,y,p)=>{var I;const R=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!R||!m)return;const C={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},x={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};v.Range.foreach(l,(T,w)=>{const h=v.Rectangle.getPositionRange({startRow:T,startColumn:w,endColumn:w,endRow:T},C),i=v.Rectangle.getPositionRange({startRow:T,startColumn:w,endColumn:w,endRow:T},x),{row:s,col:d}=p(h.startRow,h.startColumn),S=this._conditionalFormattingViewModel.getCellCfs(R,m,s,d),{row:c,col:g}=p(i.startRow,i.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(R,m,c,g);f&&f.forEach(b=>{let M=y.get(b.cfId);if(!y.get(b.cfId)){const L=this._conditionalFormattingRuleModel.getRule(R,m,b.cfId);if(!L)return;M=new v.ObjectMatrix,L.ranges.forEach(V=>{v.Range.foreach(V,(U,E)=>{M.setValue(U,E,1)})}),y.set(b.cfId,M)}M.realDeleteValue(c,g)}),S&&S.forEach(b=>{let M=y.get(b.cfId);if(!y.get(b.cfId)){const L=this._conditionalFormattingRuleModel.getRule(R,m,b.cfId);if(!L)return;M=new v.ObjectMatrix,L.ranges.forEach(V=>{v.Range.foreach(V,(U,E)=>{M.setValue(U,E,1)})}),y.set(b.cfId,M)}M.setValue(c,g,1)})})},r=(o,a)=>{var i,s,d;const l=(i=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,R=[],m=[];if(!l||!y)return t();const C=de.virtualizeDiscreteRanges([o,a]),[x,I]=C.ranges,{mapFunc:T}=C,w={row:x.startRow,col:x.startColumn};return de.getAutoFillRepeatRange(x,I).forEach(S=>{e(w,S.repeatStartCell,S.relativeRange,p,T)}),p.forEach((S,c)=>{const g=this._conditionalFormattingRuleModel.getRule(l,y,c);if(!g)return;const f=X.findAllRectangle(X.createTopMatrixFromMatrix(S));if(f.length){const b={unitId:l,subUnitId:y,rule:{...g,ranges:f}};R.push({id:u.SetConditionalRuleMutation.id,params:b}),m.push(...u.setConditionalRuleMutationUndoFactory(this._injector,b))}else{const b={unitId:l,subUnitId:y,cfId:g.cfId};R.push({id:u.DeleteConditionalRuleMutation.id,params:b}),m.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,b))}}),{undos:m,redos:R}},n={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,a,l)=>{if(l===de.APPLY_TYPE.COPY||l===de.APPLY_TYPE.ONLY_FORMAT||l===de.APPLY_TYPE.SERIES){const{source:y,target:p}=o;return r(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Wt=ba([gt(0,v.Inject(v.Injector)),gt(1,v.Inject(v.IUniverInstanceService)),gt(2,v.Inject(de.IAutoFillService)),gt(3,v.Inject(u.ConditionalFormattingRuleModel)),gt(4,v.Inject(u.ConditionalFormattingViewModel))],Wt);var Ra=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,Ta=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ca(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ra(e,r,o),o},vt=(t,e)=>(r,n)=>e(r,n,t);Z.ConditionalFormattingClearController=class extends v.Disposable{constructor(e,r,n,o,a){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var a;const r=[],n=[],o={redos:r,undos:n};if([X.ClearSelectionFormatCommand.id,X.ClearSelectionAllCommand.id].includes(e.id)){const l=(a=this._selectionManagerService.getCurrentSelections())==null?void 0:a.map(T=>T.range);if(!l)return o;const y=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return o;const R=y.getUnitId(),m=p.getSheetId(),C=this._conditionalFormattingRuleModel.getSubunitRules(R,m);if(!C||!C.length)return o;const{redos:x,undos:I}=Nr(this._injector,C,l,R,m);r.push(...x),n.push(...I)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],a=[],l={redos:o,undos:a};if(!n||!n.length)return l;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!y||!y.length)return l;const{redos:p,undos:R}=Nr(this._injector,y,n,e,r);return o.push(...p),a.push(...R),l}}))}},Z.ConditionalFormattingClearController=Ta([vt(0,v.Inject(v.Injector)),vt(1,v.Inject(v.IUniverInstanceService)),vt(2,v.Inject(X.SheetInterceptorService)),vt(3,v.Inject(X.SheetsSelectionsService)),vt(4,v.Inject(u.ConditionalFormattingRuleModel))],Z.ConditionalFormattingClearController);function Nr(t,e,r,n,o){const a=[],l=[];return e.filter(y=>r.some(p=>y.ranges.some(R=>v.Rectangle.getIntersects(R,p)))).forEach(y=>{const R=new X.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(R.length){const m={id:u.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...y,ranges:R}}},C=u.setConditionalRuleMutationUndoFactory(t,m.params);a.push(m),l.push(...C)}else{const m={id:u.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:y.cfId}},C=u.DeleteConditionalRuleMutationUndoFactory(t,m.params);a.push(m),l.push(...C)}}),{redos:a,undos:l}}var Ia=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,_a=(t,e,r,n)=>{for(var o=n>1?void 0:n?wa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ia(e,r,o),o},jr=(t,e)=>(r,n)=>e(r,n,t);let Ht=class extends v.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(v.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(X.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var l,y,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),o=(l=n==null?void 0:n.style)!=null?l:{},a=Object.keys(o);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(R=>{R.ts&&a.forEach(m=>{var C;(C=R.ts)==null||delete C[m]})}),r(t);{const R={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};a.forEach(C=>{delete R[C]});const m={...t,s:{...R}};return r(m)}}})))}};Ht=_a([jr(0,v.Inject(X.SheetInterceptorService)),jr(1,v.Inject(u.ConditionalFormattingService))],Ht);const Lr=[X.SetWorksheetActiveOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],yt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],xa=t=>{const e=t.get(X.SheetsSelectionsService),r=t.get(v.ICommandService),n=t.get(v.IUniverInstanceService),o=t.get(u.ConditionalFormattingRuleModel),a=new Re.Observable(p=>Re.merge(e.selectionMoveEnd$,e.selectionSet$,new Re.Observable(R=>{const m=r.onCommandExecuted(C=>{var w;const{id:x,params:I}=C,T=(w=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();Lr.includes(x)&&I.unitId===T&&R.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var w;const R=((w=e.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],m=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!m)return;const C=m.getActiveSheet();if(!C)return;const T=(o.getSubunitRules(m.getUnitId(),C.getSheetId())||[]).filter(h=>h.ranges.some(i=>R.some(s=>v.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>X.checkRangesEditablePermission(t,m.getUnitId(),C.getSheetId(),h));p.next(T)})),l=new Re.Observable(p=>new Re.Observable(R=>{const m=r.onCommandExecuted(C=>{var w;const{id:x,params:I}=C,T=(w=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();Lr.includes(x)&&I.unitId===T&&R.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const R=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!R)return;const m=R.getActiveSheet();if(!m)return;const C=o.getSubunitRules(R.getUnitId(),m.getSheetId())||[];if(!C.length)return p.next(!1),!1;const x=C.map(I=>I.ranges).every(I=>X.checkRangesEditablePermission(t,R.getUnitId(),m.getSheetId(),I));p.next(x)})),y=new Re.Observable(p=>{a.subscribe(R=>{const m=yt.find(C=>C.value===ve.clearRangeRules);m&&(m.disabled=!R,p.next(yt))}),l.subscribe(R=>{const m=yt.find(C=>C.value===ve.clearWorkSheetRules);m&&(m.disabled=!R,p.next(yt))}),p.next(yt)});return{id:ct.id,type:ge.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:ge.getMenuHiddenObservable(t,v.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[X.WorkbookEditablePermission],worksheetTypes:[X.WorksheetSetCellStylePermission,X.WorksheetEditPermission],rangeTypes:[X.RangeProtectionPermissionEditPoint]})}},Ea={[ge.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:xa}}};var Oa=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,Ma=(t,e,r,n)=>{for(var o=n>1?void 0:n?Pa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Oa(e,r,o),o},Ur=(t,e)=>(r,n)=>e(r,n,t);let kt=class extends v.Disposable{constructor(e,r){super();Pe(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(Ea)}};kt=Ma([Ur(0,v.Inject(v.Injector)),Ur(1,ge.IMenuManagerService)],kt);var Da=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,ja=(t,e,r,n)=>{for(var o=n>1?void 0:n?Na(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Da(e,r,o),o},Be=(t,e)=>(r,n)=>e(r,n,t);const La=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,o=r(e)%r(t),a=n(e)%n(t),l=Math.floor(r(e)/r(t)),y=Math.floor(n(e)/n(t)),p=[],R={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:R,startRange:m}),p}for(let m=0;m<l+(o?.1:0);m++)for(let C=0;C<y+(a?.1:0);C++){const x=r(t)*m,I=n(t)*C,T={startRow:x+e.startRow,endRow:x+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let w=R;m===l&&o&&(w={...w},w.endRow=w.endRow-(r(t)-o)),C===y&&a&&(w={...w},w.endColumn=w.endColumn-(n(t)-a)),p.push({repeatRelativeRange:w,startRange:T})}return p};let Bt=class extends v.Disposable{constructor(e,r,n,o,a,l){super();Pe(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=a,this._conditionalFormattingViewModel=l,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(a,l,y,p,R)=>{const{unitId:m,subUnitId:C}=this._painterConfig,{targetUnitId:x,targetSubUnitId:I}=R,T={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},w={startRow:l.row,startColumn:l.col,endColumn:l.col,endRow:l.row};v.Range.foreach(y,(h,i)=>{const s=v.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},T),d=v.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},w),S=this._conditionalFormattingViewModel.getCellCfs(m,C,s.startRow,s.startColumn),c=this._conditionalFormattingViewModel.getCellCfs(x,I,d.startRow,d.startColumn);c&&c.forEach(g=>{let f=p.get(g.cfId);if(!p.get(g.cfId)){const b=this._conditionalFormattingRuleModel.getRule(x,I,g.cfId);if(!b)return;f=new v.ObjectMatrix,b.ranges.forEach(M=>{v.Range.foreach(M,(L,V)=>{f.setValue(L,V,1)})}),p.set(g.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),S&&S.forEach(g=>{const f=p.get(g.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(a,l,y)=>{var s;const{range:p,unitId:R,subUnitId:m}=this._painterConfig,C=a!==R||m!==l,x=new Map,I=[],T=[];if(!a||!l||!R||!m)return e();const w=(s=this._conditionalFormattingRuleModel.getSubunitRules(R,m))!=null?s:[];w==null||w.forEach(d=>{const{ranges:S,cfId:c}=d;if(S.some(g=>v.Rectangle.intersects(p,g))){const g=new v.ObjectMatrix;C||S.forEach(f=>{v.Range.foreach(f,(b,M)=>{g.setValue(b,M,1)})}),x.set(c,g)}});const h={row:p.startRow,col:p.startColumn};return La(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,x,{targetUnitId:a,targetSubUnitId:l})}),x.forEach((d,S)=>{if(C){const c=this._conditionalFormattingRuleModel.getRule(a,l,S),g=X.findAllRectangle(X.createTopMatrixFromMatrix(d));if(c)if(g.length){const f={unitId:a,subUnitId:l,rule:{...c,ranges:g}};I.push({id:u.SetConditionalRuleMutation.id,params:f}),T.push(...u.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:a,subUnitId:l,cfId:c.cfId};I.push({id:u.DeleteConditionalRuleMutation.id,params:f}),T.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(g.length){const f=this._conditionalFormattingRuleModel.getRule(R,m,S);if(f){const b={unitId:a,subUnitId:l,rule:{...v.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(a,l),ranges:g}};I.push({id:u.AddConditionalRuleMutation.id,params:b}),T.push(u.AddConditionalRuleMutationUndoFactory(this._injector,b))}}}else{const c=this._conditionalFormattingRuleModel.getRule(R,m,S);if(!c)return;const g=X.findAllRectangle(X.createTopMatrixFromMatrix(d));if(g.length){const f={unitId:R,subUnitId:m,rule:{...c,ranges:g}};I.push({id:u.SetConditionalRuleMutation.id,params:f}),T.push(...u.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:R,subUnitId:m,cfId:c.cfId};I.push({id:u.DeleteConditionalRuleMutation.id,params:f}),T.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:T,redos:I}},o={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:a=>{var l,y,p;switch(a){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const R=(l=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:l.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),C=this._sheetsSelectionsService.getCurrentLastSelection(),x=C==null?void 0:C.range;R&&m&&x&&(this._painterConfig={unitId:R,subUnitId:m,range:x});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(a,l,y)=>this._painterConfig?n(a,l,y):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Bt=ja([Be(0,v.Inject(v.Injector)),Be(1,v.Inject(v.IUniverInstanceService)),Be(2,v.Inject(de.IFormatPainterService)),Be(3,v.Inject(X.SheetsSelectionsService)),Be(4,v.Inject(u.ConditionalFormattingRuleModel)),Be(5,v.Inject(u.ConditionalFormattingViewModel))],Bt);var Ua=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,za=(t,e,r,n)=>{for(var o=n>1?void 0:n?Va(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Ua(e,r,o),o},Rn=(t,e)=>(r,n)=>e(r,n,t);let Ft=class extends v.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const a=o.with(de.SheetSkeletonManagerService);this.disposeWithMe(a.currentSkeleton$.subscribe(l=>{if(l){const y=l.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,C=Math.max(u.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(C)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ft=za([Rn(0,v.Inject(u.ConditionalFormattingViewModel)),Rn(1,v.IUniverInstanceService),Rn(2,wn.IRenderManagerService)],Ft);var Vr=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,Wa=(t,e,r)=>e in t?Vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ha=(t,e,r,n)=>{for(var o=n>1?void 0:n?Aa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(o=(n?l(e,r,o):l(o))||o);return n&&o&&Vr(e,r,o),o},Cn=(t,e)=>(r,n)=>e(r,n,t),zr=(t,e,r)=>Wa(t,typeof e!="symbol"?e+"":e,r);Z.UniverSheetsConditionalFormattingUIPlugin=class extends v.Plugin{constructor(e=At,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:a,...l}=v.merge({},At,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Pr,l),this._initCommand()}onStarting(){v.registerDependencies(this._injector,[[mt],[ht],[ft],[Wt],[pt],[ut],[kt],[Ae],[Ht],[Z.ConditionalFormattingClearController],[Bt],[Ft]]),v.touchDependencies(this._injector,[[mt]])}onReady(){v.touchDependencies(this._injector,[[kt],[ut]])}onRendered(){v.touchDependencies(this._injector,[[Wt],[Z.ConditionalFormattingClearController],[ft],[Ht],[Ae],[Bt],[pt],[ht],[Ft]])}_initCommand(){[Xt,Yt,$t,Kt,Zt,Jt,Qt,en,tn,ct,$e,Rt,bt,Xe,St,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},zr(Z.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),zr(Z.UniverSheetsConditionalFormattingUIPlugin,"type",v.UniverInstanceType.UNIVER_SHEET),Z.UniverSheetsConditionalFormattingUIPlugin=Ha([v.DependentOn(u.UniverSheetsConditionalFormattingPlugin),Cn(1,v.Inject(v.Injector)),Cn(2,v.Inject(v.ICommandService)),Cn(3,v.IConfigService)],Z.UniverSheetsConditionalFormattingUIPlugin),Z.AddAverageCfCommand=Xt,Z.AddCfCommand=Xe,Z.AddColorScaleConditionalRuleCommand=Yt,Z.AddDataBarConditionalRuleCommand=$t,Z.AddDuplicateValuesCfCommand=Kt,Z.AddNumberCfCommand=Zt,Z.AddRankCfCommand=Jt,Z.AddTextCfCommand=Qt,Z.AddTimePeriodCfCommand=en,Z.AddUniqueValuesCfCommand=tn,Z.ClearRangeCfCommand=St,Z.ClearWorksheetCfCommand=Ye,Z.DeleteCfCommand=$e,Z.MoveCfCommand=bt,Z.OpenConditionalFormattingOperator=ct,Z.SetCfCommand=Rt,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
|
|
17
194
|
|
|
18
195
|
|
|
19
196
|
// index
|
|
20
|
-
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets-conditional-formatting-ui")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-conditional-formatting","@univerjs/sheets-conditional-formatting-ui"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.UniverPresetSheetsConditionalFormatting={},e.UniverSheetsConditionalFormatting,e.UniverSheetsConditionalFormattingUi))})(this,function(e,i,n){"use strict";function t(){return{plugins:[i.UniverSheetsConditionalFormattingPlugin,n.UniverSheetsConditionalFormattingUIPlugin].filter(o=>!!o)}}e.UniverSheetsConditionalFormattingPreset=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
197
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets-conditional-formatting-ui"),require("@univerjs/sheets-conditional-formatting/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/sheets-conditional-formatting","@univerjs/sheets-conditional-formatting-ui","@univerjs/sheets-conditional-formatting/facade"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.UniverPresetSheetsConditionalFormatting={},e.UniverSheetsConditionalFormatting,e.UniverSheetsConditionalFormattingUi))})(this,function(e,i,n){"use strict";function t(){return{plugins:[i.UniverSheetsConditionalFormattingPlugin,n.UniverSheetsConditionalFormattingUIPlugin].filter(o=>!!o)}}e.UniverSheetsConditionalFormattingPreset=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|