@univerjs-pro/thread-comment-datasource 0.10.1-nightly.202508020912 → 0.10.2-nightly.202508071209
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x40d73c=_0x4459;(function(_0x9a07c7,_0x3c6f09){const _0x5888f6=_0x4459,_0xb07a69=_0x9a07c7();while(!![]){try{const _0x4c6176=parseInt(_0x5888f6(0x1b5))/0x1*(-parseInt(_0x5888f6(0x178))/0x2)+parseInt(_0x5888f6(0x1ad))/0x3*(parseInt(_0x5888f6(0x1a8))/0x4)+-parseInt(_0x5888f6(0x17d))/0x5+-parseInt(_0x5888f6(0x175))/0x6+parseInt(_0x5888f6(0x195))/0x7*(-parseInt(_0x5888f6(0x19a))/0x8)+-parseInt(_0x5888f6(0x16c))/0x9+parseInt(_0x5888f6(0x172))/0xa*(parseInt(_0x5888f6(0x196))/0xb);if(_0x4c6176===_0x3c6f09)break;else _0xb07a69['push'](_0xb07a69['shift']());}catch(_0x561050){_0xb07a69['push'](_0xb07a69['shift']());}}}(_0x52e3,0x894a3));Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0x40d73c(0x1b7)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),w=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),j=require('rxjs'),P=require('@univerjs/network'),U=_0x40d73c(0x1bb);var I=(_0x157ff5=>(_0x157ff5[_0x157ff5[_0x40d73c(0x162)]=0x0]=_0x40d73c(0x162),_0x157ff5[_0x157ff5[_0x40d73c(0x171)]=0x1]='Solved',_0x157ff5[_0x157ff5['UNRECOGNIZED']=-0x1]=_0x40d73c(0x1a1),_0x157ff5))(I||{}),v=(_0x25850e=>(_0x25850e[_0x25850e[_0x40d73c(0x188)]=0x0]=_0x40d73c(0x188),_0x25850e[_0x25850e[_0x40d73c(0x18f)]=0x1]=_0x40d73c(0x18f),_0x25850e[_0x25850e[_0x40d73c(0x187)]=0x2]='Reply',_0x25850e[_0x25850e['Edit']=0x3]=_0x40d73c(0x183),_0x25850e[_0x25850e[_0x40d73c(0x176)]=0x4]=_0x40d73c(0x176),_0x25850e[_0x25850e[_0x40d73c(0x191)]=0x5]=_0x40d73c(0x191),_0x25850e[_0x25850e['UNRECOGNIZED']=-0x1]=_0x40d73c(0x1a1),_0x25850e))(v||{});const f=_0x4f64b3=>c[_0x40d73c(0x180)](new Date(+_0x4f64b3))[_0x40d73c(0x18d)](_0x40d73c(0x18a)),R=async(_0x503cae,_0x2969c2)=>{const _0x50fc49=_0x40d73c,_0x2249e6=_0x503cae[_0x50fc49(0x16d)](c[_0x50fc49(0x1c5)]),_0x306fd2=_0x503cae['get'](P['HTTPService']);_0x2969c2['forEach'](_0x2c69e8=>{const _0x28af90=_0x50fc49;_0x2249e6['getUser'](_0x2c69e8)&&_0x2969c2[_0x28af90(0x1a3)](_0x2c69e8);}),_0x2969c2[_0x50fc49(0x1c0)]&&(await _0x306fd2[_0x50fc49(0x16d)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2969c2]}}))[_0x50fc49(0x165)][_0x50fc49(0x163)][_0x50fc49(0x170)](_0x1b90ef=>{const _0x2f380a=_0x50fc49;_0x1b90ef&&_0x2249e6[_0x2f380a(0x166)](_0x1b90ef);});};var $=Object[_0x40d73c(0x1af)],E=(_0x54ff0e,_0x34cf81,_0x4ef00e,_0x31d125)=>{const _0x11a611=_0x40d73c;for(var _0xc645a2=_0x31d125>0x1?void 0x0:_0x31d125?$(_0x34cf81,_0x4ef00e):_0x34cf81,_0x2a7ff0=_0x54ff0e[_0x11a611(0x160)]-0x1,_0x2afcd8;_0x2a7ff0>=0x0;_0x2a7ff0--)(_0x2afcd8=_0x54ff0e[_0x2a7ff0])&&(_0xc645a2=_0x2afcd8(_0xc645a2)||_0xc645a2);return _0xc645a2;},S=(_0x482d23,_0x1a034a)=>(_0x159433,_0x16276e)=>_0x1a034a(_0x159433,_0x16276e,_0x482d23);let _=class extends c[_0x40d73c(0x1b8)]{constructor(_0xa73dd9,_0x3aa852,_0x4dba0e,_0x5257cb){const _0x5891eb=_0x40d73c;super(),this[_0x5891eb(0x18e)]=_0xa73dd9,this['_threadCommentModel']=_0x3aa852,this[_0x5891eb(0x161)]=_0x4dba0e,this[_0x5891eb(0x167)]=_0x5257cb,this[_0x5891eb(0x19c)](),this[_0x5891eb(0x15e)]();}['_initUserSync'](){const _0x8bfb91=_0x40d73c;this[_0x8bfb91(0x1b2)](this[_0x8bfb91(0x199)][_0x8bfb91(0x193)][_0x8bfb91(0x156)](j[_0x8bfb91(0x189)](0x10))[_0x8bfb91(0x17b)](_0x3aae10=>{const _0xc0ec4=_0x8bfb91,_0x50a836=new Set();_0x3aae10[_0xc0ec4(0x170)](_0x4e0e06=>{const _0x1b34f0=_0xc0ec4;switch(_0x4e0e06[_0x1b34f0(0x1aa)]){case _0x1b34f0(0x1a2):{const _0x51c07b=_0x4e0e06[_0x1b34f0(0x1bc)]['personId'];_0x50a836[_0x1b34f0(0x1a2)](_0x51c07b);break;}}}),R(this[_0xc0ec4(0x167)],_0x50a836);}));}[_0x40d73c(0x19c)](){const _0x13628a=_0x40d73c;this['disposeWithMe'](this[_0x13628a(0x18e)][_0x13628a(0x193)][_0x13628a(0x17b)](async _0x4b40d9=>{const _0x3150c3=_0x13628a;var _0x20c38d,_0x3bc3e0,_0x2aa845,_0x4ce09d;const _0x2eab6a=(_0x20c38d=this[_0x3150c3(0x199)]['getUnit'](_0x4b40d9[_0x3150c3(0x1b4)])[_0x3150c3(0x17e)](_0xff039c=>_0xff039c['threadId']===_0x4b40d9['threadId']))==null?void 0x0:_0x20c38d['root'];if(!_0x2eab6a)return;const {unitId:_0xa60026,subUnitId:_0x7f8a73}=_0x2eab6a;switch(_0x4b40d9[_0x3150c3(0x19d)]&&this[_0x3150c3(0x161)][_0x3150c3(0x166)](_0x4b40d9[_0x3150c3(0x19d)]),_0x4b40d9['type']){case v[_0x3150c3(0x18f)]:break;case v[_0x3150c3(0x187)]:{this[_0x3150c3(0x199)][_0x3150c3(0x1c4)](_0xa60026,_0x7f8a73,{'unitId':_0xa60026,'subUnitId':_0x7f8a73,'ref':'','id':_0x4b40d9[_0x3150c3(0x186)],'dT':f(+_0x4b40d9['createTimestamp']),'threadId':_0x4b40d9[_0x3150c3(0x1a7)],'personId':(_0x2aa845=(_0x3bc3e0=_0x4b40d9[_0x3150c3(0x19d)])==null?void 0x0:_0x3bc3e0['userID'])!=null?_0x2aa845:_0x4b40d9['userId'],'text':JSON[_0x3150c3(0x1a0)](_0x4b40d9[_0x3150c3(0x179)]),'parentId':_0x2eab6a['id']});break;}case v['Delete']:{const _0x55bdf0=this['_threadCommentModel']['getComment'](_0xa60026,_0x7f8a73,_0x4b40d9[_0x3150c3(0x186)]);_0x55bdf0&&_0x55bdf0['parentId']&&this[_0x3150c3(0x199)]['deleteComment'](_0xa60026,_0x7f8a73,_0x4b40d9[_0x3150c3(0x186)]);break;}case v[_0x3150c3(0x183)]:{this[_0x3150c3(0x199)][_0x3150c3(0x19b)](_0xa60026,_0x7f8a73,{'commentId':_0x4b40d9[_0x3150c3(0x186)],'text':JSON[_0x3150c3(0x1a0)](_0x4b40d9[_0x3150c3(0x179)])});break;}case v['Solve']:{const _0x316d80=(_0x4ce09d=this[_0x3150c3(0x199)]['getUnit'](_0x4b40d9['unitId'])[_0x3150c3(0x17e)](_0x157cdb=>_0x157cdb[_0x3150c3(0x1a7)]===_0x4b40d9[_0x3150c3(0x1a7)]))==null?void 0x0:_0x4ce09d[_0x3150c3(0x173)];_0x316d80&&this[_0x3150c3(0x199)][_0x3150c3(0x15d)](_0xa60026,_0x7f8a73,_0x316d80['id'],_0x4b40d9[_0x3150c3(0x184)]===I[_0x3150c3(0x171)]);break;}}}));}};_=E([S(0x0,c[_0x40d73c(0x19e)](b['CommentService'])),S(0x1,c[_0x40d73c(0x19e)](M[_0x40d73c(0x198)])),S(0x2,c[_0x40d73c(0x19e)](c[_0x40d73c(0x1c5)])),S(0x3,c[_0x40d73c(0x19e)](c['Injector']))],_);const q='thread-comment-data-source.config',D={};var A=Object[_0x40d73c(0x1af)],x=(_0x137a71,_0x3a335d,_0x395905,_0x22ed38)=>{const _0x437aeb=_0x40d73c;for(var _0x1fb4f5=_0x22ed38>0x1?void 0x0:_0x22ed38?A(_0x3a335d,_0x395905):_0x3a335d,_0x1e4c52=_0x137a71[_0x437aeb(0x160)]-0x1,_0x4ed7c3;_0x1e4c52>=0x0;_0x1e4c52--)(_0x4ed7c3=_0x137a71[_0x1e4c52])&&(_0x1fb4f5=_0x4ed7c3(_0x1fb4f5)||_0x1fb4f5);return _0x1fb4f5;},C=(_0x937819,_0x32dfae)=>(_0x425f50,_0x646150)=>_0x32dfae(_0x425f50,_0x646150,_0x937819);function Y(_0x3b45bf,_0x420db8){const _0x8fa5be=_0x40d73c,_0x175f58=_0x3b45bf['replies'][0x0];return{..._0x420db8,'id':_0x175f58[_0x8fa5be(0x186)],'resolved':_0x3b45bf[_0x8fa5be(0x184)]===0x1,'dT':f(_0x175f58[_0x8fa5be(0x159)]),'personId':_0x175f58[_0x8fa5be(0x19f)],'threadId':_0x175f58[_0x8fa5be(0x1a7)]};}function G(_0x512437,_0x7c2ef5,_0x328e5b){const _0x19744b=_0x40d73c;var _0xb63a78,_0x20e4aa;if(((_0x20e4aa=(_0xb63a78=_0x512437==null?void 0x0:_0x512437['replies'])==null?void 0x0:_0xb63a78[_0x19744b(0x160)])!=null?_0x20e4aa:0x0)>0x0){const _0x2332ae=(_0x1761eb,_0x415ecd)=>({'id':_0x1761eb[_0x19744b(0x186)],'threadId':_0x1761eb[_0x19744b(0x1a7)],'dT':f(_0x1761eb[_0x19744b(0x159)]),'personId':_0x1761eb[_0x19744b(0x19f)],'resolved':_0x512437[_0x19744b(0x184)]===I[_0x19744b(0x171)],'unitId':_0x7c2ef5,'subUnitId':_0x328e5b,'text':JSON[_0x19744b(0x1a0)](_0x1761eb['content']),'parentId':_0x415ecd}),_0x31f7c6=_0x2332ae(_0x512437[_0x19744b(0x1a5)][0x0]);return{..._0x31f7c6,'children':_0x512437[_0x19744b(0x1a5)][_0x19744b(0x182)](0x1)[_0x19744b(0x1c6)](_0xd700e9=>_0x2332ae(_0xd700e9,_0x31f7c6['id']))};}return null;}let p=class{constructor(_0x220570,_0x5ea29a,_0x7fa594){const _0x2ffd68=_0x40d73c;this[_0x2ffd68(0x1bf)]=_0x220570,this[_0x2ffd68(0x161)]=_0x5ea29a,this['_sessionService']=_0x7fa594;}async['addComment'](_0x28c7b1){const _0x522bef=_0x40d73c;var _0x4b2a88,_0x1dc8e7;const {parentId:_0x1e556a,unitId:_0x26fe0b,text:_0x2a6ac0,threadId:_0x5913bb}=_0x28c7b1,_0x2f65fc=(_0x1dc8e7=(_0x4b2a88=_0x2a6ac0[_0x522bef(0x16b)])==null?void 0x0:_0x4b2a88[_0x522bef(0x1b1)](_0x4245ea=>_0x4245ea[_0x522bef(0x190)]===c[_0x522bef(0x174)]['COMMENT'])[_0x522bef(0x1c6)](_0xa1bf5c=>_0xa1bf5c['rangeId']))!=null?_0x1dc8e7:[],_0x5bf137=JSON[_0x522bef(0x1a9)](_0x2a6ac0),_0x219f1d=(await this['_sessionService'][_0x522bef(0x18b)](_0x26fe0b))[_0x522bef(0x15f)]();if(_0x1e556a){const _0x13a42d={'memberId':_0x219f1d,'unitId':_0x26fe0b,'content':_0x5bf137,'mention':_0x2f65fc,'threadId':_0x5913bb},_0xb63640=(await this['_httpService'][_0x522bef(0x1b3)](_0x522bef(0x168)+_0x26fe0b+_0x522bef(0x1a6),{'body':_0x13a42d}))[_0x522bef(0x165)]['reply'];return{..._0x28c7b1,'id':_0xb63640[_0x522bef(0x186)],'dT':c[_0x522bef(0x180)](+_0xb63640[_0x522bef(0x159)])[_0x522bef(0x18d)](_0x522bef(0x18a)),'personId':_0xb63640[_0x522bef(0x19f)]};}else{const _0x539014={'memberId':_0x219f1d,'unitId':_0x26fe0b,'content':_0x5bf137,'mention':_0x2f65fc},_0x22ef51=await this[_0x522bef(0x1bf)]['post']('/universer-api/comment/unit/'+_0x26fe0b+_0x522bef(0x1c2),{'body':_0x539014});return Y(_0x22ef51[_0x522bef(0x165)][_0x522bef(0x1be)],_0x28c7b1);}}async[_0x40d73c(0x19b)](_0x1612fb){const _0x695713=_0x40d73c;var _0x53f67d,_0x37f866;const {text:_0x34dc87,unitId:_0x5da15d}=_0x1612fb,_0x338549=(_0x37f866=(_0x53f67d=_0x34dc87[_0x695713(0x16b)])==null?void 0x0:_0x53f67d[_0x695713(0x1b1)](_0x18b04a=>_0x18b04a[_0x695713(0x190)]===c[_0x695713(0x174)]['COMMENT'])[_0x695713(0x1c6)](_0x45accb=>_0x45accb['rangeId']))!=null?_0x37f866:[],_0x9a285c=JSON['stringify'](_0x34dc87),_0x5d5151=_0x1612fb['threadId'],_0x311b88=_0x1612fb['id'],_0x4dde97={'memberId':(await this[_0x695713(0x16f)]['requireSession'](_0x5da15d))[_0x695713(0x15f)](),'unitId':_0x5da15d,'threadId':_0x5d5151,'mention':_0x338549,'content':_0x9a285c,'replyId':_0x311b88},_0x24b58d=await this[_0x695713(0x1bf)][_0x695713(0x1b3)](_0x695713(0x168)+_0x5da15d+'/edit',{'body':_0x4dde97});return!_0x24b58d['body'][_0x695713(0x157)]||_0x24b58d[_0x695713(0x165)][_0x695713(0x157)][_0x695713(0x1b9)]===0x1;}async['resolveComment'](_0x5c3e42){const _0x4f8c4c=_0x40d73c,{unitId:_0x3409c7}=_0x5c3e42,_0x1760a8=_0x5c3e42['threadId'],_0x37caa7={'memberId':this['_userService'][_0x4f8c4c(0x15b)]()[_0x4f8c4c(0x194)],'unitId':_0x3409c7,'threadId':_0x1760a8,'solved':_0x5c3e42[_0x4f8c4c(0x1ae)]?I[_0x4f8c4c(0x171)]:I[_0x4f8c4c(0x162)]},_0x571b8d=await this[_0x4f8c4c(0x1bf)][_0x4f8c4c(0x1b3)](_0x4f8c4c(0x168)+_0x3409c7+_0x4f8c4c(0x1ba),{'body':_0x37caa7});return!_0x571b8d[_0x4f8c4c(0x165)][_0x4f8c4c(0x157)]||_0x571b8d[_0x4f8c4c(0x165)][_0x4f8c4c(0x157)][_0x4f8c4c(0x1b9)]===0x1;}async[_0x40d73c(0x1c8)](_0x3b36d2,_0x2f2303,_0x553c70,_0x5a424c){const _0x2721ac=_0x40d73c,_0x52688c={'memberId':(await this[_0x2721ac(0x16f)][_0x2721ac(0x18b)](_0x3b36d2))[_0x2721ac(0x15f)](),'threadId':_0x553c70,'replyId':_0x5a424c,'unitId':_0x3b36d2},_0x293bab=await this[_0x2721ac(0x1bf)][_0x2721ac(0x1b3)]('/universer-api/comment/unit/'+_0x3b36d2+'/delete',{'body':_0x52688c});return!_0x293bab[_0x2721ac(0x165)][_0x2721ac(0x157)]||_0x293bab[_0x2721ac(0x165)][_0x2721ac(0x157)]['code']===0x1;}async[_0x40d73c(0x164)](_0x43add8,_0x57bd48,_0xedf0c5){const _0xadde1f=_0x40d73c,_0x1b7050={'unitId':_0x43add8,'threadId':_0xedf0c5},_0x237345=await this[_0xadde1f(0x1bf)][_0xadde1f(0x1b3)]('/universer-api/comment/unit/'+_0x43add8+_0xadde1f(0x1ab),{'body':_0x1b7050}),_0x1fe52c=_0xedf0c5['map'](_0x29bd83=>G(_0x237345[_0xadde1f(0x165)][_0xadde1f(0x155)][_0x29bd83],_0x43add8,_0x57bd48))[_0xadde1f(0x1b1)](Boolean);return Object['values'](_0x237345[_0xadde1f(0x165)][_0xadde1f(0x163)])['forEach'](_0x2cfa1b=>{const _0x4e20f6=_0xadde1f;this[_0x4e20f6(0x161)][_0x4e20f6(0x166)](_0x2cfa1b);}),_0x1fe52c;}['saveCommentToSnapshot'](_0x32a219){const _0x1e6a41=_0x40d73c;return{'id':_0x32a219['id'],'threadId':_0x32a219[_0x1e6a41(0x1a7)],'ref':_0x32a219[_0x1e6a41(0x177)]};}};p=x([C(0x0,c['Inject'](P[_0x40d73c(0x158)])),C(0x1,c[_0x40d73c(0x19e)](c[_0x40d73c(0x1c5)])),C(0x2,c[_0x40d73c(0x19e)](b[_0x40d73c(0x17a)]))],p);var H=Object[_0x40d73c(0x1af)],J=(_0x2b4923,_0x527b00,_0x314a7c,_0x1be7fe)=>{const _0x44af0a=_0x40d73c;for(var _0x3e183d=_0x1be7fe>0x1?void 0x0:_0x1be7fe?H(_0x527b00,_0x314a7c):_0x527b00,_0xb2e436=_0x2b4923[_0x44af0a(0x160)]-0x1,_0x371697;_0xb2e436>=0x0;_0xb2e436--)(_0x371697=_0x2b4923[_0xb2e436])&&(_0x3e183d=_0x371697(_0x3e183d)||_0x3e183d);return _0x3e183d;},y=(_0x5a0c5b,_0x2eee8d)=>(_0x3c954c,_0x50b502)=>_0x2eee8d(_0x3c954c,_0x50b502,_0x5a0c5b);function _0x52e3(){const _0x434eb8=['UniverThreadCommentDataSourcePlugin','filter','disposeWithMe','post','unitId','119265zkPoaR','IConfigService','Module','Disposable','code','/solved','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','payload','_config','comment','_httpService','size','_threadCommentDataSource','/add','_configService','addComment','UserManagerService','map','dataSource','deleteComment','comments','pipe','error','HTTPService','createTimestamp','UniverThreadCommentUIPlugin','getCurrentUser','_threadCommentDataSourceService','resolveComment','_initUserSync','getMemberID','length','_userService','OpenOrReOpen','users','listComments','body','addUser','_injector','/universer-api/comment/unit/','defineProperty','symbol','customRanges','5948037UFJffZ','get','UniverInstanceType','_sessionService','forEach','Solved','30YOdFbE','root','CustomRangeType','3598614wyLWbH','Delete','ref','2SEVRzV','content','CollaborationSessionService','subscribe','onStarting','4766545lFbmvW','find','UNIVER_UNKNOWN','dayjs','IThreadCommentDataSourceService','slice','Edit','solved','onReady','replyId','Reply','Unknown','bufferTime','YYYY/MM/DD\x20HH:mm','requireSession','_initDataSource','format','_commentService','Add','rangeType','Solve','setConfig','commentUpdate$','userID','434fjwMmZ','9052890xITRtR','Injector','ThreadCommentModel','_threadCommentModel','20112RNoAeb','updateComment','_init','user','Inject','userId','parse','UNRECOGNIZED','add','delete','merge','replies','/reply','threadId','4DmcCUL','stringify','type','/list','syncUpdateMutationToColla','1747419QRfdxc','resolved','getOwnPropertyDescriptor'];_0x52e3=function(){return _0x434eb8;};return _0x52e3();}let g=class extends c['Disposable']{constructor(_0x26f35e,_0x455d40){const _0x4da7a1=_0x40d73c;super(),this[_0x4da7a1(0x15c)]=_0x26f35e,this[_0x4da7a1(0x1c1)]=_0x455d40,this[_0x4da7a1(0x18c)]();}['_initDataSource'](){const _0x35f63f=_0x40d73c;this[_0x35f63f(0x15c)][_0x35f63f(0x1c7)]=this['_threadCommentDataSource'],this[_0x35f63f(0x15c)][_0x35f63f(0x1ac)]=!0x1;}};g=J([y(0x0,M[_0x40d73c(0x181)]),y(0x1,c[_0x40d73c(0x19e)](p))],g);function _0x4459(_0x552427,_0x284c08){const _0x52e3ec=_0x52e3();return _0x4459=function(_0x445926,_0x2a50f9){_0x445926=_0x445926-0x155;let _0x4c2ca3=_0x52e3ec[_0x445926];return _0x4c2ca3;},_0x4459(_0x552427,_0x284c08);}var F=Object[_0x40d73c(0x169)],L=Object['getOwnPropertyDescriptor'],Z=(_0x11ec7b,_0x3de5db,_0x325f8d)=>_0x3de5db in _0x11ec7b?F(_0x11ec7b,_0x3de5db,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x325f8d}):_0x11ec7b[_0x3de5db]=_0x325f8d,W=(_0x5825ec,_0x3a094a,_0x1cd651,_0x4496cf)=>{const _0x1b986d=_0x40d73c;for(var _0x3ad23e=_0x4496cf>0x1?void 0x0:_0x4496cf?L(_0x3a094a,_0x1cd651):_0x3a094a,_0x1c4087=_0x5825ec[_0x1b986d(0x160)]-0x1,_0x438760;_0x1c4087>=0x0;_0x1c4087--)(_0x438760=_0x5825ec[_0x1c4087])&&(_0x3ad23e=_0x438760(_0x3ad23e)||_0x3ad23e);return _0x3ad23e;},O=(_0x4069ba,_0x390d1f)=>(_0x24171b,_0x560811)=>_0x390d1f(_0x24171b,_0x560811,_0x4069ba),N=(_0x284cd2,_0x1f78e4,_0x82b172)=>Z(_0x284cd2,typeof _0x1f78e4!=_0x40d73c(0x16a)?_0x1f78e4+'':_0x1f78e4,_0x82b172);exports[_0x40d73c(0x1b0)]=class extends c['Plugin']{constructor(_0x37b45a=D,_0x4c952b,_0x27b0ec){const _0x30ce3e=_0x40d73c;super(),this[_0x30ce3e(0x1bd)]=_0x37b45a,this[_0x30ce3e(0x167)]=_0x4c952b,this[_0x30ce3e(0x1c3)]=_0x27b0ec;const {..._0x1ffe7a}=c[_0x30ce3e(0x1a4)]({},D,this[_0x30ce3e(0x1bd)]);this['_configService'][_0x30ce3e(0x192)](q,_0x1ffe7a);}[_0x40d73c(0x17c)](){const _0x506de2=_0x40d73c;[[p],[g],[_]][_0x506de2(0x170)](_0x37b92d=>{const _0x28b483=_0x506de2;this['_injector'][_0x28b483(0x1a2)](_0x37b92d);});}[_0x40d73c(0x185)](){const _0x596cb0=_0x40d73c;this[_0x596cb0(0x167)][_0x596cb0(0x16d)](g),this['_injector'][_0x596cb0(0x16d)](_);}},N(exports[_0x40d73c(0x1b0)],'pluginName',U),N(exports[_0x40d73c(0x1b0)],_0x40d73c(0x1aa),c[_0x40d73c(0x16e)][_0x40d73c(0x17f)]),exports[_0x40d73c(0x1b0)]=W([c['DependentOn'](w[_0x40d73c(0x15a)],b['UniverCollaborationClientPlugin'],T['UniverLicensePlugin']),O(0x1,c['Inject'](c[_0x40d73c(0x197)])),O(0x2,c[_0x40d73c(0x1b6)])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0x467677=_0xff50;(function(_0x45827a,_0x42a44e){const _0x41cc84=_0xff50,_0x3fff7d=_0x45827a();while(!![]){try{const _0x147664=parseInt(_0x41cc84(0xce))/0x1*(-parseInt(_0x41cc84(0xe1))/0x2)+-parseInt(_0x41cc84(0xc7))/0x3+parseInt(_0x41cc84(0xd6))/0x4+-parseInt(_0x41cc84(0x106))/0x5+parseInt(_0x41cc84(0x110))/0x6+parseInt(_0x41cc84(0x132))/0x7*(-parseInt(_0x41cc84(0xcb))/0x8)+parseInt(_0x41cc84(0xea))/0x9;if(_0x147664===_0x42a44e)break;else _0x3fff7d['push'](_0x3fff7d['shift']());}catch(_0xd7e95){_0x3fff7d['push'](_0x3fff7d['shift']());}}}(_0x1e94,0x7e44b));Object[_0x467677(0x103)](exports,Symbol[_0x467677(0x10c)],{'value':_0x467677(0xc3)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),w=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),j=require('rxjs'),P=require('@univerjs/network'),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x4fbf1f=>(_0x4fbf1f[_0x4fbf1f['OpenOrReOpen']=0x0]=_0x467677(0xd7),_0x4fbf1f[_0x4fbf1f[_0x467677(0xdf)]=0x1]=_0x467677(0xdf),_0x4fbf1f[_0x4fbf1f[_0x467677(0xfb)]=-0x1]='UNRECOGNIZED',_0x4fbf1f))(I||{}),v=(_0x157cae=>(_0x157cae[_0x157cae[_0x467677(0x11f)]=0x0]=_0x467677(0x11f),_0x157cae[_0x157cae[_0x467677(0x133)]=0x1]=_0x467677(0x133),_0x157cae[_0x157cae[_0x467677(0x112)]=0x2]=_0x467677(0x112),_0x157cae[_0x157cae[_0x467677(0x134)]=0x3]=_0x467677(0x134),_0x157cae[_0x157cae[_0x467677(0xe5)]=0x4]=_0x467677(0xe5),_0x157cae[_0x157cae[_0x467677(0x139)]=0x5]=_0x467677(0x139),_0x157cae[_0x157cae[_0x467677(0xfb)]=-0x1]='UNRECOGNIZED',_0x157cae))(v||{});const f=_0x380333=>c[_0x467677(0x12a)](new Date(+_0x380333))['format'](_0x467677(0x10f)),R=async(_0x5317f3,_0x187e1c)=>{const _0x2e254a=_0x467677,_0x405533=_0x5317f3[_0x2e254a(0xdc)](c['UserManagerService']),_0xd68b95=_0x5317f3[_0x2e254a(0xdc)](P[_0x2e254a(0xf5)]);_0x187e1c[_0x2e254a(0x12e)](_0x4bdb1e=>{const _0x504c90=_0x2e254a;_0x405533[_0x504c90(0xfe)](_0x4bdb1e)&&_0x187e1c[_0x504c90(0x105)](_0x4bdb1e);}),_0x187e1c[_0x2e254a(0x100)]&&(await _0xd68b95[_0x2e254a(0xdc)]('/universer-api/user/list',{'params':{'userIDs':[..._0x187e1c]}}))['body'][_0x2e254a(0xcc)][_0x2e254a(0x12e)](_0x3de295=>{const _0x4c5985=_0x2e254a;_0x3de295&&_0x405533[_0x4c5985(0xdb)](_0x3de295);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x4587a2,_0x10662a,_0x1c7793,_0x595f6c)=>{const _0x4cabbd=_0x467677;for(var _0x2f0298=_0x595f6c>0x1?void 0x0:_0x595f6c?$(_0x10662a,_0x1c7793):_0x10662a,_0x4363cc=_0x4587a2[_0x4cabbd(0xeb)]-0x1,_0x912bf2;_0x4363cc>=0x0;_0x4363cc--)(_0x912bf2=_0x4587a2[_0x4363cc])&&(_0x2f0298=_0x912bf2(_0x2f0298)||_0x2f0298);return _0x2f0298;},S=(_0x4b0d07,_0x164773)=>(_0x25157d,_0x3a5ff9)=>_0x164773(_0x25157d,_0x3a5ff9,_0x4b0d07);let _=class extends c[_0x467677(0xd1)]{constructor(_0xef9b5b,_0x287936,_0x1cacc9,_0x482386){const _0x75f76e=_0x467677;super(),this['_commentService']=_0xef9b5b,this['_threadCommentModel']=_0x287936,this['_userService']=_0x1cacc9,this['_injector']=_0x482386,this[_0x75f76e(0xf6)](),this[_0x75f76e(0xe6)]();}[_0x467677(0xe6)](){const _0x106c67=_0x467677;this[_0x106c67(0x123)](this[_0x106c67(0x122)][_0x106c67(0xec)][_0x106c67(0x11d)](j['bufferTime'](0x10))[_0x106c67(0xd5)](_0xafee35=>{const _0x3cf8e5=_0x106c67,_0xc55f28=new Set();_0xafee35['forEach'](_0x167c62=>{const _0x5dc1c3=_0xff50;switch(_0x167c62[_0x5dc1c3(0xf3)]){case _0x5dc1c3(0xc4):{const _0x161af1=_0x167c62[_0x5dc1c3(0x12f)]['personId'];_0xc55f28[_0x5dc1c3(0xc4)](_0x161af1);break;}}}),R(this[_0x3cf8e5(0xd2)],_0xc55f28);}));}['_init'](){const _0x5a9751=_0x467677;this[_0x5a9751(0x123)](this[_0x5a9751(0x127)][_0x5a9751(0xec)][_0x5a9751(0xd5)](async _0x124641=>{const _0x527641=_0x5a9751;var _0x558274,_0x543c6c,_0x8f4297,_0x4c9a09;const _0xfa7818=(_0x558274=this['_threadCommentModel'][_0x527641(0x135)](_0x124641[_0x527641(0x10e)])['find'](_0x1ee875=>_0x1ee875[_0x527641(0xd0)]===_0x124641[_0x527641(0xd0)]))==null?void 0x0:_0x558274[_0x527641(0x11a)];if(!_0xfa7818)return;const {unitId:_0x49e075,subUnitId:_0x5931af}=_0xfa7818;switch(_0x124641[_0x527641(0x12d)]&&this[_0x527641(0x116)][_0x527641(0xdb)](_0x124641[_0x527641(0x12d)]),_0x124641[_0x527641(0xf3)]){case v[_0x527641(0x133)]:break;case v[_0x527641(0x112)]:{this[_0x527641(0x122)]['addComment'](_0x49e075,_0x5931af,{'unitId':_0x49e075,'subUnitId':_0x5931af,'ref':'','id':_0x124641[_0x527641(0xca)],'dT':f(+_0x124641['createTimestamp']),'threadId':_0x124641['threadId'],'personId':(_0x8f4297=(_0x543c6c=_0x124641[_0x527641(0x12d)])==null?void 0x0:_0x543c6c['userID'])!=null?_0x8f4297:_0x124641[_0x527641(0x136)],'text':JSON[_0x527641(0x12c)](_0x124641['content']),'parentId':_0xfa7818['id']});break;}case v[_0x527641(0xe5)]:{const _0x93b88c=this[_0x527641(0x122)][_0x527641(0xc6)](_0x49e075,_0x5931af,_0x124641[_0x527641(0xca)]);_0x93b88c&&_0x93b88c[_0x527641(0x128)]&&this[_0x527641(0x122)][_0x527641(0x137)](_0x49e075,_0x5931af,_0x124641['replyId']);break;}case v[_0x527641(0x134)]:{this[_0x527641(0x122)][_0x527641(0xc5)](_0x49e075,_0x5931af,{'commentId':_0x124641['replyId'],'text':JSON[_0x527641(0x12c)](_0x124641['content'])});break;}case v[_0x527641(0x139)]:{const _0x3ddf6f=(_0x4c9a09=this[_0x527641(0x122)][_0x527641(0x135)](_0x124641['unitId'])[_0x527641(0x125)](_0x8931b=>_0x8931b[_0x527641(0xd0)]===_0x124641[_0x527641(0xd0)]))==null?void 0x0:_0x4c9a09['root'];_0x3ddf6f&&this[_0x527641(0x122)][_0x527641(0x107)](_0x49e075,_0x5931af,_0x3ddf6f['id'],_0x124641[_0x527641(0x10b)]===I['Solved']);break;}}}));}};_=E([S(0x0,c[_0x467677(0xc2)](b[_0x467677(0xed)])),S(0x1,c['Inject'](M[_0x467677(0xf2)])),S(0x2,c['Inject'](c[_0x467677(0x130)])),S(0x3,c['Inject'](c['Injector']))],_);const q=_0x467677(0xe8),D={};var A=Object[_0x467677(0xfc)],x=(_0x515595,_0x1cc5fa,_0x1b0684,_0x3b7a03)=>{for(var _0x53d0da=_0x3b7a03>0x1?void 0x0:_0x3b7a03?A(_0x1cc5fa,_0x1b0684):_0x1cc5fa,_0x58aa31=_0x515595['length']-0x1,_0xb39c93;_0x58aa31>=0x0;_0x58aa31--)(_0xb39c93=_0x515595[_0x58aa31])&&(_0x53d0da=_0xb39c93(_0x53d0da)||_0x53d0da);return _0x53d0da;},C=(_0x3a235a,_0x19690e)=>(_0x4b171e,_0x1ca552)=>_0x19690e(_0x4b171e,_0x1ca552,_0x3a235a);function Y(_0x483bf7,_0x4eada8){const _0xb3171c=_0x467677,_0x41b6e5=_0x483bf7['replies'][0x0];return{..._0x4eada8,'id':_0x41b6e5[_0xb3171c(0xca)],'resolved':_0x483bf7['solved']===0x1,'dT':f(_0x41b6e5['createTimestamp']),'personId':_0x41b6e5['userId'],'threadId':_0x41b6e5[_0xb3171c(0xd0)]};}function G(_0x21aff8,_0x30d4e3,_0x2d5e11){const _0x851cc1=_0x467677;var _0x570226,_0x426fc7;if(((_0x426fc7=(_0x570226=_0x21aff8==null?void 0x0:_0x21aff8[_0x851cc1(0x124)])==null?void 0x0:_0x570226[_0x851cc1(0xeb)])!=null?_0x426fc7:0x0)>0x0){const _0x1418a7=(_0x4fcd9f,_0x5aa67c)=>({'id':_0x4fcd9f[_0x851cc1(0xca)],'threadId':_0x4fcd9f[_0x851cc1(0xd0)],'dT':f(_0x4fcd9f[_0x851cc1(0xe7)]),'personId':_0x4fcd9f['userId'],'resolved':_0x21aff8['solved']===I[_0x851cc1(0xdf)],'unitId':_0x30d4e3,'subUnitId':_0x2d5e11,'text':JSON[_0x851cc1(0x12c)](_0x4fcd9f[_0x851cc1(0xf7)]),'parentId':_0x5aa67c}),_0x31021e=_0x1418a7(_0x21aff8[_0x851cc1(0x124)][0x0]);return{..._0x31021e,'children':_0x21aff8[_0x851cc1(0x124)]['slice'](0x1)[_0x851cc1(0x129)](_0x1ee3a0=>_0x1418a7(_0x1ee3a0,_0x31021e['id']))};}return null;}let p=class{constructor(_0x18ca1b,_0x22303e,_0x3d8cde){const _0x24a3b8=_0x467677;this[_0x24a3b8(0x111)]=_0x18ca1b,this['_userService']=_0x22303e,this[_0x24a3b8(0xd4)]=_0x3d8cde;}async['addComment'](_0x229b2c){const _0x1712d0=_0x467677;var _0x19bac4,_0x16ae0d;const {parentId:_0x18ebfe,unitId:_0x2d5bf8,text:_0x145fac,threadId:_0x443c70}=_0x229b2c,_0x5ec8b1=(_0x16ae0d=(_0x19bac4=_0x145fac['customRanges'])==null?void 0x0:_0x19bac4['filter'](_0x5cb8de=>_0x5cb8de[_0x1712d0(0x101)]===c[_0x1712d0(0xee)]['COMMENT'])['map'](_0x381f2a=>_0x381f2a[_0x1712d0(0x115)]))!=null?_0x16ae0d:[],_0x1e3ae8=JSON[_0x1712d0(0xe9)](_0x145fac),_0x1b2e43=(await this[_0x1712d0(0xd4)][_0x1712d0(0x131)](_0x2d5bf8))['getMemberID']();if(_0x18ebfe){const _0x10ee86={'memberId':_0x1b2e43,'unitId':_0x2d5bf8,'content':_0x1e3ae8,'mention':_0x5ec8b1,'threadId':_0x443c70},_0x2a3d3a=(await this[_0x1712d0(0x111)][_0x1712d0(0x120)]('/universer-api/comment/unit/'+_0x2d5bf8+_0x1712d0(0xf9),{'body':_0x10ee86}))[_0x1712d0(0x104)]['reply'];return{..._0x229b2c,'id':_0x2a3d3a[_0x1712d0(0xca)],'dT':c['dayjs'](+_0x2a3d3a['createTimestamp'])[_0x1712d0(0x113)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2a3d3a['userId']};}else{const _0xfe878e={'memberId':_0x1b2e43,'unitId':_0x2d5bf8,'content':_0x1e3ae8,'mention':_0x5ec8b1},_0x40d498=await this['_httpService'][_0x1712d0(0x120)](_0x1712d0(0x11b)+_0x2d5bf8+_0x1712d0(0xe4),{'body':_0xfe878e});return Y(_0x40d498[_0x1712d0(0x104)]['comment'],_0x229b2c);}}async[_0x467677(0xc5)](_0x617afd){const _0x414244=_0x467677;var _0x369443,_0x563292;const {text:_0x4f8852,unitId:_0x3b78ba}=_0x617afd,_0xcf3a9=(_0x563292=(_0x369443=_0x4f8852[_0x414244(0x119)])==null?void 0x0:_0x369443['filter'](_0x43e700=>_0x43e700[_0x414244(0x101)]===c[_0x414244(0xee)][_0x414244(0xcf)])[_0x414244(0x129)](_0x2eb30c=>_0x2eb30c[_0x414244(0x115)]))!=null?_0x563292:[],_0x34c397=JSON[_0x414244(0xe9)](_0x4f8852),_0x177b4b=_0x617afd['threadId'],_0x44a6cb=_0x617afd['id'],_0x500438={'memberId':(await this['_sessionService'][_0x414244(0x131)](_0x3b78ba))['getMemberID'](),'unitId':_0x3b78ba,'threadId':_0x177b4b,'mention':_0xcf3a9,'content':_0x34c397,'replyId':_0x44a6cb},_0x3ae846=await this[_0x414244(0x111)][_0x414244(0x120)]('/universer-api/comment/unit/'+_0x3b78ba+_0x414244(0x11c),{'body':_0x500438});return!_0x3ae846[_0x414244(0x104)][_0x414244(0x10a)]||_0x3ae846['body'][_0x414244(0x10a)][_0x414244(0xf0)]===0x1;}async[_0x467677(0x107)](_0x4598a9){const _0x4dae9d=_0x467677,{unitId:_0x425792}=_0x4598a9,_0x21d2a2=_0x4598a9[_0x4dae9d(0xd0)],_0xb7d187={'memberId':this['_userService']['getCurrentUser']()[_0x4dae9d(0x138)],'unitId':_0x425792,'threadId':_0x21d2a2,'solved':_0x4598a9[_0x4dae9d(0xe0)]?I[_0x4dae9d(0xdf)]:I[_0x4dae9d(0xd7)]},_0x1e44a5=await this[_0x4dae9d(0x111)]['post']('/universer-api/comment/unit/'+_0x425792+_0x4dae9d(0x114),{'body':_0xb7d187});return!_0x1e44a5[_0x4dae9d(0x104)][_0x4dae9d(0x10a)]||_0x1e44a5['body']['error'][_0x4dae9d(0xf0)]===0x1;}async[_0x467677(0x137)](_0x2ac63c,_0x392707,_0x17ce40,_0x51f7ac){const _0x14c6b6=_0x467677,_0x1ab2a8={'memberId':(await this['_sessionService'][_0x14c6b6(0x131)](_0x2ac63c))[_0x14c6b6(0x11e)](),'threadId':_0x17ce40,'replyId':_0x51f7ac,'unitId':_0x2ac63c},_0x3cce31=await this[_0x14c6b6(0x111)]['post']('/universer-api/comment/unit/'+_0x2ac63c+_0x14c6b6(0x102),{'body':_0x1ab2a8});return!_0x3cce31['body'][_0x14c6b6(0x10a)]||_0x3cce31[_0x14c6b6(0x104)][_0x14c6b6(0x10a)]['code']===0x1;}async[_0x467677(0xe3)](_0x12eb31,_0x28c3f6,_0x1aa1f8){const _0x21f8e7=_0x467677,_0x26e20e={'unitId':_0x12eb31,'threadId':_0x1aa1f8},_0x10dd9c=await this[_0x21f8e7(0x111)][_0x21f8e7(0x120)](_0x21f8e7(0x11b)+_0x12eb31+_0x21f8e7(0xf8),{'body':_0x26e20e}),_0xce4ae7=_0x1aa1f8['map'](_0x3ecb55=>G(_0x10dd9c['body']['comments'][_0x3ecb55],_0x12eb31,_0x28c3f6))[_0x21f8e7(0x121)](Boolean);return Object[_0x21f8e7(0xc9)](_0x10dd9c[_0x21f8e7(0x104)][_0x21f8e7(0xcc)])[_0x21f8e7(0x12e)](_0x131b2c=>{const _0x50427b=_0x21f8e7;this[_0x50427b(0x116)]['addUser'](_0x131b2c);}),_0xce4ae7;}[_0x467677(0xd9)](_0x47d750){const _0x33d3f0=_0x467677;return{'id':_0x47d750['id'],'threadId':_0x47d750[_0x33d3f0(0xd0)],'ref':_0x47d750[_0x33d3f0(0x109)]};}};function _0x1e94(){const _0x47418f=['_threadCommentModel','disposeWithMe','replies','find','UniverCollaborationClientPlugin','_commentService','parentId','map','dayjs','syncUpdateMutationToColla','parse','user','forEach','payload','UserManagerService','requireSession','2646861evPGcA','Add','Edit','getUnit','userId','deleteComment','userID','Solve','Inject','Module','add','updateComment','getComment','3079467iClZEs','IThreadCommentDataSourceService','values','replyId','8VpKyeh','users','onStarting','1468xstmHM','COMMENT','threadId','Disposable','_injector','UniverLicensePlugin','_sessionService','subscribe','3288780Dahioo','OpenOrReOpen','dataSource','saveCommentToSnapshot','_threadCommentDataSourceService','addUser','get','setConfig','_threadCommentDataSource','Solved','resolved','1318nVIGhK','CollaborationSessionService','listComments','/add','Delete','_initUserSync','createTimestamp','thread-comment-data-source.config','stringify','15564861OZuxAm','length','commentUpdate$','CommentService','CustomRangeType','Injector','code','merge','ThreadCommentModel','type','Plugin','HTTPService','_init','content','/list','/reply','pluginName','UNRECOGNIZED','getOwnPropertyDescriptor','UniverThreadCommentDataSourcePlugin','getUser','DependentOn','size','rangeType','/delete','defineProperty','body','delete','744510AlrvRk','resolveComment','_configService','ref','error','solved','toStringTag','_config','unitId','YYYY/MM/DD\x20HH:mm','2918982eSupMj','_httpService','Reply','format','/solved','rangeId','_userService','symbol','_initDataSource','customRanges','root','/universer-api/comment/unit/','/edit','pipe','getMemberID','Unknown','post','filter'];_0x1e94=function(){return _0x47418f;};return _0x1e94();}p=x([C(0x0,c['Inject'](P[_0x467677(0xf5)])),C(0x1,c[_0x467677(0xc2)](c[_0x467677(0x130)])),C(0x2,c[_0x467677(0xc2)](b[_0x467677(0xe2)]))],p);var H=Object[_0x467677(0xfc)],J=(_0x5c06d7,_0x555d46,_0x58f00c,_0x293278)=>{for(var _0x4e47d4=_0x293278>0x1?void 0x0:_0x293278?H(_0x555d46,_0x58f00c):_0x555d46,_0x2a4ac1=_0x5c06d7['length']-0x1,_0x352898;_0x2a4ac1>=0x0;_0x2a4ac1--)(_0x352898=_0x5c06d7[_0x2a4ac1])&&(_0x4e47d4=_0x352898(_0x4e47d4)||_0x4e47d4);return _0x4e47d4;},y=(_0x20dc8c,_0x40f24f)=>(_0x6f090b,_0x2ce15e)=>_0x40f24f(_0x6f090b,_0x2ce15e,_0x20dc8c);let g=class extends c[_0x467677(0xd1)]{constructor(_0x3bba8f,_0x25bd75){const _0x4aa53d=_0x467677;super(),this[_0x4aa53d(0xda)]=_0x3bba8f,this[_0x4aa53d(0xde)]=_0x25bd75,this[_0x4aa53d(0x118)]();}[_0x467677(0x118)](){const _0x351016=_0x467677;this[_0x351016(0xda)][_0x351016(0xd8)]=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x351016(0x12b)]=!0x1;}};g=J([y(0x0,M[_0x467677(0xc8)]),y(0x1,c[_0x467677(0xc2)](p))],g);function _0xff50(_0x7faf17,_0x22be49){const _0x1e94ba=_0x1e94();return _0xff50=function(_0xff50f6,_0x37132b){_0xff50f6=_0xff50f6-0xc2;let _0x2a7f9b=_0x1e94ba[_0xff50f6];return _0x2a7f9b;},_0xff50(_0x7faf17,_0x22be49);}var F=Object['defineProperty'],L=Object['getOwnPropertyDescriptor'],Z=(_0x2a9153,_0x4b6571,_0x2a0d4c)=>_0x4b6571 in _0x2a9153?F(_0x2a9153,_0x4b6571,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2a0d4c}):_0x2a9153[_0x4b6571]=_0x2a0d4c,W=(_0x3ff298,_0x15b277,_0x1ed197,_0x189380)=>{const _0x2ece29=_0x467677;for(var _0x248180=_0x189380>0x1?void 0x0:_0x189380?L(_0x15b277,_0x1ed197):_0x15b277,_0x342af1=_0x3ff298[_0x2ece29(0xeb)]-0x1,_0xba3207;_0x342af1>=0x0;_0x342af1--)(_0xba3207=_0x3ff298[_0x342af1])&&(_0x248180=_0xba3207(_0x248180)||_0x248180);return _0x248180;},O=(_0x2771bf,_0x4ef681)=>(_0x1c10ec,_0x54dfbf)=>_0x4ef681(_0x1c10ec,_0x54dfbf,_0x2771bf),N=(_0x4b8f2d,_0x2adc3c,_0x15745d)=>Z(_0x4b8f2d,typeof _0x2adc3c!=_0x467677(0x117)?_0x2adc3c+'':_0x2adc3c,_0x15745d);exports[_0x467677(0xfd)]=class extends c[_0x467677(0xf4)]{constructor(_0x33af0c=D,_0x54e2ad,_0x241372){const _0x4da19e=_0x467677;super(),this[_0x4da19e(0x10d)]=_0x33af0c,this['_injector']=_0x54e2ad,this['_configService']=_0x241372;const {..._0x24fe90}=c[_0x4da19e(0xf1)]({},D,this['_config']);this[_0x4da19e(0x108)][_0x4da19e(0xdd)](q,_0x24fe90);}[_0x467677(0xcd)](){[[p],[g],[_]]['forEach'](_0x319cd6=>{const _0x41ff98=_0xff50;this[_0x41ff98(0xd2)]['add'](_0x319cd6);});}['onReady'](){const _0x1cda73=_0x467677;this['_injector'][_0x1cda73(0xdc)](g),this[_0x1cda73(0xd2)]['get'](_);}},N(exports[_0x467677(0xfd)],_0x467677(0xfa),U),N(exports[_0x467677(0xfd)],_0x467677(0xf3),c['UniverInstanceType']['UNIVER_UNKNOWN']),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x467677(0xff)](w['UniverThreadCommentUIPlugin'],b[_0x467677(0x126)],T[_0x467677(0xd3)]),O(0x1,c[_0x467677(0xc2)](c[_0x467677(0xef)])),O(0x2,c['IConfigService'])],exports['UniverThreadCommentDataSourcePlugin']);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x275575=_0x4c29;(function(_0x1e2582,_0x3be747){const _0x21b665=_0x4c29,_0xac331a=_0x1e2582();while(!![]){try{const _0x217653=parseInt(_0x21b665(0x1d8))/0x1*(parseInt(_0x21b665(0x225))/0x2)+parseInt(_0x21b665(0x1ee))/0x3+-parseInt(_0x21b665(0x1ce))/0x4+parseInt(_0x21b665(0x1e6))/0x5*(-parseInt(_0x21b665(0x206))/0x6)+parseInt(_0x21b665(0x212))/0x7*(parseInt(_0x21b665(0x1f3))/0x8)+-parseInt(_0x21b665(0x1f8))/0x9*(-parseInt(_0x21b665(0x220))/0xa)+-parseInt(_0x21b665(0x1c5))/0xb;if(_0x217653===_0x3be747)break;else _0xac331a['push'](_0xac331a['shift']());}catch(_0x3bccdc){_0xac331a['push'](_0xac331a['shift']());}}}(_0x5de8,0xcc65c));import{CommentService as _0x3d5a29,CollaborationSessionService as _0x37a6c6,UniverCollaborationClientPlugin as _0x1f1be7}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x396281}from'@univerjs-pro/license';import{dayjs as _0x36129d,UserManagerService as _0x188360,Inject as _0xde8013,Injector as _0x4c4116,Disposable as _0x2dddad,CustomRangeType as _0x6c1323,UniverInstanceType as _0x3cabaf,DependentOn as _0x3ab8d0,IConfigService as _0x5ce03d,Plugin as _0x391839,merge as _0x2439a0}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x59d9b0}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x596e63,IThreadCommentDataSourceService as _0x47f5fc}from'@univerjs/thread-comment';import{bufferTime as _0x565e7e}from'rxjs';function _0x5de8(){const _0x58406f=['Add','ref','YYYY/MM/DD\x20HH:mm','symbol','_initDataSource','onReady','filter','3409ZZiTye','_configService','COMMENT','post','rangeType','Solve','pipe','Delete','_sessionService','_injector','size','Unknown','getUnit','customRanges','1553420JKCBFo','user','body','saveCommentToSnapshot','code','18ZTiBxp','UNIVER_UNKNOWN','resolveComment','users','getOwnPropertyDescriptor','32934495oiRTMK','root','subscribe','comment','getMemberID','replies','/reply','OpenOrReOpen','error','4675080wHREKM','/add','threadId','commentUpdate$','disposeWithMe','_initUserSync','slice','_threadCommentDataSource','_httpService','addComment','173697VtAEZU','delete','/edit','/universer-api/user/list','length','Solved','getCurrentUser','addUser','getUser','createTimestamp','onStarting','find','UNRECOGNIZED','deleteComment','20DVzpiz','content','_init','resolved','_threadCommentModel','getComment','get','solved','3667197psvXAu','/solved','rangeId','comments','unitId','16424VWeZEf','stringify','pluginName','parse','type','72UJEJyw','thread-comment-data-source.config','/universer-api/comment/unit/','_threadCommentDataSourceService','requireSession','updateComment','Edit','_userService','syncUpdateMutationToColla','forEach','personId','reply','/delete','replyId','42288lXhcvO','map','_commentService','userId','Reply'];_0x5de8=function(){return _0x58406f;};return _0x5de8();}import{HTTPService as _0x10249e}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x387d39=>(_0x387d39[_0x387d39[_0x275575(0x1cc)]=0x0]=_0x275575(0x1cc),_0x387d39[_0x387d39[_0x275575(0x1dd)]=0x1]=_0x275575(0x1dd),_0x387d39[_0x387d39['UNRECOGNIZED']=-0x1]=_0x275575(0x1e4),_0x387d39))(I||{}),v=(_0x1a5a50=>(_0x1a5a50[_0x1a5a50[_0x275575(0x21d)]=0x0]=_0x275575(0x21d),_0x1a5a50[_0x1a5a50[_0x275575(0x20b)]=0x1]=_0x275575(0x20b),_0x1a5a50[_0x1a5a50['Reply']=0x2]=_0x275575(0x20a),_0x1a5a50[_0x1a5a50[_0x275575(0x1fe)]=0x3]=_0x275575(0x1fe),_0x1a5a50[_0x1a5a50[_0x275575(0x219)]=0x4]=_0x275575(0x219),_0x1a5a50[_0x1a5a50['Solve']=0x5]='Solve',_0x1a5a50[_0x1a5a50[_0x275575(0x1e4)]=-0x1]=_0x275575(0x1e4),_0x1a5a50))(v||{});const y=_0x20c9f5=>_0x36129d(new Date(+_0x20c9f5))['format'](_0x275575(0x20d)),B=async(_0x4c1fb2,_0x28881c)=>{const _0x416236=_0x275575,_0x1380cb=_0x4c1fb2[_0x416236(0x1ec)](_0x188360),_0x34b17b=_0x4c1fb2[_0x416236(0x1ec)](_0x10249e);_0x28881c[_0x416236(0x201)](_0xaabef4=>{const _0xb0dbbf=_0x416236;_0x1380cb[_0xb0dbbf(0x1e0)](_0xaabef4)&&_0x28881c[_0xb0dbbf(0x1d9)](_0xaabef4);}),_0x28881c[_0x416236(0x21c)]&&(await _0x34b17b['get'](_0x416236(0x1db),{'params':{'userIDs':[..._0x28881c]}}))[_0x416236(0x222)]['users'][_0x416236(0x201)](_0x43caf8=>{_0x43caf8&&_0x1380cb['addUser'](_0x43caf8);});};var K=Object[_0x275575(0x229)],V=(_0x47ef92,_0x633b6a,_0xb44b57,_0x34ea59)=>{for(var _0x4b2227=_0x34ea59>0x1?void 0x0:_0x34ea59?K(_0x633b6a,_0xb44b57):_0x633b6a,_0x40b543=_0x47ef92['length']-0x1,_0x41cf0d;_0x40b543>=0x0;_0x40b543--)(_0x41cf0d=_0x47ef92[_0x40b543])&&(_0x4b2227=_0x41cf0d(_0x4b2227)||_0x4b2227);return _0x4b2227;},p=(_0xc1b8da,_0x3979a2)=>(_0x138342,_0x2e844f)=>_0x3979a2(_0x138342,_0x2e844f,_0xc1b8da);let _=class extends _0x2dddad{constructor(_0x2c5638,_0x4e0bb2,_0x591380,_0x24d732){const _0x413b61=_0x275575;super(),this[_0x413b61(0x208)]=_0x2c5638,this[_0x413b61(0x1ea)]=_0x4e0bb2,this[_0x413b61(0x1ff)]=_0x591380,this['_injector']=_0x24d732,this[_0x413b61(0x1e8)](),this[_0x413b61(0x1d3)]();}[_0x275575(0x1d3)](){const _0x5948f1=_0x275575;this[_0x5948f1(0x1d2)](this[_0x5948f1(0x1ea)][_0x5948f1(0x1d1)][_0x5948f1(0x218)](_0x565e7e(0x10))[_0x5948f1(0x1c7)](_0x3c245b=>{const _0x493ee8=_0x5948f1,_0x411db1=new Set();_0x3c245b[_0x493ee8(0x201)](_0x2eb238=>{const _0x4a35cd=_0x493ee8;switch(_0x2eb238[_0x4a35cd(0x1f7)]){case'add':{const _0xf19bf5=_0x2eb238['payload'][_0x4a35cd(0x202)];_0x411db1['add'](_0xf19bf5);break;}}}),B(this[_0x493ee8(0x21b)],_0x411db1);}));}[_0x275575(0x1e8)](){const _0x577c1c=_0x275575;this[_0x577c1c(0x1d2)](this[_0x577c1c(0x208)][_0x577c1c(0x1d1)][_0x577c1c(0x1c7)](async _0x5101e5=>{const _0x1a47c1=_0x577c1c;var _0x3b748a,_0x34e7fd,_0x14618c,_0x2c4e45;const _0x1cf729=(_0x3b748a=this[_0x1a47c1(0x1ea)][_0x1a47c1(0x21e)](_0x5101e5[_0x1a47c1(0x1f2)])[_0x1a47c1(0x1e3)](_0x5ec179=>_0x5ec179[_0x1a47c1(0x1d0)]===_0x5101e5[_0x1a47c1(0x1d0)]))==null?void 0x0:_0x3b748a[_0x1a47c1(0x1c6)];if(!_0x1cf729)return;const {unitId:_0x41cbc3,subUnitId:_0x23600b}=_0x1cf729;switch(_0x5101e5[_0x1a47c1(0x221)]&&this['_userService']['addUser'](_0x5101e5[_0x1a47c1(0x221)]),_0x5101e5[_0x1a47c1(0x1f7)]){case v[_0x1a47c1(0x20b)]:break;case v['Reply']:{this[_0x1a47c1(0x1ea)][_0x1a47c1(0x1d7)](_0x41cbc3,_0x23600b,{'unitId':_0x41cbc3,'subUnitId':_0x23600b,'ref':'','id':_0x5101e5['replyId'],'dT':y(+_0x5101e5['createTimestamp']),'threadId':_0x5101e5['threadId'],'personId':(_0x14618c=(_0x34e7fd=_0x5101e5[_0x1a47c1(0x221)])==null?void 0x0:_0x34e7fd['userID'])!=null?_0x14618c:_0x5101e5[_0x1a47c1(0x209)],'text':JSON[_0x1a47c1(0x1f6)](_0x5101e5['content']),'parentId':_0x1cf729['id']});break;}case v[_0x1a47c1(0x219)]:{const _0x8fb82a=this[_0x1a47c1(0x1ea)][_0x1a47c1(0x1eb)](_0x41cbc3,_0x23600b,_0x5101e5[_0x1a47c1(0x205)]);_0x8fb82a&&_0x8fb82a['parentId']&&this[_0x1a47c1(0x1ea)]['deleteComment'](_0x41cbc3,_0x23600b,_0x5101e5[_0x1a47c1(0x205)]);break;}case v['Edit']:{this[_0x1a47c1(0x1ea)]['updateComment'](_0x41cbc3,_0x23600b,{'commentId':_0x5101e5[_0x1a47c1(0x205)],'text':JSON['parse'](_0x5101e5[_0x1a47c1(0x1e7)])});break;}case v[_0x1a47c1(0x217)]:{const _0x3cc215=(_0x2c4e45=this[_0x1a47c1(0x1ea)][_0x1a47c1(0x21e)](_0x5101e5[_0x1a47c1(0x1f2)])[_0x1a47c1(0x1e3)](_0x4679cd=>_0x4679cd['threadId']===_0x5101e5['threadId']))==null?void 0x0:_0x2c4e45['root'];_0x3cc215&&this[_0x1a47c1(0x1ea)][_0x1a47c1(0x227)](_0x41cbc3,_0x23600b,_0x3cc215['id'],_0x5101e5[_0x1a47c1(0x1ed)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0xde8013(_0x3d5a29)),p(0x1,_0xde8013(_0x596e63)),p(0x2,_0xde8013(_0x188360)),p(0x3,_0xde8013(_0x4c4116))],_);const z=_0x275575(0x1f9),O={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5bc3c9,_0x2c111c,_0x11da80,_0x57b0b8)=>{const _0x332d53=_0x275575;for(var _0x44e2e=_0x57b0b8>0x1?void 0x0:_0x57b0b8?k(_0x2c111c,_0x11da80):_0x2c111c,_0x5c5896=_0x5bc3c9[_0x332d53(0x1dc)]-0x1,_0x52617b;_0x5c5896>=0x0;_0x5c5896--)(_0x52617b=_0x5bc3c9[_0x5c5896])&&(_0x44e2e=_0x52617b(_0x44e2e)||_0x44e2e);return _0x44e2e;},b=(_0xb163e3,_0x566f3d)=>(_0x30b126,_0x1de9c3)=>_0x566f3d(_0x30b126,_0x1de9c3,_0xb163e3);function X(_0x4f19d3,_0x2c4e0b){const _0x266dd7=_0x275575,_0x4c7241=_0x4f19d3[_0x266dd7(0x1ca)][0x0];return{..._0x2c4e0b,'id':_0x4c7241['replyId'],'resolved':_0x4f19d3[_0x266dd7(0x1ed)]===0x1,'dT':y(_0x4c7241[_0x266dd7(0x1e1)]),'personId':_0x4c7241[_0x266dd7(0x209)],'threadId':_0x4c7241[_0x266dd7(0x1d0)]};}function ee(_0x3aa93d,_0x5097fc,_0x5f5b33){const _0x1a336e=_0x275575;var _0x29d977,_0x368188;if(((_0x368188=(_0x29d977=_0x3aa93d==null?void 0x0:_0x3aa93d[_0x1a336e(0x1ca)])==null?void 0x0:_0x29d977[_0x1a336e(0x1dc)])!=null?_0x368188:0x0)>0x0){const _0x3eb303=(_0x38f1d6,_0x410ac3)=>({'id':_0x38f1d6['replyId'],'threadId':_0x38f1d6[_0x1a336e(0x1d0)],'dT':y(_0x38f1d6['createTimestamp']),'personId':_0x38f1d6['userId'],'resolved':_0x3aa93d[_0x1a336e(0x1ed)]===I[_0x1a336e(0x1dd)],'unitId':_0x5097fc,'subUnitId':_0x5f5b33,'text':JSON['parse'](_0x38f1d6['content']),'parentId':_0x410ac3}),_0xd6cb9f=_0x3eb303(_0x3aa93d[_0x1a336e(0x1ca)][0x0]);return{..._0xd6cb9f,'children':_0x3aa93d[_0x1a336e(0x1ca)][_0x1a336e(0x1d4)](0x1)[_0x1a336e(0x207)](_0x2f7d6d=>_0x3eb303(_0x2f7d6d,_0xd6cb9f['id']))};}return null;}let S=class{constructor(_0x2cb0b8,_0x2f3533,_0x5725a4){const _0x5897a4=_0x275575;this[_0x5897a4(0x1d6)]=_0x2cb0b8,this[_0x5897a4(0x1ff)]=_0x2f3533,this[_0x5897a4(0x21a)]=_0x5725a4;}async['addComment'](_0xdfc00f){const _0x410707=_0x275575;var _0x2ad7e7,_0x5c2555;const {parentId:_0x2a6264,unitId:_0x48b951,text:_0x54db91,threadId:_0x373f58}=_0xdfc00f,_0x5369d3=(_0x5c2555=(_0x2ad7e7=_0x54db91[_0x410707(0x21f)])==null?void 0x0:_0x2ad7e7[_0x410707(0x211)](_0x2f68af=>_0x2f68af['rangeType']===_0x6c1323[_0x410707(0x214)])[_0x410707(0x207)](_0x20c0f0=>_0x20c0f0['rangeId']))!=null?_0x5c2555:[],_0x47642d=JSON[_0x410707(0x1f4)](_0x54db91),_0x248741=(await this[_0x410707(0x21a)]['requireSession'](_0x48b951))[_0x410707(0x1c9)]();if(_0x2a6264){const _0x6dac91={'memberId':_0x248741,'unitId':_0x48b951,'content':_0x47642d,'mention':_0x5369d3,'threadId':_0x373f58},_0x36c323=(await this['_httpService'][_0x410707(0x215)](_0x410707(0x1fa)+_0x48b951+_0x410707(0x1cb),{'body':_0x6dac91}))['body'][_0x410707(0x203)];return{..._0xdfc00f,'id':_0x36c323[_0x410707(0x205)],'dT':_0x36129d(+_0x36c323[_0x410707(0x1e1)])['format']('YYYY/MM/DD\x20HH:mm'),'personId':_0x36c323[_0x410707(0x209)]};}else{const _0x1f8658={'memberId':_0x248741,'unitId':_0x48b951,'content':_0x47642d,'mention':_0x5369d3},_0x5925da=await this[_0x410707(0x1d6)][_0x410707(0x215)](_0x410707(0x1fa)+_0x48b951+_0x410707(0x1cf),{'body':_0x1f8658});return X(_0x5925da['body'][_0x410707(0x1c8)],_0xdfc00f);}}async[_0x275575(0x1fd)](_0x50eb69){const _0x288707=_0x275575;var _0x5d66bf,_0x57b7da;const {text:_0x56e5b3,unitId:_0x44024a}=_0x50eb69,_0x380fc0=(_0x57b7da=(_0x5d66bf=_0x56e5b3['customRanges'])==null?void 0x0:_0x5d66bf['filter'](_0x11f48d=>_0x11f48d[_0x288707(0x216)]===_0x6c1323['COMMENT'])[_0x288707(0x207)](_0x3f658a=>_0x3f658a[_0x288707(0x1f0)]))!=null?_0x57b7da:[],_0x49bd1d=JSON['stringify'](_0x56e5b3),_0x13fb6d=_0x50eb69[_0x288707(0x1d0)],_0x5ed13e=_0x50eb69['id'],_0x4c88c5={'memberId':(await this['_sessionService'][_0x288707(0x1fc)](_0x44024a))[_0x288707(0x1c9)](),'unitId':_0x44024a,'threadId':_0x13fb6d,'mention':_0x380fc0,'content':_0x49bd1d,'replyId':_0x5ed13e},_0x3f2c05=await this[_0x288707(0x1d6)]['post']('/universer-api/comment/unit/'+_0x44024a+_0x288707(0x1da),{'body':_0x4c88c5});return!_0x3f2c05[_0x288707(0x222)]['error']||_0x3f2c05['body'][_0x288707(0x1cd)][_0x288707(0x224)]===0x1;}async[_0x275575(0x227)](_0x3b6d35){const _0x34b095=_0x275575,{unitId:_0xbe3ad}=_0x3b6d35,_0x563eb8=_0x3b6d35['threadId'],_0x1d2f03={'memberId':this[_0x34b095(0x1ff)][_0x34b095(0x1de)]()['userID'],'unitId':_0xbe3ad,'threadId':_0x563eb8,'solved':_0x3b6d35[_0x34b095(0x1e9)]?I['Solved']:I['OpenOrReOpen']},_0x2a0c51=await this[_0x34b095(0x1d6)][_0x34b095(0x215)](_0x34b095(0x1fa)+_0xbe3ad+_0x34b095(0x1ef),{'body':_0x1d2f03});return!_0x2a0c51[_0x34b095(0x222)][_0x34b095(0x1cd)]||_0x2a0c51[_0x34b095(0x222)][_0x34b095(0x1cd)]['code']===0x1;}async[_0x275575(0x1e5)](_0x19e5ee,_0x3832c3,_0x44b363,_0x3206a0){const _0x1041ff=_0x275575,_0x390182={'memberId':(await this[_0x1041ff(0x21a)][_0x1041ff(0x1fc)](_0x19e5ee))['getMemberID'](),'threadId':_0x44b363,'replyId':_0x3206a0,'unitId':_0x19e5ee},_0x1d3204=await this[_0x1041ff(0x1d6)][_0x1041ff(0x215)](_0x1041ff(0x1fa)+_0x19e5ee+_0x1041ff(0x204),{'body':_0x390182});return!_0x1d3204[_0x1041ff(0x222)][_0x1041ff(0x1cd)]||_0x1d3204[_0x1041ff(0x222)][_0x1041ff(0x1cd)]['code']===0x1;}async['listComments'](_0x291554,_0x17984f,_0x248e92){const _0x4248f7=_0x275575,_0x55225d={'unitId':_0x291554,'threadId':_0x248e92},_0x14420c=await this[_0x4248f7(0x1d6)]['post'](_0x4248f7(0x1fa)+_0x291554+'/list',{'body':_0x55225d}),_0x4b8410=_0x248e92['map'](_0x23cb8b=>ee(_0x14420c[_0x4248f7(0x222)][_0x4248f7(0x1f1)][_0x23cb8b],_0x291554,_0x17984f))[_0x4248f7(0x211)](Boolean);return Object['values'](_0x14420c[_0x4248f7(0x222)][_0x4248f7(0x228)])['forEach'](_0x350653=>{const _0x218ea1=_0x4248f7;this[_0x218ea1(0x1ff)][_0x218ea1(0x1df)](_0x350653);}),_0x4b8410;}[_0x275575(0x223)](_0x2f9928){const _0xabe566=_0x275575;return{'id':_0x2f9928['id'],'threadId':_0x2f9928[_0xabe566(0x1d0)],'ref':_0x2f9928[_0xabe566(0x20c)]};}};S=Q([b(0x0,_0xde8013(_0x10249e)),b(0x1,_0xde8013(_0x188360)),b(0x2,_0xde8013(_0x37a6c6))],S);var re=Object[_0x275575(0x229)],te=(_0x49a27e,_0x3d24f0,_0x109bab,_0x274aa1)=>{const _0x2c8bc8=_0x275575;for(var _0x59bd97=_0x274aa1>0x1?void 0x0:_0x274aa1?re(_0x3d24f0,_0x109bab):_0x3d24f0,_0x5000b3=_0x49a27e[_0x2c8bc8(0x1dc)]-0x1,_0x5980ff;_0x5000b3>=0x0;_0x5000b3--)(_0x5980ff=_0x49a27e[_0x5000b3])&&(_0x59bd97=_0x5980ff(_0x59bd97)||_0x59bd97);return _0x59bd97;},M=(_0x214254,_0x51f7c9)=>(_0x3aa63e,_0x436ab5)=>_0x51f7c9(_0x3aa63e,_0x436ab5,_0x214254);function _0x4c29(_0x5d472e,_0x1b7a3c){const _0x5de8c2=_0x5de8();return _0x4c29=function(_0x4c29e7,_0x48ee8f){_0x4c29e7=_0x4c29e7-0x1c5;let _0x29eb8e=_0x5de8c2[_0x4c29e7];return _0x29eb8e;},_0x4c29(_0x5d472e,_0x1b7a3c);}let f=class extends _0x2dddad{constructor(_0x57b457,_0x79423a){const _0x3d8b91=_0x275575;super(),this['_threadCommentDataSourceService']=_0x57b457,this[_0x3d8b91(0x1d5)]=_0x79423a,this['_initDataSource']();}[_0x275575(0x20f)](){const _0x501b84=_0x275575;this[_0x501b84(0x1fb)]['dataSource']=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x501b84(0x200)]=!0x1;}};f=te([M(0x0,_0x47f5fc),M(0x1,_0xde8013(S))],f);var se=Object['defineProperty'],oe=Object[_0x275575(0x229)],ne=(_0x4a1390,_0x75ec14,_0xe21405)=>_0x75ec14 in _0x4a1390?se(_0x4a1390,_0x75ec14,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xe21405}):_0x4a1390[_0x75ec14]=_0xe21405,ie=(_0x34db19,_0xd950c9,_0x5f2766,_0x366b07)=>{const _0x39ba20=_0x275575;for(var _0x46e546=_0x366b07>0x1?void 0x0:_0x366b07?oe(_0xd950c9,_0x5f2766):_0xd950c9,_0x28644c=_0x34db19[_0x39ba20(0x1dc)]-0x1,_0x403644;_0x28644c>=0x0;_0x28644c--)(_0x403644=_0x34db19[_0x28644c])&&(_0x46e546=_0x403644(_0x46e546)||_0x46e546);return _0x46e546;},N=(_0x28fea1,_0x27eb1d)=>(_0x208cdd,_0x38ccb5)=>_0x27eb1d(_0x208cdd,_0x38ccb5,_0x28fea1),$=(_0x138a30,_0x537051,_0x1259a5)=>ne(_0x138a30,typeof _0x537051!=_0x275575(0x20e)?_0x537051+'':_0x537051,_0x1259a5);let g=class extends _0x391839{constructor(_0x2b6b03=O,_0x549b60,_0x4587af){const _0x5d8373=_0x275575;super(),this['_config']=_0x2b6b03,this[_0x5d8373(0x21b)]=_0x549b60,this[_0x5d8373(0x213)]=_0x4587af;const {..._0x507169}=_0x2439a0({},O,this['_config']);this['_configService']['setConfig'](z,_0x507169);}[_0x275575(0x1e2)](){const _0x4e4652=_0x275575;[[S],[f],[_]][_0x4e4652(0x201)](_0x1ea360=>{const _0x1c23ec=_0x4e4652;this[_0x1c23ec(0x21b)]['add'](_0x1ea360);});}[_0x275575(0x210)](){const _0xc80849=_0x275575;this[_0xc80849(0x21b)][_0xc80849(0x1ec)](f),this[_0xc80849(0x21b)][_0xc80849(0x1ec)](_);}};$(g,_0x275575(0x1f5),W),$(g,_0x275575(0x1f7),_0x3cabaf[_0x275575(0x226)]),g=ie([_0x3ab8d0(_0x59d9b0,_0x1f1be7,_0x396281),N(0x1,_0xde8013(_0x4c4116)),N(0x2,_0x5ce03d)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x13fd22=_0x2bd7;(function(_0x2b3e72,_0xd9bb7d){const _0x307b3d=_0x2bd7,_0x2fd460=_0x2b3e72();while(!![]){try{const _0x42cb2c=-parseInt(_0x307b3d(0x175))/0x1*(parseInt(_0x307b3d(0x16a))/0x2)+-parseInt(_0x307b3d(0x198))/0x3*(-parseInt(_0x307b3d(0x180))/0x4)+parseInt(_0x307b3d(0x1af))/0x5+parseInt(_0x307b3d(0x1a2))/0x6+parseInt(_0x307b3d(0x18b))/0x7*(-parseInt(_0x307b3d(0x194))/0x8)+parseInt(_0x307b3d(0x1b9))/0x9*(parseInt(_0x307b3d(0x17d))/0xa)+-parseInt(_0x307b3d(0x1c1))/0xb;if(_0x42cb2c===_0xd9bb7d)break;else _0x2fd460['push'](_0x2fd460['shift']());}catch(_0x487d40){_0x2fd460['push'](_0x2fd460['shift']());}}}(_0x5302,0xb5660));import{CommentService as _0x3fbe85,CollaborationSessionService as _0x50677e,UniverCollaborationClientPlugin as _0x54ad58}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4a3ed7}from'@univerjs-pro/license';import{dayjs as _0x3371bc,UserManagerService as _0x45c70b,Inject as _0xaa8355,Injector as _0x3fdd9c,Disposable as _0x38de46,CustomRangeType as _0x5c1d0a,UniverInstanceType as _0x4cf366,DependentOn as _0x80d377,IConfigService as _0x58d07b,Plugin as _0x1811b7,merge as _0x5c648c}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x2c1d59}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x15bc22,IThreadCommentDataSourceService as _0x46ff36}from'@univerjs/thread-comment';import{bufferTime as _0x57b9c7}from'rxjs';import{HTTPService as _0x570ef7}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x308574=>(_0x308574[_0x308574[_0x13fd22(0x1a4)]=0x0]=_0x13fd22(0x1a4),_0x308574[_0x308574[_0x13fd22(0x17e)]=0x1]=_0x13fd22(0x17e),_0x308574[_0x308574[_0x13fd22(0x189)]=-0x1]=_0x13fd22(0x189),_0x308574))(I||{}),v=(_0x21e28d=>(_0x21e28d[_0x21e28d[_0x13fd22(0x192)]=0x0]=_0x13fd22(0x192),_0x21e28d[_0x21e28d['Add']=0x1]=_0x13fd22(0x1ae),_0x21e28d[_0x21e28d['Reply']=0x2]=_0x13fd22(0x1a0),_0x21e28d[_0x21e28d[_0x13fd22(0x186)]=0x3]=_0x13fd22(0x186),_0x21e28d[_0x21e28d[_0x13fd22(0x17f)]=0x4]=_0x13fd22(0x17f),_0x21e28d[_0x21e28d[_0x13fd22(0x1a9)]=0x5]='Solve',_0x21e28d[_0x21e28d['UNRECOGNIZED']=-0x1]=_0x13fd22(0x189),_0x21e28d))(v||{});const y=_0x1975f7=>_0x3371bc(new Date(+_0x1975f7))[_0x13fd22(0x19f)](_0x13fd22(0x1b5)),B=async(_0x1c5128,_0x326bf9)=>{const _0x205283=_0x13fd22,_0x577021=_0x1c5128[_0x205283(0x1be)](_0x45c70b),_0x28b63d=_0x1c5128[_0x205283(0x1be)](_0x570ef7);_0x326bf9[_0x205283(0x195)](_0x2d0895=>{const _0x48ce69=_0x205283;_0x577021[_0x48ce69(0x1ab)](_0x2d0895)&&_0x326bf9[_0x48ce69(0x1ac)](_0x2d0895);}),_0x326bf9[_0x205283(0x18f)]&&(await _0x28b63d['get'](_0x205283(0x1b2),{'params':{'userIDs':[..._0x326bf9]}}))['body'][_0x205283(0x1a6)][_0x205283(0x195)](_0x3450c4=>{const _0x23c6d9=_0x205283;_0x3450c4&&_0x577021[_0x23c6d9(0x1aa)](_0x3450c4);});};var K=Object[_0x13fd22(0x173)],V=(_0xd076ad,_0x2c16d2,_0x4b1816,_0x425ad4)=>{for(var _0x155466=_0x425ad4>0x1?void 0x0:_0x425ad4?K(_0x2c16d2,_0x4b1816):_0x2c16d2,_0x4d5f86=_0xd076ad['length']-0x1,_0x38aa5d;_0x4d5f86>=0x0;_0x4d5f86--)(_0x38aa5d=_0xd076ad[_0x4d5f86])&&(_0x155466=_0x38aa5d(_0x155466)||_0x155466);return _0x155466;},p=(_0x281486,_0x5778f6)=>(_0xce2a77,_0x17062c)=>_0x5778f6(_0xce2a77,_0x17062c,_0x281486);let _=class extends _0x38de46{constructor(_0x209875,_0x5d1886,_0x390eff,_0x4ed1ba){const _0x4c41d2=_0x13fd22;super(),this[_0x4c41d2(0x170)]=_0x209875,this['_threadCommentModel']=_0x5d1886,this[_0x4c41d2(0x1ca)]=_0x390eff,this['_injector']=_0x4ed1ba,this[_0x4c41d2(0x18a)](),this[_0x4c41d2(0x184)]();}[_0x13fd22(0x184)](){const _0xcaa5c2=_0x13fd22;this[_0xcaa5c2(0x1bf)](this['_threadCommentModel'][_0xcaa5c2(0x174)][_0xcaa5c2(0x185)](_0x57b9c7(0x10))[_0xcaa5c2(0x1b4)](_0x33ea75=>{const _0x4fbaf4=_0xcaa5c2,_0x445758=new Set();_0x33ea75[_0x4fbaf4(0x195)](_0x5cca3b=>{const _0x35167e=_0x4fbaf4;switch(_0x5cca3b[_0x35167e(0x19c)]){case _0x35167e(0x188):{const _0xc9f003=_0x5cca3b['payload'][_0x35167e(0x181)];_0x445758[_0x35167e(0x188)](_0xc9f003);break;}}}),B(this[_0x4fbaf4(0x182)],_0x445758);}));}['_init'](){const _0x45bb18=_0x13fd22;this['disposeWithMe'](this[_0x45bb18(0x170)][_0x45bb18(0x174)][_0x45bb18(0x1b4)](async _0x267d96=>{const _0x4b277a=_0x45bb18;var _0x300262,_0x52589c,_0x3c962f,_0x14606f;const _0x4fd52d=(_0x300262=this[_0x4b277a(0x19e)][_0x4b277a(0x1c8)](_0x267d96['unitId'])['find'](_0x481d76=>_0x481d76[_0x4b277a(0x1a1)]===_0x267d96[_0x4b277a(0x1a1)]))==null?void 0x0:_0x300262[_0x4b277a(0x199)];if(!_0x4fd52d)return;const {unitId:_0x11127c,subUnitId:_0x1806d9}=_0x4fd52d;switch(_0x267d96[_0x4b277a(0x172)]&&this[_0x4b277a(0x1ca)][_0x4b277a(0x1aa)](_0x267d96[_0x4b277a(0x172)]),_0x267d96[_0x4b277a(0x19c)]){case v['Add']:break;case v['Reply']:{this[_0x4b277a(0x19e)][_0x4b277a(0x1ad)](_0x11127c,_0x1806d9,{'unitId':_0x11127c,'subUnitId':_0x1806d9,'ref':'','id':_0x267d96[_0x4b277a(0x1b8)],'dT':y(+_0x267d96['createTimestamp']),'threadId':_0x267d96[_0x4b277a(0x1a1)],'personId':(_0x3c962f=(_0x52589c=_0x267d96[_0x4b277a(0x172)])==null?void 0x0:_0x52589c[_0x4b277a(0x19a)])!=null?_0x3c962f:_0x267d96[_0x4b277a(0x17c)],'text':JSON['parse'](_0x267d96[_0x4b277a(0x1c5)]),'parentId':_0x4fd52d['id']});break;}case v[_0x4b277a(0x17f)]:{const _0x4de315=this[_0x4b277a(0x19e)][_0x4b277a(0x17a)](_0x11127c,_0x1806d9,_0x267d96[_0x4b277a(0x1b8)]);_0x4de315&&_0x4de315[_0x4b277a(0x1a5)]&&this[_0x4b277a(0x19e)]['deleteComment'](_0x11127c,_0x1806d9,_0x267d96[_0x4b277a(0x1b8)]);break;}case v[_0x4b277a(0x186)]:{this['_threadCommentModel']['updateComment'](_0x11127c,_0x1806d9,{'commentId':_0x267d96[_0x4b277a(0x1b8)],'text':JSON[_0x4b277a(0x190)](_0x267d96[_0x4b277a(0x1c5)])});break;}case v[_0x4b277a(0x1a9)]:{const _0x4c3d64=(_0x14606f=this[_0x4b277a(0x19e)]['getUnit'](_0x267d96['unitId'])[_0x4b277a(0x177)](_0x4f426c=>_0x4f426c[_0x4b277a(0x1a1)]===_0x267d96[_0x4b277a(0x1a1)]))==null?void 0x0:_0x14606f[_0x4b277a(0x199)];_0x4c3d64&&this['_threadCommentModel'][_0x4b277a(0x16d)](_0x11127c,_0x1806d9,_0x4c3d64['id'],_0x267d96[_0x4b277a(0x19d)]===I[_0x4b277a(0x17e)]);break;}}}));}};_=V([p(0x0,_0xaa8355(_0x3fbe85)),p(0x1,_0xaa8355(_0x15bc22)),p(0x2,_0xaa8355(_0x45c70b)),p(0x3,_0xaa8355(_0x3fdd9c))],_);const z='thread-comment-data-source.config',O={};var k=Object[_0x13fd22(0x173)],Q=(_0x1eeb89,_0x28210,_0x1b3256,_0x2e3719)=>{const _0x1889d1=_0x13fd22;for(var _0x3ca2a8=_0x2e3719>0x1?void 0x0:_0x2e3719?k(_0x28210,_0x1b3256):_0x28210,_0x4be001=_0x1eeb89[_0x1889d1(0x16b)]-0x1,_0x3f7e56;_0x4be001>=0x0;_0x4be001--)(_0x3f7e56=_0x1eeb89[_0x4be001])&&(_0x3ca2a8=_0x3f7e56(_0x3ca2a8)||_0x3ca2a8);return _0x3ca2a8;},b=(_0x31a031,_0x3c2365)=>(_0x6b00d3,_0x5224fd)=>_0x3c2365(_0x6b00d3,_0x5224fd,_0x31a031);function X(_0x41c870,_0x69d117){const _0x4accdd=_0x13fd22,_0x582b46=_0x41c870[_0x4accdd(0x168)][0x0];return{..._0x69d117,'id':_0x582b46[_0x4accdd(0x1b8)],'resolved':_0x41c870[_0x4accdd(0x19d)]===0x1,'dT':y(_0x582b46['createTimestamp']),'personId':_0x582b46['userId'],'threadId':_0x582b46[_0x4accdd(0x1a1)]};}function _0x5302(){const _0x283e20=['user','getOwnPropertyDescriptor','commentUpdate$','1FMlTQe','comments','find','_config','/universer-api/comment/unit/','getComment','defineProperty','userId','1154840jlIbyu','Solved','Delete','310688zUArGH','personId','_injector','getCurrentUser','_initUserSync','pipe','Edit','body','add','UNRECOGNIZED','_init','7EcihVF','saveCommentToSnapshot','error','_initDataSource','size','parse','stringify','Unknown','setConfig','7912472ESujzC','forEach','syncUpdateMutationToColla','customRanges','42PirBGe','root','userID','_httpService','type','solved','_threadCommentModel','format','Reply','threadId','3205080grNLsk','/reply','OpenOrReOpen','parentId','users','_configService','createTimestamp','Solve','addUser','getUser','delete','addComment','Add','5470970hqGpxy','slice','resolved','/universer-api/user/list','code','subscribe','YYYY/MM/DD\x20HH:mm','/list','requireSession','replyId','9iLNaik','values','COMMENT','ref','listComments','get','disposeWithMe','getMemberID','1297923Gsjtor','_threadCommentDataSource','_sessionService','map','content','UNIVER_UNKNOWN','onReady','getUnit','rangeType','_userService','/add','pluginName','replies','post','1962412QIWbPX','length','filter','resolveComment','rangeId','_threadCommentDataSourceService','_commentService','comment'];_0x5302=function(){return _0x283e20;};return _0x5302();}function _0x2bd7(_0x585f9e,_0x5e523){const _0x5302f8=_0x5302();return _0x2bd7=function(_0x2bd783,_0x166080){_0x2bd783=_0x2bd783-0x168;let _0xa52b29=_0x5302f8[_0x2bd783];return _0xa52b29;},_0x2bd7(_0x585f9e,_0x5e523);}function ee(_0x1661a5,_0x2a5e74,_0x3a6922){const _0x4588b0=_0x13fd22;var _0x101df0,_0x39cc13;if(((_0x39cc13=(_0x101df0=_0x1661a5==null?void 0x0:_0x1661a5[_0x4588b0(0x168)])==null?void 0x0:_0x101df0[_0x4588b0(0x16b)])!=null?_0x39cc13:0x0)>0x0){const _0x4aeae4=(_0x545e76,_0x116a0d)=>({'id':_0x545e76[_0x4588b0(0x1b8)],'threadId':_0x545e76['threadId'],'dT':y(_0x545e76[_0x4588b0(0x1a8)]),'personId':_0x545e76[_0x4588b0(0x17c)],'resolved':_0x1661a5[_0x4588b0(0x19d)]===I[_0x4588b0(0x17e)],'unitId':_0x2a5e74,'subUnitId':_0x3a6922,'text':JSON[_0x4588b0(0x190)](_0x545e76['content']),'parentId':_0x116a0d}),_0x71c3f9=_0x4aeae4(_0x1661a5[_0x4588b0(0x168)][0x0]);return{..._0x71c3f9,'children':_0x1661a5[_0x4588b0(0x168)][_0x4588b0(0x1b0)](0x1)[_0x4588b0(0x1c4)](_0x15c8cb=>_0x4aeae4(_0x15c8cb,_0x71c3f9['id']))};}return null;}let S=class{constructor(_0x424ec5,_0x383401,_0x494730){const _0x3ce2b=_0x13fd22;this['_httpService']=_0x424ec5,this[_0x3ce2b(0x1ca)]=_0x383401,this[_0x3ce2b(0x1c3)]=_0x494730;}async[_0x13fd22(0x1ad)](_0x122849){const _0x3fd2ee=_0x13fd22;var _0x2d0bd3,_0x3b3a3d;const {parentId:_0x5157da,unitId:_0x39e169,text:_0x1b61f9,threadId:_0x3d57cd}=_0x122849,_0x1a5d3c=(_0x3b3a3d=(_0x2d0bd3=_0x1b61f9[_0x3fd2ee(0x197)])==null?void 0x0:_0x2d0bd3[_0x3fd2ee(0x16c)](_0xf413af=>_0xf413af['rangeType']===_0x5c1d0a['COMMENT'])[_0x3fd2ee(0x1c4)](_0x125fe8=>_0x125fe8[_0x3fd2ee(0x16e)]))!=null?_0x3b3a3d:[],_0x3c12a6=JSON['stringify'](_0x1b61f9),_0xb692da=(await this[_0x3fd2ee(0x1c3)]['requireSession'](_0x39e169))[_0x3fd2ee(0x1c0)]();if(_0x5157da){const _0x38c1a4={'memberId':_0xb692da,'unitId':_0x39e169,'content':_0x3c12a6,'mention':_0x1a5d3c,'threadId':_0x3d57cd},_0x17d599=(await this[_0x3fd2ee(0x19b)]['post'](_0x3fd2ee(0x179)+_0x39e169+_0x3fd2ee(0x1a3),{'body':_0x38c1a4}))['body']['reply'];return{..._0x122849,'id':_0x17d599[_0x3fd2ee(0x1b8)],'dT':_0x3371bc(+_0x17d599[_0x3fd2ee(0x1a8)])[_0x3fd2ee(0x19f)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x17d599[_0x3fd2ee(0x17c)]};}else{const _0x2a6ac3={'memberId':_0xb692da,'unitId':_0x39e169,'content':_0x3c12a6,'mention':_0x1a5d3c},_0x4275f1=await this['_httpService'][_0x3fd2ee(0x169)](_0x3fd2ee(0x179)+_0x39e169+_0x3fd2ee(0x1cb),{'body':_0x2a6ac3});return X(_0x4275f1[_0x3fd2ee(0x187)][_0x3fd2ee(0x171)],_0x122849);}}async['updateComment'](_0x332372){const _0x942cdb=_0x13fd22;var _0x339a8d,_0x113285;const {text:_0x3091e5,unitId:_0x455fa9}=_0x332372,_0x5778f0=(_0x113285=(_0x339a8d=_0x3091e5[_0x942cdb(0x197)])==null?void 0x0:_0x339a8d[_0x942cdb(0x16c)](_0xb10e4e=>_0xb10e4e[_0x942cdb(0x1c9)]===_0x5c1d0a[_0x942cdb(0x1bb)])[_0x942cdb(0x1c4)](_0x5f1d96=>_0x5f1d96['rangeId']))!=null?_0x113285:[],_0x2eaca1=JSON[_0x942cdb(0x191)](_0x3091e5),_0x5a25c3=_0x332372['threadId'],_0x54f31e=_0x332372['id'],_0x6277a3={'memberId':(await this['_sessionService'][_0x942cdb(0x1b7)](_0x455fa9))[_0x942cdb(0x1c0)](),'unitId':_0x455fa9,'threadId':_0x5a25c3,'mention':_0x5778f0,'content':_0x2eaca1,'replyId':_0x54f31e},_0x37a6da=await this[_0x942cdb(0x19b)][_0x942cdb(0x169)](_0x942cdb(0x179)+_0x455fa9+'/edit',{'body':_0x6277a3});return!_0x37a6da[_0x942cdb(0x187)][_0x942cdb(0x18d)]||_0x37a6da['body']['error'][_0x942cdb(0x1b3)]===0x1;}async[_0x13fd22(0x16d)](_0x577ef2){const _0x11c7b5=_0x13fd22,{unitId:_0x4b89ad}=_0x577ef2,_0x6ea3f7=_0x577ef2[_0x11c7b5(0x1a1)],_0x51e5f2={'memberId':this[_0x11c7b5(0x1ca)][_0x11c7b5(0x183)]()[_0x11c7b5(0x19a)],'unitId':_0x4b89ad,'threadId':_0x6ea3f7,'solved':_0x577ef2[_0x11c7b5(0x1b1)]?I[_0x11c7b5(0x17e)]:I[_0x11c7b5(0x1a4)]},_0x15537f=await this['_httpService'][_0x11c7b5(0x169)](_0x11c7b5(0x179)+_0x4b89ad+'/solved',{'body':_0x51e5f2});return!_0x15537f[_0x11c7b5(0x187)][_0x11c7b5(0x18d)]||_0x15537f[_0x11c7b5(0x187)][_0x11c7b5(0x18d)][_0x11c7b5(0x1b3)]===0x1;}async['deleteComment'](_0x17797d,_0x21ff9e,_0x155004,_0x4f88b1){const _0x2d24a1=_0x13fd22,_0x388d7a={'memberId':(await this[_0x2d24a1(0x1c3)][_0x2d24a1(0x1b7)](_0x17797d))[_0x2d24a1(0x1c0)](),'threadId':_0x155004,'replyId':_0x4f88b1,'unitId':_0x17797d},_0x523d1e=await this[_0x2d24a1(0x19b)][_0x2d24a1(0x169)](_0x2d24a1(0x179)+_0x17797d+'/delete',{'body':_0x388d7a});return!_0x523d1e['body'][_0x2d24a1(0x18d)]||_0x523d1e[_0x2d24a1(0x187)][_0x2d24a1(0x18d)][_0x2d24a1(0x1b3)]===0x1;}async[_0x13fd22(0x1bd)](_0x5b33e9,_0x2c150e,_0x2547da){const _0x264ab3=_0x13fd22,_0x1e1b91={'unitId':_0x5b33e9,'threadId':_0x2547da},_0x4b2a64=await this[_0x264ab3(0x19b)]['post'](_0x264ab3(0x179)+_0x5b33e9+_0x264ab3(0x1b6),{'body':_0x1e1b91}),_0x233fd5=_0x2547da['map'](_0x339ed9=>ee(_0x4b2a64['body'][_0x264ab3(0x176)][_0x339ed9],_0x5b33e9,_0x2c150e))['filter'](Boolean);return Object[_0x264ab3(0x1ba)](_0x4b2a64[_0x264ab3(0x187)]['users'])[_0x264ab3(0x195)](_0x57a200=>{const _0x2f191a=_0x264ab3;this[_0x2f191a(0x1ca)][_0x2f191a(0x1aa)](_0x57a200);}),_0x233fd5;}[_0x13fd22(0x18c)](_0x59c288){const _0x37c630=_0x13fd22;return{'id':_0x59c288['id'],'threadId':_0x59c288[_0x37c630(0x1a1)],'ref':_0x59c288[_0x37c630(0x1bc)]};}};S=Q([b(0x0,_0xaa8355(_0x570ef7)),b(0x1,_0xaa8355(_0x45c70b)),b(0x2,_0xaa8355(_0x50677e))],S);var re=Object[_0x13fd22(0x173)],te=(_0x577ddb,_0x3287e6,_0x4709a4,_0x4ddfd6)=>{const _0x26573f=_0x13fd22;for(var _0x4879be=_0x4ddfd6>0x1?void 0x0:_0x4ddfd6?re(_0x3287e6,_0x4709a4):_0x3287e6,_0x384506=_0x577ddb[_0x26573f(0x16b)]-0x1,_0x1b3329;_0x384506>=0x0;_0x384506--)(_0x1b3329=_0x577ddb[_0x384506])&&(_0x4879be=_0x1b3329(_0x4879be)||_0x4879be);return _0x4879be;},M=(_0x35df9a,_0x1967a3)=>(_0x5676ad,_0x5008e8)=>_0x1967a3(_0x5676ad,_0x5008e8,_0x35df9a);let f=class extends _0x38de46{constructor(_0x4d799b,_0x50cd13){const _0x9b1841=_0x13fd22;super(),this[_0x9b1841(0x16f)]=_0x4d799b,this['_threadCommentDataSource']=_0x50cd13,this[_0x9b1841(0x18e)]();}[_0x13fd22(0x18e)](){const _0x3dd30e=_0x13fd22;this[_0x3dd30e(0x16f)]['dataSource']=this[_0x3dd30e(0x1c2)],this[_0x3dd30e(0x16f)][_0x3dd30e(0x196)]=!0x1;}};f=te([M(0x0,_0x46ff36),M(0x1,_0xaa8355(S))],f);var se=Object[_0x13fd22(0x17b)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x42854f,_0x73c3cf,_0x44d42e)=>_0x73c3cf in _0x42854f?se(_0x42854f,_0x73c3cf,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x44d42e}):_0x42854f[_0x73c3cf]=_0x44d42e,ie=(_0x26bcb9,_0x89cd3a,_0x35aa57,_0x22c449)=>{const _0x4395e5=_0x13fd22;for(var _0x1c8129=_0x22c449>0x1?void 0x0:_0x22c449?oe(_0x89cd3a,_0x35aa57):_0x89cd3a,_0x190562=_0x26bcb9[_0x4395e5(0x16b)]-0x1,_0x10e8c8;_0x190562>=0x0;_0x190562--)(_0x10e8c8=_0x26bcb9[_0x190562])&&(_0x1c8129=_0x10e8c8(_0x1c8129)||_0x1c8129);return _0x1c8129;},N=(_0x5808d1,_0x58fb69)=>(_0x3ea498,_0x581819)=>_0x58fb69(_0x3ea498,_0x581819,_0x5808d1),$=(_0x71e515,_0x255f8d,_0x5252dc)=>ne(_0x71e515,typeof _0x255f8d!='symbol'?_0x255f8d+'':_0x255f8d,_0x5252dc);let g=class extends _0x1811b7{constructor(_0x50b0ee=O,_0x22e778,_0x54b055){const _0x732f65=_0x13fd22;super(),this[_0x732f65(0x178)]=_0x50b0ee,this[_0x732f65(0x182)]=_0x22e778,this['_configService']=_0x54b055;const {..._0x899740}=_0x5c648c({},O,this[_0x732f65(0x178)]);this[_0x732f65(0x1a7)][_0x732f65(0x193)](z,_0x899740);}['onStarting'](){const _0x317907=_0x13fd22;[[S],[f],[_]][_0x317907(0x195)](_0xc00ef2=>{this['_injector']['add'](_0xc00ef2);});}[_0x13fd22(0x1c7)](){const _0x4bcb5d=_0x13fd22;this[_0x4bcb5d(0x182)][_0x4bcb5d(0x1be)](f),this[_0x4bcb5d(0x182)]['get'](_);}};$(g,_0x13fd22(0x1cc),W),$(g,_0x13fd22(0x19c),_0x4cf366[_0x13fd22(0x1c6)]),g=ie([_0x80d377(_0x2c1d59,_0x54ad58,_0x4a3ed7),N(0x1,_0xaa8355(_0x3fdd9c)),N(0x2,_0x58d07b)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x275575=_0x4c29;(function(_0x1e2582,_0x3be747){const _0x21b665=_0x4c29,_0xac331a=_0x1e2582();while(!![]){try{const _0x217653=parseInt(_0x21b665(0x1d8))/0x1*(parseInt(_0x21b665(0x225))/0x2)+parseInt(_0x21b665(0x1ee))/0x3+-parseInt(_0x21b665(0x1ce))/0x4+parseInt(_0x21b665(0x1e6))/0x5*(-parseInt(_0x21b665(0x206))/0x6)+parseInt(_0x21b665(0x212))/0x7*(parseInt(_0x21b665(0x1f3))/0x8)+-parseInt(_0x21b665(0x1f8))/0x9*(-parseInt(_0x21b665(0x220))/0xa)+-parseInt(_0x21b665(0x1c5))/0xb;if(_0x217653===_0x3be747)break;else _0xac331a['push'](_0xac331a['shift']());}catch(_0x3bccdc){_0xac331a['push'](_0xac331a['shift']());}}}(_0x5de8,0xcc65c));import{CommentService as _0x3d5a29,CollaborationSessionService as _0x37a6c6,UniverCollaborationClientPlugin as _0x1f1be7}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x396281}from'@univerjs-pro/license';import{dayjs as _0x36129d,UserManagerService as _0x188360,Inject as _0xde8013,Injector as _0x4c4116,Disposable as _0x2dddad,CustomRangeType as _0x6c1323,UniverInstanceType as _0x3cabaf,DependentOn as _0x3ab8d0,IConfigService as _0x5ce03d,Plugin as _0x391839,merge as _0x2439a0}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x59d9b0}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x596e63,IThreadCommentDataSourceService as _0x47f5fc}from'@univerjs/thread-comment';import{bufferTime as _0x565e7e}from'rxjs';function _0x5de8(){const _0x58406f=['Add','ref','YYYY/MM/DD\x20HH:mm','symbol','_initDataSource','onReady','filter','3409ZZiTye','_configService','COMMENT','post','rangeType','Solve','pipe','Delete','_sessionService','_injector','size','Unknown','getUnit','customRanges','1553420JKCBFo','user','body','saveCommentToSnapshot','code','18ZTiBxp','UNIVER_UNKNOWN','resolveComment','users','getOwnPropertyDescriptor','32934495oiRTMK','root','subscribe','comment','getMemberID','replies','/reply','OpenOrReOpen','error','4675080wHREKM','/add','threadId','commentUpdate$','disposeWithMe','_initUserSync','slice','_threadCommentDataSource','_httpService','addComment','173697VtAEZU','delete','/edit','/universer-api/user/list','length','Solved','getCurrentUser','addUser','getUser','createTimestamp','onStarting','find','UNRECOGNIZED','deleteComment','20DVzpiz','content','_init','resolved','_threadCommentModel','getComment','get','solved','3667197psvXAu','/solved','rangeId','comments','unitId','16424VWeZEf','stringify','pluginName','parse','type','72UJEJyw','thread-comment-data-source.config','/universer-api/comment/unit/','_threadCommentDataSourceService','requireSession','updateComment','Edit','_userService','syncUpdateMutationToColla','forEach','personId','reply','/delete','replyId','42288lXhcvO','map','_commentService','userId','Reply'];_0x5de8=function(){return _0x58406f;};return _0x5de8();}import{HTTPService as _0x10249e}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x387d39=>(_0x387d39[_0x387d39[_0x275575(0x1cc)]=0x0]=_0x275575(0x1cc),_0x387d39[_0x387d39[_0x275575(0x1dd)]=0x1]=_0x275575(0x1dd),_0x387d39[_0x387d39['UNRECOGNIZED']=-0x1]=_0x275575(0x1e4),_0x387d39))(I||{}),v=(_0x1a5a50=>(_0x1a5a50[_0x1a5a50[_0x275575(0x21d)]=0x0]=_0x275575(0x21d),_0x1a5a50[_0x1a5a50[_0x275575(0x20b)]=0x1]=_0x275575(0x20b),_0x1a5a50[_0x1a5a50['Reply']=0x2]=_0x275575(0x20a),_0x1a5a50[_0x1a5a50[_0x275575(0x1fe)]=0x3]=_0x275575(0x1fe),_0x1a5a50[_0x1a5a50[_0x275575(0x219)]=0x4]=_0x275575(0x219),_0x1a5a50[_0x1a5a50['Solve']=0x5]='Solve',_0x1a5a50[_0x1a5a50[_0x275575(0x1e4)]=-0x1]=_0x275575(0x1e4),_0x1a5a50))(v||{});const y=_0x20c9f5=>_0x36129d(new Date(+_0x20c9f5))['format'](_0x275575(0x20d)),B=async(_0x4c1fb2,_0x28881c)=>{const _0x416236=_0x275575,_0x1380cb=_0x4c1fb2[_0x416236(0x1ec)](_0x188360),_0x34b17b=_0x4c1fb2[_0x416236(0x1ec)](_0x10249e);_0x28881c[_0x416236(0x201)](_0xaabef4=>{const _0xb0dbbf=_0x416236;_0x1380cb[_0xb0dbbf(0x1e0)](_0xaabef4)&&_0x28881c[_0xb0dbbf(0x1d9)](_0xaabef4);}),_0x28881c[_0x416236(0x21c)]&&(await _0x34b17b['get'](_0x416236(0x1db),{'params':{'userIDs':[..._0x28881c]}}))[_0x416236(0x222)]['users'][_0x416236(0x201)](_0x43caf8=>{_0x43caf8&&_0x1380cb['addUser'](_0x43caf8);});};var K=Object[_0x275575(0x229)],V=(_0x47ef92,_0x633b6a,_0xb44b57,_0x34ea59)=>{for(var _0x4b2227=_0x34ea59>0x1?void 0x0:_0x34ea59?K(_0x633b6a,_0xb44b57):_0x633b6a,_0x40b543=_0x47ef92['length']-0x1,_0x41cf0d;_0x40b543>=0x0;_0x40b543--)(_0x41cf0d=_0x47ef92[_0x40b543])&&(_0x4b2227=_0x41cf0d(_0x4b2227)||_0x4b2227);return _0x4b2227;},p=(_0xc1b8da,_0x3979a2)=>(_0x138342,_0x2e844f)=>_0x3979a2(_0x138342,_0x2e844f,_0xc1b8da);let _=class extends _0x2dddad{constructor(_0x2c5638,_0x4e0bb2,_0x591380,_0x24d732){const _0x413b61=_0x275575;super(),this[_0x413b61(0x208)]=_0x2c5638,this[_0x413b61(0x1ea)]=_0x4e0bb2,this[_0x413b61(0x1ff)]=_0x591380,this['_injector']=_0x24d732,this[_0x413b61(0x1e8)](),this[_0x413b61(0x1d3)]();}[_0x275575(0x1d3)](){const _0x5948f1=_0x275575;this[_0x5948f1(0x1d2)](this[_0x5948f1(0x1ea)][_0x5948f1(0x1d1)][_0x5948f1(0x218)](_0x565e7e(0x10))[_0x5948f1(0x1c7)](_0x3c245b=>{const _0x493ee8=_0x5948f1,_0x411db1=new Set();_0x3c245b[_0x493ee8(0x201)](_0x2eb238=>{const _0x4a35cd=_0x493ee8;switch(_0x2eb238[_0x4a35cd(0x1f7)]){case'add':{const _0xf19bf5=_0x2eb238['payload'][_0x4a35cd(0x202)];_0x411db1['add'](_0xf19bf5);break;}}}),B(this[_0x493ee8(0x21b)],_0x411db1);}));}[_0x275575(0x1e8)](){const _0x577c1c=_0x275575;this[_0x577c1c(0x1d2)](this[_0x577c1c(0x208)][_0x577c1c(0x1d1)][_0x577c1c(0x1c7)](async _0x5101e5=>{const _0x1a47c1=_0x577c1c;var _0x3b748a,_0x34e7fd,_0x14618c,_0x2c4e45;const _0x1cf729=(_0x3b748a=this[_0x1a47c1(0x1ea)][_0x1a47c1(0x21e)](_0x5101e5[_0x1a47c1(0x1f2)])[_0x1a47c1(0x1e3)](_0x5ec179=>_0x5ec179[_0x1a47c1(0x1d0)]===_0x5101e5[_0x1a47c1(0x1d0)]))==null?void 0x0:_0x3b748a[_0x1a47c1(0x1c6)];if(!_0x1cf729)return;const {unitId:_0x41cbc3,subUnitId:_0x23600b}=_0x1cf729;switch(_0x5101e5[_0x1a47c1(0x221)]&&this['_userService']['addUser'](_0x5101e5[_0x1a47c1(0x221)]),_0x5101e5[_0x1a47c1(0x1f7)]){case v[_0x1a47c1(0x20b)]:break;case v['Reply']:{this[_0x1a47c1(0x1ea)][_0x1a47c1(0x1d7)](_0x41cbc3,_0x23600b,{'unitId':_0x41cbc3,'subUnitId':_0x23600b,'ref':'','id':_0x5101e5['replyId'],'dT':y(+_0x5101e5['createTimestamp']),'threadId':_0x5101e5['threadId'],'personId':(_0x14618c=(_0x34e7fd=_0x5101e5[_0x1a47c1(0x221)])==null?void 0x0:_0x34e7fd['userID'])!=null?_0x14618c:_0x5101e5[_0x1a47c1(0x209)],'text':JSON[_0x1a47c1(0x1f6)](_0x5101e5['content']),'parentId':_0x1cf729['id']});break;}case v[_0x1a47c1(0x219)]:{const _0x8fb82a=this[_0x1a47c1(0x1ea)][_0x1a47c1(0x1eb)](_0x41cbc3,_0x23600b,_0x5101e5[_0x1a47c1(0x205)]);_0x8fb82a&&_0x8fb82a['parentId']&&this[_0x1a47c1(0x1ea)]['deleteComment'](_0x41cbc3,_0x23600b,_0x5101e5[_0x1a47c1(0x205)]);break;}case v['Edit']:{this[_0x1a47c1(0x1ea)]['updateComment'](_0x41cbc3,_0x23600b,{'commentId':_0x5101e5[_0x1a47c1(0x205)],'text':JSON['parse'](_0x5101e5[_0x1a47c1(0x1e7)])});break;}case v[_0x1a47c1(0x217)]:{const _0x3cc215=(_0x2c4e45=this[_0x1a47c1(0x1ea)][_0x1a47c1(0x21e)](_0x5101e5[_0x1a47c1(0x1f2)])[_0x1a47c1(0x1e3)](_0x4679cd=>_0x4679cd['threadId']===_0x5101e5['threadId']))==null?void 0x0:_0x2c4e45['root'];_0x3cc215&&this[_0x1a47c1(0x1ea)][_0x1a47c1(0x227)](_0x41cbc3,_0x23600b,_0x3cc215['id'],_0x5101e5[_0x1a47c1(0x1ed)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0xde8013(_0x3d5a29)),p(0x1,_0xde8013(_0x596e63)),p(0x2,_0xde8013(_0x188360)),p(0x3,_0xde8013(_0x4c4116))],_);const z=_0x275575(0x1f9),O={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5bc3c9,_0x2c111c,_0x11da80,_0x57b0b8)=>{const _0x332d53=_0x275575;for(var _0x44e2e=_0x57b0b8>0x1?void 0x0:_0x57b0b8?k(_0x2c111c,_0x11da80):_0x2c111c,_0x5c5896=_0x5bc3c9[_0x332d53(0x1dc)]-0x1,_0x52617b;_0x5c5896>=0x0;_0x5c5896--)(_0x52617b=_0x5bc3c9[_0x5c5896])&&(_0x44e2e=_0x52617b(_0x44e2e)||_0x44e2e);return _0x44e2e;},b=(_0xb163e3,_0x566f3d)=>(_0x30b126,_0x1de9c3)=>_0x566f3d(_0x30b126,_0x1de9c3,_0xb163e3);function X(_0x4f19d3,_0x2c4e0b){const _0x266dd7=_0x275575,_0x4c7241=_0x4f19d3[_0x266dd7(0x1ca)][0x0];return{..._0x2c4e0b,'id':_0x4c7241['replyId'],'resolved':_0x4f19d3[_0x266dd7(0x1ed)]===0x1,'dT':y(_0x4c7241[_0x266dd7(0x1e1)]),'personId':_0x4c7241[_0x266dd7(0x209)],'threadId':_0x4c7241[_0x266dd7(0x1d0)]};}function ee(_0x3aa93d,_0x5097fc,_0x5f5b33){const _0x1a336e=_0x275575;var _0x29d977,_0x368188;if(((_0x368188=(_0x29d977=_0x3aa93d==null?void 0x0:_0x3aa93d[_0x1a336e(0x1ca)])==null?void 0x0:_0x29d977[_0x1a336e(0x1dc)])!=null?_0x368188:0x0)>0x0){const _0x3eb303=(_0x38f1d6,_0x410ac3)=>({'id':_0x38f1d6['replyId'],'threadId':_0x38f1d6[_0x1a336e(0x1d0)],'dT':y(_0x38f1d6['createTimestamp']),'personId':_0x38f1d6['userId'],'resolved':_0x3aa93d[_0x1a336e(0x1ed)]===I[_0x1a336e(0x1dd)],'unitId':_0x5097fc,'subUnitId':_0x5f5b33,'text':JSON['parse'](_0x38f1d6['content']),'parentId':_0x410ac3}),_0xd6cb9f=_0x3eb303(_0x3aa93d[_0x1a336e(0x1ca)][0x0]);return{..._0xd6cb9f,'children':_0x3aa93d[_0x1a336e(0x1ca)][_0x1a336e(0x1d4)](0x1)[_0x1a336e(0x207)](_0x2f7d6d=>_0x3eb303(_0x2f7d6d,_0xd6cb9f['id']))};}return null;}let S=class{constructor(_0x2cb0b8,_0x2f3533,_0x5725a4){const _0x5897a4=_0x275575;this[_0x5897a4(0x1d6)]=_0x2cb0b8,this[_0x5897a4(0x1ff)]=_0x2f3533,this[_0x5897a4(0x21a)]=_0x5725a4;}async['addComment'](_0xdfc00f){const _0x410707=_0x275575;var _0x2ad7e7,_0x5c2555;const {parentId:_0x2a6264,unitId:_0x48b951,text:_0x54db91,threadId:_0x373f58}=_0xdfc00f,_0x5369d3=(_0x5c2555=(_0x2ad7e7=_0x54db91[_0x410707(0x21f)])==null?void 0x0:_0x2ad7e7[_0x410707(0x211)](_0x2f68af=>_0x2f68af['rangeType']===_0x6c1323[_0x410707(0x214)])[_0x410707(0x207)](_0x20c0f0=>_0x20c0f0['rangeId']))!=null?_0x5c2555:[],_0x47642d=JSON[_0x410707(0x1f4)](_0x54db91),_0x248741=(await this[_0x410707(0x21a)]['requireSession'](_0x48b951))[_0x410707(0x1c9)]();if(_0x2a6264){const _0x6dac91={'memberId':_0x248741,'unitId':_0x48b951,'content':_0x47642d,'mention':_0x5369d3,'threadId':_0x373f58},_0x36c323=(await this['_httpService'][_0x410707(0x215)](_0x410707(0x1fa)+_0x48b951+_0x410707(0x1cb),{'body':_0x6dac91}))['body'][_0x410707(0x203)];return{..._0xdfc00f,'id':_0x36c323[_0x410707(0x205)],'dT':_0x36129d(+_0x36c323[_0x410707(0x1e1)])['format']('YYYY/MM/DD\x20HH:mm'),'personId':_0x36c323[_0x410707(0x209)]};}else{const _0x1f8658={'memberId':_0x248741,'unitId':_0x48b951,'content':_0x47642d,'mention':_0x5369d3},_0x5925da=await this[_0x410707(0x1d6)][_0x410707(0x215)](_0x410707(0x1fa)+_0x48b951+_0x410707(0x1cf),{'body':_0x1f8658});return X(_0x5925da['body'][_0x410707(0x1c8)],_0xdfc00f);}}async[_0x275575(0x1fd)](_0x50eb69){const _0x288707=_0x275575;var _0x5d66bf,_0x57b7da;const {text:_0x56e5b3,unitId:_0x44024a}=_0x50eb69,_0x380fc0=(_0x57b7da=(_0x5d66bf=_0x56e5b3['customRanges'])==null?void 0x0:_0x5d66bf['filter'](_0x11f48d=>_0x11f48d[_0x288707(0x216)]===_0x6c1323['COMMENT'])[_0x288707(0x207)](_0x3f658a=>_0x3f658a[_0x288707(0x1f0)]))!=null?_0x57b7da:[],_0x49bd1d=JSON['stringify'](_0x56e5b3),_0x13fb6d=_0x50eb69[_0x288707(0x1d0)],_0x5ed13e=_0x50eb69['id'],_0x4c88c5={'memberId':(await this['_sessionService'][_0x288707(0x1fc)](_0x44024a))[_0x288707(0x1c9)](),'unitId':_0x44024a,'threadId':_0x13fb6d,'mention':_0x380fc0,'content':_0x49bd1d,'replyId':_0x5ed13e},_0x3f2c05=await this[_0x288707(0x1d6)]['post']('/universer-api/comment/unit/'+_0x44024a+_0x288707(0x1da),{'body':_0x4c88c5});return!_0x3f2c05[_0x288707(0x222)]['error']||_0x3f2c05['body'][_0x288707(0x1cd)][_0x288707(0x224)]===0x1;}async[_0x275575(0x227)](_0x3b6d35){const _0x34b095=_0x275575,{unitId:_0xbe3ad}=_0x3b6d35,_0x563eb8=_0x3b6d35['threadId'],_0x1d2f03={'memberId':this[_0x34b095(0x1ff)][_0x34b095(0x1de)]()['userID'],'unitId':_0xbe3ad,'threadId':_0x563eb8,'solved':_0x3b6d35[_0x34b095(0x1e9)]?I['Solved']:I['OpenOrReOpen']},_0x2a0c51=await this[_0x34b095(0x1d6)][_0x34b095(0x215)](_0x34b095(0x1fa)+_0xbe3ad+_0x34b095(0x1ef),{'body':_0x1d2f03});return!_0x2a0c51[_0x34b095(0x222)][_0x34b095(0x1cd)]||_0x2a0c51[_0x34b095(0x222)][_0x34b095(0x1cd)]['code']===0x1;}async[_0x275575(0x1e5)](_0x19e5ee,_0x3832c3,_0x44b363,_0x3206a0){const _0x1041ff=_0x275575,_0x390182={'memberId':(await this[_0x1041ff(0x21a)][_0x1041ff(0x1fc)](_0x19e5ee))['getMemberID'](),'threadId':_0x44b363,'replyId':_0x3206a0,'unitId':_0x19e5ee},_0x1d3204=await this[_0x1041ff(0x1d6)][_0x1041ff(0x215)](_0x1041ff(0x1fa)+_0x19e5ee+_0x1041ff(0x204),{'body':_0x390182});return!_0x1d3204[_0x1041ff(0x222)][_0x1041ff(0x1cd)]||_0x1d3204[_0x1041ff(0x222)][_0x1041ff(0x1cd)]['code']===0x1;}async['listComments'](_0x291554,_0x17984f,_0x248e92){const _0x4248f7=_0x275575,_0x55225d={'unitId':_0x291554,'threadId':_0x248e92},_0x14420c=await this[_0x4248f7(0x1d6)]['post'](_0x4248f7(0x1fa)+_0x291554+'/list',{'body':_0x55225d}),_0x4b8410=_0x248e92['map'](_0x23cb8b=>ee(_0x14420c[_0x4248f7(0x222)][_0x4248f7(0x1f1)][_0x23cb8b],_0x291554,_0x17984f))[_0x4248f7(0x211)](Boolean);return Object['values'](_0x14420c[_0x4248f7(0x222)][_0x4248f7(0x228)])['forEach'](_0x350653=>{const _0x218ea1=_0x4248f7;this[_0x218ea1(0x1ff)][_0x218ea1(0x1df)](_0x350653);}),_0x4b8410;}[_0x275575(0x223)](_0x2f9928){const _0xabe566=_0x275575;return{'id':_0x2f9928['id'],'threadId':_0x2f9928[_0xabe566(0x1d0)],'ref':_0x2f9928[_0xabe566(0x20c)]};}};S=Q([b(0x0,_0xde8013(_0x10249e)),b(0x1,_0xde8013(_0x188360)),b(0x2,_0xde8013(_0x37a6c6))],S);var re=Object[_0x275575(0x229)],te=(_0x49a27e,_0x3d24f0,_0x109bab,_0x274aa1)=>{const _0x2c8bc8=_0x275575;for(var _0x59bd97=_0x274aa1>0x1?void 0x0:_0x274aa1?re(_0x3d24f0,_0x109bab):_0x3d24f0,_0x5000b3=_0x49a27e[_0x2c8bc8(0x1dc)]-0x1,_0x5980ff;_0x5000b3>=0x0;_0x5000b3--)(_0x5980ff=_0x49a27e[_0x5000b3])&&(_0x59bd97=_0x5980ff(_0x59bd97)||_0x59bd97);return _0x59bd97;},M=(_0x214254,_0x51f7c9)=>(_0x3aa63e,_0x436ab5)=>_0x51f7c9(_0x3aa63e,_0x436ab5,_0x214254);function _0x4c29(_0x5d472e,_0x1b7a3c){const _0x5de8c2=_0x5de8();return _0x4c29=function(_0x4c29e7,_0x48ee8f){_0x4c29e7=_0x4c29e7-0x1c5;let _0x29eb8e=_0x5de8c2[_0x4c29e7];return _0x29eb8e;},_0x4c29(_0x5d472e,_0x1b7a3c);}let f=class extends _0x2dddad{constructor(_0x57b457,_0x79423a){const _0x3d8b91=_0x275575;super(),this['_threadCommentDataSourceService']=_0x57b457,this[_0x3d8b91(0x1d5)]=_0x79423a,this['_initDataSource']();}[_0x275575(0x20f)](){const _0x501b84=_0x275575;this[_0x501b84(0x1fb)]['dataSource']=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x501b84(0x200)]=!0x1;}};f=te([M(0x0,_0x47f5fc),M(0x1,_0xde8013(S))],f);var se=Object['defineProperty'],oe=Object[_0x275575(0x229)],ne=(_0x4a1390,_0x75ec14,_0xe21405)=>_0x75ec14 in _0x4a1390?se(_0x4a1390,_0x75ec14,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xe21405}):_0x4a1390[_0x75ec14]=_0xe21405,ie=(_0x34db19,_0xd950c9,_0x5f2766,_0x366b07)=>{const _0x39ba20=_0x275575;for(var _0x46e546=_0x366b07>0x1?void 0x0:_0x366b07?oe(_0xd950c9,_0x5f2766):_0xd950c9,_0x28644c=_0x34db19[_0x39ba20(0x1dc)]-0x1,_0x403644;_0x28644c>=0x0;_0x28644c--)(_0x403644=_0x34db19[_0x28644c])&&(_0x46e546=_0x403644(_0x46e546)||_0x46e546);return _0x46e546;},N=(_0x28fea1,_0x27eb1d)=>(_0x208cdd,_0x38ccb5)=>_0x27eb1d(_0x208cdd,_0x38ccb5,_0x28fea1),$=(_0x138a30,_0x537051,_0x1259a5)=>ne(_0x138a30,typeof _0x537051!=_0x275575(0x20e)?_0x537051+'':_0x537051,_0x1259a5);let g=class extends _0x391839{constructor(_0x2b6b03=O,_0x549b60,_0x4587af){const _0x5d8373=_0x275575;super(),this['_config']=_0x2b6b03,this[_0x5d8373(0x21b)]=_0x549b60,this[_0x5d8373(0x213)]=_0x4587af;const {..._0x507169}=_0x2439a0({},O,this['_config']);this['_configService']['setConfig'](z,_0x507169);}[_0x275575(0x1e2)](){const _0x4e4652=_0x275575;[[S],[f],[_]][_0x4e4652(0x201)](_0x1ea360=>{const _0x1c23ec=_0x4e4652;this[_0x1c23ec(0x21b)]['add'](_0x1ea360);});}[_0x275575(0x210)](){const _0xc80849=_0x275575;this[_0xc80849(0x21b)][_0xc80849(0x1ec)](f),this[_0xc80849(0x21b)][_0xc80849(0x1ec)](_);}};$(g,_0x275575(0x1f5),W),$(g,_0x275575(0x1f7),_0x3cabaf[_0x275575(0x226)]),g=ie([_0x3ab8d0(_0x59d9b0,_0x1f1be7,_0x396281),N(0x1,_0xde8013(_0x4c4116)),N(0x2,_0x5ce03d)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x13fd22=_0x2bd7;(function(_0x2b3e72,_0xd9bb7d){const _0x307b3d=_0x2bd7,_0x2fd460=_0x2b3e72();while(!![]){try{const _0x42cb2c=-parseInt(_0x307b3d(0x175))/0x1*(parseInt(_0x307b3d(0x16a))/0x2)+-parseInt(_0x307b3d(0x198))/0x3*(-parseInt(_0x307b3d(0x180))/0x4)+parseInt(_0x307b3d(0x1af))/0x5+parseInt(_0x307b3d(0x1a2))/0x6+parseInt(_0x307b3d(0x18b))/0x7*(-parseInt(_0x307b3d(0x194))/0x8)+parseInt(_0x307b3d(0x1b9))/0x9*(parseInt(_0x307b3d(0x17d))/0xa)+-parseInt(_0x307b3d(0x1c1))/0xb;if(_0x42cb2c===_0xd9bb7d)break;else _0x2fd460['push'](_0x2fd460['shift']());}catch(_0x487d40){_0x2fd460['push'](_0x2fd460['shift']());}}}(_0x5302,0xb5660));import{CommentService as _0x3fbe85,CollaborationSessionService as _0x50677e,UniverCollaborationClientPlugin as _0x54ad58}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4a3ed7}from'@univerjs-pro/license';import{dayjs as _0x3371bc,UserManagerService as _0x45c70b,Inject as _0xaa8355,Injector as _0x3fdd9c,Disposable as _0x38de46,CustomRangeType as _0x5c1d0a,UniverInstanceType as _0x4cf366,DependentOn as _0x80d377,IConfigService as _0x58d07b,Plugin as _0x1811b7,merge as _0x5c648c}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x2c1d59}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x15bc22,IThreadCommentDataSourceService as _0x46ff36}from'@univerjs/thread-comment';import{bufferTime as _0x57b9c7}from'rxjs';import{HTTPService as _0x570ef7}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x308574=>(_0x308574[_0x308574[_0x13fd22(0x1a4)]=0x0]=_0x13fd22(0x1a4),_0x308574[_0x308574[_0x13fd22(0x17e)]=0x1]=_0x13fd22(0x17e),_0x308574[_0x308574[_0x13fd22(0x189)]=-0x1]=_0x13fd22(0x189),_0x308574))(I||{}),v=(_0x21e28d=>(_0x21e28d[_0x21e28d[_0x13fd22(0x192)]=0x0]=_0x13fd22(0x192),_0x21e28d[_0x21e28d['Add']=0x1]=_0x13fd22(0x1ae),_0x21e28d[_0x21e28d['Reply']=0x2]=_0x13fd22(0x1a0),_0x21e28d[_0x21e28d[_0x13fd22(0x186)]=0x3]=_0x13fd22(0x186),_0x21e28d[_0x21e28d[_0x13fd22(0x17f)]=0x4]=_0x13fd22(0x17f),_0x21e28d[_0x21e28d[_0x13fd22(0x1a9)]=0x5]='Solve',_0x21e28d[_0x21e28d['UNRECOGNIZED']=-0x1]=_0x13fd22(0x189),_0x21e28d))(v||{});const y=_0x1975f7=>_0x3371bc(new Date(+_0x1975f7))[_0x13fd22(0x19f)](_0x13fd22(0x1b5)),B=async(_0x1c5128,_0x326bf9)=>{const _0x205283=_0x13fd22,_0x577021=_0x1c5128[_0x205283(0x1be)](_0x45c70b),_0x28b63d=_0x1c5128[_0x205283(0x1be)](_0x570ef7);_0x326bf9[_0x205283(0x195)](_0x2d0895=>{const _0x48ce69=_0x205283;_0x577021[_0x48ce69(0x1ab)](_0x2d0895)&&_0x326bf9[_0x48ce69(0x1ac)](_0x2d0895);}),_0x326bf9[_0x205283(0x18f)]&&(await _0x28b63d['get'](_0x205283(0x1b2),{'params':{'userIDs':[..._0x326bf9]}}))['body'][_0x205283(0x1a6)][_0x205283(0x195)](_0x3450c4=>{const _0x23c6d9=_0x205283;_0x3450c4&&_0x577021[_0x23c6d9(0x1aa)](_0x3450c4);});};var K=Object[_0x13fd22(0x173)],V=(_0xd076ad,_0x2c16d2,_0x4b1816,_0x425ad4)=>{for(var _0x155466=_0x425ad4>0x1?void 0x0:_0x425ad4?K(_0x2c16d2,_0x4b1816):_0x2c16d2,_0x4d5f86=_0xd076ad['length']-0x1,_0x38aa5d;_0x4d5f86>=0x0;_0x4d5f86--)(_0x38aa5d=_0xd076ad[_0x4d5f86])&&(_0x155466=_0x38aa5d(_0x155466)||_0x155466);return _0x155466;},p=(_0x281486,_0x5778f6)=>(_0xce2a77,_0x17062c)=>_0x5778f6(_0xce2a77,_0x17062c,_0x281486);let _=class extends _0x38de46{constructor(_0x209875,_0x5d1886,_0x390eff,_0x4ed1ba){const _0x4c41d2=_0x13fd22;super(),this[_0x4c41d2(0x170)]=_0x209875,this['_threadCommentModel']=_0x5d1886,this[_0x4c41d2(0x1ca)]=_0x390eff,this['_injector']=_0x4ed1ba,this[_0x4c41d2(0x18a)](),this[_0x4c41d2(0x184)]();}[_0x13fd22(0x184)](){const _0xcaa5c2=_0x13fd22;this[_0xcaa5c2(0x1bf)](this['_threadCommentModel'][_0xcaa5c2(0x174)][_0xcaa5c2(0x185)](_0x57b9c7(0x10))[_0xcaa5c2(0x1b4)](_0x33ea75=>{const _0x4fbaf4=_0xcaa5c2,_0x445758=new Set();_0x33ea75[_0x4fbaf4(0x195)](_0x5cca3b=>{const _0x35167e=_0x4fbaf4;switch(_0x5cca3b[_0x35167e(0x19c)]){case _0x35167e(0x188):{const _0xc9f003=_0x5cca3b['payload'][_0x35167e(0x181)];_0x445758[_0x35167e(0x188)](_0xc9f003);break;}}}),B(this[_0x4fbaf4(0x182)],_0x445758);}));}['_init'](){const _0x45bb18=_0x13fd22;this['disposeWithMe'](this[_0x45bb18(0x170)][_0x45bb18(0x174)][_0x45bb18(0x1b4)](async _0x267d96=>{const _0x4b277a=_0x45bb18;var _0x300262,_0x52589c,_0x3c962f,_0x14606f;const _0x4fd52d=(_0x300262=this[_0x4b277a(0x19e)][_0x4b277a(0x1c8)](_0x267d96['unitId'])['find'](_0x481d76=>_0x481d76[_0x4b277a(0x1a1)]===_0x267d96[_0x4b277a(0x1a1)]))==null?void 0x0:_0x300262[_0x4b277a(0x199)];if(!_0x4fd52d)return;const {unitId:_0x11127c,subUnitId:_0x1806d9}=_0x4fd52d;switch(_0x267d96[_0x4b277a(0x172)]&&this[_0x4b277a(0x1ca)][_0x4b277a(0x1aa)](_0x267d96[_0x4b277a(0x172)]),_0x267d96[_0x4b277a(0x19c)]){case v['Add']:break;case v['Reply']:{this[_0x4b277a(0x19e)][_0x4b277a(0x1ad)](_0x11127c,_0x1806d9,{'unitId':_0x11127c,'subUnitId':_0x1806d9,'ref':'','id':_0x267d96[_0x4b277a(0x1b8)],'dT':y(+_0x267d96['createTimestamp']),'threadId':_0x267d96[_0x4b277a(0x1a1)],'personId':(_0x3c962f=(_0x52589c=_0x267d96[_0x4b277a(0x172)])==null?void 0x0:_0x52589c[_0x4b277a(0x19a)])!=null?_0x3c962f:_0x267d96[_0x4b277a(0x17c)],'text':JSON['parse'](_0x267d96[_0x4b277a(0x1c5)]),'parentId':_0x4fd52d['id']});break;}case v[_0x4b277a(0x17f)]:{const _0x4de315=this[_0x4b277a(0x19e)][_0x4b277a(0x17a)](_0x11127c,_0x1806d9,_0x267d96[_0x4b277a(0x1b8)]);_0x4de315&&_0x4de315[_0x4b277a(0x1a5)]&&this[_0x4b277a(0x19e)]['deleteComment'](_0x11127c,_0x1806d9,_0x267d96[_0x4b277a(0x1b8)]);break;}case v[_0x4b277a(0x186)]:{this['_threadCommentModel']['updateComment'](_0x11127c,_0x1806d9,{'commentId':_0x267d96[_0x4b277a(0x1b8)],'text':JSON[_0x4b277a(0x190)](_0x267d96[_0x4b277a(0x1c5)])});break;}case v[_0x4b277a(0x1a9)]:{const _0x4c3d64=(_0x14606f=this[_0x4b277a(0x19e)]['getUnit'](_0x267d96['unitId'])[_0x4b277a(0x177)](_0x4f426c=>_0x4f426c[_0x4b277a(0x1a1)]===_0x267d96[_0x4b277a(0x1a1)]))==null?void 0x0:_0x14606f[_0x4b277a(0x199)];_0x4c3d64&&this['_threadCommentModel'][_0x4b277a(0x16d)](_0x11127c,_0x1806d9,_0x4c3d64['id'],_0x267d96[_0x4b277a(0x19d)]===I[_0x4b277a(0x17e)]);break;}}}));}};_=V([p(0x0,_0xaa8355(_0x3fbe85)),p(0x1,_0xaa8355(_0x15bc22)),p(0x2,_0xaa8355(_0x45c70b)),p(0x3,_0xaa8355(_0x3fdd9c))],_);const z='thread-comment-data-source.config',O={};var k=Object[_0x13fd22(0x173)],Q=(_0x1eeb89,_0x28210,_0x1b3256,_0x2e3719)=>{const _0x1889d1=_0x13fd22;for(var _0x3ca2a8=_0x2e3719>0x1?void 0x0:_0x2e3719?k(_0x28210,_0x1b3256):_0x28210,_0x4be001=_0x1eeb89[_0x1889d1(0x16b)]-0x1,_0x3f7e56;_0x4be001>=0x0;_0x4be001--)(_0x3f7e56=_0x1eeb89[_0x4be001])&&(_0x3ca2a8=_0x3f7e56(_0x3ca2a8)||_0x3ca2a8);return _0x3ca2a8;},b=(_0x31a031,_0x3c2365)=>(_0x6b00d3,_0x5224fd)=>_0x3c2365(_0x6b00d3,_0x5224fd,_0x31a031);function X(_0x41c870,_0x69d117){const _0x4accdd=_0x13fd22,_0x582b46=_0x41c870[_0x4accdd(0x168)][0x0];return{..._0x69d117,'id':_0x582b46[_0x4accdd(0x1b8)],'resolved':_0x41c870[_0x4accdd(0x19d)]===0x1,'dT':y(_0x582b46['createTimestamp']),'personId':_0x582b46['userId'],'threadId':_0x582b46[_0x4accdd(0x1a1)]};}function _0x5302(){const _0x283e20=['user','getOwnPropertyDescriptor','commentUpdate$','1FMlTQe','comments','find','_config','/universer-api/comment/unit/','getComment','defineProperty','userId','1154840jlIbyu','Solved','Delete','310688zUArGH','personId','_injector','getCurrentUser','_initUserSync','pipe','Edit','body','add','UNRECOGNIZED','_init','7EcihVF','saveCommentToSnapshot','error','_initDataSource','size','parse','stringify','Unknown','setConfig','7912472ESujzC','forEach','syncUpdateMutationToColla','customRanges','42PirBGe','root','userID','_httpService','type','solved','_threadCommentModel','format','Reply','threadId','3205080grNLsk','/reply','OpenOrReOpen','parentId','users','_configService','createTimestamp','Solve','addUser','getUser','delete','addComment','Add','5470970hqGpxy','slice','resolved','/universer-api/user/list','code','subscribe','YYYY/MM/DD\x20HH:mm','/list','requireSession','replyId','9iLNaik','values','COMMENT','ref','listComments','get','disposeWithMe','getMemberID','1297923Gsjtor','_threadCommentDataSource','_sessionService','map','content','UNIVER_UNKNOWN','onReady','getUnit','rangeType','_userService','/add','pluginName','replies','post','1962412QIWbPX','length','filter','resolveComment','rangeId','_threadCommentDataSourceService','_commentService','comment'];_0x5302=function(){return _0x283e20;};return _0x5302();}function _0x2bd7(_0x585f9e,_0x5e523){const _0x5302f8=_0x5302();return _0x2bd7=function(_0x2bd783,_0x166080){_0x2bd783=_0x2bd783-0x168;let _0xa52b29=_0x5302f8[_0x2bd783];return _0xa52b29;},_0x2bd7(_0x585f9e,_0x5e523);}function ee(_0x1661a5,_0x2a5e74,_0x3a6922){const _0x4588b0=_0x13fd22;var _0x101df0,_0x39cc13;if(((_0x39cc13=(_0x101df0=_0x1661a5==null?void 0x0:_0x1661a5[_0x4588b0(0x168)])==null?void 0x0:_0x101df0[_0x4588b0(0x16b)])!=null?_0x39cc13:0x0)>0x0){const _0x4aeae4=(_0x545e76,_0x116a0d)=>({'id':_0x545e76[_0x4588b0(0x1b8)],'threadId':_0x545e76['threadId'],'dT':y(_0x545e76[_0x4588b0(0x1a8)]),'personId':_0x545e76[_0x4588b0(0x17c)],'resolved':_0x1661a5[_0x4588b0(0x19d)]===I[_0x4588b0(0x17e)],'unitId':_0x2a5e74,'subUnitId':_0x3a6922,'text':JSON[_0x4588b0(0x190)](_0x545e76['content']),'parentId':_0x116a0d}),_0x71c3f9=_0x4aeae4(_0x1661a5[_0x4588b0(0x168)][0x0]);return{..._0x71c3f9,'children':_0x1661a5[_0x4588b0(0x168)][_0x4588b0(0x1b0)](0x1)[_0x4588b0(0x1c4)](_0x15c8cb=>_0x4aeae4(_0x15c8cb,_0x71c3f9['id']))};}return null;}let S=class{constructor(_0x424ec5,_0x383401,_0x494730){const _0x3ce2b=_0x13fd22;this['_httpService']=_0x424ec5,this[_0x3ce2b(0x1ca)]=_0x383401,this[_0x3ce2b(0x1c3)]=_0x494730;}async[_0x13fd22(0x1ad)](_0x122849){const _0x3fd2ee=_0x13fd22;var _0x2d0bd3,_0x3b3a3d;const {parentId:_0x5157da,unitId:_0x39e169,text:_0x1b61f9,threadId:_0x3d57cd}=_0x122849,_0x1a5d3c=(_0x3b3a3d=(_0x2d0bd3=_0x1b61f9[_0x3fd2ee(0x197)])==null?void 0x0:_0x2d0bd3[_0x3fd2ee(0x16c)](_0xf413af=>_0xf413af['rangeType']===_0x5c1d0a['COMMENT'])[_0x3fd2ee(0x1c4)](_0x125fe8=>_0x125fe8[_0x3fd2ee(0x16e)]))!=null?_0x3b3a3d:[],_0x3c12a6=JSON['stringify'](_0x1b61f9),_0xb692da=(await this[_0x3fd2ee(0x1c3)]['requireSession'](_0x39e169))[_0x3fd2ee(0x1c0)]();if(_0x5157da){const _0x38c1a4={'memberId':_0xb692da,'unitId':_0x39e169,'content':_0x3c12a6,'mention':_0x1a5d3c,'threadId':_0x3d57cd},_0x17d599=(await this[_0x3fd2ee(0x19b)]['post'](_0x3fd2ee(0x179)+_0x39e169+_0x3fd2ee(0x1a3),{'body':_0x38c1a4}))['body']['reply'];return{..._0x122849,'id':_0x17d599[_0x3fd2ee(0x1b8)],'dT':_0x3371bc(+_0x17d599[_0x3fd2ee(0x1a8)])[_0x3fd2ee(0x19f)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x17d599[_0x3fd2ee(0x17c)]};}else{const _0x2a6ac3={'memberId':_0xb692da,'unitId':_0x39e169,'content':_0x3c12a6,'mention':_0x1a5d3c},_0x4275f1=await this['_httpService'][_0x3fd2ee(0x169)](_0x3fd2ee(0x179)+_0x39e169+_0x3fd2ee(0x1cb),{'body':_0x2a6ac3});return X(_0x4275f1[_0x3fd2ee(0x187)][_0x3fd2ee(0x171)],_0x122849);}}async['updateComment'](_0x332372){const _0x942cdb=_0x13fd22;var _0x339a8d,_0x113285;const {text:_0x3091e5,unitId:_0x455fa9}=_0x332372,_0x5778f0=(_0x113285=(_0x339a8d=_0x3091e5[_0x942cdb(0x197)])==null?void 0x0:_0x339a8d[_0x942cdb(0x16c)](_0xb10e4e=>_0xb10e4e[_0x942cdb(0x1c9)]===_0x5c1d0a[_0x942cdb(0x1bb)])[_0x942cdb(0x1c4)](_0x5f1d96=>_0x5f1d96['rangeId']))!=null?_0x113285:[],_0x2eaca1=JSON[_0x942cdb(0x191)](_0x3091e5),_0x5a25c3=_0x332372['threadId'],_0x54f31e=_0x332372['id'],_0x6277a3={'memberId':(await this['_sessionService'][_0x942cdb(0x1b7)](_0x455fa9))[_0x942cdb(0x1c0)](),'unitId':_0x455fa9,'threadId':_0x5a25c3,'mention':_0x5778f0,'content':_0x2eaca1,'replyId':_0x54f31e},_0x37a6da=await this[_0x942cdb(0x19b)][_0x942cdb(0x169)](_0x942cdb(0x179)+_0x455fa9+'/edit',{'body':_0x6277a3});return!_0x37a6da[_0x942cdb(0x187)][_0x942cdb(0x18d)]||_0x37a6da['body']['error'][_0x942cdb(0x1b3)]===0x1;}async[_0x13fd22(0x16d)](_0x577ef2){const _0x11c7b5=_0x13fd22,{unitId:_0x4b89ad}=_0x577ef2,_0x6ea3f7=_0x577ef2[_0x11c7b5(0x1a1)],_0x51e5f2={'memberId':this[_0x11c7b5(0x1ca)][_0x11c7b5(0x183)]()[_0x11c7b5(0x19a)],'unitId':_0x4b89ad,'threadId':_0x6ea3f7,'solved':_0x577ef2[_0x11c7b5(0x1b1)]?I[_0x11c7b5(0x17e)]:I[_0x11c7b5(0x1a4)]},_0x15537f=await this['_httpService'][_0x11c7b5(0x169)](_0x11c7b5(0x179)+_0x4b89ad+'/solved',{'body':_0x51e5f2});return!_0x15537f[_0x11c7b5(0x187)][_0x11c7b5(0x18d)]||_0x15537f[_0x11c7b5(0x187)][_0x11c7b5(0x18d)][_0x11c7b5(0x1b3)]===0x1;}async['deleteComment'](_0x17797d,_0x21ff9e,_0x155004,_0x4f88b1){const _0x2d24a1=_0x13fd22,_0x388d7a={'memberId':(await this[_0x2d24a1(0x1c3)][_0x2d24a1(0x1b7)](_0x17797d))[_0x2d24a1(0x1c0)](),'threadId':_0x155004,'replyId':_0x4f88b1,'unitId':_0x17797d},_0x523d1e=await this[_0x2d24a1(0x19b)][_0x2d24a1(0x169)](_0x2d24a1(0x179)+_0x17797d+'/delete',{'body':_0x388d7a});return!_0x523d1e['body'][_0x2d24a1(0x18d)]||_0x523d1e[_0x2d24a1(0x187)][_0x2d24a1(0x18d)][_0x2d24a1(0x1b3)]===0x1;}async[_0x13fd22(0x1bd)](_0x5b33e9,_0x2c150e,_0x2547da){const _0x264ab3=_0x13fd22,_0x1e1b91={'unitId':_0x5b33e9,'threadId':_0x2547da},_0x4b2a64=await this[_0x264ab3(0x19b)]['post'](_0x264ab3(0x179)+_0x5b33e9+_0x264ab3(0x1b6),{'body':_0x1e1b91}),_0x233fd5=_0x2547da['map'](_0x339ed9=>ee(_0x4b2a64['body'][_0x264ab3(0x176)][_0x339ed9],_0x5b33e9,_0x2c150e))['filter'](Boolean);return Object[_0x264ab3(0x1ba)](_0x4b2a64[_0x264ab3(0x187)]['users'])[_0x264ab3(0x195)](_0x57a200=>{const _0x2f191a=_0x264ab3;this[_0x2f191a(0x1ca)][_0x2f191a(0x1aa)](_0x57a200);}),_0x233fd5;}[_0x13fd22(0x18c)](_0x59c288){const _0x37c630=_0x13fd22;return{'id':_0x59c288['id'],'threadId':_0x59c288[_0x37c630(0x1a1)],'ref':_0x59c288[_0x37c630(0x1bc)]};}};S=Q([b(0x0,_0xaa8355(_0x570ef7)),b(0x1,_0xaa8355(_0x45c70b)),b(0x2,_0xaa8355(_0x50677e))],S);var re=Object[_0x13fd22(0x173)],te=(_0x577ddb,_0x3287e6,_0x4709a4,_0x4ddfd6)=>{const _0x26573f=_0x13fd22;for(var _0x4879be=_0x4ddfd6>0x1?void 0x0:_0x4ddfd6?re(_0x3287e6,_0x4709a4):_0x3287e6,_0x384506=_0x577ddb[_0x26573f(0x16b)]-0x1,_0x1b3329;_0x384506>=0x0;_0x384506--)(_0x1b3329=_0x577ddb[_0x384506])&&(_0x4879be=_0x1b3329(_0x4879be)||_0x4879be);return _0x4879be;},M=(_0x35df9a,_0x1967a3)=>(_0x5676ad,_0x5008e8)=>_0x1967a3(_0x5676ad,_0x5008e8,_0x35df9a);let f=class extends _0x38de46{constructor(_0x4d799b,_0x50cd13){const _0x9b1841=_0x13fd22;super(),this[_0x9b1841(0x16f)]=_0x4d799b,this['_threadCommentDataSource']=_0x50cd13,this[_0x9b1841(0x18e)]();}[_0x13fd22(0x18e)](){const _0x3dd30e=_0x13fd22;this[_0x3dd30e(0x16f)]['dataSource']=this[_0x3dd30e(0x1c2)],this[_0x3dd30e(0x16f)][_0x3dd30e(0x196)]=!0x1;}};f=te([M(0x0,_0x46ff36),M(0x1,_0xaa8355(S))],f);var se=Object[_0x13fd22(0x17b)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x42854f,_0x73c3cf,_0x44d42e)=>_0x73c3cf in _0x42854f?se(_0x42854f,_0x73c3cf,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x44d42e}):_0x42854f[_0x73c3cf]=_0x44d42e,ie=(_0x26bcb9,_0x89cd3a,_0x35aa57,_0x22c449)=>{const _0x4395e5=_0x13fd22;for(var _0x1c8129=_0x22c449>0x1?void 0x0:_0x22c449?oe(_0x89cd3a,_0x35aa57):_0x89cd3a,_0x190562=_0x26bcb9[_0x4395e5(0x16b)]-0x1,_0x10e8c8;_0x190562>=0x0;_0x190562--)(_0x10e8c8=_0x26bcb9[_0x190562])&&(_0x1c8129=_0x10e8c8(_0x1c8129)||_0x1c8129);return _0x1c8129;},N=(_0x5808d1,_0x58fb69)=>(_0x3ea498,_0x581819)=>_0x58fb69(_0x3ea498,_0x581819,_0x5808d1),$=(_0x71e515,_0x255f8d,_0x5252dc)=>ne(_0x71e515,typeof _0x255f8d!='symbol'?_0x255f8d+'':_0x255f8d,_0x5252dc);let g=class extends _0x1811b7{constructor(_0x50b0ee=O,_0x22e778,_0x54b055){const _0x732f65=_0x13fd22;super(),this[_0x732f65(0x178)]=_0x50b0ee,this[_0x732f65(0x182)]=_0x22e778,this['_configService']=_0x54b055;const {..._0x899740}=_0x5c648c({},O,this[_0x732f65(0x178)]);this[_0x732f65(0x1a7)][_0x732f65(0x193)](z,_0x899740);}['onStarting'](){const _0x317907=_0x13fd22;[[S],[f],[_]][_0x317907(0x195)](_0xc00ef2=>{this['_injector']['add'](_0xc00ef2);});}[_0x13fd22(0x1c7)](){const _0x4bcb5d=_0x13fd22;this[_0x4bcb5d(0x182)][_0x4bcb5d(0x1be)](f),this[_0x4bcb5d(0x182)]['get'](_);}};$(g,_0x13fd22(0x1cc),W),$(g,_0x13fd22(0x19c),_0x4cf366[_0x13fd22(0x1c6)]),g=ie([_0x80d377(_0x2c1d59,_0x54ad58,_0x4a3ed7),N(0x1,_0xaa8355(_0x3fdd9c)),N(0x2,_0x58d07b)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/types/index.d.ts
CHANGED
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x16cc(_0xbc2c55,_0x21c98c){const _0x12bd18=_0x12bd();return _0x16cc=function(_0x16cca9,_0x34c505){_0x16cca9=_0x16cca9-0x1c3;let _0x26e94a=_0x12bd18[_0x16cca9];return _0x26e94a;},_0x16cc(_0xbc2c55,_0x21c98c);}function _0x12bd(){const _0x475af3=['saveCommentToSnapshot','content','Unknown','@univerjs/thread-comment','UniverLicensePlugin','bufferTime','stringify','solved','amd','slice','replyId','dayjs','length','user','filter','object','rxjs','toStringTag','userId','parse','threadId','COMMENT','910dUywjy','_initDataSource','_userService','_init','/reply','_configService','Delete','getCurrentUser','/universer-api/comment/unit/','UniverProCollaborationClient','symbol','UniverNetwork','_threadCommentDataSourceService','commentUpdate$','rangeType','/edit','resolved','_commentService','_threadCommentModel','YYYY/MM/DD\x20HH:mm','parentId','@univerjs-pro/collaboration-client','getOwnPropertyDescriptor','/solved','UNRECOGNIZED','@univerjs/network','code','map','payload','CustomRangeType','syncUpdateMutationToColla','/add','pluginName','onReady','setConfig','ThreadCommentModel','Inject','UniverThreadCommentUi','root','Module','OpenOrReOpen','ref','/universer-api/user/list','createTimestamp','resolveComment','Disposable','delete','125360GQPSOU','error','_httpService','Solved','merge','UniverThreadCommentDataSourcePlugin','updateComment','IThreadCommentDataSourceService','format','UniverProLicense','replies','find','_injector','get','907UxdukZ','addUser','function','thread-comment-data-source.config','comments','168uocrFZ','pipe','/list','deleteComment','IConfigService','@univerjs/core','UserManagerService','1218384xdZzRD','addComment','defineProperty','@univerjs/thread-comment-ui','940821jvwjcF','UNIVER_UNKNOWN','UniverInstanceType','Solve','users','UniverProThreadCommentDatasource','DependentOn','getComment','personId','rangeId','_sessionService','dataSource','Add','getMemberID','body','unitId','_config','152664yRIwRB','CommentService','Injector','exports','requireSession','910962jDKllX','forEach','6858KziFOH','post','3Llnwmt','type','userID','Reply','Plugin','_initUserSync','HTTPService','size','subscribe','Edit','add','UniverThreadCommentUIPlugin','_threadCommentDataSource'];_0x12bd=function(){return _0x475af3;};return _0x12bd();}(function(_0x1d0699,_0x240901){const _0x1d5a83=_0x16cc,_0x3e868b=_0x1d0699();while(!![]){try{const _0x1cd37b=-parseInt(_0x1d5a83(0x210))/0x1*(parseInt(_0x1d5a83(0x215))/0x2)+-parseInt(_0x1d5a83(0x23a))/0x3*(parseInt(_0x1d5a83(0x231))/0x4)+parseInt(_0x1d5a83(0x202))/0x5+parseInt(_0x1d5a83(0x236))/0x6+parseInt(_0x1d5a83(0x220))/0x7+-parseInt(_0x1d5a83(0x21c))/0x8+parseInt(_0x1d5a83(0x238))/0x9*(parseInt(_0x1d5a83(0x1d3))/0xa);if(_0x1cd37b===_0x240901)break;else _0x3e868b['push'](_0x3e868b['shift']());}catch(_0xe0d405){_0x3e868b['push'](_0x3e868b['shift']());}}}(_0x12bd,0x1bd48),function(_0x48650b,_0x3507ab){const _0x1c3ff7=_0x16cc;typeof exports==_0x1c3ff7(0x1cc)&&typeof module<'u'?_0x3507ab(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define==_0x1c3ff7(0x212)&&define[_0x1c3ff7(0x1c5)]?define([_0x1c3ff7(0x234),_0x1c3ff7(0x1e8),'@univerjs-pro/license',_0x1c3ff7(0x21a),_0x1c3ff7(0x21f),_0x1c3ff7(0x24a),_0x1c3ff7(0x1cd),_0x1c3ff7(0x1ec)],_0x3507ab):(_0x48650b=typeof globalThis<'u'?globalThis:_0x48650b||self,_0x3507ab(_0x48650b[_0x1c3ff7(0x225)]={},_0x48650b[_0x1c3ff7(0x1dc)],_0x48650b[_0x1c3ff7(0x20b)],_0x48650b['UniverCore'],_0x48650b[_0x1c3ff7(0x1f8)],_0x48650b['UniverThreadComment'],_0x48650b[_0x1c3ff7(0x1cd)],_0x48650b[_0x1c3ff7(0x1de)]));}(this,function(_0x503cf8,_0x1ae5ad,_0x5ea93e,_0x2a910e,_0x667203,_0x488a10,_0x2f22b7,_0x4c58d5){'use strict';const _0x1efa24=_0x16cc;const _0x59d600='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x4f488b=(_0x8bde02=>(_0x8bde02[_0x8bde02[_0x1efa24(0x1fb)]=0x0]=_0x1efa24(0x1fb),_0x8bde02[_0x8bde02[_0x1efa24(0x205)]=0x1]=_0x1efa24(0x205),_0x8bde02[_0x8bde02[_0x1efa24(0x1eb)]=-0x1]='UNRECOGNIZED',_0x8bde02))(_0x4f488b||{}),_0x213e43=(_0x466852=>(_0x466852[_0x466852[_0x1efa24(0x249)]=0x0]=_0x1efa24(0x249),_0x466852[_0x466852[_0x1efa24(0x22c)]=0x1]=_0x1efa24(0x22c),_0x466852[_0x466852['Reply']=0x2]=_0x1efa24(0x23d),_0x466852[_0x466852['Edit']=0x3]=_0x1efa24(0x243),_0x466852[_0x466852[_0x1efa24(0x1d9)]=0x4]=_0x1efa24(0x1d9),_0x466852[_0x466852[_0x1efa24(0x223)]=0x5]=_0x1efa24(0x223),_0x466852[_0x466852[_0x1efa24(0x1eb)]=-0x1]=_0x1efa24(0x1eb),_0x466852))(_0x213e43||{});const _0xc4c178=_0x4dd7b8=>_0x2a910e[_0x1efa24(0x1c8)](new Date(+_0x4dd7b8))[_0x1efa24(0x20a)]('YYYY/MM/DD\x20HH:mm'),_0x2532f9=async(_0x2e2bbd,_0x5a7249)=>{const _0x3ecef9=_0x1efa24,_0xeb5c00=_0x2e2bbd[_0x3ecef9(0x20f)](_0x2a910e[_0x3ecef9(0x21b)]),_0x317ead=_0x2e2bbd[_0x3ecef9(0x20f)](_0x4c58d5['HTTPService']);_0x5a7249['forEach'](_0x48f1f7=>{const _0x12bbb7=_0x3ecef9;_0xeb5c00['getUser'](_0x48f1f7)&&_0x5a7249[_0x12bbb7(0x201)](_0x48f1f7);}),_0x5a7249[_0x3ecef9(0x241)]&&(await _0x317ead[_0x3ecef9(0x20f)](_0x3ecef9(0x1fd),{'params':{'userIDs':[..._0x5a7249]}}))[_0x3ecef9(0x22e)][_0x3ecef9(0x224)]['forEach'](_0x43af8c=>{const _0x12d1e0=_0x3ecef9;_0x43af8c&&_0xeb5c00[_0x12d1e0(0x211)](_0x43af8c);});};var _0x4f68b4=Object['getOwnPropertyDescriptor'],_0x5e6d71=(_0x5d912d,_0x5e1adb,_0x3930cd,_0x452b3f)=>{const _0xd8d312=_0x1efa24;for(var _0x2852fc=_0x452b3f>0x1?void 0x0:_0x452b3f?_0x4f68b4(_0x5e1adb,_0x3930cd):_0x5e1adb,_0x20e63e=_0x5d912d[_0xd8d312(0x1c9)]-0x1,_0x561f78;_0x20e63e>=0x0;_0x20e63e--)(_0x561f78=_0x5d912d[_0x20e63e])&&(_0x2852fc=_0x561f78(_0x2852fc)||_0x2852fc);return _0x2852fc;},_0x2d5716=(_0x20bb06,_0xf26b5)=>(_0x2d027c,_0x1d3602)=>_0xf26b5(_0x2d027c,_0x1d3602,_0x20bb06);let _0x2fd4e8=class extends _0x2a910e[_0x1efa24(0x200)]{constructor(_0x5199e5,_0x13019a,_0x48ee39,_0x4e0f87){const _0x178e2d=_0x1efa24;super(),this[_0x178e2d(0x1e4)]=_0x5199e5,this[_0x178e2d(0x1e5)]=_0x13019a,this[_0x178e2d(0x1d5)]=_0x48ee39,this['_injector']=_0x4e0f87,this['_init'](),this[_0x178e2d(0x23f)]();}['_initUserSync'](){const _0x21a431=_0x1efa24;this['disposeWithMe'](this[_0x21a431(0x1e5)][_0x21a431(0x1e0)][_0x21a431(0x216)](_0x2f22b7[_0x21a431(0x24c)](0x10))[_0x21a431(0x242)](_0x595e55=>{const _0x12d52d=_0x21a431,_0x3023c6=new Set();_0x595e55[_0x12d52d(0x237)](_0x194879=>{const _0x4b5e79=_0x12d52d;switch(_0x194879[_0x4b5e79(0x23b)]){case _0x4b5e79(0x244):{const _0x31f947=_0x194879[_0x4b5e79(0x1ef)][_0x4b5e79(0x228)];_0x3023c6[_0x4b5e79(0x244)](_0x31f947);break;}}}),_0x2532f9(this['_injector'],_0x3023c6);}));}[_0x1efa24(0x1d6)](){const _0x10d945=_0x1efa24;this['disposeWithMe'](this[_0x10d945(0x1e4)][_0x10d945(0x1e0)][_0x10d945(0x242)](async _0x23c7d8=>{const _0x3ed171=_0x10d945;var _0x49923e,_0x115e8c,_0x332b1b,_0x406588;const _0x20637b=(_0x49923e=this['_threadCommentModel']['getUnit'](_0x23c7d8[_0x3ed171(0x22f)])[_0x3ed171(0x20d)](_0x5b4573=>_0x5b4573[_0x3ed171(0x1d1)]===_0x23c7d8[_0x3ed171(0x1d1)]))==null?void 0x0:_0x49923e[_0x3ed171(0x1f9)];if(!_0x20637b)return;const {unitId:_0x5cc5b0,subUnitId:_0x22d1b6}=_0x20637b;switch(_0x23c7d8[_0x3ed171(0x1ca)]&&this[_0x3ed171(0x1d5)][_0x3ed171(0x211)](_0x23c7d8[_0x3ed171(0x1ca)]),_0x23c7d8[_0x3ed171(0x23b)]){case _0x213e43['Add']:break;case _0x213e43[_0x3ed171(0x23d)]:{this[_0x3ed171(0x1e5)][_0x3ed171(0x21d)](_0x5cc5b0,_0x22d1b6,{'unitId':_0x5cc5b0,'subUnitId':_0x22d1b6,'ref':'','id':_0x23c7d8[_0x3ed171(0x1c7)],'dT':_0xc4c178(+_0x23c7d8[_0x3ed171(0x1fe)]),'threadId':_0x23c7d8[_0x3ed171(0x1d1)],'personId':(_0x332b1b=(_0x115e8c=_0x23c7d8[_0x3ed171(0x1ca)])==null?void 0x0:_0x115e8c[_0x3ed171(0x23c)])!=null?_0x332b1b:_0x23c7d8[_0x3ed171(0x1cf)],'text':JSON['parse'](_0x23c7d8['content']),'parentId':_0x20637b['id']});break;}case _0x213e43[_0x3ed171(0x1d9)]:{const _0x200c69=this[_0x3ed171(0x1e5)][_0x3ed171(0x227)](_0x5cc5b0,_0x22d1b6,_0x23c7d8[_0x3ed171(0x1c7)]);_0x200c69&&_0x200c69[_0x3ed171(0x1e7)]&&this['_threadCommentModel']['deleteComment'](_0x5cc5b0,_0x22d1b6,_0x23c7d8[_0x3ed171(0x1c7)]);break;}case _0x213e43[_0x3ed171(0x243)]:{this[_0x3ed171(0x1e5)][_0x3ed171(0x208)](_0x5cc5b0,_0x22d1b6,{'commentId':_0x23c7d8['replyId'],'text':JSON[_0x3ed171(0x1d0)](_0x23c7d8['content'])});break;}case _0x213e43[_0x3ed171(0x223)]:{const _0x2ff8ee=(_0x406588=this[_0x3ed171(0x1e5)]['getUnit'](_0x23c7d8[_0x3ed171(0x22f)])[_0x3ed171(0x20d)](_0x4856e3=>_0x4856e3['threadId']===_0x23c7d8[_0x3ed171(0x1d1)]))==null?void 0x0:_0x406588[_0x3ed171(0x1f9)];_0x2ff8ee&&this['_threadCommentModel'][_0x3ed171(0x1ff)](_0x5cc5b0,_0x22d1b6,_0x2ff8ee['id'],_0x23c7d8['solved']===_0x4f488b[_0x3ed171(0x205)]);break;}}}));}};_0x2fd4e8=_0x5e6d71([_0x2d5716(0x0,_0x2a910e[_0x1efa24(0x1f7)](_0x1ae5ad[_0x1efa24(0x232)])),_0x2d5716(0x1,_0x2a910e[_0x1efa24(0x1f7)](_0x488a10[_0x1efa24(0x1f6)])),_0x2d5716(0x2,_0x2a910e[_0x1efa24(0x1f7)](_0x2a910e[_0x1efa24(0x21b)])),_0x2d5716(0x3,_0x2a910e['Inject'](_0x2a910e[_0x1efa24(0x233)]))],_0x2fd4e8);const _0xc9cefb=_0x1efa24(0x213),_0x569cf3={};var _0x4238cf=Object[_0x1efa24(0x1e9)],_0x45a030=(_0x560935,_0x13d908,_0x3c4d97,_0x162832)=>{for(var _0x2524c6=_0x162832>0x1?void 0x0:_0x162832?_0x4238cf(_0x13d908,_0x3c4d97):_0x13d908,_0x28bc6d=_0x560935['length']-0x1,_0x202965;_0x28bc6d>=0x0;_0x28bc6d--)(_0x202965=_0x560935[_0x28bc6d])&&(_0x2524c6=_0x202965(_0x2524c6)||_0x2524c6);return _0x2524c6;},_0x3311db=(_0x1b6c87,_0x1e5824)=>(_0x51001d,_0x141997)=>_0x1e5824(_0x51001d,_0x141997,_0x1b6c87);function _0x3bac95(_0x1f437e,_0x542a63){const _0x4c9965=_0x1efa24,_0x39ce39=_0x1f437e[_0x4c9965(0x20c)][0x0];return{..._0x542a63,'id':_0x39ce39[_0x4c9965(0x1c7)],'resolved':_0x1f437e['solved']===0x1,'dT':_0xc4c178(_0x39ce39[_0x4c9965(0x1fe)]),'personId':_0x39ce39['userId'],'threadId':_0x39ce39[_0x4c9965(0x1d1)]};}function _0x38434f(_0xac0d64,_0x1b23e0,_0x401aa8){const _0x544aad=_0x1efa24;var _0x3df828,_0xc8b27b;if(((_0xc8b27b=(_0x3df828=_0xac0d64==null?void 0x0:_0xac0d64[_0x544aad(0x20c)])==null?void 0x0:_0x3df828[_0x544aad(0x1c9)])!=null?_0xc8b27b:0x0)>0x0){const _0x3d3547=(_0xec8d2f,_0x470096)=>({'id':_0xec8d2f[_0x544aad(0x1c7)],'threadId':_0xec8d2f[_0x544aad(0x1d1)],'dT':_0xc4c178(_0xec8d2f[_0x544aad(0x1fe)]),'personId':_0xec8d2f[_0x544aad(0x1cf)],'resolved':_0xac0d64[_0x544aad(0x1c4)]===_0x4f488b[_0x544aad(0x205)],'unitId':_0x1b23e0,'subUnitId':_0x401aa8,'text':JSON[_0x544aad(0x1d0)](_0xec8d2f[_0x544aad(0x248)]),'parentId':_0x470096}),_0x3b3ce2=_0x3d3547(_0xac0d64[_0x544aad(0x20c)][0x0]);return{..._0x3b3ce2,'children':_0xac0d64[_0x544aad(0x20c)][_0x544aad(0x1c6)](0x1)['map'](_0x311bed=>_0x3d3547(_0x311bed,_0x3b3ce2['id']))};}return null;}let _0x1261f8=class{constructor(_0x32761f,_0x5d6741,_0x125b11){const _0x52f5bb=_0x1efa24;this[_0x52f5bb(0x204)]=_0x32761f,this[_0x52f5bb(0x1d5)]=_0x5d6741,this[_0x52f5bb(0x22a)]=_0x125b11;}async[_0x1efa24(0x21d)](_0xcd8a4){const _0x26a2a4=_0x1efa24;var _0x32157b,_0x5350cb;const {parentId:_0x5d9ae9,unitId:_0x52ce4f,text:_0x223531,threadId:_0x39e770}=_0xcd8a4,_0x3d110a=(_0x5350cb=(_0x32157b=_0x223531['customRanges'])==null?void 0x0:_0x32157b[_0x26a2a4(0x1cb)](_0x1dc432=>_0x1dc432['rangeType']===_0x2a910e['CustomRangeType'][_0x26a2a4(0x1d2)])[_0x26a2a4(0x1ee)](_0x17cd39=>_0x17cd39['rangeId']))!=null?_0x5350cb:[],_0xa79af6=JSON[_0x26a2a4(0x1c3)](_0x223531),_0x409cca=(await this[_0x26a2a4(0x22a)][_0x26a2a4(0x235)](_0x52ce4f))[_0x26a2a4(0x22d)]();if(_0x5d9ae9){const _0x41a674={'memberId':_0x409cca,'unitId':_0x52ce4f,'content':_0xa79af6,'mention':_0x3d110a,'threadId':_0x39e770},_0x3634b7=(await this['_httpService'][_0x26a2a4(0x239)](_0x26a2a4(0x1db)+_0x52ce4f+_0x26a2a4(0x1d7),{'body':_0x41a674}))[_0x26a2a4(0x22e)]['reply'];return{..._0xcd8a4,'id':_0x3634b7['replyId'],'dT':_0x2a910e[_0x26a2a4(0x1c8)](+_0x3634b7[_0x26a2a4(0x1fe)])[_0x26a2a4(0x20a)](_0x26a2a4(0x1e6)),'personId':_0x3634b7[_0x26a2a4(0x1cf)]};}else{const _0x31ae9b={'memberId':_0x409cca,'unitId':_0x52ce4f,'content':_0xa79af6,'mention':_0x3d110a},_0x131fce=await this[_0x26a2a4(0x204)]['post']('/universer-api/comment/unit/'+_0x52ce4f+_0x26a2a4(0x1f2),{'body':_0x31ae9b});return _0x3bac95(_0x131fce[_0x26a2a4(0x22e)]['comment'],_0xcd8a4);}}async[_0x1efa24(0x208)](_0x21b39d){const _0x2f23ed=_0x1efa24;var _0x2a15ad,_0x6bef2c;const {text:_0x4705e7,unitId:_0x30447f}=_0x21b39d,_0x494135=(_0x6bef2c=(_0x2a15ad=_0x4705e7['customRanges'])==null?void 0x0:_0x2a15ad['filter'](_0x364c27=>_0x364c27[_0x2f23ed(0x1e1)]===_0x2a910e[_0x2f23ed(0x1f0)][_0x2f23ed(0x1d2)])[_0x2f23ed(0x1ee)](_0x1958de=>_0x1958de[_0x2f23ed(0x229)]))!=null?_0x6bef2c:[],_0x4e1b14=JSON[_0x2f23ed(0x1c3)](_0x4705e7),_0x161721=_0x21b39d[_0x2f23ed(0x1d1)],_0x70b9dd=_0x21b39d['id'],_0x451922={'memberId':(await this[_0x2f23ed(0x22a)][_0x2f23ed(0x235)](_0x30447f))[_0x2f23ed(0x22d)](),'unitId':_0x30447f,'threadId':_0x161721,'mention':_0x494135,'content':_0x4e1b14,'replyId':_0x70b9dd},_0x57b880=await this['_httpService']['post']('/universer-api/comment/unit/'+_0x30447f+_0x2f23ed(0x1e2),{'body':_0x451922});return!_0x57b880[_0x2f23ed(0x22e)][_0x2f23ed(0x203)]||_0x57b880[_0x2f23ed(0x22e)][_0x2f23ed(0x203)][_0x2f23ed(0x1ed)]===0x1;}async[_0x1efa24(0x1ff)](_0x5f3a34){const _0x21a49b=_0x1efa24,{unitId:_0x5d0219}=_0x5f3a34,_0x538307=_0x5f3a34['threadId'],_0x47df83={'memberId':this['_userService'][_0x21a49b(0x1da)]()[_0x21a49b(0x23c)],'unitId':_0x5d0219,'threadId':_0x538307,'solved':_0x5f3a34[_0x21a49b(0x1e3)]?_0x4f488b[_0x21a49b(0x205)]:_0x4f488b[_0x21a49b(0x1fb)]},_0x486588=await this[_0x21a49b(0x204)]['post']('/universer-api/comment/unit/'+_0x5d0219+_0x21a49b(0x1ea),{'body':_0x47df83});return!_0x486588[_0x21a49b(0x22e)][_0x21a49b(0x203)]||_0x486588[_0x21a49b(0x22e)]['error'][_0x21a49b(0x1ed)]===0x1;}async[_0x1efa24(0x218)](_0x2b882f,_0x436afe,_0x49d26b,_0x10a0a4){const _0x227fdb=_0x1efa24,_0x5f27dc={'memberId':(await this['_sessionService']['requireSession'](_0x2b882f))[_0x227fdb(0x22d)](),'threadId':_0x49d26b,'replyId':_0x10a0a4,'unitId':_0x2b882f},_0x2954e6=await this[_0x227fdb(0x204)][_0x227fdb(0x239)](_0x227fdb(0x1db)+_0x2b882f+'/delete',{'body':_0x5f27dc});return!_0x2954e6[_0x227fdb(0x22e)][_0x227fdb(0x203)]||_0x2954e6[_0x227fdb(0x22e)][_0x227fdb(0x203)][_0x227fdb(0x1ed)]===0x1;}async['listComments'](_0x3bea91,_0x1a5811,_0x3a8905){const _0x28de90=_0x1efa24,_0x78f67b={'unitId':_0x3bea91,'threadId':_0x3a8905},_0x1f424e=await this[_0x28de90(0x204)][_0x28de90(0x239)](_0x28de90(0x1db)+_0x3bea91+_0x28de90(0x217),{'body':_0x78f67b}),_0x1a2507=_0x3a8905[_0x28de90(0x1ee)](_0x4e1f96=>_0x38434f(_0x1f424e[_0x28de90(0x22e)][_0x28de90(0x214)][_0x4e1f96],_0x3bea91,_0x1a5811))[_0x28de90(0x1cb)](Boolean);return Object['values'](_0x1f424e[_0x28de90(0x22e)]['users'])[_0x28de90(0x237)](_0x3e0549=>{const _0x50a0df=_0x28de90;this[_0x50a0df(0x1d5)][_0x50a0df(0x211)](_0x3e0549);}),_0x1a2507;}[_0x1efa24(0x247)](_0x42c897){const _0x45d022=_0x1efa24;return{'id':_0x42c897['id'],'threadId':_0x42c897[_0x45d022(0x1d1)],'ref':_0x42c897[_0x45d022(0x1fc)]};}};_0x1261f8=_0x45a030([_0x3311db(0x0,_0x2a910e['Inject'](_0x4c58d5[_0x1efa24(0x240)])),_0x3311db(0x1,_0x2a910e[_0x1efa24(0x1f7)](_0x2a910e[_0x1efa24(0x21b)])),_0x3311db(0x2,_0x2a910e[_0x1efa24(0x1f7)](_0x1ae5ad['CollaborationSessionService']))],_0x1261f8);var _0x15f539=Object[_0x1efa24(0x1e9)],_0x361bc3=(_0x35cec9,_0xeaeedd,_0x34fa23,_0x532807)=>{const _0x4bc8e9=_0x1efa24;for(var _0xbe2b91=_0x532807>0x1?void 0x0:_0x532807?_0x15f539(_0xeaeedd,_0x34fa23):_0xeaeedd,_0x3bbabd=_0x35cec9[_0x4bc8e9(0x1c9)]-0x1,_0x3a2c96;_0x3bbabd>=0x0;_0x3bbabd--)(_0x3a2c96=_0x35cec9[_0x3bbabd])&&(_0xbe2b91=_0x3a2c96(_0xbe2b91)||_0xbe2b91);return _0xbe2b91;},_0x33cfb8=(_0x41a323,_0x4a197e)=>(_0x5e25e8,_0x18894b)=>_0x4a197e(_0x5e25e8,_0x18894b,_0x41a323);let _0xd48725=class extends _0x2a910e[_0x1efa24(0x200)]{constructor(_0x4920ad,_0x1ba8b6){const _0x18e681=_0x1efa24;super(),this[_0x18e681(0x1df)]=_0x4920ad,this[_0x18e681(0x246)]=_0x1ba8b6,this[_0x18e681(0x1d4)]();}[_0x1efa24(0x1d4)](){const _0x4dd695=_0x1efa24;this[_0x4dd695(0x1df)][_0x4dd695(0x22b)]=this[_0x4dd695(0x246)],this[_0x4dd695(0x1df)][_0x4dd695(0x1f1)]=!0x1;}};_0xd48725=_0x361bc3([_0x33cfb8(0x0,_0x488a10[_0x1efa24(0x209)]),_0x33cfb8(0x1,_0x2a910e[_0x1efa24(0x1f7)](_0x1261f8))],_0xd48725);var _0x338b76=Object[_0x1efa24(0x21e)],_0x24746f=Object[_0x1efa24(0x1e9)],_0x38782a=(_0x33d642,_0x224512,_0x49213e)=>_0x224512 in _0x33d642?_0x338b76(_0x33d642,_0x224512,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x49213e}):_0x33d642[_0x224512]=_0x49213e,_0x34dccf=(_0x362e73,_0x1f2cca,_0x29ce00,_0x5bfe67)=>{const _0x2e0851=_0x1efa24;for(var _0x38f525=_0x5bfe67>0x1?void 0x0:_0x5bfe67?_0x24746f(_0x1f2cca,_0x29ce00):_0x1f2cca,_0x2bc75e=_0x362e73[_0x2e0851(0x1c9)]-0x1,_0x160d6e;_0x2bc75e>=0x0;_0x2bc75e--)(_0x160d6e=_0x362e73[_0x2bc75e])&&(_0x38f525=_0x160d6e(_0x38f525)||_0x38f525);return _0x38f525;},_0x452eb8=(_0x5585c1,_0x32cd51)=>(_0x486815,_0x3ea586)=>_0x32cd51(_0x486815,_0x3ea586,_0x5585c1),_0x32194d=(_0x73d2a9,_0x108232,_0xda6962)=>_0x38782a(_0x73d2a9,typeof _0x108232!=_0x1efa24(0x1dd)?_0x108232+'':_0x108232,_0xda6962);_0x503cf8['UniverThreadCommentDataSourcePlugin']=class extends _0x2a910e[_0x1efa24(0x23e)]{constructor(_0x42738b=_0x569cf3,_0x57f007,_0x4ff830){const _0x3e627a=_0x1efa24;super(),this[_0x3e627a(0x230)]=_0x42738b,this['_injector']=_0x57f007,this[_0x3e627a(0x1d8)]=_0x4ff830;const {..._0xe0463d}=_0x2a910e[_0x3e627a(0x206)]({},_0x569cf3,this[_0x3e627a(0x230)]);this[_0x3e627a(0x1d8)][_0x3e627a(0x1f5)](_0xc9cefb,_0xe0463d);}['onStarting'](){const _0x58513c=_0x1efa24;[[_0x1261f8],[_0xd48725],[_0x2fd4e8]][_0x58513c(0x237)](_0x2d224d=>{this['_injector']['add'](_0x2d224d);});}[_0x1efa24(0x1f4)](){const _0x293cf2=_0x1efa24;this[_0x293cf2(0x20e)][_0x293cf2(0x20f)](_0xd48725),this[_0x293cf2(0x20e)][_0x293cf2(0x20f)](_0x2fd4e8);}},_0x32194d(_0x503cf8[_0x1efa24(0x207)],_0x1efa24(0x1f3),_0x59d600),_0x32194d(_0x503cf8[_0x1efa24(0x207)],_0x1efa24(0x23b),_0x2a910e[_0x1efa24(0x222)][_0x1efa24(0x221)]),_0x503cf8[_0x1efa24(0x207)]=_0x34dccf([_0x2a910e[_0x1efa24(0x226)](_0x667203[_0x1efa24(0x245)],_0x1ae5ad['UniverCollaborationClientPlugin'],_0x5ea93e[_0x1efa24(0x24b)]),_0x452eb8(0x1,_0x2a910e[_0x1efa24(0x1f7)](_0x2a910e['Injector'])),_0x452eb8(0x2,_0x2a910e[_0x1efa24(0x219)])],_0x503cf8[_0x1efa24(0x207)]),Object[_0x1efa24(0x21e)](_0x503cf8,Symbol[_0x1efa24(0x1ce)],{'value':_0x1efa24(0x1fa)});}));
|
|
1
|
+
function _0x57b2(_0x24aac2,_0x3286f3){const _0x7288b5=_0x7288();return _0x57b2=function(_0x57b2da,_0x1edb58){_0x57b2da=_0x57b2da-0x198;let _0x225eed=_0x7288b5[_0x57b2da];return _0x225eed;},_0x57b2(_0x24aac2,_0x3286f3);}(function(_0x46e386,_0x44ce75){const _0x4d03f9=_0x57b2,_0x538952=_0x46e386();while(!![]){try{const _0x1995fe=-parseInt(_0x4d03f9(0x1be))/0x1*(-parseInt(_0x4d03f9(0x1d5))/0x2)+-parseInt(_0x4d03f9(0x1b3))/0x3*(parseInt(_0x4d03f9(0x1c4))/0x4)+parseInt(_0x4d03f9(0x1e6))/0x5+-parseInt(_0x4d03f9(0x1a6))/0x6+-parseInt(_0x4d03f9(0x1fb))/0x7+parseInt(_0x4d03f9(0x200))/0x8+-parseInt(_0x4d03f9(0x213))/0x9;if(_0x1995fe===_0x44ce75)break;else _0x538952['push'](_0x538952['shift']());}catch(_0x1df9aa){_0x538952['push'](_0x538952['shift']());}}}(_0x7288,0x94615),function(_0x5e71e1,_0x5304e0){const _0x4e0052=_0x57b2;typeof exports==_0x4e0052(0x1fe)&&typeof module<'u'?_0x5304e0(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define==_0x4e0052(0x1c1)&&define[_0x4e0052(0x207)]?define([_0x4e0052(0x1cd),'@univerjs-pro/collaboration-client',_0x4e0052(0x1ad),_0x4e0052(0x1cb),_0x4e0052(0x1d8),'@univerjs/thread-comment',_0x4e0052(0x19c),'@univerjs/network'],_0x5304e0):(_0x5e71e1=typeof globalThis<'u'?globalThis:_0x5e71e1||self,_0x5304e0(_0x5e71e1[_0x4e0052(0x21b)]={},_0x5e71e1[_0x4e0052(0x1a8)],_0x5e71e1[_0x4e0052(0x1d4)],_0x5e71e1[_0x4e0052(0x1f7)],_0x5e71e1[_0x4e0052(0x209)],_0x5e71e1[_0x4e0052(0x1bf)],_0x5e71e1[_0x4e0052(0x19c)],_0x5e71e1[_0x4e0052(0x1b2)]));}(this,function(_0x3d06e0,_0x419784,_0x453f4e,_0x2719a6,_0x30f938,_0x124cfb,_0x58c8b1,_0x45adf1){'use strict';const _0x543983=_0x57b2;const _0x402452=_0x543983(0x221);var _0x1f7dd8=(_0x252b15=>(_0x252b15[_0x252b15[_0x543983(0x1c2)]=0x0]=_0x543983(0x1c2),_0x252b15[_0x252b15['Solved']=0x1]=_0x543983(0x219),_0x252b15[_0x252b15['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x252b15))(_0x1f7dd8||{}),_0x3ab9da=(_0xb2849=>(_0xb2849[_0xb2849['Unknown']=0x0]=_0x543983(0x1d3),_0xb2849[_0xb2849[_0x543983(0x19e)]=0x1]='Add',_0xb2849[_0xb2849['Reply']=0x2]=_0x543983(0x20d),_0xb2849[_0xb2849['Edit']=0x3]=_0x543983(0x205),_0xb2849[_0xb2849[_0x543983(0x1a5)]=0x4]=_0x543983(0x1a5),_0xb2849[_0xb2849[_0x543983(0x1ff)]=0x5]='Solve',_0xb2849[_0xb2849[_0x543983(0x1ef)]=-0x1]='UNRECOGNIZED',_0xb2849))(_0x3ab9da||{});const _0x5bbbfe=_0x2db556=>_0x2719a6[_0x543983(0x1c3)](new Date(+_0x2db556))[_0x543983(0x21f)](_0x543983(0x1c7)),_0xeb6ef=async(_0x133ed4,_0x587891)=>{const _0x33559f=_0x543983,_0x378c51=_0x133ed4[_0x33559f(0x206)](_0x2719a6[_0x33559f(0x1f0)]),_0x51b45b=_0x133ed4[_0x33559f(0x206)](_0x45adf1[_0x33559f(0x1d6)]);_0x587891['forEach'](_0xaf7578=>{const _0x1c36d7=_0x33559f;_0x378c51[_0x1c36d7(0x1e3)](_0xaf7578)&&_0x587891[_0x1c36d7(0x1c9)](_0xaf7578);}),_0x587891[_0x33559f(0x1e4)]&&(await _0x51b45b['get'](_0x33559f(0x1c8),{'params':{'userIDs':[..._0x587891]}}))['body']['users'][_0x33559f(0x1ec)](_0x495bde=>{_0x495bde&&_0x378c51['addUser'](_0x495bde);});};var _0x2c6244=Object[_0x543983(0x20b)],_0x3d911c=(_0x114b18,_0x2f2060,_0x25d830,_0x267f3d)=>{const _0xa254c6=_0x543983;for(var _0x48bb3f=_0x267f3d>0x1?void 0x0:_0x267f3d?_0x2c6244(_0x2f2060,_0x25d830):_0x2f2060,_0x36c993=_0x114b18[_0xa254c6(0x1bd)]-0x1,_0x3b50a5;_0x36c993>=0x0;_0x36c993--)(_0x3b50a5=_0x114b18[_0x36c993])&&(_0x48bb3f=_0x3b50a5(_0x48bb3f)||_0x48bb3f);return _0x48bb3f;},_0x2fda31=(_0x2bb833,_0x3f2a28)=>(_0x5c7dc0,_0x3f0bb7)=>_0x3f2a28(_0x5c7dc0,_0x3f0bb7,_0x2bb833);let _0x42393c=class extends _0x2719a6[_0x543983(0x211)]{constructor(_0x1534e0,_0x2360bd,_0x582653,_0x3166cf){const _0x3571cb=_0x543983;super(),this[_0x3571cb(0x21c)]=_0x1534e0,this[_0x3571cb(0x1b6)]=_0x2360bd,this[_0x3571cb(0x1c6)]=_0x582653,this[_0x3571cb(0x1f9)]=_0x3166cf,this[_0x3571cb(0x1df)](),this[_0x3571cb(0x203)]();}[_0x543983(0x203)](){const _0x5e6c0e=_0x543983;this[_0x5e6c0e(0x220)](this[_0x5e6c0e(0x1b6)][_0x5e6c0e(0x1ce)][_0x5e6c0e(0x1bc)](_0x58c8b1['bufferTime'](0x10))[_0x5e6c0e(0x19f)](_0x2bd6c2=>{const _0x454caa=_0x5e6c0e,_0x171674=new Set();_0x2bd6c2[_0x454caa(0x1ec)](_0x42c8ff=>{const _0x5aa1e9=_0x454caa;switch(_0x42c8ff[_0x5aa1e9(0x1af)]){case'add':{const _0x1491db=_0x42c8ff[_0x5aa1e9(0x215)][_0x5aa1e9(0x1cf)];_0x171674[_0x5aa1e9(0x208)](_0x1491db);break;}}}),_0xeb6ef(this[_0x454caa(0x1f9)],_0x171674);}));}[_0x543983(0x1df)](){const _0x5eb6e9=_0x543983;this[_0x5eb6e9(0x220)](this[_0x5eb6e9(0x21c)][_0x5eb6e9(0x1ce)]['subscribe'](async _0x532e1a=>{const _0x24f854=_0x5eb6e9;var _0x5d2992,_0x56933c,_0x11a53d,_0x41d01c;const _0xdf5273=(_0x5d2992=this[_0x24f854(0x1b6)][_0x24f854(0x204)](_0x532e1a[_0x24f854(0x19b)])[_0x24f854(0x202)](_0x52ba1d=>_0x52ba1d[_0x24f854(0x1da)]===_0x532e1a[_0x24f854(0x1da)]))==null?void 0x0:_0x5d2992[_0x24f854(0x1a0)];if(!_0xdf5273)return;const {unitId:_0x117417,subUnitId:_0x239928}=_0xdf5273;switch(_0x532e1a[_0x24f854(0x1b9)]&&this['_userService'][_0x24f854(0x1ac)](_0x532e1a[_0x24f854(0x1b9)]),_0x532e1a['type']){case _0x3ab9da['Add']:break;case _0x3ab9da[_0x24f854(0x20d)]:{this['_threadCommentModel'][_0x24f854(0x20a)](_0x117417,_0x239928,{'unitId':_0x117417,'subUnitId':_0x239928,'ref':'','id':_0x532e1a[_0x24f854(0x1ca)],'dT':_0x5bbbfe(+_0x532e1a[_0x24f854(0x1b4)]),'threadId':_0x532e1a[_0x24f854(0x1da)],'personId':(_0x11a53d=(_0x56933c=_0x532e1a[_0x24f854(0x1b9)])==null?void 0x0:_0x56933c[_0x24f854(0x1bb)])!=null?_0x11a53d:_0x532e1a[_0x24f854(0x1ea)],'text':JSON[_0x24f854(0x21a)](_0x532e1a[_0x24f854(0x1ab)]),'parentId':_0xdf5273['id']});break;}case _0x3ab9da[_0x24f854(0x1a5)]:{const _0x418d35=this[_0x24f854(0x1b6)][_0x24f854(0x1b1)](_0x117417,_0x239928,_0x532e1a[_0x24f854(0x1ca)]);_0x418d35&&_0x418d35[_0x24f854(0x1c5)]&&this[_0x24f854(0x1b6)][_0x24f854(0x198)](_0x117417,_0x239928,_0x532e1a[_0x24f854(0x1ca)]);break;}case _0x3ab9da[_0x24f854(0x205)]:{this['_threadCommentModel'][_0x24f854(0x212)](_0x117417,_0x239928,{'commentId':_0x532e1a[_0x24f854(0x1ca)],'text':JSON[_0x24f854(0x21a)](_0x532e1a['content'])});break;}case _0x3ab9da[_0x24f854(0x1ff)]:{const _0x4b6c88=(_0x41d01c=this[_0x24f854(0x1b6)]['getUnit'](_0x532e1a[_0x24f854(0x19b)])['find'](_0x2fe6ea=>_0x2fe6ea[_0x24f854(0x1da)]===_0x532e1a[_0x24f854(0x1da)]))==null?void 0x0:_0x41d01c[_0x24f854(0x1a0)];_0x4b6c88&&this[_0x24f854(0x1b6)][_0x24f854(0x1fc)](_0x117417,_0x239928,_0x4b6c88['id'],_0x532e1a[_0x24f854(0x1d0)]===_0x1f7dd8[_0x24f854(0x219)]);break;}}}));}};_0x42393c=_0x3d911c([_0x2fda31(0x0,_0x2719a6[_0x543983(0x1e0)](_0x419784[_0x543983(0x1a7)])),_0x2fda31(0x1,_0x2719a6[_0x543983(0x1e0)](_0x124cfb[_0x543983(0x1f8)])),_0x2fda31(0x2,_0x2719a6[_0x543983(0x1e0)](_0x2719a6[_0x543983(0x1f0)])),_0x2fda31(0x3,_0x2719a6['Inject'](_0x2719a6['Injector']))],_0x42393c);const _0x5c524=_0x543983(0x1ae),_0x1bc86f={};var _0x3691c3=Object[_0x543983(0x20b)],_0x3b1755=(_0x2c4c96,_0x39cbd2,_0x4dc882,_0x5d5abd)=>{for(var _0x166654=_0x5d5abd>0x1?void 0x0:_0x5d5abd?_0x3691c3(_0x39cbd2,_0x4dc882):_0x39cbd2,_0x51df44=_0x2c4c96['length']-0x1,_0x559b8d;_0x51df44>=0x0;_0x51df44--)(_0x559b8d=_0x2c4c96[_0x51df44])&&(_0x166654=_0x559b8d(_0x166654)||_0x166654);return _0x166654;},_0x50be53=(_0x396601,_0x10991d)=>(_0xd852e5,_0x416a88)=>_0x10991d(_0xd852e5,_0x416a88,_0x396601);function _0x4fdfe7(_0x321b9a,_0x500a46){const _0x3139ad=_0x543983,_0x9552e4=_0x321b9a[_0x3139ad(0x1a9)][0x0];return{..._0x500a46,'id':_0x9552e4['replyId'],'resolved':_0x321b9a['solved']===0x1,'dT':_0x5bbbfe(_0x9552e4[_0x3139ad(0x1b4)]),'personId':_0x9552e4[_0x3139ad(0x1ea)],'threadId':_0x9552e4[_0x3139ad(0x1da)]};}function _0x5e6398(_0xb9625,_0x5d94f2,_0x22eb48){const _0x227263=_0x543983;var _0x3123e4,_0x5eaee7;if(((_0x5eaee7=(_0x3123e4=_0xb9625==null?void 0x0:_0xb9625[_0x227263(0x1a9)])==null?void 0x0:_0x3123e4[_0x227263(0x1bd)])!=null?_0x5eaee7:0x0)>0x0){const _0x1d882e=(_0xc58a53,_0x270330)=>({'id':_0xc58a53[_0x227263(0x1ca)],'threadId':_0xc58a53[_0x227263(0x1da)],'dT':_0x5bbbfe(_0xc58a53['createTimestamp']),'personId':_0xc58a53[_0x227263(0x1ea)],'resolved':_0xb9625[_0x227263(0x1d0)]===_0x1f7dd8[_0x227263(0x219)],'unitId':_0x5d94f2,'subUnitId':_0x22eb48,'text':JSON[_0x227263(0x21a)](_0xc58a53[_0x227263(0x1ab)]),'parentId':_0x270330}),_0x519f42=_0x1d882e(_0xb9625[_0x227263(0x1a9)][0x0]);return{..._0x519f42,'children':_0xb9625['replies'][_0x227263(0x20c)](0x1)[_0x227263(0x217)](_0x54baf5=>_0x1d882e(_0x54baf5,_0x519f42['id']))};}return null;}let _0x57065d=class{constructor(_0x5024c0,_0x411cab,_0x4d53a0){const _0x5a27a8=_0x543983;this[_0x5a27a8(0x1dc)]=_0x5024c0,this[_0x5a27a8(0x1c6)]=_0x411cab,this['_sessionService']=_0x4d53a0;}async['addComment'](_0x26222f){const _0x15173e=_0x543983;var _0x3f1cfc,_0x4e6942;const {parentId:_0x3a76f7,unitId:_0x594734,text:_0x35b2d5,threadId:_0x177389}=_0x26222f,_0x47623e=(_0x4e6942=(_0x3f1cfc=_0x35b2d5[_0x15173e(0x216)])==null?void 0x0:_0x3f1cfc[_0x15173e(0x1c0)](_0x1000b2=>_0x1000b2[_0x15173e(0x1d2)]===_0x2719a6[_0x15173e(0x19a)][_0x15173e(0x1fd)])[_0x15173e(0x217)](_0x33a776=>_0x33a776[_0x15173e(0x1cc)]))!=null?_0x4e6942:[],_0x588249=JSON['stringify'](_0x35b2d5),_0x1f4783=(await this[_0x15173e(0x1a1)][_0x15173e(0x1b7)](_0x594734))[_0x15173e(0x1f4)]();if(_0x3a76f7){const _0xfdc992={'memberId':_0x1f4783,'unitId':_0x594734,'content':_0x588249,'mention':_0x47623e,'threadId':_0x177389},_0x434f7f=(await this[_0x15173e(0x1dc)][_0x15173e(0x1e7)](_0x15173e(0x1f6)+_0x594734+'/reply',{'body':_0xfdc992}))[_0x15173e(0x1ba)][_0x15173e(0x201)];return{..._0x26222f,'id':_0x434f7f[_0x15173e(0x1ca)],'dT':_0x2719a6[_0x15173e(0x1c3)](+_0x434f7f[_0x15173e(0x1b4)])[_0x15173e(0x21f)](_0x15173e(0x1c7)),'personId':_0x434f7f['userId']};}else{const _0x4b4298={'memberId':_0x1f4783,'unitId':_0x594734,'content':_0x588249,'mention':_0x47623e},_0x5c6dbc=await this[_0x15173e(0x1dc)][_0x15173e(0x1e7)](_0x15173e(0x1f6)+_0x594734+_0x15173e(0x1fa),{'body':_0x4b4298});return _0x4fdfe7(_0x5c6dbc[_0x15173e(0x1ba)][_0x15173e(0x1e9)],_0x26222f);}}async[_0x543983(0x212)](_0xfb48a1){const _0x559ab0=_0x543983;var _0xb11eea,_0x3cc276;const {text:_0xdd13fd,unitId:_0x355ff7}=_0xfb48a1,_0x556ec8=(_0x3cc276=(_0xb11eea=_0xdd13fd[_0x559ab0(0x216)])==null?void 0x0:_0xb11eea[_0x559ab0(0x1c0)](_0x5abc8f=>_0x5abc8f[_0x559ab0(0x1d2)]===_0x2719a6[_0x559ab0(0x19a)][_0x559ab0(0x1fd)])['map'](_0x29e654=>_0x29e654['rangeId']))!=null?_0x3cc276:[],_0x4f3639=JSON['stringify'](_0xdd13fd),_0x173538=_0xfb48a1[_0x559ab0(0x1da)],_0x5042ce=_0xfb48a1['id'],_0x1b51f9={'memberId':(await this[_0x559ab0(0x1a1)][_0x559ab0(0x1b7)](_0x355ff7))[_0x559ab0(0x1f4)](),'unitId':_0x355ff7,'threadId':_0x173538,'mention':_0x556ec8,'content':_0x4f3639,'replyId':_0x5042ce},_0x534858=await this[_0x559ab0(0x1dc)][_0x559ab0(0x1e7)]('/universer-api/comment/unit/'+_0x355ff7+_0x559ab0(0x1db),{'body':_0x1b51f9});return!_0x534858[_0x559ab0(0x1ba)]['error']||_0x534858[_0x559ab0(0x1ba)][_0x559ab0(0x1a4)][_0x559ab0(0x1aa)]===0x1;}async[_0x543983(0x1fc)](_0x492e83){const _0x3d9bd2=_0x543983,{unitId:_0x2217e2}=_0x492e83,_0x40506d=_0x492e83[_0x3d9bd2(0x1da)],_0x48bfb0={'memberId':this['_userService'][_0x3d9bd2(0x1de)]()['userID'],'unitId':_0x2217e2,'threadId':_0x40506d,'solved':_0x492e83['resolved']?_0x1f7dd8[_0x3d9bd2(0x219)]:_0x1f7dd8[_0x3d9bd2(0x1c2)]},_0x26d9a3=await this[_0x3d9bd2(0x1dc)][_0x3d9bd2(0x1e7)]('/universer-api/comment/unit/'+_0x2217e2+_0x3d9bd2(0x1f2),{'body':_0x48bfb0});return!_0x26d9a3[_0x3d9bd2(0x1ba)][_0x3d9bd2(0x1a4)]||_0x26d9a3['body'][_0x3d9bd2(0x1a4)][_0x3d9bd2(0x1aa)]===0x1;}async[_0x543983(0x198)](_0x527746,_0x10086e,_0x695734,_0x3ecb0e){const _0xd93645=_0x543983,_0x4961ff={'memberId':(await this['_sessionService']['requireSession'](_0x527746))[_0xd93645(0x1f4)](),'threadId':_0x695734,'replyId':_0x3ecb0e,'unitId':_0x527746},_0x45f9ed=await this[_0xd93645(0x1dc)]['post'](_0xd93645(0x1f6)+_0x527746+'/delete',{'body':_0x4961ff});return!_0x45f9ed[_0xd93645(0x1ba)]['error']||_0x45f9ed[_0xd93645(0x1ba)][_0xd93645(0x1a4)]['code']===0x1;}async[_0x543983(0x20f)](_0x34b300,_0x302afb,_0x40e886){const _0x4d7a16=_0x543983,_0x4d65a1={'unitId':_0x34b300,'threadId':_0x40e886},_0x4fb19e=await this[_0x4d7a16(0x1dc)]['post'](_0x4d7a16(0x1f6)+_0x34b300+'/list',{'body':_0x4d65a1}),_0x1e2bd0=_0x40e886[_0x4d7a16(0x217)](_0x1463c8=>_0x5e6398(_0x4fb19e[_0x4d7a16(0x1ba)]['comments'][_0x1463c8],_0x34b300,_0x302afb))['filter'](Boolean);return Object[_0x4d7a16(0x1ed)](_0x4fb19e[_0x4d7a16(0x1ba)][_0x4d7a16(0x1d9)])[_0x4d7a16(0x1ec)](_0x22eb5f=>{const _0x78939e=_0x4d7a16;this['_userService'][_0x78939e(0x1ac)](_0x22eb5f);}),_0x1e2bd0;}[_0x543983(0x1d7)](_0x68729b){const _0x1719ac=_0x543983;return{'id':_0x68729b['id'],'threadId':_0x68729b[_0x1719ac(0x1da)],'ref':_0x68729b[_0x1719ac(0x1f3)]};}};_0x57065d=_0x3b1755([_0x50be53(0x0,_0x2719a6['Inject'](_0x45adf1[_0x543983(0x1d6)])),_0x50be53(0x1,_0x2719a6['Inject'](_0x2719a6[_0x543983(0x1f0)])),_0x50be53(0x2,_0x2719a6[_0x543983(0x1e0)](_0x419784['CollaborationSessionService']))],_0x57065d);var _0x383e64=Object['getOwnPropertyDescriptor'],_0x5c24c6=(_0x524e42,_0x3b24d7,_0x2b1717,_0x45d034)=>{for(var _0x2fb17d=_0x45d034>0x1?void 0x0:_0x45d034?_0x383e64(_0x3b24d7,_0x2b1717):_0x3b24d7,_0x594216=_0x524e42['length']-0x1,_0x39efdb;_0x594216>=0x0;_0x594216--)(_0x39efdb=_0x524e42[_0x594216])&&(_0x2fb17d=_0x39efdb(_0x2fb17d)||_0x2fb17d);return _0x2fb17d;},_0x346711=(_0x24fc51,_0x507525)=>(_0x9c2e03,_0x54cc58)=>_0x507525(_0x9c2e03,_0x54cc58,_0x24fc51);let _0x5e9438=class extends _0x2719a6['Disposable']{constructor(_0x53703b,_0x458fa5){const _0x471224=_0x543983;super(),this[_0x471224(0x1e2)]=_0x53703b,this[_0x471224(0x1e1)]=_0x458fa5,this['_initDataSource']();}['_initDataSource'](){const _0x1b41f1=_0x543983;this[_0x1b41f1(0x1e2)][_0x1b41f1(0x1b0)]=this[_0x1b41f1(0x1e1)],this[_0x1b41f1(0x1e2)][_0x1b41f1(0x1f5)]=!0x1;}};_0x5e9438=_0x5c24c6([_0x346711(0x0,_0x124cfb[_0x543983(0x1b5)]),_0x346711(0x1,_0x2719a6[_0x543983(0x1e0)](_0x57065d))],_0x5e9438);var _0x15029a=Object[_0x543983(0x218)],_0x1b5644=Object['getOwnPropertyDescriptor'],_0x163b85=(_0xb01878,_0x4a02d9,_0x43f358)=>_0x4a02d9 in _0xb01878?_0x15029a(_0xb01878,_0x4a02d9,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x43f358}):_0xb01878[_0x4a02d9]=_0x43f358,_0xca0be5=(_0x4da116,_0x54ef89,_0x7143a5,_0x1151e2)=>{for(var _0x31e1ca=_0x1151e2>0x1?void 0x0:_0x1151e2?_0x1b5644(_0x54ef89,_0x7143a5):_0x54ef89,_0x309150=_0x4da116['length']-0x1,_0x31624e;_0x309150>=0x0;_0x309150--)(_0x31624e=_0x4da116[_0x309150])&&(_0x31e1ca=_0x31624e(_0x31e1ca)||_0x31e1ca);return _0x31e1ca;},_0x169baf=(_0x64dccc,_0x137a6b)=>(_0x86f9e3,_0x46c024)=>_0x137a6b(_0x86f9e3,_0x46c024,_0x64dccc),_0x28d9d0=(_0x25cb83,_0x5e3409,_0x2d3251)=>_0x163b85(_0x25cb83,typeof _0x5e3409!=_0x543983(0x1a2)?_0x5e3409+'':_0x5e3409,_0x2d3251);_0x3d06e0[_0x543983(0x19d)]=class extends _0x2719a6[_0x543983(0x1eb)]{constructor(_0x14f6fb=_0x1bc86f,_0x3f7302,_0x38e223){const _0x4b3d85=_0x543983;super(),this[_0x4b3d85(0x21e)]=_0x14f6fb,this[_0x4b3d85(0x1f9)]=_0x3f7302,this[_0x4b3d85(0x1ee)]=_0x38e223;const {..._0x235f41}=_0x2719a6['merge']({},_0x1bc86f,this['_config']);this['_configService'][_0x4b3d85(0x1dd)](_0x5c524,_0x235f41);}[_0x543983(0x210)](){[[_0x57065d],[_0x5e9438],[_0x42393c]]['forEach'](_0x39f2f9=>{const _0x4387ef=_0x57b2;this[_0x4387ef(0x1f9)][_0x4387ef(0x208)](_0x39f2f9);});}[_0x543983(0x21d)](){const _0x142758=_0x543983;this['_injector'][_0x142758(0x206)](_0x5e9438),this['_injector'][_0x142758(0x206)](_0x42393c);}},_0x28d9d0(_0x3d06e0[_0x543983(0x19d)],_0x543983(0x1f1),_0x402452),_0x28d9d0(_0x3d06e0[_0x543983(0x19d)],'type',_0x2719a6[_0x543983(0x1b8)]['UNIVER_UNKNOWN']),_0x3d06e0[_0x543983(0x19d)]=_0xca0be5([_0x2719a6[_0x543983(0x214)](_0x30f938['UniverThreadCommentUIPlugin'],_0x419784[_0x543983(0x1a3)],_0x453f4e[_0x543983(0x20e)]),_0x169baf(0x1,_0x2719a6[_0x543983(0x1e0)](_0x2719a6[_0x543983(0x199)])),_0x169baf(0x2,_0x2719a6[_0x543983(0x1d1)])],_0x3d06e0[_0x543983(0x19d)]),Object[_0x543983(0x218)](_0x3d06e0,Symbol[_0x543983(0x1e8)],{'value':_0x543983(0x1e5)});}));function _0x7288(){const _0x10f4eb=['Reply','UniverLicensePlugin','listComments','onStarting','Disposable','updateComment','2238426NCjhCr','DependentOn','payload','customRanges','map','defineProperty','Solved','parse','UniverProThreadCommentDatasource','_commentService','onReady','_config','format','disposeWithMe','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','deleteComment','Injector','CustomRangeType','unitId','rxjs','UniverThreadCommentDataSourcePlugin','Add','subscribe','root','_sessionService','symbol','UniverCollaborationClientPlugin','error','Delete','5209626oOqvqG','CommentService','UniverProCollaborationClient','replies','code','content','addUser','@univerjs-pro/license','thread-comment-data-source.config','type','dataSource','getComment','UniverNetwork','9uszuXm','createTimestamp','IThreadCommentDataSourceService','_threadCommentModel','requireSession','UniverInstanceType','user','body','userID','pipe','length','12953EEmGsZ','UniverThreadComment','filter','function','OpenOrReOpen','dayjs','75876UiYDKg','parentId','_userService','YYYY/MM/DD\x20HH:mm','/universer-api/user/list','delete','replyId','@univerjs/core','rangeId','exports','commentUpdate$','personId','solved','IConfigService','rangeType','Unknown','UniverProLicense','168cSoXqw','HTTPService','saveCommentToSnapshot','@univerjs/thread-comment-ui','users','threadId','/edit','_httpService','setConfig','getCurrentUser','_init','Inject','_threadCommentDataSource','_threadCommentDataSourceService','getUser','size','Module','2226960UjMmLC','post','toStringTag','comment','userId','Plugin','forEach','values','_configService','UNRECOGNIZED','UserManagerService','pluginName','/solved','ref','getMemberID','syncUpdateMutationToColla','/universer-api/comment/unit/','UniverCore','ThreadCommentModel','_injector','/add','512617BaRngh','resolveComment','COMMENT','object','Solve','2571552AshyCf','reply','find','_initUserSync','getUnit','Edit','get','amd','add','UniverThreadCommentUi','addComment','getOwnPropertyDescriptor','slice'];_0x7288=function(){return _0x10f4eb;};return _0x7288();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2-nightly.202508071209",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs
|
|
49
|
-
"@univerjs-pro/
|
|
50
|
-
"@univerjs/
|
|
51
|
-
"@univerjs/network": "0.10.
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment
|
|
54
|
-
"@univerjs/
|
|
48
|
+
"@univerjs/core": "0.10.2-nightly.202508071209",
|
|
49
|
+
"@univerjs-pro/collaboration-client": "0.10.2-nightly.202508071209",
|
|
50
|
+
"@univerjs/protocol": "0.1.47-alpha.0",
|
|
51
|
+
"@univerjs/network": "0.10.2-nightly.202508071209",
|
|
52
|
+
"@univerjs-pro/license": "0.10.2-nightly.202508071209",
|
|
53
|
+
"@univerjs/thread-comment": "0.10.2-nightly.202508071209",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.10.2-nightly.202508071209"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^7.0.6",
|
|
60
60
|
"vitest": "^3.2.4",
|
|
61
|
-
"@univerjs-infra/shared": "0.10.
|
|
61
|
+
"@univerjs-infra/shared": "0.10.2"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|