1 line
49 KiB
JavaScript
1 line
49 KiB
JavaScript
|
|
(()=>{"use strict";var e,t={9786:(e,t,n)=>{var o=n(2833),r=n(2427),s=n.n(r),c=n(6931),a=n.n(c);function i(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),m=()=>Math.random().toString(36).substring(7).split("").join("."),u={INIT:`@@redux/INIT${m()}`,REPLACE:`@@redux/REPLACE${m()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${m()}`};function d(e,t,n){if("function"!=typeof e)throw new Error(i(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(i(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(i(1));return n(d)(e,t)}let o=e,r=t,s=new Map,c=s,a=0,m=!1;function p(){c===s&&(c=new Map,s.forEach((e,t)=>{c.set(t,e)}))}function f(){if(m)throw new Error(i(3));return r}function h(e){if("function"!=typeof e)throw new Error(i(4));if(m)throw new Error(i(5));let t=!0;p();const n=a++;return c.set(n,e),function(){if(t){if(m)throw new Error(i(6));t=!1,p(),c.delete(n),s=null}}}function y(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(i(7));if(void 0===e.type)throw new Error(i(8));if("string"!=typeof e.type)throw new Error(i(17));if(m)throw new Error(i(9));try{m=!0,r=o(r,e)}finally{m=!1}return(s=c).forEach(e=>{e()}),e}return y({type:u.INIT}),{dispatch:y,subscribe:h,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw new Error(i(10));o=e,y({type:u.REPLACE})},[l]:function(){const e=h;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(i(11));function n(){const e=t;e.next&&e.next(f())}return n(),{unsubscribe:e(n)}},[l](){return this}}}}}function p(e,t,n){const o=e.get(t);return void 0===o?n:o}class f{commentElements=new Map;commentAnnotations=new Map;commentTabs=new Map;commentDesiredPositions=new Map;commentHeights=new Map;pinnedComment=null;commentCalculatedPositions=new Map;isDirty=!1;setCommentElement(e,t){null!==t?this.commentElements.set(e,t):this.commentElements.delete(e),this.isDirty=!0}setCommentAnnotation(e,t){this.commentAnnotations.set(e,t),this.commentTabs.set(e,t.getTab()||null),this.updateDesiredPosition(e),this.isDirty=!0}setCommentHeight(e,t){this.commentHeights.get(e)!==t&&(this.commentHeights.set(e,t),this.isDirty=!0)}setPinnedComment(e){this.pinnedComment=e,this.isDirty=!0}updateDesiredPosition(e){const t=this.commentAnnotations.get(e);if(!t)return;const n=t.getAnchorNode(e===this.pinnedComment);let o=n.getBoundingClientRect().top,r=n.parentElement;for(;r;)o+=r.scrollTop,r=r.parentElement;this.commentDesiredPositions.set(e,0!==o?o+-50:0)}refreshDesiredPositions(e=null){const t=new Map(this.commentDesiredPositions);this.commentAnnotations.forEach((t,n)=>{this.getCommentTabVisible(e,n)&&this.updateDesiredPosition(n)}),this.commentDesiredPositions!==t&&(this.isDirty=!0)}refreshLayout(){if(!this.isDirty)return!1;const e=Array.from(this.commentElements.keys()).map(e=>({tab:p(this.commentTabs,e,null),position:p(this.commentDesiredPositions,e,0),height:p(this.commentHeights,e,0),comments:[e],containsPinnedComment:null!==this.pinnedComment&&e===this.pinnedComment,pinnedCommentPosition:0})),t=new Map;e.forEach(e=>{const n=t.get(e.tab)||[];n.push(e),t.set(e.tab,n)});const n=this.pinnedComment?this.commentDesiredPositions.get(this.pinnedComment):void 0,o=this.pinnedComment?this.commentTabs.get(this.pinnedComment):void 0;return Array.from(t.entries()).forEach(([e,t])=>{const r=this.pinnedComment&&o===e;t.sort((e,t)=>e.position-t.position);let s=t,c=!0;for(;c;){c=!1;const e=[];let t=null;for(const o of s)t&&t.position+t.height+20>o.position?(c=!0,t.comments.push(...o.comments),o.containsPinnedComment&&(t.containsPinnedComment=!0,t.pinnedCommentPosition=o.pinnedCommentPosition+t.height),t.height+=o.height,!r&&t.p
|