@univerjs/preset-docs-thread-comment 0.5.0-beta.1 → 0.5.0-nightly.202411230627
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/umd/index.js
CHANGED
|
@@ -1,153 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m.UniverThreadCommentUi={},m.UniverCore,m.UniverThreadComment,m.UniverUi,m.rxjs,m.React,m.UniverDesign,m.UniverDocs,m.UniverDocsUi,m.UniverEngineRender))})(this,function(m,o,b,k,ne,h,_,Me,Oe,Re){"use strict";var ut=Object.defineProperty;var vt=(m,o,b)=>o in m?ut(m,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[o]=b;var L=(m,o,b)=>vt(m,typeof o!="symbol"?o+"":o,b);var De=Object.defineProperty,we=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?we(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);m.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();L(this,"_panelVisible",!1);L(this,"_panelVisible$",new ne.BehaviorSubject(!1));L(this,"_activeCommentId");L(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));L(this,"panelVisible$",this._panelVisible$.asObservable());L(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},m.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],m.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(m.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(m.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};class Ve{constructor(){L(this,"dataSource");L(this,"renderSuggestion");L(this,"trigger","@")}async getMentions(e,t,r){return this.dataSource?this.dataSource.getMentions(e,t,r):[]}}const le=o.createIdentifier("thread-comment.mention-data.service");var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,We=(n,e,t,r)=>{for(var i=r>1?void 0:r?Be(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&ve(e,t,i),i},me=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Fe(n,typeof e!="symbol"?e+"":e,t);m.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:d,...c}=this._config;d&&this._configService.setConfig("menu",d,{merge:!0}),this._configService.setConfig(Le,c)}onStarting(){var e;o.mergeOverrideWithDependencies([[m.ThreadCommentPanelService],[le,{useClass:Ve}]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,F].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(m.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(m.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),m.UniverThreadCommentUIPlugin=We([o.DependentOn(b.UniverThreadCommentPlugin),me(1,o.Inject(o.Injector)),me(2,o.ICommandService),me(3,o.IConfigService)],m.UniverThreadCommentUIPlugin);var fe={exports:{}},re={};/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var ze=h,Ze=Symbol.for("react.element"),Ge=Symbol.for("react.fragment"),Ke=Object.prototype.hasOwnProperty,Ye=ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function ge(n,e,t){var r,i={},d=null,c=null;t!==void 0&&(d=""+t),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(c=e.ref);for(r in e)Ke.call(e,r)&&!Je.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Ze,type:n,key:d,ref:c,props:i,_owner:Ye.current}}re.Fragment=Ge,re.jsx=ge,re.jsxs=ge,fe.exports=re;var a=fe.exports,N=function(){return N=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},N.apply(this,arguments)},Qe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,d=n.extend,c=Qe(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),g=h.useRef("_".concat($e()));return pe(t,"".concat(r),{defIds:t.defIds,idSuffix:g.current},N({ref:e,className:C},c),d)});function pe(n,e,t,r,i){return h.createElement(n.tag,N(N({key:e},Xe(n,t,i)),r),(qe(n,t).children||[]).map(function(d,c){return pe(d,"".concat(e,"-").concat(n.tag,"-").concat(c),t,void 0,i)}))}function Xe(n,e,t){var r=N({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(d){var c=d[0],C=d[1];typeof C=="string"&&(r[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function qe(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?N(N({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?N(N({},i),{attrs:N(N({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function $e(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:et}))});Ie.displayName="DeleteSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:tt}))});Se.displayName="IncreaseSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:nt}))});xe.displayName="MoreHorizontalSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:rt}))});ye.displayName="ReplyToCommentSingle";var it={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:it}))});be.displayName="ResolvedSingle";var ot={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:ot}))});Te.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},st=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},dt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),_e=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let d=0;return t==null||t.forEach(c=>{d<c.startIndex&&i.push({type:"text",content:e.slice(d,c.startIndex)}),i.push({type:"mention",content:{label:e.slice(c.startIndex,c.endIndex).slice(1,-1),id:c.rangeId}}),d=c.endIndex}),i.push({type:"text",content:e.slice(d,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const d=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:d,properties:{}});break}}}),e+=`
|
|
12
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},lt=n=>({display:n.label,id:`${n.id}`,raw:n}),mt=(n,e,t,r,i)=>{var c,C;const d=(c=n.raw)==null?void 0:c.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[d?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:d}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var x,R;const{comment:t,onSave:r,id:i,onCancel:d,autoFocus:c,unitId:C,subUnitId:g}=n,j=o.useDependency(le),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,f]=h.useState({...t}),[p,S]=h.useState(!1),O=h.useRef(null),T=o.useDependency(Me.DocSelectionManagerService),u=(x=o.useDependency(Re.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:x.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(s){var y;f({...t,text:s,attachments:[]}),(y=O.current)==null||y.inputElement.focus()}}));const W=()=>{var s;I.text&&(r==null||r({...I,text:I.text}),S(!1),f({text:void 0}),(s=O.current)==null||s.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:s=>s.preventDefault(),children:[a.jsx(_.Mentions,{ref:O,autoFocus:c,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?dt(_e(I.text)):"",onChange:s=>{s.target.value||f({...t,text:void 0}),f==null||f({...t,text:Ue(st(s.target.value))})},onFocus:()=>{const s=T.getActiveTextRange();s&&s.collapsed&&(u==null||u.removeAllRanges()),u==null||u.blur(),S(!0)},children:a.jsx(_.Mention,{trigger:j.trigger,data:(s,y)=>j.getMentions(s,C,g).then(U=>U.map(lt)).then(y),displayTransform:(s,y)=>`@${y} `,renderSuggestion:(R=j.renderSuggestion)!=null?R:mt},j.trigger)}),p?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{d==null||d(),S(!1),f({text:void 0}),w.executeCommand(F.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:W,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ct=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:d,onReply:c,resolved:C,isRoot:g,onClose:j,onDeleteComment:w}=n,M=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),f=o.useDependency(o.UserManagerService),p=f.getUser(e.personId),S=k.useObservable(f.currentUser$),O=(S==null?void 0:S.userID)===e.personId,T=e.id===Ee,[Z,u]=h.useState(!1),W=()=>{(w==null?void 0:w(e))!==!1&&(M.executeCommand(g?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),g&&(j==null||j()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>u(!1),onMouseEnter:()=>u(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:p==null?void 0:p.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(p==null?void 0:p.name)||" "}),a.jsxs("div",{children:[T||C?null:Z?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>c(p),children:a.jsx(ye,{})}):null,O&&!T&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>d==null?void 0:d(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:W,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(xe,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>d==null?void 0:d(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:x,attachments:R})=>{d==null||d(!1),M.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:x,attachments:R}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:_e(e.text).map((x,R)=>{switch(x.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",x.content.label," "]},R);default:return x.content}})})]})},Ne=n=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:d=!0,onClick:c,showHighlight:C,onClose:g,getSubUnitName:j,prefix:w,autoFocus:M,onMouseEnter:I,onMouseLeave:f,onAddComment:p,onDeleteComment:S,onResolve:O}=n,T=o.useDependency(b.ThreadCommentModel),[Z,u]=h.useState(!1),[W,x]=h.useState(""),R=h.useMemo(()=>T.commentUpdate$.pipe(ne.debounceTime(16)),[T]);k.useObservable(R);const s=e?T.getCommentWithChildren(t,r,e):null,y=o.useDependency(o.ICommandService),U=o.useDependency(o.UserManagerService),H=s==null?void 0:s.root.resolved,D=k.useObservable(U.currentUser$),Q=h.useRef(null),X=[...s?[s.root]:[{id:Ee,text:{dataStream:`
|
|
13
|
-
\r`},personId:(ae=D==null?void 0:D.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...($=s==null?void 0:s.children)!=null?$:[]],G=h.useRef(null),V=P=>{P.stopPropagation(),H?y.executeCommand(F.id,{unitId:t,subUnitId:r,commentId:e}):y.executeCommand(F.id),y.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!H}),O==null||O(!H)},q=P=>{P.stopPropagation(),y.executeCommand(F.id),!(s!=null&&s.root&&(S==null?void 0:S(s.root))===!1)&&(y.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),g==null||g())};h.useEffect(()=>f==null?void 0:f(),[]);const B=j((ee=s==null?void 0:s.root.subUnitId)!=null?ee:r),oe=d&&!W&&!H,Y=`${i||(s==null?void 0:s.root.ref)||""}${B?" · ":""}${B}`;return a.jsxs("div",{className:at(v.threadComment,{[v.threadCommentActive]:!H&&(C||Z||w==="cell")}),onClick:c,id:`${w}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),u(!0)},onMouseLeave:()=>{f==null||f(),u(!1)},children:[!H&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),s?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:V,className:v.threadCommentIcon,style:{color:H?"rgb(var(--green-500))":""},children:H?a.jsx(be,{}):a.jsx(Te,{})}),(D==null?void 0:D.userID)===s.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:G,children:X.map(P=>a.jsx(ct,{onClose:g,unitId:t,subUnitId:r,item:P,isRoot:P.id===(s==null?void 0:s.root.id),editing:W===P.id,resolved:s==null?void 0:s.root.resolved,onEditingChange:A=>{x(A?P.id:"")},onReply:A=>{A&&requestAnimationFrame(()=>{var l;(l=Q.current)==null||l.reply(Ue([{type:"mention",content:{id:A.userID,label:A.name}}]))})},onAddComment:p,onDeleteComment:S},P.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:Q,unitId:t,subUnitId:r,onSave:async({text:P,attachments:A})=>{const l={text:P,attachments:A,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:D==null?void 0:D.userID,parentId:s==null?void 0:s.root.id,unitId:t,subUnitId:r,threadId:s==null?void 0:s.root.threadId};(p==null?void 0:p(l))!==!1&&(await y.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:l}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:M||!s,onCancel:()=>{s||g==null||g()}},`${M}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},ht=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:d,onResolve:c,sortComments:C,onItemLeave:g,onItemEnter:j,disableAdd:w,tempComment:M,onAddComment:I,onDeleteComment:f,showComments:p}=n,[S,O]=h.useState("all"),[T,Z]=h.useState("all"),u=o.useDependency(o.LocaleService),W=o.useDependency(o.UserManagerService),x=o.useDependency(b.ThreadCommentModel),[R,s]=h.useState(()=>x.getUnit(e)),y=o.useDependency(m.ThreadCommentPanelService),U=k.useObservable(y.activeCommentId$),H=k.useObservable(x.commentUpdate$),D=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),G="panel",V=k.useObservable(W.currentUser$),q=h.useMemo(()=>{var de;const l=S==="all"?R:(de=R.filter(E=>E.subUnitId===Q))!=null?de:[],te=C!=null?C:E=>E,se=l.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(p){const E=new Map;return se.forEach(K=>{E.set(K.id,K)}),[...p,""].map(K=>E.get(K)).filter(Boolean)}else return te(se)},[p,S,R,C,Q]),B=h.useMemo(()=>[...q.filter(l=>!l.resolved),...q.filter(l=>l.resolved)],[q]),oe=h.useMemo(()=>T==="resolved"?B.filter(l=>l.resolved):T==="unsolved"?B.filter(l=>!l.resolved):T==="concern_me"&&V!=null&&V.userID?B.filter(l=>l==null?void 0:l.users.has(V.userID)):B,[B,V==null?void 0:V.userID,T]),Y=M?[M,...oe]:oe,ae=Y.filter(l=>!l.resolved),$=Y.filter(l=>l.resolved),ee=T!=="all"||S!=="all",P=()=>{Z("all"),O("all")};h.useEffect(()=>{e&&s(x.getUnit(e))},[e,x,H]),h.useEffect(()=>{var E;if(!U)return;if(!X.current){X.current=!0;return}const{unitId:l,subUnitId:te,commentId:se}=U,de=`${G}-${l}-${te}-${se}`;(E=document.getElementById(de))==null||E.scrollIntoView({block:"center"})},[U]);const A=l=>a.jsx(Ne,{prefix:G,getSubUnitName:d,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(U==null?void 0:U.commentId)===l.id,showHighlight:(U==null?void 0:U.commentId)===l.id,onClick:()=>{X.current=!1,l.resolved?D.executeCommand(F.id):D.executeCommand(F.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>j==null?void 0:j(l),onMouseLeave:()=>g==null?void 0:g(l),onAddComment:I,onDeleteComment:f,onResolve:te=>c==null?void 0:c(l.id,te)},l.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:l=>O(l),options:[{value:"current",label:u.t("threadCommentUI.filter.sheet.current")},{value:"all",label:u.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:T,onChange:l=>Z(l),options:[{value:"all",label:u.t("threadCommentUI.filter.status.all")},{value:"resolved",label:u.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:u.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:u.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(A),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(A),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?u.t("threadCommentUI.panel.filterEmpty"):u.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:P,type:"link",children:u.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:w,children:[a.jsx(Se,{}),u.t("threadCommentUI.panel.addComment")]})]})]})};m.IThreadCommentMentionDataService=le,m.SetActiveCommentOperation=F,m.THREAD_COMMENT_PANEL=he,m.ThreadCommentPanel=ht,m.ThreadCommentTree=Ne,m.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/docs-thread-comment-ui
|
|
17
|
-
|
|
18
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverDocsThreadCommentUi={},c.UniverCore,c.UniverEngineRender,c.UniverThreadCommentUi,c.UniverDocs,c.UniverDocsUi,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React))})(this,function(c,o,g,T,M,j,w,C,A,O){"use strict";var Fe=Object.defineProperty;var Le=(c,o,g)=>o in c?Fe(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var Y=(c,o,g)=>Le(c,typeof o!="symbol"?o+"":o,g);const se="DOC_THREAD_COMMENT_UI_PLUGIN",y="default_doc",de="docs-thread-comment-ui.config",ae={};var ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ce(t,r,i),i},Q=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Y(this,"_addingComment$",new A.BehaviorSubject(void 0));Y(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=le([Q(0,C.ISidebarService),Q(1,o.Inject(T.ThreadCommentPanelService))],U);var X={exports:{}},B={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* react-jsx-runtime.production.min.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var ue=O,ve=Symbol.for("react.element"),fe=Symbol.for("react.fragment"),he=Object.prototype.hasOwnProperty,Ce=ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pe={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var n,i={},s=null,d=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(d=t.ref);for(n in t)he.call(t,n)&&!pe.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ve,type:e,key:s,ref:d,props:i,_owner:Ce.current}}B.Fragment=fe,B.jsx=k,B.jsxs=k,X.exports=B;var Ie=X.exports;const W={id:"docs.command.add-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{comment:r,unitId:n}=t,s=await e.get(w.IThreadCommentDataSourceService).addComment(r),d=e.get(o.ICommandService),a=j.addCustomDecorationBySelectionFactory(e,{id:s.threadId,type:o.CustomDecorationType.COMMENT});if(a){const v={id:w.AddCommentMutation.id,params:{unitId:n,subUnitId:y,comment:s}},h={id:T.SetActiveCommentOperation.id,params:{unitId:n,subUnitId:y,commentId:s.id}};return(await o.sequenceExecute([v,a,h],d)).result}return!1}},K={id:"docs.command.delete-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{commentId:r,unitId:n}=t,i=e.get(o.ICommandService),s=j.deleteCustomDecorationFactory(e,{id:r,unitId:n});return s?(await o.sequenceExecute([s],i)).result:!1}},ee=e=>{const t=e.get(g.IRenderManagerService),r=e.get(M.DocSelectionManagerService),n=t.getCurrent(),i=n==null?void 0:n.with(M.DocSkeletonManagerService).getSkeleton(),s=i==null?void 0:i.getViewModel().getEditArea();if(s===g.DocumentEditArea.FOOTER||s===g.DocumentEditArea.HEADER)return!0;const d=r.getActiveTextRange();return!!(d==null||d.collapsed)};function _e(e){return{id:V.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC,void 0,o.SHEET_EDITOR_UNITS),disabled$:new A.Observable(function(t){const n=e.get(M.DocSelectionManagerService).textSelection$.pipe(A.debounceTime(16)).subscribe(()=>{t.next(ee(e))});return()=>{n.unsubscribe()}})}}function Se(e){return{id:G.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC)}}const P=()=>{const e=o.useDependency(o.IUniverInstanceService),t=o.useDependency(o.Injector),r=O.useMemo(()=>e.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_DOC),[e]),n=o.useObservable(r),i=O.useMemo(()=>new A.Observable(l=>l.next(y)),[]),s=o.useDependency(M.DocSelectionManagerService),d=O.useMemo(()=>s.textSelection$.pipe(A.debounceTime(16)),[s.textSelection$]);o.useObservable(d);const a=o.useDependency(o.ICommandService),v=o.useDependency(U),h=o.useObservable(v.addingComment$),[m,_]=O.useState([]);if(O.useEffect(()=>{var E;const l=new Set,u=n==null?void 0:n.getCustomDecorations();_((E=u==null?void 0:u.map(f=>f.id).filter(f=>{const b=l.has(f);return l.add(f),!b}))!=null?E:[]);const D=a.onCommandExecuted(f=>{var b;if(f.id===M.RichTextEditingMutation.id){const $=new Set,q=n==null?void 0:n.getCustomDecorations();_((b=q==null?void 0:q.map(H=>H.id).filter(H=>{const Be=$.has(H);return $.add(H),!Be}))!=null?b:[])}});return()=>{D.dispose()}},[a,n]),!n)return null;const S=ee(t),p=n.getUnitId();return Ie.jsx(T.ThreadCommentPanel,{unitId:p,subUnitId$:i,type:o.UniverInstanceType.UNIVER_DOC,onAdd:()=>{a.executeCommand(V.id)},getSubUnitName:()=>"",disableAdd:S,tempComment:h,onAddComment:l=>{if(!l.parentId){const u={unitId:p,range:h,comment:l};return a.executeCommand(W.id,u),v.endAdd(),!1}return!0},onDeleteComment:l=>{if(!l.parentId){const u={unitId:p,commentId:l.id};return a.executeCommand(K.id,u),!1}return!0},showComments:m})};P.componentKey="univer.doc.thread-comment-panel";const N={id:"docs.operation.show-comment-panel",type:o.CommandType.OPERATION,handler(e,t){var i;const r=e.get(T.ThreadCommentPanelService),n=e.get(C.ISidebarService);return(!r.panelVisible||((i=n.options.children)==null?void 0:i.label)!==P.componentKey)&&(n.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},G={id:"docs.operation.toggle-comment-panel",type:o.CommandType.OPERATION,handler(e){var n;const t=e.get(T.ThreadCommentPanelService),r=e.get(C.ISidebarService);return!t.panelVisible||((n=r.options.children)==null?void 0:n.label)!==P.componentKey?(r.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>t.setPanelVisible(!1)}),t.setPanelVisible(!0)):(r.close(),t.setPanelVisible(!1),t.setActiveComment(null)),!0}},V={id:"docs.operation.start-add-comment",type:o.CommandType.OPERATION,handler(e){var f,b,$;const t=e.get(T.ThreadCommentPanelService),n=e.get(o.IUniverInstanceService).getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC),i=e.get(M.DocSelectionManagerService),s=e.get(g.IRenderManagerService),d=e.get(o.UserManagerService),a=e.get(U),v=e.get(o.ICommandService),h=e.get(C.ISidebarService),m=i.getActiveTextRange();if(!n||!m)return!1;const _=(f=s.getRenderById(n.getUnitId()))==null?void 0:f.with(j.DocSelectionRenderService);if(m.collapsed)return t.panelVisible?(t.setPanelVisible(!1),h.close()):v.executeCommand(N.id),!0;v.executeCommand(N.id);const S=n.getUnitId(),p=(($=(b=n.getBody())==null?void 0:b.dataStream)!=null?$:"").slice(m.startOffset,m.endOffset),l=o.BuildTextUtils.transform.getPlainText(p),u=y,D="",E={unitId:S,subUnitId:u,id:D,ref:l,dT:w.getDT(),personId:d.getCurrentUser().userID,text:{dataStream:`\r
|
|
27
|
-
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs-pro/thread-comment-datasource
|
|
31
|
-
|
|
32
|
-
function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=function(_0x1085fa,_0x46606a){_0x1085fa=_0x1085fa-0xfe;let _0x2655bd=_0x45cb86[_0x1085fa];return _0x2655bd;},_0x1085(_0x330f90,_0x71315c);}(function(_0x1c3962,_0x38a0e2){const _0xcc7751=_0x1085,_0x25cd31=_0x1c3962();while(!![]){try{const _0x4ef23e=parseInt(_0xcc7751(0x155))/0x1+parseInt(_0xcc7751(0x119))/0x2+parseInt(_0xcc7751(0x193))/0x3*(-parseInt(_0xcc7751(0x15d))/0x4)+-parseInt(_0xcc7751(0x147))/0x5+-parseInt(_0xcc7751(0x16c))/0x6*(-parseInt(_0xcc7751(0x181))/0x7)+parseInt(_0xcc7751(0x18c))/0x8+-parseInt(_0xcc7751(0x157))/0x9;if(_0x4ef23e===_0x38a0e2)break;else _0x25cd31['push'](_0x25cd31['shift']());}catch(_0x1c931a){_0x25cd31['push'](_0x25cd31['shift']());}}}(_0x45cb,0xc73dd),function(_0x223df9,_0x2a32d0){const _0x169cb1=_0x1085;typeof exports==_0x169cb1(0x16e)&&typeof module<'u'?_0x2a32d0(exports,require('@univerjs/core'),require(_0x169cb1(0x13d)),require(_0x169cb1(0x178)),require(_0x169cb1(0x105)),require(_0x169cb1(0x13b)),require(_0x169cb1(0x128)),require(_0x169cb1(0x120))):typeof define=='function'&&define['amd']?define([_0x169cb1(0x106),_0x169cb1(0x188),'@univerjs/thread-comment-ui','@univerjs-pro/collaboration-client',_0x169cb1(0x105),_0x169cb1(0x13b),'rxjs',_0x169cb1(0x120)],_0x2a32d0):(_0x223df9=typeof globalThis<'u'?globalThis:_0x223df9||self,_0x2a32d0(_0x223df9[_0x169cb1(0x143)]={},_0x223df9['UniverCore'],_0x223df9[_0x169cb1(0x187)],_0x223df9[_0x169cb1(0x16d)],_0x223df9[_0x169cb1(0x160)],_0x223df9[_0x169cb1(0x144)],_0x223df9[_0x169cb1(0x128)],_0x223df9[_0x169cb1(0x12b)]));}(this,function(_0x17a296,_0x3d0190,_0x3ed21d,_0x3db026,_0x51384d,_0x5c0884,_0x1b5c0a,_0x49bd93){'use strict';const _0x2d1c5a=_0x1085;const _0x581514='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x5cda73=(_0x209b8d=>(_0x209b8d[_0x209b8d[_0x2d1c5a(0x121)]=0x0]=_0x2d1c5a(0x121),_0x209b8d[_0x209b8d[_0x2d1c5a(0x16f)]=0x1]=_0x2d1c5a(0x16f),_0x209b8d[_0x209b8d[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x209b8d))(_0x5cda73||{}),_0x4aae21=(_0x569621=>(_0x569621[_0x569621[_0x2d1c5a(0x12c)]=0x0]=_0x2d1c5a(0x12c),_0x569621[_0x569621[_0x2d1c5a(0xfe)]=0x1]=_0x2d1c5a(0xfe),_0x569621[_0x569621['Reply']=0x2]=_0x2d1c5a(0x194),_0x569621[_0x569621[_0x2d1c5a(0x18f)]=0x3]=_0x2d1c5a(0x18f),_0x569621[_0x569621['Delete']=0x4]=_0x2d1c5a(0x15f),_0x569621[_0x569621[_0x2d1c5a(0x163)]=0x5]='Solve',_0x569621[_0x569621[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x569621))(_0x4aae21||{});const _0x1d64e1=_0x32d4fa=>_0x3d0190[_0x2d1c5a(0x168)](new Date(+_0x32d4fa))['format'](_0x2d1c5a(0x17a)),_0x41e898=async(_0x1daffb,_0x2ae0d7)=>{const _0x49961f=_0x2d1c5a,_0x4f8c20=_0x1daffb[_0x49961f(0x191)](_0x3d0190[_0x49961f(0x11c)]),_0x50f0c5=_0x1daffb[_0x49961f(0x191)](_0x49bd93[_0x49961f(0x176)]);_0x2ae0d7[_0x49961f(0x11d)](_0x27ee20=>{const _0x12083e=_0x49961f;_0x4f8c20['getUser'](_0x27ee20)&&_0x2ae0d7[_0x12083e(0x124)](_0x27ee20);}),_0x2ae0d7[_0x49961f(0x156)]&&(await _0x50f0c5[_0x49961f(0x191)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2ae0d7]}}))[_0x49961f(0x141)][_0x49961f(0x177)][_0x49961f(0x11d)](_0x1f578d=>{const _0x5d3ae8=_0x49961f;_0x1f578d&&_0x4f8c20[_0x5d3ae8(0x111)](_0x1f578d);});};var _0x2b18e9=Object['defineProperty'],_0xaed435=Object['getOwnPropertyDescriptor'],_0xdbf4ec=(_0x3443bc,_0x3e2fe7,_0x3d4a6c,_0x5e2b31)=>{const _0x5b531d=_0x2d1c5a;for(var _0x15e483=_0x5e2b31>0x1?void 0x0:_0x5e2b31?_0xaed435(_0x3e2fe7,_0x3d4a6c):_0x3e2fe7,_0x229be8=_0x3443bc[_0x5b531d(0x104)]-0x1,_0x29a12f;_0x229be8>=0x0;_0x229be8--)(_0x29a12f=_0x3443bc[_0x229be8])&&(_0x15e483=(_0x5e2b31?_0x29a12f(_0x3e2fe7,_0x3d4a6c,_0x15e483):_0x29a12f(_0x15e483))||_0x15e483);return _0x5e2b31&&_0x15e483&&_0x2b18e9(_0x3e2fe7,_0x3d4a6c,_0x15e483),_0x15e483;},_0x470027=(_0x2a44f3,_0x529c33)=>(_0x166652,_0x92e77d)=>_0x529c33(_0x166652,_0x92e77d,_0x2a44f3);let _0x2c4030=class extends _0x3d0190['Disposable']{constructor(_0x1c592b,_0xef8ea5,_0x4e6c26,_0x22f0c3){const _0x6f6060=_0x2d1c5a;super(),this[_0x6f6060(0x11f)]=_0x1c592b,this[_0x6f6060(0x114)]=_0xef8ea5,this[_0x6f6060(0x151)]=_0x4e6c26,this[_0x6f6060(0x101)]=_0x22f0c3,this['_init'](),this[_0x6f6060(0x127)]();}[_0x2d1c5a(0x127)](){const _0x568e0e=_0x2d1c5a;this[_0x568e0e(0xff)](this['_threadCommentModel'][_0x568e0e(0x16a)][_0x568e0e(0x100)](_0x1b5c0a[_0x568e0e(0x15e)](0x10))['subscribe'](_0x496c60=>{const _0x35946b=new Set();_0x496c60['forEach'](_0x34a6dc=>{const _0xeb10e9=_0x1085;switch(_0x34a6dc[_0xeb10e9(0x117)]){case _0xeb10e9(0x139):{const _0x5d3422=_0x34a6dc[_0xeb10e9(0x17e)][_0xeb10e9(0x162)];_0x35946b[_0xeb10e9(0x139)](_0x5d3422);break;}}}),_0x41e898(this['_injector'],_0x35946b);}));}['_init'](){const _0x32d451=_0x2d1c5a;this[_0x32d451(0xff)](this['_commentService']['commentUpdate$'][_0x32d451(0x167)](async _0x490edc=>{const _0x159d32=_0x32d451;var _0x22400e,_0xc8d55f,_0x22c0dd,_0x4b8c1f;const _0x29d0eb=(_0x22400e=this['_threadCommentModel']['getUnit'](_0x490edc[_0x159d32(0x17d)])['find'](_0x43f4ee=>_0x43f4ee['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x22400e['root'];if(!_0x29d0eb)return;const {unitId:_0x117158,subUnitId:_0x3aafe5}=_0x29d0eb;switch(_0x490edc[_0x159d32(0x130)]&&this[_0x159d32(0x151)]['addUser'](_0x490edc['user']),_0x490edc[_0x159d32(0x117)]){case _0x4aae21[_0x159d32(0xfe)]:break;case _0x4aae21[_0x159d32(0x194)]:{this['_threadCommentModel']['addComment'](_0x117158,_0x3aafe5,{'unitId':_0x117158,'subUnitId':_0x3aafe5,'ref':'','id':_0x490edc['replyId'],'dT':_0x1d64e1(+_0x490edc['createTimestamp']),'threadId':_0x490edc[_0x159d32(0x14f)],'personId':(_0x22c0dd=(_0xc8d55f=_0x490edc[_0x159d32(0x130)])==null?void 0x0:_0xc8d55f[_0x159d32(0x171)])!=null?_0x22c0dd:_0x490edc['userId'],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)]),'parentId':_0x29d0eb['id']});break;}case _0x4aae21[_0x159d32(0x15f)]:{const _0x55b8a5=this[_0x159d32(0x114)][_0x159d32(0x183)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);_0x55b8a5&&_0x55b8a5['parentId']&&this[_0x159d32(0x114)][_0x159d32(0x140)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);break;}case _0x4aae21['Edit']:{this[_0x159d32(0x114)][_0x159d32(0x134)](_0x117158,_0x3aafe5,{'commentId':_0x490edc[_0x159d32(0x14e)],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)])});break;}case _0x4aae21[_0x159d32(0x163)]:{const _0x99e61a=(_0x4b8c1f=this[_0x159d32(0x114)][_0x159d32(0x174)](_0x490edc['unitId'])[_0x159d32(0x154)](_0x232300=>_0x232300['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x4b8c1f[_0x159d32(0x185)];_0x99e61a&&this[_0x159d32(0x114)]['resolveComment'](_0x117158,_0x3aafe5,_0x99e61a['id'],_0x490edc[_0x159d32(0x166)]===_0x5cda73[_0x159d32(0x16f)]);break;}}}));}};_0x2c4030=_0xdbf4ec([_0x470027(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x16b)])),_0x470027(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x5c0884['ThreadCommentModel'])),_0x470027(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x470027(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190['Injector']))],_0x2c4030);const _0x168b3a=_0x2d1c5a(0x12d),_0x5c96e1={};var _0x3f3071=Object[_0x2d1c5a(0x18e)],_0x4e1f86=Object['getOwnPropertyDescriptor'],_0x34829b=(_0x4ac3ab,_0x20f67f,_0x137e72,_0x56aa0f)=>{for(var _0x42b400=_0x56aa0f>0x1?void 0x0:_0x56aa0f?_0x4e1f86(_0x20f67f,_0x137e72):_0x20f67f,_0x382a88=_0x4ac3ab['length']-0x1,_0x583b56;_0x382a88>=0x0;_0x382a88--)(_0x583b56=_0x4ac3ab[_0x382a88])&&(_0x42b400=(_0x56aa0f?_0x583b56(_0x20f67f,_0x137e72,_0x42b400):_0x583b56(_0x42b400))||_0x42b400);return _0x56aa0f&&_0x42b400&&_0x3f3071(_0x20f67f,_0x137e72,_0x42b400),_0x42b400;},_0x5b385f=(_0x3179ab,_0x2379b8)=>(_0x4ad694,_0x3d031b)=>_0x2379b8(_0x4ad694,_0x3d031b,_0x3179ab);function _0x287c05(_0x334b3e,_0x1c3ac9){const _0x1da2de=_0x2d1c5a,_0x316913=_0x334b3e[_0x1da2de(0x116)][0x0];return{..._0x1c3ac9,'id':_0x316913[_0x1da2de(0x14e)],'resolved':_0x334b3e[_0x1da2de(0x166)]===0x1,'dT':_0x1d64e1(_0x316913[_0x1da2de(0x123)]),'personId':_0x316913[_0x1da2de(0x12a)],'threadId':_0x316913[_0x1da2de(0x14f)]};}function _0x4513b1(_0x5c5d7f,_0xee5259,_0x1ea201){const _0x1aa179=_0x2d1c5a;var _0x30e012,_0x4a60c9;if(((_0x4a60c9=(_0x30e012=_0x5c5d7f==null?void 0x0:_0x5c5d7f['replies'])==null?void 0x0:_0x30e012[_0x1aa179(0x104)])!=null?_0x4a60c9:0x0)>0x0){const _0x33a106=(_0x413bee,_0x1ef023)=>({'id':_0x413bee[_0x1aa179(0x14e)],'threadId':_0x413bee['threadId'],'dT':_0x1d64e1(_0x413bee['createTimestamp']),'personId':_0x413bee['userId'],'resolved':_0x5c5d7f['solved']===_0x5cda73[_0x1aa179(0x16f)],'unitId':_0xee5259,'subUnitId':_0x1ea201,'text':JSON[_0x1aa179(0x164)](_0x413bee['content']),'parentId':_0x1ef023}),_0x2fcf35=_0x33a106(_0x5c5d7f['replies'][0x0]);return{..._0x2fcf35,'children':_0x5c5d7f[_0x1aa179(0x116)]['slice'](0x1)[_0x1aa179(0x17b)](_0x25c910=>_0x33a106(_0x25c910,_0x2fcf35['id']))};}return null;}let _0x4c567b=class{constructor(_0x504ccd,_0x440d1d,_0x13d849,_0x1e6654){const _0x21ba5d=_0x2d1c5a;this[_0x21ba5d(0x109)]=_0x504ccd,this[_0x21ba5d(0x151)]=_0x440d1d,this[_0x21ba5d(0x102)]=_0x13d849,this[_0x21ba5d(0x101)]=_0x1e6654;}async[_0x2d1c5a(0x126)](_0x2d47fd){const _0x30ca48=_0x2d1c5a;var _0x23c2b9,_0x54c2a1;const {parentId:_0x92c8a9,unitId:_0x5cc676,text:_0x3d84cf,threadId:_0x5735b3}=_0x2d47fd,_0x2e07a3=(_0x54c2a1=(_0x23c2b9=_0x3d84cf[_0x30ca48(0x135)])==null?void 0x0:_0x23c2b9['filter'](_0x3766f4=>_0x3766f4[_0x30ca48(0x15b)]===_0x3d0190[_0x30ca48(0x150)][_0x30ca48(0x18b)])[_0x30ca48(0x17b)](_0x3231ef=>_0x3231ef[_0x30ca48(0x122)]))!=null?_0x54c2a1:[],_0x57e106=JSON[_0x30ca48(0x14d)](_0x3d84cf),_0x44db1c=(await this[_0x30ca48(0x102)]['requireSession'](_0x5cc676))[_0x30ca48(0x18a)]();if(_0x92c8a9){const _0x20deb8={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3,'threadId':_0x5735b3},_0x5ed8eb=(await this['_httpService'][_0x30ca48(0x14b)]('/universer-api/comment/unit/'+_0x5cc676+_0x30ca48(0x192),{'body':_0x20deb8}))[_0x30ca48(0x141)][_0x30ca48(0x161)];return{..._0x2d47fd,'id':_0x5ed8eb[_0x30ca48(0x14e)],'dT':_0x3d0190[_0x30ca48(0x168)](+_0x5ed8eb[_0x30ca48(0x123)])['format'](_0x30ca48(0x17a)),'personId':_0x5ed8eb['userId']};}else{const _0x36ed66={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3},_0x2048d0=await this[_0x30ca48(0x109)][_0x30ca48(0x14b)](_0x30ca48(0x10a)+_0x5cc676+_0x30ca48(0x184),{'body':_0x36ed66});return _0x287c05(_0x2048d0[_0x30ca48(0x141)][_0x30ca48(0x17f)],_0x2d47fd);}}async[_0x2d1c5a(0x134)](_0xa03223){const _0x2b9009=_0x2d1c5a;var _0xd70d8b,_0x2971aa;const {text:_0xa9b207,unitId:_0x38e37f}=_0xa03223,_0x2a422d=(_0x2971aa=(_0xd70d8b=_0xa9b207[_0x2b9009(0x135)])==null?void 0x0:_0xd70d8b[_0x2b9009(0x175)](_0x2e447c=>_0x2e447c['rangeType']===_0x3d0190[_0x2b9009(0x150)]['COMMENT'])[_0x2b9009(0x17b)](_0x2a0ee2=>_0x2a0ee2[_0x2b9009(0x122)]))!=null?_0x2971aa:[],_0x27365a=JSON[_0x2b9009(0x14d)](_0xa9b207),_0xa8dbb2=_0xa03223[_0x2b9009(0x14f)],_0x32e73c=_0xa03223['id'],_0x30dbfc={'memberId':(await this[_0x2b9009(0x102)][_0x2b9009(0x11e)](_0x38e37f))['getMemberID'](),'unitId':_0x38e37f,'threadId':_0xa8dbb2,'mention':_0x2a422d,'content':_0x27365a,'replyId':_0x32e73c},_0x335d49=await this[_0x2b9009(0x109)]['post'](_0x2b9009(0x10a)+_0x38e37f+_0x2b9009(0x13f),{'body':_0x30dbfc});return!_0x335d49[_0x2b9009(0x141)][_0x2b9009(0x132)]||_0x335d49['body']['error'][_0x2b9009(0x107)]===0x1;}async[_0x2d1c5a(0x13e)](_0x25130f){const _0x3f746e=_0x2d1c5a,{unitId:_0x45df06}=_0x25130f,_0x4b542f=_0x25130f[_0x3f746e(0x14f)],_0x458032={'memberId':this['_userService'][_0x3f746e(0x10b)]()['userID'],'unitId':_0x45df06,'threadId':_0x4b542f,'solved':_0x25130f[_0x3f746e(0x138)]?_0x5cda73[_0x3f746e(0x16f)]:_0x5cda73[_0x3f746e(0x121)]},_0x5d5e33=await this[_0x3f746e(0x109)][_0x3f746e(0x14b)](_0x3f746e(0x10a)+_0x45df06+_0x3f746e(0x186),{'body':_0x458032});return!_0x5d5e33[_0x3f746e(0x141)]['error']||_0x5d5e33[_0x3f746e(0x141)][_0x3f746e(0x132)][_0x3f746e(0x107)]===0x1;}async[_0x2d1c5a(0x140)](_0x4bf704,_0x13e9f4,_0x4a7c8d,_0x3aaf08){const _0x2b2280=_0x2d1c5a,_0x2f3900={'memberId':(await this[_0x2b2280(0x102)][_0x2b2280(0x11e)](_0x4bf704))[_0x2b2280(0x18a)](),'threadId':_0x4a7c8d,'replyId':_0x3aaf08,'unitId':_0x4bf704},_0xc6ccca=await this[_0x2b2280(0x109)][_0x2b2280(0x14b)]('/universer-api/comment/unit/'+_0x4bf704+_0x2b2280(0x172),{'body':_0x2f3900});return!_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]||_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]['code']===0x1;}async['listComments'](_0x4daf68,_0x3df24c,_0x30e3d8){const _0x5d19cd=_0x2d1c5a,_0x76a77c={'unitId':_0x4daf68,'threadId':_0x30e3d8},_0x2dd97e=await this[_0x5d19cd(0x109)]['post'](_0x5d19cd(0x10a)+_0x4daf68+_0x5d19cd(0x179),{'body':_0x76a77c}),_0x3e6e53=_0x30e3d8[_0x5d19cd(0x17b)](_0x3a0879=>_0x4513b1(_0x2dd97e['body']['comments'][_0x3a0879],_0x4daf68,_0x3df24c))['filter'](Boolean);return Object[_0x5d19cd(0x112)](_0x2dd97e[_0x5d19cd(0x141)][_0x5d19cd(0x177)])[_0x5d19cd(0x11d)](_0x4e7ff0=>{const _0x434fbd=_0x5d19cd;this['_userService'][_0x434fbd(0x111)](_0x4e7ff0);}),_0x3e6e53;}['saveCommentToSnapshot'](_0x2a7527){const _0x25447e=_0x2d1c5a;return{'id':_0x2a7527['id'],'threadId':_0x2a7527[_0x25447e(0x14f)],'ref':_0x2a7527[_0x25447e(0x11b)]};}};_0x4c567b=_0x34829b([_0x5b385f(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93['HTTPService'])),_0x5b385f(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x5b385f(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x10c)])),_0x5b385f(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)]))],_0x4c567b);var _0x570b55=Object[_0x2d1c5a(0x18e)],_0x4c869a=Object[_0x2d1c5a(0x145)],_0x2bb772=(_0x5d19b3,_0x75698f,_0x41601e,_0x4776a3)=>{const _0x42d174=_0x2d1c5a;for(var _0x5d00a1=_0x4776a3>0x1?void 0x0:_0x4776a3?_0x4c869a(_0x75698f,_0x41601e):_0x75698f,_0x372fde=_0x5d19b3[_0x42d174(0x104)]-0x1,_0x2d1d7c;_0x372fde>=0x0;_0x372fde--)(_0x2d1d7c=_0x5d19b3[_0x372fde])&&(_0x5d00a1=(_0x4776a3?_0x2d1d7c(_0x75698f,_0x41601e,_0x5d00a1):_0x2d1d7c(_0x5d00a1))||_0x5d00a1);return _0x4776a3&&_0x5d00a1&&_0x570b55(_0x75698f,_0x41601e,_0x5d00a1),_0x5d00a1;},_0x49a366=(_0x4fbd56,_0x28563b)=>(_0x62fef0,_0x2e0de7)=>_0x28563b(_0x62fef0,_0x2e0de7,_0x4fbd56);let _0x6c0c22=class{constructor(_0x8dc74c){const _0x9e5a88=_0x2d1c5a;this[_0x9e5a88(0x109)]=_0x8dc74c;}async[_0x2d1c5a(0x12e)](_0x44bee6,_0x20771b,_0x304520){const _0x58ba96=_0x2d1c5a,_0x5c5129=new URL(window[_0x58ba96(0x18d)][_0x58ba96(0x173)])['searchParams'][_0x58ba96(0x191)](_0x58ba96(0x110));if(!_0x5c5129)return[];const _0x45b2ad=window['location'][_0x58ba96(0x148)],_0x371842=window[_0x58ba96(0x18d)][_0x58ba96(0x158)]===_0x58ba96(0x12f)?_0x58ba96(0x165):_0x58ba96(0x13a);return(await this[_0x58ba96(0x109)][_0x58ba96(0x191)](_0x371842+_0x58ba96(0x149)+_0x45b2ad+_0x58ba96(0x103),{'params':{'objectID':_0x5c5129,'unitID':_0x5c5129}}))[_0x58ba96(0x141)][_0x58ba96(0x108)]['map'](_0x2a842b=>{const _0x1b1849=_0x58ba96;var _0x1e4d30,_0xf43929,_0x5015c8,_0x1c8f43,_0x561c23,_0x131e08;return{'id':(_0xf43929=(_0x1e4d30=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x1e4d30[_0x1b1849(0x171)])!=null?_0xf43929:'','label':(_0x1c8f43=(_0x5015c8=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x5015c8[_0x1b1849(0x15c)])!=null?_0x1c8f43:'','icon':(_0x131e08=(_0x561c23=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x561c23[_0x1b1849(0x133)])!=null?_0x131e08:'','type':_0x1b1849(0x130)};});}};_0x6c0c22=_0x2bb772([_0x49a366(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93[_0x2d1c5a(0x176)]))],_0x6c0c22);var _0x37496f=Object[_0x2d1c5a(0x18e)],_0x2a227c=Object[_0x2d1c5a(0x145)],_0x4d0464=(_0xd2a913,_0x87dbce,_0x5883ab,_0x51ad35)=>{for(var _0x14a9f4=_0x51ad35>0x1?void 0x0:_0x51ad35?_0x2a227c(_0x87dbce,_0x5883ab):_0x87dbce,_0x44abcb=_0xd2a913['length']-0x1,_0x5f82e1;_0x44abcb>=0x0;_0x44abcb--)(_0x5f82e1=_0xd2a913[_0x44abcb])&&(_0x14a9f4=(_0x51ad35?_0x5f82e1(_0x87dbce,_0x5883ab,_0x14a9f4):_0x5f82e1(_0x14a9f4))||_0x14a9f4);return _0x51ad35&&_0x14a9f4&&_0x37496f(_0x87dbce,_0x5883ab,_0x14a9f4),_0x14a9f4;},_0x434cce=(_0x1e9d3e,_0x140f0b)=>(_0x18600b,_0x5bb0a4)=>_0x140f0b(_0x18600b,_0x5bb0a4,_0x1e9d3e);let _0x3d1a79=class extends _0x3d0190[_0x2d1c5a(0x125)]{constructor(_0x3b6ddb,_0x357b76,_0x337cf9,_0x481722){const _0x165423=_0x2d1c5a;super(),this[_0x165423(0x142)]=_0x3b6ddb,this[_0x165423(0x17c)]=_0x357b76,this[_0x165423(0x136)]=_0x337cf9,this[_0x165423(0x146)]=_0x481722,this[_0x165423(0x190)]();}[_0x2d1c5a(0x190)](){const _0x38ca74=_0x2d1c5a;this[_0x38ca74(0x142)][_0x38ca74(0x15a)]=this[_0x38ca74(0x17c)],this[_0x38ca74(0x142)][_0x38ca74(0x152)]=!0x1,this[_0x38ca74(0x136)]['dataSource']=this[_0x38ca74(0x146)];}};_0x3d1a79=_0x4d0464([_0x434cce(0x0,_0x5c0884['IThreadCommentDataSourceService']),_0x434cce(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x4c567b)),_0x434cce(0x2,_0x3ed21d[_0x2d1c5a(0x14c)]),_0x434cce(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x6c0c22))],_0x3d1a79);var _0x25b1bc=Object[_0x2d1c5a(0x18e)],_0x271190=Object[_0x2d1c5a(0x145)],_0x51ac44=(_0x241833,_0x23df0b,_0x468956)=>_0x23df0b in _0x241833?_0x25b1bc(_0x241833,_0x23df0b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x468956}):_0x241833[_0x23df0b]=_0x468956,_0x222d11=(_0x2385c4,_0x1ead91,_0x5319db,_0x2527a7)=>{const _0x478081=_0x2d1c5a;for(var _0x55b4d9=_0x2527a7>0x1?void 0x0:_0x2527a7?_0x271190(_0x1ead91,_0x5319db):_0x1ead91,_0x5b3d36=_0x2385c4[_0x478081(0x104)]-0x1,_0x196bb6;_0x5b3d36>=0x0;_0x5b3d36--)(_0x196bb6=_0x2385c4[_0x5b3d36])&&(_0x55b4d9=(_0x2527a7?_0x196bb6(_0x1ead91,_0x5319db,_0x55b4d9):_0x196bb6(_0x55b4d9))||_0x55b4d9);return _0x2527a7&&_0x55b4d9&&_0x25b1bc(_0x1ead91,_0x5319db,_0x55b4d9),_0x55b4d9;},_0x54454a=(_0x412be0,_0x463a27)=>(_0x108220,_0x1cfaae)=>_0x463a27(_0x108220,_0x1cfaae,_0x412be0),_0x3d7f66=(_0x3bb133,_0x545864,_0x5eac52)=>_0x51ac44(_0x3bb133,typeof _0x545864!=_0x2d1c5a(0x11a)?_0x545864+'':_0x545864,_0x5eac52);_0x17a296[_0x2d1c5a(0x159)]=class extends _0x3d0190[_0x2d1c5a(0x10e)]{constructor(_0x54fd89=_0x5c96e1,_0x322218,_0x48bb3f){const _0x37d3fc=_0x2d1c5a;super(),this['_config']=_0x54fd89,this['_injector']=_0x322218,this['_configService']=_0x48bb3f;const {..._0x3fd3f9}=this[_0x37d3fc(0x169)];this[_0x37d3fc(0x170)][_0x37d3fc(0x189)](_0x168b3a,_0x3fd3f9);}[_0x2d1c5a(0x131)](){const _0x2e3fbe=_0x2d1c5a;[[_0x6c0c22],[_0x4c567b],[_0x3d1a79],[_0x2c4030]][_0x2e3fbe(0x11d)](_0x3c3c13=>{const _0x20958e=_0x2e3fbe;this['_injector'][_0x20958e(0x139)](_0x3c3c13);});}[_0x2d1c5a(0x10d)](){const _0x31eae9=_0x2d1c5a;this[_0x31eae9(0x101)]['get'](_0x3d1a79),this[_0x31eae9(0x101)][_0x31eae9(0x191)](_0x2c4030);}},_0x3d7f66(_0x17a296['UniverThreadCommentDataSourcePlugin'],_0x2d1c5a(0x13c),_0x581514),_0x3d7f66(_0x17a296[_0x2d1c5a(0x159)],'type',_0x3d0190[_0x2d1c5a(0x129)][_0x2d1c5a(0x153)]),_0x17a296[_0x2d1c5a(0x159)]=_0x222d11([_0x3d0190['DependentOn'](_0x3ed21d['UniverThreadCommentUIPlugin'],_0x3db026[_0x2d1c5a(0x115)],_0x51384d[_0x2d1c5a(0x118)]),_0x54454a(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)])),_0x54454a(0x2,_0x3d0190['IConfigService'])],_0x17a296[_0x2d1c5a(0x159)]),Object['defineProperty'](_0x17a296,Symbol[_0x2d1c5a(0x14a)],{'value':'Module'});}));function _0x45cb(){const _0x4c3ba6=['delete','Disposable','addComment','_initUserSync','rxjs','UniverInstanceType','userId','UniverNetwork','Unknown','thread-comment-data-source.config','getMentions','https:','user','onStarting','error','avatar','updateComment','customRanges','_threadCommentMentionDataService','UNRECOGNIZED','resolved','add','http','@univerjs/thread-comment','pluginName','@univerjs/thread-comment-ui','resolveComment','/edit','deleteComment','body','_threadCommentDataSourceService','UniverProThreadCommentDatasource','UniverThreadComment','getOwnPropertyDescriptor','_threadCommentMentionDataSource','6846820HIrJlY','host','://','toStringTag','post','IThreadCommentMentionDataService','stringify','replyId','threadId','CustomRangeType','_userService','syncUpdateMutationToColla','UNIVER_UNKNOWN','find','748670RYfhYR','size','14296464KKikiZ','protocol','UniverThreadCommentDataSourcePlugin','dataSource','rangeType','name','580ElmYGS','bufferTime','Delete','UniverProLicense','reply','personId','Solve','parse','https','solved','subscribe','dayjs','_config','commentUpdate$','CommentService','4782FSQpvV','UniverProCollaborationClient','object','Solved','_configService','userID','/delete','href','getUnit','filter','HTTPService','users','@univerjs-pro/collaboration-client','/list','YYYY/MM/DD\x20HH:mm','map','_threadCommentDataSource','unitId','payload','comment','content','13615oBUuuF','Inject','getComment','/add','root','/solved','UniverThreadCommentUi','@univerjs/core','setConfig','getMemberID','COMMENT','7362024zfVyhe','location','defineProperty','Edit','_initDataSource','get','/reply','14718WcxWkQ','Reply','Add','disposeWithMe','pipe','_injector','_sessionService','/universer-api/authz/collaborator','length','@univerjs-pro/license','exports','code','collaborators','_httpService','/universer-api/comment/unit/','getCurrentUser','CollaborationSessionService','onReady','Plugin','Injector','unit','addUser','values','subject','_threadCommentModel','UniverCollaborationClientPlugin','replies','type','UniverLicensePlugin','2532470kOXJCz','symbol','ref','UserManagerService','forEach','requireSession','_commentService','@univerjs/network','OpenOrReOpen','rangeId','createTimestamp'];_0x45cb=function(){return _0x4c3ba6;};return _0x45cb();}
|
|
33
|
-
|
|
34
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/thread-comment-ui
|
|
35
|
-
|
|
36
|
-
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m.UniverThreadCommentUi={},m.UniverCore,m.UniverThreadComment,m.UniverUi,m.rxjs,m.React,m.UniverDesign,m.UniverDocs,m.UniverDocsUi,m.UniverEngineRender))})(this,function(m,o,b,k,ne,h,_,Me,Oe,Re){"use strict";var ut=Object.defineProperty;var vt=(m,o,b)=>o in m?ut(m,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[o]=b;var L=(m,o,b)=>vt(m,typeof o!="symbol"?o+"":o,b);var De=Object.defineProperty,we=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?we(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);m.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();L(this,"_panelVisible",!1);L(this,"_panelVisible$",new ne.BehaviorSubject(!1));L(this,"_activeCommentId");L(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));L(this,"panelVisible$",this._panelVisible$.asObservable());L(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},m.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],m.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(m.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(m.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};class Ve{constructor(){L(this,"dataSource");L(this,"renderSuggestion");L(this,"trigger","@")}async getMentions(e,t,r){return this.dataSource?this.dataSource.getMentions(e,t,r):[]}}const le=o.createIdentifier("thread-comment.mention-data.service");var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,We=(n,e,t,r)=>{for(var i=r>1?void 0:r?Be(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&ve(e,t,i),i},me=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Fe(n,typeof e!="symbol"?e+"":e,t);m.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:d,...c}=this._config;d&&this._configService.setConfig("menu",d,{merge:!0}),this._configService.setConfig(Le,c)}onStarting(){var e;o.mergeOverrideWithDependencies([[m.ThreadCommentPanelService],[le,{useClass:Ve}]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,F].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(m.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(m.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),m.UniverThreadCommentUIPlugin=We([o.DependentOn(b.UniverThreadCommentPlugin),me(1,o.Inject(o.Injector)),me(2,o.ICommandService),me(3,o.IConfigService)],m.UniverThreadCommentUIPlugin);var fe={exports:{}},re={};/**
|
|
37
|
-
* @license React
|
|
38
|
-
* react-jsx-runtime.production.min.js
|
|
39
|
-
*
|
|
40
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
41
|
-
*
|
|
42
|
-
* This source code is licensed under the MIT license found in the
|
|
43
|
-
* LICENSE file in the root directory of this source tree.
|
|
44
|
-
*/var ze=h,Ze=Symbol.for("react.element"),Ge=Symbol.for("react.fragment"),Ke=Object.prototype.hasOwnProperty,Ye=ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function ge(n,e,t){var r,i={},d=null,c=null;t!==void 0&&(d=""+t),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(c=e.ref);for(r in e)Ke.call(e,r)&&!Je.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Ze,type:n,key:d,ref:c,props:i,_owner:Ye.current}}re.Fragment=Ge,re.jsx=ge,re.jsxs=ge,fe.exports=re;var a=fe.exports,N=function(){return N=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},N.apply(this,arguments)},Qe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,d=n.extend,c=Qe(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),g=h.useRef("_".concat($e()));return pe(t,"".concat(r),{defIds:t.defIds,idSuffix:g.current},N({ref:e,className:C},c),d)});function pe(n,e,t,r,i){return h.createElement(n.tag,N(N({key:e},Xe(n,t,i)),r),(qe(n,t).children||[]).map(function(d,c){return pe(d,"".concat(e,"-").concat(n.tag,"-").concat(c),t,void 0,i)}))}function Xe(n,e,t){var r=N({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(d){var c=d[0],C=d[1];typeof C=="string"&&(r[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function qe(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?N(N({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?N(N({},i),{attrs:N(N({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function $e(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:et}))});Ie.displayName="DeleteSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:tt}))});Se.displayName="IncreaseSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:nt}))});xe.displayName="MoreHorizontalSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:rt}))});ye.displayName="ReplyToCommentSingle";var it={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:it}))});be.displayName="ResolvedSingle";var ot={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:ot}))});Te.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},st=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},dt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),_e=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let d=0;return t==null||t.forEach(c=>{d<c.startIndex&&i.push({type:"text",content:e.slice(d,c.startIndex)}),i.push({type:"mention",content:{label:e.slice(c.startIndex,c.endIndex).slice(1,-1),id:c.rangeId}}),d=c.endIndex}),i.push({type:"text",content:e.slice(d,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const d=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:d,properties:{}});break}}}),e+=`
|
|
45
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},lt=n=>({display:n.label,id:`${n.id}`,raw:n}),mt=(n,e,t,r,i)=>{var c,C;const d=(c=n.raw)==null?void 0:c.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[d?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:d}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var x,R;const{comment:t,onSave:r,id:i,onCancel:d,autoFocus:c,unitId:C,subUnitId:g}=n,j=o.useDependency(le),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,f]=h.useState({...t}),[p,S]=h.useState(!1),O=h.useRef(null),T=o.useDependency(Me.DocSelectionManagerService),u=(x=o.useDependency(Re.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:x.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(s){var y;f({...t,text:s,attachments:[]}),(y=O.current)==null||y.inputElement.focus()}}));const W=()=>{var s;I.text&&(r==null||r({...I,text:I.text}),S(!1),f({text:void 0}),(s=O.current)==null||s.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:s=>s.preventDefault(),children:[a.jsx(_.Mentions,{ref:O,autoFocus:c,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?dt(_e(I.text)):"",onChange:s=>{s.target.value||f({...t,text:void 0}),f==null||f({...t,text:Ue(st(s.target.value))})},onFocus:()=>{const s=T.getActiveTextRange();s&&s.collapsed&&(u==null||u.removeAllRanges()),u==null||u.blur(),S(!0)},children:a.jsx(_.Mention,{trigger:j.trigger,data:(s,y)=>j.getMentions(s,C,g).then(U=>U.map(lt)).then(y),displayTransform:(s,y)=>`@${y} `,renderSuggestion:(R=j.renderSuggestion)!=null?R:mt},j.trigger)}),p?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{d==null||d(),S(!1),f({text:void 0}),w.executeCommand(F.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:W,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ct=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:d,onReply:c,resolved:C,isRoot:g,onClose:j,onDeleteComment:w}=n,M=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),f=o.useDependency(o.UserManagerService),p=f.getUser(e.personId),S=k.useObservable(f.currentUser$),O=(S==null?void 0:S.userID)===e.personId,T=e.id===Ee,[Z,u]=h.useState(!1),W=()=>{(w==null?void 0:w(e))!==!1&&(M.executeCommand(g?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),g&&(j==null||j()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>u(!1),onMouseEnter:()=>u(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:p==null?void 0:p.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(p==null?void 0:p.name)||" "}),a.jsxs("div",{children:[T||C?null:Z?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>c(p),children:a.jsx(ye,{})}):null,O&&!T&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>d==null?void 0:d(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:W,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(xe,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>d==null?void 0:d(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:x,attachments:R})=>{d==null||d(!1),M.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:x,attachments:R}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:_e(e.text).map((x,R)=>{switch(x.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",x.content.label," "]},R);default:return x.content}})})]})},Ne=n=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:d=!0,onClick:c,showHighlight:C,onClose:g,getSubUnitName:j,prefix:w,autoFocus:M,onMouseEnter:I,onMouseLeave:f,onAddComment:p,onDeleteComment:S,onResolve:O}=n,T=o.useDependency(b.ThreadCommentModel),[Z,u]=h.useState(!1),[W,x]=h.useState(""),R=h.useMemo(()=>T.commentUpdate$.pipe(ne.debounceTime(16)),[T]);k.useObservable(R);const s=e?T.getCommentWithChildren(t,r,e):null,y=o.useDependency(o.ICommandService),U=o.useDependency(o.UserManagerService),H=s==null?void 0:s.root.resolved,D=k.useObservable(U.currentUser$),Q=h.useRef(null),X=[...s?[s.root]:[{id:Ee,text:{dataStream:`
|
|
46
|
-
\r`},personId:(ae=D==null?void 0:D.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...($=s==null?void 0:s.children)!=null?$:[]],G=h.useRef(null),V=P=>{P.stopPropagation(),H?y.executeCommand(F.id,{unitId:t,subUnitId:r,commentId:e}):y.executeCommand(F.id),y.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!H}),O==null||O(!H)},q=P=>{P.stopPropagation(),y.executeCommand(F.id),!(s!=null&&s.root&&(S==null?void 0:S(s.root))===!1)&&(y.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),g==null||g())};h.useEffect(()=>f==null?void 0:f(),[]);const B=j((ee=s==null?void 0:s.root.subUnitId)!=null?ee:r),oe=d&&!W&&!H,Y=`${i||(s==null?void 0:s.root.ref)||""}${B?" · ":""}${B}`;return a.jsxs("div",{className:at(v.threadComment,{[v.threadCommentActive]:!H&&(C||Z||w==="cell")}),onClick:c,id:`${w}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),u(!0)},onMouseLeave:()=>{f==null||f(),u(!1)},children:[!H&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),s?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:V,className:v.threadCommentIcon,style:{color:H?"rgb(var(--green-500))":""},children:H?a.jsx(be,{}):a.jsx(Te,{})}),(D==null?void 0:D.userID)===s.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:G,children:X.map(P=>a.jsx(ct,{onClose:g,unitId:t,subUnitId:r,item:P,isRoot:P.id===(s==null?void 0:s.root.id),editing:W===P.id,resolved:s==null?void 0:s.root.resolved,onEditingChange:A=>{x(A?P.id:"")},onReply:A=>{A&&requestAnimationFrame(()=>{var l;(l=Q.current)==null||l.reply(Ue([{type:"mention",content:{id:A.userID,label:A.name}}]))})},onAddComment:p,onDeleteComment:S},P.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:Q,unitId:t,subUnitId:r,onSave:async({text:P,attachments:A})=>{const l={text:P,attachments:A,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:D==null?void 0:D.userID,parentId:s==null?void 0:s.root.id,unitId:t,subUnitId:r,threadId:s==null?void 0:s.root.threadId};(p==null?void 0:p(l))!==!1&&(await y.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:l}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:M||!s,onCancel:()=>{s||g==null||g()}},`${M}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},ht=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:d,onResolve:c,sortComments:C,onItemLeave:g,onItemEnter:j,disableAdd:w,tempComment:M,onAddComment:I,onDeleteComment:f,showComments:p}=n,[S,O]=h.useState("all"),[T,Z]=h.useState("all"),u=o.useDependency(o.LocaleService),W=o.useDependency(o.UserManagerService),x=o.useDependency(b.ThreadCommentModel),[R,s]=h.useState(()=>x.getUnit(e)),y=o.useDependency(m.ThreadCommentPanelService),U=k.useObservable(y.activeCommentId$),H=k.useObservable(x.commentUpdate$),D=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),G="panel",V=k.useObservable(W.currentUser$),q=h.useMemo(()=>{var de;const l=S==="all"?R:(de=R.filter(E=>E.subUnitId===Q))!=null?de:[],te=C!=null?C:E=>E,se=l.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(p){const E=new Map;return se.forEach(K=>{E.set(K.id,K)}),[...p,""].map(K=>E.get(K)).filter(Boolean)}else return te(se)},[p,S,R,C,Q]),B=h.useMemo(()=>[...q.filter(l=>!l.resolved),...q.filter(l=>l.resolved)],[q]),oe=h.useMemo(()=>T==="resolved"?B.filter(l=>l.resolved):T==="unsolved"?B.filter(l=>!l.resolved):T==="concern_me"&&V!=null&&V.userID?B.filter(l=>l==null?void 0:l.users.has(V.userID)):B,[B,V==null?void 0:V.userID,T]),Y=M?[M,...oe]:oe,ae=Y.filter(l=>!l.resolved),$=Y.filter(l=>l.resolved),ee=T!=="all"||S!=="all",P=()=>{Z("all"),O("all")};h.useEffect(()=>{e&&s(x.getUnit(e))},[e,x,H]),h.useEffect(()=>{var E;if(!U)return;if(!X.current){X.current=!0;return}const{unitId:l,subUnitId:te,commentId:se}=U,de=`${G}-${l}-${te}-${se}`;(E=document.getElementById(de))==null||E.scrollIntoView({block:"center"})},[U]);const A=l=>a.jsx(Ne,{prefix:G,getSubUnitName:d,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(U==null?void 0:U.commentId)===l.id,showHighlight:(U==null?void 0:U.commentId)===l.id,onClick:()=>{X.current=!1,l.resolved?D.executeCommand(F.id):D.executeCommand(F.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>j==null?void 0:j(l),onMouseLeave:()=>g==null?void 0:g(l),onAddComment:I,onDeleteComment:f,onResolve:te=>c==null?void 0:c(l.id,te)},l.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:l=>O(l),options:[{value:"current",label:u.t("threadCommentUI.filter.sheet.current")},{value:"all",label:u.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:T,onChange:l=>Z(l),options:[{value:"all",label:u.t("threadCommentUI.filter.status.all")},{value:"resolved",label:u.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:u.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:u.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(A),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(A),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?u.t("threadCommentUI.panel.filterEmpty"):u.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:P,type:"link",children:u.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:w,children:[a.jsx(Se,{}),u.t("threadCommentUI.panel.addComment")]})]})]})};m.IThreadCommentMentionDataService=le,m.SetActiveCommentOperation=F,m.THREAD_COMMENT_PANEL=he,m.ThreadCommentPanel=ht,m.ThreadCommentTree=Ne,m.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/docs-thread-comment-ui
|
|
50
|
-
|
|
51
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverDocsThreadCommentUi={},c.UniverCore,c.UniverEngineRender,c.UniverThreadCommentUi,c.UniverDocs,c.UniverDocsUi,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React))})(this,function(c,o,g,T,M,j,w,C,A,O){"use strict";var Fe=Object.defineProperty;var Le=(c,o,g)=>o in c?Fe(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var Y=(c,o,g)=>Le(c,typeof o!="symbol"?o+"":o,g);const se="DOC_THREAD_COMMENT_UI_PLUGIN",y="default_doc",de="docs-thread-comment-ui.config",ae={};var ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ce(t,r,i),i},Q=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Y(this,"_addingComment$",new A.BehaviorSubject(void 0));Y(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=le([Q(0,C.ISidebarService),Q(1,o.Inject(T.ThreadCommentPanelService))],U);var X={exports:{}},B={};/**
|
|
52
|
-
* @license React
|
|
53
|
-
* react-jsx-runtime.production.min.js
|
|
54
|
-
*
|
|
55
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the MIT license found in the
|
|
58
|
-
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var ue=O,ve=Symbol.for("react.element"),fe=Symbol.for("react.fragment"),he=Object.prototype.hasOwnProperty,Ce=ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pe={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var n,i={},s=null,d=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(d=t.ref);for(n in t)he.call(t,n)&&!pe.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ve,type:e,key:s,ref:d,props:i,_owner:Ce.current}}B.Fragment=fe,B.jsx=k,B.jsxs=k,X.exports=B;var Ie=X.exports;const W={id:"docs.command.add-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{comment:r,unitId:n}=t,s=await e.get(w.IThreadCommentDataSourceService).addComment(r),d=e.get(o.ICommandService),a=j.addCustomDecorationBySelectionFactory(e,{id:s.threadId,type:o.CustomDecorationType.COMMENT});if(a){const v={id:w.AddCommentMutation.id,params:{unitId:n,subUnitId:y,comment:s}},h={id:T.SetActiveCommentOperation.id,params:{unitId:n,subUnitId:y,commentId:s.id}};return(await o.sequenceExecute([v,a,h],d)).result}return!1}},K={id:"docs.command.delete-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{commentId:r,unitId:n}=t,i=e.get(o.ICommandService),s=j.deleteCustomDecorationFactory(e,{id:r,unitId:n});return s?(await o.sequenceExecute([s],i)).result:!1}},ee=e=>{const t=e.get(g.IRenderManagerService),r=e.get(M.DocSelectionManagerService),n=t.getCurrent(),i=n==null?void 0:n.with(M.DocSkeletonManagerService).getSkeleton(),s=i==null?void 0:i.getViewModel().getEditArea();if(s===g.DocumentEditArea.FOOTER||s===g.DocumentEditArea.HEADER)return!0;const d=r.getActiveTextRange();return!!(d==null||d.collapsed)};function _e(e){return{id:V.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC,void 0,o.SHEET_EDITOR_UNITS),disabled$:new A.Observable(function(t){const n=e.get(M.DocSelectionManagerService).textSelection$.pipe(A.debounceTime(16)).subscribe(()=>{t.next(ee(e))});return()=>{n.unsubscribe()}})}}function Se(e){return{id:G.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC)}}const P=()=>{const e=o.useDependency(o.IUniverInstanceService),t=o.useDependency(o.Injector),r=O.useMemo(()=>e.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_DOC),[e]),n=o.useObservable(r),i=O.useMemo(()=>new A.Observable(l=>l.next(y)),[]),s=o.useDependency(M.DocSelectionManagerService),d=O.useMemo(()=>s.textSelection$.pipe(A.debounceTime(16)),[s.textSelection$]);o.useObservable(d);const a=o.useDependency(o.ICommandService),v=o.useDependency(U),h=o.useObservable(v.addingComment$),[m,_]=O.useState([]);if(O.useEffect(()=>{var E;const l=new Set,u=n==null?void 0:n.getCustomDecorations();_((E=u==null?void 0:u.map(f=>f.id).filter(f=>{const b=l.has(f);return l.add(f),!b}))!=null?E:[]);const D=a.onCommandExecuted(f=>{var b;if(f.id===M.RichTextEditingMutation.id){const $=new Set,q=n==null?void 0:n.getCustomDecorations();_((b=q==null?void 0:q.map(H=>H.id).filter(H=>{const Be=$.has(H);return $.add(H),!Be}))!=null?b:[])}});return()=>{D.dispose()}},[a,n]),!n)return null;const S=ee(t),p=n.getUnitId();return Ie.jsx(T.ThreadCommentPanel,{unitId:p,subUnitId$:i,type:o.UniverInstanceType.UNIVER_DOC,onAdd:()=>{a.executeCommand(V.id)},getSubUnitName:()=>"",disableAdd:S,tempComment:h,onAddComment:l=>{if(!l.parentId){const u={unitId:p,range:h,comment:l};return a.executeCommand(W.id,u),v.endAdd(),!1}return!0},onDeleteComment:l=>{if(!l.parentId){const u={unitId:p,commentId:l.id};return a.executeCommand(K.id,u),!1}return!0},showComments:m})};P.componentKey="univer.doc.thread-comment-panel";const N={id:"docs.operation.show-comment-panel",type:o.CommandType.OPERATION,handler(e,t){var i;const r=e.get(T.ThreadCommentPanelService),n=e.get(C.ISidebarService);return(!r.panelVisible||((i=n.options.children)==null?void 0:i.label)!==P.componentKey)&&(n.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},G={id:"docs.operation.toggle-comment-panel",type:o.CommandType.OPERATION,handler(e){var n;const t=e.get(T.ThreadCommentPanelService),r=e.get(C.ISidebarService);return!t.panelVisible||((n=r.options.children)==null?void 0:n.label)!==P.componentKey?(r.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>t.setPanelVisible(!1)}),t.setPanelVisible(!0)):(r.close(),t.setPanelVisible(!1),t.setActiveComment(null)),!0}},V={id:"docs.operation.start-add-comment",type:o.CommandType.OPERATION,handler(e){var f,b,$;const t=e.get(T.ThreadCommentPanelService),n=e.get(o.IUniverInstanceService).getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC),i=e.get(M.DocSelectionManagerService),s=e.get(g.IRenderManagerService),d=e.get(o.UserManagerService),a=e.get(U),v=e.get(o.ICommandService),h=e.get(C.ISidebarService),m=i.getActiveTextRange();if(!n||!m)return!1;const _=(f=s.getRenderById(n.getUnitId()))==null?void 0:f.with(j.DocSelectionRenderService);if(m.collapsed)return t.panelVisible?(t.setPanelVisible(!1),h.close()):v.executeCommand(N.id),!0;v.executeCommand(N.id);const S=n.getUnitId(),p=(($=(b=n.getBody())==null?void 0:b.dataStream)!=null?$:"").slice(m.startOffset,m.endOffset),l=o.BuildTextUtils.transform.getPlainText(p),u=y,D="",E={unitId:S,subUnitId:u,id:D,ref:l,dT:w.getDT(),personId:d.getCurrentUser().userID,text:{dataStream:`\r
|
|
60
|
-
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs-pro/thread-comment-datasource
|
|
64
|
-
|
|
65
|
-
function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=function(_0x1085fa,_0x46606a){_0x1085fa=_0x1085fa-0xfe;let _0x2655bd=_0x45cb86[_0x1085fa];return _0x2655bd;},_0x1085(_0x330f90,_0x71315c);}(function(_0x1c3962,_0x38a0e2){const _0xcc7751=_0x1085,_0x25cd31=_0x1c3962();while(!![]){try{const _0x4ef23e=parseInt(_0xcc7751(0x155))/0x1+parseInt(_0xcc7751(0x119))/0x2+parseInt(_0xcc7751(0x193))/0x3*(-parseInt(_0xcc7751(0x15d))/0x4)+-parseInt(_0xcc7751(0x147))/0x5+-parseInt(_0xcc7751(0x16c))/0x6*(-parseInt(_0xcc7751(0x181))/0x7)+parseInt(_0xcc7751(0x18c))/0x8+-parseInt(_0xcc7751(0x157))/0x9;if(_0x4ef23e===_0x38a0e2)break;else _0x25cd31['push'](_0x25cd31['shift']());}catch(_0x1c931a){_0x25cd31['push'](_0x25cd31['shift']());}}}(_0x45cb,0xc73dd),function(_0x223df9,_0x2a32d0){const _0x169cb1=_0x1085;typeof exports==_0x169cb1(0x16e)&&typeof module<'u'?_0x2a32d0(exports,require('@univerjs/core'),require(_0x169cb1(0x13d)),require(_0x169cb1(0x178)),require(_0x169cb1(0x105)),require(_0x169cb1(0x13b)),require(_0x169cb1(0x128)),require(_0x169cb1(0x120))):typeof define=='function'&&define['amd']?define([_0x169cb1(0x106),_0x169cb1(0x188),'@univerjs/thread-comment-ui','@univerjs-pro/collaboration-client',_0x169cb1(0x105),_0x169cb1(0x13b),'rxjs',_0x169cb1(0x120)],_0x2a32d0):(_0x223df9=typeof globalThis<'u'?globalThis:_0x223df9||self,_0x2a32d0(_0x223df9[_0x169cb1(0x143)]={},_0x223df9['UniverCore'],_0x223df9[_0x169cb1(0x187)],_0x223df9[_0x169cb1(0x16d)],_0x223df9[_0x169cb1(0x160)],_0x223df9[_0x169cb1(0x144)],_0x223df9[_0x169cb1(0x128)],_0x223df9[_0x169cb1(0x12b)]));}(this,function(_0x17a296,_0x3d0190,_0x3ed21d,_0x3db026,_0x51384d,_0x5c0884,_0x1b5c0a,_0x49bd93){'use strict';const _0x2d1c5a=_0x1085;const _0x581514='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x5cda73=(_0x209b8d=>(_0x209b8d[_0x209b8d[_0x2d1c5a(0x121)]=0x0]=_0x2d1c5a(0x121),_0x209b8d[_0x209b8d[_0x2d1c5a(0x16f)]=0x1]=_0x2d1c5a(0x16f),_0x209b8d[_0x209b8d[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x209b8d))(_0x5cda73||{}),_0x4aae21=(_0x569621=>(_0x569621[_0x569621[_0x2d1c5a(0x12c)]=0x0]=_0x2d1c5a(0x12c),_0x569621[_0x569621[_0x2d1c5a(0xfe)]=0x1]=_0x2d1c5a(0xfe),_0x569621[_0x569621['Reply']=0x2]=_0x2d1c5a(0x194),_0x569621[_0x569621[_0x2d1c5a(0x18f)]=0x3]=_0x2d1c5a(0x18f),_0x569621[_0x569621['Delete']=0x4]=_0x2d1c5a(0x15f),_0x569621[_0x569621[_0x2d1c5a(0x163)]=0x5]='Solve',_0x569621[_0x569621[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x569621))(_0x4aae21||{});const _0x1d64e1=_0x32d4fa=>_0x3d0190[_0x2d1c5a(0x168)](new Date(+_0x32d4fa))['format'](_0x2d1c5a(0x17a)),_0x41e898=async(_0x1daffb,_0x2ae0d7)=>{const _0x49961f=_0x2d1c5a,_0x4f8c20=_0x1daffb[_0x49961f(0x191)](_0x3d0190[_0x49961f(0x11c)]),_0x50f0c5=_0x1daffb[_0x49961f(0x191)](_0x49bd93[_0x49961f(0x176)]);_0x2ae0d7[_0x49961f(0x11d)](_0x27ee20=>{const _0x12083e=_0x49961f;_0x4f8c20['getUser'](_0x27ee20)&&_0x2ae0d7[_0x12083e(0x124)](_0x27ee20);}),_0x2ae0d7[_0x49961f(0x156)]&&(await _0x50f0c5[_0x49961f(0x191)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2ae0d7]}}))[_0x49961f(0x141)][_0x49961f(0x177)][_0x49961f(0x11d)](_0x1f578d=>{const _0x5d3ae8=_0x49961f;_0x1f578d&&_0x4f8c20[_0x5d3ae8(0x111)](_0x1f578d);});};var _0x2b18e9=Object['defineProperty'],_0xaed435=Object['getOwnPropertyDescriptor'],_0xdbf4ec=(_0x3443bc,_0x3e2fe7,_0x3d4a6c,_0x5e2b31)=>{const _0x5b531d=_0x2d1c5a;for(var _0x15e483=_0x5e2b31>0x1?void 0x0:_0x5e2b31?_0xaed435(_0x3e2fe7,_0x3d4a6c):_0x3e2fe7,_0x229be8=_0x3443bc[_0x5b531d(0x104)]-0x1,_0x29a12f;_0x229be8>=0x0;_0x229be8--)(_0x29a12f=_0x3443bc[_0x229be8])&&(_0x15e483=(_0x5e2b31?_0x29a12f(_0x3e2fe7,_0x3d4a6c,_0x15e483):_0x29a12f(_0x15e483))||_0x15e483);return _0x5e2b31&&_0x15e483&&_0x2b18e9(_0x3e2fe7,_0x3d4a6c,_0x15e483),_0x15e483;},_0x470027=(_0x2a44f3,_0x529c33)=>(_0x166652,_0x92e77d)=>_0x529c33(_0x166652,_0x92e77d,_0x2a44f3);let _0x2c4030=class extends _0x3d0190['Disposable']{constructor(_0x1c592b,_0xef8ea5,_0x4e6c26,_0x22f0c3){const _0x6f6060=_0x2d1c5a;super(),this[_0x6f6060(0x11f)]=_0x1c592b,this[_0x6f6060(0x114)]=_0xef8ea5,this[_0x6f6060(0x151)]=_0x4e6c26,this[_0x6f6060(0x101)]=_0x22f0c3,this['_init'](),this[_0x6f6060(0x127)]();}[_0x2d1c5a(0x127)](){const _0x568e0e=_0x2d1c5a;this[_0x568e0e(0xff)](this['_threadCommentModel'][_0x568e0e(0x16a)][_0x568e0e(0x100)](_0x1b5c0a[_0x568e0e(0x15e)](0x10))['subscribe'](_0x496c60=>{const _0x35946b=new Set();_0x496c60['forEach'](_0x34a6dc=>{const _0xeb10e9=_0x1085;switch(_0x34a6dc[_0xeb10e9(0x117)]){case _0xeb10e9(0x139):{const _0x5d3422=_0x34a6dc[_0xeb10e9(0x17e)][_0xeb10e9(0x162)];_0x35946b[_0xeb10e9(0x139)](_0x5d3422);break;}}}),_0x41e898(this['_injector'],_0x35946b);}));}['_init'](){const _0x32d451=_0x2d1c5a;this[_0x32d451(0xff)](this['_commentService']['commentUpdate$'][_0x32d451(0x167)](async _0x490edc=>{const _0x159d32=_0x32d451;var _0x22400e,_0xc8d55f,_0x22c0dd,_0x4b8c1f;const _0x29d0eb=(_0x22400e=this['_threadCommentModel']['getUnit'](_0x490edc[_0x159d32(0x17d)])['find'](_0x43f4ee=>_0x43f4ee['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x22400e['root'];if(!_0x29d0eb)return;const {unitId:_0x117158,subUnitId:_0x3aafe5}=_0x29d0eb;switch(_0x490edc[_0x159d32(0x130)]&&this[_0x159d32(0x151)]['addUser'](_0x490edc['user']),_0x490edc[_0x159d32(0x117)]){case _0x4aae21[_0x159d32(0xfe)]:break;case _0x4aae21[_0x159d32(0x194)]:{this['_threadCommentModel']['addComment'](_0x117158,_0x3aafe5,{'unitId':_0x117158,'subUnitId':_0x3aafe5,'ref':'','id':_0x490edc['replyId'],'dT':_0x1d64e1(+_0x490edc['createTimestamp']),'threadId':_0x490edc[_0x159d32(0x14f)],'personId':(_0x22c0dd=(_0xc8d55f=_0x490edc[_0x159d32(0x130)])==null?void 0x0:_0xc8d55f[_0x159d32(0x171)])!=null?_0x22c0dd:_0x490edc['userId'],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)]),'parentId':_0x29d0eb['id']});break;}case _0x4aae21[_0x159d32(0x15f)]:{const _0x55b8a5=this[_0x159d32(0x114)][_0x159d32(0x183)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);_0x55b8a5&&_0x55b8a5['parentId']&&this[_0x159d32(0x114)][_0x159d32(0x140)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);break;}case _0x4aae21['Edit']:{this[_0x159d32(0x114)][_0x159d32(0x134)](_0x117158,_0x3aafe5,{'commentId':_0x490edc[_0x159d32(0x14e)],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)])});break;}case _0x4aae21[_0x159d32(0x163)]:{const _0x99e61a=(_0x4b8c1f=this[_0x159d32(0x114)][_0x159d32(0x174)](_0x490edc['unitId'])[_0x159d32(0x154)](_0x232300=>_0x232300['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x4b8c1f[_0x159d32(0x185)];_0x99e61a&&this[_0x159d32(0x114)]['resolveComment'](_0x117158,_0x3aafe5,_0x99e61a['id'],_0x490edc[_0x159d32(0x166)]===_0x5cda73[_0x159d32(0x16f)]);break;}}}));}};_0x2c4030=_0xdbf4ec([_0x470027(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x16b)])),_0x470027(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x5c0884['ThreadCommentModel'])),_0x470027(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x470027(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190['Injector']))],_0x2c4030);const _0x168b3a=_0x2d1c5a(0x12d),_0x5c96e1={};var _0x3f3071=Object[_0x2d1c5a(0x18e)],_0x4e1f86=Object['getOwnPropertyDescriptor'],_0x34829b=(_0x4ac3ab,_0x20f67f,_0x137e72,_0x56aa0f)=>{for(var _0x42b400=_0x56aa0f>0x1?void 0x0:_0x56aa0f?_0x4e1f86(_0x20f67f,_0x137e72):_0x20f67f,_0x382a88=_0x4ac3ab['length']-0x1,_0x583b56;_0x382a88>=0x0;_0x382a88--)(_0x583b56=_0x4ac3ab[_0x382a88])&&(_0x42b400=(_0x56aa0f?_0x583b56(_0x20f67f,_0x137e72,_0x42b400):_0x583b56(_0x42b400))||_0x42b400);return _0x56aa0f&&_0x42b400&&_0x3f3071(_0x20f67f,_0x137e72,_0x42b400),_0x42b400;},_0x5b385f=(_0x3179ab,_0x2379b8)=>(_0x4ad694,_0x3d031b)=>_0x2379b8(_0x4ad694,_0x3d031b,_0x3179ab);function _0x287c05(_0x334b3e,_0x1c3ac9){const _0x1da2de=_0x2d1c5a,_0x316913=_0x334b3e[_0x1da2de(0x116)][0x0];return{..._0x1c3ac9,'id':_0x316913[_0x1da2de(0x14e)],'resolved':_0x334b3e[_0x1da2de(0x166)]===0x1,'dT':_0x1d64e1(_0x316913[_0x1da2de(0x123)]),'personId':_0x316913[_0x1da2de(0x12a)],'threadId':_0x316913[_0x1da2de(0x14f)]};}function _0x4513b1(_0x5c5d7f,_0xee5259,_0x1ea201){const _0x1aa179=_0x2d1c5a;var _0x30e012,_0x4a60c9;if(((_0x4a60c9=(_0x30e012=_0x5c5d7f==null?void 0x0:_0x5c5d7f['replies'])==null?void 0x0:_0x30e012[_0x1aa179(0x104)])!=null?_0x4a60c9:0x0)>0x0){const _0x33a106=(_0x413bee,_0x1ef023)=>({'id':_0x413bee[_0x1aa179(0x14e)],'threadId':_0x413bee['threadId'],'dT':_0x1d64e1(_0x413bee['createTimestamp']),'personId':_0x413bee['userId'],'resolved':_0x5c5d7f['solved']===_0x5cda73[_0x1aa179(0x16f)],'unitId':_0xee5259,'subUnitId':_0x1ea201,'text':JSON[_0x1aa179(0x164)](_0x413bee['content']),'parentId':_0x1ef023}),_0x2fcf35=_0x33a106(_0x5c5d7f['replies'][0x0]);return{..._0x2fcf35,'children':_0x5c5d7f[_0x1aa179(0x116)]['slice'](0x1)[_0x1aa179(0x17b)](_0x25c910=>_0x33a106(_0x25c910,_0x2fcf35['id']))};}return null;}let _0x4c567b=class{constructor(_0x504ccd,_0x440d1d,_0x13d849,_0x1e6654){const _0x21ba5d=_0x2d1c5a;this[_0x21ba5d(0x109)]=_0x504ccd,this[_0x21ba5d(0x151)]=_0x440d1d,this[_0x21ba5d(0x102)]=_0x13d849,this[_0x21ba5d(0x101)]=_0x1e6654;}async[_0x2d1c5a(0x126)](_0x2d47fd){const _0x30ca48=_0x2d1c5a;var _0x23c2b9,_0x54c2a1;const {parentId:_0x92c8a9,unitId:_0x5cc676,text:_0x3d84cf,threadId:_0x5735b3}=_0x2d47fd,_0x2e07a3=(_0x54c2a1=(_0x23c2b9=_0x3d84cf[_0x30ca48(0x135)])==null?void 0x0:_0x23c2b9['filter'](_0x3766f4=>_0x3766f4[_0x30ca48(0x15b)]===_0x3d0190[_0x30ca48(0x150)][_0x30ca48(0x18b)])[_0x30ca48(0x17b)](_0x3231ef=>_0x3231ef[_0x30ca48(0x122)]))!=null?_0x54c2a1:[],_0x57e106=JSON[_0x30ca48(0x14d)](_0x3d84cf),_0x44db1c=(await this[_0x30ca48(0x102)]['requireSession'](_0x5cc676))[_0x30ca48(0x18a)]();if(_0x92c8a9){const _0x20deb8={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3,'threadId':_0x5735b3},_0x5ed8eb=(await this['_httpService'][_0x30ca48(0x14b)]('/universer-api/comment/unit/'+_0x5cc676+_0x30ca48(0x192),{'body':_0x20deb8}))[_0x30ca48(0x141)][_0x30ca48(0x161)];return{..._0x2d47fd,'id':_0x5ed8eb[_0x30ca48(0x14e)],'dT':_0x3d0190[_0x30ca48(0x168)](+_0x5ed8eb[_0x30ca48(0x123)])['format'](_0x30ca48(0x17a)),'personId':_0x5ed8eb['userId']};}else{const _0x36ed66={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3},_0x2048d0=await this[_0x30ca48(0x109)][_0x30ca48(0x14b)](_0x30ca48(0x10a)+_0x5cc676+_0x30ca48(0x184),{'body':_0x36ed66});return _0x287c05(_0x2048d0[_0x30ca48(0x141)][_0x30ca48(0x17f)],_0x2d47fd);}}async[_0x2d1c5a(0x134)](_0xa03223){const _0x2b9009=_0x2d1c5a;var _0xd70d8b,_0x2971aa;const {text:_0xa9b207,unitId:_0x38e37f}=_0xa03223,_0x2a422d=(_0x2971aa=(_0xd70d8b=_0xa9b207[_0x2b9009(0x135)])==null?void 0x0:_0xd70d8b[_0x2b9009(0x175)](_0x2e447c=>_0x2e447c['rangeType']===_0x3d0190[_0x2b9009(0x150)]['COMMENT'])[_0x2b9009(0x17b)](_0x2a0ee2=>_0x2a0ee2[_0x2b9009(0x122)]))!=null?_0x2971aa:[],_0x27365a=JSON[_0x2b9009(0x14d)](_0xa9b207),_0xa8dbb2=_0xa03223[_0x2b9009(0x14f)],_0x32e73c=_0xa03223['id'],_0x30dbfc={'memberId':(await this[_0x2b9009(0x102)][_0x2b9009(0x11e)](_0x38e37f))['getMemberID'](),'unitId':_0x38e37f,'threadId':_0xa8dbb2,'mention':_0x2a422d,'content':_0x27365a,'replyId':_0x32e73c},_0x335d49=await this[_0x2b9009(0x109)]['post'](_0x2b9009(0x10a)+_0x38e37f+_0x2b9009(0x13f),{'body':_0x30dbfc});return!_0x335d49[_0x2b9009(0x141)][_0x2b9009(0x132)]||_0x335d49['body']['error'][_0x2b9009(0x107)]===0x1;}async[_0x2d1c5a(0x13e)](_0x25130f){const _0x3f746e=_0x2d1c5a,{unitId:_0x45df06}=_0x25130f,_0x4b542f=_0x25130f[_0x3f746e(0x14f)],_0x458032={'memberId':this['_userService'][_0x3f746e(0x10b)]()['userID'],'unitId':_0x45df06,'threadId':_0x4b542f,'solved':_0x25130f[_0x3f746e(0x138)]?_0x5cda73[_0x3f746e(0x16f)]:_0x5cda73[_0x3f746e(0x121)]},_0x5d5e33=await this[_0x3f746e(0x109)][_0x3f746e(0x14b)](_0x3f746e(0x10a)+_0x45df06+_0x3f746e(0x186),{'body':_0x458032});return!_0x5d5e33[_0x3f746e(0x141)]['error']||_0x5d5e33[_0x3f746e(0x141)][_0x3f746e(0x132)][_0x3f746e(0x107)]===0x1;}async[_0x2d1c5a(0x140)](_0x4bf704,_0x13e9f4,_0x4a7c8d,_0x3aaf08){const _0x2b2280=_0x2d1c5a,_0x2f3900={'memberId':(await this[_0x2b2280(0x102)][_0x2b2280(0x11e)](_0x4bf704))[_0x2b2280(0x18a)](),'threadId':_0x4a7c8d,'replyId':_0x3aaf08,'unitId':_0x4bf704},_0xc6ccca=await this[_0x2b2280(0x109)][_0x2b2280(0x14b)]('/universer-api/comment/unit/'+_0x4bf704+_0x2b2280(0x172),{'body':_0x2f3900});return!_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]||_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]['code']===0x1;}async['listComments'](_0x4daf68,_0x3df24c,_0x30e3d8){const _0x5d19cd=_0x2d1c5a,_0x76a77c={'unitId':_0x4daf68,'threadId':_0x30e3d8},_0x2dd97e=await this[_0x5d19cd(0x109)]['post'](_0x5d19cd(0x10a)+_0x4daf68+_0x5d19cd(0x179),{'body':_0x76a77c}),_0x3e6e53=_0x30e3d8[_0x5d19cd(0x17b)](_0x3a0879=>_0x4513b1(_0x2dd97e['body']['comments'][_0x3a0879],_0x4daf68,_0x3df24c))['filter'](Boolean);return Object[_0x5d19cd(0x112)](_0x2dd97e[_0x5d19cd(0x141)][_0x5d19cd(0x177)])[_0x5d19cd(0x11d)](_0x4e7ff0=>{const _0x434fbd=_0x5d19cd;this['_userService'][_0x434fbd(0x111)](_0x4e7ff0);}),_0x3e6e53;}['saveCommentToSnapshot'](_0x2a7527){const _0x25447e=_0x2d1c5a;return{'id':_0x2a7527['id'],'threadId':_0x2a7527[_0x25447e(0x14f)],'ref':_0x2a7527[_0x25447e(0x11b)]};}};_0x4c567b=_0x34829b([_0x5b385f(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93['HTTPService'])),_0x5b385f(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x5b385f(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x10c)])),_0x5b385f(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)]))],_0x4c567b);var _0x570b55=Object[_0x2d1c5a(0x18e)],_0x4c869a=Object[_0x2d1c5a(0x145)],_0x2bb772=(_0x5d19b3,_0x75698f,_0x41601e,_0x4776a3)=>{const _0x42d174=_0x2d1c5a;for(var _0x5d00a1=_0x4776a3>0x1?void 0x0:_0x4776a3?_0x4c869a(_0x75698f,_0x41601e):_0x75698f,_0x372fde=_0x5d19b3[_0x42d174(0x104)]-0x1,_0x2d1d7c;_0x372fde>=0x0;_0x372fde--)(_0x2d1d7c=_0x5d19b3[_0x372fde])&&(_0x5d00a1=(_0x4776a3?_0x2d1d7c(_0x75698f,_0x41601e,_0x5d00a1):_0x2d1d7c(_0x5d00a1))||_0x5d00a1);return _0x4776a3&&_0x5d00a1&&_0x570b55(_0x75698f,_0x41601e,_0x5d00a1),_0x5d00a1;},_0x49a366=(_0x4fbd56,_0x28563b)=>(_0x62fef0,_0x2e0de7)=>_0x28563b(_0x62fef0,_0x2e0de7,_0x4fbd56);let _0x6c0c22=class{constructor(_0x8dc74c){const _0x9e5a88=_0x2d1c5a;this[_0x9e5a88(0x109)]=_0x8dc74c;}async[_0x2d1c5a(0x12e)](_0x44bee6,_0x20771b,_0x304520){const _0x58ba96=_0x2d1c5a,_0x5c5129=new URL(window[_0x58ba96(0x18d)][_0x58ba96(0x173)])['searchParams'][_0x58ba96(0x191)](_0x58ba96(0x110));if(!_0x5c5129)return[];const _0x45b2ad=window['location'][_0x58ba96(0x148)],_0x371842=window[_0x58ba96(0x18d)][_0x58ba96(0x158)]===_0x58ba96(0x12f)?_0x58ba96(0x165):_0x58ba96(0x13a);return(await this[_0x58ba96(0x109)][_0x58ba96(0x191)](_0x371842+_0x58ba96(0x149)+_0x45b2ad+_0x58ba96(0x103),{'params':{'objectID':_0x5c5129,'unitID':_0x5c5129}}))[_0x58ba96(0x141)][_0x58ba96(0x108)]['map'](_0x2a842b=>{const _0x1b1849=_0x58ba96;var _0x1e4d30,_0xf43929,_0x5015c8,_0x1c8f43,_0x561c23,_0x131e08;return{'id':(_0xf43929=(_0x1e4d30=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x1e4d30[_0x1b1849(0x171)])!=null?_0xf43929:'','label':(_0x1c8f43=(_0x5015c8=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x5015c8[_0x1b1849(0x15c)])!=null?_0x1c8f43:'','icon':(_0x131e08=(_0x561c23=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x561c23[_0x1b1849(0x133)])!=null?_0x131e08:'','type':_0x1b1849(0x130)};});}};_0x6c0c22=_0x2bb772([_0x49a366(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93[_0x2d1c5a(0x176)]))],_0x6c0c22);var _0x37496f=Object[_0x2d1c5a(0x18e)],_0x2a227c=Object[_0x2d1c5a(0x145)],_0x4d0464=(_0xd2a913,_0x87dbce,_0x5883ab,_0x51ad35)=>{for(var _0x14a9f4=_0x51ad35>0x1?void 0x0:_0x51ad35?_0x2a227c(_0x87dbce,_0x5883ab):_0x87dbce,_0x44abcb=_0xd2a913['length']-0x1,_0x5f82e1;_0x44abcb>=0x0;_0x44abcb--)(_0x5f82e1=_0xd2a913[_0x44abcb])&&(_0x14a9f4=(_0x51ad35?_0x5f82e1(_0x87dbce,_0x5883ab,_0x14a9f4):_0x5f82e1(_0x14a9f4))||_0x14a9f4);return _0x51ad35&&_0x14a9f4&&_0x37496f(_0x87dbce,_0x5883ab,_0x14a9f4),_0x14a9f4;},_0x434cce=(_0x1e9d3e,_0x140f0b)=>(_0x18600b,_0x5bb0a4)=>_0x140f0b(_0x18600b,_0x5bb0a4,_0x1e9d3e);let _0x3d1a79=class extends _0x3d0190[_0x2d1c5a(0x125)]{constructor(_0x3b6ddb,_0x357b76,_0x337cf9,_0x481722){const _0x165423=_0x2d1c5a;super(),this[_0x165423(0x142)]=_0x3b6ddb,this[_0x165423(0x17c)]=_0x357b76,this[_0x165423(0x136)]=_0x337cf9,this[_0x165423(0x146)]=_0x481722,this[_0x165423(0x190)]();}[_0x2d1c5a(0x190)](){const _0x38ca74=_0x2d1c5a;this[_0x38ca74(0x142)][_0x38ca74(0x15a)]=this[_0x38ca74(0x17c)],this[_0x38ca74(0x142)][_0x38ca74(0x152)]=!0x1,this[_0x38ca74(0x136)]['dataSource']=this[_0x38ca74(0x146)];}};_0x3d1a79=_0x4d0464([_0x434cce(0x0,_0x5c0884['IThreadCommentDataSourceService']),_0x434cce(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x4c567b)),_0x434cce(0x2,_0x3ed21d[_0x2d1c5a(0x14c)]),_0x434cce(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x6c0c22))],_0x3d1a79);var _0x25b1bc=Object[_0x2d1c5a(0x18e)],_0x271190=Object[_0x2d1c5a(0x145)],_0x51ac44=(_0x241833,_0x23df0b,_0x468956)=>_0x23df0b in _0x241833?_0x25b1bc(_0x241833,_0x23df0b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x468956}):_0x241833[_0x23df0b]=_0x468956,_0x222d11=(_0x2385c4,_0x1ead91,_0x5319db,_0x2527a7)=>{const _0x478081=_0x2d1c5a;for(var _0x55b4d9=_0x2527a7>0x1?void 0x0:_0x2527a7?_0x271190(_0x1ead91,_0x5319db):_0x1ead91,_0x5b3d36=_0x2385c4[_0x478081(0x104)]-0x1,_0x196bb6;_0x5b3d36>=0x0;_0x5b3d36--)(_0x196bb6=_0x2385c4[_0x5b3d36])&&(_0x55b4d9=(_0x2527a7?_0x196bb6(_0x1ead91,_0x5319db,_0x55b4d9):_0x196bb6(_0x55b4d9))||_0x55b4d9);return _0x2527a7&&_0x55b4d9&&_0x25b1bc(_0x1ead91,_0x5319db,_0x55b4d9),_0x55b4d9;},_0x54454a=(_0x412be0,_0x463a27)=>(_0x108220,_0x1cfaae)=>_0x463a27(_0x108220,_0x1cfaae,_0x412be0),_0x3d7f66=(_0x3bb133,_0x545864,_0x5eac52)=>_0x51ac44(_0x3bb133,typeof _0x545864!=_0x2d1c5a(0x11a)?_0x545864+'':_0x545864,_0x5eac52);_0x17a296[_0x2d1c5a(0x159)]=class extends _0x3d0190[_0x2d1c5a(0x10e)]{constructor(_0x54fd89=_0x5c96e1,_0x322218,_0x48bb3f){const _0x37d3fc=_0x2d1c5a;super(),this['_config']=_0x54fd89,this['_injector']=_0x322218,this['_configService']=_0x48bb3f;const {..._0x3fd3f9}=this[_0x37d3fc(0x169)];this[_0x37d3fc(0x170)][_0x37d3fc(0x189)](_0x168b3a,_0x3fd3f9);}[_0x2d1c5a(0x131)](){const _0x2e3fbe=_0x2d1c5a;[[_0x6c0c22],[_0x4c567b],[_0x3d1a79],[_0x2c4030]][_0x2e3fbe(0x11d)](_0x3c3c13=>{const _0x20958e=_0x2e3fbe;this['_injector'][_0x20958e(0x139)](_0x3c3c13);});}[_0x2d1c5a(0x10d)](){const _0x31eae9=_0x2d1c5a;this[_0x31eae9(0x101)]['get'](_0x3d1a79),this[_0x31eae9(0x101)][_0x31eae9(0x191)](_0x2c4030);}},_0x3d7f66(_0x17a296['UniverThreadCommentDataSourcePlugin'],_0x2d1c5a(0x13c),_0x581514),_0x3d7f66(_0x17a296[_0x2d1c5a(0x159)],'type',_0x3d0190[_0x2d1c5a(0x129)][_0x2d1c5a(0x153)]),_0x17a296[_0x2d1c5a(0x159)]=_0x222d11([_0x3d0190['DependentOn'](_0x3ed21d['UniverThreadCommentUIPlugin'],_0x3db026[_0x2d1c5a(0x115)],_0x51384d[_0x2d1c5a(0x118)]),_0x54454a(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)])),_0x54454a(0x2,_0x3d0190['IConfigService'])],_0x17a296[_0x2d1c5a(0x159)]),Object['defineProperty'](_0x17a296,Symbol[_0x2d1c5a(0x14a)],{'value':'Module'});}));function _0x45cb(){const _0x4c3ba6=['delete','Disposable','addComment','_initUserSync','rxjs','UniverInstanceType','userId','UniverNetwork','Unknown','thread-comment-data-source.config','getMentions','https:','user','onStarting','error','avatar','updateComment','customRanges','_threadCommentMentionDataService','UNRECOGNIZED','resolved','add','http','@univerjs/thread-comment','pluginName','@univerjs/thread-comment-ui','resolveComment','/edit','deleteComment','body','_threadCommentDataSourceService','UniverProThreadCommentDatasource','UniverThreadComment','getOwnPropertyDescriptor','_threadCommentMentionDataSource','6846820HIrJlY','host','://','toStringTag','post','IThreadCommentMentionDataService','stringify','replyId','threadId','CustomRangeType','_userService','syncUpdateMutationToColla','UNIVER_UNKNOWN','find','748670RYfhYR','size','14296464KKikiZ','protocol','UniverThreadCommentDataSourcePlugin','dataSource','rangeType','name','580ElmYGS','bufferTime','Delete','UniverProLicense','reply','personId','Solve','parse','https','solved','subscribe','dayjs','_config','commentUpdate$','CommentService','4782FSQpvV','UniverProCollaborationClient','object','Solved','_configService','userID','/delete','href','getUnit','filter','HTTPService','users','@univerjs-pro/collaboration-client','/list','YYYY/MM/DD\x20HH:mm','map','_threadCommentDataSource','unitId','payload','comment','content','13615oBUuuF','Inject','getComment','/add','root','/solved','UniverThreadCommentUi','@univerjs/core','setConfig','getMemberID','COMMENT','7362024zfVyhe','location','defineProperty','Edit','_initDataSource','get','/reply','14718WcxWkQ','Reply','Add','disposeWithMe','pipe','_injector','_sessionService','/universer-api/authz/collaborator','length','@univerjs-pro/license','exports','code','collaborators','_httpService','/universer-api/comment/unit/','getCurrentUser','CollaborationSessionService','onReady','Plugin','Injector','unit','addUser','values','subject','_threadCommentModel','UniverCollaborationClientPlugin','replies','type','UniverLicensePlugin','2532470kOXJCz','symbol','ref','UserManagerService','forEach','requireSession','_commentService','@univerjs/network','OpenOrReOpen','rangeId','createTimestamp'];_0x45cb=function(){return _0x4c3ba6;};return _0x45cb();}
|
|
66
|
-
|
|
67
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/thread-comment-ui
|
|
68
|
-
|
|
69
|
-
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m.UniverThreadCommentUi={},m.UniverCore,m.UniverThreadComment,m.UniverUi,m.rxjs,m.React,m.UniverDesign,m.UniverDocs,m.UniverDocsUi,m.UniverEngineRender))})(this,function(m,o,b,k,ne,h,_,Me,Oe,Re){"use strict";var ut=Object.defineProperty;var vt=(m,o,b)=>o in m?ut(m,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[o]=b;var L=(m,o,b)=>vt(m,typeof o!="symbol"?o+"":o,b);var De=Object.defineProperty,we=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?we(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);m.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();L(this,"_panelVisible",!1);L(this,"_panelVisible$",new ne.BehaviorSubject(!1));L(this,"_activeCommentId");L(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));L(this,"panelVisible$",this._panelVisible$.asObservable());L(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},m.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],m.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(m.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(m.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};class Ve{constructor(){L(this,"dataSource");L(this,"renderSuggestion");L(this,"trigger","@")}async getMentions(e,t,r){return this.dataSource?this.dataSource.getMentions(e,t,r):[]}}const le=o.createIdentifier("thread-comment.mention-data.service");var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,We=(n,e,t,r)=>{for(var i=r>1?void 0:r?Be(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&ve(e,t,i),i},me=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Fe(n,typeof e!="symbol"?e+"":e,t);m.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:d,...c}=this._config;d&&this._configService.setConfig("menu",d,{merge:!0}),this._configService.setConfig(Le,c)}onStarting(){var e;o.mergeOverrideWithDependencies([[m.ThreadCommentPanelService],[le,{useClass:Ve}]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,F].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(m.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(m.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),m.UniverThreadCommentUIPlugin=We([o.DependentOn(b.UniverThreadCommentPlugin),me(1,o.Inject(o.Injector)),me(2,o.ICommandService),me(3,o.IConfigService)],m.UniverThreadCommentUIPlugin);var fe={exports:{}},re={};/**
|
|
70
|
-
* @license React
|
|
71
|
-
* react-jsx-runtime.production.min.js
|
|
72
|
-
*
|
|
73
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the MIT license found in the
|
|
76
|
-
* LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/var ze=h,Ze=Symbol.for("react.element"),Ge=Symbol.for("react.fragment"),Ke=Object.prototype.hasOwnProperty,Ye=ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function ge(n,e,t){var r,i={},d=null,c=null;t!==void 0&&(d=""+t),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(c=e.ref);for(r in e)Ke.call(e,r)&&!Je.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Ze,type:n,key:d,ref:c,props:i,_owner:Ye.current}}re.Fragment=Ge,re.jsx=ge,re.jsxs=ge,fe.exports=re;var a=fe.exports,N=function(){return N=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},N.apply(this,arguments)},Qe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,d=n.extend,c=Qe(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),g=h.useRef("_".concat($e()));return pe(t,"".concat(r),{defIds:t.defIds,idSuffix:g.current},N({ref:e,className:C},c),d)});function pe(n,e,t,r,i){return h.createElement(n.tag,N(N({key:e},Xe(n,t,i)),r),(qe(n,t).children||[]).map(function(d,c){return pe(d,"".concat(e,"-").concat(n.tag,"-").concat(c),t,void 0,i)}))}function Xe(n,e,t){var r=N({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(d){var c=d[0],C=d[1];typeof C=="string"&&(r[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function qe(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?N(N({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?N(N({},i),{attrs:N(N({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function $e(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:et}))});Ie.displayName="DeleteSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:tt}))});Se.displayName="IncreaseSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:nt}))});xe.displayName="MoreHorizontalSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:rt}))});ye.displayName="ReplyToCommentSingle";var it={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:it}))});be.displayName="ResolvedSingle";var ot={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:ot}))});Te.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},st=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},dt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),_e=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let d=0;return t==null||t.forEach(c=>{d<c.startIndex&&i.push({type:"text",content:e.slice(d,c.startIndex)}),i.push({type:"mention",content:{label:e.slice(c.startIndex,c.endIndex).slice(1,-1),id:c.rangeId}}),d=c.endIndex}),i.push({type:"text",content:e.slice(d,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const d=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:d,properties:{}});break}}}),e+=`
|
|
78
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},lt=n=>({display:n.label,id:`${n.id}`,raw:n}),mt=(n,e,t,r,i)=>{var c,C;const d=(c=n.raw)==null?void 0:c.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[d?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:d}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var x,R;const{comment:t,onSave:r,id:i,onCancel:d,autoFocus:c,unitId:C,subUnitId:g}=n,j=o.useDependency(le),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,f]=h.useState({...t}),[p,S]=h.useState(!1),O=h.useRef(null),T=o.useDependency(Me.DocSelectionManagerService),u=(x=o.useDependency(Re.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:x.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(s){var y;f({...t,text:s,attachments:[]}),(y=O.current)==null||y.inputElement.focus()}}));const W=()=>{var s;I.text&&(r==null||r({...I,text:I.text}),S(!1),f({text:void 0}),(s=O.current)==null||s.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:s=>s.preventDefault(),children:[a.jsx(_.Mentions,{ref:O,autoFocus:c,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?dt(_e(I.text)):"",onChange:s=>{s.target.value||f({...t,text:void 0}),f==null||f({...t,text:Ue(st(s.target.value))})},onFocus:()=>{const s=T.getActiveTextRange();s&&s.collapsed&&(u==null||u.removeAllRanges()),u==null||u.blur(),S(!0)},children:a.jsx(_.Mention,{trigger:j.trigger,data:(s,y)=>j.getMentions(s,C,g).then(U=>U.map(lt)).then(y),displayTransform:(s,y)=>`@${y} `,renderSuggestion:(R=j.renderSuggestion)!=null?R:mt},j.trigger)}),p?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{d==null||d(),S(!1),f({text:void 0}),w.executeCommand(F.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:W,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ct=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:d,onReply:c,resolved:C,isRoot:g,onClose:j,onDeleteComment:w}=n,M=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),f=o.useDependency(o.UserManagerService),p=f.getUser(e.personId),S=k.useObservable(f.currentUser$),O=(S==null?void 0:S.userID)===e.personId,T=e.id===Ee,[Z,u]=h.useState(!1),W=()=>{(w==null?void 0:w(e))!==!1&&(M.executeCommand(g?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),g&&(j==null||j()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>u(!1),onMouseEnter:()=>u(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:p==null?void 0:p.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(p==null?void 0:p.name)||" "}),a.jsxs("div",{children:[T||C?null:Z?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>c(p),children:a.jsx(ye,{})}):null,O&&!T&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>d==null?void 0:d(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:W,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(xe,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>d==null?void 0:d(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:x,attachments:R})=>{d==null||d(!1),M.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:x,attachments:R}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:_e(e.text).map((x,R)=>{switch(x.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",x.content.label," "]},R);default:return x.content}})})]})},Ne=n=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:d=!0,onClick:c,showHighlight:C,onClose:g,getSubUnitName:j,prefix:w,autoFocus:M,onMouseEnter:I,onMouseLeave:f,onAddComment:p,onDeleteComment:S,onResolve:O}=n,T=o.useDependency(b.ThreadCommentModel),[Z,u]=h.useState(!1),[W,x]=h.useState(""),R=h.useMemo(()=>T.commentUpdate$.pipe(ne.debounceTime(16)),[T]);k.useObservable(R);const s=e?T.getCommentWithChildren(t,r,e):null,y=o.useDependency(o.ICommandService),U=o.useDependency(o.UserManagerService),H=s==null?void 0:s.root.resolved,D=k.useObservable(U.currentUser$),Q=h.useRef(null),X=[...s?[s.root]:[{id:Ee,text:{dataStream:`
|
|
79
|
-
\r`},personId:(ae=D==null?void 0:D.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...($=s==null?void 0:s.children)!=null?$:[]],G=h.useRef(null),V=P=>{P.stopPropagation(),H?y.executeCommand(F.id,{unitId:t,subUnitId:r,commentId:e}):y.executeCommand(F.id),y.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!H}),O==null||O(!H)},q=P=>{P.stopPropagation(),y.executeCommand(F.id),!(s!=null&&s.root&&(S==null?void 0:S(s.root))===!1)&&(y.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),g==null||g())};h.useEffect(()=>f==null?void 0:f(),[]);const B=j((ee=s==null?void 0:s.root.subUnitId)!=null?ee:r),oe=d&&!W&&!H,Y=`${i||(s==null?void 0:s.root.ref)||""}${B?" · ":""}${B}`;return a.jsxs("div",{className:at(v.threadComment,{[v.threadCommentActive]:!H&&(C||Z||w==="cell")}),onClick:c,id:`${w}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),u(!0)},onMouseLeave:()=>{f==null||f(),u(!1)},children:[!H&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),s?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:V,className:v.threadCommentIcon,style:{color:H?"rgb(var(--green-500))":""},children:H?a.jsx(be,{}):a.jsx(Te,{})}),(D==null?void 0:D.userID)===s.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:G,children:X.map(P=>a.jsx(ct,{onClose:g,unitId:t,subUnitId:r,item:P,isRoot:P.id===(s==null?void 0:s.root.id),editing:W===P.id,resolved:s==null?void 0:s.root.resolved,onEditingChange:A=>{x(A?P.id:"")},onReply:A=>{A&&requestAnimationFrame(()=>{var l;(l=Q.current)==null||l.reply(Ue([{type:"mention",content:{id:A.userID,label:A.name}}]))})},onAddComment:p,onDeleteComment:S},P.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:Q,unitId:t,subUnitId:r,onSave:async({text:P,attachments:A})=>{const l={text:P,attachments:A,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:D==null?void 0:D.userID,parentId:s==null?void 0:s.root.id,unitId:t,subUnitId:r,threadId:s==null?void 0:s.root.threadId};(p==null?void 0:p(l))!==!1&&(await y.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:l}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:M||!s,onCancel:()=>{s||g==null||g()}},`${M}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},ht=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:d,onResolve:c,sortComments:C,onItemLeave:g,onItemEnter:j,disableAdd:w,tempComment:M,onAddComment:I,onDeleteComment:f,showComments:p}=n,[S,O]=h.useState("all"),[T,Z]=h.useState("all"),u=o.useDependency(o.LocaleService),W=o.useDependency(o.UserManagerService),x=o.useDependency(b.ThreadCommentModel),[R,s]=h.useState(()=>x.getUnit(e)),y=o.useDependency(m.ThreadCommentPanelService),U=k.useObservable(y.activeCommentId$),H=k.useObservable(x.commentUpdate$),D=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),G="panel",V=k.useObservable(W.currentUser$),q=h.useMemo(()=>{var de;const l=S==="all"?R:(de=R.filter(E=>E.subUnitId===Q))!=null?de:[],te=C!=null?C:E=>E,se=l.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(p){const E=new Map;return se.forEach(K=>{E.set(K.id,K)}),[...p,""].map(K=>E.get(K)).filter(Boolean)}else return te(se)},[p,S,R,C,Q]),B=h.useMemo(()=>[...q.filter(l=>!l.resolved),...q.filter(l=>l.resolved)],[q]),oe=h.useMemo(()=>T==="resolved"?B.filter(l=>l.resolved):T==="unsolved"?B.filter(l=>!l.resolved):T==="concern_me"&&V!=null&&V.userID?B.filter(l=>l==null?void 0:l.users.has(V.userID)):B,[B,V==null?void 0:V.userID,T]),Y=M?[M,...oe]:oe,ae=Y.filter(l=>!l.resolved),$=Y.filter(l=>l.resolved),ee=T!=="all"||S!=="all",P=()=>{Z("all"),O("all")};h.useEffect(()=>{e&&s(x.getUnit(e))},[e,x,H]),h.useEffect(()=>{var E;if(!U)return;if(!X.current){X.current=!0;return}const{unitId:l,subUnitId:te,commentId:se}=U,de=`${G}-${l}-${te}-${se}`;(E=document.getElementById(de))==null||E.scrollIntoView({block:"center"})},[U]);const A=l=>a.jsx(Ne,{prefix:G,getSubUnitName:d,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(U==null?void 0:U.commentId)===l.id,showHighlight:(U==null?void 0:U.commentId)===l.id,onClick:()=>{X.current=!1,l.resolved?D.executeCommand(F.id):D.executeCommand(F.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>j==null?void 0:j(l),onMouseLeave:()=>g==null?void 0:g(l),onAddComment:I,onDeleteComment:f,onResolve:te=>c==null?void 0:c(l.id,te)},l.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:l=>O(l),options:[{value:"current",label:u.t("threadCommentUI.filter.sheet.current")},{value:"all",label:u.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:T,onChange:l=>Z(l),options:[{value:"all",label:u.t("threadCommentUI.filter.status.all")},{value:"resolved",label:u.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:u.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:u.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(A),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(A),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?u.t("threadCommentUI.panel.filterEmpty"):u.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:P,type:"link",children:u.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:w,children:[a.jsx(Se,{}),u.t("threadCommentUI.panel.addComment")]})]})]})};m.IThreadCommentMentionDataService=le,m.SetActiveCommentOperation=F,m.THREAD_COMMENT_PANEL=he,m.ThreadCommentPanel=ht,m.ThreadCommentTree=Ne,m.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/docs-thread-comment-ui
|
|
83
|
-
|
|
84
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverDocsThreadCommentUi={},c.UniverCore,c.UniverEngineRender,c.UniverThreadCommentUi,c.UniverDocs,c.UniverDocsUi,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React))})(this,function(c,o,g,T,M,j,w,C,A,O){"use strict";var Fe=Object.defineProperty;var Le=(c,o,g)=>o in c?Fe(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var Y=(c,o,g)=>Le(c,typeof o!="symbol"?o+"":o,g);const se="DOC_THREAD_COMMENT_UI_PLUGIN",y="default_doc",de="docs-thread-comment-ui.config",ae={};var ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ce(t,r,i),i},Q=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Y(this,"_addingComment$",new A.BehaviorSubject(void 0));Y(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=le([Q(0,C.ISidebarService),Q(1,o.Inject(T.ThreadCommentPanelService))],U);var X={exports:{}},B={};/**
|
|
85
|
-
* @license React
|
|
86
|
-
* react-jsx-runtime.production.min.js
|
|
87
|
-
*
|
|
88
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the MIT license found in the
|
|
91
|
-
* LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/var ue=O,ve=Symbol.for("react.element"),fe=Symbol.for("react.fragment"),he=Object.prototype.hasOwnProperty,Ce=ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pe={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var n,i={},s=null,d=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(d=t.ref);for(n in t)he.call(t,n)&&!pe.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ve,type:e,key:s,ref:d,props:i,_owner:Ce.current}}B.Fragment=fe,B.jsx=k,B.jsxs=k,X.exports=B;var Ie=X.exports;const W={id:"docs.command.add-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{comment:r,unitId:n}=t,s=await e.get(w.IThreadCommentDataSourceService).addComment(r),d=e.get(o.ICommandService),a=j.addCustomDecorationBySelectionFactory(e,{id:s.threadId,type:o.CustomDecorationType.COMMENT});if(a){const v={id:w.AddCommentMutation.id,params:{unitId:n,subUnitId:y,comment:s}},h={id:T.SetActiveCommentOperation.id,params:{unitId:n,subUnitId:y,commentId:s.id}};return(await o.sequenceExecute([v,a,h],d)).result}return!1}},K={id:"docs.command.delete-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{commentId:r,unitId:n}=t,i=e.get(o.ICommandService),s=j.deleteCustomDecorationFactory(e,{id:r,unitId:n});return s?(await o.sequenceExecute([s],i)).result:!1}},ee=e=>{const t=e.get(g.IRenderManagerService),r=e.get(M.DocSelectionManagerService),n=t.getCurrent(),i=n==null?void 0:n.with(M.DocSkeletonManagerService).getSkeleton(),s=i==null?void 0:i.getViewModel().getEditArea();if(s===g.DocumentEditArea.FOOTER||s===g.DocumentEditArea.HEADER)return!0;const d=r.getActiveTextRange();return!!(d==null||d.collapsed)};function _e(e){return{id:V.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC,void 0,o.SHEET_EDITOR_UNITS),disabled$:new A.Observable(function(t){const n=e.get(M.DocSelectionManagerService).textSelection$.pipe(A.debounceTime(16)).subscribe(()=>{t.next(ee(e))});return()=>{n.unsubscribe()}})}}function Se(e){return{id:G.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC)}}const P=()=>{const e=o.useDependency(o.IUniverInstanceService),t=o.useDependency(o.Injector),r=O.useMemo(()=>e.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_DOC),[e]),n=o.useObservable(r),i=O.useMemo(()=>new A.Observable(l=>l.next(y)),[]),s=o.useDependency(M.DocSelectionManagerService),d=O.useMemo(()=>s.textSelection$.pipe(A.debounceTime(16)),[s.textSelection$]);o.useObservable(d);const a=o.useDependency(o.ICommandService),v=o.useDependency(U),h=o.useObservable(v.addingComment$),[m,_]=O.useState([]);if(O.useEffect(()=>{var E;const l=new Set,u=n==null?void 0:n.getCustomDecorations();_((E=u==null?void 0:u.map(f=>f.id).filter(f=>{const b=l.has(f);return l.add(f),!b}))!=null?E:[]);const D=a.onCommandExecuted(f=>{var b;if(f.id===M.RichTextEditingMutation.id){const $=new Set,q=n==null?void 0:n.getCustomDecorations();_((b=q==null?void 0:q.map(H=>H.id).filter(H=>{const Be=$.has(H);return $.add(H),!Be}))!=null?b:[])}});return()=>{D.dispose()}},[a,n]),!n)return null;const S=ee(t),p=n.getUnitId();return Ie.jsx(T.ThreadCommentPanel,{unitId:p,subUnitId$:i,type:o.UniverInstanceType.UNIVER_DOC,onAdd:()=>{a.executeCommand(V.id)},getSubUnitName:()=>"",disableAdd:S,tempComment:h,onAddComment:l=>{if(!l.parentId){const u={unitId:p,range:h,comment:l};return a.executeCommand(W.id,u),v.endAdd(),!1}return!0},onDeleteComment:l=>{if(!l.parentId){const u={unitId:p,commentId:l.id};return a.executeCommand(K.id,u),!1}return!0},showComments:m})};P.componentKey="univer.doc.thread-comment-panel";const N={id:"docs.operation.show-comment-panel",type:o.CommandType.OPERATION,handler(e,t){var i;const r=e.get(T.ThreadCommentPanelService),n=e.get(C.ISidebarService);return(!r.panelVisible||((i=n.options.children)==null?void 0:i.label)!==P.componentKey)&&(n.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},G={id:"docs.operation.toggle-comment-panel",type:o.CommandType.OPERATION,handler(e){var n;const t=e.get(T.ThreadCommentPanelService),r=e.get(C.ISidebarService);return!t.panelVisible||((n=r.options.children)==null?void 0:n.label)!==P.componentKey?(r.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>t.setPanelVisible(!1)}),t.setPanelVisible(!0)):(r.close(),t.setPanelVisible(!1),t.setActiveComment(null)),!0}},V={id:"docs.operation.start-add-comment",type:o.CommandType.OPERATION,handler(e){var f,b,$;const t=e.get(T.ThreadCommentPanelService),n=e.get(o.IUniverInstanceService).getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC),i=e.get(M.DocSelectionManagerService),s=e.get(g.IRenderManagerService),d=e.get(o.UserManagerService),a=e.get(U),v=e.get(o.ICommandService),h=e.get(C.ISidebarService),m=i.getActiveTextRange();if(!n||!m)return!1;const _=(f=s.getRenderById(n.getUnitId()))==null?void 0:f.with(j.DocSelectionRenderService);if(m.collapsed)return t.panelVisible?(t.setPanelVisible(!1),h.close()):v.executeCommand(N.id),!0;v.executeCommand(N.id);const S=n.getUnitId(),p=(($=(b=n.getBody())==null?void 0:b.dataStream)!=null?$:"").slice(m.startOffset,m.endOffset),l=o.BuildTextUtils.transform.getPlainText(p),u=y,D="",E={unitId:S,subUnitId:u,id:D,ref:l,dT:w.getDT(),personId:d.getCurrentUser().userID,text:{dataStream:`\r
|
|
93
|
-
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs-pro/thread-comment-datasource
|
|
97
|
-
|
|
98
|
-
function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=function(_0x1085fa,_0x46606a){_0x1085fa=_0x1085fa-0xfe;let _0x2655bd=_0x45cb86[_0x1085fa];return _0x2655bd;},_0x1085(_0x330f90,_0x71315c);}(function(_0x1c3962,_0x38a0e2){const _0xcc7751=_0x1085,_0x25cd31=_0x1c3962();while(!![]){try{const _0x4ef23e=parseInt(_0xcc7751(0x155))/0x1+parseInt(_0xcc7751(0x119))/0x2+parseInt(_0xcc7751(0x193))/0x3*(-parseInt(_0xcc7751(0x15d))/0x4)+-parseInt(_0xcc7751(0x147))/0x5+-parseInt(_0xcc7751(0x16c))/0x6*(-parseInt(_0xcc7751(0x181))/0x7)+parseInt(_0xcc7751(0x18c))/0x8+-parseInt(_0xcc7751(0x157))/0x9;if(_0x4ef23e===_0x38a0e2)break;else _0x25cd31['push'](_0x25cd31['shift']());}catch(_0x1c931a){_0x25cd31['push'](_0x25cd31['shift']());}}}(_0x45cb,0xc73dd),function(_0x223df9,_0x2a32d0){const _0x169cb1=_0x1085;typeof exports==_0x169cb1(0x16e)&&typeof module<'u'?_0x2a32d0(exports,require('@univerjs/core'),require(_0x169cb1(0x13d)),require(_0x169cb1(0x178)),require(_0x169cb1(0x105)),require(_0x169cb1(0x13b)),require(_0x169cb1(0x128)),require(_0x169cb1(0x120))):typeof define=='function'&&define['amd']?define([_0x169cb1(0x106),_0x169cb1(0x188),'@univerjs/thread-comment-ui','@univerjs-pro/collaboration-client',_0x169cb1(0x105),_0x169cb1(0x13b),'rxjs',_0x169cb1(0x120)],_0x2a32d0):(_0x223df9=typeof globalThis<'u'?globalThis:_0x223df9||self,_0x2a32d0(_0x223df9[_0x169cb1(0x143)]={},_0x223df9['UniverCore'],_0x223df9[_0x169cb1(0x187)],_0x223df9[_0x169cb1(0x16d)],_0x223df9[_0x169cb1(0x160)],_0x223df9[_0x169cb1(0x144)],_0x223df9[_0x169cb1(0x128)],_0x223df9[_0x169cb1(0x12b)]));}(this,function(_0x17a296,_0x3d0190,_0x3ed21d,_0x3db026,_0x51384d,_0x5c0884,_0x1b5c0a,_0x49bd93){'use strict';const _0x2d1c5a=_0x1085;const _0x581514='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x5cda73=(_0x209b8d=>(_0x209b8d[_0x209b8d[_0x2d1c5a(0x121)]=0x0]=_0x2d1c5a(0x121),_0x209b8d[_0x209b8d[_0x2d1c5a(0x16f)]=0x1]=_0x2d1c5a(0x16f),_0x209b8d[_0x209b8d[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x209b8d))(_0x5cda73||{}),_0x4aae21=(_0x569621=>(_0x569621[_0x569621[_0x2d1c5a(0x12c)]=0x0]=_0x2d1c5a(0x12c),_0x569621[_0x569621[_0x2d1c5a(0xfe)]=0x1]=_0x2d1c5a(0xfe),_0x569621[_0x569621['Reply']=0x2]=_0x2d1c5a(0x194),_0x569621[_0x569621[_0x2d1c5a(0x18f)]=0x3]=_0x2d1c5a(0x18f),_0x569621[_0x569621['Delete']=0x4]=_0x2d1c5a(0x15f),_0x569621[_0x569621[_0x2d1c5a(0x163)]=0x5]='Solve',_0x569621[_0x569621[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x569621))(_0x4aae21||{});const _0x1d64e1=_0x32d4fa=>_0x3d0190[_0x2d1c5a(0x168)](new Date(+_0x32d4fa))['format'](_0x2d1c5a(0x17a)),_0x41e898=async(_0x1daffb,_0x2ae0d7)=>{const _0x49961f=_0x2d1c5a,_0x4f8c20=_0x1daffb[_0x49961f(0x191)](_0x3d0190[_0x49961f(0x11c)]),_0x50f0c5=_0x1daffb[_0x49961f(0x191)](_0x49bd93[_0x49961f(0x176)]);_0x2ae0d7[_0x49961f(0x11d)](_0x27ee20=>{const _0x12083e=_0x49961f;_0x4f8c20['getUser'](_0x27ee20)&&_0x2ae0d7[_0x12083e(0x124)](_0x27ee20);}),_0x2ae0d7[_0x49961f(0x156)]&&(await _0x50f0c5[_0x49961f(0x191)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2ae0d7]}}))[_0x49961f(0x141)][_0x49961f(0x177)][_0x49961f(0x11d)](_0x1f578d=>{const _0x5d3ae8=_0x49961f;_0x1f578d&&_0x4f8c20[_0x5d3ae8(0x111)](_0x1f578d);});};var _0x2b18e9=Object['defineProperty'],_0xaed435=Object['getOwnPropertyDescriptor'],_0xdbf4ec=(_0x3443bc,_0x3e2fe7,_0x3d4a6c,_0x5e2b31)=>{const _0x5b531d=_0x2d1c5a;for(var _0x15e483=_0x5e2b31>0x1?void 0x0:_0x5e2b31?_0xaed435(_0x3e2fe7,_0x3d4a6c):_0x3e2fe7,_0x229be8=_0x3443bc[_0x5b531d(0x104)]-0x1,_0x29a12f;_0x229be8>=0x0;_0x229be8--)(_0x29a12f=_0x3443bc[_0x229be8])&&(_0x15e483=(_0x5e2b31?_0x29a12f(_0x3e2fe7,_0x3d4a6c,_0x15e483):_0x29a12f(_0x15e483))||_0x15e483);return _0x5e2b31&&_0x15e483&&_0x2b18e9(_0x3e2fe7,_0x3d4a6c,_0x15e483),_0x15e483;},_0x470027=(_0x2a44f3,_0x529c33)=>(_0x166652,_0x92e77d)=>_0x529c33(_0x166652,_0x92e77d,_0x2a44f3);let _0x2c4030=class extends _0x3d0190['Disposable']{constructor(_0x1c592b,_0xef8ea5,_0x4e6c26,_0x22f0c3){const _0x6f6060=_0x2d1c5a;super(),this[_0x6f6060(0x11f)]=_0x1c592b,this[_0x6f6060(0x114)]=_0xef8ea5,this[_0x6f6060(0x151)]=_0x4e6c26,this[_0x6f6060(0x101)]=_0x22f0c3,this['_init'](),this[_0x6f6060(0x127)]();}[_0x2d1c5a(0x127)](){const _0x568e0e=_0x2d1c5a;this[_0x568e0e(0xff)](this['_threadCommentModel'][_0x568e0e(0x16a)][_0x568e0e(0x100)](_0x1b5c0a[_0x568e0e(0x15e)](0x10))['subscribe'](_0x496c60=>{const _0x35946b=new Set();_0x496c60['forEach'](_0x34a6dc=>{const _0xeb10e9=_0x1085;switch(_0x34a6dc[_0xeb10e9(0x117)]){case _0xeb10e9(0x139):{const _0x5d3422=_0x34a6dc[_0xeb10e9(0x17e)][_0xeb10e9(0x162)];_0x35946b[_0xeb10e9(0x139)](_0x5d3422);break;}}}),_0x41e898(this['_injector'],_0x35946b);}));}['_init'](){const _0x32d451=_0x2d1c5a;this[_0x32d451(0xff)](this['_commentService']['commentUpdate$'][_0x32d451(0x167)](async _0x490edc=>{const _0x159d32=_0x32d451;var _0x22400e,_0xc8d55f,_0x22c0dd,_0x4b8c1f;const _0x29d0eb=(_0x22400e=this['_threadCommentModel']['getUnit'](_0x490edc[_0x159d32(0x17d)])['find'](_0x43f4ee=>_0x43f4ee['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x22400e['root'];if(!_0x29d0eb)return;const {unitId:_0x117158,subUnitId:_0x3aafe5}=_0x29d0eb;switch(_0x490edc[_0x159d32(0x130)]&&this[_0x159d32(0x151)]['addUser'](_0x490edc['user']),_0x490edc[_0x159d32(0x117)]){case _0x4aae21[_0x159d32(0xfe)]:break;case _0x4aae21[_0x159d32(0x194)]:{this['_threadCommentModel']['addComment'](_0x117158,_0x3aafe5,{'unitId':_0x117158,'subUnitId':_0x3aafe5,'ref':'','id':_0x490edc['replyId'],'dT':_0x1d64e1(+_0x490edc['createTimestamp']),'threadId':_0x490edc[_0x159d32(0x14f)],'personId':(_0x22c0dd=(_0xc8d55f=_0x490edc[_0x159d32(0x130)])==null?void 0x0:_0xc8d55f[_0x159d32(0x171)])!=null?_0x22c0dd:_0x490edc['userId'],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)]),'parentId':_0x29d0eb['id']});break;}case _0x4aae21[_0x159d32(0x15f)]:{const _0x55b8a5=this[_0x159d32(0x114)][_0x159d32(0x183)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);_0x55b8a5&&_0x55b8a5['parentId']&&this[_0x159d32(0x114)][_0x159d32(0x140)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);break;}case _0x4aae21['Edit']:{this[_0x159d32(0x114)][_0x159d32(0x134)](_0x117158,_0x3aafe5,{'commentId':_0x490edc[_0x159d32(0x14e)],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)])});break;}case _0x4aae21[_0x159d32(0x163)]:{const _0x99e61a=(_0x4b8c1f=this[_0x159d32(0x114)][_0x159d32(0x174)](_0x490edc['unitId'])[_0x159d32(0x154)](_0x232300=>_0x232300['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x4b8c1f[_0x159d32(0x185)];_0x99e61a&&this[_0x159d32(0x114)]['resolveComment'](_0x117158,_0x3aafe5,_0x99e61a['id'],_0x490edc[_0x159d32(0x166)]===_0x5cda73[_0x159d32(0x16f)]);break;}}}));}};_0x2c4030=_0xdbf4ec([_0x470027(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x16b)])),_0x470027(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x5c0884['ThreadCommentModel'])),_0x470027(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x470027(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190['Injector']))],_0x2c4030);const _0x168b3a=_0x2d1c5a(0x12d),_0x5c96e1={};var _0x3f3071=Object[_0x2d1c5a(0x18e)],_0x4e1f86=Object['getOwnPropertyDescriptor'],_0x34829b=(_0x4ac3ab,_0x20f67f,_0x137e72,_0x56aa0f)=>{for(var _0x42b400=_0x56aa0f>0x1?void 0x0:_0x56aa0f?_0x4e1f86(_0x20f67f,_0x137e72):_0x20f67f,_0x382a88=_0x4ac3ab['length']-0x1,_0x583b56;_0x382a88>=0x0;_0x382a88--)(_0x583b56=_0x4ac3ab[_0x382a88])&&(_0x42b400=(_0x56aa0f?_0x583b56(_0x20f67f,_0x137e72,_0x42b400):_0x583b56(_0x42b400))||_0x42b400);return _0x56aa0f&&_0x42b400&&_0x3f3071(_0x20f67f,_0x137e72,_0x42b400),_0x42b400;},_0x5b385f=(_0x3179ab,_0x2379b8)=>(_0x4ad694,_0x3d031b)=>_0x2379b8(_0x4ad694,_0x3d031b,_0x3179ab);function _0x287c05(_0x334b3e,_0x1c3ac9){const _0x1da2de=_0x2d1c5a,_0x316913=_0x334b3e[_0x1da2de(0x116)][0x0];return{..._0x1c3ac9,'id':_0x316913[_0x1da2de(0x14e)],'resolved':_0x334b3e[_0x1da2de(0x166)]===0x1,'dT':_0x1d64e1(_0x316913[_0x1da2de(0x123)]),'personId':_0x316913[_0x1da2de(0x12a)],'threadId':_0x316913[_0x1da2de(0x14f)]};}function _0x4513b1(_0x5c5d7f,_0xee5259,_0x1ea201){const _0x1aa179=_0x2d1c5a;var _0x30e012,_0x4a60c9;if(((_0x4a60c9=(_0x30e012=_0x5c5d7f==null?void 0x0:_0x5c5d7f['replies'])==null?void 0x0:_0x30e012[_0x1aa179(0x104)])!=null?_0x4a60c9:0x0)>0x0){const _0x33a106=(_0x413bee,_0x1ef023)=>({'id':_0x413bee[_0x1aa179(0x14e)],'threadId':_0x413bee['threadId'],'dT':_0x1d64e1(_0x413bee['createTimestamp']),'personId':_0x413bee['userId'],'resolved':_0x5c5d7f['solved']===_0x5cda73[_0x1aa179(0x16f)],'unitId':_0xee5259,'subUnitId':_0x1ea201,'text':JSON[_0x1aa179(0x164)](_0x413bee['content']),'parentId':_0x1ef023}),_0x2fcf35=_0x33a106(_0x5c5d7f['replies'][0x0]);return{..._0x2fcf35,'children':_0x5c5d7f[_0x1aa179(0x116)]['slice'](0x1)[_0x1aa179(0x17b)](_0x25c910=>_0x33a106(_0x25c910,_0x2fcf35['id']))};}return null;}let _0x4c567b=class{constructor(_0x504ccd,_0x440d1d,_0x13d849,_0x1e6654){const _0x21ba5d=_0x2d1c5a;this[_0x21ba5d(0x109)]=_0x504ccd,this[_0x21ba5d(0x151)]=_0x440d1d,this[_0x21ba5d(0x102)]=_0x13d849,this[_0x21ba5d(0x101)]=_0x1e6654;}async[_0x2d1c5a(0x126)](_0x2d47fd){const _0x30ca48=_0x2d1c5a;var _0x23c2b9,_0x54c2a1;const {parentId:_0x92c8a9,unitId:_0x5cc676,text:_0x3d84cf,threadId:_0x5735b3}=_0x2d47fd,_0x2e07a3=(_0x54c2a1=(_0x23c2b9=_0x3d84cf[_0x30ca48(0x135)])==null?void 0x0:_0x23c2b9['filter'](_0x3766f4=>_0x3766f4[_0x30ca48(0x15b)]===_0x3d0190[_0x30ca48(0x150)][_0x30ca48(0x18b)])[_0x30ca48(0x17b)](_0x3231ef=>_0x3231ef[_0x30ca48(0x122)]))!=null?_0x54c2a1:[],_0x57e106=JSON[_0x30ca48(0x14d)](_0x3d84cf),_0x44db1c=(await this[_0x30ca48(0x102)]['requireSession'](_0x5cc676))[_0x30ca48(0x18a)]();if(_0x92c8a9){const _0x20deb8={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3,'threadId':_0x5735b3},_0x5ed8eb=(await this['_httpService'][_0x30ca48(0x14b)]('/universer-api/comment/unit/'+_0x5cc676+_0x30ca48(0x192),{'body':_0x20deb8}))[_0x30ca48(0x141)][_0x30ca48(0x161)];return{..._0x2d47fd,'id':_0x5ed8eb[_0x30ca48(0x14e)],'dT':_0x3d0190[_0x30ca48(0x168)](+_0x5ed8eb[_0x30ca48(0x123)])['format'](_0x30ca48(0x17a)),'personId':_0x5ed8eb['userId']};}else{const _0x36ed66={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3},_0x2048d0=await this[_0x30ca48(0x109)][_0x30ca48(0x14b)](_0x30ca48(0x10a)+_0x5cc676+_0x30ca48(0x184),{'body':_0x36ed66});return _0x287c05(_0x2048d0[_0x30ca48(0x141)][_0x30ca48(0x17f)],_0x2d47fd);}}async[_0x2d1c5a(0x134)](_0xa03223){const _0x2b9009=_0x2d1c5a;var _0xd70d8b,_0x2971aa;const {text:_0xa9b207,unitId:_0x38e37f}=_0xa03223,_0x2a422d=(_0x2971aa=(_0xd70d8b=_0xa9b207[_0x2b9009(0x135)])==null?void 0x0:_0xd70d8b[_0x2b9009(0x175)](_0x2e447c=>_0x2e447c['rangeType']===_0x3d0190[_0x2b9009(0x150)]['COMMENT'])[_0x2b9009(0x17b)](_0x2a0ee2=>_0x2a0ee2[_0x2b9009(0x122)]))!=null?_0x2971aa:[],_0x27365a=JSON[_0x2b9009(0x14d)](_0xa9b207),_0xa8dbb2=_0xa03223[_0x2b9009(0x14f)],_0x32e73c=_0xa03223['id'],_0x30dbfc={'memberId':(await this[_0x2b9009(0x102)][_0x2b9009(0x11e)](_0x38e37f))['getMemberID'](),'unitId':_0x38e37f,'threadId':_0xa8dbb2,'mention':_0x2a422d,'content':_0x27365a,'replyId':_0x32e73c},_0x335d49=await this[_0x2b9009(0x109)]['post'](_0x2b9009(0x10a)+_0x38e37f+_0x2b9009(0x13f),{'body':_0x30dbfc});return!_0x335d49[_0x2b9009(0x141)][_0x2b9009(0x132)]||_0x335d49['body']['error'][_0x2b9009(0x107)]===0x1;}async[_0x2d1c5a(0x13e)](_0x25130f){const _0x3f746e=_0x2d1c5a,{unitId:_0x45df06}=_0x25130f,_0x4b542f=_0x25130f[_0x3f746e(0x14f)],_0x458032={'memberId':this['_userService'][_0x3f746e(0x10b)]()['userID'],'unitId':_0x45df06,'threadId':_0x4b542f,'solved':_0x25130f[_0x3f746e(0x138)]?_0x5cda73[_0x3f746e(0x16f)]:_0x5cda73[_0x3f746e(0x121)]},_0x5d5e33=await this[_0x3f746e(0x109)][_0x3f746e(0x14b)](_0x3f746e(0x10a)+_0x45df06+_0x3f746e(0x186),{'body':_0x458032});return!_0x5d5e33[_0x3f746e(0x141)]['error']||_0x5d5e33[_0x3f746e(0x141)][_0x3f746e(0x132)][_0x3f746e(0x107)]===0x1;}async[_0x2d1c5a(0x140)](_0x4bf704,_0x13e9f4,_0x4a7c8d,_0x3aaf08){const _0x2b2280=_0x2d1c5a,_0x2f3900={'memberId':(await this[_0x2b2280(0x102)][_0x2b2280(0x11e)](_0x4bf704))[_0x2b2280(0x18a)](),'threadId':_0x4a7c8d,'replyId':_0x3aaf08,'unitId':_0x4bf704},_0xc6ccca=await this[_0x2b2280(0x109)][_0x2b2280(0x14b)]('/universer-api/comment/unit/'+_0x4bf704+_0x2b2280(0x172),{'body':_0x2f3900});return!_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]||_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]['code']===0x1;}async['listComments'](_0x4daf68,_0x3df24c,_0x30e3d8){const _0x5d19cd=_0x2d1c5a,_0x76a77c={'unitId':_0x4daf68,'threadId':_0x30e3d8},_0x2dd97e=await this[_0x5d19cd(0x109)]['post'](_0x5d19cd(0x10a)+_0x4daf68+_0x5d19cd(0x179),{'body':_0x76a77c}),_0x3e6e53=_0x30e3d8[_0x5d19cd(0x17b)](_0x3a0879=>_0x4513b1(_0x2dd97e['body']['comments'][_0x3a0879],_0x4daf68,_0x3df24c))['filter'](Boolean);return Object[_0x5d19cd(0x112)](_0x2dd97e[_0x5d19cd(0x141)][_0x5d19cd(0x177)])[_0x5d19cd(0x11d)](_0x4e7ff0=>{const _0x434fbd=_0x5d19cd;this['_userService'][_0x434fbd(0x111)](_0x4e7ff0);}),_0x3e6e53;}['saveCommentToSnapshot'](_0x2a7527){const _0x25447e=_0x2d1c5a;return{'id':_0x2a7527['id'],'threadId':_0x2a7527[_0x25447e(0x14f)],'ref':_0x2a7527[_0x25447e(0x11b)]};}};_0x4c567b=_0x34829b([_0x5b385f(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93['HTTPService'])),_0x5b385f(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x5b385f(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x10c)])),_0x5b385f(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)]))],_0x4c567b);var _0x570b55=Object[_0x2d1c5a(0x18e)],_0x4c869a=Object[_0x2d1c5a(0x145)],_0x2bb772=(_0x5d19b3,_0x75698f,_0x41601e,_0x4776a3)=>{const _0x42d174=_0x2d1c5a;for(var _0x5d00a1=_0x4776a3>0x1?void 0x0:_0x4776a3?_0x4c869a(_0x75698f,_0x41601e):_0x75698f,_0x372fde=_0x5d19b3[_0x42d174(0x104)]-0x1,_0x2d1d7c;_0x372fde>=0x0;_0x372fde--)(_0x2d1d7c=_0x5d19b3[_0x372fde])&&(_0x5d00a1=(_0x4776a3?_0x2d1d7c(_0x75698f,_0x41601e,_0x5d00a1):_0x2d1d7c(_0x5d00a1))||_0x5d00a1);return _0x4776a3&&_0x5d00a1&&_0x570b55(_0x75698f,_0x41601e,_0x5d00a1),_0x5d00a1;},_0x49a366=(_0x4fbd56,_0x28563b)=>(_0x62fef0,_0x2e0de7)=>_0x28563b(_0x62fef0,_0x2e0de7,_0x4fbd56);let _0x6c0c22=class{constructor(_0x8dc74c){const _0x9e5a88=_0x2d1c5a;this[_0x9e5a88(0x109)]=_0x8dc74c;}async[_0x2d1c5a(0x12e)](_0x44bee6,_0x20771b,_0x304520){const _0x58ba96=_0x2d1c5a,_0x5c5129=new URL(window[_0x58ba96(0x18d)][_0x58ba96(0x173)])['searchParams'][_0x58ba96(0x191)](_0x58ba96(0x110));if(!_0x5c5129)return[];const _0x45b2ad=window['location'][_0x58ba96(0x148)],_0x371842=window[_0x58ba96(0x18d)][_0x58ba96(0x158)]===_0x58ba96(0x12f)?_0x58ba96(0x165):_0x58ba96(0x13a);return(await this[_0x58ba96(0x109)][_0x58ba96(0x191)](_0x371842+_0x58ba96(0x149)+_0x45b2ad+_0x58ba96(0x103),{'params':{'objectID':_0x5c5129,'unitID':_0x5c5129}}))[_0x58ba96(0x141)][_0x58ba96(0x108)]['map'](_0x2a842b=>{const _0x1b1849=_0x58ba96;var _0x1e4d30,_0xf43929,_0x5015c8,_0x1c8f43,_0x561c23,_0x131e08;return{'id':(_0xf43929=(_0x1e4d30=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x1e4d30[_0x1b1849(0x171)])!=null?_0xf43929:'','label':(_0x1c8f43=(_0x5015c8=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x5015c8[_0x1b1849(0x15c)])!=null?_0x1c8f43:'','icon':(_0x131e08=(_0x561c23=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x561c23[_0x1b1849(0x133)])!=null?_0x131e08:'','type':_0x1b1849(0x130)};});}};_0x6c0c22=_0x2bb772([_0x49a366(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93[_0x2d1c5a(0x176)]))],_0x6c0c22);var _0x37496f=Object[_0x2d1c5a(0x18e)],_0x2a227c=Object[_0x2d1c5a(0x145)],_0x4d0464=(_0xd2a913,_0x87dbce,_0x5883ab,_0x51ad35)=>{for(var _0x14a9f4=_0x51ad35>0x1?void 0x0:_0x51ad35?_0x2a227c(_0x87dbce,_0x5883ab):_0x87dbce,_0x44abcb=_0xd2a913['length']-0x1,_0x5f82e1;_0x44abcb>=0x0;_0x44abcb--)(_0x5f82e1=_0xd2a913[_0x44abcb])&&(_0x14a9f4=(_0x51ad35?_0x5f82e1(_0x87dbce,_0x5883ab,_0x14a9f4):_0x5f82e1(_0x14a9f4))||_0x14a9f4);return _0x51ad35&&_0x14a9f4&&_0x37496f(_0x87dbce,_0x5883ab,_0x14a9f4),_0x14a9f4;},_0x434cce=(_0x1e9d3e,_0x140f0b)=>(_0x18600b,_0x5bb0a4)=>_0x140f0b(_0x18600b,_0x5bb0a4,_0x1e9d3e);let _0x3d1a79=class extends _0x3d0190[_0x2d1c5a(0x125)]{constructor(_0x3b6ddb,_0x357b76,_0x337cf9,_0x481722){const _0x165423=_0x2d1c5a;super(),this[_0x165423(0x142)]=_0x3b6ddb,this[_0x165423(0x17c)]=_0x357b76,this[_0x165423(0x136)]=_0x337cf9,this[_0x165423(0x146)]=_0x481722,this[_0x165423(0x190)]();}[_0x2d1c5a(0x190)](){const _0x38ca74=_0x2d1c5a;this[_0x38ca74(0x142)][_0x38ca74(0x15a)]=this[_0x38ca74(0x17c)],this[_0x38ca74(0x142)][_0x38ca74(0x152)]=!0x1,this[_0x38ca74(0x136)]['dataSource']=this[_0x38ca74(0x146)];}};_0x3d1a79=_0x4d0464([_0x434cce(0x0,_0x5c0884['IThreadCommentDataSourceService']),_0x434cce(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x4c567b)),_0x434cce(0x2,_0x3ed21d[_0x2d1c5a(0x14c)]),_0x434cce(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x6c0c22))],_0x3d1a79);var _0x25b1bc=Object[_0x2d1c5a(0x18e)],_0x271190=Object[_0x2d1c5a(0x145)],_0x51ac44=(_0x241833,_0x23df0b,_0x468956)=>_0x23df0b in _0x241833?_0x25b1bc(_0x241833,_0x23df0b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x468956}):_0x241833[_0x23df0b]=_0x468956,_0x222d11=(_0x2385c4,_0x1ead91,_0x5319db,_0x2527a7)=>{const _0x478081=_0x2d1c5a;for(var _0x55b4d9=_0x2527a7>0x1?void 0x0:_0x2527a7?_0x271190(_0x1ead91,_0x5319db):_0x1ead91,_0x5b3d36=_0x2385c4[_0x478081(0x104)]-0x1,_0x196bb6;_0x5b3d36>=0x0;_0x5b3d36--)(_0x196bb6=_0x2385c4[_0x5b3d36])&&(_0x55b4d9=(_0x2527a7?_0x196bb6(_0x1ead91,_0x5319db,_0x55b4d9):_0x196bb6(_0x55b4d9))||_0x55b4d9);return _0x2527a7&&_0x55b4d9&&_0x25b1bc(_0x1ead91,_0x5319db,_0x55b4d9),_0x55b4d9;},_0x54454a=(_0x412be0,_0x463a27)=>(_0x108220,_0x1cfaae)=>_0x463a27(_0x108220,_0x1cfaae,_0x412be0),_0x3d7f66=(_0x3bb133,_0x545864,_0x5eac52)=>_0x51ac44(_0x3bb133,typeof _0x545864!=_0x2d1c5a(0x11a)?_0x545864+'':_0x545864,_0x5eac52);_0x17a296[_0x2d1c5a(0x159)]=class extends _0x3d0190[_0x2d1c5a(0x10e)]{constructor(_0x54fd89=_0x5c96e1,_0x322218,_0x48bb3f){const _0x37d3fc=_0x2d1c5a;super(),this['_config']=_0x54fd89,this['_injector']=_0x322218,this['_configService']=_0x48bb3f;const {..._0x3fd3f9}=this[_0x37d3fc(0x169)];this[_0x37d3fc(0x170)][_0x37d3fc(0x189)](_0x168b3a,_0x3fd3f9);}[_0x2d1c5a(0x131)](){const _0x2e3fbe=_0x2d1c5a;[[_0x6c0c22],[_0x4c567b],[_0x3d1a79],[_0x2c4030]][_0x2e3fbe(0x11d)](_0x3c3c13=>{const _0x20958e=_0x2e3fbe;this['_injector'][_0x20958e(0x139)](_0x3c3c13);});}[_0x2d1c5a(0x10d)](){const _0x31eae9=_0x2d1c5a;this[_0x31eae9(0x101)]['get'](_0x3d1a79),this[_0x31eae9(0x101)][_0x31eae9(0x191)](_0x2c4030);}},_0x3d7f66(_0x17a296['UniverThreadCommentDataSourcePlugin'],_0x2d1c5a(0x13c),_0x581514),_0x3d7f66(_0x17a296[_0x2d1c5a(0x159)],'type',_0x3d0190[_0x2d1c5a(0x129)][_0x2d1c5a(0x153)]),_0x17a296[_0x2d1c5a(0x159)]=_0x222d11([_0x3d0190['DependentOn'](_0x3ed21d['UniverThreadCommentUIPlugin'],_0x3db026[_0x2d1c5a(0x115)],_0x51384d[_0x2d1c5a(0x118)]),_0x54454a(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)])),_0x54454a(0x2,_0x3d0190['IConfigService'])],_0x17a296[_0x2d1c5a(0x159)]),Object['defineProperty'](_0x17a296,Symbol[_0x2d1c5a(0x14a)],{'value':'Module'});}));function _0x45cb(){const _0x4c3ba6=['delete','Disposable','addComment','_initUserSync','rxjs','UniverInstanceType','userId','UniverNetwork','Unknown','thread-comment-data-source.config','getMentions','https:','user','onStarting','error','avatar','updateComment','customRanges','_threadCommentMentionDataService','UNRECOGNIZED','resolved','add','http','@univerjs/thread-comment','pluginName','@univerjs/thread-comment-ui','resolveComment','/edit','deleteComment','body','_threadCommentDataSourceService','UniverProThreadCommentDatasource','UniverThreadComment','getOwnPropertyDescriptor','_threadCommentMentionDataSource','6846820HIrJlY','host','://','toStringTag','post','IThreadCommentMentionDataService','stringify','replyId','threadId','CustomRangeType','_userService','syncUpdateMutationToColla','UNIVER_UNKNOWN','find','748670RYfhYR','size','14296464KKikiZ','protocol','UniverThreadCommentDataSourcePlugin','dataSource','rangeType','name','580ElmYGS','bufferTime','Delete','UniverProLicense','reply','personId','Solve','parse','https','solved','subscribe','dayjs','_config','commentUpdate$','CommentService','4782FSQpvV','UniverProCollaborationClient','object','Solved','_configService','userID','/delete','href','getUnit','filter','HTTPService','users','@univerjs-pro/collaboration-client','/list','YYYY/MM/DD\x20HH:mm','map','_threadCommentDataSource','unitId','payload','comment','content','13615oBUuuF','Inject','getComment','/add','root','/solved','UniverThreadCommentUi','@univerjs/core','setConfig','getMemberID','COMMENT','7362024zfVyhe','location','defineProperty','Edit','_initDataSource','get','/reply','14718WcxWkQ','Reply','Add','disposeWithMe','pipe','_injector','_sessionService','/universer-api/authz/collaborator','length','@univerjs-pro/license','exports','code','collaborators','_httpService','/universer-api/comment/unit/','getCurrentUser','CollaborationSessionService','onReady','Plugin','Injector','unit','addUser','values','subject','_threadCommentModel','UniverCollaborationClientPlugin','replies','type','UniverLicensePlugin','2532470kOXJCz','symbol','ref','UserManagerService','forEach','requireSession','_commentService','@univerjs/network','OpenOrReOpen','rangeId','createTimestamp'];_0x45cb=function(){return _0x4c3ba6;};return _0x45cb();}
|
|
99
|
-
|
|
100
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/thread-comment-ui
|
|
101
|
-
|
|
102
|
-
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m.UniverThreadCommentUi={},m.UniverCore,m.UniverThreadComment,m.UniverUi,m.rxjs,m.React,m.UniverDesign,m.UniverDocs,m.UniverDocsUi,m.UniverEngineRender))})(this,function(m,o,b,k,ne,h,_,Me,Oe,Re){"use strict";var ut=Object.defineProperty;var vt=(m,o,b)=>o in m?ut(m,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[o]=b;var L=(m,o,b)=>vt(m,typeof o!="symbol"?o+"":o,b);var De=Object.defineProperty,we=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?we(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);m.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();L(this,"_panelVisible",!1);L(this,"_panelVisible$",new ne.BehaviorSubject(!1));L(this,"_activeCommentId");L(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));L(this,"panelVisible$",this._panelVisible$.asObservable());L(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},m.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],m.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(m.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(m.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};class Ve{constructor(){L(this,"dataSource");L(this,"renderSuggestion");L(this,"trigger","@")}async getMentions(e,t,r){return this.dataSource?this.dataSource.getMentions(e,t,r):[]}}const le=o.createIdentifier("thread-comment.mention-data.service");var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,We=(n,e,t,r)=>{for(var i=r>1?void 0:r?Be(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&ve(e,t,i),i},me=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Fe(n,typeof e!="symbol"?e+"":e,t);m.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:d,...c}=this._config;d&&this._configService.setConfig("menu",d,{merge:!0}),this._configService.setConfig(Le,c)}onStarting(){var e;o.mergeOverrideWithDependencies([[m.ThreadCommentPanelService],[le,{useClass:Ve}]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,F].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(m.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(m.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),m.UniverThreadCommentUIPlugin=We([o.DependentOn(b.UniverThreadCommentPlugin),me(1,o.Inject(o.Injector)),me(2,o.ICommandService),me(3,o.IConfigService)],m.UniverThreadCommentUIPlugin);var fe={exports:{}},re={};/**
|
|
103
|
-
* @license React
|
|
104
|
-
* react-jsx-runtime.production.min.js
|
|
105
|
-
*
|
|
106
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the MIT license found in the
|
|
109
|
-
* LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/var ze=h,Ze=Symbol.for("react.element"),Ge=Symbol.for("react.fragment"),Ke=Object.prototype.hasOwnProperty,Ye=ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function ge(n,e,t){var r,i={},d=null,c=null;t!==void 0&&(d=""+t),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(c=e.ref);for(r in e)Ke.call(e,r)&&!Je.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Ze,type:n,key:d,ref:c,props:i,_owner:Ye.current}}re.Fragment=Ge,re.jsx=ge,re.jsxs=ge,fe.exports=re;var a=fe.exports,N=function(){return N=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},N.apply(this,arguments)},Qe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,d=n.extend,c=Qe(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),g=h.useRef("_".concat($e()));return pe(t,"".concat(r),{defIds:t.defIds,idSuffix:g.current},N({ref:e,className:C},c),d)});function pe(n,e,t,r,i){return h.createElement(n.tag,N(N({key:e},Xe(n,t,i)),r),(qe(n,t).children||[]).map(function(d,c){return pe(d,"".concat(e,"-").concat(n.tag,"-").concat(c),t,void 0,i)}))}function Xe(n,e,t){var r=N({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(d){var c=d[0],C=d[1];typeof C=="string"&&(r[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function qe(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?N(N({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?N(N({},i),{attrs:N(N({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function $e(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:et}))});Ie.displayName="DeleteSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:tt}))});Se.displayName="IncreaseSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:nt}))});xe.displayName="MoreHorizontalSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:rt}))});ye.displayName="ReplyToCommentSingle";var it={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:it}))});be.displayName="ResolvedSingle";var ot={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:ot}))});Te.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},st=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},dt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),_e=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let d=0;return t==null||t.forEach(c=>{d<c.startIndex&&i.push({type:"text",content:e.slice(d,c.startIndex)}),i.push({type:"mention",content:{label:e.slice(c.startIndex,c.endIndex).slice(1,-1),id:c.rangeId}}),d=c.endIndex}),i.push({type:"text",content:e.slice(d,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const d=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:d,properties:{}});break}}}),e+=`
|
|
111
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},lt=n=>({display:n.label,id:`${n.id}`,raw:n}),mt=(n,e,t,r,i)=>{var c,C;const d=(c=n.raw)==null?void 0:c.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[d?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:d}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var x,R;const{comment:t,onSave:r,id:i,onCancel:d,autoFocus:c,unitId:C,subUnitId:g}=n,j=o.useDependency(le),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,f]=h.useState({...t}),[p,S]=h.useState(!1),O=h.useRef(null),T=o.useDependency(Me.DocSelectionManagerService),u=(x=o.useDependency(Re.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:x.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(s){var y;f({...t,text:s,attachments:[]}),(y=O.current)==null||y.inputElement.focus()}}));const W=()=>{var s;I.text&&(r==null||r({...I,text:I.text}),S(!1),f({text:void 0}),(s=O.current)==null||s.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:s=>s.preventDefault(),children:[a.jsx(_.Mentions,{ref:O,autoFocus:c,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?dt(_e(I.text)):"",onChange:s=>{s.target.value||f({...t,text:void 0}),f==null||f({...t,text:Ue(st(s.target.value))})},onFocus:()=>{const s=T.getActiveTextRange();s&&s.collapsed&&(u==null||u.removeAllRanges()),u==null||u.blur(),S(!0)},children:a.jsx(_.Mention,{trigger:j.trigger,data:(s,y)=>j.getMentions(s,C,g).then(U=>U.map(lt)).then(y),displayTransform:(s,y)=>`@${y} `,renderSuggestion:(R=j.renderSuggestion)!=null?R:mt},j.trigger)}),p?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{d==null||d(),S(!1),f({text:void 0}),w.executeCommand(F.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:W,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ct=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:d,onReply:c,resolved:C,isRoot:g,onClose:j,onDeleteComment:w}=n,M=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),f=o.useDependency(o.UserManagerService),p=f.getUser(e.personId),S=k.useObservable(f.currentUser$),O=(S==null?void 0:S.userID)===e.personId,T=e.id===Ee,[Z,u]=h.useState(!1),W=()=>{(w==null?void 0:w(e))!==!1&&(M.executeCommand(g?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),g&&(j==null||j()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>u(!1),onMouseEnter:()=>u(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:p==null?void 0:p.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(p==null?void 0:p.name)||" "}),a.jsxs("div",{children:[T||C?null:Z?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>c(p),children:a.jsx(ye,{})}):null,O&&!T&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>d==null?void 0:d(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:W,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(xe,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>d==null?void 0:d(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:x,attachments:R})=>{d==null||d(!1),M.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:x,attachments:R}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:_e(e.text).map((x,R)=>{switch(x.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",x.content.label," "]},R);default:return x.content}})})]})},Ne=n=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:d=!0,onClick:c,showHighlight:C,onClose:g,getSubUnitName:j,prefix:w,autoFocus:M,onMouseEnter:I,onMouseLeave:f,onAddComment:p,onDeleteComment:S,onResolve:O}=n,T=o.useDependency(b.ThreadCommentModel),[Z,u]=h.useState(!1),[W,x]=h.useState(""),R=h.useMemo(()=>T.commentUpdate$.pipe(ne.debounceTime(16)),[T]);k.useObservable(R);const s=e?T.getCommentWithChildren(t,r,e):null,y=o.useDependency(o.ICommandService),U=o.useDependency(o.UserManagerService),H=s==null?void 0:s.root.resolved,D=k.useObservable(U.currentUser$),Q=h.useRef(null),X=[...s?[s.root]:[{id:Ee,text:{dataStream:`
|
|
112
|
-
\r`},personId:(ae=D==null?void 0:D.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...($=s==null?void 0:s.children)!=null?$:[]],G=h.useRef(null),V=P=>{P.stopPropagation(),H?y.executeCommand(F.id,{unitId:t,subUnitId:r,commentId:e}):y.executeCommand(F.id),y.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!H}),O==null||O(!H)},q=P=>{P.stopPropagation(),y.executeCommand(F.id),!(s!=null&&s.root&&(S==null?void 0:S(s.root))===!1)&&(y.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),g==null||g())};h.useEffect(()=>f==null?void 0:f(),[]);const B=j((ee=s==null?void 0:s.root.subUnitId)!=null?ee:r),oe=d&&!W&&!H,Y=`${i||(s==null?void 0:s.root.ref)||""}${B?" · ":""}${B}`;return a.jsxs("div",{className:at(v.threadComment,{[v.threadCommentActive]:!H&&(C||Z||w==="cell")}),onClick:c,id:`${w}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),u(!0)},onMouseLeave:()=>{f==null||f(),u(!1)},children:[!H&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),s?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:V,className:v.threadCommentIcon,style:{color:H?"rgb(var(--green-500))":""},children:H?a.jsx(be,{}):a.jsx(Te,{})}),(D==null?void 0:D.userID)===s.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:G,children:X.map(P=>a.jsx(ct,{onClose:g,unitId:t,subUnitId:r,item:P,isRoot:P.id===(s==null?void 0:s.root.id),editing:W===P.id,resolved:s==null?void 0:s.root.resolved,onEditingChange:A=>{x(A?P.id:"")},onReply:A=>{A&&requestAnimationFrame(()=>{var l;(l=Q.current)==null||l.reply(Ue([{type:"mention",content:{id:A.userID,label:A.name}}]))})},onAddComment:p,onDeleteComment:S},P.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:Q,unitId:t,subUnitId:r,onSave:async({text:P,attachments:A})=>{const l={text:P,attachments:A,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:D==null?void 0:D.userID,parentId:s==null?void 0:s.root.id,unitId:t,subUnitId:r,threadId:s==null?void 0:s.root.threadId};(p==null?void 0:p(l))!==!1&&(await y.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:l}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:M||!s,onCancel:()=>{s||g==null||g()}},`${M}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},ht=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:d,onResolve:c,sortComments:C,onItemLeave:g,onItemEnter:j,disableAdd:w,tempComment:M,onAddComment:I,onDeleteComment:f,showComments:p}=n,[S,O]=h.useState("all"),[T,Z]=h.useState("all"),u=o.useDependency(o.LocaleService),W=o.useDependency(o.UserManagerService),x=o.useDependency(b.ThreadCommentModel),[R,s]=h.useState(()=>x.getUnit(e)),y=o.useDependency(m.ThreadCommentPanelService),U=k.useObservable(y.activeCommentId$),H=k.useObservable(x.commentUpdate$),D=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),G="panel",V=k.useObservable(W.currentUser$),q=h.useMemo(()=>{var de;const l=S==="all"?R:(de=R.filter(E=>E.subUnitId===Q))!=null?de:[],te=C!=null?C:E=>E,se=l.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(p){const E=new Map;return se.forEach(K=>{E.set(K.id,K)}),[...p,""].map(K=>E.get(K)).filter(Boolean)}else return te(se)},[p,S,R,C,Q]),B=h.useMemo(()=>[...q.filter(l=>!l.resolved),...q.filter(l=>l.resolved)],[q]),oe=h.useMemo(()=>T==="resolved"?B.filter(l=>l.resolved):T==="unsolved"?B.filter(l=>!l.resolved):T==="concern_me"&&V!=null&&V.userID?B.filter(l=>l==null?void 0:l.users.has(V.userID)):B,[B,V==null?void 0:V.userID,T]),Y=M?[M,...oe]:oe,ae=Y.filter(l=>!l.resolved),$=Y.filter(l=>l.resolved),ee=T!=="all"||S!=="all",P=()=>{Z("all"),O("all")};h.useEffect(()=>{e&&s(x.getUnit(e))},[e,x,H]),h.useEffect(()=>{var E;if(!U)return;if(!X.current){X.current=!0;return}const{unitId:l,subUnitId:te,commentId:se}=U,de=`${G}-${l}-${te}-${se}`;(E=document.getElementById(de))==null||E.scrollIntoView({block:"center"})},[U]);const A=l=>a.jsx(Ne,{prefix:G,getSubUnitName:d,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(U==null?void 0:U.commentId)===l.id,showHighlight:(U==null?void 0:U.commentId)===l.id,onClick:()=>{X.current=!1,l.resolved?D.executeCommand(F.id):D.executeCommand(F.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>j==null?void 0:j(l),onMouseLeave:()=>g==null?void 0:g(l),onAddComment:I,onDeleteComment:f,onResolve:te=>c==null?void 0:c(l.id,te)},l.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:l=>O(l),options:[{value:"current",label:u.t("threadCommentUI.filter.sheet.current")},{value:"all",label:u.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:T,onChange:l=>Z(l),options:[{value:"all",label:u.t("threadCommentUI.filter.status.all")},{value:"resolved",label:u.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:u.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:u.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(A),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(A),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?u.t("threadCommentUI.panel.filterEmpty"):u.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:P,type:"link",children:u.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:w,children:[a.jsx(Se,{}),u.t("threadCommentUI.panel.addComment")]})]})]})};m.IThreadCommentMentionDataService=le,m.SetActiveCommentOperation=F,m.THREAD_COMMENT_PANEL=he,m.ThreadCommentPanel=ht,m.ThreadCommentTree=Ne,m.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/docs-thread-comment-ui
|
|
116
|
-
|
|
117
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverDocsThreadCommentUi={},c.UniverCore,c.UniverEngineRender,c.UniverThreadCommentUi,c.UniverDocs,c.UniverDocsUi,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React))})(this,function(c,o,g,T,M,j,w,C,A,O){"use strict";var Fe=Object.defineProperty;var Le=(c,o,g)=>o in c?Fe(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var Y=(c,o,g)=>Le(c,typeof o!="symbol"?o+"":o,g);const se="DOC_THREAD_COMMENT_UI_PLUGIN",y="default_doc",de="docs-thread-comment-ui.config",ae={};var ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ce(t,r,i),i},Q=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Y(this,"_addingComment$",new A.BehaviorSubject(void 0));Y(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=le([Q(0,C.ISidebarService),Q(1,o.Inject(T.ThreadCommentPanelService))],U);var X={exports:{}},B={};/**
|
|
118
|
-
* @license React
|
|
119
|
-
* react-jsx-runtime.production.min.js
|
|
120
|
-
*
|
|
121
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the MIT license found in the
|
|
124
|
-
* LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/var ue=O,ve=Symbol.for("react.element"),fe=Symbol.for("react.fragment"),he=Object.prototype.hasOwnProperty,Ce=ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pe={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var n,i={},s=null,d=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(d=t.ref);for(n in t)he.call(t,n)&&!pe.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:ve,type:e,key:s,ref:d,props:i,_owner:Ce.current}}B.Fragment=fe,B.jsx=k,B.jsxs=k,X.exports=B;var Ie=X.exports;const W={id:"docs.command.add-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{comment:r,unitId:n}=t,s=await e.get(w.IThreadCommentDataSourceService).addComment(r),d=e.get(o.ICommandService),a=j.addCustomDecorationBySelectionFactory(e,{id:s.threadId,type:o.CustomDecorationType.COMMENT});if(a){const v={id:w.AddCommentMutation.id,params:{unitId:n,subUnitId:y,comment:s}},h={id:T.SetActiveCommentOperation.id,params:{unitId:n,subUnitId:y,commentId:s.id}};return(await o.sequenceExecute([v,a,h],d)).result}return!1}},K={id:"docs.command.delete-comment",type:o.CommandType.COMMAND,async handler(e,t){if(!t)return!1;const{commentId:r,unitId:n}=t,i=e.get(o.ICommandService),s=j.deleteCustomDecorationFactory(e,{id:r,unitId:n});return s?(await o.sequenceExecute([s],i)).result:!1}},ee=e=>{const t=e.get(g.IRenderManagerService),r=e.get(M.DocSelectionManagerService),n=t.getCurrent(),i=n==null?void 0:n.with(M.DocSkeletonManagerService).getSkeleton(),s=i==null?void 0:i.getViewModel().getEditArea();if(s===g.DocumentEditArea.FOOTER||s===g.DocumentEditArea.HEADER)return!0;const d=r.getActiveTextRange();return!!(d==null||d.collapsed)};function _e(e){return{id:V.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC,void 0,o.SHEET_EDITOR_UNITS),disabled$:new A.Observable(function(t){const n=e.get(M.DocSelectionManagerService).textSelection$.pipe(A.debounceTime(16)).subscribe(()=>{t.next(ee(e))});return()=>{n.unsubscribe()}})}}function Se(e){return{id:G.id,type:C.MenuItemType.BUTTON,icon:"CommentSingle",title:"threadCommentUI.panel.addComment",tooltip:"threadCommentUI.panel.addComment",hidden$:C.getMenuHiddenObservable(e,o.UniverInstanceType.UNIVER_DOC)}}const P=()=>{const e=o.useDependency(o.IUniverInstanceService),t=o.useDependency(o.Injector),r=O.useMemo(()=>e.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_DOC),[e]),n=o.useObservable(r),i=O.useMemo(()=>new A.Observable(l=>l.next(y)),[]),s=o.useDependency(M.DocSelectionManagerService),d=O.useMemo(()=>s.textSelection$.pipe(A.debounceTime(16)),[s.textSelection$]);o.useObservable(d);const a=o.useDependency(o.ICommandService),v=o.useDependency(U),h=o.useObservable(v.addingComment$),[m,_]=O.useState([]);if(O.useEffect(()=>{var E;const l=new Set,u=n==null?void 0:n.getCustomDecorations();_((E=u==null?void 0:u.map(f=>f.id).filter(f=>{const b=l.has(f);return l.add(f),!b}))!=null?E:[]);const D=a.onCommandExecuted(f=>{var b;if(f.id===M.RichTextEditingMutation.id){const $=new Set,q=n==null?void 0:n.getCustomDecorations();_((b=q==null?void 0:q.map(H=>H.id).filter(H=>{const Be=$.has(H);return $.add(H),!Be}))!=null?b:[])}});return()=>{D.dispose()}},[a,n]),!n)return null;const S=ee(t),p=n.getUnitId();return Ie.jsx(T.ThreadCommentPanel,{unitId:p,subUnitId$:i,type:o.UniverInstanceType.UNIVER_DOC,onAdd:()=>{a.executeCommand(V.id)},getSubUnitName:()=>"",disableAdd:S,tempComment:h,onAddComment:l=>{if(!l.parentId){const u={unitId:p,range:h,comment:l};return a.executeCommand(W.id,u),v.endAdd(),!1}return!0},onDeleteComment:l=>{if(!l.parentId){const u={unitId:p,commentId:l.id};return a.executeCommand(K.id,u),!1}return!0},showComments:m})};P.componentKey="univer.doc.thread-comment-panel";const N={id:"docs.operation.show-comment-panel",type:o.CommandType.OPERATION,handler(e,t){var i;const r=e.get(T.ThreadCommentPanelService),n=e.get(C.ISidebarService);return(!r.panelVisible||((i=n.options.children)==null?void 0:i.label)!==P.componentKey)&&(n.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>r.setPanelVisible(!1)}),r.setPanelVisible(!0)),t&&r.setActiveComment(t==null?void 0:t.activeComment),!0}},G={id:"docs.operation.toggle-comment-panel",type:o.CommandType.OPERATION,handler(e){var n;const t=e.get(T.ThreadCommentPanelService),r=e.get(C.ISidebarService);return!t.panelVisible||((n=r.options.children)==null?void 0:n.label)!==P.componentKey?(r.open({header:{title:"threadCommentUI.panel.title"},children:{label:P.componentKey},width:320,onClose:()=>t.setPanelVisible(!1)}),t.setPanelVisible(!0)):(r.close(),t.setPanelVisible(!1),t.setActiveComment(null)),!0}},V={id:"docs.operation.start-add-comment",type:o.CommandType.OPERATION,handler(e){var f,b,$;const t=e.get(T.ThreadCommentPanelService),n=e.get(o.IUniverInstanceService).getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC),i=e.get(M.DocSelectionManagerService),s=e.get(g.IRenderManagerService),d=e.get(o.UserManagerService),a=e.get(U),v=e.get(o.ICommandService),h=e.get(C.ISidebarService),m=i.getActiveTextRange();if(!n||!m)return!1;const _=(f=s.getRenderById(n.getUnitId()))==null?void 0:f.with(j.DocSelectionRenderService);if(m.collapsed)return t.panelVisible?(t.setPanelVisible(!1),h.close()):v.executeCommand(N.id),!0;v.executeCommand(N.id);const S=n.getUnitId(),p=(($=(b=n.getBody())==null?void 0:b.dataStream)!=null?$:"").slice(m.startOffset,m.endOffset),l=o.BuildTextUtils.transform.getPlainText(p),u=y,D="",E={unitId:S,subUnitId:u,id:D,ref:l,dT:w.getDT(),personId:d.getCurrentUser().userID,text:{dataStream:`\r
|
|
126
|
-
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs-pro/thread-comment-datasource
|
|
130
|
-
|
|
131
|
-
function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=function(_0x1085fa,_0x46606a){_0x1085fa=_0x1085fa-0xfe;let _0x2655bd=_0x45cb86[_0x1085fa];return _0x2655bd;},_0x1085(_0x330f90,_0x71315c);}(function(_0x1c3962,_0x38a0e2){const _0xcc7751=_0x1085,_0x25cd31=_0x1c3962();while(!![]){try{const _0x4ef23e=parseInt(_0xcc7751(0x155))/0x1+parseInt(_0xcc7751(0x119))/0x2+parseInt(_0xcc7751(0x193))/0x3*(-parseInt(_0xcc7751(0x15d))/0x4)+-parseInt(_0xcc7751(0x147))/0x5+-parseInt(_0xcc7751(0x16c))/0x6*(-parseInt(_0xcc7751(0x181))/0x7)+parseInt(_0xcc7751(0x18c))/0x8+-parseInt(_0xcc7751(0x157))/0x9;if(_0x4ef23e===_0x38a0e2)break;else _0x25cd31['push'](_0x25cd31['shift']());}catch(_0x1c931a){_0x25cd31['push'](_0x25cd31['shift']());}}}(_0x45cb,0xc73dd),function(_0x223df9,_0x2a32d0){const _0x169cb1=_0x1085;typeof exports==_0x169cb1(0x16e)&&typeof module<'u'?_0x2a32d0(exports,require('@univerjs/core'),require(_0x169cb1(0x13d)),require(_0x169cb1(0x178)),require(_0x169cb1(0x105)),require(_0x169cb1(0x13b)),require(_0x169cb1(0x128)),require(_0x169cb1(0x120))):typeof define=='function'&&define['amd']?define([_0x169cb1(0x106),_0x169cb1(0x188),'@univerjs/thread-comment-ui','@univerjs-pro/collaboration-client',_0x169cb1(0x105),_0x169cb1(0x13b),'rxjs',_0x169cb1(0x120)],_0x2a32d0):(_0x223df9=typeof globalThis<'u'?globalThis:_0x223df9||self,_0x2a32d0(_0x223df9[_0x169cb1(0x143)]={},_0x223df9['UniverCore'],_0x223df9[_0x169cb1(0x187)],_0x223df9[_0x169cb1(0x16d)],_0x223df9[_0x169cb1(0x160)],_0x223df9[_0x169cb1(0x144)],_0x223df9[_0x169cb1(0x128)],_0x223df9[_0x169cb1(0x12b)]));}(this,function(_0x17a296,_0x3d0190,_0x3ed21d,_0x3db026,_0x51384d,_0x5c0884,_0x1b5c0a,_0x49bd93){'use strict';const _0x2d1c5a=_0x1085;const _0x581514='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x5cda73=(_0x209b8d=>(_0x209b8d[_0x209b8d[_0x2d1c5a(0x121)]=0x0]=_0x2d1c5a(0x121),_0x209b8d[_0x209b8d[_0x2d1c5a(0x16f)]=0x1]=_0x2d1c5a(0x16f),_0x209b8d[_0x209b8d[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x209b8d))(_0x5cda73||{}),_0x4aae21=(_0x569621=>(_0x569621[_0x569621[_0x2d1c5a(0x12c)]=0x0]=_0x2d1c5a(0x12c),_0x569621[_0x569621[_0x2d1c5a(0xfe)]=0x1]=_0x2d1c5a(0xfe),_0x569621[_0x569621['Reply']=0x2]=_0x2d1c5a(0x194),_0x569621[_0x569621[_0x2d1c5a(0x18f)]=0x3]=_0x2d1c5a(0x18f),_0x569621[_0x569621['Delete']=0x4]=_0x2d1c5a(0x15f),_0x569621[_0x569621[_0x2d1c5a(0x163)]=0x5]='Solve',_0x569621[_0x569621[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x569621))(_0x4aae21||{});const _0x1d64e1=_0x32d4fa=>_0x3d0190[_0x2d1c5a(0x168)](new Date(+_0x32d4fa))['format'](_0x2d1c5a(0x17a)),_0x41e898=async(_0x1daffb,_0x2ae0d7)=>{const _0x49961f=_0x2d1c5a,_0x4f8c20=_0x1daffb[_0x49961f(0x191)](_0x3d0190[_0x49961f(0x11c)]),_0x50f0c5=_0x1daffb[_0x49961f(0x191)](_0x49bd93[_0x49961f(0x176)]);_0x2ae0d7[_0x49961f(0x11d)](_0x27ee20=>{const _0x12083e=_0x49961f;_0x4f8c20['getUser'](_0x27ee20)&&_0x2ae0d7[_0x12083e(0x124)](_0x27ee20);}),_0x2ae0d7[_0x49961f(0x156)]&&(await _0x50f0c5[_0x49961f(0x191)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2ae0d7]}}))[_0x49961f(0x141)][_0x49961f(0x177)][_0x49961f(0x11d)](_0x1f578d=>{const _0x5d3ae8=_0x49961f;_0x1f578d&&_0x4f8c20[_0x5d3ae8(0x111)](_0x1f578d);});};var _0x2b18e9=Object['defineProperty'],_0xaed435=Object['getOwnPropertyDescriptor'],_0xdbf4ec=(_0x3443bc,_0x3e2fe7,_0x3d4a6c,_0x5e2b31)=>{const _0x5b531d=_0x2d1c5a;for(var _0x15e483=_0x5e2b31>0x1?void 0x0:_0x5e2b31?_0xaed435(_0x3e2fe7,_0x3d4a6c):_0x3e2fe7,_0x229be8=_0x3443bc[_0x5b531d(0x104)]-0x1,_0x29a12f;_0x229be8>=0x0;_0x229be8--)(_0x29a12f=_0x3443bc[_0x229be8])&&(_0x15e483=(_0x5e2b31?_0x29a12f(_0x3e2fe7,_0x3d4a6c,_0x15e483):_0x29a12f(_0x15e483))||_0x15e483);return _0x5e2b31&&_0x15e483&&_0x2b18e9(_0x3e2fe7,_0x3d4a6c,_0x15e483),_0x15e483;},_0x470027=(_0x2a44f3,_0x529c33)=>(_0x166652,_0x92e77d)=>_0x529c33(_0x166652,_0x92e77d,_0x2a44f3);let _0x2c4030=class extends _0x3d0190['Disposable']{constructor(_0x1c592b,_0xef8ea5,_0x4e6c26,_0x22f0c3){const _0x6f6060=_0x2d1c5a;super(),this[_0x6f6060(0x11f)]=_0x1c592b,this[_0x6f6060(0x114)]=_0xef8ea5,this[_0x6f6060(0x151)]=_0x4e6c26,this[_0x6f6060(0x101)]=_0x22f0c3,this['_init'](),this[_0x6f6060(0x127)]();}[_0x2d1c5a(0x127)](){const _0x568e0e=_0x2d1c5a;this[_0x568e0e(0xff)](this['_threadCommentModel'][_0x568e0e(0x16a)][_0x568e0e(0x100)](_0x1b5c0a[_0x568e0e(0x15e)](0x10))['subscribe'](_0x496c60=>{const _0x35946b=new Set();_0x496c60['forEach'](_0x34a6dc=>{const _0xeb10e9=_0x1085;switch(_0x34a6dc[_0xeb10e9(0x117)]){case _0xeb10e9(0x139):{const _0x5d3422=_0x34a6dc[_0xeb10e9(0x17e)][_0xeb10e9(0x162)];_0x35946b[_0xeb10e9(0x139)](_0x5d3422);break;}}}),_0x41e898(this['_injector'],_0x35946b);}));}['_init'](){const _0x32d451=_0x2d1c5a;this[_0x32d451(0xff)](this['_commentService']['commentUpdate$'][_0x32d451(0x167)](async _0x490edc=>{const _0x159d32=_0x32d451;var _0x22400e,_0xc8d55f,_0x22c0dd,_0x4b8c1f;const _0x29d0eb=(_0x22400e=this['_threadCommentModel']['getUnit'](_0x490edc[_0x159d32(0x17d)])['find'](_0x43f4ee=>_0x43f4ee['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x22400e['root'];if(!_0x29d0eb)return;const {unitId:_0x117158,subUnitId:_0x3aafe5}=_0x29d0eb;switch(_0x490edc[_0x159d32(0x130)]&&this[_0x159d32(0x151)]['addUser'](_0x490edc['user']),_0x490edc[_0x159d32(0x117)]){case _0x4aae21[_0x159d32(0xfe)]:break;case _0x4aae21[_0x159d32(0x194)]:{this['_threadCommentModel']['addComment'](_0x117158,_0x3aafe5,{'unitId':_0x117158,'subUnitId':_0x3aafe5,'ref':'','id':_0x490edc['replyId'],'dT':_0x1d64e1(+_0x490edc['createTimestamp']),'threadId':_0x490edc[_0x159d32(0x14f)],'personId':(_0x22c0dd=(_0xc8d55f=_0x490edc[_0x159d32(0x130)])==null?void 0x0:_0xc8d55f[_0x159d32(0x171)])!=null?_0x22c0dd:_0x490edc['userId'],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)]),'parentId':_0x29d0eb['id']});break;}case _0x4aae21[_0x159d32(0x15f)]:{const _0x55b8a5=this[_0x159d32(0x114)][_0x159d32(0x183)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);_0x55b8a5&&_0x55b8a5['parentId']&&this[_0x159d32(0x114)][_0x159d32(0x140)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);break;}case _0x4aae21['Edit']:{this[_0x159d32(0x114)][_0x159d32(0x134)](_0x117158,_0x3aafe5,{'commentId':_0x490edc[_0x159d32(0x14e)],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)])});break;}case _0x4aae21[_0x159d32(0x163)]:{const _0x99e61a=(_0x4b8c1f=this[_0x159d32(0x114)][_0x159d32(0x174)](_0x490edc['unitId'])[_0x159d32(0x154)](_0x232300=>_0x232300['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x4b8c1f[_0x159d32(0x185)];_0x99e61a&&this[_0x159d32(0x114)]['resolveComment'](_0x117158,_0x3aafe5,_0x99e61a['id'],_0x490edc[_0x159d32(0x166)]===_0x5cda73[_0x159d32(0x16f)]);break;}}}));}};_0x2c4030=_0xdbf4ec([_0x470027(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x16b)])),_0x470027(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x5c0884['ThreadCommentModel'])),_0x470027(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x470027(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190['Injector']))],_0x2c4030);const _0x168b3a=_0x2d1c5a(0x12d),_0x5c96e1={};var _0x3f3071=Object[_0x2d1c5a(0x18e)],_0x4e1f86=Object['getOwnPropertyDescriptor'],_0x34829b=(_0x4ac3ab,_0x20f67f,_0x137e72,_0x56aa0f)=>{for(var _0x42b400=_0x56aa0f>0x1?void 0x0:_0x56aa0f?_0x4e1f86(_0x20f67f,_0x137e72):_0x20f67f,_0x382a88=_0x4ac3ab['length']-0x1,_0x583b56;_0x382a88>=0x0;_0x382a88--)(_0x583b56=_0x4ac3ab[_0x382a88])&&(_0x42b400=(_0x56aa0f?_0x583b56(_0x20f67f,_0x137e72,_0x42b400):_0x583b56(_0x42b400))||_0x42b400);return _0x56aa0f&&_0x42b400&&_0x3f3071(_0x20f67f,_0x137e72,_0x42b400),_0x42b400;},_0x5b385f=(_0x3179ab,_0x2379b8)=>(_0x4ad694,_0x3d031b)=>_0x2379b8(_0x4ad694,_0x3d031b,_0x3179ab);function _0x287c05(_0x334b3e,_0x1c3ac9){const _0x1da2de=_0x2d1c5a,_0x316913=_0x334b3e[_0x1da2de(0x116)][0x0];return{..._0x1c3ac9,'id':_0x316913[_0x1da2de(0x14e)],'resolved':_0x334b3e[_0x1da2de(0x166)]===0x1,'dT':_0x1d64e1(_0x316913[_0x1da2de(0x123)]),'personId':_0x316913[_0x1da2de(0x12a)],'threadId':_0x316913[_0x1da2de(0x14f)]};}function _0x4513b1(_0x5c5d7f,_0xee5259,_0x1ea201){const _0x1aa179=_0x2d1c5a;var _0x30e012,_0x4a60c9;if(((_0x4a60c9=(_0x30e012=_0x5c5d7f==null?void 0x0:_0x5c5d7f['replies'])==null?void 0x0:_0x30e012[_0x1aa179(0x104)])!=null?_0x4a60c9:0x0)>0x0){const _0x33a106=(_0x413bee,_0x1ef023)=>({'id':_0x413bee[_0x1aa179(0x14e)],'threadId':_0x413bee['threadId'],'dT':_0x1d64e1(_0x413bee['createTimestamp']),'personId':_0x413bee['userId'],'resolved':_0x5c5d7f['solved']===_0x5cda73[_0x1aa179(0x16f)],'unitId':_0xee5259,'subUnitId':_0x1ea201,'text':JSON[_0x1aa179(0x164)](_0x413bee['content']),'parentId':_0x1ef023}),_0x2fcf35=_0x33a106(_0x5c5d7f['replies'][0x0]);return{..._0x2fcf35,'children':_0x5c5d7f[_0x1aa179(0x116)]['slice'](0x1)[_0x1aa179(0x17b)](_0x25c910=>_0x33a106(_0x25c910,_0x2fcf35['id']))};}return null;}let _0x4c567b=class{constructor(_0x504ccd,_0x440d1d,_0x13d849,_0x1e6654){const _0x21ba5d=_0x2d1c5a;this[_0x21ba5d(0x109)]=_0x504ccd,this[_0x21ba5d(0x151)]=_0x440d1d,this[_0x21ba5d(0x102)]=_0x13d849,this[_0x21ba5d(0x101)]=_0x1e6654;}async[_0x2d1c5a(0x126)](_0x2d47fd){const _0x30ca48=_0x2d1c5a;var _0x23c2b9,_0x54c2a1;const {parentId:_0x92c8a9,unitId:_0x5cc676,text:_0x3d84cf,threadId:_0x5735b3}=_0x2d47fd,_0x2e07a3=(_0x54c2a1=(_0x23c2b9=_0x3d84cf[_0x30ca48(0x135)])==null?void 0x0:_0x23c2b9['filter'](_0x3766f4=>_0x3766f4[_0x30ca48(0x15b)]===_0x3d0190[_0x30ca48(0x150)][_0x30ca48(0x18b)])[_0x30ca48(0x17b)](_0x3231ef=>_0x3231ef[_0x30ca48(0x122)]))!=null?_0x54c2a1:[],_0x57e106=JSON[_0x30ca48(0x14d)](_0x3d84cf),_0x44db1c=(await this[_0x30ca48(0x102)]['requireSession'](_0x5cc676))[_0x30ca48(0x18a)]();if(_0x92c8a9){const _0x20deb8={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3,'threadId':_0x5735b3},_0x5ed8eb=(await this['_httpService'][_0x30ca48(0x14b)]('/universer-api/comment/unit/'+_0x5cc676+_0x30ca48(0x192),{'body':_0x20deb8}))[_0x30ca48(0x141)][_0x30ca48(0x161)];return{..._0x2d47fd,'id':_0x5ed8eb[_0x30ca48(0x14e)],'dT':_0x3d0190[_0x30ca48(0x168)](+_0x5ed8eb[_0x30ca48(0x123)])['format'](_0x30ca48(0x17a)),'personId':_0x5ed8eb['userId']};}else{const _0x36ed66={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3},_0x2048d0=await this[_0x30ca48(0x109)][_0x30ca48(0x14b)](_0x30ca48(0x10a)+_0x5cc676+_0x30ca48(0x184),{'body':_0x36ed66});return _0x287c05(_0x2048d0[_0x30ca48(0x141)][_0x30ca48(0x17f)],_0x2d47fd);}}async[_0x2d1c5a(0x134)](_0xa03223){const _0x2b9009=_0x2d1c5a;var _0xd70d8b,_0x2971aa;const {text:_0xa9b207,unitId:_0x38e37f}=_0xa03223,_0x2a422d=(_0x2971aa=(_0xd70d8b=_0xa9b207[_0x2b9009(0x135)])==null?void 0x0:_0xd70d8b[_0x2b9009(0x175)](_0x2e447c=>_0x2e447c['rangeType']===_0x3d0190[_0x2b9009(0x150)]['COMMENT'])[_0x2b9009(0x17b)](_0x2a0ee2=>_0x2a0ee2[_0x2b9009(0x122)]))!=null?_0x2971aa:[],_0x27365a=JSON[_0x2b9009(0x14d)](_0xa9b207),_0xa8dbb2=_0xa03223[_0x2b9009(0x14f)],_0x32e73c=_0xa03223['id'],_0x30dbfc={'memberId':(await this[_0x2b9009(0x102)][_0x2b9009(0x11e)](_0x38e37f))['getMemberID'](),'unitId':_0x38e37f,'threadId':_0xa8dbb2,'mention':_0x2a422d,'content':_0x27365a,'replyId':_0x32e73c},_0x335d49=await this[_0x2b9009(0x109)]['post'](_0x2b9009(0x10a)+_0x38e37f+_0x2b9009(0x13f),{'body':_0x30dbfc});return!_0x335d49[_0x2b9009(0x141)][_0x2b9009(0x132)]||_0x335d49['body']['error'][_0x2b9009(0x107)]===0x1;}async[_0x2d1c5a(0x13e)](_0x25130f){const _0x3f746e=_0x2d1c5a,{unitId:_0x45df06}=_0x25130f,_0x4b542f=_0x25130f[_0x3f746e(0x14f)],_0x458032={'memberId':this['_userService'][_0x3f746e(0x10b)]()['userID'],'unitId':_0x45df06,'threadId':_0x4b542f,'solved':_0x25130f[_0x3f746e(0x138)]?_0x5cda73[_0x3f746e(0x16f)]:_0x5cda73[_0x3f746e(0x121)]},_0x5d5e33=await this[_0x3f746e(0x109)][_0x3f746e(0x14b)](_0x3f746e(0x10a)+_0x45df06+_0x3f746e(0x186),{'body':_0x458032});return!_0x5d5e33[_0x3f746e(0x141)]['error']||_0x5d5e33[_0x3f746e(0x141)][_0x3f746e(0x132)][_0x3f746e(0x107)]===0x1;}async[_0x2d1c5a(0x140)](_0x4bf704,_0x13e9f4,_0x4a7c8d,_0x3aaf08){const _0x2b2280=_0x2d1c5a,_0x2f3900={'memberId':(await this[_0x2b2280(0x102)][_0x2b2280(0x11e)](_0x4bf704))[_0x2b2280(0x18a)](),'threadId':_0x4a7c8d,'replyId':_0x3aaf08,'unitId':_0x4bf704},_0xc6ccca=await this[_0x2b2280(0x109)][_0x2b2280(0x14b)]('/universer-api/comment/unit/'+_0x4bf704+_0x2b2280(0x172),{'body':_0x2f3900});return!_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]||_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]['code']===0x1;}async['listComments'](_0x4daf68,_0x3df24c,_0x30e3d8){const _0x5d19cd=_0x2d1c5a,_0x76a77c={'unitId':_0x4daf68,'threadId':_0x30e3d8},_0x2dd97e=await this[_0x5d19cd(0x109)]['post'](_0x5d19cd(0x10a)+_0x4daf68+_0x5d19cd(0x179),{'body':_0x76a77c}),_0x3e6e53=_0x30e3d8[_0x5d19cd(0x17b)](_0x3a0879=>_0x4513b1(_0x2dd97e['body']['comments'][_0x3a0879],_0x4daf68,_0x3df24c))['filter'](Boolean);return Object[_0x5d19cd(0x112)](_0x2dd97e[_0x5d19cd(0x141)][_0x5d19cd(0x177)])[_0x5d19cd(0x11d)](_0x4e7ff0=>{const _0x434fbd=_0x5d19cd;this['_userService'][_0x434fbd(0x111)](_0x4e7ff0);}),_0x3e6e53;}['saveCommentToSnapshot'](_0x2a7527){const _0x25447e=_0x2d1c5a;return{'id':_0x2a7527['id'],'threadId':_0x2a7527[_0x25447e(0x14f)],'ref':_0x2a7527[_0x25447e(0x11b)]};}};_0x4c567b=_0x34829b([_0x5b385f(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93['HTTPService'])),_0x5b385f(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x5b385f(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x10c)])),_0x5b385f(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)]))],_0x4c567b);var _0x570b55=Object[_0x2d1c5a(0x18e)],_0x4c869a=Object[_0x2d1c5a(0x145)],_0x2bb772=(_0x5d19b3,_0x75698f,_0x41601e,_0x4776a3)=>{const _0x42d174=_0x2d1c5a;for(var _0x5d00a1=_0x4776a3>0x1?void 0x0:_0x4776a3?_0x4c869a(_0x75698f,_0x41601e):_0x75698f,_0x372fde=_0x5d19b3[_0x42d174(0x104)]-0x1,_0x2d1d7c;_0x372fde>=0x0;_0x372fde--)(_0x2d1d7c=_0x5d19b3[_0x372fde])&&(_0x5d00a1=(_0x4776a3?_0x2d1d7c(_0x75698f,_0x41601e,_0x5d00a1):_0x2d1d7c(_0x5d00a1))||_0x5d00a1);return _0x4776a3&&_0x5d00a1&&_0x570b55(_0x75698f,_0x41601e,_0x5d00a1),_0x5d00a1;},_0x49a366=(_0x4fbd56,_0x28563b)=>(_0x62fef0,_0x2e0de7)=>_0x28563b(_0x62fef0,_0x2e0de7,_0x4fbd56);let _0x6c0c22=class{constructor(_0x8dc74c){const _0x9e5a88=_0x2d1c5a;this[_0x9e5a88(0x109)]=_0x8dc74c;}async[_0x2d1c5a(0x12e)](_0x44bee6,_0x20771b,_0x304520){const _0x58ba96=_0x2d1c5a,_0x5c5129=new URL(window[_0x58ba96(0x18d)][_0x58ba96(0x173)])['searchParams'][_0x58ba96(0x191)](_0x58ba96(0x110));if(!_0x5c5129)return[];const _0x45b2ad=window['location'][_0x58ba96(0x148)],_0x371842=window[_0x58ba96(0x18d)][_0x58ba96(0x158)]===_0x58ba96(0x12f)?_0x58ba96(0x165):_0x58ba96(0x13a);return(await this[_0x58ba96(0x109)][_0x58ba96(0x191)](_0x371842+_0x58ba96(0x149)+_0x45b2ad+_0x58ba96(0x103),{'params':{'objectID':_0x5c5129,'unitID':_0x5c5129}}))[_0x58ba96(0x141)][_0x58ba96(0x108)]['map'](_0x2a842b=>{const _0x1b1849=_0x58ba96;var _0x1e4d30,_0xf43929,_0x5015c8,_0x1c8f43,_0x561c23,_0x131e08;return{'id':(_0xf43929=(_0x1e4d30=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x1e4d30[_0x1b1849(0x171)])!=null?_0xf43929:'','label':(_0x1c8f43=(_0x5015c8=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x5015c8[_0x1b1849(0x15c)])!=null?_0x1c8f43:'','icon':(_0x131e08=(_0x561c23=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x561c23[_0x1b1849(0x133)])!=null?_0x131e08:'','type':_0x1b1849(0x130)};});}};_0x6c0c22=_0x2bb772([_0x49a366(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93[_0x2d1c5a(0x176)]))],_0x6c0c22);var _0x37496f=Object[_0x2d1c5a(0x18e)],_0x2a227c=Object[_0x2d1c5a(0x145)],_0x4d0464=(_0xd2a913,_0x87dbce,_0x5883ab,_0x51ad35)=>{for(var _0x14a9f4=_0x51ad35>0x1?void 0x0:_0x51ad35?_0x2a227c(_0x87dbce,_0x5883ab):_0x87dbce,_0x44abcb=_0xd2a913['length']-0x1,_0x5f82e1;_0x44abcb>=0x0;_0x44abcb--)(_0x5f82e1=_0xd2a913[_0x44abcb])&&(_0x14a9f4=(_0x51ad35?_0x5f82e1(_0x87dbce,_0x5883ab,_0x14a9f4):_0x5f82e1(_0x14a9f4))||_0x14a9f4);return _0x51ad35&&_0x14a9f4&&_0x37496f(_0x87dbce,_0x5883ab,_0x14a9f4),_0x14a9f4;},_0x434cce=(_0x1e9d3e,_0x140f0b)=>(_0x18600b,_0x5bb0a4)=>_0x140f0b(_0x18600b,_0x5bb0a4,_0x1e9d3e);let _0x3d1a79=class extends _0x3d0190[_0x2d1c5a(0x125)]{constructor(_0x3b6ddb,_0x357b76,_0x337cf9,_0x481722){const _0x165423=_0x2d1c5a;super(),this[_0x165423(0x142)]=_0x3b6ddb,this[_0x165423(0x17c)]=_0x357b76,this[_0x165423(0x136)]=_0x337cf9,this[_0x165423(0x146)]=_0x481722,this[_0x165423(0x190)]();}[_0x2d1c5a(0x190)](){const _0x38ca74=_0x2d1c5a;this[_0x38ca74(0x142)][_0x38ca74(0x15a)]=this[_0x38ca74(0x17c)],this[_0x38ca74(0x142)][_0x38ca74(0x152)]=!0x1,this[_0x38ca74(0x136)]['dataSource']=this[_0x38ca74(0x146)];}};_0x3d1a79=_0x4d0464([_0x434cce(0x0,_0x5c0884['IThreadCommentDataSourceService']),_0x434cce(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x4c567b)),_0x434cce(0x2,_0x3ed21d[_0x2d1c5a(0x14c)]),_0x434cce(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x6c0c22))],_0x3d1a79);var _0x25b1bc=Object[_0x2d1c5a(0x18e)],_0x271190=Object[_0x2d1c5a(0x145)],_0x51ac44=(_0x241833,_0x23df0b,_0x468956)=>_0x23df0b in _0x241833?_0x25b1bc(_0x241833,_0x23df0b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x468956}):_0x241833[_0x23df0b]=_0x468956,_0x222d11=(_0x2385c4,_0x1ead91,_0x5319db,_0x2527a7)=>{const _0x478081=_0x2d1c5a;for(var _0x55b4d9=_0x2527a7>0x1?void 0x0:_0x2527a7?_0x271190(_0x1ead91,_0x5319db):_0x1ead91,_0x5b3d36=_0x2385c4[_0x478081(0x104)]-0x1,_0x196bb6;_0x5b3d36>=0x0;_0x5b3d36--)(_0x196bb6=_0x2385c4[_0x5b3d36])&&(_0x55b4d9=(_0x2527a7?_0x196bb6(_0x1ead91,_0x5319db,_0x55b4d9):_0x196bb6(_0x55b4d9))||_0x55b4d9);return _0x2527a7&&_0x55b4d9&&_0x25b1bc(_0x1ead91,_0x5319db,_0x55b4d9),_0x55b4d9;},_0x54454a=(_0x412be0,_0x463a27)=>(_0x108220,_0x1cfaae)=>_0x463a27(_0x108220,_0x1cfaae,_0x412be0),_0x3d7f66=(_0x3bb133,_0x545864,_0x5eac52)=>_0x51ac44(_0x3bb133,typeof _0x545864!=_0x2d1c5a(0x11a)?_0x545864+'':_0x545864,_0x5eac52);_0x17a296[_0x2d1c5a(0x159)]=class extends _0x3d0190[_0x2d1c5a(0x10e)]{constructor(_0x54fd89=_0x5c96e1,_0x322218,_0x48bb3f){const _0x37d3fc=_0x2d1c5a;super(),this['_config']=_0x54fd89,this['_injector']=_0x322218,this['_configService']=_0x48bb3f;const {..._0x3fd3f9}=this[_0x37d3fc(0x169)];this[_0x37d3fc(0x170)][_0x37d3fc(0x189)](_0x168b3a,_0x3fd3f9);}[_0x2d1c5a(0x131)](){const _0x2e3fbe=_0x2d1c5a;[[_0x6c0c22],[_0x4c567b],[_0x3d1a79],[_0x2c4030]][_0x2e3fbe(0x11d)](_0x3c3c13=>{const _0x20958e=_0x2e3fbe;this['_injector'][_0x20958e(0x139)](_0x3c3c13);});}[_0x2d1c5a(0x10d)](){const _0x31eae9=_0x2d1c5a;this[_0x31eae9(0x101)]['get'](_0x3d1a79),this[_0x31eae9(0x101)][_0x31eae9(0x191)](_0x2c4030);}},_0x3d7f66(_0x17a296['UniverThreadCommentDataSourcePlugin'],_0x2d1c5a(0x13c),_0x581514),_0x3d7f66(_0x17a296[_0x2d1c5a(0x159)],'type',_0x3d0190[_0x2d1c5a(0x129)][_0x2d1c5a(0x153)]),_0x17a296[_0x2d1c5a(0x159)]=_0x222d11([_0x3d0190['DependentOn'](_0x3ed21d['UniverThreadCommentUIPlugin'],_0x3db026[_0x2d1c5a(0x115)],_0x51384d[_0x2d1c5a(0x118)]),_0x54454a(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)])),_0x54454a(0x2,_0x3d0190['IConfigService'])],_0x17a296[_0x2d1c5a(0x159)]),Object['defineProperty'](_0x17a296,Symbol[_0x2d1c5a(0x14a)],{'value':'Module'});}));function _0x45cb(){const _0x4c3ba6=['delete','Disposable','addComment','_initUserSync','rxjs','UniverInstanceType','userId','UniverNetwork','Unknown','thread-comment-data-source.config','getMentions','https:','user','onStarting','error','avatar','updateComment','customRanges','_threadCommentMentionDataService','UNRECOGNIZED','resolved','add','http','@univerjs/thread-comment','pluginName','@univerjs/thread-comment-ui','resolveComment','/edit','deleteComment','body','_threadCommentDataSourceService','UniverProThreadCommentDatasource','UniverThreadComment','getOwnPropertyDescriptor','_threadCommentMentionDataSource','6846820HIrJlY','host','://','toStringTag','post','IThreadCommentMentionDataService','stringify','replyId','threadId','CustomRangeType','_userService','syncUpdateMutationToColla','UNIVER_UNKNOWN','find','748670RYfhYR','size','14296464KKikiZ','protocol','UniverThreadCommentDataSourcePlugin','dataSource','rangeType','name','580ElmYGS','bufferTime','Delete','UniverProLicense','reply','personId','Solve','parse','https','solved','subscribe','dayjs','_config','commentUpdate$','CommentService','4782FSQpvV','UniverProCollaborationClient','object','Solved','_configService','userID','/delete','href','getUnit','filter','HTTPService','users','@univerjs-pro/collaboration-client','/list','YYYY/MM/DD\x20HH:mm','map','_threadCommentDataSource','unitId','payload','comment','content','13615oBUuuF','Inject','getComment','/add','root','/solved','UniverThreadCommentUi','@univerjs/core','setConfig','getMemberID','COMMENT','7362024zfVyhe','location','defineProperty','Edit','_initDataSource','get','/reply','14718WcxWkQ','Reply','Add','disposeWithMe','pipe','_injector','_sessionService','/universer-api/authz/collaborator','length','@univerjs-pro/license','exports','code','collaborators','_httpService','/universer-api/comment/unit/','getCurrentUser','CollaborationSessionService','onReady','Plugin','Injector','unit','addUser','values','subject','_threadCommentModel','UniverCollaborationClientPlugin','replies','type','UniverLicensePlugin','2532470kOXJCz','symbol','ref','UserManagerService','forEach','requireSession','_commentService','@univerjs/network','OpenOrReOpen','rangeId','createTimestamp'];_0x45cb=function(){return _0x4c3ba6;};return _0x45cb();}
|
|
132
|
-
|
|
133
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/thread-comment-ui
|
|
134
|
-
|
|
135
|
-
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m.UniverThreadCommentUi={},m.UniverCore,m.UniverThreadComment,m.UniverUi,m.rxjs,m.React,m.UniverDesign,m.UniverDocs,m.UniverDocsUi,m.UniverEngineRender))})(this,function(m,o,b,k,ne,h,_,Me,Oe,Re){"use strict";var ut=Object.defineProperty;var vt=(m,o,b)=>o in m?ut(m,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[o]=b;var L=(m,o,b)=>vt(m,typeof o!="symbol"?o+"":o,b);var De=Object.defineProperty,we=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?we(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);m.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();L(this,"_panelVisible",!1);L(this,"_panelVisible$",new ne.BehaviorSubject(!1));L(this,"_activeCommentId");L(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));L(this,"panelVisible$",this._panelVisible$.asObservable());L(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},m.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],m.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(m.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(m.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};class Ve{constructor(){L(this,"dataSource");L(this,"renderSuggestion");L(this,"trigger","@")}async getMentions(e,t,r){return this.dataSource?this.dataSource.getMentions(e,t,r):[]}}const le=o.createIdentifier("thread-comment.mention-data.service");var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,We=(n,e,t,r)=>{for(var i=r>1?void 0:r?Be(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&ve(e,t,i),i},me=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Fe(n,typeof e!="symbol"?e+"":e,t);m.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:d,...c}=this._config;d&&this._configService.setConfig("menu",d,{merge:!0}),this._configService.setConfig(Le,c)}onStarting(){var e;o.mergeOverrideWithDependencies([[m.ThreadCommentPanelService],[le,{useClass:Ve}]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,F].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(m.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(m.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),m.UniverThreadCommentUIPlugin=We([o.DependentOn(b.UniverThreadCommentPlugin),me(1,o.Inject(o.Injector)),me(2,o.ICommandService),me(3,o.IConfigService)],m.UniverThreadCommentUIPlugin);var fe={exports:{}},re={};/**
|
|
136
|
-
* @license React
|
|
137
|
-
* react-jsx-runtime.production.min.js
|
|
138
|
-
*
|
|
139
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the MIT license found in the
|
|
142
|
-
* LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/var ze=h,Ze=Symbol.for("react.element"),Ge=Symbol.for("react.fragment"),Ke=Object.prototype.hasOwnProperty,Ye=ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function ge(n,e,t){var r,i={},d=null,c=null;t!==void 0&&(d=""+t),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(c=e.ref);for(r in e)Ke.call(e,r)&&!Je.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Ze,type:n,key:d,ref:c,props:i,_owner:Ye.current}}re.Fragment=Ge,re.jsx=ge,re.jsxs=ge,fe.exports=re;var a=fe.exports,N=function(){return N=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},N.apply(this,arguments)},Qe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,d=n.extend,c=Qe(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),g=h.useRef("_".concat($e()));return pe(t,"".concat(r),{defIds:t.defIds,idSuffix:g.current},N({ref:e,className:C},c),d)});function pe(n,e,t,r,i){return h.createElement(n.tag,N(N({key:e},Xe(n,t,i)),r),(qe(n,t).children||[]).map(function(d,c){return pe(d,"".concat(e,"-").concat(n.tag,"-").concat(c),t,void 0,i)}))}function Xe(n,e,t){var r=N({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(d){var c=d[0],C=d[1];typeof C=="string"&&(r[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function qe(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?N(N({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?N(N({},i),{attrs:N(N({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function $e(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:et}))});Ie.displayName="DeleteSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:tt}))});Se.displayName="IncreaseSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:nt}))});xe.displayName="MoreHorizontalSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:rt}))});ye.displayName="ReplyToCommentSingle";var it={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:it}))});be.displayName="ResolvedSingle";var ot={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:ot}))});Te.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},st=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},dt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),_e=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let d=0;return t==null||t.forEach(c=>{d<c.startIndex&&i.push({type:"text",content:e.slice(d,c.startIndex)}),i.push({type:"mention",content:{label:e.slice(c.startIndex,c.endIndex).slice(1,-1),id:c.rangeId}}),d=c.endIndex}),i.push({type:"text",content:e.slice(d,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const d=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:d,properties:{}});break}}}),e+=`
|
|
144
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},lt=n=>({display:n.label,id:`${n.id}`,raw:n}),mt=(n,e,t,r,i)=>{var c,C;const d=(c=n.raw)==null?void 0:c.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[d?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:d}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var x,R;const{comment:t,onSave:r,id:i,onCancel:d,autoFocus:c,unitId:C,subUnitId:g}=n,j=o.useDependency(le),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,f]=h.useState({...t}),[p,S]=h.useState(!1),O=h.useRef(null),T=o.useDependency(Me.DocSelectionManagerService),u=(x=o.useDependency(Re.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:x.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(s){var y;f({...t,text:s,attachments:[]}),(y=O.current)==null||y.inputElement.focus()}}));const W=()=>{var s;I.text&&(r==null||r({...I,text:I.text}),S(!1),f({text:void 0}),(s=O.current)==null||s.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:s=>s.preventDefault(),children:[a.jsx(_.Mentions,{ref:O,autoFocus:c,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?dt(_e(I.text)):"",onChange:s=>{s.target.value||f({...t,text:void 0}),f==null||f({...t,text:Ue(st(s.target.value))})},onFocus:()=>{const s=T.getActiveTextRange();s&&s.collapsed&&(u==null||u.removeAllRanges()),u==null||u.blur(),S(!0)},children:a.jsx(_.Mention,{trigger:j.trigger,data:(s,y)=>j.getMentions(s,C,g).then(U=>U.map(lt)).then(y),displayTransform:(s,y)=>`@${y} `,renderSuggestion:(R=j.renderSuggestion)!=null?R:mt},j.trigger)}),p?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{d==null||d(),S(!1),f({text:void 0}),w.executeCommand(F.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:W,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ct=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:d,onReply:c,resolved:C,isRoot:g,onClose:j,onDeleteComment:w}=n,M=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),f=o.useDependency(o.UserManagerService),p=f.getUser(e.personId),S=k.useObservable(f.currentUser$),O=(S==null?void 0:S.userID)===e.personId,T=e.id===Ee,[Z,u]=h.useState(!1),W=()=>{(w==null?void 0:w(e))!==!1&&(M.executeCommand(g?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),g&&(j==null||j()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>u(!1),onMouseEnter:()=>u(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:p==null?void 0:p.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(p==null?void 0:p.name)||" "}),a.jsxs("div",{children:[T||C?null:Z?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>c(p),children:a.jsx(ye,{})}):null,O&&!T&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>d==null?void 0:d(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:W,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(xe,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>d==null?void 0:d(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:x,attachments:R})=>{d==null||d(!1),M.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:x,attachments:R}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:_e(e.text).map((x,R)=>{switch(x.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",x.content.label," "]},R);default:return x.content}})})]})},Ne=n=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:d=!0,onClick:c,showHighlight:C,onClose:g,getSubUnitName:j,prefix:w,autoFocus:M,onMouseEnter:I,onMouseLeave:f,onAddComment:p,onDeleteComment:S,onResolve:O}=n,T=o.useDependency(b.ThreadCommentModel),[Z,u]=h.useState(!1),[W,x]=h.useState(""),R=h.useMemo(()=>T.commentUpdate$.pipe(ne.debounceTime(16)),[T]);k.useObservable(R);const s=e?T.getCommentWithChildren(t,r,e):null,y=o.useDependency(o.ICommandService),U=o.useDependency(o.UserManagerService),H=s==null?void 0:s.root.resolved,D=k.useObservable(U.currentUser$),Q=h.useRef(null),X=[...s?[s.root]:[{id:Ee,text:{dataStream:`
|
|
145
|
-
\r`},personId:(ae=D==null?void 0:D.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...($=s==null?void 0:s.children)!=null?$:[]],G=h.useRef(null),V=P=>{P.stopPropagation(),H?y.executeCommand(F.id,{unitId:t,subUnitId:r,commentId:e}):y.executeCommand(F.id),y.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!H}),O==null||O(!H)},q=P=>{P.stopPropagation(),y.executeCommand(F.id),!(s!=null&&s.root&&(S==null?void 0:S(s.root))===!1)&&(y.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),g==null||g())};h.useEffect(()=>f==null?void 0:f(),[]);const B=j((ee=s==null?void 0:s.root.subUnitId)!=null?ee:r),oe=d&&!W&&!H,Y=`${i||(s==null?void 0:s.root.ref)||""}${B?" · ":""}${B}`;return a.jsxs("div",{className:at(v.threadComment,{[v.threadCommentActive]:!H&&(C||Z||w==="cell")}),onClick:c,id:`${w}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),u(!0)},onMouseLeave:()=>{f==null||f(),u(!1)},children:[!H&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),s?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:V,className:v.threadCommentIcon,style:{color:H?"rgb(var(--green-500))":""},children:H?a.jsx(be,{}):a.jsx(Te,{})}),(D==null?void 0:D.userID)===s.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:G,children:X.map(P=>a.jsx(ct,{onClose:g,unitId:t,subUnitId:r,item:P,isRoot:P.id===(s==null?void 0:s.root.id),editing:W===P.id,resolved:s==null?void 0:s.root.resolved,onEditingChange:A=>{x(A?P.id:"")},onReply:A=>{A&&requestAnimationFrame(()=>{var l;(l=Q.current)==null||l.reply(Ue([{type:"mention",content:{id:A.userID,label:A.name}}]))})},onAddComment:p,onDeleteComment:S},P.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:Q,unitId:t,subUnitId:r,onSave:async({text:P,attachments:A})=>{const l={text:P,attachments:A,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:D==null?void 0:D.userID,parentId:s==null?void 0:s.root.id,unitId:t,subUnitId:r,threadId:s==null?void 0:s.root.threadId};(p==null?void 0:p(l))!==!1&&(await y.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:l}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:M||!s,onCancel:()=>{s||g==null||g()}},`${M}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},ht=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:d,onResolve:c,sortComments:C,onItemLeave:g,onItemEnter:j,disableAdd:w,tempComment:M,onAddComment:I,onDeleteComment:f,showComments:p}=n,[S,O]=h.useState("all"),[T,Z]=h.useState("all"),u=o.useDependency(o.LocaleService),W=o.useDependency(o.UserManagerService),x=o.useDependency(b.ThreadCommentModel),[R,s]=h.useState(()=>x.getUnit(e)),y=o.useDependency(m.ThreadCommentPanelService),U=k.useObservable(y.activeCommentId$),H=k.useObservable(x.commentUpdate$),D=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),G="panel",V=k.useObservable(W.currentUser$),q=h.useMemo(()=>{var de;const l=S==="all"?R:(de=R.filter(E=>E.subUnitId===Q))!=null?de:[],te=C!=null?C:E=>E,se=l.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(p){const E=new Map;return se.forEach(K=>{E.set(K.id,K)}),[...p,""].map(K=>E.get(K)).filter(Boolean)}else return te(se)},[p,S,R,C,Q]),B=h.useMemo(()=>[...q.filter(l=>!l.resolved),...q.filter(l=>l.resolved)],[q]),oe=h.useMemo(()=>T==="resolved"?B.filter(l=>l.resolved):T==="unsolved"?B.filter(l=>!l.resolved):T==="concern_me"&&V!=null&&V.userID?B.filter(l=>l==null?void 0:l.users.has(V.userID)):B,[B,V==null?void 0:V.userID,T]),Y=M?[M,...oe]:oe,ae=Y.filter(l=>!l.resolved),$=Y.filter(l=>l.resolved),ee=T!=="all"||S!=="all",P=()=>{Z("all"),O("all")};h.useEffect(()=>{e&&s(x.getUnit(e))},[e,x,H]),h.useEffect(()=>{var E;if(!U)return;if(!X.current){X.current=!0;return}const{unitId:l,subUnitId:te,commentId:se}=U,de=`${G}-${l}-${te}-${se}`;(E=document.getElementById(de))==null||E.scrollIntoView({block:"center"})},[U]);const A=l=>a.jsx(Ne,{prefix:G,getSubUnitName:d,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(U==null?void 0:U.commentId)===l.id,showHighlight:(U==null?void 0:U.commentId)===l.id,onClick:()=>{X.current=!1,l.resolved?D.executeCommand(F.id):D.executeCommand(F.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>j==null?void 0:j(l),onMouseLeave:()=>g==null?void 0:g(l),onAddComment:I,onDeleteComment:f,onResolve:te=>c==null?void 0:c(l.id,te)},l.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:l=>O(l),options:[{value:"current",label:u.t("threadCommentUI.filter.sheet.current")},{value:"all",label:u.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:T,onChange:l=>Z(l),options:[{value:"all",label:u.t("threadCommentUI.filter.status.all")},{value:"resolved",label:u.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:u.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:u.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(A),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(A),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?u.t("threadCommentUI.panel.filterEmpty"):u.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:P,type:"link",children:u.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:w,children:[a.jsx(Se,{}),u.t("threadCommentUI.panel.addComment")]})]})]})};m.IThreadCommentMentionDataService=le,m.SetActiveCommentOperation=F,m.THREAD_COMMENT_PANEL=he,m.ThreadCommentPanel=ht,m.ThreadCommentTree=Ne,m.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/docs-thread-comment-ui
|
|
149
|
-
|
|
150
|
-
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverDocsThreadCommentUi={},c.UniverCore,c.UniverEngineRender,c.UniverThreadCommentUi,c.UniverDocs,c.UniverDocsUi,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React))})(this,function(c,o,g,T,M,j,w,C,A,O){"use strict";var Fe=Object.defineProperty;var Le=(c,o,g)=>o in c?Fe(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var Y=(c,o,g)=>Le(c,typeof o!="symbol"?o+"":o,g);const se="DOC_THREAD_COMMENT_UI_PLUGIN",y="default_doc",de="docs-thread-comment-ui.config",ae={};var ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ce(t,r,i),i},Q=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Y(this,"_addingComment$",new A.BehaviorSubject(void 0));Y(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=le([Q(0,C.ISidebarService),Q(1,o.Inject(T.ThreadCommentPanelService))],U);var X={exports:{}},B={};/**
|
|
1
|
+
// @univerjs/thread-comment-ui/index
|
|
2
|
+
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverThreadCommentUi={},c.UniverCore,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React,c.UniverDesign,c.UniverDocs,c.UniverDocsUi,c.UniverEngineRender))})(this,function(c,o,b,k,ne,h,_,Ne,Oe,Me){"use strict";var mt=Object.defineProperty;var ct=(c,o,b)=>o in c?mt(c,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[o]=b;var K=(c,o,b)=>ct(c,typeof o!="symbol"?o+"":o,b);var Re=Object.defineProperty,we=Object.getOwnPropertyDescriptor,De=(r,e,t,n)=>{for(var i=n>1?void 0:n?we(e,t):e,s=r.length-1,l;s>=0;s--)(l=r[s])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&Re(e,t,i),i},me=(r,e)=>(t,n)=>e(t,n,r);c.ThreadCommentPanelService=class extends o.Disposable{constructor(t,n){super();K(this,"_panelVisible",!1);K(this,"_panelVisible$",new ne.BehaviorSubject(!1));K(this,"_activeCommentId");K(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));K(this,"panelVisible$",this._panelVisible$.asObservable());K(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=n,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},c.ThreadCommentPanelService=De([me(0,o.Inject(k.ISidebarService)),me(1,o.IUniverInstanceService)],c.ThreadCommentPanelService);const ce="thread-comment-panel",He="UNIVER_THREAD_COMMENT_UI_PLUGIN",he={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(r){const e=r.get(k.ISidebarService),t=r.get(c.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:ce},width:330}),t.setPanelVisible(!0)),!0}},W={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(r,e){return r.get(c.ThreadCommentPanelService).setActiveComment(e),!0}},Ae="thread-comment-ui.config",Le={};var ue=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,Ve=(r,e,t)=>e in r?ue(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Be=(r,e,t,n)=>{for(var i=n>1?void 0:n?ke(e,t):e,s=r.length-1,l;s>=0;s--)(l=r[s])&&(i=(n?l(e,t,i):l(i))||i);return n&&i&&ue(e,t,i),i},le=(r,e)=>(t,n)=>e(t,n,r),ve=(r,e,t)=>Ve(r,typeof e!="symbol"?e+"":e,t);c.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=Le,t,n,i){super(),this._config=e,this._injector=t,this._commandService=n,this._configService=i;const{menu:s,...l}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(Ae,l)}onStarting(){var e;o.mergeOverrideWithDependencies([[c.ThreadCommentPanelService]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[he,W].forEach(t=>{this._commandService.registerCommand(t)})}},ve(c.UniverThreadCommentUIPlugin,"pluginName",He),ve(c.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),c.UniverThreadCommentUIPlugin=Be([o.DependentOn(b.UniverThreadCommentPlugin),le(1,o.Inject(o.Injector)),le(2,o.ICommandService),le(3,o.IConfigService)],c.UniverThreadCommentUIPlugin);var Ce={exports:{}},re={};/**
|
|
151
3
|
* @license React
|
|
152
4
|
* react-jsx-runtime.production.min.js
|
|
153
5
|
*
|
|
@@ -155,31 +7,12 @@ function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=f
|
|
|
155
7
|
*
|
|
156
8
|
* This source code is licensed under the MIT license found in the
|
|
157
9
|
* LICENSE file in the root directory of this source tree.
|
|
158
|
-
*/var
|
|
159
|
-
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs-pro/thread-comment-datasource
|
|
163
|
-
|
|
164
|
-
function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=function(_0x1085fa,_0x46606a){_0x1085fa=_0x1085fa-0xfe;let _0x2655bd=_0x45cb86[_0x1085fa];return _0x2655bd;},_0x1085(_0x330f90,_0x71315c);}(function(_0x1c3962,_0x38a0e2){const _0xcc7751=_0x1085,_0x25cd31=_0x1c3962();while(!![]){try{const _0x4ef23e=parseInt(_0xcc7751(0x155))/0x1+parseInt(_0xcc7751(0x119))/0x2+parseInt(_0xcc7751(0x193))/0x3*(-parseInt(_0xcc7751(0x15d))/0x4)+-parseInt(_0xcc7751(0x147))/0x5+-parseInt(_0xcc7751(0x16c))/0x6*(-parseInt(_0xcc7751(0x181))/0x7)+parseInt(_0xcc7751(0x18c))/0x8+-parseInt(_0xcc7751(0x157))/0x9;if(_0x4ef23e===_0x38a0e2)break;else _0x25cd31['push'](_0x25cd31['shift']());}catch(_0x1c931a){_0x25cd31['push'](_0x25cd31['shift']());}}}(_0x45cb,0xc73dd),function(_0x223df9,_0x2a32d0){const _0x169cb1=_0x1085;typeof exports==_0x169cb1(0x16e)&&typeof module<'u'?_0x2a32d0(exports,require('@univerjs/core'),require(_0x169cb1(0x13d)),require(_0x169cb1(0x178)),require(_0x169cb1(0x105)),require(_0x169cb1(0x13b)),require(_0x169cb1(0x128)),require(_0x169cb1(0x120))):typeof define=='function'&&define['amd']?define([_0x169cb1(0x106),_0x169cb1(0x188),'@univerjs/thread-comment-ui','@univerjs-pro/collaboration-client',_0x169cb1(0x105),_0x169cb1(0x13b),'rxjs',_0x169cb1(0x120)],_0x2a32d0):(_0x223df9=typeof globalThis<'u'?globalThis:_0x223df9||self,_0x2a32d0(_0x223df9[_0x169cb1(0x143)]={},_0x223df9['UniverCore'],_0x223df9[_0x169cb1(0x187)],_0x223df9[_0x169cb1(0x16d)],_0x223df9[_0x169cb1(0x160)],_0x223df9[_0x169cb1(0x144)],_0x223df9[_0x169cb1(0x128)],_0x223df9[_0x169cb1(0x12b)]));}(this,function(_0x17a296,_0x3d0190,_0x3ed21d,_0x3db026,_0x51384d,_0x5c0884,_0x1b5c0a,_0x49bd93){'use strict';const _0x2d1c5a=_0x1085;const _0x581514='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x5cda73=(_0x209b8d=>(_0x209b8d[_0x209b8d[_0x2d1c5a(0x121)]=0x0]=_0x2d1c5a(0x121),_0x209b8d[_0x209b8d[_0x2d1c5a(0x16f)]=0x1]=_0x2d1c5a(0x16f),_0x209b8d[_0x209b8d[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x209b8d))(_0x5cda73||{}),_0x4aae21=(_0x569621=>(_0x569621[_0x569621[_0x2d1c5a(0x12c)]=0x0]=_0x2d1c5a(0x12c),_0x569621[_0x569621[_0x2d1c5a(0xfe)]=0x1]=_0x2d1c5a(0xfe),_0x569621[_0x569621['Reply']=0x2]=_0x2d1c5a(0x194),_0x569621[_0x569621[_0x2d1c5a(0x18f)]=0x3]=_0x2d1c5a(0x18f),_0x569621[_0x569621['Delete']=0x4]=_0x2d1c5a(0x15f),_0x569621[_0x569621[_0x2d1c5a(0x163)]=0x5]='Solve',_0x569621[_0x569621[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x569621))(_0x4aae21||{});const _0x1d64e1=_0x32d4fa=>_0x3d0190[_0x2d1c5a(0x168)](new Date(+_0x32d4fa))['format'](_0x2d1c5a(0x17a)),_0x41e898=async(_0x1daffb,_0x2ae0d7)=>{const _0x49961f=_0x2d1c5a,_0x4f8c20=_0x1daffb[_0x49961f(0x191)](_0x3d0190[_0x49961f(0x11c)]),_0x50f0c5=_0x1daffb[_0x49961f(0x191)](_0x49bd93[_0x49961f(0x176)]);_0x2ae0d7[_0x49961f(0x11d)](_0x27ee20=>{const _0x12083e=_0x49961f;_0x4f8c20['getUser'](_0x27ee20)&&_0x2ae0d7[_0x12083e(0x124)](_0x27ee20);}),_0x2ae0d7[_0x49961f(0x156)]&&(await _0x50f0c5[_0x49961f(0x191)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2ae0d7]}}))[_0x49961f(0x141)][_0x49961f(0x177)][_0x49961f(0x11d)](_0x1f578d=>{const _0x5d3ae8=_0x49961f;_0x1f578d&&_0x4f8c20[_0x5d3ae8(0x111)](_0x1f578d);});};var _0x2b18e9=Object['defineProperty'],_0xaed435=Object['getOwnPropertyDescriptor'],_0xdbf4ec=(_0x3443bc,_0x3e2fe7,_0x3d4a6c,_0x5e2b31)=>{const _0x5b531d=_0x2d1c5a;for(var _0x15e483=_0x5e2b31>0x1?void 0x0:_0x5e2b31?_0xaed435(_0x3e2fe7,_0x3d4a6c):_0x3e2fe7,_0x229be8=_0x3443bc[_0x5b531d(0x104)]-0x1,_0x29a12f;_0x229be8>=0x0;_0x229be8--)(_0x29a12f=_0x3443bc[_0x229be8])&&(_0x15e483=(_0x5e2b31?_0x29a12f(_0x3e2fe7,_0x3d4a6c,_0x15e483):_0x29a12f(_0x15e483))||_0x15e483);return _0x5e2b31&&_0x15e483&&_0x2b18e9(_0x3e2fe7,_0x3d4a6c,_0x15e483),_0x15e483;},_0x470027=(_0x2a44f3,_0x529c33)=>(_0x166652,_0x92e77d)=>_0x529c33(_0x166652,_0x92e77d,_0x2a44f3);let _0x2c4030=class extends _0x3d0190['Disposable']{constructor(_0x1c592b,_0xef8ea5,_0x4e6c26,_0x22f0c3){const _0x6f6060=_0x2d1c5a;super(),this[_0x6f6060(0x11f)]=_0x1c592b,this[_0x6f6060(0x114)]=_0xef8ea5,this[_0x6f6060(0x151)]=_0x4e6c26,this[_0x6f6060(0x101)]=_0x22f0c3,this['_init'](),this[_0x6f6060(0x127)]();}[_0x2d1c5a(0x127)](){const _0x568e0e=_0x2d1c5a;this[_0x568e0e(0xff)](this['_threadCommentModel'][_0x568e0e(0x16a)][_0x568e0e(0x100)](_0x1b5c0a[_0x568e0e(0x15e)](0x10))['subscribe'](_0x496c60=>{const _0x35946b=new Set();_0x496c60['forEach'](_0x34a6dc=>{const _0xeb10e9=_0x1085;switch(_0x34a6dc[_0xeb10e9(0x117)]){case _0xeb10e9(0x139):{const _0x5d3422=_0x34a6dc[_0xeb10e9(0x17e)][_0xeb10e9(0x162)];_0x35946b[_0xeb10e9(0x139)](_0x5d3422);break;}}}),_0x41e898(this['_injector'],_0x35946b);}));}['_init'](){const _0x32d451=_0x2d1c5a;this[_0x32d451(0xff)](this['_commentService']['commentUpdate$'][_0x32d451(0x167)](async _0x490edc=>{const _0x159d32=_0x32d451;var _0x22400e,_0xc8d55f,_0x22c0dd,_0x4b8c1f;const _0x29d0eb=(_0x22400e=this['_threadCommentModel']['getUnit'](_0x490edc[_0x159d32(0x17d)])['find'](_0x43f4ee=>_0x43f4ee['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x22400e['root'];if(!_0x29d0eb)return;const {unitId:_0x117158,subUnitId:_0x3aafe5}=_0x29d0eb;switch(_0x490edc[_0x159d32(0x130)]&&this[_0x159d32(0x151)]['addUser'](_0x490edc['user']),_0x490edc[_0x159d32(0x117)]){case _0x4aae21[_0x159d32(0xfe)]:break;case _0x4aae21[_0x159d32(0x194)]:{this['_threadCommentModel']['addComment'](_0x117158,_0x3aafe5,{'unitId':_0x117158,'subUnitId':_0x3aafe5,'ref':'','id':_0x490edc['replyId'],'dT':_0x1d64e1(+_0x490edc['createTimestamp']),'threadId':_0x490edc[_0x159d32(0x14f)],'personId':(_0x22c0dd=(_0xc8d55f=_0x490edc[_0x159d32(0x130)])==null?void 0x0:_0xc8d55f[_0x159d32(0x171)])!=null?_0x22c0dd:_0x490edc['userId'],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)]),'parentId':_0x29d0eb['id']});break;}case _0x4aae21[_0x159d32(0x15f)]:{const _0x55b8a5=this[_0x159d32(0x114)][_0x159d32(0x183)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);_0x55b8a5&&_0x55b8a5['parentId']&&this[_0x159d32(0x114)][_0x159d32(0x140)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);break;}case _0x4aae21['Edit']:{this[_0x159d32(0x114)][_0x159d32(0x134)](_0x117158,_0x3aafe5,{'commentId':_0x490edc[_0x159d32(0x14e)],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)])});break;}case _0x4aae21[_0x159d32(0x163)]:{const _0x99e61a=(_0x4b8c1f=this[_0x159d32(0x114)][_0x159d32(0x174)](_0x490edc['unitId'])[_0x159d32(0x154)](_0x232300=>_0x232300['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x4b8c1f[_0x159d32(0x185)];_0x99e61a&&this[_0x159d32(0x114)]['resolveComment'](_0x117158,_0x3aafe5,_0x99e61a['id'],_0x490edc[_0x159d32(0x166)]===_0x5cda73[_0x159d32(0x16f)]);break;}}}));}};_0x2c4030=_0xdbf4ec([_0x470027(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x16b)])),_0x470027(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x5c0884['ThreadCommentModel'])),_0x470027(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x470027(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190['Injector']))],_0x2c4030);const _0x168b3a=_0x2d1c5a(0x12d),_0x5c96e1={};var _0x3f3071=Object[_0x2d1c5a(0x18e)],_0x4e1f86=Object['getOwnPropertyDescriptor'],_0x34829b=(_0x4ac3ab,_0x20f67f,_0x137e72,_0x56aa0f)=>{for(var _0x42b400=_0x56aa0f>0x1?void 0x0:_0x56aa0f?_0x4e1f86(_0x20f67f,_0x137e72):_0x20f67f,_0x382a88=_0x4ac3ab['length']-0x1,_0x583b56;_0x382a88>=0x0;_0x382a88--)(_0x583b56=_0x4ac3ab[_0x382a88])&&(_0x42b400=(_0x56aa0f?_0x583b56(_0x20f67f,_0x137e72,_0x42b400):_0x583b56(_0x42b400))||_0x42b400);return _0x56aa0f&&_0x42b400&&_0x3f3071(_0x20f67f,_0x137e72,_0x42b400),_0x42b400;},_0x5b385f=(_0x3179ab,_0x2379b8)=>(_0x4ad694,_0x3d031b)=>_0x2379b8(_0x4ad694,_0x3d031b,_0x3179ab);function _0x287c05(_0x334b3e,_0x1c3ac9){const _0x1da2de=_0x2d1c5a,_0x316913=_0x334b3e[_0x1da2de(0x116)][0x0];return{..._0x1c3ac9,'id':_0x316913[_0x1da2de(0x14e)],'resolved':_0x334b3e[_0x1da2de(0x166)]===0x1,'dT':_0x1d64e1(_0x316913[_0x1da2de(0x123)]),'personId':_0x316913[_0x1da2de(0x12a)],'threadId':_0x316913[_0x1da2de(0x14f)]};}function _0x4513b1(_0x5c5d7f,_0xee5259,_0x1ea201){const _0x1aa179=_0x2d1c5a;var _0x30e012,_0x4a60c9;if(((_0x4a60c9=(_0x30e012=_0x5c5d7f==null?void 0x0:_0x5c5d7f['replies'])==null?void 0x0:_0x30e012[_0x1aa179(0x104)])!=null?_0x4a60c9:0x0)>0x0){const _0x33a106=(_0x413bee,_0x1ef023)=>({'id':_0x413bee[_0x1aa179(0x14e)],'threadId':_0x413bee['threadId'],'dT':_0x1d64e1(_0x413bee['createTimestamp']),'personId':_0x413bee['userId'],'resolved':_0x5c5d7f['solved']===_0x5cda73[_0x1aa179(0x16f)],'unitId':_0xee5259,'subUnitId':_0x1ea201,'text':JSON[_0x1aa179(0x164)](_0x413bee['content']),'parentId':_0x1ef023}),_0x2fcf35=_0x33a106(_0x5c5d7f['replies'][0x0]);return{..._0x2fcf35,'children':_0x5c5d7f[_0x1aa179(0x116)]['slice'](0x1)[_0x1aa179(0x17b)](_0x25c910=>_0x33a106(_0x25c910,_0x2fcf35['id']))};}return null;}let _0x4c567b=class{constructor(_0x504ccd,_0x440d1d,_0x13d849,_0x1e6654){const _0x21ba5d=_0x2d1c5a;this[_0x21ba5d(0x109)]=_0x504ccd,this[_0x21ba5d(0x151)]=_0x440d1d,this[_0x21ba5d(0x102)]=_0x13d849,this[_0x21ba5d(0x101)]=_0x1e6654;}async[_0x2d1c5a(0x126)](_0x2d47fd){const _0x30ca48=_0x2d1c5a;var _0x23c2b9,_0x54c2a1;const {parentId:_0x92c8a9,unitId:_0x5cc676,text:_0x3d84cf,threadId:_0x5735b3}=_0x2d47fd,_0x2e07a3=(_0x54c2a1=(_0x23c2b9=_0x3d84cf[_0x30ca48(0x135)])==null?void 0x0:_0x23c2b9['filter'](_0x3766f4=>_0x3766f4[_0x30ca48(0x15b)]===_0x3d0190[_0x30ca48(0x150)][_0x30ca48(0x18b)])[_0x30ca48(0x17b)](_0x3231ef=>_0x3231ef[_0x30ca48(0x122)]))!=null?_0x54c2a1:[],_0x57e106=JSON[_0x30ca48(0x14d)](_0x3d84cf),_0x44db1c=(await this[_0x30ca48(0x102)]['requireSession'](_0x5cc676))[_0x30ca48(0x18a)]();if(_0x92c8a9){const _0x20deb8={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3,'threadId':_0x5735b3},_0x5ed8eb=(await this['_httpService'][_0x30ca48(0x14b)]('/universer-api/comment/unit/'+_0x5cc676+_0x30ca48(0x192),{'body':_0x20deb8}))[_0x30ca48(0x141)][_0x30ca48(0x161)];return{..._0x2d47fd,'id':_0x5ed8eb[_0x30ca48(0x14e)],'dT':_0x3d0190[_0x30ca48(0x168)](+_0x5ed8eb[_0x30ca48(0x123)])['format'](_0x30ca48(0x17a)),'personId':_0x5ed8eb['userId']};}else{const _0x36ed66={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3},_0x2048d0=await this[_0x30ca48(0x109)][_0x30ca48(0x14b)](_0x30ca48(0x10a)+_0x5cc676+_0x30ca48(0x184),{'body':_0x36ed66});return _0x287c05(_0x2048d0[_0x30ca48(0x141)][_0x30ca48(0x17f)],_0x2d47fd);}}async[_0x2d1c5a(0x134)](_0xa03223){const _0x2b9009=_0x2d1c5a;var _0xd70d8b,_0x2971aa;const {text:_0xa9b207,unitId:_0x38e37f}=_0xa03223,_0x2a422d=(_0x2971aa=(_0xd70d8b=_0xa9b207[_0x2b9009(0x135)])==null?void 0x0:_0xd70d8b[_0x2b9009(0x175)](_0x2e447c=>_0x2e447c['rangeType']===_0x3d0190[_0x2b9009(0x150)]['COMMENT'])[_0x2b9009(0x17b)](_0x2a0ee2=>_0x2a0ee2[_0x2b9009(0x122)]))!=null?_0x2971aa:[],_0x27365a=JSON[_0x2b9009(0x14d)](_0xa9b207),_0xa8dbb2=_0xa03223[_0x2b9009(0x14f)],_0x32e73c=_0xa03223['id'],_0x30dbfc={'memberId':(await this[_0x2b9009(0x102)][_0x2b9009(0x11e)](_0x38e37f))['getMemberID'](),'unitId':_0x38e37f,'threadId':_0xa8dbb2,'mention':_0x2a422d,'content':_0x27365a,'replyId':_0x32e73c},_0x335d49=await this[_0x2b9009(0x109)]['post'](_0x2b9009(0x10a)+_0x38e37f+_0x2b9009(0x13f),{'body':_0x30dbfc});return!_0x335d49[_0x2b9009(0x141)][_0x2b9009(0x132)]||_0x335d49['body']['error'][_0x2b9009(0x107)]===0x1;}async[_0x2d1c5a(0x13e)](_0x25130f){const _0x3f746e=_0x2d1c5a,{unitId:_0x45df06}=_0x25130f,_0x4b542f=_0x25130f[_0x3f746e(0x14f)],_0x458032={'memberId':this['_userService'][_0x3f746e(0x10b)]()['userID'],'unitId':_0x45df06,'threadId':_0x4b542f,'solved':_0x25130f[_0x3f746e(0x138)]?_0x5cda73[_0x3f746e(0x16f)]:_0x5cda73[_0x3f746e(0x121)]},_0x5d5e33=await this[_0x3f746e(0x109)][_0x3f746e(0x14b)](_0x3f746e(0x10a)+_0x45df06+_0x3f746e(0x186),{'body':_0x458032});return!_0x5d5e33[_0x3f746e(0x141)]['error']||_0x5d5e33[_0x3f746e(0x141)][_0x3f746e(0x132)][_0x3f746e(0x107)]===0x1;}async[_0x2d1c5a(0x140)](_0x4bf704,_0x13e9f4,_0x4a7c8d,_0x3aaf08){const _0x2b2280=_0x2d1c5a,_0x2f3900={'memberId':(await this[_0x2b2280(0x102)][_0x2b2280(0x11e)](_0x4bf704))[_0x2b2280(0x18a)](),'threadId':_0x4a7c8d,'replyId':_0x3aaf08,'unitId':_0x4bf704},_0xc6ccca=await this[_0x2b2280(0x109)][_0x2b2280(0x14b)]('/universer-api/comment/unit/'+_0x4bf704+_0x2b2280(0x172),{'body':_0x2f3900});return!_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]||_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]['code']===0x1;}async['listComments'](_0x4daf68,_0x3df24c,_0x30e3d8){const _0x5d19cd=_0x2d1c5a,_0x76a77c={'unitId':_0x4daf68,'threadId':_0x30e3d8},_0x2dd97e=await this[_0x5d19cd(0x109)]['post'](_0x5d19cd(0x10a)+_0x4daf68+_0x5d19cd(0x179),{'body':_0x76a77c}),_0x3e6e53=_0x30e3d8[_0x5d19cd(0x17b)](_0x3a0879=>_0x4513b1(_0x2dd97e['body']['comments'][_0x3a0879],_0x4daf68,_0x3df24c))['filter'](Boolean);return Object[_0x5d19cd(0x112)](_0x2dd97e[_0x5d19cd(0x141)][_0x5d19cd(0x177)])[_0x5d19cd(0x11d)](_0x4e7ff0=>{const _0x434fbd=_0x5d19cd;this['_userService'][_0x434fbd(0x111)](_0x4e7ff0);}),_0x3e6e53;}['saveCommentToSnapshot'](_0x2a7527){const _0x25447e=_0x2d1c5a;return{'id':_0x2a7527['id'],'threadId':_0x2a7527[_0x25447e(0x14f)],'ref':_0x2a7527[_0x25447e(0x11b)]};}};_0x4c567b=_0x34829b([_0x5b385f(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93['HTTPService'])),_0x5b385f(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x5b385f(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x10c)])),_0x5b385f(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)]))],_0x4c567b);var _0x570b55=Object[_0x2d1c5a(0x18e)],_0x4c869a=Object[_0x2d1c5a(0x145)],_0x2bb772=(_0x5d19b3,_0x75698f,_0x41601e,_0x4776a3)=>{const _0x42d174=_0x2d1c5a;for(var _0x5d00a1=_0x4776a3>0x1?void 0x0:_0x4776a3?_0x4c869a(_0x75698f,_0x41601e):_0x75698f,_0x372fde=_0x5d19b3[_0x42d174(0x104)]-0x1,_0x2d1d7c;_0x372fde>=0x0;_0x372fde--)(_0x2d1d7c=_0x5d19b3[_0x372fde])&&(_0x5d00a1=(_0x4776a3?_0x2d1d7c(_0x75698f,_0x41601e,_0x5d00a1):_0x2d1d7c(_0x5d00a1))||_0x5d00a1);return _0x4776a3&&_0x5d00a1&&_0x570b55(_0x75698f,_0x41601e,_0x5d00a1),_0x5d00a1;},_0x49a366=(_0x4fbd56,_0x28563b)=>(_0x62fef0,_0x2e0de7)=>_0x28563b(_0x62fef0,_0x2e0de7,_0x4fbd56);let _0x6c0c22=class{constructor(_0x8dc74c){const _0x9e5a88=_0x2d1c5a;this[_0x9e5a88(0x109)]=_0x8dc74c;}async[_0x2d1c5a(0x12e)](_0x44bee6,_0x20771b,_0x304520){const _0x58ba96=_0x2d1c5a,_0x5c5129=new URL(window[_0x58ba96(0x18d)][_0x58ba96(0x173)])['searchParams'][_0x58ba96(0x191)](_0x58ba96(0x110));if(!_0x5c5129)return[];const _0x45b2ad=window['location'][_0x58ba96(0x148)],_0x371842=window[_0x58ba96(0x18d)][_0x58ba96(0x158)]===_0x58ba96(0x12f)?_0x58ba96(0x165):_0x58ba96(0x13a);return(await this[_0x58ba96(0x109)][_0x58ba96(0x191)](_0x371842+_0x58ba96(0x149)+_0x45b2ad+_0x58ba96(0x103),{'params':{'objectID':_0x5c5129,'unitID':_0x5c5129}}))[_0x58ba96(0x141)][_0x58ba96(0x108)]['map'](_0x2a842b=>{const _0x1b1849=_0x58ba96;var _0x1e4d30,_0xf43929,_0x5015c8,_0x1c8f43,_0x561c23,_0x131e08;return{'id':(_0xf43929=(_0x1e4d30=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x1e4d30[_0x1b1849(0x171)])!=null?_0xf43929:'','label':(_0x1c8f43=(_0x5015c8=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x5015c8[_0x1b1849(0x15c)])!=null?_0x1c8f43:'','icon':(_0x131e08=(_0x561c23=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x561c23[_0x1b1849(0x133)])!=null?_0x131e08:'','type':_0x1b1849(0x130)};});}};_0x6c0c22=_0x2bb772([_0x49a366(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93[_0x2d1c5a(0x176)]))],_0x6c0c22);var _0x37496f=Object[_0x2d1c5a(0x18e)],_0x2a227c=Object[_0x2d1c5a(0x145)],_0x4d0464=(_0xd2a913,_0x87dbce,_0x5883ab,_0x51ad35)=>{for(var _0x14a9f4=_0x51ad35>0x1?void 0x0:_0x51ad35?_0x2a227c(_0x87dbce,_0x5883ab):_0x87dbce,_0x44abcb=_0xd2a913['length']-0x1,_0x5f82e1;_0x44abcb>=0x0;_0x44abcb--)(_0x5f82e1=_0xd2a913[_0x44abcb])&&(_0x14a9f4=(_0x51ad35?_0x5f82e1(_0x87dbce,_0x5883ab,_0x14a9f4):_0x5f82e1(_0x14a9f4))||_0x14a9f4);return _0x51ad35&&_0x14a9f4&&_0x37496f(_0x87dbce,_0x5883ab,_0x14a9f4),_0x14a9f4;},_0x434cce=(_0x1e9d3e,_0x140f0b)=>(_0x18600b,_0x5bb0a4)=>_0x140f0b(_0x18600b,_0x5bb0a4,_0x1e9d3e);let _0x3d1a79=class extends _0x3d0190[_0x2d1c5a(0x125)]{constructor(_0x3b6ddb,_0x357b76,_0x337cf9,_0x481722){const _0x165423=_0x2d1c5a;super(),this[_0x165423(0x142)]=_0x3b6ddb,this[_0x165423(0x17c)]=_0x357b76,this[_0x165423(0x136)]=_0x337cf9,this[_0x165423(0x146)]=_0x481722,this[_0x165423(0x190)]();}[_0x2d1c5a(0x190)](){const _0x38ca74=_0x2d1c5a;this[_0x38ca74(0x142)][_0x38ca74(0x15a)]=this[_0x38ca74(0x17c)],this[_0x38ca74(0x142)][_0x38ca74(0x152)]=!0x1,this[_0x38ca74(0x136)]['dataSource']=this[_0x38ca74(0x146)];}};_0x3d1a79=_0x4d0464([_0x434cce(0x0,_0x5c0884['IThreadCommentDataSourceService']),_0x434cce(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x4c567b)),_0x434cce(0x2,_0x3ed21d[_0x2d1c5a(0x14c)]),_0x434cce(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x6c0c22))],_0x3d1a79);var _0x25b1bc=Object[_0x2d1c5a(0x18e)],_0x271190=Object[_0x2d1c5a(0x145)],_0x51ac44=(_0x241833,_0x23df0b,_0x468956)=>_0x23df0b in _0x241833?_0x25b1bc(_0x241833,_0x23df0b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x468956}):_0x241833[_0x23df0b]=_0x468956,_0x222d11=(_0x2385c4,_0x1ead91,_0x5319db,_0x2527a7)=>{const _0x478081=_0x2d1c5a;for(var _0x55b4d9=_0x2527a7>0x1?void 0x0:_0x2527a7?_0x271190(_0x1ead91,_0x5319db):_0x1ead91,_0x5b3d36=_0x2385c4[_0x478081(0x104)]-0x1,_0x196bb6;_0x5b3d36>=0x0;_0x5b3d36--)(_0x196bb6=_0x2385c4[_0x5b3d36])&&(_0x55b4d9=(_0x2527a7?_0x196bb6(_0x1ead91,_0x5319db,_0x55b4d9):_0x196bb6(_0x55b4d9))||_0x55b4d9);return _0x2527a7&&_0x55b4d9&&_0x25b1bc(_0x1ead91,_0x5319db,_0x55b4d9),_0x55b4d9;},_0x54454a=(_0x412be0,_0x463a27)=>(_0x108220,_0x1cfaae)=>_0x463a27(_0x108220,_0x1cfaae,_0x412be0),_0x3d7f66=(_0x3bb133,_0x545864,_0x5eac52)=>_0x51ac44(_0x3bb133,typeof _0x545864!=_0x2d1c5a(0x11a)?_0x545864+'':_0x545864,_0x5eac52);_0x17a296[_0x2d1c5a(0x159)]=class extends _0x3d0190[_0x2d1c5a(0x10e)]{constructor(_0x54fd89=_0x5c96e1,_0x322218,_0x48bb3f){const _0x37d3fc=_0x2d1c5a;super(),this['_config']=_0x54fd89,this['_injector']=_0x322218,this['_configService']=_0x48bb3f;const {..._0x3fd3f9}=this[_0x37d3fc(0x169)];this[_0x37d3fc(0x170)][_0x37d3fc(0x189)](_0x168b3a,_0x3fd3f9);}[_0x2d1c5a(0x131)](){const _0x2e3fbe=_0x2d1c5a;[[_0x6c0c22],[_0x4c567b],[_0x3d1a79],[_0x2c4030]][_0x2e3fbe(0x11d)](_0x3c3c13=>{const _0x20958e=_0x2e3fbe;this['_injector'][_0x20958e(0x139)](_0x3c3c13);});}[_0x2d1c5a(0x10d)](){const _0x31eae9=_0x2d1c5a;this[_0x31eae9(0x101)]['get'](_0x3d1a79),this[_0x31eae9(0x101)][_0x31eae9(0x191)](_0x2c4030);}},_0x3d7f66(_0x17a296['UniverThreadCommentDataSourcePlugin'],_0x2d1c5a(0x13c),_0x581514),_0x3d7f66(_0x17a296[_0x2d1c5a(0x159)],'type',_0x3d0190[_0x2d1c5a(0x129)][_0x2d1c5a(0x153)]),_0x17a296[_0x2d1c5a(0x159)]=_0x222d11([_0x3d0190['DependentOn'](_0x3ed21d['UniverThreadCommentUIPlugin'],_0x3db026[_0x2d1c5a(0x115)],_0x51384d[_0x2d1c5a(0x118)]),_0x54454a(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)])),_0x54454a(0x2,_0x3d0190['IConfigService'])],_0x17a296[_0x2d1c5a(0x159)]),Object['defineProperty'](_0x17a296,Symbol[_0x2d1c5a(0x14a)],{'value':'Module'});}));function _0x45cb(){const _0x4c3ba6=['delete','Disposable','addComment','_initUserSync','rxjs','UniverInstanceType','userId','UniverNetwork','Unknown','thread-comment-data-source.config','getMentions','https:','user','onStarting','error','avatar','updateComment','customRanges','_threadCommentMentionDataService','UNRECOGNIZED','resolved','add','http','@univerjs/thread-comment','pluginName','@univerjs/thread-comment-ui','resolveComment','/edit','deleteComment','body','_threadCommentDataSourceService','UniverProThreadCommentDatasource','UniverThreadComment','getOwnPropertyDescriptor','_threadCommentMentionDataSource','6846820HIrJlY','host','://','toStringTag','post','IThreadCommentMentionDataService','stringify','replyId','threadId','CustomRangeType','_userService','syncUpdateMutationToColla','UNIVER_UNKNOWN','find','748670RYfhYR','size','14296464KKikiZ','protocol','UniverThreadCommentDataSourcePlugin','dataSource','rangeType','name','580ElmYGS','bufferTime','Delete','UniverProLicense','reply','personId','Solve','parse','https','solved','subscribe','dayjs','_config','commentUpdate$','CommentService','4782FSQpvV','UniverProCollaborationClient','object','Solved','_configService','userID','/delete','href','getUnit','filter','HTTPService','users','@univerjs-pro/collaboration-client','/list','YYYY/MM/DD\x20HH:mm','map','_threadCommentDataSource','unitId','payload','comment','content','13615oBUuuF','Inject','getComment','/add','root','/solved','UniverThreadCommentUi','@univerjs/core','setConfig','getMemberID','COMMENT','7362024zfVyhe','location','defineProperty','Edit','_initDataSource','get','/reply','14718WcxWkQ','Reply','Add','disposeWithMe','pipe','_injector','_sessionService','/universer-api/authz/collaborator','length','@univerjs-pro/license','exports','code','collaborators','_httpService','/universer-api/comment/unit/','getCurrentUser','CollaborationSessionService','onReady','Plugin','Injector','unit','addUser','values','subject','_threadCommentModel','UniverCollaborationClientPlugin','replies','type','UniverLicensePlugin','2532470kOXJCz','symbol','ref','UserManagerService','forEach','requireSession','_commentService','@univerjs/network','OpenOrReOpen','rangeId','createTimestamp'];_0x45cb=function(){return _0x4c3ba6;};return _0x45cb();}
|
|
165
|
-
|
|
166
|
-
// /home/runner/work/univer-presets/univer-presets/packages/preset-docs-thread-comment/node_modules/@univerjs/thread-comment-ui
|
|
167
|
-
|
|
168
|
-
(function(m,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react"),require("@univerjs/design"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/engine-render")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/thread-comment","@univerjs/ui","rxjs","react","@univerjs/design","@univerjs/docs","@univerjs/docs-ui","@univerjs/engine-render"],o):(m=typeof globalThis<"u"?globalThis:m||self,o(m.UniverThreadCommentUi={},m.UniverCore,m.UniverThreadComment,m.UniverUi,m.rxjs,m.React,m.UniverDesign,m.UniverDocs,m.UniverDocsUi,m.UniverEngineRender))})(this,function(m,o,b,k,ne,h,_,Me,Oe,Re){"use strict";var ut=Object.defineProperty;var vt=(m,o,b)=>o in m?ut(m,o,{enumerable:!0,configurable:!0,writable:!0,value:b}):m[o]=b;var L=(m,o,b)=>vt(m,typeof o!="symbol"?o+"":o,b);var De=Object.defineProperty,we=Object.getOwnPropertyDescriptor,He=(n,e,t,r)=>{for(var i=r>1?void 0:r?we(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&De(e,t,i),i},ce=(n,e)=>(t,r)=>e(t,r,n);m.ThreadCommentPanelService=class extends o.Disposable{constructor(t,r){super();L(this,"_panelVisible",!1);L(this,"_panelVisible$",new ne.BehaviorSubject(!1));L(this,"_activeCommentId");L(this,"_activeCommentId$",new ne.BehaviorSubject(void 0));L(this,"panelVisible$",this._panelVisible$.asObservable());L(this,"activeCommentId$",this._activeCommentId$.asObservable());this._sidebarService=t,this._univerInstanceService=r,this._init(),this.disposeWithMe(()=>{this._activeCommentId$.complete(),this._panelVisible$.complete()})}_init(){this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(t=>{t.visible||this.setPanelVisible(!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(o.UniverInstanceType.UNIVER_SHEET).pipe(ne.filter(t=>!t)).subscribe(()=>{this._sidebarService.close()}))}get panelVisible(){return this._panelVisible}get activeCommentId(){return this._activeCommentId}setPanelVisible(t){this._panelVisible=t,this._panelVisible$.next(t)}setActiveComment(t){this._activeCommentId=t,this._activeCommentId$.next(t)}},m.ThreadCommentPanelService=He([ce(0,o.Inject(k.ISidebarService)),ce(1,o.IUniverInstanceService)],m.ThreadCommentPanelService);const he="thread-comment-panel",Ae="UNIVER_THREAD_COMMENT_UI_PLUGIN",ue={id:"thread-comment-ui.operation.toggle-panel",type:o.CommandType.OPERATION,handler(n){const e=n.get(k.ISidebarService),t=n.get(m.ThreadCommentPanelService);return t.panelVisible?(e.close(),t.setPanelVisible(!1)):(e.open({header:{title:"threadCommentUI.panel.title"},children:{label:he},width:330}),t.setPanelVisible(!0)),!0}},F={id:"thread-comment-ui.operation.set-active-comment",type:o.CommandType.OPERATION,handler(n,e){return n.get(m.ThreadCommentPanelService).setActiveComment(e),!0}},Le="thread-comment-ui.config",ke={};class Ve{constructor(){L(this,"dataSource");L(this,"renderSuggestion");L(this,"trigger","@")}async getMentions(e,t,r){return this.dataSource?this.dataSource.getMentions(e,t,r):[]}}const le=o.createIdentifier("thread-comment.mention-data.service");var ve=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(n,e,t)=>e in n?ve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,We=(n,e,t,r)=>{for(var i=r>1?void 0:r?Be(e,t):e,d=n.length-1,c;d>=0;d--)(c=n[d])&&(i=(r?c(e,t,i):c(i))||i);return r&&i&&ve(e,t,i),i},me=(n,e)=>(t,r)=>e(t,r,n),Ce=(n,e,t)=>Fe(n,typeof e!="symbol"?e+"":e,t);m.UniverThreadCommentUIPlugin=class extends o.Plugin{constructor(e=ke,t,r,i){super(),this._config=e,this._injector=t,this._commandService=r,this._configService=i;const{menu:d,...c}=this._config;d&&this._configService.setConfig("menu",d,{merge:!0}),this._configService.setConfig(Le,c)}onStarting(){var e;o.mergeOverrideWithDependencies([[m.ThreadCommentPanelService],[le,{useClass:Ve}]],(e=this._config)==null?void 0:e.overrides).forEach(t=>{this._injector.add(t)}),[ue,F].forEach(t=>{this._commandService.registerCommand(t)})}},Ce(m.UniverThreadCommentUIPlugin,"pluginName",Ae),Ce(m.UniverThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_UNKNOWN),m.UniverThreadCommentUIPlugin=We([o.DependentOn(b.UniverThreadCommentPlugin),me(1,o.Inject(o.Injector)),me(2,o.ICommandService),me(3,o.IConfigService)],m.UniverThreadCommentUIPlugin);var fe={exports:{}},re={};/**
|
|
169
|
-
* @license React
|
|
170
|
-
* react-jsx-runtime.production.min.js
|
|
171
|
-
*
|
|
172
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
173
|
-
*
|
|
174
|
-
* This source code is licensed under the MIT license found in the
|
|
175
|
-
* LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/var ze=h,Ze=Symbol.for("react.element"),Ge=Symbol.for("react.fragment"),Ke=Object.prototype.hasOwnProperty,Ye=ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function ge(n,e,t){var r,i={},d=null,c=null;t!==void 0&&(d=""+t),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(c=e.ref);for(r in e)Ke.call(e,r)&&!Je.hasOwnProperty(r)&&(i[r]=e[r]);if(n&&n.defaultProps)for(r in e=n.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:Ze,type:n,key:d,ref:c,props:i,_owner:Ye.current}}re.Fragment=Ge,re.jsx=ge,re.jsxs=ge,fe.exports=re;var a=fe.exports,N=function(){return N=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},N.apply(this,arguments)},Qe=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},z=h.forwardRef(function(n,e){var t=n.icon,r=n.id,i=n.className,d=n.extend,c=Qe(n,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(r," ").concat(i||"").trim(),g=h.useRef("_".concat($e()));return pe(t,"".concat(r),{defIds:t.defIds,idSuffix:g.current},N({ref:e,className:C},c),d)});function pe(n,e,t,r,i){return h.createElement(n.tag,N(N({key:e},Xe(n,t,i)),r),(qe(n,t).children||[]).map(function(d,c){return pe(d,"".concat(e,"-").concat(n.tag,"-").concat(c),t,void 0,i)}))}function Xe(n,e,t){var r=N({},n.attrs);t!=null&&t.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(n.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(d){var c=d[0],C=d[1];typeof C=="string"&&(r[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function qe(n,e){var t,r=e.defIds;return!r||r.length===0?n:n.tag==="defs"&&(!((t=n.children)===null||t===void 0)&&t.length)?N(N({},n),{children:n.children.map(function(i){return typeof i.attrs.id=="string"&&r&&r.indexOf(i.attrs.id)>-1?N(N({},i),{attrs:N(N({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):n}function $e(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ie=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"delete-single",ref:e,icon:et}))});Ie.displayName="DeleteSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Se=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"increase-single",ref:e,icon:tt}))});Se.displayName="IncreaseSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},xe=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"more-horizontal-single",ref:e,icon:nt}))});xe.displayName="MoreHorizontalSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},ye=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"reply-to-comment-single",ref:e,icon:rt}))});ye.displayName="ReplyToCommentSingle";var it={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},be=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"resolved-single",ref:e,icon:it}))});be.displayName="ResolvedSingle";var ot={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},Te=h.forwardRef(function(n,e){return h.createElement(z,Object.assign({},n,{id:"solve-single",ref:e,icon:ot}))});Te.displayName="SolveSingle";function je(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;e<i;e++)n[e]&&(t=je(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function at(){for(var n,e,t=0,r="",i=arguments.length;t<i;t++)(n=arguments[t])&&(e=je(n))&&(r&&(r+=" "),r+=e);return r}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},st=n=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,r=0;const i=[];for(;(t=e.exec(n))!==null;)t.index>r&&i.push({type:"text",content:n.substring(r,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),r=e.lastIndex;return r<n.length&&i.push({type:"text",content:n.substring(r)}),i},dt=n=>n.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),_e=n=>{const{dataStream:e,customRanges:t}=n,r=e.length-2,i=[];let d=0;return t==null||t.forEach(c=>{d<c.startIndex&&i.push({type:"text",content:e.slice(d,c.startIndex)}),i.push({type:"mention",content:{label:e.slice(c.startIndex,c.endIndex).slice(1,-1),id:c.rangeId}}),d=c.endIndex}),i.push({type:"text",content:e.slice(d,r)}),i},Ue=n=>{let e="";const t=[];return n.forEach(r=>{switch(r.type){case"text":e+=r.content;break;case"mention":{const i=e.length;e+=`${r.content.label}`;const d=e.length;t.push({rangeId:r.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:d,properties:{}});break}}}),e+=`
|
|
177
|
-
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},lt=n=>({display:n.label,id:`${n.id}`,raw:n}),mt=(n,e,t,r,i)=>{var c,C;const d=(c=n.raw)==null?void 0:c.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[d?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:d}):null,a.jsx("div",{children:(C=n.display)!=null?C:n.id})]})},Pe=h.forwardRef((n,e)=>{var x,R;const{comment:t,onSave:r,id:i,onCancel:d,autoFocus:c,unitId:C,subUnitId:g}=n,j=o.useDependency(le),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,f]=h.useState({...t}),[p,S]=h.useState(!1),O=h.useRef(null),T=o.useDependency(Me.DocSelectionManagerService),u=(x=o.useDependency(Re.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:x.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(s){var y;f({...t,text:s,attachments:[]}),(y=O.current)==null||y.inputElement.focus()}}));const W=()=>{var s;I.text&&(r==null||r({...I,text:I.text}),S(!1),f({text:void 0}),(s=O.current)==null||s.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:s=>s.preventDefault(),children:[a.jsx(_.Mentions,{ref:O,autoFocus:c,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?dt(_e(I.text)):"",onChange:s=>{s.target.value||f({...t,text:void 0}),f==null||f({...t,text:Ue(st(s.target.value))})},onFocus:()=>{const s=T.getActiveTextRange();s&&s.collapsed&&(u==null||u.removeAllRanges()),u==null||u.blur(),S(!0)},children:a.jsx(_.Mention,{trigger:j.trigger,data:(s,y)=>j.getMentions(s,C,g).then(U=>U.map(lt)).then(y),displayTransform:(s,y)=>`@${y} `,renderSuggestion:(R=j.renderSuggestion)!=null?R:mt},j.trigger)}),p?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{d==null||d(),S(!1),f({text:void 0}),w.executeCommand(F.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:W,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Ee="__mock__",ct=n=>{const{item:e,unitId:t,subUnitId:r,editing:i,onEditingChange:d,onReply:c,resolved:C,isRoot:g,onClose:j,onDeleteComment:w}=n,M=o.useDependency(o.ICommandService),I=o.useDependency(o.LocaleService),f=o.useDependency(o.UserManagerService),p=f.getUser(e.personId),S=k.useObservable(f.currentUser$),O=(S==null?void 0:S.userID)===e.personId,T=e.id===Ee,[Z,u]=h.useState(!1),W=()=>{(w==null?void 0:w(e))!==!1&&(M.executeCommand(g?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:r,commentId:e.id}),g&&(j==null||j()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>u(!1),onMouseEnter:()=>u(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:p==null?void 0:p.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(p==null?void 0:p.name)||" "}),a.jsxs("div",{children:[T||C?null:Z?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>c(p),children:a.jsx(ye,{})}):null,O&&!T&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>d==null?void 0:d(!0),children:I.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:W,children:I.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(xe,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Pe,{id:e.id,comment:e,onCancel:()=>d==null?void 0:d(!1),autoFocus:!0,unitId:t,subUnitId:r,onSave:({text:x,attachments:R})=>{d==null||d(!1),M.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:r,payload:{commentId:e.id,text:x,attachments:R}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:_e(e.text).map((x,R)=>{switch(x.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",x.content.label," "]},R);default:return x.content}})})]})},Ne=n=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:r,refStr:i,showEdit:d=!0,onClick:c,showHighlight:C,onClose:g,getSubUnitName:j,prefix:w,autoFocus:M,onMouseEnter:I,onMouseLeave:f,onAddComment:p,onDeleteComment:S,onResolve:O}=n,T=o.useDependency(b.ThreadCommentModel),[Z,u]=h.useState(!1),[W,x]=h.useState(""),R=h.useMemo(()=>T.commentUpdate$.pipe(ne.debounceTime(16)),[T]);k.useObservable(R);const s=e?T.getCommentWithChildren(t,r,e):null,y=o.useDependency(o.ICommandService),U=o.useDependency(o.UserManagerService),H=s==null?void 0:s.root.resolved,D=k.useObservable(U.currentUser$),Q=h.useRef(null),X=[...s?[s.root]:[{id:Ee,text:{dataStream:`
|
|
178
|
-
\r`},personId:(ae=D==null?void 0:D.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:r,threadId:""}],...($=s==null?void 0:s.children)!=null?$:[]],G=h.useRef(null),V=P=>{P.stopPropagation(),H?y.executeCommand(F.id,{unitId:t,subUnitId:r,commentId:e}):y.executeCommand(F.id),y.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:r,commentId:e,resolved:!H}),O==null||O(!H)},q=P=>{P.stopPropagation(),y.executeCommand(F.id),!(s!=null&&s.root&&(S==null?void 0:S(s.root))===!1)&&(y.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:r,commentId:e}),g==null||g())};h.useEffect(()=>f==null?void 0:f(),[]);const B=j((ee=s==null?void 0:s.root.subUnitId)!=null?ee:r),oe=d&&!W&&!H,Y=`${i||(s==null?void 0:s.root.ref)||""}${B?" · ":""}${B}`;return a.jsxs("div",{className:at(v.threadComment,{[v.threadCommentActive]:!H&&(C||Z||w==="cell")}),onClick:c,id:`${w}-${t}-${r}-${e}`,onMouseEnter:()=>{I==null||I(),u(!0)},onMouseLeave:()=>{f==null||f(),u(!1)},children:[!H&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),s?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:V,className:v.threadCommentIcon,style:{color:H?"rgb(var(--green-500))":""},children:H?a.jsx(be,{}):a.jsx(Te,{})}),(D==null?void 0:D.userID)===s.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(Ie,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:G,children:X.map(P=>a.jsx(ct,{onClose:g,unitId:t,subUnitId:r,item:P,isRoot:P.id===(s==null?void 0:s.root.id),editing:W===P.id,resolved:s==null?void 0:s.root.resolved,onEditingChange:A=>{x(A?P.id:"")},onReply:A=>{A&&requestAnimationFrame(()=>{var l;(l=Q.current)==null||l.reply(Ue([{type:"mention",content:{id:A.userID,label:A.name}}]))})},onAddComment:p,onDeleteComment:S},P.id))}),oe?a.jsx("div",{children:a.jsx(Pe,{ref:Q,unitId:t,subUnitId:r,onSave:async({text:P,attachments:A})=>{const l={text:P,attachments:A,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:D==null?void 0:D.userID,parentId:s==null?void 0:s.root.id,unitId:t,subUnitId:r,threadId:s==null?void 0:s.root.threadId};(p==null?void 0:p(l))!==!1&&(await y.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:r,comment:l}),G.current&&(G.current.scrollTop=G.current.scrollHeight))},autoFocus:M||!s,onCancel:()=>{s||g==null||g()}},`${M}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},ht=n=>{const{unitId:e,subUnitId$:t,type:r,onAdd:i,getSubUnitName:d,onResolve:c,sortComments:C,onItemLeave:g,onItemEnter:j,disableAdd:w,tempComment:M,onAddComment:I,onDeleteComment:f,showComments:p}=n,[S,O]=h.useState("all"),[T,Z]=h.useState("all"),u=o.useDependency(o.LocaleService),W=o.useDependency(o.UserManagerService),x=o.useDependency(b.ThreadCommentModel),[R,s]=h.useState(()=>x.getUnit(e)),y=o.useDependency(m.ThreadCommentPanelService),U=k.useObservable(y.activeCommentId$),H=k.useObservable(x.commentUpdate$),D=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),G="panel",V=k.useObservable(W.currentUser$),q=h.useMemo(()=>{var de;const l=S==="all"?R:(de=R.filter(E=>E.subUnitId===Q))!=null?de:[],te=C!=null?C:E=>E,se=l.map(E=>{var K;return{...E.root,children:(K=E.children)!=null?K:[],users:E.relativeUsers}});if(p){const E=new Map;return se.forEach(K=>{E.set(K.id,K)}),[...p,""].map(K=>E.get(K)).filter(Boolean)}else return te(se)},[p,S,R,C,Q]),B=h.useMemo(()=>[...q.filter(l=>!l.resolved),...q.filter(l=>l.resolved)],[q]),oe=h.useMemo(()=>T==="resolved"?B.filter(l=>l.resolved):T==="unsolved"?B.filter(l=>!l.resolved):T==="concern_me"&&V!=null&&V.userID?B.filter(l=>l==null?void 0:l.users.has(V.userID)):B,[B,V==null?void 0:V.userID,T]),Y=M?[M,...oe]:oe,ae=Y.filter(l=>!l.resolved),$=Y.filter(l=>l.resolved),ee=T!=="all"||S!=="all",P=()=>{Z("all"),O("all")};h.useEffect(()=>{e&&s(x.getUnit(e))},[e,x,H]),h.useEffect(()=>{var E;if(!U)return;if(!X.current){X.current=!0;return}const{unitId:l,subUnitId:te,commentId:se}=U,de=`${G}-${l}-${te}-${se}`;(E=document.getElementById(de))==null||E.scrollIntoView({block:"center"})},[U]);const A=l=>a.jsx(Ne,{prefix:G,getSubUnitName:d,id:l.id,unitId:l.unitId,subUnitId:l.subUnitId,refStr:l.ref,type:r,showEdit:(U==null?void 0:U.commentId)===l.id,showHighlight:(U==null?void 0:U.commentId)===l.id,onClick:()=>{X.current=!1,l.resolved?D.executeCommand(F.id):D.executeCommand(F.id,{unitId:l.unitId,subUnitId:l.subUnitId,commentId:l.id,temp:!1})},onMouseEnter:()=>j==null?void 0:j(l),onMouseLeave:()=>g==null?void 0:g(l),onAddComment:I,onDeleteComment:f,onResolve:te=>c==null?void 0:c(l.id,te)},l.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[r===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:l=>O(l),options:[{value:"current",label:u.t("threadCommentUI.filter.sheet.current")},{value:"all",label:u.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:T,onChange:l=>Z(l),options:[{value:"all",label:u.t("threadCommentUI.filter.status.all")},{value:"resolved",label:u.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:u.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:u.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(A),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(A),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?u.t("threadCommentUI.panel.filterEmpty"):u.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:P,type:"link",children:u.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:w,children:[a.jsx(Se,{}),u.t("threadCommentUI.panel.addComment")]})]})]})};m.IThreadCommentMentionDataService=le,m.SetActiveCommentOperation=F,m.THREAD_COMMENT_PANEL=he,m.ThreadCommentPanel=ht,m.ThreadCommentTree=Ne,m.ToggleSheetCommentPanelOperation=ue,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
10
|
+
*/var Fe=h,We=Symbol.for("react.element"),ze=Symbol.for("react.fragment"),Ze=Object.prototype.hasOwnProperty,Ge=Fe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0};function fe(r,e,t){var n,i={},s=null,l=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(l=e.ref);for(n in e)Ze.call(e,n)&&!Ke.hasOwnProperty(n)&&(i[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:We,type:r,key:s,ref:l,props:i,_owner:Ge.current}}re.Fragment=ze,re.jsx=fe,re.jsxs=fe,Ce.exports=re;var a=Ce.exports,O=function(){return O=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=e[i])}return r},O.apply(this,arguments)},Ye=function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t},z=h.forwardRef(function(r,e){var t=r.icon,n=r.id,i=r.className,s=r.extend,l=Ye(r,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),p=h.useRef("_".concat(Xe()));return pe(t,"".concat(n),{defIds:t.defIds,idSuffix:p.current},O({ref:e,className:C},l),s)});function pe(r,e,t,n,i){return h.createElement(r.tag,O(O({key:e},Je(r,t,i)),n),(Qe(r,t).children||[]).map(function(s,l){return pe(s,"".concat(e,"-").concat(r.tag,"-").concat(l),t,void 0,i)}))}function Je(r,e,t){var n=O({},r.attrs);t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1);var i=e.defIds;return!i||i.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(s){var l=s[0],C=s[1];typeof C=="string"&&(n[l]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Qe(r,e){var t,n=e.defIds;return!n||n.length===0?r:r.tag==="defs"&&(!((t=r.children)===null||t===void 0)&&t.length)?O(O({},r),{children:r.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?O(O({},i),{attrs:O(O({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):r}function Xe(){return Math.random().toString(36).substring(2,8)}z.displayName="UniverIcon";var qe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ge=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"delete-single",ref:e,icon:qe}))});ge.displayName="DeleteSingle";var $e={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Ie=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"increase-single",ref:e,icon:$e}))});Ie.displayName="IncreaseSingle";var et={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 9C3.55228 9 4 8.55228 4 8 4 7.44772 3.55228 7 3 7 2.44772 7 2 7.44772 2 8 2 8.55228 2.44772 9 3 9zM8 9C8.55228 9 9 8.55228 9 8 9 7.44772 8.55228 7 8 7 7.44772 7 7 7.44772 7 8 7 8.55228 7.44772 9 8 9zM13 9C13.5523 9 14 8.55228 14 8 14 7.44772 13.5523 7 13 7 12.4477 7 12 7.44772 12 8 12 8.55228 12.4477 9 13 9z"}}]},Se=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"more-horizontal-single",ref:e,icon:et}))});Se.displayName="MoreHorizontalSingle";var tt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{stroke:"currentColor",d:"M7.48389 10.3267V12.1905C7.48389 12.7428 7.9316 13.1905 8.48389 13.1905H11.2216L12.2955 14.2644L13.3695 13.1905H14.1593C14.7116 13.1905 15.1593 12.7428 15.1593 12.1905V8.46289C15.1593 7.91061 14.7116 7.46289 14.1593 7.46289H12.2955",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M0.840332 3.73535C0.840332 2.63078 1.73576 1.73535 2.84033 1.73535H10.2955C11.4001 1.73535 12.2955 2.63078 12.2955 3.73535V8.32676C12.2955 9.43132 11.4001 10.3268 10.2955 10.3268H5.6014L4.1695 11.7587L3.05978 10.3268H2.84033C1.73576 10.3268 0.840332 9.43133 0.840332 8.32676V3.73535Z",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.41016 6.1311H6.76813M8.91626 6.1311H9.27424M3.90454 6.1311H4.26252",strokeLinecap:"round",strokeWidth:1.2}}]},xe=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"reply-to-comment-single",ref:e,icon:tt}))});xe.displayName="ReplyToCommentSingle";var nt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6106 15.4036C12.4766 15.4036 15.6106 12.2696 15.6106 8.40356C15.6106 4.53757 12.4766 1.40356 8.6106 1.40356C4.7446 1.40356 1.6106 4.53757 1.6106 8.40356C1.6106 12.2696 4.7446 15.4036 8.6106 15.4036ZM12.3351 6.82773C12.5694 6.59342 12.5694 6.21352 12.3351 5.9792C12.1007 5.74489 11.7208 5.74489 11.4865 5.9792L7.91079 9.55494L6.33506 7.9792C6.10074 7.74489 5.72084 7.74489 5.48653 7.9792C5.25221 8.21352 5.25221 8.59342 5.48653 8.82773L7.48653 10.8277C7.72084 11.062 8.10074 11.062 8.33506 10.8277L12.3351 6.82773Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ye=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"resolved-single",ref:e,icon:nt}))});ye.displayName="ResolvedSingle";var rt={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"circle",attrs:{cx:8.73,cy:8.4,r:6.4,stroke:"currentColor",strokeWidth:1.2}},{tag:"path",attrs:{stroke:"currentColor",d:"M6.02637 8.40356L8.02637 10.4036L12.0264 6.40356",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.2}}]},be=h.forwardRef(function(r,e){return h.createElement(z,Object.assign({},r,{id:"solve-single",ref:e,icon:rt}))});be.displayName="SolveSingle";function Te(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var i=r.length;for(e=0;e<i;e++)r[e]&&(t=Te(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function it(){for(var r,e,t=0,n="",i=arguments.length;t<i;t++)(r=arguments[t])&&(e=Te(r))&&(n&&(n+=" "),n+=e);return n}const ie={threadCommentEditorButtons:"univer-thread-comment-editor-buttons",threadCommentEditorSuggestion:"univer-thread-comment-editor-suggestion",threadCommentEditorSuggestionActive:"univer-thread-comment-editor-suggestionActive",threadCommentEditorSuggestionIcon:"univer-thread-comment-editor-suggestion-icon"},ot=r=>{const e=/@\[(.*?)\]\((.*?)\)|(\w+)/g;let t,n=0;const i=[];for(;(t=e.exec(r))!==null;)t.index>n&&i.push({type:"text",content:r.substring(n,t.index)}),t[1]&&t[2]?i.push({type:"mention",content:{label:t[1],id:t[2]}}):t[3]&&i.push({type:"text",content:t[3]}),n=e.lastIndex;return n<r.length&&i.push({type:"text",content:r.substring(n)}),i},at=r=>r.map(e=>{switch(e.type){case"mention":return`@[${e.content.label}](${e.content.id})`;default:return e.content}}).join(""),je=r=>{const{dataStream:e,customRanges:t}=r,n=e.length-2,i=[];let s=0;return t==null||t.forEach(l=>{s<l.startIndex&&i.push({type:"text",content:e.slice(s,l.startIndex)}),i.push({type:"mention",content:{label:e.slice(l.startIndex,l.endIndex).slice(1,-1),id:l.rangeId}}),s=l.endIndex}),i.push({type:"text",content:e.slice(s,n)}),i},_e=r=>{let e="";const t=[];return r.forEach(n=>{switch(n.type){case"text":e+=n.content;break;case"mention":{const i=e.length;e+=`${n.content.label}`;const s=e.length;t.push({rangeId:n.content.id,rangeType:o.CustomRangeType.MENTION,startIndex:i,endIndex:s,properties:{}});break}}}),e+=`
|
|
11
|
+
\r`,{textRuns:[],paragraphs:[{startIndex:e.length-2,paragraphStyle:{}}],sectionBreaks:[{startIndex:e.length-1}],dataStream:e,customRanges:t}},st=(r,e,t,n,i)=>{var l,C;const s=(l=r.raw)==null?void 0:l.icon;return a.jsxs("div",{className:ie.threadCommentEditorSuggestion,children:[s?a.jsx("img",{className:ie.threadCommentEditorSuggestionIcon,src:s}):null,a.jsx("div",{children:(C=r.display)!=null?C:r.id})]})},Ue=h.forwardRef((r,e)=>{var V;const{comment:t,onSave:n,id:i,onCancel:s,autoFocus:l,unitId:C}=r,p=o.useDependency(o.IMentionIOService),w=o.useDependency(o.ICommandService),M=o.useDependency(o.LocaleService),[I,y]=h.useState({...t}),[U,f]=h.useState(!1),S=h.useRef(null),D=o.useDependency(Ne.DocSelectionManagerService),P=(V=o.useDependency(Me.IRenderManagerService).getCurrentTypeOfRenderer(o.UniverInstanceType.UNIVER_DOC))==null?void 0:V.with(Oe.DocSelectionRenderService);h.useImperativeHandle(e,()=>({reply(u){var x;y({...t,text:u,attachments:[]}),(x=S.current)==null||x.inputElement.focus()}}));const g=()=>{var u;I.text&&(n==null||n({...I,text:I.text}),f(!1),y({text:void 0}),(u=S.current)==null||u.inputElement.blur())};return a.jsxs("div",{className:ie.threadCommentEditor,onClick:u=>u.preventDefault(),children:[a.jsx(_.Mentions,{ref:S,autoFocus:l,style:{width:"100%"},placeholder:M.t("threadCommentUI.editor.placeholder"),value:I!=null&&I.text?at(je(I.text)):"",onChange:u=>{u.target.value||y({...t,text:void 0}),y==null||y({...t,text:_e(ot(u.target.value))})},onFocus:()=>{const u=D.getActiveTextRange();u&&u.collapsed&&(P==null||P.removeAllRanges()),P==null||P.blur(),f(!0)},children:a.jsx(_.Mention,{trigger:"@",data:(u,x)=>p.list({search:u,unitId:C}).then(m=>m.list.map(H=>H.mentions.map(T=>({id:T.objectId,display:T.label,raw:T}))).flat()).then(x),displayTransform:(u,x)=>`@${x} `,renderSuggestion:st},"@")}),U?a.jsxs("div",{className:ie.threadCommentEditorButtons,children:[a.jsx(_.Button,{style:{marginRight:12},onClick:()=>{s==null||s(),f(!1),y({text:void 0}),w.executeCommand(W.id)},children:M.t("threadCommentUI.editor.cancel")}),a.jsx(_.Button,{type:"primary",disabled:!I.text,onClick:g,children:M.t(i?"threadCommentUI.editor.save":"threadCommentUI.editor.reply")})]}):null]})}),v={threadComment:"univer-thread-comment",threadCommentActive:"univer-thread-comment-active",threadCommentContent:"univer-thread-comment-content",threadCommentHighlight:"univer-thread-comment-highlight",threadCommentIconContainer:"univer-thread-comment-icon-container",threadCommentIcon:"univer-thread-comment-icon",threadCommentTitle:"univer-thread-comment-title",threadCommentTitlePosition:"univer-thread-comment-title-position",threadCommentTitleHighlight:"univer-thread-comment-title-highlight",threadCommentTitlePositionText:"univer-thread-comment-title-position-text",threadCommentUsername:"univer-thread-comment-username",threadCommentItem:"univer-thread-comment-item",threadCommentItemHead:"univer-thread-comment-item-head",threadCommentItemTitle:"univer-thread-comment-item-title",threadCommentItemTitlePosition:"univer-thread-comment-item-title-position",threadCommentItemTitleHighlight:"univer-thread-comment-item-title-highlight",threadCommentItemTime:"univer-thread-comment-item-time",threadCommentItemContent:"univer-thread-comment-item-content",threadCommentItemAt:"univer-thread-comment-item-at"},Pe="__mock__",dt=r=>{const{item:e,unitId:t,subUnitId:n,editing:i,onEditingChange:s,onReply:l,resolved:C,isRoot:p,onClose:w,onDeleteComment:M}=r,I=o.useDependency(o.ICommandService),y=o.useDependency(o.LocaleService),U=o.useDependency(o.UserManagerService),f=U.getUser(e.personId),S=k.useObservable(U.currentUser$),D=(S==null?void 0:S.userID)===e.personId,j=e.id===Pe,[P,g]=h.useState(!1),V=()=>{(M==null?void 0:M(e))!==!1&&(I.executeCommand(p?b.DeleteCommentTreeCommand.id:b.DeleteCommentCommand.id,{unitId:t,subUnitId:n,commentId:e.id}),p&&(w==null||w()))};return a.jsxs("div",{className:v.threadCommentItem,onMouseLeave:()=>g(!1),onMouseEnter:()=>g(!0),children:[a.jsx("img",{className:v.threadCommentItemHead,src:f==null?void 0:f.avatar}),a.jsxs("div",{className:v.threadCommentItemTitle,children:[a.jsx("div",{className:v.threadCommentUsername,children:(f==null?void 0:f.name)||" "}),a.jsxs("div",{children:[j||C?null:P?a.jsx("div",{className:v.threadCommentIcon,onClick:()=>l(f),children:a.jsx(xe,{})}):null,D&&!j&&!C?a.jsx(_.Dropdown,{overlay:a.jsxs(_.Menu,{children:[a.jsx(_.MenuItem,{onClick:()=>s==null?void 0:s(!0),children:y.t("threadCommentUI.item.edit")},"edit"),a.jsx(_.MenuItem,{onClick:V,children:y.t("threadCommentUI.item.delete")},"delete")]}),children:a.jsx("div",{className:v.threadCommentIcon,children:a.jsx(Se,{})})}):null]})]}),a.jsx("div",{className:v.threadCommentItemTime,children:e.dT}),i?a.jsx(Ue,{id:e.id,comment:e,onCancel:()=>s==null?void 0:s(!1),autoFocus:!0,unitId:t,subUnitId:n,onSave:({text:u,attachments:x})=>{s==null||s(!1),I.executeCommand(b.UpdateCommentCommand.id,{unitId:t,subUnitId:n,payload:{commentId:e.id,text:u,attachments:x}})}}):a.jsx("div",{className:v.threadCommentItemContent,children:je(e.text).map((u,x)=>{switch(u.type){case"mention":return a.jsxs("a",{className:v.threadCommentItemAt,children:["@",u.content.label," "]},x);default:return u.content}})})]})},Ee=r=>{var ae,$,ee;const{id:e,unitId:t,subUnitId:n,refStr:i,showEdit:s=!0,onClick:l,showHighlight:C,onClose:p,getSubUnitName:w,prefix:M,autoFocus:I,onMouseEnter:y,onMouseLeave:U,onAddComment:f,onDeleteComment:S,onResolve:D}=r,j=o.useDependency(b.ThreadCommentModel),[P,g]=h.useState(!1),[V,u]=h.useState(""),x=h.useMemo(()=>j.commentUpdate$.pipe(ne.debounceTime(16)),[j]);k.useObservable(x);const m=e?j.getCommentWithChildren(t,n,e):null,H=o.useDependency(o.ICommandService),T=o.useDependency(o.UserManagerService),A=m==null?void 0:m.root.resolved,R=k.useObservable(T.currentUser$),Q=h.useRef(null),X=[...m?[m.root]:[{id:Pe,text:{dataStream:`
|
|
12
|
+
\r`},personId:(ae=R==null?void 0:R.userID)!=null?ae:"",ref:i!=null?i:"",dT:"",unitId:t,subUnitId:n,threadId:""}],...($=m==null?void 0:m.children)!=null?$:[]],Z=h.useRef(null),B=E=>{E.stopPropagation(),A?H.executeCommand(W.id,{unitId:t,subUnitId:n,commentId:e}):H.executeCommand(W.id),H.executeCommand(b.ResolveCommentCommand.id,{unitId:t,subUnitId:n,commentId:e,resolved:!A}),D==null||D(!A)},q=E=>{E.stopPropagation(),H.executeCommand(W.id),!(m!=null&&m.root&&(S==null?void 0:S(m.root))===!1)&&(H.executeCommand(b.DeleteCommentTreeCommand.id,{unitId:t,subUnitId:n,commentId:e}),p==null||p())};h.useEffect(()=>U==null?void 0:U(),[]);const F=w((ee=m==null?void 0:m.root.subUnitId)!=null?ee:n),oe=s&&!V&&!A,Y=`${i||(m==null?void 0:m.root.ref)||""}${F?" · ":""}${F}`;return a.jsxs("div",{className:it(v.threadComment,{[v.threadCommentActive]:!A&&(C||P||M==="cell")}),onClick:l,id:`${M}-${t}-${n}-${e}`,onMouseEnter:()=>{y==null||y(),g(!0)},onMouseLeave:()=>{U==null||U(),g(!1)},children:[!A&&C?a.jsx("div",{className:v.threadCommentHighlight}):null,a.jsxs("div",{className:v.threadCommentTitle,children:[a.jsxs("div",{className:v.threadCommentTitlePosition,children:[a.jsx("div",{className:v.threadCommentTitleHighlight}),a.jsx(_.Tooltip,{showIfEllipsis:!0,title:Y,children:a.jsx("div",{className:v.threadCommentTitlePositionText,children:Y})})]}),m?a.jsxs("div",{className:v.threadCommentIconContainer,children:[a.jsx("div",{onClick:B,className:v.threadCommentIcon,style:{color:A?"rgb(var(--green-500))":""},children:A?a.jsx(ye,{}):a.jsx(be,{})}),(R==null?void 0:R.userID)===m.root.personId?a.jsx("div",{className:v.threadCommentIcon,onClick:q,children:a.jsx(ge,{})}):null]}):null]}),a.jsx("div",{className:v.threadCommentContent,ref:Z,children:X.map(E=>a.jsx(dt,{onClose:p,unitId:t,subUnitId:n,item:E,isRoot:E.id===(m==null?void 0:m.root.id),editing:V===E.id,resolved:m==null?void 0:m.root.resolved,onEditingChange:L=>{u(L?E.id:"")},onReply:L=>{L&&requestAnimationFrame(()=>{var d;(d=Q.current)==null||d.reply(_e([{type:"mention",content:{id:L.userID,label:L.name}}]))})},onAddComment:f,onDeleteComment:S},E.id))}),oe?a.jsx("div",{children:a.jsx(Ue,{ref:Q,unitId:t,subUnitId:n,onSave:async({text:E,attachments:L})=>{const d={text:E,attachments:L,dT:b.getDT(),id:o.generateRandomId(),ref:i,personId:R==null?void 0:R.userID,parentId:m==null?void 0:m.root.id,unitId:t,subUnitId:n,threadId:m==null?void 0:m.root.threadId};(f==null?void 0:f(d))!==!1&&(await H.executeCommand(b.AddCommentCommand.id,{unitId:t,subUnitId:n,comment:d}),Z.current&&(Z.current.scrollTop=Z.current.scrollHeight))},autoFocus:I||!m,onCancel:()=>{m||p==null||p()}},`${I}`)}):null]})},J={threadCommentPanel:"univer-thread-comment-panel",threadComment:"univer-thread-comment",threadCommentPanelForms:"univer-thread-comment-panel-forms",select:"univer-select",threadCommentPanelEmpty:"univer-thread-comment-panel-empty",threadCommentPanelAdd:"univer-thread-comment-panel-add",threadCommentPanelSolved:"univer-thread-comment-panel-solved"},lt=r=>{const{unitId:e,subUnitId$:t,type:n,onAdd:i,getSubUnitName:s,onResolve:l,sortComments:C,onItemLeave:p,onItemEnter:w,disableAdd:M,tempComment:I,onAddComment:y,onDeleteComment:U,showComments:f}=r,[S,D]=h.useState("all"),[j,P]=h.useState("all"),g=o.useDependency(o.LocaleService),V=o.useDependency(o.UserManagerService),u=o.useDependency(b.ThreadCommentModel),[x,m]=h.useState(()=>u.getUnit(e)),H=o.useDependency(c.ThreadCommentPanelService),T=k.useObservable(H.activeCommentId$),A=k.useObservable(u.commentUpdate$),R=o.useDependency(o.ICommandService),Q=k.useObservable(t),X=h.useRef(!0),Z="panel",B=k.useObservable(V.currentUser$),q=h.useMemo(()=>{var de;const d=S==="all"?x:(de=x.filter(N=>N.subUnitId===Q))!=null?de:[],te=C!=null?C:N=>N,se=d.map(N=>{var G;return{...N.root,children:(G=N.children)!=null?G:[],users:N.relativeUsers}});if(f){const N=new Map;return se.forEach(G=>{N.set(G.id,G)}),[...f,""].map(G=>N.get(G)).filter(Boolean)}else return te(se)},[f,S,x,C,Q]),F=h.useMemo(()=>[...q.filter(d=>!d.resolved),...q.filter(d=>d.resolved)],[q]),oe=h.useMemo(()=>j==="resolved"?F.filter(d=>d.resolved):j==="unsolved"?F.filter(d=>!d.resolved):j==="concern_me"&&B!=null&&B.userID?F.filter(d=>d==null?void 0:d.users.has(B.userID)):F,[F,B==null?void 0:B.userID,j]),Y=I?[I,...oe]:oe,ae=Y.filter(d=>!d.resolved),$=Y.filter(d=>d.resolved),ee=j!=="all"||S!=="all",E=()=>{P("all"),D("all")};h.useEffect(()=>{e&&m(u.getUnit(e))},[e,u,A]),h.useEffect(()=>{var N;if(!T)return;if(!X.current){X.current=!0;return}const{unitId:d,subUnitId:te,commentId:se}=T,de=`${Z}-${d}-${te}-${se}`;(N=document.getElementById(de))==null||N.scrollIntoView({block:"center"})},[T]);const L=d=>a.jsx(Ee,{prefix:Z,getSubUnitName:s,id:d.id,unitId:d.unitId,subUnitId:d.subUnitId,refStr:d.ref,type:n,showEdit:(T==null?void 0:T.commentId)===d.id,showHighlight:(T==null?void 0:T.commentId)===d.id,onClick:()=>{X.current=!1,d.resolved?R.executeCommand(W.id):R.executeCommand(W.id,{unitId:d.unitId,subUnitId:d.subUnitId,commentId:d.id,temp:!1})},onMouseEnter:()=>w==null?void 0:w(d),onMouseLeave:()=>p==null?void 0:p(d),onAddComment:y,onDeleteComment:U,onResolve:te=>l==null?void 0:l(d.id,te)},d.id);return a.jsxs("div",{className:J.threadCommentPanel,children:[a.jsxs("div",{className:J.threadCommentPanelForms,children:[n===o.UniverInstanceType.UNIVER_SHEET?a.jsx(_.Select,{borderless:!0,value:S,onChange:d=>D(d),options:[{value:"current",label:g.t("threadCommentUI.filter.sheet.current")},{value:"all",label:g.t("threadCommentUI.filter.sheet.all")}]}):null,a.jsx(_.Select,{borderless:!0,value:j,onChange:d=>P(d),options:[{value:"all",label:g.t("threadCommentUI.filter.status.all")},{value:"resolved",label:g.t("threadCommentUI.filter.status.resolved")},{value:"unsolved",label:g.t("threadCommentUI.filter.status.unsolved")},{value:"concern_me",label:g.t("threadCommentUI.filter.status.concernMe")}]})]}),ae.map(L),$.length?a.jsx("div",{className:J.threadCommentPanelSolved,children:"已解决"}):null,$.map(L),Y.length?null:a.jsxs("div",{className:J.threadCommentPanelEmpty,children:[ee?g.t("threadCommentUI.panel.filterEmpty"):g.t("threadCommentUI.panel.empty"),ee?a.jsx(_.Button,{onClick:E,type:"link",children:g.t("threadCommentUI.panel.reset")}):a.jsxs(_.Button,{id:"thread-comment-add",className:J.threadCommentPanelAdd,type:"primary",onClick:i,disabled:M,children:[a.jsx(Ie,{}),g.t("threadCommentUI.panel.addComment")]})]})]})};c.SetActiveCommentOperation=W,c.THREAD_COMMENT_PANEL=ce,c.ThreadCommentPanel=lt,c.ThreadCommentTree=Ee,c.ToggleSheetCommentPanelOperation=he,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
179
13
|
|
|
180
14
|
|
|
181
|
-
//
|
|
182
|
-
|
|
15
|
+
// @univerjs/docs-thread-comment-ui/index
|
|
183
16
|
(function(c,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-render"),require("@univerjs/thread-comment-ui"),require("@univerjs/docs"),require("@univerjs/docs-ui"),require("@univerjs/thread-comment"),require("@univerjs/ui"),require("rxjs"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-render","@univerjs/thread-comment-ui","@univerjs/docs","@univerjs/docs-ui","@univerjs/thread-comment","@univerjs/ui","rxjs","react"],o):(c=typeof globalThis<"u"?globalThis:c||self,o(c.UniverDocsThreadCommentUi={},c.UniverCore,c.UniverEngineRender,c.UniverThreadCommentUi,c.UniverDocs,c.UniverDocsUi,c.UniverThreadComment,c.UniverUi,c.rxjs,c.React))})(this,function(c,o,g,T,M,j,w,C,A,O){"use strict";var Fe=Object.defineProperty;var Le=(c,o,g)=>o in c?Fe(c,o,{enumerable:!0,configurable:!0,writable:!0,value:g}):c[o]=g;var Y=(c,o,g)=>Le(c,typeof o!="symbol"?o+"":o,g);const se="DOC_THREAD_COMMENT_UI_PLUGIN",y="default_doc",de="docs-thread-comment-ui.config",ae={};var ce=Object.defineProperty,me=Object.getOwnPropertyDescriptor,le=(e,t,r,n)=>{for(var i=n>1?void 0:n?me(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ce(t,r,i),i},Q=(e,t)=>(r,n)=>t(r,n,e);let U=class extends o.Disposable{constructor(t,r){super();Y(this,"_addingComment$",new A.BehaviorSubject(void 0));Y(this,"addingComment$",this._addingComment$.asObservable());this._sidebarService=t,this._threadCommentPanelService=r,this.disposeWithMe(()=>{this._addingComment$.complete()})}get addingComment(){return this._addingComment$.getValue()}startAdd(t){this._addingComment$.next(t)}endAdd(){this._addingComment$.next(void 0)}};U=le([Q(0,C.ISidebarService),Q(1,o.Inject(T.ThreadCommentPanelService))],U);var X={exports:{}},B={};/**
|
|
184
17
|
* @license React
|
|
185
18
|
* react-jsx-runtime.production.min.js
|
|
@@ -192,8 +25,8 @@ function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=f
|
|
|
192
25
|
`},startOffset:m.startOffset,endOffset:m.endOffset,collapsed:!0,threadId:D};return _==null||_.blurEditor(),a.startAdd(E),t.setActiveComment({unitId:S,subUnitId:u,commentId:D}),!0}};var ge=Object.defineProperty,Oe=Object.getOwnPropertyDescriptor,Te=(e,t,r,n)=>{for(var i=n>1?void 0:n?Oe(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ge(t,r,i),i},x=(e,t)=>(r,n)=>t(r,n,e);let F=class extends o.Disposable{constructor(e,t,r,n,i,s){super(),this._threadCommentPanelService=e,this._univerInstanceService=t,this._commandService=r,this._docThreadCommentService=n,this._renderManagerService=i,this._threadCommentModel=s,this._initSelectionChange(),this._initActiveCommandChange()}_initSelectionChange(){let e;this.disposeWithMe(this._commandService.onCommandExecuted(t=>{var r,n,i,s;if(t.id===M.SetTextSelectionsOperation.id){const d=t.params,{unitId:a,ranges:v}=d,h=this._univerInstanceService.getUnit(a,o.UniverInstanceType.UNIVER_DOC),m=v[0];if((e==null?void 0:e.startOffset)===(m==null?void 0:m.startOffset)&&(e==null?void 0:e.endOffset)===(m==null?void 0:m.endOffset))return;if(e=m,m&&h){const{startOffset:_,endOffset:S,collapsed:p}=m;let l;if(p?l=(n=(r=h.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(u=>u.startIndex<=_&&u.endIndex>=S-1):l=(s=(i=h.getBody())==null?void 0:i.customDecorations)==null?void 0:s.find(u=>u.startIndex<=_&&u.endIndex>=S-1),l){const u=this._threadCommentModel.getComment(a,y,l.id);u&&!u.resolved&&this._commandService.executeCommand(N.id,{activeComment:{unitId:a,subUnitId:y,commentId:l.id}});return}}if(!this._threadCommentPanelService.activeCommentId)return;this._commandService.executeCommand(T.SetActiveCommentOperation.id)}}))}_initActiveCommandChange(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var t,r,n,i;if(e){const s=this._univerInstanceService.getUnit(e.unitId);if(s){const d=(t=this._renderManagerService.getRenderById(e.unitId))==null?void 0:t.with(j.DocBackScrollRenderController),a=(n=(r=s.getBody())==null?void 0:r.customDecorations)==null?void 0:n.find(v=>v.id===e.commentId);a&&d&&d.scrollToRange({startOffset:a.startIndex,endOffset:a.endIndex,collapsed:!1})}}(!e||e.commentId!==((i=this._docThreadCommentService.addingComment)==null?void 0:i.id))&&this._docThreadCommentService.endAdd()}))}};F=Te([x(0,o.Inject(T.ThreadCommentPanelService)),x(1,o.IUniverInstanceService),x(2,o.ICommandService),x(3,o.Inject(U)),x(4,g.IRenderManagerService),x(5,o.Inject(w.ThreadCommentModel))],F);var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},Me=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},te=O.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,s=e.extend,d=Me(e,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),v=O.useRef("_".concat(be()));return ne(r,"".concat(n),{defIds:r.defIds,idSuffix:v.current},I({ref:t,className:a},d),s)});function ne(e,t,r,n,i){return O.createElement(e.tag,I(I({key:t},ye(e,r,i)),n),(De(e,r).children||[]).map(function(s,d){return ne(s,"".concat(t,"-").concat(e.tag,"-").concat(d),r,void 0,i)}))}function ye(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(s){var d=s[0],a=s[1];typeof a=="string"&&(n[d]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function De(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function be(){return Math.random().toString(36).substring(2,8)}te.displayName="UniverIcon";var Ue={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},re=O.forwardRef(function(e,t){return O.createElement(te,Object.assign({},e,{id:"comment-single",ref:t,icon:Ue}))});re.displayName="CommentSingle";const Pe={[C.RibbonStartGroup.OTHERS]:{[G.id]:{order:1,menuItemFactory:Se}},[C.ContextMenuPosition.MAIN_AREA]:{[C.ContextMenuGroup.DATA]:{[V.id]:{order:1,menuItemFactory:_e}}}};var xe=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,Ee=(e,t,r,n)=>{for(var i=n>1?void 0:n?Re(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&xe(t,r,i),i},Z=(e,t)=>(r,n)=>t(r,n,e);let L=class extends o.Disposable{constructor(e,t,r){super(),this._commandService=e,this._menuManagerService=t,this._componentManager=r,this._initCommands(),this._initMenus(),this._initComponents()}_initCommands(){[W,K,N,V,G].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenus(){this._menuManagerService.mergeMenu(Pe)}_initComponents(){[P].forEach(e=>{this.disposeWithMe(this._componentManager.register(e.componentKey,e))}),this.disposeWithMe(this._componentManager.register("CommentSingle",re))}};L=Ee([Z(0,o.ICommandService),Z(1,C.IMenuManagerService),Z(2,o.Inject(C.ComponentManager))],L);var je=Object.defineProperty,we=Object.getOwnPropertyDescriptor,Ae=(e,t,r,n)=>{for(var i=n>1?void 0:n?we(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&je(t,r,i),i},R=(e,t)=>(r,n)=>t(r,n,e);let z=class extends o.Disposable{constructor(e,t,r,n,i,s,d){super(),this._context=e,this._docInterceptorService=t,this._threadCommentPanelService=r,this._docRenderController=n,this._univerInstanceService=i,this._threadCommentModel=s,this._commandService=d,this._interceptorViewModel(),this._initReRender(),this._initSyncComments()}_initReRender(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(e=>{var r;if(e){this._docRenderController.reRender(e.unitId);return}const t=(r=this._univerInstanceService.getCurrentUnitForType(o.UniverInstanceType.UNIVER_DOC))==null?void 0:r.getUnitId();t&&this._docRenderController.reRender(t)})),this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{e.type==="resolve"&&this._docRenderController.reRender(e.unitId)}))}_interceptorViewModel(){this._docInterceptorService.intercept(M.DOC_INTERCEPTOR_POINT.CUSTOM_DECORATION,{handler:(e,t,r)=>{if(!e)return r(e);const{unitId:n,index:i,customDecorations:s}=t,d=this._threadCommentPanelService.activeCommentId,{commentId:a,unitId:v}=d||{},h=s.find(p=>p.id===a),m=this._threadCommentModel.getComment(n,y,e.id);if(!m)return r({...e,show:!1});const _=h&&i>=h.startIndex&&i<=h.endIndex,S=v===n&&e.id===a;return r({...e,active:S||_,show:!m.resolved})}})}_initSyncComments(){var i,s,d;const e=this._context.unit.getUnitId(),t=y,r=(d=(s=(i=this._context.unit.getBody())==null?void 0:i.customDecorations)==null?void 0:s.filter(a=>a.type===o.CustomDecorationType.COMMENT).map(a=>a.id))!=null?d:[];r.forEach(a=>{this._threadCommentModel.getComment(e,t,a)||this._threadCommentModel.addComment(e,t,{id:a,threadId:a,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),r.length&&this._threadCommentModel.syncThreadComments(this._context.unit.getUnitId(),y,r);let n=r.sort();this.disposeWithMe(this._commandService.onCommandExecuted(a=>{var v,h,m;if(a.id===M.RichTextEditingMutation.id){if(a.params.unitId!==this._context.unit.getUnitId())return;const S=(m=(h=(v=this._context.unit.getBody())==null?void 0:v.customDecorations)==null?void 0:h.filter(l=>l.type===o.CustomDecorationType.COMMENT).map(l=>l.id))!=null?m:[],p=S.sort();if(JSON.stringify(n)!==JSON.stringify(p)){const l=new Set(n),u=new Set(p),D=new Set,E=new Set;S.forEach(f=>{l.has(f)||D.add(f)}),n.forEach(f=>{u.has(f)||E.add(f)}),n=p,D.forEach(f=>{this._threadCommentModel.getComment(e,t,f)||this._threadCommentModel.addComment(e,t,{id:f,threadId:f,ref:"",dT:"",personId:"",text:{dataStream:""},unitId:e,subUnitId:t})}),this._threadCommentModel.syncThreadComments(e,t,[...D])}}}))}};z=Ae([R(1,o.Inject(M.DocInterceptorService)),R(2,o.Inject(T.ThreadCommentPanelService)),R(3,o.Inject(j.DocRenderController)),R(4,o.IUniverInstanceService),R(5,o.Inject(w.ThreadCommentModel)),R(6,o.ICommandService)],z);var ie=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ve=(e,t,r)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$e=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ne(t,r):t,s=e.length-1,d;s>=0;s--)(d=e[s])&&(i=(n?d(t,r,i):d(i))||i);return n&&i&&ie(t,r,i),i},J=(e,t)=>(r,n)=>t(r,n,e),oe=(e,t,r)=>Ve(e,typeof t!="symbol"?t+"":t,r);c.UniverDocsThreadCommentUIPlugin=class extends o.Plugin{constructor(t=ae,r,n,i){super(),this._config=t,this._injector=r,this._renderManagerSrv=n,this._configService=i;const{menu:s,...d}=this._config;s&&this._configService.setConfig("menu",s,{merge:!0}),this._configService.setConfig(de,d)}onStarting(){[[L],[F],[U]].forEach(t=>{this._injector.add(t)})}onRendered(){this._initRenderModule(),this._injector.get(F),this._injector.get(L)}_initRenderModule(){[z].forEach(t=>{this._renderManagerSrv.registerRenderModule(o.UniverInstanceType.UNIVER_DOC,t)})}},oe(c.UniverDocsThreadCommentUIPlugin,"pluginName",se),oe(c.UniverDocsThreadCommentUIPlugin,"type",o.UniverInstanceType.UNIVER_DOC),c.UniverDocsThreadCommentUIPlugin=$e([o.DependentOn(T.UniverThreadCommentUIPlugin),J(1,o.Inject(o.Injector)),J(2,g.IRenderManagerService),J(3,o.IConfigService)],c.UniverDocsThreadCommentUIPlugin),c.AddDocCommentComment=W,c.DeleteDocCommentComment=K,c.ShowCommentPanelOperation=N,c.StartAddCommentOperation=V,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
193
26
|
|
|
194
27
|
|
|
195
|
-
//
|
|
196
|
-
|
|
197
|
-
function _0x1085(_0x330f90,_0x71315c){const _0x45cb86=_0x45cb();return _0x1085=function(_0x1085fa,_0x46606a){_0x1085fa=_0x1085fa-0xfe;let _0x2655bd=_0x45cb86[_0x1085fa];return _0x2655bd;},_0x1085(_0x330f90,_0x71315c);}(function(_0x1c3962,_0x38a0e2){const _0xcc7751=_0x1085,_0x25cd31=_0x1c3962();while(!![]){try{const _0x4ef23e=parseInt(_0xcc7751(0x155))/0x1+parseInt(_0xcc7751(0x119))/0x2+parseInt(_0xcc7751(0x193))/0x3*(-parseInt(_0xcc7751(0x15d))/0x4)+-parseInt(_0xcc7751(0x147))/0x5+-parseInt(_0xcc7751(0x16c))/0x6*(-parseInt(_0xcc7751(0x181))/0x7)+parseInt(_0xcc7751(0x18c))/0x8+-parseInt(_0xcc7751(0x157))/0x9;if(_0x4ef23e===_0x38a0e2)break;else _0x25cd31['push'](_0x25cd31['shift']());}catch(_0x1c931a){_0x25cd31['push'](_0x25cd31['shift']());}}}(_0x45cb,0xc73dd),function(_0x223df9,_0x2a32d0){const _0x169cb1=_0x1085;typeof exports==_0x169cb1(0x16e)&&typeof module<'u'?_0x2a32d0(exports,require('@univerjs/core'),require(_0x169cb1(0x13d)),require(_0x169cb1(0x178)),require(_0x169cb1(0x105)),require(_0x169cb1(0x13b)),require(_0x169cb1(0x128)),require(_0x169cb1(0x120))):typeof define=='function'&&define['amd']?define([_0x169cb1(0x106),_0x169cb1(0x188),'@univerjs/thread-comment-ui','@univerjs-pro/collaboration-client',_0x169cb1(0x105),_0x169cb1(0x13b),'rxjs',_0x169cb1(0x120)],_0x2a32d0):(_0x223df9=typeof globalThis<'u'?globalThis:_0x223df9||self,_0x2a32d0(_0x223df9[_0x169cb1(0x143)]={},_0x223df9['UniverCore'],_0x223df9[_0x169cb1(0x187)],_0x223df9[_0x169cb1(0x16d)],_0x223df9[_0x169cb1(0x160)],_0x223df9[_0x169cb1(0x144)],_0x223df9[_0x169cb1(0x128)],_0x223df9[_0x169cb1(0x12b)]));}(this,function(_0x17a296,_0x3d0190,_0x3ed21d,_0x3db026,_0x51384d,_0x5c0884,_0x1b5c0a,_0x49bd93){'use strict';const _0x2d1c5a=_0x1085;const _0x581514='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x5cda73=(_0x209b8d=>(_0x209b8d[_0x209b8d[_0x2d1c5a(0x121)]=0x0]=_0x2d1c5a(0x121),_0x209b8d[_0x209b8d[_0x2d1c5a(0x16f)]=0x1]=_0x2d1c5a(0x16f),_0x209b8d[_0x209b8d[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x209b8d))(_0x5cda73||{}),_0x4aae21=(_0x569621=>(_0x569621[_0x569621[_0x2d1c5a(0x12c)]=0x0]=_0x2d1c5a(0x12c),_0x569621[_0x569621[_0x2d1c5a(0xfe)]=0x1]=_0x2d1c5a(0xfe),_0x569621[_0x569621['Reply']=0x2]=_0x2d1c5a(0x194),_0x569621[_0x569621[_0x2d1c5a(0x18f)]=0x3]=_0x2d1c5a(0x18f),_0x569621[_0x569621['Delete']=0x4]=_0x2d1c5a(0x15f),_0x569621[_0x569621[_0x2d1c5a(0x163)]=0x5]='Solve',_0x569621[_0x569621[_0x2d1c5a(0x137)]=-0x1]=_0x2d1c5a(0x137),_0x569621))(_0x4aae21||{});const _0x1d64e1=_0x32d4fa=>_0x3d0190[_0x2d1c5a(0x168)](new Date(+_0x32d4fa))['format'](_0x2d1c5a(0x17a)),_0x41e898=async(_0x1daffb,_0x2ae0d7)=>{const _0x49961f=_0x2d1c5a,_0x4f8c20=_0x1daffb[_0x49961f(0x191)](_0x3d0190[_0x49961f(0x11c)]),_0x50f0c5=_0x1daffb[_0x49961f(0x191)](_0x49bd93[_0x49961f(0x176)]);_0x2ae0d7[_0x49961f(0x11d)](_0x27ee20=>{const _0x12083e=_0x49961f;_0x4f8c20['getUser'](_0x27ee20)&&_0x2ae0d7[_0x12083e(0x124)](_0x27ee20);}),_0x2ae0d7[_0x49961f(0x156)]&&(await _0x50f0c5[_0x49961f(0x191)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2ae0d7]}}))[_0x49961f(0x141)][_0x49961f(0x177)][_0x49961f(0x11d)](_0x1f578d=>{const _0x5d3ae8=_0x49961f;_0x1f578d&&_0x4f8c20[_0x5d3ae8(0x111)](_0x1f578d);});};var _0x2b18e9=Object['defineProperty'],_0xaed435=Object['getOwnPropertyDescriptor'],_0xdbf4ec=(_0x3443bc,_0x3e2fe7,_0x3d4a6c,_0x5e2b31)=>{const _0x5b531d=_0x2d1c5a;for(var _0x15e483=_0x5e2b31>0x1?void 0x0:_0x5e2b31?_0xaed435(_0x3e2fe7,_0x3d4a6c):_0x3e2fe7,_0x229be8=_0x3443bc[_0x5b531d(0x104)]-0x1,_0x29a12f;_0x229be8>=0x0;_0x229be8--)(_0x29a12f=_0x3443bc[_0x229be8])&&(_0x15e483=(_0x5e2b31?_0x29a12f(_0x3e2fe7,_0x3d4a6c,_0x15e483):_0x29a12f(_0x15e483))||_0x15e483);return _0x5e2b31&&_0x15e483&&_0x2b18e9(_0x3e2fe7,_0x3d4a6c,_0x15e483),_0x15e483;},_0x470027=(_0x2a44f3,_0x529c33)=>(_0x166652,_0x92e77d)=>_0x529c33(_0x166652,_0x92e77d,_0x2a44f3);let _0x2c4030=class extends _0x3d0190['Disposable']{constructor(_0x1c592b,_0xef8ea5,_0x4e6c26,_0x22f0c3){const _0x6f6060=_0x2d1c5a;super(),this[_0x6f6060(0x11f)]=_0x1c592b,this[_0x6f6060(0x114)]=_0xef8ea5,this[_0x6f6060(0x151)]=_0x4e6c26,this[_0x6f6060(0x101)]=_0x22f0c3,this['_init'](),this[_0x6f6060(0x127)]();}[_0x2d1c5a(0x127)](){const _0x568e0e=_0x2d1c5a;this[_0x568e0e(0xff)](this['_threadCommentModel'][_0x568e0e(0x16a)][_0x568e0e(0x100)](_0x1b5c0a[_0x568e0e(0x15e)](0x10))['subscribe'](_0x496c60=>{const _0x35946b=new Set();_0x496c60['forEach'](_0x34a6dc=>{const _0xeb10e9=_0x1085;switch(_0x34a6dc[_0xeb10e9(0x117)]){case _0xeb10e9(0x139):{const _0x5d3422=_0x34a6dc[_0xeb10e9(0x17e)][_0xeb10e9(0x162)];_0x35946b[_0xeb10e9(0x139)](_0x5d3422);break;}}}),_0x41e898(this['_injector'],_0x35946b);}));}['_init'](){const _0x32d451=_0x2d1c5a;this[_0x32d451(0xff)](this['_commentService']['commentUpdate$'][_0x32d451(0x167)](async _0x490edc=>{const _0x159d32=_0x32d451;var _0x22400e,_0xc8d55f,_0x22c0dd,_0x4b8c1f;const _0x29d0eb=(_0x22400e=this['_threadCommentModel']['getUnit'](_0x490edc[_0x159d32(0x17d)])['find'](_0x43f4ee=>_0x43f4ee['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x22400e['root'];if(!_0x29d0eb)return;const {unitId:_0x117158,subUnitId:_0x3aafe5}=_0x29d0eb;switch(_0x490edc[_0x159d32(0x130)]&&this[_0x159d32(0x151)]['addUser'](_0x490edc['user']),_0x490edc[_0x159d32(0x117)]){case _0x4aae21[_0x159d32(0xfe)]:break;case _0x4aae21[_0x159d32(0x194)]:{this['_threadCommentModel']['addComment'](_0x117158,_0x3aafe5,{'unitId':_0x117158,'subUnitId':_0x3aafe5,'ref':'','id':_0x490edc['replyId'],'dT':_0x1d64e1(+_0x490edc['createTimestamp']),'threadId':_0x490edc[_0x159d32(0x14f)],'personId':(_0x22c0dd=(_0xc8d55f=_0x490edc[_0x159d32(0x130)])==null?void 0x0:_0xc8d55f[_0x159d32(0x171)])!=null?_0x22c0dd:_0x490edc['userId'],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)]),'parentId':_0x29d0eb['id']});break;}case _0x4aae21[_0x159d32(0x15f)]:{const _0x55b8a5=this[_0x159d32(0x114)][_0x159d32(0x183)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);_0x55b8a5&&_0x55b8a5['parentId']&&this[_0x159d32(0x114)][_0x159d32(0x140)](_0x117158,_0x3aafe5,_0x490edc[_0x159d32(0x14e)]);break;}case _0x4aae21['Edit']:{this[_0x159d32(0x114)][_0x159d32(0x134)](_0x117158,_0x3aafe5,{'commentId':_0x490edc[_0x159d32(0x14e)],'text':JSON[_0x159d32(0x164)](_0x490edc[_0x159d32(0x180)])});break;}case _0x4aae21[_0x159d32(0x163)]:{const _0x99e61a=(_0x4b8c1f=this[_0x159d32(0x114)][_0x159d32(0x174)](_0x490edc['unitId'])[_0x159d32(0x154)](_0x232300=>_0x232300['threadId']===_0x490edc[_0x159d32(0x14f)]))==null?void 0x0:_0x4b8c1f[_0x159d32(0x185)];_0x99e61a&&this[_0x159d32(0x114)]['resolveComment'](_0x117158,_0x3aafe5,_0x99e61a['id'],_0x490edc[_0x159d32(0x166)]===_0x5cda73[_0x159d32(0x16f)]);break;}}}));}};_0x2c4030=_0xdbf4ec([_0x470027(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x16b)])),_0x470027(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x5c0884['ThreadCommentModel'])),_0x470027(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x470027(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190['Injector']))],_0x2c4030);const _0x168b3a=_0x2d1c5a(0x12d),_0x5c96e1={};var _0x3f3071=Object[_0x2d1c5a(0x18e)],_0x4e1f86=Object['getOwnPropertyDescriptor'],_0x34829b=(_0x4ac3ab,_0x20f67f,_0x137e72,_0x56aa0f)=>{for(var _0x42b400=_0x56aa0f>0x1?void 0x0:_0x56aa0f?_0x4e1f86(_0x20f67f,_0x137e72):_0x20f67f,_0x382a88=_0x4ac3ab['length']-0x1,_0x583b56;_0x382a88>=0x0;_0x382a88--)(_0x583b56=_0x4ac3ab[_0x382a88])&&(_0x42b400=(_0x56aa0f?_0x583b56(_0x20f67f,_0x137e72,_0x42b400):_0x583b56(_0x42b400))||_0x42b400);return _0x56aa0f&&_0x42b400&&_0x3f3071(_0x20f67f,_0x137e72,_0x42b400),_0x42b400;},_0x5b385f=(_0x3179ab,_0x2379b8)=>(_0x4ad694,_0x3d031b)=>_0x2379b8(_0x4ad694,_0x3d031b,_0x3179ab);function _0x287c05(_0x334b3e,_0x1c3ac9){const _0x1da2de=_0x2d1c5a,_0x316913=_0x334b3e[_0x1da2de(0x116)][0x0];return{..._0x1c3ac9,'id':_0x316913[_0x1da2de(0x14e)],'resolved':_0x334b3e[_0x1da2de(0x166)]===0x1,'dT':_0x1d64e1(_0x316913[_0x1da2de(0x123)]),'personId':_0x316913[_0x1da2de(0x12a)],'threadId':_0x316913[_0x1da2de(0x14f)]};}function _0x4513b1(_0x5c5d7f,_0xee5259,_0x1ea201){const _0x1aa179=_0x2d1c5a;var _0x30e012,_0x4a60c9;if(((_0x4a60c9=(_0x30e012=_0x5c5d7f==null?void 0x0:_0x5c5d7f['replies'])==null?void 0x0:_0x30e012[_0x1aa179(0x104)])!=null?_0x4a60c9:0x0)>0x0){const _0x33a106=(_0x413bee,_0x1ef023)=>({'id':_0x413bee[_0x1aa179(0x14e)],'threadId':_0x413bee['threadId'],'dT':_0x1d64e1(_0x413bee['createTimestamp']),'personId':_0x413bee['userId'],'resolved':_0x5c5d7f['solved']===_0x5cda73[_0x1aa179(0x16f)],'unitId':_0xee5259,'subUnitId':_0x1ea201,'text':JSON[_0x1aa179(0x164)](_0x413bee['content']),'parentId':_0x1ef023}),_0x2fcf35=_0x33a106(_0x5c5d7f['replies'][0x0]);return{..._0x2fcf35,'children':_0x5c5d7f[_0x1aa179(0x116)]['slice'](0x1)[_0x1aa179(0x17b)](_0x25c910=>_0x33a106(_0x25c910,_0x2fcf35['id']))};}return null;}let _0x4c567b=class{constructor(_0x504ccd,_0x440d1d,_0x13d849,_0x1e6654){const _0x21ba5d=_0x2d1c5a;this[_0x21ba5d(0x109)]=_0x504ccd,this[_0x21ba5d(0x151)]=_0x440d1d,this[_0x21ba5d(0x102)]=_0x13d849,this[_0x21ba5d(0x101)]=_0x1e6654;}async[_0x2d1c5a(0x126)](_0x2d47fd){const _0x30ca48=_0x2d1c5a;var _0x23c2b9,_0x54c2a1;const {parentId:_0x92c8a9,unitId:_0x5cc676,text:_0x3d84cf,threadId:_0x5735b3}=_0x2d47fd,_0x2e07a3=(_0x54c2a1=(_0x23c2b9=_0x3d84cf[_0x30ca48(0x135)])==null?void 0x0:_0x23c2b9['filter'](_0x3766f4=>_0x3766f4[_0x30ca48(0x15b)]===_0x3d0190[_0x30ca48(0x150)][_0x30ca48(0x18b)])[_0x30ca48(0x17b)](_0x3231ef=>_0x3231ef[_0x30ca48(0x122)]))!=null?_0x54c2a1:[],_0x57e106=JSON[_0x30ca48(0x14d)](_0x3d84cf),_0x44db1c=(await this[_0x30ca48(0x102)]['requireSession'](_0x5cc676))[_0x30ca48(0x18a)]();if(_0x92c8a9){const _0x20deb8={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3,'threadId':_0x5735b3},_0x5ed8eb=(await this['_httpService'][_0x30ca48(0x14b)]('/universer-api/comment/unit/'+_0x5cc676+_0x30ca48(0x192),{'body':_0x20deb8}))[_0x30ca48(0x141)][_0x30ca48(0x161)];return{..._0x2d47fd,'id':_0x5ed8eb[_0x30ca48(0x14e)],'dT':_0x3d0190[_0x30ca48(0x168)](+_0x5ed8eb[_0x30ca48(0x123)])['format'](_0x30ca48(0x17a)),'personId':_0x5ed8eb['userId']};}else{const _0x36ed66={'memberId':_0x44db1c,'unitId':_0x5cc676,'content':_0x57e106,'mention':_0x2e07a3},_0x2048d0=await this[_0x30ca48(0x109)][_0x30ca48(0x14b)](_0x30ca48(0x10a)+_0x5cc676+_0x30ca48(0x184),{'body':_0x36ed66});return _0x287c05(_0x2048d0[_0x30ca48(0x141)][_0x30ca48(0x17f)],_0x2d47fd);}}async[_0x2d1c5a(0x134)](_0xa03223){const _0x2b9009=_0x2d1c5a;var _0xd70d8b,_0x2971aa;const {text:_0xa9b207,unitId:_0x38e37f}=_0xa03223,_0x2a422d=(_0x2971aa=(_0xd70d8b=_0xa9b207[_0x2b9009(0x135)])==null?void 0x0:_0xd70d8b[_0x2b9009(0x175)](_0x2e447c=>_0x2e447c['rangeType']===_0x3d0190[_0x2b9009(0x150)]['COMMENT'])[_0x2b9009(0x17b)](_0x2a0ee2=>_0x2a0ee2[_0x2b9009(0x122)]))!=null?_0x2971aa:[],_0x27365a=JSON[_0x2b9009(0x14d)](_0xa9b207),_0xa8dbb2=_0xa03223[_0x2b9009(0x14f)],_0x32e73c=_0xa03223['id'],_0x30dbfc={'memberId':(await this[_0x2b9009(0x102)][_0x2b9009(0x11e)](_0x38e37f))['getMemberID'](),'unitId':_0x38e37f,'threadId':_0xa8dbb2,'mention':_0x2a422d,'content':_0x27365a,'replyId':_0x32e73c},_0x335d49=await this[_0x2b9009(0x109)]['post'](_0x2b9009(0x10a)+_0x38e37f+_0x2b9009(0x13f),{'body':_0x30dbfc});return!_0x335d49[_0x2b9009(0x141)][_0x2b9009(0x132)]||_0x335d49['body']['error'][_0x2b9009(0x107)]===0x1;}async[_0x2d1c5a(0x13e)](_0x25130f){const _0x3f746e=_0x2d1c5a,{unitId:_0x45df06}=_0x25130f,_0x4b542f=_0x25130f[_0x3f746e(0x14f)],_0x458032={'memberId':this['_userService'][_0x3f746e(0x10b)]()['userID'],'unitId':_0x45df06,'threadId':_0x4b542f,'solved':_0x25130f[_0x3f746e(0x138)]?_0x5cda73[_0x3f746e(0x16f)]:_0x5cda73[_0x3f746e(0x121)]},_0x5d5e33=await this[_0x3f746e(0x109)][_0x3f746e(0x14b)](_0x3f746e(0x10a)+_0x45df06+_0x3f746e(0x186),{'body':_0x458032});return!_0x5d5e33[_0x3f746e(0x141)]['error']||_0x5d5e33[_0x3f746e(0x141)][_0x3f746e(0x132)][_0x3f746e(0x107)]===0x1;}async[_0x2d1c5a(0x140)](_0x4bf704,_0x13e9f4,_0x4a7c8d,_0x3aaf08){const _0x2b2280=_0x2d1c5a,_0x2f3900={'memberId':(await this[_0x2b2280(0x102)][_0x2b2280(0x11e)](_0x4bf704))[_0x2b2280(0x18a)](),'threadId':_0x4a7c8d,'replyId':_0x3aaf08,'unitId':_0x4bf704},_0xc6ccca=await this[_0x2b2280(0x109)][_0x2b2280(0x14b)]('/universer-api/comment/unit/'+_0x4bf704+_0x2b2280(0x172),{'body':_0x2f3900});return!_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]||_0xc6ccca[_0x2b2280(0x141)][_0x2b2280(0x132)]['code']===0x1;}async['listComments'](_0x4daf68,_0x3df24c,_0x30e3d8){const _0x5d19cd=_0x2d1c5a,_0x76a77c={'unitId':_0x4daf68,'threadId':_0x30e3d8},_0x2dd97e=await this[_0x5d19cd(0x109)]['post'](_0x5d19cd(0x10a)+_0x4daf68+_0x5d19cd(0x179),{'body':_0x76a77c}),_0x3e6e53=_0x30e3d8[_0x5d19cd(0x17b)](_0x3a0879=>_0x4513b1(_0x2dd97e['body']['comments'][_0x3a0879],_0x4daf68,_0x3df24c))['filter'](Boolean);return Object[_0x5d19cd(0x112)](_0x2dd97e[_0x5d19cd(0x141)][_0x5d19cd(0x177)])[_0x5d19cd(0x11d)](_0x4e7ff0=>{const _0x434fbd=_0x5d19cd;this['_userService'][_0x434fbd(0x111)](_0x4e7ff0);}),_0x3e6e53;}['saveCommentToSnapshot'](_0x2a7527){const _0x25447e=_0x2d1c5a;return{'id':_0x2a7527['id'],'threadId':_0x2a7527[_0x25447e(0x14f)],'ref':_0x2a7527[_0x25447e(0x11b)]};}};_0x4c567b=_0x34829b([_0x5b385f(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93['HTTPService'])),_0x5b385f(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x11c)])),_0x5b385f(0x2,_0x3d0190[_0x2d1c5a(0x182)](_0x3db026[_0x2d1c5a(0x10c)])),_0x5b385f(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)]))],_0x4c567b);var _0x570b55=Object[_0x2d1c5a(0x18e)],_0x4c869a=Object[_0x2d1c5a(0x145)],_0x2bb772=(_0x5d19b3,_0x75698f,_0x41601e,_0x4776a3)=>{const _0x42d174=_0x2d1c5a;for(var _0x5d00a1=_0x4776a3>0x1?void 0x0:_0x4776a3?_0x4c869a(_0x75698f,_0x41601e):_0x75698f,_0x372fde=_0x5d19b3[_0x42d174(0x104)]-0x1,_0x2d1d7c;_0x372fde>=0x0;_0x372fde--)(_0x2d1d7c=_0x5d19b3[_0x372fde])&&(_0x5d00a1=(_0x4776a3?_0x2d1d7c(_0x75698f,_0x41601e,_0x5d00a1):_0x2d1d7c(_0x5d00a1))||_0x5d00a1);return _0x4776a3&&_0x5d00a1&&_0x570b55(_0x75698f,_0x41601e,_0x5d00a1),_0x5d00a1;},_0x49a366=(_0x4fbd56,_0x28563b)=>(_0x62fef0,_0x2e0de7)=>_0x28563b(_0x62fef0,_0x2e0de7,_0x4fbd56);let _0x6c0c22=class{constructor(_0x8dc74c){const _0x9e5a88=_0x2d1c5a;this[_0x9e5a88(0x109)]=_0x8dc74c;}async[_0x2d1c5a(0x12e)](_0x44bee6,_0x20771b,_0x304520){const _0x58ba96=_0x2d1c5a,_0x5c5129=new URL(window[_0x58ba96(0x18d)][_0x58ba96(0x173)])['searchParams'][_0x58ba96(0x191)](_0x58ba96(0x110));if(!_0x5c5129)return[];const _0x45b2ad=window['location'][_0x58ba96(0x148)],_0x371842=window[_0x58ba96(0x18d)][_0x58ba96(0x158)]===_0x58ba96(0x12f)?_0x58ba96(0x165):_0x58ba96(0x13a);return(await this[_0x58ba96(0x109)][_0x58ba96(0x191)](_0x371842+_0x58ba96(0x149)+_0x45b2ad+_0x58ba96(0x103),{'params':{'objectID':_0x5c5129,'unitID':_0x5c5129}}))[_0x58ba96(0x141)][_0x58ba96(0x108)]['map'](_0x2a842b=>{const _0x1b1849=_0x58ba96;var _0x1e4d30,_0xf43929,_0x5015c8,_0x1c8f43,_0x561c23,_0x131e08;return{'id':(_0xf43929=(_0x1e4d30=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x1e4d30[_0x1b1849(0x171)])!=null?_0xf43929:'','label':(_0x1c8f43=(_0x5015c8=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x5015c8[_0x1b1849(0x15c)])!=null?_0x1c8f43:'','icon':(_0x131e08=(_0x561c23=_0x2a842b[_0x1b1849(0x113)])==null?void 0x0:_0x561c23[_0x1b1849(0x133)])!=null?_0x131e08:'','type':_0x1b1849(0x130)};});}};_0x6c0c22=_0x2bb772([_0x49a366(0x0,_0x3d0190[_0x2d1c5a(0x182)](_0x49bd93[_0x2d1c5a(0x176)]))],_0x6c0c22);var _0x37496f=Object[_0x2d1c5a(0x18e)],_0x2a227c=Object[_0x2d1c5a(0x145)],_0x4d0464=(_0xd2a913,_0x87dbce,_0x5883ab,_0x51ad35)=>{for(var _0x14a9f4=_0x51ad35>0x1?void 0x0:_0x51ad35?_0x2a227c(_0x87dbce,_0x5883ab):_0x87dbce,_0x44abcb=_0xd2a913['length']-0x1,_0x5f82e1;_0x44abcb>=0x0;_0x44abcb--)(_0x5f82e1=_0xd2a913[_0x44abcb])&&(_0x14a9f4=(_0x51ad35?_0x5f82e1(_0x87dbce,_0x5883ab,_0x14a9f4):_0x5f82e1(_0x14a9f4))||_0x14a9f4);return _0x51ad35&&_0x14a9f4&&_0x37496f(_0x87dbce,_0x5883ab,_0x14a9f4),_0x14a9f4;},_0x434cce=(_0x1e9d3e,_0x140f0b)=>(_0x18600b,_0x5bb0a4)=>_0x140f0b(_0x18600b,_0x5bb0a4,_0x1e9d3e);let _0x3d1a79=class extends _0x3d0190[_0x2d1c5a(0x125)]{constructor(_0x3b6ddb,_0x357b76,_0x337cf9,_0x481722){const _0x165423=_0x2d1c5a;super(),this[_0x165423(0x142)]=_0x3b6ddb,this[_0x165423(0x17c)]=_0x357b76,this[_0x165423(0x136)]=_0x337cf9,this[_0x165423(0x146)]=_0x481722,this[_0x165423(0x190)]();}[_0x2d1c5a(0x190)](){const _0x38ca74=_0x2d1c5a;this[_0x38ca74(0x142)][_0x38ca74(0x15a)]=this[_0x38ca74(0x17c)],this[_0x38ca74(0x142)][_0x38ca74(0x152)]=!0x1,this[_0x38ca74(0x136)]['dataSource']=this[_0x38ca74(0x146)];}};_0x3d1a79=_0x4d0464([_0x434cce(0x0,_0x5c0884['IThreadCommentDataSourceService']),_0x434cce(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x4c567b)),_0x434cce(0x2,_0x3ed21d[_0x2d1c5a(0x14c)]),_0x434cce(0x3,_0x3d0190[_0x2d1c5a(0x182)](_0x6c0c22))],_0x3d1a79);var _0x25b1bc=Object[_0x2d1c5a(0x18e)],_0x271190=Object[_0x2d1c5a(0x145)],_0x51ac44=(_0x241833,_0x23df0b,_0x468956)=>_0x23df0b in _0x241833?_0x25b1bc(_0x241833,_0x23df0b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x468956}):_0x241833[_0x23df0b]=_0x468956,_0x222d11=(_0x2385c4,_0x1ead91,_0x5319db,_0x2527a7)=>{const _0x478081=_0x2d1c5a;for(var _0x55b4d9=_0x2527a7>0x1?void 0x0:_0x2527a7?_0x271190(_0x1ead91,_0x5319db):_0x1ead91,_0x5b3d36=_0x2385c4[_0x478081(0x104)]-0x1,_0x196bb6;_0x5b3d36>=0x0;_0x5b3d36--)(_0x196bb6=_0x2385c4[_0x5b3d36])&&(_0x55b4d9=(_0x2527a7?_0x196bb6(_0x1ead91,_0x5319db,_0x55b4d9):_0x196bb6(_0x55b4d9))||_0x55b4d9);return _0x2527a7&&_0x55b4d9&&_0x25b1bc(_0x1ead91,_0x5319db,_0x55b4d9),_0x55b4d9;},_0x54454a=(_0x412be0,_0x463a27)=>(_0x108220,_0x1cfaae)=>_0x463a27(_0x108220,_0x1cfaae,_0x412be0),_0x3d7f66=(_0x3bb133,_0x545864,_0x5eac52)=>_0x51ac44(_0x3bb133,typeof _0x545864!=_0x2d1c5a(0x11a)?_0x545864+'':_0x545864,_0x5eac52);_0x17a296[_0x2d1c5a(0x159)]=class extends _0x3d0190[_0x2d1c5a(0x10e)]{constructor(_0x54fd89=_0x5c96e1,_0x322218,_0x48bb3f){const _0x37d3fc=_0x2d1c5a;super(),this['_config']=_0x54fd89,this['_injector']=_0x322218,this['_configService']=_0x48bb3f;const {..._0x3fd3f9}=this[_0x37d3fc(0x169)];this[_0x37d3fc(0x170)][_0x37d3fc(0x189)](_0x168b3a,_0x3fd3f9);}[_0x2d1c5a(0x131)](){const _0x2e3fbe=_0x2d1c5a;[[_0x6c0c22],[_0x4c567b],[_0x3d1a79],[_0x2c4030]][_0x2e3fbe(0x11d)](_0x3c3c13=>{const _0x20958e=_0x2e3fbe;this['_injector'][_0x20958e(0x139)](_0x3c3c13);});}[_0x2d1c5a(0x10d)](){const _0x31eae9=_0x2d1c5a;this[_0x31eae9(0x101)]['get'](_0x3d1a79),this[_0x31eae9(0x101)][_0x31eae9(0x191)](_0x2c4030);}},_0x3d7f66(_0x17a296['UniverThreadCommentDataSourcePlugin'],_0x2d1c5a(0x13c),_0x581514),_0x3d7f66(_0x17a296[_0x2d1c5a(0x159)],'type',_0x3d0190[_0x2d1c5a(0x129)][_0x2d1c5a(0x153)]),_0x17a296[_0x2d1c5a(0x159)]=_0x222d11([_0x3d0190['DependentOn'](_0x3ed21d['UniverThreadCommentUIPlugin'],_0x3db026[_0x2d1c5a(0x115)],_0x51384d[_0x2d1c5a(0x118)]),_0x54454a(0x1,_0x3d0190[_0x2d1c5a(0x182)](_0x3d0190[_0x2d1c5a(0x10f)])),_0x54454a(0x2,_0x3d0190['IConfigService'])],_0x17a296[_0x2d1c5a(0x159)]),Object['defineProperty'](_0x17a296,Symbol[_0x2d1c5a(0x14a)],{'value':'Module'});}));function _0x45cb(){const _0x4c3ba6=['delete','Disposable','addComment','_initUserSync','rxjs','UniverInstanceType','userId','UniverNetwork','Unknown','thread-comment-data-source.config','getMentions','https:','user','onStarting','error','avatar','updateComment','customRanges','_threadCommentMentionDataService','UNRECOGNIZED','resolved','add','http','@univerjs/thread-comment','pluginName','@univerjs/thread-comment-ui','resolveComment','/edit','deleteComment','body','_threadCommentDataSourceService','UniverProThreadCommentDatasource','UniverThreadComment','getOwnPropertyDescriptor','_threadCommentMentionDataSource','6846820HIrJlY','host','://','toStringTag','post','IThreadCommentMentionDataService','stringify','replyId','threadId','CustomRangeType','_userService','syncUpdateMutationToColla','UNIVER_UNKNOWN','find','748670RYfhYR','size','14296464KKikiZ','protocol','UniverThreadCommentDataSourcePlugin','dataSource','rangeType','name','580ElmYGS','bufferTime','Delete','UniverProLicense','reply','personId','Solve','parse','https','solved','subscribe','dayjs','_config','commentUpdate$','CommentService','4782FSQpvV','UniverProCollaborationClient','object','Solved','_configService','userID','/delete','href','getUnit','filter','HTTPService','users','@univerjs-pro/collaboration-client','/list','YYYY/MM/DD\x20HH:mm','map','_threadCommentDataSource','unitId','payload','comment','content','13615oBUuuF','Inject','getComment','/add','root','/solved','UniverThreadCommentUi','@univerjs/core','setConfig','getMemberID','COMMENT','7362024zfVyhe','location','defineProperty','Edit','_initDataSource','get','/reply','14718WcxWkQ','Reply','Add','disposeWithMe','pipe','_injector','_sessionService','/universer-api/authz/collaborator','length','@univerjs-pro/license','exports','code','collaborators','_httpService','/universer-api/comment/unit/','getCurrentUser','CollaborationSessionService','onReady','Plugin','Injector','unit','addUser','values','subject','_threadCommentModel','UniverCollaborationClientPlugin','replies','type','UniverLicensePlugin','2532470kOXJCz','symbol','ref','UserManagerService','forEach','requireSession','_commentService','@univerjs/network','OpenOrReOpen','rangeId','createTimestamp'];_0x45cb=function(){return _0x4c3ba6;};return _0x45cb();}
|
|
28
|
+
// @univerjs-pro/thread-comment-datasource/index
|
|
29
|
+
function _0x4be6(){const _0x3668e7=['CollaborationSessionService','9316890PKlpdY','UniverNetwork','121307gAiTVT','length','content','_config','_threadCommentDataSourceService','format','HTTPService','parentId','UniverCollaborationClientPlugin','_threadCommentDataSource','84YdTCPx','IConfigService','UniverThreadComment','_initDataSource','Plugin','find','Solved','getCurrentUser','rangeId','post','listComments','dayjs','_threadCommentModel','UserManagerService','requireSession','addUser','unitId','userId','getUser','COMMENT','/delete','Reply','Delete','@univerjs/network','/reply','/solved','_initUserSync','size','/edit','UniverThreadCommentUi','UNIVER_UNKNOWN','code','YYYY/MM/DD\x20HH:mm','userID','forEach','users','Edit','onStarting','/universer-api/user/list','1220ituseD','Injector','parse','@univerjs-pro/collaboration-client','updateComment','getOwnPropertyDescriptor','user','pluginName','@univerjs/thread-comment-ui','2389824VTxolh','UNRECOGNIZED','defineProperty','createTimestamp','rxjs','@univerjs/thread-comment','error','Inject','_userService','34589898temSRC','get','rangeType','40gsnpAn','add','OpenOrReOpen','@univerjs-pro/license','IThreadCommentDataSourceService','resolved','customRanges','_httpService','_sessionService','/list','ref','root','filter','Module','getMemberID','UniverThreadCommentDataSourcePlugin','solved','thread-comment-data-source.config','_configService','UniverProThreadCommentDatasource','slice','stringify','_injector','threadId','CustomRangeType','replies','replyId','_commentService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','1508544ouaLdj','reply','/add','UniverThreadCommentUIPlugin','values','commentUpdate$','getUnit','Add','/universer-api/comment/unit/','UniverInstanceType','Unknown','1108919FgpyyU','subscribe','body','UniverLicensePlugin','_init','dataSource','resolveComment','setConfig','UniverProCollaborationClient','Solve','type','amd','Disposable','comments','deleteComment','payload','disposeWithMe'];_0x4be6=function(){return _0x3668e7;};return _0x4be6();}function _0x7bf8(_0x148829,_0x46b82e){const _0x4be6db=_0x4be6();return _0x7bf8=function(_0x7bf87f,_0x582bd6){_0x7bf87f=_0x7bf87f-0x8c;let _0x4363b3=_0x4be6db[_0x7bf87f];return _0x4363b3;},_0x7bf8(_0x148829,_0x46b82e);}(function(_0x5a4074,_0xdb3a29){const _0x557a2c=_0x7bf8,_0xb849e5=_0x5a4074();while(!![]){try{const _0x3d2fdf=parseInt(_0x557a2c(0x95))/0x1+-parseInt(_0x557a2c(0xf8))/0x2+-parseInt(_0x557a2c(0x9f))/0x3*(-parseInt(_0x557a2c(0xc6))/0x4)+-parseInt(_0x557a2c(0x93))/0x5+parseInt(_0x557a2c(0xcf))/0x6+-parseInt(_0x557a2c(0x103))/0x7*(parseInt(_0x557a2c(0xdb))/0x8)+parseInt(_0x557a2c(0xd8))/0x9;if(_0x3d2fdf===_0xdb3a29)break;else _0xb849e5['push'](_0xb849e5['shift']());}catch(_0x34a3e1){_0xb849e5['push'](_0xb849e5['shift']());}}}(_0x4be6,0xeacca),function(_0x479271,_0x54bdb2){const _0x4164f4=_0x7bf8;typeof exports=='object'&&typeof module<'u'?_0x54bdb2(exports,require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require(_0x4164f4(0xc9)),require(_0x4164f4(0xde)),require(_0x4164f4(0xd4)),require(_0x4164f4(0xd3)),require(_0x4164f4(0xb6))):typeof define=='function'&&define[_0x4164f4(0x8c)]?define(['exports','@univerjs/core',_0x4164f4(0xce),_0x4164f4(0xc9),'@univerjs-pro/license','@univerjs/thread-comment',_0x4164f4(0xd3),_0x4164f4(0xb6)],_0x54bdb2):(_0x479271=typeof globalThis<'u'?globalThis:_0x479271||self,_0x54bdb2(_0x479271[_0x4164f4(0xee)]={},_0x479271['UniverCore'],_0x479271[_0x4164f4(0xbc)],_0x479271[_0x4164f4(0x10b)],_0x479271['UniverProLicense'],_0x479271[_0x4164f4(0xa1)],_0x479271[_0x4164f4(0xd3)],_0x479271[_0x4164f4(0x94)]));}(this,function(_0x3d559e,_0x178aea,_0x11616b,_0x222a5f,_0x39f192,_0x28d5fb,_0x47b451,_0x115935){'use strict';const _0x25554b=_0x7bf8;const _0x55b355=_0x25554b(0xf7);var _0x3fcdaf=(_0xda2fd2=>(_0xda2fd2[_0xda2fd2[_0x25554b(0xdd)]=0x0]=_0x25554b(0xdd),_0xda2fd2[_0xda2fd2[_0x25554b(0xa5)]=0x1]=_0x25554b(0xa5),_0xda2fd2[_0xda2fd2[_0x25554b(0xd0)]=-0x1]='UNRECOGNIZED',_0xda2fd2))(_0x3fcdaf||{}),_0x1a98a7=(_0x436686=>(_0x436686[_0x436686[_0x25554b(0x102)]=0x0]='Unknown',_0x436686[_0x436686['Add']=0x1]=_0x25554b(0xff),_0x436686[_0x436686['Reply']=0x2]=_0x25554b(0xb4),_0x436686[_0x436686[_0x25554b(0xc3)]=0x3]=_0x25554b(0xc3),_0x436686[_0x436686['Delete']=0x4]='Delete',_0x436686[_0x436686[_0x25554b(0x10c)]=0x5]=_0x25554b(0x10c),_0x436686[_0x436686['UNRECOGNIZED']=-0x1]=_0x25554b(0xd0),_0x436686))(_0x1a98a7||{});const _0x2b00ae=_0x1486d6=>_0x178aea['dayjs'](new Date(+_0x1486d6))[_0x25554b(0x9a)](_0x25554b(0xbf)),_0x6e5acb=async(_0x40a71e,_0x134c1c)=>{const _0x303c1f=_0x25554b,_0x1bf27f=_0x40a71e[_0x303c1f(0xd9)](_0x178aea['UserManagerService']),_0x1fc3b2=_0x40a71e[_0x303c1f(0xd9)](_0x115935[_0x303c1f(0x9b)]);_0x134c1c[_0x303c1f(0xc1)](_0x530db2=>{const _0x19fe22=_0x303c1f;_0x1bf27f[_0x19fe22(0xb1)](_0x530db2)&&_0x134c1c['delete'](_0x530db2);}),_0x134c1c[_0x303c1f(0xba)]&&(await _0x1fc3b2[_0x303c1f(0xd9)](_0x303c1f(0xc5),{'params':{'userIDs':[..._0x134c1c]}}))[_0x303c1f(0x105)]['users'][_0x303c1f(0xc1)](_0x24f1d7=>{const _0x1314dc=_0x303c1f;_0x24f1d7&&_0x1bf27f[_0x1314dc(0xae)](_0x24f1d7);});};var _0xbf704a=Object[_0x25554b(0xd1)],_0x5e87c5=Object[_0x25554b(0xcb)],_0x2f2fe5=(_0x333799,_0x304363,_0x11344e,_0x37e764)=>{const _0x41ffeb=_0x25554b;for(var _0xd07ab3=_0x37e764>0x1?void 0x0:_0x37e764?_0x5e87c5(_0x304363,_0x11344e):_0x304363,_0x3f41da=_0x333799[_0x41ffeb(0x96)]-0x1,_0x541c5b;_0x3f41da>=0x0;_0x3f41da--)(_0x541c5b=_0x333799[_0x3f41da])&&(_0xd07ab3=(_0x37e764?_0x541c5b(_0x304363,_0x11344e,_0xd07ab3):_0x541c5b(_0xd07ab3))||_0xd07ab3);return _0x37e764&&_0xd07ab3&&_0xbf704a(_0x304363,_0x11344e,_0xd07ab3),_0xd07ab3;},_0x5a325f=(_0x59bd68,_0x1a28fd)=>(_0x1120fe,_0x1c8f69)=>_0x1a28fd(_0x1120fe,_0x1c8f69,_0x59bd68);let _0x4c6b65=class extends _0x178aea[_0x25554b(0x8d)]{constructor(_0x539c0f,_0x3b6312,_0x4ee931,_0x24774a){const _0x3148c4=_0x25554b;super(),this[_0x3148c4(0xf6)]=_0x539c0f,this[_0x3148c4(0xab)]=_0x3b6312,this[_0x3148c4(0xd7)]=_0x4ee931,this[_0x3148c4(0xf1)]=_0x24774a,this[_0x3148c4(0x107)](),this[_0x3148c4(0xb9)]();}[_0x25554b(0xb9)](){const _0x36d146=_0x25554b;this[_0x36d146(0x91)](this[_0x36d146(0xab)][_0x36d146(0xfd)]['pipe'](_0x47b451['bufferTime'](0x10))[_0x36d146(0x104)](_0x2936cd=>{const _0x3b9f14=_0x36d146,_0x37f491=new Set();_0x2936cd[_0x3b9f14(0xc1)](_0x4f1406=>{const _0x1049e1=_0x3b9f14;switch(_0x4f1406['type']){case'add':{const _0x1a0d5d=_0x4f1406[_0x1049e1(0x90)]['personId'];_0x37f491['add'](_0x1a0d5d);break;}}}),_0x6e5acb(this['_injector'],_0x37f491);}));}[_0x25554b(0x107)](){const _0x415f44=_0x25554b;this['disposeWithMe'](this[_0x415f44(0xf6)]['commentUpdate$'][_0x415f44(0x104)](async _0x4b10e3=>{const _0x5b148e=_0x415f44;var _0x5482dc,_0x2b8564,_0x3a9986,_0x381706;const _0x9a2936=(_0x5482dc=this[_0x5b148e(0xab)]['getUnit'](_0x4b10e3[_0x5b148e(0xaf)])['find'](_0x26e7cf=>_0x26e7cf['threadId']===_0x4b10e3[_0x5b148e(0xf2)]))==null?void 0x0:_0x5482dc['root'];if(!_0x9a2936)return;const {unitId:_0x1be22a,subUnitId:_0x50c15a}=_0x9a2936;switch(_0x4b10e3[_0x5b148e(0xcc)]&&this[_0x5b148e(0xd7)]['addUser'](_0x4b10e3[_0x5b148e(0xcc)]),_0x4b10e3['type']){case _0x1a98a7[_0x5b148e(0xff)]:break;case _0x1a98a7[_0x5b148e(0xb4)]:{this[_0x5b148e(0xab)]['addComment'](_0x1be22a,_0x50c15a,{'unitId':_0x1be22a,'subUnitId':_0x50c15a,'ref':'','id':_0x4b10e3[_0x5b148e(0xf5)],'dT':_0x2b00ae(+_0x4b10e3[_0x5b148e(0xd2)]),'threadId':_0x4b10e3[_0x5b148e(0xf2)],'personId':(_0x3a9986=(_0x2b8564=_0x4b10e3[_0x5b148e(0xcc)])==null?void 0x0:_0x2b8564[_0x5b148e(0xc0)])!=null?_0x3a9986:_0x4b10e3[_0x5b148e(0xb0)],'text':JSON[_0x5b148e(0xc8)](_0x4b10e3[_0x5b148e(0x97)]),'parentId':_0x9a2936['id']});break;}case _0x1a98a7[_0x5b148e(0xb5)]:{const _0x378dfb=this[_0x5b148e(0xab)]['getComment'](_0x1be22a,_0x50c15a,_0x4b10e3['replyId']);_0x378dfb&&_0x378dfb[_0x5b148e(0x9c)]&&this['_threadCommentModel'][_0x5b148e(0x8f)](_0x1be22a,_0x50c15a,_0x4b10e3[_0x5b148e(0xf5)]);break;}case _0x1a98a7[_0x5b148e(0xc3)]:{this[_0x5b148e(0xab)]['updateComment'](_0x1be22a,_0x50c15a,{'commentId':_0x4b10e3['replyId'],'text':JSON[_0x5b148e(0xc8)](_0x4b10e3[_0x5b148e(0x97)])});break;}case _0x1a98a7['Solve']:{const _0x392c2a=(_0x381706=this[_0x5b148e(0xab)][_0x5b148e(0xfe)](_0x4b10e3[_0x5b148e(0xaf)])[_0x5b148e(0xa4)](_0xe422c1=>_0xe422c1['threadId']===_0x4b10e3[_0x5b148e(0xf2)]))==null?void 0x0:_0x381706[_0x5b148e(0xe6)];_0x392c2a&&this['_threadCommentModel']['resolveComment'](_0x1be22a,_0x50c15a,_0x392c2a['id'],_0x4b10e3[_0x5b148e(0xeb)]===_0x3fcdaf[_0x5b148e(0xa5)]);break;}}}));}};_0x4c6b65=_0x2f2fe5([_0x5a325f(0x0,_0x178aea[_0x25554b(0xd6)](_0x222a5f['CommentService'])),_0x5a325f(0x1,_0x178aea[_0x25554b(0xd6)](_0x28d5fb['ThreadCommentModel'])),_0x5a325f(0x2,_0x178aea[_0x25554b(0xd6)](_0x178aea['UserManagerService'])),_0x5a325f(0x3,_0x178aea[_0x25554b(0xd6)](_0x178aea[_0x25554b(0xc7)]))],_0x4c6b65);const _0x16222b=_0x25554b(0xec),_0xb59808={};var _0x510078=Object[_0x25554b(0xd1)],_0x2b4404=Object[_0x25554b(0xcb)],_0x273b83=(_0x401147,_0xf71ea5,_0x40ca14,_0x1233ac)=>{for(var _0x38bf61=_0x1233ac>0x1?void 0x0:_0x1233ac?_0x2b4404(_0xf71ea5,_0x40ca14):_0xf71ea5,_0x2f1323=_0x401147['length']-0x1,_0x4dc708;_0x2f1323>=0x0;_0x2f1323--)(_0x4dc708=_0x401147[_0x2f1323])&&(_0x38bf61=(_0x1233ac?_0x4dc708(_0xf71ea5,_0x40ca14,_0x38bf61):_0x4dc708(_0x38bf61))||_0x38bf61);return _0x1233ac&&_0x38bf61&&_0x510078(_0xf71ea5,_0x40ca14,_0x38bf61),_0x38bf61;},_0x57f9f8=(_0x3fb87c,_0x4d997f)=>(_0x379b65,_0x2616b9)=>_0x4d997f(_0x379b65,_0x2616b9,_0x3fb87c);function _0x1fcb66(_0x2310f9,_0x3ebb1f){const _0x87b44d=_0x25554b,_0x4a4e33=_0x2310f9[_0x87b44d(0xf4)][0x0];return{..._0x3ebb1f,'id':_0x4a4e33['replyId'],'resolved':_0x2310f9['solved']===0x1,'dT':_0x2b00ae(_0x4a4e33['createTimestamp']),'personId':_0x4a4e33[_0x87b44d(0xb0)],'threadId':_0x4a4e33['threadId']};}function _0x1952fb(_0x4db1e3,_0x375968,_0x5df834){const _0x209b1d=_0x25554b;var _0x4dd6bd,_0x5ea7e1;if(((_0x5ea7e1=(_0x4dd6bd=_0x4db1e3==null?void 0x0:_0x4db1e3[_0x209b1d(0xf4)])==null?void 0x0:_0x4dd6bd['length'])!=null?_0x5ea7e1:0x0)>0x0){const _0x5b5b1c=(_0x11bbd5,_0x44f714)=>({'id':_0x11bbd5[_0x209b1d(0xf5)],'threadId':_0x11bbd5[_0x209b1d(0xf2)],'dT':_0x2b00ae(_0x11bbd5['createTimestamp']),'personId':_0x11bbd5[_0x209b1d(0xb0)],'resolved':_0x4db1e3['solved']===_0x3fcdaf['Solved'],'unitId':_0x375968,'subUnitId':_0x5df834,'text':JSON[_0x209b1d(0xc8)](_0x11bbd5[_0x209b1d(0x97)]),'parentId':_0x44f714}),_0x2047db=_0x5b5b1c(_0x4db1e3[_0x209b1d(0xf4)][0x0]);return{..._0x2047db,'children':_0x4db1e3[_0x209b1d(0xf4)][_0x209b1d(0xef)](0x1)['map'](_0x542ed3=>_0x5b5b1c(_0x542ed3,_0x2047db['id']))};}return null;}let _0x3b4535=class{constructor(_0x32e7b2,_0x515302,_0x5f30d4,_0x5c9c40){const _0x1cb3fc=_0x25554b;this[_0x1cb3fc(0xe2)]=_0x32e7b2,this[_0x1cb3fc(0xd7)]=_0x515302,this[_0x1cb3fc(0xe3)]=_0x5f30d4,this[_0x1cb3fc(0xf1)]=_0x5c9c40;}async['addComment'](_0x690679){const _0x2336eb=_0x25554b;var _0x406914,_0x272f2b;const {parentId:_0x5ad1cc,unitId:_0x1c6658,text:_0x548f96,threadId:_0x16a6a0}=_0x690679,_0x34cad0=(_0x272f2b=(_0x406914=_0x548f96[_0x2336eb(0xe1)])==null?void 0x0:_0x406914['filter'](_0x294e92=>_0x294e92['rangeType']===_0x178aea[_0x2336eb(0xf3)]['COMMENT'])['map'](_0x42c0a3=>_0x42c0a3[_0x2336eb(0xa7)]))!=null?_0x272f2b:[],_0x276df2=JSON[_0x2336eb(0xf0)](_0x548f96),_0x39440f=(await this['_sessionService']['requireSession'](_0x1c6658))[_0x2336eb(0xe9)]();if(_0x5ad1cc){const _0x33d464={'memberId':_0x39440f,'unitId':_0x1c6658,'content':_0x276df2,'mention':_0x34cad0,'threadId':_0x16a6a0},_0x4656c8=(await this[_0x2336eb(0xe2)][_0x2336eb(0xa8)]('/universer-api/comment/unit/'+_0x1c6658+_0x2336eb(0xb7),{'body':_0x33d464}))[_0x2336eb(0x105)][_0x2336eb(0xf9)];return{..._0x690679,'id':_0x4656c8[_0x2336eb(0xf5)],'dT':_0x178aea[_0x2336eb(0xaa)](+_0x4656c8[_0x2336eb(0xd2)])['format'](_0x2336eb(0xbf)),'personId':_0x4656c8[_0x2336eb(0xb0)]};}else{const _0x492667={'memberId':_0x39440f,'unitId':_0x1c6658,'content':_0x276df2,'mention':_0x34cad0},_0x9f043=await this[_0x2336eb(0xe2)][_0x2336eb(0xa8)](_0x2336eb(0x100)+_0x1c6658+_0x2336eb(0xfa),{'body':_0x492667});return _0x1fcb66(_0x9f043[_0x2336eb(0x105)]['comment'],_0x690679);}}async[_0x25554b(0xca)](_0x282978){const _0x3c731d=_0x25554b;var _0x40f0ad,_0x2025a1;const {text:_0x4b4e75,unitId:_0x5852fe}=_0x282978,_0x4d3e5b=(_0x2025a1=(_0x40f0ad=_0x4b4e75['customRanges'])==null?void 0x0:_0x40f0ad['filter'](_0x58ddee=>_0x58ddee[_0x3c731d(0xda)]===_0x178aea['CustomRangeType'][_0x3c731d(0xb2)])['map'](_0x5547ac=>_0x5547ac[_0x3c731d(0xa7)]))!=null?_0x2025a1:[],_0x5b20e3=JSON[_0x3c731d(0xf0)](_0x4b4e75),_0x953e4c=_0x282978['threadId'],_0x5d8fe2=_0x282978['id'],_0x4b8236={'memberId':(await this[_0x3c731d(0xe3)]['requireSession'](_0x5852fe))[_0x3c731d(0xe9)](),'unitId':_0x5852fe,'threadId':_0x953e4c,'mention':_0x4d3e5b,'content':_0x5b20e3,'replyId':_0x5d8fe2},_0x5c1093=await this[_0x3c731d(0xe2)]['post'](_0x3c731d(0x100)+_0x5852fe+_0x3c731d(0xbb),{'body':_0x4b8236});return!_0x5c1093[_0x3c731d(0x105)][_0x3c731d(0xd5)]||_0x5c1093[_0x3c731d(0x105)][_0x3c731d(0xd5)][_0x3c731d(0xbe)]===0x1;}async[_0x25554b(0x109)](_0x46fb6f){const _0x594c2c=_0x25554b,{unitId:_0x4ac8ac}=_0x46fb6f,_0x214bce=_0x46fb6f['threadId'],_0x33966d={'memberId':this[_0x594c2c(0xd7)][_0x594c2c(0xa6)]()['userID'],'unitId':_0x4ac8ac,'threadId':_0x214bce,'solved':_0x46fb6f[_0x594c2c(0xe0)]?_0x3fcdaf[_0x594c2c(0xa5)]:_0x3fcdaf['OpenOrReOpen']},_0x37ecc2=await this[_0x594c2c(0xe2)]['post'](_0x594c2c(0x100)+_0x4ac8ac+_0x594c2c(0xb8),{'body':_0x33966d});return!_0x37ecc2['body']['error']||_0x37ecc2[_0x594c2c(0x105)][_0x594c2c(0xd5)][_0x594c2c(0xbe)]===0x1;}async[_0x25554b(0x8f)](_0x5c52a0,_0x4e8926,_0x171a3c,_0x78eb85){const _0x520bb9=_0x25554b,_0x357f={'memberId':(await this['_sessionService'][_0x520bb9(0xad)](_0x5c52a0))[_0x520bb9(0xe9)](),'threadId':_0x171a3c,'replyId':_0x78eb85,'unitId':_0x5c52a0},_0x272edd=await this[_0x520bb9(0xe2)]['post'](_0x520bb9(0x100)+_0x5c52a0+_0x520bb9(0xb3),{'body':_0x357f});return!_0x272edd['body']['error']||_0x272edd[_0x520bb9(0x105)]['error'][_0x520bb9(0xbe)]===0x1;}async[_0x25554b(0xa9)](_0x323016,_0x250480,_0x7d30aa){const _0x259aab=_0x25554b,_0x4828e6={'unitId':_0x323016,'threadId':_0x7d30aa},_0x3f8668=await this[_0x259aab(0xe2)]['post'](_0x259aab(0x100)+_0x323016+_0x259aab(0xe4),{'body':_0x4828e6}),_0x392815=_0x7d30aa['map'](_0x1b2b11=>_0x1952fb(_0x3f8668[_0x259aab(0x105)][_0x259aab(0x8e)][_0x1b2b11],_0x323016,_0x250480))[_0x259aab(0xe7)](Boolean);return Object[_0x259aab(0xfc)](_0x3f8668['body'][_0x259aab(0xc2)])[_0x259aab(0xc1)](_0x3092ea=>{this['_userService']['addUser'](_0x3092ea);}),_0x392815;}['saveCommentToSnapshot'](_0x320df){const _0x3aac12=_0x25554b;return{'id':_0x320df['id'],'threadId':_0x320df[_0x3aac12(0xf2)],'ref':_0x320df[_0x3aac12(0xe5)]};}};_0x3b4535=_0x273b83([_0x57f9f8(0x0,_0x178aea[_0x25554b(0xd6)](_0x115935[_0x25554b(0x9b)])),_0x57f9f8(0x1,_0x178aea['Inject'](_0x178aea[_0x25554b(0xac)])),_0x57f9f8(0x2,_0x178aea[_0x25554b(0xd6)](_0x222a5f[_0x25554b(0x92)])),_0x57f9f8(0x3,_0x178aea[_0x25554b(0xd6)](_0x178aea[_0x25554b(0xc7)]))],_0x3b4535);var _0x2dfce6=Object[_0x25554b(0xd1)],_0x27e7c4=Object[_0x25554b(0xcb)],_0x4934b6=(_0x52ce2a,_0x5cdef5,_0x3e0380,_0x3f0d37)=>{const _0x3af9f3=_0x25554b;for(var _0x17507d=_0x3f0d37>0x1?void 0x0:_0x3f0d37?_0x27e7c4(_0x5cdef5,_0x3e0380):_0x5cdef5,_0x187790=_0x52ce2a[_0x3af9f3(0x96)]-0x1,_0x5d32fe;_0x187790>=0x0;_0x187790--)(_0x5d32fe=_0x52ce2a[_0x187790])&&(_0x17507d=(_0x3f0d37?_0x5d32fe(_0x5cdef5,_0x3e0380,_0x17507d):_0x5d32fe(_0x17507d))||_0x17507d);return _0x3f0d37&&_0x17507d&&_0x2dfce6(_0x5cdef5,_0x3e0380,_0x17507d),_0x17507d;},_0x4e0240=(_0x35c71f,_0x31df7d)=>(_0x15e40c,_0x1cb864)=>_0x31df7d(_0x15e40c,_0x1cb864,_0x35c71f);let _0x2e0ad6=class extends _0x178aea[_0x25554b(0x8d)]{constructor(_0x37f8ae,_0x778a77){const _0x522227=_0x25554b;super(),this[_0x522227(0x99)]=_0x37f8ae,this['_threadCommentDataSource']=_0x778a77,this[_0x522227(0xa2)]();}[_0x25554b(0xa2)](){const _0x32b41c=_0x25554b;this[_0x32b41c(0x99)][_0x32b41c(0x108)]=this[_0x32b41c(0x9e)],this[_0x32b41c(0x99)]['syncUpdateMutationToColla']=!0x1;}};_0x2e0ad6=_0x4934b6([_0x4e0240(0x0,_0x28d5fb[_0x25554b(0xdf)]),_0x4e0240(0x1,_0x178aea[_0x25554b(0xd6)](_0x3b4535))],_0x2e0ad6);var _0x4ebd09=Object[_0x25554b(0xd1)],_0x57946c=Object[_0x25554b(0xcb)],_0x1a3026=(_0x55b135,_0x56ba8d,_0xd1f75e)=>_0x56ba8d in _0x55b135?_0x4ebd09(_0x55b135,_0x56ba8d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xd1f75e}):_0x55b135[_0x56ba8d]=_0xd1f75e,_0x45b68b=(_0x25ec3b,_0xac6fc7,_0x154994,_0x5c9684)=>{const _0x5a4bbd=_0x25554b;for(var _0x2dd402=_0x5c9684>0x1?void 0x0:_0x5c9684?_0x57946c(_0xac6fc7,_0x154994):_0xac6fc7,_0x3a78c6=_0x25ec3b[_0x5a4bbd(0x96)]-0x1,_0x25f324;_0x3a78c6>=0x0;_0x3a78c6--)(_0x25f324=_0x25ec3b[_0x3a78c6])&&(_0x2dd402=(_0x5c9684?_0x25f324(_0xac6fc7,_0x154994,_0x2dd402):_0x25f324(_0x2dd402))||_0x2dd402);return _0x5c9684&&_0x2dd402&&_0x4ebd09(_0xac6fc7,_0x154994,_0x2dd402),_0x2dd402;},_0x1f32ff=(_0x1a938d,_0x319727)=>(_0x44152e,_0x251ca3)=>_0x319727(_0x44152e,_0x251ca3,_0x1a938d),_0x3d97e3=(_0x16cc32,_0x576039,_0x4c6df2)=>_0x1a3026(_0x16cc32,typeof _0x576039!='symbol'?_0x576039+'':_0x576039,_0x4c6df2);_0x3d559e[_0x25554b(0xea)]=class extends _0x178aea[_0x25554b(0xa3)]{constructor(_0x3f8ab2=_0xb59808,_0xe17423,_0x2fabe0){const _0xde4eb7=_0x25554b;super(),this[_0xde4eb7(0x98)]=_0x3f8ab2,this['_injector']=_0xe17423,this[_0xde4eb7(0xed)]=_0x2fabe0;const {..._0x2853a6}=this['_config'];this[_0xde4eb7(0xed)][_0xde4eb7(0x10a)](_0x16222b,_0x2853a6);}[_0x25554b(0xc4)](){const _0x476736=_0x25554b;[[_0x3b4535],[_0x2e0ad6],[_0x4c6b65]][_0x476736(0xc1)](_0x4c498e=>{const _0x288029=_0x476736;this[_0x288029(0xf1)][_0x288029(0xdc)](_0x4c498e);});}['onReady'](){const _0x4d4f07=_0x25554b;this[_0x4d4f07(0xf1)][_0x4d4f07(0xd9)](_0x2e0ad6),this['_injector'][_0x4d4f07(0xd9)](_0x4c6b65);}},_0x3d97e3(_0x3d559e[_0x25554b(0xea)],_0x25554b(0xcd),_0x55b355),_0x3d97e3(_0x3d559e[_0x25554b(0xea)],_0x25554b(0x10d),_0x178aea[_0x25554b(0x101)][_0x25554b(0xbd)]),_0x3d559e[_0x25554b(0xea)]=_0x45b68b([_0x178aea['DependentOn'](_0x11616b[_0x25554b(0xfb)],_0x222a5f[_0x25554b(0x9d)],_0x39f192[_0x25554b(0x106)]),_0x1f32ff(0x1,_0x178aea[_0x25554b(0xd6)](_0x178aea[_0x25554b(0xc7)])),_0x1f32ff(0x2,_0x178aea[_0x25554b(0xa0)])],_0x3d559e['UniverThreadCommentDataSourcePlugin']),Object[_0x25554b(0xd1)](_0x3d559e,Symbol['toStringTag'],{'value':_0x25554b(0xe8)});}));
|
|
198
30
|
|
|
199
|
-
|
|
31
|
+
// index
|
|
32
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@univerjs/docs-thread-comment-ui"),require("@univerjs/thread-comment-ui"),require("@univerjs-pro/thread-comment-datasource")):typeof define=="function"&&define.amd?define(["exports","@univerjs/docs-thread-comment-ui","@univerjs/thread-comment-ui","@univerjs-pro/thread-comment-datasource"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.UniverPresetDocsThreadComment={},e.UniverDocsThreadCommentUi,e.UniverThreadCommentUi,e.UniverProThreadCommentDatasource))})(this,function(e,n,t,i){"use strict";function o(m={}){const{collaboration:u}=m,r=[t.UniverThreadCommentUIPlugin,n.UniverDocsThreadCommentUIPlugin];return u&&r.push(i.UniverThreadCommentDataSourcePlugin),{plugins:r}}e.UniverDocsThreadCommentPreset=o,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|