@univerjs-pro/thread-comment-datasource 1.0.0-rc.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3739c9=_0xabe3;(function(_0x3d034c,_0x20e7dc){const _0x5e7035=_0xabe3,_0x1f08fe=_0x3d034c();while(!![]){try{const _0x5244ac=parseInt(_0x5e7035(0x13c))/0x1*(parseInt(_0x5e7035(0x194))/0x2)+-parseInt(_0x5e7035(0x153))/0x3*(parseInt(_0x5e7035(0x13e))/0x4)+parseInt(_0x5e7035(0x186))/0x5*(-parseInt(_0x5e7035(0x19f))/0x6)+parseInt(_0x5e7035(0x12c))/0x7+parseInt(_0x5e7035(0x188))/0x8*(parseInt(_0x5e7035(0x154))/0x9)+parseInt(_0x5e7035(0x137))/0xa+-parseInt(_0x5e7035(0x16e))/0xb;if(_0x5244ac===_0x20e7dc)break;else _0x1f08fe['push'](_0x1f08fe['shift']());}catch(_0x4523ef){_0x1f08fe['push'](_0x1f08fe['shift']());}}}(_0x4022,0x833ef),Object['defineProperty'](exports,Symbol[_0x3739c9(0x11e)],{'value':_0x3739c9(0x12a)}));let e=require('@univerjs-pro/collaboration-client'),t=require('@univerjs-pro/license'),n=require('@univerjs/core'),r=require('@univerjs/network'),i=require('@univerjs/thread-comment'),a=require('@univerjs/thread-comment-ui'),o=require('@univerjs/protocol'),s=require('rxjs');var c='@univerjs-pro/thread-comment-datasource',l=_0x3739c9(0x13d);const u={},d=_0x1c546a=>(0x0,n['dateKit'])(new Date(+_0x1c546a))[_0x3739c9(0x171)](_0x3739c9(0x16f));function f(_0x13ed0e){const _0x3540e6=_0x3739c9;if(!_0x13ed0e)return null;try{let _0x2136f3=JSON['parse'](_0x13ed0e);return(0x0,i[_0x3540e6(0x141)])(_0x2136f3)?_0x2136f3:null;}catch{return null;}}const p=async(_0x1a9070,_0x1c3e4d)=>{const _0x1195a5=_0x3739c9;let _0x4063fe=_0x1a9070[_0x1195a5(0x19d)](n[_0x1195a5(0x187)]),_0x279a05=_0x1a9070['get'](r['HTTPService']);_0x1c3e4d[_0x1195a5(0x193)](_0x24db08=>{const _0x5948d6=_0x1195a5;_0x4063fe['getUser'](_0x24db08)&&_0x1c3e4d[_0x5948d6(0x17b)](_0x24db08);}),_0x1c3e4d['size']&&(await _0x279a05['get'](_0x1195a5(0x16a),{'params':{'userIDs':[..._0x1c3e4d]}}))[_0x1195a5(0x157)]['users']['forEach'](_0x4bbfc9=>{const _0xac888c=_0x1195a5;_0x4bbfc9&&_0x4063fe[_0xac888c(0x140)](_0x4bbfc9);});};function m(_0x56bf39,_0x329192){return function(_0x411715,_0x4152e2){_0x329192(_0x411715,_0x4152e2,_0x56bf39);};}function h(_0x8f55f0,_0x1f6067,_0x42500a,_0x22f037){const _0x3a3a8f=_0x3739c9;var _0x4c6196=arguments[_0x3a3a8f(0x15c)],_0x816bfb=_0x4c6196<0x3?_0x1f6067:_0x22f037===null?_0x22f037=Object[_0x3a3a8f(0x117)](_0x1f6067,_0x42500a):_0x22f037,_0xd02c28;if(typeof Reflect==_0x3a3a8f(0x11d)&&typeof Reflect['decorate']==_0x3a3a8f(0x11c))_0x816bfb=Reflect[_0x3a3a8f(0x177)](_0x8f55f0,_0x1f6067,_0x42500a,_0x22f037);else{for(var _0x43a1f5=_0x8f55f0['length']-0x1;_0x43a1f5>=0x0;_0x43a1f5--)(_0xd02c28=_0x8f55f0[_0x43a1f5])&&(_0x816bfb=(_0x4c6196<0x3?_0xd02c28(_0x816bfb):_0x4c6196>0x3?_0xd02c28(_0x1f6067,_0x42500a,_0x816bfb):_0xd02c28(_0x1f6067,_0x42500a))||_0x816bfb);}return _0x4c6196>0x3&&_0x816bfb&&Object[_0x3a3a8f(0x17d)](_0x1f6067,_0x42500a,_0x816bfb),_0x816bfb;}function _0x4022(){const _0x4a04d0=['parentId','getComment','default','iterator','payload','requireSession','solved','Module','constructor','2161803IOulbt','onReady','CollaborationSessionService','_threadCommentDataSourceService','Edit','stringify','Delete','UniverNetworkPlugin','bufferTime','root','Reply','6371850uoaeNx','replies','content','Solve','/edit','42LzbVcx','1.0.0-rc.0','1552580cnvyaz','post','addUser','isThreadCommentDocumentBody','IConfigService','/add','Plugin','rangeType','Comment\x20service\x20returned\x20an\x20invalid\x20thread','_sessionService','userId','_init','/delete','prototype','CommentSolvedStatus','_initUserSync','comments','UniverThreadCommentPlugin','_resolveComment','getMemberID','code','3fzEiPE','1089FEAnAy','CommentService','personId','body','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','packageName','_configService','merge','length','/list','comment','resolved','version','pipe','type','flatMap','thread-comment-data-source.config','customRanges','dateKit','threadId','COMMENT','/reply','/universer-api/user/list','slice','Solved','string','7285784WTeiwp','YYYY/MM/DD\x20HH:mm','listComments','format','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_initDataSource','/universer-api/comment/unit/','map','replyId','decorate','ref','UniverLicensePlugin','updateComment','delete','_deleteComment','defineProperty','error','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment','Inject','toPrimitive','Disposable','find','commentUpdate$','ThreadCommentModel','61345bekJVb','UserManagerService','69176bcljzb','has','_threadCommentDataSource','deleteThread','onStarting','reply','CustomRangeType','_injector','subscribe','_threadCommentModel','/solved','forEach','17558ocbGZv','filter','OpenOrReOpen','Injector','dataSource','_commentService','add','values','unitId','get','disposeWithMe','378MtMmDz','message','_httpService','Comment\x20service\x20failed\x20to\x20list\x20comments','symbol','user','deleteComment','getOwnPropertyDescriptor','_userService','UniverThreadCommentUIPlugin','pluginName','CommentUpdateEventType','function','object','toStringTag','createTimestamp','resolveComment','userID','isFinite'];_0x4022=function(){return _0x4a04d0;};return _0x4022();}function _0xabe3(_0x13e57e,_0x318c79){_0x13e57e=_0x13e57e-0x111;const _0x402254=_0x4022();let _0xabe334=_0x402254[_0x13e57e];return _0xabe334;}let g=class extends n['Disposable']{constructor(_0x26dfae,_0x557953,_0x2e5c2f,_0x146cf5){const _0x5c1979=_0x3739c9;super(),this[_0x5c1979(0x199)]=_0x26dfae,this['_threadCommentModel']=_0x557953,this[_0x5c1979(0x118)]=_0x2e5c2f,this[_0x5c1979(0x18f)]=_0x146cf5,this[_0x5c1979(0x149)](),this[_0x5c1979(0x14d)]();}[_0x3739c9(0x14d)](){const _0x344c30=_0x3739c9;this[_0x344c30(0x19e)](this[_0x344c30(0x191)][_0x344c30(0x184)][_0x344c30(0x161)]((0x0,s[_0x344c30(0x134)])(0x10))[_0x344c30(0x190)](_0x34668a=>{const _0x387ae2=_0x344c30;let _0x525419=new Set();_0x34668a[_0x387ae2(0x193)](_0x7af5c2=>{const _0x1e9f79=_0x387ae2;switch(_0x7af5c2[_0x1e9f79(0x162)]){case _0x1e9f79(0x19a):{let _0x608bc9=_0x7af5c2[_0x1e9f79(0x127)][_0x1e9f79(0x156)];_0x525419['add'](_0x608bc9);break;}default:break;}}),p(this[_0x387ae2(0x18f)],_0x525419);}));}[_0x3739c9(0x17c)](_0x143dcc,_0x970f1e,_0x590ba0){const _0x4599cc=_0x3739c9;let _0x341798=this[_0x4599cc(0x191)][_0x4599cc(0x124)](_0x143dcc,_0x970f1e,_0x590ba0);_0x341798&&(_0x341798[_0x4599cc(0x123)]?this[_0x4599cc(0x191)][_0x4599cc(0x116)](_0x143dcc,_0x970f1e,_0x590ba0):this['_threadCommentModel'][_0x4599cc(0x18b)](_0x143dcc,_0x970f1e,_0x341798['threadId']));}[_0x3739c9(0x150)](_0x19d388,_0x45b11c,_0x563a88,_0x4fefff){const _0x335401=_0x3739c9;(_0x4fefff===o[_0x335401(0x14c)][_0x335401(0x16c)]||_0x4fefff===o['CommentSolvedStatus']['OpenOrReOpen'])&&this[_0x335401(0x191)][_0x335401(0x120)](_0x19d388,_0x45b11c,_0x563a88,_0x4fefff===o['CommentSolvedStatus']['Solved']);}[_0x3739c9(0x149)](){const _0x10986e=_0x3739c9;this[_0x10986e(0x19e)](this[_0x10986e(0x199)]['commentUpdate$'][_0x10986e(0x190)](_0x445689=>{const _0x5d5461=_0x10986e;var _0x4ed4a8;let _0xc597fd=(_0x4ed4a8=this[_0x5d5461(0x191)]['getUnit'](_0x445689[_0x5d5461(0x19c)])[_0x5d5461(0x183)](_0x333a5f=>_0x333a5f[_0x5d5461(0x167)]===_0x445689[_0x5d5461(0x167)]))==null?void 0x0:_0x4ed4a8[_0x5d5461(0x135)];if(!_0xc597fd)return;let {unitId:_0x353780,subUnitId:_0x4a5870}=_0xc597fd;switch(_0x445689['user']&&this['_userService'][_0x5d5461(0x140)](_0x445689[_0x5d5461(0x115)]),_0x445689['type']){case o[_0x5d5461(0x11b)][_0x5d5461(0x136)]:{var _0x4a7108;let _0x106d9e=f(_0x445689[_0x5d5461(0x139)]);if(!_0x445689[_0x5d5461(0x176)]||!_0x445689[_0x5d5461(0x11f)]||!_0x106d9e)return;this[_0x5d5461(0x191)]['addComment'](_0x353780,_0x4a5870,{'unitId':_0x353780,'subUnitId':_0x4a5870,'ref':'','id':_0x445689['replyId'],'dT':d(+_0x445689[_0x5d5461(0x11f)]),'threadId':_0x445689[_0x5d5461(0x167)],'personId':((_0x4a7108=_0x445689[_0x5d5461(0x115)])==null?void 0x0:_0x4a7108[_0x5d5461(0x121)])??_0x445689[_0x5d5461(0x148)],'text':_0x106d9e,'parentId':_0xc597fd['id']});break;}case o[_0x5d5461(0x11b)][_0x5d5461(0x132)]:if(!_0x445689['replyId']){this[_0x5d5461(0x191)][_0x5d5461(0x18b)](_0x353780,_0x4a5870,_0xc597fd[_0x5d5461(0x167)]);break;}this[_0x5d5461(0x17c)](_0x353780,_0x4a5870,_0x445689[_0x5d5461(0x176)]);break;case o[_0x5d5461(0x11b)][_0x5d5461(0x130)]:{let _0x1b4485=f(_0x445689[_0x5d5461(0x139)]);if(!_0x445689[_0x5d5461(0x176)]||!_0x1b4485)return;this[_0x5d5461(0x191)][_0x5d5461(0x17a)](_0x353780,_0x4a5870,{'commentId':_0x445689[_0x5d5461(0x176)],'text':_0x1b4485});break;}case o['CommentUpdateEventType'][_0x5d5461(0x13a)]:this[_0x5d5461(0x150)](_0x353780,_0x4a5870,_0xc597fd['id'],_0x445689[_0x5d5461(0x129)]);break;default:break;}}));}};g=h([m(0x0,(0x0,n[_0x3739c9(0x180)])(e[_0x3739c9(0x155)])),m(0x1,(0x0,n[_0x3739c9(0x180)])(i[_0x3739c9(0x185)])),m(0x2,(0x0,n[_0x3739c9(0x180)])(n[_0x3739c9(0x187)])),m(0x3,(0x0,n[_0x3739c9(0x180)])(n[_0x3739c9(0x197)]))],g);function _(_0x13e308,_0x2a0163){const _0x241608=_0x3739c9;let _0x474eed=Number(_0x13e308==null?void 0x0:_0x13e308[_0x241608(0x11f)]);return!!(_0x13e308&&_0x13e308[_0x241608(0x176)]&&_0x13e308[_0x241608(0x167)]===_0x2a0163&&_0x13e308[_0x241608(0x148)]&&Number[_0x241608(0x122)](_0x474eed)&&_0x474eed>0x0);}function v(_0x252aea,_0x1de374){const _0x51fa60=_0x3739c9;let _0x524446=_0x252aea[_0x51fa60(0x138)][0x0];if(!_0x252aea[_0x51fa60(0x167)]||!_(_0x524446,_0x252aea['threadId']))throw Error(_0x51fa60(0x146));return{..._0x1de374,'id':_0x524446[_0x51fa60(0x176)],'resolved':_0x252aea[_0x51fa60(0x129)]===0x1,'dT':d(_0x524446[_0x51fa60(0x11f)]),'personId':_0x524446[_0x51fa60(0x148)],'threadId':_0x524446[_0x51fa60(0x167)]};}function y(_0x109880,_0x57f08b,_0x2e06d1,_0x48818a){const _0x5ef754=_0x3739c9;if((_0x109880==null?void 0x0:_0x109880['threadId'])===_0x57f08b&&_0x109880[_0x5ef754(0x138)]['length']>0x0){let _0x49a551=(_0xcdb769,_0x41bf13)=>{const _0xe82df1=_0x5ef754;if(!_(_0xcdb769,_0x57f08b))return null;let _0x29ea00=f(_0xcdb769[_0xe82df1(0x139)]);return _0x29ea00?{'id':_0xcdb769[_0xe82df1(0x176)],'threadId':_0xcdb769[_0xe82df1(0x167)],'dT':d(_0xcdb769['createTimestamp']),'personId':_0xcdb769[_0xe82df1(0x148)],'resolved':_0x109880[_0xe82df1(0x129)]===o['CommentSolvedStatus'][_0xe82df1(0x16c)],'unitId':_0x2e06d1,'subUnitId':_0x48818a,'text':_0x29ea00,'parentId':_0x41bf13}:null;},_0x77be74=_0x49a551(_0x109880['replies'][0x0]);if(!_0x77be74)return null;let _0x5b9c35=new Set([_0x77be74['id']]),_0x3b63dc=_0x109880[_0x5ef754(0x138)][_0x5ef754(0x16b)](0x1)[_0x5ef754(0x163)](_0x4086ce=>{const _0x1d3e32=_0x5ef754;let _0x395ffc=_0x49a551(_0x4086ce,_0x77be74['id']);return!_0x395ffc||_0x5b9c35[_0x1d3e32(0x189)](_0x395ffc['id'])?[]:(_0x5b9c35['add'](_0x395ffc['id']),[_0x395ffc]);});return{..._0x77be74,'children':_0x3b63dc};}return null;}let b=class{constructor(_0x4fd3d4,_0x3b2731,_0x16001a){const _0x2eb515=_0x3739c9;this['_httpService']=_0x4fd3d4,this[_0x2eb515(0x118)]=_0x3b2731,this[_0x2eb515(0x147)]=_0x16001a;}async['addComment'](_0x972d0b){const _0x563aaf=_0x3739c9;var _0x993d5;let {parentId:_0x2d7a8e,unitId:_0x9dde9,text:_0x1e7807,threadId:_0x500383}=_0x972d0b,_0xcfcded=((_0x993d5=_0x1e7807[_0x563aaf(0x165)])==null?void 0x0:_0x993d5[_0x563aaf(0x195)](_0x3f4bf3=>_0x3f4bf3[_0x563aaf(0x145)]===n[_0x563aaf(0x18e)]['COMMENT'])[_0x563aaf(0x175)](_0x3ecbc6=>_0x3ecbc6['rangeId']))??[],_0x28d447=JSON[_0x563aaf(0x131)](_0x1e7807),_0x34454e=(await this['_sessionService'][_0x563aaf(0x128)](_0x9dde9))[_0x563aaf(0x151)]();if(_0x2d7a8e){let _0x1edc9e={'memberId':_0x34454e,'unitId':_0x9dde9,'content':_0x28d447,'mention':_0xcfcded,'threadId':_0x500383},_0x1cb0f1=await this[_0x563aaf(0x112)][_0x563aaf(0x13f)]('/universer-api/comment/unit/'+_0x9dde9+_0x563aaf(0x169),{'body':_0x1edc9e}),_0x350015=_0x1cb0f1['body'][_0x563aaf(0x18d)];if(_0x1cb0f1['body'][_0x563aaf(0x17e)]&&_0x1cb0f1[_0x563aaf(0x157)][_0x563aaf(0x17e)]['code']!==0x1||!_(_0x350015,_0x500383)){var _0x3b0c08;throw Error(((_0x3b0c08=_0x1cb0f1[_0x563aaf(0x157)][_0x563aaf(0x17e)])==null?void 0x0:_0x3b0c08['message'])??'Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply');}return{..._0x972d0b,'id':_0x350015[_0x563aaf(0x176)],'dT':(0x0,n[_0x563aaf(0x166)])(+_0x350015[_0x563aaf(0x11f)])[_0x563aaf(0x171)](_0x563aaf(0x16f)),'personId':_0x350015[_0x563aaf(0x148)]};}else{let _0xa4250c={'memberId':_0x34454e,'unitId':_0x9dde9,'content':_0x28d447,'mention':_0xcfcded},_0x4d3d14=await this[_0x563aaf(0x112)][_0x563aaf(0x13f)]('/universer-api/comment/unit/'+_0x9dde9+_0x563aaf(0x143),{'body':_0xa4250c});if(_0x4d3d14[_0x563aaf(0x157)][_0x563aaf(0x17e)]&&_0x4d3d14[_0x563aaf(0x157)][_0x563aaf(0x17e)][_0x563aaf(0x152)]!==0x1||!_0x4d3d14[_0x563aaf(0x157)][_0x563aaf(0x15e)]){var _0x863d53;throw Error(((_0x863d53=_0x4d3d14[_0x563aaf(0x157)]['error'])==null?void 0x0:_0x863d53[_0x563aaf(0x111)])??_0x563aaf(0x17f));}return v(_0x4d3d14[_0x563aaf(0x157)][_0x563aaf(0x15e)],_0x972d0b);}}async[_0x3739c9(0x17a)](_0x160d11){const _0x44e10a=_0x3739c9;var _0x20dffb;let {text:_0x182e92,unitId:_0x3f2577}=_0x160d11,_0x477a83=((_0x20dffb=_0x182e92[_0x44e10a(0x165)])==null?void 0x0:_0x20dffb[_0x44e10a(0x195)](_0x1c37f1=>_0x1c37f1['rangeType']===n['CustomRangeType'][_0x44e10a(0x168)])['map'](_0x1f8bb4=>_0x1f8bb4['rangeId']))??[],_0x1aa1c4=JSON[_0x44e10a(0x131)](_0x182e92),_0x4c8594=_0x160d11[_0x44e10a(0x167)],_0x15ce87=_0x160d11['id'],_0x537e2a={'memberId':(await this[_0x44e10a(0x147)][_0x44e10a(0x128)](_0x3f2577))['getMemberID'](),'unitId':_0x3f2577,'threadId':_0x4c8594,'mention':_0x477a83,'content':_0x1aa1c4,'replyId':_0x15ce87},_0x223d2e=await this['_httpService'][_0x44e10a(0x13f)](_0x44e10a(0x174)+_0x3f2577+_0x44e10a(0x13b),{'body':_0x537e2a});return!_0x223d2e[_0x44e10a(0x157)][_0x44e10a(0x17e)]||_0x223d2e[_0x44e10a(0x157)][_0x44e10a(0x17e)][_0x44e10a(0x152)]===0x1;}async['resolveComment'](_0x550c45){const _0x30641c=_0x3739c9;let {unitId:_0x384f20}=_0x550c45,_0x41657c=_0x550c45[_0x30641c(0x167)],_0x3e2a88={'memberId':(await this[_0x30641c(0x147)]['requireSession'](_0x384f20))['getMemberID'](),'unitId':_0x384f20,'threadId':_0x41657c,'solved':_0x550c45[_0x30641c(0x15f)]?o[_0x30641c(0x14c)][_0x30641c(0x16c)]:o['CommentSolvedStatus'][_0x30641c(0x196)]},_0x3fc681=await this[_0x30641c(0x112)][_0x30641c(0x13f)](_0x30641c(0x174)+_0x384f20+_0x30641c(0x192),{'body':_0x3e2a88});return!_0x3fc681['body'][_0x30641c(0x17e)]||_0x3fc681[_0x30641c(0x157)][_0x30641c(0x17e)][_0x30641c(0x152)]===0x1;}[_0x3739c9(0x116)](_0x49fdbc,_0x426a0d,_0x2b5c1d,_0x5adee9){const _0x35bee8=_0x3739c9;return this[_0x35bee8(0x17c)](_0x49fdbc,_0x2b5c1d,_0x5adee9);}[_0x3739c9(0x18b)](_0x2ab2b9,_0x558883,_0x4be8a5){return this['_deleteComment'](_0x2ab2b9,_0x4be8a5);}async[_0x3739c9(0x17c)](_0x262e0a,_0x4a9245,_0x45280d){const _0x729454=_0x3739c9;let _0x31ea40={'memberId':(await this[_0x729454(0x147)][_0x729454(0x128)](_0x262e0a))[_0x729454(0x151)](),'threadId':_0x4a9245,'replyId':_0x45280d,'unitId':_0x262e0a},_0x52f1f9=await this[_0x729454(0x112)][_0x729454(0x13f)](_0x729454(0x174)+_0x262e0a+_0x729454(0x14a),{'body':_0x31ea40});return!_0x52f1f9[_0x729454(0x157)][_0x729454(0x17e)]||_0x52f1f9['body'][_0x729454(0x17e)][_0x729454(0x152)]===0x1;}async[_0x3739c9(0x170)](_0x3e0767,_0x2d8c27,_0x3bff26){const _0xd31b94=_0x3739c9;let _0x39699f={'unitId':_0x3e0767,'threadId':_0x3bff26},_0x5a63c2=await this[_0xd31b94(0x112)][_0xd31b94(0x13f)]('/universer-api/comment/unit/'+_0x3e0767+_0xd31b94(0x15d),{'body':_0x39699f});if(_0x5a63c2[_0xd31b94(0x157)][_0xd31b94(0x17e)]&&_0x5a63c2[_0xd31b94(0x157)][_0xd31b94(0x17e)][_0xd31b94(0x152)]!==0x1)throw Error(_0x5a63c2[_0xd31b94(0x157)][_0xd31b94(0x17e)][_0xd31b94(0x111)]||_0xd31b94(0x113));let _0x19c508=_0x3bff26[_0xd31b94(0x175)](_0x3bae3a=>{const _0x4a6e1c=_0xd31b94;var _0x1d9217;return y((_0x1d9217=_0x5a63c2[_0x4a6e1c(0x157)][_0x4a6e1c(0x14e)])==null?void 0x0:_0x1d9217[_0x3bae3a],_0x3bae3a,_0x3e0767,_0x2d8c27);})['filter'](Boolean);return Object[_0xd31b94(0x19b)](_0x5a63c2[_0xd31b94(0x157)]['users']??{})[_0xd31b94(0x193)](_0x18ae3d=>{const _0x544f68=_0xd31b94;this[_0x544f68(0x118)]['addUser'](_0x18ae3d);}),_0x19c508;}['saveCommentToSnapshot'](_0x3eb8d7){const _0x2c9096=_0x3739c9;return{'id':_0x3eb8d7['id'],'threadId':_0x3eb8d7[_0x2c9096(0x167)],'ref':_0x3eb8d7[_0x2c9096(0x178)]};}};b=h([m(0x0,(0x0,n[_0x3739c9(0x180)])(r['HTTPService'])),m(0x1,(0x0,n[_0x3739c9(0x180)])(n[_0x3739c9(0x187)])),m(0x2,(0x0,n[_0x3739c9(0x180)])(e[_0x3739c9(0x12e)]))],b);let x=class extends n[_0x3739c9(0x182)]{constructor(_0x2e1e99,_0x2cb8e4){const _0x40c2ec=_0x3739c9;super(),this[_0x40c2ec(0x12f)]=_0x2e1e99,this['_threadCommentDataSource']=_0x2cb8e4,this[_0x40c2ec(0x173)]();}[_0x3739c9(0x173)](){const _0xc2b7b8=_0x3739c9;this[_0xc2b7b8(0x12f)][_0xc2b7b8(0x198)]=this[_0xc2b7b8(0x18a)],this['_threadCommentDataSourceService']['syncUpdateMutationToColla']=!0x1;}};x=h([m(0x0,i['IThreadCommentDataSourceService']),m(0x1,(0x0,n[_0x3739c9(0x180)])(b))],x);function S(_0xd111c1){'@babel/helpers - typeof';const _0x4af0f9=_0x3739c9;return S=typeof Symbol=='function'&&typeof Symbol[_0x4af0f9(0x126)]==_0x4af0f9(0x114)?function(_0x447bd1){return typeof _0x447bd1;}:function(_0x22a9bd){const _0x33346d=_0x4af0f9;return _0x22a9bd&&typeof Symbol==_0x33346d(0x11c)&&_0x22a9bd[_0x33346d(0x12b)]===Symbol&&_0x22a9bd!==Symbol[_0x33346d(0x14b)]?'symbol':typeof _0x22a9bd;},S(_0xd111c1);}function C(_0x1616f9,_0x29767b){const _0x3f2ed4=_0x3739c9;if(S(_0x1616f9)!=_0x3f2ed4(0x11d)||!_0x1616f9)return _0x1616f9;var _0x3022ea=_0x1616f9[Symbol[_0x3f2ed4(0x181)]];if(_0x3022ea!==void 0x0){var _0x5e8489=_0x3022ea['call'](_0x1616f9,_0x29767b||_0x3f2ed4(0x125));if(S(_0x5e8489)!=_0x3f2ed4(0x11d))return _0x5e8489;throw TypeError(_0x3f2ed4(0x158));}return(_0x29767b===_0x3f2ed4(0x16d)?String:Number)(_0x1616f9);}function w(_0x552b08){const _0x2935a5=_0x3739c9;var _0x5b9fb7=C(_0x552b08,_0x2935a5(0x16d));return S(_0x5b9fb7)==_0x2935a5(0x114)?_0x5b9fb7:_0x5b9fb7+'';}function T(_0x4adbbb,_0x2be68f,_0x54d9cc){const _0x52aa6e=_0x3739c9;return(_0x2be68f=w(_0x2be68f))in _0x4adbbb?Object[_0x52aa6e(0x17d)](_0x4adbbb,_0x2be68f,{'value':_0x54d9cc,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x4adbbb[_0x2be68f]=_0x54d9cc,_0x4adbbb;}let E=class extends n[_0x3739c9(0x144)]{constructor(_0x13c553=u,_0x4374f7,_0x4532a1){const _0x20ce26=_0x3739c9;super(),this['_config']=_0x13c553,this['_injector']=_0x4374f7,this[_0x20ce26(0x15a)]=_0x4532a1;let {..._0x46d881}=(0x0,n[_0x20ce26(0x15b)])({},u,this['_config']);this[_0x20ce26(0x15a)]['setConfig'](_0x20ce26(0x164),_0x46d881);}[_0x3739c9(0x18c)](){const _0x48c965=_0x3739c9;[[b],[x],[g]][_0x48c965(0x193)](_0x1d359c=>{const _0x42bb84=_0x48c965;this[_0x42bb84(0x18f)][_0x42bb84(0x19a)](_0x1d359c);});}[_0x3739c9(0x12d)](){const _0x17236c=_0x3739c9;this[_0x17236c(0x18f)][_0x17236c(0x19d)](x),this[_0x17236c(0x18f)]['get'](g);}};T(E,_0x3739c9(0x11a),_0x3739c9(0x172)),T(E,_0x3739c9(0x159),c),T(E,_0x3739c9(0x160),l),E=h([(0x0,n['DependentOn'])(t[_0x3739c9(0x179)],r[_0x3739c9(0x133)],i[_0x3739c9(0x14f)],a[_0x3739c9(0x119)],e['UniverCollaborationClientPlugin']),m(0x1,(0x0,n[_0x3739c9(0x180)])(n[_0x3739c9(0x197)])),m(0x2,n[_0x3739c9(0x142)])],E),Object[_0x3739c9(0x17d)](exports,'UniverThreadCommentDataSourcePlugin',{'enumerable':!0x0,'get':function(){return E;}});
|
|
1
|
+
const _0x11d4ec=_0x3162;(function(_0x213fd3,_0x268ece){const _0xb9185d=_0x3162,_0x49508f=_0x213fd3();while(!![]){try{const _0x570d8f=-parseInt(_0xb9185d(0xe2))/0x1*(-parseInt(_0xb9185d(0x119))/0x2)+-parseInt(_0xb9185d(0x147))/0x3+parseInt(_0xb9185d(0x146))/0x4*(parseInt(_0xb9185d(0xf7))/0x5)+-parseInt(_0xb9185d(0xef))/0x6*(parseInt(_0xb9185d(0x168))/0x7)+-parseInt(_0xb9185d(0x140))/0x8*(parseInt(_0xb9185d(0x13c))/0x9)+parseInt(_0xb9185d(0xf9))/0xa+parseInt(_0xb9185d(0x136))/0xb*(parseInt(_0xb9185d(0x145))/0xc);if(_0x570d8f===_0x268ece)break;else _0x49508f['push'](_0x49508f['shift']());}catch(_0x3131b7){_0x49508f['push'](_0x49508f['shift']());}}}(_0x3543,0xc814d),Object[_0x11d4ec(0x121)](exports,Symbol[_0x11d4ec(0x113)],{'value':'Module'}));let e=require('@univerjs-pro/collaboration-client'),t=require('@univerjs-pro/license'),n=require('@univerjs/core'),r=require('@univerjs/network'),i=require('@univerjs/thread-comment'),a=require('@univerjs/thread-comment-ui'),o=require('@univerjs/protocol'),s=require('rxjs');var c=_0x11d4ec(0x15c),l='1.0.0';const u={},d=_0x3a2907=>(0x0,n[_0x11d4ec(0x14c)])(new Date(+_0x3a2907))['format'](_0x11d4ec(0x128));function f(_0x2f1839){const _0x40ff0a=_0x11d4ec;if(!_0x2f1839)return null;try{let _0x49b135=JSON['parse'](_0x2f1839);return(0x0,i[_0x40ff0a(0xe7)])(_0x49b135)?_0x49b135:null;}catch{return null;}}const p=async(_0x4ff177,_0x42d3f6)=>{const _0x5ce795=_0x11d4ec;let _0x57a915=_0x4ff177[_0x5ce795(0xe5)](n[_0x5ce795(0xfa)]),_0xd6c53b=_0x4ff177[_0x5ce795(0xe5)](r[_0x5ce795(0x102)]);_0x42d3f6[_0x5ce795(0x11a)](_0x2e7537=>{const _0x57230e=_0x5ce795;_0x57a915['getUser'](_0x2e7537)&&_0x42d3f6[_0x57230e(0xeb)](_0x2e7537);}),_0x42d3f6['size']&&(await _0xd6c53b[_0x5ce795(0xe5)](_0x5ce795(0x10e),{'params':{'userIDs':[..._0x42d3f6]}}))[_0x5ce795(0x10a)]['users'][_0x5ce795(0x11a)](_0x115b8a=>{_0x115b8a&&_0x57a915['addUser'](_0x115b8a);});};function _0x3543(){const _0xb55871=['/universer-api/comment/unit/','userID','HTTPService','COMMENT','merge','function','call','rangeType','_sessionService','/solved','body','has','deleteComment','IThreadCommentDataSourceService','/universer-api/user/list','threadId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','root','find','toStringTag','length','payload','map','replies','ThreadCommentModel','18946CBtTpe','forEach','saveCommentToSnapshot','Injector','_threadCommentDataSourceService','thread-comment-data-source.config','syncUpdateMutationToColla','Solved','defineProperty','setConfig','post','/reply','decorate','Inject','children','YYYY/MM/DD\x20HH:mm','dataSource','unitId','error','createTimestamp','resolved','format','userId','UniverLicensePlugin','deleteThread','default','Delete','updateComment','disposeWithMe','29432799tNVIZC','pipe','solved','reply','symbol','Disposable','4543659OFluws','bufferTime','iterator','_httpService','8EqQYMi','getUnit','CommentSolvedStatus','_deleteComment','personId','12EihFUm','76212BSTnkb','3512697GNtXWY','UniverCollaborationClientPlugin','flatMap','UniverNetworkPlugin','rangeId','dateKit','_threadCommentDataSource','object','CustomRangeType','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','replyId','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply','_config','IConfigService','stringify','some','message','getMemberID','comments','subscribe','_userService','@univerjs-pro/thread-comment-datasource','_configService','commentUpdate$','onReady','_initDataSource','Plugin','/add','parentId','type','customRanges','values','version','1988ocwwIZ','isFinite','getOwnPropertyDescriptor','_resolveComment','Edit','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment','OpenOrReOpen','add','_injector','95dhqgKB','CommentUpdateEventType','Comment\x20service\x20returned\x20an\x20invalid\x20thread','get','toPrimitive','isThreadCommentDocumentBody','_init','comment','filter','delete','_threadCommentModel','users','getComment','32586AxAJYe','resolveComment','onStarting','addComment','CollaborationSessionService','requireSession','/delete','content','85wRGtXM','user','1381420jrImXc','UserManagerService','code','authorName','/edit','addUser','UniverThreadCommentDataSourcePlugin'];_0x3543=function(){return _0xb55871;};return _0x3543();}function m(_0x16adb0,_0x2245bc){return function(_0x576d65,_0x6043a4){_0x2245bc(_0x576d65,_0x6043a4,_0x16adb0);};}function _0x3162(_0x3d42ca,_0x2d8506){_0x3d42ca=_0x3d42ca-0xde;const _0x354372=_0x3543();let _0x3162e7=_0x354372[_0x3d42ca];return _0x3162e7;}function h(_0x34cb3c,_0x3cc103,_0x33e862,_0x40889c){const _0x2c7311=_0x11d4ec;var _0x2f89ea=arguments[_0x2c7311(0x114)],_0x5cb75e=_0x2f89ea<0x3?_0x3cc103:_0x40889c===null?_0x40889c=Object[_0x2c7311(0x16a)](_0x3cc103,_0x33e862):_0x40889c,_0x570896;if(typeof Reflect=='object'&&typeof Reflect['decorate']==_0x2c7311(0x105))_0x5cb75e=Reflect[_0x2c7311(0x125)](_0x34cb3c,_0x3cc103,_0x33e862,_0x40889c);else{for(var _0x20f3fa=_0x34cb3c['length']-0x1;_0x20f3fa>=0x0;_0x20f3fa--)(_0x570896=_0x34cb3c[_0x20f3fa])&&(_0x5cb75e=(_0x2f89ea<0x3?_0x570896(_0x5cb75e):_0x2f89ea>0x3?_0x570896(_0x3cc103,_0x33e862,_0x5cb75e):_0x570896(_0x3cc103,_0x33e862))||_0x5cb75e);}return _0x2f89ea>0x3&&_0x5cb75e&&Object[_0x2c7311(0x121)](_0x3cc103,_0x33e862,_0x5cb75e),_0x5cb75e;}let g=class extends n[_0x11d4ec(0x13b)]{constructor(_0x386f97,_0x24c6a9,_0xc1baad,_0x36f6b7){const _0xb1ae4f=_0x11d4ec;super(),this['_commentService']=_0x386f97,this[_0xb1ae4f(0xec)]=_0x24c6a9,this[_0xb1ae4f(0x15b)]=_0xc1baad,this['_injector']=_0x36f6b7,this[_0xb1ae4f(0xe8)](),this['_initUserSync']();}['_initUserSync'](){const _0x44de52=_0x11d4ec;this[_0x44de52(0x135)](this[_0x44de52(0xec)]['commentUpdate$'][_0x44de52(0x137)]((0x0,s[_0x44de52(0x13d)])(0x10))['subscribe'](_0x4aac34=>{const _0x2517c0=_0x44de52;let _0x224f5d=new Set();_0x4aac34[_0x2517c0(0x11a)](_0x2140e1=>{const _0x2d674e=_0x2517c0;switch(_0x2140e1[_0x2d674e(0x164)]){case _0x2d674e(0xe0):{let _0x28d43c=_0x2140e1[_0x2d674e(0x115)][_0x2d674e(0x144)];_0x224f5d[_0x2d674e(0xe0)](_0x28d43c);break;}}}),p(this[_0x2517c0(0xe1)],_0x224f5d);}));}[_0x11d4ec(0x143)](_0x1558fe,_0x46e325,_0x33c184){const _0x416251=_0x11d4ec;let _0x2d6112=this[_0x416251(0xec)][_0x416251(0xee)](_0x1558fe,_0x46e325,_0x33c184);_0x2d6112&&(_0x2d6112[_0x416251(0x163)]?this[_0x416251(0xec)]['deleteComment'](_0x1558fe,_0x46e325,_0x33c184):this[_0x416251(0xec)]['deleteThread'](_0x1558fe,_0x46e325,_0x2d6112[_0x416251(0x10f)]));}[_0x11d4ec(0x16b)](_0x34f3c4,_0x4f2a2f,_0x2964c7,_0x159a64){const _0x39ca01=_0x11d4ec;(_0x159a64===o['CommentSolvedStatus']['Solved']||_0x159a64===o[_0x39ca01(0x142)][_0x39ca01(0xdf)])&&this[_0x39ca01(0xec)][_0x39ca01(0xf0)](_0x34f3c4,_0x4f2a2f,_0x2964c7,_0x159a64===o[_0x39ca01(0x142)][_0x39ca01(0x120)]);}['_init'](){const _0x297bb4=_0x11d4ec;this[_0x297bb4(0x135)](this['_commentService'][_0x297bb4(0x15e)][_0x297bb4(0x15a)](_0x1b1e9a=>{const _0x58ea43=_0x297bb4;var _0x7973b4;let _0x289cad=(_0x7973b4=this[_0x58ea43(0xec)][_0x58ea43(0x141)](_0x1b1e9a[_0x58ea43(0x12a)])[_0x58ea43(0x112)](_0x38d94e=>_0x38d94e[_0x58ea43(0x10f)]===_0x1b1e9a['threadId']))==null?void 0x0:_0x7973b4[_0x58ea43(0x111)];if(!_0x289cad)return;let {unitId:_0x42c27f,subUnitId:_0x1c8398}=_0x289cad;switch(_0x1b1e9a[_0x58ea43(0xf8)]&&this['_userService'][_0x58ea43(0xfe)](_0x1b1e9a[_0x58ea43(0xf8)]),_0x1b1e9a[_0x58ea43(0x164)]){case o[_0x58ea43(0xe3)]['Reply']:{var _0x37adb8;let _0x388bde=f(_0x1b1e9a[_0x58ea43(0xf6)]);if(!_0x1b1e9a[_0x58ea43(0x151)]||!_0x1b1e9a[_0x58ea43(0x12c)]||!_0x388bde)return;this[_0x58ea43(0xec)][_0x58ea43(0xf2)](_0x42c27f,_0x1c8398,{'unitId':_0x42c27f,'subUnitId':_0x1c8398,'ref':'','id':_0x1b1e9a[_0x58ea43(0x151)],'dT':d(+_0x1b1e9a[_0x58ea43(0x12c)]),'threadId':_0x1b1e9a['threadId'],'personId':((_0x37adb8=_0x1b1e9a[_0x58ea43(0xf8)])==null?void 0x0:_0x37adb8[_0x58ea43(0x101)])??_0x1b1e9a[_0x58ea43(0x12f)],'text':_0x388bde,'parentId':_0x289cad['id']});break;}case o['CommentUpdateEventType'][_0x58ea43(0x133)]:if(!_0x1b1e9a[_0x58ea43(0x151)]){this[_0x58ea43(0xec)]['deleteThread'](_0x42c27f,_0x1c8398,_0x289cad['threadId']);break;}this[_0x58ea43(0x143)](_0x42c27f,_0x1c8398,_0x1b1e9a[_0x58ea43(0x151)]);break;case o[_0x58ea43(0xe3)][_0x58ea43(0x16c)]:{let _0x53df42=f(_0x1b1e9a[_0x58ea43(0xf6)]);if(!_0x1b1e9a[_0x58ea43(0x151)]||!_0x53df42)return;this[_0x58ea43(0xec)]['updateComment'](_0x42c27f,_0x1c8398,{'commentId':_0x1b1e9a[_0x58ea43(0x151)],'text':_0x53df42});break;}case o[_0x58ea43(0xe3)]['Solve']:this[_0x58ea43(0x16b)](_0x42c27f,_0x1c8398,_0x289cad['id'],_0x1b1e9a[_0x58ea43(0x138)]);}}));}};g=h([m(0x0,(0x0,n[_0x11d4ec(0x126)])(e['CommentService'])),m(0x1,(0x0,n[_0x11d4ec(0x126)])(i[_0x11d4ec(0x118)])),m(0x2,(0x0,n[_0x11d4ec(0x126)])(n[_0x11d4ec(0xfa)])),m(0x3,(0x0,n[_0x11d4ec(0x126)])(n['Injector']))],g);function _(_0x3d14cf,_0x32c08a){const _0x4abc29=_0x11d4ec;let _0x1517c1=Number(_0x3d14cf==null?void 0x0:_0x3d14cf[_0x4abc29(0x12c)]);return!!(_0x3d14cf&&_0x3d14cf['replyId']&&_0x3d14cf[_0x4abc29(0x10f)]===_0x32c08a&&_0x3d14cf[_0x4abc29(0x12f)]&&Number[_0x4abc29(0x169)](_0x1517c1)&&_0x1517c1>0x0);}function v(_0x1fae21,_0x296725){const _0x48cc07=_0x11d4ec;let _0x5e297f=_0x1fae21[_0x48cc07(0x117)][0x0];if(!_0x1fae21['threadId']||!_(_0x5e297f,_0x1fae21[_0x48cc07(0x10f)]))throw Error(_0x48cc07(0xe4));return{..._0x296725,'id':_0x5e297f[_0x48cc07(0x151)],'resolved':_0x1fae21[_0x48cc07(0x138)]===0x1,'dT':d(_0x5e297f['createTimestamp']),'personId':_0x5e297f[_0x48cc07(0x12f)],'threadId':_0x5e297f['threadId']};}function y(_0x1a8cfd,_0x249b81,_0x2376e4,_0x10fd8a){const _0x25914b=_0x11d4ec;if((_0x1a8cfd==null?void 0x0:_0x1a8cfd['threadId'])===_0x249b81&&_0x1a8cfd[_0x25914b(0x117)]['length']>0x0){let _0x3c522e=(_0x35efec,_0x4d3e18)=>{const _0x4243fa=_0x25914b;if(!_(_0x35efec,_0x249b81))return null;let _0x23b25c=f(_0x35efec[_0x4243fa(0xf6)]);return _0x23b25c?{'id':_0x35efec[_0x4243fa(0x151)],'threadId':_0x35efec[_0x4243fa(0x10f)],'dT':d(_0x35efec[_0x4243fa(0x12c)]),'personId':_0x35efec[_0x4243fa(0x12f)],'resolved':_0x1a8cfd[_0x4243fa(0x138)]===o[_0x4243fa(0x142)]['Solved'],'unitId':_0x2376e4,'subUnitId':_0x10fd8a,'text':_0x23b25c,'parentId':_0x4d3e18}:null;},_0x4c9bd8=_0x3c522e(_0x1a8cfd[_0x25914b(0x117)][0x0]);if(!_0x4c9bd8)return null;let _0x306c90=new Set([_0x4c9bd8['id']]),_0x2299dd=_0x1a8cfd[_0x25914b(0x117)]['slice'](0x1)[_0x25914b(0x149)](_0x54f915=>{const _0x3aa093=_0x25914b;let _0x39ed48=_0x3c522e(_0x54f915,_0x4c9bd8['id']);return!_0x39ed48||_0x306c90[_0x3aa093(0x10b)](_0x39ed48['id'])?[]:(_0x306c90[_0x3aa093(0xe0)](_0x39ed48['id']),[_0x39ed48]);});return{..._0x4c9bd8,'children':_0x2299dd};}return null;}let b=class{constructor(_0x2663d4,_0x2ae1b8,_0x94bd8d){const _0x5d92d6=_0x11d4ec;this[_0x5d92d6(0x13f)]=_0x2663d4,this[_0x5d92d6(0x15b)]=_0x2ae1b8,this[_0x5d92d6(0x108)]=_0x94bd8d;}async[_0x11d4ec(0xf2)](_0x3a084e){const _0x5b154b=_0x11d4ec;var _0x4d4f64;let {parentId:_0x558f96,unitId:_0x4f5356,text:_0x4a53d6,threadId:_0x4abf47}=_0x3a084e,_0xc1b6c8=((_0x4d4f64=_0x4a53d6[_0x5b154b(0x165)])==null?void 0x0:_0x4d4f64[_0x5b154b(0xea)](_0x386a49=>_0x386a49[_0x5b154b(0x107)]===n[_0x5b154b(0x14f)]['COMMENT'])['map'](_0x2ae671=>_0x2ae671[_0x5b154b(0x14b)]))??[],_0x592f29=JSON[_0x5b154b(0x155)](_0x4a53d6),_0x4d84ad=(await this[_0x5b154b(0x108)]['requireSession'](_0x4f5356))[_0x5b154b(0x158)]();if(_0x558f96){let _0x4d0b30={'memberId':_0x4d84ad,'unitId':_0x4f5356,'content':_0x592f29,'mention':_0xc1b6c8,'threadId':_0x4abf47},_0x493390=await this[_0x5b154b(0x13f)][_0x5b154b(0x123)](_0x5b154b(0x100)+_0x4f5356+_0x5b154b(0x124),{'body':_0x4d0b30}),_0x3f7a27=_0x493390['body'][_0x5b154b(0x139)];if(_0x493390['body'][_0x5b154b(0x12b)]&&_0x493390[_0x5b154b(0x10a)][_0x5b154b(0x12b)][_0x5b154b(0xfb)]!==0x1||!_(_0x3f7a27,_0x4abf47)){var _0x47704a;throw Error(((_0x47704a=_0x493390[_0x5b154b(0x10a)][_0x5b154b(0x12b)])==null?void 0x0:_0x47704a[_0x5b154b(0x157)])??_0x5b154b(0x152));}return{..._0x3a084e,'id':_0x3f7a27[_0x5b154b(0x151)],'dT':(0x0,n[_0x5b154b(0x14c)])(+_0x3f7a27[_0x5b154b(0x12c)])[_0x5b154b(0x12e)](_0x5b154b(0x128)),'personId':_0x3f7a27[_0x5b154b(0x12f)]};}{let _0x3ac60e={'memberId':_0x4d84ad,'unitId':_0x4f5356,'content':_0x592f29,'mention':_0xc1b6c8},_0x2a1b23=await this[_0x5b154b(0x13f)][_0x5b154b(0x123)](_0x5b154b(0x100)+_0x4f5356+_0x5b154b(0x162),{'body':_0x3ac60e});if(_0x2a1b23['body']['error']&&_0x2a1b23[_0x5b154b(0x10a)][_0x5b154b(0x12b)][_0x5b154b(0xfb)]!==0x1||!_0x2a1b23[_0x5b154b(0x10a)]['comment']){var _0x41c25d;throw Error(((_0x41c25d=_0x2a1b23[_0x5b154b(0x10a)]['error'])==null?void 0x0:_0x41c25d[_0x5b154b(0x157)])??_0x5b154b(0xde));}return v(_0x2a1b23[_0x5b154b(0x10a)][_0x5b154b(0xe9)],_0x3a084e);}}async[_0x11d4ec(0x134)](_0x15f92e){const _0xf92ece=_0x11d4ec;var _0xe4ad2;let {text:_0x4dfde5,unitId:_0x3d4671}=_0x15f92e,_0x5b646b=((_0xe4ad2=_0x4dfde5[_0xf92ece(0x165)])==null?void 0x0:_0xe4ad2['filter'](_0x2559cf=>_0x2559cf['rangeType']===n['CustomRangeType'][_0xf92ece(0x103)])[_0xf92ece(0x116)](_0x2166d4=>_0x2166d4['rangeId']))??[],_0x55d1d3=JSON['stringify'](_0x4dfde5),_0x5343fd=_0x15f92e['threadId'],_0x55f6c7=_0x15f92e['id'],_0x5d9d3e={'memberId':(await this['_sessionService']['requireSession'](_0x3d4671))[_0xf92ece(0x158)](),'unitId':_0x3d4671,'threadId':_0x5343fd,'mention':_0x5b646b,'content':_0x55d1d3,'replyId':_0x55f6c7},_0x46c7f3=await this[_0xf92ece(0x13f)][_0xf92ece(0x123)](_0xf92ece(0x100)+_0x3d4671+_0xf92ece(0xfd),{'body':_0x5d9d3e});return!_0x46c7f3['body'][_0xf92ece(0x12b)]||_0x46c7f3[_0xf92ece(0x10a)][_0xf92ece(0x12b)]['code']===0x1;}async[_0x11d4ec(0xf0)](_0x48c1f2){const _0x4346f9=_0x11d4ec;let {unitId:_0xea6ad7}=_0x48c1f2,_0x4b3ff8=_0x48c1f2[_0x4346f9(0x10f)],_0x1cd2e1={'memberId':(await this[_0x4346f9(0x108)][_0x4346f9(0xf4)](_0xea6ad7))['getMemberID'](),'unitId':_0xea6ad7,'threadId':_0x4b3ff8,'solved':_0x48c1f2[_0x4346f9(0x12d)]?o['CommentSolvedStatus'][_0x4346f9(0x120)]:o[_0x4346f9(0x142)][_0x4346f9(0xdf)]},_0x380e34=await this[_0x4346f9(0x13f)][_0x4346f9(0x123)](_0x4346f9(0x100)+_0xea6ad7+_0x4346f9(0x109),{'body':_0x1cd2e1});return!_0x380e34[_0x4346f9(0x10a)][_0x4346f9(0x12b)]||_0x380e34[_0x4346f9(0x10a)][_0x4346f9(0x12b)][_0x4346f9(0xfb)]===0x1;}[_0x11d4ec(0x10c)](_0x2bec33,_0x2b307e,_0x2eb754,_0x5bc992){const _0x146481=_0x11d4ec;return this[_0x146481(0x143)](_0x2bec33,_0x2eb754,_0x5bc992);}[_0x11d4ec(0x131)](_0x4011e9,_0x4e2b43,_0x21dd2f){return this['_deleteComment'](_0x4011e9,_0x21dd2f);}async[_0x11d4ec(0x143)](_0x45d6d2,_0x4f940a,_0x33466b){const _0x32153d=_0x11d4ec;let _0x59e57f={'memberId':(await this[_0x32153d(0x108)][_0x32153d(0xf4)](_0x45d6d2))[_0x32153d(0x158)](),'threadId':_0x4f940a,'replyId':_0x33466b,'unitId':_0x45d6d2},_0x1bd99f=await this[_0x32153d(0x13f)]['post'](_0x32153d(0x100)+_0x45d6d2+_0x32153d(0xf5),{'body':_0x59e57f});return!_0x1bd99f[_0x32153d(0x10a)][_0x32153d(0x12b)]||_0x1bd99f['body'][_0x32153d(0x12b)][_0x32153d(0xfb)]===0x1;}async['listComments'](_0x702c0f,_0x5b071c,_0x30fa8f){const _0x4e5661=_0x11d4ec;let _0xbc570={'unitId':_0x702c0f,'threadId':_0x30fa8f},_0x34763f=await this[_0x4e5661(0x13f)][_0x4e5661(0x123)](_0x4e5661(0x100)+_0x702c0f+'/list',{'body':_0xbc570});if(_0x34763f[_0x4e5661(0x10a)][_0x4e5661(0x12b)]&&_0x34763f[_0x4e5661(0x10a)][_0x4e5661(0x12b)][_0x4e5661(0xfb)]!==0x1)throw Error(_0x34763f[_0x4e5661(0x10a)][_0x4e5661(0x12b)][_0x4e5661(0x157)]||'Comment\x20service\x20failed\x20to\x20list\x20comments');let _0x520e07=_0x30fa8f[_0x4e5661(0x116)](_0x35c9ef=>{const _0x4962ac=_0x4e5661;var _0x42d258;return y((_0x42d258=_0x34763f[_0x4962ac(0x10a)][_0x4962ac(0x159)])==null?void 0x0:_0x42d258[_0x35c9ef],_0x35c9ef,_0x702c0f,_0x5b071c);})[_0x4e5661(0xea)](Boolean);return Object[_0x4e5661(0x166)](_0x34763f['body'][_0x4e5661(0xed)]??{})[_0x4e5661(0x11a)](_0x563925=>{const _0x5a1fe9=_0x4e5661;this[_0x5a1fe9(0x15b)]['addUser'](_0x563925);}),_0x520e07;}[_0x11d4ec(0x11b)](_0x168615){const _0x24dada=_0x11d4ec;var _0x46402f;return{'id':_0x168615['id'],'threadId':_0x168615['threadId'],'ref':_0x168615['ref'],..._0x168615[_0x24dada(0xfc)]===void 0x0?{}:{'authorName':_0x168615[_0x24dada(0xfc)],'personId':_0x168615['personId']},...(_0x46402f=_0x168615[_0x24dada(0x127)])!=null&&_0x46402f[_0x24dada(0x156)](_0x46e8ec=>_0x46e8ec[_0x24dada(0xfc)]!==void 0x0)?{'children':_0x168615[_0x24dada(0x127)][_0x24dada(0xea)](_0x36e20d=>_0x36e20d[_0x24dada(0xfc)]!==void 0x0)['map'](_0x367707=>({'id':_0x367707['id'],'threadId':_0x367707[_0x24dada(0x10f)],'ref':'','parentId':_0x168615['id'],'personId':_0x367707[_0x24dada(0x144)],'authorName':_0x367707[_0x24dada(0xfc)]}))}:{}};}};b=h([m(0x0,(0x0,n[_0x11d4ec(0x126)])(r[_0x11d4ec(0x102)])),m(0x1,(0x0,n[_0x11d4ec(0x126)])(n[_0x11d4ec(0xfa)])),m(0x2,(0x0,n['Inject'])(e[_0x11d4ec(0xf3)]))],b);let x=class extends n[_0x11d4ec(0x13b)]{constructor(_0x2d2fd7,_0x3d9f8e){const _0x371944=_0x11d4ec;super(),this['_threadCommentDataSourceService']=_0x2d2fd7,this['_threadCommentDataSource']=_0x3d9f8e,this[_0x371944(0x160)]();}[_0x11d4ec(0x160)](){const _0x1271fe=_0x11d4ec;this[_0x1271fe(0x11d)][_0x1271fe(0x129)]=this[_0x1271fe(0x14d)],this[_0x1271fe(0x11d)][_0x1271fe(0x11f)]=!0x1;}};x=h([m(0x0,i[_0x11d4ec(0x10d)]),m(0x1,(0x0,n[_0x11d4ec(0x126)])(b))],x);function S(_0x4034a9){'@babel/helpers - typeof';const _0x2b11f9=_0x11d4ec;return S=typeof Symbol==_0x2b11f9(0x105)&&typeof Symbol[_0x2b11f9(0x13e)]==_0x2b11f9(0x13a)?function(_0x4b43e6){return typeof _0x4b43e6;}:function(_0x325629){const _0x40c5fe=_0x2b11f9;return _0x325629&&typeof Symbol==_0x40c5fe(0x105)&&_0x325629['constructor']===Symbol&&_0x325629!==Symbol['prototype']?_0x40c5fe(0x13a):typeof _0x325629;},S(_0x4034a9);}function C(_0x2db0d6,_0xce066d){const _0x2e6166=_0x11d4ec;if(S(_0x2db0d6)!=_0x2e6166(0x14e)||!_0x2db0d6)return _0x2db0d6;var _0x51af41=_0x2db0d6[Symbol[_0x2e6166(0xe6)]];if(_0x51af41!==void 0x0){var _0x464206=_0x51af41[_0x2e6166(0x106)](_0x2db0d6,_0xce066d||_0x2e6166(0x132));if(S(_0x464206)!='object')return _0x464206;throw TypeError(_0x2e6166(0x150));}return(_0xce066d==='string'?String:Number)(_0x2db0d6);}function w(_0xacd0b7){const _0x2ce4df=_0x11d4ec;var _0x38f82b=C(_0xacd0b7,'string');return S(_0x38f82b)==_0x2ce4df(0x13a)?_0x38f82b:_0x38f82b+'';}function T(_0x6b8c20,_0x34086c,_0x1acf73){const _0x1b84a1=_0x11d4ec;return(_0x34086c=w(_0x34086c))in _0x6b8c20?Object[_0x1b84a1(0x121)](_0x6b8c20,_0x34086c,{'value':_0x1acf73,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x6b8c20[_0x34086c]=_0x1acf73,_0x6b8c20;}let E=class extends n[_0x11d4ec(0x161)]{constructor(_0x23595a=u,_0x5b55f3,_0x4039a0){const _0x8f499c=_0x11d4ec;super(),this['_config']=_0x23595a,this[_0x8f499c(0xe1)]=_0x5b55f3,this[_0x8f499c(0x15d)]=_0x4039a0;let {..._0x32dc2c}=(0x0,n[_0x8f499c(0x104)])({},u,this[_0x8f499c(0x153)]);this[_0x8f499c(0x15d)][_0x8f499c(0x122)](_0x8f499c(0x11e),_0x32dc2c);}[_0x11d4ec(0xf1)](){[[b],[x],[g]]['forEach'](_0x24c457=>{const _0x5e00a0=_0x3162;this[_0x5e00a0(0xe1)]['add'](_0x24c457);});}[_0x11d4ec(0x15f)](){const _0x44b248=_0x11d4ec;this[_0x44b248(0xe1)][_0x44b248(0xe5)](x),this[_0x44b248(0xe1)]['get'](g);}};T(E,'pluginName',_0x11d4ec(0x110)),T(E,'packageName',c),T(E,_0x11d4ec(0x167),l),E=h([(0x0,n['DependentOn'])(t[_0x11d4ec(0x130)],r[_0x11d4ec(0x14a)],i['UniverThreadCommentPlugin'],a['UniverThreadCommentUIPlugin'],e[_0x11d4ec(0x148)]),m(0x1,(0x0,n[_0x11d4ec(0x126)])(n[_0x11d4ec(0x11c)])),m(0x2,n[_0x11d4ec(0x154)])],E),Object[_0x11d4ec(0x121)](exports,_0x11d4ec(0xff),{'enumerable':!0x0,'get':function(){return E;}});
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4b6787=_0x3951;(function(_0x1d031c,_0x1e8045){const _0x31a056=_0x3951,_0x348dff=_0x1d031c();while(!![]){try{const _0x327c24=-parseInt(_0x31a056(0x219))/0x1*(parseInt(_0x31a056(0x1d8))/0x2)+-parseInt(_0x31a056(0x208))/0x3+-parseInt(_0x31a056(0x229))/0x4+-parseInt(_0x31a056(0x21e))/0x5+-parseInt(_0x31a056(0x1da))/0x6+parseInt(_0x31a056(0x22c))/0x7*(parseInt(_0x31a056(0x225))/0x8)+parseInt(_0x31a056(0x245))/0x9;if(_0x327c24===_0x1e8045)break;else _0x348dff['push'](_0x348dff['shift']());}catch(_0x4e9c21){_0x348dff['push'](_0x348dff['shift']());}}}(_0x17f6,0x810df));import{CollaborationSessionService as _0x1ae4d4,CommentService as _0x2beca0,UniverCollaborationClientPlugin as _0x535258}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x3e8bc8}from'@univerjs-pro/license';import{CustomRangeType as _0x12a057,DependentOn as _0x4ea591,Disposable as _0x1cf564,IConfigService as _0x51ba67,Inject as _0x3b3332,Injector as _0x3d6580,Plugin as _0x3d0ed6,UserManagerService as _0x433e94,dateKit as _0x4d5352,merge as _0x3d3724}from'@univerjs/core';import{HTTPService as _0x47d19f,UniverNetworkPlugin as _0xf573f8}from'@univerjs/network';import{IThreadCommentDataSourceService as _0x2aa24e,ThreadCommentModel as _0x3abeb7,UniverThreadCommentPlugin as _0x122edc,isThreadCommentDocumentBody as _0xbb7c7d}from'@univerjs/thread-comment';import{UniverThreadCommentUIPlugin as _0xf23f6f}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x4dc009,CommentUpdateEventType as _0x3a38e9}from'@univerjs/protocol';import{bufferTime as _0x4c06a2}from'rxjs';var w=_0x4b6787(0x246),T=_0x4b6787(0x23a);const E={},D=_0x568215=>_0x4d5352(new Date(+_0x568215))[_0x4b6787(0x221)](_0x4b6787(0x1e8));function O(_0x4e76d9){if(!_0x4e76d9)return null;try{let _0x277fc1=JSON['parse'](_0x4e76d9);return _0xbb7c7d(_0x277fc1)?_0x277fc1:null;}catch{return null;}}const k=async(_0x515a28,_0x4e5958)=>{const _0x4ce176=_0x4b6787;let _0x28f06d=_0x515a28['get'](_0x433e94),_0x1be0ba=_0x515a28[_0x4ce176(0x230)](_0x47d19f);_0x4e5958[_0x4ce176(0x201)](_0x40403f=>{const _0xf51681=_0x4ce176;_0x28f06d[_0xf51681(0x228)](_0x40403f)&&_0x4e5958[_0xf51681(0x1ef)](_0x40403f);}),_0x4e5958[_0x4ce176(0x1fa)]&&(await _0x1be0ba[_0x4ce176(0x230)](_0x4ce176(0x1e5),{'params':{'userIDs':[..._0x4e5958]}}))[_0x4ce176(0x204)][_0x4ce176(0x1fb)][_0x4ce176(0x201)](_0x606b31=>{const _0x281c15=_0x4ce176;_0x606b31&&_0x28f06d[_0x281c15(0x1f6)](_0x606b31);});};function A(_0x149758,_0x1269dc){return function(_0x11e4d9,_0x4d3d81){_0x1269dc(_0x11e4d9,_0x4d3d81,_0x149758);};}function j(_0x332c11,_0xda7d9,_0x32dd6d,_0xf18639){const _0x475981=_0x4b6787;var _0x5651a2=arguments[_0x475981(0x1f9)],_0x537f8a=_0x5651a2<0x3?_0xda7d9:_0xf18639===null?_0xf18639=Object[_0x475981(0x20d)](_0xda7d9,_0x32dd6d):_0xf18639,_0x68ff4d;if(typeof Reflect==_0x475981(0x22d)&&typeof Reflect[_0x475981(0x211)]==_0x475981(0x234))_0x537f8a=Reflect['decorate'](_0x332c11,_0xda7d9,_0x32dd6d,_0xf18639);else{for(var _0x3a8b04=_0x332c11[_0x475981(0x1f9)]-0x1;_0x3a8b04>=0x0;_0x3a8b04--)(_0x68ff4d=_0x332c11[_0x3a8b04])&&(_0x537f8a=(_0x5651a2<0x3?_0x68ff4d(_0x537f8a):_0x5651a2>0x3?_0x68ff4d(_0xda7d9,_0x32dd6d,_0x537f8a):_0x68ff4d(_0xda7d9,_0x32dd6d))||_0x537f8a);}return _0x5651a2>0x3&&_0x537f8a&&Object[_0x475981(0x235)](_0xda7d9,_0x32dd6d,_0x537f8a),_0x537f8a;}let M=class extends _0x1cf564{constructor(_0x5c3973,_0x3df5b2,_0x39c6f2,_0x212d7d){const _0xc45aa3=_0x4b6787;super(),this[_0xc45aa3(0x21a)]=_0x5c3973,this[_0xc45aa3(0x21b)]=_0x3df5b2,this[_0xc45aa3(0x242)]=_0x39c6f2,this[_0xc45aa3(0x23c)]=_0x212d7d,this[_0xc45aa3(0x1e9)](),this[_0xc45aa3(0x1f3)]();}['_initUserSync'](){const _0x416ed3=_0x4b6787;this['disposeWithMe'](this[_0x416ed3(0x21b)][_0x416ed3(0x22e)][_0x416ed3(0x247)](_0x4c06a2(0x10))[_0x416ed3(0x1e2)](_0x596ce6=>{const _0x30f96f=_0x416ed3;let _0x2e5d87=new Set();_0x596ce6[_0x30f96f(0x201)](_0x532d8a=>{const _0x417919=_0x30f96f;switch(_0x532d8a[_0x417919(0x215)]){case'add':{let _0x36f2e7=_0x532d8a[_0x417919(0x23e)][_0x417919(0x1d6)];_0x2e5d87[_0x417919(0x1d5)](_0x36f2e7);break;}default:break;}}),k(this[_0x30f96f(0x23c)],_0x2e5d87);}));}[_0x4b6787(0x236)](_0x3ef31a,_0x575b8d,_0x2a3338){const _0x1bd983=_0x4b6787;let _0x1ec437=this[_0x1bd983(0x21b)][_0x1bd983(0x1fc)](_0x3ef31a,_0x575b8d,_0x2a3338);_0x1ec437&&(_0x1ec437[_0x1bd983(0x1dc)]?this[_0x1bd983(0x21b)]['deleteComment'](_0x3ef31a,_0x575b8d,_0x2a3338):this[_0x1bd983(0x21b)]['deleteThread'](_0x3ef31a,_0x575b8d,_0x1ec437[_0x1bd983(0x217)]));}['_resolveComment'](_0x1ca1e2,_0x5e1eea,_0xf2c1b8,_0x368fd7){const _0x15352b=_0x4b6787;(_0x368fd7===_0x4dc009[_0x15352b(0x1e1)]||_0x368fd7===_0x4dc009[_0x15352b(0x207)])&&this[_0x15352b(0x21b)]['resolveComment'](_0x1ca1e2,_0x5e1eea,_0xf2c1b8,_0x368fd7===_0x4dc009[_0x15352b(0x1e1)]);}[_0x4b6787(0x1e9)](){const _0x5a45a8=_0x4b6787;this['disposeWithMe'](this[_0x5a45a8(0x21a)][_0x5a45a8(0x22e)][_0x5a45a8(0x1e2)](_0x3e48cf=>{const _0x68bc0=_0x5a45a8;var _0x22e659;let _0x4312b0=(_0x22e659=this[_0x68bc0(0x21b)][_0x68bc0(0x213)](_0x3e48cf['unitId'])[_0x68bc0(0x1f8)](_0x3d327b=>_0x3d327b[_0x68bc0(0x217)]===_0x3e48cf['threadId']))==null?void 0x0:_0x22e659[_0x68bc0(0x23b)];if(!_0x4312b0)return;let {unitId:_0x3077d6,subUnitId:_0x1a65d5}=_0x4312b0;switch(_0x3e48cf[_0x68bc0(0x1fd)]&&this[_0x68bc0(0x242)][_0x68bc0(0x1f6)](_0x3e48cf[_0x68bc0(0x1fd)]),_0x3e48cf[_0x68bc0(0x215)]){case _0x3a38e9[_0x68bc0(0x21f)]:{var _0xb65df7;let _0x10536e=O(_0x3e48cf[_0x68bc0(0x1db)]);if(!_0x3e48cf[_0x68bc0(0x1d9)]||!_0x3e48cf['createTimestamp']||!_0x10536e)return;this[_0x68bc0(0x21b)][_0x68bc0(0x1ec)](_0x3077d6,_0x1a65d5,{'unitId':_0x3077d6,'subUnitId':_0x1a65d5,'ref':'','id':_0x3e48cf[_0x68bc0(0x1d9)],'dT':D(+_0x3e48cf['createTimestamp']),'threadId':_0x3e48cf[_0x68bc0(0x217)],'personId':((_0xb65df7=_0x3e48cf[_0x68bc0(0x1fd)])==null?void 0x0:_0xb65df7[_0x68bc0(0x1f2)])??_0x3e48cf[_0x68bc0(0x210)],'text':_0x10536e,'parentId':_0x4312b0['id']});break;}case _0x3a38e9[_0x68bc0(0x237)]:if(!_0x3e48cf['replyId']){this[_0x68bc0(0x21b)]['deleteThread'](_0x3077d6,_0x1a65d5,_0x4312b0['threadId']);break;}this[_0x68bc0(0x236)](_0x3077d6,_0x1a65d5,_0x3e48cf[_0x68bc0(0x1d9)]);break;case _0x3a38e9[_0x68bc0(0x22a)]:{let _0x2869d0=O(_0x3e48cf[_0x68bc0(0x1db)]);if(!_0x3e48cf[_0x68bc0(0x1d9)]||!_0x2869d0)return;this[_0x68bc0(0x21b)][_0x68bc0(0x23d)](_0x3077d6,_0x1a65d5,{'commentId':_0x3e48cf[_0x68bc0(0x1d9)],'text':_0x2869d0});break;}case _0x3a38e9['Solve']:this[_0x68bc0(0x238)](_0x3077d6,_0x1a65d5,_0x4312b0['id'],_0x3e48cf[_0x68bc0(0x1f7)]);break;default:break;}}));}};function _0x3951(_0x2125c0,_0x4d6d69){_0x2125c0=_0x2125c0-0x1d4;const _0x17f6e4=_0x17f6();let _0x3951f8=_0x17f6e4[_0x2125c0];return _0x3951f8;}M=j([A(0x0,_0x3b3332(_0x2beca0)),A(0x1,_0x3b3332(_0x3abeb7)),A(0x2,_0x3b3332(_0x433e94)),A(0x3,_0x3b3332(_0x3d6580))],M);function _0x17f6(){const _0x71e5c3=['getMemberID','type','_configService','threadId','/reply','3016bYTSkb','_commentService','_threadCommentModel','slice','symbol','4967030HseBqu','Reply','_threadCommentDataSourceService','format','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','filter','rangeType','6312zOOLsf','post','toPrimitive','getUser','2921692utgzzQ','Edit','message','7252uPNfID','object','commentUpdate$','Comment\x20service\x20returned\x20an\x20invalid\x20thread','get','reply','ref','/solved','function','defineProperty','_deleteComment','Delete','_resolveComment','values','1.0.0-rc.0','root','_injector','updateComment','payload','syncUpdateMutationToColla','deleteComment','_httpService','_userService','code','call','23832441kmKwhC','@univerjs-pro/thread-comment-datasource','pipe','requireSession','_config','add','personId','_sessionService','370KciAsa','replyId','2213346qnwiUh','content','parentId','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply','dataSource','error','resolveComment','Solved','subscribe','comments','COMMENT','/universer-api/user/list','createTimestamp','_threadCommentDataSource','YYYY/MM/DD\x20HH:mm','_init','/delete','customRanges','addComment','saveCommentToSnapshot','packageName','delete','listComments','prototype','userID','_initUserSync','onStarting','/list','addUser','solved','find','length','size','users','getComment','user','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment','constructor','/universer-api/comment/unit/','forEach','default','flatMap','body','rangeId','replies','OpenOrReOpen','858498VtTpfH','comment','string','map','pluginName','getOwnPropertyDescriptor','_initDataSource','Comment\x20service\x20failed\x20to\x20list\x20comments','userId','decorate','stringify','getUnit'];_0x17f6=function(){return _0x71e5c3;};return _0x17f6();}function N(_0x1c1ce0,_0x314a79){const _0xab31e3=_0x4b6787;let _0x6a51e5=Number(_0x1c1ce0==null?void 0x0:_0x1c1ce0['createTimestamp']);return!!(_0x1c1ce0&&_0x1c1ce0['replyId']&&_0x1c1ce0[_0xab31e3(0x217)]===_0x314a79&&_0x1c1ce0['userId']&&Number['isFinite'](_0x6a51e5)&&_0x6a51e5>0x0);}function P(_0xda1c8c,_0x29e852){const _0x4d3b4a=_0x4b6787;let _0x3bf116=_0xda1c8c[_0x4d3b4a(0x206)][0x0];if(!_0xda1c8c[_0x4d3b4a(0x217)]||!N(_0x3bf116,_0xda1c8c[_0x4d3b4a(0x217)]))throw Error(_0x4d3b4a(0x22f));return{..._0x29e852,'id':_0x3bf116[_0x4d3b4a(0x1d9)],'resolved':_0xda1c8c['solved']===0x1,'dT':D(_0x3bf116['createTimestamp']),'personId':_0x3bf116['userId'],'threadId':_0x3bf116['threadId']};}function F(_0x28f089,_0x456788,_0x11369d,_0x38f7d7){const _0x117db2=_0x4b6787;if((_0x28f089==null?void 0x0:_0x28f089[_0x117db2(0x217)])===_0x456788&&_0x28f089['replies'][_0x117db2(0x1f9)]>0x0){let _0x254d72=(_0x193a2b,_0x1bf45f)=>{const _0x5d74ad=_0x117db2;if(!N(_0x193a2b,_0x456788))return null;let _0x250209=O(_0x193a2b[_0x5d74ad(0x1db)]);return _0x250209?{'id':_0x193a2b['replyId'],'threadId':_0x193a2b[_0x5d74ad(0x217)],'dT':D(_0x193a2b['createTimestamp']),'personId':_0x193a2b['userId'],'resolved':_0x28f089[_0x5d74ad(0x1f7)]===_0x4dc009[_0x5d74ad(0x1e1)],'unitId':_0x11369d,'subUnitId':_0x38f7d7,'text':_0x250209,'parentId':_0x1bf45f}:null;},_0x2cb2a8=_0x254d72(_0x28f089[_0x117db2(0x206)][0x0]);if(!_0x2cb2a8)return null;let _0x2e6e8b=new Set([_0x2cb2a8['id']]),_0x371cbe=_0x28f089[_0x117db2(0x206)][_0x117db2(0x21c)](0x1)[_0x117db2(0x203)](_0x555eb4=>{const _0x29866b=_0x117db2;let _0x4a6469=_0x254d72(_0x555eb4,_0x2cb2a8['id']);return!_0x4a6469||_0x2e6e8b['has'](_0x4a6469['id'])?[]:(_0x2e6e8b[_0x29866b(0x1d5)](_0x4a6469['id']),[_0x4a6469]);});return{..._0x2cb2a8,'children':_0x371cbe};}return null;}let I=class{constructor(_0x3c7b11,_0x19f740,_0x4d8288){const _0x5590a1=_0x4b6787;this[_0x5590a1(0x241)]=_0x3c7b11,this[_0x5590a1(0x242)]=_0x19f740,this['_sessionService']=_0x4d8288;}async['addComment'](_0x5e40f7){const _0x19523b=_0x4b6787;var _0x459e8e;let {parentId:_0xac8312,unitId:_0x11958c,text:_0x330e30,threadId:_0x3f7374}=_0x5e40f7,_0x48d474=((_0x459e8e=_0x330e30[_0x19523b(0x1eb)])==null?void 0x0:_0x459e8e[_0x19523b(0x223)](_0x2a7d57=>_0x2a7d57[_0x19523b(0x224)]===_0x12a057[_0x19523b(0x1e4)])[_0x19523b(0x20b)](_0x1d58af=>_0x1d58af[_0x19523b(0x205)]))??[],_0x2f0dc9=JSON[_0x19523b(0x212)](_0x330e30),_0x17c4e8=(await this[_0x19523b(0x1d7)][_0x19523b(0x248)](_0x11958c))['getMemberID']();if(_0xac8312){let _0xbea85f={'memberId':_0x17c4e8,'unitId':_0x11958c,'content':_0x2f0dc9,'mention':_0x48d474,'threadId':_0x3f7374},_0x1c7665=await this['_httpService']['post'](_0x19523b(0x200)+_0x11958c+_0x19523b(0x218),{'body':_0xbea85f}),_0x4f9c2a=_0x1c7665[_0x19523b(0x204)][_0x19523b(0x231)];if(_0x1c7665[_0x19523b(0x204)][_0x19523b(0x1df)]&&_0x1c7665[_0x19523b(0x204)]['error'][_0x19523b(0x243)]!==0x1||!N(_0x4f9c2a,_0x3f7374)){var _0x40a743;throw Error(((_0x40a743=_0x1c7665[_0x19523b(0x204)][_0x19523b(0x1df)])==null?void 0x0:_0x40a743[_0x19523b(0x22b)])??_0x19523b(0x1dd));}return{..._0x5e40f7,'id':_0x4f9c2a['replyId'],'dT':_0x4d5352(+_0x4f9c2a[_0x19523b(0x1e6)])[_0x19523b(0x221)](_0x19523b(0x1e8)),'personId':_0x4f9c2a[_0x19523b(0x210)]};}else{let _0x49d4bd={'memberId':_0x17c4e8,'unitId':_0x11958c,'content':_0x2f0dc9,'mention':_0x48d474},_0x39a7ba=await this[_0x19523b(0x241)][_0x19523b(0x226)](_0x19523b(0x200)+_0x11958c+'/add',{'body':_0x49d4bd});if(_0x39a7ba['body'][_0x19523b(0x1df)]&&_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x1df)]['code']!==0x1||!_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x209)]){var _0x1a78d4;throw Error(((_0x1a78d4=_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x1df)])==null?void 0x0:_0x1a78d4[_0x19523b(0x22b)])??_0x19523b(0x1fe));}return P(_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x209)],_0x5e40f7);}}async[_0x4b6787(0x23d)](_0x37e6c2){const _0x262cb1=_0x4b6787;var _0x472ce2;let {text:_0x2a2999,unitId:_0x39f11b}=_0x37e6c2,_0x2524b8=((_0x472ce2=_0x2a2999['customRanges'])==null?void 0x0:_0x472ce2[_0x262cb1(0x223)](_0x7dafa4=>_0x7dafa4[_0x262cb1(0x224)]===_0x12a057[_0x262cb1(0x1e4)])[_0x262cb1(0x20b)](_0x28eecb=>_0x28eecb[_0x262cb1(0x205)]))??[],_0x3b4bf4=JSON[_0x262cb1(0x212)](_0x2a2999),_0x3c3639=_0x37e6c2[_0x262cb1(0x217)],_0x2846eb=_0x37e6c2['id'],_0x1a51ca={'memberId':(await this[_0x262cb1(0x1d7)][_0x262cb1(0x248)](_0x39f11b))[_0x262cb1(0x214)](),'unitId':_0x39f11b,'threadId':_0x3c3639,'mention':_0x2524b8,'content':_0x3b4bf4,'replyId':_0x2846eb},_0x31863f=await this['_httpService'][_0x262cb1(0x226)](_0x262cb1(0x200)+_0x39f11b+'/edit',{'body':_0x1a51ca});return!_0x31863f[_0x262cb1(0x204)][_0x262cb1(0x1df)]||_0x31863f['body'][_0x262cb1(0x1df)][_0x262cb1(0x243)]===0x1;}async[_0x4b6787(0x1e0)](_0x48c1df){const _0x2baae9=_0x4b6787;let {unitId:_0x515954}=_0x48c1df,_0x2ae123=_0x48c1df[_0x2baae9(0x217)],_0x36c552={'memberId':(await this[_0x2baae9(0x1d7)]['requireSession'](_0x515954))[_0x2baae9(0x214)](),'unitId':_0x515954,'threadId':_0x2ae123,'solved':_0x48c1df['resolved']?_0x4dc009['Solved']:_0x4dc009['OpenOrReOpen']},_0x4f6ebe=await this[_0x2baae9(0x241)][_0x2baae9(0x226)](_0x2baae9(0x200)+_0x515954+_0x2baae9(0x233),{'body':_0x36c552});return!_0x4f6ebe[_0x2baae9(0x204)]['error']||_0x4f6ebe[_0x2baae9(0x204)][_0x2baae9(0x1df)][_0x2baae9(0x243)]===0x1;}[_0x4b6787(0x240)](_0x45e2c2,_0x395b27,_0x5031cd,_0x565a9f){const _0x3265d2=_0x4b6787;return this[_0x3265d2(0x236)](_0x45e2c2,_0x5031cd,_0x565a9f);}['deleteThread'](_0xe73d56,_0xa6fa09,_0x1776c8){const _0x3c1a10=_0x4b6787;return this[_0x3c1a10(0x236)](_0xe73d56,_0x1776c8);}async[_0x4b6787(0x236)](_0x3332a9,_0x555228,_0x98e0eb){const _0x17e5d7=_0x4b6787;let _0x2b42a0={'memberId':(await this[_0x17e5d7(0x1d7)][_0x17e5d7(0x248)](_0x3332a9))['getMemberID'](),'threadId':_0x555228,'replyId':_0x98e0eb,'unitId':_0x3332a9},_0x1fa272=await this[_0x17e5d7(0x241)][_0x17e5d7(0x226)](_0x17e5d7(0x200)+_0x3332a9+_0x17e5d7(0x1ea),{'body':_0x2b42a0});return!_0x1fa272[_0x17e5d7(0x204)][_0x17e5d7(0x1df)]||_0x1fa272[_0x17e5d7(0x204)][_0x17e5d7(0x1df)][_0x17e5d7(0x243)]===0x1;}async[_0x4b6787(0x1f0)](_0x2978b2,_0x47a7ff,_0x84b068){const _0x54c64f=_0x4b6787;let _0x20ed44={'unitId':_0x2978b2,'threadId':_0x84b068},_0x341fd7=await this[_0x54c64f(0x241)]['post']('/universer-api/comment/unit/'+_0x2978b2+_0x54c64f(0x1f5),{'body':_0x20ed44});if(_0x341fd7[_0x54c64f(0x204)]['error']&&_0x341fd7['body'][_0x54c64f(0x1df)]['code']!==0x1)throw Error(_0x341fd7[_0x54c64f(0x204)][_0x54c64f(0x1df)]['message']||_0x54c64f(0x20f));let _0x11ba46=_0x84b068[_0x54c64f(0x20b)](_0x5319ed=>{const _0x469344=_0x54c64f;var _0x12fc60;return F((_0x12fc60=_0x341fd7['body'][_0x469344(0x1e3)])==null?void 0x0:_0x12fc60[_0x5319ed],_0x5319ed,_0x2978b2,_0x47a7ff);})['filter'](Boolean);return Object[_0x54c64f(0x239)](_0x341fd7[_0x54c64f(0x204)][_0x54c64f(0x1fb)]??{})[_0x54c64f(0x201)](_0x5b4153=>{const _0x377ea8=_0x54c64f;this['_userService'][_0x377ea8(0x1f6)](_0x5b4153);}),_0x11ba46;}[_0x4b6787(0x1ed)](_0x117b79){const _0x5e3960=_0x4b6787;return{'id':_0x117b79['id'],'threadId':_0x117b79[_0x5e3960(0x217)],'ref':_0x117b79[_0x5e3960(0x232)]};}};I=j([A(0x0,_0x3b3332(_0x47d19f)),A(0x1,_0x3b3332(_0x433e94)),A(0x2,_0x3b3332(_0x1ae4d4))],I);let L=class extends _0x1cf564{constructor(_0x1e971a,_0x1e118d){const _0x35e610=_0x4b6787;super(),this['_threadCommentDataSourceService']=_0x1e971a,this[_0x35e610(0x1e7)]=_0x1e118d,this[_0x35e610(0x20e)]();}[_0x4b6787(0x20e)](){const _0x1eb003=_0x4b6787;this[_0x1eb003(0x220)][_0x1eb003(0x1de)]=this['_threadCommentDataSource'],this[_0x1eb003(0x220)][_0x1eb003(0x23f)]=!0x1;}};L=j([A(0x0,_0x2aa24e),A(0x1,_0x3b3332(I))],L);function R(_0x4a4deb){'@babel/helpers - typeof';const _0x5a1880=_0x4b6787;return R=typeof Symbol==_0x5a1880(0x234)&&typeof Symbol['iterator']==_0x5a1880(0x21d)?function(_0x2a4d6c){return typeof _0x2a4d6c;}:function(_0x1c764e){const _0x4ee0fd=_0x5a1880;return _0x1c764e&&typeof Symbol==_0x4ee0fd(0x234)&&_0x1c764e[_0x4ee0fd(0x1ff)]===Symbol&&_0x1c764e!==Symbol[_0x4ee0fd(0x1f1)]?'symbol':typeof _0x1c764e;},R(_0x4a4deb);}function z(_0x29b24d,_0x58c2d2){const _0x1ef6c4=_0x4b6787;if(R(_0x29b24d)!='object'||!_0x29b24d)return _0x29b24d;var _0x53ad8c=_0x29b24d[Symbol[_0x1ef6c4(0x227)]];if(_0x53ad8c!==void 0x0){var _0x475116=_0x53ad8c[_0x1ef6c4(0x244)](_0x29b24d,_0x58c2d2||_0x1ef6c4(0x202));if(R(_0x475116)!='object')return _0x475116;throw TypeError(_0x1ef6c4(0x222));}return(_0x58c2d2===_0x1ef6c4(0x20a)?String:Number)(_0x29b24d);}function B(_0xd537a6){const _0x1168e0=_0x4b6787;var _0x161e54=z(_0xd537a6,_0x1168e0(0x20a));return R(_0x161e54)=='symbol'?_0x161e54:_0x161e54+'';}function V(_0x2c0890,_0x3848da,_0x3bf08d){const _0x14d7a3=_0x4b6787;return(_0x3848da=B(_0x3848da))in _0x2c0890?Object[_0x14d7a3(0x235)](_0x2c0890,_0x3848da,{'value':_0x3bf08d,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2c0890[_0x3848da]=_0x3bf08d,_0x2c0890;}let H=class extends _0x3d0ed6{constructor(_0x236045=E,_0x478960,_0xbc9fe1){const _0x231eff=_0x4b6787;super(),this[_0x231eff(0x1d4)]=_0x236045,this[_0x231eff(0x23c)]=_0x478960,this['_configService']=_0xbc9fe1;let {..._0xda2307}=_0x3d3724({},E,this['_config']);this[_0x231eff(0x216)]['setConfig']('thread-comment-data-source.config',_0xda2307);}[_0x4b6787(0x1f4)](){const _0x13a1a4=_0x4b6787;[[I],[L],[M]][_0x13a1a4(0x201)](_0x3e406e=>{const _0x3c8cbc=_0x13a1a4;this[_0x3c8cbc(0x23c)][_0x3c8cbc(0x1d5)](_0x3e406e);});}['onReady'](){const _0x437bbe=_0x4b6787;this[_0x437bbe(0x23c)][_0x437bbe(0x230)](L),this[_0x437bbe(0x23c)][_0x437bbe(0x230)](M);}};V(H,_0x4b6787(0x20c),'UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN'),V(H,_0x4b6787(0x1ee),w),V(H,'version',T),H=j([_0x4ea591(_0x3e8bc8,_0xf573f8,_0x122edc,_0xf23f6f,_0x535258),A(0x1,_0x3b3332(_0x3d6580)),A(0x2,_0x51ba67)],H);export{H as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x2c160b=_0x25fe;(function(_0x13736a,_0x1e430d){const _0x26db5e=_0x25fe,_0xcfef00=_0x13736a();while(!![]){try{const _0xb7fe0a=-parseInt(_0x26db5e(0x15a))/0x1*(parseInt(_0x26db5e(0x14e))/0x2)+-parseInt(_0x26db5e(0x136))/0x3+parseInt(_0x26db5e(0x15e))/0x4+-parseInt(_0x26db5e(0x14c))/0x5+parseInt(_0x26db5e(0x14f))/0x6+parseInt(_0x26db5e(0x15d))/0x7+-parseInt(_0x26db5e(0x13b))/0x8;if(_0xb7fe0a===_0x1e430d)break;else _0xcfef00['push'](_0xcfef00['shift']());}catch(_0x371c52){_0xcfef00['push'](_0xcfef00['shift']());}}}(_0x3892,0x3799c));import{CollaborationSessionService as _0x51d608,CommentService as _0x5e0b6b,UniverCollaborationClientPlugin as _0x4a9289}from'@univerjs-pro/collaboration-client';function _0x3892(){const _0x4d1c63=['Edit','createTimestamp','getUnit','deleteThread','post','319yvzrxU','function','some','2692081XiaqDj','1730188WyqOGz','_resolveComment','comment','stringify','get','flatMap','deleteComment','OpenOrReOpen','_init','/universer-api/user/list','solved','parentId','getUser','requireSession','iterator','_httpService','getOwnPropertyDescriptor','pluginName','slice','default','message','users','_sessionService','userId','/add','commentUpdate$','map','/universer-api/comment/unit/','rangeType','/solved','_initDataSource','prototype','customRanges','payload','symbol','/delete','_injector','Comment\x20service\x20failed\x20to\x20list\x20comments','addComment','string','unitId','user','_deleteComment','packageName','length','format','COMMENT','_config','object','constructor','_userService','reply','_commentService','/edit','resolveComment','userID','children','replyId','onReady','Solve','saveCommentToSnapshot','_threadCommentDataSource','root','/list','_threadCommentModel','body','_initUserSync','authorName','comments','ref','defineProperty','parse','Delete','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply','toPrimitive','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','1203705ytjYQY','disposeWithMe','_configService','rangeId','call','1136952GromKW','Comment\x20service\x20returned\x20an\x20invalid\x20thread','filter','error','forEach','content','syncUpdateMutationToColla','replies','Solved','decorate','subscribe','addUser','threadId','type','resolved','getMemberID','code','67695KLdUyu','getComment','2572CuXMul','2266422lwShdS','add','_threadCommentDataSourceService','values','delete','personId'];_0x3892=function(){return _0x4d1c63;};return _0x3892();}import{UniverLicensePlugin as _0x148c8f}from'@univerjs-pro/license';import{CustomRangeType as _0x4feba4,DependentOn as _0x122467,Disposable as _0x566060,IConfigService as _0x476ac6,Inject as _0x260cda,Injector as _0x29c905,Plugin as _0x5b3733,UserManagerService as _0xc8664e,dateKit as _0x39b695,merge as _0x627b99}from'@univerjs/core';function _0x25fe(_0x404132,_0x2fab86){_0x404132=_0x404132-0x127;const _0x3892a6=_0x3892();let _0x25fe3d=_0x3892a6[_0x404132];return _0x25fe3d;}import{HTTPService as _0x3efbde,UniverNetworkPlugin as _0x4ea40a}from'@univerjs/network';import{IThreadCommentDataSourceService as _0x1a2de3,ThreadCommentModel as _0x597175,UniverThreadCommentPlugin as _0x5f3cde,isThreadCommentDocumentBody as _0x448839}from'@univerjs/thread-comment';import{UniverThreadCommentUIPlugin as _0x56d8be}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x3036ad,CommentUpdateEventType as _0x149475}from'@univerjs/protocol';import{bufferTime as _0x1cf1fc}from'rxjs';var w='@univerjs-pro/thread-comment-datasource',T='1.0.0';const E={},D=_0x178cc1=>_0x39b695(new Date(+_0x178cc1))['format']('YYYY/MM/DD\x20HH:mm');function O(_0x418d19){const _0x37aeb7=_0x25fe;if(!_0x418d19)return null;try{let _0x2d1b5d=JSON[_0x37aeb7(0x131)](_0x418d19);return _0x448839(_0x2d1b5d)?_0x2d1b5d:null;}catch{return null;}}const k=async(_0x1f18d9,_0x2d62cd)=>{const _0x47b48a=_0x25fe;let _0x2c71b6=_0x1f18d9[_0x47b48a(0x162)](_0xc8664e),_0x11d274=_0x1f18d9[_0x47b48a(0x162)](_0x3efbde);_0x2d62cd[_0x47b48a(0x13f)](_0x18aa2a=>{const _0x1064f8=_0x47b48a;_0x2c71b6[_0x1064f8(0x16a)](_0x18aa2a)&&_0x2d62cd[_0x1064f8(0x153)](_0x18aa2a);}),_0x2d62cd['size']&&(await _0x11d274[_0x47b48a(0x162)](_0x47b48a(0x167),{'params':{'userIDs':[..._0x2d62cd]}}))[_0x47b48a(0x12b)][_0x47b48a(0x173)][_0x47b48a(0x13f)](_0x4d2777=>{_0x4d2777&&_0x2c71b6['addUser'](_0x4d2777);});};function A(_0x177e93,_0x2fd586){return function(_0x37a172,_0x2fa1d1){_0x2fd586(_0x37a172,_0x2fa1d1,_0x177e93);};}function j(_0x22b140,_0x5a823c,_0x8c4f8c,_0x2bfce2){const _0x5f5a45=_0x25fe;var _0xaea3b=arguments['length'],_0x1cea27=_0xaea3b<0x3?_0x5a823c:_0x2bfce2===null?_0x2bfce2=Object[_0x5f5a45(0x16e)](_0x5a823c,_0x8c4f8c):_0x2bfce2,_0x161439;if(typeof Reflect==_0x5f5a45(0x18e)&&typeof Reflect[_0x5f5a45(0x144)]=='function')_0x1cea27=Reflect[_0x5f5a45(0x144)](_0x22b140,_0x5a823c,_0x8c4f8c,_0x2bfce2);else{for(var _0x2dd6b8=_0x22b140[_0x5f5a45(0x18a)]-0x1;_0x2dd6b8>=0x0;_0x2dd6b8--)(_0x161439=_0x22b140[_0x2dd6b8])&&(_0x1cea27=(_0xaea3b<0x3?_0x161439(_0x1cea27):_0xaea3b>0x3?_0x161439(_0x5a823c,_0x8c4f8c,_0x1cea27):_0x161439(_0x5a823c,_0x8c4f8c))||_0x1cea27);}return _0xaea3b>0x3&&_0x1cea27&&Object[_0x5f5a45(0x130)](_0x5a823c,_0x8c4f8c,_0x1cea27),_0x1cea27;}let M=class extends _0x566060{constructor(_0x5e0cbe,_0x37715f,_0x46b149,_0x511df4){const _0x35fb17=_0x25fe;super(),this['_commentService']=_0x5e0cbe,this[_0x35fb17(0x12a)]=_0x37715f,this[_0x35fb17(0x190)]=_0x46b149,this['_injector']=_0x511df4,this[_0x35fb17(0x166)](),this[_0x35fb17(0x12c)]();}['_initUserSync'](){const _0x58a371=_0x25fe;this[_0x58a371(0x137)](this[_0x58a371(0x12a)][_0x58a371(0x177)]['pipe'](_0x1cf1fc(0x10))[_0x58a371(0x145)](_0x3d578f=>{const _0x1a0134=_0x58a371;let _0x3aecbf=new Set();_0x3d578f[_0x1a0134(0x13f)](_0x56f23d=>{const _0x54b755=_0x1a0134;switch(_0x56f23d['type']){case _0x54b755(0x150):{let _0x1878d9=_0x56f23d[_0x54b755(0x17f)][_0x54b755(0x154)];_0x3aecbf[_0x54b755(0x150)](_0x1878d9);break;}}}),k(this['_injector'],_0x3aecbf);}));}[_0x2c160b(0x188)](_0x2cae83,_0x330935,_0x367862){const _0x13e783=_0x2c160b;let _0x23a533=this['_threadCommentModel'][_0x13e783(0x14d)](_0x2cae83,_0x330935,_0x367862);_0x23a533&&(_0x23a533[_0x13e783(0x169)]?this[_0x13e783(0x12a)][_0x13e783(0x164)](_0x2cae83,_0x330935,_0x367862):this[_0x13e783(0x12a)][_0x13e783(0x158)](_0x2cae83,_0x330935,_0x23a533[_0x13e783(0x147)]));}['_resolveComment'](_0x4fe58b,_0x2e9bfc,_0x4531f3,_0x1cca4f){const _0x54b47d=_0x2c160b;(_0x1cca4f===_0x3036ad[_0x54b47d(0x143)]||_0x1cca4f===_0x3036ad[_0x54b47d(0x165)])&&this[_0x54b47d(0x12a)][_0x54b47d(0x194)](_0x4fe58b,_0x2e9bfc,_0x4531f3,_0x1cca4f===_0x3036ad[_0x54b47d(0x143)]);}[_0x2c160b(0x166)](){const _0x51bfbf=_0x2c160b;this[_0x51bfbf(0x137)](this[_0x51bfbf(0x192)]['commentUpdate$']['subscribe'](_0x28d611=>{const _0x5df3f1=_0x51bfbf;var _0x59f5ba;let _0x5d4ee9=(_0x59f5ba=this[_0x5df3f1(0x12a)][_0x5df3f1(0x157)](_0x28d611[_0x5df3f1(0x186)])['find'](_0x110c0c=>_0x110c0c[_0x5df3f1(0x147)]===_0x28d611[_0x5df3f1(0x147)]))==null?void 0x0:_0x59f5ba[_0x5df3f1(0x128)];if(!_0x5d4ee9)return;let {unitId:_0x3e744d,subUnitId:_0x8f76a7}=_0x5d4ee9;switch(_0x28d611[_0x5df3f1(0x187)]&&this[_0x5df3f1(0x190)][_0x5df3f1(0x146)](_0x28d611[_0x5df3f1(0x187)]),_0x28d611[_0x5df3f1(0x148)]){case _0x149475['Reply']:{var _0x3959f0;let _0x175aa4=O(_0x28d611[_0x5df3f1(0x140)]);if(!_0x28d611[_0x5df3f1(0x197)]||!_0x28d611[_0x5df3f1(0x156)]||!_0x175aa4)return;this[_0x5df3f1(0x12a)][_0x5df3f1(0x184)](_0x3e744d,_0x8f76a7,{'unitId':_0x3e744d,'subUnitId':_0x8f76a7,'ref':'','id':_0x28d611['replyId'],'dT':D(+_0x28d611[_0x5df3f1(0x156)]),'threadId':_0x28d611[_0x5df3f1(0x147)],'personId':((_0x3959f0=_0x28d611[_0x5df3f1(0x187)])==null?void 0x0:_0x3959f0[_0x5df3f1(0x195)])??_0x28d611[_0x5df3f1(0x175)],'text':_0x175aa4,'parentId':_0x5d4ee9['id']});break;}case _0x149475[_0x5df3f1(0x132)]:if(!_0x28d611['replyId']){this[_0x5df3f1(0x12a)][_0x5df3f1(0x158)](_0x3e744d,_0x8f76a7,_0x5d4ee9[_0x5df3f1(0x147)]);break;}this[_0x5df3f1(0x188)](_0x3e744d,_0x8f76a7,_0x28d611[_0x5df3f1(0x197)]);break;case _0x149475[_0x5df3f1(0x155)]:{let _0x15373d=O(_0x28d611[_0x5df3f1(0x140)]);if(!_0x28d611[_0x5df3f1(0x197)]||!_0x15373d)return;this['_threadCommentModel']['updateComment'](_0x3e744d,_0x8f76a7,{'commentId':_0x28d611[_0x5df3f1(0x197)],'text':_0x15373d});break;}case _0x149475[_0x5df3f1(0x199)]:this[_0x5df3f1(0x15f)](_0x3e744d,_0x8f76a7,_0x5d4ee9['id'],_0x28d611[_0x5df3f1(0x168)]);}}));}};M=j([A(0x0,_0x260cda(_0x5e0b6b)),A(0x1,_0x260cda(_0x597175)),A(0x2,_0x260cda(_0xc8664e)),A(0x3,_0x260cda(_0x29c905))],M);function N(_0x3dcb98,_0x411a15){const _0x1ba9b4=_0x2c160b;let _0x555ee8=Number(_0x3dcb98==null?void 0x0:_0x3dcb98[_0x1ba9b4(0x156)]);return!!(_0x3dcb98&&_0x3dcb98['replyId']&&_0x3dcb98['threadId']===_0x411a15&&_0x3dcb98['userId']&&Number['isFinite'](_0x555ee8)&&_0x555ee8>0x0);}function P(_0x43b985,_0x2ba9a8){const _0x2a4ebd=_0x2c160b;let _0x4f39f9=_0x43b985[_0x2a4ebd(0x142)][0x0];if(!_0x43b985[_0x2a4ebd(0x147)]||!N(_0x4f39f9,_0x43b985[_0x2a4ebd(0x147)]))throw Error(_0x2a4ebd(0x13c));return{..._0x2ba9a8,'id':_0x4f39f9['replyId'],'resolved':_0x43b985[_0x2a4ebd(0x168)]===0x1,'dT':D(_0x4f39f9['createTimestamp']),'personId':_0x4f39f9[_0x2a4ebd(0x175)],'threadId':_0x4f39f9[_0x2a4ebd(0x147)]};}function F(_0x23e729,_0x2d977e,_0x896c09,_0x51fa6f){const _0x30d382=_0x2c160b;if((_0x23e729==null?void 0x0:_0x23e729[_0x30d382(0x147)])===_0x2d977e&&_0x23e729[_0x30d382(0x142)][_0x30d382(0x18a)]>0x0){let _0x4f5a9a=(_0x304ffb,_0x5a2f24)=>{const _0x57dff7=_0x30d382;if(!N(_0x304ffb,_0x2d977e))return null;let _0x2b04e6=O(_0x304ffb[_0x57dff7(0x140)]);return _0x2b04e6?{'id':_0x304ffb[_0x57dff7(0x197)],'threadId':_0x304ffb[_0x57dff7(0x147)],'dT':D(_0x304ffb[_0x57dff7(0x156)]),'personId':_0x304ffb[_0x57dff7(0x175)],'resolved':_0x23e729['solved']===_0x3036ad['Solved'],'unitId':_0x896c09,'subUnitId':_0x51fa6f,'text':_0x2b04e6,'parentId':_0x5a2f24}:null;},_0x10d0ba=_0x4f5a9a(_0x23e729[_0x30d382(0x142)][0x0]);if(!_0x10d0ba)return null;let _0x266fb1=new Set([_0x10d0ba['id']]),_0x57b7b5=_0x23e729['replies'][_0x30d382(0x170)](0x1)[_0x30d382(0x163)](_0x2963b4=>{const _0x466ddc=_0x30d382;let _0x223df2=_0x4f5a9a(_0x2963b4,_0x10d0ba['id']);return!_0x223df2||_0x266fb1['has'](_0x223df2['id'])?[]:(_0x266fb1[_0x466ddc(0x150)](_0x223df2['id']),[_0x223df2]);});return{..._0x10d0ba,'children':_0x57b7b5};}return null;}let I=class{constructor(_0x44c122,_0x374ecb,_0x589b43){const _0x21c14=_0x2c160b;this[_0x21c14(0x16d)]=_0x44c122,this[_0x21c14(0x190)]=_0x374ecb,this[_0x21c14(0x174)]=_0x589b43;}async[_0x2c160b(0x184)](_0x3fc777){const _0x1d133d=_0x2c160b;var _0xfdb54a;let {parentId:_0x147623,unitId:_0xe6856b,text:_0x700d5d,threadId:_0x95d867}=_0x3fc777,_0x26f87a=((_0xfdb54a=_0x700d5d['customRanges'])==null?void 0x0:_0xfdb54a[_0x1d133d(0x13d)](_0x3dfe62=>_0x3dfe62['rangeType']===_0x4feba4[_0x1d133d(0x18c)])[_0x1d133d(0x178)](_0x452022=>_0x452022[_0x1d133d(0x139)]))??[],_0x486262=JSON[_0x1d133d(0x161)](_0x700d5d),_0x170fbe=(await this['_sessionService'][_0x1d133d(0x16b)](_0xe6856b))[_0x1d133d(0x14a)]();if(_0x147623){let _0x5d5fee={'memberId':_0x170fbe,'unitId':_0xe6856b,'content':_0x486262,'mention':_0x26f87a,'threadId':_0x95d867},_0x5a414c=await this[_0x1d133d(0x16d)][_0x1d133d(0x159)](_0x1d133d(0x179)+_0xe6856b+'/reply',{'body':_0x5d5fee}),_0x9725a7=_0x5a414c[_0x1d133d(0x12b)][_0x1d133d(0x191)];if(_0x5a414c['body'][_0x1d133d(0x13e)]&&_0x5a414c[_0x1d133d(0x12b)][_0x1d133d(0x13e)][_0x1d133d(0x14b)]!==0x1||!N(_0x9725a7,_0x95d867)){var _0x301547;throw Error(((_0x301547=_0x5a414c['body'][_0x1d133d(0x13e)])==null?void 0x0:_0x301547[_0x1d133d(0x172)])??_0x1d133d(0x133));}return{..._0x3fc777,'id':_0x9725a7['replyId'],'dT':_0x39b695(+_0x9725a7['createTimestamp'])[_0x1d133d(0x18b)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x9725a7[_0x1d133d(0x175)]};}{let _0x52d70d={'memberId':_0x170fbe,'unitId':_0xe6856b,'content':_0x486262,'mention':_0x26f87a},_0x14e0da=await this[_0x1d133d(0x16d)][_0x1d133d(0x159)](_0x1d133d(0x179)+_0xe6856b+_0x1d133d(0x176),{'body':_0x52d70d});if(_0x14e0da['body']['error']&&_0x14e0da[_0x1d133d(0x12b)]['error'][_0x1d133d(0x14b)]!==0x1||!_0x14e0da[_0x1d133d(0x12b)]['comment']){var _0x3b2fa9;throw Error(((_0x3b2fa9=_0x14e0da[_0x1d133d(0x12b)][_0x1d133d(0x13e)])==null?void 0x0:_0x3b2fa9[_0x1d133d(0x172)])??'Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment');}return P(_0x14e0da[_0x1d133d(0x12b)][_0x1d133d(0x160)],_0x3fc777);}}async['updateComment'](_0x32d432){const _0x5531cc=_0x2c160b;var _0x544be6;let {text:_0x3bb358,unitId:_0x3e6966}=_0x32d432,_0x2110bf=((_0x544be6=_0x3bb358[_0x5531cc(0x17e)])==null?void 0x0:_0x544be6[_0x5531cc(0x13d)](_0x472d5e=>_0x472d5e[_0x5531cc(0x17a)]===_0x4feba4[_0x5531cc(0x18c)])[_0x5531cc(0x178)](_0x3fd038=>_0x3fd038[_0x5531cc(0x139)]))??[],_0xc9e5a2=JSON[_0x5531cc(0x161)](_0x3bb358),_0x50e1ae=_0x32d432['threadId'],_0xc2ab4b=_0x32d432['id'],_0x4e9976={'memberId':(await this[_0x5531cc(0x174)][_0x5531cc(0x16b)](_0x3e6966))[_0x5531cc(0x14a)](),'unitId':_0x3e6966,'threadId':_0x50e1ae,'mention':_0x2110bf,'content':_0xc9e5a2,'replyId':_0xc2ab4b},_0x8d9235=await this[_0x5531cc(0x16d)][_0x5531cc(0x159)]('/universer-api/comment/unit/'+_0x3e6966+_0x5531cc(0x193),{'body':_0x4e9976});return!_0x8d9235[_0x5531cc(0x12b)][_0x5531cc(0x13e)]||_0x8d9235['body']['error'][_0x5531cc(0x14b)]===0x1;}async[_0x2c160b(0x194)](_0x7a71c0){const _0x22e4cf=_0x2c160b;let {unitId:_0xc3e85c}=_0x7a71c0,_0x40dfe6=_0x7a71c0[_0x22e4cf(0x147)],_0x4dd233={'memberId':(await this[_0x22e4cf(0x174)][_0x22e4cf(0x16b)](_0xc3e85c))[_0x22e4cf(0x14a)](),'unitId':_0xc3e85c,'threadId':_0x40dfe6,'solved':_0x7a71c0[_0x22e4cf(0x149)]?_0x3036ad[_0x22e4cf(0x143)]:_0x3036ad[_0x22e4cf(0x165)]},_0x143f1d=await this[_0x22e4cf(0x16d)][_0x22e4cf(0x159)]('/universer-api/comment/unit/'+_0xc3e85c+_0x22e4cf(0x17b),{'body':_0x4dd233});return!_0x143f1d[_0x22e4cf(0x12b)]['error']||_0x143f1d[_0x22e4cf(0x12b)][_0x22e4cf(0x13e)][_0x22e4cf(0x14b)]===0x1;}[_0x2c160b(0x164)](_0x12896b,_0x3058bb,_0x20e7e0,_0x4d762b){const _0x4e676e=_0x2c160b;return this[_0x4e676e(0x188)](_0x12896b,_0x20e7e0,_0x4d762b);}[_0x2c160b(0x158)](_0x1abe31,_0x42f26d,_0x522fc6){const _0x2bf1b0=_0x2c160b;return this[_0x2bf1b0(0x188)](_0x1abe31,_0x522fc6);}async[_0x2c160b(0x188)](_0x63eeee,_0x146f68,_0x498b34){const _0x353621=_0x2c160b;let _0x328cc6={'memberId':(await this[_0x353621(0x174)][_0x353621(0x16b)](_0x63eeee))[_0x353621(0x14a)](),'threadId':_0x146f68,'replyId':_0x498b34,'unitId':_0x63eeee},_0x48e3a0=await this[_0x353621(0x16d)][_0x353621(0x159)](_0x353621(0x179)+_0x63eeee+_0x353621(0x181),{'body':_0x328cc6});return!_0x48e3a0[_0x353621(0x12b)][_0x353621(0x13e)]||_0x48e3a0[_0x353621(0x12b)]['error'][_0x353621(0x14b)]===0x1;}async['listComments'](_0x85b211,_0x1870fe,_0x9861d0){const _0x3fb90c=_0x2c160b;let _0x151ed2={'unitId':_0x85b211,'threadId':_0x9861d0},_0x5f0d65=await this[_0x3fb90c(0x16d)]['post'](_0x3fb90c(0x179)+_0x85b211+_0x3fb90c(0x129),{'body':_0x151ed2});if(_0x5f0d65[_0x3fb90c(0x12b)][_0x3fb90c(0x13e)]&&_0x5f0d65['body'][_0x3fb90c(0x13e)][_0x3fb90c(0x14b)]!==0x1)throw Error(_0x5f0d65[_0x3fb90c(0x12b)]['error'][_0x3fb90c(0x172)]||_0x3fb90c(0x183));let _0x56fa57=_0x9861d0['map'](_0x2146e7=>{const _0x11b9c0=_0x3fb90c;var _0x1ebde8;return F((_0x1ebde8=_0x5f0d65['body'][_0x11b9c0(0x12e)])==null?void 0x0:_0x1ebde8[_0x2146e7],_0x2146e7,_0x85b211,_0x1870fe);})[_0x3fb90c(0x13d)](Boolean);return Object[_0x3fb90c(0x152)](_0x5f0d65['body'][_0x3fb90c(0x173)]??{})[_0x3fb90c(0x13f)](_0x559337=>{this['_userService']['addUser'](_0x559337);}),_0x56fa57;}[_0x2c160b(0x19a)](_0x31052d){const _0x4b6442=_0x2c160b;var _0x453e73;return{'id':_0x31052d['id'],'threadId':_0x31052d['threadId'],'ref':_0x31052d[_0x4b6442(0x12f)],..._0x31052d[_0x4b6442(0x12d)]===void 0x0?{}:{'authorName':_0x31052d[_0x4b6442(0x12d)],'personId':_0x31052d[_0x4b6442(0x154)]},...(_0x453e73=_0x31052d[_0x4b6442(0x196)])!=null&&_0x453e73[_0x4b6442(0x15c)](_0x51d507=>_0x51d507[_0x4b6442(0x12d)]!==void 0x0)?{'children':_0x31052d[_0x4b6442(0x196)][_0x4b6442(0x13d)](_0x5f080a=>_0x5f080a[_0x4b6442(0x12d)]!==void 0x0)[_0x4b6442(0x178)](_0x5c034f=>({'id':_0x5c034f['id'],'threadId':_0x5c034f[_0x4b6442(0x147)],'ref':'','parentId':_0x31052d['id'],'personId':_0x5c034f[_0x4b6442(0x154)],'authorName':_0x5c034f[_0x4b6442(0x12d)]}))}:{}};}};I=j([A(0x0,_0x260cda(_0x3efbde)),A(0x1,_0x260cda(_0xc8664e)),A(0x2,_0x260cda(_0x51d608))],I);let L=class extends _0x566060{constructor(_0x3375ed,_0x1778d7){const _0x40742d=_0x2c160b;super(),this[_0x40742d(0x151)]=_0x3375ed,this[_0x40742d(0x127)]=_0x1778d7,this[_0x40742d(0x17c)]();}['_initDataSource'](){const _0x4ce698=_0x2c160b;this[_0x4ce698(0x151)]['dataSource']=this[_0x4ce698(0x127)],this['_threadCommentDataSourceService'][_0x4ce698(0x141)]=!0x1;}};L=j([A(0x0,_0x1a2de3),A(0x1,_0x260cda(I))],L);function R(_0x2f8273){'@babel/helpers - typeof';const _0x219002=_0x2c160b;return R=typeof Symbol=='function'&&typeof Symbol[_0x219002(0x16c)]==_0x219002(0x180)?function(_0x5065b6){return typeof _0x5065b6;}:function(_0x568bab){const _0x403f98=_0x219002;return _0x568bab&&typeof Symbol==_0x403f98(0x15b)&&_0x568bab[_0x403f98(0x18f)]===Symbol&&_0x568bab!==Symbol[_0x403f98(0x17d)]?_0x403f98(0x180):typeof _0x568bab;},R(_0x2f8273);}function z(_0x18bc94,_0x3ee021){const _0x138c1b=_0x2c160b;if(R(_0x18bc94)!=_0x138c1b(0x18e)||!_0x18bc94)return _0x18bc94;var _0x22b355=_0x18bc94[Symbol[_0x138c1b(0x134)]];if(_0x22b355!==void 0x0){var _0x4d18dd=_0x22b355[_0x138c1b(0x13a)](_0x18bc94,_0x3ee021||_0x138c1b(0x171));if(R(_0x4d18dd)!=_0x138c1b(0x18e))return _0x4d18dd;throw TypeError(_0x138c1b(0x135));}return(_0x3ee021===_0x138c1b(0x185)?String:Number)(_0x18bc94);}function B(_0x3e76b3){const _0x280b3c=_0x2c160b;var _0x33160e=z(_0x3e76b3,_0x280b3c(0x185));return R(_0x33160e)=='symbol'?_0x33160e:_0x33160e+'';}function V(_0x43defc,_0x3b20a8,_0x3a5a37){const _0x31f438=_0x2c160b;return(_0x3b20a8=B(_0x3b20a8))in _0x43defc?Object[_0x31f438(0x130)](_0x43defc,_0x3b20a8,{'value':_0x3a5a37,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x43defc[_0x3b20a8]=_0x3a5a37,_0x43defc;}let H=class extends _0x5b3733{constructor(_0x4e8872=E,_0x3b1ad4,_0x401600){const _0x39aad8=_0x2c160b;super(),this[_0x39aad8(0x18d)]=_0x4e8872,this[_0x39aad8(0x182)]=_0x3b1ad4,this[_0x39aad8(0x138)]=_0x401600;let {..._0x54a97b}=_0x627b99({},E,this[_0x39aad8(0x18d)]);this[_0x39aad8(0x138)]['setConfig']('thread-comment-data-source.config',_0x54a97b);}['onStarting'](){const _0x1a72b9=_0x2c160b;[[I],[L],[M]][_0x1a72b9(0x13f)](_0x521451=>{const _0x1c6548=_0x1a72b9;this[_0x1c6548(0x182)]['add'](_0x521451);});}[_0x2c160b(0x198)](){const _0x16437d=_0x2c160b;this[_0x16437d(0x182)][_0x16437d(0x162)](L),this[_0x16437d(0x182)][_0x16437d(0x162)](M);}};V(H,_0x2c160b(0x16f),'UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN'),V(H,_0x2c160b(0x189),w),V(H,'version',T),H=j([_0x122467(_0x148c8f,_0x4ea40a,_0x5f3cde,_0x56d8be,_0x4a9289),A(0x1,_0x260cda(_0x29c905)),A(0x2,_0x476ac6)],H);export{H as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4b6787=_0x3951;(function(_0x1d031c,_0x1e8045){const _0x31a056=_0x3951,_0x348dff=_0x1d031c();while(!![]){try{const _0x327c24=-parseInt(_0x31a056(0x219))/0x1*(parseInt(_0x31a056(0x1d8))/0x2)+-parseInt(_0x31a056(0x208))/0x3+-parseInt(_0x31a056(0x229))/0x4+-parseInt(_0x31a056(0x21e))/0x5+-parseInt(_0x31a056(0x1da))/0x6+parseInt(_0x31a056(0x22c))/0x7*(parseInt(_0x31a056(0x225))/0x8)+parseInt(_0x31a056(0x245))/0x9;if(_0x327c24===_0x1e8045)break;else _0x348dff['push'](_0x348dff['shift']());}catch(_0x4e9c21){_0x348dff['push'](_0x348dff['shift']());}}}(_0x17f6,0x810df));import{CollaborationSessionService as _0x1ae4d4,CommentService as _0x2beca0,UniverCollaborationClientPlugin as _0x535258}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x3e8bc8}from'@univerjs-pro/license';import{CustomRangeType as _0x12a057,DependentOn as _0x4ea591,Disposable as _0x1cf564,IConfigService as _0x51ba67,Inject as _0x3b3332,Injector as _0x3d6580,Plugin as _0x3d0ed6,UserManagerService as _0x433e94,dateKit as _0x4d5352,merge as _0x3d3724}from'@univerjs/core';import{HTTPService as _0x47d19f,UniverNetworkPlugin as _0xf573f8}from'@univerjs/network';import{IThreadCommentDataSourceService as _0x2aa24e,ThreadCommentModel as _0x3abeb7,UniverThreadCommentPlugin as _0x122edc,isThreadCommentDocumentBody as _0xbb7c7d}from'@univerjs/thread-comment';import{UniverThreadCommentUIPlugin as _0xf23f6f}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x4dc009,CommentUpdateEventType as _0x3a38e9}from'@univerjs/protocol';import{bufferTime as _0x4c06a2}from'rxjs';var w=_0x4b6787(0x246),T=_0x4b6787(0x23a);const E={},D=_0x568215=>_0x4d5352(new Date(+_0x568215))[_0x4b6787(0x221)](_0x4b6787(0x1e8));function O(_0x4e76d9){if(!_0x4e76d9)return null;try{let _0x277fc1=JSON['parse'](_0x4e76d9);return _0xbb7c7d(_0x277fc1)?_0x277fc1:null;}catch{return null;}}const k=async(_0x515a28,_0x4e5958)=>{const _0x4ce176=_0x4b6787;let _0x28f06d=_0x515a28['get'](_0x433e94),_0x1be0ba=_0x515a28[_0x4ce176(0x230)](_0x47d19f);_0x4e5958[_0x4ce176(0x201)](_0x40403f=>{const _0xf51681=_0x4ce176;_0x28f06d[_0xf51681(0x228)](_0x40403f)&&_0x4e5958[_0xf51681(0x1ef)](_0x40403f);}),_0x4e5958[_0x4ce176(0x1fa)]&&(await _0x1be0ba[_0x4ce176(0x230)](_0x4ce176(0x1e5),{'params':{'userIDs':[..._0x4e5958]}}))[_0x4ce176(0x204)][_0x4ce176(0x1fb)][_0x4ce176(0x201)](_0x606b31=>{const _0x281c15=_0x4ce176;_0x606b31&&_0x28f06d[_0x281c15(0x1f6)](_0x606b31);});};function A(_0x149758,_0x1269dc){return function(_0x11e4d9,_0x4d3d81){_0x1269dc(_0x11e4d9,_0x4d3d81,_0x149758);};}function j(_0x332c11,_0xda7d9,_0x32dd6d,_0xf18639){const _0x475981=_0x4b6787;var _0x5651a2=arguments[_0x475981(0x1f9)],_0x537f8a=_0x5651a2<0x3?_0xda7d9:_0xf18639===null?_0xf18639=Object[_0x475981(0x20d)](_0xda7d9,_0x32dd6d):_0xf18639,_0x68ff4d;if(typeof Reflect==_0x475981(0x22d)&&typeof Reflect[_0x475981(0x211)]==_0x475981(0x234))_0x537f8a=Reflect['decorate'](_0x332c11,_0xda7d9,_0x32dd6d,_0xf18639);else{for(var _0x3a8b04=_0x332c11[_0x475981(0x1f9)]-0x1;_0x3a8b04>=0x0;_0x3a8b04--)(_0x68ff4d=_0x332c11[_0x3a8b04])&&(_0x537f8a=(_0x5651a2<0x3?_0x68ff4d(_0x537f8a):_0x5651a2>0x3?_0x68ff4d(_0xda7d9,_0x32dd6d,_0x537f8a):_0x68ff4d(_0xda7d9,_0x32dd6d))||_0x537f8a);}return _0x5651a2>0x3&&_0x537f8a&&Object[_0x475981(0x235)](_0xda7d9,_0x32dd6d,_0x537f8a),_0x537f8a;}let M=class extends _0x1cf564{constructor(_0x5c3973,_0x3df5b2,_0x39c6f2,_0x212d7d){const _0xc45aa3=_0x4b6787;super(),this[_0xc45aa3(0x21a)]=_0x5c3973,this[_0xc45aa3(0x21b)]=_0x3df5b2,this[_0xc45aa3(0x242)]=_0x39c6f2,this[_0xc45aa3(0x23c)]=_0x212d7d,this[_0xc45aa3(0x1e9)](),this[_0xc45aa3(0x1f3)]();}['_initUserSync'](){const _0x416ed3=_0x4b6787;this['disposeWithMe'](this[_0x416ed3(0x21b)][_0x416ed3(0x22e)][_0x416ed3(0x247)](_0x4c06a2(0x10))[_0x416ed3(0x1e2)](_0x596ce6=>{const _0x30f96f=_0x416ed3;let _0x2e5d87=new Set();_0x596ce6[_0x30f96f(0x201)](_0x532d8a=>{const _0x417919=_0x30f96f;switch(_0x532d8a[_0x417919(0x215)]){case'add':{let _0x36f2e7=_0x532d8a[_0x417919(0x23e)][_0x417919(0x1d6)];_0x2e5d87[_0x417919(0x1d5)](_0x36f2e7);break;}default:break;}}),k(this[_0x30f96f(0x23c)],_0x2e5d87);}));}[_0x4b6787(0x236)](_0x3ef31a,_0x575b8d,_0x2a3338){const _0x1bd983=_0x4b6787;let _0x1ec437=this[_0x1bd983(0x21b)][_0x1bd983(0x1fc)](_0x3ef31a,_0x575b8d,_0x2a3338);_0x1ec437&&(_0x1ec437[_0x1bd983(0x1dc)]?this[_0x1bd983(0x21b)]['deleteComment'](_0x3ef31a,_0x575b8d,_0x2a3338):this[_0x1bd983(0x21b)]['deleteThread'](_0x3ef31a,_0x575b8d,_0x1ec437[_0x1bd983(0x217)]));}['_resolveComment'](_0x1ca1e2,_0x5e1eea,_0xf2c1b8,_0x368fd7){const _0x15352b=_0x4b6787;(_0x368fd7===_0x4dc009[_0x15352b(0x1e1)]||_0x368fd7===_0x4dc009[_0x15352b(0x207)])&&this[_0x15352b(0x21b)]['resolveComment'](_0x1ca1e2,_0x5e1eea,_0xf2c1b8,_0x368fd7===_0x4dc009[_0x15352b(0x1e1)]);}[_0x4b6787(0x1e9)](){const _0x5a45a8=_0x4b6787;this['disposeWithMe'](this[_0x5a45a8(0x21a)][_0x5a45a8(0x22e)][_0x5a45a8(0x1e2)](_0x3e48cf=>{const _0x68bc0=_0x5a45a8;var _0x22e659;let _0x4312b0=(_0x22e659=this[_0x68bc0(0x21b)][_0x68bc0(0x213)](_0x3e48cf['unitId'])[_0x68bc0(0x1f8)](_0x3d327b=>_0x3d327b[_0x68bc0(0x217)]===_0x3e48cf['threadId']))==null?void 0x0:_0x22e659[_0x68bc0(0x23b)];if(!_0x4312b0)return;let {unitId:_0x3077d6,subUnitId:_0x1a65d5}=_0x4312b0;switch(_0x3e48cf[_0x68bc0(0x1fd)]&&this[_0x68bc0(0x242)][_0x68bc0(0x1f6)](_0x3e48cf[_0x68bc0(0x1fd)]),_0x3e48cf[_0x68bc0(0x215)]){case _0x3a38e9[_0x68bc0(0x21f)]:{var _0xb65df7;let _0x10536e=O(_0x3e48cf[_0x68bc0(0x1db)]);if(!_0x3e48cf[_0x68bc0(0x1d9)]||!_0x3e48cf['createTimestamp']||!_0x10536e)return;this[_0x68bc0(0x21b)][_0x68bc0(0x1ec)](_0x3077d6,_0x1a65d5,{'unitId':_0x3077d6,'subUnitId':_0x1a65d5,'ref':'','id':_0x3e48cf[_0x68bc0(0x1d9)],'dT':D(+_0x3e48cf['createTimestamp']),'threadId':_0x3e48cf[_0x68bc0(0x217)],'personId':((_0xb65df7=_0x3e48cf[_0x68bc0(0x1fd)])==null?void 0x0:_0xb65df7[_0x68bc0(0x1f2)])??_0x3e48cf[_0x68bc0(0x210)],'text':_0x10536e,'parentId':_0x4312b0['id']});break;}case _0x3a38e9[_0x68bc0(0x237)]:if(!_0x3e48cf['replyId']){this[_0x68bc0(0x21b)]['deleteThread'](_0x3077d6,_0x1a65d5,_0x4312b0['threadId']);break;}this[_0x68bc0(0x236)](_0x3077d6,_0x1a65d5,_0x3e48cf[_0x68bc0(0x1d9)]);break;case _0x3a38e9[_0x68bc0(0x22a)]:{let _0x2869d0=O(_0x3e48cf[_0x68bc0(0x1db)]);if(!_0x3e48cf[_0x68bc0(0x1d9)]||!_0x2869d0)return;this[_0x68bc0(0x21b)][_0x68bc0(0x23d)](_0x3077d6,_0x1a65d5,{'commentId':_0x3e48cf[_0x68bc0(0x1d9)],'text':_0x2869d0});break;}case _0x3a38e9['Solve']:this[_0x68bc0(0x238)](_0x3077d6,_0x1a65d5,_0x4312b0['id'],_0x3e48cf[_0x68bc0(0x1f7)]);break;default:break;}}));}};function _0x3951(_0x2125c0,_0x4d6d69){_0x2125c0=_0x2125c0-0x1d4;const _0x17f6e4=_0x17f6();let _0x3951f8=_0x17f6e4[_0x2125c0];return _0x3951f8;}M=j([A(0x0,_0x3b3332(_0x2beca0)),A(0x1,_0x3b3332(_0x3abeb7)),A(0x2,_0x3b3332(_0x433e94)),A(0x3,_0x3b3332(_0x3d6580))],M);function _0x17f6(){const _0x71e5c3=['getMemberID','type','_configService','threadId','/reply','3016bYTSkb','_commentService','_threadCommentModel','slice','symbol','4967030HseBqu','Reply','_threadCommentDataSourceService','format','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','filter','rangeType','6312zOOLsf','post','toPrimitive','getUser','2921692utgzzQ','Edit','message','7252uPNfID','object','commentUpdate$','Comment\x20service\x20returned\x20an\x20invalid\x20thread','get','reply','ref','/solved','function','defineProperty','_deleteComment','Delete','_resolveComment','values','1.0.0-rc.0','root','_injector','updateComment','payload','syncUpdateMutationToColla','deleteComment','_httpService','_userService','code','call','23832441kmKwhC','@univerjs-pro/thread-comment-datasource','pipe','requireSession','_config','add','personId','_sessionService','370KciAsa','replyId','2213346qnwiUh','content','parentId','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply','dataSource','error','resolveComment','Solved','subscribe','comments','COMMENT','/universer-api/user/list','createTimestamp','_threadCommentDataSource','YYYY/MM/DD\x20HH:mm','_init','/delete','customRanges','addComment','saveCommentToSnapshot','packageName','delete','listComments','prototype','userID','_initUserSync','onStarting','/list','addUser','solved','find','length','size','users','getComment','user','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment','constructor','/universer-api/comment/unit/','forEach','default','flatMap','body','rangeId','replies','OpenOrReOpen','858498VtTpfH','comment','string','map','pluginName','getOwnPropertyDescriptor','_initDataSource','Comment\x20service\x20failed\x20to\x20list\x20comments','userId','decorate','stringify','getUnit'];_0x17f6=function(){return _0x71e5c3;};return _0x17f6();}function N(_0x1c1ce0,_0x314a79){const _0xab31e3=_0x4b6787;let _0x6a51e5=Number(_0x1c1ce0==null?void 0x0:_0x1c1ce0['createTimestamp']);return!!(_0x1c1ce0&&_0x1c1ce0['replyId']&&_0x1c1ce0[_0xab31e3(0x217)]===_0x314a79&&_0x1c1ce0['userId']&&Number['isFinite'](_0x6a51e5)&&_0x6a51e5>0x0);}function P(_0xda1c8c,_0x29e852){const _0x4d3b4a=_0x4b6787;let _0x3bf116=_0xda1c8c[_0x4d3b4a(0x206)][0x0];if(!_0xda1c8c[_0x4d3b4a(0x217)]||!N(_0x3bf116,_0xda1c8c[_0x4d3b4a(0x217)]))throw Error(_0x4d3b4a(0x22f));return{..._0x29e852,'id':_0x3bf116[_0x4d3b4a(0x1d9)],'resolved':_0xda1c8c['solved']===0x1,'dT':D(_0x3bf116['createTimestamp']),'personId':_0x3bf116['userId'],'threadId':_0x3bf116['threadId']};}function F(_0x28f089,_0x456788,_0x11369d,_0x38f7d7){const _0x117db2=_0x4b6787;if((_0x28f089==null?void 0x0:_0x28f089[_0x117db2(0x217)])===_0x456788&&_0x28f089['replies'][_0x117db2(0x1f9)]>0x0){let _0x254d72=(_0x193a2b,_0x1bf45f)=>{const _0x5d74ad=_0x117db2;if(!N(_0x193a2b,_0x456788))return null;let _0x250209=O(_0x193a2b[_0x5d74ad(0x1db)]);return _0x250209?{'id':_0x193a2b['replyId'],'threadId':_0x193a2b[_0x5d74ad(0x217)],'dT':D(_0x193a2b['createTimestamp']),'personId':_0x193a2b['userId'],'resolved':_0x28f089[_0x5d74ad(0x1f7)]===_0x4dc009[_0x5d74ad(0x1e1)],'unitId':_0x11369d,'subUnitId':_0x38f7d7,'text':_0x250209,'parentId':_0x1bf45f}:null;},_0x2cb2a8=_0x254d72(_0x28f089[_0x117db2(0x206)][0x0]);if(!_0x2cb2a8)return null;let _0x2e6e8b=new Set([_0x2cb2a8['id']]),_0x371cbe=_0x28f089[_0x117db2(0x206)][_0x117db2(0x21c)](0x1)[_0x117db2(0x203)](_0x555eb4=>{const _0x29866b=_0x117db2;let _0x4a6469=_0x254d72(_0x555eb4,_0x2cb2a8['id']);return!_0x4a6469||_0x2e6e8b['has'](_0x4a6469['id'])?[]:(_0x2e6e8b[_0x29866b(0x1d5)](_0x4a6469['id']),[_0x4a6469]);});return{..._0x2cb2a8,'children':_0x371cbe};}return null;}let I=class{constructor(_0x3c7b11,_0x19f740,_0x4d8288){const _0x5590a1=_0x4b6787;this[_0x5590a1(0x241)]=_0x3c7b11,this[_0x5590a1(0x242)]=_0x19f740,this['_sessionService']=_0x4d8288;}async['addComment'](_0x5e40f7){const _0x19523b=_0x4b6787;var _0x459e8e;let {parentId:_0xac8312,unitId:_0x11958c,text:_0x330e30,threadId:_0x3f7374}=_0x5e40f7,_0x48d474=((_0x459e8e=_0x330e30[_0x19523b(0x1eb)])==null?void 0x0:_0x459e8e[_0x19523b(0x223)](_0x2a7d57=>_0x2a7d57[_0x19523b(0x224)]===_0x12a057[_0x19523b(0x1e4)])[_0x19523b(0x20b)](_0x1d58af=>_0x1d58af[_0x19523b(0x205)]))??[],_0x2f0dc9=JSON[_0x19523b(0x212)](_0x330e30),_0x17c4e8=(await this[_0x19523b(0x1d7)][_0x19523b(0x248)](_0x11958c))['getMemberID']();if(_0xac8312){let _0xbea85f={'memberId':_0x17c4e8,'unitId':_0x11958c,'content':_0x2f0dc9,'mention':_0x48d474,'threadId':_0x3f7374},_0x1c7665=await this['_httpService']['post'](_0x19523b(0x200)+_0x11958c+_0x19523b(0x218),{'body':_0xbea85f}),_0x4f9c2a=_0x1c7665[_0x19523b(0x204)][_0x19523b(0x231)];if(_0x1c7665[_0x19523b(0x204)][_0x19523b(0x1df)]&&_0x1c7665[_0x19523b(0x204)]['error'][_0x19523b(0x243)]!==0x1||!N(_0x4f9c2a,_0x3f7374)){var _0x40a743;throw Error(((_0x40a743=_0x1c7665[_0x19523b(0x204)][_0x19523b(0x1df)])==null?void 0x0:_0x40a743[_0x19523b(0x22b)])??_0x19523b(0x1dd));}return{..._0x5e40f7,'id':_0x4f9c2a['replyId'],'dT':_0x4d5352(+_0x4f9c2a[_0x19523b(0x1e6)])[_0x19523b(0x221)](_0x19523b(0x1e8)),'personId':_0x4f9c2a[_0x19523b(0x210)]};}else{let _0x49d4bd={'memberId':_0x17c4e8,'unitId':_0x11958c,'content':_0x2f0dc9,'mention':_0x48d474},_0x39a7ba=await this[_0x19523b(0x241)][_0x19523b(0x226)](_0x19523b(0x200)+_0x11958c+'/add',{'body':_0x49d4bd});if(_0x39a7ba['body'][_0x19523b(0x1df)]&&_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x1df)]['code']!==0x1||!_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x209)]){var _0x1a78d4;throw Error(((_0x1a78d4=_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x1df)])==null?void 0x0:_0x1a78d4[_0x19523b(0x22b)])??_0x19523b(0x1fe));}return P(_0x39a7ba[_0x19523b(0x204)][_0x19523b(0x209)],_0x5e40f7);}}async[_0x4b6787(0x23d)](_0x37e6c2){const _0x262cb1=_0x4b6787;var _0x472ce2;let {text:_0x2a2999,unitId:_0x39f11b}=_0x37e6c2,_0x2524b8=((_0x472ce2=_0x2a2999['customRanges'])==null?void 0x0:_0x472ce2[_0x262cb1(0x223)](_0x7dafa4=>_0x7dafa4[_0x262cb1(0x224)]===_0x12a057[_0x262cb1(0x1e4)])[_0x262cb1(0x20b)](_0x28eecb=>_0x28eecb[_0x262cb1(0x205)]))??[],_0x3b4bf4=JSON[_0x262cb1(0x212)](_0x2a2999),_0x3c3639=_0x37e6c2[_0x262cb1(0x217)],_0x2846eb=_0x37e6c2['id'],_0x1a51ca={'memberId':(await this[_0x262cb1(0x1d7)][_0x262cb1(0x248)](_0x39f11b))[_0x262cb1(0x214)](),'unitId':_0x39f11b,'threadId':_0x3c3639,'mention':_0x2524b8,'content':_0x3b4bf4,'replyId':_0x2846eb},_0x31863f=await this['_httpService'][_0x262cb1(0x226)](_0x262cb1(0x200)+_0x39f11b+'/edit',{'body':_0x1a51ca});return!_0x31863f[_0x262cb1(0x204)][_0x262cb1(0x1df)]||_0x31863f['body'][_0x262cb1(0x1df)][_0x262cb1(0x243)]===0x1;}async[_0x4b6787(0x1e0)](_0x48c1df){const _0x2baae9=_0x4b6787;let {unitId:_0x515954}=_0x48c1df,_0x2ae123=_0x48c1df[_0x2baae9(0x217)],_0x36c552={'memberId':(await this[_0x2baae9(0x1d7)]['requireSession'](_0x515954))[_0x2baae9(0x214)](),'unitId':_0x515954,'threadId':_0x2ae123,'solved':_0x48c1df['resolved']?_0x4dc009['Solved']:_0x4dc009['OpenOrReOpen']},_0x4f6ebe=await this[_0x2baae9(0x241)][_0x2baae9(0x226)](_0x2baae9(0x200)+_0x515954+_0x2baae9(0x233),{'body':_0x36c552});return!_0x4f6ebe[_0x2baae9(0x204)]['error']||_0x4f6ebe[_0x2baae9(0x204)][_0x2baae9(0x1df)][_0x2baae9(0x243)]===0x1;}[_0x4b6787(0x240)](_0x45e2c2,_0x395b27,_0x5031cd,_0x565a9f){const _0x3265d2=_0x4b6787;return this[_0x3265d2(0x236)](_0x45e2c2,_0x5031cd,_0x565a9f);}['deleteThread'](_0xe73d56,_0xa6fa09,_0x1776c8){const _0x3c1a10=_0x4b6787;return this[_0x3c1a10(0x236)](_0xe73d56,_0x1776c8);}async[_0x4b6787(0x236)](_0x3332a9,_0x555228,_0x98e0eb){const _0x17e5d7=_0x4b6787;let _0x2b42a0={'memberId':(await this[_0x17e5d7(0x1d7)][_0x17e5d7(0x248)](_0x3332a9))['getMemberID'](),'threadId':_0x555228,'replyId':_0x98e0eb,'unitId':_0x3332a9},_0x1fa272=await this[_0x17e5d7(0x241)][_0x17e5d7(0x226)](_0x17e5d7(0x200)+_0x3332a9+_0x17e5d7(0x1ea),{'body':_0x2b42a0});return!_0x1fa272[_0x17e5d7(0x204)][_0x17e5d7(0x1df)]||_0x1fa272[_0x17e5d7(0x204)][_0x17e5d7(0x1df)][_0x17e5d7(0x243)]===0x1;}async[_0x4b6787(0x1f0)](_0x2978b2,_0x47a7ff,_0x84b068){const _0x54c64f=_0x4b6787;let _0x20ed44={'unitId':_0x2978b2,'threadId':_0x84b068},_0x341fd7=await this[_0x54c64f(0x241)]['post']('/universer-api/comment/unit/'+_0x2978b2+_0x54c64f(0x1f5),{'body':_0x20ed44});if(_0x341fd7[_0x54c64f(0x204)]['error']&&_0x341fd7['body'][_0x54c64f(0x1df)]['code']!==0x1)throw Error(_0x341fd7[_0x54c64f(0x204)][_0x54c64f(0x1df)]['message']||_0x54c64f(0x20f));let _0x11ba46=_0x84b068[_0x54c64f(0x20b)](_0x5319ed=>{const _0x469344=_0x54c64f;var _0x12fc60;return F((_0x12fc60=_0x341fd7['body'][_0x469344(0x1e3)])==null?void 0x0:_0x12fc60[_0x5319ed],_0x5319ed,_0x2978b2,_0x47a7ff);})['filter'](Boolean);return Object[_0x54c64f(0x239)](_0x341fd7[_0x54c64f(0x204)][_0x54c64f(0x1fb)]??{})[_0x54c64f(0x201)](_0x5b4153=>{const _0x377ea8=_0x54c64f;this['_userService'][_0x377ea8(0x1f6)](_0x5b4153);}),_0x11ba46;}[_0x4b6787(0x1ed)](_0x117b79){const _0x5e3960=_0x4b6787;return{'id':_0x117b79['id'],'threadId':_0x117b79[_0x5e3960(0x217)],'ref':_0x117b79[_0x5e3960(0x232)]};}};I=j([A(0x0,_0x3b3332(_0x47d19f)),A(0x1,_0x3b3332(_0x433e94)),A(0x2,_0x3b3332(_0x1ae4d4))],I);let L=class extends _0x1cf564{constructor(_0x1e971a,_0x1e118d){const _0x35e610=_0x4b6787;super(),this['_threadCommentDataSourceService']=_0x1e971a,this[_0x35e610(0x1e7)]=_0x1e118d,this[_0x35e610(0x20e)]();}[_0x4b6787(0x20e)](){const _0x1eb003=_0x4b6787;this[_0x1eb003(0x220)][_0x1eb003(0x1de)]=this['_threadCommentDataSource'],this[_0x1eb003(0x220)][_0x1eb003(0x23f)]=!0x1;}};L=j([A(0x0,_0x2aa24e),A(0x1,_0x3b3332(I))],L);function R(_0x4a4deb){'@babel/helpers - typeof';const _0x5a1880=_0x4b6787;return R=typeof Symbol==_0x5a1880(0x234)&&typeof Symbol['iterator']==_0x5a1880(0x21d)?function(_0x2a4d6c){return typeof _0x2a4d6c;}:function(_0x1c764e){const _0x4ee0fd=_0x5a1880;return _0x1c764e&&typeof Symbol==_0x4ee0fd(0x234)&&_0x1c764e[_0x4ee0fd(0x1ff)]===Symbol&&_0x1c764e!==Symbol[_0x4ee0fd(0x1f1)]?'symbol':typeof _0x1c764e;},R(_0x4a4deb);}function z(_0x29b24d,_0x58c2d2){const _0x1ef6c4=_0x4b6787;if(R(_0x29b24d)!='object'||!_0x29b24d)return _0x29b24d;var _0x53ad8c=_0x29b24d[Symbol[_0x1ef6c4(0x227)]];if(_0x53ad8c!==void 0x0){var _0x475116=_0x53ad8c[_0x1ef6c4(0x244)](_0x29b24d,_0x58c2d2||_0x1ef6c4(0x202));if(R(_0x475116)!='object')return _0x475116;throw TypeError(_0x1ef6c4(0x222));}return(_0x58c2d2===_0x1ef6c4(0x20a)?String:Number)(_0x29b24d);}function B(_0xd537a6){const _0x1168e0=_0x4b6787;var _0x161e54=z(_0xd537a6,_0x1168e0(0x20a));return R(_0x161e54)=='symbol'?_0x161e54:_0x161e54+'';}function V(_0x2c0890,_0x3848da,_0x3bf08d){const _0x14d7a3=_0x4b6787;return(_0x3848da=B(_0x3848da))in _0x2c0890?Object[_0x14d7a3(0x235)](_0x2c0890,_0x3848da,{'value':_0x3bf08d,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2c0890[_0x3848da]=_0x3bf08d,_0x2c0890;}let H=class extends _0x3d0ed6{constructor(_0x236045=E,_0x478960,_0xbc9fe1){const _0x231eff=_0x4b6787;super(),this[_0x231eff(0x1d4)]=_0x236045,this[_0x231eff(0x23c)]=_0x478960,this['_configService']=_0xbc9fe1;let {..._0xda2307}=_0x3d3724({},E,this['_config']);this[_0x231eff(0x216)]['setConfig']('thread-comment-data-source.config',_0xda2307);}[_0x4b6787(0x1f4)](){const _0x13a1a4=_0x4b6787;[[I],[L],[M]][_0x13a1a4(0x201)](_0x3e406e=>{const _0x3c8cbc=_0x13a1a4;this[_0x3c8cbc(0x23c)][_0x3c8cbc(0x1d5)](_0x3e406e);});}['onReady'](){const _0x437bbe=_0x4b6787;this[_0x437bbe(0x23c)][_0x437bbe(0x230)](L),this[_0x437bbe(0x23c)][_0x437bbe(0x230)](M);}};V(H,_0x4b6787(0x20c),'UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN'),V(H,_0x4b6787(0x1ee),w),V(H,'version',T),H=j([_0x4ea591(_0x3e8bc8,_0xf573f8,_0x122edc,_0xf23f6f,_0x535258),A(0x1,_0x3b3332(_0x3d6580)),A(0x2,_0x51ba67)],H);export{H as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x2c160b=_0x25fe;(function(_0x13736a,_0x1e430d){const _0x26db5e=_0x25fe,_0xcfef00=_0x13736a();while(!![]){try{const _0xb7fe0a=-parseInt(_0x26db5e(0x15a))/0x1*(parseInt(_0x26db5e(0x14e))/0x2)+-parseInt(_0x26db5e(0x136))/0x3+parseInt(_0x26db5e(0x15e))/0x4+-parseInt(_0x26db5e(0x14c))/0x5+parseInt(_0x26db5e(0x14f))/0x6+parseInt(_0x26db5e(0x15d))/0x7+-parseInt(_0x26db5e(0x13b))/0x8;if(_0xb7fe0a===_0x1e430d)break;else _0xcfef00['push'](_0xcfef00['shift']());}catch(_0x371c52){_0xcfef00['push'](_0xcfef00['shift']());}}}(_0x3892,0x3799c));import{CollaborationSessionService as _0x51d608,CommentService as _0x5e0b6b,UniverCollaborationClientPlugin as _0x4a9289}from'@univerjs-pro/collaboration-client';function _0x3892(){const _0x4d1c63=['Edit','createTimestamp','getUnit','deleteThread','post','319yvzrxU','function','some','2692081XiaqDj','1730188WyqOGz','_resolveComment','comment','stringify','get','flatMap','deleteComment','OpenOrReOpen','_init','/universer-api/user/list','solved','parentId','getUser','requireSession','iterator','_httpService','getOwnPropertyDescriptor','pluginName','slice','default','message','users','_sessionService','userId','/add','commentUpdate$','map','/universer-api/comment/unit/','rangeType','/solved','_initDataSource','prototype','customRanges','payload','symbol','/delete','_injector','Comment\x20service\x20failed\x20to\x20list\x20comments','addComment','string','unitId','user','_deleteComment','packageName','length','format','COMMENT','_config','object','constructor','_userService','reply','_commentService','/edit','resolveComment','userID','children','replyId','onReady','Solve','saveCommentToSnapshot','_threadCommentDataSource','root','/list','_threadCommentModel','body','_initUserSync','authorName','comments','ref','defineProperty','parse','Delete','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply','toPrimitive','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','1203705ytjYQY','disposeWithMe','_configService','rangeId','call','1136952GromKW','Comment\x20service\x20returned\x20an\x20invalid\x20thread','filter','error','forEach','content','syncUpdateMutationToColla','replies','Solved','decorate','subscribe','addUser','threadId','type','resolved','getMemberID','code','67695KLdUyu','getComment','2572CuXMul','2266422lwShdS','add','_threadCommentDataSourceService','values','delete','personId'];_0x3892=function(){return _0x4d1c63;};return _0x3892();}import{UniverLicensePlugin as _0x148c8f}from'@univerjs-pro/license';import{CustomRangeType as _0x4feba4,DependentOn as _0x122467,Disposable as _0x566060,IConfigService as _0x476ac6,Inject as _0x260cda,Injector as _0x29c905,Plugin as _0x5b3733,UserManagerService as _0xc8664e,dateKit as _0x39b695,merge as _0x627b99}from'@univerjs/core';function _0x25fe(_0x404132,_0x2fab86){_0x404132=_0x404132-0x127;const _0x3892a6=_0x3892();let _0x25fe3d=_0x3892a6[_0x404132];return _0x25fe3d;}import{HTTPService as _0x3efbde,UniverNetworkPlugin as _0x4ea40a}from'@univerjs/network';import{IThreadCommentDataSourceService as _0x1a2de3,ThreadCommentModel as _0x597175,UniverThreadCommentPlugin as _0x5f3cde,isThreadCommentDocumentBody as _0x448839}from'@univerjs/thread-comment';import{UniverThreadCommentUIPlugin as _0x56d8be}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x3036ad,CommentUpdateEventType as _0x149475}from'@univerjs/protocol';import{bufferTime as _0x1cf1fc}from'rxjs';var w='@univerjs-pro/thread-comment-datasource',T='1.0.0';const E={},D=_0x178cc1=>_0x39b695(new Date(+_0x178cc1))['format']('YYYY/MM/DD\x20HH:mm');function O(_0x418d19){const _0x37aeb7=_0x25fe;if(!_0x418d19)return null;try{let _0x2d1b5d=JSON[_0x37aeb7(0x131)](_0x418d19);return _0x448839(_0x2d1b5d)?_0x2d1b5d:null;}catch{return null;}}const k=async(_0x1f18d9,_0x2d62cd)=>{const _0x47b48a=_0x25fe;let _0x2c71b6=_0x1f18d9[_0x47b48a(0x162)](_0xc8664e),_0x11d274=_0x1f18d9[_0x47b48a(0x162)](_0x3efbde);_0x2d62cd[_0x47b48a(0x13f)](_0x18aa2a=>{const _0x1064f8=_0x47b48a;_0x2c71b6[_0x1064f8(0x16a)](_0x18aa2a)&&_0x2d62cd[_0x1064f8(0x153)](_0x18aa2a);}),_0x2d62cd['size']&&(await _0x11d274[_0x47b48a(0x162)](_0x47b48a(0x167),{'params':{'userIDs':[..._0x2d62cd]}}))[_0x47b48a(0x12b)][_0x47b48a(0x173)][_0x47b48a(0x13f)](_0x4d2777=>{_0x4d2777&&_0x2c71b6['addUser'](_0x4d2777);});};function A(_0x177e93,_0x2fd586){return function(_0x37a172,_0x2fa1d1){_0x2fd586(_0x37a172,_0x2fa1d1,_0x177e93);};}function j(_0x22b140,_0x5a823c,_0x8c4f8c,_0x2bfce2){const _0x5f5a45=_0x25fe;var _0xaea3b=arguments['length'],_0x1cea27=_0xaea3b<0x3?_0x5a823c:_0x2bfce2===null?_0x2bfce2=Object[_0x5f5a45(0x16e)](_0x5a823c,_0x8c4f8c):_0x2bfce2,_0x161439;if(typeof Reflect==_0x5f5a45(0x18e)&&typeof Reflect[_0x5f5a45(0x144)]=='function')_0x1cea27=Reflect[_0x5f5a45(0x144)](_0x22b140,_0x5a823c,_0x8c4f8c,_0x2bfce2);else{for(var _0x2dd6b8=_0x22b140[_0x5f5a45(0x18a)]-0x1;_0x2dd6b8>=0x0;_0x2dd6b8--)(_0x161439=_0x22b140[_0x2dd6b8])&&(_0x1cea27=(_0xaea3b<0x3?_0x161439(_0x1cea27):_0xaea3b>0x3?_0x161439(_0x5a823c,_0x8c4f8c,_0x1cea27):_0x161439(_0x5a823c,_0x8c4f8c))||_0x1cea27);}return _0xaea3b>0x3&&_0x1cea27&&Object[_0x5f5a45(0x130)](_0x5a823c,_0x8c4f8c,_0x1cea27),_0x1cea27;}let M=class extends _0x566060{constructor(_0x5e0cbe,_0x37715f,_0x46b149,_0x511df4){const _0x35fb17=_0x25fe;super(),this['_commentService']=_0x5e0cbe,this[_0x35fb17(0x12a)]=_0x37715f,this[_0x35fb17(0x190)]=_0x46b149,this['_injector']=_0x511df4,this[_0x35fb17(0x166)](),this[_0x35fb17(0x12c)]();}['_initUserSync'](){const _0x58a371=_0x25fe;this[_0x58a371(0x137)](this[_0x58a371(0x12a)][_0x58a371(0x177)]['pipe'](_0x1cf1fc(0x10))[_0x58a371(0x145)](_0x3d578f=>{const _0x1a0134=_0x58a371;let _0x3aecbf=new Set();_0x3d578f[_0x1a0134(0x13f)](_0x56f23d=>{const _0x54b755=_0x1a0134;switch(_0x56f23d['type']){case _0x54b755(0x150):{let _0x1878d9=_0x56f23d[_0x54b755(0x17f)][_0x54b755(0x154)];_0x3aecbf[_0x54b755(0x150)](_0x1878d9);break;}}}),k(this['_injector'],_0x3aecbf);}));}[_0x2c160b(0x188)](_0x2cae83,_0x330935,_0x367862){const _0x13e783=_0x2c160b;let _0x23a533=this['_threadCommentModel'][_0x13e783(0x14d)](_0x2cae83,_0x330935,_0x367862);_0x23a533&&(_0x23a533[_0x13e783(0x169)]?this[_0x13e783(0x12a)][_0x13e783(0x164)](_0x2cae83,_0x330935,_0x367862):this[_0x13e783(0x12a)][_0x13e783(0x158)](_0x2cae83,_0x330935,_0x23a533[_0x13e783(0x147)]));}['_resolveComment'](_0x4fe58b,_0x2e9bfc,_0x4531f3,_0x1cca4f){const _0x54b47d=_0x2c160b;(_0x1cca4f===_0x3036ad[_0x54b47d(0x143)]||_0x1cca4f===_0x3036ad[_0x54b47d(0x165)])&&this[_0x54b47d(0x12a)][_0x54b47d(0x194)](_0x4fe58b,_0x2e9bfc,_0x4531f3,_0x1cca4f===_0x3036ad[_0x54b47d(0x143)]);}[_0x2c160b(0x166)](){const _0x51bfbf=_0x2c160b;this[_0x51bfbf(0x137)](this[_0x51bfbf(0x192)]['commentUpdate$']['subscribe'](_0x28d611=>{const _0x5df3f1=_0x51bfbf;var _0x59f5ba;let _0x5d4ee9=(_0x59f5ba=this[_0x5df3f1(0x12a)][_0x5df3f1(0x157)](_0x28d611[_0x5df3f1(0x186)])['find'](_0x110c0c=>_0x110c0c[_0x5df3f1(0x147)]===_0x28d611[_0x5df3f1(0x147)]))==null?void 0x0:_0x59f5ba[_0x5df3f1(0x128)];if(!_0x5d4ee9)return;let {unitId:_0x3e744d,subUnitId:_0x8f76a7}=_0x5d4ee9;switch(_0x28d611[_0x5df3f1(0x187)]&&this[_0x5df3f1(0x190)][_0x5df3f1(0x146)](_0x28d611[_0x5df3f1(0x187)]),_0x28d611[_0x5df3f1(0x148)]){case _0x149475['Reply']:{var _0x3959f0;let _0x175aa4=O(_0x28d611[_0x5df3f1(0x140)]);if(!_0x28d611[_0x5df3f1(0x197)]||!_0x28d611[_0x5df3f1(0x156)]||!_0x175aa4)return;this[_0x5df3f1(0x12a)][_0x5df3f1(0x184)](_0x3e744d,_0x8f76a7,{'unitId':_0x3e744d,'subUnitId':_0x8f76a7,'ref':'','id':_0x28d611['replyId'],'dT':D(+_0x28d611[_0x5df3f1(0x156)]),'threadId':_0x28d611[_0x5df3f1(0x147)],'personId':((_0x3959f0=_0x28d611[_0x5df3f1(0x187)])==null?void 0x0:_0x3959f0[_0x5df3f1(0x195)])??_0x28d611[_0x5df3f1(0x175)],'text':_0x175aa4,'parentId':_0x5d4ee9['id']});break;}case _0x149475[_0x5df3f1(0x132)]:if(!_0x28d611['replyId']){this[_0x5df3f1(0x12a)][_0x5df3f1(0x158)](_0x3e744d,_0x8f76a7,_0x5d4ee9[_0x5df3f1(0x147)]);break;}this[_0x5df3f1(0x188)](_0x3e744d,_0x8f76a7,_0x28d611[_0x5df3f1(0x197)]);break;case _0x149475[_0x5df3f1(0x155)]:{let _0x15373d=O(_0x28d611[_0x5df3f1(0x140)]);if(!_0x28d611[_0x5df3f1(0x197)]||!_0x15373d)return;this['_threadCommentModel']['updateComment'](_0x3e744d,_0x8f76a7,{'commentId':_0x28d611[_0x5df3f1(0x197)],'text':_0x15373d});break;}case _0x149475[_0x5df3f1(0x199)]:this[_0x5df3f1(0x15f)](_0x3e744d,_0x8f76a7,_0x5d4ee9['id'],_0x28d611[_0x5df3f1(0x168)]);}}));}};M=j([A(0x0,_0x260cda(_0x5e0b6b)),A(0x1,_0x260cda(_0x597175)),A(0x2,_0x260cda(_0xc8664e)),A(0x3,_0x260cda(_0x29c905))],M);function N(_0x3dcb98,_0x411a15){const _0x1ba9b4=_0x2c160b;let _0x555ee8=Number(_0x3dcb98==null?void 0x0:_0x3dcb98[_0x1ba9b4(0x156)]);return!!(_0x3dcb98&&_0x3dcb98['replyId']&&_0x3dcb98['threadId']===_0x411a15&&_0x3dcb98['userId']&&Number['isFinite'](_0x555ee8)&&_0x555ee8>0x0);}function P(_0x43b985,_0x2ba9a8){const _0x2a4ebd=_0x2c160b;let _0x4f39f9=_0x43b985[_0x2a4ebd(0x142)][0x0];if(!_0x43b985[_0x2a4ebd(0x147)]||!N(_0x4f39f9,_0x43b985[_0x2a4ebd(0x147)]))throw Error(_0x2a4ebd(0x13c));return{..._0x2ba9a8,'id':_0x4f39f9['replyId'],'resolved':_0x43b985[_0x2a4ebd(0x168)]===0x1,'dT':D(_0x4f39f9['createTimestamp']),'personId':_0x4f39f9[_0x2a4ebd(0x175)],'threadId':_0x4f39f9[_0x2a4ebd(0x147)]};}function F(_0x23e729,_0x2d977e,_0x896c09,_0x51fa6f){const _0x30d382=_0x2c160b;if((_0x23e729==null?void 0x0:_0x23e729[_0x30d382(0x147)])===_0x2d977e&&_0x23e729[_0x30d382(0x142)][_0x30d382(0x18a)]>0x0){let _0x4f5a9a=(_0x304ffb,_0x5a2f24)=>{const _0x57dff7=_0x30d382;if(!N(_0x304ffb,_0x2d977e))return null;let _0x2b04e6=O(_0x304ffb[_0x57dff7(0x140)]);return _0x2b04e6?{'id':_0x304ffb[_0x57dff7(0x197)],'threadId':_0x304ffb[_0x57dff7(0x147)],'dT':D(_0x304ffb[_0x57dff7(0x156)]),'personId':_0x304ffb[_0x57dff7(0x175)],'resolved':_0x23e729['solved']===_0x3036ad['Solved'],'unitId':_0x896c09,'subUnitId':_0x51fa6f,'text':_0x2b04e6,'parentId':_0x5a2f24}:null;},_0x10d0ba=_0x4f5a9a(_0x23e729[_0x30d382(0x142)][0x0]);if(!_0x10d0ba)return null;let _0x266fb1=new Set([_0x10d0ba['id']]),_0x57b7b5=_0x23e729['replies'][_0x30d382(0x170)](0x1)[_0x30d382(0x163)](_0x2963b4=>{const _0x466ddc=_0x30d382;let _0x223df2=_0x4f5a9a(_0x2963b4,_0x10d0ba['id']);return!_0x223df2||_0x266fb1['has'](_0x223df2['id'])?[]:(_0x266fb1[_0x466ddc(0x150)](_0x223df2['id']),[_0x223df2]);});return{..._0x10d0ba,'children':_0x57b7b5};}return null;}let I=class{constructor(_0x44c122,_0x374ecb,_0x589b43){const _0x21c14=_0x2c160b;this[_0x21c14(0x16d)]=_0x44c122,this[_0x21c14(0x190)]=_0x374ecb,this[_0x21c14(0x174)]=_0x589b43;}async[_0x2c160b(0x184)](_0x3fc777){const _0x1d133d=_0x2c160b;var _0xfdb54a;let {parentId:_0x147623,unitId:_0xe6856b,text:_0x700d5d,threadId:_0x95d867}=_0x3fc777,_0x26f87a=((_0xfdb54a=_0x700d5d['customRanges'])==null?void 0x0:_0xfdb54a[_0x1d133d(0x13d)](_0x3dfe62=>_0x3dfe62['rangeType']===_0x4feba4[_0x1d133d(0x18c)])[_0x1d133d(0x178)](_0x452022=>_0x452022[_0x1d133d(0x139)]))??[],_0x486262=JSON[_0x1d133d(0x161)](_0x700d5d),_0x170fbe=(await this['_sessionService'][_0x1d133d(0x16b)](_0xe6856b))[_0x1d133d(0x14a)]();if(_0x147623){let _0x5d5fee={'memberId':_0x170fbe,'unitId':_0xe6856b,'content':_0x486262,'mention':_0x26f87a,'threadId':_0x95d867},_0x5a414c=await this[_0x1d133d(0x16d)][_0x1d133d(0x159)](_0x1d133d(0x179)+_0xe6856b+'/reply',{'body':_0x5d5fee}),_0x9725a7=_0x5a414c[_0x1d133d(0x12b)][_0x1d133d(0x191)];if(_0x5a414c['body'][_0x1d133d(0x13e)]&&_0x5a414c[_0x1d133d(0x12b)][_0x1d133d(0x13e)][_0x1d133d(0x14b)]!==0x1||!N(_0x9725a7,_0x95d867)){var _0x301547;throw Error(((_0x301547=_0x5a414c['body'][_0x1d133d(0x13e)])==null?void 0x0:_0x301547[_0x1d133d(0x172)])??_0x1d133d(0x133));}return{..._0x3fc777,'id':_0x9725a7['replyId'],'dT':_0x39b695(+_0x9725a7['createTimestamp'])[_0x1d133d(0x18b)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x9725a7[_0x1d133d(0x175)]};}{let _0x52d70d={'memberId':_0x170fbe,'unitId':_0xe6856b,'content':_0x486262,'mention':_0x26f87a},_0x14e0da=await this[_0x1d133d(0x16d)][_0x1d133d(0x159)](_0x1d133d(0x179)+_0xe6856b+_0x1d133d(0x176),{'body':_0x52d70d});if(_0x14e0da['body']['error']&&_0x14e0da[_0x1d133d(0x12b)]['error'][_0x1d133d(0x14b)]!==0x1||!_0x14e0da[_0x1d133d(0x12b)]['comment']){var _0x3b2fa9;throw Error(((_0x3b2fa9=_0x14e0da[_0x1d133d(0x12b)][_0x1d133d(0x13e)])==null?void 0x0:_0x3b2fa9[_0x1d133d(0x172)])??'Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment');}return P(_0x14e0da[_0x1d133d(0x12b)][_0x1d133d(0x160)],_0x3fc777);}}async['updateComment'](_0x32d432){const _0x5531cc=_0x2c160b;var _0x544be6;let {text:_0x3bb358,unitId:_0x3e6966}=_0x32d432,_0x2110bf=((_0x544be6=_0x3bb358[_0x5531cc(0x17e)])==null?void 0x0:_0x544be6[_0x5531cc(0x13d)](_0x472d5e=>_0x472d5e[_0x5531cc(0x17a)]===_0x4feba4[_0x5531cc(0x18c)])[_0x5531cc(0x178)](_0x3fd038=>_0x3fd038[_0x5531cc(0x139)]))??[],_0xc9e5a2=JSON[_0x5531cc(0x161)](_0x3bb358),_0x50e1ae=_0x32d432['threadId'],_0xc2ab4b=_0x32d432['id'],_0x4e9976={'memberId':(await this[_0x5531cc(0x174)][_0x5531cc(0x16b)](_0x3e6966))[_0x5531cc(0x14a)](),'unitId':_0x3e6966,'threadId':_0x50e1ae,'mention':_0x2110bf,'content':_0xc9e5a2,'replyId':_0xc2ab4b},_0x8d9235=await this[_0x5531cc(0x16d)][_0x5531cc(0x159)]('/universer-api/comment/unit/'+_0x3e6966+_0x5531cc(0x193),{'body':_0x4e9976});return!_0x8d9235[_0x5531cc(0x12b)][_0x5531cc(0x13e)]||_0x8d9235['body']['error'][_0x5531cc(0x14b)]===0x1;}async[_0x2c160b(0x194)](_0x7a71c0){const _0x22e4cf=_0x2c160b;let {unitId:_0xc3e85c}=_0x7a71c0,_0x40dfe6=_0x7a71c0[_0x22e4cf(0x147)],_0x4dd233={'memberId':(await this[_0x22e4cf(0x174)][_0x22e4cf(0x16b)](_0xc3e85c))[_0x22e4cf(0x14a)](),'unitId':_0xc3e85c,'threadId':_0x40dfe6,'solved':_0x7a71c0[_0x22e4cf(0x149)]?_0x3036ad[_0x22e4cf(0x143)]:_0x3036ad[_0x22e4cf(0x165)]},_0x143f1d=await this[_0x22e4cf(0x16d)][_0x22e4cf(0x159)]('/universer-api/comment/unit/'+_0xc3e85c+_0x22e4cf(0x17b),{'body':_0x4dd233});return!_0x143f1d[_0x22e4cf(0x12b)]['error']||_0x143f1d[_0x22e4cf(0x12b)][_0x22e4cf(0x13e)][_0x22e4cf(0x14b)]===0x1;}[_0x2c160b(0x164)](_0x12896b,_0x3058bb,_0x20e7e0,_0x4d762b){const _0x4e676e=_0x2c160b;return this[_0x4e676e(0x188)](_0x12896b,_0x20e7e0,_0x4d762b);}[_0x2c160b(0x158)](_0x1abe31,_0x42f26d,_0x522fc6){const _0x2bf1b0=_0x2c160b;return this[_0x2bf1b0(0x188)](_0x1abe31,_0x522fc6);}async[_0x2c160b(0x188)](_0x63eeee,_0x146f68,_0x498b34){const _0x353621=_0x2c160b;let _0x328cc6={'memberId':(await this[_0x353621(0x174)][_0x353621(0x16b)](_0x63eeee))[_0x353621(0x14a)](),'threadId':_0x146f68,'replyId':_0x498b34,'unitId':_0x63eeee},_0x48e3a0=await this[_0x353621(0x16d)][_0x353621(0x159)](_0x353621(0x179)+_0x63eeee+_0x353621(0x181),{'body':_0x328cc6});return!_0x48e3a0[_0x353621(0x12b)][_0x353621(0x13e)]||_0x48e3a0[_0x353621(0x12b)]['error'][_0x353621(0x14b)]===0x1;}async['listComments'](_0x85b211,_0x1870fe,_0x9861d0){const _0x3fb90c=_0x2c160b;let _0x151ed2={'unitId':_0x85b211,'threadId':_0x9861d0},_0x5f0d65=await this[_0x3fb90c(0x16d)]['post'](_0x3fb90c(0x179)+_0x85b211+_0x3fb90c(0x129),{'body':_0x151ed2});if(_0x5f0d65[_0x3fb90c(0x12b)][_0x3fb90c(0x13e)]&&_0x5f0d65['body'][_0x3fb90c(0x13e)][_0x3fb90c(0x14b)]!==0x1)throw Error(_0x5f0d65[_0x3fb90c(0x12b)]['error'][_0x3fb90c(0x172)]||_0x3fb90c(0x183));let _0x56fa57=_0x9861d0['map'](_0x2146e7=>{const _0x11b9c0=_0x3fb90c;var _0x1ebde8;return F((_0x1ebde8=_0x5f0d65['body'][_0x11b9c0(0x12e)])==null?void 0x0:_0x1ebde8[_0x2146e7],_0x2146e7,_0x85b211,_0x1870fe);})[_0x3fb90c(0x13d)](Boolean);return Object[_0x3fb90c(0x152)](_0x5f0d65['body'][_0x3fb90c(0x173)]??{})[_0x3fb90c(0x13f)](_0x559337=>{this['_userService']['addUser'](_0x559337);}),_0x56fa57;}[_0x2c160b(0x19a)](_0x31052d){const _0x4b6442=_0x2c160b;var _0x453e73;return{'id':_0x31052d['id'],'threadId':_0x31052d['threadId'],'ref':_0x31052d[_0x4b6442(0x12f)],..._0x31052d[_0x4b6442(0x12d)]===void 0x0?{}:{'authorName':_0x31052d[_0x4b6442(0x12d)],'personId':_0x31052d[_0x4b6442(0x154)]},...(_0x453e73=_0x31052d[_0x4b6442(0x196)])!=null&&_0x453e73[_0x4b6442(0x15c)](_0x51d507=>_0x51d507[_0x4b6442(0x12d)]!==void 0x0)?{'children':_0x31052d[_0x4b6442(0x196)][_0x4b6442(0x13d)](_0x5f080a=>_0x5f080a[_0x4b6442(0x12d)]!==void 0x0)[_0x4b6442(0x178)](_0x5c034f=>({'id':_0x5c034f['id'],'threadId':_0x5c034f[_0x4b6442(0x147)],'ref':'','parentId':_0x31052d['id'],'personId':_0x5c034f[_0x4b6442(0x154)],'authorName':_0x5c034f[_0x4b6442(0x12d)]}))}:{}};}};I=j([A(0x0,_0x260cda(_0x3efbde)),A(0x1,_0x260cda(_0xc8664e)),A(0x2,_0x260cda(_0x51d608))],I);let L=class extends _0x566060{constructor(_0x3375ed,_0x1778d7){const _0x40742d=_0x2c160b;super(),this[_0x40742d(0x151)]=_0x3375ed,this[_0x40742d(0x127)]=_0x1778d7,this[_0x40742d(0x17c)]();}['_initDataSource'](){const _0x4ce698=_0x2c160b;this[_0x4ce698(0x151)]['dataSource']=this[_0x4ce698(0x127)],this['_threadCommentDataSourceService'][_0x4ce698(0x141)]=!0x1;}};L=j([A(0x0,_0x1a2de3),A(0x1,_0x260cda(I))],L);function R(_0x2f8273){'@babel/helpers - typeof';const _0x219002=_0x2c160b;return R=typeof Symbol=='function'&&typeof Symbol[_0x219002(0x16c)]==_0x219002(0x180)?function(_0x5065b6){return typeof _0x5065b6;}:function(_0x568bab){const _0x403f98=_0x219002;return _0x568bab&&typeof Symbol==_0x403f98(0x15b)&&_0x568bab[_0x403f98(0x18f)]===Symbol&&_0x568bab!==Symbol[_0x403f98(0x17d)]?_0x403f98(0x180):typeof _0x568bab;},R(_0x2f8273);}function z(_0x18bc94,_0x3ee021){const _0x138c1b=_0x2c160b;if(R(_0x18bc94)!=_0x138c1b(0x18e)||!_0x18bc94)return _0x18bc94;var _0x22b355=_0x18bc94[Symbol[_0x138c1b(0x134)]];if(_0x22b355!==void 0x0){var _0x4d18dd=_0x22b355[_0x138c1b(0x13a)](_0x18bc94,_0x3ee021||_0x138c1b(0x171));if(R(_0x4d18dd)!=_0x138c1b(0x18e))return _0x4d18dd;throw TypeError(_0x138c1b(0x135));}return(_0x3ee021===_0x138c1b(0x185)?String:Number)(_0x18bc94);}function B(_0x3e76b3){const _0x280b3c=_0x2c160b;var _0x33160e=z(_0x3e76b3,_0x280b3c(0x185));return R(_0x33160e)=='symbol'?_0x33160e:_0x33160e+'';}function V(_0x43defc,_0x3b20a8,_0x3a5a37){const _0x31f438=_0x2c160b;return(_0x3b20a8=B(_0x3b20a8))in _0x43defc?Object[_0x31f438(0x130)](_0x43defc,_0x3b20a8,{'value':_0x3a5a37,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x43defc[_0x3b20a8]=_0x3a5a37,_0x43defc;}let H=class extends _0x5b3733{constructor(_0x4e8872=E,_0x3b1ad4,_0x401600){const _0x39aad8=_0x2c160b;super(),this[_0x39aad8(0x18d)]=_0x4e8872,this[_0x39aad8(0x182)]=_0x3b1ad4,this[_0x39aad8(0x138)]=_0x401600;let {..._0x54a97b}=_0x627b99({},E,this[_0x39aad8(0x18d)]);this[_0x39aad8(0x138)]['setConfig']('thread-comment-data-source.config',_0x54a97b);}['onStarting'](){const _0x1a72b9=_0x2c160b;[[I],[L],[M]][_0x1a72b9(0x13f)](_0x521451=>{const _0x1c6548=_0x1a72b9;this[_0x1c6548(0x182)]['add'](_0x521451);});}[_0x2c160b(0x198)](){const _0x16437d=_0x2c160b;this[_0x16437d(0x182)][_0x16437d(0x162)](L),this[_0x16437d(0x182)][_0x16437d(0x162)](M);}};V(H,_0x2c160b(0x16f),'UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN'),V(H,_0x2c160b(0x189),w),V(H,'version',T),H=j([_0x122467(_0x148c8f,_0x4ea40a,_0x5f3cde,_0x56d8be,_0x4a9289),A(0x1,_0x260cda(_0x29c905)),A(0x2,_0x476ac6)],H);export{H as UniverThreadCommentDataSourcePlugin};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const THREAD_COMMENT_DATA_SOURCE_PLUGIN_CONFIG_KEY = "thread-comment-data-source.config";
|
|
2
|
+
export declare const configSymbol: unique symbol;
|
|
3
|
+
export interface IUniverThreadCommentDataSourceConfig {
|
|
4
|
+
}
|
|
5
|
+
export declare const defaultPluginConfig: IUniverThreadCommentDataSourceConfig;
|
|
@@ -15,6 +15,16 @@ export declare class ThreadCommentServerDataSource implements IThreadCommentData
|
|
|
15
15
|
private _deleteComment;
|
|
16
16
|
listComments(unitId: string, subUnitId: string, threadIds: string[]): Promise<IBaseComment[]>;
|
|
17
17
|
saveCommentToSnapshot(comment: IThreadComment): {
|
|
18
|
+
children?: {
|
|
19
|
+
id: string;
|
|
20
|
+
threadId: string;
|
|
21
|
+
ref: string;
|
|
22
|
+
parentId: string;
|
|
23
|
+
personId: string;
|
|
24
|
+
authorName: string | undefined;
|
|
25
|
+
}[] | undefined;
|
|
26
|
+
authorName?: string | undefined;
|
|
27
|
+
personId?: string | undefined;
|
|
18
28
|
id: string;
|
|
19
29
|
threadId: string;
|
|
20
30
|
ref: string;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x46d0(_0x5d6a09,_0x34cc82){_0x5d6a09=_0x5d6a09-0x12c;const _0x2f82d6=_0x2f82();let _0x46d05b=_0x2f82d6[_0x5d6a09];return _0x46d05b;}(function(_0x2d365e,_0x3ca49e){const _0x1b695a=_0x46d0,_0x3d0bec=_0x2d365e();while(!![]){try{const _0x48671d=parseInt(_0x1b695a(0x1a9))/0x1+parseInt(_0x1b695a(0x154))/0x2+parseInt(_0x1b695a(0x1c0))/0x3+parseInt(_0x1b695a(0x1b8))/0x4*(-parseInt(_0x1b695a(0x130))/0x5)+-parseInt(_0x1b695a(0x1b7))/0x6*(-parseInt(_0x1b695a(0x196))/0x7)+parseInt(_0x1b695a(0x193))/0x8*(parseInt(_0x1b695a(0x168))/0x9)+-parseInt(_0x1b695a(0x156))/0xa;if(_0x48671d===_0x3ca49e)break;else _0x3d0bec['push'](_0x3d0bec['shift']());}catch(_0x2f9acd){_0x3d0bec['push'](_0x3d0bec['shift']());}}}(_0x2f82,0x8b2ac),function(_0x46def3,_0x350d5c){const _0x18c843=_0x46d0;typeof exports==_0x18c843(0x16e)&&typeof module<'u'?_0x350d5c(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/network'),require('@univerjs/thread-comment'),require('@univerjs/thread-comment-ui'),require('@univerjs/protocol'),require('rxjs')):typeof define==_0x18c843(0x143)&&define['amd']?define([_0x18c843(0x190),_0x18c843(0x162),_0x18c843(0x1c3),_0x18c843(0x1ac),_0x18c843(0x1ab),_0x18c843(0x167),_0x18c843(0x171),_0x18c843(0x19f),'rxjs'],_0x350d5c):(_0x46def3=typeof globalThis<'u'?globalThis:_0x46def3||self,_0x350d5c(_0x46def3[_0x18c843(0x1b6)]={},_0x46def3[_0x18c843(0x12d)],_0x46def3[_0x18c843(0x135)],_0x46def3[_0x18c843(0x163)],_0x46def3[_0x18c843(0x13a)],_0x46def3[_0x18c843(0x1bc)],_0x46def3[_0x18c843(0x14a)],_0x46def3[_0x18c843(0x1aa)],_0x46def3['rxjs']));}(this,function(_0x2c16c7,_0x4271aa,_0x17db57,_0x426991,_0x1648fb,_0x4bc821,_0x30e421,_0x45160e,_0x9b34f0){const _0x233e86=_0x46d0;Object[_0x233e86(0x13e)](_0x2c16c7,Symbol[_0x233e86(0x1ad)],{'value':_0x233e86(0x172)});var _0x291f84=_0x233e86(0x18f),_0x10d7ac=_0x233e86(0x131);let _0x4323a0={},_0x65dfb=_0x4a1429=>(0x0,_0x426991['dateKit'])(new Date(+_0x4a1429))['format'](_0x233e86(0x169));function _0x534ff4(_0x3850f4){if(!_0x3850f4)return null;try{let _0x2263f0=JSON['parse'](_0x3850f4);return(0x0,_0x4bc821['isThreadCommentDocumentBody'])(_0x2263f0)?_0x2263f0:null;}catch{return null;}}let _0x20a030=async(_0x65df42,_0x4cb21c)=>{const _0x119da7=_0x233e86;let _0x5286b8=_0x65df42['get'](_0x426991[_0x119da7(0x1c6)]),_0x573762=_0x65df42[_0x119da7(0x176)](_0x1648fb[_0x119da7(0x186)]);_0x4cb21c[_0x119da7(0x160)](_0x4bd434=>{const _0xf6776f=_0x119da7;_0x5286b8[_0xf6776f(0x139)](_0x4bd434)&&_0x4cb21c['delete'](_0x4bd434);}),_0x4cb21c['size']&&(await _0x573762['get'](_0x119da7(0x15b),{'params':{'userIDs':[..._0x4cb21c]}}))[_0x119da7(0x1be)][_0x119da7(0x173)][_0x119da7(0x160)](_0x2b4059=>{const _0x525e3c=_0x119da7;_0x2b4059&&_0x5286b8[_0x525e3c(0x134)](_0x2b4059);});};function _0x55e20d(_0x87643c,_0x1d3891){return function(_0x2f36ff,_0x45c825){_0x1d3891(_0x2f36ff,_0x45c825,_0x87643c);};}function _0x2bb40d(_0x3c011c,_0x532e5d,_0x5c67c5,_0x59cb29){const _0xfa1ddc=_0x233e86;var _0x382318=arguments['length'],_0x114a4c=_0x382318<0x3?_0x532e5d:_0x59cb29===null?_0x59cb29=Object[_0xfa1ddc(0x142)](_0x532e5d,_0x5c67c5):_0x59cb29,_0x23a984;if(typeof Reflect==_0xfa1ddc(0x16e)&&typeof Reflect['decorate']==_0xfa1ddc(0x143))_0x114a4c=Reflect[_0xfa1ddc(0x14b)](_0x3c011c,_0x532e5d,_0x5c67c5,_0x59cb29);else{for(var _0x416871=_0x3c011c[_0xfa1ddc(0x1c4)]-0x1;_0x416871>=0x0;_0x416871--)(_0x23a984=_0x3c011c[_0x416871])&&(_0x114a4c=(_0x382318<0x3?_0x23a984(_0x114a4c):_0x382318>0x3?_0x23a984(_0x532e5d,_0x5c67c5,_0x114a4c):_0x23a984(_0x532e5d,_0x5c67c5))||_0x114a4c);}return _0x382318>0x3&&_0x114a4c&&Object[_0xfa1ddc(0x13e)](_0x532e5d,_0x5c67c5,_0x114a4c),_0x114a4c;}let _0xa6580a=class extends _0x426991[_0x233e86(0x17f)]{constructor(_0x24be29,_0x258f83,_0x2732d3,_0x15a42e){const _0x172523=_0x233e86;super(),this['_commentService']=_0x24be29,this[_0x172523(0x1b1)]=_0x258f83,this[_0x172523(0x151)]=_0x2732d3,this[_0x172523(0x164)]=_0x15a42e,this[_0x172523(0x138)](),this['_initUserSync']();}['_initUserSync'](){const _0x57d46e=_0x233e86;this[_0x57d46e(0x1a1)](this['_threadCommentModel'][_0x57d46e(0x16d)][_0x57d46e(0x16c)]((0x0,_0x9b34f0[_0x57d46e(0x140)])(0x10))[_0x57d46e(0x152)](_0x10e09c=>{const _0x1e71c3=_0x57d46e;let _0x183fd=new Set();_0x10e09c[_0x1e71c3(0x160)](_0x3ec54e=>{const _0x24d7bb=_0x1e71c3;switch(_0x3ec54e[_0x24d7bb(0x12c)]){case _0x24d7bb(0x1c2):{let _0x796b48=_0x3ec54e[_0x24d7bb(0x19b)][_0x24d7bb(0x19a)];_0x183fd['add'](_0x796b48);break;}default:break;}}),_0x20a030(this['_injector'],_0x183fd);}));}['_deleteComment'](_0x19d263,_0xcd0286,_0x5aa295){const _0x1f0f31=_0x233e86;let _0x52a361=this['_threadCommentModel'][_0x1f0f31(0x17a)](_0x19d263,_0xcd0286,_0x5aa295);_0x52a361&&(_0x52a361[_0x1f0f31(0x1ba)]?this[_0x1f0f31(0x1b1)][_0x1f0f31(0x17c)](_0x19d263,_0xcd0286,_0x5aa295):this[_0x1f0f31(0x1b1)][_0x1f0f31(0x1bf)](_0x19d263,_0xcd0286,_0x52a361[_0x1f0f31(0x180)]));}[_0x233e86(0x15e)](_0xf8e84a,_0xb0fdc6,_0x4e6835,_0x57d17f){const _0x36fe5f=_0x233e86;(_0x57d17f===_0x45160e['CommentSolvedStatus']['Solved']||_0x57d17f===_0x45160e[_0x36fe5f(0x16a)][_0x36fe5f(0x198)])&&this[_0x36fe5f(0x1b1)][_0x36fe5f(0x141)](_0xf8e84a,_0xb0fdc6,_0x4e6835,_0x57d17f===_0x45160e[_0x36fe5f(0x16a)]['Solved']);}['_init'](){const _0xa8aabf=_0x233e86;this[_0xa8aabf(0x1a1)](this[_0xa8aabf(0x191)][_0xa8aabf(0x16d)]['subscribe'](_0x36a66c=>{const _0x351157=_0xa8aabf;var _0x5e3707;let _0x5e9527=(_0x5e3707=this[_0x351157(0x1b1)][_0x351157(0x15c)](_0x36a66c[_0x351157(0x14e)])[_0x351157(0x12e)](_0x1c9ceb=>_0x1c9ceb['threadId']===_0x36a66c['threadId']))==null?void 0x0:_0x5e3707['root'];if(!_0x5e9527)return;let {unitId:_0xd69e0b,subUnitId:_0x21f3db}=_0x5e9527;switch(_0x36a66c[_0x351157(0x13f)]&&this[_0x351157(0x151)]['addUser'](_0x36a66c[_0x351157(0x13f)]),_0x36a66c['type']){case _0x45160e[_0x351157(0x18b)]['Reply']:{var _0xd1f7b1;let _0xa8c4be=_0x534ff4(_0x36a66c[_0x351157(0x146)]);if(!_0x36a66c[_0x351157(0x178)]||!_0x36a66c[_0x351157(0x149)]||!_0xa8c4be)return;this['_threadCommentModel'][_0x351157(0x185)](_0xd69e0b,_0x21f3db,{'unitId':_0xd69e0b,'subUnitId':_0x21f3db,'ref':'','id':_0x36a66c['replyId'],'dT':_0x65dfb(+_0x36a66c[_0x351157(0x149)]),'threadId':_0x36a66c[_0x351157(0x180)],'personId':((_0xd1f7b1=_0x36a66c['user'])==null?void 0x0:_0xd1f7b1[_0x351157(0x18a)])??_0x36a66c[_0x351157(0x16f)],'text':_0xa8c4be,'parentId':_0x5e9527['id']});break;}case _0x45160e[_0x351157(0x18b)]['Delete']:if(!_0x36a66c[_0x351157(0x178)]){this['_threadCommentModel'][_0x351157(0x1bf)](_0xd69e0b,_0x21f3db,_0x5e9527['threadId']);break;}this[_0x351157(0x137)](_0xd69e0b,_0x21f3db,_0x36a66c['replyId']);break;case _0x45160e[_0x351157(0x18b)]['Edit']:{let _0x1d8022=_0x534ff4(_0x36a66c[_0x351157(0x146)]);if(!_0x36a66c[_0x351157(0x178)]||!_0x1d8022)return;this['_threadCommentModel']['updateComment'](_0xd69e0b,_0x21f3db,{'commentId':_0x36a66c[_0x351157(0x178)],'text':_0x1d8022});break;}case _0x45160e['CommentUpdateEventType'][_0x351157(0x1b0)]:this[_0x351157(0x15e)](_0xd69e0b,_0x21f3db,_0x5e9527['id'],_0x36a66c['solved']);break;default:break;}}));}};_0xa6580a=_0x2bb40d([_0x55e20d(0x0,(0x0,_0x426991['Inject'])(_0x4271aa[_0x233e86(0x192)])),_0x55e20d(0x1,(0x0,_0x426991[_0x233e86(0x179)])(_0x4bc821[_0x233e86(0x1af)])),_0x55e20d(0x2,(0x0,_0x426991[_0x233e86(0x179)])(_0x426991[_0x233e86(0x1c6)])),_0x55e20d(0x3,(0x0,_0x426991['Inject'])(_0x426991[_0x233e86(0x13d)]))],_0xa6580a);function _0x203f66(_0xd42d3e,_0x351e20){const _0x454136=_0x233e86;let _0x2d6b12=Number(_0xd42d3e==null?void 0x0:_0xd42d3e[_0x454136(0x149)]);return!!(_0xd42d3e&&_0xd42d3e[_0x454136(0x178)]&&_0xd42d3e[_0x454136(0x180)]===_0x351e20&&_0xd42d3e['userId']&&Number[_0x454136(0x145)](_0x2d6b12)&&_0x2d6b12>0x0);}function _0x4dc141(_0x26cc54,_0xdee8d4){const _0xda943c=_0x233e86;let _0x514c98=_0x26cc54[_0xda943c(0x188)][0x0];if(!_0x26cc54[_0xda943c(0x180)]||!_0x203f66(_0x514c98,_0x26cc54['threadId']))throw Error('Comment\x20service\x20returned\x20an\x20invalid\x20thread');return{..._0xdee8d4,'id':_0x514c98[_0xda943c(0x178)],'resolved':_0x26cc54[_0xda943c(0x148)]===0x1,'dT':_0x65dfb(_0x514c98['createTimestamp']),'personId':_0x514c98['userId'],'threadId':_0x514c98[_0xda943c(0x180)]};}function _0x4bb30b(_0x2a6193,_0x2147c1,_0x3e747e,_0x57f199){const _0xf7496=_0x233e86;if((_0x2a6193==null?void 0x0:_0x2a6193['threadId'])===_0x2147c1&&_0x2a6193[_0xf7496(0x188)][_0xf7496(0x1c4)]>0x0){let _0x475234=(_0x2ebf0b,_0x5b6f19)=>{const _0x5a0ec1=_0xf7496;if(!_0x203f66(_0x2ebf0b,_0x2147c1))return null;let _0xd2e1a4=_0x534ff4(_0x2ebf0b[_0x5a0ec1(0x146)]);return _0xd2e1a4?{'id':_0x2ebf0b[_0x5a0ec1(0x178)],'threadId':_0x2ebf0b[_0x5a0ec1(0x180)],'dT':_0x65dfb(_0x2ebf0b['createTimestamp']),'personId':_0x2ebf0b['userId'],'resolved':_0x2a6193[_0x5a0ec1(0x148)]===_0x45160e[_0x5a0ec1(0x16a)]['Solved'],'unitId':_0x3e747e,'subUnitId':_0x57f199,'text':_0xd2e1a4,'parentId':_0x5b6f19}:null;},_0x4e36a1=_0x475234(_0x2a6193[_0xf7496(0x188)][0x0]);if(!_0x4e36a1)return null;let _0x21d7ff=new Set([_0x4e36a1['id']]),_0xd68fd3=_0x2a6193[_0xf7496(0x188)]['slice'](0x1)['flatMap'](_0x57a291=>{const _0x211ab4=_0xf7496;let _0xd82776=_0x475234(_0x57a291,_0x4e36a1['id']);return!_0xd82776||_0x21d7ff[_0x211ab4(0x144)](_0xd82776['id'])?[]:(_0x21d7ff[_0x211ab4(0x1c2)](_0xd82776['id']),[_0xd82776]);});return{..._0x4e36a1,'children':_0xd68fd3};}return null;}let _0x5d1715=class{constructor(_0xaafd5d,_0x5abdf9,_0x56f0c0){const _0x4e96b7=_0x233e86;this['_httpService']=_0xaafd5d,this['_userService']=_0x5abdf9,this[_0x4e96b7(0x189)]=_0x56f0c0;}async[_0x233e86(0x185)](_0x56c7e1){const _0xdf725d=_0x233e86;var _0x4e01dc;let {parentId:_0x21f7b5,unitId:_0x33e36f,text:_0x3674a1,threadId:_0x4f1756}=_0x56c7e1,_0xe1b948=((_0x4e01dc=_0x3674a1[_0xdf725d(0x161)])==null?void 0x0:_0x4e01dc[_0xdf725d(0x17e)](_0x33058f=>_0x33058f['rangeType']===_0x426991[_0xdf725d(0x15d)][_0xdf725d(0x159)])[_0xdf725d(0x12f)](_0x2b4e5a=>_0x2b4e5a['rangeId']))??[],_0x43162c=JSON[_0xdf725d(0x1a4)](_0x3674a1),_0x5863a1=(await this['_sessionService']['requireSession'](_0x33e36f))[_0xdf725d(0x184)]();if(_0x21f7b5){let _0x4e3616={'memberId':_0x5863a1,'unitId':_0x33e36f,'content':_0x43162c,'mention':_0xe1b948,'threadId':_0x4f1756},_0x3a88d5=await this[_0xdf725d(0x16b)][_0xdf725d(0x1bd)](_0xdf725d(0x195)+_0x33e36f+_0xdf725d(0x166),{'body':_0x4e3616}),_0x2c4c31=_0x3a88d5['body'][_0xdf725d(0x158)];if(_0x3a88d5['body'][_0xdf725d(0x183)]&&_0x3a88d5['body'][_0xdf725d(0x183)][_0xdf725d(0x19d)]!==0x1||!_0x203f66(_0x2c4c31,_0x4f1756)){var _0x3279ec;throw Error(((_0x3279ec=_0x3a88d5[_0xdf725d(0x1be)][_0xdf725d(0x183)])==null?void 0x0:_0x3279ec[_0xdf725d(0x1b2)])??_0xdf725d(0x174));}return{..._0x56c7e1,'id':_0x2c4c31['replyId'],'dT':(0x0,_0x426991[_0xdf725d(0x1ae)])(+_0x2c4c31['createTimestamp'])[_0xdf725d(0x1a8)](_0xdf725d(0x169)),'personId':_0x2c4c31[_0xdf725d(0x16f)]};}else{let _0x9312a4={'memberId':_0x5863a1,'unitId':_0x33e36f,'content':_0x43162c,'mention':_0xe1b948},_0x229a23=await this[_0xdf725d(0x16b)][_0xdf725d(0x1bd)](_0xdf725d(0x195)+_0x33e36f+'/add',{'body':_0x9312a4});if(_0x229a23[_0xdf725d(0x1be)][_0xdf725d(0x183)]&&_0x229a23[_0xdf725d(0x1be)][_0xdf725d(0x183)]['code']!==0x1||!_0x229a23['body']['comment']){var _0x4eb36c;throw Error(((_0x4eb36c=_0x229a23[_0xdf725d(0x1be)][_0xdf725d(0x183)])==null?void 0x0:_0x4eb36c[_0xdf725d(0x1b2)])??_0xdf725d(0x15a));}return _0x4dc141(_0x229a23['body'][_0xdf725d(0x18e)],_0x56c7e1);}}async[_0x233e86(0x1a0)](_0x189331){const _0x45e778=_0x233e86;var _0x17dfed;let {text:_0x145018,unitId:_0xc57881}=_0x189331,_0x106e6c=((_0x17dfed=_0x145018['customRanges'])==null?void 0x0:_0x17dfed[_0x45e778(0x17e)](_0x1e5492=>_0x1e5492[_0x45e778(0x1b5)]===_0x426991['CustomRangeType']['COMMENT'])[_0x45e778(0x12f)](_0x49103e=>_0x49103e[_0x45e778(0x150)]))??[],_0x4d558e=JSON['stringify'](_0x145018),_0x11eb24=_0x189331['threadId'],_0x15c92d=_0x189331['id'],_0x5c8395={'memberId':(await this[_0x45e778(0x189)][_0x45e778(0x147)](_0xc57881))[_0x45e778(0x184)](),'unitId':_0xc57881,'threadId':_0x11eb24,'mention':_0x106e6c,'content':_0x4d558e,'replyId':_0x15c92d},_0x8bc914=await this['_httpService'][_0x45e778(0x1bd)](_0x45e778(0x195)+_0xc57881+'/edit',{'body':_0x5c8395});return!_0x8bc914[_0x45e778(0x1be)][_0x45e778(0x183)]||_0x8bc914['body'][_0x45e778(0x183)][_0x45e778(0x19d)]===0x1;}async[_0x233e86(0x141)](_0x5868ca){const _0x1190cb=_0x233e86;let {unitId:_0x564719}=_0x5868ca,_0x535614=_0x5868ca['threadId'],_0x3d3cbf={'memberId':(await this['_sessionService']['requireSession'](_0x564719))[_0x1190cb(0x184)](),'unitId':_0x564719,'threadId':_0x535614,'solved':_0x5868ca[_0x1190cb(0x17b)]?_0x45160e[_0x1190cb(0x16a)][_0x1190cb(0x18d)]:_0x45160e[_0x1190cb(0x16a)][_0x1190cb(0x198)]},_0x1b3dc1=await this[_0x1190cb(0x16b)][_0x1190cb(0x1bd)](_0x1190cb(0x195)+_0x564719+_0x1190cb(0x155),{'body':_0x3d3cbf});return!_0x1b3dc1['body'][_0x1190cb(0x183)]||_0x1b3dc1[_0x1190cb(0x1be)][_0x1190cb(0x183)][_0x1190cb(0x19d)]===0x1;}['deleteComment'](_0xd56c2e,_0x2b126c,_0x5c6195,_0x5b5f9a){const _0xe137a4=_0x233e86;return this[_0xe137a4(0x137)](_0xd56c2e,_0x5c6195,_0x5b5f9a);}[_0x233e86(0x1bf)](_0x23f268,_0x597442,_0x536ab5){const _0x1ab1d1=_0x233e86;return this[_0x1ab1d1(0x137)](_0x23f268,_0x536ab5);}async[_0x233e86(0x137)](_0x188d8d,_0x2c27a5,_0x1c4689){const _0x29615a=_0x233e86;let _0x485806={'memberId':(await this[_0x29615a(0x189)]['requireSession'](_0x188d8d))[_0x29615a(0x184)](),'threadId':_0x2c27a5,'replyId':_0x1c4689,'unitId':_0x188d8d},_0x17fb83=await this[_0x29615a(0x16b)][_0x29615a(0x1bd)]('/universer-api/comment/unit/'+_0x188d8d+_0x29615a(0x17d),{'body':_0x485806});return!_0x17fb83[_0x29615a(0x1be)][_0x29615a(0x183)]||_0x17fb83[_0x29615a(0x1be)][_0x29615a(0x183)]['code']===0x1;}async[_0x233e86(0x1b4)](_0x5418ee,_0x179514,_0x578ba4){const _0x4227db=_0x233e86;let _0x2b0bb5={'unitId':_0x5418ee,'threadId':_0x578ba4},_0x23416e=await this[_0x4227db(0x16b)][_0x4227db(0x1bd)](_0x4227db(0x195)+_0x5418ee+_0x4227db(0x165),{'body':_0x2b0bb5});if(_0x23416e['body'][_0x4227db(0x183)]&&_0x23416e[_0x4227db(0x1be)][_0x4227db(0x183)]['code']!==0x1)throw Error(_0x23416e[_0x4227db(0x1be)][_0x4227db(0x183)]['message']||_0x4227db(0x14d));let _0x136908=_0x578ba4[_0x4227db(0x12f)](_0x3cacd9=>{const _0x3a7fa7=_0x4227db;var _0x39ab24;return _0x4bb30b((_0x39ab24=_0x23416e[_0x3a7fa7(0x1be)][_0x3a7fa7(0x13c)])==null?void 0x0:_0x39ab24[_0x3cacd9],_0x3cacd9,_0x5418ee,_0x179514);})[_0x4227db(0x17e)](Boolean);return Object[_0x4227db(0x1a6)](_0x23416e['body'][_0x4227db(0x173)]??{})[_0x4227db(0x160)](_0x57ceed=>{const _0x4c7ffb=_0x4227db;this['_userService'][_0x4c7ffb(0x134)](_0x57ceed);}),_0x136908;}[_0x233e86(0x1bb)](_0x167ef0){const _0x17227f=_0x233e86;return{'id':_0x167ef0['id'],'threadId':_0x167ef0[_0x17227f(0x180)],'ref':_0x167ef0[_0x17227f(0x182)]};}};_0x5d1715=_0x2bb40d([_0x55e20d(0x0,(0x0,_0x426991['Inject'])(_0x1648fb[_0x233e86(0x186)])),_0x55e20d(0x1,(0x0,_0x426991[_0x233e86(0x179)])(_0x426991[_0x233e86(0x1c6)])),_0x55e20d(0x2,(0x0,_0x426991['Inject'])(_0x4271aa[_0x233e86(0x170)]))],_0x5d1715);let _0x575b65=class extends _0x426991[_0x233e86(0x17f)]{constructor(_0x511e36,_0x490435){const _0x1272a4=_0x233e86;super(),this[_0x1272a4(0x136)]=_0x511e36,this[_0x1272a4(0x1b9)]=_0x490435,this[_0x1272a4(0x181)]();}[_0x233e86(0x181)](){const _0x23f928=_0x233e86;this[_0x23f928(0x136)]['dataSource']=this['_threadCommentDataSource'],this[_0x23f928(0x136)][_0x23f928(0x15f)]=!0x1;}};_0x575b65=_0x2bb40d([_0x55e20d(0x0,_0x4bc821[_0x233e86(0x1c7)]),_0x55e20d(0x1,(0x0,_0x426991[_0x233e86(0x179)])(_0x5d1715))],_0x575b65);function _0x2da692(_0x468b68){'@babel/helpers - typeof';return _0x2da692=typeof Symbol=='function'&&typeof Symbol['iterator']=='symbol'?function(_0x3c31e2){return typeof _0x3c31e2;}:function(_0x4753ae){const _0x4e0cbc=_0x46d0;return _0x4753ae&&typeof Symbol=='function'&&_0x4753ae['constructor']===Symbol&&_0x4753ae!==Symbol[_0x4e0cbc(0x1a5)]?_0x4e0cbc(0x157):typeof _0x4753ae;},_0x2da692(_0x468b68);}function _0x13e2a5(_0x543cc0,_0x4450b5){const _0x108101=_0x233e86;if(_0x2da692(_0x543cc0)!='object'||!_0x543cc0)return _0x543cc0;var _0xe6f069=_0x543cc0[Symbol['toPrimitive']];if(_0xe6f069!==void 0x0){var _0x47e0ed=_0xe6f069[_0x108101(0x133)](_0x543cc0,_0x4450b5||_0x108101(0x1a2));if(_0x2da692(_0x47e0ed)!=_0x108101(0x16e))return _0x47e0ed;throw TypeError(_0x108101(0x187));}return(_0x4450b5===_0x108101(0x14f)?String:Number)(_0x543cc0);}function _0x237ea8(_0x2b3c11){const _0x4488fa=_0x233e86;var _0x3e3cea=_0x13e2a5(_0x2b3c11,_0x4488fa(0x14f));return _0x2da692(_0x3e3cea)==_0x4488fa(0x157)?_0x3e3cea:_0x3e3cea+'';}function _0x19caa5(_0xd4b28e,_0x1b5e53,_0x42be4d){const _0x43715d=_0x233e86;return(_0x1b5e53=_0x237ea8(_0x1b5e53))in _0xd4b28e?Object[_0x43715d(0x13e)](_0xd4b28e,_0x1b5e53,{'value':_0x42be4d,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0xd4b28e[_0x1b5e53]=_0x42be4d,_0xd4b28e;}let _0x141067=class extends _0x426991[_0x233e86(0x194)]{constructor(_0x2beffa=_0x4323a0,_0x4d4396,_0x19bf76){const _0x577c95=_0x233e86;super(),this[_0x577c95(0x1b3)]=_0x2beffa,this['_injector']=_0x4d4396,this['_configService']=_0x19bf76;let {..._0xd7caca}=(0x0,_0x426991[_0x577c95(0x197)])({},_0x4323a0,this[_0x577c95(0x1b3)]);this['_configService'][_0x577c95(0x132)](_0x577c95(0x19e),_0xd7caca);}['onStarting'](){[[_0x5d1715],[_0x575b65],[_0xa6580a]]['forEach'](_0xc12ec=>{const _0x6b10cf=_0x46d0;this[_0x6b10cf(0x164)][_0x6b10cf(0x1c2)](_0xc12ec);});}[_0x233e86(0x14c)](){const _0x22212c=_0x233e86;this['_injector'][_0x22212c(0x176)](_0x575b65),this[_0x22212c(0x164)]['get'](_0xa6580a);}};_0x19caa5(_0x141067,_0x233e86(0x1c1),_0x233e86(0x177)),_0x19caa5(_0x141067,_0x233e86(0x19c),_0x291f84),_0x19caa5(_0x141067,_0x233e86(0x1a3),_0x10d7ac),_0x141067=_0x2bb40d([(0x0,_0x426991[_0x233e86(0x18c)])(_0x17db57[_0x233e86(0x1a7)],_0x1648fb[_0x233e86(0x153)],_0x4bc821[_0x233e86(0x175)],_0x30e421[_0x233e86(0x1c5)],_0x4271aa[_0x233e86(0x13b)]),_0x55e20d(0x1,(0x0,_0x426991[_0x233e86(0x179)])(_0x426991[_0x233e86(0x13d)])),_0x55e20d(0x2,_0x426991['IConfigService'])],_0x141067),Object[_0x233e86(0x13e)](_0x2c16c7,_0x233e86(0x199),{'enumerable':!0x0,'get':function(){return _0x141067;}});}));function _0x2f82(){const _0x33c42f=['CollaborationSessionService','@univerjs/thread-comment-ui','Module','users','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply','UniverThreadCommentPlugin','get','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','replyId','Inject','getComment','resolved','deleteComment','/delete','filter','Disposable','threadId','_initDataSource','ref','error','getMemberID','addComment','HTTPService','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','replies','_sessionService','userID','CommentUpdateEventType','DependentOn','Solved','comment','@univerjs-pro/thread-comment-datasource','exports','_commentService','CommentService','6305168ivOMzZ','Plugin','/universer-api/comment/unit/','18522hspRNC','merge','OpenOrReOpen','UniverThreadCommentDataSourcePlugin','personId','payload','packageName','code','thread-comment-data-source.config','@univerjs/protocol','updateComment','disposeWithMe','default','version','stringify','prototype','values','UniverLicensePlugin','format','729448EvmLHI','UniverProtocol','@univerjs/network','@univerjs/core','toStringTag','dateKit','ThreadCommentModel','Solve','_threadCommentModel','message','_config','listComments','rangeType','UniverProThreadCommentDatasource','2196iGqfAP','4IkfCtz','_threadCommentDataSource','parentId','saveCommentToSnapshot','UniverThreadComment','post','body','deleteThread','1991346ZYxoNR','pluginName','add','@univerjs-pro/license','length','UniverThreadCommentUIPlugin','UserManagerService','IThreadCommentDataSourceService','type','UniverProCollaborationClient','find','map','359630eWbswK','1.0.0-rc.0','setConfig','call','addUser','UniverProLicense','_threadCommentDataSourceService','_deleteComment','_init','getUser','UniverNetwork','UniverCollaborationClientPlugin','comments','Injector','defineProperty','user','bufferTime','resolveComment','getOwnPropertyDescriptor','function','has','isFinite','content','requireSession','solved','createTimestamp','UniverThreadCommentUi','decorate','onReady','Comment\x20service\x20failed\x20to\x20list\x20comments','unitId','string','rangeId','_userService','subscribe','UniverNetworkPlugin','773738IfoBXx','/solved','28947270iPJaGs','symbol','reply','COMMENT','Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment','/universer-api/user/list','getUnit','CustomRangeType','_resolveComment','syncUpdateMutationToColla','forEach','customRanges','@univerjs-pro/collaboration-client','UniverCore','_injector','/list','/reply','@univerjs/thread-comment','9XtSBRX','YYYY/MM/DD\x20HH:mm','CommentSolvedStatus','_httpService','pipe','commentUpdate$','object','userId'];_0x2f82=function(){return _0x33c42f;};return _0x2f82();}
|
|
1
|
+
function _0x4117(_0x31a4db,_0x2c0a66){_0x31a4db=_0x31a4db-0xd7;const _0x18f90a=_0x18f9();let _0x4117c9=_0x18f90a[_0x31a4db];return _0x4117c9;}function _0x18f9(){const _0x4ac2b5=['Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20comment','@univerjs/thread-comment-ui','get','forEach','88509sHHEQS','replyId','setConfig','CommentSolvedStatus','merge','@univerjs/network','user','listComments','rangeType','385016EbEmdy','Inject','decorate','createTimestamp','defineProperty','string','Comment\x20service\x20failed\x20to\x20list\x20comments','_injector','replies','ref','Comment\x20service\x20returned\x20an\x20invalid\x20thread','2jIvvQJ','map','deleteThread','symbol','solved','Injector','post','function','UniverProCollaborationClient','Edit','_config','prototype','IThreadCommentDataSourceService','message','Solved','@univerjs-pro/license','resolved','exports','/universer-api/comment/unit/','content','157816DKGUwi','20WNeeyJ','type','default','addComment','CommentService','@univerjs-pro/collaboration-client','UniverCollaborationClientPlugin','6778602LZKuxG','users','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_deleteComment','2192886rkSBdK','disposeWithMe','add','UniverLicensePlugin','1501014CwZxkG','DependentOn','_resolveComment','IConfigService','rxjs','constructor','version','authorName','length','rangeId','1.0.0','size','/universer-api/user/list','comments','@univerjs/protocol','format','/reply','_init','subscribe','/edit','updateComment','_configService','YYYY/MM/DD\x20HH:mm','/delete','dataSource','_threadCommentDataSourceService','threadId','_httpService','flatMap','code','getUser','CommentUpdateEventType','body','requireSession','iterator','personId','_commentService','object','children','addUser','_initUserSync','resolveComment','isFinite','comment','error','dateKit','customRanges','Disposable','UniverThreadCommentUIPlugin','HTTPService','CollaborationSessionService','3714872DbeHMz','_threadCommentModel','toPrimitive','some','UniverThreadComment','Delete','COMMENT','bufferTime','isThreadCommentDocumentBody','getComment','UniverProThreadCommentDatasource','/list','_userService','Module','pluginName','syncUpdateMutationToColla','Reply','filter','getMemberID','stringify','userId','slice','UserManagerService','_initDataSource','has','UniverProLicense','_sessionService','commentUpdate$','find','payload','call','Solve','CustomRangeType','@univerjs-pro/thread-comment-datasource','saveCommentToSnapshot','delete'];_0x18f9=function(){return _0x4ac2b5;};return _0x18f9();}(function(_0x3eaa0f,_0x39514e){const _0x4efa4a=_0x4117,_0x173baa=_0x3eaa0f();while(!![]){try{const _0x5d1602=parseInt(_0x4efa4a(0x152))/0x1+-parseInt(_0x4efa4a(0x166))/0x2*(parseInt(_0x4efa4a(0xf7))/0x3)+-parseInt(_0x4efa4a(0xe7))/0x4*(-parseInt(_0x4efa4a(0xe8))/0x5)+parseInt(_0x4efa4a(0xf3))/0x6+-parseInt(_0x4efa4a(0x12a))/0x7+-parseInt(_0x4efa4a(0x15b))/0x8+parseInt(_0x4efa4a(0xef))/0x9;if(_0x5d1602===_0x39514e)break;else _0x173baa['push'](_0x173baa['shift']());}catch(_0x455ddf){_0x173baa['push'](_0x173baa['shift']());}}}(_0x18f9,0x45c7f),function(_0x5e0ee8,_0x20c8d9){const _0x1cd465=_0x4117;typeof exports==_0x1cd465(0x11c)&&typeof module<'u'?_0x20c8d9(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/network'),require('@univerjs/thread-comment'),require('@univerjs/thread-comment-ui'),require('@univerjs/protocol'),require('rxjs')):typeof define==_0x1cd465(0xda)&&define['amd']?define([_0x1cd465(0xe4),_0x1cd465(0xed),_0x1cd465(0xe2),'@univerjs/core',_0x1cd465(0x157),'@univerjs/thread-comment',_0x1cd465(0x14f),_0x1cd465(0x105),_0x1cd465(0xfb)],_0x20c8d9):(_0x5e0ee8=typeof globalThis<'u'?globalThis:_0x5e0ee8||self,_0x20c8d9(_0x5e0ee8[_0x1cd465(0x134)]={},_0x5e0ee8[_0x1cd465(0xdb)],_0x5e0ee8[_0x1cd465(0x143)],_0x5e0ee8['UniverCore'],_0x5e0ee8['UniverNetwork'],_0x5e0ee8[_0x1cd465(0x12e)],_0x5e0ee8['UniverThreadCommentUi'],_0x5e0ee8['UniverProtocol'],_0x5e0ee8['rxjs']));}(this,function(_0x4cfc50,_0x372be1,_0x2c47f5,_0x262129,_0x3c74b7,_0x1af8ca,_0x11b9a5,_0x3b15a9,_0x35038f){const _0x5b5c0f=_0x4117;Object[_0x5b5c0f(0x15f)](_0x4cfc50,Symbol['toStringTag'],{'value':_0x5b5c0f(0x137)});var _0x44e29e=_0x5b5c0f(0x14b),_0x34fe59=_0x5b5c0f(0x101);let _0x4509ed={},_0x39bf4d=_0x21364f=>(0x0,_0x262129[_0x5b5c0f(0x124)])(new Date(+_0x21364f))[_0x5b5c0f(0x106)](_0x5b5c0f(0x10d));function _0x1b0c88(_0x3d25a3){const _0x4c11a5=_0x5b5c0f;if(!_0x3d25a3)return null;try{let _0x115a81=JSON['parse'](_0x3d25a3);return(0x0,_0x1af8ca[_0x4c11a5(0x132)])(_0x115a81)?_0x115a81:null;}catch{return null;}}let _0x21c751=async(_0x367cc1,_0x46180a)=>{const _0x438335=_0x5b5c0f;let _0x99c181=_0x367cc1[_0x438335(0x150)](_0x262129[_0x438335(0x140)]),_0x67d1b3=_0x367cc1[_0x438335(0x150)](_0x3c74b7[_0x438335(0x128)]);_0x46180a[_0x438335(0x151)](_0x12b61c=>{const _0x5c3ad1=_0x438335;_0x99c181[_0x5c3ad1(0x115)](_0x12b61c)&&_0x46180a[_0x5c3ad1(0x14d)](_0x12b61c);}),_0x46180a[_0x438335(0x102)]&&(await _0x67d1b3[_0x438335(0x150)](_0x438335(0x103),{'params':{'userIDs':[..._0x46180a]}}))['body'][_0x438335(0xf0)]['forEach'](_0x380464=>{const _0x5291d4=_0x438335;_0x380464&&_0x99c181[_0x5291d4(0x11e)](_0x380464);});};function _0x4477bb(_0x53316a,_0x167c1d){return function(_0x2e43f7,_0x5f7444){_0x167c1d(_0x2e43f7,_0x5f7444,_0x53316a);};}function _0x1baa22(_0x5ece5e,_0x5d6026,_0x3e94ab,_0x420f96){const _0xda8578=_0x5b5c0f;var _0x38ea8c=arguments[_0xda8578(0xff)],_0x1fc397=_0x38ea8c<0x3?_0x5d6026:_0x420f96===null?_0x420f96=Object['getOwnPropertyDescriptor'](_0x5d6026,_0x3e94ab):_0x420f96,_0xf11627;if(typeof Reflect=='object'&&typeof Reflect['decorate']==_0xda8578(0xda))_0x1fc397=Reflect[_0xda8578(0x15d)](_0x5ece5e,_0x5d6026,_0x3e94ab,_0x420f96);else{for(var _0x14e410=_0x5ece5e[_0xda8578(0xff)]-0x1;_0x14e410>=0x0;_0x14e410--)(_0xf11627=_0x5ece5e[_0x14e410])&&(_0x1fc397=(_0x38ea8c<0x3?_0xf11627(_0x1fc397):_0x38ea8c>0x3?_0xf11627(_0x5d6026,_0x3e94ab,_0x1fc397):_0xf11627(_0x5d6026,_0x3e94ab))||_0x1fc397);}return _0x38ea8c>0x3&&_0x1fc397&&Object[_0xda8578(0x15f)](_0x5d6026,_0x3e94ab,_0x1fc397),_0x1fc397;}let _0xe3e7ad=class extends _0x262129[_0x5b5c0f(0x126)]{constructor(_0x5bb017,_0x20d02e,_0x255fee,_0x5c7cb8){const _0x45ff3a=_0x5b5c0f;super(),this[_0x45ff3a(0x11b)]=_0x5bb017,this['_threadCommentModel']=_0x20d02e,this[_0x45ff3a(0x136)]=_0x255fee,this[_0x45ff3a(0x162)]=_0x5c7cb8,this[_0x45ff3a(0x108)](),this[_0x45ff3a(0x11f)]();}['_initUserSync'](){const _0x245f5b=_0x5b5c0f;this[_0x245f5b(0xf4)](this[_0x245f5b(0x12b)][_0x245f5b(0x145)]['pipe']((0x0,_0x35038f[_0x245f5b(0x131)])(0x10))[_0x245f5b(0x109)](_0x189824=>{let _0x236b36=new Set();_0x189824['forEach'](_0x2ae679=>{const _0x19903e=_0x4117;switch(_0x2ae679[_0x19903e(0xe9)]){case _0x19903e(0xf5):{let _0x56c772=_0x2ae679[_0x19903e(0x147)][_0x19903e(0x11a)];_0x236b36[_0x19903e(0xf5)](_0x56c772);break;}}}),_0x21c751(this['_injector'],_0x236b36);}));}[_0x5b5c0f(0xf2)](_0x33975f,_0x3826ca,_0x5236f9){const _0x55e77f=_0x5b5c0f;let _0xc7a5a7=this[_0x55e77f(0x12b)][_0x55e77f(0x133)](_0x33975f,_0x3826ca,_0x5236f9);_0xc7a5a7&&(_0xc7a5a7['parentId']?this[_0x55e77f(0x12b)]['deleteComment'](_0x33975f,_0x3826ca,_0x5236f9):this[_0x55e77f(0x12b)][_0x55e77f(0x168)](_0x33975f,_0x3826ca,_0xc7a5a7[_0x55e77f(0x111)]));}[_0x5b5c0f(0xf9)](_0x556585,_0x46e628,_0x3a83b7,_0x403fcd){const _0xcf8142=_0x5b5c0f;(_0x403fcd===_0x3b15a9[_0xcf8142(0x155)]['Solved']||_0x403fcd===_0x3b15a9[_0xcf8142(0x155)]['OpenOrReOpen'])&&this['_threadCommentModel'][_0xcf8142(0x120)](_0x556585,_0x46e628,_0x3a83b7,_0x403fcd===_0x3b15a9[_0xcf8142(0x155)][_0xcf8142(0xe1)]);}[_0x5b5c0f(0x108)](){const _0x448b7b=_0x5b5c0f;this[_0x448b7b(0xf4)](this['_commentService'][_0x448b7b(0x145)]['subscribe'](_0x2087f5=>{const _0x49aeed=_0x448b7b;var _0x2bf785;let _0x2dd8e0=(_0x2bf785=this['_threadCommentModel']['getUnit'](_0x2087f5['unitId'])[_0x49aeed(0x146)](_0x1f7dee=>_0x1f7dee[_0x49aeed(0x111)]===_0x2087f5[_0x49aeed(0x111)]))==null?void 0x0:_0x2bf785['root'];if(!_0x2dd8e0)return;let {unitId:_0x1f4f26,subUnitId:_0x3a62af}=_0x2dd8e0;switch(_0x2087f5['user']&&this[_0x49aeed(0x136)]['addUser'](_0x2087f5['user']),_0x2087f5[_0x49aeed(0xe9)]){case _0x3b15a9[_0x49aeed(0x116)][_0x49aeed(0x13a)]:{var _0x1ea20f;let _0x58bb7d=_0x1b0c88(_0x2087f5[_0x49aeed(0xe6)]);if(!_0x2087f5[_0x49aeed(0x153)]||!_0x2087f5[_0x49aeed(0x15e)]||!_0x58bb7d)return;this[_0x49aeed(0x12b)][_0x49aeed(0xeb)](_0x1f4f26,_0x3a62af,{'unitId':_0x1f4f26,'subUnitId':_0x3a62af,'ref':'','id':_0x2087f5[_0x49aeed(0x153)],'dT':_0x39bf4d(+_0x2087f5[_0x49aeed(0x15e)]),'threadId':_0x2087f5[_0x49aeed(0x111)],'personId':((_0x1ea20f=_0x2087f5[_0x49aeed(0x158)])==null?void 0x0:_0x1ea20f['userID'])??_0x2087f5[_0x49aeed(0x13e)],'text':_0x58bb7d,'parentId':_0x2dd8e0['id']});break;}case _0x3b15a9[_0x49aeed(0x116)][_0x49aeed(0x12f)]:if(!_0x2087f5['replyId']){this['_threadCommentModel'][_0x49aeed(0x168)](_0x1f4f26,_0x3a62af,_0x2dd8e0[_0x49aeed(0x111)]);break;}this['_deleteComment'](_0x1f4f26,_0x3a62af,_0x2087f5[_0x49aeed(0x153)]);break;case _0x3b15a9['CommentUpdateEventType'][_0x49aeed(0xdc)]:{let _0x5eb645=_0x1b0c88(_0x2087f5[_0x49aeed(0xe6)]);if(!_0x2087f5[_0x49aeed(0x153)]||!_0x5eb645)return;this[_0x49aeed(0x12b)][_0x49aeed(0x10b)](_0x1f4f26,_0x3a62af,{'commentId':_0x2087f5[_0x49aeed(0x153)],'text':_0x5eb645});break;}case _0x3b15a9[_0x49aeed(0x116)][_0x49aeed(0x149)]:this[_0x49aeed(0xf9)](_0x1f4f26,_0x3a62af,_0x2dd8e0['id'],_0x2087f5[_0x49aeed(0xd7)]);}}));}};_0xe3e7ad=_0x1baa22([_0x4477bb(0x0,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x372be1[_0x5b5c0f(0xec)])),_0x4477bb(0x1,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x1af8ca['ThreadCommentModel'])),_0x4477bb(0x2,(0x0,_0x262129['Inject'])(_0x262129[_0x5b5c0f(0x140)])),_0x4477bb(0x3,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x262129[_0x5b5c0f(0xd8)]))],_0xe3e7ad);function _0x5abe11(_0x41359e,_0x5b54e9){const _0x3e2b98=_0x5b5c0f;let _0x53bfbe=Number(_0x41359e==null?void 0x0:_0x41359e['createTimestamp']);return!!(_0x41359e&&_0x41359e['replyId']&&_0x41359e[_0x3e2b98(0x111)]===_0x5b54e9&&_0x41359e[_0x3e2b98(0x13e)]&&Number[_0x3e2b98(0x121)](_0x53bfbe)&&_0x53bfbe>0x0);}function _0x16cc94(_0x157ffc,_0x38c339){const _0x4092e2=_0x5b5c0f;let _0x3ddcd4=_0x157ffc[_0x4092e2(0x163)][0x0];if(!_0x157ffc[_0x4092e2(0x111)]||!_0x5abe11(_0x3ddcd4,_0x157ffc[_0x4092e2(0x111)]))throw Error(_0x4092e2(0x165));return{..._0x38c339,'id':_0x3ddcd4[_0x4092e2(0x153)],'resolved':_0x157ffc[_0x4092e2(0xd7)]===0x1,'dT':_0x39bf4d(_0x3ddcd4[_0x4092e2(0x15e)]),'personId':_0x3ddcd4[_0x4092e2(0x13e)],'threadId':_0x3ddcd4[_0x4092e2(0x111)]};}function _0x2b7458(_0x420cc3,_0x25d3eb,_0x104410,_0x39cf80){const _0x15b1e3=_0x5b5c0f;if((_0x420cc3==null?void 0x0:_0x420cc3[_0x15b1e3(0x111)])===_0x25d3eb&&_0x420cc3['replies']['length']>0x0){let _0x536294=(_0xe1ccbb,_0x8ef967)=>{const _0x1e0af2=_0x15b1e3;if(!_0x5abe11(_0xe1ccbb,_0x25d3eb))return null;let _0x4a2010=_0x1b0c88(_0xe1ccbb[_0x1e0af2(0xe6)]);return _0x4a2010?{'id':_0xe1ccbb['replyId'],'threadId':_0xe1ccbb['threadId'],'dT':_0x39bf4d(_0xe1ccbb[_0x1e0af2(0x15e)]),'personId':_0xe1ccbb[_0x1e0af2(0x13e)],'resolved':_0x420cc3[_0x1e0af2(0xd7)]===_0x3b15a9[_0x1e0af2(0x155)][_0x1e0af2(0xe1)],'unitId':_0x104410,'subUnitId':_0x39cf80,'text':_0x4a2010,'parentId':_0x8ef967}:null;},_0x1aed9c=_0x536294(_0x420cc3[_0x15b1e3(0x163)][0x0]);if(!_0x1aed9c)return null;let _0x30e24a=new Set([_0x1aed9c['id']]),_0x484de5=_0x420cc3[_0x15b1e3(0x163)][_0x15b1e3(0x13f)](0x1)[_0x15b1e3(0x113)](_0x46ff4b=>{const _0x4fc496=_0x15b1e3;let _0x2290ff=_0x536294(_0x46ff4b,_0x1aed9c['id']);return!_0x2290ff||_0x30e24a[_0x4fc496(0x142)](_0x2290ff['id'])?[]:(_0x30e24a[_0x4fc496(0xf5)](_0x2290ff['id']),[_0x2290ff]);});return{..._0x1aed9c,'children':_0x484de5};}return null;}let _0x260c9b=class{constructor(_0x614a5e,_0x1f2fed,_0x17af19){const _0x450539=_0x5b5c0f;this[_0x450539(0x112)]=_0x614a5e,this[_0x450539(0x136)]=_0x1f2fed,this['_sessionService']=_0x17af19;}async['addComment'](_0x6fdbb){const _0x316faf=_0x5b5c0f;var _0x5dfc46;let {parentId:_0x5c0992,unitId:_0x40c765,text:_0x1f4797,threadId:_0x11b794}=_0x6fdbb,_0x4e4cb2=((_0x5dfc46=_0x1f4797[_0x316faf(0x125)])==null?void 0x0:_0x5dfc46[_0x316faf(0x13b)](_0x2ce142=>_0x2ce142[_0x316faf(0x15a)]===_0x262129[_0x316faf(0x14a)][_0x316faf(0x130)])[_0x316faf(0x167)](_0x3ae3e7=>_0x3ae3e7[_0x316faf(0x100)]))??[],_0x20a3e0=JSON[_0x316faf(0x13d)](_0x1f4797),_0xffaf21=(await this[_0x316faf(0x144)][_0x316faf(0x118)](_0x40c765))[_0x316faf(0x13c)]();if(_0x5c0992){let _0x2a6bea={'memberId':_0xffaf21,'unitId':_0x40c765,'content':_0x20a3e0,'mention':_0x4e4cb2,'threadId':_0x11b794},_0x2144e8=await this['_httpService'][_0x316faf(0xd9)](_0x316faf(0xe5)+_0x40c765+_0x316faf(0x107),{'body':_0x2a6bea}),_0x302957=_0x2144e8[_0x316faf(0x117)]['reply'];if(_0x2144e8[_0x316faf(0x117)][_0x316faf(0x123)]&&_0x2144e8[_0x316faf(0x117)][_0x316faf(0x123)][_0x316faf(0x114)]!==0x1||!_0x5abe11(_0x302957,_0x11b794)){var _0x185d03;throw Error(((_0x185d03=_0x2144e8[_0x316faf(0x117)][_0x316faf(0x123)])==null?void 0x0:_0x185d03[_0x316faf(0xe0)])??'Comment\x20service\x20did\x20not\x20return\x20the\x20created\x20reply');}return{..._0x6fdbb,'id':_0x302957[_0x316faf(0x153)],'dT':(0x0,_0x262129[_0x316faf(0x124)])(+_0x302957[_0x316faf(0x15e)])[_0x316faf(0x106)](_0x316faf(0x10d)),'personId':_0x302957[_0x316faf(0x13e)]};}{let _0x4377d4={'memberId':_0xffaf21,'unitId':_0x40c765,'content':_0x20a3e0,'mention':_0x4e4cb2},_0x48bf2f=await this[_0x316faf(0x112)][_0x316faf(0xd9)](_0x316faf(0xe5)+_0x40c765+'/add',{'body':_0x4377d4});if(_0x48bf2f[_0x316faf(0x117)]['error']&&_0x48bf2f[_0x316faf(0x117)]['error'][_0x316faf(0x114)]!==0x1||!_0x48bf2f['body'][_0x316faf(0x122)]){var _0x4cf91b;throw Error(((_0x4cf91b=_0x48bf2f['body'][_0x316faf(0x123)])==null?void 0x0:_0x4cf91b['message'])??_0x316faf(0x14e));}return _0x16cc94(_0x48bf2f['body'][_0x316faf(0x122)],_0x6fdbb);}}async[_0x5b5c0f(0x10b)](_0x2027e7){const _0x22f5f8=_0x5b5c0f;var _0x5d13fe;let {text:_0x3345db,unitId:_0x574be7}=_0x2027e7,_0x10149d=((_0x5d13fe=_0x3345db[_0x22f5f8(0x125)])==null?void 0x0:_0x5d13fe['filter'](_0x278061=>_0x278061[_0x22f5f8(0x15a)]===_0x262129[_0x22f5f8(0x14a)][_0x22f5f8(0x130)])['map'](_0x3db87b=>_0x3db87b[_0x22f5f8(0x100)]))??[],_0x2b8231=JSON[_0x22f5f8(0x13d)](_0x3345db),_0x262aba=_0x2027e7['threadId'],_0x550afc=_0x2027e7['id'],_0x20695f={'memberId':(await this[_0x22f5f8(0x144)]['requireSession'](_0x574be7))[_0x22f5f8(0x13c)](),'unitId':_0x574be7,'threadId':_0x262aba,'mention':_0x10149d,'content':_0x2b8231,'replyId':_0x550afc},_0x138e52=await this[_0x22f5f8(0x112)][_0x22f5f8(0xd9)](_0x22f5f8(0xe5)+_0x574be7+_0x22f5f8(0x10a),{'body':_0x20695f});return!_0x138e52['body'][_0x22f5f8(0x123)]||_0x138e52['body']['error'][_0x22f5f8(0x114)]===0x1;}async['resolveComment'](_0x297c8c){const _0x53aa17=_0x5b5c0f;let {unitId:_0x28f3ff}=_0x297c8c,_0x37c16b=_0x297c8c['threadId'],_0x11f1fe={'memberId':(await this['_sessionService'][_0x53aa17(0x118)](_0x28f3ff))[_0x53aa17(0x13c)](),'unitId':_0x28f3ff,'threadId':_0x37c16b,'solved':_0x297c8c[_0x53aa17(0xe3)]?_0x3b15a9[_0x53aa17(0x155)][_0x53aa17(0xe1)]:_0x3b15a9['CommentSolvedStatus']['OpenOrReOpen']},_0x4e56bd=await this[_0x53aa17(0x112)][_0x53aa17(0xd9)](_0x53aa17(0xe5)+_0x28f3ff+'/solved',{'body':_0x11f1fe});return!_0x4e56bd[_0x53aa17(0x117)][_0x53aa17(0x123)]||_0x4e56bd[_0x53aa17(0x117)]['error'][_0x53aa17(0x114)]===0x1;}['deleteComment'](_0x5c151e,_0x2a9456,_0x5e7cf9,_0x5407c1){const _0x454000=_0x5b5c0f;return this[_0x454000(0xf2)](_0x5c151e,_0x5e7cf9,_0x5407c1);}[_0x5b5c0f(0x168)](_0x11b4b3,_0x4ca568,_0x5b0faa){const _0x2b7a94=_0x5b5c0f;return this[_0x2b7a94(0xf2)](_0x11b4b3,_0x5b0faa);}async[_0x5b5c0f(0xf2)](_0x52fdea,_0x372734,_0x15d811){const _0x1ae58a=_0x5b5c0f;let _0x5d163e={'memberId':(await this[_0x1ae58a(0x144)][_0x1ae58a(0x118)](_0x52fdea))[_0x1ae58a(0x13c)](),'threadId':_0x372734,'replyId':_0x15d811,'unitId':_0x52fdea},_0x39bbe7=await this[_0x1ae58a(0x112)][_0x1ae58a(0xd9)]('/universer-api/comment/unit/'+_0x52fdea+_0x1ae58a(0x10e),{'body':_0x5d163e});return!_0x39bbe7[_0x1ae58a(0x117)]['error']||_0x39bbe7[_0x1ae58a(0x117)]['error']['code']===0x1;}async[_0x5b5c0f(0x159)](_0x3fbaa9,_0x5abf2c,_0x36d4a6){const _0x2a9f74=_0x5b5c0f;let _0x55f76f={'unitId':_0x3fbaa9,'threadId':_0x36d4a6},_0x14bf72=await this[_0x2a9f74(0x112)][_0x2a9f74(0xd9)](_0x2a9f74(0xe5)+_0x3fbaa9+_0x2a9f74(0x135),{'body':_0x55f76f});if(_0x14bf72[_0x2a9f74(0x117)]['error']&&_0x14bf72['body'][_0x2a9f74(0x123)]['code']!==0x1)throw Error(_0x14bf72[_0x2a9f74(0x117)][_0x2a9f74(0x123)][_0x2a9f74(0xe0)]||_0x2a9f74(0x161));let _0x3b8958=_0x36d4a6['map'](_0x1b41ea=>{const _0x410c2e=_0x2a9f74;var _0x622320;return _0x2b7458((_0x622320=_0x14bf72[_0x410c2e(0x117)][_0x410c2e(0x104)])==null?void 0x0:_0x622320[_0x1b41ea],_0x1b41ea,_0x3fbaa9,_0x5abf2c);})[_0x2a9f74(0x13b)](Boolean);return Object['values'](_0x14bf72[_0x2a9f74(0x117)]['users']??{})['forEach'](_0xe70d71=>{const _0x24bde5=_0x2a9f74;this[_0x24bde5(0x136)][_0x24bde5(0x11e)](_0xe70d71);}),_0x3b8958;}[_0x5b5c0f(0x14c)](_0x3fa72){const _0x235774=_0x5b5c0f;var _0xbed788;return{'id':_0x3fa72['id'],'threadId':_0x3fa72[_0x235774(0x111)],'ref':_0x3fa72[_0x235774(0x164)],..._0x3fa72[_0x235774(0xfe)]===void 0x0?{}:{'authorName':_0x3fa72[_0x235774(0xfe)],'personId':_0x3fa72['personId']},...(_0xbed788=_0x3fa72[_0x235774(0x11d)])!=null&&_0xbed788[_0x235774(0x12d)](_0x1275e4=>_0x1275e4['authorName']!==void 0x0)?{'children':_0x3fa72[_0x235774(0x11d)][_0x235774(0x13b)](_0x12198e=>_0x12198e[_0x235774(0xfe)]!==void 0x0)[_0x235774(0x167)](_0x34efbb=>({'id':_0x34efbb['id'],'threadId':_0x34efbb[_0x235774(0x111)],'ref':'','parentId':_0x3fa72['id'],'personId':_0x34efbb[_0x235774(0x11a)],'authorName':_0x34efbb['authorName']}))}:{}};}};_0x260c9b=_0x1baa22([_0x4477bb(0x0,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x3c74b7[_0x5b5c0f(0x128)])),_0x4477bb(0x1,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x262129[_0x5b5c0f(0x140)])),_0x4477bb(0x2,(0x0,_0x262129['Inject'])(_0x372be1[_0x5b5c0f(0x129)]))],_0x260c9b);let _0x5ef704=class extends _0x262129[_0x5b5c0f(0x126)]{constructor(_0x4ce89c,_0x38809c){const _0x53a4a5=_0x5b5c0f;super(),this[_0x53a4a5(0x110)]=_0x4ce89c,this['_threadCommentDataSource']=_0x38809c,this['_initDataSource']();}[_0x5b5c0f(0x141)](){const _0x18910b=_0x5b5c0f;this[_0x18910b(0x110)][_0x18910b(0x10f)]=this['_threadCommentDataSource'],this[_0x18910b(0x110)][_0x18910b(0x139)]=!0x1;}};_0x5ef704=_0x1baa22([_0x4477bb(0x0,_0x1af8ca[_0x5b5c0f(0xdf)]),_0x4477bb(0x1,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x260c9b))],_0x5ef704);function _0x118764(_0xb1c811){'@babel/helpers - typeof';const _0x1d7852=_0x5b5c0f;return _0x118764=typeof Symbol==_0x1d7852(0xda)&&typeof Symbol[_0x1d7852(0x119)]==_0x1d7852(0x169)?function(_0x2d2262){return typeof _0x2d2262;}:function(_0x1a3787){const _0x79db69=_0x1d7852;return _0x1a3787&&typeof Symbol=='function'&&_0x1a3787[_0x79db69(0xfc)]===Symbol&&_0x1a3787!==Symbol[_0x79db69(0xde)]?_0x79db69(0x169):typeof _0x1a3787;},_0x118764(_0xb1c811);}function _0x45049c(_0x52af09,_0x30018f){const _0x153f92=_0x5b5c0f;if(_0x118764(_0x52af09)!=_0x153f92(0x11c)||!_0x52af09)return _0x52af09;var _0x36571c=_0x52af09[Symbol[_0x153f92(0x12c)]];if(_0x36571c!==void 0x0){var _0x52dad3=_0x36571c[_0x153f92(0x148)](_0x52af09,_0x30018f||_0x153f92(0xea));if(_0x118764(_0x52dad3)!=_0x153f92(0x11c))return _0x52dad3;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x30018f===_0x153f92(0x160)?String:Number)(_0x52af09);}function _0x6ba1e4(_0x223ffc){const _0x37a2d6=_0x5b5c0f;var _0x3264cf=_0x45049c(_0x223ffc,_0x37a2d6(0x160));return _0x118764(_0x3264cf)==_0x37a2d6(0x169)?_0x3264cf:_0x3264cf+'';}function _0x11d0ab(_0x207fc4,_0x550233,_0x25ff75){const _0x101527=_0x5b5c0f;return(_0x550233=_0x6ba1e4(_0x550233))in _0x207fc4?Object[_0x101527(0x15f)](_0x207fc4,_0x550233,{'value':_0x25ff75,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x207fc4[_0x550233]=_0x25ff75,_0x207fc4;}let _0x1defeb=class extends _0x262129['Plugin']{constructor(_0x100954=_0x4509ed,_0x43a870,_0x2eeea8){const _0x58130b=_0x5b5c0f;super(),this[_0x58130b(0xdd)]=_0x100954,this['_injector']=_0x43a870,this['_configService']=_0x2eeea8;let {..._0x4c40c0}=(0x0,_0x262129[_0x58130b(0x156)])({},_0x4509ed,this[_0x58130b(0xdd)]);this[_0x58130b(0x10c)][_0x58130b(0x154)]('thread-comment-data-source.config',_0x4c40c0);}['onStarting'](){const _0xd5547a=_0x5b5c0f;[[_0x260c9b],[_0x5ef704],[_0xe3e7ad]][_0xd5547a(0x151)](_0x72433a=>{const _0x14df8f=_0xd5547a;this['_injector'][_0x14df8f(0xf5)](_0x72433a);});}['onReady'](){const _0x26d99c=_0x5b5c0f;this[_0x26d99c(0x162)][_0x26d99c(0x150)](_0x5ef704),this['_injector'][_0x26d99c(0x150)](_0xe3e7ad);}};_0x11d0ab(_0x1defeb,_0x5b5c0f(0x138),_0x5b5c0f(0xf1)),_0x11d0ab(_0x1defeb,'packageName',_0x44e29e),_0x11d0ab(_0x1defeb,_0x5b5c0f(0xfd),_0x34fe59),_0x1defeb=_0x1baa22([(0x0,_0x262129[_0x5b5c0f(0xf8)])(_0x2c47f5[_0x5b5c0f(0xf6)],_0x3c74b7['UniverNetworkPlugin'],_0x1af8ca['UniverThreadCommentPlugin'],_0x11b9a5[_0x5b5c0f(0x127)],_0x372be1[_0x5b5c0f(0xee)]),_0x4477bb(0x1,(0x0,_0x262129[_0x5b5c0f(0x15c)])(_0x262129[_0x5b5c0f(0xd8)])),_0x4477bb(0x2,_0x262129[_0x5b5c0f(0xfa)])],_0x1defeb),Object['defineProperty'](_0x4cfc50,'UniverThreadCommentDataSourcePlugin',{'enumerable':!0x0,'get':function(){return _0x1defeb;}});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Remote data source integration for Univer thread comments.",
|
|
6
6
|
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
@@ -51,19 +51,19 @@
|
|
|
51
51
|
"rxjs": ">=7.0.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@univerjs-pro/collaboration-client": "1.0.0
|
|
55
|
-
"@univerjs-pro/license": "1.0.0
|
|
56
|
-
"@univerjs/core": "1.0.0
|
|
57
|
-
"@univerjs/network": "1.0.0
|
|
58
|
-
"@univerjs/protocol": "1.0.0
|
|
59
|
-
"@univerjs/thread-comment": "1.0.0
|
|
60
|
-
"@univerjs/thread-comment-ui": "1.0.0
|
|
54
|
+
"@univerjs-pro/collaboration-client": "1.0.0",
|
|
55
|
+
"@univerjs-pro/license": "1.0.0",
|
|
56
|
+
"@univerjs/core": "1.0.0",
|
|
57
|
+
"@univerjs/network": "1.0.0",
|
|
58
|
+
"@univerjs/protocol": "1.0.0",
|
|
59
|
+
"@univerjs/thread-comment": "1.0.0",
|
|
60
|
+
"@univerjs/thread-comment-ui": "1.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@univerjs-infra/shared": "1.0.0
|
|
63
|
+
"@univerjs-infra/shared": "1.0.0",
|
|
64
64
|
"rxjs": "7.8.2",
|
|
65
65
|
"typescript": "^6.0.3",
|
|
66
|
-
"vitest": "^
|
|
66
|
+
"vitest": "^5.0.0"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"test": "vitest run",
|