requestmovies/data/wwwroot/beer.min.js

3 lines
9.6 KiB
JavaScript
Raw Normal View History

2024-10-11 22:59:37 +00:00
const V=[];function E(){return window.matchMedia("(pointer: coarse)").matches}function ut(){return window.matchMedia("(prefers-color-scheme: dark)").matches}async function W(t){await new Promise(n=>setTimeout(n,t))}function lt(){return"fxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16|0;return(t==="x"?n:n&3|8).toString(16)})}function x(t,n){try{return typeof t=="string"?(n??document).querySelector(t):t}catch{return null}}function s(t,n){try{return typeof t=="string"?(n??document).querySelectorAll(t):t??V}catch{return V}}function a(t,n){return(t==null?void 0:t.classList.contains(n))??!1}function p(t,n){var e;return((e=t==null?void 0:t.tagName)==null?void 0:e.toLowerCase())===n}function C(t,n){var e;return((e=t==null?void 0:t.type)==null?void 0:e.toLowerCase())===n}function y(t,n){if(t instanceof NodeList)for(let e=0;e<t.length;e++)t[e].classList.add(n);else t==null||t.classList.add(n)}function f(t,n){if(t instanceof NodeList)for(let e=0;e<t.length;e++)t[e].classList.remove(n);else t==null||t.classList.remove(n)}function o(t,n,e,i=!0){t!=null&&t.addEventListener&&t.addEventListener(n,e,i)}function F(t,n,e,i=!0){t!=null&&t.removeEventListener&&t.removeEventListener(n,e,i)}function ft(t,n){var e;(e=n==null?void 0:n.parentNode)==null||e.insertBefore(t,n)}function O(t){return t==null?void 0:t.previousElementSibling}function N(t){return t==null?void 0:t.nextElementSibling}function b(t){return t==null?void 0:t.parentElement}function dt(t){const n=document.createElement("div");for(let e=0,i=Object.keys(t),u=i.length;e<u;e++){const c=i[e],r=t[c];n.setAttribute(c,r)}return n}function _(){var t;(t=document.activeElement)==null||t.blur()}function pt(t){return s('[data-ui="#'+t+'"]')}function yt(t){return x('[data-ui="#'+t+'"]')}function gt(t){t.id&&a(t,"page")&&(t=yt(t.id)??t);const n=b(t);if(!a(n,"tabs")&&!a(n,"tabbed")&&!p(n,"nav"))return;const e=s("a",n);for(let i=0;i<e.length;i++)f(e[i],"active");y(t,"active")}function G(t){t.placeholder||(t.placeholder=" ")}function ht(t){const n=t.currentTarget,e=b(n),i=x("input:not([type=file], [type=checkbox], [type=radio]), select, textarea",e);i&&i.focus()}function $(t){const n=t.currentTarget;w(n)}function q(t){const n=t.currentTarget;w(n)}function vt(t){const n=t.currentTarget;z(n)}function bt(t){const n=t.currentTarget;B(n)}function kt(t){const n=t.currentTarget;z(n,t)}function xt(t){const n=t.currentTarget;B(n,t)}function mt(t){const n=t.currentTarget;Q(n)}function Tt(){const t=s(".field > label");for(let n=0;n<t.length;n++)o(t[n],"click",ht)}function Ct(){const t=s(".field > input:not([type=file], [type=color], [type=range])");for(let n=0;n<t.length;n++)o(t[n],"focus",$),o(t[n],"blur",q),w(t[n])}function wt(){const t=s(".field > select");for(let n=0;n<t.length;n++)o(t[n],"focus",$),o(t[n],"blur",q)}function Lt(){const t=s(".field > input[type=file]");for(let n=0;n<t.length;n++)o(t[n],"change",vt),z(t[n])}function At(){const t=s(".field > input[type=color]");for(let n=0;n<t.length;n++)o(t[n],"change",bt),B(t[n])}function Et(){const t=s(".field.textarea > textarea");for(let n=0;n<t.length;n++)o(t[n],"focus",$),o(t[n],"blur",q),o(t[n],"input",mt),Q(t[n])}function w(t){C(t,"number")&&!t.value&&(t.value=""),G(t)}function z(t,n){if((n==null?void 0:n.key)==="Enter"){const i=O(t);if(!C(i,"file"))return;i.click();return}const e=N(t);C(e,"text")&&(e.value=t.files?Array.from(t.files).map(i=>i.name).join(", "):"",e.readOnly=!0,o(e,"keydown",kt,!1),w(e))}function B(t,n){if((n==null?void 0:n.key)==="Enter"){const i=O(t);if(!C(i,"color"))return;i.click();return}const e=N(t);C(e,"text")&&(e.readOnly=!0,e.value=t.value,o(e,"keydown",xt,!1),w(e))}function Q(t){G(t);const n=b(t);n.removeAttribute("style"),a(n,"min")&&n.style.setProperty("---size",`${Math.max(t.scrollHeight,n.offsetHeight)}px`)}function St(){Tt(),Ct(),wt(),Lt(),At(),Et()}function H(t){const n=t.target;!p(n,"input")&&!p(n,"select")||(n.type==="range"?(n.focus(),Y(n)):X())}function Dt(t){if(!E())return;const n=t.target,e=b(n);a(e,"vertical")&&document.body.classList.add("no-scroll")}function Mt(t){if(!E())r
export default globalThis.ui;