@univerjs-pro/thread-comment-datasource 0.12.1 → 0.12.2
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 _0x4bff12=_0x3fa3;(function(_0x35dbbf,_0x26de5b){const _0x39ba39=_0x3fa3,_0x5093da=_0x35dbbf();while(!![]){try{const _0x3ff795=parseInt(_0x39ba39(0x194))/0x1*(parseInt(_0x39ba39(0x176))/0x2)+parseInt(_0x39ba39(0x197))/0x3+-parseInt(_0x39ba39(0x18e))/0x4+-parseInt(_0x39ba39(0x141))/0x5+parseInt(_0x39ba39(0x19b))/0x6*(parseInt(_0x39ba39(0x160))/0x7)+-parseInt(_0x39ba39(0x199))/0x8+parseInt(_0x39ba39(0x191))/0x9*(-parseInt(_0x39ba39(0x186))/0xa);if(_0x3ff795===_0x26de5b)break;else _0x5093da['push'](_0x5093da['shift']());}catch(_0x268500){_0x5093da['push'](_0x5093da['shift']());}}}(_0x2437,0xc2d30));function _0x3fa3(_0x1929b4,_0x790b9b){const _0x2437cb=_0x2437();return _0x3fa3=function(_0x3fa3db,_0x41f2a4){_0x3fa3db=_0x3fa3db-0x12d;let _0x35d03d=_0x2437cb[_0x3fa3db];return _0x35d03d;},_0x3fa3(_0x1929b4,_0x790b9b);}Object[_0x4bff12(0x156)](exports,Symbol['toStringTag'],{'value':'Module'});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),w=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),j=require('rxjs'),P=require('@univerjs/network'),U=_0x4bff12(0x15f);var I=(_0x3ceeb3=>(_0x3ceeb3[_0x3ceeb3['OpenOrReOpen']=0x0]=_0x4bff12(0x158),_0x3ceeb3[_0x3ceeb3[_0x4bff12(0x18a)]=0x1]='Solved',_0x3ceeb3[_0x3ceeb3[_0x4bff12(0x150)]=-0x1]=_0x4bff12(0x150),_0x3ceeb3))(I||{}),v=(_0xae20c=>(_0xae20c[_0xae20c[_0x4bff12(0x193)]=0x0]=_0x4bff12(0x193),_0xae20c[_0xae20c[_0x4bff12(0x16e)]=0x1]=_0x4bff12(0x16e),_0xae20c[_0xae20c['Reply']=0x2]=_0x4bff12(0x147),_0xae20c[_0xae20c[_0x4bff12(0x16c)]=0x3]=_0x4bff12(0x16c),_0xae20c[_0xae20c[_0x4bff12(0x19e)]=0x4]=_0x4bff12(0x19e),_0xae20c[_0xae20c[_0x4bff12(0x12d)]=0x5]=_0x4bff12(0x12d),_0xae20c[_0xae20c[_0x4bff12(0x150)]=-0x1]=_0x4bff12(0x150),_0xae20c))(v||{});const f=_0x54236c=>c[_0x4bff12(0x188)](new Date(+_0x54236c))[_0x4bff12(0x1a5)](_0x4bff12(0x13c)),R=async(_0x7194ad,_0x55334c)=>{const _0x39b181=_0x4bff12,_0x5e4b79=_0x7194ad[_0x39b181(0x15b)](c[_0x39b181(0x166)]),_0x134650=_0x7194ad['get'](P['HTTPService']);_0x55334c['forEach'](_0x2e12a6=>{const _0x54ef03=_0x39b181;_0x5e4b79[_0x54ef03(0x187)](_0x2e12a6)&&_0x55334c[_0x54ef03(0x144)](_0x2e12a6);}),_0x55334c[_0x39b181(0x135)]&&(await _0x134650[_0x39b181(0x15b)](_0x39b181(0x157),{'params':{'userIDs':[..._0x55334c]}}))[_0x39b181(0x131)]['users'][_0x39b181(0x18d)](_0x1f13cd=>{const _0x55ca3c=_0x39b181;_0x1f13cd&&_0x5e4b79[_0x55ca3c(0x13b)](_0x1f13cd);});};function _0x2437(){const _0x2dc759=['3975678UIiIra','IConfigService','11085096qNsqyT','replyId','6cJqQWj','comments','thread-comment-data-source.config','Delete','COMMENT','UNIVER_UNKNOWN','resolveComment','filter','reply','code','format','Solve','_injector','UniverThreadCommentDataSourcePlugin','setConfig','body','UniverLicensePlugin','_userService','UniverThreadCommentUIPlugin','size','_threadCommentDataSource','_httpService','map','/add','getCurrentUser','addUser','YYYY/MM/DD\x20HH:mm','disposeWithMe','onStarting','rangeId','Injector','2366670cuNPCp','add','requireSession','delete','replies','_sessionService','Reply','/solved','IThreadCommentDataSourceService','_init','UniverCollaborationClientPlugin','_initDataSource','threadId','content','values','UNRECOGNIZED','createTimestamp','_threadCommentDataSourceService','DependentOn','comment','merge','defineProperty','/universer-api/user/list','OpenOrReOpen','personId','CustomRangeType','get','parentId','Plugin','Inject','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','6721274knHwvO','users','_initUserSync','CommentService','_commentService','type','UserManagerService','/list','length','getMemberID','rangeType','customRanges','Edit','_configService','Add','/delete','stringify','_threadCommentModel','/universer-api/comment/unit/','symbol','Disposable','deleteComment','4ekeBno','listComments','userID','updateComment','getComment','ThreadCommentModel','pipe','user','root','getUnit','error','subscribe','UniverInstanceType','CollaborationSessionService','/reply','parse','7162960MHTKuJ','getUser','dayjs','userId','Solved','/edit','slice','forEach','2004028mObNNU','solved','getOwnPropertyDescriptor','9YojHOp','unitId','Unknown','794433HZXmNa','payload','post'];_0x2437=function(){return _0x2dc759;};return _0x2437();}var $=Object[_0x4bff12(0x190)],E=(_0x3ef370,_0x46584c,_0x245550,_0x3de885)=>{const _0x5449e2=_0x4bff12;for(var _0x594631=_0x3de885>0x1?void 0x0:_0x3de885?$(_0x46584c,_0x245550):_0x46584c,_0x334d3e=_0x3ef370[_0x5449e2(0x168)]-0x1,_0x250470;_0x334d3e>=0x0;_0x334d3e--)(_0x250470=_0x3ef370[_0x334d3e])&&(_0x594631=_0x250470(_0x594631)||_0x594631);return _0x594631;},S=(_0xd0ab58,_0x217b9f)=>(_0x459084,_0x40cbdf)=>_0x217b9f(_0x459084,_0x40cbdf,_0xd0ab58);let _=class extends c[_0x4bff12(0x174)]{constructor(_0x58b72d,_0xaa7629,_0x1c2b68,_0x17b52a){const _0x14015d=_0x4bff12;super(),this[_0x14015d(0x164)]=_0x58b72d,this[_0x14015d(0x171)]=_0xaa7629,this[_0x14015d(0x133)]=_0x1c2b68,this[_0x14015d(0x12e)]=_0x17b52a,this[_0x14015d(0x14a)](),this[_0x14015d(0x162)]();}['_initUserSync'](){const _0x23e4ac=_0x4bff12;this[_0x23e4ac(0x13d)](this['_threadCommentModel']['commentUpdate$'][_0x23e4ac(0x17c)](j['bufferTime'](0x10))[_0x23e4ac(0x181)](_0x1c2cf4=>{const _0x18e2bd=_0x23e4ac,_0x580815=new Set();_0x1c2cf4[_0x18e2bd(0x18d)](_0x3f763a=>{const _0x3dc7fe=_0x18e2bd;switch(_0x3f763a[_0x3dc7fe(0x165)]){case _0x3dc7fe(0x142):{const _0x31af00=_0x3f763a[_0x3dc7fe(0x195)][_0x3dc7fe(0x159)];_0x580815[_0x3dc7fe(0x142)](_0x31af00);break;}}}),R(this[_0x18e2bd(0x12e)],_0x580815);}));}[_0x4bff12(0x14a)](){const _0x1cc51b=_0x4bff12;this[_0x1cc51b(0x13d)](this[_0x1cc51b(0x164)]['commentUpdate$'][_0x1cc51b(0x181)](async _0x2952b5=>{const _0x5780fb=_0x1cc51b;var _0x4a44ad,_0x1fc45c,_0xcd0030,_0x1685fa;const _0x26f005=(_0x4a44ad=this['_threadCommentModel'][_0x5780fb(0x17f)](_0x2952b5[_0x5780fb(0x192)])['find'](_0x27a152=>_0x27a152['threadId']===_0x2952b5[_0x5780fb(0x14d)]))==null?void 0x0:_0x4a44ad[_0x5780fb(0x17e)];if(!_0x26f005)return;const {unitId:_0x19ec2c,subUnitId:_0x2dd38a}=_0x26f005;switch(_0x2952b5[_0x5780fb(0x17d)]&&this[_0x5780fb(0x133)]['addUser'](_0x2952b5[_0x5780fb(0x17d)]),_0x2952b5[_0x5780fb(0x165)]){case v['Add']:break;case v[_0x5780fb(0x147)]:{this[_0x5780fb(0x171)]['addComment'](_0x19ec2c,_0x2dd38a,{'unitId':_0x19ec2c,'subUnitId':_0x2dd38a,'ref':'','id':_0x2952b5[_0x5780fb(0x19a)],'dT':f(+_0x2952b5[_0x5780fb(0x151)]),'threadId':_0x2952b5[_0x5780fb(0x14d)],'personId':(_0xcd0030=(_0x1fc45c=_0x2952b5['user'])==null?void 0x0:_0x1fc45c[_0x5780fb(0x178)])!=null?_0xcd0030:_0x2952b5[_0x5780fb(0x189)],'text':JSON[_0x5780fb(0x185)](_0x2952b5['content']),'parentId':_0x26f005['id']});break;}case v[_0x5780fb(0x19e)]:{const _0x2610bd=this[_0x5780fb(0x171)][_0x5780fb(0x17a)](_0x19ec2c,_0x2dd38a,_0x2952b5[_0x5780fb(0x19a)]);_0x2610bd&&_0x2610bd[_0x5780fb(0x15c)]&&this[_0x5780fb(0x171)][_0x5780fb(0x175)](_0x19ec2c,_0x2dd38a,_0x2952b5['replyId']);break;}case v[_0x5780fb(0x16c)]:{this['_threadCommentModel'][_0x5780fb(0x179)](_0x19ec2c,_0x2dd38a,{'commentId':_0x2952b5[_0x5780fb(0x19a)],'text':JSON[_0x5780fb(0x185)](_0x2952b5[_0x5780fb(0x14e)])});break;}case v['Solve']:{const _0x15a3ec=(_0x1685fa=this[_0x5780fb(0x171)][_0x5780fb(0x17f)](_0x2952b5['unitId'])['find'](_0x20d9d4=>_0x20d9d4[_0x5780fb(0x14d)]===_0x2952b5[_0x5780fb(0x14d)]))==null?void 0x0:_0x1685fa[_0x5780fb(0x17e)];_0x15a3ec&&this[_0x5780fb(0x171)][_0x5780fb(0x1a1)](_0x19ec2c,_0x2dd38a,_0x15a3ec['id'],_0x2952b5['solved']===I[_0x5780fb(0x18a)]);break;}}}));}};_=E([S(0x0,c[_0x4bff12(0x15e)](b[_0x4bff12(0x163)])),S(0x1,c['Inject'](M[_0x4bff12(0x17b)])),S(0x2,c['Inject'](c[_0x4bff12(0x166)])),S(0x3,c[_0x4bff12(0x15e)](c[_0x4bff12(0x140)]))],_);const q=_0x4bff12(0x19d),D={};var A=Object[_0x4bff12(0x190)],x=(_0x46068c,_0x37de42,_0xb272a5,_0x347295)=>{const _0x4711ee=_0x4bff12;for(var _0x3ba1d1=_0x347295>0x1?void 0x0:_0x347295?A(_0x37de42,_0xb272a5):_0x37de42,_0x2efd98=_0x46068c[_0x4711ee(0x168)]-0x1,_0x55d7ef;_0x2efd98>=0x0;_0x2efd98--)(_0x55d7ef=_0x46068c[_0x2efd98])&&(_0x3ba1d1=_0x55d7ef(_0x3ba1d1)||_0x3ba1d1);return _0x3ba1d1;},C=(_0xcdb6f6,_0x269e2b)=>(_0x4b5a1d,_0x159f0d)=>_0x269e2b(_0x4b5a1d,_0x159f0d,_0xcdb6f6);function Y(_0x30343b,_0x14fd29){const _0x3c935e=_0x4bff12,_0x21ae49=_0x30343b[_0x3c935e(0x145)][0x0];return{..._0x14fd29,'id':_0x21ae49['replyId'],'resolved':_0x30343b['solved']===0x1,'dT':f(_0x21ae49[_0x3c935e(0x151)]),'personId':_0x21ae49[_0x3c935e(0x189)],'threadId':_0x21ae49['threadId']};}function G(_0x485786,_0x3688dd,_0x53da58){const _0x2ee07c=_0x4bff12;var _0x4b86bb,_0x88953d;if(((_0x88953d=(_0x4b86bb=_0x485786==null?void 0x0:_0x485786['replies'])==null?void 0x0:_0x4b86bb[_0x2ee07c(0x168)])!=null?_0x88953d:0x0)>0x0){const _0x1d0603=(_0x29eff3,_0x2e0b3c)=>({'id':_0x29eff3[_0x2ee07c(0x19a)],'threadId':_0x29eff3[_0x2ee07c(0x14d)],'dT':f(_0x29eff3[_0x2ee07c(0x151)]),'personId':_0x29eff3[_0x2ee07c(0x189)],'resolved':_0x485786[_0x2ee07c(0x18f)]===I[_0x2ee07c(0x18a)],'unitId':_0x3688dd,'subUnitId':_0x53da58,'text':JSON[_0x2ee07c(0x185)](_0x29eff3['content']),'parentId':_0x2e0b3c}),_0x28adfd=_0x1d0603(_0x485786[_0x2ee07c(0x145)][0x0]);return{..._0x28adfd,'children':_0x485786[_0x2ee07c(0x145)][_0x2ee07c(0x18c)](0x1)[_0x2ee07c(0x138)](_0x3f7387=>_0x1d0603(_0x3f7387,_0x28adfd['id']))};}return null;}let p=class{constructor(_0x2369b6,_0x21224a,_0xa849b4){const _0x61d927=_0x4bff12;this[_0x61d927(0x137)]=_0x2369b6,this['_userService']=_0x21224a,this[_0x61d927(0x146)]=_0xa849b4;}async['addComment'](_0x1d4b56){const _0x4ca033=_0x4bff12;var _0x21abce,_0x4cdf7b;const {parentId:_0x50d86d,unitId:_0x573d6f,text:_0x2fbf57,threadId:_0x3b6dab}=_0x1d4b56,_0x4b31b7=(_0x4cdf7b=(_0x21abce=_0x2fbf57[_0x4ca033(0x16b)])==null?void 0x0:_0x21abce[_0x4ca033(0x1a2)](_0x47d68b=>_0x47d68b['rangeType']===c[_0x4ca033(0x15a)][_0x4ca033(0x19f)])[_0x4ca033(0x138)](_0x10e10f=>_0x10e10f[_0x4ca033(0x13f)]))!=null?_0x4cdf7b:[],_0x5144f4=JSON['stringify'](_0x2fbf57),_0x5c9fd4=(await this[_0x4ca033(0x146)][_0x4ca033(0x143)](_0x573d6f))[_0x4ca033(0x169)]();if(_0x50d86d){const _0x19cb51={'memberId':_0x5c9fd4,'unitId':_0x573d6f,'content':_0x5144f4,'mention':_0x4b31b7,'threadId':_0x3b6dab},_0x395381=(await this[_0x4ca033(0x137)]['post'](_0x4ca033(0x172)+_0x573d6f+_0x4ca033(0x184),{'body':_0x19cb51}))['body'][_0x4ca033(0x1a3)];return{..._0x1d4b56,'id':_0x395381[_0x4ca033(0x19a)],'dT':c['dayjs'](+_0x395381[_0x4ca033(0x151)])[_0x4ca033(0x1a5)](_0x4ca033(0x13c)),'personId':_0x395381[_0x4ca033(0x189)]};}else{const _0x544646={'memberId':_0x5c9fd4,'unitId':_0x573d6f,'content':_0x5144f4,'mention':_0x4b31b7},_0x4143b3=await this['_httpService'][_0x4ca033(0x196)](_0x4ca033(0x172)+_0x573d6f+_0x4ca033(0x139),{'body':_0x544646});return Y(_0x4143b3[_0x4ca033(0x131)][_0x4ca033(0x154)],_0x1d4b56);}}async[_0x4bff12(0x179)](_0x11d07c){const _0x5b5a08=_0x4bff12;var _0x1a9705,_0x2283c8;const {text:_0x341bac,unitId:_0x558414}=_0x11d07c,_0x1b019d=(_0x2283c8=(_0x1a9705=_0x341bac['customRanges'])==null?void 0x0:_0x1a9705[_0x5b5a08(0x1a2)](_0x46176d=>_0x46176d[_0x5b5a08(0x16a)]===c[_0x5b5a08(0x15a)][_0x5b5a08(0x19f)])[_0x5b5a08(0x138)](_0x4da16e=>_0x4da16e[_0x5b5a08(0x13f)]))!=null?_0x2283c8:[],_0x1f0dc7=JSON[_0x5b5a08(0x170)](_0x341bac),_0x4410c5=_0x11d07c[_0x5b5a08(0x14d)],_0x3ca959=_0x11d07c['id'],_0x51196e={'memberId':(await this[_0x5b5a08(0x146)][_0x5b5a08(0x143)](_0x558414))[_0x5b5a08(0x169)](),'unitId':_0x558414,'threadId':_0x4410c5,'mention':_0x1b019d,'content':_0x1f0dc7,'replyId':_0x3ca959},_0x46dcb4=await this[_0x5b5a08(0x137)][_0x5b5a08(0x196)](_0x5b5a08(0x172)+_0x558414+_0x5b5a08(0x18b),{'body':_0x51196e});return!_0x46dcb4[_0x5b5a08(0x131)][_0x5b5a08(0x180)]||_0x46dcb4[_0x5b5a08(0x131)][_0x5b5a08(0x180)][_0x5b5a08(0x1a4)]===0x1;}async[_0x4bff12(0x1a1)](_0x1dbd66){const _0x188cbd=_0x4bff12,{unitId:_0x6abf0c}=_0x1dbd66,_0xff84e=_0x1dbd66[_0x188cbd(0x14d)],_0x55f79a={'memberId':this[_0x188cbd(0x133)][_0x188cbd(0x13a)]()[_0x188cbd(0x178)],'unitId':_0x6abf0c,'threadId':_0xff84e,'solved':_0x1dbd66['resolved']?I[_0x188cbd(0x18a)]:I[_0x188cbd(0x158)]},_0x404d0f=await this[_0x188cbd(0x137)][_0x188cbd(0x196)]('/universer-api/comment/unit/'+_0x6abf0c+_0x188cbd(0x148),{'body':_0x55f79a});return!_0x404d0f[_0x188cbd(0x131)][_0x188cbd(0x180)]||_0x404d0f[_0x188cbd(0x131)][_0x188cbd(0x180)][_0x188cbd(0x1a4)]===0x1;}async[_0x4bff12(0x175)](_0xd275b5,_0x123b36,_0x144b2d,_0x2e3c9f){const _0x2efeb2=_0x4bff12,_0x20b907={'memberId':(await this[_0x2efeb2(0x146)][_0x2efeb2(0x143)](_0xd275b5))[_0x2efeb2(0x169)](),'threadId':_0x144b2d,'replyId':_0x2e3c9f,'unitId':_0xd275b5},_0x41f9f6=await this['_httpService']['post'](_0x2efeb2(0x172)+_0xd275b5+_0x2efeb2(0x16f),{'body':_0x20b907});return!_0x41f9f6['body'][_0x2efeb2(0x180)]||_0x41f9f6[_0x2efeb2(0x131)][_0x2efeb2(0x180)][_0x2efeb2(0x1a4)]===0x1;}async[_0x4bff12(0x177)](_0x39cf12,_0x23cc12,_0x14b29b){const _0x510128=_0x4bff12,_0x95e6ef={'unitId':_0x39cf12,'threadId':_0x14b29b},_0x369f74=await this[_0x510128(0x137)][_0x510128(0x196)](_0x510128(0x172)+_0x39cf12+_0x510128(0x167),{'body':_0x95e6ef}),_0x5395fa=_0x14b29b[_0x510128(0x138)](_0x155646=>G(_0x369f74[_0x510128(0x131)][_0x510128(0x19c)][_0x155646],_0x39cf12,_0x23cc12))[_0x510128(0x1a2)](Boolean);return Object[_0x510128(0x14f)](_0x369f74[_0x510128(0x131)][_0x510128(0x161)])[_0x510128(0x18d)](_0xafaf26=>{const _0x66110e=_0x510128;this[_0x66110e(0x133)][_0x66110e(0x13b)](_0xafaf26);}),_0x5395fa;}['saveCommentToSnapshot'](_0x41831d){return{'id':_0x41831d['id'],'threadId':_0x41831d['threadId'],'ref':_0x41831d['ref']};}};p=x([C(0x0,c[_0x4bff12(0x15e)](P['HTTPService'])),C(0x1,c[_0x4bff12(0x15e)](c[_0x4bff12(0x166)])),C(0x2,c[_0x4bff12(0x15e)](b[_0x4bff12(0x183)]))],p);var H=Object[_0x4bff12(0x190)],J=(_0x1125f8,_0x184503,_0x1ba075,_0x2bc155)=>{const _0x4530c5=_0x4bff12;for(var _0x39fbb1=_0x2bc155>0x1?void 0x0:_0x2bc155?H(_0x184503,_0x1ba075):_0x184503,_0x2be498=_0x1125f8[_0x4530c5(0x168)]-0x1,_0x420257;_0x2be498>=0x0;_0x2be498--)(_0x420257=_0x1125f8[_0x2be498])&&(_0x39fbb1=_0x420257(_0x39fbb1)||_0x39fbb1);return _0x39fbb1;},y=(_0x28a309,_0x3557cc)=>(_0x2551b9,_0x51481e)=>_0x3557cc(_0x2551b9,_0x51481e,_0x28a309);let g=class extends c['Disposable']{constructor(_0x221195,_0x3c6e05){const _0x51a9d7=_0x4bff12;super(),this['_threadCommentDataSourceService']=_0x221195,this[_0x51a9d7(0x136)]=_0x3c6e05,this[_0x51a9d7(0x14c)]();}[_0x4bff12(0x14c)](){const _0x1834a5=_0x4bff12;this[_0x1834a5(0x152)]['dataSource']=this[_0x1834a5(0x136)],this[_0x1834a5(0x152)]['syncUpdateMutationToColla']=!0x1;}};g=J([y(0x0,M[_0x4bff12(0x149)]),y(0x1,c['Inject'](p))],g);var F=Object['defineProperty'],L=Object[_0x4bff12(0x190)],Z=(_0x6f3048,_0x4cf2b4,_0x27a6d4)=>_0x4cf2b4 in _0x6f3048?F(_0x6f3048,_0x4cf2b4,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x27a6d4}):_0x6f3048[_0x4cf2b4]=_0x27a6d4,W=(_0x11e8af,_0x5ab9dd,_0x32ad18,_0x43f655)=>{const _0x3f8dd4=_0x4bff12;for(var _0x110160=_0x43f655>0x1?void 0x0:_0x43f655?L(_0x5ab9dd,_0x32ad18):_0x5ab9dd,_0x2a1500=_0x11e8af[_0x3f8dd4(0x168)]-0x1,_0x135241;_0x2a1500>=0x0;_0x2a1500--)(_0x135241=_0x11e8af[_0x2a1500])&&(_0x110160=_0x135241(_0x110160)||_0x110160);return _0x110160;},O=(_0x57a9f8,_0xaa1cdf)=>(_0x50b3f7,_0x229668)=>_0xaa1cdf(_0x50b3f7,_0x229668,_0x57a9f8),N=(_0x142ef8,_0x525a45,_0x5e3ec3)=>Z(_0x142ef8,typeof _0x525a45!=_0x4bff12(0x173)?_0x525a45+'':_0x525a45,_0x5e3ec3);exports['UniverThreadCommentDataSourcePlugin']=class extends c[_0x4bff12(0x15d)]{constructor(_0x2e0549=D,_0xccc06a,_0x1dae27){const _0x594076=_0x4bff12;super(),this['_config']=_0x2e0549,this['_injector']=_0xccc06a,this[_0x594076(0x16d)]=_0x1dae27;const {..._0x48d92f}=c[_0x594076(0x155)]({},D,this['_config']);this[_0x594076(0x16d)][_0x594076(0x130)](q,_0x48d92f);}[_0x4bff12(0x13e)](){const _0x3ec8fd=_0x4bff12;[[p],[g],[_]][_0x3ec8fd(0x18d)](_0x46f40f=>{const _0x3ebb76=_0x3ec8fd;this[_0x3ebb76(0x12e)][_0x3ebb76(0x142)](_0x46f40f);});}['onReady'](){const _0x27153c=_0x4bff12;this[_0x27153c(0x12e)]['get'](g),this[_0x27153c(0x12e)][_0x27153c(0x15b)](_);}},N(exports[_0x4bff12(0x12f)],'pluginName',U),N(exports[_0x4bff12(0x12f)],_0x4bff12(0x165),c[_0x4bff12(0x182)][_0x4bff12(0x1a0)]),exports[_0x4bff12(0x12f)]=W([c[_0x4bff12(0x153)](w[_0x4bff12(0x134)],b[_0x4bff12(0x14b)],T[_0x4bff12(0x132)]),O(0x1,c['Inject'](c[_0x4bff12(0x140)])),O(0x2,c[_0x4bff12(0x198)])],exports[_0x4bff12(0x12f)]);
|
|
1
|
+
'use strict';const _0x1e852c=_0x1aed;(function(_0x583bd5,_0x1799a1){const _0x2acdf0=_0x1aed,_0x1d9cc9=_0x583bd5();while(!![]){try{const _0x9320e6=-parseInt(_0x2acdf0(0xe7))/0x1*(-parseInt(_0x2acdf0(0xa2))/0x2)+parseInt(_0x2acdf0(0xc4))/0x3+parseInt(_0x2acdf0(0x9e))/0x4+parseInt(_0x2acdf0(0xd1))/0x5+parseInt(_0x2acdf0(0xb0))/0x6+-parseInt(_0x2acdf0(0xf0))/0x7*(parseInt(_0x2acdf0(0xd0))/0x8)+parseInt(_0x2acdf0(0xdb))/0x9*(-parseInt(_0x2acdf0(0xb4))/0xa);if(_0x9320e6===_0x1799a1)break;else _0x1d9cc9['push'](_0x1d9cc9['shift']());}catch(_0x2abe2b){_0x1d9cc9['push'](_0x1d9cc9['shift']());}}}(_0x56d9,0x4c1f6));Object[_0x1e852c(0xcf)](exports,Symbol[_0x1e852c(0xc7)],{'value':_0x1e852c(0xa0)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),w=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),j=require('rxjs'),P=require('@univerjs/network'),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x4ffc35=>(_0x4ffc35[_0x4ffc35[_0x1e852c(0xb6)]=0x0]=_0x1e852c(0xb6),_0x4ffc35[_0x4ffc35[_0x1e852c(0xcd)]=0x1]=_0x1e852c(0xcd),_0x4ffc35[_0x4ffc35[_0x1e852c(0xf8)]=-0x1]=_0x1e852c(0xf8),_0x4ffc35))(I||{}),v=(_0x59c3c5=>(_0x59c3c5[_0x59c3c5['Unknown']=0x0]=_0x1e852c(0x9d),_0x59c3c5[_0x59c3c5[_0x1e852c(0xe4)]=0x1]='Add',_0x59c3c5[_0x59c3c5['Reply']=0x2]='Reply',_0x59c3c5[_0x59c3c5['Edit']=0x3]='Edit',_0x59c3c5[_0x59c3c5[_0x1e852c(0xc9)]=0x4]='Delete',_0x59c3c5[_0x59c3c5[_0x1e852c(0xf4)]=0x5]='Solve',_0x59c3c5[_0x59c3c5[_0x1e852c(0xf8)]=-0x1]=_0x1e852c(0xf8),_0x59c3c5))(v||{});const f=_0xf604a6=>c['dayjs'](new Date(+_0xf604a6))[_0x1e852c(0xec)](_0x1e852c(0xbb)),R=async(_0x4c568d,_0x5a2d50)=>{const _0x22d23f=_0x1e852c,_0x426046=_0x4c568d[_0x22d23f(0xd7)](c['UserManagerService']),_0xadade=_0x4c568d['get'](P[_0x22d23f(0xd4)]);_0x5a2d50['forEach'](_0x16b205=>{const _0x133a51=_0x22d23f;_0x426046[_0x133a51(0x8e)](_0x16b205)&&_0x5a2d50[_0x133a51(0xcb)](_0x16b205);}),_0x5a2d50[_0x22d23f(0xd5)]&&(await _0xadade['get'](_0x22d23f(0xf2),{'params':{'userIDs':[..._0x5a2d50]}}))[_0x22d23f(0xf5)][_0x22d23f(0xe3)][_0x22d23f(0xa3)](_0x51c5ed=>{_0x51c5ed&&_0x426046['addUser'](_0x51c5ed);});};var $=Object[_0x1e852c(0xaf)],E=(_0x1fb24a,_0x522a7f,_0x2fac06,_0x4d056a)=>{const _0x56a544=_0x1e852c;for(var _0x47f8ed=_0x4d056a>0x1?void 0x0:_0x4d056a?$(_0x522a7f,_0x2fac06):_0x522a7f,_0x378de1=_0x1fb24a[_0x56a544(0xb1)]-0x1,_0x1d70c2;_0x378de1>=0x0;_0x378de1--)(_0x1d70c2=_0x1fb24a[_0x378de1])&&(_0x47f8ed=_0x1d70c2(_0x47f8ed)||_0x47f8ed);return _0x47f8ed;},S=(_0x22116e,_0x129e5b)=>(_0x319285,_0xceaf50)=>_0x129e5b(_0x319285,_0xceaf50,_0x22116e);function _0x56d9(){const _0x5c4191=['saveCommentToSnapshot','users','Add','subscribe','_initUserSync','1VwWwtx','_httpService','code','userId','resolved','format','CommentService','values','Edit','21nkFdTU','merge','/universer-api/user/list','_init','Solve','body','createTimestamp','addUser','UNRECOGNIZED','UniverLicensePlugin','onStarting','getMemberID','deleteComment','post','_threadCommentModel','type','pipe','rangeId','onReady','Plugin','UniverThreadCommentDataSourcePlugin','map','_threadCommentDataSourceService','commentUpdate$','Disposable','symbol','getUser','_injector','Injector','IConfigService','getComment','/reply','/solved','root','rangeType','_userService','_commentService','user','bufferTime','resolveComment','thread-comment-data-source.config','Unknown','680028uvxoQE','COMMENT','Module','error','473954ESNFte','forEach','customRanges','parentId','solved','getUnit','CustomRangeType','_configService','updateComment','ref','unitId','threadId','DependentOn','getOwnPropertyDescriptor','1585242IsxLqT','length','disposeWithMe','/list','10xfwxjw','addComment','OpenOrReOpen','IThreadCommentDataSourceService','find','requireSession','slice','YYYY/MM/DD\x20HH:mm','_config','userID','ThreadCommentModel','replyId','UserManagerService','add','getCurrentUser','Inject','969447iRdbhF','CollaborationSessionService','_threadCommentDataSource','toStringTag','_sessionService','Delete','UniverCollaborationClientPlugin','delete','Reply','Solved','/delete','defineProperty','741896LKVCZS','724490WrEHxn','comments','personId','HTTPService','size','syncUpdateMutationToColla','get','UniverInstanceType','parse','stringify','4943061CuGPky','/universer-api/comment/unit/','filter','replies','listComments','content','comment'];_0x56d9=function(){return _0x5c4191;};return _0x56d9();}let _=class extends c[_0x1e852c(0x8c)]{constructor(_0x1ad158,_0x5d73e8,_0x10cbec,_0x41468d){const _0x45b227=_0x1e852c;super(),this['_commentService']=_0x1ad158,this[_0x45b227(0xfe)]=_0x5d73e8,this[_0x45b227(0x97)]=_0x10cbec,this[_0x45b227(0x8f)]=_0x41468d,this[_0x45b227(0xf3)](),this[_0x45b227(0xe6)]();}['_initUserSync'](){const _0x28aa54=_0x1e852c;this[_0x28aa54(0xb2)](this[_0x28aa54(0xfe)]['commentUpdate$'][_0x28aa54(0x100)](j[_0x28aa54(0x9a)](0x10))[_0x28aa54(0xe5)](_0x4f18dc=>{const _0x2bede5=new Set();_0x4f18dc['forEach'](_0x41bc73=>{const _0x4f2c9a=_0x1aed;switch(_0x41bc73[_0x4f2c9a(0xff)]){case _0x4f2c9a(0xc1):{const _0x24e787=_0x41bc73['payload'][_0x4f2c9a(0xd3)];_0x2bede5[_0x4f2c9a(0xc1)](_0x24e787);break;}}}),R(this['_injector'],_0x2bede5);}));}[_0x1e852c(0xf3)](){const _0x36843c=_0x1e852c;this[_0x36843c(0xb2)](this[_0x36843c(0x98)][_0x36843c(0x8b)][_0x36843c(0xe5)](async _0x5c6a04=>{const _0x4335c0=_0x36843c;var _0x50f4ce,_0x2e3d99,_0x444129,_0x30fd74;const _0x1b720e=(_0x50f4ce=this[_0x4335c0(0xfe)][_0x4335c0(0xa7)](_0x5c6a04[_0x4335c0(0xac)])[_0x4335c0(0xb8)](_0x11256c=>_0x11256c[_0x4335c0(0xad)]===_0x5c6a04['threadId']))==null?void 0x0:_0x50f4ce[_0x4335c0(0x95)];if(!_0x1b720e)return;const {unitId:_0x279c70,subUnitId:_0x2f9319}=_0x1b720e;switch(_0x5c6a04['user']&&this[_0x4335c0(0x97)][_0x4335c0(0xf7)](_0x5c6a04[_0x4335c0(0x99)]),_0x5c6a04[_0x4335c0(0xff)]){case v[_0x4335c0(0xe4)]:break;case v[_0x4335c0(0xcc)]:{this[_0x4335c0(0xfe)][_0x4335c0(0xb5)](_0x279c70,_0x2f9319,{'unitId':_0x279c70,'subUnitId':_0x2f9319,'ref':'','id':_0x5c6a04[_0x4335c0(0xbf)],'dT':f(+_0x5c6a04['createTimestamp']),'threadId':_0x5c6a04[_0x4335c0(0xad)],'personId':(_0x444129=(_0x2e3d99=_0x5c6a04[_0x4335c0(0x99)])==null?void 0x0:_0x2e3d99[_0x4335c0(0xbd)])!=null?_0x444129:_0x5c6a04[_0x4335c0(0xea)],'text':JSON[_0x4335c0(0xd9)](_0x5c6a04[_0x4335c0(0xe0)]),'parentId':_0x1b720e['id']});break;}case v[_0x4335c0(0xc9)]:{const _0x1a5ba4=this[_0x4335c0(0xfe)][_0x4335c0(0x92)](_0x279c70,_0x2f9319,_0x5c6a04[_0x4335c0(0xbf)]);_0x1a5ba4&&_0x1a5ba4[_0x4335c0(0xa5)]&&this[_0x4335c0(0xfe)][_0x4335c0(0xfc)](_0x279c70,_0x2f9319,_0x5c6a04[_0x4335c0(0xbf)]);break;}case v[_0x4335c0(0xef)]:{this['_threadCommentModel'][_0x4335c0(0xaa)](_0x279c70,_0x2f9319,{'commentId':_0x5c6a04[_0x4335c0(0xbf)],'text':JSON[_0x4335c0(0xd9)](_0x5c6a04[_0x4335c0(0xe0)])});break;}case v[_0x4335c0(0xf4)]:{const _0x83f994=(_0x30fd74=this[_0x4335c0(0xfe)][_0x4335c0(0xa7)](_0x5c6a04[_0x4335c0(0xac)])[_0x4335c0(0xb8)](_0x268d01=>_0x268d01[_0x4335c0(0xad)]===_0x5c6a04[_0x4335c0(0xad)]))==null?void 0x0:_0x30fd74['root'];_0x83f994&&this[_0x4335c0(0xfe)][_0x4335c0(0x9b)](_0x279c70,_0x2f9319,_0x83f994['id'],_0x5c6a04[_0x4335c0(0xa6)]===I[_0x4335c0(0xcd)]);break;}}}));}};_=E([S(0x0,c[_0x1e852c(0xc3)](b[_0x1e852c(0xed)])),S(0x1,c[_0x1e852c(0xc3)](M[_0x1e852c(0xbe)])),S(0x2,c['Inject'](c[_0x1e852c(0xc0)])),S(0x3,c[_0x1e852c(0xc3)](c[_0x1e852c(0x90)]))],_);const q=_0x1e852c(0x9c),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x5f50a0,_0xccf826,_0x3b3ed0,_0x5b3adc)=>{const _0x551804=_0x1e852c;for(var _0x2169fc=_0x5b3adc>0x1?void 0x0:_0x5b3adc?A(_0xccf826,_0x3b3ed0):_0xccf826,_0x135827=_0x5f50a0[_0x551804(0xb1)]-0x1,_0x1affa8;_0x135827>=0x0;_0x135827--)(_0x1affa8=_0x5f50a0[_0x135827])&&(_0x2169fc=_0x1affa8(_0x2169fc)||_0x2169fc);return _0x2169fc;},C=(_0x2a0317,_0x250465)=>(_0x854252,_0xdd4ec6)=>_0x250465(_0x854252,_0xdd4ec6,_0x2a0317);function Y(_0x40a5cb,_0x14ec5d){const _0x5b76d5=_0x1e852c,_0x210bcc=_0x40a5cb[_0x5b76d5(0xde)][0x0];return{..._0x14ec5d,'id':_0x210bcc[_0x5b76d5(0xbf)],'resolved':_0x40a5cb[_0x5b76d5(0xa6)]===0x1,'dT':f(_0x210bcc[_0x5b76d5(0xf6)]),'personId':_0x210bcc[_0x5b76d5(0xea)],'threadId':_0x210bcc[_0x5b76d5(0xad)]};}function G(_0x276209,_0x4d01e8,_0x2fb708){const _0x1aaab7=_0x1e852c;var _0x15b83f,_0x1f3920;if(((_0x1f3920=(_0x15b83f=_0x276209==null?void 0x0:_0x276209[_0x1aaab7(0xde)])==null?void 0x0:_0x15b83f[_0x1aaab7(0xb1)])!=null?_0x1f3920:0x0)>0x0){const _0x41d41f=(_0x3a4a1d,_0x1f1f1c)=>({'id':_0x3a4a1d[_0x1aaab7(0xbf)],'threadId':_0x3a4a1d[_0x1aaab7(0xad)],'dT':f(_0x3a4a1d['createTimestamp']),'personId':_0x3a4a1d['userId'],'resolved':_0x276209[_0x1aaab7(0xa6)]===I['Solved'],'unitId':_0x4d01e8,'subUnitId':_0x2fb708,'text':JSON[_0x1aaab7(0xd9)](_0x3a4a1d[_0x1aaab7(0xe0)]),'parentId':_0x1f1f1c}),_0x492df7=_0x41d41f(_0x276209['replies'][0x0]);return{..._0x492df7,'children':_0x276209[_0x1aaab7(0xde)][_0x1aaab7(0xba)](0x1)[_0x1aaab7(0x89)](_0x639a4f=>_0x41d41f(_0x639a4f,_0x492df7['id']))};}return null;}let p=class{constructor(_0x34a515,_0x5c86ba,_0x309ca4){const _0x3eb59d=_0x1e852c;this[_0x3eb59d(0xe8)]=_0x34a515,this[_0x3eb59d(0x97)]=_0x5c86ba,this['_sessionService']=_0x309ca4;}async['addComment'](_0x321d0b){const _0x2492e7=_0x1e852c;var _0x2e0ee2,_0x4b7e1f;const {parentId:_0x210438,unitId:_0x3ce1df,text:_0x50e1de,threadId:_0xdd2fc4}=_0x321d0b,_0x29b420=(_0x4b7e1f=(_0x2e0ee2=_0x50e1de[_0x2492e7(0xa4)])==null?void 0x0:_0x2e0ee2['filter'](_0x2462a6=>_0x2462a6[_0x2492e7(0x96)]===c[_0x2492e7(0xa8)]['COMMENT'])['map'](_0x3c9b6b=>_0x3c9b6b[_0x2492e7(0x101)]))!=null?_0x4b7e1f:[],_0x243b19=JSON[_0x2492e7(0xda)](_0x50e1de),_0x7b8061=(await this[_0x2492e7(0xc8)]['requireSession'](_0x3ce1df))[_0x2492e7(0xfb)]();if(_0x210438){const _0x577e42={'memberId':_0x7b8061,'unitId':_0x3ce1df,'content':_0x243b19,'mention':_0x29b420,'threadId':_0xdd2fc4},_0x488236=(await this[_0x2492e7(0xe8)][_0x2492e7(0xfd)](_0x2492e7(0xdc)+_0x3ce1df+_0x2492e7(0x93),{'body':_0x577e42}))[_0x2492e7(0xf5)]['reply'];return{..._0x321d0b,'id':_0x488236[_0x2492e7(0xbf)],'dT':c['dayjs'](+_0x488236[_0x2492e7(0xf6)])[_0x2492e7(0xec)](_0x2492e7(0xbb)),'personId':_0x488236[_0x2492e7(0xea)]};}else{const _0x2920e0={'memberId':_0x7b8061,'unitId':_0x3ce1df,'content':_0x243b19,'mention':_0x29b420},_0x564e80=await this[_0x2492e7(0xe8)][_0x2492e7(0xfd)](_0x2492e7(0xdc)+_0x3ce1df+'/add',{'body':_0x2920e0});return Y(_0x564e80['body'][_0x2492e7(0xe1)],_0x321d0b);}}async[_0x1e852c(0xaa)](_0x48be23){const _0x16ca5c=_0x1e852c;var _0x29aa2b,_0x1c7b03;const {text:_0x28ff12,unitId:_0x3d5292}=_0x48be23,_0x4d0e1f=(_0x1c7b03=(_0x29aa2b=_0x28ff12['customRanges'])==null?void 0x0:_0x29aa2b['filter'](_0x49b6f3=>_0x49b6f3[_0x16ca5c(0x96)]===c[_0x16ca5c(0xa8)][_0x16ca5c(0x9f)])['map'](_0x393bf8=>_0x393bf8['rangeId']))!=null?_0x1c7b03:[],_0x5e2897=JSON[_0x16ca5c(0xda)](_0x28ff12),_0xa0e47=_0x48be23[_0x16ca5c(0xad)],_0x2dfec6=_0x48be23['id'],_0x44c82b={'memberId':(await this[_0x16ca5c(0xc8)][_0x16ca5c(0xb9)](_0x3d5292))[_0x16ca5c(0xfb)](),'unitId':_0x3d5292,'threadId':_0xa0e47,'mention':_0x4d0e1f,'content':_0x5e2897,'replyId':_0x2dfec6},_0x5d4a6d=await this['_httpService'][_0x16ca5c(0xfd)](_0x16ca5c(0xdc)+_0x3d5292+'/edit',{'body':_0x44c82b});return!_0x5d4a6d[_0x16ca5c(0xf5)][_0x16ca5c(0xa1)]||_0x5d4a6d[_0x16ca5c(0xf5)]['error'][_0x16ca5c(0xe9)]===0x1;}async[_0x1e852c(0x9b)](_0x4a041a){const _0x42db8c=_0x1e852c,{unitId:_0x2a2c6b}=_0x4a041a,_0x73dea6=_0x4a041a['threadId'],_0x357720={'memberId':this['_userService'][_0x42db8c(0xc2)]()[_0x42db8c(0xbd)],'unitId':_0x2a2c6b,'threadId':_0x73dea6,'solved':_0x4a041a[_0x42db8c(0xeb)]?I[_0x42db8c(0xcd)]:I[_0x42db8c(0xb6)]},_0x363441=await this[_0x42db8c(0xe8)][_0x42db8c(0xfd)](_0x42db8c(0xdc)+_0x2a2c6b+_0x42db8c(0x94),{'body':_0x357720});return!_0x363441[_0x42db8c(0xf5)][_0x42db8c(0xa1)]||_0x363441[_0x42db8c(0xf5)][_0x42db8c(0xa1)][_0x42db8c(0xe9)]===0x1;}async[_0x1e852c(0xfc)](_0x4f18e1,_0x214cc2,_0x4a8365,_0x45c2b3){const _0x5e9611=_0x1e852c,_0x253db6={'memberId':(await this[_0x5e9611(0xc8)][_0x5e9611(0xb9)](_0x4f18e1))[_0x5e9611(0xfb)](),'threadId':_0x4a8365,'replyId':_0x45c2b3,'unitId':_0x4f18e1},_0x577fcb=await this[_0x5e9611(0xe8)][_0x5e9611(0xfd)](_0x5e9611(0xdc)+_0x4f18e1+_0x5e9611(0xce),{'body':_0x253db6});return!_0x577fcb['body'][_0x5e9611(0xa1)]||_0x577fcb[_0x5e9611(0xf5)][_0x5e9611(0xa1)][_0x5e9611(0xe9)]===0x1;}async[_0x1e852c(0xdf)](_0x51cedf,_0x2fc03e,_0x529abf){const _0x46060f=_0x1e852c,_0x23cbda={'unitId':_0x51cedf,'threadId':_0x529abf},_0x4e8577=await this[_0x46060f(0xe8)][_0x46060f(0xfd)](_0x46060f(0xdc)+_0x51cedf+_0x46060f(0xb3),{'body':_0x23cbda}),_0x12b7b5=_0x529abf[_0x46060f(0x89)](_0x23954d=>G(_0x4e8577[_0x46060f(0xf5)][_0x46060f(0xd2)][_0x23954d],_0x51cedf,_0x2fc03e))[_0x46060f(0xdd)](Boolean);return Object[_0x46060f(0xee)](_0x4e8577[_0x46060f(0xf5)]['users'])['forEach'](_0x10a83f=>{const _0x3f2d8d=_0x46060f;this[_0x3f2d8d(0x97)]['addUser'](_0x10a83f);}),_0x12b7b5;}[_0x1e852c(0xe2)](_0x3c1574){const _0x4d53a2=_0x1e852c;return{'id':_0x3c1574['id'],'threadId':_0x3c1574['threadId'],'ref':_0x3c1574[_0x4d53a2(0xab)]};}};function _0x1aed(_0xcaff65,_0x27381f){const _0x56d978=_0x56d9();return _0x1aed=function(_0x1aedd0,_0x14a72c){_0x1aedd0=_0x1aedd0-0x88;let _0x26ab86=_0x56d978[_0x1aedd0];return _0x26ab86;},_0x1aed(_0xcaff65,_0x27381f);}p=x([C(0x0,c[_0x1e852c(0xc3)](P[_0x1e852c(0xd4)])),C(0x1,c['Inject'](c[_0x1e852c(0xc0)])),C(0x2,c[_0x1e852c(0xc3)](b[_0x1e852c(0xc5)]))],p);var H=Object[_0x1e852c(0xaf)],J=(_0xa8d2fc,_0x2cfd3e,_0x2bcf7f,_0x59fb2e)=>{const _0x5148d0=_0x1e852c;for(var _0x631705=_0x59fb2e>0x1?void 0x0:_0x59fb2e?H(_0x2cfd3e,_0x2bcf7f):_0x2cfd3e,_0x3744ec=_0xa8d2fc[_0x5148d0(0xb1)]-0x1,_0xdf4285;_0x3744ec>=0x0;_0x3744ec--)(_0xdf4285=_0xa8d2fc[_0x3744ec])&&(_0x631705=_0xdf4285(_0x631705)||_0x631705);return _0x631705;},y=(_0x2cd91f,_0x2370fb)=>(_0x49a6bb,_0xf6e529)=>_0x2370fb(_0x49a6bb,_0xf6e529,_0x2cd91f);let g=class extends c[_0x1e852c(0x8c)]{constructor(_0x3a51c6,_0x1739cf){const _0x3c2487=_0x1e852c;super(),this[_0x3c2487(0x8a)]=_0x3a51c6,this[_0x3c2487(0xc6)]=_0x1739cf,this['_initDataSource']();}['_initDataSource'](){const _0x1e176c=_0x1e852c;this[_0x1e176c(0x8a)]['dataSource']=this[_0x1e176c(0xc6)],this[_0x1e176c(0x8a)][_0x1e176c(0xd6)]=!0x1;}};g=J([y(0x0,M[_0x1e852c(0xb7)]),y(0x1,c[_0x1e852c(0xc3)](p))],g);var F=Object[_0x1e852c(0xcf)],L=Object[_0x1e852c(0xaf)],Z=(_0x38c1cc,_0x1eb39f,_0x5c92ba)=>_0x1eb39f in _0x38c1cc?F(_0x38c1cc,_0x1eb39f,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5c92ba}):_0x38c1cc[_0x1eb39f]=_0x5c92ba,W=(_0x18efa0,_0x4c453f,_0x547512,_0x5dbe95)=>{const _0x575069=_0x1e852c;for(var _0x4e139d=_0x5dbe95>0x1?void 0x0:_0x5dbe95?L(_0x4c453f,_0x547512):_0x4c453f,_0x3589a9=_0x18efa0[_0x575069(0xb1)]-0x1,_0x2f5080;_0x3589a9>=0x0;_0x3589a9--)(_0x2f5080=_0x18efa0[_0x3589a9])&&(_0x4e139d=_0x2f5080(_0x4e139d)||_0x4e139d);return _0x4e139d;},O=(_0x360033,_0x32f845)=>(_0x4ea5a7,_0x2ce4db)=>_0x32f845(_0x4ea5a7,_0x2ce4db,_0x360033),N=(_0x3a7f67,_0x5a11ce,_0x585d3c)=>Z(_0x3a7f67,typeof _0x5a11ce!=_0x1e852c(0x8d)?_0x5a11ce+'':_0x5a11ce,_0x585d3c);exports[_0x1e852c(0x88)]=class extends c[_0x1e852c(0x103)]{constructor(_0x4b5850=D,_0x4af86a,_0x34acf4){const _0x430734=_0x1e852c;super(),this[_0x430734(0xbc)]=_0x4b5850,this[_0x430734(0x8f)]=_0x4af86a,this[_0x430734(0xa9)]=_0x34acf4;const {..._0x3ada9f}=c[_0x430734(0xf1)]({},D,this[_0x430734(0xbc)]);this['_configService']['setConfig'](q,_0x3ada9f);}[_0x1e852c(0xfa)](){[[p],[g],[_]]['forEach'](_0x5e3804=>{const _0x3a2fd9=_0x1aed;this[_0x3a2fd9(0x8f)]['add'](_0x5e3804);});}[_0x1e852c(0x102)](){const _0x5084ac=_0x1e852c;this['_injector'][_0x5084ac(0xd7)](g),this[_0x5084ac(0x8f)][_0x5084ac(0xd7)](_);}},N(exports['UniverThreadCommentDataSourcePlugin'],'pluginName',U),N(exports[_0x1e852c(0x88)],'type',c[_0x1e852c(0xd8)]['UNIVER_UNKNOWN']),exports[_0x1e852c(0x88)]=W([c[_0x1e852c(0xae)](w['UniverThreadCommentUIPlugin'],b[_0x1e852c(0xca)],T[_0x1e852c(0xf9)]),O(0x1,c[_0x1e852c(0xc3)](c[_0x1e852c(0x90)])),O(0x2,c[_0x1e852c(0x91)])],exports[_0x1e852c(0x88)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3603e1=_0x2560;(function(_0xa1537d,_0x11af53){const _0x5ea1e0=_0x2560,_0x147c00=_0xa1537d();while(!![]){try{const _0x1295b0=-parseInt(_0x5ea1e0(0x14f))/0x1*(-parseInt(_0x5ea1e0(0x163))/0x2)+parseInt(_0x5ea1e0(0x12d))/0x3+-parseInt(_0x5ea1e0(0x145))/0x4+parseInt(_0x5ea1e0(0x14d))/0x5+parseInt(_0x5ea1e0(0x132))/0x6+-parseInt(_0x5ea1e0(0x150))/0x7+-parseInt(_0x5ea1e0(0x133))/0x8*(-parseInt(_0x5ea1e0(0x15a))/0x9);if(_0x1295b0===_0x11af53)break;else _0x147c00['push'](_0x147c00['shift']());}catch(_0x5e1b46){_0x147c00['push'](_0x147c00['shift']());}}}(_0x549c,0xb67e9));import{CommentService as _0x5d5f90,CollaborationSessionService as _0x3c4a77,UniverCollaborationClientPlugin as _0x8c2bb9}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0xd50337}from'@univerjs-pro/license';import{dayjs as _0x2557b7,UserManagerService as _0x2bff43,Inject as _0x4c511f,Injector as _0x130911,Disposable as _0x199a3d,CustomRangeType as _0x729685,UniverInstanceType as _0x4ffa54,DependentOn as _0x414d5d,IConfigService as _0x5d98bf,Plugin as _0x2db651,merge as _0x352425}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x5b41d9}from'@univerjs/thread-comment-ui';function _0x549c(){const _0x3b6b96=['addUser','_configService','comment','deleteComment','/edit','pipe','Edit','resolved','2PmucyW','createTimestamp','Solve','parse','YYYY/MM/DD\x20HH:mm','rangeId','_httpService','COMMENT','saveCommentToSnapshot','map','solved','getOwnPropertyDescriptor','pluginName','_userService','unitId','threadId','filter','Solved','replies','customRanges','find','_threadCommentDataSourceService','_initDataSource','userID','size','error','_injector','user','disposeWithMe','UNRECOGNIZED','length','subscribe','root','_sessionService','Unknown','_initUserSync','content','parentId','rangeType','requireSession','OpenOrReOpen','resolveComment','reply','Add','code','ref','getCurrentUser','372465IzKdOn','userId','get','users','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','868542mHczTj','9946000ooByHz','post','_threadCommentDataSource','setConfig','onReady','/add','_commentService','Reply','slice','/universer-api/comment/unit/','updateComment','values','UNIVER_UNKNOWN','/solved','dataSource','getMemberID','add','delete','4405228HrwoMy','payload','format','stringify','addComment','replyId','_config','body','6636785AdUQxW','_init','319433kXmTug','9171036eFBHMz','getUnit','Delete','forEach','_threadCommentModel','commentUpdate$','personId','/list','type','syncUpdateMutationToColla','9wXcmmx'];_0x549c=function(){return _0x3b6b96;};return _0x549c();}import{ThreadCommentModel as _0x1650d8,IThreadCommentDataSourceService as _0x14c9f4}from'@univerjs/thread-comment';import{bufferTime as _0x33d3a7}from'rxjs';import{HTTPService as _0x4be4d2}from'@univerjs/network';const W=_0x3603e1(0x131);var I=(_0x1e8132=>(_0x1e8132[_0x1e8132[_0x3603e1(0x126)]=0x0]=_0x3603e1(0x126),_0x1e8132[_0x1e8132['Solved']=0x1]='Solved',_0x1e8132[_0x1e8132[_0x3603e1(0x11b)]=-0x1]=_0x3603e1(0x11b),_0x1e8132))(I||{}),v=(_0x45e0db=>(_0x45e0db[_0x45e0db[_0x3603e1(0x120)]=0x0]=_0x3603e1(0x120),_0x45e0db[_0x45e0db[_0x3603e1(0x129)]=0x1]=_0x3603e1(0x129),_0x45e0db[_0x45e0db[_0x3603e1(0x13a)]=0x2]=_0x3603e1(0x13a),_0x45e0db[_0x45e0db[_0x3603e1(0x161)]=0x3]='Edit',_0x45e0db[_0x45e0db[_0x3603e1(0x152)]=0x4]=_0x3603e1(0x152),_0x45e0db[_0x45e0db['Solve']=0x5]=_0x3603e1(0x165),_0x45e0db[_0x45e0db['UNRECOGNIZED']=-0x1]=_0x3603e1(0x11b),_0x45e0db))(v||{});const y=_0x1222d2=>_0x2557b7(new Date(+_0x1222d2))[_0x3603e1(0x147)](_0x3603e1(0x167)),B=async(_0x25f2aa,_0x3668ec)=>{const _0x38f4c6=_0x3603e1,_0x41c345=_0x25f2aa[_0x38f4c6(0x12f)](_0x2bff43),_0xdd090c=_0x25f2aa['get'](_0x4be4d2);_0x3668ec['forEach'](_0x2e82cc=>{const _0x1df16f=_0x38f4c6;_0x41c345['getUser'](_0x2e82cc)&&_0x3668ec[_0x1df16f(0x144)](_0x2e82cc);}),_0x3668ec[_0x38f4c6(0x116)]&&(await _0xdd090c[_0x38f4c6(0x12f)]('/universer-api/user/list',{'params':{'userIDs':[..._0x3668ec]}}))[_0x38f4c6(0x14c)][_0x38f4c6(0x130)][_0x38f4c6(0x153)](_0x2449c2=>{_0x2449c2&&_0x41c345['addUser'](_0x2449c2);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x42190c,_0x5cec83,_0x4907dc,_0x5e1cb7)=>{const _0xff9594=_0x3603e1;for(var _0x5e9f88=_0x5e1cb7>0x1?void 0x0:_0x5e1cb7?K(_0x5cec83,_0x4907dc):_0x5cec83,_0x3bca60=_0x42190c[_0xff9594(0x11c)]-0x1,_0x48719c;_0x3bca60>=0x0;_0x3bca60--)(_0x48719c=_0x42190c[_0x3bca60])&&(_0x5e9f88=_0x48719c(_0x5e9f88)||_0x5e9f88);return _0x5e9f88;},p=(_0x2efd0f,_0x28468f)=>(_0x408ca1,_0x15dd41)=>_0x28468f(_0x408ca1,_0x15dd41,_0x2efd0f);let _=class extends _0x199a3d{constructor(_0x39e204,_0x12cd99,_0x35f7d9,_0x18e945){const _0x36e703=_0x3603e1;super(),this[_0x36e703(0x139)]=_0x39e204,this[_0x36e703(0x154)]=_0x12cd99,this[_0x36e703(0x170)]=_0x35f7d9,this[_0x36e703(0x118)]=_0x18e945,this[_0x36e703(0x14e)](),this[_0x36e703(0x121)]();}[_0x3603e1(0x121)](){const _0xaf7b0c=_0x3603e1;this[_0xaf7b0c(0x11a)](this[_0xaf7b0c(0x154)][_0xaf7b0c(0x155)][_0xaf7b0c(0x160)](_0x33d3a7(0x10))['subscribe'](_0x46c702=>{const _0x3db001=_0xaf7b0c,_0x534f63=new Set();_0x46c702[_0x3db001(0x153)](_0x1f1752=>{const _0x32501d=_0x3db001;switch(_0x1f1752[_0x32501d(0x158)]){case _0x32501d(0x143):{const _0x3a6c10=_0x1f1752[_0x32501d(0x146)][_0x32501d(0x156)];_0x534f63[_0x32501d(0x143)](_0x3a6c10);break;}}}),B(this[_0x3db001(0x118)],_0x534f63);}));}['_init'](){const _0x50faa7=_0x3603e1;this[_0x50faa7(0x11a)](this[_0x50faa7(0x139)][_0x50faa7(0x155)][_0x50faa7(0x11d)](async _0x491b86=>{const _0x383228=_0x50faa7;var _0x4cd500,_0x933e87,_0x534ec5,_0x4394c7;const _0x170e0f=(_0x4cd500=this[_0x383228(0x154)][_0x383228(0x151)](_0x491b86[_0x383228(0x171)])[_0x383228(0x112)](_0x55e71a=>_0x55e71a[_0x383228(0x172)]===_0x491b86[_0x383228(0x172)]))==null?void 0x0:_0x4cd500[_0x383228(0x11e)];if(!_0x170e0f)return;const {unitId:_0x300389,subUnitId:_0x33d44e}=_0x170e0f;switch(_0x491b86[_0x383228(0x119)]&&this[_0x383228(0x170)][_0x383228(0x15b)](_0x491b86[_0x383228(0x119)]),_0x491b86[_0x383228(0x158)]){case v['Add']:break;case v[_0x383228(0x13a)]:{this[_0x383228(0x154)][_0x383228(0x149)](_0x300389,_0x33d44e,{'unitId':_0x300389,'subUnitId':_0x33d44e,'ref':'','id':_0x491b86['replyId'],'dT':y(+_0x491b86[_0x383228(0x164)]),'threadId':_0x491b86[_0x383228(0x172)],'personId':(_0x534ec5=(_0x933e87=_0x491b86[_0x383228(0x119)])==null?void 0x0:_0x933e87[_0x383228(0x115)])!=null?_0x534ec5:_0x491b86['userId'],'text':JSON[_0x383228(0x166)](_0x491b86[_0x383228(0x122)]),'parentId':_0x170e0f['id']});break;}case v['Delete']:{const _0x418b2e=this[_0x383228(0x154)]['getComment'](_0x300389,_0x33d44e,_0x491b86[_0x383228(0x14a)]);_0x418b2e&&_0x418b2e[_0x383228(0x123)]&&this['_threadCommentModel'][_0x383228(0x15e)](_0x300389,_0x33d44e,_0x491b86[_0x383228(0x14a)]);break;}case v['Edit']:{this[_0x383228(0x154)][_0x383228(0x13d)](_0x300389,_0x33d44e,{'commentId':_0x491b86[_0x383228(0x14a)],'text':JSON['parse'](_0x491b86[_0x383228(0x122)])});break;}case v[_0x383228(0x165)]:{const _0x578684=(_0x4394c7=this[_0x383228(0x154)][_0x383228(0x151)](_0x491b86[_0x383228(0x171)])['find'](_0x40ea88=>_0x40ea88[_0x383228(0x172)]===_0x491b86['threadId']))==null?void 0x0:_0x4394c7['root'];_0x578684&&this['_threadCommentModel'][_0x383228(0x127)](_0x300389,_0x33d44e,_0x578684['id'],_0x491b86[_0x383228(0x16d)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0x4c511f(_0x5d5f90)),p(0x1,_0x4c511f(_0x1650d8)),p(0x2,_0x4c511f(_0x2bff43)),p(0x3,_0x4c511f(_0x130911))],_);function _0x2560(_0x347111,_0x5da665){const _0x549c35=_0x549c();return _0x2560=function(_0x25603c,_0x2dc82c){_0x25603c=_0x25603c-0x111;let _0x23ac25=_0x549c35[_0x25603c];return _0x23ac25;},_0x2560(_0x347111,_0x5da665);}const z='thread-comment-data-source.config',O={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5bdaee,_0x255f8f,_0x2a2ca5,_0x15aaa5)=>{for(var _0x45c161=_0x15aaa5>0x1?void 0x0:_0x15aaa5?k(_0x255f8f,_0x2a2ca5):_0x255f8f,_0x3a6252=_0x5bdaee['length']-0x1,_0x1d8bd2;_0x3a6252>=0x0;_0x3a6252--)(_0x1d8bd2=_0x5bdaee[_0x3a6252])&&(_0x45c161=_0x1d8bd2(_0x45c161)||_0x45c161);return _0x45c161;},b=(_0x9fdc32,_0x2f9aeb)=>(_0x29a17d,_0x40315d)=>_0x2f9aeb(_0x29a17d,_0x40315d,_0x9fdc32);function X(_0x387955,_0x8fc331){const _0x36d2f5=_0x3603e1,_0x257eeb=_0x387955[_0x36d2f5(0x175)][0x0];return{..._0x8fc331,'id':_0x257eeb[_0x36d2f5(0x14a)],'resolved':_0x387955['solved']===0x1,'dT':y(_0x257eeb[_0x36d2f5(0x164)]),'personId':_0x257eeb['userId'],'threadId':_0x257eeb[_0x36d2f5(0x172)]};}function ee(_0x242bc8,_0x1a5118,_0x5c8298){const _0x2476dc=_0x3603e1;var _0x20f65a,_0x4ded9c;if(((_0x4ded9c=(_0x20f65a=_0x242bc8==null?void 0x0:_0x242bc8['replies'])==null?void 0x0:_0x20f65a[_0x2476dc(0x11c)])!=null?_0x4ded9c:0x0)>0x0){const _0x402548=(_0x4ae8c7,_0x314035)=>({'id':_0x4ae8c7[_0x2476dc(0x14a)],'threadId':_0x4ae8c7[_0x2476dc(0x172)],'dT':y(_0x4ae8c7[_0x2476dc(0x164)]),'personId':_0x4ae8c7[_0x2476dc(0x12e)],'resolved':_0x242bc8[_0x2476dc(0x16d)]===I[_0x2476dc(0x174)],'unitId':_0x1a5118,'subUnitId':_0x5c8298,'text':JSON[_0x2476dc(0x166)](_0x4ae8c7[_0x2476dc(0x122)]),'parentId':_0x314035}),_0x2abd8f=_0x402548(_0x242bc8[_0x2476dc(0x175)][0x0]);return{..._0x2abd8f,'children':_0x242bc8['replies'][_0x2476dc(0x13b)](0x1)[_0x2476dc(0x16c)](_0x5ab63b=>_0x402548(_0x5ab63b,_0x2abd8f['id']))};}return null;}let S=class{constructor(_0x38b591,_0x12135c,_0x43adcc){const _0x1bd914=_0x3603e1;this['_httpService']=_0x38b591,this[_0x1bd914(0x170)]=_0x12135c,this[_0x1bd914(0x11f)]=_0x43adcc;}async[_0x3603e1(0x149)](_0x576602){const _0x5d6350=_0x3603e1;var _0x49b212,_0x5030d4;const {parentId:_0x2eee08,unitId:_0x2e627e,text:_0x53aa84,threadId:_0x5e5adf}=_0x576602,_0xe0a2b0=(_0x5030d4=(_0x49b212=_0x53aa84[_0x5d6350(0x111)])==null?void 0x0:_0x49b212['filter'](_0x5a2df8=>_0x5a2df8[_0x5d6350(0x124)]===_0x729685[_0x5d6350(0x16a)])[_0x5d6350(0x16c)](_0x3a8dab=>_0x3a8dab[_0x5d6350(0x168)]))!=null?_0x5030d4:[],_0x2b50ac=JSON[_0x5d6350(0x148)](_0x53aa84),_0x4b0364=(await this[_0x5d6350(0x11f)][_0x5d6350(0x125)](_0x2e627e))['getMemberID']();if(_0x2eee08){const _0x1e1567={'memberId':_0x4b0364,'unitId':_0x2e627e,'content':_0x2b50ac,'mention':_0xe0a2b0,'threadId':_0x5e5adf},_0x29a066=(await this['_httpService'][_0x5d6350(0x134)]('/universer-api/comment/unit/'+_0x2e627e+'/reply',{'body':_0x1e1567}))[_0x5d6350(0x14c)][_0x5d6350(0x128)];return{..._0x576602,'id':_0x29a066[_0x5d6350(0x14a)],'dT':_0x2557b7(+_0x29a066['createTimestamp'])[_0x5d6350(0x147)](_0x5d6350(0x167)),'personId':_0x29a066[_0x5d6350(0x12e)]};}else{const _0x3a8725={'memberId':_0x4b0364,'unitId':_0x2e627e,'content':_0x2b50ac,'mention':_0xe0a2b0},_0x12b2f1=await this['_httpService'][_0x5d6350(0x134)]('/universer-api/comment/unit/'+_0x2e627e+_0x5d6350(0x138),{'body':_0x3a8725});return X(_0x12b2f1['body'][_0x5d6350(0x15d)],_0x576602);}}async[_0x3603e1(0x13d)](_0x7e24d7){const _0x36aeb4=_0x3603e1;var _0x562efe,_0x46c781;const {text:_0x5587f3,unitId:_0x28913b}=_0x7e24d7,_0xcd73c7=(_0x46c781=(_0x562efe=_0x5587f3[_0x36aeb4(0x111)])==null?void 0x0:_0x562efe[_0x36aeb4(0x173)](_0x3950b1=>_0x3950b1[_0x36aeb4(0x124)]===_0x729685[_0x36aeb4(0x16a)])[_0x36aeb4(0x16c)](_0x543c22=>_0x543c22['rangeId']))!=null?_0x46c781:[],_0x50513b=JSON['stringify'](_0x5587f3),_0x2d8946=_0x7e24d7[_0x36aeb4(0x172)],_0x5e1fcb=_0x7e24d7['id'],_0x309c07={'memberId':(await this[_0x36aeb4(0x11f)][_0x36aeb4(0x125)](_0x28913b))['getMemberID'](),'unitId':_0x28913b,'threadId':_0x2d8946,'mention':_0xcd73c7,'content':_0x50513b,'replyId':_0x5e1fcb},_0x316bde=await this[_0x36aeb4(0x169)][_0x36aeb4(0x134)]('/universer-api/comment/unit/'+_0x28913b+_0x36aeb4(0x15f),{'body':_0x309c07});return!_0x316bde['body']['error']||_0x316bde[_0x36aeb4(0x14c)][_0x36aeb4(0x117)][_0x36aeb4(0x12a)]===0x1;}async[_0x3603e1(0x127)](_0x17a72c){const _0x564f23=_0x3603e1,{unitId:_0x417c84}=_0x17a72c,_0x49e65b=_0x17a72c[_0x564f23(0x172)],_0x2e6561={'memberId':this[_0x564f23(0x170)][_0x564f23(0x12c)]()[_0x564f23(0x115)],'unitId':_0x417c84,'threadId':_0x49e65b,'solved':_0x17a72c[_0x564f23(0x162)]?I['Solved']:I[_0x564f23(0x126)]},_0x370a85=await this[_0x564f23(0x169)]['post'](_0x564f23(0x13c)+_0x417c84+_0x564f23(0x140),{'body':_0x2e6561});return!_0x370a85[_0x564f23(0x14c)]['error']||_0x370a85[_0x564f23(0x14c)][_0x564f23(0x117)][_0x564f23(0x12a)]===0x1;}async['deleteComment'](_0x526e13,_0x3a00f5,_0x222751,_0x442f5e){const _0x336cc6=_0x3603e1,_0x98e226={'memberId':(await this['_sessionService'][_0x336cc6(0x125)](_0x526e13))[_0x336cc6(0x142)](),'threadId':_0x222751,'replyId':_0x442f5e,'unitId':_0x526e13},_0x3705d5=await this[_0x336cc6(0x169)][_0x336cc6(0x134)]('/universer-api/comment/unit/'+_0x526e13+'/delete',{'body':_0x98e226});return!_0x3705d5[_0x336cc6(0x14c)][_0x336cc6(0x117)]||_0x3705d5[_0x336cc6(0x14c)][_0x336cc6(0x117)][_0x336cc6(0x12a)]===0x1;}async['listComments'](_0x3ab6f2,_0x21a4cd,_0x11fdb9){const _0x4636dd=_0x3603e1,_0x1e174f={'unitId':_0x3ab6f2,'threadId':_0x11fdb9},_0x36d645=await this[_0x4636dd(0x169)][_0x4636dd(0x134)](_0x4636dd(0x13c)+_0x3ab6f2+_0x4636dd(0x157),{'body':_0x1e174f}),_0x198f78=_0x11fdb9[_0x4636dd(0x16c)](_0x451b15=>ee(_0x36d645[_0x4636dd(0x14c)]['comments'][_0x451b15],_0x3ab6f2,_0x21a4cd))['filter'](Boolean);return Object[_0x4636dd(0x13e)](_0x36d645['body'][_0x4636dd(0x130)])[_0x4636dd(0x153)](_0x46054b=>{const _0x152e6e=_0x4636dd;this[_0x152e6e(0x170)][_0x152e6e(0x15b)](_0x46054b);}),_0x198f78;}[_0x3603e1(0x16b)](_0x2ecc60){const _0x478897=_0x3603e1;return{'id':_0x2ecc60['id'],'threadId':_0x2ecc60[_0x478897(0x172)],'ref':_0x2ecc60[_0x478897(0x12b)]};}};S=Q([b(0x0,_0x4c511f(_0x4be4d2)),b(0x1,_0x4c511f(_0x2bff43)),b(0x2,_0x4c511f(_0x3c4a77))],S);var re=Object[_0x3603e1(0x16e)],te=(_0x52cef3,_0x358961,_0x5869a7,_0x5b2bc1)=>{const _0x49b540=_0x3603e1;for(var _0x17ada8=_0x5b2bc1>0x1?void 0x0:_0x5b2bc1?re(_0x358961,_0x5869a7):_0x358961,_0x114f18=_0x52cef3[_0x49b540(0x11c)]-0x1,_0x2d6d13;_0x114f18>=0x0;_0x114f18--)(_0x2d6d13=_0x52cef3[_0x114f18])&&(_0x17ada8=_0x2d6d13(_0x17ada8)||_0x17ada8);return _0x17ada8;},M=(_0x3d1f7b,_0x120812)=>(_0xe48815,_0x2da559)=>_0x120812(_0xe48815,_0x2da559,_0x3d1f7b);let f=class extends _0x199a3d{constructor(_0x5294ac,_0x45bfef){const _0x510915=_0x3603e1;super(),this['_threadCommentDataSourceService']=_0x5294ac,this['_threadCommentDataSource']=_0x45bfef,this[_0x510915(0x114)]();}[_0x3603e1(0x114)](){const _0x58da72=_0x3603e1;this[_0x58da72(0x113)][_0x58da72(0x141)]=this[_0x58da72(0x135)],this[_0x58da72(0x113)][_0x58da72(0x159)]=!0x1;}};f=te([M(0x0,_0x14c9f4),M(0x1,_0x4c511f(S))],f);var se=Object['defineProperty'],oe=Object[_0x3603e1(0x16e)],ne=(_0x48ded8,_0xaa4984,_0x14a79d)=>_0xaa4984 in _0x48ded8?se(_0x48ded8,_0xaa4984,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x14a79d}):_0x48ded8[_0xaa4984]=_0x14a79d,ie=(_0x1405ab,_0x4d873e,_0x1a522a,_0x129fad)=>{for(var _0x4bb661=_0x129fad>0x1?void 0x0:_0x129fad?oe(_0x4d873e,_0x1a522a):_0x4d873e,_0x376546=_0x1405ab['length']-0x1,_0x2c7adc;_0x376546>=0x0;_0x376546--)(_0x2c7adc=_0x1405ab[_0x376546])&&(_0x4bb661=_0x2c7adc(_0x4bb661)||_0x4bb661);return _0x4bb661;},N=(_0x5aa258,_0x488498)=>(_0x2c93fa,_0x5a31e6)=>_0x488498(_0x2c93fa,_0x5a31e6,_0x5aa258),$=(_0x184f22,_0x48592a,_0x1a2c9f)=>ne(_0x184f22,typeof _0x48592a!='symbol'?_0x48592a+'':_0x48592a,_0x1a2c9f);let g=class extends _0x2db651{constructor(_0x1ef4b3=O,_0x2c0d31,_0x41dc22){const _0x45abde=_0x3603e1;super(),this[_0x45abde(0x14b)]=_0x1ef4b3,this[_0x45abde(0x118)]=_0x2c0d31,this[_0x45abde(0x15c)]=_0x41dc22;const {..._0x1f6e80}=_0x352425({},O,this['_config']);this['_configService'][_0x45abde(0x136)](z,_0x1f6e80);}['onStarting'](){const _0x3c080e=_0x3603e1;[[S],[f],[_]][_0x3c080e(0x153)](_0x3b515a=>{const _0xc5e888=_0x3c080e;this[_0xc5e888(0x118)][_0xc5e888(0x143)](_0x3b515a);});}[_0x3603e1(0x137)](){const _0x2ae203=_0x3603e1;this[_0x2ae203(0x118)][_0x2ae203(0x12f)](f),this[_0x2ae203(0x118)][_0x2ae203(0x12f)](_);}};$(g,_0x3603e1(0x16f),W),$(g,_0x3603e1(0x158),_0x4ffa54[_0x3603e1(0x13f)]),g=ie([_0x414d5d(_0x5b41d9,_0x8c2bb9,_0xd50337),N(0x1,_0x4c511f(_0x130911)),N(0x2,_0x5d98bf)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0xae48e8=_0x4a6a;(function(_0x34c849,_0x10de2b){const _0x474d5e=_0x4a6a,_0x3e0b68=_0x34c849();while(!![]){try{const _0x2d5f54=-parseInt(_0x474d5e(0xec))/0x1*(parseInt(_0x474d5e(0xe0))/0x2)+parseInt(_0x474d5e(0xf1))/0x3+parseInt(_0x474d5e(0xe6))/0x4*(-parseInt(_0x474d5e(0xdb))/0x5)+parseInt(_0x474d5e(0xb1))/0x6+-parseInt(_0x474d5e(0xc7))/0x7*(-parseInt(_0x474d5e(0xb5))/0x8)+-parseInt(_0x474d5e(0xb2))/0x9*(-parseInt(_0x474d5e(0xd9))/0xa)+-parseInt(_0x474d5e(0xc9))/0xb*(parseInt(_0x474d5e(0xff))/0xc);if(_0x2d5f54===_0x10de2b)break;else _0x3e0b68['push'](_0x3e0b68['shift']());}catch(_0x2b72e5){_0x3e0b68['push'](_0x3e0b68['shift']());}}}(_0x6ed9,0x23880));import{CommentService as _0x4294c9,CollaborationSessionService as _0x12024f,UniverCollaborationClientPlugin as _0x490620}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x48719b}from'@univerjs-pro/license';import{dayjs as _0x112222,UserManagerService as _0x4a6b5e,Inject as _0x4293fe,Injector as _0x5f09c2,Disposable as _0x490269,CustomRangeType as _0x435b6d,UniverInstanceType as _0x2f7f9b,DependentOn as _0x5afa64,IConfigService as _0x254ac8,Plugin as _0x1d5852,merge as _0x2ffa71}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1f9c3f}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x29a48e,IThreadCommentDataSourceService as _0x41df09}from'@univerjs/thread-comment';function _0x4a6a(_0x1eb5d0,_0x5beb7c){const _0x6ed95d=_0x6ed9();return _0x4a6a=function(_0x4a6a89,_0x2bf3b6){_0x4a6a89=_0x4a6a89-0xa6;let _0x1252a7=_0x6ed95d[_0x4a6a89];return _0x1252a7;},_0x4a6a(_0x1eb5d0,_0x5beb7c);}import{bufferTime as _0x350851}from'rxjs';import{HTTPService as _0x1f0c3e}from'@univerjs/network';const W=_0xae48e8(0xf4);var I=(_0x30d18c=>(_0x30d18c[_0x30d18c[_0xae48e8(0xba)]=0x0]=_0xae48e8(0xba),_0x30d18c[_0x30d18c['Solved']=0x1]=_0xae48e8(0x108),_0x30d18c[_0x30d18c[_0xae48e8(0xe8)]=-0x1]=_0xae48e8(0xe8),_0x30d18c))(I||{}),v=(_0x67ce74=>(_0x67ce74[_0x67ce74['Unknown']=0x0]=_0xae48e8(0x106),_0x67ce74[_0x67ce74['Add']=0x1]=_0xae48e8(0x10a),_0x67ce74[_0x67ce74[_0xae48e8(0xf7)]=0x2]='Reply',_0x67ce74[_0x67ce74[_0xae48e8(0xd4)]=0x3]=_0xae48e8(0xd4),_0x67ce74[_0x67ce74['Delete']=0x4]=_0xae48e8(0xc0),_0x67ce74[_0x67ce74[_0xae48e8(0xa8)]=0x5]=_0xae48e8(0xa8),_0x67ce74[_0x67ce74['UNRECOGNIZED']=-0x1]=_0xae48e8(0xe8),_0x67ce74))(v||{});const y=_0x1f20f9=>_0x112222(new Date(+_0x1f20f9))[_0xae48e8(0xcf)](_0xae48e8(0xea)),B=async(_0x5123a5,_0x174e65)=>{const _0x299d7a=_0xae48e8,_0x1aa93c=_0x5123a5['get'](_0x4a6b5e),_0x2be18a=_0x5123a5['get'](_0x1f0c3e);_0x174e65[_0x299d7a(0x104)](_0x2d3d5c=>{const _0x2e135e=_0x299d7a;_0x1aa93c[_0x2e135e(0xa7)](_0x2d3d5c)&&_0x174e65[_0x2e135e(0xbc)](_0x2d3d5c);}),_0x174e65[_0x299d7a(0xb9)]&&(await _0x2be18a[_0x299d7a(0xdc)](_0x299d7a(0xbf),{'params':{'userIDs':[..._0x174e65]}}))['body'][_0x299d7a(0xcd)][_0x299d7a(0x104)](_0x45a1f4=>{const _0x222e60=_0x299d7a;_0x45a1f4&&_0x1aa93c[_0x222e60(0xca)](_0x45a1f4);});};var K=Object[_0xae48e8(0xc5)],V=(_0x4f3f3c,_0xc88767,_0x4a144d,_0x180a10)=>{const _0x42355c=_0xae48e8;for(var _0x15e2a8=_0x180a10>0x1?void 0x0:_0x180a10?K(_0xc88767,_0x4a144d):_0xc88767,_0x1a8ce7=_0x4f3f3c[_0x42355c(0x101)]-0x1,_0x34c274;_0x1a8ce7>=0x0;_0x1a8ce7--)(_0x34c274=_0x4f3f3c[_0x1a8ce7])&&(_0x15e2a8=_0x34c274(_0x15e2a8)||_0x15e2a8);return _0x15e2a8;},p=(_0x2269b7,_0x354442)=>(_0x4b5aed,_0x8473dd)=>_0x354442(_0x4b5aed,_0x8473dd,_0x2269b7);let _=class extends _0x490269{constructor(_0x21dab8,_0x44d787,_0x423357,_0xb7e4ac){const _0x32c25a=_0xae48e8;super(),this[_0x32c25a(0x100)]=_0x21dab8,this[_0x32c25a(0xb7)]=_0x44d787,this[_0x32c25a(0xe7)]=_0x423357,this['_injector']=_0xb7e4ac,this[_0x32c25a(0xef)](),this[_0x32c25a(0xd6)]();}[_0xae48e8(0xd6)](){const _0x317d70=_0xae48e8;this[_0x317d70(0xbb)](this[_0x317d70(0xb7)]['commentUpdate$']['pipe'](_0x350851(0x10))['subscribe'](_0x5c19cd=>{const _0x30aaf5=_0x317d70,_0x468230=new Set();_0x5c19cd[_0x30aaf5(0x104)](_0x55ae96=>{const _0x2200f7=_0x30aaf5;switch(_0x55ae96['type']){case _0x2200f7(0xb4):{const _0x4104f0=_0x55ae96[_0x2200f7(0xdd)]['personId'];_0x468230[_0x2200f7(0xb4)](_0x4104f0);break;}}}),B(this['_injector'],_0x468230);}));}['_init'](){const _0x369bfd=_0xae48e8;this[_0x369bfd(0xbb)](this['_commentService'][_0x369bfd(0xde)]['subscribe'](async _0x1ce3c8=>{const _0x1a29cb=_0x369bfd;var _0x3df353,_0x460914,_0x9a8e37,_0x5837ad;const _0x47d013=(_0x3df353=this[_0x1a29cb(0xb7)][_0x1a29cb(0xae)](_0x1ce3c8[_0x1a29cb(0xab)])[_0x1a29cb(0xe4)](_0x414284=>_0x414284[_0x1a29cb(0xd5)]===_0x1ce3c8[_0x1a29cb(0xd5)]))==null?void 0x0:_0x3df353[_0x1a29cb(0xfd)];if(!_0x47d013)return;const {unitId:_0x347b30,subUnitId:_0x24dbe6}=_0x47d013;switch(_0x1ce3c8[_0x1a29cb(0xfc)]&&this[_0x1a29cb(0xe7)][_0x1a29cb(0xca)](_0x1ce3c8['user']),_0x1ce3c8[_0x1a29cb(0x105)]){case v[_0x1a29cb(0x10a)]:break;case v[_0x1a29cb(0xf7)]:{this['_threadCommentModel'][_0x1a29cb(0xe3)](_0x347b30,_0x24dbe6,{'unitId':_0x347b30,'subUnitId':_0x24dbe6,'ref':'','id':_0x1ce3c8['replyId'],'dT':y(+_0x1ce3c8['createTimestamp']),'threadId':_0x1ce3c8[_0x1a29cb(0xd5)],'personId':(_0x9a8e37=(_0x460914=_0x1ce3c8['user'])==null?void 0x0:_0x460914['userID'])!=null?_0x9a8e37:_0x1ce3c8[_0x1a29cb(0xc1)],'text':JSON[_0x1a29cb(0xda)](_0x1ce3c8[_0x1a29cb(0xac)]),'parentId':_0x47d013['id']});break;}case v[_0x1a29cb(0xc0)]:{const _0x5d7137=this[_0x1a29cb(0xb7)][_0x1a29cb(0xcc)](_0x347b30,_0x24dbe6,_0x1ce3c8[_0x1a29cb(0x103)]);_0x5d7137&&_0x5d7137['parentId']&&this[_0x1a29cb(0xb7)][_0x1a29cb(0xed)](_0x347b30,_0x24dbe6,_0x1ce3c8[_0x1a29cb(0x103)]);break;}case v['Edit']:{this[_0x1a29cb(0xb7)][_0x1a29cb(0x107)](_0x347b30,_0x24dbe6,{'commentId':_0x1ce3c8[_0x1a29cb(0x103)],'text':JSON[_0x1a29cb(0xda)](_0x1ce3c8['content'])});break;}case v[_0x1a29cb(0xa8)]:{const _0xa3f900=(_0x5837ad=this[_0x1a29cb(0xb7)][_0x1a29cb(0xae)](_0x1ce3c8[_0x1a29cb(0xab)])['find'](_0x2300ea=>_0x2300ea[_0x1a29cb(0xd5)]===_0x1ce3c8[_0x1a29cb(0xd5)]))==null?void 0x0:_0x5837ad[_0x1a29cb(0xfd)];_0xa3f900&&this[_0x1a29cb(0xb7)][_0x1a29cb(0xbe)](_0x347b30,_0x24dbe6,_0xa3f900['id'],_0x1ce3c8[_0x1a29cb(0xa9)]===I[_0x1a29cb(0x108)]);break;}}}));}};_=V([p(0x0,_0x4293fe(_0x4294c9)),p(0x1,_0x4293fe(_0x29a48e)),p(0x2,_0x4293fe(_0x4a6b5e)),p(0x3,_0x4293fe(_0x5f09c2))],_);const z='thread-comment-data-source.config',O={};var k=Object[_0xae48e8(0xc5)],Q=(_0x1bc445,_0x976867,_0x5f2c61,_0x3f1647)=>{for(var _0x56146e=_0x3f1647>0x1?void 0x0:_0x3f1647?k(_0x976867,_0x5f2c61):_0x976867,_0x3c1514=_0x1bc445['length']-0x1,_0x2ae76c;_0x3c1514>=0x0;_0x3c1514--)(_0x2ae76c=_0x1bc445[_0x3c1514])&&(_0x56146e=_0x2ae76c(_0x56146e)||_0x56146e);return _0x56146e;},b=(_0x27caf9,_0x3d1875)=>(_0x4b89da,_0x2b4606)=>_0x3d1875(_0x4b89da,_0x2b4606,_0x27caf9);function X(_0x48eda6,_0x3f99a0){const _0x1405f1=_0xae48e8,_0x438ea8=_0x48eda6[_0x1405f1(0xf0)][0x0];return{..._0x3f99a0,'id':_0x438ea8['replyId'],'resolved':_0x48eda6['solved']===0x1,'dT':y(_0x438ea8[_0x1405f1(0xf8)]),'personId':_0x438ea8[_0x1405f1(0xc1)],'threadId':_0x438ea8[_0x1405f1(0xd5)]};}function ee(_0x5c3ae4,_0x3494c0,_0x2c70d3){const _0x19de92=_0xae48e8;var _0x4d3db6,_0xe146e9;if(((_0xe146e9=(_0x4d3db6=_0x5c3ae4==null?void 0x0:_0x5c3ae4[_0x19de92(0xf0)])==null?void 0x0:_0x4d3db6[_0x19de92(0x101)])!=null?_0xe146e9:0x0)>0x0){const _0x573bb7=(_0x15d944,_0x26e7b1)=>({'id':_0x15d944[_0x19de92(0x103)],'threadId':_0x15d944['threadId'],'dT':y(_0x15d944['createTimestamp']),'personId':_0x15d944['userId'],'resolved':_0x5c3ae4[_0x19de92(0xa9)]===I['Solved'],'unitId':_0x3494c0,'subUnitId':_0x2c70d3,'text':JSON['parse'](_0x15d944[_0x19de92(0xac)]),'parentId':_0x26e7b1}),_0x551ec8=_0x573bb7(_0x5c3ae4[_0x19de92(0xf0)][0x0]);return{..._0x551ec8,'children':_0x5c3ae4['replies'][_0x19de92(0xa6)](0x1)[_0x19de92(0xee)](_0x3b74f9=>_0x573bb7(_0x3b74f9,_0x551ec8['id']))};}return null;}function _0x6ed9(){const _0x2a08d2=['/list','150qtiKpT','parse','75255EDCiRg','get','payload','commentUpdate$','requireSession','2048dFLKum','_injector','_threadCommentDataSourceService','addComment','find','_threadCommentDataSource','64FkGudo','_userService','UNRECOGNIZED','saveCommentToSnapshot','YYYY/MM/DD\x20HH:mm','listComments','12SSKLbs','deleteComment','map','_init','replies','260622MWvtXl','post','values','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','getCurrentUser','comments','Reply','createTimestamp','dataSource','rangeType','_configService','user','root','filter','48keSAco','_commentService','length','/add','replyId','forEach','type','Unknown','updateComment','Solved','_initDataSource','Add','slice','getUser','Solve','solved','_config','unitId','content','UNIVER_UNKNOWN','getUnit','getMemberID','defineProperty','868992PGUdsN','136179NnLRpW','_httpService','add','24FDayxI','onStarting','_threadCommentModel','body','size','OpenOrReOpen','disposeWithMe','delete','_sessionService','resolveComment','/universer-api/user/list','Delete','userId','rangeId','syncUpdateMutationToColla','resolved','getOwnPropertyDescriptor','customRanges','82481mqyXCZ','/reply','262295veSzsV','addUser','/solved','getComment','users','ref','format','reply','/universer-api/comment/unit/','code','COMMENT','Edit','threadId','_initUserSync','error'];_0x6ed9=function(){return _0x2a08d2;};return _0x6ed9();}let S=class{constructor(_0x5f3117,_0x509651,_0x1874bf){const _0x4619dc=_0xae48e8;this[_0x4619dc(0xb3)]=_0x5f3117,this[_0x4619dc(0xe7)]=_0x509651,this[_0x4619dc(0xbd)]=_0x1874bf;}async['addComment'](_0x4921cb){const _0x5580de=_0xae48e8;var _0x309e5b,_0xfbfba1;const {parentId:_0x29aa91,unitId:_0x20be5f,text:_0x1d027b,threadId:_0x3d6a0b}=_0x4921cb,_0x19f2e5=(_0xfbfba1=(_0x309e5b=_0x1d027b[_0x5580de(0xc6)])==null?void 0x0:_0x309e5b['filter'](_0x1e0417=>_0x1e0417[_0x5580de(0xfa)]===_0x435b6d[_0x5580de(0xd3)])['map'](_0x1fb682=>_0x1fb682[_0x5580de(0xc2)]))!=null?_0xfbfba1:[],_0x14402e=JSON['stringify'](_0x1d027b),_0xf6e0a6=(await this[_0x5580de(0xbd)][_0x5580de(0xdf)](_0x20be5f))[_0x5580de(0xaf)]();if(_0x29aa91){const _0x5cacfd={'memberId':_0xf6e0a6,'unitId':_0x20be5f,'content':_0x14402e,'mention':_0x19f2e5,'threadId':_0x3d6a0b},_0x16fee3=(await this['_httpService'][_0x5580de(0xf2)](_0x5580de(0xd1)+_0x20be5f+_0x5580de(0xc8),{'body':_0x5cacfd}))[_0x5580de(0xb8)][_0x5580de(0xd0)];return{..._0x4921cb,'id':_0x16fee3[_0x5580de(0x103)],'dT':_0x112222(+_0x16fee3[_0x5580de(0xf8)])[_0x5580de(0xcf)](_0x5580de(0xea)),'personId':_0x16fee3['userId']};}else{const _0x1f7910={'memberId':_0xf6e0a6,'unitId':_0x20be5f,'content':_0x14402e,'mention':_0x19f2e5},_0x25906c=await this[_0x5580de(0xb3)][_0x5580de(0xf2)](_0x5580de(0xd1)+_0x20be5f+_0x5580de(0x102),{'body':_0x1f7910});return X(_0x25906c[_0x5580de(0xb8)]['comment'],_0x4921cb);}}async[_0xae48e8(0x107)](_0x3aed10){const _0x4f1bbf=_0xae48e8;var _0x5f4ba3,_0xaeba8e;const {text:_0x3bb053,unitId:_0xd2ce68}=_0x3aed10,_0x103757=(_0xaeba8e=(_0x5f4ba3=_0x3bb053['customRanges'])==null?void 0x0:_0x5f4ba3[_0x4f1bbf(0xfe)](_0x1d09a8=>_0x1d09a8[_0x4f1bbf(0xfa)]===_0x435b6d[_0x4f1bbf(0xd3)])[_0x4f1bbf(0xee)](_0x6cd4a6=>_0x6cd4a6[_0x4f1bbf(0xc2)]))!=null?_0xaeba8e:[],_0x3e9165=JSON['stringify'](_0x3bb053),_0x444a88=_0x3aed10[_0x4f1bbf(0xd5)],_0x362784=_0x3aed10['id'],_0x49aac6={'memberId':(await this[_0x4f1bbf(0xbd)][_0x4f1bbf(0xdf)](_0xd2ce68))['getMemberID'](),'unitId':_0xd2ce68,'threadId':_0x444a88,'mention':_0x103757,'content':_0x3e9165,'replyId':_0x362784},_0xd5b3b8=await this[_0x4f1bbf(0xb3)][_0x4f1bbf(0xf2)]('/universer-api/comment/unit/'+_0xd2ce68+'/edit',{'body':_0x49aac6});return!_0xd5b3b8[_0x4f1bbf(0xb8)][_0x4f1bbf(0xd7)]||_0xd5b3b8[_0x4f1bbf(0xb8)][_0x4f1bbf(0xd7)][_0x4f1bbf(0xd2)]===0x1;}async[_0xae48e8(0xbe)](_0x57b468){const _0x494714=_0xae48e8,{unitId:_0x43bfb4}=_0x57b468,_0x2a078f=_0x57b468[_0x494714(0xd5)],_0x109614={'memberId':this[_0x494714(0xe7)][_0x494714(0xf5)]()['userID'],'unitId':_0x43bfb4,'threadId':_0x2a078f,'solved':_0x57b468[_0x494714(0xc4)]?I['Solved']:I[_0x494714(0xba)]},_0xa513b7=await this[_0x494714(0xb3)]['post'](_0x494714(0xd1)+_0x43bfb4+_0x494714(0xcb),{'body':_0x109614});return!_0xa513b7[_0x494714(0xb8)][_0x494714(0xd7)]||_0xa513b7[_0x494714(0xb8)]['error'][_0x494714(0xd2)]===0x1;}async['deleteComment'](_0x91399b,_0x265efe,_0x17c895,_0x53c485){const _0x1f1b71=_0xae48e8,_0x1c648e={'memberId':(await this[_0x1f1b71(0xbd)][_0x1f1b71(0xdf)](_0x91399b))[_0x1f1b71(0xaf)](),'threadId':_0x17c895,'replyId':_0x53c485,'unitId':_0x91399b},_0x2d0f66=await this['_httpService'][_0x1f1b71(0xf2)]('/universer-api/comment/unit/'+_0x91399b+'/delete',{'body':_0x1c648e});return!_0x2d0f66[_0x1f1b71(0xb8)][_0x1f1b71(0xd7)]||_0x2d0f66[_0x1f1b71(0xb8)]['error']['code']===0x1;}async[_0xae48e8(0xeb)](_0x18df81,_0x3f8fa6,_0x3c87ba){const _0x19ba03=_0xae48e8,_0x3db1c8={'unitId':_0x18df81,'threadId':_0x3c87ba},_0xfa71dd=await this[_0x19ba03(0xb3)][_0x19ba03(0xf2)]('/universer-api/comment/unit/'+_0x18df81+_0x19ba03(0xd8),{'body':_0x3db1c8}),_0x148e5a=_0x3c87ba[_0x19ba03(0xee)](_0x3b1e66=>ee(_0xfa71dd['body'][_0x19ba03(0xf6)][_0x3b1e66],_0x18df81,_0x3f8fa6))[_0x19ba03(0xfe)](Boolean);return Object[_0x19ba03(0xf3)](_0xfa71dd[_0x19ba03(0xb8)]['users'])['forEach'](_0x48a2f4=>{const _0x2751d4=_0x19ba03;this[_0x2751d4(0xe7)][_0x2751d4(0xca)](_0x48a2f4);}),_0x148e5a;}[_0xae48e8(0xe9)](_0x51f8ab){const _0x384089=_0xae48e8;return{'id':_0x51f8ab['id'],'threadId':_0x51f8ab[_0x384089(0xd5)],'ref':_0x51f8ab[_0x384089(0xce)]};}};S=Q([b(0x0,_0x4293fe(_0x1f0c3e)),b(0x1,_0x4293fe(_0x4a6b5e)),b(0x2,_0x4293fe(_0x12024f))],S);var re=Object[_0xae48e8(0xc5)],te=(_0x868595,_0x49a3e5,_0x7f37b3,_0x199247)=>{const _0x414813=_0xae48e8;for(var _0x51e3e4=_0x199247>0x1?void 0x0:_0x199247?re(_0x49a3e5,_0x7f37b3):_0x49a3e5,_0x32cd78=_0x868595[_0x414813(0x101)]-0x1,_0x168ab8;_0x32cd78>=0x0;_0x32cd78--)(_0x168ab8=_0x868595[_0x32cd78])&&(_0x51e3e4=_0x168ab8(_0x51e3e4)||_0x51e3e4);return _0x51e3e4;},M=(_0x5e3719,_0x3dce69)=>(_0x1f8e11,_0x5740ce)=>_0x3dce69(_0x1f8e11,_0x5740ce,_0x5e3719);let f=class extends _0x490269{constructor(_0x268d57,_0x200ef0){const _0x2d4a05=_0xae48e8;super(),this[_0x2d4a05(0xe2)]=_0x268d57,this[_0x2d4a05(0xe5)]=_0x200ef0,this[_0x2d4a05(0x109)]();}[_0xae48e8(0x109)](){const _0x43b95a=_0xae48e8;this['_threadCommentDataSourceService'][_0x43b95a(0xf9)]=this[_0x43b95a(0xe5)],this['_threadCommentDataSourceService'][_0x43b95a(0xc3)]=!0x1;}};f=te([M(0x0,_0x41df09),M(0x1,_0x4293fe(S))],f);var se=Object[_0xae48e8(0xb0)],oe=Object[_0xae48e8(0xc5)],ne=(_0xd724d0,_0x39fb83,_0x500f7c)=>_0x39fb83 in _0xd724d0?se(_0xd724d0,_0x39fb83,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x500f7c}):_0xd724d0[_0x39fb83]=_0x500f7c,ie=(_0x280339,_0x316153,_0x1fdac7,_0xd3543d)=>{const _0xa3e1e3=_0xae48e8;for(var _0x3b6a72=_0xd3543d>0x1?void 0x0:_0xd3543d?oe(_0x316153,_0x1fdac7):_0x316153,_0x256d40=_0x280339[_0xa3e1e3(0x101)]-0x1,_0xe878d1;_0x256d40>=0x0;_0x256d40--)(_0xe878d1=_0x280339[_0x256d40])&&(_0x3b6a72=_0xe878d1(_0x3b6a72)||_0x3b6a72);return _0x3b6a72;},N=(_0x5d1322,_0x263669)=>(_0x5c5359,_0xa2f7a1)=>_0x263669(_0x5c5359,_0xa2f7a1,_0x5d1322),$=(_0xdda9e0,_0x3f5d3a,_0x2d715c)=>ne(_0xdda9e0,typeof _0x3f5d3a!='symbol'?_0x3f5d3a+'':_0x3f5d3a,_0x2d715c);let g=class extends _0x1d5852{constructor(_0x3cbd37=O,_0x2dddcf,_0xe4bfcb){const _0x519874=_0xae48e8;super(),this['_config']=_0x3cbd37,this['_injector']=_0x2dddcf,this[_0x519874(0xfb)]=_0xe4bfcb;const {..._0x46b64e}=_0x2ffa71({},O,this[_0x519874(0xaa)]);this[_0x519874(0xfb)]['setConfig'](z,_0x46b64e);}[_0xae48e8(0xb6)](){[[S],[f],[_]]['forEach'](_0x381175=>{const _0x4d152f=_0x4a6a;this['_injector'][_0x4d152f(0xb4)](_0x381175);});}['onReady'](){const _0x1ef97b=_0xae48e8;this[_0x1ef97b(0xe1)][_0x1ef97b(0xdc)](f),this[_0x1ef97b(0xe1)][_0x1ef97b(0xdc)](_);}};$(g,'pluginName',W),$(g,'type',_0x2f7f9b[_0xae48e8(0xad)]),g=ie([_0x5afa64(_0x1f9c3f,_0x490620,_0x48719b),N(0x1,_0x4293fe(_0x5f09c2)),N(0x2,_0x254ac8)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3603e1=_0x2560;(function(_0xa1537d,_0x11af53){const _0x5ea1e0=_0x2560,_0x147c00=_0xa1537d();while(!![]){try{const _0x1295b0=-parseInt(_0x5ea1e0(0x14f))/0x1*(-parseInt(_0x5ea1e0(0x163))/0x2)+parseInt(_0x5ea1e0(0x12d))/0x3+-parseInt(_0x5ea1e0(0x145))/0x4+parseInt(_0x5ea1e0(0x14d))/0x5+parseInt(_0x5ea1e0(0x132))/0x6+-parseInt(_0x5ea1e0(0x150))/0x7+-parseInt(_0x5ea1e0(0x133))/0x8*(-parseInt(_0x5ea1e0(0x15a))/0x9);if(_0x1295b0===_0x11af53)break;else _0x147c00['push'](_0x147c00['shift']());}catch(_0x5e1b46){_0x147c00['push'](_0x147c00['shift']());}}}(_0x549c,0xb67e9));import{CommentService as _0x5d5f90,CollaborationSessionService as _0x3c4a77,UniverCollaborationClientPlugin as _0x8c2bb9}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0xd50337}from'@univerjs-pro/license';import{dayjs as _0x2557b7,UserManagerService as _0x2bff43,Inject as _0x4c511f,Injector as _0x130911,Disposable as _0x199a3d,CustomRangeType as _0x729685,UniverInstanceType as _0x4ffa54,DependentOn as _0x414d5d,IConfigService as _0x5d98bf,Plugin as _0x2db651,merge as _0x352425}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x5b41d9}from'@univerjs/thread-comment-ui';function _0x549c(){const _0x3b6b96=['addUser','_configService','comment','deleteComment','/edit','pipe','Edit','resolved','2PmucyW','createTimestamp','Solve','parse','YYYY/MM/DD\x20HH:mm','rangeId','_httpService','COMMENT','saveCommentToSnapshot','map','solved','getOwnPropertyDescriptor','pluginName','_userService','unitId','threadId','filter','Solved','replies','customRanges','find','_threadCommentDataSourceService','_initDataSource','userID','size','error','_injector','user','disposeWithMe','UNRECOGNIZED','length','subscribe','root','_sessionService','Unknown','_initUserSync','content','parentId','rangeType','requireSession','OpenOrReOpen','resolveComment','reply','Add','code','ref','getCurrentUser','372465IzKdOn','userId','get','users','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','868542mHczTj','9946000ooByHz','post','_threadCommentDataSource','setConfig','onReady','/add','_commentService','Reply','slice','/universer-api/comment/unit/','updateComment','values','UNIVER_UNKNOWN','/solved','dataSource','getMemberID','add','delete','4405228HrwoMy','payload','format','stringify','addComment','replyId','_config','body','6636785AdUQxW','_init','319433kXmTug','9171036eFBHMz','getUnit','Delete','forEach','_threadCommentModel','commentUpdate$','personId','/list','type','syncUpdateMutationToColla','9wXcmmx'];_0x549c=function(){return _0x3b6b96;};return _0x549c();}import{ThreadCommentModel as _0x1650d8,IThreadCommentDataSourceService as _0x14c9f4}from'@univerjs/thread-comment';import{bufferTime as _0x33d3a7}from'rxjs';import{HTTPService as _0x4be4d2}from'@univerjs/network';const W=_0x3603e1(0x131);var I=(_0x1e8132=>(_0x1e8132[_0x1e8132[_0x3603e1(0x126)]=0x0]=_0x3603e1(0x126),_0x1e8132[_0x1e8132['Solved']=0x1]='Solved',_0x1e8132[_0x1e8132[_0x3603e1(0x11b)]=-0x1]=_0x3603e1(0x11b),_0x1e8132))(I||{}),v=(_0x45e0db=>(_0x45e0db[_0x45e0db[_0x3603e1(0x120)]=0x0]=_0x3603e1(0x120),_0x45e0db[_0x45e0db[_0x3603e1(0x129)]=0x1]=_0x3603e1(0x129),_0x45e0db[_0x45e0db[_0x3603e1(0x13a)]=0x2]=_0x3603e1(0x13a),_0x45e0db[_0x45e0db[_0x3603e1(0x161)]=0x3]='Edit',_0x45e0db[_0x45e0db[_0x3603e1(0x152)]=0x4]=_0x3603e1(0x152),_0x45e0db[_0x45e0db['Solve']=0x5]=_0x3603e1(0x165),_0x45e0db[_0x45e0db['UNRECOGNIZED']=-0x1]=_0x3603e1(0x11b),_0x45e0db))(v||{});const y=_0x1222d2=>_0x2557b7(new Date(+_0x1222d2))[_0x3603e1(0x147)](_0x3603e1(0x167)),B=async(_0x25f2aa,_0x3668ec)=>{const _0x38f4c6=_0x3603e1,_0x41c345=_0x25f2aa[_0x38f4c6(0x12f)](_0x2bff43),_0xdd090c=_0x25f2aa['get'](_0x4be4d2);_0x3668ec['forEach'](_0x2e82cc=>{const _0x1df16f=_0x38f4c6;_0x41c345['getUser'](_0x2e82cc)&&_0x3668ec[_0x1df16f(0x144)](_0x2e82cc);}),_0x3668ec[_0x38f4c6(0x116)]&&(await _0xdd090c[_0x38f4c6(0x12f)]('/universer-api/user/list',{'params':{'userIDs':[..._0x3668ec]}}))[_0x38f4c6(0x14c)][_0x38f4c6(0x130)][_0x38f4c6(0x153)](_0x2449c2=>{_0x2449c2&&_0x41c345['addUser'](_0x2449c2);});};var K=Object['getOwnPropertyDescriptor'],V=(_0x42190c,_0x5cec83,_0x4907dc,_0x5e1cb7)=>{const _0xff9594=_0x3603e1;for(var _0x5e9f88=_0x5e1cb7>0x1?void 0x0:_0x5e1cb7?K(_0x5cec83,_0x4907dc):_0x5cec83,_0x3bca60=_0x42190c[_0xff9594(0x11c)]-0x1,_0x48719c;_0x3bca60>=0x0;_0x3bca60--)(_0x48719c=_0x42190c[_0x3bca60])&&(_0x5e9f88=_0x48719c(_0x5e9f88)||_0x5e9f88);return _0x5e9f88;},p=(_0x2efd0f,_0x28468f)=>(_0x408ca1,_0x15dd41)=>_0x28468f(_0x408ca1,_0x15dd41,_0x2efd0f);let _=class extends _0x199a3d{constructor(_0x39e204,_0x12cd99,_0x35f7d9,_0x18e945){const _0x36e703=_0x3603e1;super(),this[_0x36e703(0x139)]=_0x39e204,this[_0x36e703(0x154)]=_0x12cd99,this[_0x36e703(0x170)]=_0x35f7d9,this[_0x36e703(0x118)]=_0x18e945,this[_0x36e703(0x14e)](),this[_0x36e703(0x121)]();}[_0x3603e1(0x121)](){const _0xaf7b0c=_0x3603e1;this[_0xaf7b0c(0x11a)](this[_0xaf7b0c(0x154)][_0xaf7b0c(0x155)][_0xaf7b0c(0x160)](_0x33d3a7(0x10))['subscribe'](_0x46c702=>{const _0x3db001=_0xaf7b0c,_0x534f63=new Set();_0x46c702[_0x3db001(0x153)](_0x1f1752=>{const _0x32501d=_0x3db001;switch(_0x1f1752[_0x32501d(0x158)]){case _0x32501d(0x143):{const _0x3a6c10=_0x1f1752[_0x32501d(0x146)][_0x32501d(0x156)];_0x534f63[_0x32501d(0x143)](_0x3a6c10);break;}}}),B(this[_0x3db001(0x118)],_0x534f63);}));}['_init'](){const _0x50faa7=_0x3603e1;this[_0x50faa7(0x11a)](this[_0x50faa7(0x139)][_0x50faa7(0x155)][_0x50faa7(0x11d)](async _0x491b86=>{const _0x383228=_0x50faa7;var _0x4cd500,_0x933e87,_0x534ec5,_0x4394c7;const _0x170e0f=(_0x4cd500=this[_0x383228(0x154)][_0x383228(0x151)](_0x491b86[_0x383228(0x171)])[_0x383228(0x112)](_0x55e71a=>_0x55e71a[_0x383228(0x172)]===_0x491b86[_0x383228(0x172)]))==null?void 0x0:_0x4cd500[_0x383228(0x11e)];if(!_0x170e0f)return;const {unitId:_0x300389,subUnitId:_0x33d44e}=_0x170e0f;switch(_0x491b86[_0x383228(0x119)]&&this[_0x383228(0x170)][_0x383228(0x15b)](_0x491b86[_0x383228(0x119)]),_0x491b86[_0x383228(0x158)]){case v['Add']:break;case v[_0x383228(0x13a)]:{this[_0x383228(0x154)][_0x383228(0x149)](_0x300389,_0x33d44e,{'unitId':_0x300389,'subUnitId':_0x33d44e,'ref':'','id':_0x491b86['replyId'],'dT':y(+_0x491b86[_0x383228(0x164)]),'threadId':_0x491b86[_0x383228(0x172)],'personId':(_0x534ec5=(_0x933e87=_0x491b86[_0x383228(0x119)])==null?void 0x0:_0x933e87[_0x383228(0x115)])!=null?_0x534ec5:_0x491b86['userId'],'text':JSON[_0x383228(0x166)](_0x491b86[_0x383228(0x122)]),'parentId':_0x170e0f['id']});break;}case v['Delete']:{const _0x418b2e=this[_0x383228(0x154)]['getComment'](_0x300389,_0x33d44e,_0x491b86[_0x383228(0x14a)]);_0x418b2e&&_0x418b2e[_0x383228(0x123)]&&this['_threadCommentModel'][_0x383228(0x15e)](_0x300389,_0x33d44e,_0x491b86[_0x383228(0x14a)]);break;}case v['Edit']:{this[_0x383228(0x154)][_0x383228(0x13d)](_0x300389,_0x33d44e,{'commentId':_0x491b86[_0x383228(0x14a)],'text':JSON['parse'](_0x491b86[_0x383228(0x122)])});break;}case v[_0x383228(0x165)]:{const _0x578684=(_0x4394c7=this[_0x383228(0x154)][_0x383228(0x151)](_0x491b86[_0x383228(0x171)])['find'](_0x40ea88=>_0x40ea88[_0x383228(0x172)]===_0x491b86['threadId']))==null?void 0x0:_0x4394c7['root'];_0x578684&&this['_threadCommentModel'][_0x383228(0x127)](_0x300389,_0x33d44e,_0x578684['id'],_0x491b86[_0x383228(0x16d)]===I['Solved']);break;}}}));}};_=V([p(0x0,_0x4c511f(_0x5d5f90)),p(0x1,_0x4c511f(_0x1650d8)),p(0x2,_0x4c511f(_0x2bff43)),p(0x3,_0x4c511f(_0x130911))],_);function _0x2560(_0x347111,_0x5da665){const _0x549c35=_0x549c();return _0x2560=function(_0x25603c,_0x2dc82c){_0x25603c=_0x25603c-0x111;let _0x23ac25=_0x549c35[_0x25603c];return _0x23ac25;},_0x2560(_0x347111,_0x5da665);}const z='thread-comment-data-source.config',O={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x5bdaee,_0x255f8f,_0x2a2ca5,_0x15aaa5)=>{for(var _0x45c161=_0x15aaa5>0x1?void 0x0:_0x15aaa5?k(_0x255f8f,_0x2a2ca5):_0x255f8f,_0x3a6252=_0x5bdaee['length']-0x1,_0x1d8bd2;_0x3a6252>=0x0;_0x3a6252--)(_0x1d8bd2=_0x5bdaee[_0x3a6252])&&(_0x45c161=_0x1d8bd2(_0x45c161)||_0x45c161);return _0x45c161;},b=(_0x9fdc32,_0x2f9aeb)=>(_0x29a17d,_0x40315d)=>_0x2f9aeb(_0x29a17d,_0x40315d,_0x9fdc32);function X(_0x387955,_0x8fc331){const _0x36d2f5=_0x3603e1,_0x257eeb=_0x387955[_0x36d2f5(0x175)][0x0];return{..._0x8fc331,'id':_0x257eeb[_0x36d2f5(0x14a)],'resolved':_0x387955['solved']===0x1,'dT':y(_0x257eeb[_0x36d2f5(0x164)]),'personId':_0x257eeb['userId'],'threadId':_0x257eeb[_0x36d2f5(0x172)]};}function ee(_0x242bc8,_0x1a5118,_0x5c8298){const _0x2476dc=_0x3603e1;var _0x20f65a,_0x4ded9c;if(((_0x4ded9c=(_0x20f65a=_0x242bc8==null?void 0x0:_0x242bc8['replies'])==null?void 0x0:_0x20f65a[_0x2476dc(0x11c)])!=null?_0x4ded9c:0x0)>0x0){const _0x402548=(_0x4ae8c7,_0x314035)=>({'id':_0x4ae8c7[_0x2476dc(0x14a)],'threadId':_0x4ae8c7[_0x2476dc(0x172)],'dT':y(_0x4ae8c7[_0x2476dc(0x164)]),'personId':_0x4ae8c7[_0x2476dc(0x12e)],'resolved':_0x242bc8[_0x2476dc(0x16d)]===I[_0x2476dc(0x174)],'unitId':_0x1a5118,'subUnitId':_0x5c8298,'text':JSON[_0x2476dc(0x166)](_0x4ae8c7[_0x2476dc(0x122)]),'parentId':_0x314035}),_0x2abd8f=_0x402548(_0x242bc8[_0x2476dc(0x175)][0x0]);return{..._0x2abd8f,'children':_0x242bc8['replies'][_0x2476dc(0x13b)](0x1)[_0x2476dc(0x16c)](_0x5ab63b=>_0x402548(_0x5ab63b,_0x2abd8f['id']))};}return null;}let S=class{constructor(_0x38b591,_0x12135c,_0x43adcc){const _0x1bd914=_0x3603e1;this['_httpService']=_0x38b591,this[_0x1bd914(0x170)]=_0x12135c,this[_0x1bd914(0x11f)]=_0x43adcc;}async[_0x3603e1(0x149)](_0x576602){const _0x5d6350=_0x3603e1;var _0x49b212,_0x5030d4;const {parentId:_0x2eee08,unitId:_0x2e627e,text:_0x53aa84,threadId:_0x5e5adf}=_0x576602,_0xe0a2b0=(_0x5030d4=(_0x49b212=_0x53aa84[_0x5d6350(0x111)])==null?void 0x0:_0x49b212['filter'](_0x5a2df8=>_0x5a2df8[_0x5d6350(0x124)]===_0x729685[_0x5d6350(0x16a)])[_0x5d6350(0x16c)](_0x3a8dab=>_0x3a8dab[_0x5d6350(0x168)]))!=null?_0x5030d4:[],_0x2b50ac=JSON[_0x5d6350(0x148)](_0x53aa84),_0x4b0364=(await this[_0x5d6350(0x11f)][_0x5d6350(0x125)](_0x2e627e))['getMemberID']();if(_0x2eee08){const _0x1e1567={'memberId':_0x4b0364,'unitId':_0x2e627e,'content':_0x2b50ac,'mention':_0xe0a2b0,'threadId':_0x5e5adf},_0x29a066=(await this['_httpService'][_0x5d6350(0x134)]('/universer-api/comment/unit/'+_0x2e627e+'/reply',{'body':_0x1e1567}))[_0x5d6350(0x14c)][_0x5d6350(0x128)];return{..._0x576602,'id':_0x29a066[_0x5d6350(0x14a)],'dT':_0x2557b7(+_0x29a066['createTimestamp'])[_0x5d6350(0x147)](_0x5d6350(0x167)),'personId':_0x29a066[_0x5d6350(0x12e)]};}else{const _0x3a8725={'memberId':_0x4b0364,'unitId':_0x2e627e,'content':_0x2b50ac,'mention':_0xe0a2b0},_0x12b2f1=await this['_httpService'][_0x5d6350(0x134)]('/universer-api/comment/unit/'+_0x2e627e+_0x5d6350(0x138),{'body':_0x3a8725});return X(_0x12b2f1['body'][_0x5d6350(0x15d)],_0x576602);}}async[_0x3603e1(0x13d)](_0x7e24d7){const _0x36aeb4=_0x3603e1;var _0x562efe,_0x46c781;const {text:_0x5587f3,unitId:_0x28913b}=_0x7e24d7,_0xcd73c7=(_0x46c781=(_0x562efe=_0x5587f3[_0x36aeb4(0x111)])==null?void 0x0:_0x562efe[_0x36aeb4(0x173)](_0x3950b1=>_0x3950b1[_0x36aeb4(0x124)]===_0x729685[_0x36aeb4(0x16a)])[_0x36aeb4(0x16c)](_0x543c22=>_0x543c22['rangeId']))!=null?_0x46c781:[],_0x50513b=JSON['stringify'](_0x5587f3),_0x2d8946=_0x7e24d7[_0x36aeb4(0x172)],_0x5e1fcb=_0x7e24d7['id'],_0x309c07={'memberId':(await this[_0x36aeb4(0x11f)][_0x36aeb4(0x125)](_0x28913b))['getMemberID'](),'unitId':_0x28913b,'threadId':_0x2d8946,'mention':_0xcd73c7,'content':_0x50513b,'replyId':_0x5e1fcb},_0x316bde=await this[_0x36aeb4(0x169)][_0x36aeb4(0x134)]('/universer-api/comment/unit/'+_0x28913b+_0x36aeb4(0x15f),{'body':_0x309c07});return!_0x316bde['body']['error']||_0x316bde[_0x36aeb4(0x14c)][_0x36aeb4(0x117)][_0x36aeb4(0x12a)]===0x1;}async[_0x3603e1(0x127)](_0x17a72c){const _0x564f23=_0x3603e1,{unitId:_0x417c84}=_0x17a72c,_0x49e65b=_0x17a72c[_0x564f23(0x172)],_0x2e6561={'memberId':this[_0x564f23(0x170)][_0x564f23(0x12c)]()[_0x564f23(0x115)],'unitId':_0x417c84,'threadId':_0x49e65b,'solved':_0x17a72c[_0x564f23(0x162)]?I['Solved']:I[_0x564f23(0x126)]},_0x370a85=await this[_0x564f23(0x169)]['post'](_0x564f23(0x13c)+_0x417c84+_0x564f23(0x140),{'body':_0x2e6561});return!_0x370a85[_0x564f23(0x14c)]['error']||_0x370a85[_0x564f23(0x14c)][_0x564f23(0x117)][_0x564f23(0x12a)]===0x1;}async['deleteComment'](_0x526e13,_0x3a00f5,_0x222751,_0x442f5e){const _0x336cc6=_0x3603e1,_0x98e226={'memberId':(await this['_sessionService'][_0x336cc6(0x125)](_0x526e13))[_0x336cc6(0x142)](),'threadId':_0x222751,'replyId':_0x442f5e,'unitId':_0x526e13},_0x3705d5=await this[_0x336cc6(0x169)][_0x336cc6(0x134)]('/universer-api/comment/unit/'+_0x526e13+'/delete',{'body':_0x98e226});return!_0x3705d5[_0x336cc6(0x14c)][_0x336cc6(0x117)]||_0x3705d5[_0x336cc6(0x14c)][_0x336cc6(0x117)][_0x336cc6(0x12a)]===0x1;}async['listComments'](_0x3ab6f2,_0x21a4cd,_0x11fdb9){const _0x4636dd=_0x3603e1,_0x1e174f={'unitId':_0x3ab6f2,'threadId':_0x11fdb9},_0x36d645=await this[_0x4636dd(0x169)][_0x4636dd(0x134)](_0x4636dd(0x13c)+_0x3ab6f2+_0x4636dd(0x157),{'body':_0x1e174f}),_0x198f78=_0x11fdb9[_0x4636dd(0x16c)](_0x451b15=>ee(_0x36d645[_0x4636dd(0x14c)]['comments'][_0x451b15],_0x3ab6f2,_0x21a4cd))['filter'](Boolean);return Object[_0x4636dd(0x13e)](_0x36d645['body'][_0x4636dd(0x130)])[_0x4636dd(0x153)](_0x46054b=>{const _0x152e6e=_0x4636dd;this[_0x152e6e(0x170)][_0x152e6e(0x15b)](_0x46054b);}),_0x198f78;}[_0x3603e1(0x16b)](_0x2ecc60){const _0x478897=_0x3603e1;return{'id':_0x2ecc60['id'],'threadId':_0x2ecc60[_0x478897(0x172)],'ref':_0x2ecc60[_0x478897(0x12b)]};}};S=Q([b(0x0,_0x4c511f(_0x4be4d2)),b(0x1,_0x4c511f(_0x2bff43)),b(0x2,_0x4c511f(_0x3c4a77))],S);var re=Object[_0x3603e1(0x16e)],te=(_0x52cef3,_0x358961,_0x5869a7,_0x5b2bc1)=>{const _0x49b540=_0x3603e1;for(var _0x17ada8=_0x5b2bc1>0x1?void 0x0:_0x5b2bc1?re(_0x358961,_0x5869a7):_0x358961,_0x114f18=_0x52cef3[_0x49b540(0x11c)]-0x1,_0x2d6d13;_0x114f18>=0x0;_0x114f18--)(_0x2d6d13=_0x52cef3[_0x114f18])&&(_0x17ada8=_0x2d6d13(_0x17ada8)||_0x17ada8);return _0x17ada8;},M=(_0x3d1f7b,_0x120812)=>(_0xe48815,_0x2da559)=>_0x120812(_0xe48815,_0x2da559,_0x3d1f7b);let f=class extends _0x199a3d{constructor(_0x5294ac,_0x45bfef){const _0x510915=_0x3603e1;super(),this['_threadCommentDataSourceService']=_0x5294ac,this['_threadCommentDataSource']=_0x45bfef,this[_0x510915(0x114)]();}[_0x3603e1(0x114)](){const _0x58da72=_0x3603e1;this[_0x58da72(0x113)][_0x58da72(0x141)]=this[_0x58da72(0x135)],this[_0x58da72(0x113)][_0x58da72(0x159)]=!0x1;}};f=te([M(0x0,_0x14c9f4),M(0x1,_0x4c511f(S))],f);var se=Object['defineProperty'],oe=Object[_0x3603e1(0x16e)],ne=(_0x48ded8,_0xaa4984,_0x14a79d)=>_0xaa4984 in _0x48ded8?se(_0x48ded8,_0xaa4984,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x14a79d}):_0x48ded8[_0xaa4984]=_0x14a79d,ie=(_0x1405ab,_0x4d873e,_0x1a522a,_0x129fad)=>{for(var _0x4bb661=_0x129fad>0x1?void 0x0:_0x129fad?oe(_0x4d873e,_0x1a522a):_0x4d873e,_0x376546=_0x1405ab['length']-0x1,_0x2c7adc;_0x376546>=0x0;_0x376546--)(_0x2c7adc=_0x1405ab[_0x376546])&&(_0x4bb661=_0x2c7adc(_0x4bb661)||_0x4bb661);return _0x4bb661;},N=(_0x5aa258,_0x488498)=>(_0x2c93fa,_0x5a31e6)=>_0x488498(_0x2c93fa,_0x5a31e6,_0x5aa258),$=(_0x184f22,_0x48592a,_0x1a2c9f)=>ne(_0x184f22,typeof _0x48592a!='symbol'?_0x48592a+'':_0x48592a,_0x1a2c9f);let g=class extends _0x2db651{constructor(_0x1ef4b3=O,_0x2c0d31,_0x41dc22){const _0x45abde=_0x3603e1;super(),this[_0x45abde(0x14b)]=_0x1ef4b3,this[_0x45abde(0x118)]=_0x2c0d31,this[_0x45abde(0x15c)]=_0x41dc22;const {..._0x1f6e80}=_0x352425({},O,this['_config']);this['_configService'][_0x45abde(0x136)](z,_0x1f6e80);}['onStarting'](){const _0x3c080e=_0x3603e1;[[S],[f],[_]][_0x3c080e(0x153)](_0x3b515a=>{const _0xc5e888=_0x3c080e;this[_0xc5e888(0x118)][_0xc5e888(0x143)](_0x3b515a);});}[_0x3603e1(0x137)](){const _0x2ae203=_0x3603e1;this[_0x2ae203(0x118)][_0x2ae203(0x12f)](f),this[_0x2ae203(0x118)][_0x2ae203(0x12f)](_);}};$(g,_0x3603e1(0x16f),W),$(g,_0x3603e1(0x158),_0x4ffa54[_0x3603e1(0x13f)]),g=ie([_0x414d5d(_0x5b41d9,_0x8c2bb9,_0xd50337),N(0x1,_0x4c511f(_0x130911)),N(0x2,_0x5d98bf)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0xae48e8=_0x4a6a;(function(_0x34c849,_0x10de2b){const _0x474d5e=_0x4a6a,_0x3e0b68=_0x34c849();while(!![]){try{const _0x2d5f54=-parseInt(_0x474d5e(0xec))/0x1*(parseInt(_0x474d5e(0xe0))/0x2)+parseInt(_0x474d5e(0xf1))/0x3+parseInt(_0x474d5e(0xe6))/0x4*(-parseInt(_0x474d5e(0xdb))/0x5)+parseInt(_0x474d5e(0xb1))/0x6+-parseInt(_0x474d5e(0xc7))/0x7*(-parseInt(_0x474d5e(0xb5))/0x8)+-parseInt(_0x474d5e(0xb2))/0x9*(-parseInt(_0x474d5e(0xd9))/0xa)+-parseInt(_0x474d5e(0xc9))/0xb*(parseInt(_0x474d5e(0xff))/0xc);if(_0x2d5f54===_0x10de2b)break;else _0x3e0b68['push'](_0x3e0b68['shift']());}catch(_0x2b72e5){_0x3e0b68['push'](_0x3e0b68['shift']());}}}(_0x6ed9,0x23880));import{CommentService as _0x4294c9,CollaborationSessionService as _0x12024f,UniverCollaborationClientPlugin as _0x490620}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x48719b}from'@univerjs-pro/license';import{dayjs as _0x112222,UserManagerService as _0x4a6b5e,Inject as _0x4293fe,Injector as _0x5f09c2,Disposable as _0x490269,CustomRangeType as _0x435b6d,UniverInstanceType as _0x2f7f9b,DependentOn as _0x5afa64,IConfigService as _0x254ac8,Plugin as _0x1d5852,merge as _0x2ffa71}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1f9c3f}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x29a48e,IThreadCommentDataSourceService as _0x41df09}from'@univerjs/thread-comment';function _0x4a6a(_0x1eb5d0,_0x5beb7c){const _0x6ed95d=_0x6ed9();return _0x4a6a=function(_0x4a6a89,_0x2bf3b6){_0x4a6a89=_0x4a6a89-0xa6;let _0x1252a7=_0x6ed95d[_0x4a6a89];return _0x1252a7;},_0x4a6a(_0x1eb5d0,_0x5beb7c);}import{bufferTime as _0x350851}from'rxjs';import{HTTPService as _0x1f0c3e}from'@univerjs/network';const W=_0xae48e8(0xf4);var I=(_0x30d18c=>(_0x30d18c[_0x30d18c[_0xae48e8(0xba)]=0x0]=_0xae48e8(0xba),_0x30d18c[_0x30d18c['Solved']=0x1]=_0xae48e8(0x108),_0x30d18c[_0x30d18c[_0xae48e8(0xe8)]=-0x1]=_0xae48e8(0xe8),_0x30d18c))(I||{}),v=(_0x67ce74=>(_0x67ce74[_0x67ce74['Unknown']=0x0]=_0xae48e8(0x106),_0x67ce74[_0x67ce74['Add']=0x1]=_0xae48e8(0x10a),_0x67ce74[_0x67ce74[_0xae48e8(0xf7)]=0x2]='Reply',_0x67ce74[_0x67ce74[_0xae48e8(0xd4)]=0x3]=_0xae48e8(0xd4),_0x67ce74[_0x67ce74['Delete']=0x4]=_0xae48e8(0xc0),_0x67ce74[_0x67ce74[_0xae48e8(0xa8)]=0x5]=_0xae48e8(0xa8),_0x67ce74[_0x67ce74['UNRECOGNIZED']=-0x1]=_0xae48e8(0xe8),_0x67ce74))(v||{});const y=_0x1f20f9=>_0x112222(new Date(+_0x1f20f9))[_0xae48e8(0xcf)](_0xae48e8(0xea)),B=async(_0x5123a5,_0x174e65)=>{const _0x299d7a=_0xae48e8,_0x1aa93c=_0x5123a5['get'](_0x4a6b5e),_0x2be18a=_0x5123a5['get'](_0x1f0c3e);_0x174e65[_0x299d7a(0x104)](_0x2d3d5c=>{const _0x2e135e=_0x299d7a;_0x1aa93c[_0x2e135e(0xa7)](_0x2d3d5c)&&_0x174e65[_0x2e135e(0xbc)](_0x2d3d5c);}),_0x174e65[_0x299d7a(0xb9)]&&(await _0x2be18a[_0x299d7a(0xdc)](_0x299d7a(0xbf),{'params':{'userIDs':[..._0x174e65]}}))['body'][_0x299d7a(0xcd)][_0x299d7a(0x104)](_0x45a1f4=>{const _0x222e60=_0x299d7a;_0x45a1f4&&_0x1aa93c[_0x222e60(0xca)](_0x45a1f4);});};var K=Object[_0xae48e8(0xc5)],V=(_0x4f3f3c,_0xc88767,_0x4a144d,_0x180a10)=>{const _0x42355c=_0xae48e8;for(var _0x15e2a8=_0x180a10>0x1?void 0x0:_0x180a10?K(_0xc88767,_0x4a144d):_0xc88767,_0x1a8ce7=_0x4f3f3c[_0x42355c(0x101)]-0x1,_0x34c274;_0x1a8ce7>=0x0;_0x1a8ce7--)(_0x34c274=_0x4f3f3c[_0x1a8ce7])&&(_0x15e2a8=_0x34c274(_0x15e2a8)||_0x15e2a8);return _0x15e2a8;},p=(_0x2269b7,_0x354442)=>(_0x4b5aed,_0x8473dd)=>_0x354442(_0x4b5aed,_0x8473dd,_0x2269b7);let _=class extends _0x490269{constructor(_0x21dab8,_0x44d787,_0x423357,_0xb7e4ac){const _0x32c25a=_0xae48e8;super(),this[_0x32c25a(0x100)]=_0x21dab8,this[_0x32c25a(0xb7)]=_0x44d787,this[_0x32c25a(0xe7)]=_0x423357,this['_injector']=_0xb7e4ac,this[_0x32c25a(0xef)](),this[_0x32c25a(0xd6)]();}[_0xae48e8(0xd6)](){const _0x317d70=_0xae48e8;this[_0x317d70(0xbb)](this[_0x317d70(0xb7)]['commentUpdate$']['pipe'](_0x350851(0x10))['subscribe'](_0x5c19cd=>{const _0x30aaf5=_0x317d70,_0x468230=new Set();_0x5c19cd[_0x30aaf5(0x104)](_0x55ae96=>{const _0x2200f7=_0x30aaf5;switch(_0x55ae96['type']){case _0x2200f7(0xb4):{const _0x4104f0=_0x55ae96[_0x2200f7(0xdd)]['personId'];_0x468230[_0x2200f7(0xb4)](_0x4104f0);break;}}}),B(this['_injector'],_0x468230);}));}['_init'](){const _0x369bfd=_0xae48e8;this[_0x369bfd(0xbb)](this['_commentService'][_0x369bfd(0xde)]['subscribe'](async _0x1ce3c8=>{const _0x1a29cb=_0x369bfd;var _0x3df353,_0x460914,_0x9a8e37,_0x5837ad;const _0x47d013=(_0x3df353=this[_0x1a29cb(0xb7)][_0x1a29cb(0xae)](_0x1ce3c8[_0x1a29cb(0xab)])[_0x1a29cb(0xe4)](_0x414284=>_0x414284[_0x1a29cb(0xd5)]===_0x1ce3c8[_0x1a29cb(0xd5)]))==null?void 0x0:_0x3df353[_0x1a29cb(0xfd)];if(!_0x47d013)return;const {unitId:_0x347b30,subUnitId:_0x24dbe6}=_0x47d013;switch(_0x1ce3c8[_0x1a29cb(0xfc)]&&this[_0x1a29cb(0xe7)][_0x1a29cb(0xca)](_0x1ce3c8['user']),_0x1ce3c8[_0x1a29cb(0x105)]){case v[_0x1a29cb(0x10a)]:break;case v[_0x1a29cb(0xf7)]:{this['_threadCommentModel'][_0x1a29cb(0xe3)](_0x347b30,_0x24dbe6,{'unitId':_0x347b30,'subUnitId':_0x24dbe6,'ref':'','id':_0x1ce3c8['replyId'],'dT':y(+_0x1ce3c8['createTimestamp']),'threadId':_0x1ce3c8[_0x1a29cb(0xd5)],'personId':(_0x9a8e37=(_0x460914=_0x1ce3c8['user'])==null?void 0x0:_0x460914['userID'])!=null?_0x9a8e37:_0x1ce3c8[_0x1a29cb(0xc1)],'text':JSON[_0x1a29cb(0xda)](_0x1ce3c8[_0x1a29cb(0xac)]),'parentId':_0x47d013['id']});break;}case v[_0x1a29cb(0xc0)]:{const _0x5d7137=this[_0x1a29cb(0xb7)][_0x1a29cb(0xcc)](_0x347b30,_0x24dbe6,_0x1ce3c8[_0x1a29cb(0x103)]);_0x5d7137&&_0x5d7137['parentId']&&this[_0x1a29cb(0xb7)][_0x1a29cb(0xed)](_0x347b30,_0x24dbe6,_0x1ce3c8[_0x1a29cb(0x103)]);break;}case v['Edit']:{this[_0x1a29cb(0xb7)][_0x1a29cb(0x107)](_0x347b30,_0x24dbe6,{'commentId':_0x1ce3c8[_0x1a29cb(0x103)],'text':JSON[_0x1a29cb(0xda)](_0x1ce3c8['content'])});break;}case v[_0x1a29cb(0xa8)]:{const _0xa3f900=(_0x5837ad=this[_0x1a29cb(0xb7)][_0x1a29cb(0xae)](_0x1ce3c8[_0x1a29cb(0xab)])['find'](_0x2300ea=>_0x2300ea[_0x1a29cb(0xd5)]===_0x1ce3c8[_0x1a29cb(0xd5)]))==null?void 0x0:_0x5837ad[_0x1a29cb(0xfd)];_0xa3f900&&this[_0x1a29cb(0xb7)][_0x1a29cb(0xbe)](_0x347b30,_0x24dbe6,_0xa3f900['id'],_0x1ce3c8[_0x1a29cb(0xa9)]===I[_0x1a29cb(0x108)]);break;}}}));}};_=V([p(0x0,_0x4293fe(_0x4294c9)),p(0x1,_0x4293fe(_0x29a48e)),p(0x2,_0x4293fe(_0x4a6b5e)),p(0x3,_0x4293fe(_0x5f09c2))],_);const z='thread-comment-data-source.config',O={};var k=Object[_0xae48e8(0xc5)],Q=(_0x1bc445,_0x976867,_0x5f2c61,_0x3f1647)=>{for(var _0x56146e=_0x3f1647>0x1?void 0x0:_0x3f1647?k(_0x976867,_0x5f2c61):_0x976867,_0x3c1514=_0x1bc445['length']-0x1,_0x2ae76c;_0x3c1514>=0x0;_0x3c1514--)(_0x2ae76c=_0x1bc445[_0x3c1514])&&(_0x56146e=_0x2ae76c(_0x56146e)||_0x56146e);return _0x56146e;},b=(_0x27caf9,_0x3d1875)=>(_0x4b89da,_0x2b4606)=>_0x3d1875(_0x4b89da,_0x2b4606,_0x27caf9);function X(_0x48eda6,_0x3f99a0){const _0x1405f1=_0xae48e8,_0x438ea8=_0x48eda6[_0x1405f1(0xf0)][0x0];return{..._0x3f99a0,'id':_0x438ea8['replyId'],'resolved':_0x48eda6['solved']===0x1,'dT':y(_0x438ea8[_0x1405f1(0xf8)]),'personId':_0x438ea8[_0x1405f1(0xc1)],'threadId':_0x438ea8[_0x1405f1(0xd5)]};}function ee(_0x5c3ae4,_0x3494c0,_0x2c70d3){const _0x19de92=_0xae48e8;var _0x4d3db6,_0xe146e9;if(((_0xe146e9=(_0x4d3db6=_0x5c3ae4==null?void 0x0:_0x5c3ae4[_0x19de92(0xf0)])==null?void 0x0:_0x4d3db6[_0x19de92(0x101)])!=null?_0xe146e9:0x0)>0x0){const _0x573bb7=(_0x15d944,_0x26e7b1)=>({'id':_0x15d944[_0x19de92(0x103)],'threadId':_0x15d944['threadId'],'dT':y(_0x15d944['createTimestamp']),'personId':_0x15d944['userId'],'resolved':_0x5c3ae4[_0x19de92(0xa9)]===I['Solved'],'unitId':_0x3494c0,'subUnitId':_0x2c70d3,'text':JSON['parse'](_0x15d944[_0x19de92(0xac)]),'parentId':_0x26e7b1}),_0x551ec8=_0x573bb7(_0x5c3ae4[_0x19de92(0xf0)][0x0]);return{..._0x551ec8,'children':_0x5c3ae4['replies'][_0x19de92(0xa6)](0x1)[_0x19de92(0xee)](_0x3b74f9=>_0x573bb7(_0x3b74f9,_0x551ec8['id']))};}return null;}function _0x6ed9(){const _0x2a08d2=['/list','150qtiKpT','parse','75255EDCiRg','get','payload','commentUpdate$','requireSession','2048dFLKum','_injector','_threadCommentDataSourceService','addComment','find','_threadCommentDataSource','64FkGudo','_userService','UNRECOGNIZED','saveCommentToSnapshot','YYYY/MM/DD\x20HH:mm','listComments','12SSKLbs','deleteComment','map','_init','replies','260622MWvtXl','post','values','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','getCurrentUser','comments','Reply','createTimestamp','dataSource','rangeType','_configService','user','root','filter','48keSAco','_commentService','length','/add','replyId','forEach','type','Unknown','updateComment','Solved','_initDataSource','Add','slice','getUser','Solve','solved','_config','unitId','content','UNIVER_UNKNOWN','getUnit','getMemberID','defineProperty','868992PGUdsN','136179NnLRpW','_httpService','add','24FDayxI','onStarting','_threadCommentModel','body','size','OpenOrReOpen','disposeWithMe','delete','_sessionService','resolveComment','/universer-api/user/list','Delete','userId','rangeId','syncUpdateMutationToColla','resolved','getOwnPropertyDescriptor','customRanges','82481mqyXCZ','/reply','262295veSzsV','addUser','/solved','getComment','users','ref','format','reply','/universer-api/comment/unit/','code','COMMENT','Edit','threadId','_initUserSync','error'];_0x6ed9=function(){return _0x2a08d2;};return _0x6ed9();}let S=class{constructor(_0x5f3117,_0x509651,_0x1874bf){const _0x4619dc=_0xae48e8;this[_0x4619dc(0xb3)]=_0x5f3117,this[_0x4619dc(0xe7)]=_0x509651,this[_0x4619dc(0xbd)]=_0x1874bf;}async['addComment'](_0x4921cb){const _0x5580de=_0xae48e8;var _0x309e5b,_0xfbfba1;const {parentId:_0x29aa91,unitId:_0x20be5f,text:_0x1d027b,threadId:_0x3d6a0b}=_0x4921cb,_0x19f2e5=(_0xfbfba1=(_0x309e5b=_0x1d027b[_0x5580de(0xc6)])==null?void 0x0:_0x309e5b['filter'](_0x1e0417=>_0x1e0417[_0x5580de(0xfa)]===_0x435b6d[_0x5580de(0xd3)])['map'](_0x1fb682=>_0x1fb682[_0x5580de(0xc2)]))!=null?_0xfbfba1:[],_0x14402e=JSON['stringify'](_0x1d027b),_0xf6e0a6=(await this[_0x5580de(0xbd)][_0x5580de(0xdf)](_0x20be5f))[_0x5580de(0xaf)]();if(_0x29aa91){const _0x5cacfd={'memberId':_0xf6e0a6,'unitId':_0x20be5f,'content':_0x14402e,'mention':_0x19f2e5,'threadId':_0x3d6a0b},_0x16fee3=(await this['_httpService'][_0x5580de(0xf2)](_0x5580de(0xd1)+_0x20be5f+_0x5580de(0xc8),{'body':_0x5cacfd}))[_0x5580de(0xb8)][_0x5580de(0xd0)];return{..._0x4921cb,'id':_0x16fee3[_0x5580de(0x103)],'dT':_0x112222(+_0x16fee3[_0x5580de(0xf8)])[_0x5580de(0xcf)](_0x5580de(0xea)),'personId':_0x16fee3['userId']};}else{const _0x1f7910={'memberId':_0xf6e0a6,'unitId':_0x20be5f,'content':_0x14402e,'mention':_0x19f2e5},_0x25906c=await this[_0x5580de(0xb3)][_0x5580de(0xf2)](_0x5580de(0xd1)+_0x20be5f+_0x5580de(0x102),{'body':_0x1f7910});return X(_0x25906c[_0x5580de(0xb8)]['comment'],_0x4921cb);}}async[_0xae48e8(0x107)](_0x3aed10){const _0x4f1bbf=_0xae48e8;var _0x5f4ba3,_0xaeba8e;const {text:_0x3bb053,unitId:_0xd2ce68}=_0x3aed10,_0x103757=(_0xaeba8e=(_0x5f4ba3=_0x3bb053['customRanges'])==null?void 0x0:_0x5f4ba3[_0x4f1bbf(0xfe)](_0x1d09a8=>_0x1d09a8[_0x4f1bbf(0xfa)]===_0x435b6d[_0x4f1bbf(0xd3)])[_0x4f1bbf(0xee)](_0x6cd4a6=>_0x6cd4a6[_0x4f1bbf(0xc2)]))!=null?_0xaeba8e:[],_0x3e9165=JSON['stringify'](_0x3bb053),_0x444a88=_0x3aed10[_0x4f1bbf(0xd5)],_0x362784=_0x3aed10['id'],_0x49aac6={'memberId':(await this[_0x4f1bbf(0xbd)][_0x4f1bbf(0xdf)](_0xd2ce68))['getMemberID'](),'unitId':_0xd2ce68,'threadId':_0x444a88,'mention':_0x103757,'content':_0x3e9165,'replyId':_0x362784},_0xd5b3b8=await this[_0x4f1bbf(0xb3)][_0x4f1bbf(0xf2)]('/universer-api/comment/unit/'+_0xd2ce68+'/edit',{'body':_0x49aac6});return!_0xd5b3b8[_0x4f1bbf(0xb8)][_0x4f1bbf(0xd7)]||_0xd5b3b8[_0x4f1bbf(0xb8)][_0x4f1bbf(0xd7)][_0x4f1bbf(0xd2)]===0x1;}async[_0xae48e8(0xbe)](_0x57b468){const _0x494714=_0xae48e8,{unitId:_0x43bfb4}=_0x57b468,_0x2a078f=_0x57b468[_0x494714(0xd5)],_0x109614={'memberId':this[_0x494714(0xe7)][_0x494714(0xf5)]()['userID'],'unitId':_0x43bfb4,'threadId':_0x2a078f,'solved':_0x57b468[_0x494714(0xc4)]?I['Solved']:I[_0x494714(0xba)]},_0xa513b7=await this[_0x494714(0xb3)]['post'](_0x494714(0xd1)+_0x43bfb4+_0x494714(0xcb),{'body':_0x109614});return!_0xa513b7[_0x494714(0xb8)][_0x494714(0xd7)]||_0xa513b7[_0x494714(0xb8)]['error'][_0x494714(0xd2)]===0x1;}async['deleteComment'](_0x91399b,_0x265efe,_0x17c895,_0x53c485){const _0x1f1b71=_0xae48e8,_0x1c648e={'memberId':(await this[_0x1f1b71(0xbd)][_0x1f1b71(0xdf)](_0x91399b))[_0x1f1b71(0xaf)](),'threadId':_0x17c895,'replyId':_0x53c485,'unitId':_0x91399b},_0x2d0f66=await this['_httpService'][_0x1f1b71(0xf2)]('/universer-api/comment/unit/'+_0x91399b+'/delete',{'body':_0x1c648e});return!_0x2d0f66[_0x1f1b71(0xb8)][_0x1f1b71(0xd7)]||_0x2d0f66[_0x1f1b71(0xb8)]['error']['code']===0x1;}async[_0xae48e8(0xeb)](_0x18df81,_0x3f8fa6,_0x3c87ba){const _0x19ba03=_0xae48e8,_0x3db1c8={'unitId':_0x18df81,'threadId':_0x3c87ba},_0xfa71dd=await this[_0x19ba03(0xb3)][_0x19ba03(0xf2)]('/universer-api/comment/unit/'+_0x18df81+_0x19ba03(0xd8),{'body':_0x3db1c8}),_0x148e5a=_0x3c87ba[_0x19ba03(0xee)](_0x3b1e66=>ee(_0xfa71dd['body'][_0x19ba03(0xf6)][_0x3b1e66],_0x18df81,_0x3f8fa6))[_0x19ba03(0xfe)](Boolean);return Object[_0x19ba03(0xf3)](_0xfa71dd[_0x19ba03(0xb8)]['users'])['forEach'](_0x48a2f4=>{const _0x2751d4=_0x19ba03;this[_0x2751d4(0xe7)][_0x2751d4(0xca)](_0x48a2f4);}),_0x148e5a;}[_0xae48e8(0xe9)](_0x51f8ab){const _0x384089=_0xae48e8;return{'id':_0x51f8ab['id'],'threadId':_0x51f8ab[_0x384089(0xd5)],'ref':_0x51f8ab[_0x384089(0xce)]};}};S=Q([b(0x0,_0x4293fe(_0x1f0c3e)),b(0x1,_0x4293fe(_0x4a6b5e)),b(0x2,_0x4293fe(_0x12024f))],S);var re=Object[_0xae48e8(0xc5)],te=(_0x868595,_0x49a3e5,_0x7f37b3,_0x199247)=>{const _0x414813=_0xae48e8;for(var _0x51e3e4=_0x199247>0x1?void 0x0:_0x199247?re(_0x49a3e5,_0x7f37b3):_0x49a3e5,_0x32cd78=_0x868595[_0x414813(0x101)]-0x1,_0x168ab8;_0x32cd78>=0x0;_0x32cd78--)(_0x168ab8=_0x868595[_0x32cd78])&&(_0x51e3e4=_0x168ab8(_0x51e3e4)||_0x51e3e4);return _0x51e3e4;},M=(_0x5e3719,_0x3dce69)=>(_0x1f8e11,_0x5740ce)=>_0x3dce69(_0x1f8e11,_0x5740ce,_0x5e3719);let f=class extends _0x490269{constructor(_0x268d57,_0x200ef0){const _0x2d4a05=_0xae48e8;super(),this[_0x2d4a05(0xe2)]=_0x268d57,this[_0x2d4a05(0xe5)]=_0x200ef0,this[_0x2d4a05(0x109)]();}[_0xae48e8(0x109)](){const _0x43b95a=_0xae48e8;this['_threadCommentDataSourceService'][_0x43b95a(0xf9)]=this[_0x43b95a(0xe5)],this['_threadCommentDataSourceService'][_0x43b95a(0xc3)]=!0x1;}};f=te([M(0x0,_0x41df09),M(0x1,_0x4293fe(S))],f);var se=Object[_0xae48e8(0xb0)],oe=Object[_0xae48e8(0xc5)],ne=(_0xd724d0,_0x39fb83,_0x500f7c)=>_0x39fb83 in _0xd724d0?se(_0xd724d0,_0x39fb83,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x500f7c}):_0xd724d0[_0x39fb83]=_0x500f7c,ie=(_0x280339,_0x316153,_0x1fdac7,_0xd3543d)=>{const _0xa3e1e3=_0xae48e8;for(var _0x3b6a72=_0xd3543d>0x1?void 0x0:_0xd3543d?oe(_0x316153,_0x1fdac7):_0x316153,_0x256d40=_0x280339[_0xa3e1e3(0x101)]-0x1,_0xe878d1;_0x256d40>=0x0;_0x256d40--)(_0xe878d1=_0x280339[_0x256d40])&&(_0x3b6a72=_0xe878d1(_0x3b6a72)||_0x3b6a72);return _0x3b6a72;},N=(_0x5d1322,_0x263669)=>(_0x5c5359,_0xa2f7a1)=>_0x263669(_0x5c5359,_0xa2f7a1,_0x5d1322),$=(_0xdda9e0,_0x3f5d3a,_0x2d715c)=>ne(_0xdda9e0,typeof _0x3f5d3a!='symbol'?_0x3f5d3a+'':_0x3f5d3a,_0x2d715c);let g=class extends _0x1d5852{constructor(_0x3cbd37=O,_0x2dddcf,_0xe4bfcb){const _0x519874=_0xae48e8;super(),this['_config']=_0x3cbd37,this['_injector']=_0x2dddcf,this[_0x519874(0xfb)]=_0xe4bfcb;const {..._0x46b64e}=_0x2ffa71({},O,this[_0x519874(0xaa)]);this[_0x519874(0xfb)]['setConfig'](z,_0x46b64e);}[_0xae48e8(0xb6)](){[[S],[f],[_]]['forEach'](_0x381175=>{const _0x4d152f=_0x4a6a;this['_injector'][_0x4d152f(0xb4)](_0x381175);});}['onReady'](){const _0x1ef97b=_0xae48e8;this[_0x1ef97b(0xe1)][_0x1ef97b(0xdc)](f),this[_0x1ef97b(0xe1)][_0x1ef97b(0xdc)](_);}};$(g,'pluginName',W),$(g,'type',_0x2f7f9b[_0xae48e8(0xad)]),g=ie([_0x5afa64(_0x1f9c3f,_0x490620,_0x48719b),N(0x1,_0x4293fe(_0x5f09c2)),N(0x2,_0x254ac8)],g);export{g as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x43b6(){const _0xef9192=['solved','COMMENT','users','resolved','length','replyId','UniverLicensePlugin','Add','exports','root','userId','post','Plugin','format','stringify','/edit','parse','replies','updateComment','_userService','getUnit','UniverProCollaborationClient','UniverThreadComment','filter','1141bviBpN','getOwnPropertyDescriptor','saveCommentToSnapshot','user','disposeWithMe','/solved','rangeId','getMemberID','resolveComment','10zfECVt','payload','Injector','Unknown','@univerjs/thread-comment-ui','values','ThreadCommentModel','Delete','map','4883112UJMIkP','userID','onStarting','bufferTime','thread-comment-data-source.config','409904fnSnzq','ref','Inject','UniverThreadCommentUi','1420359XwfLXu','UniverThreadCommentUIPlugin','UNIVER_UNKNOWN','UniverInstanceType','/add','DependentOn','10579BjONCy','YYYY/MM/DD\x20HH:mm','rangeType','add','_configService','rxjs','slice','_commentService','@univerjs/core','UniverProLicense','CollaborationSessionService','UNRECOGNIZED','unitId','1449789WDzaiH','Solved','dayjs','comments','forEach','_threadCommentDataSource','merge','Edit','HTTPService','code','amd','CustomRangeType','type','object','subscribe','_injector','UniverCollaborationClientPlugin','Solve','CommentService','body','UniverNetwork','@univerjs-pro/license','Reply','@univerjs/network','addUser','@univerjs/thread-comment','UniverCore','deleteComment','_sessionService','dataSource','get','symbol','toStringTag','Disposable','_init','onReady','_threadCommentModel','addComment','getCurrentUser','_threadCommentDataSourceService','OpenOrReOpen','getUser','threadId','_initUserSync','30tkyFrd','UniverThreadCommentDataSourcePlugin','error','requireSession','_config','createTimestamp','defineProperty','36192erMutX','/delete','comment','/universer-api/user/list','_httpService','_initDataSource','6570117GCYWST','function','86hjDQyc','content','/universer-api/comment/unit/','UserManagerService','Module'];_0x43b6=function(){return _0xef9192;};return _0x43b6();}function _0x2263(_0x26951e,_0x51504c){const _0x43b6ef=_0x43b6();return _0x2263=function(_0x226364,_0x39c559){_0x226364=_0x226364-0x1a3;let _0x4e8dc4=_0x43b6ef[_0x226364];return _0x4e8dc4;},_0x2263(_0x26951e,_0x51504c);}(function(_0xd14ae0,_0xf243e5){const _0x20ddf4=_0x2263,_0x5068ca=_0xd14ae0();while(!![]){try{const _0x3ed83e=parseInt(_0x20ddf4(0x1c1))/0x1*(parseInt(_0x20ddf4(0x209))/0x2)+-parseInt(_0x20ddf4(0x1bb))/0x3+-parseInt(_0x20ddf4(0x1b7))/0x4*(parseInt(_0x20ddf4(0x1a9))/0x5)+-parseInt(_0x20ddf4(0x201))/0x6*(parseInt(_0x20ddf4(0x226))/0x7)+parseInt(_0x20ddf4(0x1b2))/0x8+parseInt(_0x20ddf4(0x207))/0x9+parseInt(_0x20ddf4(0x1fa))/0xa*(parseInt(_0x20ddf4(0x1ce))/0xb);if(_0x3ed83e===_0xf243e5)break;else _0x5068ca['push'](_0x5068ca['shift']());}catch(_0x191611){_0x5068ca['push'](_0x5068ca['shift']());}}}(_0x43b6,0x812b3),function(_0x5860bf,_0x298227){const _0xa7eb1e=_0x2263;typeof exports==_0xa7eb1e(0x1db)&&typeof module<'u'?_0x298227(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==_0xa7eb1e(0x208)&&define[_0xa7eb1e(0x1d8)]?define([_0xa7eb1e(0x216),'@univerjs-pro/collaboration-client',_0xa7eb1e(0x1e3),_0xa7eb1e(0x1c9),_0xa7eb1e(0x1ad),_0xa7eb1e(0x1e7),_0xa7eb1e(0x1c6),_0xa7eb1e(0x1e5)],_0x298227):(_0x5860bf=typeof globalThis<'u'?globalThis:_0x5860bf||self,_0x298227(_0x5860bf['UniverProThreadCommentDatasource']={},_0x5860bf[_0xa7eb1e(0x223)],_0x5860bf[_0xa7eb1e(0x1ca)],_0x5860bf[_0xa7eb1e(0x1e8)],_0x5860bf[_0xa7eb1e(0x1ba)],_0x5860bf[_0xa7eb1e(0x224)],_0x5860bf[_0xa7eb1e(0x1c6)],_0x5860bf[_0xa7eb1e(0x1e2)]));}(this,function(_0x1364c8,_0x39b02d,_0x2c286d,_0x4fe2f8,_0x4dd2a8,_0x335fb0,_0x29d836,_0x2d13c2){'use strict';const _0x621c8a=_0x2263;const _0x4696c5='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x589ea0=(_0xdf4b59=>(_0xdf4b59[_0xdf4b59[_0x621c8a(0x1f6)]=0x0]='OpenOrReOpen',_0xdf4b59[_0xdf4b59[_0x621c8a(0x1cf)]=0x1]=_0x621c8a(0x1cf),_0xdf4b59[_0xdf4b59['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0xdf4b59))(_0x589ea0||{}),_0x18e293=(_0xbd6438=>(_0xbd6438[_0xbd6438['Unknown']=0x0]=_0x621c8a(0x1ac),_0xbd6438[_0xbd6438['Add']=0x1]=_0x621c8a(0x215),_0xbd6438[_0xbd6438[_0x621c8a(0x1e4)]=0x2]=_0x621c8a(0x1e4),_0xbd6438[_0xbd6438[_0x621c8a(0x1d5)]=0x3]=_0x621c8a(0x1d5),_0xbd6438[_0xbd6438[_0x621c8a(0x1b0)]=0x4]=_0x621c8a(0x1b0),_0xbd6438[_0xbd6438[_0x621c8a(0x1df)]=0x5]=_0x621c8a(0x1df),_0xbd6438[_0xbd6438['UNRECOGNIZED']=-0x1]=_0x621c8a(0x1cc),_0xbd6438))(_0x18e293||{});const _0x34ad45=_0x5444c3=>_0x4fe2f8[_0x621c8a(0x1d0)](new Date(+_0x5444c3))[_0x621c8a(0x21b)](_0x621c8a(0x1c2)),_0x32d783=async(_0x352d11,_0x3cffdd)=>{const _0x4697b0=_0x621c8a,_0x2bd54d=_0x352d11[_0x4697b0(0x1ec)](_0x4fe2f8[_0x4697b0(0x20c)]),_0x543cd3=_0x352d11[_0x4697b0(0x1ec)](_0x2d13c2[_0x4697b0(0x1d6)]);_0x3cffdd[_0x4697b0(0x1d2)](_0x5f21bd=>{const _0x2e3569=_0x4697b0;_0x2bd54d[_0x2e3569(0x1f7)](_0x5f21bd)&&_0x3cffdd['delete'](_0x5f21bd);}),_0x3cffdd['size']&&(await _0x543cd3[_0x4697b0(0x1ec)](_0x4697b0(0x204),{'params':{'userIDs':[..._0x3cffdd]}}))[_0x4697b0(0x1e1)][_0x4697b0(0x210)]['forEach'](_0x40778b=>{const _0x581ad5=_0x4697b0;_0x40778b&&_0x2bd54d[_0x581ad5(0x1e6)](_0x40778b);});};var _0x48a680=Object[_0x621c8a(0x227)],_0x2b4e8f=(_0x1e14bd,_0x410822,_0x1a27e2,_0x195c04)=>{const _0x29c8cb=_0x621c8a;for(var _0x3b7566=_0x195c04>0x1?void 0x0:_0x195c04?_0x48a680(_0x410822,_0x1a27e2):_0x410822,_0x5eb332=_0x1e14bd[_0x29c8cb(0x212)]-0x1,_0x8d7e0f;_0x5eb332>=0x0;_0x5eb332--)(_0x8d7e0f=_0x1e14bd[_0x5eb332])&&(_0x3b7566=_0x8d7e0f(_0x3b7566)||_0x3b7566);return _0x3b7566;},_0x579027=(_0x46c716,_0x483230)=>(_0x590855,_0x533cfa)=>_0x483230(_0x590855,_0x533cfa,_0x46c716);let _0x479b42=class extends _0x4fe2f8[_0x621c8a(0x1ef)]{constructor(_0x5a0169,_0x245875,_0x241c80,_0x562fa5){const _0x46e933=_0x621c8a;super(),this[_0x46e933(0x1c8)]=_0x5a0169,this[_0x46e933(0x1f2)]=_0x245875,this[_0x46e933(0x221)]=_0x241c80,this['_injector']=_0x562fa5,this[_0x46e933(0x1f0)](),this['_initUserSync']();}[_0x621c8a(0x1f9)](){const _0x10aa3b=_0x621c8a;this['disposeWithMe'](this[_0x10aa3b(0x1f2)]['commentUpdate$']['pipe'](_0x29d836[_0x10aa3b(0x1b5)](0x10))[_0x10aa3b(0x1dc)](_0x82182a=>{const _0x8f9877=_0x10aa3b,_0x2ae634=new Set();_0x82182a[_0x8f9877(0x1d2)](_0x293d12=>{const _0x2d7df9=_0x8f9877;switch(_0x293d12[_0x2d7df9(0x1da)]){case'add':{const _0x2775eb=_0x293d12[_0x2d7df9(0x1aa)]['personId'];_0x2ae634[_0x2d7df9(0x1c4)](_0x2775eb);break;}}}),_0x32d783(this['_injector'],_0x2ae634);}));}[_0x621c8a(0x1f0)](){const _0x3fbc45=_0x621c8a;this[_0x3fbc45(0x1a4)](this[_0x3fbc45(0x1c8)]['commentUpdate$'][_0x3fbc45(0x1dc)](async _0x48d7a8=>{const _0x5311f1=_0x3fbc45;var _0xcf88c0,_0x5c0372,_0xae7ec2,_0x11c52a;const _0x555409=(_0xcf88c0=this['_threadCommentModel'][_0x5311f1(0x222)](_0x48d7a8[_0x5311f1(0x1cd)])['find'](_0x1ae19b=>_0x1ae19b[_0x5311f1(0x1f8)]===_0x48d7a8[_0x5311f1(0x1f8)]))==null?void 0x0:_0xcf88c0[_0x5311f1(0x217)];if(!_0x555409)return;const {unitId:_0x2d61a9,subUnitId:_0x70e6f6}=_0x555409;switch(_0x48d7a8[_0x5311f1(0x1a3)]&&this[_0x5311f1(0x221)]['addUser'](_0x48d7a8[_0x5311f1(0x1a3)]),_0x48d7a8[_0x5311f1(0x1da)]){case _0x18e293[_0x5311f1(0x215)]:break;case _0x18e293['Reply']:{this['_threadCommentModel'][_0x5311f1(0x1f3)](_0x2d61a9,_0x70e6f6,{'unitId':_0x2d61a9,'subUnitId':_0x70e6f6,'ref':'','id':_0x48d7a8['replyId'],'dT':_0x34ad45(+_0x48d7a8[_0x5311f1(0x1ff)]),'threadId':_0x48d7a8[_0x5311f1(0x1f8)],'personId':(_0xae7ec2=(_0x5c0372=_0x48d7a8[_0x5311f1(0x1a3)])==null?void 0x0:_0x5c0372[_0x5311f1(0x1b3)])!=null?_0xae7ec2:_0x48d7a8[_0x5311f1(0x218)],'text':JSON[_0x5311f1(0x21e)](_0x48d7a8[_0x5311f1(0x20a)]),'parentId':_0x555409['id']});break;}case _0x18e293[_0x5311f1(0x1b0)]:{const _0x392d86=this[_0x5311f1(0x1f2)]['getComment'](_0x2d61a9,_0x70e6f6,_0x48d7a8[_0x5311f1(0x213)]);_0x392d86&&_0x392d86['parentId']&&this['_threadCommentModel'][_0x5311f1(0x1e9)](_0x2d61a9,_0x70e6f6,_0x48d7a8[_0x5311f1(0x213)]);break;}case _0x18e293[_0x5311f1(0x1d5)]:{this[_0x5311f1(0x1f2)][_0x5311f1(0x220)](_0x2d61a9,_0x70e6f6,{'commentId':_0x48d7a8['replyId'],'text':JSON['parse'](_0x48d7a8['content'])});break;}case _0x18e293[_0x5311f1(0x1df)]:{const _0x277692=(_0x11c52a=this['_threadCommentModel'][_0x5311f1(0x222)](_0x48d7a8[_0x5311f1(0x1cd)])['find'](_0x8967a7=>_0x8967a7[_0x5311f1(0x1f8)]===_0x48d7a8[_0x5311f1(0x1f8)]))==null?void 0x0:_0x11c52a[_0x5311f1(0x217)];_0x277692&&this['_threadCommentModel']['resolveComment'](_0x2d61a9,_0x70e6f6,_0x277692['id'],_0x48d7a8[_0x5311f1(0x20e)]===_0x589ea0[_0x5311f1(0x1cf)]);break;}}}));}};_0x479b42=_0x2b4e8f([_0x579027(0x0,_0x4fe2f8[_0x621c8a(0x1b9)](_0x39b02d[_0x621c8a(0x1e0)])),_0x579027(0x1,_0x4fe2f8[_0x621c8a(0x1b9)](_0x335fb0[_0x621c8a(0x1af)])),_0x579027(0x2,_0x4fe2f8[_0x621c8a(0x1b9)](_0x4fe2f8[_0x621c8a(0x20c)])),_0x579027(0x3,_0x4fe2f8[_0x621c8a(0x1b9)](_0x4fe2f8[_0x621c8a(0x1ab)]))],_0x479b42);const _0x492efb=_0x621c8a(0x1b6),_0x27617e={};var _0x290262=Object[_0x621c8a(0x227)],_0xe659bf=(_0x3000e6,_0x57c87c,_0x25aaef,_0x25c6a1)=>{const _0x58c15f=_0x621c8a;for(var _0x370b6e=_0x25c6a1>0x1?void 0x0:_0x25c6a1?_0x290262(_0x57c87c,_0x25aaef):_0x57c87c,_0xa18c26=_0x3000e6[_0x58c15f(0x212)]-0x1,_0x399e0b;_0xa18c26>=0x0;_0xa18c26--)(_0x399e0b=_0x3000e6[_0xa18c26])&&(_0x370b6e=_0x399e0b(_0x370b6e)||_0x370b6e);return _0x370b6e;},_0x3f08a2=(_0x556b74,_0x1c4725)=>(_0x2869fe,_0x252775)=>_0x1c4725(_0x2869fe,_0x252775,_0x556b74);function _0x13c38e(_0x5031a2,_0x170e2f){const _0x59d96f=_0x621c8a,_0xea9d2e=_0x5031a2[_0x59d96f(0x21f)][0x0];return{..._0x170e2f,'id':_0xea9d2e[_0x59d96f(0x213)],'resolved':_0x5031a2[_0x59d96f(0x20e)]===0x1,'dT':_0x34ad45(_0xea9d2e['createTimestamp']),'personId':_0xea9d2e[_0x59d96f(0x218)],'threadId':_0xea9d2e[_0x59d96f(0x1f8)]};}function _0x286105(_0x51c281,_0x40367e,_0x386aa4){const _0x4244bf=_0x621c8a;var _0x389807,_0x41fe8c;if(((_0x41fe8c=(_0x389807=_0x51c281==null?void 0x0:_0x51c281[_0x4244bf(0x21f)])==null?void 0x0:_0x389807[_0x4244bf(0x212)])!=null?_0x41fe8c:0x0)>0x0){const _0x11783f=(_0x5d8e4b,_0x1bb702)=>({'id':_0x5d8e4b[_0x4244bf(0x213)],'threadId':_0x5d8e4b[_0x4244bf(0x1f8)],'dT':_0x34ad45(_0x5d8e4b[_0x4244bf(0x1ff)]),'personId':_0x5d8e4b['userId'],'resolved':_0x51c281[_0x4244bf(0x20e)]===_0x589ea0[_0x4244bf(0x1cf)],'unitId':_0x40367e,'subUnitId':_0x386aa4,'text':JSON['parse'](_0x5d8e4b['content']),'parentId':_0x1bb702}),_0x7ceb7e=_0x11783f(_0x51c281[_0x4244bf(0x21f)][0x0]);return{..._0x7ceb7e,'children':_0x51c281[_0x4244bf(0x21f)][_0x4244bf(0x1c7)](0x1)[_0x4244bf(0x1b1)](_0x32c0cf=>_0x11783f(_0x32c0cf,_0x7ceb7e['id']))};}return null;}let _0x14208e=class{constructor(_0x3797a7,_0x2498f7,_0x367310){const _0x1abdfb=_0x621c8a;this[_0x1abdfb(0x205)]=_0x3797a7,this[_0x1abdfb(0x221)]=_0x2498f7,this[_0x1abdfb(0x1ea)]=_0x367310;}async[_0x621c8a(0x1f3)](_0x216feb){const _0x1aabdd=_0x621c8a;var _0x112b29,_0x2d497b;const {parentId:_0x57904f,unitId:_0x2b53c9,text:_0x4a91ef,threadId:_0x24a3ab}=_0x216feb,_0x227674=(_0x2d497b=(_0x112b29=_0x4a91ef['customRanges'])==null?void 0x0:_0x112b29[_0x1aabdd(0x225)](_0x52d885=>_0x52d885[_0x1aabdd(0x1c3)]===_0x4fe2f8[_0x1aabdd(0x1d9)][_0x1aabdd(0x20f)])['map'](_0x370e17=>_0x370e17[_0x1aabdd(0x1a6)]))!=null?_0x2d497b:[],_0x15bc49=JSON[_0x1aabdd(0x21c)](_0x4a91ef),_0x4bcd87=(await this[_0x1aabdd(0x1ea)][_0x1aabdd(0x1fd)](_0x2b53c9))[_0x1aabdd(0x1a7)]();if(_0x57904f){const _0x4a02bb={'memberId':_0x4bcd87,'unitId':_0x2b53c9,'content':_0x15bc49,'mention':_0x227674,'threadId':_0x24a3ab},_0x2da8d9=(await this[_0x1aabdd(0x205)][_0x1aabdd(0x219)](_0x1aabdd(0x20b)+_0x2b53c9+'/reply',{'body':_0x4a02bb}))[_0x1aabdd(0x1e1)]['reply'];return{..._0x216feb,'id':_0x2da8d9[_0x1aabdd(0x213)],'dT':_0x4fe2f8['dayjs'](+_0x2da8d9[_0x1aabdd(0x1ff)])['format'](_0x1aabdd(0x1c2)),'personId':_0x2da8d9[_0x1aabdd(0x218)]};}else{const _0x2cc378={'memberId':_0x4bcd87,'unitId':_0x2b53c9,'content':_0x15bc49,'mention':_0x227674},_0x5da2f2=await this[_0x1aabdd(0x205)][_0x1aabdd(0x219)](_0x1aabdd(0x20b)+_0x2b53c9+_0x1aabdd(0x1bf),{'body':_0x2cc378});return _0x13c38e(_0x5da2f2[_0x1aabdd(0x1e1)][_0x1aabdd(0x203)],_0x216feb);}}async[_0x621c8a(0x220)](_0xc994e9){const _0x491d2e=_0x621c8a;var _0xb15531,_0x36ac69;const {text:_0x418561,unitId:_0x26af0d}=_0xc994e9,_0x11a4b1=(_0x36ac69=(_0xb15531=_0x418561['customRanges'])==null?void 0x0:_0xb15531['filter'](_0x52e0cc=>_0x52e0cc[_0x491d2e(0x1c3)]===_0x4fe2f8[_0x491d2e(0x1d9)][_0x491d2e(0x20f)])[_0x491d2e(0x1b1)](_0x1940cc=>_0x1940cc['rangeId']))!=null?_0x36ac69:[],_0xfd37db=JSON[_0x491d2e(0x21c)](_0x418561),_0x4cc4bf=_0xc994e9[_0x491d2e(0x1f8)],_0x5f0442=_0xc994e9['id'],_0x5e5958={'memberId':(await this[_0x491d2e(0x1ea)][_0x491d2e(0x1fd)](_0x26af0d))[_0x491d2e(0x1a7)](),'unitId':_0x26af0d,'threadId':_0x4cc4bf,'mention':_0x11a4b1,'content':_0xfd37db,'replyId':_0x5f0442},_0x5058ed=await this['_httpService'][_0x491d2e(0x219)](_0x491d2e(0x20b)+_0x26af0d+_0x491d2e(0x21d),{'body':_0x5e5958});return!_0x5058ed[_0x491d2e(0x1e1)][_0x491d2e(0x1fc)]||_0x5058ed[_0x491d2e(0x1e1)][_0x491d2e(0x1fc)][_0x491d2e(0x1d7)]===0x1;}async[_0x621c8a(0x1a8)](_0x521bd1){const _0x29cd5d=_0x621c8a,{unitId:_0x35773f}=_0x521bd1,_0x531f53=_0x521bd1[_0x29cd5d(0x1f8)],_0x44a999={'memberId':this[_0x29cd5d(0x221)][_0x29cd5d(0x1f4)]()['userID'],'unitId':_0x35773f,'threadId':_0x531f53,'solved':_0x521bd1[_0x29cd5d(0x211)]?_0x589ea0[_0x29cd5d(0x1cf)]:_0x589ea0[_0x29cd5d(0x1f6)]},_0x2048bb=await this[_0x29cd5d(0x205)][_0x29cd5d(0x219)](_0x29cd5d(0x20b)+_0x35773f+_0x29cd5d(0x1a5),{'body':_0x44a999});return!_0x2048bb[_0x29cd5d(0x1e1)][_0x29cd5d(0x1fc)]||_0x2048bb['body'][_0x29cd5d(0x1fc)]['code']===0x1;}async[_0x621c8a(0x1e9)](_0x581cb1,_0x2c0d3d,_0x2ee973,_0x3a5334){const _0x43b918=_0x621c8a,_0x1ef600={'memberId':(await this[_0x43b918(0x1ea)][_0x43b918(0x1fd)](_0x581cb1))[_0x43b918(0x1a7)](),'threadId':_0x2ee973,'replyId':_0x3a5334,'unitId':_0x581cb1},_0x323014=await this[_0x43b918(0x205)][_0x43b918(0x219)](_0x43b918(0x20b)+_0x581cb1+_0x43b918(0x202),{'body':_0x1ef600});return!_0x323014[_0x43b918(0x1e1)]['error']||_0x323014[_0x43b918(0x1e1)][_0x43b918(0x1fc)][_0x43b918(0x1d7)]===0x1;}async['listComments'](_0x23d2ac,_0x568b3d,_0x63bf56){const _0x40bc64=_0x621c8a,_0xe15183={'unitId':_0x23d2ac,'threadId':_0x63bf56},_0x35e970=await this[_0x40bc64(0x205)][_0x40bc64(0x219)]('/universer-api/comment/unit/'+_0x23d2ac+'/list',{'body':_0xe15183}),_0x1b4263=_0x63bf56[_0x40bc64(0x1b1)](_0x50611d=>_0x286105(_0x35e970['body'][_0x40bc64(0x1d1)][_0x50611d],_0x23d2ac,_0x568b3d))[_0x40bc64(0x225)](Boolean);return Object[_0x40bc64(0x1ae)](_0x35e970[_0x40bc64(0x1e1)][_0x40bc64(0x210)])[_0x40bc64(0x1d2)](_0x36411f=>{const _0x33947d=_0x40bc64;this['_userService'][_0x33947d(0x1e6)](_0x36411f);}),_0x1b4263;}[_0x621c8a(0x228)](_0x2826a4){const _0x1ffd4e=_0x621c8a;return{'id':_0x2826a4['id'],'threadId':_0x2826a4['threadId'],'ref':_0x2826a4[_0x1ffd4e(0x1b8)]};}};_0x14208e=_0xe659bf([_0x3f08a2(0x0,_0x4fe2f8[_0x621c8a(0x1b9)](_0x2d13c2[_0x621c8a(0x1d6)])),_0x3f08a2(0x1,_0x4fe2f8[_0x621c8a(0x1b9)](_0x4fe2f8[_0x621c8a(0x20c)])),_0x3f08a2(0x2,_0x4fe2f8[_0x621c8a(0x1b9)](_0x39b02d[_0x621c8a(0x1cb)]))],_0x14208e);var _0x49bc21=Object[_0x621c8a(0x227)],_0x5b47dc=(_0x4db194,_0x57ca5c,_0x457608,_0x3a60b6)=>{const _0x5e58a4=_0x621c8a;for(var _0x1b0cae=_0x3a60b6>0x1?void 0x0:_0x3a60b6?_0x49bc21(_0x57ca5c,_0x457608):_0x57ca5c,_0x3807bc=_0x4db194[_0x5e58a4(0x212)]-0x1,_0x524fe6;_0x3807bc>=0x0;_0x3807bc--)(_0x524fe6=_0x4db194[_0x3807bc])&&(_0x1b0cae=_0x524fe6(_0x1b0cae)||_0x1b0cae);return _0x1b0cae;},_0x2e4e1a=(_0x56aefc,_0x411035)=>(_0x5564c1,_0x130719)=>_0x411035(_0x5564c1,_0x130719,_0x56aefc);let _0x4bf261=class extends _0x4fe2f8[_0x621c8a(0x1ef)]{constructor(_0x2fe674,_0x54cd8f){const _0x1c9525=_0x621c8a;super(),this[_0x1c9525(0x1f5)]=_0x2fe674,this[_0x1c9525(0x1d3)]=_0x54cd8f,this[_0x1c9525(0x206)]();}['_initDataSource'](){const _0x2dbd77=_0x621c8a;this['_threadCommentDataSourceService'][_0x2dbd77(0x1eb)]=this[_0x2dbd77(0x1d3)],this[_0x2dbd77(0x1f5)]['syncUpdateMutationToColla']=!0x1;}};_0x4bf261=_0x5b47dc([_0x2e4e1a(0x0,_0x335fb0['IThreadCommentDataSourceService']),_0x2e4e1a(0x1,_0x4fe2f8[_0x621c8a(0x1b9)](_0x14208e))],_0x4bf261);var _0x24e48e=Object[_0x621c8a(0x200)],_0x2b6ea3=Object[_0x621c8a(0x227)],_0x5a4e09=(_0x1b89e4,_0x601104,_0x5921c3)=>_0x601104 in _0x1b89e4?_0x24e48e(_0x1b89e4,_0x601104,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5921c3}):_0x1b89e4[_0x601104]=_0x5921c3,_0x4b39da=(_0x5d4a9f,_0x1ba3b8,_0x1708e3,_0x1df463)=>{const _0x562803=_0x621c8a;for(var _0x38b97e=_0x1df463>0x1?void 0x0:_0x1df463?_0x2b6ea3(_0x1ba3b8,_0x1708e3):_0x1ba3b8,_0x339de0=_0x5d4a9f[_0x562803(0x212)]-0x1,_0x3f85fa;_0x339de0>=0x0;_0x339de0--)(_0x3f85fa=_0x5d4a9f[_0x339de0])&&(_0x38b97e=_0x3f85fa(_0x38b97e)||_0x38b97e);return _0x38b97e;},_0x1706f7=(_0x5bc052,_0x395508)=>(_0x3dbfdd,_0x162e21)=>_0x395508(_0x3dbfdd,_0x162e21,_0x5bc052),_0x16bba0=(_0x11750b,_0x240602,_0x3997ea)=>_0x5a4e09(_0x11750b,typeof _0x240602!=_0x621c8a(0x1ed)?_0x240602+'':_0x240602,_0x3997ea);_0x1364c8['UniverThreadCommentDataSourcePlugin']=class extends _0x4fe2f8[_0x621c8a(0x21a)]{constructor(_0x3f27be=_0x27617e,_0x209b5b,_0x2b3de3){const _0x5d3465=_0x621c8a;super(),this[_0x5d3465(0x1fe)]=_0x3f27be,this['_injector']=_0x209b5b,this[_0x5d3465(0x1c5)]=_0x2b3de3;const {..._0x5e42ec}=_0x4fe2f8[_0x5d3465(0x1d4)]({},_0x27617e,this['_config']);this[_0x5d3465(0x1c5)]['setConfig'](_0x492efb,_0x5e42ec);}[_0x621c8a(0x1b4)](){[[_0x14208e],[_0x4bf261],[_0x479b42]]['forEach'](_0x4623e4=>{const _0x234546=_0x2263;this[_0x234546(0x1dd)][_0x234546(0x1c4)](_0x4623e4);});}[_0x621c8a(0x1f1)](){const _0x20d6b9=_0x621c8a;this[_0x20d6b9(0x1dd)][_0x20d6b9(0x1ec)](_0x4bf261),this[_0x20d6b9(0x1dd)][_0x20d6b9(0x1ec)](_0x479b42);}},_0x16bba0(_0x1364c8[_0x621c8a(0x1fb)],'pluginName',_0x4696c5),_0x16bba0(_0x1364c8[_0x621c8a(0x1fb)],_0x621c8a(0x1da),_0x4fe2f8[_0x621c8a(0x1be)][_0x621c8a(0x1bd)]),_0x1364c8[_0x621c8a(0x1fb)]=_0x4b39da([_0x4fe2f8[_0x621c8a(0x1c0)](_0x4dd2a8[_0x621c8a(0x1bc)],_0x39b02d[_0x621c8a(0x1de)],_0x2c286d[_0x621c8a(0x214)]),_0x1706f7(0x1,_0x4fe2f8['Inject'](_0x4fe2f8[_0x621c8a(0x1ab)])),_0x1706f7(0x2,_0x4fe2f8['IConfigService'])],_0x1364c8[_0x621c8a(0x1fb)]),Object[_0x621c8a(0x200)](_0x1364c8,Symbol[_0x621c8a(0x1ee)],{'value':_0x621c8a(0x20d)});}));
|
|
1
|
+
function _0x36b8(_0x2864a1,_0x162230){const _0x18b0aa=_0x18b0();return _0x36b8=function(_0x36b8a1,_0x6148fc){_0x36b8a1=_0x36b8a1-0x1f3;let _0x1ecaef=_0x18b0aa[_0x36b8a1];return _0x1ecaef;},_0x36b8(_0x2864a1,_0x162230);}(function(_0x55b05b,_0x5f2a8e){const _0x8ebc=_0x36b8,_0x5c2b94=_0x55b05b();while(!![]){try{const _0x56a7af=parseInt(_0x8ebc(0x24d))/0x1*(-parseInt(_0x8ebc(0x246))/0x2)+parseInt(_0x8ebc(0x268))/0x3*(parseInt(_0x8ebc(0x243))/0x4)+parseInt(_0x8ebc(0x23e))/0x5+-parseInt(_0x8ebc(0x22d))/0x6+-parseInt(_0x8ebc(0x264))/0x7+-parseInt(_0x8ebc(0x24c))/0x8*(parseInt(_0x8ebc(0x249))/0x9)+-parseInt(_0x8ebc(0x209))/0xa*(-parseInt(_0x8ebc(0x25c))/0xb);if(_0x56a7af===_0x5f2a8e)break;else _0x5c2b94['push'](_0x5c2b94['shift']());}catch(_0x82221a){_0x5c2b94['push'](_0x5c2b94['shift']());}}}(_0x18b0,0x8d972),function(_0x167a8f,_0x4b7fd7){const _0x540fbb=_0x36b8;typeof exports==_0x540fbb(0x256)&&typeof module<'u'?_0x4b7fd7(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==_0x540fbb(0x1f3)&&define['amd']?define([_0x540fbb(0x26e),_0x540fbb(0x239),'@univerjs-pro/license','@univerjs/core','@univerjs/thread-comment-ui',_0x540fbb(0x22f),_0x540fbb(0x24a),_0x540fbb(0x20b)],_0x4b7fd7):(_0x167a8f=typeof globalThis<'u'?globalThis:_0x167a8f||self,_0x4b7fd7(_0x167a8f['UniverProThreadCommentDatasource']={},_0x167a8f[_0x540fbb(0x25d)],_0x167a8f[_0x540fbb(0x20d)],_0x167a8f[_0x540fbb(0x272)],_0x167a8f[_0x540fbb(0x220)],_0x167a8f[_0x540fbb(0x25e)],_0x167a8f[_0x540fbb(0x24a)],_0x167a8f['UniverNetwork']));}(this,function(_0x5838ea,_0x1cabcb,_0x250cd7,_0x559f35,_0x5e4b71,_0x3beb1d,_0x17826c,_0x2c1229){'use strict';const _0x4ac278=_0x36b8;const _0x47eccf=_0x4ac278(0x206);var _0x2203ca=(_0x2ad0e1=>(_0x2ad0e1[_0x2ad0e1[_0x4ac278(0x1fd)]=0x0]=_0x4ac278(0x1fd),_0x2ad0e1[_0x2ad0e1[_0x4ac278(0x240)]=0x1]=_0x4ac278(0x240),_0x2ad0e1[_0x2ad0e1[_0x4ac278(0x1f4)]=-0x1]=_0x4ac278(0x1f4),_0x2ad0e1))(_0x2203ca||{}),_0x49f46a=(_0xca68a2=>(_0xca68a2[_0xca68a2[_0x4ac278(0x203)]=0x0]=_0x4ac278(0x203),_0xca68a2[_0xca68a2[_0x4ac278(0x262)]=0x1]=_0x4ac278(0x262),_0xca68a2[_0xca68a2[_0x4ac278(0x260)]=0x2]=_0x4ac278(0x260),_0xca68a2[_0xca68a2[_0x4ac278(0x218)]=0x3]='Edit',_0xca68a2[_0xca68a2['Delete']=0x4]='Delete',_0xca68a2[_0xca68a2[_0x4ac278(0x251)]=0x5]=_0x4ac278(0x251),_0xca68a2[_0xca68a2[_0x4ac278(0x1f4)]=-0x1]='UNRECOGNIZED',_0xca68a2))(_0x49f46a||{});const _0x423bfe=_0x32b763=>_0x559f35[_0x4ac278(0x271)](new Date(+_0x32b763))['format'](_0x4ac278(0x211)),_0x1d1730=async(_0x3fdba2,_0x181d51)=>{const _0x4ad18a=_0x4ac278,_0x35f481=_0x3fdba2[_0x4ad18a(0x23d)](_0x559f35[_0x4ad18a(0x223)]),_0x4e5f62=_0x3fdba2[_0x4ad18a(0x23d)](_0x2c1229[_0x4ad18a(0x236)]);_0x181d51[_0x4ad18a(0x242)](_0x4e2405=>{_0x35f481['getUser'](_0x4e2405)&&_0x181d51['delete'](_0x4e2405);}),_0x181d51[_0x4ad18a(0x21e)]&&(await _0x4e5f62[_0x4ad18a(0x23d)]('/universer-api/user/list',{'params':{'userIDs':[..._0x181d51]}}))[_0x4ad18a(0x261)][_0x4ad18a(0x238)][_0x4ad18a(0x242)](_0x99cff1=>{_0x99cff1&&_0x35f481['addUser'](_0x99cff1);});};var _0xd2f529=Object[_0x4ac278(0x221)],_0x2fefef=(_0x20774b,_0xdc6e9c,_0x179cb4,_0x4166b2)=>{for(var _0x3620b4=_0x4166b2>0x1?void 0x0:_0x4166b2?_0xd2f529(_0xdc6e9c,_0x179cb4):_0xdc6e9c,_0x24c46c=_0x20774b['length']-0x1,_0x541eca;_0x24c46c>=0x0;_0x24c46c--)(_0x541eca=_0x20774b[_0x24c46c])&&(_0x3620b4=_0x541eca(_0x3620b4)||_0x3620b4);return _0x3620b4;},_0x23f3f0=(_0x5a91ae,_0x4b300a)=>(_0xbd31f2,_0x4b5ab1)=>_0x4b300a(_0xbd31f2,_0x4b5ab1,_0x5a91ae);let _0x23ae1a=class extends _0x559f35[_0x4ac278(0x265)]{constructor(_0x55ee03,_0x24a5b7,_0x4dc5ca,_0x1959e0){const _0x36d06c=_0x4ac278;super(),this['_commentService']=_0x55ee03,this['_threadCommentModel']=_0x24a5b7,this[_0x36d06c(0x226)]=_0x4dc5ca,this[_0x36d06c(0x244)]=_0x1959e0,this[_0x36d06c(0x23f)](),this[_0x36d06c(0x255)]();}['_initUserSync'](){const _0x3e1836=_0x4ac278;this['disposeWithMe'](this[_0x3e1836(0x259)][_0x3e1836(0x22e)][_0x3e1836(0x231)](_0x17826c[_0x3e1836(0x21b)](0x10))[_0x3e1836(0x26a)](_0x270b6c=>{const _0x1affe0=_0x3e1836,_0x14a6ee=new Set();_0x270b6c['forEach'](_0x491b66=>{const _0x2329c3=_0x36b8;switch(_0x491b66[_0x2329c3(0x213)]){case _0x2329c3(0x22a):{const _0x177f82=_0x491b66[_0x2329c3(0x200)][_0x2329c3(0x1f6)];_0x14a6ee[_0x2329c3(0x22a)](_0x177f82);break;}}}),_0x1d1730(this[_0x1affe0(0x244)],_0x14a6ee);}));}[_0x4ac278(0x23f)](){const _0x2a97fb=_0x4ac278;this[_0x2a97fb(0x207)](this['_commentService'][_0x2a97fb(0x22e)]['subscribe'](async _0x19fc28=>{const _0x1c3bff=_0x2a97fb;var _0x5eb4cc,_0x103b8e,_0x127401,_0x980d2c;const _0x205e2f=(_0x5eb4cc=this[_0x1c3bff(0x259)][_0x1c3bff(0x201)](_0x19fc28[_0x1c3bff(0x25f)])[_0x1c3bff(0x21a)](_0x1ca51b=>_0x1ca51b[_0x1c3bff(0x1ff)]===_0x19fc28['threadId']))==null?void 0x0:_0x5eb4cc[_0x1c3bff(0x235)];if(!_0x205e2f)return;const {unitId:_0x169979,subUnitId:_0x195d5c}=_0x205e2f;switch(_0x19fc28[_0x1c3bff(0x21f)]&&this[_0x1c3bff(0x226)][_0x1c3bff(0x26f)](_0x19fc28['user']),_0x19fc28['type']){case _0x49f46a[_0x1c3bff(0x262)]:break;case _0x49f46a[_0x1c3bff(0x260)]:{this[_0x1c3bff(0x259)]['addComment'](_0x169979,_0x195d5c,{'unitId':_0x169979,'subUnitId':_0x195d5c,'ref':'','id':_0x19fc28[_0x1c3bff(0x214)],'dT':_0x423bfe(+_0x19fc28['createTimestamp']),'threadId':_0x19fc28[_0x1c3bff(0x1ff)],'personId':(_0x127401=(_0x103b8e=_0x19fc28[_0x1c3bff(0x21f)])==null?void 0x0:_0x103b8e[_0x1c3bff(0x26b)])!=null?_0x127401:_0x19fc28[_0x1c3bff(0x24b)],'text':JSON[_0x1c3bff(0x252)](_0x19fc28[_0x1c3bff(0x1f9)]),'parentId':_0x205e2f['id']});break;}case _0x49f46a[_0x1c3bff(0x245)]:{const _0x1c44ad=this[_0x1c3bff(0x259)]['getComment'](_0x169979,_0x195d5c,_0x19fc28[_0x1c3bff(0x214)]);_0x1c44ad&&_0x1c44ad[_0x1c3bff(0x1fc)]&&this[_0x1c3bff(0x259)]['deleteComment'](_0x169979,_0x195d5c,_0x19fc28[_0x1c3bff(0x214)]);break;}case _0x49f46a[_0x1c3bff(0x218)]:{this[_0x1c3bff(0x259)][_0x1c3bff(0x23a)](_0x169979,_0x195d5c,{'commentId':_0x19fc28['replyId'],'text':JSON['parse'](_0x19fc28[_0x1c3bff(0x1f9)])});break;}case _0x49f46a[_0x1c3bff(0x251)]:{const _0xcee4f7=(_0x980d2c=this['_threadCommentModel'][_0x1c3bff(0x201)](_0x19fc28['unitId'])[_0x1c3bff(0x21a)](_0x5ab72a=>_0x5ab72a[_0x1c3bff(0x1ff)]===_0x19fc28[_0x1c3bff(0x1ff)]))==null?void 0x0:_0x980d2c[_0x1c3bff(0x235)];_0xcee4f7&&this[_0x1c3bff(0x259)][_0x1c3bff(0x1fa)](_0x169979,_0x195d5c,_0xcee4f7['id'],_0x19fc28[_0x1c3bff(0x270)]===_0x2203ca[_0x1c3bff(0x240)]);break;}}}));}};_0x23ae1a=_0x2fefef([_0x23f3f0(0x0,_0x559f35['Inject'](_0x1cabcb['CommentService'])),_0x23f3f0(0x1,_0x559f35[_0x4ac278(0x228)](_0x3beb1d[_0x4ac278(0x24f)])),_0x23f3f0(0x2,_0x559f35[_0x4ac278(0x228)](_0x559f35[_0x4ac278(0x223)])),_0x23f3f0(0x3,_0x559f35['Inject'](_0x559f35[_0x4ac278(0x23c)]))],_0x23ae1a);const _0xaaf712=_0x4ac278(0x204),_0x4845e7={};var _0x4a873b=Object[_0x4ac278(0x221)],_0x40934f=(_0x1d24d6,_0x3c6da3,_0x2858c1,_0x39d05c)=>{const _0x4c8c90=_0x4ac278;for(var _0x5a3787=_0x39d05c>0x1?void 0x0:_0x39d05c?_0x4a873b(_0x3c6da3,_0x2858c1):_0x3c6da3,_0x96b7d3=_0x1d24d6[_0x4c8c90(0x263)]-0x1,_0x2b6171;_0x96b7d3>=0x0;_0x96b7d3--)(_0x2b6171=_0x1d24d6[_0x96b7d3])&&(_0x5a3787=_0x2b6171(_0x5a3787)||_0x5a3787);return _0x5a3787;},_0x57eacf=(_0x25af5a,_0x39178b)=>(_0x5dbd57,_0x2ff018)=>_0x39178b(_0x5dbd57,_0x2ff018,_0x25af5a);function _0x354760(_0x1ce131,_0xf07070){const _0x4178a7=_0x4ac278,_0x21afc3=_0x1ce131[_0x4178a7(0x216)][0x0];return{..._0xf07070,'id':_0x21afc3[_0x4178a7(0x214)],'resolved':_0x1ce131[_0x4178a7(0x270)]===0x1,'dT':_0x423bfe(_0x21afc3['createTimestamp']),'personId':_0x21afc3[_0x4178a7(0x24b)],'threadId':_0x21afc3['threadId']};}function _0x5ea654(_0x5b7aeb,_0x4f54ab,_0x2121e5){const _0x393be9=_0x4ac278;var _0x30a8ce,_0x17acda;if(((_0x17acda=(_0x30a8ce=_0x5b7aeb==null?void 0x0:_0x5b7aeb[_0x393be9(0x216)])==null?void 0x0:_0x30a8ce[_0x393be9(0x263)])!=null?_0x17acda:0x0)>0x0){const _0xbac0a1=(_0x9ef73b,_0x2536f7)=>({'id':_0x9ef73b[_0x393be9(0x214)],'threadId':_0x9ef73b[_0x393be9(0x1ff)],'dT':_0x423bfe(_0x9ef73b['createTimestamp']),'personId':_0x9ef73b[_0x393be9(0x24b)],'resolved':_0x5b7aeb[_0x393be9(0x270)]===_0x2203ca[_0x393be9(0x240)],'unitId':_0x4f54ab,'subUnitId':_0x2121e5,'text':JSON[_0x393be9(0x252)](_0x9ef73b[_0x393be9(0x1f9)]),'parentId':_0x2536f7}),_0x40a35d=_0xbac0a1(_0x5b7aeb[_0x393be9(0x216)][0x0]);return{..._0x40a35d,'children':_0x5b7aeb[_0x393be9(0x216)][_0x393be9(0x267)](0x1)[_0x393be9(0x1fe)](_0x60c671=>_0xbac0a1(_0x60c671,_0x40a35d['id']))};}return null;}let _0x3b779e=class{constructor(_0x21166d,_0x30ed2e,_0x1370d1){const _0x50121e=_0x4ac278;this[_0x50121e(0x21d)]=_0x21166d,this['_userService']=_0x30ed2e,this[_0x50121e(0x233)]=_0x1370d1;}async[_0x4ac278(0x20c)](_0x368a2c){const _0x27dbd4=_0x4ac278;var _0x39f5b7,_0x22cf5f;const {parentId:_0xf9b6d,unitId:_0x24276f,text:_0x2bdd3f,threadId:_0xd8ea25}=_0x368a2c,_0x269f9a=(_0x22cf5f=(_0x39f5b7=_0x2bdd3f[_0x27dbd4(0x224)])==null?void 0x0:_0x39f5b7['filter'](_0x520814=>_0x520814[_0x27dbd4(0x26c)]===_0x559f35[_0x27dbd4(0x237)][_0x27dbd4(0x257)])[_0x27dbd4(0x1fe)](_0x59e389=>_0x59e389[_0x27dbd4(0x248)]))!=null?_0x22cf5f:[],_0x40b66e=JSON['stringify'](_0x2bdd3f),_0x4e6d74=(await this[_0x27dbd4(0x233)][_0x27dbd4(0x1f5)](_0x24276f))[_0x27dbd4(0x229)]();if(_0xf9b6d){const _0x28134b={'memberId':_0x4e6d74,'unitId':_0x24276f,'content':_0x40b66e,'mention':_0x269f9a,'threadId':_0xd8ea25},_0x48b707=(await this[_0x27dbd4(0x21d)][_0x27dbd4(0x20e)]('/universer-api/comment/unit/'+_0x24276f+'/reply',{'body':_0x28134b}))[_0x27dbd4(0x261)][_0x27dbd4(0x247)];return{..._0x368a2c,'id':_0x48b707[_0x27dbd4(0x214)],'dT':_0x559f35['dayjs'](+_0x48b707[_0x27dbd4(0x26d)])[_0x27dbd4(0x210)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x48b707[_0x27dbd4(0x24b)]};}else{const _0x36486b={'memberId':_0x4e6d74,'unitId':_0x24276f,'content':_0x40b66e,'mention':_0x269f9a},_0x1d74fb=await this['_httpService']['post'](_0x27dbd4(0x254)+_0x24276f+_0x27dbd4(0x232),{'body':_0x36486b});return _0x354760(_0x1d74fb[_0x27dbd4(0x261)]['comment'],_0x368a2c);}}async['updateComment'](_0x49ca29){const _0x2ebe4c=_0x4ac278;var _0x15b504,_0x11a934;const {text:_0x151d3c,unitId:_0x4eafba}=_0x49ca29,_0x4e6f45=(_0x11a934=(_0x15b504=_0x151d3c[_0x2ebe4c(0x224)])==null?void 0x0:_0x15b504['filter'](_0x50bd94=>_0x50bd94[_0x2ebe4c(0x26c)]===_0x559f35[_0x2ebe4c(0x237)][_0x2ebe4c(0x257)])[_0x2ebe4c(0x1fe)](_0x3feff3=>_0x3feff3[_0x2ebe4c(0x248)]))!=null?_0x11a934:[],_0x5d670e=JSON['stringify'](_0x151d3c),_0x23a358=_0x49ca29[_0x2ebe4c(0x1ff)],_0x388669=_0x49ca29['id'],_0x2bd58a={'memberId':(await this[_0x2ebe4c(0x233)]['requireSession'](_0x4eafba))[_0x2ebe4c(0x229)](),'unitId':_0x4eafba,'threadId':_0x23a358,'mention':_0x4e6f45,'content':_0x5d670e,'replyId':_0x388669},_0x202d40=await this[_0x2ebe4c(0x21d)][_0x2ebe4c(0x20e)]('/universer-api/comment/unit/'+_0x4eafba+_0x2ebe4c(0x24e),{'body':_0x2bd58a});return!_0x202d40['body'][_0x2ebe4c(0x225)]||_0x202d40['body'][_0x2ebe4c(0x225)][_0x2ebe4c(0x269)]===0x1;}async[_0x4ac278(0x1fa)](_0x49f0a2){const _0x33f1a8=_0x4ac278,{unitId:_0x2a83b6}=_0x49f0a2,_0xdba305=_0x49f0a2[_0x33f1a8(0x1ff)],_0x128b27={'memberId':this['_userService']['getCurrentUser']()[_0x33f1a8(0x26b)],'unitId':_0x2a83b6,'threadId':_0xdba305,'solved':_0x49f0a2[_0x33f1a8(0x250)]?_0x2203ca[_0x33f1a8(0x240)]:_0x2203ca['OpenOrReOpen']},_0x5970db=await this[_0x33f1a8(0x21d)][_0x33f1a8(0x20e)](_0x33f1a8(0x254)+_0x2a83b6+_0x33f1a8(0x20a),{'body':_0x128b27});return!_0x5970db[_0x33f1a8(0x261)][_0x33f1a8(0x225)]||_0x5970db[_0x33f1a8(0x261)]['error'][_0x33f1a8(0x269)]===0x1;}async['deleteComment'](_0x5aed5c,_0x160bae,_0x51e99f,_0x3e1b1a){const _0x2774b2=_0x4ac278,_0x810b5c={'memberId':(await this[_0x2774b2(0x233)][_0x2774b2(0x1f5)](_0x5aed5c))[_0x2774b2(0x229)](),'threadId':_0x51e99f,'replyId':_0x3e1b1a,'unitId':_0x5aed5c},_0x5a39b5=await this[_0x2774b2(0x21d)][_0x2774b2(0x20e)]('/universer-api/comment/unit/'+_0x5aed5c+_0x2774b2(0x266),{'body':_0x810b5c});return!_0x5a39b5[_0x2774b2(0x261)]['error']||_0x5a39b5[_0x2774b2(0x261)][_0x2774b2(0x225)][_0x2774b2(0x269)]===0x1;}async[_0x4ac278(0x253)](_0x280644,_0x5de97,_0x23c4a7){const _0x58fcc2=_0x4ac278,_0x5f5b9a={'unitId':_0x280644,'threadId':_0x23c4a7},_0x110e3e=await this['_httpService'][_0x58fcc2(0x20e)](_0x58fcc2(0x254)+_0x280644+_0x58fcc2(0x227),{'body':_0x5f5b9a}),_0x2c9269=_0x23c4a7[_0x58fcc2(0x1fe)](_0x43eff0=>_0x5ea654(_0x110e3e[_0x58fcc2(0x261)][_0x58fcc2(0x234)][_0x43eff0],_0x280644,_0x5de97))[_0x58fcc2(0x205)](Boolean);return Object['values'](_0x110e3e[_0x58fcc2(0x261)][_0x58fcc2(0x238)])[_0x58fcc2(0x242)](_0x5aed71=>{const _0x571b1d=_0x58fcc2;this[_0x571b1d(0x226)][_0x571b1d(0x26f)](_0x5aed71);}),_0x2c9269;}[_0x4ac278(0x20f)](_0x51023d){const _0x228ff6=_0x4ac278;return{'id':_0x51023d['id'],'threadId':_0x51023d['threadId'],'ref':_0x51023d[_0x228ff6(0x202)]};}};_0x3b779e=_0x40934f([_0x57eacf(0x0,_0x559f35[_0x4ac278(0x228)](_0x2c1229['HTTPService'])),_0x57eacf(0x1,_0x559f35[_0x4ac278(0x228)](_0x559f35[_0x4ac278(0x223)])),_0x57eacf(0x2,_0x559f35['Inject'](_0x1cabcb[_0x4ac278(0x25a)]))],_0x3b779e);var _0x132f02=Object[_0x4ac278(0x221)],_0xbfaa64=(_0x2d04b7,_0xf1f7ea,_0x378e8e,_0x23aaa0)=>{const _0x4b2ada=_0x4ac278;for(var _0x5c501c=_0x23aaa0>0x1?void 0x0:_0x23aaa0?_0x132f02(_0xf1f7ea,_0x378e8e):_0xf1f7ea,_0x521e59=_0x2d04b7[_0x4b2ada(0x263)]-0x1,_0x15fe00;_0x521e59>=0x0;_0x521e59--)(_0x15fe00=_0x2d04b7[_0x521e59])&&(_0x5c501c=_0x15fe00(_0x5c501c)||_0x5c501c);return _0x5c501c;},_0x323d31=(_0x47e460,_0x42b945)=>(_0x18f404,_0x3c6a05)=>_0x42b945(_0x18f404,_0x3c6a05,_0x47e460);let _0x1aed25=class extends _0x559f35[_0x4ac278(0x265)]{constructor(_0x447f48,_0x1a652d){const _0x24d3ee=_0x4ac278;super(),this[_0x24d3ee(0x1f8)]=_0x447f48,this['_threadCommentDataSource']=_0x1a652d,this[_0x24d3ee(0x22c)]();}[_0x4ac278(0x22c)](){const _0x4c53c1=_0x4ac278;this['_threadCommentDataSourceService'][_0x4c53c1(0x258)]=this['_threadCommentDataSource'],this[_0x4c53c1(0x1f8)][_0x4c53c1(0x219)]=!0x1;}};_0x1aed25=_0xbfaa64([_0x323d31(0x0,_0x3beb1d['IThreadCommentDataSourceService']),_0x323d31(0x1,_0x559f35[_0x4ac278(0x228)](_0x3b779e))],_0x1aed25);var _0x59f3fe=Object['defineProperty'],_0x30548d=Object[_0x4ac278(0x221)],_0x4d403c=(_0x32f7a7,_0x15ec43,_0x11208b)=>_0x15ec43 in _0x32f7a7?_0x59f3fe(_0x32f7a7,_0x15ec43,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x11208b}):_0x32f7a7[_0x15ec43]=_0x11208b,_0x19a716=(_0x4ac8b5,_0x4ec567,_0x179ef5,_0x1c7c3f)=>{const _0x1988f5=_0x4ac278;for(var _0x3d4ffd=_0x1c7c3f>0x1?void 0x0:_0x1c7c3f?_0x30548d(_0x4ec567,_0x179ef5):_0x4ec567,_0xf5c8c9=_0x4ac8b5[_0x1988f5(0x263)]-0x1,_0x50c1ca;_0xf5c8c9>=0x0;_0xf5c8c9--)(_0x50c1ca=_0x4ac8b5[_0xf5c8c9])&&(_0x3d4ffd=_0x50c1ca(_0x3d4ffd)||_0x3d4ffd);return _0x3d4ffd;},_0x57d374=(_0x28afed,_0xf8ccd1)=>(_0x23a7c2,_0x124750)=>_0xf8ccd1(_0x23a7c2,_0x124750,_0x28afed),_0x288689=(_0x118a1b,_0x1e9549,_0x165351)=>_0x4d403c(_0x118a1b,typeof _0x1e9549!='symbol'?_0x1e9549+'':_0x1e9549,_0x165351);_0x5838ea[_0x4ac278(0x230)]=class extends _0x559f35['Plugin']{constructor(_0x31f90a=_0x4845e7,_0x9ed0e1,_0x1bea2a){const _0x3044d6=_0x4ac278;super(),this[_0x3044d6(0x212)]=_0x31f90a,this['_injector']=_0x9ed0e1,this[_0x3044d6(0x215)]=_0x1bea2a;const {..._0x2a882f}=_0x559f35[_0x3044d6(0x23b)]({},_0x4845e7,this[_0x3044d6(0x212)]);this[_0x3044d6(0x215)][_0x3044d6(0x22b)](_0xaaf712,_0x2a882f);}[_0x4ac278(0x208)](){const _0x513e0d=_0x4ac278;[[_0x3b779e],[_0x1aed25],[_0x23ae1a]][_0x513e0d(0x242)](_0x224b23=>{const _0x220e1c=_0x513e0d;this[_0x220e1c(0x244)]['add'](_0x224b23);});}[_0x4ac278(0x25b)](){const _0x38eff1=_0x4ac278;this[_0x38eff1(0x244)][_0x38eff1(0x23d)](_0x1aed25),this['_injector']['get'](_0x23ae1a);}},_0x288689(_0x5838ea[_0x4ac278(0x230)],'pluginName',_0x47eccf),_0x288689(_0x5838ea[_0x4ac278(0x230)],_0x4ac278(0x213),_0x559f35[_0x4ac278(0x217)]['UNIVER_UNKNOWN']),_0x5838ea[_0x4ac278(0x230)]=_0x19a716([_0x559f35['DependentOn'](_0x5e4b71[_0x4ac278(0x1fb)],_0x1cabcb[_0x4ac278(0x241)],_0x250cd7[_0x4ac278(0x1f7)]),_0x57d374(0x1,_0x559f35[_0x4ac278(0x228)](_0x559f35[_0x4ac278(0x23c)])),_0x57d374(0x2,_0x559f35[_0x4ac278(0x21c)])],_0x5838ea[_0x4ac278(0x230)]),Object['defineProperty'](_0x5838ea,Symbol[_0x4ac278(0x222)],{'value':'Module'});}));function _0x18b0(){const _0xde38e1=['/edit','ThreadCommentModel','resolved','Solve','parse','listComments','/universer-api/comment/unit/','_initUserSync','object','COMMENT','dataSource','_threadCommentModel','CollaborationSessionService','onReady','11mNivqM','UniverProCollaborationClient','UniverThreadComment','unitId','Reply','body','Add','length','2832578oZtnie','Disposable','/delete','slice','368013UPrsQw','code','subscribe','userID','rangeType','createTimestamp','exports','addUser','solved','dayjs','UniverCore','function','UNRECOGNIZED','requireSession','personId','UniverLicensePlugin','_threadCommentDataSourceService','content','resolveComment','UniverThreadCommentUIPlugin','parentId','OpenOrReOpen','map','threadId','payload','getUnit','ref','Unknown','thread-comment-data-source.config','filter','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','disposeWithMe','onStarting','30840fbHwAq','/solved','@univerjs/network','addComment','UniverProLicense','post','saveCommentToSnapshot','format','YYYY/MM/DD\x20HH:mm','_config','type','replyId','_configService','replies','UniverInstanceType','Edit','syncUpdateMutationToColla','find','bufferTime','IConfigService','_httpService','size','user','UniverThreadCommentUi','getOwnPropertyDescriptor','toStringTag','UserManagerService','customRanges','error','_userService','/list','Inject','getMemberID','add','setConfig','_initDataSource','2047392tvIELd','commentUpdate$','@univerjs/thread-comment','UniverThreadCommentDataSourcePlugin','pipe','/add','_sessionService','comments','root','HTTPService','CustomRangeType','users','@univerjs-pro/collaboration-client','updateComment','merge','Injector','get','2049005OPALIS','_init','Solved','UniverCollaborationClientPlugin','forEach','32JVMHIm','_injector','Delete','34bDnOEG','reply','rangeId','36Itbesx','rxjs','userId','26088uFsQSD','3257GBMZdw'];_0x18b0=function(){return _0xde38e1;};return _0x18b0();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/
|
|
49
|
-
"@univerjs/core": "0.12.
|
|
50
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.12.2",
|
|
49
|
+
"@univerjs/core": "0.12.2",
|
|
50
|
+
"@univerjs-pro/license": "0.12.2",
|
|
51
|
+
"@univerjs/network": "0.12.2",
|
|
51
52
|
"@univerjs/protocol": "0.1.47",
|
|
52
|
-
"@univerjs/thread-comment": "0.12.
|
|
53
|
-
"@univerjs/thread-comment-ui": "0.12.
|
|
54
|
-
"@univerjs-pro/collaboration-client": "0.12.1"
|
|
53
|
+
"@univerjs/thread-comment": "0.12.2",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.12.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
59
|
"vite": "^7.2.2",
|
|
60
60
|
"vitest": "^3.2.4",
|
|
61
|
-
"@univerjs-infra/shared": "0.12.
|
|
61
|
+
"@univerjs-infra/shared": "0.12.2"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|