1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,12533,18314,22067,22765,34271,43602,65928,87212,92747,99127],{92747(w,y,i){var f,d;f=[i(49897),i(65303),i(29930),i(81335),i(2269)],d=(function(o,c,r,p){const E={},D={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"};E.open=function(s){config.enablePostHistory&&o.get(`/posts/${encodeURIComponent(s)}/diffs`,{}).then(g=>{P(g).then(async t=>{const e=await c.dialog({title:"[[topic:diffs.title]]",message:t,size:"large",onEscape:!0,backdrop:!0});if(!g.timestamps.length)return;const l=e.find("select"),h=e.find('button[data-action="restore"]'),O=e.find('button[data-action="delete"]'),I=e.find("ul.posts-list"),n=e.find(".number-of-diffs strong");l.on("change",function(){E.load(s,this.value,I),h.prop("disabled",g.timestamps.indexOf(this.value)===0),O.prop("disabled",g.timestamps.indexOf(this.value)===0)}),h.on("click",function(){E.restore(s,l.val(),e)}),O.on("click",function(){E.delete(s,l.val(),l,n)}),e.on("shown.bs.modal",function(){E.load(s,l.val(),I),h.prop("disabled",!0),O.prop("disabled",!0)})})}).catch(r.error)},E.load=function(s,g,t){config.enablePostHistory&&o.get(`/posts/${encodeURIComponent(s)}/diffs/${g}`,{}).then(e=>{e.deleted=!!parseInt(e.deleted,10),app.parseAndTranslate("partials/posts_list","posts",{posts:[e]},function(l){t.empty().append(l),t.find(".timeago").timeago()})}).catch(r.error)},E.restore=function(s,g,t){config.enablePostHistory&&o.put(`/posts/${encodeURIComponent(s)}/diffs/${g}`,{}).then(()=>{t.modal("hide"),r.success("[[topic:diffs.post-restored]]")}).catch(r.error)},E.delete=function(s,g,t,e){o.del(`/posts/${encodeURIComponent(s)}/diffs/${g}`).then(l=>{P(l,"diffs").then(h=>{t.empty().append(h),t.trigger("change");const O=t.find("option").length;e.text(O),r.success("[[topic:diffs.deleted]]")})}).catch(r.error)};async function P(s,g){const t=[{diffs:s.revisions.map(function(e){const l=parseInt(e.timestamp,10);return{username:e.username,timestamp:l,pretty:new Date(l).toLocaleString(config.userLang.replace("_","-"),D)}}),numDiffs:s.timestamps.length,editable:s.editable,deletable:s.deletable}];return g&&t.unshift(g),await p.render("modals/post-history",...t)}return E}).apply(y,f),d!==void 0&&(w.exports=d)},2269(w,y){var i,f;i=[],f=(function(){const d={},o=/-resized(\.[\w]+)?$/;return d.wrapImagesInLinks=function(c){c.find('[component="post/content"] img:not(.emoji)').each(function(){d.wrapImageInLink($(this))})},d.wrapImageInLink=function(c){let r=c.attr("src")||"";if(r!=="about:blank"&&!c.parent().is("a")){utils.isRelativeUrl(r)&&o.test(r)&&(r=r.replace(o,"$1"));const p=c.attr("alt")||"",E=r.split(".").slice(1).pop(),D=p.split("/").pop(),P=D.split(".").slice(1).pop(),s=$('<a target="_blank" rel="noopener"></a>').attr("href",r);!E&&P&&s.attr("download",D),c.wrap(s)}},d}).apply(y,i),f!==void 0&&(w.exports=f)},49897(w,y,i){i.r(y),i.d(y,{del:()=>O,get:()=>g,head:()=>t,patch:()=>l,post:()=>e,put:()=>h});var f=i(91749),d=i.n(f),o=i(65303),c=i(17459),r=i.n(c),p=i(68636),E=i.n(p);const D=config.relative_path+"/api/v3";async function P(n,u){if(n.url=n.url.startsWith("/api")?config.relative_path+n.url:D+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 u=="function"){s(n).then(a=>u(null,a),a=>u(a));return}try{return await s(n)}catch(a){if(a.message===await c.translate("[[error:api.401]]",config.userLang)){const{url:m}=await(0,f.fire)("filter:admin.reauth",{url:"login"}),v=await c.translate("[[error:api.reauth-required]]",config.userLang);(0,o.confirm)(v,A=>{A&&(p.setItem("location-hash",window.location.hash),ajaxify.go(m))})}throw a}}async function s(n){const{url:u}=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,f.fire)("filter:api.options",{options:n}),n.data&&(n.body=n.data,delete n.data);const a=await fetch(u,n),{headers:m}=a;if(m.get("x-redirect"))return s({url:m.get("x-redirect"),...n});const v=m.get("content-type"),A=v&&v.startsWith("application/json");let _;if(n.method!=="HEAD"&&(A?_=await a.json():_=await a.text()),!a.ok){if(_){const M=A&&(_.status?.message||_.error||""),L=typeof _=="string"?_:a.statusText||`[[error:api.${a.status}]]`;throw new Error(A&&M?M:L)}throw new Error(a.statusText)}return A&&_&&_.hasOwnProperty("status")&&_.hasOwnProperty("response")?_.response:_}function g(n,u,a){return P({url:n+(u&&Object.keys(u).length?"?"+$.param(u):"")},a)}function t(n,u,a){return P({url:n+(u&&Object.keys(u).length?"?"+$.param(u):""),method:"HEAD"},a)}function e(n,u,a,m){return I("POST",n,u,a,m)}function l(n,u,a,m){return I("PATCH",n,u,a,m)}function h(n,u,a,m){return I("PUT",n,u,a,m)}function O(n,u,a,m){return I("DELETE",n,u,a,m)}function I(n,u,a,m,v){return typeof m=="function"&&(v=m,m={}),P({url:u,method:n,data:a,headers:{"x-csrf-token":config.csrf_token,...m}},v)}},65303(w,y,i){i.r(y),i.d(y,{alert:()=>p,confirm:()=>E,dialog:()=>r,prompt:()=>D,promptPassword:()=>P});var f=i(33530),d=i.n(f),o=i(17459),c=i.n(o);f.setDefaults({locale:config.userLang}),o.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(t=>{f.addLocale(config.userLang,{OK:t[0],CANCEL:t[1],CONFIRM:t[2]}),f.setLocale(config.userLang)});async function r(t){const[e,l,h]=await Promise.all([o.translate(t.title||""),s(t)||"",g(t.buttons)]);return f.dialog({...t,title:e,message:l,buttons:h})}async function p(t,e){const[l,h]=await Promise.all([t&&t.title?o.translate(t.title):null,s(t)]);return e=typeof e=="function"?e:t.callback,f.alert({...t,title:l,message:h,callback:e})}async function E(t,e){const[l,h]=await Promise.all([t&&t.title?o.translate(t.title):null,s(t)]);return e=typeof e=="function"?e:t.callback,f.confirm({...t,title:l,message:h,callback:e})}async function D(t,e){const[l,h]=await Promise.all([o.translate(typeof t=="string"?t:t.title),t&&t.message?s(t):null]);return e=typeof e=="function"?e:t.callback,f.prompt({...t,title:l,message:h,callback:e})}async function P(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(e=>{D({...t,inputType:"password",required:!0,value:"",callback:e})})}function s(t){const e=t&&t.message?t.message:t;return e instanceof jQuery?e:o.translate(e||"")}async function g(t){if(!Object.keys(t||{}).length)return;const e=Object.values(t);return await Promise.all(e.map(async l=>({...l,label:await o.translateKey(l.label)})))}},68636(w,y,i){var f;f=(function(){function d(){this._store={},this._keys=[]}d.prototype.isMock=!0,d.prototype.setItem=function(r,p){r=String(r),this._keys.indexOf(r)===-1&&this._keys.push(r),this._store[r]=p},d.prototype.getItem=function(r){return r=String(r),this._keys.indexOf(r)===-1?null:this._store[r]},d.prototype.removeItem=function(r){r=String(r),this._keys=this._keys.filter(function(p){return p!==r}),this._store[r]=null},d.prototype.clear=function(){this._keys=[],this._store={}},d.prototype.key=function(r){return r=parseInt(r,10)||0,this._keys[r]},Object.defineProperty&&Object.defineProperty(d.prototype,"length",{get:function(){return this._keys.length}});let o;const c=Date.now().toString();try{if(o=window.localStorage,o.setItem(c,c),o.getItem(c)!==c)throw Error("localStorage behaved unexpectedly");return o.removeItem(c),o}catch(r){console.warn(r),console.warn("localStorage failed, falling back on sessionStorage");try{if(o=window.sessionStorage,o.setItem(c,c),o.getItem(c)!==c)throw Error("sessionStorage behaved unexpectedly");return o.removeItem(c),o}catch(p){return console.warn(p),console.warn("sessionStorage failed, falling back on memory storage"),new d}}}).call(y,i,y,w),f!==void 0&&(w.exports=f)}}]);
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.