@univerjs-pro/thread-comment-datasource 0.7.0-nightly.202505111606 → 0.7.0-nightly.202505121607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x289b(_0xdef441,_0x5c452b){const _0x536247=_0x5362();return _0x289b=function(_0x289b50,_0x3dbebd){_0x289b50=_0x289b50-0x9e;let _0x5e1721=_0x536247[_0x289b50];return _0x5e1721;},_0x289b(_0xdef441,_0x5c452b);}const _0x4ae273=_0x289b;(function(_0x40e0d5,_0x31b299){const _0x156586=_0x289b,_0x16ff4a=_0x40e0d5();while(!![]){try{const _0x44f9ec=-parseInt(_0x156586(0xf2))/0x1*(-parseInt(_0x156586(0xf8))/0x2)+parseInt(_0x156586(0xdc))/0x3+-parseInt(_0x156586(0x101))/0x4+parseInt(_0x156586(0xe2))/0x5*(parseInt(_0x156586(0xe3))/0x6)+-parseInt(_0x156586(0x103))/0x7*(-parseInt(_0x156586(0xd1))/0x8)+parseInt(_0x156586(0xe9))/0x9+-parseInt(_0x156586(0xe5))/0xa;if(_0x44f9ec===_0x31b299)break;else _0x16ff4a['push'](_0x16ff4a['shift']());}catch(_0x412dae){_0x16ff4a['push'](_0x16ff4a['shift']());}}}(_0x5362,0x1e98f));Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0x4ae273(0xa1)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require(_0x4ae273(0x106)),j=require(_0x4ae273(0xa3)),M=require(_0x4ae273(0xc9)),w=require(_0x4ae273(0xb0)),P=require('@univerjs/network'),U=_0x4ae273(0xa7);var I=(_0x14366c=>(_0x14366c[_0x14366c[_0x4ae273(0x109)]=0x0]='OpenOrReOpen',_0x14366c[_0x14366c[_0x4ae273(0xd5)]=0x1]=_0x4ae273(0xd5),_0x14366c[_0x14366c['UNRECOGNIZED']=-0x1]=_0x4ae273(0x10b),_0x14366c))(I||{}),v=(_0x47bd2e=>(_0x47bd2e[_0x47bd2e[_0x4ae273(0xf6)]=0x0]='Unknown',_0x47bd2e[_0x47bd2e[_0x4ae273(0xeb)]=0x1]=_0x4ae273(0xeb),_0x47bd2e[_0x47bd2e[_0x4ae273(0x10a)]=0x2]=_0x4ae273(0x10a),_0x47bd2e[_0x47bd2e[_0x4ae273(0xd9)]=0x3]=_0x4ae273(0xd9),_0x47bd2e[_0x47bd2e[_0x4ae273(0x105)]=0x4]=_0x4ae273(0x105),_0x47bd2e[_0x47bd2e[_0x4ae273(0xe7)]=0x5]=_0x4ae273(0xe7),_0x47bd2e[_0x47bd2e[_0x4ae273(0x10b)]=-0x1]='UNRECOGNIZED',_0x47bd2e))(v||{});const f=_0x3d7cd3=>c[_0x4ae273(0xf7)](new Date(+_0x3d7cd3))[_0x4ae273(0xe6)](_0x4ae273(0x10d)),R=async(_0x14d822,_0x4efd3f)=>{const _0x303ef8=_0x4ae273,_0x2bd209=_0x14d822[_0x303ef8(0xbd)](c[_0x303ef8(0xa4)]),_0x2a7e8d=_0x14d822['get'](P[_0x303ef8(0xd0)]);_0x4efd3f[_0x303ef8(0xbc)](_0x22af8d=>{const _0x398a0b=_0x303ef8;_0x2bd209[_0x398a0b(0xba)](_0x22af8d)&&_0x4efd3f['delete'](_0x22af8d);}),_0x4efd3f[_0x303ef8(0xff)]&&(await _0x2a7e8d[_0x303ef8(0xbd)](_0x303ef8(0xb4),{'params':{'userIDs':[..._0x4efd3f]}}))[_0x303ef8(0xaa)][_0x303ef8(0xb7)][_0x303ef8(0xbc)](_0x3413eb=>{const _0x1451e9=_0x303ef8;_0x3413eb&&_0x2bd209[_0x1451e9(0x108)](_0x3413eb);});};var $=Object[_0x4ae273(0x9e)],E=(_0x3b3def,_0x162768,_0x372acc,_0x120bb4)=>{for(var _0x11bec5=_0x120bb4>0x1?void 0x0:_0x120bb4?$(_0x162768,_0x372acc):_0x162768,_0x58e9e0=_0x3b3def['length']-0x1,_0xa1d518;_0x58e9e0>=0x0;_0x58e9e0--)(_0xa1d518=_0x3b3def[_0x58e9e0])&&(_0x11bec5=_0xa1d518(_0x11bec5)||_0x11bec5);return _0x11bec5;},S=(_0x4cc93f,_0x5a8fcd)=>(_0x320472,_0x4dfdf9)=>_0x5a8fcd(_0x320472,_0x4dfdf9,_0x4cc93f);let p=class extends c['Disposable']{constructor(_0x5b966c,_0xbc726c,_0x17e5ab,_0x4e225b){const _0x2e1c1d=_0x4ae273;super(),this['_commentService']=_0x5b966c,this['_threadCommentModel']=_0xbc726c,this[_0x2e1c1d(0xef)]=_0x17e5ab,this[_0x2e1c1d(0xda)]=_0x4e225b,this[_0x2e1c1d(0x100)](),this[_0x2e1c1d(0x10c)]();}[_0x4ae273(0x10c)](){const _0x349348=_0x4ae273;this['disposeWithMe'](this[_0x349348(0xee)]['commentUpdate$']['pipe'](w[_0x349348(0x113)](0x10))[_0x349348(0x10e)](_0x4520d4=>{const _0x53da15=_0x349348,_0x5cd53b=new Set();_0x4520d4['forEach'](_0xcc70a5=>{const _0xed8d0f=_0x289b;switch(_0xcc70a5[_0xed8d0f(0xcc)]){case _0xed8d0f(0xdb):{const _0x1503bd=_0xcc70a5[_0xed8d0f(0xf4)][_0xed8d0f(0xb3)];_0x5cd53b[_0xed8d0f(0xdb)](_0x1503bd);break;}}}),R(this[_0x53da15(0xda)],_0x5cd53b);}));}[_0x4ae273(0x100)](){const _0x461ee1=_0x4ae273;this[_0x461ee1(0xd7)](this[_0x461ee1(0x115)]['commentUpdate$'][_0x461ee1(0x10e)](async _0x57a8a1=>{const _0x3d86cf=_0x461ee1;var _0x57cd02,_0x3da038,_0x359928,_0x39ddb7;const _0x47ce09=(_0x57cd02=this[_0x3d86cf(0xee)]['getUnit'](_0x57a8a1[_0x3d86cf(0xfc)])[_0x3d86cf(0xf0)](_0x3351f6=>_0x3351f6[_0x3d86cf(0xb9)]===_0x57a8a1['threadId']))==null?void 0x0:_0x57cd02[_0x3d86cf(0xa5)];if(!_0x47ce09)return;const {unitId:_0x287414,subUnitId:_0x17135a}=_0x47ce09;switch(_0x57a8a1[_0x3d86cf(0x111)]&&this[_0x3d86cf(0xef)][_0x3d86cf(0x108)](_0x57a8a1[_0x3d86cf(0x111)]),_0x57a8a1[_0x3d86cf(0xcc)]){case v[_0x3d86cf(0xeb)]:break;case v[_0x3d86cf(0x10a)]:{this[_0x3d86cf(0xee)][_0x3d86cf(0xfa)](_0x287414,_0x17135a,{'unitId':_0x287414,'subUnitId':_0x17135a,'ref':'','id':_0x57a8a1[_0x3d86cf(0xad)],'dT':f(+_0x57a8a1['createTimestamp']),'threadId':_0x57a8a1[_0x3d86cf(0xb9)],'personId':(_0x359928=(_0x3da038=_0x57a8a1[_0x3d86cf(0x111)])==null?void 0x0:_0x3da038['userID'])!=null?_0x359928:_0x57a8a1['userId'],'text':JSON[_0x3d86cf(0xea)](_0x57a8a1[_0x3d86cf(0xc1)]),'parentId':_0x47ce09['id']});break;}case v[_0x3d86cf(0x105)]:{const _0x163684=this[_0x3d86cf(0xee)]['getComment'](_0x287414,_0x17135a,_0x57a8a1[_0x3d86cf(0xad)]);_0x163684&&_0x163684['parentId']&&this[_0x3d86cf(0xee)]['deleteComment'](_0x287414,_0x17135a,_0x57a8a1[_0x3d86cf(0xad)]);break;}case v['Edit']:{this[_0x3d86cf(0xee)][_0x3d86cf(0xa2)](_0x287414,_0x17135a,{'commentId':_0x57a8a1[_0x3d86cf(0xad)],'text':JSON[_0x3d86cf(0xea)](_0x57a8a1[_0x3d86cf(0xc1)])});break;}case v[_0x3d86cf(0xe7)]:{const _0x260cc1=(_0x39ddb7=this['_threadCommentModel'][_0x3d86cf(0xfb)](_0x57a8a1[_0x3d86cf(0xfc)])['find'](_0x2fab45=>_0x2fab45['threadId']===_0x57a8a1[_0x3d86cf(0xb9)]))==null?void 0x0:_0x39ddb7[_0x3d86cf(0xa5)];_0x260cc1&&this[_0x3d86cf(0xee)][_0x3d86cf(0xbb)](_0x287414,_0x17135a,_0x260cc1['id'],_0x57a8a1[_0x3d86cf(0xf3)]===I[_0x3d86cf(0xd5)]);break;}}}));}};p=E([S(0x0,c[_0x4ae273(0xd4)](b['CommentService'])),S(0x1,c[_0x4ae273(0xd4)](M[_0x4ae273(0xc3)])),S(0x2,c['Inject'](c[_0x4ae273(0xa4)])),S(0x3,c[_0x4ae273(0xd4)](c[_0x4ae273(0xd2)]))],p);const q='thread-comment-data-source.config',D={};var A=Object[_0x4ae273(0x9e)],x=(_0x557b62,_0x4bb138,_0x3048f9,_0x30a09a)=>{const _0x3b5526=_0x4ae273;for(var _0x4fb52a=_0x30a09a>0x1?void 0x0:_0x30a09a?A(_0x4bb138,_0x3048f9):_0x4bb138,_0x5d35dd=_0x557b62[_0x3b5526(0xf1)]-0x1,_0x4ee223;_0x5d35dd>=0x0;_0x5d35dd--)(_0x4ee223=_0x557b62[_0x5d35dd])&&(_0x4fb52a=_0x4ee223(_0x4fb52a)||_0x4fb52a);return _0x4fb52a;},_=(_0x3f2c5a,_0x339fa4)=>(_0x562bc1,_0x4b6035)=>_0x339fa4(_0x562bc1,_0x4b6035,_0x3f2c5a);function Y(_0x599be2,_0x3d591c){const _0x517ab9=_0x4ae273,_0x32bafc=_0x599be2[_0x517ab9(0xd3)][0x0];return{..._0x3d591c,'id':_0x32bafc[_0x517ab9(0xad)],'resolved':_0x599be2[_0x517ab9(0xf3)]===0x1,'dT':f(_0x32bafc[_0x517ab9(0x114)]),'personId':_0x32bafc['userId'],'threadId':_0x32bafc[_0x517ab9(0xb9)]};}function G(_0x2eef40,_0x316c3d,_0xf244a7){const _0x6d9f25=_0x4ae273;var _0x39664e,_0xb6c3b2;if(((_0xb6c3b2=(_0x39664e=_0x2eef40==null?void 0x0:_0x2eef40['replies'])==null?void 0x0:_0x39664e[_0x6d9f25(0xf1)])!=null?_0xb6c3b2:0x0)>0x0){const _0x42cd59=(_0xee327,_0x1219e6)=>({'id':_0xee327[_0x6d9f25(0xad)],'threadId':_0xee327[_0x6d9f25(0xb9)],'dT':f(_0xee327[_0x6d9f25(0x114)]),'personId':_0xee327[_0x6d9f25(0xc5)],'resolved':_0x2eef40[_0x6d9f25(0xf3)]===I[_0x6d9f25(0xd5)],'unitId':_0x316c3d,'subUnitId':_0xf244a7,'text':JSON['parse'](_0xee327[_0x6d9f25(0xc1)]),'parentId':_0x1219e6}),_0x193094=_0x42cd59(_0x2eef40[_0x6d9f25(0xd3)][0x0]);return{..._0x193094,'children':_0x2eef40[_0x6d9f25(0xd3)][_0x6d9f25(0xec)](0x1)[_0x6d9f25(0xb8)](_0x24c438=>_0x42cd59(_0x24c438,_0x193094['id']))};}return null;}let g=class{constructor(_0x2086de,_0x6b104e,_0x563a4e,_0x36fa48){const _0x4bd995=_0x4ae273;this[_0x4bd995(0xb1)]=_0x2086de,this[_0x4bd995(0xef)]=_0x6b104e,this[_0x4bd995(0xde)]=_0x563a4e,this[_0x4bd995(0xda)]=_0x36fa48;}async['addComment'](_0x5b007b){const _0x587902=_0x4ae273;var _0x5e86f3,_0x18ea34;const {parentId:_0x1e51f3,unitId:_0x42e85b,text:_0x2daa9d,threadId:_0x5aafa4}=_0x5b007b,_0x424365=(_0x18ea34=(_0x5e86f3=_0x2daa9d[_0x587902(0xa0)])==null?void 0x0:_0x5e86f3['filter'](_0x57d348=>_0x57d348[_0x587902(0xbf)]===c[_0x587902(0xe8)]['COMMENT'])[_0x587902(0xb8)](_0x19e3d1=>_0x19e3d1['rangeId']))!=null?_0x18ea34:[],_0x37f82d=JSON[_0x587902(0xce)](_0x2daa9d),_0xf70449=(await this[_0x587902(0xde)][_0x587902(0xcf)](_0x42e85b))['getMemberID']();if(_0x1e51f3){const _0x54ce1f={'memberId':_0xf70449,'unitId':_0x42e85b,'content':_0x37f82d,'mention':_0x424365,'threadId':_0x5aafa4},_0x1107ab=(await this['_httpService'][_0x587902(0x102)](_0x587902(0xe1)+_0x42e85b+_0x587902(0xb5),{'body':_0x54ce1f}))[_0x587902(0xaa)]['reply'];return{..._0x5b007b,'id':_0x1107ab[_0x587902(0xad)],'dT':c['dayjs'](+_0x1107ab[_0x587902(0x114)])['format'](_0x587902(0x10d)),'personId':_0x1107ab['userId']};}else{const _0x1278a9={'memberId':_0xf70449,'unitId':_0x42e85b,'content':_0x37f82d,'mention':_0x424365},_0x12f60d=await this['_httpService'][_0x587902(0x102)](_0x587902(0xe1)+_0x42e85b+_0x587902(0xc6),{'body':_0x1278a9});return Y(_0x12f60d[_0x587902(0xaa)]['comment'],_0x5b007b);}}async['updateComment'](_0x443ace){const _0x553436=_0x4ae273;var _0x322648,_0x356f58;const {text:_0x435409,unitId:_0x432ce8}=_0x443ace,_0x14d13d=(_0x356f58=(_0x322648=_0x435409[_0x553436(0xa0)])==null?void 0x0:_0x322648['filter'](_0x365578=>_0x365578[_0x553436(0xbf)]===c[_0x553436(0xe8)]['COMMENT'])[_0x553436(0xb8)](_0x1cd0cd=>_0x1cd0cd[_0x553436(0xaf)]))!=null?_0x356f58:[],_0x27c085=JSON[_0x553436(0xce)](_0x435409),_0x1c57c7=_0x443ace[_0x553436(0xb9)],_0x105e15=_0x443ace['id'],_0x3c24f2={'memberId':(await this[_0x553436(0xde)]['requireSession'](_0x432ce8))[_0x553436(0xab)](),'unitId':_0x432ce8,'threadId':_0x1c57c7,'mention':_0x14d13d,'content':_0x27c085,'replyId':_0x105e15},_0x5f3a9e=await this[_0x553436(0xb1)]['post'](_0x553436(0xe1)+_0x432ce8+_0x553436(0xfe),{'body':_0x3c24f2});return!_0x5f3a9e['body'][_0x553436(0xcd)]||_0x5f3a9e[_0x553436(0xaa)][_0x553436(0xcd)][_0x553436(0xca)]===0x1;}async[_0x4ae273(0xbb)](_0x5a5145){const _0x1735f5=_0x4ae273,{unitId:_0x175ff9}=_0x5a5145,_0x5e6672=_0x5a5145[_0x1735f5(0xb9)],_0xc1d84f={'memberId':this[_0x1735f5(0xef)]['getCurrentUser']()[_0x1735f5(0xf5)],'unitId':_0x175ff9,'threadId':_0x5e6672,'solved':_0x5a5145[_0x1735f5(0xc4)]?I['Solved']:I[_0x1735f5(0x109)]},_0x4abd92=await this[_0x1735f5(0xb1)][_0x1735f5(0x102)](_0x1735f5(0xe1)+_0x175ff9+'/solved',{'body':_0xc1d84f});return!_0x4abd92[_0x1735f5(0xaa)][_0x1735f5(0xcd)]||_0x4abd92[_0x1735f5(0xaa)][_0x1735f5(0xcd)][_0x1735f5(0xca)]===0x1;}async[_0x4ae273(0xc0)](_0x1fea3a,_0x49b0a0,_0x42822f,_0x472fb3){const _0x2c59d6=_0x4ae273,_0x3edafd={'memberId':(await this[_0x2c59d6(0xde)][_0x2c59d6(0xcf)](_0x1fea3a))[_0x2c59d6(0xab)](),'threadId':_0x42822f,'replyId':_0x472fb3,'unitId':_0x1fea3a},_0x2838ce=await this['_httpService']['post'](_0x2c59d6(0xe1)+_0x1fea3a+_0x2c59d6(0x10f),{'body':_0x3edafd});return!_0x2838ce[_0x2c59d6(0xaa)][_0x2c59d6(0xcd)]||_0x2838ce[_0x2c59d6(0xaa)][_0x2c59d6(0xcd)][_0x2c59d6(0xca)]===0x1;}async[_0x4ae273(0xb2)](_0x1999ec,_0x23cca6,_0x48d901){const _0x3cbb66=_0x4ae273,_0x2e0c4d={'unitId':_0x1999ec,'threadId':_0x48d901},_0x329240=await this[_0x3cbb66(0xb1)][_0x3cbb66(0x102)]('/universer-api/comment/unit/'+_0x1999ec+'/list',{'body':_0x2e0c4d}),_0xd05bb4=_0x48d901[_0x3cbb66(0xb8)](_0x36f14e=>G(_0x329240[_0x3cbb66(0xaa)]['comments'][_0x36f14e],_0x1999ec,_0x23cca6))[_0x3cbb66(0xdd)](Boolean);return Object[_0x3cbb66(0xac)](_0x329240[_0x3cbb66(0xaa)]['users'])[_0x3cbb66(0xbc)](_0x2d1d98=>{const _0x28d078=_0x3cbb66;this[_0x28d078(0xef)]['addUser'](_0x2d1d98);}),_0xd05bb4;}[_0x4ae273(0xc7)](_0x326a1a){const _0x2e52f9=_0x4ae273;return{'id':_0x326a1a['id'],'threadId':_0x326a1a[_0x2e52f9(0xb9)],'ref':_0x326a1a[_0x2e52f9(0xf9)]};}};g=x([_(0x0,c[_0x4ae273(0xd4)](P[_0x4ae273(0xd0)])),_(0x1,c[_0x4ae273(0xd4)](c[_0x4ae273(0xa4)])),_(0x2,c['Inject'](b[_0x4ae273(0xa6)])),_(0x3,c[_0x4ae273(0xd4)](c[_0x4ae273(0xd2)]))],g);var H=Object[_0x4ae273(0x9e)],J=(_0x11affa,_0x319600,_0x56da34,_0x7e95cf)=>{for(var _0x4e4b13=_0x7e95cf>0x1?void 0x0:_0x7e95cf?H(_0x319600,_0x56da34):_0x319600,_0x5a2cdb=_0x11affa['length']-0x1,_0x7ec729;_0x5a2cdb>=0x0;_0x5a2cdb--)(_0x7ec729=_0x11affa[_0x5a2cdb])&&(_0x4e4b13=_0x7ec729(_0x4e4b13)||_0x4e4b13);return _0x4e4b13;},y=(_0x41dc77,_0x1d646a)=>(_0x3cad87,_0x22b838)=>_0x1d646a(_0x3cad87,_0x22b838,_0x41dc77);let C=class extends c[_0x4ae273(0xa8)]{constructor(_0x296d7e,_0x142f85){const _0x159b04=_0x4ae273;super(),this[_0x159b04(0x9f)]=_0x296d7e,this['_threadCommentDataSource']=_0x142f85,this['_initDataSource']();}[_0x4ae273(0x112)](){const _0x376b59=_0x4ae273;this[_0x376b59(0x9f)][_0x376b59(0xae)]=this[_0x376b59(0xcb)],this[_0x376b59(0x9f)]['syncUpdateMutationToColla']=!0x1;}};C=J([y(0x0,M[_0x4ae273(0x110)]),y(0x1,c['Inject'](g))],C);var F=Object['defineProperty'],L=Object['getOwnPropertyDescriptor'],Z=(_0x1acbc4,_0x229cd3,_0xe77459)=>_0x229cd3 in _0x1acbc4?F(_0x1acbc4,_0x229cd3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xe77459}):_0x1acbc4[_0x229cd3]=_0xe77459,W=(_0x374bb6,_0x2599d6,_0x8e2233,_0x41a544)=>{const _0x1d1ada=_0x4ae273;for(var _0x2207d2=_0x41a544>0x1?void 0x0:_0x41a544?L(_0x2599d6,_0x8e2233):_0x2599d6,_0x58f111=_0x374bb6[_0x1d1ada(0xf1)]-0x1,_0x2adbfa;_0x58f111>=0x0;_0x58f111--)(_0x2adbfa=_0x374bb6[_0x58f111])&&(_0x2207d2=_0x2adbfa(_0x2207d2)||_0x2207d2);return _0x2207d2;},O=(_0xf7647b,_0x41af70)=>(_0x3c0eb0,_0x4d7767)=>_0x41af70(_0x3c0eb0,_0x4d7767,_0xf7647b),N=(_0x5a611c,_0x370a00,_0x188303)=>Z(_0x5a611c,typeof _0x370a00!=_0x4ae273(0xc8)?_0x370a00+'':_0x370a00,_0x188303);function _0x5362(){const _0x3fe95b=['dataSource','rangeId','rxjs','_httpService','listComments','personId','/universer-api/user/list','/reply','UNIVER_UNKNOWN','users','map','threadId','getUser','resolveComment','forEach','get','_configService','rangeType','deleteComment','content','setConfig','ThreadCommentModel','resolved','userId','/add','saveCommentToSnapshot','symbol','@univerjs/thread-comment','code','_threadCommentDataSource','type','error','stringify','requireSession','HTTPService','177736QKiIJD','Injector','replies','Inject','Solved','_config','disposeWithMe','UniverThreadCommentUIPlugin','Edit','_injector','add','743034nsfklO','filter','_sessionService','UniverCollaborationClientPlugin','merge','/universer-api/comment/unit/','10JyIgnE','416328nQhHXD','DependentOn','6823580Febkeo','format','Solve','CustomRangeType','2181834RlBCQl','parse','Add','slice','onStarting','_threadCommentModel','_userService','find','length','1HSXRNy','solved','payload','userID','Unknown','dayjs','350722OLpUpx','ref','addComment','getUnit','unitId','UniverThreadCommentDataSourcePlugin','/edit','size','_init','252828hMPtMt','post','21mVqokA','UniverLicensePlugin','Delete','@univerjs/core','onReady','addUser','OpenOrReOpen','Reply','UNRECOGNIZED','_initUserSync','YYYY/MM/DD\x20HH:mm','subscribe','/delete','IThreadCommentDataSourceService','user','_initDataSource','bufferTime','createTimestamp','_commentService','getOwnPropertyDescriptor','_threadCommentDataSourceService','customRanges','Module','updateComment','@univerjs/thread-comment-ui','UserManagerService','root','CollaborationSessionService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Disposable','Plugin','body','getMemberID','values','replyId'];_0x5362=function(){return _0x3fe95b;};return _0x5362();}exports['UniverThreadCommentDataSourcePlugin']=class extends c[_0x4ae273(0xa9)]{constructor(_0x44ca0e=D,_0x2baa3f,_0x2e18f9){const _0x2c7611=_0x4ae273;super(),this[_0x2c7611(0xd6)]=_0x44ca0e,this['_injector']=_0x2baa3f,this[_0x2c7611(0xbe)]=_0x2e18f9;const {..._0x747ce5}=c[_0x2c7611(0xe0)]({},D,this[_0x2c7611(0xd6)]);this[_0x2c7611(0xbe)][_0x2c7611(0xc2)](q,_0x747ce5);}[_0x4ae273(0xed)](){const _0x51e99c=_0x4ae273;[[g],[C],[p]][_0x51e99c(0xbc)](_0x1859cc=>{const _0x3da4dc=_0x51e99c;this[_0x3da4dc(0xda)][_0x3da4dc(0xdb)](_0x1859cc);});}[_0x4ae273(0x107)](){const _0x16827e=_0x4ae273;this[_0x16827e(0xda)][_0x16827e(0xbd)](C),this[_0x16827e(0xda)][_0x16827e(0xbd)](p);}},N(exports[_0x4ae273(0xfd)],'pluginName',U),N(exports['UniverThreadCommentDataSourcePlugin'],_0x4ae273(0xcc),c['UniverInstanceType'][_0x4ae273(0xb6)]),exports[_0x4ae273(0xfd)]=W([c[_0x4ae273(0xe4)](j[_0x4ae273(0xd8)],b[_0x4ae273(0xdf)],T[_0x4ae273(0x104)]),O(0x1,c[_0x4ae273(0xd4)](c[_0x4ae273(0xd2)])),O(0x2,c['IConfigService'])],exports[_0x4ae273(0xfd)]);
|
|
1
|
+
'use strict';const _0x1a1030=_0x428a;(function(_0x1ef0fe,_0x546022){const _0x5a031c=_0x428a,_0x50d066=_0x1ef0fe();while(!![]){try{const _0x5f0265=parseInt(_0x5a031c(0x11a))/0x1+-parseInt(_0x5a031c(0x189))/0x2*(parseInt(_0x5a031c(0x161))/0x3)+-parseInt(_0x5a031c(0x17a))/0x4+parseInt(_0x5a031c(0x158))/0x5*(parseInt(_0x5a031c(0x15c))/0x6)+parseInt(_0x5a031c(0x16f))/0x7+parseInt(_0x5a031c(0x125))/0x8+-parseInt(_0x5a031c(0x176))/0x9;if(_0x5f0265===_0x546022)break;else _0x50d066['push'](_0x50d066['shift']());}catch(_0x822738){_0x50d066['push'](_0x50d066['shift']());}}}(_0x4fc6,0x39efd));Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0x1a1030(0x152)});function _0x4fc6(){const _0x1a853a=['679848rgcKSO','customRanges','updateComment','@univerjs/thread-comment-ui','replyId','/add','UniverLicensePlugin','symbol','comments','Edit','Plugin','/list','_httpService','@univerjs-pro/license','map','333786njOtsi','users','/universer-api/comment/unit/','_commentService','/reply','YYYY/MM/DD\x20HH:mm','Inject','UniverCollaborationClientPlugin','setConfig','Add','personId','deleteComment','commentUpdate$','CommentService','223077NYzbaf','/delete','getCurrentUser','dataSource','_init','IThreadCommentDataSourceService','delete','length','CustomRangeType','UniverThreadCommentDataSourcePlugin','/solved','1789528XErIci','_initUserSync','post','_sessionService','merge','Reply','getUser','getUnit','getMemberID','body','/edit','payload','UserManagerService','UNIVER_UNKNOWN','onStarting','size','onReady','userId','user','add','_initDataSource','rangeId','userID','COMMENT','CollaborationSessionService','stringify','UNRECOGNIZED','_userService','values','_threadCommentDataSource','parse','UniverThreadCommentUIPlugin','pluginName','Unknown','rangeType','find','parentId','OpenOrReOpen','pipe','getOwnPropertyDescriptor','threadId','get','_config','_threadCommentDataSourceService','unitId','Module','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','subscribe','_configService','_threadCommentModel','UniverInstanceType','340XyVvrS','listComments','type','slice','30462aovnMG','ThreadCommentModel','Injector','error','root','3swqxJM','format','code','content','requireSession','disposeWithMe','Solved','solved','Delete','Solve','replies','addComment','HTTPService','filter','654948PpyfRQ','Disposable','@univerjs/network','forEach','createTimestamp','thread-comment-data-source.config','syncUpdateMutationToColla','2802636LVoKaK','resolveComment','_injector','reply'];_0x4fc6=function(){return _0x1a853a;};return _0x4fc6();}const b=require('@univerjs-pro/collaboration-client'),T=require(_0x1a1030(0x187)),c=require('@univerjs/core'),j=require(_0x1a1030(0x17d)),M=require('@univerjs/thread-comment'),w=require('rxjs'),P=require(_0x1a1030(0x171)),U=_0x1a1030(0x153);function _0x428a(_0x3229ed,_0x523355){const _0x4fc6f7=_0x4fc6();return _0x428a=function(_0x428a87,_0x30704b){_0x428a87=_0x428a87-0x111;let _0x1ace59=_0x4fc6f7[_0x428a87];return _0x1ace59;},_0x428a(_0x3229ed,_0x523355);}var I=(_0xbbfb20=>(_0xbbfb20[_0xbbfb20[_0x1a1030(0x14a)]=0x0]=_0x1a1030(0x14a),_0xbbfb20[_0xbbfb20[_0x1a1030(0x167)]=0x1]=_0x1a1030(0x167),_0xbbfb20[_0xbbfb20[_0x1a1030(0x13f)]=-0x1]=_0x1a1030(0x13f),_0xbbfb20))(I||{}),v=(_0x29b682=>(_0x29b682[_0x29b682[_0x1a1030(0x146)]=0x0]=_0x1a1030(0x146),_0x29b682[_0x29b682[_0x1a1030(0x115)]=0x1]='Add',_0x29b682[_0x29b682[_0x1a1030(0x12a)]=0x2]=_0x1a1030(0x12a),_0x29b682[_0x29b682['Edit']=0x3]=_0x1a1030(0x183),_0x29b682[_0x29b682[_0x1a1030(0x169)]=0x4]=_0x1a1030(0x169),_0x29b682[_0x29b682[_0x1a1030(0x16a)]=0x5]=_0x1a1030(0x16a),_0x29b682[_0x29b682[_0x1a1030(0x13f)]=-0x1]=_0x1a1030(0x13f),_0x29b682))(v||{});const f=_0x258112=>c['dayjs'](new Date(+_0x258112))[_0x1a1030(0x162)](_0x1a1030(0x111)),R=async(_0x5e95c1,_0x51e35d)=>{const _0x155133=_0x1a1030,_0x2a068b=_0x5e95c1['get'](c[_0x155133(0x131)]),_0x22bb05=_0x5e95c1['get'](P[_0x155133(0x16d)]);_0x51e35d[_0x155133(0x172)](_0x5e5120=>{const _0x4d8740=_0x155133;_0x2a068b[_0x4d8740(0x12b)](_0x5e5120)&&_0x51e35d[_0x4d8740(0x120)](_0x5e5120);}),_0x51e35d[_0x155133(0x134)]&&(await _0x22bb05[_0x155133(0x14e)]('/universer-api/user/list',{'params':{'userIDs':[..._0x51e35d]}}))[_0x155133(0x12e)]['users'][_0x155133(0x172)](_0xbc885b=>{_0xbc885b&&_0x2a068b['addUser'](_0xbc885b);});};var $=Object[_0x1a1030(0x14c)],E=(_0x3d029f,_0x59cbab,_0x4ec347,_0x57c013)=>{const _0x211f10=_0x1a1030;for(var _0x28e789=_0x57c013>0x1?void 0x0:_0x57c013?$(_0x59cbab,_0x4ec347):_0x59cbab,_0x1227c9=_0x3d029f[_0x211f10(0x121)]-0x1,_0x285c4b;_0x1227c9>=0x0;_0x1227c9--)(_0x285c4b=_0x3d029f[_0x1227c9])&&(_0x28e789=_0x285c4b(_0x28e789)||_0x28e789);return _0x28e789;},S=(_0x1bd01e,_0x59671a)=>(_0x38565e,_0x219328)=>_0x59671a(_0x38565e,_0x219328,_0x1bd01e);let p=class extends c[_0x1a1030(0x170)]{constructor(_0x351039,_0x376ccb,_0x46c0fd,_0x366226){const _0xfa981e=_0x1a1030;super(),this[_0xfa981e(0x18c)]=_0x351039,this[_0xfa981e(0x156)]=_0x376ccb,this[_0xfa981e(0x140)]=_0x46c0fd,this[_0xfa981e(0x178)]=_0x366226,this[_0xfa981e(0x11e)](),this[_0xfa981e(0x126)]();}['_initUserSync'](){const _0x414b59=_0x1a1030;this[_0x414b59(0x166)](this[_0x414b59(0x156)][_0x414b59(0x118)][_0x414b59(0x14b)](w['bufferTime'](0x10))[_0x414b59(0x154)](_0x45272d=>{const _0x872a47=_0x414b59,_0x5c6c1f=new Set();_0x45272d[_0x872a47(0x172)](_0x5ac2fa=>{const _0x106ffd=_0x872a47;switch(_0x5ac2fa[_0x106ffd(0x15a)]){case'add':{const _0x3e0d81=_0x5ac2fa[_0x106ffd(0x130)][_0x106ffd(0x116)];_0x5c6c1f[_0x106ffd(0x138)](_0x3e0d81);break;}}}),R(this[_0x872a47(0x178)],_0x5c6c1f);}));}['_init'](){const _0x3ec11d=_0x1a1030;this[_0x3ec11d(0x166)](this[_0x3ec11d(0x18c)][_0x3ec11d(0x118)]['subscribe'](async _0x1a482d=>{const _0x49a30f=_0x3ec11d;var _0x5ecee0,_0x200137,_0x4153da,_0x5f1aa7;const _0x1c3f5e=(_0x5ecee0=this['_threadCommentModel'][_0x49a30f(0x12c)](_0x1a482d['unitId'])[_0x49a30f(0x148)](_0x5f0318=>_0x5f0318['threadId']===_0x1a482d['threadId']))==null?void 0x0:_0x5ecee0[_0x49a30f(0x160)];if(!_0x1c3f5e)return;const {unitId:_0x431db3,subUnitId:_0x5b95c0}=_0x1c3f5e;switch(_0x1a482d['user']&&this[_0x49a30f(0x140)]['addUser'](_0x1a482d['user']),_0x1a482d[_0x49a30f(0x15a)]){case v[_0x49a30f(0x115)]:break;case v[_0x49a30f(0x12a)]:{this[_0x49a30f(0x156)]['addComment'](_0x431db3,_0x5b95c0,{'unitId':_0x431db3,'subUnitId':_0x5b95c0,'ref':'','id':_0x1a482d[_0x49a30f(0x17e)],'dT':f(+_0x1a482d[_0x49a30f(0x173)]),'threadId':_0x1a482d[_0x49a30f(0x14d)],'personId':(_0x4153da=(_0x200137=_0x1a482d[_0x49a30f(0x137)])==null?void 0x0:_0x200137[_0x49a30f(0x13b)])!=null?_0x4153da:_0x1a482d['userId'],'text':JSON[_0x49a30f(0x143)](_0x1a482d[_0x49a30f(0x164)]),'parentId':_0x1c3f5e['id']});break;}case v[_0x49a30f(0x169)]:{const _0x26cb38=this[_0x49a30f(0x156)]['getComment'](_0x431db3,_0x5b95c0,_0x1a482d['replyId']);_0x26cb38&&_0x26cb38[_0x49a30f(0x149)]&&this['_threadCommentModel'][_0x49a30f(0x117)](_0x431db3,_0x5b95c0,_0x1a482d[_0x49a30f(0x17e)]);break;}case v[_0x49a30f(0x183)]:{this[_0x49a30f(0x156)][_0x49a30f(0x17c)](_0x431db3,_0x5b95c0,{'commentId':_0x1a482d[_0x49a30f(0x17e)],'text':JSON[_0x49a30f(0x143)](_0x1a482d[_0x49a30f(0x164)])});break;}case v['Solve']:{const _0x49e35a=(_0x5f1aa7=this['_threadCommentModel'][_0x49a30f(0x12c)](_0x1a482d[_0x49a30f(0x151)])[_0x49a30f(0x148)](_0x5816e6=>_0x5816e6['threadId']===_0x1a482d[_0x49a30f(0x14d)]))==null?void 0x0:_0x5f1aa7['root'];_0x49e35a&&this[_0x49a30f(0x156)][_0x49a30f(0x177)](_0x431db3,_0x5b95c0,_0x49e35a['id'],_0x1a482d['solved']===I['Solved']);break;}}}));}};p=E([S(0x0,c['Inject'](b[_0x1a1030(0x119)])),S(0x1,c[_0x1a1030(0x112)](M[_0x1a1030(0x15d)])),S(0x2,c['Inject'](c['UserManagerService'])),S(0x3,c['Inject'](c[_0x1a1030(0x15e)]))],p);const q=_0x1a1030(0x174),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x57248b,_0x319dfc,_0x4a30bc,_0x26519c)=>{const _0x113799=_0x1a1030;for(var _0x387b7f=_0x26519c>0x1?void 0x0:_0x26519c?A(_0x319dfc,_0x4a30bc):_0x319dfc,_0x466d32=_0x57248b[_0x113799(0x121)]-0x1,_0xe28a66;_0x466d32>=0x0;_0x466d32--)(_0xe28a66=_0x57248b[_0x466d32])&&(_0x387b7f=_0xe28a66(_0x387b7f)||_0x387b7f);return _0x387b7f;},_=(_0x1f5a08,_0x4fa508)=>(_0x5be2cc,_0x13125f)=>_0x4fa508(_0x5be2cc,_0x13125f,_0x1f5a08);function Y(_0xd5d793,_0x132761){const _0xa1cdad=_0x1a1030,_0x1ffcc4=_0xd5d793['replies'][0x0];return{..._0x132761,'id':_0x1ffcc4[_0xa1cdad(0x17e)],'resolved':_0xd5d793[_0xa1cdad(0x168)]===0x1,'dT':f(_0x1ffcc4[_0xa1cdad(0x173)]),'personId':_0x1ffcc4['userId'],'threadId':_0x1ffcc4[_0xa1cdad(0x14d)]};}function G(_0x2e1431,_0x3765a4,_0x3cd16f){const _0x201214=_0x1a1030;var _0x2882e4,_0x555baf;if(((_0x555baf=(_0x2882e4=_0x2e1431==null?void 0x0:_0x2e1431[_0x201214(0x16b)])==null?void 0x0:_0x2882e4[_0x201214(0x121)])!=null?_0x555baf:0x0)>0x0){const _0x445995=(_0x52db64,_0x2a6401)=>({'id':_0x52db64[_0x201214(0x17e)],'threadId':_0x52db64[_0x201214(0x14d)],'dT':f(_0x52db64[_0x201214(0x173)]),'personId':_0x52db64[_0x201214(0x136)],'resolved':_0x2e1431[_0x201214(0x168)]===I[_0x201214(0x167)],'unitId':_0x3765a4,'subUnitId':_0x3cd16f,'text':JSON[_0x201214(0x143)](_0x52db64['content']),'parentId':_0x2a6401}),_0x2bc8bd=_0x445995(_0x2e1431['replies'][0x0]);return{..._0x2bc8bd,'children':_0x2e1431[_0x201214(0x16b)][_0x201214(0x15b)](0x1)[_0x201214(0x188)](_0x54a3e0=>_0x445995(_0x54a3e0,_0x2bc8bd['id']))};}return null;}let g=class{constructor(_0x1ef6ba,_0x4d7365,_0x8f38f5,_0x596111){const _0x48454a=_0x1a1030;this[_0x48454a(0x186)]=_0x1ef6ba,this[_0x48454a(0x140)]=_0x4d7365,this[_0x48454a(0x128)]=_0x8f38f5,this[_0x48454a(0x178)]=_0x596111;}async[_0x1a1030(0x16c)](_0x32c25e){const _0x27ada3=_0x1a1030;var _0x16ced3,_0x4d98b7;const {parentId:_0x357084,unitId:_0x4e59f2,text:_0x34df88,threadId:_0x37eed2}=_0x32c25e,_0xc55285=(_0x4d98b7=(_0x16ced3=_0x34df88[_0x27ada3(0x17b)])==null?void 0x0:_0x16ced3['filter'](_0x3a1e5d=>_0x3a1e5d[_0x27ada3(0x147)]===c[_0x27ada3(0x122)][_0x27ada3(0x13c)])['map'](_0x368ae6=>_0x368ae6[_0x27ada3(0x13a)]))!=null?_0x4d98b7:[],_0x2d52be=JSON[_0x27ada3(0x13e)](_0x34df88),_0x42564d=(await this[_0x27ada3(0x128)]['requireSession'](_0x4e59f2))['getMemberID']();if(_0x357084){const _0x29500b={'memberId':_0x42564d,'unitId':_0x4e59f2,'content':_0x2d52be,'mention':_0xc55285,'threadId':_0x37eed2},_0x1a502e=(await this['_httpService'][_0x27ada3(0x127)](_0x27ada3(0x18b)+_0x4e59f2+_0x27ada3(0x18d),{'body':_0x29500b}))[_0x27ada3(0x12e)][_0x27ada3(0x179)];return{..._0x32c25e,'id':_0x1a502e['replyId'],'dT':c['dayjs'](+_0x1a502e[_0x27ada3(0x173)])[_0x27ada3(0x162)](_0x27ada3(0x111)),'personId':_0x1a502e[_0x27ada3(0x136)]};}else{const _0x5e87cd={'memberId':_0x42564d,'unitId':_0x4e59f2,'content':_0x2d52be,'mention':_0xc55285},_0x4f90d2=await this['_httpService'][_0x27ada3(0x127)](_0x27ada3(0x18b)+_0x4e59f2+_0x27ada3(0x17f),{'body':_0x5e87cd});return Y(_0x4f90d2[_0x27ada3(0x12e)]['comment'],_0x32c25e);}}async[_0x1a1030(0x17c)](_0x234d77){const _0xb8cd0e=_0x1a1030;var _0x417bd4,_0x33bbb1;const {text:_0x375892,unitId:_0x104dbd}=_0x234d77,_0x5290fc=(_0x33bbb1=(_0x417bd4=_0x375892[_0xb8cd0e(0x17b)])==null?void 0x0:_0x417bd4[_0xb8cd0e(0x16e)](_0x5bad5b=>_0x5bad5b[_0xb8cd0e(0x147)]===c[_0xb8cd0e(0x122)]['COMMENT'])[_0xb8cd0e(0x188)](_0x197585=>_0x197585[_0xb8cd0e(0x13a)]))!=null?_0x33bbb1:[],_0x287b31=JSON[_0xb8cd0e(0x13e)](_0x375892),_0x2c5d22=_0x234d77['threadId'],_0x7f6c6c=_0x234d77['id'],_0x145fca={'memberId':(await this[_0xb8cd0e(0x128)][_0xb8cd0e(0x165)](_0x104dbd))[_0xb8cd0e(0x12d)](),'unitId':_0x104dbd,'threadId':_0x2c5d22,'mention':_0x5290fc,'content':_0x287b31,'replyId':_0x7f6c6c},_0x3ab238=await this[_0xb8cd0e(0x186)]['post'](_0xb8cd0e(0x18b)+_0x104dbd+_0xb8cd0e(0x12f),{'body':_0x145fca});return!_0x3ab238[_0xb8cd0e(0x12e)]['error']||_0x3ab238[_0xb8cd0e(0x12e)]['error'][_0xb8cd0e(0x163)]===0x1;}async['resolveComment'](_0x57a4aa){const _0x3c7a32=_0x1a1030,{unitId:_0x4fb85d}=_0x57a4aa,_0x5ae9aa=_0x57a4aa[_0x3c7a32(0x14d)],_0xe8dc10={'memberId':this[_0x3c7a32(0x140)][_0x3c7a32(0x11c)]()[_0x3c7a32(0x13b)],'unitId':_0x4fb85d,'threadId':_0x5ae9aa,'solved':_0x57a4aa['resolved']?I[_0x3c7a32(0x167)]:I[_0x3c7a32(0x14a)]},_0x4146b1=await this[_0x3c7a32(0x186)][_0x3c7a32(0x127)](_0x3c7a32(0x18b)+_0x4fb85d+_0x3c7a32(0x124),{'body':_0xe8dc10});return!_0x4146b1['body']['error']||_0x4146b1[_0x3c7a32(0x12e)]['error'][_0x3c7a32(0x163)]===0x1;}async[_0x1a1030(0x117)](_0x264bb3,_0x3d5080,_0xd93d32,_0x547dde){const _0x211657=_0x1a1030,_0x35b179={'memberId':(await this[_0x211657(0x128)][_0x211657(0x165)](_0x264bb3))[_0x211657(0x12d)](),'threadId':_0xd93d32,'replyId':_0x547dde,'unitId':_0x264bb3},_0x95f292=await this[_0x211657(0x186)]['post'](_0x211657(0x18b)+_0x264bb3+_0x211657(0x11b),{'body':_0x35b179});return!_0x95f292[_0x211657(0x12e)][_0x211657(0x15f)]||_0x95f292[_0x211657(0x12e)][_0x211657(0x15f)][_0x211657(0x163)]===0x1;}async[_0x1a1030(0x159)](_0xbc48b6,_0x5dbb41,_0x57e252){const _0x3b7d74=_0x1a1030,_0xeec34={'unitId':_0xbc48b6,'threadId':_0x57e252},_0x5301ef=await this['_httpService'][_0x3b7d74(0x127)](_0x3b7d74(0x18b)+_0xbc48b6+_0x3b7d74(0x185),{'body':_0xeec34}),_0x47ebbb=_0x57e252[_0x3b7d74(0x188)](_0x4a5f4d=>G(_0x5301ef[_0x3b7d74(0x12e)][_0x3b7d74(0x182)][_0x4a5f4d],_0xbc48b6,_0x5dbb41))['filter'](Boolean);return Object[_0x3b7d74(0x141)](_0x5301ef[_0x3b7d74(0x12e)][_0x3b7d74(0x18a)])[_0x3b7d74(0x172)](_0x3be9d7=>{const _0x247a29=_0x3b7d74;this[_0x247a29(0x140)]['addUser'](_0x3be9d7);}),_0x47ebbb;}['saveCommentToSnapshot'](_0x3ac8d9){const _0x205c2b=_0x1a1030;return{'id':_0x3ac8d9['id'],'threadId':_0x3ac8d9[_0x205c2b(0x14d)],'ref':_0x3ac8d9['ref']};}};g=x([_(0x0,c[_0x1a1030(0x112)](P[_0x1a1030(0x16d)])),_(0x1,c[_0x1a1030(0x112)](c['UserManagerService'])),_(0x2,c[_0x1a1030(0x112)](b[_0x1a1030(0x13d)])),_(0x3,c[_0x1a1030(0x112)](c[_0x1a1030(0x15e)]))],g);var H=Object[_0x1a1030(0x14c)],J=(_0xf738dd,_0x1ba1ae,_0x52d6a1,_0x35dfbb)=>{const _0x5f28dd=_0x1a1030;for(var _0x57d8bc=_0x35dfbb>0x1?void 0x0:_0x35dfbb?H(_0x1ba1ae,_0x52d6a1):_0x1ba1ae,_0x39d5a8=_0xf738dd[_0x5f28dd(0x121)]-0x1,_0x212917;_0x39d5a8>=0x0;_0x39d5a8--)(_0x212917=_0xf738dd[_0x39d5a8])&&(_0x57d8bc=_0x212917(_0x57d8bc)||_0x57d8bc);return _0x57d8bc;},y=(_0x4f7cf1,_0x3358e2)=>(_0x4b00f3,_0x5e7695)=>_0x3358e2(_0x4b00f3,_0x5e7695,_0x4f7cf1);let C=class extends c[_0x1a1030(0x170)]{constructor(_0x3880cd,_0x186589){const _0x493847=_0x1a1030;super(),this['_threadCommentDataSourceService']=_0x3880cd,this[_0x493847(0x142)]=_0x186589,this[_0x493847(0x139)]();}[_0x1a1030(0x139)](){const _0x10531c=_0x1a1030;this[_0x10531c(0x150)][_0x10531c(0x11d)]=this[_0x10531c(0x142)],this[_0x10531c(0x150)][_0x10531c(0x175)]=!0x1;}};C=J([y(0x0,M[_0x1a1030(0x11f)]),y(0x1,c['Inject'](g))],C);var F=Object['defineProperty'],L=Object[_0x1a1030(0x14c)],Z=(_0x3305ca,_0x9dbaa3,_0x2953cd)=>_0x9dbaa3 in _0x3305ca?F(_0x3305ca,_0x9dbaa3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2953cd}):_0x3305ca[_0x9dbaa3]=_0x2953cd,W=(_0x3067b3,_0x3a7658,_0x4c8e95,_0x3daf97)=>{const _0x39f9c1=_0x1a1030;for(var _0x49071d=_0x3daf97>0x1?void 0x0:_0x3daf97?L(_0x3a7658,_0x4c8e95):_0x3a7658,_0x391a5a=_0x3067b3[_0x39f9c1(0x121)]-0x1,_0x323bcb;_0x391a5a>=0x0;_0x391a5a--)(_0x323bcb=_0x3067b3[_0x391a5a])&&(_0x49071d=_0x323bcb(_0x49071d)||_0x49071d);return _0x49071d;},O=(_0x4f8101,_0x73850e)=>(_0xebb4fe,_0x4921f9)=>_0x73850e(_0xebb4fe,_0x4921f9,_0x4f8101),N=(_0x2ce280,_0x5e5110,_0x5f1cf6)=>Z(_0x2ce280,typeof _0x5e5110!=_0x1a1030(0x181)?_0x5e5110+'':_0x5e5110,_0x5f1cf6);exports[_0x1a1030(0x123)]=class extends c[_0x1a1030(0x184)]{constructor(_0x479847=D,_0x4cb67b,_0x47dd66){const _0x1307d7=_0x1a1030;super(),this[_0x1307d7(0x14f)]=_0x479847,this[_0x1307d7(0x178)]=_0x4cb67b,this[_0x1307d7(0x155)]=_0x47dd66;const {..._0x2d614a}=c[_0x1307d7(0x129)]({},D,this['_config']);this[_0x1307d7(0x155)][_0x1307d7(0x114)](q,_0x2d614a);}[_0x1a1030(0x133)](){const _0x3564fd=_0x1a1030;[[g],[C],[p]][_0x3564fd(0x172)](_0x28d6b5=>{const _0x10e30d=_0x3564fd;this[_0x10e30d(0x178)][_0x10e30d(0x138)](_0x28d6b5);});}[_0x1a1030(0x135)](){const _0x10699b=_0x1a1030;this['_injector']['get'](C),this['_injector'][_0x10699b(0x14e)](p);}},N(exports[_0x1a1030(0x123)],_0x1a1030(0x145),U),N(exports[_0x1a1030(0x123)],'type',c[_0x1a1030(0x157)][_0x1a1030(0x132)]),exports['UniverThreadCommentDataSourcePlugin']=W([c['DependentOn'](j[_0x1a1030(0x144)],b[_0x1a1030(0x113)],T[_0x1a1030(0x180)]),O(0x1,c[_0x1a1030(0x112)](c['Injector'])),O(0x2,c['IConfigService'])],exports['UniverThreadCommentDataSourcePlugin']);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2069b1=_0x43de;(function(_0x380a17,_0x180abc){const _0x512c22=_0x43de,_0xf23808=_0x380a17();while(!![]){try{const _0x23b653=-parseInt(_0x512c22(0x202))/0x1*(-parseInt(_0x512c22(0x211))/0x2)+parseInt(_0x512c22(0x212))/0x3*(parseInt(_0x512c22(0x1f7))/0x4)+parseInt(_0x512c22(0x204))/0x5*(-parseInt(_0x512c22(0x235))/0x6)+-parseInt(_0x512c22(0x20f))/0x7+parseInt(_0x512c22(0x231))/0x8*(-parseInt(_0x512c22(0x1ed))/0x9)+-parseInt(_0x512c22(0x1f1))/0xa+parseInt(_0x512c22(0x249))/0xb;if(_0x23b653===_0x180abc)break;else _0xf23808['push'](_0xf23808['shift']());}catch(_0x4008b3){_0xf23808['push'](_0xf23808['shift']());}}}(_0x5a9a,0xc9b63));import{CommentService as _0x13b92b,CollaborationSessionService as _0x497b32,UniverCollaborationClientPlugin as _0x293a48}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x177d79}from'@univerjs-pro/license';import{dayjs as _0x3db8db,UserManagerService as _0x4a0daf,Inject as _0x29435d,Injector as _0x4a982a,Disposable as _0xcf5e6a,CustomRangeType as _0x20a37b,UniverInstanceType as _0x388da4,DependentOn as _0x4bdd65,IConfigService as _0x10e4b8,Plugin as _0x336457,merge as _0x29ae8d}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x40bc7d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x307483,IThreadCommentDataSourceService as _0x50d99d}from'@univerjs/thread-comment';import{bufferTime as _0x2cdc2a}from'rxjs';import{HTTPService as _0x28bbac}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2869f4=>(_0x2869f4[_0x2869f4['OpenOrReOpen']=0x0]=_0x2069b1(0x246),_0x2869f4[_0x2869f4[_0x2069b1(0x23a)]=0x1]='Solved',_0x2869f4[_0x2869f4[_0x2069b1(0x208)]=-0x1]='UNRECOGNIZED',_0x2869f4))(I||{}),v=(_0x4886b4=>(_0x4886b4[_0x4886b4[_0x2069b1(0x22a)]=0x0]=_0x2069b1(0x22a),_0x4886b4[_0x4886b4['Add']=0x1]=_0x2069b1(0x1ec),_0x4886b4[_0x4886b4[_0x2069b1(0x245)]=0x2]=_0x2069b1(0x245),_0x4886b4[_0x4886b4[_0x2069b1(0x244)]=0x3]=_0x2069b1(0x244),_0x4886b4[_0x4886b4[_0x2069b1(0x20d)]=0x4]=_0x2069b1(0x20d),_0x4886b4[_0x4886b4[_0x2069b1(0x241)]=0x5]=_0x2069b1(0x241),_0x4886b4[_0x4886b4[_0x2069b1(0x208)]=-0x1]=_0x2069b1(0x208),_0x4886b4))(v||{});const D=_0x370191=>_0x3db8db(new Date(+_0x370191))[_0x2069b1(0x210)](_0x2069b1(0x232)),B=async(_0x191f0d,_0x23776b)=>{const _0x187ad9=_0x2069b1,_0x3ecd4a=_0x191f0d[_0x187ad9(0x1f8)](_0x4a0daf),_0x478deb=_0x191f0d[_0x187ad9(0x1f8)](_0x28bbac);_0x23776b[_0x187ad9(0x206)](_0x3b836a=>{_0x3ecd4a['getUser'](_0x3b836a)&&_0x23776b['delete'](_0x3b836a);}),_0x23776b['size']&&(await _0x478deb[_0x187ad9(0x1f8)](_0x187ad9(0x1f3),{'params':{'userIDs':[..._0x23776b]}}))[_0x187ad9(0x1eb)][_0x187ad9(0x236)][_0x187ad9(0x206)](_0x2ab20f=>{const _0x28dba8=_0x187ad9;_0x2ab20f&&_0x3ecd4a[_0x28dba8(0x1fd)](_0x2ab20f);});};var K=Object[_0x2069b1(0x1f0)],V=(_0xc1efc,_0x23a962,_0x2f879a,_0x39b1b5)=>{const _0x48ea24=_0x2069b1;for(var _0x2271cc=_0x39b1b5>0x1?void 0x0:_0x39b1b5?K(_0x23a962,_0x2f879a):_0x23a962,_0x442cad=_0xc1efc[_0x48ea24(0x243)]-0x1,_0x140cdf;_0x442cad>=0x0;_0x442cad--)(_0x140cdf=_0xc1efc[_0x442cad])&&(_0x2271cc=_0x140cdf(_0x2271cc)||_0x2271cc);return _0x2271cc;},p=(_0x20cc3e,_0x213cb1)=>(_0x4562f0,_0x36ca17)=>_0x213cb1(_0x4562f0,_0x36ca17,_0x20cc3e);let S=class extends _0xcf5e6a{constructor(_0x5e4639,_0x4ad17a,_0x1df9ef,_0x43e464){const _0x592c51=_0x2069b1;super(),this[_0x592c51(0x1f2)]=_0x5e4639,this[_0x592c51(0x201)]=_0x4ad17a,this['_userService']=_0x1df9ef,this['_injector']=_0x43e464,this['_init'](),this[_0x592c51(0x217)]();}['_initUserSync'](){const _0x1bb593=_0x2069b1;this['disposeWithMe'](this[_0x1bb593(0x201)][_0x1bb593(0x21a)][_0x1bb593(0x1e6)](_0x2cdc2a(0x10))[_0x1bb593(0x242)](_0x14c196=>{const _0x5196a3=_0x1bb593,_0x1ac635=new Set();_0x14c196[_0x5196a3(0x206)](_0x5f3b47=>{const _0x8685af=_0x5196a3;switch(_0x5f3b47[_0x8685af(0x229)]){case _0x8685af(0x226):{const _0x3eb9ac=_0x5f3b47[_0x8685af(0x239)]['personId'];_0x1ac635[_0x8685af(0x226)](_0x3eb9ac);break;}}}),B(this[_0x5196a3(0x20e)],_0x1ac635);}));}['_init'](){const _0x191103=_0x2069b1;this['disposeWithMe'](this[_0x191103(0x1f2)][_0x191103(0x21a)]['subscribe'](async _0x576bff=>{const _0x54e210=_0x191103;var _0x1e86ed,_0x513627,_0x562641,_0x5c215c;const _0x3fe2bf=(_0x1e86ed=this['_threadCommentModel'][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0xc814d3=>_0xc814d3[_0x54e210(0x233)]===_0x576bff[_0x54e210(0x233)]))==null?void 0x0:_0x1e86ed[_0x54e210(0x1fb)];if(!_0x3fe2bf)return;const {unitId:_0x38e42b,subUnitId:_0x32a05e}=_0x3fe2bf;switch(_0x576bff[_0x54e210(0x22b)]&&this[_0x54e210(0x224)][_0x54e210(0x1fd)](_0x576bff['user']),_0x576bff[_0x54e210(0x229)]){case v[_0x54e210(0x1ec)]:break;case v['Reply']:{this['_threadCommentModel'][_0x54e210(0x1e8)](_0x38e42b,_0x32a05e,{'unitId':_0x38e42b,'subUnitId':_0x32a05e,'ref':'','id':_0x576bff[_0x54e210(0x23e)],'dT':D(+_0x576bff[_0x54e210(0x23c)]),'threadId':_0x576bff[_0x54e210(0x233)],'personId':(_0x562641=(_0x513627=_0x576bff[_0x54e210(0x22b)])==null?void 0x0:_0x513627[_0x54e210(0x214)])!=null?_0x562641:_0x576bff[_0x54e210(0x223)],'text':JSON[_0x54e210(0x216)](_0x576bff[_0x54e210(0x238)]),'parentId':_0x3fe2bf['id']});break;}case v[_0x54e210(0x20d)]:{const _0x15bd4d=this[_0x54e210(0x201)][_0x54e210(0x215)](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);_0x15bd4d&&_0x15bd4d[_0x54e210(0x209)]&&this[_0x54e210(0x201)]['deleteComment'](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);break;}case v[_0x54e210(0x244)]:{this[_0x54e210(0x201)][_0x54e210(0x22c)](_0x38e42b,_0x32a05e,{'commentId':_0x576bff['replyId'],'text':JSON['parse'](_0x576bff[_0x54e210(0x238)])});break;}case v['Solve']:{const _0x50c2c4=(_0x5c215c=this[_0x54e210(0x201)][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0x107d79=>_0x107d79[_0x54e210(0x233)]===_0x576bff['threadId']))==null?void 0x0:_0x5c215c[_0x54e210(0x1fb)];_0x50c2c4&&this[_0x54e210(0x201)][_0x54e210(0x1f6)](_0x38e42b,_0x32a05e,_0x50c2c4['id'],_0x576bff['solved']===I[_0x54e210(0x23a)]);break;}}}));}};function _0x5a9a(){const _0x5366f2=['commentUpdate$','replies','find','unitId','saveCommentToSnapshot','_httpService','dataSource','stringify','solved','userId','_userService','/solved','add','_configService','setConfig','type','Unknown','user','updateComment','getUnit','/edit','/reply','filter','69256DAIiqt','YYYY/MM/DD\x20HH:mm','threadId','pluginName','2082jCSCpC','users','symbol','content','payload','Solved','_threadCommentDataSource','createTimestamp','getMemberID','replyId','_sessionService','post','Solve','subscribe','length','Edit','Reply','OpenOrReOpen','rangeType','syncUpdateMutationToColla','31023069BMRycz','reply','pipe','customRanges','addComment','map','_threadCommentDataSourceService','body','Add','1629QhDmIA','onStarting','error','getOwnPropertyDescriptor','7244530jbqmzq','_commentService','/universer-api/user/list','COMMENT','values','resolveComment','36YvsnLp','get','/add','ref','root','requireSession','addUser','_config','UNIVER_UNKNOWN','comment','_threadCommentModel','424AGAVSP','listComments','10655TPPakK','rangeId','forEach','getCurrentUser','UNRECOGNIZED','parentId','code','/universer-api/comment/unit/','/delete','Delete','_injector','3187954BAQHAN','format','844drDleX','437751EsPYEn','thread-comment-data-source.config','userID','getComment','parse','_initUserSync','_initDataSource','defineProperty'];_0x5a9a=function(){return _0x5366f2;};return _0x5a9a();}function _0x43de(_0x266f57,_0xd09ba3){const _0x5a9a09=_0x5a9a();return _0x43de=function(_0x43de40,_0x5853ef){_0x43de40=_0x43de40-0x1e6;let _0x3a8bd3=_0x5a9a09[_0x43de40];return _0x3a8bd3;},_0x43de(_0x266f57,_0xd09ba3);}S=V([p(0x0,_0x29435d(_0x13b92b)),p(0x1,_0x29435d(_0x307483)),p(0x2,_0x29435d(_0x4a0daf)),p(0x3,_0x29435d(_0x4a982a))],S);const z=_0x2069b1(0x213),M={};var k=Object[_0x2069b1(0x1f0)],Q=(_0x4b650e,_0x2d1575,_0x32a1f4,_0x254d33)=>{for(var _0x4ff3c5=_0x254d33>0x1?void 0x0:_0x254d33?k(_0x2d1575,_0x32a1f4):_0x2d1575,_0xcc5436=_0x4b650e['length']-0x1,_0x3c0264;_0xcc5436>=0x0;_0xcc5436--)(_0x3c0264=_0x4b650e[_0xcc5436])&&(_0x4ff3c5=_0x3c0264(_0x4ff3c5)||_0x4ff3c5);return _0x4ff3c5;},_=(_0x2bd5f4,_0x32c032)=>(_0x28a6e4,_0x3e8e36)=>_0x32c032(_0x28a6e4,_0x3e8e36,_0x2bd5f4);function X(_0x2f4f42,_0x2b125f){const _0x51c332=_0x2069b1,_0x5056fc=_0x2f4f42[_0x51c332(0x21b)][0x0];return{..._0x2b125f,'id':_0x5056fc['replyId'],'resolved':_0x2f4f42[_0x51c332(0x222)]===0x1,'dT':D(_0x5056fc[_0x51c332(0x23c)]),'personId':_0x5056fc[_0x51c332(0x223)],'threadId':_0x5056fc[_0x51c332(0x233)]};}function ee(_0x300d9d,_0x1645fb,_0x3e6823){const _0x1e4b94=_0x2069b1;var _0x395378,_0x3d0378;if(((_0x3d0378=(_0x395378=_0x300d9d==null?void 0x0:_0x300d9d[_0x1e4b94(0x21b)])==null?void 0x0:_0x395378[_0x1e4b94(0x243)])!=null?_0x3d0378:0x0)>0x0){const _0x2be729=(_0x1fe7c3,_0x22b6aa)=>({'id':_0x1fe7c3[_0x1e4b94(0x23e)],'threadId':_0x1fe7c3['threadId'],'dT':D(_0x1fe7c3[_0x1e4b94(0x23c)]),'personId':_0x1fe7c3[_0x1e4b94(0x223)],'resolved':_0x300d9d[_0x1e4b94(0x222)]===I[_0x1e4b94(0x23a)],'unitId':_0x1645fb,'subUnitId':_0x3e6823,'text':JSON[_0x1e4b94(0x216)](_0x1fe7c3['content']),'parentId':_0x22b6aa}),_0x25549e=_0x2be729(_0x300d9d['replies'][0x0]);return{..._0x25549e,'children':_0x300d9d['replies']['slice'](0x1)[_0x1e4b94(0x1e9)](_0x42081c=>_0x2be729(_0x42081c,_0x25549e['id']))};}return null;}let f=class{constructor(_0x2973e1,_0x4c581d,_0x4112ae,_0x3c713d){const _0x4f683f=_0x2069b1;this[_0x4f683f(0x21f)]=_0x2973e1,this[_0x4f683f(0x224)]=_0x4c581d,this[_0x4f683f(0x23f)]=_0x4112ae,this['_injector']=_0x3c713d;}async[_0x2069b1(0x1e8)](_0x57ba0c){const _0xc74b=_0x2069b1;var _0x260f16,_0x3aec62;const {parentId:_0x37b97d,unitId:_0x25ebf1,text:_0x5881ae,threadId:_0x208bba}=_0x57ba0c,_0x22a188=(_0x3aec62=(_0x260f16=_0x5881ae['customRanges'])==null?void 0x0:_0x260f16['filter'](_0x4cf826=>_0x4cf826['rangeType']===_0x20a37b[_0xc74b(0x1f4)])[_0xc74b(0x1e9)](_0x4947a6=>_0x4947a6[_0xc74b(0x205)]))!=null?_0x3aec62:[],_0x53dc8e=JSON['stringify'](_0x5881ae),_0x2893aa=(await this[_0xc74b(0x23f)][_0xc74b(0x1fc)](_0x25ebf1))[_0xc74b(0x23d)]();if(_0x37b97d){const _0x447f4c={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188,'threadId':_0x208bba},_0x8537e3=(await this[_0xc74b(0x21f)][_0xc74b(0x240)](_0xc74b(0x20b)+_0x25ebf1+_0xc74b(0x22f),{'body':_0x447f4c}))[_0xc74b(0x1eb)][_0xc74b(0x24a)];return{..._0x57ba0c,'id':_0x8537e3[_0xc74b(0x23e)],'dT':_0x3db8db(+_0x8537e3['createTimestamp'])[_0xc74b(0x210)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x8537e3['userId']};}else{const _0xbaf400={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188},_0x3beb00=await this[_0xc74b(0x21f)][_0xc74b(0x240)]('/universer-api/comment/unit/'+_0x25ebf1+_0xc74b(0x1f9),{'body':_0xbaf400});return X(_0x3beb00['body'][_0xc74b(0x200)],_0x57ba0c);}}async['updateComment'](_0x33469c){const _0x2bb8dd=_0x2069b1;var _0x57cd8f,_0x326866;const {text:_0x3d2d88,unitId:_0x484fbb}=_0x33469c,_0x23435a=(_0x326866=(_0x57cd8f=_0x3d2d88[_0x2bb8dd(0x1e7)])==null?void 0x0:_0x57cd8f[_0x2bb8dd(0x230)](_0x52c847=>_0x52c847[_0x2bb8dd(0x247)]===_0x20a37b['COMMENT'])[_0x2bb8dd(0x1e9)](_0x24efd7=>_0x24efd7['rangeId']))!=null?_0x326866:[],_0x136a5a=JSON[_0x2bb8dd(0x221)](_0x3d2d88),_0x161502=_0x33469c[_0x2bb8dd(0x233)],_0x100d9b=_0x33469c['id'],_0x504d21={'memberId':(await this[_0x2bb8dd(0x23f)][_0x2bb8dd(0x1fc)](_0x484fbb))['getMemberID'](),'unitId':_0x484fbb,'threadId':_0x161502,'mention':_0x23435a,'content':_0x136a5a,'replyId':_0x100d9b},_0x54da1f=await this[_0x2bb8dd(0x21f)][_0x2bb8dd(0x240)](_0x2bb8dd(0x20b)+_0x484fbb+_0x2bb8dd(0x22e),{'body':_0x504d21});return!_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)]||_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)][_0x2bb8dd(0x20a)]===0x1;}async[_0x2069b1(0x1f6)](_0x526be0){const _0x2c8d26=_0x2069b1,{unitId:_0x3222c2}=_0x526be0,_0x4d38e0=_0x526be0[_0x2c8d26(0x233)],_0x2d0a68={'memberId':this[_0x2c8d26(0x224)][_0x2c8d26(0x207)]()[_0x2c8d26(0x214)],'unitId':_0x3222c2,'threadId':_0x4d38e0,'solved':_0x526be0['resolved']?I['Solved']:I[_0x2c8d26(0x246)]},_0x36fd32=await this['_httpService'][_0x2c8d26(0x240)](_0x2c8d26(0x20b)+_0x3222c2+_0x2c8d26(0x225),{'body':_0x2d0a68});return!_0x36fd32[_0x2c8d26(0x1eb)]['error']||_0x36fd32[_0x2c8d26(0x1eb)][_0x2c8d26(0x1ef)][_0x2c8d26(0x20a)]===0x1;}async['deleteComment'](_0x23cc3f,_0x570924,_0x20daa7,_0x2c124e){const _0x5168ef=_0x2069b1,_0x406cea={'memberId':(await this[_0x5168ef(0x23f)][_0x5168ef(0x1fc)](_0x23cc3f))[_0x5168ef(0x23d)](),'threadId':_0x20daa7,'replyId':_0x2c124e,'unitId':_0x23cc3f},_0x575c63=await this[_0x5168ef(0x21f)]['post']('/universer-api/comment/unit/'+_0x23cc3f+_0x5168ef(0x20c),{'body':_0x406cea});return!_0x575c63['body'][_0x5168ef(0x1ef)]||_0x575c63[_0x5168ef(0x1eb)][_0x5168ef(0x1ef)]['code']===0x1;}async[_0x2069b1(0x203)](_0x5bf68c,_0x1da9d9,_0x13095e){const _0x5f1305=_0x2069b1,_0x917eb7={'unitId':_0x5bf68c,'threadId':_0x13095e},_0x1de068=await this[_0x5f1305(0x21f)][_0x5f1305(0x240)](_0x5f1305(0x20b)+_0x5bf68c+'/list',{'body':_0x917eb7}),_0x58a87f=_0x13095e['map'](_0x38c997=>ee(_0x1de068[_0x5f1305(0x1eb)]['comments'][_0x38c997],_0x5bf68c,_0x1da9d9))[_0x5f1305(0x230)](Boolean);return Object[_0x5f1305(0x1f5)](_0x1de068[_0x5f1305(0x1eb)][_0x5f1305(0x236)])[_0x5f1305(0x206)](_0x1a2e90=>{const _0x29c53b=_0x5f1305;this[_0x29c53b(0x224)][_0x29c53b(0x1fd)](_0x1a2e90);}),_0x58a87f;}[_0x2069b1(0x21e)](_0x5b685d){const _0x35c709=_0x2069b1;return{'id':_0x5b685d['id'],'threadId':_0x5b685d['threadId'],'ref':_0x5b685d[_0x35c709(0x1fa)]};}};f=Q([_(0x0,_0x29435d(_0x28bbac)),_(0x1,_0x29435d(_0x4a0daf)),_(0x2,_0x29435d(_0x497b32)),_(0x3,_0x29435d(_0x4a982a))],f);var re=Object[_0x2069b1(0x1f0)],te=(_0x53a279,_0x1e8bf8,_0x5da0b2,_0x41acd3)=>{const _0x4f0473=_0x2069b1;for(var _0x402979=_0x41acd3>0x1?void 0x0:_0x41acd3?re(_0x1e8bf8,_0x5da0b2):_0x1e8bf8,_0x8614a8=_0x53a279[_0x4f0473(0x243)]-0x1,_0x3993e3;_0x8614a8>=0x0;_0x8614a8--)(_0x3993e3=_0x53a279[_0x8614a8])&&(_0x402979=_0x3993e3(_0x402979)||_0x402979);return _0x402979;},N=(_0x3edf70,_0x404ed6)=>(_0x342394,_0x2ea15a)=>_0x404ed6(_0x342394,_0x2ea15a,_0x3edf70);let g=class extends _0xcf5e6a{constructor(_0x10394d,_0x3d1afd){const _0x31a5c4=_0x2069b1;super(),this[_0x31a5c4(0x1ea)]=_0x10394d,this[_0x31a5c4(0x23b)]=_0x3d1afd,this['_initDataSource']();}[_0x2069b1(0x218)](){const _0x3ee648=_0x2069b1;this['_threadCommentDataSourceService'][_0x3ee648(0x220)]=this['_threadCommentDataSource'],this[_0x3ee648(0x1ea)][_0x3ee648(0x248)]=!0x1;}};g=te([N(0x0,_0x50d99d),N(0x1,_0x29435d(f))],g);var se=Object[_0x2069b1(0x219)],oe=Object[_0x2069b1(0x1f0)],ne=(_0x145b1f,_0x1d1939,_0x483275)=>_0x1d1939 in _0x145b1f?se(_0x145b1f,_0x1d1939,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x483275}):_0x145b1f[_0x1d1939]=_0x483275,ie=(_0x5c0722,_0x1a2999,_0x186fe8,_0x27cb6)=>{for(var _0x23c14e=_0x27cb6>0x1?void 0x0:_0x27cb6?oe(_0x1a2999,_0x186fe8):_0x1a2999,_0x3aa58f=_0x5c0722['length']-0x1,_0x296568;_0x3aa58f>=0x0;_0x3aa58f--)(_0x296568=_0x5c0722[_0x3aa58f])&&(_0x23c14e=_0x296568(_0x23c14e)||_0x23c14e);return _0x23c14e;},w=(_0x9c69e8,_0x3e5640)=>(_0x5c9264,_0x5b91d0)=>_0x3e5640(_0x5c9264,_0x5b91d0,_0x9c69e8),$=(_0x1188fa,_0xecfa3c,_0x3f0e32)=>ne(_0x1188fa,typeof _0xecfa3c!=_0x2069b1(0x237)?_0xecfa3c+'':_0xecfa3c,_0x3f0e32);let b=class extends _0x336457{constructor(_0x5b7b71=M,_0x54a116,_0x232ede){const _0x4a7efd=_0x2069b1;super(),this[_0x4a7efd(0x1fe)]=_0x5b7b71,this['_injector']=_0x54a116,this[_0x4a7efd(0x227)]=_0x232ede;const {..._0x55939b}=_0x29ae8d({},M,this[_0x4a7efd(0x1fe)]);this[_0x4a7efd(0x227)][_0x4a7efd(0x228)](z,_0x55939b);}[_0x2069b1(0x1ee)](){[[f],[g],[S]]['forEach'](_0x53b308=>{const _0x125688=_0x43de;this[_0x125688(0x20e)]['add'](_0x53b308);});}['onReady'](){const _0x828de8=_0x2069b1;this['_injector'][_0x828de8(0x1f8)](g),this[_0x828de8(0x20e)][_0x828de8(0x1f8)](S);}};$(b,_0x2069b1(0x234),W),$(b,_0x2069b1(0x229),_0x388da4[_0x2069b1(0x1ff)]),b=ie([_0x4bdd65(_0x40bc7d,_0x293a48,_0x177d79),w(0x1,_0x29435d(_0x4a982a)),w(0x2,_0x10e4b8)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x597f96=_0x5f55;(function(_0x299bf7,_0x2b77b8){const _0x5b4259=_0x5f55,_0x21cc96=_0x299bf7();while(!![]){try{const _0x397444=parseInt(_0x5b4259(0x172))/0x1*(parseInt(_0x5b4259(0x16f))/0x2)+parseInt(_0x5b4259(0x194))/0x3*(-parseInt(_0x5b4259(0x17c))/0x4)+-parseInt(_0x5b4259(0x164))/0x5+parseInt(_0x5b4259(0x14b))/0x6*(parseInt(_0x5b4259(0x15b))/0x7)+-parseInt(_0x5b4259(0x16c))/0x8*(parseInt(_0x5b4259(0x16d))/0x9)+parseInt(_0x5b4259(0x186))/0xa*(parseInt(_0x5b4259(0x184))/0xb)+parseInt(_0x5b4259(0x19e))/0xc;if(_0x397444===_0x2b77b8)break;else _0x21cc96['push'](_0x21cc96['shift']());}catch(_0x418b09){_0x21cc96['push'](_0x21cc96['shift']());}}}(_0x35bf,0x23011));import{CommentService as _0x870a6e,CollaborationSessionService as _0x32baf8,UniverCollaborationClientPlugin as _0x53a35a}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5b5c78}from'@univerjs-pro/license';import{dayjs as _0x3a4c00,UserManagerService as _0x5eb8f1,Inject as _0x3319bd,Injector as _0x2a9806,Disposable as _0x4b16b4,CustomRangeType as _0xc9d637,UniverInstanceType as _0x2a8601,DependentOn as _0x32eefa,IConfigService as _0x2dc9fb,Plugin as _0x2469e2,merge as _0x4f5a3a}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1d2348}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0xa098e9,IThreadCommentDataSourceService as _0x524bce}from'@univerjs/thread-comment';import{bufferTime as _0x55f664}from'rxjs';import{HTTPService as _0xeee792}from'@univerjs/network';function _0x35bf(){const _0x340636=['map','createTimestamp','_commentService','add','forEach','content','926710TcxCXI','user','getComment','_sessionService','get','/solved','post','code','48376uaZsJd','9EVZyoq','slice','183970KYbNiI','size','_userService','1PmjoYO','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/reply','COMMENT','delete','deleteComment','/list','stringify','customRanges','root','4aNwqoT','OpenOrReOpen','_config','comment','personId','error','getUnit','Reply','96613aFNbfN','Solve','20zmhijx','thread-comment-data-source.config','users','_threadCommentDataSource','parse','defineProperty','_initDataSource','addUser','userId','/universer-api/comment/unit/','disposeWithMe','type','/add','rangeId','127989fZcHHY','filter','listComments','format','_injector','_configService','Add','pipe','solved','replies','2375436jNmUbt','parentId','Delete','Edit','resolveComment','getMemberID','threadId','length','/delete','Unknown','userID','subscribe','_httpService','commentUpdate$','/edit','419550sMPSZJ','requireSession','resolved','UNRECOGNIZED','replyId','saveCommentToSnapshot','_threadCommentDataSourceService','body','_init','YYYY/MM/DD\x20HH:mm','setConfig','_threadCommentModel','symbol','Solved','values','getOwnPropertyDescriptor','7wjJgVf','unitId','_initUserSync'];_0x35bf=function(){return _0x340636;};return _0x35bf();}const W=_0x597f96(0x173);function _0x5f55(_0x4e0e0a,_0x7c0f12){const _0x35bfd2=_0x35bf();return _0x5f55=function(_0x5f554e,_0x4591eb){_0x5f554e=_0x5f554e-0x148;let _0x27154a=_0x35bfd2[_0x5f554e];return _0x27154a;},_0x5f55(_0x4e0e0a,_0x7c0f12);}var I=(_0xb883fe=>(_0xb883fe[_0xb883fe[_0x597f96(0x17d)]=0x0]=_0x597f96(0x17d),_0xb883fe[_0xb883fe[_0x597f96(0x158)]=0x1]=_0x597f96(0x158),_0xb883fe[_0xb883fe[_0x597f96(0x14e)]=-0x1]=_0x597f96(0x14e),_0xb883fe))(I||{}),v=(_0x1e09c6=>(_0x1e09c6[_0x1e09c6[_0x597f96(0x1a7)]=0x0]=_0x597f96(0x1a7),_0x1e09c6[_0x1e09c6[_0x597f96(0x19a)]=0x1]=_0x597f96(0x19a),_0x1e09c6[_0x1e09c6[_0x597f96(0x183)]=0x2]=_0x597f96(0x183),_0x1e09c6[_0x1e09c6[_0x597f96(0x1a1)]=0x3]=_0x597f96(0x1a1),_0x1e09c6[_0x1e09c6[_0x597f96(0x1a0)]=0x4]=_0x597f96(0x1a0),_0x1e09c6[_0x1e09c6['Solve']=0x5]=_0x597f96(0x185),_0x1e09c6[_0x1e09c6[_0x597f96(0x14e)]=-0x1]=_0x597f96(0x14e),_0x1e09c6))(v||{});const D=_0x3591a0=>_0x3a4c00(new Date(+_0x3591a0))[_0x597f96(0x197)](_0x597f96(0x154)),B=async(_0x42e457,_0x30674a)=>{const _0x473a52=_0x597f96,_0x5869a7=_0x42e457[_0x473a52(0x168)](_0x5eb8f1),_0x26300c=_0x42e457['get'](_0xeee792);_0x30674a[_0x473a52(0x162)](_0x5caa43=>{const _0x3829c8=_0x473a52;_0x5869a7['getUser'](_0x5caa43)&&_0x30674a[_0x3829c8(0x176)](_0x5caa43);}),_0x30674a[_0x473a52(0x170)]&&(await _0x26300c['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x30674a]}}))[_0x473a52(0x152)][_0x473a52(0x188)][_0x473a52(0x162)](_0x32b78c=>{const _0xc10422=_0x473a52;_0x32b78c&&_0x5869a7[_0xc10422(0x18d)](_0x32b78c);});};var K=Object[_0x597f96(0x15a)],V=(_0x285199,_0x568b53,_0x17f0ff,_0x62f402)=>{const _0x2f26d5=_0x597f96;for(var _0xd2c762=_0x62f402>0x1?void 0x0:_0x62f402?K(_0x568b53,_0x17f0ff):_0x568b53,_0x1e654d=_0x285199[_0x2f26d5(0x1a5)]-0x1,_0x4d2e64;_0x1e654d>=0x0;_0x1e654d--)(_0x4d2e64=_0x285199[_0x1e654d])&&(_0xd2c762=_0x4d2e64(_0xd2c762)||_0xd2c762);return _0xd2c762;},p=(_0x31ed3b,_0x137a6c)=>(_0x22ef5c,_0x58feb4)=>_0x137a6c(_0x22ef5c,_0x58feb4,_0x31ed3b);let S=class extends _0x4b16b4{constructor(_0x43c20b,_0xf30329,_0x6c99d3,_0x56d514){const _0x40841b=_0x597f96;super(),this[_0x40841b(0x160)]=_0x43c20b,this[_0x40841b(0x156)]=_0xf30329,this[_0x40841b(0x171)]=_0x6c99d3,this['_injector']=_0x56d514,this[_0x40841b(0x153)](),this[_0x40841b(0x15d)]();}[_0x597f96(0x15d)](){const _0xa79a10=_0x597f96;this[_0xa79a10(0x190)](this['_threadCommentModel']['commentUpdate$'][_0xa79a10(0x19b)](_0x55f664(0x10))[_0xa79a10(0x1a9)](_0x2f0b64=>{const _0x55dd1d=_0xa79a10,_0x10ddd1=new Set();_0x2f0b64['forEach'](_0x110dcf=>{const _0x3ac234=_0x5f55;switch(_0x110dcf[_0x3ac234(0x191)]){case'add':{const _0x499f8a=_0x110dcf['payload'][_0x3ac234(0x180)];_0x10ddd1[_0x3ac234(0x161)](_0x499f8a);break;}}}),B(this[_0x55dd1d(0x198)],_0x10ddd1);}));}[_0x597f96(0x153)](){const _0x3d182b=_0x597f96;this[_0x3d182b(0x190)](this[_0x3d182b(0x160)][_0x3d182b(0x149)][_0x3d182b(0x1a9)](async _0x16063c=>{const _0x144ffe=_0x3d182b;var _0x3ce913,_0x414d9f,_0x517bbb,_0x4c2310;const _0x127d08=(_0x3ce913=this['_threadCommentModel'][_0x144ffe(0x182)](_0x16063c['unitId'])['find'](_0x70efa8=>_0x70efa8['threadId']===_0x16063c['threadId']))==null?void 0x0:_0x3ce913['root'];if(!_0x127d08)return;const {unitId:_0x38dcef,subUnitId:_0x4519bc}=_0x127d08;switch(_0x16063c[_0x144ffe(0x165)]&&this['_userService'][_0x144ffe(0x18d)](_0x16063c[_0x144ffe(0x165)]),_0x16063c['type']){case v[_0x144ffe(0x19a)]:break;case v[_0x144ffe(0x183)]:{this[_0x144ffe(0x156)]['addComment'](_0x38dcef,_0x4519bc,{'unitId':_0x38dcef,'subUnitId':_0x4519bc,'ref':'','id':_0x16063c[_0x144ffe(0x14f)],'dT':D(+_0x16063c[_0x144ffe(0x15f)]),'threadId':_0x16063c['threadId'],'personId':(_0x517bbb=(_0x414d9f=_0x16063c['user'])==null?void 0x0:_0x414d9f[_0x144ffe(0x1a8)])!=null?_0x517bbb:_0x16063c[_0x144ffe(0x18e)],'text':JSON[_0x144ffe(0x18a)](_0x16063c[_0x144ffe(0x163)]),'parentId':_0x127d08['id']});break;}case v['Delete']:{const _0x3c14f8=this[_0x144ffe(0x156)][_0x144ffe(0x166)](_0x38dcef,_0x4519bc,_0x16063c[_0x144ffe(0x14f)]);_0x3c14f8&&_0x3c14f8[_0x144ffe(0x19f)]&&this['_threadCommentModel'][_0x144ffe(0x177)](_0x38dcef,_0x4519bc,_0x16063c[_0x144ffe(0x14f)]);break;}case v['Edit']:{this['_threadCommentModel']['updateComment'](_0x38dcef,_0x4519bc,{'commentId':_0x16063c['replyId'],'text':JSON['parse'](_0x16063c[_0x144ffe(0x163)])});break;}case v[_0x144ffe(0x185)]:{const _0x46e105=(_0x4c2310=this['_threadCommentModel'][_0x144ffe(0x182)](_0x16063c[_0x144ffe(0x15c)])['find'](_0x140f7e=>_0x140f7e[_0x144ffe(0x1a4)]===_0x16063c['threadId']))==null?void 0x0:_0x4c2310[_0x144ffe(0x17b)];_0x46e105&&this[_0x144ffe(0x156)]['resolveComment'](_0x38dcef,_0x4519bc,_0x46e105['id'],_0x16063c[_0x144ffe(0x19c)]===I[_0x144ffe(0x158)]);break;}}}));}};S=V([p(0x0,_0x3319bd(_0x870a6e)),p(0x1,_0x3319bd(_0xa098e9)),p(0x2,_0x3319bd(_0x5eb8f1)),p(0x3,_0x3319bd(_0x2a9806))],S);const z=_0x597f96(0x187),M={};var k=Object[_0x597f96(0x15a)],Q=(_0x10532d,_0x59c67e,_0x9c1fe6,_0x543e0b)=>{const _0x2a5bb0=_0x597f96;for(var _0x582c49=_0x543e0b>0x1?void 0x0:_0x543e0b?k(_0x59c67e,_0x9c1fe6):_0x59c67e,_0x52b088=_0x10532d[_0x2a5bb0(0x1a5)]-0x1,_0x558edf;_0x52b088>=0x0;_0x52b088--)(_0x558edf=_0x10532d[_0x52b088])&&(_0x582c49=_0x558edf(_0x582c49)||_0x582c49);return _0x582c49;},_=(_0xde9a76,_0x300404)=>(_0x2f5898,_0x226a7d)=>_0x300404(_0x2f5898,_0x226a7d,_0xde9a76);function X(_0xe3fd93,_0x5f0ac8){const _0x3a4758=_0x597f96,_0x212ad5=_0xe3fd93[_0x3a4758(0x19d)][0x0];return{..._0x5f0ac8,'id':_0x212ad5[_0x3a4758(0x14f)],'resolved':_0xe3fd93[_0x3a4758(0x19c)]===0x1,'dT':D(_0x212ad5[_0x3a4758(0x15f)]),'personId':_0x212ad5['userId'],'threadId':_0x212ad5['threadId']};}function ee(_0x18d791,_0x44d536,_0x55dc40){const _0x3aea06=_0x597f96;var _0x231397,_0x1c43da;if(((_0x1c43da=(_0x231397=_0x18d791==null?void 0x0:_0x18d791[_0x3aea06(0x19d)])==null?void 0x0:_0x231397[_0x3aea06(0x1a5)])!=null?_0x1c43da:0x0)>0x0){const _0x2d5661=(_0x4a6db1,_0xb98591)=>({'id':_0x4a6db1[_0x3aea06(0x14f)],'threadId':_0x4a6db1[_0x3aea06(0x1a4)],'dT':D(_0x4a6db1[_0x3aea06(0x15f)]),'personId':_0x4a6db1[_0x3aea06(0x18e)],'resolved':_0x18d791[_0x3aea06(0x19c)]===I[_0x3aea06(0x158)],'unitId':_0x44d536,'subUnitId':_0x55dc40,'text':JSON[_0x3aea06(0x18a)](_0x4a6db1[_0x3aea06(0x163)]),'parentId':_0xb98591}),_0x206aa8=_0x2d5661(_0x18d791[_0x3aea06(0x19d)][0x0]);return{..._0x206aa8,'children':_0x18d791[_0x3aea06(0x19d)][_0x3aea06(0x16e)](0x1)[_0x3aea06(0x15e)](_0x44bdf9=>_0x2d5661(_0x44bdf9,_0x206aa8['id']))};}return null;}let f=class{constructor(_0x30794d,_0x280658,_0x194daa,_0x463807){const _0x338733=_0x597f96;this[_0x338733(0x148)]=_0x30794d,this[_0x338733(0x171)]=_0x280658,this[_0x338733(0x167)]=_0x194daa,this['_injector']=_0x463807;}async['addComment'](_0x5d8f4d){const _0x2ac765=_0x597f96;var _0x3219c4,_0x3bdaca;const {parentId:_0x25d9dd,unitId:_0x5dcb58,text:_0x217d9b,threadId:_0x6f770b}=_0x5d8f4d,_0x2a4e4c=(_0x3bdaca=(_0x3219c4=_0x217d9b['customRanges'])==null?void 0x0:_0x3219c4[_0x2ac765(0x195)](_0x2872c9=>_0x2872c9['rangeType']===_0xc9d637[_0x2ac765(0x175)])[_0x2ac765(0x15e)](_0x427f35=>_0x427f35[_0x2ac765(0x193)]))!=null?_0x3bdaca:[],_0x11c187=JSON[_0x2ac765(0x179)](_0x217d9b),_0x6d173d=(await this[_0x2ac765(0x167)]['requireSession'](_0x5dcb58))[_0x2ac765(0x1a3)]();if(_0x25d9dd){const _0x4fb426={'memberId':_0x6d173d,'unitId':_0x5dcb58,'content':_0x11c187,'mention':_0x2a4e4c,'threadId':_0x6f770b},_0x4c0835=(await this[_0x2ac765(0x148)][_0x2ac765(0x16a)](_0x2ac765(0x18f)+_0x5dcb58+_0x2ac765(0x174),{'body':_0x4fb426}))['body']['reply'];return{..._0x5d8f4d,'id':_0x4c0835['replyId'],'dT':_0x3a4c00(+_0x4c0835[_0x2ac765(0x15f)])['format']('YYYY/MM/DD\x20HH:mm'),'personId':_0x4c0835[_0x2ac765(0x18e)]};}else{const _0x22181d={'memberId':_0x6d173d,'unitId':_0x5dcb58,'content':_0x11c187,'mention':_0x2a4e4c},_0xd465d5=await this[_0x2ac765(0x148)]['post'](_0x2ac765(0x18f)+_0x5dcb58+_0x2ac765(0x192),{'body':_0x22181d});return X(_0xd465d5['body'][_0x2ac765(0x17f)],_0x5d8f4d);}}async['updateComment'](_0x286a9b){const _0x420817=_0x597f96;var _0x34c9a7,_0x4b3f4e;const {text:_0x3a8bc7,unitId:_0x4aeadd}=_0x286a9b,_0x107907=(_0x4b3f4e=(_0x34c9a7=_0x3a8bc7[_0x420817(0x17a)])==null?void 0x0:_0x34c9a7['filter'](_0x21e0d0=>_0x21e0d0['rangeType']===_0xc9d637[_0x420817(0x175)])[_0x420817(0x15e)](_0x2f6d3a=>_0x2f6d3a[_0x420817(0x193)]))!=null?_0x4b3f4e:[],_0x517a57=JSON[_0x420817(0x179)](_0x3a8bc7),_0x12241f=_0x286a9b[_0x420817(0x1a4)],_0x3d6cb6=_0x286a9b['id'],_0x43f11f={'memberId':(await this[_0x420817(0x167)][_0x420817(0x14c)](_0x4aeadd))['getMemberID'](),'unitId':_0x4aeadd,'threadId':_0x12241f,'mention':_0x107907,'content':_0x517a57,'replyId':_0x3d6cb6},_0x10ae1d=await this[_0x420817(0x148)][_0x420817(0x16a)]('/universer-api/comment/unit/'+_0x4aeadd+_0x420817(0x14a),{'body':_0x43f11f});return!_0x10ae1d[_0x420817(0x152)]['error']||_0x10ae1d[_0x420817(0x152)][_0x420817(0x181)][_0x420817(0x16b)]===0x1;}async[_0x597f96(0x1a2)](_0x2cf37d){const _0x384a16=_0x597f96,{unitId:_0x483f2a}=_0x2cf37d,_0x10e469=_0x2cf37d[_0x384a16(0x1a4)],_0xec4560={'memberId':this[_0x384a16(0x171)]['getCurrentUser']()[_0x384a16(0x1a8)],'unitId':_0x483f2a,'threadId':_0x10e469,'solved':_0x2cf37d[_0x384a16(0x14d)]?I[_0x384a16(0x158)]:I[_0x384a16(0x17d)]},_0x4a6017=await this[_0x384a16(0x148)][_0x384a16(0x16a)](_0x384a16(0x18f)+_0x483f2a+_0x384a16(0x169),{'body':_0xec4560});return!_0x4a6017['body'][_0x384a16(0x181)]||_0x4a6017[_0x384a16(0x152)][_0x384a16(0x181)][_0x384a16(0x16b)]===0x1;}async['deleteComment'](_0x1fe00d,_0x33f6dd,_0x4f2c4c,_0x259f47){const _0x1536bb=_0x597f96,_0x2b3e31={'memberId':(await this['_sessionService']['requireSession'](_0x1fe00d))[_0x1536bb(0x1a3)](),'threadId':_0x4f2c4c,'replyId':_0x259f47,'unitId':_0x1fe00d},_0xbabc2=await this['_httpService'][_0x1536bb(0x16a)](_0x1536bb(0x18f)+_0x1fe00d+_0x1536bb(0x1a6),{'body':_0x2b3e31});return!_0xbabc2[_0x1536bb(0x152)][_0x1536bb(0x181)]||_0xbabc2[_0x1536bb(0x152)][_0x1536bb(0x181)][_0x1536bb(0x16b)]===0x1;}async[_0x597f96(0x196)](_0xa08590,_0x532cfe,_0x24b1c2){const _0x40a35f=_0x597f96,_0x4178d1={'unitId':_0xa08590,'threadId':_0x24b1c2},_0x261a59=await this['_httpService'][_0x40a35f(0x16a)](_0x40a35f(0x18f)+_0xa08590+_0x40a35f(0x178),{'body':_0x4178d1}),_0xe09690=_0x24b1c2[_0x40a35f(0x15e)](_0x54aeec=>ee(_0x261a59['body']['comments'][_0x54aeec],_0xa08590,_0x532cfe))[_0x40a35f(0x195)](Boolean);return Object[_0x40a35f(0x159)](_0x261a59[_0x40a35f(0x152)]['users'])['forEach'](_0xbfb615=>{const _0xc31d2d=_0x40a35f;this[_0xc31d2d(0x171)]['addUser'](_0xbfb615);}),_0xe09690;}[_0x597f96(0x150)](_0x70e505){const _0x1ef39f=_0x597f96;return{'id':_0x70e505['id'],'threadId':_0x70e505[_0x1ef39f(0x1a4)],'ref':_0x70e505['ref']};}};f=Q([_(0x0,_0x3319bd(_0xeee792)),_(0x1,_0x3319bd(_0x5eb8f1)),_(0x2,_0x3319bd(_0x32baf8)),_(0x3,_0x3319bd(_0x2a9806))],f);var re=Object[_0x597f96(0x15a)],te=(_0xda6ae8,_0xafc026,_0x6084be,_0x25b53e)=>{for(var _0x5a10cc=_0x25b53e>0x1?void 0x0:_0x25b53e?re(_0xafc026,_0x6084be):_0xafc026,_0xd1af38=_0xda6ae8['length']-0x1,_0x34b42d;_0xd1af38>=0x0;_0xd1af38--)(_0x34b42d=_0xda6ae8[_0xd1af38])&&(_0x5a10cc=_0x34b42d(_0x5a10cc)||_0x5a10cc);return _0x5a10cc;},N=(_0xaf04b8,_0x46ef6f)=>(_0x575db9,_0x160f09)=>_0x46ef6f(_0x575db9,_0x160f09,_0xaf04b8);let g=class extends _0x4b16b4{constructor(_0x696a20,_0x217382){const _0x55f272=_0x597f96;super(),this[_0x55f272(0x151)]=_0x696a20,this[_0x55f272(0x189)]=_0x217382,this[_0x55f272(0x18c)]();}[_0x597f96(0x18c)](){const _0x416c56=_0x597f96;this['_threadCommentDataSourceService']['dataSource']=this[_0x416c56(0x189)],this[_0x416c56(0x151)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x524bce),N(0x1,_0x3319bd(f))],g);var se=Object[_0x597f96(0x18b)],oe=Object[_0x597f96(0x15a)],ne=(_0x5a1a53,_0x2d9d4e,_0x2d07ec)=>_0x2d9d4e in _0x5a1a53?se(_0x5a1a53,_0x2d9d4e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2d07ec}):_0x5a1a53[_0x2d9d4e]=_0x2d07ec,ie=(_0x2ac3d0,_0x5935b3,_0x12851b,_0x1f4f36)=>{const _0x301a83=_0x597f96;for(var _0x3d8a92=_0x1f4f36>0x1?void 0x0:_0x1f4f36?oe(_0x5935b3,_0x12851b):_0x5935b3,_0x5b01e5=_0x2ac3d0[_0x301a83(0x1a5)]-0x1,_0x417de6;_0x5b01e5>=0x0;_0x5b01e5--)(_0x417de6=_0x2ac3d0[_0x5b01e5])&&(_0x3d8a92=_0x417de6(_0x3d8a92)||_0x3d8a92);return _0x3d8a92;},w=(_0x5f34b8,_0x2d1046)=>(_0x121a8e,_0x14767b)=>_0x2d1046(_0x121a8e,_0x14767b,_0x5f34b8),$=(_0x17e997,_0xd52f66,_0x17d923)=>ne(_0x17e997,typeof _0xd52f66!=_0x597f96(0x157)?_0xd52f66+'':_0xd52f66,_0x17d923);let b=class extends _0x2469e2{constructor(_0x5dd388=M,_0x32acef,_0xe35147){const _0xdb3830=_0x597f96;super(),this[_0xdb3830(0x17e)]=_0x5dd388,this['_injector']=_0x32acef,this[_0xdb3830(0x199)]=_0xe35147;const {..._0x3bc1f7}=_0x4f5a3a({},M,this[_0xdb3830(0x17e)]);this[_0xdb3830(0x199)][_0xdb3830(0x155)](z,_0x3bc1f7);}['onStarting'](){const _0xe0f8c=_0x597f96;[[f],[g],[S]][_0xe0f8c(0x162)](_0x35634b=>{const _0x522e91=_0xe0f8c;this['_injector'][_0x522e91(0x161)](_0x35634b);});}['onReady'](){const _0x43d2ea=_0x597f96;this[_0x43d2ea(0x198)]['get'](g),this[_0x43d2ea(0x198)][_0x43d2ea(0x168)](S);}};$(b,'pluginName',W),$(b,_0x597f96(0x191),_0x2a8601['UNIVER_UNKNOWN']),b=ie([_0x32eefa(_0x1d2348,_0x53a35a,_0x5b5c78),w(0x1,_0x3319bd(_0x2a9806)),w(0x2,_0x2dc9fb)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2069b1=_0x43de;(function(_0x380a17,_0x180abc){const _0x512c22=_0x43de,_0xf23808=_0x380a17();while(!![]){try{const _0x23b653=-parseInt(_0x512c22(0x202))/0x1*(-parseInt(_0x512c22(0x211))/0x2)+parseInt(_0x512c22(0x212))/0x3*(parseInt(_0x512c22(0x1f7))/0x4)+parseInt(_0x512c22(0x204))/0x5*(-parseInt(_0x512c22(0x235))/0x6)+-parseInt(_0x512c22(0x20f))/0x7+parseInt(_0x512c22(0x231))/0x8*(-parseInt(_0x512c22(0x1ed))/0x9)+-parseInt(_0x512c22(0x1f1))/0xa+parseInt(_0x512c22(0x249))/0xb;if(_0x23b653===_0x180abc)break;else _0xf23808['push'](_0xf23808['shift']());}catch(_0x4008b3){_0xf23808['push'](_0xf23808['shift']());}}}(_0x5a9a,0xc9b63));import{CommentService as _0x13b92b,CollaborationSessionService as _0x497b32,UniverCollaborationClientPlugin as _0x293a48}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x177d79}from'@univerjs-pro/license';import{dayjs as _0x3db8db,UserManagerService as _0x4a0daf,Inject as _0x29435d,Injector as _0x4a982a,Disposable as _0xcf5e6a,CustomRangeType as _0x20a37b,UniverInstanceType as _0x388da4,DependentOn as _0x4bdd65,IConfigService as _0x10e4b8,Plugin as _0x336457,merge as _0x29ae8d}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x40bc7d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x307483,IThreadCommentDataSourceService as _0x50d99d}from'@univerjs/thread-comment';import{bufferTime as _0x2cdc2a}from'rxjs';import{HTTPService as _0x28bbac}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2869f4=>(_0x2869f4[_0x2869f4['OpenOrReOpen']=0x0]=_0x2069b1(0x246),_0x2869f4[_0x2869f4[_0x2069b1(0x23a)]=0x1]='Solved',_0x2869f4[_0x2869f4[_0x2069b1(0x208)]=-0x1]='UNRECOGNIZED',_0x2869f4))(I||{}),v=(_0x4886b4=>(_0x4886b4[_0x4886b4[_0x2069b1(0x22a)]=0x0]=_0x2069b1(0x22a),_0x4886b4[_0x4886b4['Add']=0x1]=_0x2069b1(0x1ec),_0x4886b4[_0x4886b4[_0x2069b1(0x245)]=0x2]=_0x2069b1(0x245),_0x4886b4[_0x4886b4[_0x2069b1(0x244)]=0x3]=_0x2069b1(0x244),_0x4886b4[_0x4886b4[_0x2069b1(0x20d)]=0x4]=_0x2069b1(0x20d),_0x4886b4[_0x4886b4[_0x2069b1(0x241)]=0x5]=_0x2069b1(0x241),_0x4886b4[_0x4886b4[_0x2069b1(0x208)]=-0x1]=_0x2069b1(0x208),_0x4886b4))(v||{});const D=_0x370191=>_0x3db8db(new Date(+_0x370191))[_0x2069b1(0x210)](_0x2069b1(0x232)),B=async(_0x191f0d,_0x23776b)=>{const _0x187ad9=_0x2069b1,_0x3ecd4a=_0x191f0d[_0x187ad9(0x1f8)](_0x4a0daf),_0x478deb=_0x191f0d[_0x187ad9(0x1f8)](_0x28bbac);_0x23776b[_0x187ad9(0x206)](_0x3b836a=>{_0x3ecd4a['getUser'](_0x3b836a)&&_0x23776b['delete'](_0x3b836a);}),_0x23776b['size']&&(await _0x478deb[_0x187ad9(0x1f8)](_0x187ad9(0x1f3),{'params':{'userIDs':[..._0x23776b]}}))[_0x187ad9(0x1eb)][_0x187ad9(0x236)][_0x187ad9(0x206)](_0x2ab20f=>{const _0x28dba8=_0x187ad9;_0x2ab20f&&_0x3ecd4a[_0x28dba8(0x1fd)](_0x2ab20f);});};var K=Object[_0x2069b1(0x1f0)],V=(_0xc1efc,_0x23a962,_0x2f879a,_0x39b1b5)=>{const _0x48ea24=_0x2069b1;for(var _0x2271cc=_0x39b1b5>0x1?void 0x0:_0x39b1b5?K(_0x23a962,_0x2f879a):_0x23a962,_0x442cad=_0xc1efc[_0x48ea24(0x243)]-0x1,_0x140cdf;_0x442cad>=0x0;_0x442cad--)(_0x140cdf=_0xc1efc[_0x442cad])&&(_0x2271cc=_0x140cdf(_0x2271cc)||_0x2271cc);return _0x2271cc;},p=(_0x20cc3e,_0x213cb1)=>(_0x4562f0,_0x36ca17)=>_0x213cb1(_0x4562f0,_0x36ca17,_0x20cc3e);let S=class extends _0xcf5e6a{constructor(_0x5e4639,_0x4ad17a,_0x1df9ef,_0x43e464){const _0x592c51=_0x2069b1;super(),this[_0x592c51(0x1f2)]=_0x5e4639,this[_0x592c51(0x201)]=_0x4ad17a,this['_userService']=_0x1df9ef,this['_injector']=_0x43e464,this['_init'](),this[_0x592c51(0x217)]();}['_initUserSync'](){const _0x1bb593=_0x2069b1;this['disposeWithMe'](this[_0x1bb593(0x201)][_0x1bb593(0x21a)][_0x1bb593(0x1e6)](_0x2cdc2a(0x10))[_0x1bb593(0x242)](_0x14c196=>{const _0x5196a3=_0x1bb593,_0x1ac635=new Set();_0x14c196[_0x5196a3(0x206)](_0x5f3b47=>{const _0x8685af=_0x5196a3;switch(_0x5f3b47[_0x8685af(0x229)]){case _0x8685af(0x226):{const _0x3eb9ac=_0x5f3b47[_0x8685af(0x239)]['personId'];_0x1ac635[_0x8685af(0x226)](_0x3eb9ac);break;}}}),B(this[_0x5196a3(0x20e)],_0x1ac635);}));}['_init'](){const _0x191103=_0x2069b1;this['disposeWithMe'](this[_0x191103(0x1f2)][_0x191103(0x21a)]['subscribe'](async _0x576bff=>{const _0x54e210=_0x191103;var _0x1e86ed,_0x513627,_0x562641,_0x5c215c;const _0x3fe2bf=(_0x1e86ed=this['_threadCommentModel'][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0xc814d3=>_0xc814d3[_0x54e210(0x233)]===_0x576bff[_0x54e210(0x233)]))==null?void 0x0:_0x1e86ed[_0x54e210(0x1fb)];if(!_0x3fe2bf)return;const {unitId:_0x38e42b,subUnitId:_0x32a05e}=_0x3fe2bf;switch(_0x576bff[_0x54e210(0x22b)]&&this[_0x54e210(0x224)][_0x54e210(0x1fd)](_0x576bff['user']),_0x576bff[_0x54e210(0x229)]){case v[_0x54e210(0x1ec)]:break;case v['Reply']:{this['_threadCommentModel'][_0x54e210(0x1e8)](_0x38e42b,_0x32a05e,{'unitId':_0x38e42b,'subUnitId':_0x32a05e,'ref':'','id':_0x576bff[_0x54e210(0x23e)],'dT':D(+_0x576bff[_0x54e210(0x23c)]),'threadId':_0x576bff[_0x54e210(0x233)],'personId':(_0x562641=(_0x513627=_0x576bff[_0x54e210(0x22b)])==null?void 0x0:_0x513627[_0x54e210(0x214)])!=null?_0x562641:_0x576bff[_0x54e210(0x223)],'text':JSON[_0x54e210(0x216)](_0x576bff[_0x54e210(0x238)]),'parentId':_0x3fe2bf['id']});break;}case v[_0x54e210(0x20d)]:{const _0x15bd4d=this[_0x54e210(0x201)][_0x54e210(0x215)](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);_0x15bd4d&&_0x15bd4d[_0x54e210(0x209)]&&this[_0x54e210(0x201)]['deleteComment'](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);break;}case v[_0x54e210(0x244)]:{this[_0x54e210(0x201)][_0x54e210(0x22c)](_0x38e42b,_0x32a05e,{'commentId':_0x576bff['replyId'],'text':JSON['parse'](_0x576bff[_0x54e210(0x238)])});break;}case v['Solve']:{const _0x50c2c4=(_0x5c215c=this[_0x54e210(0x201)][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0x107d79=>_0x107d79[_0x54e210(0x233)]===_0x576bff['threadId']))==null?void 0x0:_0x5c215c[_0x54e210(0x1fb)];_0x50c2c4&&this[_0x54e210(0x201)][_0x54e210(0x1f6)](_0x38e42b,_0x32a05e,_0x50c2c4['id'],_0x576bff['solved']===I[_0x54e210(0x23a)]);break;}}}));}};function _0x5a9a(){const _0x5366f2=['commentUpdate$','replies','find','unitId','saveCommentToSnapshot','_httpService','dataSource','stringify','solved','userId','_userService','/solved','add','_configService','setConfig','type','Unknown','user','updateComment','getUnit','/edit','/reply','filter','69256DAIiqt','YYYY/MM/DD\x20HH:mm','threadId','pluginName','2082jCSCpC','users','symbol','content','payload','Solved','_threadCommentDataSource','createTimestamp','getMemberID','replyId','_sessionService','post','Solve','subscribe','length','Edit','Reply','OpenOrReOpen','rangeType','syncUpdateMutationToColla','31023069BMRycz','reply','pipe','customRanges','addComment','map','_threadCommentDataSourceService','body','Add','1629QhDmIA','onStarting','error','getOwnPropertyDescriptor','7244530jbqmzq','_commentService','/universer-api/user/list','COMMENT','values','resolveComment','36YvsnLp','get','/add','ref','root','requireSession','addUser','_config','UNIVER_UNKNOWN','comment','_threadCommentModel','424AGAVSP','listComments','10655TPPakK','rangeId','forEach','getCurrentUser','UNRECOGNIZED','parentId','code','/universer-api/comment/unit/','/delete','Delete','_injector','3187954BAQHAN','format','844drDleX','437751EsPYEn','thread-comment-data-source.config','userID','getComment','parse','_initUserSync','_initDataSource','defineProperty'];_0x5a9a=function(){return _0x5366f2;};return _0x5a9a();}function _0x43de(_0x266f57,_0xd09ba3){const _0x5a9a09=_0x5a9a();return _0x43de=function(_0x43de40,_0x5853ef){_0x43de40=_0x43de40-0x1e6;let _0x3a8bd3=_0x5a9a09[_0x43de40];return _0x3a8bd3;},_0x43de(_0x266f57,_0xd09ba3);}S=V([p(0x0,_0x29435d(_0x13b92b)),p(0x1,_0x29435d(_0x307483)),p(0x2,_0x29435d(_0x4a0daf)),p(0x3,_0x29435d(_0x4a982a))],S);const z=_0x2069b1(0x213),M={};var k=Object[_0x2069b1(0x1f0)],Q=(_0x4b650e,_0x2d1575,_0x32a1f4,_0x254d33)=>{for(var _0x4ff3c5=_0x254d33>0x1?void 0x0:_0x254d33?k(_0x2d1575,_0x32a1f4):_0x2d1575,_0xcc5436=_0x4b650e['length']-0x1,_0x3c0264;_0xcc5436>=0x0;_0xcc5436--)(_0x3c0264=_0x4b650e[_0xcc5436])&&(_0x4ff3c5=_0x3c0264(_0x4ff3c5)||_0x4ff3c5);return _0x4ff3c5;},_=(_0x2bd5f4,_0x32c032)=>(_0x28a6e4,_0x3e8e36)=>_0x32c032(_0x28a6e4,_0x3e8e36,_0x2bd5f4);function X(_0x2f4f42,_0x2b125f){const _0x51c332=_0x2069b1,_0x5056fc=_0x2f4f42[_0x51c332(0x21b)][0x0];return{..._0x2b125f,'id':_0x5056fc['replyId'],'resolved':_0x2f4f42[_0x51c332(0x222)]===0x1,'dT':D(_0x5056fc[_0x51c332(0x23c)]),'personId':_0x5056fc[_0x51c332(0x223)],'threadId':_0x5056fc[_0x51c332(0x233)]};}function ee(_0x300d9d,_0x1645fb,_0x3e6823){const _0x1e4b94=_0x2069b1;var _0x395378,_0x3d0378;if(((_0x3d0378=(_0x395378=_0x300d9d==null?void 0x0:_0x300d9d[_0x1e4b94(0x21b)])==null?void 0x0:_0x395378[_0x1e4b94(0x243)])!=null?_0x3d0378:0x0)>0x0){const _0x2be729=(_0x1fe7c3,_0x22b6aa)=>({'id':_0x1fe7c3[_0x1e4b94(0x23e)],'threadId':_0x1fe7c3['threadId'],'dT':D(_0x1fe7c3[_0x1e4b94(0x23c)]),'personId':_0x1fe7c3[_0x1e4b94(0x223)],'resolved':_0x300d9d[_0x1e4b94(0x222)]===I[_0x1e4b94(0x23a)],'unitId':_0x1645fb,'subUnitId':_0x3e6823,'text':JSON[_0x1e4b94(0x216)](_0x1fe7c3['content']),'parentId':_0x22b6aa}),_0x25549e=_0x2be729(_0x300d9d['replies'][0x0]);return{..._0x25549e,'children':_0x300d9d['replies']['slice'](0x1)[_0x1e4b94(0x1e9)](_0x42081c=>_0x2be729(_0x42081c,_0x25549e['id']))};}return null;}let f=class{constructor(_0x2973e1,_0x4c581d,_0x4112ae,_0x3c713d){const _0x4f683f=_0x2069b1;this[_0x4f683f(0x21f)]=_0x2973e1,this[_0x4f683f(0x224)]=_0x4c581d,this[_0x4f683f(0x23f)]=_0x4112ae,this['_injector']=_0x3c713d;}async[_0x2069b1(0x1e8)](_0x57ba0c){const _0xc74b=_0x2069b1;var _0x260f16,_0x3aec62;const {parentId:_0x37b97d,unitId:_0x25ebf1,text:_0x5881ae,threadId:_0x208bba}=_0x57ba0c,_0x22a188=(_0x3aec62=(_0x260f16=_0x5881ae['customRanges'])==null?void 0x0:_0x260f16['filter'](_0x4cf826=>_0x4cf826['rangeType']===_0x20a37b[_0xc74b(0x1f4)])[_0xc74b(0x1e9)](_0x4947a6=>_0x4947a6[_0xc74b(0x205)]))!=null?_0x3aec62:[],_0x53dc8e=JSON['stringify'](_0x5881ae),_0x2893aa=(await this[_0xc74b(0x23f)][_0xc74b(0x1fc)](_0x25ebf1))[_0xc74b(0x23d)]();if(_0x37b97d){const _0x447f4c={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188,'threadId':_0x208bba},_0x8537e3=(await this[_0xc74b(0x21f)][_0xc74b(0x240)](_0xc74b(0x20b)+_0x25ebf1+_0xc74b(0x22f),{'body':_0x447f4c}))[_0xc74b(0x1eb)][_0xc74b(0x24a)];return{..._0x57ba0c,'id':_0x8537e3[_0xc74b(0x23e)],'dT':_0x3db8db(+_0x8537e3['createTimestamp'])[_0xc74b(0x210)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x8537e3['userId']};}else{const _0xbaf400={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188},_0x3beb00=await this[_0xc74b(0x21f)][_0xc74b(0x240)]('/universer-api/comment/unit/'+_0x25ebf1+_0xc74b(0x1f9),{'body':_0xbaf400});return X(_0x3beb00['body'][_0xc74b(0x200)],_0x57ba0c);}}async['updateComment'](_0x33469c){const _0x2bb8dd=_0x2069b1;var _0x57cd8f,_0x326866;const {text:_0x3d2d88,unitId:_0x484fbb}=_0x33469c,_0x23435a=(_0x326866=(_0x57cd8f=_0x3d2d88[_0x2bb8dd(0x1e7)])==null?void 0x0:_0x57cd8f[_0x2bb8dd(0x230)](_0x52c847=>_0x52c847[_0x2bb8dd(0x247)]===_0x20a37b['COMMENT'])[_0x2bb8dd(0x1e9)](_0x24efd7=>_0x24efd7['rangeId']))!=null?_0x326866:[],_0x136a5a=JSON[_0x2bb8dd(0x221)](_0x3d2d88),_0x161502=_0x33469c[_0x2bb8dd(0x233)],_0x100d9b=_0x33469c['id'],_0x504d21={'memberId':(await this[_0x2bb8dd(0x23f)][_0x2bb8dd(0x1fc)](_0x484fbb))['getMemberID'](),'unitId':_0x484fbb,'threadId':_0x161502,'mention':_0x23435a,'content':_0x136a5a,'replyId':_0x100d9b},_0x54da1f=await this[_0x2bb8dd(0x21f)][_0x2bb8dd(0x240)](_0x2bb8dd(0x20b)+_0x484fbb+_0x2bb8dd(0x22e),{'body':_0x504d21});return!_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)]||_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)][_0x2bb8dd(0x20a)]===0x1;}async[_0x2069b1(0x1f6)](_0x526be0){const _0x2c8d26=_0x2069b1,{unitId:_0x3222c2}=_0x526be0,_0x4d38e0=_0x526be0[_0x2c8d26(0x233)],_0x2d0a68={'memberId':this[_0x2c8d26(0x224)][_0x2c8d26(0x207)]()[_0x2c8d26(0x214)],'unitId':_0x3222c2,'threadId':_0x4d38e0,'solved':_0x526be0['resolved']?I['Solved']:I[_0x2c8d26(0x246)]},_0x36fd32=await this['_httpService'][_0x2c8d26(0x240)](_0x2c8d26(0x20b)+_0x3222c2+_0x2c8d26(0x225),{'body':_0x2d0a68});return!_0x36fd32[_0x2c8d26(0x1eb)]['error']||_0x36fd32[_0x2c8d26(0x1eb)][_0x2c8d26(0x1ef)][_0x2c8d26(0x20a)]===0x1;}async['deleteComment'](_0x23cc3f,_0x570924,_0x20daa7,_0x2c124e){const _0x5168ef=_0x2069b1,_0x406cea={'memberId':(await this[_0x5168ef(0x23f)][_0x5168ef(0x1fc)](_0x23cc3f))[_0x5168ef(0x23d)](),'threadId':_0x20daa7,'replyId':_0x2c124e,'unitId':_0x23cc3f},_0x575c63=await this[_0x5168ef(0x21f)]['post']('/universer-api/comment/unit/'+_0x23cc3f+_0x5168ef(0x20c),{'body':_0x406cea});return!_0x575c63['body'][_0x5168ef(0x1ef)]||_0x575c63[_0x5168ef(0x1eb)][_0x5168ef(0x1ef)]['code']===0x1;}async[_0x2069b1(0x203)](_0x5bf68c,_0x1da9d9,_0x13095e){const _0x5f1305=_0x2069b1,_0x917eb7={'unitId':_0x5bf68c,'threadId':_0x13095e},_0x1de068=await this[_0x5f1305(0x21f)][_0x5f1305(0x240)](_0x5f1305(0x20b)+_0x5bf68c+'/list',{'body':_0x917eb7}),_0x58a87f=_0x13095e['map'](_0x38c997=>ee(_0x1de068[_0x5f1305(0x1eb)]['comments'][_0x38c997],_0x5bf68c,_0x1da9d9))[_0x5f1305(0x230)](Boolean);return Object[_0x5f1305(0x1f5)](_0x1de068[_0x5f1305(0x1eb)][_0x5f1305(0x236)])[_0x5f1305(0x206)](_0x1a2e90=>{const _0x29c53b=_0x5f1305;this[_0x29c53b(0x224)][_0x29c53b(0x1fd)](_0x1a2e90);}),_0x58a87f;}[_0x2069b1(0x21e)](_0x5b685d){const _0x35c709=_0x2069b1;return{'id':_0x5b685d['id'],'threadId':_0x5b685d['threadId'],'ref':_0x5b685d[_0x35c709(0x1fa)]};}};f=Q([_(0x0,_0x29435d(_0x28bbac)),_(0x1,_0x29435d(_0x4a0daf)),_(0x2,_0x29435d(_0x497b32)),_(0x3,_0x29435d(_0x4a982a))],f);var re=Object[_0x2069b1(0x1f0)],te=(_0x53a279,_0x1e8bf8,_0x5da0b2,_0x41acd3)=>{const _0x4f0473=_0x2069b1;for(var _0x402979=_0x41acd3>0x1?void 0x0:_0x41acd3?re(_0x1e8bf8,_0x5da0b2):_0x1e8bf8,_0x8614a8=_0x53a279[_0x4f0473(0x243)]-0x1,_0x3993e3;_0x8614a8>=0x0;_0x8614a8--)(_0x3993e3=_0x53a279[_0x8614a8])&&(_0x402979=_0x3993e3(_0x402979)||_0x402979);return _0x402979;},N=(_0x3edf70,_0x404ed6)=>(_0x342394,_0x2ea15a)=>_0x404ed6(_0x342394,_0x2ea15a,_0x3edf70);let g=class extends _0xcf5e6a{constructor(_0x10394d,_0x3d1afd){const _0x31a5c4=_0x2069b1;super(),this[_0x31a5c4(0x1ea)]=_0x10394d,this[_0x31a5c4(0x23b)]=_0x3d1afd,this['_initDataSource']();}[_0x2069b1(0x218)](){const _0x3ee648=_0x2069b1;this['_threadCommentDataSourceService'][_0x3ee648(0x220)]=this['_threadCommentDataSource'],this[_0x3ee648(0x1ea)][_0x3ee648(0x248)]=!0x1;}};g=te([N(0x0,_0x50d99d),N(0x1,_0x29435d(f))],g);var se=Object[_0x2069b1(0x219)],oe=Object[_0x2069b1(0x1f0)],ne=(_0x145b1f,_0x1d1939,_0x483275)=>_0x1d1939 in _0x145b1f?se(_0x145b1f,_0x1d1939,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x483275}):_0x145b1f[_0x1d1939]=_0x483275,ie=(_0x5c0722,_0x1a2999,_0x186fe8,_0x27cb6)=>{for(var _0x23c14e=_0x27cb6>0x1?void 0x0:_0x27cb6?oe(_0x1a2999,_0x186fe8):_0x1a2999,_0x3aa58f=_0x5c0722['length']-0x1,_0x296568;_0x3aa58f>=0x0;_0x3aa58f--)(_0x296568=_0x5c0722[_0x3aa58f])&&(_0x23c14e=_0x296568(_0x23c14e)||_0x23c14e);return _0x23c14e;},w=(_0x9c69e8,_0x3e5640)=>(_0x5c9264,_0x5b91d0)=>_0x3e5640(_0x5c9264,_0x5b91d0,_0x9c69e8),$=(_0x1188fa,_0xecfa3c,_0x3f0e32)=>ne(_0x1188fa,typeof _0xecfa3c!=_0x2069b1(0x237)?_0xecfa3c+'':_0xecfa3c,_0x3f0e32);let b=class extends _0x336457{constructor(_0x5b7b71=M,_0x54a116,_0x232ede){const _0x4a7efd=_0x2069b1;super(),this[_0x4a7efd(0x1fe)]=_0x5b7b71,this['_injector']=_0x54a116,this[_0x4a7efd(0x227)]=_0x232ede;const {..._0x55939b}=_0x29ae8d({},M,this[_0x4a7efd(0x1fe)]);this[_0x4a7efd(0x227)][_0x4a7efd(0x228)](z,_0x55939b);}[_0x2069b1(0x1ee)](){[[f],[g],[S]]['forEach'](_0x53b308=>{const _0x125688=_0x43de;this[_0x125688(0x20e)]['add'](_0x53b308);});}['onReady'](){const _0x828de8=_0x2069b1;this['_injector'][_0x828de8(0x1f8)](g),this[_0x828de8(0x20e)][_0x828de8(0x1f8)](S);}};$(b,_0x2069b1(0x234),W),$(b,_0x2069b1(0x229),_0x388da4[_0x2069b1(0x1ff)]),b=ie([_0x4bdd65(_0x40bc7d,_0x293a48,_0x177d79),w(0x1,_0x29435d(_0x4a982a)),w(0x2,_0x10e4b8)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x597f96=_0x5f55;(function(_0x299bf7,_0x2b77b8){const _0x5b4259=_0x5f55,_0x21cc96=_0x299bf7();while(!![]){try{const _0x397444=parseInt(_0x5b4259(0x172))/0x1*(parseInt(_0x5b4259(0x16f))/0x2)+parseInt(_0x5b4259(0x194))/0x3*(-parseInt(_0x5b4259(0x17c))/0x4)+-parseInt(_0x5b4259(0x164))/0x5+parseInt(_0x5b4259(0x14b))/0x6*(parseInt(_0x5b4259(0x15b))/0x7)+-parseInt(_0x5b4259(0x16c))/0x8*(parseInt(_0x5b4259(0x16d))/0x9)+parseInt(_0x5b4259(0x186))/0xa*(parseInt(_0x5b4259(0x184))/0xb)+parseInt(_0x5b4259(0x19e))/0xc;if(_0x397444===_0x2b77b8)break;else _0x21cc96['push'](_0x21cc96['shift']());}catch(_0x418b09){_0x21cc96['push'](_0x21cc96['shift']());}}}(_0x35bf,0x23011));import{CommentService as _0x870a6e,CollaborationSessionService as _0x32baf8,UniverCollaborationClientPlugin as _0x53a35a}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x5b5c78}from'@univerjs-pro/license';import{dayjs as _0x3a4c00,UserManagerService as _0x5eb8f1,Inject as _0x3319bd,Injector as _0x2a9806,Disposable as _0x4b16b4,CustomRangeType as _0xc9d637,UniverInstanceType as _0x2a8601,DependentOn as _0x32eefa,IConfigService as _0x2dc9fb,Plugin as _0x2469e2,merge as _0x4f5a3a}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1d2348}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0xa098e9,IThreadCommentDataSourceService as _0x524bce}from'@univerjs/thread-comment';import{bufferTime as _0x55f664}from'rxjs';import{HTTPService as _0xeee792}from'@univerjs/network';function _0x35bf(){const _0x340636=['map','createTimestamp','_commentService','add','forEach','content','926710TcxCXI','user','getComment','_sessionService','get','/solved','post','code','48376uaZsJd','9EVZyoq','slice','183970KYbNiI','size','_userService','1PmjoYO','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/reply','COMMENT','delete','deleteComment','/list','stringify','customRanges','root','4aNwqoT','OpenOrReOpen','_config','comment','personId','error','getUnit','Reply','96613aFNbfN','Solve','20zmhijx','thread-comment-data-source.config','users','_threadCommentDataSource','parse','defineProperty','_initDataSource','addUser','userId','/universer-api/comment/unit/','disposeWithMe','type','/add','rangeId','127989fZcHHY','filter','listComments','format','_injector','_configService','Add','pipe','solved','replies','2375436jNmUbt','parentId','Delete','Edit','resolveComment','getMemberID','threadId','length','/delete','Unknown','userID','subscribe','_httpService','commentUpdate$','/edit','419550sMPSZJ','requireSession','resolved','UNRECOGNIZED','replyId','saveCommentToSnapshot','_threadCommentDataSourceService','body','_init','YYYY/MM/DD\x20HH:mm','setConfig','_threadCommentModel','symbol','Solved','values','getOwnPropertyDescriptor','7wjJgVf','unitId','_initUserSync'];_0x35bf=function(){return _0x340636;};return _0x35bf();}const W=_0x597f96(0x173);function _0x5f55(_0x4e0e0a,_0x7c0f12){const _0x35bfd2=_0x35bf();return _0x5f55=function(_0x5f554e,_0x4591eb){_0x5f554e=_0x5f554e-0x148;let _0x27154a=_0x35bfd2[_0x5f554e];return _0x27154a;},_0x5f55(_0x4e0e0a,_0x7c0f12);}var I=(_0xb883fe=>(_0xb883fe[_0xb883fe[_0x597f96(0x17d)]=0x0]=_0x597f96(0x17d),_0xb883fe[_0xb883fe[_0x597f96(0x158)]=0x1]=_0x597f96(0x158),_0xb883fe[_0xb883fe[_0x597f96(0x14e)]=-0x1]=_0x597f96(0x14e),_0xb883fe))(I||{}),v=(_0x1e09c6=>(_0x1e09c6[_0x1e09c6[_0x597f96(0x1a7)]=0x0]=_0x597f96(0x1a7),_0x1e09c6[_0x1e09c6[_0x597f96(0x19a)]=0x1]=_0x597f96(0x19a),_0x1e09c6[_0x1e09c6[_0x597f96(0x183)]=0x2]=_0x597f96(0x183),_0x1e09c6[_0x1e09c6[_0x597f96(0x1a1)]=0x3]=_0x597f96(0x1a1),_0x1e09c6[_0x1e09c6[_0x597f96(0x1a0)]=0x4]=_0x597f96(0x1a0),_0x1e09c6[_0x1e09c6['Solve']=0x5]=_0x597f96(0x185),_0x1e09c6[_0x1e09c6[_0x597f96(0x14e)]=-0x1]=_0x597f96(0x14e),_0x1e09c6))(v||{});const D=_0x3591a0=>_0x3a4c00(new Date(+_0x3591a0))[_0x597f96(0x197)](_0x597f96(0x154)),B=async(_0x42e457,_0x30674a)=>{const _0x473a52=_0x597f96,_0x5869a7=_0x42e457[_0x473a52(0x168)](_0x5eb8f1),_0x26300c=_0x42e457['get'](_0xeee792);_0x30674a[_0x473a52(0x162)](_0x5caa43=>{const _0x3829c8=_0x473a52;_0x5869a7['getUser'](_0x5caa43)&&_0x30674a[_0x3829c8(0x176)](_0x5caa43);}),_0x30674a[_0x473a52(0x170)]&&(await _0x26300c['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x30674a]}}))[_0x473a52(0x152)][_0x473a52(0x188)][_0x473a52(0x162)](_0x32b78c=>{const _0xc10422=_0x473a52;_0x32b78c&&_0x5869a7[_0xc10422(0x18d)](_0x32b78c);});};var K=Object[_0x597f96(0x15a)],V=(_0x285199,_0x568b53,_0x17f0ff,_0x62f402)=>{const _0x2f26d5=_0x597f96;for(var _0xd2c762=_0x62f402>0x1?void 0x0:_0x62f402?K(_0x568b53,_0x17f0ff):_0x568b53,_0x1e654d=_0x285199[_0x2f26d5(0x1a5)]-0x1,_0x4d2e64;_0x1e654d>=0x0;_0x1e654d--)(_0x4d2e64=_0x285199[_0x1e654d])&&(_0xd2c762=_0x4d2e64(_0xd2c762)||_0xd2c762);return _0xd2c762;},p=(_0x31ed3b,_0x137a6c)=>(_0x22ef5c,_0x58feb4)=>_0x137a6c(_0x22ef5c,_0x58feb4,_0x31ed3b);let S=class extends _0x4b16b4{constructor(_0x43c20b,_0xf30329,_0x6c99d3,_0x56d514){const _0x40841b=_0x597f96;super(),this[_0x40841b(0x160)]=_0x43c20b,this[_0x40841b(0x156)]=_0xf30329,this[_0x40841b(0x171)]=_0x6c99d3,this['_injector']=_0x56d514,this[_0x40841b(0x153)](),this[_0x40841b(0x15d)]();}[_0x597f96(0x15d)](){const _0xa79a10=_0x597f96;this[_0xa79a10(0x190)](this['_threadCommentModel']['commentUpdate$'][_0xa79a10(0x19b)](_0x55f664(0x10))[_0xa79a10(0x1a9)](_0x2f0b64=>{const _0x55dd1d=_0xa79a10,_0x10ddd1=new Set();_0x2f0b64['forEach'](_0x110dcf=>{const _0x3ac234=_0x5f55;switch(_0x110dcf[_0x3ac234(0x191)]){case'add':{const _0x499f8a=_0x110dcf['payload'][_0x3ac234(0x180)];_0x10ddd1[_0x3ac234(0x161)](_0x499f8a);break;}}}),B(this[_0x55dd1d(0x198)],_0x10ddd1);}));}[_0x597f96(0x153)](){const _0x3d182b=_0x597f96;this[_0x3d182b(0x190)](this[_0x3d182b(0x160)][_0x3d182b(0x149)][_0x3d182b(0x1a9)](async _0x16063c=>{const _0x144ffe=_0x3d182b;var _0x3ce913,_0x414d9f,_0x517bbb,_0x4c2310;const _0x127d08=(_0x3ce913=this['_threadCommentModel'][_0x144ffe(0x182)](_0x16063c['unitId'])['find'](_0x70efa8=>_0x70efa8['threadId']===_0x16063c['threadId']))==null?void 0x0:_0x3ce913['root'];if(!_0x127d08)return;const {unitId:_0x38dcef,subUnitId:_0x4519bc}=_0x127d08;switch(_0x16063c[_0x144ffe(0x165)]&&this['_userService'][_0x144ffe(0x18d)](_0x16063c[_0x144ffe(0x165)]),_0x16063c['type']){case v[_0x144ffe(0x19a)]:break;case v[_0x144ffe(0x183)]:{this[_0x144ffe(0x156)]['addComment'](_0x38dcef,_0x4519bc,{'unitId':_0x38dcef,'subUnitId':_0x4519bc,'ref':'','id':_0x16063c[_0x144ffe(0x14f)],'dT':D(+_0x16063c[_0x144ffe(0x15f)]),'threadId':_0x16063c['threadId'],'personId':(_0x517bbb=(_0x414d9f=_0x16063c['user'])==null?void 0x0:_0x414d9f[_0x144ffe(0x1a8)])!=null?_0x517bbb:_0x16063c[_0x144ffe(0x18e)],'text':JSON[_0x144ffe(0x18a)](_0x16063c[_0x144ffe(0x163)]),'parentId':_0x127d08['id']});break;}case v['Delete']:{const _0x3c14f8=this[_0x144ffe(0x156)][_0x144ffe(0x166)](_0x38dcef,_0x4519bc,_0x16063c[_0x144ffe(0x14f)]);_0x3c14f8&&_0x3c14f8[_0x144ffe(0x19f)]&&this['_threadCommentModel'][_0x144ffe(0x177)](_0x38dcef,_0x4519bc,_0x16063c[_0x144ffe(0x14f)]);break;}case v['Edit']:{this['_threadCommentModel']['updateComment'](_0x38dcef,_0x4519bc,{'commentId':_0x16063c['replyId'],'text':JSON['parse'](_0x16063c[_0x144ffe(0x163)])});break;}case v[_0x144ffe(0x185)]:{const _0x46e105=(_0x4c2310=this['_threadCommentModel'][_0x144ffe(0x182)](_0x16063c[_0x144ffe(0x15c)])['find'](_0x140f7e=>_0x140f7e[_0x144ffe(0x1a4)]===_0x16063c['threadId']))==null?void 0x0:_0x4c2310[_0x144ffe(0x17b)];_0x46e105&&this[_0x144ffe(0x156)]['resolveComment'](_0x38dcef,_0x4519bc,_0x46e105['id'],_0x16063c[_0x144ffe(0x19c)]===I[_0x144ffe(0x158)]);break;}}}));}};S=V([p(0x0,_0x3319bd(_0x870a6e)),p(0x1,_0x3319bd(_0xa098e9)),p(0x2,_0x3319bd(_0x5eb8f1)),p(0x3,_0x3319bd(_0x2a9806))],S);const z=_0x597f96(0x187),M={};var k=Object[_0x597f96(0x15a)],Q=(_0x10532d,_0x59c67e,_0x9c1fe6,_0x543e0b)=>{const _0x2a5bb0=_0x597f96;for(var _0x582c49=_0x543e0b>0x1?void 0x0:_0x543e0b?k(_0x59c67e,_0x9c1fe6):_0x59c67e,_0x52b088=_0x10532d[_0x2a5bb0(0x1a5)]-0x1,_0x558edf;_0x52b088>=0x0;_0x52b088--)(_0x558edf=_0x10532d[_0x52b088])&&(_0x582c49=_0x558edf(_0x582c49)||_0x582c49);return _0x582c49;},_=(_0xde9a76,_0x300404)=>(_0x2f5898,_0x226a7d)=>_0x300404(_0x2f5898,_0x226a7d,_0xde9a76);function X(_0xe3fd93,_0x5f0ac8){const _0x3a4758=_0x597f96,_0x212ad5=_0xe3fd93[_0x3a4758(0x19d)][0x0];return{..._0x5f0ac8,'id':_0x212ad5[_0x3a4758(0x14f)],'resolved':_0xe3fd93[_0x3a4758(0x19c)]===0x1,'dT':D(_0x212ad5[_0x3a4758(0x15f)]),'personId':_0x212ad5['userId'],'threadId':_0x212ad5['threadId']};}function ee(_0x18d791,_0x44d536,_0x55dc40){const _0x3aea06=_0x597f96;var _0x231397,_0x1c43da;if(((_0x1c43da=(_0x231397=_0x18d791==null?void 0x0:_0x18d791[_0x3aea06(0x19d)])==null?void 0x0:_0x231397[_0x3aea06(0x1a5)])!=null?_0x1c43da:0x0)>0x0){const _0x2d5661=(_0x4a6db1,_0xb98591)=>({'id':_0x4a6db1[_0x3aea06(0x14f)],'threadId':_0x4a6db1[_0x3aea06(0x1a4)],'dT':D(_0x4a6db1[_0x3aea06(0x15f)]),'personId':_0x4a6db1[_0x3aea06(0x18e)],'resolved':_0x18d791[_0x3aea06(0x19c)]===I[_0x3aea06(0x158)],'unitId':_0x44d536,'subUnitId':_0x55dc40,'text':JSON[_0x3aea06(0x18a)](_0x4a6db1[_0x3aea06(0x163)]),'parentId':_0xb98591}),_0x206aa8=_0x2d5661(_0x18d791[_0x3aea06(0x19d)][0x0]);return{..._0x206aa8,'children':_0x18d791[_0x3aea06(0x19d)][_0x3aea06(0x16e)](0x1)[_0x3aea06(0x15e)](_0x44bdf9=>_0x2d5661(_0x44bdf9,_0x206aa8['id']))};}return null;}let f=class{constructor(_0x30794d,_0x280658,_0x194daa,_0x463807){const _0x338733=_0x597f96;this[_0x338733(0x148)]=_0x30794d,this[_0x338733(0x171)]=_0x280658,this[_0x338733(0x167)]=_0x194daa,this['_injector']=_0x463807;}async['addComment'](_0x5d8f4d){const _0x2ac765=_0x597f96;var _0x3219c4,_0x3bdaca;const {parentId:_0x25d9dd,unitId:_0x5dcb58,text:_0x217d9b,threadId:_0x6f770b}=_0x5d8f4d,_0x2a4e4c=(_0x3bdaca=(_0x3219c4=_0x217d9b['customRanges'])==null?void 0x0:_0x3219c4[_0x2ac765(0x195)](_0x2872c9=>_0x2872c9['rangeType']===_0xc9d637[_0x2ac765(0x175)])[_0x2ac765(0x15e)](_0x427f35=>_0x427f35[_0x2ac765(0x193)]))!=null?_0x3bdaca:[],_0x11c187=JSON[_0x2ac765(0x179)](_0x217d9b),_0x6d173d=(await this[_0x2ac765(0x167)]['requireSession'](_0x5dcb58))[_0x2ac765(0x1a3)]();if(_0x25d9dd){const _0x4fb426={'memberId':_0x6d173d,'unitId':_0x5dcb58,'content':_0x11c187,'mention':_0x2a4e4c,'threadId':_0x6f770b},_0x4c0835=(await this[_0x2ac765(0x148)][_0x2ac765(0x16a)](_0x2ac765(0x18f)+_0x5dcb58+_0x2ac765(0x174),{'body':_0x4fb426}))['body']['reply'];return{..._0x5d8f4d,'id':_0x4c0835['replyId'],'dT':_0x3a4c00(+_0x4c0835[_0x2ac765(0x15f)])['format']('YYYY/MM/DD\x20HH:mm'),'personId':_0x4c0835[_0x2ac765(0x18e)]};}else{const _0x22181d={'memberId':_0x6d173d,'unitId':_0x5dcb58,'content':_0x11c187,'mention':_0x2a4e4c},_0xd465d5=await this[_0x2ac765(0x148)]['post'](_0x2ac765(0x18f)+_0x5dcb58+_0x2ac765(0x192),{'body':_0x22181d});return X(_0xd465d5['body'][_0x2ac765(0x17f)],_0x5d8f4d);}}async['updateComment'](_0x286a9b){const _0x420817=_0x597f96;var _0x34c9a7,_0x4b3f4e;const {text:_0x3a8bc7,unitId:_0x4aeadd}=_0x286a9b,_0x107907=(_0x4b3f4e=(_0x34c9a7=_0x3a8bc7[_0x420817(0x17a)])==null?void 0x0:_0x34c9a7['filter'](_0x21e0d0=>_0x21e0d0['rangeType']===_0xc9d637[_0x420817(0x175)])[_0x420817(0x15e)](_0x2f6d3a=>_0x2f6d3a[_0x420817(0x193)]))!=null?_0x4b3f4e:[],_0x517a57=JSON[_0x420817(0x179)](_0x3a8bc7),_0x12241f=_0x286a9b[_0x420817(0x1a4)],_0x3d6cb6=_0x286a9b['id'],_0x43f11f={'memberId':(await this[_0x420817(0x167)][_0x420817(0x14c)](_0x4aeadd))['getMemberID'](),'unitId':_0x4aeadd,'threadId':_0x12241f,'mention':_0x107907,'content':_0x517a57,'replyId':_0x3d6cb6},_0x10ae1d=await this[_0x420817(0x148)][_0x420817(0x16a)]('/universer-api/comment/unit/'+_0x4aeadd+_0x420817(0x14a),{'body':_0x43f11f});return!_0x10ae1d[_0x420817(0x152)]['error']||_0x10ae1d[_0x420817(0x152)][_0x420817(0x181)][_0x420817(0x16b)]===0x1;}async[_0x597f96(0x1a2)](_0x2cf37d){const _0x384a16=_0x597f96,{unitId:_0x483f2a}=_0x2cf37d,_0x10e469=_0x2cf37d[_0x384a16(0x1a4)],_0xec4560={'memberId':this[_0x384a16(0x171)]['getCurrentUser']()[_0x384a16(0x1a8)],'unitId':_0x483f2a,'threadId':_0x10e469,'solved':_0x2cf37d[_0x384a16(0x14d)]?I[_0x384a16(0x158)]:I[_0x384a16(0x17d)]},_0x4a6017=await this[_0x384a16(0x148)][_0x384a16(0x16a)](_0x384a16(0x18f)+_0x483f2a+_0x384a16(0x169),{'body':_0xec4560});return!_0x4a6017['body'][_0x384a16(0x181)]||_0x4a6017[_0x384a16(0x152)][_0x384a16(0x181)][_0x384a16(0x16b)]===0x1;}async['deleteComment'](_0x1fe00d,_0x33f6dd,_0x4f2c4c,_0x259f47){const _0x1536bb=_0x597f96,_0x2b3e31={'memberId':(await this['_sessionService']['requireSession'](_0x1fe00d))[_0x1536bb(0x1a3)](),'threadId':_0x4f2c4c,'replyId':_0x259f47,'unitId':_0x1fe00d},_0xbabc2=await this['_httpService'][_0x1536bb(0x16a)](_0x1536bb(0x18f)+_0x1fe00d+_0x1536bb(0x1a6),{'body':_0x2b3e31});return!_0xbabc2[_0x1536bb(0x152)][_0x1536bb(0x181)]||_0xbabc2[_0x1536bb(0x152)][_0x1536bb(0x181)][_0x1536bb(0x16b)]===0x1;}async[_0x597f96(0x196)](_0xa08590,_0x532cfe,_0x24b1c2){const _0x40a35f=_0x597f96,_0x4178d1={'unitId':_0xa08590,'threadId':_0x24b1c2},_0x261a59=await this['_httpService'][_0x40a35f(0x16a)](_0x40a35f(0x18f)+_0xa08590+_0x40a35f(0x178),{'body':_0x4178d1}),_0xe09690=_0x24b1c2[_0x40a35f(0x15e)](_0x54aeec=>ee(_0x261a59['body']['comments'][_0x54aeec],_0xa08590,_0x532cfe))[_0x40a35f(0x195)](Boolean);return Object[_0x40a35f(0x159)](_0x261a59[_0x40a35f(0x152)]['users'])['forEach'](_0xbfb615=>{const _0xc31d2d=_0x40a35f;this[_0xc31d2d(0x171)]['addUser'](_0xbfb615);}),_0xe09690;}[_0x597f96(0x150)](_0x70e505){const _0x1ef39f=_0x597f96;return{'id':_0x70e505['id'],'threadId':_0x70e505[_0x1ef39f(0x1a4)],'ref':_0x70e505['ref']};}};f=Q([_(0x0,_0x3319bd(_0xeee792)),_(0x1,_0x3319bd(_0x5eb8f1)),_(0x2,_0x3319bd(_0x32baf8)),_(0x3,_0x3319bd(_0x2a9806))],f);var re=Object[_0x597f96(0x15a)],te=(_0xda6ae8,_0xafc026,_0x6084be,_0x25b53e)=>{for(var _0x5a10cc=_0x25b53e>0x1?void 0x0:_0x25b53e?re(_0xafc026,_0x6084be):_0xafc026,_0xd1af38=_0xda6ae8['length']-0x1,_0x34b42d;_0xd1af38>=0x0;_0xd1af38--)(_0x34b42d=_0xda6ae8[_0xd1af38])&&(_0x5a10cc=_0x34b42d(_0x5a10cc)||_0x5a10cc);return _0x5a10cc;},N=(_0xaf04b8,_0x46ef6f)=>(_0x575db9,_0x160f09)=>_0x46ef6f(_0x575db9,_0x160f09,_0xaf04b8);let g=class extends _0x4b16b4{constructor(_0x696a20,_0x217382){const _0x55f272=_0x597f96;super(),this[_0x55f272(0x151)]=_0x696a20,this[_0x55f272(0x189)]=_0x217382,this[_0x55f272(0x18c)]();}[_0x597f96(0x18c)](){const _0x416c56=_0x597f96;this['_threadCommentDataSourceService']['dataSource']=this[_0x416c56(0x189)],this[_0x416c56(0x151)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x524bce),N(0x1,_0x3319bd(f))],g);var se=Object[_0x597f96(0x18b)],oe=Object[_0x597f96(0x15a)],ne=(_0x5a1a53,_0x2d9d4e,_0x2d07ec)=>_0x2d9d4e in _0x5a1a53?se(_0x5a1a53,_0x2d9d4e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2d07ec}):_0x5a1a53[_0x2d9d4e]=_0x2d07ec,ie=(_0x2ac3d0,_0x5935b3,_0x12851b,_0x1f4f36)=>{const _0x301a83=_0x597f96;for(var _0x3d8a92=_0x1f4f36>0x1?void 0x0:_0x1f4f36?oe(_0x5935b3,_0x12851b):_0x5935b3,_0x5b01e5=_0x2ac3d0[_0x301a83(0x1a5)]-0x1,_0x417de6;_0x5b01e5>=0x0;_0x5b01e5--)(_0x417de6=_0x2ac3d0[_0x5b01e5])&&(_0x3d8a92=_0x417de6(_0x3d8a92)||_0x3d8a92);return _0x3d8a92;},w=(_0x5f34b8,_0x2d1046)=>(_0x121a8e,_0x14767b)=>_0x2d1046(_0x121a8e,_0x14767b,_0x5f34b8),$=(_0x17e997,_0xd52f66,_0x17d923)=>ne(_0x17e997,typeof _0xd52f66!=_0x597f96(0x157)?_0xd52f66+'':_0xd52f66,_0x17d923);let b=class extends _0x2469e2{constructor(_0x5dd388=M,_0x32acef,_0xe35147){const _0xdb3830=_0x597f96;super(),this[_0xdb3830(0x17e)]=_0x5dd388,this['_injector']=_0x32acef,this[_0xdb3830(0x199)]=_0xe35147;const {..._0x3bc1f7}=_0x4f5a3a({},M,this[_0xdb3830(0x17e)]);this[_0xdb3830(0x199)][_0xdb3830(0x155)](z,_0x3bc1f7);}['onStarting'](){const _0xe0f8c=_0x597f96;[[f],[g],[S]][_0xe0f8c(0x162)](_0x35634b=>{const _0x522e91=_0xe0f8c;this['_injector'][_0x522e91(0x161)](_0x35634b);});}['onReady'](){const _0x43d2ea=_0x597f96;this[_0x43d2ea(0x198)]['get'](g),this[_0x43d2ea(0x198)][_0x43d2ea(0x168)](S);}};$(b,'pluginName',W),$(b,_0x597f96(0x191),_0x2a8601['UNIVER_UNKNOWN']),b=ie([_0x32eefa(_0x1d2348,_0x53a35a,_0x5b5c78),w(0x1,_0x3319bd(_0x2a9806)),w(0x2,_0x2dc9fb)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x583c(_0x448ca6,_0x43c3b5){const _0x4372d5=_0x4372();return _0x583c=function(_0x583cc9,_0x564864){_0x583cc9=_0x583cc9-0xe9;let _0x4b6854=_0x4372d5[_0x583cc9];return _0x4b6854;},_0x583c(_0x448ca6,_0x43c3b5);}function _0x4372(){const _0x17ea52=['replies','payload','Disposable','unitId','parse','addComment','Injector','onStarting','replyId','dataSource','ref','rangeType','5641480ODDsKa','_sessionService','OpenOrReOpen','Reply','addUser','_injector','426JrNbJl','thread-comment-data-source.config','YYYY/MM/DD\x20HH:mm','70eGtqvj','Solved','/universer-api/user/list','CustomRangeType','ThreadCommentModel','comments','2513vaCMhY','Solve','solved','@univerjs/core','_configService','UniverProLicense','/universer-api/comment/unit/','_initDataSource','getUnit','_userService','Add','Plugin','disposeWithMe','createTimestamp','4458FcyKrD','userId','4035361QwfyBM','dayjs','error','/delete','2087120AXdMEk','syncUpdateMutationToColla','post','UniverThreadCommentDataSourcePlugin','add','COMMENT','@univerjs/thread-comment','11478qqZZJE','delete','getUser','UNIVER_UNKNOWN','_httpService','format','pipe','object','/reply','toStringTag','_config','1570167vfSmmT','root','user','comment','updateComment','size','_commentService','customRanges','_threadCommentDataSource','IThreadCommentDataSourceService','Edit','content','@univerjs/thread-comment-ui','resolveComment','defineProperty','filter','/solved','Unknown','merge','@univerjs-pro/collaboration-client','getOwnPropertyDescriptor','stringify','commentUpdate$','DependentOn','8MrJhIq','find','personId','CollaborationSessionService','forEach','UNRECOGNIZED','@univerjs-pro/license','exports','_initUserSync','_init','/list','length','getMemberID','_threadCommentModel','478134deHNxF','body','_threadCommentDataSourceService','Delete','rangeId','getCurrentUser','UniverThreadCommentUIPlugin','values','code','UniverCore','reply','bufferTime','users','Module','UniverProThreadCommentDatasource','UniverInstanceType','map','deleteComment','IConfigService','UniverThreadCommentUi','function','threadId','UniverCollaborationClientPlugin','rxjs','HTTPService','Inject','get','requireSession','subscribe','parentId','@univerjs/network','UniverNetwork','/edit','userID','setConfig','UserManagerService'];_0x4372=function(){return _0x17ea52;};return _0x4372();}(function(_0x42e37a,_0x5b650d){const _0x2bf550=_0x583c,_0x316d48=_0x42e37a();while(!![]){try{const _0x27fa08=parseInt(_0x2bf550(0xf4))/0x1*(parseInt(_0x2bf550(0x10b))/0x2)+parseInt(_0x2bf550(0x149))/0x3+-parseInt(_0x2bf550(0x13b))/0x4*(-parseInt(_0x2bf550(0x111))/0x5)+parseInt(_0x2bf550(0x118))/0x6*(parseInt(_0x2bf550(0xfd))/0x7)+parseInt(_0x2bf550(0xee))/0x8+-parseInt(_0x2bf550(0x123))/0x9+parseInt(_0x2bf550(0xf7))/0xa*(-parseInt(_0x2bf550(0x10d))/0xb);if(_0x27fa08===_0x5b650d)break;else _0x316d48['push'](_0x316d48['shift']());}catch(_0x103e61){_0x316d48['push'](_0x316d48['shift']());}}}(_0x4372,0x90da0),function(_0x3712fb,_0xc64564){const _0x23e2e0=_0x583c;typeof exports==_0x23e2e0(0x11f)&&typeof module<'u'?_0xc64564(exports,require(_0x23e2e0(0x136)),require(_0x23e2e0(0x141)),require(_0x23e2e0(0x100)),require('@univerjs/thread-comment-ui'),require(_0x23e2e0(0x117)),require(_0x23e2e0(0x160)),require(_0x23e2e0(0x167))):typeof define==_0x23e2e0(0x15d)&&define['amd']?define([_0x23e2e0(0x142),_0x23e2e0(0x136),_0x23e2e0(0x141),_0x23e2e0(0x100),_0x23e2e0(0x12f),_0x23e2e0(0x117),_0x23e2e0(0x160),_0x23e2e0(0x167)],_0xc64564):(_0x3712fb=typeof globalThis<'u'?globalThis:_0x3712fb||self,_0xc64564(_0x3712fb[_0x23e2e0(0x157)]={},_0x3712fb['UniverProCollaborationClient'],_0x3712fb[_0x23e2e0(0x102)],_0x3712fb[_0x23e2e0(0x152)],_0x3712fb[_0x23e2e0(0x15c)],_0x3712fb['UniverThreadComment'],_0x3712fb[_0x23e2e0(0x160)],_0x3712fb[_0x23e2e0(0x168)]));}(this,function(_0x6a332c,_0x5ed8c0,_0x3750e3,_0x575f15,_0x4a658b,_0x254c84,_0x211f0d,_0x2daee6){'use strict';const _0x239848=_0x583c;const _0x5902bc='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x3af9f5=(_0x4a6fa3=>(_0x4a6fa3[_0x4a6fa3[_0x239848(0xf0)]=0x0]=_0x239848(0xf0),_0x4a6fa3[_0x4a6fa3['Solved']=0x1]=_0x239848(0xf8),_0x4a6fa3[_0x4a6fa3[_0x239848(0x140)]=-0x1]=_0x239848(0x140),_0x4a6fa3))(_0x3af9f5||{}),_0x1b4ca8=(_0x576bd7=>(_0x576bd7[_0x576bd7[_0x239848(0x134)]=0x0]=_0x239848(0x134),_0x576bd7[_0x576bd7[_0x239848(0x107)]=0x1]=_0x239848(0x107),_0x576bd7[_0x576bd7[_0x239848(0xf1)]=0x2]=_0x239848(0xf1),_0x576bd7[_0x576bd7[_0x239848(0x12d)]=0x3]=_0x239848(0x12d),_0x576bd7[_0x576bd7[_0x239848(0x14c)]=0x4]=_0x239848(0x14c),_0x576bd7[_0x576bd7[_0x239848(0xfe)]=0x5]=_0x239848(0xfe),_0x576bd7[_0x576bd7[_0x239848(0x140)]=-0x1]='UNRECOGNIZED',_0x576bd7))(_0x1b4ca8||{});const _0x1aed35=_0x3d6807=>_0x575f15[_0x239848(0x10e)](new Date(+_0x3d6807))[_0x239848(0x11d)](_0x239848(0xf6)),_0x24af04=async(_0x6d4a36,_0x1ced8e)=>{const _0x1527eb=_0x239848,_0x345032=_0x6d4a36['get'](_0x575f15[_0x1527eb(0x16c)]),_0x5f5452=_0x6d4a36[_0x1527eb(0x163)](_0x2daee6[_0x1527eb(0x161)]);_0x1ced8e[_0x1527eb(0x13f)](_0x3ad163=>{const _0x14d846=_0x1527eb;_0x345032[_0x14d846(0x11a)](_0x3ad163)&&_0x1ced8e[_0x14d846(0x119)](_0x3ad163);}),_0x1ced8e[_0x1527eb(0x128)]&&(await _0x5f5452[_0x1527eb(0x163)](_0x1527eb(0xf9),{'params':{'userIDs':[..._0x1ced8e]}}))[_0x1527eb(0x14a)][_0x1527eb(0x155)][_0x1527eb(0x13f)](_0x2c89ca=>{const _0x2e143e=_0x1527eb;_0x2c89ca&&_0x345032[_0x2e143e(0xf2)](_0x2c89ca);});};var _0x28c919=Object['getOwnPropertyDescriptor'],_0x4faf2b=(_0x3b0835,_0x2e6b16,_0x412557,_0x3f645b)=>{const _0x460452=_0x239848;for(var _0x3b7c8a=_0x3f645b>0x1?void 0x0:_0x3f645b?_0x28c919(_0x2e6b16,_0x412557):_0x2e6b16,_0x7c31a2=_0x3b0835[_0x460452(0x146)]-0x1,_0x4dc9c9;_0x7c31a2>=0x0;_0x7c31a2--)(_0x4dc9c9=_0x3b0835[_0x7c31a2])&&(_0x3b7c8a=_0x4dc9c9(_0x3b7c8a)||_0x3b7c8a);return _0x3b7c8a;},_0x28c0d4=(_0x4f852f,_0x48ebab)=>(_0x75d321,_0x9d5c6f)=>_0x48ebab(_0x75d321,_0x9d5c6f,_0x4f852f);let _0x2a7b45=class extends _0x575f15[_0x239848(0x16f)]{constructor(_0x2cbb2e,_0x4777c8,_0x41ba7a,_0x3dd1f9){const _0x535eda=_0x239848;super(),this[_0x535eda(0x129)]=_0x2cbb2e,this[_0x535eda(0x148)]=_0x4777c8,this['_userService']=_0x41ba7a,this[_0x535eda(0xf3)]=_0x3dd1f9,this['_init'](),this['_initUserSync']();}[_0x239848(0x143)](){const _0x4a2ca2=_0x239848;this[_0x4a2ca2(0x109)](this['_threadCommentModel'][_0x4a2ca2(0x139)][_0x4a2ca2(0x11e)](_0x211f0d[_0x4a2ca2(0x154)](0x10))[_0x4a2ca2(0x165)](_0x5c99da=>{const _0x308905=_0x4a2ca2,_0x5da793=new Set();_0x5c99da[_0x308905(0x13f)](_0x289e45=>{const _0x275902=_0x308905;switch(_0x289e45['type']){case'add':{const _0x4bb9cf=_0x289e45[_0x275902(0x16e)][_0x275902(0x13d)];_0x5da793[_0x275902(0x115)](_0x4bb9cf);break;}}}),_0x24af04(this[_0x308905(0xf3)],_0x5da793);}));}[_0x239848(0x144)](){const _0x132b08=_0x239848;this['disposeWithMe'](this[_0x132b08(0x129)]['commentUpdate$'][_0x132b08(0x165)](async _0x55c948=>{const _0x2c8dc8=_0x132b08;var _0x3e186c,_0x18a275,_0x246f5a,_0x14f9cf;const _0x3c8284=(_0x3e186c=this[_0x2c8dc8(0x148)][_0x2c8dc8(0x105)](_0x55c948[_0x2c8dc8(0x170)])[_0x2c8dc8(0x13c)](_0x53a8ab=>_0x53a8ab[_0x2c8dc8(0x15e)]===_0x55c948['threadId']))==null?void 0x0:_0x3e186c[_0x2c8dc8(0x124)];if(!_0x3c8284)return;const {unitId:_0x362d42,subUnitId:_0x61ac69}=_0x3c8284;switch(_0x55c948[_0x2c8dc8(0x125)]&&this[_0x2c8dc8(0x106)][_0x2c8dc8(0xf2)](_0x55c948[_0x2c8dc8(0x125)]),_0x55c948['type']){case _0x1b4ca8[_0x2c8dc8(0x107)]:break;case _0x1b4ca8[_0x2c8dc8(0xf1)]:{this[_0x2c8dc8(0x148)][_0x2c8dc8(0x172)](_0x362d42,_0x61ac69,{'unitId':_0x362d42,'subUnitId':_0x61ac69,'ref':'','id':_0x55c948[_0x2c8dc8(0xea)],'dT':_0x1aed35(+_0x55c948[_0x2c8dc8(0x10a)]),'threadId':_0x55c948['threadId'],'personId':(_0x246f5a=(_0x18a275=_0x55c948[_0x2c8dc8(0x125)])==null?void 0x0:_0x18a275[_0x2c8dc8(0x16a)])!=null?_0x246f5a:_0x55c948['userId'],'text':JSON[_0x2c8dc8(0x171)](_0x55c948['content']),'parentId':_0x3c8284['id']});break;}case _0x1b4ca8['Delete']:{const _0x30d789=this[_0x2c8dc8(0x148)]['getComment'](_0x362d42,_0x61ac69,_0x55c948['replyId']);_0x30d789&&_0x30d789[_0x2c8dc8(0x166)]&&this[_0x2c8dc8(0x148)][_0x2c8dc8(0x15a)](_0x362d42,_0x61ac69,_0x55c948['replyId']);break;}case _0x1b4ca8['Edit']:{this[_0x2c8dc8(0x148)][_0x2c8dc8(0x127)](_0x362d42,_0x61ac69,{'commentId':_0x55c948[_0x2c8dc8(0xea)],'text':JSON[_0x2c8dc8(0x171)](_0x55c948[_0x2c8dc8(0x12e)])});break;}case _0x1b4ca8[_0x2c8dc8(0xfe)]:{const _0x9f7010=(_0x14f9cf=this[_0x2c8dc8(0x148)][_0x2c8dc8(0x105)](_0x55c948[_0x2c8dc8(0x170)])['find'](_0x261594=>_0x261594['threadId']===_0x55c948[_0x2c8dc8(0x15e)]))==null?void 0x0:_0x14f9cf[_0x2c8dc8(0x124)];_0x9f7010&&this['_threadCommentModel']['resolveComment'](_0x362d42,_0x61ac69,_0x9f7010['id'],_0x55c948[_0x2c8dc8(0xff)]===_0x3af9f5['Solved']);break;}}}));}};_0x2a7b45=_0x4faf2b([_0x28c0d4(0x0,_0x575f15[_0x239848(0x162)](_0x5ed8c0['CommentService'])),_0x28c0d4(0x1,_0x575f15['Inject'](_0x254c84[_0x239848(0xfb)])),_0x28c0d4(0x2,_0x575f15[_0x239848(0x162)](_0x575f15[_0x239848(0x16c)])),_0x28c0d4(0x3,_0x575f15[_0x239848(0x162)](_0x575f15[_0x239848(0x173)]))],_0x2a7b45);const _0x5d5fcb=_0x239848(0xf5),_0x3c7908={};var _0x5e0987=Object[_0x239848(0x137)],_0x548227=(_0x230faf,_0x4b5bf2,_0x7fe616,_0x3fae5b)=>{for(var _0x58efa0=_0x3fae5b>0x1?void 0x0:_0x3fae5b?_0x5e0987(_0x4b5bf2,_0x7fe616):_0x4b5bf2,_0x1a2f57=_0x230faf['length']-0x1,_0x215b48;_0x1a2f57>=0x0;_0x1a2f57--)(_0x215b48=_0x230faf[_0x1a2f57])&&(_0x58efa0=_0x215b48(_0x58efa0)||_0x58efa0);return _0x58efa0;},_0x44d073=(_0x4386d7,_0x3d3d02)=>(_0x5cc2d9,_0x438af7)=>_0x3d3d02(_0x5cc2d9,_0x438af7,_0x4386d7);function _0x474a87(_0x556243,_0x9fe308){const _0x19290e=_0x239848,_0x582d55=_0x556243['replies'][0x0];return{..._0x9fe308,'id':_0x582d55[_0x19290e(0xea)],'resolved':_0x556243[_0x19290e(0xff)]===0x1,'dT':_0x1aed35(_0x582d55[_0x19290e(0x10a)]),'personId':_0x582d55[_0x19290e(0x10c)],'threadId':_0x582d55[_0x19290e(0x15e)]};}function _0xde0284(_0x77f13f,_0x102563,_0x46d7a7){const _0x3d9d4e=_0x239848;var _0x43ae80,_0x118c7d;if(((_0x118c7d=(_0x43ae80=_0x77f13f==null?void 0x0:_0x77f13f[_0x3d9d4e(0x16d)])==null?void 0x0:_0x43ae80[_0x3d9d4e(0x146)])!=null?_0x118c7d:0x0)>0x0){const _0x49eaf6=(_0x59c2e1,_0x21354a)=>({'id':_0x59c2e1[_0x3d9d4e(0xea)],'threadId':_0x59c2e1[_0x3d9d4e(0x15e)],'dT':_0x1aed35(_0x59c2e1[_0x3d9d4e(0x10a)]),'personId':_0x59c2e1['userId'],'resolved':_0x77f13f['solved']===_0x3af9f5[_0x3d9d4e(0xf8)],'unitId':_0x102563,'subUnitId':_0x46d7a7,'text':JSON['parse'](_0x59c2e1[_0x3d9d4e(0x12e)]),'parentId':_0x21354a}),_0x498fb9=_0x49eaf6(_0x77f13f[_0x3d9d4e(0x16d)][0x0]);return{..._0x498fb9,'children':_0x77f13f[_0x3d9d4e(0x16d)]['slice'](0x1)[_0x3d9d4e(0x159)](_0x2c317f=>_0x49eaf6(_0x2c317f,_0x498fb9['id']))};}return null;}let _0x3476f6=class{constructor(_0x43e627,_0x14173d,_0x328d92,_0x1c2fe7){const _0x36be8c=_0x239848;this[_0x36be8c(0x11c)]=_0x43e627,this[_0x36be8c(0x106)]=_0x14173d,this[_0x36be8c(0xef)]=_0x328d92,this[_0x36be8c(0xf3)]=_0x1c2fe7;}async[_0x239848(0x172)](_0x376dd5){const _0x487659=_0x239848;var _0x336521,_0x5bd9b2;const {parentId:_0x41e3f7,unitId:_0x245607,text:_0x5136b2,threadId:_0x14214e}=_0x376dd5,_0x112ef9=(_0x5bd9b2=(_0x336521=_0x5136b2[_0x487659(0x12a)])==null?void 0x0:_0x336521[_0x487659(0x132)](_0x3022a8=>_0x3022a8[_0x487659(0xed)]===_0x575f15[_0x487659(0xfa)][_0x487659(0x116)])[_0x487659(0x159)](_0x311131=>_0x311131[_0x487659(0x14d)]))!=null?_0x5bd9b2:[],_0x157c45=JSON['stringify'](_0x5136b2),_0x36d97a=(await this[_0x487659(0xef)][_0x487659(0x164)](_0x245607))[_0x487659(0x147)]();if(_0x41e3f7){const _0x2036a7={'memberId':_0x36d97a,'unitId':_0x245607,'content':_0x157c45,'mention':_0x112ef9,'threadId':_0x14214e},_0x5931f3=(await this[_0x487659(0x11c)][_0x487659(0x113)]('/universer-api/comment/unit/'+_0x245607+_0x487659(0x120),{'body':_0x2036a7}))[_0x487659(0x14a)][_0x487659(0x153)];return{..._0x376dd5,'id':_0x5931f3[_0x487659(0xea)],'dT':_0x575f15[_0x487659(0x10e)](+_0x5931f3['createTimestamp'])[_0x487659(0x11d)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x5931f3[_0x487659(0x10c)]};}else{const _0x6928ca={'memberId':_0x36d97a,'unitId':_0x245607,'content':_0x157c45,'mention':_0x112ef9},_0x3c9198=await this[_0x487659(0x11c)][_0x487659(0x113)](_0x487659(0x103)+_0x245607+'/add',{'body':_0x6928ca});return _0x474a87(_0x3c9198['body'][_0x487659(0x126)],_0x376dd5);}}async['updateComment'](_0x46aeb9){const _0x1f40ac=_0x239848;var _0x272c4f,_0x358791;const {text:_0x23420a,unitId:_0x552a69}=_0x46aeb9,_0x11c2a3=(_0x358791=(_0x272c4f=_0x23420a['customRanges'])==null?void 0x0:_0x272c4f[_0x1f40ac(0x132)](_0x305076=>_0x305076[_0x1f40ac(0xed)]===_0x575f15[_0x1f40ac(0xfa)][_0x1f40ac(0x116)])['map'](_0x5c2d8e=>_0x5c2d8e[_0x1f40ac(0x14d)]))!=null?_0x358791:[],_0x405748=JSON[_0x1f40ac(0x138)](_0x23420a),_0x98cbe1=_0x46aeb9['threadId'],_0x4793e5=_0x46aeb9['id'],_0x4a5dc7={'memberId':(await this[_0x1f40ac(0xef)][_0x1f40ac(0x164)](_0x552a69))[_0x1f40ac(0x147)](),'unitId':_0x552a69,'threadId':_0x98cbe1,'mention':_0x11c2a3,'content':_0x405748,'replyId':_0x4793e5},_0x144f91=await this[_0x1f40ac(0x11c)][_0x1f40ac(0x113)](_0x1f40ac(0x103)+_0x552a69+_0x1f40ac(0x169),{'body':_0x4a5dc7});return!_0x144f91[_0x1f40ac(0x14a)]['error']||_0x144f91[_0x1f40ac(0x14a)]['error'][_0x1f40ac(0x151)]===0x1;}async[_0x239848(0x130)](_0xd52baa){const _0x305033=_0x239848,{unitId:_0x33eab6}=_0xd52baa,_0x4a7e29=_0xd52baa[_0x305033(0x15e)],_0x15d8b1={'memberId':this[_0x305033(0x106)][_0x305033(0x14e)]()[_0x305033(0x16a)],'unitId':_0x33eab6,'threadId':_0x4a7e29,'solved':_0xd52baa['resolved']?_0x3af9f5[_0x305033(0xf8)]:_0x3af9f5[_0x305033(0xf0)]},_0x5b51e2=await this[_0x305033(0x11c)][_0x305033(0x113)](_0x305033(0x103)+_0x33eab6+_0x305033(0x133),{'body':_0x15d8b1});return!_0x5b51e2[_0x305033(0x14a)][_0x305033(0x10f)]||_0x5b51e2[_0x305033(0x14a)][_0x305033(0x10f)][_0x305033(0x151)]===0x1;}async[_0x239848(0x15a)](_0x55e9c7,_0xa77323,_0x4babf3,_0x14157c){const _0x2bb11a=_0x239848,_0x456b3b={'memberId':(await this['_sessionService'][_0x2bb11a(0x164)](_0x55e9c7))[_0x2bb11a(0x147)](),'threadId':_0x4babf3,'replyId':_0x14157c,'unitId':_0x55e9c7},_0x303020=await this[_0x2bb11a(0x11c)][_0x2bb11a(0x113)]('/universer-api/comment/unit/'+_0x55e9c7+_0x2bb11a(0x110),{'body':_0x456b3b});return!_0x303020[_0x2bb11a(0x14a)][_0x2bb11a(0x10f)]||_0x303020[_0x2bb11a(0x14a)][_0x2bb11a(0x10f)]['code']===0x1;}async['listComments'](_0x5baf61,_0x1bdb8b,_0x4be464){const _0x5116bb=_0x239848,_0x40396f={'unitId':_0x5baf61,'threadId':_0x4be464},_0x2f50c6=await this[_0x5116bb(0x11c)][_0x5116bb(0x113)]('/universer-api/comment/unit/'+_0x5baf61+_0x5116bb(0x145),{'body':_0x40396f}),_0x23179a=_0x4be464['map'](_0x1a8042=>_0xde0284(_0x2f50c6[_0x5116bb(0x14a)][_0x5116bb(0xfc)][_0x1a8042],_0x5baf61,_0x1bdb8b))['filter'](Boolean);return Object[_0x5116bb(0x150)](_0x2f50c6[_0x5116bb(0x14a)][_0x5116bb(0x155)])['forEach'](_0xc4978b=>{const _0x350a23=_0x5116bb;this[_0x350a23(0x106)][_0x350a23(0xf2)](_0xc4978b);}),_0x23179a;}['saveCommentToSnapshot'](_0x60b7c){const _0x1a44e9=_0x239848;return{'id':_0x60b7c['id'],'threadId':_0x60b7c[_0x1a44e9(0x15e)],'ref':_0x60b7c[_0x1a44e9(0xec)]};}};_0x3476f6=_0x548227([_0x44d073(0x0,_0x575f15[_0x239848(0x162)](_0x2daee6[_0x239848(0x161)])),_0x44d073(0x1,_0x575f15[_0x239848(0x162)](_0x575f15[_0x239848(0x16c)])),_0x44d073(0x2,_0x575f15[_0x239848(0x162)](_0x5ed8c0[_0x239848(0x13e)])),_0x44d073(0x3,_0x575f15['Inject'](_0x575f15[_0x239848(0x173)]))],_0x3476f6);var _0x1490a1=Object[_0x239848(0x137)],_0x84035a=(_0x3d2720,_0x3a949b,_0x54a797,_0x1712d2)=>{const _0x4a753e=_0x239848;for(var _0x24cf1c=_0x1712d2>0x1?void 0x0:_0x1712d2?_0x1490a1(_0x3a949b,_0x54a797):_0x3a949b,_0x5118a8=_0x3d2720[_0x4a753e(0x146)]-0x1,_0x1bb2d2;_0x5118a8>=0x0;_0x5118a8--)(_0x1bb2d2=_0x3d2720[_0x5118a8])&&(_0x24cf1c=_0x1bb2d2(_0x24cf1c)||_0x24cf1c);return _0x24cf1c;},_0x2bf312=(_0x8c54c4,_0x5d9bb1)=>(_0x52d04c,_0x2f17e9)=>_0x5d9bb1(_0x52d04c,_0x2f17e9,_0x8c54c4);let _0x24dbfc=class extends _0x575f15[_0x239848(0x16f)]{constructor(_0x1f0cdd,_0x544a83){const _0x24df9e=_0x239848;super(),this['_threadCommentDataSourceService']=_0x1f0cdd,this['_threadCommentDataSource']=_0x544a83,this[_0x24df9e(0x104)]();}[_0x239848(0x104)](){const _0xba6664=_0x239848;this[_0xba6664(0x14b)][_0xba6664(0xeb)]=this[_0xba6664(0x12b)],this[_0xba6664(0x14b)][_0xba6664(0x112)]=!0x1;}};_0x24dbfc=_0x84035a([_0x2bf312(0x0,_0x254c84[_0x239848(0x12c)]),_0x2bf312(0x1,_0x575f15['Inject'](_0x3476f6))],_0x24dbfc);var _0x17f487=Object[_0x239848(0x131)],_0xe44086=Object[_0x239848(0x137)],_0x261cdc=(_0x4d6a2c,_0x55f7b5,_0x246ac7)=>_0x55f7b5 in _0x4d6a2c?_0x17f487(_0x4d6a2c,_0x55f7b5,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x246ac7}):_0x4d6a2c[_0x55f7b5]=_0x246ac7,_0x124413=(_0x24d9c9,_0x3773e1,_0x2b77c5,_0x5227b5)=>{const _0x16b290=_0x239848;for(var _0x1e1512=_0x5227b5>0x1?void 0x0:_0x5227b5?_0xe44086(_0x3773e1,_0x2b77c5):_0x3773e1,_0x38017b=_0x24d9c9[_0x16b290(0x146)]-0x1,_0x11d34f;_0x38017b>=0x0;_0x38017b--)(_0x11d34f=_0x24d9c9[_0x38017b])&&(_0x1e1512=_0x11d34f(_0x1e1512)||_0x1e1512);return _0x1e1512;},_0x15bec8=(_0x18d74d,_0x379dff)=>(_0x2a84dc,_0x3a3db4)=>_0x379dff(_0x2a84dc,_0x3a3db4,_0x18d74d),_0x13025c=(_0xea726c,_0x5cd399,_0x257adb)=>_0x261cdc(_0xea726c,typeof _0x5cd399!='symbol'?_0x5cd399+'':_0x5cd399,_0x257adb);_0x6a332c[_0x239848(0x114)]=class extends _0x575f15[_0x239848(0x108)]{constructor(_0x6eaf9c=_0x3c7908,_0x513f2b,_0x25107a){const _0xea7218=_0x239848;super(),this[_0xea7218(0x122)]=_0x6eaf9c,this[_0xea7218(0xf3)]=_0x513f2b,this[_0xea7218(0x101)]=_0x25107a;const {..._0x2477b0}=_0x575f15[_0xea7218(0x135)]({},_0x3c7908,this[_0xea7218(0x122)]);this[_0xea7218(0x101)][_0xea7218(0x16b)](_0x5d5fcb,_0x2477b0);}[_0x239848(0xe9)](){const _0x4aba69=_0x239848;[[_0x3476f6],[_0x24dbfc],[_0x2a7b45]][_0x4aba69(0x13f)](_0x38a5db=>{const _0x21eb6b=_0x4aba69;this['_injector'][_0x21eb6b(0x115)](_0x38a5db);});}['onReady'](){const _0x5c4dfb=_0x239848;this[_0x5c4dfb(0xf3)][_0x5c4dfb(0x163)](_0x24dbfc),this['_injector'][_0x5c4dfb(0x163)](_0x2a7b45);}},_0x13025c(_0x6a332c[_0x239848(0x114)],'pluginName',_0x5902bc),_0x13025c(_0x6a332c[_0x239848(0x114)],'type',_0x575f15[_0x239848(0x158)][_0x239848(0x11b)]),_0x6a332c[_0x239848(0x114)]=_0x124413([_0x575f15[_0x239848(0x13a)](_0x4a658b[_0x239848(0x14f)],_0x5ed8c0[_0x239848(0x15f)],_0x3750e3['UniverLicensePlugin']),_0x15bec8(0x1,_0x575f15['Inject'](_0x575f15['Injector'])),_0x15bec8(0x2,_0x575f15[_0x239848(0x15b)])],_0x6a332c[_0x239848(0x114)]),Object[_0x239848(0x131)](_0x6a332c,Symbol[_0x239848(0x121)],{'value':_0x239848(0x156)});}));
|
|
1
|
+
function _0x3f16(){const _0x533f13=['add','error','ThreadCommentModel','87584HUhFhV','symbol','_httpService','Module','parentId','Reply','post','rangeType','deleteComment','1365480RVqRuJ','@univerjs-pro/collaboration-client','UniverInstanceType','HTTPService','_injector','getUnit','onReady','root','_threadCommentDataSource','code','UniverThreadCommentUi','updateComment','function','232508SapGpd','DependentOn','listComments','/reply','_commentService','/solved','addComment','forEach','getUser','@univerjs/network','comments','body','length','size','dayjs','addUser','UniverProCollaborationClient','CollaborationSessionService','defineProperty','UniverNetwork','ref','requireSession','commentUpdate$','createTimestamp','995547YZsnWG','Inject','filter','_threadCommentDataSourceService','replies','81xDmrgV','@univerjs/core','resolved','Solved','customRanges','3WWqiKj','getCurrentUser','Plugin','rxjs','UniverProLicense','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','bufferTime','getMemberID','COMMENT','_userService','exports','Delete','personId','find','UniverProThreadCommentDatasource','slice','values','Add','threadId','CommentService','UNRECOGNIZED','userId','comment','Unknown','solved','5YYHDJh','amd','_sessionService','subscribe','map','OpenOrReOpen','780968YRzPcN','unitId','rangeId','_configService','_init','getOwnPropertyDescriptor','setConfig','/universer-api/comment/unit/','_config','UniverLicensePlugin','Disposable','onStarting','CustomRangeType','format','disposeWithMe','replyId','Injector','/edit','type','/delete','_initUserSync','object','users','user','stringify','UniverThreadCommentDataSourcePlugin','pluginName','Solve','merge','/list','syncUpdateMutationToColla','content','928506spmift','UNIVER_UNKNOWN','57104OAPFPZ','userID','parse','dataSource','thread-comment-data-source.config','@univerjs/thread-comment-ui','get','/universer-api/user/list','UserManagerService','_threadCommentModel','Edit','YYYY/MM/DD\x20HH:mm','reply'];_0x3f16=function(){return _0x533f13;};return _0x3f16();}function _0x1b41(_0x379ebb,_0x52d64b){const _0x3f1671=_0x3f16();return _0x1b41=function(_0x1b41a7,_0x54ffd4){_0x1b41a7=_0x1b41a7-0x1b7;let _0x5826e8=_0x3f1671[_0x1b41a7];return _0x5826e8;},_0x1b41(_0x379ebb,_0x52d64b);}(function(_0x585621,_0x29707e){const _0x59cb97=_0x1b41,_0x36dc0d=_0x585621();while(!![]){try{const _0x423c35=parseInt(_0x59cb97(0x218))/0x1+parseInt(_0x59cb97(0x22e))/0x2*(parseInt(_0x59cb97(0x1c7))/0x3)+-parseInt(_0x59cb97(0x1e6))/0x4+-parseInt(_0x59cb97(0x1e0))/0x5*(-parseInt(_0x59cb97(0x206))/0x6)+parseInt(_0x59cb97(0x1bd))/0x7+parseInt(_0x59cb97(0x208))/0x8*(-parseInt(_0x59cb97(0x1c2))/0x9)+-parseInt(_0x59cb97(0x221))/0xa;if(_0x423c35===_0x29707e)break;else _0x36dc0d['push'](_0x36dc0d['shift']());}catch(_0x3e592c){_0x36dc0d['push'](_0x36dc0d['shift']());}}}(_0x3f16,0x1994a),function(_0x3f16f6,_0x290e1d){const _0x4465f7=_0x1b41;typeof exports==_0x4465f7(0x1fb)&&typeof module<'u'?_0x290e1d(exports,require(_0x4465f7(0x222)),require('@univerjs-pro/license'),require(_0x4465f7(0x1c3)),require('@univerjs/thread-comment-ui'),require('@univerjs/thread-comment'),require(_0x4465f7(0x1ca)),require(_0x4465f7(0x237))):typeof define==_0x4465f7(0x22d)&&define[_0x4465f7(0x1e1)]?define([_0x4465f7(0x1d1),_0x4465f7(0x222),'@univerjs-pro/license',_0x4465f7(0x1c3),_0x4465f7(0x20d),'@univerjs/thread-comment',_0x4465f7(0x1ca),'@univerjs/network'],_0x290e1d):(_0x3f16f6=typeof globalThis<'u'?globalThis:_0x3f16f6||self,_0x290e1d(_0x3f16f6[_0x4465f7(0x1d5)]={},_0x3f16f6[_0x4465f7(0x23e)],_0x3f16f6[_0x4465f7(0x1cb)],_0x3f16f6['UniverCore'],_0x3f16f6[_0x4465f7(0x22b)],_0x3f16f6['UniverThreadComment'],_0x3f16f6['rxjs'],_0x3f16f6[_0x4465f7(0x1b8)]));}(this,function(_0x24ed3d,_0x4b6958,_0x4a61dd,_0x8ba108,_0x56d5d9,_0x47d0a6,_0x39e82a,_0x50014d){'use strict';const _0xd9dc20=_0x1b41;const _0x299ca5=_0xd9dc20(0x1cc);var _0x527132=(_0x8292e0=>(_0x8292e0[_0x8292e0['OpenOrReOpen']=0x0]=_0xd9dc20(0x1e5),_0x8292e0[_0x8292e0[_0xd9dc20(0x1c5)]=0x1]=_0xd9dc20(0x1c5),_0x8292e0[_0x8292e0['UNRECOGNIZED']=-0x1]=_0xd9dc20(0x1db),_0x8292e0))(_0x527132||{}),_0x1ab4b5=(_0x22f7ef=>(_0x22f7ef[_0x22f7ef['Unknown']=0x0]=_0xd9dc20(0x1de),_0x22f7ef[_0x22f7ef[_0xd9dc20(0x1d8)]=0x1]='Add',_0x22f7ef[_0x22f7ef[_0xd9dc20(0x21d)]=0x2]='Reply',_0x22f7ef[_0x22f7ef[_0xd9dc20(0x212)]=0x3]=_0xd9dc20(0x212),_0x22f7ef[_0x22f7ef[_0xd9dc20(0x1d2)]=0x4]='Delete',_0x22f7ef[_0x22f7ef[_0xd9dc20(0x201)]=0x5]=_0xd9dc20(0x201),_0x22f7ef[_0x22f7ef[_0xd9dc20(0x1db)]=-0x1]=_0xd9dc20(0x1db),_0x22f7ef))(_0x1ab4b5||{});const _0x19b69f=_0x2f4cae=>_0x8ba108[_0xd9dc20(0x23c)](new Date(+_0x2f4cae))[_0xd9dc20(0x1f3)](_0xd9dc20(0x213)),_0x36a832=async(_0x5e7c4d,_0x5b1517)=>{const _0x395be8=_0xd9dc20,_0x4229e1=_0x5e7c4d[_0x395be8(0x20e)](_0x8ba108['UserManagerService']),_0x5ac6e9=_0x5e7c4d[_0x395be8(0x20e)](_0x50014d[_0x395be8(0x224)]);_0x5b1517[_0x395be8(0x235)](_0x4a8641=>{const _0x419481=_0x395be8;_0x4229e1[_0x419481(0x236)](_0x4a8641)&&_0x5b1517['delete'](_0x4a8641);}),_0x5b1517[_0x395be8(0x23b)]&&(await _0x5ac6e9['get'](_0x395be8(0x20f),{'params':{'userIDs':[..._0x5b1517]}}))[_0x395be8(0x239)][_0x395be8(0x1fc)]['forEach'](_0x558660=>{const _0x129931=_0x395be8;_0x558660&&_0x4229e1[_0x129931(0x23d)](_0x558660);});};var _0xe1934b=Object['getOwnPropertyDescriptor'],_0x2801e3=(_0x58b446,_0x3732db,_0x4204c1,_0x41e259)=>{const _0x1edf36=_0xd9dc20;for(var _0xb60792=_0x41e259>0x1?void 0x0:_0x41e259?_0xe1934b(_0x3732db,_0x4204c1):_0x3732db,_0x39bf7d=_0x58b446[_0x1edf36(0x23a)]-0x1,_0x43f59f;_0x39bf7d>=0x0;_0x39bf7d--)(_0x43f59f=_0x58b446[_0x39bf7d])&&(_0xb60792=_0x43f59f(_0xb60792)||_0xb60792);return _0xb60792;},_0x46d7c4=(_0x544d68,_0x2d9244)=>(_0x26664a,_0x2618ec)=>_0x2d9244(_0x26664a,_0x2618ec,_0x544d68);let _0x257958=class extends _0x8ba108['Disposable']{constructor(_0x3d3cea,_0x443e0d,_0x4dadf9,_0x5f5725){const _0x27717d=_0xd9dc20;super(),this[_0x27717d(0x232)]=_0x3d3cea,this[_0x27717d(0x211)]=_0x443e0d,this['_userService']=_0x4dadf9,this[_0x27717d(0x225)]=_0x5f5725,this['_init'](),this['_initUserSync']();}[_0xd9dc20(0x1fa)](){const _0x32dd7a=_0xd9dc20;this['disposeWithMe'](this['_threadCommentModel'][_0x32dd7a(0x1bb)]['pipe'](_0x39e82a[_0x32dd7a(0x1cd)](0x10))[_0x32dd7a(0x1e3)](_0x19b19b=>{const _0x58c893=_0x32dd7a,_0x5f1b95=new Set();_0x19b19b['forEach'](_0x57da52=>{const _0x39a007=_0x1b41;switch(_0x57da52['type']){case _0x39a007(0x215):{const _0x1c3733=_0x57da52['payload'][_0x39a007(0x1d3)];_0x5f1b95['add'](_0x1c3733);break;}}}),_0x36a832(this[_0x58c893(0x225)],_0x5f1b95);}));}[_0xd9dc20(0x1ea)](){const _0x2c8c79=_0xd9dc20;this[_0x2c8c79(0x1f4)](this[_0x2c8c79(0x232)][_0x2c8c79(0x1bb)]['subscribe'](async _0x28c715=>{const _0x179b25=_0x2c8c79;var _0x841773,_0x24c0af,_0x4f0f7b,_0x21afd1;const _0xc1bf97=(_0x841773=this[_0x179b25(0x211)][_0x179b25(0x226)](_0x28c715[_0x179b25(0x1e7)])[_0x179b25(0x1d4)](_0xab4354=>_0xab4354[_0x179b25(0x1d9)]===_0x28c715[_0x179b25(0x1d9)]))==null?void 0x0:_0x841773['root'];if(!_0xc1bf97)return;const {unitId:_0x3f8a30,subUnitId:_0x433acd}=_0xc1bf97;switch(_0x28c715[_0x179b25(0x1fd)]&&this[_0x179b25(0x1d0)][_0x179b25(0x23d)](_0x28c715[_0x179b25(0x1fd)]),_0x28c715['type']){case _0x1ab4b5[_0x179b25(0x1d8)]:break;case _0x1ab4b5['Reply']:{this[_0x179b25(0x211)][_0x179b25(0x234)](_0x3f8a30,_0x433acd,{'unitId':_0x3f8a30,'subUnitId':_0x433acd,'ref':'','id':_0x28c715[_0x179b25(0x1f5)],'dT':_0x19b69f(+_0x28c715[_0x179b25(0x1bc)]),'threadId':_0x28c715['threadId'],'personId':(_0x4f0f7b=(_0x24c0af=_0x28c715[_0x179b25(0x1fd)])==null?void 0x0:_0x24c0af[_0x179b25(0x209)])!=null?_0x4f0f7b:_0x28c715[_0x179b25(0x1dc)],'text':JSON['parse'](_0x28c715[_0x179b25(0x205)]),'parentId':_0xc1bf97['id']});break;}case _0x1ab4b5[_0x179b25(0x1d2)]:{const _0x57d38c=this['_threadCommentModel']['getComment'](_0x3f8a30,_0x433acd,_0x28c715['replyId']);_0x57d38c&&_0x57d38c[_0x179b25(0x21c)]&&this['_threadCommentModel'][_0x179b25(0x220)](_0x3f8a30,_0x433acd,_0x28c715[_0x179b25(0x1f5)]);break;}case _0x1ab4b5['Edit']:{this[_0x179b25(0x211)][_0x179b25(0x22c)](_0x3f8a30,_0x433acd,{'commentId':_0x28c715[_0x179b25(0x1f5)],'text':JSON[_0x179b25(0x20a)](_0x28c715[_0x179b25(0x205)])});break;}case _0x1ab4b5[_0x179b25(0x201)]:{const _0x969f8d=(_0x21afd1=this[_0x179b25(0x211)][_0x179b25(0x226)](_0x28c715[_0x179b25(0x1e7)])[_0x179b25(0x1d4)](_0x19c65b=>_0x19c65b[_0x179b25(0x1d9)]===_0x28c715[_0x179b25(0x1d9)]))==null?void 0x0:_0x21afd1[_0x179b25(0x228)];_0x969f8d&&this[_0x179b25(0x211)]['resolveComment'](_0x3f8a30,_0x433acd,_0x969f8d['id'],_0x28c715['solved']===_0x527132[_0x179b25(0x1c5)]);break;}}}));}};_0x257958=_0x2801e3([_0x46d7c4(0x0,_0x8ba108[_0xd9dc20(0x1be)](_0x4b6958[_0xd9dc20(0x1da)])),_0x46d7c4(0x1,_0x8ba108[_0xd9dc20(0x1be)](_0x47d0a6[_0xd9dc20(0x217)])),_0x46d7c4(0x2,_0x8ba108[_0xd9dc20(0x1be)](_0x8ba108[_0xd9dc20(0x210)])),_0x46d7c4(0x3,_0x8ba108[_0xd9dc20(0x1be)](_0x8ba108[_0xd9dc20(0x1f6)]))],_0x257958);const _0x5963a3=_0xd9dc20(0x20c),_0x1ebfe0={};var _0x3e93cd=Object[_0xd9dc20(0x1eb)],_0x20ec76=(_0x3625dd,_0x5f48f5,_0x563321,_0x1c2b44)=>{for(var _0x55c0a9=_0x1c2b44>0x1?void 0x0:_0x1c2b44?_0x3e93cd(_0x5f48f5,_0x563321):_0x5f48f5,_0x238d0d=_0x3625dd['length']-0x1,_0x522b42;_0x238d0d>=0x0;_0x238d0d--)(_0x522b42=_0x3625dd[_0x238d0d])&&(_0x55c0a9=_0x522b42(_0x55c0a9)||_0x55c0a9);return _0x55c0a9;},_0x50759f=(_0x2c26ad,_0x2a780f)=>(_0x5d51d3,_0x4ff7b2)=>_0x2a780f(_0x5d51d3,_0x4ff7b2,_0x2c26ad);function _0x4cc20f(_0x39220e,_0x502e8e){const _0x3eff86=_0xd9dc20,_0xc14e70=_0x39220e[_0x3eff86(0x1c1)][0x0];return{..._0x502e8e,'id':_0xc14e70[_0x3eff86(0x1f5)],'resolved':_0x39220e[_0x3eff86(0x1df)]===0x1,'dT':_0x19b69f(_0xc14e70[_0x3eff86(0x1bc)]),'personId':_0xc14e70['userId'],'threadId':_0xc14e70[_0x3eff86(0x1d9)]};}function _0xd260ef(_0x1484f3,_0x1523d3,_0x3f0219){const _0x38ea1e=_0xd9dc20;var _0x4ab1d0,_0x26b215;if(((_0x26b215=(_0x4ab1d0=_0x1484f3==null?void 0x0:_0x1484f3[_0x38ea1e(0x1c1)])==null?void 0x0:_0x4ab1d0[_0x38ea1e(0x23a)])!=null?_0x26b215:0x0)>0x0){const _0x24602e=(_0x1a45f1,_0x63a4c7)=>({'id':_0x1a45f1['replyId'],'threadId':_0x1a45f1[_0x38ea1e(0x1d9)],'dT':_0x19b69f(_0x1a45f1[_0x38ea1e(0x1bc)]),'personId':_0x1a45f1[_0x38ea1e(0x1dc)],'resolved':_0x1484f3['solved']===_0x527132[_0x38ea1e(0x1c5)],'unitId':_0x1523d3,'subUnitId':_0x3f0219,'text':JSON[_0x38ea1e(0x20a)](_0x1a45f1[_0x38ea1e(0x205)]),'parentId':_0x63a4c7}),_0x411958=_0x24602e(_0x1484f3[_0x38ea1e(0x1c1)][0x0]);return{..._0x411958,'children':_0x1484f3[_0x38ea1e(0x1c1)][_0x38ea1e(0x1d6)](0x1)['map'](_0x4b5b50=>_0x24602e(_0x4b5b50,_0x411958['id']))};}return null;}let _0x24593d=class{constructor(_0x553aea,_0x2c1d2b,_0xf58014,_0x10891f){const _0x54ce37=_0xd9dc20;this['_httpService']=_0x553aea,this[_0x54ce37(0x1d0)]=_0x2c1d2b,this[_0x54ce37(0x1e2)]=_0xf58014,this['_injector']=_0x10891f;}async[_0xd9dc20(0x234)](_0x16f180){const _0x50ab45=_0xd9dc20;var _0x72bc6,_0x3239cc;const {parentId:_0x3fad65,unitId:_0x51c35a,text:_0x35a7ca,threadId:_0x1b7e8d}=_0x16f180,_0x1eae6f=(_0x3239cc=(_0x72bc6=_0x35a7ca['customRanges'])==null?void 0x0:_0x72bc6[_0x50ab45(0x1bf)](_0xcbc757=>_0xcbc757[_0x50ab45(0x21f)]===_0x8ba108[_0x50ab45(0x1f2)][_0x50ab45(0x1cf)])[_0x50ab45(0x1e4)](_0x65bf2e=>_0x65bf2e['rangeId']))!=null?_0x3239cc:[],_0x5b1528=JSON[_0x50ab45(0x1fe)](_0x35a7ca),_0x501eb5=(await this[_0x50ab45(0x1e2)][_0x50ab45(0x1ba)](_0x51c35a))[_0x50ab45(0x1ce)]();if(_0x3fad65){const _0x3b7fef={'memberId':_0x501eb5,'unitId':_0x51c35a,'content':_0x5b1528,'mention':_0x1eae6f,'threadId':_0x1b7e8d},_0x120f60=(await this[_0x50ab45(0x21a)][_0x50ab45(0x21e)]('/universer-api/comment/unit/'+_0x51c35a+_0x50ab45(0x231),{'body':_0x3b7fef}))[_0x50ab45(0x239)][_0x50ab45(0x214)];return{..._0x16f180,'id':_0x120f60['replyId'],'dT':_0x8ba108['dayjs'](+_0x120f60[_0x50ab45(0x1bc)])[_0x50ab45(0x1f3)](_0x50ab45(0x213)),'personId':_0x120f60[_0x50ab45(0x1dc)]};}else{const _0x2a34f2={'memberId':_0x501eb5,'unitId':_0x51c35a,'content':_0x5b1528,'mention':_0x1eae6f},_0x511c95=await this[_0x50ab45(0x21a)][_0x50ab45(0x21e)](_0x50ab45(0x1ed)+_0x51c35a+'/add',{'body':_0x2a34f2});return _0x4cc20f(_0x511c95[_0x50ab45(0x239)][_0x50ab45(0x1dd)],_0x16f180);}}async[_0xd9dc20(0x22c)](_0x33e952){const _0x21e1a8=_0xd9dc20;var _0x1a8cc9,_0x3e21ea;const {text:_0x5f91a1,unitId:_0x5ef23a}=_0x33e952,_0x217489=(_0x3e21ea=(_0x1a8cc9=_0x5f91a1[_0x21e1a8(0x1c6)])==null?void 0x0:_0x1a8cc9['filter'](_0x226faa=>_0x226faa[_0x21e1a8(0x21f)]===_0x8ba108[_0x21e1a8(0x1f2)][_0x21e1a8(0x1cf)])['map'](_0x57e31a=>_0x57e31a[_0x21e1a8(0x1e8)]))!=null?_0x3e21ea:[],_0x51b7d8=JSON[_0x21e1a8(0x1fe)](_0x5f91a1),_0x1da904=_0x33e952[_0x21e1a8(0x1d9)],_0x893c32=_0x33e952['id'],_0x3e0f57={'memberId':(await this['_sessionService'][_0x21e1a8(0x1ba)](_0x5ef23a))[_0x21e1a8(0x1ce)](),'unitId':_0x5ef23a,'threadId':_0x1da904,'mention':_0x217489,'content':_0x51b7d8,'replyId':_0x893c32},_0x41ee93=await this['_httpService'][_0x21e1a8(0x21e)](_0x21e1a8(0x1ed)+_0x5ef23a+_0x21e1a8(0x1f7),{'body':_0x3e0f57});return!_0x41ee93['body'][_0x21e1a8(0x216)]||_0x41ee93['body'][_0x21e1a8(0x216)][_0x21e1a8(0x22a)]===0x1;}async['resolveComment'](_0x4666e7){const _0x38f7fa=_0xd9dc20,{unitId:_0x26e269}=_0x4666e7,_0x5be4a8=_0x4666e7[_0x38f7fa(0x1d9)],_0x5d5715={'memberId':this[_0x38f7fa(0x1d0)][_0x38f7fa(0x1c8)]()[_0x38f7fa(0x209)],'unitId':_0x26e269,'threadId':_0x5be4a8,'solved':_0x4666e7[_0x38f7fa(0x1c4)]?_0x527132['Solved']:_0x527132['OpenOrReOpen']},_0x55923b=await this[_0x38f7fa(0x21a)][_0x38f7fa(0x21e)](_0x38f7fa(0x1ed)+_0x26e269+_0x38f7fa(0x233),{'body':_0x5d5715});return!_0x55923b[_0x38f7fa(0x239)]['error']||_0x55923b[_0x38f7fa(0x239)][_0x38f7fa(0x216)]['code']===0x1;}async[_0xd9dc20(0x220)](_0x3a33d0,_0x152566,_0x469ebc,_0x1e5209){const _0x4b9d6b=_0xd9dc20,_0x496e8a={'memberId':(await this[_0x4b9d6b(0x1e2)][_0x4b9d6b(0x1ba)](_0x3a33d0))[_0x4b9d6b(0x1ce)](),'threadId':_0x469ebc,'replyId':_0x1e5209,'unitId':_0x3a33d0},_0x1e8124=await this['_httpService'][_0x4b9d6b(0x21e)](_0x4b9d6b(0x1ed)+_0x3a33d0+_0x4b9d6b(0x1f9),{'body':_0x496e8a});return!_0x1e8124[_0x4b9d6b(0x239)][_0x4b9d6b(0x216)]||_0x1e8124[_0x4b9d6b(0x239)][_0x4b9d6b(0x216)][_0x4b9d6b(0x22a)]===0x1;}async[_0xd9dc20(0x230)](_0x30eaed,_0x96dbff,_0x168369){const _0x107396=_0xd9dc20,_0x2404ef={'unitId':_0x30eaed,'threadId':_0x168369},_0x186d56=await this['_httpService']['post'](_0x107396(0x1ed)+_0x30eaed+_0x107396(0x203),{'body':_0x2404ef}),_0x51e000=_0x168369[_0x107396(0x1e4)](_0x3fbb51=>_0xd260ef(_0x186d56[_0x107396(0x239)][_0x107396(0x238)][_0x3fbb51],_0x30eaed,_0x96dbff))['filter'](Boolean);return Object[_0x107396(0x1d7)](_0x186d56['body'][_0x107396(0x1fc)])[_0x107396(0x235)](_0x3ec5b2=>{const _0x4d018c=_0x107396;this[_0x4d018c(0x1d0)]['addUser'](_0x3ec5b2);}),_0x51e000;}['saveCommentToSnapshot'](_0x34564c){const _0x2efb7d=_0xd9dc20;return{'id':_0x34564c['id'],'threadId':_0x34564c['threadId'],'ref':_0x34564c[_0x2efb7d(0x1b9)]};}};_0x24593d=_0x20ec76([_0x50759f(0x0,_0x8ba108[_0xd9dc20(0x1be)](_0x50014d['HTTPService'])),_0x50759f(0x1,_0x8ba108[_0xd9dc20(0x1be)](_0x8ba108[_0xd9dc20(0x210)])),_0x50759f(0x2,_0x8ba108[_0xd9dc20(0x1be)](_0x4b6958[_0xd9dc20(0x23f)])),_0x50759f(0x3,_0x8ba108[_0xd9dc20(0x1be)](_0x8ba108[_0xd9dc20(0x1f6)]))],_0x24593d);var _0x87a981=Object[_0xd9dc20(0x1eb)],_0x409830=(_0x2339e2,_0x81f701,_0x1f8de0,_0x51e9cb)=>{const _0x5b3069=_0xd9dc20;for(var _0x413706=_0x51e9cb>0x1?void 0x0:_0x51e9cb?_0x87a981(_0x81f701,_0x1f8de0):_0x81f701,_0x25c93e=_0x2339e2[_0x5b3069(0x23a)]-0x1,_0x130753;_0x25c93e>=0x0;_0x25c93e--)(_0x130753=_0x2339e2[_0x25c93e])&&(_0x413706=_0x130753(_0x413706)||_0x413706);return _0x413706;},_0x507e96=(_0x5b4773,_0xdd4361)=>(_0x2fab3d,_0x7e9d78)=>_0xdd4361(_0x2fab3d,_0x7e9d78,_0x5b4773);let _0x366456=class extends _0x8ba108[_0xd9dc20(0x1f0)]{constructor(_0xedf1e4,_0x43400a){const _0x3bd067=_0xd9dc20;super(),this['_threadCommentDataSourceService']=_0xedf1e4,this[_0x3bd067(0x229)]=_0x43400a,this['_initDataSource']();}['_initDataSource'](){const _0x477bf6=_0xd9dc20;this[_0x477bf6(0x1c0)][_0x477bf6(0x20b)]=this[_0x477bf6(0x229)],this[_0x477bf6(0x1c0)][_0x477bf6(0x204)]=!0x1;}};_0x366456=_0x409830([_0x507e96(0x0,_0x47d0a6['IThreadCommentDataSourceService']),_0x507e96(0x1,_0x8ba108['Inject'](_0x24593d))],_0x366456);var _0x2c2bc6=Object[_0xd9dc20(0x1b7)],_0x11e524=Object[_0xd9dc20(0x1eb)],_0xfe42b7=(_0x5bc393,_0x148947,_0x2337f3)=>_0x148947 in _0x5bc393?_0x2c2bc6(_0x5bc393,_0x148947,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2337f3}):_0x5bc393[_0x148947]=_0x2337f3,_0x36df0e=(_0x4ccf5c,_0x2e9607,_0x217ed9,_0x1efb0d)=>{const _0x1da006=_0xd9dc20;for(var _0x484964=_0x1efb0d>0x1?void 0x0:_0x1efb0d?_0x11e524(_0x2e9607,_0x217ed9):_0x2e9607,_0x42d1c0=_0x4ccf5c[_0x1da006(0x23a)]-0x1,_0x13f870;_0x42d1c0>=0x0;_0x42d1c0--)(_0x13f870=_0x4ccf5c[_0x42d1c0])&&(_0x484964=_0x13f870(_0x484964)||_0x484964);return _0x484964;},_0x5cd221=(_0x3da58b,_0x2b3e65)=>(_0x3e9376,_0x3e6b04)=>_0x2b3e65(_0x3e9376,_0x3e6b04,_0x3da58b),_0x772518=(_0x56614d,_0x5e97ff,_0x180108)=>_0xfe42b7(_0x56614d,typeof _0x5e97ff!=_0xd9dc20(0x219)?_0x5e97ff+'':_0x5e97ff,_0x180108);_0x24ed3d[_0xd9dc20(0x1ff)]=class extends _0x8ba108[_0xd9dc20(0x1c9)]{constructor(_0x35f5a1=_0x1ebfe0,_0x1f28ce,_0x299bbf){const _0x350231=_0xd9dc20;super(),this['_config']=_0x35f5a1,this['_injector']=_0x1f28ce,this['_configService']=_0x299bbf;const {..._0xbef2b2}=_0x8ba108[_0x350231(0x202)]({},_0x1ebfe0,this[_0x350231(0x1ee)]);this[_0x350231(0x1e9)][_0x350231(0x1ec)](_0x5963a3,_0xbef2b2);}[_0xd9dc20(0x1f1)](){const _0x3b0d56=_0xd9dc20;[[_0x24593d],[_0x366456],[_0x257958]][_0x3b0d56(0x235)](_0x2ebb08=>{const _0x5daf72=_0x3b0d56;this[_0x5daf72(0x225)][_0x5daf72(0x215)](_0x2ebb08);});}[_0xd9dc20(0x227)](){const _0x358fb7=_0xd9dc20;this[_0x358fb7(0x225)][_0x358fb7(0x20e)](_0x366456),this[_0x358fb7(0x225)]['get'](_0x257958);}},_0x772518(_0x24ed3d[_0xd9dc20(0x1ff)],_0xd9dc20(0x200),_0x299ca5),_0x772518(_0x24ed3d[_0xd9dc20(0x1ff)],_0xd9dc20(0x1f8),_0x8ba108[_0xd9dc20(0x223)][_0xd9dc20(0x207)]),_0x24ed3d['UniverThreadCommentDataSourcePlugin']=_0x36df0e([_0x8ba108[_0xd9dc20(0x22f)](_0x56d5d9['UniverThreadCommentUIPlugin'],_0x4b6958['UniverCollaborationClientPlugin'],_0x4a61dd[_0xd9dc20(0x1ef)]),_0x5cd221(0x1,_0x8ba108['Inject'](_0x8ba108[_0xd9dc20(0x1f6)])),_0x5cd221(0x2,_0x8ba108['IConfigService'])],_0x24ed3d[_0xd9dc20(0x1ff)]),Object[_0xd9dc20(0x1b7)](_0x24ed3d,Symbol['toStringTag'],{'value':_0xd9dc20(0x21b)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.7.0-nightly.
|
|
3
|
+
"version": "0.7.0-nightly.202505121607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/
|
|
49
|
-
"@univerjs
|
|
50
|
-
"@univerjs/
|
|
51
|
-
"@univerjs/
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment-ui": "0.7.0-nightly.
|
|
54
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.7.0-nightly.202505121607",
|
|
49
|
+
"@univerjs/thread-comment": "0.7.0-nightly.202505121607",
|
|
50
|
+
"@univerjs/core": "0.7.0-nightly.202505121607",
|
|
51
|
+
"@univerjs-pro/license": "0.7.0-nightly.202505121607",
|
|
52
|
+
"@univerjs/protocol": "0.1.46-alpha.3",
|
|
53
|
+
"@univerjs/thread-comment-ui": "0.7.0-nightly.202505121607",
|
|
54
|
+
"@univerjs/network": "0.7.0-nightly.202505121607"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"rxjs": "
|
|
57
|
+
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^6.3.5",
|
|
60
60
|
"vitest": "^3.1.3",
|