@mescius/spread-sheets-threaded-comments 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # SpreadJS Sheets Threaded Comments Module
2
+
3
+ The sheets threaded comments package is one of modules for [SpreadJS](https://developer.mescius.com/spreadjs).
4
+
5
+ For a detailed listing of SpreadJS sub-libraries and plug-ins, please see [Using SpreadJS Libraries](https://developer.mescius.com/spreadjs/docs/getstarted/modules).
6
+
7
+ ## Installation
8
+ ```sh
9
+ npm install @mescius/spread-sheets-threaded-comments
10
+ ```
11
+
12
+ ## Getting more help
13
+ Visit the SpreadJS home page to get more information about the library:
14
+ [https://developer.mescius.com/spreadjs](https://developer.mescius.com/spreadjs)
15
+
16
+ You can ask any question about SpreadJS using the [SpreadJS Forum](https://developer.mescius.com/forums/spreadjs).
@@ -0,0 +1,12 @@
1
+ /*!
2
+ *
3
+ * SpreadJS Library 19.0.0
4
+ *
5
+ * Copyright(c) MESCIUS inc. All rights reserved.
6
+ *
7
+ * Licensed under the SpreadJS Commercial License.
8
+ * us.sales@mescius.com
9
+ * https://developer.mescius.com/spreadjs
10
+ *
11
+ */
12
+ !function(t){var e;"object"==typeof module&&"object"==typeof module.exports?(e=require("@mescius/spread-common"),require("@mescius/spread-sheets-core"),require("@mescius/spread-sheets-comments"),require("@mescius/spread-sheets-components"),module.exports=t(e)):"function"==typeof define&&define.amd?define(["@mescius/spread-common","@mescius/spread-sheets-core","@mescius/spread-sheets-comments","@mescius/spread-sheets-components"],t):"object"==typeof exports?(e=require("@mescius/spread-common"),require("@mescius/spread-sheets-core"),require("@mescius/spread-sheets-comments"),require("@mescius/spread-sheets-components"),exports.Spread=t(e)):t(GC)}((function(t){!function(){"use strict";var e,n={47:function(t,e,n){var i,o,s,r,d,c;n.r(e),n.d(e,{ThreadedCommentViewDialog:function(){return _}}),i=n(376),o=n.n(i),s=n(731),r=n(758),d=n(234),c=n.n(d);const a=new d.Common.ResourceManager(r.SR,"ThreadedComment"),l=a.getResource.bind(a);let u=i.mt.gi,h=i.zc,m=i.GC$;const f="gc.threadedComment.closed",p="left",v="top";class _ extends h{constructor(t,e){let n;super(t,u(t),void 0,!0),this.ter=i.DialogFeatureType.threadedComment,this.zX=e}opo(t,e,n){let i=this,o=t[0];i.Dho&&i.Dho.create&&i.Dho.create(o,e,n)}rQ(t,e,n,i,o){let s=this;s.vpt=o;let r=s.WX(n,i);s.Dho=t,s.opo(r,e,o)}WX(t,e){let n=this,i=n.Xc();return i.css({[p]:t,[v]:e,maxHeight:"",overflow:""}),i.attr({role:"dialog","aria-label":l().Aria_Threaded_Comment_Dialog,"aria-modal":"false"}),i.empty(),super.$c(),n.aY(),i}if(){let t=this,e=t.Wc,n=parseInt(e.css(p),10)||0,i=parseInt(e.css(v),10)||0;if(!t.vpt)return;let o=t.vpt.getActiveSheet();if(!o)return;let s=o.Dg();if(!s)return;let r=s.clientWidth||0,d=s.clientHeight||0;r<=0&&d<=0||requestAnimationFrame((()=>{var s;let c=Number(e.outerWidth())||0,a=Number(e.outerHeight())||0;if(0===c&&0===a)return;let l=n,u=i;const h=_.EDGE_PADDING;if(r>0){if(n+c>r-h){const e=null===(s=t.Dho)||void 0===s?void 0:s.Oho;if(e){const t=e.row(),n=e.col(),i=o.getCellRect(t,n);i&&!isNaN(i.x)?(l=i.x-c,l<h&&(l=h)):l=r-c-h}else l=r-c-h}l<h&&(l=h)}if(d>0){const t=d-2*h;a>t&&(e.css({maxHeight:t,overflowY:"auto",overflowX:"hidden"}),a=t),i+a>d-h&&(u=d-a-h,u<h&&(u=h))}e.css([p,v],[l,u])}))}RRe(t,e){let n=this;if(!n.rf())return;let i=n.Xc();i&&i.length&&(n.bgo&&clearTimeout(n.bgo),n.bgo=window.setTimeout((()=>{i.css([p,v],[t,e]),n.if()}),_.DEBOUNCE_DELAY))}ygo(t,e){if(t.composedPath){const n=t.composedPath(),i=e.id;return n.some((t=>t instanceof HTMLElement&&(!(t!==e&&!t.isSameNode(e))||!(!i||t.id!==i))))}return e.contains(t.target)}aY(){let t=this;t.zX.bind(f,(function(){t.close()}));const e=function(e){let n=t.Xc();n&&n.length&&(t.ygo(e,n.get(0))||t.zX.trigger(s.Threaded_Comment_Schedule_Hide_Event,e))};document.addEventListener("mousedown",e,!0),t.wgo=e,m(document).bind("mousemove."+t.Zc,(function(e){let n=t.Xc();n&&n.length&&t.ygo(e,n.get(0))&&(e.stopPropagation(),t.zX.trigger(s.Threaded_Comment_Schedule_Cancel_Hide_Event,e))})),t.Xc().bind("contextmenu."+t.Zc,(function(t){t.stopPropagation(),t.preventDefault()})),t.Xc().bind("mouseenter."+t.Zc,(function(e){t.zX.trigger(s.Threaded_Comment_Schedule_Cancel_Hide_Event,e)})),m(document).bind("keydown."+t.Zc,(function(e){27===e.keyCode&&t.close()})),m(window).bind("resize."+t.Zc,(function(){let e=t.Xc();e&&e.length&&(t.Mgo&&clearTimeout(t.Mgo),t.Mgo=window.setTimeout((()=>{t.if()}),_.DEBOUNCE_DELAY))}));let n=t.Xc();n&&n.bind(s.Threaded_Comment_View_Display_Updated_Event+"."+t.Zc,t.Rgo.bind(this))}Rgo(){this.if()}KX(){let t=this;t.zX.unbind(f);const e=t.Xc();e&&e.unbind("."+t.Zc),t.wgo&&(document.removeEventListener("mousedown",t.wgo,!0),t.wgo=void 0),m(document).unbind("."+t.Zc),m(window).unbind("resize."+t.Zc),t.bgo&&(clearTimeout(t.bgo),t.bgo=void 0),t.Mgo&&(clearTimeout(t.Mgo),t.Mgo=void 0)}close(){let t=this,e=t.Dho;super.close(),t.KX(),e&&(e.dispose(),t.Dho=void 0),t.Yc(t.Zc)&&m("#"+t.Zc).remove()}}_.EDGE_PADDING=2,_.DEBOUNCE_DELAY=16},51:function(t,e,n){n.r(e),n.d(e,{UndoManager:function(){return o}});var i=n(231);class o{constructor(t){this.Nmt=[],this.kmt=[],this.iwo=0,this.rwo=null,this.owo=!1,this.awo=t,this.uwo=50,this.swo=300}saveState(t,e=!1){if(this.owo)return;const n=Date.now();if(!e&&this.cwo(t,n))return void(this.iwo=n);const i=this.fwo();this.lwo(i),this.iwo=n,this.rwo=t||null}cwo(t,e){return 0!==this.Nmt.length&&(t===this.rwo&&(!(e-this.iwo>this.swo)&&"typing"===t))}fwo(){return{html:this.awo.innerHTML,selection:this.hwo()}}lwo(t){const e=this.Nmt[this.Nmt.length-1];e&&e.html===t.html||(this.Nmt.push(t),this.Nmt.length>this.uwo&&this.Nmt.shift(),this.kmt=[])}undo(){if(!this.canUndo())return!1;this.owo=!0;try{const t=this.fwo();this.kmt.push(t);const e=this.Nmt.pop();return this.dwo(e),!0}finally{this.owo=!1}}redo(){if(!this.canRedo())return!1;this.owo=!0;try{const t=this.fwo();this.Nmt.push(t),this.Nmt.length>this.uwo&&this.Nmt.shift();const e=this.kmt.pop();return this.dwo(e),!0}finally{this.owo=!1}}dwo(t){this.awo.innerHTML=t.html,t.selection&&this.vwo(t.selection),this.awo.dispatchEvent(new CustomEvent("undoredo",{bubbles:!0}))}hwo(){const t=i.DOMUtils.getSelection(this.awo);if(!t||0===t.rangeCount)return null;const e=t.getRangeAt(0),n=this.pwo(e.startContainer),o=this.pwo(e.endContainer);return null===n||null===o?null:{startOffset:e.startOffset,endOffset:e.endOffset,startPath:n,endPath:o}}vwo(t){var e,n;try{const o=i.DOMUtils.getSelection(this.awo);if(!o)return;const s=this.mwo(t.startPath),r=this.mwo(t.endPath);if(!s||!r)return void this.gwo();const d=document.createRange(),c=s.nodeType===Node.TEXT_NODE?(null===(e=s.textContent)||void 0===e?void 0:e.length)||0:s.childNodes.length,a=r.nodeType===Node.TEXT_NODE?(null===(n=r.textContent)||void 0===n?void 0:n.length)||0:r.childNodes.length;d.setStart(s,Math.min(t.startOffset,c)),d.setEnd(r,Math.min(t.endOffset,a)),o.removeAllRanges(),o.addRange(d)}catch(t){this.gwo()}}pwo(t){const e=[];let n=t;if(n===this.awo)return[];for(;n&&n!==this.awo;){const t=n.parentNode;if(!t)return null;const i=Array.from(t.childNodes).indexOf(n);if(-1===i)return null;e.unshift(i),n=t}return n!==this.awo?null:e}mwo(t){if(0===t.length)return this.awo;let e=this.awo;for(const n of t){if(!e.childNodes||n>=e.childNodes.length)return null;e=e.childNodes[n]}return e}gwo(){const t=i.DOMUtils.getSelection(this.awo);if(!t)return;const e=document.createRange();e.selectNodeContents(this.awo),e.collapse(!1),t.removeAllRanges(),t.addRange(e)}canUndo(){return this.Nmt.length>0}canRedo(){return this.kmt.length>0}clear(){this.Nmt=[],this.kmt=[],this.iwo=0,this.rwo=null}getUndoStackSize(){return this.Nmt.length}getRedoStackSize(){return this.kmt.length}isUndoRedoing(){return this.owo}}},116:function(t,e,n){var i,o,s,r;n.r(e),n.d(e,{MentionHandler:function(){return c}}),i=n(637),o=n(231),s=n(234),r=n.n(s);const d=s.Common.UserManager;class c{constructor(t,e,n){this.qdo="",this.tvo=!1,this.nvo=-1,this.evo=null,this.Odo=t,this.ivo=e,this.Jdo=n}get isEditingMention(){return this.tvo}get mentionSelectedIndex(){return this.nvo}onMentionTrigger(){const t=o.DOMUtils.getAllTextNodes(this.Jdo);let e=null;for(let n=t.length-1;n>=0;n--){const i=t[n],s=i.textContent||"",r=s.lastIndexOf("@");if(-1!==r){const t=undefined;if(0===r||r>0&&(/\s/.test(s.charAt(r-1))||s.charAt(r-1)===o.ZERO_WIDTH_CHAR)){e=i;break}}}e&&this.rvo(e)}onMentionEditing(t){this.evo&&queueMicrotask((()=>{this.evo&&this.evo.parentNode||this.ovo(),this.avo()}))}navigateMentionList(t){const e=this.Odo.Sl()||[];0!==e.length&&(this.nvo+=t,this.nvo<0?this.nvo=e.length-1:this.nvo>=e.length&&(this.nvo=0),this.Odo.setSelectedIndex(this.nvo))}selectCurrentMention(){return this.Odo.selectCurrentItem()}insertMention(t){const e=this;if(!e.evo)return;const n=e.evo.textContent||"",s=n.lastIndexOf("@");if(-1===s)return;const r=s+1+e.qdo.length,c=n.substring(0,s),a=n.substring(r);d.ZP(t);const l=o.DOMUtils.createNativeMentionElement({type:i.ContentType.mention,name:t.name,id:t.id}),u=document.createDocumentFragment();c&&u.appendChild(document.createTextNode(c)),u.appendChild(l);const h=document.createTextNode(" ");u.appendChild(h),a&&u.appendChild(document.createTextNode(a));const m=e.evo.parentNode;if(m){const t=Array.from(m.childNodes).indexOf(e.evo);m.replaceChild(u,e.evo),e.exitMentionEditingState(),requestAnimationFrame((()=>{setTimeout((()=>{let n=null;const i=Array.from(m.childNodes);for(let e=t;e<i.length;e++){const t=i[e];if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains("native-mention")&&e+1<i.length){const t=i[e+1];if(t.nodeType===Node.TEXT_NODE){n=t;break}}}if(n&&n.parentNode)e.svo(n,1);else{const t=document.createRange();t.selectNodeContents(e.Jdo),t.collapse(!1);const n=o.DOMUtils.getSelection(e.Jdo);n&&(n.removeAllRanges(),n.addRange(t))}e.Jdo.focus()}),0)}))}}exitMentionEditingState(){this.tvo=!1,this.evo=null,this.qdo="",this.nvo=-1,this.uvo()}positionMentionList(){if(this.evo)try{const t=o.DOMUtils.getSelection(this.Jdo);if(!t||0===t.rangeCount)return;const e=document.createRange(),n=undefined,i=(this.evo.textContent||"").lastIndexOf("@");if(-1===i)return;e.setStart(this.evo,i),e.setEnd(this.evo,i+1);const s=e.getBoundingClientRect(),r=this.ivo.getBoundingClientRect(),{left:d,top:c}=o.DOMUtils.calculateMentionListPosition(s,r);this.ivo.style.left=`${d}px`,this.ivo.style.top=`${c}px`}catch(t){this.cvo()}}rvo(t){this.tvo=!0,this.evo=t,this.qdo="",this.nvo=-1,this.fvo()}ovo(){const t=o.DOMUtils.getSelection(this.Jdo);if(!t||0===t.rangeCount)return void this.exitMentionEditingState();const e=undefined;let n=t.getRangeAt(0).startContainer;if(n.nodeType===Node.ELEMENT_NODE){const t=o.DOMUtils.getAllTextNodes(this.Jdo);for(const e of t)if(e.textContent&&e.textContent.includes("@")){n=e;break}}n.nodeType===Node.TEXT_NODE&&n.textContent&&n.textContent.includes("@")?this.evo=n:this.exitMentionEditingState()}avo(){if(!this.evo)return;const t=this.evo.textContent||"",e=this.lvo();if(-1===e)return void this.exitMentionEditingState();const n=t.lastIndexOf("@",e-1);if(-1===n)return void this.exitMentionEditingState();const i=t.substring(n+1,e);/\s/.test(i)?this.exitMentionEditingState():(this.qdo=i,this.hvo(),this.tvo&&this.positionMentionList())}hvo(){const t=this.qdo.trim().toLowerCase();d.dvo(t).then((t=>{this.Odo.Kbt(t),this.positionMentionList()})).catch((()=>{this.Odo.Kbt([]),this.positionMentionList()})),this.Odo.setSelectedIndex(-1)}fvo(){d.dvo("").then((t=>{this.Odo.Kbt(t),this.positionMentionList()})).catch((()=>{this.Odo.Kbt([]),this.positionMentionList()})),this.ivo.style.display="block",this.positionMentionList()}uvo(){this.ivo.style.display="none"}cvo(){const t=this.Jdo.getBoundingClientRect();this.ivo.style.left=`${t.left}px`,this.ivo.style.top=`${t.bottom+4}px`}lvo(){const t=o.DOMUtils.getSelection(this.Jdo);if(!t||0===t.rangeCount)return-1;const e=t.getRangeAt(0);if(!this.vvo(e))return this.pvo();const n=e.startContainer;return n===this.evo?e.startOffset:n.nodeType===Node.ELEMENT_NODE?this.mvo(n,e.startOffset):n.nodeType===Node.TEXT_NODE&&n.parentNode===this.evo.parentNode?this.gvo(n,e.startOffset):this.pvo()}vvo(t){const e=undefined;let n=t.startContainer;for(;n;){if(n===this.Jdo)return!0;n=n.parentNode}return!1}mvo(t,e){var n;if(!this.evo||!this.evo.parentNode)return-1;const i=this.evo.parentNode,o=undefined,s=Array.from(i.childNodes).indexOf(this.evo);return-1===s?-1:e<=s?0:e>s&&(null===(n=this.evo.textContent)||void 0===n?void 0:n.length)||0}gvo(t,e){var n;if(!this.evo||!this.evo.parentNode)return-1;const i=this.evo.parentNode,o=Array.from(i.childNodes);let s=0;for(const i of o){if(i===this.evo)return s;if(i===t)return s+e;i.nodeType===Node.TEXT_NODE&&(s+=(null===(n=i.textContent)||void 0===n?void 0:n.length)||0)}return-1}pvo(){if(!this.evo)return-1;const t=undefined,e=(this.evo.textContent||"").lastIndexOf("@");return-1===e?-1:this.qdo?e+1+this.qdo.length:e+1}svo(t,e){var n;const i=o.DOMUtils.getSelection(this.Jdo);if(i)try{const o=document.createRange(),s=(null===(n=t.textContent)||void 0===n?void 0:n.length)||0,r=Math.min(e,s);o.setStart(t,r),o.setEnd(t,r),o.collapse(!0),i.removeAllRanges(),i.addRange(o),this.Jdo.focus(),0===i.rangeCount&&i.addRange(o)}catch(t){try{const t=document.createRange();t.selectNodeContents(this.Jdo),t.collapse(!1),i.removeAllRanges(),i.addRange(t),this.Jdo.focus()}catch(t){}}}}},151:function(t,e,n){var i,o,s,r,d,c,a,l;n.r(e),n.d(e,{ThreadedComment:function(){return v}}),i=n(376),o=n.n(i),s=n(788),r=n(780),d=n(234),c=n.n(d),a=n(758),l=n(637);const u=new d.Common.ResourceManager(a.SR,"ThreadedComment"),h=u.getResource.bind(u),m=d.Common.UserManager,f=d.Common.lt.ht;function p(t){if(m&&(t.authorId&&m.get(t.authorId),t.message&&Array.isArray(t.message)))for(const e of t.message)e.type===l.ContentType.mention&&e.userId&&m.get(e.userId)}class v{_ho(t){this.Cdo.addListener(t)}Rho(t){this.Cdo.removeListener(t)}constructor(t,e){this.Mdo=[],this.xdo=!1,this.Cdo=new i.EventNotifier,this.assignId(),this.Mdo=[],this.Ky=t,this.iw=e}row(){return this.Ky}col(){return this.iw}Nho(t){this.Ky=t}jho(t){this.iw=t}add(t){const e=this;if(!t||!Array.isArray(t.message))return null;const n=e.Mdo.length;let i=e.ZP(t);return this.notifyAfterAddReply(i,e,n),i}ZP(t){return this.Eit(this.Mdo.length,t)}Eit(t,e){if(!e||t<0)return null;const n=this.gho(e),i=e;return i.__ID__&&n.UKn(i.__ID__),t>=this.Mdo.length?this.Mdo.push(n):this.Mdo.splice(t,0,n),this.notifyEventChangedInternal(),n}gho(t,e){if(void 0!==e){const n=this.Mdo[e];if(n)return this.createReplyWithExistedReply(t,n)}let n=t.authorId;!n&&m&&(n=m.current(),n||(n=m.Tdo().id,m.current(n)));const i=this.Sdo(t)||new Date,o=new r.Reply({message:t.message,createdAt:i,authorId:n});return p(o),o}Sdo(t){if(t.createdAt){if(t.createdAt instanceof Date)return t.createdAt;if("string"==typeof t.createdAt){const e=new Date(t.createdAt);if(!isNaN(e.getTime()))return e}}return null}get(t){return this.Mdo[t]?(0,r.replyToIReply)(this.Mdo[t]):void 0}Fso(t){return this.Mdo.findIndex((e=>e.jKe()===t))}set(t,e){const n=this,i=n.Mdo[t];if(!i||!e||!Array.isArray(e.message))return;let o=this.notifyBeforeSetReply(n,i);const s=n.Ydn(t,e);this.notifyAfterSetReply(n,t,i,s,o)}Ydn(t,e){const n=this,i=n.Mdo[t],o=this.createReplyWithExistedReply(e,i);return p(o),o.UKn(i.jKe()),n.Mdo[t]=o,this.notifyEventChangedInternal(),o}createReplyWithExistedReply(t,e){return new r.Reply({message:f(t.message)?e.message:t.message,createdAt:this.Sdo(t)||e.createdAt,authorId:t.authorId||e.authorId})}notifyEventChangedInternal(){this.Cdo.notify({eventType:3,threadedComment:this})}notifyInvalidateSheet(){this.Cdo.notify({eventType:4})}all(t){const e=this;return t&&Array.isArray(t)&&t.forEach((t=>{t&&e.ZP({message:t.message,authorId:t.authorId,createdAt:t.createdAt})})),this.Mdo.map((t=>(0,r.replyToIReply)(t)))}_text(){return this.Mdo.map((t=>(0,s.replyToCapabilityCommentText)(t))).join("\n")}remove(t){let e=this;if(t<0||t>=e.Mdo.length)return;const n=e.Mdo[t];let i=this.notifyBeforeRemoveReply(e,t,n),o=e.VP(t);return this.notifyAfterRemoveReply(e,t,i),o}VP(t){const e=this.Mdo.splice(t,1)[0];return this.notifyEventChangedInternal(),e}resolved(t){const e=this;if(void 0===t)return e.xdo||!1;let n=e.xdo;return e.xdo=!!t,this.notifyAfterResolved(e,n),e.xdo}notifyAfterRemoveReply(t,e,n){t.Cdo.notify({eventType:1,type:"removeThreadedCommentReply",id:t.jKe(),index:e,changingContext:n.changingContext})}notifyAfterAddReply(t,e,n){t&&(e.Cdo.notify({eventType:1,type:"addThreadedCommentReply",id:e.jKe(),reply:t,index:n}),e.Cdo.notify({eventType:2,type:"addReply",row:e.Ky,col:e.iw,replyIndex:n,threadedComment:e}))}notifyAfterSetReply(t,e,n,i,o){t.Cdo.notify({eventType:2,type:"setReply",row:t.Ky,col:t.iw,replyIndex:e,reply:n,threadedComment:t}),t.Cdo.notify({eventType:1,type:"updateThreadedCommentReply",id:t.jKe(),reply:i,threadedComment:t,changingContext:o.changingContext})}notifyBeforeSetReply(t,e){let n={eventType:0,type:"updateThreadedCommentReply",id:t.jKe(),oldReply:e,changingContext:void 0};return t.Cdo.notify(n),n}notifyBeforeRemoveReply(t,e,n){t.Cdo.notify({eventType:2,type:"removeReply",row:t.Ky,col:t.iw,replyIndex:e,threadedComment:t,reply:n});let i={eventType:0,type:"removeThreadedCommentReply",reply:n,changingContext:void 0};return t.Cdo.notify(i),i}notifyAfterResolved(t,e){t.Cdo.notify({eventType:1,type:"updateThreadedComment",id:t.jKe(),propName:"resolved",oldValue:e,value:t.xdo}),t.Cdo.notify({eventType:2,type:"property",row:t.Ky,col:t.iw,name:"resolved",value:e,threadedComment:t}),this.notifyEventChangedInternal(),this.notifyInvalidateSheet()}clone(){const t=this,e=new v(t.Ky,t.iw);return e.Mdo=t.Mdo.map((t=>t.clone())),e.xdo=t.xdo,e}toJSON(t){const e=this;let n={replies:e.Mdo.map((e=>e.toJSON(t))),resolved:e.xdo};if(null==t?void 0:t.isServer){let t=n;return t.__ID__=e.jKe(),t.row=e.Ky,t.col=e.iw,t}return n}fromJSON(t){const e=this;e.Mdo=t.replies.map((t=>{const e=new r.Reply;return e.fromJSON(t),p(e),e})),e.xdo=t.resolved;let n=t;n.__ID__&&e.UKn(n.__ID__),n.row&&(e.Ky=n.row),n.col&&(e.iw=n.col)}wh(t,e){const n=this,o=this.Mdo,r=[];if(o.length>0){const d=o[0],c=i.range_parser.jc(new i.Range(n.Ky,n.iw,1,1)),a=(0,s.toSJSThreadedComment)(d,c,t,void 0,n.resolved(),e),l=a.id;r.push(a);for(let n=1;n<o.length;n++){const i=o[n],d=(0,s.toSJSThreadedComment)(i,c,t,l,void 0,e);r.push(d)}}return r}yh(t){const e=this,n=[];for(const e of t){const t=(0,s.fromSJSThreadedComment)(e),i=new r.Reply(t);p(i),n.push(i)}e.Mdo=n}Fho(){let t="";const e=this.Mdo;if(e.length>0){t+=h().CAPBILITY_COMMENT_PREFIX;for(let n=1;n<e.length;n++)t+=`${h().CAPBILITY_REPLY_PREFIX}${(0,s.replyToCapabilityCommentText)(e[n])}\r\n`}return t}L0(){this.Cdo.destroy()}}(0,i.qDr)(v)},185:function(t,e,n){n.r(e),n.d(e,{Indicator_Size:function(){return s},drawThreadedCommentIndicator:function(){return r}});const i="rgb(189, 103, 201)",o="rgb(128, 128, 128)",s=8;function r(t,e,n,r,d,c,a){const l=s*a,u=e+r-l,h=n;t.save(),t.fillStyle=c?i:o,t.beginPath();const m=undefined;[{x:0,y:0},{x:1,y:0},{x:1,y:1},{x:.5,y:.5},{x:0,y:.5}].forEach(((e,n)=>{const i=u+e.x*l,o=h+e.y*l;0===n?t.moveTo(i,o):t.lineTo(i,o)})),t.closePath(),t.fill(),t.restore()}},186:function(t,e,n){var i,o,s,r;n.r(e),n.d(e,{contentBlocksComponentDataToContentBlock:function(){return v},contentBlocksToContentBlockComponentData:function(){return f},threadedCommentToThreadedCommentComponentData:function(){return C},updateCurrentAuthor:function(){return y}}),i=n(234),o=n.n(i),s=n(637),r=n(758);const d=i.Common.UserManager,c=new i.Common.ResourceManager(r.SR,"ThreadedComment"),a=c.getResource.bind(c);function l(t){return{timestamp:t}}function u(t){return{text:t.value,type:s.ContentType.text}}function h(t){const e=d.Hfo(t.userId);return{name:(null==e?void 0:e.name)||a().Guest,id:(null==e?void 0:e.id)||t.userId,type:s.ContentType.mention}}function m(t){if(t)switch(t.type){case s.ContentType.text:return u(t);case s.ContentType.mention:return h(t);case s.ContentType.link:return t}}function f(t){return null==t?void 0:t.map((t=>m(t)))}function p(t){switch(t.type){case s.ContentType.text:return{type:s.ContentType.text,value:t.text};case s.ContentType.mention:return{type:s.ContentType.mention,userId:t.id}}return t}function v(t){return t.map((t=>p(t)))}function _(t,e,n){return{content:f(t.message),timestamp:n?l(t.createdAt):void 0,author:t.authorId,index:e}}function C(t,e,n,i,o,s){const r=t.map(((t,e)=>({reply:t,index:e})));r.sort(((t,e)=>{var n,i;return(null===(n=t.reply.createdAt)||void 0===n?void 0:n.getTime())-(null===(i=e.reply.createdAt)||void 0===i?void 0:i.getTime())}));const d={replies:r.map((t=>_(t.reply,t.index,o))),resolved:n,readOnly:i,isCollapse:s,isActive:o,ref:e};return t.length>0&&(d.replies[0].ref=e),d}function y(t,e){const n=d.Hfo(t);e(n?{id:n.id,name:n.name||a().Guest,email:n.email,avatar:n.avatar,color:n.color}:{id:t,name:a().Guest}),d.get(t).then((t=>{t&&e({name:t.name||a().Guest,email:t.email,avatar:t.avatar,color:t.color})})).catch((t=>{}))}},231:function(t,e,n){n.r(e),n.d(e,{DOMUtils:function(){return d},TextInsertionUtils:function(){return a},URL_REGEX:function(){return s},ZERO_WIDTH_CHAR:function(){return o},normalizeUrl:function(){return r}});var i=n(637);const o="\u200b",s=/^(https?:\/\/[^\s]+|(www|WWW)\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]?\.[a-zA-Z]{2,}(?:\/[^\s]*)?|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]?\.[a-zA-Z]{2,}(?:\/[^\s]*)?|ftp:\/\/[^\s]+|mailto:[^\s]+)$/;function r(t){return t?(t=t.trim(),/^(javascript|data|vbscript):/i.test(t)?"#":/^(https?|ftp|mailto):/i.test(t)?t:/^www\./i.test(t)||/^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]?\.[a-zA-Z]{2,}/.test(t)?"https://"+t:t):t}class d{static getSelection(t){const e=t.getRootNode();if(e&&e!==document){const t=e;if("function"==typeof t.getSelection)return t.getSelection()}return window.getSelection()}static getAllTextNodes(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let i;for(;i=n.nextNode();)e.push(i);return e}static createNativeTextElement(t){const e=t.text||t.value||"";if(!e.includes("\n"))return document.createTextNode(e);const n=document.createDocumentFragment(),i=undefined;return e.split("\n").forEach(((t,e)=>{e>0&&(n.appendChild(document.createElement("br")),n.appendChild(document.createTextNode(o))),t&&n.appendChild(document.createTextNode(t))})),n}static createNativeMentionElement(t){const e=document.createElement("span");return e.className="native-mention",e.textContent=`@${t.name}`,e.contentEditable="false",e.setAttribute("data-mention-id",t.id),e.setAttribute("data-mention-name",t.name),e.setAttribute("data-type","mention"),e}static createNativeHyperlinkElement(t){const e=document.createElement("span");return e.className="native-hyperlink",e.textContent=t.text,e.contentEditable="true",e.setAttribute("data-link-url",t.href),e.setAttribute("data-link-text",t.text),e.setAttribute("data-type","hyperlink"),e}static createNativeElement(t){switch(t.type){case i.ContentType.text:return d.createNativeTextElement(t);case i.ContentType.mention:return d.createNativeMentionElement(t);case i.ContentType.link:return d.createNativeHyperlinkElement(t);default:return null}}static getPreviousNode(t){if(t.startOffset>0){const e=t.startContainer;return e.nodeType===Node.TEXT_NODE?e.previousSibling:e.childNodes[t.startOffset-1]}return t.startContainer.previousSibling}static getNextNode(t){const e=t.startContainer;return e.nodeType===Node.TEXT_NODE?e.nextSibling:e.childNodes[t.startOffset]}static removeHyperlinkHandlers(t){const e=undefined;t.querySelectorAll(".native-hyperlink").forEach((t=>{var e;const n=t.cloneNode(!0);null===(e=t.parentNode)||void 0===e||e.replaceChild(n,t)}))}static calculateMentionListPosition(t,e){const n=window.innerWidth,i=window.innerHeight,o=e.width,s=e.height,r=8;let d=t.left,c=t.bottom+8;return d+o>n-8&&(d=Math.max(8,t.right-o)),d<8&&(d=8),c+s>i-8&&(c=t.top-s-8,c<8&&(c=Math.max(8,Math.min(t.top,i-s-8)))),{left:d,top:c}}}function c(t,e){var n,i;let o=null,s=t.commonAncestorContainer;for(;s&&s!==e;){if(s.nodeType===Node.ELEMENT_NODE){const t=s;if((null===(n=t.classList)||void 0===n?void 0:n.contains("native-mention"))||(null===(i=t.classList)||void 0===i?void 0:i.contains("native-hyperlink"))){o=t;break}}s=s.parentNode}return o}class a{static insertTextAtCursor(t,e){const n=d.getSelection(t);if(!n)return;0!==n.rangeCount&&t.contains(n.focusNode)||a.moveCursorToEnd(t);const i=n.getRangeAt(0);if(i.collapsed||i.deleteContents(),e.includes("\n"))a.insertMultilineText(t,i,e);else{const t=document.createTextNode(e);i.insertNode(t),i.setStartAfter(t),i.setEndAfter(t),n.removeAllRanges(),n.addRange(i)}}static moveCursorToEnd(t){const e=d.getSelection(t);if(!e)return;const n=document.createRange();n.selectNodeContents(t),n.collapse(!1),e.removeAllRanges(),e.addRange(n)}static insertMultilineText(t,e,n){const i=n.split("\n"),s=document.createDocumentFragment();i.forEach(((t,e)=>{e>0&&(s.appendChild(document.createElement("br")),s.appendChild(document.createTextNode(o))),t&&s.appendChild(document.createTextNode(t))}));const r=s.lastChild;e.insertNode(s);const c=d.getSelection(t);if(c&&r){const t=document.createRange();t.setStartAfter(r),t.setEndAfter(r),c.removeAllRanges(),c.addRange(t)}}static getTextAtCursor(t){const e=d.getSelection(t);if(!e||0===e.rangeCount)return{beforeCursor:"",afterCursor:""};const n=e.getRangeAt(0),i=n.commonAncestorContainer;if(i.nodeType===Node.TEXT_NODE){const t=i.textContent||"";return{beforeCursor:t.substring(0,n.startOffset),afterCursor:t.substring(n.endOffset)}}return{beforeCursor:"",afterCursor:""}}static setCursorAfterNode(t,e){const n=e?d.getSelection(e):window.getSelection();if(!n)return;const i=document.createRange();i.setStartAfter(t),i.setEndAfter(t),n.removeAllRanges(),n.addRange(i)}static insertBrForWrapline(t){const e=d.getSelection(t);if(e&&e.rangeCount>0){const n=e.getRangeAt(0),i=c(n,t),s=document.createElement("br"),r=document.createTextNode(o);if(i){const t=i.parentNode;if(t){const e=i.nextSibling;e?(t.insertBefore(s,e),t.insertBefore(r,s.nextSibling)):(t.appendChild(s),t.appendChild(r))}}else n.deleteContents(),n.insertNode(r),n.insertNode(s);const d=document.createRange();d.setStartAfter(r),d.setEndAfter(r),d.collapse(!1),e.removeAllRanges(),e.addRange(d),s.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})}}}},234:function(e){e.exports=t.Spread},243:function(t,e,n){var i,o,s,r,d,c,a,l;n.r(e),n.d(e,{MessageComponent:function(){return m}}),i=n(994),o=n.n(i),s=n(919),r=n(731),d=n(186),c=n(758),a=n(234),l=n.n(a);const u=new a.Common.ResourceManager(c.SR,"ThreadedComment"),h=u.getResource.bind(u);class m extends i.ComponentBase{connectedCallback(){const t=this;t.shadowRoot.innerHTML=`\n <style>\n ${i.CSSUtils.base()}\n .message-container {\n ${i.CSSUtils.columnFlex("center","flex-start")}\n line-height: 1.5;\n }\n .message-header {\n ${i.CSSUtils.rowFlex("space-between","flex-start")}\n width: 100%;\n }\n .message-header > * + * {\n margin-left: 8px;\n }\n .settings-button {\n ${i.CSSUtils.rowFlex()}\n width: 24px;\n height: 24px;\n border: none;\n background: transparent;\n cursor: pointer;\n border-radius: 4px;\n align-items: center;\n justify-content: center;\n transition: opacity 0.2s, background-color 0.2s;\n }\n .settings-button:hover {\n opacity: 1;\n background-color: ${i.CSSVariables.lightGrayBg};\n }\n .settings-button svg {\n width: 16px;\n height: 16px;\n background: transparent;\n }\n .settings-button svg path {\n stroke: ${i.CSSVariables.foreground};\n fill: ${i.CSSVariables.foreground};\n }\n\n .message-operators {\n ${i.CSSUtils.rowFlex("flex-end","center")}\n position: relative;\n overflow: visible;\n flex-shrink: 0;\n }\n .message-operators > * + * {\n margin-left: 12px;\n }\n .message-ref-text {\n --sjs-text-block-font-size: 11px;\n color: ${i.CSSVariables.foreground};\n }\n .message-username {\n --sjs-text-block-font-size: 14px;\n --sjs-text-block-font-weight: 600;\n min-width: 0;\n flex-grow: 1;\n }\n .message-content {\n --sjs-content-blocks-font-size: 12px;\n --sjs-content-blocks-font-weight: 400;\n margin-top: 4px;\n }\n .message-timestamp {\n --sjs-date-time-font-size: 11px;\n --sjs-date-time-font-weight: 400;\n --sjs-date-time-font-opacity: 0.8;\n margin-top: 4px;\n }\n .message-content-container{\n width: 100%;\n }\n </style>\n <div class="message-container" part="message-container">\n <div class="message-header" part="message-header">\n <sjs-text-block class="message-username" part="message-username" break-word="false" ellipsis="true"></sjs-text-block>\n <div class="message-operators" part="message-operators">\n <sjs-text-block class="message-ref-text" part="message-ref-text" display="none" break-word="false"></sjs-text-block>\n </div>\n </div>\n <div class="message-content-container" part="message-content-container">\n </div>\n </div>\n `,t.kvo=t.shadowRoot.querySelector(".message-username"),t.Ivo=t.shadowRoot.querySelector(".message-operators"),t.jvo=t.shadowRoot.querySelector(".message-ref-text"),t._vo=t.shadowRoot.querySelector(".message-content-container"),t.Ldo={}}Kbt(t){this.y4!==t&&(this.y4=t,this.lp=t.index,this.Dvo(),this.Ovo(),this.Evo())}Ovo(){const t=this;if(t.y4&&t.Ivo)if(t.y4.operators&&!t.Rvo){const e=document.createElement("div");e.className="settings-button",e.setAttribute("part","settings-button"),e.setAttribute("role","button"),e.setAttribute("aria-label",h().Aria_More_Options),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"),e.innerHTML=i.Icons.setting,t.Ivo.appendChild(e),t.Rvo=e,t.Lvo()}else!t.y4.operators&&t.Rvo&&(t.Ivo.removeChild(t.Rvo),t.Fvo(),t.Rvo=null)}Dvo(){const t=this;if(t.y4&&t._vo)if(t.Bvo instanceof s.ContentBlocksEditorComponent&&t.Pvo(),t._vo.innerHTML="",this.y4.isEditing){const e=document.createElement("sjs-content-blocks-editor");e.className="message-content",e.setAttribute("part","message-content"),t._vo.appendChild(e),t.Bvo=e,t.Gvo=null,t.Rvo&&(t.Fvo(),t.Ivo.removeChild(t.Rvo),t.Rvo=null),t.Uvo(),t.Bvo.focus()}else{const e=document.createElement("sjs-content-blocks");if(e.className="message-content",e.setAttribute("part","message-content"),t._vo.appendChild(e),t.Bvo=e,t.y4.timestamp){const e=document.createElement("sjs-date-time");e.className="message-timestamp",e.setAttribute("part","message-timestamp"),t._vo.appendChild(e),t.Gvo=e}}}Uvo(){const t=this;t.Ldo[r.Threaded_Comment_Component_Editor_Submit_Event]=e=>{t.y4.content=(0,d.contentBlocksToContentBlockComponentData)(e.detail.contentBlocks),t.y4.isEditing=!1,t.Dvo(),t.Ovo(),t.Evo();const n=new CustomEvent(r.Threaded_Comment_Component_Editor_Submit_Event,{bubbles:!0,detail:{eventType:r.Threaded_Comment_Component_Editor_Submit_Event,model:t.y4,component:t,index:t.lp,contentBlocks:e.detail.contentBlocks}});t.dispatchEvent(n)},t.Bvo.addEventListener(r.Threaded_Comment_Component_Editor_Submit_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Submit_Event]),t.Ldo[r.Threaded_Comment_Component_Editor_Cancel_Event]=e=>{t.y4.isEditing=!1,t.Kbt(Object.assign({},t.y4)),t.dispatchEvent(new CustomEvent(r.Threaded_Comment_Component_Editor_Cancel_Event,{bubbles:!0,detail:{eventType:r.Threaded_Comment_Component_Editor_Cancel_Event,model:t.y4,component:t,index:t.lp}}))},t.Bvo.addEventListener(r.Threaded_Comment_Component_Editor_Cancel_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Cancel_Event])}Pvo(){const t=this;t.Bvo.removeEventListener(r.Threaded_Comment_Component_Editor_Submit_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Submit_Event]),t.Bvo.removeEventListener(r.Threaded_Comment_Component_Editor_Cancel_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Cancel_Event])}Lvo(){var t;const e=this;e.Ldo[r.Threaded_Comment_Component_Settings_Button_Click_Event]=t=>{var n;t.stopPropagation(),(null===(n=e.y4)||void 0===n?void 0:n.operators)&&e.y4.operators.length&&e.dispatchEvent(new CustomEvent(r.Threaded_Comment_Component_Settings_Button_Click_Event,{bubbles:!0,detail:{eventType:r.Threaded_Comment_Component_Settings_Button_Click_Event,model:e.y4,component:e,index:e.lp,operators:e.y4.operators,anchor:e.Rvo}}))},null===(t=e.Rvo)||void 0===t||t.addEventListener("click",e.Ldo[r.Threaded_Comment_Component_Settings_Button_Click_Event])}Fvo(){const t=this;t.Rvo&&t.Rvo.removeEventListener("click",t.Ldo[r.Threaded_Comment_Component_Settings_Button_Click_Event])}handleOperator(t){const e=this;if(!t)return;t===r.Threaded_Comment_Component_Edit_Event&&e.Kbt(Object.assign(Object.assign({},e.y4),{isEditing:!0}));const n=new CustomEvent(t,{bubbles:!0,detail:{eventType:t,model:e.y4,component:e,index:e.lp}});e.dispatchEvent(n)}Evo(){this.y4&&this.kvo&&this.Bvo&&((0,d.updateCurrentAuthor)(this.y4.author,(t=>{this.kvo.Kbt({text:t.name})})),this.Bvo.Kbt(this.y4.content),this.Gvo&&!this.y4.isEditing&&this.Gvo.Kbt(this.y4.timestamp),this.y4.ref?(this.jvo.Kbt({text:this.y4.ref}),this.jvo.style.display="inline-block"):this.jvo.style.display="none")}getContentBlocks(){return this.Bvo}uQ(){var t;return(null===(t=this.y4)||void 0===t?void 0:t.isEditing)||!1}}(0,i.s0r)("sjs-message",m)},255:function(t,e,n){var i,o,s,r,d,c,a,l;n.r(e),n.d(e,{ThreadedCommentComponent:function(){return f}}),i=n(994),o=n.n(i),s=n(234),r=n.n(s),d=n(758),c=n(731),a=n(919),l=n(186);const u=s.Common.UserManager,h=new s.Common.ResourceManager(d.SR,"ThreadedComment"),m=h.getResource.bind(h);class f extends i.ComponentBase{constructor(){super(...arguments),this.Wvo=[],this.Drr=!1,this.xpo=t=>{const e=this;if(!e.Tpo||!e.Tpo.isOpen())return;const n=t.target;e.Tpo.containsNode(n)||e.Tpo.close()}}connectedCallback(){const t="true"===this.getAttribute("inPanel");this.shadowRoot.innerHTML=`\n <style>\n ${i.CSSUtils.base()}\n .threaded-comment-root {\n ${i.CSSUtils.columnFlex("flex-start","flex-start")}\n border-radius: 4px;\n background: ${i.CSSVariables.background};\n box-sizing: border-box;\n outline: none;\n max-height: inherit;\n position: relative;\n overflow: visible;\n }\n .threaded-comment-root > * + * {\n margin-top: 8px;\n }\n .threaded-comment-root-not-active {\n box-shadow: rgba(0, 0, 0, 0.2) 1px 1.5px 3px 1px;\n }\n .threaded-comment-root-not-active:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 16px 0px, rgb(196, 128, 203) 0px 0px 0px 1px;\n }\n .threaded-comment-root-active {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 1px 16px 0px, rgb(196, 128, 203) 0px 0px 0px 3px;\n }\n .replies-container {\n ${i.CSSUtils.columnFlex("flex-start","flex-start")}\n width: 100%;\n ${i.CSSUtils.objToCss(t?{}:{"max-height":"400px","overflow-y":"auto"})}\n flex: 1 1 auto;\n min-height: 0;\n }\n .replies-container > * + * {\n margin-top: 8px;\n }\n .reply-item {\n width: 100%;\n }\n .reply-item:not (:first-child) {\n padding-left: 24px;\n }\n .main-editor {\n width: 100%;\n flex-shrink: 0;\n margin-bottom: 8px;\n }\n .more-replies {\n width: 100%;\n padding-left: 24px;\n font-size: 12px;\n color: ${i.CSSVariables.accent};\n cursor: pointer;\n }\n .padding-container {\n padding: 0 8px;\n width: 100%;\n border-radius: 5px;\n }\n .resolved-title {\n ${i.CSSUtils.rowFlex("space-between","center")};\n border-bottom: 1px solid ${i.CSSVariables.borderColor};\n width: 100%;\n padding: 8px 10px;\n box-sizing: border-box;\n border-radius: 5px 5px 0 0;\n }\n .resolved-title-left {\n ${i.CSSUtils.rowFlex("flex-start","center")};\n }\n .resolved-title-right {\n ${i.CSSUtils.rowFlex("flex-start","center")};\n }\n .resolved-title-label {\n font-size: 14px;\n margin-left: 4px;\n font-weight: 600;\n }\n .resolved-title-delete {\n margin-left: 6px;\n }\n .resolved-title-resolve svg,\n .resolved-title-reopen svg,\n .resolved-title-delete svg {\n width: 18px;\n height: 18px;\n margin-top: 1px;\n }\n .resolved-title-reopen svg path,\n .resolved-title-delete svg path {\n stroke: ${i.CSSVariables.foreground};\n fill: ${i.CSSVariables.foreground};\n }\n .resolved-title-resolve svg g polyline {\n stroke: ${i.CSSVariables.foreground};\n fill: ${i.CSSVariables.foreground};\n }\n .resolved-title-reopen svg,\n .resolved-title-delete svg {\n cursor: pointer;\n }\n .resolved-title-reopen svg path,\n .resolved-title-delete svg path {\n stroke: ${i.CSSVariables.foreground};\n fill: ${i.CSSVariables.foreground};\n }\n .resolved-title-resolve,\n .resolved-title-reopen,\n .resolved-title-delete {\n height: 18px;\n }\n .resolved-title {\n display: none;\n }\n .resolved-title.show {\n display: flex;\n }\n .sticky-title {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10;\n padding: 4px 8px;\n border-bottom: 1px solid ${i.CSSVariables.borderColor};\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n display: none;\n opacity: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n }\n .sticky-title.visible {\n opacity: 1;\n pointer-events: auto;\n }\n .sticky-title-content {\n ${i.CSSUtils.rowFlex("flex-end","center")}\n width: 100%;\n }\n .sticky-title-ref {\n --sjs-text-block-font-size: 11px;\n color: ${i.CSSVariables.foreground};\n opacity: 0.7;\n flex-shrink: 0;\n margin-right: 8px;\n }\n .sticky-title-settings {\n ${i.CSSUtils.rowFlex()}\n width: 24px;\n height: 24px;\n border: none;\n background: transparent;\n cursor: pointer;\n border-radius: 4px;\n align-items: center;\n justify-content: center;\n opacity: 0.7;\n transition: opacity 0.2s, background-color 0.2s;\n flex-shrink: 0;\n }\n .sticky-title-settings svg {\n width: 16px;\n height: 16px;\n }\n .sticky-title-settings svg path {\n fill: ${i.CSSVariables.foreground};\n stroke: ${i.CSSVariables.foreground};\n opacity: 1;\n }\n .threaded-comment-menu {\n background-color: transparent;\n }\n </style>\n <div class="threaded-comment-root threaded-comment-root-not-active" part="threaded-comment-root" tabIndex="-1" role="article" aria-label="${m().Aria_Threaded_Comment}">\n <div class="resolved-title" part="resolved-title" role="banner" aria-label="${m().Aria_Resolved_Comment}">\n <div class="resolved-title-left" part="resolved-title-left">\n <div class="resolved-title-resolve" aria-hidden="true">\n ${i.Icons.resolve}\n </div>\n <div class="resolved-title-label">\n ${m().RESOLVED}\n </div>\n </div>\n <div class="resolved-title-right" part="resolved-title-right">\n <div class="resolved-title-reopen" aria-label="${m().Reopen_Thread}" role="button">\n ${i.Icons.reopen}\n </div>\n <div class="resolved-title-delete" aria-label="${m().Delete_Thread}" role="button">\n ${i.Icons.deleteInThreadedCommentView}\n </div>\n </div>\n </div>\n <div class="padding-container">\n <div class="sticky-title" part="sticky-title">\n <div class="sticky-title-content">\n <sjs-text-block class="sticky-title-ref" part="sticky-title-ref"></sjs-text-block>\n <div class="sticky-title-settings" part="sticky-title-settings" role="button" aria-label="${m().Aria_More_Options}" aria-haspopup="true" aria-expanded="false">\n ${i.Icons.setting}\n </div>\n </div>\n </div>\n <div class="replies-container" part="replies-container"></div>\n </div>\n <div class="padding-container">\n <sjs-content-blocks-editor class='main-editor'></sjs-content-blocks-editor>\n </div>\n <sjs-threaded-comment-menu class='threaded-comment-menu' part='threaded-comment-menu'></sjs-threaded-comment-menu>\n </div>\n `,this.Qvo=this.shadowRoot.querySelector(".threaded-comment-root"),this.Kvo=this.shadowRoot.querySelector(".replies-container"),this.Jvo=this.shadowRoot.querySelector(".main-editor"),this.Tpo=this.shadowRoot.querySelector(".threaded-comment-menu"),this.Spo=this.shadowRoot.querySelector(".resolved-title"),this.Apo=this.shadowRoot.querySelector(".resolved-title-reopen"),this.kpo=this.shadowRoot.querySelector(".resolved-title-delete"),this.jgo=this.shadowRoot.querySelector(".sticky-title"),this.Lgo=this.shadowRoot.querySelector(".sticky-title-ref"),this.Fgo=this.shadowRoot.querySelector(".sticky-title-settings"),this.E3t(),this.Zvo()}Zvo(){const t=this;if(t.Qvo.addEventListener("click",(e=>{t.xpo(e),t.Xvo(!0),t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Activate_Event,{bubbles:!0,detail:e.detail}))})),t.Qvo.addEventListener("mousedown",(e=>{t.Bgo(e)})),t.Qvo.addEventListener("keydown",(e=>{t.Jvo.shadowRoot.host.contains(e.target)||("Enter"!==e.key||e.ctrlKey)&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key&&" "!==e.key||t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Collapse_Event,{bubbles:!0,detail:{changeCollapseState:!0}}))})),t.Qvo.addEventListener(c.Threaded_Comment_Component_Settings_Button_Click_Event,(e=>{e.stopPropagation(),t.Ipo(e.detail)})),t.Tpo.addEventListener(c.Threaded_Comment_Menu_Command_Event,(e=>{e.stopPropagation(),t._po(e.detail)})),t.Kvo){const e=undefined;c.All_Threaded_Comment_Component_Events.forEach((e=>{t.Kvo.addEventListener(e,(n=>{e===c.Threaded_Comment_Component_Resolve_Event&&(t.Kvo.scrollTop=0),t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n.detail}))}))}))}t.Jvo&&(t.Jvo.addEventListener(c.Threaded_Comment_Component_Editor_Submit_Event,(e=>{t.y4.replies.push({index:t.y4.replies.length,content:(0,l.contentBlocksToContentBlockComponentData)(e.detail.contentBlocks),author:u.current(),timestamp:{timestamp:new Date},ref:0===t.y4.replies.length?t.y4.ref:void 0}),t.E3t(),t.Kvo&&(t.Kvo.scrollTop=t.Kvo.scrollHeight),t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Editor_Submit_Event,{bubbles:!0,detail:Object.assign(Object.assign({},e.detail),{index:-1})}))})),t.Jvo.addEventListener(c.Threaded_Comment_Component_Editor_Cancel_Event,(e=>{t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Editor_Cancel_Event,{bubbles:!0,detail:Object.assign(Object.assign({},e.detail),{index:-1})}))})),t.Jvo.addEventListener(c.Threaded_Comment_Component_Edit_Event,(e=>{t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Edit_Event,{bubbles:!0,detail:e.detail}))})))}Xvo(t){const e=this;t?(e.Qvo.classList.remove("threaded-comment-root-not-active"),e.Qvo.classList.add("threaded-comment-root-active")):(e.Qvo.classList.remove("threaded-comment-root-active"),e.Qvo.classList.add("threaded-comment-root-not-active"))}Bgo(t){const e=undefined,n=this.Pgo(),i=t.composedPath(),o=n.find((t=>i.includes(t)));n.forEach((t=>{t!==o&&t.isEditingMention()&&t.exitMentionEditingState()}))}Pgo(){const t=this,e=[];return t.Jvo&&e.push(t.Jvo),t.Wvo.forEach((t=>{var n;const i=null===(n=t.getMessage())||void 0===n?void 0:n.getContentBlocks();i instanceof a.ContentBlocksEditorComponent&&e.push(i)})),e}Ggo(){var t;const e=this;e.Ugo(),(null===(t=e.y4)||void 0===t?void 0:t.replies)&&0!==e.y4.replies.length&&requestAnimationFrame((()=>{const t=e.Kvo.querySelector(".reply-item:first-child");t&&(e.Hgo=new IntersectionObserver((t=>{t.forEach((t=>{const n=e.Kvo.scrollTop>0;t.intersectionRatio<1&&n?e.Vgo():e.zgo()}))}),{root:e.Kvo,threshold:[0,1],rootMargin:"0px 0px 0px 0px"}),e.Hgo.observe(t),e.Ygo(),e.Zgo())}))}Vgo(){const t=this;t.jgo&&(t.jgo.style.display="block",t.jgo.offsetWidth,t.jgo.classList.add("visible"))}zgo(){const t=this;t.jgo&&(t.jgo.classList.remove("visible"),setTimeout((()=>{t.jgo.classList.contains("visible")||(t.jgo.style.display="none")}),200))}Zgo(){var t;const e=this;if(!(null===(t=e.y4)||void 0===t?void 0:t.replies)||0===e.y4.replies.length)return;const n=e.y4.replies[0];e.Lgo&&n.ref&&e.Lgo.Kbt({text:n.ref})}Ygo(){var t,e;const n=this;n.Wgo&&(null===(t=n.Fgo)||void 0===t||t.removeEventListener("click",n.Wgo)),n.Wgo=t=>{t.stopPropagation();const e=n.Wvo[0];if(!e)return;const o=[{event:c.Threaded_Comment_Component_Comment_Delete_Event,icon:i.Icons.deleteInThreadedCommentView,text:m().Delete_Thread},{event:c.Threaded_Comment_Component_Resolve_Event,text:m().Resolve_Thread,icon:i.Icons.resolve}],s=e.Yvo;s&&n.Qvo.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Settings_Button_Click_Event,{bubbles:!0,detail:{eventType:c.Threaded_Comment_Component_Settings_Button_Click_Event,component:s,index:0,operators:o,anchor:n.Fgo}}))},null===(e=n.Fgo)||void 0===e||e.addEventListener("click",n.Wgo)}Ugo(){var t;const e=this;e.Hgo&&(e.Hgo.disconnect(),e.Hgo=null),e.Wgo&&(null===(t=e.Fgo)||void 0===t||t.removeEventListener("click",e.Wgo),e.Wgo=null),e.zgo()}setValue(t){this.y4!==t&&(this.y4=t,this.E3t())}E3t(){const t=this;if(t.y4&&t.Kvo){if(t.Tpo.close(),t.Dpo(),t.$vo()&&!t.y4.resolved)return t.Xvo(t.y4.isActive),void t.qvo();t.tpo(),t.Xvo(t.y4.isActive),t.npo(),t.epo()}}qvo(){const t=this;if(!t.y4||!t.y4.replies||!t.y4.replies.length)return;if(t.Drr){const e=t.Kvo.querySelector(".more-replies");if(e){t.Kvo.removeChild(e),t.Drr=!1;for(let e=1;e<t.y4.replies.length-1;e++){const n=t.ipo(t.y4.replies[e],e,t.y4.resolved,t.y4.readOnly);n&&t.Kvo.insertBefore(n,t.Kvo.lastChild)}if(t.Wvo.length>2){const e=t.Wvo[1];t.Wvo.splice(1,1),t.Wvo.push(e)}}}const e=t.Wvo.length;for(let n=0;n<t.y4.replies.length;n++)if(n<e){const e=t.Wvo[n];e&&!e.uQ()&&t.ipo(t.y4.replies[n],n,t.y4.resolved,t.y4.readOnly,e)}else{const e=t.ipo(t.y4.replies[n],n,t.y4.resolved,t.y4.readOnly);e&&t.Kvo.appendChild(e)}for(;t.Wvo.length>t.y4.replies.length;)t.Kvo.removeChild(t.Kvo.lastChild),t.Wvo.pop();t.Ggo()}$vo(){return this.Wvo.some((t=>(null==t?void 0:t.uQ())||!1))}tpo(){for(this.Wvo.length=0;this.Kvo.firstChild;)this.Kvo.removeChild(this.Kvo.firstChild)}npo(){const t=this;if(!t.y4||!t.y4.replies||!t.y4.replies.length){const e=document.createElement("div");e.className="reply-item",e.style.position="relative";const n=document.createElement("sjs-reply");return n.Kbt({author:u.current(),content:[],index:0,ref:t.y4.ref}),e.appendChild(n),t.Wvo.push(n),void t.Kvo.appendChild(e)}const e=t.ipo(t.y4.replies[0],0,t.y4.resolved,t.y4.readOnly);if(e&&t.Kvo.appendChild(e),t.Drr=t.y4.isCollapse,t.rpo(),t.y4.isCollapse){if(t.y4.replies.length>1){let e=t.y4.replies.length-1;const n=t.ipo(t.y4.replies[t.y4.replies.length-1],e,t.y4.resolved,t.y4.readOnly);n&&t.Kvo.appendChild(n)}}else for(let e=1;e<t.y4.replies.length;e++){const n=t.ipo(t.y4.replies[e],e,t.y4.resolved,t.y4.readOnly);n&&t.Kvo.appendChild(n)}t.Ggo()}ipo(t,e,n,o,s){var r;const d=document.createElement("div");d.className="reply-item",d.style.position="relative",(null===(r=this.y4)||void 0===r?void 0:r.isCollapse)&&(t=Object.assign(Object.assign({},t),{timestamp:void 0})),o?0!==e&&(d.style.paddingLeft="24px"):0===e?n||(t.operators=[],u.current()===t.author&&t.operators.push({event:c.Threaded_Comment_Component_Edit_Event,icon:i.Icons.edit,text:m().Edit_Comment}),t.operators.push({event:c.Threaded_Comment_Component_Comment_Delete_Event,icon:i.Icons.deleteInThreadedCommentView,text:m().Delete_Thread}),t.operators.push({event:c.Threaded_Comment_Component_Resolve_Event,text:m().Resolve_Thread,icon:i.Icons.resolve})):(n||(t.operators=[],u.current()===t.author&&t.operators.push({event:c.Threaded_Comment_Component_Edit_Event,icon:i.Icons.edit,text:m().Edit_Comment}),t.operators.push({event:c.Threaded_Comment_Component_Reply_Delete_Event,icon:i.Icons.deleteInThreadedCommentView,text:m().Delete_Comment})),d.style.paddingLeft="24px");const a=s||document.createElement("sjs-reply");if(a.Kbt(t),!s)return this.Wvo.push(a),d.appendChild(a),d}rpo(){const t=this;if(t.y4.replies.length>2&&t.y4.isCollapse){const e=document.createElement("div");e.className="more-replies",e.textContent=`${t.y4.replies.length-2} ${m().More_Replies}`,t.Kvo.appendChild(e),e.addEventListener("click",(e=>{t.y4.isCollapse=!1,t.E3t()}))}}epo(){!this.y4||this.y4.readOnly||this.y4.resolved?this.Jvo&&(this.Jvo.style.display="none"):this.Jvo&&(this.Jvo.style.display="block",0===this.y4.replies.length?this.Jvo.setPlaceholder(m().Comment_Editor_Placeholder):this.Jvo.setPlaceholder(m().Reply_Editor_Placeholder))}Ipo(t){var e;const n=this;if(!t)return;const i=t.operators,o=t.anchor,s=t.component;if(!i||!i.length||!o||!s||t.index===(null===(e=n.Tpo.DJ)||void 0===e?void 0:e.index)&&n.Tpo.isOpen())return void n.Tpo.close();const r=n.Qvo.getBoundingClientRect(),d=o.getBoundingClientRect(),c="number"==typeof t.index?t.index:-1;n.Tpo.open({items:i,anchorRect:d,containerRect:r,context:{component:s,index:c}})}_po(t){if(!t)return;const{eventName:e,context:n}=t;this.Tpo.close();const i=null==n?void 0:n.component;i&&"function"==typeof i.handleOperator&&i.handleOperator(e)}startEdit(){const t=this.Jvo;t&&(t.style.display="block",requestAnimationFrame((()=>{t.showButtons(),t.focus()})))}Dpo(){const t=this;t.Spo&&(t.y4.resolved?(t.Spo.classList.add("show"),t.Opo()):(t.Spo.classList.remove("show"),t.Epo()))}Opo(){const t=this;t.Apo&&t.kpo&&(t.Epo(),t.Rpo=e=>{e.stopPropagation(),t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Reopen_Event,{bubbles:!0,detail:e.detail}))},t.Lpo=e=>{e.stopPropagation(),t.dispatchEvent(new CustomEvent(c.Threaded_Comment_Component_Comment_Delete_Event,{bubbles:!0,detail:e.detail}))},t.Apo.addEventListener("click",t.Rpo),t.kpo.addEventListener("click",t.Lpo))}Epo(){const t=this;t.Apo&&t.kpo&&(t.Rpo&&(t.Apo.removeEventListener("click",t.Rpo),t.Rpo=null),t.Lpo&&(t.kpo.removeEventListener("click",t.Lpo),t.Lpo=null))}disconnectedCallback(){this.Tpo.close(),this.Wvo.length=0,this.Epo(),this.Ugo()}}(0,i.s0r)("sjs-threaded-comment",f)},262:function(t,e,n){n.r(e),n.d(e,{Aria_Active_Filters:function(){return j},Aria_Comment_At_Position:function(){return O},Aria_Comment_Options_Menu:function(){return E},Aria_Comment_Reply:function(){return $},Aria_Comments_List:function(){return S},Aria_Filter_Comments:function(){return B},Aria_Filter_Options:function(){return M},Aria_More_Options:function(){return R},Aria_Resolved_Comment:function(){return A},Aria_Threaded_Comment:function(){return N},Aria_Threaded_Comment_Dialog:function(){return I},CAPBILITY_COMMENT_PREFIX:function(){return s},CAPBILITY_REPLY_PREFIX:function(){return r},Comment_Editor_Placeholder:function(){return m},Delete_Comment:function(){return c},Delete_Thread:function(){return a},Edit_Comment:function(){return d},Filter_Active_Only:function(){return g},Filter_By:function(){return k},Filter_Mentions_Me:function(){return T},Filter_Reset_All:function(){return w},Filter_Resolved_Only:function(){return x},Guest:function(){return f},Items_Text:function(){return C},More_Replies:function(){return p},New_Button:function(){return _},Panel_Title:function(){return v},RESOLVED:function(){return i},Reopen_Thread:function(){return u},Reply_Editor_Placeholder:function(){return h},Resolve_Thread:function(){return l},Return_To_First_Comment:function(){return b},See_More_Comments:function(){return y},UNRESOLVED:function(){return o}});const i="Resolved",o="Unresolved",s="[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\r\n",r="Reply:\r\n",d="Edit Comment",c="Delete Comment",a="Delete Thread",l="Resolve Thread",u="Reopen Thread",h="@mention or reply",m="@mention or comment",f="Guest",p="more replies",v="Threaded Comments",_="New",C="items",y="See more comments",b="Return to first comment",g="Active Only",x="Resolved Only",T="@mentions Me",w="Reset All",k="Filter By",E="Threaded comment options menu",N="Threaded comment",A="Resolved threaded comment",$="Threaded comment reply",R="More options",I="Threaded comment dialog",S="Threaded comments list",O="Threaded comment at row {0}, column {1}",B="Filter threaded comments",M="Filter options",j="Active filters"},311:function(t,e,n){var i,o,s,r,d,c;n.r(e),n.d(e,{ContentBlocksEditorComponent:function(){return i.ContentBlocksEditorComponent},DOMUtils:function(){return d.DOMUtils},EDITOR_STYLES:function(){return c.EDITOR_STYLES},EDITOR_TEMPLATE:function(){return c.EDITOR_TEMPLATE},EventHandlers:function(){return r.EventHandlers},LinkHandler:function(){return s.LinkHandler},MentionHandler:function(){return o.MentionHandler}}),i=n(919),o=n(116),s=n(606),r=n(925),d=n(231),c=n(961)},338:function(t,e,n){var i,o,s,r;n.r(e),n.d(e,{ThreadedCommentNavigateButton:function(){return a}}),i=n(758),o=n(234),s=n.n(o),r=n(670);const d=new o.Common.ResourceManager(i.SR,"ThreadedComment"),c=d.getResource.bind(d);class a{constructor(t){const e=this;e.En(),t.appendChild(e.RS)}En(){const t=this;t.RS=document.createElement("div"),t.RS.className=r.CSS_CLASSES.NAVIGATE_CONTAINER,t.RS.style.display=r.STYLES.DISPLAY_NONE,t.RS.setAttribute("role","button"),t.RS.setAttribute("aria-label",c().See_More_Comments),t.RS.innerHTML=`\n <span class="${r.CSS_CLASSES.NAVIGATE_TEXT}">\n ${c().See_More_Comments}\n </span>\n <div class="${r.CSS_CLASSES.NAVIGATE_ICON}" aria-hidden="true"></div>\n `}sdo(t){this.RS.style.display=t?r.STYLES.DISPLAY_FLEX:r.STYLES.DISPLAY_NONE}udo(t){const e=this.RS.querySelector(`.${r.CSS_CLASSES.NAVIGATE_TEXT}`),n=t?c().Return_To_First_Comment:c().See_More_Comments;e&&(e.textContent=n),this.RS.setAttribute("aria-label",n)}L0(){this.RS.innerHTML=""}}},344:function(t,e,n){var i,o,s,r,d,c;n.r(e),n.d(e,{ContentBlocksComponent:function(){return i.ContentBlocksComponent},ContentBlocksEditorComponent:function(){return o.ContentBlocksEditorComponent},MessageComponent:function(){return s.MessageComponent},ReplyComponent:function(){return r.ReplyComponent},ThreadedCommentComponent:function(){return c.ThreadedCommentComponent},ThreadedCommentMenuComponent:function(){return d.ThreadedCommentMenuComponent}}),i=n(752),o=n(311),s=n(243),r=n(860),d=n(711),c=n(255),n(752),n(311),n(243),n(860),n(711),n(255)},352:function(t,e,n){var i,o,s,r,d;n.r(e),n.d(e,{ThreadedCommentFilterDropdown:function(){return l},ThreadedCommentFilterType:function(){return d}}),i=n(758),o=n(234),s=n.n(o),r=n(670);const c=new o.Common.ResourceManager(i.SR,"ThreadedComment"),a=c.getResource.bind(c);!function(t){t[t.None=0]="None",t[t.MentionsMe=1]="MentionsMe",t[t.ActiveOnly=2]="ActiveOnly",t[t.ResolvedOnly=4]="ResolvedOnly"}(d||(d={}));class l{constructor(t){this.tF=!1,this.tdo=d.None,this.En(),t.appendChild(this.RS)}En(){const t=this;t.RS=document.createElement("div"),t.RS.className=r.CSS_CLASSES.FILTER_CONTAINER,t.RS.innerHTML=`\n <button class="${r.CSS_CLASSES.FILTER_BUTTON}" aria-label="${a().Aria_Filter_Comments}" aria-haspopup="true" aria-expanded="false">\n <span class="${r.CSS_CLASSES.FILTER_ICON}" aria-hidden="true"></span>\n <span class="${r.CSS_CLASSES.FILTER_BADGE}" style="display: none;" aria-label="${a().Aria_Active_Filters}"></span>\n </button>\n <div class="${r.CSS_CLASSES.FILTER_DROPDOWN}" style="display: none;" role="menu" aria-label="${a().Aria_Filter_Options}">\n <div class="${r.CSS_CLASSES.FILTER_SECTION}">\n <div class="${r.CSS_CLASSES.FILTER_OPTION}" ${r.ATTRIBUTES.DATA_FILTER}="${d.None}" role="menuitem" aria-label="${a().Filter_Reset_All}">\n <span class="${r.CSS_CLASSES.FILTER_CLEAR_ICON} ${r.CSS_CLASSES.FILTER_OPTION_ICON_DISABLED}" aria-hidden="true"></span>\n <span class="${r.CSS_CLASSES.FILTER_RESET_TEXT}">${a().Filter_Reset_All}</span>\n </div>\n </div>\n <div class="${r.CSS_CLASSES.FILTER_DIVIDER}" role="separator"></div>\n <div class="${r.CSS_CLASSES.FILTER_SEPARATOR}" role="presentation">${a().Filter_By}</div>\n <div class="${r.CSS_CLASSES.FILTER_SECTION}">\n <div class="${r.CSS_CLASSES.FILTER_OPTION}" ${r.ATTRIBUTES.DATA_FILTER}="${d.MentionsMe}" role="menuitemcheckbox" aria-checked="false" aria-label="${a().Filter_Mentions_Me}">\n <span class="${r.CSS_CLASSES.FILTER_CHECKBOX}" aria-hidden="true"></span>\n <span>${a().Filter_Mentions_Me}</span>\n </div>\n </div>\n <div class="${r.CSS_CLASSES.FILTER_DIVIDER}" role="separator"></div>\n <div class="${r.CSS_CLASSES.FILTER_SECTION}">\n <div class="${r.CSS_CLASSES.FILTER_OPTION}" ${r.ATTRIBUTES.DATA_FILTER}="${d.ActiveOnly}" role="menuitemcheckbox" aria-checked="false" aria-label="${a().Filter_Active_Only}">\n <span class="${r.CSS_CLASSES.FILTER_CHECKBOX}" aria-hidden="true"></span>\n <span>${a().Filter_Active_Only}</span>\n </div>\n <div class="${r.CSS_CLASSES.FILTER_OPTION}" ${r.ATTRIBUTES.DATA_FILTER}="${d.ResolvedOnly}" role="menuitemcheckbox" aria-checked="false" aria-label="${a().Filter_Resolved_Only}">\n <span class="${r.CSS_CLASSES.FILTER_CHECKBOX}" aria-hidden="true"></span>\n <span>${a().Filter_Resolved_Only}</span>\n </div>\n </div>\n </div>\n `,t.lar=t.RS.querySelector(`.${r.CSS_CLASSES.FILTER_BUTTON}`),t.ndo=t.RS.querySelector(`.${r.CSS_CLASSES.FILTER_DROPDOWN}`),t.fgo=t.RS.querySelector(`.${r.CSS_CLASSES.FILTER_BADGE}`)}edo(t){const e=this;t===d.None?e.tdo=d.None:t===d.ActiveOnly||t===d.ResolvedOnly?e.tdo&t?e.tdo&=~t:(t===d.ActiveOnly?e.tdo&=~d.ResolvedOnly:e.tdo&=~d.ActiveOnly,e.tdo|=t):e.tdo^=t,e.ido()}lgo(){const t=this;let e=0;return t.tdo&d.MentionsMe&&e++,t.tdo&d.ActiveOnly&&e++,t.tdo&d.ResolvedOnly&&e++,e}hgo(){const t=this,e=t.lgo();e>0?(t.fgo.textContent=e.toString(),t.fgo.style.display="inline-block",t.lar.classList.add(r.CSS_CLASSES.FILTER_BUTTON_ACTIVE)):(t.fgo.style.display="none",t.lar.classList.remove(r.CSS_CLASSES.FILTER_BUTTON_ACTIVE))}ido(){const t=this,e=undefined;t.ndo.querySelectorAll(`.${r.CSS_CLASSES.FILTER_OPTION}`).forEach((e=>{const n=parseInt(e.getAttribute(r.ATTRIBUTES.DATA_FILTER),10),i=undefined;if(e.querySelector(`.${r.CSS_CLASSES.FILTER_CHECKBOX}`)&&n!==d.None){const i=0!==(t.tdo&n);e.setAttribute("aria-checked",i?"true":"false"),i?(e.classList.add(r.CSS_CLASSES.FILTER_OPTION_CHECKED),e.classList.remove(r.CSS_CLASSES.FILTER_OPTION_UNCHECKED)):(e.classList.add(r.CSS_CLASSES.FILTER_OPTION_UNCHECKED),e.classList.remove(r.CSS_CLASSES.FILTER_OPTION_CHECKED))}if(n===d.None){const n=e,i=n.children[0];t.tdo===d.None?(i.classList.remove(r.CSS_CLASSES.FILTER_OPTION_ICON_ENABLED),i.classList.add(r.CSS_CLASSES.FILTER_OPTION_ICON_DISABLED),n.style.pointerEvents=r.STYLES.POINTER_EVENTS_NONE,n.setAttribute("aria-disabled","true")):(i.classList.remove(r.CSS_CLASSES.FILTER_OPTION_ICON_DISABLED),i.classList.add(r.CSS_CLASSES.FILTER_OPTION_ICON_ENABLED),n.style.pointerEvents=r.STYLES.POINTER_EVENTS_AUTO,n.setAttribute("aria-disabled","false"))}})),t.hgo()}rdo(){this.tF?this.odo():this.ado()}ado(){this.ndo.style.display=r.STYLES.DISPLAY_BLOCK,this.lar.setAttribute("aria-expanded","true"),this.tF=!0,this.ido()}odo(){this.ndo.style.display=r.STYLES.DISPLAY_NONE,this.lar.setAttribute("aria-expanded","false"),this.tF=!1}X7e(t){this.tdo=t,this.ido()}Iwn(){return this.tdo}L0(){this.RS.innerHTML=""}}},376:function(e){e.exports=t.Spread.Sheets},405:function(t,e,n){var i,o,s,r,d,c,a,l,u;n.r(e),n.d(e,{All_Threaded_Comment_Component_Events:function(){return y},ThreadedCommentPanel:function(){return b},Threaded_Comment_Panel_Filter_Event:function(){return _},Threaded_Comment_Panel_Namespace:function(){return p},Threaded_Comment_Panel_Navigate_Event:function(){return C},Threaded_Comment_Panel_New_Event:function(){return v}}),i=n(352),o=n(642),s=n(338),r=n(670),d=n(376),c=n.n(d),a=n(758),l=n(234),u=n.n(l);const h=new l.Common.ResourceManager(a.SR,"ThreadedComment"),m=h.getResource.bind(h),f="threadedCommentPanel",p=".threadedCommentPanel",v="threaded_comment_panel_new_event",_="threaded_comment_panel_filter_event",C="threaded_comment_panel_navigate_event",y=[v,_,C];class b{constructor(t,e){this.xbo=!1;const n=this;n.Ti="string"==typeof t?document.getElementById(t):t,n.Ti&&(n.refresh=n.refresh.bind(n),n.attach=n.attach.bind(n),n.detach=n.detach.bind(n),n.cdo=n.cdo.bind(n),n.fdo=n.fdo.bind(n),n.ldo=n.ldo.bind(n),n.hdo=n.hdo.bind(n),n.ddo=n.ddo.bind(n),n.vdo(),n.Ti[f]=n,n.attach(e))}vdo(){const t=this;t.Ti.className=r.CSS_CLASSES.PANEL_HOST,t.Ti.setAttribute(r.ATTRIBUTES.TABINDEX,r.ATTRIBUTE_VALUES.TABINDEX_FOCUSABLE),t.Ti.setAttribute("role","region"),t.Ti.setAttribute("aria-label",m().Panel_Title||"Threaded Comments"),t.Ti.style.outline="none";const e="true"===t.Ti.getAttribute("hidden-title");t.Ti.innerHTML=`\n <div class="${r.CSS_CLASSES.PANEL_SIDE_PANEL}">\n <div class="${r.CSS_CLASSES.PANEL_FIXED_HEADER}" role="banner">\n <div class="${r.CSS_CLASSES.PANEL_TITLE}" ${e?'style="display: none;"':""}>${m().Panel_Title}</div>\n <div class="${r.CSS_CLASSES.TAB_BUTTONS}">\n <button class="${r.CSS_CLASSES.TAB_SHOW_BUTTON}" aria-label="${m().New_Button}" role="button">\n <span class="${r.CSS_CLASSES.NEW_BUTTON_ICON}" aria-hidden="true"></span>\n <span>${m().New_Button}</span>\n </button>\n <sjs-text-block class="${r.CSS_CLASSES.TAB_ITEM_TEXT}" aria-live="polite"></sjs-text-block>\n <div class="${r.CSS_CLASSES.FILTER_DROPDOWN_CONTAINER}"></div>\n </div>\n </div>\n <div class="${r.CSS_CLASSES.PANEL_SCROLLABLE_CONTAINER}" role="main"></div>\n </div>\n `,t.pdo=t.Ti.querySelector(`.${r.CSS_CLASSES.TAB_SHOW_BUTTON}`);const n=t.Ti.querySelector(`.${r.CSS_CLASSES.TAB_ITEM_TEXT}`);t.mdo=n,n.Kbt({text:`0 ${m().Items_Text}`});const d=t.Ti.querySelector(`.${r.CSS_CLASSES.TAB_BUTTONS}`),c=t.Ti.querySelector(`.${r.CSS_CLASSES.FILTER_DROPDOWN_CONTAINER}`);t.gdo=new i.ThreadedCommentFilterDropdown(c),d.appendChild(c);const a=t.Ti.querySelector(`.${r.CSS_CLASSES.PANEL_SCROLLABLE_CONTAINER}`);t.wB=new o.ThreadedCommentList(a),t.bdo=new s.ThreadedCommentNavigateButton(a)}v7(){const t=this;t.Vv&&(document.addEventListener("click",this.ldo),t.Ti.addEventListener("click",this.fdo),t.Ti.addEventListener("keydown",this.hdo))}hdo(t){const e=undefined,n=this.Vv;if(!n)return;let i=n.getActiveSheet();if(!i||!i.threadedComments)return;let o=i.getActiveRowIndex(),s=i.getActiveColumnIndex();if(i.threadedComments.get(o,s)){const e=t.key;"ArrowUp"!==e&&"ArrowDown"!==e||(t.preventDefault(),t.stopPropagation(),"ArrowUp"===e?n.commandManager().execute({cmd:"navigatePreviousThreadedComment",sheetName:i.name(),silent:!0}):n.commandManager().execute({cmd:"navigateNextThreadedComment",sheetName:i.name(),silent:!0}))}}ldo(t){const e=this,n=t.target;n&&!e.gdo.RS.contains(n)&&e.gdo.odo()}fdo(t){var e;const n=this,i=t.target;if(i)if(n.pdo.contains(i)){if(n.pdo.disabled)return;const t=n.Vv.getActiveSheet(),i=t.getActiveRowIndex(),o=t.getActiveColumnIndex();if(!t.threadedComments.get(i,o)){const e=undefined;n.Vv.commandManager().execute({cmd:"addThreadedComment",sheetName:t.name(),row:i,col:o})}n.xbo=!0,n.refresh(),null===(e=n.wB.krr(i,o))||void 0===e||e.startEdit()}else if(n.bdo.RS.contains(i))n.ydo();else if(n.gdo.RS.contains(i)&&(n.gdo.lar.contains(i)&&n.gdo.rdo(),n.gdo.ndo.contains(i))){const t=i.getAttribute(r.ATTRIBUTES.DATA_FILTER)||i.parentElement.getAttribute(r.ATTRIBUTES.DATA_FILTER);if(t){const e=parseInt(t,10);n.gdo.edo(e);const i=n.gdo.Iwn(),o=n.Vv.getActiveSheet();o&&o.threadedComments&&o.threadedComments.X7e(i),n.refresh()}}}wpt(){const t=this;document.removeEventListener("click",t.ldo),t.Ti.removeEventListener("click",t.fdo),t.Ti.removeEventListener("keydown",t.hdo)}ydo(){const t=this,e=t.Vv.getActiveSheetIndex(),n=t.Vv.sheets,i=n.length;for(let o=0;o<i;o++){const s=(e+o+1)%i,r=n[s];if(r.threadedComments&&r.threadedComments.size()>0){const e=r.threadedComments.bho();if(e.length>0){t.Vv.setActiveSheetIndex(s);const n=e[0];r.setActiveCell(n.row(),n.col());break}}}t.refresh()}refresh(){const t=this;if(!t.Vv)return;const e=t.Vv.getActiveSheet();if(!e)return;const n=e.getActiveRowIndex(),i=e.getActiveColumnIndex(),o=e.threadedComments,s=o?o.get(n,i):void 0,r=o?o.bho(t.xbo):[];t.mdo.Kbt({text:`${r.length} ${m().Items_Text}`}),t.wB.Xho(r),t.Wmo(s);const{visible:d,returnFirst:c}=t.wdo();if(t.bdo.sdo(d),t.bdo.udo(c),o){const e=o.Iwn();t.gdo.X7e(e)}t.xbo=!1}Wmo(t){const e=null==t?void 0:t.resolved();this.pdo.disabled=!!e}wdo(){const t=this;let e=t.Vv.getActiveSheetIndex();const n=t.Vv.sheets;let i=n.length,o=-1,s;for(let t=0;t<n.length;t++){const e=n[t];if(e.threadedComments&&e.threadedComments.size()>0){const n=undefined;e.threadedComments.bho().length>0&&(i=Math.min(i,t),o=Math.max(o,t))}}return-1!==o&&(i===o?e!==i&&(s=!0):s=e<i||e>=o),{visible:void 0!==s,returnFirst:!0===s}}attach(t){let e=this;t&&e.Vv!==t&&(e.Vv=t,e.v7(),e.eJ=t.getActiveSheetOrSheetTab(),e.wB.oW(t),e.Vv.D3(d.Events.ThreadedCommentChangedInternal+p,e.refresh),e.Vv.D3(d.Events.ClipboardPasted+p,e.refresh),e.Vv.D3(d.Events.DragDropBlockCompleted+p,e.refresh),e.Vv.D3(d.Events.EnterCellInternal+p,e.cdo),e.Vv.D3(d.Events.ActiveSheetChangedInternal+p,e.ddo),e.Vv.D3(d.Events.ColumnChanged+p,e.refresh),e.Vv.D3(d.Events.RowChanged+p,e.refresh),e.refresh())}ddo(){const t=this,e=t.Vv.getActiveSheetOrSheetTab();t.cdo(),t.eJ=e}detach(){var t,e;const n=this;null===(t=n.Vv)||void 0===t||t._3(p),null===(e=n.eJ)||void 0===e||e._3(p),n.Vv=void 0}cdo(){const t=this;if(!t.Vv)return;const e=t.Vv.getActiveSheet();if(e){const n=e.getActiveRowIndex(),i=e.getActiveColumnIndex();e.threadedComments.get(n,i)&&t.wB.qQ(n,i)}t.refresh()}pho(t,e){const n=undefined;this.wB.qQ(t,e)}krr(t,e){const n=undefined;return this.wB.krr(t,e)}destroy(){const t=this;t.detach(),t.L0()}L0(){var t,e,n;const i=this;null===(t=i.wB)||void 0===t||t.L0(),null===(e=i.gdo)||void 0===e||e.L0(),null===(n=i.bdo)||void 0===n||n.L0(),i.wpt(),delete i.Ti[f],i.Ti.innerHTML=""}static findControl(t){const e="string"==typeof t?document.getElementById(t):t;return e&&e[f]||null}}(0,d.$e)(b)},606:function(t,e,n){var i,o,s,r;n.r(e),n.d(e,{LinkHandler:function(){return c}}),i=n(637),o=n(231),s=n(376),r=n.n(s);const d=s.util.Tt.safari;class c{constructor(t){this.Jdo=t}mayConvertUrl(){return null!==this.Mwo()}detectAndConvertUrlBeforeCursor(){const t=this.Mwo();return!!t&&(this.ypo(t.textNode,t.urlStartInText,t.cursorOffset-1,t.potentialUrl,t.cursorOffset),!0)}Mwo(){if(d)return null;const t=o.DOMUtils.getSelection(this.Jdo);if(!t||0===t.rangeCount)return null;const e=t.getRangeAt(0),n=e.startContainer;if(n.nodeType!==Node.TEXT_NODE)return null;const i=n,s=e.startOffset,r=undefined,c=(i.textContent||"").substring(0,s),a=c.charAt(c.length-1);if(" "!==a&&"\n"!==a)return null;let l=c.substring(0,c.length-1);if(l[0]===o.ZERO_WIDTH_CHAR&&(l=l.substring(1)),!l.trim())return null;const u=l.lastIndexOf(" "),h=l.lastIndexOf("\n"),m=Math.max(u,h)+1,f=l.substring(m);return o.URL_REGEX.lastIndex=0,o.URL_REGEX.test(f)?{textNode:i,urlStartInText:m,cursorOffset:s,potentialUrl:f}:null}ypo(t,e,n,s,r){const d=t.parentNode;if(!d)return;const c=t.textContent||"",a=c.substring(0,e),l=c.substring(n),u=document.createDocumentFragment();a&&u.appendChild(document.createTextNode(a));const h=o.DOMUtils.createNativeHyperlinkElement({type:i.ContentType.link,text:s,href:s});u.appendChild(h);let m=null;l&&(m=document.createTextNode(l),u.appendChild(m)),d.replaceChild(u,t);const f=o.DOMUtils.getSelection(this.Jdo);if(f&&m){const t=document.createRange(),e=r-n;t.setStart(m,e),t.setEnd(m,e),f.removeAllRanges(),f.addRange(t)}}convertHyperlinkToText(t,e){const n=t.dataset.linkUrl||"",i=n!==t.textContent,s=document.createTextNode(n),r=t.parentNode;if(r){r.replaceChild(s,t);const d=o.DOMUtils.getSelection(this.Jdo);if(d){const t=document.createRange(),o=void 0===e||i?n.length:e;t.setStart(s,o),t.setEnd(s,o),d.removeAllRanges(),d.addRange(t)}}}processHyperlinkBeforeInput(t){var e,n,i,s,r;const d=this.Jdo,c=o.DOMUtils.getSelection(d);if(!c||0===c.rangeCount)return;const a=c.getRangeAt(0);let l=null,u,h=a.commonAncestorContainer;for(;h&&h!==d;){if(h.nodeType===Node.ELEMENT_NODE&&(null===(e=h.classList)||void 0===e?void 0:e.contains("native-hyperlink"))){l=h,u=this.wpo(l,a);break}h=h.parentNode}if(!l)if("deleteContentBackward"===t.inputType){const t=o.DOMUtils.getPreviousNode(a);t&&(null===(n=t.classList)||void 0===n?void 0:n.contains("native-hyperlink"))&&(a.startContainer.nodeType===Node.ELEMENT_NODE||a.startContainer.nodeType===Node.TEXT_NODE&&0===a.startOffset)&&(l=t,u=(null===(i=l.textContent)||void 0===i?void 0:i.length)||0)}else if("deleteContentForward"===t.inputType){const t=o.DOMUtils.getNextNode(a);if(t&&(null===(s=t.classList)||void 0===s?void 0:s.contains("native-hyperlink"))){const e=a.startContainer;(e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&a.startOffset===(null===(r=e.textContent)||void 0===r?void 0:r.length))&&(l=t,u=0)}}l&&(this.convertHyperlinkToText(l,u),t.preventDefault())}wpo(t,e){var n;let i=0;const o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null);let s;for(;s=o.nextNode();){if(s===e.startContainer){i+=e.startOffset;break}i+=(null===(n=s.textContent)||void 0===n?void 0:n.length)||0}return i}bpo(t){const e=[];let n=0,s;for(;null!==(s=o.URL_REGEX.exec(t));){if(s.index>n){const o=t.substring(n,s.index);o&&e.push({type:i.ContentType.text,value:o})}const r=s[0];e.push({type:i.ContentType.link,href:r,text:r}),n=o.URL_REGEX.lastIndex}if(n<t.length){const o=t.substring(n);o&&e.push({type:i.ContentType.text,value:o})}return 0===e.length&&e.push({type:i.ContentType.text,value:t}),e}}},637:function(t,e,n){var i;function o(t){return t?t.type===i.text?{type:i.text,value:t.value}:t.type===i.mention?{type:i.mention,userId:t.userId}:{type:i.link,href:t.href,text:t.text}:t}n.r(e),n.d(e,{ContentType:function(){return i},cloneContentBlock:function(){return o}}),function(t){t[t.text=0]="text",t[t.mention=1]="mention",t[t.link=2]="link"}(i||(i={}))},642:function(t,e,n){var i,o,s,r,d,c,a;n.r(e),n.d(e,{ThreadedCommentList:function(){return h}}),i=n(802),o=n(670),s=n(758),r=n(234),d=n.n(r),c=n(994),a=n.n(c);const l=new r.Common.ResourceManager(s.SR,"ThreadedComment"),u=l.getResource.bind(l);class h{constructor(t){this.Jho=new Map;const e=document.createElement("div");e.className=o.CSS_CLASSES.PANEL,e.setAttribute("role","list"),e.setAttribute("aria-label",u().Aria_Comments_List),t.appendChild(e),this.RS=e,this.Wc=t,this.oW=this.oW.bind(this),this.Xho=this.Xho.bind(this)}oW(t){let e=this;t&&e.Vv!==t&&(e.Vv=t)}krr(t,e){var n;const i=`${t}_${e}`;return null===(n=this.Jho.get(i))||void 0===n?void 0:n.view}Xho(t){const e=this;if(!e.Vv)return;const n=new Set(t.map((t=>`${t.row()}_${t.col()}`))),i=undefined;Array.from(e.Jho.keys()).filter((t=>!n.has(t))).forEach((t=>{const n=e.Jho.get(t);n&&e.p0n(t,n)})),t.forEach((t=>{const n=`${t.row()}_${t.col()}`;if(e.Jho.has(n)){const i=e.Jho.get(n);i.view&&i.view.Oho===t?i.view&&i.view.updateDisplay&&(i.view.$ji=void 0,i.view.updateDisplay()):(e.p0n(n,i),e.$ho(t,n))}else e.$ho(t,n)}))}p0n(t,e){e.view&&e.view.dispose&&e.view.dispose(),e.element&&e.element.remove(),this.Jho.delete(t)}$ho(t,e){const n=this;if(!n.Vv)return;const s=document.createElement("div");s.className=o.CSS_CLASSES.PANEL_ITEM,s.setAttribute(o.ATTRIBUTES.DATA_COMMENT_KEY,e),s.setAttribute("role","listitem");const r=u().Aria_Comment_At_Position.replace("{0}",String(t.row()+1)).replace("{1}",String(t.col()+1));s.setAttribute("aria-label",r),s.style.marginBottom=o.STYLES.MARGIN_BOTTOM_10PX;const d=new i.ThreadedCommentView;d.create(s,t,n.Vv,{inPanel:!0}),n.Jho.set(e,{element:s,view:d}),n.qho(s)}qho(t){const e=t.getAttribute(o.ATTRIBUTES.DATA_COMMENT_KEY),[n,i]=e.split("_").map(Number),s=Array.from(this.RS.children);let r=null;for(const t of s){const e=t.getAttribute(o.ATTRIBUTES.DATA_COMMENT_KEY);if(e){const[o,s]=e.split("_").map(Number);if(o>n||o===n&&s>i){r=t;break}}}r?this.RS.insertBefore(t,r):this.RS.appendChild(t)}qQ(t,e){const n=this.Jho.get(`${t}_${e}`);n&&n.element&&(0,c.scrollIntoView)(n.element,this.Wc)}L0(){this.Jho.forEach((t=>{t.view&&t.view.dispose&&t.view.dispose()})),this.Jho=null,this.Vv=null,this.RS.innerHTML=""}}},670:function(t,e,n){n.r(e),n.d(e,{ATTRIBUTES:function(){return o},ATTRIBUTE_VALUES:function(){return s},CSS_CLASSES:function(){return i},STYLES:function(){return r}});const i={PANEL_HOST:"gc-threaded-comment-panel-host",PANEL_SIDE_PANEL:"gc-threaded-comment-panel-side-panel",PANEL_FIXED_HEADER:"gc-threaded-comment-panel-fixed-header",PANEL_TITLE:"gc-threaded-comment-panel-title",PANEL_SCROLLABLE_CONTAINER:"gc-threaded-comment-panel-scrollable-container",PANEL:"gc-threaded-comment-panel",PANEL_ITEM:"gc-threaded-comment-panel-item",TAB_BUTTONS:"gc-tab-threaded-comment-buttons",TAB_SHOW_BUTTON:"gc-tab-threaded-comment-panel-show",TAB_ITEM_TEXT:"gc-tab-threaded-comment-panel-item",NEW_BUTTON_ICON:"gc-threaded-comment-panel-new-button-icon",FILTER_CONTAINER:"gc-threaded-comment-panel-filter-container",FILTER_DROPDOWN_CONTAINER:"gc-threaded-comment-filter-dropdown",FILTER_BUTTON:"gc-tab-threaded-comment-panel-filter",FILTER_BUTTON_ACTIVE:"gc-tab-threaded-comment-panel-filter-active",FILTER_ICON:"gc-threaded-comment-panel-filter-icon",FILTER_BADGE:"gc-threaded-comment-panel-filter-badge",FILTER_DROPDOWN:"gc-threaded-comment-panel-filter-dropdown",FILTER_SECTION:"gc-threaded-comment-panel-filter-section",FILTER_OPTION:"gc-threaded-comment-panel-filter-option",FILTER_CLEAR_ICON:"gc-threaded-comment-panel-clear-filter-icon",FILTER_RESET_TEXT:"gc-threaded-comment-panel-filter-reset-text",FILTER_DIVIDER:"gc-threaded-comment-panel-filter-divider",FILTER_SEPARATOR:"gc-threaded-comment-panel-filter-separator",FILTER_CHECKBOX:"gc-threaded-comment-panel-filter-checkbox",FILTER_OPTION_CHECKED:"gc-threaded-comment-panel-status-filter-option-checked",FILTER_OPTION_UNCHECKED:"gc-threaded-comment-panel-status-filter-option",FILTER_OPTION_ICON_ENABLED:"gc-threaded-comment-panel-clear-filter-icon-enabled",FILTER_OPTION_ICON_DISABLED:"gc-threaded-comment-panel-clear-filter-icon-disabled",NAVIGATE_CONTAINER:"gc-threaded-comment-panel-navigate-container",NAVIGATE_TEXT:"gc-threaded-comment-panel-navigate-text",NAVIGATE_ICON:"gc-threaded-comment-panel-navigate-icon"},o={TABINDEX:"tabindex",DATA_FILTER:"data-filter",DATA_COMMENT_KEY:"data-comment-key"},s={TABINDEX_FOCUSABLE:"-1"},r={DISPLAY_NONE:"none",DISPLAY_BLOCK:"block",DISPLAY_FLEX:"flex",MARGIN_BOTTOM_10PX:"10px",OPACITY_HALF:"0.5",OPACITY_FULL:"1",POINTER_EVENTS_NONE:"none",POINTER_EVENTS_AUTO:"auto"}},711:function(t,e,n){var i,o,s,r,d,c;n.r(e),n.d(e,{ThreadedCommentMenuComponent:function(){return u}}),i=n(731),o=n(994),s=n.n(o),r=n(758),d=n(234),c=n.n(d);const a=new d.Common.ResourceManager(r.SR,"ThreadedComment"),l=a.getResource.bind(a);class u extends HTMLElement{constructor(){super(),this.Jet=!1,this._items=[],this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=`\n <style>\n :host {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n z-index: 2000;\n }\n .menu {\n background: ${o.CSSVariables.background};\n border: 1px solid ${o.CSSVariables.borderColor};\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n min-width: 150px;\n max-width: 240px;\n padding: 3px;\n overflow: hidden;\n ${o.CSSUtils.columnFlex("flex-start","stretch")};\n }\n .menu-item {\n ${o.CSSUtils.rowFlex("flex-start","center")}\n padding: 8px 12px;\n cursor: pointer;\n transition: background-color 0.2s;\n font-size: 12px;\n color: ${o.CSSVariables.foreground};\n user-select: none;\n }\n .menu-item > * + * {\n margin-left: 8px;\n }\n .menu-item:hover {\n background-color: color-mix(in srgb, ${o.CSSVariables.accent} 15%, ${o.CSSVariables.background});\n }\n .menu-item.disabled {\n cursor: default;\n opacity: 0.6;\n }\n .menu-item.disabled:hover {\n background-color: transparent;\n }\n .menu-item-icon {\n width: 14px;\n height: 14px;\n flex-shrink: 0;\n }\n .menu-item-icon svg path {\n stroke: ${o.CSSVariables.foreground};\n fill: ${o.CSSVariables.foreground};\n }\n .menu-item-icon svg g polyline {\n stroke: ${o.CSSVariables.foreground};\n fill: ${o.CSSVariables.foreground};\n }\n .menu-item-text {\n flex: 1 1 auto;\n }\n </style>\n <div class="menu" part="menu" role="menu" aria-label="${l().Aria_Comment_Options_Menu}"></div>\n `,this.Nvo=this.shadowRoot.querySelector(".menu")}open(t){this.Nvo&&(this.close(),t&&t.items&&t.items.length&&(this._items=t.items.filter((t=>!!t)),this._items.length&&(this.qdt=t.containerRect,this.DJ=t.context,this.Cpo(),this.style.display="block",this.Jet=!0,this.style.left="0px",this.style.top="0px",requestAnimationFrame((()=>{this.u_(t.anchorRect)})))))}close(){this.Jet&&(this.Jet=!1,this.style.display="none",this.Nvo&&(this.Nvo.innerHTML=""),this._items=[],this.qdt=void 0,this.DJ=void 0)}disconnectedCallback(){this.close()}Cpo(){this.Nvo.innerHTML="",this._items.forEach((t=>{var e;const n=document.createElement("div");if(n.className="menu-item",n.setAttribute("role","menuitem"),t.text&&n.setAttribute("aria-label",t.text),t.icon){const e=document.createElement("div");e.className="menu-item-icon",e.innerHTML=t.icon,e.setAttribute("aria-hidden","true"),n.appendChild(e)}const i=document.createElement("div");i.className="menu-item-text",i.textContent=null!==(e=t.text)&&void 0!==e?e:"",n.appendChild(i),t.event?n.addEventListener("click",(e=>{e.stopPropagation(),this.Mpo(t)})):(n.classList.add("disabled"),n.setAttribute("aria-disabled","true")),this.Nvo.appendChild(n)}))}Mpo(t){if(!(null==t?void 0:t.event))return;const e={eventName:t.event,context:this.DJ};this.dispatchEvent(new CustomEvent(i.Threaded_Comment_Menu_Command_Event,{bubbles:!0,detail:e})),this.close()}u_(t){if(!this.Nvo||!this.qdt||!t)return;const e=4,n=this.Nvo.offsetWidth,i=this.qdt.width;let o=t.right-this.qdt.left-n;o<0&&(o=t.left-this.qdt.left),o+n>i&&(o=Math.max(i-n,0)),o=Math.max(0,o);const s=t.bottom-this.qdt.top+4;this.style.left=`${o}px`,this.style.top=`${s}px`}isOpen(){return this.Jet}containsNode(t){var e;return(null===(e=this.shadowRoot)||void 0===e?void 0:e.contains(t))||!1}}(0,o.s0r)("sjs-threaded-comment-menu",u)},729:function(t,e,n){var i,o,s,r,d,c,a,l,u,h,m,f;n.r(e),n.d(e,{ThreadedCommentManager:function(){return I}}),i=n(151),o=n(802),s=n(47),r=n(376),d=n.n(r),c=n(844),a=n.n(c),l=n(185),u=n(234),h=n.n(u),m=n(731),f=n(352);const p=u.Common.who,v=u.Common.Cho,_=r.UsedRangeUtil.vh,C=u.Common.UserManager,y=r.XFileConstants.Bfo,b=r.XFileConstants.Rr,g=r.XFileConstants.Lr,x=r.Util.wr,T=r.Util.ko,w=null,k=u.Common.lt.ht,E=200;function N(t){return null==t?void 0:t.Dho}function A(t){var e;return null===(e=N(t))||void 0===e?void 0:e.Oho}function $(t){var e;return null===(e=N(t))||void 0===e?void 0:e.apo}function R(t){return{pageX:t.pageX,pageY:t.pageY}}class I{constructor(t){this.pI=new Map,this.Mf=t,this.Mho=new Map,this.ybo=this.ybo.bind(this),this.Cgo()}hg(t){this.Ti=t}Tho(t){this.NW=t}add(t,e,n){const o=this.Mf,s=o.getSpan(t,e);if(s&&(s.row!==t||s.col!==e))return w;this.remove(t,e);const r=new i.ThreadedComment(t,e);return r.all(n||[]),this.WB(t,e,r),o.zw(),r}ybo(t){var e;const n=null==t?void 0:t.eventType;if(void 0!==n)switch(delete t.eventType,n){case 0:this.THr(t);break;case 1:this.$Dr(t);const n=this.Pso(t.id);"resolved"===t.propName&&this.qyo(n),this.wbo(n);break;case 2:this.Sho(t);break;case 3:this.Aho(t);break;case 4:null===(e=this.Mf)||void 0===e||e.zw()}}THr(t){var e;const n=null===(e=this.Mf)||void 0===e?void 0:e.THr(t);return t.changingContext=n,n}$Dr(t){var e;null===(e=this.Mf)||void 0===e||e.$Dr(t,t.changingContext)}Aho(t){var e,n;t||(t={}),null===(e=this.Mf)||void 0===e||e.ki(r.Events.ThreadedCommentChangedInternal,Object.assign(Object.assign({},t),{sheet:this.Mf,sheetName:null===(n=this.Mf)||void 0===n?void 0:n.name()}),!0)}qyo(t){const e=this.Mf;e&&e.Lj&&e.Lj(e,[{row:t.row(),col:t.col(),rowCount:1,colCount:1}],0)}wbo(t){const e=this.Bho,n=undefined;if(A(e)===t){const t=N(e);null==t||t.updateDisplay()}}Sho(t){var e,n;let i=null===(n=null===(e=this.Mf)||void 0===e?void 0:e.Ut)||void 0===n?void 0:n.G8;if(i){let e=i.threadedCommentChanges;e||(e=i.threadedCommentChanges=[]),e.push(t)}}kho(t){if(t){let e=this;const n=this.Mf,i=null==n?void 0:n.name();for(let o=t.length-1;o>=0;o--){let s=t[o],d=s.threadedComment;if("add"===s.type)e.Iho(d);else if("remove"===s.type)e.ZP(s.row,s.col,d);else if("property"===s.type){let t=s.name,e=s.value,o=d[t]();d[t](e),"resolved"===t&&this.qyo(d),null==n||n.ki(r.Events.ThreadedCommentChanged,{sheet:n,sheetName:i,threadedComment:d,propertyName:t,oldValue:o,newValue:e})}else if("position"===s.type)e.EK(d,s.row,s.col);else if("addReply"===s.type){let t=d.get(s.replyIndex);d.VP(s.replyIndex),null==n||n.ki(r.Events.ThreadedCommentChanged,{sheet:n,sheetName:i,threadedComment:d,propertyName:"reply",replyIndex:s.replyIndex,oldValue:t})}else if("removeReply"===s.type)d.Eit(s.replyIndex,s.reply),null==n||n.ki(r.Events.ThreadedCommentChanged,{sheet:n,sheetName:i,threadedComment:d,propertyName:"reply",replyIndex:s.replyIndex,newValue:s.reply});else if("setReply"===s.type){let t=d.get(s.replyIndex);d.Ydn(s.replyIndex,s.reply),null==n||n.ki(r.Events.ThreadedCommentChanged,{sheet:n,sheetName:i,threadedComment:d,propertyName:"reply",replyIndex:s.replyIndex,oldValue:t,newValue:s.reply})}this.wbo(d)}}}WB(t,e,n){var i;const o=this,s=o.get(t,e);o.ZP(t,e,n),o.$Dr({type:"addThreadedComment",row:t,col:e,threadedComments:[n]}),o.Sho({type:"add",row:t,col:e,threadedComment:n}),null===(i=o.Mf)||void 0===i||i.Rj("threadedComment",t,e,r.SheetArea.viewport,s,n)}ZP(t,e,n){const i=this,o=i.pI;o.has(t)||o.set(t,new Map),n.Nho(t),n.jho(e),o.get(t).set(e,n),i.Mho.set(n.jKe(),n),i.Aho({threadedComment:n}),n._ho(i.ybo);const s=i.NW;s&&s.remove(t,e)}get(t,e){var n;const i=undefined,o=this.pI;return null===(n=null==o?void 0:o.get(t))||void 0===n?void 0:n.get(e)}Pso(t){const e=undefined;return this.Mho.get(t)}hasComments(t){const e=this;if(!e.pI)return!1;if(t&&e.pI.size>0)for(let n=0;n<t.length;n++){const i=t[n],{row:o,rowCount:s,col:r,colCount:d}=i;for(let t=0;t<s;t++){const n=e.pI.get(t+o);if(n)for(let t of Array.from(n.values()))if(e.kbo(t)&&t.col()>=r&&t.col()<r+d)return!0}}return!1}remove(t,e){var n,i;const o=this,s=undefined,d=null===(n=o.pI.get(t))||void 0===n?void 0:n.get(e);if(d){o.Sho({type:"remove",row:t,col:e,threadedComment:d});let n=o.THr({type:"removeThreadedComment",threadedComments:[d]});o.Iho(d),o.$Dr({type:"removeThreadedComment",ids:[d.jKe()],changingContext:n}),null===(i=o.Mf)||void 0===i||i.Rj("threadedComment",d.row(),d.col(),r.SheetArea.viewport,d,void 0),o.Mf.zw()}return d}Iho(t){const e=this,n=e.pI;let i=t;A(e.Bho)===i&&e.Eho(),i.Rho(e.ybo),i.L0(),e.Mho.delete(t.jKe());const o=n.get(t.row());o.delete(t.col()),0===o.size&&n.delete(t.row()),e.Aho({threadedComment:i})}VP(t,e){var n;const i=undefined,o=undefined;let s=null===(n=this.pI.get(t))||void 0===n?void 0:n.get(e);s&&this.Iho(s)}clear(t){const e=this,n=e.pI,i=[];n.forEach(((n,o)=>{(!t||o>=t.row&&o<t.row+t.rowCount||-1===t.row||-1===t.rowCount)&&n.forEach(((n,o)=>{if(!t||o>=t.col&&o<t.col+t.colCount||-1===t.col||-1===t.colCount){i.push(n);let t=n;e.Sho({type:"remove",row:t.row(),col:t.col(),threadedComment:t})}}))}));const o=this.THr({type:"removeThreadedComment",threadedComments:i});i.forEach((t=>{e.Iho(t)})),this.$Dr({type:"removeThreadedComment",ids:i.map((t=>t.jKe())),changingContext:o}),e.Mf.zw()}all(){const t=undefined,e=this.pI,n=[];return e.forEach(((t,e)=>{t.forEach(((t,e)=>{n.push(t)}))})),n.sort(((t,e)=>t.row()===e.row()?t.col()-e.col():t.row()-e.row()))}size(){return this.Mho?this.Mho.size:0}yh(t){var e;let n=null===(e=null==t?void 0:t.ThreadedComments)||void 0===e?void 0:e.threadedComment;if(!n)return;Array.isArray(n)||(n=[n]);const o=this,s=new Map;n.forEach((t=>{t.parentId?(s.has(t.parentId)||s.set(t.parentId,[]),s.get(t.parentId).push(t)):s.has(t.id)?s.get(t.id).push(t):s.set(t.id,[t])})),s.forEach(((t,e)=>{const n=t.find((t=>!t.parentId));if(n){const e=r.range_parser._c(n.ref);if(e){let s=new i.ThreadedComment(e.row,e.col);s.yh(t),"1"===n.done&&s.resolved(!0),o.ZP(e.row,e.col,s)}}}))}wh(t,e){const n=undefined,i=this.pI,o=[],s={};return i.forEach(((n,i)=>{n.forEach(((n,d)=>{const c=r.range_parser.jc(new r.Range(i,d,1,1)),a=n.wh(t,e);a.length>0&&(o.push(...a),s[c]=a[0].id)}))})),{ThreadedComments:{r_:[71,43],threadedComment:o},commentsRefMap:s}}Lho(t){const e=this,n=e.pI,i=e.Mf,o=[],s=r.XFileConstants.Bfo+i.wp;return n.forEach(((e,n)=>{e.forEach(((e,d)=>{const a=e;if(a.Mdo&&a.Mdo.length>0){const a=new c.Comment(e.Fho());a.Yfo=!0,a.Mf=i,a.bZ=n,a.yZ=d;const l=r.range_parser.jc(new r.Range(n,d,1,1));a.zfo=t.threadedCommentsRefMap[s][l],o.push(a)}}))})),o}fromJSON(t){const e=this,n=undefined;e.pI.clear(),Object.keys(t).forEach((n=>{const o=t[n];Object.keys(o).forEach((t=>{const s=o[t];if(s){const o=new i.ThreadedComment(+n,+t);o.fromJSON(s),e.ZP(+n,+t,o)}}))}))}toJSON(t){const e=undefined,n=this.pI,i={};let o=0;if(n.forEach(((e,n)=>{i[n]={},e.forEach(((e,s)=>{o++,i[n][s]=e.toJSON(t)}))})),0!==o)return i}JO(t,e){const n=this,i=n.pI;p(i,t,e,((t,e)=>{t.forEach((t=>{const i=t.row();i!==e&&n.Sho({type:"position",row:i,col:t.col(),threadedComment:t}),t.Nho(e)}))})),n.Aho()}xP(t,e){const n=this,i=n.pI,o=[];i.forEach(((n,i)=>{i>=t&&i<t+e&&n.forEach((t=>{o.push(t)}))})),o.forEach((t=>{n.remove(t.row(),t.col())})),v(i,t,e,((t,e)=>{t.forEach((t=>{if(-1!==e){const i=t.row();i!==e&&n.Sho({type:"position",row:i,col:t.col(),threadedComment:t}),t.Nho(e)}}))})),n.Aho()}qO(t,e){const n=this,i=undefined;n.pI.forEach((i=>{p(i,t,e,((t,e)=>{const i=t.col();i!==e&&n.Sho({type:"position",row:t.row(),col:i,threadedComment:t}),t.jho(e)}))})),n.Aho()}NP(t,e){const n=this,i=n.pI,o=[];i.forEach((n=>{n.forEach((n=>{n.col()>=t&&n.col()<t+e&&o.push(n)}))})),o.forEach((t=>{n.remove(t.row(),t.col())})),i.forEach((i=>{v(i,t,e,((t,e)=>{if(-1!==e){const i=t.col();i!==e&&n.Sho({type:"position",row:t.row(),col:i,threadedComment:t}),t.jho(e)}}))})),n.Aho()}CB(t,e,n,i,o,s,r=!0){var d;if((t||i)&&(t&&this.EK(t,o,s),i&&this.EK(i,e,n),r)){const t={type:"sortSwap",sortType:"threadedComment",fromRow:e,fromCol:n,toRow:o,toCol:s};null===(d=this.Mf)||void 0===d||d.$Dr(t,{})}}EK(t,e,n){const i=t.row(),o=t.col();this.pI&&(this.pI.get(i).delete(o),this.pI.has(e)||this.pI.set(e,new Map),this.Sho({type:"position",row:i,col:o,threadedComment:t}),this.pI.get(e).set(n,t),t.Nho(e),t.jho(n))}pho(t,e){const n=this,i=n.get(t,e),r=n.Mf;if(!i)return;if(n.Bho&&n.Eho(),!n._bo(i))return;const d=r.getCellRect(t,e);if(!d||isNaN(d.x)||isNaN(d.y))return;const c=d.x+d.width,a=d.y,l=new o.ThreadedCommentView,u=r.parent.j2();n.Bho=new s.ThreadedCommentViewDialog(u,r.bP()),n.Bho.rQ(l,i,c,a,r.parent)}Eho(){const t=this;t.Bho&&(t.Bho.close(),this.Bho=void 0)}Pho(){return!!this.Bho}Sgo(t){const e=this;if($(e.Bho))return;if(!t)return void e.Tgo();const n=A(e.Bho);n?n!==t?e.xgo(t):e.Uho&&e.Ago():e.pho(t.row(),t.col())}Ago(){this.Uho&&(clearTimeout(this.Uho),this.Uho=void 0)}xgo(t){this.Uho&&this.Ago(),this.Uho=window.setTimeout((()=>{this.Eho(),this.Uho=void 0,this.pho(t.row(),t.col())}),E)}Tgo(){const t=this;t.Uho||t.Bho&&(t.Uho=window.setTimeout((()=>{t.Eho(),t.Uho=void 0}),E))}Igo(){this.Ago()}Zho(t,e){var n;const i=this;if(i.ewo=R(e),0===(null===(n=i.pI)||void 0===n?void 0:n.size))return;const o=t.uw(),s=t.hitTest(e.pageX-o.left,e.pageY-o.top);if(s&&s.rowViewportIndex>=0&&s.colViewportIndex>=0){const t=s.row,e=s.col,n=i.get(t,e);i.Sgo(n)}}Who(t){const e=this,n=e.Ti;n.bind("mousemove"+m.EVENT_NS,(function(n){e.Zho(t,n)})),n.bind("mouseleave"+m.EVENT_NS,(function(t){const n=N(e.Bho);(null==n?void 0:n.apo)||e.Tgo()})),t.bind(m.Threaded_Comment_Schedule_Cancel_Hide_Event,(function(){e.Igo()})),t.bind(m.Threaded_Comment_Schedule_Hide_Event,(function(n,i){const o=t.uw(),s=t.hitTest(i.pageX-o.left,i.pageY-o.top);if(s&&s.rowViewportIndex>=0&&s.colViewportIndex>=0){const t=s.row,n=s.col,i=e.get(t,n);if(i&&i===A(e.Bho)){const t=N(e.Bho);return void(t&&(t.$ji=void 0,t.updateDisplay({isActive:!0})))}}e.Eho()}))}Qho(){var t;const e=this,n=e.Ti;null==n||n.unbind(m.EVENT_NS),null===(t=e.Mf)||void 0===t||t._3(m.EVENT_NS),e.Ti=null}Cgo(){const t=this,e=t.Mf;e.D3(r.Events.TopRowChanged+m.EVENT_NS,(()=>{t.Ngo()})),e.D3(r.Events.LeftColumnChanged+m.EVENT_NS,(()=>{t.Ngo()}))}Ngo(){const t=this;t._go&&(clearTimeout(t._go),t._go=void 0);const e=A(t.Bho);if(e){const n=e.row(),i=e.col(),o=undefined,s=t.Mf.getCellRect(n,i);if(!s||isNaN(s.x)||isNaN(s.y))return void t.Eho();const r=s.x+s.width,d=s.y;t.Bho.RRe(r,d)}t._go=window.setTimeout((()=>{t._go=void 0,t.Dgo()}),200)}Dgo(){const t=this,e=t.ewo;if(!e)return;const n=t.Mf,i=n.uw(),o=n.hitTest(e.pageX-i.left,e.pageY-i.top);if(o&&o.rowViewportIndex>=0&&o.colViewportIndex>=0){const e=o.row,n=o.col,i=t.get(e,n),s=undefined;i!==A(t.Bho)&&(i?(t.Eho(),t.pho(e,n)):t.Eho())}else t.Eho()}mW(){return N(this.Bho)}L0(t){let e=this;e.Ago(),e.Eho(),e._go&&(clearTimeout(e._go),e._go=void 0),e.Mf&&(e.Mf._3(r.Events.TopRowChanged+m.EVENT_NS),e.Mf._3(r.Events.LeftColumnChanged+m.EVENT_NS)),!1!==t&&(e.pI&&e.pI.forEach((t=>{t.forEach((t=>{t.L0()}))})),e.pI=w,e.NW=w,e.Mf=w,e.Mho=w)}getUsedRange(){let t,e=this.all(),n={};if(e){let t,i;for(let o of e)t=o.row(),i=o.col(),_(n,{minRow:t,minCol:i,maxRow:t,maxCol:i})}return n}X7e(t){var e,n;const i=this,o=null===(e=i.Mf)||void 0===e?void 0:e.parent;if(!o)return;const s=undefined;(o.Dbo||0)!==t&&(o.Dbo=t,null===(n=o.getActiveSheet())||void 0===n||n.zw(),i.Aho())}Iwn(){var t;const e=null===(t=this.Mf)||void 0===t?void 0:t.parent;return(null==e?void 0:e.Dbo)||f.ThreadedCommentFilterType.None}bho(t){var e,n;const i=this,o=i.Iwn(),s=null===(e=i.Mf)||void 0===e?void 0:e.getActiveRowIndex(),r=null===(n=i.Mf)||void 0===n?void 0:n.getActiveColumnIndex(),d=t=>t.row()===s&&t.col()===r;let c=i.all();if(o&f.ThreadedCommentFilterType.ActiveOnly?c=c.filter((e=>!e.resolved()||t&&d(e))):o&f.ThreadedCommentFilterType.ResolvedOnly&&(c=c.filter((e=>e.resolved()||t&&d(e)))),o&f.ThreadedCommentFilterType.MentionsMe){const e=C.current();e&&(c=c.filter((n=>n.all().some((t=>t.message.some((t=>1===t.type&&t.userId===e))))||t&&d(n))))}return c}kbo(t){const e=undefined,n=this.Iwn();if(n===f.ThreadedCommentFilterType.None)return!0;if(n&f.ThreadedCommentFilterType.ActiveOnly){if(t.resolved())return!1}else if(n&f.ThreadedCommentFilterType.ResolvedOnly&&!t.resolved())return!1;if(n&f.ThreadedCommentFilterType.MentionsMe){const e=C.current();if(!e)return!1;{const n=undefined;if(!t.all().some((t=>t.message.some((t=>1===t.type&&t.userId===e)))))return!1}}return!0}_bo(t){const e=this;if(!t)return!1;const n=e.Mf,i=null==n?void 0:n.getActiveRowIndex(),o=null==n?void 0:n.getActiveColumnIndex(),s=undefined;return t.row()===i&&t.col()===o||e.kbo(t)}Qgo(){const t=N(this.Bho);t&&(t.apo=!0)}Obo(t,e,n,i){const o=this,s=o.Mf;if(o.pI.size>0){if(t>=0&&e>=0){const n=o.get(t,e);if(n&&!o.kbo(n)){const n=s.j1(new r.Range(t,e,1,1));s.repaint(n)}}if(n>=0&&i>=0){const t=o.get(n,i);if(t&&!o.kbo(t)){const t=s.j1(new r.Range(n,i,1,1));s.repaint(t)}}}}}function S(t,e,n,i,o){const s=N(t);if(null==s?void 0:s.Oho){const t=s.Oho.row(),r=s.Oho.col(),d=undefined,c=undefined;(e===t&&n===r)!==(i===t&&o===r)&&s.updateDisplay()}}function O(t,e,n,i,o){let s,r=this.threadedComments,d;if(t&&r){let t=r.all();const s=[];for(let r=0;r<t.length;r++){d=t[r];let c=d.row(),a=d.col();c===e&&a===n||c>=e&&c<e+i&&a>=n&&a<n+o&&s.push(d)}if(s.length>0){const t=r.THr({type:"removeThreadedComment",threadedComments:s}),e=[];s.forEach((t=>{e.push(t.jKe()),r.Iho(t)})),r.$Dr({type:"removeThreadedComment",ids:e,changingContext:t})}}}r.Workbook.ch("ThreadedCommentManager",{init:function(){r.Commands.yho(this.commandManager())},wh:function(t,e,n){const i=e.threadedComments;i&&Object.keys(i).forEach((e=>{t[e]=i[e]}))}}),r.Worksheet.ch("ThreadedCommentManager",{priority:8900,getUsedRange(t){if(!(t.type&r.UsedRangeType.threadedComment))return;let e,n,i=this.threadedComments.getUsedRange();_(t.range,i)},init:function(){this.threadedComments=this.Ut.Vfo},setHost:function(t){if(!t)return;const e=this;e.threadedComments.hg(t),e.threadedComments.Who(e),e.D3(r.Events.ActiveCellChanged+m.EVENT_NS,(function(t,n){const i=e.threadedComments;if(!i)return;const{oldRow:o,oldCol:s,row:r,col:d}=n;i.Obo(o,s,r,d);const c=i.Bho;c&&S(c,o,s,r,d)}))},attach:function(){this.threadedComments.Tho(this.comments)},paintCell:function(t){var e,n;const{ctx:i,sheetArea:o,cell:s,isPrinting:d}=t;if(!d&&o===r.SheetArea.viewport){const t=s.baseRow||s.row,d=s.baseCol||s.col,c=null===(e=this.threadedComments)||void 0===e?void 0:e.get(t,d);if(this.threadedComments._bo(c)){const e=this.zoom()||1;let a=s.width;const u=null===(n=this.rowFilter)||void 0===n?void 0:n.call(this);let h=u&&u.rn(t,d,o)&&u.filterButtonVisible(d);if(!h){const e=this.tables.find(t,d);if(e&&e.showHeader()&&e.headerIndex()===t){const t=undefined,n=d-e.range().col;h=e.filterButtonVisible(n)}}let m=!1;if(!h){const e=this.pivotTables;if(e){const n=e.findPivotTable(t,d);if(n){const e=n.getPivotInfoImp(t,d,!1,!1,!0);e&&(e.colHeadFieldInfo||e.pageFieldInfo||e.cornerFieldInfo)&&(m=!0)}}}if(m||h){const t=new r.Rect(s.x,s.y,s.width,s.height),n=this.an(t,o),i=undefined;(s.height-n.height<l.Indicator_Size*e||m)&&(a=s.width-n.width)}(0,l.drawThreadedCommentIndicator)(i,s.x,s.y,a,s.height,!c.resolved(),e)}}},yh:function(t,e,n){var i;const o=t.rels,s=n&&!1===n.includeStyles;if(!o||s)return;const r=o.c_;let d;for(let t of r){let e=t.Target;if(e&&e.indexOf(y)>0){d=e.split("/").pop().slice(0,-4);break}}const c=null===(i=e.threadedComments)||void 0===i?void 0:i[d];c&&this.threadedComments.yh(c)},wh:function(t,e,n){if(!t||n&&!1===n.includeStyles)return;const i=t.rels,o=this.threadedComments&&this.threadedComments.all();if(i&&o&&o.length>0){const t=x(i),o=b+t,s=this.wp,d=r.XFileConstants.Bfo+s;i.c_.push({n_:g,Id:o,Type:r.RelationshipConstants.Gfo,Target:"../threadedComments/"+d+"."+r.XFileConstants.Cr}),e.threadedComments||(e.threadedComments={});const{ThreadedComments:c,commentsRefMap:a}=this.threadedComments.wh(e,T(n));e.threadedComments[d]={ThreadedComments:c},e.threadedCommentsRefMap||(e.threadedCommentsRefMap={}),e.threadedCommentsRefMap[d]=a}},fromJson:function(t){const e=t.threadedComments;e&&this.threadedComments.fromJSON(e)},toJson:function(t,e){const n=this.threadedComments;n&&(t.threadedComments=n.toJSON(e))},onLayoutChanged:function(t){if(!k(t.sheetArea)&&3!==t.sheetArea)return;let e=this,n=e.threadedComments,i=t.changeType,o=t.row,s=t.rowCount,d=t.col,c=t.colCount;"addRows"===i?n.JO(o,s):"deletingRows"!==i||t.onlyCheck?"addColumns"===i?n.qO(d,c):"deletingColumns"!==i||t.onlyCheck?t.sheetArea===r.SheetArea.viewport&&("clear"===i?1024&~t.type||n.clear(new r.Range(o,d,s,c)):"addSpan"===i?O.call(e,!0,o,d,s,c):"removeSpan"===i&&O.call(e,!1,o,d)):n.NP(d,c):n.xP(o,s)},onLayoutChangedFromOp:function(t){if(!k(t.sheetArea)&&3!==t.sheetArea)return;const e=undefined,n=this.threadedComments,{changeType:i,row:o,rowCount:s,col:r,colCount:d}=t;"addRows"===i?n.JO(o,s):"deleteRows"===i?n.xP(o,s):"addColumns"===i?n.qO(r,d):"deleteColumns"===i&&n.NP(r,d)},dispose:function(){this.threadedComments.Qho(),this._3(r.Events.ActiveCellChanged+m.EVENT_NS)}}),c.CommentManager.ch("ThreadedCommentManager",{beforeCommentsToSJSFormat:function(t){const e=this.Mf,n=null==e?void 0:e.threadedComments,{sjsCommonInfo:i,saveOptions:o,comments:s}=t;if(n&&!T(o)){const t=n.Lho(i);s.push(...t)}},addComment:function(t){const e=this.Mf,n=null==e?void 0:e.threadedComments;n&&n.remove(t.bZ,t.yZ)},afterCommentsToSJSFormat:function(t){const e=t.comments,n=t.saveOptions;(null==e?void 0:e.length)&&(T(n)||e.forEach((t=>{t.Yfo&&(t.Mf=null)})))}});let B=r.Y8;r.GC$.extend(B.prototype,{Kho:function(t,e,n,i){let o=this;for(let s=0;s<n;s++)for(let n=0;n<i;n++)0===s&&0===n||o.threadedComments.remove(t+s,e+n)}}),B.ch("threadedComments",{init:function(){this.Vfo=new I(this.Mf)},undo:function(t){let e=t.threadedCommentChanges;e&&this.Vfo.kho(e)},dispose:function(t){let e=this,n=t&&t.clearCache;e.Vfo&&e.Vfo.L0(n),!1!==n&&(e.Vfo=w)}})},731:function(t,e,n){n.r(e),n.d(e,{All_Threaded_Comment_Component_Events:function(){return g},EVENT_NS:function(){return i},Threaded_Comment_Component_Activate_Event:function(){return p},Threaded_Comment_Component_Collapse_Event:function(){return v},Threaded_Comment_Component_Comment_Delete_Event:function(){return a},Threaded_Comment_Component_Edit_End_Event:function(){return c},Threaded_Comment_Component_Edit_Event:function(){return d},Threaded_Comment_Component_Editor_Cancel_Event:function(){return f},Threaded_Comment_Component_Editor_Submit_Event:function(){return m},Threaded_Comment_Component_Reopen_Event:function(){return h},Threaded_Comment_Component_Reply_Delete_Event:function(){return l},Threaded_Comment_Component_Resolve_Event:function(){return u},Threaded_Comment_Component_Settings_Button_Click_Event:function(){return _},Threaded_Comment_Component_Settings_DropDown_Out_Click_Event:function(){return C},Threaded_Comment_Container_Max_Width:function(){return o},Threaded_Comment_Menu_Command_Event:function(){return y},Threaded_Comment_Schedule_Cancel_Hide_Event:function(){return s},Threaded_Comment_Schedule_Hide_Event:function(){return r},Threaded_Comment_View_Display_Updated_Event:function(){return b}});const i=".threadedComment",o=261,s="scheduleCancelHideHoverComment"+i,r="scheduleHideHoverComment"+i,d="sjs-threaded-comment-edit",c="sjs-threaded-comment-edit-end",a="sjs-threaded-comment-comment-delete",l="sjs-threaded-comment-reply-delete",u="sjs-threaded-comment-resolve",h="sjs-threaded-comment-reopen",m="sjs-threaded-comment-editor-submit",f="sjs-threaded-comment-editor-cancel",p="sjs-threaded-comment-activate",v="sjs-threaded-comment-change-collapse",_="sjs-threaded-comment-settings-button-click",C="sjs-threaded-comment-settings-dropdown-out-click",y="sjs-threaded-comment-menu-command",b="sjs-threaded-comment-view-display-updated",g=[d,a,l,u,h,m,f,_]},752:function(t,e,n){var i,o,s,r,d;n.r(e),n.d(e,{ContentBlocksComponent:function(){return c}}),i=n(994),o=n.n(i),s=n(637),r=n(186),d=n(231);class c extends i.ComponentBase{connectedCallback(){this.shadowRoot.innerHTML=`\n <style>\n ${i.CSSUtils.base()}\n .content-blocks-container {\n line-height: 20px;\n font-size: var(--sjs-content-blocks-font-size, 12px);\n font-weight: var(--sjs-content-blocks-font-weight, normal);\n font-style: var(--sjs-content-blocks-font-style, normal);\n text-decoration: var(--sjs-content-blocks-text-decoration, none);\n color: var(--sjs-content-blocks-color, ${i.CSSVariables.foreground});\n word-wrap: break-word;\n word-break: break-word;\n user-select: text;\n -webkit-user-select: text;\n padding-right: 12px;\n }\n sjs-text-block, sjs-mention-block, sjs-hyperlink-block { display: inline; }\n </style>\n <div class="content-blocks-container" part="content-blocks-container"></div>\n `,this.goe=this.shadowRoot.querySelector(".content-blocks-container"),this.wvo(),this.goe.addEventListener("sjs-link-click",(t=>{this.yvo(t)}))}yvo(t){const e=undefined,n=t.detail.href,i=(0,d.normalizeUrl)(n);window.open(i,"_blank")}Kbt(t){this.y4!==t&&(this.y4=t,this.wvo())}wvo(){this.y4&&this.goe&&(this.Qse(),this.Cvo())}Qse(){for(;this.goe.firstChild;)this.goe.removeChild(this.goe.firstChild)}Cvo(){this.y4&&this.y4.length&&this.y4.forEach((t=>{const e=this.Mvo(t);e&&this.goe.appendChild(e)}))}Mvo(t){switch(t.type){case s.ContentType.mention:return this.xvo(t);case s.ContentType.link:return this.Tvo(t);default:return this.Svo(t)}}Svo(t){const e=document.createElement("sjs-text-block");return e.Kbt(t),e}xvo(t){const e=document.createElement("sjs-mention-block");return(0,r.updateCurrentAuthor)(t.id,(t=>{e.Kbt(t)})),e}Tvo(t){const e=document.createElement("sjs-hyperlink-block");return e.Kbt(t),e}addContentBlock(t){this.y4||(this.y4=[]),this.y4.push(t),this.wvo()}clearContent(){this.y4=[],this.wvo()}getContentBlockCount(){return this.y4?this.y4.length:0}getContentBlocksByType(t){return this.y4?this.y4.filter((e=>e.type===t)):[]}}(0,i.s0r)("sjs-content-blocks",c)},758:function(t,e,n){var i;n.r(e),n.d(e,{SR:function(){return o}});const o={en:n(262)}},765:function(t,e,n){var i,o;n.r(e),n.d(e,{AddThreadedCommentReplyUndoAction:function(){return y},AddThreadedCommentUndoAction:function(){return v},NavigateNextThreadedCommentAction:function(){return w},NavigatePreviousThreadedCommentAction:function(){return T},RemoveThreadedCommentReplyUndoAction:function(){return b},RemoveThreadedCommentUndoAction:function(){return _},UpdateThreadedCommentReplyUndoAction:function(){return g},UpdateThreadedCommentUndoAction:function(){return C}}),i=n(376),o=n.n(i);let s=i.Commands.ActionBase;const r="addThreadedComment",d="removeThreadedComment",c="updateThreadedComment",a="addThreadedCommentReply",l="removeThreadedCommentReply",u="updateThreadedCommentReply",h="navigatePreviousThreadedComment",m="navigateNextThreadedComment";let f=i.Commands.zA;class p extends s{constructor(t,e){super(),this.Mf=t,this.tT=e}execute(){let t=this;if(t.canExecute()){let e=t.Mf;t.X5(e,!0),i.Commands.startTransaction(e.getParent(),t.tT);const n=t.mho(e);return i.Commands.endTransaction(e.getParent(),t.tT),t.q5(e,!0),n}return!1}undo(){let t=this,e=t.Mf;t.X5(e,!0);let n=i.Commands.TI(e.name());return e.Ut.undo(t.tT[n]),t.q5(e,!0),!0}}class v extends p{mho(t){let e,n=t.Ut.Vfo;const{row:i,col:o,replies:s}=this.tT;return n.add(i,o,s),!0}}class _ extends p{mho(t){let e,n=t.Ut.Vfo;const{row:i,col:o}=this.tT;return n.remove(i,o),!0}}class C extends p{mho(t){const{row:e,col:n,propertyName:o,value:s}=this.tT;let r=t.threadedComments.get(e,n);if(r){const e=r[o](),n={sheet:t,sheetName:t.name(),threadedComment:r,propertyName:o,oldValue:e,newValue:s,cancel:!1};if(t.ki(i.Events.ThreadedCommentChanging,n),n.cancel)return!1;r[o](s),t.ki(i.Events.ThreadedCommentChanged,{sheet:t,sheetName:t.name(),threadedComment:r,propertyName:o,oldValue:e,newValue:s})}return!0}}class y extends p{mho(t){const{row:e,col:n,reply:o}=this.tT;let s=t.threadedComments.get(e,n);if(s){const e=s.all().length,n=s.gho(o),r={sheet:t,sheetName:t.name(),threadedComment:s,propertyName:"reply",replyIndex:e,newValue:n,cancel:!1};if(t.ki(i.Events.ThreadedCommentChanging,r),r.cancel)return!1;s.add(n),t.ki(i.Events.ThreadedCommentChanged,{sheet:t,sheetName:t.name(),threadedComment:s,propertyName:"reply",replyIndex:e,newValue:n})}return!0}}class b extends p{mho(t){const{row:e,col:n,replyIndex:o}=this.tT;let s=t.threadedComments.get(e,n);if(s){const e=s.get(o),n={sheet:t,sheetName:t.name(),threadedComment:s,propertyName:"reply",replyIndex:o,oldValue:e,cancel:!1};if(t.ki(i.Events.ThreadedCommentChanging,n),n.cancel)return!1;s.remove(o),t.ki(i.Events.ThreadedCommentChanged,{sheet:t,sheetName:t.name(),threadedComment:s,propertyName:"reply",replyIndex:o,oldValue:e})}return!0}}class g extends p{mho(t){const{row:e,col:n,replyIndex:o,reply:s}=this.tT;let r=t.threadedComments.get(e,n);if(r){const e=r.get(o),n=r.gho(s,o),d={sheet:t,sheetName:t.name(),threadedComment:r,propertyName:"reply",replyIndex:o,oldValue:e,newValue:n,cancel:!1};if(t.ki(i.Events.ThreadedCommentChanging,d),d.cancel)return!1;r.set(o,n),t.ki(i.Events.ThreadedCommentChanged,{sheet:t,sheetName:t.name(),threadedComment:r,propertyName:"reply",replyIndex:o,oldValue:e,newValue:n})}return!0}}function x(t){const e=t.threadedComments.mW();e&&(e.apo=!0)}class T{constructor(t,e){this.Mf=t,this.tT=e}execute(){let t=this,e=t.Mf;const{crossSheet:n,wrap:i,silent:o}=t.tT,s=e.parent;let r=s.getActiveSheet(),d=r.getActiveRowIndex(),c=r.getActiveColumnIndex();const a=r.threadedComments.bho().reverse();let l=a.find((t=>t.row()<d||t.row()===d&&t.col()<c));if(l){const t=r.getSelections();r.t4(l.row(),l.col(),void 0,void 0,0),r.jA(t),x(r)}else if(n){const t=s.getActiveSheetIndex(),e=s.sheets,n=e.length;for(let o=1;o<n;o++){const d=(t-o+n)%n;if(!i&&d===n-1)break;const c=e[d];if(c&&c.threadedComments&&c.threadedComments.size()>0){s.setActiveSheetIndex(d),r=c;const t=undefined;l=c.threadedComments.all().reverse()[0];const e=r.getSelections();r.t4(l.row(),l.col(),void 0,void 0,0),r.jA(e),x(r);break}}}if(!l&&i&&a.length>0){l=a[0];const t=r.getSelections();r.t4(l.row(),l.col(),void 0,void 0,0),r.jA(t),x(r)}return l&&(o||(d=r.getActiveRowIndex(),c=r.getActiveColumnIndex(),r.threadedComments.pho(d,c),x(r))),!0}}class w{constructor(t,e){this.Mf=t,this.tT=e}execute(){let t=this,e=t.Mf;const{crossSheet:n,wrap:i,silent:o}=t.tT,s=e.parent;let r=s.getActiveSheet(),d=r.getActiveRowIndex(),c=r.getActiveColumnIndex();const a=r.threadedComments.bho();let l=a.find((t=>t.row()>d||t.row()===d&&t.col()>c));if(l){const t=r.getSelections();r.t4(l.row(),l.col(),void 0,void 0,0),r.jA(t),x(r)}else if(n){const t=s.getActiveSheetIndex(),e=s.sheets,n=e.length;for(let o=1;o<n;o++){const d=(t+o)%n;if(!i&&0===d)break;const c=e[d];if(c&&c.threadedComments&&c.threadedComments.size()>0){s.setActiveSheetIndex(d),r=c;const t=undefined;l=c.threadedComments.all()[0];const e=r.getSelections();r.t4(l.row(),l.col(),void 0,void 0,0),r.jA(e),x(r);break}}}if(!l&&i&&a.length>0){l=a[0];const t=r.getSelections();r.t4(l.row(),l.col(),void 0,void 0,0),r.jA(t),x(r)}return l&&(o||(d=r.getActiveRowIndex(),c=r.getActiveColumnIndex(),r.threadedComments.pho(d,c),x(r))),!0}}i.Commands[r]={canUndo:!0,execute:function(t,e,n){return f(t,v,e,n)}},i.Commands[d]={canUndo:!0,execute:function(t,e,n){return f(t,_,e,n)}},i.Commands[c]={canUndo:!0,execute:function(t,e,n){return f(t,C,e,n)}},i.Commands[a]={canUndo:!0,execute:function(t,e,n){return f(t,y,e,n)}},i.Commands[l]={canUndo:!0,execute:function(t,e,n){return f(t,b,e,n)}},i.Commands[u]={canUndo:!0,execute:function(t,e,n){return f(t,g,e,n)}},i.Commands[m]={canUndo:!1,execute:function(t,e,n){return f(t,w,e,n)}},i.Commands[h]={canUndo:!1,execute:function(t,e,n){return f(t,T,e,n)}};let k=function(t){t.register(r,i.Commands[r]),t.register(d,i.Commands[d]),t.register(c,i.Commands[c]),t.register(a,i.Commands[a]),t.register(l,i.Commands[l]),t.register(u,i.Commands[u]),t.register(m,i.Commands[m]),t.register(h,i.Commands[h])};i.Commands.yho=k},780:function(t,e,n){var i,o,s;n.r(e),n.d(e,{Reply:function(){return r},replyToIReply:function(){return d}}),i=n(376),o=n.n(i),s=n(637);class r{constructor(t){this.assignId(),this.message=null==t?void 0:t.message,this.createdAt=null==t?void 0:t.createdAt,this.authorId=null==t?void 0:t.authorId}toJSON(t){var e,n;const i={createdAt:null===(e=this.createdAt)||void 0===e?void 0:e.toISOString(),authorId:this.authorId,message:null===(n=this.message)||void 0===n?void 0:n.map((t=>(0,s.cloneContentBlock)(t)))};if(null==t?void 0:t.isServer){const t=i;return t.__ID__=this.jKe(),t}return i}fromJSON(t){var e;const n=this,i=t;return i.__ID__&&(n.__ID__=i.__ID__),n.createdAt=t.createdAt?new Date(t.createdAt):void 0,n.authorId=t.authorId,n.message=null===(e=t.message)||void 0===e?void 0:e.map((t=>(0,s.cloneContentBlock)(t))),n}clone(){var t;let e=this;const n=new r({message:null===(t=e.message)||void 0===t?void 0:t.map((t=>(0,s.cloneContentBlock)(t))),createdAt:e.createdAt,authorId:e.authorId});return n.UKn(e.jKe()),n}}function d(t){var e;if(t)return{message:null===(e=t.message)||void 0===e?void 0:e.map((t=>(0,s.cloneContentBlock)(t))),createdAt:t.createdAt,authorId:t.authorId}}(0,i.qDr)(r)},788:function(t,e,n){var i,o,s,r,d;n.r(e),n.d(e,{fromSJSThreadedComment:function(){return y},replyToCapabilityCommentText:function(){return f},toSJSThreadedComment:function(){return _}}),i=n(637),o=n(376),s=n.n(o),r=n(234),d=n.n(r);const c=r.Common.UserManager,a=r.Common.UUIDGenerator,l=o.util.vo,u=o.util.n1;function h(t){const e=t.map((t=>t.url)).join("");let n=-1;const i=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}for(let t=0;t<e.length;t++){const o=undefined;n=n>>>8^i[255&(n^255&e.charCodeAt(t))]}return~n>>>0}function m(t,e,n){if(!t||!Array.isArray(t))return{};const s=[],r=[];let d="",c=0;for(let l=0;l<t.length;l++){const u=t[l];switch(u.type){case i.ContentType.text:c+=u.value.length,d+=u.value;break;case i.ContentType.mention:const t=u.userId;if(!t)continue;const l=(0,o.getExcelUUIDByUserId)(t,e,n);if(!l)continue;const{uuid:h,user:m}=l,f=`@${m.name}`;s.push({mentionpersonId:h,mentionId:a.secureUpperCaseUUID(),startIndex:c,length:f.length}),c+=f.length,d+=f;break;case i.ContentType.link:r.push({url:u.href,startIndex:c,length:u.text.length,ns_:"xltc2:"}),c+=u.text.length,d+=u.text}}const u={text:{v_:l(d)}};return s.length>0&&(u.mentions={mention:s}),r.length>0&&(u.extLst={ext:{r_:[72,73],ns_:"x:",checksum:{ns_:"xltc2:",v_:h(r)},hyperlink:r}}),u}function f(t){const e=t.message;let n="";for(const t of e)switch(t.type){case i.ContentType.text:n+=t.value;break;case i.ContentType.mention:const e=t.userId;if(!e)continue;let o=c.Hfo(e);o||(o=c.ZX(e)),n+=`@${o.name} `;break;case i.ContentType.link:n+=t.text}return n}function p(t){return new Date(/(Z|[+-]\d{2}:\d{2})$/.test(t)?t:t+"Z")}function v(t){const e=undefined,n=undefined;return t.toISOString().replace(/Z$/,"").replace(/(\.\d{2})\d+$/,"$1")}function _(t,e,n,i,s,r){const d=m(t.message,n,r),c=(0,o.getExcelUUIDByUserId)(t.authorId,n,r);if(!c)return{};const{uuid:l}=c;return{ref:e,dT:v(t.createdAt),personId:l,id:a.secureUpperCaseUUID(),parentId:i,done:s?"1":void 0,text:d.text,mentions:d.mentions,extLst:d.extLst}}function C(t){var e,n,o,s;if(!t)return[];const r=[],d=null===(e=t.mentions)||void 0===e?void 0:e.mention,c=Array.isArray(d)?d:d?[d]:[],a=null===(o=null===(n=t.extLst)||void 0===n?void 0:n.ext)||void 0===o?void 0:o.hyperlink,l=Array.isArray(a)?a:a?[a]:[];let h=u((null===(s=t.text)||void 0===s?void 0:s.v_)||"").replace(/\r\n/g,"\n");if(!c.length&&!l.length)return h?[{type:i.ContentType.text,value:h}]:[];const m=[...c.map((t=>({type:i.ContentType.mention,index:+t.startIndex,length:+t.length,value:t}))),...l.map((t=>({type:i.ContentType.link,index:+t.startIndex,length:+t.length,value:t})))].sort(((t,e)=>t.index-e.index));let f=0;m[0].index>0&&(r.push({type:i.ContentType.text,value:h.substring(0,m[0].index)}),f=m[0].index);for(const t of m)f<t.index&&(r.push({type:i.ContentType.text,value:h.substring(f,t.index)}),f=t.index),t.type===i.ContentType.mention?r.push({type:i.ContentType.mention,userId:t.value.mentionpersonId}):t.type===i.ContentType.link&&r.push({type:i.ContentType.link,href:t.value.url,text:h.substring(t.index,t.index+t.length)}),f+=t.length;return f<h.length&&r.push({type:i.ContentType.text,value:h.substring(f)}),r}function y(t){return{message:C(t),createdAt:p(t.dT),authorId:t.personId}}},795:function(t,e,n){var i,o,s,r;n.r(e),n.d(e,{ThreadedCommentFilterDropdown:function(){return o.ThreadedCommentFilterDropdown},ThreadedCommentFilterType:function(){return o.ThreadedCommentFilterType},ThreadedCommentList:function(){return s.ThreadedCommentList},ThreadedCommentNavigateButton:function(){return r.ThreadedCommentNavigateButton},ThreadedCommentPanel:function(){return i.ThreadedCommentPanel}}),i=n(405),o=n(352),s=n(642),r=n(338)},802:function(t,e,n){var i,o,s,r,d;n.r(e),n.d(e,{ThreadedCommentView:function(){return u}}),i=n(186),o=n(376),s=n.n(o),r=n(731),d=n(637);let c=o.GC$,a=o.mt.En,l=null;class u{create(t,e,n,i){let o=this;o.Ti=c(t),o.Oho=e,o.DJ=n,o.Sbo=null==i?void 0:i.inPanel,o.Ldo={},o.opo()}opo(){let t=this;if(!t.Oho||!t.DJ)return;t.Wc=c(a("DIV")).addClass("gc-ui-threaded-comment-container"),t.Wc.css({width:`${r.Threaded_Comment_Container_Max_Width}px`,overflow:"visible",background:"transparent","min-height":"max-content"});const e=document.createElement("sjs-threaded-comment");t.spo=e,t.Sbo&&e.setAttribute("inPanel","true"),t.Wc[0].appendChild(t.spo),t.Wc.appendTo(t.Ti),t.updateDisplay(),t.aY()}aY(){let t=this;(t.spo||t.spo)&&(t.Ldo[r.Threaded_Comment_Component_Reply_Delete_Event]=function(e){t.DJ.commandManager().execute({cmd:"removeThreadedCommentReply",sheetName:t.DJ.getActiveSheet().name(),row:t.Oho.row(),col:t.Oho.col(),replyIndex:e.detail.index}),t.$ji=void 0},t.Ldo[r.Threaded_Comment_Component_Comment_Delete_Event]=function(e){t.DJ.commandManager().execute({cmd:"removeThreadedComment",sheetName:t.DJ.getActiveSheet().name(),row:t.Oho.row(),col:t.Oho.col()})},t.Ldo[r.Threaded_Comment_Component_Resolve_Event]=function(e){t.DJ.commandManager().execute({cmd:"updateThreadedComment",sheetName:t.DJ.getActiveSheet().name(),row:t.Oho.row(),col:t.Oho.col(),propertyName:"resolved",value:!0})},t.Ldo[r.Threaded_Comment_Component_Reopen_Event]=function(e){t.DJ.commandManager().execute({cmd:"updateThreadedComment",sheetName:t.DJ.getActiveSheet().name(),row:t.Oho.row(),col:t.Oho.col(),propertyName:"resolved",value:!1})},t.Ldo[r.Threaded_Comment_Component_Editor_Submit_Event]=function(e){const n=e.detail.contentBlocks,i=e.detail.index,s=undefined;if(!1!==t.DJ.commandManager().execute({cmd:-1===i?"addThreadedCommentReply":"updateThreadedCommentReply",sheetName:t.DJ.getActiveSheet().name(),row:t.Oho.row(),col:t.Oho.col(),reply:{message:n},replyIndex:i})){const e=n.filter((t=>(null==t?void 0:t.type)===d.ContentType.mention)).map((t=>t.userId));if(e.length>0){const n=t.DJ.getActiveSheet();n.ki(o.Events.UserMentioned,{sheet:n,sheetName:n.name(),context:{type:o.MentionContextType.threadedComment,threadedComment:t.Oho,replyIndex:-1===i?t.Oho.Mdo.length-1:i},userIds:e})}}},t.Ldo[r.Threaded_Comment_Component_Activate_Event]=function(e){const n=t.Oho.row(),i=t.Oho.col(),s=t.DJ.getActiveSheet();if(t.apo=!0,s.getActiveRowIndex()!==n||s.getActiveColumnIndex()!==i){let r=s.Ut.getSelections(),d=[new o.Range(n,i,1,1)];s.EA(r,d),s.t4(n,i,void 0,void 0,0),s.jA(r),t.$ji=null==e?void 0:e.isCollapse,t.updateDisplay()}t.Sbo||(t.ggo=s,o.hi.F1(null))},t.Ldo[r.Threaded_Comment_Component_Collapse_Event]=function(e){var n;(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.changeCollapseState)&&(t.$ji=!t.$ji,t.updateDisplay())},t.Ldo[r.Threaded_Comment_Component_Editor_Cancel_Event]=function(e){const n=undefined;-1===e.detail.index&&0===t.Oho.Mdo.length&&t.DJ.commandManager().execute({cmd:"removeThreadedComment",sheetName:t.DJ.getActiveSheet().name(),row:t.Oho.row(),col:t.Oho.col()})},t.Ldo[r.Threaded_Comment_Component_Edit_Event]=function(e){e.isCollapse=!0,t.Ldo[r.Threaded_Comment_Component_Activate_Event](e)},t.Ldo[r.Threaded_Comment_Component_Edit_End_Event]=function(e){const n=o.hi.ai(),i=t.ggo;i&&!n&&o.hi.F1(i),t.ggo=null},t.spo.addEventListener(r.Threaded_Comment_Component_Reply_Delete_Event,t.Ldo[r.Threaded_Comment_Component_Reply_Delete_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Comment_Delete_Event,t.Ldo[r.Threaded_Comment_Component_Comment_Delete_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Resolve_Event,t.Ldo[r.Threaded_Comment_Component_Resolve_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Reopen_Event,t.Ldo[r.Threaded_Comment_Component_Reopen_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Editor_Submit_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Submit_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Activate_Event,t.Ldo[r.Threaded_Comment_Component_Activate_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Collapse_Event,t.Ldo[r.Threaded_Comment_Component_Collapse_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Editor_Cancel_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Cancel_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Edit_Event,t.Ldo[r.Threaded_Comment_Component_Edit_Event]),t.spo.addEventListener(r.Threaded_Comment_Component_Edit_End_Event,t.Ldo[r.Threaded_Comment_Component_Edit_End_Event]))}KX(){let t=this;t.Wc&&(t.Wc.unbind("mouseenter"),t.Wc.unbind("mouseleave")),t.spo&&(t.spo.removeEventListener(r.Threaded_Comment_Component_Reply_Delete_Event,t.Ldo[r.Threaded_Comment_Component_Reply_Delete_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Comment_Delete_Event,t.Ldo[r.Threaded_Comment_Component_Comment_Delete_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Resolve_Event,t.Ldo[r.Threaded_Comment_Component_Resolve_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Reopen_Event,t.Ldo[r.Threaded_Comment_Component_Reopen_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Editor_Submit_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Submit_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Activate_Event,t.Ldo[r.Threaded_Comment_Component_Activate_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Collapse_Event,t.Ldo[r.Threaded_Comment_Component_Collapse_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Editor_Cancel_Event,t.Ldo[r.Threaded_Comment_Component_Editor_Cancel_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Edit_Event,t.Ldo[r.Threaded_Comment_Component_Edit_Event]),t.spo.removeEventListener(r.Threaded_Comment_Component_Edit_End_Event,t.Ldo[r.Threaded_Comment_Component_Edit_End_Event]))}dispose(){let t=this;t.ggo&&!o.hi.ai()&&(t.ggo.t4(t.Oho.row(),t.Oho.col(),void 0,void 0,1),o.hi.F1(t.ggo),t.ggo=null),t.Wc&&t.Wc.remove(),t.KX(),t.Ti=l,t.Oho=l,t.DJ=l,t.spo=l,t.Wc=l}updateDisplay(t){var e,n;let s=this,d=s.Oho;if(!d||!s.spo)return;const c=d.Mdo,a=(null==t?void 0:t.isActive)||s.DJ.getActiveSheet().getActiveRowIndex()===d.row()&&s.DJ.getActiveSheet().getActiveColumnIndex()===d.col();let l;void 0!==s.$ji?l=s.$ji:(l=!a,s.$ji=l);const u=null===(n=null===(e=s.DJ)||void 0===e?void 0:e.collaboration)||void 0===n?void 0:n.getPermission(),h=1===(null==u?void 0:u.mode),m=(0,i.threadedCommentToThreadedCommentComponentData)(c,o.range_parser.jc(new o.Range(d.row(),d.col(),1,1)),d.resolved(),h,a,l);s.spo.setValue(m),s.Ti&&s.Ti.length>0&&s.Ti.trigger(r.Threaded_Comment_View_Display_Updated_Event,{view:s})}startEdit(){let t;this.spo.startEdit()}endEdit(){this.updateDisplay()}}},844:function(e){e.exports=t.Spread.Sheets.Comments},860:function(t,e,n){var i,o,s,r,d,c,a;n.r(e),n.d(e,{ReplyComponent:function(){return h}}),i=n(994),o=n.n(i),s=n(731),r=n(186),d=n(758),c=n(234),a=n.n(c);const l=new c.Common.ResourceManager(d.SR,"ThreadedComment"),u=l.getResource.bind(l);class h extends i.ComponentBase{connectedCallback(){this.shadowRoot.innerHTML=`\n <style>\n ${i.CSSUtils.base()}\n .reply-root {\n ${i.CSSUtils.rowFlex("flex-start")}\n align-items: flex-start;\n }\n .reply-root > * + * {\n margin-left: 8px;\n }\n .reply-avatar {\n flex: 0 0 auto;\n }\n .reply-message {\n flex: 1 1 auto;\n min-width: 0;\n }\n </style>\n <div class="reply-root" part="reply-root" role="article" aria-label="${u().Aria_Comment_Reply}">\n <sjs-avatar class="reply-avatar" part="reply-avatar" aria-hidden="true"></sjs-avatar>\n <sjs-message class="reply-message" part="reply-message"></sjs-message>\n </div>\n `,this.cho=this.shadowRoot.querySelector(".reply-avatar"),this.Yvo=this.shadowRoot.querySelector(".reply-message"),this.E3t(),this.Zvo()}Kbt(t){this.y4!==t&&(this.y4=t,this.E3t())}E3t(){this.y4&&(this.cho&&(0,r.updateCurrentAuthor)(this.y4.author,(t=>{this.cho.Kbt({name:t.name,avatar:t.avatar,color:t.color})})),this.Yvo&&this.Yvo.Kbt({author:this.y4.author,content:this.y4.content,timestamp:this.y4.timestamp,operators:this.y4.operators,ref:this.y4.ref,index:this.y4.index}))}Zvo(){if(this.Yvo){const t=undefined;s.All_Threaded_Comment_Component_Events.forEach((t=>{this.Yvo.addEventListener(t,(e=>{this.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e.detail}))}))}))}}getMessage(){return this.Yvo}uQ(){var t;return(null===(t=this.Yvo)||void 0===t?void 0:t.uQ())||!1}}(0,i.s0r)("sjs-reply",h)},919:function(t,e,n){var i,o,s,r,d,c,a,l,u,h,m,f,p;n.r(e),n.d(e,{ContentBlocksEditorComponent:function(){return y}}),i=n(994),o=n.n(i),s=n(961),r=n(116),d=n(606),c=n(925),a=n(231),l=n(51),u=n(758),h=n(234),m=n.n(h),f=n(376),p=n.n(f);const v=f.util.Tt.safari,_=new h.Common.ResourceManager(u.SR,"ThreadedComment"),C=_.getResource.bind(_);class y extends i.ComponentBase{constructor(){super(...arguments),this.Mor=C().Editor_Placeholder}connectedCallback(){this.shadowRoot.innerHTML=`\n <style>\n ${s.EDITOR_STYLES}\n </style>\n ${s.EDITOR_TEMPLATE}\n `,this.Ado(),this.kdo(),this.Ido(),this.Dn()}disconnectedCallback(){this.Ndo(),!v&&this.Wp&&this.Wp.clear()}Kbt(t){this.y4!==t&&(this.y4=t,this.Dn(),!v&&this.Wp&&(this.Wp.clear(),this.Wp.saveState("initial",!0)))}clearValue(){this.y4=[],this.Dn(),!v&&this.Wp&&this.Wp.clear()}showButtons(){this.jdo=!0,this._do()}hideButtons(){this.jdo=!1,this._do()}setPlaceholder(t){this.Mor=t,this.Ddo()}Ado(){this.j0t={editorContainer:this.shadowRoot.querySelector(".editor-container"),editorInput:this.shadowRoot.querySelector(".editor-input"),buttonsContainer:this.shadowRoot.querySelector(".buttons-container"),postButton:this.shadowRoot.querySelector(".post-button"),cancelButton:this.shadowRoot.querySelector(".cancel-button"),mentionListContainer:this.shadowRoot.querySelector(".mention-component-container")},this.Odo=this.shadowRoot.querySelector("sjs-mention-list")}kdo(){this.Edo=new r.MentionHandler(this.Odo,this.j0t.mentionListContainer,this.j0t.editorInput),this.Rdo=new d.LinkHandler(this.j0t.editorInput),this.Wp=new l.UndoManager(this.j0t.editorInput),this.Ldo=new c.EventHandlers(this.j0t,this.Edo,this.Rdo,this,this.Wp),this.Fdo=this.Ldo.getBoundHandlers()}Ido(){this.j0t.editorInput.addEventListener("beforeinput",this.Fdo.beforeinput),this.j0t.editorInput.addEventListener("input",this.Fdo.input),this.j0t.editorInput.addEventListener("keydown",this.Fdo.keydown),this.j0t.editorInput.addEventListener("paste",this.Fdo.paste),this.j0t.editorInput.addEventListener("focus",this.Fdo.focus),this.j0t.editorInput.addEventListener("blur",this.Fdo.blur),this.j0t.editorInput.addEventListener("compositionstart",this.Fdo.compositionstart),this.j0t.editorInput.addEventListener("compositionend",this.Fdo.compositionend),this.j0t.postButton.addEventListener("click",this.Fdo.post),this.j0t.cancelButton.addEventListener("click",this.Fdo.cancel),this.Odo.addEventListener("sjs-mention-submit",this.Fdo.mentionSelect),window.addEventListener("resize",this.Fdo.windowResize)}Ndo(){window.removeEventListener("resize",this.Fdo.windowResize),this.j0t.editorInput&&(this.j0t.editorInput.removeEventListener("beforeinput",this.Fdo.beforeinput),this.j0t.editorInput.removeEventListener("input",this.Fdo.input),this.j0t.editorInput.removeEventListener("keydown",this.Fdo.keydown),this.j0t.editorInput.removeEventListener("paste",this.Fdo.paste),this.j0t.editorInput.removeEventListener("focus",this.Fdo.focus),this.j0t.editorInput.removeEventListener("blur",this.Fdo.blur),this.j0t.editorInput.removeEventListener("compositionstart",this.Fdo.compositionstart),this.j0t.editorInput.removeEventListener("compositionend",this.Fdo.compositionend)),this.j0t.postButton&&this.j0t.postButton.removeEventListener("click",this.Fdo.post),this.j0t.cancelButton&&this.j0t.cancelButton.removeEventListener("click",this.Fdo.cancel),this.Odo&&this.Odo.removeEventListener("sjs-mention-submit",this.Fdo.mentionSelect)}Dn(){this.j0t.editorInput&&(this.y4&&this.y4.length>0?this.Bdo():this.j0t.editorInput.innerHTML="",this.Pdo(),this._do(),this.Ddo())}Bdo(){this.j0t.editorInput.innerHTML="",this.y4.forEach((t=>{const e=a.DOMUtils.createNativeElement(t);e&&this.j0t.editorInput.appendChild(e)}))}Pdo(){var t;const e=(null===(t=this.j0t.editorInput.textContent)||void 0===t?void 0:t.trim().length)>0;this.j0t.postButton.disabled=!e}_do(){this.j0t.editorContainer&&this.j0t.buttonsContainer&&this.j0t.editorInput&&(this.jdo?this.j0t.buttonsContainer.classList.remove("hidden"):this.j0t.buttonsContainer.classList.add("hidden"))}Ddo(){this.j0t.editorInput&&this.j0t.editorInput.setAttribute("data-placeholder",this.Mor||C().Comment_Editor_Placeholder)}focus(){this.j0t.editorInput&&requestAnimationFrame((()=>{setTimeout((()=>{var t;const e=document.createRange(),n=a.DOMUtils.getSelection(this.j0t.editorInput);if(this.j0t.editorInput.childNodes.length>0)e.selectNodeContents(this.j0t.editorInput),e.collapse(!1);else{const t=document.createTextNode("");this.j0t.editorInput.appendChild(t),e.setStart(t,0),e.setEnd(t,0)}n&&(n.removeAllRanges(),n.addRange(e)),this.j0t.editorInput.focus(),n&&0===n.rangeCount&&n.addRange(e),!v&&this.Wp&&0===this.Wp.getUndoStackSize()&&this.Wp.saveState("initial",!0),null===(t=this.Edo)||void 0===t||t.exitMentionEditingState(),this.Pdo()}),0)}))}blur(){var t;this.j0t.editorInput&&(this.j0t.editorInput.blur(),this.parentElement.focus(),null===(t=this.Edo)||void 0===t||t.exitMentionEditingState())}getContent(){return this.Ldo?this.Ldo.Gdo():[]}isEmpty(){var t;return 0===(null===(t=this.j0t.editorInput.textContent)||void 0===t?void 0:t.trim().length)}isEditingMention(){var t;return(null===(t=this.Edo)||void 0===t?void 0:t.isEditingMention)||!1}exitMentionEditingState(){var t;null===(t=this.Edo)||void 0===t||t.exitMentionEditingState()}}(0,i.s0r)("sjs-content-blocks-editor",y)},925:function(t,e,n){var i,o,s,r,d;n.r(e),n.d(e,{EventHandlers:function(){return u}}),i=n(637),o=n(731),s=n(231),r=n(376),d=n.n(r);const c=r.util.Tt.safari,a=r.util.Qf(),l=s.TextInsertionUtils.insertBrForWrapline;class u{constructor(t,e,n,i,o){this.bwo=!1,this.j0t=t,this.Edo=e,this.Rdo=n,this.Udo=i,this.Wp=o}getBoundHandlers(){return{beforeinput:this.gpo.bind(this),input:this.xrr.bind(this),keydown:this.Hdo.bind(this),paste:this.Vdo.bind(this),post:this.zdo.bind(this),cancel:this.Ydo.bind(this),mentionSelect:this.Zdo.bind(this),windowResize:this.Wdo.bind(this),focus:this.GRi.bind(this),blur:this.WRi.bind(this),compositionstart:this.ywo.bind(this),compositionend:this.wwo.bind(this)}}gpo(t){if("historyUndo"===t.inputType){if(c)return;return t.preventDefault(),void(this.Wp.canUndo()&&(this.Wp.undo(),this.Pdo()))}if("historyRedo"===t.inputType){if(c)return;return t.preventDefault(),void(this.Wp.canRedo()&&(this.Wp.redo(),this.Pdo()))}c||this.bwo||this.Wp.isUndoRedoing()||("deleteContentBackward"===t.inputType||"deleteContentForward"===t.inputType||"deleteByCut"===t.inputType?this.Wp.saveState("delete",!0):"insertText"===t.inputType?this.Wp.saveState("typing",!1):"insertParagraph"!==t.inputType&&"insertLineBreak"!==t.inputType||this.Wp.saveState("format",!0)),this.Rdo.processHyperlinkBeforeInput(t)}xrr(t){"insertText"===t.inputType&&"@"===t.data?queueMicrotask((()=>{this.Edo.onMentionTrigger()})):this.Edo.isEditingMention&&this.Edo.onMentionEditing(t);const e="insertText"===t.inputType&&" "===t.data,n="insertText"===t.inputType&&"\n"===t.data||"insertParagraph"===t.inputType||"insertLineBreak"===t.inputType,i=undefined;(e||n)&&queueMicrotask((()=>{this.Rdo.mayConvertUrl()&&this.Rdo.detectAndConvertUrlBeforeCursor()})),this.Pdo()}Hdo(t){t.stopPropagation();const e=a&&t.metaKey&&"z"===t.key&&!t.shiftKey||!a&&t.ctrlKey&&"z"===t.key&&!t.shiftKey,n=a&&t.metaKey&&"z"===t.key&&t.shiftKey||!a&&t.ctrlKey&&("y"===t.key||"z"===t.key&&t.shiftKey);if(e){if(c)return;return t.preventDefault(),void(this.Wp.canUndo()&&(this.Wp.undo(),this.Pdo()))}if(n){if(c)return;return t.preventDefault(),void(this.Wp.canRedo()&&(this.Wp.redo(),this.Pdo()))}this.Edo.isEditingMention?"Escape"===t.key?(this.Edo.exitMentionEditingState(),t.preventDefault()):t.shiftKey&&"Enter"===t.key&&!this.Edo.selectCurrentMention()?(this.Edo.exitMentionEditingState(),c||(this.Wp.saveState("format",!0),l(this.j0t.editorInput))):"ArrowUp"===t.key?(this.Edo.navigateMentionList(-1),t.preventDefault()):"ArrowDown"===t.key?(this.Edo.navigateMentionList(1),t.preventDefault()):"Enter"!==t.key&&"Tab"!==t.key||(this.Edo.selectCurrentMention(),t.preventDefault()):"Enter"!==t.key||t.ctrlKey?"Backspace"===t.key?(this.Qdo(t)||this.Oyo(t))&&t.preventDefault():"Delete"===t.key?(this.Qdo(t)||this.Ryo(t))&&t.preventDefault():"ArrowLeft"===t.key?this.jyo(t):"ArrowRight"===t.key?this.Lyo(t):"Enter"===t.key&&t.ctrlKey?(this.zdo(),t.preventDefault()):"Escape"===t.key&&(this.Ydo(),t.preventDefault()):c||(this.Wp.saveState("format",!0),t.preventDefault(),l(this.j0t.editorInput))}Wdo(){this.Edo.isEditingMention&&"block"===this.j0t.mentionListContainer.style.display&&this.Edo.positionMentionList()}GRi(t){this.Udo.showButtons(),this.Udo.dispatchEvent(new CustomEvent(o.Threaded_Comment_Component_Edit_Event,{bubbles:!0}))}WRi(t){this.Udo.dispatchEvent(new CustomEvent(o.Threaded_Comment_Component_Edit_End_Event,{bubbles:!0}))}Vdo(t){var e,n;t.preventDefault(),c||this.Wp.saveState("paste",!0);let i=(null===(e=t.clipboardData)||void 0===e?void 0:e.getData("text/plain"))||"";if(!i){const e=(null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html"))||"";e&&(i=this.Jgo(e))}i&&(s.TextInsertionUtils.insertTextAtCursor(this.j0t.editorInput,i),this.Pdo())}Jgo(t){const e=document.createElement("div");e.innerHTML=t;const n=t=>{let e="";for(const i of Array.from(t.childNodes))if(i.nodeType===Node.TEXT_NODE)e+=i.textContent||"";else if(i.nodeType===Node.ELEMENT_NODE){const t=i.tagName.toUpperCase();"BR"===t?e+="\n":["DIV","P","H1","H2","H3","H4","H5","H6"].includes(t)?(e&&!e.endsWith("\n")&&(e+="\n"),e+=n(i),e&&!e.endsWith("\n")&&(e+="\n")):e+=n(i)}return e};return n(e).trim()}zdo(){const t=this;if(t.j0t.postButton.disabled)return;const e=t.Gdo();t.Udo.hideButtons(),t.Udo.clearValue(),t.Udo.blur(),t.Udo.dispatchEvent(new CustomEvent(o.Threaded_Comment_Component_Editor_Submit_Event,{bubbles:!0,detail:{contentBlocks:e}}))}Ydo(){this.j0t.editorInput.innerHTML="",this.Edo.exitMentionEditingState(),this.Udo.hideButtons(),this.Udo.clearValue(),this.Udo.blur(),this.Udo.dispatchEvent(new CustomEvent(o.Threaded_Comment_Component_Editor_Cancel_Event,{bubbles:!0}))}Zdo(t){const e=t.detail;c||this.Wp.saveState("mention",!0),this.Edo.insertMention(e),this.Pdo()}Qdo(t){var e,n,i,o;const r=s.DOMUtils.getSelection(this.j0t.editorInput);if(!r||0===r.rangeCount)return!1;const d=r.getRangeAt(0);let a=null,l=d.commonAncestorContainer;for(;l&&l!==this.j0t.editorInput;){if(l.nodeType===Node.ELEMENT_NODE&&(null===(e=l.classList)||void 0===e?void 0:e.contains("native-mention"))){a=l;break}l=l.parentNode}if(!a)if("Backspace"===t.key){const t=s.DOMUtils.getPreviousNode(d);t&&(null===(n=t.classList)||void 0===n?void 0:n.contains("native-mention"))&&(d.startContainer.nodeType===Node.ELEMENT_NODE||d.startContainer.nodeType===Node.TEXT_NODE&&0===d.startOffset)&&(a=t)}else if("Delete"===t.key){const t=s.DOMUtils.getNextNode(d);if(t&&(null===(i=t.classList)||void 0===i?void 0:i.contains("native-mention"))){const e=d.startContainer;(e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&d.startOffset===(null===(o=e.textContent)||void 0===o?void 0:o.length))&&(a=t)}}return!!a&&(c||this.Wp.saveState("delete",!0),a.remove(),t.preventDefault(),this.Pdo(),!0)}Fyo(t){return t===s.ZERO_WIDTH_CHAR}Byo(t){return t.nodeType===Node.TEXT_NODE&&0===(t.textContent||"").length}Pyo(t){return t.length>0&&t.split("").every((t=>this.Fyo(t)))}Gyo(t){if(t.nodeType!==Node.TEXT_NODE)return!1;const e=t.textContent||"";return this.Pyo(e)}Uyo(t){return this.Byo(t)||this.Gyo(t)}Hyo(t){let e=t.previousSibling;for(;e&&this.Byo(e);)e=e.previousSibling;return e}Vyo(t){let e=t.nextSibling;for(;e&&e.nodeType===Node.TEXT_NODE;){const t=e.textContent||"";if(0!==t.length){if(this.Fyo(t[0]))return e;break}e=e.nextSibling}return null}zyo(t,e){const n=undefined,i=(t.textContent||"")[0];if(this.Fyo(i)&&(0===e||1===e)){let e=t.previousSibling;for(;e;)if(this.Byo(e))e=e.previousSibling;else{if("BR"===e.nodeName){const n=undefined;return{zeroWidthCharNode:t,previousTextNode:this.Hyo(e)}}e=e.previousSibling}}if(0===e){const e=this.Hyo(t);if(e&&e.nodeType===Node.TEXT_NODE){const t=e.textContent||"";if(t.length>0&&this.Fyo(t[t.length-1])){const t=this.Hyo(e);if(t&&"BR"===t.nodeName){const n=undefined;return{zeroWidthCharNode:e,previousTextNode:this.Hyo(t)}}}}}return null}Yyo(t,e){const n=t.textContent||"",i=undefined;if(e===n.length){let e=t.nextSibling;for(;e&&this.Uyo(e);)e=e.nextSibling;if(e&&"BR"===e.nodeName){const t=this.Vyo(e);if(t)return{zeroWidthCharNode:t,offset:1}}}if(0===e&&n.length>0&&this.Fyo(n[0]))return{zeroWidthCharNode:t,offset:0};const o=n.substring(e);if(this.Pyo(o)){let e=t.nextSibling;for(;e&&this.Uyo(e);)e=e.nextSibling;if(e&&"BR"===e.nodeName){const t=this.Vyo(e);if(t)return{zeroWidthCharNode:t,offset:1}}}return null}Zyo(){const t=s.DOMUtils.getSelection(this.j0t.editorInput);if(!t||0===t.rangeCount)return null;const e=undefined;if(!t.getRangeAt(0).collapsed)return null;const n=t.anchorNode,i=t.anchorOffset;return n&&n.nodeType===Node.TEXT_NODE?{selection:t,anchorNode:n,anchorOffset:i}:null}Wyo(t,e){const n=document.createRange();if(e&&e.nodeType===Node.TEXT_NODE){const t=(e.textContent||"").length;n.setStart(e,t),n.setEnd(e,t)}else e?(n.setStartAfter(e),n.setEndAfter(e)):(n.setStart(this.j0t.editorInput,0),n.setEnd(this.j0t.editorInput,0));t.removeAllRanges(),t.addRange(n)}Qyo(t,e,n){const i=document.createRange(),o=Math.min(n,(e.textContent||"").length);i.setStart(e,o),i.setEnd(e,o),t.removeAllRanges(),t.addRange(i)}Kyo(t){var e,n;let i=t.previousSibling;for(;i&&"BR"!==i.nodeName;){const t=i.previousSibling;null===(e=i.parentNode)||void 0===e||e.removeChild(i),i=t}i&&"BR"===i.nodeName&&(null===(n=i.parentNode)||void 0===n||n.removeChild(i))}Jyo(t){var e;const n=t.textContent||"";n.length>0&&this.Fyo(n[0])&&(t.deleteData(0,1),""===t.textContent&&(null===(e=t.parentNode)||void 0===e||e.removeChild(t)))}$yo(t){var e;let n=t;for(;n&&"BR"!==n.nodeName;){const t=n.nextSibling;this.Uyo(n)&&(null===(e=n.parentNode)||void 0===e||e.removeChild(n)),n=t}return n&&"BR"===n.nodeName?n:null}Xyo(t){var e,n,i;let o=t.nextSibling;for(null===(e=t.parentNode)||void 0===e||e.removeChild(t);o;){if(o.nodeType===Node.TEXT_NODE){const t=o.textContent||"";if(0===t.length){const t=o.nextSibling;null===(n=o.parentNode)||void 0===n||n.removeChild(o),o=t;continue}if(this.Fyo(t[0])&&(o.deleteData(0,1),""===o.textContent)){const t=o.nextSibling;null===(i=o.parentNode)||void 0===i||i.removeChild(o),o=t;continue}break}break}}Oyo(t){const e=this.Zyo();if(!e)return!1;const{selection:n,anchorNode:i,anchorOffset:o}=e,s=this.zyo(i,o);if(!s||!s.zeroWidthCharNode)return!1;const r=s.zeroWidthCharNode,d=s.previousTextNode;return this.Kyo(r),this.Jyo(r),this.Wyo(n,d),this.Pdo(),!0}Ryo(t){const e=this.Zyo();if(!e)return!1;const{selection:n,anchorNode:i,anchorOffset:o}=e,s=this.Yyo(i,o);if(!s||!s.zeroWidthCharNode)return!1;const r=undefined,d=(i.textContent||"").substring(o),c=i,a=o;this.Pyo(d)&&i.deleteData(o,d.length);const l=this.$yo(i.nextSibling);return l&&this.Xyo(l),this.Qyo(n,c,a),this.Pdo(),!0}jyo(t){const e=this.Zyo();if(!e)return;const{selection:n,anchorNode:i,anchorOffset:o}=e,s=this.zyo(i,o);s&&s.previousTextNode&&(this.Wyo(n,s.previousTextNode),t.preventDefault())}Lyo(t){const e=this.Zyo();if(!e)return;const{selection:n,anchorNode:i,anchorOffset:o}=e,s=this.Yyo(i,o);if(!s||!s.zeroWidthCharNode)return;const r=s.zeroWidthCharNode,d=r.textContent||"",c=document.createRange();if(0===s.offset){const t=Math.min(2,d.length);c.setStart(r,t),c.setEnd(r,t)}else c.setStart(r,1),c.setEnd(r,1);n.removeAllRanges(),n.addRange(c),t.preventDefault()}mgo(t,e){t&&0!==t.length&&t.forEach((t=>{var n,i;if(t.nodeType===Node.ELEMENT_NODE){const o=null===(n=t.tagName)||void 0===n?void 0:n.toUpperCase();if("DIV"===o||"P"===o){if(t.childNodes&&t.childNodes.length>0){const n=t.childNodes[0];n.nodeType===Node.ELEMENT_NODE&&"BR"===(null===(i=n.tagName)||void 0===i?void 0:i.toUpperCase())||e.push(document.createElement("BR")),this.mgo(t.childNodes,e)}}else e.push(t)}else e.push(t)}))}Gdo(){const t=[],e=[];return this.mgo(this.j0t.editorInput.childNodes,e),e.forEach((e=>{e.nodeType===Node.TEXT_NODE?this.Kmo(e,t):e.nodeType===Node.ELEMENT_NODE&&this.Jmo(e,t)})),this.Xmo(t)}Kmo(t,e){let n=t.textContent||"";if(!n)return;if(n=n.replace(/\u200b/g,""),!n)return;const i=n.split("\n");i.forEach(((t,n)=>{this.$mo(t,e),this.qmo(n,i.length,e)}))}$mo(t,e){const n=t;if(n)if(c){const t=this.Rdo.bpo(n);e.push(...t)}else e.push({type:i.ContentType.text,value:n})}qmo(t,e,n){t<e-1&&n.push({type:i.ContentType.text,value:"\n"})}Jmo(t,e){this.tgo(t)?this.ngo(e):this.ego(t)?this.igo(t,e):this.rgo(t)&&this.ogo(t,e)}tgo(t){var e;return"BR"===(null===(e=t.tagName)||void 0===e?void 0:e.toUpperCase())}ego(t){return t.classList.contains("native-mention")}rgo(t){return t.classList.contains("native-hyperlink")}ngo(t){t.push({type:i.ContentType.text,value:"\n"})}igo(t,e){const n=t.getAttribute("data-mention-id");n&&e.push({type:i.ContentType.mention,userId:n})}ogo(t,e){const n=t.getAttribute("data-link-url"),o=t.getAttribute("data-link-text");n&&o&&e.push({type:i.ContentType.link,href:n,text:o})}Xmo(t){const e=[];let n=null;return t.forEach((t=>{if(t.type===i.ContentType.text){const o=Object.assign({},t);if(o.value&&(o.value=o.value.replace(/\u200b/g,"")),!o.value)return;n&&n.type===i.ContentType.text?n.value+=o.value:(n=o,e.push(n))}else n=null,e.push(t)})),e}Pdo(){var t;const e=(null===(t=this.j0t.editorInput.textContent)||void 0===t?void 0:t.trim().length)>0;this.j0t.postButton.disabled=!e}ywo(t){this.bwo=!0,c||!this.Wp||this.Wp.isUndoRedoing()||this.Wp.saveState("typing",!0)}wwo(t){this.bwo=!1}}},961:function(t,e,n){var i,o;n.r(e),n.d(e,{EDITOR_STYLES:function(){return s},EDITOR_TEMPLATE:function(){return r}}),i=n(994),o=n.n(i);const s=`\n ${i.CSSUtils.base()}\n :host {\n display: block;\n width: 100%;\n }\n .editor-container {\n position: relative;\n border-radius: 6px;\n background: ${i.CSSVariables.background};\n display: flex;\n flex-direction: column;\n width: 100%;\n }\n .editor-input {\n flex: 1;\n padding: 4px;\n outline: none;\n font-family: ${i.CSSVariables.fontFamily};\n font-size: 12px;\n line-height: 1.5;\n color: ${i.CSSVariables.foreground};\n white-space: pre-wrap;\n word-wrap: break-word;\n overflow-y: auto;\n background: transparent;\n width: 100%;\n max-height: 150px;\n min-height: 24px;\n border: 1px solid ${i.CSSVariables.borderColor};\n border-radius: 4px;\n user-select: text;\n -webkit-user-select: text;\n cursor: text;\n -webkit-nbsp-mode: space;\n -webkit-user-modify: read-write;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: default;\n }\n .editor-input:empty:before {\n content: attr(data-placeholder);\n color: ${i.CSSVariables.foreground};\n opacity: 0.7;\n }\n /* Native mention spans using shared styles */\n .native-mention {\n ${i.CSSUtils.mentionBlockStyle}\n }\n .native-mention:hover {\n ${i.CSSUtils.mentionBlockHoverStyle}\n }\n /* Native hyperlink spans using shared styles */\n .native-hyperlink {\n ${i.CSSUtils.hyperlinkBlockStyle},\n cursor: text;\n }\n .native-hyperlink:hover {\n ${i.CSSUtils.hyperlinkBlockHoverStyle}\n cursor: text;\n }\n /* Text elements using shared styles */\n .native-text {\n ${i.CSSUtils.textBlockStyle}\n }\n .buttons-container {\n display: flex;\n justify-content: flex-end;\n margin-top: 8px;\n }\n .buttons-container > * + * {\n margin-left: 8px;\n }\n .buttons-container.hidden {\n display: none;\n }\n .editor-container.deactive .editor-input {\n cursor: text;\n }\n .editor-container.deactive .editor-input:focus {\n outline: none;\n }\n .editor-button {\n ${i.CSSUtils.buttonBase}\n ${i.CSSUtils.rowFlex("center","center")}\n padding: 0px 12px;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n transition: all 0.2s ease;\n height: 20px;\n }\n .editor-button > * + * {\n margin-left: 6px;\n }\n .post-button {\n background: ${i.CSSVariables.accent};\n color: ${i.CSSVariables.accentColor};\n border: 1px solid ${i.CSSVariables.accent};\n }\n .post-button:hover:not (:disabled) {\n opacity: 0.9;\n }\n .post-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .post-button .button-icon {\n fill: ${i.CSSVariables.accentColor};\n }\n .cancel-button {\n background: transparent;\n color: ${i.CSSVariables.foreground};\n border: 1px solid ${i.CSSVariables.borderColor};\n }\n .cancel-button:hover {\n background: ${i.CSSVariables.lightGrayBg};\n }\n .mention-component-container {\n background-color: transparent;\n position: fixed;\n z-index: 1001;\n display: none;\n }\n .button-icon {\n width: 12px;\n height: 12px;\n fill: currentColor;\n background: transparent;\n }\n .editor-button svg {\n background: transparent;\n }\n .editor-button svg path {\n stroke: ${i.CSSVariables.foreground};\n fill: ${i.CSSVariables.foreground};\n }\n .editor-button svg #Post-Message path {\n stroke: #FFFFFF;\n fill: #FFFFFF;\n }\n .editor-container .editor-input:focus {\n border: 1px solid ${i.CSSVariables.accent};\n }\n .editor-container .editor-input.warning-input {\n border: 1px solid #ff4444;\n }\n`,r=`\n <div class="editor-container" part="editor-container">\n <div class="editor-input"\n contenteditable="true"\n data-placeholder="Enter your comment..."\n part="editor-input">\n </div>\n <div class="buttons-container" part="buttons-container">\n <button class="editor-button post-button" type="button" disabled>\n ${i.Icons.post}\n </button>\n <button class="editor-button cancel-button" type="button">\n ${i.Icons.cancel}\n </button>\n </div>\n <div class="mention-component-container" part="mention-component-container">\n <sjs-mention-list></sjs-mention-list>\n </div>\n </div>\n`},994:function(e){e.exports=t.Spread.Sheets.Components}},i={},o,s,r,d,c,a,l,u,h,m;function f(t){var e,o=i[t];return void 0!==o?o.exports:(e=i[t]={exports:{}},n[t](e,e.exports,f),e.exports)}f.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return f.d(e,{a:e}),e},f.d=function(t,e){for(var n in e)f.o(e,n)&&!f.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},f.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},f.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e={},f.r(e),f.d(e,{AddThreadedCommentReplyUndoAction:function(){return u.AddThreadedCommentReplyUndoAction},AddThreadedCommentUndoAction:function(){return u.AddThreadedCommentUndoAction},ContentBlocksComponent:function(){return l.ContentBlocksComponent},ContentBlocksEditorComponent:function(){return l.ContentBlocksEditorComponent},ContentType:function(){return s.ContentType},MessageComponent:function(){return l.MessageComponent},NavigateNextThreadedCommentAction:function(){return u.NavigateNextThreadedCommentAction},NavigatePreviousThreadedCommentAction:function(){return u.NavigatePreviousThreadedCommentAction},RemoveThreadedCommentReplyUndoAction:function(){return u.RemoveThreadedCommentReplyUndoAction},RemoveThreadedCommentUndoAction:function(){return u.RemoveThreadedCommentUndoAction},Reply:function(){return r.Reply},ReplyComponent:function(){return l.ReplyComponent},SR:function(){return o.SR},ThreadedComment:function(){return d.ThreadedComment},ThreadedCommentComponent:function(){return l.ThreadedCommentComponent},ThreadedCommentFilterDropdown:function(){return m.ThreadedCommentFilterDropdown},ThreadedCommentFilterType:function(){return m.ThreadedCommentFilterType},ThreadedCommentList:function(){return m.ThreadedCommentList},ThreadedCommentManager:function(){return a.ThreadedCommentManager},ThreadedCommentMenuComponent:function(){return l.ThreadedCommentMenuComponent},ThreadedCommentNavigateButton:function(){return m.ThreadedCommentNavigateButton},ThreadedCommentPanel:function(){return m.ThreadedCommentPanel},ThreadedCommentView:function(){return h.ThreadedCommentView},UpdateThreadedCommentReplyUndoAction:function(){return u.UpdateThreadedCommentReplyUndoAction},UpdateThreadedCommentUndoAction:function(){return u.UpdateThreadedCommentUndoAction},cloneContentBlock:function(){return s.cloneContentBlock},fromSJSThreadedComment:function(){return c.fromSJSThreadedComment},replyToCapabilityCommentText:function(){return c.replyToCapabilityCommentText},replyToIReply:function(){return r.replyToIReply},toSJSThreadedComment:function(){return c.toSJSThreadedComment}}),o=f(758),s=f(637),r=f(780),d=f(151),c=f(788),a=f(729),l=f(344),u=f(765),h=f(802),m=f(795),(((t=void 0===t?{}:t).Spread=t.Spread||{}).Sheets=t.Spread.Sheets||{}).ThreadedComments=e}()}));
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/gc.spread.sheets.threadedcomments.min.js');
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@mescius/spread-sheets-threaded-comments",
3
+ "version": "19.0.0",
4
+ "main": "index.js",
5
+ "description":"SpreadJS sheets threaded comments module",
6
+ "scripts": {},
7
+ "keywords": [
8
+ "spread-sheets-threaded-comments",
9
+ "spreadjs-sheets-threaded-comments",
10
+ "threaded-comments",
11
+ "spread",
12
+ "sheet",
13
+ "javascript",
14
+ "excel",
15
+ "mescius",
16
+ "spreadjs"
17
+ ],
18
+ "dependencies": {
19
+ "@mescius/spread-common": "19.0.0",
20
+ "@mescius/spread-sheets-core": "19.0.0",
21
+ "@mescius/spread-sheets-comments": "19.0.0",
22
+ "@mescius/spread-sheets-components": "19.0.0"
23
+ },
24
+ "author": {
25
+ "email": "us.sales@mescius.com",
26
+ "name": "MESCIUS inc"
27
+ },
28
+ "homepage": "https://developer.mescius.com/spreadjs",
29
+ "license": "Commercial"
30
+ }