@univerjs-pro/sheets-pivot 0.21.0 → 0.21.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/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +10 -10
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5b3260=_0x216b;(function(_0x82597,_0x25ea49){const _0x308463=_0x216b,_0x40d557=_0x82597();while(!![]){try{const _0x4f3239=-parseInt(_0x308463(0x29e))/0x1*(parseInt(_0x308463(0x18a))/0x2)+parseInt(_0x308463(0x1ad))/0x3+parseInt(_0x308463(0x20a))/0x4+parseInt(_0x308463(0x3a8))/0x5+-parseInt(_0x308463(0x3c6))/0x6+-parseInt(_0x308463(0x26f))/0x7*(-parseInt(_0x308463(0x2ef))/0x8)+parseInt(_0x308463(0x408))/0x9;if(_0x4f3239===_0x25ea49)break;else _0x40d557['push'](_0x40d557['shift']());}catch(_0x5b8c21){_0x40d557['push'](_0x40d557['shift']());}}}(_0x461f,0xcaf36),Object[_0x5b3260(0x29d)](exports,Symbol[_0x5b3260(0x405)],{'value':_0x5b3260(0x285)}));let _univerjs_pro_engine_pivot=require('@univerjs-pro/engine-pivot'),_univerjs_core=require('@univerjs/core'),_univerjs_engine_formula=require('@univerjs/engine-formula'),_univerjs_sheets=require('@univerjs/sheets'),rxjs=require('rxjs'),_univerjs_pro_license=require('@univerjs-pro/license'),_univerjs_sheets_filter=require('@univerjs/sheets-filter'),_univerjs_rpc=require('@univerjs/rpc'),_univerjs_engine_render=require('@univerjs/engine-render');const BUILD_TIMESTAMP=Number[_0x5b3260(0x200)](0x69e35012),DEFAULT_PIVOT_NUMBER=0x1,SHEET_PIVOT_TABLE_PLUGIN='SHEET_PIVOT_TABLE_PLUGIN',BLANK_ROW_COUNT=0x1,DEFAULT_FIELD_BG_COLOR=_0x5b3260(0x390),DEFAULT_DATA_BG_COLOR='rgb(255,255,255)',DEFAULT_PIVOT_BORDER_COLOR=_0x5b3260(0x3b4),DEFAULT_PIVOT_PAGE_VIEW_BG='#f4f4f5',DEFAULT_PIVOT_LEAF_VIEW_BG='#f4f4f5',DEFAULT_PIVOT_CORNER_VIEW_VG=_0x5b3260(0x2b0),DEFAULT_PIVOT_GRAND_TOTAL_BG=_0x5b3260(0x245),DEFAULT_PIVOT_GRAND_TOTAL_CL=_0x5b3260(0x197),DEFAULT_PIVOT_SUB_TOTAL_BG=_0x5b3260(0x205),DEFAULT_PIVOT_COL_VIEW_BG=_0x5b3260(0x245),DEFAULT_PIVOT_COL_VIEW_CL='#FFFFFF',DEFAULT_PIVOT_ROW_VIEW_BG='#e6ebfb';let PositionType=function(_0x1a11ee){const _0x29b72f=_0x5b3260;return _0x1a11ee[_0x29b72f(0x21c)]=_0x29b72f(0x2a0),_0x1a11ee[_0x29b72f(0x436)]=_0x29b72f(0x3c2),_0x1a11ee;}({});const localeTemplate={'sheets-pivot':{'blankValue':'','otherValue':'','columnName':'','subTotalText':'','grandTotalText':'','valueText':'','averageName':'','countName':'','countNumsName':'','maxName':'','minName':'','productName':'','stdDevName':'','stdDevpName':'','sumName':'','varName':'','varpName':'','value':'','blank':'','other':'','subTotal':'','grandTotal':'','emptyPivot':{'filter':'','row':'','column':'','values':''},'dateGroup':{'year':'','month':'','day':'','hour':'','minute':'','quarter':'','monthDate':'','yearQuarter':'','yearMonth':'','yearMonthDate':''},'cellDateGroupDisplay':{'minute':'','hour':'','hourMinute':'','date':'','month':'','monthDate':'','quarter':'','year':'','yearMonth':'','yearMonthDate':'','yearQuarter':''}}},defaultPivotBorderStyle={'b':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}},'l':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}},'r':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}},'t':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}}},defaultEmptyPivotFieldCellStyle={'bg':{'rgb':DEFAULT_FIELD_BG_COLOR},'ht':0x2,'vt':0x2,'tb':0x1},defaultEmptyPivotDataCellStyle={'bg':{'rgb':DEFAULT_DATA_BG_COLOR},'ht':0x2,'vt':0x2,'tb':0x1},defaultThemeStyle={'rowStyle':{'bg':{'rgb':DEFAULT_PIVOT_ROW_VIEW_BG},'bd':defaultPivotBorderStyle,'bl':0x1,'vt':0x2},'colStyle':{'bg':{'rgb':DEFAULT_PIVOT_COL_VIEW_BG},'bd':null,'cl':{'rgb':DEFAULT_PIVOT_COL_VIEW_CL},'bl':0x1,'vt':0x2},'subTotalStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_SUB_TOTAL_BG},'vt':0x2},'cornerStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_CORNER_VIEW_VG},'bl':0x1,'vt':0x2},'pageStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_PAGE_VIEW_BG},'vt':0x2},'leafStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_LEAF_VIEW_BG},'vt':0x2},'grandTotal':{'bd':null,'bg':{'rgb':DEFAULT_PIVOT_GRAND_TOTAL_BG},'cl':{'rgb':DEFAULT_PIVOT_GRAND_TOTAL_CL},'bl':0x1,'vt':0x2},'dataStyle':{'bd':defaultPivotBorderStyle,'vt':0x2}};function getDateGroupStr(_0x1f864b,_0x184bdc,_0x317c57){const _0x263400=_0x5b3260,_0x17c7ae=_0x1f864b['get'](_univerjs_core[_0x263400(0x13b)]),_0x552450=_0x317c57['split']('_');switch(_0x184bdc){case _univerjs_pro_engine_pivot[_0x263400(0x372)][_0x263400(0x2a9)]:return _0x17c7ae['t'](_0x263400(0x3fd),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)][_0x263400(0x19e)]:return _0x17c7ae['t'](_0x263400(0x19b),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)]['Hour']:return _0x17c7ae['t'](_0x263400(0x14f),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)][_0x263400(0x33d)]:return _0x17c7ae['t'](_0x263400(0x142),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)][_0x263400(0x2b8)]:return _0x17c7ae['t'](_0x263400(0x12f),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)][_0x263400(0x12b)]:return _0x17c7ae['t'](_0x263400(0x2cc),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)][_0x263400(0x3b5)]:return _0x17c7ae['t'](_0x263400(0x35b),..._0x552450);case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum']['YearMonth']:return _0x17c7ae['t']('sheets-pivot.cellDateGroupDisplay.yearMonth',..._0x552450);case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum']['YearMonthDate']:return _0x17c7ae['t'](_0x263400(0x246),..._0x552450);case _univerjs_pro_engine_pivot[_0x263400(0x372)]['YearQuarter']:return _0x17c7ae['t'](_0x263400(0x3a7),..._0x552450);}return'';}const transformPivotDataToCellData$1=(_0x3527d7,_0x59046a,_0x135881,_0x1987a6)=>{const _0x43c72e=_0x5b3260;let _0x2b2275;const _0x47492e=_0x3527d7[_0x43c72e(0x3e5)](_univerjs_core['IUniverInstanceService'])[_0x43c72e(0x43c)](_univerjs_core['UniverInstanceType']['UNIVER_SHEET']);if(!_0x47492e)return null;const _0x2b3013=_0x47492e[_0x43c72e(0x3a1)]();let _0x4ee117;if(_0x135881)_0x4ee117=_0x2b3013['setValue'](_0x135881);if((_0x59046a===null||_0x59046a===void 0x0?void 0x0:_0x59046a['v'])||(_0x59046a===null||_0x59046a===void 0x0?void 0x0:_0x59046a['v'])===0x0){if(!_0x2b2275)_0x2b2275={};const _0xc2315d=transformErrorValue(_0x59046a['v']);if(typeof _0xc2315d===_0x43c72e(0x266))_0x2b2275['t']=_univerjs_core['CellValueType'][_0x43c72e(0x2c8)];else{if(typeof _0xc2315d===_0x43c72e(0x3f6))_0x2b2275['t']=_univerjs_core[_0x43c72e(0x267)][_0x43c72e(0x156)];}_0x2b2275['v']=_0xc2315d;}if((_0x59046a===null||_0x59046a===void 0x0?void 0x0:_0x59046a['i'])||(_0x59046a===null||_0x59046a===void 0x0?void 0x0:_0x59046a['i'])===0x0){if(!_0x2b2275)_0x2b2275={};_0x2b2275['fi']=_0x59046a['i'];}if(_0x59046a===null||_0x59046a===void 0x0?void 0x0:_0x59046a['s']){if(!_0x2b2275)_0x2b2275={};_0x2b2275['pbt']=_0x59046a['s'];}if(_0x135881){if(!_0x2b2275)_0x2b2275={};_0x2b2275['s']=_0x4ee117;}if(_0x1987a6){if((_0x2b2275===null||_0x2b2275===void 0x0?void 0x0:_0x2b2275['v'])&&_0x2b2275[_0x43c72e(0x12c)]!==_univerjs_pro_engine_pivot['PivotCellStyleTypeEnum']['GrandTotal']&&_0x2b2275['pbt']!==_univerjs_pro_engine_pivot[_0x43c72e(0x239)][_0x43c72e(0x244)]){const _0x346969=String(_0x2b2275['v']),{dateType:_0x171c25}=_0x1987a6;_0x2b2275['v']=getDateGroupStr(_0x3527d7,_0x171c25,_0x346969),_0x2b2275['t']=_univerjs_core['CellValueType'][_0x43c72e(0x156)];}}return _0x2b2275;},generatorAdjustPositionData$1=(_0x164a58,_0x679945,_0x4167ce,_0x4284a7)=>{const _0x157821=_0x5b3260,_0x51696e=_0x4167ce[_0x157821(0x226)],{cornerView:_0x4a71e9,rowView:_0x27d443,colView:_0x5161fd,dataView:_0x135c95,pageView:_0x2202b1,formatMap:_0x58d4d8,groupInfo:_0x38a788}=_0x679945,{row:_0x36868c,col:_0x3fbf7b}=_0x51696e,_0x10b19b=new _univerjs_core['ObjectMatrix'](),_0x197ab3={},_0x45d723={},_0x1486e3={},_0x23c265={},_0x1f3813={};let _0xa81179=_0x36868c,_0x4420bf=_0x3fbf7b;Object[_0x157821(0x2da)](_0x2202b1[_0x157821(0x232)])[_0x157821(0x21b)](_0x2dca84=>{const _0x4c0318=_0x157821;Object['keys'](_0x2202b1[_0x4c0318(0x232)][Number(_0x2dca84)])[_0x4c0318(0x21b)](_0x4a5995=>{const _0x1f5a8f=_0x4c0318,_0x29c398={..._0x2202b1['data'][Number(_0x2dca84)][Number(_0x4a5995)]};_0x10b19b['setValue'](Number(_0x2dca84)+_0xa81179,Number(_0x4a5995)+_0x4420bf,transformPivotDataToCellData$1(_0x164a58,_0x29c398,defaultThemeStyle[_0x1f5a8f(0x264)]));});});const _0x567819=Object[_0x157821(0x2da)](_0x2202b1['data'])[_0x157821(0x2b9)];_0xa81179+=_0x567819+(_0x567819?0x1:0x0);const _0x335e98=_0x4a71e9[_0x157821(0x427)](),_0x537cbb=_0x4a71e9[_0x157821(0x39a)]();for(let _0xd9dd2e=0x0;_0xd9dd2e<_0x335e98;_0xd9dd2e++)for(let _0x2870cf=0x0;_0x2870cf<_0x537cbb;_0x2870cf++){var _0x1a2bf8;const _0xcda980={...(_0x1a2bf8=_0x4a71e9['data'])===null||_0x1a2bf8===void 0x0||(_0x1a2bf8=_0x1a2bf8[_0xd9dd2e])===null||_0x1a2bf8===void 0x0?void 0x0:_0x1a2bf8[_0x2870cf]};if(_0xcda980){var _0x12fcb9;if(((_0x12fcb9=_0x27d443[_0x157821(0x159)][_0x2870cf])===null||_0x12fcb9===void 0x0?void 0x0:_0x12fcb9[_0x157821(0x24b)])&&_0x2870cf===_0x537cbb-0x1&&_0xd9dd2e===_0x335e98-0x1)_0xcda980['v']=''+_0x4284a7['sheets-pivot.value'];}_0x10b19b[_0x157821(0x333)](_0xd9dd2e+_0xa81179,_0x2870cf+_0x4420bf,transformPivotDataToCellData$1(_0x164a58,_0xcda980,defaultThemeStyle[_0x157821(0x195)]));}for(let _0x373ce2=0x0;_0x373ce2<_0x4a71e9[_0x157821(0x1ee)][_0x157821(0x2b9)];_0x373ce2++)if(_0x4a71e9[_0x157821(0x1ee)][_0x373ce2])_0x1486e3[''+(_0x373ce2+_0x4420bf)]=_0x4a71e9[_0x157821(0x1ee)][_0x373ce2];_0x4420bf+=_0x537cbb;const _0x2b0153=_0x5161fd['headerMap'],_0x49ad6c=_0x5161fd[_0x157821(0x322)]()>=0x0?_0x5161fd[_0x157821(0x322)]()+0x1:0x0,_0x5ddd43=_0x5161fd['getLastCol']()>=0x0?_0x5161fd[_0x157821(0x400)]()+0x1:0x0;for(let _0x237723=0x0;_0x237723<_0x5ddd43;_0x237723++){for(let _0xcbb6cb=0x0;_0xcbb6cb<_0x49ad6c;_0xcbb6cb++){var _0x2149f5,_0x2cc1ed;const _0xff7e02={...(_0x2149f5=_0x5161fd[_0x157821(0x232)])===null||_0x2149f5===void 0x0||(_0x2149f5=_0x2149f5[_0xcbb6cb])===null||_0x2149f5===void 0x0?void 0x0:_0x2149f5[_0x237723]},_0x3f6e59=(_0x2cc1ed=_0x2b0153[_0xcbb6cb])===null||_0x2cc1ed===void 0x0?void 0x0:_0x2cc1ed['tableFieldId'],_0x26b4be=_0x58d4d8[_0x3f6e59],_0x20bab1=_0x38a788[_0x3f6e59];if(_0xff7e02){var _0x41bdcb;_0xff7e02['v']=transFromCellValue(_0xff7e02,_0xcbb6cb===0x0&&((_0x41bdcb=_0x5161fd['getHeaderMapItem'](_0x237723+0x1))===null||_0x41bdcb===void 0x0?void 0x0:_0x41bdcb['isValue']),_0x26b4be,_0x4284a7);}let _0x4aacdb;if(_0x26b4be)_0x4aacdb={...defaultThemeStyle[_0x157821(0x209)],'n':{'pattern':_0x26b4be}};else _0x4aacdb={...defaultThemeStyle[_0x157821(0x209)]};_0x10b19b[_0x157821(0x333)](_0xcbb6cb+_0xa81179,_0x237723+_0x4420bf,transformPivotDataToCellData$1(_0x164a58,_0xff7e02,_0x4aacdb,_0x20bab1));}if(_0x5161fd['info'][_0x237723])_0x45d723[''+(_0x237723+_0x4420bf)]=_0x5161fd[_0x157821(0x1ee)][_0x237723];if(_0x5161fd[_0x157821(0x159)][_0x237723+0x1])_0x1f3813[''+(_0x237723+_0xa81179+0x1)]=_0x5161fd[_0x157821(0x159)][_0x237723+0x1];}_0xa81179+=_0x335e98;const _0x2f1bdf=_0x27d443[_0x157821(0x159)],_0x19b5a7=_0x27d443[_0x157821(0x322)]()>=0x0?_0x27d443[_0x157821(0x322)]()+0x1:0x0,_0x730ba9=_0x27d443['getLastCol']()>=0x0?_0x27d443[_0x157821(0x400)]()+0x1:0x0;for(let _0x26fdc4=0x0;_0x26fdc4<_0x19b5a7;_0x26fdc4++){for(let _0x4dfb09=0x0;_0x4dfb09<_0x730ba9;_0x4dfb09++){var _0x36b13e,_0x45bd2f;const _0x4e454d={...(_0x36b13e=_0x27d443[_0x157821(0x232)])===null||_0x36b13e===void 0x0||(_0x36b13e=_0x36b13e[_0x26fdc4])===null||_0x36b13e===void 0x0?void 0x0:_0x36b13e[_0x4dfb09]},_0xb3b196=(_0x45bd2f=_0x2f1bdf[_0x4dfb09])===null||_0x45bd2f===void 0x0?void 0x0:_0x45bd2f['tableFieldId'],_0x5d22d7=_0x58d4d8[_0xb3b196],_0x4f594b=_0x38a788[_0xb3b196];if(_0x4e454d)_0x4e454d['v']=transFromCellValue(_0x4e454d,![],_0x5d22d7,_0x4284a7);let _0x584d40;if(_0x27d443['info'][_0x26fdc4][_0x157821(0x2dc)]===_0x27d443[_0x157821(0x39a)]())_0x584d40=defaultThemeStyle[_0x157821(0x3be)];else{if(_0x27d443[_0x157821(0x1ee)][_0x26fdc4][_0x157821(0x31a)])_0x584d40=_0x27d443[_0x157821(0x1ee)][_0x26fdc4]['level']===0x0?defaultThemeStyle['grandTotal']:defaultThemeStyle['subTotalStyle'];else _0x584d40=defaultThemeStyle[_0x157821(0x2b3)];}if(_0x5d22d7)_0x584d40={..._0x584d40,'n':{'pattern':_0x5d22d7}};_0x10b19b['setValue'](_0x26fdc4+_0xa81179,_0x4dfb09+_0x3fbf7b,transformPivotDataToCellData$1(_0x164a58,_0x4e454d,_0x584d40,_0x4f594b));}if(_0x27d443[_0x157821(0x1ee)][_0x26fdc4])_0x197ab3[''+(_0x26fdc4+_0xa81179)]=_0x27d443[_0x157821(0x1ee)][_0x26fdc4];if(_0x27d443[_0x157821(0x159)][_0x26fdc4])_0x23c265[''+(_0x26fdc4+_0x3fbf7b)]=_0x27d443[_0x157821(0x159)][_0x26fdc4];}const _0x2d1191=_0x135c95[_0x157821(0x427)](),_0x10e720=_0x135c95[_0x157821(0x39a)]();for(let _0x19aafe=0x0;_0x19aafe<_0x2d1191;_0x19aafe++)for(let _0x47946b=0x0;_0x47946b<_0x10e720;_0x47946b++){var _0x5791fc;const _0x120b44={...(_0x5791fc=_0x135c95['data'])===null||_0x5791fc===void 0x0||(_0x5791fc=_0x5791fc[_0x19aafe])===null||_0x5791fc===void 0x0?void 0x0:_0x5791fc[_0x47946b]};let _0x51ab90;if(_0x27d443[_0x157821(0x1ee)][_0x19aafe][_0x157821(0x31a)])_0x51ab90=_0x27d443[_0x157821(0x1ee)][_0x19aafe][_0x157821(0x2dc)]===0x0?defaultThemeStyle[_0x157821(0x3ac)]:defaultThemeStyle[_0x157821(0x305)];else _0x51ab90=defaultThemeStyle[_0x157821(0x353)];const _0xac4911=_0x27d443[_0x157821(0x1ee)][_0x19aafe][_0x157821(0x169)],_0x4c2a9d=_0x5161fd[_0x157821(0x1ee)][_0x47946b]['valueIndex'],_0x530264=Math[_0x157821(0x18b)](_0xac4911,_0x4c2a9d),_0xf8d243=_0x4167ce[_0x157821(0x170)][_0x157821(0x1f7)]['concat']();let _0x7f720e='';if(_0x530264<0x0){var _0x7cfed5;_0x7f720e=(_0x7cfed5=_0xf8d243[0x0])!==null&&_0x7cfed5!==void 0x0?_0x7cfed5:'';}else{var _0x4510a0;_0x7f720e=(_0x4510a0=_0xf8d243[_0x530264])!==null&&_0x4510a0!==void 0x0?_0x4510a0:'';}const _0x941468=_0x58d4d8[_0x7f720e];if(_0x941468)_0x51ab90={..._0x51ab90,'n':{'pattern':_0x941468}};_0x10b19b[_0x157821(0x333)](_0x19aafe+_0xa81179,_0x47946b+_0x4420bf,transformPivotDataToCellData$1(_0x164a58,_0x120b44,_0x51ab90));}return{'valueMatrix':_0x10b19b,'rowInfo':_0x197ab3,'colInfo':_0x45d723,'cornerInfo':_0x1486e3,'rowHeaderMap':_0x23c265,'colHeaderMap':_0x1f3813};};function transFromCellValue(_0x2086e7,_0xd459fb,_0x1aa8bd,_0x5728ee){const _0x20330b=_0x5b3260;let _0xd0a737=_0x2086e7['v'];if(_0xd459fb)_0xd0a737=''+_0x5728ee[_0x20330b(0x3c9)];const _0x16d80d=_0x2086e7['t']&&(_0x2086e7['t']&_univerjs_pro_engine_pivot['PivotViewCellValueTypeEnum'][_0x20330b(0x262)])>0x0;if(_0x16d80d)_0xd0a737=''+_0x5728ee[_0x20330b(0x290)];const _0x1d7eed=_0x2086e7['t']&&(_0x2086e7['t']&_univerjs_pro_engine_pivot[_0x20330b(0x1f2)][_0x20330b(0x297)])>0x0;if(_0x1d7eed)_0xd0a737=''+_0x5728ee['sheets-pivot.other'];if(_0x2086e7['s']===_univerjs_pro_engine_pivot[_0x20330b(0x239)]['Subtotal']){let _0x3f4132=_0xd0a737,_0x52c136='';(0x0,_univerjs_pro_engine_pivot['isPrefixValue'])(_0xd0a737)&&(_0x3f4132=_0xd0a737['prefix'],_0x52c136=_0xd0a737['value']);const _0x4f4447=_0x1aa8bd&&!_0x16d80d&&!_0x1d7eed?_univerjs_core[_0x20330b(0x1d0)]['format'](_0x1aa8bd,Number(_0x3f4132)):_0x3f4132;if(_0x52c136)_0xd0a737=_0x4f4447+'\x20'+_0x52c136;else _0xd0a737=_0x4f4447+'\x20'+_0x5728ee[_0x20330b(0x23e)];}else{if(_0x2086e7['s']===_univerjs_pro_engine_pivot[_0x20330b(0x239)][_0x20330b(0x201)])_0xd0a737=_0xd0a737+'\x20'+_0x5728ee['sheets-pivot.grandTotal'];}return _0xd0a737;}function transformErrorValue(_0x2f0f47){const _0x53d1ea=_0x5b3260;if((0x0,_univerjs_pro_engine_pivot[_0x53d1ea(0x326)])(_0x2f0f47)){const {errorType:_0x1aa70b}=_0x2f0f47;switch(_0x1aa70b){case _univerjs_pro_engine_pivot[_0x53d1ea(0x137)][_0x53d1ea(0x3ff)]:return _univerjs_engine_formula[_0x53d1ea(0x3cb)][_0x53d1ea(0x263)];case _univerjs_pro_engine_pivot[_0x53d1ea(0x137)]['NotNumber']:return _univerjs_engine_formula[_0x53d1ea(0x3cb)][_0x53d1ea(0x233)];case _univerjs_pro_engine_pivot[_0x53d1ea(0x137)]['NotFunction']:return _univerjs_engine_formula[_0x53d1ea(0x3cb)]['NAME'];case _univerjs_pro_engine_pivot['PivotErrorTypeEnum']['NotName']:return _univerjs_engine_formula[_0x53d1ea(0x3cb)][_0x53d1ea(0x2b2)];case _univerjs_pro_engine_pivot[_0x53d1ea(0x137)][_0x53d1ea(0x240)]:return _univerjs_engine_formula[_0x53d1ea(0x3cb)]['REF'];}}return _0x2f0f47;}function getAdjustRangesPosition(_0x2c15f1,_0x396679,_0x5ce4e4=![],_0xc2659d=![]){const _0x258372=_0x5b3260,{data:_0x432efe}=_0x396679,_0x7ad0da=_0x396679['getRowCount'](),_0x171475=_0x396679[_0x258372(0x39a)]();if(_0x7ad0da<=0x0||_0x171475<=0x0)return[];const _0xbae08a=_0x396679[_0x258372(0x400)](),_0x3bcd5e=_0x396679['getLastRow'](),_0x10aedc=_0xc2659d?_0x3bcd5e>=0x0?_0x3bcd5e+0x1:0x0:_0x7ad0da,_0x302f96=_0xc2659d?_0xbae08a>=0x0?_0xbae08a+0x1:0x0:_0x171475,{row:_0x145f42,col:_0x26cf16}=_0x2c15f1,_0x57c5db=_0x145f42,_0xdef6a2=_0x26cf16;if(_0x5ce4e4){const _0x251a26=[];for(const [_0x5b256e,_0x39d14e]of Object[_0x258372(0x17a)](_0x432efe))for(const [_0x169695,_0x580d04]of Object[_0x258372(0x17a)](_0x39d14e))_0x251a26[_0x258372(0x154)]((0x0,_univerjs_core[_0x258372(0x318)])(_0x57c5db+Number(_0x5b256e),_0xdef6a2+Number(_0x169695)));return _0x251a26;}else{const _0x291217=_0xc2659d?_0x10aedc>0x0?0x1:0x0:0x1,_0x5c564f=_0xc2659d?_0x302f96>0x0?0x1:0x0:0x1;return[{'startRow':_0x57c5db,'startColumn':_0xdef6a2,'endRow':_0x145f42+_0x10aedc-_0x291217,'endColumn':_0x26cf16+_0x302f96-_0x5c564f}];}}const SHEET_PIVOT_IN_MAIN_THREAD='SHEET_PIVOT_IN_MAIN_THREAD',SHEET_PIVOT_EXCLUSIVE_ID='SHEET_PIVOT_EXCLUSIVE_ID';let PivotDisplayDataType=function(_0x4658f5){const _0x101d0c=_0x5b3260;return _0x4658f5[_0x101d0c(0x341)]=_0x101d0c(0x161),_0x4658f5['Panel']=_0x101d0c(0x222),_0x4658f5[_0x101d0c(0x3ef)]=_0x101d0c(0x16c),_0x4658f5[_0x101d0c(0x253)]=_0x101d0c(0x253),_0x4658f5[_0x101d0c(0x2ed)]=_0x101d0c(0x29a),_0x4658f5['MovePivotField']=_0x101d0c(0x409),_0x4658f5[_0x101d0c(0x15a)]=_0x101d0c(0x3da),_0x4658f5[_0x101d0c(0x373)]='setPivotCollapse',_0x4658f5[_0x101d0c(0x2c6)]=_0x101d0c(0x166),_0x4658f5[_0x101d0c(0x43d)]=_0x101d0c(0x37b),_0x4658f5['SetPivotSetting']='setPivotSetting',_0x4658f5[_0x101d0c(0x3c0)]='updatePivotSource',_0x4658f5['UpdateValuePosition']=_0x101d0c(0x198),_0x4658f5[_0x101d0c(0x221)]=_0x101d0c(0x3d5),_0x4658f5['SetValuePivotFilter']='setValuePivotFilter',_0x4658f5[_0x101d0c(0x3c7)]='setPivotTableConfig',_0x4658f5[_0x101d0c(0x213)]=_0x101d0c(0x3de),_0x4658f5;}({});const defaultTextInfo={'sheets-pivot.blankValue':_0x5b3260(0x2a7),'sheets-pivot.columnName':_0x5b3260(0x23d),'sheets-pivot.subTotalText':_0x5b3260(0x3cf),'sheets-pivot.grandTotalText':_0x5b3260(0x2f8),'sheets-pivot.valueText':_0x5b3260(0x26b),'sheets-pivot.averageName':'Average\x20of\x20','sheets-pivot.countName':_0x5b3260(0x2d4),'sheets-pivot.countNumsName':_0x5b3260(0x2d4),'sheets-pivot.maxName':_0x5b3260(0x1b0),'sheets-pivot.minName':_0x5b3260(0x34d),'sheets-pivot.productName':_0x5b3260(0x429),'sheets-pivot.stdDevName':'StdDev\x20of\x20','sheets-pivot.stdDevpName':_0x5b3260(0x41a),'sheets-pivot.sumName':_0x5b3260(0x2c2),'sheets-pivot.varName':_0x5b3260(0x18c),'sheets-pivot.varpName':_0x5b3260(0x3d7),'sheets-pivot.subTotal':_0x5b3260(0x244),'sheets-pivot.grandTotal':'Grand\x20Total','sheets-pivot.value':_0x5b3260(0x43f),'sheets-pivot.blank':_0x5b3260(0x262),'sheets-pivot.other':'other','sheets-pivot.emptyPivot.filter':_0x5b3260(0x341),'sheets-pivot.emptyPivot.row':_0x5b3260(0x3ed),'sheets-pivot.emptyPivot.column':_0x5b3260(0x269),'sheets-pivot.emptyPivot.values':_0x5b3260(0x2fd)},defaultEmptyPivotGeneratedMutations={'undos':[],'redos':[],'preUndos':[],'preRedos':[]},PIVOT_PERFORM_CHECK=(0x0,_univerjs_core[_0x5b3260(0x215)])(_0x5b3260(0x218)),PIVOT_MUTATION_GENERATE=(0x0,_univerjs_core[_0x5b3260(0x417)])(_0x5b3260(0x16f));let CollectionChangeEnum=function(_0xe60230){const _0x3dc7e4=_0x5b3260;return _0xe60230[_0x3dc7e4(0x1a8)]=_0x3dc7e4(0x1a8),_0xe60230['delete']='delete',_0xe60230['update']=_0x3dc7e4(0x33a),_0xe60230;}({}),PivotTableOperationEnum=function(_0x110d6d){const _0x5f5bb4=_0x5b3260;return _0x110d6d[_0x5f5bb4(0x347)]=_0x5f5bb4(0x1a8),_0x110d6d[_0x5f5bb4(0x178)]='set',_0x110d6d['Delete']=_0x5f5bb4(0x384),_0x110d6d;}({});const GetPivotDataLocalMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':'sheet.mutation.get-pivot-data-local','handler':()=>!![]},SendPivotDataLocalMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':'sheet.mutation.send-pivot-data-local','handler':()=>!![]},SendPivotViewLocalMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x2d1),'handler':()=>!![]},SendPivotConfigLocalMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x158),'handler':()=>!![]},SendInitPivotTextLocalMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':_0x5b3260(0x1ac),'handler':()=>!![]};function _typeof(_0x321d5e){'@babel/helpers - typeof';const _0x1315f4=_0x5b3260;return _typeof=_0x1315f4(0x364)==typeof Symbol&&_0x1315f4(0x41f)==typeof Symbol[_0x1315f4(0x3cd)]?function(_0x11628f){return typeof _0x11628f;}:function(_0xa4457d){const _0x18b24f=_0x1315f4;return _0xa4457d&&'function'==typeof Symbol&&_0xa4457d[_0x18b24f(0x3ab)]===Symbol&&_0xa4457d!==Symbol['prototype']?_0x18b24f(0x41f):typeof _0xa4457d;},_typeof(_0x321d5e);}function toPrimitive(_0x15ebd7,_0xb0326b){const _0x3bac81=_0x5b3260;if(_0x3bac81(0x211)!=_typeof(_0x15ebd7)||!_0x15ebd7)return _0x15ebd7;var _0x52aab2=_0x15ebd7[Symbol[_0x3bac81(0x28b)]];if(void 0x0!==_0x52aab2){var _0x5b464f=_0x52aab2[_0x3bac81(0x1c3)](_0x15ebd7,_0xb0326b||_0x3bac81(0x227));if(_0x3bac81(0x211)!=_typeof(_0x5b464f))return _0x5b464f;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x3bac81(0x3f6)===_0xb0326b?String:Number)(_0x15ebd7);}function toPropertyKey(_0x4b6f2f){const _0x514c05=_0x5b3260;var _0x1e0909=toPrimitive(_0x4b6f2f,_0x514c05(0x3f6));return _0x514c05(0x41f)==_typeof(_0x1e0909)?_0x1e0909:_0x1e0909+'';}function _defineProperty(_0x74e9d1,_0x591a6b,_0x41b5aa){const _0x51382d=_0x5b3260;return(_0x591a6b=toPropertyKey(_0x591a6b))in _0x74e9d1?Object[_0x51382d(0x29d)](_0x74e9d1,_0x591a6b,{'value':_0x41b5aa,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x74e9d1[_0x591a6b]=_0x41b5aa,_0x74e9d1;}function __decorateParam(_0x40a53f,_0x491f7a){return function(_0x2b394c,_0x46f941){_0x491f7a(_0x2b394c,_0x46f941,_0x40a53f);};}function __decorate(_0x38d622,_0x366798,_0x4864e4,_0x50ca8c){const _0x532572=_0x5b3260;var _0x5b95a4=arguments[_0x532572(0x2b9)],_0x250968=_0x5b95a4<0x3?_0x366798:_0x50ca8c===null?_0x50ca8c=Object['getOwnPropertyDescriptor'](_0x366798,_0x4864e4):_0x50ca8c,_0x513d9d;if(typeof Reflect===_0x532572(0x211)&&typeof Reflect[_0x532572(0x3bc)]==='function')_0x250968=Reflect['decorate'](_0x38d622,_0x366798,_0x4864e4,_0x50ca8c);else{for(var _0x386795=_0x38d622['length']-0x1;_0x386795>=0x0;_0x386795--)if(_0x513d9d=_0x38d622[_0x386795])_0x250968=(_0x5b95a4<0x3?_0x513d9d(_0x250968):_0x5b95a4>0x3?_0x513d9d(_0x366798,_0x4864e4,_0x250968):_0x513d9d(_0x366798,_0x4864e4))||_0x250968;}return _0x5b95a4>0x3&&_0x250968&&Object[_0x532572(0x29d)](_0x366798,_0x4864e4,_0x250968),_0x250968;}let SheetsPivotRPCService=class SheetsPivotRPCService extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x553475){const _0x1a6bc1=_0x5b3260;super(),this[_0x1a6bc1(0x389)]=_0x553475,_defineProperty(this,_0x1a6bc1(0x32e),new Map());}['handleAsyncResponse'](_0x181504){const _0x514b1e=_0x5b3260,{version:_0xb2ba49}=_0x181504,_0x4b4a1c=this['_requestResolvers']['get'](_0xb2ba49);_0x4b4a1c&&(_0x4b4a1c(_0x181504),this['_requestResolvers'][_0x514b1e(0x384)](_0xb2ba49));}['getPivotDisplayConfig'](_0xd088f1){return new Promise((_0x2315bb,_0x150434)=>{const _0x5dde76=_0x216b,_0x216f7a=this[_0x5dde76(0x324)]();this[_0x5dde76(0x32e)]['set'](_0x216f7a,_0x2315bb),this[_0x5dde76(0x389)][_0x5dde76(0x37a)](GetPivotDataLocalMutation['id'],{'version':_0x216f7a,..._0xd088f1},{'onlyLocal':!![]});});}[_0x5b3260(0x324)](){const _0x39ed1b=_0x5b3260;return Math['random']()[_0x39ed1b(0x3f9)](0x24)[_0x39ed1b(0x3ba)](0x2,0x10);}};SheetsPivotRPCService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x5b3260(0x151)]))],SheetsPivotRPCService);const getStringFromDataStream=_0x256f3c=>{const _0x5c9d5c=_0x5b3260;var _0x420f81;return((_0x420f81=_0x256f3c[_0x5c9d5c(0x3bb)])===null||_0x420f81===void 0x0?void 0x0:_0x420f81[_0x5c9d5c(0x3d6)][_0x5c9d5c(0x185)](/\r\n$/,''))||'';};var SheetsPivotDataFieldManager=class extends _univerjs_pro_engine_pivot[_0x5b3260(0x1df)]{constructor(_0x3baf5d,_0xbf5ce){const _0xb9874=_0x5b3260;super(),_defineProperty(this,_0xb9874(0x1b1),{}),_defineProperty(this,'_univerInstanceService',void 0x0),_defineProperty(this,_0xb9874(0x30b),void 0x0),this[_0xb9874(0x2ac)]=_0xbf5ce,this['_host']=_0x3baf5d;}[_0x5b3260(0x1bc)](){const _0x6488ef=_0x5b3260;for(const _0x5ddfac in this[_0x6488ef(0x363)]){const _0x36b108=this[_0x6488ef(0x363)][_0x5ddfac],_0x44f275=_0x36b108[_0x6488ef(0x27d)]();this[_0x6488ef(0x1b1)][_0x44f275]=_0x36b108[_0x6488ef(0x1ef)]();}}['getAutoDisplayNameFunction'](){const _0x3659d4=_0x5b3260,_0x5412b9=this[_0x3659d4(0x30b)];return getAutoDisplayName$1[_0x3659d4(0x1a2)](_0x5412b9);}[_0x5b3260(0x3e0)](_0x4295f1){const _0x497ca9=_0x5b3260,_0x13c535=this[_0x497ca9(0x363)][_0x4295f1][_0x497ca9(0x34f)];delete this[_0x497ca9(0x363)][_0x4295f1],delete this['rangeKeyMap'][_0x13c535];}[_0x5b3260(0x35a)](_0x584f9c){const _0x3ffb06=_0x5b3260;this['dataFields'][_0x584f9c[_0x3ffb06(0x1ef)]()]=_0x584f9c;}[_0x5b3260(0x3ee)](_0x500767){const _0x5b1af3=_0x5b3260;var _0x3be573;const _0x4ac93d=this[_0x5b1af3(0x30b)][_0x5b1af3(0x2d6)](_0x500767);if(_0x4ac93d){var _0x4e0793;const {unitId:_0x5360b8,subUnitId:_0x11e125}=_0x4ac93d,_0x4dd091=(_0x4e0793=this[_0x5b1af3(0x30b)][_0x5b1af3(0x32a)](_0x5360b8,_0x11e125,_0x500767))===null||_0x4e0793===void 0x0?void 0x0:_0x4e0793[_0x5b1af3(0x3d4)];this[_0x5b1af3(0x30b)]['broadcastCollectionChange']({'token':_0x500767,'type':CollectionChangeEnum[_0x5b1af3(0x384)],'dataRangeInfo':_0x4dd091});}(_0x3be573=this['getCollection'](_0x500767))===null||_0x3be573===void 0x0||_0x3be573[_0x5b1af3(0x366)](),delete this[_0x5b1af3(0x2a4)][_0x500767];}[_0x5b3260(0x27d)](_0x1f757f,_0x121c14){const {sheetName:_0x3e6e11,unitId:_0x453411,range:_0x6efb90}=_0x1f757f,{startRow:_0x3c70bd,endRow:_0x1d9303}=_0x6efb90;return(0x0,_univerjs_engine_formula['serializeRangeWithSpreadsheet'])(_0x453411,_0x3e6e11,{'startRow':_0x3c70bd,'endRow':_0x1d9303,'startColumn':_0x121c14,'endColumn':_0x121c14});}[_0x5b3260(0x34c)](_0x36a4b4){const _0x535859=_0x5b3260;return this[_0x535859(0x363)][this[_0x535859(0x1b1)][_0x36a4b4]];}[_0x5b3260(0x371)](_0x54ff2a,_0x31cb4e){const _0x13163d=_0x5b3260;this[_0x13163d(0x1b1)][_0x54ff2a]=_0x31cb4e;}[_0x5b3260(0x136)](_0x4a0e41,_0x52fb26){const _0x714d05=_0x5b3260;this[_0x714d05(0x1b1)][_0x52fb26]=this[_0x714d05(0x1b1)][_0x4a0e41],delete this[_0x714d05(0x1b1)][_0x4a0e41];}[_0x5b3260(0x3e2)](_0x4ae819,_0x5f48b8,_0x157875,_0x26813e){const _0x5c80b1=_0x5b3260,_0xa8a9be=new _univerjs_pro_engine_pivot[(_0x5c80b1(0x28f))](this);_0xa8a9be[_0x5c80b1(0x283)](_0x5f48b8);const _0x5a14cb=[];let _0x4140ce=0x0;for(const _0xd5345b of _0xa8a9be[_0x5c80b1(0x19c)]){const _0x357943=this[_0x5c80b1(0x27d)](_0x157875,_0x4140ce),_0x29a59b=this[_0x5c80b1(0x363)][_0xd5345b];_0x29a59b&&(_0x29a59b['rangeKey']=_0x357943,this[_0x5c80b1(0x371)](_0x357943,_0xd5345b),_0x5a14cb['push']({'index':_0x4140ce,'dataField':_0x29a59b})),_0x4140ce++;}return this[_0x5c80b1(0x1cb)](_0x4ae819,_0xa8a9be,_0x157875,_0x26813e),{'collection':_0xa8a9be,'updateDataFieldList':_0x5a14cb};}[_0x5b3260(0x314)](_0x590796,_0x341ade){const _0xdf287a=_0x5b3260;if(_0x590796[_0xdf287a(0x1d5)]===_univerjs_core[_0xdf287a(0x284)][_0xdf287a(0x307)])return{'startRow':0x0,'startColumn':_0x590796[_0xdf287a(0x29c)],'endRow':_0x341ade[_0xdf287a(0x427)]()-0x1,'endColumn':_0x590796[_0xdf287a(0x2bc)]};return{'startRow':_0x590796[_0xdf287a(0x401)],'startColumn':_0x590796['startColumn'],'endRow':_0x590796[_0xdf287a(0x249)],'endColumn':_0x590796[_0xdf287a(0x2bc)]};}['createCollectionWithDataRange'](_0x3c5cd9){const _0x3f9e03=_0x5b3260,{sheetName:_0xac4266,range:_0x44d144}=_0x3c5cd9,_0x15906e=this[_0x3f9e03(0x2ac)][_0x3f9e03(0x43c)](_univerjs_core[_0x3f9e03(0x1b7)][_0x3f9e03(0x2e8)]),_0x1e84c1=_0x15906e['getSheetBySheetName'](_0xac4266),_0x50dffb=_0x1e84c1[_0x3f9e03(0x438)](),{startColumn:_0x10feab,startRow:_0x3ae199,endColumn:_0x21ffbb}=this[_0x3f9e03(0x314)](_0x44d144,_0x1e84c1),_0xd4e364=_0x15906e[_0x3f9e03(0x3a1)](),_0x533647=new _univerjs_pro_engine_pivot[(_0x3f9e03(0x28f))](this);_0x533647['setRange'](_0x3c5cd9);const _0x43a80b=[],_0x307626={};for(let _0x314cbd=_0x10feab;_0x314cbd<=_0x21ffbb;_0x314cbd++){const _0x3ebf48=_0x50dffb[_0x3f9e03(0x323)](_0x3ae199,_0x314cbd),_0x2aa2e2=this[_0x3f9e03(0x27d)](_0x3c5cd9,_0x314cbd),_0x50698c=this[_0x3f9e03(0x34c)](_0x2aa2e2);if(!_0x50698c){const _0x3160d0=this[_0x3f9e03(0x3ca)]();let _0xe77952=this[_0x3f9e03(0x149)](_0x3ebf48,_0xd4e364,_0x307626);if((0x0,_univerjs_pro_engine_pivot['isDateValue'])(_0xe77952))_0xe77952=_univerjs_core[_0x3f9e03(0x1d0)][_0x3f9e03(0x2f7)](_0xe77952['f'],Number(_0xe77952['v']));const _0x55d0ca=this[_0x3f9e03(0x27f)](_0xe77952,_0x314cbd),_0x4e2b45=new _univerjs_pro_engine_pivot[(_0x3f9e03(0x3ec))](_0x3160d0,_0x55d0ca,(0x0,_univerjs_pro_engine_pivot[_0x3f9e03(0x16e)])(0x3));_0x4e2b45[_0x3f9e03(0x34f)]=_0x2aa2e2,this[_0x3f9e03(0x363)][_0x3160d0]=_0x4e2b45,_0x533647[_0x3f9e03(0x377)](_0x3160d0,_0x55d0ca),_0x43a80b[_0x3f9e03(0x154)]({'index':_0x314cbd,'dataField':_0x4e2b45});}else _0x533647[_0x3f9e03(0x377)](_0x50698c[_0x3f9e03(0x1ef)](),_0x50698c[_0x3f9e03(0x1c2)]());}return{'updateDataFieldList':_0x43a80b,'collection':_0x533647};}[_0x5b3260(0x168)](_0x4fe6d5){const _0x58cfd7=_0x5b3260;return this['_host'][_0x58cfd7(0x382)]()[_0x58cfd7(0x393)]+'\x20'+(0x0,_univerjs_core[_0x58cfd7(0x14a)])(_0x4fe6d5);}['uniqueDataFieldName'](_0x3518d7,_0x1ed98d){return _0x3518d7===void 0x0||_0x3518d7===null||_0x3518d7===''?this['_getAutoName'](_0x1ed98d):String(_0x3518d7);}[_0x5b3260(0x329)](_0x2612a6){return this['collections'][_0x2612a6];}[_0x5b3260(0x1cb)](_0x53bfc6,_0x5c8f3a,_0x57ce7f,_0x58c953){const _0x27d58f=_0x5b3260;this['collections'][_0x53bfc6]=_0x5c8f3a,_0x5c8f3a['setRange'](_0x57ce7f),this['_host'][_0x27d58f(0x2e0)]({'token':_0x53bfc6,'type':CollectionChangeEnum[_0x27d58f(0x1a8)],'dataRangeInfo':_0x57ce7f,'targetCellInfo':_0x58c953});}['handleMoveRange'](_0x248a39,_0x3305e4){const _0x59ec6f=_0x5b3260,_0x40cb48=this['getCollection'](_0x248a39),_0xaedab3=_0x40cb48['getFieldIds']();let _0x5c9ba1=0x0;for(const _0x2b0b9a of _0xaedab3){const _0x1bf42c=_0x40cb48['getFieldById'](_0x2b0b9a),_0x619f09=this[_0x59ec6f(0x27d)](_0x3305e4,_0x5c9ba1);this[_0x59ec6f(0x136)](_0x1bf42c[_0x59ec6f(0x34f)],_0x619f09),_0x5c9ba1++;}}[_0x5b3260(0x30f)](){return{'runtimeCellData':{},'dirtyRanges':{}};}[_0x5b3260(0x259)](_0x32ab1f,_0x349fc7){const _0x4b7bef=_0x5b3260;if(this[_0x4b7bef(0x329)](_0x32ab1f)){const _0x8f1ed9=this['getRangeKeyList'](_0x349fc7),_0x52b595=[];for(const _0x535e16 of _0x8f1ed9)if(this[_0x4b7bef(0x1b1)][_0x535e16]!==void 0x0)_0x52b595[_0x4b7bef(0x154)](this[_0x4b7bef(0x1b1)][_0x535e16]);const _0x25e035=this[_0x4b7bef(0x1e3)](_0x32ab1f),_0x42c691=[],_0x2eb7de=new Set(_0x52b595);for(const _0x517ca7 of _0x25e035)if(!_0x2eb7de[_0x4b7bef(0x194)](_0x517ca7))_0x42c691[_0x4b7bef(0x154)](_0x517ca7);return _0x42c691;}}[_0x5b3260(0x22d)](_0x531447,_0x5deefb,_0x52b1ff,_0x1bc5a0,_0x35ade7){const _0x5c762b=_0x5b3260;if(_0x5deefb){if(_0x5deefb[_0x5c762b(0x323)](_0x1bc5a0,_0x35ade7))return _0x5deefb[_0x5c762b(0x323)](_0x1bc5a0,_0x35ade7);}if(_0x52b1ff){if(_0x52b1ff[_0x5c762b(0x323)](_0x1bc5a0,_0x35ade7))return _0x52b1ff['getValue'](_0x1bc5a0,_0x35ade7);}return _0x531447[_0x5c762b(0x323)](_0x1bc5a0,_0x35ade7);}[_0x5b3260(0x33b)](_0x4f5ac4,_0x11c08b,_0x43126b,_0x5633ab){const _0x40a744=_0x5b3260,_0x4ea408=this[_0x40a744(0x363)][_0x4f5ac4];if(!_0x4ea408)return;const {subUnitId:_0x1fbccf,range:_0x5f3995,unitId:_0x5a9cd7}=_0x11c08b,_0x51de0e=this['_univerInstanceService']['getUnit'](_0x5a9cd7);if(!_0x51de0e){console[_0x40a744(0x260)]('workbook\x20is\x20not\x20found');return;}const _0x191483=_0x51de0e['getSheetBySheetId'](_0x1fbccf),_0x4c8c03=_0x191483[_0x40a744(0x438)](),{arrayFormulaCellDataMatrix:_0x5e5868,unitDataMatrix:_0x3502ab}=_0x5633ab||{},{startRow:_0x17a469,startColumn:_0x4db296,endRow:_0x21afbc}=this[_0x40a744(0x314)](_0x5f3995,_0x191483);_0x4ea408['reset']();const _0x474208=_0x51de0e[_0x40a744(0x3a1)](),_0x4f94d5={},_0x4986df=this['getMatrixValue'](_0x4c8c03,_0x5e5868,_0x3502ab,_0x17a469,_0x4db296+_0x43126b);let _0x27c9d0=this[_0x40a744(0x149)](_0x4986df,_0x474208,_0x4f94d5);if((0x0,_univerjs_pro_engine_pivot[_0x40a744(0x1d3)])(_0x27c9d0))_0x27c9d0=_univerjs_core[_0x40a744(0x1d0)][_0x40a744(0x2f7)](_0x27c9d0['f'],Number(_0x27c9d0['v']));const _0x59d81d=this[_0x40a744(0x27f)](_0x27c9d0,_0x4db296+_0x43126b);_0x4ea408[_0x40a744(0x247)](_0x59d81d);for(let _0x2e7468=_0x17a469+0x1;_0x2e7468<=_0x21afbc;_0x2e7468++){const _0x121717=this[_0x40a744(0x22d)](_0x4c8c03,_0x5e5868,_0x3502ab,_0x2e7468,_0x4db296+_0x43126b);_0x4ea408[_0x40a744(0x19a)](this[_0x40a744(0x149)](_0x121717,_0x474208,_0x4f94d5),_0x2e7468-0x1-_0x17a469);}}[_0x5b3260(0x342)](_0x121c10,_0x46db1f,_0x52da76){const _0x509d1d=_0x5b3260,{subUnitId:_0x3e63b2,range:_0x540fd1,unitId:_0x59b8a1}=_0x52da76,_0x59ed4e=this[_0x509d1d(0x2ac)][_0x509d1d(0x1cf)](_0x59b8a1);if(!_0x59ed4e){console['error'](_0x509d1d(0x1cd));return;}const _0x34fdf9=_0x59ed4e['getSheetBySheetId'](_0x3e63b2),_0x17e9d0=_0x34fdf9['getCellMatrix'](),{startRow:_0x4c6886,startColumn:_0x3819ee,endRow:_0x1ba39d}=this[_0x509d1d(0x314)](_0x540fd1,_0x34fdf9),_0x3c5eb6=_0x59ed4e[_0x509d1d(0x3a1)](),_0x110662={};for(const {dataField:_0x1e6252,index:_0x54ce93}of _0x46db1f){_0x1e6252['reset']();const _0x5a1659=this['getMatrixValue'](_0x17e9d0,void 0x0,void 0x0,_0x4c6886,_0x3819ee+_0x54ce93);let _0x4cc165=this[_0x509d1d(0x149)](_0x5a1659,_0x3c5eb6,_0x110662);if((0x0,_univerjs_pro_engine_pivot['isDateValue'])(_0x4cc165))_0x4cc165=_univerjs_core[_0x509d1d(0x1d0)]['format'](_0x4cc165['f'],Number(_0x4cc165['v']));const _0x3d1d7f=this[_0x509d1d(0x27f)](_0x4cc165,_0x3819ee+_0x54ce93);_0x1e6252[_0x509d1d(0x247)](_0x3d1d7f);}_0x121c10[_0x509d1d(0x410)]();for(let _0x126ba7=_0x4c6886+0x1;_0x126ba7<=_0x1ba39d;_0x126ba7++)for(const {index:_0x5b75bf,dataField:_0x5f13b9}of _0x46db1f){const _0x396fe7=_0x17e9d0[_0x509d1d(0x323)](_0x126ba7,_0x3819ee+_0x5b75bf);_0x5f13b9[_0x509d1d(0x19a)](this[_0x509d1d(0x149)](_0x396fe7,_0x3c5eb6,_0x110662),_0x126ba7-0x1-_0x4c6886);}_0x121c10[_0x509d1d(0x39e)](_0x1ba39d-_0x4c6886);}[_0x5b3260(0x21d)](_0x7e737f){const _0x41fc8e=_0x5b3260,{range:_0x21fa09}=_0x7e737f,{startColumn:_0x10088f,endColumn:_0x574120}=_0x21fa09,_0x38dbbd=[];for(let _0x37e49a=_0x10088f;_0x37e49a<=_0x574120;_0x37e49a++)_0x38dbbd[_0x41fc8e(0x154)](this[_0x41fc8e(0x27d)](_0x7e737f,_0x37e49a));return _0x38dbbd;}[_0x5b3260(0x149)](_0xa28a49,_0x5ce7ac,_0x3a07dc){const _0x3b815c=_0x5b3260;if(_0xa28a49){const {s:_0x2499f0,v:_0x67e57e,t:_0x32784d,p:_0x3b6ed0}=_0xa28a49;if(_0x3b6ed0)return getStringFromDataStream(_0x3b6ed0);const _0x41a810=_0x5ce7ac[_0x3b815c(0x3e5)](_0x2499f0);if(_0x41a810&&_0x32784d===_univerjs_core[_0x3b815c(0x267)][_0x3b815c(0x2c8)]&&_0x41a810['n']){const {pattern:_0x1a6653}=_0x41a810['n'];if(!_0x3a07dc[_0x1a6653])_0x3a07dc[_0x1a6653]=_univerjs_core['numfmt']['getFormatInfo'](_0x1a6653);const _0x192ad8=_0x3a07dc[_0x1a6653],_0x24df55=_0x192ad8['isDate'];if(_0x192ad8[_0x3b815c(0x3ad)])return String(_0x67e57e);else{if(_0x24df55)return{'v':_0x67e57e,'f':_0x1a6653};}}if(_0x32784d===_univerjs_core[_0x3b815c(0x267)][_0x3b815c(0x2c8)])return Number(_0x67e57e);else{if(_0x32784d===_univerjs_core[_0x3b815c(0x267)][_0x3b815c(0x156)]||_0x32784d===_univerjs_core['CellValueType']['FORCE_STRING'])return String(_0x67e57e);}if(_0x32784d===void 0x0){const _0x5cfec1=Number(_0x67e57e);if(!Number['isNaN'](_0x5cfec1)&&String(_0x5cfec1)===_0x67e57e)return _0x5cfec1;}return _0x67e57e!==null&&_0x67e57e!==void 0x0?_0x67e57e:null;}else return null;}[_0x5b3260(0x2a5)](_0x367fd0){const _0x168f88=_0x5b3260,{sheetName:_0x15d027,range:_0x17e738,unitId:_0x2ceb1e}=_0x367fd0,_0x522324=this[_0x168f88(0x2ac)]['getUnit'](_0x2ceb1e);if(!_0x522324)return console[_0x168f88(0x260)](_0x168f88(0x1cd)),{'header':[],'data':[]};const _0x5b0092=_0x522324[_0x168f88(0x23f)](_0x15d027),_0x3a3390=_0x5b0092[_0x168f88(0x438)](),{startRow:_0x2d1905,startColumn:_0x39b7ea,endRow:_0x405340,endColumn:_0xc7ce75}=this[_0x168f88(0x314)](_0x17e738,_0x5b0092),_0x26810a=_0x522324[_0x168f88(0x3a1)](),_0x519f8e=[],_0x220669=[],_0x5c00ac={};for(let _0x5f202b=_0x2d1905;_0x5f202b<=_0x405340;_0x5f202b++){const _0xef6f96=[];for(let _0x5e1fbd=_0x39b7ea;_0x5e1fbd<=_0xc7ce75;_0x5e1fbd++){const _0x384e64=_0x3a3390[_0x168f88(0x323)](_0x5f202b,_0x5e1fbd);if(_0x5f202b===_0x2d1905)_0x519f8e[_0x168f88(0x154)](_0x384e64===void 0x0||_0x384e64===null?null:String(_0x384e64['v']));else _0xef6f96[_0x168f88(0x154)](this[_0x168f88(0x149)](_0x384e64,_0x26810a,_0x5c00ac));}_0x220669[_0x168f88(0x154)](_0xef6f96);}return{'header':_0x519f8e,'data':_0x220669};}[_0x5b3260(0x1d4)](){const _0x1c7169=_0x5b3260;return super[_0x1c7169(0x1d4)]();}[_0x5b3260(0x283)](_0xacb481){const _0x329b44=_0x5b3260;super[_0x329b44(0x283)](_0xacb481),this['initDataRanges']();}[_0x5b3260(0x366)](){const _0x185dc0=_0x5b3260;super['dispose'](),this[_0x185dc0(0x1b1)]={},this[_0x185dc0(0x30b)]=null;}};const adjustEmptyViewForCalcEngine=_0x5b89b2=>{const _0x4677e1=_0x5b3260,{targetCellInfo:_0x297963}=_0x5b89b2,{matrixCache:_0x504641,rangesCache:_0x4e6227}=generateDefaultEmptyCache({'filter':'Filter','row':_0x4677e1(0x3ed),'column':'Column','values':_0x4677e1(0x2fd)},_0x297963),_0x530fc5=new _univerjs_core[(_0x4677e1(0x1e5))]();return _0x504641[_0x4677e1(0x1eb)]((_0x36804c,_0x5a5f86,_0x40a2ae)=>{_0x530fc5['setValue'](_0x36804c,_0x5a5f86,_0x40a2ae);}),{'matrix':_0x530fc5,'rangesCache':_0x4e6227};},transformPivotDataToCellData=_0x1df528=>{const _0x1bfa11=_0x5b3260;let _0x81f27c;if((_0x1df528===null||_0x1df528===void 0x0?void 0x0:_0x1df528['v'])||(_0x1df528===null||_0x1df528===void 0x0?void 0x0:_0x1df528['v'])===0x0){if(!_0x81f27c)_0x81f27c={};const _0x3e51f6=transformErrorValue(_0x1df528['v']);if(typeof _0x3e51f6==='number')_0x81f27c['t']=_univerjs_core[_0x1bfa11(0x267)][_0x1bfa11(0x2c8)];else{if(typeof _0x3e51f6===_0x1bfa11(0x3f6))_0x81f27c['t']=_univerjs_core['CellValueType'][_0x1bfa11(0x156)];}_0x81f27c['v']=_0x3e51f6;}return _0x81f27c;},generatorAdjustPositionData=(_0x4b575b,_0x915de1,_0x5772f3)=>{const _0x521f9a=_0x5b3260,{cornerView:_0x2ee678,rowView:_0x55b8cc,colView:_0x21b569,dataView:_0x5c7d44,pageView:_0x593994,formatMap:_0x59b99}=_0x4b575b,{row:_0x34f4a9,col:_0x417f8b}=_0x915de1,_0x252997=new _univerjs_core[(_0x521f9a(0x1e5))]();let _0x9c92bf=_0x34f4a9,_0x547d09=_0x417f8b;Object['keys'](_0x593994[_0x521f9a(0x232)])[_0x521f9a(0x21b)](_0x2af0c1=>{Object['keys'](_0x593994['data'][Number(_0x2af0c1)])['forEach'](_0x1aef82=>{const _0x2a6056=_0x216b,_0x1d1af1={..._0x593994[_0x2a6056(0x232)][Number(_0x2af0c1)][Number(_0x1aef82)]};_0x252997[_0x2a6056(0x333)](Number(_0x2af0c1)+_0x9c92bf,Number(_0x1aef82)+_0x547d09,transformPivotDataToCellData(_0x1d1af1));});});const _0x3fbe8b=Object[_0x521f9a(0x2da)](_0x593994[_0x521f9a(0x232)])['length'];_0x9c92bf+=_0x3fbe8b+(_0x3fbe8b?0x1:0x0);const _0xc2539a=_0x2ee678['getRowCount'](),_0x3b77bd=_0x2ee678[_0x521f9a(0x39a)]();for(let _0x17d2f4=0x0;_0x17d2f4<_0xc2539a;_0x17d2f4++)for(let _0x1a4d6f=0x0;_0x1a4d6f<_0x3b77bd;_0x1a4d6f++){var _0x3ab84b;const _0xd08f11={...(_0x3ab84b=_0x2ee678[_0x521f9a(0x232)])===null||_0x3ab84b===void 0x0||(_0x3ab84b=_0x3ab84b[_0x17d2f4])===null||_0x3ab84b===void 0x0?void 0x0:_0x3ab84b[_0x1a4d6f]};if(_0xd08f11){var _0x437d59;if(((_0x437d59=_0x55b8cc[_0x521f9a(0x159)][_0x1a4d6f])===null||_0x437d59===void 0x0?void 0x0:_0x437d59[_0x521f9a(0x24b)])&&_0x1a4d6f===_0x3b77bd-0x1&&_0x17d2f4===_0xc2539a-0x1)_0xd08f11['v']=''+_0x5772f3[_0x521f9a(0x3c9)];}_0x252997['setValue'](_0x17d2f4+_0x9c92bf,_0x1a4d6f+_0x547d09,transformPivotDataToCellData(_0xd08f11));}_0x547d09+=_0x3b77bd;const _0x1ce0ab=_0x21b569[_0x521f9a(0x159)],_0x2144da=_0x21b569[_0x521f9a(0x322)]()>=0x0?_0x21b569[_0x521f9a(0x322)]()+0x1:0x0,_0x37e6d5=_0x21b569[_0x521f9a(0x400)]()>=0x0?_0x21b569[_0x521f9a(0x400)]()+0x1:0x0;for(let _0x74ca5e=0x0;_0x74ca5e<_0x37e6d5;_0x74ca5e++)for(let _0x22bf26=0x0;_0x22bf26<_0x2144da;_0x22bf26++){var _0x3e161e,_0x53d4af;const _0x4702d9={...(_0x3e161e=_0x21b569[_0x521f9a(0x232)])===null||_0x3e161e===void 0x0||(_0x3e161e=_0x3e161e[_0x74ca5e])===null||_0x3e161e===void 0x0?void 0x0:_0x3e161e[_0x22bf26]},_0x4550e8=_0x59b99[(_0x53d4af=_0x1ce0ab[_0x74ca5e])===null||_0x53d4af===void 0x0?void 0x0:_0x53d4af[_0x521f9a(0x25f)]];if(_0x4702d9){var _0x3cb9af;_0x4702d9['v']=transFromCellValue(_0x4702d9,_0x74ca5e===0x0&&((_0x3cb9af=_0x21b569[_0x521f9a(0x2e1)](_0x22bf26+0x1))===null||_0x3cb9af===void 0x0?void 0x0:_0x3cb9af[_0x521f9a(0x24b)]),_0x4550e8,_0x5772f3);}_0x252997[_0x521f9a(0x333)](_0x74ca5e+_0x9c92bf,_0x22bf26+_0x547d09,transformPivotDataToCellData(_0x4702d9));}_0x9c92bf+=_0xc2539a;const _0x16b77d=_0x55b8cc['headerMap'],_0xe75c91=_0x55b8cc[_0x521f9a(0x322)]()>=0x0?_0x55b8cc[_0x521f9a(0x322)]()+0x1:0x0,_0x287a7f=_0x55b8cc['getLastCol']()>=0x0?_0x55b8cc[_0x521f9a(0x400)]()+0x1:0x0;for(let _0x2465bb=0x0;_0x2465bb<_0xe75c91;_0x2465bb++)for(let _0x34f384=0x0;_0x34f384<_0x287a7f;_0x34f384++){var _0xbe8b50,_0x4a9182;const _0x8e0530={...(_0xbe8b50=_0x55b8cc[_0x521f9a(0x232)])===null||_0xbe8b50===void 0x0||(_0xbe8b50=_0xbe8b50[_0x2465bb])===null||_0xbe8b50===void 0x0?void 0x0:_0xbe8b50[_0x34f384]},_0x23edf2=_0x59b99[(_0x4a9182=_0x16b77d[_0x34f384])===null||_0x4a9182===void 0x0?void 0x0:_0x4a9182[_0x521f9a(0x25f)]];if(_0x8e0530)_0x8e0530['v']=transFromCellValue(_0x8e0530,![],_0x23edf2,_0x5772f3);_0x252997[_0x521f9a(0x333)](_0x2465bb+_0x9c92bf,_0x34f384+_0x417f8b,transformPivotDataToCellData(_0x8e0530));}const _0x39cacd=_0x5c7d44[_0x521f9a(0x427)](),_0x8483fb=_0x5c7d44[_0x521f9a(0x39a)]();for(let _0x4d5788=0x0;_0x4d5788<_0x39cacd;_0x4d5788++)for(let _0x5f17bd=0x0;_0x5f17bd<_0x8483fb;_0x5f17bd++){var _0x19f3c3;const _0x4f5594={...(_0x19f3c3=_0x5c7d44[_0x521f9a(0x232)])===null||_0x19f3c3===void 0x0||(_0x19f3c3=_0x19f3c3[_0x4d5788])===null||_0x19f3c3===void 0x0?void 0x0:_0x19f3c3[_0x5f17bd]};_0x252997[_0x521f9a(0x333)](_0x4d5788+_0x9c92bf,_0x5f17bd+_0x547d09,transformPivotDataToCellData(_0x4f5594));}return _0x252997;},adjustViewForCalcEngine=_0xc51929=>{const _0xf77e98=_0x5b3260,{view:_0x3adbcd,targetCellInfo:_0x100d18,isEmpty:_0x49b436,textInfo:_0x5af957}=_0xc51929;if(_0x49b436)return adjustEmptyViewForCalcEngine(_0xc51929);const {pageView:_0x2b357c,cornerView:_0x35a704,rowView:_0x496cab,colView:_0x4ea8d7,dataView:_0x345f4f}=_0x3adbcd,_0x20ed1d=getAdjustRangesPosition(_0x100d18,_0x2b357c,!![]),_0x3fbbcb=_0x2b357c['lastRow']>=0x0?_0x2b357c[_0xf77e98(0x3e4)]+0x1:0x0,_0x2006de=_0x35a704[_0xf77e98(0x427)](),_0x461407=_0x35a704[_0xf77e98(0x39a)](),_0x316732=_0x20ed1d[_0xf77e98(0x2b9)]>0x0?0x1:0x0,_0x9b71f=getAdjustRangesPosition({'row':_0x100d18[_0xf77e98(0x1c0)]+_0x3fbbcb+_0x316732,'col':_0x100d18[_0xf77e98(0x1c6)]},_0x35a704,![],![]),_0x50a8ef={'rowRanges':getAdjustRangesPosition({'row':_0x100d18[_0xf77e98(0x1c0)]+_0x3fbbcb+_0x316732+_0x2006de,'col':_0x100d18[_0xf77e98(0x1c6)]},_0x496cab,![],!![]),'colRanges':getAdjustRangesPosition({'row':_0x100d18['row']+_0x3fbbcb+_0x316732,'col':_0x100d18['col']+_0x461407},_0x4ea8d7,![],!![]),'cornerRanges':_0x9b71f,'dataRanges':getAdjustRangesPosition({'row':_0x100d18['row']+_0x3fbbcb+_0x316732+_0x2006de,'col':_0x100d18[_0xf77e98(0x1c6)]+_0x461407},_0x345f4f,![],![]),'pageRanges':_0x20ed1d};return{'matrix':generatorAdjustPositionData(_0x3adbcd,_0x100d18,_0x5af957),'rangesCache':_0x50a8ef};};let SheetsPivotDataSourceModel=class SheetsPivotDataSourceModel extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x52a289,_0x5ba0c8,_0x4ae9c9,_0x37c880,_0x5543ac){const _0xc57851=_0x5b3260;super(),this['_injector']=_0x52a289,this[_0xc57851(0x2ac)]=_0x5ba0c8,this[_0xc57851(0x28c)]=_0x4ae9c9,this[_0xc57851(0x389)]=_0x37c880,this[_0xc57851(0x2ca)]=_0x5543ac,_defineProperty(this,_0xc57851(0x145),new Map()),_defineProperty(this,_0xc57851(0x147),new Map()),_defineProperty(this,_0xc57851(0x33c),new Map()),_defineProperty(this,'_textInfo',void 0x0),_defineProperty(this,'_collectionChange$',new rxjs[(_0xc57851(0x355))]()),_defineProperty(this,_0xc57851(0x2e5),this[_0xc57851(0x192)][_0xc57851(0x1c9)]()),_defineProperty(this,_0xc57851(0x2d5),new rxjs['Subject']()),_defineProperty(this,_0xc57851(0x199),this[_0xc57851(0x2d5)][_0xc57851(0x1c9)]()),_defineProperty(this,_0xc57851(0x191),new rxjs[(_0xc57851(0x355))]()),_defineProperty(this,_0xc57851(0x1e4),this['_fieldsCollectionChange$'][_0xc57851(0x1c9)]()),_defineProperty(this,_0xc57851(0x12d),new Map()),_defineProperty(this,_0xc57851(0x308),[]),_defineProperty(this,_0xc57851(0x334),new Map()),this['_initSnapshot']();}[_0x5b3260(0x382)](){const _0x5ab5f7=_0x5b3260;if(!this[_0x5ab5f7(0x37e)])return defaultTextInfo;return this[_0x5ab5f7(0x37e)];}['setTextInfo'](_0x150470){const _0x15e7de=_0x5b3260;this[_0x15e7de(0x37e)]=_0x150470;}[_0x5b3260(0x1a3)](_0x1abffe){const _0x2ce6d8=_0x5b3260,{from:_0x58f51a,to:_0x3391e6,unitId:_0x4bd8ba,fromRange:_0x9ad3a6,toRange:_0x1760e8}=_0x1abffe;if(_0x58f51a&&_0x3391e6){var _0x247593;const _0x5d0eef=this[_0x2ce6d8(0x2d3)](_0x4bd8ba),_0x3e6ba1=this['_model'][_0x2ce6d8(0x3e5)](_0x4bd8ba),_0x31b676=(_0x247593=this[_0x2ce6d8(0x2ac)]['getUnit'](_0x4bd8ba))===null||_0x247593===void 0x0?void 0x0:_0x247593[_0x2ce6d8(0x26d)](_0x3391e6['subUnitId']);if(!_0x3e6ba1||!_0x31b676)return;const _0x2e7ea5=_0x31b676===null||_0x31b676===void 0x0?void 0x0:_0x31b676[_0x2ce6d8(0x1c2)]();for(const [_0x91ee43,_0x2afed7]of _0x3e6ba1[_0x2ce6d8(0x17a)]())for(const [_0x3ed584,_0x37f31d]of _0x2afed7['entries']()){const {sourceRangeInfo:_0x45ae9f}=_0x37f31d;if(_0x45ae9f[_0x2ce6d8(0x30d)]===_0x4bd8ba&&_0x45ae9f[_0x2ce6d8(0x2a1)]===_0x58f51a[_0x2ce6d8(0x2a1)]&&_univerjs_core['Rectangle'][_0x2ce6d8(0x31f)](_0x9ad3a6,_0x45ae9f[_0x2ce6d8(0x30e)])){const _0xff26c4={'row':_0x45ae9f['range'][_0x2ce6d8(0x401)]-_0x9ad3a6[_0x2ce6d8(0x401)],'col':_0x45ae9f['range'][_0x2ce6d8(0x29c)]-_0x9ad3a6[_0x2ce6d8(0x29c)]},_0x340c02={'unitId':_0x4bd8ba,'subUnitId':_0x3391e6[_0x2ce6d8(0x2a1)],'sheetName':_0x2e7ea5,'range':{'startRow':_0x1760e8['startRow']+_0xff26c4[_0x2ce6d8(0x1c0)],'endRow':_0x1760e8[_0x2ce6d8(0x401)]+_0xff26c4[_0x2ce6d8(0x1c0)]+_0x45ae9f['range'][_0x2ce6d8(0x249)]-_0x45ae9f[_0x2ce6d8(0x30e)][_0x2ce6d8(0x401)],'startColumn':_0x1760e8[_0x2ce6d8(0x29c)]+_0xff26c4[_0x2ce6d8(0x1c6)],'endColumn':_0x1760e8[_0x2ce6d8(0x29c)]+_0xff26c4[_0x2ce6d8(0x1c6)]+_0x45ae9f[_0x2ce6d8(0x30e)][_0x2ce6d8(0x2bc)]-_0x45ae9f['range']['startColumn']}};_0x5d0eef['handleMoveRange'](_0x3ed584,_0x340c02);const _0x45152c={..._0x37f31d,'sourceRangeInfo':_0x340c02};this['_updateModelCache'](_0x4bd8ba,_0x3391e6[_0x2ce6d8(0x2a1)],_0x3ed584,_0x45152c),this[_0x2ce6d8(0x2e0)]({'unitId':_0x4bd8ba,'token':_0x3ed584,'type':CollectionChangeEnum[_0x2ce6d8(0x33a)],'oldSourceRangeInfo':_0x45ae9f,'dataRangeInfo':_0x340c02,'targetCellInfo':_0x37f31d[_0x2ce6d8(0x226)]}),this[_0x2ce6d8(0x164)]({'unitId':_0x4bd8ba,'subUnitId':_0x3391e6[_0x2ce6d8(0x2a1)],'oldSubUnitId':_0x91ee43,'pivotTableId':_0x3ed584,'pivotTableConfig':_0x45152c,'collectionConfig':_0x5d0eef['toJSON']()});}}}}[_0x5b3260(0x2e0)](_0x17b7ec){const _0x3b5bd2=_0x5b3260;this[_0x3b5bd2(0x192)]['next'](_0x17b7ec);}[_0x5b3260(0x2d3)](_0x4fed4a){const _0x2e2b3d=_0x5b3260;let _0x208b7a=this[_0x2e2b3d(0x12d)]['get'](_0x4fed4a);return!_0x208b7a&&(_0x208b7a=new SheetsPivotDataFieldManager(this,this[_0x2e2b3d(0x2ac)]),this[_0x2e2b3d(0x12d)]['set'](_0x4fed4a,_0x208b7a)),_0x208b7a;}['getCollection'](_0x1e8390,_0x59963d){const _0x2fa88e=_0x5b3260;return this[_0x2fa88e(0x2d3)](_0x1e8390)['collections'][_0x59963d];}['getUpdateRangeDeleteIds'](_0x4e32c0,_0x451ec8,_0x18ec59){const _0x5a30dc=_0x5b3260;return this['getDataFieldManager'](_0x4e32c0)[_0x5a30dc(0x259)](_0x451ec8,_0x18ec59);}[_0x5b3260(0x3b8)](_0x11a566,_0x527bda){const _0x54216c=_0x5b3260;let _0x1ac8dd=this[_0x54216c(0x145)][_0x54216c(0x3e5)](_0x11a566);!_0x1ac8dd&&(_0x1ac8dd=new Map(),this['_model'][_0x54216c(0x2c9)](_0x11a566,_0x1ac8dd));let _0x3db8cd=_0x1ac8dd[_0x54216c(0x3e5)](_0x527bda);return!_0x3db8cd&&(_0x3db8cd=new Map(),_0x1ac8dd[_0x54216c(0x2c9)](_0x527bda,_0x3db8cd)),_0x3db8cd;}[_0x5b3260(0x3c5)](_0x523714,_0x5781f1,_0x49b265,_0x503801){const _0x5165d6=_0x5b3260;this['_ensurePivotMap'](_0x523714,_0x5781f1)[_0x5165d6(0x2c9)](_0x49b265,_0x503801);}[_0x5b3260(0x2e3)](_0x1bbf50,_0x2e7a27,_0x559616){const _0x593033=_0x5b3260;var _0x27597a;if((_0x27597a=this[_0x593033(0x145)][_0x593033(0x3e5)](_0x1bbf50))===null||_0x27597a===void 0x0||(_0x27597a=_0x27597a['get'](_0x2e7a27))===null||_0x27597a===void 0x0?void 0x0:_0x27597a[_0x593033(0x3e5)](_0x559616)){var _0x14342b;(_0x14342b=this[_0x593033(0x145)][_0x593033(0x3e5)](_0x1bbf50))===null||_0x14342b===void 0x0||(_0x14342b=_0x14342b['get'](_0x2e7a27))===null||_0x14342b===void 0x0||_0x14342b[_0x593033(0x384)](_0x559616);}}['_updatePivotTableInstanceCache'](_0xa7ef12,_0x14e343){const _0x2c1f43=_0x5b3260;this['_pivotTableInstanceCache'][_0x2c1f43(0x2c9)](_0xa7ef12,_0x14e343);}[_0x5b3260(0x411)](_0x15885a){const _0x5b3448=_0x5b3260;this['_pivotTableInstanceCache'][_0x5b3448(0x384)](_0x15885a);}[_0x5b3260(0x2d8)](_0x40ee89,_0x160066){const _0x462551=_0x5b3260;let _0x546f08=this[_0x462551(0x33c)][_0x462551(0x3e5)](_0x40ee89);!_0x546f08&&(_0x546f08=new Map(),this['_viewData']['set'](_0x40ee89,_0x546f08));let _0x5918f9=_0x546f08[_0x462551(0x3e5)](_0x160066);return!_0x5918f9&&(_0x5918f9=new Map(),_0x546f08[_0x462551(0x2c9)](_0x160066,_0x5918f9)),_0x5918f9;}['updateConfig'](_0x2ed1d8){const _0x1354e0=_0x5b3260,{unitId:_0x2b1d57,subUnitId:_0x3133d7,pivotTableId:_0x122afc,pivotTableConfig:_0x38a34b,collectionConfig:_0x33b5fd}=_0x2ed1d8,_0x18348b={'unitId':_0x2b1d57,'subUnitId':_0x3133d7,'oldSubUnitId':_0x3133d7,'pivotTableId':_0x122afc,'pivotTableConfig':_0x38a34b,'collectionConfig':_0x33b5fd};this[_0x1354e0(0x389)]['executeCommand'](SendPivotConfigLocalMutation['id'],_0x18348b,{'onlyLocal':!![]});}[_0x5b3260(0x3dd)](_0x1e5ccd,_0xcc3af,_0x69c6c2,_0x31c29f,_0x55adf2,_0x272768,_0x2702a4,_0x39b33e=![]){const _0x2fbcc1=_0x5b3260;var _0x10304a;this[_0x2fbcc1(0x389)][_0x2fbcc1(0x37a)](SendPivotViewLocalMutation['id'],{'single':{'unitId':_0x1e5ccd,'subUnitId':_0xcc3af,'type':_0x69c6c2,'pivotTableId':_0x31c29f,'view':_0x55adf2,'pivotConfig':_0x272768},'collectionConfig':{[_0x1e5ccd]:_0x2702a4}},{'onlyLocal':!![]});const _0x253e4d=Boolean((_0x10304a=this[_0x2fbcc1(0x407)](_0x31c29f))===null||_0x10304a===void 0x0?void 0x0:_0x10304a[_0x2fbcc1(0x40d)]()),_0x371b43=this[_0x2fbcc1(0x32a)](_0x1e5ccd,_0xcc3af,_0x31c29f);if(_0x371b43)this['updateViewData']({'view':_0x55adf2,'pivotTableId':_0x31c29f,'textInfo':this[_0x2fbcc1(0x382)](),'isEmpty':_0x253e4d,'targetCellInfo':_0x371b43[_0x2fbcc1(0x226)]},_0x39b33e);}[_0x5b3260(0x37f)](_0x265f93,_0xab02a5){const _0x21b0a8=_0x5b3260,{targetCellInfo:_0x2a2dda,pivotTableId:_0x5834f1}=_0x265f93,{unitId:_0x49672c,subUnitId:_0x927172}=_0x2a2dda,_0x1e0900=this[_0x21b0a8(0x2d8)](_0x49672c,_0x927172),_0x1ec872=_0x1e0900[_0x21b0a8(0x3e5)](_0x5834f1);let _0x33a6d9,_0x20f63d;_0x1ec872&&(_0x33a6d9=_0x1ec872['rangeCache'],_0x20f63d=_0x1ec872[_0x21b0a8(0x3ae)]);const {rangesCache:_0x556db9,matrix:_0x94cd60}=adjustViewForCalcEngine(_0x265f93);_0x1e0900[_0x21b0a8(0x2c9)](_0x5834f1,{'rangeCache':_0x556db9,'matrix':_0x94cd60,'oldMatrix':_0x20f63d,'oldRangeCache':_0x33a6d9});if(!_0xab02a5)this['_viewData$'][_0x21b0a8(0x3e1)]({'unitId':_0x49672c,'subUnitId':_0x927172,'pivotTableId':_0x5834f1});}[_0x5b3260(0x29a)](_0x4faa8e,_0xa23829,_0x63dc88,_0x2dc0bc,_0x599f88){const _0x10cf3f=_0x5b3260;this[_0x10cf3f(0x3c5)](_0x4faa8e,_0xa23829,_0x63dc88,_0x599f88),this[_0x10cf3f(0x155)](_0x63dc88,_0x2dc0bc);}[_0x5b3260(0x133)](_0x30bfab,_0x18117b,_0x248edd){const _0x5df4a1=_0x5b3260,_0x1575cf=this[_0x5df4a1(0x2d3)](_0x30bfab);_0x1575cf[_0x5df4a1(0x1e3)](_0x248edd)[_0x5df4a1(0x21b)](_0x99fc5c=>{const _0x98be10=_0x5df4a1;_0x1575cf[_0x98be10(0x3e0)](_0x99fc5c);}),this[_0x5df4a1(0x1d6)](_0x30bfab,_0x248edd),this[_0x5df4a1(0x2e3)](_0x30bfab,_0x18117b,_0x248edd),this[_0x5df4a1(0x411)](_0x248edd);}['setPivotTable'](_0x3676a9,_0x5dc8bc,_0x1fbdad,_0x2a7ccc){const _0x4fd2c4=_0x5b3260;this[_0x4fd2c4(0x3c5)](_0x3676a9,_0x5dc8bc,_0x1fbdad,_0x2a7ccc);}[_0x5b3260(0x32a)](_0x394087,_0x1222a8,_0x334505){const _0x225c3b=_0x5b3260;var _0x39185a;const _0x46214e=(_0x39185a=this[_0x225c3b(0x145)][_0x225c3b(0x3e5)](_0x394087))===null||_0x39185a===void 0x0||(_0x39185a=_0x39185a['get'](_0x1222a8))===null||_0x39185a===void 0x0?void 0x0:_0x39185a[_0x225c3b(0x3e5)](_0x334505);if(_0x46214e)return _0x46214e;}['getPivotTableModelConfig'](_0x2d6ba2,_0x2540ce,_0x597d60){const _0x3caa0e=_0x5b3260;var _0x5b1003;const _0x438e6b=(_0x5b1003=this['_model']['get'](_0x2d6ba2))===null||_0x5b1003===void 0x0||(_0x5b1003=_0x5b1003[_0x3caa0e(0x3e5)](_0x2540ce))===null||_0x5b1003===void 0x0?void 0x0:_0x5b1003['get'](_0x597d60);if(_0x438e6b)return _0x438e6b['fieldsConfig'];}['getPivotTableInstance'](_0x84ef5e){const _0x20b13b=_0x5b3260;return this[_0x20b13b(0x147)][_0x20b13b(0x3e5)](_0x84ef5e);}[_0x5b3260(0x230)](_0x4d38f8){const _0x133d84=_0x5b3260;this[_0x133d84(0x145)][_0x133d84(0x384)](_0x4d38f8);const _0x5e9d27=this['_dataFieldManagerCollection']['get'](_0x4d38f8);_0x5e9d27&&(_0x5e9d27[_0x133d84(0x366)](),this[_0x133d84(0x12d)][_0x133d84(0x384)](_0x4d38f8)),this[_0x133d84(0x33c)][_0x133d84(0x384)](_0x4d38f8),this[_0x133d84(0x308)][_0x133d84(0x21b)](_0x2fa073=>{_0x2fa073['deleteUnitId'](_0x4d38f8);});}[_0x5b3260(0x3e2)](_0x349a43,_0x11122d,_0x4c24e9,_0x54a458){const _0x26991f=_0x5b3260;return this[_0x26991f(0x2d3)](_0x4c24e9[_0x26991f(0x30d)])[_0x26991f(0x3e2)](_0x349a43,_0x11122d,_0x4c24e9,_0x54a458);}['createCollectionWithDataRange'](_0x10523e){const _0x404187=_0x5b3260;return this['getDataFieldManager'](_0x10523e['unitId'])[_0x404187(0x179)](_0x10523e);}[_0x5b3260(0x342)](_0x1db09a,_0x5b7bad,_0x16fca0){const _0x1276b3=_0x5b3260;this[_0x1276b3(0x2d3)](_0x16fca0[_0x1276b3(0x30d)])[_0x1276b3(0x342)](_0x1db09a,_0x5b7bad,_0x16fca0);}[_0x5b3260(0x24f)](_0x20473f,_0x48868c){this['getDataFieldManager'](_0x20473f)['deleteDataField'](_0x48868c);}[_0x5b3260(0x1d6)](_0x5e4150,_0x170a79){const _0x4a0ac6=_0x5b3260;this[_0x4a0ac6(0x2d3)](_0x5e4150)[_0x4a0ac6(0x3ee)](_0x170a79);}['getSubUnitPivotConfigs'](_0xa80de2,_0x157945){const _0x28420f=_0x5b3260;var _0x374bb8;return(_0x374bb8=this[_0x28420f(0x145)][_0x28420f(0x3e5)](_0xa80de2))===null||_0x374bb8===void 0x0?void 0x0:_0x374bb8[_0x28420f(0x3e5)](_0x157945);}['getTargetByPivotId'](_0x13f594){const _0x2d8dd1=_0x5b3260;for(const [_0x4e6652,_0x249027]of this[_0x2d8dd1(0x145)][_0x2d8dd1(0x17a)]())for(const [_0x2b04ab,_0x2f9310]of _0x249027[_0x2d8dd1(0x17a)]())if(_0x2f9310[_0x2d8dd1(0x194)](_0x13f594))return{'unitId':_0x4e6652,'subUnitId':_0x2b04ab};return null;}[_0x5b3260(0x3fb)](_0x159628,_0x1c07bd,_0x329651,_0x6d8498){const _0x6611d3=_0x5b3260,_0x5317be=this['_ensureViewDataMap'](_0x159628,_0x1c07bd);if(_0x6d8498)_0x5317be['set'](_0x329651,_0x6d8498);else _0x5317be['delete'](_0x329651);this[_0x6611d3(0x2d5)][_0x6611d3(0x3e1)]({'unitId':_0x159628,'subUnitId':_0x1c07bd,'pivotTableId':_0x329651});}['dispose'](){const _0xdd702e=_0x5b3260;super[_0xdd702e(0x366)](),this[_0xdd702e(0x145)][_0xdd702e(0x3f7)](),this[_0xdd702e(0x147)][_0xdd702e(0x3f7)](),this['_viewData'][_0xdd702e(0x3f7)](),this[_0xdd702e(0x192)][_0xdd702e(0x182)](),this[_0xdd702e(0x2d5)][_0xdd702e(0x182)](),this['_fieldsCollectionChange$']['complete'](),this['_dataFieldManagerCollection'][_0xdd702e(0x21b)](_0x31a23d=>_0x31a23d['dispose']()),this[_0xdd702e(0x12d)][_0xdd702e(0x3f7)]();}['getViewData'](_0x224a31,_0x4ae0cd,_0xe533db){const _0x2d6ae5=_0x5b3260;var _0x4154e7;const _0x4c38df=(_0x4154e7=this[_0x2d6ae5(0x33c)][_0x2d6ae5(0x3e5)](_0x224a31))===null||_0x4154e7===void 0x0||(_0x4154e7=_0x4154e7[_0x2d6ae5(0x3e5)](_0x4ae0cd))===null||_0x4154e7===void 0x0?void 0x0:_0x4154e7[_0x2d6ae5(0x3e5)](_0xe533db);if(_0x4c38df)return _0x4c38df;return null;}[_0x5b3260(0x1c8)](_0x4343b0){const _0x90f11f=_0x5b3260;this[_0x90f11f(0x1ed)](_0x4343b0);}['updateDirtyPivotTable'](_0x2e0827){const _0x199026=_0x5b3260,{token:_0x3501c7,unitId:_0xef5780,subUnitId:_0x2967d0}=_0x2e0827,_0x1e1d21=_0xef5780+'-'+_0x2967d0+'-'+_0x3501c7;if(this[_0x199026(0x334)][_0x199026(0x3e5)](_0x1e1d21))clearTimeout(this[_0x199026(0x334)]['get'](_0x1e1d21));const _0x54d018=setTimeout(()=>{const _0x255330=_0x199026;this[_0x255330(0x33e)](_0x2e0827),this[_0x255330(0x334)][_0x255330(0x384)](_0x1e1d21);},0x1e);this['_queryingMap']['set'](_0x1e1d21,_0x54d018);}[_0x5b3260(0x33e)](_0x1a930a){const _0x221ff3=_0x5b3260,{unitId:_0x3049e2,subUnitId:_0x59f71a,token:_0x40d23e,type:_0x1d6e25,pivotConfig:_0x2cbfdc}=_0x1a930a,_0x40583c=this['getPivotTableInstance'](_0x40d23e),_0x2e8cc9=_0x40583c===null||_0x40583c===void 0x0?void 0x0:_0x40583c['query'](),_0x4a5824=_0x2cbfdc!==null&&_0x2cbfdc!==void 0x0?_0x2cbfdc:this[_0x221ff3(0x32a)](_0x3049e2,_0x59f71a,_0x40d23e);if(_0x4a5824)_0x4a5824[_0x221ff3(0x40d)]=!!(_0x40583c===null||_0x40583c===void 0x0?void 0x0:_0x40583c['isEmpty']());if(_0x2e8cc9||_0x1d6e25===PivotTableOperationEnum[_0x221ff3(0x153)])this[_0x221ff3(0x3dd)](_0x3049e2,_0x59f71a,_0x1d6e25,_0x40d23e,_0x2e8cc9,_0x4a5824,this[_0x221ff3(0x2d3)](_0x3049e2)['toJSON']());}[_0x5b3260(0x1d4)](_0x37ac16){const _0x1c9e31=_0x5b3260,_0x392e41={'dataFieldManagerConfig':{},'pivotTableConfigs':{}};if(this[_0x1c9e31(0x2d3)](_0x37ac16))_0x392e41[_0x1c9e31(0x31d)][_0x37ac16]=this[_0x1c9e31(0x2d3)](_0x37ac16)['toJSON']();if(this[_0x1c9e31(0x145)][_0x1c9e31(0x3e5)](_0x37ac16)){_0x392e41[_0x1c9e31(0x13c)][_0x37ac16]={};const _0x3b65f6=this[_0x1c9e31(0x145)][_0x1c9e31(0x3e5)](_0x37ac16);if(_0x3b65f6===null||_0x3b65f6===void 0x0?void 0x0:_0x3b65f6[_0x1c9e31(0x275)])[..._0x3b65f6[_0x1c9e31(0x2da)]()]['forEach'](_0x26d995=>{const _0x2cc551=_0x1c9e31,_0x3ed4b1=_0x3b65f6[_0x2cc551(0x3e5)](_0x26d995);(_0x3ed4b1===null||_0x3ed4b1===void 0x0?void 0x0:_0x3ed4b1[_0x2cc551(0x275)])&&(_0x392e41['pivotTableConfigs'][_0x37ac16][_0x26d995]={},[..._0x3ed4b1[_0x2cc551(0x2da)]()][_0x2cc551(0x21b)](_0x18fcf3=>{const _0x508af6=_0x2cc551,_0xaee7f3=_0x3ed4b1[_0x508af6(0x3e5)](_0x18fcf3);if(_0xaee7f3)_0x392e41[_0x508af6(0x13c)][_0x37ac16][_0x26d995][_0x18fcf3]=_0xaee7f3;}));});}return _0x392e41;}[_0x5b3260(0x283)](_0x273f2c){const _0x51e774=_0x5b3260,{dataFieldManagerConfig:_0x3b86ac,pivotTableConfigs:_0x21c9f5}=_0x273f2c;if(_0x3b86ac)Object[_0x51e774(0x2da)](_0x3b86ac)[_0x51e774(0x21b)](_0x571c27=>{const _0x5442f5=_0x51e774;this['getDataFieldManager'](_0x571c27)[_0x5442f5(0x283)](_0x3b86ac[_0x571c27]);});const _0x19c2f0=[];if(_0x21c9f5){var _0x42b29c;const {ls:_0x22d400,pbk:_0x30943b}=(_0x42b29c=this['_injector'][_0x51e774(0x3e5)](_univerjs_core['IConfigService'])[_0x51e774(0x2fe)](_univerjs_pro_license[_0x51e774(0x1a6)]))!==null&&_0x42b29c!==void 0x0?_0x42b29c:{},_0x4e3255=getPivotInfoByLicense(0x1,_0x22d400,_0x30943b)['count'];Object[_0x51e774(0x2da)](_0x21c9f5)[_0x51e774(0x21b)](_0x157b2b=>{const _0x147de1=_0x51e774;let _0x5ef1c9=0x0;const _0x18498a=_0x21c9f5[_0x157b2b];Object[_0x147de1(0x2da)](_0x18498a)['forEach'](_0x307178=>{const _0x3f292e=_0x147de1,_0x3c05a3=_0x18498a[_0x307178];Object[_0x3f292e(0x2da)](_0x3c05a3)[_0x3f292e(0x21b)](_0x33f87f=>{const _0xffc27=_0x3f292e,_0x5290f9=_0x3c05a3[_0x33f87f];if(_0x5290f9){if(_0x5ef1c9>=_0x4e3255)return;_0x5ef1c9++;const _0xb14de7=this[_0xffc27(0x2d3)](_0x157b2b),_0x1454b9=_0xb14de7['collections'][_0x33f87f],_0x37acc4=_0x1454b9['getFieldIds']();let _0x37afb6=0x0;const _0x16608d=[];for(const _0x40682a of _0x37acc4){const _0xe56ac=_0x1454b9[_0xffc27(0x25b)](_0x40682a);if((0x0,_univerjs_pro_engine_pivot[_0xffc27(0x15e)])(_0xe56ac)){const _0x50e25c=_0xe56ac['getOriginFieldId'](),_0x2d670e=_0x1454b9[_0xffc27(0x25b)](_0x50e25c);if(_0x2d670e)_0x16608d['push']([_0xe56ac,_0x2d670e]);continue;}_0xb14de7[_0xffc27(0x33b)](_0x40682a,_0x5290f9[_0xffc27(0x3d4)],_0x37afb6),_0x37afb6++;}_0x16608d['forEach'](([_0x434a53,_0x2aa30b])=>{_0x434a53['refreshGroupField'](_0x2aa30b);});const _0x1ddcac=new _univerjs_pro_engine_pivot[(_0xffc27(0x404))](_0x1454b9);_0x1ddcac[_0xffc27(0x283)](_0x5290f9['fieldsConfig']),this['addPivotTable'](_0x157b2b,_0x307178,_0x33f87f,_0x1ddcac,_0x5290f9);const _0x557741=_0x1ddcac[_0xffc27(0x3e7)]();_0x19c2f0[_0xffc27(0x154)]({'unitId':_0x157b2b,'subUnitId':_0x307178,'pivotTableId':_0x33f87f,'view':_0x557741[_0xffc27(0x1d4)](),'pivotConfig':_0x5290f9,'type':PivotTableOperationEnum['Add']});const _0x339c47=Boolean(_0x1ddcac[_0xffc27(0x40d)]()),_0x535837={'view':_0x557741,'pivotTableId':_0x33f87f,'textInfo':this[_0xffc27(0x382)](),'isEmpty':_0x339c47,'targetCellInfo':_0x5290f9[_0xffc27(0x226)]};this[_0xffc27(0x37f)](_0x535837,![]);}});});});}if(_0x3b86ac)Object[_0x51e774(0x2da)](_0x3b86ac)[_0x51e774(0x21b)](_0x1eddde=>{const _0x2d544a=_0x51e774,_0x5241c8=this[_0x2d544a(0x2d3)](_0x1eddde);this[_0x2d544a(0x191)]['next'](_0x5241c8['collections']);});this[_0x51e774(0x389)][_0x51e774(0x37a)](SendPivotViewLocalMutation['id'],{'batch':_0x19c2f0,'collectionConfig':_0x3b86ac},{'onlyLocal':!![]});}[_0x5b3260(0x2eb)](){const _0x264f6f=_0x5b3260;this[_0x264f6f(0x1bf)](this[_0x264f6f(0x2ca)][_0x264f6f(0x3bf)]({'toJson':_0x8c3551=>{const _0x2bedfb=_0x264f6f;return JSON[_0x2bedfb(0x1bd)](this['toJSON'](_0x8c3551));},'parseJson':_0x33e7be=>{const _0x4dfda3=_0x264f6f;if(!_0x33e7be)return{};try{return JSON[_0x4dfda3(0x2c3)](_0x33e7be);}catch(_0xf5ff44){return{};}},'businesses':[_univerjs_core[_0x264f6f(0x1b7)][_0x264f6f(0x2e8)]],'pluginName':SHEET_PIVOT_TABLE_PLUGIN,'onLoad':(_0x357a56,_0x888d1d)=>{const _0x2d801a=_0x264f6f;this[_0x2d801a(0x283)](_0x888d1d);},'onUnLoad':_0x1bbc53=>{const _0x2a9635=_0x264f6f;this[_0x2a9635(0x230)](_0x1bbc53);}}));}};SheetsPivotDataSourceModel=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x5b3260(0x1e6)])),__decorateParam(0x1,_univerjs_core[_0x5b3260(0x13e)]),__decorateParam(0x2,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core['LifecycleService'])),__decorateParam(0x3,_univerjs_core['ICommandService']),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core['IResourceManagerService']))],SheetsPivotDataSourceModel);const defaultEmptyMatrix={0x0:{0x0:{'v':'filter','s':defaultEmptyPivotFieldCellStyle}},0x2:{0x1:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x2:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x3:{'v':_0x5b3260(0x3d1),'s':defaultEmptyPivotFieldCellStyle},0x4:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x5:{'v':'','s':defaultEmptyPivotFieldCellStyle}},0x3:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x4:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x5:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x6:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x7:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x8:{0x0:{'v':'row','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'values','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x9:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xa:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xb:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xc:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xd:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}}},defaultEmptyRanges={'rowRanges':[{'startRow':0x3,'endRow':0xd,'startColumn':0x0,'endColumn':0x0}],'colRanges':[{'startRow':0x2,'endRow':0x2,'startColumn':0x1,'endColumn':0x5}],'dataRanges':[{'startRow':0x3,'endRow':0xd,'startColumn':0x1,'endColumn':0x5}],'pageRanges':[{'startRow':0x0,'endRow':0x0,'startColumn':0x0,'endColumn':0x0}],'cornerRanges':[]},generateDefaultEmptyCache=(_0x1f0c22,_0x5f20a1)=>{const _0xaefd28=_0x5b3260,_0x17e6da=new _univerjs_core[(_0xaefd28(0x1e5))](),_0x314302=new _univerjs_core[(_0xaefd28(0x1e5))](defaultEmptyMatrix),{row:_0x963f34,col:_0x254186}=_0x5f20a1;_0x314302[_0xaefd28(0x1eb)]((_0x40db52,_0x2535c0,_0x591e23)=>{const _0x2836f8=_0xaefd28;let _0x4d416b='';if(_0x591e23['v']==='filter')_0x4d416b=_0x1f0c22[_0x2836f8(0x161)];else{if(_0x591e23['v']===_0x2836f8(0x1c0))_0x4d416b=_0x1f0c22[_0x2836f8(0x1c0)];else{if(_0x591e23['v']===_0x2836f8(0x3d1))_0x4d416b=_0x1f0c22[_0x2836f8(0x3d1)];else{if(_0x591e23['v']===_0x2836f8(0x360))_0x4d416b=_0x1f0c22['values'];}}}_0x17e6da[_0x2836f8(0x333)](_0x40db52+_0x963f34,_0x2535c0+_0x254186,{..._0x591e23,'v':_0x4d416b});});const _0x535921=_univerjs_core[_0xaefd28(0x40e)]['deepClone'](defaultEmptyRanges);return Object[_0xaefd28(0x2da)](defaultEmptyRanges)[_0xaefd28(0x21b)](_0x20ac2c=>{const _0x197462=_0xaefd28;_0x535921[_0x20ac2c]=defaultEmptyRanges[_0x20ac2c][_0x197462(0x3c3)](_0x4d8089=>{const _0x90e73f=_0x197462;return{..._0x4d8089,'startRow':_0x4d8089[_0x90e73f(0x401)]+_0x963f34,'endRow':_0x4d8089[_0x90e73f(0x249)]+_0x963f34,'startColumn':_0x4d8089[_0x90e73f(0x29c)]+_0x254186,'endColumn':_0x4d8089[_0x90e73f(0x2bc)]+_0x254186};});}),{'matrixCache':_0x17e6da,'rangesCache':_0x535921};};function getAutoDisplayName$1(_0x476f47,_0x31e296){const _0x5a8407=_0x5b3260;let _0x3f827c='';const _0x4a16d6=this[_0x5a8407(0x382)]();switch(_0x31e296){case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x188)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x21a)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x331)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x13d)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x3b1)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x1d1)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x18b)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x2ba)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x430)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x14d)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)]['product']:_0x3f827c=_0x4a16d6[_0x5a8407(0x1ec)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x426)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x1fa)]+_0x476f47;break;case _univerjs_pro_engine_pivot['PivotSubtotalTypeEnum'][_0x5a8407(0x1b8)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x21f)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)]['sum']:_0x3f827c=_0x4a16d6['sheets-pivot.sumName']+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x299)]:_0x3f827c=_0x4a16d6[_0x5a8407(0x22b)]+_0x476f47;break;case _univerjs_pro_engine_pivot[_0x5a8407(0x175)][_0x5a8407(0x2ce)]:_0x3f827c=_0x4a16d6['sheets-pivot.varpName']+_0x476f47;break;default:_0x3f827c=_0x476f47;break;}return _0x3f827c;}function getPivotCellInfo(_0x2395e8,_0xad281a,_0x37f0c9,_0x13f5c1,_0x2dc8c7){const _0x4815e6=_0x5b3260,_0x4fdbad=(0x0,_univerjs_core[_0x4815e6(0x318)])(_0x2395e8,_0xad281a),{rangesInfo:_0x1e15d4,areaInfo:_0x339703,headerMap:_0x33a8cf}=_0x2dc8c7;if(!_0x1e15d4||!_0x339703||!_0x33a8cf)return;const _0x6e280f=Object[_0x4815e6(0x2da)](_0x1e15d4)[_0x4815e6(0x2ad)](_0x10f054=>{const _0xa1a44f=_0x4815e6;return _0x1e15d4[_0x10f054][_0xa1a44f(0x1c4)](_0x50b967=>_univerjs_core['Rectangle'][_0xa1a44f(0x31f)](_0x50b967,_0x4fdbad));}),_0x3afb73=_0x339703;let _0x4a3f3c,_0x32fc5f,_0x392c7e;if(_0x6e280f==='rowRanges'){var _0x264fda,_0x220421;_0x4a3f3c=_0x3afb73===null||_0x3afb73===void 0x0||(_0x264fda=_0x3afb73[_0x4815e6(0x414)])===null||_0x264fda===void 0x0?void 0x0:_0x264fda[_0x2395e8],_0x32fc5f=_0x33a8cf===null||_0x33a8cf===void 0x0||(_0x220421=_0x33a8cf[_0x4815e6(0x1ae)])===null||_0x220421===void 0x0?void 0x0:_0x220421[_0xad281a],_0x392c7e=_0x32fc5f===null||_0x32fc5f===void 0x0?void 0x0:_0x32fc5f[_0x4815e6(0x25f)];}else{if(_0x6e280f===_0x4815e6(0x41b)){var _0x145a0c,_0x3b001a;_0x4a3f3c=_0x3afb73===null||_0x3afb73===void 0x0||(_0x145a0c=_0x3afb73[_0x4815e6(0x42e)])===null||_0x145a0c===void 0x0?void 0x0:_0x145a0c[_0xad281a],_0x32fc5f=(_0x3b001a=_0x33a8cf['colHeaderMap'])===null||_0x3b001a===void 0x0?void 0x0:_0x3b001a[_0x2395e8+0x1+_0xad281a-_0x1e15d4[_0x4815e6(0x41b)][0x0][_0x4815e6(0x29c)]],_0x392c7e=_0x32fc5f===null||_0x32fc5f===void 0x0?void 0x0:_0x32fc5f[_0x4815e6(0x25f)];}else{if(_0x6e280f==='cornerRanges'){var _0x27dace;_0x4a3f3c=_0x3afb73===null||_0x3afb73===void 0x0||(_0x27dace=_0x3afb73[_0x4815e6(0x350)])===null||_0x27dace===void 0x0?void 0x0:_0x27dace[_0xad281a],_0x392c7e=_0x4a3f3c===null||_0x4a3f3c===void 0x0?void 0x0:_0x4a3f3c[_0x4815e6(0x25f)];}else{if(_0x6e280f===_0x4815e6(0x14e)){const _0x435149=_0x37f0c9===null||_0x37f0c9===void 0x0?void 0x0:_0x37f0c9['fi'];if(_0x435149!==void 0x0)_0x392c7e=_0x13f5c1['getFilterFieldIdByIndex'](_0x435149);}}}}return{'filterId':_0x392c7e,'info':_0x4a3f3c,'data':_0x37f0c9,'headerInfo':_0x32fc5f};}function getPivotTableInfo(_0x5cfb07,_0x315abe,_0x424b72){const _0x34a389=_0x5b3260,_0x4c52c7=_0x5cfb07['dataFieldsCollection'],_0x38153b=_0x4c52c7['getFieldIds'](),_0x944e80=new Set();_0x5cfb07[_0x34a389(0x132)](_0x2ca4d5=>{const _0x3af3ed=_0x34a389;_0x944e80[_0x3af3ed(0x1a8)](_0x2ca4d5[_0x3af3ed(0x3a9)]);});const _0x5e2983=_0x38153b[_0x34a389(0x3c3)](_0x102550=>{const _0x2a003f=_0x34a389,_0x41107e=_0x4c52c7[_0x2a003f(0x25b)](_0x102550);return{'checked':_0x944e80[_0x2a003f(0x194)](_0x102550),'dataFieldId':_0x41107e['id'],'id':_0x41107e['id'],'name':_0x4c52c7[_0x2a003f(0x2b1)](_0x41107e['id']),'type':_0x41107e[_0x2a003f(0x1ba)](),'pivotTableId':_0x315abe};}),_0xa6f06d=[];_0x5cfb07[_0x34a389(0x421)](_univerjs_pro_engine_pivot[_0x34a389(0x23c)][_0x34a389(0x3ed)],_0x36c85d=>{const _0x995ee7=_0x34a389;_0xa6f06d[_0x995ee7(0x154)]({'dataFieldId':_0x36c85d[_0x995ee7(0x3a9)],'tableFieldId':_0x36c85d[_0x995ee7(0x1ef)](),'displayName':_0x36c85d[_0x995ee7(0x2b1)]()});});const _0x5ba694=[];_0x5cfb07['iterateFieldByArea'](_univerjs_pro_engine_pivot[_0x34a389(0x23c)][_0x34a389(0x269)],_0x3df74c=>{const _0x160d86=_0x34a389;_0x5ba694[_0x160d86(0x154)]({'dataFieldId':_0x3df74c[_0x160d86(0x3a9)],'tableFieldId':_0x3df74c['getId'](),'displayName':_0x3df74c[_0x160d86(0x2b1)]()});});const _0x38086b=[];_0x5cfb07[_0x34a389(0x421)](_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x34a389(0x26b)],_0xde4182=>{const _0x3964dd=_0x34a389;_0x38086b[_0x3964dd(0x154)]({'dataFieldId':_0xde4182[_0x3964dd(0x3a9)],'tableFieldId':_0xde4182[_0x3964dd(0x1ef)](),'displayName':_0xde4182[_0x3964dd(0x2b1)](),'format':_0xde4182[_0x3964dd(0x183)](),'subTotalType':_0xde4182['getSubtotal']()});});if(_0x38086b[_0x34a389(0x2b9)]>0x1){const _0x28382f=_0x5cfb07[_0x34a389(0x193)]();(_0x5cfb07[_0x34a389(0x1dc)]()?_0x5ba694:_0xa6f06d)[_0x34a389(0x435)](_0x28382f,0x0,{'dataFieldId':'','tableFieldId':_0x34a389(0x2c7),'displayName':'ΣValue'});}const _0x2c362f=[];return _0x5cfb07[_0x34a389(0x421)](_univerjs_pro_engine_pivot[_0x34a389(0x23c)]['Filter'],_0x1ac2a9=>{const _0x3829ac=_0x34a389;_0x2c362f[_0x3829ac(0x154)]({'dataFieldId':_0x1ac2a9[_0x3829ac(0x3a9)],'tableFieldId':_0x1ac2a9[_0x3829ac(0x1ef)](),'displayName':_0x1ac2a9[_0x3829ac(0x2b1)]()});}),{'sourceList':_0x5e2983,'sourceRange':_0x424b72[_0x34a389(0x3d4)],'rowFields':_0xa6f06d,'columnFields':_0x5ba694,'valueFields':_0x38086b,'filterFields':_0x2c362f,'positionInfo':_0x424b72[_0x34a389(0x226)]};}function flattenObject(_0x52ffcd,_0x38a553,_0x1ab1e6='',_0x509b58={}){const _0x565dfa=_0x5b3260,_0x311e10=_0x52ffcd[_0x565dfa(0x3e5)](_univerjs_core['LocaleService']);for(const _0x1c2b33 in _0x38a553)if(Object[_0x565dfa(0x3e9)]['hasOwnProperty'][_0x565dfa(0x1c3)](_0x38a553,_0x1c2b33)){const _0xdfc370=_0x1ab1e6?_0x1ab1e6+'.'+_0x1c2b33:_0x1c2b33;if(typeof _0x38a553[_0x1c2b33]==='object'&&_0x38a553[_0x1c2b33]!==null&&!Array['isArray'](_0x38a553[_0x1c2b33]))flattenObject(_0x52ffcd,_0x38a553[_0x1c2b33],_0xdfc370,_0x509b58);else _0x509b58[_0xdfc370]=_0x311e10['t'](_0xdfc370);}return _0x509b58;}const unionPivotViewRange=_0x352ab2=>{const _0x55c9a8=_0x5b3260;if(!_0x352ab2)return[];const {rowRanges:_0x44b0ac,colRanges:_0x1233b3,cornerRanges:_0x5188a7,dataRanges:_0x3e2b1f,pageRanges:_0x553b9f}=_0x352ab2,_0x3600d7=[..._0x1233b3,..._0x44b0ac,..._0x3e2b1f,..._0x5188a7][_0x55c9a8(0x161)](_0x533515=>{const _0x16b211=_0x55c9a8;return _0x533515[_0x16b211(0x401)]>=0x0&&_0x533515[_0x16b211(0x29c)]>=0x0&&_0x533515[_0x16b211(0x249)]>=0x0&&_0x533515[_0x16b211(0x2bc)]>=0x0;});if(_0x3600d7[_0x55c9a8(0x2b9)]===0x0)return[..._0x553b9f];let _0x444395=_0x3600d7[0x0][_0x55c9a8(0x401)],_0x21dc52=_0x3600d7[0x0][_0x55c9a8(0x249)],_0xfce983=_0x3600d7[0x0][_0x55c9a8(0x29c)],_0xda74b8=_0x3600d7[0x0][_0x55c9a8(0x2bc)];for(let _0xbde73d=0x1;_0xbde73d<_0x3600d7[_0x55c9a8(0x2b9)];_0xbde73d++){_0x444395=Math[_0x55c9a8(0x430)](_0x444395,_0x3600d7[_0xbde73d][_0x55c9a8(0x401)]),_0x21dc52=Math[_0x55c9a8(0x18b)](_0x21dc52,_0x3600d7[_0xbde73d][_0x55c9a8(0x249)]),_0xfce983=Math[_0x55c9a8(0x430)](_0xfce983,_0x3600d7[_0xbde73d]['startColumn']),_0xda74b8=Math[_0x55c9a8(0x18b)](_0xda74b8,_0x3600d7[_0xbde73d][_0x55c9a8(0x2bc)]);}return[..._0x553b9f,{'startRow':_0x444395,'endRow':_0x21dc52,'startColumn':_0xfce983,'endColumn':_0xda74b8}];};function getPivotDrillDownData(_0x41066d,_0x12da09){const _0x1f86f9=_0x5b3260,_0xf3f1be=_0x12da09[_0x1f86f9(0x35e)][_0x1f86f9(0x3d5)],{pivotTableId:_0x4dff89,unitId:_0x24233f,subUnitId:_0x31bca6}=_0x12da09;if(!_0xf3f1be)return;const _0x4fed25=_0x41066d[_0x1f86f9(0x3e5)](SheetsPivotDataSourceModel),_0x4c5e19=_0x4fed25[_0x1f86f9(0x407)](_0x4dff89),_0x3fea18=_0x4fed25[_0x1f86f9(0x32a)](_0x24233f,_0x31bca6,_0x4dff89);if(!_0x4c5e19||!_0x3fea18)return;const _0x593cea=_0x4c5e19[_0x1f86f9(0x17e)](_0xf3f1be[_0x1f86f9(0x1a9)]);if(!(_0x593cea===null||_0x593cea===void 0x0?void 0x0:_0x593cea[_0x1f86f9(0x2b9)]))return;const {unitId:_0x63cbda,subUnitId:_0x48c8f7,range:_0x24837b}=_0x3fea18[_0x1f86f9(0x3d4)];let _0x39c03e=0x0;return{'indexes':_0x593cea,'range':_0x24837b,'sourceUnitId':_0x63cbda,'sourceSubUnitId':_0x48c8f7,'formatMap':_0x4c5e19[_0x1f86f9(0x316)][_0x1f86f9(0x379)]()['reduce']((_0x491897,_0x393abf)=>{const _0x2fa4f2=_0x1f86f9;var _0x27a99a;const _0x2b088e=(_0x27a99a=_0x4c5e19[_0x2fa4f2(0x1b9)](_0x393abf))===null||_0x27a99a===void 0x0?void 0x0:_0x27a99a[_0x2fa4f2(0x237)]();if(_0x2b088e)_0x491897[String(_0x39c03e)]=_0x2b088e;return _0x39c03e++,_0x491897;},{})};}function canUsePivot(_0x137aba,_0x3e1376){const _0x4dfc93=_0x5b3260;if(!_0x137aba||!_0x3e1376)return!![];const _0x6c4d9b=(0x0,_univerjs_pro_license['getLicenseInfo'])(_0x137aba,_0x3e1376)[_0x4dfc93(0x20e)],_0x22379b=(0x0,_univerjs_pro_license[_0x4dfc93(0x3a0)])(_0x6c4d9b,'sf',BUILD_TIMESTAMP);if((_0x6c4d9b===null||_0x6c4d9b===void 0x0?void 0x0:_0x6c4d9b['rt'])===_univerjs_pro_license[_0x4dfc93(0x1ff)]['NO_COMMERCIAL']&&!_0x22379b)return![];return!![];}function getPivotInfoByLicense(_0x32739e,_0x27a87a,_0x5d5f90){const _0x1ee8eb=_0x5b3260,_0x261792={'count':_0x32739e,'timeValid':![]};if(!_0x27a87a||!_0x5d5f90)return _0x261792;const _0x5530fe=(0x0,_univerjs_pro_license[_0x1ee8eb(0x330)])(_0x27a87a,_0x5d5f90);if(_0x5530fe===null||_0x5530fe===void 0x0?void 0x0:_0x5530fe['valid']){const _0x535d6=_0x5530fe[_0x1ee8eb(0x20e)],_0x1baddc=(0x0,_univerjs_pro_license[_0x1ee8eb(0x3a0)])(_0x535d6,'sf',BUILD_TIMESTAMP);return{'count':(0x0,_univerjs_pro_license[_0x1ee8eb(0x25d)])(_0x535d6,_0x1baddc,_0x1ee8eb(0x1f8),_0x32739e,_0x32739e,0x0),'timeValid':_0x1baddc};}return _0x261792;}function generateSetRangeValueMutations(_0x119f8a,_0x27337d,_0x297ed8,_0x33b3a6){const _0x1dd63f=_0x5b3260,_0x3325da={'subUnitId':_0x297ed8,'unitId':_0x27337d,'cellValue':(0x0,_univerjs_sheets[_0x1dd63f(0x381)])(_0x33b3a6)},_0x4cb0b2=(0x0,_univerjs_sheets['SetRangeValuesUndoMutationFactory'])(_0x119f8a,_0x3325da);let _0x1c4af5=![];return new _univerjs_core[(_0x1dd63f(0x1e5))](_0x4cb0b2[_0x1dd63f(0x301)])[_0x1dd63f(0x1eb)]((_0x2fb078,_0x1f74f5,_0x5ab95e)=>{if(!_0x1c4af5){if(_0x5ab95e&&(_0x5ab95e['custom']||_0x5ab95e['f']||_0x5ab95e['p']||_0x5ab95e['s']||_0x5ab95e['si']||_0x5ab95e['t']||_0x5ab95e['v']))return _0x1c4af5=!![],![];}}),{'setRangeValueUndoMutation':{'id':_univerjs_sheets['SetRangeValuesMutation']['id'],'params':_0x4cb0b2},'setRangeValueRedoMutation':{'id':_univerjs_sheets[_0x1dd63f(0x31c)]['id'],'params':_0x3325da},'shouldClear':_0x1c4af5};}function getEmptyPivotRanges(_0x2a3e66){const {row:_0x402ea0,col:_0x13598b}=_0x2a3e66;return[{'startRow':_0x402ea0,'endRow':_0x402ea0,'startColumn':_0x13598b,'endColumn':_0x13598b},{'startRow':_0x402ea0+0x2,'endRow':_0x402ea0+0xe,'startColumn':_0x13598b,'endColumn':_0x13598b+0x6}];}function getPivotRowColCount(_0x510a26,_0x3d0179,_0x21b280){const _0x4d2aa1=_0x5b3260,{cornerView:_0xf420c,rowView:_0x6eba64,colView:_0x19df87,pageView:_0x28d3ff}=_0x510a26,{row:_0x3326b6,col:_0x5c0628}=_0x3d0179;if(_0x21b280)return{'rowCount':0xe+_0x3326b6,'colCount':0x6+_0x5c0628};const _0x27f487=_0x28d3ff[_0x4d2aa1(0x3e4)]>-0x1?_0x28d3ff['lastRow']+0x1:0x0,_0x469aee=_0x28d3ff[_0x4d2aa1(0x38c)]>-0x1?_0x28d3ff[_0x4d2aa1(0x38c)]:0x0,_0x287d5c=_0x3326b6+_0x27f487+(_0x27f487?0x1:0x0)+_0xf420c[_0x4d2aa1(0x321)]+_0x6eba64[_0x4d2aa1(0x321)],_0x32f439=_0x5c0628+_0x469aee,_0x46574f=_0x5c0628+_0xf420c[_0x4d2aa1(0x41c)]+_0x19df87[_0x4d2aa1(0x41c)];return{'rowCount':_0x287d5c,'colCount':Math[_0x4d2aa1(0x18b)](_0x32f439,_0x46574f)};}function getInsertRowColMutations(_0xf1008a,_0x28127a,_0x5ee74e,_0x944f94){const _0x22d43b=_0x5b3260,{row:_0x31cb8e,col:_0xd31324,unitId:_0x26fdff,subUnitId:_0x10c456}=_0x5ee74e,_0x14372e=getPivotRowColCount(_0x28127a,{'row':_0x31cb8e,'col':_0xd31324},_0x944f94),_0x68800c=(0x0,_univerjs_sheets[_0x22d43b(0x2f9)])(_0xf1008a['get'](_univerjs_core[_0x22d43b(0x13e)]),{'unitId':_0x26fdff,'subUnitId':_0x10c456}),_0x322767=[],_0x887a62=[];if(!_0x68800c)return{'undos':_0x887a62,'redos':_0x322767};const {worksheet:_0x1110b8}=_0x68800c,_0x38561e=_0x1110b8[_0x22d43b(0x427)](),_0x20cb7a=_0x1110b8[_0x22d43b(0x2ab)]();return _0x38561e<_0x14372e[_0x22d43b(0x321)]&&(_0x322767['push']({'id':_univerjs_sheets[_0x22d43b(0x16a)]['id'],'params':{'unitId':_0x26fdff,'subUnitId':_0x10c456,'range':{'startRow':_0x38561e,'endRow':_0x14372e[_0x22d43b(0x321)]-0x1,'startColumn':0x0,'endColumn':_0x20cb7a-0x1}}}),_0x887a62[_0x22d43b(0x154)]({'id':_univerjs_sheets[_0x22d43b(0x1af)]['id'],'params':{'unitId':_0x26fdff,'subUnitId':_0x10c456,'range':{'startRow':_0x38561e,'endRow':_0x14372e[_0x22d43b(0x321)]-0x1,'startColumn':0x0,'endColumn':_0x20cb7a-0x1}}})),_0x20cb7a<_0x14372e[_0x22d43b(0x41c)]&&(_0x322767['push']({'id':_univerjs_sheets[_0x22d43b(0x2e7)]['id'],'params':{'unitId':_0x26fdff,'subUnitId':_0x10c456,'range':{'startRow':0x0,'endRow':_0x38561e-0x1,'startColumn':_0x20cb7a,'endColumn':_0x14372e[_0x22d43b(0x41c)]-0x1}}}),_0x887a62['push']({'id':_univerjs_sheets[_0x22d43b(0x2e9)]['id'],'params':{'unitId':_0x26fdff,'subUnitId':_0x10c456,'range':{'startRow':0x0,'endRow':_0x38561e-0x1,'startColumn':_0x20cb7a,'endColumn':_0x14372e[_0x22d43b(0x41c)]-0x1}}})),{'undos':_0x887a62,'redos':_0x322767};}function getStringLength(_0x4934e8){const _0x4372eb=_0x5b3260;let _0x68370f=0x0;for(let _0x31c366=0x0;_0x31c366<_0x4934e8[_0x4372eb(0x2b9)];_0x31c366++){const _0x53814b=_0x4934e8[_0x4372eb(0x367)](_0x31c366);if(_0x53814b>=0x4e00&&_0x53814b<=0x9fff||_0x53814b>=0x3000&&_0x53814b<=0x303f||_0x53814b>=0xff00&&_0x53814b<=0xffef)_0x68370f+=0x2;else _0x68370f+=0x1;}return _0x68370f;}function getHeaderViewMaxText(_0x2cf88a,_0x2cd9d5,_0x3e7b24,_0x2b643a){const _0x406517=_0x5b3260,{rowCount:_0x90d195,colCount:_0x5628a0,headerMap:_0x42a5cb}=_0x2cf88a,_0x3158a8=0x64,_0x64b4a3=Math[_0x406517(0x430)](_0x90d195,_0x3158a8),_0x4ff55f=Math['min'](_0x5628a0,_0x3158a8);let _0x4341ce='',_0x3370cd=0x0;for(let _0x2529a0=0x0;_0x2529a0<_0x64b4a3;_0x2529a0++)for(let _0x218e92=0x0;_0x218e92<_0x4ff55f;_0x218e92++){var _0x3bf98c,_0x4baf4e;const _0x3ab449={...(_0x3bf98c=_0x2cf88a[_0x406517(0x232)])===null||_0x3bf98c===void 0x0||(_0x3bf98c=_0x3bf98c[_0x2529a0])===null||_0x3bf98c===void 0x0?void 0x0:_0x3bf98c[_0x218e92]},_0x20f165=_0x2b643a[(_0x4baf4e=_0x42a5cb[_0x2529a0])===null||_0x4baf4e===void 0x0?void 0x0:_0x4baf4e[_0x406517(0x25f)]];let _0x37bf59=_0x2cf88a[_0x406517(0x323)](_0x2529a0,_0x218e92);if(_0x3ab449){var _0x2e848d;_0x37bf59=transFromCellValue(_0x3ab449,_0x3e7b24?_0x218e92===0x0&&((_0x2e848d=_0x2cf88a[_0x406517(0x2e1)](_0x218e92+0x1))===null||_0x2e848d===void 0x0?void 0x0:_0x2e848d[_0x406517(0x24b)]):![],_0x20f165,_0x2cd9d5);}if(_0x37bf59!==void 0x0){const _0x22074e=getStringLength(String(_0x37bf59));_0x3370cd<_0x22074e&&(_0x4341ce=String(_0x37bf59),_0x3370cd=_0x22074e);}}return _0x4341ce;}function getValueViewMaxText(_0x2176c1){const _0x22c2d0=_0x5b3260,{rowCount:_0x5651a7,colCount:_0x1b764d}=_0x2176c1;let _0x533ce6='',_0x287e41=0x0;for(let _0x8acf44=_0x5651a7-0x1;_0x8acf44>0x0&&_0x8acf44>_0x5651a7-0x3;_0x8acf44--)for(let _0x34ce32=0x0;_0x34ce32<_0x1b764d;_0x34ce32++){const _0x26b18e=_0x2176c1[_0x22c2d0(0x323)](_0x8acf44,_0x34ce32);if(_0x26b18e!==void 0x0){const _0x3070d2=String(_0x26b18e)[_0x22c2d0(0x2b9)];_0x287e41<_0x3070d2&&(_0x533ce6=String(_0x26b18e),_0x287e41=_0x3070d2);}}return _0x533ce6;}function getCornerMaxText(_0x4e80ff){const _0x5566eb=_0x5b3260,{rowCount:_0xce8dbe,colCount:_0x4f1fa8}=_0x4e80ff;let _0x13de26='',_0x5a0a4f=0x0;for(let _0x3bbca6=0x0;_0x3bbca6<_0xce8dbe;_0x3bbca6++)for(let _0x3cf743=0x0;_0x3cf743<_0x4f1fa8;_0x3cf743++){const _0x1e4cf3=_0x4e80ff[_0x5566eb(0x323)](_0x3bbca6,_0x3cf743);if(_0x1e4cf3!==void 0x0){const _0x183168=String(_0x1e4cf3)[_0x5566eb(0x2b9)];_0x5a0a4f<_0x183168&&(_0x13de26=String(_0x1e4cf3),_0x5a0a4f=_0x183168);}}return _0x13de26;}function setConfigToPivotTable(_0x49f9ca,_0x125fac){const _0x245a06=_0x5b3260,{rowFields:_0x552c39,columnFields:_0x22fb20,valueFields:_0x4e2de6,filterFields:_0x40d65d,dimension:_0x517244,measure:_0x19a65c}=_0x125fac;for(const _0x412dc7 of _0x552c39){const _0x6ec395=_0x517244[_0x412dc7];if(_0x6ec395&&_0x49f9ca[_0x245a06(0x1b9)](_0x6ec395['dataFieldId'])){_0x49f9ca[_0x245a06(0x13f)](_0x6ec395[_0x245a06(0x3a9)],_univerjs_pro_engine_pivot[_0x245a06(0x23c)][_0x245a06(0x3ed)],void 0x0,_0x412dc7);if(_0x6ec395[_0x245a06(0x374)])_0x49f9ca[_0x245a06(0x311)](_0x6ec395['id'],_0x6ec395[_0x245a06(0x374)]);if(_0x6ec395['sortInfo'])_0x49f9ca['setSortInfo'](_0x6ec395['id'],_0x6ec395['sortInfo']);if(_0x6ec395[_0x245a06(0x351)])_0x49f9ca['setLabelFilterInfo'](_0x6ec395['id'],_0x6ec395['filterInfo']);}}for(const _0x578fb5 of _0x22fb20){const _0x5d680d=_0x517244[_0x578fb5];if(_0x5d680d&&_0x49f9ca[_0x245a06(0x1b9)](_0x5d680d['dataFieldId'])){_0x49f9ca[_0x245a06(0x13f)](_0x5d680d[_0x245a06(0x3a9)],_univerjs_pro_engine_pivot[_0x245a06(0x23c)][_0x245a06(0x269)],void 0x0,_0x578fb5);if(_0x5d680d[_0x245a06(0x1be)])_0x49f9ca[_0x245a06(0x20f)](_0x5d680d['id'],_0x5d680d[_0x245a06(0x1be)]);if(_0x5d680d[_0x245a06(0x351)])_0x49f9ca[_0x245a06(0x424)](_0x5d680d['id'],_0x5d680d['filterInfo']);if(_0x5d680d[_0x245a06(0x374)])_0x49f9ca['renameField'](_0x5d680d['id'],_0x5d680d['displayName']);}}for(const _0x313029 of _0x40d65d){const _0x1aa637=_0x517244[_0x313029];if(_0x1aa637&&_0x49f9ca['getDataFieldByDataFieldId'](_0x1aa637[_0x245a06(0x3a9)])){_0x49f9ca['addFieldWithSourceId'](_0x1aa637['dataFieldId'],_univerjs_pro_engine_pivot[_0x245a06(0x23c)][_0x245a06(0x341)],void 0x0,_0x313029);if(_0x1aa637['sortInfo'])_0x49f9ca[_0x245a06(0x20f)](_0x1aa637['id'],_0x1aa637[_0x245a06(0x1be)]);if(_0x1aa637['filterInfo'])_0x49f9ca[_0x245a06(0x424)](_0x1aa637['id'],_0x1aa637[_0x245a06(0x351)]);if(_0x1aa637[_0x245a06(0x374)])_0x49f9ca['renameField'](_0x1aa637['id'],_0x1aa637[_0x245a06(0x374)]);}}for(const _0x3e0d14 of _0x4e2de6){const _0xf4361b=_0x19a65c[_0x3e0d14];if(_0xf4361b&&_0x49f9ca['getDataFieldByDataFieldId'](_0xf4361b[_0x245a06(0x3a9)])){_0x49f9ca[_0x245a06(0x13f)](_0xf4361b['dataFieldId'],_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x245a06(0x26b)],void 0x0,_0x3e0d14);if(_0xf4361b[_0x245a06(0x32d)]!==void 0x0)_0x49f9ca[_0x245a06(0x298)](_0x3e0d14,_0xf4361b[_0x245a06(0x32d)]);if(_0xf4361b[_0x245a06(0x2f7)])_0x49f9ca[_0x245a06(0x1c5)](_0x3e0d14,_0xf4361b[_0x245a06(0x2f7)]);if(_0xf4361b[_0x245a06(0x374)])_0x49f9ca[_0x245a06(0x311)](_0xf4361b['id'],_0xf4361b['displayName']);}}const _0x2847f0=_0x125fac[_0x245a06(0x380)];for(const {fieldId:_0xf2116c,filterInfo:_0x456241}of _0x2847f0)_0x49f9ca[_0x245a06(0x2ec)](_0xf2116c,_0x456241);}function resetPivotTable(_0x31c7d7,_0x3e827f){const _0x5b3206=_0x5b3260,_0x31133a=[];if(_0x3e827f===_univerjs_pro_engine_pivot[_0x5b3206(0x23c)]['Row'])_0x31c7d7[_0x5b3206(0x421)](_univerjs_pro_engine_pivot[_0x5b3206(0x23c)][_0x5b3206(0x3ed)],_0x4d1b36=>{const _0x57ec00=_0x5b3206;_0x31133a[_0x57ec00(0x154)](_0x4d1b36[_0x57ec00(0x1ef)]());});if(_0x3e827f===_univerjs_pro_engine_pivot[_0x5b3206(0x23c)][_0x5b3206(0x269)])_0x31c7d7[_0x5b3206(0x421)](_univerjs_pro_engine_pivot[_0x5b3206(0x23c)][_0x5b3206(0x269)],_0x13cb1e=>{const _0x5c9494=_0x5b3206;_0x31133a['push'](_0x13cb1e[_0x5c9494(0x1ef)]());});if(_0x3e827f===_univerjs_pro_engine_pivot[_0x5b3206(0x23c)][_0x5b3206(0x341)])_0x31c7d7[_0x5b3206(0x421)](_univerjs_pro_engine_pivot[_0x5b3206(0x23c)][_0x5b3206(0x341)],_0x4f2f31=>{const _0x122a78=_0x5b3206;_0x31133a[_0x122a78(0x154)](_0x4f2f31['getId']());});if(_0x3e827f===_univerjs_pro_engine_pivot[_0x5b3206(0x23c)][_0x5b3206(0x26b)])_0x31c7d7[_0x5b3206(0x421)](_univerjs_pro_engine_pivot[_0x5b3206(0x23c)]['Value'],_0x7241f2=>{const _0x19c5e1=_0x5b3206;_0x31133a[_0x19c5e1(0x154)](_0x7241f2[_0x19c5e1(0x1ef)]());});if(_0x3e827f===void 0x0)_0x31c7d7['iterateField'](_0x103da7=>{const _0x492b90=_0x5b3206;_0x31133a[_0x492b90(0x154)](_0x103da7[_0x492b90(0x1ef)]());});const _0x40894=_0x31133a[_0x5b3206(0x2b9)];for(let _0x287d35=_0x40894-0x1;_0x287d35>=0x0;_0x287d35--)_0x31c7d7['removeField'](_0x31133a[_0x287d35]);const _0x37e5fa=_0x31c7d7[_0x5b3206(0x359)]();for(const _0x58e4c1 in _0x37e5fa)_0x31c7d7[_0x5b3206(0x1aa)](_0x58e4c1);}function findCommonDateType(_0x2941fc,_0xb1fd6c){const _0x15fb0e=_0x5b3260,_0x19941a=new Date((0x0,_univerjs_pro_engine_pivot[_0x15fb0e(0x1b4)])(_0xb1fd6c)),_0x283ecc=new Date((0x0,_univerjs_pro_engine_pivot[_0x15fb0e(0x1b4)])(_0x2941fc)),_0x269397=_0x19941a[_0x15fb0e(0x319)](),_0x4e1c69=_0x283ecc[_0x15fb0e(0x319)](),_0x263846=_0x19941a[_0x15fb0e(0x3d8)](),_0x9682d3=_0x283ecc[_0x15fb0e(0x3d8)](),_0xe1bfa=_0x19941a[_0x15fb0e(0x343)](),_0x3b9e1c=_0x283ecc[_0x15fb0e(0x343)](),_0x72695=_0x269397===_0x4e1c69,_0x20cd1d=_0x72695&&_0x263846===_0x9682d3;if(_0x72695&&_0x20cd1d&&!(_0x20cd1d&&_0xe1bfa===_0x3b9e1c))return _univerjs_pro_engine_pivot[_0x15fb0e(0x372)]['YearMonthDate'];else{if(_0x72695&&!_0x20cd1d)return _univerjs_pro_engine_pivot[_0x15fb0e(0x372)][_0x15fb0e(0x40a)];}return _univerjs_pro_engine_pivot[_0x15fb0e(0x372)][_0x15fb0e(0x2a9)];}function getDateGroupName(_0x4f9191,_0xc87bf1){const _0x3d3f5e=_0x5b3260,_0x31d5da=_0x4f9191[_0x3d3f5e(0x3e5)](SheetsPivotDataSourceModel)[_0x3d3f5e(0x382)]();let _0xd017d0='';switch(_0xc87bf1){case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x1d9)]:_0xd017d0=_0x31d5da[_0x3d3f5e(0x32b)];break;case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum'][_0x3d3f5e(0x40a)]:_0xd017d0=_0x31d5da[_0x3d3f5e(0x42d)];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x2a9)]:_0xd017d0=_0x31d5da[_0x3d3f5e(0x1bb)];break;case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum'][_0x3d3f5e(0x12b)]:_0xd017d0=_0x31d5da['sheets-pivot.dateGroup.month'];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x3b5)]:_0xd017d0=_0x31d5da[_0x3d3f5e(0x2aa)];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x2b8)]:_0xd017d0=_0x31d5da[_0x3d3f5e(0x163)];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)]['HourMinute']:_0xd017d0=_0x31d5da[_0x3d3f5e(0x34e)];break;case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum']['Hour']:_0xd017d0=_0x31d5da['sheets-pivot.dateGroup.hour'];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x19e)]:_0xd017d0=_0x31d5da['sheets-pivot.dateGroup.minute'];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x22f)]:_0xd017d0=_0x31d5da[_0x3d3f5e(0x36c)];break;case _univerjs_pro_engine_pivot[_0x3d3f5e(0x372)][_0x3d3f5e(0x152)]:_0xd017d0=_0x31d5da['sheets-pivot.dateGroup.yearQuarter'];break;default:_0xd017d0='';break;}return _0xd017d0;}const SHEETS_PIVOT_PLUGIN_CONFIG_KEY=_0x5b3260(0x212),configSymbol=Symbol(SHEETS_PIVOT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsPivotTableConfigModel=class SheetsPivotTableConfigModel extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x4bc06c,_0x4d545,_0x3a5baf,_0x2717e5,_0x3555c4){const _0x173f53=_0x5b3260;super(),this[_0x173f53(0x2ee)]=_0x4bc06c,this[_0x173f53(0x389)]=_0x4d545,this[_0x173f53(0x2ac)]=_0x3a5baf,this['_resourceManagerService']=_0x2717e5,this[_0x173f53(0x2fa)]=_0x3555c4,_defineProperty(this,'_model',new Map()),_defineProperty(this,_0x173f53(0x15f),new Map()),_defineProperty(this,'_pivotTableRangeInfo',new Map()),_defineProperty(this,_0x173f53(0x3e6),new Map()),_defineProperty(this,'_configVersion$',new rxjs[(_0x173f53(0x355))]()),_defineProperty(this,'_pivotInitCompleted$',new rxjs[(_0x173f53(0x355))]()),_defineProperty(this,_0x173f53(0x2df),this[_0x173f53(0x254)][_0x173f53(0x1c9)]()),_defineProperty(this,_0x173f53(0x43a),new rxjs[(_0x173f53(0x355))]()),_defineProperty(this,_0x173f53(0x268),this[_0x173f53(0x43a)][_0x173f53(0x1c9)]()),_defineProperty(this,'_textInfo',{}),_defineProperty(this,_0x173f53(0x1a7),this['_configVersion$'][_0x173f53(0x1c9)]()),this[_0x173f53(0x3ea)](),this[_0x173f53(0x376)]();const _0x24cc20=this['_configService'][_0x173f53(0x2fe)](SHEETS_PIVOT_PLUGIN_CONFIG_KEY);if((_0x24cc20===null||_0x24cc20===void 0x0?void 0x0:_0x24cc20[_0x173f53(0x3a3)])===!![])this[_0x173f53(0x2eb)]();}['_initUnitDisposed'](){const _0x4d4d4b=_0x5b3260;this[_0x4d4d4b(0x1bf)](this['_univerInstanceService']['getTypeOfUnitDisposed$'](_univerjs_core['UniverInstanceType'][_0x4d4d4b(0x2e8)])[_0x4d4d4b(0x276)](_0x2e6b6c=>{const _0x2fe304=_0x4d4d4b;this[_0x2fe304(0x230)](_0x2e6b6c[_0x2fe304(0x234)]());}));}[_0x5b3260(0x17b)](){const _0x4601de=_0x5b3260;this[_0x4601de(0x254)][_0x4601de(0x3e1)](!![]);}[_0x5b3260(0x3ea)](){const _0x25742e=_0x5b3260,_0xe038d7=flattenObject(this[_0x25742e(0x2ee)],localeTemplate,'',{});this['_textInfo']=_0xe038d7,this['_commandService']['executeCommand'](SendInitPivotTextLocalMutation['id'],{'textInfo':_0xe038d7},{'onlyLocal':!![]});}[_0x5b3260(0x382)](){const _0x2b4cac=_0x5b3260;return this[_0x2b4cac(0x37e)];}[_0x5b3260(0x18f)](_0xa68f5,_0x1a2226,_0xe7cec2,_0x12581c,_0x4fe86a){const _0x50f5f7=_0x5b3260;this[_0x50f5f7(0x143)](_0xa68f5,_0x1a2226,_0xe7cec2,_0x12581c),this['updatePivotTableRangeInfo'](_0xa68f5,_0x1a2226,_0xe7cec2,_0x4fe86a);}[_0x5b3260(0x32a)](_0x39aef4,_0x123d8c,_0x48722f){const _0x1ddb52=_0x5b3260;var _0x417685;const _0x104329=(_0x417685=this[_0x1ddb52(0x145)][_0x1ddb52(0x3e5)](_0x39aef4))===null||_0x417685===void 0x0?void 0x0:_0x417685['get'](_0x123d8c);if(!_0x104329)return;return _0x104329[_0x1ddb52(0x3e5)](_0x48722f);}['getTargetByPivotTableId'](_0x57e72e,_0x2459b3){const _0x25f10d=_0x5b3260,_0x39ff12=this[_0x25f10d(0x145)][_0x25f10d(0x3e5)](_0x57e72e);if(!_0x39ff12)return;for(const [_0xb5dbe2,_0x253204]of _0x39ff12[_0x25f10d(0x17a)]())for(const [_0x2ec2ba,_0x148f09]of _0x253204['entries']())if(_0x2ec2ba===_0x2459b3)return _0x148f09[_0x25f10d(0x226)];}[_0x5b3260(0x2d6)](_0x2abd60,_0x478946,_0x36d781){const _0x4dfdc7=_0x5b3260,_0x433181=this[_0x4dfdc7(0x32a)](_0x2abd60,_0x478946,_0x36d781);return _0x433181===null||_0x433181===void 0x0?void 0x0:_0x433181[_0x4dfdc7(0x226)];}[_0x5b3260(0x3b3)](_0xdbee6e,_0x2c3982){const _0x335918=_0x5b3260;var _0x927ae5;return(_0x927ae5=this[_0x335918(0x145)][_0x335918(0x3e5)](_0xdbee6e))===null||_0x927ae5===void 0x0?void 0x0:_0x927ae5['get'](_0x2c3982);}[_0x5b3260(0x35f)](_0x4b4308,_0x129b6c,_0x5b6642,_0x3944e7){const _0x3074dc=_0x5b3260,_0x4eb562=this[_0x3074dc(0x3b8)](_0x4b4308,_0x129b6c);if(_0x3944e7)_0x4eb562[_0x3074dc(0x2c9)](_0x5b6642,_0x3944e7);else _0x4eb562['delete'](_0x5b6642);this['_pivotConfigChange$']['next']({'unitId':_0x4b4308,'subUnitId':_0x129b6c,'pivotTableId':_0x5b6642,'pivotTableConfig':_0x3944e7});}[_0x5b3260(0x329)](_0x5cb055,_0x11a506){const _0x52b0bf=_0x5b3260;var _0x3f834c;return(_0x3f834c=this[_0x52b0bf(0x15f)][_0x52b0bf(0x3e5)](_0x5cb055))===null||_0x3f834c===void 0x0?void 0x0:_0x3f834c[_0x52b0bf(0x2a4)][_0x11a506];}[_0x5b3260(0x1f9)](_0x45d310,_0x361c58){const _0x45e010=_0x5b3260;this[_0x45e010(0x15f)][_0x45e010(0x2c9)](_0x45d310,_0x361c58),this['_configVersion$'][_0x45e010(0x3e1)](Math[_0x45e010(0x24a)]());}[_0x5b3260(0x3b8)](_0x154cb7,_0x3c6190){const _0x1151fc=_0x5b3260;let _0x2cfe87=this['_model'][_0x1151fc(0x3e5)](_0x154cb7);!_0x2cfe87&&(_0x2cfe87=new Map(),this[_0x1151fc(0x145)][_0x1151fc(0x2c9)](_0x154cb7,_0x2cfe87));let _0x318d22=_0x2cfe87[_0x1151fc(0x3e5)](_0x3c6190);return!_0x318d22&&(_0x318d22=new Map(),_0x2cfe87[_0x1151fc(0x2c9)](_0x3c6190,_0x318d22)),_0x318d22;}['_ensurePivotTableRangeInfo'](_0x4f1f7,_0x200793){const _0x198952=_0x5b3260;let _0x150b4a=this[_0x198952(0x1db)][_0x198952(0x3e5)](_0x4f1f7);!_0x150b4a&&(_0x150b4a=new Map(),this[_0x198952(0x1db)][_0x198952(0x2c9)](_0x4f1f7,_0x150b4a));let _0x3b314f=_0x150b4a[_0x198952(0x3e5)](_0x200793);return!_0x3b314f&&(_0x3b314f=new Map(),_0x150b4a['set'](_0x200793,_0x3b314f)),_0x3b314f;}['_ensurePivotTableMatrixInfo'](_0xf936c,_0x4bc8f7){const _0x33bc71=_0x5b3260;let _0x525bb2=this[_0x33bc71(0x3e6)][_0x33bc71(0x3e5)](_0xf936c);!_0x525bb2&&(_0x525bb2=new Map(),this['_pivotTableMatrixInfo'][_0x33bc71(0x2c9)](_0xf936c,_0x525bb2));let _0x3d01b6=_0x525bb2['get'](_0x4bc8f7);return!_0x3d01b6&&(_0x3d01b6=new Map(),_0x525bb2[_0x33bc71(0x2c9)](_0x4bc8f7,_0x3d01b6)),_0x3d01b6;}[_0x5b3260(0x296)](_0x3a97d4,_0x543d97,_0xe9de87,_0x25888a){const _0x28ae29=_0x5b3260;var _0x5e003b;const _0x48e64f=this[_0x28ae29(0x2d0)](_0x3a97d4,_0x543d97),_0x2c2afb=(_0x5e003b=_0x48e64f['get'](_0xe9de87))===null||_0x5e003b===void 0x0?void 0x0:_0x5e003b[_0x28ae29(0x397)];_0x48e64f['set'](_0xe9de87,{'oldRangeInfo':_0x2c2afb,'rangeInfo':_0x25888a});}[_0x5b3260(0x143)](_0x3e3c25,_0x3c177c,_0x3430b5,_0x3752db){const _0x23f1f0=_0x5b3260;var _0x2e460f;const _0x47a968=this[_0x23f1f0(0x36a)](_0x3e3c25,_0x3c177c),_0x22ea3e=(_0x2e460f=_0x47a968[_0x23f1f0(0x3e5)](_0x3430b5))===null||_0x2e460f===void 0x0?void 0x0:_0x2e460f['oldMatrix'];_0x47a968[_0x23f1f0(0x2c9)](_0x3430b5,{'oldMatrix':_0x22ea3e,'matrix':_0x3752db});}['getPivotTableRangeInfo'](_0x5141db,_0x18ea45,_0x3a51d2){const _0x58b3d7=_0x5b3260;var _0xd3ff22;return(_0xd3ff22=this[_0x58b3d7(0x1db)][_0x58b3d7(0x3e5)](_0x5141db))===null||_0xd3ff22===void 0x0||(_0xd3ff22=_0xd3ff22[_0x58b3d7(0x3e5)](_0x18ea45))===null||_0xd3ff22===void 0x0?void 0x0:_0xd3ff22[_0x58b3d7(0x3e5)](_0x3a51d2);}[_0x5b3260(0x138)](_0x4225d4,_0x1e351c,_0x1c8ee0){const _0x1a638a=_0x5b3260;var _0x248740;return(_0x248740=this[_0x1a638a(0x3e6)][_0x1a638a(0x3e5)](_0x4225d4))===null||_0x248740===void 0x0||(_0x248740=_0x248740[_0x1a638a(0x3e5)](_0x1e351c))===null||_0x248740===void 0x0?void 0x0:_0x248740['get'](_0x1c8ee0);}['deleteUnitId'](_0x54763c){const _0x4467bd=_0x5b3260;this[_0x4467bd(0x145)][_0x4467bd(0x384)](_0x54763c),this[_0x4467bd(0x15f)][_0x4467bd(0x384)](_0x54763c);}['_toJSON'](_0x3ee2a6){const _0x4cf37e=_0x5b3260,_0x40553d={'dataFieldManagerConfig':{},'pivotTableConfigs':{}};if(this[_0x4cf37e(0x15f)][_0x4cf37e(0x3e5)](_0x3ee2a6))_0x40553d['dataFieldManagerConfig'][_0x3ee2a6]=this[_0x4cf37e(0x15f)][_0x4cf37e(0x3e5)](_0x3ee2a6);if(this[_0x4cf37e(0x145)][_0x4cf37e(0x3e5)](_0x3ee2a6)){_0x40553d[_0x4cf37e(0x13c)][_0x3ee2a6]={};const _0xf388eb=this[_0x4cf37e(0x145)]['get'](_0x3ee2a6);if(_0xf388eb===null||_0xf388eb===void 0x0?void 0x0:_0xf388eb['size'])[..._0xf388eb[_0x4cf37e(0x2da)]()][_0x4cf37e(0x21b)](_0x5e50c5=>{const _0x27e11d=_0x4cf37e,_0x292454=_0xf388eb['get'](_0x5e50c5);(_0x292454===null||_0x292454===void 0x0?void 0x0:_0x292454[_0x27e11d(0x275)])&&(_0x40553d[_0x27e11d(0x13c)][_0x3ee2a6][_0x5e50c5]={},[..._0x292454['keys']()][_0x27e11d(0x21b)](_0x45c30d=>{const _0x13b373=_0x27e11d,_0x130d09=_0x292454[_0x13b373(0x3e5)](_0x45c30d);if(_0x130d09)_0x40553d[_0x13b373(0x13c)][_0x3ee2a6][_0x5e50c5][_0x45c30d]=_0x130d09;}));});}return _0x40553d;}[_0x5b3260(0x2eb)](){const _0x5eacb9=_0x5b3260;this['disposeWithMe'](this[_0x5eacb9(0x2ca)]['registerPluginResource']({'toJson':_0xe37d4d=>{const _0x1c0fda=_0x5eacb9;return JSON[_0x1c0fda(0x1bd)](this['_toJSON'](_0xe37d4d));},'parseJson':_0x49ec87=>{return{};},'businesses':[_univerjs_core['UniverInstanceType']['UNIVER_SHEET']],'pluginName':SHEET_PIVOT_TABLE_PLUGIN,'onLoad':(_0x706766,_0x1d08c9)=>{},'onUnLoad':_0x11fc26=>{const _0x5bdeca=_0x5eacb9;this[_0x5bdeca(0x230)](_0x11fc26);}}));}};SheetsPivotTableConfigModel=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x1e6)])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_core['ICommandService'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core['IUniverInstanceService'])),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x5b3260(0x187)])),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core['IConfigService']))],SheetsPivotTableConfigModel);let SheetsPivotTableAdaptorModel=class SheetsPivotTableAdaptorModel extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x3a1684,_0x1132eb,_0x268016,_0x3baec1,_0xc4f80){const _0x3a3894=_0x5b3260;super(),this[_0x3a3894(0x27c)]=_0x3a1684,this['_injector']=_0x1132eb,this[_0x3a3894(0x2f0)]=_0x268016,this[_0x3a3894(0x2ac)]=_0x3baec1,this[_0x3a3894(0x34a)]=_0xc4f80,_defineProperty(this,_0x3a3894(0x25c),new Map()),_defineProperty(this,'_pivotRenderValueMatrixCache',new Map()),_defineProperty(this,'_markDirty$',new rxjs['Subject']()),_defineProperty(this,_0x3a3894(0x412),this['_markDirty$']['asObservable']()),_defineProperty(this,_0x3a3894(0x398),new rxjs['Subject']()),_defineProperty(this,_0x3a3894(0x17c),this[_0x3a3894(0x398)][_0x3a3894(0x1c9)]()),_defineProperty(this,_0x3a3894(0x37e),void 0x0),this[_0x3a3894(0x3ea)](),this[_0x3a3894(0x376)]();}['_initUnitDisposed'](){const _0xd0157f=_0x5b3260;this[_0xd0157f(0x1bf)](this[_0xd0157f(0x2ac)][_0xd0157f(0x131)](_univerjs_core[_0xd0157f(0x1b7)]['UNIVER_SHEET'])[_0xd0157f(0x276)](_0x47a26f=>{const _0x556055=_0xd0157f;this[_0x556055(0x230)](_0x47a26f[_0x556055(0x234)]());}));}[_0x5b3260(0x3ea)](){const _0x3a3fb7=_0x5b3260;this['_textInfo']=flattenObject(this[_0x3a3fb7(0x2ee)],localeTemplate,'',{});}[_0x5b3260(0x38a)](_0x3e2f9d){const _0xf449c5=_0x5b3260,{view:_0x46b653,unitId:_0x3c73bf,subUnitId:_0x2cb3df,pivotTableId:_0x31e5e9,type:_0x250314}=_0x3e2f9d,_0x13cc29=this[_0xf449c5(0x2f0)][_0xf449c5(0x32a)](_0x3c73bf,_0x2cb3df,_0x31e5e9);if(!_0x46b653||!_0x13cc29||_0x250314===PivotTableOperationEnum[_0xf449c5(0x153)])return;const {pageView:_0x521b05,cornerView:_0x3e8b76,rowView:_0x413308,colView:_0x1563dd,dataView:_0x2ec0ba}=_0x46b653,_0x546dce=_0x13cc29['targetCellInfo'],_0x558294=_0x13cc29[_0xf449c5(0x40d)],_0x2b68b8=this[_0xf449c5(0x27e)](_0x3c73bf,_0x2cb3df),_0x11336e=this[_0xf449c5(0x388)](_0x3c73bf,_0x2cb3df,_0x31e5e9);if(_0x558294)return this[_0xf449c5(0x3a2)](_0x3e2f9d,_0x2b68b8,_0x546dce,_0x11336e);else{const _0x3f2f5f=getAdjustRangesPosition(_0x546dce,_0x521b05,!![]),_0x4fd9bf=_0x521b05[_0xf449c5(0x3e4)]>=0x0?_0x521b05[_0xf449c5(0x3e4)]+0x1:0x0,_0x330ea3=_0x3e8b76[_0xf449c5(0x427)](),_0x59ee99=_0x3e8b76[_0xf449c5(0x39a)](),_0x35feef=_0x3f2f5f[_0xf449c5(0x2b9)]>0x0?0x1:0x0,_0x3fcac4=getAdjustRangesPosition({'row':_0x546dce[_0xf449c5(0x1c0)]+_0x4fd9bf+_0x35feef,'col':_0x546dce[_0xf449c5(0x1c6)]},_0x3e8b76,![],![]);_0x11336e[_0xf449c5(0x206)]={'rowRanges':getAdjustRangesPosition({'row':_0x546dce['row']+_0x4fd9bf+_0x35feef+_0x330ea3,'col':_0x546dce[_0xf449c5(0x1c6)]},_0x413308,![],!![]),'colRanges':getAdjustRangesPosition({'row':_0x546dce['row']+_0x4fd9bf+_0x35feef,'col':_0x546dce[_0xf449c5(0x1c6)]+_0x59ee99},_0x1563dd,![],!![]),'cornerRanges':_0x3fcac4,'dataRanges':getAdjustRangesPosition({'row':_0x546dce[_0xf449c5(0x1c0)]+_0x4fd9bf+_0x35feef+_0x330ea3,'col':_0x546dce[_0xf449c5(0x1c6)]+_0x59ee99},_0x2ec0ba,![],![]),'pageRanges':_0x3f2f5f};const {valueMatrix:_0x234f76,rowInfo:_0x16f4e3,colInfo:_0x7d5b14,cornerInfo:_0x24536c,rowHeaderMap:_0xaa173d,colHeaderMap:_0x537a81}=generatorAdjustPositionData$1(this[_0xf449c5(0x2ee)],_0x46b653,_0x13cc29,this[_0xf449c5(0x37e)]);return _0x11336e['areaInfo']={'rowInfo':_0x16f4e3,'colInfo':_0x7d5b14,'cornerInfo':_0x24536c},_0x11336e[_0xf449c5(0x159)]={'rowHeaderMap':_0xaa173d,'colHeaderMap':_0x537a81},_0x234f76[_0xf449c5(0x21b)]((_0x515f48,_0x4dacbc)=>{const _0x2f3d57=_0xf449c5;Object[_0x2f3d57(0x2da)](_0x4dacbc)[_0x2f3d57(0x21b)](_0x5c85d6=>{const _0x35adff=_0x2f3d57,_0x3e611a=+_0x5c85d6,_0x77c3ea=_0x234f76[_0x35adff(0x323)](_0x515f48,_0x3e611a);_0x2b68b8['setValue'](_0x515f48,_0x3e611a,_0x77c3ea);});}),this['_viewUpdate$'][_0xf449c5(0x3e1)]({'unitId':_0x3c73bf,'subUnitId':_0x2cb3df,'valueMatrix':_0x2b68b8,'rangesCache':_0x11336e[_0xf449c5(0x206)],'pivotTableId':_0x31e5e9,'type':_0x3e2f9d[_0xf449c5(0x3d0)]}),this[_0xf449c5(0x2f0)][_0xf449c5(0x18f)](_0x3c73bf,_0x2cb3df,_0x31e5e9,_0x2b68b8,_0x11336e[_0xf449c5(0x206)]),this[_0xf449c5(0x34a)][_0xf449c5(0x2d7)](_0x3c73bf,_0x2cb3df,SHEET_PIVOT_EXCLUSIVE_ID,this[_0xf449c5(0x28a)](_0x11336e[_0xf449c5(0x206)],_0x31e5e9)),{'rangeCache':_0x11336e[_0xf449c5(0x206)],'matrix':_0x2b68b8};}}['_updateRenderEmptyCache'](_0x510b6c,_0x3f070f,_0x26df4c,_0x5218b0){const _0xb62c39=_0x5b3260,_0x2f708e=this[_0xb62c39(0x27c)]['t'],{unitId:_0x1ea902,subUnitId:_0x425df9,pivotTableId:_0x1dabf9}=_0x510b6c,{matrixCache:_0x1f8fb7,rangesCache:_0x526c7d}=generateDefaultEmptyCache({'filter':_0x2f708e(_0xb62c39(0x16b)),'row':_0x2f708e(_0xb62c39(0x252)),'column':_0x2f708e(_0xb62c39(0x304)),'values':_0x2f708e('sheets-pivot.emptyPivot.values')},_0x26df4c);return _0x1f8fb7[_0xb62c39(0x1eb)]((_0x24bc1b,_0x39f89a,_0x53aae2)=>{const _0x468376=_0xb62c39;_0x3f070f[_0x468376(0x333)](_0x24bc1b,_0x39f89a,_0x53aae2);}),_0x5218b0[_0xb62c39(0x206)]=_0x526c7d,this[_0xb62c39(0x398)][_0xb62c39(0x3e1)]({'unitId':_0x1ea902,'subUnitId':_0x425df9,'valueMatrix':_0x3f070f,'rangesCache':_0x526c7d,'pivotTableId':_0x1dabf9,'type':_0x510b6c[_0xb62c39(0x3d0)],'isEmpty':!![]}),this['_sheetsPivotTableConfigModel'][_0xb62c39(0x18f)](_0x1ea902,_0x425df9,_0x1dabf9,_0x3f070f,_0x526c7d),this[_0xb62c39(0x34a)]['addExclusiveRange'](_0x1ea902,_0x425df9,SHEET_PIVOT_EXCLUSIVE_ID,this[_0xb62c39(0x28a)](_0x526c7d,_0x1dabf9)),{'rangeCache':_0x5218b0[_0xb62c39(0x206)],'matrix':_0x3f070f};}['_createExclusiveRange'](_0xd6fa6,_0x1870d1){const _0x1f8469=_0x5b3260,_0x13f761=[],_0x4bed82=unionPivotViewRange(_0xd6fa6);for(const _0x18c8e2 of _0x4bed82)_0x13f761[_0x1f8469(0x154)]({'groupId':_0x1870d1,'range':_0x18c8e2});return _0x13f761;}[_0x5b3260(0x165)](_0x3994ff){const _0x56a5d0=_0x5b3260;var _0x4b9cd5;const {pivotTableId:_0x344a74,unitId:_0x44aaaa,subUnitId:_0x578744}=_0x3994ff;if(!_0x344a74||!_0x44aaaa||!_0x578744)return;const _0x144800=this[_0x56a5d0(0x27e)](_0x44aaaa,_0x578744),_0x3b0f56=(_0x4b9cd5=this['_pivotRenderInfoCache'][_0x56a5d0(0x3e5)](_0x44aaaa))===null||_0x4b9cd5===void 0x0||(_0x4b9cd5=_0x4b9cd5['get'](_0x578744))===null||_0x4b9cd5===void 0x0?void 0x0:_0x4b9cd5['get'](_0x344a74);if(_0x3b0f56===null||_0x3b0f56===void 0x0?void 0x0:_0x3b0f56[_0x56a5d0(0x206)]){for(const _0x3fbf0d of Object['keys'](_0x3b0f56[_0x56a5d0(0x206)]))_0x3b0f56['rangesInfo'][_0x3fbf0d][_0x56a5d0(0x21b)](_0x2b6721=>{const _0x193cf9=_0x56a5d0;for(let _0x13351c=_0x2b6721[_0x193cf9(0x401)];_0x13351c<=_0x2b6721['endRow'];_0x13351c++)for(let _0x885a9=_0x2b6721[_0x193cf9(0x29c)];_0x885a9<=_0x2b6721[_0x193cf9(0x2bc)];_0x885a9++)_0x144800[_0x193cf9(0x391)](_0x13351c,_0x885a9);});}if(_0x3b0f56){var _0x59d5f5;(_0x59d5f5=this[_0x56a5d0(0x25c)][_0x56a5d0(0x3e5)](_0x44aaaa))===null||_0x59d5f5===void 0x0||(_0x59d5f5=_0x59d5f5[_0x56a5d0(0x3e5)](_0x578744))===null||_0x59d5f5===void 0x0||_0x59d5f5[_0x56a5d0(0x384)](_0x344a74);}this[_0x56a5d0(0x398)][_0x56a5d0(0x3e1)]({'unitId':_0x44aaaa,'subUnitId':_0x578744,'valueMatrix':_0x144800,'pivotTableId':_0x344a74,'rangesCache':void 0x0,'type':_0x3994ff[_0x56a5d0(0x3d0)]}),this[_0x56a5d0(0x34a)][_0x56a5d0(0x20b)](_0x44aaaa,_0x578744,SHEET_PIVOT_EXCLUSIVE_ID,_0x344a74);}[_0x5b3260(0x388)](_0x5319c4,_0x1134b9,_0x98c920){const _0x2d38ff=_0x5b3260;var _0x4f0ec2,_0x265481;if(!this[_0x2d38ff(0x25c)][_0x2d38ff(0x194)](_0x5319c4))this['_pivotRenderInfoCache'][_0x2d38ff(0x2c9)](_0x5319c4,new Map());if(!((_0x4f0ec2=this[_0x2d38ff(0x25c)]['get'](_0x5319c4))===null||_0x4f0ec2===void 0x0?void 0x0:_0x4f0ec2[_0x2d38ff(0x194)](_0x1134b9))){var _0x297b3d;(_0x297b3d=this['_pivotRenderInfoCache'][_0x2d38ff(0x3e5)](_0x5319c4))===null||_0x297b3d===void 0x0||_0x297b3d[_0x2d38ff(0x2c9)](_0x1134b9,new Map());}if(!((_0x265481=this[_0x2d38ff(0x25c)]['get'](_0x5319c4))===null||_0x265481===void 0x0||(_0x265481=_0x265481[_0x2d38ff(0x3e5)](_0x1134b9))===null||_0x265481===void 0x0?void 0x0:_0x265481[_0x2d38ff(0x194)](_0x98c920))){var _0x1f9758;(_0x1f9758=this[_0x2d38ff(0x25c)]['get'](_0x5319c4))===null||_0x1f9758===void 0x0||(_0x1f9758=_0x1f9758['get'](_0x1134b9))===null||_0x1f9758===void 0x0||_0x1f9758[_0x2d38ff(0x2c9)](_0x98c920,{});}return this[_0x2d38ff(0x25c)][_0x2d38ff(0x3e5)](_0x5319c4)['get'](_0x1134b9)[_0x2d38ff(0x3e5)](_0x98c920);}['_ensurePivotItemRenderValueMatrixCache'](_0x3aad7f,_0x1663a1){const _0x59f9f2=_0x5b3260;var _0x359678;if(!this[_0x59f9f2(0x22c)][_0x59f9f2(0x194)](_0x3aad7f))this[_0x59f9f2(0x22c)][_0x59f9f2(0x2c9)](_0x3aad7f,new Map());if(!((_0x359678=this[_0x59f9f2(0x22c)][_0x59f9f2(0x3e5)](_0x3aad7f))===null||_0x359678===void 0x0?void 0x0:_0x359678[_0x59f9f2(0x194)](_0x1663a1))){var _0x1c3f61;(_0x1c3f61=this['_pivotRenderValueMatrixCache']['get'](_0x3aad7f))===null||_0x1c3f61===void 0x0||_0x1c3f61[_0x59f9f2(0x2c9)](_0x1663a1,new _univerjs_core[(_0x59f9f2(0x1e5))]());}return this[_0x59f9f2(0x22c)]['get'](_0x3aad7f)[_0x59f9f2(0x3e5)](_0x1663a1);}[_0x5b3260(0x358)](_0x6edd78,_0x135996,_0x3a8734,_0x438678){const _0x81dfd4=_0x5b3260;var _0x2353b9;const _0x412f11=(_0x2353b9=this['_pivotRenderValueMatrixCache'][_0x81dfd4(0x3e5)](_0x6edd78))===null||_0x2353b9===void 0x0||(_0x2353b9=_0x2353b9['get'](_0x135996))===null||_0x2353b9===void 0x0?void 0x0:_0x2353b9[_0x81dfd4(0x323)](_0x3a8734,_0x438678);if(_0x412f11===void 0x0||_0x412f11===null)return;return _0x412f11;}[_0x5b3260(0x38b)](_0x2b5308,_0xd1ea51,_0x57e419,_0x2b97f8){const _0x1ee464=_0x5b3260;var _0x2e01e2;const _0xd22477=(0x0,_univerjs_core['cellToRange'])(_0x57e419,_0x2b97f8),_0x56c541=(_0x2e01e2=this[_0x1ee464(0x25c)]['get'](_0x2b5308))===null||_0x2e01e2===void 0x0?void 0x0:_0x2e01e2[_0x1ee464(0x3e5)](_0xd1ea51);if(!_0x56c541)return;return Array[_0x1ee464(0x176)](_0x56c541[_0x1ee464(0x2da)]())[_0x1ee464(0x2ad)](_0xdeeaf1=>{const _0x3e2a1b=_0x1ee464,_0x5021ea=_0x56c541['get'](_0xdeeaf1),_0x1a55f7=_0x5021ea===null||_0x5021ea===void 0x0?void 0x0:_0x5021ea['rangesInfo'];if(!_0x1a55f7)return![];return Object['keys'](_0x1a55f7)[_0x3e2a1b(0x1c4)](_0x11e69a=>{const _0x52c007=_0x3e2a1b;return _0x1a55f7[_0x11e69a][_0x52c007(0x1c4)](_0x58da02=>_univerjs_core[_0x52c007(0x422)][_0x52c007(0x31f)](_0x58da02,_0xd22477));});});}[_0x5b3260(0x15b)](_0x3727c5,_0x5d5164,_0x5d9a3b){const _0x3287cc=_0x5b3260;var _0x2e9f46;const _0x2ced9d=(_0x2e9f46=this[_0x3287cc(0x25c)][_0x3287cc(0x3e5)](_0x3727c5))===null||_0x2e9f46===void 0x0?void 0x0:_0x2e9f46[_0x3287cc(0x3e5)](_0x5d5164),_0x554040=[];if(!_0x2ced9d)return _0x554040;return Array[_0x3287cc(0x176)](_0x2ced9d['keys']())[_0x3287cc(0x21b)](_0x253cb1=>{const _0x15249e=_0x3287cc,_0x102413=_0x2ced9d[_0x15249e(0x3e5)](_0x253cb1),_0xab0740=_0x102413===null||_0x102413===void 0x0?void 0x0:_0x102413['rangesInfo'];if(_0xab0740)for(const _0x58936d of Object['values'](_0xab0740)){let _0x30c7d9=![];for(const _0x2100e3 of _0x58936d)if(_univerjs_core[_0x15249e(0x422)][_0x15249e(0x196)](_0x2100e3,_0x5d9a3b)){_0x554040[_0x15249e(0x154)](_0x253cb1),_0x30c7d9=!![];break;}if(_0x30c7d9)break;}}),_0x554040;}['getSubUnitPivotMatrix'](_0x25abcc,_0x558f17){const _0x4658c6=_0x5b3260;var _0x1b50e9,_0x290a45;return(_0x1b50e9=(_0x290a45=this['_pivotRenderValueMatrixCache']['get'](_0x25abcc))===null||_0x290a45===void 0x0?void 0x0:_0x290a45[_0x4658c6(0x3e5)](_0x558f17))!==null&&_0x1b50e9!==void 0x0?_0x1b50e9:new _univerjs_core[(_0x4658c6(0x1e5))]();}[_0x5b3260(0x1f1)](_0x2f193f,_0x79d04b){const _0x2da505=_0x5b3260;var _0x2c1221;return(_0x2c1221=this[_0x2da505(0x25c)]['get'](_0x2f193f))===null||_0x2c1221===void 0x0?void 0x0:_0x2c1221[_0x2da505(0x3e5)](_0x79d04b);}[_0x5b3260(0x402)](_0x3e2494,_0x59ef75,_0x4678e3){const _0x3a3a51=_0x5b3260;var _0x42fcbe;return(_0x42fcbe=this[_0x3a3a51(0x25c)][_0x3a3a51(0x3e5)](_0x3e2494))===null||_0x42fcbe===void 0x0||(_0x42fcbe=_0x42fcbe[_0x3a3a51(0x3e5)](_0x59ef75))===null||_0x42fcbe===void 0x0?void 0x0:_0x42fcbe[_0x3a3a51(0x3e5)](_0x4678e3);}['deleteUnitId'](_0x30aff4){const _0x3c7110=_0x5b3260;this[_0x3c7110(0x25c)][_0x3c7110(0x384)](_0x30aff4),this[_0x3c7110(0x22c)][_0x3c7110(0x384)](_0x30aff4);}[_0x5b3260(0x278)](_0x3b947f,_0x4c9dc6){const _0x15819a=_0x5b3260;this[_0x15819a(0x335)][_0x15819a(0x3e1)]({'unitId':_0x3b947f,'subUnitId':_0x4c9dc6});}};SheetsPivotTableAdaptorModel=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x5b3260(0x13b)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x1e6)])),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(SheetsPivotTableConfigModel)),__decorateParam(0x3,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x13e)])),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_sheets[_0x5b3260(0x437)]))],SheetsPivotTableAdaptorModel);let SheetsPivotTableService=class SheetsPivotTableService extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x1bd7a5,_0x510479){const _0x203428=_0x5b3260;super(),this[_0x203428(0x392)]=_0x1bd7a5,this['_sheetsPivotTableAdaptorModel']=_0x510479,_defineProperty(this,_0x203428(0x273),new _univerjs_core['AsyncInterceptorManager']({'PIVOT_PERFORM_CHECK':PIVOT_PERFORM_CHECK})),_defineProperty(this,_0x203428(0x24d),new _univerjs_core[(_0x203428(0x365))]({'PIVOT_MUTATION_GENERATE':PIVOT_MUTATION_GENERATE})),this['_init']();}[_0x5b3260(0x315)](){const _0x67b918=_0x5b3260;this[_0x67b918(0x413)]();}[_0x5b3260(0x184)](_0xcdb97c){const _0x573af3=_0x5b3260;return this[_0x573af3(0x273)][_0x573af3(0x1a1)](PIVOT_PERFORM_CHECK)(![],_0xcdb97c);}['_initViewModelBySheetInterceptor'](){const _0xf48363=_0x5b3260;this['disposeWithMe'](this[_0xf48363(0x392)][_0xf48363(0x441)](_univerjs_sheets[_0xf48363(0x217)][_0xf48363(0x2bd)],{'priority':0xc8,'effect':_univerjs_core[_0xf48363(0x224)][_0xf48363(0x26b)]|_univerjs_core[_0xf48363(0x224)][_0xf48363(0x442)],'handler':(_0x3e7857,_0x38f0bc,_0x138518)=>{const _0xc54226=_0xf48363,{row:_0x444c44,col:_0x4bb16e,unitId:_0xc56156,subUnitId:_0x4a622b,workbook:_0x40e3d9}=_0x38f0bc,_0x212bc6=this[_0xc54226(0x387)][_0xc54226(0x358)](_0xc56156,_0x4a622b,_0x444c44,_0x4bb16e);if(!_0x212bc6)return _0x138518(_0x3e7857);const _0x5f070f={..._0x3e7857};if(_0x212bc6['v']||_0x212bc6['v']===0x0)_0x5f070f['v']=_0x212bc6['v'];if(_0x212bc6['t'])_0x5f070f['t']=_0x212bc6['t'];const _0x1c8c48=(typeof(_0x3e7857===null||_0x3e7857===void 0x0?void 0x0:_0x3e7857['s'])==='string'?_0x40e3d9['getStyles']()['get'](_0x3e7857===null||_0x3e7857===void 0x0?void 0x0:_0x3e7857['s']):_0x3e7857===null||_0x3e7857===void 0x0?void 0x0:_0x3e7857['s'])||{},_0x38603c=_0x40e3d9[_0xc54226(0x3a1)]()[_0xc54226(0x3e5)](_0x212bc6['s']),_0x1c1d94={..._0x38603c,..._0x1c8c48};if(_0x38603c===null||_0x38603c===void 0x0?void 0x0:_0x38603c['n'])_0x1c1d94['n']=_0x38603c['n'];return _0x5f070f['s']=_0x40e3d9[_0xc54226(0x3a1)]()[_0xc54226(0x333)](_0x1c1d94),(_0x212bc6[_0xc54226(0x12c)]===_univerjs_pro_engine_pivot['PivotCellStyleTypeEnum'][_0xc54226(0x173)]||_0x212bc6[_0xc54226(0x12c)]===_univerjs_pro_engine_pivot[_0xc54226(0x239)][_0xc54226(0x19d)])&&(_0x5f070f[_0xc54226(0x423)]={},_0x5f070f['fontRenderExtension']['leftOffset']=0x10),_0x138518(_0x5f070f);}}));}};SheetsPivotTableService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_sheets['SheetInterceptorService'])),__decorateParam(0x1,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableAdaptorModel))],SheetsPivotTableService);const AddGroupCollectionMutation={'id':_0x5b3260(0x378),'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'handler':(_0x5b76d9,_0x5ad73a)=>{const _0x3aaad6=_0x5b3260;if(!_0x5ad73a)return![];const _0x3ba7f3=_0x5b76d9[_0x3aaad6(0x3e5)](_univerjs_core[_0x3aaad6(0x295)]);if(Boolean(_0x3ba7f3[_0x3aaad6(0x2fe)](_0x3aaad6(0x20d))))return!![];const {pivotTableId:_0x11c0ae,fieldJSON:_0x3a1c4d,unitId:_0x526243,subUnitId:_0x47317d}=_0x5ad73a;let _0x5b1896;const {dataFieldType:_0x29da1d,id:_0x51b984,name:_0x4b2265,hexCode:_0x5b6cb9,originalFieldId:_0x293a94}=_0x3a1c4d;if(_0x29da1d===_univerjs_pro_engine_pivot[_0x3aaad6(0x3df)]['dateGroupField'])_0x5b1896=new _univerjs_pro_engine_pivot['DateGroupField'](_0x51b984,_0x4b2265,_0x5b6cb9,_0x293a94);if(!_0x5b1896)return![];const _0x3656c1=_0x5b76d9[_0x3aaad6(0x3e5)](SheetsPivotDataSourceModel),_0x10e07d=_0x3656c1[_0x3aaad6(0x2d3)](_0x526243),_0x9ff21a=_0x10e07d[_0x3aaad6(0x329)](_0x11c0ae);_0x10e07d[_0x3aaad6(0x35a)](_0x5b1896),_0x9ff21a[_0x3aaad6(0x377)](_0x5b1896['getId'](),_0x5b1896['getName']());const _0x1a7a10=_0x9ff21a[_0x3aaad6(0x25b)](_0x5b1896[_0x3aaad6(0x395)]());if(_0x1a7a10)_0x5b1896['refreshGroupField'](_0x1a7a10);const _0x267719=_0x3656c1[_0x3aaad6(0x32a)](_0x526243,_0x47317d,_0x11c0ae);return _0x3656c1[_0x3aaad6(0x1c8)]({'unitId':_0x526243,'subUnitId':_0x47317d,'token':_0x11c0ae,'type':PivotTableOperationEnum[_0x3aaad6(0x178)],'pivotConfig':_0x267719}),!![];}},RemoveGroupCollectionMutation={'id':_0x5b3260(0x1de),'type':_univerjs_core['CommandType'][_0x5b3260(0x2be)],'handler':(_0xd68018,_0x1874bb)=>{const _0x5eb69b=_0x5b3260;if(!_0x1874bb)return![];const _0x229a36=_0xd68018[_0x5eb69b(0x3e5)](_univerjs_core[_0x5eb69b(0x295)]);if(Boolean(_0x229a36[_0x5eb69b(0x2fe)](_0x5eb69b(0x20d))))return!![];const {pivotTableId:_0x5c3a86,dataFieldId:_0x5bec55,unitId:_0x4c19e6,subUnitId:_0x41fa08}=_0x1874bb,_0x4ee5d8=_0xd68018[_0x5eb69b(0x3e5)](SheetsPivotDataSourceModel),_0x2cf3f3=_0x4ee5d8[_0x5eb69b(0x2d3)](_0x4c19e6);_0x2cf3f3[_0x5eb69b(0x329)](_0x5c3a86)['deleteField'](_0x5bec55);let _0x58c02d=!![];for(const _0x105083 in _0x2cf3f3[_0x5eb69b(0x2a4)])if(_0x2cf3f3[_0x5eb69b(0x2a4)][_0x105083]['getFieldIds']()[_0x5eb69b(0x32f)](_0x5bec55)){_0x58c02d=![];break;}if(_0x58c02d)_0x2cf3f3['deleteDataField'](_0x5bec55);const _0x2bb930=_0x4ee5d8['getPivotTableConfig'](_0x4c19e6,_0x41fa08,_0x5c3a86);return _0x4ee5d8['addDirtyPivotTable']({'unitId':_0x4c19e6,'subUnitId':_0x41fa08,'token':_0x5c3a86,'type':PivotTableOperationEnum[_0x5eb69b(0x178)],'pivotConfig':_0x2bb930}),!![];}};function getFieldListByArea(_0x243495,_0x1494e0){const _0x4452ac=_0x5b3260;switch(_0x1494e0){case _univerjs_pro_engine_pivot[_0x4452ac(0x23c)][_0x4452ac(0x26b)]:return _0x243495['valueFields'];case _univerjs_pro_engine_pivot[_0x4452ac(0x23c)][_0x4452ac(0x341)]:return _0x243495[_0x4452ac(0x306)];case _univerjs_pro_engine_pivot[_0x4452ac(0x23c)][_0x4452ac(0x3ed)]:return _0x243495[_0x4452ac(0x208)];case _univerjs_pro_engine_pivot[_0x4452ac(0x23c)][_0x4452ac(0x269)]:return _0x243495['columnFields'];default:return[];}}function getFieldJson(_0x31147f,_0x47b4c0){const _0x1da2c8=_0x5b3260;return _0x31147f['measure'][_0x47b4c0]||_0x31147f[_0x1da2c8(0x394)][_0x47b4c0];}function applyAddFieldChangeSet(_0x247f44,_0x5dbb11){const _0xe14156=_0x5b3260,{area:_0x45a9dc,fieldJson:_0x21c9d0,index:_0x1c8318}=_0x5dbb11;if(_0x45a9dc===_univerjs_pro_engine_pivot[_0xe14156(0x23c)][_0xe14156(0x26b)])_0x247f44['measure'][_0x21c9d0['id']]=_0x21c9d0;else _0x247f44[_0xe14156(0x394)][_0x21c9d0['id']]=_0x21c9d0;getFieldListByArea(_0x247f44,_0x45a9dc)[_0xe14156(0x435)](_0x1c8318,0x0,_0x21c9d0['id']);}function applyRemoveFieldChangeSet(_0xb4a36f,_0x413359){const _0x2fe117=_0x5b3260,{area:_0x34fe34,fieldId:_0x5ace1b,index:_0x45ac1e}=_0x413359;if(_0x34fe34===_univerjs_pro_engine_pivot[_0x2fe117(0x23c)][_0x2fe117(0x26b)])delete _0xb4a36f['measure'][_0x5ace1b];else delete _0xb4a36f['dimension'][_0x5ace1b];getFieldListByArea(_0xb4a36f,_0x34fe34)['splice'](_0x45ac1e,0x1);}function applyRenameFieldChangeSet(_0x2ffda6,_0x4d7a8d){const _0x3e836d=_0x5b3260,{fieldId:_0x508a93,name:_0xdfb4c0}=_0x4d7a8d,_0x1b5549=getFieldJson(_0x2ffda6,_0x508a93);if(_0x1b5549)_0x1b5549[_0x3e836d(0x374)]=_0xdfb4c0;}function applyCollapseChangeSet(_0x2acad0,_0x271612){const _0x334a48=_0x5b3260,{fieldId:_0x354b80,collapse:_0x4656e7,item:_0x2695dc}=_0x271612;if(_0x2695dc!==void 0x0)_0x2acad0[_0x334a48(0x189)][_0x354b80]=_0x2acad0['collapseInfo'][_0x354b80]||{},_0x2acad0['collapseInfo'][_0x354b80][_0x2695dc]=_0x4656e7;else _0x2acad0[_0x334a48(0x189)][_0x354b80]=_0x4656e7;}function applySetFormatChangeSet(_0x21879a,_0x5cdf2e){const _0x208bed=_0x5b3260,{fieldId:_0x19a257,format:_0x563647}=_0x5cdf2e,_0x56aa3d=getFieldJson(_0x21879a,_0x19a257);if(_0x56aa3d)_0x56aa3d[_0x208bed(0x2f7)]=_0x563647;}function applySetFilterChangeSet(_0x4d3a58,_0x8700ac){const _0x303ee1=_0x5b3260,{fieldId:_0x5acce2,filterInfo:_0x4fd166}=_0x8700ac,_0x57d336=getFieldJson(_0x4d3a58,_0x5acce2);if(_0x57d336)_0x57d336[_0x303ee1(0x351)]=_0x4fd166;}function applySetValueFilterChangeSet(_0x1586e2,_0x279110){const _0x5b3abd=_0x5b3260,{fieldId:_0x636174,filterInfo:_0x4680ff}=_0x279110,_0x4238d1=_0x1586e2[_0x5b3abd(0x380)][_0x5b3abd(0x161)](_0x493c9f=>_0x493c9f[_0x5b3abd(0x241)]!==_0x636174);if(_0x4680ff)_0x4238d1[_0x5b3abd(0x154)]({'fieldId':_0x636174,'filterInfo':_0x4680ff});_0x1586e2['valueFilter']=_0x4238d1;}function applySetSubtotalChangeSet(_0x50b1d9,_0x26033b){const _0x5cb49d=_0x5b3260,{fieldId:_0x92c240,subtotalType:_0x2342d0}=_0x26033b,_0x26c97c=getFieldJson(_0x50b1d9,_0x92c240);if(_0x26c97c)_0x26c97c[_0x5cb49d(0x32d)]=_0x2342d0;}function applyFieldPositionChangeSet(_0x39fd0d,_0x5e700a){const _0x53b41a=_0x5b3260,{fieldId:_0x593726,oldArea:_0x4dc4ee,area:_0xcc6178,oldIndex:_0x1e88e3,index:_0x57b9bf}=_0x5e700a,_0x367e94=_0x4dc4ee!==_univerjs_pro_engine_pivot[_0x53b41a(0x23c)][_0x53b41a(0x26b)]&&_0xcc6178===_univerjs_pro_engine_pivot[_0x53b41a(0x23c)][_0x53b41a(0x26b)],_0x406922=_0x4dc4ee===_univerjs_pro_engine_pivot[_0x53b41a(0x23c)][_0x53b41a(0x26b)]&&_0xcc6178!==_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum']['Value'];if(_0x367e94||_0x406922){const _0x4501b3=getFieldJson(_0x39fd0d,_0x593726);if(_0x4501b3)_0x367e94?(delete _0x39fd0d[_0x53b41a(0x394)][_0x593726],_0x39fd0d[_0x53b41a(0x1b2)][_0x593726]=_0x4501b3):(delete _0x39fd0d[_0x53b41a(0x1b2)][_0x593726],_0x39fd0d[_0x53b41a(0x394)][_0x593726]=_0x4501b3);}const _0x335cde=getFieldListByArea(_0x39fd0d,_0x4dc4ee),_0x411aa0=getFieldListByArea(_0x39fd0d,_0xcc6178);_0x335cde[_0x53b41a(0x435)](_0x1e88e3,0x1),_0x411aa0[_0x53b41a(0x435)](_0x57b9bf,0x0,_0x593726);}function applyValuePositionChangeSet(_0x51a596,_0x2c9453){const _0x17477f=_0x5b3260,{valuePosition:_0x902a8a,index:_0x143608}=_0x2c9453;_0x51a596[_0x17477f(0x399)]=_0x902a8a,_0x51a596[_0x17477f(0x169)]=_0x143608;}function applySourceInfoChangeSet(_0x36812e,_0x18e48c){const _0x3387f4=_0x5b3260,{tableFieldId:_0x59c98b,sourceName:_0x3494de,dataFieldId:_0xcfc20e}=_0x18e48c,_0x3f83cc=getFieldJson(_0x36812e,_0x59c98b);_0x3f83cc&&(_0x3f83cc['sourceName']=_0x3494de,_0x3f83cc[_0x3387f4(0x3a9)]=_0xcfc20e);}function applySetSortChangeSet(_0x30540b,_0x493b69){const _0x2676ae=_0x5b3260,{fieldId:_0x5147d7,sortInfo:_0x16d52e}=_0x493b69,_0x24cae1=getFieldJson(_0x30540b,_0x5147d7);if(_0x24cae1)_0x24cae1[_0x2676ae(0x1be)]=_0x16d52e;}function applySetOptionsChangeSet(_0x2cc588,_0xf2a44d){const _0x24c1ed=_0x5b3260,{options:_0x5467de}=_0xf2a44d;_0x2cc588[_0x24c1ed(0x1da)]={..._0x2cc588[_0x24c1ed(0x1da)],..._0x5467de};}const AddPivotFieldMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x340),'handler'(_0xf74787,_0x467498){const _0x5a5cf7=_0x5b3260;if(!_0x467498)return![];const _0x21303=_0xf74787[_0x5a5cf7(0x3e5)](_univerjs_core[_0x5a5cf7(0x295)]);if(Boolean(_0x21303[_0x5a5cf7(0x2fe)](_0x5a5cf7(0x20d))))return!![];const _0x160677=_0xf74787[_0x5a5cf7(0x3e5)](SheetsPivotDataSourceModel),{pivotTableId:_0x4aaef3,fieldJson:_0x331f98,area:_0x282660,index:_0x23ec74,unitId:_0x2e4cd7,subUnitId:_0x2ffc20}=_0x467498,_0x50ddb5=_0x160677[_0x5a5cf7(0x407)](_0x4aaef3);if(!_0x50ddb5)return![];let _0x1dde05;if(_0x282660===_univerjs_pro_engine_pivot[_0x5a5cf7(0x23c)]['Value'])_0x1dde05=(0x0,_univerjs_pro_engine_pivot['createValueField'])(_0x331f98);else _0x1dde05=(0x0,_univerjs_pro_engine_pivot[_0x5a5cf7(0x3e3)])(_0x331f98);_0x50ddb5[_0x5a5cf7(0x377)](_0x1dde05,_0x282660,_0x23ec74),applyAddFieldChangeSet(_0x160677['getPivotTableModelConfig'](_0x2e4cd7,_0x2ffc20,_0x4aaef3),_0x467498);const _0x3730d6=_0x160677[_0x5a5cf7(0x32a)](_0x2e4cd7,_0x2ffc20,_0x4aaef3);return _0x160677[_0x5a5cf7(0x1c8)]({'unitId':_0x2e4cd7,'subUnitId':_0x2ffc20,'token':_0x4aaef3,'type':PivotTableOperationEnum[_0x5a5cf7(0x178)],'pivotConfig':_0x3730d6}),!![];}},RemovePivotFieldMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':_0x5b3260(0x135),'handler'(_0x596f43,_0x29f55a){const _0x3f2d24=_0x5b3260;if(!_0x29f55a)return![];const _0x204f7d=_0x596f43['get'](_univerjs_core[_0x3f2d24(0x295)]);if(Boolean(_0x204f7d[_0x3f2d24(0x2fe)](_0x3f2d24(0x20d))))return!![];const _0x30b543=_0x596f43[_0x3f2d24(0x3e5)](SheetsPivotDataSourceModel),{pivotTableId:_0x3d98c8,fieldId:_0x4c4b1b,unitId:_0x1103d8,subUnitId:_0xa4bd97}=_0x29f55a,_0x1398e2=_0x30b543[_0x3f2d24(0x407)](_0x3d98c8);if(!_0x1398e2)return![];_0x1398e2['removeField'](_0x4c4b1b),applyRemoveFieldChangeSet(_0x30b543['getPivotTableModelConfig'](_0x1103d8,_0xa4bd97,_0x3d98c8),_0x29f55a);const _0x4cc4ca=_0x30b543[_0x3f2d24(0x32a)](_0x1103d8,_0xa4bd97,_0x3d98c8);return _0x30b543[_0x3f2d24(0x1c8)]({'unitId':_0x1103d8,'subUnitId':_0xa4bd97,'token':_0x3d98c8,'type':PivotTableOperationEnum[_0x3f2d24(0x178)],'pivotConfig':_0x4cc4ca}),!![];}},RenamePivotFieldMutation={'type':_univerjs_core['CommandType'][_0x5b3260(0x2be)],'id':_0x5b3260(0x420),'handler'(_0x30cb45,_0x40b72a){const _0x10cea2=_0x5b3260;if(!_0x40b72a)return![];const _0x4d43c3=_0x30cb45['get'](_univerjs_core['IConfigService']);if(Boolean(_0x4d43c3['getConfig'](_0x10cea2(0x20d))))return!![];const _0x122f18=_0x30cb45[_0x10cea2(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x387886,subUnitId:_0x4803ea,pivotTableId:_0x346c9a,fieldId:_0x37a42f,name:_0x4c50db}=_0x40b72a,_0x1e33c1=_0x122f18[_0x10cea2(0x407)](_0x346c9a);if(!_0x1e33c1)return![];return _0x1e33c1[_0x10cea2(0x311)](_0x37a42f,_0x4c50db),applyRenameFieldChangeSet(_0x122f18[_0x10cea2(0x24c)](_0x387886,_0x4803ea,_0x346c9a),_0x40b72a),_0x122f18[_0x10cea2(0x1c8)]({'unitId':_0x387886,'subUnitId':_0x4803ea,'token':_0x346c9a,'type':PivotTableOperationEnum[_0x10cea2(0x178)]}),!![];}},SetPivotCollapseMutation={'type':_univerjs_core['CommandType']['MUTATION'],'id':_0x5b3260(0x403),'handler'(_0x4217c4,_0x347311){const _0x18b6de=_0x5b3260;if(!_0x347311)return![];const _0x4bcaa4=_0x4217c4['get'](_univerjs_core[_0x18b6de(0x295)]);if(Boolean(_0x4bcaa4[_0x18b6de(0x2fe)](_0x18b6de(0x20d))))return!![];const _0x52f19f=_0x4217c4['get'](SheetsPivotDataSourceModel),{unitId:_0x24a130,subUnitId:_0x4be7c9,pivotTableId:_0x533ba5,fieldId:_0x170f3a,collapse:_0x18ce12,item:_0x239a3e}=_0x347311,_0x3c3297=_0x52f19f[_0x18b6de(0x407)](_0x533ba5);if(!_0x3c3297)return![];return _0x3c3297['setCollapse'](_0x170f3a,_0x18ce12,_0x239a3e),applyCollapseChangeSet(_0x52f19f[_0x18b6de(0x24c)](_0x24a130,_0x4be7c9,_0x533ba5),_0x347311),_0x52f19f[_0x18b6de(0x1c8)]({'unitId':_0x24a130,'subUnitId':_0x4be7c9,'token':_0x533ba5,'type':PivotTableOperationEnum[_0x18b6de(0x178)]}),!![];}},SetPivotFieldFormatMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':_0x5b3260(0x248),'handler'(_0xcf2d07,_0x8c83c6){const _0x3b18e8=_0x5b3260;if(!_0x8c83c6)return![];const _0x19dea7=_0xcf2d07[_0x3b18e8(0x3e5)](_univerjs_core['IConfigService']);if(Boolean(_0x19dea7[_0x3b18e8(0x2fe)](_0x3b18e8(0x20d))))return!![];const _0x59b991=_0xcf2d07[_0x3b18e8(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x286994,subUnitId:_0x27a279,pivotTableId:_0x171836,fieldId:_0x55cda9,format:_0x35355e}=_0x8c83c6,_0x25ef63=_0x59b991['getPivotTableInstance'](_0x171836);if(!_0x25ef63)return![];return _0x25ef63['setFieldFormat'](_0x55cda9,_0x35355e),applySetFormatChangeSet(_0x59b991[_0x3b18e8(0x24c)](_0x286994,_0x27a279,_0x171836),_0x8c83c6),_0x59b991[_0x3b18e8(0x1c8)]({'unitId':_0x286994,'subUnitId':_0x27a279,'token':_0x171836,'type':PivotTableOperationEnum['Set']}),!![];}},SetPivotFilterMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x13a),'handler'(_0x5b5419,_0x450cf0){const _0x3fb69f=_0x5b3260;if(!_0x450cf0)return![];const _0x4eb96e=_0x5b5419[_0x3fb69f(0x3e5)](_univerjs_core[_0x3fb69f(0x295)]);if(Boolean(_0x4eb96e['getConfig']('SHEET_PIVOT_IN_MAIN_THREAD')))return!![];const _0x341ff3=_0x5b5419[_0x3fb69f(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x319137,subUnitId:_0x3923b4,pivotTableId:_0x3f80ac,fieldId:_0x271400,filterInfo:_0x58ccf3}=_0x450cf0,_0x27e6e0=_0x341ff3[_0x3fb69f(0x407)](_0x3f80ac);if(!_0x27e6e0)return![];return _0x27e6e0['setLabelFilterInfo'](_0x271400,_0x58ccf3),applySetFilterChangeSet(_0x341ff3['getPivotTableModelConfig'](_0x319137,_0x3923b4,_0x3f80ac),_0x450cf0),_0x341ff3[_0x3fb69f(0x1c8)]({'unitId':_0x319137,'subUnitId':_0x3923b4,'token':_0x3f80ac,'type':PivotTableOperationEnum[_0x3fb69f(0x178)]}),!![];}},SetPivotOptionMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':_0x5b3260(0x332),'handler'(_0x3bc541,_0x2918b7){const _0x2ffdff=_0x5b3260;if(!_0x2918b7)return![];const _0x48ecc5=_0x3bc541[_0x2ffdff(0x3e5)](_univerjs_core['IConfigService']);if(Boolean(_0x48ecc5[_0x2ffdff(0x2fe)](_0x2ffdff(0x20d))))return!![];const _0x4277b1=_0x3bc541[_0x2ffdff(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x55f867,subUnitId:_0x39d746,pivotTableId:_0x1ac6f9,options:_0x190ff0}=_0x2918b7,_0x130ee3=_0x4277b1[_0x2ffdff(0x407)](_0x1ac6f9);if(!_0x130ee3)return![];return _0x130ee3['setOptions'](_0x190ff0),applySetOptionsChangeSet(_0x4277b1[_0x2ffdff(0x24c)](_0x55f867,_0x39d746,_0x1ac6f9),_0x2918b7),_0x4277b1[_0x2ffdff(0x1c8)]({'unitId':_0x55f867,'subUnitId':_0x39d746,'token':_0x1ac6f9,'type':PivotTableOperationEnum[_0x2ffdff(0x178)]}),!![];}},SetPivotSortMutation={'type':_univerjs_core['CommandType'][_0x5b3260(0x2be)],'id':_0x5b3260(0x2c5),'handler'(_0x50d516,_0x211de5){const _0x52d51b=_0x5b3260;if(!_0x211de5)return![];const _0x30a60d=_0x50d516['get'](_univerjs_core[_0x52d51b(0x295)]);if(Boolean(_0x30a60d[_0x52d51b(0x2fe)]('SHEET_PIVOT_IN_MAIN_THREAD')))return!![];const _0x4af0b0=_0x50d516[_0x52d51b(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x4f66d3,subUnitId:_0x617c06,pivotTableId:_0x57356e,sortInfo:_0x4edb32,fieldId:_0x36d429}=_0x211de5,_0x50b2a4=_0x4af0b0[_0x52d51b(0x407)](_0x57356e);if(!_0x50b2a4)return![];return _0x50b2a4['setSortInfo'](_0x36d429,_0x4edb32),applySetSortChangeSet(_0x4af0b0[_0x52d51b(0x24c)](_0x4f66d3,_0x617c06,_0x57356e),_0x211de5),_0x4af0b0[_0x52d51b(0x1c8)]({'unitId':_0x4f66d3,'subUnitId':_0x617c06,'token':_0x57356e,'type':PivotTableOperationEnum[_0x52d51b(0x178)]}),!![];}},SetPivotSubtotalTypeMutation={'type':_univerjs_core['CommandType'][_0x5b3260(0x2be)],'id':'sheet.mutation.set-pivot-field-subtotal-type','handler'(_0x56346,_0x459ae5){const _0x37d075=_0x5b3260;if(!_0x459ae5)return![];const _0x5e134f=_0x56346['get'](_univerjs_core['IConfigService']);if(Boolean(_0x5e134f[_0x37d075(0x2fe)](_0x37d075(0x20d))))return!![];const _0x24a9cc=_0x56346[_0x37d075(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x2d6848,subUnitId:_0x5b113b,pivotTableId:_0x1e2e7e,fieldId:_0x346e7d,subtotalType:_0x283bc7}=_0x459ae5,_0x6dd570=_0x24a9cc[_0x37d075(0x407)](_0x1e2e7e);if(!_0x6dd570)return![];return _0x6dd570['setSubtotalType'](_0x346e7d,_0x283bc7),applySetSubtotalChangeSet(_0x24a9cc[_0x37d075(0x24c)](_0x2d6848,_0x5b113b,_0x1e2e7e),_0x459ae5),_0x24a9cc[_0x37d075(0x1c8)]({'unitId':_0x2d6848,'subUnitId':_0x5b113b,'token':_0x1e2e7e,'type':PivotTableOperationEnum[_0x37d075(0x178)]}),!![];}},SetPivotValueFilterMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':'sheet.mutation.set-pivot-value-filter','handler'(_0x1dc44b,_0x2eff7c){const _0x5a860c=_0x5b3260;if(!_0x2eff7c)return![];const _0x432ed6=_0x1dc44b[_0x5a860c(0x3e5)](_univerjs_core[_0x5a860c(0x295)]);if(Boolean(_0x432ed6[_0x5a860c(0x2fe)](_0x5a860c(0x20d))))return!![];const _0x6b024c=_0x1dc44b[_0x5a860c(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x4f48e7,subUnitId:_0x427823,pivotTableId:_0x322b67,fieldId:_0x42e5cb,filterInfo:_0x387a6b}=_0x2eff7c,_0x502d7f=_0x6b024c[_0x5a860c(0x407)](_0x322b67);if(!_0x502d7f)return![];return _0x502d7f[_0x5a860c(0x2ec)](_0x42e5cb,_0x387a6b),applySetValueFilterChangeSet(_0x6b024c[_0x5a860c(0x24c)](_0x4f48e7,_0x427823,_0x322b67),_0x2eff7c),_0x6b024c['addDirtyPivotTable']({'unitId':_0x4f48e7,'subUnitId':_0x427823,'token':_0x322b67,'type':PivotTableOperationEnum['Set']}),!![];}},UpdateFieldPositionMutation={'type':_univerjs_core['CommandType'][_0x5b3260(0x2be)],'id':_0x5b3260(0x338),'handler'(_0x26e80d,_0x38e245){const _0xb624a0=_0x5b3260;if(!_0x38e245)return![];const _0x35cb3f=_0x26e80d['get'](_univerjs_core['IConfigService']);if(Boolean(_0x35cb3f[_0xb624a0(0x2fe)](_0xb624a0(0x20d))))return!![];const _0x5c82b3=_0x26e80d['get'](SheetsPivotDataSourceModel),{unitId:_0x3e883c,subUnitId:_0x45f6fa,pivotTableId:_0x59db8f,area:_0x1953c9,index:_0x36fd72,fieldId:_0x530b00}=_0x38e245,_0x238bd2=_0x5c82b3['getPivotTableInstance'](_0x59db8f);if(!_0x238bd2)return![];return _0x238bd2[_0xb624a0(0x406)](_0x530b00,_0x1953c9,_0x36fd72),applyFieldPositionChangeSet(_0x5c82b3['getPivotTableModelConfig'](_0x3e883c,_0x45f6fa,_0x59db8f),_0x38e245),_0x5c82b3[_0xb624a0(0x1c8)]({'unitId':_0x3e883c,'subUnitId':_0x45f6fa,'token':_0x59db8f,'type':PivotTableOperationEnum[_0xb624a0(0x178)]}),!![];}},UpdatePivotFieldSourceInfoMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x291),'handler'(_0x3b63d7,_0x469045){const _0x71f685=_0x5b3260;if(!_0x469045)return![];const _0x251435=_0x3b63d7[_0x71f685(0x3e5)](_univerjs_core[_0x71f685(0x295)]);if(Boolean(_0x251435['getConfig'](_0x71f685(0x20d))))return!![];const _0x301357=_0x3b63d7[_0x71f685(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x3b6080,subUnitId:_0x52879f,pivotTableId:_0xa0f37a,sourceName:_0x91ceef,dataFieldId:_0x13f3ab,tableFieldId:_0x22ea9b}=_0x469045,_0x1940f5=_0x301357[_0x71f685(0x407)](_0xa0f37a);if(!_0x1940f5)return![];return _0x1940f5['updateFieldSourceInfo'](_0x22ea9b,_0x91ceef,_0x13f3ab),applySourceInfoChangeSet(_0x301357[_0x71f685(0x24c)](_0x3b6080,_0x52879f,_0xa0f37a),_0x469045),_0x301357[_0x71f685(0x1c8)]({'unitId':_0x3b6080,'subUnitId':_0x52879f,'token':_0xa0f37a,'type':PivotTableOperationEnum[_0x71f685(0x178)]}),!![];}},UpdateValuePositionMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x38e),'handler'(_0x5bebf6,_0x16d939){const _0x1d4d2b=_0x5b3260;if(!_0x16d939)return![];const _0x1c62a3=_0x5bebf6[_0x1d4d2b(0x3e5)](_univerjs_core[_0x1d4d2b(0x295)]);if(Boolean(_0x1c62a3['getConfig'](_0x1d4d2b(0x20d))))return!![];const _0x514a21=_0x5bebf6[_0x1d4d2b(0x3e5)](SheetsPivotDataSourceModel),{unitId:_0x2a04dd,subUnitId:_0x79771f,pivotTableId:_0x249901,valuePosition:_0x4e6712,index:_0x25464e}=_0x16d939,_0xdfd9b1=_0x514a21[_0x1d4d2b(0x407)](_0x249901);if(!_0xdfd9b1)return![];return _0xdfd9b1[_0x1d4d2b(0x198)](_0x4e6712,_0x25464e),applyValuePositionChangeSet(_0x514a21['getPivotTableModelConfig'](_0x2a04dd,_0x79771f,_0x249901),_0x16d939),_0x514a21[_0x1d4d2b(0x1c8)]({'unitId':_0x2a04dd,'subUnitId':_0x79771f,'token':_0x249901,'type':PivotTableOperationEnum[_0x1d4d2b(0x178)]}),!![];}};function applyChangeSet(_0x24b1e5,_0x49abf7,_0x304d2d){const _0x2c0cb2=_0x5b3260,{pivotTableId:_0x5e5395,unitId:_0x2ed6b9,subUnitId:_0x2d3243}=_0x49abf7,_0x3be4e6=[],_0x1e0c83=[];for(const _0x175871 of _0x304d2d)switch(_0x175871[_0x2c0cb2(0x3d0)]){case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x1c1)]:{const {fieldJson:_0x4a54dd,area:_0x1758fb,index:_0x361b39}=_0x175871,_0x5b04a4={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldJson':_0x4a54dd,'area':_0x1758fb,'index':_0x361b39},_0xbb87c0={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x4a54dd['id'],'area':_0x1758fb,'index':_0x361b39};_0x3be4e6[_0x2c0cb2(0x154)]({'id':AddPivotFieldMutation['id'],'params':_0x5b04a4}),_0x1e0c83[_0x2c0cb2(0x440)]({'id':RemovePivotFieldMutation['id'],'params':_0xbb87c0});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)]['SetSubtotalType']:{const {fieldId:_0x4c267f,newSubtotalType:_0x577ece,oldSubtotalType:_0x25c17c}=_0x175871,_0x19a0a2={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x4c267f,'subtotalType':_0x577ece};_0x3be4e6['push']({'id':SetPivotSubtotalTypeMutation['id'],'params':_0x19a0a2});const _0x1f94fe={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x4c267f,'subtotalType':_0x25c17c};_0x1e0c83['unshift']({'id':SetPivotSubtotalTypeMutation['id'],'params':_0x1f94fe});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)]['RemoveField']:{const {fieldId:_0x59d063,fieldJson:_0x8d9222,area:_0x5f2057,index:_0x253b2d}=_0x175871,_0x489dbc={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x59d063,'index':_0x253b2d,'area':_0x5f2057};_0x3be4e6[_0x2c0cb2(0x154)]({'id':RemovePivotFieldMutation['id'],'params':_0x489dbc});const _0x2d47d8={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldJson':_0x8d9222,'area':_0x5f2057,'index':_0x253b2d};_0x1e0c83[_0x2c0cb2(0x440)]({'id':AddPivotFieldMutation['id'],'params':_0x2d47d8});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)]['RenameField']:{const {fieldId:_0x4a3e36,oldName:_0xb8a3fa,newName:_0x375cf6}=_0x175871,_0x58d74f={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x4a3e36,'name':_0x375cf6};_0x3be4e6['push']({'id':RenamePivotFieldMutation['id'],'params':_0x58d74f});const _0x147d51={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x4a3e36,'name':_0xb8a3fa};_0x1e0c83[_0x2c0cb2(0x440)]({'id':RenamePivotFieldMutation['id'],'params':_0x147d51});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x26e)]:{const {fieldId:_0x201d09,oldFilterInfo:_0x4a4d77,newFilterInfo:_0x1f6b8a}=_0x175871,_0x3ece31={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x201d09,'filterInfo':_0x1f6b8a};_0x3be4e6[_0x2c0cb2(0x154)]({'id':SetPivotFilterMutation['id'],'params':_0x3ece31});const _0x28f837={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x201d09,'filterInfo':_0x4a4d77};_0x1e0c83[_0x2c0cb2(0x440)]({'id':SetPivotFilterMutation['id'],'params':_0x28f837});}break;case _univerjs_pro_engine_pivot['PivotTableChangeTypeEnum'][_0x2c0cb2(0x317)]:{const {fieldId:_0x9ece6d,oldSortInfo:_0x32b642,newSortInfo:_0x3ec5ff}=_0x175871,_0x2bed28={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x9ece6d,'sortInfo':_0x3ec5ff};_0x3be4e6[_0x2c0cb2(0x154)]({'id':SetPivotSortMutation['id'],'params':_0x2bed28});const _0x360d3d={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x9ece6d,'sortInfo':_0x32b642};_0x1e0c83[_0x2c0cb2(0x440)]({'id':SetPivotSortMutation['id'],'params':_0x360d3d});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x36f)]:{const {oldOptions:_0xbe3fe2,newOptions:_0x5c69c1}=_0x175871,_0x15829f={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'options':_0x5c69c1};_0x3be4e6[_0x2c0cb2(0x154)]({'id':SetPivotOptionMutation['id'],'params':_0x15829f});const _0x55a9d5={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'options':_0xbe3fe2};_0x1e0c83['unshift']({'id':SetPivotOptionMutation['id'],'params':_0x55a9d5});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x431)]:{const {oldArea:_0x9e3486,newArea:_0x1101ad,oldIndex:_0x48ac6b,newIndex:_0x4c3ef1,fieldId:_0x5b05fe}=_0x175871,_0x322fbe={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x5b05fe,'area':_0x1101ad,'index':_0x4c3ef1,'oldArea':_0x9e3486,'oldIndex':_0x48ac6b};_0x3be4e6[_0x2c0cb2(0x154)]({'id':UpdateFieldPositionMutation['id'],'params':_0x322fbe});const _0x60f254={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x5b05fe,'area':_0x9e3486,'index':_0x48ac6b,'oldArea':_0x1101ad,'oldIndex':_0x4c3ef1};_0x1e0c83[_0x2c0cb2(0x440)]({'id':UpdateFieldPositionMutation['id'],'params':_0x60f254});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)]['UpdateValuePosition']:{const {oldValuePosition:_0x7d121f,newValuePosition:_0x54ccfe,oldIndex:_0x4b4d85,newIndex:_0x15ce7c}=_0x175871,_0x55fcf7={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'valuePosition':_0x54ccfe,'index':_0x15ce7c};_0x3be4e6[_0x2c0cb2(0x154)]({'id':UpdateValuePositionMutation['id'],'params':_0x55fcf7});const _0x590f4d={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'valuePosition':_0x7d121f,'index':_0x4b4d85};_0x1e0c83[_0x2c0cb2(0x440)]({'id':UpdateValuePositionMutation['id'],'params':_0x590f4d});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x356)]:{const {fieldId:_0x1a1bb9,collapse:_0x2b5e0a,item:_0xc41e4a}=_0x175871,_0x2c0fd4={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x1a1bb9,'collapse':_0x2b5e0a,'item':_0xc41e4a};_0x3be4e6[_0x2c0cb2(0x154)]({'id':SetPivotCollapseMutation['id'],'params':_0x2c0fd4});const _0x2a06c3={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x1a1bb9,'collapse':!_0x2b5e0a,'item':_0xc41e4a};_0x1e0c83[_0x2c0cb2(0x440)]({'id':SetPivotCollapseMutation['id'],'params':_0x2a06c3});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x22e)]:{const {newFormat:_0x1fd52a,oldFormat:_0x2138ca,fieldId:_0x43a3db}=_0x175871,_0x36013f={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x43a3db,'format':_0x1fd52a};_0x3be4e6['push']({'id':SetPivotFieldFormatMutation['id'],'params':_0x36013f});const _0x526c89={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x43a3db,'format':_0x2138ca};_0x1e0c83[_0x2c0cb2(0x440)]({'id':SetPivotFieldFormatMutation['id'],'params':_0x526c89});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)][_0x2c0cb2(0x42c)]:{const {tableFieldId:_0x13fcce,oldSourceName:_0xbef19e,newSourceName:_0x3cf74b,oldDataFieldId:_0x20ea93,newDataFieldId:_0x12bce9}=_0x175871,_0x3e026c={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'tableFieldId':_0x13fcce,'sourceName':_0x3cf74b,'dataFieldId':_0x12bce9};_0x3be4e6[_0x2c0cb2(0x154)]({'id':UpdatePivotFieldSourceInfoMutation['id'],'params':_0x3e026c});const _0x36e08f={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'tableFieldId':_0x13fcce,'sourceName':_0xbef19e,'dataFieldId':_0x20ea93};_0x1e0c83[_0x2c0cb2(0x440)]({'id':UpdatePivotFieldSourceInfoMutation['id'],'params':_0x36e08f});}break;case _univerjs_pro_engine_pivot[_0x2c0cb2(0x286)]['SetValueFilter']:{const {fieldId:_0x31c850,filterInfo:_0x59c9d3,oldFilterInfo:_0x7d03c9}=_0x175871,_0x5b6ae7={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x31c850,'filterInfo':_0x59c9d3};_0x3be4e6[_0x2c0cb2(0x154)]({'id':SetPivotValueFilterMutation['id'],'params':_0x5b6ae7});const _0x440264={'unitId':_0x2ed6b9,'subUnitId':_0x2d3243,'pivotTableId':_0x5e5395,'fieldId':_0x31c850,'filterInfo':_0x7d03c9};_0x1e0c83[_0x2c0cb2(0x440)]({'id':SetPivotValueFilterMutation['id'],'params':_0x440264});}}return{'redos':_0x3be4e6,'undos':_0x1e0c83};}function generateMutationsFromPivotCommand(_0x16b0d7,_0x55629e){const _0x17d95b=_0x5b3260;var _0x48828c;const _0x411579=_0x16b0d7[_0x17d95b(0x3e5)](SheetsPivotTableService),{cellInfo:_0x674d87,view:_0x365cbc,isEmpty:_0x5b8caf}=_0x55629e;return(_0x48828c=_0x411579[_0x17d95b(0x24d)][_0x17d95b(0x25a)](PIVOT_MUTATION_GENERATE)(defaultEmptyPivotGeneratedMutations,{'cellInfo':_0x674d87,'view':_0x365cbc,'isEmpty':_0x5b8caf}))!==null&&_0x48828c!==void 0x0?_0x48828c:defaultEmptyPivotGeneratedMutations;}const AddPivotFieldCommand={'type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'id':_0x5b3260(0x1e2),async 'handler'(_0x47872c,_0x3ffa0c){const _0x4a473e=_0x5b3260;if(!_0x3ffa0c)return![];const _0x56d96d=_0x47872c[_0x4a473e(0x3e5)](_univerjs_core[_0x4a473e(0x151)]),_0x20b2ee=_0x47872c[_0x4a473e(0x3e5)](SheetsPivotRPCService),_0x458c17=_0x47872c[_0x4a473e(0x3e5)](_univerjs_core[_0x4a473e(0x2bf)]),{pivotTableId:_0x4ce262,dataFieldId:_0x18cd7d,fieldArea:_0x408979,index:_0x8803fe,unitId:_0xfe9d8d,subUnitId:_0x2820d2}=_0x3ffa0c,_0x2c99e8=(await _0x20b2ee[_0x4a473e(0x235)]({'unitId':_0xfe9d8d,'subUnitId':_0x2820d2,'pivotTableId':_0x4ce262,'params':{'type':PivotDisplayDataType[_0x4a473e(0x3ef)],'addPivotField':{'dataFieldId':_0x18cd7d,'fieldArea':_0x408979,'index':_0x8803fe}}}))[_0x4a473e(0x21e)][_0x4a473e(0x16c)];if(!_0x2c99e8)return![];const {view:_0x1d61d4,changesets:_0x20810e,isEmpty:_0x3a8b6e,pivotTableConfig:_0x5905a2,shouldBeAddedGroupJSON:_0x2be37a}=_0x2c99e8,_0x5165d8=_0x5905a2['targetCellInfo'],_0xee19a7=new _univerjs_pro_engine_pivot['PivotView']();_0xee19a7[_0x4a473e(0x3db)](_0x1d61d4);const _0x2c418c={'cellInfo':_0x5165d8,'view':_0xee19a7,'isEmpty':_0x3a8b6e};if(!await _0x47872c[_0x4a473e(0x3e5)](SheetsPivotTableService)['asyncInterceptor']['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0x2c418c))return![];const _0x380253=getInsertRowColMutations(_0x47872c,_0xee19a7,_0x5165d8,_0x3a8b6e),_0x569b31=generateMutationsFromPivotCommand(_0x47872c,_0x2c418c),{undos:_0x28ffaf,redos:_0x22a367}=applyChangeSet(_0x56d96d,{'pivotTableId':_0x4ce262,'unitId':_0xfe9d8d,'subUnitId':_0x2820d2},_0x20810e);return _0x2be37a&&(_0x22a367[_0x4a473e(0x440)]({'id':AddGroupCollectionMutation['id'],'params':{'pivotTableId':_0x4ce262,'fieldJSON':_0x2be37a,'unitId':_0xfe9d8d,'subUnitId':_0x2820d2}}),_0x28ffaf[_0x4a473e(0x154)]({'id':RemoveGroupCollectionMutation['id'],'params':{'pivotTableId':_0x4ce262,'dataFieldId':_0x2be37a['id'],'unitId':_0xfe9d8d,'subUnitId':_0x2820d2}})),(0x0,_univerjs_core[_0x4a473e(0x29f)])([..._0x380253[_0x4a473e(0x35c)],..._0x569b31['redos'],..._0x22a367],_0x56d96d),_0x458c17[_0x4a473e(0x27a)]({'unitID':_0xfe9d8d,'redoMutations':[..._0x380253[_0x4a473e(0x35c)],..._0x569b31[_0x4a473e(0x35c)],..._0x22a367],'undoMutations':[..._0x380253[_0x4a473e(0x2a2)],..._0x569b31[_0x4a473e(0x2a2)],..._0x28ffaf]}),!![];}},isNodeEnv=()=>{const _0x4fc719=_0x5b3260;return typeof process!==_0x4fc719(0x31b)&&process[_0x4fc719(0x228)]!=null&&process['versions'][_0x4fc719(0x38d)]!=null;},AddPivotTableMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':_0x5b3260(0x270),'handler'(_0x4cc1b9,_0x453145){const _0x488625=_0x5b3260;if(!_0x453145)return![];const _0x388214=_0x4cc1b9[_0x488625(0x3e5)](_univerjs_core[_0x488625(0x295)]);if(Boolean(_0x388214[_0x488625(0x2fe)](_0x488625(0x20d))))return!![];const _0x430ed9=_0x4cc1b9[_0x488625(0x3e5)](_univerjs_core[_0x488625(0x13e)]),_0x539699=_0x4cc1b9[_0x488625(0x3e5)](SheetsPivotDataSourceModel),{pivotTableId:_0x59eb11,pivotTableConfig:_0x2e04b8,collectionConfig:_0x1a7ab1,unitId:_0x45089f,subUnitId:_0x25c046}=_0x453145,{sourceRangeInfo:_0x2c901a,fieldsConfig:_0x3b4e81,targetCellInfo:_0x2039e2}=_0x2e04b8,_0x320979=_0x430ed9[_0x488625(0x1cf)](_0x45089f);if(!_0x320979)return![];if(!_0x320979[_0x488625(0x26d)](_0x25c046))return![];if(!isNodeEnv()){var _0x50b413;let _0xccd260=0x0;_0x320979[_0x488625(0x312)]()[_0x488625(0x21b)](_0x1480e0=>{const _0x6f5dc5=_0x488625;var _0x5c1083,_0x42a280;_0xccd260+=(_0x5c1083=(_0x42a280=_0x539699[_0x6f5dc5(0x3b3)](_0x45089f,_0x1480e0['getSheetId']()))===null||_0x42a280===void 0x0?void 0x0:_0x42a280['size'])!==null&&_0x5c1083!==void 0x0?_0x5c1083:0x0;});const {ls:_0x1e50e0,pbk:_0x21591b}=(_0x50b413=_0x388214[_0x488625(0x2fe)](_univerjs_pro_license['LS_CONFIG_KEY']))!==null&&_0x50b413!==void 0x0?_0x50b413:{};if(!canUsePivot(_0x1e50e0,_0x21591b))throw new _univerjs_core[(_0x488625(0x2cd))](_0x488625(0x3b2));const _0x5d466d=getPivotInfoByLicense(0x1,_0x1e50e0,_0x21591b)['count'];if(_0xccd260>=_0x5d466d)throw new _univerjs_core[(_0x488625(0x2cd))](_0x488625(0x3b2));}if(!_0x1a7ab1||!_0x3b4e81)return![];const {collection:_0x4b09c5,updateDataFieldList:_0x9d9331}=_0x539699[_0x488625(0x3e2)](_0x59eb11,_0x1a7ab1,_0x2c901a,_0x2039e2);_0x539699[_0x488625(0x342)](_0x4b09c5,_0x9d9331,_0x2c901a);const _0x11f0d3=new _univerjs_pro_engine_pivot[(_0x488625(0x404))](_0x4b09c5,void 0x0,_0x59eb11);_0x11f0d3[_0x488625(0x283)](_0x3b4e81);const _0x47a905=JSON[_0x488625(0x2c3)](JSON[_0x488625(0x1bd)](_0x2e04b8));return _0x539699[_0x488625(0x29a)](_0x45089f,_0x25c046,_0x59eb11,_0x11f0d3,_0x47a905),_0x539699['addDirtyPivotTable']({'unitId':_0x45089f,'subUnitId':_0x25c046,'token':_0x59eb11,'type':PivotTableOperationEnum[_0x488625(0x347)],'pivotConfig':_0x47a905}),!![];}},AddPivotTableWithConfigCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x238),async 'handler'(_0x1ef5af,_0x2f9982){const _0x53d847=_0x5b3260;if(!_0x2f9982)return![];const {sourceDataInfo:_0x4964b2,pivotTableConfig:_0x1e4140}=_0x2f9982;if(!_0x4964b2||!_0x1e4140)return![];const {unitId:_0x7fd9e9,subUnitId:_0x3f0a04,range:_0x11f05f}=_0x4964b2,_0x5f2abd=_0x1ef5af[_0x53d847(0x3e5)](_univerjs_core[_0x53d847(0x13e)]),_0x3f9e85=_0x1ef5af['get'](SheetsPivotRPCService),_0x46b686=_0x1ef5af[_0x53d847(0x3e5)](_univerjs_core[_0x53d847(0x13b)]),_0x1d7b60=_0x1ef5af['get'](_univerjs_core[_0x53d847(0x151)]),_0x21133d=_0x5f2abd[_0x53d847(0x1cf)](_0x7fd9e9);if(!_0x21133d)return![];const _0x47b504=_0x21133d[_0x53d847(0x26d)](_0x3f0a04);if(!_0x47b504)return![];const _0x12e661=(0x0,_univerjs_pro_engine_pivot[_0x53d847(0x16e)])(0x8),_0x1625bc=_0x11f05f||{'startRow':0x0,'startColumn':0x0,'endRow':_0x47b504['getRowCount']()-0x1,'endColumn':_0x47b504[_0x53d847(0x2ab)]()-0x1};_0x1625bc[_0x53d847(0x1d5)]=_univerjs_core[_0x53d847(0x284)]['NORMAL'];const _0x9710ff=(await _0x3f9e85[_0x53d847(0x235)]({'unitId':_0x7fd9e9,'subUnitId':_0x3f0a04,'pivotTableId':_0x12e661,'params':{'type':PivotDisplayDataType[_0x53d847(0x253)],'addPivotTableWithConfig':{'sourceRangeInfo':{'unitId':_0x7fd9e9,'sheetName':_0x47b504[_0x53d847(0x1c2)](),'subUnitId':_0x3f0a04,'range':_0x1625bc},'pivotTableId':_0x12e661,'pivotTableIndexConfig':_0x1e4140}}}))[_0x53d847(0x21e)][_0x53d847(0x26c)];if(!_0x9710ff)return![];const {isEmpty:_0x5cebd3,fieldsConfig:_0x4f29f1,collectionConfig:_0x3e8e1f,changesets:_0x3016d7}=_0x9710ff,_0x103c90=_0x21133d[_0x53d847(0x312)]()[_0x53d847(0x2b9)],_0x101e21=(0x0,_univerjs_core[_0x53d847(0x256)])({'rowCount':_0x47b504[_0x53d847(0x427)]()-0x1,'columnCount':_0x47b504['getColumnCount']()-0x1});_0x101e21['id']=(0x0,_univerjs_core[_0x53d847(0x1fb)])(),_0x101e21[_0x53d847(0x349)]=_0x21133d[_0x53d847(0x1ea)](''+_0x46b686['t'](_0x53d847(0x3eb)));const _0x170e25={'index':_0x103c90,'sheet':_0x101e21,'unitId':_0x7fd9e9},{redos:_0x5c3459}=applyChangeSet(_0x1d7b60,{'pivotTableId':_0x12e661,'unitId':_0x7fd9e9,'subUnitId':_0x101e21['id']},_0x3016d7);return(0x0,_univerjs_core[_0x53d847(0x29f)])([{'id':_univerjs_sheets['InsertSheetCommand']['id'],'params':_0x170e25},{'id':AddPivotTableMutation['id'],'params':{'unitId':_0x7fd9e9,'subUnitId':_0x101e21['id'],'pivotTableId':_0x12e661,'pivotTableConfig':{'isEmpty':_0x5cebd3,'fieldsConfig':_0x4f29f1,'targetCellInfo':{'row':0x0,'col':0x0,'unitId':_0x7fd9e9,'subUnitId':_0x101e21['id']},'sourceRangeInfo':{'subUnitId':_0x3f0a04,'unitId':_0x7fd9e9,'range':_0x1625bc,'sheetName':_0x47b504[_0x53d847(0x1c2)]()}},'collectionConfig':_0x3e8e1f}},..._0x5c3459],_0x1d7b60),!![];}},RemovePivotTableMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x207),'handler'(_0x1460db,_0x4185a9){const _0x3d7f3d=_0x5b3260;if(!_0x4185a9)return![];const _0x23291e=_0x1460db[_0x3d7f3d(0x3e5)](_univerjs_core[_0x3d7f3d(0x295)]);if(Boolean(_0x23291e['getConfig']('SHEET_PIVOT_IN_MAIN_THREAD')))return!![];const {pivotTableId:_0x88221e,unitId:_0x52cc73,subUnitId:_0x2e6759}=_0x4185a9,_0x2e5923=_0x1460db[_0x3d7f3d(0x3e5)](SheetsPivotDataSourceModel);if(!_0x2e5923['getPivotTableConfig'](_0x52cc73,_0x2e6759,_0x88221e))return![];return _0x2e5923['addDirtyPivotTable']({'unitId':_0x52cc73,'subUnitId':_0x2e6759,'token':_0x88221e,'type':PivotTableOperationEnum['Delete']}),_0x2e5923['removePivotTable'](_0x52cc73,_0x2e6759,_0x88221e),!![];}},AddPivotTableCommand={'type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'id':'sheet.command.add-pivot-table',async 'handler'(_0x8951a7,_0x340126){const _0x4982d6=_0x5b3260;var _0x2ed54f;const _0xde642f=_0x8951a7['get'](_univerjs_core[_0x4982d6(0x151)]),_0x556749=_0x8951a7[_0x4982d6(0x3e5)](_univerjs_core[_0x4982d6(0x13e)]),_0xf6b7c1=_0x8951a7['get'](_univerjs_core[_0x4982d6(0x13b)]),_0x405370=_0x8951a7[_0x4982d6(0x3e5)](SheetsPivotRPCService),_0x32c2aa=_0x8951a7[_0x4982d6(0x3e5)](_univerjs_core['IUndoRedoService']),_0x1f5a3a=_0x8951a7[_0x4982d6(0x3e5)](SheetsPivotTableConfigModel),_0x1c40d7=_0x8951a7[_0x4982d6(0x3e5)](_univerjs_core[_0x4982d6(0x295)]);if(!_0x340126)return![];const {pivotTableConfig:_0x227b3b,positionType:_0x17c01b}=_0x340126,{targetCellInfo:_0x2109d3,sourceRangeInfo:_0x2a5d8f}=_0x227b3b,{unitId:_0x517fe7,subUnitId:_0x4bdac7}=_0x2109d3,_0x2f841a=_0x556749['getUnit'](_0x517fe7);if(!_0x2f841a)return![];let _0x16bb5c=0x0;_0x2f841a[_0x4982d6(0x312)]()[_0x4982d6(0x21b)](_0xaf9362=>{const _0x2b7b2d=_0x4982d6;var _0x5a4943,_0x10445f;_0x16bb5c+=(_0x5a4943=(_0x10445f=_0x1f5a3a[_0x2b7b2d(0x3b3)](_0x517fe7,_0xaf9362['getSheetId']()))===null||_0x10445f===void 0x0?void 0x0:_0x10445f[_0x2b7b2d(0x275)])!==null&&_0x5a4943!==void 0x0?_0x5a4943:0x0;});const {ls:_0x5f1a02,pbk:_0x278048}=(_0x2ed54f=_0x1c40d7['getConfig'](_univerjs_pro_license[_0x4982d6(0x1a6)]))!==null&&_0x2ed54f!==void 0x0?_0x2ed54f:{};if(!canUsePivot(_0x5f1a02,_0x278048))return![];const _0x386da1=getPivotInfoByLicense(0x1,_0x5f1a02,_0x278048)[_0x4982d6(0x331)];if(_0x16bb5c>=_0x386da1)return![];const _0x20d56f=_0x340126['pivotTableId']||(0x0,_univerjs_pro_engine_pivot['generateHexNumber'])(0x8),_0x28bcc1=(await _0x405370['getPivotDisplayConfig']({'unitId':_0x517fe7,'subUnitId':_0x4bdac7,'pivotTableId':_0x20d56f,'params':{'type':PivotDisplayDataType[_0x4982d6(0x2ed)],'addPivotTable':{'sourceRangeInfo':_0x2a5d8f,'pivotTableId':_0x20d56f}}}))[_0x4982d6(0x21e)][_0x4982d6(0x29a)];if(!_0x28bcc1)return![];const {view:_0x433ffc,isEmpty:_0x38d1bf,fieldsConfig:_0xad562b,collectionConfig:_0x3ea8f8}=_0x28bcc1,_0xda5f29=[],_0x3a8e7f=[];if(_0x17c01b===PositionType[_0x4982d6(0x436)]){var _0x1ddf08;const _0x33e7fd=_0x2f841a[_0x4982d6(0x312)]()[_0x4982d6(0x2b9)],_0x23b15e=(0x0,_univerjs_core[_0x4982d6(0x256)])({});_0x23b15e['id']=_0x227b3b['targetCellInfo'][_0x4982d6(0x2a1)],_0x23b15e[_0x4982d6(0x349)]=(_0x1ddf08=_0x227b3b[_0x4982d6(0x226)]['sheetName'])!==null&&_0x1ddf08!==void 0x0?_0x1ddf08:_0x2f841a['generateNewSheetName'](''+_0xf6b7c1['t'](_0x4982d6(0x3eb)));const _0x53b400={'index':_0x33e7fd,'sheet':_0x23b15e,'unitId':_0x517fe7},_0x4e6b8e=(0x0,_univerjs_sheets[_0x4982d6(0x23a)])(_0x8951a7,_0x53b400);_0xda5f29[_0x4982d6(0x154)]({'id':_univerjs_sheets[_0x4982d6(0x186)]['id'],'params':_0x4e6b8e}),_0x3a8e7f['push']({'id':_univerjs_sheets[_0x4982d6(0x3f2)]['id'],'params':_0x53b400});}else{if(!_0x2f841a[_0x4982d6(0x26d)](_0x4bdac7))return![];const _0xf58bf3=getInsertRowColMutations(_0x8951a7,new _univerjs_pro_engine_pivot['PivotView'](),_0x2109d3,!![]);_0x3a8e7f[_0x4982d6(0x154)](..._0xf58bf3[_0x4982d6(0x35c)]),_0xda5f29[_0x4982d6(0x154)](..._0xf58bf3[_0x4982d6(0x2a2)]);const _0x4a81ec={'cellInfo':_0x2109d3,'view':_0x433ffc,'isEmpty':_0x38d1bf};if(!await _0x8951a7[_0x4982d6(0x3e5)](SheetsPivotTableService)[_0x4982d6(0x273)][_0x4982d6(0x1a1)](PIVOT_PERFORM_CHECK)(!![],_0x4a81ec))return![];const _0x1856d0=generateMutationsFromPivotCommand(_0x8951a7,_0x4a81ec);_0x3a8e7f[_0x4982d6(0x154)](..._0x1856d0[_0x4982d6(0x35c)]),_0xda5f29[_0x4982d6(0x154)](..._0x1856d0[_0x4982d6(0x2a2)]);}_0x3a8e7f[_0x4982d6(0x154)]({'id':AddPivotTableMutation['id'],'params':{'unitId':_0x2109d3[_0x4982d6(0x30d)],'subUnitId':_0x2109d3[_0x4982d6(0x2a1)],'pivotTableId':_0x20d56f,'pivotTableConfig':{'targetCellInfo':_0x2109d3,'sourceRangeInfo':_0x2a5d8f,'fieldsConfig':_0xad562b},'collectionConfig':_0x3ea8f8}}),_0xda5f29[_0x4982d6(0x440)]({'id':RemovePivotTableMutation['id'],'params':{'unitId':_0x517fe7,'subUnitId':_0x4bdac7,'pivotTableId':_0x20d56f}});if((0x0,_univerjs_core['sequenceExecute'])(_0x3a8e7f,_0xde642f))_0x32c2aa[_0x4982d6(0x27a)]({'unitID':_0x517fe7,'undoMutations':_0xda5f29,'redoMutations':_0x3a8e7f});return!![];}},MovePivotFieldCommand={'type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'id':_0x5b3260(0x1d2),async 'handler'(_0x187a9f,_0x564df0){const _0x1871d5=_0x5b3260;if(!_0x564df0)return![];const _0x41650a=_0x187a9f[_0x1871d5(0x3e5)](_univerjs_core[_0x1871d5(0x151)]),_0x1e72fe=_0x187a9f['get'](SheetsPivotRPCService),_0x2bfdbe=_0x187a9f[_0x1871d5(0x3e5)](_univerjs_core[_0x1871d5(0x2bf)]),{pivotTableId:_0x5d0feb,fieldId:_0xfd7616,area:_0x120d6e,index:_0xe79e10,unitId:_0x50165a,subUnitId:_0x383fcd}=_0x564df0,_0x580b61=(await _0x1e72fe['getPivotDisplayConfig']({'unitId':_0x50165a,'subUnitId':_0x383fcd,'pivotTableId':_0x5d0feb,'params':{'type':PivotDisplayDataType[_0x1871d5(0x3c4)],'movePivotField':{'fieldId':_0xfd7616,'area':_0x120d6e,'index':_0xe79e10}}}))[_0x1871d5(0x21e)][_0x1871d5(0x409)];if(!_0x580b61)return![];const {changesets:_0xb3d321,view:_0x32911d,isEmpty:_0x3c9a7b,pivotTableConfig:_0x269804}=_0x580b61,_0x1a333a=_0x269804[_0x1871d5(0x226)],_0x5944e5=new _univerjs_pro_engine_pivot[(_0x1871d5(0x3ce))]();_0x5944e5[_0x1871d5(0x3db)](_0x32911d);const _0x4cfd14={'cellInfo':_0x1a333a,'view':_0x5944e5,'isEmpty':_0x3c9a7b};if(!await _0x187a9f[_0x1871d5(0x3e5)](SheetsPivotTableService)['asyncInterceptor'][_0x1871d5(0x1a1)](PIVOT_PERFORM_CHECK)(!![],_0x4cfd14))return![];const _0x3576fc=getInsertRowColMutations(_0x187a9f,_0x5944e5,_0x1a333a,_0x3c9a7b),_0x9661e2=generateMutationsFromPivotCommand(_0x187a9f,_0x4cfd14),{redos:_0x31934,undos:_0x1dc774}=applyChangeSet(_0x41650a,{'pivotTableId':_0x5d0feb,'unitId':_0x50165a,'subUnitId':_0x383fcd},_0xb3d321);return(0x0,_univerjs_core[_0x1871d5(0x29f)])([..._0x3576fc[_0x1871d5(0x35c)],..._0x9661e2[_0x1871d5(0x35c)],..._0x31934],_0x41650a),_0x2bfdbe['pushUndoRedo']({'unitID':_0x50165a,'redoMutations':[..._0x3576fc['redos'],..._0x9661e2['redos'],..._0x31934],'undoMutations':[..._0x3576fc[_0x1871d5(0x2a2)],..._0x9661e2[_0x1871d5(0x2a2)],..._0x1dc774]}),!![];}},SetPivotPositionMutation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':'sheet.mutation.set-pivot-position','handler'(_0x21e4d6,_0x373cb6){const _0x59732c=_0x5b3260;if(!_0x373cb6)return![];const _0x105245=_0x21e4d6[_0x59732c(0x3e5)](_univerjs_core[_0x59732c(0x295)]);if(Boolean(_0x105245[_0x59732c(0x2fe)](_0x59732c(0x20d))))return!![];const {pivotTableId:_0x29913c,targetCellPosition:_0x321a42,unitId:_0x4ae942,subUnitId:_0x38bfe0}=_0x373cb6,_0x1a3d6d=_0x21e4d6[_0x59732c(0x3e5)](SheetsPivotDataSourceModel);if(!_0x1a3d6d['getPivotTableInstance'](_0x373cb6[_0x59732c(0x1e1)]))return![];const _0x26b167=_0x1a3d6d[_0x59732c(0x2d6)](_0x29913c);if(!_0x26b167)return![];const _0x57530e=_0x1a3d6d[_0x59732c(0x329)](_0x26b167[_0x59732c(0x30d)],_0x373cb6[_0x59732c(0x1e1)]);if(!_0x57530e)return![];const _0x29088c=_0x1a3d6d[_0x59732c(0x32a)](_0x26b167[_0x59732c(0x30d)],_0x26b167[_0x59732c(0x2a1)],_0x29913c);if(!_0x29088c)return![];const _0x488c9e=_univerjs_core[_0x59732c(0x40e)]['deepClone'](_0x29088c);_0x488c9e[_0x59732c(0x226)]={'unitId':_0x4ae942,'subUnitId':_0x38bfe0,'row':_0x321a42[_0x59732c(0x1c0)],'col':_0x321a42['col']};const _0x5ad6df=_0x57530e[_0x59732c(0x1d4)]();if(_0x26b167['subUnitId']===_0x38bfe0&&_0x26b167[_0x59732c(0x30d)]===_0x4ae942)_0x1a3d6d[_0x59732c(0x167)](_0x4ae942,_0x38bfe0,_0x29913c,_0x488c9e),_0x1a3d6d[_0x59732c(0x1c8)]({'unitId':_0x4ae942,'subUnitId':_0x38bfe0,'token':_0x29913c,'type':PivotTableOperationEnum[_0x59732c(0x178)]});else{_0x1a3d6d[_0x59732c(0x1c8)]({'unitId':_0x26b167[_0x59732c(0x30d)],'subUnitId':_0x26b167[_0x59732c(0x2a1)],'token':_0x29913c,'type':PivotTableOperationEnum[_0x59732c(0x153)]}),_0x1a3d6d[_0x59732c(0x133)](_0x26b167[_0x59732c(0x30d)],_0x26b167[_0x59732c(0x2a1)],_0x29913c);const _0x3bd7ee=new _univerjs_pro_engine_pivot[(_0x59732c(0x404))](_0x1a3d6d['addCollectionByJSON'](_0x29913c,_0x5ad6df,_0x29088c[_0x59732c(0x3d4)],_0x488c9e[_0x59732c(0x226)])[_0x59732c(0x274)],void 0x0,_0x29913c);_0x3bd7ee['fromJSON'](_0x488c9e[_0x59732c(0x170)]),_0x1a3d6d[_0x59732c(0x29a)](_0x4ae942,_0x38bfe0,_0x29913c,_0x3bd7ee,_0x488c9e),_0x1a3d6d[_0x59732c(0x1c8)]({'unitId':_0x4ae942,'subUnitId':_0x38bfe0,'token':_0x29913c,'type':PivotTableOperationEnum[_0x59732c(0x347)],'pivotConfig':_0x488c9e});}return!![];}},MovePivotTableCommand={'type':_univerjs_core[_0x5b3260(0x289)]['COMMAND'],'id':_0x5b3260(0x229),'handler':(_0x307df5,_0xb2ce13)=>{const _0x8ba932=_0x5b3260;if(!_0xb2ce13)return![];const _0x39c5a4=(0x0,_univerjs_sheets['getSheetCommandTarget'])(_0x307df5[_0x8ba932(0x3e5)](_univerjs_core[_0x8ba932(0x13e)]),{'unitId':_0xb2ce13[_0x8ba932(0x226)][_0x8ba932(0x30d)],'subUnitId':_0xb2ce13[_0x8ba932(0x226)][_0x8ba932(0x2a1)]});if(!_0x39c5a4)throw new Error(_0x8ba932(0x25e));const _0x48fb2f=_0x307df5[_0x8ba932(0x3e5)](SheetsPivotTableConfigModel)[_0x8ba932(0x32a)](_0xb2ce13[_0x8ba932(0x3f0)][_0x8ba932(0x30d)],_0xb2ce13['originTargetInfo'][_0x8ba932(0x2a1)],_0xb2ce13[_0x8ba932(0x1e1)]);if(!_0x48fb2f)return![];const _0x53c5c4=_0x307df5[_0x8ba932(0x3e5)](_univerjs_core['ICommandService']),_0x3621d9=_0x307df5['get'](_univerjs_core[_0x8ba932(0x2bf)]),{unitId:_0x1186c4,subUnitId:_0x31e5c3,worksheet:_0x593447}=_0x39c5a4,_0x1dbe5c=_0x593447[_0x8ba932(0x427)](),_0x2aeed0=_0x593447[_0x8ba932(0x2ab)]();if(_0xb2ce13['targetCellInfo'][_0x8ba932(0x1c0)]>_0x1dbe5c||_0xb2ce13[_0x8ba932(0x226)]['col']>_0x2aeed0)throw new Error(_0x8ba932(0x2b7));const _0xbafb3c=[{'id':SetPivotPositionMutation['id'],'params':{'unitId':_0x1186c4,'subUnitId':_0xb2ce13[_0x8ba932(0x226)][_0x8ba932(0x2a1)],'pivotTableId':_0xb2ce13[_0x8ba932(0x1e1)],'targetCellPosition':{'row':_0xb2ce13['targetCellInfo'][_0x8ba932(0x1c0)],'col':_0xb2ce13[_0x8ba932(0x226)][_0x8ba932(0x1c6)]}}}],_0x4a858d=[{'id':SetPivotPositionMutation['id'],'params':{'unitId':_0x1186c4,'subUnitId':_0x31e5c3,'pivotTableId':_0xb2ce13[_0x8ba932(0x1e1)],'targetCellPosition':{'row':_0x48fb2f[_0x8ba932(0x226)]['row'],'col':_0x48fb2f[_0x8ba932(0x226)][_0x8ba932(0x1c6)]}}}];if((0x0,_univerjs_core[_0x8ba932(0x29f)])(_0xbafb3c,_0x53c5c4))_0x3621d9[_0x8ba932(0x27a)]({'unitID':_0x1186c4,'undoMutations':_0x4a858d,'redoMutations':_0xbafb3c});return!![];}},PivotDrillDownCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x418),async 'handler'(_0x513347,_0x142081){const _0x1b864e=_0x5b3260;var _0xd03a86;if(!_0x142081)return![];const _0x4b0d09=_0x513347['get'](_univerjs_core[_0x1b864e(0x13e)]),_0x1d629f=(0x0,_univerjs_sheets['getSheetCommandTarget'])(_0x4b0d09);if(!_0x1d629f)return![];const {unitId:_0x18d08c,subUnitId:_0x2552c4,workbook:_0x56f49c}=_0x1d629f,{row:_0x2549c3,col:_0x967b68}=_0x142081,_0x4c75a7=_0x513347['get'](SheetsPivotTableAdaptorModel),_0x3ab7fb=_0x4c75a7[_0x1b864e(0x38b)](_0x18d08c,_0x2552c4,_0x2549c3,_0x967b68);if(!_0x3ab7fb)return![];const _0x25e0aa=(_0xd03a86=_0x4c75a7[_0x1b864e(0x402)](_0x18d08c,_0x2552c4,_0x3ab7fb))===null||_0xd03a86===void 0x0?void 0x0:_0xd03a86[_0x1b864e(0x432)];if(!_0x25e0aa)return![];const _0x31aefe=_0x513347['get'](SheetsPivotTableConfigModel)[_0x1b864e(0x32a)](_0x18d08c,_0x2552c4,_0x3ab7fb);if(!_0x31aefe)return![];const {rowInfo:_0x768f75,colInfo:_0x4c19db}=_0x25e0aa,_0x58bf60=_0x768f75[_0x2549c3][_0x1b864e(0x2f6)],_0x179681=_0x4c19db[_0x967b68][_0x1b864e(0x2f6)],_0x49f043=_0x768f75[_0x2549c3][_0x1b864e(0x2dc)],_0x37d940=_0x4c19db[_0x967b68]['level'],_0x2e19da=_0x58bf60[_0x1b864e(0x3fc)](_0x179681),_0x17691d=_0x31aefe['fieldsConfig'][_0x1b864e(0x208)]['slice'](0x0,_0x49f043),_0x4a0db2=_0x31aefe['fieldsConfig']['columnFields'][_0x1b864e(0x2c0)](0x0,_0x37d940),_0x11cf50=_0x17691d[_0x1b864e(0x3fc)](_0x4a0db2),_0x58ed45=_0x2e19da['map']((_0x575424,_0x383abe)=>[_0x575424,_0x11cf50[_0x383abe]]),_0x3789e2=(await _0x513347[_0x1b864e(0x3e5)](SheetsPivotRPCService)['getPivotDisplayConfig']({'unitId':_0x18d08c,'subUnitId':_0x2552c4,'pivotTableId':_0x3ab7fb,'params':{'type':PivotDisplayDataType[_0x1b864e(0x221)],'drillDown':{'tuple':_0x58ed45}}}))[_0x1b864e(0x21e)]['drillDown'];if(!_0x3789e2)return![];const {indexes:_0x2fb86d,range:_0x294b44,sourceUnitId:_0x4dad73,sourceSubUnitId:_0x257f4b,formatMap:_0x2fdf91}=_0x3789e2,{startRow:_0x28d63f,endRow:_0x4a30bb,startColumn:_0x385abc,endColumn:_0x6cd8f7}=_0x294b44,_0x5e9862=new _univerjs_core[(_0x1b864e(0x1e5))](),_0x115962=_0x4a30bb-_0x28d63f,_0x58dfbc=_0x6cd8f7-_0x385abc,_0x9e07ec={},_0x2fbcd7=(0x0,_univerjs_sheets[_0x1b864e(0x2f9)])(_0x4b0d09,{'unitId':_0x4dad73,'subUnitId':_0x257f4b});if(!_0x2fbcd7)return![];const _0x39b478=defaultThemeStyle[_0x1b864e(0x209)],_0xc20591=defaultThemeStyle['subTotalStyle'],_0x45154=defaultThemeStyle[_0x1b864e(0x305)],_0x19245e=_0x56f49c['getStyles']()['setValue'](_0x39b478),_0x4ab702=_0x56f49c[_0x1b864e(0x3a1)]()[_0x1b864e(0x333)](_0xc20591),_0x51cb91=_0x56f49c['getStyles']()[_0x1b864e(0x333)](_0x45154),{worksheet:_0x185dfd}=_0x2fbcd7;let _0x43fbee=0x0;const _0x2eeaa3=0x1;_0x2fb86d[_0x1b864e(0x21b)](_0x50ba60=>{const _0x365375=_0x1b864e;for(let _0x4713c3=0x0;_0x4713c3<=_0x6cd8f7-_0x385abc;_0x4713c3++)_0x5e9862['setValue'](_0x43fbee,_0x4713c3,_0x185dfd[_0x365375(0x416)](_0x50ba60+_0x294b44[_0x365375(0x401)]+_0x2eeaa3,_0x4713c3));_0x43fbee++;});for(let _0x1f7db6=_0x385abc;_0x1f7db6<=_0x6cd8f7;_0x1f7db6++){const _0x216104=_0x185dfd['getCellRaw'](_0x28d63f,_0x1f7db6);if(!_0x9e07ec[_0x28d63f])_0x9e07ec[_0x28d63f]={};_0x9e07ec[_0x28d63f][_0x1f7db6]={..._0x216104,'s':_0x19245e};}let _0x51c4d7=0x1;const _0x57c567={},_0x5b9a94={};_0x5e9862['forRow']((_0x4a70de,_0x5551b1)=>{_0x5551b1['forEach'](_0x2051fc=>{const _0x157d6c=_0x216b,_0x33a6a1=_0x5e9862[_0x157d6c(0x323)](_0x4a70de,_0x2051fc);if(!_0x9e07ec[_0x51c4d7])_0x9e07ec[_0x51c4d7]={};_0x9e07ec[_0x51c4d7][_0x2051fc]={..._0x33a6a1,'s':_0x51c4d7%0x2===0x0?_0x51cb91:_0x4ab702};if(_0x2fdf91[_0x2051fc]&&_0x4a70de>=0x0){const _0x52449c=_0x51c4d7%0x2===0x0;let _0x3c9481=_0x52449c?_0x5b9a94[_0x2051fc]:_0x57c567[_0x2051fc];if(!_0x3c9481){_0x3c9481=_0x56f49c[_0x157d6c(0x3a1)]()[_0x157d6c(0x333)]({..._0x52449c?_0x45154:_0xc20591,'n':{'pattern':_0x2fdf91[_0x2051fc]}});if(_0x52449c)_0x5b9a94[_0x2051fc]=_0x3c9481;else _0x57c567[_0x2051fc]=_0x3c9481;}_0x9e07ec[_0x51c4d7][_0x2051fc]['s']=_0x3c9481;}}),_0x51c4d7++;});const _0x3de4f6=new _univerjs_core[(_0x1b864e(0x1e5))](_0x9e07ec),_0x57224a={};_0x3de4f6[_0x1b864e(0x1eb)]((_0x1e9373,_0x5b4aed,_0x31d38d)=>{if(!_0x57224a[_0x1e9373])_0x57224a[_0x1e9373]={};_0x57224a[_0x1e9373][_0x5b4aed]={'s':null,'f':null,'si':null,'p':null,'v':null,'t':null,'custom':null};});const _0x3ed3b0=[],_0xee9d69=[],_0x389561=_0x56f49c['getSheets']()[_0x1b864e(0x2b9)],_0x3deeb5=(0x0,_univerjs_core[_0x1b864e(0x256)])({'rowCount':Math[_0x1b864e(0x18b)](_univerjs_core[_0x1b864e(0x19f)],_0x115962+0xa),'columnCount':Math[_0x1b864e(0x18b)](_univerjs_core[_0x1b864e(0x336)],_0x58dfbc+0x5)}),_0x1a0f63=_0x513347[_0x1b864e(0x3e5)](_univerjs_core['LocaleService']);_0x3deeb5['id']=(0x0,_univerjs_core[_0x1b864e(0x1fb)])(),_0x3deeb5[_0x1b864e(0x349)]=_0x56f49c[_0x1b864e(0x1ea)](''+_0x1a0f63['t'](_0x1b864e(0x3eb)));const _0x1ca591={'index':_0x389561,'sheet':_0x3deeb5,'unitId':_0x18d08c},_0x3b770d=(0x0,_univerjs_sheets[_0x1b864e(0x23a)])(_0x513347,_0x1ca591);_0xee9d69[_0x1b864e(0x154)]({'id':_univerjs_sheets[_0x1b864e(0x3f2)]['id'],'params':_0x1ca591}),_0x3ed3b0[_0x1b864e(0x154)]({'id':_univerjs_sheets[_0x1b864e(0x186)]['id'],'params':_0x3b770d}),_0xee9d69['push']({'id':_univerjs_sheets[_0x1b864e(0x31c)]['id'],'params':{'unitId':_0x18d08c,'subUnitId':_0x3deeb5['id'],'cellValue':_0x9e07ec}}),_0x3ed3b0[_0x1b864e(0x440)]({'id':_univerjs_sheets[_0x1b864e(0x31c)]['id'],'params':{'unitId':_0x18d08c,'subUnitId':_0x3deeb5['id'],'cellValue':_0x57224a}});const _0x3c0f49={'startRow':0x0,'startColumn':0x0,'endRow':_0x51c4d7-0x1,'endColumn':_0x6cd8f7};_0xee9d69[_0x1b864e(0x154)]({'id':_univerjs_sheets_filter[_0x1b864e(0x433)]['id'],'params':{'unitId':_0x18d08c,'subUnitId':_0x3deeb5['id'],'range':_0x3c0f49}}),_0x3ed3b0[_0x1b864e(0x440)]({'id':_univerjs_sheets_filter[_0x1b864e(0x231)]['id'],'params':{'unitId':_0x18d08c,'subUnitId':_0x3deeb5['id']}});if((0x0,_univerjs_core[_0x1b864e(0x29f)])(_0xee9d69,_0x513347[_0x1b864e(0x3e5)](_univerjs_core['ICommandService'])))_0x513347[_0x1b864e(0x3e5)](_univerjs_core[_0x1b864e(0x2bf)])[_0x1b864e(0x27a)]({'unitID':_0x18d08c,'undoMutations':_0x3ed3b0,'redoMutations':_0xee9d69});return!![];}},RemovePivotFieldCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x344),async 'handler'(_0x25e5c5,_0x11cfd0){const _0x1dd498=_0x5b3260;if(!_0x11cfd0)return![];const _0x17c3fd=_0x25e5c5[_0x1dd498(0x3e5)](_univerjs_core[_0x1dd498(0x151)]),_0x523e96=_0x25e5c5['get'](SheetsPivotRPCService),_0x4327ac=_0x25e5c5[_0x1dd498(0x3e5)](_univerjs_core[_0x1dd498(0x2bf)]),{pivotTableId:_0x386d0e,fieldIds:_0x34e902,unitId:_0x154239,subUnitId:_0x53f1dd}=_0x11cfd0,_0x14018c=(await _0x523e96[_0x1dd498(0x235)]({'unitId':_0x154239,'subUnitId':_0x53f1dd,'pivotTableId':_0x386d0e,'params':{'type':PivotDisplayDataType[_0x1dd498(0x15a)],'removePivotField':{'fieldIds':_0x34e902}}}))[_0x1dd498(0x21e)][_0x1dd498(0x3da)];if(!_0x14018c)return![];const {view:_0x4318f1,changesets:_0x5dc1a2,isEmpty:_0x55e3e6,pivotTableConfig:_0x22f3c4}=_0x14018c,_0x18f3dd=_0x22f3c4[_0x1dd498(0x226)],_0x4600c5=new _univerjs_pro_engine_pivot['PivotView']();_0x4600c5[_0x1dd498(0x3db)](_0x4318f1);const _0x36a01e={'cellInfo':_0x18f3dd,'view':_0x4600c5,'isEmpty':_0x55e3e6};if(!await _0x25e5c5['get'](SheetsPivotTableService)[_0x1dd498(0x273)]['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0x36a01e))return![];const _0x341c43=getInsertRowColMutations(_0x25e5c5,_0x4600c5,_0x18f3dd,_0x55e3e6),_0x5691fb=generateMutationsFromPivotCommand(_0x25e5c5,_0x36a01e),{redos:_0x279fa9,undos:_0x246c03}=applyChangeSet(_0x17c3fd,{'pivotTableId':_0x386d0e,'unitId':_0x154239,'subUnitId':_0x53f1dd},_0x5dc1a2);return(0x0,_univerjs_core[_0x1dd498(0x29f)])([..._0x341c43[_0x1dd498(0x35c)],..._0x5691fb[_0x1dd498(0x35c)],..._0x279fa9],_0x17c3fd),_0x4327ac[_0x1dd498(0x27a)]({'unitID':_0x154239,'redoMutations':[..._0x341c43['redos'],..._0x5691fb[_0x1dd498(0x35c)],..._0x279fa9],'undoMutations':[..._0x341c43[_0x1dd498(0x2a2)],..._0x5691fb['undos'],..._0x246c03]}),!![];}},ResetPivotFieldsConfigCommand={'type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'id':_0x5b3260(0x2f2),async 'handler'(_0x3829d1,_0x392602){const _0x1c9537=_0x5b3260;if(!_0x392602)return![];const _0x2e0003=_0x3829d1['get'](_univerjs_core[_0x1c9537(0x151)]),_0x3b12e6=_0x3829d1[_0x1c9537(0x3e5)](_univerjs_core[_0x1c9537(0x2bf)]),_0x3e5121=_0x3829d1[_0x1c9537(0x3e5)](SheetsPivotRPCService),{resetArea:_0x46167f,pivotTableId:_0x449134,unitId:_0x4a6642,subUnitId:_0x3fe041}=_0x392602,_0x4d1c1c=(await _0x3e5121['getPivotDisplayConfig']({'unitId':_0x4a6642,'subUnitId':_0x3fe041,'pivotTableId':_0x449134,'params':{'type':PivotDisplayDataType[_0x1c9537(0x213)],'resetPivotTable':{'pivotTableId':_0x449134,'resetArea':_0x46167f}}}))[_0x1c9537(0x21e)][_0x1c9537(0x3de)];if(!_0x4d1c1c)return![];const {changesets:_0x1be676}=_0x4d1c1c,{redos:_0x310770,undos:_0x4ee156}=applyChangeSet(_0x2e0003,{'pivotTableId':_0x449134,'unitId':_0x4a6642,'subUnitId':_0x3fe041},_0x1be676);return(0x0,_univerjs_core['sequenceExecute'])(_0x310770,_0x2e0003),_0x3b12e6[_0x1c9537(0x27a)]({'unitID':_0x4a6642,'redoMutations':_0x310770,'undoMutations':_0x4ee156}),!![];}},SetPivotCollapseCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x2f1),async 'handler'(_0x140635,_0x9a59cf){const _0x550328=_0x5b3260,_0x8fd863=_0x140635[_0x550328(0x3e5)](_univerjs_core[_0x550328(0x151)]),_0x2b5acb=_0x140635['get'](SheetsPivotRPCService),_0x3c2299=_0x140635[_0x550328(0x3e5)](SheetsPivotTableAdaptorModel),_0x121363=_0x140635[_0x550328(0x3e5)](_univerjs_core[_0x550328(0x13e)]),_0xa8da57=_0x140635[_0x550328(0x3e5)](_univerjs_core[_0x550328(0x13b)]),_0x222420=_0x140635[_0x550328(0x3e5)](_univerjs_core['IUndoRedoService']);if(!_0x9a59cf)return![];const {unitId:_0x29393a,subUnitId:_0x1d1b7e,row:_0x30ac6c,col:_0x6f1e6d,collapse:_0x3000f4}=_0x9a59cf,_0x4893e3=_0x121363[_0x550328(0x1cf)](_0x29393a);if(!_0x4893e3)return![];if(!_0x4893e3[_0x550328(0x26d)](_0x1d1b7e))return![];const _0x16fc98=_0x3c2299[_0x550328(0x38b)](_0x29393a,_0x1d1b7e,_0x30ac6c,_0x6f1e6d);if(!_0x16fc98)return![];const _0x2da840=_0x3c2299[_0x550328(0x402)](_0x29393a,_0x1d1b7e,_0x16fc98);if(!_0x2da840)return![];const _0x170660=(0x0,_univerjs_core[_0x550328(0x318)])(_0x30ac6c,_0x6f1e6d),{rangesInfo:_0x2642bc,areaInfo:_0x23d2f3,headerMap:_0x468ff4}=_0x2da840;if(!_0x2642bc||!_0x23d2f3||!_0x468ff4)return![];const _0x51dbab=Object[_0x550328(0x2da)](_0x2642bc)[_0x550328(0x2ad)](_0x8cc9c8=>{const _0x2364e7=_0x550328;return _0x2642bc[_0x8cc9c8][_0x2364e7(0x1c4)](_0x5e6234=>_univerjs_core[_0x2364e7(0x422)][_0x2364e7(0x31f)](_0x5e6234,_0x170660));});let _0x353ead;if(_0x51dbab==='rowRanges')_0x353ead=_0x468ff4[_0x550328(0x1ae)][_0x6f1e6d];else{if(_0x51dbab===_0x550328(0x41b))_0x353ead=_0x468ff4['colHeaderMap'][_0x30ac6c];}const _0x5c71dc=_0x353ead===null||_0x353ead===void 0x0?void 0x0:_0x353ead[_0x550328(0x25f)],_0x20778a=_0x3c2299['getPivotTableCellData'](_0x29393a,_0x1d1b7e,_0x30ac6c,_0x6f1e6d);let _0x4260f2=_0x20778a===null||_0x20778a===void 0x0?void 0x0:_0x20778a['v'];if(_0x4260f2===_0xa8da57['t'](_0x550328(0x290)))_0x4260f2=_univerjs_pro_engine_pivot[_0x550328(0x1d7)]['BLANK_PLACEHOLDER'];if(_0x4260f2===void 0x0||_0x4260f2===null||!_0x16fc98||!_0x5c71dc)return![];const _0x2285fb=await _0x2b5acb['getPivotDisplayConfig']({'unitId':_0x29393a,'subUnitId':_0x1d1b7e,'pivotTableId':_0x16fc98,'params':{'type':PivotDisplayDataType['SetPivotCollapse'],'setPivotCollapse':{'tableFieldId':_0x5c71dc,'collapse':_0x3000f4,'item':_0x4260f2}}}),_0x3d2d52=_0x2285fb===null||_0x2285fb===void 0x0?void 0x0:_0x2285fb[_0x550328(0x21e)][_0x550328(0x2ea)];if(!_0x3d2d52)return![];const {view:_0x43f0ee,pivotTableConfig:_0x5062f5,isEmpty:_0x5b9e8e,changesets:_0x5f49c1}=_0x3d2d52,_0x12856d=new _univerjs_pro_engine_pivot[(_0x550328(0x3ce))]();_0x12856d[_0x550328(0x3db)](_0x43f0ee);const _0x5347e9=_0x5062f5['targetCellInfo'],_0x32059a={'cellInfo':_0x5347e9,'view':_0x12856d,'isEmpty':_0x5b9e8e};if(!await _0x140635[_0x550328(0x3e5)](SheetsPivotTableService)[_0x550328(0x273)][_0x550328(0x1a1)](PIVOT_PERFORM_CHECK)(!![],_0x32059a))return![];const _0x493d48=getInsertRowColMutations(_0x140635,_0x12856d,_0x5347e9,_0x5b9e8e),_0x3addfa=generateMutationsFromPivotCommand(_0x140635,_0x32059a),{redos:_0x2afb3c,undos:_0x27d474}=applyChangeSet(_0x8fd863,{'pivotTableId':_0x16fc98,'unitId':_0x29393a,'subUnitId':_0x1d1b7e},_0x5f49c1);return(0x0,_univerjs_core['sequenceExecute'])([..._0x493d48[_0x550328(0x35c)],..._0x3addfa[_0x550328(0x35c)],..._0x2afb3c],_0x8fd863),_0x222420[_0x550328(0x27a)]({'unitID':_0x29393a,'redoMutations':[..._0x493d48[_0x550328(0x35c)],..._0x3addfa[_0x550328(0x35c)],..._0x2afb3c],'undoMutations':[..._0x493d48[_0x550328(0x2a2)],..._0x3addfa['undos'],..._0x27d474]}),!![];}},SetPivotFieldsConfigCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x255),async 'handler'(_0x2203e2,_0xf4c7f){const _0x30fc66=_0x5b3260;if(!_0xf4c7f)return![];const _0xa3fda7=_0x2203e2['get'](_univerjs_core[_0x30fc66(0x151)]),_0x4240d1=_0x2203e2[_0x30fc66(0x3e5)](_univerjs_core[_0x30fc66(0x2bf)]),_0x580f15=_0x2203e2[_0x30fc66(0x3e5)](SheetsPivotRPCService),{pivotTableConfig:_0xbc598,pivotTableId:_0x3348ba,unitId:_0xd46b97,subUnitId:_0x554a5b}=_0xf4c7f,_0x319b02=(await _0x580f15[_0x30fc66(0x235)]({'unitId':_0xd46b97,'subUnitId':_0x554a5b,'pivotTableId':_0x3348ba,'params':{'type':PivotDisplayDataType[_0x30fc66(0x3c7)],'setPivotTableConfig':{'pivotTableId':_0x3348ba,'pivotTableConfig':_0xbc598}}}))[_0x30fc66(0x21e)][_0x30fc66(0x37d)];if(!_0x319b02)return![];const {changesets:_0x52ca0f}=_0x319b02,{redos:_0x433a40,undos:_0x5b9148}=applyChangeSet(_0xa3fda7,{'pivotTableId':_0x3348ba,'unitId':_0xd46b97,'subUnitId':_0x554a5b},_0x52ca0f);return(0x0,_univerjs_core['sequenceExecute'])(_0x433a40,_0xa3fda7),_0x4240d1['pushUndoRedo']({'unitID':_0xd46b97,'redoMutations':_0x433a40,'undoMutations':_0x5b9148}),!![];}},SetPivotFilterCommand={'type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'id':_0x5b3260(0x171),async 'handler'(_0x25eb79,_0x5fe821){const _0x525ca4=_0x5b3260;if(!_0x5fe821)return![];const _0x4df257=_0x25eb79[_0x525ca4(0x3e5)](_univerjs_core[_0x525ca4(0x151)]),{pivotTableId:_0x403c13,tableFieldId:_0x305713,items:_0x24f7d8,unitId:_0x46812c,subUnitId:_0x1d7aa4,isAll:_0x590e0e}=_0x5fe821,_0x3af203=_0x25eb79[_0x525ca4(0x3e5)](SheetsPivotRPCService),_0x532bb9=_0x25eb79[_0x525ca4(0x3e5)](_univerjs_core[_0x525ca4(0x2bf)]),_0x27e69c=(await _0x3af203[_0x525ca4(0x235)]({'unitId':_0x46812c,'subUnitId':_0x1d7aa4,'pivotTableId':_0x403c13,'params':{'type':PivotDisplayDataType['SetPivotFilter'],'setPivotFilter':{'tableFieldId':_0x305713,'items':_0x24f7d8,'isAll':_0x590e0e}}}))[_0x525ca4(0x21e)]['setPivotFilter'];if(!_0x27e69c)return![];const {changesets:_0x4da72f,pivotTableConfig:_0x4ab5b4,isEmpty:_0x3fd07c,view:_0x9c5627}=_0x27e69c,_0x62d34a=_0x4ab5b4[_0x525ca4(0x226)],_0x4de47e=new _univerjs_pro_engine_pivot[(_0x525ca4(0x3ce))]();_0x4de47e[_0x525ca4(0x3db)](_0x9c5627);const _0x29dbf2={'cellInfo':_0x62d34a,'view':_0x4de47e,'isEmpty':_0x3fd07c};if(!await _0x25eb79[_0x525ca4(0x3e5)](SheetsPivotTableService)['asyncInterceptor'][_0x525ca4(0x1a1)](PIVOT_PERFORM_CHECK)(!![],_0x29dbf2))return![];const _0x53ca30=getInsertRowColMutations(_0x25eb79,_0x4de47e,_0x62d34a,_0x3fd07c),_0x1c4e43=generateMutationsFromPivotCommand(_0x25eb79,_0x29dbf2),{undos:_0x16ca10,redos:_0x2ce744}=applyChangeSet(_0x4df257,{'pivotTableId':_0x403c13,'unitId':_0x46812c,'subUnitId':_0x1d7aa4},_0x4da72f);return(0x0,_univerjs_core[_0x525ca4(0x29f)])([..._0x53ca30['redos'],..._0x1c4e43[_0x525ca4(0x35c)],..._0x2ce744],_0x4df257),_0x532bb9[_0x525ca4(0x27a)]({'unitID':_0x46812c,'redoMutations':[..._0x53ca30['redos'],..._0x1c4e43[_0x525ca4(0x35c)],..._0x2ce744],'undoMutations':[..._0x53ca30['undos'],..._0x1c4e43['undos'],..._0x16ca10]}),!![];}},SetPivotSortCommand={'type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'id':_0x5b3260(0x1ca),async 'handler'(_0x3571ae,_0x3321f2){const _0x3d0fc1=_0x5b3260;if(!_0x3321f2)return![];const _0x1522d8=_0x3571ae[_0x3d0fc1(0x3e5)](_univerjs_core['ICommandService']),_0xde7262=_0x3571ae[_0x3d0fc1(0x3e5)](_univerjs_core[_0x3d0fc1(0x2bf)]),_0x2b2684=_0x3571ae[_0x3d0fc1(0x3e5)](SheetsPivotRPCService),{info:_0x28e222,tableFieldId:_0x4d3b16,pivotTableId:_0x5ce61a,unitId:_0x41706a,subUnitId:_0x497e1e}=_0x3321f2,_0x396c44=(await _0x2b2684[_0x3d0fc1(0x235)]({'unitId':_0x41706a,'subUnitId':_0x497e1e,'pivotTableId':_0x5ce61a,'params':{'type':PivotDisplayDataType['SetPivotSort'],'setPivotSort':{'tableFieldId':_0x4d3b16,'info':_0x28e222}}}))['result'][_0x3d0fc1(0x37b)];if(!_0x396c44)return![];const {changesets:_0x5c29f2}=_0x396c44,{redos:_0x210873,undos:_0x54d168}=applyChangeSet(_0x1522d8,{'pivotTableId':_0x5ce61a,'unitId':_0x41706a,'subUnitId':_0x497e1e},_0x5c29f2);return(0x0,_univerjs_core['sequenceExecute'])(_0x210873,_0x1522d8),_0xde7262['pushUndoRedo']({'unitID':_0x41706a,'redoMutations':_0x210873,'undoMutations':_0x54d168}),!![];}},SetPivotValueFilterCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x130),async 'handler'(_0x21a240,_0x5b0530){const _0x3ab25e=_0x5b3260;if(!_0x5b0530)return![];const _0x32a819=_0x21a240['get'](_univerjs_core[_0x3ab25e(0x151)]),{pivotTableId:_0x36d1ca,fieldId:_0x225d58,valueFilterInfo:_0x3b5863,unitId:_0xcea474,subUnitId:_0x3df282}=_0x5b0530,_0x3bd442=_0x21a240[_0x3ab25e(0x3e5)](SheetsPivotRPCService),_0x17b1b1=_0x21a240['get'](_univerjs_core[_0x3ab25e(0x2bf)]),_0x102b85=(await _0x3bd442['getPivotDisplayConfig']({'unitId':_0xcea474,'subUnitId':_0x3df282,'pivotTableId':_0x36d1ca,'params':{'type':PivotDisplayDataType[_0x3ab25e(0x3a4)],'setValuePivotFilter':{'tableFieldId':_0x225d58,'filterInfo':_0x3b5863}}}))[_0x3ab25e(0x21e)][_0x3ab25e(0x243)];if(!_0x102b85)return![];const {changesets:_0x34fe1b,pivotTableConfig:_0x51aede,isEmpty:_0x5dcf23,view:_0x395b1b}=_0x102b85,_0x59cd56=_0x51aede['targetCellInfo'],_0xf390da=new _univerjs_pro_engine_pivot[(_0x3ab25e(0x3ce))]();_0xf390da[_0x3ab25e(0x3db)](_0x395b1b);const _0x3daa4b={'cellInfo':_0x59cd56,'view':_0xf390da,'isEmpty':_0x5dcf23};if(!await _0x21a240[_0x3ab25e(0x3e5)](SheetsPivotTableService)[_0x3ab25e(0x273)]['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0x3daa4b))return![];const _0x9f0f1d=getInsertRowColMutations(_0x21a240,_0xf390da,_0x59cd56,_0x5dcf23),_0x554a5a=generateMutationsFromPivotCommand(_0x21a240,_0x3daa4b),{undos:_0x2de4bf,redos:_0x5bdb92}=applyChangeSet(_0x32a819,{'pivotTableId':_0x36d1ca,'unitId':_0xcea474,'subUnitId':_0x3df282},_0x34fe1b);return(0x0,_univerjs_core[_0x3ab25e(0x29f)])([..._0x9f0f1d[_0x3ab25e(0x35c)],..._0x554a5a[_0x3ab25e(0x35c)],..._0x5bdb92],_0x32a819),_0x17b1b1[_0x3ab25e(0x27a)]({'unitID':_0xcea474,'redoMutations':[..._0x9f0f1d['redos'],..._0x554a5a[_0x3ab25e(0x35c)],..._0x5bdb92],'undoMutations':[..._0x9f0f1d['undos'],..._0x554a5a[_0x3ab25e(0x2a2)],..._0x2de4bf]}),!![];}},UpdateDateGroupMutation={'id':'sheet.mutation.update-date-group','type':_univerjs_core['CommandType']['MUTATION'],'handler':(_0x2cb213,_0x224b5f)=>{const _0x59ce68=_0x5b3260;if(!_0x224b5f)return![];const _0x13e299=_0x2cb213['get'](_univerjs_core['IConfigService']);if(Boolean(_0x13e299[_0x59ce68(0x2fe)](_0x59ce68(0x20d))))return!![];const {unitId:_0x48e0ac,subUnitId:_0x17a099,pivotTableId:_0x47dca0,tableFieldId:_0x3d71b9,dateType:_0x13100f}=_0x224b5f,_0x320a26=_0x2cb213['get'](SheetsPivotDataSourceModel),_0x3dfa2b=_0x320a26[_0x59ce68(0x407)](_0x47dca0);if(!_0x3dfa2b)return![];const _0x10e983=_0x3dfa2b['getDataFieldByTableId'](_0x3d71b9);if(!_0x10e983)return![];const _0x3cc4f8=_0x10e983[_0x59ce68(0x395)](),_0x5cde1f=_0x3dfa2b['getDataFieldByDataFieldId'](_0x3cc4f8),_0x21bb73=(_0x5cde1f===null||_0x5cde1f===void 0x0?void 0x0:_0x5cde1f['getName']())+'\x20'+getDateGroupName(_0x2cb213,_0x13100f);_0x320a26[_0x59ce68(0x329)](_0x48e0ac,_0x47dca0)[_0x59ce68(0x40c)](_0x10e983['id'],_0x21bb73);const _0x19f98f=_0x3dfa2b[_0x59ce68(0x3af)](_0x3d71b9);if(!_0x19f98f)return![];_0x3dfa2b[_0x59ce68(0x311)](_0x19f98f[_0x59ce68(0x1ef)](),_0x21bb73),_0x10e983[_0x59ce68(0x38f)](_0x13100f);const _0x542012=_0x320a26['getPivotTableConfig'](_0x48e0ac,_0x17a099,_0x47dca0);return _0x320a26['addDirtyPivotTable']({'unitId':_0x48e0ac,'subUnitId':_0x17a099,'token':_0x47dca0,'type':PivotTableOperationEnum['Set'],'pivotConfig':_0x542012}),!![];}},UpdateDateGroupCommand={'id':'sheet.command.update-date-group','type':_univerjs_core['CommandType'][_0x5b3260(0x277)],'handler':(_0x3954fd,_0x2b4be5)=>{const _0x33f5f5=_0x5b3260;if(!_0x2b4be5)return![];const _0x5748cc=_0x3954fd[_0x33f5f5(0x3e5)](_univerjs_core['IUndoRedoService']),{unitId:_0x4b3e2c,subUnitId:_0x499d2d,pivotTableId:_0x463b28,tableFieldId:_0x2f7a68}=_0x2b4be5,_0x44479c=[],_0x597926=[],_0x561916=_0x3954fd[_0x33f5f5(0x3e5)](SheetsPivotTableConfigModel),_0x3df498=_0x561916[_0x33f5f5(0x329)](_0x4b3e2c,_0x463b28),_0x4c84c1=_0x561916['getPivotTableConfig'](_0x4b3e2c,_0x499d2d,_0x463b28);if(!(_0x4c84c1===null||_0x4c84c1===void 0x0?void 0x0:_0x4c84c1[_0x33f5f5(0x170)][_0x33f5f5(0x394)]))return![];const _0x22d19c=Object[_0x33f5f5(0x360)](_0x4c84c1[_0x33f5f5(0x170)][_0x33f5f5(0x394)])[_0x33f5f5(0x2ad)](_0x18f5b2=>_0x18f5b2['id']===_0x2f7a68);if(!_0x22d19c)return![];const _0x449f84=_0x22d19c['dataFieldId'];if(!(_0x3df498===null||_0x3df498===void 0x0?void 0x0:_0x3df498[_0x33f5f5(0x146)]))return![];const _0x19505b=Object[_0x33f5f5(0x360)](_0x3df498===null||_0x3df498===void 0x0?void 0x0:_0x3df498[_0x33f5f5(0x146)])[_0x33f5f5(0x2ad)](_0x3e861f=>_0x3e861f['id']===_0x449f84);if(!_0x19505b)return![];if((0x0,_univerjs_pro_engine_pivot[_0x33f5f5(0x396)])(_0x19505b))_0x44479c[_0x33f5f5(0x154)]({'id':UpdateDateGroupMutation['id'],'params':{..._0x2b4be5,'dateType':_0x19505b[_0x33f5f5(0x2cb)]}});_0x597926['push']({'id':UpdateDateGroupMutation['id'],'params':{..._0x2b4be5}});if((0x0,_univerjs_core['sequenceExecute'])(_0x597926,_0x3954fd['get'](_univerjs_core[_0x33f5f5(0x151)])))_0x5748cc['pushUndoRedo']({'unitID':_0x4b3e2c,'undoMutations':_0x44479c,'redoMutations':_0x597926});return!![];}},UpdatePivotFieldSettingCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':_0x5b3260(0x15d),async 'handler'(_0x116017,_0xe235fc){const _0x559068=_0x5b3260;if(!_0xe235fc)return![];const _0x4a330e=_0x116017['get'](_univerjs_core[_0x559068(0x151)]),_0xda6a18=_0x116017[_0x559068(0x3e5)](_univerjs_core[_0x559068(0x2bf)]),_0x5ba1ce=_0x116017[_0x559068(0x3e5)](SheetsPivotRPCService),{displayName:_0x47ead1,subtotalType:_0x2a1f44,format:_0x41295b,tableFieldId:_0x150fd9,pivotTableId:_0x2f2a56,unitId:_0xbeb500,subUnitId:_0x3c5121}=_0xe235fc,_0x32cb07=(await _0x5ba1ce['getPivotDisplayConfig']({'unitId':_0xbeb500,'subUnitId':_0x3c5121,'pivotTableId':_0x2f2a56,'params':{'type':PivotDisplayDataType['SetPivotSetting'],'setPivotSetting':{'tableFieldId':_0x150fd9,'displayName':_0x47ead1,'subtotalType':_0x2a1f44,'format':_0x41295b}}}))[_0x559068(0x21e)][_0x559068(0x328)];if(!_0x32cb07)return![];const {changesets:_0x3e5966,view:_0x5d3ea7,pivotTableConfig:_0x3c9a24,isEmpty:_0x421ac2}=_0x32cb07,_0x1411f8=_0x3c9a24[_0x559068(0x226)],_0x36f3f1=new _univerjs_pro_engine_pivot[(_0x559068(0x3ce))]();_0x36f3f1[_0x559068(0x3db)](_0x5d3ea7);const _0x16b838={'cellInfo':_0x1411f8,'view':_0x36f3f1,'isEmpty':_0x421ac2};if(!await _0x116017[_0x559068(0x3e5)](SheetsPivotTableService)[_0x559068(0x273)][_0x559068(0x1a1)](PIVOT_PERFORM_CHECK)(!![],_0x16b838))return![];const _0x5e221a=getInsertRowColMutations(_0x116017,_0x36f3f1,_0x1411f8,_0x421ac2),_0x183116=generateMutationsFromPivotCommand(_0x116017,_0x16b838),{undos:_0x24b377,redos:_0x4afff5}=applyChangeSet(_0x4a330e,{'pivotTableId':_0x2f2a56,'unitId':_0xbeb500,'subUnitId':_0x3c5121},_0x3e5966);return(0x0,_univerjs_core[_0x559068(0x29f)])([..._0x5e221a[_0x559068(0x35c)],..._0x183116[_0x559068(0x35c)],..._0x4afff5],_0x4a330e),_0xda6a18[_0x559068(0x27a)]({'unitID':_0xbeb500,'redoMutations':[..._0x5e221a['redos'],..._0x183116[_0x559068(0x35c)],..._0x4afff5],'undoMutations':[..._0x5e221a[_0x559068(0x2a2)],..._0x183116[_0x559068(0x2a2)],..._0x24b377]}),!![];}},UpdatePivotTableSourceRangeMutation={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x2be)],'id':_0x5b3260(0x419),'handler'(_0x5d4536,_0x4c3a02){const _0x19e9bc=_0x5b3260;if(!_0x4c3a02)return![];const _0x4b3a41=_0x5d4536[_0x19e9bc(0x3e5)](_univerjs_core[_0x19e9bc(0x295)]);if(Boolean(_0x4b3a41[_0x19e9bc(0x2fe)](_0x19e9bc(0x20d))))return!![];const _0x3b76be=_0x5d4536[_0x19e9bc(0x3e5)](SheetsPivotDataSourceModel),{pivotTableId:_0x5ca95b,deleteIds:_0x2dfa7a,collectionJSON:_0x8326cb,dataRangeInfo:_0x48b8fd,unitId:_0x51e4f1,subUnitId:_0x3fe480}=_0x4c3a02,_0x3a8e50=_0x3b76be[_0x19e9bc(0x407)](_0x5ca95b),_0x71a174=_0x3b76be['getPivotTableConfig'](_0x51e4f1,_0x3fe480,_0x5ca95b);if(!_0x3a8e50||!_0x71a174)return![];const {collection:_0x577e6f,updateDataFieldList:_0x20b5b5}=_0x3b76be[_0x19e9bc(0x3e2)](_0x5ca95b,_0x8326cb,_0x48b8fd,_0x71a174['targetCellInfo']);_0x3b76be[_0x19e9bc(0x342)](_0x577e6f,_0x20b5b5,_0x48b8fd),_0x3a8e50[_0x19e9bc(0x368)](_0x577e6f);for(const _0x400c5a of _0x2dfa7a)_0x3b76be[_0x19e9bc(0x24f)](_0x48b8fd['unitId'],_0x400c5a);const _0x296d5b=_0x3b76be[_0x19e9bc(0x32a)](_0x51e4f1,_0x3fe480,_0x5ca95b);return _0x296d5b[_0x19e9bc(0x3d4)]=JSON['parse'](JSON['stringify'](_0x48b8fd)),_0x3b76be['addDirtyPivotTable']({'unitId':_0x51e4f1,'subUnitId':_0x3fe480,'token':_0x5ca95b,'type':PivotTableOperationEnum[_0x19e9bc(0x178)]}),!![];}},UpdatePivotTableSourceRangeCommand={'type':_univerjs_core['CommandType']['COMMAND'],'id':_0x5b3260(0x310),async 'handler'(_0x1c6c4b,_0x32ec54){const _0x4abeda=_0x5b3260,_0x2c1cd3=_0x1c6c4b[_0x4abeda(0x3e5)](_univerjs_core[_0x4abeda(0x151)]),_0xafbd2d=_0x1c6c4b['get'](SheetsPivotRPCService),_0x332026=_0x1c6c4b['get'](_univerjs_core[_0x4abeda(0x2bf)]);if(!_0x32ec54)return![];const {token:_0x17057a,dataRangeInfo:_0x1b1e6d,unitId:_0x69254e,subUnitId:_0x19d9b2}=_0x32ec54,_0x1841f8=[],_0x2e9c5f=[],_0x51770a=(await _0xafbd2d[_0x4abeda(0x235)]({'unitId':_0x69254e,'subUnitId':_0x19d9b2,'pivotTableId':_0x17057a,'params':{'type':PivotDisplayDataType[_0x4abeda(0x3c0)],'updatePivotSource':{'dataRangeInfo':_0x1b1e6d,'unitId':_0x69254e,'subUnitId':_0x19d9b2}}}))[_0x4abeda(0x21e)][_0x4abeda(0x261)];if(!_0x51770a)return![];const {changesets:_0x4d27f9,deleteIds:_0x79b175,collectionConfig:_0xe60ef4,oldCollectionConfig:_0xdf22db,view:_0x4b0005,isEmpty:_0x166b6f,pivotTableConfig:_0xed853b}=_0x51770a;_0x2e9c5f['push']({'id':UpdatePivotTableSourceRangeMutation['id'],'params':{'pivotTableId':_0x17057a,'deleteIds':_0x79b175,'collectionJSON':_0xe60ef4,'dataRangeInfo':_0x1b1e6d,'unitId':_0x69254e,'subUnitId':_0x19d9b2}}),_0x1841f8[_0x4abeda(0x440)]({'id':UpdatePivotTableSourceRangeMutation['id'],'params':{'pivotTableId':_0x17057a,'deleteIds':[],'collectionJSON':_0xdf22db,'dataRangeInfo':_0xed853b[_0x4abeda(0x3d4)],'unitId':_0x69254e,'subUnitId':_0x19d9b2}});const _0x7648d1=_0xed853b[_0x4abeda(0x226)],_0x3cb9e3=new _univerjs_pro_engine_pivot[(_0x4abeda(0x3ce))]();_0x3cb9e3[_0x4abeda(0x3db)](_0x4b0005);const _0x387335={'cellInfo':_0x7648d1,'view':_0x3cb9e3,'isEmpty':_0x166b6f};if(!await _0x1c6c4b[_0x4abeda(0x3e5)](SheetsPivotTableService)[_0x4abeda(0x273)][_0x4abeda(0x1a1)](PIVOT_PERFORM_CHECK)(!![],_0x387335))return![];const _0x402782=getInsertRowColMutations(_0x1c6c4b,_0x3cb9e3,_0x7648d1,_0x166b6f),_0x2cfcd6=generateMutationsFromPivotCommand(_0x1c6c4b,_0x387335),{undos:_0x3e4170,redos:_0x1acec5}=applyChangeSet(_0x2c1cd3,{'pivotTableId':_0x17057a,'unitId':_0x69254e,'subUnitId':_0x19d9b2},_0x4d27f9);return(0x0,_univerjs_core[_0x4abeda(0x29f)])([..._0x402782[_0x4abeda(0x35c)],..._0x2cfcd6[_0x4abeda(0x35c)],..._0x2e9c5f,..._0x3e4170],_0x2c1cd3),_0x332026['pushUndoRedo']({'unitID':_0x69254e,'redoMutations':[..._0x402782[_0x4abeda(0x35c)],..._0x2cfcd6[_0x4abeda(0x35c)],..._0x2e9c5f,..._0x3e4170],'undoMutations':[..._0x402782[_0x4abeda(0x2a2)],..._0x2cfcd6[_0x4abeda(0x2a2)],..._0x1841f8,..._0x1acec5]}),!![];}},UpdatePivotValuePositionCommand={'type':_univerjs_core[_0x5b3260(0x289)][_0x5b3260(0x277)],'id':'sheet.command.update-pivot-value-position',async 'handler'(_0x40f1fe,_0x3a15f7){const _0x27d0d5=_0x5b3260;if(!_0x3a15f7)return![];const _0x41ad36=_0x40f1fe['get'](_univerjs_core['ICommandService']),_0x42d16d=_0x40f1fe[_0x27d0d5(0x3e5)](SheetsPivotRPCService),_0x32777b=_0x40f1fe[_0x27d0d5(0x3e5)](_univerjs_core[_0x27d0d5(0x13e)]),_0x1db7a8=_0x40f1fe[_0x27d0d5(0x3e5)](_univerjs_core[_0x27d0d5(0x2bf)]),{pivotTableId:_0x373db1,position:_0x53fd11,index:_0xc31739}=_0x3a15f7,_0x2870d2=(0x0,_univerjs_sheets[_0x27d0d5(0x2f9)])(_0x32777b);if(!_0x2870d2)return![];const {unitId:_0x2ef9dd,subUnitId:_0x4e5d0c}=_0x2870d2,_0x522a9e=(await _0x42d16d[_0x27d0d5(0x235)]({'unitId':_0x2ef9dd,'subUnitId':_0x4e5d0c,'pivotTableId':_0x373db1,'params':{'type':PivotDisplayDataType[_0x27d0d5(0x36b)],'updateValuePosition':{'position':_0x53fd11,'index':_0xc31739}}}))[_0x27d0d5(0x21e)][_0x27d0d5(0x198)];if(!_0x522a9e)return![];const {changesets:_0x436150,view:_0x1905e4,isEmpty:_0x24bad7,pivotTableConfig:_0x51578b}=_0x522a9e,_0x1ea5dc=_0x51578b[_0x27d0d5(0x226)],_0x2a85ee=new _univerjs_pro_engine_pivot[(_0x27d0d5(0x3ce))]();_0x2a85ee[_0x27d0d5(0x3db)](_0x1905e4);const _0x5ba15e=_0x40f1fe[_0x27d0d5(0x3e5)](SheetsPivotTableService),_0xac8b43={'cellInfo':_0x1ea5dc,'view':_0x2a85ee,'isEmpty':_0x24bad7};if(!await _0x5ba15e['asyncInterceptor']['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0xac8b43))return![];const _0x62bdf2=getInsertRowColMutations(_0x40f1fe,_0x2a85ee,_0x1ea5dc,_0x24bad7),_0x25f3b0=generateMutationsFromPivotCommand(_0x40f1fe,_0xac8b43),{undos:_0x38361d,redos:_0x1409fd}=applyChangeSet(_0x41ad36,{'pivotTableId':_0x373db1,'unitId':_0x2ef9dd,'subUnitId':_0x4e5d0c},_0x436150);return(0x0,_univerjs_core['sequenceExecute'])([..._0x62bdf2[_0x27d0d5(0x35c)],..._0x25f3b0[_0x27d0d5(0x35c)],..._0x1409fd],_0x41ad36),_0x1db7a8[_0x27d0d5(0x27a)]({'unitID':_0x2ef9dd,'redoMutations':[..._0x62bdf2[_0x27d0d5(0x35c)],..._0x25f3b0[_0x27d0d5(0x35c)],..._0x1409fd],'undoMutations':[..._0x62bdf2[_0x27d0d5(0x2a2)],..._0x25f3b0[_0x27d0d5(0x2a2)],..._0x38361d]}),!![];}},PivotTableViewDirtyMarkOperation={'type':_univerjs_core[_0x5b3260(0x289)]['MUTATION'],'id':_0x5b3260(0x41e),'handler'(){return!![];}};var name=_0x5b3260(0x3f3),version=_0x5b3260(0x434);const getEmptyPivotDirtyViewInfo=()=>{return{'runtimeCellData':{},'dirtyRanges':{}};},updatePivotTableFieldName=(_0x1b6af1,_0x1018b5,_0x10fada)=>{const _0x219968=_0x5b3260,_0x80180=_0x1b6af1['dataFieldsCollection'];_0x1b6af1[_0x219968(0x2fb)](_0x354267=>{const _0x23c00f=_0x219968,_0x174dd2=_0x354267[_0x23c00f(0x1ef)](),_0x1c9b7a=_0x354267['getDataFieldId'](),_0x6c870b=_0x354267[_0x23c00f(0x140)](),_0x51bcf0=_0x354267[_0x23c00f(0x2b1)]();_0x1018b5[_0x1c9b7a]&&_0x1018b5[_0x1c9b7a]===_0x51bcf0&&(_0x6c870b===_0x51bcf0&&(_0x1b6af1[_0x23c00f(0x311)](_0x174dd2,_0x80180[_0x23c00f(0x2b1)](_0x1c9b7a)),_0x354267[_0x23c00f(0x280)](_0x80180[_0x23c00f(0x2b1)](_0x1c9b7a))));}),_0x1b6af1[_0x219968(0x421)](_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum']['Value'],_0x251ba2=>{const _0x298282=_0x219968,_0xe51d76=_0x251ba2[_0x298282(0x1ef)](),_0x50c420=_0x251ba2[_0x298282(0x162)](),_0x3f2b7d=_0x251ba2[_0x298282(0x140)](),_0x1e2ed7=_0x251ba2['getDisplayName'](),_0x2304d4=_0x251ba2[_0x298282(0x30a)](),_0x39a8a9=_0x10fada(_0x3f2b7d,_0x2304d4);_0x1018b5[_0x50c420]&&_0x1018b5[_0x50c420]===_0x3f2b7d&&_0x39a8a9===_0x1e2ed7&&(_0x1b6af1[_0x298282(0x311)](_0xe51d76,_0x10fada(_0x80180['getDisplayName'](_0x50c420),_0x2304d4)),_0x251ba2[_0x298282(0x280)](_0x80180[_0x298282(0x2b1)](_0x50c420)));});},getDirtyColumn=(_0x6a3331,_0x527366,_0x246186)=>{const _0x31b2f7=_0x5b3260;var _0x4b4922,_0x4ef84f;const {arrayFormulaCellData:_0x3a33c0,unitData:_0x260116}=_0x527366,{unitId:_0x38b270,subUnitId:_0x2af96d}=_0x246186,_0x10dbcc=_0x246186[_0x31b2f7(0x30e)],{startColumn:_0x32398d,endColumn:_0x1d1380}=_0x10dbcc,_0x488c01=_0x3a33c0===null||_0x3a33c0===void 0x0||(_0x4b4922=_0x3a33c0[_0x38b270])===null||_0x4b4922===void 0x0?void 0x0:_0x4b4922[_0x2af96d],_0xb24be7=_0x260116===null||_0x260116===void 0x0||(_0x4ef84f=_0x260116[_0x38b270])===null||_0x4ef84f===void 0x0?void 0x0:_0x4ef84f[_0x2af96d],_0x20d14c=new Set(),_0x2134f4=_0x1d1380-_0x32398d+0x1,{dirtyRanges:_0x58fad3}=_0x6a3331;if(_0x58fad3)for(const {range:_0x580498,sheetId:_0x4e7e00,unitId:_0x30ea60}of _0x58fad3){if(_0x4e7e00!==_0x2af96d||_0x38b270!==_0x30ea60)continue;const _0x5d58e5=_univerjs_core[_0x31b2f7(0x422)][_0x31b2f7(0x34b)](_0x580498,_0x10dbcc);if(_0x5d58e5){const {startColumn:_0x36e95a,endColumn:_0x21211b}=_0x5d58e5;for(let _0x577b74=_0x36e95a;_0x577b74<=_0x21211b;_0x577b74++)_0x20d14c[_0x31b2f7(0x1a8)](_0x577b74);}}if(_0x20d14c['size']===_0x2134f4)return Array[_0x31b2f7(0x176)](_0x20d14c);if(_0x20d14c[_0x31b2f7(0x275)]===_0x2134f4)return Array['from'](_0x20d14c);if(_0xb24be7){const _0x434e46=_0xb24be7['getMatrix'](),_0x1417ce=Object[_0x31b2f7(0x2da)](_0x434e46);for(const _0x54662d of _0x1417ce){const _0x4759bb=_0x434e46[Number(_0x54662d)];if(_0x20d14c[_0x31b2f7(0x275)]===_0x2134f4)break;for(const _0xfa0326 in _0x4759bb){const _0x2be8cc=Number(_0xfa0326);if(_0x2be8cc<_0x32398d||_0x2be8cc>_0x1d1380)continue;_0x20d14c['add'](_0x2be8cc);}}}if(_0x488c01){const _0x36bcfb=_0x488c01[_0x31b2f7(0x180)](),_0x535bdc=Object['keys'](_0x36bcfb);for(const _0x21d312 of _0x535bdc){const _0x16c99f=_0x36bcfb[Number(_0x21d312)];if(_0x20d14c[_0x31b2f7(0x275)]===_0x2134f4)break;for(const _0x4683bb in _0x16c99f){const _0x57cf4c=Number(_0x4683bb);if(_0x57cf4c<_0x32398d||_0x57cf4c>_0x1d1380)continue;_0x20d14c[_0x31b2f7(0x1a8)](_0x57cf4c);}}}return Array['from'](_0x20d14c);},getUniqueRange=_0x33011a=>{const _0x52a717=_0x5b3260,_0x235133=new Set(),_0x1b98ab=[];for(const _0x48fa50 of _0x33011a){const _0x309149=_0x48fa50[_0x52a717(0x401)]+','+_0x48fa50[_0x52a717(0x249)]+','+_0x48fa50[_0x52a717(0x29c)]+','+_0x48fa50['endColumn'];!_0x235133[_0x52a717(0x194)](_0x309149)&&(_0x235133['add'](_0x309149),_0x1b98ab[_0x52a717(0x154)](_0x48fa50));}return _0x1b98ab;};function _0x216b(_0x5eb63e,_0x707bc9){_0x5eb63e=_0x5eb63e-0x12b;const _0x461fb9=_0x461f();let _0x216bc7=_0x461fb9[_0x5eb63e];return _0x216bc7;}let PivotCalculatorController=class PivotCalculatorController extends _univerjs_core['Disposable']{constructor(_0x33528c,_0x2936c5,_0x2c854f,_0x367518,_0x29e715){const _0x181f44=_0x5b3260;super(),this[_0x181f44(0x2d9)]=_0x33528c,this[_0x181f44(0x2af)]=_0x2936c5,this['_commandService']=_0x2c854f,this[_0x181f44(0x42a)]=_0x367518,this[_0x181f44(0x2ee)]=_0x29e715,_defineProperty(this,_0x181f44(0x3dc),new rxjs[(_0x181f44(0x257))](!![])),_defineProperty(this,_0x181f44(0x29b),_0x4fe99f=>{const _0x354aa6=_0x181f44;this[_0x354aa6(0x3dc)][_0x354aa6(0x3e1)](![]);}),_defineProperty(this,_0x181f44(0x202),_0x29b460=>{const _0x55ec6d=_0x181f44;this[_0x55ec6d(0x3dc)][_0x55ec6d(0x3e1)](!![]);}),this[_0x181f44(0x315)](),this[_0x181f44(0x3f4)]();}[_0x5b3260(0x315)](){const _0x410276=_0x5b3260;this['_subjectCollectionChange'](),this['_subjectViewChange'](),this[_0x410276(0x28e)](),this[_0x410276(0x28d)]();}[_0x5b3260(0x383)](){const _0x2e0e32=_0x5b3260;this[_0x2e0e32(0x42a)][_0x2e0e32(0x23b)](this[_0x2e0e32(0x3dc)]),_univerjs_pro_engine_pivot[_0x2e0e32(0x404)][_0x2e0e32(0x12e)](_univerjs_pro_engine_pivot[_0x2e0e32(0x1b5)]['onQueryStart'],this[_0x2e0e32(0x29b)]),_univerjs_pro_engine_pivot[_0x2e0e32(0x404)]['registerCallbackWithEvent'](_univerjs_pro_engine_pivot[_0x2e0e32(0x1b5)][_0x2e0e32(0x1cc)],this[_0x2e0e32(0x202)]);}[_0x5b3260(0x3f4)](){const _0x502da7=_0x5b3260;this['disposeWithMe'](this[_0x502da7(0x389)]['onCommandExecuted'](_0x158480=>{const _0x57a972=_0x502da7;if(_0x158480['id']===_univerjs_sheets['MoveRangeMutation']['id'])this['_sheetsPivotDataSourceModel']['handleMoveRange'](_0x158480[_0x57a972(0x35e)]);})),this[_0x502da7(0x1bf)](this[_0x502da7(0x389)][_0x502da7(0x24e)](_0x185218=>{const _0x4003a7=_0x502da7;if(_0x185218['id']!==GetPivotDataLocalMutation['id'])return;const _0x3b2a39=_0x185218[_0x4003a7(0x35e)],{unitId:_0x3eff04,subUnitId:_0x2f8d13,pivotTableId:_0x5eb60b}=_0x3b2a39,_0xb8e42e=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x3d0)],_0x1c5114={};switch(_0xb8e42e){case PivotDisplayDataType[_0x4003a7(0x341)]:{const _0x201364=_0x3b2a39['params'][_0x4003a7(0x161)];if(!_0x201364)return;const {row:_0x50e8b6,col:_0x1b2ede,cellData:_0x594c50,pivotItemRenderInfoCache:_0x16d917,tableFieldId:_0x3c13db}=_0x201364,_0x259fbf=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x3b2a39['pivotTableId']);if(!_0x259fbf||!_0x16d917)return;if(!_0x3c13db){const _0x1a956c=getPivotCellInfo(_0x50e8b6,_0x1b2ede,_0x594c50,_0x259fbf,_0x16d917),_0x2e1f29=_0x1a956c===null||_0x1a956c===void 0x0?void 0x0:_0x1a956c[_0x4003a7(0x2ae)];if(!_0x2e1f29)return;const _0x52991f=_0x259fbf[_0x4003a7(0x190)](_0x2e1f29);if(!_0x52991f)return;_0x1c5114[_0x4003a7(0x161)]={..._0x259fbf[_0x4003a7(0x2fc)](_0x52991f),'tableFieldId':_0x2e1f29,'pivotTableId':_0x3b2a39[_0x4003a7(0x1e1)],'filterInfo':_0x259fbf[_0x4003a7(0x36e)](_0x2e1f29),'sortInfo':_0x259fbf['getSortInfo'](_0x2e1f29),'format':_0x259fbf['getFieldFormat'](_0x2e1f29)};}else{const _0x559e52=_0x259fbf[_0x4003a7(0x190)](_0x3c13db);if(!_0x559e52)return;_0x1c5114[_0x4003a7(0x161)]={..._0x259fbf[_0x4003a7(0x2fc)](_0x559e52),'tableFieldId':_0x3c13db,'pivotTableId':_0x3b2a39[_0x4003a7(0x1e1)],'filterInfo':_0x259fbf['getFilterInfo'](_0x3c13db),'sortInfo':_0x259fbf[_0x4003a7(0x1ab)](_0x3c13db),'format':_0x259fbf[_0x4003a7(0x1ce)](_0x3c13db)};}}break;case PivotDisplayDataType[_0x4003a7(0x27b)]:{const _0x555fc1=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x222)];if(!_0x555fc1)return;const {pivotTableId:_0xbc1de4}=_0x555fc1,_0xee0464=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0xbc1de4);if(!_0xee0464)return;_0x1c5114[_0x4003a7(0x222)]=getPivotTableInfo(_0xee0464,_0xbc1de4,this[_0x4003a7(0x2d9)][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0xbc1de4));}break;case PivotDisplayDataType[_0x4003a7(0x3ef)]:{const _0x12d4db=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b),_0x3d579d=this[_0x4003a7(0x2d9)]['getDataFieldManager'](_0x3eff04),_0x195030=_0x3d579d[_0x4003a7(0x329)](_0x5eb60b);let _0x456e89=null;const _0x4eeb70=this[_0x4003a7(0x2d9)][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0x5eb60b),_0x3bbc82=_0x3b2a39['params'][_0x4003a7(0x16c)];if(!_0x12d4db||!_0x4eeb70||!_0x3bbc82)return![];const {dataFieldId:_0x1a993d,fieldArea:_0x52ac1c,index:_0x4b1ba7}=_0x3bbc82;_0x12d4db[_0x4003a7(0x3c1)]();const _0x2a11ce=_0x12d4db['addFieldWithSourceId'](_0x1a993d,_0x52ac1c,_0x4b1ba7);if(_0x2a11ce&&_0x52ac1c===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)]['Value']){const _0x4de7a8=_0x2a11ce[_0x4003a7(0x1ef)](),_0x1fa622=_0x12d4db[_0x4003a7(0x190)](_0x4de7a8);if(_0x1fa622){const _0x3767ea=_0x1fa622===null||_0x1fa622===void 0x0?void 0x0:_0x1fa622[_0x4003a7(0x1ba)]();_0x12d4db[_0x4003a7(0x298)](_0x2a11ce[_0x4003a7(0x1ef)](),_0x3767ea===_univerjs_pro_engine_pivot[_0x4003a7(0x16d)]['number']?_univerjs_pro_engine_pivot[_0x4003a7(0x175)][_0x4003a7(0x37c)]:_univerjs_pro_engine_pivot[_0x4003a7(0x175)][_0x4003a7(0x331)]);}const _0xd8c933=_0x12d4db[_0x4003a7(0x193)](),_0x2db172=_0x12d4db['getValuePosition'](),_0x4f10ad=_0x12d4db[_0x4003a7(0x3d3)](_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x26b)]);if(_0xd8c933===-0x1&&_0x4f10ad>0x1){const _0x5a9ff6=_0x2db172===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)]['None']?_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)][_0x4003a7(0x269)]:_0x2db172,_0xaac529=_0x5a9ff6===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)]['Row']?_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x3ed)]:_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum']['Column'];_0x12d4db[_0x4003a7(0x198)](_0x5a9ff6,_0x12d4db[_0x4003a7(0x3d3)](_0xaac529));}}else{if(_0x2a11ce&&(_0x52ac1c===_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x4003a7(0x3ed)]||_0x52ac1c===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x269)])){const _0x1a1980=_0x2a11ce['getId'](),_0x2bc837=_0x12d4db[_0x4003a7(0x190)](_0x1a1980);if(_0x2bc837){if((_0x2bc837===null||_0x2bc837===void 0x0?void 0x0:_0x2bc837[_0x4003a7(0x1ba)]())===_univerjs_pro_engine_pivot[_0x4003a7(0x16d)][_0x4003a7(0x2a8)]){const _0x208c78=_0x2bc837['getformat']();if(_0x208c78)_0x12d4db[_0x4003a7(0x1c5)](_0x2a11ce[_0x4003a7(0x1ef)](),_0x208c78);if(!_0x195030[_0x4003a7(0x379)]()[_0x4003a7(0x1c4)](_0x3081e9=>{const _0x14c94c=_0x4003a7,_0x1a565f=_0x195030[_0x14c94c(0x25b)](_0x3081e9);if((0x0,_univerjs_pro_engine_pivot['isDateGroupField'])(_0x1a565f))return _0x1a565f[_0x14c94c(0x1c7)]()[_0x14c94c(0x2f5)]===_0x1a993d;return![];})){const _0xea40c7=_0x3d579d[_0x4003a7(0x3ca)](),_0x1cb8a3=findCommonDateType(_0x2bc837[_0x4003a7(0x172)],_0x2bc837[_0x4003a7(0x1f6)]),_0x25ff7d=_0x2bc837[_0x4003a7(0x1c2)]()+_0x4003a7(0x181)+getDateGroupName(this[_0x4003a7(0x2ee)],_0x1cb8a3),_0x3b991f=new _univerjs_pro_engine_pivot[(_0x4003a7(0x43e))](_0xea40c7,_0x25ff7d,(0x0,_univerjs_pro_engine_pivot[_0x4003a7(0x16e)])(0x3),_0x2bc837['getId'](),_0x1cb8a3);_0x3d579d[_0x4003a7(0x35a)](_0x3b991f),_0x195030[_0x4003a7(0x377)](_0xea40c7,_0x25ff7d),_0x12d4db[_0x4003a7(0x13f)](_0xea40c7,_0x52ac1c,(_0x4b1ba7!==null&&_0x4b1ba7!==void 0x0?_0x4b1ba7:0x0)+0x1),_0x456e89=_0x3b991f;}}}}}const _0x571391=_0x12d4db[_0x4003a7(0x40d)](),_0x5e4e81=_0x12d4db['query']()[_0x4003a7(0x1d4)]();let _0x1c46d6;if(_0x456e89){_0x1c46d6=_0x456e89[_0x4003a7(0x1d4)]();const _0x15a4f3=_0x456e89[_0x4003a7(0x1ef)]();_0x195030['deleteField'](_0x15a4f3);let _0x2dc66b=!![];for(const _0x3f8aaa in _0x3d579d[_0x4003a7(0x2a4)])if(_0x3d579d['collections'][_0x3f8aaa][_0x4003a7(0x379)]()[_0x4003a7(0x32f)](_0x15a4f3)){_0x2dc66b=![];break;}if(_0x2dc66b)_0x3d579d[_0x4003a7(0x3e0)](_0x15a4f3);}_0x1c5114['addPivotField']={'view':_0x5e4e81,'changesets':_0x12d4db[_0x4003a7(0x39f)](),'isEmpty':_0x571391,'pivotTableConfig':_0x4eeb70,'shouldBeAddedGroupJSON':_0x1c46d6};}break;case PivotDisplayDataType['AddPivotTable']:{const _0x122fe6=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x29a)];if(!_0x122fe6)return;const _0x24259a=_0x122fe6[_0x4003a7(0x3d4)],_0x4dd337=_0x122fe6[_0x4003a7(0x1e1)],{collection:_0x1667b0}=this[_0x4003a7(0x2d9)][_0x4003a7(0x179)]({'unitId':_0x24259a['unitId'],'sheetName':_0x24259a[_0x4003a7(0x3b7)],'subUnitId':_0x24259a['subUnitId'],'range':_0x24259a[_0x4003a7(0x30e)]}),_0xa89b8a=new _univerjs_pro_engine_pivot[(_0x4003a7(0x404))](_0x1667b0,void 0x0,_0x4dd337);_0x1c5114['addPivotTable']={'view':_0xa89b8a[_0x4003a7(0x3e7)](),'fieldsConfig':_0xa89b8a['toJSON'](),'collectionConfig':_0x1667b0[_0x4003a7(0x1d4)](),'isEmpty':_0xa89b8a[_0x4003a7(0x40d)]()};}break;case PivotDisplayDataType['MovePivotField']:{const _0x39dbcc=_0x3b2a39['params']['movePivotField'];if(!_0x39dbcc)return;const {fieldId:_0x9e6591,area:_0x3c4f38,index:_0x43f607}=_0x39dbcc,_0x2d1ac0=this[_0x4003a7(0x2d9)]['getPivotTableConfig'](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x2d1ac0)return;const _0x50e291=this[_0x4003a7(0x2d9)]['getPivotTableInstance'](_0x5eb60b);if(!_0x50e291)return;_0x50e291['startCollectChangeset']();const {area:_0x84ba51,index:_0x53b53e}=_0x50e291[_0x4003a7(0x177)](_0x9e6591);_0x50e291[_0x4003a7(0x406)](_0x9e6591,_0x3c4f38,_0x43f607);if(_0x3c4f38===_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x4003a7(0x26b)]&&_0x50e291[_0x4003a7(0x3af)](_0x9e6591)['getSubtotal']()===void 0x0){const _0x1e2c2c=_0x50e291[_0x4003a7(0x3af)](_0x9e6591);if(_0x1e2c2c&&_0x1e2c2c[_0x4003a7(0x30a)]()===void 0x0){const _0x43bb34=_0x50e291[_0x4003a7(0x190)](_0x9e6591);if(_0x43bb34){const _0x472f1e=_0x43bb34===null||_0x43bb34===void 0x0?void 0x0:_0x43bb34['getFieldDataType']();_0x50e291[_0x4003a7(0x298)](_0x9e6591,_0x472f1e===_univerjs_pro_engine_pivot[_0x4003a7(0x16d)][_0x4003a7(0x266)]?_univerjs_pro_engine_pivot[_0x4003a7(0x175)][_0x4003a7(0x37c)]:_univerjs_pro_engine_pivot[_0x4003a7(0x175)][_0x4003a7(0x331)]);}}}const _0x1b672e=_0x50e291['getValuePosition'](),_0x4c76d2=_0x50e291['getValueIndex'](),_0x278dde=_0x50e291[_0x4003a7(0x3d3)](_univerjs_pro_engine_pivot[_0x4003a7(0x23c)]['Value'])>0x1;if(_0x278dde&&_0x84ba51===_0x3c4f38&&(_0x3c4f38===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x3ed)]&&_0x1b672e===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)][_0x4003a7(0x3ed)]||_0x3c4f38===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x269)]&&_0x1b672e===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)][_0x4003a7(0x269)])){let _0x128754=_0x4c76d2;if(_0x53b53e<=_0x4c76d2)_0x128754--;if(_0x43f607<=_0x4c76d2)_0x128754++;_0x50e291[_0x4003a7(0x198)](_0x1b672e,_0x128754);}else{if(_0x278dde&&(_0x84ba51===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x3ed)]&&_0x1b672e===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)][_0x4003a7(0x3ed)]||_0x84ba51===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x269)]&&_0x1b672e===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)][_0x4003a7(0x269)])){if(_0x4c76d2>=_0x53b53e)_0x50e291['updateValuePosition'](_0x1b672e,_0x4c76d2-0x1);}if(_0x278dde&&(_0x3c4f38===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x3ed)]&&_0x1b672e===_univerjs_pro_engine_pivot['PivotTableValuePositionEnum'][_0x4003a7(0x3ed)]||_0x3c4f38===_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum']['Column']&&_0x1b672e===_univerjs_pro_engine_pivot[_0x4003a7(0x1f0)][_0x4003a7(0x269)])){if(_0x4c76d2>=_0x43f607)_0x50e291[_0x4003a7(0x198)](_0x1b672e,_0x4c76d2+0x1);}}const _0x210e32=_0x50e291[_0x4003a7(0x3e7)](),_0x2afe2f=_0x50e291[_0x4003a7(0x40d)](),_0x1746f1=_0x50e291[_0x4003a7(0x39f)]();_0x1c5114[_0x4003a7(0x409)]={'view':_0x210e32[_0x4003a7(0x1d4)](),'changesets':_0x1746f1,'isEmpty':_0x2afe2f,'pivotTableConfig':_0x2d1ac0};}break;case PivotDisplayDataType['RemovePivotField']:{const _0x3bf4d6=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x3da)];if(!_0x3bf4d6)return;const _0x31aa68=_0x3bf4d6[_0x4003a7(0x19c)],_0x488c49=this['_sheetsPivotDataSourceModel'][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x488c49)return![];const _0x38cb11=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b);if(!_0x38cb11)return![];_0x38cb11['startCollectChangeset']();for(const _0x3a651b of _0x31aa68){const {area:_0x45b949}=_0x38cb11[_0x4003a7(0x177)](_0x3a651b);if(_0x45b949===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x26b)])_0x38cb11[_0x4003a7(0x361)](_0x3a651b);if(_0x45b949===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x3ed)]||_0x45b949===_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x269)])_0x38cb11[_0x4003a7(0x1aa)](_0x3a651b);_0x38cb11[_0x4003a7(0x2ff)](_0x3a651b);}const _0x4c3cf2=_0x38cb11[_0x4003a7(0x40d)](),_0x3e2b23=_0x38cb11[_0x4003a7(0x3e7)]()[_0x4003a7(0x1d4)]();_0x1c5114[_0x4003a7(0x3da)]={'changesets':_0x38cb11[_0x4003a7(0x39f)](),'pivotTableConfig':_0x488c49,'isEmpty':_0x4c3cf2,'view':_0x3e2b23};}break;case PivotDisplayDataType[_0x4003a7(0x2c6)]:{const _0x3edf59=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x166)];if(!_0x3edf59)return;const {tableFieldId:_0x2f2892,items:_0x5ba562,isAll:_0x21257f}=_0x3edf59,_0x7d19c3=this[_0x4003a7(0x2d9)]['getPivotTableInstance'](_0x5eb60b),_0x3fe1d8=this[_0x4003a7(0x2d9)]['getPivotTableConfig'](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x7d19c3||!_0x3fe1d8)return;_0x7d19c3[_0x4003a7(0x3c1)](),_0x7d19c3[_0x4003a7(0x424)](_0x2f2892,{'type':_univerjs_pro_engine_pivot[_0x4003a7(0x157)]['ManualFilter'],'list':_0x5ba562,'isAll':_0x21257f});const _0x3134cc=_0x7d19c3[_0x4003a7(0x40d)]();_0x1c5114['setPivotFilter']={'view':_0x7d19c3[_0x4003a7(0x3e7)]()[_0x4003a7(0x1d4)](),'changesets':_0x7d19c3[_0x4003a7(0x39f)](),'isEmpty':_0x3134cc,'pivotTableConfig':_0x3fe1d8};}break;case PivotDisplayDataType['SetValuePivotFilter']:{const _0x1fdfec=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x243)];if(!_0x1fdfec)return;const {tableFieldId:_0x57cd81,filterInfo:_0x304098}=_0x1fdfec,_0x19e896=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b),_0x12a2d2=this[_0x4003a7(0x2d9)][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x19e896||!_0x12a2d2)return;_0x19e896['startCollectChangeset'](),_0x19e896[_0x4003a7(0x2ec)](_0x57cd81,_0x304098);const _0x53fbf=_0x19e896[_0x4003a7(0x40d)]();_0x1c5114[_0x4003a7(0x243)]={'view':_0x19e896[_0x4003a7(0x3e7)]()[_0x4003a7(0x1d4)](),'changesets':_0x19e896[_0x4003a7(0x39f)](),'isEmpty':_0x53fbf,'pivotTableConfig':_0x12a2d2};}break;case PivotDisplayDataType['SetPivotSort']:{const _0x3bf1bb=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x37b)];if(!_0x3bf1bb)return;const {tableFieldId:_0x5df1c4,info:_0x1f8d84}=_0x3bf1bb,_0x29fbeb=this[_0x4003a7(0x2d9)]['getPivotTableInstance'](_0x5eb60b),_0x3d3589=this['_sheetsPivotDataSourceModel'][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x29fbeb||!_0x3d3589)return;_0x29fbeb[_0x4003a7(0x3c1)](),_0x29fbeb['setSortInfo'](_0x5df1c4,_0x1f8d84);const _0x4bb02e=_0x29fbeb['isEmpty']();_0x1c5114[_0x4003a7(0x37b)]={'view':_0x29fbeb[_0x4003a7(0x3e7)]()[_0x4003a7(0x1d4)](),'changesets':_0x29fbeb['endCollectChangeset'](),'isEmpty':_0x4bb02e,'pivotTableConfig':_0x3d3589};}break;case PivotDisplayDataType[_0x4003a7(0x210)]:{const _0x533bf6=_0x3b2a39['params'][_0x4003a7(0x328)];if(!_0x533bf6)return;const {tableFieldId:_0x49ee83,displayName:_0x537f51,subtotalType:_0x594d75,format:_0x422e8a}=_0x533bf6,_0x5e1019=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b),_0x1406f8=this[_0x4003a7(0x2d9)][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x5e1019||!_0x1406f8)return;_0x5e1019[_0x4003a7(0x3c1)]();if(_0x537f51!==void 0x0)_0x5e1019[_0x4003a7(0x311)](_0x49ee83,_0x537f51);if(_0x594d75!==void 0x0)_0x5e1019[_0x4003a7(0x298)](_0x49ee83,_0x594d75);if(_0x422e8a!==void 0x0)_0x5e1019[_0x4003a7(0x1c5)](_0x49ee83,_0x422e8a);const _0x5746f3=_0x5e1019[_0x4003a7(0x40d)](),_0x116225=_0x5e1019['query']()['toJSON']();_0x1c5114[_0x4003a7(0x328)]={'changesets':_0x5e1019[_0x4003a7(0x39f)](),'pivotTableConfig':_0x1406f8,'isEmpty':_0x5746f3,'view':_0x116225};}break;case PivotDisplayDataType['UpdatePivotSource']:{const _0x3de4e8=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x261)];if(!_0x3de4e8)return;const {dataRangeInfo:_0x2e0f7b,unitId:_0x92a9bf,subUnitId:_0x5101a5}=_0x3de4e8,_0x24bb2c=this[_0x4003a7(0x2d9)][_0x4003a7(0x32a)](_0x92a9bf,_0x5101a5,_0x5eb60b),_0x437c40=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b);if(!this[_0x4003a7(0x2d9)]['getCollection'](_0x92a9bf,_0x5eb60b))return;if(!_0x437c40||!_0x24bb2c)return;const _0xdfae9b=this[_0x4003a7(0x2d9)]['getUpdateRangeDeleteIds'](_0x92a9bf,_0x5eb60b,_0x2e0f7b),_0x3a2dba=this[_0x4003a7(0x2d9)][_0x4003a7(0x329)](_0x92a9bf,_0x5eb60b)[_0x4003a7(0x1d4)](),{collection:_0x45c507}=this[_0x4003a7(0x2d9)][_0x4003a7(0x179)]({'unitId':_0x2e0f7b[_0x4003a7(0x30d)],'sheetName':_0x2e0f7b[_0x4003a7(0x3b7)],'subUnitId':_0x2e0f7b[_0x4003a7(0x2a1)],'range':_0x2e0f7b[_0x4003a7(0x30e)]}),_0x2dda71=_0x45c507[_0x4003a7(0x1d4)]();_0x437c40[_0x4003a7(0x3c1)]();const _0x25a1c9=this['_sheetsPivotDataSourceModel'][_0x4003a7(0x2d3)](_0x92a9bf)['getAutoDisplayNameFunction']()||_univerjs_pro_engine_pivot['getAutoDisplayName'];_0x437c40[_0x4003a7(0x132)](_0x14bf14=>{const _0x4e5917=_0x4003a7,_0x1b9086=_0x14bf14[_0x4e5917(0x162)]();if(!_0x45c507[_0x4e5917(0x141)](_0x1b9086)){const _0x173d28=_0x45c507[_0x4e5917(0x236)](_0x14bf14[_0x4e5917(0x140)]());if(_0x173d28){_0x437c40['updateFieldSourceInfo'](_0x14bf14[_0x4e5917(0x1ef)](),_0x173d28[_0x4e5917(0x1c2)](),_0x173d28[_0x4e5917(0x1ef)]());const {area:_0x410c74}=_0x437c40[_0x4e5917(0x177)](_0x14bf14['getId']());let _0x2f8f14=_0x14bf14[_0x4e5917(0x140)]();const _0x2f416f=_0x14bf14[_0x4e5917(0x2b1)]();if(_0x410c74===_univerjs_pro_engine_pivot[_0x4e5917(0x23c)]['Value']){const _0x370891=_0x14bf14[_0x4e5917(0x30a)]();_0x2f8f14=_0x25a1c9(_0x173d28[_0x4e5917(0x1c2)](),_0x370891);}if(_0x2f416f!==_0x2f8f14)_0x437c40[_0x4e5917(0x311)](_0x14bf14[_0x4e5917(0x1ef)](),_0x2f8f14);}else _0x437c40[_0x4e5917(0x2ff)](_0x14bf14[_0x4e5917(0x1ef)]());}});const _0x8554d7=_0x437c40['isEmpty']();_0x1c5114[_0x4003a7(0x261)]={'view':_0x437c40[_0x4003a7(0x3e7)]()['toJSON'](),'changesets':_0x437c40['endCollectChangeset'](),'isEmpty':_0x8554d7,'pivotTableConfig':_0x24bb2c,'collectionConfig':_0x2dda71,'oldCollectionConfig':_0x3a2dba,'deleteIds':_0xdfae9b};}break;case PivotDisplayDataType[_0x4003a7(0x36b)]:{const _0x22dd11=_0x3b2a39['params'][_0x4003a7(0x198)];if(!_0x22dd11)return;const {position:_0x40c321,index:_0x3858f5}=_0x22dd11,_0x1f5f70=this[_0x4003a7(0x2d9)]['getPivotTableConfig'](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x1f5f70)return![];const _0x2799cd=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b);if(!_0x2799cd)return![];_0x2799cd[_0x4003a7(0x3c1)](),_0x2799cd['updateValuePosition'](_0x40c321,_0x3858f5);const _0x49f731=_0x2799cd[_0x4003a7(0x40d)](),_0x38a113=_0x2799cd[_0x4003a7(0x3e7)]()['toJSON']();_0x1c5114[_0x4003a7(0x198)]={'changesets':_0x2799cd[_0x4003a7(0x39f)](),'pivotTableConfig':_0x1f5f70,'isEmpty':_0x49f731,'view':_0x38a113};}break;case PivotDisplayDataType['SetPivotCollapse']:{const _0x259b0c=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x2ea)];if(!_0x259b0c)return;const {tableFieldId:_0x52ef32,collapse:_0x1af7ab,item:_0x18fad2}=_0x259b0c,_0x15bea3=this[_0x4003a7(0x2d9)]['getPivotTableInstance'](_0x5eb60b),_0x52962d=this[_0x4003a7(0x2d9)]['getPivotTableConfig'](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x15bea3||!_0x52962d)return;_0x15bea3[_0x4003a7(0x3c1)](),_0x15bea3['setCollapse'](_0x52ef32,_0x1af7ab,_0x18fad2);const _0x5dba5e=_0x15bea3[_0x4003a7(0x40d)]();_0x1c5114['setPivotCollapse']={'view':_0x15bea3['query']()[_0x4003a7(0x1d4)](),'isEmpty':_0x5dba5e,'pivotTableConfig':_0x52962d,'changesets':_0x15bea3[_0x4003a7(0x39f)]()};}break;case PivotDisplayDataType[_0x4003a7(0x3c7)]:{const _0x333ad5=_0x3b2a39[_0x4003a7(0x35e)][_0x4003a7(0x37d)];if(!_0x333ad5)return;const {pivotTableConfig:_0x58d643}=_0x333ad5,_0xeb62e2=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b),_0x7fa8b3=this['_sheetsPivotDataSourceModel'][_0x4003a7(0x32a)](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0xeb62e2||!_0x7fa8b3)return;_0xeb62e2[_0x4003a7(0x3c1)](),setConfigToPivotTable(_0xeb62e2,_0x58d643);const _0x36dca5=_0xeb62e2[_0x4003a7(0x40d)](),_0xb2b0dd=_0xeb62e2['query']()[_0x4003a7(0x1d4)](),_0x889e71=_0xeb62e2[_0x4003a7(0x39f)]();_0x1c5114[_0x4003a7(0x37d)]={'view':_0xb2b0dd,'isEmpty':_0x36dca5,'pivotTableConfig':{..._0x7fa8b3,'fieldsConfig':_0xeb62e2[_0x4003a7(0x1d4)]()},'changesets':_0x889e71};}break;case PivotDisplayDataType['ResetPivotTable']:{const _0x19ec41=_0x3b2a39['params'][_0x4003a7(0x3de)];if(!_0x19ec41)return;const _0x13cd46=this[_0x4003a7(0x2d9)][_0x4003a7(0x407)](_0x5eb60b),_0x265948=this['_sheetsPivotDataSourceModel']['getPivotTableConfig'](_0x3eff04,_0x2f8d13,_0x5eb60b);if(!_0x13cd46||!_0x265948)return;_0x13cd46[_0x4003a7(0x3c1)](),resetPivotTable(_0x13cd46,_0x19ec41[_0x4003a7(0x160)]);const _0x1f145d=_0x13cd46[_0x4003a7(0x3e7)]()['toJSON'](),_0x5cb328=_0x13cd46['endCollectChangeset']();_0x1c5114[_0x4003a7(0x3de)]={'view':_0x1f145d,'isEmpty':!![],'pivotTableConfig':{..._0x265948,'fieldsConfig':_0x13cd46[_0x4003a7(0x1d4)]()},'changesets':_0x5cb328};}break;case PivotDisplayDataType[_0x4003a7(0x253)]:{const _0x36e14d=_0x3b2a39[_0x4003a7(0x35e)]['addPivotTableWithConfig'];if(!_0x36e14d)return;const _0x215abc=_0x36e14d['sourceRangeInfo'],_0x32ff96=_0x36e14d[_0x4003a7(0x1e1)],{collection:_0x3c8c19}=this['_sheetsPivotDataSourceModel'][_0x4003a7(0x179)]({'unitId':_0x215abc[_0x4003a7(0x30d)],'sheetName':_0x215abc[_0x4003a7(0x3b7)],'subUnitId':_0x215abc[_0x4003a7(0x2a1)],'range':_0x215abc[_0x4003a7(0x30e)]}),_0x4b569e=new _univerjs_pro_engine_pivot['PivotTable'](_0x3c8c19,void 0x0,_0x32ff96),_0x4c3e6f=_0x3c8c19[_0x4003a7(0x379)](),{rows:_0x2ae982,columns:_0x27d50b,filters:_0x62c010,values:_0xab883a}=_0x36e14d[_0x4003a7(0x352)];_0x4b569e[_0x4003a7(0x3c1)]();for(const {field:_0x3ee3b9,selectedItems:_0x538964}of _0x2ae982||[]){const _0x204f41=_0x4c3e6f[_0x3ee3b9];if(_0x204f41){const _0x58f332=_0x4b569e[_0x4003a7(0x13f)](_0x204f41,_univerjs_pro_engine_pivot[_0x4003a7(0x23c)][_0x4003a7(0x3ed)]);if(_0x538964&&_0x58f332)_0x4b569e[_0x4003a7(0x424)](_0x58f332['getId'](),{'type':_univerjs_pro_engine_pivot[_0x4003a7(0x157)][_0x4003a7(0x39d)],'list':_0x538964,'isAll':![]});}}for(const {field:_0x237020,selectedItems:_0xd9e040}of _0x27d50b||[]){const _0x51a5e6=_0x4c3e6f[_0x237020];if(_0x51a5e6){const _0x40c0d9=_0x4b569e[_0x4003a7(0x13f)](_0x51a5e6,_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x4003a7(0x269)]);if(_0xd9e040&&_0x40c0d9)_0x4b569e[_0x4003a7(0x424)](_0x40c0d9['getId'](),{'type':_univerjs_pro_engine_pivot[_0x4003a7(0x157)]['ManualFilter'],'list':_0xd9e040,'isAll':![]});}}for(const {field:_0x179968,selectedItems:_0x4c7606}of _0x62c010||[]){const _0x58b7fa=_0x4c3e6f[_0x179968];if(_0x58b7fa){const _0x268843=_0x4b569e[_0x4003a7(0x13f)](_0x58b7fa,_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x4003a7(0x341)]);if(_0x4c7606&&_0x268843)_0x4b569e[_0x4003a7(0x424)](_0x268843[_0x4003a7(0x1ef)](),{'type':_univerjs_pro_engine_pivot[_0x4003a7(0x157)][_0x4003a7(0x39d)],'list':_0x4c7606,'isAll':![]});}}for(const {field:_0x441736,subTotalType:_0x5838f7,formatString:_0x26963b}of _0xab883a||[]){const _0x20c165=_0x3c8c19[_0x4003a7(0x25b)](_0x4c3e6f[_0x441736]);if(!_0x20c165)continue;const _0x590fa7=_0x4c3e6f[_0x441736];if(_0x590fa7){const _0x571b09=_0x4b569e[_0x4003a7(0x13f)](_0x590fa7,_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x4003a7(0x26b)]);if(_0x571b09){if(_0x5838f7!==void 0x0){_0x4b569e['setSubtotalType'](_0x571b09[_0x4003a7(0x1ef)](),_0x5838f7);const _0x3426dc=(this['_sheetsPivotDataSourceModel'][_0x4003a7(0x2d3)](_0x215abc['unitId'])[_0x4003a7(0x294)]()||_univerjs_pro_engine_pivot['getAutoDisplayName'])(_0x3c8c19['getDisplayName'](_0x590fa7),_0x5838f7);_0x4b569e[_0x4003a7(0x311)](_0x571b09[_0x4003a7(0x1ef)](),_0x3426dc);}else{if(_0x20c165){const _0x9668cb=_0x20c165===null||_0x20c165===void 0x0?void 0x0:_0x20c165[_0x4003a7(0x1ba)]();_0x4b569e[_0x4003a7(0x298)](_0x571b09[_0x4003a7(0x1ef)](),_0x9668cb===_univerjs_pro_engine_pivot[_0x4003a7(0x16d)][_0x4003a7(0x266)]?_univerjs_pro_engine_pivot[_0x4003a7(0x175)][_0x4003a7(0x37c)]:_univerjs_pro_engine_pivot[_0x4003a7(0x175)][_0x4003a7(0x331)]);}}if(_0x26963b)_0x4b569e[_0x4003a7(0x1c5)](_0x571b09['getId'](),_0x26963b);}}}const _0x2ff953=_0x4b569e['query'](),_0x5cca4e=_0x4b569e[_0x4003a7(0x1d4)](),_0x3b04ac=_0x4b569e[_0x4003a7(0x40d)](),_0x107dfa=_0x4b569e['endCollectChangeset']();_0x1c5114['addPivotTableWithConfig']={'view':_0x2ff953,'fieldsConfig':_0x5cca4e,'collectionConfig':_0x3c8c19[_0x4003a7(0x1d4)](),'isEmpty':_0x3b04ac,'changesets':_0x107dfa};}break;case PivotDisplayDataType[_0x4003a7(0x221)]:{const _0x5c96fc=getPivotDrillDownData(this[_0x4003a7(0x2ee)],_0x3b2a39);if(!_0x5c96fc)return;const {range:_0x18675a,sourceSubUnitId:_0x2289ea,sourceUnitId:_0xa0094a,formatMap:_0x551d3a,indexes:_0x488bf9}=_0x5c96fc;_0x1c5114[_0x4003a7(0x3d5)]={'range':_0x18675a,'sourceSubUnitId':_0x2289ea,'sourceUnitId':_0xa0094a,'formatMap':_0x551d3a,'indexes':_0x488bf9};}break;}this['_commandService'][_0x4003a7(0x37a)](SendPivotDataLocalMutation['id'],{'version':_0x3b2a39[_0x4003a7(0x345)],'result':_0x1c5114},{'onlyLocal':!![]});}));}[_0x5b3260(0x28e)](){const _0x5d036f=_0x5b3260;this[_0x5d036f(0x1bf)](this[_0x5d036f(0x389)][_0x5d036f(0x24e)](_0x4bbf22=>{const _0x218441=_0x5d036f;if(_0x4bbf22['id']!==SendInitPivotTextLocalMutation['id'])return;const _0x470eb5=_0x4bbf22[_0x218441(0x35e)];return this[_0x218441(0x2d9)][_0x218441(0x251)](_0x470eb5[_0x218441(0x2c4)]),!![];}));}['_subjectCollectionChange'](){const _0x567fac=_0x5b3260;this[_0x567fac(0x2d9)]['collectionChange$'][_0x567fac(0x276)](_0x5a4287=>{const _0x3c5009=_0x567fac;switch(_0x5a4287[_0x3c5009(0x3d0)]){case CollectionChangeEnum[_0x3c5009(0x1a8)]:if(_0x5a4287[_0x3c5009(0x309)]&&_0x5a4287[_0x3c5009(0x226)])this['handleSourceRangeChange'](_0x5a4287['token'],_0x5a4287[_0x3c5009(0x309)],_0x5a4287[_0x3c5009(0x226)]);break;case CollectionChangeEnum[_0x3c5009(0x384)]:{const {unitId:_0x5eb933,subUnitId:_0x1d9cb0,token:_0x1c040f}=_0x5a4287;if(_0x5eb933&&_0x1d9cb0&&_0x1c040f)this['removeSourceRangeChange'](_0x5eb933,_0x1d9cb0,_0x1c040f);}break;case CollectionChangeEnum[_0x3c5009(0x33a)]:{const {token:_0x4a6cbe,oldSourceRangeInfo:_0x3818ff,dataRangeInfo:_0x518022,targetCellInfo:_0x228813}=_0x5a4287,{unitId:_0x268730,subUnitId:_0x486e43}=_0x3818ff||{};if(_0x268730&&_0x486e43&&_0x4a6cbe)this['removeSourceRangeChange'](_0x268730,_0x486e43,_0x4a6cbe);if(_0x518022&&_0x228813)this[_0x3c5009(0x18e)](_0x4a6cbe,_0x518022,_0x228813);}break;}});}[_0x5b3260(0x28d)](){const _0x2862a9=_0x5b3260;this['_sheetsPivotDataSourceModel']['fieldsCollectionChange$'][_0x2862a9(0x276)](_0x581b19=>{const _0x223d9a=_0x2862a9;Object[_0x223d9a(0x2da)](_0x581b19)[_0x223d9a(0x21b)](_0x38abbc=>{const _0x117ab0=_0x223d9a,_0x4ae077=this[_0x117ab0(0x2d9)][_0x117ab0(0x2d6)](_0x38abbc);if(_0x4ae077){const _0x572110=this['_sheetsPivotDataSourceModel'][_0x117ab0(0x32a)](_0x4ae077===null||_0x4ae077===void 0x0?void 0x0:_0x4ae077[_0x117ab0(0x30d)],_0x4ae077===null||_0x4ae077===void 0x0?void 0x0:_0x4ae077[_0x117ab0(0x2a1)],_0x38abbc);_0x572110&&(this[_0x117ab0(0x18e)](_0x38abbc,_0x572110[_0x117ab0(0x3d4)],_0x572110[_0x117ab0(0x226)]),this[_0x117ab0(0x1a4)]([{'unitId':_0x4ae077[_0x117ab0(0x30d)],'subUnitId':_0x4ae077[_0x117ab0(0x2a1)],'token':_0x38abbc}]));}});});}[_0x5b3260(0x287)](){const _0x5b932c=_0x5b3260;this[_0x5b932c(0x2d9)][_0x5b932c(0x199)]['subscribe'](_0x16bff3=>{const _0x32d159=_0x5b932c,{unitId:_0x2b6f69,subUnitId:_0x2b019a,pivotTableId:_0x3634df}=_0x16bff3;if(_0x2b6f69&&_0x2b019a&&_0x3634df)this[_0x32d159(0x1a4)]([{'unitId':_0x2b6f69,'subUnitId':_0x2b019a,'token':_0x3634df}]);});}[_0x5b3260(0x1a4)](_0x3dfbc1){const _0x100b68=_0x5b3260,_0x5263ff={};_0x3dfbc1[_0x100b68(0x21b)](_0x42fe43=>{var _0x1cd4be,_0x1dfd67;const {unitId:_0x3ebebf,subUnitId:_0x1f9716,token:_0x28bb58}=_0x42fe43;_0x5263ff[_0x3ebebf]=(_0x1cd4be=_0x5263ff[_0x3ebebf])!==null&&_0x1cd4be!==void 0x0?_0x1cd4be:{},_0x5263ff[_0x3ebebf][_0x1f9716]=(_0x1dfd67=_0x5263ff[_0x3ebebf][_0x1f9716])!==null&&_0x1dfd67!==void 0x0?_0x1dfd67:{},_0x5263ff[_0x3ebebf][_0x1f9716][_0x28bb58]=!![];}),this[_0x100b68(0x389)][_0x100b68(0x37a)](PivotTableViewDirtyMarkOperation['id'],_0x5263ff);}[_0x5b3260(0x428)](_0x11c281,_0x43e664,_0x52148e){const _0x2c87a4=_0x5b3260;this['_featureCalculationManagerService'][_0x2c87a4(0x2b4)](_0x11c281,_0x43e664,[_0x52148e]);}[_0x5b3260(0x18e)](_0x1d026a,_0x55f05c,_0xb2321d){const _0x4919bf=_0x5b3260,{unitId:_0x346c8d,subUnitId:_0x5f4dc3}=_0x55f05c;if(this['_featureCalculationManagerService'][_0x4919bf(0x194)](_0xb2321d[_0x4919bf(0x30d)],_0xb2321d['subUnitId'],_0x1d026a))this[_0x4919bf(0x428)](_0x346c8d,_0x5f4dc3,_0x1d026a);const _0x4510dd={'sheetId':_0x5f4dc3,..._0x55f05c};this[_0x4919bf(0x2af)][_0x4919bf(0x375)](_0xb2321d[_0x4919bf(0x30d)],_0xb2321d['subUnitId'],_0x1d026a,{'unitId':_0xb2321d['unitId'],'subUnitId':_0xb2321d[_0x4919bf(0x2a1)],'dependencyRanges':[_0x4510dd],'getDirtyData':(_0x1a5aea,_0x14cbb4)=>{const _0x39534a=_0x4919bf,_0x4a60ae=this[_0x39534a(0x2d9)],_0x4f0619=_0x4a60ae[_0x39534a(0x2d6)](_0x1d026a);if(!_0x4f0619)return getEmptyPivotDirtyViewInfo();const {unitId:_0xf4df1e,subUnitId:_0x4d9327}=_0x4f0619,_0xc26b71=getDirtyColumn(_0x1a5aea,_0x14cbb4,_0x55f05c);if(_0xc26b71[_0x39534a(0x2b9)]>0x0){const _0xff0f24=_0x4a60ae[_0x39534a(0x329)](_0x346c8d,_0x1d026a),_0x306d86=_0xff0f24[_0x39534a(0x379)](),_0x46313f=this[_0x39534a(0x293)](_0x55f05c[_0x39534a(0x30d)],_0x55f05c['subUnitId'],_0x14cbb4),_0x2e8704={},_0x8189e4=this[_0x39534a(0x2d9)][_0x39534a(0x2d3)](_0xf4df1e)[_0x39534a(0x294)]()||_univerjs_pro_engine_pivot[_0x39534a(0x272)],_0x35f972=[];for(const _0x4efd21 of _0xc26b71){const _0x588f87=_0x4efd21-(_0x55f05c[_0x39534a(0x30e)]['startColumn']||0x0),_0xd868f1=_0x306d86[_0x588f87];_0x35f972[_0x39534a(0x154)](_0xd868f1),_0x2e8704[_0xd868f1]=_0xff0f24[_0x39534a(0x25b)](_0xd868f1)['getName'](),_0x4a60ae[_0x39534a(0x2d3)](_0x346c8d)[_0x39534a(0x33b)](_0xd868f1,_0x55f05c,_0x588f87,_0x46313f);}_0xff0f24[_0x39534a(0x327)](_0x35f972)[_0x39534a(0x21b)](_0x398dde=>{const _0x198927=_0x39534a,[_0x1d988a,_0x2f372b]=_0x398dde,_0x3d8ad1=_0xff0f24[_0x198927(0x25b)](_0x1d988a),_0x27b931=_0xff0f24[_0x198927(0x25b)](_0x2f372b);if(_0x3d8ad1&&_0x27b931)_0x3d8ad1['refreshGroupField'](_0x27b931);}),_0xff0f24[_0x39534a(0x410)]();const _0x3a9199=_0x4a60ae['getPivotTableInstance'](_0x1d026a);if(_0x3a9199){updatePivotTableFieldName(_0x3a9199,_0x2e8704,_0x8189e4),_0x3a9199[_0x39534a(0x14c)](!![]);const _0x31f520=_0x3a9199[_0x39534a(0x3e7)](),_0x5a18d1=_0x4a60ae[_0x39534a(0x32a)](_0xf4df1e,_0x4d9327,_0x1d026a),_0x5b5be6=_0x4a60ae['getDataFieldManager'](_0x346c8d)[_0x39534a(0x1d4)]();_0x4a60ae[_0x39534a(0x3dd)](_0xf4df1e,_0x4d9327,PivotTableOperationEnum[_0x39534a(0x178)],_0x1d026a,_0x31f520,_0x5a18d1,_0x5b5be6,!![]);}}return this['getDirtyInfo'](_0xf4df1e,_0x4d9327,_0x1d026a);}});}['getMatrixFromRunTimeData'](_0x582d82,_0xff76b7,_0x53cab6){var _0x1b3b07,_0x5e75f7;const {arrayFormulaCellData:_0x376ac9,unitData:_0x2ef975}=_0x53cab6;return{'arrayFormulaCellDataMatrix':_0x376ac9===null||_0x376ac9===void 0x0||(_0x1b3b07=_0x376ac9[_0x582d82])===null||_0x1b3b07===void 0x0?void 0x0:_0x1b3b07[_0xff76b7],'unitDataMatrix':_0x2ef975===null||_0x2ef975===void 0x0||(_0x5e75f7=_0x2ef975[_0x582d82])===null||_0x5e75f7===void 0x0?void 0x0:_0x5e75f7[_0xff76b7]};}[_0x5b3260(0x325)](_0x348e35,_0x4c6e47,_0x2b3716){const _0x65056d=_0x5b3260,_0x296ad9=this[_0x65056d(0x2d9)][_0x65056d(0x313)](_0x348e35,_0x4c6e47,_0x2b3716),_0x102f64=[],_0x4b612b=new _univerjs_core[(_0x65056d(0x1e5))]();if(_0x296ad9){const {rangeCache:_0x4adfbd,matrix:_0x1bdfe3,oldRangeCache:_0xd8d400,oldMatrix:_0x2fa936}=_0x296ad9,_0x2670a0=unionPivotViewRange(_0xd8d400),_0x2c5da0=unionPivotViewRange(_0x4adfbd);_0x102f64[_0x65056d(0x154)](..._0x2c5da0,..._0x2670a0);if(_0x2fa936&&_0xd8d400)_0x2670a0[_0x65056d(0x21b)](_0x21c3f9=>{const _0x4d27d0=_0x65056d;for(let _0x30cd49=_0x21c3f9['startRow'];_0x30cd49<=_0x21c3f9[_0x4d27d0(0x249)];_0x30cd49++)for(let _0x35a8cd=_0x21c3f9[_0x4d27d0(0x29c)];_0x35a8cd<=_0x21c3f9[_0x4d27d0(0x2bc)];_0x35a8cd++)_0x4b612b[_0x4d27d0(0x391)](_0x30cd49,_0x35a8cd);});if(_0x1bdfe3&&_0x2c5da0)_0x2c5da0[_0x65056d(0x21b)](_0x5f9db9=>{const _0x1c58b3=_0x65056d;for(let _0x11eaa8=_0x5f9db9['startRow'];_0x11eaa8<=_0x5f9db9[_0x1c58b3(0x249)];_0x11eaa8++)for(let _0x3d1ea5=_0x5f9db9[_0x1c58b3(0x29c)];_0x3d1ea5<=_0x5f9db9['endColumn'];_0x3d1ea5++)_0x4b612b['setValue'](_0x11eaa8,_0x3d1ea5,_0x1bdfe3[_0x1c58b3(0x323)](_0x11eaa8,_0x3d1ea5));});}const _0x13661d={};return _0x13661d[_0x348e35]={[_0x4c6e47]:getUniqueRange(_0x102f64)},{'runtimeCellData':{[_0x348e35]:{[_0x4c6e47]:_0x4b612b}},'dirtyRanges':_0x13661d};}['dispose'](){}};PivotCalculatorController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(SheetsPivotDataSourceModel)),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_engine_formula[_0x5b3260(0x26a)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x151)])),__decorateParam(0x3,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_engine_formula[_0x5b3260(0x36d)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x1e6)]))],PivotCalculatorController);let SheetsPivotClearController=class SheetsPivotClearController extends _univerjs_core['Disposable']{constructor(_0xe95936,_0x5e2eff,_0x1aae52,_0x5abc0d){const _0x30a1e8=_0x5b3260;super(),this[_0x30a1e8(0x2ac)]=_0xe95936,this[_0x30a1e8(0x392)]=_0x5e2eff,this[_0x30a1e8(0x2dd)]=_0x1aae52,this[_0x30a1e8(0x2f0)]=_0x5abc0d,_defineProperty(this,_0x30a1e8(0x265),new _univerjs_core['DisposableCollection']()),this[_0x30a1e8(0x1b6)]();}['_initClearSelectionCommandInterceptor'](){const _0x20d23c=_0x5b3260;this[_0x20d23c(0x1bf)](this[_0x20d23c(0x392)][_0x20d23c(0x40f)]({'getMutations':_0x196387=>{const _0x245e0a=_0x20d23c;if(_0x196387['id']===_univerjs_sheets[_0x245e0a(0x3f1)]['id']||_0x196387['id']===_univerjs_sheets[_0x245e0a(0x1e9)]['id']){const _0xeba8d0=[],_0xa2c71c=[],_0x9f0e1a=this['_sheetsSelectionsService'][_0x245e0a(0x1e8)]()[_0x245e0a(0x3c3)](_0x42c717=>_0x42c717[_0x245e0a(0x30e)]),_0x14ad58=(0x0,_univerjs_sheets[_0x245e0a(0x2f9)])(this[_0x245e0a(0x2ac)],_0x196387[_0x245e0a(0x35e)]);if(!_0x14ad58)return{'redos':[],'undos':[]};const {unitId:_0x54c07c,subUnitId:_0x3db728}=_0x14ad58,_0x183d6d={},_0x27d1fa=this[_0x245e0a(0x2f0)][_0x245e0a(0x3b3)](_0x54c07c,_0x3db728);if(_0x27d1fa===null||_0x27d1fa===void 0x0?void 0x0:_0x27d1fa[_0x245e0a(0x275)])for(const [_0x2a800f,_0xdccfff]of _0x27d1fa){const {unitId:_0x42ed54,subUnitId:_0xa262a8,row:_0x584f1e,col:_0x2fd2b0}=_0xdccfff[_0x245e0a(0x226)];if(_0x42ed54===_0x14ad58[_0x245e0a(0x30d)]&&_0xa262a8===_0x14ad58['subUnitId'])_0x183d6d[_0x584f1e+'-'+_0x2fd2b0]=_0x2a800f;}if(_0x9f0e1a&&_0x14ad58)_0x9f0e1a[_0x245e0a(0x21b)](_0x1189e8=>{const _0x20ec8e=_0x245e0a;_univerjs_core[_0x20ec8e(0x204)][_0x20ec8e(0x271)](_0x1189e8,(_0x1eb9a5,_0x97637a)=>{const _0x5e7b3a=_0x20ec8e,_0x4cc742=_0x1eb9a5+'-'+_0x97637a;if(_0x183d6d[_0x4cc742]){const _0x2c7596=_0x183d6d[_0x4cc742];_0xeba8d0[_0x5e7b3a(0x154)]({'id':RemovePivotTableMutation['id'],'params':{'unitId':_0x54c07c,'subUnitId':_0x3db728,'pivotTableId':_0x2c7596}});const _0x18d8cb=this['_sheetsPivotTableConfigModel'][_0x5e7b3a(0x329)](_0x54c07c,_0x2c7596),_0x265a6d=this[_0x5e7b3a(0x2f0)]['getPivotTableConfig'](_0x54c07c,_0x3db728,_0x2c7596);_0xa2c71c['push']({'id':AddPivotTableMutation['id'],'params':{'unitId':_0x54c07c,'subUnitId':_0x3db728,'pivotTableId':_0x2c7596,'pivotTableConfig':_0x265a6d,'collectionConfig':_0x18d8cb}});}});});return{'redos':_0xeba8d0,'undos':_0xa2c71c};}return{'redos':[],'undos':[]};}}));}};SheetsPivotClearController=__decorate([__decorateParam(0x0,_univerjs_core[_0x5b3260(0x13e)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_sheets[_0x5b3260(0x35d)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_sheets[_0x5b3260(0x2bb)])),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(SheetsPivotTableConfigModel))],SheetsPivotClearController);function _0x461f(){const _0xf66fce=['AddPivotTable','_injector','3062936wVNESX','_sheetsPivotTableConfigModel','sheet.command.set-pivot-collapse','sheet.command.reset-pivot-fields-config','getRefRangeMutationsByMoveRange','batch','originalFieldId','paths','format','Grand\x20Total','getSheetCommandTarget','_configService','iterateFieldDim','getDataFieldItemInfo','Values','getConfig','removeField','_initConfig','cellValue','merge','RemovePivotTableMutation','sheets-pivot.emptyPivot.column','subTotalStyle','filterFields','COLUMN','needSameDeleteModel','dataRangeInfo','getSubtotal','_host','getFieldListByArea','unitId','range','getPivotDirtyViewInfo','sheet.command.update-pivot-table-source-range','renameField','getSheets','getViewData','getRangeStartEndInfo','_init','dataFieldsCollection','SetSortInfo','cellToRange','getFullYear','isBottomTotal','undefined','SetRangeValuesMutation','dataFieldManagerConfig','setRangeValueUndoMutation','contains','getSheetId','rowCount','getLastRow','getValue','_generateUniqueVersion','getDirtyInfo','isErrorValue','getGroupFieldsInfoByIds','setPivotSetting','getCollection','getPivotTableConfig','sheets-pivot.dateGroup.yearMonthDate','_initRegisterCommand','subtotal','_requestResolvers','includes','getLicenseInfo','count','sheet.mutation.set-pivot-option','setValue','_queryingMap','_markDirty$','DEFAULT_WORKSHEET_COLUMN_COUNT','generateSetRangeValueMutations','sheet.mutation.pivot-update-field-position','IActiveDirtyManagerService','update','refreshDataField','_viewData','HourMinute','queryDirtyPivotTable','PIVOT_MUTATION_GENERATE','sheet.mutation.add-pivot-field','Filter','refreshData','getDate','sheet.command.remove-pivot-field','version','getPivotInfoByLicense','Add','MovePivotFieldCommand','name','_exclusiveRangeService','getIntersects','getDataFieldByRangeKey','Min\x20of\x20','sheets-pivot.dateGroup.hourMinute','rangeKey','cornerInfo','filterInfo','pivotTableIndexConfig','dataStyle','Inject','Subject','SetCollapse','UpdateValuePositionMutation','getPivotTableCellData','getValueFilterInfos','addDataFieldWithoutUnitInfo','sheets-pivot.cellDateGroupDisplay.quarter','redos','SheetInterceptorService','params','updateConfigCache','values','removeValueFilterInfoByValueFieldId','UpdateDateGroupCommand','dataFields','function','InterceptorManager','dispose','charCodeAt','updateDataFieldsCollection','setConfig','_ensurePivotTableMatrixInfo','UpdateValuePosition','sheets-pivot.dateGroup.monthDate','GlobalComputingStatusService','getFilterInfo','SetOptions','SetPivotValueFilterMutation','setRangeKeyMap','PivotDateGroupFieldDateTypeEnum','SetPivotCollapse','displayName','register','_initUnitDisposed','addField','sheet.mutation.add-group-collection','getFieldIds','executeCommand','setPivotSort','sum','setPivotTableConfig','_textInfo','updateViewData','valueFilter','generateNullCell','getTextInfo','_initGlobalComputed','delete','canUsePivot','SetPivotCollapseCommand','_sheetsPivotTableAdaptorModel','_ensurePivotItemRenderInfoCache','_commandService','updateRenderCache','getPivotTableIdByCell','lastCol','node','sheet.mutation.pivot-update-value-position','setDateType','rgb(240,241,243)','realDeleteValue','_sheetInterceptorService','sheets-pivot.columnName','dimension','getOriginFieldId','isDateGroupFieldJSON','oldRangeInfo','_viewUpdate$','valuePosition','getColCount','DisposableCollection','getFontStyleString','ManualFilter','setDataRecordCount','endCollectChangeset','isFeatureAuthorizedWithinTime','getStyles','_updateRenderEmptyCache','notExecuteFormula','SetValuePivotFilter','SetPivotFieldFormatMutation','registerCommand','sheets-pivot.cellDateGroupDisplay.yearQuarter','3399150PkDhic','dataFieldId','getActiveSheet','constructor','grandTotal','isText','matrix','getTableFieldById','_getPivotAppliedRanges','countNums','limit\x20pivot','getSubUnitPivotConfigs','#b2b2b2','Quarter','generateMutationsByRanges','sheetName','_ensurePivotMap','SHEET_PIVOT_TABLE_PLUGIN','substring','body','decorate','_sheetsPivotTableService','leafStyle','registerPluginResource','UpdatePivotSource','startCollectChangeset','new','map','MovePivotField','_updateModelCache','5276082rBuHHu','SetPivotTableConfig','shouldClear','sheets-pivot.value','createDataFieldId','ErrorType','AddPivotFieldCommand','iterator','PivotView','Total','type','column','MovePivotTableCommand','getFieldCountByArea','sourceRangeInfo','drillDown','dataStream','Varp\x20of\x20','getMonth','unionPivotViewRange','removePivotField','formJSON','_globalSubject','updateView','resetPivotTable','PivotDataFieldTypeEnum','deleteDataField','next','addCollectionByJSON','createLabelField','lastRow','get','_pivotTableMatrixInfo','query','RenamePivotFieldMutation','prototype','_initLocale','sheets.tabs.sheet','DataField','Row','removeCollectionImp','AddPivotField','originTargetInfo','ClearSelectionContentCommand','InsertSheetMutation','@univerjs-pro/sheets-pivot','_initPivotDataGetListener','SetPivotSubtotalTypeMutation','string','clear','PivotDisplayDataType','toString','registerRefRange','sideEffectUpdateWorkerCache','concat','sheets-pivot.cellDateGroupDisplay.year','RemovePivotFieldCommand','Div0','getLastCol','startRow','getPivotItemRenderInfoCache','sheet.mutation.set-pivot-collapse','PivotTable','toStringTag','updateFieldPosition','getPivotTableInstance','7067205PHCRWF','movePivotField','YearMonth','maxLimitItemCount','setDisplayName','isEmpty','Tools','interceptCommand','updateAllDisplayName','_deletePivotTableInstanceCache','markDirty$','_initViewModelBySheetInterceptor','rowInfo','document','getCellRaw','createInterceptorKey','sheet.command.pivot-drill-down','sheet.mutation.update-pivot-table-source-range','StdDevp\x20of\x20','colRanges','colCount','Optional','sheet.operation.pivot-table-view-formula-mark-dirty','symbol','sheet.mutation.rename-pivot-field','iterateFieldByArea','Rectangle','fontRenderExtension','setLabelFilterInfo','_sheetsPivotRpcService','stdDev','getRowCount','removeSourceRangeChange','Product\x20of\x20','_globalComputingSrv','setRangeValueRedoMutation','UpdateSource','sheets-pivot.dateGroup.yearMonth','colInfo','_initRemoveSheetCommandInterceptor','min','UpdateFieldPosition','areaInfo','SetSheetsFilterRangeMutation','0.21.0','splice','New','IExclusiveRangeService','getCellMatrix','packageName','_pivotConfigChange$','width','getCurrentUnitForType','SetPivotSort','DateGroupField','value','unshift','intercept','Style','Month','pbt','_dataFieldManagerCollection','registerCallbackWithEvent','sheets-pivot.cellDateGroupDisplay.date','sheet.command.set-pivot-value-filter','getTypeOfUnitDisposed$','iterateField','removePivotTable','registerSyncingMutations','sheet.mutation.remove-pivot-field','updateRangeKeyMap','PivotErrorTypeEnum','getPivotTableMatrixInfo','Disposable','sheet.mutation.set-pivot-filter','LocaleService','pivotTableConfigs','sheets-pivot.countName','IUniverInstanceService','addFieldWithSourceId','getSourceName','hasField','sheets-pivot.cellDateGroupDisplay.hourMinute','updatePivotTableMatrixInfo','_dataSyncPrimaryController','_model','fields','_pivotTableInstanceCache','RemovePivotFieldMutation','adjustSheetCellData','numberToABC','_config','setDirty','sheets-pivot.minName','pageRanges','sheets-pivot.cellDateGroupDisplay.hour','PivotTableViewDirtyMarkOperation','ICommandService','YearQuarter','Delete','push','_updatePivotTableInstanceCache','STRING','PivotFilterTypeEnum','sheet.mutation.send-pivot-config-local','headerMap','RemovePivotField','getIntersectsPivotTable','floor','sheet.command.set-pivot-field-setting','isBaseGroupField','_collectionConfigModel','resetArea','filter','getDataFieldId','sheets-pivot.dateGroup.date','updateConfig','clearRenderCache','setPivotFilter','setPivotTable','_getAutoName','valueIndex','InsertRowMutation','sheets-pivot.emptyPivot.filter','addPivotField','PivotDataFieldDataTypeEnum','generateHexNumber','pivotMutationGenerate','fieldsConfig','sheet.command.set-pivot-filter','maxDate','Collapse','getColumnWidth','PivotSubtotalTypeEnum','from','getFieldPositionInfoById','Set','createCollectionWithDataRange','entries','setPivotInitCompleted','viewUpdate$','SetPivotFieldsConfigCommand','getIndexesByPathStr','SetPivotSortCommand','getMatrix','\x20-\x20','complete','getFormat','getPivotPerformCheck','replace','RemoveSheetMutation','IResourceManagerService','average','collapseInfo','1764BYxULw','max','Var\x20of\x20','getInterceptPoints','handleSourceRangeChange','updateViewInfo','getDataFieldByTableId','_fieldsCollectionChange$','_collectionChange$','getValueIndex','has','cornerStyle','intersects','#FFFFFF','updateValuePosition','viewData$','addRecord','sheets-pivot.cellDateGroupDisplay.minute','fieldIds','Expand','Minute','DEFAULT_WORKSHEET_ROW_COUNT','SheetsPivotTableAdaptorModel','fetchThroughAsyncInterceptors','bind','handleMoveRange','triggerDirtyFeature','SetPivotPositionMutation','LS_CONFIG_KEY','configVersion$','add','tuple','removeValueFilterInfo','getSortInfo','sheet.mutation.send-init-pivot-text-local','1617171hJrMPR','rowHeaderMap','RemoveRowMutation','Max\x20of\x20','rangeKeyMap','measure','DependentOn','excelDateToUnixMilliseconds','PivotCallbackEnum','_initClearSelectionCommandInterceptor','UniverInstanceType','stdDevp','getDataFieldByDataFieldId','getFieldDataType','sheets-pivot.dateGroup.year','initDataRanges','stringify','sortInfo','disposeWithMe','row','AddField','getName','call','some','setFieldFormat','col','getFieldInfo','addDirtyPivotTable','asObservable','sheet.command.set-pivot-sort','addCollection','onQueryEnd','workbook\x20is\x20not\x20found','getFieldFormat','getUnit','numfmt','sheets-pivot.countNumsName','sheet.command.move-pivot-field','isDateValue','toJSON','rangeType','removeCollections','GlobalConfig','UpdatePivotFieldSourceInfoMutation','YearMonthDate','options','_pivotTableRangeInfo','isColMultiMeasure','applyChangeSet','sheet.mutation.remove-group-collection','DataFieldManager','getPivotTableInfo','pivotTableId','sheet.command.add-pivot-field','getNoUsedDataFieldIds','fieldsCollectionChange$','ObjectMatrix','Injector','Plugin','getCurrentSelections','ClearSelectionAllCommand','generateNewSheetName','forValue','sheets-pivot.productName','updateDirtyPivotTable','info','getId','PivotTableValuePositionEnum','getSubUnitPivotRenderCache','PivotViewCellValueTypeEnum','UpdateFieldPositionMutation','AddPivotTableCommand','UpdatePivotFieldSettingCommand','minDate','valueFields','ptn','updateCollectionConfig','sheets-pivot.stdDevName','generateRandomId','UpdatePivotTableSourceRangeMutation','_onRefRangeChange','PivotDrillDownCommand','ReleaseType','parseInt','GrandTotal','_globalComputedEndHelpFunc','collectionConfig','Range','#e6ebfa','rangesInfo','sheet.mutation.remove-pivot-table','rowFields','colStyle','2000572goMsPp','clearExclusiveRangesByGroupId','_activeDirtyManagerService','SHEET_PIVOT_IN_MAIN_THREAD','message','setSortInfo','SetPivotSetting','object','sheets-pivot.config','ResetPivotTable','SetPivotFilterCommand','createAsyncInterceptorKey','SetPivotSortMutation','INTERCEPTOR_POINT','pivotPerformCheck','SetPivotValueFilterCommand','sheets-pivot.averageName','forEach','Existing','getRangeKeyList','result','sheets-pivot.stdDevpName','single','DrillDown','panel','FontCache','InterceptorEffectEnum','BLANK_ROW_COUNT','targetCellInfo','default','versions','sheet.command.move-pivot-table','MoveRangeCommand','sheets-pivot.varName','_pivotRenderValueMatrixCache','getMatrixValue','SetFieldFormat','MonthDate','deleteUnitId','RemoveSheetsFilterMutation','data','NUM','getUnitId','getPivotDisplayConfig','getDataFieldBySourceName','getformat','sheet.command.add-pivot-table-with-config','PivotCellStyleTypeEnum','InsertSheetUndoMutationFactory','pushComputingStatusSubject','PivotTableFiledAreaEnum','Column\x20','sheets-pivot.subTotal','getSheetBySheetName','BadReference','fieldId','DataSyncPrimaryController','setValuePivotFilter','Subtotal','#1d32e9','sheets-pivot.cellDateGroupDisplay.yearMonthDate','setName','sheet.mutation.set-pivot-format','endRow','random','isValue','getPivotTableModelConfig','interceptor','onCommandExecuted','removeDataField','defaultThemeStyle','setTextInfo','sheets-pivot.emptyPivot.row','AddPivotTableWithConfig','_pivotInitCompleted$','sheet.command.set-pivot-fields-config','mergeWorksheetSnapshotWithDefault','BehaviorSubject','getInsertRowColMutations','getUpdateRangeDeleteIds','fetchThroughInterceptors','getFieldById','_pivotRenderInfoCache','getSheetFeatureLimit','[Pivot\x20Table]:\x20Target\x20sheet\x20is\x20not\x20valid','tableFieldId','error','updatePivotSource','blank','DIV_BY_ZERO','pageStyle','disposableCollection','number','CellValueType','pivotConfigChange$','Column','IFeatureCalculationManagerService','Value','addPivotTableWithConfig','getSheetBySheetId','SetFilterInfo','14dSMKKl','sheet.mutation.add-pivot-table','foreach','getAutoDisplayName','asyncInterceptor','collection','size','subscribe','COMMAND','markDirty','SetWorksheetColWidthMutation','pushUndoRedo','Panel','_localeService','getRangeKey','_ensurePivotItemRenderValueMatrixCache','uniqueDataFieldName','setSourceName','UniverSheetsPivotTablePlugin','SetPivotOptionMutation','fromJSON','RANGE_TYPE','Module','PivotTableChangeTypeEnum','_subjectViewChange','DEFAULT_PIVOT_NUMBER','CommandType','_createExclusiveRange','toPrimitive','_lifecycleService','_subjectFieldsCollectionChange','_initPivotTextInfo','FieldsCollection','sheets-pivot.blank','sheet.mutation.pivot-update-field-source-info','_initDataSendListener','getMatrixFromRunTimeData','getAutoDisplayNameFunction','IConfigService','updatePivotTableRangeInfo','other','setSubtotalType','var','addPivotTable','_globalComputedStartHelpFunc','startColumn','defineProperty','1768LdDNqR','sequenceExecute','existing','subUnitId','undos','getTextSize','collections','getRangeData','_refRangeHandle','(Blank)','date','Year','sheets-pivot.dateGroup.quarter','getColumnCount','_univerInstanceService','find','filterId','_featureCalculationManagerService','#eceeff','getDisplayName','NAME','rowStyle','remove','PositionType','AddPivotFieldMutation','[Pivot\x20Table]:\x20Target\x20cell\x20is\x20out\x20of\x20range','Date','length','sheets-pivot.maxName','SheetsSelectionsService','endColumn','CELL_CONTENT','MUTATION','IUndoRedoService','slice','handleAsyncResponse','Sum\x20of\x20','parse','textInfo','sheet.mutation.set-pivot-sort-info','SetPivotFilter','PivotMultipleValueId','NUMBER','set','_resourceManagerService','dateType','sheets-pivot.cellDateGroupDisplay.month','CustomCommandExecutionError','varp','SHEETS_PIVOT_PLUGIN_CONFIG_KEY','_ensurePivotTableRangeInfo','sheet.mutation.send-pivot-view-local','_refRangeService','getDataFieldManager','Count\x20of\x20','_viewData$','getTargetByPivotId','addExclusiveRange','_ensureViewDataMap','_sheetsPivotDataSourceModel','keys','getAutoFitColumnsMutations','level','_sheetsSelectionsService','UpdatePivotValuePositionCommand','pivotInitCompleted$','broadcastCollectionChange','getHeaderMapItem','_initCommandInterceptListener','_deleteModelCache','SetPivotCollapseMutation','collectionChange$','transFromCellValue','InsertColMutation','UNIVER_SHEET','RemoveColMutation','setPivotCollapse','_initSnapshot','setValueFilterInfo'];_0x461f=function(){return _0xf66fce;};return _0x461f();}let SheetsPivotTableInterceptController=class SheetsPivotTableInterceptController extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x3da77e,_0x5604ef,_0x1327ea,_0x2e2b6f,_0x2eaadc){const _0x122a3f=_0x5b3260;super(),this['_sheetInterceptorService']=_0x3da77e,this[_0x122a3f(0x2ee)]=_0x5604ef,this[_0x122a3f(0x2ac)]=_0x1327ea,this[_0x122a3f(0x2f0)]=_0x2e2b6f,this[_0x122a3f(0x3bd)]=_0x2eaadc,this[_0x122a3f(0x2e2)]();}['_getPivotAppliedRanges'](_0x49472d,_0x5deb30,_0x18d997){const _0x1f556e=_0x5b3260,{pageView:_0x5a5aec,cornerView:_0x414926,rowView:_0x3bf8fd,colView:_0x5b8335,dataView:_0x13e95c}=_0x5deb30,_0x13bd3f=_0x49472d;let _0x19cf8d;if(_0x18d997)_0x19cf8d=[...getEmptyPivotRanges(_0x13bd3f)];else{const _0x493c44=getAdjustRangesPosition(_0x13bd3f,_0x5a5aec,!![]),_0x3c1724=_0x5a5aec[_0x1f556e(0x3e4)]>=0x0?_0x5a5aec['lastRow']+0x1:0x0,_0x118b71=_0x414926[_0x1f556e(0x321)],_0x28604d=_0x414926[_0x1f556e(0x41c)],_0x173681=_0x493c44[_0x1f556e(0x2b9)]>0x0?0x1:0x0,_0x402c13=getAdjustRangesPosition({'row':_0x13bd3f['row']+_0x3c1724+_0x173681,'col':_0x13bd3f[_0x1f556e(0x1c6)]},_0x414926,![],![]),_0xb1332c=getAdjustRangesPosition({'row':_0x13bd3f[_0x1f556e(0x1c0)]+_0x3c1724+_0x173681+_0x118b71,'col':_0x13bd3f['col']},_0x3bf8fd,![],!![]),_0x606fef=getAdjustRangesPosition({'row':_0x13bd3f[_0x1f556e(0x1c0)]+_0x3c1724+_0x173681,'col':_0x13bd3f[_0x1f556e(0x1c6)]+_0x28604d},_0x5b8335,![],!![]),_0x4d95fb=getAdjustRangesPosition({'row':_0x13bd3f[_0x1f556e(0x1c0)]+_0x3c1724+_0x173681+_0x118b71,'col':_0x13bd3f[_0x1f556e(0x1c6)]+_0x28604d},_0x13e95c,![],!![]);_0x19cf8d=[..._0x493c44,..._0x402c13,..._0xb1332c,..._0x606fef,..._0x4d95fb];}return _0x19cf8d;}[_0x5b3260(0x2e2)](){const _0xcdb05d=_0x5b3260;this[_0xcdb05d(0x1bf)](this[_0xcdb05d(0x3bd)][_0xcdb05d(0x24d)]['intercept'](this[_0xcdb05d(0x3bd)][_0xcdb05d(0x24d)][_0xcdb05d(0x18d)]()[_0xcdb05d(0x33f)],{'handler':(_0x2114f0,_0x3a225a)=>{const _0x17fadd=_0xcdb05d,{cellInfo:_0x3811b4,view:_0x361494,isEmpty:_0x5f39d0}=_0x3a225a,{unitId:_0x38214c,subUnitId:_0x5bd8ae}=_0x3811b4,_0x2d2c07=this[_0x17fadd(0x3b0)](_0x3811b4,_0x361494,_0x5f39d0),_0x400e0c=this['_sheetInterceptorService'][_0x17fadd(0x3b6)]({'unitId':_0x38214c,'subUnitId':_0x5bd8ae,'ranges':_0x2d2c07}),_0x254bad=generateSetRangeValueMutations(this[_0x17fadd(0x2ee)],_0x38214c,_0x5bd8ae,_0x2d2c07);_0x254bad[_0x17fadd(0x3c8)]&&(_0x400e0c[_0x17fadd(0x35c)]['push'](_0x254bad[_0x17fadd(0x42b)]),_0x400e0c[_0x17fadd(0x2a2)][_0x17fadd(0x154)](_0x254bad['setRangeValueUndoMutation']));const _0x105f68=this['getAutoFitColumnsMutations'](_0x361494,_0x3811b4);return _0x400e0c[_0x17fadd(0x35c)][_0x17fadd(0x154)](..._0x105f68[_0x17fadd(0x35c)]),_0x400e0c[_0x17fadd(0x2a2)][_0x17fadd(0x154)](..._0x105f68[_0x17fadd(0x2a2)]),{'redos':_0x400e0c['redos'],'undos':_0x400e0c['undos']};}}));}[_0x5b3260(0x2db)](_0x1fe882,_0x1665ba){const _0xa2c255=_0x5b3260,{col:_0x972741,unitId:_0x567b4a,subUnitId:_0x4616e3}=_0x1665ba,_0x608fff=[],_0x4dd945=[],_0x3f8248=(0x0,_univerjs_sheets[_0xa2c255(0x2f9)])(this[_0xa2c255(0x2ac)],{'unitId':_0x567b4a,'subUnitId':_0x4616e3});if(!_0x1665ba||!_0x1fe882||!_0x3f8248)return{'undos':_0x4dd945,'redos':_0x608fff};const _0x39a107=this[_0xa2c255(0x2f0)]['getTextInfo'](),{colView:_0x22f0ce,dataView:_0x184b44,cornerView:_0x5689e1,rowView:_0x15af92,formatMap:_0x321772}=_0x1fe882,_0x2c6db4=getHeaderViewMaxText(_0x22f0ce,_0x39a107,!![],_0x321772),_0x7aa558=getHeaderViewMaxText(_0x15af92,_0x39a107,![],_0x321772),_0xf908db=getValueViewMaxText(_0x184b44),_0x24d807=getCornerMaxText(_0x5689e1),{worksheet:_0x1f57cc}=_0x3f8248;if(typeof window!==_0xa2c255(0x31b)&&window[_0xa2c255(0x415)]){const _0x157966=(0x0,_univerjs_engine_render[_0xa2c255(0x39c)])({...defaultThemeStyle[_0xa2c255(0x209)]}),_0x3d1120=_univerjs_engine_render[_0xa2c255(0x223)][_0xa2c255(0x2a3)](_0x2c6db4,_0x157966)[_0xa2c255(0x43b)]+0x10,_0x270a0e=_univerjs_engine_render[_0xa2c255(0x223)][_0xa2c255(0x2a3)](_0xf908db,_0x157966)[_0xa2c255(0x43b)],_0x200fc1=Math[_0xa2c255(0x15c)](Math[_0xa2c255(0x18b)](_0x3d1120,_0x270a0e))+0x10,_0x18098d=Math['floor'](_univerjs_engine_render[_0xa2c255(0x223)][_0xa2c255(0x2a3)](_0x7aa558,_0x157966)['width']),_0x249dd2=Math['floor'](_univerjs_engine_render[_0xa2c255(0x223)][_0xa2c255(0x2a3)](_0x24d807,_0x157966)[_0xa2c255(0x43b)]),_0x540472=Math[_0xa2c255(0x18b)](_0x18098d,_0x249dd2,0x28)+0xc,_0xe43cae=_0x22f0ce[_0xa2c255(0x41c)]+_0x5689e1[_0xa2c255(0x41c)],_0x4a5be6={},_0x57906a={};for(let _0xca53f2=_0x972741;_0xca53f2<_0x972741+_0xe43cae;_0xca53f2++){_0x4a5be6[_0xca53f2]=_0x1f57cc[_0xa2c255(0x174)](_0xca53f2);if(_0xca53f2-_0x972741<_0x5689e1[_0xa2c255(0x41c)])_0x57906a[_0xca53f2-_0x972741]=_0x540472;else _0x57906a[_0xca53f2-_0x972741]=_0x200fc1;}_0x608fff['push']({'id':_univerjs_sheets[_0xa2c255(0x279)]['id'],'params':{'subUnitId':_0x4616e3,'unitId':_0x567b4a,'ranges':[{'startColumn':_0x972741,'endColumn':_0x972741+_0xe43cae-0x1,'startRow':0x0,'endRow':_0x1f57cc[_0xa2c255(0x427)]()-0x1}],'colWidth':_0x57906a}}),_0x4dd945[_0xa2c255(0x154)]({'id':_univerjs_sheets[_0xa2c255(0x279)]['id'],'params':{'subUnitId':_0x4616e3,'unitId':_0x567b4a,'ranges':[{'startColumn':_0x972741,'endColumn':_0x972741+_0xe43cae-0x1,'startRow':0x0,'endRow':_0x1f57cc[_0xa2c255(0x427)]()-0x1}],'colWidth':_0x4a5be6}});}return{'undos':_0x4dd945,'redos':_0x608fff};}};SheetsPivotTableInterceptController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_sheets[_0x5b3260(0x35d)])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x5b3260(0x1e6)])),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x5b3260(0x13e)])),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(SheetsPivotTableConfigModel)),__decorateParam(0x4,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableService))],SheetsPivotTableInterceptController);let SheetsPivotRefRangeController=class SheetsPivotRefRangeController extends _univerjs_core['Disposable']{constructor(_0x609c04,_0x395a0a,_0x4eec66,_0x2fad41,_0xbdc727,_0x25f3c8,_0x519ef0){const _0x41b7b9=_0x5b3260;super(),this[_0x41b7b9(0x2ee)]=_0x609c04,this[_0x41b7b9(0x2d2)]=_0x395a0a,this[_0x41b7b9(0x389)]=_0x4eec66,this['_univerInstanceService']=_0x2fad41,this[_0x41b7b9(0x2f0)]=_0xbdc727,this[_0x41b7b9(0x387)]=_0x25f3c8,this[_0x41b7b9(0x392)]=_0x519ef0,_defineProperty(this,_0x41b7b9(0x265),new _univerjs_core[(_0x41b7b9(0x39b))]()),this[_0x41b7b9(0x1fd)]();}[_0x5b3260(0x1fd)](){const _0x1d956b=_0x5b3260,_0x57b713=(_0x52fd9,_0xed089d)=>{const _0x1ec03d=_0x216b,_0x2234cd=this[_0x1ec03d(0x2ac)][_0x1ec03d(0x43c)](_univerjs_core['UniverInstanceType'][_0x1ec03d(0x2e8)]);if(!_0x2234cd)return;if(!(_0x2234cd===null||_0x2234cd===void 0x0?void 0x0:_0x2234cd[_0x1ec03d(0x26d)](_0xed089d)))return;this[_0x1ec03d(0x265)]['dispose']();const _0x3fde37=_0x5c37b9=>{const _0x4eeee1=_0x1ec03d;return this[_0x4eeee1(0x2a6)](_0x5c37b9,_0x52fd9,_0xed089d);},_0x484594=this[_0x1ec03d(0x2f0)][_0x1ec03d(0x3b3)](_0x52fd9,_0xed089d);if(!(_0x484594===null||_0x484594===void 0x0?void 0x0:_0x484594[_0x1ec03d(0x275)]))return;Array['from'](_0x484594[_0x1ec03d(0x360)]())[_0x1ec03d(0x3c3)](_0xafc958=>{const _0x41e647=_0x1ec03d,{row:_0x1899c1,col:_0x1abfd0}=_0xafc958[_0x41e647(0x226)];return(0x0,_univerjs_core['cellToRange'])(_0x1899c1,_0x1abfd0);})[_0x1ec03d(0x21b)](_0x27d04a=>{const _0x527229=_0x1ec03d;this[_0x527229(0x265)][_0x527229(0x1a8)](this[_0x527229(0x2d2)][_0x527229(0x3fa)](_0x27d04a,_0x3fde37,_0x52fd9,_0xed089d));});},_0x492ad6=()=>{const _0x19b4ef=_0x216b,_0x4ea2fc=this[_0x19b4ef(0x2ac)][_0x19b4ef(0x43c)](_univerjs_core[_0x19b4ef(0x1b7)][_0x19b4ef(0x2e8)]);if(_0x4ea2fc){const _0x30c3d2=_0x4ea2fc[_0x19b4ef(0x3aa)]();if(!_0x30c3d2)return;_0x57b713(_0x4ea2fc['getUnitId'](),_0x30c3d2[_0x19b4ef(0x320)]());}};this[_0x1d956b(0x1bf)](this[_0x1d956b(0x389)][_0x1d956b(0x24e)](_0x1c67c8=>{const _0x26dc4e=_0x1d956b;if(_0x1c67c8['id']===_univerjs_sheets['SetWorksheetActiveOperation']['id']){const _0x56afaf=_0x1c67c8[_0x26dc4e(0x35e)],_0x35089b=_0x56afaf[_0x26dc4e(0x2a1)],_0x4978de=_0x56afaf[_0x26dc4e(0x30d)];if(!_0x35089b||!_0x4978de)return;_0x57b713(_0x4978de,_0x35089b);}})),this[_0x1d956b(0x1bf)](this[_0x1d956b(0x2f0)][_0x1d956b(0x2df)][_0x1d956b(0x276)](_0x12014c=>{if(_0x12014c)_0x492ad6();})),this[_0x1d956b(0x1bf)](this[_0x1d956b(0x2f0)][_0x1d956b(0x268)][_0x1d956b(0x276)](_0x476112=>{const _0x3ca08e=_0x1d956b,_0x234e87=(0x0,_univerjs_sheets[_0x3ca08e(0x2f9)])(this[_0x3ca08e(0x2ac)],{'unitId':_0x476112[_0x3ca08e(0x30d)],'subUnitId':_0x476112[_0x3ca08e(0x2a1)]});if(!_0x234e87)return;const {unitId:_0x355899,subUnitId:_0x1b56af}=_0x234e87,{unitId:_0x4fcdd5,subUnitId:_0x6d6d05}=_0x476112;if(_0x355899!==_0x4fcdd5||_0x1b56af!==_0x6d6d05)return;_0x57b713(_0x355899,_0x1b56af);})),_0x492ad6();}[_0x5b3260(0x2a6)](_0x25437c,_0x2bd152,_0x8cc9f9){const _0x5a6db1=_0x5b3260;switch(_0x25437c['id']){case _univerjs_sheets[_0x5a6db1(0x22a)]['id']:return this[_0x5a6db1(0x2f3)](_0x25437c[_0x5a6db1(0x35e)],_0x2bd152,_0x8cc9f9);default:break;}return{'redos':[],'undos':[]};}['getRefRangeMutationsByMoveRange'](_0x2735cd,_0x51510e,_0x408a24){const _0x326f9f=_0x5b3260,{fromRange:_0x13f5e9,toRange:_0x4c25fd}=_0x2735cd,_0x42026f=[],_0x2c9519=[],_0x10f188=(0x0,_univerjs_sheets['getSheetCommandTarget'])(this[_0x326f9f(0x2ac)]);if(!_0x10f188)return{'undos':_0x2c9519,'redos':_0x42026f};if(_0x51510e!==_0x10f188['unitId']||_0x408a24!==_0x10f188[_0x326f9f(0x2a1)])return{'undos':_0x2c9519,'redos':_0x42026f};const _0x40334a=this['_sheetsPivotTableConfigModel']['getSubUnitPivotConfigs'](_0x51510e,_0x408a24);if(_0x40334a===null||_0x40334a===void 0x0?void 0x0:_0x40334a['size'])for(const [_0x3671e7,_0x405789]of _0x40334a){const {unitId:_0x1c5c41,subUnitId:_0x295b54,row:_0x2b0af5,col:_0x11c6d3}=_0x405789['targetCellInfo'];if(_0x1c5c41===_0x10f188[_0x326f9f(0x30d)]&&_0x295b54===_0x10f188[_0x326f9f(0x2a1)]){const _0x1efe74=(0x0,_univerjs_core[_0x326f9f(0x318)])(_0x2b0af5,_0x11c6d3);if(_univerjs_core['Rectangle'][_0x326f9f(0x196)](_0x1efe74,_0x13f5e9)){const _0x19aee2=_0x2b0af5-_0x13f5e9[_0x326f9f(0x401)],_0x107e6f=_0x11c6d3-_0x13f5e9[_0x326f9f(0x29c)],_0x255ac6={'row':_0x4c25fd[_0x326f9f(0x401)]+_0x19aee2,'col':_0x4c25fd[_0x326f9f(0x29c)]+_0x107e6f};_0x42026f[_0x326f9f(0x154)]({'id':SetPivotPositionMutation['id'],'params':{'unitId':_0x1c5c41,'subUnitId':_0x295b54,'pivotTableId':_0x3671e7,'targetCellPosition':_0x255ac6}}),_0x2c9519[_0x326f9f(0x154)]({'id':SetPivotPositionMutation['id'],'params':{'unitId':_0x1c5c41,'subUnitId':_0x295b54,'pivotTableId':_0x3671e7,'targetCellPosition':{'row':_0x2b0af5,'col':_0x11c6d3}}});const _0x39d51c=_0x255ac6['row']-_0x2b0af5,_0xe09dd6=_0x255ac6[_0x326f9f(0x1c6)]-_0x11c6d3,_0x339cae=[],_0x4085ec=this[_0x326f9f(0x387)][_0x326f9f(0x402)](_0x1c5c41,_0x295b54,_0x3671e7),_0x5d6c27=_0x4085ec===null||_0x4085ec===void 0x0?void 0x0:_0x4085ec['rangesInfo'];if(_0x5d6c27){Object['keys'](_0x5d6c27)['forEach'](_0x4244fd=>{const _0x1e80e5=_0x326f9f;_0x5d6c27[_0x4244fd][_0x1e80e5(0x21b)](_0x51169e=>{const _0x2cae8e=_0x1e80e5,_0x142450={..._0x51169e};_0x142450[_0x2cae8e(0x401)]=_0x51169e[_0x2cae8e(0x401)]+_0x39d51c,_0x142450[_0x2cae8e(0x249)]=_0x51169e[_0x2cae8e(0x249)]+_0x39d51c,_0x142450[_0x2cae8e(0x29c)]=_0x51169e[_0x2cae8e(0x29c)]+_0xe09dd6,_0x142450[_0x2cae8e(0x2bc)]=_0x51169e['endColumn']+_0xe09dd6,_0x339cae[_0x2cae8e(0x154)](_0x142450);});});const _0x201c13=this[_0x326f9f(0x392)][_0x326f9f(0x3b6)]({'unitId':_0x1c5c41,'subUnitId':_0x295b54,'ranges':_0x339cae});_0x42026f[_0x326f9f(0x154)](..._0x201c13[_0x326f9f(0x35c)]),_0x2c9519['push'](..._0x201c13['undos']);const _0x362176=generateSetRangeValueMutations(this[_0x326f9f(0x2ee)],_0x1c5c41,_0x295b54,_0x339cae);_0x362176[_0x326f9f(0x3c8)]&&(_0x42026f[_0x326f9f(0x154)](_0x362176[_0x326f9f(0x42b)]),_0x2c9519['push'](_0x362176[_0x326f9f(0x31e)]));}}}}return{'redos':_0x42026f,'undos':_0x2c9519};}};SheetsPivotRefRangeController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x1e6)])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_sheets['RefRangeService'])),__decorateParam(0x2,_univerjs_core[_0x5b3260(0x151)]),__decorateParam(0x3,_univerjs_core[_0x5b3260(0x13e)]),__decorateParam(0x4,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableConfigModel)),__decorateParam(0x5,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableAdaptorModel)),__decorateParam(0x6,(0x0,_univerjs_core['Inject'])(_univerjs_sheets[_0x5b3260(0x35d)]))],SheetsPivotRefRangeController);let SheetsPivotRemoveSheetController=class SheetsPivotRemoveSheetController extends _univerjs_core[_0x5b3260(0x139)]{constructor(_0x24abd3,_0x18d028){const _0x4204ef=_0x5b3260;super(),this[_0x4204ef(0x392)]=_0x24abd3,this['_sheetsPivotTableConfigModel']=_0x18d028,this['_initRemoveSheetCommandInterceptor']();}[_0x5b3260(0x42f)](){const _0x5c5104=_0x5b3260;this[_0x5c5104(0x1bf)](this[_0x5c5104(0x392)][_0x5c5104(0x40f)]({'getMutations':_0x404233=>{const _0x216504=_0x5c5104;if(_0x404233['id']===_univerjs_sheets['RemoveSheetCommand']['id']){const _0x151181=[],_0x280759=[],{unitId:_0x2454aa,subUnitId:_0xd3f2ad}=_0x404233[_0x216504(0x35e)];if(!_0x2454aa||!_0xd3f2ad)return{'undos':_0x280759,'redos':_0x151181};const _0xdefa28=this[_0x216504(0x2f0)][_0x216504(0x3b3)](_0x2454aa,_0xd3f2ad);if(_0xdefa28===null||_0xdefa28===void 0x0?void 0x0:_0xdefa28[_0x216504(0x275)])for(const [_0x20b44b,_0x5c10fb]of _0xdefa28){_0x151181[_0x216504(0x154)]({'id':RemovePivotTableMutation['id'],'params':{'unitId':_0x2454aa,'subUnitId':_0xd3f2ad,'pivotTableId':_0x20b44b}});const _0x2d5d48={...this[_0x216504(0x2f0)]['getCollection'](_0x2454aa,_0x20b44b)};_0x280759[_0x216504(0x154)]({'id':AddPivotTableMutation['id'],'params':{'unitId':_0x2454aa,'subUnitId':_0xd3f2ad,'pivotTableId':_0x20b44b,'pivotTableConfig':_0x5c10fb,'collectionConfig':_0x2d5d48}});}return{'redos':_0x151181,'undos':_0x280759};}return{'redos':[],'undos':[]};}}));}};SheetsPivotRemoveSheetController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_sheets[_0x5b3260(0x35d)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableConfigModel))],SheetsPivotRemoveSheetController);let SheetsPivotRPCController=class SheetsPivotRPCController extends _univerjs_core['Disposable']{constructor(_0x246c37,_0x428ce3,_0x889294,_0x31dfd6,_0x29b304,_0x51b3eb){const _0x3471ae=_0x5b3260;super(),this[_0x3471ae(0x389)]=_0x246c37,this[_0x3471ae(0x425)]=_0x428ce3,this['_sheetsPivotTableAdaptorModel']=_0x889294,this[_0x3471ae(0x2f0)]=_0x31dfd6,this[_0x3471ae(0x2ac)]=_0x29b304,this[_0x3471ae(0x20c)]=_0x51b3eb,this[_0x3471ae(0x292)](),this['registerDirtyService']();}[_0x5b3260(0x292)](){const _0x4816cf=_0x5b3260;this[_0x4816cf(0x1bf)](this['_commandService'][_0x4816cf(0x24e)](_0x49ede7=>{const _0x2c8fc8=_0x4816cf;if(_0x49ede7['id']!==SendPivotDataLocalMutation['id'])return;const _0x5c589a=_0x49ede7[_0x2c8fc8(0x35e)];this[_0x2c8fc8(0x425)][_0x2c8fc8(0x2c1)](_0x5c589a);})),this['disposeWithMe'](this[_0x4816cf(0x389)][_0x4816cf(0x24e)](_0x99222f=>{const _0x101722=_0x4816cf;if(_0x99222f['id']===SendPivotConfigLocalMutation['id']){const _0xde8fb8=_0x99222f[_0x101722(0x35e)];if(_0xde8fb8){const {unitId:_0x1f0c7a,subUnitId:_0x3fb09d,oldSubUnitId:_0x235fa6,pivotTableId:_0x38b9d1,pivotTableConfig:_0x2acc47,collectionConfig:_0x4c076a}=_0xde8fb8;this[_0x101722(0x2f0)][_0x101722(0x35f)](_0x1f0c7a,_0x235fa6,_0xde8fb8[_0x101722(0x1e1)],null),this[_0x101722(0x2f0)][_0x101722(0x35f)](_0x1f0c7a,_0x3fb09d,_0x38b9d1,_0x2acc47),this[_0x101722(0x2f0)]['updateCollectionConfig'](_0x1f0c7a,_0x4c076a);}}})),this[_0x4816cf(0x1bf)](this['_commandService'][_0x4816cf(0x24e)](_0x25a876=>{const _0x561f22=_0x4816cf;if(_0x25a876['id']!==SendPivotViewLocalMutation['id'])return;const _0x5bc8ec=(0x0,_univerjs_sheets['getSheetCommandTarget'])(this[_0x561f22(0x2ac)]);if(!_0x5bc8ec)return;const {unitId:_0x3518ba,subUnitId:_0x5e1aef}=_0x5bc8ec,_0x542122=_0x25a876[_0x561f22(0x35e)];if(_0x542122[_0x561f22(0x203)])Object[_0x561f22(0x2da)](_0x542122[_0x561f22(0x203)])[_0x561f22(0x21b)](_0x1fb168=>{const _0x1d3d6a=_0x561f22;var _0x5bdea7;if((_0x5bdea7=_0x542122[_0x1d3d6a(0x203)])===null||_0x5bdea7===void 0x0?void 0x0:_0x5bdea7[_0x1fb168])this[_0x1d3d6a(0x2f0)]['updateCollectionConfig'](_0x1fb168,_0x542122[_0x1d3d6a(0x203)][_0x1fb168]);});if(_0x542122[_0x561f22(0x220)]){const {unitId:_0x6635b2,subUnitId:_0x1b6d1f,view:_0x46eaf5,pivotTableId:_0x5baca1,type:_0x1bea73,pivotConfig:_0x33085c}=_0x542122[_0x561f22(0x220)];if(_0x1bea73===PivotTableOperationEnum[_0x561f22(0x153)])this[_0x561f22(0x387)]['clearRenderCache']({'unitId':_0x6635b2,'subUnitId':_0x1b6d1f,'pivotTableId':_0x5baca1,'type':_0x1bea73}),this[_0x561f22(0x2f0)]['updateConfigCache'](_0x6635b2,_0x1b6d1f,_0x5baca1,null);else{const _0x4bf31c=new _univerjs_pro_engine_pivot[(_0x561f22(0x3ce))]();_0x4bf31c[_0x561f22(0x3db)](_0x46eaf5),this[_0x561f22(0x2f0)][_0x561f22(0x35f)](_0x6635b2,_0x1b6d1f,_0x5baca1,_0x33085c),this[_0x561f22(0x387)]['clearRenderCache']({'unitId':_0x6635b2,'subUnitId':_0x1b6d1f,'pivotTableId':_0x5baca1,'type':_0x1bea73,'view':_0x4bf31c}),this[_0x561f22(0x387)][_0x561f22(0x38a)]({'unitId':_0x6635b2,'subUnitId':_0x1b6d1f,'view':_0x4bf31c,'pivotTableId':_0x5baca1,'type':_0x1bea73});}}else _0x542122[_0x561f22(0x2f4)]&&(_0x542122[_0x561f22(0x2f4)][_0x561f22(0x21b)](_0x340b96=>{const _0x35db81=_0x561f22,{unitId:_0x3cc630,subUnitId:_0x41e48d,view:_0x55a74a,pivotTableId:_0x414c3e,type:_0xba8661,pivotConfig:_0x1e9d8b}=_0x340b96,_0x2de912=new _univerjs_pro_engine_pivot[(_0x35db81(0x3ce))]();_0x2de912[_0x35db81(0x3db)](_0x55a74a),this[_0x35db81(0x2f0)][_0x35db81(0x35f)](_0x3cc630,_0x41e48d,_0x414c3e,_0x1e9d8b),this[_0x35db81(0x387)][_0x35db81(0x38a)]({'unitId':_0x3cc630,'subUnitId':_0x41e48d,'view':_0x2de912,'pivotTableId':_0x414c3e,'type':_0xba8661});}),this['_sheetsPivotTableConfigModel']['setPivotInitCompleted']());this['_sheetsPivotTableAdaptorModel']['markDirty'](_0x3518ba,_0x5e1aef);}));}['registerDirtyService'](){const _0x136b8d=_0x5b3260;this['_activeDirtyManagerService'][_0x136b8d(0x375)](PivotTableViewDirtyMarkOperation['id'],{'commandId':PivotTableViewDirtyMarkOperation['id'],'getDirtyData'(_0x2a0344){const _0x484bad=_0x136b8d;return{'dirtyUnitFeatureMap':_0x2a0344[_0x484bad(0x35e)]};}});}};SheetsPivotRPCController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x151)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotRPCService)),__decorateParam(0x2,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableAdaptorModel)),__decorateParam(0x3,(0x0,_univerjs_core[_0x5b3260(0x354)])(SheetsPivotTableConfigModel)),__decorateParam(0x4,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x13e)])),__decorateParam(0x5,_univerjs_engine_formula[_0x5b3260(0x339)])],SheetsPivotRPCController);let UniverSheetsPivotTablePlugin=class UniverSheetsPivotTablePlugin extends _univerjs_core[_0x5b3260(0x1e7)]{constructor(_0x2e3e97=defaultPluginConfig,_0x3d5a0c,_0x313d01,_0x25b34b,_0x555602){const _0x14da91=_0x5b3260;super(),this[_0x14da91(0x14b)]=_0x2e3e97,this[_0x14da91(0x2ee)]=_0x3d5a0c,this[_0x14da91(0x389)]=_0x313d01,this['_configService']=_0x25b34b,this['_dataSyncPrimaryController']=_0x555602;const {..._0x3c8b8b}=(0x0,_univerjs_core[_0x14da91(0x302)])({},defaultPluginConfig,this[_0x14da91(0x14b)]);this[_0x14da91(0x2fa)][_0x14da91(0x369)](SHEETS_PIVOT_PLUGIN_CONFIG_KEY,_0x3c8b8b),this[_0x14da91(0x32c)](),this['_initConfig'](_0x3c8b8b);}[_0x5b3260(0x300)](_0xa43dca){const _0x4261db=_0x5b3260;var _0x556952;const _0x3b15e4=(_0x556952=this['_config'])===null||_0x556952===void 0x0?void 0x0:_0x556952[_0x4261db(0x3a3)];this[_0x4261db(0x2fa)][_0x4261db(0x369)](SHEET_PIVOT_IN_MAIN_THREAD,_0x3b15e4===!![]);if(_0xa43dca['maxLimitItemCount']!==void 0x0)(0x0,_univerjs_pro_engine_pivot['setMaxLimitItemCount'])(_0xa43dca[_0x4261db(0x40b)]);}['onStarting'](){const _0x179eb9=_0x5b3260;var _0x70f425;let _0x4a2a32=[];const _0x115378=(_0x70f425=this[_0x179eb9(0x14b)])===null||_0x70f425===void 0x0?void 0x0:_0x70f425[_0x179eb9(0x3a3)];if(_0x115378===!![])_0x4a2a32=[[SheetsPivotTableService],[SheetsPivotRPCService],[SheetsPivotRPCController],[SheetsPivotTableAdaptorModel],[SheetsPivotTableConfigModel],[SheetsPivotRemoveSheetController],[SheetsPivotClearController],[SheetsPivotRefRangeController],[SheetsPivotTableInterceptController]];else{if(_0x115378===![])_0x4a2a32=[[SheetsPivotDataSourceModel],[PivotCalculatorController]];else{if(_0x115378===void 0x0)_0x4a2a32=[[SheetsPivotDataSourceModel],[PivotCalculatorController],[SheetsPivotTableService],[SheetsPivotRPCService],[SheetsPivotRPCController],[SheetsPivotTableAdaptorModel],[SheetsPivotTableConfigModel],[SheetsPivotRemoveSheetController],[SheetsPivotClearController],[SheetsPivotRefRangeController],[SheetsPivotTableInterceptController]];}}_0x4a2a32[_0x179eb9(0x21b)](_0x1811b6=>this['_injector'][_0x179eb9(0x1a8)](_0x1811b6)),[PivotCalculatorController,SheetsPivotRPCController,SheetsPivotTableService,SheetsPivotClearController,SheetsPivotRemoveSheetController,SheetsPivotRefRangeController,SheetsPivotTableInterceptController][_0x179eb9(0x21b)](_0x1429fa=>{const _0x3aed1a=_0x179eb9;if(this[_0x3aed1a(0x2ee)]['has'](_0x1429fa))this[_0x3aed1a(0x2ee)][_0x3aed1a(0x3e5)](_0x1429fa);});}[_0x5b3260(0x32c)](){const _0x4457b9=_0x5b3260;[AddPivotTableWithConfigCommand,AddPivotTableCommand,AddPivotFieldCommand,MovePivotFieldCommand,RemovePivotFieldCommand,UpdatePivotValuePositionCommand,UpdateDateGroupCommand,SetPivotCollapseCommand,SetPivotSortCommand,SetPivotFilterCommand,UpdatePivotFieldSettingCommand,UpdatePivotTableSourceRangeCommand,MovePivotTableCommand,PivotDrillDownCommand,AddPivotTableMutation,UpdateDateGroupMutation,RemovePivotTableMutation,AddPivotFieldMutation,AddGroupCollectionMutation,RemoveGroupCollectionMutation,SetPivotFilterMutation,RemovePivotFieldMutation,RenamePivotFieldMutation,SetPivotCollapseMutation,SetPivotSortMutation,SetPivotOptionMutation,SetPivotPositionMutation,GetPivotDataLocalMutation,SendPivotDataLocalMutation,SendPivotViewLocalMutation,UpdateFieldPositionMutation,UpdateValuePositionMutation,SetPivotSubtotalTypeMutation,SetPivotFieldFormatMutation,SendInitPivotTextLocalMutation,UpdatePivotTableSourceRangeMutation,UpdatePivotFieldSourceInfoMutation,PivotTableViewDirtyMarkOperation,SendPivotConfigLocalMutation,SetPivotValueFilterCommand,SetPivotValueFilterMutation,SetPivotFieldsConfigCommand,ResetPivotFieldsConfigCommand][_0x4457b9(0x21b)](_0x1b7216=>{const _0x4d3143=_0x4457b9;var _0xfea61b;(_0xfea61b=this[_0x4d3143(0x144)])===null||_0xfea61b===void 0x0||_0xfea61b[_0x4d3143(0x134)](_0x1b7216),this[_0x4d3143(0x389)][_0x4d3143(0x3a6)](_0x1b7216);});}};_defineProperty(UniverSheetsPivotTablePlugin,'pluginName',SHEET_PIVOT_TABLE_PLUGIN),_defineProperty(UniverSheetsPivotTablePlugin,_0x5b3260(0x439),name),_defineProperty(UniverSheetsPivotTablePlugin,_0x5b3260(0x345),version),_defineProperty(UniverSheetsPivotTablePlugin,_0x5b3260(0x3d0),_univerjs_core[_0x5b3260(0x1b7)][_0x5b3260(0x2e8)]),UniverSheetsPivotTablePlugin=__decorate([(0x0,_univerjs_core[_0x5b3260(0x1b3)])(_univerjs_pro_license['UniverLicensePlugin']),__decorateParam(0x1,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core['Injector'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x5b3260(0x354)])(_univerjs_core[_0x5b3260(0x151)])),__decorateParam(0x3,_univerjs_core[_0x5b3260(0x295)]),__decorateParam(0x4,(0x0,_univerjs_core[_0x5b3260(0x41d)])(_univerjs_rpc[_0x5b3260(0x242)]))],UniverSheetsPivotTablePlugin),exports[_0x5b3260(0x3cc)]=AddPivotFieldCommand,exports[_0x5b3260(0x2b6)]=AddPivotFieldMutation,exports[_0x5b3260(0x1f4)]=AddPivotTableCommand,exports['AddPivotTableMutation']=AddPivotTableMutation,exports['AddPivotTableWithConfigCommand']=AddPivotTableWithConfigCommand,exports[_0x5b3260(0x225)]=BLANK_ROW_COUNT,exports[_0x5b3260(0x288)]=DEFAULT_PIVOT_NUMBER,exports[_0x5b3260(0x348)]=MovePivotFieldCommand,exports[_0x5b3260(0x3d2)]=MovePivotTableCommand,exports[_0x5b3260(0x3f8)]=PivotDisplayDataType,exports[_0x5b3260(0x1fe)]=PivotDrillDownCommand,exports['PivotTableOperationEnum']=PivotTableOperationEnum,exports[_0x5b3260(0x150)]=PivotTableViewDirtyMarkOperation,exports[_0x5b3260(0x2b5)]=PositionType,exports[_0x5b3260(0x3fe)]=RemovePivotFieldCommand,exports[_0x5b3260(0x148)]=RemovePivotFieldMutation,exports[_0x5b3260(0x303)]=RemovePivotTableMutation,exports[_0x5b3260(0x3e8)]=RenamePivotFieldMutation,exports['ResetPivotFieldsConfigCommand']=ResetPivotFieldsConfigCommand,exports[_0x5b3260(0x2cf)]=SHEETS_PIVOT_PLUGIN_CONFIG_KEY,exports[_0x5b3260(0x3b9)]=SHEET_PIVOT_TABLE_PLUGIN,exports[_0x5b3260(0x386)]=SetPivotCollapseCommand,exports[_0x5b3260(0x2e4)]=SetPivotCollapseMutation,exports[_0x5b3260(0x3a5)]=SetPivotFieldFormatMutation,exports[_0x5b3260(0x17d)]=SetPivotFieldsConfigCommand,exports[_0x5b3260(0x214)]=SetPivotFilterCommand,exports['SetPivotFilterMutation']=SetPivotFilterMutation,exports[_0x5b3260(0x282)]=SetPivotOptionMutation,exports[_0x5b3260(0x1a5)]=SetPivotPositionMutation,exports[_0x5b3260(0x17f)]=SetPivotSortCommand,exports[_0x5b3260(0x216)]=SetPivotSortMutation,exports[_0x5b3260(0x3f5)]=SetPivotSubtotalTypeMutation,exports[_0x5b3260(0x219)]=SetPivotValueFilterCommand,exports[_0x5b3260(0x370)]=SetPivotValueFilterMutation,Object[_0x5b3260(0x29d)](exports,'SheetsPivotDataSourceModel',{'enumerable':!![],'get':function(){return SheetsPivotDataSourceModel;}}),Object[_0x5b3260(0x29d)](exports,'SheetsPivotRPCService',{'enumerable':!![],'get':function(){return SheetsPivotRPCService;}}),Object[_0x5b3260(0x29d)](exports,_0x5b3260(0x1a0),{'enumerable':!![],'get':function(){return SheetsPivotTableAdaptorModel;}}),Object['defineProperty'](exports,'SheetsPivotTableConfigModel',{'enumerable':!![],'get':function(){return SheetsPivotTableConfigModel;}}),Object[_0x5b3260(0x29d)](exports,'SheetsPivotTableService',{'enumerable':!![],'get':function(){return SheetsPivotTableService;}}),Object[_0x5b3260(0x29d)](exports,_0x5b3260(0x281),{'enumerable':!![],'get':function(){return UniverSheetsPivotTablePlugin;}}),exports[_0x5b3260(0x362)]=UpdateDateGroupCommand,exports[_0x5b3260(0x1f3)]=UpdateFieldPositionMutation,exports[_0x5b3260(0x1f5)]=UpdatePivotFieldSettingCommand,exports[_0x5b3260(0x1d8)]=UpdatePivotFieldSourceInfoMutation,exports['UpdatePivotTableSourceRangeCommand']=UpdatePivotTableSourceRangeCommand,exports[_0x5b3260(0x1fc)]=UpdatePivotTableSourceRangeMutation,exports[_0x5b3260(0x2de)]=UpdatePivotValuePositionCommand,exports[_0x5b3260(0x357)]=UpdateValuePositionMutation,exports[_0x5b3260(0x1dd)]=applyChangeSet,exports[_0x5b3260(0x385)]=canUsePivot,exports[_0x5b3260(0x250)]=defaultThemeStyle,exports[_0x5b3260(0x337)]=generateSetRangeValueMutations,exports['getAdjustRangesPosition']=getAdjustRangesPosition,exports['getEmptyPivotRanges']=getEmptyPivotRanges,exports[_0x5b3260(0x30c)]=getFieldListByArea,exports[_0x5b3260(0x258)]=getInsertRowColMutations,exports['getPivotCellInfo']=getPivotCellInfo,exports[_0x5b3260(0x346)]=getPivotInfoByLicense,exports[_0x5b3260(0x1e0)]=getPivotTableInfo,exports[_0x5b3260(0x2e6)]=transFromCellValue,exports[_0x5b3260(0x3d9)]=unionPivotViewRange;
|
|
1
|
+
const _0x273cf5=_0x1f80;(function(_0x2f4c98,_0x311aa5){const _0x680a88=_0x1f80,_0x4a9b80=_0x2f4c98();while(!![]){try{const _0x4f4ab6=parseInt(_0x680a88(0x3cc))/0x1*(parseInt(_0x680a88(0x4c4))/0x2)+-parseInt(_0x680a88(0x202))/0x3*(-parseInt(_0x680a88(0x253))/0x4)+-parseInt(_0x680a88(0x4c9))/0x5*(-parseInt(_0x680a88(0x33c))/0x6)+parseInt(_0x680a88(0x302))/0x7*(-parseInt(_0x680a88(0x3f8))/0x8)+parseInt(_0x680a88(0x3bb))/0x9*(-parseInt(_0x680a88(0x23a))/0xa)+-parseInt(_0x680a88(0x46b))/0xb*(parseInt(_0x680a88(0x3e8))/0xc)+-parseInt(_0x680a88(0x4c1))/0xd*(-parseInt(_0x680a88(0x344))/0xe);if(_0x4f4ab6===_0x311aa5)break;else _0x4a9b80['push'](_0x4a9b80['shift']());}catch(_0x1cde86){_0x4a9b80['push'](_0x4a9b80['shift']());}}}(_0x527b,0xbaa6d),Object['defineProperty'](exports,Symbol[_0x273cf5(0x20a)],{'value':'Module'}));let _univerjs_pro_engine_pivot=require('@univerjs-pro/engine-pivot'),_univerjs_core=require('@univerjs/core'),_univerjs_engine_formula=require('@univerjs/engine-formula'),_univerjs_sheets=require('@univerjs/sheets'),rxjs=require('rxjs'),_univerjs_pro_license=require('@univerjs-pro/license'),_univerjs_sheets_filter=require('@univerjs/sheets-filter'),_univerjs_rpc=require('@univerjs/rpc'),_univerjs_engine_render=require('@univerjs/engine-render');const BUILD_TIMESTAMP=Number[_0x273cf5(0x3b4)](0x69ec6f5d),DEFAULT_PIVOT_NUMBER=0x1,SHEET_PIVOT_TABLE_PLUGIN='SHEET_PIVOT_TABLE_PLUGIN',BLANK_ROW_COUNT=0x1,DEFAULT_FIELD_BG_COLOR=_0x273cf5(0x47d),DEFAULT_DATA_BG_COLOR='rgb(255,255,255)',DEFAULT_PIVOT_BORDER_COLOR=_0x273cf5(0x4ca),DEFAULT_PIVOT_PAGE_VIEW_BG='#f4f4f5',DEFAULT_PIVOT_LEAF_VIEW_BG=_0x273cf5(0x27f),DEFAULT_PIVOT_CORNER_VIEW_VG=_0x273cf5(0x1f7),DEFAULT_PIVOT_GRAND_TOTAL_BG=_0x273cf5(0x215),DEFAULT_PIVOT_GRAND_TOTAL_CL='#FFFFFF',DEFAULT_PIVOT_SUB_TOTAL_BG='#e6ebfa',DEFAULT_PIVOT_COL_VIEW_BG='#1d32e9',DEFAULT_PIVOT_COL_VIEW_CL=_0x273cf5(0x2be),DEFAULT_PIVOT_ROW_VIEW_BG=_0x273cf5(0x290);let PositionType=function(_0x3c99ba){const _0x3c7f9b=_0x273cf5;return _0x3c99ba[_0x3c7f9b(0x359)]=_0x3c7f9b(0x3f4),_0x3c99ba['New']=_0x3c7f9b(0x317),_0x3c99ba;}({});const localeTemplate={'sheets-pivot':{'blankValue':'','otherValue':'','columnName':'','subTotalText':'','grandTotalText':'','valueText':'','averageName':'','countName':'','countNumsName':'','maxName':'','minName':'','productName':'','stdDevName':'','stdDevpName':'','sumName':'','varName':'','varpName':'','value':'','blank':'','other':'','subTotal':'','grandTotal':'','emptyPivot':{'filter':'','row':'','column':'','values':''},'dateGroup':{'year':'','month':'','day':'','hour':'','minute':'','quarter':'','monthDate':'','yearQuarter':'','yearMonth':'','yearMonthDate':''},'cellDateGroupDisplay':{'minute':'','hour':'','hourMinute':'','date':'','month':'','monthDate':'','quarter':'','year':'','yearMonth':'','yearMonthDate':'','yearQuarter':''}}},defaultPivotBorderStyle={'b':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}},'l':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}},'r':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}},'t':{'s':0x1,'cl':{'rgb':DEFAULT_PIVOT_BORDER_COLOR}}},defaultEmptyPivotFieldCellStyle={'bg':{'rgb':DEFAULT_FIELD_BG_COLOR},'ht':0x2,'vt':0x2,'tb':0x1},defaultEmptyPivotDataCellStyle={'bg':{'rgb':DEFAULT_DATA_BG_COLOR},'ht':0x2,'vt':0x2,'tb':0x1},defaultThemeStyle={'rowStyle':{'bg':{'rgb':DEFAULT_PIVOT_ROW_VIEW_BG},'bd':defaultPivotBorderStyle,'bl':0x1,'vt':0x2},'colStyle':{'bg':{'rgb':DEFAULT_PIVOT_COL_VIEW_BG},'bd':null,'cl':{'rgb':DEFAULT_PIVOT_COL_VIEW_CL},'bl':0x1,'vt':0x2},'subTotalStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_SUB_TOTAL_BG},'vt':0x2},'cornerStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_CORNER_VIEW_VG},'bl':0x1,'vt':0x2},'pageStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_PAGE_VIEW_BG},'vt':0x2},'leafStyle':{'bd':defaultPivotBorderStyle,'bg':{'rgb':DEFAULT_PIVOT_LEAF_VIEW_BG},'vt':0x2},'grandTotal':{'bd':null,'bg':{'rgb':DEFAULT_PIVOT_GRAND_TOTAL_BG},'cl':{'rgb':DEFAULT_PIVOT_GRAND_TOTAL_CL},'bl':0x1,'vt':0x2},'dataStyle':{'bd':defaultPivotBorderStyle,'vt':0x2}};function getDateGroupStr(_0x1ddca0,_0x275033,_0x182f28){const _0x1f4c98=_0x273cf5,_0x285bc1=_0x1ddca0[_0x1f4c98(0x29f)](_univerjs_core[_0x1f4c98(0x337)]),_0x30de72=_0x182f28[_0x1f4c98(0x27d)]('_');switch(_0x275033){case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum']['Year']:return _0x285bc1['t'](_0x1f4c98(0x1e9),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)]['Minute']:return _0x285bc1['t']('sheets-pivot.cellDateGroupDisplay.minute',..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)][_0x1f4c98(0x373)]:return _0x285bc1['t'](_0x1f4c98(0x3c5),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)][_0x1f4c98(0x1d3)]:return _0x285bc1['t'](_0x1f4c98(0x2cd),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)]['Date']:return _0x285bc1['t'](_0x1f4c98(0x210),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)][_0x1f4c98(0x386)]:return _0x285bc1['t'](_0x1f4c98(0x3b6),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)]['Quarter']:return _0x285bc1['t'](_0x1f4c98(0x362),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)]['YearMonth']:return _0x285bc1['t'](_0x1f4c98(0x1fd),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)][_0x1f4c98(0x2ee)]:return _0x285bc1['t'](_0x1f4c98(0x303),..._0x30de72);case _univerjs_pro_engine_pivot[_0x1f4c98(0x264)]['YearQuarter']:return _0x285bc1['t'](_0x1f4c98(0x39d),..._0x30de72);}return'';}const transformPivotDataToCellData$1=(_0x599f0b,_0x8e5593,_0x4e39e5,_0x2127ba)=>{const _0x58d1aa=_0x273cf5;let _0x3d826a;const _0x12b9a3=_0x599f0b[_0x58d1aa(0x29f)](_univerjs_core[_0x58d1aa(0x315)])['getCurrentUnitForType'](_univerjs_core[_0x58d1aa(0x37f)][_0x58d1aa(0x4aa)]);if(!_0x12b9a3)return null;const _0x31ed48=_0x12b9a3[_0x58d1aa(0x22c)]();let _0x2d8b65;if(_0x4e39e5)_0x2d8b65=_0x31ed48[_0x58d1aa(0x438)](_0x4e39e5);if((_0x8e5593===null||_0x8e5593===void 0x0?void 0x0:_0x8e5593['v'])||(_0x8e5593===null||_0x8e5593===void 0x0?void 0x0:_0x8e5593['v'])===0x0){if(!_0x3d826a)_0x3d826a={};const _0x523c6f=transformErrorValue(_0x8e5593['v']);if(typeof _0x523c6f===_0x58d1aa(0x1f1))_0x3d826a['t']=_univerjs_core[_0x58d1aa(0x42e)][_0x58d1aa(0x433)];else{if(typeof _0x523c6f===_0x58d1aa(0x3f3))_0x3d826a['t']=_univerjs_core[_0x58d1aa(0x42e)][_0x58d1aa(0x47a)];}_0x3d826a['v']=_0x523c6f;}if((_0x8e5593===null||_0x8e5593===void 0x0?void 0x0:_0x8e5593['i'])||(_0x8e5593===null||_0x8e5593===void 0x0?void 0x0:_0x8e5593['i'])===0x0){if(!_0x3d826a)_0x3d826a={};_0x3d826a['fi']=_0x8e5593['i'];}if(_0x8e5593===null||_0x8e5593===void 0x0?void 0x0:_0x8e5593['s']){if(!_0x3d826a)_0x3d826a={};_0x3d826a['pbt']=_0x8e5593['s'];}if(_0x4e39e5){if(!_0x3d826a)_0x3d826a={};_0x3d826a['s']=_0x2d8b65;}if(_0x2127ba){if((_0x3d826a===null||_0x3d826a===void 0x0?void 0x0:_0x3d826a['v'])&&_0x3d826a[_0x58d1aa(0x4df)]!==_univerjs_pro_engine_pivot['PivotCellStyleTypeEnum']['GrandTotal']&&_0x3d826a['pbt']!==_univerjs_pro_engine_pivot[_0x58d1aa(0x48a)]['Subtotal']){const _0x3a0281=String(_0x3d826a['v']),{dateType:_0x455623}=_0x2127ba;_0x3d826a['v']=getDateGroupStr(_0x599f0b,_0x455623,_0x3a0281),_0x3d826a['t']=_univerjs_core['CellValueType'][_0x58d1aa(0x47a)];}}return _0x3d826a;},generatorAdjustPositionData$1=(_0x4641a2,_0x397879,_0x54e9c7,_0x1877f7)=>{const _0xf6a670=_0x273cf5,_0x3afb64=_0x54e9c7['targetCellInfo'],{cornerView:_0x3a8234,rowView:_0x457b4a,colView:_0x24c339,dataView:_0x14f063,pageView:_0x4a6f45,formatMap:_0x39d43d,groupInfo:_0x4cd67a}=_0x397879,{row:_0x19ab08,col:_0x38c670}=_0x3afb64,_0x404db2=new _univerjs_core[(_0xf6a670(0x24d))](),_0x2f9c07={},_0x3e3f67={},_0x32ee25={},_0x534094={},_0xf6a70b={};let _0x5796ae=_0x19ab08,_0x377adf=_0x38c670;Object[_0xf6a670(0x260)](_0x4a6f45[_0xf6a670(0x4d0)])[_0xf6a670(0x24b)](_0x498f13=>{const _0xa119e3=_0xf6a670;Object['keys'](_0x4a6f45[_0xa119e3(0x4d0)][Number(_0x498f13)])[_0xa119e3(0x24b)](_0xc77e25=>{const _0x13cb4f=_0xa119e3,_0x3b7396={..._0x4a6f45[_0x13cb4f(0x4d0)][Number(_0x498f13)][Number(_0xc77e25)]};_0x404db2[_0x13cb4f(0x438)](Number(_0x498f13)+_0x5796ae,Number(_0xc77e25)+_0x377adf,transformPivotDataToCellData$1(_0x4641a2,_0x3b7396,defaultThemeStyle[_0x13cb4f(0x3a7)]));});});const _0x661716=Object[_0xf6a670(0x260)](_0x4a6f45[_0xf6a670(0x4d0)])['length'];_0x5796ae+=_0x661716+(_0x661716?0x1:0x0);const _0x1d8fce=_0x3a8234[_0xf6a670(0x3d7)](),_0x1e3da5=_0x3a8234[_0xf6a670(0x456)]();for(let _0x858cee=0x0;_0x858cee<_0x1d8fce;_0x858cee++)for(let _0x33948c=0x0;_0x33948c<_0x1e3da5;_0x33948c++){var _0x13a438;const _0x2bbde6={...(_0x13a438=_0x3a8234['data'])===null||_0x13a438===void 0x0||(_0x13a438=_0x13a438[_0x858cee])===null||_0x13a438===void 0x0?void 0x0:_0x13a438[_0x33948c]};if(_0x2bbde6){var _0x352e34;if(((_0x352e34=_0x457b4a[_0xf6a670(0x2ec)][_0x33948c])===null||_0x352e34===void 0x0?void 0x0:_0x352e34['isValue'])&&_0x33948c===_0x1e3da5-0x1&&_0x858cee===_0x1d8fce-0x1)_0x2bbde6['v']=''+_0x1877f7[_0xf6a670(0x2d3)];}_0x404db2['setValue'](_0x858cee+_0x5796ae,_0x33948c+_0x377adf,transformPivotDataToCellData$1(_0x4641a2,_0x2bbde6,defaultThemeStyle[_0xf6a670(0x30e)]));}for(let _0x551b3e=0x0;_0x551b3e<_0x3a8234['info'][_0xf6a670(0x36f)];_0x551b3e++)if(_0x3a8234[_0xf6a670(0x324)][_0x551b3e])_0x32ee25[''+(_0x551b3e+_0x377adf)]=_0x3a8234['info'][_0x551b3e];_0x377adf+=_0x1e3da5;const _0x23ccb4=_0x24c339['headerMap'],_0x4546d2=_0x24c339[_0xf6a670(0x218)]()>=0x0?_0x24c339[_0xf6a670(0x218)]()+0x1:0x0,_0x5e3939=_0x24c339[_0xf6a670(0x268)]()>=0x0?_0x24c339['getLastCol']()+0x1:0x0;for(let _0x449f74=0x0;_0x449f74<_0x5e3939;_0x449f74++){for(let _0x4056f5=0x0;_0x4056f5<_0x4546d2;_0x4056f5++){var _0x1e50d1,_0x1125ae;const _0xd982b3={...(_0x1e50d1=_0x24c339[_0xf6a670(0x4d0)])===null||_0x1e50d1===void 0x0||(_0x1e50d1=_0x1e50d1[_0x4056f5])===null||_0x1e50d1===void 0x0?void 0x0:_0x1e50d1[_0x449f74]},_0x2fd0b5=(_0x1125ae=_0x23ccb4[_0x4056f5])===null||_0x1125ae===void 0x0?void 0x0:_0x1125ae[_0xf6a670(0x1cf)],_0x208391=_0x39d43d[_0x2fd0b5],_0x54ed81=_0x4cd67a[_0x2fd0b5];if(_0xd982b3){var _0x5adfd9;_0xd982b3['v']=transFromCellValue(_0xd982b3,_0x4056f5===0x0&&((_0x5adfd9=_0x24c339[_0xf6a670(0x24f)](_0x449f74+0x1))===null||_0x5adfd9===void 0x0?void 0x0:_0x5adfd9[_0xf6a670(0x4eb)]),_0x208391,_0x1877f7);}let _0x22b916;if(_0x208391)_0x22b916={...defaultThemeStyle[_0xf6a670(0x4a4)],'n':{'pattern':_0x208391}};else _0x22b916={...defaultThemeStyle[_0xf6a670(0x4a4)]};_0x404db2[_0xf6a670(0x438)](_0x4056f5+_0x5796ae,_0x449f74+_0x377adf,transformPivotDataToCellData$1(_0x4641a2,_0xd982b3,_0x22b916,_0x54ed81));}if(_0x24c339['info'][_0x449f74])_0x3e3f67[''+(_0x449f74+_0x377adf)]=_0x24c339[_0xf6a670(0x324)][_0x449f74];if(_0x24c339[_0xf6a670(0x2ec)][_0x449f74+0x1])_0xf6a70b[''+(_0x449f74+_0x5796ae+0x1)]=_0x24c339[_0xf6a670(0x2ec)][_0x449f74+0x1];}_0x5796ae+=_0x1d8fce;const _0x18ac15=_0x457b4a[_0xf6a670(0x2ec)],_0x3295e5=_0x457b4a['getLastRow']()>=0x0?_0x457b4a[_0xf6a670(0x218)]()+0x1:0x0,_0x1fa04f=_0x457b4a[_0xf6a670(0x268)]()>=0x0?_0x457b4a['getLastCol']()+0x1:0x0;for(let _0x1e846e=0x0;_0x1e846e<_0x3295e5;_0x1e846e++){for(let _0x4b77bf=0x0;_0x4b77bf<_0x1fa04f;_0x4b77bf++){var _0x24993b,_0x373bf8;const _0x933e3={...(_0x24993b=_0x457b4a[_0xf6a670(0x4d0)])===null||_0x24993b===void 0x0||(_0x24993b=_0x24993b[_0x1e846e])===null||_0x24993b===void 0x0?void 0x0:_0x24993b[_0x4b77bf]},_0x502ec8=(_0x373bf8=_0x18ac15[_0x4b77bf])===null||_0x373bf8===void 0x0?void 0x0:_0x373bf8[_0xf6a670(0x1cf)],_0x5d9ca0=_0x39d43d[_0x502ec8],_0x5c6ffc=_0x4cd67a[_0x502ec8];if(_0x933e3)_0x933e3['v']=transFromCellValue(_0x933e3,![],_0x5d9ca0,_0x1877f7);let _0x44a5a0;if(_0x457b4a[_0xf6a670(0x324)][_0x1e846e][_0xf6a670(0x394)]===_0x457b4a['getColCount']())_0x44a5a0=defaultThemeStyle['leafStyle'];else{if(_0x457b4a[_0xf6a670(0x324)][_0x1e846e][_0xf6a670(0x2fc)])_0x44a5a0=_0x457b4a[_0xf6a670(0x324)][_0x1e846e][_0xf6a670(0x394)]===0x0?defaultThemeStyle[_0xf6a670(0x2d2)]:defaultThemeStyle[_0xf6a670(0x3ff)];else _0x44a5a0=defaultThemeStyle[_0xf6a670(0x241)];}if(_0x5d9ca0)_0x44a5a0={..._0x44a5a0,'n':{'pattern':_0x5d9ca0}};_0x404db2[_0xf6a670(0x438)](_0x1e846e+_0x5796ae,_0x4b77bf+_0x38c670,transformPivotDataToCellData$1(_0x4641a2,_0x933e3,_0x44a5a0,_0x5c6ffc));}if(_0x457b4a[_0xf6a670(0x324)][_0x1e846e])_0x2f9c07[''+(_0x1e846e+_0x5796ae)]=_0x457b4a[_0xf6a670(0x324)][_0x1e846e];if(_0x457b4a[_0xf6a670(0x2ec)][_0x1e846e])_0x534094[''+(_0x1e846e+_0x38c670)]=_0x457b4a['headerMap'][_0x1e846e];}const _0x157e99=_0x14f063[_0xf6a670(0x3d7)](),_0xbcfe93=_0x14f063['getColCount']();for(let _0x2bf333=0x0;_0x2bf333<_0x157e99;_0x2bf333++)for(let _0x5bdf9d=0x0;_0x5bdf9d<_0xbcfe93;_0x5bdf9d++){var _0x593224;const _0x37b270={...(_0x593224=_0x14f063[_0xf6a670(0x4d0)])===null||_0x593224===void 0x0||(_0x593224=_0x593224[_0x2bf333])===null||_0x593224===void 0x0?void 0x0:_0x593224[_0x5bdf9d]};let _0x24493b;if(_0x457b4a[_0xf6a670(0x324)][_0x2bf333][_0xf6a670(0x2fc)])_0x24493b=_0x457b4a[_0xf6a670(0x324)][_0x2bf333][_0xf6a670(0x394)]===0x0?defaultThemeStyle['grandTotal']:defaultThemeStyle[_0xf6a670(0x3ff)];else _0x24493b=defaultThemeStyle[_0xf6a670(0x292)];const _0x5172eb=_0x457b4a[_0xf6a670(0x324)][_0x2bf333][_0xf6a670(0x2c6)],_0x438d59=_0x24c339[_0xf6a670(0x324)][_0x5bdf9d]['valueIndex'],_0x33eee=Math['max'](_0x5172eb,_0x438d59),_0x839b8d=_0x54e9c7[_0xf6a670(0x30c)]['valueFields']['concat']();let _0xf93565='';if(_0x33eee<0x0){var _0x312014;_0xf93565=(_0x312014=_0x839b8d[0x0])!==null&&_0x312014!==void 0x0?_0x312014:'';}else{var _0x55176f;_0xf93565=(_0x55176f=_0x839b8d[_0x33eee])!==null&&_0x55176f!==void 0x0?_0x55176f:'';}const _0x48b168=_0x39d43d[_0xf93565];if(_0x48b168)_0x24493b={..._0x24493b,'n':{'pattern':_0x48b168}};_0x404db2[_0xf6a670(0x438)](_0x2bf333+_0x5796ae,_0x5bdf9d+_0x377adf,transformPivotDataToCellData$1(_0x4641a2,_0x37b270,_0x24493b));}return{'valueMatrix':_0x404db2,'rowInfo':_0x2f9c07,'colInfo':_0x3e3f67,'cornerInfo':_0x32ee25,'rowHeaderMap':_0x534094,'colHeaderMap':_0xf6a70b};};function transFromCellValue(_0x1aed85,_0x5c8476,_0x25aa4d,_0x4fd5c9){const _0x49fd3e=_0x273cf5;let _0x24722f=_0x1aed85['v'];if(_0x5c8476)_0x24722f=''+_0x4fd5c9[_0x49fd3e(0x2d3)];const _0x714731=_0x1aed85['t']&&(_0x1aed85['t']&_univerjs_pro_engine_pivot[_0x49fd3e(0x26f)][_0x49fd3e(0x3cb)])>0x0;if(_0x714731)_0x24722f=''+_0x4fd5c9[_0x49fd3e(0x4bb)];const _0x5434bb=_0x1aed85['t']&&(_0x1aed85['t']&_univerjs_pro_engine_pivot[_0x49fd3e(0x26f)][_0x49fd3e(0x321)])>0x0;if(_0x5434bb)_0x24722f=''+_0x4fd5c9[_0x49fd3e(0x276)];if(_0x1aed85['s']===_univerjs_pro_engine_pivot[_0x49fd3e(0x48a)][_0x49fd3e(0x252)]){let _0x33ab18=_0x24722f,_0x2fd99f='';(0x0,_univerjs_pro_engine_pivot[_0x49fd3e(0x4d5)])(_0x24722f)&&(_0x33ab18=_0x24722f['prefix'],_0x2fd99f=_0x24722f['value']);const _0x1eab01=_0x25aa4d&&!_0x714731&&!_0x5434bb?_univerjs_core[_0x49fd3e(0x30f)]['format'](_0x25aa4d,Number(_0x33ab18)):_0x33ab18;if(_0x2fd99f)_0x24722f=_0x1eab01+'\x20'+_0x2fd99f;else _0x24722f=_0x1eab01+'\x20'+_0x4fd5c9[_0x49fd3e(0x1dc)];}else{if(_0x1aed85['s']===_univerjs_pro_engine_pivot[_0x49fd3e(0x48a)][_0x49fd3e(0x2e6)])_0x24722f=_0x24722f+'\x20'+_0x4fd5c9['sheets-pivot.grandTotal'];}return _0x24722f;}function transformErrorValue(_0x143351){const _0x1c2952=_0x273cf5;if((0x0,_univerjs_pro_engine_pivot[_0x1c2952(0x492)])(_0x143351)){const {errorType:_0x586032}=_0x143351;switch(_0x586032){case _univerjs_pro_engine_pivot[_0x1c2952(0x279)]['Div0']:return _univerjs_engine_formula[_0x1c2952(0x3af)][_0x1c2952(0x4b6)];case _univerjs_pro_engine_pivot[_0x1c2952(0x279)]['NotNumber']:return _univerjs_engine_formula[_0x1c2952(0x3af)][_0x1c2952(0x483)];case _univerjs_pro_engine_pivot[_0x1c2952(0x279)]['NotFunction']:return _univerjs_engine_formula[_0x1c2952(0x3af)][_0x1c2952(0x3fa)];case _univerjs_pro_engine_pivot[_0x1c2952(0x279)]['NotName']:return _univerjs_engine_formula['ErrorType'][_0x1c2952(0x3fa)];case _univerjs_pro_engine_pivot[_0x1c2952(0x279)][_0x1c2952(0x3f2)]:return _univerjs_engine_formula[_0x1c2952(0x3af)][_0x1c2952(0x356)];}}return _0x143351;}function getAdjustRangesPosition(_0x1154f9,_0x5adfbe,_0x39fceb=![],_0x439446=![]){const _0x175e1e=_0x273cf5,{data:_0x61cb52}=_0x5adfbe,_0x2b8b9c=_0x5adfbe[_0x175e1e(0x3d7)](),_0x225b04=_0x5adfbe[_0x175e1e(0x456)]();if(_0x2b8b9c<=0x0||_0x225b04<=0x0)return[];const _0x2211fb=_0x5adfbe[_0x175e1e(0x268)](),_0x555b67=_0x5adfbe[_0x175e1e(0x218)](),_0x575138=_0x439446?_0x555b67>=0x0?_0x555b67+0x1:0x0:_0x2b8b9c,_0x59a595=_0x439446?_0x2211fb>=0x0?_0x2211fb+0x1:0x0:_0x225b04,{row:_0x587509,col:_0x73b9db}=_0x1154f9,_0x5286e2=_0x587509,_0x32b514=_0x73b9db;if(_0x39fceb){const _0x446bb5=[];for(const [_0x1a35bc,_0x1c0db2]of Object[_0x175e1e(0x2f5)](_0x61cb52))for(const [_0x7c7e36,_0x4939c1]of Object[_0x175e1e(0x2f5)](_0x1c0db2))_0x446bb5[_0x175e1e(0x4e8)]((0x0,_univerjs_core[_0x175e1e(0x38d)])(_0x5286e2+Number(_0x1a35bc),_0x32b514+Number(_0x7c7e36)));return _0x446bb5;}else{const _0x713e24=_0x439446?_0x575138>0x0?0x1:0x0:0x1,_0x34e140=_0x439446?_0x59a595>0x0?0x1:0x0:0x1;return[{'startRow':_0x5286e2,'startColumn':_0x32b514,'endRow':_0x587509+_0x575138-_0x713e24,'endColumn':_0x73b9db+_0x59a595-_0x34e140}];}}const SHEET_PIVOT_IN_MAIN_THREAD=_0x273cf5(0x235),SHEET_PIVOT_EXCLUSIVE_ID=_0x273cf5(0x2a0);let PivotDisplayDataType=function(_0x304d3a){const _0x549dbb=_0x273cf5;return _0x304d3a['Filter']=_0x549dbb(0x33f),_0x304d3a['Panel']=_0x549dbb(0x43c),_0x304d3a[_0x549dbb(0x48b)]=_0x549dbb(0x427),_0x304d3a[_0x549dbb(0x441)]='AddPivotTableWithConfig',_0x304d3a['AddPivotTable']=_0x549dbb(0x3a9),_0x304d3a[_0x549dbb(0x229)]=_0x549dbb(0x360),_0x304d3a['RemovePivotField']='removePivotField',_0x304d3a['SetPivotCollapse']=_0x549dbb(0x2ba),_0x304d3a[_0x549dbb(0x4a8)]=_0x549dbb(0x411),_0x304d3a[_0x549dbb(0x3a5)]=_0x549dbb(0x422),_0x304d3a['SetPivotSetting']=_0x549dbb(0x421),_0x304d3a[_0x549dbb(0x375)]=_0x549dbb(0x3c7),_0x304d3a[_0x549dbb(0x1e0)]=_0x549dbb(0x498),_0x304d3a[_0x549dbb(0x3dd)]=_0x549dbb(0x4f2),_0x304d3a[_0x549dbb(0x1df)]=_0x549dbb(0x2bc),_0x304d3a[_0x549dbb(0x3eb)]=_0x549dbb(0x3b9),_0x304d3a[_0x549dbb(0x29e)]=_0x549dbb(0x207),_0x304d3a;}({});const defaultTextInfo={'sheets-pivot.blankValue':_0x273cf5(0x4bc),'sheets-pivot.columnName':_0x273cf5(0x4a1),'sheets-pivot.subTotalText':_0x273cf5(0x2a6),'sheets-pivot.grandTotalText':_0x273cf5(0x284),'sheets-pivot.valueText':_0x273cf5(0x3a1),'sheets-pivot.averageName':_0x273cf5(0x239),'sheets-pivot.countName':_0x273cf5(0x4e2),'sheets-pivot.countNumsName':_0x273cf5(0x4e2),'sheets-pivot.maxName':_0x273cf5(0x1f6),'sheets-pivot.minName':_0x273cf5(0x212),'sheets-pivot.productName':'Product\x20of\x20','sheets-pivot.stdDevName':'StdDev\x20of\x20','sheets-pivot.stdDevpName':_0x273cf5(0x294),'sheets-pivot.sumName':_0x273cf5(0x486),'sheets-pivot.varName':_0x273cf5(0x305),'sheets-pivot.varpName':_0x273cf5(0x412),'sheets-pivot.subTotal':_0x273cf5(0x252),'sheets-pivot.grandTotal':'Grand\x20Total','sheets-pivot.value':_0x273cf5(0x3da),'sheets-pivot.blank':_0x273cf5(0x3cb),'sheets-pivot.other':_0x273cf5(0x321),'sheets-pivot.emptyPivot.filter':_0x273cf5(0x390),'sheets-pivot.emptyPivot.row':_0x273cf5(0x3ec),'sheets-pivot.emptyPivot.column':_0x273cf5(0x20b),'sheets-pivot.emptyPivot.values':'Values'},defaultEmptyPivotGeneratedMutations={'undos':[],'redos':[],'preUndos':[],'preRedos':[]},PIVOT_PERFORM_CHECK=(0x0,_univerjs_core[_0x273cf5(0x42d)])(_0x273cf5(0x22b)),PIVOT_MUTATION_GENERATE=(0x0,_univerjs_core[_0x273cf5(0x287)])('pivotMutationGenerate');let CollectionChangeEnum=function(_0x317f2e){const _0x2b38f1=_0x273cf5;return _0x317f2e[_0x2b38f1(0x1dd)]='add',_0x317f2e['delete']=_0x2b38f1(0x33d),_0x317f2e['update']=_0x2b38f1(0x43d),_0x317f2e;}({}),PivotTableOperationEnum=function(_0x10400c){const _0x53203b=_0x273cf5;return _0x10400c['Add']=_0x53203b(0x1dd),_0x10400c[_0x53203b(0x2b2)]=_0x53203b(0x3ab),_0x10400c[_0x53203b(0x28d)]=_0x53203b(0x33d),_0x10400c;}({});const GetPivotDataLocalMutation={'type':_univerjs_core['CommandType'][_0x273cf5(0x3a2)],'id':'sheet.mutation.get-pivot-data-local','handler':()=>!![]},SendPivotDataLocalMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x3bd),'handler':()=>!![]},SendPivotViewLocalMutation={'type':_univerjs_core[_0x273cf5(0x4d7)]['MUTATION'],'id':'sheet.mutation.send-pivot-view-local','handler':()=>!![]},SendPivotConfigLocalMutation={'type':_univerjs_core['CommandType'][_0x273cf5(0x3a2)],'id':_0x273cf5(0x1ea),'handler':()=>!![]},SendInitPivotTextLocalMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x308),'handler':()=>!![]};function _typeof(_0x4062ca){'@babel/helpers - typeof';const _0x1156d5=_0x273cf5;return _typeof=_0x1156d5(0x3c4)==typeof Symbol&&_0x1156d5(0x474)==typeof Symbol[_0x1156d5(0x25b)]?function(_0x2e814f){return typeof _0x2e814f;}:function(_0x214c15){const _0x24e08f=_0x1156d5;return _0x214c15&&'function'==typeof Symbol&&_0x214c15[_0x24e08f(0x1f3)]===Symbol&&_0x214c15!==Symbol[_0x24e08f(0x32b)]?_0x24e08f(0x474):typeof _0x214c15;},_typeof(_0x4062ca);}function toPrimitive(_0x592ba5,_0x20853c){const _0x5a814a=_0x273cf5;if(_0x5a814a(0x364)!=_typeof(_0x592ba5)||!_0x592ba5)return _0x592ba5;var _0x425d59=_0x592ba5[Symbol[_0x5a814a(0x47e)]];if(void 0x0!==_0x425d59){var _0x1a6a90=_0x425d59[_0x5a814a(0x3c9)](_0x592ba5,_0x20853c||_0x5a814a(0x451));if(_0x5a814a(0x364)!=_typeof(_0x1a6a90))return _0x1a6a90;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return('string'===_0x20853c?String:Number)(_0x592ba5);}function toPropertyKey(_0x50ac94){const _0x318bf0=_0x273cf5;var _0x27dfa0=toPrimitive(_0x50ac94,_0x318bf0(0x3f3));return'symbol'==_typeof(_0x27dfa0)?_0x27dfa0:_0x27dfa0+'';}function _defineProperty(_0x380dbb,_0x4babfb,_0x5dd99d){const _0x5b30dd=_0x273cf5;return(_0x4babfb=toPropertyKey(_0x4babfb))in _0x380dbb?Object[_0x5b30dd(0x2e3)](_0x380dbb,_0x4babfb,{'value':_0x5dd99d,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x380dbb[_0x4babfb]=_0x5dd99d,_0x380dbb;}function __decorateParam(_0x43288c,_0x2a7301){return function(_0x39b2ca,_0x58069b){_0x2a7301(_0x39b2ca,_0x58069b,_0x43288c);};}function __decorate(_0x1b5098,_0x299fab,_0x312145,_0x4002b2){const _0x207cd1=_0x273cf5;var _0x4f157a=arguments[_0x207cd1(0x36f)],_0xd13e4c=_0x4f157a<0x3?_0x299fab:_0x4002b2===null?_0x4002b2=Object['getOwnPropertyDescriptor'](_0x299fab,_0x312145):_0x4002b2,_0x39a822;if(typeof Reflect==='object'&&typeof Reflect[_0x207cd1(0x1e8)]===_0x207cd1(0x3c4))_0xd13e4c=Reflect[_0x207cd1(0x1e8)](_0x1b5098,_0x299fab,_0x312145,_0x4002b2);else{for(var _0x411078=_0x1b5098[_0x207cd1(0x36f)]-0x1;_0x411078>=0x0;_0x411078--)if(_0x39a822=_0x1b5098[_0x411078])_0xd13e4c=(_0x4f157a<0x3?_0x39a822(_0xd13e4c):_0x4f157a>0x3?_0x39a822(_0x299fab,_0x312145,_0xd13e4c):_0x39a822(_0x299fab,_0x312145))||_0xd13e4c;}return _0x4f157a>0x3&&_0xd13e4c&&Object[_0x207cd1(0x2e3)](_0x299fab,_0x312145,_0xd13e4c),_0xd13e4c;}let SheetsPivotRPCService=class SheetsPivotRPCService extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x17ff90){const _0x32d20c=_0x273cf5;super(),this['_commandService']=_0x17ff90,_defineProperty(this,_0x32d20c(0x477),new Map());}[_0x273cf5(0x273)](_0x1a45e2){const _0x3f5e70=_0x273cf5,{version:_0x52d3ba}=_0x1a45e2,_0x1e353f=this[_0x3f5e70(0x477)][_0x3f5e70(0x29f)](_0x52d3ba);_0x1e353f&&(_0x1e353f(_0x1a45e2),this['_requestResolvers'][_0x3f5e70(0x33d)](_0x52d3ba));}[_0x273cf5(0x429)](_0x11c812){return new Promise((_0x4d9e53,_0x1032cf)=>{const _0xd252f9=_0x1f80,_0x3f9498=this[_0xd252f9(0x38c)]();this[_0xd252f9(0x477)]['set'](_0x3f9498,_0x4d9e53),this[_0xd252f9(0x381)][_0xd252f9(0x39a)](GetPivotDataLocalMutation['id'],{'version':_0x3f9498,..._0x11c812},{'onlyLocal':!![]});});}[_0x273cf5(0x38c)](){const _0x1f712a=_0x273cf5;return Math[_0x1f712a(0x384)]()[_0x1f712a(0x23d)](0x24)[_0x1f712a(0x2ea)](0x2,0x10);}};SheetsPivotRPCService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core['ICommandService']))],SheetsPivotRPCService);const getStringFromDataStream=_0x3d6793=>{const _0x3cdc8b=_0x273cf5;var _0xb52e10;return((_0xb52e10=_0x3d6793['body'])===null||_0xb52e10===void 0x0?void 0x0:_0xb52e10[_0x3cdc8b(0x35b)][_0x3cdc8b(0x205)](/\r\n$/,''))||'';};var SheetsPivotDataFieldManager=class extends _univerjs_pro_engine_pivot[_0x273cf5(0x3c6)]{constructor(_0x156a42,_0x365ab9){const _0x1e3066=_0x273cf5;super(),_defineProperty(this,'rangeKeyMap',{}),_defineProperty(this,_0x1e3066(0x2ae),void 0x0),_defineProperty(this,'_host',void 0x0),this[_0x1e3066(0x2ae)]=_0x365ab9,this[_0x1e3066(0x370)]=_0x156a42;}[_0x273cf5(0x494)](){const _0x3baf5d=_0x273cf5;for(const _0x10c4aa in this[_0x3baf5d(0x4d2)]){const _0x116453=this['dataFields'][_0x10c4aa],_0x4408c4=_0x116453['getRangeKey']();this[_0x3baf5d(0x21b)][_0x4408c4]=_0x116453[_0x3baf5d(0x368)]();}}[_0x273cf5(0x322)](){const _0x15060a=_0x273cf5,_0x45d684=this[_0x15060a(0x370)];return getAutoDisplayName$1['bind'](_0x45d684);}[_0x273cf5(0x34b)](_0x1d4073){const _0x4f4fea=_0x273cf5,_0x48783d=this[_0x4f4fea(0x4d2)][_0x1d4073][_0x4f4fea(0x3fc)];delete this[_0x4f4fea(0x4d2)][_0x1d4073],delete this['rangeKeyMap'][_0x48783d];}['addDataFieldWithoutUnitInfo'](_0x2b7480){const _0x127950=_0x273cf5;this[_0x127950(0x4d2)][_0x2b7480[_0x127950(0x368)]()]=_0x2b7480;}[_0x273cf5(0x1d9)](_0x350699){const _0x1b6d08=_0x273cf5;var _0x1e6864;const _0x40bc57=this[_0x1b6d08(0x370)]['getTargetByPivotId'](_0x350699);if(_0x40bc57){var _0x49c934;const {unitId:_0x3acf2d,subUnitId:_0x3aa766}=_0x40bc57,_0x50f129=(_0x49c934=this['_host']['getPivotTableConfig'](_0x3acf2d,_0x3aa766,_0x350699))===null||_0x49c934===void 0x0?void 0x0:_0x49c934[_0x1b6d08(0x3f5)];this['_host'][_0x1b6d08(0x3db)]({'token':_0x350699,'type':CollectionChangeEnum[_0x1b6d08(0x33d)],'dataRangeInfo':_0x50f129});}(_0x1e6864=this['getCollection'](_0x350699))===null||_0x1e6864===void 0x0||_0x1e6864[_0x1b6d08(0x4ef)](),delete this[_0x1b6d08(0x3d8)][_0x350699];}['getRangeKey'](_0x45e332,_0x499436){const _0x251541=_0x273cf5,{sheetName:_0x1a00f9,unitId:_0x46cb81,range:_0x59857f}=_0x45e332,{startRow:_0x2d5789,endRow:_0x50d967}=_0x59857f;return(0x0,_univerjs_engine_formula[_0x251541(0x371)])(_0x46cb81,_0x1a00f9,{'startRow':_0x2d5789,'endRow':_0x50d967,'startColumn':_0x499436,'endColumn':_0x499436});}[_0x273cf5(0x2db)](_0x3b0120){const _0xb9ca0b=_0x273cf5;return this[_0xb9ca0b(0x4d2)][this[_0xb9ca0b(0x21b)][_0x3b0120]];}[_0x273cf5(0x45b)](_0x6445de,_0x53794c){const _0x30788b=_0x273cf5;this[_0x30788b(0x21b)][_0x6445de]=_0x53794c;}[_0x273cf5(0x301)](_0x2ab952,_0xf055b1){const _0x6290c2=_0x273cf5;this['rangeKeyMap'][_0xf055b1]=this['rangeKeyMap'][_0x2ab952],delete this[_0x6290c2(0x21b)][_0x2ab952];}['addCollectionByJSON'](_0x4d8d58,_0x479d1f,_0xee6bcf,_0x2f060b){const _0x459ebf=_0x273cf5,_0x3a1ca7=new _univerjs_pro_engine_pivot['FieldsCollection'](this);_0x3a1ca7[_0x459ebf(0x374)](_0x479d1f);const _0x42beab=[];let _0x5ac786=0x0;for(const _0x174052 of _0x3a1ca7[_0x459ebf(0x2d6)]){const _0x115b47=this['getRangeKey'](_0xee6bcf,_0x5ac786),_0x56bc53=this[_0x459ebf(0x4d2)][_0x174052];_0x56bc53&&(_0x56bc53['rangeKey']=_0x115b47,this[_0x459ebf(0x45b)](_0x115b47,_0x174052),_0x42beab[_0x459ebf(0x4e8)]({'index':_0x5ac786,'dataField':_0x56bc53})),_0x5ac786++;}return this[_0x459ebf(0x430)](_0x4d8d58,_0x3a1ca7,_0xee6bcf,_0x2f060b),{'collection':_0x3a1ca7,'updateDataFieldList':_0x42beab};}[_0x273cf5(0x46f)](_0xbaf72,_0x428ade){const _0x253c46=_0x273cf5;if(_0xbaf72['rangeType']===_univerjs_core['RANGE_TYPE'][_0x253c46(0x304)])return{'startRow':0x0,'startColumn':_0xbaf72['startColumn'],'endRow':_0x428ade[_0x253c46(0x3d7)]()-0x1,'endColumn':_0xbaf72[_0x253c46(0x41e)]};return{'startRow':_0xbaf72[_0x253c46(0x3de)],'startColumn':_0xbaf72[_0x253c46(0x3ed)],'endRow':_0xbaf72[_0x253c46(0x4a7)],'endColumn':_0xbaf72['endColumn']};}['createCollectionWithDataRange'](_0x12e1eb){const _0x4d05a7=_0x273cf5,{sheetName:_0xca757d,range:_0x54f128}=_0x12e1eb,_0x2c0213=this[_0x4d05a7(0x2ae)][_0x4d05a7(0x3ae)](_univerjs_core[_0x4d05a7(0x37f)][_0x4d05a7(0x4aa)]),_0x4f81a6=_0x2c0213[_0x4d05a7(0x336)](_0xca757d),_0x2f4823=_0x4f81a6[_0x4d05a7(0x357)](),{startColumn:_0x5a8323,startRow:_0xe0ae69,endColumn:_0x5aaeeb}=this['getRangeStartEndInfo'](_0x54f128,_0x4f81a6),_0x3a09cd=_0x2c0213[_0x4d05a7(0x22c)](),_0x1e29cd=new _univerjs_pro_engine_pivot[(_0x4d05a7(0x30b))](this);_0x1e29cd[_0x4d05a7(0x1e2)](_0x12e1eb);const _0x293775=[],_0x1b3bbc={};for(let _0x24c974=_0x5a8323;_0x24c974<=_0x5aaeeb;_0x24c974++){const _0x345c25=_0x2f4823['getValue'](_0xe0ae69,_0x24c974),_0x41d13d=this[_0x4d05a7(0x339)](_0x12e1eb,_0x24c974),_0x40450f=this['getDataFieldByRangeKey'](_0x41d13d);if(!_0x40450f){const _0x11fe34=this['createDataFieldId']();let _0xb0b7d4=this[_0x4d05a7(0x40a)](_0x345c25,_0x3a09cd,_0x1b3bbc);if((0x0,_univerjs_pro_engine_pivot['isDateValue'])(_0xb0b7d4))_0xb0b7d4=_univerjs_core[_0x4d05a7(0x30f)]['format'](_0xb0b7d4['f'],Number(_0xb0b7d4['v']));const _0x1a59c8=this[_0x4d05a7(0x39f)](_0xb0b7d4,_0x24c974),_0x213432=new _univerjs_pro_engine_pivot[(_0x4d05a7(0x2cc))](_0x11fe34,_0x1a59c8,(0x0,_univerjs_pro_engine_pivot[_0x4d05a7(0x2f9)])(0x3));_0x213432[_0x4d05a7(0x3fc)]=_0x41d13d,this[_0x4d05a7(0x4d2)][_0x11fe34]=_0x213432,_0x1e29cd[_0x4d05a7(0x3e5)](_0x11fe34,_0x1a59c8),_0x293775[_0x4d05a7(0x4e8)]({'index':_0x24c974,'dataField':_0x213432});}else _0x1e29cd[_0x4d05a7(0x3e5)](_0x40450f[_0x4d05a7(0x368)](),_0x40450f[_0x4d05a7(0x416)]());}return{'updateDataFieldList':_0x293775,'collection':_0x1e29cd};}[_0x273cf5(0x2a2)](_0x36ddcc){const _0x2e4694=_0x273cf5;return this[_0x2e4694(0x370)]['getTextInfo']()[_0x2e4694(0x256)]+'\x20'+(0x0,_univerjs_core['numberToABC'])(_0x36ddcc);}[_0x273cf5(0x39f)](_0x15b503,_0x7acfbf){const _0x52f822=_0x273cf5;return _0x15b503===void 0x0||_0x15b503===null||_0x15b503===''?this[_0x52f822(0x2a2)](_0x7acfbf):String(_0x15b503);}[_0x273cf5(0x22d)](_0x4a775b){const _0x4e7881=_0x273cf5;return this[_0x4e7881(0x3d8)][_0x4a775b];}[_0x273cf5(0x430)](_0x390aa0,_0x1c0732,_0x225ce6,_0x5dab4e){const _0x118dcc=_0x273cf5;this['collections'][_0x390aa0]=_0x1c0732,_0x1c0732['setRange'](_0x225ce6),this['_host'][_0x118dcc(0x3db)]({'token':_0x390aa0,'type':CollectionChangeEnum[_0x118dcc(0x1dd)],'dataRangeInfo':_0x225ce6,'targetCellInfo':_0x5dab4e});}[_0x273cf5(0x470)](_0x29bdcd,_0x5965fb){const _0x152244=_0x273cf5,_0x44fbcb=this[_0x152244(0x22d)](_0x29bdcd),_0x298068=_0x44fbcb[_0x152244(0x4d4)]();let _0x3bdf92=0x0;for(const _0x2203fa of _0x298068){const _0x56532d=_0x44fbcb['getFieldById'](_0x2203fa),_0x279758=this['getRangeKey'](_0x5965fb,_0x3bdf92);this[_0x152244(0x301)](_0x56532d[_0x152244(0x3fc)],_0x279758),_0x3bdf92++;}}[_0x273cf5(0x2b8)](){return{'runtimeCellData':{},'dirtyRanges':{}};}[_0x273cf5(0x35a)](_0x1756c5,_0x342265){const _0x15a385=_0x273cf5;if(this[_0x15a385(0x22d)](_0x1756c5)){const _0x28593d=this[_0x15a385(0x44e)](_0x342265),_0x2b33ab=[];for(const _0x3130e3 of _0x28593d)if(this['rangeKeyMap'][_0x3130e3]!==void 0x0)_0x2b33ab[_0x15a385(0x4e8)](this[_0x15a385(0x21b)][_0x3130e3]);const _0x54655b=this[_0x15a385(0x349)](_0x1756c5),_0x17fba4=[],_0x3bbbb2=new Set(_0x2b33ab);for(const _0x4b11aa of _0x54655b)if(!_0x3bbbb2[_0x15a385(0x388)](_0x4b11aa))_0x17fba4[_0x15a385(0x4e8)](_0x4b11aa);return _0x17fba4;}}[_0x273cf5(0x2d8)](_0x3d03ed,_0x6cd938,_0x2bdd79,_0x30efcb,_0x6ca719){const _0xd90893=_0x273cf5;if(_0x6cd938){if(_0x6cd938[_0xd90893(0x3e2)](_0x30efcb,_0x6ca719))return _0x6cd938[_0xd90893(0x3e2)](_0x30efcb,_0x6ca719);}if(_0x2bdd79){if(_0x2bdd79['getValue'](_0x30efcb,_0x6ca719))return _0x2bdd79[_0xd90893(0x3e2)](_0x30efcb,_0x6ca719);}return _0x3d03ed[_0xd90893(0x3e2)](_0x30efcb,_0x6ca719);}[_0x273cf5(0x4d3)](_0x296574,_0x55fc5a,_0x2bffc4,_0x26e0c3){const _0x2b44a9=_0x273cf5,_0x5e5fbf=this[_0x2b44a9(0x4d2)][_0x296574];if(!_0x5e5fbf)return;const {subUnitId:_0x4384e3,range:_0x52c11,unitId:_0x48fa90}=_0x55fc5a,_0x469c5b=this[_0x2b44a9(0x2ae)][_0x2b44a9(0x2c7)](_0x48fa90);if(!_0x469c5b){console[_0x2b44a9(0x254)](_0x2b44a9(0x28e));return;}const _0x4ec283=_0x469c5b[_0x2b44a9(0x38f)](_0x4384e3),_0x1015df=_0x4ec283[_0x2b44a9(0x357)](),{arrayFormulaCellDataMatrix:_0x2bac3a,unitDataMatrix:_0x5d101f}=_0x26e0c3||{},{startRow:_0x46e887,startColumn:_0xe4cc23,endRow:_0x1116a7}=this[_0x2b44a9(0x46f)](_0x52c11,_0x4ec283);_0x5e5fbf['reset']();const _0x37d2f0=_0x469c5b[_0x2b44a9(0x22c)](),_0x15b820={},_0x5b064a=this['getMatrixValue'](_0x1015df,_0x2bac3a,_0x5d101f,_0x46e887,_0xe4cc23+_0x2bffc4);let _0x3d3826=this['adjustSheetCellData'](_0x5b064a,_0x37d2f0,_0x15b820);if((0x0,_univerjs_pro_engine_pivot[_0x2b44a9(0x312)])(_0x3d3826))_0x3d3826=_univerjs_core[_0x2b44a9(0x30f)]['format'](_0x3d3826['f'],Number(_0x3d3826['v']));const _0x4c1d38=this[_0x2b44a9(0x39f)](_0x3d3826,_0xe4cc23+_0x2bffc4);_0x5e5fbf[_0x2b44a9(0x222)](_0x4c1d38);for(let _0x33843a=_0x46e887+0x1;_0x33843a<=_0x1116a7;_0x33843a++){const _0x4c4785=this[_0x2b44a9(0x2d8)](_0x1015df,_0x2bac3a,_0x5d101f,_0x33843a,_0xe4cc23+_0x2bffc4);_0x5e5fbf[_0x2b44a9(0x378)](this[_0x2b44a9(0x40a)](_0x4c4785,_0x37d2f0,_0x15b820),_0x33843a-0x1-_0x46e887);}}[_0x273cf5(0x450)](_0x2b5dab,_0x4fd025,_0x21c21a){const _0x5a52de=_0x273cf5,{subUnitId:_0x884cf8,range:_0x49e3d6,unitId:_0x5182a1}=_0x21c21a,_0x43bf14=this[_0x5a52de(0x2ae)][_0x5a52de(0x2c7)](_0x5182a1);if(!_0x43bf14){console['error'](_0x5a52de(0x28e));return;}const _0x3053f1=_0x43bf14[_0x5a52de(0x38f)](_0x884cf8),_0x3ef8a8=_0x3053f1[_0x5a52de(0x357)](),{startRow:_0x1730ce,startColumn:_0xb959ca,endRow:_0x366db9}=this['getRangeStartEndInfo'](_0x49e3d6,_0x3053f1),_0x1b8900=_0x43bf14[_0x5a52de(0x22c)](),_0x4166f4={};for(const {dataField:_0x35947d,index:_0x24bad8}of _0x4fd025){_0x35947d[_0x5a52de(0x448)]();const _0xc0c93b=this[_0x5a52de(0x2d8)](_0x3ef8a8,void 0x0,void 0x0,_0x1730ce,_0xb959ca+_0x24bad8);let _0x405366=this[_0x5a52de(0x40a)](_0xc0c93b,_0x1b8900,_0x4166f4);if((0x0,_univerjs_pro_engine_pivot[_0x5a52de(0x312)])(_0x405366))_0x405366=_univerjs_core[_0x5a52de(0x30f)][_0x5a52de(0x263)](_0x405366['f'],Number(_0x405366['v']));const _0x110793=this[_0x5a52de(0x39f)](_0x405366,_0xb959ca+_0x24bad8);_0x35947d['setName'](_0x110793);}_0x2b5dab[_0x5a52de(0x48d)]();for(let _0xa1f02a=_0x1730ce+0x1;_0xa1f02a<=_0x366db9;_0xa1f02a++)for(const {index:_0x4fa719,dataField:_0x5f1c60}of _0x4fd025){const _0x1cff35=_0x3ef8a8[_0x5a52de(0x3e2)](_0xa1f02a,_0xb959ca+_0x4fa719);_0x5f1c60[_0x5a52de(0x378)](this['adjustSheetCellData'](_0x1cff35,_0x1b8900,_0x4166f4),_0xa1f02a-0x1-_0x1730ce);}_0x2b5dab[_0x5a52de(0x34d)](_0x366db9-_0x1730ce);}[_0x273cf5(0x44e)](_0x5ec21a){const _0x28cc3e=_0x273cf5,{range:_0x29439b}=_0x5ec21a,{startColumn:_0x20f660,endColumn:_0x148ce6}=_0x29439b,_0x3ab564=[];for(let _0x55b2c3=_0x20f660;_0x55b2c3<=_0x148ce6;_0x55b2c3++)_0x3ab564['push'](this[_0x28cc3e(0x339)](_0x5ec21a,_0x55b2c3));return _0x3ab564;}['adjustSheetCellData'](_0x52f8b4,_0x3d0e1b,_0x2ee6d8){const _0x3894b3=_0x273cf5;if(_0x52f8b4){const {s:_0x229fb5,v:_0x5f85fe,t:_0x42263f,p:_0x2632e1}=_0x52f8b4;if(_0x2632e1)return getStringFromDataStream(_0x2632e1);const _0x120fa8=_0x3d0e1b[_0x3894b3(0x29f)](_0x229fb5);if(_0x120fa8&&_0x42263f===_univerjs_core[_0x3894b3(0x42e)][_0x3894b3(0x433)]&&_0x120fa8['n']){const {pattern:_0x3ebc9b}=_0x120fa8['n'];if(!_0x2ee6d8[_0x3ebc9b])_0x2ee6d8[_0x3ebc9b]=_univerjs_core['numfmt'][_0x3894b3(0x2de)](_0x3ebc9b);const _0x32fd10=_0x2ee6d8[_0x3ebc9b],_0xc158fa=_0x32fd10['isDate'];if(_0x32fd10[_0x3894b3(0x1eb)])return String(_0x5f85fe);else{if(_0xc158fa)return{'v':_0x5f85fe,'f':_0x3ebc9b};}}if(_0x42263f===_univerjs_core[_0x3894b3(0x42e)][_0x3894b3(0x433)])return Number(_0x5f85fe);else{if(_0x42263f===_univerjs_core['CellValueType'][_0x3894b3(0x47a)]||_0x42263f===_univerjs_core[_0x3894b3(0x42e)]['FORCE_STRING'])return String(_0x5f85fe);}if(_0x42263f===void 0x0){const _0x599bed=Number(_0x5f85fe);if(!Number['isNaN'](_0x599bed)&&String(_0x599bed)===_0x5f85fe)return _0x599bed;}return _0x5f85fe!==null&&_0x5f85fe!==void 0x0?_0x5f85fe:null;}else return null;}[_0x273cf5(0x398)](_0x3ec464){const _0x3abb36=_0x273cf5,{sheetName:_0x3a908a,range:_0x519edf,unitId:_0x44be60}=_0x3ec464,_0x18e95d=this['_univerInstanceService'][_0x3abb36(0x2c7)](_0x44be60);if(!_0x18e95d)return console[_0x3abb36(0x254)](_0x3abb36(0x28e)),{'header':[],'data':[]};const _0x2d866c=_0x18e95d['getSheetBySheetName'](_0x3a908a),_0x203a40=_0x2d866c[_0x3abb36(0x357)](),{startRow:_0x134550,startColumn:_0x2cc9b9,endRow:_0x3761f3,endColumn:_0x40fe76}=this[_0x3abb36(0x46f)](_0x519edf,_0x2d866c),_0x921b87=_0x18e95d[_0x3abb36(0x22c)](),_0x5d28e1=[],_0x1c637f=[],_0x133898={};for(let _0x196e1c=_0x134550;_0x196e1c<=_0x3761f3;_0x196e1c++){const _0x423f59=[];for(let _0x2c43e7=_0x2cc9b9;_0x2c43e7<=_0x40fe76;_0x2c43e7++){const _0x6564c2=_0x203a40[_0x3abb36(0x3e2)](_0x196e1c,_0x2c43e7);if(_0x196e1c===_0x134550)_0x5d28e1['push'](_0x6564c2===void 0x0||_0x6564c2===null?null:String(_0x6564c2['v']));else _0x423f59[_0x3abb36(0x4e8)](this[_0x3abb36(0x40a)](_0x6564c2,_0x921b87,_0x133898));}_0x1c637f[_0x3abb36(0x4e8)](_0x423f59);}return{'header':_0x5d28e1,'data':_0x1c637f};}[_0x273cf5(0x480)](){return super['toJSON']();}[_0x273cf5(0x374)](_0x54cf06){const _0x35277c=_0x273cf5;super[_0x35277c(0x374)](_0x54cf06),this[_0x35277c(0x494)]();}['dispose'](){const _0x2800ff=_0x273cf5;super[_0x2800ff(0x4ef)](),this['rangeKeyMap']={},this['_host']=null;}};const adjustEmptyViewForCalcEngine=_0x319002=>{const _0x490893=_0x273cf5,{targetCellInfo:_0x2e95d8}=_0x319002,{matrixCache:_0xfc23f5,rangesCache:_0x197104}=generateDefaultEmptyCache({'filter':_0x490893(0x390),'row':_0x490893(0x3ec),'column':_0x490893(0x20b),'values':_0x490893(0x348)},_0x2e95d8),_0x3f16df=new _univerjs_core[(_0x490893(0x24d))]();return _0xfc23f5[_0x490893(0x3bf)]((_0x24409f,_0x5742a7,_0x5d2e8c)=>{const _0xc9d2cb=_0x490893;_0x3f16df[_0xc9d2cb(0x438)](_0x24409f,_0x5742a7,_0x5d2e8c);}),{'matrix':_0x3f16df,'rangesCache':_0x197104};},transformPivotDataToCellData=_0x5572bd=>{const _0x5addb8=_0x273cf5;let _0x48c3f9;if((_0x5572bd===null||_0x5572bd===void 0x0?void 0x0:_0x5572bd['v'])||(_0x5572bd===null||_0x5572bd===void 0x0?void 0x0:_0x5572bd['v'])===0x0){if(!_0x48c3f9)_0x48c3f9={};const _0x253043=transformErrorValue(_0x5572bd['v']);if(typeof _0x253043===_0x5addb8(0x1f1))_0x48c3f9['t']=_univerjs_core['CellValueType'][_0x5addb8(0x433)];else{if(typeof _0x253043===_0x5addb8(0x3f3))_0x48c3f9['t']=_univerjs_core[_0x5addb8(0x42e)]['STRING'];}_0x48c3f9['v']=_0x253043;}return _0x48c3f9;},generatorAdjustPositionData=(_0x368885,_0xd25c12,_0x41769a)=>{const _0x402896=_0x273cf5,{cornerView:_0xafbf0c,rowView:_0x29ee74,colView:_0x42ae6a,dataView:_0x37edd2,pageView:_0x4ab9a6,formatMap:_0x32bcd9}=_0x368885,{row:_0x15effe,col:_0x324ddf}=_0xd25c12,_0x38233a=new _univerjs_core[(_0x402896(0x24d))]();let _0x546ef9=_0x15effe,_0x314d95=_0x324ddf;Object[_0x402896(0x260)](_0x4ab9a6[_0x402896(0x4d0)])['forEach'](_0x3d11d7=>{const _0x10aa5d=_0x402896;Object[_0x10aa5d(0x260)](_0x4ab9a6[_0x10aa5d(0x4d0)][Number(_0x3d11d7)])[_0x10aa5d(0x24b)](_0x24456e=>{const _0x5c337b={..._0x4ab9a6['data'][Number(_0x3d11d7)][Number(_0x24456e)]};_0x38233a['setValue'](Number(_0x3d11d7)+_0x546ef9,Number(_0x24456e)+_0x314d95,transformPivotDataToCellData(_0x5c337b));});});const _0x292e23=Object[_0x402896(0x260)](_0x4ab9a6[_0x402896(0x4d0)])['length'];_0x546ef9+=_0x292e23+(_0x292e23?0x1:0x0);const _0x5d3037=_0xafbf0c[_0x402896(0x3d7)](),_0x20688e=_0xafbf0c['getColCount']();for(let _0x2999f1=0x0;_0x2999f1<_0x5d3037;_0x2999f1++)for(let _0x52db3a=0x0;_0x52db3a<_0x20688e;_0x52db3a++){var _0x4823ea;const _0x4c32c2={...(_0x4823ea=_0xafbf0c[_0x402896(0x4d0)])===null||_0x4823ea===void 0x0||(_0x4823ea=_0x4823ea[_0x2999f1])===null||_0x4823ea===void 0x0?void 0x0:_0x4823ea[_0x52db3a]};if(_0x4c32c2){var _0x119686;if(((_0x119686=_0x29ee74['headerMap'][_0x52db3a])===null||_0x119686===void 0x0?void 0x0:_0x119686[_0x402896(0x4eb)])&&_0x52db3a===_0x20688e-0x1&&_0x2999f1===_0x5d3037-0x1)_0x4c32c2['v']=''+_0x41769a[_0x402896(0x2d3)];}_0x38233a['setValue'](_0x2999f1+_0x546ef9,_0x52db3a+_0x314d95,transformPivotDataToCellData(_0x4c32c2));}_0x314d95+=_0x20688e;const _0x1c36e8=_0x42ae6a[_0x402896(0x2ec)],_0x6e9bce=_0x42ae6a[_0x402896(0x218)]()>=0x0?_0x42ae6a[_0x402896(0x218)]()+0x1:0x0,_0x37e58b=_0x42ae6a[_0x402896(0x268)]()>=0x0?_0x42ae6a[_0x402896(0x268)]()+0x1:0x0;for(let _0x904478=0x0;_0x904478<_0x37e58b;_0x904478++)for(let _0x51ae63=0x0;_0x51ae63<_0x6e9bce;_0x51ae63++){var _0x26cf5d,_0xc198c;const _0x170f46={...(_0x26cf5d=_0x42ae6a[_0x402896(0x4d0)])===null||_0x26cf5d===void 0x0||(_0x26cf5d=_0x26cf5d[_0x904478])===null||_0x26cf5d===void 0x0?void 0x0:_0x26cf5d[_0x51ae63]},_0x3615f4=_0x32bcd9[(_0xc198c=_0x1c36e8[_0x904478])===null||_0xc198c===void 0x0?void 0x0:_0xc198c[_0x402896(0x1cf)]];if(_0x170f46){var _0x553a9d;_0x170f46['v']=transFromCellValue(_0x170f46,_0x904478===0x0&&((_0x553a9d=_0x42ae6a[_0x402896(0x24f)](_0x51ae63+0x1))===null||_0x553a9d===void 0x0?void 0x0:_0x553a9d[_0x402896(0x4eb)]),_0x3615f4,_0x41769a);}_0x38233a[_0x402896(0x438)](_0x904478+_0x546ef9,_0x51ae63+_0x314d95,transformPivotDataToCellData(_0x170f46));}_0x546ef9+=_0x5d3037;const _0x1dd053=_0x29ee74['headerMap'],_0xe69c30=_0x29ee74['getLastRow']()>=0x0?_0x29ee74[_0x402896(0x218)]()+0x1:0x0,_0x3c2cf8=_0x29ee74['getLastCol']()>=0x0?_0x29ee74['getLastCol']()+0x1:0x0;for(let _0x3e6a71=0x0;_0x3e6a71<_0xe69c30;_0x3e6a71++)for(let _0xc3619f=0x0;_0xc3619f<_0x3c2cf8;_0xc3619f++){var _0x30522e,_0x105b37;const _0x1df325={...(_0x30522e=_0x29ee74[_0x402896(0x4d0)])===null||_0x30522e===void 0x0||(_0x30522e=_0x30522e[_0x3e6a71])===null||_0x30522e===void 0x0?void 0x0:_0x30522e[_0xc3619f]},_0x5057b3=_0x32bcd9[(_0x105b37=_0x1dd053[_0xc3619f])===null||_0x105b37===void 0x0?void 0x0:_0x105b37[_0x402896(0x1cf)]];if(_0x1df325)_0x1df325['v']=transFromCellValue(_0x1df325,![],_0x5057b3,_0x41769a);_0x38233a[_0x402896(0x438)](_0x3e6a71+_0x546ef9,_0xc3619f+_0x324ddf,transformPivotDataToCellData(_0x1df325));}const _0x501839=_0x37edd2['getRowCount'](),_0x5cbb78=_0x37edd2[_0x402896(0x456)]();for(let _0x345b93=0x0;_0x345b93<_0x501839;_0x345b93++)for(let _0x10c81e=0x0;_0x10c81e<_0x5cbb78;_0x10c81e++){var _0x48e019;const _0x5cc40f={...(_0x48e019=_0x37edd2[_0x402896(0x4d0)])===null||_0x48e019===void 0x0||(_0x48e019=_0x48e019[_0x345b93])===null||_0x48e019===void 0x0?void 0x0:_0x48e019[_0x10c81e]};_0x38233a[_0x402896(0x438)](_0x345b93+_0x546ef9,_0x10c81e+_0x314d95,transformPivotDataToCellData(_0x5cc40f));}return _0x38233a;},adjustViewForCalcEngine=_0x1b0a84=>{const _0x511e69=_0x273cf5,{view:_0x532678,targetCellInfo:_0x4ed013,isEmpty:_0x10833c,textInfo:_0x2d2ba6}=_0x1b0a84;if(_0x10833c)return adjustEmptyViewForCalcEngine(_0x1b0a84);const {pageView:_0x362f84,cornerView:_0x4611db,rowView:_0x2e972d,colView:_0x5d035f,dataView:_0x426116}=_0x532678,_0x2f6341=getAdjustRangesPosition(_0x4ed013,_0x362f84,!![]),_0x3b047d=_0x362f84[_0x511e69(0x30a)]>=0x0?_0x362f84['lastRow']+0x1:0x0,_0xa2c2b5=_0x4611db[_0x511e69(0x3d7)](),_0x53e40d=_0x4611db[_0x511e69(0x456)](),_0x1c69c8=_0x2f6341[_0x511e69(0x36f)]>0x0?0x1:0x0,_0x372b9d=getAdjustRangesPosition({'row':_0x4ed013[_0x511e69(0x1ed)]+_0x3b047d+_0x1c69c8,'col':_0x4ed013['col']},_0x4611db,![],![]),_0x53b33b={'rowRanges':getAdjustRangesPosition({'row':_0x4ed013['row']+_0x3b047d+_0x1c69c8+_0xa2c2b5,'col':_0x4ed013['col']},_0x2e972d,![],!![]),'colRanges':getAdjustRangesPosition({'row':_0x4ed013['row']+_0x3b047d+_0x1c69c8,'col':_0x4ed013['col']+_0x53e40d},_0x5d035f,![],!![]),'cornerRanges':_0x372b9d,'dataRanges':getAdjustRangesPosition({'row':_0x4ed013[_0x511e69(0x1ed)]+_0x3b047d+_0x1c69c8+_0xa2c2b5,'col':_0x4ed013[_0x511e69(0x2d4)]+_0x53e40d},_0x426116,![],![]),'pageRanges':_0x2f6341};return{'matrix':generatorAdjustPositionData(_0x532678,_0x4ed013,_0x2d2ba6),'rangesCache':_0x53b33b};};let SheetsPivotDataSourceModel=class SheetsPivotDataSourceModel extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x2cc430,_0x1dc9e2,_0x524131,_0x411aaf,_0x286f2e){const _0x181b32=_0x273cf5;super(),this[_0x181b32(0x24c)]=_0x2cc430,this['_univerInstanceService']=_0x1dc9e2,this[_0x181b32(0x314)]=_0x524131,this[_0x181b32(0x381)]=_0x411aaf,this[_0x181b32(0x22e)]=_0x286f2e,_defineProperty(this,'_model',new Map()),_defineProperty(this,'_pivotTableInstanceCache',new Map()),_defineProperty(this,_0x181b32(0x2a9),new Map()),_defineProperty(this,_0x181b32(0x49f),void 0x0),_defineProperty(this,_0x181b32(0x464),new rxjs['Subject']()),_defineProperty(this,_0x181b32(0x3f7),this['_collectionChange$'][_0x181b32(0x4b8)]()),_defineProperty(this,_0x181b32(0x243),new rxjs['Subject']()),_defineProperty(this,_0x181b32(0x2a5),this['_viewData$'][_0x181b32(0x4b8)]()),_defineProperty(this,_0x181b32(0x320),new rxjs[(_0x181b32(0x45f))]()),_defineProperty(this,'fieldsCollectionChange$',this['_fieldsCollectionChange$'][_0x181b32(0x4b8)]()),_defineProperty(this,_0x181b32(0x334),new Map()),_defineProperty(this,_0x181b32(0x258),[]),_defineProperty(this,_0x181b32(0x297),new Map()),this['_initSnapshot']();}[_0x273cf5(0x471)](){const _0x725914=_0x273cf5;if(!this[_0x725914(0x49f)])return defaultTextInfo;return this[_0x725914(0x49f)];}[_0x273cf5(0x4ee)](_0x5c9133){const _0x4cdab1=_0x273cf5;this[_0x4cdab1(0x49f)]=_0x5c9133;}[_0x273cf5(0x470)](_0x438ab8){const _0x65b95c=_0x273cf5,{from:_0x5deca8,to:_0x3f8598,unitId:_0x2e5a92,fromRange:_0x5d7dd8,toRange:_0x354938}=_0x438ab8;if(_0x5deca8&&_0x3f8598){var _0xe4339a;const _0x4015f0=this['getDataFieldManager'](_0x2e5a92),_0x5db45b=this[_0x65b95c(0x23c)][_0x65b95c(0x29f)](_0x2e5a92),_0x27bd86=(_0xe4339a=this[_0x65b95c(0x2ae)][_0x65b95c(0x2c7)](_0x2e5a92))===null||_0xe4339a===void 0x0?void 0x0:_0xe4339a['getSheetBySheetId'](_0x3f8598[_0x65b95c(0x23b)]);if(!_0x5db45b||!_0x27bd86)return;const _0x2e9380=_0x27bd86===null||_0x27bd86===void 0x0?void 0x0:_0x27bd86['getName']();for(const [_0x5bd83d,_0x4e8be0]of _0x5db45b[_0x65b95c(0x2f5)]())for(const [_0xf06bd1,_0x56ebfd]of _0x4e8be0[_0x65b95c(0x2f5)]()){const {sourceRangeInfo:_0x23d1e0}=_0x56ebfd;if(_0x23d1e0[_0x65b95c(0x452)]===_0x2e5a92&&_0x23d1e0[_0x65b95c(0x23b)]===_0x5deca8[_0x65b95c(0x23b)]&&_univerjs_core[_0x65b95c(0x3ce)][_0x65b95c(0x1ef)](_0x5d7dd8,_0x23d1e0['range'])){const _0x51af4c={'row':_0x23d1e0[_0x65b95c(0x36b)][_0x65b95c(0x3de)]-_0x5d7dd8[_0x65b95c(0x3de)],'col':_0x23d1e0['range'][_0x65b95c(0x3ed)]-_0x5d7dd8[_0x65b95c(0x3ed)]},_0x379edc={'unitId':_0x2e5a92,'subUnitId':_0x3f8598['subUnitId'],'sheetName':_0x2e9380,'range':{'startRow':_0x354938[_0x65b95c(0x3de)]+_0x51af4c['row'],'endRow':_0x354938[_0x65b95c(0x3de)]+_0x51af4c[_0x65b95c(0x1ed)]+_0x23d1e0[_0x65b95c(0x36b)][_0x65b95c(0x4a7)]-_0x23d1e0[_0x65b95c(0x36b)][_0x65b95c(0x3de)],'startColumn':_0x354938['startColumn']+_0x51af4c[_0x65b95c(0x2d4)],'endColumn':_0x354938[_0x65b95c(0x3ed)]+_0x51af4c[_0x65b95c(0x2d4)]+_0x23d1e0['range'][_0x65b95c(0x41e)]-_0x23d1e0[_0x65b95c(0x36b)][_0x65b95c(0x3ed)]}};_0x4015f0[_0x65b95c(0x470)](_0xf06bd1,_0x379edc);const _0x573d84={..._0x56ebfd,'sourceRangeInfo':_0x379edc};this[_0x65b95c(0x33e)](_0x2e5a92,_0x3f8598[_0x65b95c(0x23b)],_0xf06bd1,_0x573d84),this[_0x65b95c(0x3db)]({'unitId':_0x2e5a92,'token':_0xf06bd1,'type':CollectionChangeEnum[_0x65b95c(0x43d)],'oldSourceRangeInfo':_0x23d1e0,'dataRangeInfo':_0x379edc,'targetCellInfo':_0x56ebfd[_0x65b95c(0x1db)]}),this[_0x65b95c(0x331)]({'unitId':_0x2e5a92,'subUnitId':_0x3f8598[_0x65b95c(0x23b)],'oldSubUnitId':_0x5bd83d,'pivotTableId':_0xf06bd1,'pivotTableConfig':_0x573d84,'collectionConfig':_0x4015f0[_0x65b95c(0x480)]()});}}}}['broadcastCollectionChange'](_0x2023b6){const _0x146105=_0x273cf5;this['_collectionChange$'][_0x146105(0x28f)](_0x2023b6);}[_0x273cf5(0x1f5)](_0x196528){const _0x268d97=_0x273cf5;let _0x3c9062=this[_0x268d97(0x334)][_0x268d97(0x29f)](_0x196528);return!_0x3c9062&&(_0x3c9062=new SheetsPivotDataFieldManager(this,this['_univerInstanceService']),this[_0x268d97(0x334)]['set'](_0x196528,_0x3c9062)),_0x3c9062;}[_0x273cf5(0x22d)](_0x2ebe22,_0x2cd69f){const _0x398b60=_0x273cf5;return this['getDataFieldManager'](_0x2ebe22)[_0x398b60(0x3d8)][_0x2cd69f];}[_0x273cf5(0x35a)](_0x406549,_0x1e517e,_0x9ce0a9){const _0x1399c1=_0x273cf5;return this[_0x1399c1(0x1f5)](_0x406549)[_0x1399c1(0x35a)](_0x1e517e,_0x9ce0a9);}[_0x273cf5(0x47b)](_0x5aa675,_0x18932a){const _0x34748c=_0x273cf5;let _0x1bbf73=this[_0x34748c(0x23c)][_0x34748c(0x29f)](_0x5aa675);!_0x1bbf73&&(_0x1bbf73=new Map(),this[_0x34748c(0x23c)][_0x34748c(0x3ab)](_0x5aa675,_0x1bbf73));let _0x55b714=_0x1bbf73['get'](_0x18932a);return!_0x55b714&&(_0x55b714=new Map(),_0x1bbf73[_0x34748c(0x3ab)](_0x18932a,_0x55b714)),_0x55b714;}[_0x273cf5(0x33e)](_0x1d9338,_0xc9ab8f,_0x4bbf83,_0x433d96){const _0x3e2684=_0x273cf5;this[_0x3e2684(0x47b)](_0x1d9338,_0xc9ab8f)[_0x3e2684(0x3ab)](_0x4bbf83,_0x433d96);}[_0x273cf5(0x39e)](_0x4521b8,_0x243224,_0x36384a){const _0x17568a=_0x273cf5;var _0x501c6f;if((_0x501c6f=this[_0x17568a(0x23c)][_0x17568a(0x29f)](_0x4521b8))===null||_0x501c6f===void 0x0||(_0x501c6f=_0x501c6f['get'](_0x243224))===null||_0x501c6f===void 0x0?void 0x0:_0x501c6f['get'](_0x36384a)){var _0x298b61;(_0x298b61=this[_0x17568a(0x23c)][_0x17568a(0x29f)](_0x4521b8))===null||_0x298b61===void 0x0||(_0x298b61=_0x298b61['get'](_0x243224))===null||_0x298b61===void 0x0||_0x298b61['delete'](_0x36384a);}}[_0x273cf5(0x2a3)](_0x9b531d,_0x1efc2b){const _0x154f91=_0x273cf5;this['_pivotTableInstanceCache'][_0x154f91(0x3ab)](_0x9b531d,_0x1efc2b);}['_deletePivotTableInstanceCache'](_0x49a55e){const _0xbc1a86=_0x273cf5;this[_0xbc1a86(0x38b)][_0xbc1a86(0x33d)](_0x49a55e);}[_0x273cf5(0x3aa)](_0x4d19c6,_0x24c2d0){const _0x399450=_0x273cf5;let _0x3daf10=this[_0x399450(0x2a9)][_0x399450(0x29f)](_0x4d19c6);!_0x3daf10&&(_0x3daf10=new Map(),this['_viewData'][_0x399450(0x3ab)](_0x4d19c6,_0x3daf10));let _0x408769=_0x3daf10[_0x399450(0x29f)](_0x24c2d0);return!_0x408769&&(_0x408769=new Map(),_0x3daf10[_0x399450(0x3ab)](_0x24c2d0,_0x408769)),_0x408769;}[_0x273cf5(0x331)](_0x1ab786){const _0x393a53=_0x273cf5,{unitId:_0x2f25d8,subUnitId:_0x2e0704,pivotTableId:_0x49c836,pivotTableConfig:_0x3c2442,collectionConfig:_0x158784}=_0x1ab786,_0x178779={'unitId':_0x2f25d8,'subUnitId':_0x2e0704,'oldSubUnitId':_0x2e0704,'pivotTableId':_0x49c836,'pivotTableConfig':_0x3c2442,'collectionConfig':_0x158784};this[_0x393a53(0x381)][_0x393a53(0x39a)](SendPivotConfigLocalMutation['id'],_0x178779,{'onlyLocal':!![]});}[_0x273cf5(0x3e0)](_0x2ca84c,_0x3672a7,_0x529fcb,_0x2eddfb,_0x41835c,_0x3a23bd,_0x2f4318,_0x5e77f1=![]){const _0x58360b=_0x273cf5;var _0x5e9afc;this[_0x58360b(0x381)]['executeCommand'](SendPivotViewLocalMutation['id'],{'single':{'unitId':_0x2ca84c,'subUnitId':_0x3672a7,'type':_0x529fcb,'pivotTableId':_0x2eddfb,'view':_0x41835c,'pivotConfig':_0x3a23bd},'collectionConfig':{[_0x2ca84c]:_0x2f4318}},{'onlyLocal':!![]});const _0x59fada=Boolean((_0x5e9afc=this[_0x58360b(0x204)](_0x2eddfb))===null||_0x5e9afc===void 0x0?void 0x0:_0x5e9afc['isEmpty']()),_0x1d3d43=this['getPivotTableConfig'](_0x2ca84c,_0x3672a7,_0x2eddfb);if(_0x1d3d43)this[_0x58360b(0x445)]({'view':_0x41835c,'pivotTableId':_0x2eddfb,'textInfo':this['getTextInfo'](),'isEmpty':_0x59fada,'targetCellInfo':_0x1d3d43[_0x58360b(0x1db)]},_0x5e77f1);}[_0x273cf5(0x445)](_0x276882,_0x1b860b){const _0x3d30d1=_0x273cf5,{targetCellInfo:_0x140017,pivotTableId:_0x46a2a2}=_0x276882,{unitId:_0x174ead,subUnitId:_0x38233b}=_0x140017,_0x3fd4da=this[_0x3d30d1(0x3aa)](_0x174ead,_0x38233b),_0x5577ea=_0x3fd4da[_0x3d30d1(0x29f)](_0x46a2a2);let _0x1917db,_0x59e39c;_0x5577ea&&(_0x1917db=_0x5577ea['rangeCache'],_0x59e39c=_0x5577ea['matrix']);const {rangesCache:_0x48c231,matrix:_0x3fdfcf}=adjustViewForCalcEngine(_0x276882);_0x3fd4da[_0x3d30d1(0x3ab)](_0x46a2a2,{'rangeCache':_0x48c231,'matrix':_0x3fdfcf,'oldMatrix':_0x59e39c,'oldRangeCache':_0x1917db});if(!_0x1b860b)this[_0x3d30d1(0x243)]['next']({'unitId':_0x174ead,'subUnitId':_0x38233b,'pivotTableId':_0x46a2a2});}[_0x273cf5(0x3a9)](_0x43141f,_0x345f95,_0x519b80,_0x3d48cc,_0x14a690){const _0x32b5b0=_0x273cf5;this['_updateModelCache'](_0x43141f,_0x345f95,_0x519b80,_0x14a690),this[_0x32b5b0(0x2a3)](_0x519b80,_0x3d48cc);}[_0x273cf5(0x3cd)](_0xb8eed2,_0x1ddd4f,_0x168797){const _0x24c25c=_0x273cf5,_0xeb00e6=this[_0x24c25c(0x1f5)](_0xb8eed2);_0xeb00e6[_0x24c25c(0x349)](_0x168797)[_0x24c25c(0x24b)](_0x319f57=>{_0xeb00e6['deleteDataField'](_0x319f57);}),this[_0x24c25c(0x1c7)](_0xb8eed2,_0x168797),this[_0x24c25c(0x39e)](_0xb8eed2,_0x1ddd4f,_0x168797),this[_0x24c25c(0x4cb)](_0x168797);}['setPivotTable'](_0xc2fe74,_0x5b1b13,_0x503647,_0x4bc2eb){const _0x45bbd3=_0x273cf5;this[_0x45bbd3(0x33e)](_0xc2fe74,_0x5b1b13,_0x503647,_0x4bc2eb);}[_0x273cf5(0x4b0)](_0x39d021,_0x2baa3c,_0x2c6402){const _0x266b49=_0x273cf5;var _0xa173eb;const _0x41aeee=(_0xa173eb=this[_0x266b49(0x23c)][_0x266b49(0x29f)](_0x39d021))===null||_0xa173eb===void 0x0||(_0xa173eb=_0xa173eb[_0x266b49(0x29f)](_0x2baa3c))===null||_0xa173eb===void 0x0?void 0x0:_0xa173eb[_0x266b49(0x29f)](_0x2c6402);if(_0x41aeee)return _0x41aeee;}[_0x273cf5(0x34c)](_0x473168,_0x370993,_0x9e9cec){const _0x1c1953=_0x273cf5;var _0x46b5f7;const _0x38bd85=(_0x46b5f7=this[_0x1c1953(0x23c)][_0x1c1953(0x29f)](_0x473168))===null||_0x46b5f7===void 0x0||(_0x46b5f7=_0x46b5f7['get'](_0x370993))===null||_0x46b5f7===void 0x0?void 0x0:_0x46b5f7[_0x1c1953(0x29f)](_0x9e9cec);if(_0x38bd85)return _0x38bd85[_0x1c1953(0x30c)];}[_0x273cf5(0x204)](_0x156a59){const _0x4a3f0c=_0x273cf5;return this[_0x4a3f0c(0x38b)][_0x4a3f0c(0x29f)](_0x156a59);}[_0x273cf5(0x255)](_0x58f6ab){const _0x17f2ba=_0x273cf5;this[_0x17f2ba(0x23c)][_0x17f2ba(0x33d)](_0x58f6ab);const _0x3ddcf2=this[_0x17f2ba(0x334)]['get'](_0x58f6ab);_0x3ddcf2&&(_0x3ddcf2[_0x17f2ba(0x4ef)](),this[_0x17f2ba(0x334)][_0x17f2ba(0x33d)](_0x58f6ab)),this['_viewData'][_0x17f2ba(0x33d)](_0x58f6ab),this[_0x17f2ba(0x258)][_0x17f2ba(0x24b)](_0x2a13de=>{const _0x3b9f1a=_0x17f2ba;_0x2a13de[_0x3b9f1a(0x255)](_0x58f6ab);});}[_0x273cf5(0x306)](_0x53bb87,_0x57eba2,_0x3f3aee,_0x254343){const _0xe73776=_0x273cf5;return this[_0xe73776(0x1f5)](_0x3f3aee[_0xe73776(0x452)])['addCollectionByJSON'](_0x53bb87,_0x57eba2,_0x3f3aee,_0x254343);}[_0x273cf5(0x1f0)](_0x3abba7){const _0x420416=_0x273cf5;return this[_0x420416(0x1f5)](_0x3abba7['unitId'])['createCollectionWithDataRange'](_0x3abba7);}[_0x273cf5(0x450)](_0x373db8,_0x2903dc,_0x3ca3c5){const _0x43715c=_0x273cf5;this[_0x43715c(0x1f5)](_0x3ca3c5[_0x43715c(0x452)])[_0x43715c(0x450)](_0x373db8,_0x2903dc,_0x3ca3c5);}[_0x273cf5(0x2e9)](_0x56ecfc,_0xd096c2){const _0x206686=_0x273cf5;this[_0x206686(0x1f5)](_0x56ecfc)['deleteDataField'](_0xd096c2);}[_0x273cf5(0x1c7)](_0x17c468,_0x1ecbc5){const _0x252e57=_0x273cf5;this[_0x252e57(0x1f5)](_0x17c468)[_0x252e57(0x1d9)](_0x1ecbc5);}[_0x273cf5(0x44a)](_0x24aa1c,_0x5dad4e){const _0x444241=_0x273cf5;var _0x2bb277;return(_0x2bb277=this[_0x444241(0x23c)][_0x444241(0x29f)](_0x24aa1c))===null||_0x2bb277===void 0x0?void 0x0:_0x2bb277[_0x444241(0x29f)](_0x5dad4e);}[_0x273cf5(0x25d)](_0x32d57c){const _0x34d83a=_0x273cf5;for(const [_0x2932cd,_0x24725b]of this[_0x34d83a(0x23c)][_0x34d83a(0x2f5)]())for(const [_0x3595db,_0x16a995]of _0x24725b[_0x34d83a(0x2f5)]())if(_0x16a995[_0x34d83a(0x388)](_0x32d57c))return{'unitId':_0x2932cd,'subUnitId':_0x3595db};return null;}[_0x273cf5(0x3fb)](_0x2c0a0f,_0x28ecfd,_0x368027,_0x26c174){const _0x2b489f=_0x273cf5,_0x5cb94d=this[_0x2b489f(0x3aa)](_0x2c0a0f,_0x28ecfd);if(_0x26c174)_0x5cb94d['set'](_0x368027,_0x26c174);else _0x5cb94d[_0x2b489f(0x33d)](_0x368027);this[_0x2b489f(0x243)][_0x2b489f(0x28f)]({'unitId':_0x2c0a0f,'subUnitId':_0x28ecfd,'pivotTableId':_0x368027});}[_0x273cf5(0x4ef)](){const _0x5b6799=_0x273cf5;super[_0x5b6799(0x4ef)](),this[_0x5b6799(0x23c)][_0x5b6799(0x4dc)](),this['_pivotTableInstanceCache']['clear'](),this[_0x5b6799(0x2a9)][_0x5b6799(0x4dc)](),this[_0x5b6799(0x464)][_0x5b6799(0x2c5)](),this['_viewData$'][_0x5b6799(0x2c5)](),this[_0x5b6799(0x320)][_0x5b6799(0x2c5)](),this['_dataFieldManagerCollection'][_0x5b6799(0x24b)](_0x192057=>_0x192057['dispose']()),this[_0x5b6799(0x334)][_0x5b6799(0x4dc)]();}[_0x273cf5(0x342)](_0x18bdad,_0x171888,_0x53d7e7){const _0x39439d=_0x273cf5;var _0x245602;const _0x1bb75d=(_0x245602=this[_0x39439d(0x2a9)]['get'](_0x18bdad))===null||_0x245602===void 0x0||(_0x245602=_0x245602[_0x39439d(0x29f)](_0x171888))===null||_0x245602===void 0x0?void 0x0:_0x245602['get'](_0x53d7e7);if(_0x1bb75d)return _0x1bb75d;return null;}[_0x273cf5(0x4c7)](_0x5879f0){this['updateDirtyPivotTable'](_0x5879f0);}[_0x273cf5(0x372)](_0x5321a4){const _0x3f777e=_0x273cf5,{token:_0x12a6d0,unitId:_0x611973,subUnitId:_0x37f4b9}=_0x5321a4,_0x537279=_0x611973+'-'+_0x37f4b9+'-'+_0x12a6d0;if(this[_0x3f777e(0x297)][_0x3f777e(0x29f)](_0x537279))clearTimeout(this[_0x3f777e(0x297)][_0x3f777e(0x29f)](_0x537279));const _0x5c9c69=setTimeout(()=>{const _0x28232f=_0x3f777e;this['queryDirtyPivotTable'](_0x5321a4),this[_0x28232f(0x297)]['delete'](_0x537279);},0x1e);this[_0x3f777e(0x297)][_0x3f777e(0x3ab)](_0x537279,_0x5c9c69);}[_0x273cf5(0x2f7)](_0x39fea7){const _0x158096=_0x273cf5,{unitId:_0x3904d8,subUnitId:_0x57e70d,token:_0x49d64b,type:_0x10182e,pivotConfig:_0x4d9ea6}=_0x39fea7,_0x53c3ee=this[_0x158096(0x204)](_0x49d64b),_0x377baf=_0x53c3ee===null||_0x53c3ee===void 0x0?void 0x0:_0x53c3ee['query'](),_0x3f08e0=_0x4d9ea6!==null&&_0x4d9ea6!==void 0x0?_0x4d9ea6:this[_0x158096(0x4b0)](_0x3904d8,_0x57e70d,_0x49d64b);if(_0x3f08e0)_0x3f08e0[_0x158096(0x443)]=!!(_0x53c3ee===null||_0x53c3ee===void 0x0?void 0x0:_0x53c3ee[_0x158096(0x443)]());if(_0x377baf||_0x10182e===PivotTableOperationEnum[_0x158096(0x28d)])this[_0x158096(0x3e0)](_0x3904d8,_0x57e70d,_0x10182e,_0x49d64b,_0x377baf,_0x3f08e0,this['getDataFieldManager'](_0x3904d8)[_0x158096(0x480)]());}['toJSON'](_0x532001){const _0x2bf068=_0x273cf5,_0x4694b3={'dataFieldManagerConfig':{},'pivotTableConfigs':{}};if(this[_0x2bf068(0x1f5)](_0x532001))_0x4694b3[_0x2bf068(0x295)][_0x532001]=this[_0x2bf068(0x1f5)](_0x532001)[_0x2bf068(0x480)]();if(this[_0x2bf068(0x23c)][_0x2bf068(0x29f)](_0x532001)){_0x4694b3['pivotTableConfigs'][_0x532001]={};const _0x274e7f=this[_0x2bf068(0x23c)][_0x2bf068(0x29f)](_0x532001);if(_0x274e7f===null||_0x274e7f===void 0x0?void 0x0:_0x274e7f['size'])[..._0x274e7f['keys']()][_0x2bf068(0x24b)](_0x15ec7c=>{const _0x90cad7=_0x2bf068,_0x35c10a=_0x274e7f[_0x90cad7(0x29f)](_0x15ec7c);(_0x35c10a===null||_0x35c10a===void 0x0?void 0x0:_0x35c10a[_0x90cad7(0x2a4)])&&(_0x4694b3[_0x90cad7(0x247)][_0x532001][_0x15ec7c]={},[..._0x35c10a[_0x90cad7(0x260)]()][_0x90cad7(0x24b)](_0x1e4534=>{const _0x41b29a=_0x90cad7,_0x1330b7=_0x35c10a[_0x41b29a(0x29f)](_0x1e4534);if(_0x1330b7)_0x4694b3[_0x41b29a(0x247)][_0x532001][_0x15ec7c][_0x1e4534]=_0x1330b7;}));});}return _0x4694b3;}[_0x273cf5(0x374)](_0x573459){const _0x118c64=_0x273cf5,{dataFieldManagerConfig:_0x2a4a53,pivotTableConfigs:_0x1f1027}=_0x573459;if(_0x2a4a53)Object['keys'](_0x2a4a53)[_0x118c64(0x24b)](_0x2e84ae=>{this['getDataFieldManager'](_0x2e84ae)['fromJSON'](_0x2a4a53[_0x2e84ae]);});const _0x504864=[];if(_0x1f1027){var _0x5bc2d8;const {ls:_0x208eda,pbk:_0x384141}=(_0x5bc2d8=this[_0x118c64(0x24c)]['get'](_univerjs_core['IConfigService'])[_0x118c64(0x4e3)](_univerjs_pro_license[_0x118c64(0x487)]))!==null&&_0x5bc2d8!==void 0x0?_0x5bc2d8:{},_0x15b7a9=getPivotInfoByLicense(0x1,_0x208eda,_0x384141)[_0x118c64(0x3b2)];Object[_0x118c64(0x260)](_0x1f1027)[_0x118c64(0x24b)](_0x459cf9=>{const _0x2eab54=_0x118c64;let _0x5c0fff=0x0;const _0xd8e99=_0x1f1027[_0x459cf9];Object[_0x2eab54(0x260)](_0xd8e99)[_0x2eab54(0x24b)](_0x51a1a4=>{const _0x39d2fd=_0x2eab54,_0x46560b=_0xd8e99[_0x51a1a4];Object['keys'](_0x46560b)[_0x39d2fd(0x24b)](_0x8e49bd=>{const _0x3f9472=_0x39d2fd,_0x1830f4=_0x46560b[_0x8e49bd];if(_0x1830f4){if(_0x5c0fff>=_0x15b7a9)return;_0x5c0fff++;const _0x5f3de5=this[_0x3f9472(0x1f5)](_0x459cf9),_0x4157c1=_0x5f3de5['collections'][_0x8e49bd],_0x2d09a0=_0x4157c1['getFieldIds']();let _0x14760a=0x0;const _0x98a470=[];for(const _0x1a9d31 of _0x2d09a0){const _0x49baef=_0x4157c1[_0x3f9472(0x286)](_0x1a9d31);if((0x0,_univerjs_pro_engine_pivot[_0x3f9472(0x29a)])(_0x49baef)){const _0x28a5de=_0x49baef[_0x3f9472(0x259)](),_0x393daa=_0x4157c1['getFieldById'](_0x28a5de);if(_0x393daa)_0x98a470[_0x3f9472(0x4e8)]([_0x49baef,_0x393daa]);continue;}_0x5f3de5[_0x3f9472(0x4d3)](_0x1a9d31,_0x1830f4[_0x3f9472(0x3f5)],_0x14760a),_0x14760a++;}_0x98a470['forEach'](([_0x1b8dd5,_0xdb39fb])=>{const _0x547fe2=_0x3f9472;_0x1b8dd5[_0x547fe2(0x2f2)](_0xdb39fb);});const _0x3d4ec0=new _univerjs_pro_engine_pivot['PivotTable'](_0x4157c1);_0x3d4ec0[_0x3f9472(0x374)](_0x1830f4[_0x3f9472(0x30c)]),this[_0x3f9472(0x3a9)](_0x459cf9,_0x51a1a4,_0x8e49bd,_0x3d4ec0,_0x1830f4);const _0x46c910=_0x3d4ec0['query']();_0x504864[_0x3f9472(0x4e8)]({'unitId':_0x459cf9,'subUnitId':_0x51a1a4,'pivotTableId':_0x8e49bd,'view':_0x46c910[_0x3f9472(0x480)](),'pivotConfig':_0x1830f4,'type':PivotTableOperationEnum[_0x3f9472(0x446)]});const _0x5e5e75=Boolean(_0x3d4ec0['isEmpty']()),_0x3d93b0={'view':_0x46c910,'pivotTableId':_0x8e49bd,'textInfo':this['getTextInfo'](),'isEmpty':_0x5e5e75,'targetCellInfo':_0x1830f4['targetCellInfo']};this[_0x3f9472(0x445)](_0x3d93b0,![]);}});});});}if(_0x2a4a53)Object[_0x118c64(0x260)](_0x2a4a53)['forEach'](_0x5caf21=>{const _0x448128=_0x118c64,_0x3329ba=this[_0x448128(0x1f5)](_0x5caf21);this[_0x448128(0x320)]['next'](_0x3329ba[_0x448128(0x3d8)]);});this['_commandService'][_0x118c64(0x39a)](SendPivotViewLocalMutation['id'],{'batch':_0x504864,'collectionConfig':_0x2a4a53},{'onlyLocal':!![]});}['_initSnapshot'](){const _0x5eb3a5=_0x273cf5;this['disposeWithMe'](this[_0x5eb3a5(0x22e)]['registerPluginResource']({'toJson':_0x36cdb3=>{const _0x47f5b4=_0x5eb3a5;return JSON[_0x47f5b4(0x307)](this[_0x47f5b4(0x480)](_0x36cdb3));},'parseJson':_0x56a2b0=>{if(!_0x56a2b0)return{};try{return JSON['parse'](_0x56a2b0);}catch(_0x3855b2){return{};}},'businesses':[_univerjs_core['UniverInstanceType'][_0x5eb3a5(0x4aa)]],'pluginName':SHEET_PIVOT_TABLE_PLUGIN,'onLoad':(_0x1d1e3c,_0x355771)=>{const _0x478505=_0x5eb3a5;this[_0x478505(0x374)](_0x355771);},'onUnLoad':_0x419848=>{const _0x22a33c=_0x5eb3a5;this[_0x22a33c(0x255)](_0x419848);}}));}};SheetsPivotDataSourceModel=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x3a6)])),__decorateParam(0x1,_univerjs_core[_0x273cf5(0x315)]),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x35e)])),__decorateParam(0x3,_univerjs_core[_0x273cf5(0x3ad)]),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x273cf5(0x2bb)]))],SheetsPivotDataSourceModel);const defaultEmptyMatrix={0x0:{0x0:{'v':_0x273cf5(0x33f),'s':defaultEmptyPivotFieldCellStyle}},0x2:{0x1:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x2:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x3:{'v':_0x273cf5(0x449),'s':defaultEmptyPivotFieldCellStyle},0x4:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x5:{'v':'','s':defaultEmptyPivotFieldCellStyle}},0x3:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x4:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x5:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x6:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x7:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x8:{0x0:{'v':_0x273cf5(0x1ed),'s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'values','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0x9:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xa:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xb:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xc:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}},0xd:{0x0:{'v':'','s':defaultEmptyPivotFieldCellStyle},0x1:{'v':'','s':defaultEmptyPivotDataCellStyle},0x2:{'v':'','s':defaultEmptyPivotDataCellStyle},0x3:{'v':'','s':defaultEmptyPivotDataCellStyle},0x4:{'v':'','s':defaultEmptyPivotDataCellStyle},0x5:{'v':'','s':defaultEmptyPivotDataCellStyle}}},defaultEmptyRanges={'rowRanges':[{'startRow':0x3,'endRow':0xd,'startColumn':0x0,'endColumn':0x0}],'colRanges':[{'startRow':0x2,'endRow':0x2,'startColumn':0x1,'endColumn':0x5}],'dataRanges':[{'startRow':0x3,'endRow':0xd,'startColumn':0x1,'endColumn':0x5}],'pageRanges':[{'startRow':0x0,'endRow':0x0,'startColumn':0x0,'endColumn':0x0}],'cornerRanges':[]},generateDefaultEmptyCache=(_0x5d7aa6,_0x4e1952)=>{const _0x4daa71=_0x273cf5,_0xcdf584=new _univerjs_core[(_0x4daa71(0x24d))](),_0x409cd3=new _univerjs_core['ObjectMatrix'](defaultEmptyMatrix),{row:_0x2cf7eb,col:_0x2c26b2}=_0x4e1952;_0x409cd3['forValue']((_0x4feeaa,_0x345f0d,_0x32e2e0)=>{const _0x80b226=_0x4daa71;let _0x40dae5='';if(_0x32e2e0['v']===_0x80b226(0x33f))_0x40dae5=_0x5d7aa6[_0x80b226(0x33f)];else{if(_0x32e2e0['v']===_0x80b226(0x1ed))_0x40dae5=_0x5d7aa6[_0x80b226(0x1ed)];else{if(_0x32e2e0['v']===_0x80b226(0x449))_0x40dae5=_0x5d7aa6['column'];else{if(_0x32e2e0['v']===_0x80b226(0x343))_0x40dae5=_0x5d7aa6[_0x80b226(0x343)];}}}_0xcdf584['setValue'](_0x4feeaa+_0x2cf7eb,_0x345f0d+_0x2c26b2,{..._0x32e2e0,'v':_0x40dae5});});const _0x406ae1=_univerjs_core[_0x4daa71(0x23f)][_0x4daa71(0x32f)](defaultEmptyRanges);return Object[_0x4daa71(0x260)](defaultEmptyRanges)[_0x4daa71(0x24b)](_0x34daa2=>{const _0x1ce7da=_0x4daa71;_0x406ae1[_0x34daa2]=defaultEmptyRanges[_0x34daa2][_0x1ce7da(0x291)](_0xaa66de=>{const _0x1803d9=_0x1ce7da;return{..._0xaa66de,'startRow':_0xaa66de['startRow']+_0x2cf7eb,'endRow':_0xaa66de[_0x1803d9(0x4a7)]+_0x2cf7eb,'startColumn':_0xaa66de[_0x1803d9(0x3ed)]+_0x2c26b2,'endColumn':_0xaa66de[_0x1803d9(0x41e)]+_0x2c26b2};});}),{'matrixCache':_0xcdf584,'rangesCache':_0x406ae1};};function getAutoDisplayName$1(_0x43dc9c,_0x5f5cb7){const _0x1c9886=_0x273cf5;let _0x5dde74='';const _0x3cd490=this[_0x1c9886(0x471)]();switch(_0x5f5cb7){case _univerjs_pro_engine_pivot['PivotSubtotalTypeEnum'][_0x1c9886(0x3c3)]:_0x5dde74=_0x3cd490[_0x1c9886(0x36c)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot[_0x1c9886(0x367)][_0x1c9886(0x3b2)]:_0x5dde74=_0x3cd490[_0x1c9886(0x335)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot['PivotSubtotalTypeEnum'][_0x1c9886(0x2b7)]:_0x5dde74=_0x3cd490['sheets-pivot.countNumsName']+_0x43dc9c;break;case _univerjs_pro_engine_pivot['PivotSubtotalTypeEnum'][_0x1c9886(0x236)]:_0x5dde74=_0x3cd490[_0x1c9886(0x4de)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot[_0x1c9886(0x367)][_0x1c9886(0x4c5)]:_0x5dde74=_0x3cd490[_0x1c9886(0x4bd)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot['PivotSubtotalTypeEnum'][_0x1c9886(0x220)]:_0x5dde74=_0x3cd490[_0x1c9886(0x1f4)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot[_0x1c9886(0x367)]['stdDev']:_0x5dde74=_0x3cd490[_0x1c9886(0x1fe)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot[_0x1c9886(0x367)][_0x1c9886(0x21e)]:_0x5dde74=_0x3cd490[_0x1c9886(0x38a)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot[_0x1c9886(0x367)][_0x1c9886(0x2cf)]:_0x5dde74=_0x3cd490['sheets-pivot.sumName']+_0x43dc9c;break;case _univerjs_pro_engine_pivot['PivotSubtotalTypeEnum'][_0x1c9886(0x47c)]:_0x5dde74=_0x3cd490[_0x1c9886(0x2c8)]+_0x43dc9c;break;case _univerjs_pro_engine_pivot[_0x1c9886(0x367)][_0x1c9886(0x2f0)]:_0x5dde74=_0x3cd490[_0x1c9886(0x230)]+_0x43dc9c;break;default:_0x5dde74=_0x43dc9c;break;}return _0x5dde74;}function getPivotCellInfo(_0x479b8a,_0x31ffbb,_0x51dd1c,_0xb8d9ec,_0x19250e){const _0x3a0d66=_0x273cf5,_0x301eaf=(0x0,_univerjs_core[_0x3a0d66(0x38d)])(_0x479b8a,_0x31ffbb),{rangesInfo:_0x50dfb3,areaInfo:_0x54473a,headerMap:_0x1549f3}=_0x19250e;if(!_0x50dfb3||!_0x54473a||!_0x1549f3)return;const _0x26d557=Object[_0x3a0d66(0x260)](_0x50dfb3)[_0x3a0d66(0x265)](_0x1a4815=>{const _0x360a89=_0x3a0d66;return _0x50dfb3[_0x1a4815][_0x360a89(0x354)](_0x1f6bba=>_univerjs_core[_0x360a89(0x3ce)][_0x360a89(0x1ef)](_0x1f6bba,_0x301eaf));}),_0x5d48f8=_0x54473a;let _0x5ead15,_0x3c5063,_0x4e6bdc;if(_0x26d557===_0x3a0d66(0x257)){var _0x426b5e,_0x41aa81;_0x5ead15=_0x5d48f8===null||_0x5d48f8===void 0x0||(_0x426b5e=_0x5d48f8[_0x3a0d66(0x328)])===null||_0x426b5e===void 0x0?void 0x0:_0x426b5e[_0x479b8a],_0x3c5063=_0x1549f3===null||_0x1549f3===void 0x0||(_0x41aa81=_0x1549f3['rowHeaderMap'])===null||_0x41aa81===void 0x0?void 0x0:_0x41aa81[_0x31ffbb],_0x4e6bdc=_0x3c5063===null||_0x3c5063===void 0x0?void 0x0:_0x3c5063[_0x3a0d66(0x1cf)];}else{if(_0x26d557===_0x3a0d66(0x4ba)){var _0x3938f5,_0x247b0b;_0x5ead15=_0x5d48f8===null||_0x5d48f8===void 0x0||(_0x3938f5=_0x5d48f8[_0x3a0d66(0x401)])===null||_0x3938f5===void 0x0?void 0x0:_0x3938f5[_0x31ffbb],_0x3c5063=(_0x247b0b=_0x1549f3['colHeaderMap'])===null||_0x247b0b===void 0x0?void 0x0:_0x247b0b[_0x479b8a+0x1+_0x31ffbb-_0x50dfb3[_0x3a0d66(0x4ba)][0x0][_0x3a0d66(0x3ed)]],_0x4e6bdc=_0x3c5063===null||_0x3c5063===void 0x0?void 0x0:_0x3c5063['tableFieldId'];}else{if(_0x26d557===_0x3a0d66(0x435)){var _0x6c51c4;_0x5ead15=_0x5d48f8===null||_0x5d48f8===void 0x0||(_0x6c51c4=_0x5d48f8[_0x3a0d66(0x2b6)])===null||_0x6c51c4===void 0x0?void 0x0:_0x6c51c4[_0x31ffbb],_0x4e6bdc=_0x5ead15===null||_0x5ead15===void 0x0?void 0x0:_0x5ead15[_0x3a0d66(0x1cf)];}else{if(_0x26d557===_0x3a0d66(0x40c)){const _0x1098c7=_0x51dd1c===null||_0x51dd1c===void 0x0?void 0x0:_0x51dd1c['fi'];if(_0x1098c7!==void 0x0)_0x4e6bdc=_0xb8d9ec['getFilterFieldIdByIndex'](_0x1098c7);}}}}return{'filterId':_0x4e6bdc,'info':_0x5ead15,'data':_0x51dd1c,'headerInfo':_0x3c5063};}function getPivotTableInfo(_0x2bd597,_0x54acf9,_0x2b1181){const _0x51f63f=_0x273cf5,_0x4004c6=_0x2bd597[_0x51f63f(0x2ff)],_0x7197a7=_0x4004c6['getFieldIds'](),_0x26a3b5=new Set();_0x2bd597[_0x51f63f(0x361)](_0x98ce95=>{const _0x1d3c9d=_0x51f63f;_0x26a3b5[_0x1d3c9d(0x1dd)](_0x98ce95['dataFieldId']);});const _0x3426d8=_0x7197a7[_0x51f63f(0x291)](_0x54b27e=>{const _0x467af2=_0x51f63f,_0x2cb901=_0x4004c6['getFieldById'](_0x54b27e);return{'checked':_0x26a3b5['has'](_0x54b27e),'dataFieldId':_0x2cb901['id'],'id':_0x2cb901['id'],'name':_0x4004c6[_0x467af2(0x26b)](_0x2cb901['id']),'type':_0x2cb901[_0x467af2(0x3d3)](),'pivotTableId':_0x54acf9};}),_0x52b13a=[];_0x2bd597['iterateFieldByArea'](_univerjs_pro_engine_pivot[_0x51f63f(0x37d)][_0x51f63f(0x3ec)],_0x317bca=>{const _0x3eea96=_0x51f63f;_0x52b13a[_0x3eea96(0x4e8)]({'dataFieldId':_0x317bca['dataFieldId'],'tableFieldId':_0x317bca['getId'](),'displayName':_0x317bca[_0x3eea96(0x26b)]()});});const _0xf1a838=[];_0x2bd597[_0x51f63f(0x382)](_univerjs_pro_engine_pivot[_0x51f63f(0x37d)][_0x51f63f(0x20b)],_0x4d0dec=>{const _0x37b754=_0x51f63f;_0xf1a838[_0x37b754(0x4e8)]({'dataFieldId':_0x4d0dec[_0x37b754(0x496)],'tableFieldId':_0x4d0dec[_0x37b754(0x368)](),'displayName':_0x4d0dec['getDisplayName']()});});const _0x527c1b=[];_0x2bd597[_0x51f63f(0x382)](_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x51f63f(0x3a1)],_0x949c0f=>{const _0x508b51=_0x51f63f;_0x527c1b['push']({'dataFieldId':_0x949c0f[_0x508b51(0x496)],'tableFieldId':_0x949c0f['getId'](),'displayName':_0x949c0f[_0x508b51(0x26b)](),'format':_0x949c0f[_0x508b51(0x248)](),'subTotalType':_0x949c0f[_0x508b51(0x2e8)]()});});if(_0x527c1b[_0x51f63f(0x36f)]>0x1){const _0xddfec3=_0x2bd597[_0x51f63f(0x2fe)]();(_0x2bd597[_0x51f63f(0x251)]()?_0xf1a838:_0x52b13a)[_0x51f63f(0x40f)](_0xddfec3,0x0,{'dataFieldId':'','tableFieldId':_0x51f63f(0x275),'displayName':'ΣValue'});}const _0x4a1f24=[];return _0x2bd597[_0x51f63f(0x382)](_univerjs_pro_engine_pivot[_0x51f63f(0x37d)][_0x51f63f(0x390)],_0x40a17c=>{const _0x494f1f=_0x51f63f;_0x4a1f24[_0x494f1f(0x4e8)]({'dataFieldId':_0x40a17c[_0x494f1f(0x496)],'tableFieldId':_0x40a17c[_0x494f1f(0x368)](),'displayName':_0x40a17c[_0x494f1f(0x26b)]()});}),{'sourceList':_0x3426d8,'sourceRange':_0x2b1181[_0x51f63f(0x3f5)],'rowFields':_0x52b13a,'columnFields':_0xf1a838,'valueFields':_0x527c1b,'filterFields':_0x4a1f24,'positionInfo':_0x2b1181[_0x51f63f(0x1db)]};}function flattenObject(_0x5d266b,_0x324984,_0x1b5c5d='',_0x47d5f2={}){const _0x1ed301=_0x273cf5,_0x417b15=_0x5d266b[_0x1ed301(0x29f)](_univerjs_core[_0x1ed301(0x337)]);for(const _0x29bbc7 in _0x324984)if(Object[_0x1ed301(0x32b)][_0x1ed301(0x4b2)][_0x1ed301(0x3c9)](_0x324984,_0x29bbc7)){const _0x29e5c0=_0x1b5c5d?_0x1b5c5d+'.'+_0x29bbc7:_0x29bbc7;if(typeof _0x324984[_0x29bbc7]==='object'&&_0x324984[_0x29bbc7]!==null&&!Array[_0x1ed301(0x1da)](_0x324984[_0x29bbc7]))flattenObject(_0x5d266b,_0x324984[_0x29bbc7],_0x29e5c0,_0x47d5f2);else _0x47d5f2[_0x29e5c0]=_0x417b15['t'](_0x29e5c0);}return _0x47d5f2;}const unionPivotViewRange=_0xb638fc=>{const _0x36c08c=_0x273cf5;if(!_0xb638fc)return[];const {rowRanges:_0x59ef03,colRanges:_0x567990,cornerRanges:_0x67699a,dataRanges:_0x491b4f,pageRanges:_0x340cf7}=_0xb638fc,_0x1aa4c0=[..._0x567990,..._0x59ef03,..._0x491b4f,..._0x67699a]['filter'](_0x2c1c79=>{const _0x4cad5c=_0x1f80;return _0x2c1c79[_0x4cad5c(0x3de)]>=0x0&&_0x2c1c79[_0x4cad5c(0x3ed)]>=0x0&&_0x2c1c79['endRow']>=0x0&&_0x2c1c79[_0x4cad5c(0x41e)]>=0x0;});if(_0x1aa4c0[_0x36c08c(0x36f)]===0x0)return[..._0x340cf7];let _0x257fac=_0x1aa4c0[0x0][_0x36c08c(0x3de)],_0x31470d=_0x1aa4c0[0x0][_0x36c08c(0x4a7)],_0x3aed92=_0x1aa4c0[0x0][_0x36c08c(0x3ed)],_0xcd917=_0x1aa4c0[0x0][_0x36c08c(0x41e)];for(let _0x548f3f=0x1;_0x548f3f<_0x1aa4c0['length'];_0x548f3f++){_0x257fac=Math[_0x36c08c(0x4c5)](_0x257fac,_0x1aa4c0[_0x548f3f]['startRow']),_0x31470d=Math['max'](_0x31470d,_0x1aa4c0[_0x548f3f][_0x36c08c(0x4a7)]),_0x3aed92=Math[_0x36c08c(0x4c5)](_0x3aed92,_0x1aa4c0[_0x548f3f][_0x36c08c(0x3ed)]),_0xcd917=Math['max'](_0xcd917,_0x1aa4c0[_0x548f3f]['endColumn']);}return[..._0x340cf7,{'startRow':_0x257fac,'endRow':_0x31470d,'startColumn':_0x3aed92,'endColumn':_0xcd917}];};function getPivotDrillDownData(_0x50a214,_0x10c524){const _0x4a7d94=_0x273cf5,_0x2f3429=_0x10c524[_0x4a7d94(0x21f)][_0x4a7d94(0x4f2)],{pivotTableId:_0x1afcc9,unitId:_0x4c98d3,subUnitId:_0x34370a}=_0x10c524;if(!_0x2f3429)return;const _0x4d416e=_0x50a214['get'](SheetsPivotDataSourceModel),_0x34e9af=_0x4d416e[_0x4a7d94(0x204)](_0x1afcc9),_0x56ff26=_0x4d416e['getPivotTableConfig'](_0x4c98d3,_0x34370a,_0x1afcc9);if(!_0x34e9af||!_0x56ff26)return;const _0x6570d4=_0x34e9af[_0x4a7d94(0x4db)](_0x2f3429[_0x4a7d94(0x2c9)]);if(!(_0x6570d4===null||_0x6570d4===void 0x0?void 0x0:_0x6570d4[_0x4a7d94(0x36f)]))return;const {unitId:_0x3ec810,subUnitId:_0x2b03ff,range:_0x233218}=_0x56ff26[_0x4a7d94(0x3f5)];let _0x1fed99=0x0;return{'indexes':_0x6570d4,'range':_0x233218,'sourceUnitId':_0x3ec810,'sourceSubUnitId':_0x2b03ff,'formatMap':_0x34e9af['dataFieldsCollection'][_0x4a7d94(0x4d4)]()['reduce']((_0x33c270,_0x2fac22)=>{var _0x49764a;const _0x3f74cc=(_0x49764a=_0x34e9af['getDataFieldByDataFieldId'](_0x2fac22))===null||_0x49764a===void 0x0?void 0x0:_0x49764a['getformat']();if(_0x3f74cc)_0x33c270[String(_0x1fed99)]=_0x3f74cc;return _0x1fed99++,_0x33c270;},{})};}function canUsePivot(_0x4b8c74,_0x5650e2){const _0x403c23=_0x273cf5;if(!_0x4b8c74||!_0x5650e2)return!![];const _0x49e507=(0x0,_univerjs_pro_license[_0x403c23(0x2c2)])(_0x4b8c74,_0x5650e2)[_0x403c23(0x32a)],_0x4a19fa=(0x0,_univerjs_pro_license[_0x403c23(0x377)])(_0x49e507,'sf',BUILD_TIMESTAMP);if((_0x49e507===null||_0x49e507===void 0x0?void 0x0:_0x49e507['rt'])===_univerjs_pro_license[_0x403c23(0x2fb)][_0x403c23(0x285)]&&!_0x4a19fa)return![];return!![];}function getPivotInfoByLicense(_0x47245e,_0x272a99,_0x1bc4a7){const _0x583b49=_0x273cf5,_0x570b81={'count':_0x47245e,'timeValid':![]};if(!_0x272a99||!_0x1bc4a7)return _0x570b81;const _0x1e201d=(0x0,_univerjs_pro_license[_0x583b49(0x2c2)])(_0x272a99,_0x1bc4a7);if(_0x1e201d===null||_0x1e201d===void 0x0?void 0x0:_0x1e201d[_0x583b49(0x455)]){const _0x15e17c=_0x1e201d[_0x583b49(0x32a)],_0x1a79f6=(0x0,_univerjs_pro_license[_0x583b49(0x377)])(_0x15e17c,'sf',BUILD_TIMESTAMP);return{'count':(0x0,_univerjs_pro_license[_0x583b49(0x203)])(_0x15e17c,_0x1a79f6,'ptn',_0x47245e,_0x47245e,0x0),'timeValid':_0x1a79f6};}return _0x570b81;}function generateSetRangeValueMutations(_0x126ce9,_0x38665c,_0x12570b,_0x3abe14){const _0x5a0257=_0x273cf5,_0x4d1bbb={'subUnitId':_0x12570b,'unitId':_0x38665c,'cellValue':(0x0,_univerjs_sheets['generateNullCell'])(_0x3abe14)},_0x5e6d2e=(0x0,_univerjs_sheets[_0x5a0257(0x319)])(_0x126ce9,_0x4d1bbb);let _0x106503=![];return new _univerjs_core[(_0x5a0257(0x24d))](_0x5e6d2e[_0x5a0257(0x2ed)])['forValue']((_0x5356f2,_0xb929e6,_0x8d18c7)=>{const _0xe42dde=_0x5a0257;if(!_0x106503){if(_0x8d18c7&&(_0x8d18c7[_0xe42dde(0x37b)]||_0x8d18c7['f']||_0x8d18c7['p']||_0x8d18c7['s']||_0x8d18c7['si']||_0x8d18c7['t']||_0x8d18c7['v']))return _0x106503=!![],![];}}),{'setRangeValueUndoMutation':{'id':_univerjs_sheets[_0x5a0257(0x4e1)]['id'],'params':_0x5e6d2e},'setRangeValueRedoMutation':{'id':_univerjs_sheets['SetRangeValuesMutation']['id'],'params':_0x4d1bbb},'shouldClear':_0x106503};}function getEmptyPivotRanges(_0x31f0b6){const {row:_0x3fb3e0,col:_0x285a07}=_0x31f0b6;return[{'startRow':_0x3fb3e0,'endRow':_0x3fb3e0,'startColumn':_0x285a07,'endColumn':_0x285a07},{'startRow':_0x3fb3e0+0x2,'endRow':_0x3fb3e0+0xe,'startColumn':_0x285a07,'endColumn':_0x285a07+0x6}];}function getPivotRowColCount(_0x1d9377,_0x482be4,_0x7b22dd){const _0x1a4884=_0x273cf5,{cornerView:_0x25699a,rowView:_0x262398,colView:_0xa13460,pageView:_0x3b1d21}=_0x1d9377,{row:_0x527242,col:_0xf009a9}=_0x482be4;if(_0x7b22dd)return{'rowCount':0xe+_0x527242,'colCount':0x6+_0xf009a9};const _0x5ba1f7=_0x3b1d21[_0x1a4884(0x30a)]>-0x1?_0x3b1d21[_0x1a4884(0x30a)]+0x1:0x0,_0x1d20b8=_0x3b1d21[_0x1a4884(0x27e)]>-0x1?_0x3b1d21[_0x1a4884(0x27e)]:0x0,_0x28fffa=_0x527242+_0x5ba1f7+(_0x5ba1f7?0x1:0x0)+_0x25699a[_0x1a4884(0x482)]+_0x262398[_0x1a4884(0x482)],_0x4e7986=_0xf009a9+_0x1d20b8,_0x4cfc06=_0xf009a9+_0x25699a[_0x1a4884(0x246)]+_0xa13460['colCount'];return{'rowCount':_0x28fffa,'colCount':Math[_0x1a4884(0x236)](_0x4e7986,_0x4cfc06)};}function getInsertRowColMutations(_0x1eb591,_0x433ea0,_0x4e7b91,_0x58be65){const _0x52436d=_0x273cf5,{row:_0x17cab0,col:_0x232818,unitId:_0x2c0520,subUnitId:_0x1a004f}=_0x4e7b91,_0x12b6d1=getPivotRowColCount(_0x433ea0,{'row':_0x17cab0,'col':_0x232818},_0x58be65),_0x559588=(0x0,_univerjs_sheets['getSheetCommandTarget'])(_0x1eb591[_0x52436d(0x29f)](_univerjs_core[_0x52436d(0x315)]),{'unitId':_0x2c0520,'subUnitId':_0x1a004f}),_0x4acf20=[],_0x4ce1f2=[];if(!_0x559588)return{'undos':_0x4ce1f2,'redos':_0x4acf20};const {worksheet:_0xac8db7}=_0x559588,_0x3570e9=_0xac8db7['getRowCount'](),_0x39ec8d=_0xac8db7[_0x52436d(0x49b)]();return _0x3570e9<_0x12b6d1['rowCount']&&(_0x4acf20['push']({'id':_univerjs_sheets[_0x52436d(0x277)]['id'],'params':{'unitId':_0x2c0520,'subUnitId':_0x1a004f,'range':{'startRow':_0x3570e9,'endRow':_0x12b6d1[_0x52436d(0x482)]-0x1,'startColumn':0x0,'endColumn':_0x39ec8d-0x1}}}),_0x4ce1f2['push']({'id':_univerjs_sheets[_0x52436d(0x31b)]['id'],'params':{'unitId':_0x2c0520,'subUnitId':_0x1a004f,'range':{'startRow':_0x3570e9,'endRow':_0x12b6d1[_0x52436d(0x482)]-0x1,'startColumn':0x0,'endColumn':_0x39ec8d-0x1}}})),_0x39ec8d<_0x12b6d1[_0x52436d(0x246)]&&(_0x4acf20['push']({'id':_univerjs_sheets['InsertColMutation']['id'],'params':{'unitId':_0x2c0520,'subUnitId':_0x1a004f,'range':{'startRow':0x0,'endRow':_0x3570e9-0x1,'startColumn':_0x39ec8d,'endColumn':_0x12b6d1[_0x52436d(0x246)]-0x1}}}),_0x4ce1f2[_0x52436d(0x4e8)]({'id':_univerjs_sheets[_0x52436d(0x27c)]['id'],'params':{'unitId':_0x2c0520,'subUnitId':_0x1a004f,'range':{'startRow':0x0,'endRow':_0x3570e9-0x1,'startColumn':_0x39ec8d,'endColumn':_0x12b6d1[_0x52436d(0x246)]-0x1}}})),{'undos':_0x4ce1f2,'redos':_0x4acf20};}function getStringLength(_0x15271d){const _0x52446c=_0x273cf5;let _0x17a433=0x0;for(let _0x92431c=0x0;_0x92431c<_0x15271d[_0x52446c(0x36f)];_0x92431c++){const _0x396298=_0x15271d[_0x52446c(0x3bc)](_0x92431c);if(_0x396298>=0x4e00&&_0x396298<=0x9fff||_0x396298>=0x3000&&_0x396298<=0x303f||_0x396298>=0xff00&&_0x396298<=0xffef)_0x17a433+=0x2;else _0x17a433+=0x1;}return _0x17a433;}function getHeaderViewMaxText(_0x1a3f4f,_0x407b30,_0x9692de,_0x21f436){const _0x15b6dd=_0x273cf5,{rowCount:_0xa5db66,colCount:_0xd2517b,headerMap:_0x164613}=_0x1a3f4f,_0x386bf8=0x64,_0x5aa21e=Math[_0x15b6dd(0x4c5)](_0xa5db66,_0x386bf8),_0x26ae50=Math[_0x15b6dd(0x4c5)](_0xd2517b,_0x386bf8);let _0x39cf4b='',_0x5d6f63=0x0;for(let _0x3ecd74=0x0;_0x3ecd74<_0x5aa21e;_0x3ecd74++)for(let _0x1b42fe=0x0;_0x1b42fe<_0x26ae50;_0x1b42fe++){var _0x271aed,_0x126b2c;const _0x1810ff={...(_0x271aed=_0x1a3f4f['data'])===null||_0x271aed===void 0x0||(_0x271aed=_0x271aed[_0x3ecd74])===null||_0x271aed===void 0x0?void 0x0:_0x271aed[_0x1b42fe]},_0x3124f2=_0x21f436[(_0x126b2c=_0x164613[_0x3ecd74])===null||_0x126b2c===void 0x0?void 0x0:_0x126b2c['tableFieldId']];let _0x397145=_0x1a3f4f['getValue'](_0x3ecd74,_0x1b42fe);if(_0x1810ff){var _0x31e8a8;_0x397145=transFromCellValue(_0x1810ff,_0x9692de?_0x1b42fe===0x0&&((_0x31e8a8=_0x1a3f4f[_0x15b6dd(0x24f)](_0x1b42fe+0x1))===null||_0x31e8a8===void 0x0?void 0x0:_0x31e8a8[_0x15b6dd(0x4eb)]):![],_0x3124f2,_0x407b30);}if(_0x397145!==void 0x0){const _0x16ab3d=getStringLength(String(_0x397145));_0x5d6f63<_0x16ab3d&&(_0x39cf4b=String(_0x397145),_0x5d6f63=_0x16ab3d);}}return _0x39cf4b;}function getValueViewMaxText(_0x197cae){const _0xe27151=_0x273cf5,{rowCount:_0x2eaebb,colCount:_0x348308}=_0x197cae;let _0x52ea36='',_0x38db67=0x0;for(let _0x5d2866=_0x2eaebb-0x1;_0x5d2866>0x0&&_0x5d2866>_0x2eaebb-0x3;_0x5d2866--)for(let _0xf462ac=0x0;_0xf462ac<_0x348308;_0xf462ac++){const _0x5ea50a=_0x197cae['getValue'](_0x5d2866,_0xf462ac);if(_0x5ea50a!==void 0x0){const _0x3dff47=String(_0x5ea50a)[_0xe27151(0x36f)];_0x38db67<_0x3dff47&&(_0x52ea36=String(_0x5ea50a),_0x38db67=_0x3dff47);}}return _0x52ea36;}function getCornerMaxText(_0x1e983b){const _0x293ad3=_0x273cf5,{rowCount:_0x244bfe,colCount:_0x3c50dd}=_0x1e983b;let _0x14a437='',_0x47cc19=0x0;for(let _0x3468b4=0x0;_0x3468b4<_0x244bfe;_0x3468b4++)for(let _0x23cf54=0x0;_0x23cf54<_0x3c50dd;_0x23cf54++){const _0x59008c=_0x1e983b['getValue'](_0x3468b4,_0x23cf54);if(_0x59008c!==void 0x0){const _0x1aa6ee=String(_0x59008c)[_0x293ad3(0x36f)];_0x47cc19<_0x1aa6ee&&(_0x14a437=String(_0x59008c),_0x47cc19=_0x1aa6ee);}}return _0x14a437;}function setConfigToPivotTable(_0x2964c3,_0x1ba073){const _0x45a1a3=_0x273cf5,{rowFields:_0x3d13e3,columnFields:_0x16df13,valueFields:_0x2cb559,filterFields:_0x49c79c,dimension:_0x200fc3,measure:_0x2d07b0}=_0x1ba073;for(const _0x33705a of _0x3d13e3){const _0xb875d3=_0x200fc3[_0x33705a];if(_0xb875d3&&_0x2964c3['getDataFieldByDataFieldId'](_0xb875d3['dataFieldId'])){_0x2964c3[_0x45a1a3(0x2eb)](_0xb875d3[_0x45a1a3(0x496)],_univerjs_pro_engine_pivot[_0x45a1a3(0x37d)][_0x45a1a3(0x3ec)],void 0x0,_0x33705a);if(_0xb875d3[_0x45a1a3(0x233)])_0x2964c3[_0x45a1a3(0x2c0)](_0xb875d3['id'],_0xb875d3['displayName']);if(_0xb875d3[_0x45a1a3(0x437)])_0x2964c3['setSortInfo'](_0xb875d3['id'],_0xb875d3[_0x45a1a3(0x437)]);if(_0xb875d3[_0x45a1a3(0x3dc)])_0x2964c3['setLabelFilterInfo'](_0xb875d3['id'],_0xb875d3[_0x45a1a3(0x3dc)]);}}for(const _0x15dd04 of _0x16df13){const _0x1fbe18=_0x200fc3[_0x15dd04];if(_0x1fbe18&&_0x2964c3[_0x45a1a3(0x223)](_0x1fbe18[_0x45a1a3(0x496)])){_0x2964c3[_0x45a1a3(0x2eb)](_0x1fbe18[_0x45a1a3(0x496)],_univerjs_pro_engine_pivot[_0x45a1a3(0x37d)]['Column'],void 0x0,_0x15dd04);if(_0x1fbe18[_0x45a1a3(0x437)])_0x2964c3[_0x45a1a3(0x2fd)](_0x1fbe18['id'],_0x1fbe18[_0x45a1a3(0x437)]);if(_0x1fbe18[_0x45a1a3(0x3dc)])_0x2964c3[_0x45a1a3(0x392)](_0x1fbe18['id'],_0x1fbe18[_0x45a1a3(0x3dc)]);if(_0x1fbe18[_0x45a1a3(0x233)])_0x2964c3['renameField'](_0x1fbe18['id'],_0x1fbe18[_0x45a1a3(0x233)]);}}for(const _0x316899 of _0x49c79c){const _0x7c2982=_0x200fc3[_0x316899];if(_0x7c2982&&_0x2964c3['getDataFieldByDataFieldId'](_0x7c2982[_0x45a1a3(0x496)])){_0x2964c3[_0x45a1a3(0x2eb)](_0x7c2982[_0x45a1a3(0x496)],_univerjs_pro_engine_pivot[_0x45a1a3(0x37d)]['Filter'],void 0x0,_0x316899);if(_0x7c2982[_0x45a1a3(0x437)])_0x2964c3[_0x45a1a3(0x2fd)](_0x7c2982['id'],_0x7c2982[_0x45a1a3(0x437)]);if(_0x7c2982[_0x45a1a3(0x3dc)])_0x2964c3[_0x45a1a3(0x392)](_0x7c2982['id'],_0x7c2982['filterInfo']);if(_0x7c2982[_0x45a1a3(0x233)])_0x2964c3[_0x45a1a3(0x2c0)](_0x7c2982['id'],_0x7c2982['displayName']);}}for(const _0x5448f3 of _0x2cb559){const _0xc5543=_0x2d07b0[_0x5448f3];if(_0xc5543&&_0x2964c3[_0x45a1a3(0x223)](_0xc5543[_0x45a1a3(0x496)])){_0x2964c3[_0x45a1a3(0x2eb)](_0xc5543[_0x45a1a3(0x496)],_univerjs_pro_engine_pivot[_0x45a1a3(0x37d)][_0x45a1a3(0x3a1)],void 0x0,_0x5448f3);if(_0xc5543['subtotal']!==void 0x0)_0x2964c3['setSubtotalType'](_0x5448f3,_0xc5543['subtotal']);if(_0xc5543['format'])_0x2964c3[_0x45a1a3(0x366)](_0x5448f3,_0xc5543[_0x45a1a3(0x263)]);if(_0xc5543[_0x45a1a3(0x233)])_0x2964c3['renameField'](_0xc5543['id'],_0xc5543[_0x45a1a3(0x233)]);}}const _0x187fe2=_0x1ba073[_0x45a1a3(0x310)];for(const {fieldId:_0x10a488,filterInfo:_0x34ed4e}of _0x187fe2)_0x2964c3[_0x45a1a3(0x2b4)](_0x10a488,_0x34ed4e);}function resetPivotTable(_0x64e56f,_0x2c0735){const _0x408b7b=_0x273cf5,_0x9dced7=[];if(_0x2c0735===_univerjs_pro_engine_pivot[_0x408b7b(0x37d)][_0x408b7b(0x3ec)])_0x64e56f[_0x408b7b(0x382)](_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x408b7b(0x3ec)],_0x145e1f=>{const _0x13688d=_0x408b7b;_0x9dced7[_0x13688d(0x4e8)](_0x145e1f['getId']());});if(_0x2c0735===_univerjs_pro_engine_pivot[_0x408b7b(0x37d)][_0x408b7b(0x20b)])_0x64e56f[_0x408b7b(0x382)](_univerjs_pro_engine_pivot[_0x408b7b(0x37d)][_0x408b7b(0x20b)],_0xa82a8f=>{const _0x5eb5d9=_0x408b7b;_0x9dced7['push'](_0xa82a8f[_0x5eb5d9(0x368)]());});if(_0x2c0735===_univerjs_pro_engine_pivot[_0x408b7b(0x37d)][_0x408b7b(0x390)])_0x64e56f['iterateFieldByArea'](_univerjs_pro_engine_pivot[_0x408b7b(0x37d)]['Filter'],_0x582809=>{const _0x39de99=_0x408b7b;_0x9dced7[_0x39de99(0x4e8)](_0x582809[_0x39de99(0x368)]());});if(_0x2c0735===_univerjs_pro_engine_pivot[_0x408b7b(0x37d)]['Value'])_0x64e56f['iterateFieldByArea'](_univerjs_pro_engine_pivot[_0x408b7b(0x37d)][_0x408b7b(0x3a1)],_0x2ccacc=>{const _0x8169e7=_0x408b7b;_0x9dced7[_0x8169e7(0x4e8)](_0x2ccacc[_0x8169e7(0x368)]());});if(_0x2c0735===void 0x0)_0x64e56f[_0x408b7b(0x361)](_0x46a445=>{const _0x38aa27=_0x408b7b;_0x9dced7[_0x38aa27(0x4e8)](_0x46a445[_0x38aa27(0x368)]());});const _0x13b979=_0x9dced7[_0x408b7b(0x36f)];for(let _0xcb6866=_0x13b979-0x1;_0xcb6866>=0x0;_0xcb6866--)_0x64e56f[_0x408b7b(0x1cd)](_0x9dced7[_0xcb6866]);const _0x4af054=_0x64e56f[_0x408b7b(0x1fb)]();for(const _0x145ae5 in _0x4af054)_0x64e56f[_0x408b7b(0x3be)](_0x145ae5);}function findCommonDateType(_0x4c123f,_0x3ef1e4){const _0x480b66=_0x273cf5,_0x2e1192=new Date((0x0,_univerjs_pro_engine_pivot['excelDateToUnixMilliseconds'])(_0x3ef1e4)),_0x204a7f=new Date((0x0,_univerjs_pro_engine_pivot['excelDateToUnixMilliseconds'])(_0x4c123f)),_0x22f162=_0x2e1192['getFullYear'](),_0x16adeb=_0x204a7f[_0x480b66(0x1de)](),_0x168059=_0x2e1192[_0x480b66(0x1d8)](),_0x87cba8=_0x204a7f[_0x480b66(0x1d8)](),_0x5096db=_0x2e1192['getDate'](),_0x362720=_0x204a7f[_0x480b66(0x2e7)](),_0x19fa36=_0x22f162===_0x16adeb,_0x440817=_0x19fa36&&_0x168059===_0x87cba8;if(_0x19fa36&&_0x440817&&!(_0x440817&&_0x5096db===_0x362720))return _univerjs_pro_engine_pivot[_0x480b66(0x264)][_0x480b66(0x2ee)];else{if(_0x19fa36&&!_0x440817)return _univerjs_pro_engine_pivot[_0x480b66(0x264)]['YearMonth'];}return _univerjs_pro_engine_pivot[_0x480b66(0x264)][_0x480b66(0x3d9)];}function getDateGroupName(_0x4d20d1,_0x5eee46){const _0x19dbdb=_0x273cf5,_0x1c6d3e=_0x4d20d1[_0x19dbdb(0x29f)](SheetsPivotDataSourceModel)[_0x19dbdb(0x471)]();let _0x530134='';switch(_0x5eee46){case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x2ee)]:_0x530134=_0x1c6d3e[_0x19dbdb(0x201)];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x208)]:_0x530134=_0x1c6d3e[_0x19dbdb(0x4a6)];break;case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum'][_0x19dbdb(0x3d9)]:_0x530134=_0x1c6d3e[_0x19dbdb(0x2a7)];break;case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum']['Month']:_0x530134=_0x1c6d3e[_0x19dbdb(0x3e9)];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)]['Quarter']:_0x530134=_0x1c6d3e[_0x19dbdb(0x37c)];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x288)]:_0x530134=_0x1c6d3e[_0x19dbdb(0x262)];break;case _univerjs_pro_engine_pivot['PivotDateGroupFieldDateTypeEnum'][_0x19dbdb(0x1d3)]:_0x530134=_0x1c6d3e[_0x19dbdb(0x298)];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x373)]:_0x530134=_0x1c6d3e['sheets-pivot.dateGroup.hour'];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x4bf)]:_0x530134=_0x1c6d3e['sheets-pivot.dateGroup.minute'];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x432)]:_0x530134=_0x1c6d3e['sheets-pivot.dateGroup.monthDate'];break;case _univerjs_pro_engine_pivot[_0x19dbdb(0x264)][_0x19dbdb(0x3e1)]:_0x530134=_0x1c6d3e[_0x19dbdb(0x345)];break;default:_0x530134='';break;}return _0x530134;}const SHEETS_PIVOT_PLUGIN_CONFIG_KEY=_0x273cf5(0x351),configSymbol=Symbol(SHEETS_PIVOT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};let SheetsPivotTableConfigModel=class SheetsPivotTableConfigModel extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x48c835,_0x32b645,_0x43be5b,_0x3bd3ac,_0x2e47ce){const _0x5749d3=_0x273cf5;super(),this[_0x5749d3(0x24c)]=_0x48c835,this[_0x5749d3(0x381)]=_0x32b645,this['_univerInstanceService']=_0x43be5b,this[_0x5749d3(0x22e)]=_0x3bd3ac,this[_0x5749d3(0x4be)]=_0x2e47ce,_defineProperty(this,_0x5749d3(0x23c),new Map()),_defineProperty(this,_0x5749d3(0x365),new Map()),_defineProperty(this,'_pivotTableRangeInfo',new Map()),_defineProperty(this,_0x5749d3(0x41c),new Map()),_defineProperty(this,'_configVersion$',new rxjs[(_0x5749d3(0x45f))]()),_defineProperty(this,_0x5749d3(0x465),new rxjs[(_0x5749d3(0x45f))]()),_defineProperty(this,_0x5749d3(0x352),this[_0x5749d3(0x465)][_0x5749d3(0x4b8)]()),_defineProperty(this,'_pivotConfigChange$',new rxjs[(_0x5749d3(0x45f))]()),_defineProperty(this,_0x5749d3(0x3e4),this['_pivotConfigChange$']['asObservable']()),_defineProperty(this,_0x5749d3(0x49f),{}),_defineProperty(this,'configVersion$',this[_0x5749d3(0x1e1)]['asObservable']()),this[_0x5749d3(0x3d1)](),this[_0x5749d3(0x228)]();const _0x1ec582=this['_configService'][_0x5749d3(0x4e3)](SHEETS_PIVOT_PLUGIN_CONFIG_KEY);if((_0x1ec582===null||_0x1ec582===void 0x0?void 0x0:_0x1ec582[_0x5749d3(0x4b9)])===!![])this[_0x5749d3(0x1e5)]();}['_initUnitDisposed'](){const _0x539a29=_0x273cf5;this['disposeWithMe'](this[_0x539a29(0x2ae)][_0x539a29(0x31a)](_univerjs_core[_0x539a29(0x37f)][_0x539a29(0x4aa)])[_0x539a29(0x46a)](_0x3148d4=>{this['deleteUnitId'](_0x3148d4['getUnitId']());}));}['setPivotInitCompleted'](){const _0x1d8175=_0x273cf5;this[_0x1d8175(0x465)][_0x1d8175(0x28f)](!![]);}[_0x273cf5(0x3d1)](){const _0x34089e=_0x273cf5,_0x281c4d=flattenObject(this[_0x34089e(0x24c)],localeTemplate,'',{});this[_0x34089e(0x49f)]=_0x281c4d,this[_0x34089e(0x381)]['executeCommand'](SendInitPivotTextLocalMutation['id'],{'textInfo':_0x281c4d},{'onlyLocal':!![]});}[_0x273cf5(0x471)](){const _0x1d270f=_0x273cf5;return this[_0x1d270f(0x49f)];}[_0x273cf5(0x1d7)](_0x5494e2,_0x4bb12b,_0x5d7526,_0x4a8709,_0x5aa902){this['updatePivotTableMatrixInfo'](_0x5494e2,_0x4bb12b,_0x5d7526,_0x4a8709),this['updatePivotTableRangeInfo'](_0x5494e2,_0x4bb12b,_0x5d7526,_0x5aa902);}[_0x273cf5(0x4b0)](_0x4ce217,_0x56ba2d,_0x191f4f){const _0x1b1a06=_0x273cf5;var _0x3e4b31;const _0x3ae513=(_0x3e4b31=this[_0x1b1a06(0x23c)][_0x1b1a06(0x29f)](_0x4ce217))===null||_0x3e4b31===void 0x0?void 0x0:_0x3e4b31[_0x1b1a06(0x29f)](_0x56ba2d);if(!_0x3ae513)return;return _0x3ae513[_0x1b1a06(0x29f)](_0x191f4f);}[_0x273cf5(0x49e)](_0x41d970,_0xe606bb){const _0x2187a9=_0x273cf5,_0x46ebe9=this['_model'][_0x2187a9(0x29f)](_0x41d970);if(!_0x46ebe9)return;for(const [_0x2c9928,_0x35ea4d]of _0x46ebe9[_0x2187a9(0x2f5)]())for(const [_0x310d0d,_0x206cd5]of _0x35ea4d['entries']())if(_0x310d0d===_0xe606bb)return _0x206cd5[_0x2187a9(0x1db)];}[_0x273cf5(0x25d)](_0x2da3b5,_0x3a0d78,_0x47b7aa){const _0x2b329b=_0x273cf5,_0x1ae23e=this['getPivotTableConfig'](_0x2da3b5,_0x3a0d78,_0x47b7aa);return _0x1ae23e===null||_0x1ae23e===void 0x0?void 0x0:_0x1ae23e[_0x2b329b(0x1db)];}[_0x273cf5(0x44a)](_0x475f60,_0x53e39b){const _0xe38d5f=_0x273cf5;var _0xc76548;return(_0xc76548=this[_0xe38d5f(0x23c)][_0xe38d5f(0x29f)](_0x475f60))===null||_0xc76548===void 0x0?void 0x0:_0xc76548[_0xe38d5f(0x29f)](_0x53e39b);}[_0x273cf5(0x309)](_0x4703d9,_0x354ec5,_0x890d69,_0x409c57){const _0x4a27d5=_0x273cf5,_0x11765d=this['_ensurePivotMap'](_0x4703d9,_0x354ec5);if(_0x409c57)_0x11765d[_0x4a27d5(0x3ab)](_0x890d69,_0x409c57);else _0x11765d[_0x4a27d5(0x33d)](_0x890d69);this['_pivotConfigChange$']['next']({'unitId':_0x4703d9,'subUnitId':_0x354ec5,'pivotTableId':_0x890d69,'pivotTableConfig':_0x409c57});}['getCollection'](_0x45bdcb,_0x1d5d79){const _0x198c78=_0x273cf5;var _0x7b2a0d;return(_0x7b2a0d=this['_collectionConfigModel'][_0x198c78(0x29f)](_0x45bdcb))===null||_0x7b2a0d===void 0x0?void 0x0:_0x7b2a0d['collections'][_0x1d5d79];}[_0x273cf5(0x2e5)](_0x47861e,_0x106586){const _0x303523=_0x273cf5;this[_0x303523(0x365)]['set'](_0x47861e,_0x106586),this['_configVersion$']['next'](Math[_0x303523(0x384)]());}[_0x273cf5(0x47b)](_0xde93e1,_0x2273f8){const _0x1072cd=_0x273cf5;let _0x483448=this[_0x1072cd(0x23c)][_0x1072cd(0x29f)](_0xde93e1);!_0x483448&&(_0x483448=new Map(),this[_0x1072cd(0x23c)]['set'](_0xde93e1,_0x483448));let _0x33d868=_0x483448[_0x1072cd(0x29f)](_0x2273f8);return!_0x33d868&&(_0x33d868=new Map(),_0x483448['set'](_0x2273f8,_0x33d868)),_0x33d868;}[_0x273cf5(0x3e6)](_0x37764d,_0x1a3781){const _0x7a2c12=_0x273cf5;let _0x3ddd2b=this[_0x7a2c12(0x44c)][_0x7a2c12(0x29f)](_0x37764d);!_0x3ddd2b&&(_0x3ddd2b=new Map(),this[_0x7a2c12(0x44c)][_0x7a2c12(0x3ab)](_0x37764d,_0x3ddd2b));let _0xad9548=_0x3ddd2b[_0x7a2c12(0x29f)](_0x1a3781);return!_0xad9548&&(_0xad9548=new Map(),_0x3ddd2b['set'](_0x1a3781,_0xad9548)),_0xad9548;}[_0x273cf5(0x46e)](_0x54ef7b,_0x4621fd){const _0x7faf2b=_0x273cf5;let _0x4557b7=this[_0x7faf2b(0x41c)][_0x7faf2b(0x29f)](_0x54ef7b);!_0x4557b7&&(_0x4557b7=new Map(),this[_0x7faf2b(0x41c)]['set'](_0x54ef7b,_0x4557b7));let _0x42e37e=_0x4557b7[_0x7faf2b(0x29f)](_0x4621fd);return!_0x42e37e&&(_0x42e37e=new Map(),_0x4557b7[_0x7faf2b(0x3ab)](_0x4621fd,_0x42e37e)),_0x42e37e;}[_0x273cf5(0x31f)](_0x28b557,_0x29eb9f,_0x1aa339,_0x1751fc){const _0x4dfb24=_0x273cf5;var _0x1ade9c;const _0x522dfe=this['_ensurePivotTableRangeInfo'](_0x28b557,_0x29eb9f),_0x123263=(_0x1ade9c=_0x522dfe['get'](_0x1aa339))===null||_0x1ade9c===void 0x0?void 0x0:_0x1ade9c['oldRangeInfo'];_0x522dfe[_0x4dfb24(0x3ab)](_0x1aa339,{'oldRangeInfo':_0x123263,'rangeInfo':_0x1751fc});}[_0x273cf5(0x417)](_0x1397f4,_0x3193ce,_0x52e5c9,_0x2595ab){const _0x909360=_0x273cf5;var _0x282793;const _0x47e402=this[_0x909360(0x46e)](_0x1397f4,_0x3193ce),_0x285c93=(_0x282793=_0x47e402['get'](_0x52e5c9))===null||_0x282793===void 0x0?void 0x0:_0x282793[_0x909360(0x49a)];_0x47e402['set'](_0x52e5c9,{'oldMatrix':_0x285c93,'matrix':_0x2595ab});}[_0x273cf5(0x28a)](_0x59d231,_0xbe4f23,_0x23d58f){const _0xcc0dd1=_0x273cf5;var _0xe3b148;return(_0xe3b148=this[_0xcc0dd1(0x44c)]['get'](_0x59d231))===null||_0xe3b148===void 0x0||(_0xe3b148=_0xe3b148[_0xcc0dd1(0x29f)](_0xbe4f23))===null||_0xe3b148===void 0x0?void 0x0:_0xe3b148['get'](_0x23d58f);}[_0x273cf5(0x479)](_0x3780ee,_0x1b3be7,_0x4e51cc){const _0x4ce951=_0x273cf5;var _0x44a92f;return(_0x44a92f=this['_pivotTableMatrixInfo'][_0x4ce951(0x29f)](_0x3780ee))===null||_0x44a92f===void 0x0||(_0x44a92f=_0x44a92f[_0x4ce951(0x29f)](_0x1b3be7))===null||_0x44a92f===void 0x0?void 0x0:_0x44a92f[_0x4ce951(0x29f)](_0x4e51cc);}[_0x273cf5(0x255)](_0x42ee1e){const _0x5e5816=_0x273cf5;this[_0x5e5816(0x23c)][_0x5e5816(0x33d)](_0x42ee1e),this[_0x5e5816(0x365)][_0x5e5816(0x33d)](_0x42ee1e);}['_toJSON'](_0x25cdac){const _0x4cabf7=_0x273cf5,_0x2e0c8c={'dataFieldManagerConfig':{},'pivotTableConfigs':{}};if(this[_0x4cabf7(0x365)][_0x4cabf7(0x29f)](_0x25cdac))_0x2e0c8c[_0x4cabf7(0x295)][_0x25cdac]=this[_0x4cabf7(0x365)][_0x4cabf7(0x29f)](_0x25cdac);if(this[_0x4cabf7(0x23c)][_0x4cabf7(0x29f)](_0x25cdac)){_0x2e0c8c[_0x4cabf7(0x247)][_0x25cdac]={};const _0x58def0=this['_model'][_0x4cabf7(0x29f)](_0x25cdac);if(_0x58def0===null||_0x58def0===void 0x0?void 0x0:_0x58def0[_0x4cabf7(0x2a4)])[..._0x58def0[_0x4cabf7(0x260)]()]['forEach'](_0x36aa1d=>{const _0x52981f=_0x4cabf7,_0x26aca3=_0x58def0[_0x52981f(0x29f)](_0x36aa1d);(_0x26aca3===null||_0x26aca3===void 0x0?void 0x0:_0x26aca3[_0x52981f(0x2a4)])&&(_0x2e0c8c[_0x52981f(0x247)][_0x25cdac][_0x36aa1d]={},[..._0x26aca3[_0x52981f(0x260)]()][_0x52981f(0x24b)](_0x1c3e18=>{const _0x11044d=_0x52981f,_0x53ce5b=_0x26aca3[_0x11044d(0x29f)](_0x1c3e18);if(_0x53ce5b)_0x2e0c8c[_0x11044d(0x247)][_0x25cdac][_0x36aa1d][_0x1c3e18]=_0x53ce5b;}));});}return _0x2e0c8c;}['_initSnapshot'](){const _0x119a8c=_0x273cf5;this['disposeWithMe'](this[_0x119a8c(0x22e)][_0x119a8c(0x400)]({'toJson':_0x322010=>{const _0xe7655c=_0x119a8c;return JSON[_0xe7655c(0x307)](this[_0xe7655c(0x2f3)](_0x322010));},'parseJson':_0x41d64f=>{return{};},'businesses':[_univerjs_core[_0x119a8c(0x37f)][_0x119a8c(0x4aa)]],'pluginName':SHEET_PIVOT_TABLE_PLUGIN,'onLoad':(_0x568bbb,_0x14a265)=>{},'onUnLoad':_0x1d942e=>{const _0x1573bd=_0x119a8c;this[_0x1573bd(0x255)](_0x1d942e);}}));}};SheetsPivotTableConfigModel=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x273cf5(0x3a6)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core['ICommandService'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x315)])),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x273cf5(0x2bb)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x26e)]))],SheetsPivotTableConfigModel);let SheetsPivotTableAdaptorModel=class SheetsPivotTableAdaptorModel extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x9488ee,_0x3f3567,_0x517232,_0x3a9260,_0x4b0418){const _0x560431=_0x273cf5;super(),this[_0x560431(0x3b8)]=_0x9488ee,this['_injector']=_0x3f3567,this[_0x560431(0x219)]=_0x517232,this[_0x560431(0x2ae)]=_0x3a9260,this[_0x560431(0x2f1)]=_0x4b0418,_defineProperty(this,'_pivotRenderInfoCache',new Map()),_defineProperty(this,'_pivotRenderValueMatrixCache',new Map()),_defineProperty(this,'_markDirty$',new rxjs[(_0x560431(0x45f))]()),_defineProperty(this,_0x560431(0x237),this[_0x560431(0x436)][_0x560431(0x4b8)]()),_defineProperty(this,_0x560431(0x42b),new rxjs[(_0x560431(0x45f))]()),_defineProperty(this,_0x560431(0x2c4),this[_0x560431(0x42b)][_0x560431(0x4b8)]()),_defineProperty(this,'_textInfo',void 0x0),this['_initLocale'](),this[_0x560431(0x228)]();}['_initUnitDisposed'](){const _0x32cc9d=_0x273cf5;this['disposeWithMe'](this['_univerInstanceService'][_0x32cc9d(0x31a)](_univerjs_core[_0x32cc9d(0x37f)][_0x32cc9d(0x4aa)])[_0x32cc9d(0x46a)](_0x5cfc14=>{const _0x14a7e6=_0x32cc9d;this[_0x14a7e6(0x255)](_0x5cfc14['getUnitId']());}));}['_initLocale'](){const _0x590a5b=_0x273cf5;this[_0x590a5b(0x49f)]=flattenObject(this[_0x590a5b(0x24c)],localeTemplate,'',{});}[_0x273cf5(0x24e)](_0x30c226){const _0x226d50=_0x273cf5,{view:_0x1be7d4,unitId:_0x46d48a,subUnitId:_0x43dd77,pivotTableId:_0x349657,type:_0x1f308e}=_0x30c226,_0x5b86bc=this[_0x226d50(0x219)][_0x226d50(0x4b0)](_0x46d48a,_0x43dd77,_0x349657);if(!_0x1be7d4||!_0x5b86bc||_0x1f308e===PivotTableOperationEnum['Delete'])return;const {pageView:_0x20ed4f,cornerView:_0x58bbb7,rowView:_0x2df2a8,colView:_0x564d42,dataView:_0x39018a}=_0x1be7d4,_0x4c34e7=_0x5b86bc[_0x226d50(0x1db)],_0x19b15a=_0x5b86bc['isEmpty'],_0x55d880=this[_0x226d50(0x4a5)](_0x46d48a,_0x43dd77),_0x31f63b=this[_0x226d50(0x31d)](_0x46d48a,_0x43dd77,_0x349657);if(_0x19b15a)return this['_updateRenderEmptyCache'](_0x30c226,_0x55d880,_0x4c34e7,_0x31f63b);else{const _0x38d111=getAdjustRangesPosition(_0x4c34e7,_0x20ed4f,!![]),_0x49eab2=_0x20ed4f[_0x226d50(0x30a)]>=0x0?_0x20ed4f[_0x226d50(0x30a)]+0x1:0x0,_0x3c4a6d=_0x58bbb7[_0x226d50(0x3d7)](),_0x3143d9=_0x58bbb7[_0x226d50(0x456)](),_0x5dccd1=_0x38d111[_0x226d50(0x36f)]>0x0?0x1:0x0,_0x487085=getAdjustRangesPosition({'row':_0x4c34e7['row']+_0x49eab2+_0x5dccd1,'col':_0x4c34e7[_0x226d50(0x2d4)]},_0x58bbb7,![],![]);_0x31f63b[_0x226d50(0x4c2)]={'rowRanges':getAdjustRangesPosition({'row':_0x4c34e7[_0x226d50(0x1ed)]+_0x49eab2+_0x5dccd1+_0x3c4a6d,'col':_0x4c34e7[_0x226d50(0x2d4)]},_0x2df2a8,![],!![]),'colRanges':getAdjustRangesPosition({'row':_0x4c34e7[_0x226d50(0x1ed)]+_0x49eab2+_0x5dccd1,'col':_0x4c34e7[_0x226d50(0x2d4)]+_0x3143d9},_0x564d42,![],!![]),'cornerRanges':_0x487085,'dataRanges':getAdjustRangesPosition({'row':_0x4c34e7[_0x226d50(0x1ed)]+_0x49eab2+_0x5dccd1+_0x3c4a6d,'col':_0x4c34e7['col']+_0x3143d9},_0x39018a,![],![]),'pageRanges':_0x38d111};const {valueMatrix:_0x478bd3,rowInfo:_0x44bb3d,colInfo:_0x5bb784,cornerInfo:_0x291ed4,rowHeaderMap:_0x249fa6,colHeaderMap:_0x251178}=generatorAdjustPositionData$1(this[_0x226d50(0x24c)],_0x1be7d4,_0x5b86bc,this[_0x226d50(0x49f)]);return _0x31f63b['areaInfo']={'rowInfo':_0x44bb3d,'colInfo':_0x5bb784,'cornerInfo':_0x291ed4},_0x31f63b['headerMap']={'rowHeaderMap':_0x249fa6,'colHeaderMap':_0x251178},_0x478bd3[_0x226d50(0x24b)]((_0x5a9b92,_0x16e29f)=>{const _0x3da2a0=_0x226d50;Object[_0x3da2a0(0x260)](_0x16e29f)[_0x3da2a0(0x24b)](_0xefedb6=>{const _0x2fda75=_0x3da2a0,_0x3667e4=+_0xefedb6,_0x30e4d7=_0x478bd3[_0x2fda75(0x3e2)](_0x5a9b92,_0x3667e4);_0x55d880[_0x2fda75(0x438)](_0x5a9b92,_0x3667e4,_0x30e4d7);});}),this[_0x226d50(0x42b)]['next']({'unitId':_0x46d48a,'subUnitId':_0x43dd77,'valueMatrix':_0x55d880,'rangesCache':_0x31f63b[_0x226d50(0x4c2)],'pivotTableId':_0x349657,'type':_0x30c226[_0x226d50(0x39c)]}),this[_0x226d50(0x219)][_0x226d50(0x1d7)](_0x46d48a,_0x43dd77,_0x349657,_0x55d880,_0x31f63b[_0x226d50(0x4c2)]),this['_exclusiveRangeService'][_0x226d50(0x3a4)](_0x46d48a,_0x43dd77,SHEET_PIVOT_EXCLUSIVE_ID,this[_0x226d50(0x47f)](_0x31f63b['rangesInfo'],_0x349657)),{'rangeCache':_0x31f63b['rangesInfo'],'matrix':_0x55d880};}}[_0x273cf5(0x221)](_0x123fd0,_0x47d1de,_0x25d7e6,_0x5d73fe){const _0x4f95c5=_0x273cf5,_0x3b026b=this[_0x4f95c5(0x3b8)]['t'],{unitId:_0x2316a3,subUnitId:_0x329f1d,pivotTableId:_0x1e83b4}=_0x123fd0,{matrixCache:_0x496403,rangesCache:_0x5c050c}=generateDefaultEmptyCache({'filter':_0x3b026b(_0x4f95c5(0x24a)),'row':_0x3b026b(_0x4f95c5(0x461)),'column':_0x3b026b(_0x4f95c5(0x3ef)),'values':_0x3b026b(_0x4f95c5(0x42c))},_0x25d7e6);return _0x496403[_0x4f95c5(0x3bf)]((_0x1c961f,_0x7634de,_0xe640b6)=>{const _0x27c405=_0x4f95c5;_0x47d1de[_0x27c405(0x438)](_0x1c961f,_0x7634de,_0xe640b6);}),_0x5d73fe[_0x4f95c5(0x4c2)]=_0x5c050c,this['_viewUpdate$'][_0x4f95c5(0x28f)]({'unitId':_0x2316a3,'subUnitId':_0x329f1d,'valueMatrix':_0x47d1de,'rangesCache':_0x5c050c,'pivotTableId':_0x1e83b4,'type':_0x123fd0[_0x4f95c5(0x39c)],'isEmpty':!![]}),this[_0x4f95c5(0x219)][_0x4f95c5(0x1d7)](_0x2316a3,_0x329f1d,_0x1e83b4,_0x47d1de,_0x5c050c),this['_exclusiveRangeService']['addExclusiveRange'](_0x2316a3,_0x329f1d,SHEET_PIVOT_EXCLUSIVE_ID,this[_0x4f95c5(0x47f)](_0x5c050c,_0x1e83b4)),{'rangeCache':_0x5d73fe[_0x4f95c5(0x4c2)],'matrix':_0x47d1de};}[_0x273cf5(0x47f)](_0xc06390,_0x467b1f){const _0x1ca978=_0x273cf5,_0x5b76fc=[],_0x448011=unionPivotViewRange(_0xc06390);for(const _0x1e0977 of _0x448011)_0x5b76fc[_0x1ca978(0x4e8)]({'groupId':_0x467b1f,'range':_0x1e0977});return _0x5b76fc;}[_0x273cf5(0x3b0)](_0x1ceb30){const _0x515056=_0x273cf5;var _0x28c720;const {pivotTableId:_0x3c27c2,unitId:_0x23988c,subUnitId:_0x4d8d5c}=_0x1ceb30;if(!_0x3c27c2||!_0x23988c||!_0x4d8d5c)return;const _0x256de5=this[_0x515056(0x4a5)](_0x23988c,_0x4d8d5c),_0x21be59=(_0x28c720=this[_0x515056(0x270)][_0x515056(0x29f)](_0x23988c))===null||_0x28c720===void 0x0||(_0x28c720=_0x28c720[_0x515056(0x29f)](_0x4d8d5c))===null||_0x28c720===void 0x0?void 0x0:_0x28c720['get'](_0x3c27c2);if(_0x21be59===null||_0x21be59===void 0x0?void 0x0:_0x21be59[_0x515056(0x4c2)]){for(const _0x3ce5fe of Object[_0x515056(0x260)](_0x21be59[_0x515056(0x4c2)]))_0x21be59['rangesInfo'][_0x3ce5fe]['forEach'](_0x5a3b18=>{const _0x4d93de=_0x515056;for(let _0x441e78=_0x5a3b18[_0x4d93de(0x3de)];_0x441e78<=_0x5a3b18[_0x4d93de(0x4a7)];_0x441e78++)for(let _0x4b1f44=_0x5a3b18[_0x4d93de(0x3ed)];_0x4b1f44<=_0x5a3b18[_0x4d93de(0x41e)];_0x4b1f44++)_0x256de5['realDeleteValue'](_0x441e78,_0x4b1f44);});}if(_0x21be59){var _0x28eac4;(_0x28eac4=this[_0x515056(0x270)][_0x515056(0x29f)](_0x23988c))===null||_0x28eac4===void 0x0||(_0x28eac4=_0x28eac4['get'](_0x4d8d5c))===null||_0x28eac4===void 0x0||_0x28eac4['delete'](_0x3c27c2);}this[_0x515056(0x42b)]['next']({'unitId':_0x23988c,'subUnitId':_0x4d8d5c,'valueMatrix':_0x256de5,'pivotTableId':_0x3c27c2,'rangesCache':void 0x0,'type':_0x1ceb30[_0x515056(0x39c)]}),this[_0x515056(0x2f1)][_0x515056(0x238)](_0x23988c,_0x4d8d5c,SHEET_PIVOT_EXCLUSIVE_ID,_0x3c27c2);}[_0x273cf5(0x31d)](_0x3a16f4,_0x141bfc,_0x2cf9d7){const _0x5c473e=_0x273cf5;var _0x423409,_0x411eb3;if(!this['_pivotRenderInfoCache']['has'](_0x3a16f4))this[_0x5c473e(0x270)][_0x5c473e(0x3ab)](_0x3a16f4,new Map());if(!((_0x423409=this['_pivotRenderInfoCache'][_0x5c473e(0x29f)](_0x3a16f4))===null||_0x423409===void 0x0?void 0x0:_0x423409[_0x5c473e(0x388)](_0x141bfc))){var _0x593253;(_0x593253=this[_0x5c473e(0x270)][_0x5c473e(0x29f)](_0x3a16f4))===null||_0x593253===void 0x0||_0x593253['set'](_0x141bfc,new Map());}if(!((_0x411eb3=this[_0x5c473e(0x270)]['get'](_0x3a16f4))===null||_0x411eb3===void 0x0||(_0x411eb3=_0x411eb3['get'](_0x141bfc))===null||_0x411eb3===void 0x0?void 0x0:_0x411eb3[_0x5c473e(0x388)](_0x2cf9d7))){var _0x22dc26;(_0x22dc26=this[_0x5c473e(0x270)][_0x5c473e(0x29f)](_0x3a16f4))===null||_0x22dc26===void 0x0||(_0x22dc26=_0x22dc26[_0x5c473e(0x29f)](_0x141bfc))===null||_0x22dc26===void 0x0||_0x22dc26[_0x5c473e(0x3ab)](_0x2cf9d7,{});}return this[_0x5c473e(0x270)][_0x5c473e(0x29f)](_0x3a16f4)[_0x5c473e(0x29f)](_0x141bfc)[_0x5c473e(0x29f)](_0x2cf9d7);}[_0x273cf5(0x4a5)](_0x46ce0e,_0x319f68){const _0x2c548b=_0x273cf5;var _0x3b77dd;if(!this[_0x2c548b(0x35f)]['has'](_0x46ce0e))this[_0x2c548b(0x35f)][_0x2c548b(0x3ab)](_0x46ce0e,new Map());if(!((_0x3b77dd=this[_0x2c548b(0x35f)][_0x2c548b(0x29f)](_0x46ce0e))===null||_0x3b77dd===void 0x0?void 0x0:_0x3b77dd[_0x2c548b(0x388)](_0x319f68))){var _0x27b21f;(_0x27b21f=this['_pivotRenderValueMatrixCache']['get'](_0x46ce0e))===null||_0x27b21f===void 0x0||_0x27b21f['set'](_0x319f68,new _univerjs_core[(_0x2c548b(0x24d))]());}return this[_0x2c548b(0x35f)][_0x2c548b(0x29f)](_0x46ce0e)[_0x2c548b(0x29f)](_0x319f68);}[_0x273cf5(0x2e2)](_0x43f429,_0x574d29,_0x35dfb0,_0x2e95a7){const _0x50dfbc=_0x273cf5;var _0x26a846;const _0x4b6d2b=(_0x26a846=this[_0x50dfbc(0x35f)]['get'](_0x43f429))===null||_0x26a846===void 0x0||(_0x26a846=_0x26a846[_0x50dfbc(0x29f)](_0x574d29))===null||_0x26a846===void 0x0?void 0x0:_0x26a846['getValue'](_0x35dfb0,_0x2e95a7);if(_0x4b6d2b===void 0x0||_0x4b6d2b===null)return;return _0x4b6d2b;}[_0x273cf5(0x1e6)](_0xba2cbf,_0x5ebdab,_0x14549a,_0x485ad1){const _0xe58547=_0x273cf5;var _0x4c26f0;const _0x43ea36=(0x0,_univerjs_core[_0xe58547(0x38d)])(_0x14549a,_0x485ad1),_0x3abbbc=(_0x4c26f0=this[_0xe58547(0x270)][_0xe58547(0x29f)](_0xba2cbf))===null||_0x4c26f0===void 0x0?void 0x0:_0x4c26f0[_0xe58547(0x29f)](_0x5ebdab);if(!_0x3abbbc)return;return Array[_0xe58547(0x463)](_0x3abbbc['keys']())['find'](_0x4b8062=>{const _0xf22d6c=_0xe58547,_0x240de3=_0x3abbbc[_0xf22d6c(0x29f)](_0x4b8062),_0x3a4de1=_0x240de3===null||_0x240de3===void 0x0?void 0x0:_0x240de3[_0xf22d6c(0x4c2)];if(!_0x3a4de1)return![];return Object[_0xf22d6c(0x260)](_0x3a4de1)[_0xf22d6c(0x354)](_0x436cdd=>{const _0x42b37e=_0xf22d6c;return _0x3a4de1[_0x436cdd][_0x42b37e(0x354)](_0x2e1cea=>_univerjs_core[_0x42b37e(0x3ce)][_0x42b37e(0x1ef)](_0x2e1cea,_0x43ea36));});});}[_0x273cf5(0x353)](_0x5907bb,_0x44547a,_0x410048){const _0x3de2cf=_0x273cf5;var _0x49ee56;const _0x417c47=(_0x49ee56=this[_0x3de2cf(0x270)][_0x3de2cf(0x29f)](_0x5907bb))===null||_0x49ee56===void 0x0?void 0x0:_0x49ee56[_0x3de2cf(0x29f)](_0x44547a),_0x3dfca7=[];if(!_0x417c47)return _0x3dfca7;return Array['from'](_0x417c47[_0x3de2cf(0x260)]())['forEach'](_0x44bd67=>{const _0x487f78=_0x3de2cf,_0x4f8866=_0x417c47[_0x487f78(0x29f)](_0x44bd67),_0x38615c=_0x4f8866===null||_0x4f8866===void 0x0?void 0x0:_0x4f8866[_0x487f78(0x4c2)];if(_0x38615c)for(const _0x36152d of Object['values'](_0x38615c)){let _0x5802d9=![];for(const _0x2b5dac of _0x36152d)if(_univerjs_core[_0x487f78(0x3ce)][_0x487f78(0x476)](_0x2b5dac,_0x410048)){_0x3dfca7['push'](_0x44bd67),_0x5802d9=!![];break;}if(_0x5802d9)break;}}),_0x3dfca7;}[_0x273cf5(0x2b9)](_0x569fd8,_0x5bcac3){const _0x57edea=_0x273cf5;var _0x50fffa,_0x188082;return(_0x50fffa=(_0x188082=this[_0x57edea(0x35f)]['get'](_0x569fd8))===null||_0x188082===void 0x0?void 0x0:_0x188082[_0x57edea(0x29f)](_0x5bcac3))!==null&&_0x50fffa!==void 0x0?_0x50fffa:new _univerjs_core[(_0x57edea(0x24d))]();}[_0x273cf5(0x408)](_0x2d3f90,_0x5f31a7){const _0x4b8374=_0x273cf5;var _0x533f01;return(_0x533f01=this[_0x4b8374(0x270)]['get'](_0x2d3f90))===null||_0x533f01===void 0x0?void 0x0:_0x533f01[_0x4b8374(0x29f)](_0x5f31a7);}['getPivotItemRenderInfoCache'](_0x195740,_0x458c08,_0xbccaf2){const _0x2b2886=_0x273cf5;var _0x272db5;return(_0x272db5=this[_0x2b2886(0x270)]['get'](_0x195740))===null||_0x272db5===void 0x0||(_0x272db5=_0x272db5[_0x2b2886(0x29f)](_0x458c08))===null||_0x272db5===void 0x0?void 0x0:_0x272db5['get'](_0xbccaf2);}[_0x273cf5(0x255)](_0x59f149){const _0x53bfde=_0x273cf5;this[_0x53bfde(0x270)]['delete'](_0x59f149),this[_0x53bfde(0x35f)]['delete'](_0x59f149);}[_0x273cf5(0x283)](_0x2d18d2,_0x3142ca){this['_markDirty$']['next']({'unitId':_0x2d18d2,'subUnitId':_0x3142ca});}};SheetsPivotTableAdaptorModel=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core['LocaleService'])),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x3a6)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableConfigModel)),__decorateParam(0x3,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x315)])),__decorateParam(0x4,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_sheets[_0x273cf5(0x1f9)]))],SheetsPivotTableAdaptorModel);let SheetsPivotTableService=class SheetsPivotTableService extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x9ec129,_0xe513c4){const _0x3fc15f=_0x273cf5;super(),this[_0x3fc15f(0x4b7)]=_0x9ec129,this[_0x3fc15f(0x414)]=_0xe513c4,_defineProperty(this,'asyncInterceptor',new _univerjs_core[(_0x3fc15f(0x4a3))]({'PIVOT_PERFORM_CHECK':PIVOT_PERFORM_CHECK})),_defineProperty(this,_0x3fc15f(0x2e4),new _univerjs_core['InterceptorManager']({'PIVOT_MUTATION_GENERATE':PIVOT_MUTATION_GENERATE})),this['_init']();}[_0x273cf5(0x4b3)](){const _0x29ece2=_0x273cf5;this[_0x29ece2(0x403)]();}[_0x273cf5(0x3d6)](_0x591220){const _0x291693=_0x273cf5;return this[_0x291693(0x489)]['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(![],_0x591220);}[_0x273cf5(0x403)](){const _0x2572cc=_0x273cf5;this[_0x2572cc(0x399)](this[_0x2572cc(0x4b7)][_0x2572cc(0x2aa)](_univerjs_sheets['INTERCEPTOR_POINT'][_0x2572cc(0x458)],{'priority':0xc8,'effect':_univerjs_core[_0x2572cc(0x2b1)][_0x2572cc(0x3a1)]|_univerjs_core['InterceptorEffectEnum'][_0x2572cc(0x4c6)],'handler':(_0x548d65,_0x2ff9ee,_0x874a38)=>{const _0x454edd=_0x2572cc,{row:_0x17ea49,col:_0x11ab30,unitId:_0x104909,subUnitId:_0x1976bd,workbook:_0x264e0c}=_0x2ff9ee,_0x44da1b=this[_0x454edd(0x414)]['getPivotTableCellData'](_0x104909,_0x1976bd,_0x17ea49,_0x11ab30);if(!_0x44da1b)return _0x874a38(_0x548d65);const _0x3bd2af={..._0x548d65};if(_0x44da1b['v']||_0x44da1b['v']===0x0)_0x3bd2af['v']=_0x44da1b['v'];if(_0x44da1b['t'])_0x3bd2af['t']=_0x44da1b['t'];const _0x3e299b=(typeof(_0x548d65===null||_0x548d65===void 0x0?void 0x0:_0x548d65['s'])===_0x454edd(0x3f3)?_0x264e0c['getStyles']()['get'](_0x548d65===null||_0x548d65===void 0x0?void 0x0:_0x548d65['s']):_0x548d65===null||_0x548d65===void 0x0?void 0x0:_0x548d65['s'])||{},_0x9c6435=_0x264e0c[_0x454edd(0x22c)]()[_0x454edd(0x29f)](_0x44da1b['s']),_0x245596={..._0x9c6435,..._0x3e299b};if(_0x9c6435===null||_0x9c6435===void 0x0?void 0x0:_0x9c6435['n'])_0x245596['n']=_0x9c6435['n'];return _0x3bd2af['s']=_0x264e0c[_0x454edd(0x22c)]()[_0x454edd(0x438)](_0x245596),(_0x44da1b[_0x454edd(0x4df)]===_univerjs_pro_engine_pivot['PivotCellStyleTypeEnum'][_0x454edd(0x1d2)]||_0x44da1b[_0x454edd(0x4df)]===_univerjs_pro_engine_pivot[_0x454edd(0x48a)][_0x454edd(0x434)])&&(_0x3bd2af[_0x454edd(0x30d)]={},_0x3bd2af['fontRenderExtension'][_0x454edd(0x2cb)]=0x10),_0x874a38(_0x3bd2af);}}));}};function _0x1f80(_0x29e67c,_0x195cec){_0x29e67c=_0x29e67c-0x1c5;const _0x527b9b=_0x527b();let _0x1f808b=_0x527b9b[_0x29e67c];return _0x1f808b;}SheetsPivotTableService=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_sheets[_0x273cf5(0x478)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableAdaptorModel))],SheetsPivotTableService);const AddGroupCollectionMutation={'id':'sheet.mutation.add-group-collection','type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'handler':(_0x2221b5,_0x211a39)=>{const _0x1ae564=_0x273cf5;if(!_0x211a39)return![];const _0x1ac99b=_0x2221b5[_0x1ae564(0x29f)](_univerjs_core[_0x1ae564(0x26e)]);if(Boolean(_0x1ac99b['getConfig'](_0x1ae564(0x235))))return!![];const {pivotTableId:_0x2c7cd0,fieldJSON:_0x50c9cb,unitId:_0x46213a,subUnitId:_0x5a8e9e}=_0x211a39;let _0x4331ac;const {dataFieldType:_0x1ab988,id:_0x1bcfd9,name:_0x386077,hexCode:_0x24e356,originalFieldId:_0x6a6866}=_0x50c9cb;if(_0x1ab988===_univerjs_pro_engine_pivot[_0x1ae564(0x1f8)]['dateGroupField'])_0x4331ac=new _univerjs_pro_engine_pivot[(_0x1ae564(0x2af))](_0x1bcfd9,_0x386077,_0x24e356,_0x6a6866);if(!_0x4331ac)return![];const _0x3bbfed=_0x2221b5['get'](SheetsPivotDataSourceModel),_0x21caf4=_0x3bbfed[_0x1ae564(0x1f5)](_0x46213a),_0x19ce9e=_0x21caf4[_0x1ae564(0x22d)](_0x2c7cd0);_0x21caf4[_0x1ae564(0x3ee)](_0x4331ac),_0x19ce9e[_0x1ae564(0x3e5)](_0x4331ac[_0x1ae564(0x368)](),_0x4331ac[_0x1ae564(0x416)]());const _0x150caf=_0x19ce9e[_0x1ae564(0x286)](_0x4331ac['getOriginFieldId']());if(_0x150caf)_0x4331ac[_0x1ae564(0x2f2)](_0x150caf);const _0x2f48a8=_0x3bbfed[_0x1ae564(0x4b0)](_0x46213a,_0x5a8e9e,_0x2c7cd0);return _0x3bbfed[_0x1ae564(0x4c7)]({'unitId':_0x46213a,'subUnitId':_0x5a8e9e,'token':_0x2c7cd0,'type':PivotTableOperationEnum[_0x1ae564(0x2b2)],'pivotConfig':_0x2f48a8}),!![];}},RemoveGroupCollectionMutation={'id':_0x273cf5(0x35d),'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'handler':(_0x3cbfea,_0x3b8718)=>{const _0x3b4397=_0x273cf5;if(!_0x3b8718)return![];const _0xfc88ad=_0x3cbfea['get'](_univerjs_core[_0x3b4397(0x26e)]);if(Boolean(_0xfc88ad['getConfig'](_0x3b4397(0x235))))return!![];const {pivotTableId:_0x37df79,dataFieldId:_0x334843,unitId:_0x2a86e0,subUnitId:_0x3d3dc0}=_0x3b8718,_0x216f7f=_0x3cbfea['get'](SheetsPivotDataSourceModel),_0x32c87f=_0x216f7f[_0x3b4397(0x1f5)](_0x2a86e0);_0x32c87f['getCollection'](_0x37df79)[_0x3b4397(0x468)](_0x334843);let _0x43c492=!![];for(const _0xe3b176 in _0x32c87f[_0x3b4397(0x3d8)])if(_0x32c87f['collections'][_0xe3b176]['getFieldIds']()['includes'](_0x334843)){_0x43c492=![];break;}if(_0x43c492)_0x32c87f[_0x3b4397(0x34b)](_0x334843);const _0x140064=_0x216f7f[_0x3b4397(0x4b0)](_0x2a86e0,_0x3d3dc0,_0x37df79);return _0x216f7f[_0x3b4397(0x4c7)]({'unitId':_0x2a86e0,'subUnitId':_0x3d3dc0,'token':_0x37df79,'type':PivotTableOperationEnum[_0x3b4397(0x2b2)],'pivotConfig':_0x140064}),!![];}};function getFieldListByArea(_0x57c7b6,_0x96eadd){const _0x5650cd=_0x273cf5;switch(_0x96eadd){case _univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x5650cd(0x3a1)]:return _0x57c7b6[_0x5650cd(0x225)];case _univerjs_pro_engine_pivot['PivotTableFiledAreaEnum']['Filter']:return _0x57c7b6[_0x5650cd(0x2c3)];case _univerjs_pro_engine_pivot[_0x5650cd(0x37d)][_0x5650cd(0x3ec)]:return _0x57c7b6['rowFields'];case _univerjs_pro_engine_pivot[_0x5650cd(0x37d)]['Column']:return _0x57c7b6[_0x5650cd(0x4c8)];default:return[];}}function getFieldJson(_0x288088,_0x9bddda){const _0x3c6780=_0x273cf5;return _0x288088[_0x3c6780(0x28b)][_0x9bddda]||_0x288088['dimension'][_0x9bddda];}function applyAddFieldChangeSet(_0xa3ea3f,_0x50f2be){const _0x5e8c21=_0x273cf5,{area:_0x1dfe79,fieldJson:_0x2e0f62,index:_0x508efc}=_0x50f2be;if(_0x1dfe79===_univerjs_pro_engine_pivot[_0x5e8c21(0x37d)][_0x5e8c21(0x3a1)])_0xa3ea3f[_0x5e8c21(0x28b)][_0x2e0f62['id']]=_0x2e0f62;else _0xa3ea3f['dimension'][_0x2e0f62['id']]=_0x2e0f62;getFieldListByArea(_0xa3ea3f,_0x1dfe79)[_0x5e8c21(0x40f)](_0x508efc,0x0,_0x2e0f62['id']);}function applyRemoveFieldChangeSet(_0x39645c,_0x4d6bcb){const _0x540c06=_0x273cf5,{area:_0x15aff6,fieldId:_0x3cc3c7,index:_0x8a8738}=_0x4d6bcb;if(_0x15aff6===_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum']['Value'])delete _0x39645c[_0x540c06(0x28b)][_0x3cc3c7];else delete _0x39645c[_0x540c06(0x20d)][_0x3cc3c7];getFieldListByArea(_0x39645c,_0x15aff6)[_0x540c06(0x40f)](_0x8a8738,0x1);}function applyRenameFieldChangeSet(_0x2bda7d,_0x150979){const {fieldId:_0x36c985,name:_0x5c9ed7}=_0x150979,_0x6a6c99=getFieldJson(_0x2bda7d,_0x36c985);if(_0x6a6c99)_0x6a6c99['displayName']=_0x5c9ed7;}function applyCollapseChangeSet(_0x299993,_0xdb3d22){const _0x3a925b=_0x273cf5,{fieldId:_0x179a4b,collapse:_0x4662f3,item:_0xcf2d47}=_0xdb3d22;if(_0xcf2d47!==void 0x0)_0x299993[_0x3a925b(0x213)][_0x179a4b]=_0x299993[_0x3a925b(0x213)][_0x179a4b]||{},_0x299993[_0x3a925b(0x213)][_0x179a4b][_0xcf2d47]=_0x4662f3;else _0x299993[_0x3a925b(0x213)][_0x179a4b]=_0x4662f3;}function applySetFormatChangeSet(_0x1450e1,_0x4be38b){const _0x3d8651=_0x273cf5,{fieldId:_0x1f7faf,format:_0x447931}=_0x4be38b,_0x4443a1=getFieldJson(_0x1450e1,_0x1f7faf);if(_0x4443a1)_0x4443a1[_0x3d8651(0x263)]=_0x447931;}function applySetFilterChangeSet(_0x108724,_0x10616c){const _0x1d3572=_0x273cf5,{fieldId:_0x2fba15,filterInfo:_0xbe0993}=_0x10616c,_0x33e1ea=getFieldJson(_0x108724,_0x2fba15);if(_0x33e1ea)_0x33e1ea[_0x1d3572(0x3dc)]=_0xbe0993;}function applySetValueFilterChangeSet(_0x5a41b4,_0x407dd3){const _0x2627fc=_0x273cf5,{fieldId:_0x1cee5a,filterInfo:_0xc854ce}=_0x407dd3,_0x62e9cb=_0x5a41b4[_0x2627fc(0x310)][_0x2627fc(0x33f)](_0x34c869=>_0x34c869[_0x2627fc(0x2e0)]!==_0x1cee5a);if(_0xc854ce)_0x62e9cb[_0x2627fc(0x4e8)]({'fieldId':_0x1cee5a,'filterInfo':_0xc854ce});_0x5a41b4[_0x2627fc(0x310)]=_0x62e9cb;}function applySetSubtotalChangeSet(_0xb2f86c,_0x2f3389){const _0x229799=_0x273cf5,{fieldId:_0x2d3163,subtotalType:_0x270d14}=_0x2f3389,_0x445e23=getFieldJson(_0xb2f86c,_0x2d3163);if(_0x445e23)_0x445e23[_0x229799(0x485)]=_0x270d14;}function applyFieldPositionChangeSet(_0x180194,_0x42793f){const _0x41291a=_0x273cf5,{fieldId:_0x3a707d,oldArea:_0x3c72e8,area:_0x4a73b2,oldIndex:_0x4f5e20,index:_0x4c1eb4}=_0x42793f,_0x375cba=_0x3c72e8!==_univerjs_pro_engine_pivot[_0x41291a(0x37d)][_0x41291a(0x3a1)]&&_0x4a73b2===_univerjs_pro_engine_pivot[_0x41291a(0x37d)][_0x41291a(0x3a1)],_0x111499=_0x3c72e8===_univerjs_pro_engine_pivot[_0x41291a(0x37d)][_0x41291a(0x3a1)]&&_0x4a73b2!==_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x41291a(0x3a1)];if(_0x375cba||_0x111499){const _0x3097cb=getFieldJson(_0x180194,_0x3a707d);if(_0x3097cb)_0x375cba?(delete _0x180194[_0x41291a(0x20d)][_0x3a707d],_0x180194[_0x41291a(0x28b)][_0x3a707d]=_0x3097cb):(delete _0x180194[_0x41291a(0x28b)][_0x3a707d],_0x180194[_0x41291a(0x20d)][_0x3a707d]=_0x3097cb);}const _0x5810ee=getFieldListByArea(_0x180194,_0x3c72e8),_0x59fdc0=getFieldListByArea(_0x180194,_0x4a73b2);_0x5810ee[_0x41291a(0x40f)](_0x4f5e20,0x1),_0x59fdc0[_0x41291a(0x40f)](_0x4c1eb4,0x0,_0x3a707d);}function applyValuePositionChangeSet(_0x2372e6,_0x23caae){const _0x12364d=_0x273cf5,{valuePosition:_0x296e5e,index:_0x4aa8c7}=_0x23caae;_0x2372e6[_0x12364d(0x3ac)]=_0x296e5e,_0x2372e6[_0x12364d(0x2c6)]=_0x4aa8c7;}function applySourceInfoChangeSet(_0x3e9edf,_0x55e2b0){const _0x33faa7=_0x273cf5,{tableFieldId:_0x4401f0,sourceName:_0x54c800,dataFieldId:_0x5ae143}=_0x55e2b0,_0x143acf=getFieldJson(_0x3e9edf,_0x4401f0);_0x143acf&&(_0x143acf[_0x33faa7(0x4d1)]=_0x54c800,_0x143acf[_0x33faa7(0x496)]=_0x5ae143);}function applySetSortChangeSet(_0xf20f1d,_0x1d573f){const {fieldId:_0x490423,sortInfo:_0x224457}=_0x1d573f,_0x308220=getFieldJson(_0xf20f1d,_0x490423);if(_0x308220)_0x308220['sortInfo']=_0x224457;}function applySetOptionsChangeSet(_0x280443,_0x6c2cab){const _0x1c3637=_0x273cf5,{options:_0x222420}=_0x6c2cab;_0x280443[_0x1c3637(0x33a)]={..._0x280443[_0x1c3637(0x33a)],..._0x222420};}const AddPivotFieldMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x4ac),'handler'(_0xc878bb,_0x1d4182){const _0x452700=_0x273cf5;if(!_0x1d4182)return![];const _0x3ae300=_0xc878bb[_0x452700(0x29f)](_univerjs_core[_0x452700(0x26e)]);if(Boolean(_0x3ae300[_0x452700(0x4e3)](_0x452700(0x235))))return!![];const _0x5af173=_0xc878bb[_0x452700(0x29f)](SheetsPivotDataSourceModel),{pivotTableId:_0x41b88a,fieldJson:_0x411b0c,area:_0x35219b,index:_0x1acf1a,unitId:_0x1a4c89,subUnitId:_0x378a63}=_0x1d4182,_0x254f35=_0x5af173[_0x452700(0x204)](_0x41b88a);if(!_0x254f35)return![];let _0x16c29a;if(_0x35219b===_univerjs_pro_engine_pivot[_0x452700(0x37d)][_0x452700(0x3a1)])_0x16c29a=(0x0,_univerjs_pro_engine_pivot['createValueField'])(_0x411b0c);else _0x16c29a=(0x0,_univerjs_pro_engine_pivot[_0x452700(0x2a8)])(_0x411b0c);_0x254f35['addField'](_0x16c29a,_0x35219b,_0x1acf1a),applyAddFieldChangeSet(_0x5af173['getPivotTableModelConfig'](_0x1a4c89,_0x378a63,_0x41b88a),_0x1d4182);const _0x25445d=_0x5af173[_0x452700(0x4b0)](_0x1a4c89,_0x378a63,_0x41b88a);return _0x5af173['addDirtyPivotTable']({'unitId':_0x1a4c89,'subUnitId':_0x378a63,'token':_0x41b88a,'type':PivotTableOperationEnum[_0x452700(0x2b2)],'pivotConfig':_0x25445d}),!![];}},RemovePivotFieldMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':'sheet.mutation.remove-pivot-field','handler'(_0x1e3185,_0x430ffd){const _0x3c3d17=_0x273cf5;if(!_0x430ffd)return![];const _0x2e77cf=_0x1e3185[_0x3c3d17(0x29f)](_univerjs_core[_0x3c3d17(0x26e)]);if(Boolean(_0x2e77cf[_0x3c3d17(0x4e3)](_0x3c3d17(0x235))))return!![];const _0x20efce=_0x1e3185[_0x3c3d17(0x29f)](SheetsPivotDataSourceModel),{pivotTableId:_0x1f9a6e,fieldId:_0x59bd97,unitId:_0x327a26,subUnitId:_0x56c423}=_0x430ffd,_0x25866a=_0x20efce[_0x3c3d17(0x204)](_0x1f9a6e);if(!_0x25866a)return![];_0x25866a['removeField'](_0x59bd97),applyRemoveFieldChangeSet(_0x20efce[_0x3c3d17(0x34c)](_0x327a26,_0x56c423,_0x1f9a6e),_0x430ffd);const _0x1ff92=_0x20efce[_0x3c3d17(0x4b0)](_0x327a26,_0x56c423,_0x1f9a6e);return _0x20efce[_0x3c3d17(0x4c7)]({'unitId':_0x327a26,'subUnitId':_0x56c423,'token':_0x1f9a6e,'type':PivotTableOperationEnum['Set'],'pivotConfig':_0x1ff92}),!![];}},RenamePivotFieldMutation={'type':_univerjs_core['CommandType'][_0x273cf5(0x3a2)],'id':_0x273cf5(0x4cf),'handler'(_0x12c8a1,_0xd81293){const _0x5782fd=_0x273cf5;if(!_0xd81293)return![];const _0x1f605c=_0x12c8a1[_0x5782fd(0x29f)](_univerjs_core[_0x5782fd(0x26e)]);if(Boolean(_0x1f605c[_0x5782fd(0x4e3)](_0x5782fd(0x235))))return!![];const _0x1b43f1=_0x12c8a1[_0x5782fd(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x34aa54,subUnitId:_0x4fd4bd,pivotTableId:_0x258670,fieldId:_0x4f4502,name:_0x16c73c}=_0xd81293,_0x53ce8e=_0x1b43f1[_0x5782fd(0x204)](_0x258670);if(!_0x53ce8e)return![];return _0x53ce8e[_0x5782fd(0x2c0)](_0x4f4502,_0x16c73c),applyRenameFieldChangeSet(_0x1b43f1[_0x5782fd(0x34c)](_0x34aa54,_0x4fd4bd,_0x258670),_0xd81293),_0x1b43f1[_0x5782fd(0x4c7)]({'unitId':_0x34aa54,'subUnitId':_0x4fd4bd,'token':_0x258670,'type':PivotTableOperationEnum[_0x5782fd(0x2b2)]}),!![];}},SetPivotCollapseMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x415),'handler'(_0x38ab89,_0x1a532b){const _0x5d68fe=_0x273cf5;if(!_0x1a532b)return![];const _0x2acc96=_0x38ab89[_0x5d68fe(0x29f)](_univerjs_core[_0x5d68fe(0x26e)]);if(Boolean(_0x2acc96[_0x5d68fe(0x4e3)](_0x5d68fe(0x235))))return!![];const _0x225513=_0x38ab89[_0x5d68fe(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x54cbec,subUnitId:_0x15b828,pivotTableId:_0x1b985f,fieldId:_0x303d98,collapse:_0x48bada,item:_0xfe56d1}=_0x1a532b,_0x31cebd=_0x225513[_0x5d68fe(0x204)](_0x1b985f);if(!_0x31cebd)return![];return _0x31cebd[_0x5d68fe(0x36a)](_0x303d98,_0x48bada,_0xfe56d1),applyCollapseChangeSet(_0x225513[_0x5d68fe(0x34c)](_0x54cbec,_0x15b828,_0x1b985f),_0x1a532b),_0x225513[_0x5d68fe(0x4c7)]({'unitId':_0x54cbec,'subUnitId':_0x15b828,'token':_0x1b985f,'type':PivotTableOperationEnum[_0x5d68fe(0x2b2)]}),!![];}},SetPivotFieldFormatMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x311),'handler'(_0x1e614c,_0x438d69){const _0x537f45=_0x273cf5;if(!_0x438d69)return![];const _0x57aa4c=_0x1e614c[_0x537f45(0x29f)](_univerjs_core['IConfigService']);if(Boolean(_0x57aa4c[_0x537f45(0x4e3)](_0x537f45(0x235))))return!![];const _0x289909=_0x1e614c[_0x537f45(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x2c9c8f,subUnitId:_0x2a7680,pivotTableId:_0x3dc2b7,fieldId:_0x58180d,format:_0x2a4b04}=_0x438d69,_0x36ab7d=_0x289909[_0x537f45(0x204)](_0x3dc2b7);if(!_0x36ab7d)return![];return _0x36ab7d[_0x537f45(0x366)](_0x58180d,_0x2a4b04),applySetFormatChangeSet(_0x289909[_0x537f45(0x34c)](_0x2c9c8f,_0x2a7680,_0x3dc2b7),_0x438d69),_0x289909[_0x537f45(0x4c7)]({'unitId':_0x2c9c8f,'subUnitId':_0x2a7680,'token':_0x3dc2b7,'type':PivotTableOperationEnum[_0x537f45(0x2b2)]}),!![];}},SetPivotFilterMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x327),'handler'(_0x5d6d3f,_0x4d3ce2){const _0x22af38=_0x273cf5;if(!_0x4d3ce2)return![];const _0x2e7c40=_0x5d6d3f[_0x22af38(0x29f)](_univerjs_core[_0x22af38(0x26e)]);if(Boolean(_0x2e7c40['getConfig'](_0x22af38(0x235))))return!![];const _0xb5a243=_0x5d6d3f[_0x22af38(0x29f)](SheetsPivotDataSourceModel),{unitId:_0xcc2146,subUnitId:_0x5d1387,pivotTableId:_0x3bd70c,fieldId:_0xd3154b,filterInfo:_0x6efeee}=_0x4d3ce2,_0x1add77=_0xb5a243[_0x22af38(0x204)](_0x3bd70c);if(!_0x1add77)return![];return _0x1add77[_0x22af38(0x392)](_0xd3154b,_0x6efeee),applySetFilterChangeSet(_0xb5a243[_0x22af38(0x34c)](_0xcc2146,_0x5d1387,_0x3bd70c),_0x4d3ce2),_0xb5a243[_0x22af38(0x4c7)]({'unitId':_0xcc2146,'subUnitId':_0x5d1387,'token':_0x3bd70c,'type':PivotTableOperationEnum[_0x22af38(0x2b2)]}),!![];}},SetPivotOptionMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x3e7),'handler'(_0x2d9361,_0x14933f){const _0xe47104=_0x273cf5;if(!_0x14933f)return![];const _0x4a7772=_0x2d9361[_0xe47104(0x29f)](_univerjs_core['IConfigService']);if(Boolean(_0x4a7772[_0xe47104(0x4e3)](_0xe47104(0x235))))return!![];const _0x5036df=_0x2d9361[_0xe47104(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x6d7bbf,subUnitId:_0x5abf13,pivotTableId:_0x3ec5b7,options:_0x338984}=_0x14933f,_0x4c2d21=_0x5036df[_0xe47104(0x204)](_0x3ec5b7);if(!_0x4c2d21)return![];return _0x4c2d21[_0xe47104(0x293)](_0x338984),applySetOptionsChangeSet(_0x5036df[_0xe47104(0x34c)](_0x6d7bbf,_0x5abf13,_0x3ec5b7),_0x14933f),_0x5036df[_0xe47104(0x4c7)]({'unitId':_0x6d7bbf,'subUnitId':_0x5abf13,'token':_0x3ec5b7,'type':PivotTableOperationEnum[_0xe47104(0x2b2)]}),!![];}},SetPivotSortMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':'sheet.mutation.set-pivot-sort-info','handler'(_0x1d588b,_0x409ca2){const _0x4e327d=_0x273cf5;if(!_0x409ca2)return![];const _0x2d513f=_0x1d588b['get'](_univerjs_core['IConfigService']);if(Boolean(_0x2d513f[_0x4e327d(0x4e3)](_0x4e327d(0x235))))return!![];const _0x4c86bc=_0x1d588b[_0x4e327d(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x53c2cd,subUnitId:_0x1be9c8,pivotTableId:_0x1a3879,sortInfo:_0x288af8,fieldId:_0x3af709}=_0x409ca2,_0x25bbcf=_0x4c86bc['getPivotTableInstance'](_0x1a3879);if(!_0x25bbcf)return![];return _0x25bbcf['setSortInfo'](_0x3af709,_0x288af8),applySetSortChangeSet(_0x4c86bc[_0x4e327d(0x34c)](_0x53c2cd,_0x1be9c8,_0x1a3879),_0x409ca2),_0x4c86bc[_0x4e327d(0x4c7)]({'unitId':_0x53c2cd,'subUnitId':_0x1be9c8,'token':_0x1a3879,'type':PivotTableOperationEnum['Set']}),!![];}},SetPivotSubtotalTypeMutation={'type':_univerjs_core[_0x273cf5(0x4d7)]['MUTATION'],'id':'sheet.mutation.set-pivot-field-subtotal-type','handler'(_0xcfbe87,_0xf64cbb){const _0x5d941b=_0x273cf5;if(!_0xf64cbb)return![];const _0x2ce353=_0xcfbe87[_0x5d941b(0x29f)](_univerjs_core[_0x5d941b(0x26e)]);if(Boolean(_0x2ce353['getConfig'](_0x5d941b(0x235))))return!![];const _0x4e5614=_0xcfbe87[_0x5d941b(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x22c74f,subUnitId:_0x2b1bb2,pivotTableId:_0x52d726,fieldId:_0x17bc18,subtotalType:_0x52c1dd}=_0xf64cbb,_0x18f971=_0x4e5614['getPivotTableInstance'](_0x52d726);if(!_0x18f971)return![];return _0x18f971[_0x5d941b(0x4e9)](_0x17bc18,_0x52c1dd),applySetSubtotalChangeSet(_0x4e5614['getPivotTableModelConfig'](_0x22c74f,_0x2b1bb2,_0x52d726),_0xf64cbb),_0x4e5614['addDirtyPivotTable']({'unitId':_0x22c74f,'subUnitId':_0x2b1bb2,'token':_0x52d726,'type':PivotTableOperationEnum[_0x5d941b(0x2b2)]}),!![];}},SetPivotValueFilterMutation={'type':_univerjs_core['CommandType'][_0x273cf5(0x3a2)],'id':'sheet.mutation.set-pivot-value-filter','handler'(_0x1a79d5,_0x3529c3){const _0x4f0507=_0x273cf5;if(!_0x3529c3)return![];const _0x538c8d=_0x1a79d5['get'](_univerjs_core[_0x4f0507(0x26e)]);if(Boolean(_0x538c8d[_0x4f0507(0x4e3)](_0x4f0507(0x235))))return!![];const _0x1de870=_0x1a79d5[_0x4f0507(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x3f7588,subUnitId:_0x2d9917,pivotTableId:_0xadae7d,fieldId:_0x12724a,filterInfo:_0x2ec121}=_0x3529c3,_0x525ac5=_0x1de870[_0x4f0507(0x204)](_0xadae7d);if(!_0x525ac5)return![];return _0x525ac5[_0x4f0507(0x2b4)](_0x12724a,_0x2ec121),applySetValueFilterChangeSet(_0x1de870[_0x4f0507(0x34c)](_0x3f7588,_0x2d9917,_0xadae7d),_0x3529c3),_0x1de870[_0x4f0507(0x4c7)]({'unitId':_0x3f7588,'subUnitId':_0x2d9917,'token':_0xadae7d,'type':PivotTableOperationEnum[_0x4f0507(0x2b2)]}),!![];}},UpdateFieldPositionMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x2bf),'handler'(_0x312f5c,_0x30ac88){const _0x2cb27c=_0x273cf5;if(!_0x30ac88)return![];const _0x3c23ef=_0x312f5c[_0x2cb27c(0x29f)](_univerjs_core[_0x2cb27c(0x26e)]);if(Boolean(_0x3c23ef[_0x2cb27c(0x4e3)](_0x2cb27c(0x235))))return!![];const _0xbbc65=_0x312f5c['get'](SheetsPivotDataSourceModel),{unitId:_0x111923,subUnitId:_0x263b88,pivotTableId:_0x3d17f4,area:_0x4589cd,index:_0x41f9de,fieldId:_0x13fc10}=_0x30ac88,_0x11e0ce=_0xbbc65['getPivotTableInstance'](_0x3d17f4);if(!_0x11e0ce)return![];return _0x11e0ce[_0x2cb27c(0x3c1)](_0x13fc10,_0x4589cd,_0x41f9de),applyFieldPositionChangeSet(_0xbbc65[_0x2cb27c(0x34c)](_0x111923,_0x263b88,_0x3d17f4),_0x30ac88),_0xbbc65[_0x2cb27c(0x4c7)]({'unitId':_0x111923,'subUnitId':_0x263b88,'token':_0x3d17f4,'type':PivotTableOperationEnum[_0x2cb27c(0x2b2)]}),!![];}},UpdatePivotFieldSourceInfoMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x206),'handler'(_0xd21023,_0x583b77){const _0x24f862=_0x273cf5;if(!_0x583b77)return![];const _0x168bef=_0xd21023[_0x24f862(0x29f)](_univerjs_core[_0x24f862(0x26e)]);if(Boolean(_0x168bef['getConfig'](_0x24f862(0x235))))return!![];const _0x7e462=_0xd21023[_0x24f862(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x9d69d3,subUnitId:_0x109d4a,pivotTableId:_0x59404f,sourceName:_0x22fb05,dataFieldId:_0x139f21,tableFieldId:_0x5e69ce}=_0x583b77,_0x22e894=_0x7e462[_0x24f862(0x204)](_0x59404f);if(!_0x22e894)return![];return _0x22e894['updateFieldSourceInfo'](_0x5e69ce,_0x22fb05,_0x139f21),applySourceInfoChangeSet(_0x7e462[_0x24f862(0x34c)](_0x9d69d3,_0x109d4a,_0x59404f),_0x583b77),_0x7e462[_0x24f862(0x4c7)]({'unitId':_0x9d69d3,'subUnitId':_0x109d4a,'token':_0x59404f,'type':PivotTableOperationEnum[_0x24f862(0x2b2)]}),!![];}},UpdateValuePositionMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':_0x273cf5(0x338),'handler'(_0x44e20d,_0x291544){const _0x4697fc=_0x273cf5;if(!_0x291544)return![];const _0x32d303=_0x44e20d[_0x4697fc(0x29f)](_univerjs_core[_0x4697fc(0x26e)]);if(Boolean(_0x32d303['getConfig'](_0x4697fc(0x235))))return!![];const _0xa48c5f=_0x44e20d[_0x4697fc(0x29f)](SheetsPivotDataSourceModel),{unitId:_0x165537,subUnitId:_0xf8e0aa,pivotTableId:_0x1c51a5,valuePosition:_0x236c80,index:_0x227534}=_0x291544,_0xd0efac=_0xa48c5f[_0x4697fc(0x204)](_0x1c51a5);if(!_0xd0efac)return![];return _0xd0efac[_0x4697fc(0x498)](_0x236c80,_0x227534),applyValuePositionChangeSet(_0xa48c5f[_0x4697fc(0x34c)](_0x165537,_0xf8e0aa,_0x1c51a5),_0x291544),_0xa48c5f[_0x4697fc(0x4c7)]({'unitId':_0x165537,'subUnitId':_0xf8e0aa,'token':_0x1c51a5,'type':PivotTableOperationEnum[_0x4697fc(0x2b2)]}),!![];}};function applyChangeSet(_0x3552bc,_0x5af614,_0x22f60c){const _0x3b938d=_0x273cf5,{pivotTableId:_0x1758a,unitId:_0x2dce8,subUnitId:_0x31c6df}=_0x5af614,_0x4f10aa=[],_0x2219e7=[];for(const _0x353b62 of _0x22f60c)switch(_0x353b62[_0x3b938d(0x39c)]){case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x3e3)]:{const {fieldJson:_0x6cfeee,area:_0x573688,index:_0x278aab}=_0x353b62,_0x212b30={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldJson':_0x6cfeee,'area':_0x573688,'index':_0x278aab},_0x402cf9={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x6cfeee['id'],'area':_0x573688,'index':_0x278aab};_0x4f10aa['push']({'id':AddPivotFieldMutation['id'],'params':_0x212b30}),_0x2219e7['unshift']({'id':RemovePivotFieldMutation['id'],'params':_0x402cf9});}break;case _univerjs_pro_engine_pivot['PivotTableChangeTypeEnum'][_0x3b938d(0x2f6)]:{const {fieldId:_0x1000c7,newSubtotalType:_0xb74fdb,oldSubtotalType:_0x47cd2d}=_0x353b62,_0x4e9ccd={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x1000c7,'subtotalType':_0xb74fdb};_0x4f10aa['push']({'id':SetPivotSubtotalTypeMutation['id'],'params':_0x4e9ccd});const _0x520c57={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x1000c7,'subtotalType':_0x47cd2d};_0x2219e7['unshift']({'id':SetPivotSubtotalTypeMutation['id'],'params':_0x520c57});}break;case _univerjs_pro_engine_pivot['PivotTableChangeTypeEnum'][_0x3b938d(0x217)]:{const {fieldId:_0x56b890,fieldJson:_0x1b5fc6,area:_0x1d08bc,index:_0x38313c}=_0x353b62,_0x3a4b5f={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x56b890,'index':_0x38313c,'area':_0x1d08bc};_0x4f10aa[_0x3b938d(0x4e8)]({'id':RemovePivotFieldMutation['id'],'params':_0x3a4b5f});const _0x5e02f7={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldJson':_0x1b5fc6,'area':_0x1d08bc,'index':_0x38313c};_0x2219e7[_0x3b938d(0x41a)]({'id':AddPivotFieldMutation['id'],'params':_0x5e02f7});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x355)]:{const {fieldId:_0x212a95,oldName:_0x3aaa87,newName:_0x11c9a2}=_0x353b62,_0x29644e={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x212a95,'name':_0x11c9a2};_0x4f10aa['push']({'id':RenamePivotFieldMutation['id'],'params':_0x29644e});const _0x1f2391={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x212a95,'name':_0x3aaa87};_0x2219e7[_0x3b938d(0x41a)]({'id':RenamePivotFieldMutation['id'],'params':_0x1f2391});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x40e)]:{const {fieldId:_0x180e1f,oldFilterInfo:_0xa5611b,newFilterInfo:_0x475609}=_0x353b62,_0x46fb6d={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x180e1f,'filterInfo':_0x475609};_0x4f10aa['push']({'id':SetPivotFilterMutation['id'],'params':_0x46fb6d});const _0x2eef83={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x180e1f,'filterInfo':_0xa5611b};_0x2219e7['unshift']({'id':SetPivotFilterMutation['id'],'params':_0x2eef83});}break;case _univerjs_pro_engine_pivot['PivotTableChangeTypeEnum'][_0x3b938d(0x1c5)]:{const {fieldId:_0x1aed76,oldSortInfo:_0x417aa4,newSortInfo:_0x4bb76f}=_0x353b62,_0x176bb0={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x1aed76,'sortInfo':_0x4bb76f};_0x4f10aa[_0x3b938d(0x4e8)]({'id':SetPivotSortMutation['id'],'params':_0x176bb0});const _0x4b984f={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x1aed76,'sortInfo':_0x417aa4};_0x2219e7[_0x3b938d(0x41a)]({'id':SetPivotSortMutation['id'],'params':_0x4b984f});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x3fd)]:{const {oldOptions:_0x13c151,newOptions:_0xc4af0a}=_0x353b62,_0x7c4c7={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'options':_0xc4af0a};_0x4f10aa[_0x3b938d(0x4e8)]({'id':SetPivotOptionMutation['id'],'params':_0x7c4c7});const _0x42caf5={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'options':_0x13c151};_0x2219e7[_0x3b938d(0x41a)]({'id':SetPivotOptionMutation['id'],'params':_0x42caf5});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x4b5)]:{const {oldArea:_0x1e3f44,newArea:_0x4e3bcf,oldIndex:_0x41c513,newIndex:_0x2d0f27,fieldId:_0x53f8a6}=_0x353b62,_0x9d4f13={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x53f8a6,'area':_0x4e3bcf,'index':_0x2d0f27,'oldArea':_0x1e3f44,'oldIndex':_0x41c513};_0x4f10aa[_0x3b938d(0x4e8)]({'id':UpdateFieldPositionMutation['id'],'params':_0x9d4f13});const _0x54dbc3={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x53f8a6,'area':_0x1e3f44,'index':_0x41c513,'oldArea':_0x4e3bcf,'oldIndex':_0x2d0f27};_0x2219e7[_0x3b938d(0x41a)]({'id':UpdateFieldPositionMutation['id'],'params':_0x54dbc3});}break;case _univerjs_pro_engine_pivot['PivotTableChangeTypeEnum'][_0x3b938d(0x1e0)]:{const {oldValuePosition:_0x1ce422,newValuePosition:_0x44fb62,oldIndex:_0x157cd5,newIndex:_0x9e3367}=_0x353b62,_0x1d0bc7={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'valuePosition':_0x44fb62,'index':_0x9e3367};_0x4f10aa[_0x3b938d(0x4e8)]({'id':UpdateValuePositionMutation['id'],'params':_0x1d0bc7});const _0x29ba0b={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'valuePosition':_0x1ce422,'index':_0x157cd5};_0x2219e7['unshift']({'id':UpdateValuePositionMutation['id'],'params':_0x29ba0b});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x2f4)]:{const {fieldId:_0x5dc26d,collapse:_0x2e31c4,item:_0x1c4c88}=_0x353b62,_0x1ba618={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x5dc26d,'collapse':_0x2e31c4,'item':_0x1c4c88};_0x4f10aa[_0x3b938d(0x4e8)]({'id':SetPivotCollapseMutation['id'],'params':_0x1ba618});const _0x2a7bf0={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x5dc26d,'collapse':!_0x2e31c4,'item':_0x1c4c88};_0x2219e7[_0x3b938d(0x41a)]({'id':SetPivotCollapseMutation['id'],'params':_0x2a7bf0});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x26a)]:{const {newFormat:_0x57037c,oldFormat:_0x500ea6,fieldId:_0x3939ab}=_0x353b62,_0x45c3f7={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x3939ab,'format':_0x57037c};_0x4f10aa[_0x3b938d(0x4e8)]({'id':SetPivotFieldFormatMutation['id'],'params':_0x45c3f7});const _0x3e7ae2={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x3939ab,'format':_0x500ea6};_0x2219e7[_0x3b938d(0x41a)]({'id':SetPivotFieldFormatMutation['id'],'params':_0x3e7ae2});}break;case _univerjs_pro_engine_pivot['PivotTableChangeTypeEnum'][_0x3b938d(0x495)]:{const {tableFieldId:_0x309960,oldSourceName:_0x145edf,newSourceName:_0x3c9703,oldDataFieldId:_0x2f3fd8,newDataFieldId:_0x1f11a6}=_0x353b62,_0x17df89={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'tableFieldId':_0x309960,'sourceName':_0x3c9703,'dataFieldId':_0x1f11a6};_0x4f10aa['push']({'id':UpdatePivotFieldSourceInfoMutation['id'],'params':_0x17df89});const _0x389f94={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'tableFieldId':_0x309960,'sourceName':_0x145edf,'dataFieldId':_0x2f3fd8};_0x2219e7[_0x3b938d(0x41a)]({'id':UpdatePivotFieldSourceInfoMutation['id'],'params':_0x389f94});}break;case _univerjs_pro_engine_pivot[_0x3b938d(0x1cb)][_0x3b938d(0x444)]:{const {fieldId:_0x1ed403,filterInfo:_0x3f784b,oldFilterInfo:_0x5cff70}=_0x353b62,_0x46ed04={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x1ed403,'filterInfo':_0x3f784b};_0x4f10aa[_0x3b938d(0x4e8)]({'id':SetPivotValueFilterMutation['id'],'params':_0x46ed04});const _0x5ce97b={'unitId':_0x2dce8,'subUnitId':_0x31c6df,'pivotTableId':_0x1758a,'fieldId':_0x1ed403,'filterInfo':_0x5cff70};_0x2219e7[_0x3b938d(0x41a)]({'id':SetPivotValueFilterMutation['id'],'params':_0x5ce97b});}}return{'redos':_0x4f10aa,'undos':_0x2219e7};}function generateMutationsFromPivotCommand(_0x33fe1e,_0x47b654){const _0x2924dd=_0x273cf5;var _0x45352a;const _0x566d8f=_0x33fe1e['get'](SheetsPivotTableService),{cellInfo:_0x5ad447,view:_0x48d657,isEmpty:_0x5c0936}=_0x47b654;return(_0x45352a=_0x566d8f[_0x2924dd(0x2e4)][_0x2924dd(0x21a)](PIVOT_MUTATION_GENERATE)(defaultEmptyPivotGeneratedMutations,{'cellInfo':_0x5ad447,'view':_0x48d657,'isEmpty':_0x5c0936}))!==null&&_0x45352a!==void 0x0?_0x45352a:defaultEmptyPivotGeneratedMutations;}const AddPivotFieldCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x4e0),async 'handler'(_0x527a60,_0x100ec4){const _0x427003=_0x273cf5;if(!_0x100ec4)return![];const _0x419e98=_0x527a60[_0x427003(0x29f)](_univerjs_core[_0x427003(0x3ad)]),_0x1d6952=_0x527a60[_0x427003(0x29f)](SheetsPivotRPCService),_0xc52843=_0x527a60['get'](_univerjs_core[_0x427003(0x325)]),{pivotTableId:_0x2737b6,dataFieldId:_0xdfc836,fieldArea:_0x15b7ba,index:_0x454463,unitId:_0x1ac5cf,subUnitId:_0x36493a}=_0x100ec4,_0x12d903=(await _0x1d6952[_0x427003(0x429)]({'unitId':_0x1ac5cf,'subUnitId':_0x36493a,'pivotTableId':_0x2737b6,'params':{'type':PivotDisplayDataType[_0x427003(0x48b)],'addPivotField':{'dataFieldId':_0xdfc836,'fieldArea':_0x15b7ba,'index':_0x454463}}}))[_0x427003(0x4d6)][_0x427003(0x427)];if(!_0x12d903)return![];const {view:_0x5ebaf6,changesets:_0x25cdbd,isEmpty:_0x309811,pivotTableConfig:_0x2bc1ab,shouldBeAddedGroupJSON:_0x2d8c24}=_0x12d903,_0x22a0f3=_0x2bc1ab[_0x427003(0x1db)],_0x59c674=new _univerjs_pro_engine_pivot[(_0x427003(0x396))]();_0x59c674[_0x427003(0x3fe)](_0x5ebaf6);const _0x1174c7={'cellInfo':_0x22a0f3,'view':_0x59c674,'isEmpty':_0x309811};if(!await _0x527a60['get'](SheetsPivotTableService)[_0x427003(0x489)][_0x427003(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x1174c7))return![];const _0x1410d3=getInsertRowColMutations(_0x527a60,_0x59c674,_0x22a0f3,_0x309811),_0x236176=generateMutationsFromPivotCommand(_0x527a60,_0x1174c7),{undos:_0x3afdc8,redos:_0x226e6f}=applyChangeSet(_0x419e98,{'pivotTableId':_0x2737b6,'unitId':_0x1ac5cf,'subUnitId':_0x36493a},_0x25cdbd);return _0x2d8c24&&(_0x226e6f[_0x427003(0x41a)]({'id':AddGroupCollectionMutation['id'],'params':{'pivotTableId':_0x2737b6,'fieldJSON':_0x2d8c24,'unitId':_0x1ac5cf,'subUnitId':_0x36493a}}),_0x3afdc8[_0x427003(0x4e8)]({'id':RemoveGroupCollectionMutation['id'],'params':{'pivotTableId':_0x2737b6,'dataFieldId':_0x2d8c24['id'],'unitId':_0x1ac5cf,'subUnitId':_0x36493a}})),(0x0,_univerjs_core[_0x427003(0x3b7)])([..._0x1410d3[_0x427003(0x3d5)],..._0x236176[_0x427003(0x3d5)],..._0x226e6f],_0x419e98),_0xc52843[_0x427003(0x45d)]({'unitID':_0x1ac5cf,'redoMutations':[..._0x1410d3[_0x427003(0x3d5)],..._0x236176['redos'],..._0x226e6f],'undoMutations':[..._0x1410d3[_0x427003(0x211)],..._0x236176['undos'],..._0x3afdc8]}),!![];}},isNodeEnv=()=>{const _0xf153a7=_0x273cf5;return typeof process!=='undefined'&&process[_0xf153a7(0x45c)]!=null&&process[_0xf153a7(0x45c)][_0xf153a7(0x4d9)]!=null;},AddPivotTableMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':'sheet.mutation.add-pivot-table','handler'(_0x3e005e,_0x5bce5a){const _0x3a5482=_0x273cf5;if(!_0x5bce5a)return![];const _0x25bdef=_0x3e005e['get'](_univerjs_core[_0x3a5482(0x26e)]);if(Boolean(_0x25bdef[_0x3a5482(0x4e3)](_0x3a5482(0x235))))return!![];const _0x18babb=_0x3e005e[_0x3a5482(0x29f)](_univerjs_core[_0x3a5482(0x315)]),_0x2b33b2=_0x3e005e[_0x3a5482(0x29f)](SheetsPivotDataSourceModel),{pivotTableId:_0x2e84a6,pivotTableConfig:_0x57e83c,collectionConfig:_0x1eca63,unitId:_0x5eb577,subUnitId:_0x892581}=_0x5bce5a,{sourceRangeInfo:_0x3136fb,fieldsConfig:_0xf49bee,targetCellInfo:_0x29a471}=_0x57e83c,_0x4623d5=_0x18babb[_0x3a5482(0x2c7)](_0x5eb577);if(!_0x4623d5)return![];if(!_0x4623d5[_0x3a5482(0x38f)](_0x892581))return![];if(!isNodeEnv()){var _0x46c158;let _0xdde7ca=0x0;_0x4623d5['getSheets']()[_0x3a5482(0x24b)](_0x46d7ba=>{const _0x2514e6=_0x3a5482;var _0x35b689,_0x357440;_0xdde7ca+=(_0x35b689=(_0x357440=_0x2b33b2[_0x2514e6(0x44a)](_0x5eb577,_0x46d7ba['getSheetId']()))===null||_0x357440===void 0x0?void 0x0:_0x357440['size'])!==null&&_0x35b689!==void 0x0?_0x35b689:0x0;});const {ls:_0xe344f6,pbk:_0x16c363}=(_0x46c158=_0x25bdef['getConfig'](_univerjs_pro_license[_0x3a5482(0x487)]))!==null&&_0x46c158!==void 0x0?_0x46c158:{};if(!canUsePivot(_0xe344f6,_0x16c363))throw new _univerjs_core[(_0x3a5482(0x40d))](_0x3a5482(0x4ae));const _0x58b72d=getPivotInfoByLicense(0x1,_0xe344f6,_0x16c363)[_0x3a5482(0x3b2)];if(_0xdde7ca>=_0x58b72d)throw new _univerjs_core[(_0x3a5482(0x40d))](_0x3a5482(0x4ae));}if(!_0x1eca63||!_0xf49bee)return![];const {collection:_0x1c6186,updateDataFieldList:_0x36f195}=_0x2b33b2[_0x3a5482(0x306)](_0x2e84a6,_0x1eca63,_0x3136fb,_0x29a471);_0x2b33b2[_0x3a5482(0x450)](_0x1c6186,_0x36f195,_0x3136fb);const _0xb7822c=new _univerjs_pro_engine_pivot['PivotTable'](_0x1c6186,void 0x0,_0x2e84a6);_0xb7822c[_0x3a5482(0x374)](_0xf49bee);const _0x228429=JSON['parse'](JSON[_0x3a5482(0x307)](_0x57e83c));return _0x2b33b2['addPivotTable'](_0x5eb577,_0x892581,_0x2e84a6,_0xb7822c,_0x228429),_0x2b33b2['addDirtyPivotTable']({'unitId':_0x5eb577,'subUnitId':_0x892581,'token':_0x2e84a6,'type':PivotTableOperationEnum[_0x3a5482(0x446)],'pivotConfig':_0x228429}),!![];}},AddPivotTableWithConfigCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x3c2),async 'handler'(_0x251657,_0x34bc91){const _0x44dccb=_0x273cf5;if(!_0x34bc91)return![];const {sourceDataInfo:_0x7a3db0,pivotTableConfig:_0x255525}=_0x34bc91;if(!_0x7a3db0||!_0x255525)return![];const {unitId:_0x593065,subUnitId:_0x141ccd,range:_0xb5562b}=_0x7a3db0,_0x332bdf=_0x251657[_0x44dccb(0x29f)](_univerjs_core[_0x44dccb(0x315)]),_0x5de4ee=_0x251657[_0x44dccb(0x29f)](SheetsPivotRPCService),_0x470ab2=_0x251657[_0x44dccb(0x29f)](_univerjs_core[_0x44dccb(0x337)]),_0xc32cf4=_0x251657[_0x44dccb(0x29f)](_univerjs_core['ICommandService']),_0x21e07b=_0x332bdf['getUnit'](_0x593065);if(!_0x21e07b)return![];const _0x926f22=_0x21e07b[_0x44dccb(0x38f)](_0x141ccd);if(!_0x926f22)return![];const _0x7d90a2=(0x0,_univerjs_pro_engine_pivot[_0x44dccb(0x2f9)])(0x8),_0x5325a6=_0xb5562b||{'startRow':0x0,'startColumn':0x0,'endRow':_0x926f22[_0x44dccb(0x3d7)]()-0x1,'endColumn':_0x926f22[_0x44dccb(0x49b)]()-0x1};_0x5325a6[_0x44dccb(0x1fc)]=_univerjs_core['RANGE_TYPE'][_0x44dccb(0x48e)];const _0x2418b7=(await _0x5de4ee['getPivotDisplayConfig']({'unitId':_0x593065,'subUnitId':_0x141ccd,'pivotTableId':_0x7d90a2,'params':{'type':PivotDisplayDataType[_0x44dccb(0x441)],'addPivotTableWithConfig':{'sourceRangeInfo':{'unitId':_0x593065,'sheetName':_0x926f22[_0x44dccb(0x416)](),'subUnitId':_0x141ccd,'range':_0x5325a6},'pivotTableId':_0x7d90a2,'pivotTableIndexConfig':_0x255525}}}))[_0x44dccb(0x4d6)][_0x44dccb(0x379)];if(!_0x2418b7)return![];const {isEmpty:_0x3c05e6,fieldsConfig:_0x2514b4,collectionConfig:_0x7208e0,changesets:_0x4336d7}=_0x2418b7,_0x10a9ed=_0x21e07b[_0x44dccb(0x472)]()[_0x44dccb(0x36f)],_0xfdde55=(0x0,_univerjs_core[_0x44dccb(0x358)])({'rowCount':_0x926f22['getRowCount']()-0x1,'columnCount':_0x926f22[_0x44dccb(0x49b)]()-0x1});_0xfdde55['id']=(0x0,_univerjs_core[_0x44dccb(0x20e)])(),_0xfdde55['name']=_0x21e07b[_0x44dccb(0x38e)](''+_0x470ab2['t'](_0x44dccb(0x488)));const _0x59ff67={'index':_0x10a9ed,'sheet':_0xfdde55,'unitId':_0x593065},{redos:_0x5340d1}=applyChangeSet(_0xc32cf4,{'pivotTableId':_0x7d90a2,'unitId':_0x593065,'subUnitId':_0xfdde55['id']},_0x4336d7);return(0x0,_univerjs_core['sequenceExecute'])([{'id':_univerjs_sheets[_0x44dccb(0x3ca)]['id'],'params':_0x59ff67},{'id':AddPivotTableMutation['id'],'params':{'unitId':_0x593065,'subUnitId':_0xfdde55['id'],'pivotTableId':_0x7d90a2,'pivotTableConfig':{'isEmpty':_0x3c05e6,'fieldsConfig':_0x2514b4,'targetCellInfo':{'row':0x0,'col':0x0,'unitId':_0x593065,'subUnitId':_0xfdde55['id']},'sourceRangeInfo':{'subUnitId':_0x141ccd,'unitId':_0x593065,'range':_0x5325a6,'sheetName':_0x926f22['getName']()}},'collectionConfig':_0x7208e0}},..._0x5340d1],_0xc32cf4),!![];}},RemovePivotTableMutation={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'id':'sheet.mutation.remove-pivot-table','handler'(_0x3664ae,_0x3baf84){const _0x40cf53=_0x273cf5;if(!_0x3baf84)return![];const _0x575c86=_0x3664ae[_0x40cf53(0x29f)](_univerjs_core[_0x40cf53(0x26e)]);if(Boolean(_0x575c86[_0x40cf53(0x4e3)](_0x40cf53(0x235))))return!![];const {pivotTableId:_0x232208,unitId:_0x8a2e5a,subUnitId:_0x41da97}=_0x3baf84,_0x59869d=_0x3664ae[_0x40cf53(0x29f)](SheetsPivotDataSourceModel);if(!_0x59869d[_0x40cf53(0x4b0)](_0x8a2e5a,_0x41da97,_0x232208))return![];return _0x59869d[_0x40cf53(0x4c7)]({'unitId':_0x8a2e5a,'subUnitId':_0x41da97,'token':_0x232208,'type':PivotTableOperationEnum[_0x40cf53(0x28d)]}),_0x59869d[_0x40cf53(0x3cd)](_0x8a2e5a,_0x41da97,_0x232208),!![];}},AddPivotTableCommand={'type':_univerjs_core[_0x273cf5(0x4d7)]['COMMAND'],'id':_0x273cf5(0x4c0),async 'handler'(_0x2e82f7,_0x3c5dbd){const _0x49c155=_0x273cf5;var _0x509f73;const _0x2deedc=_0x2e82f7[_0x49c155(0x29f)](_univerjs_core['ICommandService']),_0x5c5f78=_0x2e82f7['get'](_univerjs_core['IUniverInstanceService']),_0x5aec81=_0x2e82f7[_0x49c155(0x29f)](_univerjs_core[_0x49c155(0x337)]),_0x4a2286=_0x2e82f7[_0x49c155(0x29f)](SheetsPivotRPCService),_0x4806f2=_0x2e82f7['get'](_univerjs_core[_0x49c155(0x325)]),_0x1d3c3f=_0x2e82f7['get'](SheetsPivotTableConfigModel),_0x2d27ad=_0x2e82f7[_0x49c155(0x29f)](_univerjs_core[_0x49c155(0x26e)]);if(!_0x3c5dbd)return![];const {pivotTableConfig:_0x1e40e3,positionType:_0x5a4723}=_0x3c5dbd,{targetCellInfo:_0x4a8f34,sourceRangeInfo:_0x27ad99}=_0x1e40e3,{unitId:_0x207a16,subUnitId:_0x23e7ff}=_0x4a8f34,_0x4e2d22=_0x5c5f78[_0x49c155(0x2c7)](_0x207a16);if(!_0x4e2d22)return![];let _0x49df1c=0x0;_0x4e2d22[_0x49c155(0x472)]()[_0x49c155(0x24b)](_0x4f573d=>{const _0x37a1ec=_0x49c155;var _0x456e02,_0x519e22;_0x49df1c+=(_0x456e02=(_0x519e22=_0x1d3c3f[_0x37a1ec(0x44a)](_0x207a16,_0x4f573d[_0x37a1ec(0x249)]()))===null||_0x519e22===void 0x0?void 0x0:_0x519e22[_0x37a1ec(0x2a4)])!==null&&_0x456e02!==void 0x0?_0x456e02:0x0;});const {ls:_0x402dbf,pbk:_0x19db6d}=(_0x509f73=_0x2d27ad[_0x49c155(0x4e3)](_univerjs_pro_license[_0x49c155(0x487)]))!==null&&_0x509f73!==void 0x0?_0x509f73:{};if(!canUsePivot(_0x402dbf,_0x19db6d))return![];const _0x9d4971=getPivotInfoByLicense(0x1,_0x402dbf,_0x19db6d)[_0x49c155(0x3b2)];if(_0x49df1c>=_0x9d4971)return![];const _0x58ee17=_0x3c5dbd[_0x49c155(0x3d4)]||(0x0,_univerjs_pro_engine_pivot[_0x49c155(0x2f9)])(0x8),_0x2c127f=(await _0x4a2286['getPivotDisplayConfig']({'unitId':_0x207a16,'subUnitId':_0x23e7ff,'pivotTableId':_0x58ee17,'params':{'type':PivotDisplayDataType[_0x49c155(0x26d)],'addPivotTable':{'sourceRangeInfo':_0x27ad99,'pivotTableId':_0x58ee17}}}))[_0x49c155(0x4d6)][_0x49c155(0x3a9)];if(!_0x2c127f)return![];const {view:_0x3496cc,isEmpty:_0x1f6ca9,fieldsConfig:_0x2b7a90,collectionConfig:_0x54e40c}=_0x2c127f,_0x40201b=[],_0x39f233=[];if(_0x5a4723===PositionType[_0x49c155(0x43e)]){var _0x5763c0;const _0xab49f3=_0x4e2d22[_0x49c155(0x472)]()[_0x49c155(0x36f)],_0x1bd888=(0x0,_univerjs_core[_0x49c155(0x358)])({});_0x1bd888['id']=_0x1e40e3[_0x49c155(0x1db)][_0x49c155(0x23b)],_0x1bd888[_0x49c155(0x4ce)]=(_0x5763c0=_0x1e40e3[_0x49c155(0x1db)]['sheetName'])!==null&&_0x5763c0!==void 0x0?_0x5763c0:_0x4e2d22[_0x49c155(0x38e)](''+_0x5aec81['t']('sheets.tabs.sheet'));const _0x138866={'index':_0xab49f3,'sheet':_0x1bd888,'unitId':_0x207a16},_0x202d46=(0x0,_univerjs_sheets[_0x49c155(0x391)])(_0x2e82f7,_0x138866);_0x40201b[_0x49c155(0x4e8)]({'id':_univerjs_sheets[_0x49c155(0x4f0)]['id'],'params':_0x202d46}),_0x39f233[_0x49c155(0x4e8)]({'id':_univerjs_sheets[_0x49c155(0x3f1)]['id'],'params':_0x138866});}else{if(!_0x4e2d22['getSheetBySheetId'](_0x23e7ff))return![];const _0x20145f=getInsertRowColMutations(_0x2e82f7,new _univerjs_pro_engine_pivot[(_0x49c155(0x396))](),_0x4a8f34,!![]);_0x39f233[_0x49c155(0x4e8)](..._0x20145f[_0x49c155(0x3d5)]),_0x40201b[_0x49c155(0x4e8)](..._0x20145f[_0x49c155(0x211)]);const _0x2abc41={'cellInfo':_0x4a8f34,'view':_0x3496cc,'isEmpty':_0x1f6ca9};if(!await _0x2e82f7['get'](SheetsPivotTableService)['asyncInterceptor']['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0x2abc41))return![];const _0x1f2930=generateMutationsFromPivotCommand(_0x2e82f7,_0x2abc41);_0x39f233[_0x49c155(0x4e8)](..._0x1f2930[_0x49c155(0x3d5)]),_0x40201b['push'](..._0x1f2930[_0x49c155(0x211)]);}_0x39f233['push']({'id':AddPivotTableMutation['id'],'params':{'unitId':_0x4a8f34[_0x49c155(0x452)],'subUnitId':_0x4a8f34['subUnitId'],'pivotTableId':_0x58ee17,'pivotTableConfig':{'targetCellInfo':_0x4a8f34,'sourceRangeInfo':_0x27ad99,'fieldsConfig':_0x2b7a90},'collectionConfig':_0x54e40c}}),_0x40201b['unshift']({'id':RemovePivotTableMutation['id'],'params':{'unitId':_0x207a16,'subUnitId':_0x23e7ff,'pivotTableId':_0x58ee17}});if((0x0,_univerjs_core[_0x49c155(0x3b7)])(_0x39f233,_0x2deedc))_0x4806f2[_0x49c155(0x45d)]({'unitID':_0x207a16,'undoMutations':_0x40201b,'redoMutations':_0x39f233});return!![];}},MovePivotFieldCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':'sheet.command.move-pivot-field',async 'handler'(_0x4b2e76,_0x3e284b){const _0x209492=_0x273cf5;if(!_0x3e284b)return![];const _0x23b62e=_0x4b2e76[_0x209492(0x29f)](_univerjs_core['ICommandService']),_0x37cd22=_0x4b2e76[_0x209492(0x29f)](SheetsPivotRPCService),_0x7cdfa1=_0x4b2e76[_0x209492(0x29f)](_univerjs_core['IUndoRedoService']),{pivotTableId:_0x20a55e,fieldId:_0x1aef62,area:_0x5404ab,index:_0x5957e0,unitId:_0x3a5fc6,subUnitId:_0x110044}=_0x3e284b,_0xc87a34=(await _0x37cd22['getPivotDisplayConfig']({'unitId':_0x3a5fc6,'subUnitId':_0x110044,'pivotTableId':_0x20a55e,'params':{'type':PivotDisplayDataType[_0x209492(0x229)],'movePivotField':{'fieldId':_0x1aef62,'area':_0x5404ab,'index':_0x5957e0}}}))[_0x209492(0x4d6)][_0x209492(0x360)];if(!_0xc87a34)return![];const {changesets:_0x1eff85,view:_0x3f2947,isEmpty:_0x5a887a,pivotTableConfig:_0x16e30f}=_0xc87a34,_0x23de61=_0x16e30f[_0x209492(0x1db)],_0x4e748b=new _univerjs_pro_engine_pivot['PivotView']();_0x4e748b[_0x209492(0x3fe)](_0x3f2947);const _0x4cfaa0={'cellInfo':_0x23de61,'view':_0x4e748b,'isEmpty':_0x5a887a};if(!await _0x4b2e76['get'](SheetsPivotTableService)['asyncInterceptor'][_0x209492(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x4cfaa0))return![];const _0x2a675=getInsertRowColMutations(_0x4b2e76,_0x4e748b,_0x23de61,_0x5a887a),_0xf07dde=generateMutationsFromPivotCommand(_0x4b2e76,_0x4cfaa0),{redos:_0x68734d,undos:_0x144f5b}=applyChangeSet(_0x23b62e,{'pivotTableId':_0x20a55e,'unitId':_0x3a5fc6,'subUnitId':_0x110044},_0x1eff85);return(0x0,_univerjs_core['sequenceExecute'])([..._0x2a675[_0x209492(0x3d5)],..._0xf07dde[_0x209492(0x3d5)],..._0x68734d],_0x23b62e),_0x7cdfa1['pushUndoRedo']({'unitID':_0x3a5fc6,'redoMutations':[..._0x2a675[_0x209492(0x3d5)],..._0xf07dde[_0x209492(0x3d5)],..._0x68734d],'undoMutations':[..._0x2a675[_0x209492(0x211)],..._0xf07dde['undos'],..._0x144f5b]}),!![];}},SetPivotPositionMutation={'type':_univerjs_core[_0x273cf5(0x4d7)]['MUTATION'],'id':_0x273cf5(0x395),'handler'(_0x5e3497,_0x3ba4d7){const _0x508149=_0x273cf5;if(!_0x3ba4d7)return![];const _0x1d6a89=_0x5e3497[_0x508149(0x29f)](_univerjs_core[_0x508149(0x26e)]);if(Boolean(_0x1d6a89[_0x508149(0x4e3)](_0x508149(0x235))))return!![];const {pivotTableId:_0x10c8d8,targetCellPosition:_0x5bda92,unitId:_0x1a7771,subUnitId:_0x26c889}=_0x3ba4d7,_0x1f45c8=_0x5e3497[_0x508149(0x29f)](SheetsPivotDataSourceModel);if(!_0x1f45c8[_0x508149(0x204)](_0x3ba4d7[_0x508149(0x3d4)]))return![];const _0x420e23=_0x1f45c8[_0x508149(0x25d)](_0x10c8d8);if(!_0x420e23)return![];const _0x34a1bb=_0x1f45c8[_0x508149(0x22d)](_0x420e23[_0x508149(0x452)],_0x3ba4d7['pivotTableId']);if(!_0x34a1bb)return![];const _0x184d64=_0x1f45c8[_0x508149(0x4b0)](_0x420e23[_0x508149(0x452)],_0x420e23[_0x508149(0x23b)],_0x10c8d8);if(!_0x184d64)return![];const _0x551d97=_univerjs_core[_0x508149(0x23f)][_0x508149(0x32f)](_0x184d64);_0x551d97[_0x508149(0x1db)]={'unitId':_0x1a7771,'subUnitId':_0x26c889,'row':_0x5bda92['row'],'col':_0x5bda92['col']};const _0xe8259b=_0x34a1bb[_0x508149(0x480)]();if(_0x420e23[_0x508149(0x23b)]===_0x26c889&&_0x420e23['unitId']===_0x1a7771)_0x1f45c8[_0x508149(0x318)](_0x1a7771,_0x26c889,_0x10c8d8,_0x551d97),_0x1f45c8[_0x508149(0x4c7)]({'unitId':_0x1a7771,'subUnitId':_0x26c889,'token':_0x10c8d8,'type':PivotTableOperationEnum['Set']});else{_0x1f45c8[_0x508149(0x4c7)]({'unitId':_0x420e23[_0x508149(0x452)],'subUnitId':_0x420e23[_0x508149(0x23b)],'token':_0x10c8d8,'type':PivotTableOperationEnum[_0x508149(0x28d)]}),_0x1f45c8[_0x508149(0x3cd)](_0x420e23[_0x508149(0x452)],_0x420e23[_0x508149(0x23b)],_0x10c8d8);const _0x90b7d8=new _univerjs_pro_engine_pivot['PivotTable'](_0x1f45c8['addCollectionByJSON'](_0x10c8d8,_0xe8259b,_0x184d64['sourceRangeInfo'],_0x551d97[_0x508149(0x1db)])[_0x508149(0x278)],void 0x0,_0x10c8d8);_0x90b7d8[_0x508149(0x374)](_0x551d97[_0x508149(0x30c)]),_0x1f45c8[_0x508149(0x3a9)](_0x1a7771,_0x26c889,_0x10c8d8,_0x90b7d8,_0x551d97),_0x1f45c8[_0x508149(0x4c7)]({'unitId':_0x1a7771,'subUnitId':_0x26c889,'token':_0x10c8d8,'type':PivotTableOperationEnum['Add'],'pivotConfig':_0x551d97});}return!![];}},MovePivotTableCommand={'type':_univerjs_core['CommandType'][_0x273cf5(0x3c8)],'id':'sheet.command.move-pivot-table','handler':(_0x88d6fb,_0x5604cb)=>{const _0x3de2f6=_0x273cf5;if(!_0x5604cb)return![];const _0x260797=(0x0,_univerjs_sheets[_0x3de2f6(0x1d6)])(_0x88d6fb['get'](_univerjs_core['IUniverInstanceService']),{'unitId':_0x5604cb[_0x3de2f6(0x1db)][_0x3de2f6(0x452)],'subUnitId':_0x5604cb[_0x3de2f6(0x1db)]['subUnitId']});if(!_0x260797)throw new Error(_0x3de2f6(0x1d5));const _0x11018f=_0x88d6fb[_0x3de2f6(0x29f)](SheetsPivotTableConfigModel)[_0x3de2f6(0x4b0)](_0x5604cb[_0x3de2f6(0x2ad)][_0x3de2f6(0x452)],_0x5604cb[_0x3de2f6(0x2ad)][_0x3de2f6(0x23b)],_0x5604cb['pivotTableId']);if(!_0x11018f)return![];const _0x4b8986=_0x88d6fb[_0x3de2f6(0x29f)](_univerjs_core[_0x3de2f6(0x3ad)]),_0x181c92=_0x88d6fb['get'](_univerjs_core[_0x3de2f6(0x325)]),{unitId:_0xa10922,subUnitId:_0x4d9ac6,worksheet:_0xe0d81f}=_0x260797,_0x2ebd3c=_0xe0d81f[_0x3de2f6(0x3d7)](),_0x3dabc8=_0xe0d81f[_0x3de2f6(0x49b)]();if(_0x5604cb[_0x3de2f6(0x1db)]['row']>_0x2ebd3c||_0x5604cb[_0x3de2f6(0x1db)][_0x3de2f6(0x2d4)]>_0x3dabc8)throw new Error(_0x3de2f6(0x3b1));const _0x1bb8ec=[{'id':SetPivotPositionMutation['id'],'params':{'unitId':_0xa10922,'subUnitId':_0x5604cb[_0x3de2f6(0x1db)][_0x3de2f6(0x23b)],'pivotTableId':_0x5604cb[_0x3de2f6(0x3d4)],'targetCellPosition':{'row':_0x5604cb[_0x3de2f6(0x1db)][_0x3de2f6(0x1ed)],'col':_0x5604cb[_0x3de2f6(0x1db)][_0x3de2f6(0x2d4)]}}}],_0x2107a0=[{'id':SetPivotPositionMutation['id'],'params':{'unitId':_0xa10922,'subUnitId':_0x4d9ac6,'pivotTableId':_0x5604cb[_0x3de2f6(0x3d4)],'targetCellPosition':{'row':_0x11018f[_0x3de2f6(0x1db)]['row'],'col':_0x11018f[_0x3de2f6(0x1db)][_0x3de2f6(0x2d4)]}}}];if((0x0,_univerjs_core[_0x3de2f6(0x3b7)])(_0x1bb8ec,_0x4b8986))_0x181c92[_0x3de2f6(0x45d)]({'unitID':_0xa10922,'undoMutations':_0x2107a0,'redoMutations':_0x1bb8ec});return!![];}},PivotDrillDownCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x2f8),async 'handler'(_0x134d1f,_0x2b78d){const _0x2ce202=_0x273cf5;var _0x2242e5;if(!_0x2b78d)return![];const _0x3921b6=_0x134d1f['get'](_univerjs_core['IUniverInstanceService']),_0x3a19ba=(0x0,_univerjs_sheets[_0x2ce202(0x1d6)])(_0x3921b6);if(!_0x3a19ba)return![];const {unitId:_0x5dddcb,subUnitId:_0x16f12b,workbook:_0x2ad2a1}=_0x3a19ba,{row:_0x27f2df,col:_0xb416f2}=_0x2b78d,_0x5c653d=_0x134d1f[_0x2ce202(0x29f)](SheetsPivotTableAdaptorModel),_0x473843=_0x5c653d[_0x2ce202(0x1e6)](_0x5dddcb,_0x16f12b,_0x27f2df,_0xb416f2);if(!_0x473843)return![];const _0x33fdf5=(_0x2242e5=_0x5c653d[_0x2ce202(0x234)](_0x5dddcb,_0x16f12b,_0x473843))===null||_0x2242e5===void 0x0?void 0x0:_0x2242e5[_0x2ce202(0x413)];if(!_0x33fdf5)return![];const _0x2cad86=_0x134d1f[_0x2ce202(0x29f)](SheetsPivotTableConfigModel)[_0x2ce202(0x4b0)](_0x5dddcb,_0x16f12b,_0x473843);if(!_0x2cad86)return![];const {rowInfo:_0x2c60f5,colInfo:_0x22c5ae}=_0x33fdf5,_0x1cb028=_0x2c60f5[_0x27f2df]['paths'],_0x507813=_0x22c5ae[_0xb416f2][_0x2ce202(0x2b5)],_0x5e2b98=_0x2c60f5[_0x27f2df][_0x2ce202(0x394)],_0x1930a0=_0x22c5ae[_0xb416f2]['level'],_0x5ee034=_0x1cb028['concat'](_0x507813),_0x4b6464=_0x2cad86[_0x2ce202(0x30c)][_0x2ce202(0x2ef)][_0x2ce202(0x428)](0x0,_0x5e2b98),_0x2c3872=_0x2cad86[_0x2ce202(0x30c)][_0x2ce202(0x4c8)][_0x2ce202(0x428)](0x0,_0x1930a0),_0x3ed42b=_0x4b6464[_0x2ce202(0x2bd)](_0x2c3872),_0x85e072=_0x5ee034[_0x2ce202(0x291)]((_0x135c87,_0x1eeca6)=>[_0x135c87,_0x3ed42b[_0x1eeca6]]),_0xc16ecd=(await _0x134d1f['get'](SheetsPivotRPCService)[_0x2ce202(0x429)]({'unitId':_0x5dddcb,'subUnitId':_0x16f12b,'pivotTableId':_0x473843,'params':{'type':PivotDisplayDataType[_0x2ce202(0x3dd)],'drillDown':{'tuple':_0x85e072}}}))[_0x2ce202(0x4d6)][_0x2ce202(0x4f2)];if(!_0xc16ecd)return![];const {indexes:_0x344e43,range:_0x18700d,sourceUnitId:_0x6aaf51,sourceSubUnitId:_0x2417ed,formatMap:_0x49636e}=_0xc16ecd,{startRow:_0xa543da,endRow:_0x29f20e,startColumn:_0x176d23,endColumn:_0x2b4283}=_0x18700d,_0x1123d2=new _univerjs_core[(_0x2ce202(0x24d))](),_0x540f2f=_0x29f20e-_0xa543da,_0x178641=_0x2b4283-_0x176d23,_0xb50695={},_0xc5a8f8=(0x0,_univerjs_sheets[_0x2ce202(0x1d6)])(_0x3921b6,{'unitId':_0x6aaf51,'subUnitId':_0x2417ed});if(!_0xc5a8f8)return![];const _0x2440ad=defaultThemeStyle[_0x2ce202(0x4a4)],_0x2b48d7=defaultThemeStyle['subTotalStyle'],_0x5c948c=defaultThemeStyle[_0x2ce202(0x3ff)],_0x578065=_0x2ad2a1[_0x2ce202(0x22c)]()[_0x2ce202(0x438)](_0x2440ad),_0x549d15=_0x2ad2a1[_0x2ce202(0x22c)]()['setValue'](_0x2b48d7),_0x216599=_0x2ad2a1[_0x2ce202(0x22c)]()[_0x2ce202(0x438)](_0x5c948c),{worksheet:_0x3ab069}=_0xc5a8f8;let _0x162ce4=0x0;const _0x2c5bc1=0x1;_0x344e43['forEach'](_0x465fba=>{const _0x5d7378=_0x2ce202;for(let _0x1bb855=0x0;_0x1bb855<=_0x2b4283-_0x176d23;_0x1bb855++)_0x1123d2['setValue'](_0x162ce4,_0x1bb855,_0x3ab069[_0x5d7378(0x2ab)](_0x465fba+_0x18700d['startRow']+_0x2c5bc1,_0x1bb855));_0x162ce4++;});for(let _0x28b6e2=_0x176d23;_0x28b6e2<=_0x2b4283;_0x28b6e2++){const _0x5e2ecf=_0x3ab069[_0x2ce202(0x2ab)](_0xa543da,_0x28b6e2);if(!_0xb50695[_0xa543da])_0xb50695[_0xa543da]={};_0xb50695[_0xa543da][_0x28b6e2]={..._0x5e2ecf,'s':_0x578065};}let _0x236179=0x1;const _0x439e5a={},_0x59fd34={};_0x1123d2['forRow']((_0x471497,_0x38d692)=>{const _0x525e15=_0x2ce202;_0x38d692[_0x525e15(0x24b)](_0x6bb064=>{const _0x452d9d=_0x525e15,_0x35d579=_0x1123d2[_0x452d9d(0x3e2)](_0x471497,_0x6bb064);if(!_0xb50695[_0x236179])_0xb50695[_0x236179]={};_0xb50695[_0x236179][_0x6bb064]={..._0x35d579,'s':_0x236179%0x2===0x0?_0x216599:_0x549d15};if(_0x49636e[_0x6bb064]&&_0x471497>=0x0){const _0x219f2f=_0x236179%0x2===0x0;let _0x40493f=_0x219f2f?_0x59fd34[_0x6bb064]:_0x439e5a[_0x6bb064];if(!_0x40493f){_0x40493f=_0x2ad2a1[_0x452d9d(0x22c)]()[_0x452d9d(0x438)]({..._0x219f2f?_0x5c948c:_0x2b48d7,'n':{'pattern':_0x49636e[_0x6bb064]}});if(_0x219f2f)_0x59fd34[_0x6bb064]=_0x40493f;else _0x439e5a[_0x6bb064]=_0x40493f;}_0xb50695[_0x236179][_0x6bb064]['s']=_0x40493f;}}),_0x236179++;});const _0x23fd1f=new _univerjs_core[(_0x2ce202(0x24d))](_0xb50695),_0x51f961={};_0x23fd1f[_0x2ce202(0x3bf)]((_0x13523e,_0x153846,_0x13a785)=>{if(!_0x51f961[_0x13523e])_0x51f961[_0x13523e]={};_0x51f961[_0x13523e][_0x153846]={'s':null,'f':null,'si':null,'p':null,'v':null,'t':null,'custom':null};});const _0x54e2f4=[],_0x2ffb81=[],_0x1df978=_0x2ad2a1[_0x2ce202(0x472)]()['length'],_0x4ca36b=(0x0,_univerjs_core[_0x2ce202(0x358)])({'rowCount':Math[_0x2ce202(0x236)](_univerjs_core[_0x2ce202(0x48f)],_0x540f2f+0xa),'columnCount':Math[_0x2ce202(0x236)](_univerjs_core[_0x2ce202(0x389)],_0x178641+0x5)}),_0x46c403=_0x134d1f[_0x2ce202(0x29f)](_univerjs_core[_0x2ce202(0x337)]);_0x4ca36b['id']=(0x0,_univerjs_core['generateRandomId'])(),_0x4ca36b[_0x2ce202(0x4ce)]=_0x2ad2a1[_0x2ce202(0x38e)](''+_0x46c403['t'](_0x2ce202(0x488)));const _0x7f9807={'index':_0x1df978,'sheet':_0x4ca36b,'unitId':_0x5dddcb},_0x2ad79b=(0x0,_univerjs_sheets[_0x2ce202(0x391)])(_0x134d1f,_0x7f9807);_0x2ffb81['push']({'id':_univerjs_sheets[_0x2ce202(0x3f1)]['id'],'params':_0x7f9807}),_0x54e2f4['push']({'id':_univerjs_sheets[_0x2ce202(0x4f0)]['id'],'params':_0x2ad79b}),_0x2ffb81[_0x2ce202(0x4e8)]({'id':_univerjs_sheets['SetRangeValuesMutation']['id'],'params':{'unitId':_0x5dddcb,'subUnitId':_0x4ca36b['id'],'cellValue':_0xb50695}}),_0x54e2f4[_0x2ce202(0x41a)]({'id':_univerjs_sheets[_0x2ce202(0x4e1)]['id'],'params':{'unitId':_0x5dddcb,'subUnitId':_0x4ca36b['id'],'cellValue':_0x51f961}});const _0x5f115e={'startRow':0x0,'startColumn':0x0,'endRow':_0x236179-0x1,'endColumn':_0x2b4283};_0x2ffb81[_0x2ce202(0x4e8)]({'id':_univerjs_sheets_filter[_0x2ce202(0x4cd)]['id'],'params':{'unitId':_0x5dddcb,'subUnitId':_0x4ca36b['id'],'range':_0x5f115e}}),_0x54e2f4['unshift']({'id':_univerjs_sheets_filter['RemoveSheetsFilterMutation']['id'],'params':{'unitId':_0x5dddcb,'subUnitId':_0x4ca36b['id']}});if((0x0,_univerjs_core[_0x2ce202(0x3b7)])(_0x2ffb81,_0x134d1f['get'](_univerjs_core[_0x2ce202(0x3ad)])))_0x134d1f[_0x2ce202(0x29f)](_univerjs_core['IUndoRedoService'])[_0x2ce202(0x45d)]({'unitID':_0x5dddcb,'undoMutations':_0x54e2f4,'redoMutations':_0x2ffb81});return!![];}},RemovePivotFieldCommand={'type':_univerjs_core['CommandType'][_0x273cf5(0x3c8)],'id':_0x273cf5(0x2d9),async 'handler'(_0x23c5f1,_0x48e7e9){const _0x4cbe44=_0x273cf5;if(!_0x48e7e9)return![];const _0x2abec8=_0x23c5f1[_0x4cbe44(0x29f)](_univerjs_core[_0x4cbe44(0x3ad)]),_0x1eb8ef=_0x23c5f1['get'](SheetsPivotRPCService),_0x1ca150=_0x23c5f1[_0x4cbe44(0x29f)](_univerjs_core[_0x4cbe44(0x325)]),{pivotTableId:_0x233c76,fieldIds:_0x21bf95,unitId:_0x2ee756,subUnitId:_0x4de24f}=_0x48e7e9,_0xa0e8bf=(await _0x1eb8ef[_0x4cbe44(0x429)]({'unitId':_0x2ee756,'subUnitId':_0x4de24f,'pivotTableId':_0x233c76,'params':{'type':PivotDisplayDataType[_0x4cbe44(0x397)],'removePivotField':{'fieldIds':_0x21bf95}}}))[_0x4cbe44(0x4d6)][_0x4cbe44(0x453)];if(!_0xa0e8bf)return![];const {view:_0x2a6db0,changesets:_0x56be65,isEmpty:_0x46250d,pivotTableConfig:_0x14581f}=_0xa0e8bf,_0x4c6668=_0x14581f[_0x4cbe44(0x1db)],_0x677f12=new _univerjs_pro_engine_pivot[(_0x4cbe44(0x396))]();_0x677f12[_0x4cbe44(0x3fe)](_0x2a6db0);const _0x3a30e8={'cellInfo':_0x4c6668,'view':_0x677f12,'isEmpty':_0x46250d};if(!await _0x23c5f1[_0x4cbe44(0x29f)](SheetsPivotTableService)[_0x4cbe44(0x489)][_0x4cbe44(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x3a30e8))return![];const _0x40872e=getInsertRowColMutations(_0x23c5f1,_0x677f12,_0x4c6668,_0x46250d),_0xe1750f=generateMutationsFromPivotCommand(_0x23c5f1,_0x3a30e8),{redos:_0x86da10,undos:_0x484bc1}=applyChangeSet(_0x2abec8,{'pivotTableId':_0x233c76,'unitId':_0x2ee756,'subUnitId':_0x4de24f},_0x56be65);return(0x0,_univerjs_core[_0x4cbe44(0x3b7)])([..._0x40872e['redos'],..._0xe1750f[_0x4cbe44(0x3d5)],..._0x86da10],_0x2abec8),_0x1ca150['pushUndoRedo']({'unitID':_0x2ee756,'redoMutations':[..._0x40872e[_0x4cbe44(0x3d5)],..._0xe1750f[_0x4cbe44(0x3d5)],..._0x86da10],'undoMutations':[..._0x40872e[_0x4cbe44(0x211)],..._0xe1750f['undos'],..._0x484bc1]}),!![];}},ResetPivotFieldsConfigCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x25c),async 'handler'(_0x45f0f2,_0x145753){const _0x277b56=_0x273cf5;if(!_0x145753)return![];const _0x372b88=_0x45f0f2[_0x277b56(0x29f)](_univerjs_core['ICommandService']),_0x1a4c1a=_0x45f0f2[_0x277b56(0x29f)](_univerjs_core['IUndoRedoService']),_0x2673be=_0x45f0f2[_0x277b56(0x29f)](SheetsPivotRPCService),{resetArea:_0x3ce3da,pivotTableId:_0x22c4c5,unitId:_0x4f4deb,subUnitId:_0x4d6849}=_0x145753,_0x1f018b=(await _0x2673be[_0x277b56(0x429)]({'unitId':_0x4f4deb,'subUnitId':_0x4d6849,'pivotTableId':_0x22c4c5,'params':{'type':PivotDisplayDataType['ResetPivotTable'],'resetPivotTable':{'pivotTableId':_0x22c4c5,'resetArea':_0x3ce3da}}}))[_0x277b56(0x4d6)][_0x277b56(0x207)];if(!_0x1f018b)return![];const {changesets:_0x4dba49}=_0x1f018b,{redos:_0x167283,undos:_0x25f9e4}=applyChangeSet(_0x372b88,{'pivotTableId':_0x22c4c5,'unitId':_0x4f4deb,'subUnitId':_0x4d6849},_0x4dba49);return(0x0,_univerjs_core[_0x277b56(0x3b7)])(_0x167283,_0x372b88),_0x1a4c1a[_0x277b56(0x45d)]({'unitID':_0x4f4deb,'redoMutations':_0x167283,'undoMutations':_0x25f9e4}),!![];}},SetPivotCollapseCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':'sheet.command.set-pivot-collapse',async 'handler'(_0x3d80c1,_0x49e8f7){const _0x5a0f86=_0x273cf5,_0x37b035=_0x3d80c1[_0x5a0f86(0x29f)](_univerjs_core[_0x5a0f86(0x3ad)]),_0xacd79c=_0x3d80c1[_0x5a0f86(0x29f)](SheetsPivotRPCService),_0x516111=_0x3d80c1['get'](SheetsPivotTableAdaptorModel),_0xb0abf2=_0x3d80c1['get'](_univerjs_core[_0x5a0f86(0x315)]),_0x16597d=_0x3d80c1[_0x5a0f86(0x29f)](_univerjs_core[_0x5a0f86(0x337)]),_0x232819=_0x3d80c1[_0x5a0f86(0x29f)](_univerjs_core['IUndoRedoService']);if(!_0x49e8f7)return![];const {unitId:_0x3bf649,subUnitId:_0x23c492,row:_0x1da899,col:_0x439288,collapse:_0x5edcac}=_0x49e8f7,_0x15a6db=_0xb0abf2['getUnit'](_0x3bf649);if(!_0x15a6db)return![];if(!_0x15a6db[_0x5a0f86(0x38f)](_0x23c492))return![];const _0x1a17bf=_0x516111[_0x5a0f86(0x1e6)](_0x3bf649,_0x23c492,_0x1da899,_0x439288);if(!_0x1a17bf)return![];const _0x46679c=_0x516111[_0x5a0f86(0x234)](_0x3bf649,_0x23c492,_0x1a17bf);if(!_0x46679c)return![];const _0x16b089=(0x0,_univerjs_core[_0x5a0f86(0x38d)])(_0x1da899,_0x439288),{rangesInfo:_0x2f9f36,areaInfo:_0x5a5eec,headerMap:_0x48d784}=_0x46679c;if(!_0x2f9f36||!_0x5a5eec||!_0x48d784)return![];const _0x3df31e=Object['keys'](_0x2f9f36)[_0x5a0f86(0x265)](_0x247a83=>{const _0x5eb640=_0x5a0f86;return _0x2f9f36[_0x247a83][_0x5eb640(0x354)](_0x181b46=>_univerjs_core[_0x5eb640(0x3ce)][_0x5eb640(0x1ef)](_0x181b46,_0x16b089));});let _0x4c2b9e;if(_0x3df31e===_0x5a0f86(0x257))_0x4c2b9e=_0x48d784['rowHeaderMap'][_0x439288];else{if(_0x3df31e===_0x5a0f86(0x4ba))_0x4c2b9e=_0x48d784[_0x5a0f86(0x20c)][_0x1da899];}const _0x5ee8aa=_0x4c2b9e===null||_0x4c2b9e===void 0x0?void 0x0:_0x4c2b9e[_0x5a0f86(0x1cf)],_0x183b96=_0x516111['getPivotTableCellData'](_0x3bf649,_0x23c492,_0x1da899,_0x439288);let _0x155d1d=_0x183b96===null||_0x183b96===void 0x0?void 0x0:_0x183b96['v'];if(_0x155d1d===_0x16597d['t'](_0x5a0f86(0x4bb)))_0x155d1d=_univerjs_pro_engine_pivot['GlobalConfig']['BLANK_PLACEHOLDER'];if(_0x155d1d===void 0x0||_0x155d1d===null||!_0x1a17bf||!_0x5ee8aa)return![];const _0x13d203=await _0xacd79c[_0x5a0f86(0x429)]({'unitId':_0x3bf649,'subUnitId':_0x23c492,'pivotTableId':_0x1a17bf,'params':{'type':PivotDisplayDataType[_0x5a0f86(0x313)],'setPivotCollapse':{'tableFieldId':_0x5ee8aa,'collapse':_0x5edcac,'item':_0x155d1d}}}),_0x3cd04c=_0x13d203===null||_0x13d203===void 0x0?void 0x0:_0x13d203[_0x5a0f86(0x4d6)][_0x5a0f86(0x2ba)];if(!_0x3cd04c)return![];const {view:_0x108c4a,pivotTableConfig:_0x4c7670,isEmpty:_0x3a028f,changesets:_0x39f776}=_0x3cd04c,_0x363242=new _univerjs_pro_engine_pivot[(_0x5a0f86(0x396))]();_0x363242[_0x5a0f86(0x3fe)](_0x108c4a);const _0x96ade8=_0x4c7670[_0x5a0f86(0x1db)],_0x57ffdc={'cellInfo':_0x96ade8,'view':_0x363242,'isEmpty':_0x3a028f};if(!await _0x3d80c1[_0x5a0f86(0x29f)](SheetsPivotTableService)[_0x5a0f86(0x489)][_0x5a0f86(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x57ffdc))return![];const _0x4eb4f5=getInsertRowColMutations(_0x3d80c1,_0x363242,_0x96ade8,_0x3a028f),_0x1356d3=generateMutationsFromPivotCommand(_0x3d80c1,_0x57ffdc),{redos:_0xc49863,undos:_0x38fcc6}=applyChangeSet(_0x37b035,{'pivotTableId':_0x1a17bf,'unitId':_0x3bf649,'subUnitId':_0x23c492},_0x39f776);return(0x0,_univerjs_core[_0x5a0f86(0x3b7)])([..._0x4eb4f5[_0x5a0f86(0x3d5)],..._0x1356d3[_0x5a0f86(0x3d5)],..._0xc49863],_0x37b035),_0x232819[_0x5a0f86(0x45d)]({'unitID':_0x3bf649,'redoMutations':[..._0x4eb4f5[_0x5a0f86(0x3d5)],..._0x1356d3[_0x5a0f86(0x3d5)],..._0xc49863],'undoMutations':[..._0x4eb4f5[_0x5a0f86(0x211)],..._0x1356d3['undos'],..._0x38fcc6]}),!![];}},SetPivotFieldsConfigCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x425),async 'handler'(_0x4990a0,_0x4f0130){const _0x23bcdf=_0x273cf5;if(!_0x4f0130)return![];const _0x241647=_0x4990a0[_0x23bcdf(0x29f)](_univerjs_core[_0x23bcdf(0x3ad)]),_0x5623a7=_0x4990a0[_0x23bcdf(0x29f)](_univerjs_core[_0x23bcdf(0x325)]),_0x189022=_0x4990a0[_0x23bcdf(0x29f)](SheetsPivotRPCService),{pivotTableConfig:_0x5b28a8,pivotTableId:_0x2acd19,unitId:_0x1d6ff1,subUnitId:_0x661302}=_0x4f0130,_0x12da05=(await _0x189022[_0x23bcdf(0x429)]({'unitId':_0x1d6ff1,'subUnitId':_0x661302,'pivotTableId':_0x2acd19,'params':{'type':PivotDisplayDataType[_0x23bcdf(0x3eb)],'setPivotTableConfig':{'pivotTableId':_0x2acd19,'pivotTableConfig':_0x5b28a8}}}))['result'][_0x23bcdf(0x3b9)];if(!_0x12da05)return![];const {changesets:_0x29099f}=_0x12da05,{redos:_0x1406f3,undos:_0x4a8f6e}=applyChangeSet(_0x241647,{'pivotTableId':_0x2acd19,'unitId':_0x1d6ff1,'subUnitId':_0x661302},_0x29099f);return(0x0,_univerjs_core['sequenceExecute'])(_0x1406f3,_0x241647),_0x5623a7[_0x23bcdf(0x45d)]({'unitID':_0x1d6ff1,'redoMutations':_0x1406f3,'undoMutations':_0x4a8f6e}),!![];}},SetPivotFilterCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x4ad),async 'handler'(_0x1b9165,_0x2853c9){const _0x17cdb5=_0x273cf5;if(!_0x2853c9)return![];const _0x3cfdd9=_0x1b9165['get'](_univerjs_core['ICommandService']),{pivotTableId:_0x11f4a1,tableFieldId:_0x16175d,items:_0x1bff73,unitId:_0x1358b9,subUnitId:_0x117944,isAll:_0x405172}=_0x2853c9,_0x6e05cf=_0x1b9165[_0x17cdb5(0x29f)](SheetsPivotRPCService),_0x45b04d=_0x1b9165[_0x17cdb5(0x29f)](_univerjs_core[_0x17cdb5(0x325)]),_0x51652b=(await _0x6e05cf[_0x17cdb5(0x429)]({'unitId':_0x1358b9,'subUnitId':_0x117944,'pivotTableId':_0x11f4a1,'params':{'type':PivotDisplayDataType[_0x17cdb5(0x4a8)],'setPivotFilter':{'tableFieldId':_0x16175d,'items':_0x1bff73,'isAll':_0x405172}}}))['result'][_0x17cdb5(0x411)];if(!_0x51652b)return![];const {changesets:_0x161442,pivotTableConfig:_0x265d2d,isEmpty:_0x86221b,view:_0x1a70aa}=_0x51652b,_0x2e6d75=_0x265d2d[_0x17cdb5(0x1db)],_0x5dd94d=new _univerjs_pro_engine_pivot[(_0x17cdb5(0x396))]();_0x5dd94d[_0x17cdb5(0x3fe)](_0x1a70aa);const _0x444fac={'cellInfo':_0x2e6d75,'view':_0x5dd94d,'isEmpty':_0x86221b};if(!await _0x1b9165[_0x17cdb5(0x29f)](SheetsPivotTableService)[_0x17cdb5(0x489)][_0x17cdb5(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x444fac))return![];const _0x458a42=getInsertRowColMutations(_0x1b9165,_0x5dd94d,_0x2e6d75,_0x86221b),_0x19c982=generateMutationsFromPivotCommand(_0x1b9165,_0x444fac),{undos:_0xe2426b,redos:_0x49f5af}=applyChangeSet(_0x3cfdd9,{'pivotTableId':_0x11f4a1,'unitId':_0x1358b9,'subUnitId':_0x117944},_0x161442);return(0x0,_univerjs_core[_0x17cdb5(0x3b7)])([..._0x458a42[_0x17cdb5(0x3d5)],..._0x19c982[_0x17cdb5(0x3d5)],..._0x49f5af],_0x3cfdd9),_0x45b04d[_0x17cdb5(0x45d)]({'unitID':_0x1358b9,'redoMutations':[..._0x458a42[_0x17cdb5(0x3d5)],..._0x19c982['redos'],..._0x49f5af],'undoMutations':[..._0x458a42[_0x17cdb5(0x211)],..._0x19c982[_0x17cdb5(0x211)],..._0xe2426b]}),!![];}},SetPivotSortCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':'sheet.command.set-pivot-sort',async 'handler'(_0x54da7b,_0x2f0f5b){const _0x3fca16=_0x273cf5;if(!_0x2f0f5b)return![];const _0x31e827=_0x54da7b[_0x3fca16(0x29f)](_univerjs_core[_0x3fca16(0x3ad)]),_0x19a438=_0x54da7b[_0x3fca16(0x29f)](_univerjs_core[_0x3fca16(0x325)]),_0x4d1acd=_0x54da7b[_0x3fca16(0x29f)](SheetsPivotRPCService),{info:_0x22ce32,tableFieldId:_0x512c8b,pivotTableId:_0x2e8acb,unitId:_0x1cbe72,subUnitId:_0x252c3f}=_0x2f0f5b,_0x51ac93=(await _0x4d1acd[_0x3fca16(0x429)]({'unitId':_0x1cbe72,'subUnitId':_0x252c3f,'pivotTableId':_0x2e8acb,'params':{'type':PivotDisplayDataType['SetPivotSort'],'setPivotSort':{'tableFieldId':_0x512c8b,'info':_0x22ce32}}}))[_0x3fca16(0x4d6)][_0x3fca16(0x422)];if(!_0x51ac93)return![];const {changesets:_0x134e91}=_0x51ac93,{redos:_0x331c5c,undos:_0x53623b}=applyChangeSet(_0x31e827,{'pivotTableId':_0x2e8acb,'unitId':_0x1cbe72,'subUnitId':_0x252c3f},_0x134e91);return(0x0,_univerjs_core['sequenceExecute'])(_0x331c5c,_0x31e827),_0x19a438['pushUndoRedo']({'unitID':_0x1cbe72,'redoMutations':_0x331c5c,'undoMutations':_0x53623b}),!![];}},SetPivotValueFilterCommand={'type':_univerjs_core['CommandType'][_0x273cf5(0x3c8)],'id':_0x273cf5(0x29d),async 'handler'(_0x523b73,_0x24afb4){const _0x292980=_0x273cf5;if(!_0x24afb4)return![];const _0x257307=_0x523b73[_0x292980(0x29f)](_univerjs_core['ICommandService']),{pivotTableId:_0x3866b2,fieldId:_0xa0f37,valueFilterInfo:_0x5cb08e,unitId:_0x4746c4,subUnitId:_0x5243ec}=_0x24afb4,_0x21a523=_0x523b73[_0x292980(0x29f)](SheetsPivotRPCService),_0x1b3c94=_0x523b73['get'](_univerjs_core[_0x292980(0x325)]),_0x5b50c9=(await _0x21a523[_0x292980(0x429)]({'unitId':_0x4746c4,'subUnitId':_0x5243ec,'pivotTableId':_0x3866b2,'params':{'type':PivotDisplayDataType[_0x292980(0x1df)],'setValuePivotFilter':{'tableFieldId':_0xa0f37,'filterInfo':_0x5cb08e}}}))[_0x292980(0x4d6)][_0x292980(0x2bc)];if(!_0x5b50c9)return![];const {changesets:_0x3113e9,pivotTableConfig:_0x4184d9,isEmpty:_0x2558c9,view:_0x308845}=_0x5b50c9,_0x2cb185=_0x4184d9[_0x292980(0x1db)],_0xd2fae6=new _univerjs_pro_engine_pivot[(_0x292980(0x396))]();_0xd2fae6[_0x292980(0x3fe)](_0x308845);const _0x2032f1={'cellInfo':_0x2cb185,'view':_0xd2fae6,'isEmpty':_0x2558c9};if(!await _0x523b73['get'](SheetsPivotTableService)[_0x292980(0x489)]['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0x2032f1))return![];const _0x31812d=getInsertRowColMutations(_0x523b73,_0xd2fae6,_0x2cb185,_0x2558c9),_0x5346ce=generateMutationsFromPivotCommand(_0x523b73,_0x2032f1),{undos:_0x590dad,redos:_0x33c613}=applyChangeSet(_0x257307,{'pivotTableId':_0x3866b2,'unitId':_0x4746c4,'subUnitId':_0x5243ec},_0x3113e9);return(0x0,_univerjs_core[_0x292980(0x3b7)])([..._0x31812d[_0x292980(0x3d5)],..._0x5346ce[_0x292980(0x3d5)],..._0x33c613],_0x257307),_0x1b3c94['pushUndoRedo']({'unitID':_0x4746c4,'redoMutations':[..._0x31812d[_0x292980(0x3d5)],..._0x5346ce[_0x292980(0x3d5)],..._0x33c613],'undoMutations':[..._0x31812d[_0x292980(0x211)],..._0x5346ce[_0x292980(0x211)],..._0x590dad]}),!![];}},UpdateDateGroupMutation={'id':'sheet.mutation.update-date-group','type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3a2)],'handler':(_0x4a6eb3,_0x32baca)=>{const _0x2f16f5=_0x273cf5;if(!_0x32baca)return![];const _0x30a56a=_0x4a6eb3[_0x2f16f5(0x29f)](_univerjs_core[_0x2f16f5(0x26e)]);if(Boolean(_0x30a56a[_0x2f16f5(0x4e3)](_0x2f16f5(0x235))))return!![];const {unitId:_0x2d29f5,subUnitId:_0x50e6cd,pivotTableId:_0x3aa99f,tableFieldId:_0x4bef77,dateType:_0x4a013c}=_0x32baca,_0x5b90e8=_0x4a6eb3[_0x2f16f5(0x29f)](SheetsPivotDataSourceModel),_0xc6db00=_0x5b90e8[_0x2f16f5(0x204)](_0x3aa99f);if(!_0xc6db00)return![];const _0x1e07a7=_0xc6db00[_0x2f16f5(0x380)](_0x4bef77);if(!_0x1e07a7)return![];const _0x5a1080=_0x1e07a7[_0x2f16f5(0x259)](),_0x5f2d95=_0xc6db00[_0x2f16f5(0x223)](_0x5a1080),_0x1b1385=(_0x5f2d95===null||_0x5f2d95===void 0x0?void 0x0:_0x5f2d95[_0x2f16f5(0x416)]())+'\x20'+getDateGroupName(_0x4a6eb3,_0x4a013c);_0x5b90e8['getCollection'](_0x2d29f5,_0x3aa99f)[_0x2f16f5(0x439)](_0x1e07a7['id'],_0x1b1385);const _0x2b3d56=_0xc6db00[_0x2f16f5(0x46c)](_0x4bef77);if(!_0x2b3d56)return![];_0xc6db00['renameField'](_0x2b3d56['getId'](),_0x1b1385),_0x1e07a7[_0x2f16f5(0x296)](_0x4a013c);const _0x342c84=_0x5b90e8[_0x2f16f5(0x4b0)](_0x2d29f5,_0x50e6cd,_0x3aa99f);return _0x5b90e8['addDirtyPivotTable']({'unitId':_0x2d29f5,'subUnitId':_0x50e6cd,'token':_0x3aa99f,'type':PivotTableOperationEnum[_0x2f16f5(0x2b2)],'pivotConfig':_0x342c84}),!![];}},UpdateDateGroupCommand={'id':_0x273cf5(0x272),'type':_univerjs_core[_0x273cf5(0x4d7)]['COMMAND'],'handler':(_0x56bdba,_0x3e87c4)=>{const _0x1f0527=_0x273cf5;if(!_0x3e87c4)return![];const _0x1fcb15=_0x56bdba[_0x1f0527(0x29f)](_univerjs_core[_0x1f0527(0x325)]),{unitId:_0x523495,subUnitId:_0x16637f,pivotTableId:_0x46200c,tableFieldId:_0x308d22}=_0x3e87c4,_0x484dde=[],_0x4d14ef=[],_0x35d09d=_0x56bdba[_0x1f0527(0x29f)](SheetsPivotTableConfigModel),_0x543fd6=_0x35d09d[_0x1f0527(0x22d)](_0x523495,_0x46200c),_0x2606b9=_0x35d09d['getPivotTableConfig'](_0x523495,_0x16637f,_0x46200c);if(!(_0x2606b9===null||_0x2606b9===void 0x0?void 0x0:_0x2606b9[_0x1f0527(0x30c)][_0x1f0527(0x20d)]))return![];const _0x2a818e=Object[_0x1f0527(0x343)](_0x2606b9[_0x1f0527(0x30c)][_0x1f0527(0x20d)])[_0x1f0527(0x265)](_0x4050b5=>_0x4050b5['id']===_0x308d22);if(!_0x2a818e)return![];const _0x5d3361=_0x2a818e[_0x1f0527(0x496)];if(!(_0x543fd6===null||_0x543fd6===void 0x0?void 0x0:_0x543fd6[_0x1f0527(0x3c0)]))return![];const _0x17ba7a=Object[_0x1f0527(0x343)](_0x543fd6===null||_0x543fd6===void 0x0?void 0x0:_0x543fd6[_0x1f0527(0x3c0)])[_0x1f0527(0x265)](_0x14a7d5=>_0x14a7d5['id']===_0x5d3361);if(!_0x17ba7a)return![];if((0x0,_univerjs_pro_engine_pivot[_0x1f0527(0x274)])(_0x17ba7a))_0x484dde[_0x1f0527(0x4e8)]({'id':UpdateDateGroupMutation['id'],'params':{..._0x3e87c4,'dateType':_0x17ba7a[_0x1f0527(0x3b5)]}});_0x4d14ef[_0x1f0527(0x4e8)]({'id':UpdateDateGroupMutation['id'],'params':{..._0x3e87c4}});if((0x0,_univerjs_core[_0x1f0527(0x3b7)])(_0x4d14ef,_0x56bdba[_0x1f0527(0x29f)](_univerjs_core[_0x1f0527(0x3ad)])))_0x1fcb15[_0x1f0527(0x45d)]({'unitID':_0x523495,'undoMutations':_0x484dde,'redoMutations':_0x4d14ef});return!![];}},UpdatePivotFieldSettingCommand={'type':_univerjs_core['CommandType'][_0x273cf5(0x3c8)],'id':_0x273cf5(0x1d0),async 'handler'(_0x718422,_0x4b518b){const _0x1101e6=_0x273cf5;if(!_0x4b518b)return![];const _0x13ef1a=_0x718422['get'](_univerjs_core[_0x1101e6(0x3ad)]),_0x578fd9=_0x718422[_0x1101e6(0x29f)](_univerjs_core[_0x1101e6(0x325)]),_0x1ca60c=_0x718422[_0x1101e6(0x29f)](SheetsPivotRPCService),{displayName:_0x4cd630,subtotalType:_0x13f57a,format:_0x41d1ef,tableFieldId:_0x2dbc18,pivotTableId:_0x269715,unitId:_0x5cb64d,subUnitId:_0x4a3486}=_0x4b518b,_0x510113=(await _0x1ca60c[_0x1101e6(0x429)]({'unitId':_0x5cb64d,'subUnitId':_0x4a3486,'pivotTableId':_0x269715,'params':{'type':PivotDisplayDataType[_0x1101e6(0x3cf)],'setPivotSetting':{'tableFieldId':_0x2dbc18,'displayName':_0x4cd630,'subtotalType':_0x13f57a,'format':_0x41d1ef}}}))[_0x1101e6(0x4d6)][_0x1101e6(0x421)];if(!_0x510113)return![];const {changesets:_0x21f597,view:_0x35f8bf,pivotTableConfig:_0x4b03b6,isEmpty:_0x38b070}=_0x510113,_0x10cabb=_0x4b03b6['targetCellInfo'],_0x20bc83=new _univerjs_pro_engine_pivot['PivotView']();_0x20bc83[_0x1101e6(0x3fe)](_0x35f8bf);const _0x42ca69={'cellInfo':_0x10cabb,'view':_0x20bc83,'isEmpty':_0x38b070};if(!await _0x718422[_0x1101e6(0x29f)](SheetsPivotTableService)[_0x1101e6(0x489)][_0x1101e6(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x42ca69))return![];const _0x2aecec=getInsertRowColMutations(_0x718422,_0x20bc83,_0x10cabb,_0x38b070),_0x648975=generateMutationsFromPivotCommand(_0x718422,_0x42ca69),{undos:_0x29e668,redos:_0x2e092e}=applyChangeSet(_0x13ef1a,{'pivotTableId':_0x269715,'unitId':_0x5cb64d,'subUnitId':_0x4a3486},_0x21f597);return(0x0,_univerjs_core[_0x1101e6(0x3b7)])([..._0x2aecec[_0x1101e6(0x3d5)],..._0x648975[_0x1101e6(0x3d5)],..._0x2e092e],_0x13ef1a),_0x578fd9[_0x1101e6(0x45d)]({'unitID':_0x5cb64d,'redoMutations':[..._0x2aecec[_0x1101e6(0x3d5)],..._0x648975[_0x1101e6(0x3d5)],..._0x2e092e],'undoMutations':[..._0x2aecec['undos'],..._0x648975[_0x1101e6(0x211)],..._0x29e668]}),!![];}},UpdatePivotTableSourceRangeMutation={'type':_univerjs_core['CommandType'][_0x273cf5(0x3a2)],'id':'sheet.mutation.update-pivot-table-source-range','handler'(_0x58da25,_0x9e93ed){const _0x31fee2=_0x273cf5;if(!_0x9e93ed)return![];const _0x40c57f=_0x58da25[_0x31fee2(0x29f)](_univerjs_core[_0x31fee2(0x26e)]);if(Boolean(_0x40c57f[_0x31fee2(0x4e3)](_0x31fee2(0x235))))return!![];const _0xd4955=_0x58da25[_0x31fee2(0x29f)](SheetsPivotDataSourceModel),{pivotTableId:_0x3498b7,deleteIds:_0x1bca97,collectionJSON:_0x266b8b,dataRangeInfo:_0x8aa8fb,unitId:_0xf5aedd,subUnitId:_0x565263}=_0x9e93ed,_0x116b94=_0xd4955['getPivotTableInstance'](_0x3498b7),_0x137799=_0xd4955[_0x31fee2(0x4b0)](_0xf5aedd,_0x565263,_0x3498b7);if(!_0x116b94||!_0x137799)return![];const {collection:_0x5b5a8a,updateDataFieldList:_0x58ee1d}=_0xd4955[_0x31fee2(0x306)](_0x3498b7,_0x266b8b,_0x8aa8fb,_0x137799['targetCellInfo']);_0xd4955[_0x31fee2(0x450)](_0x5b5a8a,_0x58ee1d,_0x8aa8fb),_0x116b94[_0x31fee2(0x41d)](_0x5b5a8a);for(const _0x2988ec of _0x1bca97)_0xd4955['removeDataField'](_0x8aa8fb[_0x31fee2(0x452)],_0x2988ec);const _0x1cac8c=_0xd4955['getPivotTableConfig'](_0xf5aedd,_0x565263,_0x3498b7);return _0x1cac8c[_0x31fee2(0x3f5)]=JSON[_0x31fee2(0x329)](JSON[_0x31fee2(0x307)](_0x8aa8fb)),_0xd4955[_0x31fee2(0x4c7)]({'unitId':_0xf5aedd,'subUnitId':_0x565263,'token':_0x3498b7,'type':PivotTableOperationEnum['Set']}),!![];}},UpdatePivotTableSourceRangeCommand={'type':_univerjs_core[_0x273cf5(0x4d7)]['COMMAND'],'id':_0x273cf5(0x20f),async 'handler'(_0x4f0f6b,_0x202e0d){const _0x3ebc43=_0x273cf5,_0x4738a2=_0x4f0f6b[_0x3ebc43(0x29f)](_univerjs_core['ICommandService']),_0x2eb09e=_0x4f0f6b[_0x3ebc43(0x29f)](SheetsPivotRPCService),_0x47085a=_0x4f0f6b[_0x3ebc43(0x29f)](_univerjs_core[_0x3ebc43(0x325)]);if(!_0x202e0d)return![];const {token:_0x1a3ad7,dataRangeInfo:_0x3d52b3,unitId:_0x3d9495,subUnitId:_0x3744e0}=_0x202e0d,_0x1bc98a=[],_0x1b13c4=[],_0xec3548=(await _0x2eb09e[_0x3ebc43(0x429)]({'unitId':_0x3d9495,'subUnitId':_0x3744e0,'pivotTableId':_0x1a3ad7,'params':{'type':PivotDisplayDataType[_0x3ebc43(0x375)],'updatePivotSource':{'dataRangeInfo':_0x3d52b3,'unitId':_0x3d9495,'subUnitId':_0x3744e0}}}))[_0x3ebc43(0x4d6)][_0x3ebc43(0x3c7)];if(!_0xec3548)return![];const {changesets:_0x451f2b,deleteIds:_0x5bc8a1,collectionConfig:_0x283ef1,oldCollectionConfig:_0x345dda,view:_0x2d8fee,isEmpty:_0x52c99c,pivotTableConfig:_0xec116a}=_0xec3548;_0x1b13c4[_0x3ebc43(0x4e8)]({'id':UpdatePivotTableSourceRangeMutation['id'],'params':{'pivotTableId':_0x1a3ad7,'deleteIds':_0x5bc8a1,'collectionJSON':_0x283ef1,'dataRangeInfo':_0x3d52b3,'unitId':_0x3d9495,'subUnitId':_0x3744e0}}),_0x1bc98a[_0x3ebc43(0x41a)]({'id':UpdatePivotTableSourceRangeMutation['id'],'params':{'pivotTableId':_0x1a3ad7,'deleteIds':[],'collectionJSON':_0x345dda,'dataRangeInfo':_0xec116a[_0x3ebc43(0x3f5)],'unitId':_0x3d9495,'subUnitId':_0x3744e0}});const _0x900f91=_0xec116a[_0x3ebc43(0x1db)],_0x5c63cc=new _univerjs_pro_engine_pivot[(_0x3ebc43(0x396))]();_0x5c63cc[_0x3ebc43(0x3fe)](_0x2d8fee);const _0x351998={'cellInfo':_0x900f91,'view':_0x5c63cc,'isEmpty':_0x52c99c};if(!await _0x4f0f6b['get'](SheetsPivotTableService)[_0x3ebc43(0x489)][_0x3ebc43(0x29c)](PIVOT_PERFORM_CHECK)(!![],_0x351998))return![];const _0x113a56=getInsertRowColMutations(_0x4f0f6b,_0x5c63cc,_0x900f91,_0x52c99c),_0x522290=generateMutationsFromPivotCommand(_0x4f0f6b,_0x351998),{undos:_0x2956f8,redos:_0x3564ca}=applyChangeSet(_0x4738a2,{'pivotTableId':_0x1a3ad7,'unitId':_0x3d9495,'subUnitId':_0x3744e0},_0x451f2b);return(0x0,_univerjs_core['sequenceExecute'])([..._0x113a56[_0x3ebc43(0x3d5)],..._0x522290[_0x3ebc43(0x3d5)],..._0x1b13c4,..._0x2956f8],_0x4738a2),_0x47085a[_0x3ebc43(0x45d)]({'unitID':_0x3d9495,'redoMutations':[..._0x113a56[_0x3ebc43(0x3d5)],..._0x522290['redos'],..._0x1b13c4,..._0x2956f8],'undoMutations':[..._0x113a56[_0x3ebc43(0x211)],..._0x522290[_0x3ebc43(0x211)],..._0x1bc98a,..._0x3564ca]}),!![];}},UpdatePivotValuePositionCommand={'type':_univerjs_core[_0x273cf5(0x4d7)][_0x273cf5(0x3c8)],'id':_0x273cf5(0x4f3),async 'handler'(_0x1d778f,_0x105e25){const _0x56685d=_0x273cf5;if(!_0x105e25)return![];const _0x294451=_0x1d778f[_0x56685d(0x29f)](_univerjs_core[_0x56685d(0x3ad)]),_0x1278db=_0x1d778f[_0x56685d(0x29f)](SheetsPivotRPCService),_0x251045=_0x1d778f['get'](_univerjs_core[_0x56685d(0x315)]),_0x1b969e=_0x1d778f[_0x56685d(0x29f)](_univerjs_core[_0x56685d(0x325)]),{pivotTableId:_0x3aa415,position:_0xb01e5b,index:_0x9039c3}=_0x105e25,_0x135b91=(0x0,_univerjs_sheets['getSheetCommandTarget'])(_0x251045);if(!_0x135b91)return![];const {unitId:_0x504624,subUnitId:_0x284c73}=_0x135b91,_0x2de81=(await _0x1278db['getPivotDisplayConfig']({'unitId':_0x504624,'subUnitId':_0x284c73,'pivotTableId':_0x3aa415,'params':{'type':PivotDisplayDataType['UpdateValuePosition'],'updateValuePosition':{'position':_0xb01e5b,'index':_0x9039c3}}}))[_0x56685d(0x4d6)][_0x56685d(0x498)];if(!_0x2de81)return![];const {changesets:_0x3a6c27,view:_0x43893e,isEmpty:_0x2fe42d,pivotTableConfig:_0x216230}=_0x2de81,_0x1e1388=_0x216230[_0x56685d(0x1db)],_0x28b3d1=new _univerjs_pro_engine_pivot[(_0x56685d(0x396))]();_0x28b3d1[_0x56685d(0x3fe)](_0x43893e);const _0x35e4a1=_0x1d778f[_0x56685d(0x29f)](SheetsPivotTableService),_0x32d964={'cellInfo':_0x1e1388,'view':_0x28b3d1,'isEmpty':_0x2fe42d};if(!await _0x35e4a1[_0x56685d(0x489)]['fetchThroughAsyncInterceptors'](PIVOT_PERFORM_CHECK)(!![],_0x32d964))return![];const _0x150a33=getInsertRowColMutations(_0x1d778f,_0x28b3d1,_0x1e1388,_0x2fe42d),_0x553905=generateMutationsFromPivotCommand(_0x1d778f,_0x32d964),{undos:_0x3a1319,redos:_0x4e383d}=applyChangeSet(_0x294451,{'pivotTableId':_0x3aa415,'unitId':_0x504624,'subUnitId':_0x284c73},_0x3a6c27);return(0x0,_univerjs_core[_0x56685d(0x3b7)])([..._0x150a33['redos'],..._0x553905[_0x56685d(0x3d5)],..._0x4e383d],_0x294451),_0x1b969e[_0x56685d(0x45d)]({'unitID':_0x504624,'redoMutations':[..._0x150a33[_0x56685d(0x3d5)],..._0x553905[_0x56685d(0x3d5)],..._0x4e383d],'undoMutations':[..._0x150a33[_0x56685d(0x211)],..._0x553905[_0x56685d(0x211)],..._0x3a1319]}),!![];}},PivotTableViewDirtyMarkOperation={'type':_univerjs_core[_0x273cf5(0x4d7)]['MUTATION'],'id':_0x273cf5(0x269),'handler'(){return!![];}};var name=_0x273cf5(0x2fa),version=_0x273cf5(0x1e4);const getEmptyPivotDirtyViewInfo=()=>{return{'runtimeCellData':{},'dirtyRanges':{}};},updatePivotTableFieldName=(_0x4e13dd,_0x5a8683,_0x3ab97b)=>{const _0x3223f3=_0x273cf5,_0x57379d=_0x4e13dd['dataFieldsCollection'];_0x4e13dd[_0x3223f3(0x1d1)](_0x339ac3=>{const _0x23cb0f=_0x3223f3,_0x38cbc1=_0x339ac3['getId'](),_0x365445=_0x339ac3[_0x23cb0f(0x4a2)](),_0x291a27=_0x339ac3['getSourceName'](),_0x22993d=_0x339ac3[_0x23cb0f(0x26b)]();_0x5a8683[_0x365445]&&_0x5a8683[_0x365445]===_0x22993d&&(_0x291a27===_0x22993d&&(_0x4e13dd[_0x23cb0f(0x2c0)](_0x38cbc1,_0x57379d['getDisplayName'](_0x365445)),_0x339ac3['setSourceName'](_0x57379d[_0x23cb0f(0x26b)](_0x365445))));}),_0x4e13dd[_0x3223f3(0x382)](_univerjs_pro_engine_pivot[_0x3223f3(0x37d)][_0x3223f3(0x3a1)],_0x58b11f=>{const _0x21f02b=_0x3223f3,_0x144df8=_0x58b11f['getId'](),_0x5bb471=_0x58b11f[_0x21f02b(0x4a2)](),_0x4e892e=_0x58b11f[_0x21f02b(0x32c)](),_0x36d2df=_0x58b11f[_0x21f02b(0x26b)](),_0x2db416=_0x58b11f[_0x21f02b(0x2e8)](),_0x1cff2b=_0x3ab97b(_0x4e892e,_0x2db416);_0x5a8683[_0x5bb471]&&_0x5a8683[_0x5bb471]===_0x4e892e&&_0x1cff2b===_0x36d2df&&(_0x4e13dd[_0x21f02b(0x2c0)](_0x144df8,_0x3ab97b(_0x57379d[_0x21f02b(0x26b)](_0x5bb471),_0x2db416)),_0x58b11f['setSourceName'](_0x57379d[_0x21f02b(0x26b)](_0x5bb471)));});},getDirtyColumn=(_0x1f695f,_0x3e7106,_0x2f58bb)=>{const _0x20127d=_0x273cf5;var _0x3e3e39,_0x15740a;const {arrayFormulaCellData:_0x357d01,unitData:_0x35e108}=_0x3e7106,{unitId:_0x43969c,subUnitId:_0x1cd399}=_0x2f58bb,_0x1f303d=_0x2f58bb[_0x20127d(0x36b)],{startColumn:_0x24baf3,endColumn:_0x2807e8}=_0x1f303d,_0x5a8ac3=_0x357d01===null||_0x357d01===void 0x0||(_0x3e3e39=_0x357d01[_0x43969c])===null||_0x3e3e39===void 0x0?void 0x0:_0x3e3e39[_0x1cd399],_0x4f05de=_0x35e108===null||_0x35e108===void 0x0||(_0x15740a=_0x35e108[_0x43969c])===null||_0x15740a===void 0x0?void 0x0:_0x15740a[_0x1cd399],_0x5197a4=new Set(),_0x25346c=_0x2807e8-_0x24baf3+0x1,{dirtyRanges:_0x15573d}=_0x1f695f;if(_0x15573d)for(const {range:_0x181a40,sheetId:_0x16a1b9,unitId:_0x1a3739}of _0x15573d){if(_0x16a1b9!==_0x1cd399||_0x43969c!==_0x1a3739)continue;const _0x1e90e0=_univerjs_core[_0x20127d(0x3ce)]['getIntersects'](_0x181a40,_0x1f303d);if(_0x1e90e0){const {startColumn:_0x31db49,endColumn:_0x58c240}=_0x1e90e0;for(let _0x24e7e5=_0x31db49;_0x24e7e5<=_0x58c240;_0x24e7e5++)_0x5197a4[_0x20127d(0x1dd)](_0x24e7e5);}}if(_0x5197a4['size']===_0x25346c)return Array[_0x20127d(0x463)](_0x5197a4);if(_0x5197a4['size']===_0x25346c)return Array[_0x20127d(0x463)](_0x5197a4);if(_0x4f05de){const _0x4aaaea=_0x4f05de[_0x20127d(0x2ac)](),_0x27cece=Object[_0x20127d(0x260)](_0x4aaaea);for(const _0x5654e4 of _0x27cece){const _0x32ec5a=_0x4aaaea[Number(_0x5654e4)];if(_0x5197a4['size']===_0x25346c)break;for(const _0x58f275 in _0x32ec5a){const _0xf80c9f=Number(_0x58f275);if(_0xf80c9f<_0x24baf3||_0xf80c9f>_0x2807e8)continue;_0x5197a4[_0x20127d(0x1dd)](_0xf80c9f);}}}if(_0x5a8ac3){const _0xb08dfc=_0x5a8ac3[_0x20127d(0x2ac)](),_0x4fb995=Object['keys'](_0xb08dfc);for(const _0x2cfb31 of _0x4fb995){const _0x5ce38d=_0xb08dfc[Number(_0x2cfb31)];if(_0x5197a4[_0x20127d(0x2a4)]===_0x25346c)break;for(const _0x2d308a in _0x5ce38d){const _0x5d70e1=Number(_0x2d308a);if(_0x5d70e1<_0x24baf3||_0x5d70e1>_0x2807e8)continue;_0x5197a4[_0x20127d(0x1dd)](_0x5d70e1);}}}return Array[_0x20127d(0x463)](_0x5197a4);},getUniqueRange=_0x5589b5=>{const _0x1ec076=_0x273cf5,_0x43e128=new Set(),_0xb1749b=[];for(const _0x5545a5 of _0x5589b5){const _0x54b4fc=_0x5545a5[_0x1ec076(0x3de)]+','+_0x5545a5[_0x1ec076(0x4a7)]+','+_0x5545a5[_0x1ec076(0x3ed)]+','+_0x5545a5[_0x1ec076(0x41e)];!_0x43e128[_0x1ec076(0x388)](_0x54b4fc)&&(_0x43e128[_0x1ec076(0x1dd)](_0x54b4fc),_0xb1749b[_0x1ec076(0x4e8)](_0x5545a5));}return _0xb1749b;};let PivotCalculatorController=class PivotCalculatorController extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x1b19c0,_0x5b9c14,_0x84345c,_0x564b48,_0x3770d3){const _0x5ba650=_0x273cf5;super(),this['_sheetsPivotDataSourceModel']=_0x1b19c0,this[_0x5ba650(0x299)]=_0x5b9c14,this[_0x5ba650(0x381)]=_0x84345c,this['_globalComputingSrv']=_0x564b48,this['_injector']=_0x3770d3,_defineProperty(this,_0x5ba650(0x232),new rxjs[(_0x5ba650(0x226))](!![])),_defineProperty(this,'_globalComputedStartHelpFunc',_0x4fc625=>{const _0x5578e8=_0x5ba650;this[_0x5578e8(0x232)][_0x5578e8(0x28f)](![]);}),_defineProperty(this,'_globalComputedEndHelpFunc',_0x51e187=>{const _0xaf98fc=_0x5ba650;this[_0xaf98fc(0x232)][_0xaf98fc(0x28f)](!![]);}),this[_0x5ba650(0x4b3)](),this[_0x5ba650(0x261)]();}[_0x273cf5(0x4b3)](){const _0x498f1c=_0x273cf5;this[_0x498f1c(0x21c)](),this[_0x498f1c(0x423)](),this[_0x498f1c(0x216)](),this[_0x498f1c(0x490)]();}[_0x273cf5(0x245)](){const _0x1bcdbb=_0x273cf5;this['_globalComputingSrv'][_0x1bcdbb(0x1e7)](this[_0x1bcdbb(0x232)]),_univerjs_pro_engine_pivot[_0x1bcdbb(0x3f9)][_0x1bcdbb(0x407)](_univerjs_pro_engine_pivot[_0x1bcdbb(0x250)][_0x1bcdbb(0x393)],this[_0x1bcdbb(0x43a)]),_univerjs_pro_engine_pivot[_0x1bcdbb(0x3f9)][_0x1bcdbb(0x407)](_univerjs_pro_engine_pivot[_0x1bcdbb(0x250)][_0x1bcdbb(0x2b0)],this[_0x1bcdbb(0x2d1)]);}[_0x273cf5(0x261)](){const _0x3e0aad=_0x273cf5;this[_0x3e0aad(0x399)](this['_commandService'][_0x3e0aad(0x1cc)](_0x211d8a=>{const _0x226f27=_0x3e0aad;if(_0x211d8a['id']===_univerjs_sheets[_0x226f27(0x43b)]['id'])this[_0x226f27(0x1f2)][_0x226f27(0x470)](_0x211d8a[_0x226f27(0x21f)]);})),this[_0x3e0aad(0x399)](this['_commandService'][_0x3e0aad(0x1cc)](_0x4b3fef=>{const _0x5ca5bf=_0x3e0aad;if(_0x4b3fef['id']!==GetPivotDataLocalMutation['id'])return;const _0x3def68=_0x4b3fef['params'],{unitId:_0x354343,subUnitId:_0x118742,pivotTableId:_0x6c530}=_0x3def68,_0x1a6a50=_0x3def68['params'][_0x5ca5bf(0x39c)],_0x2405c0={};switch(_0x1a6a50){case PivotDisplayDataType['Filter']:{const _0x483bc6=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x33f)];if(!_0x483bc6)return;const {row:_0x364a57,col:_0x33e3aa,cellData:_0x26cf51,pivotItemRenderInfoCache:_0x519fb0,tableFieldId:_0x38c616}=_0x483bc6,_0x146ba=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x204)](_0x3def68['pivotTableId']);if(!_0x146ba||!_0x519fb0)return;if(!_0x38c616){const _0x47aa70=getPivotCellInfo(_0x364a57,_0x33e3aa,_0x26cf51,_0x146ba,_0x519fb0),_0x277006=_0x47aa70===null||_0x47aa70===void 0x0?void 0x0:_0x47aa70[_0x5ca5bf(0x32d)];if(!_0x277006)return;const _0x5d33fe=_0x146ba['getDataFieldByTableId'](_0x277006);if(!_0x5d33fe)return;_0x2405c0[_0x5ca5bf(0x33f)]={..._0x146ba[_0x5ca5bf(0x346)](_0x5d33fe),'tableFieldId':_0x277006,'pivotTableId':_0x3def68[_0x5ca5bf(0x3d4)],'filterInfo':_0x146ba[_0x5ca5bf(0x27b)](_0x277006),'sortInfo':_0x146ba[_0x5ca5bf(0x44f)](_0x277006),'format':_0x146ba[_0x5ca5bf(0x454)](_0x277006)};}else{const _0x291027=_0x146ba[_0x5ca5bf(0x380)](_0x38c616);if(!_0x291027)return;_0x2405c0['filter']={..._0x146ba[_0x5ca5bf(0x346)](_0x291027),'tableFieldId':_0x38c616,'pivotTableId':_0x3def68[_0x5ca5bf(0x3d4)],'filterInfo':_0x146ba[_0x5ca5bf(0x27b)](_0x38c616),'sortInfo':_0x146ba[_0x5ca5bf(0x44f)](_0x38c616),'format':_0x146ba['getFieldFormat'](_0x38c616)};}}break;case PivotDisplayDataType['Panel']:{const _0x234c1d=_0x3def68[_0x5ca5bf(0x21f)]['panel'];if(!_0x234c1d)return;const {pivotTableId:_0x3cbeda}=_0x234c1d,_0xe7e4be=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x3cbeda);if(!_0xe7e4be)return;_0x2405c0['panel']=getPivotTableInfo(_0xe7e4be,_0x3cbeda,this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x3cbeda));}break;case PivotDisplayDataType['AddPivotField']:{const _0x58c345=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530),_0x5cd136=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x1f5)](_0x354343),_0x5d2dd9=_0x5cd136[_0x5ca5bf(0x22d)](_0x6c530);let _0x593221=null;const _0x21a3c4=this[_0x5ca5bf(0x1f2)]['getPivotTableConfig'](_0x354343,_0x118742,_0x6c530),_0x55e37c=_0x3def68[_0x5ca5bf(0x21f)]['addPivotField'];if(!_0x58c345||!_0x21a3c4||!_0x55e37c)return![];const {dataFieldId:_0x1c346a,fieldArea:_0x42b361,index:_0x46ba27}=_0x55e37c;_0x58c345[_0x5ca5bf(0x4e4)]();const _0x5f4821=_0x58c345[_0x5ca5bf(0x2eb)](_0x1c346a,_0x42b361,_0x46ba27);if(_0x5f4821&&_0x42b361===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3a1)]){const _0x1cfc40=_0x5f4821[_0x5ca5bf(0x368)](),_0x5101c4=_0x58c345[_0x5ca5bf(0x380)](_0x1cfc40);if(_0x5101c4){const _0x23e357=_0x5101c4===null||_0x5101c4===void 0x0?void 0x0:_0x5101c4[_0x5ca5bf(0x3d3)]();_0x58c345['setSubtotalType'](_0x5f4821[_0x5ca5bf(0x368)](),_0x23e357===_univerjs_pro_engine_pivot[_0x5ca5bf(0x2d0)]['number']?_univerjs_pro_engine_pivot[_0x5ca5bf(0x367)][_0x5ca5bf(0x2cf)]:_univerjs_pro_engine_pivot[_0x5ca5bf(0x367)][_0x5ca5bf(0x3b2)]);}const _0x164efe=_0x58c345['getValueIndex'](),_0x5f06c3=_0x58c345[_0x5ca5bf(0x1ee)](),_0x4681c4=_0x58c345[_0x5ca5bf(0x347)](_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)]['Value']);if(_0x164efe===-0x1&&_0x4681c4>0x1){const _0x38b955=_0x5f06c3===_univerjs_pro_engine_pivot['PivotTableValuePositionEnum']['None']?_univerjs_pro_engine_pivot['PivotTableValuePositionEnum'][_0x5ca5bf(0x20b)]:_0x5f06c3,_0x44e75e=_0x38b955===_univerjs_pro_engine_pivot[_0x5ca5bf(0x44d)][_0x5ca5bf(0x3ec)]?_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)]['Row']:_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x20b)];_0x58c345['updateValuePosition'](_0x38b955,_0x58c345[_0x5ca5bf(0x347)](_0x44e75e));}}else{if(_0x5f4821&&(_0x42b361===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)]['Row']||_0x42b361===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)]['Column'])){const _0x383121=_0x5f4821[_0x5ca5bf(0x368)](),_0x404d00=_0x58c345[_0x5ca5bf(0x380)](_0x383121);if(_0x404d00){if((_0x404d00===null||_0x404d00===void 0x0?void 0x0:_0x404d00[_0x5ca5bf(0x3d3)]())===_univerjs_pro_engine_pivot[_0x5ca5bf(0x2d0)][_0x5ca5bf(0x3a8)]){const _0x1ebd79=_0x404d00[_0x5ca5bf(0x25e)]();if(_0x1ebd79)_0x58c345[_0x5ca5bf(0x366)](_0x5f4821['getId'](),_0x1ebd79);if(!_0x5d2dd9[_0x5ca5bf(0x4d4)]()[_0x5ca5bf(0x354)](_0x2a5954=>{const _0x372776=_0x5ca5bf,_0x261467=_0x5d2dd9['getFieldById'](_0x2a5954);if((0x0,_univerjs_pro_engine_pivot[_0x372776(0x2da)])(_0x261467))return _0x261467[_0x372776(0x224)]()[_0x372776(0x459)]===_0x1c346a;return![];})){const _0x3e3616=_0x5cd136['createDataFieldId'](),_0x351bce=findCommonDateType(_0x404d00['maxDate'],_0x404d00[_0x5ca5bf(0x426)]),_0x3bfeba=_0x404d00[_0x5ca5bf(0x416)]()+_0x5ca5bf(0x25f)+getDateGroupName(this[_0x5ca5bf(0x24c)],_0x351bce),_0x2337a4=new _univerjs_pro_engine_pivot[(_0x5ca5bf(0x2af))](_0x3e3616,_0x3bfeba,(0x0,_univerjs_pro_engine_pivot['generateHexNumber'])(0x3),_0x404d00[_0x5ca5bf(0x368)](),_0x351bce);_0x5cd136[_0x5ca5bf(0x3ee)](_0x2337a4),_0x5d2dd9[_0x5ca5bf(0x3e5)](_0x3e3616,_0x3bfeba),_0x58c345[_0x5ca5bf(0x2eb)](_0x3e3616,_0x42b361,(_0x46ba27!==null&&_0x46ba27!==void 0x0?_0x46ba27:0x0)+0x1),_0x593221=_0x2337a4;}}}}}const _0x5a573b=_0x58c345['isEmpty'](),_0x431d85=_0x58c345[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)]();let _0x11cee9;if(_0x593221){_0x11cee9=_0x593221[_0x5ca5bf(0x480)]();const _0x1d9f15=_0x593221['getId']();_0x5d2dd9['deleteField'](_0x1d9f15);let _0x3f99f7=!![];for(const _0xb4029f in _0x5cd136[_0x5ca5bf(0x3d8)])if(_0x5cd136[_0x5ca5bf(0x3d8)][_0xb4029f][_0x5ca5bf(0x4d4)]()['includes'](_0x1d9f15)){_0x3f99f7=![];break;}if(_0x3f99f7)_0x5cd136['deleteDataField'](_0x1d9f15);}_0x2405c0[_0x5ca5bf(0x427)]={'view':_0x431d85,'changesets':_0x58c345[_0x5ca5bf(0x3b3)](),'isEmpty':_0x5a573b,'pivotTableConfig':_0x21a3c4,'shouldBeAddedGroupJSON':_0x11cee9};}break;case PivotDisplayDataType['AddPivotTable']:{const _0x3f0f24=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x3a9)];if(!_0x3f0f24)return;const _0x3ab58e=_0x3f0f24['sourceRangeInfo'],_0x229cb7=_0x3f0f24[_0x5ca5bf(0x3d4)],{collection:_0x2c23bb}=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x1f0)]({'unitId':_0x3ab58e[_0x5ca5bf(0x452)],'sheetName':_0x3ab58e[_0x5ca5bf(0x1d4)],'subUnitId':_0x3ab58e[_0x5ca5bf(0x23b)],'range':_0x3ab58e[_0x5ca5bf(0x36b)]}),_0x3a1f26=new _univerjs_pro_engine_pivot[(_0x5ca5bf(0x3f9))](_0x2c23bb,void 0x0,_0x229cb7);_0x2405c0[_0x5ca5bf(0x3a9)]={'view':_0x3a1f26['query'](),'fieldsConfig':_0x3a1f26['toJSON'](),'collectionConfig':_0x2c23bb[_0x5ca5bf(0x480)](),'isEmpty':_0x3a1f26[_0x5ca5bf(0x443)]()};}break;case PivotDisplayDataType[_0x5ca5bf(0x229)]:{const _0x147565=_0x3def68['params'][_0x5ca5bf(0x360)];if(!_0x147565)return;const {fieldId:_0x2ef4c1,area:_0x197875,index:_0x5d1f4a}=_0x147565,_0xa407c4=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x6c530);if(!_0xa407c4)return;const _0x52820e=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530);if(!_0x52820e)return;_0x52820e[_0x5ca5bf(0x4e4)]();const {area:_0x20631f,index:_0x534c03}=_0x52820e[_0x5ca5bf(0x484)](_0x2ef4c1);_0x52820e[_0x5ca5bf(0x3c1)](_0x2ef4c1,_0x197875,_0x5d1f4a);if(_0x197875===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3a1)]&&_0x52820e[_0x5ca5bf(0x46c)](_0x2ef4c1)['getSubtotal']()===void 0x0){const _0x49110f=_0x52820e[_0x5ca5bf(0x46c)](_0x2ef4c1);if(_0x49110f&&_0x49110f[_0x5ca5bf(0x2e8)]()===void 0x0){const _0x2f35d5=_0x52820e[_0x5ca5bf(0x380)](_0x2ef4c1);if(_0x2f35d5){const _0x5b8e38=_0x2f35d5===null||_0x2f35d5===void 0x0?void 0x0:_0x2f35d5[_0x5ca5bf(0x3d3)]();_0x52820e['setSubtotalType'](_0x2ef4c1,_0x5b8e38===_univerjs_pro_engine_pivot['PivotDataFieldDataTypeEnum'][_0x5ca5bf(0x1f1)]?_univerjs_pro_engine_pivot['PivotSubtotalTypeEnum']['sum']:_univerjs_pro_engine_pivot[_0x5ca5bf(0x367)][_0x5ca5bf(0x3b2)]);}}}const _0x420466=_0x52820e[_0x5ca5bf(0x1ee)](),_0x2d687d=_0x52820e[_0x5ca5bf(0x2fe)](),_0x3c3fc6=_0x52820e['getFieldCountByArea'](_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3a1)])>0x1;if(_0x3c3fc6&&_0x20631f===_0x197875&&(_0x197875===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3ec)]&&_0x420466===_univerjs_pro_engine_pivot[_0x5ca5bf(0x44d)][_0x5ca5bf(0x3ec)]||_0x197875===_univerjs_pro_engine_pivot['PivotTableFiledAreaEnum'][_0x5ca5bf(0x20b)]&&_0x420466===_univerjs_pro_engine_pivot[_0x5ca5bf(0x44d)][_0x5ca5bf(0x20b)])){let _0xa4182a=_0x2d687d;if(_0x534c03<=_0x2d687d)_0xa4182a--;if(_0x5d1f4a<=_0x2d687d)_0xa4182a++;_0x52820e['updateValuePosition'](_0x420466,_0xa4182a);}else{if(_0x3c3fc6&&(_0x20631f===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3ec)]&&_0x420466===_univerjs_pro_engine_pivot[_0x5ca5bf(0x44d)][_0x5ca5bf(0x3ec)]||_0x20631f===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x20b)]&&_0x420466===_univerjs_pro_engine_pivot['PivotTableValuePositionEnum']['Column'])){if(_0x2d687d>=_0x534c03)_0x52820e[_0x5ca5bf(0x498)](_0x420466,_0x2d687d-0x1);}if(_0x3c3fc6&&(_0x197875===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)]['Row']&&_0x420466===_univerjs_pro_engine_pivot[_0x5ca5bf(0x44d)]['Row']||_0x197875===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x20b)]&&_0x420466===_univerjs_pro_engine_pivot[_0x5ca5bf(0x44d)][_0x5ca5bf(0x20b)])){if(_0x2d687d>=_0x5d1f4a)_0x52820e[_0x5ca5bf(0x498)](_0x420466,_0x2d687d+0x1);}}const _0x38dbe5=_0x52820e[_0x5ca5bf(0x4e5)](),_0x500482=_0x52820e['isEmpty'](),_0x4050f8=_0x52820e[_0x5ca5bf(0x3b3)]();_0x2405c0[_0x5ca5bf(0x360)]={'view':_0x38dbe5[_0x5ca5bf(0x480)](),'changesets':_0x4050f8,'isEmpty':_0x500482,'pivotTableConfig':_0xa407c4};}break;case PivotDisplayDataType[_0x5ca5bf(0x397)]:{const _0x5acdc7=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x453)];if(!_0x5acdc7)return;const _0x1bf9fe=_0x5acdc7['fieldIds'],_0x14edb6=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x6c530);if(!_0x14edb6)return![];const _0x260f77=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530);if(!_0x260f77)return![];_0x260f77[_0x5ca5bf(0x4e4)]();for(const _0x3efc02 of _0x1bf9fe){const {area:_0x81db88}=_0x260f77[_0x5ca5bf(0x484)](_0x3efc02);if(_0x81db88===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3a1)])_0x260f77[_0x5ca5bf(0x4ed)](_0x3efc02);if(_0x81db88===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)]['Row']||_0x81db88===_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x20b)])_0x260f77[_0x5ca5bf(0x3be)](_0x3efc02);_0x260f77[_0x5ca5bf(0x1cd)](_0x3efc02);}const _0x2b798c=_0x260f77[_0x5ca5bf(0x443)](),_0x591581=_0x260f77[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)]();_0x2405c0['removePivotField']={'changesets':_0x260f77[_0x5ca5bf(0x3b3)](),'pivotTableConfig':_0x14edb6,'isEmpty':_0x2b798c,'view':_0x591581};}break;case PivotDisplayDataType[_0x5ca5bf(0x4a8)]:{const _0x26e12c=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x411)];if(!_0x26e12c)return;const {tableFieldId:_0x4b8418,items:_0x43c5cc,isAll:_0xc31643}=_0x26e12c,_0x1a68e5=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530),_0x18fcf4=this['_sheetsPivotDataSourceModel']['getPivotTableConfig'](_0x354343,_0x118742,_0x6c530);if(!_0x1a68e5||!_0x18fcf4)return;_0x1a68e5[_0x5ca5bf(0x4e4)](),_0x1a68e5[_0x5ca5bf(0x392)](_0x4b8418,{'type':_univerjs_pro_engine_pivot['PivotFilterTypeEnum'][_0x5ca5bf(0x3d0)],'list':_0x43c5cc,'isAll':_0xc31643});const _0x18a0f3=_0x1a68e5[_0x5ca5bf(0x443)]();_0x2405c0[_0x5ca5bf(0x411)]={'view':_0x1a68e5[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)](),'changesets':_0x1a68e5[_0x5ca5bf(0x3b3)](),'isEmpty':_0x18a0f3,'pivotTableConfig':_0x18fcf4};}break;case PivotDisplayDataType[_0x5ca5bf(0x1df)]:{const _0x273e9d=_0x3def68['params'][_0x5ca5bf(0x2bc)];if(!_0x273e9d)return;const {tableFieldId:_0x41a657,filterInfo:_0x27548e}=_0x273e9d,_0x3f9796=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530),_0x37da09=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x6c530);if(!_0x3f9796||!_0x37da09)return;_0x3f9796[_0x5ca5bf(0x4e4)](),_0x3f9796['setValueFilterInfo'](_0x41a657,_0x27548e);const _0x329fbd=_0x3f9796['isEmpty']();_0x2405c0['setValuePivotFilter']={'view':_0x3f9796[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)](),'changesets':_0x3f9796[_0x5ca5bf(0x3b3)](),'isEmpty':_0x329fbd,'pivotTableConfig':_0x37da09};}break;case PivotDisplayDataType[_0x5ca5bf(0x3a5)]:{const _0x1ab36f=_0x3def68[_0x5ca5bf(0x21f)]['setPivotSort'];if(!_0x1ab36f)return;const {tableFieldId:_0x4b3e3a,info:_0x1ec6c6}=_0x1ab36f,_0xd4c02b=this[_0x5ca5bf(0x1f2)]['getPivotTableInstance'](_0x6c530),_0x1f3162=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x6c530);if(!_0xd4c02b||!_0x1f3162)return;_0xd4c02b[_0x5ca5bf(0x4e4)](),_0xd4c02b[_0x5ca5bf(0x2fd)](_0x4b3e3a,_0x1ec6c6);const _0x2279a6=_0xd4c02b[_0x5ca5bf(0x443)]();_0x2405c0[_0x5ca5bf(0x422)]={'view':_0xd4c02b[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)](),'changesets':_0xd4c02b[_0x5ca5bf(0x3b3)](),'isEmpty':_0x2279a6,'pivotTableConfig':_0x1f3162};}break;case PivotDisplayDataType[_0x5ca5bf(0x3cf)]:{const _0x21d3be=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x421)];if(!_0x21d3be)return;const {tableFieldId:_0x2040fb,displayName:_0xf1a4e4,subtotalType:_0x16c33d,format:_0x4495af}=_0x21d3be,_0x43b3dd=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x204)](_0x6c530),_0xec1bd6=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x6c530);if(!_0x43b3dd||!_0xec1bd6)return;_0x43b3dd[_0x5ca5bf(0x4e4)]();if(_0xf1a4e4!==void 0x0)_0x43b3dd[_0x5ca5bf(0x2c0)](_0x2040fb,_0xf1a4e4);if(_0x16c33d!==void 0x0)_0x43b3dd[_0x5ca5bf(0x4e9)](_0x2040fb,_0x16c33d);if(_0x4495af!==void 0x0)_0x43b3dd['setFieldFormat'](_0x2040fb,_0x4495af);const _0x3e9bae=_0x43b3dd['isEmpty'](),_0x1a0f2b=_0x43b3dd['query']()['toJSON']();_0x2405c0[_0x5ca5bf(0x421)]={'changesets':_0x43b3dd[_0x5ca5bf(0x3b3)](),'pivotTableConfig':_0xec1bd6,'isEmpty':_0x3e9bae,'view':_0x1a0f2b};}break;case PivotDisplayDataType[_0x5ca5bf(0x375)]:{const _0x4b2878=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x3c7)];if(!_0x4b2878)return;const {dataRangeInfo:_0x30e740,unitId:_0x5a337b,subUnitId:_0x3cbbf4}=_0x4b2878,_0x1337a3=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x4b0)](_0x5a337b,_0x3cbbf4,_0x6c530),_0x34c00e=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530);if(!this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x22d)](_0x5a337b,_0x6c530))return;if(!_0x34c00e||!_0x1337a3)return;const _0x52101a=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x35a)](_0x5a337b,_0x6c530,_0x30e740),_0x3f07d8=this[_0x5ca5bf(0x1f2)]['getCollection'](_0x5a337b,_0x6c530)[_0x5ca5bf(0x480)](),{collection:_0xdb6a90}=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x1f0)]({'unitId':_0x30e740['unitId'],'sheetName':_0x30e740[_0x5ca5bf(0x1d4)],'subUnitId':_0x30e740[_0x5ca5bf(0x23b)],'range':_0x30e740[_0x5ca5bf(0x36b)]}),_0x5b68de=_0xdb6a90[_0x5ca5bf(0x480)]();_0x34c00e[_0x5ca5bf(0x4e4)]();const _0x59107d=this[_0x5ca5bf(0x1f2)]['getDataFieldManager'](_0x5a337b)['getAutoDisplayNameFunction']()||_univerjs_pro_engine_pivot[_0x5ca5bf(0x419)];_0x34c00e[_0x5ca5bf(0x361)](_0x1f5015=>{const _0x5db408=_0x5ca5bf,_0x429322=_0x1f5015[_0x5db408(0x4a2)]();if(!_0xdb6a90[_0x5db408(0x333)](_0x429322)){const _0x3eae9f=_0xdb6a90[_0x5db408(0x3a3)](_0x1f5015[_0x5db408(0x32c)]());if(_0x3eae9f){_0x34c00e[_0x5db408(0x49d)](_0x1f5015[_0x5db408(0x368)](),_0x3eae9f[_0x5db408(0x416)](),_0x3eae9f['getId']());const {area:_0x267835}=_0x34c00e[_0x5db408(0x484)](_0x1f5015[_0x5db408(0x368)]());let _0x4ae5f6=_0x1f5015[_0x5db408(0x32c)]();const _0x50db41=_0x1f5015[_0x5db408(0x26b)]();if(_0x267835===_univerjs_pro_engine_pivot[_0x5db408(0x37d)]['Value']){const _0x472bb7=_0x1f5015['getSubtotal']();_0x4ae5f6=_0x59107d(_0x3eae9f['getName'](),_0x472bb7);}if(_0x50db41!==_0x4ae5f6)_0x34c00e[_0x5db408(0x2c0)](_0x1f5015[_0x5db408(0x368)](),_0x4ae5f6);}else _0x34c00e[_0x5db408(0x1cd)](_0x1f5015['getId']());}});const _0x5de67d=_0x34c00e[_0x5ca5bf(0x443)]();_0x2405c0['updatePivotSource']={'view':_0x34c00e[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)](),'changesets':_0x34c00e['endCollectChangeset'](),'isEmpty':_0x5de67d,'pivotTableConfig':_0x1337a3,'collectionConfig':_0x5b68de,'oldCollectionConfig':_0x3f07d8,'deleteIds':_0x52101a};}break;case PivotDisplayDataType[_0x5ca5bf(0x1e0)]:{const _0x8da70b=_0x3def68['params'][_0x5ca5bf(0x498)];if(!_0x8da70b)return;const {position:_0x187772,index:_0x27ae0d}=_0x8da70b,_0x5b4bc1=this['_sheetsPivotDataSourceModel']['getPivotTableConfig'](_0x354343,_0x118742,_0x6c530);if(!_0x5b4bc1)return![];const _0x182b25=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x204)](_0x6c530);if(!_0x182b25)return![];_0x182b25['startCollectChangeset'](),_0x182b25['updateValuePosition'](_0x187772,_0x27ae0d);const _0x20a28d=_0x182b25['isEmpty'](),_0x284fde=_0x182b25[_0x5ca5bf(0x4e5)]()[_0x5ca5bf(0x480)]();_0x2405c0['updateValuePosition']={'changesets':_0x182b25[_0x5ca5bf(0x3b3)](),'pivotTableConfig':_0x5b4bc1,'isEmpty':_0x20a28d,'view':_0x284fde};}break;case PivotDisplayDataType[_0x5ca5bf(0x313)]:{const _0x1e4ea8=_0x3def68['params'][_0x5ca5bf(0x2ba)];if(!_0x1e4ea8)return;const {tableFieldId:_0x33b33a,collapse:_0x5916d6,item:_0x45a523}=_0x1e4ea8,_0xb92d1=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530),_0x4b8609=this['_sheetsPivotDataSourceModel'][_0x5ca5bf(0x4b0)](_0x354343,_0x118742,_0x6c530);if(!_0xb92d1||!_0x4b8609)return;_0xb92d1[_0x5ca5bf(0x4e4)](),_0xb92d1[_0x5ca5bf(0x36a)](_0x33b33a,_0x5916d6,_0x45a523);const _0x12836b=_0xb92d1[_0x5ca5bf(0x443)]();_0x2405c0['setPivotCollapse']={'view':_0xb92d1['query']()[_0x5ca5bf(0x480)](),'isEmpty':_0x12836b,'pivotTableConfig':_0x4b8609,'changesets':_0xb92d1['endCollectChangeset']()};}break;case PivotDisplayDataType[_0x5ca5bf(0x3eb)]:{const _0x37674e=_0x3def68['params'][_0x5ca5bf(0x3b9)];if(!_0x37674e)return;const {pivotTableConfig:_0x5d551f}=_0x37674e,_0x3e88b5=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530),_0x375609=this[_0x5ca5bf(0x1f2)]['getPivotTableConfig'](_0x354343,_0x118742,_0x6c530);if(!_0x3e88b5||!_0x375609)return;_0x3e88b5[_0x5ca5bf(0x4e4)](),setConfigToPivotTable(_0x3e88b5,_0x5d551f);const _0x4e40e9=_0x3e88b5['isEmpty'](),_0x17d59e=_0x3e88b5[_0x5ca5bf(0x4e5)]()['toJSON'](),_0x219d2c=_0x3e88b5['endCollectChangeset']();_0x2405c0[_0x5ca5bf(0x3b9)]={'view':_0x17d59e,'isEmpty':_0x4e40e9,'pivotTableConfig':{..._0x375609,'fieldsConfig':_0x3e88b5[_0x5ca5bf(0x480)]()},'changesets':_0x219d2c};}break;case PivotDisplayDataType[_0x5ca5bf(0x29e)]:{const _0x405d8a=_0x3def68[_0x5ca5bf(0x21f)][_0x5ca5bf(0x207)];if(!_0x405d8a)return;const _0x4b4f77=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x204)](_0x6c530),_0x32111c=this[_0x5ca5bf(0x1f2)]['getPivotTableConfig'](_0x354343,_0x118742,_0x6c530);if(!_0x4b4f77||!_0x32111c)return;_0x4b4f77[_0x5ca5bf(0x4e4)](),resetPivotTable(_0x4b4f77,_0x405d8a[_0x5ca5bf(0x43f)]);const _0x122e97=_0x4b4f77[_0x5ca5bf(0x4e5)]()['toJSON'](),_0x88fd4f=_0x4b4f77['endCollectChangeset']();_0x2405c0['resetPivotTable']={'view':_0x122e97,'isEmpty':!![],'pivotTableConfig':{..._0x32111c,'fieldsConfig':_0x4b4f77[_0x5ca5bf(0x480)]()},'changesets':_0x88fd4f};}break;case PivotDisplayDataType['AddPivotTableWithConfig']:{const _0xb914d5=_0x3def68['params'][_0x5ca5bf(0x379)];if(!_0xb914d5)return;const _0x4cce39=_0xb914d5[_0x5ca5bf(0x3f5)],_0x34761f=_0xb914d5[_0x5ca5bf(0x3d4)],{collection:_0x31510c}=this[_0x5ca5bf(0x1f2)][_0x5ca5bf(0x1f0)]({'unitId':_0x4cce39[_0x5ca5bf(0x452)],'sheetName':_0x4cce39[_0x5ca5bf(0x1d4)],'subUnitId':_0x4cce39[_0x5ca5bf(0x23b)],'range':_0x4cce39[_0x5ca5bf(0x36b)]}),_0xbfb7a4=new _univerjs_pro_engine_pivot[(_0x5ca5bf(0x3f9))](_0x31510c,void 0x0,_0x34761f),_0x4a41cc=_0x31510c[_0x5ca5bf(0x4d4)](),{rows:_0x4e735e,columns:_0x58b270,filters:_0x20045e,values:_0x4d2e1d}=_0xb914d5[_0x5ca5bf(0x34f)];_0xbfb7a4[_0x5ca5bf(0x4e4)]();for(const {field:_0xc06f78,selectedItems:_0x2dd602}of _0x4e735e||[]){const _0x4fb1a0=_0x4a41cc[_0xc06f78];if(_0x4fb1a0){const _0x5dae3a=_0xbfb7a4['addFieldWithSourceId'](_0x4fb1a0,_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3ec)]);if(_0x2dd602&&_0x5dae3a)_0xbfb7a4[_0x5ca5bf(0x392)](_0x5dae3a[_0x5ca5bf(0x368)](),{'type':_univerjs_pro_engine_pivot[_0x5ca5bf(0x369)]['ManualFilter'],'list':_0x2dd602,'isAll':![]});}}for(const {field:_0x129b31,selectedItems:_0x4beaa2}of _0x58b270||[]){const _0x46843d=_0x4a41cc[_0x129b31];if(_0x46843d){const _0x138fea=_0xbfb7a4[_0x5ca5bf(0x2eb)](_0x46843d,_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x20b)]);if(_0x4beaa2&&_0x138fea)_0xbfb7a4[_0x5ca5bf(0x392)](_0x138fea[_0x5ca5bf(0x368)](),{'type':_univerjs_pro_engine_pivot[_0x5ca5bf(0x369)]['ManualFilter'],'list':_0x4beaa2,'isAll':![]});}}for(const {field:_0x40f1d1,selectedItems:_0x241f57}of _0x20045e||[]){const _0x381a01=_0x4a41cc[_0x40f1d1];if(_0x381a01){const _0x33f2d6=_0xbfb7a4['addFieldWithSourceId'](_0x381a01,_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x390)]);if(_0x241f57&&_0x33f2d6)_0xbfb7a4[_0x5ca5bf(0x392)](_0x33f2d6[_0x5ca5bf(0x368)](),{'type':_univerjs_pro_engine_pivot[_0x5ca5bf(0x369)]['ManualFilter'],'list':_0x241f57,'isAll':![]});}}for(const {field:_0x309363,subTotalType:_0x3188b0,formatString:_0x31d647}of _0x4d2e1d||[]){const _0x15f487=_0x31510c[_0x5ca5bf(0x286)](_0x4a41cc[_0x309363]);if(!_0x15f487)continue;const _0x491868=_0x4a41cc[_0x309363];if(_0x491868){const _0x3b89c2=_0xbfb7a4[_0x5ca5bf(0x2eb)](_0x491868,_univerjs_pro_engine_pivot[_0x5ca5bf(0x37d)][_0x5ca5bf(0x3a1)]);if(_0x3b89c2){if(_0x3188b0!==void 0x0){_0xbfb7a4[_0x5ca5bf(0x4e9)](_0x3b89c2[_0x5ca5bf(0x368)](),_0x3188b0);const _0x628ab7=(this[_0x5ca5bf(0x1f2)]['getDataFieldManager'](_0x4cce39[_0x5ca5bf(0x452)])['getAutoDisplayNameFunction']()||_univerjs_pro_engine_pivot[_0x5ca5bf(0x419)])(_0x31510c[_0x5ca5bf(0x26b)](_0x491868),_0x3188b0);_0xbfb7a4[_0x5ca5bf(0x2c0)](_0x3b89c2[_0x5ca5bf(0x368)](),_0x628ab7);}else{if(_0x15f487){const _0x2e9ade=_0x15f487===null||_0x15f487===void 0x0?void 0x0:_0x15f487[_0x5ca5bf(0x3d3)]();_0xbfb7a4[_0x5ca5bf(0x4e9)](_0x3b89c2[_0x5ca5bf(0x368)](),_0x2e9ade===_univerjs_pro_engine_pivot[_0x5ca5bf(0x2d0)][_0x5ca5bf(0x1f1)]?_univerjs_pro_engine_pivot[_0x5ca5bf(0x367)][_0x5ca5bf(0x2cf)]:_univerjs_pro_engine_pivot[_0x5ca5bf(0x367)][_0x5ca5bf(0x3b2)]);}}if(_0x31d647)_0xbfb7a4[_0x5ca5bf(0x366)](_0x3b89c2['getId'](),_0x31d647);}}}const _0x530909=_0xbfb7a4[_0x5ca5bf(0x4e5)](),_0x49d1f0=_0xbfb7a4[_0x5ca5bf(0x480)](),_0x51a0de=_0xbfb7a4[_0x5ca5bf(0x443)](),_0x56302a=_0xbfb7a4[_0x5ca5bf(0x3b3)]();_0x2405c0[_0x5ca5bf(0x379)]={'view':_0x530909,'fieldsConfig':_0x49d1f0,'collectionConfig':_0x31510c[_0x5ca5bf(0x480)](),'isEmpty':_0x51a0de,'changesets':_0x56302a};}break;case PivotDisplayDataType[_0x5ca5bf(0x3dd)]:{const _0x4f42f0=getPivotDrillDownData(this[_0x5ca5bf(0x24c)],_0x3def68);if(!_0x4f42f0)return;const {range:_0x362be6,sourceSubUnitId:_0x199c88,sourceUnitId:_0x27ef47,formatMap:_0x14fa08,indexes:_0x3ccbfb}=_0x4f42f0;_0x2405c0[_0x5ca5bf(0x4f2)]={'range':_0x362be6,'sourceSubUnitId':_0x199c88,'sourceUnitId':_0x27ef47,'formatMap':_0x14fa08,'indexes':_0x3ccbfb};}break;}this[_0x5ca5bf(0x381)]['executeCommand'](SendPivotDataLocalMutation['id'],{'version':_0x3def68[_0x5ca5bf(0x3a0)],'result':_0x2405c0},{'onlyLocal':!![]});}));}[_0x273cf5(0x216)](){const _0x287b52=_0x273cf5;this[_0x287b52(0x399)](this[_0x287b52(0x381)][_0x287b52(0x1cc)](_0x3c00ec=>{const _0x3e792d=_0x287b52;if(_0x3c00ec['id']!==SendInitPivotTextLocalMutation['id'])return;const _0x2e13a6=_0x3c00ec[_0x3e792d(0x21f)];return this['_sheetsPivotDataSourceModel'][_0x3e792d(0x4ee)](_0x2e13a6[_0x3e792d(0x4b4)]),!![];}));}['_subjectCollectionChange'](){const _0x586472=_0x273cf5;this[_0x586472(0x1f2)][_0x586472(0x3f7)][_0x586472(0x46a)](_0x35f88e=>{const _0x51280b=_0x586472;switch(_0x35f88e[_0x51280b(0x39c)]){case CollectionChangeEnum[_0x51280b(0x1dd)]:if(_0x35f88e[_0x51280b(0x280)]&&_0x35f88e[_0x51280b(0x1db)])this['handleSourceRangeChange'](_0x35f88e[_0x51280b(0x4a0)],_0x35f88e[_0x51280b(0x280)],_0x35f88e[_0x51280b(0x1db)]);break;case CollectionChangeEnum[_0x51280b(0x33d)]:{const {unitId:_0x48d298,subUnitId:_0x39d89e,token:_0x4f5a45}=_0x35f88e;if(_0x48d298&&_0x39d89e&&_0x4f5a45)this[_0x51280b(0x497)](_0x48d298,_0x39d89e,_0x4f5a45);}break;case CollectionChangeEnum[_0x51280b(0x43d)]:{const {token:_0x4908d3,oldSourceRangeInfo:_0xe425b7,dataRangeInfo:_0xb719a6,targetCellInfo:_0x20bd26}=_0x35f88e,{unitId:_0x577a02,subUnitId:_0x78f6f3}=_0xe425b7||{};if(_0x577a02&&_0x78f6f3&&_0x4908d3)this[_0x51280b(0x497)](_0x577a02,_0x78f6f3,_0x4908d3);if(_0xb719a6&&_0x20bd26)this[_0x51280b(0x4f1)](_0x4908d3,_0xb719a6,_0x20bd26);}break;}});}[_0x273cf5(0x490)](){const _0x15a92d=_0x273cf5;this[_0x15a92d(0x1f2)][_0x15a92d(0x409)][_0x15a92d(0x46a)](_0x3053f7=>{const _0xc1ca4d=_0x15a92d;Object[_0xc1ca4d(0x260)](_0x3053f7)[_0xc1ca4d(0x24b)](_0xcda10f=>{const _0x31ec62=_0xc1ca4d,_0x33bff2=this[_0x31ec62(0x1f2)][_0x31ec62(0x25d)](_0xcda10f);if(_0x33bff2){const _0xe88556=this[_0x31ec62(0x1f2)]['getPivotTableConfig'](_0x33bff2===null||_0x33bff2===void 0x0?void 0x0:_0x33bff2[_0x31ec62(0x452)],_0x33bff2===null||_0x33bff2===void 0x0?void 0x0:_0x33bff2[_0x31ec62(0x23b)],_0xcda10f);_0xe88556&&(this[_0x31ec62(0x4f1)](_0xcda10f,_0xe88556[_0x31ec62(0x3f5)],_0xe88556[_0x31ec62(0x1db)]),this[_0x31ec62(0x26c)]([{'unitId':_0x33bff2[_0x31ec62(0x452)],'subUnitId':_0x33bff2[_0x31ec62(0x23b)],'token':_0xcda10f}]));}});});}[_0x273cf5(0x423)](){const _0x19fd10=_0x273cf5;this[_0x19fd10(0x1f2)][_0x19fd10(0x2a5)][_0x19fd10(0x46a)](_0x39178f=>{const _0x49f473=_0x19fd10,{unitId:_0x7b3a3f,subUnitId:_0x4fbda4,pivotTableId:_0x103563}=_0x39178f;if(_0x7b3a3f&&_0x4fbda4&&_0x103563)this[_0x49f473(0x26c)]([{'unitId':_0x7b3a3f,'subUnitId':_0x4fbda4,'token':_0x103563}]);});}['triggerDirtyFeature'](_0x2a1651){const _0x4fa246=_0x273cf5,_0x54e5b3={};_0x2a1651[_0x4fa246(0x24b)](_0x22a729=>{var _0x4242fc,_0x103a48;const {unitId:_0x4c4a31,subUnitId:_0x2538fb,token:_0x16d97c}=_0x22a729;_0x54e5b3[_0x4c4a31]=(_0x4242fc=_0x54e5b3[_0x4c4a31])!==null&&_0x4242fc!==void 0x0?_0x4242fc:{},_0x54e5b3[_0x4c4a31][_0x2538fb]=(_0x103a48=_0x54e5b3[_0x4c4a31][_0x2538fb])!==null&&_0x103a48!==void 0x0?_0x103a48:{},_0x54e5b3[_0x4c4a31][_0x2538fb][_0x16d97c]=!![];}),this['_commandService'][_0x4fa246(0x39a)](PivotTableViewDirtyMarkOperation['id'],_0x54e5b3);}[_0x273cf5(0x497)](_0x564d2e,_0x2336e1,_0x208d5e){const _0x485812=_0x273cf5;this[_0x485812(0x299)][_0x485812(0x420)](_0x564d2e,_0x2336e1,[_0x208d5e]);}['handleSourceRangeChange'](_0x1beba7,_0x1ebe20,_0x36f07f){const _0x6d6482=_0x273cf5,{unitId:_0x35ae1e,subUnitId:_0x56940f}=_0x1ebe20;if(this[_0x6d6482(0x299)][_0x6d6482(0x388)](_0x36f07f[_0x6d6482(0x452)],_0x36f07f[_0x6d6482(0x23b)],_0x1beba7))this[_0x6d6482(0x497)](_0x35ae1e,_0x56940f,_0x1beba7);const _0x112f86={'sheetId':_0x56940f,..._0x1ebe20};this['_featureCalculationManagerService'][_0x6d6482(0x323)](_0x36f07f[_0x6d6482(0x452)],_0x36f07f[_0x6d6482(0x23b)],_0x1beba7,{'unitId':_0x36f07f[_0x6d6482(0x452)],'subUnitId':_0x36f07f[_0x6d6482(0x23b)],'dependencyRanges':[_0x112f86],'getDirtyData':(_0x590c66,_0xd050c8)=>{const _0x35040b=_0x6d6482,_0x8b7567=this['_sheetsPivotDataSourceModel'],_0x227624=_0x8b7567[_0x35040b(0x25d)](_0x1beba7);if(!_0x227624)return getEmptyPivotDirtyViewInfo();const {unitId:_0xb419d3,subUnitId:_0x101295}=_0x227624,_0x488f39=getDirtyColumn(_0x590c66,_0xd050c8,_0x1ebe20);if(_0x488f39[_0x35040b(0x36f)]>0x0){const _0x1d9aef=_0x8b7567[_0x35040b(0x22d)](_0x35ae1e,_0x1beba7),_0x3c70ea=_0x1d9aef[_0x35040b(0x4d4)](),_0x529699=this[_0x35040b(0x402)](_0x1ebe20[_0x35040b(0x452)],_0x1ebe20[_0x35040b(0x23b)],_0xd050c8),_0x32926e={},_0x22f062=this['_sheetsPivotDataSourceModel'][_0x35040b(0x1f5)](_0xb419d3)[_0x35040b(0x322)]()||_univerjs_pro_engine_pivot[_0x35040b(0x419)],_0x465835=[];for(const _0x2283cc of _0x488f39){const _0x4ed167=_0x2283cc-(_0x1ebe20[_0x35040b(0x36b)][_0x35040b(0x3ed)]||0x0),_0x9997ba=_0x3c70ea[_0x4ed167];_0x465835['push'](_0x9997ba),_0x32926e[_0x9997ba]=_0x1d9aef['getFieldById'](_0x9997ba)[_0x35040b(0x416)](),_0x8b7567[_0x35040b(0x1f5)](_0x35ae1e)[_0x35040b(0x4d3)](_0x9997ba,_0x1ebe20,_0x4ed167,_0x529699);}_0x1d9aef[_0x35040b(0x39b)](_0x465835)[_0x35040b(0x24b)](_0xd9591f=>{const _0x5459fd=_0x35040b,[_0x3851f2,_0x4d8754]=_0xd9591f,_0xd7de4a=_0x1d9aef['getFieldById'](_0x3851f2),_0x45bd8a=_0x1d9aef[_0x5459fd(0x286)](_0x4d8754);if(_0xd7de4a&&_0x45bd8a)_0xd7de4a[_0x5459fd(0x2f2)](_0x45bd8a);}),_0x1d9aef['updateAllDisplayName']();const _0x3830b8=_0x8b7567[_0x35040b(0x204)](_0x1beba7);if(_0x3830b8){updatePivotTableFieldName(_0x3830b8,_0x32926e,_0x22f062),_0x3830b8[_0x35040b(0x385)](!![]);const _0x340d42=_0x3830b8['query'](),_0x519b86=_0x8b7567[_0x35040b(0x4b0)](_0xb419d3,_0x101295,_0x1beba7),_0x22933a=_0x8b7567[_0x35040b(0x1f5)](_0x35ae1e)[_0x35040b(0x480)]();_0x8b7567[_0x35040b(0x3e0)](_0xb419d3,_0x101295,PivotTableOperationEnum[_0x35040b(0x2b2)],_0x1beba7,_0x340d42,_0x519b86,_0x22933a,!![]);}}return this[_0x35040b(0x41f)](_0xb419d3,_0x101295,_0x1beba7);}});}['getMatrixFromRunTimeData'](_0x736a56,_0x5c8667,_0x7e19c6){var _0x4f9037,_0x555039;const {arrayFormulaCellData:_0xb8a1b6,unitData:_0x36b86b}=_0x7e19c6;return{'arrayFormulaCellDataMatrix':_0xb8a1b6===null||_0xb8a1b6===void 0x0||(_0x4f9037=_0xb8a1b6[_0x736a56])===null||_0x4f9037===void 0x0?void 0x0:_0x4f9037[_0x5c8667],'unitDataMatrix':_0x36b86b===null||_0x36b86b===void 0x0||(_0x555039=_0x36b86b[_0x736a56])===null||_0x555039===void 0x0?void 0x0:_0x555039[_0x5c8667]};}[_0x273cf5(0x41f)](_0x2ef681,_0x313d2b,_0x4bc844){const _0x1007e5=_0x273cf5,_0x4e30c7=this['_sheetsPivotDataSourceModel'][_0x1007e5(0x342)](_0x2ef681,_0x313d2b,_0x4bc844),_0x41fbf9=[],_0x30662b=new _univerjs_core[(_0x1007e5(0x24d))]();if(_0x4e30c7){const {rangeCache:_0x17398c,matrix:_0xe4dcb0,oldRangeCache:_0x2b4174,oldMatrix:_0x926714}=_0x4e30c7,_0x46c089=unionPivotViewRange(_0x2b4174),_0x1c844f=unionPivotViewRange(_0x17398c);_0x41fbf9['push'](..._0x1c844f,..._0x46c089);if(_0x926714&&_0x2b4174)_0x46c089['forEach'](_0x5c29b4=>{const _0x12a338=_0x1007e5;for(let _0x49550f=_0x5c29b4[_0x12a338(0x3de)];_0x49550f<=_0x5c29b4[_0x12a338(0x4a7)];_0x49550f++)for(let _0x22176f=_0x5c29b4[_0x12a338(0x3ed)];_0x22176f<=_0x5c29b4['endColumn'];_0x22176f++)_0x30662b[_0x12a338(0x240)](_0x49550f,_0x22176f);});if(_0xe4dcb0&&_0x1c844f)_0x1c844f[_0x1007e5(0x24b)](_0x11caff=>{const _0x5713ea=_0x1007e5;for(let _0x32a018=_0x11caff[_0x5713ea(0x3de)];_0x32a018<=_0x11caff['endRow'];_0x32a018++)for(let _0x522bbc=_0x11caff[_0x5713ea(0x3ed)];_0x522bbc<=_0x11caff[_0x5713ea(0x41e)];_0x522bbc++)_0x30662b['setValue'](_0x32a018,_0x522bbc,_0xe4dcb0[_0x5713ea(0x3e2)](_0x32a018,_0x522bbc));});}const _0x501f48={};return _0x501f48[_0x2ef681]={[_0x313d2b]:getUniqueRange(_0x41fbf9)},{'runtimeCellData':{[_0x2ef681]:{[_0x313d2b]:_0x30662b}},'dirtyRanges':_0x501f48};}[_0x273cf5(0x4ef)](){}};PivotCalculatorController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotDataSourceModel)),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_engine_formula[_0x273cf5(0x37e)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core['ICommandService'])),__decorateParam(0x3,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_engine_formula[_0x273cf5(0x481)])),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(_univerjs_core[_0x273cf5(0x3a6)]))],PivotCalculatorController);let SheetsPivotClearController=class SheetsPivotClearController extends _univerjs_core['Disposable']{constructor(_0x4b1b4d,_0x1983ec,_0x59e853,_0x3cbbca){const _0xf3a0de=_0x273cf5;super(),this['_univerInstanceService']=_0x4b1b4d,this[_0xf3a0de(0x4b7)]=_0x1983ec,this[_0xf3a0de(0x3df)]=_0x59e853,this['_sheetsPivotTableConfigModel']=_0x3cbbca,_defineProperty(this,_0xf3a0de(0x2dd),new _univerjs_core['DisposableCollection']()),this[_0xf3a0de(0x46d)]();}[_0x273cf5(0x46d)](){const _0x2d1584=_0x273cf5;this[_0x2d1584(0x399)](this[_0x2d1584(0x4b7)][_0x2d1584(0x467)]({'getMutations':_0x1d8dbf=>{const _0x5add03=_0x2d1584;if(_0x1d8dbf['id']===_univerjs_sheets[_0x5add03(0x3ea)]['id']||_0x1d8dbf['id']===_univerjs_sheets[_0x5add03(0x4cc)]['id']){const _0x1916ef=[],_0x5adf69=[],_0x59cfe6=this[_0x5add03(0x3df)]['getCurrentSelections']()[_0x5add03(0x291)](_0x8fc256=>_0x8fc256[_0x5add03(0x36b)]),_0x348e3d=(0x0,_univerjs_sheets[_0x5add03(0x1d6)])(this['_univerInstanceService'],_0x1d8dbf[_0x5add03(0x21f)]);if(!_0x348e3d)return{'redos':[],'undos':[]};const {unitId:_0x307dbf,subUnitId:_0x36b1fd}=_0x348e3d,_0x33872d={},_0x249eaf=this[_0x5add03(0x219)][_0x5add03(0x44a)](_0x307dbf,_0x36b1fd);if(_0x249eaf===null||_0x249eaf===void 0x0?void 0x0:_0x249eaf[_0x5add03(0x2a4)])for(const [_0x135c5b,_0x46bfd3]of _0x249eaf){const {unitId:_0x12298e,subUnitId:_0x433dcd,row:_0x1d2cae,col:_0x582fad}=_0x46bfd3['targetCellInfo'];if(_0x12298e===_0x348e3d['unitId']&&_0x433dcd===_0x348e3d[_0x5add03(0x23b)])_0x33872d[_0x1d2cae+'-'+_0x582fad]=_0x135c5b;}if(_0x59cfe6&&_0x348e3d)_0x59cfe6[_0x5add03(0x24b)](_0x5c4286=>{const _0x3e1dd7=_0x5add03;_univerjs_core[_0x3e1dd7(0x376)][_0x3e1dd7(0x41b)](_0x5c4286,(_0x49ff58,_0x3d0eed)=>{const _0xdaecff=_0x3e1dd7,_0x2cf691=_0x49ff58+'-'+_0x3d0eed;if(_0x33872d[_0x2cf691]){const _0x588a14=_0x33872d[_0x2cf691];_0x1916ef[_0xdaecff(0x4e8)]({'id':RemovePivotTableMutation['id'],'params':{'unitId':_0x307dbf,'subUnitId':_0x36b1fd,'pivotTableId':_0x588a14}});const _0x242d90=this[_0xdaecff(0x219)][_0xdaecff(0x22d)](_0x307dbf,_0x588a14),_0x20baf5=this[_0xdaecff(0x219)][_0xdaecff(0x4b0)](_0x307dbf,_0x36b1fd,_0x588a14);_0x5adf69[_0xdaecff(0x4e8)]({'id':AddPivotTableMutation['id'],'params':{'unitId':_0x307dbf,'subUnitId':_0x36b1fd,'pivotTableId':_0x588a14,'pivotTableConfig':_0x20baf5,'collectionConfig':_0x242d90}});}});});return{'redos':_0x1916ef,'undos':_0x5adf69};}return{'redos':[],'undos':[]};}}));}};SheetsPivotClearController=__decorate([__decorateParam(0x0,_univerjs_core[_0x273cf5(0x315)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_sheets['SheetInterceptorService'])),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_sheets[_0x273cf5(0x2a1)])),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(SheetsPivotTableConfigModel))],SheetsPivotClearController);let SheetsPivotTableInterceptController=class SheetsPivotTableInterceptController extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x37138e,_0x4fe77d,_0x301144,_0x23fb6b,_0x5b574e){const _0x53ed83=_0x273cf5;super(),this['_sheetInterceptorService']=_0x37138e,this[_0x53ed83(0x24c)]=_0x4fe77d,this[_0x53ed83(0x2ae)]=_0x301144,this[_0x53ed83(0x219)]=_0x23fb6b,this[_0x53ed83(0x410)]=_0x5b574e,this['_initCommandInterceptListener']();}[_0x273cf5(0x2d7)](_0x59218b,_0x4c18bb,_0x4f3e0e){const _0x1a26b8=_0x273cf5,{pageView:_0x2910f8,cornerView:_0x308392,rowView:_0x587634,colView:_0x4da88b,dataView:_0x5888e3}=_0x4c18bb,_0x3c0442=_0x59218b;let _0x5a1f1a;if(_0x4f3e0e)_0x5a1f1a=[...getEmptyPivotRanges(_0x3c0442)];else{const _0x3eea41=getAdjustRangesPosition(_0x3c0442,_0x2910f8,!![]),_0x48dcc4=_0x2910f8['lastRow']>=0x0?_0x2910f8[_0x1a26b8(0x30a)]+0x1:0x0,_0x107aff=_0x308392[_0x1a26b8(0x482)],_0x3fb677=_0x308392[_0x1a26b8(0x246)],_0x2af03a=_0x3eea41[_0x1a26b8(0x36f)]>0x0?0x1:0x0,_0x38ea2d=getAdjustRangesPosition({'row':_0x3c0442[_0x1a26b8(0x1ed)]+_0x48dcc4+_0x2af03a,'col':_0x3c0442[_0x1a26b8(0x2d4)]},_0x308392,![],![]),_0x347eba=getAdjustRangesPosition({'row':_0x3c0442['row']+_0x48dcc4+_0x2af03a+_0x107aff,'col':_0x3c0442[_0x1a26b8(0x2d4)]},_0x587634,![],!![]),_0x4477e7=getAdjustRangesPosition({'row':_0x3c0442[_0x1a26b8(0x1ed)]+_0x48dcc4+_0x2af03a,'col':_0x3c0442[_0x1a26b8(0x2d4)]+_0x3fb677},_0x4da88b,![],!![]),_0xb7d4bc=getAdjustRangesPosition({'row':_0x3c0442['row']+_0x48dcc4+_0x2af03a+_0x107aff,'col':_0x3c0442[_0x1a26b8(0x2d4)]+_0x3fb677},_0x5888e3,![],!![]);_0x5a1f1a=[..._0x3eea41,..._0x38ea2d,..._0x347eba,..._0x4477e7,..._0xb7d4bc];}return _0x5a1f1a;}['_initCommandInterceptListener'](){const _0x10d9d3=_0x273cf5;this[_0x10d9d3(0x399)](this[_0x10d9d3(0x410)]['interceptor'][_0x10d9d3(0x2aa)](this['_sheetsPivotTableService']['interceptor'][_0x10d9d3(0x36e)]()[_0x10d9d3(0x227)],{'handler':(_0x35c938,_0x463fe5)=>{const _0x34a3ad=_0x10d9d3,{cellInfo:_0x142991,view:_0x1f2739,isEmpty:_0x3d64f0}=_0x463fe5,{unitId:_0x39f440,subUnitId:_0x2007f5}=_0x142991,_0x3c2ade=this[_0x34a3ad(0x2d7)](_0x142991,_0x1f2739,_0x3d64f0),_0x4cd3b9=this[_0x34a3ad(0x4b7)][_0x34a3ad(0x209)]({'unitId':_0x39f440,'subUnitId':_0x2007f5,'ranges':_0x3c2ade}),_0x2edb9d=generateSetRangeValueMutations(this[_0x34a3ad(0x24c)],_0x39f440,_0x2007f5,_0x3c2ade);_0x2edb9d[_0x34a3ad(0x44b)]&&(_0x4cd3b9[_0x34a3ad(0x3d5)][_0x34a3ad(0x4e8)](_0x2edb9d[_0x34a3ad(0x4dd)]),_0x4cd3b9[_0x34a3ad(0x211)][_0x34a3ad(0x4e8)](_0x2edb9d[_0x34a3ad(0x42f)]));const _0x5d5d67=this[_0x34a3ad(0x2df)](_0x1f2739,_0x142991);return _0x4cd3b9[_0x34a3ad(0x3d5)][_0x34a3ad(0x4e8)](..._0x5d5d67['redos']),_0x4cd3b9[_0x34a3ad(0x211)]['push'](..._0x5d5d67['undos']),{'redos':_0x4cd3b9[_0x34a3ad(0x3d5)],'undos':_0x4cd3b9[_0x34a3ad(0x211)]};}}));}[_0x273cf5(0x2df)](_0x204368,_0x5793ec){const _0x1848cb=_0x273cf5,{col:_0x15c7a3,unitId:_0x24f7cc,subUnitId:_0x1784e2}=_0x5793ec,_0x45ed50=[],_0x33f840=[],_0x993372=(0x0,_univerjs_sheets['getSheetCommandTarget'])(this[_0x1848cb(0x2ae)],{'unitId':_0x24f7cc,'subUnitId':_0x1784e2});if(!_0x5793ec||!_0x204368||!_0x993372)return{'undos':_0x33f840,'redos':_0x45ed50};const _0x490de3=this['_sheetsPivotTableConfigModel'][_0x1848cb(0x471)](),{colView:_0x43968b,dataView:_0xee74b0,cornerView:_0x34e22b,rowView:_0x251572,formatMap:_0x15b759}=_0x204368,_0x5a227e=getHeaderViewMaxText(_0x43968b,_0x490de3,!![],_0x15b759),_0x2026cd=getHeaderViewMaxText(_0x251572,_0x490de3,![],_0x15b759),_0x56e4a1=getValueViewMaxText(_0xee74b0),_0xd2b2ba=getCornerMaxText(_0x34e22b),{worksheet:_0x3b8fba}=_0x993372;if(typeof window!=='undefined'&&window[_0x1848cb(0x4b1)]){const _0x550404=(0x0,_univerjs_engine_render[_0x1848cb(0x31e)])({...defaultThemeStyle[_0x1848cb(0x4a4)]}),_0x4cb7d3=_univerjs_engine_render[_0x1848cb(0x3ba)][_0x1848cb(0x29b)](_0x5a227e,_0x550404)[_0x1848cb(0x32e)]+0x10,_0x149636=_univerjs_engine_render[_0x1848cb(0x3ba)][_0x1848cb(0x29b)](_0x56e4a1,_0x550404)['width'],_0x5e9bdf=Math['floor'](Math[_0x1848cb(0x236)](_0x4cb7d3,_0x149636))+0x10,_0x20f595=Math[_0x1848cb(0x326)](_univerjs_engine_render[_0x1848cb(0x3ba)][_0x1848cb(0x29b)](_0x2026cd,_0x550404)[_0x1848cb(0x32e)]),_0x10ec3a=Math['floor'](_univerjs_engine_render[_0x1848cb(0x3ba)][_0x1848cb(0x29b)](_0xd2b2ba,_0x550404)[_0x1848cb(0x32e)]),_0xdc6e87=Math[_0x1848cb(0x236)](_0x20f595,_0x10ec3a,0x28)+0xc,_0x4385c9=_0x43968b[_0x1848cb(0x246)]+_0x34e22b[_0x1848cb(0x246)],_0x3efe9d={},_0x2699ca={};for(let _0xdb30d8=_0x15c7a3;_0xdb30d8<_0x15c7a3+_0x4385c9;_0xdb30d8++){_0x3efe9d[_0xdb30d8]=_0x3b8fba['getColumnWidth'](_0xdb30d8);if(_0xdb30d8-_0x15c7a3<_0x34e22b[_0x1848cb(0x246)])_0x2699ca[_0xdb30d8-_0x15c7a3]=_0xdc6e87;else _0x2699ca[_0xdb30d8-_0x15c7a3]=_0x5e9bdf;}_0x45ed50['push']({'id':_univerjs_sheets[_0x1848cb(0x22a)]['id'],'params':{'subUnitId':_0x1784e2,'unitId':_0x24f7cc,'ranges':[{'startColumn':_0x15c7a3,'endColumn':_0x15c7a3+_0x4385c9-0x1,'startRow':0x0,'endRow':_0x3b8fba[_0x1848cb(0x3d7)]()-0x1}],'colWidth':_0x2699ca}}),_0x33f840['push']({'id':_univerjs_sheets[_0x1848cb(0x22a)]['id'],'params':{'subUnitId':_0x1784e2,'unitId':_0x24f7cc,'ranges':[{'startColumn':_0x15c7a3,'endColumn':_0x15c7a3+_0x4385c9-0x1,'startRow':0x0,'endRow':_0x3b8fba['getRowCount']()-0x1}],'colWidth':_0x3efe9d}});}return{'undos':_0x33f840,'redos':_0x45ed50};}};SheetsPivotTableInterceptController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_sheets[_0x273cf5(0x478)])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x2,(0x0,_univerjs_core['Inject'])(_univerjs_core['IUniverInstanceService'])),__decorateParam(0x3,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableConfigModel)),__decorateParam(0x4,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableService))],SheetsPivotTableInterceptController);function _0x527b(){const _0x36fa33=['[Pivot\x20Table]:\x20Target\x20cell\x20is\x20out\x20of\x20range','count','endCollectChangeset','parseInt','dateType','sheets-pivot.cellDateGroupDisplay.month','sequenceExecute','_localeService','setPivotTableConfig','FontCache','3447NVqnSW','charCodeAt','sheet.mutation.send-pivot-data-local','removeValueFilterInfo','forValue','fields','updateFieldPosition','sheet.command.add-pivot-table-with-config','average','function','sheets-pivot.cellDateGroupDisplay.hour','DataFieldManager','updatePivotSource','COMMAND','call','InsertSheetCommand','blank','25fyimWM','removePivotTable','Rectangle','SetPivotSetting','ManualFilter','_initLocale','transFromCellValue','getFieldDataType','pivotTableId','redos','getPivotPerformCheck','getRowCount','collections','Year','value','broadcastCollectionChange','filterInfo','DrillDown','startRow','_sheetsSelectionsService','updateView','YearQuarter','getValue','AddField','pivotConfigChange$','addField','_ensurePivotTableRangeInfo','sheet.mutation.set-pivot-option','1202544yQSCVO','sheets-pivot.dateGroup.month','ClearSelectionContentCommand','SetPivotTableConfig','Row','startColumn','addDataFieldWithoutUnitInfo','sheets-pivot.emptyPivot.column','MovePivotTableCommand','InsertSheetMutation','BadReference','string','existing','sourceRangeInfo','_refRangeHandle','collectionChange$','776936SSklws','PivotTable','NAME','sideEffectUpdateWorkerCache','rangeKey','SetOptions','formJSON','subTotalStyle','registerPluginResource','colInfo','getMatrixFromRunTimeData','_initViewModelBySheetInterceptor','SheetsPivotRPCService','RemovePivotTableMutation','RemovePivotFieldCommand','registerCallbackWithEvent','getSubUnitPivotRenderCache','fieldsCollectionChange$','adjustSheetCellData','registerRefRange','pageRanges','CustomCommandExecutionError','SetFilterInfo','splice','_sheetsPivotTableService','setPivotFilter','Varp\x20of\x20','areaInfo','_sheetsPivotTableAdaptorModel','sheet.mutation.set-pivot-collapse','getName','updatePivotTableMatrixInfo','getPivotCellInfo','getAutoDisplayName','unshift','foreach','_pivotTableMatrixInfo','updateDataFieldsCollection','endColumn','getDirtyInfo','remove','setPivotSetting','setPivotSort','_subjectViewChange','AddPivotTableCommand','sheet.command.set-pivot-fields-config','minDate','addPivotField','slice','getPivotDisplayConfig','setPivotInitCompleted','_viewUpdate$','sheets-pivot.emptyPivot.values','createAsyncInterceptorKey','CellValueType','setRangeValueUndoMutation','addCollection','SetPivotFilterCommand','MonthDate','NUMBER','Expand','cornerRanges','_markDirty$','sortInfo','setValue','setDisplayName','_globalComputedStartHelpFunc','MoveRangeMutation','panel','update','New','resetArea','BLANK_ROW_COUNT','AddPivotTableWithConfig','packageName','isEmpty','SetValueFilter','updateViewData','Add','SheetsPivotTableService','reset','column','getSubUnitPivotConfigs','shouldClear','_pivotTableRangeInfo','PivotTableValuePositionEnum','getRangeKeyList','getSortInfo','refreshData','default','unitId','removePivotField','getFieldFormat','valid','getColCount','_refRangeService','CELL_CONTENT','originalFieldId','UpdatePivotTableSourceRangeMutation','setRangeKeyMap','versions','pushUndoRedo','SetPivotFieldFormatMutation','Subject','MovePivotFieldCommand','sheets-pivot.emptyPivot.row','getUnitId','from','_collectionChange$','_pivotInitCompleted$','SetPivotSortCommand','interceptCommand','deleteField','onStarting','subscribe','165EZhlFS','getTableFieldById','_initClearSelectionCommandInterceptor','_ensurePivotTableMatrixInfo','getRangeStartEndInfo','handleMoveRange','getTextInfo','getSheets','RefRangeService','symbol','IActiveDirtyManagerService','intersects','_requestResolvers','SheetInterceptorService','getPivotTableMatrixInfo','STRING','_ensurePivotMap','var','rgb(240,241,243)','toPrimitive','_createExclusiveRange','toJSON','GlobalComputingStatusService','rowCount','NUM','getFieldPositionInfoById','subtotal','Sum\x20of\x20','LS_CONFIG_KEY','sheets.tabs.sheet','asyncInterceptor','PivotCellStyleTypeEnum','AddPivotField','_initDataSendListener','updateAllDisplayName','NORMAL','DEFAULT_WORKSHEET_ROW_COUNT','_subjectFieldsCollectionChange','PivotDrillDownCommand','isErrorValue','SetPivotValueFilterMutation','initDataRanges','UpdateSource','dataFieldId','removeSourceRangeChange','updateValuePosition','getPivotTableInfo','oldMatrix','getColumnCount','SheetsPivotTableConfigModel','updateFieldSourceInfo','getTargetByPivotTableId','_textInfo','token','Column\x20','getDataFieldId','AsyncInterceptorManager','colStyle','_ensurePivotItemRenderValueMatrixCache','sheets-pivot.dateGroup.yearMonth','endRow','SetPivotFilter','maxLimitItemCount','UNIVER_SHEET','defaultThemeStyle','sheet.mutation.add-pivot-field','sheet.command.set-pivot-filter','limit\x20pivot','AddPivotFieldCommand','getPivotTableConfig','document','hasOwnProperty','_init','textInfo','UpdateFieldPosition','DIV_BY_ZERO','_sheetInterceptorService','asObservable','notExecuteFormula','colRanges','sheets-pivot.blank','(Blank)','sheets-pivot.minName','_configService','Minute','sheet.command.add-pivot-table','13TyRSwC','rangesInfo','merge','106310iBMrFw','min','Style','addDirtyPivotTable','columnFields','6535SmFrXy','#b2b2b2','_deletePivotTableInstanceCache','ClearSelectionAllCommand','SetSheetsFilterRangeMutation','name','sheet.mutation.rename-pivot-field','data','sourceName','dataFields','refreshDataField','getFieldIds','isPrefixValue','result','CommandType','SetPivotSubtotalTypeMutation','node','getRefRangeMutationsByMoveRange','getIndexesByPathStr','clear','setRangeValueRedoMutation','sheets-pivot.maxName','pbt','sheet.command.add-pivot-field','SetRangeValuesMutation','Count\x20of\x20','getConfig','startCollectChangeset','query','Optional','AddPivotFieldMutation','push','setSubtotalType','_onRefRangeChange','isValue','UpdatePivotValuePositionCommand','removeValueFilterInfoByValueFieldId','setTextInfo','dispose','RemoveSheetMutation','handleSourceRangeChange','drillDown','sheet.command.update-pivot-value-position','SetSortInfo','setMaxLimitItemCount','removeCollections','PositionType','SetPivotValueFilterCommand','SetPivotCollapseCommand','PivotTableChangeTypeEnum','onCommandExecuted','removeField','Inject','tableFieldId','sheet.command.set-pivot-field-setting','iterateFieldDim','Collapse','HourMinute','sheetName','[Pivot\x20Table]:\x20Target\x20sheet\x20is\x20not\x20valid','getSheetCommandTarget','updateViewInfo','getMonth','removeCollectionImp','isArray','targetCellInfo','sheets-pivot.subTotal','add','getFullYear','SetValuePivotFilter','UpdateValuePosition','_configVersion$','setRange','getAdjustRangesPosition','0.21.1','_initSnapshot','getPivotTableIdByCell','pushComputingStatusSubject','decorate','sheets-pivot.cellDateGroupDisplay.year','sheet.mutation.send-pivot-config-local','isText','SheetsPivotTableAdaptorModel','row','getValuePosition','contains','createCollectionWithDataRange','number','_sheetsPivotDataSourceModel','constructor','sheets-pivot.productName','getDataFieldManager','Max\x20of\x20','#eceeff','PivotDataFieldTypeEnum','IExclusiveRangeService','SetPivotSortMutation','getValueFilterInfos','rangeType','sheets-pivot.cellDateGroupDisplay.yearMonth','sheets-pivot.stdDevName','_dataSyncPrimaryController','_initRegisterCommand','sheets-pivot.dateGroup.yearMonthDate','177QBpxch','getSheetFeatureLimit','getPivotTableInstance','replace','sheet.mutation.pivot-update-field-source-info','resetPivotTable','YearMonth','generateMutationsByRanges','toStringTag','Column','colHeaderMap','dimension','generateRandomId','sheet.command.update-pivot-table-source-range','sheets-pivot.cellDateGroupDisplay.date','undos','Min\x20of\x20','collapseInfo','registerDirtyService','#1d32e9','_initPivotTextInfo','RemoveField','getLastRow','_sheetsPivotTableConfigModel','fetchThroughInterceptors','rangeKeyMap','_subjectCollectionChange','DisposableCollection','stdDevp','params','product','_updateRenderEmptyCache','setName','getDataFieldByDataFieldId','getFieldInfo','valueFields','BehaviorSubject','PIVOT_MUTATION_GENERATE','_initUnitDisposed','MovePivotField','SetWorksheetColWidthMutation','pivotPerformCheck','getStyles','getCollection','_resourceManagerService','SetPivotOptionMutation','sheets-pivot.varpName','registerCommand','_globalSubject','displayName','getPivotItemRenderInfoCache','SHEET_PIVOT_IN_MAIN_THREAD','max','markDirty$','clearExclusiveRangesByGroupId','Average\x20of\x20','6590AMHPUS','subUnitId','_model','toString','_config','Tools','realDeleteValue','rowStyle','PivotTableViewDirtyMarkOperation','_viewData$','Disposable','_initGlobalComputed','colCount','pivotTableConfigs','getFormat','getSheetId','sheets-pivot.emptyPivot.filter','forEach','_injector','ObjectMatrix','updateRenderCache','getHeaderMapItem','PivotCallbackEnum','isColMultiMeasure','Subtotal','33716QTiBHL','error','deleteUnitId','sheets-pivot.columnName','rowRanges','needSameDeleteModel','getOriginFieldId','SetPivotFieldsConfigCommand','iterator','sheet.command.reset-pivot-fields-config','getTargetByPivotId','getformat','\x20-\x20','keys','_initPivotDataGetListener','sheets-pivot.dateGroup.date','format','PivotDateGroupFieldDateTypeEnum','find','UpdateFieldPositionMutation','_sheetsPivotRpcService','getLastCol','sheet.operation.pivot-table-view-formula-mark-dirty','SetFieldFormat','getDisplayName','triggerDirtyFeature','AddPivotTable','IConfigService','PivotViewCellValueTypeEnum','_pivotRenderInfoCache','_initRemoveSheetCommandInterceptor','sheet.command.update-date-group','handleAsyncResponse','isDateGroupFieldJSON','PivotMultipleValueId','sheets-pivot.other','InsertRowMutation','collection','PivotErrorTypeEnum','setConfig','getFilterInfo','RemoveColMutation','split','lastCol','#f4f4f5','dataRangeInfo','batch','UpdateValuePositionMutation','markDirty','Grand\x20Total','NO_COMMERCIAL','getFieldById','createInterceptorKey','Date','DependentOn','getPivotTableRangeInfo','measure','getPivotInfoByLicense','Delete','workbook\x20is\x20not\x20found','next','#e6ebfb','map','dataStyle','setOptions','StdDevp\x20of\x20','dataFieldManagerConfig','setDateType','_queryingMap','sheets-pivot.dateGroup.hourMinute','_featureCalculationManagerService','isBaseGroupField','getTextSize','fetchThroughAsyncInterceptors','sheet.command.set-pivot-value-filter','ResetPivotTable','get','SHEET_PIVOT_EXCLUSIVE_ID','SheetsSelectionsService','_getAutoName','_updatePivotTableInstanceCache','size','viewData$','Total','sheets-pivot.dateGroup.year','createLabelField','_viewData','intercept','getCellRaw','getMatrix','originTargetInfo','_univerInstanceService','DateGroupField','onQueryEnd','InterceptorEffectEnum','Set','unionPivotViewRange','setValueFilterInfo','paths','cornerInfo','countNums','getPivotDirtyViewInfo','getSubUnitPivotMatrix','setPivotCollapse','IResourceManagerService','setValuePivotFilter','concat','#FFFFFF','sheet.mutation.pivot-update-field-position','renameField','applyChangeSet','getLicenseInfo','filterFields','viewUpdate$','complete','valueIndex','getUnit','sheets-pivot.varName','tuple','_initConfig','leftOffset','DataField','sheets-pivot.cellDateGroupDisplay.hourMinute','DataSyncPrimaryController','sum','PivotDataFieldDataTypeEnum','_globalComputedEndHelpFunc','grandTotal','sheets-pivot.value','col','pluginName','fieldIds','_getPivotAppliedRanges','getMatrixValue','sheet.command.remove-pivot-field','isDateGroupField','getDataFieldByRangeKey','collectionConfig','disposableCollection','getFormatInfo','getAutoFitColumnsMutations','fieldId','PivotTableOperationEnum','getPivotTableCellData','defineProperty','interceptor','updateCollectionConfig','GrandTotal','getDate','getSubtotal','removeDataField','substring','addFieldWithSourceId','headerMap','cellValue','YearMonthDate','rowFields','varp','_exclusiveRangeService','refreshGroupField','_toJSON','SetCollapse','entries','SetSubtotalType','queryDirtyPivotTable','sheet.command.pivot-drill-down','generateHexNumber','@univerjs-pro/sheets-pivot','ReleaseType','isBottomTotal','setSortInfo','getValueIndex','dataFieldsCollection','UniverSheetsPivotTablePlugin','updateRangeKeyMap','42ZAEeLo','sheets-pivot.cellDateGroupDisplay.yearMonthDate','COLUMN','Var\x20of\x20','addCollectionByJSON','stringify','sheet.mutation.send-init-pivot-text-local','updateConfigCache','lastRow','FieldsCollection','fieldsConfig','fontRenderExtension','cornerStyle','numfmt','valueFilter','sheet.mutation.set-pivot-format','isDateValue','SetPivotCollapse','_lifecycleService','IUniverInstanceService','Plugin','new','setPivotTable','SetRangeValuesUndoMutationFactory','getTypeOfUnitDisposed$','RemoveRowMutation','SheetsPivotDataSourceModel','_ensurePivotItemRenderInfoCache','getFontStyleString','updatePivotTableRangeInfo','_fieldsCollectionChange$','other','getAutoDisplayNameFunction','register','info','IUndoRedoService','floor','sheet.mutation.set-pivot-filter','rowInfo','parse','message','prototype','getSourceName','filterId','width','deepClone','ResetPivotFieldsConfigCommand','updateConfig','getInsertRowColMutations','hasField','_dataFieldManagerCollection','sheets-pivot.countName','getSheetBySheetName','LocaleService','sheet.mutation.pivot-update-value-position','getRangeKey','options','AddPivotTableMutation','3918BQYPsk','delete','_updateModelCache','filter','SHEET_PIVOT_TABLE_PLUGIN','UpdatePivotFieldSourceInfoMutation','getViewData','values','5924058RqQbVT','sheets-pivot.dateGroup.yearQuarter','getDataFieldItemInfo','getFieldCountByArea','Values','getNoUsedDataFieldIds','_activeDirtyManagerService','deleteDataField','getPivotTableModelConfig','setDataRecordCount','UpdatePivotTableSourceRangeCommand','pivotTableIndexConfig','AddPivotTableWithConfigCommand','sheets-pivot.config','pivotInitCompleted$','getIntersectsPivotTable','some','RenameField','REF','getCellMatrix','mergeWorksheetSnapshotWithDefault','Existing','getUpdateRangeDeleteIds','dataStream','UniverLicensePlugin','sheet.mutation.remove-group-collection','LifecycleService','_pivotRenderValueMatrixCache','movePivotField','iterateField','sheets-pivot.cellDateGroupDisplay.quarter','UpdatePivotFieldSettingCommand','object','_collectionConfigModel','setFieldFormat','PivotSubtotalTypeEnum','getId','PivotFilterTypeEnum','setCollapse','range','sheets-pivot.averageName','MoveRangeCommand','getInterceptPoints','length','_host','serializeRangeWithSpreadsheet','updateDirtyPivotTable','Hour','fromJSON','UpdatePivotSource','Range','isFeatureAuthorizedWithinTime','addRecord','addPivotTableWithConfig','generateSetRangeValueMutations','custom','sheets-pivot.dateGroup.quarter','PivotTableFiledAreaEnum','IFeatureCalculationManagerService','UniverInstanceType','getDataFieldByTableId','_commandService','iterateFieldByArea','canUsePivot','random','setDirty','Month','single','has','DEFAULT_WORKSHEET_COLUMN_COUNT','sheets-pivot.stdDevpName','_pivotTableInstanceCache','_generateUniqueVersion','cellToRange','generateNewSheetName','getSheetBySheetId','Filter','InsertSheetUndoMutationFactory','setLabelFilterInfo','onQueryStart','level','sheet.mutation.set-pivot-position','PivotView','RemovePivotField','getRangeData','disposeWithMe','executeCommand','getGroupFieldsInfoByIds','type','sheets-pivot.cellDateGroupDisplay.yearQuarter','_deleteModelCache','uniqueDataFieldName','version','Value','MUTATION','getDataFieldBySourceName','addExclusiveRange','SetPivotSort','Injector','pageStyle','date','addPivotTable','_ensureViewDataMap','set','valuePosition','ICommandService','getCurrentUnitForType','ErrorType','clearRenderCache'];_0x527b=function(){return _0x36fa33;};return _0x527b();}let SheetsPivotRefRangeController=class SheetsPivotRefRangeController extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x414a0f,_0x2be7d9,_0xa4b6b,_0xd8e985,_0x122a7e,_0x300a51,_0x30904f){const _0xb416c8=_0x273cf5;super(),this[_0xb416c8(0x24c)]=_0x414a0f,this[_0xb416c8(0x457)]=_0x2be7d9,this[_0xb416c8(0x381)]=_0xa4b6b,this[_0xb416c8(0x2ae)]=_0xd8e985,this[_0xb416c8(0x219)]=_0x122a7e,this[_0xb416c8(0x414)]=_0x300a51,this[_0xb416c8(0x4b7)]=_0x30904f,_defineProperty(this,_0xb416c8(0x2dd),new _univerjs_core[(_0xb416c8(0x21d))]()),this[_0xb416c8(0x4ea)]();}[_0x273cf5(0x4ea)](){const _0x898b8c=_0x273cf5,_0x191f38=(_0x29341f,_0x56be48)=>{const _0x566a11=_0x1f80,_0x1ff654=this['_univerInstanceService'][_0x566a11(0x3ae)](_univerjs_core[_0x566a11(0x37f)]['UNIVER_SHEET']);if(!_0x1ff654)return;if(!(_0x1ff654===null||_0x1ff654===void 0x0?void 0x0:_0x1ff654[_0x566a11(0x38f)](_0x56be48)))return;this[_0x566a11(0x2dd)][_0x566a11(0x4ef)]();const _0x12a023=_0xbeedf0=>{const _0x55dc87=_0x566a11;return this[_0x55dc87(0x3f6)](_0xbeedf0,_0x29341f,_0x56be48);},_0x416759=this[_0x566a11(0x219)][_0x566a11(0x44a)](_0x29341f,_0x56be48);if(!(_0x416759===null||_0x416759===void 0x0?void 0x0:_0x416759['size']))return;Array[_0x566a11(0x463)](_0x416759[_0x566a11(0x343)]())[_0x566a11(0x291)](_0x266b24=>{const _0x459c0f=_0x566a11,{row:_0x1a3972,col:_0x28c778}=_0x266b24[_0x459c0f(0x1db)];return(0x0,_univerjs_core[_0x459c0f(0x38d)])(_0x1a3972,_0x28c778);})[_0x566a11(0x24b)](_0x18d3c7=>{const _0x5875ce=_0x566a11;this['disposableCollection'][_0x5875ce(0x1dd)](this[_0x5875ce(0x457)][_0x5875ce(0x40b)](_0x18d3c7,_0x12a023,_0x29341f,_0x56be48));});},_0xa3bdc0=()=>{const _0x3a5583=_0x1f80,_0x4dbd50=this['_univerInstanceService'][_0x3a5583(0x3ae)](_univerjs_core[_0x3a5583(0x37f)][_0x3a5583(0x4aa)]);if(_0x4dbd50){const _0x59121d=_0x4dbd50['getActiveSheet']();if(!_0x59121d)return;_0x191f38(_0x4dbd50[_0x3a5583(0x462)](),_0x59121d[_0x3a5583(0x249)]());}};this[_0x898b8c(0x399)](this['_commandService'][_0x898b8c(0x1cc)](_0x552a7c=>{const _0x2eed40=_0x898b8c;if(_0x552a7c['id']===_univerjs_sheets['SetWorksheetActiveOperation']['id']){const _0x4c9dd2=_0x552a7c['params'],_0x2b7a54=_0x4c9dd2[_0x2eed40(0x23b)],_0x1dbb41=_0x4c9dd2[_0x2eed40(0x452)];if(!_0x2b7a54||!_0x1dbb41)return;_0x191f38(_0x1dbb41,_0x2b7a54);}})),this[_0x898b8c(0x399)](this['_sheetsPivotTableConfigModel']['pivotInitCompleted$'][_0x898b8c(0x46a)](_0x19951c=>{if(_0x19951c)_0xa3bdc0();})),this[_0x898b8c(0x399)](this[_0x898b8c(0x219)][_0x898b8c(0x3e4)][_0x898b8c(0x46a)](_0x43403f=>{const _0x105391=_0x898b8c,_0x29b59d=(0x0,_univerjs_sheets[_0x105391(0x1d6)])(this[_0x105391(0x2ae)],{'unitId':_0x43403f[_0x105391(0x452)],'subUnitId':_0x43403f['subUnitId']});if(!_0x29b59d)return;const {unitId:_0x47667f,subUnitId:_0x4275a8}=_0x29b59d,{unitId:_0x115665,subUnitId:_0x4e11bd}=_0x43403f;if(_0x47667f!==_0x115665||_0x4275a8!==_0x4e11bd)return;_0x191f38(_0x47667f,_0x4275a8);})),_0xa3bdc0();}[_0x273cf5(0x3f6)](_0x12d62e,_0x4f12a3,_0x16ee07){const _0x5c2fdf=_0x273cf5;switch(_0x12d62e['id']){case _univerjs_sheets[_0x5c2fdf(0x36d)]['id']:return this['getRefRangeMutationsByMoveRange'](_0x12d62e[_0x5c2fdf(0x21f)],_0x4f12a3,_0x16ee07);default:break;}return{'redos':[],'undos':[]};}[_0x273cf5(0x4da)](_0x47c0d1,_0x135f12,_0x3affc8){const _0x2962d5=_0x273cf5,{fromRange:_0x3e2123,toRange:_0x569a2d}=_0x47c0d1,_0x34554b=[],_0x389654=[],_0x2cdbdd=(0x0,_univerjs_sheets['getSheetCommandTarget'])(this[_0x2962d5(0x2ae)]);if(!_0x2cdbdd)return{'undos':_0x389654,'redos':_0x34554b};if(_0x135f12!==_0x2cdbdd[_0x2962d5(0x452)]||_0x3affc8!==_0x2cdbdd[_0x2962d5(0x23b)])return{'undos':_0x389654,'redos':_0x34554b};const _0x594425=this[_0x2962d5(0x219)][_0x2962d5(0x44a)](_0x135f12,_0x3affc8);if(_0x594425===null||_0x594425===void 0x0?void 0x0:_0x594425['size'])for(const [_0x49879a,_0x3c6abd]of _0x594425){const {unitId:_0x45b1c8,subUnitId:_0x55c927,row:_0x3118f0,col:_0x1ed2cd}=_0x3c6abd['targetCellInfo'];if(_0x45b1c8===_0x2cdbdd[_0x2962d5(0x452)]&&_0x55c927===_0x2cdbdd[_0x2962d5(0x23b)]){const _0x496fed=(0x0,_univerjs_core[_0x2962d5(0x38d)])(_0x3118f0,_0x1ed2cd);if(_univerjs_core[_0x2962d5(0x3ce)][_0x2962d5(0x476)](_0x496fed,_0x3e2123)){const _0x33848f=_0x3118f0-_0x3e2123[_0x2962d5(0x3de)],_0x41e6d2=_0x1ed2cd-_0x3e2123[_0x2962d5(0x3ed)],_0xd4a6b9={'row':_0x569a2d[_0x2962d5(0x3de)]+_0x33848f,'col':_0x569a2d[_0x2962d5(0x3ed)]+_0x41e6d2};_0x34554b['push']({'id':SetPivotPositionMutation['id'],'params':{'unitId':_0x45b1c8,'subUnitId':_0x55c927,'pivotTableId':_0x49879a,'targetCellPosition':_0xd4a6b9}}),_0x389654[_0x2962d5(0x4e8)]({'id':SetPivotPositionMutation['id'],'params':{'unitId':_0x45b1c8,'subUnitId':_0x55c927,'pivotTableId':_0x49879a,'targetCellPosition':{'row':_0x3118f0,'col':_0x1ed2cd}}});const _0x5346e9=_0xd4a6b9[_0x2962d5(0x1ed)]-_0x3118f0,_0x54dc73=_0xd4a6b9[_0x2962d5(0x2d4)]-_0x1ed2cd,_0xce8b26=[],_0x2e7999=this['_sheetsPivotTableAdaptorModel'][_0x2962d5(0x234)](_0x45b1c8,_0x55c927,_0x49879a),_0x1391be=_0x2e7999===null||_0x2e7999===void 0x0?void 0x0:_0x2e7999['rangesInfo'];if(_0x1391be){Object[_0x2962d5(0x260)](_0x1391be)[_0x2962d5(0x24b)](_0x374e4c=>{const _0x3c4024=_0x2962d5;_0x1391be[_0x374e4c][_0x3c4024(0x24b)](_0x330001=>{const _0x470e52=_0x3c4024,_0x509f0d={..._0x330001};_0x509f0d['startRow']=_0x330001[_0x470e52(0x3de)]+_0x5346e9,_0x509f0d[_0x470e52(0x4a7)]=_0x330001['endRow']+_0x5346e9,_0x509f0d['startColumn']=_0x330001[_0x470e52(0x3ed)]+_0x54dc73,_0x509f0d[_0x470e52(0x41e)]=_0x330001[_0x470e52(0x41e)]+_0x54dc73,_0xce8b26[_0x470e52(0x4e8)](_0x509f0d);});});const _0x13224e=this[_0x2962d5(0x4b7)][_0x2962d5(0x209)]({'unitId':_0x45b1c8,'subUnitId':_0x55c927,'ranges':_0xce8b26});_0x34554b[_0x2962d5(0x4e8)](..._0x13224e[_0x2962d5(0x3d5)]),_0x389654[_0x2962d5(0x4e8)](..._0x13224e[_0x2962d5(0x211)]);const _0x13a4da=generateSetRangeValueMutations(this[_0x2962d5(0x24c)],_0x45b1c8,_0x55c927,_0xce8b26);_0x13a4da[_0x2962d5(0x44b)]&&(_0x34554b[_0x2962d5(0x4e8)](_0x13a4da[_0x2962d5(0x4dd)]),_0x389654[_0x2962d5(0x4e8)](_0x13a4da[_0x2962d5(0x42f)]));}}}}return{'redos':_0x34554b,'undos':_0x389654};}};SheetsPivotRefRangeController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_core['Injector'])),__decorateParam(0x1,(0x0,_univerjs_core['Inject'])(_univerjs_sheets[_0x273cf5(0x473)])),__decorateParam(0x2,_univerjs_core[_0x273cf5(0x3ad)]),__decorateParam(0x3,_univerjs_core['IUniverInstanceService']),__decorateParam(0x4,(0x0,_univerjs_core['Inject'])(SheetsPivotTableConfigModel)),__decorateParam(0x5,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableAdaptorModel)),__decorateParam(0x6,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_sheets[_0x273cf5(0x478)]))],SheetsPivotRefRangeController);let SheetsPivotRemoveSheetController=class SheetsPivotRemoveSheetController extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x1e72aa,_0x28a928){const _0x193df8=_0x273cf5;super(),this[_0x193df8(0x4b7)]=_0x1e72aa,this['_sheetsPivotTableConfigModel']=_0x28a928,this[_0x193df8(0x271)]();}['_initRemoveSheetCommandInterceptor'](){const _0x267a94=_0x273cf5;this[_0x267a94(0x399)](this['_sheetInterceptorService'][_0x267a94(0x467)]({'getMutations':_0xb27036=>{const _0x4a6b74=_0x267a94;if(_0xb27036['id']===_univerjs_sheets['RemoveSheetCommand']['id']){const _0x4ea82c=[],_0x2b47ce=[],{unitId:_0x49200e,subUnitId:_0x5854af}=_0xb27036['params'];if(!_0x49200e||!_0x5854af)return{'undos':_0x2b47ce,'redos':_0x4ea82c};const _0x2585c9=this[_0x4a6b74(0x219)][_0x4a6b74(0x44a)](_0x49200e,_0x5854af);if(_0x2585c9===null||_0x2585c9===void 0x0?void 0x0:_0x2585c9[_0x4a6b74(0x2a4)])for(const [_0x15865d,_0x1ec439]of _0x2585c9){_0x4ea82c[_0x4a6b74(0x4e8)]({'id':RemovePivotTableMutation['id'],'params':{'unitId':_0x49200e,'subUnitId':_0x5854af,'pivotTableId':_0x15865d}});const _0x4dab4c={...this[_0x4a6b74(0x219)]['getCollection'](_0x49200e,_0x15865d)};_0x2b47ce[_0x4a6b74(0x4e8)]({'id':AddPivotTableMutation['id'],'params':{'unitId':_0x49200e,'subUnitId':_0x5854af,'pivotTableId':_0x15865d,'pivotTableConfig':_0x1ec439,'collectionConfig':_0x4dab4c}});}return{'redos':_0x4ea82c,'undos':_0x2b47ce};}return{'redos':[],'undos':[]};}}));}};SheetsPivotRemoveSheetController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core['Inject'])(_univerjs_sheets[_0x273cf5(0x478)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableConfigModel))],SheetsPivotRemoveSheetController);let SheetsPivotRPCController=class SheetsPivotRPCController extends _univerjs_core[_0x273cf5(0x244)]{constructor(_0x107f64,_0x11fc57,_0x38a985,_0x5338aa,_0x54132f,_0x397e01){const _0x2ff523=_0x273cf5;super(),this[_0x2ff523(0x381)]=_0x107f64,this[_0x2ff523(0x267)]=_0x11fc57,this['_sheetsPivotTableAdaptorModel']=_0x38a985,this[_0x2ff523(0x219)]=_0x5338aa,this[_0x2ff523(0x2ae)]=_0x54132f,this[_0x2ff523(0x34a)]=_0x397e01,this[_0x2ff523(0x48c)](),this[_0x2ff523(0x214)]();}[_0x273cf5(0x48c)](){const _0x682467=_0x273cf5;this['disposeWithMe'](this['_commandService'][_0x682467(0x1cc)](_0xdd2c7e=>{const _0x2d8bfc=_0x682467;if(_0xdd2c7e['id']!==SendPivotDataLocalMutation['id'])return;const _0x548401=_0xdd2c7e[_0x2d8bfc(0x21f)];this[_0x2d8bfc(0x267)][_0x2d8bfc(0x273)](_0x548401);})),this[_0x682467(0x399)](this['_commandService'][_0x682467(0x1cc)](_0x3a3712=>{const _0x15c19d=_0x682467;if(_0x3a3712['id']===SendPivotConfigLocalMutation['id']){const _0x207b8a=_0x3a3712[_0x15c19d(0x21f)];if(_0x207b8a){const {unitId:_0x1d3e0e,subUnitId:_0x233f44,oldSubUnitId:_0x4e75ff,pivotTableId:_0x2d84a1,pivotTableConfig:_0x369424,collectionConfig:_0x2b32e8}=_0x207b8a;this[_0x15c19d(0x219)][_0x15c19d(0x309)](_0x1d3e0e,_0x4e75ff,_0x207b8a[_0x15c19d(0x3d4)],null),this[_0x15c19d(0x219)][_0x15c19d(0x309)](_0x1d3e0e,_0x233f44,_0x2d84a1,_0x369424),this[_0x15c19d(0x219)]['updateCollectionConfig'](_0x1d3e0e,_0x2b32e8);}}})),this[_0x682467(0x399)](this['_commandService'][_0x682467(0x1cc)](_0x3d7a2b=>{const _0x1c9cfd=_0x682467;if(_0x3d7a2b['id']!==SendPivotViewLocalMutation['id'])return;const _0x5e119c=(0x0,_univerjs_sheets[_0x1c9cfd(0x1d6)])(this[_0x1c9cfd(0x2ae)]);if(!_0x5e119c)return;const {unitId:_0x37e850,subUnitId:_0x1dc2d6}=_0x5e119c,_0x4394f3=_0x3d7a2b[_0x1c9cfd(0x21f)];if(_0x4394f3[_0x1c9cfd(0x2dc)])Object[_0x1c9cfd(0x260)](_0x4394f3[_0x1c9cfd(0x2dc)])[_0x1c9cfd(0x24b)](_0x3da234=>{const _0x586a55=_0x1c9cfd;var _0x14429a;if((_0x14429a=_0x4394f3[_0x586a55(0x2dc)])===null||_0x14429a===void 0x0?void 0x0:_0x14429a[_0x3da234])this[_0x586a55(0x219)][_0x586a55(0x2e5)](_0x3da234,_0x4394f3[_0x586a55(0x2dc)][_0x3da234]);});if(_0x4394f3[_0x1c9cfd(0x387)]){const {unitId:_0x29b9c4,subUnitId:_0x131e3a,view:_0x61652b,pivotTableId:_0x4b3108,type:_0x305959,pivotConfig:_0x15768}=_0x4394f3[_0x1c9cfd(0x387)];if(_0x305959===PivotTableOperationEnum[_0x1c9cfd(0x28d)])this[_0x1c9cfd(0x414)]['clearRenderCache']({'unitId':_0x29b9c4,'subUnitId':_0x131e3a,'pivotTableId':_0x4b3108,'type':_0x305959}),this[_0x1c9cfd(0x219)][_0x1c9cfd(0x309)](_0x29b9c4,_0x131e3a,_0x4b3108,null);else{const _0x1e3cb7=new _univerjs_pro_engine_pivot['PivotView']();_0x1e3cb7[_0x1c9cfd(0x3fe)](_0x61652b),this[_0x1c9cfd(0x219)][_0x1c9cfd(0x309)](_0x29b9c4,_0x131e3a,_0x4b3108,_0x15768),this[_0x1c9cfd(0x414)][_0x1c9cfd(0x3b0)]({'unitId':_0x29b9c4,'subUnitId':_0x131e3a,'pivotTableId':_0x4b3108,'type':_0x305959,'view':_0x1e3cb7}),this['_sheetsPivotTableAdaptorModel'][_0x1c9cfd(0x24e)]({'unitId':_0x29b9c4,'subUnitId':_0x131e3a,'view':_0x1e3cb7,'pivotTableId':_0x4b3108,'type':_0x305959});}}else _0x4394f3[_0x1c9cfd(0x281)]&&(_0x4394f3[_0x1c9cfd(0x281)][_0x1c9cfd(0x24b)](_0x5d5e4f=>{const _0x200044=_0x1c9cfd,{unitId:_0x225225,subUnitId:_0x24ee29,view:_0x4f8d2a,pivotTableId:_0x3db51c,type:_0x2b8978,pivotConfig:_0x33bbef}=_0x5d5e4f,_0x283df4=new _univerjs_pro_engine_pivot[(_0x200044(0x396))]();_0x283df4[_0x200044(0x3fe)](_0x4f8d2a),this['_sheetsPivotTableConfigModel']['updateConfigCache'](_0x225225,_0x24ee29,_0x3db51c,_0x33bbef),this[_0x200044(0x414)][_0x200044(0x24e)]({'unitId':_0x225225,'subUnitId':_0x24ee29,'view':_0x283df4,'pivotTableId':_0x3db51c,'type':_0x2b8978});}),this[_0x1c9cfd(0x219)][_0x1c9cfd(0x42a)]());this[_0x1c9cfd(0x414)][_0x1c9cfd(0x283)](_0x37e850,_0x1dc2d6);}));}[_0x273cf5(0x214)](){const _0x1d50c3=_0x273cf5;this[_0x1d50c3(0x34a)][_0x1d50c3(0x323)](PivotTableViewDirtyMarkOperation['id'],{'commandId':PivotTableViewDirtyMarkOperation['id'],'getDirtyData'(_0x3da54d){return{'dirtyUnitFeatureMap':_0x3da54d['params']};}});}};SheetsPivotRPCController=__decorate([__decorateParam(0x0,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x3ad)])),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotRPCService)),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(SheetsPivotTableAdaptorModel)),__decorateParam(0x3,(0x0,_univerjs_core['Inject'])(SheetsPivotTableConfigModel)),__decorateParam(0x4,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x315)])),__decorateParam(0x5,_univerjs_engine_formula[_0x273cf5(0x475)])],SheetsPivotRPCController);let UniverSheetsPivotTablePlugin=class UniverSheetsPivotTablePlugin extends _univerjs_core[_0x273cf5(0x316)]{constructor(_0x890a8f=defaultPluginConfig,_0x39f8b4,_0x114554,_0x7a60f0,_0x112309){const _0x21e6f6=_0x273cf5;super(),this[_0x21e6f6(0x23e)]=_0x890a8f,this[_0x21e6f6(0x24c)]=_0x39f8b4,this[_0x21e6f6(0x381)]=_0x114554,this[_0x21e6f6(0x4be)]=_0x7a60f0,this[_0x21e6f6(0x1ff)]=_0x112309;const {..._0x37e192}=(0x0,_univerjs_core[_0x21e6f6(0x4c3)])({},defaultPluginConfig,this['_config']);this[_0x21e6f6(0x4be)][_0x21e6f6(0x27a)](SHEETS_PIVOT_PLUGIN_CONFIG_KEY,_0x37e192),this[_0x21e6f6(0x200)](),this[_0x21e6f6(0x2ca)](_0x37e192);}[_0x273cf5(0x2ca)](_0x1561ba){const _0x4b14dc=_0x273cf5;var _0x158e2e;const _0x3726d3=(_0x158e2e=this[_0x4b14dc(0x23e)])===null||_0x158e2e===void 0x0?void 0x0:_0x158e2e[_0x4b14dc(0x4b9)];this[_0x4b14dc(0x4be)][_0x4b14dc(0x27a)](SHEET_PIVOT_IN_MAIN_THREAD,_0x3726d3===!![]);if(_0x1561ba[_0x4b14dc(0x4a9)]!==void 0x0)(0x0,_univerjs_pro_engine_pivot[_0x4b14dc(0x1c6)])(_0x1561ba[_0x4b14dc(0x4a9)]);}[_0x273cf5(0x469)](){const _0x33523d=_0x273cf5;var _0x41b0ec;let _0x15dbc9=[];const _0x449e5d=(_0x41b0ec=this['_config'])===null||_0x41b0ec===void 0x0?void 0x0:_0x41b0ec[_0x33523d(0x4b9)];if(_0x449e5d===!![])_0x15dbc9=[[SheetsPivotTableService],[SheetsPivotRPCService],[SheetsPivotRPCController],[SheetsPivotTableAdaptorModel],[SheetsPivotTableConfigModel],[SheetsPivotRemoveSheetController],[SheetsPivotClearController],[SheetsPivotRefRangeController],[SheetsPivotTableInterceptController]];else{if(_0x449e5d===![])_0x15dbc9=[[SheetsPivotDataSourceModel],[PivotCalculatorController]];else{if(_0x449e5d===void 0x0)_0x15dbc9=[[SheetsPivotDataSourceModel],[PivotCalculatorController],[SheetsPivotTableService],[SheetsPivotRPCService],[SheetsPivotRPCController],[SheetsPivotTableAdaptorModel],[SheetsPivotTableConfigModel],[SheetsPivotRemoveSheetController],[SheetsPivotClearController],[SheetsPivotRefRangeController],[SheetsPivotTableInterceptController]];}}_0x15dbc9[_0x33523d(0x24b)](_0x342c46=>this['_injector'][_0x33523d(0x1dd)](_0x342c46)),[PivotCalculatorController,SheetsPivotRPCController,SheetsPivotTableService,SheetsPivotClearController,SheetsPivotRemoveSheetController,SheetsPivotRefRangeController,SheetsPivotTableInterceptController]['forEach'](_0x4f8e93=>{const _0x2aae70=_0x33523d;if(this[_0x2aae70(0x24c)][_0x2aae70(0x388)](_0x4f8e93))this[_0x2aae70(0x24c)][_0x2aae70(0x29f)](_0x4f8e93);});}[_0x273cf5(0x200)](){[AddPivotTableWithConfigCommand,AddPivotTableCommand,AddPivotFieldCommand,MovePivotFieldCommand,RemovePivotFieldCommand,UpdatePivotValuePositionCommand,UpdateDateGroupCommand,SetPivotCollapseCommand,SetPivotSortCommand,SetPivotFilterCommand,UpdatePivotFieldSettingCommand,UpdatePivotTableSourceRangeCommand,MovePivotTableCommand,PivotDrillDownCommand,AddPivotTableMutation,UpdateDateGroupMutation,RemovePivotTableMutation,AddPivotFieldMutation,AddGroupCollectionMutation,RemoveGroupCollectionMutation,SetPivotFilterMutation,RemovePivotFieldMutation,RenamePivotFieldMutation,SetPivotCollapseMutation,SetPivotSortMutation,SetPivotOptionMutation,SetPivotPositionMutation,GetPivotDataLocalMutation,SendPivotDataLocalMutation,SendPivotViewLocalMutation,UpdateFieldPositionMutation,UpdateValuePositionMutation,SetPivotSubtotalTypeMutation,SetPivotFieldFormatMutation,SendInitPivotTextLocalMutation,UpdatePivotTableSourceRangeMutation,UpdatePivotFieldSourceInfoMutation,PivotTableViewDirtyMarkOperation,SendPivotConfigLocalMutation,SetPivotValueFilterCommand,SetPivotValueFilterMutation,SetPivotFieldsConfigCommand,ResetPivotFieldsConfigCommand]['forEach'](_0x251064=>{const _0x5b85df=_0x1f80;var _0x479c46;(_0x479c46=this[_0x5b85df(0x1ff)])===null||_0x479c46===void 0x0||_0x479c46['registerSyncingMutations'](_0x251064),this[_0x5b85df(0x381)][_0x5b85df(0x231)](_0x251064);});}};_defineProperty(UniverSheetsPivotTablePlugin,_0x273cf5(0x2d5),SHEET_PIVOT_TABLE_PLUGIN),_defineProperty(UniverSheetsPivotTablePlugin,_0x273cf5(0x442),name),_defineProperty(UniverSheetsPivotTablePlugin,_0x273cf5(0x3a0),version),_defineProperty(UniverSheetsPivotTablePlugin,'type',_univerjs_core['UniverInstanceType'][_0x273cf5(0x4aa)]),UniverSheetsPivotTablePlugin=__decorate([(0x0,_univerjs_core[_0x273cf5(0x289)])(_univerjs_pro_license[_0x273cf5(0x35c)]),__decorateParam(0x1,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x3a6)])),__decorateParam(0x2,(0x0,_univerjs_core[_0x273cf5(0x1ce)])(_univerjs_core[_0x273cf5(0x3ad)])),__decorateParam(0x3,_univerjs_core[_0x273cf5(0x26e)]),__decorateParam(0x4,(0x0,_univerjs_core[_0x273cf5(0x4e6)])(_univerjs_rpc[_0x273cf5(0x2ce)]))],UniverSheetsPivotTablePlugin),exports[_0x273cf5(0x4af)]=AddPivotFieldCommand,exports[_0x273cf5(0x4e7)]=AddPivotFieldMutation,exports[_0x273cf5(0x424)]=AddPivotTableCommand,exports[_0x273cf5(0x33b)]=AddPivotTableMutation,exports[_0x273cf5(0x350)]=AddPivotTableWithConfigCommand,exports[_0x273cf5(0x440)]=BLANK_ROW_COUNT,exports['DEFAULT_PIVOT_NUMBER']=DEFAULT_PIVOT_NUMBER,exports[_0x273cf5(0x460)]=MovePivotFieldCommand,exports[_0x273cf5(0x3f0)]=MovePivotTableCommand,exports['PivotDisplayDataType']=PivotDisplayDataType,exports[_0x273cf5(0x491)]=PivotDrillDownCommand,exports[_0x273cf5(0x2e1)]=PivotTableOperationEnum,exports[_0x273cf5(0x242)]=PivotTableViewDirtyMarkOperation,exports[_0x273cf5(0x1c8)]=PositionType,exports[_0x273cf5(0x406)]=RemovePivotFieldCommand,exports['RemovePivotFieldMutation']=RemovePivotFieldMutation,exports[_0x273cf5(0x405)]=RemovePivotTableMutation,exports['RenamePivotFieldMutation']=RenamePivotFieldMutation,exports[_0x273cf5(0x330)]=ResetPivotFieldsConfigCommand,exports['SHEETS_PIVOT_PLUGIN_CONFIG_KEY']=SHEETS_PIVOT_PLUGIN_CONFIG_KEY,exports[_0x273cf5(0x340)]=SHEET_PIVOT_TABLE_PLUGIN,exports[_0x273cf5(0x1ca)]=SetPivotCollapseCommand,exports['SetPivotCollapseMutation']=SetPivotCollapseMutation,exports[_0x273cf5(0x45e)]=SetPivotFieldFormatMutation,exports[_0x273cf5(0x25a)]=SetPivotFieldsConfigCommand,exports[_0x273cf5(0x431)]=SetPivotFilterCommand,exports['SetPivotFilterMutation']=SetPivotFilterMutation,exports[_0x273cf5(0x22f)]=SetPivotOptionMutation,exports['SetPivotPositionMutation']=SetPivotPositionMutation,exports[_0x273cf5(0x466)]=SetPivotSortCommand,exports[_0x273cf5(0x1fa)]=SetPivotSortMutation,exports[_0x273cf5(0x4d8)]=SetPivotSubtotalTypeMutation,exports[_0x273cf5(0x1c9)]=SetPivotValueFilterCommand,exports[_0x273cf5(0x493)]=SetPivotValueFilterMutation,Object[_0x273cf5(0x2e3)](exports,_0x273cf5(0x31c),{'enumerable':!![],'get':function(){return SheetsPivotDataSourceModel;}}),Object[_0x273cf5(0x2e3)](exports,_0x273cf5(0x404),{'enumerable':!![],'get':function(){return SheetsPivotRPCService;}}),Object[_0x273cf5(0x2e3)](exports,_0x273cf5(0x1ec),{'enumerable':!![],'get':function(){return SheetsPivotTableAdaptorModel;}}),Object[_0x273cf5(0x2e3)](exports,_0x273cf5(0x49c),{'enumerable':!![],'get':function(){return SheetsPivotTableConfigModel;}}),Object[_0x273cf5(0x2e3)](exports,_0x273cf5(0x447),{'enumerable':!![],'get':function(){return SheetsPivotTableService;}}),Object[_0x273cf5(0x2e3)](exports,_0x273cf5(0x300),{'enumerable':!![],'get':function(){return UniverSheetsPivotTablePlugin;}}),exports['UpdateDateGroupCommand']=UpdateDateGroupCommand,exports[_0x273cf5(0x266)]=UpdateFieldPositionMutation,exports[_0x273cf5(0x363)]=UpdatePivotFieldSettingCommand,exports[_0x273cf5(0x341)]=UpdatePivotFieldSourceInfoMutation,exports[_0x273cf5(0x34e)]=UpdatePivotTableSourceRangeCommand,exports[_0x273cf5(0x45a)]=UpdatePivotTableSourceRangeMutation,exports[_0x273cf5(0x4ec)]=UpdatePivotValuePositionCommand,exports[_0x273cf5(0x282)]=UpdateValuePositionMutation,exports[_0x273cf5(0x2c1)]=applyChangeSet,exports[_0x273cf5(0x383)]=canUsePivot,exports[_0x273cf5(0x4ab)]=defaultThemeStyle,exports[_0x273cf5(0x37a)]=generateSetRangeValueMutations,exports[_0x273cf5(0x1e3)]=getAdjustRangesPosition,exports['getEmptyPivotRanges']=getEmptyPivotRanges,exports['getFieldListByArea']=getFieldListByArea,exports[_0x273cf5(0x332)]=getInsertRowColMutations,exports[_0x273cf5(0x418)]=getPivotCellInfo,exports[_0x273cf5(0x28c)]=getPivotInfoByLicense,exports[_0x273cf5(0x499)]=getPivotTableInfo,exports[_0x273cf5(0x3d2)]=transFromCellValue,exports[_0x273cf5(0x2b3)]=unionPivotViewRange;
|