@univerjs-pro/thread-comment-datasource 1.0.0-alpha.2 → 1.0.0-alpha.3
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/README.md +3 -3
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# @univerjs-pro/thread-comment-datasource
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.com/package/@univerjs-pro/thread-comment-datasource)
|
|
4
|
+
[](https://npmjs.com/package/@univerjs-pro/thread-comment-datasource)
|
|
4
5
|
[](https://npmjs.com/package/@univerjs-pro/thread-comment-datasource)
|
|
5
6
|
|
|
6
|
-
`@univerjs-pro/thread-comment-datasource`
|
|
7
|
+
`@univerjs-pro/thread-comment-datasource` is part of Univer Pro. Remote data source integration for Univer thread comments.
|
|
7
8
|
|
|
8
9
|
## Package Overview
|
|
9
10
|
|
|
@@ -31,10 +32,9 @@ univer.registerPlugin(UniverThreadCommentDataSourcePlugin);
|
|
|
31
32
|
|
|
32
33
|
## Integration Notes
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
- Keep this package on the same version as the other `@univerjs/*` and `@univerjs-pro/*` packages in your application.
|
|
35
36
|
|
|
36
37
|
## Resources
|
|
37
38
|
|
|
38
39
|
- [Documentation](https://docs.univer.ai/guides/pro)
|
|
39
40
|
- [NPM package](https://npmjs.com/package/@univerjs-pro/thread-comment-datasource)
|
|
40
|
-
|
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3f6c43=_0x2d04;(function(_0x27e85e,_0x1775de){const _0x1701e1=_0x2d04,_0x4f72a3=_0x27e85e();while(!![]){try{const _0x5b415e=-parseInt(_0x1701e1(0xe9))/0x1+parseInt(_0x1701e1(0x150))/0x2*(-parseInt(_0x1701e1(0x124))/0x3)+-parseInt(_0x1701e1(0x128))/0x4+-parseInt(_0x1701e1(0x116))/0x5*(-parseInt(_0x1701e1(0x141))/0x6)+parseInt(_0x1701e1(0xf2))/0x7*(-parseInt(_0x1701e1(0xf4))/0x8)+-parseInt(_0x1701e1(0x108))/0x9+parseInt(_0x1701e1(0x10b))/0xa;if(_0x5b415e===_0x1775de)break;else _0x4f72a3['push'](_0x4f72a3['shift']());}catch(_0x342629){_0x4f72a3['push'](_0x4f72a3['shift']());}}}(_0x288b,0x6bfd3),Object[_0x3f6c43(0x14d)](exports,Symbol[_0x3f6c43(0xe8)],{'value':_0x3f6c43(0xfa)}));let e=require('@univerjs-pro/collaboration-client'),t=require('@univerjs-pro/license'),n=require('@univerjs/core'),r=require('@univerjs/thread-comment-ui'),i=require('@univerjs/protocol'),a=require('@univerjs/thread-comment'),o=require('rxjs'),s=require('@univerjs/network');var c='@univerjs-pro/thread-comment-datasource',l=_0x3f6c43(0xe2);const u=_0x35edca=>(0x0,n[_0x3f6c43(0x152)])(new Date(+_0x35edca))['format'](_0x3f6c43(0x123)),d=async(_0x16976c,_0x18c431)=>{const _0x4f2f94=_0x3f6c43;let _0x1b5e3b=_0x16976c['get'](n['UserManagerService']),_0x129e35=_0x16976c[_0x4f2f94(0x13b)](s[_0x4f2f94(0x155)]);_0x18c431[_0x4f2f94(0x10c)](_0xc5f8a1=>{const _0x104c4f=_0x4f2f94;_0x1b5e3b[_0x104c4f(0x131)](_0xc5f8a1)&&_0x18c431[_0x104c4f(0x143)](_0xc5f8a1);}),_0x18c431[_0x4f2f94(0x133)]&&(await _0x129e35[_0x4f2f94(0x13b)](_0x4f2f94(0xfe),{'params':{'userIDs':[..._0x18c431]}}))[_0x4f2f94(0x13d)][_0x4f2f94(0x112)][_0x4f2f94(0x10c)](_0x3d1312=>{const _0x4e51d=_0x4f2f94;_0x3d1312&&_0x1b5e3b[_0x4e51d(0x13c)](_0x3d1312);});};function f(_0x2876a0,_0x32fcc6){return function(_0x147e75,_0x167c22){_0x32fcc6(_0x147e75,_0x167c22,_0x2876a0);};}function p(_0x5893d5,_0x455ad2,_0x32a2ef,_0x17c4ab){const _0x39bbce=_0x3f6c43;var _0x13db62=arguments[_0x39bbce(0x12b)],_0x838b35=_0x13db62<0x3?_0x455ad2:_0x17c4ab===null?_0x17c4ab=Object[_0x39bbce(0x134)](_0x455ad2,_0x32a2ef):_0x17c4ab,_0x5121f1;if(typeof Reflect==_0x39bbce(0x118)&&typeof Reflect['decorate']==_0x39bbce(0x129))_0x838b35=Reflect[_0x39bbce(0xf0)](_0x5893d5,_0x455ad2,_0x32a2ef,_0x17c4ab);else{for(var _0xacd079=_0x5893d5[_0x39bbce(0x12b)]-0x1;_0xacd079>=0x0;_0xacd079--)(_0x5121f1=_0x5893d5[_0xacd079])&&(_0x838b35=(_0x13db62<0x3?_0x5121f1(_0x838b35):_0x13db62>0x3?_0x5121f1(_0x455ad2,_0x32a2ef,_0x838b35):_0x5121f1(_0x455ad2,_0x32a2ef))||_0x838b35);}return _0x13db62>0x3&&_0x838b35&&Object[_0x39bbce(0x14d)](_0x455ad2,_0x32a2ef,_0x838b35),_0x838b35;}function _0x288b(){const _0x435210=['userID','IThreadCommentDataSourceService','_injector','/universer-api/comment/unit/','1.0.0-alpha.2','UniverCollaborationClientPlugin','_init','getMemberID','_configService','Inject','toStringTag','263131GSNqjS','_config','string','getComment','content','reply','code','decorate','filter','259foHTkQ','UniverThreadCommentDataSourcePlugin','181816oWWJKs','CommentService','_userService','rangeType','CustomRangeType','onReady','Module','slice','CollaborationSessionService','listComments','/universer-api/user/list','packageName','syncUpdateMutationToColla','thread-comment-data-source.config','/add','threadId','post','_commentService','userId','_initDataSource','5987997FWnruv','_initUserSync','comments','19589160zYrgSt','forEach','call','deleteComment','resolveComment','toPrimitive','UniverLicensePlugin','users','addComment','replyId','saveCommentToSnapshot','4113805oCNRgP','format','object','subscribe','pluginName','UserManagerService','createTimestamp','_sessionService','/reply','find','onStarting','rangeId','CommentUpdateEventType','YYYY/MM/DD\x20HH:mm','75mniAAO','requireSession','solved','/delete','499464NVejaN','function','parentId','length','IConfigService','constructor','payload','DependentOn','root','getUser','type','size','getOwnPropertyDescriptor','/edit','updateComment','disposeWithMe','Disposable','Solved','ThreadCommentModel','get','addUser','body','_threadCommentDataSourceService','bufferTime','Plugin','6jgzrNy','version','delete','unitId','commentUpdate$','Reply','user','replies','map','pipe','add','parse','defineProperty','Edit','/list','35610EEpTEw','Delete','dateKit','CommentSolvedStatus','_threadCommentModel','HTTPService','COMMENT','_threadCommentDataSource','error','symbol','_httpService','/solved','stringify'];_0x288b=function(){return _0x435210;};return _0x288b();}let m=class extends n[_0x3f6c43(0x138)]{constructor(_0x437679,_0x57f8b4,_0x10ee19,_0x1bd6b3){const _0x55f2db=_0x3f6c43;super(),this[_0x55f2db(0x105)]=_0x437679,this[_0x55f2db(0x154)]=_0x57f8b4,this[_0x55f2db(0xf6)]=_0x10ee19,this[_0x55f2db(0xe0)]=_0x1bd6b3,this[_0x55f2db(0xe4)](),this['_initUserSync']();}[_0x3f6c43(0x109)](){const _0x5981f8=_0x3f6c43;this[_0x5981f8(0x137)](this[_0x5981f8(0x154)][_0x5981f8(0x145)][_0x5981f8(0x14a)]((0x0,o[_0x5981f8(0x13f)])(0x10))[_0x5981f8(0x119)](_0x56c532=>{const _0x2157ea=_0x5981f8;let _0x14d83b=new Set();_0x56c532[_0x2157ea(0x10c)](_0x468969=>{const _0x5f36e8=_0x2157ea;switch(_0x468969[_0x5f36e8(0x132)]){case'add':{let _0x5b0ff3=_0x468969[_0x5f36e8(0x12e)]['personId'];_0x14d83b[_0x5f36e8(0x14b)](_0x5b0ff3);break;}default:break;}}),d(this[_0x2157ea(0xe0)],_0x14d83b);}));}['_init'](){const _0x99e320=_0x3f6c43;this[_0x99e320(0x137)](this[_0x99e320(0x105)][_0x99e320(0x145)][_0x99e320(0x119)](async _0xbf7450=>{const _0x4290f3=_0x99e320;var _0x1959d8;let _0x150148=(_0x1959d8=this[_0x4290f3(0x154)]['getUnit'](_0xbf7450[_0x4290f3(0x144)])[_0x4290f3(0x11f)](_0x3347e7=>_0x3347e7['threadId']===_0xbf7450[_0x4290f3(0x103)]))==null?void 0x0:_0x1959d8['root'];if(!_0x150148)return;let {unitId:_0x2979ec,subUnitId:_0x5c1c43}=_0x150148;switch(_0xbf7450[_0x4290f3(0x147)]&&this[_0x4290f3(0xf6)]['addUser'](_0xbf7450[_0x4290f3(0x147)]),_0xbf7450[_0x4290f3(0x132)]){case i[_0x4290f3(0x122)]['Add']:break;case i[_0x4290f3(0x122)][_0x4290f3(0x146)]:var _0x231143,_0x357eab;this[_0x4290f3(0x154)][_0x4290f3(0x113)](_0x2979ec,_0x5c1c43,{'unitId':_0x2979ec,'subUnitId':_0x5c1c43,'ref':'','id':_0xbf7450[_0x4290f3(0x114)],'dT':u(+_0xbf7450[_0x4290f3(0x11c)]),'threadId':_0xbf7450[_0x4290f3(0x103)],'personId':(_0x231143=(_0x357eab=_0xbf7450['user'])==null?void 0x0:_0x357eab[_0x4290f3(0xde)])==null?_0xbf7450[_0x4290f3(0x106)]:_0x231143,'text':JSON[_0x4290f3(0x14c)](_0xbf7450['content']),'parentId':_0x150148['id']});break;case i['CommentUpdateEventType'][_0x4290f3(0x151)]:{let _0x11007b=this[_0x4290f3(0x154)][_0x4290f3(0xec)](_0x2979ec,_0x5c1c43,_0xbf7450[_0x4290f3(0x114)]);_0x11007b&&_0x11007b[_0x4290f3(0x12a)]&&this[_0x4290f3(0x154)][_0x4290f3(0x10e)](_0x2979ec,_0x5c1c43,_0xbf7450['replyId']);break;}case i[_0x4290f3(0x122)][_0x4290f3(0x14e)]:this[_0x4290f3(0x154)]['updateComment'](_0x2979ec,_0x5c1c43,{'commentId':_0xbf7450[_0x4290f3(0x114)],'text':JSON[_0x4290f3(0x14c)](_0xbf7450[_0x4290f3(0xed)])});break;case i[_0x4290f3(0x122)]['Solve']:{var _0x2a0221;let _0x1547fa=(_0x2a0221=this['_threadCommentModel']['getUnit'](_0xbf7450[_0x4290f3(0x144)])[_0x4290f3(0x11f)](_0x999bef=>_0x999bef[_0x4290f3(0x103)]===_0xbf7450['threadId']))==null?void 0x0:_0x2a0221[_0x4290f3(0x130)];_0x1547fa&&this[_0x4290f3(0x154)][_0x4290f3(0x10f)](_0x2979ec,_0x5c1c43,_0x1547fa['id'],_0xbf7450['solved']===i['CommentSolvedStatus'][_0x4290f3(0x139)]);break;}default:break;}}));}};function _0x2d04(_0xe6302b,_0x3f5506){_0xe6302b=_0xe6302b-0xde;const _0x288b4d=_0x288b();let _0x2d04f7=_0x288b4d[_0xe6302b];return _0x2d04f7;}m=p([f(0x0,(0x0,n[_0x3f6c43(0xe7)])(e[_0x3f6c43(0xf5)])),f(0x1,(0x0,n[_0x3f6c43(0xe7)])(a[_0x3f6c43(0x13a)])),f(0x2,(0x0,n[_0x3f6c43(0xe7)])(n['UserManagerService'])),f(0x3,(0x0,n[_0x3f6c43(0xe7)])(n['Injector']))],m);const h={};function g(_0x24b901,_0x16a960){const _0x19a669=_0x3f6c43;let _0x406103=_0x24b901[_0x19a669(0x148)][0x0];return{..._0x16a960,'id':_0x406103[_0x19a669(0x114)],'resolved':_0x24b901[_0x19a669(0x126)]===0x1,'dT':u(_0x406103['createTimestamp']),'personId':_0x406103['userId'],'threadId':_0x406103[_0x19a669(0x103)]};}function _(_0x3ffd2a,_0x589dc9,_0x3095fa){const _0x2620ff=_0x3f6c43;var _0x12b039,_0x5b2179;if(((_0x12b039=_0x3ffd2a==null||(_0x5b2179=_0x3ffd2a[_0x2620ff(0x148)])==null?void 0x0:_0x5b2179[_0x2620ff(0x12b)])==null?0x0:_0x12b039)>0x0){let _0x217f35=(_0x13ec3a,_0x34737e)=>({'id':_0x13ec3a[_0x2620ff(0x114)],'threadId':_0x13ec3a[_0x2620ff(0x103)],'dT':u(_0x13ec3a[_0x2620ff(0x11c)]),'personId':_0x13ec3a[_0x2620ff(0x106)],'resolved':_0x3ffd2a[_0x2620ff(0x126)]===i[_0x2620ff(0x153)]['Solved'],'unitId':_0x589dc9,'subUnitId':_0x3095fa,'text':JSON[_0x2620ff(0x14c)](_0x13ec3a[_0x2620ff(0xed)]),'parentId':_0x34737e}),_0x5d8304=_0x217f35(_0x3ffd2a[_0x2620ff(0x148)][0x0]);return{..._0x5d8304,'children':_0x3ffd2a['replies'][_0x2620ff(0xfb)](0x1)[_0x2620ff(0x149)](_0x224d0b=>_0x217f35(_0x224d0b,_0x5d8304['id']))};}return null;}let v=class{constructor(_0x105438,_0x17a48a,_0x3c3a35){const _0x4e07a1=_0x3f6c43;this['_httpService']=_0x105438,this[_0x4e07a1(0xf6)]=_0x17a48a,this[_0x4e07a1(0x11d)]=_0x3c3a35;}async['addComment'](_0x3d78d8){const _0x30954b=_0x3f6c43;var _0x4d5106,_0x51b639;let {parentId:_0x23ec29,unitId:_0x354947,text:_0x224ebf,threadId:_0x36167a}=_0x3d78d8,_0x59ecad=(_0x4d5106=(_0x51b639=_0x224ebf['customRanges'])==null?void 0x0:_0x51b639[_0x30954b(0xf1)](_0x33ccff=>_0x33ccff[_0x30954b(0xf7)]===n[_0x30954b(0xf8)][_0x30954b(0x156)])[_0x30954b(0x149)](_0x2ae099=>_0x2ae099['rangeId']))==null?[]:_0x4d5106,_0x2efdf1=JSON[_0x30954b(0x15c)](_0x224ebf),_0x204439=(await this[_0x30954b(0x11d)]['requireSession'](_0x354947))[_0x30954b(0xe5)]();if(_0x23ec29){let _0x18c9ff={'memberId':_0x204439,'unitId':_0x354947,'content':_0x2efdf1,'mention':_0x59ecad,'threadId':_0x36167a},_0x2414e6=(await this[_0x30954b(0x15a)]['post'](_0x30954b(0xe1)+_0x354947+_0x30954b(0x11e),{'body':_0x18c9ff}))[_0x30954b(0x13d)][_0x30954b(0xee)];return{..._0x3d78d8,'id':_0x2414e6['replyId'],'dT':(0x0,n['dateKit'])(+_0x2414e6[_0x30954b(0x11c)])[_0x30954b(0x117)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2414e6['userId']};}else{let _0x9bcb9e={'memberId':_0x204439,'unitId':_0x354947,'content':_0x2efdf1,'mention':_0x59ecad};return g((await this[_0x30954b(0x15a)][_0x30954b(0x104)](_0x30954b(0xe1)+_0x354947+_0x30954b(0x102),{'body':_0x9bcb9e}))['body']['comment'],_0x3d78d8);}}async[_0x3f6c43(0x136)](_0x45721b){const _0x4d5dae=_0x3f6c43;var _0x227727,_0x110a25;let {text:_0x13b8fb,unitId:_0x12da21}=_0x45721b,_0x422fa2=(_0x227727=(_0x110a25=_0x13b8fb['customRanges'])==null?void 0x0:_0x110a25['filter'](_0x182140=>_0x182140[_0x4d5dae(0xf7)]===n[_0x4d5dae(0xf8)]['COMMENT'])[_0x4d5dae(0x149)](_0x753a19=>_0x753a19[_0x4d5dae(0x121)]))==null?[]:_0x227727,_0x247c2f=JSON[_0x4d5dae(0x15c)](_0x13b8fb),_0x5cb8eb=_0x45721b[_0x4d5dae(0x103)],_0x46bd49=_0x45721b['id'],_0x6b9632={'memberId':(await this[_0x4d5dae(0x11d)][_0x4d5dae(0x125)](_0x12da21))[_0x4d5dae(0xe5)](),'unitId':_0x12da21,'threadId':_0x5cb8eb,'mention':_0x422fa2,'content':_0x247c2f,'replyId':_0x46bd49},_0x293376=await this[_0x4d5dae(0x15a)][_0x4d5dae(0x104)](_0x4d5dae(0xe1)+_0x12da21+_0x4d5dae(0x135),{'body':_0x6b9632});return!_0x293376[_0x4d5dae(0x13d)][_0x4d5dae(0x158)]||_0x293376['body']['error']['code']===0x1;}async['resolveComment'](_0x8e35a1){const _0x34dda5=_0x3f6c43;let {unitId:_0x20ffc5}=_0x8e35a1,_0x334341=_0x8e35a1[_0x34dda5(0x103)],_0x426f4c={'memberId':this[_0x34dda5(0xf6)]['getCurrentUser']()['userID'],'unitId':_0x20ffc5,'threadId':_0x334341,'solved':_0x8e35a1['resolved']?i['CommentSolvedStatus']['Solved']:i[_0x34dda5(0x153)]['OpenOrReOpen']},_0x54e948=await this['_httpService'][_0x34dda5(0x104)](_0x34dda5(0xe1)+_0x20ffc5+_0x34dda5(0x15b),{'body':_0x426f4c});return!_0x54e948[_0x34dda5(0x13d)][_0x34dda5(0x158)]||_0x54e948[_0x34dda5(0x13d)]['error'][_0x34dda5(0xef)]===0x1;}async['deleteComment'](_0x4bbc41,_0x4252ae,_0x10f928,_0x3a9a90){const _0x142d59=_0x3f6c43;let _0x36bc6d={'memberId':(await this[_0x142d59(0x11d)]['requireSession'](_0x4bbc41))[_0x142d59(0xe5)](),'threadId':_0x10f928,'replyId':_0x3a9a90,'unitId':_0x4bbc41},_0x10807b=await this[_0x142d59(0x15a)]['post'](_0x142d59(0xe1)+_0x4bbc41+_0x142d59(0x127),{'body':_0x36bc6d});return!_0x10807b[_0x142d59(0x13d)][_0x142d59(0x158)]||_0x10807b[_0x142d59(0x13d)][_0x142d59(0x158)][_0x142d59(0xef)]===0x1;}async[_0x3f6c43(0xfd)](_0x10ac2a,_0x282052,_0x477cc9){const _0xa49b28=_0x3f6c43;let _0x5575ef={'unitId':_0x10ac2a,'threadId':_0x477cc9},_0xae03a6=await this[_0xa49b28(0x15a)][_0xa49b28(0x104)]('/universer-api/comment/unit/'+_0x10ac2a+_0xa49b28(0x14f),{'body':_0x5575ef}),_0x166f03=_0x477cc9['map'](_0x332833=>_(_0xae03a6[_0xa49b28(0x13d)][_0xa49b28(0x10a)][_0x332833],_0x10ac2a,_0x282052))[_0xa49b28(0xf1)](Boolean);return Object['values'](_0xae03a6[_0xa49b28(0x13d)][_0xa49b28(0x112)])[_0xa49b28(0x10c)](_0x52b35a=>{this['_userService']['addUser'](_0x52b35a);}),_0x166f03;}[_0x3f6c43(0x115)](_0x5163be){const _0x3af1d0=_0x3f6c43;return{'id':_0x5163be['id'],'threadId':_0x5163be[_0x3af1d0(0x103)],'ref':_0x5163be['ref']};}};v=p([f(0x0,(0x0,n[_0x3f6c43(0xe7)])(s[_0x3f6c43(0x155)])),f(0x1,(0x0,n[_0x3f6c43(0xe7)])(n[_0x3f6c43(0x11b)])),f(0x2,(0x0,n[_0x3f6c43(0xe7)])(e[_0x3f6c43(0xfc)]))],v);let y=class extends n[_0x3f6c43(0x138)]{constructor(_0x3ae8ec,_0x5238bd){const _0x5b5a69=_0x3f6c43;super(),this[_0x5b5a69(0x13e)]=_0x3ae8ec,this[_0x5b5a69(0x157)]=_0x5238bd,this[_0x5b5a69(0x107)]();}[_0x3f6c43(0x107)](){const _0x47d325=_0x3f6c43;this['_threadCommentDataSourceService']['dataSource']=this[_0x47d325(0x157)],this[_0x47d325(0x13e)][_0x47d325(0x100)]=!0x1;}};y=p([f(0x0,a[_0x3f6c43(0xdf)]),f(0x1,(0x0,n[_0x3f6c43(0xe7)])(v))],y);function b(_0x2ef2ac){'@babel/helpers - typeof';const _0x115b95=_0x3f6c43;return b=typeof Symbol=='function'&&typeof Symbol['iterator']==_0x115b95(0x159)?function(_0x22e5a7){return typeof _0x22e5a7;}:function(_0x2cf449){const _0x4a8245=_0x115b95;return _0x2cf449&&typeof Symbol=='function'&&_0x2cf449[_0x4a8245(0x12d)]===Symbol&&_0x2cf449!==Symbol['prototype']?_0x4a8245(0x159):typeof _0x2cf449;},b(_0x2ef2ac);}function x(_0x3fa8b6,_0x41d5e2){const _0xd1a8ab=_0x3f6c43;if(b(_0x3fa8b6)!=_0xd1a8ab(0x118)||!_0x3fa8b6)return _0x3fa8b6;var _0x739989=_0x3fa8b6[Symbol[_0xd1a8ab(0x110)]];if(_0x739989!==void 0x0){var _0x3359f3=_0x739989[_0xd1a8ab(0x10d)](_0x3fa8b6,_0x41d5e2||'default');if(b(_0x3359f3)!=_0xd1a8ab(0x118))return _0x3359f3;throw TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x41d5e2===_0xd1a8ab(0xeb)?String:Number)(_0x3fa8b6);}function S(_0x4198b2){const _0x271e3e=_0x3f6c43;var _0x5550d4=x(_0x4198b2,_0x271e3e(0xeb));return b(_0x5550d4)==_0x271e3e(0x159)?_0x5550d4:_0x5550d4+'';}function C(_0x35e039,_0x32844e,_0x5e30c8){const _0x3ccf06=_0x3f6c43;return(_0x32844e=S(_0x32844e))in _0x35e039?Object[_0x3ccf06(0x14d)](_0x35e039,_0x32844e,{'value':_0x5e30c8,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x35e039[_0x32844e]=_0x5e30c8,_0x35e039;}let w=class extends n[_0x3f6c43(0x140)]{constructor(_0x3feb08=h,_0x2a2c3d,_0x49d0e2){const _0x5d3cde=_0x3f6c43;super(),this['_config']=_0x3feb08,this[_0x5d3cde(0xe0)]=_0x2a2c3d,this['_configService']=_0x49d0e2;let {..._0xc6300a}=(0x0,n['merge'])({},h,this[_0x5d3cde(0xea)]);this[_0x5d3cde(0xe6)]['setConfig'](_0x5d3cde(0x101),_0xc6300a);}[_0x3f6c43(0x120)](){[[v],[y],[m]]['forEach'](_0x5d0b41=>{const _0x29a68c=_0x2d04;this[_0x29a68c(0xe0)]['add'](_0x5d0b41);});}[_0x3f6c43(0xf9)](){const _0x3d85f6=_0x3f6c43;this[_0x3d85f6(0xe0)][_0x3d85f6(0x13b)](y),this[_0x3d85f6(0xe0)][_0x3d85f6(0x13b)](m);}};C(w,_0x3f6c43(0x11a),'UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN'),C(w,_0x3f6c43(0xff),c),C(w,_0x3f6c43(0x142),l),w=p([(0x0,n[_0x3f6c43(0x12f)])(r['UniverThreadCommentUIPlugin'],e[_0x3f6c43(0xe3)],t[_0x3f6c43(0x111)]),f(0x1,(0x0,n[_0x3f6c43(0xe7)])(n['Injector'])),f(0x2,n[_0x3f6c43(0x12c)])],w),Object[_0x3f6c43(0x14d)](exports,_0x3f6c43(0xf3),{'enumerable':!0x0,'get':function(){return w;}});
|
|
1
|
+
const _0x96b8fd=_0x404d;(function(_0x319c6e,_0x3e56dd){const _0x353c4a=_0x404d,_0x4ff8ae=_0x319c6e();while(!![]){try{const _0xedb761=-parseInt(_0x353c4a(0xd7))/0x1*(parseInt(_0x353c4a(0x10e))/0x2)+parseInt(_0x353c4a(0xce))/0x3+parseInt(_0x353c4a(0x118))/0x4*(-parseInt(_0x353c4a(0xfc))/0x5)+-parseInt(_0x353c4a(0x101))/0x6*(parseInt(_0x353c4a(0xb2))/0x7)+-parseInt(_0x353c4a(0x124))/0x8*(-parseInt(_0x353c4a(0x132))/0x9)+-parseInt(_0x353c4a(0xe6))/0xa*(-parseInt(_0x353c4a(0x119))/0xb)+parseInt(_0x353c4a(0xca))/0xc;if(_0xedb761===_0x3e56dd)break;else _0x4ff8ae['push'](_0x4ff8ae['shift']());}catch(_0x50a3ec){_0x4ff8ae['push'](_0x4ff8ae['shift']());}}}(_0x4ab9,0xcafb8),Object[_0x96b8fd(0x128)](exports,Symbol[_0x96b8fd(0x125)],{'value':'Module'}));let e=require('@univerjs-pro/collaboration-client'),t=require('@univerjs-pro/license'),n=require('@univerjs/core'),r=require('@univerjs/thread-comment-ui'),i=require('@univerjs/protocol'),a=require('@univerjs/thread-comment'),o=require('rxjs'),s=require('@univerjs/network');function _0x404d(_0x28fe46,_0x1d57a8){_0x28fe46=_0x28fe46-0xb0;const _0x4ab94a=_0x4ab9();let _0x404daa=_0x4ab94a[_0x28fe46];return _0x404daa;}var c=_0x96b8fd(0xf5),l=_0x96b8fd(0x104);const u={},d=_0x470ca0=>(0x0,n[_0x96b8fd(0xfa)])(new Date(+_0x470ca0))['format'](_0x96b8fd(0xee)),f=async(_0x566398,_0x310626)=>{const _0x35f3ec=_0x96b8fd;let _0x4d3851=_0x566398['get'](n['UserManagerService']),_0x4c4d6d=_0x566398[_0x35f3ec(0x120)](s[_0x35f3ec(0xdb)]);_0x310626[_0x35f3ec(0x135)](_0x237702=>{const _0x40d4bc=_0x35f3ec;_0x4d3851[_0x40d4bc(0xf6)](_0x237702)&&_0x310626[_0x40d4bc(0x133)](_0x237702);}),_0x310626[_0x35f3ec(0x12d)]&&(await _0x4c4d6d['get'](_0x35f3ec(0xcf),{'params':{'userIDs':[..._0x310626]}}))['body'][_0x35f3ec(0xfb)][_0x35f3ec(0x135)](_0x27d8f8=>{const _0x2f0324=_0x35f3ec;_0x27d8f8&&_0x4d3851[_0x2f0324(0xb0)](_0x27d8f8);});};function p(_0x7f3845,_0x1d02b9){return function(_0x3ec428,_0x2a007c){_0x1d02b9(_0x3ec428,_0x2a007c,_0x7f3845);};}function _0x4ab9(){const _0x5e7a82=['IConfigService','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','IThreadCommentDataSourceService','HTTPService','CommentService','_initDataSource','_threadCommentDataSourceService','comments','UniverThreadCommentUIPlugin','post','/list','values','syncUpdateMutationToColla','onStarting','10IWWZom','filter','comment','_config','userId','_userService','_sessionService','/edit','YYYY/MM/DD\x20HH:mm','Injector','packageName','toPrimitive','CustomRangeType','body','CollaborationSessionService','@univerjs-pro/thread-comment-datasource','getUser','setConfig','Inject','getOwnPropertyDescriptor','dateKit','users','860LaicEI','resolveComment','getCurrentUser','_commentService','bufferTime','6930372JJNveK','Disposable','userID','1.0.0-alpha.3','Solved','version','iterator','rangeId','string','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','decorate','pipe','UserManagerService','132428OYUmeu','ThreadCommentModel','addComment','Solve','slice','format','createTimestamp','parentId','CommentUpdateEventType','type','25060OSgaTY','7508974jGOYEJ','unitId','dataSource','_init','parse','ref','listComments','get','Delete','default','customRanges','40qSYcXt','toStringTag','object','getComment','defineProperty','map','_httpService','OpenOrReOpen','UniverCollaborationClientPlugin','size','subscribe','requireSession','threadId','user','1109646sRjqBR','delete','COMMENT','forEach','addUser','Plugin','7urDLbY','error','DependentOn','replies','onReady','code','symbol','_threadCommentDataSource','commentUpdate$','personId','prototype','/universer-api/comment/unit/','deleteComment','/solved','updateComment','stringify','content','_injector','UniverThreadCommentDataSourcePlugin','replyId','solved','/delete','getUnit','Edit','28906524RrtRmZ','add','rangeType','getMemberID','2239713zyVeqj','/universer-api/user/list','_threadCommentModel','_configService','pluginName','disposeWithMe','CommentSolvedStatus','resolved','function','21cVAugW'];_0x4ab9=function(){return _0x5e7a82;};return _0x4ab9();}function m(_0x4933f0,_0x140832,_0x190173,_0x157a84){const _0xbfd435=_0x96b8fd;var _0x30dae0=arguments['length'],_0x471b66=_0x30dae0<0x3?_0x140832:_0x157a84===null?_0x157a84=Object[_0xbfd435(0xf9)](_0x140832,_0x190173):_0x157a84,_0x306c6a;if(typeof Reflect==_0xbfd435(0x126)&&typeof Reflect[_0xbfd435(0x10b)]==_0xbfd435(0xd6))_0x471b66=Reflect['decorate'](_0x4933f0,_0x140832,_0x190173,_0x157a84);else{for(var _0x2a020c=_0x4933f0['length']-0x1;_0x2a020c>=0x0;_0x2a020c--)(_0x306c6a=_0x4933f0[_0x2a020c])&&(_0x471b66=(_0x30dae0<0x3?_0x306c6a(_0x471b66):_0x30dae0>0x3?_0x306c6a(_0x140832,_0x190173,_0x471b66):_0x306c6a(_0x140832,_0x190173))||_0x471b66);}return _0x30dae0>0x3&&_0x471b66&&Object[_0xbfd435(0x128)](_0x140832,_0x190173,_0x471b66),_0x471b66;}let h=class extends n['Disposable']{constructor(_0x43b692,_0x4ba4bc,_0x5b503b,_0x177d87){const _0x455795=_0x96b8fd;super(),this[_0x455795(0xff)]=_0x43b692,this['_threadCommentModel']=_0x4ba4bc,this[_0x455795(0xeb)]=_0x5b503b,this[_0x455795(0xc3)]=_0x177d87,this[_0x455795(0x11c)](),this['_initUserSync']();}['_initUserSync'](){const _0x4f079d=_0x96b8fd;this[_0x4f079d(0xd3)](this[_0x4f079d(0xd0)]['commentUpdate$'][_0x4f079d(0x10c)]((0x0,o[_0x4f079d(0x100)])(0x10))[_0x4f079d(0x12e)](_0x3dd7f4=>{const _0x13c325=_0x4f079d;let _0x1433d3=new Set();_0x3dd7f4[_0x13c325(0x135)](_0x2a78b3=>{const _0x50ff36=_0x13c325;switch(_0x2a78b3[_0x50ff36(0x117)]){case _0x50ff36(0xcb):{let _0x56d253=_0x2a78b3['payload'][_0x50ff36(0xbb)];_0x1433d3[_0x50ff36(0xcb)](_0x56d253);break;}default:break;}}),f(this[_0x13c325(0xc3)],_0x1433d3);}));}[_0x96b8fd(0x11c)](){const _0x59c89a=_0x96b8fd;this['disposeWithMe'](this[_0x59c89a(0xff)][_0x59c89a(0xba)][_0x59c89a(0x12e)](async _0x139380=>{const _0x20138d=_0x59c89a;var _0x486261;let _0x1b166d=(_0x486261=this[_0x20138d(0xd0)][_0x20138d(0xc8)](_0x139380[_0x20138d(0x11a)])['find'](_0x566227=>_0x566227[_0x20138d(0x130)]===_0x139380[_0x20138d(0x130)]))==null?void 0x0:_0x486261['root'];if(!_0x1b166d)return;let {unitId:_0x395093,subUnitId:_0x41a54f}=_0x1b166d;switch(_0x139380[_0x20138d(0x131)]&&this[_0x20138d(0xeb)][_0x20138d(0xb0)](_0x139380[_0x20138d(0x131)]),_0x139380[_0x20138d(0x117)]){case i[_0x20138d(0x116)]['Add']:break;case i[_0x20138d(0x116)]['Reply']:var _0x3b6adc,_0x183d47;this['_threadCommentModel'][_0x20138d(0x110)](_0x395093,_0x41a54f,{'unitId':_0x395093,'subUnitId':_0x41a54f,'ref':'','id':_0x139380[_0x20138d(0xc5)],'dT':d(+_0x139380[_0x20138d(0x114)]),'threadId':_0x139380[_0x20138d(0x130)],'personId':(_0x3b6adc=(_0x183d47=_0x139380[_0x20138d(0x131)])==null?void 0x0:_0x183d47[_0x20138d(0x103)])==null?_0x139380[_0x20138d(0xea)]:_0x3b6adc,'text':JSON[_0x20138d(0x11d)](_0x139380[_0x20138d(0xc2)]),'parentId':_0x1b166d['id']});break;case i[_0x20138d(0x116)][_0x20138d(0x121)]:{let _0x5e7150=this[_0x20138d(0xd0)][_0x20138d(0x127)](_0x395093,_0x41a54f,_0x139380[_0x20138d(0xc5)]);_0x5e7150&&_0x5e7150[_0x20138d(0x115)]&&this[_0x20138d(0xd0)][_0x20138d(0xbe)](_0x395093,_0x41a54f,_0x139380[_0x20138d(0xc5)]);break;}case i[_0x20138d(0x116)][_0x20138d(0xc9)]:this['_threadCommentModel'][_0x20138d(0xc0)](_0x395093,_0x41a54f,{'commentId':_0x139380['replyId'],'text':JSON[_0x20138d(0x11d)](_0x139380[_0x20138d(0xc2)])});break;case i[_0x20138d(0x116)][_0x20138d(0x111)]:{var _0xfee572;let _0x5ed53b=(_0xfee572=this[_0x20138d(0xd0)]['getUnit'](_0x139380[_0x20138d(0x11a)])['find'](_0x38f3c6=>_0x38f3c6[_0x20138d(0x130)]===_0x139380[_0x20138d(0x130)]))==null?void 0x0:_0xfee572['root'];_0x5ed53b&&this['_threadCommentModel']['resolveComment'](_0x395093,_0x41a54f,_0x5ed53b['id'],_0x139380['solved']===i[_0x20138d(0xd4)][_0x20138d(0x105)]);break;}default:break;}}));}};h=m([p(0x0,(0x0,n[_0x96b8fd(0xf8)])(e[_0x96b8fd(0xdc)])),p(0x1,(0x0,n[_0x96b8fd(0xf8)])(a[_0x96b8fd(0x10f)])),p(0x2,(0x0,n['Inject'])(n[_0x96b8fd(0x10d)])),p(0x3,(0x0,n['Inject'])(n[_0x96b8fd(0xef)]))],h);function g(_0x44250f,_0xf46710){const _0x1eca3a=_0x96b8fd;let _0x15e6d1=_0x44250f[_0x1eca3a(0xb5)][0x0];return{..._0xf46710,'id':_0x15e6d1[_0x1eca3a(0xc5)],'resolved':_0x44250f[_0x1eca3a(0xc6)]===0x1,'dT':d(_0x15e6d1[_0x1eca3a(0x114)]),'personId':_0x15e6d1[_0x1eca3a(0xea)],'threadId':_0x15e6d1[_0x1eca3a(0x130)]};}function _(_0x311f1e,_0x5821a9,_0x4d9724){const _0x40c5f6=_0x96b8fd;var _0x3e31b1,_0x5da43c;if(((_0x3e31b1=_0x311f1e==null||(_0x5da43c=_0x311f1e[_0x40c5f6(0xb5)])==null?void 0x0:_0x5da43c['length'])==null?0x0:_0x3e31b1)>0x0){let _0x18067=(_0x118741,_0x31546b)=>({'id':_0x118741[_0x40c5f6(0xc5)],'threadId':_0x118741['threadId'],'dT':d(_0x118741[_0x40c5f6(0x114)]),'personId':_0x118741[_0x40c5f6(0xea)],'resolved':_0x311f1e[_0x40c5f6(0xc6)]===i['CommentSolvedStatus'][_0x40c5f6(0x105)],'unitId':_0x5821a9,'subUnitId':_0x4d9724,'text':JSON[_0x40c5f6(0x11d)](_0x118741[_0x40c5f6(0xc2)]),'parentId':_0x31546b}),_0x9a7e5d=_0x18067(_0x311f1e['replies'][0x0]);return{..._0x9a7e5d,'children':_0x311f1e[_0x40c5f6(0xb5)][_0x40c5f6(0x112)](0x1)[_0x40c5f6(0x129)](_0x43c6fc=>_0x18067(_0x43c6fc,_0x9a7e5d['id']))};}return null;}let v=class{constructor(_0x12d242,_0x520726,_0x4743b2){const _0x3f2df2=_0x96b8fd;this[_0x3f2df2(0x12a)]=_0x12d242,this[_0x3f2df2(0xeb)]=_0x520726,this[_0x3f2df2(0xec)]=_0x4743b2;}async[_0x96b8fd(0x110)](_0x5abf77){const _0x12904d=_0x96b8fd;var _0x37b22e,_0x4eead9;let {parentId:_0xbb5545,unitId:_0x1d3867,text:_0x5eecd8,threadId:_0x52a1a3}=_0x5abf77,_0x4dbcb3=(_0x37b22e=(_0x4eead9=_0x5eecd8[_0x12904d(0x123)])==null?void 0x0:_0x4eead9['filter'](_0x41b406=>_0x41b406[_0x12904d(0xcc)]===n[_0x12904d(0xf2)][_0x12904d(0x134)])['map'](_0x569bb6=>_0x569bb6[_0x12904d(0x108)]))==null?[]:_0x37b22e,_0x5ddb0b=JSON['stringify'](_0x5eecd8),_0x13f8a6=(await this['_sessionService']['requireSession'](_0x1d3867))[_0x12904d(0xcd)]();if(_0xbb5545){let _0x1bad87={'memberId':_0x13f8a6,'unitId':_0x1d3867,'content':_0x5ddb0b,'mention':_0x4dbcb3,'threadId':_0x52a1a3},_0x276c2d=(await this[_0x12904d(0x12a)]['post']('/universer-api/comment/unit/'+_0x1d3867+'/reply',{'body':_0x1bad87}))[_0x12904d(0xf3)]['reply'];return{..._0x5abf77,'id':_0x276c2d['replyId'],'dT':(0x0,n[_0x12904d(0xfa)])(+_0x276c2d[_0x12904d(0x114)])[_0x12904d(0x113)](_0x12904d(0xee)),'personId':_0x276c2d[_0x12904d(0xea)]};}else{let _0x441f3e={'memberId':_0x13f8a6,'unitId':_0x1d3867,'content':_0x5ddb0b,'mention':_0x4dbcb3};return g((await this[_0x12904d(0x12a)]['post'](_0x12904d(0xbd)+_0x1d3867+'/add',{'body':_0x441f3e}))[_0x12904d(0xf3)][_0x12904d(0xe8)],_0x5abf77);}}async[_0x96b8fd(0xc0)](_0x5988bc){const _0x195d19=_0x96b8fd;var _0xc3d5fc,_0x2c9fda;let {text:_0xae25d6,unitId:_0x54b2fc}=_0x5988bc,_0x1fbee3=(_0xc3d5fc=(_0x2c9fda=_0xae25d6[_0x195d19(0x123)])==null?void 0x0:_0x2c9fda[_0x195d19(0xe7)](_0x2b3daa=>_0x2b3daa['rangeType']===n['CustomRangeType'][_0x195d19(0x134)])['map'](_0x1f4878=>_0x1f4878['rangeId']))==null?[]:_0xc3d5fc,_0x1ffa76=JSON[_0x195d19(0xc1)](_0xae25d6),_0x2fdc6c=_0x5988bc[_0x195d19(0x130)],_0x3c222a=_0x5988bc['id'],_0x5d5bd5={'memberId':(await this[_0x195d19(0xec)][_0x195d19(0x12f)](_0x54b2fc))['getMemberID'](),'unitId':_0x54b2fc,'threadId':_0x2fdc6c,'mention':_0x1fbee3,'content':_0x1ffa76,'replyId':_0x3c222a},_0x3c4a2d=await this[_0x195d19(0x12a)][_0x195d19(0xe1)](_0x195d19(0xbd)+_0x54b2fc+_0x195d19(0xed),{'body':_0x5d5bd5});return!_0x3c4a2d[_0x195d19(0xf3)]['error']||_0x3c4a2d[_0x195d19(0xf3)][_0x195d19(0xb3)][_0x195d19(0xb7)]===0x1;}async[_0x96b8fd(0xfd)](_0x3ab980){const _0x18d396=_0x96b8fd;let {unitId:_0x314c89}=_0x3ab980,_0x4b6ec0=_0x3ab980[_0x18d396(0x130)],_0xc46e6f={'memberId':this[_0x18d396(0xeb)][_0x18d396(0xfe)]()[_0x18d396(0x103)],'unitId':_0x314c89,'threadId':_0x4b6ec0,'solved':_0x3ab980[_0x18d396(0xd5)]?i['CommentSolvedStatus'][_0x18d396(0x105)]:i[_0x18d396(0xd4)][_0x18d396(0x12b)]},_0x2a74cd=await this[_0x18d396(0x12a)][_0x18d396(0xe1)](_0x18d396(0xbd)+_0x314c89+_0x18d396(0xbf),{'body':_0xc46e6f});return!_0x2a74cd[_0x18d396(0xf3)]['error']||_0x2a74cd['body'][_0x18d396(0xb3)][_0x18d396(0xb7)]===0x1;}async['deleteComment'](_0x13817b,_0x14f232,_0x1308f7,_0x5c3cc3){const _0x36ddc5=_0x96b8fd;let _0x5f0b6d={'memberId':(await this[_0x36ddc5(0xec)][_0x36ddc5(0x12f)](_0x13817b))[_0x36ddc5(0xcd)](),'threadId':_0x1308f7,'replyId':_0x5c3cc3,'unitId':_0x13817b},_0x22f165=await this[_0x36ddc5(0x12a)]['post']('/universer-api/comment/unit/'+_0x13817b+_0x36ddc5(0xc7),{'body':_0x5f0b6d});return!_0x22f165[_0x36ddc5(0xf3)][_0x36ddc5(0xb3)]||_0x22f165['body'][_0x36ddc5(0xb3)][_0x36ddc5(0xb7)]===0x1;}async[_0x96b8fd(0x11f)](_0x295224,_0xf252f,_0x2c31ef){const _0x5c2aac=_0x96b8fd;let _0x133f0d={'unitId':_0x295224,'threadId':_0x2c31ef},_0x4af7ae=await this[_0x5c2aac(0x12a)][_0x5c2aac(0xe1)](_0x5c2aac(0xbd)+_0x295224+_0x5c2aac(0xe2),{'body':_0x133f0d}),_0x165d5e=_0x2c31ef[_0x5c2aac(0x129)](_0x137a00=>_(_0x4af7ae[_0x5c2aac(0xf3)][_0x5c2aac(0xdf)][_0x137a00],_0x295224,_0xf252f))[_0x5c2aac(0xe7)](Boolean);return Object[_0x5c2aac(0xe3)](_0x4af7ae[_0x5c2aac(0xf3)][_0x5c2aac(0xfb)])[_0x5c2aac(0x135)](_0x23085d=>{const _0x16306f=_0x5c2aac;this[_0x16306f(0xeb)][_0x16306f(0xb0)](_0x23085d);}),_0x165d5e;}['saveCommentToSnapshot'](_0x2f58a5){const _0x221526=_0x96b8fd;return{'id':_0x2f58a5['id'],'threadId':_0x2f58a5['threadId'],'ref':_0x2f58a5[_0x221526(0x11e)]};}};v=m([p(0x0,(0x0,n[_0x96b8fd(0xf8)])(s[_0x96b8fd(0xdb)])),p(0x1,(0x0,n['Inject'])(n[_0x96b8fd(0x10d)])),p(0x2,(0x0,n[_0x96b8fd(0xf8)])(e[_0x96b8fd(0xf4)]))],v);let y=class extends n[_0x96b8fd(0x102)]{constructor(_0x1601de,_0x52a342){const _0x4141fe=_0x96b8fd;super(),this[_0x4141fe(0xde)]=_0x1601de,this['_threadCommentDataSource']=_0x52a342,this[_0x4141fe(0xdd)]();}[_0x96b8fd(0xdd)](){const _0x7a472=_0x96b8fd;this[_0x7a472(0xde)][_0x7a472(0x11b)]=this[_0x7a472(0xb9)],this[_0x7a472(0xde)][_0x7a472(0xe4)]=!0x1;}};y=m([p(0x0,a[_0x96b8fd(0xda)]),p(0x1,(0x0,n['Inject'])(v))],y);function b(_0x491587){'@babel/helpers - typeof';const _0x161b7c=_0x96b8fd;return b=typeof Symbol==_0x161b7c(0xd6)&&typeof Symbol[_0x161b7c(0x107)]=='symbol'?function(_0x427b8c){return typeof _0x427b8c;}:function(_0x34a3a6){const _0x4c4f4d=_0x161b7c;return _0x34a3a6&&typeof Symbol==_0x4c4f4d(0xd6)&&_0x34a3a6['constructor']===Symbol&&_0x34a3a6!==Symbol[_0x4c4f4d(0xbc)]?'symbol':typeof _0x34a3a6;},b(_0x491587);}function x(_0xe3bf9f,_0x3a99b8){const _0x306348=_0x96b8fd;if(b(_0xe3bf9f)!=_0x306348(0x126)||!_0xe3bf9f)return _0xe3bf9f;var _0x6d5393=_0xe3bf9f[Symbol[_0x306348(0xf1)]];if(_0x6d5393!==void 0x0){var _0x323268=_0x6d5393['call'](_0xe3bf9f,_0x3a99b8||_0x306348(0x122));if(b(_0x323268)!=_0x306348(0x126))return _0x323268;throw TypeError(_0x306348(0xd9));}return(_0x3a99b8===_0x306348(0x109)?String:Number)(_0xe3bf9f);}function S(_0x233aaf){const _0x639b7=_0x96b8fd;var _0x1c8453=x(_0x233aaf,_0x639b7(0x109));return b(_0x1c8453)==_0x639b7(0xb8)?_0x1c8453:_0x1c8453+'';}function C(_0x2fa8a6,_0x1017ea,_0x120d36){const _0x31dfea=_0x96b8fd;return(_0x1017ea=S(_0x1017ea))in _0x2fa8a6?Object[_0x31dfea(0x128)](_0x2fa8a6,_0x1017ea,{'value':_0x120d36,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x2fa8a6[_0x1017ea]=_0x120d36,_0x2fa8a6;}let w=class extends n[_0x96b8fd(0xb1)]{constructor(_0x3bcfa8=u,_0x5a7f06,_0x450965){const _0x36ecc4=_0x96b8fd;super(),this[_0x36ecc4(0xe9)]=_0x3bcfa8,this[_0x36ecc4(0xc3)]=_0x5a7f06,this[_0x36ecc4(0xd1)]=_0x450965;let {..._0x267efb}=(0x0,n['merge'])({},u,this['_config']);this[_0x36ecc4(0xd1)][_0x36ecc4(0xf7)]('thread-comment-data-source.config',_0x267efb);}[_0x96b8fd(0xe5)](){const _0x3100d3=_0x96b8fd;[[v],[y],[h]][_0x3100d3(0x135)](_0x16184b=>{const _0x46107f=_0x3100d3;this[_0x46107f(0xc3)][_0x46107f(0xcb)](_0x16184b);});}[_0x96b8fd(0xb6)](){const _0x5a397e=_0x96b8fd;this['_injector'][_0x5a397e(0x120)](y),this['_injector']['get'](h);}};C(w,_0x96b8fd(0xd2),_0x96b8fd(0x10a)),C(w,_0x96b8fd(0xf0),c),C(w,_0x96b8fd(0x106),l),w=m([(0x0,n[_0x96b8fd(0xb4)])(r[_0x96b8fd(0xe0)],e[_0x96b8fd(0x12c)],t['UniverLicensePlugin']),p(0x1,(0x0,n[_0x96b8fd(0xf8)])(n[_0x96b8fd(0xef)])),p(0x2,n[_0x96b8fd(0xd8)])],w),Object['defineProperty'](exports,_0x96b8fd(0xc4),{'enumerable':!0x0,'get':function(){return w;}});
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x2af9(_0x4d27ed,_0x4c7126){_0x4d27ed=_0x4d27ed-0xd7;const _0x41e07e=_0x41e0();let _0x2af955=_0x41e07e[_0x4d27ed];return _0x2af955;}const _0xa1ac9d=_0x2af9;(function(_0xed1b5,_0xe63965){const _0xbf6541=_0x2af9,_0x38dcd9=_0xed1b5();while(!![]){try{const _0x26e058=-parseInt(_0xbf6541(0x121))/0x1+parseInt(_0xbf6541(0x106))/0x2*(parseInt(_0xbf6541(0xf3))/0x3)+parseInt(_0xbf6541(0x136))/0x4*(parseInt(_0xbf6541(0x100))/0x5)+-parseInt(_0xbf6541(0xff))/0x6*(-parseInt(_0xbf6541(0xef))/0x7)+-parseInt(_0xbf6541(0xec))/0x8*(-parseInt(_0xbf6541(0x143))/0x9)+-parseInt(_0xbf6541(0x11f))/0xa+-parseInt(_0xbf6541(0xea))/0xb*(parseInt(_0xbf6541(0x105))/0xc);if(_0x26e058===_0xe63965)break;else _0x38dcd9['push'](_0x38dcd9['shift']());}catch(_0x4c7acc){_0x38dcd9['push'](_0x38dcd9['shift']());}}}(_0x41e0,0xc2851));import{CollaborationSessionService as _0x2acfeb,CommentService as _0x292131,UniverCollaborationClientPlugin as _0x4c5ec1}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5c4236}from'@univerjs-pro/license';import{CustomRangeType as _0x350e42,DependentOn as _0x54f6b9,Disposable as _0x1ac458,IConfigService as _0x2a9bd4,Inject as _0x4a07d7,Injector as _0x49a2f3,Plugin as _0x227112,UserManagerService as _0x56524c,dateKit as _0x4d57f0,merge as _0x228baa}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x48ba42}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x30ee84,CommentUpdateEventType as _0x45a534}from'@univerjs/protocol';import{IThreadCommentDataSourceService as _0x3845c1,ThreadCommentModel as _0xf4d4ff}from'@univerjs/thread-comment';import{bufferTime as _0x1dcffe}from'rxjs';import{HTTPService as _0x359d11}from'@univerjs/network';var x=_0xa1ac9d(0x135),S=_0xa1ac9d(0x144);const C=_0x126d33=>_0x4d57f0(new Date(+_0x126d33))[_0xa1ac9d(0x12a)](_0xa1ac9d(0x132)),w=async(_0x3df415,_0x11c3a8)=>{const _0x390a87=_0xa1ac9d;let _0x28f987=_0x3df415['get'](_0x56524c),_0x1aefac=_0x3df415[_0x390a87(0x11e)](_0x359d11);_0x11c3a8[_0x390a87(0xeb)](_0x237e3d=>{const _0x38a6b9=_0x390a87;_0x28f987['getUser'](_0x237e3d)&&_0x11c3a8[_0x38a6b9(0x10b)](_0x237e3d);}),_0x11c3a8[_0x390a87(0xd7)]&&(await _0x1aefac[_0x390a87(0x11e)](_0x390a87(0x131),{'params':{'userIDs':[..._0x11c3a8]}}))[_0x390a87(0x117)][_0x390a87(0xe5)]['forEach'](_0x373ad2=>{const _0x162b0a=_0x390a87;_0x373ad2&&_0x28f987[_0x162b0a(0xee)](_0x373ad2);});};function T(_0x3758b2,_0x2111c2){return function(_0x2fdc32,_0x13785c){_0x2111c2(_0x2fdc32,_0x13785c,_0x3758b2);};}function _0x41e0(){const _0x6bfd2c=['format','replies','type','parentId','_initUserSync','slice','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/universer-api/user/list','YYYY/MM/DD\x20HH:mm','updateComment','resolveComment','@univerjs-pro/thread-comment-datasource','2379752MUDVyO','threadId','defineProperty','getOwnPropertyDescriptor','Add','parse','OpenOrReOpen','/list','saveCommentToSnapshot','_threadCommentDataSource','createTimestamp','thread-comment-data-source.config','solved','9vjLbOr','1.0.0-alpha.2','size','_configService','getMemberID','userID','getUnit','_userService','COMMENT','/add','root','customRanges','_init','/universer-api/comment/unit/','filter','Reply','users','code','symbol','map','setConfig','2141777PuFlAZ','forEach','6346312AJsNEL','pluginName','addUser','714maesyE','onStarting','error','user','46191abmLHJ','userId','addComment','comments','_httpService','content','decorate','post','replyId','payload','comment','add','61116GXtsfX','5OJWYqT','onReady','commentUpdate$','requireSession','iterator','24lQyBRV','178JgwEmT','object','rangeId','_threadCommentModel','_threadCommentDataSourceService','delete','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','toPrimitive','personId','unitId','subscribe','packageName','/solved','function','ref','_injector','_sessionService','body','pipe','/delete','length','Solved','stringify','constructor','get','13531120SIhIxI','syncUpdateMutationToColla','1258253MefKam','_config','call','_initDataSource','version','_commentService','find','/reply','string'];_0x41e0=function(){return _0x6bfd2c;};return _0x41e0();}function E(_0xfcb1c3,_0x2d4f42,_0x2c1bf8,_0x2ff703){const _0x20631d=_0xa1ac9d;var _0x314e2d=arguments[_0x20631d(0x11a)],_0x37da81=_0x314e2d<0x3?_0x2d4f42:_0x2ff703===null?_0x2ff703=Object[_0x20631d(0x139)](_0x2d4f42,_0x2c1bf8):_0x2ff703,_0x267306;if(typeof Reflect==_0x20631d(0x107)&&typeof Reflect['decorate']==_0x20631d(0x113))_0x37da81=Reflect[_0x20631d(0xf9)](_0xfcb1c3,_0x2d4f42,_0x2c1bf8,_0x2ff703);else{for(var _0x326002=_0xfcb1c3['length']-0x1;_0x326002>=0x0;_0x326002--)(_0x267306=_0xfcb1c3[_0x326002])&&(_0x37da81=(_0x314e2d<0x3?_0x267306(_0x37da81):_0x314e2d>0x3?_0x267306(_0x2d4f42,_0x2c1bf8,_0x37da81):_0x267306(_0x2d4f42,_0x2c1bf8))||_0x37da81);}return _0x314e2d>0x3&&_0x37da81&&Object[_0x20631d(0x138)](_0x2d4f42,_0x2c1bf8,_0x37da81),_0x37da81;}let D=class extends _0x1ac458{constructor(_0x218249,_0x442091,_0x5dfba1,_0x516e9e){const _0xe34d71=_0xa1ac9d;super(),this[_0xe34d71(0x126)]=_0x218249,this[_0xe34d71(0x109)]=_0x442091,this[_0xe34d71(0xdc)]=_0x5dfba1,this[_0xe34d71(0x115)]=_0x516e9e,this[_0xe34d71(0xe1)](),this[_0xe34d71(0x12e)]();}['_initUserSync'](){const _0x105e31=_0xa1ac9d;this['disposeWithMe'](this[_0x105e31(0x109)][_0x105e31(0x102)][_0x105e31(0x118)](_0x1dcffe(0x10))[_0x105e31(0x110)](_0x43ab59=>{const _0x97a258=_0x105e31;let _0x44d913=new Set();_0x43ab59['forEach'](_0x493bc5=>{const _0xbf4278=_0x2af9;switch(_0x493bc5['type']){case _0xbf4278(0xfe):{let _0x2d9bf1=_0x493bc5[_0xbf4278(0xfc)][_0xbf4278(0x10e)];_0x44d913[_0xbf4278(0xfe)](_0x2d9bf1);break;}default:break;}}),w(this[_0x97a258(0x115)],_0x44d913);}));}[_0xa1ac9d(0xe1)](){const _0x1643ab=_0xa1ac9d;this['disposeWithMe'](this[_0x1643ab(0x126)][_0x1643ab(0x102)][_0x1643ab(0x110)](async _0x4664ad=>{const _0x2939a3=_0x1643ab;var _0x482ab5;let _0x81d3d3=(_0x482ab5=this['_threadCommentModel'][_0x2939a3(0xdb)](_0x4664ad[_0x2939a3(0x10f)])[_0x2939a3(0x127)](_0x3a4592=>_0x3a4592[_0x2939a3(0x137)]===_0x4664ad[_0x2939a3(0x137)]))==null?void 0x0:_0x482ab5[_0x2939a3(0xdf)];if(!_0x81d3d3)return;let {unitId:_0x2ef29e,subUnitId:_0x3859fb}=_0x81d3d3;switch(_0x4664ad['user']&&this['_userService'][_0x2939a3(0xee)](_0x4664ad[_0x2939a3(0xf2)]),_0x4664ad[_0x2939a3(0x12c)]){case _0x45a534[_0x2939a3(0x13a)]:break;case _0x45a534[_0x2939a3(0xe4)]:var _0x987de7,_0x1a024a;this['_threadCommentModel'][_0x2939a3(0xf5)](_0x2ef29e,_0x3859fb,{'unitId':_0x2ef29e,'subUnitId':_0x3859fb,'ref':'','id':_0x4664ad[_0x2939a3(0xfb)],'dT':C(+_0x4664ad['createTimestamp']),'threadId':_0x4664ad[_0x2939a3(0x137)],'personId':(_0x987de7=(_0x1a024a=_0x4664ad[_0x2939a3(0xf2)])==null?void 0x0:_0x1a024a['userID'])==null?_0x4664ad['userId']:_0x987de7,'text':JSON[_0x2939a3(0x13b)](_0x4664ad['content']),'parentId':_0x81d3d3['id']});break;case _0x45a534['Delete']:{let _0x1b5864=this['_threadCommentModel']['getComment'](_0x2ef29e,_0x3859fb,_0x4664ad[_0x2939a3(0xfb)]);_0x1b5864&&_0x1b5864[_0x2939a3(0x12d)]&&this[_0x2939a3(0x109)]['deleteComment'](_0x2ef29e,_0x3859fb,_0x4664ad[_0x2939a3(0xfb)]);break;}case _0x45a534['Edit']:this[_0x2939a3(0x109)][_0x2939a3(0x133)](_0x2ef29e,_0x3859fb,{'commentId':_0x4664ad[_0x2939a3(0xfb)],'text':JSON[_0x2939a3(0x13b)](_0x4664ad[_0x2939a3(0xf8)])});break;case _0x45a534['Solve']:{var _0x4eedae;let _0x17f4f6=(_0x4eedae=this[_0x2939a3(0x109)][_0x2939a3(0xdb)](_0x4664ad[_0x2939a3(0x10f)])[_0x2939a3(0x127)](_0x5d68b3=>_0x5d68b3[_0x2939a3(0x137)]===_0x4664ad[_0x2939a3(0x137)]))==null?void 0x0:_0x4eedae[_0x2939a3(0xdf)];_0x17f4f6&&this[_0x2939a3(0x109)][_0x2939a3(0x134)](_0x2ef29e,_0x3859fb,_0x17f4f6['id'],_0x4664ad[_0x2939a3(0x142)]===_0x30ee84[_0x2939a3(0x11b)]);break;}default:break;}}));}};D=E([T(0x0,_0x4a07d7(_0x292131)),T(0x1,_0x4a07d7(_0xf4d4ff)),T(0x2,_0x4a07d7(_0x56524c)),T(0x3,_0x4a07d7(_0x49a2f3))],D);const O={};function k(_0x1cd0c9,_0x3af7c5){const _0x1ad52e=_0xa1ac9d;let _0x19372b=_0x1cd0c9[_0x1ad52e(0x12b)][0x0];return{..._0x3af7c5,'id':_0x19372b[_0x1ad52e(0xfb)],'resolved':_0x1cd0c9[_0x1ad52e(0x142)]===0x1,'dT':C(_0x19372b[_0x1ad52e(0x140)]),'personId':_0x19372b[_0x1ad52e(0xf4)],'threadId':_0x19372b['threadId']};}function A(_0x2f0300,_0x11c992,_0x359402){const _0x54c2ac=_0xa1ac9d;var _0x4b2ccd,_0x17a91f;if(((_0x4b2ccd=_0x2f0300==null||(_0x17a91f=_0x2f0300[_0x54c2ac(0x12b)])==null?void 0x0:_0x17a91f[_0x54c2ac(0x11a)])==null?0x0:_0x4b2ccd)>0x0){let _0xf083cf=(_0x4b37e4,_0xada161)=>({'id':_0x4b37e4[_0x54c2ac(0xfb)],'threadId':_0x4b37e4[_0x54c2ac(0x137)],'dT':C(_0x4b37e4['createTimestamp']),'personId':_0x4b37e4[_0x54c2ac(0xf4)],'resolved':_0x2f0300[_0x54c2ac(0x142)]===_0x30ee84['Solved'],'unitId':_0x11c992,'subUnitId':_0x359402,'text':JSON[_0x54c2ac(0x13b)](_0x4b37e4[_0x54c2ac(0xf8)]),'parentId':_0xada161}),_0x3bdb3e=_0xf083cf(_0x2f0300[_0x54c2ac(0x12b)][0x0]);return{..._0x3bdb3e,'children':_0x2f0300['replies'][_0x54c2ac(0x12f)](0x1)[_0x54c2ac(0xe8)](_0x201e54=>_0xf083cf(_0x201e54,_0x3bdb3e['id']))};}return null;}let j=class{constructor(_0x11b4d5,_0x38f88d,_0x5a2186){const _0x10d4f5=_0xa1ac9d;this[_0x10d4f5(0xf7)]=_0x11b4d5,this[_0x10d4f5(0xdc)]=_0x38f88d,this['_sessionService']=_0x5a2186;}async[_0xa1ac9d(0xf5)](_0x192980){const _0x54391c=_0xa1ac9d;var _0x13913b,_0x2fe2ba;let {parentId:_0x3e0741,unitId:_0x3062ac,text:_0x6994a,threadId:_0x4b547f}=_0x192980,_0x28ed5c=(_0x13913b=(_0x2fe2ba=_0x6994a[_0x54391c(0xe0)])==null?void 0x0:_0x2fe2ba[_0x54391c(0xe3)](_0x434bad=>_0x434bad['rangeType']===_0x350e42[_0x54391c(0xdd)])[_0x54391c(0xe8)](_0x101e5e=>_0x101e5e['rangeId']))==null?[]:_0x13913b,_0x2bdc56=JSON['stringify'](_0x6994a),_0x85ea8d=(await this[_0x54391c(0x116)][_0x54391c(0x103)](_0x3062ac))[_0x54391c(0xd9)]();if(_0x3e0741){let _0x19f793={'memberId':_0x85ea8d,'unitId':_0x3062ac,'content':_0x2bdc56,'mention':_0x28ed5c,'threadId':_0x4b547f},_0x2b4d79=(await this[_0x54391c(0xf7)]['post'](_0x54391c(0xe2)+_0x3062ac+_0x54391c(0x128),{'body':_0x19f793}))[_0x54391c(0x117)]['reply'];return{..._0x192980,'id':_0x2b4d79[_0x54391c(0xfb)],'dT':_0x4d57f0(+_0x2b4d79[_0x54391c(0x140)])[_0x54391c(0x12a)](_0x54391c(0x132)),'personId':_0x2b4d79[_0x54391c(0xf4)]};}else{let _0x2eb2e5={'memberId':_0x85ea8d,'unitId':_0x3062ac,'content':_0x2bdc56,'mention':_0x28ed5c};return k((await this[_0x54391c(0xf7)]['post'](_0x54391c(0xe2)+_0x3062ac+_0x54391c(0xde),{'body':_0x2eb2e5}))[_0x54391c(0x117)][_0x54391c(0xfd)],_0x192980);}}async['updateComment'](_0x3365ed){const _0x36ec84=_0xa1ac9d;var _0x3a1bc8,_0x4bfdfa;let {text:_0x141f08,unitId:_0x2d8948}=_0x3365ed,_0x5cab5b=(_0x3a1bc8=(_0x4bfdfa=_0x141f08['customRanges'])==null?void 0x0:_0x4bfdfa[_0x36ec84(0xe3)](_0x5cdf6f=>_0x5cdf6f['rangeType']===_0x350e42['COMMENT'])[_0x36ec84(0xe8)](_0xa297af=>_0xa297af[_0x36ec84(0x108)]))==null?[]:_0x3a1bc8,_0x354626=JSON[_0x36ec84(0x11c)](_0x141f08),_0x55e455=_0x3365ed[_0x36ec84(0x137)],_0x112e00=_0x3365ed['id'],_0x5e0d47={'memberId':(await this[_0x36ec84(0x116)]['requireSession'](_0x2d8948))['getMemberID'](),'unitId':_0x2d8948,'threadId':_0x55e455,'mention':_0x5cab5b,'content':_0x354626,'replyId':_0x112e00},_0x3406cf=await this['_httpService'][_0x36ec84(0xfa)](_0x36ec84(0xe2)+_0x2d8948+'/edit',{'body':_0x5e0d47});return!_0x3406cf[_0x36ec84(0x117)]['error']||_0x3406cf[_0x36ec84(0x117)][_0x36ec84(0xf1)]['code']===0x1;}async[_0xa1ac9d(0x134)](_0x26cfae){const _0x4fda1f=_0xa1ac9d;let {unitId:_0x4f351e}=_0x26cfae,_0x472506=_0x26cfae[_0x4fda1f(0x137)],_0x34a74d={'memberId':this[_0x4fda1f(0xdc)]['getCurrentUser']()[_0x4fda1f(0xda)],'unitId':_0x4f351e,'threadId':_0x472506,'solved':_0x26cfae['resolved']?_0x30ee84[_0x4fda1f(0x11b)]:_0x30ee84[_0x4fda1f(0x13c)]},_0x572f27=await this['_httpService'][_0x4fda1f(0xfa)](_0x4fda1f(0xe2)+_0x4f351e+_0x4fda1f(0x112),{'body':_0x34a74d});return!_0x572f27[_0x4fda1f(0x117)][_0x4fda1f(0xf1)]||_0x572f27[_0x4fda1f(0x117)][_0x4fda1f(0xf1)][_0x4fda1f(0xe6)]===0x1;}async['deleteComment'](_0x162c3d,_0x52605f,_0x50357f,_0x4685f8){const _0x1f2dd4=_0xa1ac9d;let _0x17f371={'memberId':(await this[_0x1f2dd4(0x116)][_0x1f2dd4(0x103)](_0x162c3d))['getMemberID'](),'threadId':_0x50357f,'replyId':_0x4685f8,'unitId':_0x162c3d},_0x5e8103=await this[_0x1f2dd4(0xf7)][_0x1f2dd4(0xfa)]('/universer-api/comment/unit/'+_0x162c3d+_0x1f2dd4(0x119),{'body':_0x17f371});return!_0x5e8103[_0x1f2dd4(0x117)]['error']||_0x5e8103['body']['error'][_0x1f2dd4(0xe6)]===0x1;}async['listComments'](_0x47cadf,_0x1fb931,_0x5a5a54){const _0x386471=_0xa1ac9d;let _0x5d58fd={'unitId':_0x47cadf,'threadId':_0x5a5a54},_0x10fafd=await this['_httpService'][_0x386471(0xfa)](_0x386471(0xe2)+_0x47cadf+_0x386471(0x13d),{'body':_0x5d58fd}),_0x3037b7=_0x5a5a54[_0x386471(0xe8)](_0x139280=>A(_0x10fafd[_0x386471(0x117)][_0x386471(0xf6)][_0x139280],_0x47cadf,_0x1fb931))['filter'](Boolean);return Object['values'](_0x10fafd[_0x386471(0x117)][_0x386471(0xe5)])[_0x386471(0xeb)](_0x18d088=>{const _0xb516ba=_0x386471;this[_0xb516ba(0xdc)]['addUser'](_0x18d088);}),_0x3037b7;}[_0xa1ac9d(0x13e)](_0x579a99){const _0x212beb=_0xa1ac9d;return{'id':_0x579a99['id'],'threadId':_0x579a99['threadId'],'ref':_0x579a99[_0x212beb(0x114)]};}};j=E([T(0x0,_0x4a07d7(_0x359d11)),T(0x1,_0x4a07d7(_0x56524c)),T(0x2,_0x4a07d7(_0x2acfeb))],j);let M=class extends _0x1ac458{constructor(_0x241ac4,_0x3b8876){const _0xa63184=_0xa1ac9d;super(),this[_0xa63184(0x10a)]=_0x241ac4,this[_0xa63184(0x13f)]=_0x3b8876,this[_0xa63184(0x124)]();}[_0xa1ac9d(0x124)](){const _0x30ccc6=_0xa1ac9d;this[_0x30ccc6(0x10a)]['dataSource']=this[_0x30ccc6(0x13f)],this[_0x30ccc6(0x10a)][_0x30ccc6(0x120)]=!0x1;}};M=E([T(0x0,_0x3845c1),T(0x1,_0x4a07d7(j))],M);function N(_0x1b9749){'@babel/helpers - typeof';const _0x7a23e0=_0xa1ac9d;return N=typeof Symbol==_0x7a23e0(0x113)&&typeof Symbol[_0x7a23e0(0x104)]==_0x7a23e0(0xe7)?function(_0x579263){return typeof _0x579263;}:function(_0x2fa334){const _0x27711e=_0x7a23e0;return _0x2fa334&&typeof Symbol==_0x27711e(0x113)&&_0x2fa334[_0x27711e(0x11d)]===Symbol&&_0x2fa334!==Symbol['prototype']?_0x27711e(0xe7):typeof _0x2fa334;},N(_0x1b9749);}function P(_0x4adaa8,_0x2960d6){const _0x360aa1=_0xa1ac9d;if(N(_0x4adaa8)!=_0x360aa1(0x107)||!_0x4adaa8)return _0x4adaa8;var _0x1943e6=_0x4adaa8[Symbol[_0x360aa1(0x10d)]];if(_0x1943e6!==void 0x0){var _0x349b80=_0x1943e6[_0x360aa1(0x123)](_0x4adaa8,_0x2960d6||'default');if(N(_0x349b80)!='object')return _0x349b80;throw TypeError(_0x360aa1(0x10c));}return(_0x2960d6==='string'?String:Number)(_0x4adaa8);}function F(_0x477b62){const _0xe78c70=_0xa1ac9d;var _0x47cdb5=P(_0x477b62,_0xe78c70(0x129));return N(_0x47cdb5)=='symbol'?_0x47cdb5:_0x47cdb5+'';}function I(_0x1fc602,_0x495937,_0x1cf06b){const _0x51dcb5=_0xa1ac9d;return(_0x495937=F(_0x495937))in _0x1fc602?Object[_0x51dcb5(0x138)](_0x1fc602,_0x495937,{'value':_0x1cf06b,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1fc602[_0x495937]=_0x1cf06b,_0x1fc602;}let L=class extends _0x227112{constructor(_0x2ce6a1=O,_0x38a058,_0x29c77d){const _0x327cfe=_0xa1ac9d;super(),this[_0x327cfe(0x122)]=_0x2ce6a1,this[_0x327cfe(0x115)]=_0x38a058,this[_0x327cfe(0xd8)]=_0x29c77d;let {..._0x33edd8}=_0x228baa({},O,this[_0x327cfe(0x122)]);this[_0x327cfe(0xd8)][_0x327cfe(0xe9)](_0x327cfe(0x141),_0x33edd8);}[_0xa1ac9d(0xf0)](){[[j],[M],[D]]['forEach'](_0xafacd4=>{const _0x47462e=_0x2af9;this['_injector'][_0x47462e(0xfe)](_0xafacd4);});}[_0xa1ac9d(0x101)](){const _0x158e30=_0xa1ac9d;this[_0x158e30(0x115)][_0x158e30(0x11e)](M),this[_0x158e30(0x115)][_0x158e30(0x11e)](D);}};I(L,_0xa1ac9d(0xed),_0xa1ac9d(0x130)),I(L,_0xa1ac9d(0x111),x),I(L,_0xa1ac9d(0x125),S),L=E([_0x54f6b9(_0x48ba42,_0x4c5ec1,_0x5c4236),T(0x1,_0x4a07d7(_0x49a2f3)),T(0x2,_0x2a9bd4)],L);export{L as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x2bf071=_0x2e04;(function(_0x53ffe2,_0x554073){const _0x1d2027=_0x2e04,_0x362acf=_0x53ffe2();while(!![]){try{const _0x2bcea9=parseInt(_0x1d2027(0xc2))/0x1*(parseInt(_0x1d2027(0xc4))/0x2)+parseInt(_0x1d2027(0xe2))/0x3+-parseInt(_0x1d2027(0xa7))/0x4+parseInt(_0x1d2027(0xab))/0x5+-parseInt(_0x1d2027(0x98))/0x6*(parseInt(_0x1d2027(0xc3))/0x7)+parseInt(_0x1d2027(0xa8))/0x8*(-parseInt(_0x1d2027(0xda))/0x9)+parseInt(_0x1d2027(0xb8))/0xa*(parseInt(_0x1d2027(0xc0))/0xb);if(_0x2bcea9===_0x554073)break;else _0x362acf['push'](_0x362acf['shift']());}catch(_0x1ebd6a){_0x362acf['push'](_0x362acf['shift']());}}}(_0x3e8a,0x33dc2));import{CollaborationSessionService as _0x57e2d4,CommentService as _0x587643,UniverCollaborationClientPlugin as _0x274af5}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x239c9c}from'@univerjs-pro/license';import{CustomRangeType as _0x5a195a,DependentOn as _0x91861d,Disposable as _0x4779d9,IConfigService as _0x7b49f5,Inject as _0x46a0e3,Injector as _0x1404d1,Plugin as _0x1a2f1d,UserManagerService as _0x3bad2a,dateKit as _0x20410a,merge as _0x37fe87}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4c4fd2}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x539f3c,CommentUpdateEventType as _0x292590}from'@univerjs/protocol';import{IThreadCommentDataSourceService as _0x34873a,ThreadCommentModel as _0x30174f}from'@univerjs/thread-comment';import{bufferTime as _0x46ad19}from'rxjs';import{HTTPService as _0x114486}from'@univerjs/network';var x=_0x2bf071(0xa4),S=_0x2bf071(0x88);const C={},w=_0x5da229=>_0x20410a(new Date(+_0x5da229))[_0x2bf071(0xf2)]('YYYY/MM/DD\x20HH:mm'),T=async(_0x535434,_0x3df526)=>{const _0x4794b5=_0x2bf071;let _0x15513f=_0x535434['get'](_0x3bad2a),_0x55a98a=_0x535434[_0x4794b5(0xdf)](_0x114486);_0x3df526[_0x4794b5(0xcf)](_0x922347=>{const _0x290670=_0x4794b5;_0x15513f[_0x290670(0xca)](_0x922347)&&_0x3df526[_0x290670(0x9b)](_0x922347);}),_0x3df526['size']&&(await _0x55a98a[_0x4794b5(0xdf)](_0x4794b5(0xe1),{'params':{'userIDs':[..._0x3df526]}}))[_0x4794b5(0xa9)][_0x4794b5(0x9f)]['forEach'](_0x3a3c8b=>{const _0x48ad69=_0x4794b5;_0x3a3c8b&&_0x15513f[_0x48ad69(0xb7)](_0x3a3c8b);});};function E(_0x14f858,_0x3f2718){return function(_0x3a5ff6,_0x3dd4e2){_0x3f2718(_0x3a5ff6,_0x3dd4e2,_0x14f858);};}function D(_0xeeba13,_0x359e9d,_0x3f3070,_0x28cc68){const _0x50cee3=_0x2bf071;var _0x227b82=arguments[_0x50cee3(0x9c)],_0x45f8bc=_0x227b82<0x3?_0x359e9d:_0x28cc68===null?_0x28cc68=Object[_0x50cee3(0xa5)](_0x359e9d,_0x3f3070):_0x28cc68,_0x2176ab;if(typeof Reflect==_0x50cee3(0xee)&&typeof Reflect[_0x50cee3(0xa2)]==_0x50cee3(0xd8))_0x45f8bc=Reflect[_0x50cee3(0xa2)](_0xeeba13,_0x359e9d,_0x3f3070,_0x28cc68);else{for(var _0x4a8f32=_0xeeba13[_0x50cee3(0x9c)]-0x1;_0x4a8f32>=0x0;_0x4a8f32--)(_0x2176ab=_0xeeba13[_0x4a8f32])&&(_0x45f8bc=(_0x227b82<0x3?_0x2176ab(_0x45f8bc):_0x227b82>0x3?_0x2176ab(_0x359e9d,_0x3f3070,_0x45f8bc):_0x2176ab(_0x359e9d,_0x3f3070))||_0x45f8bc);}return _0x227b82>0x3&&_0x45f8bc&&Object['defineProperty'](_0x359e9d,_0x3f3070,_0x45f8bc),_0x45f8bc;}let O=class extends _0x4779d9{constructor(_0xf66233,_0x13ab6f,_0x400415,_0xbaf923){const _0x4a7ca0=_0x2bf071;super(),this['_commentService']=_0xf66233,this[_0x4a7ca0(0xad)]=_0x13ab6f,this[_0x4a7ca0(0x95)]=_0x400415,this['_injector']=_0xbaf923,this['_init'](),this[_0x4a7ca0(0x9a)]();}[_0x2bf071(0x9a)](){const _0x1eb7a1=_0x2bf071;this['disposeWithMe'](this[_0x1eb7a1(0xad)][_0x1eb7a1(0x99)][_0x1eb7a1(0xdd)](_0x46ad19(0x10))[_0x1eb7a1(0x85)](_0x4c4fc1=>{const _0x3fc5f9=_0x1eb7a1;let _0x3d1376=new Set();_0x4c4fc1[_0x3fc5f9(0xcf)](_0x1ab0b8=>{const _0x46c719=_0x3fc5f9;switch(_0x1ab0b8[_0x46c719(0xa1)]){case _0x46c719(0xcb):{let _0x243590=_0x1ab0b8[_0x46c719(0xe9)]['personId'];_0x3d1376[_0x46c719(0xcb)](_0x243590);break;}default:break;}}),T(this[_0x3fc5f9(0xaa)],_0x3d1376);}));}[_0x2bf071(0xf7)](){const _0x2f1483=_0x2bf071;this['disposeWithMe'](this[_0x2f1483(0xf6)][_0x2f1483(0x99)][_0x2f1483(0x85)](async _0x5c35c0=>{const _0x451e05=_0x2f1483;var _0x362066;let _0x1620d3=(_0x362066=this[_0x451e05(0xad)][_0x451e05(0xb6)](_0x5c35c0[_0x451e05(0x96)])[_0x451e05(0xdc)](_0x28e8fd=>_0x28e8fd[_0x451e05(0x8e)]===_0x5c35c0['threadId']))==null?void 0x0:_0x362066['root'];if(!_0x1620d3)return;let {unitId:_0x5b2b82,subUnitId:_0x6f7ebe}=_0x1620d3;switch(_0x5c35c0[_0x451e05(0x97)]&&this[_0x451e05(0x95)][_0x451e05(0xb7)](_0x5c35c0[_0x451e05(0x97)]),_0x5c35c0[_0x451e05(0xa1)]){case _0x292590[_0x451e05(0xe5)]:break;case _0x292590[_0x451e05(0xa6)]:var _0x525f5f,_0x3bf43f;this[_0x451e05(0xad)]['addComment'](_0x5b2b82,_0x6f7ebe,{'unitId':_0x5b2b82,'subUnitId':_0x6f7ebe,'ref':'','id':_0x5c35c0[_0x451e05(0xbc)],'dT':w(+_0x5c35c0[_0x451e05(0xd7)]),'threadId':_0x5c35c0[_0x451e05(0x8e)],'personId':(_0x525f5f=(_0x3bf43f=_0x5c35c0[_0x451e05(0x97)])==null?void 0x0:_0x3bf43f['userID'])==null?_0x5c35c0['userId']:_0x525f5f,'text':JSON[_0x451e05(0xe6)](_0x5c35c0['content']),'parentId':_0x1620d3['id']});break;case _0x292590[_0x451e05(0xed)]:{let _0x5b1451=this[_0x451e05(0xad)][_0x451e05(0xaf)](_0x5b2b82,_0x6f7ebe,_0x5c35c0['replyId']);_0x5b1451&&_0x5b1451[_0x451e05(0xd6)]&&this[_0x451e05(0xad)][_0x451e05(0xd4)](_0x5b2b82,_0x6f7ebe,_0x5c35c0[_0x451e05(0xbc)]);break;}case _0x292590[_0x451e05(0xec)]:this[_0x451e05(0xad)][_0x451e05(0xc7)](_0x5b2b82,_0x6f7ebe,{'commentId':_0x5c35c0[_0x451e05(0xbc)],'text':JSON[_0x451e05(0xe6)](_0x5c35c0[_0x451e05(0x9e)])});break;case _0x292590[_0x451e05(0x93)]:{var _0xbe141b;let _0x4e9001=(_0xbe141b=this[_0x451e05(0xad)][_0x451e05(0xb6)](_0x5c35c0['unitId'])[_0x451e05(0xdc)](_0x38daa8=>_0x38daa8[_0x451e05(0x8e)]===_0x5c35c0[_0x451e05(0x8e)]))==null?void 0x0:_0xbe141b[_0x451e05(0xbb)];_0x4e9001&&this[_0x451e05(0xad)][_0x451e05(0xba)](_0x5b2b82,_0x6f7ebe,_0x4e9001['id'],_0x5c35c0[_0x451e05(0xeb)]===_0x539f3c[_0x451e05(0xf8)]);break;}default:break;}}));}};O=D([E(0x0,_0x46a0e3(_0x587643)),E(0x1,_0x46a0e3(_0x30174f)),E(0x2,_0x46a0e3(_0x3bad2a)),E(0x3,_0x46a0e3(_0x1404d1))],O);function _0x3e8a(){const _0x34fd4b=['/list','get','syncUpdateMutationToColla','/universer-api/user/list','71880sVarcg','iterator','addComment','Add','parse','onStarting','requireSession','payload','YYYY/MM/DD\x20HH:mm','solved','Edit','Delete','object','setConfig','symbol','stringify','format','/universer-api/comment/unit/','version','getMemberID','_commentService','_init','Solved','subscribe','_configService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','1.0.0-alpha.3','_httpService','_threadCommentDataSourceService','values','dataSource','comments','threadId','resolved','prototype','rangeId','packageName','Solve','thread-comment-data-source.config','_userService','unitId','user','624bDvEhq','commentUpdate$','_initUserSync','delete','length','comment','content','users','_config','type','decorate','customRanges','@univerjs-pro/thread-comment-datasource','getOwnPropertyDescriptor','Reply','112084thwGhr','8mWjmAV','body','_injector','441510LOQNHA','defineProperty','_threadCommentModel','string','getComment','reply','_threadCommentDataSource','userId','ref','/delete','rangeType','getUnit','addUser','112370kmzgKW','_initDataSource','resolveComment','root','replyId','toPrimitive','pluginName','replies','418zIfQeK','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','115037MktKdQ','21903ErTGiE','4aOJVrF','onReady','post','updateComment','_sessionService','call','getUser','add','constructor','saveCommentToSnapshot','/solved','forEach','OpenOrReOpen','/reply','error','filter','deleteComment','map','parentId','createTimestamp','function','/edit','1831383htdTdl','code','find','pipe'];_0x3e8a=function(){return _0x34fd4b;};return _0x3e8a();}function k(_0x4b94ce,_0x11e247){const _0x5a9f6f=_0x2bf071;let _0x1934a4=_0x4b94ce['replies'][0x0];return{..._0x11e247,'id':_0x1934a4[_0x5a9f6f(0xbc)],'resolved':_0x4b94ce[_0x5a9f6f(0xeb)]===0x1,'dT':w(_0x1934a4[_0x5a9f6f(0xd7)]),'personId':_0x1934a4['userId'],'threadId':_0x1934a4[_0x5a9f6f(0x8e)]};}function A(_0x22d2fe,_0x30ecfd,_0x13c9f4){const _0x5b5f5d=_0x2bf071;var _0x5efec0,_0x373c51;if(((_0x5efec0=_0x22d2fe==null||(_0x373c51=_0x22d2fe[_0x5b5f5d(0xbf)])==null?void 0x0:_0x373c51[_0x5b5f5d(0x9c)])==null?0x0:_0x5efec0)>0x0){let _0xebe4d4=(_0x4552e2,_0x232ebd)=>({'id':_0x4552e2[_0x5b5f5d(0xbc)],'threadId':_0x4552e2[_0x5b5f5d(0x8e)],'dT':w(_0x4552e2[_0x5b5f5d(0xd7)]),'personId':_0x4552e2[_0x5b5f5d(0xb2)],'resolved':_0x22d2fe[_0x5b5f5d(0xeb)]===_0x539f3c[_0x5b5f5d(0xf8)],'unitId':_0x30ecfd,'subUnitId':_0x13c9f4,'text':JSON[_0x5b5f5d(0xe6)](_0x4552e2['content']),'parentId':_0x232ebd}),_0x50eb34=_0xebe4d4(_0x22d2fe[_0x5b5f5d(0xbf)][0x0]);return{..._0x50eb34,'children':_0x22d2fe[_0x5b5f5d(0xbf)]['slice'](0x1)['map'](_0x3bb607=>_0xebe4d4(_0x3bb607,_0x50eb34['id']))};}return null;}let j=class{constructor(_0x4d1d4a,_0x4e8d7e,_0x184cd1){const _0xa3a19b=_0x2bf071;this[_0xa3a19b(0x89)]=_0x4d1d4a,this[_0xa3a19b(0x95)]=_0x4e8d7e,this[_0xa3a19b(0xc8)]=_0x184cd1;}async[_0x2bf071(0xe4)](_0x1ec8f3){const _0x3e0928=_0x2bf071;var _0x2ed4bd,_0x4d6c8b;let {parentId:_0x3f3684,unitId:_0x18e571,text:_0x381136,threadId:_0x5dd1be}=_0x1ec8f3,_0x1ba29f=(_0x2ed4bd=(_0x4d6c8b=_0x381136['customRanges'])==null?void 0x0:_0x4d6c8b[_0x3e0928(0xd3)](_0x223d1a=>_0x223d1a[_0x3e0928(0xb5)]===_0x5a195a['COMMENT'])[_0x3e0928(0xd5)](_0x3e61b9=>_0x3e61b9['rangeId']))==null?[]:_0x2ed4bd,_0x5d5cef=JSON[_0x3e0928(0xf1)](_0x381136),_0x2ce5bd=(await this[_0x3e0928(0xc8)][_0x3e0928(0xe8)](_0x18e571))[_0x3e0928(0xf5)]();if(_0x3f3684){let _0x24eb87={'memberId':_0x2ce5bd,'unitId':_0x18e571,'content':_0x5d5cef,'mention':_0x1ba29f,'threadId':_0x5dd1be},_0x5e1b0f=(await this[_0x3e0928(0x89)][_0x3e0928(0xc6)](_0x3e0928(0xf3)+_0x18e571+_0x3e0928(0xd1),{'body':_0x24eb87}))[_0x3e0928(0xa9)][_0x3e0928(0xb0)];return{..._0x1ec8f3,'id':_0x5e1b0f[_0x3e0928(0xbc)],'dT':_0x20410a(+_0x5e1b0f['createTimestamp'])[_0x3e0928(0xf2)](_0x3e0928(0xea)),'personId':_0x5e1b0f[_0x3e0928(0xb2)]};}else{let _0x3f20bd={'memberId':_0x2ce5bd,'unitId':_0x18e571,'content':_0x5d5cef,'mention':_0x1ba29f};return k((await this[_0x3e0928(0x89)][_0x3e0928(0xc6)](_0x3e0928(0xf3)+_0x18e571+'/add',{'body':_0x3f20bd}))[_0x3e0928(0xa9)][_0x3e0928(0x9d)],_0x1ec8f3);}}async['updateComment'](_0x1e2ca0){const _0x44add0=_0x2bf071;var _0x2020e8,_0x26fcfc;let {text:_0x5fbe9a,unitId:_0x14cf30}=_0x1e2ca0,_0x29d220=(_0x2020e8=(_0x26fcfc=_0x5fbe9a[_0x44add0(0xa3)])==null?void 0x0:_0x26fcfc['filter'](_0xbba013=>_0xbba013[_0x44add0(0xb5)]===_0x5a195a['COMMENT'])[_0x44add0(0xd5)](_0x516afa=>_0x516afa[_0x44add0(0x91)]))==null?[]:_0x2020e8,_0x5207ba=JSON['stringify'](_0x5fbe9a),_0xa2738=_0x1e2ca0[_0x44add0(0x8e)],_0x4b3ace=_0x1e2ca0['id'],_0x2b6031={'memberId':(await this['_sessionService'][_0x44add0(0xe8)](_0x14cf30))[_0x44add0(0xf5)](),'unitId':_0x14cf30,'threadId':_0xa2738,'mention':_0x29d220,'content':_0x5207ba,'replyId':_0x4b3ace},_0x181b5e=await this[_0x44add0(0x89)][_0x44add0(0xc6)]('/universer-api/comment/unit/'+_0x14cf30+_0x44add0(0xd9),{'body':_0x2b6031});return!_0x181b5e[_0x44add0(0xa9)]['error']||_0x181b5e['body'][_0x44add0(0xd2)][_0x44add0(0xdb)]===0x1;}async[_0x2bf071(0xba)](_0x599cec){const _0xbf3fca=_0x2bf071;let {unitId:_0x248489}=_0x599cec,_0x105faa=_0x599cec[_0xbf3fca(0x8e)],_0x55e8d0={'memberId':this[_0xbf3fca(0x95)]['getCurrentUser']()['userID'],'unitId':_0x248489,'threadId':_0x105faa,'solved':_0x599cec[_0xbf3fca(0x8f)]?_0x539f3c[_0xbf3fca(0xf8)]:_0x539f3c[_0xbf3fca(0xd0)]},_0x18ec71=await this[_0xbf3fca(0x89)][_0xbf3fca(0xc6)](_0xbf3fca(0xf3)+_0x248489+_0xbf3fca(0xce),{'body':_0x55e8d0});return!_0x18ec71[_0xbf3fca(0xa9)][_0xbf3fca(0xd2)]||_0x18ec71[_0xbf3fca(0xa9)][_0xbf3fca(0xd2)][_0xbf3fca(0xdb)]===0x1;}async['deleteComment'](_0x39464f,_0x493147,_0x1a398e,_0xbbb2a){const _0x4c3305=_0x2bf071;let _0x5b920e={'memberId':(await this[_0x4c3305(0xc8)][_0x4c3305(0xe8)](_0x39464f))[_0x4c3305(0xf5)](),'threadId':_0x1a398e,'replyId':_0xbbb2a,'unitId':_0x39464f},_0x4410d7=await this[_0x4c3305(0x89)][_0x4c3305(0xc6)](_0x4c3305(0xf3)+_0x39464f+_0x4c3305(0xb4),{'body':_0x5b920e});return!_0x4410d7[_0x4c3305(0xa9)][_0x4c3305(0xd2)]||_0x4410d7[_0x4c3305(0xa9)][_0x4c3305(0xd2)][_0x4c3305(0xdb)]===0x1;}async['listComments'](_0x2462a1,_0x3d83aa,_0x3bc3d1){const _0x4c2fc9=_0x2bf071;let _0x59dac3={'unitId':_0x2462a1,'threadId':_0x3bc3d1},_0x242b71=await this[_0x4c2fc9(0x89)][_0x4c2fc9(0xc6)](_0x4c2fc9(0xf3)+_0x2462a1+_0x4c2fc9(0xde),{'body':_0x59dac3}),_0x4e7392=_0x3bc3d1[_0x4c2fc9(0xd5)](_0x3254cd=>A(_0x242b71[_0x4c2fc9(0xa9)][_0x4c2fc9(0x8d)][_0x3254cd],_0x2462a1,_0x3d83aa))[_0x4c2fc9(0xd3)](Boolean);return Object[_0x4c2fc9(0x8b)](_0x242b71[_0x4c2fc9(0xa9)]['users'])['forEach'](_0x1bc151=>{const _0x3da313=_0x4c2fc9;this[_0x3da313(0x95)][_0x3da313(0xb7)](_0x1bc151);}),_0x4e7392;}[_0x2bf071(0xcd)](_0x215525){const _0x64b256=_0x2bf071;return{'id':_0x215525['id'],'threadId':_0x215525['threadId'],'ref':_0x215525[_0x64b256(0xb3)]};}};j=D([E(0x0,_0x46a0e3(_0x114486)),E(0x1,_0x46a0e3(_0x3bad2a)),E(0x2,_0x46a0e3(_0x57e2d4))],j);let M=class extends _0x4779d9{constructor(_0x1ab369,_0x36be48){const _0x42c535=_0x2bf071;super(),this[_0x42c535(0x8a)]=_0x1ab369,this[_0x42c535(0xb1)]=_0x36be48,this[_0x42c535(0xb9)]();}[_0x2bf071(0xb9)](){const _0x4bd81a=_0x2bf071;this[_0x4bd81a(0x8a)][_0x4bd81a(0x8c)]=this[_0x4bd81a(0xb1)],this[_0x4bd81a(0x8a)][_0x4bd81a(0xe0)]=!0x1;}};M=D([E(0x0,_0x34873a),E(0x1,_0x46a0e3(j))],M);function _0x2e04(_0x22868c,_0x56ecdd){_0x22868c=_0x22868c-0x85;const _0x3e8a24=_0x3e8a();let _0x2e04f2=_0x3e8a24[_0x22868c];return _0x2e04f2;}function N(_0x33f07f){'@babel/helpers - typeof';const _0xee0da2=_0x2bf071;return N=typeof Symbol==_0xee0da2(0xd8)&&typeof Symbol[_0xee0da2(0xe3)]==_0xee0da2(0xf0)?function(_0x3d20eb){return typeof _0x3d20eb;}:function(_0x1b31da){const _0x30934f=_0xee0da2;return _0x1b31da&&typeof Symbol==_0x30934f(0xd8)&&_0x1b31da[_0x30934f(0xcc)]===Symbol&&_0x1b31da!==Symbol[_0x30934f(0x90)]?_0x30934f(0xf0):typeof _0x1b31da;},N(_0x33f07f);}function P(_0x25c40a,_0x3bd756){const _0x574de5=_0x2bf071;if(N(_0x25c40a)!=_0x574de5(0xee)||!_0x25c40a)return _0x25c40a;var _0xa7e120=_0x25c40a[Symbol[_0x574de5(0xbd)]];if(_0xa7e120!==void 0x0){var _0x38e7ef=_0xa7e120[_0x574de5(0xc9)](_0x25c40a,_0x3bd756||'default');if(N(_0x38e7ef)!='object')return _0x38e7ef;throw TypeError(_0x574de5(0xc1));}return(_0x3bd756===_0x574de5(0xae)?String:Number)(_0x25c40a);}function F(_0x8f2e76){const _0x5a7522=_0x2bf071;var _0x40b58f=P(_0x8f2e76,_0x5a7522(0xae));return N(_0x40b58f)=='symbol'?_0x40b58f:_0x40b58f+'';}function I(_0x1d33b2,_0x2323c2,_0x166793){const _0xa1aa8f=_0x2bf071;return(_0x2323c2=F(_0x2323c2))in _0x1d33b2?Object[_0xa1aa8f(0xac)](_0x1d33b2,_0x2323c2,{'value':_0x166793,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1d33b2[_0x2323c2]=_0x166793,_0x1d33b2;}let L=class extends _0x1a2f1d{constructor(_0x156cac=C,_0x8dd30c,_0x5cef1a){const _0x3642b0=_0x2bf071;super(),this[_0x3642b0(0xa0)]=_0x156cac,this[_0x3642b0(0xaa)]=_0x8dd30c,this[_0x3642b0(0x86)]=_0x5cef1a;let {..._0x14af15}=_0x37fe87({},C,this['_config']);this[_0x3642b0(0x86)][_0x3642b0(0xef)](_0x3642b0(0x94),_0x14af15);}[_0x2bf071(0xe7)](){const _0x56fcaa=_0x2bf071;[[j],[M],[O]][_0x56fcaa(0xcf)](_0x50087b=>{const _0x238e7c=_0x56fcaa;this[_0x238e7c(0xaa)][_0x238e7c(0xcb)](_0x50087b);});}[_0x2bf071(0xc5)](){const _0x439966=_0x2bf071;this[_0x439966(0xaa)][_0x439966(0xdf)](M),this[_0x439966(0xaa)][_0x439966(0xdf)](O);}};I(L,_0x2bf071(0xbe),_0x2bf071(0x87)),I(L,_0x2bf071(0x92),x),I(L,_0x2bf071(0xf4),S),L=D([_0x91861d(_0x4c4fd2,_0x274af5,_0x239c9c),E(0x1,_0x46a0e3(_0x1404d1)),E(0x2,_0x7b49f5)],L);export{L as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x2af9(_0x4d27ed,_0x4c7126){_0x4d27ed=_0x4d27ed-0xd7;const _0x41e07e=_0x41e0();let _0x2af955=_0x41e07e[_0x4d27ed];return _0x2af955;}const _0xa1ac9d=_0x2af9;(function(_0xed1b5,_0xe63965){const _0xbf6541=_0x2af9,_0x38dcd9=_0xed1b5();while(!![]){try{const _0x26e058=-parseInt(_0xbf6541(0x121))/0x1+parseInt(_0xbf6541(0x106))/0x2*(parseInt(_0xbf6541(0xf3))/0x3)+parseInt(_0xbf6541(0x136))/0x4*(parseInt(_0xbf6541(0x100))/0x5)+-parseInt(_0xbf6541(0xff))/0x6*(-parseInt(_0xbf6541(0xef))/0x7)+-parseInt(_0xbf6541(0xec))/0x8*(-parseInt(_0xbf6541(0x143))/0x9)+-parseInt(_0xbf6541(0x11f))/0xa+-parseInt(_0xbf6541(0xea))/0xb*(parseInt(_0xbf6541(0x105))/0xc);if(_0x26e058===_0xe63965)break;else _0x38dcd9['push'](_0x38dcd9['shift']());}catch(_0x4c7acc){_0x38dcd9['push'](_0x38dcd9['shift']());}}}(_0x41e0,0xc2851));import{CollaborationSessionService as _0x2acfeb,CommentService as _0x292131,UniverCollaborationClientPlugin as _0x4c5ec1}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5c4236}from'@univerjs-pro/license';import{CustomRangeType as _0x350e42,DependentOn as _0x54f6b9,Disposable as _0x1ac458,IConfigService as _0x2a9bd4,Inject as _0x4a07d7,Injector as _0x49a2f3,Plugin as _0x227112,UserManagerService as _0x56524c,dateKit as _0x4d57f0,merge as _0x228baa}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x48ba42}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x30ee84,CommentUpdateEventType as _0x45a534}from'@univerjs/protocol';import{IThreadCommentDataSourceService as _0x3845c1,ThreadCommentModel as _0xf4d4ff}from'@univerjs/thread-comment';import{bufferTime as _0x1dcffe}from'rxjs';import{HTTPService as _0x359d11}from'@univerjs/network';var x=_0xa1ac9d(0x135),S=_0xa1ac9d(0x144);const C=_0x126d33=>_0x4d57f0(new Date(+_0x126d33))[_0xa1ac9d(0x12a)](_0xa1ac9d(0x132)),w=async(_0x3df415,_0x11c3a8)=>{const _0x390a87=_0xa1ac9d;let _0x28f987=_0x3df415['get'](_0x56524c),_0x1aefac=_0x3df415[_0x390a87(0x11e)](_0x359d11);_0x11c3a8[_0x390a87(0xeb)](_0x237e3d=>{const _0x38a6b9=_0x390a87;_0x28f987['getUser'](_0x237e3d)&&_0x11c3a8[_0x38a6b9(0x10b)](_0x237e3d);}),_0x11c3a8[_0x390a87(0xd7)]&&(await _0x1aefac[_0x390a87(0x11e)](_0x390a87(0x131),{'params':{'userIDs':[..._0x11c3a8]}}))[_0x390a87(0x117)][_0x390a87(0xe5)]['forEach'](_0x373ad2=>{const _0x162b0a=_0x390a87;_0x373ad2&&_0x28f987[_0x162b0a(0xee)](_0x373ad2);});};function T(_0x3758b2,_0x2111c2){return function(_0x2fdc32,_0x13785c){_0x2111c2(_0x2fdc32,_0x13785c,_0x3758b2);};}function _0x41e0(){const _0x6bfd2c=['format','replies','type','parentId','_initUserSync','slice','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/universer-api/user/list','YYYY/MM/DD\x20HH:mm','updateComment','resolveComment','@univerjs-pro/thread-comment-datasource','2379752MUDVyO','threadId','defineProperty','getOwnPropertyDescriptor','Add','parse','OpenOrReOpen','/list','saveCommentToSnapshot','_threadCommentDataSource','createTimestamp','thread-comment-data-source.config','solved','9vjLbOr','1.0.0-alpha.2','size','_configService','getMemberID','userID','getUnit','_userService','COMMENT','/add','root','customRanges','_init','/universer-api/comment/unit/','filter','Reply','users','code','symbol','map','setConfig','2141777PuFlAZ','forEach','6346312AJsNEL','pluginName','addUser','714maesyE','onStarting','error','user','46191abmLHJ','userId','addComment','comments','_httpService','content','decorate','post','replyId','payload','comment','add','61116GXtsfX','5OJWYqT','onReady','commentUpdate$','requireSession','iterator','24lQyBRV','178JgwEmT','object','rangeId','_threadCommentModel','_threadCommentDataSourceService','delete','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','toPrimitive','personId','unitId','subscribe','packageName','/solved','function','ref','_injector','_sessionService','body','pipe','/delete','length','Solved','stringify','constructor','get','13531120SIhIxI','syncUpdateMutationToColla','1258253MefKam','_config','call','_initDataSource','version','_commentService','find','/reply','string'];_0x41e0=function(){return _0x6bfd2c;};return _0x41e0();}function E(_0xfcb1c3,_0x2d4f42,_0x2c1bf8,_0x2ff703){const _0x20631d=_0xa1ac9d;var _0x314e2d=arguments[_0x20631d(0x11a)],_0x37da81=_0x314e2d<0x3?_0x2d4f42:_0x2ff703===null?_0x2ff703=Object[_0x20631d(0x139)](_0x2d4f42,_0x2c1bf8):_0x2ff703,_0x267306;if(typeof Reflect==_0x20631d(0x107)&&typeof Reflect['decorate']==_0x20631d(0x113))_0x37da81=Reflect[_0x20631d(0xf9)](_0xfcb1c3,_0x2d4f42,_0x2c1bf8,_0x2ff703);else{for(var _0x326002=_0xfcb1c3['length']-0x1;_0x326002>=0x0;_0x326002--)(_0x267306=_0xfcb1c3[_0x326002])&&(_0x37da81=(_0x314e2d<0x3?_0x267306(_0x37da81):_0x314e2d>0x3?_0x267306(_0x2d4f42,_0x2c1bf8,_0x37da81):_0x267306(_0x2d4f42,_0x2c1bf8))||_0x37da81);}return _0x314e2d>0x3&&_0x37da81&&Object[_0x20631d(0x138)](_0x2d4f42,_0x2c1bf8,_0x37da81),_0x37da81;}let D=class extends _0x1ac458{constructor(_0x218249,_0x442091,_0x5dfba1,_0x516e9e){const _0xe34d71=_0xa1ac9d;super(),this[_0xe34d71(0x126)]=_0x218249,this[_0xe34d71(0x109)]=_0x442091,this[_0xe34d71(0xdc)]=_0x5dfba1,this[_0xe34d71(0x115)]=_0x516e9e,this[_0xe34d71(0xe1)](),this[_0xe34d71(0x12e)]();}['_initUserSync'](){const _0x105e31=_0xa1ac9d;this['disposeWithMe'](this[_0x105e31(0x109)][_0x105e31(0x102)][_0x105e31(0x118)](_0x1dcffe(0x10))[_0x105e31(0x110)](_0x43ab59=>{const _0x97a258=_0x105e31;let _0x44d913=new Set();_0x43ab59['forEach'](_0x493bc5=>{const _0xbf4278=_0x2af9;switch(_0x493bc5['type']){case _0xbf4278(0xfe):{let _0x2d9bf1=_0x493bc5[_0xbf4278(0xfc)][_0xbf4278(0x10e)];_0x44d913[_0xbf4278(0xfe)](_0x2d9bf1);break;}default:break;}}),w(this[_0x97a258(0x115)],_0x44d913);}));}[_0xa1ac9d(0xe1)](){const _0x1643ab=_0xa1ac9d;this['disposeWithMe'](this[_0x1643ab(0x126)][_0x1643ab(0x102)][_0x1643ab(0x110)](async _0x4664ad=>{const _0x2939a3=_0x1643ab;var _0x482ab5;let _0x81d3d3=(_0x482ab5=this['_threadCommentModel'][_0x2939a3(0xdb)](_0x4664ad[_0x2939a3(0x10f)])[_0x2939a3(0x127)](_0x3a4592=>_0x3a4592[_0x2939a3(0x137)]===_0x4664ad[_0x2939a3(0x137)]))==null?void 0x0:_0x482ab5[_0x2939a3(0xdf)];if(!_0x81d3d3)return;let {unitId:_0x2ef29e,subUnitId:_0x3859fb}=_0x81d3d3;switch(_0x4664ad['user']&&this['_userService'][_0x2939a3(0xee)](_0x4664ad[_0x2939a3(0xf2)]),_0x4664ad[_0x2939a3(0x12c)]){case _0x45a534[_0x2939a3(0x13a)]:break;case _0x45a534[_0x2939a3(0xe4)]:var _0x987de7,_0x1a024a;this['_threadCommentModel'][_0x2939a3(0xf5)](_0x2ef29e,_0x3859fb,{'unitId':_0x2ef29e,'subUnitId':_0x3859fb,'ref':'','id':_0x4664ad[_0x2939a3(0xfb)],'dT':C(+_0x4664ad['createTimestamp']),'threadId':_0x4664ad[_0x2939a3(0x137)],'personId':(_0x987de7=(_0x1a024a=_0x4664ad[_0x2939a3(0xf2)])==null?void 0x0:_0x1a024a['userID'])==null?_0x4664ad['userId']:_0x987de7,'text':JSON[_0x2939a3(0x13b)](_0x4664ad['content']),'parentId':_0x81d3d3['id']});break;case _0x45a534['Delete']:{let _0x1b5864=this['_threadCommentModel']['getComment'](_0x2ef29e,_0x3859fb,_0x4664ad[_0x2939a3(0xfb)]);_0x1b5864&&_0x1b5864[_0x2939a3(0x12d)]&&this[_0x2939a3(0x109)]['deleteComment'](_0x2ef29e,_0x3859fb,_0x4664ad[_0x2939a3(0xfb)]);break;}case _0x45a534['Edit']:this[_0x2939a3(0x109)][_0x2939a3(0x133)](_0x2ef29e,_0x3859fb,{'commentId':_0x4664ad[_0x2939a3(0xfb)],'text':JSON[_0x2939a3(0x13b)](_0x4664ad[_0x2939a3(0xf8)])});break;case _0x45a534['Solve']:{var _0x4eedae;let _0x17f4f6=(_0x4eedae=this[_0x2939a3(0x109)][_0x2939a3(0xdb)](_0x4664ad[_0x2939a3(0x10f)])[_0x2939a3(0x127)](_0x5d68b3=>_0x5d68b3[_0x2939a3(0x137)]===_0x4664ad[_0x2939a3(0x137)]))==null?void 0x0:_0x4eedae[_0x2939a3(0xdf)];_0x17f4f6&&this[_0x2939a3(0x109)][_0x2939a3(0x134)](_0x2ef29e,_0x3859fb,_0x17f4f6['id'],_0x4664ad[_0x2939a3(0x142)]===_0x30ee84[_0x2939a3(0x11b)]);break;}default:break;}}));}};D=E([T(0x0,_0x4a07d7(_0x292131)),T(0x1,_0x4a07d7(_0xf4d4ff)),T(0x2,_0x4a07d7(_0x56524c)),T(0x3,_0x4a07d7(_0x49a2f3))],D);const O={};function k(_0x1cd0c9,_0x3af7c5){const _0x1ad52e=_0xa1ac9d;let _0x19372b=_0x1cd0c9[_0x1ad52e(0x12b)][0x0];return{..._0x3af7c5,'id':_0x19372b[_0x1ad52e(0xfb)],'resolved':_0x1cd0c9[_0x1ad52e(0x142)]===0x1,'dT':C(_0x19372b[_0x1ad52e(0x140)]),'personId':_0x19372b[_0x1ad52e(0xf4)],'threadId':_0x19372b['threadId']};}function A(_0x2f0300,_0x11c992,_0x359402){const _0x54c2ac=_0xa1ac9d;var _0x4b2ccd,_0x17a91f;if(((_0x4b2ccd=_0x2f0300==null||(_0x17a91f=_0x2f0300[_0x54c2ac(0x12b)])==null?void 0x0:_0x17a91f[_0x54c2ac(0x11a)])==null?0x0:_0x4b2ccd)>0x0){let _0xf083cf=(_0x4b37e4,_0xada161)=>({'id':_0x4b37e4[_0x54c2ac(0xfb)],'threadId':_0x4b37e4[_0x54c2ac(0x137)],'dT':C(_0x4b37e4['createTimestamp']),'personId':_0x4b37e4[_0x54c2ac(0xf4)],'resolved':_0x2f0300[_0x54c2ac(0x142)]===_0x30ee84['Solved'],'unitId':_0x11c992,'subUnitId':_0x359402,'text':JSON[_0x54c2ac(0x13b)](_0x4b37e4[_0x54c2ac(0xf8)]),'parentId':_0xada161}),_0x3bdb3e=_0xf083cf(_0x2f0300[_0x54c2ac(0x12b)][0x0]);return{..._0x3bdb3e,'children':_0x2f0300['replies'][_0x54c2ac(0x12f)](0x1)[_0x54c2ac(0xe8)](_0x201e54=>_0xf083cf(_0x201e54,_0x3bdb3e['id']))};}return null;}let j=class{constructor(_0x11b4d5,_0x38f88d,_0x5a2186){const _0x10d4f5=_0xa1ac9d;this[_0x10d4f5(0xf7)]=_0x11b4d5,this[_0x10d4f5(0xdc)]=_0x38f88d,this['_sessionService']=_0x5a2186;}async[_0xa1ac9d(0xf5)](_0x192980){const _0x54391c=_0xa1ac9d;var _0x13913b,_0x2fe2ba;let {parentId:_0x3e0741,unitId:_0x3062ac,text:_0x6994a,threadId:_0x4b547f}=_0x192980,_0x28ed5c=(_0x13913b=(_0x2fe2ba=_0x6994a[_0x54391c(0xe0)])==null?void 0x0:_0x2fe2ba[_0x54391c(0xe3)](_0x434bad=>_0x434bad['rangeType']===_0x350e42[_0x54391c(0xdd)])[_0x54391c(0xe8)](_0x101e5e=>_0x101e5e['rangeId']))==null?[]:_0x13913b,_0x2bdc56=JSON['stringify'](_0x6994a),_0x85ea8d=(await this[_0x54391c(0x116)][_0x54391c(0x103)](_0x3062ac))[_0x54391c(0xd9)]();if(_0x3e0741){let _0x19f793={'memberId':_0x85ea8d,'unitId':_0x3062ac,'content':_0x2bdc56,'mention':_0x28ed5c,'threadId':_0x4b547f},_0x2b4d79=(await this[_0x54391c(0xf7)]['post'](_0x54391c(0xe2)+_0x3062ac+_0x54391c(0x128),{'body':_0x19f793}))[_0x54391c(0x117)]['reply'];return{..._0x192980,'id':_0x2b4d79[_0x54391c(0xfb)],'dT':_0x4d57f0(+_0x2b4d79[_0x54391c(0x140)])[_0x54391c(0x12a)](_0x54391c(0x132)),'personId':_0x2b4d79[_0x54391c(0xf4)]};}else{let _0x2eb2e5={'memberId':_0x85ea8d,'unitId':_0x3062ac,'content':_0x2bdc56,'mention':_0x28ed5c};return k((await this[_0x54391c(0xf7)]['post'](_0x54391c(0xe2)+_0x3062ac+_0x54391c(0xde),{'body':_0x2eb2e5}))[_0x54391c(0x117)][_0x54391c(0xfd)],_0x192980);}}async['updateComment'](_0x3365ed){const _0x36ec84=_0xa1ac9d;var _0x3a1bc8,_0x4bfdfa;let {text:_0x141f08,unitId:_0x2d8948}=_0x3365ed,_0x5cab5b=(_0x3a1bc8=(_0x4bfdfa=_0x141f08['customRanges'])==null?void 0x0:_0x4bfdfa[_0x36ec84(0xe3)](_0x5cdf6f=>_0x5cdf6f['rangeType']===_0x350e42['COMMENT'])[_0x36ec84(0xe8)](_0xa297af=>_0xa297af[_0x36ec84(0x108)]))==null?[]:_0x3a1bc8,_0x354626=JSON[_0x36ec84(0x11c)](_0x141f08),_0x55e455=_0x3365ed[_0x36ec84(0x137)],_0x112e00=_0x3365ed['id'],_0x5e0d47={'memberId':(await this[_0x36ec84(0x116)]['requireSession'](_0x2d8948))['getMemberID'](),'unitId':_0x2d8948,'threadId':_0x55e455,'mention':_0x5cab5b,'content':_0x354626,'replyId':_0x112e00},_0x3406cf=await this['_httpService'][_0x36ec84(0xfa)](_0x36ec84(0xe2)+_0x2d8948+'/edit',{'body':_0x5e0d47});return!_0x3406cf[_0x36ec84(0x117)]['error']||_0x3406cf[_0x36ec84(0x117)][_0x36ec84(0xf1)]['code']===0x1;}async[_0xa1ac9d(0x134)](_0x26cfae){const _0x4fda1f=_0xa1ac9d;let {unitId:_0x4f351e}=_0x26cfae,_0x472506=_0x26cfae[_0x4fda1f(0x137)],_0x34a74d={'memberId':this[_0x4fda1f(0xdc)]['getCurrentUser']()[_0x4fda1f(0xda)],'unitId':_0x4f351e,'threadId':_0x472506,'solved':_0x26cfae['resolved']?_0x30ee84[_0x4fda1f(0x11b)]:_0x30ee84[_0x4fda1f(0x13c)]},_0x572f27=await this['_httpService'][_0x4fda1f(0xfa)](_0x4fda1f(0xe2)+_0x4f351e+_0x4fda1f(0x112),{'body':_0x34a74d});return!_0x572f27[_0x4fda1f(0x117)][_0x4fda1f(0xf1)]||_0x572f27[_0x4fda1f(0x117)][_0x4fda1f(0xf1)][_0x4fda1f(0xe6)]===0x1;}async['deleteComment'](_0x162c3d,_0x52605f,_0x50357f,_0x4685f8){const _0x1f2dd4=_0xa1ac9d;let _0x17f371={'memberId':(await this[_0x1f2dd4(0x116)][_0x1f2dd4(0x103)](_0x162c3d))['getMemberID'](),'threadId':_0x50357f,'replyId':_0x4685f8,'unitId':_0x162c3d},_0x5e8103=await this[_0x1f2dd4(0xf7)][_0x1f2dd4(0xfa)]('/universer-api/comment/unit/'+_0x162c3d+_0x1f2dd4(0x119),{'body':_0x17f371});return!_0x5e8103[_0x1f2dd4(0x117)]['error']||_0x5e8103['body']['error'][_0x1f2dd4(0xe6)]===0x1;}async['listComments'](_0x47cadf,_0x1fb931,_0x5a5a54){const _0x386471=_0xa1ac9d;let _0x5d58fd={'unitId':_0x47cadf,'threadId':_0x5a5a54},_0x10fafd=await this['_httpService'][_0x386471(0xfa)](_0x386471(0xe2)+_0x47cadf+_0x386471(0x13d),{'body':_0x5d58fd}),_0x3037b7=_0x5a5a54[_0x386471(0xe8)](_0x139280=>A(_0x10fafd[_0x386471(0x117)][_0x386471(0xf6)][_0x139280],_0x47cadf,_0x1fb931))['filter'](Boolean);return Object['values'](_0x10fafd[_0x386471(0x117)][_0x386471(0xe5)])[_0x386471(0xeb)](_0x18d088=>{const _0xb516ba=_0x386471;this[_0xb516ba(0xdc)]['addUser'](_0x18d088);}),_0x3037b7;}[_0xa1ac9d(0x13e)](_0x579a99){const _0x212beb=_0xa1ac9d;return{'id':_0x579a99['id'],'threadId':_0x579a99['threadId'],'ref':_0x579a99[_0x212beb(0x114)]};}};j=E([T(0x0,_0x4a07d7(_0x359d11)),T(0x1,_0x4a07d7(_0x56524c)),T(0x2,_0x4a07d7(_0x2acfeb))],j);let M=class extends _0x1ac458{constructor(_0x241ac4,_0x3b8876){const _0xa63184=_0xa1ac9d;super(),this[_0xa63184(0x10a)]=_0x241ac4,this[_0xa63184(0x13f)]=_0x3b8876,this[_0xa63184(0x124)]();}[_0xa1ac9d(0x124)](){const _0x30ccc6=_0xa1ac9d;this[_0x30ccc6(0x10a)]['dataSource']=this[_0x30ccc6(0x13f)],this[_0x30ccc6(0x10a)][_0x30ccc6(0x120)]=!0x1;}};M=E([T(0x0,_0x3845c1),T(0x1,_0x4a07d7(j))],M);function N(_0x1b9749){'@babel/helpers - typeof';const _0x7a23e0=_0xa1ac9d;return N=typeof Symbol==_0x7a23e0(0x113)&&typeof Symbol[_0x7a23e0(0x104)]==_0x7a23e0(0xe7)?function(_0x579263){return typeof _0x579263;}:function(_0x2fa334){const _0x27711e=_0x7a23e0;return _0x2fa334&&typeof Symbol==_0x27711e(0x113)&&_0x2fa334[_0x27711e(0x11d)]===Symbol&&_0x2fa334!==Symbol['prototype']?_0x27711e(0xe7):typeof _0x2fa334;},N(_0x1b9749);}function P(_0x4adaa8,_0x2960d6){const _0x360aa1=_0xa1ac9d;if(N(_0x4adaa8)!=_0x360aa1(0x107)||!_0x4adaa8)return _0x4adaa8;var _0x1943e6=_0x4adaa8[Symbol[_0x360aa1(0x10d)]];if(_0x1943e6!==void 0x0){var _0x349b80=_0x1943e6[_0x360aa1(0x123)](_0x4adaa8,_0x2960d6||'default');if(N(_0x349b80)!='object')return _0x349b80;throw TypeError(_0x360aa1(0x10c));}return(_0x2960d6==='string'?String:Number)(_0x4adaa8);}function F(_0x477b62){const _0xe78c70=_0xa1ac9d;var _0x47cdb5=P(_0x477b62,_0xe78c70(0x129));return N(_0x47cdb5)=='symbol'?_0x47cdb5:_0x47cdb5+'';}function I(_0x1fc602,_0x495937,_0x1cf06b){const _0x51dcb5=_0xa1ac9d;return(_0x495937=F(_0x495937))in _0x1fc602?Object[_0x51dcb5(0x138)](_0x1fc602,_0x495937,{'value':_0x1cf06b,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1fc602[_0x495937]=_0x1cf06b,_0x1fc602;}let L=class extends _0x227112{constructor(_0x2ce6a1=O,_0x38a058,_0x29c77d){const _0x327cfe=_0xa1ac9d;super(),this[_0x327cfe(0x122)]=_0x2ce6a1,this[_0x327cfe(0x115)]=_0x38a058,this[_0x327cfe(0xd8)]=_0x29c77d;let {..._0x33edd8}=_0x228baa({},O,this[_0x327cfe(0x122)]);this[_0x327cfe(0xd8)][_0x327cfe(0xe9)](_0x327cfe(0x141),_0x33edd8);}[_0xa1ac9d(0xf0)](){[[j],[M],[D]]['forEach'](_0xafacd4=>{const _0x47462e=_0x2af9;this['_injector'][_0x47462e(0xfe)](_0xafacd4);});}[_0xa1ac9d(0x101)](){const _0x158e30=_0xa1ac9d;this[_0x158e30(0x115)][_0x158e30(0x11e)](M),this[_0x158e30(0x115)][_0x158e30(0x11e)](D);}};I(L,_0xa1ac9d(0xed),_0xa1ac9d(0x130)),I(L,_0xa1ac9d(0x111),x),I(L,_0xa1ac9d(0x125),S),L=E([_0x54f6b9(_0x48ba42,_0x4c5ec1,_0x5c4236),T(0x1,_0x4a07d7(_0x49a2f3)),T(0x2,_0x2a9bd4)],L);export{L as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x2bf071=_0x2e04;(function(_0x53ffe2,_0x554073){const _0x1d2027=_0x2e04,_0x362acf=_0x53ffe2();while(!![]){try{const _0x2bcea9=parseInt(_0x1d2027(0xc2))/0x1*(parseInt(_0x1d2027(0xc4))/0x2)+parseInt(_0x1d2027(0xe2))/0x3+-parseInt(_0x1d2027(0xa7))/0x4+parseInt(_0x1d2027(0xab))/0x5+-parseInt(_0x1d2027(0x98))/0x6*(parseInt(_0x1d2027(0xc3))/0x7)+parseInt(_0x1d2027(0xa8))/0x8*(-parseInt(_0x1d2027(0xda))/0x9)+parseInt(_0x1d2027(0xb8))/0xa*(parseInt(_0x1d2027(0xc0))/0xb);if(_0x2bcea9===_0x554073)break;else _0x362acf['push'](_0x362acf['shift']());}catch(_0x1ebd6a){_0x362acf['push'](_0x362acf['shift']());}}}(_0x3e8a,0x33dc2));import{CollaborationSessionService as _0x57e2d4,CommentService as _0x587643,UniverCollaborationClientPlugin as _0x274af5}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x239c9c}from'@univerjs-pro/license';import{CustomRangeType as _0x5a195a,DependentOn as _0x91861d,Disposable as _0x4779d9,IConfigService as _0x7b49f5,Inject as _0x46a0e3,Injector as _0x1404d1,Plugin as _0x1a2f1d,UserManagerService as _0x3bad2a,dateKit as _0x20410a,merge as _0x37fe87}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4c4fd2}from'@univerjs/thread-comment-ui';import{CommentSolvedStatus as _0x539f3c,CommentUpdateEventType as _0x292590}from'@univerjs/protocol';import{IThreadCommentDataSourceService as _0x34873a,ThreadCommentModel as _0x30174f}from'@univerjs/thread-comment';import{bufferTime as _0x46ad19}from'rxjs';import{HTTPService as _0x114486}from'@univerjs/network';var x=_0x2bf071(0xa4),S=_0x2bf071(0x88);const C={},w=_0x5da229=>_0x20410a(new Date(+_0x5da229))[_0x2bf071(0xf2)]('YYYY/MM/DD\x20HH:mm'),T=async(_0x535434,_0x3df526)=>{const _0x4794b5=_0x2bf071;let _0x15513f=_0x535434['get'](_0x3bad2a),_0x55a98a=_0x535434[_0x4794b5(0xdf)](_0x114486);_0x3df526[_0x4794b5(0xcf)](_0x922347=>{const _0x290670=_0x4794b5;_0x15513f[_0x290670(0xca)](_0x922347)&&_0x3df526[_0x290670(0x9b)](_0x922347);}),_0x3df526['size']&&(await _0x55a98a[_0x4794b5(0xdf)](_0x4794b5(0xe1),{'params':{'userIDs':[..._0x3df526]}}))[_0x4794b5(0xa9)][_0x4794b5(0x9f)]['forEach'](_0x3a3c8b=>{const _0x48ad69=_0x4794b5;_0x3a3c8b&&_0x15513f[_0x48ad69(0xb7)](_0x3a3c8b);});};function E(_0x14f858,_0x3f2718){return function(_0x3a5ff6,_0x3dd4e2){_0x3f2718(_0x3a5ff6,_0x3dd4e2,_0x14f858);};}function D(_0xeeba13,_0x359e9d,_0x3f3070,_0x28cc68){const _0x50cee3=_0x2bf071;var _0x227b82=arguments[_0x50cee3(0x9c)],_0x45f8bc=_0x227b82<0x3?_0x359e9d:_0x28cc68===null?_0x28cc68=Object[_0x50cee3(0xa5)](_0x359e9d,_0x3f3070):_0x28cc68,_0x2176ab;if(typeof Reflect==_0x50cee3(0xee)&&typeof Reflect[_0x50cee3(0xa2)]==_0x50cee3(0xd8))_0x45f8bc=Reflect[_0x50cee3(0xa2)](_0xeeba13,_0x359e9d,_0x3f3070,_0x28cc68);else{for(var _0x4a8f32=_0xeeba13[_0x50cee3(0x9c)]-0x1;_0x4a8f32>=0x0;_0x4a8f32--)(_0x2176ab=_0xeeba13[_0x4a8f32])&&(_0x45f8bc=(_0x227b82<0x3?_0x2176ab(_0x45f8bc):_0x227b82>0x3?_0x2176ab(_0x359e9d,_0x3f3070,_0x45f8bc):_0x2176ab(_0x359e9d,_0x3f3070))||_0x45f8bc);}return _0x227b82>0x3&&_0x45f8bc&&Object['defineProperty'](_0x359e9d,_0x3f3070,_0x45f8bc),_0x45f8bc;}let O=class extends _0x4779d9{constructor(_0xf66233,_0x13ab6f,_0x400415,_0xbaf923){const _0x4a7ca0=_0x2bf071;super(),this['_commentService']=_0xf66233,this[_0x4a7ca0(0xad)]=_0x13ab6f,this[_0x4a7ca0(0x95)]=_0x400415,this['_injector']=_0xbaf923,this['_init'](),this[_0x4a7ca0(0x9a)]();}[_0x2bf071(0x9a)](){const _0x1eb7a1=_0x2bf071;this['disposeWithMe'](this[_0x1eb7a1(0xad)][_0x1eb7a1(0x99)][_0x1eb7a1(0xdd)](_0x46ad19(0x10))[_0x1eb7a1(0x85)](_0x4c4fc1=>{const _0x3fc5f9=_0x1eb7a1;let _0x3d1376=new Set();_0x4c4fc1[_0x3fc5f9(0xcf)](_0x1ab0b8=>{const _0x46c719=_0x3fc5f9;switch(_0x1ab0b8[_0x46c719(0xa1)]){case _0x46c719(0xcb):{let _0x243590=_0x1ab0b8[_0x46c719(0xe9)]['personId'];_0x3d1376[_0x46c719(0xcb)](_0x243590);break;}default:break;}}),T(this[_0x3fc5f9(0xaa)],_0x3d1376);}));}[_0x2bf071(0xf7)](){const _0x2f1483=_0x2bf071;this['disposeWithMe'](this[_0x2f1483(0xf6)][_0x2f1483(0x99)][_0x2f1483(0x85)](async _0x5c35c0=>{const _0x451e05=_0x2f1483;var _0x362066;let _0x1620d3=(_0x362066=this[_0x451e05(0xad)][_0x451e05(0xb6)](_0x5c35c0[_0x451e05(0x96)])[_0x451e05(0xdc)](_0x28e8fd=>_0x28e8fd[_0x451e05(0x8e)]===_0x5c35c0['threadId']))==null?void 0x0:_0x362066['root'];if(!_0x1620d3)return;let {unitId:_0x5b2b82,subUnitId:_0x6f7ebe}=_0x1620d3;switch(_0x5c35c0[_0x451e05(0x97)]&&this[_0x451e05(0x95)][_0x451e05(0xb7)](_0x5c35c0[_0x451e05(0x97)]),_0x5c35c0[_0x451e05(0xa1)]){case _0x292590[_0x451e05(0xe5)]:break;case _0x292590[_0x451e05(0xa6)]:var _0x525f5f,_0x3bf43f;this[_0x451e05(0xad)]['addComment'](_0x5b2b82,_0x6f7ebe,{'unitId':_0x5b2b82,'subUnitId':_0x6f7ebe,'ref':'','id':_0x5c35c0[_0x451e05(0xbc)],'dT':w(+_0x5c35c0[_0x451e05(0xd7)]),'threadId':_0x5c35c0[_0x451e05(0x8e)],'personId':(_0x525f5f=(_0x3bf43f=_0x5c35c0[_0x451e05(0x97)])==null?void 0x0:_0x3bf43f['userID'])==null?_0x5c35c0['userId']:_0x525f5f,'text':JSON[_0x451e05(0xe6)](_0x5c35c0['content']),'parentId':_0x1620d3['id']});break;case _0x292590[_0x451e05(0xed)]:{let _0x5b1451=this[_0x451e05(0xad)][_0x451e05(0xaf)](_0x5b2b82,_0x6f7ebe,_0x5c35c0['replyId']);_0x5b1451&&_0x5b1451[_0x451e05(0xd6)]&&this[_0x451e05(0xad)][_0x451e05(0xd4)](_0x5b2b82,_0x6f7ebe,_0x5c35c0[_0x451e05(0xbc)]);break;}case _0x292590[_0x451e05(0xec)]:this[_0x451e05(0xad)][_0x451e05(0xc7)](_0x5b2b82,_0x6f7ebe,{'commentId':_0x5c35c0[_0x451e05(0xbc)],'text':JSON[_0x451e05(0xe6)](_0x5c35c0[_0x451e05(0x9e)])});break;case _0x292590[_0x451e05(0x93)]:{var _0xbe141b;let _0x4e9001=(_0xbe141b=this[_0x451e05(0xad)][_0x451e05(0xb6)](_0x5c35c0['unitId'])[_0x451e05(0xdc)](_0x38daa8=>_0x38daa8[_0x451e05(0x8e)]===_0x5c35c0[_0x451e05(0x8e)]))==null?void 0x0:_0xbe141b[_0x451e05(0xbb)];_0x4e9001&&this[_0x451e05(0xad)][_0x451e05(0xba)](_0x5b2b82,_0x6f7ebe,_0x4e9001['id'],_0x5c35c0[_0x451e05(0xeb)]===_0x539f3c[_0x451e05(0xf8)]);break;}default:break;}}));}};O=D([E(0x0,_0x46a0e3(_0x587643)),E(0x1,_0x46a0e3(_0x30174f)),E(0x2,_0x46a0e3(_0x3bad2a)),E(0x3,_0x46a0e3(_0x1404d1))],O);function _0x3e8a(){const _0x34fd4b=['/list','get','syncUpdateMutationToColla','/universer-api/user/list','71880sVarcg','iterator','addComment','Add','parse','onStarting','requireSession','payload','YYYY/MM/DD\x20HH:mm','solved','Edit','Delete','object','setConfig','symbol','stringify','format','/universer-api/comment/unit/','version','getMemberID','_commentService','_init','Solved','subscribe','_configService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','1.0.0-alpha.3','_httpService','_threadCommentDataSourceService','values','dataSource','comments','threadId','resolved','prototype','rangeId','packageName','Solve','thread-comment-data-source.config','_userService','unitId','user','624bDvEhq','commentUpdate$','_initUserSync','delete','length','comment','content','users','_config','type','decorate','customRanges','@univerjs-pro/thread-comment-datasource','getOwnPropertyDescriptor','Reply','112084thwGhr','8mWjmAV','body','_injector','441510LOQNHA','defineProperty','_threadCommentModel','string','getComment','reply','_threadCommentDataSource','userId','ref','/delete','rangeType','getUnit','addUser','112370kmzgKW','_initDataSource','resolveComment','root','replyId','toPrimitive','pluginName','replies','418zIfQeK','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','115037MktKdQ','21903ErTGiE','4aOJVrF','onReady','post','updateComment','_sessionService','call','getUser','add','constructor','saveCommentToSnapshot','/solved','forEach','OpenOrReOpen','/reply','error','filter','deleteComment','map','parentId','createTimestamp','function','/edit','1831383htdTdl','code','find','pipe'];_0x3e8a=function(){return _0x34fd4b;};return _0x3e8a();}function k(_0x4b94ce,_0x11e247){const _0x5a9f6f=_0x2bf071;let _0x1934a4=_0x4b94ce['replies'][0x0];return{..._0x11e247,'id':_0x1934a4[_0x5a9f6f(0xbc)],'resolved':_0x4b94ce[_0x5a9f6f(0xeb)]===0x1,'dT':w(_0x1934a4[_0x5a9f6f(0xd7)]),'personId':_0x1934a4['userId'],'threadId':_0x1934a4[_0x5a9f6f(0x8e)]};}function A(_0x22d2fe,_0x30ecfd,_0x13c9f4){const _0x5b5f5d=_0x2bf071;var _0x5efec0,_0x373c51;if(((_0x5efec0=_0x22d2fe==null||(_0x373c51=_0x22d2fe[_0x5b5f5d(0xbf)])==null?void 0x0:_0x373c51[_0x5b5f5d(0x9c)])==null?0x0:_0x5efec0)>0x0){let _0xebe4d4=(_0x4552e2,_0x232ebd)=>({'id':_0x4552e2[_0x5b5f5d(0xbc)],'threadId':_0x4552e2[_0x5b5f5d(0x8e)],'dT':w(_0x4552e2[_0x5b5f5d(0xd7)]),'personId':_0x4552e2[_0x5b5f5d(0xb2)],'resolved':_0x22d2fe[_0x5b5f5d(0xeb)]===_0x539f3c[_0x5b5f5d(0xf8)],'unitId':_0x30ecfd,'subUnitId':_0x13c9f4,'text':JSON[_0x5b5f5d(0xe6)](_0x4552e2['content']),'parentId':_0x232ebd}),_0x50eb34=_0xebe4d4(_0x22d2fe[_0x5b5f5d(0xbf)][0x0]);return{..._0x50eb34,'children':_0x22d2fe[_0x5b5f5d(0xbf)]['slice'](0x1)['map'](_0x3bb607=>_0xebe4d4(_0x3bb607,_0x50eb34['id']))};}return null;}let j=class{constructor(_0x4d1d4a,_0x4e8d7e,_0x184cd1){const _0xa3a19b=_0x2bf071;this[_0xa3a19b(0x89)]=_0x4d1d4a,this[_0xa3a19b(0x95)]=_0x4e8d7e,this[_0xa3a19b(0xc8)]=_0x184cd1;}async[_0x2bf071(0xe4)](_0x1ec8f3){const _0x3e0928=_0x2bf071;var _0x2ed4bd,_0x4d6c8b;let {parentId:_0x3f3684,unitId:_0x18e571,text:_0x381136,threadId:_0x5dd1be}=_0x1ec8f3,_0x1ba29f=(_0x2ed4bd=(_0x4d6c8b=_0x381136['customRanges'])==null?void 0x0:_0x4d6c8b[_0x3e0928(0xd3)](_0x223d1a=>_0x223d1a[_0x3e0928(0xb5)]===_0x5a195a['COMMENT'])[_0x3e0928(0xd5)](_0x3e61b9=>_0x3e61b9['rangeId']))==null?[]:_0x2ed4bd,_0x5d5cef=JSON[_0x3e0928(0xf1)](_0x381136),_0x2ce5bd=(await this[_0x3e0928(0xc8)][_0x3e0928(0xe8)](_0x18e571))[_0x3e0928(0xf5)]();if(_0x3f3684){let _0x24eb87={'memberId':_0x2ce5bd,'unitId':_0x18e571,'content':_0x5d5cef,'mention':_0x1ba29f,'threadId':_0x5dd1be},_0x5e1b0f=(await this[_0x3e0928(0x89)][_0x3e0928(0xc6)](_0x3e0928(0xf3)+_0x18e571+_0x3e0928(0xd1),{'body':_0x24eb87}))[_0x3e0928(0xa9)][_0x3e0928(0xb0)];return{..._0x1ec8f3,'id':_0x5e1b0f[_0x3e0928(0xbc)],'dT':_0x20410a(+_0x5e1b0f['createTimestamp'])[_0x3e0928(0xf2)](_0x3e0928(0xea)),'personId':_0x5e1b0f[_0x3e0928(0xb2)]};}else{let _0x3f20bd={'memberId':_0x2ce5bd,'unitId':_0x18e571,'content':_0x5d5cef,'mention':_0x1ba29f};return k((await this[_0x3e0928(0x89)][_0x3e0928(0xc6)](_0x3e0928(0xf3)+_0x18e571+'/add',{'body':_0x3f20bd}))[_0x3e0928(0xa9)][_0x3e0928(0x9d)],_0x1ec8f3);}}async['updateComment'](_0x1e2ca0){const _0x44add0=_0x2bf071;var _0x2020e8,_0x26fcfc;let {text:_0x5fbe9a,unitId:_0x14cf30}=_0x1e2ca0,_0x29d220=(_0x2020e8=(_0x26fcfc=_0x5fbe9a[_0x44add0(0xa3)])==null?void 0x0:_0x26fcfc['filter'](_0xbba013=>_0xbba013[_0x44add0(0xb5)]===_0x5a195a['COMMENT'])[_0x44add0(0xd5)](_0x516afa=>_0x516afa[_0x44add0(0x91)]))==null?[]:_0x2020e8,_0x5207ba=JSON['stringify'](_0x5fbe9a),_0xa2738=_0x1e2ca0[_0x44add0(0x8e)],_0x4b3ace=_0x1e2ca0['id'],_0x2b6031={'memberId':(await this['_sessionService'][_0x44add0(0xe8)](_0x14cf30))[_0x44add0(0xf5)](),'unitId':_0x14cf30,'threadId':_0xa2738,'mention':_0x29d220,'content':_0x5207ba,'replyId':_0x4b3ace},_0x181b5e=await this[_0x44add0(0x89)][_0x44add0(0xc6)]('/universer-api/comment/unit/'+_0x14cf30+_0x44add0(0xd9),{'body':_0x2b6031});return!_0x181b5e[_0x44add0(0xa9)]['error']||_0x181b5e['body'][_0x44add0(0xd2)][_0x44add0(0xdb)]===0x1;}async[_0x2bf071(0xba)](_0x599cec){const _0xbf3fca=_0x2bf071;let {unitId:_0x248489}=_0x599cec,_0x105faa=_0x599cec[_0xbf3fca(0x8e)],_0x55e8d0={'memberId':this[_0xbf3fca(0x95)]['getCurrentUser']()['userID'],'unitId':_0x248489,'threadId':_0x105faa,'solved':_0x599cec[_0xbf3fca(0x8f)]?_0x539f3c[_0xbf3fca(0xf8)]:_0x539f3c[_0xbf3fca(0xd0)]},_0x18ec71=await this[_0xbf3fca(0x89)][_0xbf3fca(0xc6)](_0xbf3fca(0xf3)+_0x248489+_0xbf3fca(0xce),{'body':_0x55e8d0});return!_0x18ec71[_0xbf3fca(0xa9)][_0xbf3fca(0xd2)]||_0x18ec71[_0xbf3fca(0xa9)][_0xbf3fca(0xd2)][_0xbf3fca(0xdb)]===0x1;}async['deleteComment'](_0x39464f,_0x493147,_0x1a398e,_0xbbb2a){const _0x4c3305=_0x2bf071;let _0x5b920e={'memberId':(await this[_0x4c3305(0xc8)][_0x4c3305(0xe8)](_0x39464f))[_0x4c3305(0xf5)](),'threadId':_0x1a398e,'replyId':_0xbbb2a,'unitId':_0x39464f},_0x4410d7=await this[_0x4c3305(0x89)][_0x4c3305(0xc6)](_0x4c3305(0xf3)+_0x39464f+_0x4c3305(0xb4),{'body':_0x5b920e});return!_0x4410d7[_0x4c3305(0xa9)][_0x4c3305(0xd2)]||_0x4410d7[_0x4c3305(0xa9)][_0x4c3305(0xd2)][_0x4c3305(0xdb)]===0x1;}async['listComments'](_0x2462a1,_0x3d83aa,_0x3bc3d1){const _0x4c2fc9=_0x2bf071;let _0x59dac3={'unitId':_0x2462a1,'threadId':_0x3bc3d1},_0x242b71=await this[_0x4c2fc9(0x89)][_0x4c2fc9(0xc6)](_0x4c2fc9(0xf3)+_0x2462a1+_0x4c2fc9(0xde),{'body':_0x59dac3}),_0x4e7392=_0x3bc3d1[_0x4c2fc9(0xd5)](_0x3254cd=>A(_0x242b71[_0x4c2fc9(0xa9)][_0x4c2fc9(0x8d)][_0x3254cd],_0x2462a1,_0x3d83aa))[_0x4c2fc9(0xd3)](Boolean);return Object[_0x4c2fc9(0x8b)](_0x242b71[_0x4c2fc9(0xa9)]['users'])['forEach'](_0x1bc151=>{const _0x3da313=_0x4c2fc9;this[_0x3da313(0x95)][_0x3da313(0xb7)](_0x1bc151);}),_0x4e7392;}[_0x2bf071(0xcd)](_0x215525){const _0x64b256=_0x2bf071;return{'id':_0x215525['id'],'threadId':_0x215525['threadId'],'ref':_0x215525[_0x64b256(0xb3)]};}};j=D([E(0x0,_0x46a0e3(_0x114486)),E(0x1,_0x46a0e3(_0x3bad2a)),E(0x2,_0x46a0e3(_0x57e2d4))],j);let M=class extends _0x4779d9{constructor(_0x1ab369,_0x36be48){const _0x42c535=_0x2bf071;super(),this[_0x42c535(0x8a)]=_0x1ab369,this[_0x42c535(0xb1)]=_0x36be48,this[_0x42c535(0xb9)]();}[_0x2bf071(0xb9)](){const _0x4bd81a=_0x2bf071;this[_0x4bd81a(0x8a)][_0x4bd81a(0x8c)]=this[_0x4bd81a(0xb1)],this[_0x4bd81a(0x8a)][_0x4bd81a(0xe0)]=!0x1;}};M=D([E(0x0,_0x34873a),E(0x1,_0x46a0e3(j))],M);function _0x2e04(_0x22868c,_0x56ecdd){_0x22868c=_0x22868c-0x85;const _0x3e8a24=_0x3e8a();let _0x2e04f2=_0x3e8a24[_0x22868c];return _0x2e04f2;}function N(_0x33f07f){'@babel/helpers - typeof';const _0xee0da2=_0x2bf071;return N=typeof Symbol==_0xee0da2(0xd8)&&typeof Symbol[_0xee0da2(0xe3)]==_0xee0da2(0xf0)?function(_0x3d20eb){return typeof _0x3d20eb;}:function(_0x1b31da){const _0x30934f=_0xee0da2;return _0x1b31da&&typeof Symbol==_0x30934f(0xd8)&&_0x1b31da[_0x30934f(0xcc)]===Symbol&&_0x1b31da!==Symbol[_0x30934f(0x90)]?_0x30934f(0xf0):typeof _0x1b31da;},N(_0x33f07f);}function P(_0x25c40a,_0x3bd756){const _0x574de5=_0x2bf071;if(N(_0x25c40a)!=_0x574de5(0xee)||!_0x25c40a)return _0x25c40a;var _0xa7e120=_0x25c40a[Symbol[_0x574de5(0xbd)]];if(_0xa7e120!==void 0x0){var _0x38e7ef=_0xa7e120[_0x574de5(0xc9)](_0x25c40a,_0x3bd756||'default');if(N(_0x38e7ef)!='object')return _0x38e7ef;throw TypeError(_0x574de5(0xc1));}return(_0x3bd756===_0x574de5(0xae)?String:Number)(_0x25c40a);}function F(_0x8f2e76){const _0x5a7522=_0x2bf071;var _0x40b58f=P(_0x8f2e76,_0x5a7522(0xae));return N(_0x40b58f)=='symbol'?_0x40b58f:_0x40b58f+'';}function I(_0x1d33b2,_0x2323c2,_0x166793){const _0xa1aa8f=_0x2bf071;return(_0x2323c2=F(_0x2323c2))in _0x1d33b2?Object[_0xa1aa8f(0xac)](_0x1d33b2,_0x2323c2,{'value':_0x166793,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1d33b2[_0x2323c2]=_0x166793,_0x1d33b2;}let L=class extends _0x1a2f1d{constructor(_0x156cac=C,_0x8dd30c,_0x5cef1a){const _0x3642b0=_0x2bf071;super(),this[_0x3642b0(0xa0)]=_0x156cac,this[_0x3642b0(0xaa)]=_0x8dd30c,this[_0x3642b0(0x86)]=_0x5cef1a;let {..._0x14af15}=_0x37fe87({},C,this['_config']);this[_0x3642b0(0x86)][_0x3642b0(0xef)](_0x3642b0(0x94),_0x14af15);}[_0x2bf071(0xe7)](){const _0x56fcaa=_0x2bf071;[[j],[M],[O]][_0x56fcaa(0xcf)](_0x50087b=>{const _0x238e7c=_0x56fcaa;this[_0x238e7c(0xaa)][_0x238e7c(0xcb)](_0x50087b);});}[_0x2bf071(0xc5)](){const _0x439966=_0x2bf071;this[_0x439966(0xaa)][_0x439966(0xdf)](M),this[_0x439966(0xaa)][_0x439966(0xdf)](O);}};I(L,_0x2bf071(0xbe),_0x2bf071(0x87)),I(L,_0x2bf071(0x92),x),I(L,_0x2bf071(0xf4),S),L=D([_0x91861d(_0x4c4fd2,_0x274af5,_0x239c9c),E(0x1,_0x46a0e3(_0x1404d1)),E(0x2,_0x7b49f5)],L);export{L as UniverThreadCommentDataSourcePlugin};
|
package/lib/types/index.d.ts
CHANGED
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x2c02(){const _0x42b07b=['slice','getUnit','2PZJUxH','/delete','userId','onStarting','UniverProLicense','defineProperty','pluginName','UniverLicensePlugin','getMemberID','@univerjs-pro/license','UniverNetwork','/universer-api/comment/unit/','@univerjs-pro/collaboration-client','CustomRangeType','@univerjs/protocol','_sessionService','/universer-api/user/list','_threadCommentDataSource','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','format','UniverThreadCommentUIPlugin','stringify','_initDataSource','UserManagerService','getUser','parse','@univerjs/thread-comment-ui','subscribe','205064wzUlln','762003mzfeTh','CommentUpdateEventType','IThreadCommentDataSourceService','Reply','root','iterator','Inject','@univerjs/core','_initUserSync','HTTPService','version','user','code','5859MwHeJN','rangeType','bufferTime','get','values','828tSpxvw','ThreadCommentModel','call','body','onReady','getCurrentUser','_commentService','/reply','personId','rangeId','Disposable','UniverCollaborationClientPlugin','UniverProThreadCommentDatasource','replyId','syncUpdateMutationToColla','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Injector','map','COMMENT','addComment','updateComment','prototype','length','dateKit','UniverThreadCommentDataSourcePlugin','merge','forEach','rxjs','Solved','replies','userID','toPrimitive','@univerjs-pro/thread-comment-datasource','users','Add','exports','Solve','saveCommentToSnapshot','disposeWithMe','decorate','symbol','_threadCommentDataSourceService','Module','YYYY/MM/DD\x20HH:mm','deleteComment','dataSource','requireSession','_config','post','reply','comments','toStringTag','/solved','CollaborationSessionService','@univerjs/network','/list','_threadCommentModel','object','constructor','content','type','40vHammY','string','ref','323701yQPhAZ','error','amd','threadId','getComment','_userService','366705uhdCKp','Edit','IConfigService','/edit','DependentOn','3318810StSkHM','solved','delete','resolveComment','OpenOrReOpen','comment','UniverProCollaborationClient','1.0.0-alpha.2','default','filter','customRanges','function','CommentSolvedStatus','184605TFlymF','_configService','add','addUser','setConfig','unitId','117TJsRKv','payload','_init','_injector','find','_httpService'];_0x2c02=function(){return _0x42b07b;};return _0x2c02();}function _0x4d7c(_0x52ed34,_0x9b4eeb){_0x52ed34=_0x52ed34-0x16a;const _0x2c02b7=_0x2c02();let _0x4d7c97=_0x2c02b7[_0x52ed34];return _0x4d7c97;}(function(_0xaf1b4e,_0x175389){const _0x39cdbe=_0x4d7c,_0x3d9234=_0xaf1b4e();while(!![]){try{const _0x1a5832=-parseInt(_0x39cdbe(0x172))/0x1*(-parseInt(_0x39cdbe(0x198))/0x2)+parseInt(_0x39cdbe(0x178))/0x3+parseInt(_0x39cdbe(0x16f))/0x4*(parseInt(_0x39cdbe(0x18a))/0x5)+parseInt(_0x39cdbe(0x1c7))/0x6*(parseInt(_0x39cdbe(0x1c2))/0x7)+-parseInt(_0x39cdbe(0x1b4))/0x8*(parseInt(_0x39cdbe(0x190))/0x9)+-parseInt(_0x39cdbe(0x17d))/0xa+-parseInt(_0x39cdbe(0x1b5))/0xb;if(_0x1a5832===_0x175389)break;else _0x3d9234['push'](_0x3d9234['shift']());}catch(_0xc351ee){_0x3d9234['push'](_0x3d9234['shift']());}}}(_0x2c02,0x2fead),function(_0x506b02,_0x50b0e7){const _0x561ef7=_0x4d7c;typeof exports=='object'&&typeof module<'u'?_0x50b0e7(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/protocol'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define==_0x561ef7(0x188)&&define[_0x561ef7(0x174)]?define([_0x561ef7(0x1ea),_0x561ef7(0x1a4),_0x561ef7(0x1a1),_0x561ef7(0x1bc),_0x561ef7(0x1b2),_0x561ef7(0x1a6),'@univerjs/thread-comment',_0x561ef7(0x1e2),_0x561ef7(0x1fd)],_0x50b0e7):(_0x506b02=typeof globalThis<'u'?globalThis:_0x506b02||self,_0x50b0e7(_0x506b02[_0x561ef7(0x1d3)]={},_0x506b02[_0x561ef7(0x183)],_0x506b02[_0x561ef7(0x19c)],_0x506b02['UniverCore'],_0x506b02['UniverThreadCommentUi'],_0x506b02['UniverProtocol'],_0x506b02['UniverThreadComment'],_0x506b02[_0x561ef7(0x1e2)],_0x506b02[_0x561ef7(0x1a2)]));}(this,function(_0x1736a2,_0x5e24bc,_0x450993,_0x3cbf9b,_0x482b5b,_0x55fbc0,_0x23fc43,_0x3e5865,_0x310862){const _0x52ef9a=_0x4d7c;Object['defineProperty'](_0x1736a2,Symbol[_0x52ef9a(0x1fa)],{'value':_0x52ef9a(0x1f1)});var _0xfa68cc=_0x52ef9a(0x1e7),_0x476802=_0x52ef9a(0x184);let _0x939d2=_0x56fe4d=>(0x0,_0x3cbf9b['dateKit'])(new Date(+_0x56fe4d))[_0x52ef9a(0x1ab)](_0x52ef9a(0x1f2)),_0x3bb54f=async(_0x4eb66f,_0x18a8b0)=>{const _0x7cc13c=_0x52ef9a;let _0x19d5e6=_0x4eb66f[_0x7cc13c(0x1c5)](_0x3cbf9b[_0x7cc13c(0x1af)]),_0x58aa6f=_0x4eb66f['get'](_0x310862[_0x7cc13c(0x1be)]);_0x18a8b0[_0x7cc13c(0x1e1)](_0x4dc704=>{const _0x3783f2=_0x7cc13c;_0x19d5e6[_0x3783f2(0x1b0)](_0x4dc704)&&_0x18a8b0[_0x3783f2(0x17f)](_0x4dc704);}),_0x18a8b0['size']&&(await _0x58aa6f['get'](_0x7cc13c(0x1a8),{'params':{'userIDs':[..._0x18a8b0]}}))['body'][_0x7cc13c(0x1e8)][_0x7cc13c(0x1e1)](_0x3eed5b=>{const _0x18dcaf=_0x7cc13c;_0x3eed5b&&_0x19d5e6[_0x18dcaf(0x18d)](_0x3eed5b);});};function _0x52443d(_0x6325c0,_0x1f709b){return function(_0x255742,_0x4ba938){_0x1f709b(_0x255742,_0x4ba938,_0x6325c0);};}function _0x624728(_0x4e652f,_0x491ee2,_0x4dba5c,_0x3f85fc){const _0x3bedc8=_0x52ef9a;var _0x5c7d05=arguments[_0x3bedc8(0x1dd)],_0x2a893e=_0x5c7d05<0x3?_0x491ee2:_0x3f85fc===null?_0x3f85fc=Object['getOwnPropertyDescriptor'](_0x491ee2,_0x4dba5c):_0x3f85fc,_0x28a5bc;if(typeof Reflect==_0x3bedc8(0x16b)&&typeof Reflect[_0x3bedc8(0x1ee)]==_0x3bedc8(0x188))_0x2a893e=Reflect[_0x3bedc8(0x1ee)](_0x4e652f,_0x491ee2,_0x4dba5c,_0x3f85fc);else{for(var _0xa55595=_0x4e652f[_0x3bedc8(0x1dd)]-0x1;_0xa55595>=0x0;_0xa55595--)(_0x28a5bc=_0x4e652f[_0xa55595])&&(_0x2a893e=(_0x5c7d05<0x3?_0x28a5bc(_0x2a893e):_0x5c7d05>0x3?_0x28a5bc(_0x491ee2,_0x4dba5c,_0x2a893e):_0x28a5bc(_0x491ee2,_0x4dba5c))||_0x2a893e);}return _0x5c7d05>0x3&&_0x2a893e&&Object[_0x3bedc8(0x19d)](_0x491ee2,_0x4dba5c,_0x2a893e),_0x2a893e;}let _0x289b31=class extends _0x3cbf9b['Disposable']{constructor(_0x47f171,_0x1577ce,_0x5c09a4,_0x42f457){const _0x424c73=_0x52ef9a;super(),this['_commentService']=_0x47f171,this['_threadCommentModel']=_0x1577ce,this[_0x424c73(0x177)]=_0x5c09a4,this['_injector']=_0x42f457,this[_0x424c73(0x192)](),this['_initUserSync']();}[_0x52ef9a(0x1bd)](){const _0x4f6ccf=_0x52ef9a;this[_0x4f6ccf(0x1ed)](this['_threadCommentModel']['commentUpdate$']['pipe']((0x0,_0x3e5865[_0x4f6ccf(0x1c4)])(0x10))[_0x4f6ccf(0x1b3)](_0x8685ae=>{let _0x168ad2=new Set();_0x8685ae['forEach'](_0x2c5ae0=>{const _0x176fe6=_0x4d7c;switch(_0x2c5ae0[_0x176fe6(0x16e)]){case'add':{let _0x437f5a=_0x2c5ae0[_0x176fe6(0x191)][_0x176fe6(0x1cf)];_0x168ad2[_0x176fe6(0x18c)](_0x437f5a);break;}default:break;}}),_0x3bb54f(this['_injector'],_0x168ad2);}));}['_init'](){const _0x131595=_0x52ef9a;this[_0x131595(0x1ed)](this[_0x131595(0x1cd)]['commentUpdate$'][_0x131595(0x1b3)](async _0x4aa356=>{const _0x27c0a7=_0x131595;var _0x37b812;let _0x6faff7=(_0x37b812=this[_0x27c0a7(0x16a)][_0x27c0a7(0x197)](_0x4aa356[_0x27c0a7(0x18f)])[_0x27c0a7(0x194)](_0x44bc57=>_0x44bc57[_0x27c0a7(0x175)]===_0x4aa356['threadId']))==null?void 0x0:_0x37b812[_0x27c0a7(0x1b9)];if(!_0x6faff7)return;let {unitId:_0x2aa45c,subUnitId:_0x226d9f}=_0x6faff7;switch(_0x4aa356[_0x27c0a7(0x1c0)]&&this[_0x27c0a7(0x177)][_0x27c0a7(0x18d)](_0x4aa356[_0x27c0a7(0x1c0)]),_0x4aa356[_0x27c0a7(0x16e)]){case _0x55fbc0[_0x27c0a7(0x1b6)][_0x27c0a7(0x1e9)]:break;case _0x55fbc0[_0x27c0a7(0x1b6)][_0x27c0a7(0x1b8)]:var _0x159b0b,_0x2409cc;this[_0x27c0a7(0x16a)][_0x27c0a7(0x1da)](_0x2aa45c,_0x226d9f,{'unitId':_0x2aa45c,'subUnitId':_0x226d9f,'ref':'','id':_0x4aa356[_0x27c0a7(0x1d4)],'dT':_0x939d2(+_0x4aa356['createTimestamp']),'threadId':_0x4aa356[_0x27c0a7(0x175)],'personId':(_0x159b0b=(_0x2409cc=_0x4aa356[_0x27c0a7(0x1c0)])==null?void 0x0:_0x2409cc[_0x27c0a7(0x1e5)])==null?_0x4aa356[_0x27c0a7(0x19a)]:_0x159b0b,'text':JSON[_0x27c0a7(0x1b1)](_0x4aa356['content']),'parentId':_0x6faff7['id']});break;case _0x55fbc0[_0x27c0a7(0x1b6)]['Delete']:{let _0x26cf26=this[_0x27c0a7(0x16a)][_0x27c0a7(0x176)](_0x2aa45c,_0x226d9f,_0x4aa356[_0x27c0a7(0x1d4)]);_0x26cf26&&_0x26cf26['parentId']&&this['_threadCommentModel'][_0x27c0a7(0x1f3)](_0x2aa45c,_0x226d9f,_0x4aa356['replyId']);break;}case _0x55fbc0[_0x27c0a7(0x1b6)][_0x27c0a7(0x179)]:this[_0x27c0a7(0x16a)][_0x27c0a7(0x1db)](_0x2aa45c,_0x226d9f,{'commentId':_0x4aa356[_0x27c0a7(0x1d4)],'text':JSON[_0x27c0a7(0x1b1)](_0x4aa356[_0x27c0a7(0x16d)])});break;case _0x55fbc0[_0x27c0a7(0x1b6)][_0x27c0a7(0x1eb)]:{var _0x25280e;let _0x3fd237=(_0x25280e=this['_threadCommentModel'][_0x27c0a7(0x197)](_0x4aa356['unitId'])[_0x27c0a7(0x194)](_0x577893=>_0x577893[_0x27c0a7(0x175)]===_0x4aa356['threadId']))==null?void 0x0:_0x25280e[_0x27c0a7(0x1b9)];_0x3fd237&&this['_threadCommentModel']['resolveComment'](_0x2aa45c,_0x226d9f,_0x3fd237['id'],_0x4aa356[_0x27c0a7(0x17e)]===_0x55fbc0[_0x27c0a7(0x189)][_0x27c0a7(0x1e3)]);break;}default:break;}}));}};_0x289b31=_0x624728([_0x52443d(0x0,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x5e24bc['CommentService'])),_0x52443d(0x1,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x23fc43[_0x52ef9a(0x1c8)])),_0x52443d(0x2,(0x0,_0x3cbf9b['Inject'])(_0x3cbf9b[_0x52ef9a(0x1af)])),_0x52443d(0x3,(0x0,_0x3cbf9b['Inject'])(_0x3cbf9b[_0x52ef9a(0x1d7)]))],_0x289b31);let _0x5eb667={};function _0x1ed9ad(_0x431baa,_0x562485){const _0x4b676d=_0x52ef9a;let _0x90b68d=_0x431baa[_0x4b676d(0x1e4)][0x0];return{..._0x562485,'id':_0x90b68d[_0x4b676d(0x1d4)],'resolved':_0x431baa['solved']===0x1,'dT':_0x939d2(_0x90b68d['createTimestamp']),'personId':_0x90b68d['userId'],'threadId':_0x90b68d[_0x4b676d(0x175)]};}function _0x2f5b96(_0x583291,_0xdabb8d,_0x1c9be9){const _0x4e3448=_0x52ef9a;var _0x386a2d,_0x1a5e8b;if(((_0x386a2d=_0x583291==null||(_0x1a5e8b=_0x583291[_0x4e3448(0x1e4)])==null?void 0x0:_0x1a5e8b[_0x4e3448(0x1dd)])==null?0x0:_0x386a2d)>0x0){let _0x41ff14=(_0x57e0cd,_0x365904)=>({'id':_0x57e0cd[_0x4e3448(0x1d4)],'threadId':_0x57e0cd['threadId'],'dT':_0x939d2(_0x57e0cd['createTimestamp']),'personId':_0x57e0cd[_0x4e3448(0x19a)],'resolved':_0x583291[_0x4e3448(0x17e)]===_0x55fbc0[_0x4e3448(0x189)][_0x4e3448(0x1e3)],'unitId':_0xdabb8d,'subUnitId':_0x1c9be9,'text':JSON['parse'](_0x57e0cd['content']),'parentId':_0x365904}),_0x37d7fe=_0x41ff14(_0x583291[_0x4e3448(0x1e4)][0x0]);return{..._0x37d7fe,'children':_0x583291[_0x4e3448(0x1e4)][_0x4e3448(0x196)](0x1)[_0x4e3448(0x1d8)](_0x4babea=>_0x41ff14(_0x4babea,_0x37d7fe['id']))};}return null;}let _0x21ea39=class{constructor(_0x214c53,_0xa55570,_0x464140){const _0x49fbf5=_0x52ef9a;this[_0x49fbf5(0x195)]=_0x214c53,this[_0x49fbf5(0x177)]=_0xa55570,this[_0x49fbf5(0x1a7)]=_0x464140;}async['addComment'](_0x2997a9){const _0x33ee2b=_0x52ef9a;var _0x2a47f3,_0x235ee3;let {parentId:_0x410d49,unitId:_0x3d92cd,text:_0x2072be,threadId:_0x5ca664}=_0x2997a9,_0xf7179f=(_0x2a47f3=(_0x235ee3=_0x2072be[_0x33ee2b(0x187)])==null?void 0x0:_0x235ee3['filter'](_0x4768e9=>_0x4768e9[_0x33ee2b(0x1c3)]===_0x3cbf9b[_0x33ee2b(0x1a5)][_0x33ee2b(0x1d9)])['map'](_0x4bc911=>_0x4bc911[_0x33ee2b(0x1d0)]))==null?[]:_0x2a47f3,_0x577d36=JSON[_0x33ee2b(0x1ad)](_0x2072be),_0x3bae75=(await this[_0x33ee2b(0x1a7)][_0x33ee2b(0x1f5)](_0x3d92cd))['getMemberID']();if(_0x410d49){let _0x36f7e7={'memberId':_0x3bae75,'unitId':_0x3d92cd,'content':_0x577d36,'mention':_0xf7179f,'threadId':_0x5ca664},_0x53ad1f=(await this[_0x33ee2b(0x195)][_0x33ee2b(0x1f7)]('/universer-api/comment/unit/'+_0x3d92cd+_0x33ee2b(0x1ce),{'body':_0x36f7e7}))['body'][_0x33ee2b(0x1f8)];return{..._0x2997a9,'id':_0x53ad1f[_0x33ee2b(0x1d4)],'dT':(0x0,_0x3cbf9b[_0x33ee2b(0x1de)])(+_0x53ad1f['createTimestamp'])[_0x33ee2b(0x1ab)](_0x33ee2b(0x1f2)),'personId':_0x53ad1f['userId']};}else{let _0x20a294={'memberId':_0x3bae75,'unitId':_0x3d92cd,'content':_0x577d36,'mention':_0xf7179f};return _0x1ed9ad((await this['_httpService'][_0x33ee2b(0x1f7)](_0x33ee2b(0x1a3)+_0x3d92cd+'/add',{'body':_0x20a294}))[_0x33ee2b(0x1ca)][_0x33ee2b(0x182)],_0x2997a9);}}async['updateComment'](_0x5af4d1){const _0x38f1f8=_0x52ef9a;var _0x4b4fae,_0x5eb41b;let {text:_0x31121f,unitId:_0x155376}=_0x5af4d1,_0x59160c=(_0x4b4fae=(_0x5eb41b=_0x31121f[_0x38f1f8(0x187)])==null?void 0x0:_0x5eb41b[_0x38f1f8(0x186)](_0x1b244c=>_0x1b244c[_0x38f1f8(0x1c3)]===_0x3cbf9b[_0x38f1f8(0x1a5)][_0x38f1f8(0x1d9)])['map'](_0x1439bd=>_0x1439bd[_0x38f1f8(0x1d0)]))==null?[]:_0x4b4fae,_0xe9cbc0=JSON[_0x38f1f8(0x1ad)](_0x31121f),_0x760804=_0x5af4d1[_0x38f1f8(0x175)],_0x4e63d0=_0x5af4d1['id'],_0x34a1c5={'memberId':(await this[_0x38f1f8(0x1a7)][_0x38f1f8(0x1f5)](_0x155376))['getMemberID'](),'unitId':_0x155376,'threadId':_0x760804,'mention':_0x59160c,'content':_0xe9cbc0,'replyId':_0x4e63d0},_0xc545e8=await this[_0x38f1f8(0x195)]['post']('/universer-api/comment/unit/'+_0x155376+_0x38f1f8(0x17b),{'body':_0x34a1c5});return!_0xc545e8['body'][_0x38f1f8(0x173)]||_0xc545e8[_0x38f1f8(0x1ca)][_0x38f1f8(0x173)]['code']===0x1;}async[_0x52ef9a(0x180)](_0x97ce87){const _0x650ef0=_0x52ef9a;let {unitId:_0x7e87}=_0x97ce87,_0x4efe52=_0x97ce87[_0x650ef0(0x175)],_0xcb02a8={'memberId':this[_0x650ef0(0x177)][_0x650ef0(0x1cc)]()[_0x650ef0(0x1e5)],'unitId':_0x7e87,'threadId':_0x4efe52,'solved':_0x97ce87['resolved']?_0x55fbc0[_0x650ef0(0x189)][_0x650ef0(0x1e3)]:_0x55fbc0['CommentSolvedStatus'][_0x650ef0(0x181)]},_0x581b6e=await this[_0x650ef0(0x195)][_0x650ef0(0x1f7)](_0x650ef0(0x1a3)+_0x7e87+_0x650ef0(0x1fb),{'body':_0xcb02a8});return!_0x581b6e[_0x650ef0(0x1ca)]['error']||_0x581b6e[_0x650ef0(0x1ca)][_0x650ef0(0x173)][_0x650ef0(0x1c1)]===0x1;}async[_0x52ef9a(0x1f3)](_0x158090,_0x26980c,_0x2420fc,_0x15d266){const _0x226f53=_0x52ef9a;let _0x146356={'memberId':(await this[_0x226f53(0x1a7)]['requireSession'](_0x158090))[_0x226f53(0x1a0)](),'threadId':_0x2420fc,'replyId':_0x15d266,'unitId':_0x158090},_0x2e9f29=await this[_0x226f53(0x195)][_0x226f53(0x1f7)](_0x226f53(0x1a3)+_0x158090+_0x226f53(0x199),{'body':_0x146356});return!_0x2e9f29['body']['error']||_0x2e9f29[_0x226f53(0x1ca)][_0x226f53(0x173)][_0x226f53(0x1c1)]===0x1;}async['listComments'](_0x351f97,_0x187f81,_0xc4ab87){const _0x4ebf82=_0x52ef9a;let _0xf8d71e={'unitId':_0x351f97,'threadId':_0xc4ab87},_0xc1c5fb=await this[_0x4ebf82(0x195)][_0x4ebf82(0x1f7)](_0x4ebf82(0x1a3)+_0x351f97+_0x4ebf82(0x1fe),{'body':_0xf8d71e}),_0x418a90=_0xc4ab87['map'](_0xc4416b=>_0x2f5b96(_0xc1c5fb[_0x4ebf82(0x1ca)][_0x4ebf82(0x1f9)][_0xc4416b],_0x351f97,_0x187f81))[_0x4ebf82(0x186)](Boolean);return Object[_0x4ebf82(0x1c6)](_0xc1c5fb[_0x4ebf82(0x1ca)][_0x4ebf82(0x1e8)])[_0x4ebf82(0x1e1)](_0x35020f=>{const _0x5d31fe=_0x4ebf82;this['_userService'][_0x5d31fe(0x18d)](_0x35020f);}),_0x418a90;}[_0x52ef9a(0x1ec)](_0x543002){const _0x381f70=_0x52ef9a;return{'id':_0x543002['id'],'threadId':_0x543002[_0x381f70(0x175)],'ref':_0x543002[_0x381f70(0x171)]};}};_0x21ea39=_0x624728([_0x52443d(0x0,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x310862[_0x52ef9a(0x1be)])),_0x52443d(0x1,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x3cbf9b['UserManagerService'])),_0x52443d(0x2,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x5e24bc[_0x52ef9a(0x1fc)]))],_0x21ea39);let _0x4c6e13=class extends _0x3cbf9b[_0x52ef9a(0x1d1)]{constructor(_0x1ffdb2,_0x1b6bca){const _0x19a547=_0x52ef9a;super(),this[_0x19a547(0x1f0)]=_0x1ffdb2,this['_threadCommentDataSource']=_0x1b6bca,this[_0x19a547(0x1ae)]();}['_initDataSource'](){const _0x1eea2e=_0x52ef9a;this[_0x1eea2e(0x1f0)][_0x1eea2e(0x1f4)]=this[_0x1eea2e(0x1a9)],this[_0x1eea2e(0x1f0)][_0x1eea2e(0x1d5)]=!0x1;}};_0x4c6e13=_0x624728([_0x52443d(0x0,_0x23fc43[_0x52ef9a(0x1b7)]),_0x52443d(0x1,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x21ea39))],_0x4c6e13);function _0x478386(_0x3a49c3){'@babel/helpers - typeof';const _0x6c5d04=_0x52ef9a;return _0x478386=typeof Symbol=='function'&&typeof Symbol[_0x6c5d04(0x1ba)]==_0x6c5d04(0x1ef)?function(_0x4e97c9){return typeof _0x4e97c9;}:function(_0x1dced7){const _0xac4c2d=_0x6c5d04;return _0x1dced7&&typeof Symbol==_0xac4c2d(0x188)&&_0x1dced7[_0xac4c2d(0x16c)]===Symbol&&_0x1dced7!==Symbol[_0xac4c2d(0x1dc)]?'symbol':typeof _0x1dced7;},_0x478386(_0x3a49c3);}function _0x4e5f5f(_0x54c3ce,_0x50a831){const _0x3e9f95=_0x52ef9a;if(_0x478386(_0x54c3ce)!=_0x3e9f95(0x16b)||!_0x54c3ce)return _0x54c3ce;var _0x221850=_0x54c3ce[Symbol[_0x3e9f95(0x1e6)]];if(_0x221850!==void 0x0){var _0xa06ea=_0x221850[_0x3e9f95(0x1c9)](_0x54c3ce,_0x50a831||_0x3e9f95(0x185));if(_0x478386(_0xa06ea)!=_0x3e9f95(0x16b))return _0xa06ea;throw TypeError(_0x3e9f95(0x1aa));}return(_0x50a831===_0x3e9f95(0x170)?String:Number)(_0x54c3ce);}function _0x407e87(_0x22e14f){const _0x2ee9cd=_0x52ef9a;var _0x2fc009=_0x4e5f5f(_0x22e14f,_0x2ee9cd(0x170));return _0x478386(_0x2fc009)==_0x2ee9cd(0x1ef)?_0x2fc009:_0x2fc009+'';}function _0x4e4c4f(_0x1033ea,_0x1217a6,_0x3b2c86){const _0x1dc9b8=_0x52ef9a;return(_0x1217a6=_0x407e87(_0x1217a6))in _0x1033ea?Object[_0x1dc9b8(0x19d)](_0x1033ea,_0x1217a6,{'value':_0x3b2c86,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x1033ea[_0x1217a6]=_0x3b2c86,_0x1033ea;}let _0x166205=class extends _0x3cbf9b['Plugin']{constructor(_0xc9c886=_0x5eb667,_0x129357,_0x4c83c5){const _0x40130b=_0x52ef9a;super(),this[_0x40130b(0x1f6)]=_0xc9c886,this[_0x40130b(0x193)]=_0x129357,this['_configService']=_0x4c83c5;let {..._0x496f26}=(0x0,_0x3cbf9b[_0x40130b(0x1e0)])({},_0x5eb667,this[_0x40130b(0x1f6)]);this[_0x40130b(0x18b)][_0x40130b(0x18e)]('thread-comment-data-source.config',_0x496f26);}[_0x52ef9a(0x19b)](){const _0x11acb3=_0x52ef9a;[[_0x21ea39],[_0x4c6e13],[_0x289b31]][_0x11acb3(0x1e1)](_0x15188d=>{const _0x29c866=_0x11acb3;this[_0x29c866(0x193)][_0x29c866(0x18c)](_0x15188d);});}[_0x52ef9a(0x1cb)](){const _0x4c645b=_0x52ef9a;this['_injector'][_0x4c645b(0x1c5)](_0x4c6e13),this['_injector'][_0x4c645b(0x1c5)](_0x289b31);}};_0x4e4c4f(_0x166205,_0x52ef9a(0x19e),_0x52ef9a(0x1d6)),_0x4e4c4f(_0x166205,'packageName',_0xfa68cc),_0x4e4c4f(_0x166205,_0x52ef9a(0x1bf),_0x476802),_0x166205=_0x624728([(0x0,_0x3cbf9b[_0x52ef9a(0x17c)])(_0x482b5b[_0x52ef9a(0x1ac)],_0x5e24bc[_0x52ef9a(0x1d2)],_0x450993[_0x52ef9a(0x19f)]),_0x52443d(0x1,(0x0,_0x3cbf9b[_0x52ef9a(0x1bb)])(_0x3cbf9b[_0x52ef9a(0x1d7)])),_0x52443d(0x2,_0x3cbf9b[_0x52ef9a(0x17a)])],_0x166205),Object['defineProperty'](_0x1736a2,_0x52ef9a(0x1df),{'enumerable':!0x0,'get':function(){return _0x166205;}});}));
|
|
1
|
+
function _0x3621(_0x2382ed,_0x417e4d){_0x2382ed=_0x2382ed-0x1d6;const _0x1bc067=_0x1bc0();let _0x36214b=_0x1bc067[_0x2382ed];return _0x36214b;}(function(_0x4173bc,_0x129385){const _0x553980=_0x3621,_0x3145a3=_0x4173bc();while(!![]){try{const _0x4d81e9=parseInt(_0x553980(0x258))/0x1+parseInt(_0x553980(0x1e5))/0x2*(parseInt(_0x553980(0x251))/0x3)+parseInt(_0x553980(0x20d))/0x4+-parseInt(_0x553980(0x225))/0x5+parseInt(_0x553980(0x202))/0x6*(parseInt(_0x553980(0x1fb))/0x7)+-parseInt(_0x553980(0x227))/0x8+-parseInt(_0x553980(0x21f))/0x9*(parseInt(_0x553980(0x25b))/0xa);if(_0x4d81e9===_0x129385)break;else _0x3145a3['push'](_0x3145a3['shift']());}catch(_0x3c1e78){_0x3145a3['push'](_0x3145a3['shift']());}}}(_0x1bc0,0x1bcf7),function(_0x3fb22a,_0x5af42d){const _0x54f887=_0x3621;typeof exports==_0x54f887(0x1f2)&&typeof module<'u'?_0x5af42d(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/protocol'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define==_0x54f887(0x223)&&define[_0x54f887(0x1d8)]?define([_0x54f887(0x21b),_0x54f887(0x238),_0x54f887(0x222),_0x54f887(0x24f),_0x54f887(0x224),_0x54f887(0x20f),'@univerjs/thread-comment',_0x54f887(0x212),_0x54f887(0x25f)],_0x5af42d):(_0x3fb22a=typeof globalThis<'u'?globalThis:_0x3fb22a||self,_0x5af42d(_0x3fb22a[_0x54f887(0x249)]={},_0x3fb22a[_0x54f887(0x25a)],_0x3fb22a[_0x54f887(0x211)],_0x3fb22a[_0x54f887(0x205)],_0x3fb22a[_0x54f887(0x253)],_0x3fb22a['UniverProtocol'],_0x3fb22a[_0x54f887(0x25e)],_0x3fb22a['rxjs'],_0x3fb22a[_0x54f887(0x1ed)]));}(this,function(_0x12a69f,_0x2e378a,_0x35c489,_0x579a25,_0x3a4fb4,_0x47b348,_0x132505,_0x6ca5d4,_0x903e43){const _0x210f5c=_0x3621;Object['defineProperty'](_0x12a69f,Symbol[_0x210f5c(0x1dc)],{'value':'Module'});var _0x20eeeb=_0x210f5c(0x206),_0x24c283='1.0.0-alpha.3';let _0x538f41={},_0x1873da=_0x1ee369=>(0x0,_0x579a25[_0x210f5c(0x231)])(new Date(+_0x1ee369))[_0x210f5c(0x266)](_0x210f5c(0x1fd)),_0x229e68=async(_0x5c53ea,_0x544d4d)=>{const _0x3b6405=_0x210f5c;let _0x5219e7=_0x5c53ea[_0x3b6405(0x260)](_0x579a25[_0x3b6405(0x252)]),_0x261797=_0x5c53ea[_0x3b6405(0x260)](_0x903e43[_0x3b6405(0x210)]);_0x544d4d['forEach'](_0x2c28b4=>{const _0x14a0c2=_0x3b6405;_0x5219e7[_0x14a0c2(0x235)](_0x2c28b4)&&_0x544d4d[_0x14a0c2(0x242)](_0x2c28b4);}),_0x544d4d[_0x3b6405(0x216)]&&(await _0x261797[_0x3b6405(0x260)](_0x3b6405(0x263),{'params':{'userIDs':[..._0x544d4d]}}))[_0x3b6405(0x22f)][_0x3b6405(0x1e3)][_0x3b6405(0x1e6)](_0x52b0b9=>{const _0x498b37=_0x3b6405;_0x52b0b9&&_0x5219e7[_0x498b37(0x1df)](_0x52b0b9);});};function _0x4da42c(_0x2fa35b,_0x3174a4){return function(_0x44ed67,_0x4e039d){_0x3174a4(_0x44ed67,_0x4e039d,_0x2fa35b);};}function _0x3ad348(_0x386047,_0x2e7670,_0x155feb,_0x2a07c5){const _0x51148f=_0x210f5c;var _0x2a7e9e=arguments[_0x51148f(0x1ef)],_0x48e50d=_0x2a7e9e<0x3?_0x2e7670:_0x2a07c5===null?_0x2a07c5=Object[_0x51148f(0x1f4)](_0x2e7670,_0x155feb):_0x2a07c5,_0x1e94a6;if(typeof Reflect=='object'&&typeof Reflect['decorate']=='function')_0x48e50d=Reflect[_0x51148f(0x22e)](_0x386047,_0x2e7670,_0x155feb,_0x2a07c5);else{for(var _0x5a1b5f=_0x386047[_0x51148f(0x1ef)]-0x1;_0x5a1b5f>=0x0;_0x5a1b5f--)(_0x1e94a6=_0x386047[_0x5a1b5f])&&(_0x48e50d=(_0x2a7e9e<0x3?_0x1e94a6(_0x48e50d):_0x2a7e9e>0x3?_0x1e94a6(_0x2e7670,_0x155feb,_0x48e50d):_0x1e94a6(_0x2e7670,_0x155feb))||_0x48e50d);}return _0x2a7e9e>0x3&&_0x48e50d&&Object['defineProperty'](_0x2e7670,_0x155feb,_0x48e50d),_0x48e50d;}let _0x4399f3=class extends _0x579a25[_0x210f5c(0x262)]{constructor(_0x316ca8,_0x4d6258,_0x4186c8,_0x19b655){const _0x52fff3=_0x210f5c;super(),this['_commentService']=_0x316ca8,this[_0x52fff3(0x1e1)]=_0x4d6258,this[_0x52fff3(0x256)]=_0x4186c8,this[_0x52fff3(0x239)]=_0x19b655,this[_0x52fff3(0x23a)](),this[_0x52fff3(0x23f)]();}[_0x210f5c(0x23f)](){const _0xb3d323=_0x210f5c;this[_0xb3d323(0x1ea)](this[_0xb3d323(0x1e1)][_0xb3d323(0x230)]['pipe']((0x0,_0x6ca5d4[_0xb3d323(0x1e2)])(0x10))['subscribe'](_0x5cf5f9=>{const _0x2501c4=_0xb3d323;let _0x33053d=new Set();_0x5cf5f9[_0x2501c4(0x1e6)](_0x409cf8=>{const _0x315bb1=_0x2501c4;switch(_0x409cf8['type']){case _0x315bb1(0x1db):{let _0x3bffe3=_0x409cf8['payload'][_0x315bb1(0x21a)];_0x33053d['add'](_0x3bffe3);break;}default:break;}}),_0x229e68(this[_0x2501c4(0x239)],_0x33053d);}));}['_init'](){const _0x5c0b9c=_0x210f5c;this['disposeWithMe'](this[_0x5c0b9c(0x217)][_0x5c0b9c(0x230)][_0x5c0b9c(0x1fe)](async _0x3d28bf=>{const _0x3b139a=_0x5c0b9c;var _0x1154b9;let _0x146954=(_0x1154b9=this['_threadCommentModel'][_0x3b139a(0x1f7)](_0x3d28bf['unitId'])[_0x3b139a(0x1f6)](_0x3f3da3=>_0x3f3da3[_0x3b139a(0x1de)]===_0x3d28bf['threadId']))==null?void 0x0:_0x1154b9[_0x3b139a(0x1eb)];if(!_0x146954)return;let {unitId:_0x208aae,subUnitId:_0x45eab6}=_0x146954;switch(_0x3d28bf[_0x3b139a(0x20e)]&&this[_0x3b139a(0x256)][_0x3b139a(0x1df)](_0x3d28bf[_0x3b139a(0x20e)]),_0x3d28bf[_0x3b139a(0x1f3)]){case _0x47b348[_0x3b139a(0x209)][_0x3b139a(0x201)]:break;case _0x47b348[_0x3b139a(0x209)][_0x3b139a(0x265)]:var _0x45314f,_0x5435ea;this[_0x3b139a(0x1e1)][_0x3b139a(0x245)](_0x208aae,_0x45eab6,{'unitId':_0x208aae,'subUnitId':_0x45eab6,'ref':'','id':_0x3d28bf[_0x3b139a(0x1f9)],'dT':_0x1873da(+_0x3d28bf[_0x3b139a(0x25d)]),'threadId':_0x3d28bf['threadId'],'personId':(_0x45314f=(_0x5435ea=_0x3d28bf[_0x3b139a(0x20e)])==null?void 0x0:_0x5435ea[_0x3b139a(0x1e8)])==null?_0x3d28bf[_0x3b139a(0x261)]:_0x45314f,'text':JSON[_0x3b139a(0x244)](_0x3d28bf[_0x3b139a(0x24a)]),'parentId':_0x146954['id']});break;case _0x47b348['CommentUpdateEventType']['Delete']:{let _0x326727=this[_0x3b139a(0x1e1)][_0x3b139a(0x24e)](_0x208aae,_0x45eab6,_0x3d28bf[_0x3b139a(0x1f9)]);_0x326727&&_0x326727[_0x3b139a(0x23b)]&&this[_0x3b139a(0x1e1)]['deleteComment'](_0x208aae,_0x45eab6,_0x3d28bf[_0x3b139a(0x1f9)]);break;}case _0x47b348['CommentUpdateEventType'][_0x3b139a(0x20c)]:this[_0x3b139a(0x1e1)]['updateComment'](_0x208aae,_0x45eab6,{'commentId':_0x3d28bf[_0x3b139a(0x1f9)],'text':JSON['parse'](_0x3d28bf['content'])});break;case _0x47b348[_0x3b139a(0x209)][_0x3b139a(0x24d)]:{var _0xc3b466;let _0x4e2bc5=(_0xc3b466=this[_0x3b139a(0x1e1)][_0x3b139a(0x1f7)](_0x3d28bf['unitId'])[_0x3b139a(0x1f6)](_0x228249=>_0x228249[_0x3b139a(0x1de)]===_0x3d28bf[_0x3b139a(0x1de)]))==null?void 0x0:_0xc3b466[_0x3b139a(0x1eb)];_0x4e2bc5&&this[_0x3b139a(0x1e1)]['resolveComment'](_0x208aae,_0x45eab6,_0x4e2bc5['id'],_0x3d28bf['solved']===_0x47b348[_0x3b139a(0x22d)][_0x3b139a(0x21e)]);break;}default:break;}}));}};_0x4399f3=_0x3ad348([_0x4da42c(0x0,(0x0,_0x579a25['Inject'])(_0x2e378a[_0x210f5c(0x1ff)])),_0x4da42c(0x1,(0x0,_0x579a25[_0x210f5c(0x1da)])(_0x132505[_0x210f5c(0x226)])),_0x4da42c(0x2,(0x0,_0x579a25['Inject'])(_0x579a25[_0x210f5c(0x252)])),_0x4da42c(0x3,(0x0,_0x579a25[_0x210f5c(0x1da)])(_0x579a25[_0x210f5c(0x20a)]))],_0x4399f3);function _0x29ac7c(_0x536ce5,_0x161900){const _0x5af66e=_0x210f5c;let _0x35de5e=_0x536ce5[_0x5af66e(0x22c)][0x0];return{..._0x161900,'id':_0x35de5e[_0x5af66e(0x1f9)],'resolved':_0x536ce5[_0x5af66e(0x248)]===0x1,'dT':_0x1873da(_0x35de5e['createTimestamp']),'personId':_0x35de5e[_0x5af66e(0x261)],'threadId':_0x35de5e[_0x5af66e(0x1de)]};}function _0x36d570(_0x4ef99e,_0x6b5628,_0x395499){const _0x26378a=_0x210f5c;var _0x1a4d3b,_0xd90058;if(((_0x1a4d3b=_0x4ef99e==null||(_0xd90058=_0x4ef99e[_0x26378a(0x22c)])==null?void 0x0:_0xd90058[_0x26378a(0x1ef)])==null?0x0:_0x1a4d3b)>0x0){let _0x539066=(_0x20b7d0,_0x29e4c1)=>({'id':_0x20b7d0[_0x26378a(0x1f9)],'threadId':_0x20b7d0['threadId'],'dT':_0x1873da(_0x20b7d0[_0x26378a(0x25d)]),'personId':_0x20b7d0['userId'],'resolved':_0x4ef99e[_0x26378a(0x248)]===_0x47b348['CommentSolvedStatus'][_0x26378a(0x21e)],'unitId':_0x6b5628,'subUnitId':_0x395499,'text':JSON[_0x26378a(0x244)](_0x20b7d0[_0x26378a(0x24a)]),'parentId':_0x29e4c1}),_0x4be0ef=_0x539066(_0x4ef99e[_0x26378a(0x22c)][0x0]);return{..._0x4be0ef,'children':_0x4ef99e[_0x26378a(0x22c)][_0x26378a(0x200)](0x1)[_0x26378a(0x233)](_0x6b70d3=>_0x539066(_0x6b70d3,_0x4be0ef['id']))};}return null;}let _0x5b8e88=class{constructor(_0x316900,_0x5a80b1,_0x2e1ce9){const _0x431e12=_0x210f5c;this[_0x431e12(0x267)]=_0x316900,this[_0x431e12(0x256)]=_0x5a80b1,this['_sessionService']=_0x2e1ce9;}async[_0x210f5c(0x245)](_0x11e4b3){const _0x2a79ac=_0x210f5c;var _0x5d9ba7,_0x1fd0d9;let {parentId:_0x1bbf75,unitId:_0x1b4ae0,text:_0x3f7e7e,threadId:_0x372445}=_0x11e4b3,_0xdd7f26=(_0x5d9ba7=(_0x1fd0d9=_0x3f7e7e['customRanges'])==null?void 0x0:_0x1fd0d9['filter'](_0x2e7508=>_0x2e7508['rangeType']===_0x579a25[_0x2a79ac(0x1d6)][_0x2a79ac(0x257)])['map'](_0x99bf8=>_0x99bf8[_0x2a79ac(0x1dd)]))==null?[]:_0x5d9ba7,_0x1b2a06=JSON['stringify'](_0x3f7e7e),_0x4ba81a=(await this['_sessionService']['requireSession'](_0x1b4ae0))[_0x2a79ac(0x232)]();if(_0x1bbf75){let _0x4c651b={'memberId':_0x4ba81a,'unitId':_0x1b4ae0,'content':_0x1b2a06,'mention':_0xdd7f26,'threadId':_0x372445},_0x590073=(await this['_httpService']['post'](_0x2a79ac(0x22a)+_0x1b4ae0+'/reply',{'body':_0x4c651b}))[_0x2a79ac(0x22f)]['reply'];return{..._0x11e4b3,'id':_0x590073['replyId'],'dT':(0x0,_0x579a25[_0x2a79ac(0x231)])(+_0x590073[_0x2a79ac(0x25d)])[_0x2a79ac(0x266)](_0x2a79ac(0x1fd)),'personId':_0x590073[_0x2a79ac(0x261)]};}else{let _0xd48997={'memberId':_0x4ba81a,'unitId':_0x1b4ae0,'content':_0x1b2a06,'mention':_0xdd7f26};return _0x29ac7c((await this[_0x2a79ac(0x267)]['post'](_0x2a79ac(0x22a)+_0x1b4ae0+_0x2a79ac(0x243),{'body':_0xd48997}))[_0x2a79ac(0x22f)][_0x2a79ac(0x259)],_0x11e4b3);}}async['updateComment'](_0x1159f8){const _0x51c141=_0x210f5c;var _0x535b74,_0x559fc2;let {text:_0x2659a8,unitId:_0x251a2f}=_0x1159f8,_0x4db74=(_0x535b74=(_0x559fc2=_0x2659a8[_0x51c141(0x24b)])==null?void 0x0:_0x559fc2[_0x51c141(0x247)](_0x23cc68=>_0x23cc68[_0x51c141(0x229)]===_0x579a25['CustomRangeType'][_0x51c141(0x257)])[_0x51c141(0x233)](_0x44c795=>_0x44c795[_0x51c141(0x1dd)]))==null?[]:_0x535b74,_0x2f6fce=JSON[_0x51c141(0x23d)](_0x2659a8),_0x18524d=_0x1159f8[_0x51c141(0x1de)],_0x3a4ee9=_0x1159f8['id'],_0x2b96cc={'memberId':(await this[_0x51c141(0x24c)][_0x51c141(0x25c)](_0x251a2f))[_0x51c141(0x232)](),'unitId':_0x251a2f,'threadId':_0x18524d,'mention':_0x4db74,'content':_0x2f6fce,'replyId':_0x3a4ee9},_0x4db110=await this[_0x51c141(0x267)][_0x51c141(0x213)]('/universer-api/comment/unit/'+_0x251a2f+_0x51c141(0x203),{'body':_0x2b96cc});return!_0x4db110[_0x51c141(0x22f)][_0x51c141(0x241)]||_0x4db110[_0x51c141(0x22f)]['error'][_0x51c141(0x221)]===0x1;}async['resolveComment'](_0x38279a){const _0x104a70=_0x210f5c;let {unitId:_0x438dba}=_0x38279a,_0x3d1891=_0x38279a[_0x104a70(0x1de)],_0x416a17={'memberId':this[_0x104a70(0x256)]['getCurrentUser']()['userID'],'unitId':_0x438dba,'threadId':_0x3d1891,'solved':_0x38279a[_0x104a70(0x22b)]?_0x47b348['CommentSolvedStatus'][_0x104a70(0x21e)]:_0x47b348[_0x104a70(0x22d)][_0x104a70(0x215)]},_0xdac54f=await this[_0x104a70(0x267)][_0x104a70(0x213)](_0x104a70(0x22a)+_0x438dba+_0x104a70(0x254),{'body':_0x416a17});return!_0xdac54f[_0x104a70(0x22f)][_0x104a70(0x241)]||_0xdac54f[_0x104a70(0x22f)][_0x104a70(0x241)]['code']===0x1;}async['deleteComment'](_0x46fa10,_0x34dcd4,_0x353a36,_0x113441){const _0x3bc121=_0x210f5c;let _0x1307cc={'memberId':(await this[_0x3bc121(0x24c)][_0x3bc121(0x25c)](_0x46fa10))[_0x3bc121(0x232)](),'threadId':_0x353a36,'replyId':_0x113441,'unitId':_0x46fa10},_0x34e833=await this[_0x3bc121(0x267)][_0x3bc121(0x213)](_0x3bc121(0x22a)+_0x46fa10+_0x3bc121(0x264),{'body':_0x1307cc});return!_0x34e833[_0x3bc121(0x22f)]['error']||_0x34e833['body'][_0x3bc121(0x241)][_0x3bc121(0x221)]===0x1;}async[_0x210f5c(0x234)](_0x4f35b6,_0x1fdfb5,_0x2fd0cd){const _0x44617a=_0x210f5c;let _0x248752={'unitId':_0x4f35b6,'threadId':_0x2fd0cd},_0x30fd98=await this[_0x44617a(0x267)][_0x44617a(0x213)](_0x44617a(0x22a)+_0x4f35b6+_0x44617a(0x1f0),{'body':_0x248752}),_0x30ea1f=_0x2fd0cd[_0x44617a(0x233)](_0x13c28a=>_0x36d570(_0x30fd98[_0x44617a(0x22f)][_0x44617a(0x1e0)][_0x13c28a],_0x4f35b6,_0x1fdfb5))['filter'](Boolean);return Object[_0x44617a(0x250)](_0x30fd98[_0x44617a(0x22f)][_0x44617a(0x1e3)])['forEach'](_0x47d1fa=>{const _0x318f66=_0x44617a;this['_userService'][_0x318f66(0x1df)](_0x47d1fa);}),_0x30ea1f;}['saveCommentToSnapshot'](_0x1490df){const _0x3f25ed=_0x210f5c;return{'id':_0x1490df['id'],'threadId':_0x1490df['threadId'],'ref':_0x1490df[_0x3f25ed(0x1e7)]};}};_0x5b8e88=_0x3ad348([_0x4da42c(0x0,(0x0,_0x579a25['Inject'])(_0x903e43['HTTPService'])),_0x4da42c(0x1,(0x0,_0x579a25[_0x210f5c(0x1da)])(_0x579a25[_0x210f5c(0x252)])),_0x4da42c(0x2,(0x0,_0x579a25['Inject'])(_0x2e378a['CollaborationSessionService']))],_0x5b8e88);let _0x37287b=class extends _0x579a25[_0x210f5c(0x262)]{constructor(_0x1a6e53,_0x483219){const _0x7b581c=_0x210f5c;super(),this[_0x7b581c(0x1ee)]=_0x1a6e53,this['_threadCommentDataSource']=_0x483219,this['_initDataSource']();}[_0x210f5c(0x240)](){const _0xce1205=_0x210f5c;this[_0xce1205(0x1ee)][_0xce1205(0x219)]=this[_0xce1205(0x237)],this[_0xce1205(0x1ee)][_0xce1205(0x1d9)]=!0x1;}};_0x37287b=_0x3ad348([_0x4da42c(0x0,_0x132505[_0x210f5c(0x208)]),_0x4da42c(0x1,(0x0,_0x579a25[_0x210f5c(0x1da)])(_0x5b8e88))],_0x37287b);function _0x5438f8(_0x3adb41){'@babel/helpers - typeof';return _0x5438f8=typeof Symbol=='function'&&typeof Symbol['iterator']=='symbol'?function(_0x3e4609){return typeof _0x3e4609;}:function(_0x267bcb){const _0x4680aa=_0x3621;return _0x267bcb&&typeof Symbol==_0x4680aa(0x223)&&_0x267bcb[_0x4680aa(0x207)]===Symbol&&_0x267bcb!==Symbol[_0x4680aa(0x1d7)]?_0x4680aa(0x1fc):typeof _0x267bcb;},_0x5438f8(_0x3adb41);}function _0x5e3403(_0x37acd5,_0x83da8d){const _0x584a9f=_0x210f5c;if(_0x5438f8(_0x37acd5)!=_0x584a9f(0x1f2)||!_0x37acd5)return _0x37acd5;var _0x4402a1=_0x37acd5[Symbol[_0x584a9f(0x220)]];if(_0x4402a1!==void 0x0){var _0x5bd3f9=_0x4402a1['call'](_0x37acd5,_0x83da8d||_0x584a9f(0x1f1));if(_0x5438f8(_0x5bd3f9)!=_0x584a9f(0x1f2))return _0x5bd3f9;throw TypeError(_0x584a9f(0x21c));}return(_0x83da8d===_0x584a9f(0x1ec)?String:Number)(_0x37acd5);}function _0x1ed14d(_0x217d8c){var _0xb378c7=_0x5e3403(_0x217d8c,'string');return _0x5438f8(_0xb378c7)=='symbol'?_0xb378c7:_0xb378c7+'';}function _0xc6ec92(_0x5dce89,_0x393249,_0x22f6f8){const _0x141871=_0x210f5c;return(_0x393249=_0x1ed14d(_0x393249))in _0x5dce89?Object[_0x141871(0x20b)](_0x5dce89,_0x393249,{'value':_0x22f6f8,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x5dce89[_0x393249]=_0x22f6f8,_0x5dce89;}let _0x8f8dc4=class extends _0x579a25[_0x210f5c(0x268)]{constructor(_0x3e338b=_0x538f41,_0xc41399,_0x1a6d3d){const _0x390b77=_0x210f5c;super(),this['_config']=_0x3e338b,this[_0x390b77(0x239)]=_0xc41399,this[_0x390b77(0x23c)]=_0x1a6d3d;let {..._0xcfc99}=(0x0,_0x579a25[_0x390b77(0x21d)])({},_0x538f41,this[_0x390b77(0x1f5)]);this[_0x390b77(0x23c)][_0x390b77(0x204)](_0x390b77(0x236),_0xcfc99);}[_0x210f5c(0x255)](){const _0x14841e=_0x210f5c;[[_0x5b8e88],[_0x37287b],[_0x4399f3]][_0x14841e(0x1e6)](_0x5c5797=>{const _0x10b340=_0x14841e;this['_injector'][_0x10b340(0x1db)](_0x5c5797);});}['onReady'](){const _0x1d5353=_0x210f5c;this[_0x1d5353(0x239)][_0x1d5353(0x260)](_0x37287b),this['_injector']['get'](_0x4399f3);}};_0xc6ec92(_0x8f8dc4,_0x210f5c(0x228),_0x210f5c(0x1e4)),_0xc6ec92(_0x8f8dc4,_0x210f5c(0x214),_0x20eeeb),_0xc6ec92(_0x8f8dc4,_0x210f5c(0x246),_0x24c283),_0x8f8dc4=_0x3ad348([(0x0,_0x579a25['DependentOn'])(_0x3a4fb4[_0x210f5c(0x23e)],_0x2e378a[_0x210f5c(0x218)],_0x35c489[_0x210f5c(0x1fa)]),_0x4da42c(0x1,(0x0,_0x579a25['Inject'])(_0x579a25[_0x210f5c(0x20a)])),_0x4da42c(0x2,_0x579a25[_0x210f5c(0x1e9)])],_0x8f8dc4),Object[_0x210f5c(0x20b)](_0x12a69f,_0x210f5c(0x1f8),{'enumerable':!0x0,'get':function(){return _0x8f8dc4;}});}));function _0x1bc0(){const _0x3fc571=['/add','parse','addComment','version','filter','solved','UniverProThreadCommentDatasource','content','customRanges','_sessionService','Solve','getComment','@univerjs/core','values','105276SQjnDl','UserManagerService','UniverThreadCommentUi','/solved','onStarting','_userService','COMMENT','21288DJLVot','comment','UniverProCollaborationClient','4170rJTitQ','requireSession','createTimestamp','UniverThreadComment','@univerjs/network','get','userId','Disposable','/universer-api/user/list','/delete','Reply','format','_httpService','Plugin','CustomRangeType','prototype','amd','syncUpdateMutationToColla','Inject','add','toStringTag','rangeId','threadId','addUser','comments','_threadCommentModel','bufferTime','users','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','10IsGvMb','forEach','ref','userID','IConfigService','disposeWithMe','root','string','UniverNetwork','_threadCommentDataSourceService','length','/list','default','object','type','getOwnPropertyDescriptor','_config','find','getUnit','UniverThreadCommentDataSourcePlugin','replyId','UniverLicensePlugin','182mMBOIT','symbol','YYYY/MM/DD\x20HH:mm','subscribe','CommentService','slice','Add','6iMSjMk','/edit','setConfig','UniverCore','@univerjs-pro/thread-comment-datasource','constructor','IThreadCommentDataSourceService','CommentUpdateEventType','Injector','defineProperty','Edit','822124rBZVoc','user','@univerjs/protocol','HTTPService','UniverProLicense','rxjs','post','packageName','OpenOrReOpen','size','_commentService','UniverCollaborationClientPlugin','dataSource','personId','exports','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','merge','Solved','1899SxBIYs','toPrimitive','code','@univerjs-pro/license','function','@univerjs/thread-comment-ui','98545tSvGSh','ThreadCommentModel','1445584pwljTd','pluginName','rangeType','/universer-api/comment/unit/','resolved','replies','CommentSolvedStatus','decorate','body','commentUpdate$','dateKit','getMemberID','map','listComments','getUser','thread-comment-data-source.config','_threadCommentDataSource','@univerjs-pro/collaboration-client','_injector','_init','parentId','_configService','stringify','UniverThreadCommentUIPlugin','_initUserSync','_initDataSource','error','delete'];_0x1bc0=function(){return _0x3fc571;};return _0x1bc0();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
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-alpha.
|
|
55
|
-
"@univerjs
|
|
56
|
-
"@univerjs/
|
|
57
|
-
"@univerjs/
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/
|
|
54
|
+
"@univerjs-pro/collaboration-client": "1.0.0-alpha.3",
|
|
55
|
+
"@univerjs/core": "1.0.0-alpha.3",
|
|
56
|
+
"@univerjs/protocol": "1.0.0-alpha.3",
|
|
57
|
+
"@univerjs/thread-comment-ui": "1.0.0-alpha.3",
|
|
58
|
+
"@univerjs/thread-comment": "1.0.0-alpha.3",
|
|
59
|
+
"@univerjs/network": "1.0.0-alpha.3",
|
|
60
|
+
"@univerjs-pro/license": "1.0.0-alpha.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"rxjs": "7.8.2",
|
|
64
64
|
"typescript": "^6.0.3",
|
|
65
|
-
"vitest": "^4.1.
|
|
66
|
-
"@univerjs-infra/shared": "1.0.0-alpha.
|
|
65
|
+
"vitest": "^4.1.10",
|
|
66
|
+
"@univerjs-infra/shared": "1.0.0-alpha.3"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"test": "vitest run",
|