PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.12
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.12
1.1.13 1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 All 37 releases
← All changes | assets/js/release-card.min.js +4 -4 0.9.8 → 1.1.12 View file →
@@ -1,9 +1,9 @@
1 -(function(){"use strict";const A="desktop-mode-notice-dismissed";function N(){const t=window.wp?.desktop?.config?.currentUserId;return typeof t=="number"&&t>0?String(t):"anon"}function C(){return`${A}:${N()}`}function O(){try{const e=window.localStorage.getItem(C());if(!e)return{};const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{}return{}}function D(e){try{window.localStorage.setItem(C(),JSON.stringify(e))}catch{}}function P(e){if(!e)return;const t=O();t[e]=!0,D(t)}const T="desktop-mode";function $(){return window.wp?.i18n}function E(e,t=T){return $()?.__(e,t)??e}const I="desktop-mode-release-card-styles",z="desktop-mode-release-host",q='<svg viewBox="0 0 122.52 122.523" aria-hidden="true"><path fill="currentColor" d="M8.708 61.26c0 20.802 12.089 38.779 29.619 47.298L13.258 39.872a52.352 52.352 0 0 0-4.55 21.388zm87.892-2.652c0-6.495-2.333-10.993-4.334-14.494-2.664-4.329-5.161-7.995-5.161-12.324 0-4.831 3.664-9.328 8.825-9.328.233 0 .454.029.681.042-9.35-8.566-21.807-13.796-35.489-13.796-18.36 0-34.513 9.42-43.91 23.688 1.233.037 2.395.063 3.382.063 5.497 0 14.006-.667 14.006-.667 2.833-.167 3.167 3.994.337 4.329 0 0-2.847.335-6.015.501l19.138 56.925 11.502-34.493-8.187-22.432c-2.831-.166-5.51-.501-5.51-.501-2.831-.167-2.499-4.496.332-4.329 0 0 8.679.667 13.843.667 5.496 0 14.006-.667 14.006-.667 2.835-.167 3.168 3.994.337 4.329 0 0-2.852.335-6.015.501l18.992 56.494 5.242-17.517c2.272-7.269 4.001-12.49 4.001-16.989zm-34.404 7.223l-15.768 45.819a52.552 52.552 0 0 0 14.807 2.136c6.309 0 12.36-1.091 17.996-3.075a4.617 4.617 0 0 1-.374-.724L62.196 65.831zm45.192-29.81c.226 1.674.354 3.471.354 5.404 0 5.333-.996 11.328-3.996 18.824l-16.053 46.413c15.624-9.111 26.133-26.038 26.133-45.426.001-9.137-2.333-17.729-6.438-25.215zM61.262 0C27.483 0 0 27.481 0 61.26c0 33.783 27.483 61.263 61.262 61.263 33.778 0 61.265-27.48 61.265-61.263C122.526 27.481 95.04 0 61.262 0zm0 119.715c-32.23 0-58.453-26.223-58.453-58.455 0-32.23 26.222-58.451 58.453-58.451 32.229 0 58.45 26.221 58.45 58.451 0 32.232-26.221 58.455-58.45 58.455z"/></svg>',H='<svg viewBox="0 0 14 14" aria-hidden="true"><path d="M3 3 L11 11 M11 3 L3 11" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" fill="none"></path></svg>',j=`
1 +(function(){"use strict";const A="desktop-mode-notice-dismissed";function j(){const t=window.wp?.os?.config?.currentUserId;return typeof t=="number"&&t>0?String(t):"anon"}function S(){return`${A}:${j()}`}function N(){try{const e=window.localStorage.getItem(S());if(!e)return{};const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{}return{}}function $(e){try{window.localStorage.setItem(S(),JSON.stringify(e))}catch{}}function O(e){if(!e)return;const t=N();t[e]=!0,$(t)}const U="desktop-mode";function D(){return window.wp?.i18n}function H(e,t=U){return D()?.__(e,t)??e}const L={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function P(e){return Object.prototype.hasOwnProperty.call(L,e)?L[e]:null}function T(e,t={}){const r=P(e);if(!r)return"";const{size:o=24,className:i,title:n,rotate:a}=t,c=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];o!=null&&c.push(`width="${o}"`,`height="${o}"`),c.push(r.a),i&&c.push(`class="${I(i)}"`),n?c.push('role="img"',`aria-label="${I(n)}"`):c.push('aria-hidden="true"','focusable="false"');const s=a?`<g transform="rotate(${a} 12 12)">${r.b}</g>`:r.b;return`<svg ${c.join(" ")}>${s}</svg>`}const R="os-release-card-styles",E="os-release-host",q='<svg viewBox="0 0 122.52 122.523" aria-hidden="true"><path fill="currentColor" d="M8.708 61.26c0 20.802 12.089 38.779 29.619 47.298L13.258 39.872a52.352 52.352 0 0 0-4.55 21.388zm87.892-2.652c0-6.495-2.333-10.993-4.334-14.494-2.664-4.329-5.161-7.995-5.161-12.324 0-4.831 3.664-9.328 8.825-9.328.233 0 .454.029.681.042-9.35-8.566-21.807-13.796-35.489-13.796-18.36 0-34.513 9.42-43.91 23.688 1.233.037 2.395.063 3.382.063 5.497 0 14.006-.667 14.006-.667 2.833-.167 3.167 3.994.337 4.329 0 0-2.847.335-6.015.501l19.138 56.925 11.502-34.493-8.187-22.432c-2.831-.166-5.51-.501-5.51-.501-2.831-.167-2.499-4.496.332-4.329 0 0 8.679.667 13.843.667 5.496 0 14.006-.667 14.006-.667 2.835-.167 3.168 3.994.337 4.329 0 0-2.852.335-6.015.501l18.992 56.494 5.242-17.517c2.272-7.269 4.001-12.49 4.001-16.989zm-34.404 7.223l-15.768 45.819a52.552 52.552 0 0 0 14.807 2.136c6.309 0 12.36-1.091 17.996-3.075a4.617 4.617 0 0 1-.374-.724L62.196 65.831zm45.192-29.81c.226 1.674.354 3.471.354 5.404 0 5.333-.996 11.328-3.996 18.824l-16.053 46.413c15.624-9.111 26.133-26.038 26.133-45.426.001-9.137-2.333-17.729-6.438-25.215zM61.262 0C27.483 0 0 27.481 0 61.26c0 33.783 27.483 61.263 61.262 61.263 33.778 0 61.265-27.48 61.265-61.263C122.526 27.481 95.04 0 61.262 0zm0 119.715c-32.23 0-58.453-26.223-58.453-58.455 0-32.23 26.222-58.451 58.453-58.451 32.229 0 58.45 26.221 58.45 58.451 0 32.232-26.221 58.455-58.45 58.455z"/></svg>',Q=T("close",{size:null}),W=`
2 2 .dm-release-card {
3 3 position: relative; box-sizing: border-box; width: 268px; padding: 11px;
4 4 border-radius: 14px; color: #fff;
5 - font-family: var( --desktop-mode-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif );
5 + font-family: var( --os-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif );
6 6 background: #34373f; border: 1px solid rgba( 255, 255, 255, 0.14 );
7 7 box-shadow: 0 16px 40px rgba( 0, 0, 0, 0.55 ), 0 3px 8px rgba( 0, 0, 0, 0.3 ), inset 0 0 0 1px rgba( 255, 255, 255, 0.04 );
8 8 --accent: #2271b1; --accent-ink: #ffffff;
9 9 animation: dmRcCardIn 0.5s cubic-bezier( 0.2, 1.2, 0.35, 1 ) both;
@@ -21,9 +21,9 @@
21 21 transition: opacity 0.12s ease, background-color 0.12s ease;
22 22 }
23 23 .dm-rc__close:hover { opacity: 1; background: rgba( 0, 0, 0, 0.7 ); }
24 24 .dm-rc__close:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
25 -.dm-rc__close svg { width: 11px; height: 11px; }
25 +.dm-rc__close svg { width: 16px; height: 16px; }
26 26 .dm-rc__art { position: relative; height: 150px; }
27 27 .dm-rc__cover {
28 28 position: absolute; left: 2px; top: 0; width: 150px; height: 150px;
29 29 border-radius: 2px; overflow: hidden; z-index: 3;
@@ -80,5 +80,5 @@
80 80 .dm-release-card, .dm-rc__disc-wrap, .dm-rc__disc, .dm-rc__meta { animation: none !important; }
81 81 .dm-rc__disc-wrap { transform: translateX( 0 ); }
82 82 .dm-rc__meta { opacity: 1; }
83 83 }
84 -`;function W(){if(document.getElementById(I))return;const e=document.createElement("style");e.id=I,e.textContent=j,document.head.appendChild(e)}function X(){const e=document.querySelector("."+z);if(e)return e;const t=document.createElement("div");return t.className=z,t.style.cssText="position:fixed;top:calc(var(--wp-admin--admin-bar--height,32px) + 16px);inset-inline-end:16px;z-index:calc(var(--desktop-mode-z-fullscreen,99999) + 10);pointer-events:none;",document.body.appendChild(t),t}function F(e,t,r,s){const o=new Image;o.crossOrigin="anonymous",o.addEventListener("load",()=>{const n=o.naturalWidth||0,a=o.naturalHeight||0;if(!n||!a)return;const i=320;t.width=i,t.height=i;const c=t.getContext("2d");if(!c)return;const v=Math.min(n,a);c.drawImage(o,0,0,v,v,0,0,i,i);try{const k=document.createElement("canvas");k.width=n,k.height=a;const l=k.getContext("2d");if(!l)return;l.drawImage(o,0,0);const f=l.getImageData(0,0,n,a).data,w=(S,p)=>{const M=(p*n+S)*4;return f[M]>248&&f[M+1]>248&&f[M+2]>248&&f[M+3]>200},b=S=>{for(let p=0;p<n;p+=2)if(!w(p,S))return!1;return!0},x=S=>{for(let p=0;p<a;p+=2)if(!w(S,p))return!1;return!0};let g=0;for(;g<a-1&&b(g);)g++;let _=a-1;for(;_>g&&b(_);)_--;let m=0;for(;m<n-1&&x(m);)m++;let y=n-1;for(;y>m&&x(y);)y--;const d=Math.max(1,Math.min(y-m+1,_-g+1));c.clearRect(0,0,i,i),c.drawImage(o,m,g,d,d,0,0,i,i),s||B(e,c,i)}catch{}},{once:!0}),o.src=r}function B(e,t,r){const{data:s}=t.getImageData(0,0,r,r),o=new Map;let n=null,a=-1;for(let l=0;l<s.length;l+=4){const f=s[l],w=s[l+1],b=s[l+2];if(s[l+3]<200)continue;const x=Math.max(f,w,b),g=Math.min(f,w,b),_=x/255,m=x===0?0:(x-g)/x;if(_<.2||m<.25)continue;const y=`${Math.floor(f/16)},${Math.floor(w/16)},${Math.floor(b/16)}`;let d=o.get(y);d||(d={r:0,g:0,b:0,n:0,score:0},o.set(y,d)),d.r+=f,d.g+=w,d.b+=b,d.n+=1,d.score+=m*_,d.score>a&&(a=d.score,n=d)}if(!n)return;const i=Math.round(n.r/n.n),c=Math.round(n.g/n.n),v=Math.round(n.b/n.n),k=(.299*i+.587*c+.114*v)/255;e.style.setProperty("--accent",`rgb(${i}, ${c}, ${v})`),e.style.setProperty("--accent-ink",k>.6?"#1a1a1a":"#ffffff")}function J(e){W();const t=X();t.textContent="";const r=document.createElement("div");r.className="dm-release-card",r.setAttribute("role","status"),r.style.pointerEvents="auto",e.accent&&r.style.setProperty("--accent",e.accent),e.accentInk&&r.style.setProperty("--accent-ink",e.accentInk),r.innerHTML=`<button type="button" class="dm-rc__close">${H}</button><div class="dm-rc__art"><div class="dm-rc__disc-wrap"><div class="dm-rc__disc"><div class="dm-rc__label">${q}</div></div><div class="dm-rc__sheen"></div></div><div class="dm-rc__cover"><canvas class="dm-rc__canvas"></canvas></div></div><div class="dm-rc__meta"><span class="dm-rc__text"></span><button type="button" class="dm-rc__btn"></button></div>`,r.querySelector(".dm-rc__text").textContent=e.message;const s=r.querySelector(".dm-rc__close");s.setAttribute("aria-label",E("Dismiss"));const o=r.querySelector(".dm-rc__btn");o.textContent=E("Update now"),t.appendChild(r),F(r,r.querySelector(".dm-rc__canvas"),e.artUrl,!!e.accent);let n=!1,a=null;const i=()=>{n=!0,a!==null&&(clearTimeout(a),a=null),r.remove()};return s.addEventListener("click",c=>{if(c.preventDefault(),c.stopPropagation(),n)return;if(P(e.dismissKey),typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){i();return}n=!0,r.style.animation="none",r.style.transition="opacity 0.2s ease",requestAnimationFrame(()=>{r.style.opacity="0"}),a=window.setTimeout(()=>r.remove(),240)}),o.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),e.onUpdate(),i()}),i}const L="X-WP-Nonce";function Y(e,t){const r=K();if(!r)return t;const s=G(e);if(!s||!Q(s))return t;const o=t?.headers??(typeof Request<"u"&&e instanceof Request?e.headers:void 0),n=new Headers(o??{});return n.has(L)?t:(n.set(L,r),{...t??{},headers:n})}function K(){if(typeof window>"u")return;const t=window.desktopModeConfig?.restNonce;return typeof t=="string"&&t.length>0?t:void 0}function G(e){try{const t=typeof window<"u"&&window.location?window.location.href:void 0;return typeof e=="string"?new URL(e,t):e instanceof URL?e:typeof Request<"u"&&e instanceof Request?new URL(e.url,t):null}catch{return null}}function Q(e){return typeof window>"u"||!window.location||e.origin!==window.location.origin?!1:!!(e.pathname.includes("/wp-json/")||e.searchParams.has("rest_route"))}function V(e,t,r={}){const s=window.wp?.desktop?.fetch;if(typeof s=="function")return s(e,t,r);const o=Y(e,t);return fetch(e,o)}const U="desktop-mode/release-art:v1:",Z=6*60*60*1e3;function h(e){return typeof e=="string"?e:""}function u(e,t){return e&&typeof e=="object"?e[t]:void 0}function ee(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function te(e){const t=u(u(e,"_embedded"),"wp:featuredmedia"),r=Array.isArray(t)?t[0]:void 0,s=u(u(r,"media_details"),"sizes");for(const o of["medium_large","large","1536x1536","medium"]){const n=h(u(u(s,o),"source_url"));if(n)return n}return h(u(r,"source_url"))}function re(e,t){if(!Array.isArray(e))return null;const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp("^WordPress "+r+'\\s*[“"]([^”"]+)[”"]');for(const o of e){const n=ee(h(u(u(o,"title"),"rendered"))),a=s.exec(n);if(!a)continue;const i=te(o);if(i)return{name:a[1].trim(),artUrl:i}}return null}function ne(e){try{const t=localStorage.getItem(U+e);if(!t)return null;const r=JSON.parse(t);return r.ok===!0&&h(r.name)&&h(r.artUrl)?{name:h(r.name),artUrl:h(r.artUrl)}:r.ok===!1&&typeof r.ts=="number"&&Date.now()-r.ts<Z?"miss":null}catch{return null}}function R(e,t){try{localStorage.setItem(U+e,JSON.stringify(t))}catch{}}async function oe(e){if(!e)return null;const t=ne(e);if(t==="miss")return null;if(t)return t;try{const r="https://wordpress.org/news/wp-json/wp/v2/posts?search="+encodeURIComponent(e)+"&per_page=100&_fields=title,_links,_embedded&_embed=wp:featuredmedia",s=await V(r,{credentials:"omit"},{silent:!0,source:"desktop-mode/release-art"});if(!s.ok)return R(e,{ok:!1,ts:Date.now()}),null;const o=re(await s.json(),e);return o?(R(e,{ok:!0,name:o.name,artUrl:o.artUrl}),o):(R(e,{ok:!1,ts:Date.now()}),null)}catch{return R(e,{ok:!1,ts:Date.now()}),null}}function se(e,t=5e3){return new Promise(r=>{const s=new Image;s.crossOrigin="anonymous";let o=!1;const n=a=>{o||(o=!0,r(a))};s.addEventListener("load",()=>n(!0),{once:!0}),s.addEventListener("error",()=>n(!1),{once:!0}),window.setTimeout(()=>n(!1),t),s.src=e})}window.desktopModeReleaseCard={showReleaseCard:J,resolveReleaseArt:oe,preloadImage:se}})();
84 +`;function X(){if(document.getElementById(R))return;const e=document.createElement("style");e.id=R,e.textContent=W,document.head.appendChild(e)}function F(){const e=document.querySelector("."+E);if(e)return e;const t=document.createElement("div");return t.className=E,t.style.cssText="position:fixed;top:calc(var(--os-admin-bar-height,var(--wp-admin--admin-bar--height,32px)) + 16px);inset-inline-end:16px;z-index:calc(var(--os-z-fullscreen,99999) + 10);pointer-events:none;",document.body.appendChild(t),t}function B(e,t,r,o){const i=new Image;i.crossOrigin="anonymous",i.addEventListener("load",()=>{const n=i.naturalWidth||0,a=i.naturalHeight||0;if(!n||!a)return;const c=320;t.width=c,t.height=c;const s=t.getContext("2d");if(!s)return;const _=Math.min(n,a);s.drawImage(i,0,0,_,_,0,0,c,c);try{const k=document.createElement("canvas");k.width=n,k.height=a;const d=k.getContext("2d");if(!d)return;d.drawImage(i,0,0);const f=d.getImageData(0,0,n,a).data,w=(C,p)=>{const z=(p*n+C)*4;return f[z]>248&&f[z+1]>248&&f[z+2]>248&&f[z+3]>200},b=C=>{for(let p=0;p<n;p+=2)if(!w(p,C))return!1;return!0},x=C=>{for(let p=0;p<a;p+=2)if(!w(C,p))return!1;return!0};let m=0;for(;m<a-1&&b(m);)m++;let v=a-1;for(;v>m&&b(v);)v--;let h=0;for(;h<n-1&&x(h);)h++;let y=n-1;for(;y>h&&x(y);)y--;const l=Math.max(1,Math.min(y-h+1,v-m+1));s.clearRect(0,0,c,c),s.drawImage(i,h,m,l,l,0,0,c,c),o||J(e,s,c)}catch{}},{once:!0}),i.src=r}function J(e,t,r){const{data:o}=t.getImageData(0,0,r,r),i=new Map;let n=null,a=-1;for(let d=0;d<o.length;d+=4){const f=o[d],w=o[d+1],b=o[d+2];if(o[d+3]<200)continue;const x=Math.max(f,w,b),m=Math.min(f,w,b),v=x/255,h=x===0?0:(x-m)/x;if(v<.2||h<.25)continue;const y=`${Math.floor(f/16)},${Math.floor(w/16)},${Math.floor(b/16)}`;let l=i.get(y);l||(l={r:0,g:0,b:0,n:0,score:0},i.set(y,l)),l.r+=f,l.g+=w,l.b+=b,l.n+=1,l.score+=h*v,l.score>a&&(a=l.score,n=l)}if(!n)return;const c=Math.round(n.r/n.n),s=Math.round(n.g/n.n),_=Math.round(n.b/n.n),k=(.299*c+.587*s+.114*_)/255;e.style.setProperty("--accent",`rgb(${c}, ${s}, ${_})`),e.style.setProperty("--accent-ink",k>.6?"#1a1a1a":"#ffffff")}function Y(e){X();const t=F();t.textContent="";const r=document.createElement("div");r.className="dm-release-card",r.setAttribute("role","status"),r.style.pointerEvents="auto",e.accent&&r.style.setProperty("--accent",e.accent),e.accentInk&&r.style.setProperty("--accent-ink",e.accentInk),r.innerHTML=`<button type="button" class="dm-rc__close">${Q}</button><div class="dm-rc__art"><div class="dm-rc__disc-wrap"><div class="dm-rc__disc"><div class="dm-rc__label">${q}</div></div><div class="dm-rc__sheen"></div></div><div class="dm-rc__cover"><canvas class="dm-rc__canvas"></canvas></div></div><div class="dm-rc__meta"><span class="dm-rc__text"></span><button type="button" class="dm-rc__btn"></button></div>`,r.querySelector(".dm-rc__text").textContent=e.message;const o=r.querySelector(".dm-rc__close");o.setAttribute("aria-label",H("Dismiss"));const i=r.querySelector(".dm-rc__btn");i.textContent=H("Update now"),t.appendChild(r),B(r,r.querySelector(".dm-rc__canvas"),e.artUrl,!!e.accent);let n=!1,a=null;const c=()=>{n=!0,a!==null&&(clearTimeout(a),a=null),r.remove()};return o.addEventListener("click",s=>{if(s.preventDefault(),s.stopPropagation(),n)return;if(O(e.dismissKey),typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){c();return}n=!0,r.style.animation="none",r.style.transition="opacity 0.2s ease",requestAnimationFrame(()=>{r.style.opacity="0"}),a=window.setTimeout(()=>r.remove(),240)}),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),e.onUpdate(),c()}),c}const V="X-WP-Nonce";function K(e,t){const r=G();if(!r)return t;const o=ee(e);if(!o||!te(o))return t;const i=t?.headers??(typeof Request<"u"&&e instanceof Request?e.headers:void 0),n=new Headers(i??{});return n.has(V)?t:(n.set(V,r),{...t??{},headers:n})}function G(){if(typeof window>"u")return;const t=window.openStationConfig?.restNonce;return typeof t=="string"&&t.length>0?t:void 0}function ee(e){try{const t=typeof window<"u"&&window.location?window.location.href:void 0;return typeof e=="string"?new URL(e,t):e instanceof URL?e:typeof Request<"u"&&e instanceof Request?new URL(e.url,t):null}catch{return null}}function te(e){return typeof window>"u"||!window.location||e.origin!==window.location.origin?!1:!!(e.pathname.includes("/wp-json/")||e.searchParams.has("rest_route"))}function re(e,t,r={}){const o=window.wp?.os?.fetch;if(typeof o=="function")return o(e,t,r);const i=K(e,t);return fetch(e,i)}const Z="desktop-mode/release-art:v1:",ne=6*60*60*1e3,oe=30*60*1e3;function g(e){return typeof e=="string"?e:""}function u(e,t){return e&&typeof e=="object"?e[t]:void 0}function ie(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}function ce(e){const t=u(u(e,"_embedded"),"wp:featuredmedia"),r=Array.isArray(t)?t[0]:void 0,o=u(u(r,"media_details"),"sizes");for(const i of["medium_large","large","1536x1536","medium"]){const n=g(u(u(o,i),"source_url"));if(n)return n}return g(u(r,"source_url"))}function ae(e,t){if(!Array.isArray(e))return null;const r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("^WordPress "+r+'\\s*[“"]([^”"]+)[”"]');for(const i of e){const n=ie(g(u(u(i,"title"),"rendered"))),a=o.exec(n);if(!a)continue;const c=ce(i);if(c)return{name:a[1].trim(),artUrl:c}}return null}function se(e,t){try{const r=localStorage.getItem(Z+e);if(!r)return null;const o=JSON.parse(r);return o.ok===!0&&g(o.name)&&g(o.artUrl)?{name:g(o.name),artUrl:g(o.artUrl)}:o.ok===!1&&typeof o.ts=="number"&&Date.now()-o.ts<t?"miss":null}catch{return null}}function M(e,t){try{localStorage.setItem(Z+e,JSON.stringify(t))}catch{}}async function le(e,t=!1){if(!e)return null;const r=se(e,t?oe:ne);if(r==="miss")return null;if(r)return r;try{const o="https://wordpress.org/news/wp-json/wp/v2/posts?search="+encodeURIComponent(e)+"&per_page=100&_fields=title,_links,_embedded&_embed=wp:featuredmedia",i=await re(o,{credentials:"omit"},{silent:!0,source:"desktop-mode/release-art"});if(!i.ok)return M(e,{ok:!1,ts:Date.now()}),null;const n=ae(await i.json(),e);return n?(M(e,{ok:!0,name:n.name,artUrl:n.artUrl}),n):(M(e,{ok:!1,ts:Date.now()}),null)}catch{return M(e,{ok:!1,ts:Date.now()}),null}}function de(e,t=5e3){return new Promise(r=>{const o=new Image;o.crossOrigin="anonymous";let i=!1;const n=a=>{i||(i=!0,r(a))};o.addEventListener("load",()=>n(!0),{once:!0}),o.addEventListener("error",()=>n(!1),{once:!0}),window.setTimeout(()=>n(!1),t),o.src=e})}window.openStationReleaseCard={showReleaseCard:Y,resolveReleaseArt:le,preloadImage:de}})();