@univerjs-pro/thread-comment-datasource 0.9.4-nightly.202507290757 → 0.10.0
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/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x46ea9f=_0x52c6;(function(_0x3f87ae,_0x4889e0){const _0x57fd15=_0x52c6,_0x27c6d8=_0x3f87ae();while(!![]){try{const _0x21d126=parseInt(_0x57fd15(0x1ee))/0x1+-parseInt(_0x57fd15(0x1c3))/0x2*(-parseInt(_0x57fd15(0x19e))/0x3)+parseInt(_0x57fd15(0x1e0))/0x4*(parseInt(_0x57fd15(0x1a3))/0x5)+-parseInt(_0x57fd15(0x19d))/0x6*(parseInt(_0x57fd15(0x1ba))/0x7)+parseInt(_0x57fd15(0x1d7))/0x8+-parseInt(_0x57fd15(0x1b7))/0x9*(parseInt(_0x57fd15(0x1ec))/0xa)+-parseInt(_0x57fd15(0x1b3))/0xb;if(_0x21d126===_0x4889e0)break;else _0x27c6d8['push'](_0x27c6d8['shift']());}catch(_0x20f4f6){_0x27c6d8['push'](_0x27c6d8['shift']());}}}(_0x14f8,0x78396));Object[_0x46ea9f(0x1d0)](exports,Symbol['toStringTag'],{'value':_0x46ea9f(0x1ca)});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=_0x46ea9f(0x1af);var I=(_0x5eabe6=>(_0x5eabe6[_0x5eabe6[_0x46ea9f(0x1b1)]=0x0]=_0x46ea9f(0x1b1),_0x5eabe6[_0x5eabe6[_0x46ea9f(0x1f2)]=0x1]=_0x46ea9f(0x1f2),_0x5eabe6[_0x5eabe6['UNRECOGNIZED']=-0x1]=_0x46ea9f(0x1d2),_0x5eabe6))(I||{}),v=(_0x358b55=>(_0x358b55[_0x358b55['Unknown']=0x0]=_0x46ea9f(0x1bb),_0x358b55[_0x358b55[_0x46ea9f(0x1cc)]=0x1]=_0x46ea9f(0x1cc),_0x358b55[_0x358b55['Reply']=0x2]=_0x46ea9f(0x1f5),_0x358b55[_0x358b55[_0x46ea9f(0x1c6)]=0x3]=_0x46ea9f(0x1c6),_0x358b55[_0x358b55[_0x46ea9f(0x1db)]=0x4]='Delete',_0x358b55[_0x358b55[_0x46ea9f(0x1f8)]=0x5]=_0x46ea9f(0x1f8),_0x358b55[_0x358b55['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x358b55))(v||{});const f=_0x46d4e0=>c['dayjs'](new Date(+_0x46d4e0))['format']('YYYY/MM/DD\x20HH:mm'),R=async(_0x9c74c,_0x3b9fa9)=>{const _0xc88ff2=_0x46ea9f,_0x4980ce=_0x9c74c['get'](c['UserManagerService']),_0x5452cc=_0x9c74c[_0xc88ff2(0x1bd)](P[_0xc88ff2(0x195)]);_0x3b9fa9['forEach'](_0x364c44=>{const _0x2f9839=_0xc88ff2;_0x4980ce[_0x2f9839(0x1a5)](_0x364c44)&&_0x3b9fa9[_0x2f9839(0x1b0)](_0x364c44);}),_0x3b9fa9[_0xc88ff2(0x1eb)]&&(await _0x5452cc[_0xc88ff2(0x1bd)](_0xc88ff2(0x1c5),{'params':{'userIDs':[..._0x3b9fa9]}}))[_0xc88ff2(0x189)][_0xc88ff2(0x185)][_0xc88ff2(0x1f0)](_0x51b101=>{const _0x5e52bd=_0xc88ff2;_0x51b101&&_0x4980ce[_0x5e52bd(0x1aa)](_0x51b101);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x29e8d8,_0x21665f,_0x2d7b0c,_0x582420)=>{const _0x93c9c0=_0x46ea9f;for(var _0x5f3dc8=_0x582420>0x1?void 0x0:_0x582420?$(_0x21665f,_0x2d7b0c):_0x21665f,_0x120084=_0x29e8d8[_0x93c9c0(0x1e5)]-0x1,_0x2d96f8;_0x120084>=0x0;_0x120084--)(_0x2d96f8=_0x29e8d8[_0x120084])&&(_0x5f3dc8=_0x2d96f8(_0x5f3dc8)||_0x5f3dc8);return _0x5f3dc8;},S=(_0x571aab,_0x55a032)=>(_0x23327d,_0xd95672)=>_0x55a032(_0x23327d,_0xd95672,_0x571aab);function _0x52c6(_0x37df04,_0x17983d){const _0x14f834=_0x14f8();return _0x52c6=function(_0x52c6d0,_0x2ef85f){_0x52c6d0=_0x52c6d0-0x184;let _0x2a2d9f=_0x14f834[_0x52c6d0];return _0x2a2d9f;},_0x52c6(_0x37df04,_0x17983d);}let _=class extends c[_0x46ea9f(0x1ce)]{constructor(_0x1a7384,_0x548dea,_0x52d99d,_0x49935b){const _0x1534e9=_0x46ea9f;super(),this[_0x1534e9(0x188)]=_0x1a7384,this[_0x1534e9(0x1e1)]=_0x548dea,this[_0x1534e9(0x198)]=_0x52d99d,this[_0x1534e9(0x1b2)]=_0x49935b,this['_init'](),this[_0x1534e9(0x1ac)]();}['_initUserSync'](){const _0x4af199=_0x46ea9f;this[_0x4af199(0x1d9)](this[_0x4af199(0x1e1)][_0x4af199(0x18b)][_0x4af199(0x1e7)](j[_0x4af199(0x187)](0x10))[_0x4af199(0x1d5)](_0x39f82e=>{const _0x4a45e4=_0x4af199,_0x5129fd=new Set();_0x39f82e[_0x4a45e4(0x1f0)](_0x325c17=>{const _0x148609=_0x4a45e4;switch(_0x325c17[_0x148609(0x1cf)]){case _0x148609(0x1b4):{const _0x4f4e60=_0x325c17[_0x148609(0x1d4)][_0x148609(0x19b)];_0x5129fd['add'](_0x4f4e60);break;}}}),R(this[_0x4a45e4(0x1b2)],_0x5129fd);}));}[_0x46ea9f(0x1a9)](){const _0x5e6ec8=_0x46ea9f;this[_0x5e6ec8(0x1d9)](this[_0x5e6ec8(0x188)][_0x5e6ec8(0x18b)][_0x5e6ec8(0x1d5)](async _0x2ff537=>{const _0x24567d=_0x5e6ec8;var _0xb3e1b7,_0xa7c448,_0x17e164,_0x1410b8;const _0x5d600d=(_0xb3e1b7=this[_0x24567d(0x1e1)][_0x24567d(0x19f)](_0x2ff537['unitId'])[_0x24567d(0x1c0)](_0x4c3149=>_0x4c3149['threadId']===_0x2ff537[_0x24567d(0x1d1)]))==null?void 0x0:_0xb3e1b7['root'];if(!_0x5d600d)return;const {unitId:_0x35cf0,subUnitId:_0x42b804}=_0x5d600d;switch(_0x2ff537['user']&&this[_0x24567d(0x198)][_0x24567d(0x1aa)](_0x2ff537['user']),_0x2ff537['type']){case v[_0x24567d(0x1cc)]:break;case v[_0x24567d(0x1f5)]:{this[_0x24567d(0x1e1)][_0x24567d(0x1a0)](_0x35cf0,_0x42b804,{'unitId':_0x35cf0,'subUnitId':_0x42b804,'ref':'','id':_0x2ff537['replyId'],'dT':f(+_0x2ff537[_0x24567d(0x1c1)]),'threadId':_0x2ff537['threadId'],'personId':(_0x17e164=(_0xa7c448=_0x2ff537['user'])==null?void 0x0:_0xa7c448[_0x24567d(0x1a2)])!=null?_0x17e164:_0x2ff537[_0x24567d(0x1f4)],'text':JSON[_0x24567d(0x199)](_0x2ff537['content']),'parentId':_0x5d600d['id']});break;}case v['Delete']:{const _0x35245c=this[_0x24567d(0x1e1)]['getComment'](_0x35cf0,_0x42b804,_0x2ff537[_0x24567d(0x1ed)]);_0x35245c&&_0x35245c[_0x24567d(0x193)]&&this[_0x24567d(0x1e1)]['deleteComment'](_0x35cf0,_0x42b804,_0x2ff537['replyId']);break;}case v[_0x24567d(0x1c6)]:{this[_0x24567d(0x1e1)]['updateComment'](_0x35cf0,_0x42b804,{'commentId':_0x2ff537['replyId'],'text':JSON['parse'](_0x2ff537[_0x24567d(0x18a)])});break;}case v[_0x24567d(0x1f8)]:{const _0x3d193d=(_0x1410b8=this[_0x24567d(0x1e1)][_0x24567d(0x19f)](_0x2ff537[_0x24567d(0x1df)])[_0x24567d(0x1c0)](_0x1323f1=>_0x1323f1['threadId']===_0x2ff537[_0x24567d(0x1d1)]))==null?void 0x0:_0x1410b8[_0x24567d(0x1d3)];_0x3d193d&&this[_0x24567d(0x1e1)][_0x24567d(0x1a6)](_0x35cf0,_0x42b804,_0x3d193d['id'],_0x2ff537['solved']===I[_0x24567d(0x1f2)]);break;}}}));}};_=E([S(0x0,c['Inject'](b[_0x46ea9f(0x1b6)])),S(0x1,c[_0x46ea9f(0x192)](M[_0x46ea9f(0x1a4)])),S(0x2,c['Inject'](c[_0x46ea9f(0x1c4)])),S(0x3,c[_0x46ea9f(0x192)](c[_0x46ea9f(0x184)]))],_);const q=_0x46ea9f(0x1dc),D={};var A=Object[_0x46ea9f(0x1bc)],x=(_0x3d1b94,_0x4e0e81,_0x13ecbd,_0x27c93d)=>{const _0x1af105=_0x46ea9f;for(var _0x1664c0=_0x27c93d>0x1?void 0x0:_0x27c93d?A(_0x4e0e81,_0x13ecbd):_0x4e0e81,_0x3be72f=_0x3d1b94[_0x1af105(0x1e5)]-0x1,_0x5c67e4;_0x3be72f>=0x0;_0x3be72f--)(_0x5c67e4=_0x3d1b94[_0x3be72f])&&(_0x1664c0=_0x5c67e4(_0x1664c0)||_0x1664c0);return _0x1664c0;},C=(_0x2c6b04,_0x43dd2a)=>(_0x176b12,_0x2b0a83)=>_0x43dd2a(_0x176b12,_0x2b0a83,_0x2c6b04);function Y(_0x149563,_0x194167){const _0x1b7e46=_0x46ea9f,_0x4bf5aa=_0x149563['replies'][0x0];return{..._0x194167,'id':_0x4bf5aa['replyId'],'resolved':_0x149563[_0x1b7e46(0x1bf)]===0x1,'dT':f(_0x4bf5aa[_0x1b7e46(0x1c1)]),'personId':_0x4bf5aa[_0x1b7e46(0x1f4)],'threadId':_0x4bf5aa['threadId']};}function G(_0x837d8b,_0x4e394f,_0x3eadcc){const _0x18a17c=_0x46ea9f;var _0x5979a0,_0x583e68;if(((_0x583e68=(_0x5979a0=_0x837d8b==null?void 0x0:_0x837d8b[_0x18a17c(0x1e2)])==null?void 0x0:_0x5979a0[_0x18a17c(0x1e5)])!=null?_0x583e68:0x0)>0x0){const _0x1c46ab=(_0xcf3c47,_0x2a86e8)=>({'id':_0xcf3c47[_0x18a17c(0x1ed)],'threadId':_0xcf3c47[_0x18a17c(0x1d1)],'dT':f(_0xcf3c47[_0x18a17c(0x1c1)]),'personId':_0xcf3c47[_0x18a17c(0x1f4)],'resolved':_0x837d8b[_0x18a17c(0x1bf)]===I[_0x18a17c(0x1f2)],'unitId':_0x4e394f,'subUnitId':_0x3eadcc,'text':JSON[_0x18a17c(0x199)](_0xcf3c47['content']),'parentId':_0x2a86e8}),_0x3f8302=_0x1c46ab(_0x837d8b['replies'][0x0]);return{..._0x3f8302,'children':_0x837d8b[_0x18a17c(0x1e2)]['slice'](0x1)[_0x18a17c(0x1f6)](_0x34caf1=>_0x1c46ab(_0x34caf1,_0x3f8302['id']))};}return null;}function _0x14f8(){const _0x5e9249=['length','YYYY/MM/DD\x20HH:mm','pipe','filter','UniverThreadCommentDataSourcePlugin','saveCommentToSnapshot','size','58980yBpZnl','replyId','541011MqpnJZ','format','forEach','onStarting','Solved','_config','userId','Reply','map','/list','Solve','customRanges','UniverInstanceType','Injector','users','_sessionService','bufferTime','_commentService','body','content','commentUpdate$','_threadCommentDataSourceService','_threadCommentDataSource','pluginName','post','getCurrentUser','/add','Inject','parentId','getMemberID','HTTPService','error','_initDataSource','_userService','parse','_httpService','personId','stringify','15834nmNDIl','3WWvbaw','getUnit','addComment','UniverLicensePlugin','userID','5OTPCkm','ThreadCommentModel','getUser','resolveComment','_configService','dataSource','_init','addUser','/universer-api/comment/unit/','_initUserSync','requireSession','setConfig','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','delete','OpenOrReOpen','_injector','6149209GxLtGT','add','code','CommentService','333HgGULN','UniverThreadCommentUIPlugin','symbol','2135jHutRc','Unknown','getOwnPropertyDescriptor','get','onReady','solved','find','createTimestamp','UniverCollaborationClientPlugin','1087342qSiWfK','UserManagerService','/universer-api/user/list','Edit','dayjs','CustomRangeType','comments','Module','comment','Add','merge','Disposable','type','defineProperty','threadId','UNRECOGNIZED','root','payload','subscribe','/solved','4779160QGJEYG','values','disposeWithMe','rangeId','Delete','thread-comment-data-source.config','updateComment','COMMENT','unitId','1570004ipUpYY','_threadCommentModel','replies','rangeType','Plugin'];_0x14f8=function(){return _0x5e9249;};return _0x14f8();}let p=class{constructor(_0x4fd72f,_0x28463e,_0x452359){const _0x376717=_0x46ea9f;this[_0x376717(0x19a)]=_0x4fd72f,this['_userService']=_0x28463e,this[_0x376717(0x186)]=_0x452359;}async['addComment'](_0x36041f){const _0x33944e=_0x46ea9f;var _0x2037c6,_0x21ca2e;const {parentId:_0x29b7c3,unitId:_0x3d6210,text:_0x591fe6,threadId:_0x4816b2}=_0x36041f,_0x34ade7=(_0x21ca2e=(_0x2037c6=_0x591fe6['customRanges'])==null?void 0x0:_0x2037c6['filter'](_0x2bd5e8=>_0x2bd5e8[_0x33944e(0x1e3)]===c[_0x33944e(0x1c8)]['COMMENT'])[_0x33944e(0x1f6)](_0x1743db=>_0x1743db[_0x33944e(0x1da)]))!=null?_0x21ca2e:[],_0x48727b=JSON['stringify'](_0x591fe6),_0x2c8b57=(await this[_0x33944e(0x186)][_0x33944e(0x1ad)](_0x3d6210))[_0x33944e(0x194)]();if(_0x29b7c3){const _0x25f177={'memberId':_0x2c8b57,'unitId':_0x3d6210,'content':_0x48727b,'mention':_0x34ade7,'threadId':_0x4816b2},_0x231572=(await this[_0x33944e(0x19a)]['post']('/universer-api/comment/unit/'+_0x3d6210+'/reply',{'body':_0x25f177}))[_0x33944e(0x189)]['reply'];return{..._0x36041f,'id':_0x231572['replyId'],'dT':c[_0x33944e(0x1c7)](+_0x231572['createTimestamp'])[_0x33944e(0x1ef)](_0x33944e(0x1e6)),'personId':_0x231572[_0x33944e(0x1f4)]};}else{const _0x908660={'memberId':_0x2c8b57,'unitId':_0x3d6210,'content':_0x48727b,'mention':_0x34ade7},_0x58b3c3=await this[_0x33944e(0x19a)][_0x33944e(0x18f)](_0x33944e(0x1ab)+_0x3d6210+_0x33944e(0x191),{'body':_0x908660});return Y(_0x58b3c3[_0x33944e(0x189)][_0x33944e(0x1cb)],_0x36041f);}}async[_0x46ea9f(0x1dd)](_0x2317c1){const _0x4c5eb7=_0x46ea9f;var _0x590a8b,_0x52622b;const {text:_0x2c90b7,unitId:_0x57e752}=_0x2317c1,_0x3b4419=(_0x52622b=(_0x590a8b=_0x2c90b7[_0x4c5eb7(0x1f9)])==null?void 0x0:_0x590a8b[_0x4c5eb7(0x1e8)](_0x4ed0c2=>_0x4ed0c2['rangeType']===c[_0x4c5eb7(0x1c8)][_0x4c5eb7(0x1de)])[_0x4c5eb7(0x1f6)](_0x348c56=>_0x348c56[_0x4c5eb7(0x1da)]))!=null?_0x52622b:[],_0x569795=JSON[_0x4c5eb7(0x19c)](_0x2c90b7),_0xb3cbb5=_0x2317c1[_0x4c5eb7(0x1d1)],_0x41724f=_0x2317c1['id'],_0x436fcf={'memberId':(await this[_0x4c5eb7(0x186)]['requireSession'](_0x57e752))[_0x4c5eb7(0x194)](),'unitId':_0x57e752,'threadId':_0xb3cbb5,'mention':_0x3b4419,'content':_0x569795,'replyId':_0x41724f},_0x5e43a7=await this[_0x4c5eb7(0x19a)][_0x4c5eb7(0x18f)]('/universer-api/comment/unit/'+_0x57e752+'/edit',{'body':_0x436fcf});return!_0x5e43a7['body']['error']||_0x5e43a7[_0x4c5eb7(0x189)][_0x4c5eb7(0x196)][_0x4c5eb7(0x1b5)]===0x1;}async['resolveComment'](_0x3f5350){const _0x15172f=_0x46ea9f,{unitId:_0x2b3ba3}=_0x3f5350,_0x3d7d1e=_0x3f5350[_0x15172f(0x1d1)],_0x21057a={'memberId':this[_0x15172f(0x198)][_0x15172f(0x190)]()[_0x15172f(0x1a2)],'unitId':_0x2b3ba3,'threadId':_0x3d7d1e,'solved':_0x3f5350['resolved']?I[_0x15172f(0x1f2)]:I['OpenOrReOpen']},_0x5e7ec5=await this['_httpService']['post'](_0x15172f(0x1ab)+_0x2b3ba3+_0x15172f(0x1d6),{'body':_0x21057a});return!_0x5e7ec5[_0x15172f(0x189)][_0x15172f(0x196)]||_0x5e7ec5[_0x15172f(0x189)]['error']['code']===0x1;}async['deleteComment'](_0x594d61,_0x38e5c3,_0x34dbe5,_0x4fcadc){const _0x524e6a=_0x46ea9f,_0x52a4a1={'memberId':(await this['_sessionService']['requireSession'](_0x594d61))['getMemberID'](),'threadId':_0x34dbe5,'replyId':_0x4fcadc,'unitId':_0x594d61},_0x2b752a=await this[_0x524e6a(0x19a)][_0x524e6a(0x18f)](_0x524e6a(0x1ab)+_0x594d61+'/delete',{'body':_0x52a4a1});return!_0x2b752a['body'][_0x524e6a(0x196)]||_0x2b752a[_0x524e6a(0x189)]['error']['code']===0x1;}async['listComments'](_0x1ec326,_0x4c8df0,_0x2f4dd3){const _0x569201=_0x46ea9f,_0x403c3c={'unitId':_0x1ec326,'threadId':_0x2f4dd3},_0x264067=await this[_0x569201(0x19a)][_0x569201(0x18f)]('/universer-api/comment/unit/'+_0x1ec326+_0x569201(0x1f7),{'body':_0x403c3c}),_0x2745be=_0x2f4dd3[_0x569201(0x1f6)](_0x283461=>G(_0x264067[_0x569201(0x189)][_0x569201(0x1c9)][_0x283461],_0x1ec326,_0x4c8df0))[_0x569201(0x1e8)](Boolean);return Object[_0x569201(0x1d8)](_0x264067[_0x569201(0x189)]['users'])['forEach'](_0x18e2e4=>{const _0x48b0cd=_0x569201;this[_0x48b0cd(0x198)][_0x48b0cd(0x1aa)](_0x18e2e4);}),_0x2745be;}[_0x46ea9f(0x1ea)](_0x40cd8e){const _0x3c223f=_0x46ea9f;return{'id':_0x40cd8e['id'],'threadId':_0x40cd8e[_0x3c223f(0x1d1)],'ref':_0x40cd8e['ref']};}};p=x([C(0x0,c['Inject'](P[_0x46ea9f(0x195)])),C(0x1,c['Inject'](c[_0x46ea9f(0x1c4)])),C(0x2,c['Inject'](b['CollaborationSessionService']))],p);var H=Object[_0x46ea9f(0x1bc)],J=(_0x25d567,_0x1a11ff,_0x16d2f9,_0x1f877a)=>{const _0x367753=_0x46ea9f;for(var _0x5198ec=_0x1f877a>0x1?void 0x0:_0x1f877a?H(_0x1a11ff,_0x16d2f9):_0x1a11ff,_0x3359dd=_0x25d567[_0x367753(0x1e5)]-0x1,_0x245c79;_0x3359dd>=0x0;_0x3359dd--)(_0x245c79=_0x25d567[_0x3359dd])&&(_0x5198ec=_0x245c79(_0x5198ec)||_0x5198ec);return _0x5198ec;},y=(_0x8b87f6,_0x3d108d)=>(_0x112a7f,_0x1b1849)=>_0x3d108d(_0x112a7f,_0x1b1849,_0x8b87f6);let g=class extends c[_0x46ea9f(0x1ce)]{constructor(_0x1d69fd,_0x26c073){const _0x533c26=_0x46ea9f;super(),this[_0x533c26(0x18c)]=_0x1d69fd,this[_0x533c26(0x18d)]=_0x26c073,this[_0x533c26(0x197)]();}[_0x46ea9f(0x197)](){const _0x538122=_0x46ea9f;this['_threadCommentDataSourceService'][_0x538122(0x1a8)]=this['_threadCommentDataSource'],this[_0x538122(0x18c)]['syncUpdateMutationToColla']=!0x1;}};g=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c[_0x46ea9f(0x192)](p))],g);var F=Object['defineProperty'],L=Object['getOwnPropertyDescriptor'],Z=(_0x102305,_0x28cc25,_0x5e0209)=>_0x28cc25 in _0x102305?F(_0x102305,_0x28cc25,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5e0209}):_0x102305[_0x28cc25]=_0x5e0209,W=(_0x70e7f7,_0x45f96d,_0x3765ed,_0x4991c1)=>{for(var _0x1bde35=_0x4991c1>0x1?void 0x0:_0x4991c1?L(_0x45f96d,_0x3765ed):_0x45f96d,_0x82f9cb=_0x70e7f7['length']-0x1,_0x2ef1eb;_0x82f9cb>=0x0;_0x82f9cb--)(_0x2ef1eb=_0x70e7f7[_0x82f9cb])&&(_0x1bde35=_0x2ef1eb(_0x1bde35)||_0x1bde35);return _0x1bde35;},O=(_0xe86a82,_0x241ba7)=>(_0x21dc17,_0xa91f42)=>_0x241ba7(_0x21dc17,_0xa91f42,_0xe86a82),N=(_0x3f4983,_0x358a5e,_0x319a39)=>Z(_0x3f4983,typeof _0x358a5e!=_0x46ea9f(0x1b9)?_0x358a5e+'':_0x358a5e,_0x319a39);exports[_0x46ea9f(0x1e9)]=class extends c[_0x46ea9f(0x1e4)]{constructor(_0x38bcfc=D,_0x592bd7,_0x566e31){const _0x32288a=_0x46ea9f;super(),this[_0x32288a(0x1f3)]=_0x38bcfc,this[_0x32288a(0x1b2)]=_0x592bd7,this[_0x32288a(0x1a7)]=_0x566e31;const {..._0x1d04a9}=c[_0x32288a(0x1cd)]({},D,this['_config']);this[_0x32288a(0x1a7)][_0x32288a(0x1ae)](q,_0x1d04a9);}[_0x46ea9f(0x1f1)](){[[p],[g],[_]]['forEach'](_0x242fbb=>{const _0x435dfc=_0x52c6;this['_injector'][_0x435dfc(0x1b4)](_0x242fbb);});}[_0x46ea9f(0x1be)](){const _0x534ced=_0x46ea9f;this[_0x534ced(0x1b2)]['get'](g),this[_0x534ced(0x1b2)]['get'](_);}},N(exports[_0x46ea9f(0x1e9)],_0x46ea9f(0x18e),U),N(exports[_0x46ea9f(0x1e9)],_0x46ea9f(0x1cf),c[_0x46ea9f(0x1fa)]['UNIVER_UNKNOWN']),exports[_0x46ea9f(0x1e9)]=W([c['DependentOn'](w[_0x46ea9f(0x1b8)],b[_0x46ea9f(0x1c2)],T[_0x46ea9f(0x1a1)]),O(0x1,c[_0x46ea9f(0x192)](c[_0x46ea9f(0x184)])),O(0x2,c['IConfigService'])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0x44fd51=_0x3844;(function(_0x4bfa38,_0x5834bd){const _0x597fea=_0x3844,_0xe4744c=_0x4bfa38();while(!![]){try{const _0x4587d4=parseInt(_0x597fea(0x10f))/0x1*(parseInt(_0x597fea(0x16c))/0x2)+-parseInt(_0x597fea(0x140))/0x3*(-parseInt(_0x597fea(0x135))/0x4)+parseInt(_0x597fea(0x160))/0x5+-parseInt(_0x597fea(0x139))/0x6*(parseInt(_0x597fea(0x159))/0x7)+-parseInt(_0x597fea(0x112))/0x8+parseInt(_0x597fea(0x100))/0x9*(-parseInt(_0x597fea(0x14e))/0xa)+parseInt(_0x597fea(0x137))/0xb;if(_0x4587d4===_0x5834bd)break;else _0xe4744c['push'](_0xe4744c['shift']());}catch(_0x17e7c1){_0xe4744c['push'](_0xe4744c['shift']());}}}(_0x5cc8,0x3b251));Object[_0x44fd51(0x15f)](exports,Symbol[_0x44fd51(0x11c)],{'value':'Module'});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=_0x44fd51(0xf7);function _0x3844(_0x384446,_0x8a56f){const _0x5cc8f3=_0x5cc8();return _0x3844=function(_0x38449a,_0x33f0d0){_0x38449a=_0x38449a-0xf5;let _0x38376e=_0x5cc8f3[_0x38449a];return _0x38376e;},_0x3844(_0x384446,_0x8a56f);}function _0x5cc8(){const _0x38a626=['type','size','merge','_threadCommentDataSource','Solve','subscribe','user','UniverInstanceType','Solved','_threadCommentModel','length','40hHdxPf','thread-comment-data-source.config','saveCommentToSnapshot','listComments','onReady','content','delete','map','_threadCommentDataSourceService','filter','threadId','63PPxvzG','payload','_configService','parentId','_init','CustomRangeType','defineProperty','1036615GRAVRT','solved','Injector','Add','comment','_config','Delete','YYYY/MM/DD\x20HH:mm','Edit','onStarting','add','stringify','2XixLxI','resolveComment','post','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','createTimestamp','_commentService','users','UniverThreadCommentUIPlugin','addComment','resolved','pluginName','UNRECOGNIZED','695790sMWlyO','CommentService','addUser','Reply','userID','find','UNIVER_UNKNOWN','error','comments','deleteComment','_httpService','code','dayjs','rangeId','symbol','230273SQPZaF','customRanges','requireSession','3365760ndTVCD','/add','UniverThreadCommentDataSourcePlugin','/delete','getComment','replyId','root','userId','HTTPService','rangeType','toStringTag','syncUpdateMutationToColla','Inject','parse','getMemberID','_sessionService','UserManagerService','_initUserSync','disposeWithMe','/universer-api/user/list','format','pipe','values','body','getUnit','updateComment','IConfigService','forEach','/universer-api/comment/unit/','/list','slice','bufferTime','commentUpdate$','/reply','IThreadCommentDataSourceService','88IFuAsc','replies','6313879WjSZXw','_userService','280404RiCLtx','_injector','getOwnPropertyDescriptor','OpenOrReOpen','get','unitId','Unknown','51987GzMTLb','_initDataSource','personId'];_0x5cc8=function(){return _0x38a626;};return _0x5cc8();}var I=(_0x208777=>(_0x208777[_0x208777['OpenOrReOpen']=0x0]=_0x44fd51(0x13c),_0x208777[_0x208777['Solved']=0x1]='Solved',_0x208777[_0x208777[_0x44fd51(0xff)]=-0x1]='UNRECOGNIZED',_0x208777))(I||{}),v=(_0x322731=>(_0x322731[_0x322731[_0x44fd51(0x13f)]=0x0]=_0x44fd51(0x13f),_0x322731[_0x322731['Add']=0x1]=_0x44fd51(0x163),_0x322731[_0x322731[_0x44fd51(0x103)]=0x2]=_0x44fd51(0x103),_0x322731[_0x322731[_0x44fd51(0x168)]=0x3]=_0x44fd51(0x168),_0x322731[_0x322731['Delete']=0x4]=_0x44fd51(0x166),_0x322731[_0x322731[_0x44fd51(0x147)]=0x5]=_0x44fd51(0x147),_0x322731[_0x322731[_0x44fd51(0xff)]=-0x1]=_0x44fd51(0xff),_0x322731))(v||{});const f=_0x3a6fb5=>c[_0x44fd51(0x10c)](new Date(+_0x3a6fb5))[_0x44fd51(0x126)](_0x44fd51(0x167)),R=async(_0x2ba362,_0x2c5c6e)=>{const _0x303ace=_0x44fd51,_0x211540=_0x2ba362[_0x303ace(0x13d)](c[_0x303ace(0x122)]),_0x1e1890=_0x2ba362['get'](P['HTTPService']);_0x2c5c6e[_0x303ace(0x12d)](_0x4d48cc=>{const _0x10caa4=_0x303ace;_0x211540['getUser'](_0x4d48cc)&&_0x2c5c6e[_0x10caa4(0x154)](_0x4d48cc);}),_0x2c5c6e[_0x303ace(0x144)]&&(await _0x1e1890['get'](_0x303ace(0x125),{'params':{'userIDs':[..._0x2c5c6e]}}))[_0x303ace(0x129)]['users'][_0x303ace(0x12d)](_0x36c2f4=>{_0x36c2f4&&_0x211540['addUser'](_0x36c2f4);});};var $=Object[_0x44fd51(0x13b)],E=(_0x2c76e8,_0x1e439d,_0x18c783,_0x58cbf7)=>{for(var _0x4b6800=_0x58cbf7>0x1?void 0x0:_0x58cbf7?$(_0x1e439d,_0x18c783):_0x1e439d,_0x6260bb=_0x2c76e8['length']-0x1,_0x41ef3f;_0x6260bb>=0x0;_0x6260bb--)(_0x41ef3f=_0x2c76e8[_0x6260bb])&&(_0x4b6800=_0x41ef3f(_0x4b6800)||_0x4b6800);return _0x4b6800;},S=(_0x33ff2f,_0x376d44)=>(_0x4c5490,_0x5eca7b)=>_0x376d44(_0x4c5490,_0x5eca7b,_0x33ff2f);let _=class extends c['Disposable']{constructor(_0x2d2016,_0x30a552,_0x58c5d2,_0x679766){const _0x37728c=_0x44fd51;super(),this[_0x37728c(0xf9)]=_0x2d2016,this[_0x37728c(0x14c)]=_0x30a552,this[_0x37728c(0x138)]=_0x58c5d2,this[_0x37728c(0x13a)]=_0x679766,this['_init'](),this['_initUserSync']();}[_0x44fd51(0x123)](){const _0x48fa4f=_0x44fd51;this[_0x48fa4f(0x124)](this[_0x48fa4f(0x14c)]['commentUpdate$'][_0x48fa4f(0x127)](j[_0x48fa4f(0x131)](0x10))[_0x48fa4f(0x148)](_0x4a88f9=>{const _0x244a81=_0x48fa4f,_0x49c320=new Set();_0x4a88f9[_0x244a81(0x12d)](_0x586e3e=>{const _0x2e7f6c=_0x244a81;switch(_0x586e3e['type']){case _0x2e7f6c(0x16a):{const _0x2b138e=_0x586e3e[_0x2e7f6c(0x15a)][_0x2e7f6c(0x142)];_0x49c320[_0x2e7f6c(0x16a)](_0x2b138e);break;}}}),R(this[_0x244a81(0x13a)],_0x49c320);}));}[_0x44fd51(0x15d)](){const _0x5d2ea1=_0x44fd51;this['disposeWithMe'](this[_0x5d2ea1(0xf9)][_0x5d2ea1(0x132)]['subscribe'](async _0x5635b4=>{const _0x2d644d=_0x5d2ea1;var _0x193a4b,_0x2d5ef8,_0x39ad4f,_0x3d27be;const _0x1d1e1a=(_0x193a4b=this[_0x2d644d(0x14c)]['getUnit'](_0x5635b4['unitId'])['find'](_0x1b8e01=>_0x1b8e01[_0x2d644d(0x158)]===_0x5635b4['threadId']))==null?void 0x0:_0x193a4b['root'];if(!_0x1d1e1a)return;const {unitId:_0x3cb841,subUnitId:_0x842c23}=_0x1d1e1a;switch(_0x5635b4[_0x2d644d(0x149)]&&this['_userService'][_0x2d644d(0x102)](_0x5635b4[_0x2d644d(0x149)]),_0x5635b4[_0x2d644d(0x143)]){case v['Add']:break;case v['Reply']:{this['_threadCommentModel'][_0x2d644d(0xfc)](_0x3cb841,_0x842c23,{'unitId':_0x3cb841,'subUnitId':_0x842c23,'ref':'','id':_0x5635b4['replyId'],'dT':f(+_0x5635b4[_0x2d644d(0xf8)]),'threadId':_0x5635b4['threadId'],'personId':(_0x39ad4f=(_0x2d5ef8=_0x5635b4['user'])==null?void 0x0:_0x2d5ef8['userID'])!=null?_0x39ad4f:_0x5635b4['userId'],'text':JSON['parse'](_0x5635b4[_0x2d644d(0x153)]),'parentId':_0x1d1e1a['id']});break;}case v['Delete']:{const _0x64be2d=this['_threadCommentModel'][_0x2d644d(0x116)](_0x3cb841,_0x842c23,_0x5635b4[_0x2d644d(0x117)]);_0x64be2d&&_0x64be2d[_0x2d644d(0x15c)]&&this[_0x2d644d(0x14c)][_0x2d644d(0x109)](_0x3cb841,_0x842c23,_0x5635b4[_0x2d644d(0x117)]);break;}case v['Edit']:{this['_threadCommentModel'][_0x2d644d(0x12b)](_0x3cb841,_0x842c23,{'commentId':_0x5635b4[_0x2d644d(0x117)],'text':JSON[_0x2d644d(0x11f)](_0x5635b4['content'])});break;}case v[_0x2d644d(0x147)]:{const _0x463568=(_0x3d27be=this['_threadCommentModel'][_0x2d644d(0x12a)](_0x5635b4[_0x2d644d(0x13e)])[_0x2d644d(0x105)](_0x2623c2=>_0x2623c2['threadId']===_0x5635b4[_0x2d644d(0x158)]))==null?void 0x0:_0x3d27be[_0x2d644d(0x118)];_0x463568&&this[_0x2d644d(0x14c)][_0x2d644d(0xf5)](_0x3cb841,_0x842c23,_0x463568['id'],_0x5635b4[_0x2d644d(0x161)]===I[_0x2d644d(0x14b)]);break;}}}));}};_=E([S(0x0,c['Inject'](b[_0x44fd51(0x101)])),S(0x1,c[_0x44fd51(0x11e)](M['ThreadCommentModel'])),S(0x2,c[_0x44fd51(0x11e)](c[_0x44fd51(0x122)])),S(0x3,c[_0x44fd51(0x11e)](c[_0x44fd51(0x162)]))],_);const q=_0x44fd51(0x14f),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x47e790,_0x2edf2d,_0x5bd3f6,_0x15ac12)=>{for(var _0x137419=_0x15ac12>0x1?void 0x0:_0x15ac12?A(_0x2edf2d,_0x5bd3f6):_0x2edf2d,_0x26a2c0=_0x47e790['length']-0x1,_0x51ecc2;_0x26a2c0>=0x0;_0x26a2c0--)(_0x51ecc2=_0x47e790[_0x26a2c0])&&(_0x137419=_0x51ecc2(_0x137419)||_0x137419);return _0x137419;},C=(_0x1195a6,_0x20d0d5)=>(_0x21845e,_0x5f1053)=>_0x20d0d5(_0x21845e,_0x5f1053,_0x1195a6);function Y(_0x484784,_0x56bcb8){const _0x462f21=_0x44fd51,_0x3a13f7=_0x484784[_0x462f21(0x136)][0x0];return{..._0x56bcb8,'id':_0x3a13f7[_0x462f21(0x117)],'resolved':_0x484784[_0x462f21(0x161)]===0x1,'dT':f(_0x3a13f7[_0x462f21(0xf8)]),'personId':_0x3a13f7[_0x462f21(0x119)],'threadId':_0x3a13f7[_0x462f21(0x158)]};}function G(_0x5db0f2,_0x363f87,_0x4fdd49){const _0xf08581=_0x44fd51;var _0x8dea75,_0x4ac46f;if(((_0x4ac46f=(_0x8dea75=_0x5db0f2==null?void 0x0:_0x5db0f2[_0xf08581(0x136)])==null?void 0x0:_0x8dea75['length'])!=null?_0x4ac46f:0x0)>0x0){const _0x415deb=(_0x326a6b,_0x2e0992)=>({'id':_0x326a6b[_0xf08581(0x117)],'threadId':_0x326a6b[_0xf08581(0x158)],'dT':f(_0x326a6b[_0xf08581(0xf8)]),'personId':_0x326a6b[_0xf08581(0x119)],'resolved':_0x5db0f2[_0xf08581(0x161)]===I[_0xf08581(0x14b)],'unitId':_0x363f87,'subUnitId':_0x4fdd49,'text':JSON[_0xf08581(0x11f)](_0x326a6b[_0xf08581(0x153)]),'parentId':_0x2e0992}),_0xc80241=_0x415deb(_0x5db0f2[_0xf08581(0x136)][0x0]);return{..._0xc80241,'children':_0x5db0f2[_0xf08581(0x136)][_0xf08581(0x130)](0x1)[_0xf08581(0x155)](_0x358942=>_0x415deb(_0x358942,_0xc80241['id']))};}return null;}let p=class{constructor(_0x175ed3,_0x3c9a7c,_0x983409){const _0x158f44=_0x44fd51;this[_0x158f44(0x10a)]=_0x175ed3,this[_0x158f44(0x138)]=_0x3c9a7c,this['_sessionService']=_0x983409;}async[_0x44fd51(0xfc)](_0x39049f){const _0x5006db=_0x44fd51;var _0x52f87b,_0xd8d841;const {parentId:_0x1879c9,unitId:_0x3851aa,text:_0x503c70,threadId:_0x41b741}=_0x39049f,_0x27a1e1=(_0xd8d841=(_0x52f87b=_0x503c70[_0x5006db(0x110)])==null?void 0x0:_0x52f87b['filter'](_0x387ef1=>_0x387ef1['rangeType']===c[_0x5006db(0x15e)]['COMMENT'])[_0x5006db(0x155)](_0x49ea40=>_0x49ea40[_0x5006db(0x10d)]))!=null?_0xd8d841:[],_0x1ba041=JSON['stringify'](_0x503c70),_0x79f599=(await this['_sessionService'][_0x5006db(0x111)](_0x3851aa))[_0x5006db(0x120)]();if(_0x1879c9){const _0x4c2093={'memberId':_0x79f599,'unitId':_0x3851aa,'content':_0x1ba041,'mention':_0x27a1e1,'threadId':_0x41b741},_0x104506=(await this[_0x5006db(0x10a)][_0x5006db(0xf6)](_0x5006db(0x12e)+_0x3851aa+_0x5006db(0x133),{'body':_0x4c2093}))[_0x5006db(0x129)]['reply'];return{..._0x39049f,'id':_0x104506[_0x5006db(0x117)],'dT':c[_0x5006db(0x10c)](+_0x104506[_0x5006db(0xf8)])[_0x5006db(0x126)](_0x5006db(0x167)),'personId':_0x104506['userId']};}else{const _0x3cbd1f={'memberId':_0x79f599,'unitId':_0x3851aa,'content':_0x1ba041,'mention':_0x27a1e1},_0x6c9111=await this[_0x5006db(0x10a)][_0x5006db(0xf6)](_0x5006db(0x12e)+_0x3851aa+_0x5006db(0x113),{'body':_0x3cbd1f});return Y(_0x6c9111[_0x5006db(0x129)][_0x5006db(0x164)],_0x39049f);}}async['updateComment'](_0x486c46){const _0x155b1c=_0x44fd51;var _0x397fd8,_0xbc2cea;const {text:_0x1e7092,unitId:_0x17c97b}=_0x486c46,_0x5c88c4=(_0xbc2cea=(_0x397fd8=_0x1e7092[_0x155b1c(0x110)])==null?void 0x0:_0x397fd8['filter'](_0x1782dc=>_0x1782dc[_0x155b1c(0x11b)]===c[_0x155b1c(0x15e)]['COMMENT'])['map'](_0x11d0b1=>_0x11d0b1['rangeId']))!=null?_0xbc2cea:[],_0x32f061=JSON[_0x155b1c(0x16b)](_0x1e7092),_0x138575=_0x486c46['threadId'],_0xa39524=_0x486c46['id'],_0x4dfe3c={'memberId':(await this[_0x155b1c(0x121)][_0x155b1c(0x111)](_0x17c97b))[_0x155b1c(0x120)](),'unitId':_0x17c97b,'threadId':_0x138575,'mention':_0x5c88c4,'content':_0x32f061,'replyId':_0xa39524},_0xdaaccd=await this[_0x155b1c(0x10a)]['post']('/universer-api/comment/unit/'+_0x17c97b+'/edit',{'body':_0x4dfe3c});return!_0xdaaccd[_0x155b1c(0x129)][_0x155b1c(0x107)]||_0xdaaccd[_0x155b1c(0x129)]['error'][_0x155b1c(0x10b)]===0x1;}async[_0x44fd51(0xf5)](_0x417a8d){const _0x37da45=_0x44fd51,{unitId:_0x1de615}=_0x417a8d,_0x324849=_0x417a8d['threadId'],_0x1ef0d6={'memberId':this[_0x37da45(0x138)]['getCurrentUser']()[_0x37da45(0x104)],'unitId':_0x1de615,'threadId':_0x324849,'solved':_0x417a8d[_0x37da45(0xfd)]?I[_0x37da45(0x14b)]:I[_0x37da45(0x13c)]},_0x1941da=await this[_0x37da45(0x10a)][_0x37da45(0xf6)](_0x37da45(0x12e)+_0x1de615+'/solved',{'body':_0x1ef0d6});return!_0x1941da[_0x37da45(0x129)][_0x37da45(0x107)]||_0x1941da[_0x37da45(0x129)][_0x37da45(0x107)][_0x37da45(0x10b)]===0x1;}async[_0x44fd51(0x109)](_0x5eaad4,_0x18f97b,_0x335327,_0x498435){const _0x14e1ea=_0x44fd51,_0x536acc={'memberId':(await this[_0x14e1ea(0x121)][_0x14e1ea(0x111)](_0x5eaad4))[_0x14e1ea(0x120)](),'threadId':_0x335327,'replyId':_0x498435,'unitId':_0x5eaad4},_0x52cf6d=await this['_httpService'][_0x14e1ea(0xf6)](_0x14e1ea(0x12e)+_0x5eaad4+_0x14e1ea(0x115),{'body':_0x536acc});return!_0x52cf6d['body']['error']||_0x52cf6d[_0x14e1ea(0x129)][_0x14e1ea(0x107)][_0x14e1ea(0x10b)]===0x1;}async[_0x44fd51(0x151)](_0xb23bb7,_0x507b49,_0x1ee5bb){const _0x261b43=_0x44fd51,_0x1495e6={'unitId':_0xb23bb7,'threadId':_0x1ee5bb},_0x2b1290=await this[_0x261b43(0x10a)][_0x261b43(0xf6)](_0x261b43(0x12e)+_0xb23bb7+_0x261b43(0x12f),{'body':_0x1495e6}),_0x1c20b8=_0x1ee5bb[_0x261b43(0x155)](_0x3ce63c=>G(_0x2b1290[_0x261b43(0x129)][_0x261b43(0x108)][_0x3ce63c],_0xb23bb7,_0x507b49))[_0x261b43(0x157)](Boolean);return Object[_0x261b43(0x128)](_0x2b1290['body'][_0x261b43(0xfa)])['forEach'](_0x51fd00=>{const _0x198db8=_0x261b43;this[_0x198db8(0x138)]['addUser'](_0x51fd00);}),_0x1c20b8;}[_0x44fd51(0x150)](_0x2b4b29){return{'id':_0x2b4b29['id'],'threadId':_0x2b4b29['threadId'],'ref':_0x2b4b29['ref']};}};p=x([C(0x0,c[_0x44fd51(0x11e)](P[_0x44fd51(0x11a)])),C(0x1,c['Inject'](c[_0x44fd51(0x122)])),C(0x2,c['Inject'](b['CollaborationSessionService']))],p);var H=Object[_0x44fd51(0x13b)],J=(_0x379db1,_0x4610f6,_0x4a2f9d,_0x5bdcd1)=>{const _0x2f5cb7=_0x44fd51;for(var _0x56e50d=_0x5bdcd1>0x1?void 0x0:_0x5bdcd1?H(_0x4610f6,_0x4a2f9d):_0x4610f6,_0x30b9cb=_0x379db1[_0x2f5cb7(0x14d)]-0x1,_0x272a7f;_0x30b9cb>=0x0;_0x30b9cb--)(_0x272a7f=_0x379db1[_0x30b9cb])&&(_0x56e50d=_0x272a7f(_0x56e50d)||_0x56e50d);return _0x56e50d;},y=(_0x3e2d13,_0x35fa32)=>(_0x54706d,_0x5536d8)=>_0x35fa32(_0x54706d,_0x5536d8,_0x3e2d13);let g=class extends c['Disposable']{constructor(_0x230be9,_0x21c6e1){const _0x4b41f3=_0x44fd51;super(),this[_0x4b41f3(0x156)]=_0x230be9,this[_0x4b41f3(0x146)]=_0x21c6e1,this[_0x4b41f3(0x141)]();}[_0x44fd51(0x141)](){const _0x166dea=_0x44fd51;this['_threadCommentDataSourceService']['dataSource']=this['_threadCommentDataSource'],this[_0x166dea(0x156)][_0x166dea(0x11d)]=!0x1;}};g=J([y(0x0,M[_0x44fd51(0x134)]),y(0x1,c['Inject'](p))],g);var F=Object[_0x44fd51(0x15f)],L=Object['getOwnPropertyDescriptor'],Z=(_0x3599ec,_0x4bddbd,_0x4273d3)=>_0x4bddbd in _0x3599ec?F(_0x3599ec,_0x4bddbd,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4273d3}):_0x3599ec[_0x4bddbd]=_0x4273d3,W=(_0x41898d,_0x3a897e,_0x303e9e,_0x3a3424)=>{for(var _0x3ecfd4=_0x3a3424>0x1?void 0x0:_0x3a3424?L(_0x3a897e,_0x303e9e):_0x3a897e,_0x2cea53=_0x41898d['length']-0x1,_0x364c90;_0x2cea53>=0x0;_0x2cea53--)(_0x364c90=_0x41898d[_0x2cea53])&&(_0x3ecfd4=_0x364c90(_0x3ecfd4)||_0x3ecfd4);return _0x3ecfd4;},O=(_0xef4f44,_0x1213e2)=>(_0x4df72b,_0x28bfcb)=>_0x1213e2(_0x4df72b,_0x28bfcb,_0xef4f44),N=(_0x4563fb,_0x3c76ac,_0x522a16)=>Z(_0x4563fb,typeof _0x3c76ac!=_0x44fd51(0x10e)?_0x3c76ac+'':_0x3c76ac,_0x522a16);exports[_0x44fd51(0x114)]=class extends c['Plugin']{constructor(_0x17f3df=D,_0x4a91f0,_0x1775e2){const _0x132d93=_0x44fd51;super(),this[_0x132d93(0x165)]=_0x17f3df,this[_0x132d93(0x13a)]=_0x4a91f0,this['_configService']=_0x1775e2;const {..._0x5b2d03}=c[_0x132d93(0x145)]({},D,this[_0x132d93(0x165)]);this[_0x132d93(0x15b)]['setConfig'](q,_0x5b2d03);}[_0x44fd51(0x169)](){[[p],[g],[_]]['forEach'](_0xfbdb81=>{const _0x5dcfc5=_0x3844;this[_0x5dcfc5(0x13a)][_0x5dcfc5(0x16a)](_0xfbdb81);});}[_0x44fd51(0x152)](){const _0x589810=_0x44fd51;this[_0x589810(0x13a)][_0x589810(0x13d)](g),this[_0x589810(0x13a)][_0x589810(0x13d)](_);}},N(exports[_0x44fd51(0x114)],_0x44fd51(0xfe),U),N(exports[_0x44fd51(0x114)],_0x44fd51(0x143),c[_0x44fd51(0x14a)][_0x44fd51(0x106)]),exports[_0x44fd51(0x114)]=W([c['DependentOn'](w[_0x44fd51(0xfb)],b['UniverCollaborationClientPlugin'],T['UniverLicensePlugin']),O(0x1,c[_0x44fd51(0x11e)](c['Injector'])),O(0x2,c[_0x44fd51(0x12c)])],exports[_0x44fd51(0x114)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x243a(_0x50dc7e,_0x2ffada){const _0x290111=_0x2901();return _0x243a=function(_0x243a27,_0x4c55b7){_0x243a27=_0x243a27-0xe6;let _0x4305bb=_0x290111[_0x243a27];return _0x4305bb;},_0x243a(_0x50dc7e,_0x2ffada);}const _0x956842=_0x243a;(function(_0x5079eb,_0x1c2770){const _0x137e76=_0x243a,_0x23b293=_0x5079eb();while(!![]){try{const _0x55df3c=parseInt(_0x137e76(0x13a))/0x1*(parseInt(_0x137e76(0xec))/0x2)+parseInt(_0x137e76(0x132))/0x3*(parseInt(_0x137e76(0x11e))/0x4)+-parseInt(_0x137e76(0xea))/0x5+parseInt(_0x137e76(0x11f))/0x6*(parseInt(_0x137e76(0xf2))/0x7)+-parseInt(_0x137e76(0x14e))/0x8*(-parseInt(_0x137e76(0x118))/0x9)+parseInt(_0x137e76(0x10b))/0xa*(parseInt(_0x137e76(0xfa))/0xb)+parseInt(_0x137e76(0x125))/0xc*(-parseInt(_0x137e76(0x12d))/0xd);if(_0x55df3c===_0x1c2770)break;else _0x23b293['push'](_0x23b293['shift']());}catch(_0x5a687d){_0x23b293['push'](_0x23b293['shift']());}}}(_0x2901,0x9f485));import{CommentService as _0x403a4b,CollaborationSessionService as _0x5904f9,UniverCollaborationClientPlugin as _0x3802b1}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x17a341}from'@univerjs-pro/license';import{dayjs as _0x3e920d,UserManagerService as _0x55f5e7,Inject as _0x388faa,Injector as _0x469aaf,Disposable as _0x3fbff2,CustomRangeType as _0x558957,UniverInstanceType as _0x16ec5a,DependentOn as _0x23d00e,IConfigService as _0x1759fb,Plugin as _0x16d0b0,merge as _0x32f0bd}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b75f2}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x411c90,IThreadCommentDataSourceService as _0x2efa6a}from'@univerjs/thread-comment';import{bufferTime as _0x2e0e87}from'rxjs';import{HTTPService as _0x59a722}from'@univerjs/network';const W=_0x956842(0xe6);var I=(_0x530b6e=>(_0x530b6e[_0x530b6e[_0x956842(0x11c)]=0x0]=_0x956842(0x11c),_0x530b6e[_0x530b6e[_0x956842(0x11d)]=0x1]=_0x956842(0x11d),_0x530b6e[_0x530b6e[_0x956842(0x110)]=-0x1]='UNRECOGNIZED',_0x530b6e))(I||{}),v=(_0x1ec410=>(_0x1ec410[_0x1ec410[_0x956842(0xef)]=0x0]=_0x956842(0xef),_0x1ec410[_0x1ec410[_0x956842(0x127)]=0x1]='Add',_0x1ec410[_0x1ec410[_0x956842(0x142)]=0x2]='Reply',_0x1ec410[_0x1ec410[_0x956842(0x116)]=0x3]=_0x956842(0x116),_0x1ec410[_0x1ec410['Delete']=0x4]=_0x956842(0x105),_0x1ec410[_0x1ec410['Solve']=0x5]='Solve',_0x1ec410[_0x1ec410['UNRECOGNIZED']=-0x1]=_0x956842(0x110),_0x1ec410))(v||{});const y=_0x1ed2c=>_0x3e920d(new Date(+_0x1ed2c))['format'](_0x956842(0x146)),B=async(_0x427779,_0x3dc734)=>{const _0xba1855=_0x956842,_0x4c81d4=_0x427779['get'](_0x55f5e7),_0x4da8b4=_0x427779[_0xba1855(0x104)](_0x59a722);_0x3dc734[_0xba1855(0xf9)](_0x2f6e96=>{const _0x5db7fb=_0xba1855;_0x4c81d4[_0x5db7fb(0xfb)](_0x2f6e96)&&_0x3dc734[_0x5db7fb(0x12b)](_0x2f6e96);}),_0x3dc734[_0xba1855(0x139)]&&(await _0x4da8b4[_0xba1855(0x104)](_0xba1855(0x13e),{'params':{'userIDs':[..._0x3dc734]}}))[_0xba1855(0xe7)][_0xba1855(0x114)][_0xba1855(0xf9)](_0x28eb97=>{const _0x87b5d7=_0xba1855;_0x28eb97&&_0x4c81d4[_0x87b5d7(0xee)](_0x28eb97);});};function _0x2901(){const _0x48b080=['623718QKajwB','_httpService','rangeId','thread-comment-data-source.config','OpenOrReOpen','Solved','4btnRLq','415542oIynic','replyId','onStarting','customRanges','symbol','_initUserSync','57768WKSNZD','threadId','Add','syncUpdateMutationToColla','_threadCommentDataSourceService','COMMENT','delete','_sessionService','923HtBIIo','_config','Solve','listComments','/delete','885480piMWoC','_userService','disposeWithMe','post','type','pipe','_commentService','size','11mlWGhU','values','resolveComment','content','/universer-api/user/list','getUnit','/solved','error','Reply','UNIVER_UNKNOWN','addComment','/edit','YYYY/MM/DD\x20HH:mm','updateComment','deleteComment','format','_threadCommentModel','solved','parentId','payload','80ZsIGZc','createTimestamp','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','body','onReady','map','2331295mWHlbM','userID','47198vgyGVD','getOwnPropertyDescriptor','addUser','Unknown','_initDataSource','find','7piVRtL','_threadCommentDataSource','replies','defineProperty','add','stringify','requireSession','forEach','44KTHrcO','getUser','commentUpdate$','comment','code','parse','personId','subscribe','length','root','get','Delete','user','ref','userId','filter','getMemberID','358620MbbeEp','_configService','unitId','_injector','_init','UNRECOGNIZED','getCurrentUser','comments','getComment','users','/universer-api/comment/unit/','Edit','pluginName'];_0x2901=function(){return _0x48b080;};return _0x2901();}var K=Object[_0x956842(0xed)],V=(_0x39eb99,_0x109956,_0x307906,_0x333a6d)=>{for(var _0x4973ff=_0x333a6d>0x1?void 0x0:_0x333a6d?K(_0x109956,_0x307906):_0x109956,_0x2052a6=_0x39eb99['length']-0x1,_0x2f23c5;_0x2052a6>=0x0;_0x2052a6--)(_0x2f23c5=_0x39eb99[_0x2052a6])&&(_0x4973ff=_0x2f23c5(_0x4973ff)||_0x4973ff);return _0x4973ff;},p=(_0xa5c78e,_0x2ed838)=>(_0x2019fc,_0xef746d)=>_0x2ed838(_0x2019fc,_0xef746d,_0xa5c78e);let _=class extends _0x3fbff2{constructor(_0x5d3458,_0x1875b5,_0x4dddbb,_0x240d49){const _0x1a3d24=_0x956842;super(),this[_0x1a3d24(0x138)]=_0x5d3458,this['_threadCommentModel']=_0x1875b5,this[_0x1a3d24(0x133)]=_0x4dddbb,this['_injector']=_0x240d49,this[_0x1a3d24(0x10f)](),this[_0x1a3d24(0x124)]();}[_0x956842(0x124)](){const _0x4662b4=_0x956842;this[_0x4662b4(0x134)](this['_threadCommentModel']['commentUpdate$'][_0x4662b4(0x137)](_0x2e0e87(0x10))[_0x4662b4(0x101)](_0x52e62c=>{const _0xcffc11=_0x4662b4,_0x2d98cf=new Set();_0x52e62c[_0xcffc11(0xf9)](_0x262d99=>{const _0x4e8b2f=_0xcffc11;switch(_0x262d99[_0x4e8b2f(0x136)]){case _0x4e8b2f(0xf6):{const _0x3bd4a8=_0x262d99[_0x4e8b2f(0x14d)][_0x4e8b2f(0x100)];_0x2d98cf['add'](_0x3bd4a8);break;}}}),B(this['_injector'],_0x2d98cf);}));}['_init'](){const _0x35069c=_0x956842;this[_0x35069c(0x134)](this['_commentService'][_0x35069c(0xfc)][_0x35069c(0x101)](async _0x941f38=>{const _0xe8fb09=_0x35069c;var _0x40e9d0,_0x4794c5,_0x21d1a5,_0x3d2411;const _0x222bc8=(_0x40e9d0=this[_0xe8fb09(0x14a)][_0xe8fb09(0x13f)](_0x941f38[_0xe8fb09(0x10d)])[_0xe8fb09(0xf1)](_0x72d09=>_0x72d09[_0xe8fb09(0x126)]===_0x941f38['threadId']))==null?void 0x0:_0x40e9d0[_0xe8fb09(0x103)];if(!_0x222bc8)return;const {unitId:_0xdc874d,subUnitId:_0xe4fe24}=_0x222bc8;switch(_0x941f38[_0xe8fb09(0x106)]&&this['_userService'][_0xe8fb09(0xee)](_0x941f38['user']),_0x941f38[_0xe8fb09(0x136)]){case v['Add']:break;case v['Reply']:{this[_0xe8fb09(0x14a)][_0xe8fb09(0x144)](_0xdc874d,_0xe4fe24,{'unitId':_0xdc874d,'subUnitId':_0xe4fe24,'ref':'','id':_0x941f38['replyId'],'dT':y(+_0x941f38[_0xe8fb09(0x14f)]),'threadId':_0x941f38['threadId'],'personId':(_0x21d1a5=(_0x4794c5=_0x941f38[_0xe8fb09(0x106)])==null?void 0x0:_0x4794c5[_0xe8fb09(0xeb)])!=null?_0x21d1a5:_0x941f38[_0xe8fb09(0x108)],'text':JSON[_0xe8fb09(0xff)](_0x941f38[_0xe8fb09(0x13d)]),'parentId':_0x222bc8['id']});break;}case v[_0xe8fb09(0x105)]:{const _0x4f27dc=this[_0xe8fb09(0x14a)][_0xe8fb09(0x113)](_0xdc874d,_0xe4fe24,_0x941f38[_0xe8fb09(0x120)]);_0x4f27dc&&_0x4f27dc[_0xe8fb09(0x14c)]&&this[_0xe8fb09(0x14a)][_0xe8fb09(0x148)](_0xdc874d,_0xe4fe24,_0x941f38['replyId']);break;}case v[_0xe8fb09(0x116)]:{this[_0xe8fb09(0x14a)][_0xe8fb09(0x147)](_0xdc874d,_0xe4fe24,{'commentId':_0x941f38[_0xe8fb09(0x120)],'text':JSON[_0xe8fb09(0xff)](_0x941f38['content'])});break;}case v[_0xe8fb09(0x12f)]:{const _0x23a64f=(_0x3d2411=this[_0xe8fb09(0x14a)]['getUnit'](_0x941f38['unitId'])['find'](_0x52ecb5=>_0x52ecb5[_0xe8fb09(0x126)]===_0x941f38[_0xe8fb09(0x126)]))==null?void 0x0:_0x3d2411['root'];_0x23a64f&&this[_0xe8fb09(0x14a)][_0xe8fb09(0x13c)](_0xdc874d,_0xe4fe24,_0x23a64f['id'],_0x941f38[_0xe8fb09(0x14b)]===I[_0xe8fb09(0x11d)]);break;}}}));}};_=V([p(0x0,_0x388faa(_0x403a4b)),p(0x1,_0x388faa(_0x411c90)),p(0x2,_0x388faa(_0x55f5e7)),p(0x3,_0x388faa(_0x469aaf))],_);const z=_0x956842(0x11b),O={};var k=Object[_0x956842(0xed)],Q=(_0x302ede,_0x3d65f6,_0x8f7c97,_0x51c1e0)=>{for(var _0xf13b86=_0x51c1e0>0x1?void 0x0:_0x51c1e0?k(_0x3d65f6,_0x8f7c97):_0x3d65f6,_0x1c01c6=_0x302ede['length']-0x1,_0x5a5ce4;_0x1c01c6>=0x0;_0x1c01c6--)(_0x5a5ce4=_0x302ede[_0x1c01c6])&&(_0xf13b86=_0x5a5ce4(_0xf13b86)||_0xf13b86);return _0xf13b86;},b=(_0x1ef184,_0x4c3b75)=>(_0x347115,_0x3f53b4)=>_0x4c3b75(_0x347115,_0x3f53b4,_0x1ef184);function X(_0x4c380b,_0x59cce5){const _0x2ae662=_0x956842,_0x13d7a8=_0x4c380b[_0x2ae662(0xf4)][0x0];return{..._0x59cce5,'id':_0x13d7a8[_0x2ae662(0x120)],'resolved':_0x4c380b[_0x2ae662(0x14b)]===0x1,'dT':y(_0x13d7a8['createTimestamp']),'personId':_0x13d7a8[_0x2ae662(0x108)],'threadId':_0x13d7a8['threadId']};}function ee(_0x57b8dd,_0x336cd5,_0x3ad42c){const _0xaa05fa=_0x956842;var _0x4b699c,_0x1621c5;if(((_0x1621c5=(_0x4b699c=_0x57b8dd==null?void 0x0:_0x57b8dd['replies'])==null?void 0x0:_0x4b699c[_0xaa05fa(0x102)])!=null?_0x1621c5:0x0)>0x0){const _0x258ccc=(_0x3ee5ac,_0x1e6995)=>({'id':_0x3ee5ac[_0xaa05fa(0x120)],'threadId':_0x3ee5ac['threadId'],'dT':y(_0x3ee5ac[_0xaa05fa(0x14f)]),'personId':_0x3ee5ac[_0xaa05fa(0x108)],'resolved':_0x57b8dd[_0xaa05fa(0x14b)]===I[_0xaa05fa(0x11d)],'unitId':_0x336cd5,'subUnitId':_0x3ad42c,'text':JSON[_0xaa05fa(0xff)](_0x3ee5ac[_0xaa05fa(0x13d)]),'parentId':_0x1e6995}),_0xc7b3eb=_0x258ccc(_0x57b8dd['replies'][0x0]);return{..._0xc7b3eb,'children':_0x57b8dd[_0xaa05fa(0xf4)]['slice'](0x1)[_0xaa05fa(0xe9)](_0x4dcd08=>_0x258ccc(_0x4dcd08,_0xc7b3eb['id']))};}return null;}let S=class{constructor(_0x124ede,_0x2637eb,_0x20918a){const _0x6518f3=_0x956842;this['_httpService']=_0x124ede,this[_0x6518f3(0x133)]=_0x2637eb,this[_0x6518f3(0x12c)]=_0x20918a;}async[_0x956842(0x144)](_0x31fd1c){const _0x3f9f13=_0x956842;var _0x204986,_0xca1818;const {parentId:_0x1c2f71,unitId:_0x1b9b5c,text:_0x2c7406,threadId:_0x4752ef}=_0x31fd1c,_0x275b9c=(_0xca1818=(_0x204986=_0x2c7406[_0x3f9f13(0x122)])==null?void 0x0:_0x204986[_0x3f9f13(0x109)](_0x55cfd8=>_0x55cfd8['rangeType']===_0x558957[_0x3f9f13(0x12a)])[_0x3f9f13(0xe9)](_0x227f18=>_0x227f18['rangeId']))!=null?_0xca1818:[],_0xf87d93=JSON[_0x3f9f13(0xf7)](_0x2c7406),_0x41b0f3=(await this[_0x3f9f13(0x12c)][_0x3f9f13(0xf8)](_0x1b9b5c))['getMemberID']();if(_0x1c2f71){const _0x334645={'memberId':_0x41b0f3,'unitId':_0x1b9b5c,'content':_0xf87d93,'mention':_0x275b9c,'threadId':_0x4752ef},_0x4b45fa=(await this[_0x3f9f13(0x119)]['post']('/universer-api/comment/unit/'+_0x1b9b5c+'/reply',{'body':_0x334645}))[_0x3f9f13(0xe7)]['reply'];return{..._0x31fd1c,'id':_0x4b45fa[_0x3f9f13(0x120)],'dT':_0x3e920d(+_0x4b45fa[_0x3f9f13(0x14f)])[_0x3f9f13(0x149)](_0x3f9f13(0x146)),'personId':_0x4b45fa['userId']};}else{const _0x1c8531={'memberId':_0x41b0f3,'unitId':_0x1b9b5c,'content':_0xf87d93,'mention':_0x275b9c},_0x53880d=await this[_0x3f9f13(0x119)][_0x3f9f13(0x135)]('/universer-api/comment/unit/'+_0x1b9b5c+'/add',{'body':_0x1c8531});return X(_0x53880d[_0x3f9f13(0xe7)][_0x3f9f13(0xfd)],_0x31fd1c);}}async[_0x956842(0x147)](_0x4a18c5){const _0x42f38f=_0x956842;var _0x26e246,_0x1a8df5;const {text:_0x56ecca,unitId:_0xf0e616}=_0x4a18c5,_0x4ec138=(_0x1a8df5=(_0x26e246=_0x56ecca[_0x42f38f(0x122)])==null?void 0x0:_0x26e246[_0x42f38f(0x109)](_0x5b3388=>_0x5b3388['rangeType']===_0x558957['COMMENT'])['map'](_0x345545=>_0x345545[_0x42f38f(0x11a)]))!=null?_0x1a8df5:[],_0x345d78=JSON[_0x42f38f(0xf7)](_0x56ecca),_0x55c176=_0x4a18c5['threadId'],_0x5ab3b5=_0x4a18c5['id'],_0x113690={'memberId':(await this[_0x42f38f(0x12c)]['requireSession'](_0xf0e616))[_0x42f38f(0x10a)](),'unitId':_0xf0e616,'threadId':_0x55c176,'mention':_0x4ec138,'content':_0x345d78,'replyId':_0x5ab3b5},_0x549625=await this[_0x42f38f(0x119)][_0x42f38f(0x135)](_0x42f38f(0x115)+_0xf0e616+_0x42f38f(0x145),{'body':_0x113690});return!_0x549625[_0x42f38f(0xe7)][_0x42f38f(0x141)]||_0x549625[_0x42f38f(0xe7)][_0x42f38f(0x141)][_0x42f38f(0xfe)]===0x1;}async[_0x956842(0x13c)](_0x385737){const _0x324e5c=_0x956842,{unitId:_0x2b620f}=_0x385737,_0x13b3b4=_0x385737[_0x324e5c(0x126)],_0x5b351c={'memberId':this[_0x324e5c(0x133)][_0x324e5c(0x111)]()[_0x324e5c(0xeb)],'unitId':_0x2b620f,'threadId':_0x13b3b4,'solved':_0x385737['resolved']?I[_0x324e5c(0x11d)]:I['OpenOrReOpen']},_0x1f4c16=await this[_0x324e5c(0x119)][_0x324e5c(0x135)]('/universer-api/comment/unit/'+_0x2b620f+_0x324e5c(0x140),{'body':_0x5b351c});return!_0x1f4c16[_0x324e5c(0xe7)]['error']||_0x1f4c16[_0x324e5c(0xe7)][_0x324e5c(0x141)][_0x324e5c(0xfe)]===0x1;}async['deleteComment'](_0x4270ad,_0x29fd95,_0xaad581,_0x3d79cd){const _0x44ff0e=_0x956842,_0x3a0cd0={'memberId':(await this[_0x44ff0e(0x12c)][_0x44ff0e(0xf8)](_0x4270ad))['getMemberID'](),'threadId':_0xaad581,'replyId':_0x3d79cd,'unitId':_0x4270ad},_0x395fd6=await this[_0x44ff0e(0x119)][_0x44ff0e(0x135)](_0x44ff0e(0x115)+_0x4270ad+_0x44ff0e(0x131),{'body':_0x3a0cd0});return!_0x395fd6[_0x44ff0e(0xe7)][_0x44ff0e(0x141)]||_0x395fd6[_0x44ff0e(0xe7)][_0x44ff0e(0x141)]['code']===0x1;}async[_0x956842(0x130)](_0x5498c0,_0x5eb2b6,_0x2d5c00){const _0x28e2d9=_0x956842,_0x1137ab={'unitId':_0x5498c0,'threadId':_0x2d5c00},_0xf1d849=await this['_httpService']['post'](_0x28e2d9(0x115)+_0x5498c0+'/list',{'body':_0x1137ab}),_0x24fac9=_0x2d5c00[_0x28e2d9(0xe9)](_0x264b43=>ee(_0xf1d849['body'][_0x28e2d9(0x112)][_0x264b43],_0x5498c0,_0x5eb2b6))['filter'](Boolean);return Object[_0x28e2d9(0x13b)](_0xf1d849[_0x28e2d9(0xe7)][_0x28e2d9(0x114)])['forEach'](_0x5c7149=>{const _0x59a7a7=_0x28e2d9;this['_userService'][_0x59a7a7(0xee)](_0x5c7149);}),_0x24fac9;}['saveCommentToSnapshot'](_0x44f4d7){const _0x4d650c=_0x956842;return{'id':_0x44f4d7['id'],'threadId':_0x44f4d7[_0x4d650c(0x126)],'ref':_0x44f4d7[_0x4d650c(0x107)]};}};S=Q([b(0x0,_0x388faa(_0x59a722)),b(0x1,_0x388faa(_0x55f5e7)),b(0x2,_0x388faa(_0x5904f9))],S);var re=Object[_0x956842(0xed)],te=(_0x28e891,_0x1eecb4,_0x18e04b,_0x4ba75d)=>{const _0x204eb6=_0x956842;for(var _0x1e4226=_0x4ba75d>0x1?void 0x0:_0x4ba75d?re(_0x1eecb4,_0x18e04b):_0x1eecb4,_0x53c6eb=_0x28e891[_0x204eb6(0x102)]-0x1,_0xf586cd;_0x53c6eb>=0x0;_0x53c6eb--)(_0xf586cd=_0x28e891[_0x53c6eb])&&(_0x1e4226=_0xf586cd(_0x1e4226)||_0x1e4226);return _0x1e4226;},M=(_0x313d98,_0x5b8d07)=>(_0x3b1760,_0x2ef73a)=>_0x5b8d07(_0x3b1760,_0x2ef73a,_0x313d98);let f=class extends _0x3fbff2{constructor(_0x229eca,_0x4e2365){const _0x50bb22=_0x956842;super(),this['_threadCommentDataSourceService']=_0x229eca,this[_0x50bb22(0xf3)]=_0x4e2365,this[_0x50bb22(0xf0)]();}[_0x956842(0xf0)](){const _0x1e648b=_0x956842;this[_0x1e648b(0x129)]['dataSource']=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x1e648b(0x128)]=!0x1;}};f=te([M(0x0,_0x2efa6a),M(0x1,_0x388faa(S))],f);var se=Object[_0x956842(0xf5)],oe=Object[_0x956842(0xed)],ne=(_0x247e7d,_0x4462e6,_0x394e7e)=>_0x4462e6 in _0x247e7d?se(_0x247e7d,_0x4462e6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x394e7e}):_0x247e7d[_0x4462e6]=_0x394e7e,ie=(_0x314c32,_0x17d4cc,_0x5828f0,_0x37f6de)=>{const _0x385a6a=_0x956842;for(var _0x357c99=_0x37f6de>0x1?void 0x0:_0x37f6de?oe(_0x17d4cc,_0x5828f0):_0x17d4cc,_0x195918=_0x314c32[_0x385a6a(0x102)]-0x1,_0x3d119f;_0x195918>=0x0;_0x195918--)(_0x3d119f=_0x314c32[_0x195918])&&(_0x357c99=_0x3d119f(_0x357c99)||_0x357c99);return _0x357c99;},N=(_0x4dfbab,_0x436cf6)=>(_0xacb57,_0x24b764)=>_0x436cf6(_0xacb57,_0x24b764,_0x4dfbab),$=(_0x37a608,_0x4fe0b5,_0xda5cba)=>ne(_0x37a608,typeof _0x4fe0b5!=_0x956842(0x123)?_0x4fe0b5+'':_0x4fe0b5,_0xda5cba);let g=class extends _0x16d0b0{constructor(_0x56a7ed=O,_0x15a610,_0x572da2){const _0x2ff10a=_0x956842;super(),this[_0x2ff10a(0x12e)]=_0x56a7ed,this[_0x2ff10a(0x10e)]=_0x15a610,this[_0x2ff10a(0x10c)]=_0x572da2;const {..._0x496091}=_0x32f0bd({},O,this[_0x2ff10a(0x12e)]);this[_0x2ff10a(0x10c)]['setConfig'](z,_0x496091);}[_0x956842(0x121)](){[[S],[f],[_]]['forEach'](_0x5b2cfd=>{const _0x18cbe0=_0x243a;this[_0x18cbe0(0x10e)][_0x18cbe0(0xf6)](_0x5b2cfd);});}[_0x956842(0xe8)](){const _0x1a50d7=_0x956842;this['_injector']['get'](f),this[_0x1a50d7(0x10e)][_0x1a50d7(0x104)](_);}};$(g,_0x956842(0x117),W),$(g,_0x956842(0x136),_0x16ec5a[_0x956842(0x143)]),g=ie([_0x23d00e(_0x4b75f2,_0x3802b1,_0x17a341),N(0x1,_0x388faa(_0x469aaf)),N(0x2,_0x1759fb)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x4216a6=_0xb571;(function(_0x2d8b2f,_0x59151c){const _0xa1f72=_0xb571,_0x559c02=_0x2d8b2f();while(!![]){try{const _0x527ec2=-parseInt(_0xa1f72(0xcf))/0x1+parseInt(_0xa1f72(0xdb))/0x2+-parseInt(_0xa1f72(0xeb))/0x3*(-parseInt(_0xa1f72(0xb2))/0x4)+parseInt(_0xa1f72(0xe4))/0x5+parseInt(_0xa1f72(0xf0))/0x6+parseInt(_0xa1f72(0xde))/0x7*(parseInt(_0xa1f72(0x9d))/0x8)+parseInt(_0xa1f72(0xa0))/0x9*(-parseInt(_0xa1f72(0xf5))/0xa);if(_0x527ec2===_0x59151c)break;else _0x559c02['push'](_0x559c02['shift']());}catch(_0x54dd11){_0x559c02['push'](_0x559c02['shift']());}}}(_0x5c5c,0xc48b6));import{CommentService as _0x1584c3,CollaborationSessionService as _0x12ee47,UniverCollaborationClientPlugin as _0x5719a3}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x187f4d}from'@univerjs-pro/license';import{dayjs as _0x5b50d4,UserManagerService as _0x598b93,Inject as _0x49b372,Injector as _0x43ed79,Disposable as _0xef71e6,CustomRangeType as _0x5edfc0,UniverInstanceType as _0x347d61,DependentOn as _0x526950,IConfigService as _0x349588,Plugin as _0x2e9e01,merge as _0x41cc18}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x54f46d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x35b968,IThreadCommentDataSourceService as _0x23173b}from'@univerjs/thread-comment';import{bufferTime as _0x4b2858}from'rxjs';import{HTTPService as _0x38b897}from'@univerjs/network';const W=_0x4216a6(0xd9);var I=(_0x20269e=>(_0x20269e[_0x20269e['OpenOrReOpen']=0x0]='OpenOrReOpen',_0x20269e[_0x20269e[_0x4216a6(0xcc)]=0x1]=_0x4216a6(0xcc),_0x20269e[_0x20269e[_0x4216a6(0xe8)]=-0x1]=_0x4216a6(0xe8),_0x20269e))(I||{}),v=(_0x5f1b7b=>(_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xcb)]=0x0]=_0x4216a6(0xcb),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xfd)]=0x1]=_0x4216a6(0xfd),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xab)]=0x2]=_0x4216a6(0xab),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xd2)]=0x3]='Edit',_0x5f1b7b[_0x5f1b7b['Delete']=0x4]='Delete',_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xff)]=0x5]=_0x4216a6(0xff),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xe8)]=-0x1]=_0x4216a6(0xe8),_0x5f1b7b))(v||{});const y=_0x2a8d2c=>_0x5b50d4(new Date(+_0x2a8d2c))[_0x4216a6(0xc8)](_0x4216a6(0xa1)),B=async(_0x53a0c8,_0x2de9bf)=>{const _0x431f59=_0x4216a6,_0x4090dc=_0x53a0c8[_0x431f59(0xa4)](_0x598b93),_0x2c2bdc=_0x53a0c8[_0x431f59(0xa4)](_0x38b897);_0x2de9bf[_0x431f59(0xec)](_0x3569be=>{const _0x566d9d=_0x431f59;_0x4090dc[_0x566d9d(0xad)](_0x3569be)&&_0x2de9bf['delete'](_0x3569be);}),_0x2de9bf[_0x431f59(0xea)]&&(await _0x2c2bdc[_0x431f59(0xa4)](_0x431f59(0x9f),{'params':{'userIDs':[..._0x2de9bf]}}))[_0x431f59(0xbe)][_0x431f59(0xf3)][_0x431f59(0xec)](_0x22f4b6=>{const _0x546d23=_0x431f59;_0x22f4b6&&_0x4090dc[_0x546d23(0xe0)](_0x22f4b6);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x4d6cf8,_0x3bb8fe,_0x599119,_0x46b88d)=>{for(var _0xfbae88=_0x46b88d>0x1?void 0x0:_0x46b88d?K(_0x3bb8fe,_0x599119):_0x3bb8fe,_0x524dec=_0x4d6cf8['length']-0x1,_0x1d27d6;_0x524dec>=0x0;_0x524dec--)(_0x1d27d6=_0x4d6cf8[_0x524dec])&&(_0xfbae88=_0x1d27d6(_0xfbae88)||_0xfbae88);return _0xfbae88;},p=(_0x469302,_0x3c61f1)=>(_0x3ec9ac,_0x36e9fb)=>_0x3c61f1(_0x3ec9ac,_0x36e9fb,_0x469302);let _=class extends _0xef71e6{constructor(_0x29bb3d,_0xf8d8af,_0x1559d2,_0x2fa1a8){const _0x3d6071=_0x4216a6;super(),this['_commentService']=_0x29bb3d,this['_threadCommentModel']=_0xf8d8af,this[_0x3d6071(0xf8)]=_0x1559d2,this[_0x3d6071(0xc0)]=_0x2fa1a8,this[_0x3d6071(0xac)](),this['_initUserSync']();}['_initUserSync'](){const _0x13cca5=_0x4216a6;this['disposeWithMe'](this[_0x13cca5(0xc5)][_0x13cca5(0xc2)]['pipe'](_0x4b2858(0x10))[_0x13cca5(0xfc)](_0x1de64d=>{const _0x17c26b=_0x13cca5,_0x3efb5e=new Set();_0x1de64d['forEach'](_0xf06023=>{const _0x2dbedc=_0xb571;switch(_0xf06023[_0x2dbedc(0xdf)]){case'add':{const _0x19f1d0=_0xf06023['payload']['personId'];_0x3efb5e['add'](_0x19f1d0);break;}}}),B(this[_0x17c26b(0xc0)],_0x3efb5e);}));}['_init'](){const _0x25c521=_0x4216a6;this['disposeWithMe'](this[_0x25c521(0xf6)][_0x25c521(0xc2)][_0x25c521(0xfc)](async _0x27952f=>{const _0x2232f3=_0x25c521;var _0x5ef136,_0x2d05b3,_0x9d3245,_0x1843b4;const _0x91a08a=(_0x5ef136=this[_0x2232f3(0xc5)]['getUnit'](_0x27952f[_0x2232f3(0x9e)])[_0x2232f3(0xd1)](_0xc242fc=>_0xc242fc['threadId']===_0x27952f['threadId']))==null?void 0x0:_0x5ef136['root'];if(!_0x91a08a)return;const {unitId:_0x110ed3,subUnitId:_0x46d10a}=_0x91a08a;switch(_0x27952f['user']&&this['_userService']['addUser'](_0x27952f['user']),_0x27952f[_0x2232f3(0xdf)]){case v[_0x2232f3(0xfd)]:break;case v['Reply']:{this[_0x2232f3(0xc5)]['addComment'](_0x110ed3,_0x46d10a,{'unitId':_0x110ed3,'subUnitId':_0x46d10a,'ref':'','id':_0x27952f[_0x2232f3(0xba)],'dT':y(+_0x27952f['createTimestamp']),'threadId':_0x27952f[_0x2232f3(0xae)],'personId':(_0x9d3245=(_0x2d05b3=_0x27952f[_0x2232f3(0xe6)])==null?void 0x0:_0x2d05b3[_0x2232f3(0xaf)])!=null?_0x9d3245:_0x27952f['userId'],'text':JSON['parse'](_0x27952f['content']),'parentId':_0x91a08a['id']});break;}case v[_0x2232f3(0xaa)]:{const _0x1f8839=this[_0x2232f3(0xc5)]['getComment'](_0x110ed3,_0x46d10a,_0x27952f[_0x2232f3(0xba)]);_0x1f8839&&_0x1f8839['parentId']&&this[_0x2232f3(0xc5)][_0x2232f3(0xb7)](_0x110ed3,_0x46d10a,_0x27952f[_0x2232f3(0xba)]);break;}case v[_0x2232f3(0xd2)]:{this[_0x2232f3(0xc5)][_0x2232f3(0xed)](_0x110ed3,_0x46d10a,{'commentId':_0x27952f[_0x2232f3(0xba)],'text':JSON[_0x2232f3(0xd5)](_0x27952f[_0x2232f3(0xc1)])});break;}case v[_0x2232f3(0xff)]:{const _0x48098a=(_0x1843b4=this[_0x2232f3(0xc5)][_0x2232f3(0xc7)](_0x27952f['unitId'])[_0x2232f3(0xd1)](_0x211a44=>_0x211a44['threadId']===_0x27952f['threadId']))==null?void 0x0:_0x1843b4[_0x2232f3(0xbf)];_0x48098a&&this[_0x2232f3(0xc5)][_0x2232f3(0xbc)](_0x110ed3,_0x46d10a,_0x48098a['id'],_0x27952f[_0x2232f3(0xa9)]===I[_0x2232f3(0xcc)]);break;}}}));}};_=V([p(0x0,_0x49b372(_0x1584c3)),p(0x1,_0x49b372(_0x35b968)),p(0x2,_0x49b372(_0x598b93)),p(0x3,_0x49b372(_0x43ed79))],_);const z=_0x4216a6(0xd6),O={};function _0xb571(_0x3d7de3,_0x8b813a){const _0x5c5cb7=_0x5c5c();return _0xb571=function(_0xb5711a,_0x53b26d){_0xb5711a=_0xb5711a-0x9d;let _0x5dfa3b=_0x5c5cb7[_0xb5711a];return _0x5dfa3b;},_0xb571(_0x3d7de3,_0x8b813a);}var k=Object['getOwnPropertyDescriptor'],Q=(_0x3fa53d,_0x3e42e8,_0x4b9dc8,_0x396df9)=>{for(var _0x1d9696=_0x396df9>0x1?void 0x0:_0x396df9?k(_0x3e42e8,_0x4b9dc8):_0x3e42e8,_0x554496=_0x3fa53d['length']-0x1,_0x560d1b;_0x554496>=0x0;_0x554496--)(_0x560d1b=_0x3fa53d[_0x554496])&&(_0x1d9696=_0x560d1b(_0x1d9696)||_0x1d9696);return _0x1d9696;},b=(_0x23497d,_0x526561)=>(_0x54d12d,_0x9bceb)=>_0x526561(_0x54d12d,_0x9bceb,_0x23497d);function X(_0x2ec03e,_0x2288c3){const _0x31fa5d=_0x4216a6,_0x3e668f=_0x2ec03e[_0x31fa5d(0xc3)][0x0];return{..._0x2288c3,'id':_0x3e668f[_0x31fa5d(0xba)],'resolved':_0x2ec03e[_0x31fa5d(0xa9)]===0x1,'dT':y(_0x3e668f[_0x31fa5d(0xe2)]),'personId':_0x3e668f['userId'],'threadId':_0x3e668f[_0x31fa5d(0xae)]};}function ee(_0x25a34a,_0x191128,_0x183b51){const _0x2afda8=_0x4216a6;var _0x5557ca,_0x6fc11b;if(((_0x6fc11b=(_0x5557ca=_0x25a34a==null?void 0x0:_0x25a34a[_0x2afda8(0xc3)])==null?void 0x0:_0x5557ca['length'])!=null?_0x6fc11b:0x0)>0x0){const _0x4f3d99=(_0x325783,_0x360fa1)=>({'id':_0x325783[_0x2afda8(0xba)],'threadId':_0x325783[_0x2afda8(0xae)],'dT':y(_0x325783[_0x2afda8(0xe2)]),'personId':_0x325783['userId'],'resolved':_0x25a34a['solved']===I['Solved'],'unitId':_0x191128,'subUnitId':_0x183b51,'text':JSON[_0x2afda8(0xd5)](_0x325783[_0x2afda8(0xc1)]),'parentId':_0x360fa1}),_0xbe6269=_0x4f3d99(_0x25a34a['replies'][0x0]);return{..._0xbe6269,'children':_0x25a34a['replies'][_0x2afda8(0xf7)](0x1)['map'](_0x2d4475=>_0x4f3d99(_0x2d4475,_0xbe6269['id']))};}return null;}let S=class{constructor(_0x206409,_0x559f8e,_0xf1f047){const _0xf5386a=_0x4216a6;this[_0xf5386a(0xb0)]=_0x206409,this['_userService']=_0x559f8e,this[_0xf5386a(0xb6)]=_0xf1f047;}async[_0x4216a6(0xca)](_0x54a245){const _0xa64d51=_0x4216a6;var _0x59cfeb,_0x3388ad;const {parentId:_0x57cee4,unitId:_0x33e0b3,text:_0x3eddd2,threadId:_0x2d4399}=_0x54a245,_0x271ad8=(_0x3388ad=(_0x59cfeb=_0x3eddd2[_0xa64d51(0xfa)])==null?void 0x0:_0x59cfeb[_0xa64d51(0xe5)](_0x21818a=>_0x21818a[_0xa64d51(0xa3)]===_0x5edfc0[_0xa64d51(0xbd)])['map'](_0x558601=>_0x558601['rangeId']))!=null?_0x3388ad:[],_0x304aeb=JSON[_0xa64d51(0xa2)](_0x3eddd2),_0x2c8c9f=(await this[_0xa64d51(0xb6)][_0xa64d51(0xd4)](_0x33e0b3))[_0xa64d51(0xfe)]();if(_0x57cee4){const _0xda28d1={'memberId':_0x2c8c9f,'unitId':_0x33e0b3,'content':_0x304aeb,'mention':_0x271ad8,'threadId':_0x2d4399},_0x5d50c5=(await this[_0xa64d51(0xb0)][_0xa64d51(0xbb)]('/universer-api/comment/unit/'+_0x33e0b3+_0xa64d51(0xef),{'body':_0xda28d1}))['body'][_0xa64d51(0xb8)];return{..._0x54a245,'id':_0x5d50c5[_0xa64d51(0xba)],'dT':_0x5b50d4(+_0x5d50c5[_0xa64d51(0xe2)])['format'](_0xa64d51(0xa1)),'personId':_0x5d50c5[_0xa64d51(0xf9)]};}else{const _0x3a3bcb={'memberId':_0x2c8c9f,'unitId':_0x33e0b3,'content':_0x304aeb,'mention':_0x271ad8},_0x4f1c8f=await this[_0xa64d51(0xb0)][_0xa64d51(0xbb)]('/universer-api/comment/unit/'+_0x33e0b3+_0xa64d51(0xf1),{'body':_0x3a3bcb});return X(_0x4f1c8f['body'][_0xa64d51(0xd3)],_0x54a245);}}async['updateComment'](_0xb1d840){const _0x119173=_0x4216a6;var _0x43ec39,_0x507f0a;const {text:_0x2ff724,unitId:_0x411044}=_0xb1d840,_0x260608=(_0x507f0a=(_0x43ec39=_0x2ff724[_0x119173(0xfa)])==null?void 0x0:_0x43ec39[_0x119173(0xe5)](_0x11c5bc=>_0x11c5bc[_0x119173(0xa3)]===_0x5edfc0[_0x119173(0xbd)])[_0x119173(0xc4)](_0x5e4b41=>_0x5e4b41[_0x119173(0xcd)]))!=null?_0x507f0a:[],_0x488b94=JSON['stringify'](_0x2ff724),_0x40d891=_0xb1d840[_0x119173(0xae)],_0x229020=_0xb1d840['id'],_0x588261={'memberId':(await this[_0x119173(0xb6)][_0x119173(0xd4)](_0x411044))[_0x119173(0xfe)](),'unitId':_0x411044,'threadId':_0x40d891,'mention':_0x260608,'content':_0x488b94,'replyId':_0x229020},_0x12cf44=await this[_0x119173(0xb0)][_0x119173(0xbb)](_0x119173(0xa5)+_0x411044+'/edit',{'body':_0x588261});return!_0x12cf44['body'][_0x119173(0xfb)]||_0x12cf44['body'][_0x119173(0xfb)][_0x119173(0xb5)]===0x1;}async[_0x4216a6(0xbc)](_0x384578){const _0x44ae4e=_0x4216a6,{unitId:_0x1f43b3}=_0x384578,_0x3b1657=_0x384578[_0x44ae4e(0xae)],_0x9f6883={'memberId':this[_0x44ae4e(0xf8)]['getCurrentUser']()['userID'],'unitId':_0x1f43b3,'threadId':_0x3b1657,'solved':_0x384578[_0x44ae4e(0xf2)]?I[_0x44ae4e(0xcc)]:I[_0x44ae4e(0xa7)]},_0x1584ca=await this[_0x44ae4e(0xb0)][_0x44ae4e(0xbb)](_0x44ae4e(0xa5)+_0x1f43b3+_0x44ae4e(0xd8),{'body':_0x9f6883});return!_0x1584ca['body'][_0x44ae4e(0xfb)]||_0x1584ca[_0x44ae4e(0xbe)]['error']['code']===0x1;}async[_0x4216a6(0xb7)](_0x8f098,_0xd47587,_0x121e87,_0x1d296a){const _0x1f4169=_0x4216a6,_0xd622c0={'memberId':(await this[_0x1f4169(0xb6)][_0x1f4169(0xd4)](_0x8f098))[_0x1f4169(0xfe)](),'threadId':_0x121e87,'replyId':_0x1d296a,'unitId':_0x8f098},_0x2911d8=await this[_0x1f4169(0xb0)][_0x1f4169(0xbb)]('/universer-api/comment/unit/'+_0x8f098+_0x1f4169(0xda),{'body':_0xd622c0});return!_0x2911d8['body']['error']||_0x2911d8[_0x1f4169(0xbe)][_0x1f4169(0xfb)][_0x1f4169(0xb5)]===0x1;}async['listComments'](_0x23b489,_0x222ba0,_0x20e8b9){const _0x3c2907=_0x4216a6,_0x33c943={'unitId':_0x23b489,'threadId':_0x20e8b9},_0x1eb491=await this[_0x3c2907(0xb0)][_0x3c2907(0xbb)](_0x3c2907(0xa5)+_0x23b489+_0x3c2907(0xe9),{'body':_0x33c943}),_0x3d55df=_0x20e8b9[_0x3c2907(0xc4)](_0x509889=>ee(_0x1eb491[_0x3c2907(0xbe)][_0x3c2907(0x100)][_0x509889],_0x23b489,_0x222ba0))[_0x3c2907(0xe5)](Boolean);return Object[_0x3c2907(0xd0)](_0x1eb491[_0x3c2907(0xbe)][_0x3c2907(0xf3)])[_0x3c2907(0xec)](_0x479309=>{const _0x1d5a5e=_0x3c2907;this[_0x1d5a5e(0xf8)][_0x1d5a5e(0xe0)](_0x479309);}),_0x3d55df;}[_0x4216a6(0xa8)](_0x434240){const _0x5e7bb6=_0x4216a6;return{'id':_0x434240['id'],'threadId':_0x434240[_0x5e7bb6(0xae)],'ref':_0x434240[_0x5e7bb6(0xd7)]};}};S=Q([b(0x0,_0x49b372(_0x38b897)),b(0x1,_0x49b372(_0x598b93)),b(0x2,_0x49b372(_0x12ee47))],S);var re=Object[_0x4216a6(0xe1)],te=(_0x347f9d,_0x45d7d4,_0x63250c,_0x3defd5)=>{const _0x2415d1=_0x4216a6;for(var _0x2251de=_0x3defd5>0x1?void 0x0:_0x3defd5?re(_0x45d7d4,_0x63250c):_0x45d7d4,_0x3564a4=_0x347f9d[_0x2415d1(0xe3)]-0x1,_0x2918e9;_0x3564a4>=0x0;_0x3564a4--)(_0x2918e9=_0x347f9d[_0x3564a4])&&(_0x2251de=_0x2918e9(_0x2251de)||_0x2251de);return _0x2251de;},M=(_0x3d6542,_0x2b609d)=>(_0x49e1bf,_0x2ae6d8)=>_0x2b609d(_0x49e1bf,_0x2ae6d8,_0x3d6542);let f=class extends _0xef71e6{constructor(_0x50d149,_0x9bb59e){const _0x3e6000=_0x4216a6;super(),this[_0x3e6000(0xf4)]=_0x50d149,this['_threadCommentDataSource']=_0x9bb59e,this[_0x3e6000(0xb3)]();}[_0x4216a6(0xb3)](){const _0x2d4ab3=_0x4216a6;this['_threadCommentDataSourceService'][_0x2d4ab3(0xdd)]=this['_threadCommentDataSource'],this[_0x2d4ab3(0xf4)][_0x2d4ab3(0xb1)]=!0x1;}};f=te([M(0x0,_0x23173b),M(0x1,_0x49b372(S))],f);function _0x5c5c(){const _0xb48658=['reply','_config','replyId','post','resolveComment','COMMENT','body','root','_injector','content','commentUpdate$','replies','map','_threadCommentModel','setConfig','getUnit','format','defineProperty','addComment','Unknown','Solved','rangeId','UNIVER_UNKNOWN','1423865lLpQkd','values','find','Edit','comment','requireSession','parse','thread-comment-data-source.config','ref','/solved','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/delete','1718768wEfgwp','onReady','dataSource','707KkHKJh','type','addUser','getOwnPropertyDescriptor','createTimestamp','length','4544560GuSjYK','filter','user','onStarting','UNRECOGNIZED','/list','size','1751991ssMERF','forEach','updateComment','add','/reply','7920756JbXfiK','/add','resolved','users','_threadCommentDataSourceService','145600IUrZQv','_commentService','slice','_userService','userId','customRanges','error','subscribe','Add','getMemberID','Solve','comments','3296nDEwci','unitId','/universer-api/user/list','918xCawYy','YYYY/MM/DD\x20HH:mm','stringify','rangeType','get','/universer-api/comment/unit/','pluginName','OpenOrReOpen','saveCommentToSnapshot','solved','Delete','Reply','_init','getUser','threadId','userID','_httpService','syncUpdateMutationToColla','4LWHoFh','_initDataSource','_configService','code','_sessionService','deleteComment'];_0x5c5c=function(){return _0xb48658;};return _0x5c5c();}var se=Object[_0x4216a6(0xc9)],oe=Object[_0x4216a6(0xe1)],ne=(_0x441d6e,_0xd6a5ed,_0x11cfb0)=>_0xd6a5ed in _0x441d6e?se(_0x441d6e,_0xd6a5ed,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x11cfb0}):_0x441d6e[_0xd6a5ed]=_0x11cfb0,ie=(_0x541027,_0x39134b,_0x58a663,_0x547a9d)=>{const _0x2f5176=_0x4216a6;for(var _0xd75e81=_0x547a9d>0x1?void 0x0:_0x547a9d?oe(_0x39134b,_0x58a663):_0x39134b,_0x3a899c=_0x541027[_0x2f5176(0xe3)]-0x1,_0x56bff0;_0x3a899c>=0x0;_0x3a899c--)(_0x56bff0=_0x541027[_0x3a899c])&&(_0xd75e81=_0x56bff0(_0xd75e81)||_0xd75e81);return _0xd75e81;},N=(_0x3e2aef,_0x1e4ee2)=>(_0x1d7003,_0x30b021)=>_0x1e4ee2(_0x1d7003,_0x30b021,_0x3e2aef),$=(_0x4e1eb8,_0x1f8670,_0x5255f4)=>ne(_0x4e1eb8,typeof _0x1f8670!='symbol'?_0x1f8670+'':_0x1f8670,_0x5255f4);let g=class extends _0x2e9e01{constructor(_0x2b1a19=O,_0x169ad5,_0x366b34){const _0x212939=_0x4216a6;super(),this[_0x212939(0xb9)]=_0x2b1a19,this['_injector']=_0x169ad5,this['_configService']=_0x366b34;const {..._0x1c14c0}=_0x41cc18({},O,this[_0x212939(0xb9)]);this[_0x212939(0xb4)][_0x212939(0xc6)](z,_0x1c14c0);}[_0x4216a6(0xe7)](){const _0x745e4f=_0x4216a6;[[S],[f],[_]][_0x745e4f(0xec)](_0x171f41=>{const _0x22f5d5=_0x745e4f;this[_0x22f5d5(0xc0)][_0x22f5d5(0xee)](_0x171f41);});}[_0x4216a6(0xdc)](){const _0x466b3e=_0x4216a6;this['_injector']['get'](f),this['_injector'][_0x466b3e(0xa4)](_);}};$(g,_0x4216a6(0xa6),W),$(g,'type',_0x347d61[_0x4216a6(0xce)]),g=ie([_0x526950(_0x54f46d,_0x5719a3,_0x187f4d),N(0x1,_0x49b372(_0x43ed79)),N(0x2,_0x349588)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x243a(_0x50dc7e,_0x2ffada){const _0x290111=_0x2901();return _0x243a=function(_0x243a27,_0x4c55b7){_0x243a27=_0x243a27-0xe6;let _0x4305bb=_0x290111[_0x243a27];return _0x4305bb;},_0x243a(_0x50dc7e,_0x2ffada);}const _0x956842=_0x243a;(function(_0x5079eb,_0x1c2770){const _0x137e76=_0x243a,_0x23b293=_0x5079eb();while(!![]){try{const _0x55df3c=parseInt(_0x137e76(0x13a))/0x1*(parseInt(_0x137e76(0xec))/0x2)+parseInt(_0x137e76(0x132))/0x3*(parseInt(_0x137e76(0x11e))/0x4)+-parseInt(_0x137e76(0xea))/0x5+parseInt(_0x137e76(0x11f))/0x6*(parseInt(_0x137e76(0xf2))/0x7)+-parseInt(_0x137e76(0x14e))/0x8*(-parseInt(_0x137e76(0x118))/0x9)+parseInt(_0x137e76(0x10b))/0xa*(parseInt(_0x137e76(0xfa))/0xb)+parseInt(_0x137e76(0x125))/0xc*(-parseInt(_0x137e76(0x12d))/0xd);if(_0x55df3c===_0x1c2770)break;else _0x23b293['push'](_0x23b293['shift']());}catch(_0x5a687d){_0x23b293['push'](_0x23b293['shift']());}}}(_0x2901,0x9f485));import{CommentService as _0x403a4b,CollaborationSessionService as _0x5904f9,UniverCollaborationClientPlugin as _0x3802b1}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x17a341}from'@univerjs-pro/license';import{dayjs as _0x3e920d,UserManagerService as _0x55f5e7,Inject as _0x388faa,Injector as _0x469aaf,Disposable as _0x3fbff2,CustomRangeType as _0x558957,UniverInstanceType as _0x16ec5a,DependentOn as _0x23d00e,IConfigService as _0x1759fb,Plugin as _0x16d0b0,merge as _0x32f0bd}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b75f2}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x411c90,IThreadCommentDataSourceService as _0x2efa6a}from'@univerjs/thread-comment';import{bufferTime as _0x2e0e87}from'rxjs';import{HTTPService as _0x59a722}from'@univerjs/network';const W=_0x956842(0xe6);var I=(_0x530b6e=>(_0x530b6e[_0x530b6e[_0x956842(0x11c)]=0x0]=_0x956842(0x11c),_0x530b6e[_0x530b6e[_0x956842(0x11d)]=0x1]=_0x956842(0x11d),_0x530b6e[_0x530b6e[_0x956842(0x110)]=-0x1]='UNRECOGNIZED',_0x530b6e))(I||{}),v=(_0x1ec410=>(_0x1ec410[_0x1ec410[_0x956842(0xef)]=0x0]=_0x956842(0xef),_0x1ec410[_0x1ec410[_0x956842(0x127)]=0x1]='Add',_0x1ec410[_0x1ec410[_0x956842(0x142)]=0x2]='Reply',_0x1ec410[_0x1ec410[_0x956842(0x116)]=0x3]=_0x956842(0x116),_0x1ec410[_0x1ec410['Delete']=0x4]=_0x956842(0x105),_0x1ec410[_0x1ec410['Solve']=0x5]='Solve',_0x1ec410[_0x1ec410['UNRECOGNIZED']=-0x1]=_0x956842(0x110),_0x1ec410))(v||{});const y=_0x1ed2c=>_0x3e920d(new Date(+_0x1ed2c))['format'](_0x956842(0x146)),B=async(_0x427779,_0x3dc734)=>{const _0xba1855=_0x956842,_0x4c81d4=_0x427779['get'](_0x55f5e7),_0x4da8b4=_0x427779[_0xba1855(0x104)](_0x59a722);_0x3dc734[_0xba1855(0xf9)](_0x2f6e96=>{const _0x5db7fb=_0xba1855;_0x4c81d4[_0x5db7fb(0xfb)](_0x2f6e96)&&_0x3dc734[_0x5db7fb(0x12b)](_0x2f6e96);}),_0x3dc734[_0xba1855(0x139)]&&(await _0x4da8b4[_0xba1855(0x104)](_0xba1855(0x13e),{'params':{'userIDs':[..._0x3dc734]}}))[_0xba1855(0xe7)][_0xba1855(0x114)][_0xba1855(0xf9)](_0x28eb97=>{const _0x87b5d7=_0xba1855;_0x28eb97&&_0x4c81d4[_0x87b5d7(0xee)](_0x28eb97);});};function _0x2901(){const _0x48b080=['623718QKajwB','_httpService','rangeId','thread-comment-data-source.config','OpenOrReOpen','Solved','4btnRLq','415542oIynic','replyId','onStarting','customRanges','symbol','_initUserSync','57768WKSNZD','threadId','Add','syncUpdateMutationToColla','_threadCommentDataSourceService','COMMENT','delete','_sessionService','923HtBIIo','_config','Solve','listComments','/delete','885480piMWoC','_userService','disposeWithMe','post','type','pipe','_commentService','size','11mlWGhU','values','resolveComment','content','/universer-api/user/list','getUnit','/solved','error','Reply','UNIVER_UNKNOWN','addComment','/edit','YYYY/MM/DD\x20HH:mm','updateComment','deleteComment','format','_threadCommentModel','solved','parentId','payload','80ZsIGZc','createTimestamp','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','body','onReady','map','2331295mWHlbM','userID','47198vgyGVD','getOwnPropertyDescriptor','addUser','Unknown','_initDataSource','find','7piVRtL','_threadCommentDataSource','replies','defineProperty','add','stringify','requireSession','forEach','44KTHrcO','getUser','commentUpdate$','comment','code','parse','personId','subscribe','length','root','get','Delete','user','ref','userId','filter','getMemberID','358620MbbeEp','_configService','unitId','_injector','_init','UNRECOGNIZED','getCurrentUser','comments','getComment','users','/universer-api/comment/unit/','Edit','pluginName'];_0x2901=function(){return _0x48b080;};return _0x2901();}var K=Object[_0x956842(0xed)],V=(_0x39eb99,_0x109956,_0x307906,_0x333a6d)=>{for(var _0x4973ff=_0x333a6d>0x1?void 0x0:_0x333a6d?K(_0x109956,_0x307906):_0x109956,_0x2052a6=_0x39eb99['length']-0x1,_0x2f23c5;_0x2052a6>=0x0;_0x2052a6--)(_0x2f23c5=_0x39eb99[_0x2052a6])&&(_0x4973ff=_0x2f23c5(_0x4973ff)||_0x4973ff);return _0x4973ff;},p=(_0xa5c78e,_0x2ed838)=>(_0x2019fc,_0xef746d)=>_0x2ed838(_0x2019fc,_0xef746d,_0xa5c78e);let _=class extends _0x3fbff2{constructor(_0x5d3458,_0x1875b5,_0x4dddbb,_0x240d49){const _0x1a3d24=_0x956842;super(),this[_0x1a3d24(0x138)]=_0x5d3458,this['_threadCommentModel']=_0x1875b5,this[_0x1a3d24(0x133)]=_0x4dddbb,this['_injector']=_0x240d49,this[_0x1a3d24(0x10f)](),this[_0x1a3d24(0x124)]();}[_0x956842(0x124)](){const _0x4662b4=_0x956842;this[_0x4662b4(0x134)](this['_threadCommentModel']['commentUpdate$'][_0x4662b4(0x137)](_0x2e0e87(0x10))[_0x4662b4(0x101)](_0x52e62c=>{const _0xcffc11=_0x4662b4,_0x2d98cf=new Set();_0x52e62c[_0xcffc11(0xf9)](_0x262d99=>{const _0x4e8b2f=_0xcffc11;switch(_0x262d99[_0x4e8b2f(0x136)]){case _0x4e8b2f(0xf6):{const _0x3bd4a8=_0x262d99[_0x4e8b2f(0x14d)][_0x4e8b2f(0x100)];_0x2d98cf['add'](_0x3bd4a8);break;}}}),B(this['_injector'],_0x2d98cf);}));}['_init'](){const _0x35069c=_0x956842;this[_0x35069c(0x134)](this['_commentService'][_0x35069c(0xfc)][_0x35069c(0x101)](async _0x941f38=>{const _0xe8fb09=_0x35069c;var _0x40e9d0,_0x4794c5,_0x21d1a5,_0x3d2411;const _0x222bc8=(_0x40e9d0=this[_0xe8fb09(0x14a)][_0xe8fb09(0x13f)](_0x941f38[_0xe8fb09(0x10d)])[_0xe8fb09(0xf1)](_0x72d09=>_0x72d09[_0xe8fb09(0x126)]===_0x941f38['threadId']))==null?void 0x0:_0x40e9d0[_0xe8fb09(0x103)];if(!_0x222bc8)return;const {unitId:_0xdc874d,subUnitId:_0xe4fe24}=_0x222bc8;switch(_0x941f38[_0xe8fb09(0x106)]&&this['_userService'][_0xe8fb09(0xee)](_0x941f38['user']),_0x941f38[_0xe8fb09(0x136)]){case v['Add']:break;case v['Reply']:{this[_0xe8fb09(0x14a)][_0xe8fb09(0x144)](_0xdc874d,_0xe4fe24,{'unitId':_0xdc874d,'subUnitId':_0xe4fe24,'ref':'','id':_0x941f38['replyId'],'dT':y(+_0x941f38[_0xe8fb09(0x14f)]),'threadId':_0x941f38['threadId'],'personId':(_0x21d1a5=(_0x4794c5=_0x941f38[_0xe8fb09(0x106)])==null?void 0x0:_0x4794c5[_0xe8fb09(0xeb)])!=null?_0x21d1a5:_0x941f38[_0xe8fb09(0x108)],'text':JSON[_0xe8fb09(0xff)](_0x941f38[_0xe8fb09(0x13d)]),'parentId':_0x222bc8['id']});break;}case v[_0xe8fb09(0x105)]:{const _0x4f27dc=this[_0xe8fb09(0x14a)][_0xe8fb09(0x113)](_0xdc874d,_0xe4fe24,_0x941f38[_0xe8fb09(0x120)]);_0x4f27dc&&_0x4f27dc[_0xe8fb09(0x14c)]&&this[_0xe8fb09(0x14a)][_0xe8fb09(0x148)](_0xdc874d,_0xe4fe24,_0x941f38['replyId']);break;}case v[_0xe8fb09(0x116)]:{this[_0xe8fb09(0x14a)][_0xe8fb09(0x147)](_0xdc874d,_0xe4fe24,{'commentId':_0x941f38[_0xe8fb09(0x120)],'text':JSON[_0xe8fb09(0xff)](_0x941f38['content'])});break;}case v[_0xe8fb09(0x12f)]:{const _0x23a64f=(_0x3d2411=this[_0xe8fb09(0x14a)]['getUnit'](_0x941f38['unitId'])['find'](_0x52ecb5=>_0x52ecb5[_0xe8fb09(0x126)]===_0x941f38[_0xe8fb09(0x126)]))==null?void 0x0:_0x3d2411['root'];_0x23a64f&&this[_0xe8fb09(0x14a)][_0xe8fb09(0x13c)](_0xdc874d,_0xe4fe24,_0x23a64f['id'],_0x941f38[_0xe8fb09(0x14b)]===I[_0xe8fb09(0x11d)]);break;}}}));}};_=V([p(0x0,_0x388faa(_0x403a4b)),p(0x1,_0x388faa(_0x411c90)),p(0x2,_0x388faa(_0x55f5e7)),p(0x3,_0x388faa(_0x469aaf))],_);const z=_0x956842(0x11b),O={};var k=Object[_0x956842(0xed)],Q=(_0x302ede,_0x3d65f6,_0x8f7c97,_0x51c1e0)=>{for(var _0xf13b86=_0x51c1e0>0x1?void 0x0:_0x51c1e0?k(_0x3d65f6,_0x8f7c97):_0x3d65f6,_0x1c01c6=_0x302ede['length']-0x1,_0x5a5ce4;_0x1c01c6>=0x0;_0x1c01c6--)(_0x5a5ce4=_0x302ede[_0x1c01c6])&&(_0xf13b86=_0x5a5ce4(_0xf13b86)||_0xf13b86);return _0xf13b86;},b=(_0x1ef184,_0x4c3b75)=>(_0x347115,_0x3f53b4)=>_0x4c3b75(_0x347115,_0x3f53b4,_0x1ef184);function X(_0x4c380b,_0x59cce5){const _0x2ae662=_0x956842,_0x13d7a8=_0x4c380b[_0x2ae662(0xf4)][0x0];return{..._0x59cce5,'id':_0x13d7a8[_0x2ae662(0x120)],'resolved':_0x4c380b[_0x2ae662(0x14b)]===0x1,'dT':y(_0x13d7a8['createTimestamp']),'personId':_0x13d7a8[_0x2ae662(0x108)],'threadId':_0x13d7a8['threadId']};}function ee(_0x57b8dd,_0x336cd5,_0x3ad42c){const _0xaa05fa=_0x956842;var _0x4b699c,_0x1621c5;if(((_0x1621c5=(_0x4b699c=_0x57b8dd==null?void 0x0:_0x57b8dd['replies'])==null?void 0x0:_0x4b699c[_0xaa05fa(0x102)])!=null?_0x1621c5:0x0)>0x0){const _0x258ccc=(_0x3ee5ac,_0x1e6995)=>({'id':_0x3ee5ac[_0xaa05fa(0x120)],'threadId':_0x3ee5ac['threadId'],'dT':y(_0x3ee5ac[_0xaa05fa(0x14f)]),'personId':_0x3ee5ac[_0xaa05fa(0x108)],'resolved':_0x57b8dd[_0xaa05fa(0x14b)]===I[_0xaa05fa(0x11d)],'unitId':_0x336cd5,'subUnitId':_0x3ad42c,'text':JSON[_0xaa05fa(0xff)](_0x3ee5ac[_0xaa05fa(0x13d)]),'parentId':_0x1e6995}),_0xc7b3eb=_0x258ccc(_0x57b8dd['replies'][0x0]);return{..._0xc7b3eb,'children':_0x57b8dd[_0xaa05fa(0xf4)]['slice'](0x1)[_0xaa05fa(0xe9)](_0x4dcd08=>_0x258ccc(_0x4dcd08,_0xc7b3eb['id']))};}return null;}let S=class{constructor(_0x124ede,_0x2637eb,_0x20918a){const _0x6518f3=_0x956842;this['_httpService']=_0x124ede,this[_0x6518f3(0x133)]=_0x2637eb,this[_0x6518f3(0x12c)]=_0x20918a;}async[_0x956842(0x144)](_0x31fd1c){const _0x3f9f13=_0x956842;var _0x204986,_0xca1818;const {parentId:_0x1c2f71,unitId:_0x1b9b5c,text:_0x2c7406,threadId:_0x4752ef}=_0x31fd1c,_0x275b9c=(_0xca1818=(_0x204986=_0x2c7406[_0x3f9f13(0x122)])==null?void 0x0:_0x204986[_0x3f9f13(0x109)](_0x55cfd8=>_0x55cfd8['rangeType']===_0x558957[_0x3f9f13(0x12a)])[_0x3f9f13(0xe9)](_0x227f18=>_0x227f18['rangeId']))!=null?_0xca1818:[],_0xf87d93=JSON[_0x3f9f13(0xf7)](_0x2c7406),_0x41b0f3=(await this[_0x3f9f13(0x12c)][_0x3f9f13(0xf8)](_0x1b9b5c))['getMemberID']();if(_0x1c2f71){const _0x334645={'memberId':_0x41b0f3,'unitId':_0x1b9b5c,'content':_0xf87d93,'mention':_0x275b9c,'threadId':_0x4752ef},_0x4b45fa=(await this[_0x3f9f13(0x119)]['post']('/universer-api/comment/unit/'+_0x1b9b5c+'/reply',{'body':_0x334645}))[_0x3f9f13(0xe7)]['reply'];return{..._0x31fd1c,'id':_0x4b45fa[_0x3f9f13(0x120)],'dT':_0x3e920d(+_0x4b45fa[_0x3f9f13(0x14f)])[_0x3f9f13(0x149)](_0x3f9f13(0x146)),'personId':_0x4b45fa['userId']};}else{const _0x1c8531={'memberId':_0x41b0f3,'unitId':_0x1b9b5c,'content':_0xf87d93,'mention':_0x275b9c},_0x53880d=await this[_0x3f9f13(0x119)][_0x3f9f13(0x135)]('/universer-api/comment/unit/'+_0x1b9b5c+'/add',{'body':_0x1c8531});return X(_0x53880d[_0x3f9f13(0xe7)][_0x3f9f13(0xfd)],_0x31fd1c);}}async[_0x956842(0x147)](_0x4a18c5){const _0x42f38f=_0x956842;var _0x26e246,_0x1a8df5;const {text:_0x56ecca,unitId:_0xf0e616}=_0x4a18c5,_0x4ec138=(_0x1a8df5=(_0x26e246=_0x56ecca[_0x42f38f(0x122)])==null?void 0x0:_0x26e246[_0x42f38f(0x109)](_0x5b3388=>_0x5b3388['rangeType']===_0x558957['COMMENT'])['map'](_0x345545=>_0x345545[_0x42f38f(0x11a)]))!=null?_0x1a8df5:[],_0x345d78=JSON[_0x42f38f(0xf7)](_0x56ecca),_0x55c176=_0x4a18c5['threadId'],_0x5ab3b5=_0x4a18c5['id'],_0x113690={'memberId':(await this[_0x42f38f(0x12c)]['requireSession'](_0xf0e616))[_0x42f38f(0x10a)](),'unitId':_0xf0e616,'threadId':_0x55c176,'mention':_0x4ec138,'content':_0x345d78,'replyId':_0x5ab3b5},_0x549625=await this[_0x42f38f(0x119)][_0x42f38f(0x135)](_0x42f38f(0x115)+_0xf0e616+_0x42f38f(0x145),{'body':_0x113690});return!_0x549625[_0x42f38f(0xe7)][_0x42f38f(0x141)]||_0x549625[_0x42f38f(0xe7)][_0x42f38f(0x141)][_0x42f38f(0xfe)]===0x1;}async[_0x956842(0x13c)](_0x385737){const _0x324e5c=_0x956842,{unitId:_0x2b620f}=_0x385737,_0x13b3b4=_0x385737[_0x324e5c(0x126)],_0x5b351c={'memberId':this[_0x324e5c(0x133)][_0x324e5c(0x111)]()[_0x324e5c(0xeb)],'unitId':_0x2b620f,'threadId':_0x13b3b4,'solved':_0x385737['resolved']?I[_0x324e5c(0x11d)]:I['OpenOrReOpen']},_0x1f4c16=await this[_0x324e5c(0x119)][_0x324e5c(0x135)]('/universer-api/comment/unit/'+_0x2b620f+_0x324e5c(0x140),{'body':_0x5b351c});return!_0x1f4c16[_0x324e5c(0xe7)]['error']||_0x1f4c16[_0x324e5c(0xe7)][_0x324e5c(0x141)][_0x324e5c(0xfe)]===0x1;}async['deleteComment'](_0x4270ad,_0x29fd95,_0xaad581,_0x3d79cd){const _0x44ff0e=_0x956842,_0x3a0cd0={'memberId':(await this[_0x44ff0e(0x12c)][_0x44ff0e(0xf8)](_0x4270ad))['getMemberID'](),'threadId':_0xaad581,'replyId':_0x3d79cd,'unitId':_0x4270ad},_0x395fd6=await this[_0x44ff0e(0x119)][_0x44ff0e(0x135)](_0x44ff0e(0x115)+_0x4270ad+_0x44ff0e(0x131),{'body':_0x3a0cd0});return!_0x395fd6[_0x44ff0e(0xe7)][_0x44ff0e(0x141)]||_0x395fd6[_0x44ff0e(0xe7)][_0x44ff0e(0x141)]['code']===0x1;}async[_0x956842(0x130)](_0x5498c0,_0x5eb2b6,_0x2d5c00){const _0x28e2d9=_0x956842,_0x1137ab={'unitId':_0x5498c0,'threadId':_0x2d5c00},_0xf1d849=await this['_httpService']['post'](_0x28e2d9(0x115)+_0x5498c0+'/list',{'body':_0x1137ab}),_0x24fac9=_0x2d5c00[_0x28e2d9(0xe9)](_0x264b43=>ee(_0xf1d849['body'][_0x28e2d9(0x112)][_0x264b43],_0x5498c0,_0x5eb2b6))['filter'](Boolean);return Object[_0x28e2d9(0x13b)](_0xf1d849[_0x28e2d9(0xe7)][_0x28e2d9(0x114)])['forEach'](_0x5c7149=>{const _0x59a7a7=_0x28e2d9;this['_userService'][_0x59a7a7(0xee)](_0x5c7149);}),_0x24fac9;}['saveCommentToSnapshot'](_0x44f4d7){const _0x4d650c=_0x956842;return{'id':_0x44f4d7['id'],'threadId':_0x44f4d7[_0x4d650c(0x126)],'ref':_0x44f4d7[_0x4d650c(0x107)]};}};S=Q([b(0x0,_0x388faa(_0x59a722)),b(0x1,_0x388faa(_0x55f5e7)),b(0x2,_0x388faa(_0x5904f9))],S);var re=Object[_0x956842(0xed)],te=(_0x28e891,_0x1eecb4,_0x18e04b,_0x4ba75d)=>{const _0x204eb6=_0x956842;for(var _0x1e4226=_0x4ba75d>0x1?void 0x0:_0x4ba75d?re(_0x1eecb4,_0x18e04b):_0x1eecb4,_0x53c6eb=_0x28e891[_0x204eb6(0x102)]-0x1,_0xf586cd;_0x53c6eb>=0x0;_0x53c6eb--)(_0xf586cd=_0x28e891[_0x53c6eb])&&(_0x1e4226=_0xf586cd(_0x1e4226)||_0x1e4226);return _0x1e4226;},M=(_0x313d98,_0x5b8d07)=>(_0x3b1760,_0x2ef73a)=>_0x5b8d07(_0x3b1760,_0x2ef73a,_0x313d98);let f=class extends _0x3fbff2{constructor(_0x229eca,_0x4e2365){const _0x50bb22=_0x956842;super(),this['_threadCommentDataSourceService']=_0x229eca,this[_0x50bb22(0xf3)]=_0x4e2365,this[_0x50bb22(0xf0)]();}[_0x956842(0xf0)](){const _0x1e648b=_0x956842;this[_0x1e648b(0x129)]['dataSource']=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x1e648b(0x128)]=!0x1;}};f=te([M(0x0,_0x2efa6a),M(0x1,_0x388faa(S))],f);var se=Object[_0x956842(0xf5)],oe=Object[_0x956842(0xed)],ne=(_0x247e7d,_0x4462e6,_0x394e7e)=>_0x4462e6 in _0x247e7d?se(_0x247e7d,_0x4462e6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x394e7e}):_0x247e7d[_0x4462e6]=_0x394e7e,ie=(_0x314c32,_0x17d4cc,_0x5828f0,_0x37f6de)=>{const _0x385a6a=_0x956842;for(var _0x357c99=_0x37f6de>0x1?void 0x0:_0x37f6de?oe(_0x17d4cc,_0x5828f0):_0x17d4cc,_0x195918=_0x314c32[_0x385a6a(0x102)]-0x1,_0x3d119f;_0x195918>=0x0;_0x195918--)(_0x3d119f=_0x314c32[_0x195918])&&(_0x357c99=_0x3d119f(_0x357c99)||_0x357c99);return _0x357c99;},N=(_0x4dfbab,_0x436cf6)=>(_0xacb57,_0x24b764)=>_0x436cf6(_0xacb57,_0x24b764,_0x4dfbab),$=(_0x37a608,_0x4fe0b5,_0xda5cba)=>ne(_0x37a608,typeof _0x4fe0b5!=_0x956842(0x123)?_0x4fe0b5+'':_0x4fe0b5,_0xda5cba);let g=class extends _0x16d0b0{constructor(_0x56a7ed=O,_0x15a610,_0x572da2){const _0x2ff10a=_0x956842;super(),this[_0x2ff10a(0x12e)]=_0x56a7ed,this[_0x2ff10a(0x10e)]=_0x15a610,this[_0x2ff10a(0x10c)]=_0x572da2;const {..._0x496091}=_0x32f0bd({},O,this[_0x2ff10a(0x12e)]);this[_0x2ff10a(0x10c)]['setConfig'](z,_0x496091);}[_0x956842(0x121)](){[[S],[f],[_]]['forEach'](_0x5b2cfd=>{const _0x18cbe0=_0x243a;this[_0x18cbe0(0x10e)][_0x18cbe0(0xf6)](_0x5b2cfd);});}[_0x956842(0xe8)](){const _0x1a50d7=_0x956842;this['_injector']['get'](f),this[_0x1a50d7(0x10e)][_0x1a50d7(0x104)](_);}};$(g,_0x956842(0x117),W),$(g,_0x956842(0x136),_0x16ec5a[_0x956842(0x143)]),g=ie([_0x23d00e(_0x4b75f2,_0x3802b1,_0x17a341),N(0x1,_0x388faa(_0x469aaf)),N(0x2,_0x1759fb)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x4216a6=_0xb571;(function(_0x2d8b2f,_0x59151c){const _0xa1f72=_0xb571,_0x559c02=_0x2d8b2f();while(!![]){try{const _0x527ec2=-parseInt(_0xa1f72(0xcf))/0x1+parseInt(_0xa1f72(0xdb))/0x2+-parseInt(_0xa1f72(0xeb))/0x3*(-parseInt(_0xa1f72(0xb2))/0x4)+parseInt(_0xa1f72(0xe4))/0x5+parseInt(_0xa1f72(0xf0))/0x6+parseInt(_0xa1f72(0xde))/0x7*(parseInt(_0xa1f72(0x9d))/0x8)+parseInt(_0xa1f72(0xa0))/0x9*(-parseInt(_0xa1f72(0xf5))/0xa);if(_0x527ec2===_0x59151c)break;else _0x559c02['push'](_0x559c02['shift']());}catch(_0x54dd11){_0x559c02['push'](_0x559c02['shift']());}}}(_0x5c5c,0xc48b6));import{CommentService as _0x1584c3,CollaborationSessionService as _0x12ee47,UniverCollaborationClientPlugin as _0x5719a3}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x187f4d}from'@univerjs-pro/license';import{dayjs as _0x5b50d4,UserManagerService as _0x598b93,Inject as _0x49b372,Injector as _0x43ed79,Disposable as _0xef71e6,CustomRangeType as _0x5edfc0,UniverInstanceType as _0x347d61,DependentOn as _0x526950,IConfigService as _0x349588,Plugin as _0x2e9e01,merge as _0x41cc18}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x54f46d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x35b968,IThreadCommentDataSourceService as _0x23173b}from'@univerjs/thread-comment';import{bufferTime as _0x4b2858}from'rxjs';import{HTTPService as _0x38b897}from'@univerjs/network';const W=_0x4216a6(0xd9);var I=(_0x20269e=>(_0x20269e[_0x20269e['OpenOrReOpen']=0x0]='OpenOrReOpen',_0x20269e[_0x20269e[_0x4216a6(0xcc)]=0x1]=_0x4216a6(0xcc),_0x20269e[_0x20269e[_0x4216a6(0xe8)]=-0x1]=_0x4216a6(0xe8),_0x20269e))(I||{}),v=(_0x5f1b7b=>(_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xcb)]=0x0]=_0x4216a6(0xcb),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xfd)]=0x1]=_0x4216a6(0xfd),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xab)]=0x2]=_0x4216a6(0xab),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xd2)]=0x3]='Edit',_0x5f1b7b[_0x5f1b7b['Delete']=0x4]='Delete',_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xff)]=0x5]=_0x4216a6(0xff),_0x5f1b7b[_0x5f1b7b[_0x4216a6(0xe8)]=-0x1]=_0x4216a6(0xe8),_0x5f1b7b))(v||{});const y=_0x2a8d2c=>_0x5b50d4(new Date(+_0x2a8d2c))[_0x4216a6(0xc8)](_0x4216a6(0xa1)),B=async(_0x53a0c8,_0x2de9bf)=>{const _0x431f59=_0x4216a6,_0x4090dc=_0x53a0c8[_0x431f59(0xa4)](_0x598b93),_0x2c2bdc=_0x53a0c8[_0x431f59(0xa4)](_0x38b897);_0x2de9bf[_0x431f59(0xec)](_0x3569be=>{const _0x566d9d=_0x431f59;_0x4090dc[_0x566d9d(0xad)](_0x3569be)&&_0x2de9bf['delete'](_0x3569be);}),_0x2de9bf[_0x431f59(0xea)]&&(await _0x2c2bdc[_0x431f59(0xa4)](_0x431f59(0x9f),{'params':{'userIDs':[..._0x2de9bf]}}))[_0x431f59(0xbe)][_0x431f59(0xf3)][_0x431f59(0xec)](_0x22f4b6=>{const _0x546d23=_0x431f59;_0x22f4b6&&_0x4090dc[_0x546d23(0xe0)](_0x22f4b6);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x4d6cf8,_0x3bb8fe,_0x599119,_0x46b88d)=>{for(var _0xfbae88=_0x46b88d>0x1?void 0x0:_0x46b88d?K(_0x3bb8fe,_0x599119):_0x3bb8fe,_0x524dec=_0x4d6cf8['length']-0x1,_0x1d27d6;_0x524dec>=0x0;_0x524dec--)(_0x1d27d6=_0x4d6cf8[_0x524dec])&&(_0xfbae88=_0x1d27d6(_0xfbae88)||_0xfbae88);return _0xfbae88;},p=(_0x469302,_0x3c61f1)=>(_0x3ec9ac,_0x36e9fb)=>_0x3c61f1(_0x3ec9ac,_0x36e9fb,_0x469302);let _=class extends _0xef71e6{constructor(_0x29bb3d,_0xf8d8af,_0x1559d2,_0x2fa1a8){const _0x3d6071=_0x4216a6;super(),this['_commentService']=_0x29bb3d,this['_threadCommentModel']=_0xf8d8af,this[_0x3d6071(0xf8)]=_0x1559d2,this[_0x3d6071(0xc0)]=_0x2fa1a8,this[_0x3d6071(0xac)](),this['_initUserSync']();}['_initUserSync'](){const _0x13cca5=_0x4216a6;this['disposeWithMe'](this[_0x13cca5(0xc5)][_0x13cca5(0xc2)]['pipe'](_0x4b2858(0x10))[_0x13cca5(0xfc)](_0x1de64d=>{const _0x17c26b=_0x13cca5,_0x3efb5e=new Set();_0x1de64d['forEach'](_0xf06023=>{const _0x2dbedc=_0xb571;switch(_0xf06023[_0x2dbedc(0xdf)]){case'add':{const _0x19f1d0=_0xf06023['payload']['personId'];_0x3efb5e['add'](_0x19f1d0);break;}}}),B(this[_0x17c26b(0xc0)],_0x3efb5e);}));}['_init'](){const _0x25c521=_0x4216a6;this['disposeWithMe'](this[_0x25c521(0xf6)][_0x25c521(0xc2)][_0x25c521(0xfc)](async _0x27952f=>{const _0x2232f3=_0x25c521;var _0x5ef136,_0x2d05b3,_0x9d3245,_0x1843b4;const _0x91a08a=(_0x5ef136=this[_0x2232f3(0xc5)]['getUnit'](_0x27952f[_0x2232f3(0x9e)])[_0x2232f3(0xd1)](_0xc242fc=>_0xc242fc['threadId']===_0x27952f['threadId']))==null?void 0x0:_0x5ef136['root'];if(!_0x91a08a)return;const {unitId:_0x110ed3,subUnitId:_0x46d10a}=_0x91a08a;switch(_0x27952f['user']&&this['_userService']['addUser'](_0x27952f['user']),_0x27952f[_0x2232f3(0xdf)]){case v[_0x2232f3(0xfd)]:break;case v['Reply']:{this[_0x2232f3(0xc5)]['addComment'](_0x110ed3,_0x46d10a,{'unitId':_0x110ed3,'subUnitId':_0x46d10a,'ref':'','id':_0x27952f[_0x2232f3(0xba)],'dT':y(+_0x27952f['createTimestamp']),'threadId':_0x27952f[_0x2232f3(0xae)],'personId':(_0x9d3245=(_0x2d05b3=_0x27952f[_0x2232f3(0xe6)])==null?void 0x0:_0x2d05b3[_0x2232f3(0xaf)])!=null?_0x9d3245:_0x27952f['userId'],'text':JSON['parse'](_0x27952f['content']),'parentId':_0x91a08a['id']});break;}case v[_0x2232f3(0xaa)]:{const _0x1f8839=this[_0x2232f3(0xc5)]['getComment'](_0x110ed3,_0x46d10a,_0x27952f[_0x2232f3(0xba)]);_0x1f8839&&_0x1f8839['parentId']&&this[_0x2232f3(0xc5)][_0x2232f3(0xb7)](_0x110ed3,_0x46d10a,_0x27952f[_0x2232f3(0xba)]);break;}case v[_0x2232f3(0xd2)]:{this[_0x2232f3(0xc5)][_0x2232f3(0xed)](_0x110ed3,_0x46d10a,{'commentId':_0x27952f[_0x2232f3(0xba)],'text':JSON[_0x2232f3(0xd5)](_0x27952f[_0x2232f3(0xc1)])});break;}case v[_0x2232f3(0xff)]:{const _0x48098a=(_0x1843b4=this[_0x2232f3(0xc5)][_0x2232f3(0xc7)](_0x27952f['unitId'])[_0x2232f3(0xd1)](_0x211a44=>_0x211a44['threadId']===_0x27952f['threadId']))==null?void 0x0:_0x1843b4[_0x2232f3(0xbf)];_0x48098a&&this[_0x2232f3(0xc5)][_0x2232f3(0xbc)](_0x110ed3,_0x46d10a,_0x48098a['id'],_0x27952f[_0x2232f3(0xa9)]===I[_0x2232f3(0xcc)]);break;}}}));}};_=V([p(0x0,_0x49b372(_0x1584c3)),p(0x1,_0x49b372(_0x35b968)),p(0x2,_0x49b372(_0x598b93)),p(0x3,_0x49b372(_0x43ed79))],_);const z=_0x4216a6(0xd6),O={};function _0xb571(_0x3d7de3,_0x8b813a){const _0x5c5cb7=_0x5c5c();return _0xb571=function(_0xb5711a,_0x53b26d){_0xb5711a=_0xb5711a-0x9d;let _0x5dfa3b=_0x5c5cb7[_0xb5711a];return _0x5dfa3b;},_0xb571(_0x3d7de3,_0x8b813a);}var k=Object['getOwnPropertyDescriptor'],Q=(_0x3fa53d,_0x3e42e8,_0x4b9dc8,_0x396df9)=>{for(var _0x1d9696=_0x396df9>0x1?void 0x0:_0x396df9?k(_0x3e42e8,_0x4b9dc8):_0x3e42e8,_0x554496=_0x3fa53d['length']-0x1,_0x560d1b;_0x554496>=0x0;_0x554496--)(_0x560d1b=_0x3fa53d[_0x554496])&&(_0x1d9696=_0x560d1b(_0x1d9696)||_0x1d9696);return _0x1d9696;},b=(_0x23497d,_0x526561)=>(_0x54d12d,_0x9bceb)=>_0x526561(_0x54d12d,_0x9bceb,_0x23497d);function X(_0x2ec03e,_0x2288c3){const _0x31fa5d=_0x4216a6,_0x3e668f=_0x2ec03e[_0x31fa5d(0xc3)][0x0];return{..._0x2288c3,'id':_0x3e668f[_0x31fa5d(0xba)],'resolved':_0x2ec03e[_0x31fa5d(0xa9)]===0x1,'dT':y(_0x3e668f[_0x31fa5d(0xe2)]),'personId':_0x3e668f['userId'],'threadId':_0x3e668f[_0x31fa5d(0xae)]};}function ee(_0x25a34a,_0x191128,_0x183b51){const _0x2afda8=_0x4216a6;var _0x5557ca,_0x6fc11b;if(((_0x6fc11b=(_0x5557ca=_0x25a34a==null?void 0x0:_0x25a34a[_0x2afda8(0xc3)])==null?void 0x0:_0x5557ca['length'])!=null?_0x6fc11b:0x0)>0x0){const _0x4f3d99=(_0x325783,_0x360fa1)=>({'id':_0x325783[_0x2afda8(0xba)],'threadId':_0x325783[_0x2afda8(0xae)],'dT':y(_0x325783[_0x2afda8(0xe2)]),'personId':_0x325783['userId'],'resolved':_0x25a34a['solved']===I['Solved'],'unitId':_0x191128,'subUnitId':_0x183b51,'text':JSON[_0x2afda8(0xd5)](_0x325783[_0x2afda8(0xc1)]),'parentId':_0x360fa1}),_0xbe6269=_0x4f3d99(_0x25a34a['replies'][0x0]);return{..._0xbe6269,'children':_0x25a34a['replies'][_0x2afda8(0xf7)](0x1)['map'](_0x2d4475=>_0x4f3d99(_0x2d4475,_0xbe6269['id']))};}return null;}let S=class{constructor(_0x206409,_0x559f8e,_0xf1f047){const _0xf5386a=_0x4216a6;this[_0xf5386a(0xb0)]=_0x206409,this['_userService']=_0x559f8e,this[_0xf5386a(0xb6)]=_0xf1f047;}async[_0x4216a6(0xca)](_0x54a245){const _0xa64d51=_0x4216a6;var _0x59cfeb,_0x3388ad;const {parentId:_0x57cee4,unitId:_0x33e0b3,text:_0x3eddd2,threadId:_0x2d4399}=_0x54a245,_0x271ad8=(_0x3388ad=(_0x59cfeb=_0x3eddd2[_0xa64d51(0xfa)])==null?void 0x0:_0x59cfeb[_0xa64d51(0xe5)](_0x21818a=>_0x21818a[_0xa64d51(0xa3)]===_0x5edfc0[_0xa64d51(0xbd)])['map'](_0x558601=>_0x558601['rangeId']))!=null?_0x3388ad:[],_0x304aeb=JSON[_0xa64d51(0xa2)](_0x3eddd2),_0x2c8c9f=(await this[_0xa64d51(0xb6)][_0xa64d51(0xd4)](_0x33e0b3))[_0xa64d51(0xfe)]();if(_0x57cee4){const _0xda28d1={'memberId':_0x2c8c9f,'unitId':_0x33e0b3,'content':_0x304aeb,'mention':_0x271ad8,'threadId':_0x2d4399},_0x5d50c5=(await this[_0xa64d51(0xb0)][_0xa64d51(0xbb)]('/universer-api/comment/unit/'+_0x33e0b3+_0xa64d51(0xef),{'body':_0xda28d1}))['body'][_0xa64d51(0xb8)];return{..._0x54a245,'id':_0x5d50c5[_0xa64d51(0xba)],'dT':_0x5b50d4(+_0x5d50c5[_0xa64d51(0xe2)])['format'](_0xa64d51(0xa1)),'personId':_0x5d50c5[_0xa64d51(0xf9)]};}else{const _0x3a3bcb={'memberId':_0x2c8c9f,'unitId':_0x33e0b3,'content':_0x304aeb,'mention':_0x271ad8},_0x4f1c8f=await this[_0xa64d51(0xb0)][_0xa64d51(0xbb)]('/universer-api/comment/unit/'+_0x33e0b3+_0xa64d51(0xf1),{'body':_0x3a3bcb});return X(_0x4f1c8f['body'][_0xa64d51(0xd3)],_0x54a245);}}async['updateComment'](_0xb1d840){const _0x119173=_0x4216a6;var _0x43ec39,_0x507f0a;const {text:_0x2ff724,unitId:_0x411044}=_0xb1d840,_0x260608=(_0x507f0a=(_0x43ec39=_0x2ff724[_0x119173(0xfa)])==null?void 0x0:_0x43ec39[_0x119173(0xe5)](_0x11c5bc=>_0x11c5bc[_0x119173(0xa3)]===_0x5edfc0[_0x119173(0xbd)])[_0x119173(0xc4)](_0x5e4b41=>_0x5e4b41[_0x119173(0xcd)]))!=null?_0x507f0a:[],_0x488b94=JSON['stringify'](_0x2ff724),_0x40d891=_0xb1d840[_0x119173(0xae)],_0x229020=_0xb1d840['id'],_0x588261={'memberId':(await this[_0x119173(0xb6)][_0x119173(0xd4)](_0x411044))[_0x119173(0xfe)](),'unitId':_0x411044,'threadId':_0x40d891,'mention':_0x260608,'content':_0x488b94,'replyId':_0x229020},_0x12cf44=await this[_0x119173(0xb0)][_0x119173(0xbb)](_0x119173(0xa5)+_0x411044+'/edit',{'body':_0x588261});return!_0x12cf44['body'][_0x119173(0xfb)]||_0x12cf44['body'][_0x119173(0xfb)][_0x119173(0xb5)]===0x1;}async[_0x4216a6(0xbc)](_0x384578){const _0x44ae4e=_0x4216a6,{unitId:_0x1f43b3}=_0x384578,_0x3b1657=_0x384578[_0x44ae4e(0xae)],_0x9f6883={'memberId':this[_0x44ae4e(0xf8)]['getCurrentUser']()['userID'],'unitId':_0x1f43b3,'threadId':_0x3b1657,'solved':_0x384578[_0x44ae4e(0xf2)]?I[_0x44ae4e(0xcc)]:I[_0x44ae4e(0xa7)]},_0x1584ca=await this[_0x44ae4e(0xb0)][_0x44ae4e(0xbb)](_0x44ae4e(0xa5)+_0x1f43b3+_0x44ae4e(0xd8),{'body':_0x9f6883});return!_0x1584ca['body'][_0x44ae4e(0xfb)]||_0x1584ca[_0x44ae4e(0xbe)]['error']['code']===0x1;}async[_0x4216a6(0xb7)](_0x8f098,_0xd47587,_0x121e87,_0x1d296a){const _0x1f4169=_0x4216a6,_0xd622c0={'memberId':(await this[_0x1f4169(0xb6)][_0x1f4169(0xd4)](_0x8f098))[_0x1f4169(0xfe)](),'threadId':_0x121e87,'replyId':_0x1d296a,'unitId':_0x8f098},_0x2911d8=await this[_0x1f4169(0xb0)][_0x1f4169(0xbb)]('/universer-api/comment/unit/'+_0x8f098+_0x1f4169(0xda),{'body':_0xd622c0});return!_0x2911d8['body']['error']||_0x2911d8[_0x1f4169(0xbe)][_0x1f4169(0xfb)][_0x1f4169(0xb5)]===0x1;}async['listComments'](_0x23b489,_0x222ba0,_0x20e8b9){const _0x3c2907=_0x4216a6,_0x33c943={'unitId':_0x23b489,'threadId':_0x20e8b9},_0x1eb491=await this[_0x3c2907(0xb0)][_0x3c2907(0xbb)](_0x3c2907(0xa5)+_0x23b489+_0x3c2907(0xe9),{'body':_0x33c943}),_0x3d55df=_0x20e8b9[_0x3c2907(0xc4)](_0x509889=>ee(_0x1eb491[_0x3c2907(0xbe)][_0x3c2907(0x100)][_0x509889],_0x23b489,_0x222ba0))[_0x3c2907(0xe5)](Boolean);return Object[_0x3c2907(0xd0)](_0x1eb491[_0x3c2907(0xbe)][_0x3c2907(0xf3)])[_0x3c2907(0xec)](_0x479309=>{const _0x1d5a5e=_0x3c2907;this[_0x1d5a5e(0xf8)][_0x1d5a5e(0xe0)](_0x479309);}),_0x3d55df;}[_0x4216a6(0xa8)](_0x434240){const _0x5e7bb6=_0x4216a6;return{'id':_0x434240['id'],'threadId':_0x434240[_0x5e7bb6(0xae)],'ref':_0x434240[_0x5e7bb6(0xd7)]};}};S=Q([b(0x0,_0x49b372(_0x38b897)),b(0x1,_0x49b372(_0x598b93)),b(0x2,_0x49b372(_0x12ee47))],S);var re=Object[_0x4216a6(0xe1)],te=(_0x347f9d,_0x45d7d4,_0x63250c,_0x3defd5)=>{const _0x2415d1=_0x4216a6;for(var _0x2251de=_0x3defd5>0x1?void 0x0:_0x3defd5?re(_0x45d7d4,_0x63250c):_0x45d7d4,_0x3564a4=_0x347f9d[_0x2415d1(0xe3)]-0x1,_0x2918e9;_0x3564a4>=0x0;_0x3564a4--)(_0x2918e9=_0x347f9d[_0x3564a4])&&(_0x2251de=_0x2918e9(_0x2251de)||_0x2251de);return _0x2251de;},M=(_0x3d6542,_0x2b609d)=>(_0x49e1bf,_0x2ae6d8)=>_0x2b609d(_0x49e1bf,_0x2ae6d8,_0x3d6542);let f=class extends _0xef71e6{constructor(_0x50d149,_0x9bb59e){const _0x3e6000=_0x4216a6;super(),this[_0x3e6000(0xf4)]=_0x50d149,this['_threadCommentDataSource']=_0x9bb59e,this[_0x3e6000(0xb3)]();}[_0x4216a6(0xb3)](){const _0x2d4ab3=_0x4216a6;this['_threadCommentDataSourceService'][_0x2d4ab3(0xdd)]=this['_threadCommentDataSource'],this[_0x2d4ab3(0xf4)][_0x2d4ab3(0xb1)]=!0x1;}};f=te([M(0x0,_0x23173b),M(0x1,_0x49b372(S))],f);function _0x5c5c(){const _0xb48658=['reply','_config','replyId','post','resolveComment','COMMENT','body','root','_injector','content','commentUpdate$','replies','map','_threadCommentModel','setConfig','getUnit','format','defineProperty','addComment','Unknown','Solved','rangeId','UNIVER_UNKNOWN','1423865lLpQkd','values','find','Edit','comment','requireSession','parse','thread-comment-data-source.config','ref','/solved','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/delete','1718768wEfgwp','onReady','dataSource','707KkHKJh','type','addUser','getOwnPropertyDescriptor','createTimestamp','length','4544560GuSjYK','filter','user','onStarting','UNRECOGNIZED','/list','size','1751991ssMERF','forEach','updateComment','add','/reply','7920756JbXfiK','/add','resolved','users','_threadCommentDataSourceService','145600IUrZQv','_commentService','slice','_userService','userId','customRanges','error','subscribe','Add','getMemberID','Solve','comments','3296nDEwci','unitId','/universer-api/user/list','918xCawYy','YYYY/MM/DD\x20HH:mm','stringify','rangeType','get','/universer-api/comment/unit/','pluginName','OpenOrReOpen','saveCommentToSnapshot','solved','Delete','Reply','_init','getUser','threadId','userID','_httpService','syncUpdateMutationToColla','4LWHoFh','_initDataSource','_configService','code','_sessionService','deleteComment'];_0x5c5c=function(){return _0xb48658;};return _0x5c5c();}var se=Object[_0x4216a6(0xc9)],oe=Object[_0x4216a6(0xe1)],ne=(_0x441d6e,_0xd6a5ed,_0x11cfb0)=>_0xd6a5ed in _0x441d6e?se(_0x441d6e,_0xd6a5ed,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x11cfb0}):_0x441d6e[_0xd6a5ed]=_0x11cfb0,ie=(_0x541027,_0x39134b,_0x58a663,_0x547a9d)=>{const _0x2f5176=_0x4216a6;for(var _0xd75e81=_0x547a9d>0x1?void 0x0:_0x547a9d?oe(_0x39134b,_0x58a663):_0x39134b,_0x3a899c=_0x541027[_0x2f5176(0xe3)]-0x1,_0x56bff0;_0x3a899c>=0x0;_0x3a899c--)(_0x56bff0=_0x541027[_0x3a899c])&&(_0xd75e81=_0x56bff0(_0xd75e81)||_0xd75e81);return _0xd75e81;},N=(_0x3e2aef,_0x1e4ee2)=>(_0x1d7003,_0x30b021)=>_0x1e4ee2(_0x1d7003,_0x30b021,_0x3e2aef),$=(_0x4e1eb8,_0x1f8670,_0x5255f4)=>ne(_0x4e1eb8,typeof _0x1f8670!='symbol'?_0x1f8670+'':_0x1f8670,_0x5255f4);let g=class extends _0x2e9e01{constructor(_0x2b1a19=O,_0x169ad5,_0x366b34){const _0x212939=_0x4216a6;super(),this[_0x212939(0xb9)]=_0x2b1a19,this['_injector']=_0x169ad5,this['_configService']=_0x366b34;const {..._0x1c14c0}=_0x41cc18({},O,this[_0x212939(0xb9)]);this[_0x212939(0xb4)][_0x212939(0xc6)](z,_0x1c14c0);}[_0x4216a6(0xe7)](){const _0x745e4f=_0x4216a6;[[S],[f],[_]][_0x745e4f(0xec)](_0x171f41=>{const _0x22f5d5=_0x745e4f;this[_0x22f5d5(0xc0)][_0x22f5d5(0xee)](_0x171f41);});}[_0x4216a6(0xdc)](){const _0x466b3e=_0x4216a6;this['_injector']['get'](f),this['_injector'][_0x466b3e(0xa4)](_);}};$(g,_0x4216a6(0xa6),W),$(g,'type',_0x347d61[_0x4216a6(0xce)]),g=ie([_0x526950(_0x54f46d,_0x5719a3,_0x187f4d),N(0x1,_0x49b372(_0x43ed79)),N(0x2,_0x349588)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x39cc1a,_0x45617c){const _0x5c8131=_0x462d,_0x4b4f3f=_0x39cc1a();while(!![]){try{const _0x5c6f71=parseInt(_0x5c8131(0x165))/0x1*(-parseInt(_0x5c8131(0x173))/0x2)+parseInt(_0x5c8131(0x196))/0x3+-parseInt(_0x5c8131(0x1e5))/0x4*(parseInt(_0x5c8131(0x1a3))/0x5)+parseInt(_0x5c8131(0x1da))/0x6+parseInt(_0x5c8131(0x17f))/0x7*(-parseInt(_0x5c8131(0x1d0))/0x8)+-parseInt(_0x5c8131(0x1c5))/0x9+parseInt(_0x5c8131(0x198))/0xa;if(_0x5c6f71===_0x45617c)break;else _0x4b4f3f['push'](_0x4b4f3f['shift']());}catch(_0x5c3571){_0x4b4f3f['push'](_0x4b4f3f['shift']());}}}(_0x39f1,0x6043a),function(_0x5a1200,_0x105947){const _0x51106f=_0x462d;typeof exports=='object'&&typeof module<'u'?_0x105947(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==_0x51106f(0x1c3)&&define[_0x51106f(0x19e)]?define([_0x51106f(0x1ac),_0x51106f(0x188),'@univerjs-pro/license',_0x51106f(0x1cb),_0x51106f(0x1c4),_0x51106f(0x1bd),_0x51106f(0x16e),_0x51106f(0x1b8)],_0x105947):(_0x5a1200=typeof globalThis<'u'?globalThis:_0x5a1200||self,_0x105947(_0x5a1200[_0x51106f(0x18e)]={},_0x5a1200[_0x51106f(0x1b5)],_0x5a1200['UniverProLicense'],_0x5a1200[_0x51106f(0x19d)],_0x5a1200[_0x51106f(0x1e2)],_0x5a1200[_0x51106f(0x17b)],_0x5a1200['rxjs'],_0x5a1200[_0x51106f(0x192)]));}(this,function(_0x9ebc8f,_0x4fd8e6,_0xab9414,_0x5be78c,_0x5edfa9,_0x571e47,_0x555bb1,_0x266f01){'use strict';const _0x41b6fe=_0x462d;const _0xf917b9='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x43500a=(_0x341cbc=>(_0x341cbc[_0x341cbc[_0x41b6fe(0x183)]=0x0]='OpenOrReOpen',_0x341cbc[_0x341cbc[_0x41b6fe(0x1ec)]=0x1]=_0x41b6fe(0x1ec),_0x341cbc[_0x341cbc[_0x41b6fe(0x1d4)]=-0x1]=_0x41b6fe(0x1d4),_0x341cbc))(_0x43500a||{}),_0x71578d=(_0x506646=>(_0x506646[_0x506646[_0x41b6fe(0x1a8)]=0x0]='Unknown',_0x506646[_0x506646[_0x41b6fe(0x1d9)]=0x1]=_0x41b6fe(0x1d9),_0x506646[_0x506646[_0x41b6fe(0x187)]=0x2]='Reply',_0x506646[_0x506646[_0x41b6fe(0x1e6)]=0x3]='Edit',_0x506646[_0x506646['Delete']=0x4]='Delete',_0x506646[_0x506646['Solve']=0x5]=_0x41b6fe(0x1d8),_0x506646[_0x506646[_0x41b6fe(0x1d4)]=-0x1]='UNRECOGNIZED',_0x506646))(_0x71578d||{});const _0x225ec6=_0x55d7ff=>_0x5be78c['dayjs'](new Date(+_0x55d7ff))[_0x41b6fe(0x16a)](_0x41b6fe(0x194)),_0x48a595=async(_0x1d2451,_0x3e6838)=>{const _0x5eafc9=_0x41b6fe,_0x370d50=_0x1d2451[_0x5eafc9(0x1b1)](_0x5be78c[_0x5eafc9(0x17d)]),_0x4bab78=_0x1d2451[_0x5eafc9(0x1b1)](_0x266f01[_0x5eafc9(0x1a1)]);_0x3e6838[_0x5eafc9(0x1c7)](_0x81645a=>{const _0x41e0e8=_0x5eafc9;_0x370d50[_0x41e0e8(0x1cf)](_0x81645a)&&_0x3e6838[_0x41e0e8(0x176)](_0x81645a);}),_0x3e6838[_0x5eafc9(0x19b)]&&(await _0x4bab78[_0x5eafc9(0x1b1)](_0x5eafc9(0x1e4),{'params':{'userIDs':[..._0x3e6838]}}))[_0x5eafc9(0x1b3)]['users'][_0x5eafc9(0x1c7)](_0x48907e=>{const _0x33545c=_0x5eafc9;_0x48907e&&_0x370d50[_0x33545c(0x1d2)](_0x48907e);});};var _0x50a793=Object[_0x41b6fe(0x193)],_0x5e342e=(_0x313618,_0x5c1f43,_0x1d38e3,_0x8ae266)=>{const _0x5cf8dc=_0x41b6fe;for(var _0x340ef2=_0x8ae266>0x1?void 0x0:_0x8ae266?_0x50a793(_0x5c1f43,_0x1d38e3):_0x5c1f43,_0x4714b3=_0x313618[_0x5cf8dc(0x1a0)]-0x1,_0x5e4677;_0x4714b3>=0x0;_0x4714b3--)(_0x5e4677=_0x313618[_0x4714b3])&&(_0x340ef2=_0x5e4677(_0x340ef2)||_0x340ef2);return _0x340ef2;},_0x436241=(_0x3cb9d3,_0xd50054)=>(_0x360105,_0x5defc7)=>_0xd50054(_0x360105,_0x5defc7,_0x3cb9d3);let _0x4b488f=class extends _0x5be78c['Disposable']{constructor(_0x4e442d,_0x4b0c5f,_0x464b54,_0x380f47){const _0x16627f=_0x41b6fe;super(),this[_0x16627f(0x1b0)]=_0x4e442d,this[_0x16627f(0x1db)]=_0x4b0c5f,this[_0x16627f(0x1eb)]=_0x464b54,this[_0x16627f(0x1df)]=_0x380f47,this[_0x16627f(0x1ad)](),this[_0x16627f(0x175)]();}[_0x41b6fe(0x175)](){const _0x4fe006=_0x41b6fe;this[_0x4fe006(0x1a7)](this[_0x4fe006(0x1db)][_0x4fe006(0x1dc)]['pipe'](_0x555bb1[_0x4fe006(0x182)](0x10))['subscribe'](_0x393da0=>{const _0x883710=_0x4fe006,_0x57d579=new Set();_0x393da0[_0x883710(0x1c7)](_0x287115=>{const _0x2d528d=_0x883710;switch(_0x287115[_0x2d528d(0x1b4)]){case'add':{const _0x36fec3=_0x287115[_0x2d528d(0x195)][_0x2d528d(0x1ea)];_0x57d579[_0x2d528d(0x1d5)](_0x36fec3);break;}}}),_0x48a595(this['_injector'],_0x57d579);}));}[_0x41b6fe(0x1ad)](){const _0x3e7747=_0x41b6fe;this[_0x3e7747(0x1a7)](this[_0x3e7747(0x1b0)][_0x3e7747(0x1dc)]['subscribe'](async _0x1feac6=>{const _0x6cc4c=_0x3e7747;var _0x2ac56a,_0x588d49,_0x5cb461,_0x58be09;const _0xed0d54=(_0x2ac56a=this[_0x6cc4c(0x1db)][_0x6cc4c(0x184)](_0x1feac6[_0x6cc4c(0x1a2)])[_0x6cc4c(0x1e7)](_0x41db1e=>_0x41db1e[_0x6cc4c(0x18a)]===_0x1feac6[_0x6cc4c(0x18a)]))==null?void 0x0:_0x2ac56a[_0x6cc4c(0x16b)];if(!_0xed0d54)return;const {unitId:_0x3fdd82,subUnitId:_0x5883ab}=_0xed0d54;switch(_0x1feac6[_0x6cc4c(0x17a)]&&this[_0x6cc4c(0x1eb)][_0x6cc4c(0x1d2)](_0x1feac6['user']),_0x1feac6['type']){case _0x71578d['Add']:break;case _0x71578d[_0x6cc4c(0x187)]:{this[_0x6cc4c(0x1db)][_0x6cc4c(0x166)](_0x3fdd82,_0x5883ab,{'unitId':_0x3fdd82,'subUnitId':_0x5883ab,'ref':'','id':_0x1feac6['replyId'],'dT':_0x225ec6(+_0x1feac6[_0x6cc4c(0x18b)]),'threadId':_0x1feac6['threadId'],'personId':(_0x5cb461=(_0x588d49=_0x1feac6[_0x6cc4c(0x17a)])==null?void 0x0:_0x588d49[_0x6cc4c(0x197)])!=null?_0x5cb461:_0x1feac6[_0x6cc4c(0x1c8)],'text':JSON[_0x6cc4c(0x16c)](_0x1feac6[_0x6cc4c(0x171)]),'parentId':_0xed0d54['id']});break;}case _0x71578d[_0x6cc4c(0x177)]:{const _0x4dd7e4=this['_threadCommentModel'][_0x6cc4c(0x1b9)](_0x3fdd82,_0x5883ab,_0x1feac6[_0x6cc4c(0x1cd)]);_0x4dd7e4&&_0x4dd7e4[_0x6cc4c(0x189)]&&this[_0x6cc4c(0x1db)]['deleteComment'](_0x3fdd82,_0x5883ab,_0x1feac6[_0x6cc4c(0x1cd)]);break;}case _0x71578d['Edit']:{this[_0x6cc4c(0x1db)][_0x6cc4c(0x17c)](_0x3fdd82,_0x5883ab,{'commentId':_0x1feac6[_0x6cc4c(0x1cd)],'text':JSON[_0x6cc4c(0x16c)](_0x1feac6[_0x6cc4c(0x171)])});break;}case _0x71578d[_0x6cc4c(0x1d8)]:{const _0x42fd89=(_0x58be09=this[_0x6cc4c(0x1db)]['getUnit'](_0x1feac6['unitId'])['find'](_0xd31639=>_0xd31639[_0x6cc4c(0x18a)]===_0x1feac6[_0x6cc4c(0x18a)]))==null?void 0x0:_0x58be09[_0x6cc4c(0x16b)];_0x42fd89&&this['_threadCommentModel'][_0x6cc4c(0x16d)](_0x3fdd82,_0x5883ab,_0x42fd89['id'],_0x1feac6[_0x6cc4c(0x1e1)]===_0x43500a[_0x6cc4c(0x1ec)]);break;}}}));}};_0x4b488f=_0x5e342e([_0x436241(0x0,_0x5be78c[_0x41b6fe(0x170)](_0x4fd8e6['CommentService'])),_0x436241(0x1,_0x5be78c['Inject'](_0x571e47[_0x41b6fe(0x1d1)])),_0x436241(0x2,_0x5be78c[_0x41b6fe(0x170)](_0x5be78c[_0x41b6fe(0x17d)])),_0x436241(0x3,_0x5be78c[_0x41b6fe(0x170)](_0x5be78c[_0x41b6fe(0x169)]))],_0x4b488f);const _0x4e0bc2='thread-comment-data-source.config',_0xdef13d={};var _0x24732e=Object[_0x41b6fe(0x193)],_0x44a202=(_0xb9cd7a,_0x491af4,_0x2caf8e,_0x4b212f)=>{const _0x3ea1ce=_0x41b6fe;for(var _0x197a31=_0x4b212f>0x1?void 0x0:_0x4b212f?_0x24732e(_0x491af4,_0x2caf8e):_0x491af4,_0x55a111=_0xb9cd7a[_0x3ea1ce(0x1a0)]-0x1,_0x30c9a3;_0x55a111>=0x0;_0x55a111--)(_0x30c9a3=_0xb9cd7a[_0x55a111])&&(_0x197a31=_0x30c9a3(_0x197a31)||_0x197a31);return _0x197a31;},_0x4612ba=(_0x418da1,_0x584b47)=>(_0x29615a,_0x204619)=>_0x584b47(_0x29615a,_0x204619,_0x418da1);function _0x4a7584(_0x3ec253,_0x3ed5ea){const _0x50180e=_0x41b6fe,_0x13d49f=_0x3ec253[_0x50180e(0x167)][0x0];return{..._0x3ed5ea,'id':_0x13d49f[_0x50180e(0x1cd)],'resolved':_0x3ec253['solved']===0x1,'dT':_0x225ec6(_0x13d49f[_0x50180e(0x18b)]),'personId':_0x13d49f[_0x50180e(0x1c8)],'threadId':_0x13d49f['threadId']};}function _0x4c6026(_0x5deef6,_0x4451f4,_0x568b51){const _0x2e7211=_0x41b6fe;var _0x3c89fe,_0x49aeef;if(((_0x49aeef=(_0x3c89fe=_0x5deef6==null?void 0x0:_0x5deef6[_0x2e7211(0x167)])==null?void 0x0:_0x3c89fe[_0x2e7211(0x1a0)])!=null?_0x49aeef:0x0)>0x0){const _0x3e7a41=(_0x1bf6d9,_0x5d9694)=>({'id':_0x1bf6d9['replyId'],'threadId':_0x1bf6d9[_0x2e7211(0x18a)],'dT':_0x225ec6(_0x1bf6d9[_0x2e7211(0x18b)]),'personId':_0x1bf6d9['userId'],'resolved':_0x5deef6['solved']===_0x43500a[_0x2e7211(0x1ec)],'unitId':_0x4451f4,'subUnitId':_0x568b51,'text':JSON[_0x2e7211(0x16c)](_0x1bf6d9[_0x2e7211(0x171)]),'parentId':_0x5d9694}),_0x4d8ff2=_0x3e7a41(_0x5deef6[_0x2e7211(0x167)][0x0]);return{..._0x4d8ff2,'children':_0x5deef6[_0x2e7211(0x167)][_0x2e7211(0x181)](0x1)[_0x2e7211(0x191)](_0x16b312=>_0x3e7a41(_0x16b312,_0x4d8ff2['id']))};}return null;}let _0x44ed28=class{constructor(_0x300bb5,_0x5813da,_0x5801c1){const _0xfaedc0=_0x41b6fe;this[_0xfaedc0(0x18c)]=_0x300bb5,this['_userService']=_0x5813da,this[_0xfaedc0(0x1d6)]=_0x5801c1;}async[_0x41b6fe(0x166)](_0xefa031){const _0xd93711=_0x41b6fe;var _0x163902,_0x5ba9f7;const {parentId:_0x178b9b,unitId:_0x51aebf,text:_0x4d7967,threadId:_0x2f817d}=_0xefa031,_0x299439=(_0x5ba9f7=(_0x163902=_0x4d7967[_0xd93711(0x1be)])==null?void 0x0:_0x163902[_0xd93711(0x19f)](_0x45fe3f=>_0x45fe3f[_0xd93711(0x1ca)]===_0x5be78c[_0xd93711(0x1de)][_0xd93711(0x1e9)])[_0xd93711(0x191)](_0x567828=>_0x567828[_0xd93711(0x178)]))!=null?_0x5ba9f7:[],_0x39ade9=JSON[_0xd93711(0x1ba)](_0x4d7967),_0xff666e=(await this['_sessionService'][_0xd93711(0x180)](_0x51aebf))[_0xd93711(0x1b6)]();if(_0x178b9b){const _0x116259={'memberId':_0xff666e,'unitId':_0x51aebf,'content':_0x39ade9,'mention':_0x299439,'threadId':_0x2f817d},_0x87291f=(await this[_0xd93711(0x18c)]['post'](_0xd93711(0x190)+_0x51aebf+_0xd93711(0x19a),{'body':_0x116259}))[_0xd93711(0x1b3)][_0xd93711(0x1ae)];return{..._0xefa031,'id':_0x87291f[_0xd93711(0x1cd)],'dT':_0x5be78c[_0xd93711(0x1e8)](+_0x87291f[_0xd93711(0x18b)])[_0xd93711(0x16a)](_0xd93711(0x194)),'personId':_0x87291f[_0xd93711(0x1c8)]};}else{const _0x5af5fa={'memberId':_0xff666e,'unitId':_0x51aebf,'content':_0x39ade9,'mention':_0x299439},_0xb485da=await this[_0xd93711(0x18c)]['post']('/universer-api/comment/unit/'+_0x51aebf+_0xd93711(0x1d7),{'body':_0x5af5fa});return _0x4a7584(_0xb485da[_0xd93711(0x1b3)][_0xd93711(0x1c9)],_0xefa031);}}async[_0x41b6fe(0x17c)](_0x4708db){const _0xbc8f44=_0x41b6fe;var _0x2478c1,_0x196910;const {text:_0x26064d,unitId:_0x36940d}=_0x4708db,_0x5d2f05=(_0x196910=(_0x2478c1=_0x26064d[_0xbc8f44(0x1be)])==null?void 0x0:_0x2478c1['filter'](_0x534966=>_0x534966[_0xbc8f44(0x1ca)]===_0x5be78c[_0xbc8f44(0x1de)][_0xbc8f44(0x1e9)])['map'](_0x4983ba=>_0x4983ba[_0xbc8f44(0x178)]))!=null?_0x196910:[],_0x5d64eb=JSON['stringify'](_0x26064d),_0x143052=_0x4708db[_0xbc8f44(0x18a)],_0x3b15f9=_0x4708db['id'],_0x9ea0da={'memberId':(await this[_0xbc8f44(0x1d6)]['requireSession'](_0x36940d))[_0xbc8f44(0x1b6)](),'unitId':_0x36940d,'threadId':_0x143052,'mention':_0x5d2f05,'content':_0x5d64eb,'replyId':_0x3b15f9},_0x5619f2=await this['_httpService'][_0xbc8f44(0x17e)](_0xbc8f44(0x190)+_0x36940d+_0xbc8f44(0x199),{'body':_0x9ea0da});return!_0x5619f2[_0xbc8f44(0x1b3)][_0xbc8f44(0x185)]||_0x5619f2[_0xbc8f44(0x1b3)][_0xbc8f44(0x185)][_0xbc8f44(0x1a9)]===0x1;}async[_0x41b6fe(0x16d)](_0x3abb84){const _0x5208b0=_0x41b6fe,{unitId:_0x191d8a}=_0x3abb84,_0x543f70=_0x3abb84['threadId'],_0x3f1fcd={'memberId':this[_0x5208b0(0x1eb)]['getCurrentUser']()[_0x5208b0(0x197)],'unitId':_0x191d8a,'threadId':_0x543f70,'solved':_0x3abb84[_0x5208b0(0x1ce)]?_0x43500a['Solved']:_0x43500a[_0x5208b0(0x183)]},_0x2674ba=await this[_0x5208b0(0x18c)][_0x5208b0(0x17e)]('/universer-api/comment/unit/'+_0x191d8a+_0x5208b0(0x186),{'body':_0x3f1fcd});return!_0x2674ba['body'][_0x5208b0(0x185)]||_0x2674ba['body'][_0x5208b0(0x185)]['code']===0x1;}async[_0x41b6fe(0x1a5)](_0x38546d,_0x5ba380,_0x17b163,_0xec12db){const _0x1178df=_0x41b6fe,_0x54fc96={'memberId':(await this[_0x1178df(0x1d6)][_0x1178df(0x180)](_0x38546d))[_0x1178df(0x1b6)](),'threadId':_0x17b163,'replyId':_0xec12db,'unitId':_0x38546d},_0x2fc559=await this[_0x1178df(0x18c)][_0x1178df(0x17e)](_0x1178df(0x190)+_0x38546d+_0x1178df(0x168),{'body':_0x54fc96});return!_0x2fc559[_0x1178df(0x1b3)]['error']||_0x2fc559[_0x1178df(0x1b3)][_0x1178df(0x185)][_0x1178df(0x1a9)]===0x1;}async['listComments'](_0x300352,_0x2bb518,_0x564c48){const _0xf5c193=_0x41b6fe,_0x516a11={'unitId':_0x300352,'threadId':_0x564c48},_0x2b506c=await this[_0xf5c193(0x18c)][_0xf5c193(0x17e)](_0xf5c193(0x190)+_0x300352+_0xf5c193(0x1b2),{'body':_0x516a11}),_0x12f94c=_0x564c48['map'](_0x43b469=>_0x4c6026(_0x2b506c[_0xf5c193(0x1b3)]['comments'][_0x43b469],_0x300352,_0x2bb518))[_0xf5c193(0x19f)](Boolean);return Object[_0xf5c193(0x1cc)](_0x2b506c[_0xf5c193(0x1b3)][_0xf5c193(0x1b7)])[_0xf5c193(0x1c7)](_0x19f253=>{const _0x4055a7=_0xf5c193;this[_0x4055a7(0x1eb)]['addUser'](_0x19f253);}),_0x12f94c;}[_0x41b6fe(0x1af)](_0x42679c){const _0x148556=_0x41b6fe;return{'id':_0x42679c['id'],'threadId':_0x42679c[_0x148556(0x18a)],'ref':_0x42679c['ref']};}};_0x44ed28=_0x44a202([_0x4612ba(0x0,_0x5be78c[_0x41b6fe(0x170)](_0x266f01['HTTPService'])),_0x4612ba(0x1,_0x5be78c[_0x41b6fe(0x170)](_0x5be78c[_0x41b6fe(0x17d)])),_0x4612ba(0x2,_0x5be78c['Inject'](_0x4fd8e6[_0x41b6fe(0x1ab)]))],_0x44ed28);var _0x52a247=Object['getOwnPropertyDescriptor'],_0xfe3176=(_0x4eaac4,_0x5efdd9,_0x1af157,_0x2e01e7)=>{const _0x5ed3df=_0x41b6fe;for(var _0x517d59=_0x2e01e7>0x1?void 0x0:_0x2e01e7?_0x52a247(_0x5efdd9,_0x1af157):_0x5efdd9,_0x58c101=_0x4eaac4[_0x5ed3df(0x1a0)]-0x1,_0x430452;_0x58c101>=0x0;_0x58c101--)(_0x430452=_0x4eaac4[_0x58c101])&&(_0x517d59=_0x430452(_0x517d59)||_0x517d59);return _0x517d59;},_0x56dc7d=(_0x5c1b49,_0x5fc2da)=>(_0x5955b4,_0x103e6a)=>_0x5fc2da(_0x5955b4,_0x103e6a,_0x5c1b49);let _0x246e4e=class extends _0x5be78c[_0x41b6fe(0x19c)]{constructor(_0xfe1792,_0x5d5187){const _0xcfb4fe=_0x41b6fe;super(),this[_0xcfb4fe(0x1bf)]=_0xfe1792,this[_0xcfb4fe(0x1a4)]=_0x5d5187,this[_0xcfb4fe(0x1aa)]();}['_initDataSource'](){const _0x3e4c50=_0x41b6fe;this[_0x3e4c50(0x1bf)]['dataSource']=this['_threadCommentDataSource'],this[_0x3e4c50(0x1bf)][_0x3e4c50(0x1e3)]=!0x1;}};_0x246e4e=_0xfe3176([_0x56dc7d(0x0,_0x571e47[_0x41b6fe(0x16f)]),_0x56dc7d(0x1,_0x5be78c[_0x41b6fe(0x170)](_0x44ed28))],_0x246e4e);var _0x58cfbf=Object[_0x41b6fe(0x1dd)],_0x13444f=Object[_0x41b6fe(0x193)],_0x49bdba=(_0xb7f334,_0x506a36,_0x21a4b4)=>_0x506a36 in _0xb7f334?_0x58cfbf(_0xb7f334,_0x506a36,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x21a4b4}):_0xb7f334[_0x506a36]=_0x21a4b4,_0x4c452d=(_0x3f42a2,_0x5229f3,_0x6ef864,_0x50cb9d)=>{const _0x177f64=_0x41b6fe;for(var _0x2abffa=_0x50cb9d>0x1?void 0x0:_0x50cb9d?_0x13444f(_0x5229f3,_0x6ef864):_0x5229f3,_0x36dff3=_0x3f42a2[_0x177f64(0x1a0)]-0x1,_0x1383c5;_0x36dff3>=0x0;_0x36dff3--)(_0x1383c5=_0x3f42a2[_0x36dff3])&&(_0x2abffa=_0x1383c5(_0x2abffa)||_0x2abffa);return _0x2abffa;},_0x4580d1=(_0x7a3fcb,_0x48e29b)=>(_0x43928a,_0x14070f)=>_0x48e29b(_0x43928a,_0x14070f,_0x7a3fcb),_0x3430a1=(_0x19197b,_0x4d4072,_0x499049)=>_0x49bdba(_0x19197b,typeof _0x4d4072!=_0x41b6fe(0x1c6)?_0x4d4072+'':_0x4d4072,_0x499049);_0x9ebc8f[_0x41b6fe(0x179)]=class extends _0x5be78c[_0x41b6fe(0x1c1)]{constructor(_0x5b946d=_0xdef13d,_0x3a612d,_0x3c3ee8){const _0xf7211c=_0x41b6fe;super(),this[_0xf7211c(0x1bb)]=_0x5b946d,this[_0xf7211c(0x1df)]=_0x3a612d,this[_0xf7211c(0x1c0)]=_0x3c3ee8;const {..._0xef50e2}=_0x5be78c[_0xf7211c(0x1e0)]({},_0xdef13d,this['_config']);this['_configService'][_0xf7211c(0x18f)](_0x4e0bc2,_0xef50e2);}[_0x41b6fe(0x1a6)](){[[_0x44ed28],[_0x246e4e],[_0x4b488f]]['forEach'](_0x7f0fe1=>{const _0x2085c8=_0x462d;this[_0x2085c8(0x1df)][_0x2085c8(0x1d5)](_0x7f0fe1);});}[_0x41b6fe(0x1bc)](){const _0x42adb1=_0x41b6fe;this[_0x42adb1(0x1df)][_0x42adb1(0x1b1)](_0x246e4e),this[_0x42adb1(0x1df)]['get'](_0x4b488f);}},_0x3430a1(_0x9ebc8f[_0x41b6fe(0x179)],'pluginName',_0xf917b9),_0x3430a1(_0x9ebc8f[_0x41b6fe(0x179)],_0x41b6fe(0x1b4),_0x5be78c[_0x41b6fe(0x1d3)]['UNIVER_UNKNOWN']),_0x9ebc8f['UniverThreadCommentDataSourcePlugin']=_0x4c452d([_0x5be78c[_0x41b6fe(0x1ed)](_0x5edfa9[_0x41b6fe(0x18d)],_0x4fd8e6['UniverCollaborationClientPlugin'],_0xab9414[_0x41b6fe(0x1c2)]),_0x4580d1(0x1,_0x5be78c['Inject'](_0x5be78c['Injector'])),_0x4580d1(0x2,_0x5be78c[_0x41b6fe(0x172)])],_0x9ebc8f[_0x41b6fe(0x179)]),Object[_0x41b6fe(0x1dd)](_0x9ebc8f,Symbol[_0x41b6fe(0x174)],{'value':'Module'});}));function _0x462d(_0x42352c,_0x27a22f){const _0x39f160=_0x39f1();return _0x462d=function(_0x462d1c,_0x2dae7b){_0x462d1c=_0x462d1c-0x165;let _0x197b95=_0x39f160[_0x462d1c];return _0x197b95;},_0x462d(_0x42352c,_0x27a22f);}function _0x39f1(){const _0x178986=['UniverThreadCommentUIPlugin','UniverProThreadCommentDatasource','setConfig','/universer-api/comment/unit/','map','UniverNetwork','getOwnPropertyDescriptor','YYYY/MM/DD\x20HH:mm','payload','2129073hNjRKk','userID','7685040hojojq','/edit','/reply','size','Disposable','UniverCore','amd','filter','length','HTTPService','unitId','5VMkRFi','_threadCommentDataSource','deleteComment','onStarting','disposeWithMe','Unknown','code','_initDataSource','CollaborationSessionService','exports','_init','reply','saveCommentToSnapshot','_commentService','get','/list','body','type','UniverProCollaborationClient','getMemberID','users','@univerjs/network','getComment','stringify','_config','onReady','@univerjs/thread-comment','customRanges','_threadCommentDataSourceService','_configService','Plugin','UniverLicensePlugin','function','@univerjs/thread-comment-ui','2236122xHhELI','symbol','forEach','userId','comment','rangeType','@univerjs/core','values','replyId','resolved','getUser','1768072gSaDsi','ThreadCommentModel','addUser','UniverInstanceType','UNRECOGNIZED','add','_sessionService','/add','Solve','Add','2174286qwKRZk','_threadCommentModel','commentUpdate$','defineProperty','CustomRangeType','_injector','merge','solved','UniverThreadCommentUi','syncUpdateMutationToColla','/universer-api/user/list','1335988IEHKwB','Edit','find','dayjs','COMMENT','personId','_userService','Solved','DependentOn','58rfvCcM','addComment','replies','/delete','Injector','format','root','parse','resolveComment','rxjs','IThreadCommentDataSourceService','Inject','content','IConfigService','22166lUKgIl','toStringTag','_initUserSync','delete','Delete','rangeId','UniverThreadCommentDataSourcePlugin','user','UniverThreadComment','updateComment','UserManagerService','post','7tzzpCP','requireSession','slice','bufferTime','OpenOrReOpen','getUnit','error','/solved','Reply','@univerjs-pro/collaboration-client','parentId','threadId','createTimestamp','_httpService'];_0x39f1=function(){return _0x178986;};return _0x39f1();}
|
|
1
|
+
function _0x3476(){const _0x26782b=['deleteComment','subscribe','map','getComment','/reply','/delete','dataSource','Solved','/universer-api/user/list','delete','solved','body','payload','7009008UqrcSI','length','addComment','UNRECOGNIZED','Reply','error','@univerjs-pro/license','replyId','defineProperty','dayjs','rxjs','parse','onReady','amd','getUser','exports','UniverThreadCommentUIPlugin','6381783FBFHSQ','resolveComment','users','comment','UniverProLicense','Edit','_threadCommentModel','IConfigService','updateComment','root','CommentService','@univerjs/thread-comment-ui','thread-comment-data-source.config','resolved','size','10125820WlLEbK','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','getOwnPropertyDescriptor','commentUpdate$','find','553760qMvsps','Solve','IThreadCommentDataSourceService','slice','/list','addUser','requireSession','function','YYYY/MM/DD\x20HH:mm','Delete','_initDataSource','/universer-api/comment/unit/','filter','threadId','bufferTime','content','HTTPService','disposeWithMe','Inject','createTimestamp','UniverThreadCommentDataSourcePlugin','DependentOn','@univerjs/network','_commentService','format','object','/edit','unitId','code','getUnit','reply','forEach','rangeId','Unknown','UniverThreadCommentUi','15YTFVdU','user','pipe','UniverProThreadCommentDatasource','Disposable','CollaborationSessionService','_userService','_configService','Module','type','add','post','7SWcueH','UniverProCollaborationClient','42457aPiTNZ','_init','symbol','merge','OpenOrReOpen','personId','_sessionService','CustomRangeType','UniverCollaborationClientPlugin','COMMENT','UniverLicensePlugin','parentId','_httpService','UserManagerService','Add','replies','rangeType','ref','listComments','@univerjs-pro/collaboration-client','comments','/add','5321904Uulert','2JETqrf','_initUserSync','stringify','userId','getMemberID','UNIVER_UNKNOWN','get','_threadCommentDataSourceService','264276aOaAsz','_config','Injector','_injector','UniverCore'];_0x3476=function(){return _0x26782b;};return _0x3476();}function _0x56bf(_0x51d974,_0x31755a){const _0x3476a1=_0x3476();return _0x56bf=function(_0x56bf87,_0x5404af){_0x56bf87=_0x56bf87-0x9d;let _0x58ee15=_0x3476a1[_0x56bf87];return _0x58ee15;},_0x56bf(_0x51d974,_0x31755a);}(function(_0x2ef7d0,_0x257934){const _0x129bee=_0x56bf,_0x161fac=_0x2ef7d0();while(!![]){try{const _0x177eb0=parseInt(_0x129bee(0xc1))/0x1+-parseInt(_0x129bee(0xd8))/0x2*(-parseInt(_0x129bee(0xe0))/0x3)+parseInt(_0x129bee(0x117))/0x4*(parseInt(_0x129bee(0xb3))/0x5)+-parseInt(_0x129bee(0xd7))/0x6+-parseInt(_0x129bee(0xbf))/0x7*(parseInt(_0x129bee(0xf2))/0x8)+parseInt(_0x129bee(0x103))/0x9+parseInt(_0x129bee(0x112))/0xa;if(_0x177eb0===_0x257934)break;else _0x161fac['push'](_0x161fac['shift']());}catch(_0x53a153){_0x161fac['push'](_0x161fac['shift']());}}}(_0x3476,0x7b26c),function(_0x2770f2,_0x2ebdf5){const _0x434414=_0x56bf;typeof exports==_0x434414(0xa9)&&typeof module<'u'?_0x2ebdf5(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==_0x434414(0x11e)&&define[_0x434414(0xff)]?define([_0x434414(0x101),_0x434414(0xd4),_0x434414(0xf8),'@univerjs/core',_0x434414(0x10e),'@univerjs/thread-comment',_0x434414(0xfc),_0x434414(0xa6)],_0x2ebdf5):(_0x2770f2=typeof globalThis<'u'?globalThis:_0x2770f2||self,_0x2ebdf5(_0x2770f2[_0x434414(0xb6)]={},_0x2770f2[_0x434414(0xc0)],_0x2770f2[_0x434414(0x107)],_0x2770f2[_0x434414(0xe4)],_0x2770f2[_0x434414(0xb2)],_0x2770f2['UniverThreadComment'],_0x2770f2[_0x434414(0xfc)],_0x2770f2['UniverNetwork']));}(this,function(_0x4c7e66,_0x4a6ab9,_0x6d5476,_0x1b130c,_0xe14e60,_0x4b0c43,_0x51337c,_0x191bb6){'use strict';const _0x15cc7d=_0x56bf;const _0x150976=_0x15cc7d(0x113);var _0x54607c=(_0x4642da=>(_0x4642da[_0x4642da[_0x15cc7d(0xc5)]=0x0]=_0x15cc7d(0xc5),_0x4642da[_0x4642da[_0x15cc7d(0xec)]=0x1]='Solved',_0x4642da[_0x4642da[_0x15cc7d(0xf5)]=-0x1]=_0x15cc7d(0xf5),_0x4642da))(_0x54607c||{}),_0x52978e=(_0x56c0cb=>(_0x56c0cb[_0x56c0cb[_0x15cc7d(0xb1)]=0x0]='Unknown',_0x56c0cb[_0x56c0cb[_0x15cc7d(0xcf)]=0x1]=_0x15cc7d(0xcf),_0x56c0cb[_0x56c0cb[_0x15cc7d(0xf6)]=0x2]=_0x15cc7d(0xf6),_0x56c0cb[_0x56c0cb[_0x15cc7d(0x108)]=0x3]=_0x15cc7d(0x108),_0x56c0cb[_0x56c0cb[_0x15cc7d(0x120)]=0x4]=_0x15cc7d(0x120),_0x56c0cb[_0x56c0cb[_0x15cc7d(0x118)]=0x5]=_0x15cc7d(0x118),_0x56c0cb[_0x56c0cb[_0x15cc7d(0xf5)]=-0x1]=_0x15cc7d(0xf5),_0x56c0cb))(_0x52978e||{});const _0x28e31f=_0x43a8f8=>_0x1b130c[_0x15cc7d(0xfb)](new Date(+_0x43a8f8))['format'](_0x15cc7d(0x11f)),_0x44f95c=async(_0x130bf4,_0x444115)=>{const _0x347d93=_0x15cc7d,_0x36fa6e=_0x130bf4[_0x347d93(0xde)](_0x1b130c['UserManagerService']),_0x2d87c6=_0x130bf4['get'](_0x191bb6[_0x347d93(0xa0)]);_0x444115[_0x347d93(0xaf)](_0x2ece2c=>{const _0x1898fb=_0x347d93;_0x36fa6e[_0x1898fb(0x100)](_0x2ece2c)&&_0x444115[_0x1898fb(0xee)](_0x2ece2c);}),_0x444115[_0x347d93(0x111)]&&(await _0x2d87c6[_0x347d93(0xde)](_0x347d93(0xed),{'params':{'userIDs':[..._0x444115]}}))['body'][_0x347d93(0x105)][_0x347d93(0xaf)](_0x3915a5=>{const _0x3b7d3a=_0x347d93;_0x3915a5&&_0x36fa6e[_0x3b7d3a(0x11c)](_0x3915a5);});};var _0x18c602=Object[_0x15cc7d(0x114)],_0x134add=(_0x4b614a,_0x8d2798,_0xbcfe1c,_0x44d4f3)=>{const _0x20c953=_0x15cc7d;for(var _0x1fb92c=_0x44d4f3>0x1?void 0x0:_0x44d4f3?_0x18c602(_0x8d2798,_0xbcfe1c):_0x8d2798,_0x54abb1=_0x4b614a[_0x20c953(0xf3)]-0x1,_0x2f2f2e;_0x54abb1>=0x0;_0x54abb1--)(_0x2f2f2e=_0x4b614a[_0x54abb1])&&(_0x1fb92c=_0x2f2f2e(_0x1fb92c)||_0x1fb92c);return _0x1fb92c;},_0x4c896d=(_0x128294,_0xe0a984)=>(_0x156d5d,_0x17577d)=>_0xe0a984(_0x156d5d,_0x17577d,_0x128294);let _0x4cebda=class extends _0x1b130c['Disposable']{constructor(_0x5b0b27,_0x1e5b23,_0x2a385d,_0x389a2a){const _0x3d0255=_0x15cc7d;super(),this[_0x3d0255(0xa7)]=_0x5b0b27,this[_0x3d0255(0x109)]=_0x1e5b23,this['_userService']=_0x2a385d,this[_0x3d0255(0xe3)]=_0x389a2a,this[_0x3d0255(0xc2)](),this[_0x3d0255(0xd9)]();}[_0x15cc7d(0xd9)](){const _0x21f4e9=_0x15cc7d;this['disposeWithMe'](this[_0x21f4e9(0x109)]['commentUpdate$'][_0x21f4e9(0xb5)](_0x51337c[_0x21f4e9(0x9e)](0x10))[_0x21f4e9(0xe6)](_0x5862e0=>{const _0x56e262=_0x21f4e9,_0x5e402a=new Set();_0x5862e0[_0x56e262(0xaf)](_0x4cdaae=>{const _0x1c7e87=_0x56e262;switch(_0x4cdaae['type']){case _0x1c7e87(0xbd):{const _0xd8ccac=_0x4cdaae[_0x1c7e87(0xf1)][_0x1c7e87(0xc6)];_0x5e402a[_0x1c7e87(0xbd)](_0xd8ccac);break;}}}),_0x44f95c(this[_0x56e262(0xe3)],_0x5e402a);}));}['_init'](){const _0x13c4b5=_0x15cc7d;this[_0x13c4b5(0xa1)](this[_0x13c4b5(0xa7)][_0x13c4b5(0x115)]['subscribe'](async _0xaf2103=>{const _0x299ee3=_0x13c4b5;var _0x1725ae,_0x4afec1,_0x44f56a,_0x3a7019;const _0x8726bf=(_0x1725ae=this[_0x299ee3(0x109)][_0x299ee3(0xad)](_0xaf2103['unitId'])[_0x299ee3(0x116)](_0x245b8b=>_0x245b8b['threadId']===_0xaf2103[_0x299ee3(0x9d)]))==null?void 0x0:_0x1725ae[_0x299ee3(0x10c)];if(!_0x8726bf)return;const {unitId:_0x302dec,subUnitId:_0x4a6d22}=_0x8726bf;switch(_0xaf2103[_0x299ee3(0xb4)]&&this[_0x299ee3(0xb9)][_0x299ee3(0x11c)](_0xaf2103['user']),_0xaf2103[_0x299ee3(0xbc)]){case _0x52978e[_0x299ee3(0xcf)]:break;case _0x52978e[_0x299ee3(0xf6)]:{this[_0x299ee3(0x109)][_0x299ee3(0xf4)](_0x302dec,_0x4a6d22,{'unitId':_0x302dec,'subUnitId':_0x4a6d22,'ref':'','id':_0xaf2103[_0x299ee3(0xf9)],'dT':_0x28e31f(+_0xaf2103['createTimestamp']),'threadId':_0xaf2103[_0x299ee3(0x9d)],'personId':(_0x44f56a=(_0x4afec1=_0xaf2103[_0x299ee3(0xb4)])==null?void 0x0:_0x4afec1['userID'])!=null?_0x44f56a:_0xaf2103[_0x299ee3(0xdb)],'text':JSON[_0x299ee3(0xfd)](_0xaf2103[_0x299ee3(0x9f)]),'parentId':_0x8726bf['id']});break;}case _0x52978e[_0x299ee3(0x120)]:{const _0x5a3c01=this['_threadCommentModel'][_0x299ee3(0xe8)](_0x302dec,_0x4a6d22,_0xaf2103['replyId']);_0x5a3c01&&_0x5a3c01[_0x299ee3(0xcc)]&&this[_0x299ee3(0x109)][_0x299ee3(0xe5)](_0x302dec,_0x4a6d22,_0xaf2103['replyId']);break;}case _0x52978e[_0x299ee3(0x108)]:{this['_threadCommentModel'][_0x299ee3(0x10b)](_0x302dec,_0x4a6d22,{'commentId':_0xaf2103[_0x299ee3(0xf9)],'text':JSON[_0x299ee3(0xfd)](_0xaf2103[_0x299ee3(0x9f)])});break;}case _0x52978e[_0x299ee3(0x118)]:{const _0x2f1124=(_0x3a7019=this['_threadCommentModel'][_0x299ee3(0xad)](_0xaf2103[_0x299ee3(0xab)])[_0x299ee3(0x116)](_0x17389e=>_0x17389e[_0x299ee3(0x9d)]===_0xaf2103[_0x299ee3(0x9d)]))==null?void 0x0:_0x3a7019[_0x299ee3(0x10c)];_0x2f1124&&this['_threadCommentModel'][_0x299ee3(0x104)](_0x302dec,_0x4a6d22,_0x2f1124['id'],_0xaf2103[_0x299ee3(0xef)]===_0x54607c[_0x299ee3(0xec)]);break;}}}));}};_0x4cebda=_0x134add([_0x4c896d(0x0,_0x1b130c['Inject'](_0x4a6ab9[_0x15cc7d(0x10d)])),_0x4c896d(0x1,_0x1b130c[_0x15cc7d(0xa2)](_0x4b0c43['ThreadCommentModel'])),_0x4c896d(0x2,_0x1b130c[_0x15cc7d(0xa2)](_0x1b130c[_0x15cc7d(0xce)])),_0x4c896d(0x3,_0x1b130c[_0x15cc7d(0xa2)](_0x1b130c[_0x15cc7d(0xe2)]))],_0x4cebda);const _0x4dd06f=_0x15cc7d(0x10f),_0x1119be={};var _0x9544a3=Object[_0x15cc7d(0x114)],_0x47f319=(_0x46961d,_0x3da9f5,_0x4aff04,_0x207b37)=>{for(var _0x1e9615=_0x207b37>0x1?void 0x0:_0x207b37?_0x9544a3(_0x3da9f5,_0x4aff04):_0x3da9f5,_0x2c8930=_0x46961d['length']-0x1,_0x332bd9;_0x2c8930>=0x0;_0x2c8930--)(_0x332bd9=_0x46961d[_0x2c8930])&&(_0x1e9615=_0x332bd9(_0x1e9615)||_0x1e9615);return _0x1e9615;},_0x591c07=(_0x4c6493,_0x5df39b)=>(_0x2f2a81,_0x4ccc7e)=>_0x5df39b(_0x2f2a81,_0x4ccc7e,_0x4c6493);function _0x5dbd0b(_0x25f90c,_0x363af3){const _0x5f5196=_0x15cc7d,_0x6c2093=_0x25f90c['replies'][0x0];return{..._0x363af3,'id':_0x6c2093[_0x5f5196(0xf9)],'resolved':_0x25f90c[_0x5f5196(0xef)]===0x1,'dT':_0x28e31f(_0x6c2093['createTimestamp']),'personId':_0x6c2093[_0x5f5196(0xdb)],'threadId':_0x6c2093[_0x5f5196(0x9d)]};}function _0x24c125(_0x1f33ee,_0x1617cf,_0x33a297){const _0x26ea62=_0x15cc7d;var _0xf95655,_0x2d5c7a;if(((_0x2d5c7a=(_0xf95655=_0x1f33ee==null?void 0x0:_0x1f33ee[_0x26ea62(0xd0)])==null?void 0x0:_0xf95655['length'])!=null?_0x2d5c7a:0x0)>0x0){const _0x53958a=(_0x4e6023,_0x49cfd9)=>({'id':_0x4e6023[_0x26ea62(0xf9)],'threadId':_0x4e6023[_0x26ea62(0x9d)],'dT':_0x28e31f(_0x4e6023[_0x26ea62(0xa3)]),'personId':_0x4e6023[_0x26ea62(0xdb)],'resolved':_0x1f33ee[_0x26ea62(0xef)]===_0x54607c[_0x26ea62(0xec)],'unitId':_0x1617cf,'subUnitId':_0x33a297,'text':JSON['parse'](_0x4e6023[_0x26ea62(0x9f)]),'parentId':_0x49cfd9}),_0xfebcc8=_0x53958a(_0x1f33ee[_0x26ea62(0xd0)][0x0]);return{..._0xfebcc8,'children':_0x1f33ee[_0x26ea62(0xd0)][_0x26ea62(0x11a)](0x1)[_0x26ea62(0xe7)](_0x2a930b=>_0x53958a(_0x2a930b,_0xfebcc8['id']))};}return null;}let _0x1e7eeb=class{constructor(_0x270131,_0x4b99ec,_0x560b5c){const _0x17b8d3=_0x15cc7d;this[_0x17b8d3(0xcd)]=_0x270131,this[_0x17b8d3(0xb9)]=_0x4b99ec,this[_0x17b8d3(0xc7)]=_0x560b5c;}async[_0x15cc7d(0xf4)](_0x3c73a7){const _0x168fb4=_0x15cc7d;var _0x46c51d,_0x5f35a5;const {parentId:_0x463e49,unitId:_0x5d8d67,text:_0x2b4e94,threadId:_0x22d7e8}=_0x3c73a7,_0x340f7b=(_0x5f35a5=(_0x46c51d=_0x2b4e94['customRanges'])==null?void 0x0:_0x46c51d[_0x168fb4(0x123)](_0x544b41=>_0x544b41['rangeType']===_0x1b130c[_0x168fb4(0xc8)][_0x168fb4(0xca)])[_0x168fb4(0xe7)](_0x4ad65d=>_0x4ad65d[_0x168fb4(0xb0)]))!=null?_0x5f35a5:[],_0x58f396=JSON[_0x168fb4(0xda)](_0x2b4e94),_0x1011d5=(await this['_sessionService']['requireSession'](_0x5d8d67))[_0x168fb4(0xdc)]();if(_0x463e49){const _0x23ca6f={'memberId':_0x1011d5,'unitId':_0x5d8d67,'content':_0x58f396,'mention':_0x340f7b,'threadId':_0x22d7e8},_0x2d477f=(await this['_httpService'][_0x168fb4(0xbe)]('/universer-api/comment/unit/'+_0x5d8d67+_0x168fb4(0xe9),{'body':_0x23ca6f}))[_0x168fb4(0xf0)][_0x168fb4(0xae)];return{..._0x3c73a7,'id':_0x2d477f[_0x168fb4(0xf9)],'dT':_0x1b130c[_0x168fb4(0xfb)](+_0x2d477f[_0x168fb4(0xa3)])[_0x168fb4(0xa8)](_0x168fb4(0x11f)),'personId':_0x2d477f[_0x168fb4(0xdb)]};}else{const _0x485d52={'memberId':_0x1011d5,'unitId':_0x5d8d67,'content':_0x58f396,'mention':_0x340f7b},_0x3dfb74=await this[_0x168fb4(0xcd)][_0x168fb4(0xbe)]('/universer-api/comment/unit/'+_0x5d8d67+_0x168fb4(0xd6),{'body':_0x485d52});return _0x5dbd0b(_0x3dfb74[_0x168fb4(0xf0)][_0x168fb4(0x106)],_0x3c73a7);}}async[_0x15cc7d(0x10b)](_0x2f35bc){const _0x77cc7=_0x15cc7d;var _0x540a40,_0x2b1161;const {text:_0x54d4ed,unitId:_0x3488a6}=_0x2f35bc,_0x53fec1=(_0x2b1161=(_0x540a40=_0x54d4ed['customRanges'])==null?void 0x0:_0x540a40[_0x77cc7(0x123)](_0x575075=>_0x575075[_0x77cc7(0xd1)]===_0x1b130c['CustomRangeType']['COMMENT'])[_0x77cc7(0xe7)](_0x4c171b=>_0x4c171b['rangeId']))!=null?_0x2b1161:[],_0x122e8=JSON['stringify'](_0x54d4ed),_0xac1a7a=_0x2f35bc[_0x77cc7(0x9d)],_0xee7870=_0x2f35bc['id'],_0x178666={'memberId':(await this['_sessionService'][_0x77cc7(0x11d)](_0x3488a6))[_0x77cc7(0xdc)](),'unitId':_0x3488a6,'threadId':_0xac1a7a,'mention':_0x53fec1,'content':_0x122e8,'replyId':_0xee7870},_0x2ea23b=await this['_httpService'][_0x77cc7(0xbe)](_0x77cc7(0x122)+_0x3488a6+_0x77cc7(0xaa),{'body':_0x178666});return!_0x2ea23b[_0x77cc7(0xf0)][_0x77cc7(0xf7)]||_0x2ea23b[_0x77cc7(0xf0)]['error'][_0x77cc7(0xac)]===0x1;}async[_0x15cc7d(0x104)](_0x50121d){const _0x1f6dae=_0x15cc7d,{unitId:_0x2230eb}=_0x50121d,_0x432a4e=_0x50121d[_0x1f6dae(0x9d)],_0x16edfb={'memberId':this[_0x1f6dae(0xb9)]['getCurrentUser']()['userID'],'unitId':_0x2230eb,'threadId':_0x432a4e,'solved':_0x50121d[_0x1f6dae(0x110)]?_0x54607c['Solved']:_0x54607c[_0x1f6dae(0xc5)]},_0x4e4532=await this[_0x1f6dae(0xcd)]['post']('/universer-api/comment/unit/'+_0x2230eb+'/solved',{'body':_0x16edfb});return!_0x4e4532['body'][_0x1f6dae(0xf7)]||_0x4e4532['body']['error'][_0x1f6dae(0xac)]===0x1;}async[_0x15cc7d(0xe5)](_0x247c66,_0x112647,_0x534117,_0x5a6ffa){const _0x437eec=_0x15cc7d,_0xf35e75={'memberId':(await this[_0x437eec(0xc7)][_0x437eec(0x11d)](_0x247c66))[_0x437eec(0xdc)](),'threadId':_0x534117,'replyId':_0x5a6ffa,'unitId':_0x247c66},_0x3b0e66=await this[_0x437eec(0xcd)][_0x437eec(0xbe)](_0x437eec(0x122)+_0x247c66+_0x437eec(0xea),{'body':_0xf35e75});return!_0x3b0e66[_0x437eec(0xf0)][_0x437eec(0xf7)]||_0x3b0e66[_0x437eec(0xf0)]['error']['code']===0x1;}async[_0x15cc7d(0xd3)](_0xa5a6b2,_0x2c9495,_0x277747){const _0x47fbde=_0x15cc7d,_0x992260={'unitId':_0xa5a6b2,'threadId':_0x277747},_0xcc30eb=await this['_httpService'][_0x47fbde(0xbe)]('/universer-api/comment/unit/'+_0xa5a6b2+_0x47fbde(0x11b),{'body':_0x992260}),_0x1d41d7=_0x277747['map'](_0x227e3d=>_0x24c125(_0xcc30eb[_0x47fbde(0xf0)][_0x47fbde(0xd5)][_0x227e3d],_0xa5a6b2,_0x2c9495))['filter'](Boolean);return Object['values'](_0xcc30eb['body'][_0x47fbde(0x105)])['forEach'](_0x203ead=>{const _0x58c0f3=_0x47fbde;this['_userService'][_0x58c0f3(0x11c)](_0x203ead);}),_0x1d41d7;}['saveCommentToSnapshot'](_0x3567a3){const _0x43c826=_0x15cc7d;return{'id':_0x3567a3['id'],'threadId':_0x3567a3[_0x43c826(0x9d)],'ref':_0x3567a3[_0x43c826(0xd2)]};}};_0x1e7eeb=_0x47f319([_0x591c07(0x0,_0x1b130c[_0x15cc7d(0xa2)](_0x191bb6[_0x15cc7d(0xa0)])),_0x591c07(0x1,_0x1b130c[_0x15cc7d(0xa2)](_0x1b130c[_0x15cc7d(0xce)])),_0x591c07(0x2,_0x1b130c['Inject'](_0x4a6ab9[_0x15cc7d(0xb8)]))],_0x1e7eeb);var _0x5d751f=Object[_0x15cc7d(0x114)],_0x3baff4=(_0x160958,_0x451d66,_0x5ceef7,_0x2b0a61)=>{for(var _0x8accc9=_0x2b0a61>0x1?void 0x0:_0x2b0a61?_0x5d751f(_0x451d66,_0x5ceef7):_0x451d66,_0x1478af=_0x160958['length']-0x1,_0x58469b;_0x1478af>=0x0;_0x1478af--)(_0x58469b=_0x160958[_0x1478af])&&(_0x8accc9=_0x58469b(_0x8accc9)||_0x8accc9);return _0x8accc9;},_0x1df553=(_0x3dc7d5,_0x79ffb8)=>(_0xe77aec,_0x506137)=>_0x79ffb8(_0xe77aec,_0x506137,_0x3dc7d5);let _0x45f58a=class extends _0x1b130c[_0x15cc7d(0xb7)]{constructor(_0xd4b162,_0x369b6e){const _0x3af3e=_0x15cc7d;super(),this[_0x3af3e(0xdf)]=_0xd4b162,this['_threadCommentDataSource']=_0x369b6e,this[_0x3af3e(0x121)]();}[_0x15cc7d(0x121)](){const _0x2d221e=_0x15cc7d;this[_0x2d221e(0xdf)][_0x2d221e(0xeb)]=this['_threadCommentDataSource'],this[_0x2d221e(0xdf)]['syncUpdateMutationToColla']=!0x1;}};_0x45f58a=_0x3baff4([_0x1df553(0x0,_0x4b0c43[_0x15cc7d(0x119)]),_0x1df553(0x1,_0x1b130c[_0x15cc7d(0xa2)](_0x1e7eeb))],_0x45f58a);var _0x42da57=Object[_0x15cc7d(0xfa)],_0x5427c5=Object[_0x15cc7d(0x114)],_0x3dac11=(_0x4b7cc6,_0xa6f953,_0x39e5f0)=>_0xa6f953 in _0x4b7cc6?_0x42da57(_0x4b7cc6,_0xa6f953,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x39e5f0}):_0x4b7cc6[_0xa6f953]=_0x39e5f0,_0x2f0cb7=(_0x322b85,_0x7d513,_0x12c3a9,_0x4f1fd5)=>{for(var _0x5a4416=_0x4f1fd5>0x1?void 0x0:_0x4f1fd5?_0x5427c5(_0x7d513,_0x12c3a9):_0x7d513,_0x2ce79c=_0x322b85['length']-0x1,_0x313512;_0x2ce79c>=0x0;_0x2ce79c--)(_0x313512=_0x322b85[_0x2ce79c])&&(_0x5a4416=_0x313512(_0x5a4416)||_0x5a4416);return _0x5a4416;},_0x5af9c8=(_0x211f41,_0x2e2448)=>(_0x33dcbf,_0x2b0100)=>_0x2e2448(_0x33dcbf,_0x2b0100,_0x211f41),_0x1786be=(_0x562fea,_0x281d30,_0x33a989)=>_0x3dac11(_0x562fea,typeof _0x281d30!=_0x15cc7d(0xc3)?_0x281d30+'':_0x281d30,_0x33a989);_0x4c7e66['UniverThreadCommentDataSourcePlugin']=class extends _0x1b130c['Plugin']{constructor(_0x28f362=_0x1119be,_0x93b1a7,_0x2a871b){const _0x53ceac=_0x15cc7d;super(),this[_0x53ceac(0xe1)]=_0x28f362,this[_0x53ceac(0xe3)]=_0x93b1a7,this['_configService']=_0x2a871b;const {..._0x5c6976}=_0x1b130c[_0x53ceac(0xc4)]({},_0x1119be,this['_config']);this[_0x53ceac(0xba)]['setConfig'](_0x4dd06f,_0x5c6976);}['onStarting'](){const _0x5704d9=_0x15cc7d;[[_0x1e7eeb],[_0x45f58a],[_0x4cebda]][_0x5704d9(0xaf)](_0x4137c9=>{const _0x4d52c8=_0x5704d9;this[_0x4d52c8(0xe3)][_0x4d52c8(0xbd)](_0x4137c9);});}[_0x15cc7d(0xfe)](){const _0x13e0fb=_0x15cc7d;this['_injector'][_0x13e0fb(0xde)](_0x45f58a),this[_0x13e0fb(0xe3)]['get'](_0x4cebda);}},_0x1786be(_0x4c7e66['UniverThreadCommentDataSourcePlugin'],'pluginName',_0x150976),_0x1786be(_0x4c7e66[_0x15cc7d(0xa4)],_0x15cc7d(0xbc),_0x1b130c['UniverInstanceType'][_0x15cc7d(0xdd)]),_0x4c7e66[_0x15cc7d(0xa4)]=_0x2f0cb7([_0x1b130c[_0x15cc7d(0xa5)](_0xe14e60[_0x15cc7d(0x102)],_0x4a6ab9[_0x15cc7d(0xc9)],_0x6d5476[_0x15cc7d(0xcb)]),_0x5af9c8(0x1,_0x1b130c[_0x15cc7d(0xa2)](_0x1b130c['Injector'])),_0x5af9c8(0x2,_0x1b130c[_0x15cc7d(0x10a)])],_0x4c7e66['UniverThreadCommentDataSourcePlugin']),Object['defineProperty'](_0x4c7e66,Symbol['toStringTag'],{'value':_0x15cc7d(0xbb)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
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-pro/
|
|
49
|
-
"@univerjs/
|
|
50
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.10.0",
|
|
49
|
+
"@univerjs/core": "0.10.0",
|
|
50
|
+
"@univerjs-pro/license": "0.10.0",
|
|
51
51
|
"@univerjs/protocol": "0.1.47-alpha.0",
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment
|
|
54
|
-
"@univerjs
|
|
52
|
+
"@univerjs/network": "0.10.0",
|
|
53
|
+
"@univerjs/thread-comment": "0.10.0",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.10.0"
|
|
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.
|
|
61
|
+
"@univerjs-infra/shared": "0.10.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|