You need to sign in or sign up before continuing.

@univerjs/sheets-crosshair-highlight 0.3.0-alpha.0 → 0.3.0-nightly.202410101606

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),engineRender=require("@univerjs/engine-render"),ui=require("@univerjs/ui"),rxjs=require("rxjs"),React=require("react"),clsx=require("clsx"),sheetsUi=require("@univerjs/sheets-ui"),sheets=require("@univerjs/sheets");var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},IconBase=React.forwardRef(function(props,ref){var icon=props.icon,id=props.id,className=props.className,extend=props.extend,restProps=__rest(props,["icon","id","className","extend"]),cls="univerjs-icon univerjs-icon-".concat(id," ").concat(className||"").trim(),idSuffix=React.useRef("_".concat(generateShortUuid()));return render(icon,"".concat(id),{defIds:icon.defIds,idSuffix:idSuffix.current},__assign({ref,className:cls},restProps),extend)});function render(node,id,runtimeProps,rootProps,extend){return React.createElement(node.tag,__assign(__assign({key:id},replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend)),rootProps),(replaceRuntimeIdsInDefs(node,runtimeProps).children||[]).map(function(child,index){return render(child,"".concat(id,"-").concat(node.tag,"-").concat(index),runtimeProps,void 0,extend)}))}__name(render,"render");function replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend){var attrs=__assign({},node.attrs);extend!=null&&extend.colorChannel1&&attrs.fill==="colorChannel1"&&(attrs.fill=extend.colorChannel1);var defIds=runtimeProps.defIds;return!defIds||defIds.length===0||(node.tag==="use"&&attrs["xlink:href"]&&(attrs["xlink:href"]=attrs["xlink:href"]+runtimeProps.idSuffix),Object.entries(attrs).forEach(function(_a4){var key=_a4[0],value=_a4[1];typeof value=="string"&&(attrs[key]=value.replace(/url\(#(.*)\)/,"url(#$1".concat(runtimeProps.idSuffix,")")))})),attrs}__name(replaceRuntimeIdsAndExtInAttrs,"replaceRuntimeIdsAndExtInAttrs");function replaceRuntimeIdsInDefs(node,runtimeProps){var _a4,defIds=runtimeProps.defIds;return!defIds||defIds.length===0?node:node.tag==="defs"&&(!((_a4=node.children)===null||_a4===void 0)&&_a4.length)?__assign(__assign({},node),{children:node.children.map(function(child){return typeof child.attrs.id=="string"&&defIds&&defIds.indexOf(child.attrs.id)>-1?__assign(__assign({},child),{attrs:__assign(__assign({},child.attrs),{id:child.attrs.id+runtimeProps.idSuffix})}):child})}):node}__name(replaceRuntimeIdsInDefs,"replaceRuntimeIdsInDefs");function generateShortUuid(){return Math.random().toString(36).substring(2,8)}__name(generateShortUuid,"generateShortUuid");IconBase.displayName="UniverIcon";var element={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"#E5E5E5",d:"M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z"}},{tag:"path",attrs:{fill:"#fff",d:"M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z",fillRule:"evenodd",clipRule:"evenodd"}}]},CrossHighlightingSingle=React.forwardRef(function(props,ref){return React.createElement(IconBase,Object.assign({},props,{id:"cross-highlighting-single",ref,icon:element}))});CrossHighlightingSingle.displayName="CrossHighlightingSingle";const CROSSHAIR_HIGHLIGHT_COLORS=["rgba(158, 109, 227, 0.3)","rgba(254, 75, 75, 0.3)","rgba(255, 140, 81, 0.3)","rgba(164, 220, 22, 0.3)","rgba(45, 174, 255, 0.3)","rgba(58, 96, 247, 0.3)","rgba(242, 72, 166, 0.3)","rgba(153, 153, 153, 0.3)","rgba(158, 109, 227, 0.15)","rgba(254, 75, 75, 0.15)","rgba(255, 140, 81, 0.15)","rgba(164, 220, 22, 0.15)","rgba(45, 174, 255, 0.15)","rgba(58, 96, 247, 0.15)","rgba(242, 72, 166, 0.15)","rgba(153, 153, 153, 0.15)"],_SheetsCrosshairHighlightService=class _SheetsCrosshairHighlightService extends core.Disposable{constructor(){super(...arguments);__publicField(this,"_enabled$",new rxjs.BehaviorSubject(!1));__publicField(this,"enabled$",this._enabled$.asObservable());__publicField(this,"_color$",new rxjs.BehaviorSubject(CROSSHAIR_HIGHLIGHT_COLORS[0]));__publicField(this,"color$",this._color$.asObservable())}get enabled(){return this._enabled$.getValue()}get color(){return this._color$.getValue()}dispose(){this._enabled$.complete()}setEnabled(value){this._enabled$.next(value)}setColor(value){this._color$.next(value)}};__name(_SheetsCrosshairHighlightService,"SheetsCrosshairHighlightService");let SheetsCrosshairHighlightService=_SheetsCrosshairHighlightService;const ToggleCrosshairHighlightOperation={id:"sheet.operation.toggle-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService),turnedOn=service.enabled;return service.setEnabled(!turnedOn),!0}},SetCrosshairHighlightColorOperation={id:"sheet.operation.set-crosshair-highlight-color",type:core.CommandType.OPERATION,handler(accessor,{value}){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled||service.setEnabled(!0),service.setColor(value),!0}},EnableCrosshairHighlightOperation={id:"sheet.operation.enable-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled?!1:(service.setEnabled(!0),!0)}},DisableCrosshairHighlightOperation={id:"sheet.operation.disable-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled?(service.setEnabled(!1),!0):!1}},crosshairHighlightOverlay="univer-crosshair-highlight-overlay",crosshairHighlightItem="univer-crosshair-highlight-item",crosshairHighlightItemSelected="univer-crosshair-highlight-item-selected",styles={crosshairHighlightOverlay,crosshairHighlightItem,crosshairHighlightItemSelected};function CrosshairOverlay(props){const{onChange}=props,crosshairSrv=core.useDependency(SheetsCrosshairHighlightService),currentColor=core.useObservable(crosshairSrv.color$),handleColorPicked=React.useCallback(color=>{onChange==null||onChange(color)},[onChange]);return React.createElement("div",{className:styles.crosshairHighlightOverlay},CROSSHAIR_HIGHLIGHT_COLORS.map(color=>React.createElement("div",{key:color,className:clsx(styles.crosshairHighlightItem,{[styles.crosshairHighlightItemSelected]:color===currentColor}),style:{backgroundColor:color},onClick:__name(()=>handleColorPicked(color),"onClick")})))}__name(CrosshairOverlay,"CrosshairOverlay");const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT="CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";function CrosshairHighlightMenuItemFactory(accessor){const crosshairHighlightService=accessor.get(SheetsCrosshairHighlightService);return{id:ToggleCrosshairHighlightOperation.id,tooltip:"crosshair.button.tooltip",type:ui.MenuItemType.BUTTON_SELECTOR,icon:"CrossHighlightingSingle",selections:[{label:{name:CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,hoverable:!1}}],selectionsCommandId:SetCrosshairHighlightColorOperation.id,activated$:crosshairHighlightService.enabled$,hidden$:ui.getMenuHiddenObservable(accessor,core.UniverInstanceType.UNIVER_SHEET)}}__name(CrosshairHighlightMenuItemFactory,"CrosshairHighlightMenuItemFactory");const menuSchema={[ui.ContextMenuPosition.FOOTER_MENU]:{[ui.ContextMenuGroup.OTHERS]:{[ToggleCrosshairHighlightOperation.id]:{order:0,menuItemFactory:CrosshairHighlightMenuItemFactory}}}};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2"),_a;let SheetsCrosshairHighlightController=(_a=class extends core.Disposable{constructor(_componentMgr,_menuManagerService,_cmdSrv){super(),this._componentMgr=_componentMgr,this._menuManagerService=_menuManagerService,this._cmdSrv=_cmdSrv,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[ToggleCrosshairHighlightOperation,SetCrosshairHighlightColorOperation,EnableCrosshairHighlightOperation,DisableCrosshairHighlightOperation].forEach(c=>this._cmdSrv.registerCommand(c))}_initMenus(){this._menuManagerService.mergeMenu(menuSchema)}_initComponents(){this._componentMgr.register(CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,CrosshairOverlay),this._componentMgr.register("CrossHighlightingSingle",CrossHighlightingSingle)}},__name(_a,"SheetsCrosshairHighlightController"),_a);SheetsCrosshairHighlightController=__decorateClass$2([__decorateParam$2(0,core.Inject(ui.ComponentManager)),__decorateParam$2(1,ui.IMenuManagerService),__decorateParam$2(2,core.ICommandService)],SheetsCrosshairHighlightController);const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX=1,_CrossHairRangeCollection=class _CrossHairRangeCollection{constructor(){__publicField(this,"_selectedRanges",[]);__publicField(this,"_ranges",[])}addRange(range){if(range.rangeType===core.RANGE_TYPE.COLUMN||range.rangeType===core.RANGE_TYPE.ROW||range.rangeType===core.RANGE_TYPE.ALL)return;const intersects=this._getIntersects(range),splitRanges=this._getSplitRanges(range,intersects);splitRanges.length>0&&this._ranges.push(...splitRanges)}setSelectedRanges(selectedRange){this._selectedRanges=selectedRange}_getSplitRanges(range,intersects){let splitRanges=[range];for(const intersect of intersects.concat(this._selectedRanges)){const newRanges=[];for(const splitRange of splitRanges){const split=core.Rectangle.subtract(splitRange,intersect);split&&split.length>0&&newRanges.push(...split)}splitRanges=newRanges}return splitRanges.filter(range2=>range2.startRow<=range2.endRow&&range2.startColumn<=range2.endColumn)}_getIntersects(addRange){const intersects=[];for(const range of this._ranges){const intersect=core.Rectangle.getIntersects(range,addRange);intersect&&intersects.push(intersect)}return intersects}getRanges(){return this._ranges}reset(){this._ranges=[],this._selectedRanges=[]}};__name(_CrossHairRangeCollection,"CrossHairRangeCollection");let CrossHairRangeCollection=_CrossHairRangeCollection;const _SheetCrossHairHighlightShape=class _SheetCrossHairHighlightShape extends engineRender.Shape{constructor(key,props){super(key,props);__publicField(this,"_color");props&&this.setShapeProps(props)}setShapeProps(props){typeof props.color<"u"&&(this._color=props.color),this.transformByState({width:props.width,height:props.height})}_draw(ctx){const color=`rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;engineRender.Rect.drawWith(ctx,{width:this.width,height:this.height,fill:color,stroke:void 0,strokeWidth:0,evented:!1})}};__name(_SheetCrossHairHighlightShape,"SheetCrossHairHighlightShape");let SheetCrossHairHighlightShape=_SheetCrossHairHighlightShape;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1"),_a2;let SheetCrosshairHighlightRenderController=(_a2=class extends core.Disposable{constructor(_context,_sheetSkeletonManagerService,_sheetsSelectionsService,_sheetsCrosshairHighlightService,_contextService,_refSelectionsService){super();__publicField(this,"_shapes",[]);__publicField(this,"_rangeCollection",new CrossHairRangeCollection);__publicField(this,"_color","rgba(255,0,0,0.5)");this._context=_context,this._sheetSkeletonManagerService=_sheetSkeletonManagerService,this._sheetsSelectionsService=_sheetsSelectionsService,this._sheetsCrosshairHighlightService=_sheetsCrosshairHighlightService,this._contextService=_contextService,this._refSelectionsService=_refSelectionsService,this._initRenderListener()}_transformSelection(selectionData,sheet){if(!selectionData)return;const rowCount=sheet.getRowCount(),columnCount=sheet.getColumnCount(),ranges=[];for(const selection of selectionData){const{startRow,endRow,startColumn,endColumn}=selection.range;endRow-startRow+1===rowCount||endColumn-startColumn+1===columnCount||ranges.push(selection.range)}this._rangeCollection.setSelectedRanges(ranges);for(const range of ranges)this.addSelection(range,sheet)}_initRenderListener(){const workbook=this._context.unit;this.disposeWithMe(rxjs.combineLatest([this._contextService.subscribeContextValue$(sheets.DISABLE_NORMAL_SELECTIONS).pipe(rxjs.startWith(!1)),this._sheetSkeletonManagerService.currentSkeleton$,this._sheetsCrosshairHighlightService.enabled$,this._sheetsCrosshairHighlightService.color$.pipe(rxjs.tap(color=>this._color=color)),rxjs.merge(this._sheetsSelectionsService.selectionMoveStart$,this._sheetsSelectionsService.selectionMoving$,this._sheetsSelectionsService.selectionMoveEnd$,workbook.activeSheet$.pipe(rxjs.map(()=>this._sheetsSelectionsService.getCurrentSelections()))),rxjs.merge(this._refSelectionsService.selectionMoveStart$,this._refSelectionsService.selectionMoving$,this._refSelectionsService.selectionMoveEnd$,workbook.activeSheet$.pipe(rxjs.map(()=>this._refSelectionsService.getCurrentSelections())))]).subscribe(([normalSelDisabled,_,enabled,_color,normalSelections,refSelection])=>{if(this._clear(),!enabled)return;const selections=normalSelDisabled?refSelection:normalSelections;this._rangeCollection.reset(),this._transformSelection(selections,workbook.getActiveSheet()),this.render(this._rangeCollection.getRanges())}))}addSelection(range,sheet){if(range.rangeType===core.RANGE_TYPE.COLUMN||range.rangeType===core.RANGE_TYPE.ROW||range.rangeType===core.RANGE_TYPE.ALL)return;const maxRow=sheet.getRowCount(),maxColumn=sheet.getColumnCount(),{startRow,endRow,startColumn,endColumn}=range,left={startRow,endRow,startColumn:0,endColumn:startColumn-1},right={startRow,endRow,startColumn:endColumn+1,endColumn:maxColumn},top={startRow:0,endRow:startRow-1,startColumn,endColumn},bottom={startRow:endRow+1,endRow:maxRow,startColumn,endColumn};for(const range2 of[left,right,top,bottom])range2.startRow<=range2.endRow&&range2.startColumn<=range2.endColumn&&this._rangeCollection.addRange(range2)}_clear(){this._shapes.forEach(shape=>{shape.dispose()}),this._shapes=[]}_addShapes(range,index,scene,skeleton){const{startRow,endRow,startColumn,endColumn}=range,startPosition=sheetsUi.getCoordByCell(startRow,startColumn,scene,skeleton),endPosition=sheetsUi.getCoordByCell(endRow,endColumn,scene,skeleton),{startX,startY}=startPosition,{endX,endY}=endPosition,width=endX-startX,height=endY-startY,shapeProps={left:startX,top:startY,color:new core.ColorKit(this._color).toRgb(),width,height,zIndex:SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,evented:!1},currentShapes=new SheetCrossHairHighlightShape(`crosshair-${index}`,shapeProps);this._shapes.push(currentShapes),scene.addObject(currentShapes)}render(ranges){const skeleton=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!skeleton)return;const{scene}=this._context;this._clear();for(let i=0;i<ranges.length;i++){const range=ranges[i];this._addShapes(range,i,scene,skeleton)}scene.makeDirty(!0)}async dispose(){super.dispose()}},__name(_a2,"SheetCrosshairHighlightRenderController"),_a2);SheetCrosshairHighlightRenderController=__decorateClass$1([__decorateParam$1(1,core.Inject(sheetsUi.SheetSkeletonManagerService)),__decorateParam$1(2,core.Inject(sheets.SheetsSelectionsService)),__decorateParam$1(3,core.Inject(SheetsCrosshairHighlightService)),__decorateParam$1(4,core.Inject(core.IContextService)),__decorateParam$1(5,sheets.IRefSelectionsService)],SheetCrosshairHighlightRenderController);const PLUGIN_CONFIG_KEY="sheets-crosshair-highlight.config",defaultPluginConfig={};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),_a3;exports.UniverSheetsCrosshairHighlightPlugin=(_a3=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_renderManagerService,_configService){super(),this._config=_config,this._injector=_injector,this._renderManagerService=_renderManagerService,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[SheetsCrosshairHighlightService],[SheetsCrosshairHighlightController]].forEach(d=>this._injector.add(d))}onReady(){[[SheetCrosshairHighlightRenderController]].forEach(d=>this._injector.add(d)),this._injector.get(SheetsCrosshairHighlightController),this._renderManagerService.registerRenderModule(core.UniverInstanceType.UNIVER_SHEET,[SheetCrosshairHighlightRenderController])}},__name(_a3,"UniverSheetsCrosshairHighlightPlugin"),__publicField(_a3,"pluginName","SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"),__publicField(_a3,"type",core.UniverInstanceType.UNIVER_SHEET),_a3);exports.UniverSheetsCrosshairHighlightPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,engineRender.IRenderManagerService),__decorateParam(3,core.IConfigService)],exports.UniverSheetsCrosshairHighlightPlugin);exports.CROSSHAIR_HIGHLIGHT_COLORS=CROSSHAIR_HIGHLIGHT_COLORS;exports.DisableCrosshairHighlightOperation=DisableCrosshairHighlightOperation;exports.EnableCrosshairHighlightOperation=EnableCrosshairHighlightOperation;exports.SetCrosshairHighlightColorOperation=SetCrosshairHighlightColorOperation;exports.ToggleCrosshairHighlightOperation=ToggleCrosshairHighlightOperation;
1
+ 'use strict';const _0x2b2c2f=_0x183e;(function(_0x2017a2,_0x24ea5e){const _0x5740f1=_0x183e,_0x3cceec=_0x2017a2();while(!![]){try{const _0x261a0f=-parseInt(_0x5740f1(0x130))/0x1+-parseInt(_0x5740f1(0x199))/0x2*(parseInt(_0x5740f1(0x129))/0x3)+-parseInt(_0x5740f1(0x13e))/0x4*(parseInt(_0x5740f1(0x109))/0x5)+-parseInt(_0x5740f1(0x10f))/0x6+parseInt(_0x5740f1(0x116))/0x7+parseInt(_0x5740f1(0xff))/0x8+parseInt(_0x5740f1(0xd9))/0x9;if(_0x261a0f===_0x24ea5e)break;else _0x3cceec['push'](_0x3cceec['shift']());}catch(_0x54dcb8){_0x3cceec['push'](_0x3cceec['shift']());}}}(_0x2f08,0xace9f));var __defProp=Object[_0x2b2c2f(0x120)],__defNormalProp=(_0x557643,_0x87fae7,_0x1cf7c5)=>_0x87fae7 in _0x557643?__defProp(_0x557643,_0x87fae7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1cf7c5}):_0x557643[_0x87fae7]=_0x1cf7c5,__name=(_0x270858,_0xff9a20)=>__defProp(_0x270858,_0x2b2c2f(0x11e),{'value':_0xff9a20,'configurable':!0x0}),__publicField=(_0x143617,_0x14730d,_0x10677b)=>__defNormalProp(_0x143617,typeof _0x14730d!=_0x2b2c2f(0x12f)?_0x14730d+'':_0x14730d,_0x10677b);Object[_0x2b2c2f(0x120)](exports,Symbol[_0x2b2c2f(0xb8)],{'value':_0x2b2c2f(0xc4)});function _0x2f08(){const _0x5634dd=['_shapes','reset','fill','__decorateClass','toString','replaceRuntimeIdsAndExtInAttrs','27941364agFQZI','_rangeCollection','_cmdSrv','activeSheet$','COLUMN','clsx','disposeWithMe','currentSkeleton$','_sheetSkeletonManagerService','DisableCrosshairHighlightOperation','SheetsCrosshairHighlightController','sheet.operation.disable-crosshair-highlight','Disposable','_initComponents','get','_color','merge','transformByState','IRenderManagerService','FOOTER_MENU','getCurrentSkeleton','attrs','dispose','SheetCrossHairHighlightShape','setSelectedRanges','rangeType','ROW','ComponentManager','univer-crosshair-highlight-item','startRow','addObject','RANGE_TYPE','call','color$','rgba(255,\x20140,\x2081,\x200.15)','setConfig','substring','string','2419320qUjqdZ','getRanges','push','selectionMoveStart$','useObservable','_initMenus','subscribeContextValue$','_sheetsSelectionsService','rgba(45,\x20174,\x20255,\x200.15)','_ranges','80PScjaI','none','rgba(255,\x20140,\x2081,\x200.3)','getCoordByCell','map','complete','3897990tVOvMR','_config','1em','width','onClick','evenodd','getColumnCount','5653487dXpeug','EnableCrosshairHighlightOperation','rgba(254,\x2075,\x2075,\x200.3)','crosshair.button.tooltip','selectionMoving$','indexOf','add','UniverSheetsCrosshairHighlightPlugin','name','forEach','defineProperty','__decorateClass$1','render','_configService','addRange','UniverInstanceType','getOwnPropertySymbols','#E5E5E5','sheet.operation.toggle-crosshair-highlight','246yWKOvl','getValue','_initCommands','endColumn','propertyIsEnumerable','CommandType','symbol','1222370jGitCC','IRefSelectionsService','ColorKit','enabled','registerRenderModule','assign','rxjs','startWith','CrossHighlightingSingle','rgba(','CrosshairOverlay','svg','colorChannel1','icon','206604wTOZqy','useRef','useCallback','rgba(255,0,0,0.5)','IConfigService','forwardRef','onStarting','_renderManagerService','defIds','addSelection','rgba(242,\x2072,\x20166,\x200.3)','_menuManagerService','ToggleCrosshairHighlightOperation','register','prototype','M9.9998\x201.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z','mergeMenu','_getSplitRanges','#fff','IMenuManagerService','selectionMoveEnd$','_contextService','SheetsCrosshairHighlightService','Plugin','_addShapes','UNIVER_SHEET','sheet.operation.set-crosshair-highlight-color','pipe','SheetSkeletonManagerService','range','Shape','SetCrosshairHighlightColorOperation','BUTTON_SELECTOR','makeDirty','concat','current','0\x200\x2016\x2016','_injector','rgba(254,\x2075,\x2075,\x200.15)','_color$','IContextService','_draw','drawWith','function','univerjs-icon\x20univerjs-icon-','pluginName','rgba(58,\x2096,\x20247,\x200.3)','currentColor','entries','apply','className','_context','combineLatest','Rect','hasOwnProperty','color','crosshairHighlightOverlay','extend','CrosshairHighlightMenuItemFactory','next','@univerjs/engine-render','div','height','rgba(164,\x20220,\x2022,\x200.15)','OPERATION','registerCommand','generateShortUuid','Inject','getCurrentSelections','replaceRuntimeIdsInDefs','setShapeProps','setEnabled','trim','getRowCount','getMenuHiddenObservable','crosshairHighlightItem','toRgb','getOwnPropertyDescriptor','rgba(158,\x20109,\x20227,\x200.15)','SheetCrosshairHighlightRenderController','SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN','crosshair-','__decorateParam','@univerjs/core','Injector','tap','createElement','univer-crosshair-highlight-overlay','_transformSelection','children','rgba(164,\x20220,\x2022,\x200.3)','19706cRcGZC','crosshairHighlightItemSelected','_enabled$','subscribe','asObservable','onReady','xlink:href','BehaviorSubject','path','_clear','_selectedRanges','toStringTag','_initRenderListener','SheetsSelectionsService','getIntersects','rgba(153,\x20153,\x20153,\x200.15)','length','_getIntersects','url(#$1','displayName','_refSelectionsService','subtract','__decorateParam$1','Module','tag','idSuffix','startColumn','_componentMgr','type','univer-crosshair-highlight-item-selected','setColor','CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT','_sheetsCrosshairHighlightService','rgba(153,\x20153,\x20153,\x200.3)','cross-highlighting-single','enabled$','unit','endRow'];_0x2f08=function(){return _0x5634dd;};return _0x2f08();}const core=require(_0x2b2c2f(0x191)),engineRender=require(_0x2b2c2f(0x17a)),ui=require('@univerjs/ui'),rxjs=require(_0x2b2c2f(0x136)),React=require('react'),clsx=require(_0x2b2c2f(0xde)),sheetsUi=require('@univerjs/sheets-ui'),sheets=require('@univerjs/sheets');var __assign=function(){const _0x343b1e=_0x2b2c2f;return __assign=Object['assign']||function(_0x51d322){const _0x20451f=_0x183e;for(var _0x518dd1,_0x40ae81=0x1,_0x50173d=arguments['length'];_0x40ae81<_0x50173d;_0x40ae81++){_0x518dd1=arguments[_0x40ae81];for(var _0x1bf0f1 in _0x518dd1)Object[_0x20451f(0x14c)][_0x20451f(0x174)][_0x20451f(0xf9)](_0x518dd1,_0x1bf0f1)&&(_0x51d322[_0x1bf0f1]=_0x518dd1[_0x1bf0f1]);}return _0x51d322;},__assign[_0x343b1e(0x16f)](this,arguments);},__rest=function(_0x3fd5e6,_0x3b486f){const _0x3e87b9=_0x2b2c2f;var _0xb2d923={};for(var _0x16278d in _0x3fd5e6)Object[_0x3e87b9(0x14c)][_0x3e87b9(0x174)][_0x3e87b9(0xf9)](_0x3fd5e6,_0x16278d)&&_0x3b486f['indexOf'](_0x16278d)<0x0&&(_0xb2d923[_0x16278d]=_0x3fd5e6[_0x16278d]);if(_0x3fd5e6!=null&&typeof Object[_0x3e87b9(0x126)]==_0x3e87b9(0x169)){for(var _0x3345cd=0x0,_0x16278d=Object[_0x3e87b9(0x126)](_0x3fd5e6);_0x3345cd<_0x16278d[_0x3e87b9(0xbd)];_0x3345cd++)_0x3b486f[_0x3e87b9(0x11b)](_0x16278d[_0x3345cd])<0x0&&Object[_0x3e87b9(0x14c)][_0x3e87b9(0x12d)][_0x3e87b9(0xf9)](_0x3fd5e6,_0x16278d[_0x3345cd])&&(_0xb2d923[_0x16278d[_0x3345cd]]=_0x3fd5e6[_0x16278d[_0x3345cd]]);}return _0xb2d923;},IconBase=React[_0x2b2c2f(0x143)](function(_0x3acebf,_0x118daa){const _0x163af3=_0x2b2c2f;var _0x2081f6=_0x3acebf[_0x163af3(0x13d)],_0x217790=_0x3acebf['id'],_0x458050=_0x3acebf['className'],_0x4ed684=_0x3acebf[_0x163af3(0x177)],_0x3388cd=__rest(_0x3acebf,[_0x163af3(0x13d),'id',_0x163af3(0x170),_0x163af3(0x177)]),_0x303a0d=_0x163af3(0x16a)[_0x163af3(0x160)](_0x217790,'\x20')[_0x163af3(0x160)](_0x458050||'')[_0x163af3(0x186)](),_0x5a3351=React[_0x163af3(0x13f)]('_'[_0x163af3(0x160)](generateShortUuid()));return render(_0x2081f6,''[_0x163af3(0x160)](_0x217790),{'defIds':_0x2081f6[_0x163af3(0x146)],'idSuffix':_0x5a3351[_0x163af3(0x161)]},__assign({'ref':_0x118daa,'className':_0x303a0d},_0x3388cd),_0x4ed684);});function render(_0xf4e498,_0x562a6f,_0x54c224,_0x5c32ba,_0x4bb92f){const _0xd00248=_0x2b2c2f;return React[_0xd00248(0x194)](_0xf4e498[_0xd00248(0xc5)],__assign(__assign({'key':_0x562a6f},replaceRuntimeIdsAndExtInAttrs(_0xf4e498,_0x54c224,_0x4bb92f)),_0x5c32ba),(replaceRuntimeIdsInDefs(_0xf4e498,_0x54c224)[_0xd00248(0x197)]||[])[_0xd00248(0x10d)](function(_0x3d9289,_0x28ad22){const _0x192fc5=_0xd00248;return render(_0x3d9289,''[_0x192fc5(0x160)](_0x562a6f,'-')['concat'](_0xf4e498['tag'],'-')[_0x192fc5(0x160)](_0x28ad22),_0x54c224,void 0x0,_0x4bb92f);}));}function _0x183e(_0x4f23ce,_0x2ca54c){const _0x2f0819=_0x2f08();return _0x183e=function(_0x183e6c,_0x250b11){_0x183e6c=_0x183e6c-0xaf;let _0x1471ab=_0x2f0819[_0x183e6c];return _0x1471ab;},_0x183e(_0x4f23ce,_0x2ca54c);}__name(render,'render');function replaceRuntimeIdsAndExtInAttrs(_0x587083,_0x565c1d,_0xc09232){const _0x254582=_0x2b2c2f;var _0x5dbedd=__assign({},_0x587083[_0x254582(0xee)]);_0xc09232!=null&&_0xc09232[_0x254582(0x13c)]&&_0x5dbedd[_0x254582(0xd5)]===_0x254582(0x13c)&&(_0x5dbedd[_0x254582(0xd5)]=_0xc09232[_0x254582(0x13c)]);var _0xd25793=_0x565c1d[_0x254582(0x146)];return!_0xd25793||_0xd25793[_0x254582(0xbd)]===0x0||(_0x587083['tag']==='use'&&_0x5dbedd['xlink:href']&&(_0x5dbedd[_0x254582(0xb3)]=_0x5dbedd[_0x254582(0xb3)]+_0x565c1d[_0x254582(0xc6)]),Object[_0x254582(0x16e)](_0x5dbedd)[_0x254582(0x11f)](function(_0x24ce1a){const _0x1af088=_0x254582;var _0x2d7a99=_0x24ce1a[0x0],_0xf770fa=_0x24ce1a[0x1];typeof _0xf770fa==_0x1af088(0xfe)&&(_0x5dbedd[_0x2d7a99]=_0xf770fa['replace'](/url\(#(.*)\)/,_0x1af088(0xbf)[_0x1af088(0x160)](_0x565c1d[_0x1af088(0xc6)],')')));})),_0x5dbedd;}__name(replaceRuntimeIdsAndExtInAttrs,_0x2b2c2f(0xd8));function replaceRuntimeIdsInDefs(_0x526840,_0x430ee7){const _0x2a7915=_0x2b2c2f;var _0x1b5348,_0x2e603c=_0x430ee7[_0x2a7915(0x146)];return!_0x2e603c||_0x2e603c[_0x2a7915(0xbd)]===0x0?_0x526840:_0x526840[_0x2a7915(0xc5)]==='defs'&&(!((_0x1b5348=_0x526840[_0x2a7915(0x197)])===null||_0x1b5348===void 0x0)&&_0x1b5348[_0x2a7915(0xbd)])?__assign(__assign({},_0x526840),{'children':_0x526840['children'][_0x2a7915(0x10d)](function(_0x43f6db){const _0x3c7a29=_0x2a7915;return typeof _0x43f6db[_0x3c7a29(0xee)]['id']==_0x3c7a29(0xfe)&&_0x2e603c&&_0x2e603c[_0x3c7a29(0x11b)](_0x43f6db[_0x3c7a29(0xee)]['id'])>-0x1?__assign(__assign({},_0x43f6db),{'attrs':__assign(__assign({},_0x43f6db['attrs']),{'id':_0x43f6db[_0x3c7a29(0xee)]['id']+_0x430ee7[_0x3c7a29(0xc6)]})}):_0x43f6db;})}):_0x526840;}__name(replaceRuntimeIdsInDefs,_0x2b2c2f(0x183));function generateShortUuid(){const _0x302d97=_0x2b2c2f;return Math['random']()[_0x302d97(0xd7)](0x24)[_0x302d97(0xfd)](0x2,0x8);}__name(generateShortUuid,_0x2b2c2f(0x180)),IconBase[_0x2b2c2f(0xc0)]='UniverIcon';var element={'tag':_0x2b2c2f(0x13b),'attrs':{'fill':_0x2b2c2f(0x10a),'viewBox':_0x2b2c2f(0x162),'width':_0x2b2c2f(0x111),'height':_0x2b2c2f(0x111)},'children':[{'tag':'path','attrs':{'fill':_0x2b2c2f(0x127),'d':'M1.6499\x203.65002C1.6499\x202.54545\x202.54533\x201.65002\x203.6499\x201.65002H12.3499C13.4545\x201.65002\x2014.3499\x202.54545\x2014.3499\x203.65002V12.35C14.3499\x2013.4546\x2013.4545\x2014.35\x2012.3499\x2014.35H3.6499C2.54533\x2014.35\x201.6499\x2013.4546\x201.6499\x2012.35V3.65002Z'}},{'tag':_0x2b2c2f(0xb5),'attrs':{'fill':_0x2b2c2f(0x150),'d':_0x2b2c2f(0x14d)}},{'tag':_0x2b2c2f(0xb5),'attrs':{'fill':_0x2b2c2f(0x16d),'d':'M3.6498\x201.05005C2.21386\x201.05005\x201.0498\x202.21411\x201.0498\x203.65005V12.35C1.0498\x2013.786\x202.21386\x2014.95\x203.6498\x2014.95H12.3498C13.7857\x2014.95\x2014.9498\x2013.786\x2014.9498\x2012.3501V3.65005C14.9498\x202.21411\x2013.7857\x201.05005\x2012.3498\x201.05005H3.6498ZM5.4002\x202.25005H3.6498C2.87661\x202.25005\x202.2498\x202.87685\x202.2498\x203.65005V5.40002H5.4002V2.25005ZM2.2498\x2010.6V12.35C2.2498\x2013.1232\x202.87661\x2013.75\x203.6498\x2013.75H5.4002V10.6H2.2498ZM6.60019\x2013.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002\x202.25005V5.40002H13.7498V3.65005C13.7498\x202.87685\x2013.123\x202.25005\x2012.3498\x202.25005H10.6002ZM13.7498\x2010.6H10.6002V13.75H12.3498C13.123\x2013.75\x2013.7498\x2013.1232\x2013.7498\x2012.3501V10.6Z','fillRule':_0x2b2c2f(0x114),'clipRule':'evenodd'}}]},CrossHighlightingSingle=React[_0x2b2c2f(0x143)](function(_0x19d8c4,_0x213b94){const _0x4c3527=_0x2b2c2f;return React[_0x4c3527(0x194)](IconBase,Object[_0x4c3527(0x135)]({},_0x19d8c4,{'id':_0x4c3527(0xcf),'ref':_0x213b94,'icon':element}));});CrossHighlightingSingle[_0x2b2c2f(0xc0)]='CrossHighlightingSingle';const CROSSHAIR_HIGHLIGHT_COLORS=['rgba(158,\x20109,\x20227,\x200.3)',_0x2b2c2f(0x118),_0x2b2c2f(0x10b),_0x2b2c2f(0x198),'rgba(45,\x20174,\x20255,\x200.3)',_0x2b2c2f(0x16c),_0x2b2c2f(0x148),_0x2b2c2f(0xce),_0x2b2c2f(0x18c),_0x2b2c2f(0x164),_0x2b2c2f(0xfb),_0x2b2c2f(0x17d),_0x2b2c2f(0x107),'rgba(58,\x2096,\x20247,\x200.15)','rgba(242,\x2072,\x20166,\x200.15)',_0x2b2c2f(0xbc)],_SheetsCrosshairHighlightService=class _SheetsCrosshairHighlightService extends core[_0x2b2c2f(0xe5)]{constructor(){const _0x26541b=_0x2b2c2f;super(...arguments),__publicField(this,_0x26541b(0xaf),new rxjs[(_0x26541b(0xb4))](!0x1)),__publicField(this,_0x26541b(0xd0),this[_0x26541b(0xaf)][_0x26541b(0xb1)]()),__publicField(this,_0x26541b(0x165),new rxjs[(_0x26541b(0xb4))](CROSSHAIR_HIGHLIGHT_COLORS[0x0])),__publicField(this,_0x26541b(0xfa),this[_0x26541b(0x165)][_0x26541b(0xb1)]());}get[_0x2b2c2f(0x133)](){const _0x17515d=_0x2b2c2f;return this[_0x17515d(0xaf)]['getValue']();}get[_0x2b2c2f(0x175)](){const _0xaecf0=_0x2b2c2f;return this[_0xaecf0(0x165)][_0xaecf0(0x12a)]();}[_0x2b2c2f(0xef)](){const _0x4904d5=_0x2b2c2f;this[_0x4904d5(0xaf)][_0x4904d5(0x10e)]();}[_0x2b2c2f(0x185)](_0x1639cd){const _0xfd416=_0x2b2c2f;this['_enabled$'][_0xfd416(0x179)](_0x1639cd);}['setColor'](_0x13bd48){const _0x102426=_0x2b2c2f;this[_0x102426(0x165)]['next'](_0x13bd48);}};__name(_SheetsCrosshairHighlightService,_0x2b2c2f(0x154));let SheetsCrosshairHighlightService=_SheetsCrosshairHighlightService;const ToggleCrosshairHighlightOperation={'id':_0x2b2c2f(0x128),'type':core['CommandType'][_0x2b2c2f(0x17e)],'handler'(_0x325771){const _0x1545aa=_0x2b2c2f,_0x5d743e=_0x325771[_0x1545aa(0xe7)](SheetsCrosshairHighlightService),_0x2c1320=_0x5d743e[_0x1545aa(0x133)];return _0x5d743e['setEnabled'](!_0x2c1320),!0x0;}},SetCrosshairHighlightColorOperation={'id':_0x2b2c2f(0x158),'type':core[_0x2b2c2f(0x12e)][_0x2b2c2f(0x17e)],'handler'(_0xafc17,{value:_0x173cbd}){const _0x1bcac7=_0x2b2c2f,_0x54a2ee=_0xafc17['get'](SheetsCrosshairHighlightService);return _0x54a2ee[_0x1bcac7(0x133)]||_0x54a2ee['setEnabled'](!0x0),_0x54a2ee[_0x1bcac7(0xcb)](_0x173cbd),!0x0;}},EnableCrosshairHighlightOperation={'id':'sheet.operation.enable-crosshair-highlight','type':core[_0x2b2c2f(0x12e)]['OPERATION'],'handler'(_0x31678b){const _0x49f79d=_0x2b2c2f,_0x133a12=_0x31678b['get'](SheetsCrosshairHighlightService);return _0x133a12['enabled']?!0x1:(_0x133a12[_0x49f79d(0x185)](!0x0),!0x0);}},DisableCrosshairHighlightOperation={'id':_0x2b2c2f(0xe4),'type':core[_0x2b2c2f(0x12e)]['OPERATION'],'handler'(_0x7f8f5d){const _0x390b7d=_0x2b2c2f,_0x1dd536=_0x7f8f5d['get'](SheetsCrosshairHighlightService);return _0x1dd536[_0x390b7d(0x133)]?(_0x1dd536[_0x390b7d(0x185)](!0x1),!0x0):!0x1;}},crosshairHighlightOverlay=_0x2b2c2f(0x195),crosshairHighlightItem=_0x2b2c2f(0xf5),crosshairHighlightItemSelected=_0x2b2c2f(0xca),styles={'crosshairHighlightOverlay':crosshairHighlightOverlay,'crosshairHighlightItem':crosshairHighlightItem,'crosshairHighlightItemSelected':crosshairHighlightItemSelected};function CrosshairOverlay(_0x435c3c){const _0x2db34e=_0x2b2c2f,{onChange:_0x548c04}=_0x435c3c,_0x5710d0=core['useDependency'](SheetsCrosshairHighlightService),_0x15d901=core[_0x2db34e(0x103)](_0x5710d0[_0x2db34e(0xfa)]),_0x4d5800=React[_0x2db34e(0x140)](_0x42ffbd=>{_0x548c04==null||_0x548c04(_0x42ffbd);},[_0x548c04]);return React['createElement']('div',{'className':styles[_0x2db34e(0x176)]},CROSSHAIR_HIGHLIGHT_COLORS[_0x2db34e(0x10d)](_0x4fce2c=>React[_0x2db34e(0x194)](_0x2db34e(0x17b),{'key':_0x4fce2c,'className':clsx(styles[_0x2db34e(0x189)],{[styles[_0x2db34e(0x19a)]]:_0x4fce2c===_0x15d901}),'style':{'backgroundColor':_0x4fce2c},'onClick':__name(()=>_0x4d5800(_0x4fce2c),_0x2db34e(0x113))})));}__name(CrosshairOverlay,_0x2b2c2f(0x13a));const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT=_0x2b2c2f(0xcc);function CrosshairHighlightMenuItemFactory(_0x4e7220){const _0x42cf05=_0x2b2c2f,_0x30e10c=_0x4e7220[_0x42cf05(0xe7)](SheetsCrosshairHighlightService);return{'id':ToggleCrosshairHighlightOperation['id'],'tooltip':_0x42cf05(0x119),'type':ui['MenuItemType'][_0x42cf05(0x15e)],'icon':_0x42cf05(0x138),'selections':[{'label':{'name':CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,'hoverable':!0x1}}],'selectionsCommandId':SetCrosshairHighlightColorOperation['id'],'activated$':_0x30e10c['enabled$'],'hidden$':ui[_0x42cf05(0x188)](_0x4e7220,core[_0x42cf05(0x125)][_0x42cf05(0x157)])};}__name(CrosshairHighlightMenuItemFactory,_0x2b2c2f(0x178));const menuSchema={[ui['ContextMenuPosition'][_0x2b2c2f(0xec)]]:{[ui['ContextMenuGroup']['OTHERS']]:{[ToggleCrosshairHighlightOperation['id']]:{'order':0x0,'menuItemFactory':CrosshairHighlightMenuItemFactory}}}};var __defProp$2=Object[_0x2b2c2f(0x120)],__getOwnPropDesc$2=Object[_0x2b2c2f(0x18b)],__decorateClass$2=__name((_0x1370a9,_0x83bdab,_0x37d070,_0xdfd6de)=>{for(var _0x511cf6=_0xdfd6de>0x1?void 0x0:_0xdfd6de?__getOwnPropDesc$2(_0x83bdab,_0x37d070):_0x83bdab,_0xba3bed=_0x1370a9['length']-0x1,_0x494d77;_0xba3bed>=0x0;_0xba3bed--)(_0x494d77=_0x1370a9[_0xba3bed])&&(_0x511cf6=(_0xdfd6de?_0x494d77(_0x83bdab,_0x37d070,_0x511cf6):_0x494d77(_0x511cf6))||_0x511cf6);return _0xdfd6de&&_0x511cf6&&__defProp$2(_0x83bdab,_0x37d070,_0x511cf6),_0x511cf6;},'__decorateClass$2'),__decorateParam$2=__name((_0x42ab13,_0x4a4a91)=>(_0x1674d0,_0x49804d)=>_0x4a4a91(_0x1674d0,_0x49804d,_0x42ab13),'__decorateParam$2'),_a;let SheetsCrosshairHighlightController=(_a=class extends core['Disposable']{constructor(_0x54d1fa,_0x64d7a2,_0x361f5f){const _0x252aa8=_0x2b2c2f;super(),this['_componentMgr']=_0x54d1fa,this[_0x252aa8(0x149)]=_0x64d7a2,this[_0x252aa8(0xdb)]=_0x361f5f,this['_initCommands'](),this['_initMenus'](),this[_0x252aa8(0xe6)]();}[_0x2b2c2f(0x12b)](){const _0x3d7513=_0x2b2c2f;[ToggleCrosshairHighlightOperation,SetCrosshairHighlightColorOperation,EnableCrosshairHighlightOperation,DisableCrosshairHighlightOperation][_0x3d7513(0x11f)](_0x567b98=>this['_cmdSrv'][_0x3d7513(0x17f)](_0x567b98));}[_0x2b2c2f(0x104)](){const _0x2c39a0=_0x2b2c2f;this[_0x2c39a0(0x149)][_0x2c39a0(0x14e)](menuSchema);}[_0x2b2c2f(0xe6)](){const _0x1efa4e=_0x2b2c2f;this[_0x1efa4e(0xc8)]['register'](CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,CrosshairOverlay),this[_0x1efa4e(0xc8)][_0x1efa4e(0x14b)](_0x1efa4e(0x138),CrossHighlightingSingle);}},__name(_a,_0x2b2c2f(0xe3)),_a);SheetsCrosshairHighlightController=__decorateClass$2([__decorateParam$2(0x0,core[_0x2b2c2f(0x181)](ui[_0x2b2c2f(0xf4)])),__decorateParam$2(0x1,ui[_0x2b2c2f(0x151)]),__decorateParam$2(0x2,core['ICommandService'])],SheetsCrosshairHighlightController);const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX=0x1,_CrossHairRangeCollection=class _CrossHairRangeCollection{constructor(){const _0x964b84=_0x2b2c2f;__publicField(this,'_selectedRanges',[]),__publicField(this,_0x964b84(0x108),[]);}[_0x2b2c2f(0x124)](_0x5aa7ef){const _0x352eb6=_0x2b2c2f;if(_0x5aa7ef['rangeType']===core[_0x352eb6(0xf8)]['COLUMN']||_0x5aa7ef[_0x352eb6(0xf2)]===core[_0x352eb6(0xf8)][_0x352eb6(0xf3)]||_0x5aa7ef['rangeType']===core[_0x352eb6(0xf8)]['ALL'])return;const _0x367afc=this[_0x352eb6(0xbe)](_0x5aa7ef),_0x5f3414=this[_0x352eb6(0x14f)](_0x5aa7ef,_0x367afc);_0x5f3414[_0x352eb6(0xbd)]>0x0&&this[_0x352eb6(0x108)][_0x352eb6(0x101)](..._0x5f3414);}[_0x2b2c2f(0xf1)](_0x22cbcd){const _0xde8572=_0x2b2c2f;this[_0xde8572(0xb7)]=_0x22cbcd;}[_0x2b2c2f(0x14f)](_0x46e757,_0x2bbbb6){const _0x115eb8=_0x2b2c2f;let _0x2aef35=[_0x46e757];for(const _0xf2d6e4 of _0x2bbbb6['concat'](this[_0x115eb8(0xb7)])){const _0x219999=[];for(const _0x3984bf of _0x2aef35){const _0xe1fd29=core['Rectangle'][_0x115eb8(0xc2)](_0x3984bf,_0xf2d6e4);_0xe1fd29&&_0xe1fd29[_0x115eb8(0xbd)]>0x0&&_0x219999[_0x115eb8(0x101)](..._0xe1fd29);}_0x2aef35=_0x219999;}return _0x2aef35['filter'](_0x1012e3=>_0x1012e3[_0x115eb8(0xf6)]<=_0x1012e3[_0x115eb8(0xd2)]&&_0x1012e3[_0x115eb8(0xc7)]<=_0x1012e3[_0x115eb8(0x12c)]);}[_0x2b2c2f(0xbe)](_0x11051b){const _0x4c06ae=_0x2b2c2f,_0xb2e092=[];for(const _0x4f995b of this['_ranges']){const _0x39925d=core['Rectangle'][_0x4c06ae(0xbb)](_0x4f995b,_0x11051b);_0x39925d&&_0xb2e092[_0x4c06ae(0x101)](_0x39925d);}return _0xb2e092;}[_0x2b2c2f(0x100)](){const _0x3ad0b1=_0x2b2c2f;return this[_0x3ad0b1(0x108)];}[_0x2b2c2f(0xd4)](){const _0x1e85f0=_0x2b2c2f;this[_0x1e85f0(0x108)]=[],this[_0x1e85f0(0xb7)]=[];}};__name(_CrossHairRangeCollection,'CrossHairRangeCollection');let CrossHairRangeCollection=_CrossHairRangeCollection;const _SheetCrossHairHighlightShape=class _SheetCrossHairHighlightShape extends engineRender[_0x2b2c2f(0x15c)]{constructor(_0xe51f55,_0x1e72ba){const _0x476bfd=_0x2b2c2f;super(_0xe51f55,_0x1e72ba),__publicField(this,_0x476bfd(0xe8)),_0x1e72ba&&this[_0x476bfd(0x184)](_0x1e72ba);}[_0x2b2c2f(0x184)](_0xe776ae){const _0x5b9974=_0x2b2c2f;typeof _0xe776ae[_0x5b9974(0x175)]<'u'&&(this[_0x5b9974(0xe8)]=_0xe776ae[_0x5b9974(0x175)]),this[_0x5b9974(0xea)]({'width':_0xe776ae[_0x5b9974(0x112)],'height':_0xe776ae[_0x5b9974(0x17c)]});}[_0x2b2c2f(0x167)](_0xa7d107){const _0x1177c5=_0x2b2c2f,_0x558290=_0x1177c5(0x139)+this[_0x1177c5(0xe8)]['r']+',\x20'+this[_0x1177c5(0xe8)]['g']+',\x20'+this['_color']['b']+',\x20'+this[_0x1177c5(0xe8)]['a']+')';engineRender[_0x1177c5(0x173)][_0x1177c5(0x168)](_0xa7d107,{'width':this['width'],'height':this['height'],'fill':_0x558290,'stroke':void 0x0,'strokeWidth':0x0,'evented':!0x1});}};__name(_SheetCrossHairHighlightShape,_0x2b2c2f(0xf0));let SheetCrossHairHighlightShape=_SheetCrossHairHighlightShape;var __defProp$1=Object[_0x2b2c2f(0x120)],__getOwnPropDesc$1=Object[_0x2b2c2f(0x18b)],__decorateClass$1=__name((_0x2d1792,_0x318003,_0x229f7f,_0x4d395e)=>{const _0x1bd122=_0x2b2c2f;for(var _0x530dc1=_0x4d395e>0x1?void 0x0:_0x4d395e?__getOwnPropDesc$1(_0x318003,_0x229f7f):_0x318003,_0x32d4b7=_0x2d1792[_0x1bd122(0xbd)]-0x1,_0x2fc007;_0x32d4b7>=0x0;_0x32d4b7--)(_0x2fc007=_0x2d1792[_0x32d4b7])&&(_0x530dc1=(_0x4d395e?_0x2fc007(_0x318003,_0x229f7f,_0x530dc1):_0x2fc007(_0x530dc1))||_0x530dc1);return _0x4d395e&&_0x530dc1&&__defProp$1(_0x318003,_0x229f7f,_0x530dc1),_0x530dc1;},_0x2b2c2f(0x121)),__decorateParam$1=__name((_0x1edcc0,_0x4b3bca)=>(_0x158438,_0x50e180)=>_0x4b3bca(_0x158438,_0x50e180,_0x1edcc0),_0x2b2c2f(0xc3)),_a2;let SheetCrosshairHighlightRenderController=(_a2=class extends core[_0x2b2c2f(0xe5)]{constructor(_0x5580ce,_0x357719,_0x46d882,_0x36bb38,_0x513f59,_0x9a3284){const _0x5c72f8=_0x2b2c2f;super(),__publicField(this,_0x5c72f8(0xd3),[]),__publicField(this,_0x5c72f8(0xda),new CrossHairRangeCollection()),__publicField(this,_0x5c72f8(0xe8),_0x5c72f8(0x141)),(this[_0x5c72f8(0x171)]=_0x5580ce,this['_sheetSkeletonManagerService']=_0x357719,this[_0x5c72f8(0x106)]=_0x46d882,this['_sheetsCrosshairHighlightService']=_0x36bb38,this['_contextService']=_0x513f59,this[_0x5c72f8(0xc1)]=_0x9a3284,this[_0x5c72f8(0xb9)]());}[_0x2b2c2f(0x196)](_0x16e697,_0x2c8014){const _0x8e2cde=_0x2b2c2f;if(!_0x16e697)return;const _0x122e02=_0x2c8014[_0x8e2cde(0x187)](),_0x302d14=_0x2c8014['getColumnCount'](),_0x4b2859=[];for(const _0x3fded6 of _0x16e697){const {startRow:_0x15626c,endRow:_0x6f695a,startColumn:_0x35c362,endColumn:_0x49b58b}=_0x3fded6[_0x8e2cde(0x15b)];_0x6f695a-_0x15626c+0x1===_0x122e02||_0x49b58b-_0x35c362+0x1===_0x302d14||_0x4b2859[_0x8e2cde(0x101)](_0x3fded6[_0x8e2cde(0x15b)]);}this[_0x8e2cde(0xda)][_0x8e2cde(0xf1)](_0x4b2859);for(const _0x1658bf of _0x4b2859)this[_0x8e2cde(0x147)](_0x1658bf,_0x2c8014);}[_0x2b2c2f(0xb9)](){const _0x1c9c63=_0x2b2c2f,_0x369af5=this[_0x1c9c63(0x171)][_0x1c9c63(0xd1)];this[_0x1c9c63(0xdf)](rxjs[_0x1c9c63(0x172)]([this[_0x1c9c63(0x153)][_0x1c9c63(0x105)](sheets['DISABLE_NORMAL_SELECTIONS'])[_0x1c9c63(0x159)](rxjs[_0x1c9c63(0x137)](!0x1)),this['_sheetSkeletonManagerService'][_0x1c9c63(0xe0)],this[_0x1c9c63(0xcd)][_0x1c9c63(0xd0)],this[_0x1c9c63(0xcd)][_0x1c9c63(0xfa)][_0x1c9c63(0x159)](rxjs[_0x1c9c63(0x193)](_0x16b8e7=>this[_0x1c9c63(0xe8)]=_0x16b8e7)),rxjs['merge'](this[_0x1c9c63(0x106)][_0x1c9c63(0x102)],this['_sheetsSelectionsService'][_0x1c9c63(0x11a)],this[_0x1c9c63(0x106)][_0x1c9c63(0x152)],_0x369af5[_0x1c9c63(0xdc)][_0x1c9c63(0x159)](rxjs[_0x1c9c63(0x10d)](()=>this[_0x1c9c63(0x106)][_0x1c9c63(0x182)]()))),rxjs[_0x1c9c63(0xe9)](this[_0x1c9c63(0xc1)][_0x1c9c63(0x102)],this[_0x1c9c63(0xc1)][_0x1c9c63(0x11a)],this[_0x1c9c63(0xc1)][_0x1c9c63(0x152)],_0x369af5[_0x1c9c63(0xdc)][_0x1c9c63(0x159)](rxjs[_0x1c9c63(0x10d)](()=>this[_0x1c9c63(0xc1)][_0x1c9c63(0x182)]())))])[_0x1c9c63(0xb0)](([_0x1acd48,_0x587e81,_0x2f855a,_0x834fc2,_0x48ca2c,_0x40f9cc])=>{const _0x39bda7=_0x1c9c63;if(this[_0x39bda7(0xb6)](),!_0x2f855a)return;const _0x46fca5=_0x1acd48?_0x40f9cc:_0x48ca2c;this['_rangeCollection'][_0x39bda7(0xd4)](),this[_0x39bda7(0x196)](_0x46fca5,_0x369af5['getActiveSheet']()),this[_0x39bda7(0x122)](this['_rangeCollection']['getRanges']());}));}[_0x2b2c2f(0x147)](_0x4a2bc8,_0x141741){const _0x55554e=_0x2b2c2f;if(_0x4a2bc8['rangeType']===core['RANGE_TYPE'][_0x55554e(0xdd)]||_0x4a2bc8[_0x55554e(0xf2)]===core['RANGE_TYPE'][_0x55554e(0xf3)]||_0x4a2bc8[_0x55554e(0xf2)]===core[_0x55554e(0xf8)]['ALL'])return;const _0x3a12bf=_0x141741[_0x55554e(0x187)](),_0x384ced=_0x141741[_0x55554e(0x115)](),{startRow:_0x5c3bf1,endRow:_0x1e72b5,startColumn:_0x7b5315,endColumn:_0x14663a}=_0x4a2bc8,_0x4dfe18={'startRow':_0x5c3bf1,'endRow':_0x1e72b5,'startColumn':0x0,'endColumn':_0x7b5315-0x1},_0x2ef576={'startRow':_0x5c3bf1,'endRow':_0x1e72b5,'startColumn':_0x14663a+0x1,'endColumn':_0x384ced},_0x1a5048={'startRow':0x0,'endRow':_0x5c3bf1-0x1,'startColumn':_0x7b5315,'endColumn':_0x14663a},_0x1af4ea={'startRow':_0x1e72b5+0x1,'endRow':_0x3a12bf,'startColumn':_0x7b5315,'endColumn':_0x14663a};for(const _0x1c9dab of[_0x4dfe18,_0x2ef576,_0x1a5048,_0x1af4ea])_0x1c9dab[_0x55554e(0xf6)]<=_0x1c9dab[_0x55554e(0xd2)]&&_0x1c9dab[_0x55554e(0xc7)]<=_0x1c9dab[_0x55554e(0x12c)]&&this[_0x55554e(0xda)][_0x55554e(0x124)](_0x1c9dab);}[_0x2b2c2f(0xb6)](){const _0x311f6a=_0x2b2c2f;this[_0x311f6a(0xd3)][_0x311f6a(0x11f)](_0x4a0d3f=>{_0x4a0d3f['dispose']();}),this['_shapes']=[];}[_0x2b2c2f(0x156)](_0x5dfec9,_0x4321a7,_0x56cc73,_0x1bb0f8){const _0x3d4171=_0x2b2c2f,{startRow:_0x37107a,endRow:_0x560d12,startColumn:_0x3e30c3,endColumn:_0xece7fd}=_0x5dfec9,_0x431b12=sheetsUi[_0x3d4171(0x10c)](_0x37107a,_0x3e30c3,_0x56cc73,_0x1bb0f8),_0x41082a=sheetsUi[_0x3d4171(0x10c)](_0x560d12,_0xece7fd,_0x56cc73,_0x1bb0f8),{startX:_0x472a9a,startY:_0x129741}=_0x431b12,{endX:_0x412254,endY:_0x216e78}=_0x41082a,_0x225832=_0x412254-_0x472a9a,_0x39f528=_0x216e78-_0x129741,_0x494739={'left':_0x472a9a,'top':_0x129741,'color':new core[(_0x3d4171(0x132))](this[_0x3d4171(0xe8)])[_0x3d4171(0x18a)](),'width':_0x225832,'height':_0x39f528,'zIndex':SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,'evented':!0x1},_0x582611=new SheetCrossHairHighlightShape(_0x3d4171(0x18f)+_0x4321a7,_0x494739);this['_shapes'][_0x3d4171(0x101)](_0x582611),_0x56cc73[_0x3d4171(0xf7)](_0x582611);}[_0x2b2c2f(0x122)](_0xb5ffc1){const _0x3dab9d=_0x2b2c2f,_0x3bf6d7=this[_0x3dab9d(0xe1)][_0x3dab9d(0xed)]();if(!_0x3bf6d7)return;const {scene:_0x431ad4}=this[_0x3dab9d(0x171)];this[_0x3dab9d(0xb6)]();for(let _0x2302fa=0x0;_0x2302fa<_0xb5ffc1[_0x3dab9d(0xbd)];_0x2302fa++){const _0x6071bc=_0xb5ffc1[_0x2302fa];this['_addShapes'](_0x6071bc,_0x2302fa,_0x431ad4,_0x3bf6d7);}_0x431ad4[_0x3dab9d(0x15f)](!0x0);}async['dispose'](){const _0x2eb895=_0x2b2c2f;super[_0x2eb895(0xef)]();}},__name(_a2,_0x2b2c2f(0x18d)),_a2);SheetCrosshairHighlightRenderController=__decorateClass$1([__decorateParam$1(0x1,core[_0x2b2c2f(0x181)](sheetsUi[_0x2b2c2f(0x15a)])),__decorateParam$1(0x2,core['Inject'](sheets[_0x2b2c2f(0xba)])),__decorateParam$1(0x3,core[_0x2b2c2f(0x181)](SheetsCrosshairHighlightService)),__decorateParam$1(0x4,core[_0x2b2c2f(0x181)](core[_0x2b2c2f(0x166)])),__decorateParam$1(0x5,sheets[_0x2b2c2f(0x131)])],SheetCrosshairHighlightRenderController);const PLUGIN_CONFIG_KEY='sheets-crosshair-highlight.config',defaultPluginConfig={};var __defProp2=Object['defineProperty'],__getOwnPropDesc=Object[_0x2b2c2f(0x18b)],__decorateClass=__name((_0x3f80c5,_0x334948,_0x2e3def,_0x1e0f29)=>{const _0xd6eea4=_0x2b2c2f;for(var _0xc62650=_0x1e0f29>0x1?void 0x0:_0x1e0f29?__getOwnPropDesc(_0x334948,_0x2e3def):_0x334948,_0x586de3=_0x3f80c5[_0xd6eea4(0xbd)]-0x1,_0x40ed20;_0x586de3>=0x0;_0x586de3--)(_0x40ed20=_0x3f80c5[_0x586de3])&&(_0xc62650=(_0x1e0f29?_0x40ed20(_0x334948,_0x2e3def,_0xc62650):_0x40ed20(_0xc62650))||_0xc62650);return _0x1e0f29&&_0xc62650&&__defProp2(_0x334948,_0x2e3def,_0xc62650),_0xc62650;},_0x2b2c2f(0xd6)),__decorateParam=__name((_0x2fdad,_0x884fcc)=>(_0x34c09d,_0x169a8d)=>_0x884fcc(_0x34c09d,_0x169a8d,_0x2fdad),_0x2b2c2f(0x190)),_a3;exports[_0x2b2c2f(0x11d)]=(_a3=class extends core[_0x2b2c2f(0x155)]{constructor(_0x54d921=defaultPluginConfig,_0x217e09,_0x38ac27,_0x479bfd){const _0x5b7c38=_0x2b2c2f;super(),this[_0x5b7c38(0x110)]=_0x54d921,this[_0x5b7c38(0x163)]=_0x217e09,this[_0x5b7c38(0x145)]=_0x38ac27,this[_0x5b7c38(0x123)]=_0x479bfd;const {..._0x30dc31}=this[_0x5b7c38(0x110)];this[_0x5b7c38(0x123)][_0x5b7c38(0xfc)](PLUGIN_CONFIG_KEY,_0x30dc31);}[_0x2b2c2f(0x144)](){const _0x46584e=_0x2b2c2f;[[SheetsCrosshairHighlightService],[SheetsCrosshairHighlightController]][_0x46584e(0x11f)](_0x5781a3=>this[_0x46584e(0x163)][_0x46584e(0x11c)](_0x5781a3));}[_0x2b2c2f(0xb2)](){const _0x43a7cf=_0x2b2c2f;[[SheetCrosshairHighlightRenderController]][_0x43a7cf(0x11f)](_0x2197c6=>this[_0x43a7cf(0x163)]['add'](_0x2197c6)),this[_0x43a7cf(0x163)][_0x43a7cf(0xe7)](SheetsCrosshairHighlightController),this[_0x43a7cf(0x145)][_0x43a7cf(0x134)](core[_0x43a7cf(0x125)]['UNIVER_SHEET'],[SheetCrosshairHighlightRenderController]);}},__name(_a3,_0x2b2c2f(0x11d)),__publicField(_a3,_0x2b2c2f(0x16b),_0x2b2c2f(0x18e)),__publicField(_a3,_0x2b2c2f(0xc9),core['UniverInstanceType'][_0x2b2c2f(0x157)]),_a3),exports[_0x2b2c2f(0x11d)]=__decorateClass([__decorateParam(0x1,core[_0x2b2c2f(0x181)](core[_0x2b2c2f(0x192)])),__decorateParam(0x2,engineRender[_0x2b2c2f(0xeb)]),__decorateParam(0x3,core[_0x2b2c2f(0x142)])],exports[_0x2b2c2f(0x11d)]),exports['CROSSHAIR_HIGHLIGHT_COLORS']=CROSSHAIR_HIGHLIGHT_COLORS,exports[_0x2b2c2f(0xe2)]=DisableCrosshairHighlightOperation,exports[_0x2b2c2f(0x117)]=EnableCrosshairHighlightOperation,exports[_0x2b2c2f(0x15d)]=SetCrosshairHighlightColorOperation,exports[_0x2b2c2f(0x14a)]=ToggleCrosshairHighlightOperation;
package/lib/es/index.js CHANGED
@@ -1,445 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
- var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { Disposable, CommandType, useDependency, useObservable, UniverInstanceType, Inject, ICommandService, RANGE_TYPE, Rectangle, IContextService, ColorKit, Plugin, Injector, IConfigService } from "@univerjs/core";
6
- import { Shape, Rect, IRenderManagerService } from "@univerjs/engine-render";
7
- import { MenuItemType, getMenuHiddenObservable, ContextMenuPosition, ContextMenuGroup, ComponentManager, IMenuManagerService } from "@univerjs/ui";
8
- import { BehaviorSubject, combineLatest, startWith, tap, merge, map } from "rxjs";
9
- import React, { forwardRef, useRef, createElement, useCallback } from "react";
10
- import clsx from "clsx";
11
- import { SheetSkeletonManagerService, getCoordByCell } from "@univerjs/sheets-ui";
12
- import { SheetsSelectionsService, DISABLE_NORMAL_SELECTIONS, IRefSelectionsService } from "@univerjs/sheets";
13
- var __assign = function() {
14
- return __assign = Object.assign || function(t) {
15
- for (var s, i = 1, n = arguments.length; i < n; i++) {
16
- s = arguments[i];
17
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
18
- }
19
- return t;
20
- }, __assign.apply(this, arguments);
21
- }, __rest = function(s, e) {
22
- var t = {};
23
- for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
24
- if (s != null && typeof Object.getOwnPropertySymbols == "function")
25
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
26
- e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
27
- return t;
28
- }, IconBase = forwardRef(function(props, ref) {
29
- var icon = props.icon, id = props.id, className = props.className, extend = props.extend, restProps = __rest(props, ["icon", "id", "className", "extend"]), cls = "univerjs-icon univerjs-icon-".concat(id, " ").concat(className || "").trim(), idSuffix = useRef("_".concat(generateShortUuid()));
30
- return render(icon, "".concat(id), { defIds: icon.defIds, idSuffix: idSuffix.current }, __assign({ ref, className: cls }, restProps), extend);
31
- });
32
- function render(node, id, runtimeProps, rootProps, extend) {
33
- return createElement(node.tag, __assign(__assign({ key: id }, replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend)), rootProps), (replaceRuntimeIdsInDefs(node, runtimeProps).children || []).map(function(child, index) {
34
- return render(child, "".concat(id, "-").concat(node.tag, "-").concat(index), runtimeProps, void 0, extend);
35
- }));
36
- }
37
- __name(render, "render");
38
- function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
39
- var attrs = __assign({}, node.attrs);
40
- extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
41
- var defIds = runtimeProps.defIds;
42
- return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a4) {
43
- var key = _a4[0], value = _a4[1];
44
- typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
45
- })), attrs;
46
- }
47
- __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
48
- function replaceRuntimeIdsInDefs(node, runtimeProps) {
49
- var _a4, defIds = runtimeProps.defIds;
50
- return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a4 = node.children) === null || _a4 === void 0) && _a4.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
51
- return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
52
- }) }) : node;
53
- }
54
- __name(replaceRuntimeIdsInDefs, "replaceRuntimeIdsInDefs");
55
- function generateShortUuid() {
56
- return Math.random().toString(36).substring(2, 8);
57
- }
58
- __name(generateShortUuid, "generateShortUuid");
59
- IconBase.displayName = "UniverIcon";
60
- var element = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#E5E5E5", d: "M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, CrossHighlightingSingle = forwardRef(function(props, ref) {
61
- return createElement(IconBase, Object.assign({}, props, {
62
- id: "cross-highlighting-single",
63
- ref,
64
- icon: element
65
- }));
66
- });
67
- CrossHighlightingSingle.displayName = "CrossHighlightingSingle";
68
- const CROSSHAIR_HIGHLIGHT_COLORS = [
69
- "rgba(158, 109, 227, 0.3)",
70
- "rgba(254, 75, 75, 0.3)",
71
- "rgba(255, 140, 81, 0.3)",
72
- "rgba(164, 220, 22, 0.3)",
73
- "rgba(45, 174, 255, 0.3)",
74
- "rgba(58, 96, 247, 0.3)",
75
- "rgba(242, 72, 166, 0.3)",
76
- "rgba(153, 153, 153, 0.3)",
77
- "rgba(158, 109, 227, 0.15)",
78
- "rgba(254, 75, 75, 0.15)",
79
- "rgba(255, 140, 81, 0.15)",
80
- "rgba(164, 220, 22, 0.15)",
81
- "rgba(45, 174, 255, 0.15)",
82
- "rgba(58, 96, 247, 0.15)",
83
- "rgba(242, 72, 166, 0.15)",
84
- "rgba(153, 153, 153, 0.15)"
85
- ], _SheetsCrosshairHighlightService = class _SheetsCrosshairHighlightService extends Disposable {
86
- constructor() {
87
- super(...arguments);
88
- __publicField(this, "_enabled$", new BehaviorSubject(!1));
89
- __publicField(this, "enabled$", this._enabled$.asObservable());
90
- __publicField(this, "_color$", new BehaviorSubject(CROSSHAIR_HIGHLIGHT_COLORS[0]));
91
- __publicField(this, "color$", this._color$.asObservable());
92
- }
93
- get enabled() {
94
- return this._enabled$.getValue();
95
- }
96
- get color() {
97
- return this._color$.getValue();
98
- }
99
- dispose() {
100
- this._enabled$.complete();
101
- }
102
- setEnabled(value) {
103
- this._enabled$.next(value);
104
- }
105
- setColor(value) {
106
- this._color$.next(value);
107
- }
108
- };
109
- __name(_SheetsCrosshairHighlightService, "SheetsCrosshairHighlightService");
110
- let SheetsCrosshairHighlightService = _SheetsCrosshairHighlightService;
111
- const ToggleCrosshairHighlightOperation = {
112
- id: "sheet.operation.toggle-crosshair-highlight",
113
- type: CommandType.OPERATION,
114
- handler(accessor) {
115
- const service = accessor.get(SheetsCrosshairHighlightService), turnedOn = service.enabled;
116
- return service.setEnabled(!turnedOn), !0;
117
- }
118
- }, SetCrosshairHighlightColorOperation = {
119
- id: "sheet.operation.set-crosshair-highlight-color",
120
- type: CommandType.OPERATION,
121
- handler(accessor, { value }) {
122
- const service = accessor.get(SheetsCrosshairHighlightService);
123
- return service.enabled || service.setEnabled(!0), service.setColor(value), !0;
124
- }
125
- }, EnableCrosshairHighlightOperation = {
126
- id: "sheet.operation.enable-crosshair-highlight",
127
- type: CommandType.OPERATION,
128
- handler(accessor) {
129
- const service = accessor.get(SheetsCrosshairHighlightService);
130
- return service.enabled ? !1 : (service.setEnabled(!0), !0);
131
- }
132
- }, DisableCrosshairHighlightOperation = {
133
- id: "sheet.operation.disable-crosshair-highlight",
134
- type: CommandType.OPERATION,
135
- handler(accessor) {
136
- const service = accessor.get(SheetsCrosshairHighlightService);
137
- return service.enabled ? (service.setEnabled(!1), !0) : !1;
138
- }
139
- }, crosshairHighlightOverlay = "univer-crosshair-highlight-overlay", crosshairHighlightItem = "univer-crosshair-highlight-item", crosshairHighlightItemSelected = "univer-crosshair-highlight-item-selected", styles = {
140
- crosshairHighlightOverlay,
141
- crosshairHighlightItem,
142
- crosshairHighlightItemSelected
143
- };
144
- function CrosshairOverlay(props) {
145
- const { onChange } = props, crosshairSrv = useDependency(SheetsCrosshairHighlightService), currentColor = useObservable(crosshairSrv.color$), handleColorPicked = useCallback((color) => {
146
- onChange == null || onChange(color);
147
- }, [onChange]);
148
- return /* @__PURE__ */ React.createElement("div", { className: styles.crosshairHighlightOverlay }, CROSSHAIR_HIGHLIGHT_COLORS.map((color) => /* @__PURE__ */ React.createElement(
149
- "div",
150
- {
151
- key: color,
152
- className: clsx(styles.crosshairHighlightItem, {
153
- [styles.crosshairHighlightItemSelected]: color === currentColor
154
- }),
155
- style: { backgroundColor: color },
156
- onClick: /* @__PURE__ */ __name(() => handleColorPicked(color), "onClick")
157
- }
158
- )));
159
- }
160
- __name(CrosshairOverlay, "CrosshairOverlay");
161
- const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT = "CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";
162
- function CrosshairHighlightMenuItemFactory(accessor) {
163
- const crosshairHighlightService = accessor.get(SheetsCrosshairHighlightService);
164
- return {
165
- id: ToggleCrosshairHighlightOperation.id,
166
- tooltip: "crosshair.button.tooltip",
167
- type: MenuItemType.BUTTON_SELECTOR,
168
- icon: "CrossHighlightingSingle",
169
- selections: [
170
- {
171
- label: {
172
- name: CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,
173
- hoverable: !1
174
- }
175
- }
176
- ],
177
- selectionsCommandId: SetCrosshairHighlightColorOperation.id,
178
- activated$: crosshairHighlightService.enabled$,
179
- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET)
180
- };
181
- }
182
- __name(CrosshairHighlightMenuItemFactory, "CrosshairHighlightMenuItemFactory");
183
- const menuSchema = {
184
- [ContextMenuPosition.FOOTER_MENU]: {
185
- [ContextMenuGroup.OTHERS]: {
186
- [ToggleCrosshairHighlightOperation.id]: {
187
- order: 0,
188
- menuItemFactory: CrosshairHighlightMenuItemFactory
189
- }
190
- }
191
- }
192
- };
193
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
194
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
195
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
196
- return kind && result && __defProp$2(target, key, result), result;
197
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$2"), _a;
198
- let SheetsCrosshairHighlightController = (_a = class extends Disposable {
199
- constructor(_componentMgr, _menuManagerService, _cmdSrv) {
200
- super(), this._componentMgr = _componentMgr, this._menuManagerService = _menuManagerService, this._cmdSrv = _cmdSrv, this._initCommands(), this._initMenus(), this._initComponents();
201
- }
202
- _initCommands() {
203
- [
204
- ToggleCrosshairHighlightOperation,
205
- SetCrosshairHighlightColorOperation,
206
- EnableCrosshairHighlightOperation,
207
- DisableCrosshairHighlightOperation
208
- ].forEach((c) => this._cmdSrv.registerCommand(c));
209
- }
210
- _initMenus() {
211
- this._menuManagerService.mergeMenu(menuSchema);
212
- }
213
- _initComponents() {
214
- this._componentMgr.register(CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT, CrosshairOverlay), this._componentMgr.register("CrossHighlightingSingle", CrossHighlightingSingle);
215
- }
216
- }, __name(_a, "SheetsCrosshairHighlightController"), _a);
217
- SheetsCrosshairHighlightController = __decorateClass$2([
218
- __decorateParam$2(0, Inject(ComponentManager)),
219
- __decorateParam$2(1, IMenuManagerService),
220
- __decorateParam$2(2, ICommandService)
221
- ], SheetsCrosshairHighlightController);
222
- const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX = 1, _CrossHairRangeCollection = class _CrossHairRangeCollection {
223
- constructor() {
224
- __publicField(this, "_selectedRanges", []);
225
- __publicField(this, "_ranges", []);
226
- }
227
- addRange(range) {
228
- if (range.rangeType === RANGE_TYPE.COLUMN || range.rangeType === RANGE_TYPE.ROW || range.rangeType === RANGE_TYPE.ALL)
229
- return;
230
- const intersects = this._getIntersects(range), splitRanges = this._getSplitRanges(range, intersects);
231
- splitRanges.length > 0 && this._ranges.push(...splitRanges);
232
- }
233
- setSelectedRanges(selectedRange) {
234
- this._selectedRanges = selectedRange;
235
- }
236
- _getSplitRanges(range, intersects) {
237
- let splitRanges = [range];
238
- for (const intersect of intersects.concat(this._selectedRanges)) {
239
- const newRanges = [];
240
- for (const splitRange of splitRanges) {
241
- const split = Rectangle.subtract(splitRange, intersect);
242
- split && split.length > 0 && newRanges.push(...split);
243
- }
244
- splitRanges = newRanges;
245
- }
246
- return splitRanges.filter((range2) => range2.startRow <= range2.endRow && range2.startColumn <= range2.endColumn);
247
- }
248
- _getIntersects(addRange) {
249
- const intersects = [];
250
- for (const range of this._ranges) {
251
- const intersect = Rectangle.getIntersects(range, addRange);
252
- intersect && intersects.push(intersect);
253
- }
254
- return intersects;
255
- }
256
- getRanges() {
257
- return this._ranges;
258
- }
259
- reset() {
260
- this._ranges = [], this._selectedRanges = [];
261
- }
262
- };
263
- __name(_CrossHairRangeCollection, "CrossHairRangeCollection");
264
- let CrossHairRangeCollection = _CrossHairRangeCollection;
265
- const _SheetCrossHairHighlightShape = class _SheetCrossHairHighlightShape extends Shape {
266
- constructor(key, props) {
267
- super(key, props);
268
- // protected _showHighLight = false;
269
- __publicField(this, "_color");
270
- props && this.setShapeProps(props);
271
- }
272
- setShapeProps(props) {
273
- typeof props.color < "u" && (this._color = props.color), this.transformByState({
274
- width: props.width,
275
- height: props.height
276
- });
277
- }
278
- _draw(ctx) {
279
- const color = `rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;
280
- Rect.drawWith(ctx, {
281
- width: this.width,
282
- height: this.height,
283
- fill: color,
284
- stroke: void 0,
285
- strokeWidth: 0,
286
- evented: !1
287
- });
288
- }
289
- };
290
- __name(_SheetCrossHairHighlightShape, "SheetCrossHairHighlightShape");
291
- let SheetCrossHairHighlightShape = _SheetCrossHairHighlightShape;
292
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
293
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
294
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
295
- return kind && result && __defProp$1(target, key, result), result;
296
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1"), _a2;
297
- let SheetCrosshairHighlightRenderController = (_a2 = class extends Disposable {
298
- constructor(_context, _sheetSkeletonManagerService, _sheetsSelectionsService, _sheetsCrosshairHighlightService, _contextService, _refSelectionsService) {
299
- super();
300
- __publicField(this, "_shapes", []);
301
- __publicField(this, "_rangeCollection", new CrossHairRangeCollection());
302
- __publicField(this, "_color", "rgba(255,0,0,0.5)");
303
- this._context = _context, this._sheetSkeletonManagerService = _sheetSkeletonManagerService, this._sheetsSelectionsService = _sheetsSelectionsService, this._sheetsCrosshairHighlightService = _sheetsCrosshairHighlightService, this._contextService = _contextService, this._refSelectionsService = _refSelectionsService, this._initRenderListener();
304
- }
305
- _transformSelection(selectionData, sheet) {
306
- if (!selectionData)
307
- return;
308
- const rowCount = sheet.getRowCount(), columnCount = sheet.getColumnCount(), ranges = [];
309
- for (const selection of selectionData) {
310
- const { startRow, endRow, startColumn, endColumn } = selection.range;
311
- endRow - startRow + 1 === rowCount || endColumn - startColumn + 1 === columnCount || ranges.push(selection.range);
312
- }
313
- this._rangeCollection.setSelectedRanges(ranges);
314
- for (const range of ranges)
315
- this.addSelection(range, sheet);
316
- }
317
- _initRenderListener() {
318
- const workbook = this._context.unit;
319
- this.disposeWithMe(combineLatest([
320
- this._contextService.subscribeContextValue$(DISABLE_NORMAL_SELECTIONS).pipe(startWith(!1)),
321
- this._sheetSkeletonManagerService.currentSkeleton$,
322
- this._sheetsCrosshairHighlightService.enabled$,
323
- this._sheetsCrosshairHighlightService.color$.pipe(tap((color) => this._color = color)),
324
- merge(
325
- this._sheetsSelectionsService.selectionMoveStart$,
326
- this._sheetsSelectionsService.selectionMoving$,
327
- this._sheetsSelectionsService.selectionMoveEnd$,
328
- workbook.activeSheet$.pipe(map(() => this._sheetsSelectionsService.getCurrentSelections()))
329
- ),
330
- merge(
331
- this._refSelectionsService.selectionMoveStart$,
332
- this._refSelectionsService.selectionMoving$,
333
- this._refSelectionsService.selectionMoveEnd$,
334
- workbook.activeSheet$.pipe(map(() => this._refSelectionsService.getCurrentSelections()))
335
- )
336
- ]).subscribe(([normalSelDisabled, _, enabled, _color, normalSelections, refSelection]) => {
337
- if (this._clear(), !enabled) return;
338
- const selections = normalSelDisabled ? refSelection : normalSelections;
339
- this._rangeCollection.reset(), this._transformSelection(selections, workbook.getActiveSheet()), this.render(this._rangeCollection.getRanges());
340
- }));
341
- }
342
- addSelection(range, sheet) {
343
- if (range.rangeType === RANGE_TYPE.COLUMN || range.rangeType === RANGE_TYPE.ROW || range.rangeType === RANGE_TYPE.ALL)
344
- return;
345
- const maxRow = sheet.getRowCount(), maxColumn = sheet.getColumnCount(), { startRow, endRow, startColumn, endColumn } = range, left = {
346
- startRow,
347
- endRow,
348
- startColumn: 0,
349
- endColumn: startColumn - 1
350
- }, right = {
351
- startRow,
352
- endRow,
353
- startColumn: endColumn + 1,
354
- endColumn: maxColumn
355
- }, top = {
356
- startRow: 0,
357
- endRow: startRow - 1,
358
- startColumn,
359
- endColumn
360
- }, bottom = {
361
- startRow: endRow + 1,
362
- endRow: maxRow,
363
- startColumn,
364
- endColumn
365
- };
366
- for (const range2 of [left, right, top, bottom])
367
- range2.startRow <= range2.endRow && range2.startColumn <= range2.endColumn && this._rangeCollection.addRange(range2);
368
- }
369
- _clear() {
370
- this._shapes.forEach((shape) => {
371
- shape.dispose();
372
- }), this._shapes = [];
373
- }
374
- _addShapes(range, index, scene, skeleton) {
375
- const { startRow, endRow, startColumn, endColumn } = range, startPosition = getCoordByCell(startRow, startColumn, scene, skeleton), endPosition = getCoordByCell(endRow, endColumn, scene, skeleton), { startX, startY } = startPosition, { endX, endY } = endPosition, width = endX - startX, height = endY - startY, shapeProps = {
376
- left: startX,
377
- top: startY,
378
- color: new ColorKit(this._color).toRgb(),
379
- width,
380
- height,
381
- zIndex: SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,
382
- evented: !1
383
- }, currentShapes = new SheetCrossHairHighlightShape(`crosshair-${index}`, shapeProps);
384
- this._shapes.push(currentShapes), scene.addObject(currentShapes);
385
- }
386
- render(ranges) {
387
- const skeleton = this._sheetSkeletonManagerService.getCurrentSkeleton();
388
- if (!skeleton)
389
- return;
390
- const { scene } = this._context;
391
- this._clear();
392
- for (let i = 0; i < ranges.length; i++) {
393
- const range = ranges[i];
394
- this._addShapes(range, i, scene, skeleton);
395
- }
396
- scene.makeDirty(!0);
397
- }
398
- async dispose() {
399
- super.dispose();
400
- }
401
- }, __name(_a2, "SheetCrosshairHighlightRenderController"), _a2);
402
- SheetCrosshairHighlightRenderController = __decorateClass$1([
403
- __decorateParam$1(1, Inject(SheetSkeletonManagerService)),
404
- __decorateParam$1(2, Inject(SheetsSelectionsService)),
405
- __decorateParam$1(3, Inject(SheetsCrosshairHighlightService)),
406
- __decorateParam$1(4, Inject(IContextService)),
407
- __decorateParam$1(5, IRefSelectionsService)
408
- ], SheetCrosshairHighlightRenderController);
409
- const PLUGIN_CONFIG_KEY = "sheets-crosshair-highlight.config", defaultPluginConfig = {};
410
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
411
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
412
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
413
- return kind && result && __defProp2(target, key, result), result;
414
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), _a3;
415
- let UniverSheetsCrosshairHighlightPlugin = (_a3 = class extends Plugin {
416
- constructor(_config = defaultPluginConfig, _injector, _renderManagerService, _configService) {
417
- super(), this._config = _config, this._injector = _injector, this._renderManagerService = _renderManagerService, this._configService = _configService;
418
- const { ...rest } = this._config;
419
- this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
420
- }
421
- onStarting() {
422
- [
423
- [SheetsCrosshairHighlightService],
424
- [SheetsCrosshairHighlightController]
425
- ].forEach((d) => this._injector.add(d));
426
- }
427
- onReady() {
428
- [
429
- [SheetCrosshairHighlightRenderController]
430
- ].forEach((d) => this._injector.add(d)), this._injector.get(SheetsCrosshairHighlightController), this._renderManagerService.registerRenderModule(UniverInstanceType.UNIVER_SHEET, [SheetCrosshairHighlightRenderController]);
431
- }
432
- }, __name(_a3, "UniverSheetsCrosshairHighlightPlugin"), __publicField(_a3, "pluginName", "SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"), __publicField(_a3, "type", UniverInstanceType.UNIVER_SHEET), _a3);
433
- UniverSheetsCrosshairHighlightPlugin = __decorateClass([
434
- __decorateParam(1, Inject(Injector)),
435
- __decorateParam(2, IRenderManagerService),
436
- __decorateParam(3, IConfigService)
437
- ], UniverSheetsCrosshairHighlightPlugin);
438
- export {
439
- CROSSHAIR_HIGHLIGHT_COLORS,
440
- DisableCrosshairHighlightOperation,
441
- EnableCrosshairHighlightOperation,
442
- SetCrosshairHighlightColorOperation,
443
- ToggleCrosshairHighlightOperation,
444
- UniverSheetsCrosshairHighlightPlugin
445
- };
1
+ const _0x5be934=_0x100b;(function(_0x5cccda,_0x7631e0){const _0x33f264=_0x100b,_0x28ec85=_0x5cccda();while(!![]){try{const _0x5adefb=-parseInt(_0x33f264(0x163))/0x1*(-parseInt(_0x33f264(0x164))/0x2)+-parseInt(_0x33f264(0x154))/0x3*(parseInt(_0x33f264(0x1b8))/0x4)+parseInt(_0x33f264(0x114))/0x5*(-parseInt(_0x33f264(0x16b))/0x6)+parseInt(_0x33f264(0x119))/0x7+-parseInt(_0x33f264(0x13f))/0x8+parseInt(_0x33f264(0x118))/0x9+parseInt(_0x33f264(0x16c))/0xa*(-parseInt(_0x33f264(0x1b5))/0xb);if(_0x5adefb===_0x7631e0)break;else _0x28ec85['push'](_0x28ec85['shift']());}catch(_0x3f3b86){_0x28ec85['push'](_0x28ec85['shift']());}}}(_0x3fa6,0xa2e8b));var __defProp=Object[_0x5be934(0x1a2)],__defNormalProp=(_0x4b81ab,_0x246b1e,_0x7cce9a)=>_0x246b1e in _0x4b81ab?__defProp(_0x4b81ab,_0x246b1e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x7cce9a}):_0x4b81ab[_0x246b1e]=_0x7cce9a,__name=(_0x4cffdd,_0xb97aa6)=>__defProp(_0x4cffdd,_0x5be934(0x151),{'value':_0xb97aa6,'configurable':!0x0}),__publicField=(_0x14f6f2,_0xe99334,_0x4652fb)=>__defNormalProp(_0x14f6f2,typeof _0xe99334!=_0x5be934(0x15f)?_0xe99334+'':_0xe99334,_0x4652fb);import{Disposable,CommandType,useDependency,useObservable,UniverInstanceType,Inject,ICommandService,RANGE_TYPE,Rectangle,IContextService,ColorKit,Plugin,Injector,IConfigService}from'@univerjs/core';import{Shape,Rect,IRenderManagerService}from'@univerjs/engine-render';import{MenuItemType,getMenuHiddenObservable,ContextMenuPosition,ContextMenuGroup,ComponentManager,IMenuManagerService}from'@univerjs/ui';import{BehaviorSubject,combineLatest,startWith,tap,merge,map}from'rxjs';import _0x5cfb04,{forwardRef,useRef,createElement,useCallback}from'react';import _0x1b0b97 from'clsx';import{SheetSkeletonManagerService,getCoordByCell}from'@univerjs/sheets-ui';function _0x3fa6(){const _0x27be09=['__decorateClass$2','279940VpswtC','transformByState','icon','enabled','10520370AHBVWr','7733712BBdzkq','enabled$','pipe','FOOTER_MENU','complete','univer-crosshair-highlight-item','height','M9.9998\x201.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z','pluginName','evenodd','rgba(45,\x20174,\x20255,\x200.3)','reset','current','prototype','defs','_sheetsSelectionsService','SheetCrosshairHighlightRenderController','setColor','function','push','_clear','entries','hasOwnProperty','attrs','asObservable','startRow','rgba(255,\x20140,\x2081,\x200.3)','addSelection','_selectedRanges','currentSkeleton$','range','OPERATION','__decorateClass$1','getActiveSheet','_menuManagerService','addObject','_transformSelection','rangeType','345144PsrOFH','_componentMgr','filter','string','rgba(164,\x20220,\x2022,\x200.15)','CrossHairRangeCollection','rgba(153,\x20153,\x20153,\x200.3)','_getSplitRanges','indexOf','subscribe','_sheetSkeletonManagerService','COLUMN','trim','subtract','substring','_color','univer-crosshair-highlight-item-selected','disposeWithMe','name','fill','0\x200\x2016\x2016','369762TmtYyX','selectionMoveStart$','_sheetsCrosshairHighlightService','getOwnPropertyDescriptor','call','_addShapes','replace','CrossHighlightingSingle','_getIntersects','_rangeCollection','_initComponents','symbol','getCurrentSelections','replaceRuntimeIdsAndExtInAttrs','onStarting','9tlPGUW','18756ikGnui','displayName','__decorateClass','sheet.operation.enable-crosshair-highlight','rgba(58,\x2096,\x20247,\x200.3)','getIntersects','makeDirty','66yFJijq','20MlOlaB','none','_initMenus','getOwnPropertySymbols','map','length','render','use','endRow','propertyIsEnumerable','endColumn','_context','sheets-crosshair-highlight.config','get','_color$','1em','rgba(45,\x20174,\x20255,\x200.15)','OTHERS','generateShortUuid','activeSheet$','sheet.operation.disable-crosshair-highlight','_cmdSrv','_renderManagerService','setSelectedRanges','type','extend','onClick','crosshair.button.tooltip','getValue','color','_initRenderListener','width','unit','addRange','idSuffix','_contextService','_refSelectionsService','getRowCount','ROW','url(#$1','children','rgba(255,0,0,0.5)','SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN','className','rgba(254,\x2075,\x2075,\x200.3)','path','SheetsCrosshairHighlightService','#E5E5E5','ALL','startColumn','getCurrentSkeleton','_configService','_initCommands','sheet.operation.set-crosshair-highlight-color','defineProperty','tag','CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT','rgba(158,\x20109,\x20227,\x200.15)','_enabled$','_config','UNIVER_SHEET','toRgb','selectionMoving$','cross-highlighting-single','createElement','rgba(242,\x2072,\x20166,\x200.15)','color$','_ranges','register','rgba(254,\x2075,\x2075,\x200.15)','rgba(242,\x2072,\x20166,\x200.3)','replaceRuntimeIdsInDefs','apply','929962uJVxuc','defIds','registerCommand','28seGpSK','assign','__decorateParam$1','xlink:href','crosshairHighlightOverlay','concat','currentColor','svg','div','forEach','add','setEnabled','selectionMoveEnd$','getRanges','UniverSheetsCrosshairHighlightPlugin','dispose','BUTTON_SELECTOR','colorChannel1','mergeMenu','univerjs-icon\x20univerjs-icon-','drawWith','univer-crosshair-highlight-overlay','#fff','random','_injector','_shapes','SheetsCrosshairHighlightController'];_0x3fa6=function(){return _0x27be09;};return _0x3fa6();}import{SheetsSelectionsService,DISABLE_NORMAL_SELECTIONS,IRefSelectionsService}from'@univerjs/sheets';var __assign=function(){const _0x517a51=_0x5be934;return __assign=Object['assign']||function(_0x5268df){const _0x3c7642=_0x100b;for(var _0x25b617,_0x143e9c=0x1,_0x6fca99=arguments['length'];_0x143e9c<_0x6fca99;_0x143e9c++){_0x25b617=arguments[_0x143e9c];for(var _0x13eb71 in _0x25b617)Object[_0x3c7642(0x126)]['hasOwnProperty'][_0x3c7642(0x158)](_0x25b617,_0x13eb71)&&(_0x5268df[_0x13eb71]=_0x25b617[_0x13eb71]);}return _0x5268df;},__assign[_0x517a51(0x1b4)](this,arguments);},__rest=function(_0x2a05f1,_0x434aab){const _0x50fb95=_0x5be934;var _0x494cdb={};for(var _0x3f7854 in _0x2a05f1)Object[_0x50fb95(0x126)][_0x50fb95(0x12f)]['call'](_0x2a05f1,_0x3f7854)&&_0x434aab[_0x50fb95(0x147)](_0x3f7854)<0x0&&(_0x494cdb[_0x3f7854]=_0x2a05f1[_0x3f7854]);if(_0x2a05f1!=null&&typeof Object['getOwnPropertySymbols']==_0x50fb95(0x12b)){for(var _0x2a61f4=0x0,_0x3f7854=Object[_0x50fb95(0x16f)](_0x2a05f1);_0x2a61f4<_0x3f7854[_0x50fb95(0x171)];_0x2a61f4++)_0x434aab[_0x50fb95(0x147)](_0x3f7854[_0x2a61f4])<0x0&&Object[_0x50fb95(0x126)][_0x50fb95(0x175)][_0x50fb95(0x158)](_0x2a05f1,_0x3f7854[_0x2a61f4])&&(_0x494cdb[_0x3f7854[_0x2a61f4]]=_0x2a05f1[_0x3f7854[_0x2a61f4]]);}return _0x494cdb;},IconBase=forwardRef(function(_0x199ea8,_0x1478f0){const _0xc1d5f0=_0x5be934;var _0x299695=_0x199ea8['icon'],_0xb5ed39=_0x199ea8['id'],_0x207b6f=_0x199ea8['className'],_0x280899=_0x199ea8[_0xc1d5f0(0x185)],_0x4ff517=__rest(_0x199ea8,[_0xc1d5f0(0x116),'id',_0xc1d5f0(0x197),_0xc1d5f0(0x185)]),_0x38f218=_0xc1d5f0(0x10b)[_0xc1d5f0(0x1bd)](_0xb5ed39,'\x20')[_0xc1d5f0(0x1bd)](_0x207b6f||'')[_0xc1d5f0(0x14b)](),_0x45c3a1=useRef('_'[_0xc1d5f0(0x1bd)](generateShortUuid()));return render(_0x299695,''[_0xc1d5f0(0x1bd)](_0xb5ed39),{'defIds':_0x299695[_0xc1d5f0(0x1b6)],'idSuffix':_0x45c3a1[_0xc1d5f0(0x125)]},__assign({'ref':_0x1478f0,'className':_0x38f218},_0x4ff517),_0x280899);});function render(_0x83d6fd,_0x30f2fd,_0x7e6b6d,_0x20e910,_0x2b12bc){const _0x5253cf=_0x5be934;return createElement(_0x83d6fd['tag'],__assign(__assign({'key':_0x30f2fd},replaceRuntimeIdsAndExtInAttrs(_0x83d6fd,_0x7e6b6d,_0x2b12bc)),_0x20e910),(replaceRuntimeIdsInDefs(_0x83d6fd,_0x7e6b6d)[_0x5253cf(0x194)]||[])[_0x5253cf(0x170)](function(_0x3c78ed,_0x455e53){const _0x156ef0=_0x5253cf;return render(_0x3c78ed,''[_0x156ef0(0x1bd)](_0x30f2fd,'-')['concat'](_0x83d6fd[_0x156ef0(0x1a3)],'-')[_0x156ef0(0x1bd)](_0x455e53),_0x7e6b6d,void 0x0,_0x2b12bc);}));}function _0x100b(_0x241217,_0x2edac1){const _0x3fa677=_0x3fa6();return _0x100b=function(_0x100bce,_0xd34eb3){_0x100bce=_0x100bce-0x10b;let _0xa4ce1d=_0x3fa677[_0x100bce];return _0xa4ce1d;},_0x100b(_0x241217,_0x2edac1);}__name(render,_0x5be934(0x172));function replaceRuntimeIdsAndExtInAttrs(_0x408d52,_0x4d353e,_0x5ab4e1){const _0x5bfb5d=_0x5be934;var _0x4d782f=__assign({},_0x408d52[_0x5bfb5d(0x130)]);_0x5ab4e1!=null&&_0x5ab4e1[_0x5bfb5d(0x1c9)]&&_0x4d782f[_0x5bfb5d(0x152)]===_0x5bfb5d(0x1c9)&&(_0x4d782f['fill']=_0x5ab4e1[_0x5bfb5d(0x1c9)]);var _0x150bb1=_0x4d353e[_0x5bfb5d(0x1b6)];return!_0x150bb1||_0x150bb1[_0x5bfb5d(0x171)]===0x0||(_0x408d52[_0x5bfb5d(0x1a3)]===_0x5bfb5d(0x173)&&_0x4d782f[_0x5bfb5d(0x1bb)]&&(_0x4d782f['xlink:href']=_0x4d782f[_0x5bfb5d(0x1bb)]+_0x4d353e['idSuffix']),Object[_0x5bfb5d(0x12e)](_0x4d782f)[_0x5bfb5d(0x1c1)](function(_0xe822dd){const _0x3a3721=_0x5bfb5d;var _0x2f542b=_0xe822dd[0x0],_0xf7836d=_0xe822dd[0x1];typeof _0xf7836d==_0x3a3721(0x142)&&(_0x4d782f[_0x2f542b]=_0xf7836d[_0x3a3721(0x15a)](/url\(#(.*)\)/,_0x3a3721(0x193)[_0x3a3721(0x1bd)](_0x4d353e[_0x3a3721(0x18e)],')')));})),_0x4d782f;}__name(replaceRuntimeIdsAndExtInAttrs,_0x5be934(0x161));function replaceRuntimeIdsInDefs(_0x1c6984,_0x482de9){const _0x531a78=_0x5be934;var _0x349d1f,_0x22204a=_0x482de9['defIds'];return!_0x22204a||_0x22204a[_0x531a78(0x171)]===0x0?_0x1c6984:_0x1c6984['tag']===_0x531a78(0x127)&&(!((_0x349d1f=_0x1c6984['children'])===null||_0x349d1f===void 0x0)&&_0x349d1f['length'])?__assign(__assign({},_0x1c6984),{'children':_0x1c6984[_0x531a78(0x194)]['map'](function(_0xb387c6){const _0x2b48b5=_0x531a78;return typeof _0xb387c6[_0x2b48b5(0x130)]['id']=='string'&&_0x22204a&&_0x22204a[_0x2b48b5(0x147)](_0xb387c6[_0x2b48b5(0x130)]['id'])>-0x1?__assign(__assign({},_0xb387c6),{'attrs':__assign(__assign({},_0xb387c6[_0x2b48b5(0x130)]),{'id':_0xb387c6['attrs']['id']+_0x482de9[_0x2b48b5(0x18e)]})}):_0xb387c6;})}):_0x1c6984;}__name(replaceRuntimeIdsInDefs,_0x5be934(0x1b3));function generateShortUuid(){const _0xef2d2b=_0x5be934;return Math[_0xef2d2b(0x10f)]()['toString'](0x24)[_0xef2d2b(0x14d)](0x2,0x8);}__name(generateShortUuid,_0x5be934(0x17e)),IconBase[_0x5be934(0x165)]='UniverIcon';var element={'tag':_0x5be934(0x1bf),'attrs':{'fill':_0x5be934(0x16d),'viewBox':_0x5be934(0x153),'width':_0x5be934(0x17b),'height':_0x5be934(0x17b)},'children':[{'tag':_0x5be934(0x199),'attrs':{'fill':_0x5be934(0x19b),'d':'M1.6499\x203.65002C1.6499\x202.54545\x202.54533\x201.65002\x203.6499\x201.65002H12.3499C13.4545\x201.65002\x2014.3499\x202.54545\x2014.3499\x203.65002V12.35C14.3499\x2013.4546\x2013.4545\x2014.35\x2012.3499\x2014.35H3.6499C2.54533\x2014.35\x201.6499\x2013.4546\x201.6499\x2012.35V3.65002Z'}},{'tag':_0x5be934(0x199),'attrs':{'fill':_0x5be934(0x10e),'d':_0x5be934(0x120)}},{'tag':'path','attrs':{'fill':_0x5be934(0x1be),'d':'M3.6498\x201.05005C2.21386\x201.05005\x201.0498\x202.21411\x201.0498\x203.65005V12.35C1.0498\x2013.786\x202.21386\x2014.95\x203.6498\x2014.95H12.3498C13.7857\x2014.95\x2014.9498\x2013.786\x2014.9498\x2012.3501V3.65005C14.9498\x202.21411\x2013.7857\x201.05005\x2012.3498\x201.05005H3.6498ZM5.4002\x202.25005H3.6498C2.87661\x202.25005\x202.2498\x202.87685\x202.2498\x203.65005V5.40002H5.4002V2.25005ZM2.2498\x2010.6V12.35C2.2498\x2013.1232\x202.87661\x2013.75\x203.6498\x2013.75H5.4002V10.6H2.2498ZM6.60019\x2013.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002\x202.25005V5.40002H13.7498V3.65005C13.7498\x202.87685\x2013.123\x202.25005\x2012.3498\x202.25005H10.6002ZM13.7498\x2010.6H10.6002V13.75H12.3498C13.123\x2013.75\x2013.7498\x2013.1232\x2013.7498\x2012.3501V10.6Z','fillRule':_0x5be934(0x122),'clipRule':'evenodd'}}]},CrossHighlightingSingle=forwardRef(function(_0x8f4740,_0x8afe24){const _0x5b1798=_0x5be934;return createElement(IconBase,Object[_0x5b1798(0x1b9)]({},_0x8f4740,{'id':_0x5b1798(0x1ab),'ref':_0x8afe24,'icon':element}));});CrossHighlightingSingle['displayName']=_0x5be934(0x15b);const CROSSHAIR_HIGHLIGHT_COLORS=['rgba(158,\x20109,\x20227,\x200.3)',_0x5be934(0x198),_0x5be934(0x133),'rgba(164,\x20220,\x2022,\x200.3)',_0x5be934(0x123),_0x5be934(0x168),_0x5be934(0x1b2),_0x5be934(0x145),_0x5be934(0x1a5),_0x5be934(0x1b1),'rgba(255,\x20140,\x2081,\x200.15)',_0x5be934(0x143),_0x5be934(0x17c),'rgba(58,\x2096,\x20247,\x200.15)',_0x5be934(0x1ad),'rgba(153,\x20153,\x20153,\x200.15)'],_SheetsCrosshairHighlightService=class _SheetsCrosshairHighlightService extends Disposable{constructor(){const _0x544991=_0x5be934;super(...arguments),__publicField(this,_0x544991(0x1a6),new BehaviorSubject(!0x1)),__publicField(this,_0x544991(0x11a),this[_0x544991(0x1a6)][_0x544991(0x131)]()),__publicField(this,_0x544991(0x17a),new BehaviorSubject(CROSSHAIR_HIGHLIGHT_COLORS[0x0])),__publicField(this,_0x544991(0x1ae),this[_0x544991(0x17a)][_0x544991(0x131)]());}get['enabled'](){const _0x134030=_0x5be934;return this[_0x134030(0x1a6)][_0x134030(0x188)]();}get[_0x5be934(0x189)](){const _0x1ba3f0=_0x5be934;return this[_0x1ba3f0(0x17a)]['getValue']();}[_0x5be934(0x1c7)](){const _0xe0a547=_0x5be934;this[_0xe0a547(0x1a6)][_0xe0a547(0x11d)]();}[_0x5be934(0x1c3)](_0x469311){const _0x397adf=_0x5be934;this[_0x397adf(0x1a6)]['next'](_0x469311);}['setColor'](_0x276b72){const _0x5e0b5a=_0x5be934;this[_0x5e0b5a(0x17a)]['next'](_0x276b72);}};__name(_SheetsCrosshairHighlightService,_0x5be934(0x19a));let SheetsCrosshairHighlightService=_SheetsCrosshairHighlightService;const ToggleCrosshairHighlightOperation={'id':'sheet.operation.toggle-crosshair-highlight','type':CommandType[_0x5be934(0x138)],'handler'(_0x35250a){const _0x588c2a=_0x5be934,_0x1a2715=_0x35250a[_0x588c2a(0x179)](SheetsCrosshairHighlightService),_0x5b1ccf=_0x1a2715[_0x588c2a(0x117)];return _0x1a2715[_0x588c2a(0x1c3)](!_0x5b1ccf),!0x0;}},SetCrosshairHighlightColorOperation={'id':_0x5be934(0x1a1),'type':CommandType[_0x5be934(0x138)],'handler'(_0x52a6dd,{value:_0x226008}){const _0x1ef984=_0x5be934,_0xc0afc3=_0x52a6dd[_0x1ef984(0x179)](SheetsCrosshairHighlightService);return _0xc0afc3[_0x1ef984(0x117)]||_0xc0afc3[_0x1ef984(0x1c3)](!0x0),_0xc0afc3[_0x1ef984(0x12a)](_0x226008),!0x0;}},EnableCrosshairHighlightOperation={'id':_0x5be934(0x167),'type':CommandType[_0x5be934(0x138)],'handler'(_0xf70916){const _0x2bf3cf=_0x5be934,_0x2c8f5f=_0xf70916['get'](SheetsCrosshairHighlightService);return _0x2c8f5f[_0x2bf3cf(0x117)]?!0x1:(_0x2c8f5f[_0x2bf3cf(0x1c3)](!0x0),!0x0);}},DisableCrosshairHighlightOperation={'id':_0x5be934(0x180),'type':CommandType[_0x5be934(0x138)],'handler'(_0x5e4c20){const _0x4381d9=_0x5be934,_0x3be219=_0x5e4c20[_0x4381d9(0x179)](SheetsCrosshairHighlightService);return _0x3be219['enabled']?(_0x3be219[_0x4381d9(0x1c3)](!0x1),!0x0):!0x1;}},crosshairHighlightOverlay=_0x5be934(0x10d),crosshairHighlightItem=_0x5be934(0x11e),crosshairHighlightItemSelected=_0x5be934(0x14f),styles={'crosshairHighlightOverlay':crosshairHighlightOverlay,'crosshairHighlightItem':crosshairHighlightItem,'crosshairHighlightItemSelected':crosshairHighlightItemSelected};function CrosshairOverlay(_0x42a5c2){const _0x5d79f8=_0x5be934,{onChange:_0x37b3a9}=_0x42a5c2,_0x32aea0=useDependency(SheetsCrosshairHighlightService),_0x41d358=useObservable(_0x32aea0[_0x5d79f8(0x1ae)]),_0x971327=useCallback(_0x3638ff=>{_0x37b3a9==null||_0x37b3a9(_0x3638ff);},[_0x37b3a9]);return _0x5cfb04[_0x5d79f8(0x1ac)](_0x5d79f8(0x1c0),{'className':styles[_0x5d79f8(0x1bc)]},CROSSHAIR_HIGHLIGHT_COLORS[_0x5d79f8(0x170)](_0x234f4a=>_0x5cfb04['createElement'](_0x5d79f8(0x1c0),{'key':_0x234f4a,'className':_0x1b0b97(styles['crosshairHighlightItem'],{[styles['crosshairHighlightItemSelected']]:_0x234f4a===_0x41d358}),'style':{'backgroundColor':_0x234f4a},'onClick':__name(()=>_0x971327(_0x234f4a),_0x5d79f8(0x186))})));}__name(CrosshairOverlay,'CrosshairOverlay');const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT=_0x5be934(0x1a4);function CrosshairHighlightMenuItemFactory(_0x3be4ad){const _0x332c1c=_0x5be934,_0x119818=_0x3be4ad[_0x332c1c(0x179)](SheetsCrosshairHighlightService);return{'id':ToggleCrosshairHighlightOperation['id'],'tooltip':_0x332c1c(0x187),'type':MenuItemType[_0x332c1c(0x1c8)],'icon':_0x332c1c(0x15b),'selections':[{'label':{'name':CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,'hoverable':!0x1}}],'selectionsCommandId':SetCrosshairHighlightColorOperation['id'],'activated$':_0x119818[_0x332c1c(0x11a)],'hidden$':getMenuHiddenObservable(_0x3be4ad,UniverInstanceType[_0x332c1c(0x1a8)])};}__name(CrosshairHighlightMenuItemFactory,'CrosshairHighlightMenuItemFactory');const menuSchema={[ContextMenuPosition[_0x5be934(0x11c)]]:{[ContextMenuGroup[_0x5be934(0x17d)]]:{[ToggleCrosshairHighlightOperation['id']]:{'order':0x0,'menuItemFactory':CrosshairHighlightMenuItemFactory}}}};var __defProp$2=Object[_0x5be934(0x1a2)],__getOwnPropDesc$2=Object[_0x5be934(0x157)],__decorateClass$2=__name((_0x115c6d,_0x23f4a6,_0x34ed90,_0xe188a7)=>{const _0x22c8cc=_0x5be934;for(var _0x4c1117=_0xe188a7>0x1?void 0x0:_0xe188a7?__getOwnPropDesc$2(_0x23f4a6,_0x34ed90):_0x23f4a6,_0x3c7a3b=_0x115c6d[_0x22c8cc(0x171)]-0x1,_0x2c1166;_0x3c7a3b>=0x0;_0x3c7a3b--)(_0x2c1166=_0x115c6d[_0x3c7a3b])&&(_0x4c1117=(_0xe188a7?_0x2c1166(_0x23f4a6,_0x34ed90,_0x4c1117):_0x2c1166(_0x4c1117))||_0x4c1117);return _0xe188a7&&_0x4c1117&&__defProp$2(_0x23f4a6,_0x34ed90,_0x4c1117),_0x4c1117;},_0x5be934(0x113)),__decorateParam$2=__name((_0x50ab6c,_0x369e53)=>(_0x446540,_0x39df8b)=>_0x369e53(_0x446540,_0x39df8b,_0x50ab6c),'__decorateParam$2'),_a;let SheetsCrosshairHighlightController=(_a=class extends Disposable{constructor(_0x18b092,_0x13d49f,_0x2be108){const _0xd9656f=_0x5be934;super(),this[_0xd9656f(0x140)]=_0x18b092,this[_0xd9656f(0x13b)]=_0x13d49f,this[_0xd9656f(0x181)]=_0x2be108,this[_0xd9656f(0x1a0)](),this[_0xd9656f(0x16e)](),this[_0xd9656f(0x15e)]();}[_0x5be934(0x1a0)](){const _0x5e91ca=_0x5be934;[ToggleCrosshairHighlightOperation,SetCrosshairHighlightColorOperation,EnableCrosshairHighlightOperation,DisableCrosshairHighlightOperation]['forEach'](_0x537be8=>this['_cmdSrv'][_0x5e91ca(0x1b7)](_0x537be8));}[_0x5be934(0x16e)](){const _0x2905d9=_0x5be934;this[_0x2905d9(0x13b)][_0x2905d9(0x1ca)](menuSchema);}[_0x5be934(0x15e)](){const _0x5709d6=_0x5be934;this[_0x5709d6(0x140)][_0x5709d6(0x1b0)](CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,CrosshairOverlay),this['_componentMgr'][_0x5709d6(0x1b0)](_0x5709d6(0x15b),CrossHighlightingSingle);}},__name(_a,_0x5be934(0x112)),_a);SheetsCrosshairHighlightController=__decorateClass$2([__decorateParam$2(0x0,Inject(ComponentManager)),__decorateParam$2(0x1,IMenuManagerService),__decorateParam$2(0x2,ICommandService)],SheetsCrosshairHighlightController);const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX=0x1,_CrossHairRangeCollection=class _CrossHairRangeCollection{constructor(){const _0xe6777=_0x5be934;__publicField(this,_0xe6777(0x135),[]),__publicField(this,'_ranges',[]);}[_0x5be934(0x18d)](_0x20b8b7){const _0x18de3b=_0x5be934;if(_0x20b8b7['rangeType']===RANGE_TYPE[_0x18de3b(0x14a)]||_0x20b8b7[_0x18de3b(0x13e)]===RANGE_TYPE[_0x18de3b(0x192)]||_0x20b8b7[_0x18de3b(0x13e)]===RANGE_TYPE[_0x18de3b(0x19c)])return;const _0x2d284f=this[_0x18de3b(0x15c)](_0x20b8b7),_0x3a3ce5=this[_0x18de3b(0x146)](_0x20b8b7,_0x2d284f);_0x3a3ce5[_0x18de3b(0x171)]>0x0&&this[_0x18de3b(0x1af)][_0x18de3b(0x12c)](..._0x3a3ce5);}[_0x5be934(0x183)](_0x595d81){const _0x4587a9=_0x5be934;this[_0x4587a9(0x135)]=_0x595d81;}[_0x5be934(0x146)](_0x5ab300,_0xf82105){const _0x172423=_0x5be934;let _0x59ecd9=[_0x5ab300];for(const _0x5c67fd of _0xf82105[_0x172423(0x1bd)](this['_selectedRanges'])){const _0x5e175f=[];for(const _0x98d39 of _0x59ecd9){const _0x20837e=Rectangle[_0x172423(0x14c)](_0x98d39,_0x5c67fd);_0x20837e&&_0x20837e[_0x172423(0x171)]>0x0&&_0x5e175f['push'](..._0x20837e);}_0x59ecd9=_0x5e175f;}return _0x59ecd9[_0x172423(0x141)](_0xf617b=>_0xf617b[_0x172423(0x132)]<=_0xf617b[_0x172423(0x174)]&&_0xf617b[_0x172423(0x19d)]<=_0xf617b['endColumn']);}[_0x5be934(0x15c)](_0x3428ea){const _0x1a935b=_0x5be934,_0x1a5174=[];for(const _0x5cac17 of this[_0x1a935b(0x1af)]){const _0x8fcae2=Rectangle[_0x1a935b(0x169)](_0x5cac17,_0x3428ea);_0x8fcae2&&_0x1a5174[_0x1a935b(0x12c)](_0x8fcae2);}return _0x1a5174;}[_0x5be934(0x1c5)](){const _0x5c2495=_0x5be934;return this[_0x5c2495(0x1af)];}['reset'](){const _0x94720b=_0x5be934;this['_ranges']=[],this[_0x94720b(0x135)]=[];}};__name(_CrossHairRangeCollection,_0x5be934(0x144));let CrossHairRangeCollection=_CrossHairRangeCollection;const _SheetCrossHairHighlightShape=class _SheetCrossHairHighlightShape extends Shape{constructor(_0x4003d6,_0x5edbbf){const _0x5e76e=_0x5be934;super(_0x4003d6,_0x5edbbf),__publicField(this,_0x5e76e(0x14e)),_0x5edbbf&&this['setShapeProps'](_0x5edbbf);}['setShapeProps'](_0x3afcdd){const _0x20dc25=_0x5be934;typeof _0x3afcdd[_0x20dc25(0x189)]<'u'&&(this['_color']=_0x3afcdd[_0x20dc25(0x189)]),this[_0x20dc25(0x115)]({'width':_0x3afcdd[_0x20dc25(0x18b)],'height':_0x3afcdd[_0x20dc25(0x11f)]});}['_draw'](_0x538f83){const _0x2c997c=_0x5be934,_0x158985='rgba('+this[_0x2c997c(0x14e)]['r']+',\x20'+this[_0x2c997c(0x14e)]['g']+',\x20'+this[_0x2c997c(0x14e)]['b']+',\x20'+this[_0x2c997c(0x14e)]['a']+')';Rect[_0x2c997c(0x10c)](_0x538f83,{'width':this[_0x2c997c(0x18b)],'height':this['height'],'fill':_0x158985,'stroke':void 0x0,'strokeWidth':0x0,'evented':!0x1});}};__name(_SheetCrossHairHighlightShape,'SheetCrossHairHighlightShape');let SheetCrossHairHighlightShape=_SheetCrossHairHighlightShape;var __defProp$1=Object[_0x5be934(0x1a2)],__getOwnPropDesc$1=Object['getOwnPropertyDescriptor'],__decorateClass$1=__name((_0x2c261b,_0x4311fe,_0x223dab,_0x36cd1e)=>{for(var _0x129c06=_0x36cd1e>0x1?void 0x0:_0x36cd1e?__getOwnPropDesc$1(_0x4311fe,_0x223dab):_0x4311fe,_0x56e371=_0x2c261b['length']-0x1,_0x2a884b;_0x56e371>=0x0;_0x56e371--)(_0x2a884b=_0x2c261b[_0x56e371])&&(_0x129c06=(_0x36cd1e?_0x2a884b(_0x4311fe,_0x223dab,_0x129c06):_0x2a884b(_0x129c06))||_0x129c06);return _0x36cd1e&&_0x129c06&&__defProp$1(_0x4311fe,_0x223dab,_0x129c06),_0x129c06;},_0x5be934(0x139)),__decorateParam$1=__name((_0x27a2e4,_0xc522c)=>(_0x1428c3,_0x52c92e)=>_0xc522c(_0x1428c3,_0x52c92e,_0x27a2e4),_0x5be934(0x1ba)),_a2;let SheetCrosshairHighlightRenderController=(_a2=class extends Disposable{constructor(_0x4dcfba,_0x5763e1,_0x1cd90b,_0x20becb,_0x24af47,_0x1b132e){const _0x4270e7=_0x5be934;super(),__publicField(this,_0x4270e7(0x111),[]),__publicField(this,_0x4270e7(0x15d),new CrossHairRangeCollection()),__publicField(this,'_color',_0x4270e7(0x195)),(this['_context']=_0x4dcfba,this['_sheetSkeletonManagerService']=_0x5763e1,this[_0x4270e7(0x128)]=_0x1cd90b,this[_0x4270e7(0x156)]=_0x20becb,this[_0x4270e7(0x18f)]=_0x24af47,this[_0x4270e7(0x190)]=_0x1b132e,this[_0x4270e7(0x18a)]());}['_transformSelection'](_0x3848e7,_0x17fe74){const _0x534cd6=_0x5be934;if(!_0x3848e7)return;const _0x7a1d58=_0x17fe74['getRowCount'](),_0x46d9b1=_0x17fe74['getColumnCount'](),_0x2eb2e9=[];for(const _0x7c6d2 of _0x3848e7){const {startRow:_0x46f198,endRow:_0x234301,startColumn:_0x2199e8,endColumn:_0x3028ff}=_0x7c6d2['range'];_0x234301-_0x46f198+0x1===_0x7a1d58||_0x3028ff-_0x2199e8+0x1===_0x46d9b1||_0x2eb2e9[_0x534cd6(0x12c)](_0x7c6d2[_0x534cd6(0x137)]);}this[_0x534cd6(0x15d)]['setSelectedRanges'](_0x2eb2e9);for(const _0x2d1bbd of _0x2eb2e9)this[_0x534cd6(0x134)](_0x2d1bbd,_0x17fe74);}[_0x5be934(0x18a)](){const _0x592b24=_0x5be934,_0x201e62=this['_context'][_0x592b24(0x18c)];this[_0x592b24(0x150)](combineLatest([this[_0x592b24(0x18f)]['subscribeContextValue$'](DISABLE_NORMAL_SELECTIONS)[_0x592b24(0x11b)](startWith(!0x1)),this[_0x592b24(0x149)][_0x592b24(0x136)],this[_0x592b24(0x156)][_0x592b24(0x11a)],this[_0x592b24(0x156)][_0x592b24(0x1ae)][_0x592b24(0x11b)](tap(_0x1d7c04=>this[_0x592b24(0x14e)]=_0x1d7c04)),merge(this[_0x592b24(0x128)]['selectionMoveStart$'],this['_sheetsSelectionsService'][_0x592b24(0x1aa)],this[_0x592b24(0x128)][_0x592b24(0x1c4)],_0x201e62[_0x592b24(0x17f)][_0x592b24(0x11b)](map(()=>this[_0x592b24(0x128)][_0x592b24(0x160)]()))),merge(this[_0x592b24(0x190)][_0x592b24(0x155)],this['_refSelectionsService'][_0x592b24(0x1aa)],this[_0x592b24(0x190)][_0x592b24(0x1c4)],_0x201e62[_0x592b24(0x17f)][_0x592b24(0x11b)](map(()=>this[_0x592b24(0x190)]['getCurrentSelections']())))])[_0x592b24(0x148)](([_0x58caae,_0x546a8a,_0x20d30e,_0x4b5688,_0x15265c,_0x81bc06])=>{const _0x484c1c=_0x592b24;if(this['_clear'](),!_0x20d30e)return;const _0x4beb8b=_0x58caae?_0x81bc06:_0x15265c;this[_0x484c1c(0x15d)][_0x484c1c(0x124)](),this[_0x484c1c(0x13d)](_0x4beb8b,_0x201e62[_0x484c1c(0x13a)]()),this[_0x484c1c(0x172)](this[_0x484c1c(0x15d)][_0x484c1c(0x1c5)]());}));}[_0x5be934(0x134)](_0x48016b,_0x4b543a){const _0x46f588=_0x5be934;if(_0x48016b[_0x46f588(0x13e)]===RANGE_TYPE['COLUMN']||_0x48016b[_0x46f588(0x13e)]===RANGE_TYPE[_0x46f588(0x192)]||_0x48016b[_0x46f588(0x13e)]===RANGE_TYPE[_0x46f588(0x19c)])return;const _0x33bde8=_0x4b543a[_0x46f588(0x191)](),_0x3114df=_0x4b543a['getColumnCount'](),{startRow:_0x522927,endRow:_0x1e8967,startColumn:_0x5eb35b,endColumn:_0x24a8b4}=_0x48016b,_0x5be385={'startRow':_0x522927,'endRow':_0x1e8967,'startColumn':0x0,'endColumn':_0x5eb35b-0x1},_0x1e1f7d={'startRow':_0x522927,'endRow':_0x1e8967,'startColumn':_0x24a8b4+0x1,'endColumn':_0x3114df},_0x4a3760={'startRow':0x0,'endRow':_0x522927-0x1,'startColumn':_0x5eb35b,'endColumn':_0x24a8b4},_0x284967={'startRow':_0x1e8967+0x1,'endRow':_0x33bde8,'startColumn':_0x5eb35b,'endColumn':_0x24a8b4};for(const _0x54f512 of[_0x5be385,_0x1e1f7d,_0x4a3760,_0x284967])_0x54f512[_0x46f588(0x132)]<=_0x54f512[_0x46f588(0x174)]&&_0x54f512[_0x46f588(0x19d)]<=_0x54f512[_0x46f588(0x176)]&&this[_0x46f588(0x15d)]['addRange'](_0x54f512);}[_0x5be934(0x12d)](){const _0x510df3=_0x5be934;this[_0x510df3(0x111)]['forEach'](_0x3ec19a=>{const _0x2d36a4=_0x510df3;_0x3ec19a[_0x2d36a4(0x1c7)]();}),this['_shapes']=[];}['_addShapes'](_0x1fb11e,_0x322580,_0x45cce0,_0x5eb4a8){const _0x196cd1=_0x5be934,{startRow:_0xc5b3f9,endRow:_0xe86273,startColumn:_0x23e2ca,endColumn:_0x84a306}=_0x1fb11e,_0x417a4a=getCoordByCell(_0xc5b3f9,_0x23e2ca,_0x45cce0,_0x5eb4a8),_0x52aa95=getCoordByCell(_0xe86273,_0x84a306,_0x45cce0,_0x5eb4a8),{startX:_0x3a0251,startY:_0x413b6b}=_0x417a4a,{endX:_0x4cba0e,endY:_0x50c910}=_0x52aa95,_0x519de0=_0x4cba0e-_0x3a0251,_0x2bf490=_0x50c910-_0x413b6b,_0x2f98aa={'left':_0x3a0251,'top':_0x413b6b,'color':new ColorKit(this['_color'])[_0x196cd1(0x1a9)](),'width':_0x519de0,'height':_0x2bf490,'zIndex':SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,'evented':!0x1},_0x4c4be0=new SheetCrossHairHighlightShape('crosshair-'+_0x322580,_0x2f98aa);this[_0x196cd1(0x111)][_0x196cd1(0x12c)](_0x4c4be0),_0x45cce0[_0x196cd1(0x13c)](_0x4c4be0);}[_0x5be934(0x172)](_0x501b19){const _0x8d1a51=_0x5be934,_0x581076=this['_sheetSkeletonManagerService'][_0x8d1a51(0x19e)]();if(!_0x581076)return;const {scene:_0x38ff09}=this[_0x8d1a51(0x177)];this[_0x8d1a51(0x12d)]();for(let _0x5afef0=0x0;_0x5afef0<_0x501b19[_0x8d1a51(0x171)];_0x5afef0++){const _0x3011ce=_0x501b19[_0x5afef0];this[_0x8d1a51(0x159)](_0x3011ce,_0x5afef0,_0x38ff09,_0x581076);}_0x38ff09[_0x8d1a51(0x16a)](!0x0);}async['dispose'](){const _0x474015=_0x5be934;super[_0x474015(0x1c7)]();}},__name(_a2,_0x5be934(0x129)),_a2);SheetCrosshairHighlightRenderController=__decorateClass$1([__decorateParam$1(0x1,Inject(SheetSkeletonManagerService)),__decorateParam$1(0x2,Inject(SheetsSelectionsService)),__decorateParam$1(0x3,Inject(SheetsCrosshairHighlightService)),__decorateParam$1(0x4,Inject(IContextService)),__decorateParam$1(0x5,IRefSelectionsService)],SheetCrosshairHighlightRenderController);const PLUGIN_CONFIG_KEY=_0x5be934(0x178),defaultPluginConfig={};var __defProp2=Object[_0x5be934(0x1a2)],__getOwnPropDesc=Object[_0x5be934(0x157)],__decorateClass=__name((_0x161356,_0x6c3b38,_0x202f98,_0x53a32c)=>{const _0x140f77=_0x5be934;for(var _0x37e2ff=_0x53a32c>0x1?void 0x0:_0x53a32c?__getOwnPropDesc(_0x6c3b38,_0x202f98):_0x6c3b38,_0x14adb8=_0x161356[_0x140f77(0x171)]-0x1,_0x26ae17;_0x14adb8>=0x0;_0x14adb8--)(_0x26ae17=_0x161356[_0x14adb8])&&(_0x37e2ff=(_0x53a32c?_0x26ae17(_0x6c3b38,_0x202f98,_0x37e2ff):_0x26ae17(_0x37e2ff))||_0x37e2ff);return _0x53a32c&&_0x37e2ff&&__defProp2(_0x6c3b38,_0x202f98,_0x37e2ff),_0x37e2ff;},_0x5be934(0x166)),__decorateParam=__name((_0x2d4a00,_0x1f4747)=>(_0x26a20a,_0x39d85e)=>_0x1f4747(_0x26a20a,_0x39d85e,_0x2d4a00),'__decorateParam'),_a3;let UniverSheetsCrosshairHighlightPlugin=(_a3=class extends Plugin{constructor(_0x5b7546=defaultPluginConfig,_0x175d7e,_0x496835,_0x4307a0){const _0x201acb=_0x5be934;super(),this['_config']=_0x5b7546,this['_injector']=_0x175d7e,this[_0x201acb(0x182)]=_0x496835,this[_0x201acb(0x19f)]=_0x4307a0;const {..._0x4379fe}=this[_0x201acb(0x1a7)];this[_0x201acb(0x19f)]['setConfig'](PLUGIN_CONFIG_KEY,_0x4379fe);}[_0x5be934(0x162)](){const _0x3c4548=_0x5be934;[[SheetsCrosshairHighlightService],[SheetsCrosshairHighlightController]][_0x3c4548(0x1c1)](_0x4539b4=>this[_0x3c4548(0x110)][_0x3c4548(0x1c2)](_0x4539b4));}['onReady'](){const _0x3d07c1=_0x5be934;[[SheetCrosshairHighlightRenderController]]['forEach'](_0x4dff1d=>this['_injector']['add'](_0x4dff1d)),this[_0x3d07c1(0x110)][_0x3d07c1(0x179)](SheetsCrosshairHighlightController),this[_0x3d07c1(0x182)]['registerRenderModule'](UniverInstanceType[_0x3d07c1(0x1a8)],[SheetCrosshairHighlightRenderController]);}},__name(_a3,_0x5be934(0x1c6)),__publicField(_a3,_0x5be934(0x121),_0x5be934(0x196)),__publicField(_a3,_0x5be934(0x184),UniverInstanceType['UNIVER_SHEET']),_a3);UniverSheetsCrosshairHighlightPlugin=__decorateClass([__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,IRenderManagerService),__decorateParam(0x3,IConfigService)],UniverSheetsCrosshairHighlightPlugin);export{CROSSHAIR_HIGHLIGHT_COLORS,DisableCrosshairHighlightOperation,EnableCrosshairHighlightOperation,SetCrosshairHighlightColorOperation,ToggleCrosshairHighlightOperation,UniverSheetsCrosshairHighlightPlugin};
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/ui"),require("rxjs"),require("react"),require("clsx"),require("@univerjs/sheets-ui"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/ui","rxjs","react","clsx","@univerjs/sheets-ui","@univerjs/sheets"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverSheetsCrosshairHighlight={},global.UniverCore,global.UniverEngineRender,global.UniverUi,global.rxjs,global.React,global.clsx,global.UniverSheetsUi,global.UniverSheets))})(this,function(exports2,core,engineRender,ui,rxjs,React,clsx,sheetsUi,sheets){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b,_c;var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)},__rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t},IconBase=React.forwardRef(function(props,ref){var icon=props.icon,id=props.id,className=props.className,extend=props.extend,restProps=__rest(props,["icon","id","className","extend"]),cls="univerjs-icon univerjs-icon-".concat(id," ").concat(className||"").trim(),idSuffix=React.useRef("_".concat(generateShortUuid()));return render(icon,"".concat(id),{defIds:icon.defIds,idSuffix:idSuffix.current},__assign({ref,className:cls},restProps),extend)});function render(node,id,runtimeProps,rootProps,extend){return React.createElement(node.tag,__assign(__assign({key:id},replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend)),rootProps),(replaceRuntimeIdsInDefs(node,runtimeProps).children||[]).map(function(child,index){return render(child,"".concat(id,"-").concat(node.tag,"-").concat(index),runtimeProps,void 0,extend)}))}__name(render,"render");function replaceRuntimeIdsAndExtInAttrs(node,runtimeProps,extend){var attrs=__assign({},node.attrs);extend!=null&&extend.colorChannel1&&attrs.fill==="colorChannel1"&&(attrs.fill=extend.colorChannel1);var defIds=runtimeProps.defIds;return!defIds||defIds.length===0||(node.tag==="use"&&attrs["xlink:href"]&&(attrs["xlink:href"]=attrs["xlink:href"]+runtimeProps.idSuffix),Object.entries(attrs).forEach(function(_a2){var key=_a2[0],value=_a2[1];typeof value=="string"&&(attrs[key]=value.replace(/url\(#(.*)\)/,"url(#$1".concat(runtimeProps.idSuffix,")")))})),attrs}__name(replaceRuntimeIdsAndExtInAttrs,"replaceRuntimeIdsAndExtInAttrs");function replaceRuntimeIdsInDefs(node,runtimeProps){var _a2,defIds=runtimeProps.defIds;return!defIds||defIds.length===0?node:node.tag==="defs"&&(!((_a2=node.children)===null||_a2===void 0)&&_a2.length)?__assign(__assign({},node),{children:node.children.map(function(child){return typeof child.attrs.id=="string"&&defIds&&defIds.indexOf(child.attrs.id)>-1?__assign(__assign({},child),{attrs:__assign(__assign({},child.attrs),{id:child.attrs.id+runtimeProps.idSuffix})}):child})}):node}__name(replaceRuntimeIdsInDefs,"replaceRuntimeIdsInDefs");function generateShortUuid(){return Math.random().toString(36).substring(2,8)}__name(generateShortUuid,"generateShortUuid"),IconBase.displayName="UniverIcon";var element={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"#E5E5E5",d:"M1.6499 3.65002C1.6499 2.54545 2.54533 1.65002 3.6499 1.65002H12.3499C13.4545 1.65002 14.3499 2.54545 14.3499 3.65002V12.35C14.3499 13.4546 13.4545 14.35 12.3499 14.35H3.6499C2.54533 14.35 1.6499 13.4546 1.6499 12.35V3.65002Z"}},{tag:"path",attrs:{fill:"#fff",d:"M9.9998 1.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M3.6498 1.05005C2.21386 1.05005 1.0498 2.21411 1.0498 3.65005V12.35C1.0498 13.786 2.21386 14.95 3.6498 14.95H12.3498C13.7857 14.95 14.9498 13.786 14.9498 12.3501V3.65005C14.9498 2.21411 13.7857 1.05005 12.3498 1.05005H3.6498ZM5.4002 2.25005H3.6498C2.87661 2.25005 2.2498 2.87685 2.2498 3.65005V5.40002H5.4002V2.25005ZM2.2498 10.6V12.35C2.2498 13.1232 2.87661 13.75 3.6498 13.75H5.4002V10.6H2.2498ZM6.60019 13.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002 2.25005V5.40002H13.7498V3.65005C13.7498 2.87685 13.123 2.25005 12.3498 2.25005H10.6002ZM13.7498 10.6H10.6002V13.75H12.3498C13.123 13.75 13.7498 13.1232 13.7498 12.3501V10.6Z",fillRule:"evenodd",clipRule:"evenodd"}}]},CrossHighlightingSingle=React.forwardRef(function(props,ref){return React.createElement(IconBase,Object.assign({},props,{id:"cross-highlighting-single",ref,icon:element}))});CrossHighlightingSingle.displayName="CrossHighlightingSingle";const CROSSHAIR_HIGHLIGHT_COLORS=["rgba(158, 109, 227, 0.3)","rgba(254, 75, 75, 0.3)","rgba(255, 140, 81, 0.3)","rgba(164, 220, 22, 0.3)","rgba(45, 174, 255, 0.3)","rgba(58, 96, 247, 0.3)","rgba(242, 72, 166, 0.3)","rgba(153, 153, 153, 0.3)","rgba(158, 109, 227, 0.15)","rgba(254, 75, 75, 0.15)","rgba(255, 140, 81, 0.15)","rgba(164, 220, 22, 0.15)","rgba(45, 174, 255, 0.15)","rgba(58, 96, 247, 0.15)","rgba(242, 72, 166, 0.15)","rgba(153, 153, 153, 0.15)"],_SheetsCrosshairHighlightService=class _SheetsCrosshairHighlightService extends core.Disposable{constructor(){super(...arguments);__publicField(this,"_enabled$",new rxjs.BehaviorSubject(!1));__publicField(this,"enabled$",this._enabled$.asObservable());__publicField(this,"_color$",new rxjs.BehaviorSubject(CROSSHAIR_HIGHLIGHT_COLORS[0]));__publicField(this,"color$",this._color$.asObservable())}get enabled(){return this._enabled$.getValue()}get color(){return this._color$.getValue()}dispose(){this._enabled$.complete()}setEnabled(value){this._enabled$.next(value)}setColor(value){this._color$.next(value)}};__name(_SheetsCrosshairHighlightService,"SheetsCrosshairHighlightService");let SheetsCrosshairHighlightService=_SheetsCrosshairHighlightService;const ToggleCrosshairHighlightOperation={id:"sheet.operation.toggle-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService),turnedOn=service.enabled;return service.setEnabled(!turnedOn),!0}},SetCrosshairHighlightColorOperation={id:"sheet.operation.set-crosshair-highlight-color",type:core.CommandType.OPERATION,handler(accessor,{value}){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled||service.setEnabled(!0),service.setColor(value),!0}},EnableCrosshairHighlightOperation={id:"sheet.operation.enable-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled?!1:(service.setEnabled(!0),!0)}},DisableCrosshairHighlightOperation={id:"sheet.operation.disable-crosshair-highlight",type:core.CommandType.OPERATION,handler(accessor){const service=accessor.get(SheetsCrosshairHighlightService);return service.enabled?(service.setEnabled(!1),!0):!1}},styles={crosshairHighlightOverlay:"univer-crosshair-highlight-overlay",crosshairHighlightItem:"univer-crosshair-highlight-item",crosshairHighlightItemSelected:"univer-crosshair-highlight-item-selected"};function CrosshairOverlay(props){const{onChange}=props,crosshairSrv=core.useDependency(SheetsCrosshairHighlightService),currentColor=core.useObservable(crosshairSrv.color$),handleColorPicked=React.useCallback(color=>{onChange==null||onChange(color)},[onChange]);return React.createElement("div",{className:styles.crosshairHighlightOverlay},CROSSHAIR_HIGHLIGHT_COLORS.map(color=>React.createElement("div",{key:color,className:clsx(styles.crosshairHighlightItem,{[styles.crosshairHighlightItemSelected]:color===currentColor}),style:{backgroundColor:color},onClick:__name(()=>handleColorPicked(color),"onClick")})))}__name(CrosshairOverlay,"CrosshairOverlay");const CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT="CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT";function CrosshairHighlightMenuItemFactory(accessor){const crosshairHighlightService=accessor.get(SheetsCrosshairHighlightService);return{id:ToggleCrosshairHighlightOperation.id,tooltip:"crosshair.button.tooltip",type:ui.MenuItemType.BUTTON_SELECTOR,icon:"CrossHighlightingSingle",selections:[{label:{name:CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,hoverable:!1}}],selectionsCommandId:SetCrosshairHighlightColorOperation.id,activated$:crosshairHighlightService.enabled$,hidden$:ui.getMenuHiddenObservable(accessor,core.UniverInstanceType.UNIVER_SHEET)}}__name(CrosshairHighlightMenuItemFactory,"CrosshairHighlightMenuItemFactory");const menuSchema={[ui.ContextMenuPosition.FOOTER_MENU]:{[ui.ContextMenuGroup.OTHERS]:{[ToggleCrosshairHighlightOperation.id]:{order:0,menuItemFactory:CrosshairHighlightMenuItemFactory}}}};var __defProp$2=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$2=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$2(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$2(target,key,result),result},"__decorateClass$2"),__decorateParam$2=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$2");let SheetsCrosshairHighlightController=(_a=class extends core.Disposable{constructor(_componentMgr,_menuManagerService,_cmdSrv){super(),this._componentMgr=_componentMgr,this._menuManagerService=_menuManagerService,this._cmdSrv=_cmdSrv,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[ToggleCrosshairHighlightOperation,SetCrosshairHighlightColorOperation,EnableCrosshairHighlightOperation,DisableCrosshairHighlightOperation].forEach(c=>this._cmdSrv.registerCommand(c))}_initMenus(){this._menuManagerService.mergeMenu(menuSchema)}_initComponents(){this._componentMgr.register(CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT,CrosshairOverlay),this._componentMgr.register("CrossHighlightingSingle",CrossHighlightingSingle)}},__name(_a,"SheetsCrosshairHighlightController"),_a);SheetsCrosshairHighlightController=__decorateClass$2([__decorateParam$2(0,core.Inject(ui.ComponentManager)),__decorateParam$2(1,ui.IMenuManagerService),__decorateParam$2(2,core.ICommandService)],SheetsCrosshairHighlightController);const SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX=1,_CrossHairRangeCollection=class _CrossHairRangeCollection{constructor(){__publicField(this,"_selectedRanges",[]);__publicField(this,"_ranges",[])}addRange(range){if(range.rangeType===core.RANGE_TYPE.COLUMN||range.rangeType===core.RANGE_TYPE.ROW||range.rangeType===core.RANGE_TYPE.ALL)return;const intersects=this._getIntersects(range),splitRanges=this._getSplitRanges(range,intersects);splitRanges.length>0&&this._ranges.push(...splitRanges)}setSelectedRanges(selectedRange){this._selectedRanges=selectedRange}_getSplitRanges(range,intersects){let splitRanges=[range];for(const intersect of intersects.concat(this._selectedRanges)){const newRanges=[];for(const splitRange of splitRanges){const split=core.Rectangle.subtract(splitRange,intersect);split&&split.length>0&&newRanges.push(...split)}splitRanges=newRanges}return splitRanges.filter(range2=>range2.startRow<=range2.endRow&&range2.startColumn<=range2.endColumn)}_getIntersects(addRange){const intersects=[];for(const range of this._ranges){const intersect=core.Rectangle.getIntersects(range,addRange);intersect&&intersects.push(intersect)}return intersects}getRanges(){return this._ranges}reset(){this._ranges=[],this._selectedRanges=[]}};__name(_CrossHairRangeCollection,"CrossHairRangeCollection");let CrossHairRangeCollection=_CrossHairRangeCollection;const _SheetCrossHairHighlightShape=class _SheetCrossHairHighlightShape extends engineRender.Shape{constructor(key,props){super(key,props);__publicField(this,"_color");props&&this.setShapeProps(props)}setShapeProps(props){typeof props.color<"u"&&(this._color=props.color),this.transformByState({width:props.width,height:props.height})}_draw(ctx){const color=`rgba(${this._color.r}, ${this._color.g}, ${this._color.b}, ${this._color.a})`;engineRender.Rect.drawWith(ctx,{width:this.width,height:this.height,fill:color,stroke:void 0,strokeWidth:0,evented:!1})}};__name(_SheetCrossHairHighlightShape,"SheetCrossHairHighlightShape");let SheetCrossHairHighlightShape=_SheetCrossHairHighlightShape;var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");let SheetCrosshairHighlightRenderController=(_b=class extends core.Disposable{constructor(_context,_sheetSkeletonManagerService,_sheetsSelectionsService,_sheetsCrosshairHighlightService,_contextService,_refSelectionsService){super();__publicField(this,"_shapes",[]);__publicField(this,"_rangeCollection",new CrossHairRangeCollection);__publicField(this,"_color","rgba(255,0,0,0.5)");this._context=_context,this._sheetSkeletonManagerService=_sheetSkeletonManagerService,this._sheetsSelectionsService=_sheetsSelectionsService,this._sheetsCrosshairHighlightService=_sheetsCrosshairHighlightService,this._contextService=_contextService,this._refSelectionsService=_refSelectionsService,this._initRenderListener()}_transformSelection(selectionData,sheet){if(!selectionData)return;const rowCount=sheet.getRowCount(),columnCount=sheet.getColumnCount(),ranges=[];for(const selection of selectionData){const{startRow,endRow,startColumn,endColumn}=selection.range;endRow-startRow+1===rowCount||endColumn-startColumn+1===columnCount||ranges.push(selection.range)}this._rangeCollection.setSelectedRanges(ranges);for(const range of ranges)this.addSelection(range,sheet)}_initRenderListener(){const workbook=this._context.unit;this.disposeWithMe(rxjs.combineLatest([this._contextService.subscribeContextValue$(sheets.DISABLE_NORMAL_SELECTIONS).pipe(rxjs.startWith(!1)),this._sheetSkeletonManagerService.currentSkeleton$,this._sheetsCrosshairHighlightService.enabled$,this._sheetsCrosshairHighlightService.color$.pipe(rxjs.tap(color=>this._color=color)),rxjs.merge(this._sheetsSelectionsService.selectionMoveStart$,this._sheetsSelectionsService.selectionMoving$,this._sheetsSelectionsService.selectionMoveEnd$,workbook.activeSheet$.pipe(rxjs.map(()=>this._sheetsSelectionsService.getCurrentSelections()))),rxjs.merge(this._refSelectionsService.selectionMoveStart$,this._refSelectionsService.selectionMoving$,this._refSelectionsService.selectionMoveEnd$,workbook.activeSheet$.pipe(rxjs.map(()=>this._refSelectionsService.getCurrentSelections())))]).subscribe(([normalSelDisabled,_,enabled,_color,normalSelections,refSelection])=>{if(this._clear(),!enabled)return;const selections=normalSelDisabled?refSelection:normalSelections;this._rangeCollection.reset(),this._transformSelection(selections,workbook.getActiveSheet()),this.render(this._rangeCollection.getRanges())}))}addSelection(range,sheet){if(range.rangeType===core.RANGE_TYPE.COLUMN||range.rangeType===core.RANGE_TYPE.ROW||range.rangeType===core.RANGE_TYPE.ALL)return;const maxRow=sheet.getRowCount(),maxColumn=sheet.getColumnCount(),{startRow,endRow,startColumn,endColumn}=range,left={startRow,endRow,startColumn:0,endColumn:startColumn-1},right={startRow,endRow,startColumn:endColumn+1,endColumn:maxColumn},top={startRow:0,endRow:startRow-1,startColumn,endColumn},bottom={startRow:endRow+1,endRow:maxRow,startColumn,endColumn};for(const range2 of[left,right,top,bottom])range2.startRow<=range2.endRow&&range2.startColumn<=range2.endColumn&&this._rangeCollection.addRange(range2)}_clear(){this._shapes.forEach(shape=>{shape.dispose()}),this._shapes=[]}_addShapes(range,index,scene,skeleton){const{startRow,endRow,startColumn,endColumn}=range,startPosition=sheetsUi.getCoordByCell(startRow,startColumn,scene,skeleton),endPosition=sheetsUi.getCoordByCell(endRow,endColumn,scene,skeleton),{startX,startY}=startPosition,{endX,endY}=endPosition,width=endX-startX,height=endY-startY,shapeProps={left:startX,top:startY,color:new core.ColorKit(this._color).toRgb(),width,height,zIndex:SHEETS_CROSSHAIR_HIGHLIGHT_Z_INDEX,evented:!1},currentShapes=new SheetCrossHairHighlightShape(`crosshair-${index}`,shapeProps);this._shapes.push(currentShapes),scene.addObject(currentShapes)}render(ranges){const skeleton=this._sheetSkeletonManagerService.getCurrentSkeleton();if(!skeleton)return;const{scene}=this._context;this._clear();for(let i=0;i<ranges.length;i++){const range=ranges[i];this._addShapes(range,i,scene,skeleton)}scene.makeDirty(!0)}async dispose(){super.dispose()}},__name(_b,"SheetCrosshairHighlightRenderController"),_b);SheetCrosshairHighlightRenderController=__decorateClass$1([__decorateParam$1(1,core.Inject(sheetsUi.SheetSkeletonManagerService)),__decorateParam$1(2,core.Inject(sheets.SheetsSelectionsService)),__decorateParam$1(3,core.Inject(SheetsCrosshairHighlightService)),__decorateParam$1(4,core.Inject(core.IContextService)),__decorateParam$1(5,sheets.IRefSelectionsService)],SheetCrosshairHighlightRenderController);const PLUGIN_CONFIG_KEY="sheets-crosshair-highlight.config",defaultPluginConfig={};var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam");exports2.UniverSheetsCrosshairHighlightPlugin=(_c=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_renderManagerService,_configService){super(),this._config=_config,this._injector=_injector,this._renderManagerService=_renderManagerService,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[SheetsCrosshairHighlightService],[SheetsCrosshairHighlightController]].forEach(d=>this._injector.add(d))}onReady(){[[SheetCrosshairHighlightRenderController]].forEach(d=>this._injector.add(d)),this._injector.get(SheetsCrosshairHighlightController),this._renderManagerService.registerRenderModule(core.UniverInstanceType.UNIVER_SHEET,[SheetCrosshairHighlightRenderController])}},__name(_c,"UniverSheetsCrosshairHighlightPlugin"),__publicField(_c,"pluginName","SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN"),__publicField(_c,"type",core.UniverInstanceType.UNIVER_SHEET),_c),exports2.UniverSheetsCrosshairHighlightPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,engineRender.IRenderManagerService),__decorateParam(3,core.IConfigService)],exports2.UniverSheetsCrosshairHighlightPlugin),exports2.CROSSHAIR_HIGHLIGHT_COLORS=CROSSHAIR_HIGHLIGHT_COLORS,exports2.DisableCrosshairHighlightOperation=DisableCrosshairHighlightOperation,exports2.EnableCrosshairHighlightOperation=EnableCrosshairHighlightOperation,exports2.SetCrosshairHighlightColorOperation=SetCrosshairHighlightColorOperation,exports2.ToggleCrosshairHighlightOperation=ToggleCrosshairHighlightOperation,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
1
+ function _0x1f73(_0xe5326d,_0xe13e07){const _0x174bae=_0x174b();return _0x1f73=function(_0x1f7316,_0x31a9cd){_0x1f7316=_0x1f7316-0xb1;let _0x4c5138=_0x174bae[_0x1f7316];return _0x4c5138;},_0x1f73(_0xe5326d,_0xe13e07);}(function(_0x28081b,_0x480860){const _0x4da3e7=_0x1f73,_0x420264=_0x28081b();while(!![]){try{const _0x32120e=-parseInt(_0x4da3e7(0x197))/0x1+-parseInt(_0x4da3e7(0x144))/0x2+parseInt(_0x4da3e7(0xf6))/0x3+parseInt(_0x4da3e7(0xdd))/0x4*(parseInt(_0x4da3e7(0x154))/0x5)+-parseInt(_0x4da3e7(0x132))/0x6+-parseInt(_0x4da3e7(0x185))/0x7+parseInt(_0x4da3e7(0xe9))/0x8*(parseInt(_0x4da3e7(0x166))/0x9);if(_0x32120e===_0x480860)break;else _0x420264['push'](_0x420264['shift']());}catch(_0x3c10c2){_0x420264['push'](_0x420264['shift']());}}}(_0x174b,0xf1b03),function(_0x21c86,_0x54008b){const _0x1aaa75=_0x1f73;typeof exports=='object'&&typeof module<'u'?_0x54008b(exports,require(_0x1aaa75(0x168)),require(_0x1aaa75(0xfd)),require(_0x1aaa75(0xd2)),require(_0x1aaa75(0x102)),require(_0x1aaa75(0x162)),require(_0x1aaa75(0xee)),require('@univerjs/sheets-ui'),require(_0x1aaa75(0xca))):typeof define==_0x1aaa75(0x167)&&define[_0x1aaa75(0x14e)]?define([_0x1aaa75(0x10c),_0x1aaa75(0x168),_0x1aaa75(0xfd),_0x1aaa75(0xd2),_0x1aaa75(0x102),'react','clsx',_0x1aaa75(0x18e),_0x1aaa75(0xca)],_0x54008b):(_0x21c86=typeof globalThis<'u'?globalThis:_0x21c86||self,_0x54008b(_0x21c86[_0x1aaa75(0x153)]={},_0x21c86[_0x1aaa75(0x17d)],_0x21c86[_0x1aaa75(0x18b)],_0x21c86['UniverUi'],_0x21c86[_0x1aaa75(0x102)],_0x21c86[_0x1aaa75(0x10a)],_0x21c86[_0x1aaa75(0xee)],_0x21c86[_0x1aaa75(0x16f)],_0x21c86[_0x1aaa75(0x137)]));}(this,function(_0x54e77e,_0x492337,_0x142b11,_0x296a1d,_0x5875d1,_0x1e8769,_0x5abcb6,_0x2a1f77,_0x285c8a){'use strict';const _0x1041fa=_0x1f73;var _0x309873=Object[_0x1041fa(0x15d)],_0xdb1a8e=(_0x22c591,_0x529fd3,_0x332406)=>_0x529fd3 in _0x22c591?_0x309873(_0x22c591,_0x529fd3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x332406}):_0x22c591[_0x529fd3]=_0x332406,_0x2cb1d0=(_0x10d188,_0x308270)=>_0x309873(_0x10d188,_0x1041fa(0xb9),{'value':_0x308270,'configurable':!0x0}),_0x590615=(_0x1c84a0,_0x5da828,_0x19f95d)=>_0xdb1a8e(_0x1c84a0,typeof _0x5da828!=_0x1041fa(0xc3)?_0x5da828+'':_0x5da828,_0x19f95d),_0x285ed8,_0x1c5bf0,_0x248248,_0x317484=function(){const _0xebf279=_0x1041fa;return _0x317484=Object[_0xebf279(0x120)]||function(_0x16890d){const _0x5440be=_0xebf279;for(var _0x3a0545,_0x517c07=0x1,_0x3c9898=arguments[_0x5440be(0x182)];_0x517c07<_0x3c9898;_0x517c07++){_0x3a0545=arguments[_0x517c07];for(var _0x118c1c in _0x3a0545)Object[_0x5440be(0xd8)]['hasOwnProperty'][_0x5440be(0xf7)](_0x3a0545,_0x118c1c)&&(_0x16890d[_0x118c1c]=_0x3a0545[_0x118c1c]);}return _0x16890d;},_0x317484[_0xebf279(0x186)](this,arguments);},_0x46b523=function(_0x31617e,_0xfe1016){const _0x28bf80=_0x1041fa;var _0x324213={};for(var _0x294b25 in _0x31617e)Object[_0x28bf80(0xd8)]['hasOwnProperty'][_0x28bf80(0xf7)](_0x31617e,_0x294b25)&&_0xfe1016['indexOf'](_0x294b25)<0x0&&(_0x324213[_0x294b25]=_0x31617e[_0x294b25]);if(_0x31617e!=null&&typeof Object['getOwnPropertySymbols']=='function'){for(var _0x29fff9=0x0,_0x294b25=Object[_0x28bf80(0x149)](_0x31617e);_0x29fff9<_0x294b25[_0x28bf80(0x182)];_0x29fff9++)_0xfe1016['indexOf'](_0x294b25[_0x29fff9])<0x0&&Object[_0x28bf80(0xd8)][_0x28bf80(0x136)][_0x28bf80(0xf7)](_0x31617e,_0x294b25[_0x29fff9])&&(_0x324213[_0x294b25[_0x29fff9]]=_0x31617e[_0x294b25[_0x29fff9]]);}return _0x324213;},_0x498158=_0x1e8769[_0x1041fa(0x1a3)](function(_0x310c20,_0x10493d){const _0x16cfed=_0x1041fa;var _0x84dcee=_0x310c20['icon'],_0x3004bb=_0x310c20['id'],_0x4e8237=_0x310c20[_0x16cfed(0x179)],_0x57c705=_0x310c20[_0x16cfed(0x19b)],_0x29eead=_0x46b523(_0x310c20,[_0x16cfed(0xb6),'id',_0x16cfed(0x179),_0x16cfed(0x19b)]),_0x372523=_0x16cfed(0x147)['concat'](_0x3004bb,'\x20')[_0x16cfed(0xb7)](_0x4e8237||'')[_0x16cfed(0x16c)](),_0x2fefb1=_0x1e8769[_0x16cfed(0x17a)]('_'[_0x16cfed(0xb7)](_0x2fa268()));return _0x41b705(_0x84dcee,''[_0x16cfed(0xb7)](_0x3004bb),{'defIds':_0x84dcee[_0x16cfed(0xf2)],'idSuffix':_0x2fefb1[_0x16cfed(0x17f)]},_0x317484({'ref':_0x10493d,'className':_0x372523},_0x29eead),_0x57c705);});function _0x41b705(_0x2b45ae,_0x226b8e,_0x207d05,_0x156033,_0x1cda77){const _0x1269a8=_0x1041fa;return _0x1e8769[_0x1269a8(0x169)](_0x2b45ae[_0x1269a8(0x11f)],_0x317484(_0x317484({'key':_0x226b8e},_0x24a86d(_0x2b45ae,_0x207d05,_0x1cda77)),_0x156033),(_0x542c6e(_0x2b45ae,_0x207d05)['children']||[])[_0x1269a8(0xbb)](function(_0x470fbe,_0x1bd007){const _0x5dfffd=_0x1269a8;return _0x41b705(_0x470fbe,''[_0x5dfffd(0xb7)](_0x226b8e,'-')[_0x5dfffd(0xb7)](_0x2b45ae[_0x5dfffd(0x11f)],'-')[_0x5dfffd(0xb7)](_0x1bd007),_0x207d05,void 0x0,_0x1cda77);}));}_0x2cb1d0(_0x41b705,_0x1041fa(0xe7));function _0x24a86d(_0x53b9b0,_0x2d8324,_0x48d0cf){const _0x23318c=_0x1041fa;var _0x24b8f2=_0x317484({},_0x53b9b0[_0x23318c(0x199)]);_0x48d0cf!=null&&_0x48d0cf[_0x23318c(0x109)]&&_0x24b8f2[_0x23318c(0x14a)]==='colorChannel1'&&(_0x24b8f2['fill']=_0x48d0cf[_0x23318c(0x109)]);var _0x193f2f=_0x2d8324['defIds'];return!_0x193f2f||_0x193f2f[_0x23318c(0x182)]===0x0||(_0x53b9b0['tag']===_0x23318c(0x13f)&&_0x24b8f2[_0x23318c(0xd4)]&&(_0x24b8f2['xlink:href']=_0x24b8f2[_0x23318c(0xd4)]+_0x2d8324['idSuffix']),Object[_0x23318c(0x11b)](_0x24b8f2)[_0x23318c(0x1a1)](function(_0x1af64b){const _0x212062=_0x23318c;var _0x5cc50d=_0x1af64b[0x0],_0x3a0418=_0x1af64b[0x1];typeof _0x3a0418==_0x212062(0xf1)&&(_0x24b8f2[_0x5cc50d]=_0x3a0418[_0x212062(0x161)](/url\(#(.*)\)/,_0x212062(0x163)[_0x212062(0xb7)](_0x2d8324[_0x212062(0x15e)],')')));})),_0x24b8f2;}_0x2cb1d0(_0x24a86d,_0x1041fa(0x10d));function _0x542c6e(_0x521c1d,_0x2a1774){const _0xcf2c74=_0x1041fa;var _0x21b8f7,_0x6e7021=_0x2a1774[_0xcf2c74(0xf2)];return!_0x6e7021||_0x6e7021[_0xcf2c74(0x182)]===0x0?_0x521c1d:_0x521c1d[_0xcf2c74(0x11f)]===_0xcf2c74(0xc9)&&(!((_0x21b8f7=_0x521c1d[_0xcf2c74(0x124)])===null||_0x21b8f7===void 0x0)&&_0x21b8f7[_0xcf2c74(0x182)])?_0x317484(_0x317484({},_0x521c1d),{'children':_0x521c1d[_0xcf2c74(0x124)][_0xcf2c74(0xbb)](function(_0x410f4b){const _0xdad4c2=_0xcf2c74;return typeof _0x410f4b['attrs']['id']==_0xdad4c2(0xf1)&&_0x6e7021&&_0x6e7021[_0xdad4c2(0x118)](_0x410f4b[_0xdad4c2(0x199)]['id'])>-0x1?_0x317484(_0x317484({},_0x410f4b),{'attrs':_0x317484(_0x317484({},_0x410f4b[_0xdad4c2(0x199)]),{'id':_0x410f4b[_0xdad4c2(0x199)]['id']+_0x2a1774[_0xdad4c2(0x15e)]})}):_0x410f4b;})}):_0x521c1d;}_0x2cb1d0(_0x542c6e,_0x1041fa(0xe0));function _0x2fa268(){const _0x118419=_0x1041fa;return Math[_0x118419(0xcc)]()['toString'](0x24)[_0x118419(0x105)](0x2,0x8);}_0x2cb1d0(_0x2fa268,_0x1041fa(0x192)),_0x498158[_0x1041fa(0xcd)]=_0x1041fa(0x146);var _0x4cfec8={'tag':_0x1041fa(0xb8),'attrs':{'fill':_0x1041fa(0xba),'viewBox':_0x1041fa(0x17b),'width':'1em','height':_0x1041fa(0x151)},'children':[{'tag':_0x1041fa(0xfb),'attrs':{'fill':_0x1041fa(0xe2),'d':_0x1041fa(0xd5)}},{'tag':'path','attrs':{'fill':_0x1041fa(0x13d),'d':_0x1041fa(0xce)}},{'tag':_0x1041fa(0xfb),'attrs':{'fill':_0x1041fa(0xec),'d':_0x1041fa(0x15f),'fillRule':_0x1041fa(0x140),'clipRule':_0x1041fa(0x140)}}]},_0xf41628=_0x1e8769[_0x1041fa(0x1a3)](function(_0x24d310,_0x10cfcf){const _0x46ecff=_0x1041fa;return _0x1e8769['createElement'](_0x498158,Object['assign']({},_0x24d310,{'id':_0x46ecff(0xe1),'ref':_0x10cfcf,'icon':_0x4cfec8}));});_0xf41628['displayName']='CrossHighlightingSingle';const _0x5591cc=[_0x1041fa(0x196),_0x1041fa(0x12c),_0x1041fa(0xbf),'rgba(164,\x20220,\x2022,\x200.3)',_0x1041fa(0xc4),_0x1041fa(0x138),_0x1041fa(0x148),_0x1041fa(0x11e),_0x1041fa(0x11d),_0x1041fa(0xd3),_0x1041fa(0xd0),_0x1041fa(0x129),_0x1041fa(0x18c),_0x1041fa(0xd6),'rgba(242,\x2072,\x20166,\x200.15)','rgba(153,\x20153,\x20153,\x200.15)'],_0x206cba=class _0x1922ce extends _0x492337[_0x1041fa(0x17c)]{constructor(){const _0x277c49=_0x1041fa;super(...arguments),_0x590615(this,_0x277c49(0x188),new _0x5875d1[(_0x277c49(0xc0))](!0x1)),_0x590615(this,_0x277c49(0x103),this['_enabled$']['asObservable']()),_0x590615(this,'_color$',new _0x5875d1[(_0x277c49(0xc0))](_0x5591cc[0x0])),_0x590615(this,_0x277c49(0x112),this[_0x277c49(0x14c)]['asObservable']());}get['enabled'](){const _0x8fddb8=_0x1041fa;return this[_0x8fddb8(0x188)][_0x8fddb8(0x15a)]();}get[_0x1041fa(0x131)](){const _0x5efe33=_0x1041fa;return this[_0x5efe33(0x14c)][_0x5efe33(0x15a)]();}[_0x1041fa(0xf8)](){const _0x21a37b=_0x1041fa;this[_0x21a37b(0x188)][_0x21a37b(0x143)]();}[_0x1041fa(0x128)](_0x2eb4b3){const _0x3ed93d=_0x1041fa;this[_0x3ed93d(0x188)]['next'](_0x2eb4b3);}[_0x1041fa(0x19c)](_0xcd9b8d){const _0x1ff85c=_0x1041fa;this[_0x1ff85c(0x14c)][_0x1ff85c(0x19f)](_0xcd9b8d);}};_0x2cb1d0(_0x206cba,_0x1041fa(0xfc));let _0x4a4117=_0x206cba;const _0x49b6ea={'id':_0x1041fa(0x155),'type':_0x492337[_0x1041fa(0xe4)][_0x1041fa(0x152)],'handler'(_0xa03fbe){const _0x4cc421=_0x1041fa,_0x484965=_0xa03fbe[_0x4cc421(0x187)](_0x4a4117),_0x43f512=_0x484965[_0x4cc421(0x16e)];return _0x484965[_0x4cc421(0x128)](!_0x43f512),!0x0;}},_0x264060={'id':_0x1041fa(0x16a),'type':_0x492337[_0x1041fa(0xe4)]['OPERATION'],'handler'(_0x1567a9,{value:_0x373dbc}){const _0x21dbbc=_0x1041fa,_0x18b8c2=_0x1567a9[_0x21dbbc(0x187)](_0x4a4117);return _0x18b8c2[_0x21dbbc(0x16e)]||_0x18b8c2['setEnabled'](!0x0),_0x18b8c2[_0x21dbbc(0x19c)](_0x373dbc),!0x0;}},_0x4094fc={'id':_0x1041fa(0x135),'type':_0x492337[_0x1041fa(0xe4)][_0x1041fa(0x152)],'handler'(_0xc41c9a){const _0x556bc6=_0x1041fa,_0xec8bf=_0xc41c9a['get'](_0x4a4117);return _0xec8bf[_0x556bc6(0x16e)]?!0x1:(_0xec8bf[_0x556bc6(0x128)](!0x0),!0x0);}},_0x465e2f={'id':'sheet.operation.disable-crosshair-highlight','type':_0x492337['CommandType'][_0x1041fa(0x152)],'handler'(_0x30d685){const _0x4c71e4=_0x1041fa,_0xdd62fc=_0x30d685[_0x4c71e4(0x187)](_0x4a4117);return _0xdd62fc[_0x4c71e4(0x16e)]?(_0xdd62fc[_0x4c71e4(0x128)](!0x1),!0x0):!0x1;}},_0x2962e2={'crosshairHighlightOverlay':'univer-crosshair-highlight-overlay','crosshairHighlightItem':_0x1041fa(0x121),'crosshairHighlightItemSelected':_0x1041fa(0x184)};function _0x5ef1d7(_0x2e1f32){const _0x526a31=_0x1041fa,{onChange:_0x3a568e}=_0x2e1f32,_0x35bbed=_0x492337[_0x526a31(0x117)](_0x4a4117),_0x1ba45e=_0x492337[_0x526a31(0xb5)](_0x35bbed['color$']),_0x2b18e4=_0x1e8769[_0x526a31(0xf3)](_0x5e5a36=>{_0x3a568e==null||_0x3a568e(_0x5e5a36);},[_0x3a568e]);return _0x1e8769['createElement'](_0x526a31(0x11c),{'className':_0x2962e2[_0x526a31(0x107)]},_0x5591cc[_0x526a31(0xbb)](_0x420d23=>_0x1e8769['createElement'](_0x526a31(0x11c),{'key':_0x420d23,'className':_0x5abcb6(_0x2962e2[_0x526a31(0x16b)],{[_0x2962e2[_0x526a31(0xd7)]]:_0x420d23===_0x1ba45e}),'style':{'backgroundColor':_0x420d23},'onClick':_0x2cb1d0(()=>_0x2b18e4(_0x420d23),'onClick')})));}_0x2cb1d0(_0x5ef1d7,_0x1041fa(0xb2));const _0x25274c=_0x1041fa(0x190);function _0x320ad4(_0x270c35){const _0x5b9b73=_0x1041fa,_0x21d1c4=_0x270c35[_0x5b9b73(0x187)](_0x4a4117);return{'id':_0x49b6ea['id'],'tooltip':'crosshair.button.tooltip','type':_0x296a1d[_0x5b9b73(0xdc)][_0x5b9b73(0x111)],'icon':_0x5b9b73(0x180),'selections':[{'label':{'name':_0x25274c,'hoverable':!0x1}}],'selectionsCommandId':_0x264060['id'],'activated$':_0x21d1c4[_0x5b9b73(0x103)],'hidden$':_0x296a1d[_0x5b9b73(0x176)](_0x270c35,_0x492337[_0x5b9b73(0xcf)][_0x5b9b73(0xc1)])};}_0x2cb1d0(_0x320ad4,_0x1041fa(0x126));const _0x2bbd31={[_0x296a1d[_0x1041fa(0x150)]['FOOTER_MENU']]:{[_0x296a1d[_0x1041fa(0x130)][_0x1041fa(0x171)]]:{[_0x49b6ea['id']]:{'order':0x0,'menuItemFactory':_0x320ad4}}}};var _0x15aef5=Object[_0x1041fa(0x15d)],_0x1d9850=Object[_0x1041fa(0x195)],_0x29f6df=_0x2cb1d0((_0x1658fd,_0x40c59c,_0x555ad7,_0x4d6535)=>{const _0x408eff=_0x1041fa;for(var _0x319ba5=_0x4d6535>0x1?void 0x0:_0x4d6535?_0x1d9850(_0x40c59c,_0x555ad7):_0x40c59c,_0x571bf7=_0x1658fd[_0x408eff(0x182)]-0x1,_0x47f448;_0x571bf7>=0x0;_0x571bf7--)(_0x47f448=_0x1658fd[_0x571bf7])&&(_0x319ba5=(_0x4d6535?_0x47f448(_0x40c59c,_0x555ad7,_0x319ba5):_0x47f448(_0x319ba5))||_0x319ba5);return _0x4d6535&&_0x319ba5&&_0x15aef5(_0x40c59c,_0x555ad7,_0x319ba5),_0x319ba5;},_0x1041fa(0xb1)),_0x413e58=_0x2cb1d0((_0x48bfad,_0x5b2378)=>(_0x2886e5,_0x174784)=>_0x5b2378(_0x2886e5,_0x174784,_0x48bfad),_0x1041fa(0x116));let _0x171a4c=(_0x285ed8=class extends _0x492337[_0x1041fa(0x17c)]{constructor(_0x36598d,_0x139c00,_0x38da1c){const _0x4447ed=_0x1041fa;super(),this[_0x4447ed(0x123)]=_0x36598d,this['_menuManagerService']=_0x139c00,this['_cmdSrv']=_0x38da1c,this[_0x4447ed(0x159)](),this[_0x4447ed(0xc2)](),this[_0x4447ed(0x19a)]();}['_initCommands'](){const _0xaa6465=_0x1041fa;[_0x49b6ea,_0x264060,_0x4094fc,_0x465e2f][_0xaa6465(0x1a1)](_0xb446f4=>this[_0xaa6465(0x101)][_0xaa6465(0x119)](_0xb446f4));}[_0x1041fa(0xc2)](){const _0x5afc65=_0x1041fa;this[_0x5afc65(0x10b)][_0x5afc65(0xcb)](_0x2bbd31);}[_0x1041fa(0x19a)](){const _0x17c499=_0x1041fa;this[_0x17c499(0x123)][_0x17c499(0x13e)](_0x25274c,_0x5ef1d7),this['_componentMgr'][_0x17c499(0x13e)](_0x17c499(0x180),_0xf41628);}},_0x2cb1d0(_0x285ed8,_0x1041fa(0xc5)),_0x285ed8);_0x171a4c=_0x29f6df([_0x413e58(0x0,_0x492337[_0x1041fa(0xe5)](_0x296a1d['ComponentManager'])),_0x413e58(0x1,_0x296a1d['IMenuManagerService']),_0x413e58(0x2,_0x492337['ICommandService'])],_0x171a4c);const _0x505a76=0x1,_0x50b762=class _0x3f1cfd{constructor(){const _0x2ba956=_0x1041fa;_0x590615(this,_0x2ba956(0xdb),[]),_0x590615(this,'_ranges',[]);}[_0x1041fa(0x113)](_0x562f8c){const _0x4f4afa=_0x1041fa;if(_0x562f8c[_0x4f4afa(0xd1)]===_0x492337[_0x4f4afa(0x198)]['COLUMN']||_0x562f8c[_0x4f4afa(0xd1)]===_0x492337[_0x4f4afa(0x198)][_0x4f4afa(0x164)]||_0x562f8c[_0x4f4afa(0xd1)]===_0x492337[_0x4f4afa(0x198)][_0x4f4afa(0x170)])return;const _0x17feaa=this[_0x4f4afa(0x181)](_0x562f8c),_0xbb6939=this[_0x4f4afa(0xb4)](_0x562f8c,_0x17feaa);_0xbb6939[_0x4f4afa(0x182)]>0x0&&this[_0x4f4afa(0x173)]['push'](..._0xbb6939);}['setSelectedRanges'](_0x20fad5){const _0x4251d8=_0x1041fa;this[_0x4251d8(0xdb)]=_0x20fad5;}[_0x1041fa(0xb4)](_0xa21964,_0x2f4804){const _0x4ac1b4=_0x1041fa;let _0x41b51c=[_0xa21964];for(const _0x50e1b1 of _0x2f4804[_0x4ac1b4(0xb7)](this[_0x4ac1b4(0xdb)])){const _0x400686=[];for(const _0x1bb984 of _0x41b51c){const _0x2cb603=_0x492337[_0x4ac1b4(0x156)][_0x4ac1b4(0x14b)](_0x1bb984,_0x50e1b1);_0x2cb603&&_0x2cb603[_0x4ac1b4(0x182)]>0x0&&_0x400686[_0x4ac1b4(0xef)](..._0x2cb603);}_0x41b51c=_0x400686;}return _0x41b51c['filter'](_0x40e31b=>_0x40e31b[_0x4ac1b4(0xbe)]<=_0x40e31b[_0x4ac1b4(0x15c)]&&_0x40e31b[_0x4ac1b4(0x172)]<=_0x40e31b[_0x4ac1b4(0xf4)]);}[_0x1041fa(0x181)](_0x4407b2){const _0x1e7f44=_0x1041fa,_0x562351=[];for(const _0x3d9023 of this[_0x1e7f44(0x173)]){const _0x477443=_0x492337[_0x1e7f44(0x156)]['getIntersects'](_0x3d9023,_0x4407b2);_0x477443&&_0x562351[_0x1e7f44(0xef)](_0x477443);}return _0x562351;}[_0x1041fa(0x157)](){const _0x485edf=_0x1041fa;return this[_0x485edf(0x173)];}[_0x1041fa(0x12a)](){const _0x14b38b=_0x1041fa;this[_0x14b38b(0x173)]=[],this['_selectedRanges']=[];}};_0x2cb1d0(_0x50b762,_0x1041fa(0x18f));let _0x119b6d=_0x50b762;const _0x59d0b5=class _0x2868f9 extends _0x142b11[_0x1041fa(0xdf)]{constructor(_0xd67666,_0x2b0135){const _0x157059=_0x1041fa;super(_0xd67666,_0x2b0135),_0x590615(this,_0x157059(0xfa)),_0x2b0135&&this[_0x157059(0xe8)](_0x2b0135);}[_0x1041fa(0xe8)](_0x5c4ec2){const _0x464ef0=_0x1041fa;typeof _0x5c4ec2[_0x464ef0(0x131)]<'u'&&(this['_color']=_0x5c4ec2['color']),this[_0x464ef0(0x165)]({'width':_0x5c4ec2['width'],'height':_0x5c4ec2[_0x464ef0(0x1a0)]});}[_0x1041fa(0x14f)](_0x1fe80e){const _0x34cab0=_0x1041fa,_0x569304=_0x34cab0(0xea)+this[_0x34cab0(0xfa)]['r']+',\x20'+this['_color']['g']+',\x20'+this[_0x34cab0(0xfa)]['b']+',\x20'+this['_color']['a']+')';_0x142b11['Rect'][_0x34cab0(0x14d)](_0x1fe80e,{'width':this[_0x34cab0(0xc7)],'height':this[_0x34cab0(0x1a0)],'fill':_0x569304,'stroke':void 0x0,'strokeWidth':0x0,'evented':!0x1});}};_0x2cb1d0(_0x59d0b5,_0x1041fa(0x12e));let _0x1b19ae=_0x59d0b5;var _0x397ead=Object[_0x1041fa(0x15d)],_0x549dee=Object[_0x1041fa(0x195)],_0x209c5b=_0x2cb1d0((_0x529500,_0x5acf7b,_0x5089fd,_0x22b111)=>{const _0x52e23b=_0x1041fa;for(var _0x224084=_0x22b111>0x1?void 0x0:_0x22b111?_0x549dee(_0x5acf7b,_0x5089fd):_0x5acf7b,_0x522bb0=_0x529500[_0x52e23b(0x182)]-0x1,_0x3e68c5;_0x522bb0>=0x0;_0x522bb0--)(_0x3e68c5=_0x529500[_0x522bb0])&&(_0x224084=(_0x22b111?_0x3e68c5(_0x5acf7b,_0x5089fd,_0x224084):_0x3e68c5(_0x224084))||_0x224084);return _0x22b111&&_0x224084&&_0x397ead(_0x5acf7b,_0x5089fd,_0x224084),_0x224084;},'__decorateClass$1'),_0x383787=_0x2cb1d0((_0x55f8f0,_0xf7456f)=>(_0x3fae6c,_0x301e8e)=>_0xf7456f(_0x3fae6c,_0x301e8e,_0x55f8f0),'__decorateParam$1');let _0x668831=(_0x1c5bf0=class extends _0x492337[_0x1041fa(0x17c)]{constructor(_0x36890d,_0x330653,_0x27c419,_0x327a2f,_0x25e635,_0x21d332){const _0x2cf22b=_0x1041fa;super(),_0x590615(this,_0x2cf22b(0x19d),[]),_0x590615(this,_0x2cf22b(0x158),new _0x119b6d()),_0x590615(this,'_color','rgba(255,0,0,0.5)'),(this[_0x2cf22b(0x100)]=_0x36890d,this[_0x2cf22b(0xde)]=_0x330653,this['_sheetsSelectionsService']=_0x27c419,this[_0x2cf22b(0x142)]=_0x327a2f,this[_0x2cf22b(0x13a)]=_0x25e635,this[_0x2cf22b(0x115)]=_0x21d332,this[_0x2cf22b(0x122)]());}[_0x1041fa(0xc8)](_0x46aa36,_0x45665c){const _0x503e37=_0x1041fa;if(!_0x46aa36)return;const _0x2b76f2=_0x45665c[_0x503e37(0xbc)](),_0x2b6228=_0x45665c[_0x503e37(0x13c)](),_0xab0e2f=[];for(const _0x3b74de of _0x46aa36){const {startRow:_0x5f570f,endRow:_0x447dc5,startColumn:_0x400f61,endColumn:_0x1026a9}=_0x3b74de[_0x503e37(0x16d)];_0x447dc5-_0x5f570f+0x1===_0x2b76f2||_0x1026a9-_0x400f61+0x1===_0x2b6228||_0xab0e2f['push'](_0x3b74de[_0x503e37(0x16d)]);}this['_rangeCollection'][_0x503e37(0xf9)](_0xab0e2f);for(const _0x4c2191 of _0xab0e2f)this[_0x503e37(0x106)](_0x4c2191,_0x45665c);}[_0x1041fa(0x122)](){const _0x16fa9a=_0x1041fa,_0x15fa31=this[_0x16fa9a(0x100)][_0x16fa9a(0x127)];this[_0x16fa9a(0xf0)](_0x5875d1['combineLatest']([this[_0x16fa9a(0x13a)][_0x16fa9a(0x13b)](_0x285c8a[_0x16fa9a(0x18a)])[_0x16fa9a(0xed)](_0x5875d1[_0x16fa9a(0xff)](!0x1)),this[_0x16fa9a(0xde)][_0x16fa9a(0xfe)],this['_sheetsCrosshairHighlightService'][_0x16fa9a(0x103)],this[_0x16fa9a(0x142)][_0x16fa9a(0x112)][_0x16fa9a(0xed)](_0x5875d1[_0x16fa9a(0x177)](_0x3814b4=>this[_0x16fa9a(0xfa)]=_0x3814b4)),_0x5875d1['merge'](this[_0x16fa9a(0x12d)][_0x16fa9a(0xd9)],this[_0x16fa9a(0x12d)]['selectionMoving$'],this[_0x16fa9a(0x12d)][_0x16fa9a(0x175)],_0x15fa31['activeSheet$'][_0x16fa9a(0xed)](_0x5875d1[_0x16fa9a(0xbb)](()=>this[_0x16fa9a(0x12d)][_0x16fa9a(0x17e)]()))),_0x5875d1[_0x16fa9a(0x108)](this[_0x16fa9a(0x115)]['selectionMoveStart$'],this[_0x16fa9a(0x115)][_0x16fa9a(0x139)],this[_0x16fa9a(0x115)][_0x16fa9a(0x175)],_0x15fa31['activeSheet$'][_0x16fa9a(0xed)](_0x5875d1[_0x16fa9a(0xbb)](()=>this['_refSelectionsService'][_0x16fa9a(0x17e)]())))])[_0x16fa9a(0xb3)](([_0x1ce0d8,_0x58c1f3,_0x5439c1,_0x2f8cfa,_0x364ecf,_0x4c3e7e])=>{const _0xea3502=_0x16fa9a;if(this['_clear'](),!_0x5439c1)return;const _0x5f0650=_0x1ce0d8?_0x4c3e7e:_0x364ecf;this[_0xea3502(0x158)][_0xea3502(0x12a)](),this['_transformSelection'](_0x5f0650,_0x15fa31[_0xea3502(0x104)]()),this[_0xea3502(0xe7)](this[_0xea3502(0x158)][_0xea3502(0x157)]());}));}[_0x1041fa(0x106)](_0x34ed04,_0x59226f){const _0xc4a3f6=_0x1041fa;if(_0x34ed04[_0xc4a3f6(0xd1)]===_0x492337[_0xc4a3f6(0x198)][_0xc4a3f6(0x12b)]||_0x34ed04['rangeType']===_0x492337[_0xc4a3f6(0x198)]['ROW']||_0x34ed04[_0xc4a3f6(0xd1)]===_0x492337[_0xc4a3f6(0x198)][_0xc4a3f6(0x170)])return;const _0x2bbc7e=_0x59226f[_0xc4a3f6(0xbc)](),_0xb40283=_0x59226f[_0xc4a3f6(0x13c)](),{startRow:_0x3e1add,endRow:_0x37b2b4,startColumn:_0x188a67,endColumn:_0x43edb1}=_0x34ed04,_0x582912={'startRow':_0x3e1add,'endRow':_0x37b2b4,'startColumn':0x0,'endColumn':_0x188a67-0x1},_0x4270a1={'startRow':_0x3e1add,'endRow':_0x37b2b4,'startColumn':_0x43edb1+0x1,'endColumn':_0xb40283},_0x53cbf3={'startRow':0x0,'endRow':_0x3e1add-0x1,'startColumn':_0x188a67,'endColumn':_0x43edb1},_0x32971a={'startRow':_0x37b2b4+0x1,'endRow':_0x2bbc7e,'startColumn':_0x188a67,'endColumn':_0x43edb1};for(const _0x3a6999 of[_0x582912,_0x4270a1,_0x53cbf3,_0x32971a])_0x3a6999['startRow']<=_0x3a6999[_0xc4a3f6(0x15c)]&&_0x3a6999[_0xc4a3f6(0x172)]<=_0x3a6999[_0xc4a3f6(0xf4)]&&this[_0xc4a3f6(0x158)][_0xc4a3f6(0x113)](_0x3a6999);}[_0x1041fa(0x10f)](){const _0x5621f8=_0x1041fa;this[_0x5621f8(0x19d)][_0x5621f8(0x1a1)](_0x3b040f=>{const _0x1db11b=_0x5621f8;_0x3b040f[_0x1db11b(0xf8)]();}),this['_shapes']=[];}[_0x1041fa(0x191)](_0x1e5d99,_0x70db81,_0xa11f71,_0x4139a3){const _0x3d5f1e=_0x1041fa,{startRow:_0x1562ee,endRow:_0x16dd84,startColumn:_0x16c609,endColumn:_0x325387}=_0x1e5d99,_0x3777ce=_0x2a1f77[_0x3d5f1e(0x189)](_0x1562ee,_0x16c609,_0xa11f71,_0x4139a3),_0x1d8fc3=_0x2a1f77['getCoordByCell'](_0x16dd84,_0x325387,_0xa11f71,_0x4139a3),{startX:_0x434214,startY:_0x411f26}=_0x3777ce,{endX:_0x2c87cd,endY:_0x54123f}=_0x1d8fc3,_0x4b0b86=_0x2c87cd-_0x434214,_0x4f410e=_0x54123f-_0x411f26,_0x6471f4={'left':_0x434214,'top':_0x411f26,'color':new _0x492337[(_0x3d5f1e(0x134))](this[_0x3d5f1e(0xfa)])[_0x3d5f1e(0xe3)](),'width':_0x4b0b86,'height':_0x4f410e,'zIndex':_0x505a76,'evented':!0x1},_0x5d40b6=new _0x1b19ae(_0x3d5f1e(0x125)+_0x70db81,_0x6471f4);this[_0x3d5f1e(0x19d)][_0x3d5f1e(0xef)](_0x5d40b6),_0xa11f71['addObject'](_0x5d40b6);}[_0x1041fa(0xe7)](_0x48083d){const _0x9f8bb0=_0x1041fa,_0x3f36cf=this[_0x9f8bb0(0xde)][_0x9f8bb0(0x110)]();if(!_0x3f36cf)return;const {scene:_0x5eb562}=this['_context'];this[_0x9f8bb0(0x10f)]();for(let _0x11ade0=0x0;_0x11ade0<_0x48083d[_0x9f8bb0(0x182)];_0x11ade0++){const _0x453b02=_0x48083d[_0x11ade0];this[_0x9f8bb0(0x191)](_0x453b02,_0x11ade0,_0x5eb562,_0x3f36cf);}_0x5eb562[_0x9f8bb0(0xe6)](!0x0);}async[_0x1041fa(0xf8)](){super['dispose']();}},_0x2cb1d0(_0x1c5bf0,_0x1041fa(0x133)),_0x1c5bf0);_0x668831=_0x209c5b([_0x383787(0x1,_0x492337['Inject'](_0x2a1f77[_0x1041fa(0x160)])),_0x383787(0x2,_0x492337[_0x1041fa(0xe5)](_0x285c8a['SheetsSelectionsService'])),_0x383787(0x3,_0x492337[_0x1041fa(0xe5)](_0x4a4117)),_0x383787(0x4,_0x492337[_0x1041fa(0xe5)](_0x492337[_0x1041fa(0x178)])),_0x383787(0x5,_0x285c8a[_0x1041fa(0xeb)])],_0x668831);const _0x37ce45=_0x1041fa(0x174),_0x2dab26={};var _0x1d6ebd=Object[_0x1041fa(0x15d)],_0x1bb95d=Object['getOwnPropertyDescriptor'],_0x2398bb=_0x2cb1d0((_0x4f0060,_0x54f56d,_0x234afd,_0x508e2e)=>{const _0x4f15a0=_0x1041fa;for(var _0x2c5d4f=_0x508e2e>0x1?void 0x0:_0x508e2e?_0x1bb95d(_0x54f56d,_0x234afd):_0x54f56d,_0x651d28=_0x4f0060[_0x4f15a0(0x182)]-0x1,_0x5e617c;_0x651d28>=0x0;_0x651d28--)(_0x5e617c=_0x4f0060[_0x651d28])&&(_0x2c5d4f=(_0x508e2e?_0x5e617c(_0x54f56d,_0x234afd,_0x2c5d4f):_0x5e617c(_0x2c5d4f))||_0x2c5d4f);return _0x508e2e&&_0x2c5d4f&&_0x1d6ebd(_0x54f56d,_0x234afd,_0x2c5d4f),_0x2c5d4f;},_0x1041fa(0x10e)),_0x1667f0=_0x2cb1d0((_0x2f2624,_0x37ba51)=>(_0x3bb6e1,_0x276757)=>_0x37ba51(_0x3bb6e1,_0x276757,_0x2f2624),_0x1041fa(0x183));_0x54e77e['UniverSheetsCrosshairHighlightPlugin']=(_0x248248=class extends _0x492337['Plugin']{constructor(_0x5556c2=_0x2dab26,_0x481480,_0x578555,_0x41dd05){const _0x1a7a5e=_0x1041fa;super(),this[_0x1a7a5e(0x194)]=_0x5556c2,this[_0x1a7a5e(0xf5)]=_0x481480,this[_0x1a7a5e(0x193)]=_0x578555,this[_0x1a7a5e(0x15b)]=_0x41dd05;const {..._0x1a0f53}=this['_config'];this[_0x1a7a5e(0x15b)]['setConfig'](_0x37ce45,_0x1a0f53);}[_0x1041fa(0x18d)](){[[_0x4a4117],[_0x171a4c]]['forEach'](_0x10a606=>this['_injector']['add'](_0x10a606));}['onReady'](){const _0x36c912=_0x1041fa;[[_0x668831]]['forEach'](_0x29c656=>this[_0x36c912(0xf5)][_0x36c912(0x1a2)](_0x29c656)),this[_0x36c912(0xf5)][_0x36c912(0x187)](_0x171a4c),this[_0x36c912(0x193)][_0x36c912(0xc6)](_0x492337[_0x36c912(0xcf)]['UNIVER_SHEET'],[_0x668831]);}},_0x2cb1d0(_0x248248,_0x1041fa(0x145)),_0x590615(_0x248248,_0x1041fa(0x141),'SHEET_CROSSHAIR_HIGHLIGHT_PLUGIN'),_0x590615(_0x248248,'type',_0x492337['UniverInstanceType'][_0x1041fa(0xc1)]),_0x248248),_0x54e77e['UniverSheetsCrosshairHighlightPlugin']=_0x2398bb([_0x1667f0(0x1,_0x492337[_0x1041fa(0xe5)](_0x492337[_0x1041fa(0xda)])),_0x1667f0(0x2,_0x142b11['IRenderManagerService']),_0x1667f0(0x3,_0x492337[_0x1041fa(0x19e)])],_0x54e77e[_0x1041fa(0x145)]),_0x54e77e[_0x1041fa(0xbd)]=_0x5591cc,_0x54e77e['DisableCrosshairHighlightOperation']=_0x465e2f,_0x54e77e[_0x1041fa(0x12f)]=_0x4094fc,_0x54e77e['SetCrosshairHighlightColorOperation']=_0x264060,_0x54e77e['ToggleCrosshairHighlightOperation']=_0x49b6ea,Object[_0x1041fa(0x15d)](_0x54e77e,Symbol[_0x1041fa(0x114)],{'value':_0x1041fa(0x11a)});}));function _0x174b(){const _0x59b97b=['width','_transformSelection','defs','@univerjs/sheets','mergeMenu','random','displayName','M9.9998\x201.65002H5.9998V6H1.6499V10H5.9998V14.35H9.9998V10H14.3499V6H9.9998V1.65002Z','UniverInstanceType','rgba(255,\x20140,\x2081,\x200.15)','rangeType','@univerjs/ui','rgba(254,\x2075,\x2075,\x200.15)','xlink:href','M1.6499\x203.65002C1.6499\x202.54545\x202.54533\x201.65002\x203.6499\x201.65002H12.3499C13.4545\x201.65002\x2014.3499\x202.54545\x2014.3499\x203.65002V12.35C14.3499\x2013.4546\x2013.4545\x2014.35\x2012.3499\x2014.35H3.6499C2.54533\x2014.35\x201.6499\x2013.4546\x201.6499\x2012.35V3.65002Z','rgba(58,\x2096,\x20247,\x200.15)','crosshairHighlightItemSelected','prototype','selectionMoveStart$','Injector','_selectedRanges','MenuItemType','2244JRWiDD','_sheetSkeletonManagerService','Shape','replaceRuntimeIdsInDefs','cross-highlighting-single','#E5E5E5','toRgb','CommandType','Inject','makeDirty','render','setShapeProps','3976KvNZII','rgba(','IRefSelectionsService','currentColor','pipe','clsx','push','disposeWithMe','string','defIds','useCallback','endColumn','_injector','1957110MZNhiL','call','dispose','setSelectedRanges','_color','path','SheetsCrosshairHighlightService','@univerjs/engine-render','currentSkeleton$','startWith','_context','_cmdSrv','rxjs','enabled$','getActiveSheet','substring','addSelection','crosshairHighlightOverlay','merge','colorChannel1','React','_menuManagerService','exports','replaceRuntimeIdsAndExtInAttrs','__decorateClass','_clear','getCurrentSkeleton','BUTTON_SELECTOR','color$','addRange','toStringTag','_refSelectionsService','__decorateParam$2','useDependency','indexOf','registerCommand','Module','entries','div','rgba(158,\x20109,\x20227,\x200.15)','rgba(153,\x20153,\x20153,\x200.3)','tag','assign','univer-crosshair-highlight-item','_initRenderListener','_componentMgr','children','crosshair-','CrosshairHighlightMenuItemFactory','unit','setEnabled','rgba(164,\x20220,\x2022,\x200.15)','reset','COLUMN','rgba(254,\x2075,\x2075,\x200.3)','_sheetsSelectionsService','SheetCrossHairHighlightShape','EnableCrosshairHighlightOperation','ContextMenuGroup','color','3822324EjHkTR','SheetCrosshairHighlightRenderController','ColorKit','sheet.operation.enable-crosshair-highlight','propertyIsEnumerable','UniverSheets','rgba(58,\x2096,\x20247,\x200.3)','selectionMoving$','_contextService','subscribeContextValue$','getColumnCount','#fff','register','use','evenodd','pluginName','_sheetsCrosshairHighlightService','complete','1564618jMfPLK','UniverSheetsCrosshairHighlightPlugin','UniverIcon','univerjs-icon\x20univerjs-icon-','rgba(242,\x2072,\x20166,\x200.3)','getOwnPropertySymbols','fill','subtract','_color$','drawWith','amd','_draw','ContextMenuPosition','1em','OPERATION','UniverSheetsCrosshairHighlight','8710oZBYbV','sheet.operation.toggle-crosshair-highlight','Rectangle','getRanges','_rangeCollection','_initCommands','getValue','_configService','endRow','defineProperty','idSuffix','M3.6498\x201.05005C2.21386\x201.05005\x201.0498\x202.21411\x201.0498\x203.65005V12.35C1.0498\x2013.786\x202.21386\x2014.95\x203.6498\x2014.95H12.3498C13.7857\x2014.95\x2014.9498\x2013.786\x2014.9498\x2012.3501V3.65005C14.9498\x202.21411\x2013.7857\x201.05005\x2012.3498\x201.05005H3.6498ZM5.4002\x202.25005H3.6498C2.87661\x202.25005\x202.2498\x202.87685\x202.2498\x203.65005V5.40002H5.4002V2.25005ZM2.2498\x2010.6V12.35C2.2498\x2013.1232\x202.87661\x2013.75\x203.6498\x2013.75H5.4002V10.6H2.2498ZM6.60019\x2013.75H9.4002V9.40002H13.7498V6.60002H9.4002V2.25005H6.60019V6.60002H2.25029V9.40002H6.60019V13.75ZM10.6002\x202.25005V5.40002H13.7498V3.65005C13.7498\x202.87685\x2013.123\x202.25005\x2012.3498\x202.25005H10.6002ZM13.7498\x2010.6H10.6002V13.75H12.3498C13.123\x2013.75\x2013.7498\x2013.1232\x2013.7498\x2012.3501V10.6Z','SheetSkeletonManagerService','replace','react','url(#$1','ROW','transformByState','77229cmgUVC','function','@univerjs/core','createElement','sheet.operation.set-crosshair-highlight-color','crosshairHighlightItem','trim','range','enabled','UniverSheetsUi','ALL','OTHERS','startColumn','_ranges','sheets-crosshair-highlight.config','selectionMoveEnd$','getMenuHiddenObservable','tap','IContextService','className','useRef','0\x200\x2016\x2016','Disposable','UniverCore','getCurrentSelections','current','CrossHighlightingSingle','_getIntersects','length','__decorateParam','univer-crosshair-highlight-item-selected','11687585hlIaYh','apply','get','_enabled$','getCoordByCell','DISABLE_NORMAL_SELECTIONS','UniverEngineRender','rgba(45,\x20174,\x20255,\x200.15)','onStarting','@univerjs/sheets-ui','CrossHairRangeCollection','CROSSHAIR_HIGHLIGHT_OVERLAY_COMPONENT','_addShapes','generateShortUuid','_renderManagerService','_config','getOwnPropertyDescriptor','rgba(158,\x20109,\x20227,\x200.3)','1815416BEsYwu','RANGE_TYPE','attrs','_initComponents','extend','setColor','_shapes','IConfigService','next','height','forEach','add','forwardRef','__decorateClass$2','CrosshairOverlay','subscribe','_getSplitRanges','useObservable','icon','concat','svg','name','none','map','getRowCount','CROSSHAIR_HIGHLIGHT_COLORS','startRow','rgba(255,\x20140,\x2081,\x200.3)','BehaviorSubject','UNIVER_SHEET','_initMenus','symbol','rgba(45,\x20174,\x20255,\x200.3)','SheetsCrosshairHighlightController','registerRenderModule'];_0x174b=function(){return _0x59b97b;};return _0x174b();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-crosshair-highlight",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0-nightly.202410101606",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -48,20 +48,20 @@
48
48
  "clsx": ">=2.0.0",
49
49
  "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
50
50
  "rxjs": ">=7.0.0",
51
- "@univerjs/core": "0.3.0-alpha.0",
52
- "@univerjs/engine-render": "0.3.0-alpha.0",
53
- "@univerjs/sheets": "0.3.0-alpha.0",
54
- "@univerjs/ui": "0.3.0-alpha.0",
55
- "@univerjs/sheets-ui": "0.3.0-alpha.0"
51
+ "@univerjs/core": "0.3.0-nightly.202410101606",
52
+ "@univerjs/sheets": "0.3.0-nightly.202410101606",
53
+ "@univerjs/engine-render": "0.3.0-nightly.202410101606",
54
+ "@univerjs/ui": "0.3.0-nightly.202410101606",
55
+ "@univerjs/sheets-ui": "0.3.0-nightly.202410101606"
56
56
  },
57
57
  "dependencies": {
58
58
  "@univerjs/icons": "^0.1.78",
59
59
  "clsx": "^2.1.1",
60
- "@univerjs/core": "0.3.0-alpha.0",
61
- "@univerjs/sheets": "0.3.0-alpha.0",
62
- "@univerjs/sheets-ui": "0.3.0-alpha.0",
63
- "@univerjs/ui": "0.3.0-alpha.0",
64
- "@univerjs/engine-render": "0.3.0-alpha.0"
60
+ "@univerjs/core": "0.3.0-nightly.202410101606",
61
+ "@univerjs/sheets": "0.3.0-nightly.202410101606",
62
+ "@univerjs/engine-render": "0.3.0-nightly.202410101606",
63
+ "@univerjs/sheets-ui": "0.3.0-nightly.202410101606",
64
+ "@univerjs/ui": "0.3.0-nightly.202410101606"
65
65
  },
66
66
  "devDependencies": {
67
67
  "less": "^4.2.0",
@@ -70,7 +70,7 @@
70
70
  "typescript": "^5.6.2",
71
71
  "vite": "^5.4.8",
72
72
  "vitest": "^2.1.1",
73
- "@univerjs-infra/shared": "0.3.0-alpha.0"
73
+ "@univerjs-infra/shared": "0.3.0"
74
74
  },
75
75
  "univerSpace": {
76
76
  ".": {
package/LICENSE DELETED
@@ -1,176 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS