From c541b04b923c4d1d1cf03429cae8e6ea203b0213 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 28 Mar 2023 16:44:27 +0000 Subject: [PATCH] ci: Release scripts [skip ci] ## [1.4.10](https://github.com/mjpieters/SO-userscripts/compare/v1.4.9...v1.4.10) (2023-03-28) ### Bug Fixes * **connected-users:** better user link handling ([e8b1d2f](https://github.com/mjpieters/SO-userscripts/commit/e8b1d2fb1a6b725b889821d246d654ee930a3490)) --- dist/bookmark-users.meta.js | 6 +++--- dist/bookmark-users.user.js | 6 +++--- dist/connected-users.meta.js | 6 +++--- dist/connected-users.user.js | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist/bookmark-users.meta.js b/dist/bookmark-users.meta.js index 38003627..975f05b8 100644 --- a/dist/bookmark-users.meta.js +++ b/dist/bookmark-users.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Bookmark Users // @description Shows what user bookmarked a question. Fetches the bookmarking users from the StackExchange data explorer (data can be up to a week old) -// @version 1.4.9 +// @version 1.4.10 // @author Martijn Pieters // @homepage https://github.com/mjpieters/SO-userscripts/tree/main/scripts/bookmark-users // @supportURL https://github.com/mjpieters/SO-userscripts/issues?q=is:issue+is%3Aopen+label:bookmark-users @@ -12,9 +12,9 @@ // @match http*://*.mathoverflow.net/questions/* // @match http*://*.stackexchange.com/questions/* // @connect data.stackexchange.com -// @downloadURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/bookmark-users.user.js +// @downloadURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/bookmark-users.user.js // @grant GM_xmlhttpRequest // @grant GM_addStyle // @namespace https://github.com/mjpieters/SO-userscripts -// @updateURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/bookmark-users.meta.js +// @updateURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/bookmark-users.meta.js // ==/UserScript== diff --git a/dist/bookmark-users.user.js b/dist/bookmark-users.user.js index 0725614f..7c78a2bf 100644 --- a/dist/bookmark-users.user.js +++ b/dist/bookmark-users.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Bookmark Users // @description Shows what user bookmarked a question. Fetches the bookmarking users from the StackExchange data explorer (data can be up to a week old) -// @version 1.4.9 +// @version 1.4.10 // @author Martijn Pieters // @homepage https://github.com/mjpieters/SO-userscripts/tree/main/scripts/bookmark-users // @supportURL https://github.com/mjpieters/SO-userscripts/issues?q=is:issue+is%3Aopen+label:bookmark-users @@ -12,11 +12,11 @@ // @match http*://*.mathoverflow.net/questions/* // @match http*://*.stackexchange.com/questions/* // @connect data.stackexchange.com -// @downloadURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/bookmark-users.user.js +// @downloadURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/bookmark-users.user.js // @grant GM_xmlhttpRequest // @grant GM_addStyle // @namespace https://github.com/mjpieters/SO-userscripts -// @updateURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/bookmark-users.meta.js +// @updateURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/bookmark-users.meta.js // ==/UserScript== (()=>{"use strict";var t="9VvY5KWke5mKcflYkx)NDw((",e="https://api.stackexchange.com/2.3",n="!)69QNaSIc2a*QW(ccD0ph0dVbliY",r="us-bookmarkers",o="\n.".concat(r,"-content { min-height: min-content; }\n.").concat(r,"-popover .s-user-card__minimal .anonymous-gravatar {\n zoom:0.5;\n -moz-transform:scale(0.5);\n -moz-transform-origin: 0 0;\n}\n.").concat(r,"-popover .s-user-card__minimal .s-user-card--time {\n font-variant-numeric: tabular-nums;\n}\n");function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]1?r-1:0),a=1;a0?[4,y(b)]:[3,2];case 1:p.sent(),p.label=2;case 2:return[4,fetch(u.toString())];case 3:return[4,p.sent().json()];case 4:if(m=p.sent(),h.set(n,(new Date).getTime()+(null!==(w=m.backoff)&&void 0!==w?w:0)),m.error_id)throw new Error("".concat(m.error_name," (").concat(m.error_id,"): ").concat(m.error_message));return[2,m.items]}}))})),b.apply(this,arguments)}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},G=new Intl.NumberFormat("en-US",{notation:"compact",maximumSignificantDigits:3}),U=new Intl.NumberFormat("en-US",{useGrouping:!0}),H=function(){function t(){P(this,t),T(this,"user_id",void 0),T(this,"display_name",void 0),T(this,"link",void 0),T(this,"profile_image",void 0),T(this,"reputation",void 0),T(this,"is_employee",void 0),T(this,"user_type",void 0)}return A(t,[{key:"badges",get:function(){var t=[];switch(this.is_employee&&t.push('Staff'),this.user_type){case"moderator":t.push('Mod');break;case"team_admin":t.push('Admin')}return t.join(" ")}},{key:"abbreviated_reputation",get:function(){return this.reputation<1e4?U.format(this.reputation):G.format(this.reputation).toLowerCase()}},{key:"toHTML",value:function(t){return'\n \n ")}}]),t}(),N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&R(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=I(e);if(n){var o=I(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return M(this,t)});function o(t){var e;return P(this,o),(e=r.call(this)).user_id=parseInt(t),e.link="/users/".concat(t),e}return A(o,[{key:"toHTML",value:function(t){return StackExchange.options.user.isModerator?'\n \n "):'\n
\n \n
\n \n \n
\n \n
\n ")}}]),o}(H);function z(){return z=B((function(t){var e,r,o=arguments;return q(this,(function(a){switch(a.label){case 0:e=function(){var e,o,a;return q(this,(function(i){switch(i.label){case 0:return e=t.splice(0,100),t=t.splice(100),[4,O(v("users/".concat(e.join(";")),n))];case 1:return o=i.sent(),a=new Map(o.map((function(t){return[t.user_id.toFixed(0),Object.assign(new H,t)]}))),[5,C(k(S(e.reduce((function(t,e){var n=a.get(e);return void 0===n&&r&&(n=new N(e)),n?L(t).concat([n]):t}),[])),O))];case 2:return i.sent(),[2]}}))},r=o.length>1&&void 0!==o[1]&&o[1],a.label=1;case 1:return t.length>0?[5,C(e())]:[3,3];case 2:return a.sent(),[3,1];case 3:return[2]}}))})),z.apply(this,arguments)}function F(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return $=function(t){this.s=t,this.n=t.next},$.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new $(t)}function Q(t,e,n,r,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function K(t,e){for(var n=0;n\n'),et='\n
\n
\n'),nt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&X(t,e)}(s,Stacks.StacksController);var e,n,a,i,c,u=(i=s,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=W(i);if(c){var n=W(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return J(this,t)});function s(){var t;return Y(this,s),V(F(t=u.apply(this,arguments)),"state","initial"),V(F(t),"popoverElement",void 0),t}return e=s,n=[{key:"connect",value:function(){var t;"initial"===this.state&&(this.state="attached",Stacks.attachPopover(this.element,et),this.popoverElement=document.getElementById(null!==(t=this.element.getAttribute("aria-controls"))&&void 0!==t?t:""))}},{key:"showBookmarkers",value:function(){var t,e=this;return(t=function(){var t,n,r,o,a,i,c,u,s,l,f,p,d,y,h;return function(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]No bookmarkers known (yet)'),null==o||o.classList.add("mx-auto"),[3,14]);case 2:i=new Map(a.map((function(t){return[t.userId,t.date]}))),c=!1,u=!1,v.label=3;case 3:v.trys.push([3,8,9,14]),l=function(t){var e,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new $(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}(function(t){return z.apply(this,arguments)}(a.map((function(t){return t.userId})),!0)),v.label=4;case 4:return[4,l.next()];case 5:if(!(c=!(f=v.sent()).done))return[3,7];p=f.value,d=p,null==o||o.insertAdjacentHTML("beforeend",'
  • '.concat(d.toHTML(null!==(y=i.get(d.user_id.toFixed(0)))&&void 0!==y?y:"<unknown>"),"
  • ")),v.label=6;case 6:return c=!1,[3,4];case 7:return[3,14];case 8:return h=v.sent(),u=!0,s=h,[3,14];case 9:return v.trys.push([9,,12,13]),c&&null!=l.return?[4,l.return()]:[3,11];case 10:v.sent(),v.label=11;case 11:return[3,13];case 12:if(u)throw s;return[7];case 13:return[7];case 14:return e.state="loaded",null===(n=null===(r=e.popoverElement)||void 0===r?void 0:r.querySelector(".s-spinner"))||void 0===n||n.remove(),[2]}}))},function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){Q(a,r,o,i,c,"next",t)}function c(t){Q(a,r,o,i,c,"throw",t)}i(void 0)}))})()}}],a=[{key:"attach",value:function(t){var e,n;t&&(null===(e=t.querySelector(".js-bookmark-count"))||void 0===e?void 0:e.offsetParent)&&(s.style||(s.style=GM_addStyle(o)),t.insertAdjacentHTML("afterend",tt),null===(n=t.nextElementSibling)||void 0===n||n.insertAdjacentElement("beforeend",Svg.Person()[0]),Stacks.application.register(r,s))}}],n&&K(e.prototype,n),a&&K(e,a),s}();V(nt,"style",void 0),StackExchange.ready((function(){return nt.attach(document.querySelector(".js-bookmark-btn"))}))})(); \ No newline at end of file diff --git a/dist/connected-users.meta.js b/dist/connected-users.meta.js index da7d0b62..94d716d0 100644 --- a/dist/connected-users.meta.js +++ b/dist/connected-users.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Connected Users // @description **Moderator-only**. Hightlights users in the IP cross section view that overlap in time -// @version 1.4.9 +// @version 1.4.10 // @author Martijn Pieters // @homepage https://github.com/mjpieters/SO-userscripts/tree/main/scripts/connected-users // @supportURL https://github.com/mjpieters/SO-userscripts/issues?q=is:issue+is%3Aopen+label:connected-users @@ -12,7 +12,7 @@ // @match *://mathoverflow.net/admin/xref-user-ips/* // @match *://stackapps.com/admin/xref-user-ips/* // @match *://*.stackexchange.com/admin/xref-user-ips/* -// @downloadURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/connected-users.user.js +// @downloadURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/connected-users.user.js // @namespace https://github.com/mjpieters/SO-userscripts -// @updateURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/connected-users.meta.js +// @updateURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/connected-users.meta.js // ==/UserScript== diff --git a/dist/connected-users.user.js b/dist/connected-users.user.js index 9d39b339..a64c2316 100644 --- a/dist/connected-users.user.js +++ b/dist/connected-users.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Connected Users // @description **Moderator-only**. Hightlights users in the IP cross section view that overlap in time -// @version 1.4.9 +// @version 1.4.10 // @author Martijn Pieters // @homepage https://github.com/mjpieters/SO-userscripts/tree/main/scripts/connected-users // @supportURL https://github.com/mjpieters/SO-userscripts/issues?q=is:issue+is%3Aopen+label:connected-users @@ -12,9 +12,9 @@ // @match *://mathoverflow.net/admin/xref-user-ips/* // @match *://stackapps.com/admin/xref-user-ips/* // @match *://*.stackexchange.com/admin/xref-user-ips/* -// @downloadURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/connected-users.user.js +// @downloadURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/connected-users.user.js // @namespace https://github.com/mjpieters/SO-userscripts -// @updateURL https://github.com/mjpieters/SO-userscripts/raw/main/dist/connected-users.meta.js +// @updateURL https://github.com/mjpieters/SO-userscripts/releases/latest/download/connected-users.meta.js // ==/UserScript== -(()=>{"use strict";var t="us-mod-connected-users",e=")Q7.NL.wLaTOvZyxvEF8za4m(g8T";function n(t,e){for(var n=0;n=this.maxEntries&&this.values.delete(this.values.keys().next().value),this.values.set(t,e)}}])&&n(e.prototype,o),t}();const c='',s='';function u(t){return t.replace(/(?:[_-])([a-z0-9])/g,((t,e)=>e.toUpperCase()))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function f(t,e){const n=d(t);return Array.from(n.reduce(((t,n)=>(function(t,e){const n=t[e];return Array.isArray(n)?n:[]}(n,e).forEach((e=>t.add(e))),t)),new Set))}function d(t){const e=[];for(;t;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function h(t){return t.reduce(((t,[e,n])=>Object.assign(Object.assign({},t),{[e]:n})),{})}function p([t,e],n){return function(t){const e=`${r=t.token,r.replace(/([A-Z])/g,((t,e)=>`-${e.toLowerCase()}`))}-value`,n=function(t){const e=function(t){const e=y(t.typeObject.type);if(!e)return;const n=v(t.typeObject.default);if(e!==n){throw new Error(`The specified default value for the Stimulus Value "${t.controller?`${t.controller}.${t.token}`:t.token}" must match the defined type "${e}". The provided default value of "${t.typeObject.default}" is of type "${n}".`)}return e}({controller:t.controller,token:t.token,typeObject:t.typeDefinition}),n=v(t.typeDefinition),r=y(t.typeDefinition),o=e||n||r;if(o)return o;throw new Error(`Unknown value type "${t.controller?`${t.controller}.${t.typeDefinition}`:t.token}" for "${t.token}" value`)}(t);var r;return{type:n,key:e,name:u(e),get defaultValue(){return function(t){const e=y(t);if(e)return b[e];const n=t.default;return void 0!==n?n:t}(t.typeDefinition)},get hasCustomDefaultValue(){return void 0!==v(t.typeDefinition)},reader:g[n],writer:m[n]||m.default}}({controller:n,token:t,typeDefinition:e})}function y(t){switch(t){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function v(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(t)?"array":"[object Object]"===Object.prototype.toString.call(t)?"object":void 0}"function"==typeof Object.getOwnPropertySymbols||Object.getOwnPropertyNames,(()=>{try{!function(){const t=function(t){function e(){return Reflect.construct(t,arguments,new.target)}return e.prototype=Object.create(t.prototype,{constructor:{value:e}}),Reflect.setPrototypeOf(e,t),e}((function(){this.a.call(this)}));t.prototype.a=function(){},new t}()}catch(t){return t=>class extends t{}}})(),Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End"},h("abcdefghijklmnopqrstuvwxyz".split("").map((t=>[t,t])))),h("0123456789".split("").map((t=>[t,t]))));const b={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},g={array(t){const e=JSON.parse(t);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${t}" of type "${v(e)}"`);return e},boolean:t=>!("0"==t||"false"==String(t).toLowerCase()),number:t=>Number(t),object(t){const e=JSON.parse(t);if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${t}" of type "${v(e)}"`);return e},string:t=>t},m={default:function(t){return`${t}`},array:w,object:w};function w(t){return JSON.stringify(t)}class _{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(t,{target:e=this.element,detail:n={},prefix:r=this.identifier,bubbles:o=!0,cancelable:a=!0}={}){const i=new CustomEvent(r?`${r}:${t}`:t,{detail:n,bubbles:o,cancelable:a});return e.dispatchEvent(i),i}}_.blessings=[function(t){return f(t,"classes").reduce(((t,e)=>{return Object.assign(t,{[`${n=e}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${l(n)}Class`]:{get(){return this.classes.has(n)}}});var n}),{})},function(t){return f(t,"targets").reduce(((t,e)=>{return Object.assign(t,{[`${n=e}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${l(n)}Target`]:{get(){return this.targets.has(n)}}});var n}),{})},function(t){const e=function(t,e){return d(t).reduce(((t,n)=>(t.push(...function(t,e){const n=t[e];return n?Object.keys(n).map((t=>[t,n[t]])):[]}(n,e)),t)),[])}(t,"values"),n={valueDescriptorMap:{get(){return e.reduce(((t,e)=>{const n=p(e,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(t,{[r]:n})}),{})}}};return e.reduce(((t,e)=>Object.assign(t,function(t,e){const n=p(t,void 0),{key:r,name:o,reader:a,writer:i}=n;return{[o]:{get(){const t=this.data.get(r);return null!==t?a(t):n.defaultValue},set(t){void 0===t?this.data.delete(r):this.data.set(r,i(t))}},[`has${l(o)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}(e))),n)},function(t){return f(t,"outlets").reduce(((t,e)=>Object.assign(t,function(t){const e=u(t.replace(/--/g,"-").replace(/__/g,"_"));return{[`${e}Outlet`]:{get(){const e=this.outlets.find(t);if(e){const n=this.application.getControllerForElementAndIdentifier(e,t);if(n)return n;throw new Error(`Missing "data-controller=${t}" attribute on outlet element for "${this.identifier}" controller`)}throw new Error(`Missing outlet element "${t}" for "${this.identifier}" controller`)}},[`${e}Outlets`]:{get(){const e=this.outlets.findAll(t);return e.length>0?e.map((e=>{const n=this.application.getControllerForElementAndIdentifier(e,t);if(n)return n;console.warn(`The provided outlet element is missing the outlet controller "${t}" for "${this.identifier}"`,e)})).filter((t=>t)):[]}},[`${e}OutletElement`]:{get(){const e=this.outlets.find(t);if(e)return e;throw new Error(`Missing outlet element "${t}" for "${this.identifier}" controller`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(t)}},[`has${l(e)}Outlet`]:{get(){return this.outlets.has(t)}}}}(e))),{})}],_.targets=[],_.outlets=[],_.values={};const S={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};(class extends _{}).debounces=[];class k extends class{constructor(t,e={}){var n,r,o;this.log=(t,e)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${t}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},e)),this.logger.groupEnd())},this.warn=t=>{this.logger.warn(`%c${this.controller.identifier} %c${t}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(t,e={})=>{if(this.dispatchEvent){const{event:n}=e,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o{const n=this.controller[t];if("function"==typeof n)return n.call(this.controller,e)},this.extendedEvent=(t,e,n)=>{const{bubbles:r,cancelable:o,composed:a}=e||{bubbles:!0,cancelable:!0,composed:!0};return e&&Object.assign(n,{originalEvent:e}),new CustomEvent(this.composeEventName(t),{bubbles:r,cancelable:o,composed:a,detail:n})},this.composeEventName=t=>{let e=t;return!0===this.eventPrefix?e=`${this.controller.identifier}:${t}`:"string"==typeof this.eventPrefix&&(e=`${this.eventPrefix}:${t}`),e},this.debug=null!==(r=null!==(n=null==e?void 0:e.debug)&&void 0!==n?n:t.application.stimulusUseDebug)&&void 0!==r?r:S.debug,this.logger=null!==(o=null==e?void 0:e.logger)&&void 0!==o?o:S.logger,this.controller=t,this.controllerId=t.element.id||t.element.dataset.id,this.targetElement=(null==e?void 0:e.element)||t.element;const{dispatchEvent:a,eventPrefix:i}=Object.assign({},S,e);Object.assign(this,{dispatchEvent:a,eventPrefix:i}),this.controllerInitialize=t.initialize.bind(t),this.controllerConnect=t.connect.bind(t),this.controllerDisconnect=t.disconnect.bind(t)}}{constructor(t,e={}){super(t,e),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(t){this.controller.application.handleError(t,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=t=>{this.call("mutate",t),this.log("mutate",{entries:t}),this.dispatch("mutate",{entries:t})},this.targetElement=(null==e?void 0:e.element)||t.element,this.controller=t,this.options=e,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unobserve(),t()}})}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n{const n=new k(t,e);n.observe,n.unobserve})(this,{childList:!0,element:this.container}),this.checkEmpty()}},{key:"mutate",value:function(){this.checkEmpty()}},{key:"checkEmpty",value:function(){var t,e,n,r,o=this.children.length;0===o?((t=this.element.classList).remove.apply(t,C(this.notEmptyClasses)),(e=this.element.classList).add.apply(e,C(this.emptyClasses)),this.dispatch("empty",{target:this.container})):((n=this.element.classList).add.apply(n,C(this.notEmptyClasses)),(r=this.element.classList).remove.apply(r,C(this.emptyClasses)),this.dispatch("not-empty",{target:this.container,detail:{count:o}}))}}])&&x(e.prototype,n),i}();function R(t,e){var n=localStorage[t];return function(t){return![null,void 0,""].includes(t)}(n)?JSON.parse(n):e}A(U,"controllerId","empty-dom"),A(U,"targets",["container"]),A(U,"classes",["empty","notEmpty"]),A(U,"values",{scopeSelector:String});var L,M=function(t){return null!==t&&"object"==typeof t};function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F={openedSections:(L={},$(L,"".concat(t,"-connected-histogram"),!0),$(L,"".concat(t,"-connected"),!1),$(L,"".concat(t,"-focused"),!1),L),showOnlyConnected:!1};function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:200;return function(){for(var r=arguments.length,o=new Array(r),a=0;at.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]2&&void 0!==arguments[2]?arguments[2]:100;W(this,t),et(this,"apiKey",void 0),et(this,"defaultPageSize",void 0),et(this,"siteId",void 0),et(this,"notBeforeFutures",void 0),this.apiKey=e,this.defaultPageSize=r,this.notBeforeFutures=new Map,this.siteId=n||ft()}return tt(t,[{key:"fetch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this;return K((function(){var o,a,i,c;return st(this,(function(s){switch(s.label){case 0:return o=r.buildURL(t,e,n),[4,r.handleBackoff(t)];case 1:a=s.sent(),s.label=2;case 2:return s.trys.push([2,5,,6]),[4,fetch(o.toString())];case 3:return[4,s.sent().json()];case 4:return i=s.sent(),a((new Date).getTime()+1e3*(i.backoff||0)),[3,6];case 5:throw c=s.sent(),a(0),c;case 6:if(ut(i))throw lt.fromWrapper(i);return[2,i.items]}}))}))()}},{key:"buildURL",value:function(t,e,n){var r,o,a=new URLSearchParams((r=function(t){for(var e=1;e0?[4,(s=i,new Promise((function(t){return setTimeout(t,s)})))]:[3,3];case 2:c.sent(),c.label=3;case 3:return[2,a.resolve]}var s}))}))()}}]),t}();function vt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bt(t,e){for(var n=0;nStaff'),this.user_type){case"moderator":t.push('Mod');break;case"team_admin":t.push('Admin')}return t.join(" ")}},{key:"_abbreviated_reputation",get:function(){return this.reputation<1e4?jt.format(this.reputation):Ot.format(this.reputation).toLowerCase()}},{key:"toHTML",value:function(){return'\n \n ");var t}}]),t}(),At=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&St(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=wt(e);if(n){var o=wt(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return _t(this,t)});function o(t){var e;return vt(this,o),(e=r.call(this)).user_id=t,e.link="/users/".concat(t),e}return gt(o,[{key:"toHTML",value:function(){return'\n \n ")}}]),o}(xt);function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=new i(1e3),Dt=new yt("rSgJSoND0c32iHgumlM8vg((");function qt(){return qt=Mt((function(t){var n,r,o,a,i=arguments;return $t(this,(function(c){switch(c.label){case 0:n=function(){var n,i,c,s;return $t(this,(function(u){switch(u.label){case 0:return n=o.splice(0,100),o=o.splice(100),[4,Ut(Dt.fetch("/users/{ids}",{ids:n},{filter:e}))];case 1:return i=u.sent(),c=new Map(i.map((function(t){return[t.user_id,Object.assign(new xt,t)]}))),s=t.indexOf(n[n.length-1])+1,[5,Ft(Tt(Ct(t.splice(0,s).reduce((function(t,e){var n=a.get(e)||c.get(e);return void 0===n&&r&&(n=new At(e)),n&&Bt.put(e,n),n?Lt(t).concat([n]):t}),[])),Ut))];case 2:return u.sent(),t=t.splice(s),[2]}}))},r=i.length>1&&void 0!==i[1]&&i[1],o=[],a=new Map(t.reduce((function(t,e){var n=Bt.get(e);return n?Lt(t).concat([[e,n]]):(o.push(e),t)}),[])),c.label=1;case 1:return o.length>0?[5,Ft(n())]:[3,3];case 2:return c.sent(),[3,1];case 3:return[5,Ft(Tt(Ct(t.map((function(t){return Bt.get(t)}))),Ut))];case 4:return c.sent(),[2]}}))})),qt.apply(this,arguments)}function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]').concat(te,""))}}],n&&Vt(e.prototype,n),r&&Vt(e,r),c}();Jt(ee,"controllerId","".concat(t,"-user-list")),Jt(ee,"targets",["count","userRow"]),Jt(ee,"classes",["userCard"]);function ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]1&&void 0!==arguments[1])||arguments[1],n=this;if(this.svgTarget.replaceChildren(),this._buckets=[],0!==t.length){for(var r=t[t.length-1].count,o=t[0].count,a=r;a<=o;a++)this._buckets.push({connCount:a,userCount:0,label:"Overlapping on ".concat(a," ip(s)")});if(t.forEach((function(t){var e=t.count;return n._buckets[e-r].userCount+=1})),this._buckets.length>20){for(var i=Math.ceil(this._buckets.length/20),c=[],s=0;s10*h,console.log("Histogram scale uses log?",this._logScale),this._buckets.length<=1||(this._drawBarChart(),this._adjustThresholdClasses(this._buckets[0].connCount),e&&this.dispatch("click",{detail:this._buckets[0]}))}}},{key:"_drawBarChart",value:function(){var t,e=this,n=5*this._buckets.length+1,r=n*this._svgRatio;this.svgTarget.setAttribute("viewBox","0 0 ".concat(n," ").concat(r));var o=this._logScale?function(t){return t>0?Math.log10(t)||.15:t}:function(t){return t},a=(t=Math).max.apply(t,function(t){return function(t){if(Array.isArray(t))return ne(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||de(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this._buckets.map((function(t){return t.userCount})))),i=r/o(a),c=.005*r;this.svgTarget.insertAdjacentHTML("beforeend",'\n \n \n '));for(var s=this.svgTarget.querySelector("g.gridLines"),u=this._logScale?function(t){return Math.pow(10,Math.floor(Math.log10(t||1)))}:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.max(Math.floor(a/10),1);return e},l=0;l')),l+=u(l)}this._buckets.forEach((function(t,n){var a=o(t.userCount)*i,c='\n \n ').concat(t.label,": ").concat(t.userCount," account").concat(1===t.userCount?"":"s","\n \n ");e.svgTarget.insertAdjacentHTML("beforeend",c)}))}}],r=[{key:"afterLoad",value:function(t){document.head.insertAdjacentHTML("beforeend",'"))}}],n&&ae(e.prototype,n),r&&ae(e,r),c}();function ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n').concat(s,' Focus\n\n \n');function Te(t){return luxon.Interval.fromDateTimes.apply(this,Array.from(t.querySelectorAll("td .relativetime[title]")).map((function(t){return e=t.title,luxon.DateTime.fromISO(e.replace(" ","T"),{zone:"utc"});var e})))}var Ce=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Se(t,e)}(u,Stacks.StacksController);var n,r,o,i,c,s=(i=u,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=we(i);if(c){var n=we(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return _e(this,t)});function u(){var t;return be(this,u),me(ve(t=s.apply(this,arguments)),"_belowThreshold",void 0),me(ve(t),"_showOnlyConnected",void 0),me(ve(t),"_refreshId",null),t}return n=u,r=[{key:"_userRows",get:function(){return Array.from(this.element.querySelectorAll("tbody > tr[data-uid]"))}},{key:"_mainUserRow",get:function(){return this.element.querySelector("tbody .".concat(je))}},{key:"_focusUserRows",get:function(){var t=new Set(z.focusedUsers);return this._userRows.filter((function(e){return t.has(parseInt(e.dataset.uid||"0"))}))}},{key:"_focusIntervals",get:function(){return[this._mainUserRow].concat(ke(this._focusUserRows)).map((function(t){return Te(t)}))}},{key:"_connectedUserRows",get:function(){var t=this._focusIntervals,e=new Set(z.focusedUsers);return this._userRows.filter((function(n){if(n.classList.contains(je))return!1;var r=parseInt(n.dataset.uid||"0");if(e.has(r))return!1;var o=Te(n);return t.some((function(t){return t.overlaps(o)}))}))}},{key:"connectedUsers",get:function(){return this._connectedUserRows.map((function(t){return parseInt(t.dataset.uid||"0")}))}},{key:"_updateMarkup",value:function(){var t;this.element.querySelectorAll("tbody tr").forEach((function(t){var e=t.querySelector("td a");t.dataset.uid=(null==e?void 0:e.href.split("/").pop())||"0"}));var e=location.pathname.split("/").pop()||"0";null===(t=this.element.querySelector('tr[data-uid="'.concat(e,'"]')))||void 0===t||t.classList.add(je)}},{key:"connect",value:function(){this._updateMarkup(),this._belowThreshold=new Set,this._showOnlyConnected=z.xrefUIState.showOnlyConnected,this._addFocusButtons(),this._updateClasses()}},{key:"_addFocusButtons",value:function(){this._userRows.forEach((function(e){var n,r=e.dataset.uid||"0",o="".concat(a(t),"UidParam");null===(n=e.querySelector("td a"))||void 0===n||n.insertAdjacentHTML("beforebegin",Ie),e.querySelectorAll("td .s-btn[data-action]").forEach((function(t){return t.dataset[o]=r}))}))}},{key:"_updateClasses",value:function(){var t=this;if(this._userRows.forEach((function(t){t.classList.remove(xe,Ae,"d-none"),delete t.dataset.connected})),this._focusUserRows.forEach((function(t){t.classList.add(xe)})),this._connectedUserRows.forEach((function(e){var n=parseInt(e.dataset.uid||"0");e.classList.toggle(Ae,!t._belowThreshold.has(n))})),this._showOnlyConnected){var e=[je,xe,Ae];this._userRows.forEach((function(t){e.some((function(e){return t.classList.contains(e)}))||t.classList.add("d-none")}))}}},{key:"refresh",value:function(t){var e=this;void 0!==t&&(this._showOnlyConnected=t),null===this._refreshId&&(this._refreshId=window.requestAnimationFrame((function(){e._updateClasses(),e._refreshId=null})))}},{key:"updateUsersBelowThreshold",value:function(t,e){this._belowThreshold=new Set(e.reduce((function(e,n){var r=n.uid;return n.count').concat(Ee,""))}}],r&&ge(n.prototype,r),o&&ge(n,o),u}();function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n \n\n');function Ve(t){return t.toFormat("yyyy/MM/dd")}var Je,Ke=function(t){var e=t.controllerId;return"".concat(a(e),"OutletConnected")}(pe),We=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Be(t,e)}(f,Stacks.StacksController);var n,r,o,i,u,l=(i=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=$e(i);if(u){var n=$e(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Fe(this,t)});function f(){var t;return Re(this,f),Me(Ue(t=l.apply(this,arguments)),"_threshold",0),Me(Ue(t),"_refreshId",null),t}return n=f,r=[{key:"_ipGroups",get:function(){return this[function(t){var e=t.controllerId;return"".concat(a("".concat(e)),"Outlets")}(Ce)]}},{key:"_histogram",get:function(){return this[function(t){var e=t.controllerId;return"".concat(a("".concat(e)),"Outlet")}(pe)]}},{key:"_uiDiv",get:function(){var e=this.element.querySelector(".s-".concat(this.identifier));if(null===e){var n,r=document.createElement("div");r.insertAdjacentHTML("afterbegin",Ge);var o=r.firstElementChild;o.querySelectorAll('[data-controller="s-expandable-control"]').forEach((function(t){var e,n=t.getAttribute("aria-controls");n&&z.xrefUIState.openedSections[n]&&(t.setAttribute("aria-expanded","true"),null===(e=o.querySelector("#".concat(n)))||void 0===e||e.classList.add("is-expanded"))})),null===(n=o.querySelector("#".concat(t,"-toggle-only-connected")))||void 0===n||n.toggleAttribute("checked",z.xrefUIState.showOnlyConnected),e=o}return e}},{key:"_connectedUsers",get:function(){var t,e=new Map;return this._ipGroups.forEach((function(n){return n.connectedUsers.forEach((function(n){return e.set(n,(null!==(t=e.get(n))&&void 0!==t?t:0)+1)}))})),De(e.entries()).map((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a=[],i=!0,c=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(c)throw o}}return a}}(t,e)||He(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2);return{uid:e[0],count:e[1]}})).sort((function(t,e){var n=t.uid,r=t.count,o=e.uid;return e.count-r||n-o}))}},{key:"connect",value:function(){this.element.insertAdjacentElement("afterbegin",this._uiDiv),this._updateConnectedUsersList(this._connectedUsers),this._updateFocusedUsersList()}},{key:Ke,value:function(t){t.setFrequencies(this._connectedUsers)}},{key:"reloadPreferences",value:function(){Z(),this._refresh()}},{key:"showConnected",value:function(t){var e=t.detail.connCount;e!==this._threshold&&(this._threshold=e,this._refreshConnectedUsers(this._connectedUsers))}},{key:"toggleOnly",value:function(t){var e=t.target;z.xrefUIState.showOnlyConnected=e.checked,this._ipGroups.forEach((function(t){return t.refresh(e.checked)}))}},{key:"sectionToggled",value:function(t){var e=t.target,n=e.getAttribute("aria-controls");n&&Object.hasOwn(z.xrefUIState.openedSections,n)&&(z.xrefUIState.openedSections[n]="true"===e.getAttribute("aria-expanded"))}},{key:"addFocusUser",value:function(t){var e=t.params.uid,n=z.focusedUsers.length;z.focusedUsers=Array.from(new Set(De(z.focusedUsers).concat([e]))).sort((function(t,e){return t-e})),z.focusedUsers.length!==n&&this._refresh()}},{key:"removeFocusUser",value:function(t){var e=t.params.uid,n=z.focusedUsers.length;z.focusedUsers=z.focusedUsers.filter((function(t){return t!==e})),z.focusedUsers.length!==n&&this._refresh()}},{key:"clearFocusUsers",value:function(){confirm("Clear all focused users?")&&z.focusedUsers.length>0&&(z.focusedUsers=[],this._refresh())}},{key:"copyFocusUsers",value:function(t){var e=t.target,n=this,r=z.focusedUsers.map((function(t){var e=n.focusedUsersTarget.querySelector('a[href^="/users/'.concat(t,'/"]'));return e?e.href.replace(/.*\/users\//,""):t.toFixed(0)})).join("\n"),o=e.closest("button");navigator.clipboard.writeText(r).then((function(){return null==o||o.classList.add("is-copied"),new Promise((function(t){return setTimeout(t,1500)}))})).then((function(){return null==o?void 0:o.classList.remove("is-copied")}))}},{key:"updateFocusUsersGraphLink",value:function(t){var e=t.detail,n=luxon.DateTime.utc(),r=n.minus({days:14}),o=this.focusUsersGraphLinkTarget,a=new URL(o.href);a.hash="".concat(Ve(r),"|").concat(Ve(n),"|").concat(e.join(",")),o.href=a.toString()}},{key:"_refresh",value:function(){var t=this;null===this._refreshId&&(this._refreshId=window.requestAnimationFrame((function(){t._threshold=0,t._updateFocusedUsersList();var e=t._connectedUsers;t._histogram.setFrequencies(e,!1),t._refreshConnectedUsers(e),t._refreshId=null})))}},{key:"_refreshConnectedUsers",value:function(t){var e=this;this._ipGroups.forEach((function(n){return n.updateUsersBelowThreshold(e._threshold,t)})),this._updateConnectedUsersList(t)}},{key:"_updateConnectedUsersList",value:function(e){var n=this,r=function(){var r=n.connectedUsersTarget;r.replaceChildren(),e.forEach((function(e){var o=e.uid,a=e.count;if(!(a\n
    \n ').concat(i,'\n \n \n \n
    user').concat(o,'
    \n
    \n \n '))}}))};null===this._refreshId?window.requestAnimationFrame(r):r()}},{key:"_updateFocusedUsersList",value:function(){var e=this.focusedUsersTarget;e.replaceChildren(),z.focusedUsers.forEach((function(n){e.insertAdjacentHTML("beforeend",'
    \n
    \n \n \n \n
    user').concat(n,'
    \n
    \n \n
    \n '))}))}}],o=[{key:"attach",value:function(t){var e=document.querySelector(t),n=Array.from(e.querySelectorAll(Ne)).filter((function(t){return null!==t.querySelector("tbody")}));Stacks.application.logDebugActivity(this.controllerId,"attach",{controllersToRegister:[this.controllerId,Ce.controllerId],hasXrefsTable:!!e,ipGroupsCount:n.length}),Stacks.application.register(Ce.controllerId,Ce),e.setAttribute(Stacks.application.schema.targetAttributeForScope(this.controllerId),"xrefsTable"),n.forEach((function(t){return t.dataset.controller=Ce.controllerId}));var r,o=e.parentElement,a=(null!==(r=o.dataset.controller)&&void 0!==r?r:"").split(" ");a.push(this.controllerId),o.dataset.controller=a.join(" ").trim(),o.setAttribute(Stacks.application.schema.outletAttributeForScope(this.controllerId,Ce.controllerId),Ne),o.setAttribute(Stacks.application.schema.outletAttributeForScope(this.controllerId,pe.controllerId),ze),Stacks.application.register(this.controllerId,this)}},{key:"afterLoad",value:function(t,e){var n=[pe,U,ee];e.logDebugActivity(t,"afterLoad",{controllersToRegister:n.map((function(t){return t.controllerId}))});var r=!0,o=!1,a=void 0;try{for(var i,c=n[Symbol.iterator]();!(r=(i=c.next()).done);r=!0){var s=i.value;e.register(s.controllerId,s)}}catch(t){o=!0,a=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}document.head.insertAdjacentHTML("beforeend",'"))}}],r&&Le(n.prototype,r),o&&Le(n,o),f}();Me(We,"controllerId",t),Me(We,"targets",["xrefsTable","connectedUsers","focusedUsers","focusUsersGraphLink"]),Me(We,"outlets",[pe.controllerId,Ce.controllerId]),new URL(location.href).searchParams.has("usModDebug")&&(Stacks.application.debug=!0),Stacks.application.logDebugActivity(t,"pre-flight",{isModerator:StackExchange.options.user.isModerator}),StackExchange.options.user.isModerator&&(Stacks.application.logDebugActivity(t,"xrefUsersView",{location:location.pathname}),location.pathname.includes("/admin/xref-user-ips/")&&Promise.all([o,(Je="https://cdn.jsdelivr.net/npm/luxon@3/build/global/luxon.min.js",new Promise((function(t,e){if(null!==document.querySelector("script[src='".concat(Je,"']")))return t();var n=document.createElement("script");n.onload=function(){return t()},n.onerror=function(t){return e(t.error)},n.src=Je,document.head.appendChild(n)})))]).then((function(){We.attach("#xref-ids")})))})(); \ No newline at end of file +(()=>{"use strict";var t="us-mod-connected-users",e="rSgJSoND0c32iHgumlM8vg((";function n(t,e){for(var n=0;n=this.maxEntries;)this.values.delete(this.values.keys().next().value);this.values.set(t,e)}}])&&n(e.prototype,o),t}();const s='',c='';function u(t){return t.replace(/(?:[_-])([a-z0-9])/g,((t,e)=>e.toUpperCase()))}function l(t){return t.charAt(0).toUpperCase()+t.slice(1)}function f(t,e){const n=d(t);return Array.from(n.reduce(((t,n)=>(function(t,e){const n=t[e];return Array.isArray(n)?n:[]}(n,e).forEach((e=>t.add(e))),t)),new Set))}function d(t){const e=[];for(;t;)e.push(t),t=Object.getPrototypeOf(t);return e.reverse()}function h(t){return t.reduce(((t,[e,n])=>Object.assign(Object.assign({},t),{[e]:n})),{})}function p([t,e],n){return function(t){const e=`${r=t.token,r.replace(/([A-Z])/g,((t,e)=>`-${e.toLowerCase()}`))}-value`,n=function(t){const e=function(t){const e=y(t.typeObject.type);if(!e)return;const n=v(t.typeObject.default);if(e!==n){throw new Error(`The specified default value for the Stimulus Value "${t.controller?`${t.controller}.${t.token}`:t.token}" must match the defined type "${e}". The provided default value of "${t.typeObject.default}" is of type "${n}".`)}return e}({controller:t.controller,token:t.token,typeObject:t.typeDefinition}),n=v(t.typeDefinition),r=y(t.typeDefinition),o=e||n||r;if(o)return o;throw new Error(`Unknown value type "${t.controller?`${t.controller}.${t.typeDefinition}`:t.token}" for "${t.token}" value`)}(t);var r;return{type:n,key:e,name:u(e),get defaultValue(){return function(t){const e=y(t);if(e)return b[e];const n=t.default;return void 0!==n?n:t}(t.typeDefinition)},get hasCustomDefaultValue(){return void 0!==v(t.typeDefinition)},reader:g[n],writer:m[n]||m.default}}({controller:n,token:t,typeDefinition:e})}function y(t){switch(t){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function v(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(t)?"array":"[object Object]"===Object.prototype.toString.call(t)?"object":void 0}"function"==typeof Object.getOwnPropertySymbols||Object.getOwnPropertyNames,(()=>{try{!function(){const t=function(t){function e(){return Reflect.construct(t,arguments,new.target)}return e.prototype=Object.create(t.prototype,{constructor:{value:e}}),Reflect.setPrototypeOf(e,t),e}((function(){this.a.call(this)}));t.prototype.a=function(){},new t}()}catch(t){return t=>class extends t{}}})(),Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End"},h("abcdefghijklmnopqrstuvwxyz".split("").map((t=>[t,t])))),h("0123456789".split("").map((t=>[t,t]))));const b={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},g={array(t){const e=JSON.parse(t);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${t}" of type "${v(e)}"`);return e},boolean:t=>!("0"==t||"false"==String(t).toLowerCase()),number:t=>Number(t),object(t){const e=JSON.parse(t);if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${t}" of type "${v(e)}"`);return e},string:t=>t},m={default:function(t){return`${t}`},array:w,object:w};function w(t){return JSON.stringify(t)}class _{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(t,{target:e=this.element,detail:n={},prefix:r=this.identifier,bubbles:o=!0,cancelable:a=!0}={}){const i=new CustomEvent(r?`${r}:${t}`:t,{detail:n,bubbles:o,cancelable:a});return e.dispatchEvent(i),i}}_.blessings=[function(t){return f(t,"classes").reduce(((t,e)=>{return Object.assign(t,{[`${n=e}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${l(n)}Class`]:{get(){return this.classes.has(n)}}});var n}),{})},function(t){return f(t,"targets").reduce(((t,e)=>{return Object.assign(t,{[`${n=e}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${l(n)}Target`]:{get(){return this.targets.has(n)}}});var n}),{})},function(t){const e=function(t,e){return d(t).reduce(((t,n)=>(t.push(...function(t,e){const n=t[e];return n?Object.keys(n).map((t=>[t,n[t]])):[]}(n,e)),t)),[])}(t,"values"),n={valueDescriptorMap:{get(){return e.reduce(((t,e)=>{const n=p(e,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(t,{[r]:n})}),{})}}};return e.reduce(((t,e)=>Object.assign(t,function(t,e){const n=p(t,void 0),{key:r,name:o,reader:a,writer:i}=n;return{[o]:{get(){const t=this.data.get(r);return null!==t?a(t):n.defaultValue},set(t){void 0===t?this.data.delete(r):this.data.set(r,i(t))}},[`has${l(o)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}(e))),n)},function(t){return f(t,"outlets").reduce(((t,e)=>Object.assign(t,function(t){const e=u(t.replace(/--/g,"-").replace(/__/g,"_"));return{[`${e}Outlet`]:{get(){const e=this.outlets.find(t);if(e){const n=this.application.getControllerForElementAndIdentifier(e,t);if(n)return n;throw new Error(`Missing "data-controller=${t}" attribute on outlet element for "${this.identifier}" controller`)}throw new Error(`Missing outlet element "${t}" for "${this.identifier}" controller`)}},[`${e}Outlets`]:{get(){const e=this.outlets.findAll(t);return e.length>0?e.map((e=>{const n=this.application.getControllerForElementAndIdentifier(e,t);if(n)return n;console.warn(`The provided outlet element is missing the outlet controller "${t}" for "${this.identifier}"`,e)})).filter((t=>t)):[]}},[`${e}OutletElement`]:{get(){const e=this.outlets.find(t);if(e)return e;throw new Error(`Missing outlet element "${t}" for "${this.identifier}" controller`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(t)}},[`has${l(e)}Outlet`]:{get(){return this.outlets.has(t)}}}}(e))),{})}],_.targets=[],_.outlets=[],_.values={};const S={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};(class extends _{}).debounces=[];class k extends class{constructor(t,e={}){var n,r,o;this.log=(t,e)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${t}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},e)),this.logger.groupEnd())},this.warn=t=>{this.logger.warn(`%c${this.controller.identifier} %c${t}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(t,e={})=>{if(this.dispatchEvent){const{event:n}=e,r=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o{const n=this.controller[t];if("function"==typeof n)return n.call(this.controller,e)},this.extendedEvent=(t,e,n)=>{const{bubbles:r,cancelable:o,composed:a}=e||{bubbles:!0,cancelable:!0,composed:!0};return e&&Object.assign(n,{originalEvent:e}),new CustomEvent(this.composeEventName(t),{bubbles:r,cancelable:o,composed:a,detail:n})},this.composeEventName=t=>{let e=t;return!0===this.eventPrefix?e=`${this.controller.identifier}:${t}`:"string"==typeof this.eventPrefix&&(e=`${this.eventPrefix}:${t}`),e},this.debug=null!==(r=null!==(n=null==e?void 0:e.debug)&&void 0!==n?n:t.application.stimulusUseDebug)&&void 0!==r?r:S.debug,this.logger=null!==(o=null==e?void 0:e.logger)&&void 0!==o?o:S.logger,this.controller=t,this.controllerId=t.element.id||t.element.dataset.id,this.targetElement=(null==e?void 0:e.element)||t.element;const{dispatchEvent:a,eventPrefix:i}=Object.assign({},S,e);Object.assign(this,{dispatchEvent:a,eventPrefix:i}),this.controllerInitialize=t.initialize.bind(t),this.controllerConnect=t.connect.bind(t),this.controllerDisconnect=t.disconnect.bind(t)}}{constructor(t,e={}){super(t,e),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(t){this.controller.application.handleError(t,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=t=>{this.call("mutate",t),this.log("mutate",{entries:t}),this.dispatch("mutate",{entries:t})},this.targetElement=(null==e?void 0:e.element)||t.element,this.controller=t,this.options=e,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unobserve(),t()}})}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n{const n=new k(t,e);n.observe,n.unobserve})(this,{childList:!0,element:this.container}),this.checkEmpty()}},{key:"mutate",value:function(){this.checkEmpty()}},{key:"checkEmpty",value:function(){var t,e,n,r,o=this.children.length;0===o?((t=this.element.classList).remove.apply(t,C(this.notEmptyClasses)),(e=this.element.classList).add.apply(e,C(this.emptyClasses)),this.dispatch("empty",{target:this.container})):((n=this.element.classList).add.apply(n,C(this.notEmptyClasses)),(r=this.element.classList).remove.apply(r,C(this.emptyClasses)),this.dispatch("not-empty",{target:this.container,detail:{count:o}}))}}])&&x(e.prototype,n),i}();function R(t,e){var n=localStorage[t];return function(t){return![null,void 0,""].includes(t)}(n)?JSON.parse(n):e}A(U,"controllerId","empty-dom"),A(U,"targets",["container"]),A(U,"classes",["empty","notEmpty"]),A(U,"values",{scopeSelector:String});var L,M=function(t){return null!==t&&"object"==typeof t};function $(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var F={openedSections:(L={},$(L,"".concat(t,"-connected-histogram"),!0),$(L,"".concat(t,"-connected"),!1),$(L,"".concat(t,"-focused"),!1),L),showOnlyConnected:!1};function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:200;return function(){for(var r=arguments.length,o=new Array(r),a=0;at.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&dt(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=ct(e);if(n){var o=ct(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return ft(this,t)});function o(t,e,n){var a;return nt(this,o),st(V(a=r.call(this,"".concat(n," (").concat(t,"): ").concat(e))),"errorId",void 0),st(V(a),"errorMessage",void 0),st(V(a),"errorName",void 0),a.errorId=t,a.errorMessage=e,a.errorName=n,a.name="APIError",a}return it(o,null,[{key:"fromWrapper",value:function(t){return new o(t.error_id,t.error_message,t.error_name)}}]),o}(bt(Error)),_t=function(){return location.hostname.replace(/(\.stackexchange)?\.com$/,"")},St=function(t){return"string"==typeof t?t:(e=t,n=Date,(null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](e):e instanceof n)?Math.round(t.getTime()/1e3):t).toFixed(0);var e,n},kt=function t(e){var n=this;nt(this,t),st(this,"promise",void 0),st(this,"resolve",void 0),st(this,"then",void 0),this.promise=void 0===e?new Promise((function(t){n.resolve=t})):Promise.resolve(e),this.then=this.promise.then.bind(this.promise)},Ot=new kt(0),jt=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;nt(this,t),st(this,"apiKey",void 0),st(this,"defaultPageSize",void 0),st(this,"siteId",void 0),st(this,"notBeforeFutures",void 0),this.apiKey=e,this.defaultPageSize=r,this.notBeforeFutures=new Map,this.siteId=n||_t()}return it(t,[{key:"fetch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this;return Y((function(){return gt(this,(function(o){switch(o.label){case 0:return[4,r.fetchItems(t,e,n)];case 1:return[2,o.sent().items]}}))}))()}},{key:"fetchItems",value:function(t,e,n){var r=this;return Y((function(){var o,a,i,s;return gt(this,(function(c){switch(c.label){case 0:return o=r.buildURL(t,e,n),[4,r.handleBackoff(t)];case 1:a=c.sent(),c.label=2;case 2:return c.trys.push([2,5,,6]),[4,fetch(o.toString())];case 3:return[4,c.sent().json()];case 4:return i=c.sent(),a((new Date).getTime()+1e3*(i.backoff||0)),[3,6];case 5:throw s=c.sent(),a(0),s;case 6:if(function(t){return void 0!==t.error_id}(i))throw wt.fromWrapper(i);return[2,i]}}))}))()}},{key:"fetchAll",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this;return vt((function(){var o,a,i,s,c,u,l,f,d,h,p;return gt(this,(function(y){switch(y.label){case 0:o=n.pageSize||r.defaultPageSize,a=!0,i=!1,s=void 0,y.label=1;case 1:y.trys.push([1,9,10,11]),c=r.pathParameterBatches(t,e,o)[Symbol.iterator](),y.label=2;case 2:if(a=(u=c.next()).done)return[3,8];l=u.value,d=parseInt((null===(f=l.page)||void 0===f?void 0:f.toString())||"1"),h=void 0,y.label=3;case 3:return[4,tt(r.fetchItems(t,lt(ut({},l),{page:d}),n))];case 4:return h=y.sent(),[5,mt(K(W(h.items),tt))];case 5:y.sent(),d+=1,y.label=6;case 6:if(h.has_more)return[3,3];y.label=7;case 7:return a=!0,[3,2];case 8:return[3,11];case 9:return p=y.sent(),i=!0,s=p,[3,11];case 10:try{a||null==c.return||c.return()}finally{if(i)throw s}return[7];case 11:return[2]}}))}))()}},{key:"pathParameterBatches",value:function(t,e,n){var r,o,a=Array.from(t.matchAll(/{(\w+)}/g)).map((function(t){return t[1]}));switch(a.length){case 0:return[e];case 1:var i=[a[0],e[a[0]]],s=i[0],c=i[1];if(void 0===c)throw Error("Missing path parameter ".concat(s));return(r=function(t){return Array.isArray(t)?t:[t]}(c),o=n,r.reduce((function(t,e,n){var r=Math.floor(n/o);return t[r]=function(t){return function(t){if(Array.isArray(t))return G(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r0?[4,(c=i,new Promise((function(t){return setTimeout(t,c)})))]:[3,3];case 2:s.sent(),s.label=3;case 3:return[2,a.resolve]}var c}))}))()}}]),t}();function xt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function At(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Et(t,e){for(var n=0;nStaff'),this.user_type){case"moderator":t.push('Mod');break;case"team_admin":t.push('Admin')}return t.join(" ")}},{key:"_abbreviated_reputation",get:function(){return this.reputation<1e4?Ft.format(this.reputation):$t.format(this.reputation).toLowerCase()}},{key:"toHTML",value:function(){return'\n \n ");var t}}],[{key:"fromJSON",value:function(t){var e=new this;return Object.assign(e,t),e}}]),n}(Dt),qt=function(t){Pt(n,t);var e=Mt(n);function n(t){var r;return At(this,n),(r=e.call(this)).user_id=t||0,r.link="".concat(location.origin,"/users/").concat(r.user_id),r}return It(n,[{key:"toHTML",value:function(){return'\n \n ")}}]),n}(Dt);function Ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]0))return[3,12];o=n.api.fetchAll("/users/{ids}",{ids:e},{filter:")Q7.NL.wLaTOvZyxvEF8za4m(g8T"}),a=!1,i=!1,k.label=1;case 1:k.trys.push([1,6,7,12]),c=function(t){var e,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new zt(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}(o),k.label=2;case 2:return[4,(O=c.next(),new Zt(O))];case 3:if(!(a=!(u=k.sent()).done))return[3,5];l=u.value,f=l,d=n.UserClass.fromJSON(f),n.cache.put(d.user_id,d),r.set(d.user_id,d),k.label=4;case 4:return a=!1,[3,2];case 5:return[3,12];case 6:return h=k.sent(),i=!0,s=h,[3,12];case 7:return k.trys.push([7,,10,11]),a&&null!=c.return?[4,c.return()]:[3,9];case 8:k.sent(),k.label=9;case 9:return[3,11];case 10:if(i)throw s;return[7];case 11:return[7];case 12:p=n.missingAssumeDeleted?function(t){return r.get(t)||n.missingUser(t)}:function(t){return r.get(t)},y=!0,v=!1,b=void 0,k.label=13;case 13:k.trys.push([13,18,19,20]),g=t[Symbol.iterator](),k.label=14;case 14:return(y=(m=g.next()).done)?[3,17]:(w=m.value,(_=p(w))?[4,_]:[3,16]);case 15:k.sent(),k.label=16;case 16:return y=!0,[3,14];case 17:return[3,20];case 18:return S=k.sent(),v=!0,b=S,[3,20];case 19:try{y||null==g.return||g.return()}finally{if(v)throw b}return[7];case 20:return[2]}var O}))},function(){return new Nt(e.apply(this,arguments))})()}},{key:"missingUser",value:function(t){var e=new this.MissingClass(t);return this.cache.put(e.user_id,e),e}}],o=[{key:"withDefaultClasses",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={api:n.api||new jt(e),cache:n.cache||new i(1e3),missingAssumeDeleted:void 0!==n.missingAssumeDeleted&&n.missingAssumeDeleted};return new t(Bt,qt,r)}}],r&&Gt(n.prototype,r),o&&Gt(n,o),t}();function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n').concat(se,""))}}],(n=[{key:"connect",value:function(){this.updateUsers()}},{key:"updateUsers",value:function(){this.countTarget.innerHTML=this.userRowTargets.length.toString();var t=new Map(this.userRowTargets.reduce((function(t,e){return"true"===e.dataset.hydrated?t:ae(t).concat([[parseInt(e.dataset.uid||"0"),e]])}),[]));if(0!==t.size){var e=this;window.requestAnimationFrame(Xt((function(){var n,r,o,a,i,s,c,u,l,f,d,h,p,y;return function(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]1&&void 0!==arguments[1])||arguments[1],n=this;if(this.svgTarget.replaceChildren(),this._buckets=[],0!==t.length){for(var r=t[t.length-1].count,o=t[0].count,a=r;a<=o;a++)this._buckets.push({connCount:a,userCount:0,label:"Overlapping on ".concat(a," ip(s)")});if(t.forEach((function(t){var e=t.count;return n._buckets[e-r].userCount+=1})),this._buckets.length>20){for(var i=Math.ceil(this._buckets.length/20),s=[],c=0;c10*h,console.log("Histogram scale uses log?",this._logScale),this._buckets.length<=1||(this._drawBarChart(),this._adjustThresholdClasses(this._buckets[0].connCount),e&&this.dispatch("click",{detail:this._buckets[0]}))}}},{key:"_drawBarChart",value:function(){var t,e=this,n=5*this._buckets.length+1,r=n*this._svgRatio;this.svgTarget.setAttribute("viewBox","0 0 ".concat(n," ").concat(r));var o=this._logScale?function(t){return t>0?Math.log10(t)||.15:t}:function(t){return t},a=(t=Math).max.apply(t,function(t){return function(t){if(Array.isArray(t))return le(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||we(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this._buckets.map((function(t){return t.userCount})))),i=r/o(a),s=.005*r;this.svgTarget.insertAdjacentHTML("beforeend",'\n \n \n '));for(var c=this.svgTarget.querySelector("g.gridLines"),u=this._logScale?function(t){return Math.pow(10,Math.floor(Math.log10(t||1)))}:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.max(Math.floor(a/10),1);return e},l=0;l')),l+=u(l)}this._buckets.forEach((function(t,n){var a=o(t.userCount)*i,s='\n \n ').concat(t.label,": ").concat(t.userCount," account").concat(1===t.userCount?"":"s","\n \n ");e.svgTarget.insertAdjacentHTML("beforeend",s)}))}}],r=[{key:"afterLoad",value:function(t){document.head.insertAdjacentHTML("beforeend",'"))}}],n&&he(e.prototype,n),r&&he(e,r),s}();function ke(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n').concat(c,' Focus\n\n \n');function Fe(t){return luxon.Interval.fromDateTimes.apply(this,Array.from(t.querySelectorAll("td .relativetime[title]")).map((function(t){return e=t.title,luxon.DateTime.fromISO(e.replace(" ","T"),{zone:"utc"});var e})))}var De=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Te(t,e)}(u,Stacks.StacksController);var n,r,o,i,s,c=(i=u,s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ee(i);if(s){var n=Ee(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ie(this,t)});function u(){var t;return je(this,u),Ae(Oe(t=c.apply(this,arguments)),"_belowThreshold",void 0),Ae(Oe(t),"_showOnlyConnected",void 0),Ae(Oe(t),"_refreshId",null),t}return n=u,r=[{key:"_userRows",get:function(){return Array.from(this.element.querySelectorAll("tbody > tr[data-uid]"))}},{key:"_mainUserRow",get:function(){return this.element.querySelector("tbody .".concat(Ue))}},{key:"_focusUserRows",get:function(){var t=new Set(z.focusedUsers);return this._userRows.filter((function(e){return t.has(parseInt(e.dataset.uid||"0"))}))}},{key:"_focusIntervals",get:function(){return[this._mainUserRow].concat(Ce(this._focusUserRows)).map((function(t){return Fe(t)}))}},{key:"_connectedUserRows",get:function(){var t=this._focusIntervals,e=new Set(z.focusedUsers);return this._userRows.filter((function(n){if(n.classList.contains(Ue))return!1;var r=parseInt(n.dataset.uid||"0");if(e.has(r))return!1;var o=Fe(n);return t.some((function(t){return t.overlaps(o)}))}))}},{key:"connectedUsers",get:function(){return this._connectedUserRows.map((function(t){return parseInt(t.dataset.uid||"0")}))}},{key:"_updateMarkup",value:function(){var t;this.element.querySelectorAll("tbody tr").forEach((function(t){var e=t.querySelector("td a");t.dataset.uid=(null==e?void 0:e.href.split("/").pop())||"0"}));var e=location.pathname.split("/").pop()||"0";null===(t=this.element.querySelector('tr[data-uid="'.concat(e,'"]')))||void 0===t||t.classList.add(Ue)}},{key:"connect",value:function(){this._updateMarkup(),this._belowThreshold=new Set,this._showOnlyConnected=z.xrefUIState.showOnlyConnected,this._addFocusButtons(),this._updateClasses()}},{key:"_addFocusButtons",value:function(){this._userRows.forEach((function(e){var n,r=e.dataset.uid||"0",o="".concat(a(t),"UidParam");null===(n=e.querySelector("td a"))||void 0===n||n.insertAdjacentHTML("beforebegin",$e),e.querySelectorAll("td .s-btn[data-action]").forEach((function(t){return t.dataset[o]=r}))}))}},{key:"_updateClasses",value:function(){var t=this;if(this._userRows.forEach((function(t){t.classList.remove(Re,Le,"d-none"),delete t.dataset.connected})),this._focusUserRows.forEach((function(t){t.classList.add(Re)})),this._connectedUserRows.forEach((function(e){var n=parseInt(e.dataset.uid||"0");e.classList.toggle(Le,!t._belowThreshold.has(n))})),this._showOnlyConnected){var e=[Ue,Re,Le];this._userRows.forEach((function(t){e.some((function(e){return t.classList.contains(e)}))||t.classList.add("d-none")}))}}},{key:"refresh",value:function(t){var e=this;void 0!==t&&(this._showOnlyConnected=t),null===this._refreshId&&(this._refreshId=window.requestAnimationFrame((function(){e._updateClasses(),e._refreshId=null})))}},{key:"updateUsersBelowThreshold",value:function(t,e){this._belowThreshold=new Set(e.reduce((function(e,n){var r=n.uid;return n.count').concat(Me,""))}}],r&&xe(n.prototype,r),o&&xe(n,o),u}();function Be(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n\n \n\n');function en(t){return t.toFormat("yyyy/MM/dd")}var nn,rn=function(t){var e=t.controllerId;return"".concat(a(e),"OutletConnected")}(Se),on=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Ve(t,e)}(f,Stacks.StacksController);var n,r,o,i,u,l=(i=f,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=Ze(i);if(u){var n=Ze(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return Ge(this,t)});function f(){var t;return He(this,f),ze(qe(t=l.apply(this,arguments)),"_threshold",0),ze(qe(t),"_refreshId",null),t}return n=f,r=[{key:"_ipGroups",get:function(){return this[function(t){var e=t.controllerId;return"".concat(a("".concat(e)),"Outlets")}(De)]}},{key:"_histogram",get:function(){return this[function(t){var e=t.controllerId;return"".concat(a("".concat(e)),"Outlet")}(Se)]}},{key:"_uiDiv",get:function(){var e=this.element.querySelector(".s-".concat(this.identifier));if(null===e){var n,r=document.createElement("div");r.insertAdjacentHTML("afterbegin",tn);var o=r.firstElementChild;o.querySelectorAll('[data-controller="s-expandable-control"]').forEach((function(t){var e,n=t.getAttribute("aria-controls");n&&z.xrefUIState.openedSections[n]&&(t.setAttribute("aria-expanded","true"),null===(e=o.querySelector("#".concat(n)))||void 0===e||e.classList.add("is-expanded"))})),null===(n=o.querySelector("#".concat(t,"-toggle-only-connected")))||void 0===n||n.toggleAttribute("checked",z.xrefUIState.showOnlyConnected),e=o}return e}},{key:"_connectedUsers",get:function(){var t,e=new Map;return this._ipGroups.forEach((function(n){return n.connectedUsers.forEach((function(n){return e.set(n,(null!==(t=e.get(n))&&void 0!==t?t:0)+1)}))})),Je(e.entries()).map((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a=[],i=!0,s=!1;try{for(n=n.call(t);!(i=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);i=!0);}catch(t){s=!0,o=t}finally{try{i||null==n.return||n.return()}finally{if(s)throw o}}return a}}(t,e)||We(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2);return{uid:e[0],count:e[1]}})).sort((function(t,e){var n=t.uid,r=t.count,o=e.uid;return e.count-r||n-o}))}},{key:"connect",value:function(){this.element.insertAdjacentElement("afterbegin",this._uiDiv),this._updateConnectedUsersList(this._connectedUsers),this._updateFocusedUsersList()}},{key:rn,value:function(t){t.setFrequencies(this._connectedUsers)}},{key:"reloadPreferences",value:function(){Z(),this._refresh()}},{key:"showConnected",value:function(t){var e=t.detail.connCount;e!==this._threshold&&(this._threshold=e,this._refreshConnectedUsers(this._connectedUsers))}},{key:"toggleOnly",value:function(t){var e=t.target;z.xrefUIState.showOnlyConnected=e.checked,this._ipGroups.forEach((function(t){return t.refresh(e.checked)}))}},{key:"sectionToggled",value:function(t){var e=t.target,n=e.getAttribute("aria-controls");n&&Object.hasOwn(z.xrefUIState.openedSections,n)&&(z.xrefUIState.openedSections[n]="true"===e.getAttribute("aria-expanded"))}},{key:"addFocusUser",value:function(t){var e=t.params.uid,n=z.focusedUsers.length;z.focusedUsers=Array.from(new Set(Je(z.focusedUsers).concat([e]))).sort((function(t,e){return t-e})),z.focusedUsers.length!==n&&this._refresh()}},{key:"removeFocusUser",value:function(t){var e=t.params.uid,n=z.focusedUsers.length;z.focusedUsers=z.focusedUsers.filter((function(t){return t!==e})),z.focusedUsers.length!==n&&this._refresh()}},{key:"clearFocusUsers",value:function(){confirm("Clear all focused users?")&&z.focusedUsers.length>0&&(z.focusedUsers=[],this._refresh())}},{key:"copyFocusUsers",value:function(t){var e=t.target,n=this,r=z.focusedUsers.map((function(t){var e=n.focusedUsersTarget.querySelector('a[href^="/users/'.concat(t,'/"]'));return e?e.href.replace(/.*\/users\//,""):t.toFixed(0)})).join("\n"),o=e.closest("button");navigator.clipboard.writeText(r).then((function(){return null==o||o.classList.add("is-copied"),new Promise((function(t){return setTimeout(t,1500)}))})).then((function(){return null==o?void 0:o.classList.remove("is-copied")}))}},{key:"updateFocusUsersGraphLink",value:function(t){var e=t.detail,n=luxon.DateTime.utc(),r=n.minus({days:14}),o=this.focusUsersGraphLinkTarget,a=new URL(o.href);a.hash="".concat(en(r),"|").concat(en(n),"|").concat(e.join(",")),o.href=a.toString()}},{key:"_refresh",value:function(){var t=this;null===this._refreshId&&(this._refreshId=window.requestAnimationFrame((function(){t._threshold=0,t._updateFocusedUsersList();var e=t._connectedUsers;t._histogram.setFrequencies(e,!1),t._refreshConnectedUsers(e),t._refreshId=null})))}},{key:"_refreshConnectedUsers",value:function(t){var e=this;this._ipGroups.forEach((function(n){return n.updateUsersBelowThreshold(e._threshold,t)})),this._updateConnectedUsersList(t)}},{key:"_updateConnectedUsersList",value:function(e){var n=this,r=function(){var r=n.connectedUsersTarget;r.replaceChildren(),e.forEach((function(e){var o=e.uid,a=e.count;if(!(a\n
    \n ').concat(i,'\n \n \n \n
    user').concat(o,'
    \n
    \n \n '))}}))};null===this._refreshId?window.requestAnimationFrame(r):r()}},{key:"_updateFocusedUsersList",value:function(){var e=this.focusedUsersTarget;e.replaceChildren(),z.focusedUsers.forEach((function(n){e.insertAdjacentHTML("beforeend",'
    \n
    \n \n \n \n
    user').concat(n,'
    \n
    \n \n
    \n '))}))}}],o=[{key:"attach",value:function(t){var e=document.querySelector(t),n=Array.from(e.querySelectorAll(Qe)).filter((function(t){return null!==t.querySelector("tbody")}));Stacks.application.logDebugActivity(this.controllerId,"attach",{controllersToRegister:[this.controllerId,De.controllerId],hasXrefsTable:!!e,ipGroupsCount:n.length}),Stacks.application.register(De.controllerId,De),e.setAttribute(Stacks.application.schema.targetAttributeForScope(this.controllerId),"xrefsTable"),n.forEach((function(t){return t.dataset.controller=De.controllerId}));var r,o=e.parentElement,a=(null!==(r=o.dataset.controller)&&void 0!==r?r:"").split(" ");a.push(this.controllerId),o.dataset.controller=a.join(" ").trim(),o.setAttribute(Stacks.application.schema.outletAttributeForScope(this.controllerId,De.controllerId),Qe),o.setAttribute(Stacks.application.schema.outletAttributeForScope(this.controllerId,Se.controllerId),Xe),Stacks.application.register(this.controllerId,this)}},{key:"afterLoad",value:function(t,e){var n=[Se,U,ue];e.logDebugActivity(t,"afterLoad",{controllersToRegister:n.map((function(t){return t.controllerId}))});var r=!0,o=!1,a=void 0;try{for(var i,s=n[Symbol.iterator]();!(r=(i=s.next()).done);r=!0){var c=i.value;e.register(c.controllerId,c)}}catch(t){o=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}document.head.insertAdjacentHTML("beforeend",'"))}}],r&&Ne(n.prototype,r),o&&Ne(n,o),f}();ze(on,"controllerId",t),ze(on,"targets",["xrefsTable","connectedUsers","focusedUsers","focusUsersGraphLink"]),ze(on,"outlets",[Se.controllerId,De.controllerId]),new URL(location.href).searchParams.has("usModDebug")&&(Stacks.application.debug=!0),Stacks.application.logDebugActivity(t,"pre-flight",{isModerator:StackExchange.options.user.isModerator}),StackExchange.options.user.isModerator&&(Stacks.application.logDebugActivity(t,"xrefUsersView",{location:location.pathname}),location.pathname.includes("/admin/xref-user-ips/")&&Promise.all([o,(nn="https://cdn.jsdelivr.net/npm/luxon@3/build/global/luxon.min.js",new Promise((function(t,e){if(null!==document.querySelector("script[src='".concat(nn,"']")))return t();var n=document.createElement("script");n.onload=function(){return t()},n.onerror=function(t){return e(t.error)},n.src=nn,document.head.appendChild(n)})))]).then((function(){on.attach("#xref-ids")})))})(); \ No newline at end of file