@univerjs-pro/sheets-shape 0.22.0-insiders.20260513-09bbeca → 0.22.1

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/es/facade.js CHANGED
@@ -1 +1 @@
1
- const _0x2064d3=_0x49d7;(function(_0x23aa3d,_0x4979c2){const _0x53c63f=_0x49d7,_0x5435e7=_0x23aa3d();while(!![]){try{const _0x13249d=-parseInt(_0x53c63f(0x11f))/0x1+parseInt(_0x53c63f(0xdf))/0x2+-parseInt(_0x53c63f(0x134))/0x3*(-parseInt(_0x53c63f(0xdb))/0x4)+parseInt(_0x53c63f(0xd3))/0x5*(-parseInt(_0x53c63f(0x10b))/0x6)+-parseInt(_0x53c63f(0xfb))/0x7+-parseInt(_0x53c63f(0x114))/0x8+parseInt(_0x53c63f(0xeb))/0x9;if(_0x13249d===_0x4979c2)break;else _0x5435e7['push'](_0x5435e7['shift']());}catch(_0x50cd61){_0x5435e7['push'](_0x5435e7['shift']());}}}(_0x51fb,0x4ad8e));import{ConnectorCoordinateTransform,ShapeArrowSizeEnum,ShapeArrowTypeEnum,ShapeFillEnum,ShapeGradientTypeEnum,ShapeLineCapEnum,ShapeLineDashEnum,ShapeLineJoinEnum,ShapeLineTypeEnum,ShapeTypeEnum,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{FEnum}from'@univerjs/core/facade';import{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,SetShapeDrawingDataCommand,SheetsShapeService,UpdateConnectorRelationCommand}from'@univerjs-pro/sheets-shape';import{DrawingTypeEnum,generateRandomId}from'@univerjs/core';import{IDrawingManagerService}from'@univerjs/drawing';import{SheetSkeletonService,convertPositionCellToSheetOverGrid}from'@univerjs/sheets';function _0x49d7(_0x2f1116,_0x6a6059){_0x2f1116=_0x2f1116-0xb1;const _0x51fb1e=_0x51fb();let _0x49d75d=_0x51fb1e[_0x2f1116];return _0x49d75d;}import{ISheetDrawingService,RemoveSheetDrawingCommand}from'@univerjs/sheets-drawing';function _0x51fb(){const _0x4433b6=['ShapeFillEnum','toPrimitive','2924640VQoAHm','index','_resolveEndpoints','setNoneFill','setAbsolutePosition','object','lineJoinType','getDrawingData','getEndConnectInfo','capType','ShapeLineCapEnum','382240pqBMqu','colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.','rotation','_resolveExistingOrFreeEndpoint','connectShapes','\x20and\x20subUnitId\x20','setPosition','_commandService','getConnectorLinePoints','entries','shapeData','keys','setStrokeWidth','gradientType','flipX','getConnectionSiteList','stringify','ensureSkeleton','ShapeArrowTypeEnum','opacity','from','1792296kAnmYu','top','\x20not\x20found','setStrokeLineDashType','call','ang','setShapeType','ShapeLineDashEnum','lineType','shapeId','cxnIndex','length','abs','left','defineProperty','width','iterator','setEndArrowSize','getPosition','getAdjustNames','DRAWING_SHAPE','push','getShapeData','setEndArrowType','_preloadShapeProperties','ShapeArrowSizeEnum','getDrawingPoints','Skeleton\x20for\x20unitId\x20','executeCommand','setStartArrowSize','shape','constructor','find','setHeight','getSheetId','transform','subUnitId','getWorkbook','5IRToeT','setStrokeColor','relation','drawId','symbol','getShapeModel','updateShape','localToWorld','4SYkmBf','connectionSiteIndex','SolidFill','getShapeType','67144DkCewm','color','flipY','worldRect','cos','isLineShape','setStrokeLineType','function','getConnectionSites','removeShape','insertShape','getDrawingByParam','9807138rgKydC','GradientFill','stroke','point','endArrow','build','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','setShapeSolidFill','string','getStartConnectInfo','type','_injector','newConnector','unitId','setStrokeOpacity','get','4013681mqiOwZ','getSize','extend','ShapeTypeEnum','ShapeLineJoinEnum','gradientStops','setWidth','setStartArrowType','updateContext','startArrow','ShapeLineTypeEnum','shapeType','parse','fill','prototype','getUnitId','557454XyZfgv','fillType','sin','Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().','setStrokeLineCapType','drawingType','height'];_0x51fb=function(){return _0x4433b6;};return _0x51fb();}import{FWorksheet}from'@univerjs/sheets/facade';var FSheetsShapeEnumMixin=class extends FEnum{get[_0x2064d3(0xfe)](){return ShapeTypeEnum;}get[_0x2064d3(0x112)](){return ShapeFillEnum;}get['ShapeGradientTypeEnum'](){return ShapeGradientTypeEnum;}get[_0x2064d3(0x105)](){return ShapeLineTypeEnum;}get[_0x2064d3(0xb4)](){return ShapeLineDashEnum;}get[_0x2064d3(0x11e)](){return ShapeLineCapEnum;}get[_0x2064d3(0xff)](){return ShapeLineJoinEnum;}get[_0x2064d3(0x131)](){return ShapeArrowTypeEnum;}get[_0x2064d3(0xc6)](){return ShapeArrowSizeEnum;}};FEnum[_0x2064d3(0xfd)](FSheetsShapeEnumMixin);function _typeof(_0x305363){'@babel/helpers - typeof';const _0x1dc0c6=_0x2064d3;return _typeof=_0x1dc0c6(0xe6)==typeof Symbol&&_0x1dc0c6(0xd7)==typeof Symbol[_0x1dc0c6(0xbd)]?function(_0x295236){return typeof _0x295236;}:function(_0x487978){const _0x4503df=_0x1dc0c6;return _0x487978&&'function'==typeof Symbol&&_0x487978[_0x4503df(0xcc)]===Symbol&&_0x487978!==Symbol[_0x4503df(0x109)]?'symbol':typeof _0x487978;},_typeof(_0x305363);}function toPrimitive(_0x2e3d4b,_0x299e43){const _0x2c6428=_0x2064d3;if('object'!=_typeof(_0x2e3d4b)||!_0x2e3d4b)return _0x2e3d4b;var _0x3d8036=_0x2e3d4b[Symbol[_0x2c6428(0x113)]];if(void 0x0!==_0x3d8036){var _0x24e653=_0x3d8036[_0x2c6428(0xb1)](_0x2e3d4b,_0x299e43||'default');if(_0x2c6428(0x119)!=_typeof(_0x24e653))return _0x24e653;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return('string'===_0x299e43?String:Number)(_0x2e3d4b);}function toPropertyKey(_0x495ad1){const _0x7dca40=_0x2064d3;var _0x51ca23=toPrimitive(_0x495ad1,_0x7dca40(0xf3));return'symbol'==_typeof(_0x51ca23)?_0x51ca23:_0x51ca23+'';}function _defineProperty(_0x1a317d,_0x2d0ee4,_0x485f50){const _0x3012a0=_0x2064d3;return(_0x2d0ee4=toPropertyKey(_0x2d0ee4))in _0x1a317d?Object[_0x3012a0(0xbb)](_0x1a317d,_0x2d0ee4,{'value':_0x485f50,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1a317d[_0x2d0ee4]=_0x485f50,_0x1a317d;}var FShape=class{constructor(_0x437fc2,_0x147811,_0x455fbb,_0xe8932f){const _0x5749a1=_0x2064d3;_defineProperty(this,'unitId',void 0x0),_defineProperty(this,'subUnitId',void 0x0),_defineProperty(this,'drawId',void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x5749a1(0xbc),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x5749a1(0x111),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x5749a1(0x106),void 0x0),_defineProperty(this,_0x5749a1(0x129),{}),_defineProperty(this,_0x5749a1(0xf6),void 0x0),this['unitId']=_0x437fc2,this[_0x5749a1(0xd1)]=_0x147811,this[_0x5749a1(0xd6)]=_0x455fbb||generateRandomId(),this[_0x5749a1(0xf6)]=_0xe8932f;}[_0x2064d3(0x125)](_0x2f2cb9,_0x1fcba7,_0x3c7a4f,_0x5bda54){const _0x2a2e1c=_0x2064d3,_0x15a127=this[_0x2a2e1c(0xf6)][_0x2a2e1c(0xfa)](SheetSkeletonService)['ensureSkeleton'](this[_0x2a2e1c(0xf8)],this[_0x2a2e1c(0xd1)]);if(!_0x15a127)throw new Error(_0x2a2e1c(0xc8)+this['unitId']+_0x2a2e1c(0x124)+this[_0x2a2e1c(0xd1)]+_0x2a2e1c(0x136));const {transform:_0x58e6b6}=convertPositionCellToSheetOverGrid(this[_0x2a2e1c(0xf8)],this[_0x2a2e1c(0xd1)],{'row':_0x2f2cb9,'column':_0x1fcba7,'rowOffset':_0x3c7a4f,'columnOffset':_0x5bda54},0x1,0x1,_0x15a127);return this['x']=_0x58e6b6[_0x2a2e1c(0xba)],this['y']=_0x58e6b6[_0x2a2e1c(0x135)],this;}[_0x2064d3(0x118)](_0x53a017,_0x3e828a){return this['x']=_0x53a017,this['y']=_0x3e828a,this;}[_0x2064d3(0xb3)](_0x17056b){const _0x2d6874=_0x2064d3;return this[_0x2d6874(0x106)]=_0x17056b,this;}[_0x2064d3(0xf2)](_0x54734d,_0x5a7e47){const _0x3b996f=_0x2064d3;if(!this['shapeData'][_0x3b996f(0x108)])this[_0x3b996f(0x129)][_0x3b996f(0x108)]={};this['shapeData'][_0x3b996f(0x108)][_0x3b996f(0x10c)]=ShapeFillEnum[_0x3b996f(0xdd)];if(_0x54734d!==void 0x0)this[_0x3b996f(0x129)]['fill'][_0x3b996f(0xe0)]=_0x54734d;if(_0x5a7e47!==void 0x0)this[_0x3b996f(0x129)][_0x3b996f(0x108)][_0x3b996f(0x132)]=_0x5a7e47;return this;}['setShapeGradientFill'](_0xb37c9d,_0x14d8f3,_0x3147b7){const _0x47946f=_0x2064d3;if(_0x14d8f3===void 0x0||_0x14d8f3[_0x47946f(0xb8)]===0x0)throw new Error(_0x47946f(0x120));if(!this[_0x47946f(0x129)][_0x47946f(0x108)])this[_0x47946f(0x129)][_0x47946f(0x108)]={};this[_0x47946f(0x129)][_0x47946f(0x108)][_0x47946f(0x100)]=_0x14d8f3,this[_0x47946f(0x129)][_0x47946f(0x108)][_0x47946f(0x10c)]=ShapeFillEnum[_0x47946f(0xec)],this[_0x47946f(0x129)][_0x47946f(0x108)][_0x47946f(0x12c)]=_0xb37c9d;if(_0x3147b7!==void 0x0)this['shapeData'][_0x47946f(0x108)]['gradientAngle']=_0x3147b7;return this;}[_0x2064d3(0x117)](){const _0x5b7397=_0x2064d3;return this[_0x5b7397(0x129)][_0x5b7397(0x108)]={'fillType':ShapeFillEnum['NoFill']},this;}[_0x2064d3(0xd4)](_0x3428e3){const _0x3be1cc=_0x2064d3;if(!this['shapeData']['stroke'])this[_0x3be1cc(0x129)][_0x3be1cc(0xed)]={};return this[_0x3be1cc(0x129)]['stroke'][_0x3be1cc(0xe0)]=_0x3428e3,this;}[_0x2064d3(0x12b)](_0xf41fc6){const _0x147f6d=_0x2064d3;if(!this[_0x147f6d(0x129)][_0x147f6d(0xed)])this[_0x147f6d(0x129)][_0x147f6d(0xed)]={};return this['shapeData']['stroke'][_0x147f6d(0xbc)]=_0xf41fc6,this;}[_0x2064d3(0x137)](_0x17cd1e){const _0x221f0d=_0x2064d3;if(!this[_0x221f0d(0x129)][_0x221f0d(0xed)])this['shapeData'][_0x221f0d(0xed)]={};return this[_0x221f0d(0x129)][_0x221f0d(0xed)]['dashType']=_0x17cd1e,this;}['setStrokeLineJoinType'](_0x1526ba){const _0x2999ec=_0x2064d3;if(!this['shapeData']['stroke'])this['shapeData'][_0x2999ec(0xed)]={};return this['shapeData'][_0x2999ec(0xed)][_0x2999ec(0x11a)]=_0x1526ba,this;}[_0x2064d3(0x10f)](_0x24e803){const _0x5427f2=_0x2064d3;if(!this[_0x5427f2(0x129)][_0x5427f2(0xed)])this['shapeData'][_0x5427f2(0xed)]={};return this['shapeData']['stroke'][_0x5427f2(0x11d)]=_0x24e803,this;}[_0x2064d3(0xf9)](_0x2487c7){const _0x88bbee=_0x2064d3;if(!this[_0x88bbee(0x129)][_0x88bbee(0xed)])this[_0x88bbee(0x129)][_0x88bbee(0xed)]={};return this[_0x88bbee(0x129)][_0x88bbee(0xed)][_0x88bbee(0x132)]=_0x2487c7,this;}[_0x2064d3(0xe5)](_0x506269){const _0x468e54=_0x2064d3;if(!this[_0x468e54(0x129)][_0x468e54(0xed)])this[_0x468e54(0x129)][_0x468e54(0xed)]={};return this[_0x468e54(0x129)][_0x468e54(0xed)]['lineStrokeType']=_0x506269,this;}[_0x2064d3(0x101)](_0xac96fd){const _0xd09b47=_0x2064d3;return this[_0xd09b47(0xbc)]=_0xac96fd,this;}[_0x2064d3(0xce)](_0x50b7fd){return this['height']=_0x50b7fd,this;}[_0x2064d3(0xe4)](){const _0x49569e=_0x2064d3,_0x50aa80=this[_0x49569e(0xf6)][_0x49569e(0xfa)](SheetsShapeService)['getShapeModel'](this[_0x49569e(0xf8)],this[_0x49569e(0xd1)],this[_0x49569e(0xd6)]);if(_0x50aa80)return isConnectorShape(_0x50aa80[_0x49569e(0xde)]());if(this[_0x49569e(0x106)])return isConnectorShape(this[_0x49569e(0x106)]);return![];}[_0x2064d3(0xe7)](){const _0x392e70=_0x2064d3,_0x1d95dd=this[_0x392e70(0xf6)][_0x392e70(0xfa)](SheetsShapeService)[_0x392e70(0xd8)](this[_0x392e70(0xf8)],this[_0x392e70(0xd1)],this[_0x392e70(0xd6)]);if(!_0x1d95dd)return[];const _0x5ddcc6=this[_0x392e70(0xf6)][_0x392e70(0xfa)](IDrawingManagerService)[_0x392e70(0xea)]({'unitId':this[_0x392e70(0xf8)],'subUnitId':this['subUnitId'],'drawingId':this['drawId']});if(!(_0x5ddcc6===null||_0x5ddcc6===void 0x0?void 0x0:_0x5ddcc6['transform']))return[];const {width:width=0x0,height:height=0x0}=_0x5ddcc6[_0x392e70(0xd0)];return _0x1d95dd[_0x392e70(0x103)]({'width':width,'height':height}),_0x1d95dd[_0x392e70(0x12e)]();}['getAdjustPoints'](){const _0x4ad187=_0x2064d3,_0x1671e5=this[_0x4ad187(0xf6)]['get'](SheetsShapeService)[_0x4ad187(0xd8)](this[_0x4ad187(0xf8)],this[_0x4ad187(0xd1)],this[_0x4ad187(0xd6)]);if(!_0x1671e5)return[];const _0x185874=this[_0x4ad187(0xf6)][_0x4ad187(0xfa)](IDrawingManagerService)[_0x4ad187(0xea)]({'unitId':this[_0x4ad187(0xf8)],'subUnitId':this[_0x4ad187(0xd1)],'drawingId':this[_0x4ad187(0xd6)]});if(!(_0x185874===null||_0x185874===void 0x0?void 0x0:_0x185874[_0x4ad187(0xd0)]))return[];const {width:width=0x0,height:height=0x0}=_0x185874[_0x4ad187(0xd0)];return _0x1671e5[_0x4ad187(0x103)]({'width':width,'height':height}),_0x1671e5[_0x4ad187(0xc7)]();}[_0x2064d3(0x127)](){const _0x5376dd=_0x2064d3,_0x3adb00=this['_injector'][_0x5376dd(0xfa)](SheetsShapeService)[_0x5376dd(0xd8)](this[_0x5376dd(0xf8)],this[_0x5376dd(0xd1)],this[_0x5376dd(0xd6)]);if(!_0x3adb00)return[];if(!isConnectorShape(_0x3adb00['getShapeType']()))return[];const _0x29c422=this['_injector'][_0x5376dd(0xfa)](IDrawingManagerService)[_0x5376dd(0xea)]({'unitId':this['unitId'],'subUnitId':this[_0x5376dd(0xd1)],'drawingId':this[_0x5376dd(0xd6)]});if(!(_0x29c422===null||_0x29c422===void 0x0?void 0x0:_0x29c422[_0x5376dd(0xd0)]))return[];const {width:width=0x0,height:height=0x0}=_0x29c422[_0x5376dd(0xd0)];return _0x3adb00[_0x5376dd(0x103)]({'width':width,'height':height}),_0x3adb00['getConnectorLinePoints']();}[_0x2064d3(0xf4)](){const _0x44debc=_0x2064d3;var _0xc50027;const _0x525fa5=this[_0x44debc(0xf6)]['get'](SheetsShapeService)[_0x44debc(0xd8)](this[_0x44debc(0xf8)],this[_0x44debc(0xd1)],this[_0x44debc(0xd6)]);if(!_0x525fa5)return null;return(_0xc50027=_0x525fa5[_0x44debc(0xf4)]())!==null&&_0xc50027!==void 0x0?_0xc50027:null;}['getEndConnectInfo'](){const _0x5529dc=_0x2064d3;var _0x4cb5ee;const _0xf69dae=this[_0x5529dc(0xf6)][_0x5529dc(0xfa)](SheetsShapeService)[_0x5529dc(0xd8)](this[_0x5529dc(0xf8)],this[_0x5529dc(0xd1)],this[_0x5529dc(0xd6)]);if(!_0xf69dae)return null;return(_0x4cb5ee=_0xf69dae[_0x5529dc(0x11c)]())!==null&&_0x4cb5ee!==void 0x0?_0x4cb5ee:null;}[_0x2064d3(0xf0)](){const _0x1afe2a=_0x2064d3;var _0x3e15ac,_0x48f2a4;if(!this[_0x1afe2a(0x106)])throw new Error(_0x1afe2a(0x10e));if(this['x']===0x0||this['y']===0x0){const _0x18ebce=this['_injector'][_0x1afe2a(0xfa)](SheetSkeletonService)[_0x1afe2a(0x130)](this[_0x1afe2a(0xf8)],this[_0x1afe2a(0xd1)]);if(!_0x18ebce)throw new Error(_0x1afe2a(0xc8)+this[_0x1afe2a(0xf8)]+_0x1afe2a(0x124)+this[_0x1afe2a(0xd1)]+'\x20not\x20found');const {transform:_0x210930}=convertPositionCellToSheetOverGrid(this[_0x1afe2a(0xf8)],this['subUnitId'],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0x18ebce);this['x']=this['x']>0x0?this['x']:_0x210930[_0x1afe2a(0xba)],this['y']=this['y']>0x0?this['y']:_0x210930[_0x1afe2a(0x135)];}return this[_0x1afe2a(0xbc)]=(_0x3e15ac=this[_0x1afe2a(0xbc)])!==null&&_0x3e15ac!==void 0x0?_0x3e15ac:DEFAULT_SHAPE_WIDTH,this[_0x1afe2a(0x111)]=(_0x48f2a4=this[_0x1afe2a(0x111)])!==null&&_0x48f2a4!==void 0x0?_0x48f2a4:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x1afe2a(0xf8)],'subUnitId':this['subUnitId'],'shapeId':this[_0x1afe2a(0xd6)],'shapeType':this[_0x1afe2a(0x106)],'shapeData':Object[_0x1afe2a(0x12a)](this[_0x1afe2a(0x129)])[_0x1afe2a(0xb8)]>0x0?this[_0x1afe2a(0x129)]:void 0x0,'x':this['x'],'y':this['y'],'width':this[_0x1afe2a(0xbc)],'height':this[_0x1afe2a(0x111)]};}['getShapeId'](){const _0x1135c4=_0x2064d3;return this[_0x1135c4(0xd6)];}[_0x2064d3(0xde)](){const _0x32acae=_0x2064d3;return this[_0x32acae(0x106)];}['getShapeData'](){return this['shapeData'];}[_0x2064d3(0xbf)](){return{'x':this['x'],'y':this['y']};}[_0x2064d3(0xfc)](){return{'width':this['width'],'height':this['height']};}},FConnectorShape=class extends FShape{constructor(_0x210ffb,_0x51e1fe,_0x5be18d,_0x2cce77){const _0x413aad=_0x2064d3;super(_0x210ffb,_0x51e1fe,_0x5be18d,_0x2cce77),_defineProperty(this,_0x413aad(0x129),{});}[_0x2064d3(0xb3)](_0x40b245){const _0xe253af=_0x2064d3;if(!isConnectorShape(_0x40b245))throw new Error(_0xe253af(0xf1)+_0x40b245+',\x20but\x20expected\x20a\x20connector\x20shape\x20type.');return super[_0xe253af(0xb3)](_0x40b245),this;}[_0x2064d3(0x102)](_0x31e9a){const _0x3c9ce7=_0x2064d3;var _0x4fe36b,_0x15304d;if(!((_0x4fe36b=this[_0x3c9ce7(0x129)])===null||_0x4fe36b===void 0x0?void 0x0:_0x4fe36b['ln']))this['shapeData']['ln']={};if(!((_0x15304d=this[_0x3c9ce7(0x129)])===null||_0x15304d===void 0x0||(_0x15304d=_0x15304d['ln'])===null||_0x15304d===void 0x0?void 0x0:_0x15304d[_0x3c9ce7(0x104)]))this[_0x3c9ce7(0x129)]['ln'][_0x3c9ce7(0x104)]={};return this[_0x3c9ce7(0x129)]['ln']['startArrow'][_0x3c9ce7(0xf5)]=_0x31e9a,this;}[_0x2064d3(0xc4)](_0x459d39){const _0x232e7f=_0x2064d3;var _0x51bf2c,_0x1d1f7d;if(!((_0x51bf2c=this[_0x232e7f(0x129)])===null||_0x51bf2c===void 0x0?void 0x0:_0x51bf2c['ln']))this[_0x232e7f(0x129)]['ln']={};if(!((_0x1d1f7d=this['shapeData'])===null||_0x1d1f7d===void 0x0||(_0x1d1f7d=_0x1d1f7d['ln'])===null||_0x1d1f7d===void 0x0?void 0x0:_0x1d1f7d[_0x232e7f(0xef)]))this[_0x232e7f(0x129)]['ln'][_0x232e7f(0xef)]={};return this['shapeData']['ln']['endArrow']['type']=_0x459d39,this;}[_0x2064d3(0xca)](_0x3c0df4){const _0x15e90d=_0x2064d3;var _0x295212,_0x5d0bef;if(!((_0x295212=this[_0x15e90d(0x129)])===null||_0x295212===void 0x0?void 0x0:_0x295212['ln']))this[_0x15e90d(0x129)]['ln']={};if(!((_0x5d0bef=this['shapeData'])===null||_0x5d0bef===void 0x0||(_0x5d0bef=_0x5d0bef['ln'])===null||_0x5d0bef===void 0x0?void 0x0:_0x5d0bef[_0x15e90d(0x104)]))this[_0x15e90d(0x129)]['ln'][_0x15e90d(0x104)]={};return this['shapeData']['ln'][_0x15e90d(0x104)]['size']=_0x3c0df4,this;}[_0x2064d3(0xbe)](_0x3a2526){const _0x2f0883=_0x2064d3;var _0x39cbba,_0x46565c;if(!((_0x39cbba=this[_0x2f0883(0x129)])===null||_0x39cbba===void 0x0?void 0x0:_0x39cbba['ln']))this['shapeData']['ln']={};if(!((_0x46565c=this[_0x2f0883(0x129)])===null||_0x46565c===void 0x0||(_0x46565c=_0x46565c['ln'])===null||_0x46565c===void 0x0?void 0x0:_0x46565c[_0x2f0883(0xef)]))this[_0x2f0883(0x129)]['ln']['endArrow']={};return this[_0x2f0883(0x129)]['ln'][_0x2f0883(0xef)]['size']=_0x3a2526,this;}[_0x2064d3(0xf0)](){const _0x21847b=_0x2064d3;return super[_0x21847b(0xf0)]();}['getEndConnectInfo'](){const _0x1ebaa9=_0x2064d3;var _0x285399;return((_0x285399=this[_0x1ebaa9(0x129)])===null||_0x285399===void 0x0||(_0x285399=_0x285399[_0x1ebaa9(0xd5)])===null||_0x285399===void 0x0?void 0x0:_0x285399['to'])||null;}['getStartConnectInfo'](){const _0x3cef8a=_0x2064d3;var _0x1e070a;return((_0x1e070a=this['shapeData'])===null||_0x1e070a===void 0x0||(_0x1e070a=_0x1e070a[_0x3cef8a(0xd5)])===null||_0x1e070a===void 0x0?void 0x0:_0x1e070a[_0x3cef8a(0x133)])||null;}};function computeConnectionPointInfo(_0x5c7138,_0x48139c,_0x512d1f,_0xb31140,_0x1ca524,_0x5a7938){const _0x46cd6e=_0x2064d3,_0x52460e=_0x1ca524[_0x46cd6e(0xd8)](_0x5c7138,_0x48139c,_0x512d1f);if(!_0x52460e)return null;const _0x1fb0ff=_0x5a7938[_0x46cd6e(0xea)]({'unitId':_0x5c7138,'subUnitId':_0x48139c,'drawingId':_0x512d1f});if(!(_0x1fb0ff===null||_0x1fb0ff===void 0x0?void 0x0:_0x1fb0ff['transform']))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x1245c7}=_0x1fb0ff[_0x46cd6e(0xd0)];_0x52460e[_0x46cd6e(0x103)]({'width':width,'height':height});const _0x134a20=_0x52460e['getConnectionSiteList']()[_0x46cd6e(0xcd)](_0x4245bd=>_0x4245bd[_0x46cd6e(0x115)]===_0xb31140);if(!_0x134a20)return null;let _0x2733af=flipX?width-_0x134a20['x']:_0x134a20['x'],_0x105160=flipY?height-_0x134a20['y']:_0x134a20['y'];if(_0x1245c7&&_0x1245c7!==0x0){const _0x50639d=_0x1245c7*Math['PI']/0xb4,_0x1127c9=Math[_0x46cd6e(0xe3)](_0x50639d),_0x184c2f=Math[_0x46cd6e(0x10d)](_0x50639d),_0x1e6842=width/0x2,_0x51bcb8=height/0x2,_0xa90322=_0x2733af-_0x1e6842,_0x497caf=_0x105160-_0x51bcb8;_0x2733af=_0x1e6842+_0xa90322*_0x1127c9-_0x497caf*_0x184c2f,_0x105160=_0x51bcb8+_0xa90322*_0x184c2f+_0x497caf*_0x1127c9;}_0x2733af+=left,_0x105160+=top;let _0x27ee7a=_0x134a20[_0x46cd6e(0xb2)]/0xea60;if(flipX)_0x27ee7a=0xb4-_0x27ee7a;if(flipY)_0x27ee7a=-_0x27ee7a;_0x27ee7a+=_0x1245c7||0x0,_0x27ee7a=(_0x27ee7a%0x168+0x168)%0x168;const _0x441846=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x1245c7||0x0);return{'point':{'x':_0x2733af,'y':_0x105160},'angle':_0x27ee7a,'bounds':_0x441846};}function calculateFreeEndpointAngle(_0x260a8e,_0x33d93b){const _0x5ecdd9=_0x2064d3,_0x1541c2=_0x33d93b['x']-_0x260a8e['x'],_0x1acba1=_0x33d93b['y']-_0x260a8e['y'];if(Math[_0x5ecdd9(0xb9)](_0x1541c2)>=Math['abs'](_0x1acba1))return _0x1541c2>=0x0?0xb4:0x0;return _0x1acba1>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x2a04fe,_0x1afa68,_0x2bdb14,_0x30176d,_0x436688,_0x436e8b,_0x254a05){const _0x1fdd7e=_0x2064d3,_0x4a4873=_0x436e8b[_0x1fdd7e(0xd8)](_0x2a04fe,_0x1afa68,_0x2bdb14);if(!_0x4a4873)return null;const _0x256cf0=_0x254a05['getDrawingByParam']({'unitId':_0x2a04fe,'subUnitId':_0x1afa68,'drawingId':_0x2bdb14});if(!(_0x256cf0===null||_0x256cf0===void 0x0?void 0x0:_0x256cf0[_0x1fdd7e(0xd0)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x256cf0[_0x1fdd7e(0xd0)];_0x4a4873['updateContext']({'width':width,'height':height});const _0x47dce6=_0x4a4873[_0x1fdd7e(0x127)]();if(_0x47dce6[_0x1fdd7e(0xb8)]<0x2)return null;const _0x524e27=_0x30176d?_0x47dce6[0x0]:_0x47dce6[_0x47dce6[_0x1fdd7e(0xb8)]-0x1],_0x4d1708=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x1fdd7e(0xda)](_0x524e27);return{'point':_0x4d1708,'angle':calculateFreeEndpointAngle(_0x436688[_0x1fdd7e(0xee)],_0x4d1708),'bounds':{'left':_0x4d1708['x'],'top':_0x4d1708['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x2064d3(0xe9)](_0x2a8f70){const _0x391bcd=_0x2064d3,{unitId:_0x480721,subUnitId:_0x516a05,shapeId:_0x21cfe3,shapeType:_0x60910f,shapeData:_0x280073,x:_0x23873e,y:_0x4a714e,width:_0x2683b2,height:_0x246dcd}=_0x2a8f70;return this[_0x391bcd(0x126)]['executeCommand'](InsertShapeCommand['id'],{'unitId':_0x480721,'subUnitId':_0x516a05,'shapeId':_0x21cfe3,'shapeType':_0x60910f,'shapeData':_0x280073,'position':{'x':_0x23873e,'y':_0x4a714e},'width':_0x2683b2,'height':_0x246dcd});}async[_0x2064d3(0xd9)](_0x3f3f4f){const _0x77cd43=_0x2064d3,{unitId:_0x42f487,subUnitId:_0x4f8c70,shapeId:_0x4ecbf0,shapeType:_0x1a0283,shapeData:_0xb8270c,x:_0x2f4a87,y:_0x439ee0,width:_0x27186f,height:_0x135d60}=_0x3f3f4f;return this[_0x77cd43(0x126)]['executeCommand'](SetShapeDrawingDataCommand['id'],{'unitId':_0x42f487,'subUnitId':_0x4f8c70,'shapeId':_0x4ecbf0,'shapeType':_0x1a0283,'shapeData':_0xb8270c,'position':{'x':_0x2f4a87,'y':_0x439ee0},'width':_0x27186f,'height':_0x135d60});}['newShape'](_0xe6da62){const _0x4c948d=_0x2064d3,_0xff028a=this['getWorkbook']()['getUnitId'](),_0x30c2ec=this[_0x4c948d(0xcf)]();if(_0xe6da62){const _0x2afaa4=new FShape(_0xff028a,_0x30c2ec,_0xe6da62[_0x4c948d(0xd6)],this[_0x4c948d(0xf6)]);return this[_0x4c948d(0xc5)](_0x2afaa4,_0xff028a,_0x30c2ec,_0xe6da62[_0x4c948d(0xd6)]),_0x2afaa4;}return new FShape(_0xff028a,_0x30c2ec,generateRandomId(),this[_0x4c948d(0xf6)]);}[_0x2064d3(0xf7)](_0x4a531e){const _0x2399ed=_0x2064d3,_0x57cac9=this[_0x2399ed(0xd2)]()[_0x2399ed(0x10a)](),_0x360821=this[_0x2399ed(0xcf)]();if(_0x4a531e){const _0x5e257c=new FConnectorShape(_0x57cac9,_0x360821,_0x4a531e[_0x2399ed(0xd6)],this[_0x2399ed(0xf6)]);return this[_0x2399ed(0xc5)](_0x5e257c,_0x57cac9,_0x360821,_0x4a531e[_0x2399ed(0xd6)]),_0x5e257c;}return new FConnectorShape(_0x57cac9,_0x360821,generateRandomId(),this['_injector']);}['getShapes'](){const _0x11ce5e=_0x2064d3,_0x395e72=this[_0x11ce5e(0xf6)][_0x11ce5e(0xfa)](ISheetDrawingService),_0x46fdda=this[_0x11ce5e(0xd2)]()[_0x11ce5e(0x10a)](),_0x15d192=this[_0x11ce5e(0xcf)](),_0x3f8c60=_0x395e72[_0x11ce5e(0x11b)](_0x46fdda,_0x15d192);if(!_0x3f8c60)return[];const _0x545265=[];for(const [_0x3eeab2,_0x5ad671]of Object[_0x11ce5e(0x128)](_0x3f8c60))if(_0x5ad671&&_0x5ad671[_0x11ce5e(0x110)]===DrawingTypeEnum['DRAWING_SHAPE']){const _0x4dedee=new FShape(_0x46fdda,_0x15d192,_0x3eeab2,this['_injector']);this[_0x11ce5e(0xc5)](_0x4dedee,_0x46fdda,_0x15d192,_0x3eeab2),_0x545265[_0x11ce5e(0xc2)](_0x4dedee);}return _0x545265;}[_0x2064d3(0xe8)](_0x17b082){const _0x1748b2=_0x2064d3,{unitId:_0x4bd68a,subUnitId:_0x29c1a3,drawId:_0x254d70}=_0x17b082;return this['_commandService'][_0x1748b2(0xc9)](RemoveSheetDrawingCommand['id'],{'unitId':_0x4bd68a,'drawings':[{'unitId':_0x4bd68a,'subUnitId':_0x29c1a3,'drawingId':_0x254d70,'drawingType':DrawingTypeEnum[_0x1748b2(0xc1)]}]});}async[_0x2064d3(0x123)](_0x577464){const _0x3c9819=_0x2064d3,{connector:_0x16a501,startTarget:_0x56f6c4,endTarget:_0x3a04bf}=_0x577464;if(!_0x56f6c4&&!_0x3a04bf)return![];const _0x1c3c27=this[_0x3c9819(0xd2)]()['getUnitId'](),_0x14f9fd=this[_0x3c9819(0xcf)](),_0x4913a4=this[_0x3c9819(0xf6)][_0x3c9819(0xfa)](SheetsShapeService),_0x1f70f7=this[_0x3c9819(0xf6)][_0x3c9819(0xfa)](IDrawingManagerService),_0x42885f=_0x4913a4['getShapeModel'](_0x1c3c27,_0x14f9fd,_0x16a501[_0x3c9819(0xd6)]);if(!_0x42885f)return![];const _0x16e43b=_0x42885f[_0x3c9819(0xde)](),_0x14a984=_0x42885f['getShapeRelation'](),_0x557690={};for(const _0x2a28cf of _0x42885f[_0x3c9819(0xc0)]()){const _0x54e90e=_0x42885f['getAdjustValueByName'](_0x2a28cf);if(_0x54e90e!==void 0x0)_0x557690[_0x2a28cf]=_0x54e90e;}const {startInfo:_0x5b56e0,endInfo:_0x473e2d}=this['_resolveEndpoints'](_0x1c3c27,_0x14f9fd,_0x16a501,_0x42885f,_0x56f6c4,_0x3a04bf,_0x4913a4,_0x1f70f7,_0x14a984);if(!_0x5b56e0||!_0x473e2d)return![];const _0x5c8f9e=computeConnectorRouteLayout(routeConnectorLineShape(_0x5b56e0,_0x473e2d,_0x16e43b),_0x16e43b),_0x4825dc={};if(_0x56f6c4)_0x4825dc[_0x3c9819(0x133)]={'shapeId':_0x56f6c4[_0x3c9819(0xcb)][_0x3c9819(0xd6)],'cxnIndex':_0x56f6c4['connectionSiteIndex']};else{if(_0x14a984===null||_0x14a984===void 0x0?void 0x0:_0x14a984[_0x3c9819(0x133)])_0x4825dc[_0x3c9819(0x133)]=_0x14a984[_0x3c9819(0x133)];}if(_0x3a04bf)_0x4825dc['to']={'shapeId':_0x3a04bf[_0x3c9819(0xcb)]['drawId'],'cxnIndex':_0x3a04bf[_0x3c9819(0xdc)]};else{if(_0x14a984===null||_0x14a984===void 0x0?void 0x0:_0x14a984['to'])_0x4825dc['to']=_0x14a984['to'];}return this[_0x3c9819(0x126)][_0x3c9819(0xc9)](UpdateConnectorRelationCommand['id'],{'unitId':_0x1c3c27,'subUnitId':_0x14f9fd,'connectorShapeId':_0x16a501[_0x3c9819(0xd6)],'width':_0x5c8f9e[_0x3c9819(0xe2)][_0x3c9819(0xbc)],'height':_0x5c8f9e['worldRect']['height'],'left':_0x5c8f9e[_0x3c9819(0xe2)][_0x3c9819(0xba)],'top':_0x5c8f9e[_0x3c9819(0xe2)]['top'],'flipX':_0x5c8f9e['worldRect'][_0x3c9819(0x12d)]||![],'flipY':_0x5c8f9e[_0x3c9819(0xe2)][_0x3c9819(0xe1)]||![],'oldAdjustValues':_0x557690,'newAdjustValues':_0x5c8f9e['adjustValues'],'newLineType':_0x5c8f9e[_0x3c9819(0xb5)],'oldLineType':_0x16e43b,'rotation':_0x5c8f9e[_0x3c9819(0x121)],'oldRelation':_0x14a984,'newRelation':_0x4825dc});}[_0x2064d3(0xc5)](_0x47ffea,_0x28e6be,_0x33b88d,_0x5d4374){const _0x177369=_0x2064d3,_0x1e61c6=this[_0x177369(0xf6)][_0x177369(0xfa)](IDrawingManagerService)[_0x177369(0xea)]({'unitId':_0x28e6be,'subUnitId':_0x33b88d,'drawingId':_0x5d4374});if(_0x1e61c6===null||_0x1e61c6===void 0x0?void 0x0:_0x1e61c6[_0x177369(0xd0)]){var _0x594252,_0x15fe66,_0x43926d,_0x329605;_0x47ffea['x']=(_0x594252=_0x1e61c6[_0x177369(0xd0)][_0x177369(0xba)])!==null&&_0x594252!==void 0x0?_0x594252:0x0,_0x47ffea['y']=(_0x15fe66=_0x1e61c6[_0x177369(0xd0)][_0x177369(0x135)])!==null&&_0x15fe66!==void 0x0?_0x15fe66:0x0,_0x47ffea[_0x177369(0xbc)]=(_0x43926d=_0x1e61c6['transform'][_0x177369(0xbc)])!==null&&_0x43926d!==void 0x0?_0x43926d:_0x47ffea[_0x177369(0xbc)],_0x47ffea[_0x177369(0x111)]=(_0x329605=_0x1e61c6['transform'][_0x177369(0x111)])!==null&&_0x329605!==void 0x0?_0x329605:_0x47ffea['height'];}const _0x4193d4=this[_0x177369(0xf6)]['get'](SheetsShapeService)['getShapeModel'](_0x28e6be,_0x33b88d,_0x5d4374);if(_0x4193d4){_0x47ffea[_0x177369(0x106)]=_0x4193d4[_0x177369(0xde)]();const _0x4a2130=_0x4193d4[_0x177369(0xc3)]();if(_0x4a2130)_0x47ffea[_0x177369(0x129)]=JSON[_0x177369(0x107)](JSON[_0x177369(0x12f)](_0x4a2130));}}[_0x2064d3(0x116)](_0x1c6887,_0x376ecf,_0xdcda2d,_0x188ca8,_0x3f2744,_0x216b73,_0x1ec6ed,_0x490bd1,_0x5107bc){const _0x92c038=_0x2064d3;let _0x1c0875=null,_0x4103df=null;if(_0x3f2744)_0x1c0875=computeConnectionPointInfo(_0x1c6887,_0x376ecf,_0x3f2744[_0x92c038(0xcb)][_0x92c038(0xd6)],_0x3f2744[_0x92c038(0xdc)],_0x1ec6ed,_0x490bd1);if(_0x216b73)_0x4103df=computeConnectionPointInfo(_0x1c6887,_0x376ecf,_0x216b73[_0x92c038(0xcb)][_0x92c038(0xd6)],_0x216b73[_0x92c038(0xdc)],_0x1ec6ed,_0x490bd1);if(!_0x1c0875)_0x1c0875=this[_0x92c038(0x122)](_0x1c6887,_0x376ecf,_0xdcda2d[_0x92c038(0xd6)],!![],_0x4103df,_0x5107bc===null||_0x5107bc===void 0x0?void 0x0:_0x5107bc['from'],_0x1ec6ed,_0x490bd1);if(!_0x4103df)_0x4103df=this[_0x92c038(0x122)](_0x1c6887,_0x376ecf,_0xdcda2d[_0x92c038(0xd6)],![],_0x1c0875,_0x5107bc===null||_0x5107bc===void 0x0?void 0x0:_0x5107bc['to'],_0x1ec6ed,_0x490bd1);return{'startInfo':_0x1c0875,'endInfo':_0x4103df};}[_0x2064d3(0x122)](_0x162d1d,_0x48bea1,_0xa44a92,_0x42a08f,_0x4e0253,_0x1963c1,_0x564553,_0x11c438){const _0x6d3f4=_0x2064d3;if(_0x1963c1){const _0x5c5890=computeConnectionPointInfo(_0x162d1d,_0x48bea1,_0x1963c1[_0x6d3f4(0xb6)],_0x1963c1[_0x6d3f4(0xb7)],_0x564553,_0x11c438);if(_0x5c5890)return _0x5c5890;}if(!_0x4e0253)return null;return computeFreeEndpointInfo(_0x162d1d,_0x48bea1,_0xa44a92,_0x42a08f,_0x4e0253,_0x564553,_0x11c438);}};FWorksheet['extend'](FWorksheetShapeMixin);export{FConnectorShape,FShape};
1
+ const _0x4296b1=_0x26cd;(function(_0x11a5d5,_0x5933f5){const _0x997147=_0x26cd,_0x5beee3=_0x11a5d5();while(!![]){try{const _0x439401=parseInt(_0x997147(0x1b4))/0x1+-parseInt(_0x997147(0x1ae))/0x2+-parseInt(_0x997147(0x19e))/0x3+-parseInt(_0x997147(0x1c2))/0x4*(parseInt(_0x997147(0x18d))/0x5)+-parseInt(_0x997147(0x1cc))/0x6*(parseInt(_0x997147(0x1ee))/0x7)+-parseInt(_0x997147(0x188))/0x8*(-parseInt(_0x997147(0x1c8))/0x9)+-parseInt(_0x997147(0x1a4))/0xa*(-parseInt(_0x997147(0x190))/0xb);if(_0x439401===_0x5933f5)break;else _0x5beee3['push'](_0x5beee3['shift']());}catch(_0x29eaf4){_0x5beee3['push'](_0x5beee3['shift']());}}}(_0x5bfe,0x595f7));function _0x26cd(_0xfe032f,_0x713fc4){_0xfe032f=_0xfe032f-0x16d;const _0x5bfe3d=_0x5bfe();let _0x26cd83=_0x5bfe3d[_0xfe032f];return _0x26cd83;}import{ConnectorCoordinateTransform,ShapeArrowSizeEnum,ShapeArrowTypeEnum,ShapeFillEnum,ShapeGradientTypeEnum,ShapeLineCapEnum,ShapeLineDashEnum,ShapeLineJoinEnum,ShapeLineTypeEnum,ShapeTypeEnum,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{FEnum}from'@univerjs/core/facade';import{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,SetShapeDrawingDataCommand,SheetsShapeService,UpdateConnectorRelationCommand}from'@univerjs-pro/sheets-shape';import{DrawingTypeEnum,generateRandomId}from'@univerjs/core';import{IDrawingManagerService}from'@univerjs/drawing';function _0x5bfe(){const _0x38145f=['type','removeShape','insertShape','ShapeLineCapEnum','shapeData','executeCommand','function','_injector','getConnectionSiteList','SolidFill','setStartArrowSize','\x20and\x20subUnitId\x20','updateContext','default','extend','worldRect','gradientAngle','colorStops\x20is\x20required\x20and\x20should\x20contain\x20at\x20least\x20one\x20color\x20stop.','symbol','gradientType','ShapeLineTypeEnum','8ZFdEUZ','parse','DRAWING_SHAPE','ang','_resolveExistingOrFreeEndpoint','85ZBBizl','height','newConnector','2962212aUratN','gradientStops','dashType','getWorkbook','sin','fillType','flipX','getShapeModel','setNoneFill','getPosition','size','setEndArrowType','adjustValues','left','579720flBQMy','getUnitId','toPrimitive','setStrokeColor','getSize','shape','20jNrRfB','length','stringify','flipY','string',',\x20but\x20expected\x20a\x20connector\x20shape\x20type.','lineJoinType','ShapeGradientTypeEnum','shapeId','get','941798UtfsNP','getEndConnectInfo','ShapeArrowTypeEnum','Skeleton\x20for\x20unitId\x20','Invalid\x20shape\x20type\x20for\x20connector.\x20Received\x20','ensureSkeleton','625093PQSgek','setStrokeLineCapType','transform','keys','getSheetId','newShape','fill','getConnectorLinePoints','width','entries','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','setStrokeLineJoinType','from','_preloadShapeProperties','6164fkaPgq','rotation','_commandService','setStrokeLineDashType','color','getAdjustNames','4182471ghtBAB','call','getAdjustPoints','getShapeRelation','311994agMSRI','iterator','startArrow','setStrokeLineType','setStrokeOpacity','getAdjustValueByName','build','top','ShapeLineJoinEnum','drawId','setHeight','getDrawingByParam','setShapeSolidFill','object','\x20not\x20found','cos','ShapeLineDashEnum','setShapeType','stroke','getShapeData','setWidth','shapeType','opacity','setPosition','connectShapes','abs','localToWorld','getStartConnectInfo','getDrawingPoints','getShapeType','unitId','connectionSiteIndex','Shape\x20type\x20is\x20required.\x20Please\x20call\x20setShapeType()\x20before\x20build().','prototype','77vBAHdu','updateShape','getShapeId','getConnectionSites','_resolveEndpoints','subUnitId','find','endArrow'];_0x5bfe=function(){return _0x38145f;};return _0x5bfe();}import{SheetSkeletonService,convertPositionCellToSheetOverGrid}from'@univerjs/sheets';import{ISheetDrawingService,RemoveSheetDrawingCommand}from'@univerjs/sheets-drawing';import{FWorksheet}from'@univerjs/sheets/facade';var FSheetsShapeEnumMixin=class extends FEnum{get['ShapeTypeEnum'](){return ShapeTypeEnum;}get['ShapeFillEnum'](){return ShapeFillEnum;}get[_0x4296b1(0x1ab)](){return ShapeGradientTypeEnum;}get[_0x4296b1(0x187)](){return ShapeLineTypeEnum;}get[_0x4296b1(0x1dc)](){return ShapeLineDashEnum;}get[_0x4296b1(0x176)](){return ShapeLineCapEnum;}get[_0x4296b1(0x1d4)](){return ShapeLineJoinEnum;}get[_0x4296b1(0x1b0)](){return ShapeArrowTypeEnum;}get['ShapeArrowSizeEnum'](){return ShapeArrowSizeEnum;}};FEnum[_0x4296b1(0x181)](FSheetsShapeEnumMixin);function _typeof(_0xd175e8){'@babel/helpers - typeof';const _0x53c326=_0x4296b1;return _typeof=_0x53c326(0x179)==typeof Symbol&&_0x53c326(0x185)==typeof Symbol[_0x53c326(0x1cd)]?function(_0x261472){return typeof _0x261472;}:function(_0xb8e2e5){const _0x34ce11=_0x53c326;return _0xb8e2e5&&_0x34ce11(0x179)==typeof Symbol&&_0xb8e2e5['constructor']===Symbol&&_0xb8e2e5!==Symbol[_0x34ce11(0x1ed)]?_0x34ce11(0x185):typeof _0xb8e2e5;},_typeof(_0xd175e8);}function toPrimitive(_0x42ffe3,_0x2193ff){const _0x543da3=_0x4296b1;if(_0x543da3(0x1d9)!=_typeof(_0x42ffe3)||!_0x42ffe3)return _0x42ffe3;var _0x1f93a5=_0x42ffe3[Symbol[_0x543da3(0x1a0)]];if(void 0x0!==_0x1f93a5){var _0x4819c1=_0x1f93a5[_0x543da3(0x1c9)](_0x42ffe3,_0x2193ff||_0x543da3(0x180));if('object'!=_typeof(_0x4819c1))return _0x4819c1;throw new TypeError(_0x543da3(0x1be));}return(_0x543da3(0x1a8)===_0x2193ff?String:Number)(_0x42ffe3);}function toPropertyKey(_0x52c7bd){const _0x4502a3=_0x4296b1;var _0x711b55=toPrimitive(_0x52c7bd,'string');return _0x4502a3(0x185)==_typeof(_0x711b55)?_0x711b55:_0x711b55+'';}function _defineProperty(_0x101f93,_0x301b06,_0x28d40c){return(_0x301b06=toPropertyKey(_0x301b06))in _0x101f93?Object['defineProperty'](_0x101f93,_0x301b06,{'value':_0x28d40c,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x101f93[_0x301b06]=_0x28d40c,_0x101f93;}var FShape=class{constructor(_0x24e252,_0x2d85e6,_0x4ad9e6,_0xd4c48b){const _0x266ae0=_0x4296b1;_defineProperty(this,_0x266ae0(0x1ea),void 0x0),_defineProperty(this,'subUnitId',void 0x0),_defineProperty(this,_0x266ae0(0x1d5),void 0x0),_defineProperty(this,'x',0x0),_defineProperty(this,'y',0x0),_defineProperty(this,_0x266ae0(0x1bc),DEFAULT_SHAPE_WIDTH),_defineProperty(this,_0x266ae0(0x18e),DEFAULT_SHAPE_HEIGHT),_defineProperty(this,_0x266ae0(0x1e1),void 0x0),_defineProperty(this,_0x266ae0(0x177),{}),_defineProperty(this,'_injector',void 0x0),this[_0x266ae0(0x1ea)]=_0x24e252,this['subUnitId']=_0x2d85e6,this[_0x266ae0(0x1d5)]=_0x4ad9e6||generateRandomId(),this[_0x266ae0(0x17a)]=_0xd4c48b;}[_0x4296b1(0x1e3)](_0x4b97e9,_0x140d84,_0x5a849e,_0x332ded){const _0x2c163d=_0x4296b1,_0x81bec1=this[_0x2c163d(0x17a)][_0x2c163d(0x1ad)](SheetSkeletonService)['ensureSkeleton'](this[_0x2c163d(0x1ea)],this['subUnitId']);if(!_0x81bec1)throw new Error('Skeleton\x20for\x20unitId\x20'+this[_0x2c163d(0x1ea)]+'\x20and\x20subUnitId\x20'+this[_0x2c163d(0x170)]+'\x20not\x20found');const {transform:_0x547883}=convertPositionCellToSheetOverGrid(this['unitId'],this['subUnitId'],{'row':_0x4b97e9,'column':_0x140d84,'rowOffset':_0x5a849e,'columnOffset':_0x332ded},0x1,0x1,_0x81bec1);return this['x']=_0x547883[_0x2c163d(0x19d)],this['y']=_0x547883[_0x2c163d(0x1d3)],this;}['setAbsolutePosition'](_0x30e167,_0x4a894a){return this['x']=_0x30e167,this['y']=_0x4a894a,this;}[_0x4296b1(0x1dd)](_0x489677){const _0x4b04c3=_0x4296b1;return this[_0x4b04c3(0x1e1)]=_0x489677,this;}[_0x4296b1(0x1d8)](_0x1899dc,_0x42aac6){const _0x405364=_0x4296b1;if(!this[_0x405364(0x177)]['fill'])this['shapeData'][_0x405364(0x1ba)]={};this[_0x405364(0x177)][_0x405364(0x1ba)][_0x405364(0x195)]=ShapeFillEnum[_0x405364(0x17c)];if(_0x1899dc!==void 0x0)this[_0x405364(0x177)][_0x405364(0x1ba)][_0x405364(0x1c6)]=_0x1899dc;if(_0x42aac6!==void 0x0)this[_0x405364(0x177)][_0x405364(0x1ba)][_0x405364(0x1e2)]=_0x42aac6;return this;}['setShapeGradientFill'](_0x75a39d,_0x4efb58,_0x2c4d6f){const _0x9da8d2=_0x4296b1;if(_0x4efb58===void 0x0||_0x4efb58['length']===0x0)throw new Error(_0x9da8d2(0x184));if(!this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)])this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)]={};this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)][_0x9da8d2(0x191)]=_0x4efb58,this[_0x9da8d2(0x177)][_0x9da8d2(0x1ba)][_0x9da8d2(0x195)]=ShapeFillEnum['GradientFill'],this['shapeData'][_0x9da8d2(0x1ba)][_0x9da8d2(0x186)]=_0x75a39d;if(_0x2c4d6f!==void 0x0)this['shapeData'][_0x9da8d2(0x1ba)][_0x9da8d2(0x183)]=_0x2c4d6f;return this;}[_0x4296b1(0x198)](){const _0x26c4d6=_0x4296b1;return this[_0x26c4d6(0x177)]['fill']={'fillType':ShapeFillEnum['NoFill']},this;}[_0x4296b1(0x1a1)](_0x52eb5c){const _0x12f2e7=_0x4296b1;if(!this[_0x12f2e7(0x177)][_0x12f2e7(0x1de)])this[_0x12f2e7(0x177)][_0x12f2e7(0x1de)]={};return this[_0x12f2e7(0x177)]['stroke'][_0x12f2e7(0x1c6)]=_0x52eb5c,this;}['setStrokeWidth'](_0x308bea){const _0x4e06f9=_0x4296b1;if(!this[_0x4e06f9(0x177)][_0x4e06f9(0x1de)])this['shapeData']['stroke']={};return this[_0x4e06f9(0x177)]['stroke'][_0x4e06f9(0x1bc)]=_0x308bea,this;}[_0x4296b1(0x1c5)](_0x4df6c0){const _0x15c4fc=_0x4296b1;if(!this[_0x15c4fc(0x177)]['stroke'])this['shapeData'][_0x15c4fc(0x1de)]={};return this['shapeData'][_0x15c4fc(0x1de)][_0x15c4fc(0x192)]=_0x4df6c0,this;}[_0x4296b1(0x1bf)](_0x508c3f){const _0x1e8420=_0x4296b1;if(!this[_0x1e8420(0x177)][_0x1e8420(0x1de)])this[_0x1e8420(0x177)][_0x1e8420(0x1de)]={};return this[_0x1e8420(0x177)][_0x1e8420(0x1de)][_0x1e8420(0x1aa)]=_0x508c3f,this;}[_0x4296b1(0x1b5)](_0x1af8ef){const _0x1bfd1f=_0x4296b1;if(!this[_0x1bfd1f(0x177)][_0x1bfd1f(0x1de)])this[_0x1bfd1f(0x177)][_0x1bfd1f(0x1de)]={};return this[_0x1bfd1f(0x177)]['stroke']['capType']=_0x1af8ef,this;}[_0x4296b1(0x1d0)](_0x5d22d1){const _0xe8716b=_0x4296b1;if(!this[_0xe8716b(0x177)][_0xe8716b(0x1de)])this[_0xe8716b(0x177)]['stroke']={};return this[_0xe8716b(0x177)][_0xe8716b(0x1de)][_0xe8716b(0x1e2)]=_0x5d22d1,this;}[_0x4296b1(0x1cf)](_0x1fc1e4){const _0x36f9b3=_0x4296b1;if(!this[_0x36f9b3(0x177)]['stroke'])this[_0x36f9b3(0x177)][_0x36f9b3(0x1de)]={};return this[_0x36f9b3(0x177)][_0x36f9b3(0x1de)]['lineStrokeType']=_0x1fc1e4,this;}[_0x4296b1(0x1e0)](_0x45ea76){const _0xba6e4d=_0x4296b1;return this[_0xba6e4d(0x1bc)]=_0x45ea76,this;}[_0x4296b1(0x1d6)](_0x4987e2){const _0x58758c=_0x4296b1;return this[_0x58758c(0x18e)]=_0x4987e2,this;}['isLineShape'](){const _0xcc2e99=_0x4296b1,_0x295e09=this['_injector'][_0xcc2e99(0x1ad)](SheetsShapeService)[_0xcc2e99(0x197)](this[_0xcc2e99(0x1ea)],this[_0xcc2e99(0x170)],this[_0xcc2e99(0x1d5)]);if(_0x295e09)return isConnectorShape(_0x295e09[_0xcc2e99(0x1e9)]());if(this[_0xcc2e99(0x1e1)])return isConnectorShape(this[_0xcc2e99(0x1e1)]);return![];}[_0x4296b1(0x16e)](){const _0xd83d62=_0x4296b1,_0x2ed5f7=this['_injector']['get'](SheetsShapeService)[_0xd83d62(0x197)](this['unitId'],this[_0xd83d62(0x170)],this[_0xd83d62(0x1d5)]);if(!_0x2ed5f7)return[];const _0x441a09=this[_0xd83d62(0x17a)][_0xd83d62(0x1ad)](IDrawingManagerService)[_0xd83d62(0x1d7)]({'unitId':this['unitId'],'subUnitId':this[_0xd83d62(0x170)],'drawingId':this[_0xd83d62(0x1d5)]});if(!(_0x441a09===null||_0x441a09===void 0x0?void 0x0:_0x441a09['transform']))return[];const {width:width=0x0,height:height=0x0}=_0x441a09[_0xd83d62(0x1b6)];return _0x2ed5f7['updateContext']({'width':width,'height':height}),_0x2ed5f7[_0xd83d62(0x17b)]();}[_0x4296b1(0x1ca)](){const _0x4a736a=_0x4296b1,_0x58a463=this[_0x4a736a(0x17a)][_0x4a736a(0x1ad)](SheetsShapeService)[_0x4a736a(0x197)](this[_0x4a736a(0x1ea)],this[_0x4a736a(0x170)],this[_0x4a736a(0x1d5)]);if(!_0x58a463)return[];const _0x310927=this[_0x4a736a(0x17a)][_0x4a736a(0x1ad)](IDrawingManagerService)[_0x4a736a(0x1d7)]({'unitId':this['unitId'],'subUnitId':this[_0x4a736a(0x170)],'drawingId':this['drawId']});if(!(_0x310927===null||_0x310927===void 0x0?void 0x0:_0x310927[_0x4a736a(0x1b6)]))return[];const {width:width=0x0,height:height=0x0}=_0x310927['transform'];return _0x58a463[_0x4a736a(0x17f)]({'width':width,'height':height}),_0x58a463[_0x4a736a(0x1e8)]();}[_0x4296b1(0x1bb)](){const _0xc19b01=_0x4296b1,_0x227083=this[_0xc19b01(0x17a)]['get'](SheetsShapeService)[_0xc19b01(0x197)](this['unitId'],this['subUnitId'],this[_0xc19b01(0x1d5)]);if(!_0x227083)return[];if(!isConnectorShape(_0x227083[_0xc19b01(0x1e9)]()))return[];const _0x23795a=this[_0xc19b01(0x17a)][_0xc19b01(0x1ad)](IDrawingManagerService)[_0xc19b01(0x1d7)]({'unitId':this[_0xc19b01(0x1ea)],'subUnitId':this[_0xc19b01(0x170)],'drawingId':this['drawId']});if(!(_0x23795a===null||_0x23795a===void 0x0?void 0x0:_0x23795a[_0xc19b01(0x1b6)]))return[];const {width:width=0x0,height:height=0x0}=_0x23795a[_0xc19b01(0x1b6)];return _0x227083[_0xc19b01(0x17f)]({'width':width,'height':height}),_0x227083[_0xc19b01(0x1bb)]();}[_0x4296b1(0x1e7)](){const _0x589962=_0x4296b1;var _0x1a2caf;const _0x4239ee=this['_injector'][_0x589962(0x1ad)](SheetsShapeService)[_0x589962(0x197)](this['unitId'],this['subUnitId'],this[_0x589962(0x1d5)]);if(!_0x4239ee)return null;return(_0x1a2caf=_0x4239ee[_0x589962(0x1e7)]())!==null&&_0x1a2caf!==void 0x0?_0x1a2caf:null;}[_0x4296b1(0x1af)](){const _0x45bb25=_0x4296b1;var _0x207fbd;const _0xe1c07f=this[_0x45bb25(0x17a)][_0x45bb25(0x1ad)](SheetsShapeService)[_0x45bb25(0x197)](this[_0x45bb25(0x1ea)],this['subUnitId'],this[_0x45bb25(0x1d5)]);if(!_0xe1c07f)return null;return(_0x207fbd=_0xe1c07f['getEndConnectInfo']())!==null&&_0x207fbd!==void 0x0?_0x207fbd:null;}['build'](){const _0x5ddd54=_0x4296b1;var _0x30e3a6,_0x1cedc9;if(!this[_0x5ddd54(0x1e1)])throw new Error(_0x5ddd54(0x1ec));if(this['x']===0x0||this['y']===0x0){const _0xc90448=this[_0x5ddd54(0x17a)][_0x5ddd54(0x1ad)](SheetSkeletonService)[_0x5ddd54(0x1b3)](this[_0x5ddd54(0x1ea)],this[_0x5ddd54(0x170)]);if(!_0xc90448)throw new Error(_0x5ddd54(0x1b1)+this['unitId']+_0x5ddd54(0x17e)+this[_0x5ddd54(0x170)]+_0x5ddd54(0x1da));const {transform:_0x21cf9d}=convertPositionCellToSheetOverGrid(this[_0x5ddd54(0x1ea)],this[_0x5ddd54(0x170)],{'row':0x1,'column':0x1,'rowOffset':0x0,'columnOffset':0x0},0x1,0x1,_0xc90448);this['x']=this['x']>0x0?this['x']:_0x21cf9d[_0x5ddd54(0x19d)],this['y']=this['y']>0x0?this['y']:_0x21cf9d['top'];}return this[_0x5ddd54(0x1bc)]=(_0x30e3a6=this[_0x5ddd54(0x1bc)])!==null&&_0x30e3a6!==void 0x0?_0x30e3a6:DEFAULT_SHAPE_WIDTH,this[_0x5ddd54(0x18e)]=(_0x1cedc9=this[_0x5ddd54(0x18e)])!==null&&_0x1cedc9!==void 0x0?_0x1cedc9:DEFAULT_SHAPE_HEIGHT,{'unitId':this[_0x5ddd54(0x1ea)],'subUnitId':this['subUnitId'],'shapeId':this['drawId'],'shapeType':this['shapeType'],'shapeData':Object[_0x5ddd54(0x1b7)](this[_0x5ddd54(0x177)])[_0x5ddd54(0x1a5)]>0x0?this[_0x5ddd54(0x177)]:void 0x0,'x':this['x'],'y':this['y'],'width':this['width'],'height':this['height']};}[_0x4296b1(0x16d)](){return this['drawId'];}[_0x4296b1(0x1e9)](){const _0xb9b10d=_0x4296b1;return this[_0xb9b10d(0x1e1)];}[_0x4296b1(0x1df)](){const _0x380fff=_0x4296b1;return this[_0x380fff(0x177)];}[_0x4296b1(0x199)](){return{'x':this['x'],'y':this['y']};}[_0x4296b1(0x1a2)](){const _0x4b024c=_0x4296b1;return{'width':this[_0x4b024c(0x1bc)],'height':this['height']};}},FConnectorShape=class extends FShape{constructor(_0x545d83,_0x2e3df6,_0x3437e8,_0x3b9d35){const _0x1dfb4e=_0x4296b1;super(_0x545d83,_0x2e3df6,_0x3437e8,_0x3b9d35),_defineProperty(this,_0x1dfb4e(0x177),{});}['setShapeType'](_0x38dd2d){const _0x302968=_0x4296b1;if(!isConnectorShape(_0x38dd2d))throw new Error(_0x302968(0x1b2)+_0x38dd2d+_0x302968(0x1a9));return super[_0x302968(0x1dd)](_0x38dd2d),this;}['setStartArrowType'](_0xd2b8ec){const _0x4f48ba=_0x4296b1;var _0x2df4c5,_0x2f88e9;if(!((_0x2df4c5=this[_0x4f48ba(0x177)])===null||_0x2df4c5===void 0x0?void 0x0:_0x2df4c5['ln']))this[_0x4f48ba(0x177)]['ln']={};if(!((_0x2f88e9=this[_0x4f48ba(0x177)])===null||_0x2f88e9===void 0x0||(_0x2f88e9=_0x2f88e9['ln'])===null||_0x2f88e9===void 0x0?void 0x0:_0x2f88e9[_0x4f48ba(0x1ce)]))this[_0x4f48ba(0x177)]['ln'][_0x4f48ba(0x1ce)]={};return this['shapeData']['ln'][_0x4f48ba(0x1ce)]['type']=_0xd2b8ec,this;}[_0x4296b1(0x19b)](_0x5302af){const _0x4053a6=_0x4296b1;var _0x3588cf,_0x590902;if(!((_0x3588cf=this[_0x4053a6(0x177)])===null||_0x3588cf===void 0x0?void 0x0:_0x3588cf['ln']))this[_0x4053a6(0x177)]['ln']={};if(!((_0x590902=this['shapeData'])===null||_0x590902===void 0x0||(_0x590902=_0x590902['ln'])===null||_0x590902===void 0x0?void 0x0:_0x590902['endArrow']))this[_0x4053a6(0x177)]['ln'][_0x4053a6(0x172)]={};return this[_0x4053a6(0x177)]['ln'][_0x4053a6(0x172)][_0x4053a6(0x173)]=_0x5302af,this;}[_0x4296b1(0x17d)](_0x2e5bd4){const _0x5ec447=_0x4296b1;var _0xda075e,_0x3a1207;if(!((_0xda075e=this[_0x5ec447(0x177)])===null||_0xda075e===void 0x0?void 0x0:_0xda075e['ln']))this['shapeData']['ln']={};if(!((_0x3a1207=this[_0x5ec447(0x177)])===null||_0x3a1207===void 0x0||(_0x3a1207=_0x3a1207['ln'])===null||_0x3a1207===void 0x0?void 0x0:_0x3a1207[_0x5ec447(0x1ce)]))this[_0x5ec447(0x177)]['ln'][_0x5ec447(0x1ce)]={};return this['shapeData']['ln'][_0x5ec447(0x1ce)][_0x5ec447(0x19a)]=_0x2e5bd4,this;}['setEndArrowSize'](_0x17dd49){const _0x479f1c=_0x4296b1;var _0x444d95,_0x4b808d;if(!((_0x444d95=this[_0x479f1c(0x177)])===null||_0x444d95===void 0x0?void 0x0:_0x444d95['ln']))this[_0x479f1c(0x177)]['ln']={};if(!((_0x4b808d=this[_0x479f1c(0x177)])===null||_0x4b808d===void 0x0||(_0x4b808d=_0x4b808d['ln'])===null||_0x4b808d===void 0x0?void 0x0:_0x4b808d['endArrow']))this[_0x479f1c(0x177)]['ln']['endArrow']={};return this['shapeData']['ln'][_0x479f1c(0x172)][_0x479f1c(0x19a)]=_0x17dd49,this;}[_0x4296b1(0x1d2)](){return super['build']();}[_0x4296b1(0x1af)](){var _0x510935;return((_0x510935=this['shapeData'])===null||_0x510935===void 0x0||(_0x510935=_0x510935['relation'])===null||_0x510935===void 0x0?void 0x0:_0x510935['to'])||null;}[_0x4296b1(0x1e7)](){const _0x123950=_0x4296b1;var _0x43b1ba;return((_0x43b1ba=this[_0x123950(0x177)])===null||_0x43b1ba===void 0x0||(_0x43b1ba=_0x43b1ba['relation'])===null||_0x43b1ba===void 0x0?void 0x0:_0x43b1ba[_0x123950(0x1c0)])||null;}};function computeConnectionPointInfo(_0x3aabea,_0x5ee288,_0x51e515,_0x7e8a40,_0x380c1d,_0x122970){const _0x3184ab=_0x4296b1,_0x43671c=_0x380c1d[_0x3184ab(0x197)](_0x3aabea,_0x5ee288,_0x51e515);if(!_0x43671c)return null;const _0x5f4c3=_0x122970[_0x3184ab(0x1d7)]({'unitId':_0x3aabea,'subUnitId':_0x5ee288,'drawingId':_0x51e515});if(!(_0x5f4c3===null||_0x5f4c3===void 0x0?void 0x0:_0x5f4c3[_0x3184ab(0x1b6)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x13eca9}=_0x5f4c3[_0x3184ab(0x1b6)];_0x43671c[_0x3184ab(0x17f)]({'width':width,'height':height});const _0xcef540=_0x43671c[_0x3184ab(0x17b)]()[_0x3184ab(0x171)](_0x641d2d=>_0x641d2d['index']===_0x7e8a40);if(!_0xcef540)return null;let _0x29dd94=flipX?width-_0xcef540['x']:_0xcef540['x'],_0x48d2a7=flipY?height-_0xcef540['y']:_0xcef540['y'];if(_0x13eca9&&_0x13eca9!==0x0){const _0x2a2f29=_0x13eca9*Math['PI']/0xb4,_0x3e3f40=Math[_0x3184ab(0x1db)](_0x2a2f29),_0x2f288e=Math[_0x3184ab(0x194)](_0x2a2f29),_0x288407=width/0x2,_0x20f3af=height/0x2,_0x536eeb=_0x29dd94-_0x288407,_0x1bdb50=_0x48d2a7-_0x20f3af;_0x29dd94=_0x288407+_0x536eeb*_0x3e3f40-_0x1bdb50*_0x2f288e,_0x48d2a7=_0x20f3af+_0x536eeb*_0x2f288e+_0x1bdb50*_0x3e3f40;}_0x29dd94+=left,_0x48d2a7+=top;let _0x498542=_0xcef540[_0x3184ab(0x18b)]/0xea60;if(flipX)_0x498542=0xb4-_0x498542;if(flipY)_0x498542=-_0x498542;_0x498542+=_0x13eca9||0x0,_0x498542=(_0x498542%0x168+0x168)%0x168;const _0x7df8cb=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x13eca9||0x0);return{'point':{'x':_0x29dd94,'y':_0x48d2a7},'angle':_0x498542,'bounds':_0x7df8cb};}function calculateFreeEndpointAngle(_0x382f26,_0x49e5df){const _0x45635b=_0x4296b1,_0x32d072=_0x49e5df['x']-_0x382f26['x'],_0x30b5e5=_0x49e5df['y']-_0x382f26['y'];if(Math[_0x45635b(0x1e5)](_0x32d072)>=Math['abs'](_0x30b5e5))return _0x32d072>=0x0?0xb4:0x0;return _0x30b5e5>=0x0?0x10e:0x5a;}function computeFreeEndpointInfo(_0x502745,_0x3f0c48,_0x3651d2,_0x419f03,_0x355d1a,_0x2d3e3b,_0x4b7aa0){const _0x2a71a1=_0x4296b1,_0x27091f=_0x2d3e3b[_0x2a71a1(0x197)](_0x502745,_0x3f0c48,_0x3651d2);if(!_0x27091f)return null;const _0x2098c1=_0x4b7aa0['getDrawingByParam']({'unitId':_0x502745,'subUnitId':_0x3f0c48,'drawingId':_0x3651d2});if(!(_0x2098c1===null||_0x2098c1===void 0x0?void 0x0:_0x2098c1[_0x2a71a1(0x1b6)]))return null;const {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![]}=_0x2098c1['transform'];_0x27091f[_0x2a71a1(0x17f)]({'width':width,'height':height});const _0x434dee=_0x27091f[_0x2a71a1(0x1bb)]();if(_0x434dee[_0x2a71a1(0x1a5)]<0x2)return null;const _0x1f585a=_0x419f03?_0x434dee[0x0]:_0x434dee[_0x434dee[_0x2a71a1(0x1a5)]-0x1],_0x2db3a1=new ConnectorCoordinateTransform({'left':left,'top':top,'width':width,'height':height,'flipX':flipX,'flipY':flipY})[_0x2a71a1(0x1e6)](_0x1f585a);return{'point':_0x2db3a1,'angle':calculateFreeEndpointAngle(_0x355d1a['point'],_0x2db3a1),'bounds':{'left':_0x2db3a1['x'],'top':_0x2db3a1['y'],'width':0x0,'height':0x0}};}var FWorksheetShapeMixin=class extends FWorksheet{async[_0x4296b1(0x175)](_0x59fdfd){const _0x2e0bcb=_0x4296b1,{unitId:_0x5a542e,subUnitId:_0x127d02,shapeId:_0x31b02a,shapeType:_0x5537b9,shapeData:_0x11494a,x:_0xbe9019,y:_0x570793,width:_0x502b7a,height:_0x29d44b}=_0x59fdfd;return this['_commandService'][_0x2e0bcb(0x178)](InsertShapeCommand['id'],{'unitId':_0x5a542e,'subUnitId':_0x127d02,'shapeId':_0x31b02a,'shapeType':_0x5537b9,'shapeData':_0x11494a,'position':{'x':_0xbe9019,'y':_0x570793},'width':_0x502b7a,'height':_0x29d44b});}async[_0x4296b1(0x1ef)](_0x415ccd){const _0x408cb4=_0x4296b1,{unitId:_0x39eab7,subUnitId:_0x59024b,shapeId:_0x1c6674,shapeType:_0x35f437,shapeData:_0x36b1be,x:_0x253a1a,y:_0x28b9ce,width:_0x56e549,height:_0x13b20a}=_0x415ccd;return this[_0x408cb4(0x1c4)][_0x408cb4(0x178)](SetShapeDrawingDataCommand['id'],{'unitId':_0x39eab7,'subUnitId':_0x59024b,'shapeId':_0x1c6674,'shapeType':_0x35f437,'shapeData':_0x36b1be,'position':{'x':_0x253a1a,'y':_0x28b9ce},'width':_0x56e549,'height':_0x13b20a});}[_0x4296b1(0x1b9)](_0x3e1d0b){const _0xfdf40=_0x4296b1,_0x2c4d69=this[_0xfdf40(0x193)]()[_0xfdf40(0x19f)](),_0x4bda6b=this[_0xfdf40(0x1b8)]();if(_0x3e1d0b){const _0x187976=new FShape(_0x2c4d69,_0x4bda6b,_0x3e1d0b[_0xfdf40(0x1d5)],this[_0xfdf40(0x17a)]);return this['_preloadShapeProperties'](_0x187976,_0x2c4d69,_0x4bda6b,_0x3e1d0b['drawId']),_0x187976;}return new FShape(_0x2c4d69,_0x4bda6b,generateRandomId(),this[_0xfdf40(0x17a)]);}[_0x4296b1(0x18f)](_0x2bf1f3){const _0x2d9923=_0x4296b1,_0x185826=this[_0x2d9923(0x193)]()[_0x2d9923(0x19f)](),_0x51c78f=this[_0x2d9923(0x1b8)]();if(_0x2bf1f3){const _0x4c5b91=new FConnectorShape(_0x185826,_0x51c78f,_0x2bf1f3[_0x2d9923(0x1d5)],this[_0x2d9923(0x17a)]);return this[_0x2d9923(0x1c1)](_0x4c5b91,_0x185826,_0x51c78f,_0x2bf1f3[_0x2d9923(0x1d5)]),_0x4c5b91;}return new FConnectorShape(_0x185826,_0x51c78f,generateRandomId(),this['_injector']);}['getShapes'](){const _0x27b81a=_0x4296b1,_0x183efd=this[_0x27b81a(0x17a)]['get'](ISheetDrawingService),_0x1b6ff2=this[_0x27b81a(0x193)]()[_0x27b81a(0x19f)](),_0x58579e=this[_0x27b81a(0x1b8)](),_0x4e9109=_0x183efd['getDrawingData'](_0x1b6ff2,_0x58579e);if(!_0x4e9109)return[];const _0x2bdffc=[];for(const [_0x7993b8,_0x4a8792]of Object[_0x27b81a(0x1bd)](_0x4e9109))if(_0x4a8792&&_0x4a8792['drawingType']===DrawingTypeEnum[_0x27b81a(0x18a)]){const _0x15d2c1=new FShape(_0x1b6ff2,_0x58579e,_0x7993b8,this[_0x27b81a(0x17a)]);this[_0x27b81a(0x1c1)](_0x15d2c1,_0x1b6ff2,_0x58579e,_0x7993b8),_0x2bdffc['push'](_0x15d2c1);}return _0x2bdffc;}[_0x4296b1(0x174)](_0x140c0e){const _0x590d17=_0x4296b1,{unitId:_0x5398c5,subUnitId:_0x2c1a0a,drawId:_0x39da9c}=_0x140c0e;return this[_0x590d17(0x1c4)][_0x590d17(0x178)](RemoveSheetDrawingCommand['id'],{'unitId':_0x5398c5,'drawings':[{'unitId':_0x5398c5,'subUnitId':_0x2c1a0a,'drawingId':_0x39da9c,'drawingType':DrawingTypeEnum['DRAWING_SHAPE']}]});}async[_0x4296b1(0x1e4)](_0x149288){const _0x31e303=_0x4296b1,{connector:_0xb6bcee,startTarget:_0x151dbe,endTarget:_0x3c4595}=_0x149288;if(!_0x151dbe&&!_0x3c4595)return![];const _0x1b26e7=this[_0x31e303(0x193)]()[_0x31e303(0x19f)](),_0xbb405f=this[_0x31e303(0x1b8)](),_0x2694c0=this['_injector']['get'](SheetsShapeService),_0x1f1d63=this[_0x31e303(0x17a)][_0x31e303(0x1ad)](IDrawingManagerService),_0xb504c=_0x2694c0['getShapeModel'](_0x1b26e7,_0xbb405f,_0xb6bcee[_0x31e303(0x1d5)]);if(!_0xb504c)return![];const _0x4a4471=_0xb504c[_0x31e303(0x1e9)](),_0x1efcde=_0xb504c[_0x31e303(0x1cb)](),_0x37ac88={};for(const _0x36ae1b of _0xb504c[_0x31e303(0x1c7)]()){const _0x3fe095=_0xb504c[_0x31e303(0x1d1)](_0x36ae1b);if(_0x3fe095!==void 0x0)_0x37ac88[_0x36ae1b]=_0x3fe095;}const {startInfo:_0x29ec96,endInfo:_0x28b1ea}=this[_0x31e303(0x16f)](_0x1b26e7,_0xbb405f,_0xb6bcee,_0xb504c,_0x151dbe,_0x3c4595,_0x2694c0,_0x1f1d63,_0x1efcde);if(!_0x29ec96||!_0x28b1ea)return![];const _0x42224d=computeConnectorRouteLayout(routeConnectorLineShape(_0x29ec96,_0x28b1ea,_0x4a4471),_0x4a4471),_0x48d06d={};if(_0x151dbe)_0x48d06d[_0x31e303(0x1c0)]={'shapeId':_0x151dbe[_0x31e303(0x1a3)][_0x31e303(0x1d5)],'cxnIndex':_0x151dbe['connectionSiteIndex']};else{if(_0x1efcde===null||_0x1efcde===void 0x0?void 0x0:_0x1efcde[_0x31e303(0x1c0)])_0x48d06d['from']=_0x1efcde[_0x31e303(0x1c0)];}if(_0x3c4595)_0x48d06d['to']={'shapeId':_0x3c4595[_0x31e303(0x1a3)]['drawId'],'cxnIndex':_0x3c4595['connectionSiteIndex']};else{if(_0x1efcde===null||_0x1efcde===void 0x0?void 0x0:_0x1efcde['to'])_0x48d06d['to']=_0x1efcde['to'];}return this['_commandService']['executeCommand'](UpdateConnectorRelationCommand['id'],{'unitId':_0x1b26e7,'subUnitId':_0xbb405f,'connectorShapeId':_0xb6bcee[_0x31e303(0x1d5)],'width':_0x42224d[_0x31e303(0x182)][_0x31e303(0x1bc)],'height':_0x42224d['worldRect'][_0x31e303(0x18e)],'left':_0x42224d[_0x31e303(0x182)][_0x31e303(0x19d)],'top':_0x42224d[_0x31e303(0x182)][_0x31e303(0x1d3)],'flipX':_0x42224d['worldRect'][_0x31e303(0x196)]||![],'flipY':_0x42224d[_0x31e303(0x182)][_0x31e303(0x1a7)]||![],'oldAdjustValues':_0x37ac88,'newAdjustValues':_0x42224d[_0x31e303(0x19c)],'newLineType':_0x42224d['lineType'],'oldLineType':_0x4a4471,'rotation':_0x42224d[_0x31e303(0x1c3)],'oldRelation':_0x1efcde,'newRelation':_0x48d06d});}[_0x4296b1(0x1c1)](_0x334790,_0x767677,_0x1f7997,_0x68ffac){const _0xd7caa5=_0x4296b1,_0x59a1bf=this[_0xd7caa5(0x17a)][_0xd7caa5(0x1ad)](IDrawingManagerService)[_0xd7caa5(0x1d7)]({'unitId':_0x767677,'subUnitId':_0x1f7997,'drawingId':_0x68ffac});if(_0x59a1bf===null||_0x59a1bf===void 0x0?void 0x0:_0x59a1bf[_0xd7caa5(0x1b6)]){var _0x4b61b8,_0x112f1e,_0x3fc427,_0x10ba6f;_0x334790['x']=(_0x4b61b8=_0x59a1bf[_0xd7caa5(0x1b6)]['left'])!==null&&_0x4b61b8!==void 0x0?_0x4b61b8:0x0,_0x334790['y']=(_0x112f1e=_0x59a1bf[_0xd7caa5(0x1b6)][_0xd7caa5(0x1d3)])!==null&&_0x112f1e!==void 0x0?_0x112f1e:0x0,_0x334790[_0xd7caa5(0x1bc)]=(_0x3fc427=_0x59a1bf[_0xd7caa5(0x1b6)]['width'])!==null&&_0x3fc427!==void 0x0?_0x3fc427:_0x334790[_0xd7caa5(0x1bc)],_0x334790['height']=(_0x10ba6f=_0x59a1bf[_0xd7caa5(0x1b6)][_0xd7caa5(0x18e)])!==null&&_0x10ba6f!==void 0x0?_0x10ba6f:_0x334790[_0xd7caa5(0x18e)];}const _0x261fed=this['_injector'][_0xd7caa5(0x1ad)](SheetsShapeService)[_0xd7caa5(0x197)](_0x767677,_0x1f7997,_0x68ffac);if(_0x261fed){_0x334790[_0xd7caa5(0x1e1)]=_0x261fed['getShapeType']();const _0x1ad07e=_0x261fed[_0xd7caa5(0x1df)]();if(_0x1ad07e)_0x334790[_0xd7caa5(0x177)]=JSON[_0xd7caa5(0x189)](JSON[_0xd7caa5(0x1a6)](_0x1ad07e));}}[_0x4296b1(0x16f)](_0x43c675,_0x11c40f,_0x18bc0f,_0x1134ce,_0x12a4d8,_0x44bb2b,_0x537a15,_0x4a3154,_0x920042){const _0x2f10ed=_0x4296b1;let _0x4c6609=null,_0x446331=null;if(_0x12a4d8)_0x4c6609=computeConnectionPointInfo(_0x43c675,_0x11c40f,_0x12a4d8['shape']['drawId'],_0x12a4d8['connectionSiteIndex'],_0x537a15,_0x4a3154);if(_0x44bb2b)_0x446331=computeConnectionPointInfo(_0x43c675,_0x11c40f,_0x44bb2b[_0x2f10ed(0x1a3)]['drawId'],_0x44bb2b[_0x2f10ed(0x1eb)],_0x537a15,_0x4a3154);if(!_0x4c6609)_0x4c6609=this[_0x2f10ed(0x18c)](_0x43c675,_0x11c40f,_0x18bc0f['drawId'],!![],_0x446331,_0x920042===null||_0x920042===void 0x0?void 0x0:_0x920042['from'],_0x537a15,_0x4a3154);if(!_0x446331)_0x446331=this['_resolveExistingOrFreeEndpoint'](_0x43c675,_0x11c40f,_0x18bc0f[_0x2f10ed(0x1d5)],![],_0x4c6609,_0x920042===null||_0x920042===void 0x0?void 0x0:_0x920042['to'],_0x537a15,_0x4a3154);return{'startInfo':_0x4c6609,'endInfo':_0x446331};}[_0x4296b1(0x18c)](_0x335f37,_0x2905b5,_0x315790,_0x566a80,_0x2a802b,_0x5445e4,_0x2398c7,_0x22811f){const _0x2788c6=_0x4296b1;if(_0x5445e4){const _0x1dc872=computeConnectionPointInfo(_0x335f37,_0x2905b5,_0x5445e4[_0x2788c6(0x1ac)],_0x5445e4['cxnIndex'],_0x2398c7,_0x22811f);if(_0x1dc872)return _0x1dc872;}if(!_0x2a802b)return null;return computeFreeEndpointInfo(_0x335f37,_0x2905b5,_0x315790,_0x566a80,_0x2a802b,_0x2398c7,_0x22811f);}};FWorksheet[_0x4296b1(0x181)](FWorksheetShapeMixin);export{FConnectorShape,FShape};
package/lib/es/index.js CHANGED
@@ -1 +1 @@
1
- const _0x39a647=_0x488e;(function(_0x1f2167,_0x33db68){const _0x3a6787=_0x488e,_0x3199fb=_0x1f2167();while(!![]){try{const _0x4c1cec=-parseInt(_0x3a6787(0x1e3))/0x1+parseInt(_0x3a6787(0x204))/0x2+parseInt(_0x3a6787(0x212))/0x3+-parseInt(_0x3a6787(0x237))/0x4*(-parseInt(_0x3a6787(0x242))/0x5)+parseInt(_0x3a6787(0x221))/0x6+parseInt(_0x3a6787(0x1db))/0x7*(-parseInt(_0x3a6787(0x1f2))/0x8)+parseInt(_0x3a6787(0x258))/0x9*(parseInt(_0x3a6787(0x226))/0xa);if(_0x4c1cec===_0x33db68)break;else _0x3199fb['push'](_0x3199fb['shift']());}catch(_0x370244){_0x3199fb['push'](_0x3199fb['shift']());}}}(_0x3268,0x3d690));function _0x488e(_0x476f53,_0x12ae25){_0x476f53=_0x476f53-0x1bc;const _0x3268a2=_0x3268();let _0x488e42=_0x3268a2[_0x476f53];return _0x488e42;}import{ShapeModel,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{CommandType,DependentOn,Disposable,DrawingTypeEnum,ICommandService,IConfigService,IResourceManagerService,IUndoRedoService,IUniverInstanceService,Inject,Injector,Plugin,UniverInstanceType,generateRandomId,merge,sequenceExecute,touchDependencies}from'@univerjs/core';import{SheetInterceptorService,SheetSkeletonService,getSheetCommandTarget}from'@univerjs/sheets';import{ClearSheetDrawingTransformerOperation,DrawingApplyType,ISheetDrawingService,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetDrawingApplyMutation,SetSheetDrawingCommand,transformToAxisAlignPosition,transformToDrawingPosition}from'@univerjs/sheets-drawing';import{UniverLicensePlugin}from'@univerjs-pro/license';import{IDrawingManagerService}from'@univerjs/drawing';const DEFAULT_SHAPE_WIDTH=0xc8,DEFAULT_SHAPE_HEIGHT=0xc8;function _typeof(_0x565575){'@babel/helpers - typeof';const _0x4d5156=_0x488e;return _typeof=_0x4d5156(0x22d)==typeof Symbol&&_0x4d5156(0x20f)==typeof Symbol[_0x4d5156(0x1cd)]?function(_0x3e764c){return typeof _0x3e764c;}:function(_0xaa6be1){const _0xc19921=_0x4d5156;return _0xaa6be1&&_0xc19921(0x22d)==typeof Symbol&&_0xaa6be1[_0xc19921(0x1d4)]===Symbol&&_0xaa6be1!==Symbol[_0xc19921(0x210)]?_0xc19921(0x20f):typeof _0xaa6be1;},_typeof(_0x565575);}function _0x3268(){const _0x34988a=['630944BTLMDM','_sheetSkeletonService','delete','adjustValues','getCellIndexAndOffsetByPosition','add','setShapeData','left','_sheetsShapeService','_ensureShapeModelManager','removeLinePoints','_injector','object','shapeData','setShapeType','getLineShapeRelation','UNIVER_SHEET','getConnectionSiteList','4334OHVtbp','lineType','UPDATE','sheet.command.update-connector-relation','_config','sheet.command.toggle-shape-flip','getShapeType','index','_deserializeShapeForUnit','push','onStarting','symbol','prototype','interceptCommand','814023rXWmLa','sheet.command.update-line-shape-resize','angle','getShapeData','length','@univerjs-pro/sheets-shape','sheet.mutation.remove-shape','_disposed','fromJSON','getBatchUpdateOp','decorate','startY','onCommandExecute','_initSnapshot','MUTATION','2137314AOvoKC','_addLineRerouteUpdates','ang','getOwnPropertyDescriptor','type','790DpcmpO','getEndConnectInfo','dispose','toPrimitive','registerCommand','default','_drawingManagerService','function','hasShape','getDrawingByParam','resizeEnabled','0.22.0-insiders.20260513-09bbeca','width','from','redos','pluginName','worldRect','28iXCDrQ','_linesIds','sheet.command.insert-shape','updateContext','keys','defineProperty','string','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','syncExecuteCommand','isFrom','toJSON','65055CIUIuf','clear','sheet.command.set-shape-drawing-data','drawingType','flipY','_getConnectPointInfo','forEach','getAdjustValueByName','borderEnabled','flipX','getSkeleton','_commandService','pushUndoRedo','shapeId','_serializeShapeForUnit','call','sheets-shape.config','_initCommandInterceptor','relation','undos','getShapeRelation','preRedos','5625WPXafi','getShapeTextData','has','packageName','cxnIndex','_groupIds','stringify','preUndos','height','rotateEnabled','addShape','data','getDrawingData','insertShape','removeShape','_addLineFollowShapeUpdates','_sheetInterceptorService','result','_shapeModelManagerMap','iterator','top','sheet.mutation.insert-shape','disposeWithMe','ensureSkeleton','getBatchAddOp','rotation','constructor','DRAWING_SHAPE','INSERT','_initCommands','position','getBasicShapeType','setConfig','7mibYJm','find','getCellWithCoordByIndex','range','lineShapeId','fill','set','getBasicShapeRelation','439775KYeGUz','registerPluginResource','filter','sheet.command.set-shape-text-vertical-toggle','transform','_shapes','startX','get','_resourcesManagerService','COMMAND','getShapeModel','version','every','REMOVE','params'];_0x3268=function(){return _0x34988a;};return _0x3268();}function toPrimitive(_0xf93ed7,_0x5f490f){const _0x25b4b6=_0x488e;if(_0x25b4b6(0x1fe)!=_typeof(_0xf93ed7)||!_0xf93ed7)return _0xf93ed7;var _0x17697d=_0xf93ed7[Symbol[_0x25b4b6(0x229)]];if(void 0x0!==_0x17697d){var _0x52e664=_0x17697d[_0x25b4b6(0x251)](_0xf93ed7,_0x5f490f||_0x25b4b6(0x22b));if(_0x25b4b6(0x1fe)!=_typeof(_0x52e664))return _0x52e664;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x25b4b6(0x23d)===_0x5f490f?String:Number)(_0xf93ed7);}function toPropertyKey(_0x3c55e3){const _0x53c4b4=_0x488e;var _0x5b8b58=toPrimitive(_0x3c55e3,_0x53c4b4(0x23d));return'symbol'==_typeof(_0x5b8b58)?_0x5b8b58:_0x5b8b58+'';}function _defineProperty(_0x2742b4,_0x3a8cb5,_0x2540bf){return(_0x3a8cb5=toPropertyKey(_0x3a8cb5))in _0x2742b4?Object['defineProperty'](_0x2742b4,_0x3a8cb5,{'value':_0x2540bf,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2742b4[_0x3a8cb5]=_0x2540bf,_0x2742b4;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x2aded4=_0x488e;super(),_defineProperty(this,_0x2aded4(0x1e8),new Map()),_defineProperty(this,'_linesIds',new Set()),_defineProperty(this,_0x2aded4(0x1bf),new Set());}[_0x39a647(0x1c4)](_0x9b2765,_0x450efc,_0x193111){const _0x9af0b1=_0x39a647,_0x2436e4=new ShapeModel(_0x9b2765,_0x450efc,_0x193111);this[_0x9af0b1(0x1e8)][_0x9af0b1(0x1e1)](_0x450efc,_0x2436e4);if(isConnectorShape(_0x9b2765))this[_0x9af0b1(0x238)][_0x9af0b1(0x1f7)](_0x450efc);return _0x2436e4;}[_0x39a647(0x1e2)](_0x18d74e){const _0x1248fa=_0x39a647,_0x5af761=[];for(const _0x4a0e1d of this['_linesIds']){const _0x46e64a=this[_0x1248fa(0x1e8)][_0x1248fa(0x1ea)](_0x4a0e1d);if(_0x46e64a){const _0x5703e7=_0x46e64a[_0x1248fa(0x256)]();if(_0x5703e7){var _0xc3fa1,_0x8d7718;if(((_0xc3fa1=_0x5703e7[_0x1248fa(0x233)])===null||_0xc3fa1===void 0x0?void 0x0:_0xc3fa1['shapeId'])===_0x18d74e)_0x5af761[_0x1248fa(0x20d)]({..._0x5703e7['from'],'lineShapeId':_0x4a0e1d,'isFrom':!![]});if(((_0x8d7718=_0x5703e7['to'])===null||_0x8d7718===void 0x0?void 0x0:_0x8d7718[_0x1248fa(0x24f)])===_0x18d74e)_0x5af761['push']({..._0x5703e7['to'],'lineShapeId':_0x4a0e1d,'isFrom':![]});}}}return _0x5af761;}[_0x39a647(0x201)](_0x50424d){const _0x4b3993=_0x39a647,_0x325b33=this['_shapes'][_0x4b3993(0x1ea)](_0x50424d);if(_0x325b33)return _0x325b33[_0x4b3993(0x256)]();}[_0x39a647(0x20a)](_0x2a2ae5){const _0x5d361c=_0x39a647,_0x523ea5=this[_0x5d361c(0x1e8)]['get'](_0x2a2ae5);if(_0x523ea5)return _0x523ea5[_0x5d361c(0x20a)]();}[_0x39a647(0x22e)](_0xb03c3c){const _0x16ac07=_0x39a647;return this[_0x16ac07(0x1e8)][_0x16ac07(0x1bc)](_0xb03c3c);}['removeShape'](_0x2bbe5c){const _0x4b4fa8=_0x39a647,_0x2826fc=this['_shapes'][_0x4b4fa8(0x1ea)](_0x2bbe5c);if(!_0x2826fc)return;if(isConnectorShape(_0x2826fc['getShapeType']()))this['_linesIds'][_0x4b4fa8(0x1f4)](_0x2bbe5c);this[_0x4b4fa8(0x1e8)]['delete'](_0x2bbe5c);}[_0x39a647(0x241)](){const _0x18f6d3=_0x39a647,_0x491f88=[];return this[_0x18f6d3(0x1e8)][_0x18f6d3(0x248)](_0x5e835b=>{const _0x1ca483=_0x18f6d3;_0x491f88[_0x1ca483(0x20d)](_0x5e835b[_0x1ca483(0x241)]());}),_0x491f88;}[_0x39a647(0x21a)](_0x11213f){const _0x40a0d1=_0x39a647;for(const _0x450e38 of _0x11213f){const {id:_0x6e697b,shapeType:_0x50a723}=_0x450e38,_0x3032cb=this['addShape'](_0x50a723,_0x6e697b,_0x450e38[_0x40a0d1(0x1ff)]);if(_0x3032cb&&_0x3032cb['isLineShape']())this[_0x40a0d1(0x238)][_0x40a0d1(0x1f7)](_0x6e697b);}}[_0x39a647(0x228)](){const _0x7bc91d=_0x39a647;if(this[_0x7bc91d(0x219)])return;this[_0x7bc91d(0x1e8)][_0x7bc91d(0x248)](_0x187081=>{const _0x172421=_0x7bc91d;_0x187081[_0x172421(0x228)]();}),this[_0x7bc91d(0x1e8)][_0x7bc91d(0x243)](),this['_linesIds']['clear'](),this['_groupIds'][_0x7bc91d(0x243)](),super['dispose']();}};function __decorateParam(_0x32949f,_0x94329){return function(_0x36e27f,_0x371e68){_0x94329(_0x36e27f,_0x371e68,_0x32949f);};}function __decorate(_0x3953aa,_0x88dd7e,_0x28117f,_0x1e20fa){const _0x54c56f=_0x39a647;var _0x798032=arguments['length'],_0x1ed99c=_0x798032<0x3?_0x88dd7e:_0x1e20fa===null?_0x1e20fa=Object[_0x54c56f(0x224)](_0x88dd7e,_0x28117f):_0x1e20fa,_0x1bb39b;if(typeof Reflect===_0x54c56f(0x1fe)&&typeof Reflect['decorate']==='function')_0x1ed99c=Reflect[_0x54c56f(0x21c)](_0x3953aa,_0x88dd7e,_0x28117f,_0x1e20fa);else{for(var _0x31e4a0=_0x3953aa[_0x54c56f(0x216)]-0x1;_0x31e4a0>=0x0;_0x31e4a0--)if(_0x1bb39b=_0x3953aa[_0x31e4a0])_0x1ed99c=(_0x798032<0x3?_0x1bb39b(_0x1ed99c):_0x798032>0x3?_0x1bb39b(_0x88dd7e,_0x28117f,_0x1ed99c):_0x1bb39b(_0x88dd7e,_0x28117f))||_0x1ed99c;}return _0x798032>0x3&&_0x1ed99c&&Object[_0x54c56f(0x23c)](_0x88dd7e,_0x28117f,_0x1ed99c),_0x1ed99c;}const SHEET_SHAPE_PLUGIN='SHEET_SHAPE_PLUGIN';let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x124caf){const _0x4b630e=_0x39a647;super(),this[_0x4b630e(0x1eb)]=_0x124caf,_defineProperty(this,_0x4b630e(0x1cc),new Map()),this[_0x4b630e(0x21f)]();}['_ensureShapeModelManager'](_0x3b1b1c,_0x2fea7f){const _0x526f19=_0x39a647;let _0x59eb06=this['_shapeModelManagerMap'][_0x526f19(0x1ea)](_0x3b1b1c);!_0x59eb06&&(_0x59eb06=new Map(),this[_0x526f19(0x1cc)][_0x526f19(0x1e1)](_0x3b1b1c,_0x59eb06));let _0x545f8d=_0x59eb06[_0x526f19(0x1ea)](_0x2fea7f);return!_0x545f8d&&(_0x545f8d=new SheetShapeModelManager(),_0x59eb06['set'](_0x2fea7f,_0x545f8d)),_0x545f8d;}[_0x39a647(0x1c7)](_0x1d734f,_0x1f73ab,_0x4f1a3a,_0x101db4,_0x188dde){const _0x36a5db=_0x39a647;this[_0x36a5db(0x1fb)](_0x1d734f,_0x1f73ab)[_0x36a5db(0x1c4)](_0x4f1a3a,_0x101db4,_0x188dde);}['removeShape'](_0x4addf6,_0x2eea3d,_0x36b118){const _0x539c48=_0x39a647;this[_0x539c48(0x1fb)](_0x4addf6,_0x2eea3d)[_0x539c48(0x1c8)](_0x36b118);}[_0x39a647(0x1d9)](_0x13646b,_0x3d6956,_0x4ec57f){const _0x447f59=_0x39a647;return this[_0x447f59(0x1fb)](_0x13646b,_0x3d6956)[_0x447f59(0x20a)](_0x4ec57f);}['getShapeType'](_0xe9ea28,_0x38511d,_0x3474ce){const _0x1f1a3a=_0x39a647;return this[_0x1f1a3a(0x1fb)](_0xe9ea28,_0x38511d)['getShapeType'](_0x3474ce);}[_0x39a647(0x22e)](_0x4cd93e,_0x4fc067,_0x446535){const _0x123bb3=_0x39a647;return this[_0x123bb3(0x1fb)](_0x4cd93e,_0x4fc067)[_0x123bb3(0x22e)](_0x446535);}['getShapeTypeById'](_0x15baa7,_0x4264ac,_0x5a9da2){const _0x326f0c=_0x39a647;return this[_0x326f0c(0x1fb)](_0x15baa7,_0x4264ac)[_0x326f0c(0x20a)](_0x5a9da2);}['getShapeDataById'](_0x1259b2,_0x26a184,_0x5136f9){const _0x3e0d9a=_0x39a647,_0x2ae283=this[_0x3e0d9a(0x1fb)](_0x1259b2,_0x26a184);if(!_0x2ae283[_0x3e0d9a(0x20a)](_0x5136f9))return;const _0x2eb869=_0x2ae283[_0x3e0d9a(0x1e8)]['get'](_0x5136f9);if(!_0x2eb869)return;return _0x2eb869[_0x3e0d9a(0x215)]();}[_0x39a647(0x1ed)](_0x10e5fd,_0x80465d,_0x3d3803){const _0x3c9621=_0x39a647;return this[_0x3c9621(0x1fb)](_0x10e5fd,_0x80465d)[_0x3c9621(0x1e8)][_0x3c9621(0x1ea)](_0x3d3803);}[_0x39a647(0x1e2)](_0x1bbbbc,_0x533fa3,_0x591c4b){const _0x3698c5=_0x39a647;return this[_0x3698c5(0x1fb)](_0x1bbbbc,_0x533fa3)[_0x3698c5(0x1e2)](_0x591c4b);}[_0x39a647(0x201)](_0x4974b0,_0x1e0f9e,_0x3c492e){const _0x157f3c=_0x39a647,_0x4aa653=this[_0x157f3c(0x1fb)](_0x4974b0,_0x1e0f9e)[_0x157f3c(0x1e8)][_0x157f3c(0x1ea)](_0x3c492e);if(!_0x4aa653)return;return _0x4aa653['getShapeRelation']();}[_0x39a647(0x200)](){}[_0x39a647(0x250)](_0x1329cd){const _0x603028=_0x39a647,_0x590bf1={},_0x447a08=this[_0x603028(0x1cc)][_0x603028(0x1ea)](_0x1329cd);if(_0x447a08)_0x447a08[_0x603028(0x248)]((_0x4660b9,_0x125251)=>{const _0x4ebfab=_0x603028,_0x4eb7b5=_0x4660b9[_0x4ebfab(0x241)]();if(_0x4eb7b5[_0x4ebfab(0x216)]>0x0)_0x590bf1[_0x125251]=_0x4eb7b5;});return JSON[_0x603028(0x1c0)](_0x590bf1);}['_deserializeShapeForUnit'](_0x33fd1b,_0x1da6e8){const _0x1e3fe0=_0x39a647;Object[_0x1e3fe0(0x23b)](_0x1da6e8)[_0x1e3fe0(0x248)](_0x1dd827=>{const _0x277574=_0x1e3fe0;this[_0x277574(0x1fb)](_0x33fd1b,_0x1dd827)['fromJSON'](_0x1da6e8[_0x1dd827]);});}[_0x39a647(0x241)](){const _0x53b8f6=_0x39a647,_0x8b15f8={};return this[_0x53b8f6(0x1cc)][_0x53b8f6(0x248)]((_0x40e3e5,_0x4d17fc)=>{const _0x2ed30f=_0x53b8f6;_0x8b15f8[_0x4d17fc]={},_0x40e3e5[_0x2ed30f(0x248)]((_0x38b36c,_0x1b278e)=>{const _0x4c6041=_0x2ed30f;_0x8b15f8[_0x4d17fc][_0x1b278e]=_0x38b36c[_0x4c6041(0x241)]();});}),_0x8b15f8;}[_0x39a647(0x21a)](_0x4adcfa){const _0x245071=_0x39a647;Object['keys'](_0x4adcfa)[_0x245071(0x248)](_0x190de3=>{const _0x11ad9d=_0x245071,_0x1a6429=_0x4adcfa[_0x190de3];Object[_0x11ad9d(0x23b)](_0x1a6429)[_0x11ad9d(0x248)](_0x2cbe87=>{const _0x39698b=_0x11ad9d;this[_0x39698b(0x1fb)](_0x190de3,_0x2cbe87)[_0x39698b(0x21a)](_0x1a6429[_0x2cbe87]);});});}[_0x39a647(0x21f)](){const _0x5b8375=_0x39a647;this['_resourcesManagerService'][_0x5b8375(0x1e4)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType['UNIVER_SHEET']],'toJson':_0xc92ce6=>this[_0x5b8375(0x250)](_0xc92ce6),'parseJson':_0x577a7d=>JSON['parse'](_0x577a7d),'onLoad':(_0x308ac2,_0x2e4cab)=>{const _0x10d28f=_0x5b8375;this[_0x10d28f(0x20c)](_0x308ac2,_0x2e4cab);},'onUnLoad':_0x58ddf3=>{const _0x16f6fe=_0x5b8375,_0x2a8f1c=this[_0x16f6fe(0x1cc)][_0x16f6fe(0x1ea)](_0x58ddf3);_0x2a8f1c&&(_0x2a8f1c['forEach'](_0xe11f10=>{_0xe11f10['dispose']();}),this[_0x16f6fe(0x1cc)][_0x16f6fe(0x1f4)](_0x58ddf3));}});}[_0x39a647(0x228)](){const _0x522775=_0x39a647;this[_0x522775(0x1cc)][_0x522775(0x248)](_0x530e15=>{const _0xdaaaed=_0x522775;_0x530e15[_0xdaaaed(0x248)](_0x45403a=>{_0x45403a['dispose']();});});}};SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);const InsertSheetsShapeMutation={'id':_0x39a647(0x1cf),'type':CommandType['MUTATION'],'handler':(_0x2db0ad,_0x4dfbb6)=>{const _0x52cd03=_0x39a647,{unitId:_0x4d2ee7,subUnitId:_0x574fbc,shapeType:_0x4ddb68,shapeId:_0x4ee9da,shapeData:_0x5077ea}=_0x4dfbb6;return _0x2db0ad['get'](SheetsShapeService)[_0x52cd03(0x1c7)](_0x4d2ee7,_0x574fbc,_0x4ddb68,_0x4ee9da,_0x5077ea),!![];}},RemoveSheetsShapeMutation={'id':_0x39a647(0x218),'type':CommandType[_0x39a647(0x220)],'handler':(_0x4d24c1,_0x18a555)=>{const _0x26e39f=_0x39a647,{unitId:_0x31a421,subUnitId:_0x4c6399,shapeId:_0x3113f6}=_0x18a555;return _0x4d24c1[_0x26e39f(0x1ea)](SheetsShapeService)[_0x26e39f(0x1c8)](_0x31a421,_0x4c6399,_0x3113f6),!![];}},InsertShapeCommand={'type':CommandType[_0x39a647(0x1ec)],'id':_0x39a647(0x239),'handler':(_0xb44665,_0x50f4d6)=>{const _0x4039ac=_0x39a647;var _0x145ad7,_0x12277b;const _0x47b7e6=getSheetCommandTarget(_0xb44665['get'](IUniverInstanceService),_0x50f4d6);if(!_0x47b7e6)return![];const _0x5a0ff8=_0xb44665['get'](SheetSkeletonService),{unitId:_0x35756e,subUnitId:_0x2a7b6f}=_0x47b7e6,_0x59d45f=_0x5a0ff8['ensureSkeleton'](_0x35756e,_0x2a7b6f);if(!_0x59d45f)return![];const _0x1356cd=_0xb44665['get'](ICommandService),_0x5a8b70=_0xb44665['get'](IUndoRedoService),_0x3ef69b=_0xb44665['get'](SheetInterceptorService),_0x290d43=_0xb44665['get'](ISheetDrawingService),{shapeType:_0x181502,shapeData:_0x3c6234}=_0x50f4d6,_0x533e06=_0x50f4d6[_0x4039ac(0x24f)]||generateRandomId(),_0x43da78={'unitId':_0x35756e,'subUnitId':_0x2a7b6f,'shapeId':_0x533e06,'shapeType':_0x181502,'shapeData':_0x3c6234},_0x60664b=_0x50f4d6['width']||0xc8,_0x4c81a3=_0x50f4d6['height']||0xc8;let _0xa6b556=0x0,_0x163cdc=0x0,_0x3d9006={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x397e74={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x50f4d6[_0x4039ac(0x1d8)]){const {x:_0x5cd67d,y:_0x5011ac}=_0x50f4d6['position'];_0xa6b556=_0x5cd67d,_0x163cdc=_0x5011ac,_0x3d9006=_0x59d45f['getCellIndexAndOffsetByPosition'](_0x5cd67d,_0x5011ac),_0x397e74=_0x59d45f['getCellIndexAndOffsetByPosition'](_0x5cd67d+_0x60664b,_0x5011ac+_0x4c81a3);}else{if(_0x50f4d6[_0x4039ac(0x1de)]){const {startRow:_0x420703,startColumn:_0x5a31b2}=_0x50f4d6[_0x4039ac(0x1de)],_0x3f6fdd=0xa,_0x114b76=0xa;_0x3d9006={'row':_0x420703,'rowOffset':_0x3f6fdd,'column':_0x5a31b2,'columnOffset':_0x114b76};const _0x4a700b=_0x59d45f[_0x4039ac(0x1dd)](_0x420703,_0x5a31b2);_0xa6b556=_0x4a700b[_0x4039ac(0x1e9)]+_0x114b76,_0x163cdc=_0x4a700b[_0x4039ac(0x21d)]+_0x3f6fdd,_0x397e74=_0x59d45f[_0x4039ac(0x1f6)](_0xa6b556+_0x60664b,_0x163cdc+_0x4c81a3);}}const _0x7b7e0a={'from':_0x3d9006,'to':_0x397e74},_0x4c4136={'unitId':_0x35756e,'subUnitId':_0x2a7b6f,'drawingId':_0x533e06,'drawingType':DrawingTypeEnum[_0x4039ac(0x1d5)],'sheetTransform':_0x7b7e0a,'transform':{'left':_0xa6b556,'top':_0x163cdc,'width':_0x60664b,'height':_0x4c81a3},'data':{'shapeType':_0x181502,'shapeData':_0x3c6234},'axisAlignSheetTransform':_0x7b7e0a,'allowTransform':!![]};isConnectorShape(_0x181502)&&(_0x4c4136['data'][_0x4039ac(0x1e0)]=![],_0x4c4136[_0x4039ac(0x1c5)]['rotateEnabled']=![],_0x4c4136[_0x4039ac(0x1c5)][_0x4039ac(0x230)]=![],_0x4c4136[_0x4039ac(0x1c5)][_0x4039ac(0x24a)]=![],_0x4c4136[_0x4039ac(0x1e7)][_0x4039ac(0x1c3)]=![],_0x4c4136[_0x4039ac(0x1e7)][_0x4039ac(0x230)]=![],_0x4c4136[_0x4039ac(0x1e7)][_0x4039ac(0x24a)]=![]);const {undo:_0x554813,redo:_0x3325ce,objects:_0x3da00e}=_0x290d43[_0x4039ac(0x1d2)]([_0x4c4136]),_0x15d98b=_0x3ef69b[_0x4039ac(0x21e)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x35756e,'drawings':[_0x4c4136]}}),_0x1f5d99=[...(_0x145ad7=_0x15d98b[_0x4039ac(0x257)])!==null&&_0x145ad7!==void 0x0?_0x145ad7:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x35756e,'subUnitId':_0x2a7b6f,'op':_0x3325ce,'objects':_0x3da00e,'type':DrawingApplyType[_0x4039ac(0x1d6)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x35756e]},..._0x15d98b['redos'],{'id':InsertSheetsShapeMutation['id'],'params':_0x43da78}],_0x35f4c3=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x35756e,'subUnitId':_0x2a7b6f,'shapeId':_0x533e06}},...(_0x12277b=_0x15d98b['preUndos'])!==null&&_0x12277b!==void 0x0?_0x12277b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x35756e,'subUnitId':_0x2a7b6f,'op':_0x554813,'objects':_0x3da00e,'type':DrawingApplyType[_0x4039ac(0x1f0)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x35756e]},..._0x15d98b[_0x4039ac(0x255)]];if(sequenceExecute(_0x1f5d99,_0x1356cd)[_0x4039ac(0x1cb)])return _0x5a8b70[_0x4039ac(0x24e)]({'unitID':_0x35756e,'undoMutations':_0x35f4c3,'redoMutations':_0x1f5d99}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':'sheet.mutation.update-shape-data','type':CommandType[_0x39a647(0x220)],'handler':(_0x4347f6,_0x497230)=>{const _0x34fc96=_0x39a647,{unitId:_0x33e8dd,subUnitId:_0x1423fb,shapeType:_0x431f7a,shapeId:_0x57e1f7,shapeData:_0x4cad7a}=_0x497230,_0xa9dc86=_0x4347f6[_0x34fc96(0x1ea)](SheetsShapeService)['getShapeModel'](_0x33e8dd,_0x1423fb,_0x57e1f7);if(_0xa9dc86){if(_0x431f7a!==void 0x0)_0xa9dc86['setShapeType'](_0x431f7a);if(_0x4cad7a)_0xa9dc86===null||_0xa9dc86===void 0x0||_0xa9dc86[_0x34fc96(0x1f8)](_0x4cad7a,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType['COMMAND'],'id':_0x39a647(0x244),'handler':(_0xadd93,_0x4b89b0)=>{const _0x4aee5d=_0x39a647;var _0x40644b,_0x496ea3;const _0x1ac17f=getSheetCommandTarget(_0xadd93['get'](IUniverInstanceService),_0x4b89b0);if(!_0x1ac17f)return![];const _0x48db35=_0xadd93[_0x4aee5d(0x1ea)](SheetSkeletonService),{unitId:_0x2b7d53,subUnitId:_0x836d2}=_0x1ac17f,_0x2da239=_0x48db35[_0x4aee5d(0x1d1)](_0x2b7d53,_0x836d2);if(!_0x2da239)return![];const _0x25529f=_0xadd93[_0x4aee5d(0x1ea)](SheetsShapeService),{shapeId:_0x12ea16,shapeType:_0x4a92e0,shapeData:_0x217e53,position:_0x3d4923,width:_0x52887f,height:_0x1468b8}=_0x4b89b0,_0x383b6e=_0x25529f[_0x4aee5d(0x1ed)](_0x2b7d53,_0x836d2,_0x12ea16);if(!_0x383b6e)return![];const _0x37e1e6=_0xadd93[_0x4aee5d(0x1ea)](ICommandService),_0x1a08d4=_0xadd93[_0x4aee5d(0x1ea)](IUndoRedoService),_0x2502cf=_0xadd93['get'](SheetInterceptorService),_0x28d0d7=_0xadd93[_0x4aee5d(0x1ea)](ISheetDrawingService),_0x59000a={'unitId':_0x2b7d53,'subUnitId':_0x836d2,'shapeId':_0x12ea16,'shapeType':_0x4a92e0,'shapeData':_0x217e53},_0x342366=_0x383b6e[_0x4aee5d(0x20a)](),_0x593df9=_0x383b6e['getShapeData'](),{x:_0x13019b,y:_0x459d2b}=_0x3d4923,_0x35cac9={'from':_0x2da239[_0x4aee5d(0x1f6)](_0x13019b,_0x459d2b),'to':_0x2da239['getCellIndexAndOffsetByPosition'](_0x13019b+_0x52887f,_0x459d2b+_0x1468b8)},_0x327f23={'unitId':_0x2b7d53,'subUnitId':_0x836d2,'drawingId':_0x12ea16,'drawingType':DrawingTypeEnum[_0x4aee5d(0x1d5)],'sheetTransform':_0x35cac9,'transform':{'left':_0x13019b,'top':_0x459d2b,'width':_0x52887f,'height':_0x1468b8},'data':{'shapeType':_0x4a92e0,'shapeData':_0x217e53},'axisAlignSheetTransform':_0x35cac9,'allowTransform':!![]};isConnectorShape(_0x4a92e0)&&(_0x327f23['data'][_0x4aee5d(0x1e0)]=![],_0x327f23[_0x4aee5d(0x1c5)]['rotateEnabled']=![],_0x327f23[_0x4aee5d(0x1c5)][_0x4aee5d(0x230)]=![],_0x327f23['data'][_0x4aee5d(0x24a)]=![],_0x327f23[_0x4aee5d(0x1e7)][_0x4aee5d(0x1c3)]=![],_0x327f23[_0x4aee5d(0x1e7)]['resizeEnabled']=![],_0x327f23[_0x4aee5d(0x1e7)][_0x4aee5d(0x24a)]=![]);const {undo:_0x1c3fa8,redo:_0x1dd893,objects:_0x885bc6}=_0x28d0d7[_0x4aee5d(0x21b)]([_0x327f23]),_0x1692aa=_0x2502cf[_0x4aee5d(0x21e)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x2b7d53,'drawings':[_0x327f23]}}),_0x5773c1=[...(_0x40644b=_0x1692aa[_0x4aee5d(0x257)])!==null&&_0x40644b!==void 0x0?_0x40644b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2b7d53,'subUnitId':_0x836d2,'op':_0x1dd893,'objects':_0x885bc6,'type':DrawingApplyType[_0x4aee5d(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x2b7d53]},..._0x1692aa[_0x4aee5d(0x234)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x59000a}],_0x2c9cef=[...(_0x496ea3=_0x1692aa[_0x4aee5d(0x1c1)])!==null&&_0x496ea3!==void 0x0?_0x496ea3:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x2b7d53,'subUnitId':_0x836d2,'op':_0x1c3fa8,'objects':_0x885bc6,'type':DrawingApplyType[_0x4aee5d(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x2b7d53]},..._0x1692aa['undos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x2b7d53,'subUnitId':_0x836d2,'shapeType':_0x342366,'shapeId':_0x12ea16,'shapeData':_0x593df9}}];if(sequenceExecute(_0x5773c1,_0x37e1e6)[_0x4aee5d(0x1cb)])return _0x1a08d4[_0x4aee5d(0x24e)]({'unitID':_0x2b7d53,'undoMutations':_0x2c9cef,'redoMutations':_0x5773c1}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType[_0x39a647(0x1ec)],'id':_0x39a647(0x209),'handler':(_0x4ce472,_0x5345b9)=>{const _0x23fd52=_0x39a647;var _0x1de006,_0x358ff4;const _0x5f301c=getSheetCommandTarget(_0x4ce472[_0x23fd52(0x1ea)](IUniverInstanceService),_0x5345b9);if(!_0x5f301c)return![];const _0x28f940=_0x4ce472['get'](SheetSkeletonService),{unitId:_0x51f927,subUnitId:_0x142da8}=_0x5f301c,_0x50b725=_0x28f940[_0x23fd52(0x24c)](_0x51f927,_0x142da8);if(!_0x50b725)return![];const _0x4767cf=_0x4ce472['get'](ISheetDrawingService),{shapeId:_0x2f58b0,flipH:_0x4d57f8,flipV:_0x31fe0d}=_0x5345b9,_0x4b77b1=_0x4767cf['getDrawingByParam']({'unitId':_0x51f927,'subUnitId':_0x142da8,'drawingId':_0x2f58b0});if(!_0x4b77b1)return![];const _0x5983af=_0x4ce472['get'](SheetsShapeService)['getShapeModel'](_0x51f927,_0x142da8,_0x2f58b0);if(!_0x5983af)return![];const _0x1ede3b=_0x4ce472[_0x23fd52(0x1ea)](ICommandService),_0x1194cf=_0x4ce472[_0x23fd52(0x1ea)](IUndoRedoService),_0x261548=_0x4ce472[_0x23fd52(0x1ea)](SheetInterceptorService),_0x250af={..._0x4b77b1['transform']};if(_0x4d57f8!==void 0x0)_0x250af[_0x23fd52(0x24b)]=!_0x250af['flipX'];if(_0x31fe0d!==void 0x0)_0x250af[_0x23fd52(0x246)]=!_0x250af[_0x23fd52(0x246)];const _0x5e5c65=transformToDrawingPosition(_0x250af,_0x50b725),_0x5c2e35=transformToAxisAlignPosition(_0x250af,_0x50b725),_0x316cf8=_0x5983af[_0x23fd52(0x20a)](),_0x4c29dc=_0x5983af['getShapeData'](),_0x55c1c4={'unitId':_0x51f927,'subUnitId':_0x142da8,'drawingId':_0x2f58b0,'drawingType':DrawingTypeEnum[_0x23fd52(0x1d5)],'sheetTransform':_0x5e5c65,'transform':_0x250af,'data':{'shapeType':_0x316cf8,'shapeData':_0x4c29dc},'axisAlignSheetTransform':_0x5c2e35,'allowTransform':!![]},{undo:_0x128be5,redo:_0x1736fb,objects:_0x5d7d66}=_0x4767cf[_0x23fd52(0x21b)]([_0x55c1c4]),_0x55db2e=_0x261548[_0x23fd52(0x21e)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x51f927,'drawings':[_0x55c1c4]}}),_0x39f20c=[...(_0x1de006=_0x55db2e[_0x23fd52(0x257)])!==null&&_0x1de006!==void 0x0?_0x1de006:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x51f927,'subUnitId':_0x142da8,'op':_0x1736fb,'objects':_0x5d7d66,'type':DrawingApplyType[_0x23fd52(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x51f927]},..._0x55db2e[_0x23fd52(0x234)]],_0x3aabfb=[...(_0x358ff4=_0x55db2e['preUndos'])!==null&&_0x358ff4!==void 0x0?_0x358ff4:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x51f927,'subUnitId':_0x142da8,'op':_0x128be5,'objects':_0x5d7d66,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x51f927]},..._0x55db2e[_0x23fd52(0x255)]];if(isConnectorShape(_0x316cf8)){const _0x38f21f=_0x5983af['getShapeRelation']();if(_0x38f21f){const _0x385389={..._0x38f21f};_0x385389[_0x23fd52(0x233)]=void 0x0,_0x385389['to']=void 0x0,_0x39f20c['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x51f927,'subUnitId':_0x142da8,'shapeId':_0x2f58b0,'shapeType':_0x316cf8,'shapeData':{'relation':_0x385389}}}),_0x3aabfb[_0x23fd52(0x20d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x51f927,'subUnitId':_0x142da8,'shapeId':_0x2f58b0,'shapeType':_0x316cf8,'shapeData':{'relation':_0x38f21f}}});}}if(sequenceExecute(_0x39f20c,_0x1ede3b)[_0x23fd52(0x1cb)])return _0x1194cf[_0x23fd52(0x24e)]({'unitID':_0x51f927,'undoMutations':_0x3aabfb,'redoMutations':_0x39f20c}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType[_0x39a647(0x1ec)],'id':'sheet.command.set-shape-rotate','handler':(_0x275171,_0x3d52fc)=>{const _0x4e442e=_0x39a647;var _0x17704d,_0x2e0c83;const _0x28d76a=getSheetCommandTarget(_0x275171[_0x4e442e(0x1ea)](IUniverInstanceService),_0x3d52fc);if(!_0x28d76a)return![];const _0x445d8c=_0x275171[_0x4e442e(0x1ea)](SheetSkeletonService),{unitId:_0x3992e4,subUnitId:_0x1f2615}=_0x28d76a,_0x32c970=_0x445d8c[_0x4e442e(0x24c)](_0x3992e4,_0x1f2615);if(!_0x32c970)return![];const _0x19e0c5=_0x275171[_0x4e442e(0x1ea)](ISheetDrawingService),{shapeId:_0x56cab9,rotate:_0x5c6c87}=_0x3d52fc,_0x5c1c39=_0x19e0c5[_0x4e442e(0x22f)]({'unitId':_0x3992e4,'subUnitId':_0x1f2615,'drawingId':_0x56cab9});if(!_0x5c1c39)return![];const _0xaaf9c9=_0x275171[_0x4e442e(0x1ea)](SheetsShapeService)[_0x4e442e(0x1ed)](_0x3992e4,_0x1f2615,_0x56cab9);if(!_0xaaf9c9)return![];const _0x1e56f7=_0x275171[_0x4e442e(0x1ea)](ICommandService),_0x4777e0=_0x275171[_0x4e442e(0x1ea)](IUndoRedoService),_0x26ccf5=_0x275171['get'](SheetInterceptorService),_0x209a31={..._0x5c1c39['transform']};if(_0x5c6c87!==void 0x0)_0x209a31[_0x4e442e(0x214)]=(_0x209a31[_0x4e442e(0x214)]||0x0)+_0x5c6c87;const _0x254907=transformToDrawingPosition(_0x209a31,_0x32c970),_0x3fec80=transformToAxisAlignPosition(_0x209a31,_0x32c970),_0x3ee31f=_0xaaf9c9[_0x4e442e(0x20a)](),_0x4d2df9=_0xaaf9c9[_0x4e442e(0x215)](),_0x4bd42f={'unitId':_0x3992e4,'subUnitId':_0x1f2615,'drawingId':_0x56cab9,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x254907,'transform':_0x209a31,'data':{'shapeType':_0x3ee31f,'shapeData':_0x4d2df9},'axisAlignSheetTransform':_0x3fec80,'allowTransform':!![]},{undo:_0x54a3d4,redo:_0x5cc512,objects:_0x4e9d15}=_0x19e0c5[_0x4e442e(0x21b)]([_0x4bd42f]),_0x37f676=_0x26ccf5['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x3992e4,'drawings':[_0x4bd42f]}}),_0x292302=[...(_0x17704d=_0x37f676[_0x4e442e(0x257)])!==null&&_0x17704d!==void 0x0?_0x17704d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x3992e4,'subUnitId':_0x1f2615,'op':_0x5cc512,'objects':_0x4e9d15,'type':DrawingApplyType[_0x4e442e(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x3992e4]},..._0x37f676['redos']],_0x1d0b14=[...(_0x2e0c83=_0x37f676['preUndos'])!==null&&_0x2e0c83!==void 0x0?_0x2e0c83:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x3992e4,'subUnitId':_0x1f2615,'op':_0x54a3d4,'objects':_0x4e9d15,'type':DrawingApplyType[_0x4e442e(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x3992e4]},..._0x37f676[_0x4e442e(0x255)]];if(sequenceExecute(_0x292302,_0x1e56f7)[_0x4e442e(0x1cb)])return _0x4777e0[_0x4e442e(0x24e)]({'unitID':_0x3992e4,'undoMutations':_0x1d0b14,'redoMutations':_0x292302}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x39a647(0x1ec)],'id':_0x39a647(0x1e6),'handler':(_0x444b72,_0x386b82)=>{const _0x1241eb=_0x39a647;var _0x4dfbed;const _0x51eaad=getSheetCommandTarget(_0x444b72['get'](IUniverInstanceService),_0x386b82);if(!_0x51eaad)return![];const {unitId:_0x285dae,subUnitId:_0x2066b5}=_0x51eaad,{shapeId:_0x2500f4}=_0x386b82,_0x18b5cf=_0x444b72[_0x1241eb(0x1ea)](SheetsShapeService)[_0x1241eb(0x1ed)](_0x285dae,_0x2066b5,_0x2500f4);if(!_0x18b5cf)return![];const _0x152746=_0x18b5cf[_0x1241eb(0x259)](),_0x103b0b=(_0x4dfbed=_0x152746===null||_0x152746===void 0x0?void 0x0:_0x152746['isHorizontal'])!==null&&_0x4dfbed!==void 0x0?_0x4dfbed:!![],_0x2dd9e6=!_0x103b0b,_0xf8be89=_0x444b72[_0x1241eb(0x1ea)](ICommandService),_0x493efb=_0x444b72[_0x1241eb(0x1ea)](IUndoRedoService),_0x59a6e6={'unitId':_0x285dae,'subUnitId':_0x2066b5,'shapeId':_0x2500f4,'shapeData':{'shapeText':{'isHorizontal':_0x2dd9e6}}},_0x17dfee={'unitId':_0x285dae,'subUnitId':_0x2066b5,'shapeId':_0x2500f4,'shapeData':{'shapeText':{'isHorizontal':_0x103b0b}}},_0x431657=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x59a6e6}],_0x3e5e29=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x17dfee}];if(sequenceExecute(_0x431657,_0xf8be89)[_0x1241eb(0x1cb)])return _0x493efb[_0x1241eb(0x24e)]({'unitID':_0x285dae,'undoMutations':_0x3e5e29,'redoMutations':_0x431657}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x39a647(0x1ec)],'id':_0x39a647(0x207),'handler':(_0x49ac1b,_0x31c29e)=>{const _0x2dc97c=_0x39a647;var _0x39122d,_0x215b7c,_0x1abf6d,_0x58b09a;const _0x307a0a=getSheetCommandTarget(_0x49ac1b['get'](IUniverInstanceService),_0x31c29e);if(!_0x307a0a)return![];const _0x42aee1=_0x49ac1b['get'](SheetSkeletonService),{unitId:_0x8ff796,subUnitId:_0x156b5b}=_0x307a0a,_0x3eb496=_0x42aee1[_0x2dc97c(0x24c)](_0x8ff796,_0x156b5b);if(!_0x3eb496)return![];const _0x2c0b73=_0x49ac1b[_0x2dc97c(0x1ea)](ISheetDrawingService),{connectorShapeId:_0x1b99c3,width:_0x3d5115,height:_0x114efc,left:_0x237d5e,top:_0x18baed,flipX:_0x1db1db,flipY:_0x16326b,rotation:_0x293a2f,oldAdjustValues:_0x422c8c,newAdjustValues:_0x424ecb,oldLineType:_0x31a410,newLineType:_0x549117,oldRelation:_0x4cf591,newRelation:_0x3c8592}=_0x31c29e,_0x1b0dab=_0x2c0b73['getDrawingByParam']({'unitId':_0x8ff796,'subUnitId':_0x156b5b,'drawingId':_0x1b99c3});if(!_0x1b0dab)return![];const _0x30911c=_0x49ac1b[_0x2dc97c(0x1ea)](SheetsShapeService)[_0x2dc97c(0x1ed)](_0x8ff796,_0x156b5b,_0x1b99c3);if(!_0x30911c)return![];const _0x27ace7=_0x49ac1b[_0x2dc97c(0x1ea)](ICommandService),_0x34d8cd=_0x49ac1b[_0x2dc97c(0x1ea)](IUndoRedoService),_0x25572b=_0x49ac1b[_0x2dc97c(0x1ea)](SheetInterceptorService),_0x5c5174={..._0x1b0dab[_0x2dc97c(0x1e7)],'width':_0x3d5115,'height':_0x114efc,'left':_0x237d5e,'top':_0x18baed,'flipX':_0x1db1db,'flipY':_0x16326b,'angle':(_0x39122d=_0x293a2f!==null&&_0x293a2f!==void 0x0?_0x293a2f:(_0x215b7c=_0x1b0dab[_0x2dc97c(0x1e7)])===null||_0x215b7c===void 0x0?void 0x0:_0x215b7c[_0x2dc97c(0x214)])!==null&&_0x39122d!==void 0x0?_0x39122d:0x0},_0x22ea33=transformToDrawingPosition(_0x5c5174,_0x3eb496),_0x396b4c=transformToAxisAlignPosition(_0x5c5174,_0x3eb496),_0x522685=_0x30911c[_0x2dc97c(0x20a)](),_0x5c725a=_0x30911c['getShapeData'](),_0x31f088={'unitId':_0x8ff796,'subUnitId':_0x156b5b,'drawingId':_0x1b99c3,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x22ea33,'transform':_0x5c5174,'data':{'shapeType':_0x549117||_0x31a410||_0x522685,'shapeData':{..._0x5c725a,'adjustValues':_0x424ecb||_0x422c8c||(_0x5c725a===null||_0x5c725a===void 0x0?void 0x0:_0x5c725a[_0x2dc97c(0x1f5)]),'relation':_0x3c8592||_0x4cf591||(_0x5c725a===null||_0x5c725a===void 0x0?void 0x0:_0x5c725a[_0x2dc97c(0x254)])}},'axisAlignSheetTransform':_0x396b4c,'allowTransform':!![]},{undo:_0x398915,redo:_0x459c15,objects:_0x43bcd4}=_0x2c0b73['getBatchUpdateOp']([_0x31f088]),_0x36fd2e=_0x25572b[_0x2dc97c(0x21e)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x8ff796,'drawings':[_0x31f088]}}),_0x13f6cc=[...(_0x1abf6d=_0x36fd2e[_0x2dc97c(0x257)])!==null&&_0x1abf6d!==void 0x0?_0x1abf6d:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x8ff796,'subUnitId':_0x156b5b,'op':_0x459c15,'objects':_0x43bcd4,'type':DrawingApplyType[_0x2dc97c(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x8ff796]},..._0x36fd2e['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x8ff796,'subUnitId':_0x156b5b,'shapeId':_0x1b99c3,'shapeType':_0x549117,'shapeData':{'adjustValues':_0x424ecb,'relation':_0x3c8592}}}],_0x296e20=[...(_0x58b09a=_0x36fd2e[_0x2dc97c(0x1c1)])!==null&&_0x58b09a!==void 0x0?_0x58b09a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x8ff796,'subUnitId':_0x156b5b,'op':_0x398915,'objects':_0x43bcd4,'type':DrawingApplyType[_0x2dc97c(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x8ff796]},..._0x36fd2e[_0x2dc97c(0x255)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x8ff796,'subUnitId':_0x156b5b,'shapeId':_0x1b99c3,'shapeType':_0x522685,'shapeData':{..._0x5c725a,'adjustValues':_0x422c8c||(_0x5c725a===null||_0x5c725a===void 0x0?void 0x0:_0x5c725a[_0x2dc97c(0x1f5)]),'relation':_0x4cf591||(_0x5c725a===null||_0x5c725a===void 0x0?void 0x0:_0x5c725a[_0x2dc97c(0x254)])}}}];if(sequenceExecute(_0x13f6cc,_0x27ace7)[_0x2dc97c(0x1cb)])return _0x34d8cd[_0x2dc97c(0x24e)]({'unitID':_0x8ff796,'undoMutations':_0x296e20,'redoMutations':_0x13f6cc}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType[_0x39a647(0x1ec)],'id':_0x39a647(0x213),'handler':(_0x1516ca,_0x2ff72f)=>{const _0x2209fc=_0x39a647;var _0x516911,_0x773ca9;const _0x2689bd=getSheetCommandTarget(_0x1516ca['get'](IUniverInstanceService),_0x2ff72f);if(!_0x2689bd)return![];const _0x19ebb9=_0x1516ca[_0x2209fc(0x1ea)](SheetSkeletonService),{unitId:_0x1b858f,subUnitId:_0x3fa135}=_0x2689bd,_0x2735eb=_0x19ebb9['getSkeleton'](_0x1b858f,_0x3fa135);if(!_0x2735eb)return![];const _0x19c105=_0x1516ca['get'](ISheetDrawingService),{shapeId:_0x464d13,width:_0x1c58da,height:_0x504e29,left:_0x5db6c3,top:_0x18edac,flipX:_0xfd14f5,flipY:_0x2471c4,angle:_0x248a6c,oldAdjustValues:_0xd85cf1,newAdjustValues:_0x668e16,oldLineType:_0x757e84,newLineType:_0x8574b1}=_0x2ff72f,_0x4980a1=_0x19c105[_0x2209fc(0x22f)]({'unitId':_0x1b858f,'subUnitId':_0x3fa135,'drawingId':_0x464d13});if(!_0x4980a1)return![];const _0x3a5f06=_0x1516ca[_0x2209fc(0x1ea)](SheetsShapeService)[_0x2209fc(0x1ed)](_0x1b858f,_0x3fa135,_0x464d13);if(!_0x3a5f06)return![];const _0x45ecdb=_0x1516ca[_0x2209fc(0x1ea)](ICommandService),_0x27ba27=_0x1516ca[_0x2209fc(0x1ea)](IUndoRedoService),_0x2322d1=_0x1516ca[_0x2209fc(0x1ea)](SheetInterceptorService),_0x1ff4bb={..._0x4980a1[_0x2209fc(0x1e7)],'width':_0x1c58da,'height':_0x504e29,'left':_0x5db6c3,'top':_0x18edac,'flipX':_0xfd14f5,'flipY':_0x2471c4,'angle':_0x248a6c},_0x5bd54b=transformToDrawingPosition(_0x1ff4bb,_0x2735eb),_0x794a38=transformToAxisAlignPosition(_0x1ff4bb,_0x2735eb),_0x5ec5f2=_0x3a5f06['getShapeType'](),_0x320390=_0x3a5f06['getShapeData'](),_0x2a970b={'unitId':_0x1b858f,'subUnitId':_0x3fa135,'drawingId':_0x464d13,'drawingType':DrawingTypeEnum[_0x2209fc(0x1d5)],'sheetTransform':_0x5bd54b,'transform':_0x1ff4bb,'data':{'shapeType':_0x8574b1||_0x757e84||_0x5ec5f2,'shapeData':{..._0x320390,'adjustValues':_0x668e16||_0xd85cf1||(_0x320390===null||_0x320390===void 0x0?void 0x0:_0x320390[_0x2209fc(0x1f5)])}},'axisAlignSheetTransform':_0x794a38,'allowTransform':!![]},{undo:_0x24a3fb,redo:_0xbe4f16,objects:_0x363f10}=_0x19c105[_0x2209fc(0x21b)]([_0x2a970b]),_0x27769d=_0x2322d1[_0x2209fc(0x21e)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x1b858f,'drawings':[_0x2a970b]}}),_0x2b1917=[...(_0x516911=_0x27769d['preRedos'])!==null&&_0x516911!==void 0x0?_0x516911:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1b858f,'subUnitId':_0x3fa135,'op':_0xbe4f16,'objects':_0x363f10,'type':DrawingApplyType[_0x2209fc(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1b858f]},..._0x27769d['redos'],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1b858f,'subUnitId':_0x3fa135,'shapeId':_0x464d13,'shapeType':_0x8574b1,'shapeData':{'adjustValues':_0x668e16}}}],_0x50d59c=[...(_0x773ca9=_0x27769d['preUndos'])!==null&&_0x773ca9!==void 0x0?_0x773ca9:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x1b858f,'subUnitId':_0x3fa135,'op':_0x24a3fb,'objects':_0x363f10,'type':DrawingApplyType[_0x2209fc(0x206)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x1b858f]},..._0x27769d[_0x2209fc(0x255)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x1b858f,'subUnitId':_0x3fa135,'shapeId':_0x464d13,'shapeType':_0x5ec5f2,'shapeData':{..._0x320390,'adjustValues':_0xd85cf1||(_0x320390===null||_0x320390===void 0x0?void 0x0:_0x320390[_0x2209fc(0x1f5)])}}}];if(sequenceExecute(_0x2b1917,_0x45ecdb)[_0x2209fc(0x1cb)])return _0x27ba27['pushUndoRedo']({'unitID':_0x1b858f,'undoMutations':_0x50d59c,'redoMutations':_0x2b1917}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':'sheet.mutation.update-shape-type','type':CommandType[_0x39a647(0x220)],'handler':(_0x327350,_0x22ffc6)=>{const _0x4c6584=_0x39a647,{unitId:_0xffbdc7,subUnitId:_0x4456ec,shapeType:_0x27fdcc,shapeId:_0x4e7fad,shapeData:_0x1d4c3f}=_0x22ffc6,_0x2ece72=_0x327350[_0x4c6584(0x1ea)](SheetsShapeService)[_0x4c6584(0x1ed)](_0xffbdc7,_0x4456ec,_0x4e7fad);if(_0x2ece72){_0x2ece72[_0x4c6584(0x200)](_0x27fdcc);if(_0x1d4c3f)_0x2ece72===null||_0x2ece72===void 0x0||_0x2ece72[_0x4c6584(0x1f8)](_0x1d4c3f);}return!![];}},UpdateSheetsShapeTypeCommand={'id':'sheet.command.update-shape-type','type':CommandType[_0x39a647(0x1ec)],'handler':(_0x1c089c,_0x157b45)=>{const _0x17b04f=_0x39a647;if(!_0x157b45)return![];const _0x34a71e=_0x1c089c[_0x17b04f(0x1ea)](ICommandService),_0x526b9a=_0x1c089c['get'](SheetsShapeService),_0x1f2fa9=_0x1c089c[_0x17b04f(0x1ea)](IUndoRedoService),_0x5c4919=[],_0x4a38a3=[],{unitId:_0x522179,subUnitId:_0x4d97a7,shapeId:_0x340381,shapeType:_0x70597b,shapeData:_0x262fb7}=_0x157b45,_0x10d175=_0x526b9a['getShapeModel'](_0x522179,_0x4d97a7,_0x340381);if(_0x10d175){const _0x5e52fa=_0x10d175['getShapeType'](),_0x131fd7=Object['assign']({},_0x10d175[_0x17b04f(0x215)]()),_0x14a5e9={'unitId':_0x522179,'subUnitId':_0x4d97a7,'shapeId':_0x340381,'shapeType':_0x70597b,'shapeData':_0x262fb7},_0x3c09ca={'unitId':_0x522179,'subUnitId':_0x4d97a7,'shapeId':_0x340381,'shapeType':_0x5e52fa,'shapeData':_0x131fd7};_0x5c4919['push']({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x14a5e9}),_0x4a38a3[_0x17b04f(0x20d)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3c09ca});if(_0x5c4919[_0x17b04f(0x1ef)](_0x8088f0=>_0x34a71e[_0x17b04f(0x23f)](_0x8088f0['id'],_0x8088f0['params'])))_0x1f2fa9[_0x17b04f(0x24e)]({'unitID':_0x522179,'redoMutations':[..._0x5c4919],'undoMutations':[..._0x4a38a3]});return!![];}return![];}};var name=_0x39a647(0x217),version=_0x39a647(0x231);const SHEETS_SHAPE_PLUGIN_CONFIG_KEY=_0x39a647(0x252),configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x6aad8,_0x4576b2,_0x4b3627,_0x2aa7f6,_0x524913){const _0x1fdbd5=_0x39a647;super(),this['_commandService']=_0x6aad8,this[_0x1fdbd5(0x1ca)]=_0x4576b2,this[_0x1fdbd5(0x1f3)]=_0x4b3627,this[_0x1fdbd5(0x1fa)]=_0x2aa7f6,this[_0x1fdbd5(0x22c)]=_0x524913,this[_0x1fdbd5(0x1d7)](),this[_0x1fdbd5(0x253)]();}[_0x39a647(0x1d7)](){const _0x470f81=_0x39a647;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation][_0x470f81(0x248)](_0x2be336=>this['disposeWithMe'](this[_0x470f81(0x24d)][_0x470f81(0x22a)](_0x2be336)));}[_0x39a647(0x253)](){const _0x84b519=_0x39a647;this[_0x84b519(0x1d0)](this['_sheetInterceptorService'][_0x84b519(0x211)]({'getMutations':_0x543fd8=>{const _0xbabd03=_0x84b519;if(_0x543fd8['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x1be499}=_0x543fd8[_0xbabd03(0x1f1)],_0x22cc23=_0x1be499[_0xbabd03(0x1e5)](_0x24b3ae=>_0x24b3ae[_0xbabd03(0x245)]===DrawingTypeEnum[_0xbabd03(0x1d5)]);if(_0x22cc23[_0xbabd03(0x216)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x16be9c=[],_0x51e25e=[];return _0x22cc23['forEach'](_0x2eb62b=>{const _0x376646=_0xbabd03,{unitId:_0x53f657,subUnitId:_0x2845f9,drawingId:_0x527ff6}=_0x2eb62b,_0x368e3b=this[_0x376646(0x1fa)]['getShapeModel'](_0x53f657,_0x2845f9,_0x527ff6);if(!_0x368e3b)throw new TypeError(_0x376646(0x23e)+_0x368e3b);_0x16be9c[_0x376646(0x20d)]({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x53f657,'subUnitId':_0x2845f9,'shapeId':_0x527ff6}}),_0x51e25e[_0x376646(0x20d)]({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x53f657,'subUnitId':_0x2845f9,'shapeId':_0x527ff6,'shapeType':_0x368e3b['getShapeType'](),'shapeData':_0x368e3b[_0x376646(0x215)]()}});const _0x3c2686=this[_0x376646(0x1fa)][_0x376646(0x1e2)](_0x53f657,_0x2845f9,_0x527ff6);if(_0x3c2686)for(const _0x55df79 of _0x3c2686){const _0x598280=_0x55df79['lineShapeId'],_0x2779c2=_0x55df79['isFrom'],_0x52d06f=_0x2779c2?{'from':void 0x0}:{'to':void 0x0},_0x3ac830=_0x2779c2?{'from':{'shapeId':_0x55df79[_0x376646(0x24f)],'cxnIndex':_0x55df79[_0x376646(0x1be)]}}:{'to':{'shapeId':_0x55df79[_0x376646(0x24f)],'cxnIndex':_0x55df79[_0x376646(0x1be)]}};_0x16be9c[_0x376646(0x20d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x53f657,'subUnitId':_0x2845f9,'shapeId':_0x598280,'shapeData':{'relation':_0x52d06f}}}),_0x51e25e[_0x376646(0x20d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x53f657,'subUnitId':_0x2845f9,'shapeId':_0x598280,'shapeData':{'relation':_0x3ac830}}});}}),{'preRedos':_0x16be9c,'redos':[],'preUndos':[],'undos':_0x51e25e};}if(_0x543fd8['id']===SetSheetDrawingCommand['id']){const {drawings:_0x1f32f1}=_0x543fd8[_0xbabd03(0x1f1)],_0x504d63=_0x1f32f1['filter'](_0x296207=>_0x296207[_0xbabd03(0x245)]===DrawingTypeEnum[_0xbabd03(0x1d5)]);if(_0x504d63[_0xbabd03(0x216)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x456655=[],_0x4ab7c7=[];for(const _0x1e136d of _0x504d63){const {unitId:_0xa7dd17,subUnitId:_0x47c3ff,drawingId:_0x55316f,transform:_0x21de7c}=_0x1e136d;if(!_0xa7dd17||!_0x47c3ff||!_0x55316f||!_0x21de7c)continue;const _0x2833f1=this[_0xbabd03(0x1fa)][_0xbabd03(0x1ed)](_0xa7dd17,_0x47c3ff,_0x55316f);if(!_0x2833f1)throw new TypeError(_0xbabd03(0x23e)+_0x2833f1);if(isConnectorShape(_0x2833f1[_0xbabd03(0x20a)]())){const _0xa40f2f=this[_0xbabd03(0x1fa)][_0xbabd03(0x201)](_0xa7dd17,_0x47c3ff,_0x55316f),_0x1f5ca2={'from':void 0x0,'to':void 0x0};_0xa40f2f&&(_0x456655['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xa7dd17,'subUnitId':_0x47c3ff,'shapeId':_0x55316f,'shapeData':{'relation':_0x1f5ca2}}}),_0x4ab7c7[_0xbabd03(0x20d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0xa7dd17,'subUnitId':_0x47c3ff,'shapeId':_0x55316f,'shapeData':{'relation':_0xa40f2f}}}));}else{const _0x210241=this[_0xbabd03(0x1fa)]['getBasicShapeRelation'](_0xa7dd17,_0x47c3ff,_0x55316f);if(_0x210241&&_0x210241[_0xbabd03(0x216)]>0x0)for(const _0x529fc8 of _0x210241){const _0x5f5977=_0x529fc8[_0xbabd03(0x1df)],_0x4360ac=_0x529fc8[_0xbabd03(0x240)],_0x3b6f6f=this['_sheetsShapeService'][_0xbabd03(0x1ed)](_0xa7dd17,_0x47c3ff,_0x5f5977);if(!_0x3b6f6f)continue;const _0x5e2d8c=_0x3b6f6f['getStartConnectInfo'](),_0x1e4c35=_0x3b6f6f[_0xbabd03(0x227)]();if(_0x5e2d8c&&_0x1e4c35)this[_0xbabd03(0x222)](_0xa7dd17,_0x47c3ff,_0x5f5977,_0x3b6f6f,_0x5e2d8c,_0x1e4c35,_0x456655,_0x4ab7c7,_0x55316f,_0x21de7c);else this[_0xbabd03(0x1c9)](_0xa7dd17,_0x47c3ff,_0x5f5977,_0x3b6f6f,_0x4360ac?_0x5e2d8c:_0x1e4c35,_0x4360ac,_0x456655,_0x4ab7c7,_0x55316f,_0x21de7c);}}}return{'preRedos':[],'redos':_0x456655,'preUndos':_0x4ab7c7,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x39a647(0x247)](_0x3a8cf3,_0x2ebc78,_0x4488b1,_0x5a3313,_0x8c9bb0){const _0x2bf8c6=_0x39a647;if(!_0x2ebc78||!_0x4488b1)return null;const {shapeId:_0x2f4ad0,cxnIndex:_0x2b786a}=_0x3a8cf3,_0x405549=this['_sheetsShapeService'][_0x2bf8c6(0x1ed)](_0x2ebc78,_0x4488b1,_0x2f4ad0);if(!_0x405549)return null;const _0x3364ad=this[_0x2bf8c6(0x22c)][_0x2bf8c6(0x22f)]({'unitId':_0x2ebc78,'subUnitId':_0x4488b1,'drawingId':_0x2f4ad0});if(!(_0x3364ad===null||_0x3364ad===void 0x0?void 0x0:_0x3364ad['transform']))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x4ea0a6}=_0x3364ad[_0x2bf8c6(0x1e7)];if(_0x8c9bb0&&_0x5a3313===_0x2f4ad0){var _0x39ed32,_0x2d558f,_0x4d2e05,_0x1ab771,_0x8af24d,_0x1e32c0,_0x308fb7;left=(_0x39ed32=_0x8c9bb0[_0x2bf8c6(0x1f9)])!==null&&_0x39ed32!==void 0x0?_0x39ed32:left,top=(_0x2d558f=_0x8c9bb0['top'])!==null&&_0x2d558f!==void 0x0?_0x2d558f:top,width=(_0x4d2e05=_0x8c9bb0[_0x2bf8c6(0x232)])!==null&&_0x4d2e05!==void 0x0?_0x4d2e05:width,height=(_0x1ab771=_0x8c9bb0['height'])!==null&&_0x1ab771!==void 0x0?_0x1ab771:height,flipX=(_0x8af24d=_0x8c9bb0[_0x2bf8c6(0x24b)])!==null&&_0x8af24d!==void 0x0?_0x8af24d:flipX,flipY=(_0x1e32c0=_0x8c9bb0[_0x2bf8c6(0x246)])!==null&&_0x1e32c0!==void 0x0?_0x1e32c0:flipY,_0x4ea0a6=(_0x308fb7=_0x8c9bb0[_0x2bf8c6(0x214)])!==null&&_0x308fb7!==void 0x0?_0x308fb7:_0x4ea0a6;}_0x405549[_0x2bf8c6(0x23a)]({'width':width,'height':height});const _0x1a365a=_0x405549[_0x2bf8c6(0x203)]()[_0x2bf8c6(0x1dc)](_0x59119a=>_0x59119a[_0x2bf8c6(0x20b)]===_0x2b786a);if(!_0x1a365a)return null;let _0x3e5c71=flipX?width-_0x1a365a['x']:_0x1a365a['x'],_0x4af1b2=flipY?height-_0x1a365a['y']:_0x1a365a['y'];if(_0x4ea0a6!==0x0&&_0x4ea0a6!==void 0x0&&_0x4ea0a6!==null){const _0x7c661e=_0x4ea0a6*Math['PI']/0xb4,_0x180b8f=Math['cos'](_0x7c661e),_0x46ac12=Math['sin'](_0x7c661e),_0x3e8fc3=width/0x2,_0x4fae65=height/0x2,_0x3f009f=_0x3e5c71-_0x3e8fc3,_0x392638=_0x4af1b2-_0x4fae65;_0x3e5c71=_0x3e8fc3+_0x3f009f*_0x180b8f-_0x392638*_0x46ac12,_0x4af1b2=_0x4fae65+_0x3f009f*_0x46ac12+_0x392638*_0x180b8f;}_0x3e5c71+=left,_0x4af1b2+=top;let _0x4f8bfd=_0x1a365a[_0x2bf8c6(0x223)]/0xea60;if(flipX)_0x4f8bfd=0xb4-_0x4f8bfd;if(flipY)_0x4f8bfd=-_0x4f8bfd;_0x4f8bfd+=_0x4ea0a6||0x0,_0x4f8bfd=(_0x4f8bfd%0x168+0x168)%0x168;const _0x36e9d1=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x4ea0a6||0x0);return{'point':{'x':_0x3e5c71,'y':_0x4af1b2},'angle':_0x4f8bfd,'bounds':_0x36e9d1};}[_0x39a647(0x222)](_0x3e6a55,_0x2fae34,_0x52ef89,_0x34ed2a,_0x47ab06,_0x589c90,_0x39c48e,_0x4bd54b,_0x360a43,_0x528468){const _0x5ec8c3=_0x39a647,_0x44fc7a=this[_0x5ec8c3(0x1f3)][_0x5ec8c3(0x24c)](_0x3e6a55,_0x2fae34);if(!_0x44fc7a)return;const _0x5ed1fb=_0x34ed2a[_0x5ec8c3(0x256)](),_0x4de6cd=_0x34ed2a['getAdjustNames'](),_0x1ec0db={},_0x3c41c7={};_0x4de6cd[_0x5ec8c3(0x248)](_0x2da86f=>{const _0x4b13f2=_0x5ec8c3,_0x1e14b8=_0x34ed2a[_0x4b13f2(0x249)](_0x2da86f);_0x3c41c7[_0x2da86f]=_0x1e14b8!==null&&_0x1e14b8!==void 0x0?_0x1e14b8:0x0;});const _0x3566f1=this['_getConnectPointInfo'](_0x47ab06,_0x3e6a55,_0x2fae34,_0x360a43,_0x528468),_0x2afe71=this[_0x5ec8c3(0x247)](_0x589c90,_0x3e6a55,_0x2fae34,_0x360a43,_0x528468);if(_0x3566f1&&_0x2afe71){const _0xfdeb13=_0x34ed2a[_0x5ec8c3(0x20a)](),_0x1ef875=routeConnectorLineShape(_0x3566f1,_0x2afe71,_0xfdeb13);let _0x259277=_0xfdeb13;if(_0x1ef875){const _0x20bc75=computeConnectorRouteLayout(_0x1ef875,_0x34ed2a[_0x5ec8c3(0x20a)]()),_0x1bd790=this[_0x5ec8c3(0x22c)]['getDrawingData'](_0x3e6a55,_0x2fae34);if(_0x1bd790&&_0x1bd790[_0x52ef89]){const _0x4be836=_0x1bd790[_0x52ef89];_0x259277=_0x20bc75[_0x5ec8c3(0x205)];for(const [_0x491180,_0x28d91a]of Object['entries'](_0x20bc75['adjustValues']))_0x1ec0db[_0x491180]=_0x28d91a;const _0xe37512={..._0x4be836['transform'],'width':_0x20bc75[_0x5ec8c3(0x236)][_0x5ec8c3(0x232)],'height':_0x20bc75[_0x5ec8c3(0x236)][_0x5ec8c3(0x1c2)],'left':_0x20bc75[_0x5ec8c3(0x236)][_0x5ec8c3(0x1f9)],'top':_0x20bc75[_0x5ec8c3(0x236)][_0x5ec8c3(0x1ce)],'flipX':_0x20bc75[_0x5ec8c3(0x236)][_0x5ec8c3(0x24b)],'flipY':_0x20bc75[_0x5ec8c3(0x236)][_0x5ec8c3(0x246)],'angle':_0x20bc75[_0x5ec8c3(0x1d3)]},_0x593007=transformToDrawingPosition(_0xe37512,_0x44fc7a),_0x15ccff=transformToAxisAlignPosition(_0xe37512,_0x44fc7a),_0x5bbcd1={'unitId':_0x3e6a55,'subUnitId':_0x2fae34,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'drawingId':_0x52ef89,'transform':_0xe37512,'sheetTransform':_0x593007,'axisAlignSheetTransform':_0x15ccff},{unitId:_0x364938,subUnitId:_0x3a9429,undo:_0x494229,redo:_0x1a6cb9,objects:_0x5e1967}=this[_0x5ec8c3(0x22c)]['getBatchUpdateOp']([_0x5bbcd1]);_0x39c48e[_0x5ec8c3(0x20d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x364938,'subUnitId':_0x3a9429,'op':_0x1a6cb9,'objects':_0x5e1967,'type':DrawingApplyType[_0x5ec8c3(0x206)]}}),_0x4bd54b['push']({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x364938,'subUnitId':_0x3a9429,'op':_0x494229,'objects':_0x5e1967,'type':DrawingApplyType[_0x5ec8c3(0x206)]}});}_0x34ed2a[_0x5ec8c3(0x1fc)]();}_0x39c48e[_0x5ec8c3(0x20d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3e6a55,'subUnitId':_0x2fae34,'shapeId':_0x52ef89,'shapeType':_0x259277,'shapeData':{'adjustValues':_0x1ec0db,'relation':_0x5ed1fb}}}),_0x4bd54b['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x3e6a55,'subUnitId':_0x2fae34,'shapeId':_0x52ef89,'shapeType':_0xfdeb13,'shapeData':{'adjustValues':_0x3c41c7,'relation':_0x5ed1fb}}});}}['_addLineFollowShapeUpdates'](_0x40df5a,_0xd63c58,_0x5ceda1,_0x52673f,_0x1a8864,_0x24261a,_0x528a66,_0x5f1494,_0x1e317d,_0x14948c){const _0x135b03=_0x39a647;var _0x3f8db6;if(!_0x1a8864)return;const _0x55c0c8=this[_0x135b03(0x1f3)]['getSkeleton'](_0x40df5a,_0xd63c58);if(!_0x55c0c8)return;const _0x1cb2d4=(_0x3f8db6=this[_0x135b03(0x22c)]['getDrawingByParam']({'unitId':_0x40df5a,'subUnitId':_0xd63c58,'drawingId':_0x1e317d}))===null||_0x3f8db6===void 0x0?void 0x0:_0x3f8db6[_0x135b03(0x1e7)];if(!_0x1cb2d4)return;const _0x57344e=_0x1cb2d4[_0x135b03(0x1f9)]!==_0x14948c[_0x135b03(0x1f9)]||_0x1cb2d4[_0x135b03(0x1ce)]!==_0x14948c['top'],_0x57fd0d=_0x1cb2d4[_0x135b03(0x232)]!==_0x14948c[_0x135b03(0x232)]||_0x1cb2d4[_0x135b03(0x1c2)]!==_0x14948c[_0x135b03(0x1c2)],_0x4f6d7d=_0x1cb2d4[_0x135b03(0x24b)]!==_0x14948c['flipX']||_0x1cb2d4[_0x135b03(0x246)]!==_0x14948c[_0x135b03(0x246)],_0x7b8407=_0x1cb2d4[_0x135b03(0x214)]!==_0x14948c[_0x135b03(0x214)];if(_0x57344e&&!_0x57fd0d&&!_0x4f6d7d&&!_0x7b8407){var _0x31d637,_0x5964e9,_0x1eb792,_0x1f2118;const _0x7c52c7=((_0x31d637=_0x14948c[_0x135b03(0x1f9)])!==null&&_0x31d637!==void 0x0?_0x31d637:0x0)-((_0x5964e9=_0x1cb2d4[_0x135b03(0x1f9)])!==null&&_0x5964e9!==void 0x0?_0x5964e9:0x0),_0x525632=((_0x1eb792=_0x14948c[_0x135b03(0x1ce)])!==null&&_0x1eb792!==void 0x0?_0x1eb792:0x0)-((_0x1f2118=_0x1cb2d4[_0x135b03(0x1ce)])!==null&&_0x1f2118!==void 0x0?_0x1f2118:0x0),_0x27023d=this['_drawingManagerService'][_0x135b03(0x1c6)](_0x40df5a,_0xd63c58);if(_0x27023d&&_0x27023d[_0x5ceda1]){var _0x16ac17,_0x5f08ef,_0x25fb43,_0x50ba17;const _0x3650a0=_0x27023d[_0x5ceda1],_0x531a77={..._0x3650a0[_0x135b03(0x1e7)],'left':((_0x16ac17=(_0x5f08ef=_0x3650a0[_0x135b03(0x1e7)])===null||_0x5f08ef===void 0x0?void 0x0:_0x5f08ef[_0x135b03(0x1f9)])!==null&&_0x16ac17!==void 0x0?_0x16ac17:0x0)+_0x7c52c7,'top':((_0x25fb43=(_0x50ba17=_0x3650a0[_0x135b03(0x1e7)])===null||_0x50ba17===void 0x0?void 0x0:_0x50ba17[_0x135b03(0x1ce)])!==null&&_0x25fb43!==void 0x0?_0x25fb43:0x0)+_0x525632},_0x155f3a=transformToDrawingPosition(_0x531a77,_0x55c0c8),_0x575ba7=transformToAxisAlignPosition(_0x531a77,_0x55c0c8),_0x1a37f4={'unitId':_0x40df5a,'subUnitId':_0xd63c58,'drawingType':DrawingTypeEnum[_0x135b03(0x1d5)],'drawingId':_0x5ceda1,'transform':_0x531a77,'sheetTransform':_0x155f3a,'axisAlignSheetTransform':_0x575ba7},{unitId:_0x306299,subUnitId:_0x39b1ed,undo:_0xb9dedc,redo:_0x492453,objects:_0x547780}=this[_0x135b03(0x22c)][_0x135b03(0x21b)]([_0x1a37f4]);_0x528a66[_0x135b03(0x20d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x306299,'subUnitId':_0x39b1ed,'op':_0x492453,'objects':_0x547780,'type':DrawingApplyType['UPDATE']}}),_0x5f1494[_0x135b03(0x20d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x306299,'subUnitId':_0x39b1ed,'op':_0xb9dedc,'objects':_0x547780,'type':DrawingApplyType[_0x135b03(0x206)]}});}}else{const _0xe1cf54=_0x52673f['getStartConnectInfo'](),_0x21ba53=_0x52673f[_0x135b03(0x227)]();this['_addLineRerouteUpdates'](_0x40df5a,_0xd63c58,_0x5ceda1,_0x52673f,_0xe1cf54,_0x21ba53,_0x528a66,_0x5f1494,_0x1e317d,_0x14948c);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x3b87dd=defaultPluginConfig,_0x1b1d19,_0x357dc9,_0x1373e9){const _0x1bda20=_0x39a647;super(),this[_0x1bda20(0x208)]=_0x3b87dd,this[_0x1bda20(0x1fd)]=_0x1b1d19,this[_0x1bda20(0x24d)]=_0x357dc9,this['_configService']=_0x1373e9;const {..._0x352496}=merge({},defaultPluginConfig,this[_0x1bda20(0x208)]);this['_configService'][_0x1bda20(0x1da)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x352496);}[_0x39a647(0x20e)](){const _0x3a7d8a=_0x39a647,_0x20cfb3=this[_0x3a7d8a(0x1fd)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]]['forEach'](_0x588ad3=>_0x20cfb3[_0x3a7d8a(0x1f7)](_0x588ad3)),touchDependencies(_0x20cfb3,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x39a647(0x225),UniverInstanceType[_0x39a647(0x202)]),_defineProperty(UniverSheetsShapePlugin,_0x39a647(0x235),'SHEET_SHAPE_PLUGIN'),_defineProperty(UniverSheetsShapePlugin,_0x39a647(0x1bd),name),_defineProperty(UniverSheetsShapePlugin,_0x39a647(0x1ee),version),UniverSheetsShapePlugin=__decorate([DependentOn(UniverLicensePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,ICommandService),__decorateParam(0x3,IConfigService)],UniverSheetsShapePlugin);export{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,SetShapeDrawingDataCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,SheetsShapeService,ToggleSheetsShapeFlipCommand,UniverSheetsShapePlugin,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,UpdateSheetsShapeDataMutation,UpdateSheetsShapeTypeCommand,UpdateSheetsShapeTypeMutation};
1
+ const _0x341a97=_0x16de;(function(_0x4f3524,_0x5b9a4a){const _0x593e3c=_0x16de,_0x3614b0=_0x4f3524();while(!![]){try{const _0x224736=-parseInt(_0x593e3c(0x11a))/0x1*(parseInt(_0x593e3c(0x150))/0x2)+-parseInt(_0x593e3c(0x184))/0x3+parseInt(_0x593e3c(0x175))/0x4*(-parseInt(_0x593e3c(0x11e))/0x5)+-parseInt(_0x593e3c(0x1a4))/0x6+-parseInt(_0x593e3c(0x190))/0x7+-parseInt(_0x593e3c(0x15c))/0x8*(parseInt(_0x593e3c(0x142))/0x9)+parseInt(_0x593e3c(0x111))/0xa;if(_0x224736===_0x5b9a4a)break;else _0x3614b0['push'](_0x3614b0['shift']());}catch(_0x2d68e5){_0x3614b0['push'](_0x3614b0['shift']());}}}(_0x2d10,0x95c63));import{ShapeModel,computeConnectorRouteLayout,getBasicShapeRotateBound,isConnectorShape,routeConnectorLineShape}from'@univerjs-pro/engine-shape';import{CommandType,DependentOn,Disposable,DrawingTypeEnum,ICommandService,IConfigService,IResourceManagerService,IUndoRedoService,IUniverInstanceService,Inject,Injector,Plugin,UniverInstanceType,generateRandomId,merge,sequenceExecute,touchDependencies}from'@univerjs/core';import{SheetInterceptorService,SheetSkeletonService,getSheetCommandTarget}from'@univerjs/sheets';import{ClearSheetDrawingTransformerOperation,DrawingApplyType,ISheetDrawingService,InsertSheetDrawingCommand,RemoveSheetDrawingCommand,SetDrawingApplyMutation,SetSheetDrawingCommand,transformToAxisAlignPosition,transformToDrawingPosition}from'@univerjs/sheets-drawing';import{UniverLicensePlugin}from'@univerjs-pro/license';import{IDrawingManagerService}from'@univerjs/drawing';const DEFAULT_SHAPE_WIDTH=0xc8,DEFAULT_SHAPE_HEIGHT=0xc8;function _typeof(_0x2669e1){'@babel/helpers - typeof';const _0x37c67b=_0x16de;return _typeof=_0x37c67b(0x159)==typeof Symbol&&'symbol'==typeof Symbol[_0x37c67b(0x156)]?function(_0x5e5feb){return typeof _0x5e5feb;}:function(_0x4c746f){const _0x1c219e=_0x37c67b;return _0x4c746f&&_0x1c219e(0x159)==typeof Symbol&&_0x4c746f[_0x1c219e(0x185)]===Symbol&&_0x4c746f!==Symbol[_0x1c219e(0x117)]?_0x1c219e(0x135):typeof _0x4c746f;},_typeof(_0x2669e1);}function toPrimitive(_0x54ee,_0x25aac4){const _0x53f496=_0x16de;if(_0x53f496(0x168)!=_typeof(_0x54ee)||!_0x54ee)return _0x54ee;var _0x2f5eee=_0x54ee[Symbol[_0x53f496(0x174)]];if(void 0x0!==_0x2f5eee){var _0x5366eb=_0x2f5eee[_0x53f496(0x18b)](_0x54ee,_0x25aac4||'default');if(_0x53f496(0x168)!=_typeof(_0x5366eb))return _0x5366eb;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x53f496(0x126)===_0x25aac4?String:Number)(_0x54ee);}function toPropertyKey(_0x36e67c){const _0x24f02e=_0x16de;var _0x2791d2=toPrimitive(_0x36e67c,_0x24f02e(0x126));return _0x24f02e(0x135)==_typeof(_0x2791d2)?_0x2791d2:_0x2791d2+'';}function _defineProperty(_0x1cc10b,_0x29ad56,_0x3472fc){return(_0x29ad56=toPropertyKey(_0x29ad56))in _0x1cc10b?Object['defineProperty'](_0x1cc10b,_0x29ad56,{'value':_0x3472fc,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1cc10b[_0x29ad56]=_0x3472fc,_0x1cc10b;}var SheetShapeModelManager=class extends Disposable{constructor(){const _0x272193=_0x16de;super(),_defineProperty(this,'_shapes',new Map()),_defineProperty(this,_0x272193(0x141),new Set()),_defineProperty(this,'_groupIds',new Set());}[_0x341a97(0x187)](_0x279b3a,_0x57ee2c,_0x587886){const _0x3cda98=_0x341a97,_0x8a372f=new ShapeModel(_0x279b3a,_0x57ee2c,_0x587886);this[_0x3cda98(0x13e)][_0x3cda98(0x119)](_0x57ee2c,_0x8a372f);if(isConnectorShape(_0x279b3a))this['_linesIds'][_0x3cda98(0x1ab)](_0x57ee2c);return _0x8a372f;}[_0x341a97(0x148)](_0x24a515){const _0x52779c=_0x341a97,_0x49a4f5=[];for(const _0x74d4ae of this[_0x52779c(0x141)]){const _0x111d4f=this[_0x52779c(0x13e)][_0x52779c(0x17f)](_0x74d4ae);if(_0x111d4f){const _0x4c0fb5=_0x111d4f['getShapeRelation']();if(_0x4c0fb5){var _0x3e2c62,_0x65980d;if(((_0x3e2c62=_0x4c0fb5[_0x52779c(0x11d)])===null||_0x3e2c62===void 0x0?void 0x0:_0x3e2c62['shapeId'])===_0x24a515)_0x49a4f5[_0x52779c(0x12d)]({..._0x4c0fb5[_0x52779c(0x11d)],'lineShapeId':_0x74d4ae,'isFrom':!![]});if(((_0x65980d=_0x4c0fb5['to'])===null||_0x65980d===void 0x0?void 0x0:_0x65980d[_0x52779c(0x125)])===_0x24a515)_0x49a4f5[_0x52779c(0x12d)]({..._0x4c0fb5['to'],'lineShapeId':_0x74d4ae,'isFrom':![]});}}}return _0x49a4f5;}[_0x341a97(0x12e)](_0x427227){const _0x5a542c=_0x341a97,_0x184419=this[_0x5a542c(0x13e)][_0x5a542c(0x17f)](_0x427227);if(_0x184419)return _0x184419['getShapeRelation']();}[_0x341a97(0x144)](_0x267b0e){const _0x5dd0c7=_0x341a97,_0x100caf=this[_0x5dd0c7(0x13e)][_0x5dd0c7(0x17f)](_0x267b0e);if(_0x100caf)return _0x100caf['getShapeType']();}[_0x341a97(0x12a)](_0x5bb6ba){const _0x1462c5=_0x341a97;return this['_shapes'][_0x1462c5(0x192)](_0x5bb6ba);}[_0x341a97(0x127)](_0x5a795d){const _0x52ee82=_0x341a97,_0x2e986a=this[_0x52ee82(0x13e)][_0x52ee82(0x17f)](_0x5a795d);if(!_0x2e986a)return;if(isConnectorShape(_0x2e986a[_0x52ee82(0x144)]()))this['_linesIds'][_0x52ee82(0x121)](_0x5a795d);this[_0x52ee82(0x13e)][_0x52ee82(0x121)](_0x5a795d);}[_0x341a97(0x131)](){const _0x474c3c=_0x341a97,_0x2955f3=[];return this[_0x474c3c(0x13e)]['forEach'](_0x44a1f8=>{const _0x51d558=_0x474c3c;_0x2955f3[_0x51d558(0x12d)](_0x44a1f8[_0x51d558(0x131)]());}),_0x2955f3;}['fromJSON'](_0x42f7a0){const _0x5a1bfd=_0x341a97;for(const _0x581ddf of _0x42f7a0){const {id:_0x5bde8a,shapeType:_0x489eb4}=_0x581ddf,_0x20fde0=this[_0x5a1bfd(0x187)](_0x489eb4,_0x5bde8a,_0x581ddf[_0x5a1bfd(0x176)]);if(_0x20fde0&&_0x20fde0[_0x5a1bfd(0x151)]())this[_0x5a1bfd(0x141)]['add'](_0x5bde8a);}}[_0x341a97(0x15b)](){const _0xd97997=_0x341a97;if(this[_0xd97997(0x166)])return;this[_0xd97997(0x13e)][_0xd97997(0x116)](_0x3468b4=>{const _0x42e427=_0xd97997;_0x3468b4[_0x42e427(0x15b)]();}),this[_0xd97997(0x13e)][_0xd97997(0x1a5)](),this[_0xd97997(0x141)][_0xd97997(0x1a5)](),this[_0xd97997(0x170)][_0xd97997(0x1a5)](),super['dispose']();}};function __decorateParam(_0x9bd393,_0x2844da){return function(_0x1827c0,_0x20c69a){_0x2844da(_0x1827c0,_0x20c69a,_0x9bd393);};}function __decorate(_0x2ae185,_0x46abe8,_0x254137,_0x114744){const _0x265121=_0x341a97;var _0x81c0e2=arguments[_0x265121(0x17c)],_0x55803d=_0x81c0e2<0x3?_0x46abe8:_0x114744===null?_0x114744=Object[_0x265121(0x12b)](_0x46abe8,_0x254137):_0x114744,_0x7744f1;if(typeof Reflect===_0x265121(0x168)&&typeof Reflect[_0x265121(0x122)]===_0x265121(0x159))_0x55803d=Reflect[_0x265121(0x122)](_0x2ae185,_0x46abe8,_0x254137,_0x114744);else{for(var _0x4934bb=_0x2ae185[_0x265121(0x17c)]-0x1;_0x4934bb>=0x0;_0x4934bb--)if(_0x7744f1=_0x2ae185[_0x4934bb])_0x55803d=(_0x81c0e2<0x3?_0x7744f1(_0x55803d):_0x81c0e2>0x3?_0x7744f1(_0x46abe8,_0x254137,_0x55803d):_0x7744f1(_0x46abe8,_0x254137))||_0x55803d;}return _0x81c0e2>0x3&&_0x55803d&&Object[_0x265121(0x194)](_0x46abe8,_0x254137,_0x55803d),_0x55803d;}const SHEET_SHAPE_PLUGIN=_0x341a97(0x186);let SheetsShapeService=class SheetsShapeService extends Disposable{constructor(_0x32407f){const _0x4c878e=_0x341a97;super(),this['_resourcesManagerService']=_0x32407f,_defineProperty(this,_0x4c878e(0x1a8),new Map()),this[_0x4c878e(0x183)]();}[_0x341a97(0x147)](_0x559ca7,_0x46b586){const _0x4d05a5=_0x341a97;let _0x46bc41=this['_shapeModelManagerMap'][_0x4d05a5(0x17f)](_0x559ca7);!_0x46bc41&&(_0x46bc41=new Map(),this[_0x4d05a5(0x1a8)][_0x4d05a5(0x119)](_0x559ca7,_0x46bc41));let _0x1daa2e=_0x46bc41[_0x4d05a5(0x17f)](_0x46b586);return!_0x1daa2e&&(_0x1daa2e=new SheetShapeModelManager(),_0x46bc41[_0x4d05a5(0x119)](_0x46b586,_0x1daa2e)),_0x1daa2e;}[_0x341a97(0x124)](_0xd1e571,_0x1027b7,_0x25a95a,_0x323e0b,_0x37da63){const _0x4dd39d=_0x341a97;this['_ensureShapeModelManager'](_0xd1e571,_0x1027b7)[_0x4dd39d(0x187)](_0x25a95a,_0x323e0b,_0x37da63);}[_0x341a97(0x127)](_0x4d38fa,_0x2e6a61,_0x24019c){const _0x48ef05=_0x341a97;this[_0x48ef05(0x147)](_0x4d38fa,_0x2e6a61)[_0x48ef05(0x127)](_0x24019c);}[_0x341a97(0x172)](_0x5b832f,_0x55bb92,_0x10bbbb){const _0xda7489=_0x341a97;return this[_0xda7489(0x147)](_0x5b832f,_0x55bb92)['getShapeType'](_0x10bbbb);}[_0x341a97(0x144)](_0x316469,_0x1806bb,_0x47b36e){const _0x3584b0=_0x341a97;return this[_0x3584b0(0x147)](_0x316469,_0x1806bb)[_0x3584b0(0x144)](_0x47b36e);}['hasShape'](_0x558732,_0x2b279a,_0x18d227){const _0x5b6701=_0x341a97;return this[_0x5b6701(0x147)](_0x558732,_0x2b279a)[_0x5b6701(0x12a)](_0x18d227);}[_0x341a97(0x18e)](_0x210b74,_0x24cda0,_0x1b8332){const _0x234d88=_0x341a97;return this[_0x234d88(0x147)](_0x210b74,_0x24cda0)[_0x234d88(0x144)](_0x1b8332);}[_0x341a97(0x19b)](_0x3f9f2d,_0x10abdb,_0x11fc0b){const _0x2a3bc9=_0x341a97,_0x3714bd=this[_0x2a3bc9(0x147)](_0x3f9f2d,_0x10abdb);if(!_0x3714bd[_0x2a3bc9(0x144)](_0x11fc0b))return;const _0x8588ad=_0x3714bd[_0x2a3bc9(0x13e)][_0x2a3bc9(0x17f)](_0x11fc0b);if(!_0x8588ad)return;return _0x8588ad[_0x2a3bc9(0x1a0)]();}[_0x341a97(0x16d)](_0x3c22e0,_0x1d9b4b,_0x515c85){return this['_ensureShapeModelManager'](_0x3c22e0,_0x1d9b4b)['_shapes']['get'](_0x515c85);}['getBasicShapeRelation'](_0x1bde01,_0x1e0f6e,_0x359289){return this['_ensureShapeModelManager'](_0x1bde01,_0x1e0f6e)['getBasicShapeRelation'](_0x359289);}[_0x341a97(0x12e)](_0x5efbda,_0x526671,_0x96b5b2){const _0x2ac4c4=_0x341a97,_0x4a3792=this[_0x2ac4c4(0x147)](_0x5efbda,_0x526671)[_0x2ac4c4(0x13e)][_0x2ac4c4(0x17f)](_0x96b5b2);if(!_0x4a3792)return;return _0x4a3792[_0x2ac4c4(0x18a)]();}[_0x341a97(0x198)](){}[_0x341a97(0x161)](_0x271158){const _0x1e14e4=_0x341a97,_0x37f95b={},_0x29ce57=this[_0x1e14e4(0x1a8)]['get'](_0x271158);if(_0x29ce57)_0x29ce57['forEach']((_0x2871ed,_0x1e9600)=>{const _0x4abc43=_0x1e14e4,_0x5384fd=_0x2871ed['toJSON']();if(_0x5384fd[_0x4abc43(0x17c)]>0x0)_0x37f95b[_0x1e9600]=_0x5384fd;});return JSON[_0x1e14e4(0x158)](_0x37f95b);}['_deserializeShapeForUnit'](_0x21f8f9,_0x1cf0fc){const _0x3fa576=_0x341a97;Object[_0x3fa576(0x118)](_0x1cf0fc)['forEach'](_0x5a9d62=>{const _0xa800df=_0x3fa576;this[_0xa800df(0x147)](_0x21f8f9,_0x5a9d62)['fromJSON'](_0x1cf0fc[_0x5a9d62]);});}[_0x341a97(0x131)](){const _0x4e5855=_0x341a97,_0x5beba2={};return this[_0x4e5855(0x1a8)][_0x4e5855(0x116)]((_0x153e29,_0x1bcbd6)=>{const _0x1ae90c=_0x4e5855;_0x5beba2[_0x1bcbd6]={},_0x153e29[_0x1ae90c(0x116)]((_0x296f6d,_0x28794d)=>{_0x5beba2[_0x1bcbd6][_0x28794d]=_0x296f6d['toJSON']();});}),_0x5beba2;}[_0x341a97(0x191)](_0x46108a){const _0x2221cf=_0x341a97;Object[_0x2221cf(0x118)](_0x46108a)[_0x2221cf(0x116)](_0x2b780b=>{const _0x5c191c=_0x46108a[_0x2b780b];Object['keys'](_0x5c191c)['forEach'](_0x168f91=>{const _0x42adc3=_0x16de;this['_ensureShapeModelManager'](_0x2b780b,_0x168f91)[_0x42adc3(0x191)](_0x5c191c[_0x168f91]);});});}['_initSnapshot'](){const _0x937193=_0x341a97;this[_0x937193(0x11b)][_0x937193(0x15e)]({'pluginName':SHEET_SHAPE_PLUGIN,'businesses':[UniverInstanceType[_0x937193(0x162)]],'toJson':_0x220d32=>this[_0x937193(0x161)](_0x220d32),'parseJson':_0x458af6=>JSON[_0x937193(0x14c)](_0x458af6),'onLoad':(_0x48b65a,_0x387713)=>{this['_deserializeShapeForUnit'](_0x48b65a,_0x387713);},'onUnLoad':_0x314f15=>{const _0x90b8ef=_0x937193,_0x3d7235=this[_0x90b8ef(0x1a8)][_0x90b8ef(0x17f)](_0x314f15);_0x3d7235&&(_0x3d7235[_0x90b8ef(0x116)](_0x35e3c3=>{const _0x249525=_0x90b8ef;_0x35e3c3[_0x249525(0x15b)]();}),this[_0x90b8ef(0x1a8)]['delete'](_0x314f15));}});}[_0x341a97(0x15b)](){const _0x235e58=_0x341a97;this[_0x235e58(0x1a8)]['forEach'](_0xec4182=>{const _0x445d10=_0x235e58;_0xec4182[_0x445d10(0x116)](_0x904b00=>{_0x904b00['dispose']();});});}};function _0x16de(_0x402efb,_0x2ea7c8){_0x402efb=_0x402efb-0x110;const _0x2d10cc=_0x2d10();let _0x16deec=_0x2d10cc[_0x402efb];return _0x16deec;}SheetsShapeService=__decorate([__decorateParam(0x0,IResourceManagerService)],SheetsShapeService);function _0x2d10(){const _0x4c1a7c=['get','sheet.command.set-shape-text-vertical-toggle','startX','fill','_initSnapshot','3167433KJfYbE','constructor','SHEET_SHAPE_PLUGIN','addShape','getAdjustValueByName','_addLineFollowShapeUpdates','getShapeRelation','call','getCellIndexAndOffsetByPosition','setShapeData','getShapeTypeById','registerCommand','5653774MGPmwG','fromJSON','has','getEndConnectInfo','defineProperty','setConfig','isHorizontal','pushUndoRedo','setShapeType','sheet.command.update-shape-type','@univerjs-pro/sheets-shape','getShapeDataById','rotateEnabled','Fail\x20to\x20get\x20shape\x20model,\x20get:\x20','ang','type','getShapeData','getDrawingByParam','ensureSkeleton','preRedos','3054546iKzjbQ','clear','_sheetsShapeService','adjustValues','_shapeModelManagerMap','MUTATION','worldRect','add','cxnIndex','45180070FIWdck','0.22.1','getDrawingData','sheet.command.update-line-shape-resize','width','forEach','prototype','keys','set','1srcwpK','_resourcesManagerService','_commandService','from','155MQXZrd','sheet.command.toggle-shape-flip','_addLineRerouteUpdates','delete','decorate','_injector','insertShape','shapeId','string','removeShape','_getConnectPointInfo','lineShapeId','hasShape','getOwnPropertyDescriptor','index','push','getLineShapeRelation','drawingType','getCellWithCoordByIndex','toJSON','onStarting','flipX','redos','symbol','sheet.mutation.update-shape-type','data','_drawingManagerService','_configService','COMMAND','top','DRAWING_SHAPE','flipY','_shapes','result','position','_linesIds','2486853XWgQPU','startY','getShapeType','pluginName','undos','_ensureShapeModelManager','getBasicShapeRelation','left','getSkeleton','getStartConnectInfo','parse','packageName','getBatchUpdateOp','_initCommandInterceptor','1303970XjErvP','isLineShape','sheets-shape.config','getConnectionSiteList','onCommandExecute','params','iterator','UPDATE','stringify','function','range','dispose','16INLsCw','getShapeTextData','registerPluginResource','cos','_initCommands','_serializeShapeForUnit','UNIVER_SHEET','preUndos','_sheetSkeletonService','height','_disposed','INSERT','object','borderEnabled','_config','interceptCommand','disposeWithMe','getShapeModel','getAdjustNames','lineType','_groupIds','_sheetInterceptorService','getBasicShapeType','removeLinePoints','toPrimitive','42236DLVzpz','shapeData','angle','isFrom','filter','resizeEnabled','sheet.command.update-connector-relation','length','relation','transform'];_0x2d10=function(){return _0x4c1a7c;};return _0x2d10();}const InsertSheetsShapeMutation={'id':'sheet.mutation.insert-shape','type':CommandType[_0x341a97(0x1a9)],'handler':(_0x1d32c0,_0x5360ae)=>{const _0x2138b1=_0x341a97,{unitId:_0x4ec7e5,subUnitId:_0x42eec3,shapeType:_0x2227f2,shapeId:_0x63442d,shapeData:_0x201495}=_0x5360ae;return _0x1d32c0['get'](SheetsShapeService)[_0x2138b1(0x124)](_0x4ec7e5,_0x42eec3,_0x2227f2,_0x63442d,_0x201495),!![];}},RemoveSheetsShapeMutation={'id':'sheet.mutation.remove-shape','type':CommandType[_0x341a97(0x1a9)],'handler':(_0x526b66,_0x3097df)=>{const _0x3dd609=_0x341a97,{unitId:_0xa54f39,subUnitId:_0x1de393,shapeId:_0x32c41c}=_0x3097df;return _0x526b66[_0x3dd609(0x17f)](SheetsShapeService)[_0x3dd609(0x127)](_0xa54f39,_0x1de393,_0x32c41c),!![];}},InsertShapeCommand={'type':CommandType[_0x341a97(0x13a)],'id':'sheet.command.insert-shape','handler':(_0x4c0466,_0x396c57)=>{const _0x5c8558=_0x341a97;var _0x2de56b,_0x94cb09;const _0x515c34=getSheetCommandTarget(_0x4c0466['get'](IUniverInstanceService),_0x396c57);if(!_0x515c34)return![];const _0x4db599=_0x4c0466['get'](SheetSkeletonService),{unitId:_0x31dcc9,subUnitId:_0x319fce}=_0x515c34,_0x4824ec=_0x4db599[_0x5c8558(0x1a2)](_0x31dcc9,_0x319fce);if(!_0x4824ec)return![];const _0x923d1a=_0x4c0466['get'](ICommandService),_0x3fd453=_0x4c0466[_0x5c8558(0x17f)](IUndoRedoService),_0x230197=_0x4c0466[_0x5c8558(0x17f)](SheetInterceptorService),_0x20770b=_0x4c0466[_0x5c8558(0x17f)](ISheetDrawingService),{shapeType:_0x1a0f34,shapeData:_0x34bcb3}=_0x396c57,_0x6a9ffe=_0x396c57[_0x5c8558(0x125)]||generateRandomId(),_0x4c7fd6={'unitId':_0x31dcc9,'subUnitId':_0x319fce,'shapeId':_0x6a9ffe,'shapeType':_0x1a0f34,'shapeData':_0x34bcb3},_0x3d0e0e=_0x396c57[_0x5c8558(0x115)]||0xc8,_0x57c21f=_0x396c57[_0x5c8558(0x165)]||0xc8;let _0x48aa94=0x0,_0x56c44c=0x0,_0x42c8ab={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0},_0x2c12d3={'row':0x0,'rowOffset':0x0,'column':0x0,'columnOffset':0x0};if(_0x396c57[_0x5c8558(0x140)]){const {x:_0x24fce8,y:_0x43d395}=_0x396c57['position'];_0x48aa94=_0x24fce8,_0x56c44c=_0x43d395,_0x42c8ab=_0x4824ec[_0x5c8558(0x18c)](_0x24fce8,_0x43d395),_0x2c12d3=_0x4824ec[_0x5c8558(0x18c)](_0x24fce8+_0x3d0e0e,_0x43d395+_0x57c21f);}else{if(_0x396c57[_0x5c8558(0x15a)]){const {startRow:_0x4590e4,startColumn:_0x497a90}=_0x396c57['range'],_0xedbba0=0xa,_0x53194e=0xa;_0x42c8ab={'row':_0x4590e4,'rowOffset':_0xedbba0,'column':_0x497a90,'columnOffset':_0x53194e};const _0x299300=_0x4824ec[_0x5c8558(0x130)](_0x4590e4,_0x497a90);_0x48aa94=_0x299300[_0x5c8558(0x181)]+_0x53194e,_0x56c44c=_0x299300[_0x5c8558(0x143)]+_0xedbba0,_0x2c12d3=_0x4824ec[_0x5c8558(0x18c)](_0x48aa94+_0x3d0e0e,_0x56c44c+_0x57c21f);}}const _0x1f6228={'from':_0x42c8ab,'to':_0x2c12d3},_0x4769a2={'unitId':_0x31dcc9,'subUnitId':_0x319fce,'drawingId':_0x6a9ffe,'drawingType':DrawingTypeEnum[_0x5c8558(0x13c)],'sheetTransform':_0x1f6228,'transform':{'left':_0x48aa94,'top':_0x56c44c,'width':_0x3d0e0e,'height':_0x57c21f},'data':{'shapeType':_0x1a0f34,'shapeData':_0x34bcb3},'axisAlignSheetTransform':_0x1f6228,'allowTransform':!![]};isConnectorShape(_0x1a0f34)&&(_0x4769a2[_0x5c8558(0x137)][_0x5c8558(0x182)]=![],_0x4769a2[_0x5c8558(0x137)]['rotateEnabled']=![],_0x4769a2[_0x5c8558(0x137)]['resizeEnabled']=![],_0x4769a2['data'][_0x5c8558(0x169)]=![],_0x4769a2[_0x5c8558(0x17e)][_0x5c8558(0x19c)]=![],_0x4769a2[_0x5c8558(0x17e)][_0x5c8558(0x17a)]=![],_0x4769a2[_0x5c8558(0x17e)][_0x5c8558(0x169)]=![]);const {undo:_0x451dbc,redo:_0x21dcc2,objects:_0x3eb3ff}=_0x20770b['getBatchAddOp']([_0x4769a2]),_0x817e0d=_0x230197[_0x5c8558(0x154)]({'id':InsertSheetDrawingCommand['id'],'params':{'unitId':_0x31dcc9,'drawings':[_0x4769a2]}}),_0x45f808=[...(_0x2de56b=_0x817e0d['preRedos'])!==null&&_0x2de56b!==void 0x0?_0x2de56b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x31dcc9,'subUnitId':_0x319fce,'op':_0x21dcc2,'objects':_0x3eb3ff,'type':DrawingApplyType[_0x5c8558(0x167)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x31dcc9]},..._0x817e0d[_0x5c8558(0x134)],{'id':InsertSheetsShapeMutation['id'],'params':_0x4c7fd6}],_0x50d74a=[{'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x31dcc9,'subUnitId':_0x319fce,'shapeId':_0x6a9ffe}},...(_0x94cb09=_0x817e0d['preUndos'])!==null&&_0x94cb09!==void 0x0?_0x94cb09:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x31dcc9,'subUnitId':_0x319fce,'op':_0x451dbc,'objects':_0x3eb3ff,'type':DrawingApplyType['REMOVE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x31dcc9]},..._0x817e0d[_0x5c8558(0x146)]];if(sequenceExecute(_0x45f808,_0x923d1a)[_0x5c8558(0x13f)])return _0x3fd453['pushUndoRedo']({'unitID':_0x31dcc9,'undoMutations':_0x50d74a,'redoMutations':_0x45f808}),!![];return![];}},UpdateSheetsShapeDataMutation={'id':'sheet.mutation.update-shape-data','type':CommandType[_0x341a97(0x1a9)],'handler':(_0x4fe054,_0x4135f5)=>{const _0x43f2a3=_0x341a97,{unitId:_0x5ea515,subUnitId:_0x5b4115,shapeType:_0x3bfdb2,shapeId:_0x3d543c,shapeData:_0x3e0d5d}=_0x4135f5,_0x11a179=_0x4fe054[_0x43f2a3(0x17f)](SheetsShapeService)['getShapeModel'](_0x5ea515,_0x5b4115,_0x3d543c);if(_0x11a179){if(_0x3bfdb2!==void 0x0)_0x11a179[_0x43f2a3(0x198)](_0x3bfdb2);if(_0x3e0d5d)_0x11a179===null||_0x11a179===void 0x0||_0x11a179['setShapeData'](_0x3e0d5d,!![]);}return!![];}},SetShapeDrawingDataCommand={'type':CommandType[_0x341a97(0x13a)],'id':'sheet.command.set-shape-drawing-data','handler':(_0x11dafe,_0x20fba0)=>{const _0x441b0d=_0x341a97;var _0x4a088f,_0x32f7ab;const _0x3fcd4c=getSheetCommandTarget(_0x11dafe['get'](IUniverInstanceService),_0x20fba0);if(!_0x3fcd4c)return![];const _0x1bca65=_0x11dafe['get'](SheetSkeletonService),{unitId:_0x4eab77,subUnitId:_0x745007}=_0x3fcd4c,_0x4ac798=_0x1bca65['ensureSkeleton'](_0x4eab77,_0x745007);if(!_0x4ac798)return![];const _0x552c21=_0x11dafe['get'](SheetsShapeService),{shapeId:_0x32a5b2,shapeType:_0x4f6aa6,shapeData:_0x469cbc,position:_0x42a4f8,width:_0x18c5de,height:_0x366661}=_0x20fba0,_0x22b269=_0x552c21[_0x441b0d(0x16d)](_0x4eab77,_0x745007,_0x32a5b2);if(!_0x22b269)return![];const _0xb405a1=_0x11dafe[_0x441b0d(0x17f)](ICommandService),_0x4951db=_0x11dafe['get'](IUndoRedoService),_0xd72277=_0x11dafe[_0x441b0d(0x17f)](SheetInterceptorService),_0xd92001=_0x11dafe[_0x441b0d(0x17f)](ISheetDrawingService),_0x46f7ad={'unitId':_0x4eab77,'subUnitId':_0x745007,'shapeId':_0x32a5b2,'shapeType':_0x4f6aa6,'shapeData':_0x469cbc},_0x20873c=_0x22b269[_0x441b0d(0x144)](),_0x555d73=_0x22b269[_0x441b0d(0x1a0)](),{x:_0x5a0711,y:_0x34ea67}=_0x42a4f8,_0x14c47f={'from':_0x4ac798['getCellIndexAndOffsetByPosition'](_0x5a0711,_0x34ea67),'to':_0x4ac798['getCellIndexAndOffsetByPosition'](_0x5a0711+_0x18c5de,_0x34ea67+_0x366661)},_0x54e06b={'unitId':_0x4eab77,'subUnitId':_0x745007,'drawingId':_0x32a5b2,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x14c47f,'transform':{'left':_0x5a0711,'top':_0x34ea67,'width':_0x18c5de,'height':_0x366661},'data':{'shapeType':_0x4f6aa6,'shapeData':_0x469cbc},'axisAlignSheetTransform':_0x14c47f,'allowTransform':!![]};isConnectorShape(_0x4f6aa6)&&(_0x54e06b['data'][_0x441b0d(0x182)]=![],_0x54e06b[_0x441b0d(0x137)][_0x441b0d(0x19c)]=![],_0x54e06b[_0x441b0d(0x137)][_0x441b0d(0x17a)]=![],_0x54e06b[_0x441b0d(0x137)][_0x441b0d(0x169)]=![],_0x54e06b['transform'][_0x441b0d(0x19c)]=![],_0x54e06b[_0x441b0d(0x17e)][_0x441b0d(0x17a)]=![],_0x54e06b['transform'][_0x441b0d(0x169)]=![]);const {undo:_0x512cb0,redo:_0x457490,objects:_0x2c0519}=_0xd92001[_0x441b0d(0x14e)]([_0x54e06b]),_0x248a34=_0xd72277['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x4eab77,'drawings':[_0x54e06b]}}),_0x4bb8cd=[...(_0x4a088f=_0x248a34[_0x441b0d(0x1a3)])!==null&&_0x4a088f!==void 0x0?_0x4a088f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4eab77,'subUnitId':_0x745007,'op':_0x457490,'objects':_0x2c0519,'type':DrawingApplyType[_0x441b0d(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4eab77]},..._0x248a34[_0x441b0d(0x134)],{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x46f7ad}],_0x101770=[...(_0x32f7ab=_0x248a34[_0x441b0d(0x163)])!==null&&_0x32f7ab!==void 0x0?_0x32f7ab:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x4eab77,'subUnitId':_0x745007,'op':_0x512cb0,'objects':_0x2c0519,'type':DrawingApplyType[_0x441b0d(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x4eab77]},..._0x248a34[_0x441b0d(0x146)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x4eab77,'subUnitId':_0x745007,'shapeType':_0x20873c,'shapeId':_0x32a5b2,'shapeData':_0x555d73}}];if(sequenceExecute(_0x4bb8cd,_0xb405a1)[_0x441b0d(0x13f)])return _0x4951db[_0x441b0d(0x197)]({'unitID':_0x4eab77,'undoMutations':_0x101770,'redoMutations':_0x4bb8cd}),!![];return![];}},ToggleSheetsShapeFlipCommand={'type':CommandType[_0x341a97(0x13a)],'id':_0x341a97(0x11f),'handler':(_0x15961c,_0x210597)=>{const _0x16ff56=_0x341a97;var _0x3a851a,_0x5eca0a;const _0xd7cde9=getSheetCommandTarget(_0x15961c['get'](IUniverInstanceService),_0x210597);if(!_0xd7cde9)return![];const _0x226829=_0x15961c[_0x16ff56(0x17f)](SheetSkeletonService),{unitId:_0x116fa8,subUnitId:_0x239305}=_0xd7cde9,_0x56efe4=_0x226829[_0x16ff56(0x14a)](_0x116fa8,_0x239305);if(!_0x56efe4)return![];const _0x1e0228=_0x15961c['get'](ISheetDrawingService),{shapeId:_0x121cec,flipH:_0x427530,flipV:_0x1dc414}=_0x210597,_0x392f0f=_0x1e0228[_0x16ff56(0x1a1)]({'unitId':_0x116fa8,'subUnitId':_0x239305,'drawingId':_0x121cec});if(!_0x392f0f)return![];const _0x1d28d0=_0x15961c[_0x16ff56(0x17f)](SheetsShapeService)[_0x16ff56(0x16d)](_0x116fa8,_0x239305,_0x121cec);if(!_0x1d28d0)return![];const _0xacb2cd=_0x15961c['get'](ICommandService),_0x49a2c5=_0x15961c['get'](IUndoRedoService),_0x35bacc=_0x15961c['get'](SheetInterceptorService),_0x486c91={..._0x392f0f[_0x16ff56(0x17e)]};if(_0x427530!==void 0x0)_0x486c91[_0x16ff56(0x133)]=!_0x486c91[_0x16ff56(0x133)];if(_0x1dc414!==void 0x0)_0x486c91[_0x16ff56(0x13d)]=!_0x486c91['flipY'];const _0x5e9727=transformToDrawingPosition(_0x486c91,_0x56efe4),_0x35b72d=transformToAxisAlignPosition(_0x486c91,_0x56efe4),_0x4ffc74=_0x1d28d0[_0x16ff56(0x144)](),_0xc05404=_0x1d28d0['getShapeData'](),_0x18960f={'unitId':_0x116fa8,'subUnitId':_0x239305,'drawingId':_0x121cec,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'sheetTransform':_0x5e9727,'transform':_0x486c91,'data':{'shapeType':_0x4ffc74,'shapeData':_0xc05404},'axisAlignSheetTransform':_0x35b72d,'allowTransform':!![]},{undo:_0x212cfb,redo:_0x103f5a,objects:_0x419ed7}=_0x1e0228[_0x16ff56(0x14e)]([_0x18960f]),_0x6575d3=_0x35bacc['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x116fa8,'drawings':[_0x18960f]}}),_0x27948e=[...(_0x3a851a=_0x6575d3[_0x16ff56(0x1a3)])!==null&&_0x3a851a!==void 0x0?_0x3a851a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'op':_0x103f5a,'objects':_0x419ed7,'type':DrawingApplyType[_0x16ff56(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x116fa8]},..._0x6575d3[_0x16ff56(0x134)]],_0x194211=[...(_0x5eca0a=_0x6575d3['preUndos'])!==null&&_0x5eca0a!==void 0x0?_0x5eca0a:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'op':_0x212cfb,'objects':_0x419ed7,'type':DrawingApplyType[_0x16ff56(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x116fa8]},..._0x6575d3[_0x16ff56(0x146)]];if(isConnectorShape(_0x4ffc74)){const _0x5a17fb=_0x1d28d0['getShapeRelation']();if(_0x5a17fb){const _0x4d4559={..._0x5a17fb};_0x4d4559[_0x16ff56(0x11d)]=void 0x0,_0x4d4559['to']=void 0x0,_0x27948e[_0x16ff56(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'shapeId':_0x121cec,'shapeType':_0x4ffc74,'shapeData':{'relation':_0x4d4559}}}),_0x194211['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x116fa8,'subUnitId':_0x239305,'shapeId':_0x121cec,'shapeType':_0x4ffc74,'shapeData':{'relation':_0x5a17fb}}});}}if(sequenceExecute(_0x27948e,_0xacb2cd)[_0x16ff56(0x13f)])return _0x49a2c5[_0x16ff56(0x197)]({'unitID':_0x116fa8,'undoMutations':_0x194211,'redoMutations':_0x27948e}),!![];return![];}},SetSheetsShapeRotateCommand={'type':CommandType[_0x341a97(0x13a)],'id':'sheet.command.set-shape-rotate','handler':(_0x26cd92,_0x7a8ba7)=>{const _0x2d6af2=_0x341a97;var _0x4b96b8,_0x55972b;const _0xe82bad=getSheetCommandTarget(_0x26cd92[_0x2d6af2(0x17f)](IUniverInstanceService),_0x7a8ba7);if(!_0xe82bad)return![];const _0x24a1a5=_0x26cd92[_0x2d6af2(0x17f)](SheetSkeletonService),{unitId:_0x3acd4d,subUnitId:_0x4d34e0}=_0xe82bad,_0x3ad027=_0x24a1a5[_0x2d6af2(0x14a)](_0x3acd4d,_0x4d34e0);if(!_0x3ad027)return![];const _0xb0da03=_0x26cd92['get'](ISheetDrawingService),{shapeId:_0xceb1c9,rotate:_0xcfdb3b}=_0x7a8ba7,_0x157100=_0xb0da03['getDrawingByParam']({'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'drawingId':_0xceb1c9});if(!_0x157100)return![];const _0x37271b=_0x26cd92[_0x2d6af2(0x17f)](SheetsShapeService)[_0x2d6af2(0x16d)](_0x3acd4d,_0x4d34e0,_0xceb1c9);if(!_0x37271b)return![];const _0x574c07=_0x26cd92[_0x2d6af2(0x17f)](ICommandService),_0x1dd945=_0x26cd92[_0x2d6af2(0x17f)](IUndoRedoService),_0x545699=_0x26cd92[_0x2d6af2(0x17f)](SheetInterceptorService),_0x2de8e2={..._0x157100['transform']};if(_0xcfdb3b!==void 0x0)_0x2de8e2[_0x2d6af2(0x177)]=(_0x2de8e2[_0x2d6af2(0x177)]||0x0)+_0xcfdb3b;const _0x44d370=transformToDrawingPosition(_0x2de8e2,_0x3ad027),_0x5c390e=transformToAxisAlignPosition(_0x2de8e2,_0x3ad027),_0x54b1b3=_0x37271b[_0x2d6af2(0x144)](),_0x3f8622=_0x37271b[_0x2d6af2(0x1a0)](),_0x7e192d={'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'drawingId':_0xceb1c9,'drawingType':DrawingTypeEnum[_0x2d6af2(0x13c)],'sheetTransform':_0x44d370,'transform':_0x2de8e2,'data':{'shapeType':_0x54b1b3,'shapeData':_0x3f8622},'axisAlignSheetTransform':_0x5c390e,'allowTransform':!![]},{undo:_0x4a7256,redo:_0x54d9cb,objects:_0xfccf9a}=_0xb0da03[_0x2d6af2(0x14e)]([_0x7e192d]),_0x323277=_0x545699[_0x2d6af2(0x154)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x3acd4d,'drawings':[_0x7e192d]}}),_0x466e57=[...(_0x4b96b8=_0x323277[_0x2d6af2(0x1a3)])!==null&&_0x4b96b8!==void 0x0?_0x4b96b8:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'op':_0x54d9cb,'objects':_0xfccf9a,'type':DrawingApplyType[_0x2d6af2(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x3acd4d]},..._0x323277['redos']],_0x59aa1c=[...(_0x55972b=_0x323277['preUndos'])!==null&&_0x55972b!==void 0x0?_0x55972b:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x3acd4d,'subUnitId':_0x4d34e0,'op':_0x4a7256,'objects':_0xfccf9a,'type':DrawingApplyType[_0x2d6af2(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x3acd4d]},..._0x323277[_0x2d6af2(0x146)]];if(sequenceExecute(_0x466e57,_0x574c07)[_0x2d6af2(0x13f)])return _0x1dd945[_0x2d6af2(0x197)]({'unitID':_0x3acd4d,'undoMutations':_0x59aa1c,'redoMutations':_0x466e57}),!![];return![];}},SetSheetsShapeTextVerticalToggleCommand={'type':CommandType[_0x341a97(0x13a)],'id':_0x341a97(0x180),'handler':(_0x2fc3c0,_0x83e9e8)=>{const _0x408c64=_0x341a97;var _0x11b845;const _0x155142=getSheetCommandTarget(_0x2fc3c0[_0x408c64(0x17f)](IUniverInstanceService),_0x83e9e8);if(!_0x155142)return![];const {unitId:_0x20614c,subUnitId:_0x37a35d}=_0x155142,{shapeId:_0x4a49ea}=_0x83e9e8,_0x35f10c=_0x2fc3c0[_0x408c64(0x17f)](SheetsShapeService)['getShapeModel'](_0x20614c,_0x37a35d,_0x4a49ea);if(!_0x35f10c)return![];const _0xd1dce5=_0x35f10c[_0x408c64(0x15d)](),_0x10f4f0=(_0x11b845=_0xd1dce5===null||_0xd1dce5===void 0x0?void 0x0:_0xd1dce5[_0x408c64(0x196)])!==null&&_0x11b845!==void 0x0?_0x11b845:!![],_0xd70d8a=!_0x10f4f0,_0x21756a=_0x2fc3c0[_0x408c64(0x17f)](ICommandService),_0x5c2fb7=_0x2fc3c0[_0x408c64(0x17f)](IUndoRedoService),_0x2ce2a9={'unitId':_0x20614c,'subUnitId':_0x37a35d,'shapeId':_0x4a49ea,'shapeData':{'shapeText':{'isHorizontal':_0xd70d8a}}},_0x453dc5={'unitId':_0x20614c,'subUnitId':_0x37a35d,'shapeId':_0x4a49ea,'shapeData':{'shapeText':{'isHorizontal':_0x10f4f0}}},_0x5ca4a2=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x2ce2a9}],_0x5e4330=[{'id':UpdateSheetsShapeDataMutation['id'],'params':_0x453dc5}];if(sequenceExecute(_0x5ca4a2,_0x21756a)['result'])return _0x5c2fb7[_0x408c64(0x197)]({'unitID':_0x20614c,'undoMutations':_0x5e4330,'redoMutations':_0x5ca4a2}),!![];return![];}},UpdateConnectorRelationCommand={'type':CommandType[_0x341a97(0x13a)],'id':_0x341a97(0x17b),'handler':(_0x46efbc,_0x30959f)=>{const _0x1938ab=_0x341a97;var _0x16e480,_0x56ad39,_0x14b513,_0x54064f;const _0x153ded=getSheetCommandTarget(_0x46efbc[_0x1938ab(0x17f)](IUniverInstanceService),_0x30959f);if(!_0x153ded)return![];const _0x317455=_0x46efbc['get'](SheetSkeletonService),{unitId:_0x45c90e,subUnitId:_0x4153c6}=_0x153ded,_0x4b8984=_0x317455['getSkeleton'](_0x45c90e,_0x4153c6);if(!_0x4b8984)return![];const _0x1e370b=_0x46efbc[_0x1938ab(0x17f)](ISheetDrawingService),{connectorShapeId:_0xc75386,width:_0x4e428a,height:_0x4dd56b,left:_0x53385a,top:_0x47794d,flipX:_0x42826e,flipY:_0x50f0d5,rotation:_0x3896c1,oldAdjustValues:_0x5ddb7e,newAdjustValues:_0x154331,oldLineType:_0x2975cf,newLineType:_0x8ef532,oldRelation:_0x3163b7,newRelation:_0x35a282}=_0x30959f,_0x2bff1e=_0x1e370b['getDrawingByParam']({'unitId':_0x45c90e,'subUnitId':_0x4153c6,'drawingId':_0xc75386});if(!_0x2bff1e)return![];const _0x346660=_0x46efbc[_0x1938ab(0x17f)](SheetsShapeService)[_0x1938ab(0x16d)](_0x45c90e,_0x4153c6,_0xc75386);if(!_0x346660)return![];const _0x3a4bb6=_0x46efbc[_0x1938ab(0x17f)](ICommandService),_0x45d8b1=_0x46efbc[_0x1938ab(0x17f)](IUndoRedoService),_0x45b2fb=_0x46efbc[_0x1938ab(0x17f)](SheetInterceptorService),_0x490df8={..._0x2bff1e['transform'],'width':_0x4e428a,'height':_0x4dd56b,'left':_0x53385a,'top':_0x47794d,'flipX':_0x42826e,'flipY':_0x50f0d5,'angle':(_0x16e480=_0x3896c1!==null&&_0x3896c1!==void 0x0?_0x3896c1:(_0x56ad39=_0x2bff1e[_0x1938ab(0x17e)])===null||_0x56ad39===void 0x0?void 0x0:_0x56ad39[_0x1938ab(0x177)])!==null&&_0x16e480!==void 0x0?_0x16e480:0x0},_0x4c9ec7=transformToDrawingPosition(_0x490df8,_0x4b8984),_0x473bca=transformToAxisAlignPosition(_0x490df8,_0x4b8984),_0x51c1f7=_0x346660[_0x1938ab(0x144)](),_0x4cb55e=_0x346660[_0x1938ab(0x1a0)](),_0x1f286c={'unitId':_0x45c90e,'subUnitId':_0x4153c6,'drawingId':_0xc75386,'drawingType':DrawingTypeEnum[_0x1938ab(0x13c)],'sheetTransform':_0x4c9ec7,'transform':_0x490df8,'data':{'shapeType':_0x8ef532||_0x2975cf||_0x51c1f7,'shapeData':{..._0x4cb55e,'adjustValues':_0x154331||_0x5ddb7e||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x1a7)]),'relation':_0x35a282||_0x3163b7||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x17d)])}},'axisAlignSheetTransform':_0x473bca,'allowTransform':!![]},{undo:_0xcf3d79,redo:_0x307c1b,objects:_0x341393}=_0x1e370b[_0x1938ab(0x14e)]([_0x1f286c]),_0x4a8d0c=_0x45b2fb['onCommandExecute']({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x45c90e,'drawings':[_0x1f286c]}}),_0x34e09f=[...(_0x14b513=_0x4a8d0c[_0x1938ab(0x1a3)])!==null&&_0x14b513!==void 0x0?_0x14b513:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'op':_0x307c1b,'objects':_0x341393,'type':DrawingApplyType[_0x1938ab(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x45c90e]},..._0x4a8d0c[_0x1938ab(0x134)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'shapeId':_0xc75386,'shapeType':_0x8ef532,'shapeData':{'adjustValues':_0x154331,'relation':_0x35a282}}}],_0x5c9f86=[...(_0x54064f=_0x4a8d0c['preUndos'])!==null&&_0x54064f!==void 0x0?_0x54064f:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'op':_0xcf3d79,'objects':_0x341393,'type':DrawingApplyType[_0x1938ab(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x45c90e]},..._0x4a8d0c[_0x1938ab(0x146)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x45c90e,'subUnitId':_0x4153c6,'shapeId':_0xc75386,'shapeType':_0x51c1f7,'shapeData':{..._0x4cb55e,'adjustValues':_0x5ddb7e||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x1a7)]),'relation':_0x3163b7||(_0x4cb55e===null||_0x4cb55e===void 0x0?void 0x0:_0x4cb55e[_0x1938ab(0x17d)])}}}];if(sequenceExecute(_0x34e09f,_0x3a4bb6)[_0x1938ab(0x13f)])return _0x45d8b1[_0x1938ab(0x197)]({'unitID':_0x45c90e,'undoMutations':_0x5c9f86,'redoMutations':_0x34e09f}),!![];return![];}},UpdateLineShapeResizeCommand={'type':CommandType['COMMAND'],'id':_0x341a97(0x114),'handler':(_0x1f13ce,_0x42dec3)=>{const _0x146e4a=_0x341a97;var _0x17fba3,_0x5b7ce6;const _0x4ce93b=getSheetCommandTarget(_0x1f13ce['get'](IUniverInstanceService),_0x42dec3);if(!_0x4ce93b)return![];const _0x3e63bb=_0x1f13ce[_0x146e4a(0x17f)](SheetSkeletonService),{unitId:_0x20b49b,subUnitId:_0x5a9bb0}=_0x4ce93b,_0x2cc0ee=_0x3e63bb['getSkeleton'](_0x20b49b,_0x5a9bb0);if(!_0x2cc0ee)return![];const _0x2eab1b=_0x1f13ce['get'](ISheetDrawingService),{shapeId:_0x1551b2,width:_0xba5c2c,height:_0x12f435,left:_0x2de522,top:_0x4b0e11,flipX:_0x24a8e0,flipY:_0x20ab62,angle:_0x4d649d,oldAdjustValues:_0x204c6b,newAdjustValues:_0x34fce7,oldLineType:_0x18686f,newLineType:_0x8b81c4}=_0x42dec3,_0x57d9d6=_0x2eab1b[_0x146e4a(0x1a1)]({'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'drawingId':_0x1551b2});if(!_0x57d9d6)return![];const _0x2400b4=_0x1f13ce[_0x146e4a(0x17f)](SheetsShapeService)['getShapeModel'](_0x20b49b,_0x5a9bb0,_0x1551b2);if(!_0x2400b4)return![];const _0x8621d0=_0x1f13ce['get'](ICommandService),_0x5d95f3=_0x1f13ce[_0x146e4a(0x17f)](IUndoRedoService),_0x4c15da=_0x1f13ce[_0x146e4a(0x17f)](SheetInterceptorService),_0x336f73={..._0x57d9d6['transform'],'width':_0xba5c2c,'height':_0x12f435,'left':_0x2de522,'top':_0x4b0e11,'flipX':_0x24a8e0,'flipY':_0x20ab62,'angle':_0x4d649d},_0xe4bdd0=transformToDrawingPosition(_0x336f73,_0x2cc0ee),_0x48a849=transformToAxisAlignPosition(_0x336f73,_0x2cc0ee),_0x92cc2a=_0x2400b4['getShapeType'](),_0x3f58e3=_0x2400b4[_0x146e4a(0x1a0)](),_0x98ff93={'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'drawingId':_0x1551b2,'drawingType':DrawingTypeEnum[_0x146e4a(0x13c)],'sheetTransform':_0xe4bdd0,'transform':_0x336f73,'data':{'shapeType':_0x8b81c4||_0x18686f||_0x92cc2a,'shapeData':{..._0x3f58e3,'adjustValues':_0x34fce7||_0x204c6b||(_0x3f58e3===null||_0x3f58e3===void 0x0?void 0x0:_0x3f58e3[_0x146e4a(0x1a7)])}},'axisAlignSheetTransform':_0x48a849,'allowTransform':!![]},{undo:_0xb8eb7b,redo:_0x5520e5,objects:_0x173ef0}=_0x2eab1b[_0x146e4a(0x14e)]([_0x98ff93]),_0x35bc12=_0x4c15da[_0x146e4a(0x154)]({'id':SetSheetDrawingCommand['id'],'params':{'unitId':_0x20b49b,'drawings':[_0x98ff93]}}),_0x2ab597=[...(_0x17fba3=_0x35bc12[_0x146e4a(0x1a3)])!==null&&_0x17fba3!==void 0x0?_0x17fba3:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'op':_0x5520e5,'objects':_0x173ef0,'type':DrawingApplyType[_0x146e4a(0x157)]}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x20b49b]},..._0x35bc12[_0x146e4a(0x134)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'shapeId':_0x1551b2,'shapeType':_0x8b81c4,'shapeData':{'adjustValues':_0x34fce7}}}],_0x3b08e4=[...(_0x5b7ce6=_0x35bc12[_0x146e4a(0x163)])!==null&&_0x5b7ce6!==void 0x0?_0x5b7ce6:[],{'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'op':_0xb8eb7b,'objects':_0x173ef0,'type':DrawingApplyType['UPDATE']}},{'id':ClearSheetDrawingTransformerOperation['id'],'params':[_0x20b49b]},..._0x35bc12[_0x146e4a(0x146)],{'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x20b49b,'subUnitId':_0x5a9bb0,'shapeId':_0x1551b2,'shapeType':_0x92cc2a,'shapeData':{..._0x3f58e3,'adjustValues':_0x204c6b||(_0x3f58e3===null||_0x3f58e3===void 0x0?void 0x0:_0x3f58e3['adjustValues'])}}}];if(sequenceExecute(_0x2ab597,_0x8621d0)[_0x146e4a(0x13f)])return _0x5d95f3['pushUndoRedo']({'unitID':_0x20b49b,'undoMutations':_0x3b08e4,'redoMutations':_0x2ab597}),!![];return![];}},UpdateSheetsShapeTypeMutation={'id':_0x341a97(0x136),'type':CommandType[_0x341a97(0x1a9)],'handler':(_0x1a4d66,_0x5f0800)=>{const _0x374d14=_0x341a97,{unitId:_0x44794d,subUnitId:_0x11b27c,shapeType:_0x5462e4,shapeId:_0x167f93,shapeData:_0x3f0d8a}=_0x5f0800,_0x4630b9=_0x1a4d66[_0x374d14(0x17f)](SheetsShapeService)['getShapeModel'](_0x44794d,_0x11b27c,_0x167f93);if(_0x4630b9){_0x4630b9[_0x374d14(0x198)](_0x5462e4);if(_0x3f0d8a)_0x4630b9===null||_0x4630b9===void 0x0||_0x4630b9[_0x374d14(0x18d)](_0x3f0d8a);}return!![];}},UpdateSheetsShapeTypeCommand={'id':_0x341a97(0x199),'type':CommandType[_0x341a97(0x13a)],'handler':(_0x1f98e9,_0x2b8649)=>{const _0x572eb4=_0x341a97;if(!_0x2b8649)return![];const _0x10e09e=_0x1f98e9['get'](ICommandService),_0x122434=_0x1f98e9[_0x572eb4(0x17f)](SheetsShapeService),_0x5c42f2=_0x1f98e9[_0x572eb4(0x17f)](IUndoRedoService),_0x261d1a=[],_0x5f9b68=[],{unitId:_0x1a0385,subUnitId:_0x4b33ef,shapeId:_0x32001a,shapeType:_0x1ea431,shapeData:_0x22e565}=_0x2b8649,_0xa5638=_0x122434['getShapeModel'](_0x1a0385,_0x4b33ef,_0x32001a);if(_0xa5638){const _0x261ede=_0xa5638['getShapeType'](),_0x5460fb=Object['assign']({},_0xa5638[_0x572eb4(0x1a0)]()),_0x3a8d7c={'unitId':_0x1a0385,'subUnitId':_0x4b33ef,'shapeId':_0x32001a,'shapeType':_0x1ea431,'shapeData':_0x22e565},_0x461769={'unitId':_0x1a0385,'subUnitId':_0x4b33ef,'shapeId':_0x32001a,'shapeType':_0x261ede,'shapeData':_0x5460fb};_0x261d1a[_0x572eb4(0x12d)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x3a8d7c}),_0x5f9b68[_0x572eb4(0x12d)]({'id':UpdateSheetsShapeTypeMutation['id'],'params':_0x461769});if(_0x261d1a['every'](_0x4fc471=>_0x10e09e['syncExecuteCommand'](_0x4fc471['id'],_0x4fc471[_0x572eb4(0x155)])))_0x5c42f2['pushUndoRedo']({'unitID':_0x1a0385,'redoMutations':[..._0x261d1a],'undoMutations':[..._0x5f9b68]});return!![];}return![];}};var name=_0x341a97(0x19a),version=_0x341a97(0x112);const SHEETS_SHAPE_PLUGIN_CONFIG_KEY=_0x341a97(0x152),configSymbol=Symbol(SHEETS_SHAPE_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsShapeController=class SheetsShapeController extends Disposable{constructor(_0x55ecd7,_0x2780d7,_0x2427e8,_0x5bd2f,_0x2c5182){const _0x432e5a=_0x341a97;super(),this[_0x432e5a(0x11c)]=_0x55ecd7,this[_0x432e5a(0x171)]=_0x2780d7,this[_0x432e5a(0x164)]=_0x2427e8,this[_0x432e5a(0x1a6)]=_0x5bd2f,this[_0x432e5a(0x138)]=_0x2c5182,this[_0x432e5a(0x160)](),this[_0x432e5a(0x14f)]();}[_0x341a97(0x160)](){const _0x21a786=_0x341a97;[InsertShapeCommand,SetShapeDrawingDataCommand,ToggleSheetsShapeFlipCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,UpdateSheetsShapeTypeMutation,UpdateSheetsShapeDataMutation][_0x21a786(0x116)](_0x29f886=>this[_0x21a786(0x16c)](this[_0x21a786(0x11c)][_0x21a786(0x18f)](_0x29f886)));}['_initCommandInterceptor'](){const _0x25fcf4=_0x341a97;this['disposeWithMe'](this[_0x25fcf4(0x171)][_0x25fcf4(0x16b)]({'getMutations':_0x2d12b5=>{const _0x26fbb5=_0x25fcf4;if(_0x2d12b5['id']===RemoveSheetDrawingCommand['id']){const {drawings:_0x10f03a}=_0x2d12b5[_0x26fbb5(0x155)],_0x23e175=_0x10f03a[_0x26fbb5(0x179)](_0x1d903c=>_0x1d903c[_0x26fbb5(0x12f)]===DrawingTypeEnum['DRAWING_SHAPE']);if(_0x23e175[_0x26fbb5(0x17c)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x3484da=[],_0x3e5bb2=[];return _0x23e175[_0x26fbb5(0x116)](_0x35020a=>{const _0x4f0835=_0x26fbb5,{unitId:_0x39af9f,subUnitId:_0xaf745,drawingId:_0x18c98a}=_0x35020a,_0x4550d7=this[_0x4f0835(0x1a6)]['getShapeModel'](_0x39af9f,_0xaf745,_0x18c98a);if(!_0x4550d7)throw new TypeError(_0x4f0835(0x19d)+_0x4550d7);_0x3484da['push']({'id':RemoveSheetsShapeMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x18c98a}}),_0x3e5bb2[_0x4f0835(0x12d)]({'id':InsertSheetsShapeMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x18c98a,'shapeType':_0x4550d7[_0x4f0835(0x144)](),'shapeData':_0x4550d7[_0x4f0835(0x1a0)]()}});const _0x13aba7=this[_0x4f0835(0x1a6)][_0x4f0835(0x148)](_0x39af9f,_0xaf745,_0x18c98a);if(_0x13aba7)for(const _0x5002e7 of _0x13aba7){const _0x21c301=_0x5002e7[_0x4f0835(0x129)],_0x5d795c=_0x5002e7[_0x4f0835(0x178)],_0x3165cf=_0x5d795c?{'from':void 0x0}:{'to':void 0x0},_0x4efe4b=_0x5d795c?{'from':{'shapeId':_0x5002e7[_0x4f0835(0x125)],'cxnIndex':_0x5002e7[_0x4f0835(0x110)]}}:{'to':{'shapeId':_0x5002e7[_0x4f0835(0x125)],'cxnIndex':_0x5002e7[_0x4f0835(0x110)]}};_0x3484da['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x21c301,'shapeData':{'relation':_0x3165cf}}}),_0x3e5bb2[_0x4f0835(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x39af9f,'subUnitId':_0xaf745,'shapeId':_0x21c301,'shapeData':{'relation':_0x4efe4b}}});}}),{'preRedos':_0x3484da,'redos':[],'preUndos':[],'undos':_0x3e5bb2};}if(_0x2d12b5['id']===SetSheetDrawingCommand['id']){const {drawings:_0x318d17}=_0x2d12b5[_0x26fbb5(0x155)],_0x1a5143=_0x318d17[_0x26fbb5(0x179)](_0x3f8f45=>_0x3f8f45[_0x26fbb5(0x12f)]===DrawingTypeEnum[_0x26fbb5(0x13c)]);if(_0x1a5143[_0x26fbb5(0x17c)]===0x0)return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};const _0x13dbef=[],_0x42792b=[];for(const _0x7e791f of _0x1a5143){const {unitId:_0x234d0e,subUnitId:_0x2e9720,drawingId:_0xb56d0e,transform:_0x78dd7e}=_0x7e791f;if(!_0x234d0e||!_0x2e9720||!_0xb56d0e||!_0x78dd7e)continue;const _0x421265=this[_0x26fbb5(0x1a6)][_0x26fbb5(0x16d)](_0x234d0e,_0x2e9720,_0xb56d0e);if(!_0x421265)throw new TypeError('Fail\x20to\x20get\x20shape\x20model,\x20get:\x20'+_0x421265);if(isConnectorShape(_0x421265['getShapeType']())){const _0x38c47f=this[_0x26fbb5(0x1a6)]['getLineShapeRelation'](_0x234d0e,_0x2e9720,_0xb56d0e),_0x259fe4={'from':void 0x0,'to':void 0x0};_0x38c47f&&(_0x13dbef['push']({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x234d0e,'subUnitId':_0x2e9720,'shapeId':_0xb56d0e,'shapeData':{'relation':_0x259fe4}}}),_0x42792b[_0x26fbb5(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x234d0e,'subUnitId':_0x2e9720,'shapeId':_0xb56d0e,'shapeData':{'relation':_0x38c47f}}}));}else{const _0x4e7133=this['_sheetsShapeService'][_0x26fbb5(0x148)](_0x234d0e,_0x2e9720,_0xb56d0e);if(_0x4e7133&&_0x4e7133[_0x26fbb5(0x17c)]>0x0)for(const _0x16a20f of _0x4e7133){const _0x1434e2=_0x16a20f[_0x26fbb5(0x129)],_0x1eee69=_0x16a20f['isFrom'],_0x22d791=this[_0x26fbb5(0x1a6)][_0x26fbb5(0x16d)](_0x234d0e,_0x2e9720,_0x1434e2);if(!_0x22d791)continue;const _0x5bea7b=_0x22d791[_0x26fbb5(0x14b)](),_0x31c2e0=_0x22d791['getEndConnectInfo']();if(_0x5bea7b&&_0x31c2e0)this[_0x26fbb5(0x120)](_0x234d0e,_0x2e9720,_0x1434e2,_0x22d791,_0x5bea7b,_0x31c2e0,_0x13dbef,_0x42792b,_0xb56d0e,_0x78dd7e);else this[_0x26fbb5(0x189)](_0x234d0e,_0x2e9720,_0x1434e2,_0x22d791,_0x1eee69?_0x5bea7b:_0x31c2e0,_0x1eee69,_0x13dbef,_0x42792b,_0xb56d0e,_0x78dd7e);}}}return{'preRedos':[],'redos':_0x13dbef,'preUndos':_0x42792b,'undos':[]};}return{'preRedos':[],'redos':[],'preUndos':[],'undos':[]};}}));}[_0x341a97(0x128)](_0x53b388,_0x58614f,_0xe14842,_0x5d5a26,_0x47e603){const _0x46f1ec=_0x341a97;if(!_0x58614f||!_0xe14842)return null;const {shapeId:_0x46bdce,cxnIndex:_0x261feb}=_0x53b388,_0x1b1757=this[_0x46f1ec(0x1a6)]['getShapeModel'](_0x58614f,_0xe14842,_0x46bdce);if(!_0x1b1757)return null;const _0x4bf59c=this['_drawingManagerService'][_0x46f1ec(0x1a1)]({'unitId':_0x58614f,'subUnitId':_0xe14842,'drawingId':_0x46bdce});if(!(_0x4bf59c===null||_0x4bf59c===void 0x0?void 0x0:_0x4bf59c[_0x46f1ec(0x17e)]))return null;let {left:left=0x0,top:top=0x0,width:width=0x0,height:height=0x0,flipX:flipX=![],flipY:flipY=![],angle:_0x5b5bac}=_0x4bf59c[_0x46f1ec(0x17e)];if(_0x47e603&&_0x5d5a26===_0x46bdce){var _0x259e62,_0x445f7c,_0x1590e7,_0x14f501,_0x42aff3,_0x17cd8b,_0x45b485;left=(_0x259e62=_0x47e603['left'])!==null&&_0x259e62!==void 0x0?_0x259e62:left,top=(_0x445f7c=_0x47e603[_0x46f1ec(0x13b)])!==null&&_0x445f7c!==void 0x0?_0x445f7c:top,width=(_0x1590e7=_0x47e603[_0x46f1ec(0x115)])!==null&&_0x1590e7!==void 0x0?_0x1590e7:width,height=(_0x14f501=_0x47e603[_0x46f1ec(0x165)])!==null&&_0x14f501!==void 0x0?_0x14f501:height,flipX=(_0x42aff3=_0x47e603['flipX'])!==null&&_0x42aff3!==void 0x0?_0x42aff3:flipX,flipY=(_0x17cd8b=_0x47e603[_0x46f1ec(0x13d)])!==null&&_0x17cd8b!==void 0x0?_0x17cd8b:flipY,_0x5b5bac=(_0x45b485=_0x47e603[_0x46f1ec(0x177)])!==null&&_0x45b485!==void 0x0?_0x45b485:_0x5b5bac;}_0x1b1757['updateContext']({'width':width,'height':height});const _0x27df96=_0x1b1757[_0x46f1ec(0x153)]()['find'](_0x793e08=>_0x793e08[_0x46f1ec(0x12c)]===_0x261feb);if(!_0x27df96)return null;let _0x1c22a3=flipX?width-_0x27df96['x']:_0x27df96['x'],_0x49b04d=flipY?height-_0x27df96['y']:_0x27df96['y'];if(_0x5b5bac!==0x0&&_0x5b5bac!==void 0x0&&_0x5b5bac!==null){const _0x334e1d=_0x5b5bac*Math['PI']/0xb4,_0x388bf4=Math[_0x46f1ec(0x15f)](_0x334e1d),_0x1fdb65=Math['sin'](_0x334e1d),_0x17c5b5=width/0x2,_0x4cd26f=height/0x2,_0x712111=_0x1c22a3-_0x17c5b5,_0x3cac0c=_0x49b04d-_0x4cd26f;_0x1c22a3=_0x17c5b5+_0x712111*_0x388bf4-_0x3cac0c*_0x1fdb65,_0x49b04d=_0x4cd26f+_0x712111*_0x1fdb65+_0x3cac0c*_0x388bf4;}_0x1c22a3+=left,_0x49b04d+=top;let _0x42b729=_0x27df96[_0x46f1ec(0x19e)]/0xea60;if(flipX)_0x42b729=0xb4-_0x42b729;if(flipY)_0x42b729=-_0x42b729;_0x42b729+=_0x5b5bac||0x0,_0x42b729=(_0x42b729%0x168+0x168)%0x168;const _0x3e27e2=getBasicShapeRotateBound({'left':left,'top':top,'width':width,'height':height},_0x5b5bac||0x0);return{'point':{'x':_0x1c22a3,'y':_0x49b04d},'angle':_0x42b729,'bounds':_0x3e27e2};}[_0x341a97(0x120)](_0x898107,_0x120937,_0x25dd1d,_0x529417,_0x13b2a7,_0x1fce68,_0x324e27,_0x360b13,_0x5af694,_0x21d4c0){const _0x159015=_0x341a97,_0x4df202=this[_0x159015(0x164)][_0x159015(0x14a)](_0x898107,_0x120937);if(!_0x4df202)return;const _0x100869=_0x529417[_0x159015(0x18a)](),_0x1c80c6=_0x529417[_0x159015(0x16e)](),_0x47609e={},_0x21c28d={};_0x1c80c6[_0x159015(0x116)](_0x10c5a6=>{const _0x4230ad=_0x159015,_0x20c6ab=_0x529417[_0x4230ad(0x188)](_0x10c5a6);_0x21c28d[_0x10c5a6]=_0x20c6ab!==null&&_0x20c6ab!==void 0x0?_0x20c6ab:0x0;});const _0x1da5ba=this[_0x159015(0x128)](_0x13b2a7,_0x898107,_0x120937,_0x5af694,_0x21d4c0),_0x50a22f=this[_0x159015(0x128)](_0x1fce68,_0x898107,_0x120937,_0x5af694,_0x21d4c0);if(_0x1da5ba&&_0x50a22f){const _0x5932ad=_0x529417['getShapeType'](),_0x483feb=routeConnectorLineShape(_0x1da5ba,_0x50a22f,_0x5932ad);let _0x24e160=_0x5932ad;if(_0x483feb){const _0x29572c=computeConnectorRouteLayout(_0x483feb,_0x529417[_0x159015(0x144)]()),_0x795777=this['_drawingManagerService'][_0x159015(0x113)](_0x898107,_0x120937);if(_0x795777&&_0x795777[_0x25dd1d]){const _0x4a0b79=_0x795777[_0x25dd1d];_0x24e160=_0x29572c[_0x159015(0x16f)];for(const [_0x520860,_0x3ec193]of Object['entries'](_0x29572c[_0x159015(0x1a7)]))_0x47609e[_0x520860]=_0x3ec193;const _0x142e68={..._0x4a0b79[_0x159015(0x17e)],'width':_0x29572c['worldRect'][_0x159015(0x115)],'height':_0x29572c[_0x159015(0x1aa)]['height'],'left':_0x29572c['worldRect'][_0x159015(0x149)],'top':_0x29572c[_0x159015(0x1aa)][_0x159015(0x13b)],'flipX':_0x29572c[_0x159015(0x1aa)]['flipX'],'flipY':_0x29572c[_0x159015(0x1aa)]['flipY'],'angle':_0x29572c['rotation']},_0x496876=transformToDrawingPosition(_0x142e68,_0x4df202),_0x563867=transformToAxisAlignPosition(_0x142e68,_0x4df202),_0xc3d02c={'unitId':_0x898107,'subUnitId':_0x120937,'drawingType':DrawingTypeEnum[_0x159015(0x13c)],'drawingId':_0x25dd1d,'transform':_0x142e68,'sheetTransform':_0x496876,'axisAlignSheetTransform':_0x563867},{unitId:_0x53cd12,subUnitId:_0x4f6a54,undo:_0x2821c6,redo:_0x255e66,objects:_0x2be59}=this['_drawingManagerService'][_0x159015(0x14e)]([_0xc3d02c]);_0x324e27[_0x159015(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x53cd12,'subUnitId':_0x4f6a54,'op':_0x255e66,'objects':_0x2be59,'type':DrawingApplyType['UPDATE']}}),_0x360b13[_0x159015(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x53cd12,'subUnitId':_0x4f6a54,'op':_0x2821c6,'objects':_0x2be59,'type':DrawingApplyType[_0x159015(0x157)]}});}_0x529417[_0x159015(0x173)]();}_0x324e27[_0x159015(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x898107,'subUnitId':_0x120937,'shapeId':_0x25dd1d,'shapeType':_0x24e160,'shapeData':{'adjustValues':_0x47609e,'relation':_0x100869}}}),_0x360b13[_0x159015(0x12d)]({'id':UpdateSheetsShapeDataMutation['id'],'params':{'unitId':_0x898107,'subUnitId':_0x120937,'shapeId':_0x25dd1d,'shapeType':_0x5932ad,'shapeData':{'adjustValues':_0x21c28d,'relation':_0x100869}}});}}[_0x341a97(0x189)](_0x5480a9,_0x301915,_0x7a7d8f,_0x49169d,_0x1e727e,_0xda7fa4,_0x4e0bf1,_0x2bee4b,_0x5a6d8c,_0x3592c0){const _0x5e402d=_0x341a97;var _0x20610f;if(!_0x1e727e)return;const _0x2fa567=this[_0x5e402d(0x164)]['getSkeleton'](_0x5480a9,_0x301915);if(!_0x2fa567)return;const _0x5effe1=(_0x20610f=this['_drawingManagerService']['getDrawingByParam']({'unitId':_0x5480a9,'subUnitId':_0x301915,'drawingId':_0x5a6d8c}))===null||_0x20610f===void 0x0?void 0x0:_0x20610f[_0x5e402d(0x17e)];if(!_0x5effe1)return;const _0x1882e7=_0x5effe1['left']!==_0x3592c0[_0x5e402d(0x149)]||_0x5effe1[_0x5e402d(0x13b)]!==_0x3592c0[_0x5e402d(0x13b)],_0x5b6c71=_0x5effe1[_0x5e402d(0x115)]!==_0x3592c0[_0x5e402d(0x115)]||_0x5effe1[_0x5e402d(0x165)]!==_0x3592c0['height'],_0x2907c2=_0x5effe1[_0x5e402d(0x133)]!==_0x3592c0[_0x5e402d(0x133)]||_0x5effe1['flipY']!==_0x3592c0['flipY'],_0x58427a=_0x5effe1[_0x5e402d(0x177)]!==_0x3592c0[_0x5e402d(0x177)];if(_0x1882e7&&!_0x5b6c71&&!_0x2907c2&&!_0x58427a){var _0x1f1678,_0x4c76aa,_0x5cdb31,_0x396f07;const _0x427697=((_0x1f1678=_0x3592c0[_0x5e402d(0x149)])!==null&&_0x1f1678!==void 0x0?_0x1f1678:0x0)-((_0x4c76aa=_0x5effe1[_0x5e402d(0x149)])!==null&&_0x4c76aa!==void 0x0?_0x4c76aa:0x0),_0x3b95c5=((_0x5cdb31=_0x3592c0[_0x5e402d(0x13b)])!==null&&_0x5cdb31!==void 0x0?_0x5cdb31:0x0)-((_0x396f07=_0x5effe1['top'])!==null&&_0x396f07!==void 0x0?_0x396f07:0x0),_0x47411d=this[_0x5e402d(0x138)][_0x5e402d(0x113)](_0x5480a9,_0x301915);if(_0x47411d&&_0x47411d[_0x7a7d8f]){var _0x16e103,_0x46f685,_0x5d0ac4,_0x340f8a;const _0x4f4001=_0x47411d[_0x7a7d8f],_0xc77154={..._0x4f4001[_0x5e402d(0x17e)],'left':((_0x16e103=(_0x46f685=_0x4f4001[_0x5e402d(0x17e)])===null||_0x46f685===void 0x0?void 0x0:_0x46f685['left'])!==null&&_0x16e103!==void 0x0?_0x16e103:0x0)+_0x427697,'top':((_0x5d0ac4=(_0x340f8a=_0x4f4001['transform'])===null||_0x340f8a===void 0x0?void 0x0:_0x340f8a[_0x5e402d(0x13b)])!==null&&_0x5d0ac4!==void 0x0?_0x5d0ac4:0x0)+_0x3b95c5},_0x44a130=transformToDrawingPosition(_0xc77154,_0x2fa567),_0x49b020=transformToAxisAlignPosition(_0xc77154,_0x2fa567),_0xc01ac2={'unitId':_0x5480a9,'subUnitId':_0x301915,'drawingType':DrawingTypeEnum['DRAWING_SHAPE'],'drawingId':_0x7a7d8f,'transform':_0xc77154,'sheetTransform':_0x44a130,'axisAlignSheetTransform':_0x49b020},{unitId:_0x10f4ff,subUnitId:_0x2e7741,undo:_0x50b8a9,redo:_0x30b010,objects:_0x49212e}=this[_0x5e402d(0x138)][_0x5e402d(0x14e)]([_0xc01ac2]);_0x4e0bf1[_0x5e402d(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x10f4ff,'subUnitId':_0x2e7741,'op':_0x30b010,'objects':_0x49212e,'type':DrawingApplyType[_0x5e402d(0x157)]}}),_0x2bee4b[_0x5e402d(0x12d)]({'id':SetDrawingApplyMutation['id'],'params':{'unitId':_0x10f4ff,'subUnitId':_0x2e7741,'op':_0x50b8a9,'objects':_0x49212e,'type':DrawingApplyType[_0x5e402d(0x157)]}});}}else{const _0x5e9645=_0x49169d[_0x5e402d(0x14b)](),_0x36fe34=_0x49169d[_0x5e402d(0x193)]();this[_0x5e402d(0x120)](_0x5480a9,_0x301915,_0x7a7d8f,_0x49169d,_0x5e9645,_0x36fe34,_0x4e0bf1,_0x2bee4b,_0x5a6d8c,_0x3592c0);}}};SheetsShapeController=__decorate([__decorateParam(0x0,ICommandService),__decorateParam(0x1,Inject(SheetInterceptorService)),__decorateParam(0x2,Inject(SheetSkeletonService)),__decorateParam(0x3,Inject(SheetsShapeService)),__decorateParam(0x4,Inject(IDrawingManagerService))],SheetsShapeController);let UniverSheetsShapePlugin=class UniverSheetsShapePlugin extends Plugin{constructor(_0x3b452b=defaultPluginConfig,_0x2ff48,_0x48da89,_0x399d6d){const _0xb82596=_0x341a97;super(),this[_0xb82596(0x16a)]=_0x3b452b,this[_0xb82596(0x123)]=_0x2ff48,this['_commandService']=_0x48da89,this[_0xb82596(0x139)]=_0x399d6d;const {..._0x2351fb}=merge({},defaultPluginConfig,this[_0xb82596(0x16a)]);this[_0xb82596(0x139)][_0xb82596(0x195)](SHEETS_SHAPE_PLUGIN_CONFIG_KEY,_0x2351fb);}[_0x341a97(0x132)](){const _0x9bcc93=_0x341a97,_0x582692=this[_0x9bcc93(0x123)];[[SheetShapeModelManager],[SheetsShapeService],[SheetsShapeController]][_0x9bcc93(0x116)](_0x2aa18b=>_0x582692['add'](_0x2aa18b)),touchDependencies(_0x582692,[[SheetsShapeService],[SheetsShapeController]]);}};_defineProperty(UniverSheetsShapePlugin,_0x341a97(0x19f),UniverInstanceType[_0x341a97(0x162)]),_defineProperty(UniverSheetsShapePlugin,_0x341a97(0x145),_0x341a97(0x186)),_defineProperty(UniverSheetsShapePlugin,_0x341a97(0x14d),name),_defineProperty(UniverSheetsShapePlugin,'version',version),UniverSheetsShapePlugin=__decorate([DependentOn(UniverLicensePlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,ICommandService),__decorateParam(0x3,IConfigService)],UniverSheetsShapePlugin);export{DEFAULT_SHAPE_HEIGHT,DEFAULT_SHAPE_WIDTH,InsertShapeCommand,InsertSheetsShapeMutation,RemoveSheetsShapeMutation,SetShapeDrawingDataCommand,SetSheetsShapeRotateCommand,SetSheetsShapeTextVerticalToggleCommand,SheetsShapeService,ToggleSheetsShapeFlipCommand,UniverSheetsShapePlugin,UpdateConnectorRelationCommand,UpdateLineShapeResizeCommand,UpdateSheetsShapeDataMutation,UpdateSheetsShapeTypeCommand,UpdateSheetsShapeTypeMutation};