@univerjs-pro/thread-comment-datasource 0.10.3-nightly.202508150623 → 0.10.4
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 _0x35a5ab=_0x7193;(function(_0x577646,_0x333f60){const _0x591d94=_0x7193,_0x59d24b=_0x577646();while(!![]){try{const _0x3b92b0=parseInt(_0x591d94(0xdc))/0x1*(parseInt(_0x591d94(0xd6))/0x2)+-parseInt(_0x591d94(0xa5))/0x3*(-parseInt(_0x591d94(0xf8))/0x4)+parseInt(_0x591d94(0xfd))/0x5+parseInt(_0x591d94(0xd2))/0x6+-parseInt(_0x591d94(0xe0))/0x7+parseInt(_0x591d94(0xb6))/0x8+parseInt(_0x591d94(0xa6))/0x9*(-parseInt(_0x591d94(0xd0))/0xa);if(_0x3b92b0===_0x333f60)break;else _0x59d24b['push'](_0x59d24b['shift']());}catch(_0x1807c0){_0x59d24b['push'](_0x59d24b['shift']());}}}(_0x33a0,0x86788));Object[_0x35a5ab(0x102)](exports,Symbol[_0x35a5ab(0xbc)],{'value':_0x35a5ab(0xd9)});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=_0x35a5ab(0xfa);var I=(_0x5e53f6=>(_0x5e53f6[_0x5e53f6[_0x35a5ab(0x101)]=0x0]=_0x35a5ab(0x101),_0x5e53f6[_0x5e53f6[_0x35a5ab(0x10a)]=0x1]='Solved',_0x5e53f6[_0x5e53f6[_0x35a5ab(0xf2)]=-0x1]=_0x35a5ab(0xf2),_0x5e53f6))(I||{}),v=(_0x45d326=>(_0x45d326[_0x45d326['Unknown']=0x0]=_0x35a5ab(0x107),_0x45d326[_0x45d326[_0x35a5ab(0xee)]=0x1]=_0x35a5ab(0xee),_0x45d326[_0x45d326[_0x35a5ab(0xc5)]=0x2]=_0x35a5ab(0xc5),_0x45d326[_0x45d326[_0x35a5ab(0x103)]=0x3]=_0x35a5ab(0x103),_0x45d326[_0x45d326[_0x35a5ab(0xda)]=0x4]=_0x35a5ab(0xda),_0x45d326[_0x45d326['Solve']=0x5]='Solve',_0x45d326[_0x45d326['UNRECOGNIZED']=-0x1]=_0x35a5ab(0xf2),_0x45d326))(v||{});const f=_0x4b37dd=>c[_0x35a5ab(0xc7)](new Date(+_0x4b37dd))[_0x35a5ab(0xd7)](_0x35a5ab(0x117)),R=async(_0x124d1e,_0x161c23)=>{const _0xb85fbc=_0x35a5ab,_0x3782d4=_0x124d1e[_0xb85fbc(0x112)](c[_0xb85fbc(0xa4)]),_0x3c3b6a=_0x124d1e[_0xb85fbc(0x112)](P['HTTPService']);_0x161c23[_0xb85fbc(0x100)](_0x4b3aff=>{const _0x4b3f38=_0xb85fbc;_0x3782d4[_0x4b3f38(0xbf)](_0x4b3aff)&&_0x161c23[_0x4b3f38(0x10d)](_0x4b3aff);}),_0x161c23[_0xb85fbc(0x10b)]&&(await _0x3c3b6a[_0xb85fbc(0x112)]('/universer-api/user/list',{'params':{'userIDs':[..._0x161c23]}}))[_0xb85fbc(0xcd)][_0xb85fbc(0x106)][_0xb85fbc(0x100)](_0x391b19=>{const _0x2aca40=_0xb85fbc;_0x391b19&&_0x3782d4[_0x2aca40(0xae)](_0x391b19);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x43576b,_0x209190,_0x3fe690,_0x49c5eb)=>{const _0x350c11=_0x35a5ab;for(var _0x1b2535=_0x49c5eb>0x1?void 0x0:_0x49c5eb?$(_0x209190,_0x3fe690):_0x209190,_0x36d554=_0x43576b[_0x350c11(0x110)]-0x1,_0x3ad588;_0x36d554>=0x0;_0x36d554--)(_0x3ad588=_0x43576b[_0x36d554])&&(_0x1b2535=_0x3ad588(_0x1b2535)||_0x1b2535);return _0x1b2535;},S=(_0x387ccc,_0x1ea3ad)=>(_0xe28f64,_0x35edb5)=>_0x1ea3ad(_0xe28f64,_0x35edb5,_0x387ccc);let _=class extends c[_0x35a5ab(0x119)]{constructor(_0x468c4f,_0x57c177,_0x2771b2,_0x1e23af){const _0x50e38e=_0x35a5ab;super(),this['_commentService']=_0x468c4f,this[_0x50e38e(0xa3)]=_0x57c177,this[_0x50e38e(0xb0)]=_0x2771b2,this[_0x50e38e(0xb8)]=_0x1e23af,this[_0x50e38e(0xc8)](),this[_0x50e38e(0xaa)]();}[_0x35a5ab(0xaa)](){const _0x3dab22=_0x35a5ab;this[_0x3dab22(0xe9)](this[_0x3dab22(0xa3)]['commentUpdate$'][_0x3dab22(0xbb)](j[_0x3dab22(0xf6)](0x10))['subscribe'](_0x591f42=>{const _0x509edd=_0x3dab22,_0x112502=new Set();_0x591f42[_0x509edd(0x100)](_0x42089c=>{const _0x553d4d=_0x509edd;switch(_0x42089c[_0x553d4d(0xf0)]){case _0x553d4d(0xaf):{const _0x5c08e3=_0x42089c[_0x553d4d(0xf3)]['personId'];_0x112502['add'](_0x5c08e3);break;}}}),R(this[_0x509edd(0xb8)],_0x112502);}));}[_0x35a5ab(0xc8)](){const _0x244c17=_0x35a5ab;this['disposeWithMe'](this[_0x244c17(0x118)][_0x244c17(0x10f)][_0x244c17(0xb7)](async _0x271c8c=>{const _0x45843c=_0x244c17;var _0x74a57e,_0x242e39,_0x14e9ab,_0x20fde0;const _0x2976fb=(_0x74a57e=this[_0x45843c(0xa3)][_0x45843c(0xc9)](_0x271c8c[_0x45843c(0x109)])[_0x45843c(0x114)](_0x3492d7=>_0x3492d7[_0x45843c(0xcf)]===_0x271c8c['threadId']))==null?void 0x0:_0x74a57e[_0x45843c(0xf5)];if(!_0x2976fb)return;const {unitId:_0x1461e8,subUnitId:_0x8af43f}=_0x2976fb;switch(_0x271c8c[_0x45843c(0xfb)]&&this[_0x45843c(0xb0)]['addUser'](_0x271c8c[_0x45843c(0xfb)]),_0x271c8c[_0x45843c(0xf0)]){case v[_0x45843c(0xee)]:break;case v[_0x45843c(0xc5)]:{this[_0x45843c(0xa3)][_0x45843c(0xe3)](_0x1461e8,_0x8af43f,{'unitId':_0x1461e8,'subUnitId':_0x8af43f,'ref':'','id':_0x271c8c[_0x45843c(0xf7)],'dT':f(+_0x271c8c[_0x45843c(0xed)]),'threadId':_0x271c8c['threadId'],'personId':(_0x14e9ab=(_0x242e39=_0x271c8c['user'])==null?void 0x0:_0x242e39['userID'])!=null?_0x14e9ab:_0x271c8c[_0x45843c(0xc4)],'text':JSON[_0x45843c(0xff)](_0x271c8c['content']),'parentId':_0x2976fb['id']});break;}case v[_0x45843c(0xda)]:{const _0xa3156e=this['_threadCommentModel'][_0x45843c(0x10c)](_0x1461e8,_0x8af43f,_0x271c8c[_0x45843c(0xf7)]);_0xa3156e&&_0xa3156e[_0x45843c(0xd3)]&&this[_0x45843c(0xa3)][_0x45843c(0x108)](_0x1461e8,_0x8af43f,_0x271c8c['replyId']);break;}case v[_0x45843c(0x103)]:{this['_threadCommentModel']['updateComment'](_0x1461e8,_0x8af43f,{'commentId':_0x271c8c[_0x45843c(0xf7)],'text':JSON[_0x45843c(0xff)](_0x271c8c[_0x45843c(0x104)])});break;}case v['Solve']:{const _0x1732e1=(_0x20fde0=this[_0x45843c(0xa3)][_0x45843c(0xc9)](_0x271c8c[_0x45843c(0x109)])['find'](_0x2b83e8=>_0x2b83e8[_0x45843c(0xcf)]===_0x271c8c[_0x45843c(0xcf)]))==null?void 0x0:_0x20fde0['root'];_0x1732e1&&this[_0x45843c(0xa3)][_0x45843c(0xd8)](_0x1461e8,_0x8af43f,_0x1732e1['id'],_0x271c8c[_0x45843c(0xfc)]===I['Solved']);break;}}}));}};_=E([S(0x0,c[_0x35a5ab(0xd1)](b[_0x35a5ab(0xad)])),S(0x1,c[_0x35a5ab(0xd1)](M[_0x35a5ab(0xde)])),S(0x2,c['Inject'](c['UserManagerService'])),S(0x3,c['Inject'](c[_0x35a5ab(0xbe)]))],_);const q=_0x35a5ab(0xb2),D={};var A=Object[_0x35a5ab(0xb3)],x=(_0xc77cb2,_0x2a9c77,_0x594138,_0x3fe1f0)=>{const _0x402de4=_0x35a5ab;for(var _0x4479a0=_0x3fe1f0>0x1?void 0x0:_0x3fe1f0?A(_0x2a9c77,_0x594138):_0x2a9c77,_0x26b670=_0xc77cb2[_0x402de4(0x110)]-0x1,_0x5bbb83;_0x26b670>=0x0;_0x26b670--)(_0x5bbb83=_0xc77cb2[_0x26b670])&&(_0x4479a0=_0x5bbb83(_0x4479a0)||_0x4479a0);return _0x4479a0;},C=(_0x195134,_0x420826)=>(_0x5d1143,_0x26bffd)=>_0x420826(_0x5d1143,_0x26bffd,_0x195134);function _0x33a0(){const _0x122e8e=['commentUpdate$','length','merge','get','UniverCollaborationClientPlugin','find','UNIVER_UNKNOWN','requireSession','YYYY/MM/DD\x20HH:mm','_commentService','Disposable','DependentOn','_threadCommentDataSource','_threadCommentModel','UserManagerService','531EwCzXH','353367YVSRAA','userID','symbol','_sessionService','_initUserSync','getCurrentUser','code','CommentService','addUser','add','_userService','_configService','thread-comment-data-source.config','getOwnPropertyDescriptor','map','stringify','3885352qOwwrV','subscribe','_injector','reply','onStarting','pipe','toStringTag','_threadCommentDataSourceService','Injector','getUser','slice','resolved','values','COMMENT','userId','Reply','replies','dayjs','_init','getUnit','syncUpdateMutationToColla','post','IConfigService','body','CustomRangeType','threadId','120tMPMzD','Inject','1778646yItcMr','parentId','rangeId','HTTPService','33290SZPyDj','format','resolveComment','Module','Delete','error','6RSUOBH','comment','ThreadCommentModel','CollaborationSessionService','5824028YpPhwa','pluginName','/solved','addComment','filter','_httpService','UniverThreadCommentDataSourcePlugin','_initDataSource','UniverThreadCommentUIPlugin','disposeWithMe','IThreadCommentDataSourceService','rangeType','saveCommentToSnapshot','createTimestamp','Add','/add','type','dataSource','UNRECOGNIZED','payload','/edit','root','bufferTime','replyId','2872ecJKdx','/universer-api/comment/unit/','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','user','solved','4224430VtSLYx','/reply','parse','forEach','OpenOrReOpen','defineProperty','Edit','content','listComments','users','Unknown','deleteComment','unitId','Solved','size','getComment','delete','setConfig'];_0x33a0=function(){return _0x122e8e;};return _0x33a0();}function Y(_0x255075,_0x445970){const _0x2d5265=_0x35a5ab,_0xe9ff8=_0x255075[_0x2d5265(0xc6)][0x0];return{..._0x445970,'id':_0xe9ff8['replyId'],'resolved':_0x255075[_0x2d5265(0xfc)]===0x1,'dT':f(_0xe9ff8[_0x2d5265(0xed)]),'personId':_0xe9ff8[_0x2d5265(0xc4)],'threadId':_0xe9ff8[_0x2d5265(0xcf)]};}function G(_0x3711bc,_0x87f31c,_0x4e87e6){const _0x44634a=_0x35a5ab;var _0x22ab5c,_0x95e655;if(((_0x95e655=(_0x22ab5c=_0x3711bc==null?void 0x0:_0x3711bc[_0x44634a(0xc6)])==null?void 0x0:_0x22ab5c[_0x44634a(0x110)])!=null?_0x95e655:0x0)>0x0){const _0x48e6aa=(_0x495104,_0x367140)=>({'id':_0x495104[_0x44634a(0xf7)],'threadId':_0x495104['threadId'],'dT':f(_0x495104[_0x44634a(0xed)]),'personId':_0x495104['userId'],'resolved':_0x3711bc[_0x44634a(0xfc)]===I[_0x44634a(0x10a)],'unitId':_0x87f31c,'subUnitId':_0x4e87e6,'text':JSON[_0x44634a(0xff)](_0x495104['content']),'parentId':_0x367140}),_0x259d66=_0x48e6aa(_0x3711bc[_0x44634a(0xc6)][0x0]);return{..._0x259d66,'children':_0x3711bc['replies'][_0x44634a(0xc0)](0x1)['map'](_0xd7edc9=>_0x48e6aa(_0xd7edc9,_0x259d66['id']))};}return null;}let p=class{constructor(_0x21e3d5,_0xd8de2c,_0x3032c7){const _0x37717d=_0x35a5ab;this[_0x37717d(0xe5)]=_0x21e3d5,this[_0x37717d(0xb0)]=_0xd8de2c,this[_0x37717d(0xa9)]=_0x3032c7;}async['addComment'](_0x5877c5){const _0x1cd50e=_0x35a5ab;var _0x30a0c,_0x5e858a;const {parentId:_0x2bda05,unitId:_0x159b35,text:_0x4122fc,threadId:_0x346d17}=_0x5877c5,_0x95a6e1=(_0x5e858a=(_0x30a0c=_0x4122fc['customRanges'])==null?void 0x0:_0x30a0c[_0x1cd50e(0xe4)](_0x1eb91d=>_0x1eb91d[_0x1cd50e(0xeb)]===c['CustomRangeType'][_0x1cd50e(0xc3)])[_0x1cd50e(0xb4)](_0x1b5915=>_0x1b5915[_0x1cd50e(0xd4)]))!=null?_0x5e858a:[],_0x2240ae=JSON['stringify'](_0x4122fc),_0x3e1971=(await this[_0x1cd50e(0xa9)][_0x1cd50e(0x116)](_0x159b35))['getMemberID']();if(_0x2bda05){const _0x481e06={'memberId':_0x3e1971,'unitId':_0x159b35,'content':_0x2240ae,'mention':_0x95a6e1,'threadId':_0x346d17},_0xc39e14=(await this[_0x1cd50e(0xe5)][_0x1cd50e(0xcb)](_0x1cd50e(0xf9)+_0x159b35+_0x1cd50e(0xfe),{'body':_0x481e06}))[_0x1cd50e(0xcd)][_0x1cd50e(0xb9)];return{..._0x5877c5,'id':_0xc39e14[_0x1cd50e(0xf7)],'dT':c['dayjs'](+_0xc39e14[_0x1cd50e(0xed)])[_0x1cd50e(0xd7)](_0x1cd50e(0x117)),'personId':_0xc39e14[_0x1cd50e(0xc4)]};}else{const _0x165d3a={'memberId':_0x3e1971,'unitId':_0x159b35,'content':_0x2240ae,'mention':_0x95a6e1},_0x3810ee=await this[_0x1cd50e(0xe5)][_0x1cd50e(0xcb)](_0x1cd50e(0xf9)+_0x159b35+_0x1cd50e(0xef),{'body':_0x165d3a});return Y(_0x3810ee[_0x1cd50e(0xcd)][_0x1cd50e(0xdd)],_0x5877c5);}}async['updateComment'](_0x221d6b){const _0x209a1a=_0x35a5ab;var _0x3cc631,_0x3db8e0;const {text:_0x3be8a6,unitId:_0x5a8f50}=_0x221d6b,_0x5cc058=(_0x3db8e0=(_0x3cc631=_0x3be8a6['customRanges'])==null?void 0x0:_0x3cc631[_0x209a1a(0xe4)](_0x780ae4=>_0x780ae4[_0x209a1a(0xeb)]===c[_0x209a1a(0xce)][_0x209a1a(0xc3)])[_0x209a1a(0xb4)](_0x72502f=>_0x72502f['rangeId']))!=null?_0x3db8e0:[],_0x2818d0=JSON[_0x209a1a(0xb5)](_0x3be8a6),_0x58a3db=_0x221d6b[_0x209a1a(0xcf)],_0x168ab8=_0x221d6b['id'],_0x204976={'memberId':(await this[_0x209a1a(0xa9)][_0x209a1a(0x116)](_0x5a8f50))['getMemberID'](),'unitId':_0x5a8f50,'threadId':_0x58a3db,'mention':_0x5cc058,'content':_0x2818d0,'replyId':_0x168ab8},_0x27278e=await this[_0x209a1a(0xe5)][_0x209a1a(0xcb)](_0x209a1a(0xf9)+_0x5a8f50+_0x209a1a(0xf4),{'body':_0x204976});return!_0x27278e[_0x209a1a(0xcd)][_0x209a1a(0xdb)]||_0x27278e['body'][_0x209a1a(0xdb)][_0x209a1a(0xac)]===0x1;}async[_0x35a5ab(0xd8)](_0x3cd459){const _0x143fae=_0x35a5ab,{unitId:_0x3a830a}=_0x3cd459,_0x375696=_0x3cd459['threadId'],_0x2bde59={'memberId':this[_0x143fae(0xb0)][_0x143fae(0xab)]()[_0x143fae(0xa7)],'unitId':_0x3a830a,'threadId':_0x375696,'solved':_0x3cd459[_0x143fae(0xc1)]?I[_0x143fae(0x10a)]:I['OpenOrReOpen']},_0x37ebce=await this['_httpService'][_0x143fae(0xcb)](_0x143fae(0xf9)+_0x3a830a+_0x143fae(0xe2),{'body':_0x2bde59});return!_0x37ebce[_0x143fae(0xcd)]['error']||_0x37ebce[_0x143fae(0xcd)][_0x143fae(0xdb)]['code']===0x1;}async['deleteComment'](_0x48c307,_0x3cc5d5,_0x32d8f2,_0x5d6b5e){const _0x220eb0=_0x35a5ab,_0x2b7aff={'memberId':(await this[_0x220eb0(0xa9)][_0x220eb0(0x116)](_0x48c307))['getMemberID'](),'threadId':_0x32d8f2,'replyId':_0x5d6b5e,'unitId':_0x48c307},_0xf7d648=await this[_0x220eb0(0xe5)][_0x220eb0(0xcb)](_0x220eb0(0xf9)+_0x48c307+'/delete',{'body':_0x2b7aff});return!_0xf7d648[_0x220eb0(0xcd)][_0x220eb0(0xdb)]||_0xf7d648[_0x220eb0(0xcd)]['error']['code']===0x1;}async[_0x35a5ab(0x105)](_0xe46b2d,_0x27482d,_0x2816a0){const _0x21a80b=_0x35a5ab,_0x50292={'unitId':_0xe46b2d,'threadId':_0x2816a0},_0x17c87e=await this['_httpService'][_0x21a80b(0xcb)](_0x21a80b(0xf9)+_0xe46b2d+'/list',{'body':_0x50292}),_0x56e53c=_0x2816a0[_0x21a80b(0xb4)](_0x15c3f1=>G(_0x17c87e[_0x21a80b(0xcd)]['comments'][_0x15c3f1],_0xe46b2d,_0x27482d))['filter'](Boolean);return Object[_0x21a80b(0xc2)](_0x17c87e[_0x21a80b(0xcd)][_0x21a80b(0x106)])[_0x21a80b(0x100)](_0x3507b0=>{const _0x16fb8e=_0x21a80b;this['_userService'][_0x16fb8e(0xae)](_0x3507b0);}),_0x56e53c;}[_0x35a5ab(0xec)](_0x3fafc3){const _0x493ee9=_0x35a5ab;return{'id':_0x3fafc3['id'],'threadId':_0x3fafc3[_0x493ee9(0xcf)],'ref':_0x3fafc3['ref']};}};p=x([C(0x0,c[_0x35a5ab(0xd1)](P[_0x35a5ab(0xd5)])),C(0x1,c['Inject'](c[_0x35a5ab(0xa4)])),C(0x2,c['Inject'](b[_0x35a5ab(0xdf)]))],p);var H=Object[_0x35a5ab(0xb3)],J=(_0x3e456f,_0x5dda8d,_0x39c102,_0x5857b0)=>{const _0x2c7a32=_0x35a5ab;for(var _0x307802=_0x5857b0>0x1?void 0x0:_0x5857b0?H(_0x5dda8d,_0x39c102):_0x5dda8d,_0x4b3619=_0x3e456f[_0x2c7a32(0x110)]-0x1,_0x2df532;_0x4b3619>=0x0;_0x4b3619--)(_0x2df532=_0x3e456f[_0x4b3619])&&(_0x307802=_0x2df532(_0x307802)||_0x307802);return _0x307802;},y=(_0x33cf02,_0x7268aa)=>(_0x2091e2,_0x226f5)=>_0x7268aa(_0x2091e2,_0x226f5,_0x33cf02);function _0x7193(_0x21d612,_0x5b4dc3){const _0x33a074=_0x33a0();return _0x7193=function(_0x719345,_0x4d9a49){_0x719345=_0x719345-0xa1;let _0x4e328a=_0x33a074[_0x719345];return _0x4e328a;},_0x7193(_0x21d612,_0x5b4dc3);}let g=class extends c[_0x35a5ab(0x119)]{constructor(_0x14840c,_0xde0d3b){const _0x5427c6=_0x35a5ab;super(),this[_0x5427c6(0xbd)]=_0x14840c,this[_0x5427c6(0xa2)]=_0xde0d3b,this[_0x5427c6(0xe7)]();}[_0x35a5ab(0xe7)](){const _0x5adaf3=_0x35a5ab;this[_0x5adaf3(0xbd)][_0x5adaf3(0xf1)]=this[_0x5adaf3(0xa2)],this['_threadCommentDataSourceService'][_0x5adaf3(0xca)]=!0x1;}};g=J([y(0x0,M[_0x35a5ab(0xea)]),y(0x1,c[_0x35a5ab(0xd1)](p))],g);var F=Object[_0x35a5ab(0x102)],L=Object[_0x35a5ab(0xb3)],Z=(_0x10b622,_0x2a6a1f,_0x483a20)=>_0x2a6a1f in _0x10b622?F(_0x10b622,_0x2a6a1f,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x483a20}):_0x10b622[_0x2a6a1f]=_0x483a20,W=(_0xe2e451,_0x3275d2,_0x1bd4c2,_0x566d27)=>{const _0x43aaf6=_0x35a5ab;for(var _0x1f8cba=_0x566d27>0x1?void 0x0:_0x566d27?L(_0x3275d2,_0x1bd4c2):_0x3275d2,_0x354c49=_0xe2e451[_0x43aaf6(0x110)]-0x1,_0xf019e6;_0x354c49>=0x0;_0x354c49--)(_0xf019e6=_0xe2e451[_0x354c49])&&(_0x1f8cba=_0xf019e6(_0x1f8cba)||_0x1f8cba);return _0x1f8cba;},O=(_0x556259,_0x22386b)=>(_0x3d3c31,_0x5c9538)=>_0x22386b(_0x3d3c31,_0x5c9538,_0x556259),N=(_0x2845ab,_0x5dd455,_0x4cdc24)=>Z(_0x2845ab,typeof _0x5dd455!=_0x35a5ab(0xa8)?_0x5dd455+'':_0x5dd455,_0x4cdc24);exports[_0x35a5ab(0xe6)]=class extends c['Plugin']{constructor(_0x574cc3=D,_0x372eab,_0x4a7e7a){const _0x3d5e90=_0x35a5ab;super(),this['_config']=_0x574cc3,this[_0x3d5e90(0xb8)]=_0x372eab,this[_0x3d5e90(0xb1)]=_0x4a7e7a;const {..._0x2a5abd}=c[_0x3d5e90(0x111)]({},D,this['_config']);this['_configService'][_0x3d5e90(0x10e)](q,_0x2a5abd);}[_0x35a5ab(0xba)](){const _0x544ffa=_0x35a5ab;[[p],[g],[_]][_0x544ffa(0x100)](_0xd952d3=>{this['_injector']['add'](_0xd952d3);});}['onReady'](){const _0xa24a74=_0x35a5ab;this[_0xa24a74(0xb8)][_0xa24a74(0x112)](g),this[_0xa24a74(0xb8)]['get'](_);}},N(exports[_0x35a5ab(0xe6)],_0x35a5ab(0xe1),U),N(exports['UniverThreadCommentDataSourcePlugin'],_0x35a5ab(0xf0),c['UniverInstanceType'][_0x35a5ab(0x115)]),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x35a5ab(0xa1)](w[_0x35a5ab(0xe8)],b[_0x35a5ab(0x113)],T['UniverLicensePlugin']),O(0x1,c[_0x35a5ab(0xd1)](c[_0x35a5ab(0xbe)])),O(0x2,c[_0x35a5ab(0xcc)])],exports[_0x35a5ab(0xe6)]);
|
|
1
|
+
'use strict';const _0x160246=_0x14ee;(function(_0x7f3510,_0xc15499){const _0x3c8db8=_0x14ee,_0x4a7be3=_0x7f3510();while(!![]){try{const _0x244453=parseInt(_0x3c8db8(0x121))/0x1*(parseInt(_0x3c8db8(0x115))/0x2)+-parseInt(_0x3c8db8(0xff))/0x3+-parseInt(_0x3c8db8(0x151))/0x4+-parseInt(_0x3c8db8(0x137))/0x5*(-parseInt(_0x3c8db8(0x124))/0x6)+parseInt(_0x3c8db8(0x16b))/0x7+-parseInt(_0x3c8db8(0x12f))/0x8+-parseInt(_0x3c8db8(0xf7))/0x9*(parseInt(_0x3c8db8(0x105))/0xa);if(_0x244453===_0xc15499)break;else _0x4a7be3['push'](_0x4a7be3['shift']());}catch(_0x482d83){_0x4a7be3['push'](_0x4a7be3['shift']());}}}(_0x5966,0xc4b30));Object['defineProperty'](exports,Symbol[_0x160246(0x10c)],{'value':_0x160246(0x125)});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=_0x160246(0x148);var I=(_0x4bfd3b=>(_0x4bfd3b[_0x4bfd3b[_0x160246(0x127)]=0x0]='OpenOrReOpen',_0x4bfd3b[_0x4bfd3b[_0x160246(0x143)]=0x1]=_0x160246(0x143),_0x4bfd3b[_0x4bfd3b[_0x160246(0x141)]=-0x1]='UNRECOGNIZED',_0x4bfd3b))(I||{}),v=(_0x2fa134=>(_0x2fa134[_0x2fa134['Unknown']=0x0]=_0x160246(0x167),_0x2fa134[_0x2fa134['Add']=0x1]=_0x160246(0x112),_0x2fa134[_0x2fa134[_0x160246(0x104)]=0x2]=_0x160246(0x104),_0x2fa134[_0x2fa134[_0x160246(0x118)]=0x3]=_0x160246(0x118),_0x2fa134[_0x2fa134[_0x160246(0x153)]=0x4]='Delete',_0x2fa134[_0x2fa134[_0x160246(0x10a)]=0x5]=_0x160246(0x10a),_0x2fa134[_0x2fa134[_0x160246(0x141)]=-0x1]=_0x160246(0x141),_0x2fa134))(v||{});const f=_0x8d1d73=>c[_0x160246(0x13b)](new Date(+_0x8d1d73))[_0x160246(0x133)]('YYYY/MM/DD\x20HH:mm'),R=async(_0x16d754,_0x3f2782)=>{const _0x1b299f=_0x160246,_0x18111a=_0x16d754['get'](c[_0x1b299f(0x157)]),_0x5b099e=_0x16d754[_0x1b299f(0x11d)](P[_0x1b299f(0x11f)]);_0x3f2782[_0x1b299f(0x117)](_0x284019=>{const _0x32add5=_0x1b299f;_0x18111a[_0x32add5(0x16a)](_0x284019)&&_0x3f2782['delete'](_0x284019);}),_0x3f2782[_0x1b299f(0x146)]&&(await _0x5b099e[_0x1b299f(0x11d)](_0x1b299f(0x10b),{'params':{'userIDs':[..._0x3f2782]}}))['body'][_0x1b299f(0x136)][_0x1b299f(0x117)](_0x26ace4=>{const _0x181c96=_0x1b299f;_0x26ace4&&_0x18111a[_0x181c96(0xf6)](_0x26ace4);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x301fef,_0x1bf904,_0x12d62b,_0x470527)=>{const _0x51dbb0=_0x160246;for(var _0x80a061=_0x470527>0x1?void 0x0:_0x470527?$(_0x1bf904,_0x12d62b):_0x1bf904,_0x2a1c6b=_0x301fef[_0x51dbb0(0x14e)]-0x1,_0x2589a4;_0x2a1c6b>=0x0;_0x2a1c6b--)(_0x2589a4=_0x301fef[_0x2a1c6b])&&(_0x80a061=_0x2589a4(_0x80a061)||_0x80a061);return _0x80a061;},S=(_0x242c7d,_0x5f0004)=>(_0x225251,_0x4d1f5f)=>_0x5f0004(_0x225251,_0x4d1f5f,_0x242c7d);function _0x5966(){const _0x405089=['/delete','/universer-api/comment/unit/','Injector','length','listComments','IConfigService','6269816BVSNJs','ThreadCommentModel','Delete','COMMENT','CustomRangeType','_threadCommentDataSourceService','UserManagerService','map','userId','code','UniverThreadCommentUIPlugin','_injector','root','threadId','_commentService','defineProperty','payload','UniverLicensePlugin','_initUserSync','_userService','error','setConfig','Unknown','add','post','getUser','3934238cqaCzb','replyId','getUnit','addUser','3700287lawVRq','dataSource','_threadCommentModel','user','filter','comment','_config','UniverCollaborationClientPlugin','524286TFPInK','customRanges','UniverInstanceType','Inject','getOwnPropertyDescriptor','Reply','10whGJLz','getCurrentUser','_init','deleteComment','subscribe','Solve','/universer-api/user/list','toStringTag','onStarting','pluginName','/solved','UniverThreadCommentDataSourcePlugin','rangeType','Add','personId','_threadCommentDataSource','2SUPQqx','Disposable','forEach','Edit','find','onReady','/reply','resolved','get','solved','HTTPService','_configService','1261812NwmUbV','commentUpdate$','rangeId','30NgznJY','Module','resolveComment','OpenOrReOpen','merge','thread-comment-data-source.config','addComment','getComment','getMemberID','reply','createTimestamp','3072256qiQpbw','disposeWithMe','_sessionService','DependentOn','format','requireSession','bufferTime','users','1519225kgSVgZ','body','IThreadCommentDataSourceService','userID','dayjs','Plugin','CommentService','_httpService','stringify','YYYY/MM/DD\x20HH:mm','UNRECOGNIZED','syncUpdateMutationToColla','Solved','unitId','parse','size','type','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','replies','content'];_0x5966=function(){return _0x405089;};return _0x5966();}let _=class extends c[_0x160246(0x116)]{constructor(_0x3ea0cb,_0x32bdb1,_0x56e76b,_0x428746){const _0x13ceae=_0x160246;super(),this['_commentService']=_0x3ea0cb,this[_0x13ceae(0xf9)]=_0x32bdb1,this[_0x13ceae(0x164)]=_0x56e76b,this[_0x13ceae(0x15c)]=_0x428746,this[_0x13ceae(0x107)](),this[_0x13ceae(0x163)]();}[_0x160246(0x163)](){const _0x195e3=_0x160246;this['disposeWithMe'](this[_0x195e3(0xf9)][_0x195e3(0x122)]['pipe'](j[_0x195e3(0x135)](0x10))[_0x195e3(0x109)](_0x1021d9=>{const _0x20b88f=_0x195e3,_0x643596=new Set();_0x1021d9[_0x20b88f(0x117)](_0x48d411=>{const _0x57a260=_0x20b88f;switch(_0x48d411[_0x57a260(0x147)]){case _0x57a260(0x168):{const _0x22e78e=_0x48d411[_0x57a260(0x161)][_0x57a260(0x113)];_0x643596[_0x57a260(0x168)](_0x22e78e);break;}}}),R(this[_0x20b88f(0x15c)],_0x643596);}));}[_0x160246(0x107)](){const _0x1304ea=_0x160246;this[_0x1304ea(0x130)](this[_0x1304ea(0x15f)][_0x1304ea(0x122)][_0x1304ea(0x109)](async _0x402da2=>{const _0x2c4b1f=_0x1304ea;var _0x753108,_0x12395b,_0x4d6f6a,_0x4575a1;const _0x1b5e44=(_0x753108=this['_threadCommentModel'][_0x2c4b1f(0xf5)](_0x402da2[_0x2c4b1f(0x144)])[_0x2c4b1f(0x119)](_0x2ca21e=>_0x2ca21e['threadId']===_0x402da2[_0x2c4b1f(0x15e)]))==null?void 0x0:_0x753108['root'];if(!_0x1b5e44)return;const {unitId:_0x134023,subUnitId:_0x149572}=_0x1b5e44;switch(_0x402da2[_0x2c4b1f(0xfa)]&&this[_0x2c4b1f(0x164)][_0x2c4b1f(0xf6)](_0x402da2[_0x2c4b1f(0xfa)]),_0x402da2[_0x2c4b1f(0x147)]){case v[_0x2c4b1f(0x112)]:break;case v[_0x2c4b1f(0x104)]:{this['_threadCommentModel'][_0x2c4b1f(0x12a)](_0x134023,_0x149572,{'unitId':_0x134023,'subUnitId':_0x149572,'ref':'','id':_0x402da2[_0x2c4b1f(0x16c)],'dT':f(+_0x402da2[_0x2c4b1f(0x12e)]),'threadId':_0x402da2[_0x2c4b1f(0x15e)],'personId':(_0x4d6f6a=(_0x12395b=_0x402da2[_0x2c4b1f(0xfa)])==null?void 0x0:_0x12395b[_0x2c4b1f(0x13a)])!=null?_0x4d6f6a:_0x402da2[_0x2c4b1f(0x159)],'text':JSON[_0x2c4b1f(0x145)](_0x402da2[_0x2c4b1f(0x14a)]),'parentId':_0x1b5e44['id']});break;}case v[_0x2c4b1f(0x153)]:{const _0x2ead06=this['_threadCommentModel'][_0x2c4b1f(0x12b)](_0x134023,_0x149572,_0x402da2[_0x2c4b1f(0x16c)]);_0x2ead06&&_0x2ead06['parentId']&&this['_threadCommentModel'][_0x2c4b1f(0x108)](_0x134023,_0x149572,_0x402da2[_0x2c4b1f(0x16c)]);break;}case v[_0x2c4b1f(0x118)]:{this[_0x2c4b1f(0xf9)]['updateComment'](_0x134023,_0x149572,{'commentId':_0x402da2[_0x2c4b1f(0x16c)],'text':JSON[_0x2c4b1f(0x145)](_0x402da2[_0x2c4b1f(0x14a)])});break;}case v[_0x2c4b1f(0x10a)]:{const _0x4df749=(_0x4575a1=this[_0x2c4b1f(0xf9)][_0x2c4b1f(0xf5)](_0x402da2[_0x2c4b1f(0x144)])[_0x2c4b1f(0x119)](_0x4fc042=>_0x4fc042[_0x2c4b1f(0x15e)]===_0x402da2['threadId']))==null?void 0x0:_0x4575a1[_0x2c4b1f(0x15d)];_0x4df749&&this['_threadCommentModel'][_0x2c4b1f(0x126)](_0x134023,_0x149572,_0x4df749['id'],_0x402da2['solved']===I[_0x2c4b1f(0x143)]);break;}}}));}};_=E([S(0x0,c[_0x160246(0x102)](b[_0x160246(0x13d)])),S(0x1,c[_0x160246(0x102)](M[_0x160246(0x152)])),S(0x2,c[_0x160246(0x102)](c[_0x160246(0x157)])),S(0x3,c[_0x160246(0x102)](c[_0x160246(0x14d)]))],_);const q=_0x160246(0x129),D={};var A=Object[_0x160246(0x103)],x=(_0x1ec01f,_0xc38319,_0x169307,_0x5e68c3)=>{const _0xdebd9b=_0x160246;for(var _0x307573=_0x5e68c3>0x1?void 0x0:_0x5e68c3?A(_0xc38319,_0x169307):_0xc38319,_0x2a5695=_0x1ec01f[_0xdebd9b(0x14e)]-0x1,_0x2512fb;_0x2a5695>=0x0;_0x2a5695--)(_0x2512fb=_0x1ec01f[_0x2a5695])&&(_0x307573=_0x2512fb(_0x307573)||_0x307573);return _0x307573;},C=(_0x4c2b06,_0x40bcb8)=>(_0x87b131,_0x36de04)=>_0x40bcb8(_0x87b131,_0x36de04,_0x4c2b06);function Y(_0x570d27,_0x39bf6b){const _0x2b7c70=_0x160246,_0x32463f=_0x570d27[_0x2b7c70(0x149)][0x0];return{..._0x39bf6b,'id':_0x32463f[_0x2b7c70(0x16c)],'resolved':_0x570d27[_0x2b7c70(0x11e)]===0x1,'dT':f(_0x32463f[_0x2b7c70(0x12e)]),'personId':_0x32463f[_0x2b7c70(0x159)],'threadId':_0x32463f['threadId']};}function G(_0x16b94f,_0x554507,_0x3c79c1){const _0x28468e=_0x160246;var _0x50fef3,_0x1a48c0;if(((_0x1a48c0=(_0x50fef3=_0x16b94f==null?void 0x0:_0x16b94f[_0x28468e(0x149)])==null?void 0x0:_0x50fef3[_0x28468e(0x14e)])!=null?_0x1a48c0:0x0)>0x0){const _0x622544=(_0x3d1ba6,_0x3e2b1c)=>({'id':_0x3d1ba6[_0x28468e(0x16c)],'threadId':_0x3d1ba6['threadId'],'dT':f(_0x3d1ba6[_0x28468e(0x12e)]),'personId':_0x3d1ba6[_0x28468e(0x159)],'resolved':_0x16b94f['solved']===I['Solved'],'unitId':_0x554507,'subUnitId':_0x3c79c1,'text':JSON[_0x28468e(0x145)](_0x3d1ba6['content']),'parentId':_0x3e2b1c}),_0x272e06=_0x622544(_0x16b94f[_0x28468e(0x149)][0x0]);return{..._0x272e06,'children':_0x16b94f['replies']['slice'](0x1)[_0x28468e(0x158)](_0x34207f=>_0x622544(_0x34207f,_0x272e06['id']))};}return null;}let p=class{constructor(_0x27ddbd,_0xbc92a3,_0x49c3eb){const _0x2c19f0=_0x160246;this[_0x2c19f0(0x13e)]=_0x27ddbd,this[_0x2c19f0(0x164)]=_0xbc92a3,this[_0x2c19f0(0x131)]=_0x49c3eb;}async[_0x160246(0x12a)](_0x56da60){const _0xe59f3e=_0x160246;var _0x1003cc,_0x5e12d9;const {parentId:_0x3f8470,unitId:_0x4ae093,text:_0x16b997,threadId:_0x581270}=_0x56da60,_0x457696=(_0x5e12d9=(_0x1003cc=_0x16b997[_0xe59f3e(0x100)])==null?void 0x0:_0x1003cc[_0xe59f3e(0xfb)](_0x27b806=>_0x27b806[_0xe59f3e(0x111)]===c[_0xe59f3e(0x155)][_0xe59f3e(0x154)])[_0xe59f3e(0x158)](_0x357565=>_0x357565[_0xe59f3e(0x123)]))!=null?_0x5e12d9:[],_0x449f9d=JSON[_0xe59f3e(0x13f)](_0x16b997),_0x39811f=(await this[_0xe59f3e(0x131)][_0xe59f3e(0x134)](_0x4ae093))['getMemberID']();if(_0x3f8470){const _0x388c66={'memberId':_0x39811f,'unitId':_0x4ae093,'content':_0x449f9d,'mention':_0x457696,'threadId':_0x581270},_0x4632fc=(await this[_0xe59f3e(0x13e)][_0xe59f3e(0x169)](_0xe59f3e(0x14c)+_0x4ae093+_0xe59f3e(0x11b),{'body':_0x388c66}))['body'][_0xe59f3e(0x12d)];return{..._0x56da60,'id':_0x4632fc[_0xe59f3e(0x16c)],'dT':c[_0xe59f3e(0x13b)](+_0x4632fc[_0xe59f3e(0x12e)])['format'](_0xe59f3e(0x140)),'personId':_0x4632fc[_0xe59f3e(0x159)]};}else{const _0x267375={'memberId':_0x39811f,'unitId':_0x4ae093,'content':_0x449f9d,'mention':_0x457696},_0x4219b8=await this[_0xe59f3e(0x13e)][_0xe59f3e(0x169)](_0xe59f3e(0x14c)+_0x4ae093+'/add',{'body':_0x267375});return Y(_0x4219b8['body'][_0xe59f3e(0xfc)],_0x56da60);}}async['updateComment'](_0x499448){const _0x4f9f48=_0x160246;var _0x412d94,_0x13fad7;const {text:_0x126f1a,unitId:_0x5e1a7a}=_0x499448,_0x2a0476=(_0x13fad7=(_0x412d94=_0x126f1a['customRanges'])==null?void 0x0:_0x412d94['filter'](_0x3ab46d=>_0x3ab46d[_0x4f9f48(0x111)]===c[_0x4f9f48(0x155)][_0x4f9f48(0x154)])[_0x4f9f48(0x158)](_0x51f620=>_0x51f620[_0x4f9f48(0x123)]))!=null?_0x13fad7:[],_0x2af9c6=JSON[_0x4f9f48(0x13f)](_0x126f1a),_0x1a61f2=_0x499448[_0x4f9f48(0x15e)],_0x238735=_0x499448['id'],_0x50cff9={'memberId':(await this[_0x4f9f48(0x131)][_0x4f9f48(0x134)](_0x5e1a7a))[_0x4f9f48(0x12c)](),'unitId':_0x5e1a7a,'threadId':_0x1a61f2,'mention':_0x2a0476,'content':_0x2af9c6,'replyId':_0x238735},_0x2b6c78=await this[_0x4f9f48(0x13e)]['post'](_0x4f9f48(0x14c)+_0x5e1a7a+'/edit',{'body':_0x50cff9});return!_0x2b6c78[_0x4f9f48(0x138)][_0x4f9f48(0x165)]||_0x2b6c78[_0x4f9f48(0x138)][_0x4f9f48(0x165)][_0x4f9f48(0x15a)]===0x1;}async[_0x160246(0x126)](_0x1643f1){const _0x8b7900=_0x160246,{unitId:_0x66fde4}=_0x1643f1,_0xa4ca85=_0x1643f1[_0x8b7900(0x15e)],_0x329331={'memberId':this[_0x8b7900(0x164)][_0x8b7900(0x106)]()[_0x8b7900(0x13a)],'unitId':_0x66fde4,'threadId':_0xa4ca85,'solved':_0x1643f1[_0x8b7900(0x11c)]?I[_0x8b7900(0x143)]:I[_0x8b7900(0x127)]},_0x451097=await this[_0x8b7900(0x13e)]['post']('/universer-api/comment/unit/'+_0x66fde4+_0x8b7900(0x10f),{'body':_0x329331});return!_0x451097['body'][_0x8b7900(0x165)]||_0x451097[_0x8b7900(0x138)][_0x8b7900(0x165)]['code']===0x1;}async['deleteComment'](_0x3c44c4,_0x215a73,_0x4d7dea,_0x59fb20){const _0x5b875b=_0x160246,_0x133097={'memberId':(await this[_0x5b875b(0x131)][_0x5b875b(0x134)](_0x3c44c4))[_0x5b875b(0x12c)](),'threadId':_0x4d7dea,'replyId':_0x59fb20,'unitId':_0x3c44c4},_0x4a0e85=await this[_0x5b875b(0x13e)][_0x5b875b(0x169)](_0x5b875b(0x14c)+_0x3c44c4+_0x5b875b(0x14b),{'body':_0x133097});return!_0x4a0e85[_0x5b875b(0x138)][_0x5b875b(0x165)]||_0x4a0e85[_0x5b875b(0x138)][_0x5b875b(0x165)][_0x5b875b(0x15a)]===0x1;}async[_0x160246(0x14f)](_0x19aa03,_0x1585b0,_0x4a1dcd){const _0x58dfaa=_0x160246,_0x42f6b0={'unitId':_0x19aa03,'threadId':_0x4a1dcd},_0x483f2d=await this[_0x58dfaa(0x13e)][_0x58dfaa(0x169)](_0x58dfaa(0x14c)+_0x19aa03+'/list',{'body':_0x42f6b0}),_0x3edb62=_0x4a1dcd[_0x58dfaa(0x158)](_0x5b389f=>G(_0x483f2d[_0x58dfaa(0x138)]['comments'][_0x5b389f],_0x19aa03,_0x1585b0))[_0x58dfaa(0xfb)](Boolean);return Object['values'](_0x483f2d['body'][_0x58dfaa(0x136)])[_0x58dfaa(0x117)](_0x445022=>{const _0x217882=_0x58dfaa;this[_0x217882(0x164)]['addUser'](_0x445022);}),_0x3edb62;}['saveCommentToSnapshot'](_0x5a946f){return{'id':_0x5a946f['id'],'threadId':_0x5a946f['threadId'],'ref':_0x5a946f['ref']};}};function _0x14ee(_0x23d1bd,_0xadf7ec){const _0x5966b0=_0x5966();return _0x14ee=function(_0x14eeaa,_0x4d9861){_0x14eeaa=_0x14eeaa-0xf5;let _0x135ea2=_0x5966b0[_0x14eeaa];return _0x135ea2;},_0x14ee(_0x23d1bd,_0xadf7ec);}p=x([C(0x0,c[_0x160246(0x102)](P[_0x160246(0x11f)])),C(0x1,c[_0x160246(0x102)](c[_0x160246(0x157)])),C(0x2,c[_0x160246(0x102)](b['CollaborationSessionService']))],p);var H=Object['getOwnPropertyDescriptor'],J=(_0x5923bc,_0xea9f63,_0x27de2c,_0x3adc75)=>{const _0x2b377e=_0x160246;for(var _0x23e196=_0x3adc75>0x1?void 0x0:_0x3adc75?H(_0xea9f63,_0x27de2c):_0xea9f63,_0x22e8db=_0x5923bc[_0x2b377e(0x14e)]-0x1,_0x3de8e8;_0x22e8db>=0x0;_0x22e8db--)(_0x3de8e8=_0x5923bc[_0x22e8db])&&(_0x23e196=_0x3de8e8(_0x23e196)||_0x23e196);return _0x23e196;},y=(_0x582289,_0x289416)=>(_0x4d3c00,_0x45c004)=>_0x289416(_0x4d3c00,_0x45c004,_0x582289);let g=class extends c[_0x160246(0x116)]{constructor(_0x2378d9,_0x3dcf47){const _0x7127c0=_0x160246;super(),this[_0x7127c0(0x156)]=_0x2378d9,this[_0x7127c0(0x114)]=_0x3dcf47,this['_initDataSource']();}['_initDataSource'](){const _0x27e22f=_0x160246;this[_0x27e22f(0x156)][_0x27e22f(0xf8)]=this[_0x27e22f(0x114)],this[_0x27e22f(0x156)][_0x27e22f(0x142)]=!0x1;}};g=J([y(0x0,M[_0x160246(0x139)]),y(0x1,c[_0x160246(0x102)](p))],g);var F=Object[_0x160246(0x160)],L=Object[_0x160246(0x103)],Z=(_0x4272d3,_0x57b29e,_0x488d69)=>_0x57b29e in _0x4272d3?F(_0x4272d3,_0x57b29e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x488d69}):_0x4272d3[_0x57b29e]=_0x488d69,W=(_0x34eaac,_0x6f1155,_0xd62a72,_0x24da76)=>{for(var _0x24d431=_0x24da76>0x1?void 0x0:_0x24da76?L(_0x6f1155,_0xd62a72):_0x6f1155,_0x4ec8bf=_0x34eaac['length']-0x1,_0x2b1113;_0x4ec8bf>=0x0;_0x4ec8bf--)(_0x2b1113=_0x34eaac[_0x4ec8bf])&&(_0x24d431=_0x2b1113(_0x24d431)||_0x24d431);return _0x24d431;},O=(_0x77ed69,_0x2a6b7d)=>(_0x3720f8,_0x2c2e10)=>_0x2a6b7d(_0x3720f8,_0x2c2e10,_0x77ed69),N=(_0x3b095b,_0x5e00dd,_0x10ae7d)=>Z(_0x3b095b,typeof _0x5e00dd!='symbol'?_0x5e00dd+'':_0x5e00dd,_0x10ae7d);exports[_0x160246(0x110)]=class extends c[_0x160246(0x13c)]{constructor(_0x1fbddb=D,_0x1bc861,_0x3bbd8d){const _0x4cb4f9=_0x160246;super(),this[_0x4cb4f9(0xfd)]=_0x1fbddb,this[_0x4cb4f9(0x15c)]=_0x1bc861,this[_0x4cb4f9(0x120)]=_0x3bbd8d;const {..._0x4387ab}=c[_0x4cb4f9(0x128)]({},D,this[_0x4cb4f9(0xfd)]);this[_0x4cb4f9(0x120)][_0x4cb4f9(0x166)](q,_0x4387ab);}[_0x160246(0x10d)](){const _0x41b1b0=_0x160246;[[p],[g],[_]][_0x41b1b0(0x117)](_0x198228=>{const _0x4b00ca=_0x41b1b0;this[_0x4b00ca(0x15c)][_0x4b00ca(0x168)](_0x198228);});}[_0x160246(0x11a)](){const _0x29ea0c=_0x160246;this[_0x29ea0c(0x15c)][_0x29ea0c(0x11d)](g),this[_0x29ea0c(0x15c)][_0x29ea0c(0x11d)](_);}},N(exports[_0x160246(0x110)],_0x160246(0x10e),U),N(exports[_0x160246(0x110)],_0x160246(0x147),c[_0x160246(0x101)]['UNIVER_UNKNOWN']),exports[_0x160246(0x110)]=W([c[_0x160246(0x132)](w[_0x160246(0x15b)],b[_0x160246(0xfe)],T[_0x160246(0x162)]),O(0x1,c[_0x160246(0x102)](c[_0x160246(0x14d)])),O(0x2,c[_0x160246(0x150)])],exports[_0x160246(0x110)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xf2dd0a=_0x4f80;(function(_0x5d3492,_0x139a0a){const _0x1ac33b=_0x4f80,_0x30b8ca=_0x5d3492();while(!![]){try{const _0x5da65c=parseInt(_0x1ac33b(0x14a))/0x1+parseInt(_0x1ac33b(0x177))/0x2*(parseInt(_0x1ac33b(0x12d))/0x3)+parseInt(_0x1ac33b(0x12c))/0x4*(-parseInt(_0x1ac33b(0x18d))/0x5)+parseInt(_0x1ac33b(0x188))/0x6+-parseInt(_0x1ac33b(0x132))/0x7+-parseInt(_0x1ac33b(0x15b))/0x8*(-parseInt(_0x1ac33b(0x129))/0x9)+-parseInt(_0x1ac33b(0x150))/0xa;if(_0x5da65c===_0x139a0a)break;else _0x30b8ca['push'](_0x30b8ca['shift']());}catch(_0x19890a){_0x30b8ca['push'](_0x30b8ca['shift']());}}}(_0x20b3,0xba5e8));import{CommentService as _0x27ef41,CollaborationSessionService as _0x408cc2,UniverCollaborationClientPlugin as _0x4d714d}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0xf62078}from'@univerjs-pro/license';import{dayjs as _0x3296f5,UserManagerService as _0x1a82c8,Inject as _0x2a723d,Injector as _0x48547d,Disposable as _0x5f0700,CustomRangeType as _0x8aea36,UniverInstanceType as _0x561314,DependentOn as _0xd6cc24,IConfigService as _0x3fbe75,Plugin as _0xa37bcf,merge as _0x3de015}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x55c17b}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x378e1d,IThreadCommentDataSourceService as _0x2bb3bb}from'@univerjs/thread-comment';import{bufferTime as _0x2eb9bc}from'rxjs';import{HTTPService as _0x105545}from'@univerjs/network';const W=_0xf2dd0a(0x169);var I=(_0x3f38d7=>(_0x3f38d7[_0x3f38d7[_0xf2dd0a(0x12b)]=0x0]=_0xf2dd0a(0x12b),_0x3f38d7[_0x3f38d7[_0xf2dd0a(0x181)]=0x1]=_0xf2dd0a(0x181),_0x3f38d7[_0x3f38d7['UNRECOGNIZED']=-0x1]=_0xf2dd0a(0x18b),_0x3f38d7))(I||{}),v=(_0x74bc2e=>(_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x154)]=0x0]=_0xf2dd0a(0x154),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x161)]=0x1]=_0xf2dd0a(0x161),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x149)]=0x2]=_0xf2dd0a(0x149),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x156)]=0x3]='Edit',_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x139)]=0x4]='Delete',_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x158)]=0x5]=_0xf2dd0a(0x158),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x18b)]=-0x1]=_0xf2dd0a(0x18b),_0x74bc2e))(v||{});const y=_0x4ff9da=>_0x3296f5(new Date(+_0x4ff9da))[_0xf2dd0a(0x128)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x14f257,_0x1663fb)=>{const _0x2ed6f0=_0xf2dd0a,_0x60d12b=_0x14f257['get'](_0x1a82c8),_0x29195a=_0x14f257[_0x2ed6f0(0x130)](_0x105545);_0x1663fb[_0x2ed6f0(0x144)](_0x2167d6=>{const _0x2554c1=_0x2ed6f0;_0x60d12b['getUser'](_0x2167d6)&&_0x1663fb[_0x2554c1(0x14e)](_0x2167d6);}),_0x1663fb[_0x2ed6f0(0x17a)]&&(await _0x29195a['get'](_0x2ed6f0(0x141),{'params':{'userIDs':[..._0x1663fb]}}))[_0x2ed6f0(0x16c)]['users'][_0x2ed6f0(0x144)](_0x349ba6=>{const _0x328932=_0x2ed6f0;_0x349ba6&&_0x60d12b[_0x328932(0x164)](_0x349ba6);});};var K=Object[_0xf2dd0a(0x180)],V=(_0xf6bd97,_0x2acb42,_0x581d3a,_0x29947b)=>{const _0x3894b9=_0xf2dd0a;for(var _0x34f9cf=_0x29947b>0x1?void 0x0:_0x29947b?K(_0x2acb42,_0x581d3a):_0x2acb42,_0x12e167=_0xf6bd97[_0x3894b9(0x13e)]-0x1,_0x3fd1bb;_0x12e167>=0x0;_0x12e167--)(_0x3fd1bb=_0xf6bd97[_0x12e167])&&(_0x34f9cf=_0x3fd1bb(_0x34f9cf)||_0x34f9cf);return _0x34f9cf;},p=(_0x324197,_0x11351c)=>(_0x32dd4f,_0x173b14)=>_0x11351c(_0x32dd4f,_0x173b14,_0x324197);let _=class extends _0x5f0700{constructor(_0x16e83d,_0x12f3ff,_0x97344f,_0x1e96e3){const _0x4546ac=_0xf2dd0a;super(),this['_commentService']=_0x16e83d,this[_0x4546ac(0x165)]=_0x12f3ff,this[_0x4546ac(0x171)]=_0x97344f,this[_0x4546ac(0x14b)]=_0x1e96e3,this[_0x4546ac(0x138)](),this[_0x4546ac(0x17d)]();}[_0xf2dd0a(0x17d)](){const _0x354784=_0xf2dd0a;this[_0x354784(0x16b)](this[_0x354784(0x165)][_0x354784(0x187)]['pipe'](_0x2eb9bc(0x10))[_0x354784(0x145)](_0x41dd81=>{const _0x576917=_0x354784,_0x23ccf9=new Set();_0x41dd81[_0x576917(0x144)](_0x164fff=>{const _0x29e8c9=_0x576917;switch(_0x164fff[_0x29e8c9(0x137)]){case'add':{const _0x591f11=_0x164fff['payload'][_0x29e8c9(0x189)];_0x23ccf9['add'](_0x591f11);break;}}}),B(this[_0x576917(0x14b)],_0x23ccf9);}));}[_0xf2dd0a(0x138)](){const _0x40ac59=_0xf2dd0a;this[_0x40ac59(0x16b)](this[_0x40ac59(0x16a)][_0x40ac59(0x187)][_0x40ac59(0x145)](async _0xb6794c=>{const _0x3dbbcb=_0x40ac59;var _0x5a9004,_0x5d7313,_0x2f6c21,_0x514210;const _0x13ceed=(_0x5a9004=this[_0x3dbbcb(0x165)][_0x3dbbcb(0x13d)](_0xb6794c[_0x3dbbcb(0x172)])[_0x3dbbcb(0x135)](_0x20214e=>_0x20214e['threadId']===_0xb6794c[_0x3dbbcb(0x184)]))==null?void 0x0:_0x5a9004[_0x3dbbcb(0x151)];if(!_0x13ceed)return;const {unitId:_0xc065bf,subUnitId:_0x425db2}=_0x13ceed;switch(_0xb6794c[_0x3dbbcb(0x17f)]&&this[_0x3dbbcb(0x171)][_0x3dbbcb(0x164)](_0xb6794c[_0x3dbbcb(0x17f)]),_0xb6794c[_0x3dbbcb(0x137)]){case v[_0x3dbbcb(0x161)]:break;case v[_0x3dbbcb(0x149)]:{this[_0x3dbbcb(0x165)]['addComment'](_0xc065bf,_0x425db2,{'unitId':_0xc065bf,'subUnitId':_0x425db2,'ref':'','id':_0xb6794c[_0x3dbbcb(0x18a)],'dT':y(+_0xb6794c['createTimestamp']),'threadId':_0xb6794c[_0x3dbbcb(0x184)],'personId':(_0x2f6c21=(_0x5d7313=_0xb6794c[_0x3dbbcb(0x17f)])==null?void 0x0:_0x5d7313[_0x3dbbcb(0x152)])!=null?_0x2f6c21:_0xb6794c['userId'],'text':JSON[_0x3dbbcb(0x18c)](_0xb6794c[_0x3dbbcb(0x143)]),'parentId':_0x13ceed['id']});break;}case v[_0x3dbbcb(0x139)]:{const _0x48c22d=this[_0x3dbbcb(0x165)][_0x3dbbcb(0x142)](_0xc065bf,_0x425db2,_0xb6794c[_0x3dbbcb(0x18a)]);_0x48c22d&&_0x48c22d[_0x3dbbcb(0x146)]&&this['_threadCommentModel'][_0x3dbbcb(0x13b)](_0xc065bf,_0x425db2,_0xb6794c[_0x3dbbcb(0x18a)]);break;}case v[_0x3dbbcb(0x156)]:{this[_0x3dbbcb(0x165)][_0x3dbbcb(0x131)](_0xc065bf,_0x425db2,{'commentId':_0xb6794c[_0x3dbbcb(0x18a)],'text':JSON['parse'](_0xb6794c[_0x3dbbcb(0x143)])});break;}case v[_0x3dbbcb(0x158)]:{const _0x402136=(_0x514210=this['_threadCommentModel']['getUnit'](_0xb6794c[_0x3dbbcb(0x172)])['find'](_0x31de39=>_0x31de39[_0x3dbbcb(0x184)]===_0xb6794c[_0x3dbbcb(0x184)]))==null?void 0x0:_0x514210['root'];_0x402136&&this[_0x3dbbcb(0x165)][_0x3dbbcb(0x167)](_0xc065bf,_0x425db2,_0x402136['id'],_0xb6794c[_0x3dbbcb(0x14c)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0x2a723d(_0x27ef41)),p(0x1,_0x2a723d(_0x378e1d)),p(0x2,_0x2a723d(_0x1a82c8)),p(0x3,_0x2a723d(_0x48547d))],_);const z=_0xf2dd0a(0x16f),O={};var k=Object[_0xf2dd0a(0x180)],Q=(_0x121ad6,_0x2099aa,_0xbb3d2b,_0x5ca734)=>{for(var _0xda0bf6=_0x5ca734>0x1?void 0x0:_0x5ca734?k(_0x2099aa,_0xbb3d2b):_0x2099aa,_0xc12bea=_0x121ad6['length']-0x1,_0x3815eb;_0xc12bea>=0x0;_0xc12bea--)(_0x3815eb=_0x121ad6[_0xc12bea])&&(_0xda0bf6=_0x3815eb(_0xda0bf6)||_0xda0bf6);return _0xda0bf6;},b=(_0x18125b,_0x4381de)=>(_0x5a6f9f,_0x387ab5)=>_0x4381de(_0x5a6f9f,_0x387ab5,_0x18125b);function _0x20b3(){const _0xc2e80c=['/delete','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_commentService','disposeWithMe','body','UNIVER_UNKNOWN','filter','thread-comment-data-source.config','slice','_userService','unitId','_httpService','COMMENT','getCurrentUser','onStarting','2gcrWcU','/reply','_config','size','comment','_configService','_initUserSync','defineProperty','user','getOwnPropertyDescriptor','Solved','addComment','YYYY/MM/DD\x20HH:mm','threadId','/add','customRanges','commentUpdate$','6815640KPJKBg','personId','replyId','UNRECOGNIZED','parse','4170XRqfsC','_sessionService','format','2670363FDClmw','users','OpenOrReOpen','6712swSIDj','2582373JjyrMK','add','listComments','get','updateComment','9569280BVbtga','map','requireSession','find','/universer-api/comment/unit/','type','_init','Delete','rangeType','deleteComment','getMemberID','getUnit','length','syncUpdateMutationToColla','_threadCommentDataSourceService','/universer-api/user/list','getComment','content','forEach','subscribe','parentId','/list','/edit','Reply','236418JBsXCB','_injector','solved','error','delete','post','1868240HNBtQJ','root','userID','setConfig','Unknown','_threadCommentDataSource','Edit','resolved','Solve','stringify','replies','40iIaDqq','symbol','reply','userId','rangeId','dataSource','Add','_initDataSource','code','addUser','_threadCommentModel','createTimestamp','resolveComment'];_0x20b3=function(){return _0xc2e80c;};return _0x20b3();}function X(_0x36dd8f,_0x43caab){const _0x1f2558=_0xf2dd0a,_0x53c775=_0x36dd8f[_0x1f2558(0x15a)][0x0];return{..._0x43caab,'id':_0x53c775['replyId'],'resolved':_0x36dd8f[_0x1f2558(0x14c)]===0x1,'dT':y(_0x53c775[_0x1f2558(0x166)]),'personId':_0x53c775[_0x1f2558(0x15e)],'threadId':_0x53c775[_0x1f2558(0x184)]};}function ee(_0x2f6674,_0x5b0134,_0x1ad43c){const _0x398fd6=_0xf2dd0a;var _0x52f95a,_0x5d1eae;if(((_0x5d1eae=(_0x52f95a=_0x2f6674==null?void 0x0:_0x2f6674[_0x398fd6(0x15a)])==null?void 0x0:_0x52f95a[_0x398fd6(0x13e)])!=null?_0x5d1eae:0x0)>0x0){const _0x422ddf=(_0x15657c,_0x1c9cbf)=>({'id':_0x15657c[_0x398fd6(0x18a)],'threadId':_0x15657c[_0x398fd6(0x184)],'dT':y(_0x15657c[_0x398fd6(0x166)]),'personId':_0x15657c[_0x398fd6(0x15e)],'resolved':_0x2f6674[_0x398fd6(0x14c)]===I[_0x398fd6(0x181)],'unitId':_0x5b0134,'subUnitId':_0x1ad43c,'text':JSON[_0x398fd6(0x18c)](_0x15657c[_0x398fd6(0x143)]),'parentId':_0x1c9cbf}),_0x542975=_0x422ddf(_0x2f6674[_0x398fd6(0x15a)][0x0]);return{..._0x542975,'children':_0x2f6674[_0x398fd6(0x15a)][_0x398fd6(0x170)](0x1)[_0x398fd6(0x133)](_0x4ed855=>_0x422ddf(_0x4ed855,_0x542975['id']))};}return null;}let S=class{constructor(_0x501c85,_0x9778bf,_0x4a0706){const _0x488c6e=_0xf2dd0a;this['_httpService']=_0x501c85,this[_0x488c6e(0x171)]=_0x9778bf,this[_0x488c6e(0x18e)]=_0x4a0706;}async[_0xf2dd0a(0x182)](_0x22fe1d){const _0x32a6be=_0xf2dd0a;var _0x225ad7,_0x82421;const {parentId:_0x329542,unitId:_0x38cbfc,text:_0x1c6112,threadId:_0x5ebdb5}=_0x22fe1d,_0x7157e3=(_0x82421=(_0x225ad7=_0x1c6112[_0x32a6be(0x186)])==null?void 0x0:_0x225ad7[_0x32a6be(0x16e)](_0x233b9f=>_0x233b9f[_0x32a6be(0x13a)]===_0x8aea36[_0x32a6be(0x174)])[_0x32a6be(0x133)](_0x20329a=>_0x20329a['rangeId']))!=null?_0x82421:[],_0xc8c301=JSON[_0x32a6be(0x159)](_0x1c6112),_0x1196e2=(await this[_0x32a6be(0x18e)][_0x32a6be(0x134)](_0x38cbfc))[_0x32a6be(0x13c)]();if(_0x329542){const _0x1712f0={'memberId':_0x1196e2,'unitId':_0x38cbfc,'content':_0xc8c301,'mention':_0x7157e3,'threadId':_0x5ebdb5},_0x5a8480=(await this['_httpService']['post'](_0x32a6be(0x136)+_0x38cbfc+_0x32a6be(0x178),{'body':_0x1712f0}))[_0x32a6be(0x16c)][_0x32a6be(0x15d)];return{..._0x22fe1d,'id':_0x5a8480[_0x32a6be(0x18a)],'dT':_0x3296f5(+_0x5a8480[_0x32a6be(0x166)])[_0x32a6be(0x128)](_0x32a6be(0x183)),'personId':_0x5a8480['userId']};}else{const _0x25f543={'memberId':_0x1196e2,'unitId':_0x38cbfc,'content':_0xc8c301,'mention':_0x7157e3},_0x18f544=await this[_0x32a6be(0x173)][_0x32a6be(0x14f)](_0x32a6be(0x136)+_0x38cbfc+_0x32a6be(0x185),{'body':_0x25f543});return X(_0x18f544['body'][_0x32a6be(0x17b)],_0x22fe1d);}}async[_0xf2dd0a(0x131)](_0x2b5516){const _0x281c01=_0xf2dd0a;var _0x4c9901,_0x31daf5;const {text:_0x1eabcf,unitId:_0xf44fcc}=_0x2b5516,_0x3da96a=(_0x31daf5=(_0x4c9901=_0x1eabcf['customRanges'])==null?void 0x0:_0x4c9901['filter'](_0x34afb5=>_0x34afb5[_0x281c01(0x13a)]===_0x8aea36[_0x281c01(0x174)])[_0x281c01(0x133)](_0x45002d=>_0x45002d[_0x281c01(0x15f)]))!=null?_0x31daf5:[],_0xc320be=JSON[_0x281c01(0x159)](_0x1eabcf),_0x340380=_0x2b5516[_0x281c01(0x184)],_0x375d5b=_0x2b5516['id'],_0x431709={'memberId':(await this[_0x281c01(0x18e)]['requireSession'](_0xf44fcc))[_0x281c01(0x13c)](),'unitId':_0xf44fcc,'threadId':_0x340380,'mention':_0x3da96a,'content':_0xc320be,'replyId':_0x375d5b},_0x48a4b2=await this[_0x281c01(0x173)][_0x281c01(0x14f)]('/universer-api/comment/unit/'+_0xf44fcc+_0x281c01(0x148),{'body':_0x431709});return!_0x48a4b2[_0x281c01(0x16c)][_0x281c01(0x14d)]||_0x48a4b2[_0x281c01(0x16c)][_0x281c01(0x14d)][_0x281c01(0x163)]===0x1;}async[_0xf2dd0a(0x167)](_0x46894a){const _0x34faa1=_0xf2dd0a,{unitId:_0x28685f}=_0x46894a,_0x276e95=_0x46894a['threadId'],_0x1d22ef={'memberId':this[_0x34faa1(0x171)][_0x34faa1(0x175)]()[_0x34faa1(0x152)],'unitId':_0x28685f,'threadId':_0x276e95,'solved':_0x46894a[_0x34faa1(0x157)]?I[_0x34faa1(0x181)]:I[_0x34faa1(0x12b)]},_0x53a167=await this['_httpService'][_0x34faa1(0x14f)]('/universer-api/comment/unit/'+_0x28685f+'/solved',{'body':_0x1d22ef});return!_0x53a167[_0x34faa1(0x16c)][_0x34faa1(0x14d)]||_0x53a167[_0x34faa1(0x16c)]['error'][_0x34faa1(0x163)]===0x1;}async['deleteComment'](_0x5505fb,_0x2530ff,_0x581f06,_0x2ae049){const _0x208c41=_0xf2dd0a,_0x319a56={'memberId':(await this[_0x208c41(0x18e)]['requireSession'](_0x5505fb))[_0x208c41(0x13c)](),'threadId':_0x581f06,'replyId':_0x2ae049,'unitId':_0x5505fb},_0xe85e02=await this[_0x208c41(0x173)][_0x208c41(0x14f)](_0x208c41(0x136)+_0x5505fb+_0x208c41(0x168),{'body':_0x319a56});return!_0xe85e02[_0x208c41(0x16c)][_0x208c41(0x14d)]||_0xe85e02[_0x208c41(0x16c)][_0x208c41(0x14d)][_0x208c41(0x163)]===0x1;}async[_0xf2dd0a(0x12f)](_0x4e2784,_0x34788e,_0x139f5f){const _0x3cc636=_0xf2dd0a,_0x44bac9={'unitId':_0x4e2784,'threadId':_0x139f5f},_0x11cb45=await this['_httpService'][_0x3cc636(0x14f)](_0x3cc636(0x136)+_0x4e2784+_0x3cc636(0x147),{'body':_0x44bac9}),_0x4a706f=_0x139f5f[_0x3cc636(0x133)](_0x516815=>ee(_0x11cb45['body']['comments'][_0x516815],_0x4e2784,_0x34788e))['filter'](Boolean);return Object['values'](_0x11cb45[_0x3cc636(0x16c)][_0x3cc636(0x12a)])[_0x3cc636(0x144)](_0x407cfd=>{this['_userService']['addUser'](_0x407cfd);}),_0x4a706f;}['saveCommentToSnapshot'](_0x111ede){const _0x42ff2f=_0xf2dd0a;return{'id':_0x111ede['id'],'threadId':_0x111ede[_0x42ff2f(0x184)],'ref':_0x111ede['ref']};}};function _0x4f80(_0xafa963,_0x53b3ab){const _0x20b31c=_0x20b3();return _0x4f80=function(_0x4f8050,_0x2f83d0){_0x4f8050=_0x4f8050-0x128;let _0x267939=_0x20b31c[_0x4f8050];return _0x267939;},_0x4f80(_0xafa963,_0x53b3ab);}S=Q([b(0x0,_0x2a723d(_0x105545)),b(0x1,_0x2a723d(_0x1a82c8)),b(0x2,_0x2a723d(_0x408cc2))],S);var re=Object[_0xf2dd0a(0x180)],te=(_0xb5e824,_0xa391bc,_0x1e4e99,_0x394c85)=>{const _0x3d1b5b=_0xf2dd0a;for(var _0x4b4688=_0x394c85>0x1?void 0x0:_0x394c85?re(_0xa391bc,_0x1e4e99):_0xa391bc,_0x383471=_0xb5e824[_0x3d1b5b(0x13e)]-0x1,_0x4c51b7;_0x383471>=0x0;_0x383471--)(_0x4c51b7=_0xb5e824[_0x383471])&&(_0x4b4688=_0x4c51b7(_0x4b4688)||_0x4b4688);return _0x4b4688;},M=(_0x2c2d19,_0x9fcb9f)=>(_0x3620cf,_0x100100)=>_0x9fcb9f(_0x3620cf,_0x100100,_0x2c2d19);let f=class extends _0x5f0700{constructor(_0xea660f,_0x175171){const _0x12490e=_0xf2dd0a;super(),this[_0x12490e(0x140)]=_0xea660f,this[_0x12490e(0x155)]=_0x175171,this['_initDataSource']();}[_0xf2dd0a(0x162)](){const _0x1fd6d0=_0xf2dd0a;this[_0x1fd6d0(0x140)][_0x1fd6d0(0x160)]=this[_0x1fd6d0(0x155)],this['_threadCommentDataSourceService'][_0x1fd6d0(0x13f)]=!0x1;}};f=te([M(0x0,_0x2bb3bb),M(0x1,_0x2a723d(S))],f);var se=Object[_0xf2dd0a(0x17e)],oe=Object[_0xf2dd0a(0x180)],ne=(_0x5df8ae,_0x1cd5b7,_0x5911ff)=>_0x1cd5b7 in _0x5df8ae?se(_0x5df8ae,_0x1cd5b7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5911ff}):_0x5df8ae[_0x1cd5b7]=_0x5911ff,ie=(_0x53b488,_0x53832f,_0x1aa73f,_0x1aa272)=>{const _0x3b3a05=_0xf2dd0a;for(var _0x132eeb=_0x1aa272>0x1?void 0x0:_0x1aa272?oe(_0x53832f,_0x1aa73f):_0x53832f,_0x5ef4a7=_0x53b488[_0x3b3a05(0x13e)]-0x1,_0x247717;_0x5ef4a7>=0x0;_0x5ef4a7--)(_0x247717=_0x53b488[_0x5ef4a7])&&(_0x132eeb=_0x247717(_0x132eeb)||_0x132eeb);return _0x132eeb;},N=(_0x2fee8f,_0x318ed6)=>(_0x37d2ba,_0x2224df)=>_0x318ed6(_0x37d2ba,_0x2224df,_0x2fee8f),$=(_0x3df332,_0x5200d7,_0xdef899)=>ne(_0x3df332,typeof _0x5200d7!=_0xf2dd0a(0x15c)?_0x5200d7+'':_0x5200d7,_0xdef899);let g=class extends _0xa37bcf{constructor(_0x12010b=O,_0x21ffe7,_0x58d343){const _0x2a10bf=_0xf2dd0a;super(),this['_config']=_0x12010b,this['_injector']=_0x21ffe7,this[_0x2a10bf(0x17c)]=_0x58d343;const {..._0x37b03a}=_0x3de015({},O,this[_0x2a10bf(0x179)]);this['_configService'][_0x2a10bf(0x153)](z,_0x37b03a);}[_0xf2dd0a(0x176)](){const _0x464609=_0xf2dd0a;[[S],[f],[_]][_0x464609(0x144)](_0x35b556=>{const _0x3912a1=_0x464609;this['_injector'][_0x3912a1(0x12e)](_0x35b556);});}['onReady'](){const _0x55e5c8=_0xf2dd0a;this[_0x55e5c8(0x14b)]['get'](f),this[_0x55e5c8(0x14b)][_0x55e5c8(0x130)](_);}};$(g,'pluginName',W),$(g,_0xf2dd0a(0x137),_0x561314[_0xf2dd0a(0x16d)]),g=ie([_0xd6cc24(_0x55c17b,_0x4d714d,_0xf62078),N(0x1,_0x2a723d(_0x48547d)),N(0x2,_0x3fbe75)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x10bff5=_0x21bb;(function(_0x285a34,_0x32f08f){const _0x1dd46c=_0x21bb,_0x53c875=_0x285a34();while(!![]){try{const _0x587b42=-parseInt(_0x1dd46c(0x1e3))/0x1*(parseInt(_0x1dd46c(0x216))/0x2)+-parseInt(_0x1dd46c(0x1ee))/0x3+-parseInt(_0x1dd46c(0x1fe))/0x4+parseInt(_0x1dd46c(0x206))/0x5*(-parseInt(_0x1dd46c(0x22c))/0x6)+-parseInt(_0x1dd46c(0x1d6))/0x7*(-parseInt(_0x1dd46c(0x1e1))/0x8)+-parseInt(_0x1dd46c(0x205))/0x9*(parseInt(_0x1dd46c(0x22e))/0xa)+-parseInt(_0x1dd46c(0x1d1))/0xb*(-parseInt(_0x1dd46c(0x1d5))/0xc);if(_0x587b42===_0x32f08f)break;else _0x53c875['push'](_0x53c875['shift']());}catch(_0x68118d){_0x53c875['push'](_0x53c875['shift']());}}}(_0x2126,0x9dafd));import{CommentService as _0x18e6ec,CollaborationSessionService as _0x524314,UniverCollaborationClientPlugin as _0x288191}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x46bf69}from'@univerjs-pro/license';import{dayjs as _0x1e783b,UserManagerService as _0xc08702,Inject as _0x346acf,Injector as _0x542fad,Disposable as _0x2b6fd7,CustomRangeType as _0x236405,UniverInstanceType as _0x1eb642,DependentOn as _0x50acbf,IConfigService as _0x194b79,Plugin as _0x44e740,merge as _0x544057}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1b94fa}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x46dddc,IThreadCommentDataSourceService as _0x4edee4}from'@univerjs/thread-comment';import{bufferTime as _0x272284}from'rxjs';import{HTTPService as _0x1851b4}from'@univerjs/network';const W=_0x10bff5(0x209);function _0x21bb(_0x55305d,_0x2a1559){const _0x212694=_0x2126();return _0x21bb=function(_0x21bbc9,_0x21615f){_0x21bbc9=_0x21bbc9-0x1ca;let _0x3485e6=_0x212694[_0x21bbc9];return _0x3485e6;},_0x21bb(_0x55305d,_0x2a1559);}var I=(_0x56f932=>(_0x56f932[_0x56f932[_0x10bff5(0x21a)]=0x0]=_0x10bff5(0x21a),_0x56f932[_0x56f932[_0x10bff5(0x1d0)]=0x1]=_0x10bff5(0x1d0),_0x56f932[_0x56f932[_0x10bff5(0x201)]=-0x1]=_0x10bff5(0x201),_0x56f932))(I||{}),v=(_0x3a7062=>(_0x3a7062[_0x3a7062[_0x10bff5(0x1e8)]=0x0]=_0x10bff5(0x1e8),_0x3a7062[_0x3a7062['Add']=0x1]=_0x10bff5(0x1ca),_0x3a7062[_0x3a7062['Reply']=0x2]='Reply',_0x3a7062[_0x3a7062[_0x10bff5(0x1e7)]=0x3]='Edit',_0x3a7062[_0x3a7062['Delete']=0x4]=_0x10bff5(0x211),_0x3a7062[_0x3a7062['Solve']=0x5]='Solve',_0x3a7062[_0x3a7062[_0x10bff5(0x201)]=-0x1]=_0x10bff5(0x201),_0x3a7062))(v||{});const y=_0x543274=>_0x1e783b(new Date(+_0x543274))[_0x10bff5(0x1ff)](_0x10bff5(0x204)),B=async(_0x385d36,_0xf7ce8a)=>{const _0x5e2e44=_0x10bff5,_0x27b137=_0x385d36[_0x5e2e44(0x218)](_0xc08702),_0x2cab8d=_0x385d36['get'](_0x1851b4);_0xf7ce8a[_0x5e2e44(0x1f0)](_0x724427=>{const _0x13f80e=_0x5e2e44;_0x27b137[_0x13f80e(0x213)](_0x724427)&&_0xf7ce8a[_0x13f80e(0x21e)](_0x724427);}),_0xf7ce8a[_0x5e2e44(0x21f)]&&(await _0x2cab8d[_0x5e2e44(0x218)](_0x5e2e44(0x1de),{'params':{'userIDs':[..._0xf7ce8a]}}))['body'][_0x5e2e44(0x203)]['forEach'](_0x474e6c=>{const _0x20b3be=_0x5e2e44;_0x474e6c&&_0x27b137[_0x20b3be(0x20f)](_0x474e6c);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x469777,_0x39d587,_0x4707e0,_0x38a992)=>{const _0x421c96=_0x10bff5;for(var _0x48f97e=_0x38a992>0x1?void 0x0:_0x38a992?K(_0x39d587,_0x4707e0):_0x39d587,_0x55019e=_0x469777[_0x421c96(0x1f7)]-0x1,_0x11b8ef;_0x55019e>=0x0;_0x55019e--)(_0x11b8ef=_0x469777[_0x55019e])&&(_0x48f97e=_0x11b8ef(_0x48f97e)||_0x48f97e);return _0x48f97e;},p=(_0x5ee64,_0x5c7b7e)=>(_0x53b028,_0x1970b7)=>_0x5c7b7e(_0x53b028,_0x1970b7,_0x5ee64);let _=class extends _0x2b6fd7{constructor(_0x29c931,_0x2fcd85,_0x2eaf60,_0x3ebd69){const _0x3366eb=_0x10bff5;super(),this[_0x3366eb(0x21c)]=_0x29c931,this[_0x3366eb(0x20d)]=_0x2fcd85,this['_userService']=_0x2eaf60,this['_injector']=_0x3ebd69,this[_0x3366eb(0x1e4)](),this['_initUserSync']();}[_0x10bff5(0x207)](){const _0x334203=_0x10bff5;this[_0x334203(0x1e9)](this[_0x334203(0x20d)][_0x334203(0x1ce)][_0x334203(0x1fc)](_0x272284(0x10))['subscribe'](_0x1fb4f4=>{const _0x6f3543=_0x334203,_0x1309e5=new Set();_0x1fb4f4[_0x6f3543(0x1f0)](_0x16f268=>{const _0x31b3ca=_0x6f3543;switch(_0x16f268['type']){case _0x31b3ca(0x1f5):{const _0x16bbaf=_0x16f268[_0x31b3ca(0x20e)][_0x31b3ca(0x208)];_0x1309e5[_0x31b3ca(0x1f5)](_0x16bbaf);break;}}}),B(this[_0x6f3543(0x228)],_0x1309e5);}));}[_0x10bff5(0x1e4)](){const _0x10e29b=_0x10bff5;this[_0x10e29b(0x1e9)](this['_commentService']['commentUpdate$'][_0x10e29b(0x1fd)](async _0xbbdf65=>{const _0x370088=_0x10e29b;var _0x840651,_0x2de963,_0x2cc4f3,_0x1ed5b8;const _0x1fcd33=(_0x840651=this[_0x370088(0x20d)]['getUnit'](_0xbbdf65[_0x370088(0x1f2)])[_0x370088(0x1e0)](_0x482723=>_0x482723[_0x370088(0x1e2)]===_0xbbdf65[_0x370088(0x1e2)]))==null?void 0x0:_0x840651[_0x370088(0x1d9)];if(!_0x1fcd33)return;const {unitId:_0x39b3f7,subUnitId:_0x16b354}=_0x1fcd33;switch(_0xbbdf65['user']&&this[_0x370088(0x1d2)][_0x370088(0x20f)](_0xbbdf65['user']),_0xbbdf65[_0x370088(0x200)]){case v[_0x370088(0x1ca)]:break;case v[_0x370088(0x212)]:{this['_threadCommentModel']['addComment'](_0x39b3f7,_0x16b354,{'unitId':_0x39b3f7,'subUnitId':_0x16b354,'ref':'','id':_0xbbdf65[_0x370088(0x219)],'dT':y(+_0xbbdf65[_0x370088(0x1dd)]),'threadId':_0xbbdf65[_0x370088(0x1e2)],'personId':(_0x2cc4f3=(_0x2de963=_0xbbdf65[_0x370088(0x1df)])==null?void 0x0:_0x2de963[_0x370088(0x230)])!=null?_0x2cc4f3:_0xbbdf65[_0x370088(0x1cd)],'text':JSON[_0x370088(0x231)](_0xbbdf65[_0x370088(0x224)]),'parentId':_0x1fcd33['id']});break;}case v[_0x370088(0x211)]:{const _0x38e15d=this['_threadCommentModel'][_0x370088(0x1fb)](_0x39b3f7,_0x16b354,_0xbbdf65['replyId']);_0x38e15d&&_0x38e15d['parentId']&&this[_0x370088(0x20d)][_0x370088(0x1cb)](_0x39b3f7,_0x16b354,_0xbbdf65[_0x370088(0x219)]);break;}case v[_0x370088(0x1e7)]:{this['_threadCommentModel'][_0x370088(0x1f1)](_0x39b3f7,_0x16b354,{'commentId':_0xbbdf65[_0x370088(0x219)],'text':JSON[_0x370088(0x231)](_0xbbdf65['content'])});break;}case v['Solve']:{const _0x19f1dc=(_0x1ed5b8=this[_0x370088(0x20d)][_0x370088(0x226)](_0xbbdf65[_0x370088(0x1f2)])[_0x370088(0x1e0)](_0x5957d2=>_0x5957d2[_0x370088(0x1e2)]===_0xbbdf65[_0x370088(0x1e2)]))==null?void 0x0:_0x1ed5b8['root'];_0x19f1dc&&this['_threadCommentModel']['resolveComment'](_0x39b3f7,_0x16b354,_0x19f1dc['id'],_0xbbdf65[_0x370088(0x227)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0x346acf(_0x18e6ec)),p(0x1,_0x346acf(_0x46dddc)),p(0x2,_0x346acf(_0xc08702)),p(0x3,_0x346acf(_0x542fad))],_);const z=_0x10bff5(0x1cf),O={};var k=Object[_0x10bff5(0x20b)],Q=(_0x1e1833,_0x47f973,_0x4428cf,_0x3cdf79)=>{for(var _0x50dfc0=_0x3cdf79>0x1?void 0x0:_0x3cdf79?k(_0x47f973,_0x4428cf):_0x47f973,_0x179b46=_0x1e1833['length']-0x1,_0x4f9773;_0x179b46>=0x0;_0x179b46--)(_0x4f9773=_0x1e1833[_0x179b46])&&(_0x50dfc0=_0x4f9773(_0x50dfc0)||_0x50dfc0);return _0x50dfc0;},b=(_0x13d331,_0x19ce6e)=>(_0x2bf489,_0x2dee88)=>_0x19ce6e(_0x2bf489,_0x2dee88,_0x13d331);function X(_0x9649af,_0x54948b){const _0x41b52a=_0x10bff5,_0x55275a=_0x9649af[_0x41b52a(0x1db)][0x0];return{..._0x54948b,'id':_0x55275a['replyId'],'resolved':_0x9649af[_0x41b52a(0x227)]===0x1,'dT':y(_0x55275a[_0x41b52a(0x1dd)]),'personId':_0x55275a[_0x41b52a(0x1cd)],'threadId':_0x55275a[_0x41b52a(0x1e2)]};}function ee(_0x5f5350,_0x5e16dd,_0x151115){const _0x2a4b8a=_0x10bff5;var _0x1e31f3,_0x108149;if(((_0x108149=(_0x1e31f3=_0x5f5350==null?void 0x0:_0x5f5350['replies'])==null?void 0x0:_0x1e31f3[_0x2a4b8a(0x1f7)])!=null?_0x108149:0x0)>0x0){const _0xebdfe8=(_0x3809eb,_0x431bcd)=>({'id':_0x3809eb[_0x2a4b8a(0x219)],'threadId':_0x3809eb[_0x2a4b8a(0x1e2)],'dT':y(_0x3809eb['createTimestamp']),'personId':_0x3809eb[_0x2a4b8a(0x1cd)],'resolved':_0x5f5350[_0x2a4b8a(0x227)]===I[_0x2a4b8a(0x1d0)],'unitId':_0x5e16dd,'subUnitId':_0x151115,'text':JSON[_0x2a4b8a(0x231)](_0x3809eb[_0x2a4b8a(0x224)]),'parentId':_0x431bcd}),_0x5d52b6=_0xebdfe8(_0x5f5350[_0x2a4b8a(0x1db)][0x0]);return{..._0x5d52b6,'children':_0x5f5350[_0x2a4b8a(0x1db)][_0x2a4b8a(0x210)](0x1)[_0x2a4b8a(0x1ec)](_0x400af1=>_0xebdfe8(_0x400af1,_0x5d52b6['id']))};}return null;}let S=class{constructor(_0x1a9962,_0x1f911a,_0x28f3d7){const _0x26ef9e=_0x10bff5;this['_httpService']=_0x1a9962,this[_0x26ef9e(0x1d2)]=_0x1f911a,this[_0x26ef9e(0x202)]=_0x28f3d7;}async[_0x10bff5(0x1f4)](_0x32867f){const _0x4886e6=_0x10bff5;var _0x5668ec,_0x1db651;const {parentId:_0x1733a,unitId:_0x13b78f,text:_0x56ecf9,threadId:_0x6849db}=_0x32867f,_0x2e4719=(_0x1db651=(_0x5668ec=_0x56ecf9[_0x4886e6(0x232)])==null?void 0x0:_0x5668ec[_0x4886e6(0x223)](_0xffc7f8=>_0xffc7f8[_0x4886e6(0x1ed)]===_0x236405[_0x4886e6(0x215)])[_0x4886e6(0x1ec)](_0x11fc2b=>_0x11fc2b['rangeId']))!=null?_0x1db651:[],_0x3a9ec4=JSON['stringify'](_0x56ecf9),_0x3c20f9=(await this[_0x4886e6(0x202)][_0x4886e6(0x21d)](_0x13b78f))[_0x4886e6(0x234)]();if(_0x1733a){const _0xd162e8={'memberId':_0x3c20f9,'unitId':_0x13b78f,'content':_0x3a9ec4,'mention':_0x2e4719,'threadId':_0x6849db},_0x1d1cd2=(await this[_0x4886e6(0x22d)]['post']('/universer-api/comment/unit/'+_0x13b78f+_0x4886e6(0x1dc),{'body':_0xd162e8}))[_0x4886e6(0x1f3)][_0x4886e6(0x221)];return{..._0x32867f,'id':_0x1d1cd2[_0x4886e6(0x219)],'dT':_0x1e783b(+_0x1d1cd2[_0x4886e6(0x1dd)])[_0x4886e6(0x1ff)](_0x4886e6(0x204)),'personId':_0x1d1cd2[_0x4886e6(0x1cd)]};}else{const _0x151524={'memberId':_0x3c20f9,'unitId':_0x13b78f,'content':_0x3a9ec4,'mention':_0x2e4719},_0x410ada=await this[_0x4886e6(0x22d)][_0x4886e6(0x1ea)](_0x4886e6(0x1d8)+_0x13b78f+_0x4886e6(0x1eb),{'body':_0x151524});return X(_0x410ada[_0x4886e6(0x1f3)][_0x4886e6(0x214)],_0x32867f);}}async[_0x10bff5(0x1f1)](_0x3c4b74){const _0x311ed7=_0x10bff5;var _0xe96652,_0x338ca0;const {text:_0x4fbd12,unitId:_0x5c9aea}=_0x3c4b74,_0x41929b=(_0x338ca0=(_0xe96652=_0x4fbd12[_0x311ed7(0x232)])==null?void 0x0:_0xe96652['filter'](_0x3f0236=>_0x3f0236[_0x311ed7(0x1ed)]===_0x236405['COMMENT'])[_0x311ed7(0x1ec)](_0x15a562=>_0x15a562[_0x311ed7(0x21b)]))!=null?_0x338ca0:[],_0x80689a=JSON[_0x311ed7(0x1f8)](_0x4fbd12),_0xad2581=_0x3c4b74[_0x311ed7(0x1e2)],_0x543bb5=_0x3c4b74['id'],_0x1ecd3f={'memberId':(await this['_sessionService']['requireSession'](_0x5c9aea))[_0x311ed7(0x234)](),'unitId':_0x5c9aea,'threadId':_0xad2581,'mention':_0x41929b,'content':_0x80689a,'replyId':_0x543bb5},_0x203d09=await this['_httpService']['post'](_0x311ed7(0x1d8)+_0x5c9aea+'/edit',{'body':_0x1ecd3f});return!_0x203d09[_0x311ed7(0x1f3)][_0x311ed7(0x222)]||_0x203d09[_0x311ed7(0x1f3)][_0x311ed7(0x222)][_0x311ed7(0x225)]===0x1;}async[_0x10bff5(0x1d4)](_0x28eec4){const _0x582462=_0x10bff5,{unitId:_0x3b7a11}=_0x28eec4,_0x4e39b9=_0x28eec4[_0x582462(0x1e2)],_0x47d274={'memberId':this[_0x582462(0x1d2)]['getCurrentUser']()[_0x582462(0x230)],'unitId':_0x3b7a11,'threadId':_0x4e39b9,'solved':_0x28eec4[_0x582462(0x220)]?I[_0x582462(0x1d0)]:I['OpenOrReOpen']},_0x2919a4=await this[_0x582462(0x22d)][_0x582462(0x1ea)](_0x582462(0x1d8)+_0x3b7a11+_0x582462(0x1cc),{'body':_0x47d274});return!_0x2919a4[_0x582462(0x1f3)][_0x582462(0x222)]||_0x2919a4[_0x582462(0x1f3)]['error'][_0x582462(0x225)]===0x1;}async[_0x10bff5(0x1cb)](_0x4a593c,_0x261dce,_0x1cf9ac,_0x5af762){const _0xea7756=_0x10bff5,_0x3a233f={'memberId':(await this['_sessionService'][_0xea7756(0x21d)](_0x4a593c))['getMemberID'](),'threadId':_0x1cf9ac,'replyId':_0x5af762,'unitId':_0x4a593c},_0x463a2d=await this['_httpService'][_0xea7756(0x1ea)]('/universer-api/comment/unit/'+_0x4a593c+_0xea7756(0x20a),{'body':_0x3a233f});return!_0x463a2d[_0xea7756(0x1f3)][_0xea7756(0x222)]||_0x463a2d[_0xea7756(0x1f3)][_0xea7756(0x222)]['code']===0x1;}async[_0x10bff5(0x22a)](_0x42fbcd,_0x4a621a,_0x5a46e4){const _0x1f92b8=_0x10bff5,_0x517c3f={'unitId':_0x42fbcd,'threadId':_0x5a46e4},_0x238857=await this[_0x1f92b8(0x22d)]['post']('/universer-api/comment/unit/'+_0x42fbcd+_0x1f92b8(0x1d7),{'body':_0x517c3f}),_0x534d3a=_0x5a46e4[_0x1f92b8(0x1ec)](_0x153410=>ee(_0x238857['body']['comments'][_0x153410],_0x42fbcd,_0x4a621a))[_0x1f92b8(0x223)](Boolean);return Object[_0x1f92b8(0x1e5)](_0x238857['body']['users'])[_0x1f92b8(0x1f0)](_0x8c6a55=>{const _0x2de03e=_0x1f92b8;this[_0x2de03e(0x1d2)]['addUser'](_0x8c6a55);}),_0x534d3a;}[_0x10bff5(0x1da)](_0x2f9a72){const _0x52ccff=_0x10bff5;return{'id':_0x2f9a72['id'],'threadId':_0x2f9a72[_0x52ccff(0x1e2)],'ref':_0x2f9a72['ref']};}};S=Q([b(0x0,_0x346acf(_0x1851b4)),b(0x1,_0x346acf(_0xc08702)),b(0x2,_0x346acf(_0x524314))],S);function _0x2126(){const _0x1c0020=['/reply','createTimestamp','/universer-api/user/list','user','find','76984RvQZSl','threadId','43rnLkqh','_init','values','onReady','Edit','Unknown','disposeWithMe','post','/add','map','rangeType','1150347VqGkfJ','_threadCommentDataSourceService','forEach','updateComment','unitId','body','addComment','add','onStarting','length','stringify','dataSource','pluginName','getComment','pipe','subscribe','4069420kIYKqH','format','type','UNRECOGNIZED','_sessionService','users','YYYY/MM/DD\x20HH:mm','306CGtIkH','78745dDkuNJ','_initUserSync','personId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/delete','getOwnPropertyDescriptor','symbol','_threadCommentModel','payload','addUser','slice','Delete','Reply','getUser','comment','COMMENT','2706BxiulY','defineProperty','get','replyId','OpenOrReOpen','rangeId','_commentService','requireSession','delete','size','resolved','reply','error','filter','content','code','getUnit','solved','_injector','_configService','listComments','_initDataSource','438iNvQia','_httpService','241510ZxmgPo','_config','userID','parse','customRanges','_threadCommentDataSource','getMemberID','Add','deleteComment','/solved','userId','commentUpdate$','thread-comment-data-source.config','Solved','110WanZFg','_userService','UNIVER_UNKNOWN','resolveComment','4163316QMDDNO','441fUEliH','/list','/universer-api/comment/unit/','root','saveCommentToSnapshot','replies'];_0x2126=function(){return _0x1c0020;};return _0x2126();}var re=Object[_0x10bff5(0x20b)],te=(_0x5afbba,_0xed95f5,_0x54d474,_0x2e01b1)=>{const _0x3e3155=_0x10bff5;for(var _0x304b91=_0x2e01b1>0x1?void 0x0:_0x2e01b1?re(_0xed95f5,_0x54d474):_0xed95f5,_0x82b4a3=_0x5afbba[_0x3e3155(0x1f7)]-0x1,_0x4ec756;_0x82b4a3>=0x0;_0x82b4a3--)(_0x4ec756=_0x5afbba[_0x82b4a3])&&(_0x304b91=_0x4ec756(_0x304b91)||_0x304b91);return _0x304b91;},M=(_0xfce24b,_0xed2172)=>(_0x1d1c74,_0x3b89a6)=>_0xed2172(_0x1d1c74,_0x3b89a6,_0xfce24b);let f=class extends _0x2b6fd7{constructor(_0x14ab74,_0x10ca7c){const _0x348c19=_0x10bff5;super(),this[_0x348c19(0x1ef)]=_0x14ab74,this['_threadCommentDataSource']=_0x10ca7c,this[_0x348c19(0x22b)]();}['_initDataSource'](){const _0x59a133=_0x10bff5;this[_0x59a133(0x1ef)][_0x59a133(0x1f9)]=this[_0x59a133(0x233)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};f=te([M(0x0,_0x4edee4),M(0x1,_0x346acf(S))],f);var se=Object[_0x10bff5(0x217)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x1c5fb8,_0x5f14a6,_0x436d5b)=>_0x5f14a6 in _0x1c5fb8?se(_0x1c5fb8,_0x5f14a6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x436d5b}):_0x1c5fb8[_0x5f14a6]=_0x436d5b,ie=(_0x55e766,_0x2e623b,_0x3dd359,_0x2c7791)=>{const _0x22f9bf=_0x10bff5;for(var _0x274cce=_0x2c7791>0x1?void 0x0:_0x2c7791?oe(_0x2e623b,_0x3dd359):_0x2e623b,_0x25970f=_0x55e766[_0x22f9bf(0x1f7)]-0x1,_0x2a5639;_0x25970f>=0x0;_0x25970f--)(_0x2a5639=_0x55e766[_0x25970f])&&(_0x274cce=_0x2a5639(_0x274cce)||_0x274cce);return _0x274cce;},N=(_0x2b0485,_0x18646e)=>(_0x22d13d,_0x2b0701)=>_0x18646e(_0x22d13d,_0x2b0701,_0x2b0485),$=(_0x4fbad8,_0x4c4206,_0x15091a)=>ne(_0x4fbad8,typeof _0x4c4206!=_0x10bff5(0x20c)?_0x4c4206+'':_0x4c4206,_0x15091a);let g=class extends _0x44e740{constructor(_0x1d993c=O,_0x2a5fe6,_0x4536d4){const _0x44cd9e=_0x10bff5;super(),this[_0x44cd9e(0x22f)]=_0x1d993c,this[_0x44cd9e(0x228)]=_0x2a5fe6,this[_0x44cd9e(0x229)]=_0x4536d4;const {..._0x37486c}=_0x544057({},O,this['_config']);this[_0x44cd9e(0x229)]['setConfig'](z,_0x37486c);}[_0x10bff5(0x1f6)](){const _0x1bcc0c=_0x10bff5;[[S],[f],[_]][_0x1bcc0c(0x1f0)](_0x2faefa=>{const _0x5e8ece=_0x1bcc0c;this[_0x5e8ece(0x228)][_0x5e8ece(0x1f5)](_0x2faefa);});}[_0x10bff5(0x1e6)](){const _0x4943f4=_0x10bff5;this['_injector'][_0x4943f4(0x218)](f),this[_0x4943f4(0x228)][_0x4943f4(0x218)](_);}};$(g,_0x10bff5(0x1fa),W),$(g,_0x10bff5(0x200),_0x1eb642[_0x10bff5(0x1d3)]),g=ie([_0x50acbf(_0x1b94fa,_0x288191,_0x46bf69),N(0x1,_0x346acf(_0x542fad)),N(0x2,_0x194b79)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xf2dd0a=_0x4f80;(function(_0x5d3492,_0x139a0a){const _0x1ac33b=_0x4f80,_0x30b8ca=_0x5d3492();while(!![]){try{const _0x5da65c=parseInt(_0x1ac33b(0x14a))/0x1+parseInt(_0x1ac33b(0x177))/0x2*(parseInt(_0x1ac33b(0x12d))/0x3)+parseInt(_0x1ac33b(0x12c))/0x4*(-parseInt(_0x1ac33b(0x18d))/0x5)+parseInt(_0x1ac33b(0x188))/0x6+-parseInt(_0x1ac33b(0x132))/0x7+-parseInt(_0x1ac33b(0x15b))/0x8*(-parseInt(_0x1ac33b(0x129))/0x9)+-parseInt(_0x1ac33b(0x150))/0xa;if(_0x5da65c===_0x139a0a)break;else _0x30b8ca['push'](_0x30b8ca['shift']());}catch(_0x19890a){_0x30b8ca['push'](_0x30b8ca['shift']());}}}(_0x20b3,0xba5e8));import{CommentService as _0x27ef41,CollaborationSessionService as _0x408cc2,UniverCollaborationClientPlugin as _0x4d714d}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0xf62078}from'@univerjs-pro/license';import{dayjs as _0x3296f5,UserManagerService as _0x1a82c8,Inject as _0x2a723d,Injector as _0x48547d,Disposable as _0x5f0700,CustomRangeType as _0x8aea36,UniverInstanceType as _0x561314,DependentOn as _0xd6cc24,IConfigService as _0x3fbe75,Plugin as _0xa37bcf,merge as _0x3de015}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x55c17b}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x378e1d,IThreadCommentDataSourceService as _0x2bb3bb}from'@univerjs/thread-comment';import{bufferTime as _0x2eb9bc}from'rxjs';import{HTTPService as _0x105545}from'@univerjs/network';const W=_0xf2dd0a(0x169);var I=(_0x3f38d7=>(_0x3f38d7[_0x3f38d7[_0xf2dd0a(0x12b)]=0x0]=_0xf2dd0a(0x12b),_0x3f38d7[_0x3f38d7[_0xf2dd0a(0x181)]=0x1]=_0xf2dd0a(0x181),_0x3f38d7[_0x3f38d7['UNRECOGNIZED']=-0x1]=_0xf2dd0a(0x18b),_0x3f38d7))(I||{}),v=(_0x74bc2e=>(_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x154)]=0x0]=_0xf2dd0a(0x154),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x161)]=0x1]=_0xf2dd0a(0x161),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x149)]=0x2]=_0xf2dd0a(0x149),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x156)]=0x3]='Edit',_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x139)]=0x4]='Delete',_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x158)]=0x5]=_0xf2dd0a(0x158),_0x74bc2e[_0x74bc2e[_0xf2dd0a(0x18b)]=-0x1]=_0xf2dd0a(0x18b),_0x74bc2e))(v||{});const y=_0x4ff9da=>_0x3296f5(new Date(+_0x4ff9da))[_0xf2dd0a(0x128)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x14f257,_0x1663fb)=>{const _0x2ed6f0=_0xf2dd0a,_0x60d12b=_0x14f257['get'](_0x1a82c8),_0x29195a=_0x14f257[_0x2ed6f0(0x130)](_0x105545);_0x1663fb[_0x2ed6f0(0x144)](_0x2167d6=>{const _0x2554c1=_0x2ed6f0;_0x60d12b['getUser'](_0x2167d6)&&_0x1663fb[_0x2554c1(0x14e)](_0x2167d6);}),_0x1663fb[_0x2ed6f0(0x17a)]&&(await _0x29195a['get'](_0x2ed6f0(0x141),{'params':{'userIDs':[..._0x1663fb]}}))[_0x2ed6f0(0x16c)]['users'][_0x2ed6f0(0x144)](_0x349ba6=>{const _0x328932=_0x2ed6f0;_0x349ba6&&_0x60d12b[_0x328932(0x164)](_0x349ba6);});};var K=Object[_0xf2dd0a(0x180)],V=(_0xf6bd97,_0x2acb42,_0x581d3a,_0x29947b)=>{const _0x3894b9=_0xf2dd0a;for(var _0x34f9cf=_0x29947b>0x1?void 0x0:_0x29947b?K(_0x2acb42,_0x581d3a):_0x2acb42,_0x12e167=_0xf6bd97[_0x3894b9(0x13e)]-0x1,_0x3fd1bb;_0x12e167>=0x0;_0x12e167--)(_0x3fd1bb=_0xf6bd97[_0x12e167])&&(_0x34f9cf=_0x3fd1bb(_0x34f9cf)||_0x34f9cf);return _0x34f9cf;},p=(_0x324197,_0x11351c)=>(_0x32dd4f,_0x173b14)=>_0x11351c(_0x32dd4f,_0x173b14,_0x324197);let _=class extends _0x5f0700{constructor(_0x16e83d,_0x12f3ff,_0x97344f,_0x1e96e3){const _0x4546ac=_0xf2dd0a;super(),this['_commentService']=_0x16e83d,this[_0x4546ac(0x165)]=_0x12f3ff,this[_0x4546ac(0x171)]=_0x97344f,this[_0x4546ac(0x14b)]=_0x1e96e3,this[_0x4546ac(0x138)](),this[_0x4546ac(0x17d)]();}[_0xf2dd0a(0x17d)](){const _0x354784=_0xf2dd0a;this[_0x354784(0x16b)](this[_0x354784(0x165)][_0x354784(0x187)]['pipe'](_0x2eb9bc(0x10))[_0x354784(0x145)](_0x41dd81=>{const _0x576917=_0x354784,_0x23ccf9=new Set();_0x41dd81[_0x576917(0x144)](_0x164fff=>{const _0x29e8c9=_0x576917;switch(_0x164fff[_0x29e8c9(0x137)]){case'add':{const _0x591f11=_0x164fff['payload'][_0x29e8c9(0x189)];_0x23ccf9['add'](_0x591f11);break;}}}),B(this[_0x576917(0x14b)],_0x23ccf9);}));}[_0xf2dd0a(0x138)](){const _0x40ac59=_0xf2dd0a;this[_0x40ac59(0x16b)](this[_0x40ac59(0x16a)][_0x40ac59(0x187)][_0x40ac59(0x145)](async _0xb6794c=>{const _0x3dbbcb=_0x40ac59;var _0x5a9004,_0x5d7313,_0x2f6c21,_0x514210;const _0x13ceed=(_0x5a9004=this[_0x3dbbcb(0x165)][_0x3dbbcb(0x13d)](_0xb6794c[_0x3dbbcb(0x172)])[_0x3dbbcb(0x135)](_0x20214e=>_0x20214e['threadId']===_0xb6794c[_0x3dbbcb(0x184)]))==null?void 0x0:_0x5a9004[_0x3dbbcb(0x151)];if(!_0x13ceed)return;const {unitId:_0xc065bf,subUnitId:_0x425db2}=_0x13ceed;switch(_0xb6794c[_0x3dbbcb(0x17f)]&&this[_0x3dbbcb(0x171)][_0x3dbbcb(0x164)](_0xb6794c[_0x3dbbcb(0x17f)]),_0xb6794c[_0x3dbbcb(0x137)]){case v[_0x3dbbcb(0x161)]:break;case v[_0x3dbbcb(0x149)]:{this[_0x3dbbcb(0x165)]['addComment'](_0xc065bf,_0x425db2,{'unitId':_0xc065bf,'subUnitId':_0x425db2,'ref':'','id':_0xb6794c[_0x3dbbcb(0x18a)],'dT':y(+_0xb6794c['createTimestamp']),'threadId':_0xb6794c[_0x3dbbcb(0x184)],'personId':(_0x2f6c21=(_0x5d7313=_0xb6794c[_0x3dbbcb(0x17f)])==null?void 0x0:_0x5d7313[_0x3dbbcb(0x152)])!=null?_0x2f6c21:_0xb6794c['userId'],'text':JSON[_0x3dbbcb(0x18c)](_0xb6794c[_0x3dbbcb(0x143)]),'parentId':_0x13ceed['id']});break;}case v[_0x3dbbcb(0x139)]:{const _0x48c22d=this[_0x3dbbcb(0x165)][_0x3dbbcb(0x142)](_0xc065bf,_0x425db2,_0xb6794c[_0x3dbbcb(0x18a)]);_0x48c22d&&_0x48c22d[_0x3dbbcb(0x146)]&&this['_threadCommentModel'][_0x3dbbcb(0x13b)](_0xc065bf,_0x425db2,_0xb6794c[_0x3dbbcb(0x18a)]);break;}case v[_0x3dbbcb(0x156)]:{this[_0x3dbbcb(0x165)][_0x3dbbcb(0x131)](_0xc065bf,_0x425db2,{'commentId':_0xb6794c[_0x3dbbcb(0x18a)],'text':JSON['parse'](_0xb6794c[_0x3dbbcb(0x143)])});break;}case v[_0x3dbbcb(0x158)]:{const _0x402136=(_0x514210=this['_threadCommentModel']['getUnit'](_0xb6794c[_0x3dbbcb(0x172)])['find'](_0x31de39=>_0x31de39[_0x3dbbcb(0x184)]===_0xb6794c[_0x3dbbcb(0x184)]))==null?void 0x0:_0x514210['root'];_0x402136&&this[_0x3dbbcb(0x165)][_0x3dbbcb(0x167)](_0xc065bf,_0x425db2,_0x402136['id'],_0xb6794c[_0x3dbbcb(0x14c)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0x2a723d(_0x27ef41)),p(0x1,_0x2a723d(_0x378e1d)),p(0x2,_0x2a723d(_0x1a82c8)),p(0x3,_0x2a723d(_0x48547d))],_);const z=_0xf2dd0a(0x16f),O={};var k=Object[_0xf2dd0a(0x180)],Q=(_0x121ad6,_0x2099aa,_0xbb3d2b,_0x5ca734)=>{for(var _0xda0bf6=_0x5ca734>0x1?void 0x0:_0x5ca734?k(_0x2099aa,_0xbb3d2b):_0x2099aa,_0xc12bea=_0x121ad6['length']-0x1,_0x3815eb;_0xc12bea>=0x0;_0xc12bea--)(_0x3815eb=_0x121ad6[_0xc12bea])&&(_0xda0bf6=_0x3815eb(_0xda0bf6)||_0xda0bf6);return _0xda0bf6;},b=(_0x18125b,_0x4381de)=>(_0x5a6f9f,_0x387ab5)=>_0x4381de(_0x5a6f9f,_0x387ab5,_0x18125b);function _0x20b3(){const _0xc2e80c=['/delete','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_commentService','disposeWithMe','body','UNIVER_UNKNOWN','filter','thread-comment-data-source.config','slice','_userService','unitId','_httpService','COMMENT','getCurrentUser','onStarting','2gcrWcU','/reply','_config','size','comment','_configService','_initUserSync','defineProperty','user','getOwnPropertyDescriptor','Solved','addComment','YYYY/MM/DD\x20HH:mm','threadId','/add','customRanges','commentUpdate$','6815640KPJKBg','personId','replyId','UNRECOGNIZED','parse','4170XRqfsC','_sessionService','format','2670363FDClmw','users','OpenOrReOpen','6712swSIDj','2582373JjyrMK','add','listComments','get','updateComment','9569280BVbtga','map','requireSession','find','/universer-api/comment/unit/','type','_init','Delete','rangeType','deleteComment','getMemberID','getUnit','length','syncUpdateMutationToColla','_threadCommentDataSourceService','/universer-api/user/list','getComment','content','forEach','subscribe','parentId','/list','/edit','Reply','236418JBsXCB','_injector','solved','error','delete','post','1868240HNBtQJ','root','userID','setConfig','Unknown','_threadCommentDataSource','Edit','resolved','Solve','stringify','replies','40iIaDqq','symbol','reply','userId','rangeId','dataSource','Add','_initDataSource','code','addUser','_threadCommentModel','createTimestamp','resolveComment'];_0x20b3=function(){return _0xc2e80c;};return _0x20b3();}function X(_0x36dd8f,_0x43caab){const _0x1f2558=_0xf2dd0a,_0x53c775=_0x36dd8f[_0x1f2558(0x15a)][0x0];return{..._0x43caab,'id':_0x53c775['replyId'],'resolved':_0x36dd8f[_0x1f2558(0x14c)]===0x1,'dT':y(_0x53c775[_0x1f2558(0x166)]),'personId':_0x53c775[_0x1f2558(0x15e)],'threadId':_0x53c775[_0x1f2558(0x184)]};}function ee(_0x2f6674,_0x5b0134,_0x1ad43c){const _0x398fd6=_0xf2dd0a;var _0x52f95a,_0x5d1eae;if(((_0x5d1eae=(_0x52f95a=_0x2f6674==null?void 0x0:_0x2f6674[_0x398fd6(0x15a)])==null?void 0x0:_0x52f95a[_0x398fd6(0x13e)])!=null?_0x5d1eae:0x0)>0x0){const _0x422ddf=(_0x15657c,_0x1c9cbf)=>({'id':_0x15657c[_0x398fd6(0x18a)],'threadId':_0x15657c[_0x398fd6(0x184)],'dT':y(_0x15657c[_0x398fd6(0x166)]),'personId':_0x15657c[_0x398fd6(0x15e)],'resolved':_0x2f6674[_0x398fd6(0x14c)]===I[_0x398fd6(0x181)],'unitId':_0x5b0134,'subUnitId':_0x1ad43c,'text':JSON[_0x398fd6(0x18c)](_0x15657c[_0x398fd6(0x143)]),'parentId':_0x1c9cbf}),_0x542975=_0x422ddf(_0x2f6674[_0x398fd6(0x15a)][0x0]);return{..._0x542975,'children':_0x2f6674[_0x398fd6(0x15a)][_0x398fd6(0x170)](0x1)[_0x398fd6(0x133)](_0x4ed855=>_0x422ddf(_0x4ed855,_0x542975['id']))};}return null;}let S=class{constructor(_0x501c85,_0x9778bf,_0x4a0706){const _0x488c6e=_0xf2dd0a;this['_httpService']=_0x501c85,this[_0x488c6e(0x171)]=_0x9778bf,this[_0x488c6e(0x18e)]=_0x4a0706;}async[_0xf2dd0a(0x182)](_0x22fe1d){const _0x32a6be=_0xf2dd0a;var _0x225ad7,_0x82421;const {parentId:_0x329542,unitId:_0x38cbfc,text:_0x1c6112,threadId:_0x5ebdb5}=_0x22fe1d,_0x7157e3=(_0x82421=(_0x225ad7=_0x1c6112[_0x32a6be(0x186)])==null?void 0x0:_0x225ad7[_0x32a6be(0x16e)](_0x233b9f=>_0x233b9f[_0x32a6be(0x13a)]===_0x8aea36[_0x32a6be(0x174)])[_0x32a6be(0x133)](_0x20329a=>_0x20329a['rangeId']))!=null?_0x82421:[],_0xc8c301=JSON[_0x32a6be(0x159)](_0x1c6112),_0x1196e2=(await this[_0x32a6be(0x18e)][_0x32a6be(0x134)](_0x38cbfc))[_0x32a6be(0x13c)]();if(_0x329542){const _0x1712f0={'memberId':_0x1196e2,'unitId':_0x38cbfc,'content':_0xc8c301,'mention':_0x7157e3,'threadId':_0x5ebdb5},_0x5a8480=(await this['_httpService']['post'](_0x32a6be(0x136)+_0x38cbfc+_0x32a6be(0x178),{'body':_0x1712f0}))[_0x32a6be(0x16c)][_0x32a6be(0x15d)];return{..._0x22fe1d,'id':_0x5a8480[_0x32a6be(0x18a)],'dT':_0x3296f5(+_0x5a8480[_0x32a6be(0x166)])[_0x32a6be(0x128)](_0x32a6be(0x183)),'personId':_0x5a8480['userId']};}else{const _0x25f543={'memberId':_0x1196e2,'unitId':_0x38cbfc,'content':_0xc8c301,'mention':_0x7157e3},_0x18f544=await this[_0x32a6be(0x173)][_0x32a6be(0x14f)](_0x32a6be(0x136)+_0x38cbfc+_0x32a6be(0x185),{'body':_0x25f543});return X(_0x18f544['body'][_0x32a6be(0x17b)],_0x22fe1d);}}async[_0xf2dd0a(0x131)](_0x2b5516){const _0x281c01=_0xf2dd0a;var _0x4c9901,_0x31daf5;const {text:_0x1eabcf,unitId:_0xf44fcc}=_0x2b5516,_0x3da96a=(_0x31daf5=(_0x4c9901=_0x1eabcf['customRanges'])==null?void 0x0:_0x4c9901['filter'](_0x34afb5=>_0x34afb5[_0x281c01(0x13a)]===_0x8aea36[_0x281c01(0x174)])[_0x281c01(0x133)](_0x45002d=>_0x45002d[_0x281c01(0x15f)]))!=null?_0x31daf5:[],_0xc320be=JSON[_0x281c01(0x159)](_0x1eabcf),_0x340380=_0x2b5516[_0x281c01(0x184)],_0x375d5b=_0x2b5516['id'],_0x431709={'memberId':(await this[_0x281c01(0x18e)]['requireSession'](_0xf44fcc))[_0x281c01(0x13c)](),'unitId':_0xf44fcc,'threadId':_0x340380,'mention':_0x3da96a,'content':_0xc320be,'replyId':_0x375d5b},_0x48a4b2=await this[_0x281c01(0x173)][_0x281c01(0x14f)]('/universer-api/comment/unit/'+_0xf44fcc+_0x281c01(0x148),{'body':_0x431709});return!_0x48a4b2[_0x281c01(0x16c)][_0x281c01(0x14d)]||_0x48a4b2[_0x281c01(0x16c)][_0x281c01(0x14d)][_0x281c01(0x163)]===0x1;}async[_0xf2dd0a(0x167)](_0x46894a){const _0x34faa1=_0xf2dd0a,{unitId:_0x28685f}=_0x46894a,_0x276e95=_0x46894a['threadId'],_0x1d22ef={'memberId':this[_0x34faa1(0x171)][_0x34faa1(0x175)]()[_0x34faa1(0x152)],'unitId':_0x28685f,'threadId':_0x276e95,'solved':_0x46894a[_0x34faa1(0x157)]?I[_0x34faa1(0x181)]:I[_0x34faa1(0x12b)]},_0x53a167=await this['_httpService'][_0x34faa1(0x14f)]('/universer-api/comment/unit/'+_0x28685f+'/solved',{'body':_0x1d22ef});return!_0x53a167[_0x34faa1(0x16c)][_0x34faa1(0x14d)]||_0x53a167[_0x34faa1(0x16c)]['error'][_0x34faa1(0x163)]===0x1;}async['deleteComment'](_0x5505fb,_0x2530ff,_0x581f06,_0x2ae049){const _0x208c41=_0xf2dd0a,_0x319a56={'memberId':(await this[_0x208c41(0x18e)]['requireSession'](_0x5505fb))[_0x208c41(0x13c)](),'threadId':_0x581f06,'replyId':_0x2ae049,'unitId':_0x5505fb},_0xe85e02=await this[_0x208c41(0x173)][_0x208c41(0x14f)](_0x208c41(0x136)+_0x5505fb+_0x208c41(0x168),{'body':_0x319a56});return!_0xe85e02[_0x208c41(0x16c)][_0x208c41(0x14d)]||_0xe85e02[_0x208c41(0x16c)][_0x208c41(0x14d)][_0x208c41(0x163)]===0x1;}async[_0xf2dd0a(0x12f)](_0x4e2784,_0x34788e,_0x139f5f){const _0x3cc636=_0xf2dd0a,_0x44bac9={'unitId':_0x4e2784,'threadId':_0x139f5f},_0x11cb45=await this['_httpService'][_0x3cc636(0x14f)](_0x3cc636(0x136)+_0x4e2784+_0x3cc636(0x147),{'body':_0x44bac9}),_0x4a706f=_0x139f5f[_0x3cc636(0x133)](_0x516815=>ee(_0x11cb45['body']['comments'][_0x516815],_0x4e2784,_0x34788e))['filter'](Boolean);return Object['values'](_0x11cb45[_0x3cc636(0x16c)][_0x3cc636(0x12a)])[_0x3cc636(0x144)](_0x407cfd=>{this['_userService']['addUser'](_0x407cfd);}),_0x4a706f;}['saveCommentToSnapshot'](_0x111ede){const _0x42ff2f=_0xf2dd0a;return{'id':_0x111ede['id'],'threadId':_0x111ede[_0x42ff2f(0x184)],'ref':_0x111ede['ref']};}};function _0x4f80(_0xafa963,_0x53b3ab){const _0x20b31c=_0x20b3();return _0x4f80=function(_0x4f8050,_0x2f83d0){_0x4f8050=_0x4f8050-0x128;let _0x267939=_0x20b31c[_0x4f8050];return _0x267939;},_0x4f80(_0xafa963,_0x53b3ab);}S=Q([b(0x0,_0x2a723d(_0x105545)),b(0x1,_0x2a723d(_0x1a82c8)),b(0x2,_0x2a723d(_0x408cc2))],S);var re=Object[_0xf2dd0a(0x180)],te=(_0xb5e824,_0xa391bc,_0x1e4e99,_0x394c85)=>{const _0x3d1b5b=_0xf2dd0a;for(var _0x4b4688=_0x394c85>0x1?void 0x0:_0x394c85?re(_0xa391bc,_0x1e4e99):_0xa391bc,_0x383471=_0xb5e824[_0x3d1b5b(0x13e)]-0x1,_0x4c51b7;_0x383471>=0x0;_0x383471--)(_0x4c51b7=_0xb5e824[_0x383471])&&(_0x4b4688=_0x4c51b7(_0x4b4688)||_0x4b4688);return _0x4b4688;},M=(_0x2c2d19,_0x9fcb9f)=>(_0x3620cf,_0x100100)=>_0x9fcb9f(_0x3620cf,_0x100100,_0x2c2d19);let f=class extends _0x5f0700{constructor(_0xea660f,_0x175171){const _0x12490e=_0xf2dd0a;super(),this[_0x12490e(0x140)]=_0xea660f,this[_0x12490e(0x155)]=_0x175171,this['_initDataSource']();}[_0xf2dd0a(0x162)](){const _0x1fd6d0=_0xf2dd0a;this[_0x1fd6d0(0x140)][_0x1fd6d0(0x160)]=this[_0x1fd6d0(0x155)],this['_threadCommentDataSourceService'][_0x1fd6d0(0x13f)]=!0x1;}};f=te([M(0x0,_0x2bb3bb),M(0x1,_0x2a723d(S))],f);var se=Object[_0xf2dd0a(0x17e)],oe=Object[_0xf2dd0a(0x180)],ne=(_0x5df8ae,_0x1cd5b7,_0x5911ff)=>_0x1cd5b7 in _0x5df8ae?se(_0x5df8ae,_0x1cd5b7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5911ff}):_0x5df8ae[_0x1cd5b7]=_0x5911ff,ie=(_0x53b488,_0x53832f,_0x1aa73f,_0x1aa272)=>{const _0x3b3a05=_0xf2dd0a;for(var _0x132eeb=_0x1aa272>0x1?void 0x0:_0x1aa272?oe(_0x53832f,_0x1aa73f):_0x53832f,_0x5ef4a7=_0x53b488[_0x3b3a05(0x13e)]-0x1,_0x247717;_0x5ef4a7>=0x0;_0x5ef4a7--)(_0x247717=_0x53b488[_0x5ef4a7])&&(_0x132eeb=_0x247717(_0x132eeb)||_0x132eeb);return _0x132eeb;},N=(_0x2fee8f,_0x318ed6)=>(_0x37d2ba,_0x2224df)=>_0x318ed6(_0x37d2ba,_0x2224df,_0x2fee8f),$=(_0x3df332,_0x5200d7,_0xdef899)=>ne(_0x3df332,typeof _0x5200d7!=_0xf2dd0a(0x15c)?_0x5200d7+'':_0x5200d7,_0xdef899);let g=class extends _0xa37bcf{constructor(_0x12010b=O,_0x21ffe7,_0x58d343){const _0x2a10bf=_0xf2dd0a;super(),this['_config']=_0x12010b,this['_injector']=_0x21ffe7,this[_0x2a10bf(0x17c)]=_0x58d343;const {..._0x37b03a}=_0x3de015({},O,this[_0x2a10bf(0x179)]);this['_configService'][_0x2a10bf(0x153)](z,_0x37b03a);}[_0xf2dd0a(0x176)](){const _0x464609=_0xf2dd0a;[[S],[f],[_]][_0x464609(0x144)](_0x35b556=>{const _0x3912a1=_0x464609;this['_injector'][_0x3912a1(0x12e)](_0x35b556);});}['onReady'](){const _0x55e5c8=_0xf2dd0a;this[_0x55e5c8(0x14b)]['get'](f),this[_0x55e5c8(0x14b)][_0x55e5c8(0x130)](_);}};$(g,'pluginName',W),$(g,_0xf2dd0a(0x137),_0x561314[_0xf2dd0a(0x16d)]),g=ie([_0xd6cc24(_0x55c17b,_0x4d714d,_0xf62078),N(0x1,_0x2a723d(_0x48547d)),N(0x2,_0x3fbe75)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x10bff5=_0x21bb;(function(_0x285a34,_0x32f08f){const _0x1dd46c=_0x21bb,_0x53c875=_0x285a34();while(!![]){try{const _0x587b42=-parseInt(_0x1dd46c(0x1e3))/0x1*(parseInt(_0x1dd46c(0x216))/0x2)+-parseInt(_0x1dd46c(0x1ee))/0x3+-parseInt(_0x1dd46c(0x1fe))/0x4+parseInt(_0x1dd46c(0x206))/0x5*(-parseInt(_0x1dd46c(0x22c))/0x6)+-parseInt(_0x1dd46c(0x1d6))/0x7*(-parseInt(_0x1dd46c(0x1e1))/0x8)+-parseInt(_0x1dd46c(0x205))/0x9*(parseInt(_0x1dd46c(0x22e))/0xa)+-parseInt(_0x1dd46c(0x1d1))/0xb*(-parseInt(_0x1dd46c(0x1d5))/0xc);if(_0x587b42===_0x32f08f)break;else _0x53c875['push'](_0x53c875['shift']());}catch(_0x68118d){_0x53c875['push'](_0x53c875['shift']());}}}(_0x2126,0x9dafd));import{CommentService as _0x18e6ec,CollaborationSessionService as _0x524314,UniverCollaborationClientPlugin as _0x288191}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x46bf69}from'@univerjs-pro/license';import{dayjs as _0x1e783b,UserManagerService as _0xc08702,Inject as _0x346acf,Injector as _0x542fad,Disposable as _0x2b6fd7,CustomRangeType as _0x236405,UniverInstanceType as _0x1eb642,DependentOn as _0x50acbf,IConfigService as _0x194b79,Plugin as _0x44e740,merge as _0x544057}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1b94fa}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x46dddc,IThreadCommentDataSourceService as _0x4edee4}from'@univerjs/thread-comment';import{bufferTime as _0x272284}from'rxjs';import{HTTPService as _0x1851b4}from'@univerjs/network';const W=_0x10bff5(0x209);function _0x21bb(_0x55305d,_0x2a1559){const _0x212694=_0x2126();return _0x21bb=function(_0x21bbc9,_0x21615f){_0x21bbc9=_0x21bbc9-0x1ca;let _0x3485e6=_0x212694[_0x21bbc9];return _0x3485e6;},_0x21bb(_0x55305d,_0x2a1559);}var I=(_0x56f932=>(_0x56f932[_0x56f932[_0x10bff5(0x21a)]=0x0]=_0x10bff5(0x21a),_0x56f932[_0x56f932[_0x10bff5(0x1d0)]=0x1]=_0x10bff5(0x1d0),_0x56f932[_0x56f932[_0x10bff5(0x201)]=-0x1]=_0x10bff5(0x201),_0x56f932))(I||{}),v=(_0x3a7062=>(_0x3a7062[_0x3a7062[_0x10bff5(0x1e8)]=0x0]=_0x10bff5(0x1e8),_0x3a7062[_0x3a7062['Add']=0x1]=_0x10bff5(0x1ca),_0x3a7062[_0x3a7062['Reply']=0x2]='Reply',_0x3a7062[_0x3a7062[_0x10bff5(0x1e7)]=0x3]='Edit',_0x3a7062[_0x3a7062['Delete']=0x4]=_0x10bff5(0x211),_0x3a7062[_0x3a7062['Solve']=0x5]='Solve',_0x3a7062[_0x3a7062[_0x10bff5(0x201)]=-0x1]=_0x10bff5(0x201),_0x3a7062))(v||{});const y=_0x543274=>_0x1e783b(new Date(+_0x543274))[_0x10bff5(0x1ff)](_0x10bff5(0x204)),B=async(_0x385d36,_0xf7ce8a)=>{const _0x5e2e44=_0x10bff5,_0x27b137=_0x385d36[_0x5e2e44(0x218)](_0xc08702),_0x2cab8d=_0x385d36['get'](_0x1851b4);_0xf7ce8a[_0x5e2e44(0x1f0)](_0x724427=>{const _0x13f80e=_0x5e2e44;_0x27b137[_0x13f80e(0x213)](_0x724427)&&_0xf7ce8a[_0x13f80e(0x21e)](_0x724427);}),_0xf7ce8a[_0x5e2e44(0x21f)]&&(await _0x2cab8d[_0x5e2e44(0x218)](_0x5e2e44(0x1de),{'params':{'userIDs':[..._0xf7ce8a]}}))['body'][_0x5e2e44(0x203)]['forEach'](_0x474e6c=>{const _0x20b3be=_0x5e2e44;_0x474e6c&&_0x27b137[_0x20b3be(0x20f)](_0x474e6c);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x469777,_0x39d587,_0x4707e0,_0x38a992)=>{const _0x421c96=_0x10bff5;for(var _0x48f97e=_0x38a992>0x1?void 0x0:_0x38a992?K(_0x39d587,_0x4707e0):_0x39d587,_0x55019e=_0x469777[_0x421c96(0x1f7)]-0x1,_0x11b8ef;_0x55019e>=0x0;_0x55019e--)(_0x11b8ef=_0x469777[_0x55019e])&&(_0x48f97e=_0x11b8ef(_0x48f97e)||_0x48f97e);return _0x48f97e;},p=(_0x5ee64,_0x5c7b7e)=>(_0x53b028,_0x1970b7)=>_0x5c7b7e(_0x53b028,_0x1970b7,_0x5ee64);let _=class extends _0x2b6fd7{constructor(_0x29c931,_0x2fcd85,_0x2eaf60,_0x3ebd69){const _0x3366eb=_0x10bff5;super(),this[_0x3366eb(0x21c)]=_0x29c931,this[_0x3366eb(0x20d)]=_0x2fcd85,this['_userService']=_0x2eaf60,this['_injector']=_0x3ebd69,this[_0x3366eb(0x1e4)](),this['_initUserSync']();}[_0x10bff5(0x207)](){const _0x334203=_0x10bff5;this[_0x334203(0x1e9)](this[_0x334203(0x20d)][_0x334203(0x1ce)][_0x334203(0x1fc)](_0x272284(0x10))['subscribe'](_0x1fb4f4=>{const _0x6f3543=_0x334203,_0x1309e5=new Set();_0x1fb4f4[_0x6f3543(0x1f0)](_0x16f268=>{const _0x31b3ca=_0x6f3543;switch(_0x16f268['type']){case _0x31b3ca(0x1f5):{const _0x16bbaf=_0x16f268[_0x31b3ca(0x20e)][_0x31b3ca(0x208)];_0x1309e5[_0x31b3ca(0x1f5)](_0x16bbaf);break;}}}),B(this[_0x6f3543(0x228)],_0x1309e5);}));}[_0x10bff5(0x1e4)](){const _0x10e29b=_0x10bff5;this[_0x10e29b(0x1e9)](this['_commentService']['commentUpdate$'][_0x10e29b(0x1fd)](async _0xbbdf65=>{const _0x370088=_0x10e29b;var _0x840651,_0x2de963,_0x2cc4f3,_0x1ed5b8;const _0x1fcd33=(_0x840651=this[_0x370088(0x20d)]['getUnit'](_0xbbdf65[_0x370088(0x1f2)])[_0x370088(0x1e0)](_0x482723=>_0x482723[_0x370088(0x1e2)]===_0xbbdf65[_0x370088(0x1e2)]))==null?void 0x0:_0x840651[_0x370088(0x1d9)];if(!_0x1fcd33)return;const {unitId:_0x39b3f7,subUnitId:_0x16b354}=_0x1fcd33;switch(_0xbbdf65['user']&&this[_0x370088(0x1d2)][_0x370088(0x20f)](_0xbbdf65['user']),_0xbbdf65[_0x370088(0x200)]){case v[_0x370088(0x1ca)]:break;case v[_0x370088(0x212)]:{this['_threadCommentModel']['addComment'](_0x39b3f7,_0x16b354,{'unitId':_0x39b3f7,'subUnitId':_0x16b354,'ref':'','id':_0xbbdf65[_0x370088(0x219)],'dT':y(+_0xbbdf65[_0x370088(0x1dd)]),'threadId':_0xbbdf65[_0x370088(0x1e2)],'personId':(_0x2cc4f3=(_0x2de963=_0xbbdf65[_0x370088(0x1df)])==null?void 0x0:_0x2de963[_0x370088(0x230)])!=null?_0x2cc4f3:_0xbbdf65[_0x370088(0x1cd)],'text':JSON[_0x370088(0x231)](_0xbbdf65[_0x370088(0x224)]),'parentId':_0x1fcd33['id']});break;}case v[_0x370088(0x211)]:{const _0x38e15d=this['_threadCommentModel'][_0x370088(0x1fb)](_0x39b3f7,_0x16b354,_0xbbdf65['replyId']);_0x38e15d&&_0x38e15d['parentId']&&this[_0x370088(0x20d)][_0x370088(0x1cb)](_0x39b3f7,_0x16b354,_0xbbdf65[_0x370088(0x219)]);break;}case v[_0x370088(0x1e7)]:{this['_threadCommentModel'][_0x370088(0x1f1)](_0x39b3f7,_0x16b354,{'commentId':_0xbbdf65[_0x370088(0x219)],'text':JSON[_0x370088(0x231)](_0xbbdf65['content'])});break;}case v['Solve']:{const _0x19f1dc=(_0x1ed5b8=this[_0x370088(0x20d)][_0x370088(0x226)](_0xbbdf65[_0x370088(0x1f2)])[_0x370088(0x1e0)](_0x5957d2=>_0x5957d2[_0x370088(0x1e2)]===_0xbbdf65[_0x370088(0x1e2)]))==null?void 0x0:_0x1ed5b8['root'];_0x19f1dc&&this['_threadCommentModel']['resolveComment'](_0x39b3f7,_0x16b354,_0x19f1dc['id'],_0xbbdf65[_0x370088(0x227)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0x346acf(_0x18e6ec)),p(0x1,_0x346acf(_0x46dddc)),p(0x2,_0x346acf(_0xc08702)),p(0x3,_0x346acf(_0x542fad))],_);const z=_0x10bff5(0x1cf),O={};var k=Object[_0x10bff5(0x20b)],Q=(_0x1e1833,_0x47f973,_0x4428cf,_0x3cdf79)=>{for(var _0x50dfc0=_0x3cdf79>0x1?void 0x0:_0x3cdf79?k(_0x47f973,_0x4428cf):_0x47f973,_0x179b46=_0x1e1833['length']-0x1,_0x4f9773;_0x179b46>=0x0;_0x179b46--)(_0x4f9773=_0x1e1833[_0x179b46])&&(_0x50dfc0=_0x4f9773(_0x50dfc0)||_0x50dfc0);return _0x50dfc0;},b=(_0x13d331,_0x19ce6e)=>(_0x2bf489,_0x2dee88)=>_0x19ce6e(_0x2bf489,_0x2dee88,_0x13d331);function X(_0x9649af,_0x54948b){const _0x41b52a=_0x10bff5,_0x55275a=_0x9649af[_0x41b52a(0x1db)][0x0];return{..._0x54948b,'id':_0x55275a['replyId'],'resolved':_0x9649af[_0x41b52a(0x227)]===0x1,'dT':y(_0x55275a[_0x41b52a(0x1dd)]),'personId':_0x55275a[_0x41b52a(0x1cd)],'threadId':_0x55275a[_0x41b52a(0x1e2)]};}function ee(_0x5f5350,_0x5e16dd,_0x151115){const _0x2a4b8a=_0x10bff5;var _0x1e31f3,_0x108149;if(((_0x108149=(_0x1e31f3=_0x5f5350==null?void 0x0:_0x5f5350['replies'])==null?void 0x0:_0x1e31f3[_0x2a4b8a(0x1f7)])!=null?_0x108149:0x0)>0x0){const _0xebdfe8=(_0x3809eb,_0x431bcd)=>({'id':_0x3809eb[_0x2a4b8a(0x219)],'threadId':_0x3809eb[_0x2a4b8a(0x1e2)],'dT':y(_0x3809eb['createTimestamp']),'personId':_0x3809eb[_0x2a4b8a(0x1cd)],'resolved':_0x5f5350[_0x2a4b8a(0x227)]===I[_0x2a4b8a(0x1d0)],'unitId':_0x5e16dd,'subUnitId':_0x151115,'text':JSON[_0x2a4b8a(0x231)](_0x3809eb[_0x2a4b8a(0x224)]),'parentId':_0x431bcd}),_0x5d52b6=_0xebdfe8(_0x5f5350[_0x2a4b8a(0x1db)][0x0]);return{..._0x5d52b6,'children':_0x5f5350[_0x2a4b8a(0x1db)][_0x2a4b8a(0x210)](0x1)[_0x2a4b8a(0x1ec)](_0x400af1=>_0xebdfe8(_0x400af1,_0x5d52b6['id']))};}return null;}let S=class{constructor(_0x1a9962,_0x1f911a,_0x28f3d7){const _0x26ef9e=_0x10bff5;this['_httpService']=_0x1a9962,this[_0x26ef9e(0x1d2)]=_0x1f911a,this[_0x26ef9e(0x202)]=_0x28f3d7;}async[_0x10bff5(0x1f4)](_0x32867f){const _0x4886e6=_0x10bff5;var _0x5668ec,_0x1db651;const {parentId:_0x1733a,unitId:_0x13b78f,text:_0x56ecf9,threadId:_0x6849db}=_0x32867f,_0x2e4719=(_0x1db651=(_0x5668ec=_0x56ecf9[_0x4886e6(0x232)])==null?void 0x0:_0x5668ec[_0x4886e6(0x223)](_0xffc7f8=>_0xffc7f8[_0x4886e6(0x1ed)]===_0x236405[_0x4886e6(0x215)])[_0x4886e6(0x1ec)](_0x11fc2b=>_0x11fc2b['rangeId']))!=null?_0x1db651:[],_0x3a9ec4=JSON['stringify'](_0x56ecf9),_0x3c20f9=(await this[_0x4886e6(0x202)][_0x4886e6(0x21d)](_0x13b78f))[_0x4886e6(0x234)]();if(_0x1733a){const _0xd162e8={'memberId':_0x3c20f9,'unitId':_0x13b78f,'content':_0x3a9ec4,'mention':_0x2e4719,'threadId':_0x6849db},_0x1d1cd2=(await this[_0x4886e6(0x22d)]['post']('/universer-api/comment/unit/'+_0x13b78f+_0x4886e6(0x1dc),{'body':_0xd162e8}))[_0x4886e6(0x1f3)][_0x4886e6(0x221)];return{..._0x32867f,'id':_0x1d1cd2[_0x4886e6(0x219)],'dT':_0x1e783b(+_0x1d1cd2[_0x4886e6(0x1dd)])[_0x4886e6(0x1ff)](_0x4886e6(0x204)),'personId':_0x1d1cd2[_0x4886e6(0x1cd)]};}else{const _0x151524={'memberId':_0x3c20f9,'unitId':_0x13b78f,'content':_0x3a9ec4,'mention':_0x2e4719},_0x410ada=await this[_0x4886e6(0x22d)][_0x4886e6(0x1ea)](_0x4886e6(0x1d8)+_0x13b78f+_0x4886e6(0x1eb),{'body':_0x151524});return X(_0x410ada[_0x4886e6(0x1f3)][_0x4886e6(0x214)],_0x32867f);}}async[_0x10bff5(0x1f1)](_0x3c4b74){const _0x311ed7=_0x10bff5;var _0xe96652,_0x338ca0;const {text:_0x4fbd12,unitId:_0x5c9aea}=_0x3c4b74,_0x41929b=(_0x338ca0=(_0xe96652=_0x4fbd12[_0x311ed7(0x232)])==null?void 0x0:_0xe96652['filter'](_0x3f0236=>_0x3f0236[_0x311ed7(0x1ed)]===_0x236405['COMMENT'])[_0x311ed7(0x1ec)](_0x15a562=>_0x15a562[_0x311ed7(0x21b)]))!=null?_0x338ca0:[],_0x80689a=JSON[_0x311ed7(0x1f8)](_0x4fbd12),_0xad2581=_0x3c4b74[_0x311ed7(0x1e2)],_0x543bb5=_0x3c4b74['id'],_0x1ecd3f={'memberId':(await this['_sessionService']['requireSession'](_0x5c9aea))[_0x311ed7(0x234)](),'unitId':_0x5c9aea,'threadId':_0xad2581,'mention':_0x41929b,'content':_0x80689a,'replyId':_0x543bb5},_0x203d09=await this['_httpService']['post'](_0x311ed7(0x1d8)+_0x5c9aea+'/edit',{'body':_0x1ecd3f});return!_0x203d09[_0x311ed7(0x1f3)][_0x311ed7(0x222)]||_0x203d09[_0x311ed7(0x1f3)][_0x311ed7(0x222)][_0x311ed7(0x225)]===0x1;}async[_0x10bff5(0x1d4)](_0x28eec4){const _0x582462=_0x10bff5,{unitId:_0x3b7a11}=_0x28eec4,_0x4e39b9=_0x28eec4[_0x582462(0x1e2)],_0x47d274={'memberId':this[_0x582462(0x1d2)]['getCurrentUser']()[_0x582462(0x230)],'unitId':_0x3b7a11,'threadId':_0x4e39b9,'solved':_0x28eec4[_0x582462(0x220)]?I[_0x582462(0x1d0)]:I['OpenOrReOpen']},_0x2919a4=await this[_0x582462(0x22d)][_0x582462(0x1ea)](_0x582462(0x1d8)+_0x3b7a11+_0x582462(0x1cc),{'body':_0x47d274});return!_0x2919a4[_0x582462(0x1f3)][_0x582462(0x222)]||_0x2919a4[_0x582462(0x1f3)]['error'][_0x582462(0x225)]===0x1;}async[_0x10bff5(0x1cb)](_0x4a593c,_0x261dce,_0x1cf9ac,_0x5af762){const _0xea7756=_0x10bff5,_0x3a233f={'memberId':(await this['_sessionService'][_0xea7756(0x21d)](_0x4a593c))['getMemberID'](),'threadId':_0x1cf9ac,'replyId':_0x5af762,'unitId':_0x4a593c},_0x463a2d=await this['_httpService'][_0xea7756(0x1ea)]('/universer-api/comment/unit/'+_0x4a593c+_0xea7756(0x20a),{'body':_0x3a233f});return!_0x463a2d[_0xea7756(0x1f3)][_0xea7756(0x222)]||_0x463a2d[_0xea7756(0x1f3)][_0xea7756(0x222)]['code']===0x1;}async[_0x10bff5(0x22a)](_0x42fbcd,_0x4a621a,_0x5a46e4){const _0x1f92b8=_0x10bff5,_0x517c3f={'unitId':_0x42fbcd,'threadId':_0x5a46e4},_0x238857=await this[_0x1f92b8(0x22d)]['post']('/universer-api/comment/unit/'+_0x42fbcd+_0x1f92b8(0x1d7),{'body':_0x517c3f}),_0x534d3a=_0x5a46e4[_0x1f92b8(0x1ec)](_0x153410=>ee(_0x238857['body']['comments'][_0x153410],_0x42fbcd,_0x4a621a))[_0x1f92b8(0x223)](Boolean);return Object[_0x1f92b8(0x1e5)](_0x238857['body']['users'])[_0x1f92b8(0x1f0)](_0x8c6a55=>{const _0x2de03e=_0x1f92b8;this[_0x2de03e(0x1d2)]['addUser'](_0x8c6a55);}),_0x534d3a;}[_0x10bff5(0x1da)](_0x2f9a72){const _0x52ccff=_0x10bff5;return{'id':_0x2f9a72['id'],'threadId':_0x2f9a72[_0x52ccff(0x1e2)],'ref':_0x2f9a72['ref']};}};S=Q([b(0x0,_0x346acf(_0x1851b4)),b(0x1,_0x346acf(_0xc08702)),b(0x2,_0x346acf(_0x524314))],S);function _0x2126(){const _0x1c0020=['/reply','createTimestamp','/universer-api/user/list','user','find','76984RvQZSl','threadId','43rnLkqh','_init','values','onReady','Edit','Unknown','disposeWithMe','post','/add','map','rangeType','1150347VqGkfJ','_threadCommentDataSourceService','forEach','updateComment','unitId','body','addComment','add','onStarting','length','stringify','dataSource','pluginName','getComment','pipe','subscribe','4069420kIYKqH','format','type','UNRECOGNIZED','_sessionService','users','YYYY/MM/DD\x20HH:mm','306CGtIkH','78745dDkuNJ','_initUserSync','personId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/delete','getOwnPropertyDescriptor','symbol','_threadCommentModel','payload','addUser','slice','Delete','Reply','getUser','comment','COMMENT','2706BxiulY','defineProperty','get','replyId','OpenOrReOpen','rangeId','_commentService','requireSession','delete','size','resolved','reply','error','filter','content','code','getUnit','solved','_injector','_configService','listComments','_initDataSource','438iNvQia','_httpService','241510ZxmgPo','_config','userID','parse','customRanges','_threadCommentDataSource','getMemberID','Add','deleteComment','/solved','userId','commentUpdate$','thread-comment-data-source.config','Solved','110WanZFg','_userService','UNIVER_UNKNOWN','resolveComment','4163316QMDDNO','441fUEliH','/list','/universer-api/comment/unit/','root','saveCommentToSnapshot','replies'];_0x2126=function(){return _0x1c0020;};return _0x2126();}var re=Object[_0x10bff5(0x20b)],te=(_0x5afbba,_0xed95f5,_0x54d474,_0x2e01b1)=>{const _0x3e3155=_0x10bff5;for(var _0x304b91=_0x2e01b1>0x1?void 0x0:_0x2e01b1?re(_0xed95f5,_0x54d474):_0xed95f5,_0x82b4a3=_0x5afbba[_0x3e3155(0x1f7)]-0x1,_0x4ec756;_0x82b4a3>=0x0;_0x82b4a3--)(_0x4ec756=_0x5afbba[_0x82b4a3])&&(_0x304b91=_0x4ec756(_0x304b91)||_0x304b91);return _0x304b91;},M=(_0xfce24b,_0xed2172)=>(_0x1d1c74,_0x3b89a6)=>_0xed2172(_0x1d1c74,_0x3b89a6,_0xfce24b);let f=class extends _0x2b6fd7{constructor(_0x14ab74,_0x10ca7c){const _0x348c19=_0x10bff5;super(),this[_0x348c19(0x1ef)]=_0x14ab74,this['_threadCommentDataSource']=_0x10ca7c,this[_0x348c19(0x22b)]();}['_initDataSource'](){const _0x59a133=_0x10bff5;this[_0x59a133(0x1ef)][_0x59a133(0x1f9)]=this[_0x59a133(0x233)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};f=te([M(0x0,_0x4edee4),M(0x1,_0x346acf(S))],f);var se=Object[_0x10bff5(0x217)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x1c5fb8,_0x5f14a6,_0x436d5b)=>_0x5f14a6 in _0x1c5fb8?se(_0x1c5fb8,_0x5f14a6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x436d5b}):_0x1c5fb8[_0x5f14a6]=_0x436d5b,ie=(_0x55e766,_0x2e623b,_0x3dd359,_0x2c7791)=>{const _0x22f9bf=_0x10bff5;for(var _0x274cce=_0x2c7791>0x1?void 0x0:_0x2c7791?oe(_0x2e623b,_0x3dd359):_0x2e623b,_0x25970f=_0x55e766[_0x22f9bf(0x1f7)]-0x1,_0x2a5639;_0x25970f>=0x0;_0x25970f--)(_0x2a5639=_0x55e766[_0x25970f])&&(_0x274cce=_0x2a5639(_0x274cce)||_0x274cce);return _0x274cce;},N=(_0x2b0485,_0x18646e)=>(_0x22d13d,_0x2b0701)=>_0x18646e(_0x22d13d,_0x2b0701,_0x2b0485),$=(_0x4fbad8,_0x4c4206,_0x15091a)=>ne(_0x4fbad8,typeof _0x4c4206!=_0x10bff5(0x20c)?_0x4c4206+'':_0x4c4206,_0x15091a);let g=class extends _0x44e740{constructor(_0x1d993c=O,_0x2a5fe6,_0x4536d4){const _0x44cd9e=_0x10bff5;super(),this[_0x44cd9e(0x22f)]=_0x1d993c,this[_0x44cd9e(0x228)]=_0x2a5fe6,this[_0x44cd9e(0x229)]=_0x4536d4;const {..._0x37486c}=_0x544057({},O,this['_config']);this[_0x44cd9e(0x229)]['setConfig'](z,_0x37486c);}[_0x10bff5(0x1f6)](){const _0x1bcc0c=_0x10bff5;[[S],[f],[_]][_0x1bcc0c(0x1f0)](_0x2faefa=>{const _0x5e8ece=_0x1bcc0c;this[_0x5e8ece(0x228)][_0x5e8ece(0x1f5)](_0x2faefa);});}[_0x10bff5(0x1e6)](){const _0x4943f4=_0x10bff5;this['_injector'][_0x4943f4(0x218)](f),this[_0x4943f4(0x228)][_0x4943f4(0x218)](_);}};$(g,_0x10bff5(0x1fa),W),$(g,_0x10bff5(0x200),_0x1eb642[_0x10bff5(0x1d3)]),g=ie([_0x50acbf(_0x1b94fa,_0x288191,_0x46bf69),N(0x1,_0x346acf(_0x542fad)),N(0x2,_0x194b79)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x26eb(){const _0x384bbe=['IThreadCommentDataSourceService','size','rxjs','Disposable','UniverProCollaborationClient','IConfigService','UNRECOGNIZED','object','saveCommentToSnapshot','unitId','resolveComment','YYYY/MM/DD\x20HH:mm','@univerjs/thread-comment-ui','_init','addUser','11696900KyexYi','disposeWithMe','parentId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','110468qWMkeQ','defineProperty','forEach','code','updateComment','_config','replyId','threadId','pipe','UniverNetwork','length','comments','requireSession','onReady','userId','listComments','error','format','UniverThreadComment','rangeType','comment','Edit','Delete','601321oFmPdo','Add','add','createTimestamp','deleteComment','@univerjs/thread-comment','_httpService','subscribe','OpenOrReOpen','3059602faIqll','onStarting','dayjs','/add','Unknown','UniverProThreadCommentDatasource','Inject','UniverInstanceType','UniverProLicense','users','COMMENT','setConfig','UniverThreadCommentUi','getMemberID','delete','Solve','_threadCommentModel','8oQyjSA','user','type','body','toStringTag','rangeId','amd','_sessionService','pluginName','getUnit','/delete','UniverLicensePlugin','commentUpdate$','dataSource','Reply','root','_initUserSync','/reply','Injector','@univerjs-pro/collaboration-client','post','_injector','@univerjs/core','getOwnPropertyDescriptor','filter','addComment','HTTPService','_userService','@univerjs-pro/license','120kvjrlH','84oUXNeg','solved','get','customRanges','personId','_configService','UserManagerService','Plugin','2674179JoeeQz','/universer-api/user/list','UNIVER_UNKNOWN','Solved','1353648kbxZdo','userID','function','thread-comment-data-source.config','198515vgKxPS','parse','CustomRangeType','/solved','_threadCommentDataSource','symbol','stringify','_initDataSource','_commentService','find','/universer-api/comment/unit/','_threadCommentDataSourceService','replies','payload','getComment','content','UniverThreadCommentDataSourcePlugin','UniverCollaborationClientPlugin','CommentService','map'];_0x26eb=function(){return _0x384bbe;};return _0x26eb();}function _0x5d93(_0x572b6c,_0x1b5639){const _0x26eb6c=_0x26eb();return _0x5d93=function(_0x5d93bc,_0x49f7b6){_0x5d93bc=_0x5d93bc-0x12d;let _0xa76e9e=_0x26eb6c[_0x5d93bc];return _0xa76e9e;},_0x5d93(_0x572b6c,_0x1b5639);}(function(_0x4b9a23,_0x360406){const _0x23a188=_0x5d93,_0x45b82a=_0x4b9a23();while(!![]){try{const _0x5bbfd9=-parseInt(_0x23a188(0x196))/0x1+parseInt(_0x23a188(0x154))/0x2+parseInt(_0x23a188(0x148))/0x3*(parseInt(_0x23a188(0x17f))/0x4)+parseInt(_0x23a188(0x158))/0x5*(-parseInt(_0x23a188(0x147))/0x6)+-parseInt(_0x23a188(0x19f))/0x7+-parseInt(_0x23a188(0x1b0))/0x8*(parseInt(_0x23a188(0x150))/0x9)+parseInt(_0x23a188(0x17b))/0xa;if(_0x5bbfd9===_0x360406)break;else _0x45b82a['push'](_0x45b82a['shift']());}catch(_0x5d4dec){_0x45b82a['push'](_0x45b82a['shift']());}}}(_0x26eb,0x77ad0),function(_0x2673ac,_0x18786b){const _0x1a072d=_0x5d93;typeof exports==_0x1a072d(0x173)&&typeof module<'u'?_0x18786b(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==_0x1a072d(0x156)&&define[_0x1a072d(0x130)]?define(['exports',_0x1a072d(0x13d),_0x1a072d(0x146),_0x1a072d(0x140),_0x1a072d(0x178),_0x1a072d(0x19b),_0x1a072d(0x16e),'@univerjs/network'],_0x18786b):(_0x2673ac=typeof globalThis<'u'?globalThis:_0x2673ac||self,_0x18786b(_0x2673ac[_0x1a072d(0x1a4)]={},_0x2673ac[_0x1a072d(0x170)],_0x2673ac[_0x1a072d(0x1a7)],_0x2673ac['UniverCore'],_0x2673ac[_0x1a072d(0x1ab)],_0x2673ac[_0x1a072d(0x191)],_0x2673ac[_0x1a072d(0x16e)],_0x2673ac[_0x1a072d(0x188)]));}(this,function(_0x3a087b,_0x323a48,_0x575afd,_0x19df08,_0x16314d,_0x421745,_0x3762e0,_0x446d9c){'use strict';const _0x52621c=_0x5d93;const _0x2f1353=_0x52621c(0x17e);var _0x48d075=(_0x2f6aea=>(_0x2f6aea[_0x2f6aea[_0x52621c(0x19e)]=0x0]='OpenOrReOpen',_0x2f6aea[_0x2f6aea[_0x52621c(0x153)]=0x1]=_0x52621c(0x153),_0x2f6aea[_0x2f6aea['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x2f6aea))(_0x48d075||{}),_0x28aaad=(_0x457d9e=>(_0x457d9e[_0x457d9e[_0x52621c(0x1a3)]=0x0]=_0x52621c(0x1a3),_0x457d9e[_0x457d9e[_0x52621c(0x197)]=0x1]='Add',_0x457d9e[_0x457d9e['Reply']=0x2]=_0x52621c(0x138),_0x457d9e[_0x457d9e[_0x52621c(0x194)]=0x3]='Edit',_0x457d9e[_0x457d9e[_0x52621c(0x195)]=0x4]=_0x52621c(0x195),_0x457d9e[_0x457d9e[_0x52621c(0x1ae)]=0x5]=_0x52621c(0x1ae),_0x457d9e[_0x457d9e[_0x52621c(0x172)]=-0x1]=_0x52621c(0x172),_0x457d9e))(_0x28aaad||{});const _0x217280=_0x474528=>_0x19df08[_0x52621c(0x1a1)](new Date(+_0x474528))[_0x52621c(0x190)](_0x52621c(0x177)),_0x32d475=async(_0x30ee5c,_0x194c70)=>{const _0x3ea5a2=_0x52621c,_0x406fd7=_0x30ee5c['get'](_0x19df08[_0x3ea5a2(0x14e)]),_0x47f38f=_0x30ee5c[_0x3ea5a2(0x14a)](_0x446d9c[_0x3ea5a2(0x144)]);_0x194c70[_0x3ea5a2(0x181)](_0x4045f1=>{const _0x1aba79=_0x3ea5a2;_0x406fd7['getUser'](_0x4045f1)&&_0x194c70[_0x1aba79(0x1ad)](_0x4045f1);}),_0x194c70[_0x3ea5a2(0x16d)]&&(await _0x47f38f['get'](_0x3ea5a2(0x151),{'params':{'userIDs':[..._0x194c70]}}))[_0x3ea5a2(0x12d)][_0x3ea5a2(0x1a8)][_0x3ea5a2(0x181)](_0x23bba0=>{const _0x1cc050=_0x3ea5a2;_0x23bba0&&_0x406fd7[_0x1cc050(0x17a)](_0x23bba0);});};var _0x1dbe4d=Object[_0x52621c(0x141)],_0x254c2d=(_0x3edbce,_0xa07762,_0xb014b9,_0x3e347e)=>{const _0x373a31=_0x52621c;for(var _0x3230a0=_0x3e347e>0x1?void 0x0:_0x3e347e?_0x1dbe4d(_0xa07762,_0xb014b9):_0xa07762,_0x41ccef=_0x3edbce[_0x373a31(0x189)]-0x1,_0x5f4aa2;_0x41ccef>=0x0;_0x41ccef--)(_0x5f4aa2=_0x3edbce[_0x41ccef])&&(_0x3230a0=_0x5f4aa2(_0x3230a0)||_0x3230a0);return _0x3230a0;},_0x13ff24=(_0x187597,_0x315d76)=>(_0x26d958,_0x37e28a)=>_0x315d76(_0x26d958,_0x37e28a,_0x187597);let _0x26214a=class extends _0x19df08[_0x52621c(0x16f)]{constructor(_0x570951,_0x52a93c,_0x45f3cb,_0x59d76f){const _0x49df0e=_0x52621c;super(),this[_0x49df0e(0x160)]=_0x570951,this['_threadCommentModel']=_0x52a93c,this[_0x49df0e(0x145)]=_0x45f3cb,this[_0x49df0e(0x13f)]=_0x59d76f,this[_0x49df0e(0x179)](),this[_0x49df0e(0x13a)]();}[_0x52621c(0x13a)](){const _0x4e2eef=_0x52621c;this[_0x4e2eef(0x17c)](this[_0x4e2eef(0x1af)][_0x4e2eef(0x136)][_0x4e2eef(0x187)](_0x3762e0['bufferTime'](0x10))[_0x4e2eef(0x19d)](_0xa89dd8=>{const _0x41334b=_0x4e2eef,_0x103c44=new Set();_0xa89dd8[_0x41334b(0x181)](_0x6f78c8=>{const _0x270579=_0x41334b;switch(_0x6f78c8['type']){case _0x270579(0x198):{const _0x5e0f48=_0x6f78c8[_0x270579(0x165)][_0x270579(0x14c)];_0x103c44[_0x270579(0x198)](_0x5e0f48);break;}}}),_0x32d475(this[_0x41334b(0x13f)],_0x103c44);}));}[_0x52621c(0x179)](){const _0x10fab2=_0x52621c;this[_0x10fab2(0x17c)](this[_0x10fab2(0x160)][_0x10fab2(0x136)][_0x10fab2(0x19d)](async _0x5d8010=>{const _0x7ea267=_0x10fab2;var _0x2497a6,_0x87ec51,_0x16548f,_0x3dd121;const _0x256206=(_0x2497a6=this[_0x7ea267(0x1af)][_0x7ea267(0x133)](_0x5d8010[_0x7ea267(0x175)])[_0x7ea267(0x161)](_0x534e25=>_0x534e25[_0x7ea267(0x186)]===_0x5d8010['threadId']))==null?void 0x0:_0x2497a6[_0x7ea267(0x139)];if(!_0x256206)return;const {unitId:_0x358949,subUnitId:_0x31f582}=_0x256206;switch(_0x5d8010[_0x7ea267(0x1b1)]&&this[_0x7ea267(0x145)][_0x7ea267(0x17a)](_0x5d8010[_0x7ea267(0x1b1)]),_0x5d8010[_0x7ea267(0x1b2)]){case _0x28aaad[_0x7ea267(0x197)]:break;case _0x28aaad[_0x7ea267(0x138)]:{this[_0x7ea267(0x1af)][_0x7ea267(0x143)](_0x358949,_0x31f582,{'unitId':_0x358949,'subUnitId':_0x31f582,'ref':'','id':_0x5d8010[_0x7ea267(0x185)],'dT':_0x217280(+_0x5d8010['createTimestamp']),'threadId':_0x5d8010['threadId'],'personId':(_0x16548f=(_0x87ec51=_0x5d8010[_0x7ea267(0x1b1)])==null?void 0x0:_0x87ec51[_0x7ea267(0x155)])!=null?_0x16548f:_0x5d8010['userId'],'text':JSON[_0x7ea267(0x159)](_0x5d8010[_0x7ea267(0x167)]),'parentId':_0x256206['id']});break;}case _0x28aaad[_0x7ea267(0x195)]:{const _0x56107e=this[_0x7ea267(0x1af)][_0x7ea267(0x166)](_0x358949,_0x31f582,_0x5d8010[_0x7ea267(0x185)]);_0x56107e&&_0x56107e[_0x7ea267(0x17d)]&&this['_threadCommentModel'][_0x7ea267(0x19a)](_0x358949,_0x31f582,_0x5d8010[_0x7ea267(0x185)]);break;}case _0x28aaad[_0x7ea267(0x194)]:{this['_threadCommentModel'][_0x7ea267(0x183)](_0x358949,_0x31f582,{'commentId':_0x5d8010['replyId'],'text':JSON[_0x7ea267(0x159)](_0x5d8010[_0x7ea267(0x167)])});break;}case _0x28aaad[_0x7ea267(0x1ae)]:{const _0x58eaae=(_0x3dd121=this[_0x7ea267(0x1af)][_0x7ea267(0x133)](_0x5d8010[_0x7ea267(0x175)])['find'](_0x5d04c2=>_0x5d04c2[_0x7ea267(0x186)]===_0x5d8010[_0x7ea267(0x186)]))==null?void 0x0:_0x3dd121[_0x7ea267(0x139)];_0x58eaae&&this[_0x7ea267(0x1af)][_0x7ea267(0x176)](_0x358949,_0x31f582,_0x58eaae['id'],_0x5d8010[_0x7ea267(0x149)]===_0x48d075[_0x7ea267(0x153)]);break;}}}));}};_0x26214a=_0x254c2d([_0x13ff24(0x0,_0x19df08[_0x52621c(0x1a5)](_0x323a48[_0x52621c(0x16a)])),_0x13ff24(0x1,_0x19df08[_0x52621c(0x1a5)](_0x421745['ThreadCommentModel'])),_0x13ff24(0x2,_0x19df08[_0x52621c(0x1a5)](_0x19df08[_0x52621c(0x14e)])),_0x13ff24(0x3,_0x19df08['Inject'](_0x19df08[_0x52621c(0x13c)]))],_0x26214a);const _0x4b3d2e=_0x52621c(0x157),_0x2d7ec7={};var _0x20ab17=Object[_0x52621c(0x141)],_0x2b26b3=(_0x1406d3,_0x5635b0,_0x562926,_0x432411)=>{const _0x51ad3e=_0x52621c;for(var _0x13ae4b=_0x432411>0x1?void 0x0:_0x432411?_0x20ab17(_0x5635b0,_0x562926):_0x5635b0,_0x2a4a82=_0x1406d3[_0x51ad3e(0x189)]-0x1,_0x5663e9;_0x2a4a82>=0x0;_0x2a4a82--)(_0x5663e9=_0x1406d3[_0x2a4a82])&&(_0x13ae4b=_0x5663e9(_0x13ae4b)||_0x13ae4b);return _0x13ae4b;},_0xd97f5e=(_0x15a147,_0x3a4e9b)=>(_0x512065,_0x49724b)=>_0x3a4e9b(_0x512065,_0x49724b,_0x15a147);function _0x5183c8(_0x1be41b,_0x3de3b6){const _0x1b42bb=_0x52621c,_0x26c5e9=_0x1be41b[_0x1b42bb(0x164)][0x0];return{..._0x3de3b6,'id':_0x26c5e9[_0x1b42bb(0x185)],'resolved':_0x1be41b[_0x1b42bb(0x149)]===0x1,'dT':_0x217280(_0x26c5e9[_0x1b42bb(0x199)]),'personId':_0x26c5e9[_0x1b42bb(0x18d)],'threadId':_0x26c5e9[_0x1b42bb(0x186)]};}function _0x3ab341(_0x25c4dd,_0x498fec,_0x2cb424){const _0x1010d0=_0x52621c;var _0x36f90d,_0x33ebf0;if(((_0x33ebf0=(_0x36f90d=_0x25c4dd==null?void 0x0:_0x25c4dd['replies'])==null?void 0x0:_0x36f90d[_0x1010d0(0x189)])!=null?_0x33ebf0:0x0)>0x0){const _0x11f92d=(_0x20d4a4,_0x44be6e)=>({'id':_0x20d4a4['replyId'],'threadId':_0x20d4a4['threadId'],'dT':_0x217280(_0x20d4a4[_0x1010d0(0x199)]),'personId':_0x20d4a4[_0x1010d0(0x18d)],'resolved':_0x25c4dd[_0x1010d0(0x149)]===_0x48d075['Solved'],'unitId':_0x498fec,'subUnitId':_0x2cb424,'text':JSON[_0x1010d0(0x159)](_0x20d4a4[_0x1010d0(0x167)]),'parentId':_0x44be6e}),_0x5f1f47=_0x11f92d(_0x25c4dd[_0x1010d0(0x164)][0x0]);return{..._0x5f1f47,'children':_0x25c4dd[_0x1010d0(0x164)]['slice'](0x1)[_0x1010d0(0x16b)](_0x3aa11c=>_0x11f92d(_0x3aa11c,_0x5f1f47['id']))};}return null;}let _0x2e7e20=class{constructor(_0x3d78b9,_0x1db7dd,_0x5cd356){const _0x439ff4=_0x52621c;this[_0x439ff4(0x19c)]=_0x3d78b9,this[_0x439ff4(0x145)]=_0x1db7dd,this[_0x439ff4(0x131)]=_0x5cd356;}async[_0x52621c(0x143)](_0x1e2f31){const _0x5a3be3=_0x52621c;var _0x4b2ee0,_0x17f2fa;const {parentId:_0x1241fb,unitId:_0x13b7ee,text:_0x47abb2,threadId:_0x2b1a5d}=_0x1e2f31,_0x35d0a3=(_0x17f2fa=(_0x4b2ee0=_0x47abb2[_0x5a3be3(0x14b)])==null?void 0x0:_0x4b2ee0['filter'](_0x461fed=>_0x461fed[_0x5a3be3(0x192)]===_0x19df08[_0x5a3be3(0x15a)][_0x5a3be3(0x1a9)])[_0x5a3be3(0x16b)](_0x3bc4de=>_0x3bc4de[_0x5a3be3(0x12f)]))!=null?_0x17f2fa:[],_0x50e493=JSON[_0x5a3be3(0x15e)](_0x47abb2),_0x449137=(await this[_0x5a3be3(0x131)][_0x5a3be3(0x18b)](_0x13b7ee))['getMemberID']();if(_0x1241fb){const _0x4c020c={'memberId':_0x449137,'unitId':_0x13b7ee,'content':_0x50e493,'mention':_0x35d0a3,'threadId':_0x2b1a5d},_0x5e5051=(await this[_0x5a3be3(0x19c)][_0x5a3be3(0x13e)](_0x5a3be3(0x162)+_0x13b7ee+_0x5a3be3(0x13b),{'body':_0x4c020c}))['body']['reply'];return{..._0x1e2f31,'id':_0x5e5051[_0x5a3be3(0x185)],'dT':_0x19df08[_0x5a3be3(0x1a1)](+_0x5e5051[_0x5a3be3(0x199)])[_0x5a3be3(0x190)](_0x5a3be3(0x177)),'personId':_0x5e5051['userId']};}else{const _0x56b19e={'memberId':_0x449137,'unitId':_0x13b7ee,'content':_0x50e493,'mention':_0x35d0a3},_0x24606f=await this[_0x5a3be3(0x19c)][_0x5a3be3(0x13e)](_0x5a3be3(0x162)+_0x13b7ee+_0x5a3be3(0x1a2),{'body':_0x56b19e});return _0x5183c8(_0x24606f[_0x5a3be3(0x12d)][_0x5a3be3(0x193)],_0x1e2f31);}}async['updateComment'](_0x339b14){const _0x12df87=_0x52621c;var _0x14cb54,_0x3bfb85;const {text:_0x3b8059,unitId:_0x1e867d}=_0x339b14,_0x18b0e2=(_0x3bfb85=(_0x14cb54=_0x3b8059[_0x12df87(0x14b)])==null?void 0x0:_0x14cb54[_0x12df87(0x142)](_0x3d7025=>_0x3d7025[_0x12df87(0x192)]===_0x19df08[_0x12df87(0x15a)]['COMMENT'])[_0x12df87(0x16b)](_0x178d84=>_0x178d84['rangeId']))!=null?_0x3bfb85:[],_0xc6fb10=JSON['stringify'](_0x3b8059),_0x815b9f=_0x339b14[_0x12df87(0x186)],_0x1d98cc=_0x339b14['id'],_0x4a5116={'memberId':(await this[_0x12df87(0x131)][_0x12df87(0x18b)](_0x1e867d))[_0x12df87(0x1ac)](),'unitId':_0x1e867d,'threadId':_0x815b9f,'mention':_0x18b0e2,'content':_0xc6fb10,'replyId':_0x1d98cc},_0x15a7bf=await this[_0x12df87(0x19c)][_0x12df87(0x13e)](_0x12df87(0x162)+_0x1e867d+'/edit',{'body':_0x4a5116});return!_0x15a7bf[_0x12df87(0x12d)][_0x12df87(0x18f)]||_0x15a7bf['body']['error'][_0x12df87(0x182)]===0x1;}async['resolveComment'](_0x178e51){const _0xc45704=_0x52621c,{unitId:_0x48a285}=_0x178e51,_0x5474f5=_0x178e51[_0xc45704(0x186)],_0x3f3a0f={'memberId':this[_0xc45704(0x145)]['getCurrentUser']()[_0xc45704(0x155)],'unitId':_0x48a285,'threadId':_0x5474f5,'solved':_0x178e51['resolved']?_0x48d075[_0xc45704(0x153)]:_0x48d075[_0xc45704(0x19e)]},_0x588aa8=await this['_httpService']['post'](_0xc45704(0x162)+_0x48a285+_0xc45704(0x15b),{'body':_0x3f3a0f});return!_0x588aa8[_0xc45704(0x12d)][_0xc45704(0x18f)]||_0x588aa8[_0xc45704(0x12d)]['error'][_0xc45704(0x182)]===0x1;}async[_0x52621c(0x19a)](_0x3ffa4f,_0x3d8a84,_0x4a1078,_0x2dde06){const _0x10e3a9=_0x52621c,_0xa1019f={'memberId':(await this[_0x10e3a9(0x131)][_0x10e3a9(0x18b)](_0x3ffa4f))[_0x10e3a9(0x1ac)](),'threadId':_0x4a1078,'replyId':_0x2dde06,'unitId':_0x3ffa4f},_0xb4896b=await this[_0x10e3a9(0x19c)][_0x10e3a9(0x13e)](_0x10e3a9(0x162)+_0x3ffa4f+_0x10e3a9(0x134),{'body':_0xa1019f});return!_0xb4896b['body'][_0x10e3a9(0x18f)]||_0xb4896b[_0x10e3a9(0x12d)]['error']['code']===0x1;}async[_0x52621c(0x18e)](_0x373ef7,_0x3fc767,_0x3c4035){const _0x290ec2=_0x52621c,_0x4f23a0={'unitId':_0x373ef7,'threadId':_0x3c4035},_0x59f2a4=await this['_httpService'][_0x290ec2(0x13e)](_0x290ec2(0x162)+_0x373ef7+'/list',{'body':_0x4f23a0}),_0x25f204=_0x3c4035[_0x290ec2(0x16b)](_0x4ddbfd=>_0x3ab341(_0x59f2a4[_0x290ec2(0x12d)][_0x290ec2(0x18a)][_0x4ddbfd],_0x373ef7,_0x3fc767))[_0x290ec2(0x142)](Boolean);return Object['values'](_0x59f2a4['body'][_0x290ec2(0x1a8)])[_0x290ec2(0x181)](_0x26214c=>{this['_userService']['addUser'](_0x26214c);}),_0x25f204;}[_0x52621c(0x174)](_0x327c0c){const _0x331c13=_0x52621c;return{'id':_0x327c0c['id'],'threadId':_0x327c0c[_0x331c13(0x186)],'ref':_0x327c0c['ref']};}};_0x2e7e20=_0x2b26b3([_0xd97f5e(0x0,_0x19df08[_0x52621c(0x1a5)](_0x446d9c[_0x52621c(0x144)])),_0xd97f5e(0x1,_0x19df08[_0x52621c(0x1a5)](_0x19df08[_0x52621c(0x14e)])),_0xd97f5e(0x2,_0x19df08[_0x52621c(0x1a5)](_0x323a48['CollaborationSessionService']))],_0x2e7e20);var _0x42232d=Object[_0x52621c(0x141)],_0x3836f6=(_0x14f681,_0x2bd2a4,_0x2c8c66,_0x5b68bb)=>{for(var _0x2c6340=_0x5b68bb>0x1?void 0x0:_0x5b68bb?_0x42232d(_0x2bd2a4,_0x2c8c66):_0x2bd2a4,_0x50b346=_0x14f681['length']-0x1,_0x565f3c;_0x50b346>=0x0;_0x50b346--)(_0x565f3c=_0x14f681[_0x50b346])&&(_0x2c6340=_0x565f3c(_0x2c6340)||_0x2c6340);return _0x2c6340;},_0x4ab953=(_0x5c6fb7,_0x254208)=>(_0x25a362,_0x2a4a1b)=>_0x254208(_0x25a362,_0x2a4a1b,_0x5c6fb7);let _0x5ec874=class extends _0x19df08[_0x52621c(0x16f)]{constructor(_0x8cb54e,_0x5de5f0){const _0x425452=_0x52621c;super(),this['_threadCommentDataSourceService']=_0x8cb54e,this[_0x425452(0x15c)]=_0x5de5f0,this[_0x425452(0x15f)]();}['_initDataSource'](){const _0x5348e1=_0x52621c;this['_threadCommentDataSourceService'][_0x5348e1(0x137)]=this['_threadCommentDataSource'],this[_0x5348e1(0x163)]['syncUpdateMutationToColla']=!0x1;}};_0x5ec874=_0x3836f6([_0x4ab953(0x0,_0x421745[_0x52621c(0x16c)]),_0x4ab953(0x1,_0x19df08[_0x52621c(0x1a5)](_0x2e7e20))],_0x5ec874);var _0x4c04c5=Object[_0x52621c(0x180)],_0x3e63bb=Object['getOwnPropertyDescriptor'],_0x1f131f=(_0x38f7ab,_0x38fb0c,_0xc45e0)=>_0x38fb0c in _0x38f7ab?_0x4c04c5(_0x38f7ab,_0x38fb0c,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xc45e0}):_0x38f7ab[_0x38fb0c]=_0xc45e0,_0x17f52f=(_0xe783a7,_0x2ab9b0,_0xb2df55,_0x47a416)=>{const _0x19cee6=_0x52621c;for(var _0xd845e4=_0x47a416>0x1?void 0x0:_0x47a416?_0x3e63bb(_0x2ab9b0,_0xb2df55):_0x2ab9b0,_0x5e2687=_0xe783a7[_0x19cee6(0x189)]-0x1,_0x12e7a4;_0x5e2687>=0x0;_0x5e2687--)(_0x12e7a4=_0xe783a7[_0x5e2687])&&(_0xd845e4=_0x12e7a4(_0xd845e4)||_0xd845e4);return _0xd845e4;},_0x1b8b4d=(_0x7c6f04,_0x38886f)=>(_0x569c23,_0x32b914)=>_0x38886f(_0x569c23,_0x32b914,_0x7c6f04),_0x4130b6=(_0x44c847,_0x5990de,_0xf325f5)=>_0x1f131f(_0x44c847,typeof _0x5990de!=_0x52621c(0x15d)?_0x5990de+'':_0x5990de,_0xf325f5);_0x3a087b[_0x52621c(0x168)]=class extends _0x19df08[_0x52621c(0x14f)]{constructor(_0x4608b7=_0x2d7ec7,_0x30aa3e,_0x48a0fd){const _0x3e544d=_0x52621c;super(),this[_0x3e544d(0x184)]=_0x4608b7,this[_0x3e544d(0x13f)]=_0x30aa3e,this[_0x3e544d(0x14d)]=_0x48a0fd;const {..._0x59b1d8}=_0x19df08['merge']({},_0x2d7ec7,this[_0x3e544d(0x184)]);this[_0x3e544d(0x14d)][_0x3e544d(0x1aa)](_0x4b3d2e,_0x59b1d8);}[_0x52621c(0x1a0)](){const _0xd64399=_0x52621c;[[_0x2e7e20],[_0x5ec874],[_0x26214a]][_0xd64399(0x181)](_0x19ff3c=>{const _0x41296d=_0xd64399;this['_injector'][_0x41296d(0x198)](_0x19ff3c);});}[_0x52621c(0x18c)](){const _0xed3f3c=_0x52621c;this[_0xed3f3c(0x13f)]['get'](_0x5ec874),this[_0xed3f3c(0x13f)][_0xed3f3c(0x14a)](_0x26214a);}},_0x4130b6(_0x3a087b[_0x52621c(0x168)],_0x52621c(0x132),_0x2f1353),_0x4130b6(_0x3a087b['UniverThreadCommentDataSourcePlugin'],_0x52621c(0x1b2),_0x19df08[_0x52621c(0x1a6)][_0x52621c(0x152)]),_0x3a087b[_0x52621c(0x168)]=_0x17f52f([_0x19df08['DependentOn'](_0x16314d['UniverThreadCommentUIPlugin'],_0x323a48[_0x52621c(0x169)],_0x575afd[_0x52621c(0x135)]),_0x1b8b4d(0x1,_0x19df08['Inject'](_0x19df08[_0x52621c(0x13c)])),_0x1b8b4d(0x2,_0x19df08[_0x52621c(0x171)])],_0x3a087b['UniverThreadCommentDataSourcePlugin']),Object[_0x52621c(0x180)](_0x3a087b,Symbol[_0x52621c(0x12e)],{'value':'Module'});}));
|
|
1
|
+
function _0x3bda(_0x1f4b9c,_0x4d4933){const _0xbbe09d=_0xbbe0();return _0x3bda=function(_0x3bda6d,_0xd95ae0){_0x3bda6d=_0x3bda6d-0x86;let _0x1ac592=_0xbbe09d[_0x3bda6d];return _0x1ac592;},_0x3bda(_0x1f4b9c,_0x4d4933);}(function(_0x232ea9,_0x1f3334){const _0x187027=_0x3bda,_0x253d5e=_0x232ea9();while(!![]){try{const _0xb566fd=parseInt(_0x187027(0x105))/0x1*(-parseInt(_0x187027(0x10a))/0x2)+parseInt(_0x187027(0x102))/0x3+parseInt(_0x187027(0xaa))/0x4+-parseInt(_0x187027(0x90))/0x5+parseInt(_0x187027(0xbf))/0x6+-parseInt(_0x187027(0x107))/0x7+parseInt(_0x187027(0xd7))/0x8*(parseInt(_0x187027(0xeb))/0x9);if(_0xb566fd===_0x1f3334)break;else _0x253d5e['push'](_0x253d5e['shift']());}catch(_0x161e1d){_0x253d5e['push'](_0x253d5e['shift']());}}}(_0xbbe0,0x8d5c7),function(_0x514d10,_0x41c46b){const _0x47e924=_0x3bda;typeof exports==_0x47e924(0xae)&&typeof module<'u'?_0x41c46b(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==_0x47e924(0xd4)&&define['amd']?define([_0x47e924(0xa4),_0x47e924(0xaf),'@univerjs-pro/license',_0x47e924(0xb9),_0x47e924(0x97),_0x47e924(0xff),_0x47e924(0x109),_0x47e924(0x88)],_0x41c46b):(_0x514d10=typeof globalThis<'u'?globalThis:_0x514d10||self,_0x41c46b(_0x514d10[_0x47e924(0xf4)]={},_0x514d10['UniverProCollaborationClient'],_0x514d10[_0x47e924(0xbb)],_0x514d10[_0x47e924(0x94)],_0x514d10[_0x47e924(0xa5)],_0x514d10['UniverThreadComment'],_0x514d10[_0x47e924(0x109)],_0x514d10[_0x47e924(0x101)]));}(this,function(_0x450926,_0xcd18a1,_0x117662,_0x5d1429,_0x204bdc,_0x4ed01c,_0x720727,_0x47a8d6){'use strict';const _0x2f1ae2=_0x3bda;const _0x12413d='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x37cba8=(_0x449b5c=>(_0x449b5c[_0x449b5c[_0x2f1ae2(0xcf)]=0x0]=_0x2f1ae2(0xcf),_0x449b5c[_0x449b5c[_0x2f1ae2(0xd8)]=0x1]='Solved',_0x449b5c[_0x449b5c['UNRECOGNIZED']=-0x1]=_0x2f1ae2(0xfe),_0x449b5c))(_0x37cba8||{}),_0x2b5700=(_0xd4b4bc=>(_0xd4b4bc[_0xd4b4bc[_0x2f1ae2(0xfc)]=0x0]=_0x2f1ae2(0xfc),_0xd4b4bc[_0xd4b4bc[_0x2f1ae2(0xd3)]=0x1]=_0x2f1ae2(0xd3),_0xd4b4bc[_0xd4b4bc[_0x2f1ae2(0xab)]=0x2]=_0x2f1ae2(0xab),_0xd4b4bc[_0xd4b4bc['Edit']=0x3]=_0x2f1ae2(0x9b),_0xd4b4bc[_0xd4b4bc['Delete']=0x4]=_0x2f1ae2(0x8b),_0xd4b4bc[_0xd4b4bc['Solve']=0x5]='Solve',_0xd4b4bc[_0xd4b4bc[_0x2f1ae2(0xfe)]=-0x1]='UNRECOGNIZED',_0xd4b4bc))(_0x2b5700||{});const _0x2e50e9=_0x478a54=>_0x5d1429[_0x2f1ae2(0x96)](new Date(+_0x478a54))[_0x2f1ae2(0xde)](_0x2f1ae2(0x89)),_0x2bf517=async(_0x513c5f,_0x117d11)=>{const _0x2bde99=_0x2f1ae2,_0x3eeb8a=_0x513c5f['get'](_0x5d1429[_0x2bde99(0xc2)]),_0x5d3e53=_0x513c5f['get'](_0x47a8d6[_0x2bde99(0xb7)]);_0x117d11['forEach'](_0x26e727=>{const _0x4ee7d9=_0x2bde99;_0x3eeb8a[_0x4ee7d9(0xf0)](_0x26e727)&&_0x117d11['delete'](_0x26e727);}),_0x117d11[_0x2bde99(0xc8)]&&(await _0x5d3e53[_0x2bde99(0xd2)](_0x2bde99(0xb1),{'params':{'userIDs':[..._0x117d11]}}))[_0x2bde99(0xc1)][_0x2bde99(0xa3)][_0x2bde99(0x8a)](_0x4ac3ed=>{_0x4ac3ed&&_0x3eeb8a['addUser'](_0x4ac3ed);});};var _0x475384=Object['getOwnPropertyDescriptor'],_0x200f85=(_0x5e102d,_0x377f31,_0x1ead54,_0x39d095)=>{const _0x28abad=_0x2f1ae2;for(var _0x1ff3de=_0x39d095>0x1?void 0x0:_0x39d095?_0x475384(_0x377f31,_0x1ead54):_0x377f31,_0x521e37=_0x5e102d[_0x28abad(0xf6)]-0x1,_0x4b049b;_0x521e37>=0x0;_0x521e37--)(_0x4b049b=_0x5e102d[_0x521e37])&&(_0x1ff3de=_0x4b049b(_0x1ff3de)||_0x1ff3de);return _0x1ff3de;},_0x256868=(_0x189df8,_0x271622)=>(_0x1429c0,_0x36f871)=>_0x271622(_0x1429c0,_0x36f871,_0x189df8);let _0x11972=class extends _0x5d1429[_0x2f1ae2(0xb2)]{constructor(_0x2b9df1,_0xa0e33d,_0x891fde,_0x59ecd7){const _0x151fee=_0x2f1ae2;super(),this['_commentService']=_0x2b9df1,this['_threadCommentModel']=_0xa0e33d,this[_0x151fee(0xa1)]=_0x891fde,this[_0x151fee(0xee)]=_0x59ecd7,this[_0x151fee(0x103)](),this[_0x151fee(0xb0)]();}['_initUserSync'](){const _0x1ed2d6=_0x2f1ae2;this[_0x1ed2d6(0x8d)](this['_threadCommentModel'][_0x1ed2d6(0xcc)][_0x1ed2d6(0xa9)](_0x720727['bufferTime'](0x10))[_0x1ed2d6(0xdf)](_0x3dd7da=>{const _0x36932a=_0x1ed2d6,_0x28b9ae=new Set();_0x3dd7da[_0x36932a(0x8a)](_0x36a546=>{const _0x16dfc8=_0x36932a;switch(_0x36a546[_0x16dfc8(0xf3)]){case'add':{const _0x37b5f7=_0x36a546[_0x16dfc8(0xf9)][_0x16dfc8(0xe2)];_0x28b9ae[_0x16dfc8(0xb8)](_0x37b5f7);break;}}}),_0x2bf517(this[_0x36932a(0xee)],_0x28b9ae);}));}[_0x2f1ae2(0x103)](){const _0x2b4f29=_0x2f1ae2;this['disposeWithMe'](this[_0x2b4f29(0x95)][_0x2b4f29(0xcc)][_0x2b4f29(0xdf)](async _0x394082=>{const _0x3a8ae0=_0x2b4f29;var _0x17adae,_0x4e7327,_0x5df5d8,_0x4fee2d;const _0x476e7b=(_0x17adae=this['_threadCommentModel']['getUnit'](_0x394082[_0x3a8ae0(0xf2)])[_0x3a8ae0(0x8c)](_0xb966d7=>_0xb966d7['threadId']===_0x394082['threadId']))==null?void 0x0:_0x17adae['root'];if(!_0x476e7b)return;const {unitId:_0x32ffe8,subUnitId:_0x1dd871}=_0x476e7b;switch(_0x394082['user']&&this[_0x3a8ae0(0xa1)][_0x3a8ae0(0xec)](_0x394082[_0x3a8ae0(0xe0)]),_0x394082['type']){case _0x2b5700[_0x3a8ae0(0xd3)]:break;case _0x2b5700[_0x3a8ae0(0xab)]:{this['_threadCommentModel']['addComment'](_0x32ffe8,_0x1dd871,{'unitId':_0x32ffe8,'subUnitId':_0x1dd871,'ref':'','id':_0x394082[_0x3a8ae0(0xe5)],'dT':_0x2e50e9(+_0x394082[_0x3a8ae0(0x106)]),'threadId':_0x394082['threadId'],'personId':(_0x5df5d8=(_0x4e7327=_0x394082[_0x3a8ae0(0xe0)])==null?void 0x0:_0x4e7327[_0x3a8ae0(0x108)])!=null?_0x5df5d8:_0x394082[_0x3a8ae0(0xe3)],'text':JSON[_0x3a8ae0(0xea)](_0x394082['content']),'parentId':_0x476e7b['id']});break;}case _0x2b5700[_0x3a8ae0(0x8b)]:{const _0x3155af=this[_0x3a8ae0(0xc7)]['getComment'](_0x32ffe8,_0x1dd871,_0x394082[_0x3a8ae0(0xe5)]);_0x3155af&&_0x3155af[_0x3a8ae0(0xb6)]&&this[_0x3a8ae0(0xc7)]['deleteComment'](_0x32ffe8,_0x1dd871,_0x394082[_0x3a8ae0(0xe5)]);break;}case _0x2b5700[_0x3a8ae0(0x9b)]:{this[_0x3a8ae0(0xc7)][_0x3a8ae0(0xcb)](_0x32ffe8,_0x1dd871,{'commentId':_0x394082['replyId'],'text':JSON[_0x3a8ae0(0xea)](_0x394082['content'])});break;}case _0x2b5700[_0x3a8ae0(0xba)]:{const _0x18f43e=(_0x4fee2d=this[_0x3a8ae0(0xc7)][_0x3a8ae0(0x87)](_0x394082[_0x3a8ae0(0xf2)])[_0x3a8ae0(0x8c)](_0x2e1ef1=>_0x2e1ef1['threadId']===_0x394082[_0x3a8ae0(0x98)]))==null?void 0x0:_0x4fee2d[_0x3a8ae0(0x9f)];_0x18f43e&&this[_0x3a8ae0(0xc7)][_0x3a8ae0(0xda)](_0x32ffe8,_0x1dd871,_0x18f43e['id'],_0x394082[_0x3a8ae0(0x9e)]===_0x37cba8[_0x3a8ae0(0xd8)]);break;}}}));}};_0x11972=_0x200f85([_0x256868(0x0,_0x5d1429['Inject'](_0xcd18a1['CommentService'])),_0x256868(0x1,_0x5d1429[_0x2f1ae2(0xca)](_0x4ed01c['ThreadCommentModel'])),_0x256868(0x2,_0x5d1429[_0x2f1ae2(0xca)](_0x5d1429[_0x2f1ae2(0xc2)])),_0x256868(0x3,_0x5d1429['Inject'](_0x5d1429[_0x2f1ae2(0xe7)]))],_0x11972);const _0x438073=_0x2f1ae2(0xa8),_0x476311={};var _0x43fa23=Object[_0x2f1ae2(0xd6)],_0x2d9ca7=(_0x36c88a,_0x365c32,_0x5af34b,_0x29e56d)=>{const _0x2b9de5=_0x2f1ae2;for(var _0x410083=_0x29e56d>0x1?void 0x0:_0x29e56d?_0x43fa23(_0x365c32,_0x5af34b):_0x365c32,_0x15500d=_0x36c88a[_0x2b9de5(0xf6)]-0x1,_0x30a387;_0x15500d>=0x0;_0x15500d--)(_0x30a387=_0x36c88a[_0x15500d])&&(_0x410083=_0x30a387(_0x410083)||_0x410083);return _0x410083;},_0x2f4617=(_0x48b2f9,_0x421569)=>(_0xb7bfb,_0x2416e6)=>_0x421569(_0xb7bfb,_0x2416e6,_0x48b2f9);function _0x1601e5(_0x4326cc,_0x1604a1){const _0x3c1236=_0x2f1ae2,_0x1ddb13=_0x4326cc['replies'][0x0];return{..._0x1604a1,'id':_0x1ddb13[_0x3c1236(0xe5)],'resolved':_0x4326cc[_0x3c1236(0x9e)]===0x1,'dT':_0x2e50e9(_0x1ddb13[_0x3c1236(0x106)]),'personId':_0x1ddb13['userId'],'threadId':_0x1ddb13['threadId']};}function _0x12ae86(_0x2ba24f,_0x3a398b,_0x444b52){const _0x44203e=_0x2f1ae2;var _0x39b3bc,_0x32ea41;if(((_0x32ea41=(_0x39b3bc=_0x2ba24f==null?void 0x0:_0x2ba24f[_0x44203e(0xbd)])==null?void 0x0:_0x39b3bc['length'])!=null?_0x32ea41:0x0)>0x0){const _0x12b4f5=(_0x16b121,_0x2ddead)=>({'id':_0x16b121['replyId'],'threadId':_0x16b121[_0x44203e(0x98)],'dT':_0x2e50e9(_0x16b121[_0x44203e(0x106)]),'personId':_0x16b121['userId'],'resolved':_0x2ba24f[_0x44203e(0x9e)]===_0x37cba8[_0x44203e(0xd8)],'unitId':_0x3a398b,'subUnitId':_0x444b52,'text':JSON['parse'](_0x16b121[_0x44203e(0xc3)]),'parentId':_0x2ddead}),_0x346f66=_0x12b4f5(_0x2ba24f[_0x44203e(0xbd)][0x0]);return{..._0x346f66,'children':_0x2ba24f[_0x44203e(0xbd)][_0x44203e(0xf8)](0x1)[_0x44203e(0xdd)](_0x5667d4=>_0x12b4f5(_0x5667d4,_0x346f66['id']))};}return null;}let _0x49299c=class{constructor(_0x55a1bb,_0x59d909,_0x9938a1){const _0x5454cc=_0x2f1ae2;this[_0x5454cc(0x86)]=_0x55a1bb,this[_0x5454cc(0xa1)]=_0x59d909,this[_0x5454cc(0xbe)]=_0x9938a1;}async['addComment'](_0x23a30b){const _0x271b9d=_0x2f1ae2;var _0xce81b3,_0x57ba73;const {parentId:_0x29b591,unitId:_0xde2928,text:_0x500ff9,threadId:_0x49f1f3}=_0x23a30b,_0x3dfdd7=(_0x57ba73=(_0xce81b3=_0x500ff9[_0x271b9d(0xef)])==null?void 0x0:_0xce81b3[_0x271b9d(0xcd)](_0x2ab7ae=>_0x2ab7ae[_0x271b9d(0x9d)]===_0x5d1429[_0x271b9d(0xb5)][_0x271b9d(0xe1)])[_0x271b9d(0xdd)](_0x49894c=>_0x49894c['rangeId']))!=null?_0x57ba73:[],_0x226d31=JSON[_0x271b9d(0x8e)](_0x500ff9),_0x175a2d=(await this['_sessionService'][_0x271b9d(0xa2)](_0xde2928))['getMemberID']();if(_0x29b591){const _0x326464={'memberId':_0x175a2d,'unitId':_0xde2928,'content':_0x226d31,'mention':_0x3dfdd7,'threadId':_0x49f1f3},_0x2823da=(await this[_0x271b9d(0x86)][_0x271b9d(0xd5)]('/universer-api/comment/unit/'+_0xde2928+_0x271b9d(0xc0),{'body':_0x326464}))['body']['reply'];return{..._0x23a30b,'id':_0x2823da[_0x271b9d(0xe5)],'dT':_0x5d1429['dayjs'](+_0x2823da[_0x271b9d(0x106)])[_0x271b9d(0xde)](_0x271b9d(0x89)),'personId':_0x2823da[_0x271b9d(0xe3)]};}else{const _0xbd94e1={'memberId':_0x175a2d,'unitId':_0xde2928,'content':_0x226d31,'mention':_0x3dfdd7},_0x32c168=await this['_httpService'][_0x271b9d(0xd5)]('/universer-api/comment/unit/'+_0xde2928+_0x271b9d(0xd1),{'body':_0xbd94e1});return _0x1601e5(_0x32c168[_0x271b9d(0xc1)]['comment'],_0x23a30b);}}async[_0x2f1ae2(0xcb)](_0x4dba57){const _0x5e792a=_0x2f1ae2;var _0x1dfdb6,_0x525b4d;const {text:_0x2e8819,unitId:_0x173c1e}=_0x4dba57,_0x3b3a1e=(_0x525b4d=(_0x1dfdb6=_0x2e8819['customRanges'])==null?void 0x0:_0x1dfdb6['filter'](_0x38f608=>_0x38f608[_0x5e792a(0x9d)]===_0x5d1429['CustomRangeType'][_0x5e792a(0xe1)])[_0x5e792a(0xdd)](_0xae4a5d=>_0xae4a5d[_0x5e792a(0xf1)]))!=null?_0x525b4d:[],_0x13294d=JSON[_0x5e792a(0x8e)](_0x2e8819),_0x5f5cdc=_0x4dba57[_0x5e792a(0x98)],_0xd0fbef=_0x4dba57['id'],_0x5d891e={'memberId':(await this[_0x5e792a(0xbe)][_0x5e792a(0xa2)](_0x173c1e))[_0x5e792a(0x91)](),'unitId':_0x173c1e,'threadId':_0x5f5cdc,'mention':_0x3b3a1e,'content':_0x13294d,'replyId':_0xd0fbef},_0x53a241=await this[_0x5e792a(0x86)][_0x5e792a(0xd5)](_0x5e792a(0xfd)+_0x173c1e+_0x5e792a(0xa0),{'body':_0x5d891e});return!_0x53a241[_0x5e792a(0xc1)][_0x5e792a(0xc5)]||_0x53a241[_0x5e792a(0xc1)][_0x5e792a(0xc5)][_0x5e792a(0xd0)]===0x1;}async[_0x2f1ae2(0xda)](_0x5efc61){const _0xdd6696=_0x2f1ae2,{unitId:_0x183eb4}=_0x5efc61,_0x459cb5=_0x5efc61['threadId'],_0x5655f8={'memberId':this[_0xdd6696(0xa1)][_0xdd6696(0xa7)]()['userID'],'unitId':_0x183eb4,'threadId':_0x459cb5,'solved':_0x5efc61[_0xdd6696(0xfb)]?_0x37cba8['Solved']:_0x37cba8[_0xdd6696(0xcf)]},_0x2c9245=await this[_0xdd6696(0x86)]['post'](_0xdd6696(0xfd)+_0x183eb4+_0xdd6696(0xbc),{'body':_0x5655f8});return!_0x2c9245['body']['error']||_0x2c9245[_0xdd6696(0xc1)][_0xdd6696(0xc5)][_0xdd6696(0xd0)]===0x1;}async[_0x2f1ae2(0xc4)](_0x3a5d92,_0x3a26e7,_0x558956,_0x2895c3){const _0x5d7f47=_0x2f1ae2,_0x20f6a3={'memberId':(await this['_sessionService'][_0x5d7f47(0xa2)](_0x3a5d92))[_0x5d7f47(0x91)](),'threadId':_0x558956,'replyId':_0x2895c3,'unitId':_0x3a5d92},_0x3c1a45=await this[_0x5d7f47(0x86)][_0x5d7f47(0xd5)]('/universer-api/comment/unit/'+_0x3a5d92+'/delete',{'body':_0x20f6a3});return!_0x3c1a45[_0x5d7f47(0xc1)][_0x5d7f47(0xc5)]||_0x3c1a45[_0x5d7f47(0xc1)][_0x5d7f47(0xc5)][_0x5d7f47(0xd0)]===0x1;}async[_0x2f1ae2(0xdb)](_0x252926,_0x5dba2e,_0x47b342){const _0x180d57=_0x2f1ae2,_0x52405e={'unitId':_0x252926,'threadId':_0x47b342},_0x427398=await this[_0x180d57(0x86)][_0x180d57(0xd5)](_0x180d57(0xfd)+_0x252926+_0x180d57(0xa6),{'body':_0x52405e}),_0x1eb320=_0x47b342[_0x180d57(0xdd)](_0x4c3653=>_0x12ae86(_0x427398[_0x180d57(0xc1)][_0x180d57(0x8f)][_0x4c3653],_0x252926,_0x5dba2e))[_0x180d57(0xcd)](Boolean);return Object['values'](_0x427398['body'][_0x180d57(0xa3)])['forEach'](_0x43d5de=>{const _0x544962=_0x180d57;this[_0x544962(0xa1)][_0x544962(0xec)](_0x43d5de);}),_0x1eb320;}[_0x2f1ae2(0xe4)](_0x33bf69){const _0x333d75=_0x2f1ae2;return{'id':_0x33bf69['id'],'threadId':_0x33bf69[_0x333d75(0x98)],'ref':_0x33bf69[_0x333d75(0xe8)]};}};_0x49299c=_0x2d9ca7([_0x2f4617(0x0,_0x5d1429[_0x2f1ae2(0xca)](_0x47a8d6[_0x2f1ae2(0xb7)])),_0x2f4617(0x1,_0x5d1429[_0x2f1ae2(0xca)](_0x5d1429[_0x2f1ae2(0xc2)])),_0x2f4617(0x2,_0x5d1429[_0x2f1ae2(0xca)](_0xcd18a1[_0x2f1ae2(0xc6)]))],_0x49299c);var _0x265d4e=Object[_0x2f1ae2(0xd6)],_0x3c5648=(_0x52506f,_0x5041aa,_0xf3f0b7,_0xdd09da)=>{const _0x2885ba=_0x2f1ae2;for(var _0x54fe59=_0xdd09da>0x1?void 0x0:_0xdd09da?_0x265d4e(_0x5041aa,_0xf3f0b7):_0x5041aa,_0x17abe1=_0x52506f[_0x2885ba(0xf6)]-0x1,_0xe28b09;_0x17abe1>=0x0;_0x17abe1--)(_0xe28b09=_0x52506f[_0x17abe1])&&(_0x54fe59=_0xe28b09(_0x54fe59)||_0x54fe59);return _0x54fe59;},_0x1b6664=(_0x28bd14,_0x58027c)=>(_0x52383c,_0x359673)=>_0x58027c(_0x52383c,_0x359673,_0x28bd14);let _0x537e51=class extends _0x5d1429['Disposable']{constructor(_0x7352e6,_0xacdada){const _0x42fa08=_0x2f1ae2;super(),this[_0x42fa08(0x9c)]=_0x7352e6,this[_0x42fa08(0xd9)]=_0xacdada,this[_0x42fa08(0xce)]();}[_0x2f1ae2(0xce)](){const _0x1b1b23=_0x2f1ae2;this[_0x1b1b23(0x9c)][_0x1b1b23(0x92)]=this[_0x1b1b23(0xd9)],this[_0x1b1b23(0x9c)][_0x1b1b23(0x99)]=!0x1;}};_0x537e51=_0x3c5648([_0x1b6664(0x0,_0x4ed01c[_0x2f1ae2(0xb3)]),_0x1b6664(0x1,_0x5d1429['Inject'](_0x49299c))],_0x537e51);var _0x133c27=Object[_0x2f1ae2(0xdc)],_0x5421f9=Object[_0x2f1ae2(0xd6)],_0x31bb98=(_0xb35bd5,_0x12f1a7,_0x8399ee)=>_0x12f1a7 in _0xb35bd5?_0x133c27(_0xb35bd5,_0x12f1a7,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x8399ee}):_0xb35bd5[_0x12f1a7]=_0x8399ee,_0x25ba04=(_0x3f5ddf,_0x44b035,_0x46d47a,_0x15f412)=>{for(var _0xf83149=_0x15f412>0x1?void 0x0:_0x15f412?_0x5421f9(_0x44b035,_0x46d47a):_0x44b035,_0x30b343=_0x3f5ddf['length']-0x1,_0x327659;_0x30b343>=0x0;_0x30b343--)(_0x327659=_0x3f5ddf[_0x30b343])&&(_0xf83149=_0x327659(_0xf83149)||_0xf83149);return _0xf83149;},_0x1440ac=(_0x348edd,_0x337d9b)=>(_0x1c33e5,_0x26452a)=>_0x337d9b(_0x1c33e5,_0x26452a,_0x348edd),_0x46c92f=(_0x34335b,_0xd47703,_0x487880)=>_0x31bb98(_0x34335b,typeof _0xd47703!=_0x2f1ae2(0x100)?_0xd47703+'':_0xd47703,_0x487880);_0x450926[_0x2f1ae2(0xad)]=class extends _0x5d1429[_0x2f1ae2(0xfa)]{constructor(_0x1a0b40=_0x476311,_0x528004,_0x86a858){const _0x4dbd39=_0x2f1ae2;super(),this['_config']=_0x1a0b40,this[_0x4dbd39(0xee)]=_0x528004,this[_0x4dbd39(0xf7)]=_0x86a858;const {..._0x57f1f9}=_0x5d1429['merge']({},_0x476311,this[_0x4dbd39(0xc9)]);this[_0x4dbd39(0xf7)]['setConfig'](_0x438073,_0x57f1f9);}[_0x2f1ae2(0xac)](){const _0xd8e515=_0x2f1ae2;[[_0x49299c],[_0x537e51],[_0x11972]][_0xd8e515(0x8a)](_0x515bb8=>{this['_injector']['add'](_0x515bb8);});}['onReady'](){const _0x54ab27=_0x2f1ae2;this[_0x54ab27(0xee)][_0x54ab27(0xd2)](_0x537e51),this['_injector'][_0x54ab27(0xd2)](_0x11972);}},_0x46c92f(_0x450926['UniverThreadCommentDataSourcePlugin'],_0x2f1ae2(0xed),_0x12413d),_0x46c92f(_0x450926['UniverThreadCommentDataSourcePlugin'],'type',_0x5d1429[_0x2f1ae2(0xb4)]['UNIVER_UNKNOWN']),_0x450926[_0x2f1ae2(0xad)]=_0x25ba04([_0x5d1429[_0x2f1ae2(0xe6)](_0x204bdc[_0x2f1ae2(0xf5)],_0xcd18a1[_0x2f1ae2(0x104)],_0x117662['UniverLicensePlugin']),_0x1440ac(0x1,_0x5d1429[_0x2f1ae2(0xca)](_0x5d1429['Injector'])),_0x1440ac(0x2,_0x5d1429[_0x2f1ae2(0xe9)])],_0x450926[_0x2f1ae2(0xad)]),Object[_0x2f1ae2(0xdc)](_0x450926,Symbol[_0x2f1ae2(0x93)],{'value':_0x2f1ae2(0x9a)});}));function _0xbbe0(){const _0x29c1a4=['size','_config','Inject','updateComment','commentUpdate$','filter','_initDataSource','OpenOrReOpen','code','/add','get','Add','function','post','getOwnPropertyDescriptor','25150632sBpaju','Solved','_threadCommentDataSource','resolveComment','listComments','defineProperty','map','format','subscribe','user','COMMENT','personId','userId','saveCommentToSnapshot','replyId','DependentOn','Injector','ref','IConfigService','parse','9RXcGjv','addUser','pluginName','_injector','customRanges','getUser','rangeId','unitId','type','UniverProThreadCommentDatasource','UniverThreadCommentUIPlugin','length','_configService','slice','payload','Plugin','resolved','Unknown','/universer-api/comment/unit/','UNRECOGNIZED','@univerjs/thread-comment','symbol','UniverNetwork','193818OgzSAk','_init','UniverCollaborationClientPlugin','817951seMovm','createTimestamp','7195727uXyqNi','userID','rxjs','2PGDSiE','_httpService','getUnit','@univerjs/network','YYYY/MM/DD\x20HH:mm','forEach','Delete','find','disposeWithMe','stringify','comments','5012735YtSRvB','getMemberID','dataSource','toStringTag','UniverCore','_commentService','dayjs','@univerjs/thread-comment-ui','threadId','syncUpdateMutationToColla','Module','Edit','_threadCommentDataSourceService','rangeType','solved','root','/edit','_userService','requireSession','users','exports','UniverThreadCommentUi','/list','getCurrentUser','thread-comment-data-source.config','pipe','542852lDCvJe','Reply','onStarting','UniverThreadCommentDataSourcePlugin','object','@univerjs-pro/collaboration-client','_initUserSync','/universer-api/user/list','Disposable','IThreadCommentDataSourceService','UniverInstanceType','CustomRangeType','parentId','HTTPService','add','@univerjs/core','Solve','UniverProLicense','/solved','replies','_sessionService','499956gQsCxS','/reply','body','UserManagerService','content','deleteComment','error','CollaborationSessionService','_threadCommentModel'];_0xbbe0=function(){return _0x29c1a4;};return _0xbbe0();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
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/collaboration-client": "0.10.
|
|
49
|
-
"@univerjs-pro/license": "0.10.
|
|
50
|
-
"@univerjs/network": "0.10.
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.10.4",
|
|
49
|
+
"@univerjs-pro/license": "0.10.4",
|
|
50
|
+
"@univerjs/network": "0.10.4",
|
|
51
51
|
"@univerjs/protocol": "0.1.47-alpha.0",
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment": "0.10.
|
|
54
|
-
"@univerjs/
|
|
52
|
+
"@univerjs/core": "0.10.4",
|
|
53
|
+
"@univerjs/thread-comment": "0.10.4",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.10.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^7.0.6",
|
|
60
60
|
"vitest": "^3.2.4",
|
|
61
|
-
"@univerjs-infra/shared": "0.10.
|
|
61
|
+
"@univerjs-infra/shared": "0.10.4"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|