1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[13230,21374,26174,49897,57490],{8454(L,j,e){var R,w;R=[e(24962),e(96352),e(52473),e(17459),e(34342),e(49897),e(65303),e(29930),e(91749),e(30076),e(13230)],w=(function(P,I,D,A,E,C,m,l,u,p,S){const W={};let K=!1;W.init=function(o){K=!1,Q(),V(o),P.addShareHandlers(ajaxify.data.title),E.addVoteHandler(),W.updatePostCount(ajaxify.data.postcount)};function Q(){document.querySelector('[component="topic"]')&&$('[component="topic"]').on("show.bs.dropdown",'[component="post/tools"]',function(){const t=$(this),c=t.find(".dropdown-menu"),{top:a}=this.getBoundingClientRect();if(t.toggleClass("dropup",a>window.innerHeight/2),c.attr("data-loaded"))return;c.html(p.generatePlaceholderWave([3,5,9,7,10,"divider",10]));const r=t.parents("[data-pid]"),d=r.attr("data-pid"),v=parseInt(r.attr("data-index"),10);socket.emit("posts.loadPostTools",{pid:d},async(x,M)=>{if(x)return l.error(x);M.posts.display_move_tools=M.posts.display_move_tools&&v!==0;const O=await app.parseAndTranslate("partials/topic/post-menu-list",M),T=e(57576);c.attr("data-loaded","true").html(O),new T("[data-clipboard-text]"),u.fire("action:post.tools.load",{element:c})})})}W.toggle=function(o,t){const c=D.get("post","pid",o);c.find('[component="post/quote"], [component="post/bookmark"], [component="post/reply"], [component="post/flag"], [component="user/chat"]').toggleClass("hidden",t),c.find('[component="post/delete"]').toggleClass("hidden",t).parent().attr("hidden",t?"":null),c.find('[component="post/restore"]').toggleClass("hidden",!t).parent().attr("hidden",t?null:""),c.find('[component="post/purge"]').toggleClass("hidden",!t).parent().attr("hidden",t?null:""),W.removeMenu(c)},W.removeMenu=function(o){o.find('[component="post/tools"] .dropdown-menu').removeAttr("data-loaded").html("")},W.updatePostCount=function(o){D.get("topic/post-count").attr("title",o).html(p.humanReadableNumber(o)),I.setCount(o)};function V(o){const t=D.get("topic");F(),t.on("click",'[component="post/quote"]',function(){i($(this),o)}),t.on("click",'[component="post/reply"]',function(){n($(this),o)}),$(".topic").on("click",'[component="topic/reply"]',function(a){a.preventDefault(),n($(this),o)}),$(".topic").on("click",'[component="topic/reply-as-topic"]',async function(){u.fire("action:composer.topic.new",{cid:ajaxify.data.cid,body:await b()})}),t.on("click",'[component="post/bookmark"]',function(){return f($(this),h($(this),"data-pid"))}),t.on("click",'[component="post/upvote"]',function(){return E.toggleVote($(this),".upvoted",1)}),t.on("click",'[component="post/downvote"]',function(){return E.toggleVote($(this),".downvoted",-1)}),t.on("click",'[component="post/vote-count"]',function(){E.showVotes(h($(this),"data-pid"))}),t.on("click",'[component="post/announce-count"]',function(){E.showAnnouncers(h($(this),"data-pid"))}),t.on("click",'[component="post/flag"]',function(){const a=h($(this),"data-pid");e.e(6574).then(function(){var r=[e(6574)];
1(function(d){d.showFlagModal({type:"post",id:a})}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/already-flagged"]',function(){const a=$(this).data("flag-id");e.e(6574).then(function(){var r=[e(6574)];(function(d){m.confirm("[[flags:modal-confirm-rescind]]",function(v){v&&d.rescind(a)})}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/flagUser"]',function(){const a=h($(this),"data-uid");e.e(6574).then(function(){var r=[e(6574)];(function(d){d.showFlagModal({type:"user",id:a})}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/flagResolve"]',function(){const a=$(this).attr("data-flagId");e.e(6574).then(function(){var r=[e(6574)];(function(d){d.resolve(a)}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/edit"]',function(){const a=$(this),r=parseInt(h(a,"data-timestamp"),10),d=parseInt(ajaxify.data.postEditDuration,10);c(d,r,"post-edit-duration-expired")&&u.fire("action:composer.post.edit",{pid:h(a,"data-pid")})}),config.enablePostHistory&&ajaxify.data.privileges["posts:history"]&&t.on("click",'[component="post/view-history"], [component="post/edit-indicator"]',function(){const a=$(this);e.e(92747).then(function(){var r=[e(92747)];(function(d){d.open(h(a,"data-pid"))}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/delete"]',function(){const a=$(this),r=parseInt(h(a,"data-timestamp"),10),d=parseInt(ajaxify.data.postDeleteDuration,10);c(d,r,"post-delete-duration-expired")&&g($(this))});function c(a,r,d){if(!ajaxify.data.privileges.isAdminOrMod&&a&&Date.now()-r>a*1e3){const v=Math.floor(a/86400),x=Math.floor(a%86400/3600),M=Math.floor(a%86400%3600/60),O=a%86400%3600%60;let T="[[error:"+d+", "+a+"]]";return v?x?T="[[error:"+d+"-days-hours, "+v+", "+x+"]]":T="[[error:"+d+"-days, "+v+"]]":x?M?T="[[error:"+d+"-hours-minutes, "+x+", "+M+"]]":T="[[error:"+d+"-hours, "+x+"]]":M&&(O?T="[[error:"+d+"-minutes-seconds, "+M+", "+O+"]]":T="[[error:"+d+"-minutes, "+M+"]]"),l.error(T),!1}return!0}t.on("click",'[component="post/restore"]',function(){g($(this))}),t.on("click",'[component="post/purge"]',function(){H($(this))}),t.on("click",'[component="post/move"]',function(){const a=$(this);e.e(90677).then(function(){var r=[e(90677)];(function(d){d.init(a.parents("[data-pid]"))}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/change-owner"]',function(){const a=$(this);Promise.all([e.e(20056),e.e(17205)]).then(function(){var r=[e(17205)];(function(d){d.init(a.parents("[data-pid]"))}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/manage-editors"]',function(){const a=$(this);Promise.all([e.e(20056),e.e(24459)]).then(function(){var r=[e(24459)];(function(d){d.init(a.parents("[data-pid]"))}).apply(null,r)}).catch(e.oe)}),t.on("click",'[component="post/ban-ip"]',function(){const a=$(this).attr("data-ip");socket.emit("blacklist.addRule",a,function(r){if(r)return l.error(r);l.success("[[admin/manage/blacklist:ban-ip]]")})}),t.on("click",'[component="post/chat"]',function(){k($(this))})}function n(o,t){const c=s();N(function(){let a=y(o);const r=h(o,"data-uid");(r===String(app.user.uid)||r==="0"||!h(o,"data-userslug"))&&(a="");const v=o.is('[component="post/reply"]')?h(o,"data-pid"):null,x=!v||!c.pid||v===c.pid;c.text&&x?(a=a||c.username,u.fire("action:composer.addQuote",{tid:t,pid:v,title:ajaxify.data.title,username:a,body:c.text,selectedPid:c.pid})):u.fire("action:composer.post.new",{tid:t,pid:v,title:ajaxify.data.title,body:a?a+" ":$('[component="topic/quickreply/text"]').val()||""})})}function i(o,t){const c=s();N(async function(){const a=y(o),r=h(o,"data-pid"),d=c.text&&r&&r===c.pid?c.text:(await C.get(`/posts/${encodeURIComponent(r)}/raw`)).content;u.fire("action:composer.addQuote",{tid:t,pid:r,username:a,title:ajaxify.data.title,body:d})})}function s(){let o="",t,c="";const a=window.getSelection?window.getSelection():document.selection.createRange(),r=$('[component="post"] [component="post/content"]');let d;return r.each(function(v,x){a&&a.containsNode&&x&&a.containsNode(x,!0)&&(d=x)}),d&&a&&(o=a.toString(),t=$(d).parents('[component="post"]').attr("data-pid"),c=y($(d))),{text:o,pid:t,username:c}}function f(o,t){const c=o.attr("data-bookmarked")==="false"?"put":"del";return C[c](`/posts/${encodeURIComponent(t)}
1/bookmark`,void 0,function(a){if(a)return l.error(a);const r=c==="put"?"bookmark":"unbookmark";u.fire(`action:post.${r}`,{pid:t})}),!1}function h(o,t){return o.parents("[data-pid]").attr(t)}function y(o){let t="";if(o.attr("component")==="topic/reply")return t;const c=o.parents("[data-pid]"),a=c.hasClass("self-post");return c.length&&(t=S(c.attr("data-username"),!0),t||(c.attr("data-uid")!=="0"?t="[[global:former-user]]":t="[[global:guest]]"),t&&t!=="[[global:former-user]]"&&t!=="[[global:guest]]"&&(t=a?t:`@${t}`)),t}function g(o){const t=h(o,"data-pid"),a=D.get("post","pid",t).hasClass("deleted")?"restore":"delete";B(a,t)}function H(o){B("purge",h(o,"data-pid"))}async function B(o,t){({action:o}=await u.fire(`static:post.${o}`,{action:o,pid:t})),o&&m.confirm("[[topic:post-"+o+"-confirm]]",function(c){if(!c)return;const a=o==="purge"?"":"/state";C[o==="restore"?"put":"del"](`/posts/${encodeURIComponent(t)}${a}`).catch(l.error)})}function k(o){const t=o.parents("[data-pid]");return e.e(92619).then(function(){var c=[e(92619)];(function(a){a.newChat(t.attr("data-uid"))}).apply(null,c)}).catch(e.oe),o.parents(".dropdown").find(".dropdown-toggle").click(),!1}async function N(o){if(!parseInt(ajaxify.data.topicStaleDays,10))return o();const c=Math.min(Date.now()-1e3*60*60*24*ajaxify.data.topicStaleDays,864e13);if(K||ajaxify.data.lastposttime>=c)return o();m.dialog({title:"[[topic:stale.title]]",message:"[[topic:stale.warning]]",buttons:{reply:{label:"[[topic:stale.reply-anyway]]",className:"btn-link",callback:function(){K=!0,o()}},create:{label:"[[topic:stale.create]]",className:"btn-primary",callback:async function(){u.fire("action:composer.topic.new",{cid:ajaxify.data.cid,body:await b(),fromStaleTopic:!0})}}}})}const U=utils.debounce(J,250);function F(){ajaxify.data.privileges["topics:reply"]&&(u.onPage("action:posts.loaded",Y),$(document).off("selectionchange"),$(document).on("selectionchange",function(){window.getSelection().toString()===""&&$('[component="selection/tooltip"]').addClass("hidden")}),$(document).on("selectionchange",U))}function J(){window.getSelection().toString()===""||Y()}async function Y(){let o=$('[component="selection/tooltip"]');if(o.addClass("hidden"),o.attr("data-ajaxify")==="1"){o.remove();return}const t=window.getSelection();if(t.focusNode&&t.type==="Range"&&ajaxify.data.template.topic){const c=$(t.focusNode),a=$(t.anchorNode),r=a.parents("[data-pid]").attr("data-pid"),d=c.parents("[data-pid]").attr("data-pid");if(r!==d||!c.parents('[component="post/content"]').length||!a.parents('[component="post/content"]').length)return;const v=c.parents("[data-pid]"),x=t.getRangeAt(0);if(!v.length||x.collapsed)return;const M=x.getClientRects(),O=M[M.length-1];o.length||(o=await app.parseAndTranslate("partials/topic/selection-tooltip",ajaxify.data),$('[component="selection/tooltip"]').remove(),o.addClass("hidden").appendTo("body")),o.off("click").on("click",'[component="selection/tooltip/quote"]',function(){o.addClass("hidden"),i(v.find('[component="post/quote"]'),ajaxify.data.tid)}),o.removeClass("hidden"),$(window).one("action:ajaxify.start",function(){o.attr("data-ajaxify",1).addClass("hidden"),$(document).off("selectionchange",U)});const T=o.outerWidth(!0);o.css({top:O.bottom+$(window).scrollTop(),left:T>O.width?O.left:O.left+O.width-T})}}async function b(){const o=ajaxify.data.title.replace(/\]\]/g,"\\]\\]").replace(/\[\[/g,"\\[\\[").replace(/[/g,"[").replace(/]/g,"]"),t=`${config.relative_path}/topic/${ajaxify.data.slug}`;return await A.translateKey("topic:link-back",[o,t])}return W}).apply(j,R),w!==void 0&&(L.exports=w)},34342(L,j,e){var R,w;R=[e(52473),e(17459),e(49897),e(91749),e(65303),e(29930),e(89336),e(81335)],w=(function(P,I,D,A,E,C,m,l){const u={};let p={};u.addVoteHandler=function(){p={},S()&&(P.get("topic").on("mouseenter",'[data-pid] [component="post/vote-count"]',Q),P.get("topic").on("mouseleave",'[data-pid] [component="post/vote-count"]',K)),P.get("topic").on("mouseenter",'[data-pid] [component="post/announce-count"]',Q),P.get("topic").on("mouseleave",'[data-pid] [component="post/announce-count"]',K)};function S(){const{upvoteVisibility:n,privileges:i}=ajaxify.data;return i.isAdminOrMod||n==="all"||n==="loggedin"&&config.loggedIn}function W(){const{upvoteVisibility:n,downvoteVisibility:i,privileges:s}=ajaxify.data;return s.isAdminOrMod||n==="all"||i==="all"||(n==="loggedin"||i==="loggedin")&&config.loggedIn}function K(){const n=$(this),i=n.parents("[data-pid]").attr("data-pid"),s=m.Tooltip.getInstance(this);s&&(s.dispose(),n.attr("title","")),p[i]=!1}function Q(){const n=$(this),s=n.parent().parents("[data-pid]").attr("data-pid");p[s]=!0;const f=m.Tooltip.getInstance(this);f&&(f.dispose(),n.attr("title",""));const h=n.attr("component")==="post/vote-count"?`/posts/${encodeURIComponent(s)}/upvoters`:`/posts/${encodeURIComponent(s)}/announcers/tooltip`;D.get(h,{},function(y,g){if(y)return C.error(y);p[s]&&g&&V(n,g)})}async function V(n,i){function s(y){n.attr("title",y),new m.Tooltip(n,{container:"#content",html:!0}).show()}const f=i.usernames.filter(y=>y!=="[[global:former-user]]");if(!f.length)return;const h=f.join(", ");
1if(f.length+i.otherCount>i.cutoff){const y=await I.translateKey("topic:users-and-others",[h,i.otherCount]);s(y)}else s(utils.escapeHTML(h))}return u.toggleVote=async function(n,i,s,f){const h=n.closest("[data-pid]"),y=i.replace(/^\./,""),g=n.hasClass(y),H=g?"del":"put",B=g?-s:s,k=h.attr("data-pid");if(!app.user.uid){if(!config.activitypub.enabled)return ajaxify.go("login"),!1;let U;return utils.isNumber(k)?U=config.url+"/post/"+k:U=k,e.e(91722).then(e.bind(e,91722)).then(({trigger:F})=>{F("like",{object:U})}),!1}n.toggleClass(y),f&&n.find(f).toggleClass("fa text-danger",!g).toggleClass("fa-regular text-muted",g);const N=h.find('[component="post/vote-count"], [component="upvote-count"]');if(N.length){const U=parseInt(N.attr("data-votes")||N.text(),10)||0;N.text(U+B).attr("data-votes",U+B)}try{await D[H](`/posts/${encodeURIComponent(k)}/vote`,{delta:B})}catch(U){if(n.toggleClass(y),f&&n.find(f).toggleClass("fa text-danger",!g).toggleClass("fa-regular text-muted",g),N.length){const F=parseInt(N.attr("data-votes")||N.text(),10)||0;N.text(F-B).attr("data-votes",F-B)}return C.error(U.message),!1}return A.fire("action:post.toggleVote",{pid:k,delta:B,unvote:H==="del"}),!1},u.showVotes=async function(n){if(!W())return;const i=await D.get(`/posts/${encodeURIComponent(n)}/voters`,{}),s=await l.render("modals/votes",i),f=await E.dialog({title:"[[global:voters]]",message:s,className:"vote-modal",show:!0,onEscape:!0,backdrop:!0});f.on("click",function(){f.modal("hide")})},u.showAnnouncers=async function(n){const i=await D.get(`/posts/${encodeURIComponent(n)}/announcers`,{}).catch(h=>C.error(h)),s=await app.parseAndTranslate("modals/announcers",i),f=await E.dialog({title:`[[topic:announcers-x, ${i.announceCount}]]`,message:s,className:"announce-modal",show:!0,onEscape:!0,backdrop:!0});f.on("click",function(){f.modal("hide")})},u}).apply(j,R),w!==void 0&&(L.exports=w)},49897(L,j,e){e.r(j),e.d(j,{del:()=>Q,get:()=>u,head:()=>p,patch:()=>W,post:()=>S,put:()=>K});var R=e(91749),w=e.n(R),P=e(65303),I=e(17459),D=e.n(I),A=e(68636),E=e.n(A);const C=config.relative_path+"/api/v3";async function m(n,i){if(n.url=n.url.startsWith("/api")?config.relative_path+n.url:C+n.url,n.headers=n.headers||{},n.headers["x-return-to"]||(n.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof i=="function"){l(n).then(s=>i(null,s),s=>i(s));return}try{return await l(n)}catch(s){if(s.message===await I.translate("[[error:api.401]]",config.userLang)){const{url:f}=await(0,R.fire)("filter:admin.reauth",{url:"login"}),h=await I.translate("[[error:api.reauth-required]]",config.userLang);(0,P.confirm)(h,y=>{y&&(A.setItem("location-hash",window.location.hash),ajaxify.go(f))})}throw s}}async function l(n){const{url:i}=n;delete n.url,n.data&&!(n.data instanceof FormData)&&(n.data=JSON.stringify(n.data||{}),n.headers["content-type"]="application/json; charset=utf-8"),{options:n}=await(0,R.fire)("filter:api.options",{options:n}),n.data&&(n.body=n.data,delete n.data);const s=await fetch(i,n),{headers:f}=s;if(f.get("x-redirect"))return l({url:f.get("x-redirect"),...n});const h=f.get("content-type"),y=h&&h.startsWith("application/json");let g;if(n.method!=="HEAD"&&(y?g=await s.json():g=await s.text()),!s.ok){if(g){const H=y&&(g.status?.message||g.error||""),B=typeof g=="string"?g:s.statusText||`[[error:api.${s.status}]]`;throw new Error(y&&H?H:B)}throw new Error(s.statusText)}return y&&g&&g.hasOwnProperty("status")&&g.hasOwnProperty("response")?g.response:g}function u(n,i,s){return m({url:n+(i&&Object.keys(i).length?"?"+$.param(i):"")},s)}function p(n,i,s){return m({url:n+(i&&Object.keys(i).length?"?"+$.param(i):""),method:"HEAD"},s)}function S(n,i,s,f){return V("POST",n,i,s,f)}function W(n,i,s,f){return V("PATCH",n,i,s,f)}function K(n,i,s,f){return V("PUT",n,i,s,f)}function Q(n,i,s,f){return V("DELETE",n,i,s,f)}function V(n,i,s,f,h){return typeof f=="function"&&(h=f,f={}),m({url:i,method:n,data:s,headers:{"x-csrf-token":config.csrf_token,...f}},h)}},24962(L,j,e){var R,w;R=[e(91749),e(17459)],w=(function(P,I){const D={};D.addShareHandlers=function(C){function m(l,u,p,S){return window.open(l,"_blank","width="+p+",height="+S+",scrollbars=no,status=no"),P.fire("action:share.open",{url:l,urlToPost:u}),!1}$("#content").off("shown.bs.dropdown",".share-dropdown").on("shown.bs.dropdown",".share-dropdown",function(){const l=$(this).find(".post-link");
1l.val(E($(this))),setTimeout(function(){l.putCursorAtEnd().select()},50)}),A(".post-link",function(l){return l.preventDefault(),!1}),A('[component="share/twitter"]',function(){const l=E($(this)),u=`https://twitter.com/intent/tweet?text=${encodeURIComponent(C)}&url=${encodeURIComponent(l)}`;return m(u,l,550,420)}),A('[component="share/facebook"]',function(){const l=E($(this)),u=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(l)}`;return m(u,l,626,436)}),A('[component="share/whatsapp"]',function(){const l=E($(this)),u=encodeURIComponent(C)+" - "+encodeURIComponent(l),p=config.useragent.isMobile?`whatsapp://send?text=${u}`:`https://wa.me/?text=${u}`;return m(p,l,626,436)}),A('[component="share/telegram"]',function(){const l=E($(this)),u=`https://t.me/share/url?text=${encodeURIComponent(C)}&url=${encodeURIComponent(l)}`;return m(u,l,626,436)}),A('[component="share/linkedin"]',function(){const l=E($(this)),u=`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(l)}`;return m(u,l,626,436)}),A('[component="share/mastodon"]',function(){const l=E($(this)),u=`https://share.joinmastodon.org/#text=${encodeURIComponent(l)}`;return m(u,l,626,760)}),A('[component="share/email"]',async function(){const l=E($(this)),[u,p]=await I.translateKeys([I.compile("topic:share-mail-subject",config.siteTitle),I.compile("topic:share-mail-body",l)]),S=`mailto:?subject=${encodeURIComponent(u)}&body=${encodeURIComponent(p)}`;window.location.href=S}),P.fire("action:share.addHandlers",{openShare:m})};function A(C,m){$("#content").off("click",C).on("click",C,m)}function E(C){const m=C.parents("[data-pid]").attr("data-pid");return m?`${config.url}/post/${m}`:window.location.href}return D}).apply(j,R),w!==void 0&&(L.exports=w)},13230(L,j,e){var R,w;(function(P){R=P,w=typeof R=="function"?R.call(j,e,j,L):R,w!==void 0&&(L.exports=w)})(function(){const P=/[^\p{L}\s\d\-_@.]/gu,I=/[^\w\s\d\-_@.]/g,D=/^\s+|\s+$/g,A=/\s+/g,E=/-+/g,C=/-$/g,m=/^-/g,l=/^[\w\d\s.,\-@]+$/;return function(p,S){return!p||(p=String(p).replace(D,""),l.test(p)?p=p.replace(I,"-"):p=p.replace(P,"-"),p=S?p:p.toLocaleLowerCase(),p=p.replace(A,"-"),p=p.replace(E,"-"),p=p.replace(C,""),p=p.replace(m,""),p==="."||p==="..")?"":p}})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.