HEX
Server: Apache/2.4.62 (Debian)
System: Linux plxsite 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64
User: root (0)
PHP: 8.1.30
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/post-views-counter/js/admin-theme.js
const t=(t,e=0,n=1)=>t>n?n:t<e?e:t,e=(t,e=0,n=Math.pow(10,e))=>Math.round(n*t)/n,n=t=>("#"===t[0]&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:4===t.length?e(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:8===t.length?e(parseInt(t.substring(6,8),16)/255,2):1}),r=t=>{const{h:n,s:r,l:o}=(({h:t,s:n,v:r,a:o})=>{const a=(200-n)*r/100;return{h:e(t),s:e(a>0&&a<200?n*r/100/(a<=100?a:200-a)*100:0),l:e(a/2),a:e(o,2)}})(t);return`hsl(${n}, ${r}%, ${o}%)`},o=({h:t,s:n,v:r,a:o})=>{t=t/360*6,n/=100,r/=100;const a=Math.floor(t),i=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:e(255*[r,s,i,i,c,r][l]),g:e(255*[c,r,r,s,i,i][l]),b:e(255*[i,i,c,r,r,s][l]),a:e(o,2)}},a=t=>{const e=t.toString(16);return e.length<2?"0"+e:e},i=({r:t,g:n,b:r,a:o})=>{const i=o<1?a(e(255*o)):"";return"#"+a(t)+a(n)+a(r)+i},s=({r:t,g:n,b:r,a:o})=>{const a=Math.max(t,n,r),i=a-Math.min(t,n,r),s=i?a===t?(n-r)/i:a===n?2+(r-t)/i:4+(t-n)/i:0;return{h:e(60*(s<0?s+6:s)),s:e(a?i/a*100:0),v:e(a/255*100),a:o}},c=(t,e)=>{if(t===e)return!0;for(const n in t)if(t[n]!==e[n])return!1;return!0},l={},u=t=>{let e=l[t];return e||(e=document.createElement("template"),e.innerHTML=t,l[t]=e),e},d=(t,e,n)=>{t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:n}))};let h=!1;const f=t=>"touches"in t,v=(e,n)=>{const r=f(n)?n.touches[0]:n,o=e.el.getBoundingClientRect();d(e.el,"move",e.getMove({x:t((r.pageX-(o.left+window.pageXOffset))/o.width),y:t((r.pageY-(o.top+window.pageYOffset))/o.height)}))};class p{constructor(t,e,n,r){const o=u(`<div role="slider" tabindex="0" part="${e}" ${n}><div part="${e}-pointer"></div></div>`);t.appendChild(o.content.cloneNode(!0));const a=t.querySelector(`[part=${e}]`);a.addEventListener("mousedown",this),a.addEventListener("touchstart",this),a.addEventListener("keydown",this),this.el=a,this.xy=r,this.nodes=[a.firstChild,a]}set dragging(t){const e=t?document.addEventListener:document.removeEventListener;e(h?"touchmove":"mousemove",this),e(h?"touchend":"mouseup",this)}handleEvent(t){switch(t.type){case"mousedown":case"touchstart":if(t.preventDefault(),!(t=>!(h&&!f(t)||(h||(h=f(t)),0)))(t)||!h&&0!=t.button)return;this.el.focus(),v(this,t),this.dragging=!0;break;case"mousemove":case"touchmove":t.preventDefault(),v(this,t);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":((t,e)=>{const n=e.keyCode;n>40||t.xy&&n<37||n<33||(e.preventDefault(),d(t.el,"move",t.getMove({x:39===n?.01:37===n?-.01:34===n?.05:33===n?-.05:35===n?1:36===n?-1:0,y:40===n?.01:38===n?-.01:0},!0)))})(this,t)}}style(t){t.forEach((t,e)=>{for(const n in t)this.nodes[e].style.setProperty(n,t[n])})}}class m extends p{constructor(t){super(t,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:t}){this.h=t,this.style([{left:t/360*100+"%",color:r({h:t,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${e(t)}`)}getMove(e,n){return{h:n?t(this.h+360*e.x,0,360):360*e.x}}}class b extends p{constructor(t){super(t,"saturation",'aria-label="Color"',!0)}update(t){this.hsva=t,this.style([{top:100-t.v+"%",left:`${t.s}%`,color:r(t)},{"background-color":r({h:t.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${e(t.s)}%, Brightness ${e(t.v)}%`)}getMove(e,n){return{s:n?t(this.hsva.s+100*e.x,0,100):100*e.x,v:n?t(this.hsva.v-100*e.y,0,100):Math.round(100-100*e.y)}}}const g=Symbol("same"),y=Symbol("color"),x=Symbol("hsva"),E=Symbol("update"),w=Symbol("parts"),L=Symbol("css"),A=Symbol("sliders");class S extends HTMLElement{static get observedAttributes(){return["color"]}get[L](){return[':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}',"[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}","[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}"]}get[A](){return[b,m]}get color(){return this[y]}set color(t){if(!this[g](t)){const e=this.colorModel.toHsva(t);this[E](e),this[y]=t}}constructor(){super();const t=u(`<style>${this[L].join("")}</style>`),e=this.attachShadow({mode:"open"});e.appendChild(t.content.cloneNode(!0)),e.addEventListener("move",this),this[w]=this[A].map(t=>new t(e))}connectedCallback(){if(this.hasOwnProperty("color")){const t=this.color;delete this.color,this.color=t}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(t,e,n){const r=this.colorModel.fromAttr(n);this[g](r)||(this.color=r)}handleEvent(t){const e=this[x],n={...e,...t.detail};let r;this[E](n),c(n,e)||this[g](r=this.colorModel.fromHsva(n))||(this[y]=r,d(this,"color-changed",{value:r}))}[g](t){return this.color&&this.colorModel.equal(t,this.color)}[E](t){this[x]=t,this[w].forEach(e=>e.update(t))}}const k={defaultColor:"#000",toHsva:t=>s(n(t)),fromHsva:({h:t,s:e,v:n})=>i(o({h:t,s:e,v:n,a:1})),equal:(t,e)=>t.toLowerCase()===e.toLowerCase()||c(n(t),n(e)),fromAttr:t=>t};class C extends S{get colorModel(){return k}}function M(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return I(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(t,e):void 0}}(t))||e){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){s=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}customElements.define("hex-color-picker",class extends C{});var $=/^[0-9a-f]{3}([0-9a-f]{3})?$/i,H=function(t){if(!t)return"";var e=t.trim();if(!e)return"";var n=e.startsWith("#")?e.slice(1):e;return $.test(n)?"#".concat(n.toLowerCase()):""};function P(){document.querySelectorAll(".pvc-field-type-color").forEach(function(t){if("true"!==t.dataset.colorInitialized){var e=t.querySelector(".pvc-color-picker"),n=t.querySelector(".pvc-color-picker-wrapper");if(e&&n){t.dataset.colorInitialized="true";var r=document.createElement("hex-color-picker");r.style.width="200px",r.style.height="200px",n.appendChild(r);var o=H(e.value)||"#000000",a=!1,i=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=n.setInput,i=void 0===a||a,s=n.dispatch,c=void 0===s||s,l=n.setPicker,u=void 0===l||l,d=H(t);return!!d&&(o=d,i&&(e.value=d),u&&r.color!==d&&(r.color=d),c&&e.dispatchEvent(new Event("input",{bubbles:!0})),!0)},s=function(){a&&(a=!1,n.style.display="none",e.setAttribute("aria-expanded","false"),document.removeEventListener("mousedown",c,!0),document.removeEventListener("keydown",l))},c=function(e){t.contains(e.target)||s()},l=function(t){"Escape"===t.key&&s()};i(o,{setInput:!0,dispatch:!1}),e.addEventListener("click",function(){a?s():a||(a=!0,n.style.display="block",e.setAttribute("aria-expanded","true"),document.addEventListener("mousedown",c,!0),document.addEventListener("keydown",l))}),e.addEventListener("input",function(){var t=H(e.value);t&&(e.value!==t&&(e.value=t),o=t,r.color!==t&&(r.color=t))}),e.addEventListener("blur",function(){i(e.value,{setInput:!0,dispatch:!1})||i(o,{setInput:!0,dispatch:!1})}),r.addEventListener("color-changed",function(t){i(t.detail.value,{setPicker:!1})}),r.addEventListener("mousedown",function(t){return t.stopPropagation()})}}})}function D(){document.querySelectorAll('input[type="range"][data-range-output]').forEach(function(t){var e=t.getAttribute("data-range-output"),n=document.getElementById(e);n&&t.addEventListener("input",function(){n.textContent=t.value})})}function z(){var t=document.querySelector("[data-settings-prefix]"),e=t?t.dataset.settingsPrefix:"";if(e){var n="data-".concat(e,"-conditional"),r="data-".concat(e,"-conditional-action"),o="".concat(e,"-hidden"),a=[],i=new Map;document.querySelectorAll("[".concat(n,"]")).forEach(function(t){var o=function(t){var e=t.getAttribute(n);if(!e)return[];try{var r=JSON.parse(e);if(Array.isArray(r))return r;if(r&&"object"===q(r))return[r]}catch(o){return[]}return[]}(t);if(o.length){var s,c=t.closest("tr")||t,l=t.getAttribute("data-".concat(e,"-animation")),u={el:t,row:c,conditions:o,animation:l,action:(s=t.getAttribute(r))&&["show","hide","enable","disable"].includes(s)?s:"show"};a.push(u),o.forEach(function(t){i.has(t.field)||i.set(t.field,[]);var e=i.get(t.field);e.includes(u)||e.push(u)})}});var s=function(t){return t.conditions.every(function(t){var e=function(t){var e=document.getElementById(t);if(e)return"checkbox"===e.type||"radio"===e.type?e.checked?e.value:"":e.value;var n=document.querySelectorAll('input[type="radio"][id^="'.concat(t,'-"]'));if(n.length>0){var r,o=M(n);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.checked)return a.value}}catch(c){o.e(c)}finally{o.f()}return null}var i=document.querySelectorAll('input[type="checkbox"][id^="'.concat(t,'-"]'));if(i.length>0){var s=[];return i.forEach(function(t){t.checked&&s.push(t.value)}),s}return null}(t.field);if(null===e)return!1;switch(t.operator){case"is":return e===t.value;case"isnot":return e!==t.value;case"contains":return("string"==typeof e||Array.isArray(e))&&e.includes(t.value);case"containsnot":return("string"==typeof e||Array.isArray(e))&&!e.includes(t.value);default:return!1}})},c=function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=t.row,i=t.animation,s=a.classList.contains(o);if(n===!s)return Promise.resolve();if(!r||!i||!["fade","slide"].includes(i))return a.classList.toggle(o,!n),Promise.resolve();var c="".concat(e,"-anim-in"),l="".concat(e,"-anim-out"),u="".concat(e,"-anim-").concat(i);return new Promise(function(t){a._pvcAnimHandler&&(a.removeEventListener("animationend",a._pvcAnimHandler),a._pvcAnimHandler=null);var e=function(){a.classList.remove(c,l,u),n?a.classList.remove(o):a.classList.add(o),a.removeEventListener("animationend",e),a._pvcAnimHandler=null,t()};a.classList.remove(c,l,u),n?(a.classList.remove(o),a.classList.add(c,u)):a.classList.add(l,u),a._pvcAnimHandler=e,a.addEventListener("animationend",e,{once:!0})})},l=function(t,e){t.el.querySelectorAll("input, select, textarea, button").forEach(function(t){e?t.disabled||(t.dataset.pvcCondDisabled="true",t.disabled=!0):"true"===t.dataset.pvcCondDisabled&&(t.disabled=!1,delete t.dataset.pvcCondDisabled)})},u=new Set,d=new Map;i.forEach(function(t,e){if(!u.has(e)){d.has(e)||d.set(e,{seq:0});!function(t,e){var n=document.getElementById(t);if(n)return n.addEventListener("change",e),void n.addEventListener("input",e);document.querySelectorAll('input[type="radio"][id^="'.concat(t,'-"]')).forEach(function(t){t.addEventListener("change",e)}),document.querySelectorAll('input[type="checkbox"][id^="'.concat(t,'-"]')).forEach(function(t){t.addEventListener("change",e)})}(e,function(){var n=d.get(e),r=++n.seq,a=[],i=[];if(t.forEach(function(t){var e=s(t);if("enable"!==t.action&&"disable"!==t.action){var n=t.row.classList.contains(o),r="show"===t.action?e:!e;r&&n?i.push(t):r||n||a.push(t)}else{var c="disable"===t.action?e:!e;l(t,c)}}),a.length>0){var u=a.map(function(t){return c(t,!1,!0)});Promise.all(u).then(function(){n.seq===r&&i.forEach(function(t){return c(t,!0,!0)})})}else i.forEach(function(t){return c(t,!0,!0)})}),u.add(e)}}),a.forEach(function(t){var e=s(t);if("enable"!==t.action&&"disable"!==t.action){var n="show"===t.action?e:!e;c(t,n,!1)}else{var r="disable"===t.action?e:!e;l(t,r)}})}}document.addEventListener("DOMContentLoaded",function(){P(),D(),z()}),document.addEventListener("wpAjaxContentLoaded",function(){P(),D(),z()});