1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,18314,22067,29718,34271,43602,49897,87212,91722,99127],{49897(b,v,s){s.r(v),s.d(v,{del:()=>U,get:()=>K,head:()=>t,patch:()=>h,post:()=>i,put:()=>E});var d=s(91749),p=s.n(d),f=s(65303),g=s(17459),l=s.n(g),O=s(68636),j=s.n(O);const x=config.relative_path+"/api/v3";async function I(e,c){if(e.url=e.url.startsWith("/api")?config.relative_path+e.url:x+e.url,e.headers=e.headers||{},e.headers["x-return-to"]||(e.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof c=="function"){D(e).then(r=>c(null,r),r=>c(r));return}try{return await D(e)}catch(r){if(r.message===await g.translate("[[error:api.401]]",config.userLang)){const{url:u}=await(0,d.fire)("filter:admin.reauth",{url:"login"}),w=await g.translate("[[error:api.reauth-required]]",config.userLang);(0,f.confirm)(w,a=>{a&&(O.setItem("location-hash",window.location.hash),ajaxify.go(u))})}throw r}}async function D(e){const{url:c}=e;delete e.url,e.data&&!(e.data instanceof FormData)&&(e.data=JSON.stringify(e.data||{}),e.headers["content-type"]="application/json; charset=utf-8"),{options:e}=await(0,d.fire)("filter:api.options",{options:e}),e.data&&(e.body=e.data,delete e.data);const r=await fetch(c,e),{headers:u}=r;if(u.get("x-redirect"))return D({url:u.get("x-redirect"),...e});const w=u.get("content-type"),a=w&&w.startsWith("application/json");let n;if(e.method!=="HEAD"&&(a?n=await r.json():n=await r.text()),!r.ok){if(n){const m=a&&(n.status?.message||n.error||""),o=typeof n=="string"?n:r.statusText||`[[error:api.${r.status}]]`;throw new Error(a&&m?m:o)}throw new Error(r.statusText)}return a&&n&&n.hasOwnProperty("status")&&n.hasOwnProperty("response")?n.response:n}function K(e,c,r){return I({url:e+(c&&Object.keys(c).length?"?"+$.param(c):"")},r)}function t(e,c,r){return I({url:e+(c&&Object.keys(c).length?"?"+$.param(c):""),method:"HEAD"},r)}function i(e,c,r,u){return T("POST",e,c,r,u)}function h(e,c,r,u){return T("PATCH",e,c,r,u)}function E(e,c,r,u){return T("PUT",e,c,r,u)}function U(e,c,r,u){return T("DELETE",e,c,r,u)}function T(e,c,r,u,w){return typeof u=="function"&&(w=u,u={}),I({url:c,method:e,data:r,headers:{"x-csrf-token":config.csrf_token,...u}},w)}},91722(b,v,s){s.r(v),s.d(v,{addHandlers:()=>r,list:()=>E,refresh:()=>T,register:()=>e,save:()=>U,trigger:()=>w});var d=s(65303),p=s(81335),f=s.n(p),g=s(49897),l=s(68636),O=s.n(l),j=s(17459),x=s.n(j),I=s(29930);const D="ap:intents:handles";function K(){try{return O().getItem(D)}catch{return null}}function t(a){try{O().setItem(D,a)}catch{}}const i={create:"[[intents:display.create]]",like:"[[intents:display.like]]",dislike:"[[intents:display.dislike]]",follow:"[[intents:display.follow]]",object:"[[intents:display.object]]"};async function h(a){return await(0,j.translateKeys)(Object.keys(a).map(n=>`${i[n.toLowerCase()]}`))}function E(){const a=K();if(!a)return new Map;let n;try{n=JSON.parse(a)}catch{return new Map}const m=new Map;return Array.isArray(n)&&n.forEach(o=>{o&&o.handle&&typeof o.intents=="object"&&!Array.isArray(o.intents)&&m.set(o.handle,o.intents)}),m}function U(a,n){if(typeof a!="string"||!a.trim()||(a=a.trim(),!n||typeof n!="object"||Array.isArray(n)))return;const m=E();m.set(a,n);const o=Array.from(m.entries()).map(([_,A])=>({handle:_,intents:A}));t(JSON.stringify(o))}async function T(a){if(typeof a!="string"||!a.trim())return null;a=a.trim().replace(/^@/,"");const n=await(0,g.get)(`/api/v3/intents/query/${a}`);return n&&n.intents&&typeof n.intents=="object"?(U(a,n.intents),{intents:Object.keys(n.intents)}):null}async function e(){if(!config.activitypub.enabled)return;let a=E(),n=await Promise.all(Array.from(a.entries()).map(async([m,o])=>({handle:m,intents:(await h(o)).join(", ")})));p.render("modals/intents/register",{description:"[[intents:description]]",handles:n}).then(async m=>{const o=await(0,d.dialog)({title:"[[intents:title]]",message:m}),_=o.find("#intents-handle-input"),A=o.find("#intents-register-btn"),W=()=>{const L=_.val().trim(),y=/^@?[\w.-]+@[\w.-]+\.[\w]{2,}$/.test(L);A.prop("disabled",!y)};_.on("input",W),W(),o.find("#intents-register-form").on("submit",async L=>{L.preventDefault();const y=_.val().trim();A.prop("disabled",!0);try{await T(y),a=E(),n=await Promise.all(Array.from(a.entries()).map(async([S,C])=>({handle:S,intents:(await h(C)).join(", ")})));const P=await p.render("modals/intents/register",{handles:n});o.find("#intents-registered-list").html(P)}catch(P){I.error(P.message)}finally{_.val(""),A.prop("disabled",!1)}}),o.on("click",'[data-action="remove"]',function(){const L=$(this).attr("data-handle"),y=E();y.delete(L);const P=Array.from(y.entries()).map(([S,C])=>({handle:S,intents:C}));t(JSON.stringify(P)),$(this).closest("li").remove(),y.size||(o.find("#intents-registered-list").closest("hr").next("h6, p").remove(),o.find("#intents-registered-list").closest("hr").prev("p").after('<p class="text-muted mt-3">[[intents:no-handles]]</p>'))})})}const c='[component="topic/reply/guest"], [component="category/post/guest"]';function r(){config.activitypub.enabled&&(document.removeEventListener("click",u),document.addEventListener("click",u,!0))}function u(a){if(a.target.closest(c)){a.preventDefault(),a.stopPropagation();const m=ajaxify.data.tid,o=ajaxify.data.cid,_={};m?(_.inReplyTo=utils.isNumber(ajaxify.data.mainPid)?`${config.url}/post/${ajaxify.data.mainPid}`:ajaxify.data.mainPid,_.content=`@${ajaxify.data.author.userslug}`):o&&(_.content=`@${ajaxify.data.handleFull}`),w("create",_)}}async function w(a,n){if(!config.activitypub.enabled)return;const m=E(),o=a.toLowerCase(),_=i[o],A=await(0,j.translate)(`${_||a}`),W=Array.from(m.entries()).filter(([,y])=>y&&typeof y=="object"&&o in y).map(([y,P])=>({handle:y,intents:P})),L=await Promise.all(W.map(async({handle:y,intents:P})=>({handle:y,intents:(await h(P)).join(", ")})));p.render("modals/intents/trigger",{displayIntent:A,matchingHandles:L,hasAnyHandles:m.size>0}).then(async y=>{const P=await(0,d.dialog)({title:`[[intents:trigger-title, ${A}]]`,message:y});P.on("click",'[data-action="execute-intent"]',function(){const S=$(this).attr("data-handle"),C=m.get(S);let M=C&&C[o];
1if(M&&n&&typeof n=="object"&&Object.keys(n).forEach(R=>{const N=n[R],B=`{${R}}`;M.includes(B)&&(M=M.replaceAll(B,encodeURIComponent(N)))}),M=M?.replaceAll(/\{[^}]+\}/g,""),M)try{const R=new URL(M);(R.protocol==="http:"||R.protocol==="https:")&&(window.location.href=M)}catch{}}),P.on("click",'[data-action="open-register"]',function(){P.modal("hide"),setTimeout(()=>e(),300)}),P.on("click",'[data-action="go-login"]',function(){P.modal("hide"),ajaxify.go("login")})})}},65303(b,v,s){s.r(v),s.d(v,{alert:()=>O,confirm:()=>j,dialog:()=>l,prompt:()=>x,promptPassword:()=>I});var d=s(33530),p=s.n(d),f=s(17459),g=s.n(f);d.setDefaults({locale:config.userLang}),f.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(t=>{d.addLocale(config.userLang,{OK:t[0],CANCEL:t[1],CONFIRM:t[2]}),d.setLocale(config.userLang)});async function l(t){const[i,h,E]=await Promise.all([f.translate(t.title||""),D(t)||"",K(t.buttons)]);return d.dialog({...t,title:i,message:h,buttons:E})}async function O(t,i){const[h,E]=await Promise.all([t&&t.title?f.translate(t.title):null,D(t)]);return i=typeof i=="function"?i:t.callback,d.alert({...t,title:h,message:E,callback:i})}async function j(t,i){const[h,E]=await Promise.all([t&&t.title?f.translate(t.title):null,D(t)]);return i=typeof i=="function"?i:t.callback,d.confirm({...t,title:h,message:E,callback:i})}async function x(t,i){const[h,E]=await Promise.all([f.translate(typeof t=="string"?t:t.title),t&&t.message?D(t):null]);return i=typeof i=="function"?i:t.callback,d.prompt({...t,title:h,message:E,callback:i})}async function I(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(i=>{x({...t,inputType:"password",required:!0,value:"",callback:i})})}function D(t){const i=t&&t.message?t.message:t;return i instanceof jQuery?i:f.translate(i||"")}async function K(t){if(!Object.keys(t||{}).length)return;const i=Object.values(t);return await Promise.all(i.map(async h=>({...h,label:await f.translateKey(h.label)})))}},68636(b,v,s){var d;d=(function(){function p(){this._store={},this._keys=[]}p.prototype.isMock=!0,p.prototype.setItem=function(l,O){l=String(l),this._keys.indexOf(l)===-1&&this._keys.push(l),this._store[l]=O},p.prototype.getItem=function(l){return l=String(l),this._keys.indexOf(l)===-1?null:this._store[l]},p.prototype.removeItem=function(l){l=String(l),this._keys=this._keys.filter(function(O){return O!==l}),this._store[l]=null},p.prototype.clear=function(){this._keys=[],this._store={}},p.prototype.key=function(l){return l=parseInt(l,10)||0,this._keys[l]},Object.defineProperty&&Object.defineProperty(p.prototype,"length",{get:function(){return this._keys.length}});let f;const g=Date.now().toString();try{if(f=window.localStorage,f.setItem(g,g),f.getItem(g)!==g)throw Error("localStorage behaved unexpectedly");return f.removeItem(g),f}catch(l){console.warn(l),console.warn("localStorage failed, falling back on sessionStorage");try{if(f=window.sessionStorage,f.setItem(g,g),f.getItem(g)!==g)throw Error("sessionStorage behaved unexpectedly");return f.removeItem(g),f}catch(O){return console.warn(O),console.warn("sessionStorage failed, falling back on memory storage"),new p}}}).call(v,s,v,b),d!==void 0&&(b.exports=d)}}]);
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.