芝麻web文件管理V1.00
").append(n.__Content).html()),e&&n._$origin.attr("title",e),n._$origin.removeClass("tooltipstered"),n._$origin.removeData("tooltipster-ns").removeData("tooltipster-initialTitle")):(t=w.grep(t,function(t,e){return t!==n.__namespace}),n._$origin.data("tooltipster-ns",t))),n._trigger("destroyed"),n._off(),n.off(),n.__Content=null,n.__$emitterPrivate=null,n.__$emitterPublic=null,n.__options.parent=null,n._$origin=null,n._$tooltip=null,w.tooltipster.__instancesLatestArr=w.grep(w.tooltipster.__instancesLatestArr,function(t,e){return n!==t}),clearInterval(n.__garbageCollector)),n},disable:function(){return this.__destroyed?this.__destroyError():(this._close(),this.__enabled=!1),this},elementOrigin:function(){if(!this.__destroyed)return this._$origin[0];this.__destroyError()},elementTooltip:function(){return this._$tooltip?this._$tooltip[0]:null},enable:function(){return this.__enabled=!0,this},hide:function(t){return this.close(t)},instance:function(){return this},off:function(){return this.__destroyed||this.__$emitterPublic.off.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},on:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.on.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},one:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.one.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this},open:function(t){return this.__destroyed?this.__destroyError():this._open(null,t),this},option:function(t,e){return void 0===e?this.__options[t]:(this.__destroyed?this.__destroyError():(this.__options[t]=e,this.__optionsFormat(),0<=w.inArray(t,["trigger","triggerClose","triggerOpen"])&&this.__prepareOrigin(),"selfDestruction"===t&&this.__prepareGC()),this)},reposition:function(t,e){var n=this;return n.__destroyed?n.__destroyError():"closed"!=n.__state&&l(n._$origin)&&(e||l(n._$tooltip))&&(e||n._$tooltip.detach(),n.__Geometry=n.__geometry(),n._trigger({type:"reposition",event:t,helper:{geo:n.__Geometry}})),n},show:function(t){return this.open(t)},status:function(){return{destroyed:this.__destroyed,enabled:this.__enabled,open:"closed"!==this.__state,state:this.__state}},triggerHandler:function(){return this.__destroyed?this.__destroyError():this.__$emitterPublic.triggerHandler.apply(this.__$emitterPublic,Array.prototype.slice.apply(arguments)),this}},w.fn.tooltipster=function(){var n,a,t,e,o,r=Array.prototype.slice.apply(arguments),i="You are using a single HTML element as content for several tooltips. You probably want to set the contentCloning option to TRUE.";return 0===this.length?this:"string"==typeof r[0]?(n="#*$~&",this.each(function(){var t=w(this).data("tooltipster-ns");if(!(t=t?w(this).data(t[0]):null))throw new Error("You called Tooltipster's \""+r[0]+'" method on an uninitialized element');if("function"!=typeof t[r[0]])throw new Error('Unknown method "'+r[0]+'"');1').append(this.__$tooltip).appendTo(b.window.document.body)},__forceRedraw:function(){var t=this.__$tooltip.parent();this.__$tooltip.detach(),this.__$tooltip.appendTo(t)},constrain:function(t,e){return this.constraints={width:t,height:e},this.__$tooltip.css({display:"block",height:"",overflow:"auto",width:t}),this},destroy:function(){this.__$tooltip.detach().find(".tooltipster-content").css({display:"",overflow:""}),this.$container.remove()},free:function(){return this.constraints=null,this.__$tooltip.css({display:"",height:"",overflow:"visible",width:""}),this},measure:function(){this.__forceRedraw();var t,e,n,a=this.__$tooltip[0].getBoundingClientRect(),o={size:{height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}};return this.constraints&&(t=this.__$tooltip.find(".tooltipster-content"),n=this.__$tooltip.outerHeight(),e=t[0].getBoundingClientRect(),n={height:n<=this.constraints.height,width:a.width<=this.constraints.width&&e.width>=t[0].scrollWidth-1},o.fits=n.height&&n.width),b.IE&&b.IE<=11&&o.size.width!==b.window.document.documentElement.clientWidth&&(o.size.width=Math.ceil(o.size.width)+1),o}};var n=navigator.userAgent.toLowerCase(),a=(-1!=n.indexOf("msie")?b.IE=parseInt(n.split("msie")[1]):-1!==n.toLowerCase().indexOf("trident")&&-1!==n.indexOf(" rv:11")?b.IE=11:-1!=n.toLowerCase().indexOf("edge/")&&(b.IE=parseInt(n.toLowerCase().split("edge/")[1])),"tooltipster.sideTip");return w.tooltipster._plugin({name:a,instance:{__defaults:function(){return{arrow:!0,distance:6,functionPosition:null,maxWidth:null,minIntersection:16,minWidth:0,position:null,side:"top",viewportAware:!0}},__init:function(t){var e=this;e.__instance=t,e.__namespace="tooltipster-sideTip-"+Math.round(1e6*Math.random()),e.__previousState="closed",e.__options,e.__optionsFormat(),e.__instance._on("state."+e.__namespace,function(t){"closed"==t.state?e.__close():"appearing"==t.state&&"closed"==e.__previousState&&e.__create(),e.__previousState=t.state}),e.__instance._on("options."+e.__namespace,function(){e.__optionsFormat()}),e.__instance._on("reposition."+e.__namespace,function(t){e.__reposition(t.event,t.helper)})},__close:function(){this.__instance.content()instanceof w&&this.__instance.content().detach(),this.__instance._$tooltip.remove(),this.__instance._$tooltip=null},__create:function(){var t=w('');this.__options.arrow||t.find(".tooltipster-box").css("margin",0).end().find(".tooltipster-arrow").hide(),this.__options.minWidth&&t.css("min-width",this.__options.minWidth+"px"),this.__options.maxWidth&&t.css("max-width",this.__options.maxWidth+"px"),this.__instance._$tooltip=t,this.__instance._trigger("created")},__destroy:function(){this.__instance._off("."+self.__namespace)},__optionsFormat:function(){var t=this;t.__options=t.__instance._optionsExtract(a,t.__defaults()),t.__options.position&&(t.__options.side=t.__options.position),"object"!=_typeof(t.__options.distance)&&(t.__options.distance=[t.__options.distance]),t.__options.distance.length<4&&(void 0===t.__options.distance[1]&&(t.__options.distance[1]=t.__options.distance[0]),void 0===t.__options.distance[2]&&(t.__options.distance[2]=t.__options.distance[0]),void 0===t.__options.distance[3])&&(t.__options.distance[3]=t.__options.distance[1]),t.__options.distance={top:t.__options.distance[0],right:t.__options.distance[1],bottom:t.__options.distance[2],left:t.__options.distance[3]},"string"==typeof t.__options.side&&(t.__options.side=[t.__options.side,{top:"bottom",right:"left",bottom:"top",left:"right"}[t.__options.side]],"left"==t.__options.side[0]||"right"==t.__options.side[0]?t.__options.side.push("top","bottom"):t.__options.side.push("right","left")),6===w.tooltipster._env.IE&&!0!==t.__options.arrow&&(t.__options.arrow=!1)},__reposition:function(l,c){var e,d=this,u=d.__targetFind(c),p=[],n=(d.__instance._$tooltip.detach(),d.__instance._$tooltip.clone()),h=w.tooltipster._getRuler(n),f=!1;switch((a=d.__instance.option("animation"))&&n.removeClass("tooltipster-"+a),w.each(["window","document"],function(t,o){var r=null;if(d.__instance._trigger({container:o,helper:c,satisfied:f,takeTest:function(t){r=t},results:p,type:"positionTest"}),1==r||0!=r&&0==f&&("window"!=o||d.__options.viewportAware))for(t=0;t=n.outerSize.width&&c.geo.available[o][s].height>=n.outerSize.height?n.fits=!0:n.fits=!1:n.fits=a.fits,"window"==o&&(n.whole=!!n.fits&&("top"==s||"bottom"==s?c.geo.origin.windowOffset.right>=d.__options.minIntersection&&c.geo.window.size.width-c.geo.origin.windowOffset.left>=d.__options.minIntersection:c.geo.origin.windowOffset.bottom>=d.__options.minIntersection&&c.geo.window.size.height-c.geo.origin.windowOffset.top>=d.__options.minIntersection)),p.push(n),n.whole)f=!0;else if("natural"==n.mode&&(n.fits||n.size.width<=c.geo.available[o][s].width))return!1}})}}),d.__instance._trigger({edit:function(t){p=t},event:l,helper:c,results:p,type:"positionTested"}),p.sort(function(t,e){var n,a;return t.whole&&!e.whole?-1:!t.whole&&e.whole?1:t.whole&&e.whole?(n=d.__options.side.indexOf(t.side))<(a=d.__options.side.indexOf(e.side))||!(ac.geo.window.size.width-e.size.width&&(c.geo.origin.windowOffset.left+this.__options.minIntersection<=c.geo.window.size.width?e.coord.left=c.geo.window.size.width-e.size.width:e.coord.left=c.geo.origin.windowOffset.left+this.__options.minIntersection+1-e.size.width):e.coord.top<0?0<=c.geo.origin.windowOffset.bottom-this.__options.minIntersection?e.coord.top=0:e.coord.top=c.geo.origin.windowOffset.bottom-this.__options.minIntersection-1:e.coord.top>c.geo.window.size.height-e.size.height&&(c.geo.origin.windowOffset.top+this.__options.minIntersection<=c.geo.window.size.height?e.coord.top=c.geo.window.size.height-e.size.height:e.coord.top=c.geo.origin.windowOffset.top+this.__options.minIntersection+1-e.size.height):(e.coord.left>c.geo.window.size.width-e.size.width&&(e.coord.left=c.geo.window.size.width-e.size.width),e.coord.left<0&&(e.coord.left=0)),d.__sideChange(n,e.side),c.tooltipClone=n[0],c.tooltipParent=d.__instance.option("parent").parent[0],c.mode=e.mode,c.whole=e.whole,c.origin=d.__instance._$origin[0],c.tooltip=d.__instance._$tooltip[0],delete e.container,delete e.fits,delete e.mode,delete e.outerSize,delete e.whole,e.distance=e.distance.horizontal||e.distance.vertical;var t,a=w.extend(!0,{},e);d.__instance._trigger({edit:function(t){e=t},event:l,helper:c,position:a,type:"position"}),d.__options.functionPosition&&(a=d.__options.functionPosition.call(d,d.__instance,c,a))&&(e=a),h.destroy(),a="top"==e.side||"bottom"==e.side?(t={prop:"left",val:e.target-e.coord.left},e.size.width-this.__options.minIntersection):(t={prop:"top",val:e.target-e.coord.top},e.size.height-this.__options.minIntersection),t.vala&&(t.val=a),a=c.geo.origin.fixedLineage?c.geo.origin.windowOffset:{left:c.geo.origin.windowOffset.left+c.geo.window.scroll.left,top:c.geo.origin.windowOffset.top+c.geo.window.scroll.top},e.coord={left:a.left+(e.coord.left-c.geo.origin.windowOffset.left),top:a.top+(e.coord.top-c.geo.origin.windowOffset.top)},d.__sideChange(d.__instance._$tooltip,e.side),c.geo.origin.fixedLineage?d.__instance._$tooltip.css("position","fixed"):d.__instance._$tooltip.css("position",""),d.__instance._$tooltip.css({left:e.coord.left,top:e.coord.top,height:e.size.height,width:e.size.width}).find(".tooltipster-arrow").css({left:"",top:""}).css(t.prop,t.val),d.__instance._$tooltip.appendTo(d.__instance.option("parent")),d.__instance._trigger({type:"repositioned",event:l,position:e})},__sideChange:function(t,e){t.removeClass("tooltipster-bottom").removeClass("tooltipster-left").removeClass("tooltipster-right").removeClass("tooltipster-top").addClass("tooltipster-"+e)},__targetFind:function(t){var e={},n=this.__instance._$origin[0].getClientRects();return 1t.options.ticks.maxTicksLimit?(n=t.max-t.min,e=t.options.ticks.maxTicksLimit||1e3,n=Math.ceil(n/e),t.options.ticks.stepSize=Math.max(1,n)):(!t.options.ticks.stepSize||t.options.ticks.stepSize<1)&&(t.options.ticks.stepSize=1)}function I(t){var e,n=t.canvas.parentNode.querySelector("div");return n||((n=document.createElement("div")).classList.add("wps-chart-tooltip"),n.style.opacity=1,n.style.pointerEvents="none",n.style.position="absolute",n.style.transition="all .1s ease",(e=document.createElement("table")).style.margin="0px",n.appendChild(e),t.canvas.parentNode.appendChild(n)),n}function B(t,a,o,r,i,s,l){var e,c,d,u,n,p,h=t.chart,f=(f=t).tooltip,_=h.options.plugins.tooltip.unitTime;t=I(h),0===f.opacity?t.style.opacity=0:f.body&&(e=f.title||[],c=f.dataPoints[0].dataIndex,d=h.data.datasets,u="",n=O.isset(O.global,"options","wp_date_format")?O.global.options.wp_date_format:"MM/DD/YYYY",p=(p=U(n)).replace(/\/YYYY|YYYY/g,"").replace(/,\s*$/,"").replace(/^\s*,/,"").trim(),e.forEach(function(t){var e,n;"day"===_?(e=(n=(a.data||a).labels[c]).date,n=n.day,u+='
'.concat(moment(e).format(p)," (").concat(n,")
")):u+='
'.concat(("month"===_?i:o)[c],"
")}),d.forEach(function(e,t){var n,t=h.getDatasetMeta(t),a=e.label.includes("(Previous)");t.hidden||a||(t=e.data[c],u+='
').concat(e.label,'
').concat(t.toLocaleString()," ")),(a=d.find(function(t){return t.label===e.label+" (Previous)"}))&&(t=h.getDatasetMeta(d.indexOf(a)),n=(n=document.querySelector(".wps-postbox-chart--previousPeriod"))&&n.classList.contains("wps-line-through"),t.hidden||n||(t=a.data[c]||0,a=null,void 0===(a="day"===_?(n=l&&l[c])?"".concat(moment(n.date).format(p)," (").concat(n.day,")"):r[c]||"N/A":("month"===_?s:r)[c])&&(a="N/A"),u+='
').concat(a,'
').concat(t.toLocaleString()," ")))}),u+="
",t.innerHTML=u,O.setTooltipPosition(t,h,f))}function l(r,i,s,l,c){if(!(r&&r.length&&i&&i.length))return console.error("Invalid input: labels or datasets are empty."),{aggregatedLabels:[],aggregatedData:i?i.map(function(){return[]}):[],monthTooltipTitle:[]};var e=[],n=moment();if("day"===s)return r.forEach(function(t){t=moment(t.date),e.push(t.isSameOrAfter(n,"day"))}),{aggregatedLabels:r.map(function(t){return t.formatted_date}),aggregatedData:i.map(function(t){return t.data}),monthTooltipTitle:[],isIncompletePeriod:e};var d=[],u=i.map(function(){return[]}),p=[],h={};if("week"===s){O._("start_of_week")&&moment.updateLocale("en",{week:{dow:parseInt(O._("start_of_week"))}});for(var t=moment(r[0].date),a=moment(r[r.length-1].date),f=[],o=t.clone();o.isSameOrBefore(a);){var _=o.clone().startOf("week").add(1,"week"),m=_.clone().subtract(1,"day");m.isAfter(a)&&(m=a.clone()),f.push({start:o.clone(),end:m,key:o.format("YYYY-[W]WW"),data:new Array(i.length).fill(0)}),o=_}r.forEach(function(t,a){if(t.date)for(var e=moment(t.date),o=0,r=f;o{var n=r[o];if(e.isBetween(n.start,n.end,"day","[]"))return i.forEach(function(t,e){n.data[e]+=t.data[a]||0}),1})();o++);}),f.forEach(function(t){var e=H(t.start,t.end,s,l,c);d.push(e),p.push(G(t.start,t.end,l)),t.data.forEach(function(t,e){u[e]||(u[e]=[]),u[e].push(t)})}),f.forEach(function(t){t=t.end.isSameOrAfter(moment(),"day"),e.push(t)})}else if("month"===s){for(var t=moment(r[0].date),g=moment(r[r.length-1].date),y=t.clone();y.isSameOrBefore(g,"month");){var v=y.format("YYYY-MM");h[v]||(h[v]={startDate:y.clone().startOf("month"),endDate:y.clone().endOf("month"),indices:[]}),y.add(1,"month")}r.forEach(function(t,e){t.date&&(t=moment(t.date).format("YYYY-MM"),h[t])&&h[t].indices.push(e)}),Object.keys(h).forEach(function(t){var e=h[t],n=e.startDate,a=e.endDate,o=e.indices,e=moment.max(n,moment(r[0].date)),n=moment.min(a,moment(r[r.length-1].date));e.isValid()&&n.isValid()?0'.concat(O.placeholder_content("picture"),"").concat(O.placeholder_content("line"),"
")+(!1!==t?t:"")+""},O.line_placeholder=function(){for(var t=0',n=0;n ';return e+""},O.rectangle_placeholder=function(){var t=0'.concat(O.placeholder_content("picture"),"
")},O.placeholder_content=function(){var t="";switch(0';break;case"line":t='';break;case"circle":t='
'}return t},O.exist_tag=function(t){return jQuery(t).length},O.loading_button=function(t){t.classList.add("wps-loading-button")},O.date_picker=function(){var t=jQuery("input[data-wps-date-picker]");t.length&&(t.daterangepicker({singleDatePicker:!0,showDropdowns:!0,minYear:1998,drops:"up",opens:document.getElementById("TB_window")?"center":"right",maxYear:parseInt((new Date).getFullYear()+1),locale:{format:"YYYY-MM-DD"}}),t.on("show.daterangepicker",function(t,e){e=e.container,jQuery(e).addClass(t.target.className)}))},O.formatNumber=function(t){var e=1').concat(O._("visitors"),"
").concat(e.visitors,"
")})),jQuery("#wp-statistics-visitors-map").vectorMap({map:"world_en",backgroundColor:"#fff",borderColor:"#fff",borderOpacity:.6,color:"#e6e6e6",selectedColor:"#596773",hoverColor:"#596773",colors:l,onLabelShow:function(t,e,n){var a,o;n=n.toLowerCase(),s[n]?e.html(s[n]):(a=O.global.assets_url+"/images/flags/".concat(n,".svg"),o=e.text(),fetch(a).then(function(t){t=t.ok?" "):"",e.html("').concat(O._("visitors"),"
0
"))}).catch(function(t){console.error("Error fetching the image:",t),e.html("').concat(O._("visitors"),"
0
"))}))}})},O.select2=function(){jQuery("select[data-type-show=select2]").select2()},jQuery(".wps-select2")),n=jQuery("body"),R=jQuery(".wps-dropdown"),Y=(e.length&&(b=jQuery(".wps-filter-page"),t=jQuery(".wps-filter-visitor"),N=n.hasClass("rtl")?"rtl":"ltr",n=b.length?b:t,r=function(t,n){e.select2({dropdownParent:t,dir:N,dropdownAutoWidth:!0,dropdownCssClass:"wps-select2-filter-dropdown",minimumInputLength:1,ajax:{delay:500,url:O.global.ajax_url,dataType:"json",data:function(t){var e,t={wps_nonce:O.global.rest_api_nonce,search:t.term,action:n,paged:t.page||1};return O.isset(O.global,"request_params")&&((e=O.global.request_params).author_id&&(t.author_id=e.author_id),e.page&&(t.page=e.page),e.pt&&(t.post_type=e.pt),e.pid)&&(t.post_id=e.pid),t},processResults:function(t){return t&&Array.isArray(t.results)?{results:t.results.map(function(t){return{id:t.id,text:t.text}}),pagination:{more:!1}}:(console.error("Expected an array of results but got:",t),{results:[]})},error:function(t,e,n){console.error("AJAX request error:",e,n)}}})},e.select2({dropdownParent:n,dir:N,dropdownAutoWidth:!0,dropdownCssClass:"wps-select2-filter-dropdown"}),e.on("select2:open",function(){return R.addClass("active")}),e.on("select2:close",function(){return R.removeClass("active")}),e.on("change",function(){var t=jQuery(this).find("option:selected").val();t&&(window.location.href=t)}),b.length&&(r(b,"wp_statistics_get_page_filter_items"),b.on("click",function(){return e.select2("open")})),t.length)&&(r(t,"wp_statistics_search_visitors"),t.on("click",function(){return e.select2("open")})),O.tooltip=function(){jQuery(".wps-tooltip").tooltipster({theme:"tooltipster-shadow",contentCloning:!0}),jQuery("body").on("mouseenter touchstart",".wps-tooltip:not(.tooltipstered)",function(){k(this).tooltipster({theme:"tooltipster-shadow"}).tooltipster("open")})},O.tooltip(),O.redirect=function(t){window.location.replace(t)},O.horizontal_bar=function(t,e,n,a){var o=4').concat(O.formatNumber(n[c]),"").concat(u,"% "),_.classList.add("wps-horizontal-bar__data"),h.appendChild(_),p.appendChild(h),(_=document.createElement("div")).classList.add("wps-horizontal-bar__background"),_.style.width=d+"%",p.appendChild(_),l.appendChild(p)}s?i.insertBefore(l,s):i.appendChild(l)}},window.renderHorizontalBar=function(t,e,n,a){O.horizontal_bar(t,e,n,a,4')},O.isIP=function(t){var e="(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)";return new RegExp("^".concat(e,"\\.").concat(e,"\\.").concat(e,"\\.").concat(e,"$")).test(t)},O.getLinkParams=function(t){var e=1'+O._("no_result")+""},O.isTodayOrFutureDate=function(t){var e;return!!t&&(e=new Date,new Date(t)>=new Date(e.getFullYear(),e.getMonth(),e.getDate()))},O.placeholder_txt=function(t){var e=Math.floor(4*Math.random())+1,e=O.global.assets_url+"/images/no-data/vector-".concat(e,".svg");return'').concat(t,"
")},O.allValuesZero=function(t){return!t||0===t.length||t.every(function(t){return 0===t||null==t||"0"===t})},O.allDatasetsZero=function(t){var e=1o+r&&(i=o+r-l-16),t.style.opacity=1,t.style.left=c+"px",t.style.top=i+"px"},{id:"drawVerticalLine",beforeDatasetDraw:function(t){var e=t,t=e.ctx,n=(_objectDestructuringEmpty(e.scales),e.tooltip),e=e.chartArea,a=e.top,e=e.bottom;n&&n._active&&n._active.length&&(n=n._active[0].element.x,t.beginPath(),t.strokeStyle="#A9AAAE",t.lineWidth=1,t.setLineDash([6,6]),t.moveTo(n,a),t.lineTo(n,e),t.stroke(),t.setLineDash([]))}}),U=function(t){var e={d:"DD",j:"D",S:"Do",n:"M",m:"MM",F:"MMM",M:"MMM",y:"YY",Y:"YYYY"};return t.replace(/([a-zA-Z])/g,function(t){return e[t]||t})},H=function(t,e,n,a,o){return a=a.replace(/\/YYYY|YYYY/g,"").replace(/\/YY|YY/g,"").replace(/[,/\s-]/g," ").trim().replace(/MM|MMM/g,"MMM").replace(/DD|D/g,"D").trim(),"month"===n?(n=a.replace(/\s*D/g,"").replace(/YYYY|YY/g,"").replace(/\/YY|YY/g,"").trim(),moment(t).format(n)):moment(t).format(a)+" to "+moment(e).format(a)},G=function(t,e,n){return n=n.replace(/,?\s?(YYYY|YY)[-/\s]?,?|[-/\s]?(YYYY|YY)[-/\s]?,?/g,""),moment(t).format(n)+" to "+moment(e).format(n)},c={};function s(t){if(this.container=document.querySelector(t),!this.container)throw new Error("Container ".concat(t," not found"))}function a(t){this.settings=_objectSpread({modalSelector:"#wps-modal-filter",formSelector:"#wp_statistics_visitors_filter_form",resetSelector:".wps-modal-reset-filter",filterWrapperSelector:".wps-modal-filter-form",filterContainerSelector:".filter-select, .filter-input",width:430,height:510,onSubmit:null,onOpen:null,onLoadFilter:null,fields:{}},t),this.formSelector=this.settings.formSelector,this.memoryCache=null,this.filterWrapperSelector=this.settings.filterWrapperSelector,this.filterContainerSelector=this.settings.filterContainerSelector,this.onlySearchableFields=!1,this.fieldTypes=Object.fromEntries(Object.entries(this.settings.fields).map(function(t){var t=_slicedToArray(t,2),e=t[0],t=t[1];return t.name&&"page"!==t.name?[t.name,{type:t.type,key:e}]:null}).filter(Boolean)),this.fieldTypes=Object.keys(this.fieldTypes),this.initModal()}function o(t){this.settings=_objectSpread({fields:{}},t),this.sourceCache={},this.memoryCache=null,this.predefinedCache={},this.init()}O.new_line_chart=function(f,_){var t=2 ').concat(e.toLocaleString(),""):"",r.innerHTML="".concat(n.label,' ').concat(t.toLocaleString(),"
").concat(i,"
"),(s=r.querySelector(".current-data")).addEventListener("click",function(){var t=c.getDatasetMeta(a);t.hidden=!t.hidden,s.classList.toggle("wps-line-through"),c.update()}),(l=r.querySelector(".previous-data"))&&null!==o&&l.addEventListener("click",function(){var t=c.data.datasets.find(function(t,e){return t.label===d[a].label+" (Previous)"&&c.getDatasetMeta(e)});t&&(t=c.data.datasets.indexOf(t),(t=c.getDatasetMeta(t)).hidden=!t.hidden,l.classList.toggle("wps-line-through"),t=h.querySelectorAll(".previous-data"),t=Array.from(t).every(function(t){return t.classList.contains("wps-line-through")}),p&&(t?p.classList.add("wps-line-through"):p.classList.remove("wps-line-through")),c.update())}),h.appendChild(r))})),L.update()}e=document.getElementById(_).getContext("2d"),Object.keys(f.data.datasets).forEach(function(t,e){var n,a=Y[f.data.datasets[t].slug]||Y["Other"+(f.data.datasets[t].originalIndex+1)],o=P[e%P.length];e={type:n="performance"===m&&2===e?"bar":"line",label:f.data.datasets[t].label,data:f.data.datasets[t].data,backgroundColor:a,hoverBackgroundColor:a,hoverPointBackgroundColor:a,yAxisID:"bar"==n||"Clicks"===f.data.datasets[t].label?"y1":"y"},"line"==n&&(e.borderColor=a,e.fill=!1,e.borderWidth=2,e.pointRadius=0,e.pointBorderColor="transparent",e.pointBackgroundColor=a,e.pointBorderWidth=2,e.hoverPointRadius=6,e.hoverPointBorderColor="#fff",e.hoverPointBorderWidth=4,e.tension=o,e.hitRadius=10),r.push(e)}),null!=f&&f.previousData&&Object.keys(f.previousData.datasets).forEach(function(e,t){var n=(null==(n=f.data.datasets.find(function(t){return t.label===f.previousData.datasets[e].label}))?void 0:n.slug)||f.previousData.datasets[e].slug||"Other"+(t+1),n=Y[n]||Y["Other"+(t+1)],t=P[t%P.length];r.push({type:"line",label:f.previousData.datasets[e].label+" (Previous)",data:f.previousData.datasets[e].data,borderColor:O.hex_to_rgba(n,.7),hoverBorderColor:n,backgroundColor:n,fill:!1,yAxisID:"Clicks"===f.previousData.datasets[e].label?"y1":"y",borderWidth:1,borderDash:[5,5],pointRadius:0,pointBorderColor:"transparent",pointBackgroundColor:n,pointBorderWidth:2,hoverPointRadius:6,hoverPointBorderColor:"#fff",hoverPointBackgroundColor:n,hoverPointBorderWidth:4,tension:t,hitRadius:10})}),n={maintainAspectRatio:!1,resizeDelay:200,animation:{duration:0},responsive:!0,interaction:{intersect:!1,mode:"index"},plugins:{legend:!1,tooltip:{enabled:!1,external:function(t){return B(t,g,j,M,D,T,g.previousData?g.previousData.labels:[])},unitTime:a}},scales:{x:{offset:o,grid:{display:!1,drawBorder:!1,tickLength:0,drawTicks:!1},border:{color:"transparent",width:0},ticks:{align:"inner",autoSkip:!0,maxTicksLimit:y?"week"===a?2:4:"week"===a?3:"month"===a?7:9,font:{color:"#898A8E",style:"italic",weight:"lighter",size:y?"week"===a?9:11:"week"===a?11:13},padding:8}},y:{min:0,suggestedMax:4,ticks:{autoSkip:!0,maxTicksLimit:y?4:7,fontColor:"#898A8E",fontSize:13,fontStyle:"italic",fontWeight:"lighter",padding:8,lineHeight:15,callback:renderFormatNum},afterBuildTicks:Q,border:{color:"transparent",width:0},type:"linear",position:"right",grid:{display:!0,tickMarkLength:0,drawBorder:!1,tickColor:"#EEEFF1",color:"#EEEFF1"},gridLines:{drawTicks:!1},title:{display:!1}}}},"performance"===m&&2 element provided.");a&&((t=document.createElement("option")).value=o||"",t.textContent=a,t.selected=!0,n.appendChild(t)),0').concat(t.label||"Post Type",': ').concat(o?this.getFilterName(e,s):s,' ",n.innerHTML=l,t.searchable&&this.enableSearchableDropdown()):console.warn("Container ".concat(t.containerSelector," not found.")):console.warn("Invalid filter configuration provided for dropdown.")},s.prototype.getFilterName=function(t,e){var n=t,a=n.selectedOption;return(t=n.args.find(function(t){return t.slug===a}))?t.name:e},s.prototype.enableSearchableDropdown=function(){document.querySelectorAll(".wps-search-dropdown").forEach(function(t){t.addEventListener("click",function(t){t.stopPropagation()}),t.addEventListener("input",function(){var n=this.value.toLowerCase();this.parentElement.querySelectorAll("a[role='option']").forEach(function(t){var e=t.textContent.toLowerCase();t.style.display=e.includes(n)?"block":"none"})})})},a.prototype.initModal=function(){var t,e,n=document.querySelector("#wps-modal-filter-popup");n||((n=document.createElement("div")).id="wps-modal-filter-popup",n.style.display="none",n.setAttribute("dir",document.documentElement.dir||"ltr"),(t=document.createElement("form")).id=this.settings.formSelector.replace("#",""),t.method="get",t.action=O.global.admin_url+"admin.php",(e=document.createElement("div")).id=this.settings.filterWrapperSelector.replace("#",""),e.className="wps-modal-filter-form",t.appendChild(e),n.appendChild(t),document.body.appendChild(n)),this.init()},a.prototype.bindOnLoadFilter=function(){var t=this;jQuery(document).ready(function(){"function"==typeof t.settings.onLoadFilter?t.settings.onLoadFilter(t.filterWrapperSelector):t.generateFields()})},a.prototype.init=function(){var t=this;jQuery(document).on("click",this.settings.modalSelector,this.onFilterButtonClick.bind(this)),jQuery(document).on("submit",this.settings.formSelector,this.onFormSubmit.bind(this)),jQuery(document).on("click",this.settings.resetSelector,this.onResetFilterClick.bind(this)),this.bindOnLoadFilter(),jQuery(document).on("tb_unload",function(){t.cleanup()})},a.prototype.initializeSelect2Elements=function(t){t.each(function(t,e){function o(n){return new Promise(function(t){var e=new Image;e.onload=function(){return t(!0)},e.onerror=function(){return t(!1)},e.src=n})}function n(){r.hasClass("select2-hidden-accessible")&&r.select2("destroy"),s?r.select2({escapeMarkup:function(t){return t},templateResult:function(t){var e,n;return!t.id||t.loading?t.text:(e=t.id.toLowerCase().replace(/ /g,"_"),n=jQuery(' ').concat(t.text," ")),l(e).then(function(t){n.find("img").attr("src",t)}),n)},templateSelection:function(t){var e,n;return t.id?(e=t.id.toLowerCase().replace(/ /g,"_"),n=jQuery(' ').concat(t.text," ")),l(e).then(function(t){n.find("img").attr("src",t)}),n):t.text}}):r.select2(),r.find("option").length,r.trigger("change")}var a,r=jQuery(e),i=r.attr("name"),s=i?"agent"===(e=i.toLowerCase())?"browser":"platform"===e?"operating-system":"location"===e?"flags":null:null,l=(()=>{var e=_asyncToGenerator(_regeneratorRuntime().mark(function t(e){var n,a;return _regeneratorRuntime().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e&&s?(n="".concat(O.global.assets_url,"/images/").concat(s,"/")+e,a=O.global.assets_url+"/images/flags/000.svg","all"!==e?t.next=7:(t.t1=a,t.next=24)):t.next=27;break;case 7:return e=n+".svg",t.next=10,o(e);case 10:t.sent?(t.t2=e,t.next=23):t.next=14;break;case 14:return e=n+".png",t.next=17,o(e);case 17:t.sent?(t.t3=e,t.next=22):t.next=21;break;case 21:t.t3=a;case 22:t.t2=t.t3;case 23:t.t1=t.t2;case 24:t.t0=t.t1,t.next=28;break;case 27:t.t0=O.global.assets_url+"/images/flags/000.svg";case 28:return t.abrupt("return",t.t0);case 29:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})();s&&(0=a&&clearInterval(r)},3'),!0;this.settings.onSubmit(t)},a.prototype.onResetFilterClick=function(t){var e;t.preventDefault(),this.setLoading("reset"),"function"==typeof this.settings.onReset?this.settings.onReset():(e=new URL(window.location.href),this.fieldTypes.forEach(function(t){"tab"!==t&&e.searchParams.delete(t)}),window.location.href=e.toString(),this.toggleResetButton())},a.prototype.toggleResetButton=function(){var e,t=jQuery(this.settings.resetSelector);t.length&&(e=new URLSearchParams(window.location.search),this.fieldTypes.some(function(t){return e.has(t)&&""!==e.get(t).trim()})?t.removeAttr("disabled"):t.attr("disabled","disabled"))},a.prototype.setLoading=function(){("reset"===(0=i.length||(setTimeout(function(){at()},100),e=i[t],i.forEach(function(t){return t.classList.remove("wps-modal__premium-step--active")}),e&&"undefined"!==e&&(n=e.querySelector(".js-wps-premium-step__title"),nt&&n&&(nt.textContent=n.textContent.trim()),e.classList.add("wps-modal__premium-step--active")),u&&0_createClass(function t(){_classCallCheck(this,t),this.init()},[{key:"init",value:function(){var n=this;document.addEventListener("click",function(t){var e=t.target.closest('[class*="js-openModal-"]');(e=e&&n.extractModalIdFromClass(e.classList))&&n.openModal(e),(e=t.target.closest("button[data-action]"))&&(t=e.getAttribute("data-action"))&&(e=e.closest(".wps-modal"),n.handleModalAction(e,t))}),this.attachOpenEvent(),this.attachCloseEvent()}},{key:"attachOpenEvent",value:function(){var e=this;document.addEventListener("click",function(t){(t=(t=t.target.closest('[class*="js-openModal-"]'))&&e.extractModalIdFromClass(t.classList))&&e.openModal(t)})}},{key:"extractModalIdFromClass",value:function(t){var e,n=_createForOfIteratorHelper(t);try{for(n.s();!(e=n.n()).done;){var a=e.value;if(a.startsWith("js-openModal-"))return a.replace("js-openModal-","").toLowerCase()}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"openModal",value:function(t){var e=document.getElementById(t);e?e.classList.add("wps-modal--open"):console.error('Modal with ID "'.concat(t,'" not found.'))}},{key:"attachCloseEvent",value:function(){document.addEventListener("click",function(t){(t=(t=t.target.closest(".wps-modal__close"))&&t.closest(".wps-modal"))&&t.classList.remove("wps-modal--open")})}},{key:"handleModalAction",value:function(t,e){switch(e){case"resolve":break;case"closeModal":this.closeModal(t);break;default:console.warn("Unknown action:",e)}}},{key:"closeModal",value:function(t){t.classList.remove("wps-modal--open")}}]))()),jQuery(document).ready(function(){function n(){var t=document.querySelector(".wps-notification-sidebar__tab--active");t&&("tab-2"===t.dataset.tab?d&&(d.style.display="none"):(t=0'),jQuery(this.container).append(this.spinnerElement)),this.spinnerElement.show()},lt.prototype.hide=function(){this.spinnerElement&&this.spinnerElement.hide()};var ct,dt,ut,pt,ht,ft,_t,f,_,mt,gt,m,yt,vt,wt,g,y,bt,xt,kt,Ct,Et,St,v,w,b=document.querySelector(".wps-admin-column__unlock"),r=document.querySelector(".wp-list-table"),n=(b&&r&&r.classList.add("wps-admin-mini-chart__unlock"),O.TrafficHourCharts=function(_){var e,t=document.getElementById("hourly-usage-chart").getContext("2d"),m={Views:"#7362BF",Visitors:"#3288D7"},o=[],n=(Object.keys(_.data.datasets).forEach(function(t,e){var n=m[_.data.datasets[t].label];o.push({type:"bar",label:_.data.datasets[t].label,data:_.data.datasets[t].data,backgroundColor:O.hex_to_rgba(n,.5),fill:!1,yAxisID:"y",hitRadius:10})}),null!=_&&_.previousData&&Object.keys(_.previousData.datasets).forEach(function(t,e){var n,a=_.previousData.datasets[t].label;o.push({type:"bar",label:_.previousData.datasets[t].label+" (Previous)",data:_.previousData.datasets[t].data,backgroundColor:(t=O.hex_to_rgba(m[a],.5),n=(a=document.createElement("canvas")).getContext("2d"),a.width=5,a.height=5,n.fillStyle=t,n.fillRect(0,0,a.width,a.height),n.strokeStyle="white",n.lineWidth=2,n.beginPath(),n.moveTo(a.width,0),n.lineTo(0,a.height),n.stroke(),n.createPattern(a,"repeat")),fill:!1,yAxisID:"y",pointRadius:0,hitRadius:10})}),{maintainAspectRatio:!1,resizeDelay:200,animation:{duration:0},responsive:!0,interaction:{intersect:!1,mode:"index"},plugins:{legend:!1,tooltip:{enabled:!1,external:function(t){return e=m,n=_,f=(h=t=t).chart,h=h.tooltip,t=I(f),void(0===h.opacity?t.style.opacity=0:h.body&&(o=h.dataPoints[0].dataIndex,r=f.data.datasets,i="",a=r.filter(function(t){return!t.label.includes("(Previous)")}),s=r.filter(function(t){return t.label.includes("(Previous)")}),u=(new Date).getHours(),d=n.data.labels[o].hour,l=parseInt(d.match(/\d+/)[0]),d=d.includes("PM"),d=12===l?d?12:0:d?l+12:l,l=a.some(function(t){return 0'.concat(u,"
"),d&&(l||!l&&!c)&&a.forEach(function(t){var e;f.getDatasetMeta(r.indexOf(t)).hidden||(e=t.data[o],i+=' ').concat(t.label,'
').concat(e.toLocaleString()," "))}),d&&!c||(p=Object.values(e),s.forEach(function(t,e){var n=f.getDatasetMeta(r.indexOf(t)),a=t.label.replace(" (Previous)","");n.hidden||(n=t.data[o],i+=' ').concat(a,'
').concat(n.toLocaleString()," "))})),i+="",t.innerHTML=i,O.setTooltipPosition(t,f,h)));var e,n,o,r,i,a,s,l,c,d,u,p,h,f},callbacks:{title:function(t){return t[0].label},label:function(t){return t.formattedValue}}}},scales:{x:{offset:!0,grid:{display:!1,drawBorder:!1,tickLength:0,drawTicks:!1},border:{color:"transparent",width:0},ticks:{align:"inner",autoSkip:!1,maxRotation:90,minRotation:90,callback:function(t,e){return" "+this.getLabelForValue(t)},font:{color:"#898A8E",style:"italic",size:window.innerWidth<768?8:13},padding:window.innerWidth<768?3:8}},y:{min:0,ticks:{maxTicksLimit:7,font:{color:"#898A8E",style:"italic",size:window.innerWidth<768?8:13},padding:window.innerWidth<768?2:8,lineHeight:window.innerWidth<768?10:15,stepSize:1,callback:renderFormatNum},border:{color:"transparent",width:0},type:"linear",position:"right",grid:{display:!0,tickMarkLength:0,drawBorder:!1,tickColor:"#EEEFF1",color:"#EEEFF1"},gridLines:{drawTicks:!1},title:{display:!1}}}}),a=_.data.labels.map(function(t){return t.hour}),r=new Chart(t,{type:"bar",data:{labels:a,datasets:o},options:n}),i=document.getElementById("hourly-usage-chart").parentElement.parentElement.querySelector(".wps-postbox-chart--items");i&&(i.innerHTML="",o.sort(function(t,e){return"Total"===t.label?-1:"Total"===e.label?1:"Total (Previous)"===t.label?-1:"Total (Previous)"===e.label?1:0}),0<(t=document.querySelectorAll(".wps-postbox-chart--previousPeriod")).length&&(e=!1,o.forEach(function(t){t.label.includes("(Previous)")&&(e=!0)}),e)&&t.forEach(function(t){t.style.display="flex"}),o.forEach(function(t,e){var n,a;t.label.includes("(Previous)")||(t.data.reduce(function(t,e){return Number(t)+Number(e)},0),(n=document.createElement("div")).className="wps-postbox-chart--item",n.innerHTML=' ').concat(t.label," "),(a=n.querySelector(".current-data")).addEventListener("click",function(){var t=r.getDatasetMeta(e);t.hidden=!t.hidden,a.classList.toggle("wps-line-through"),r.update()}),i.appendChild(n))}))},window.renderTrafficHourChart=function(t){O.TrafficHourCharts(t)},O.sanitize_meta_box_name=function(t){return t.replace(new RegExp("-","g"),"_")},O.get_meta_box_method=function(t){return this.sanitize_meta_box_name(t)+"_meta_box"},O.getMetaBoxKey=function(t){return"wp-statistics-"+t+"-widget"},O.no_meta_box_data=function(){return''+O._("no_data")+"
"},O.error_meta_box_data=function(t){if(void 0!==t)try{var e=JSON.parse(t);if(O.isset(e,"message"))return''+e.message+"
"}catch(e){console.log("An unexpected error occurred: ",t,e)}return''+O._("rest_connect")+"
"},O.get_meta_box_info=function(t){return t in O.global.meta_boxes?O.global.meta_boxes[t]:[]},O.meta_box_lang=function(t,e){return e in O.global.meta_boxes[t].lang?O.global.meta_boxes[t].lang[e]:""},O.meta_box_inner=function(t){return"#"+O.getMetaBoxKey(t)+" div.inside"},O.meta_box_name_by_id=function(t){return t.split("statistics-").pop().split("-widget")[0]},O.meta_box_button=function(t){var e="#"+O.getMetaBoxKey(t)+" .handle-actions button:first",n=(O.get_meta_box_info(t),"right");O.is_active("rtl")&&(n="left"),jQuery("#"+O.getMetaBoxKey(t)+" button[class*=wps-refresh]").remove(),jQuery(' ').insertBefore(e),O.is_active("gutenberg")&&jQuery("body").addClass("wps-gutenberg"),jQuery("#"+O.getMetaBoxKey(t)+" .hndle, #"+O.getMetaBoxKey(t)+" .handlediv").on("click",function(){jQuery(this).closest(".postbox").addClass("handle")})},O.meta_box_tooltip=function(t){var e,n="#"+O.getMetaBoxKey(t)+" h2.hndle";(t=O.get_meta_box_info(t)).hasOwnProperty("description")&&(jQuery(n).text(),e=' ',t)&&jQuery(n).append(e)},O.run_meta_box=function(t){var e,n,a=1