https://forum.loveismyform.com/assets/admin/modules-dashboard-line-graph.b18f17519873b7d2e4af.min.js
1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,18314,22067,34271,43602,49897,57843,87212,99127],{98569(w,P,s){s.r(P),s.d(P,{init:()=>e});var i=s(70106),_=s(81335),u=s.n(_),h=s(65303),l=s(17459),O=s.n(l),R=s(49897),v=s(91749),M=s.n(v);i.t1.register(i.ZT,i.PP,i.kc,i.No,i.FN,i.m_,i.dN);let c=null,p=!1;function e({set:g,dataset:D}){const d=document.getElementById("analytics-traffic"),t=d.getContext("2d"),n=utils.getHoursArray();p=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),p&&(i.t1.defaults.plugins.tooltip.enabled=!1),o({set:g});const r=l.Translator.create();return new Promise(a=>{r.translateKey(`admin/menu:${ajaxify.data.template.name.replace("admin/","")}`,[]).then(m=>{const f={labels:n,datasets:[{label:m,fill:!0,tension:.25,backgroundColor:"rgba(151,187,205,0.2)",borderColor:"rgba(151,187,205,1)",pointBackgroundColor:"rgba(151,187,205,1)",pointHoverBackgroundColor:"rgba(151,187,205,1)",pointBorderColor:"#fff",pointHoverBorderColor:"rgba(151,187,205,1)",data:D||[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}]};d.width=$(d).parent().width(),f.datasets[0].yAxisID="left-y-axis",c=new i.t1(t,{type:"line",data:f,options:{responsive:!0,maintainAspectRatio:!1,scales:{"left-y-axis":{type:"linear",position:"left",beginAtZero:!0,title:{display:!1,text:m}}},plugins:{legend:{display:!1,position:"bottom"}},interaction:{intersect:!1,mode:"index"}}}),D?a(c):y(g).then(a)})})}function o({set:g}){$('[data-action="updateGraph"]').on("change",function(){let d=$(this).val();if(d==="custom"){D($(this));return}const t=d==="1"?"hours":"days";let n=new Date;d!=="1"&&n.setHours(0,0,0,0),d==="1"&&(d="24"),n=n.getTime(),y(g,t,n,d),$('[data-action="updateGraph"] option[value="range"]').addClass("hidden")});function D(d){_.render("admin/partials/pageviews-range-select",{}).then(async t=>{const n=await h.dialog({title:"[[admin/dashboard:page-views-custom]]",message:t,buttons:{submit:{label:"[[global:search]]",className:"btn-primary",callback:r}}}).on("shown.bs.modal",function(){const a=new Date,m=a.toISOString().slice(0,10);a.setDate(a.getDate()-1);const f=a.toISOString().slice(0,10);n.find("#startRange").val(d.attr("data-startRange")||f),n.find("#endRange").val(d.attr("data-endRange")||m)});function r(){const a=n.find("form").serializeObject(),m=/\d{4}-\d{2}-\d{2}/;if(!a.startRange&&!a.endRange){y(g,"days");return}else if(!m.test(a.startRange)||!m.test(a.endRange))return n.find(".alert-danger").removeClass("hidden"),!1;let f=new Date(a.endRange);f.setDate(f.getDate()+1),f=f.getTime();const E=(f-new Date(a.startRange).getTime())/(1e3*60*60*24);y(g,"days",f,E),d.attr("data-startRange",a.startRange),d.attr("data-endRange",a.endRange),d.find('option[value="range"]').text(a.startRange+" - "+a.endRange),d.val("range")}})}}function y(g,D=ajaxify.data.query.units||"hours",d=ajaxify.data.query.until,t=ajaxify.data.query.count){return c?new Promise(n=>{R.get(`/admin/analytics/${g}`,{units:D,until:d,amount:t}).then(r=>{D==="days"?c.data.xLabels=utils.getDaysArray(d,t):c.data.xLabels=utils.getHoursArray(),c.data.datasets[0].data=r,c.data.labels=c.data.xLabels,c.update();const a=$("#view-as-json"),m=$.param({units:D||"hours",until:d,count:t});a.attr("href",`${config.relative_path}/api/v3/admin/analytics/${ajaxify.data.set}?${m}`);const f=ajaxify.removeRelativePath(ajaxify.data.url.slice(1));ajaxify.updateHistory(`${f}?${m}`,!0),v.fire("action:admin.dashboard.updateGraph",{graph:c}),n(c)})}):Promise.reject(new Error("[[error:invalid-data]]"))}},49897(w,P,s){s.r(P),s.d(P,{del:()=>D,get:()=>p,head:()=>e,patch:()=>y,post:()=>o,put:()=>g});var i=s(91749),_=s.n(i),u=s(65303),h=s(17459),l=s.n(h),O=s(68636),R=s.n(O);const v=config.relative_path+"/api/v3";async function M(t,n){if(t.url=t.url.startsWith("/api")?config.relative_path+t.url:v+t.url,t.headers=t.headers||{},t.headers["x-return-to"]||(t.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof n=="function"){c(t).then(r=>n(null,r),r=>n(r));return}try{return await c(t)}catch(r){if(r.message===await h.translate("[[error:api.401]]",config.userLang)){const{url:a}=await(0,i.fire)("filter:admin.reauth",{url:"login"}),m=await h.translate("[[error:api.reauth-required]]",config.userLang);(0,u.confirm)(m,f=>{f&&(O.setItem("location-hash",window.location.hash),ajaxify.go(a))})}throw r}}async function c(t){const{url:n}=t;delete t.url,t.data&&!(t.data instanceof FormData)&&(t.data=JSON.stringify(t.data||{}),t.headers["content-type"]="application/json; charset=utf-8"),{options:t}=await(0,i.fire)("filter:api.options",{options:t}),t.data&&(t.body=t.data,delete t.data);const r=await fetch(n,t),{headers:a}=r;if(a.get("x-redirect"))return c({url:a.get("x-redirect"),...t});const m=a.get("content-type"),f=m&&m.startsWith("application/json");let E;if(t.method!=="HEAD"&&(f?E=await r.json():E=await r.text()),!r.ok){if(E){const C=f&&(E.status?.message||E.error||""),I=typeof E=="string"?E:r.statusText||`[[error:api.${r.status}]]`;throw new Error(f&&C?C:I)}throw new Error(r.statusText)}return f&&E&&E.hasOwnProperty("status")&&E.hasOwnProperty("response")?E.response:E}function p(t,n,r){return M({url:t+(n&&Object.keys(n).length?"?"+$.param(n):"")},r)}function e(t,n,r){return M({url:t+(n&&Object.keys(n).length?"?"+$.param(n):""),method:"HEAD"},r)}function o(t,n,r,a){return d("POST",t,n,r,a)}function y(t,n,r,a){return d("PATCH",t,n,r,a)}function g(t,n,r,a){return d("PUT",t,n,r,a)}function D(t,n,r,a){return d("DELETE",t,n,r,a)}function d(t,n,r,a,m){return typeof a=="function"&&(m=a,a={}),M({url:n,method:t,data:r,headers:{"x-csrf-token":config.csrf_token,...a}},m)}},65303(w,P,s){s.r(P),s.d(P,{alert:()=>O,confirm:()=>R,dialog:()=>l,prompt:()=>v,promptPassword:()=>M});var i=s(33530),_=s.n(i),u=s(17459),h=s.n(u);i.setDefaults({locale:config.userLang}),u.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(e=>{i.addLocale(config.userLang,{OK:e[0],CANCEL:e[1],CONFIRM:e[2]}),i.setLocale(config.userLang)});async function l(e){const[o,y,g]=await Promise.all([u.translate(e.title||""),c(e)||"",p(e.buttons)]);return i.dialog({...e,title:o,message:y,buttons:g})}async function O(e,o){const[y,g]=await Promise.all([e&&e.title?u.translate(e.title):null,c(e)]);return o=typeof o=="function"?o:e.callback,i.alert({...e,title:y,message:g,callback:o})}async function R(e,o){const[y,g]=await Promise.all([e&&e.title?u.translate(e.title):null,c(e)]);return o=typeof o=="function"?o:e.callback,i.confirm({...e,title:y,message:g,callback:o})}async function v(e,o){const[y,g]=await Promise.all([u.translate(typeof e=="string"?e:e.title),e&&e.message?c(e):null]);return o=typeof o=="function"?o:e.callback,i.prompt({...e,title:y,message:g,callback:o})}async function M(e){return typeof e=="string"&&(e={title:e}),e=e||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(o=>{v({...e,inputType:"password",required:!0,value:"",callback:o})})}function c(e){const o=e&&e.message?e.message:e;return o instanceof jQuery?o:u.translate(o||"")}async function p(e){if(!Object.keys(e||{}).length)return;const o=Object.values(e);return await Promise.all(o.map(async y=>({...y,label:await u.translateKey(y.label)})))}},68636(w,P,s){var i;i=(function(){function _(){this._store={},this._keys=[]}_.prototype.isMock=!0,_.prototype.setItem=function(l,O){l=String(l),this._keys.indexOf(l)===-1&&this._keys.push(l),this._store[l]=O},_.prototype.getItem=function(l){return l=String(l),this._keys.indexOf(l)===-1?null:this._store[l]},_.prototype.removeItem=function(l){l=String(l),this._keys=this._keys.filter(function(O){return O!==l}),this._store[l]=null},_.prototype.clear=function(){this._keys=[],this._store={}},_.prototype.key=function(l){return l=parseInt(l,10)||0,this._keys[l]},Object.defineProperty&&Object.defineProperty(_.prototype,"length",{get:function(){return this._keys.length}});let u;const h=Date.now().toString();try{if(u=window.localStorage,u.setItem(h,h),u.getItem(h)!==h)throw Error("localStorage behaved unexpectedly");return u.removeItem(h),u}catch(l){console.warn(l),console.warn("localStorage failed, falling back on sessionStorage");try{if(u=window.sessionStorage,u.setItem(h,h),u.getItem(h)!==h)throw Error("sessionStorage behaved unexpectedly");return u.removeItem(h),u}catch(O){return console.warn(O),console.warn("sessionStorage failed, falling back on memory storage"),new _}}}).call(P,s,P,w),i!==void 0&&(w.exports=i)}}]);
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.