PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.11
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.11
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 0.8.9 0.8.8 All 35 releases
← All changes | assets/js/apps/plugins.min.js +347 -137 1.1.6 → 1.1.11 View file →
@@ -1,22 +1,22 @@
1 -var openStationApp_plugins=function(_e){"use strict";const Yt="desktop-mode";function Qe(){return window.wp?.i18n}function l(e,t=Yt){return Qe()?.__(e,t)??e}function v(e,...t){const o=Qe()?.sprintf;if(o)return o(e,...t);let n=0;return e.replace(/%(?:(\d+)\$)?[sd]/g,(s,a)=>{const i=a?Number.parseInt(a,10)-1:n++;return String(t[i]??"")})}function _(e,...t){return{__wpdHtml:!0,strings:e,values:t}}function Jt(e){return!!e&&e.__wpdHtml===!0}const eo="$$wpd$$",A=/\$\$wpd\$\$(\d+)\$\$/g,to="$$wpd-node$$",oo=/^\$\$wpd-node\$\$(\d+)\$\$$/,no=new Set(["style","script","textarea","title"]);function so(e){let t="",o=!1,n=null,s=!1,a=null,i="",r=!1;for(let d=0;d<e.length;d++){const c=e[d];t+=c;for(let u=0;u<c.length;u++){const p=c[u];if(s){c.startsWith("-->",u)&&(s=!1,u+=2);continue}if(a!==null){p==="<"&&c[u+1]==="/"&&c.slice(u+2,u+2+a.length).toLowerCase()===a&&(u+=1+a.length,a=null,o=!0,r=!1,i="");continue}if(n!==null){p===n&&(n=null);continue}if(o){p==='"'||p==="'"?(n=p,r=!1):p===">"?(o=!1,r=!1,no.has(i)&&(a=i),i=""):r&&(/[a-zA-Z0-9-]/.test(p)?i+=p.toLowerCase():r=!1);continue}if(c.startsWith("<!--",u)){s=!0,u+=3;continue}const h=c[u+1]??"";p==="<"&&/[a-zA-Z/!]/.test(h)&&(o=!0,i="",r=/[a-zA-Z]/.test(h))}d<e.length-1&&(t+=o||s||a!==null?`${eo}${d}$$`:`<!--${to}${d}$$-->`)}return t}const Ye=new WeakMap;function Je(e){const t=Ye.get(e);if(t)return t;const o=document.createElement("template");o.innerHTML=so(e);const n=[],s=(r,d)=>{if(r.nodeType===Node.ELEMENT_NODE){const p=r;for(const h of Array.from(p.attributes)){const b=h.name,m=h.value,y=b[0];if(A.test(m))if(A.lastIndex=0,y==="@"){const f=A.exec(m);A.lastIndex=0,n.push({path:d,kind:"event",name:b.slice(1),valueIndex:f?Number(f[1]):0}),p.removeAttribute(b)}else if(y==="."){const f=A.exec(m);A.lastIndex=0,n.push({path:d,kind:"prop",name:b.slice(1),valueIndex:f?Number(f[1]):0}),p.removeAttribute(b)}else if(y==="?"){const f=A.exec(m);A.lastIndex=0,n.push({path:d,kind:"bool",name:b.slice(1),valueIndex:f?Number(f[1]):0}),p.removeAttribute(b)}else{const f=[],w=[];let x=0,E;for(A.lastIndex=0;(E=A.exec(m))!==null;)f.push(m.slice(x,E.index)),w.push(Number(E[1])),x=E.index+E[0].length;f.push(m.slice(x)),n.push({path:d,kind:"attr",name:b,template:f,valueIndices:w}),p.setAttribute(b,"")}}}const c=Array.from(r.childNodes);let u=0;for(let p=0;p<c.length;p++){const h=c[p],b=p+u;if(h.nodeType===Node.COMMENT_NODE){const m=oo.exec(h.data);if(m){const y=document.createTextNode("");h.parentNode.replaceChild(y,h),n.push({path:[...d,b],kind:"node",valueIndex:Number(m[1])})}continue}if(h.nodeType===Node.TEXT_NODE){const m=h.textContent||"";if(!A.test(m)){A.lastIndex=0;continue}A.lastIndex=0;const y=h.parentNode;let f=0,w;const x=[],E=[];for(A.lastIndex=0;(w=A.exec(m))!==null;){w.index>f&&x.push(document.createTextNode(m.slice(f,w.index)));const q=document.createTextNode("");x.push(q),E.push({path:[...d,b+x.length-1],kind:"node",valueIndex:Number(w[1])}),f=w.index+w[0].length}f<m.length&&x.push(document.createTextNode(m.slice(f)));for(const q of x)y.insertBefore(q,h);y.removeChild(h),u+=x.length-1,n.push(...E)}else s(h,[...d,b])}};s(o.content,[]);const i={template:o,buildParts:r=>{const d=[];for(const c of n){let u=r;for(const p of c.path)u=u.childNodes[p];c.kind==="node"?d.push({kind:"node",valueIndex:c.valueIndex,child:{anchor:u,state:null}}):c.kind==="attr"?d.push({kind:"attr",element:u,name:c.name,template:c.template,valueIndices:c.valueIndices}):c.kind==="event"?d.push({kind:"event",valueIndex:c.valueIndex,element:u,name:c.name}):c.kind==="prop"?d.push({kind:"prop",valueIndex:c.valueIndex,element:u,name:c.name}):c.kind==="bool"&&d.push({kind:"bool",valueIndex:c.valueIndex,element:u,name:c.name})}return d}};return Ye.set(e,i),i}const et=new WeakMap;function ao(e,t){for(const o of e.nodes)if(o.parentNode!==t)return!1;return!0}function tt(e,t){const o=et.get(t);if(o&&o.strings===e.strings&&ao(o,t)){re(o.parts,e.values);return}const n=Je(e.strings),s=n.template.content.cloneNode(!0),a=n.buildParts(s),i=Array.from(s.childNodes);for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(s),re(a,e.values),et.set(t,{strings:e.strings,parts:a,nodes:i})}function re(e,t){for(const o of e)if(o.kind==="node")le(o.child,t[o.valueIndex]);else if(o.kind==="attr"){let n=o.template[0];for(let s=0;s<o.valueIndices.length;s++)n+=ot(t[o.valueIndices[s]]),n+=o.template[s+1];n!==o.last&&(o.last=n,n===""?o.element.removeAttribute(o.name):o.element.setAttribute(o.name,n))}else if(o.kind==="event"){const n=t[o.valueIndex];n!==o.current&&(o.current&&o.element.removeEventListener(o.name,o.current),n&&o.element.addEventListener(o.name,n),o.current=n)}else if(o.kind==="prop"){const n=t[o.valueIndex];n!==o.last&&(o.last=n,o.element[o.name]=n)}else if(o.kind==="bool"){const n=!!t[o.valueIndex];n!==o.last&&(o.last=n,n?o.element.setAttribute(o.name,""):o.element.removeAttribute(o.name))}}function le(e,t){if(t==null||t===!1){e.state&&(T(e.state),e.state=null);return}if(Array.isArray(t)){co(e,t);return}if(Jt(t)){lo(e,t);return}if(t instanceof Node){io(e,t);return}ro(e,ot(t))}function io(e,t){const o=e.state;o?.shape==="node"&&o.node===t||(o&&T(o),j(e,[t]),e.state={shape:"node",node:t})}function ro(e,t){const o=e.state;if(o?.shape==="text"){o.text!==t&&(o.node.textContent=t,o.text=t);return}o&&T(o);const n=document.createTextNode(t);j(e,[n]),e.state={shape:"text",node:n,text:t}}function lo(e,t){const o=e.state;if(o?.shape==="template"&&o.strings===t.strings){re(o.parts,t.values);return}o&&T(o);const n=Je(t.strings),s=n.template.content.cloneNode(!0),a=n.buildParts(s),i=Array.from(s.childNodes);j(e,[s]),re(a,t.values),e.state={shape:"template",strings:t.strings,parts:a,nodes:i}}function co(e,t){const o=e.state;if(o?.shape==="array"){const s=Math.min(o.entries.length,t.length);for(let a=0;a<s;a++)le(o.entries[a],t[a]);if(t.length<o.entries.length){for(let a=t.length;a<o.entries.length;a++){const i=o.entries[a];i.state&&T(i.state),i.anchor.remove()}o.entries.length=t.length}else for(let a=o.entries.length;a<t.length;a++){const i=document.createTextNode("");j(e,[i]);const r={anchor:i,state:null};le(r,t[a]),o.entries.push(r)}return}o&&T(o);const n=[];for(const s of t){const a=document.createTextNode("");j(e,[a]);const i={anchor:a,state:null};le(i,s),n.push(i)}e.state={shape:"array",entries:n}}function j(e,t){const o=e.anchor.parentNode;if(o)for(const n of t)o.insertBefore(n,e.anchor)}function T(e){if(e.shape==="text"){e.node.remove();return}if(e.shape==="template"){for(const t of e.parts)t.kind==="node"&&t.child.state&&(T(t.child.state),t.child.state=null);for(const t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);return}if(e.shape==="node"){e.node.parentNode&&e.node.parentNode.removeChild(e.node);return}for(const t of e.entries)t.state&&T(t.state),t.anchor.remove()}function ot(e){return e==null||e===!1?"":String(e)}function ye(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KB","MB","GB","TB"];let o=e,n=0;for(;o>=1024&&n<t.length-1;)o/=1024,n++;const s=o>=100||n===0?0:1;return`${o.toFixed(s)} ${t[n]}`}function nt(e,t="short"){if(e===""||e===null||e===void 0)return"";const o=typeof e=="string"&&/^\d{4}-\d{2}$/.test(e)?`${e}-01T00:00:00`:e,n=o instanceof Date?o:new Date(o);if(Number.isNaN(n.getTime()))return String(e);try{switch(t){case"long":return n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});case"month":return n.toLocaleDateString(void 0,{year:"numeric",month:"long"});case"datetime":return n.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"});case"iso":return n.toISOString();default:return n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}}catch{return String(e)}}const uo="data-os-mode";function xe(e=typeof document<"u"?document.documentElement:null){return!!e&&e.getAttribute(uo)==="mobile"}function st(e){return e.phone??xe()?_`<os-select
1 +var openStationApp_plugins=function(Re){"use strict";const So="desktop-mode";function _t(){return window.wp?.i18n}function d(o,e=So){return _t()?.__(o,e)??o}function y(o,...e){const t=_t()?.sprintf;if(t)return t(o,...e);let s=0;return o.replace(/%(?:(\d+)\$)?[sd]/g,(n,i)=>{const a=i?Number.parseInt(i,10)-1:s++;return String(e[a]??"")})}function f(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function $o(o){return!!o&&o.__wpdHtml===!0}const zo="$$wpd$$",z=/\$\$wpd\$\$(\d+)\$\$/g,No="$$wpd-node$$",Lo=/^\$\$wpd-node\$\$(\d+)\$\$$/,To=new Set(["style","script","textarea","title"]);function Ro(o){let e="",t=!1,s=null,n=!1,i=null,a="",r=!1;for(let l=0;l<o.length;l++){const c=o[l];e+=c;for(let p=0;p<c.length;p++){const u=c[p];if(n){c.startsWith("-->",p)&&(n=!1,p+=2);continue}if(i!==null){u==="<"&&c[p+1]==="/"&&c.slice(p+2,p+2+i.length).toLowerCase()===i&&(p+=1+i.length,i=null,t=!0,r=!1,a="");continue}if(s!==null){u===s&&(s=null);continue}if(t){u==='"'||u==="'"?(s=u,r=!1):u===">"?(t=!1,r=!1,To.has(a)&&(i=a),a=""):r&&(/[a-zA-Z0-9-]/.test(u)?a+=u.toLowerCase():r=!1);continue}if(c.startsWith("<!--",p)){n=!0,p+=3;continue}const g=c[p+1]??"";u==="<"&&/[a-zA-Z/!]/.test(g)&&(t=!0,a="",r=/[a-zA-Z]/.test(g))}l<o.length-1&&(e+=t||n||i!==null?`${zo}${l}$$`:`<!--${No}${l}$$-->`)}return e}const yt=new WeakMap;function kt(o){const e=yt.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=Ro(o);const s=[],n=(r,l)=>{if(r.nodeType===Node.ELEMENT_NODE){const u=r;for(const g of Array.from(u.attributes)){const b=g.name,h=g.value,_=b[0];if(z.test(h))if(z.lastIndex=0,_==="@"){const m=z.exec(h);z.lastIndex=0,s.push({path:l,kind:"event",name:b.slice(1),valueIndex:m?Number(m[1]):0}),u.removeAttribute(b)}else if(_==="."){const m=z.exec(h);z.lastIndex=0,s.push({path:l,kind:"prop",name:b.slice(1),valueIndex:m?Number(m[1]):0}),u.removeAttribute(b)}else if(_==="?"){const m=z.exec(h);z.lastIndex=0,s.push({path:l,kind:"bool",name:b.slice(1),valueIndex:m?Number(m[1]):0}),u.removeAttribute(b)}else{const m=[],w=[];let x=0,S;for(z.lastIndex=0;(S=z.exec(h))!==null;)m.push(h.slice(x,S.index)),w.push(Number(S[1])),x=S.index+S[0].length;m.push(h.slice(x)),s.push({path:l,kind:"attr",name:b,template:m,valueIndices:w}),u.setAttribute(b,"")}}}const c=Array.from(r.childNodes);let p=0;for(let u=0;u<c.length;u++){const g=c[u],b=u+p;if(g.nodeType===Node.COMMENT_NODE){const h=Lo.exec(g.data);if(h){const _=document.createTextNode("");g.parentNode.replaceChild(_,g),s.push({path:[...l,b],kind:"node",valueIndex:Number(h[1])})}continue}if(g.nodeType===Node.TEXT_NODE){const h=g.textContent||"";if(!z.test(h)){z.lastIndex=0;continue}z.lastIndex=0;const _=g.parentNode;let m=0,w;const x=[],S=[];for(z.lastIndex=0;(w=z.exec(h))!==null;){w.index>m&&x.push(document.createTextNode(h.slice(m,w.index)));const D=document.createTextNode("");x.push(D),S.push({path:[...l,b+x.length-1],kind:"node",valueIndex:Number(w[1])}),m=w.index+w[0].length}m<h.length&&x.push(document.createTextNode(h.slice(m)));for(const D of x)_.insertBefore(D,g);_.removeChild(g),p+=x.length-1,s.push(...S)}else n(g,[...l,b])}};n(t.content,[]);const a={template:t,buildParts:r=>{const l=[];for(const c of s){let p=r;for(const u of c.path)p=p.childNodes[u];c.kind==="node"?l.push({kind:"node",valueIndex:c.valueIndex,child:{anchor:p,state:null}}):c.kind==="attr"?l.push({kind:"attr",element:p,name:c.name,template:c.template,valueIndices:c.valueIndices}):c.kind==="event"?l.push({kind:"event",valueIndex:c.valueIndex,element:p,name:c.name}):c.kind==="prop"?l.push({kind:"prop",valueIndex:c.valueIndex,element:p,name:c.name}):c.kind==="bool"&&l.push({kind:"bool",valueIndex:c.valueIndex,element:p,name:c.name})}return l}};return yt.set(o,a),a}const xt=new WeakMap;function Po(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function W(o,e){const t=xt.get(e);if(t&&t.strings===o.strings&&Po(t,e)){ve(t.parts,o.values);return}const s=kt(o.strings),n=s.template.content.cloneNode(!0),i=s.buildParts(n),a=Array.from(n.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(n),ve(i,o.values),xt.set(e,{strings:o.strings,parts:i,nodes:a})}function ve(o,e){for(const t of o)if(t.kind==="node")_e(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let s=t.template[0];for(let n=0;n<t.valueIndices.length;n++)s+=wt(e[t.valueIndices[n]]),s+=t.template[n+1];s!==t.last&&(t.last=s,s===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,s))}else if(t.kind==="event"){const s=e[t.valueIndex];s!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),s&&t.element.addEventListener(t.name,s),t.current=s)}else if(t.kind==="prop"){const s=e[t.valueIndex];s!==t.last&&(t.last=s,t.element[t.name]=s)}else if(t.kind==="bool"){const s=!!e[t.valueIndex];s!==t.last&&(t.last=s,s?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function _e(o,e){if(e==null||e===!1){o.state&&(P(o.state),o.state=null);return}if(Array.isArray(e)){Io(o,e);return}if($o(e)){Mo(o,e);return}if(e instanceof Node){qo(o,e);return}Do(o,wt(e))}function qo(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&P(t),j(o,[e]),o.state={shape:"node",node:e})}function Do(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&P(t);const s=document.createTextNode(e);j(o,[s]),o.state={shape:"text",node:s,text:e}}function Mo(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){ve(t.parts,e.values);return}t&&P(t);const s=kt(e.strings),n=s.template.content.cloneNode(!0),i=s.buildParts(n),a=Array.from(n.childNodes);j(o,[n]),ve(i,e.values),o.state={shape:"template",strings:e.strings,parts:i,nodes:a}}function Io(o,e){const t=o.state;if(t?.shape==="array"){const n=Math.min(t.entries.length,e.length);for(let i=0;i<n;i++)_e(t.entries[i],e[i]);if(e.length<t.entries.length){for(let i=e.length;i<t.entries.length;i++){const a=t.entries[i];a.state&&P(a.state),a.anchor.remove()}t.entries.length=e.length}else for(let i=t.entries.length;i<e.length;i++){const a=document.createTextNode("");j(o,[a]);const r={anchor:a,state:null};_e(r,e[i]),t.entries.push(r)}return}t&&P(t);const s=[];for(const n of e){const i=document.createTextNode("");j(o,[i]);const a={anchor:i,state:null};_e(a,n),s.push(a)}o.state={shape:"array",entries:s}}function j(o,e){const t=o.anchor.parentNode;if(t)for(const s of e)t.insertBefore(s,o.anchor)}function P(o){if(o.shape==="text"){o.node.remove();return}if(o.shape==="template"){for(const e of o.parts)e.kind==="node"&&e.child.state&&(P(e.child.state),e.child.state=null);for(const e of o.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(o.shape==="node"){o.node.parentNode&&o.node.parentNode.removeChild(o.node);return}for(const e of o.entries)e.state&&P(e.state),e.anchor.remove()}function wt(o){return o==null||o===!1?"":String(o)}function ye(o){if(!Number.isFinite(o)||o<=0)return"0 B";const e=["B","KB","MB","GB","TB"];let t=o,s=0;for(;t>=1024&&s<e.length-1;)t/=1024,s++;const n=t>=100||s===0?0:1;return`${t.toFixed(n)} ${e[s]}`}function Ct(o,e="short"){if(o===""||o===null||o===void 0)return"";const t=typeof o=="string"&&/^\d{4}-\d{2}$/.test(o)?`${o}-01T00:00:00`:o,s=t instanceof Date?t:new Date(t);if(Number.isNaN(s.getTime()))return String(o);try{switch(e){case"long":return s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});case"month":return s.toLocaleDateString(void 0,{year:"numeric",month:"long"});case"datetime":return s.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"});case"iso":return s.toISOString();default:return s.toLocaleDateString(void 0,{month:"short",day:"numeric"})}}catch{return String(o)}}const Ho="data-os-mode";function At(o=typeof document<"u"?document.documentElement:null){return!!o&&o.getAttribute(Ho)==="mobile"}function Uo(o){return o.phone??At()?f`<os-select
2 2 class="os-app-list__status"
3 - os-bind=${e.bind}
4 - os-action=${e.action}
5 - value=${e.value}
6 - aria-label=${e.label}
7 - >${e.segments.map(o=>_`<os-option value=${o.value}>${o.label}</os-option>`)}</os-select>`:_`<os-segmented
3 + os-bind=${o.bind}
4 + os-action=${o.action}
5 + .value=${o.value}
6 + aria-label=${o.label}
7 + >${o.segments.map(t=>f`<os-option .value=${t.value}>${t.label}</os-option>`)}</os-select>`:f`<os-segmented
8 8 class="os-app-list__status"
9 - os-bind=${e.bind}
10 - os-action=${e.action}
11 - value=${e.value}
12 - label=${e.label}
13 - >${e.segments.map(o=>_`<os-segment value=${o.value}>${o.label}</os-segment>`)}</os-segmented>`}function po(e,t=null){const o=t??(typeof document<"u"?document.documentElement:null);if(!!o&&xe(o)){e.hasAttribute("stacked")||e.setAttribute("stacked","");const a=e.getAttribute("sticky-columns");return a!==null&&(e.setAttribute("data-os-sticky-columns",a),e.removeAttribute("sticky-columns")),!0}e.hasAttribute("stacked")&&e.removeAttribute("stacked");const s=e.getAttribute("data-os-sticky-columns");return s!==null&&(e.setAttribute("sticky-columns",s),e.removeAttribute("data-os-sticky-columns")),!1}function at(e){return Array.from(e.selection??[],String)}function ho(){let e=null,t=!1,o=null,n=null;return{invalidateColumns(){e=null},invalidateData(){n=null},sync(s){const a={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},i=s.table;if(!i)return a;const r=s.rowId??(c=>c.id),d=po(i);if(a.phone=d,d!==e&&(e=d,i.columns=s.columns(d),a.columnsChanged=!0),t||(t=!0,s.wire?.(i)),s.listKey!==o&&(o=s.listKey,at(i).length>0&&(i.clearSelection(),a.selectionChanged=!0,s.onSelection?.([]))),s.fingerprint!==n){n=s.fingerprint,i.data=s.rows,a.dataChanged=!0;const c=new Set(s.rows.map(h=>String(r(h)))),u=at(i),p=u.filter(h=>c.has(h));p.length!==u.length&&(i.selection=p,a.selectionChanged=!0,s.onSelection?.(p))}return a}}}function go(e,t){const o=t.local??{},n={id:e,hasLocal:i=>Object.prototype.hasOwnProperty.call(o,i),runLocal:(i,r,d,c)=>{const u=o[i];if(!u)return r;const p={...r},h=u(p,d,c);return h===void 0?p:h},render:i=>{tt(t.view(i),i.root),t.updated?.(i)},mounted:i=>t.mounted?.(i)},{placeholder:s}=t;s&&(n.placeholder=i=>s(i));const a=window;return(a.openStationApps??(a.openStationApps={}))[e]=n,n}function ke(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}`${btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="currentColor"><rect x="6" y="6" width="23" height="23" rx="4"/><rect x="35" y="6" width="23" height="23" rx="4"/><rect x="6" y="35" width="23" height="23" rx="4"/><rect x="35" y="35" width="23" height="23" rx="4"/></svg>')}`,`${btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="6" stroke-linecap="round"><path d="M10 22h44M10 42h44"/><circle cx="24" cy="22" r="7" fill="currentColor" stroke="none"/><circle cx="42" cy="42" r="7" fill="currentColor" stroke="none"/></svg>')}`;function mo(e){try{(window.top??window).location.assign(e)}catch{window.location.assign(e)}}const fo=800;function bo(e,t=fo){window.setTimeout(()=>{if(e){mo(e);return}try{(window.top??window).location.reload()}catch{window.location.reload()}},t)}const it="os.plugin.changed",rt="plugins-app";function we(e){return e.textdomain||e.plugin}function M(e){return e==="active"||e==="network-active"}function R(e){return e instanceof Error?e.message:String(e)}function Ce(e){return e.endsWith(".php")?e:e+".php"}function vo(e){let t=4294967295;for(let o=0;o<e.length;o++){t^=e.charCodeAt(o)&255;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1}return Math.max(1,(t^4294967295)>>>0)}function Ee(e,t){if(!e.rest.isOpenStationSelf(t))return!1;const o=e.installed.find(n=>n.plugin===t);return!o||!M(o.status)}function Ae(e,t){e.toast(l(t?"OpenStation deleted. Reloading…":"OpenStation deactivated. Reloading…","desktop-mode"),2e3),bo(e.extra.adminUrl??"")}async function Se(e,t){const o=await e.dispatch("activate",{plugin:t.plugin});return o&&e.broadcastChange({plugin:t.plugin,action:"activate"}),o}async function _o(e,t){return await e.dispatch("deactivate",{plugin:t.plugin})?Ee(e,t.plugin)?(Ae(e,!1),!0):(e.broadcastChange({plugin:t.plugin,action:"deactivate"}),!0):!1}async function yo(e,t){return await e.dispatch("delete",{plugin:t.plugin},{confirm:{title:l("Delete plugin?","desktop-mode"),message:v(l("Permanently delete %s? Its files will be removed from disk. This cannot be undone.","desktop-mode"),t.name||t.plugin),label:l("Delete","desktop-mode"),danger:!0}})?Ee(e,t.plugin)?(Ae(e,!0),!0):(e.broadcastChange({plugin:t.plugin,action:"delete"}),!0):!1}async function lt(e,t,o){try{await e.rest.installPluginBySlug(t)}catch(n){return e.toast(v(l("Install failed: %s","desktop-mode"),R(n)),6e3),!1}return await e.refresh(),e.toast(v(l("Installed %s.","desktop-mode"),ke(o))),e.broadcastChange({plugin:t,action:"install"}),e.refreshMenu(),!0}const dt=[];let $e=!1;function ct(e){return new Promise((t,o)=>{dt.push({run:e,resolve:t,reject:o}),ut()})}async function ut(){if($e)return;const e=dt.shift();if(e){$e=!0;try{const t=await e.run();e.resolve(t)}catch(t){e.reject(t)}finally{$e=!1,Promise.resolve().then(ut)}}}const xo=()=>({updating:new Set,autoUpdating:new Set,optimistic:new Map});function de(e,t,o="small"){const n=document.createElement("os-button");return n.setAttribute("variant",t),o&&n.setAttribute("size",o),n.textContent=e,n}function F(e,t){if(!e)return()=>{};const o=e.textContent??"";return e.setAttribute("busy",""),e.setAttribute("disabled",""),e.setAttribute("aria-busy","true"),t!==void 0&&(e.textContent=t),()=>{e.removeAttribute("busy"),e.removeAttribute("disabled"),e.removeAttribute("aria-busy"),e.textContent=o}}function ko(e){return e.openstation_can_manage??{activate:e.status==="inactive",deactivate:M(e.status),delete:e.status==="inactive"}}function pt(e,t,o={}){const n=o.size??"small",s=d=>c=>o.onDone?.(c!==!1,d),a=[],i=ko(t),r=t.openstation_update_available;if(e.extra.caps.update&&r?.available)if(r.package){const d=e.busy.updating.has(t.plugin),c=de(d?l("Updating…","desktop-mode"):v(l("Update to %s","desktop-mode"),r.new_version??""),"primary",n);d&&(c.setAttribute("disabled",""),c.setAttribute("aria-busy","true")),c.addEventListener("click",u=>{u.stopPropagation(),wo(e,t).then(s("update"))}),a.push(c)}else{const d=document.createElement("span");d.className="os-plugins__update-hint",d.textContent=l("Auto-update unavailable","desktop-mode"),d.title=l("This plugin does not ship a wp.org download package. Update it manually from its source.","desktop-mode"),a.push(d)}if(i.activate){const d=de(l("Activate","desktop-mode"),"primary",n);d.addEventListener("click",c=>{c.stopPropagation(),ht(e,t,"active",()=>Se(e,t)).then(s("activate"))}),a.push(d)}else if(i.deactivate){const d=de(l("Deactivate","desktop-mode"),"secondary",n);d.addEventListener("click",c=>{c.stopPropagation(),ht(e,t,"inactive",()=>_o(e,t)).then(s("deactivate"))}),a.push(d)}if(i.delete){const d=de(l("Delete","desktop-mode"),"danger",n);d.addEventListener("click",c=>{c.stopPropagation(),yo(e,t).then(s("delete"))}),a.push(d)}return a}async function ht(e,t,o,n){e.busy.optimistic.set(t.plugin,o),e.repaint();try{return await n()}finally{e.busy.optimistic.delete(t.plugin),e.repaint()}}async function wo(e,t){if(e.busy.updating.has(t.plugin))return!1;e.busy.updating.add(t.plugin),e.repaint();let o=!1;try{const n=await ct(()=>e.rest.updateInstalledPlugin(t));e.toast(v(l("%1$s updated to %2$s.","desktop-mode"),t.name||t.plugin,n.newVersion)),e.broadcastChange({plugin:t.plugin,action:"update"}),o=!0}catch(n){Co(n)?(e.toast(v(l("%s is already up to date.","desktop-mode"),t.name||t.plugin)),e.broadcastChange({plugin:t.plugin,action:"update"}),o=!0):e.toast(v(l("Update of %1$s failed: %2$s","desktop-mode"),t.name||t.plugin,R(n)),6e3)}finally{e.busy.updating.delete(t.plugin),e.refresh(),e.refreshMenu()}return o}function Co(e){if(e?.code==="up_to_date")return!0;const o=e?.message,n=window.wp?.i18n?.__?.("The plugin is at the latest version.");return!!n&&o===n}async function Eo(e,t){const o=t.openstation_auto_update;if(e.busy.autoUpdating.has(t.plugin)||!o||o.forced!==null||!o.supported)return;const n=o.enabled;e.busy.autoUpdating.add(t.plugin),e.repaint();try{await e.rest.toggleAutoUpdate(t,n?"disable":"enable"),e.toast(v(l(n?"Auto-updates disabled for %s.":"Auto-updates enabled for %s.","desktop-mode"),t.name||t.plugin)),e.broadcastChange({plugin:t.plugin,action:"auto-update"}),await e.refresh()}catch(s){e.toast(v(l("Could not toggle auto-updates for %1$s: %2$s","desktop-mode"),t.name||t.plugin,R(s)),6e3)}finally{e.busy.autoUpdating.delete(t.plugin),e.repaint()}}function Ao(e,t,o){const{caps:n}=e.extra,s=e.installed.filter(i=>t.includes(i.plugin)),a=[];if(n.update){const i=s.filter(r=>!!r.openstation_update_available?.available&&!!r.openstation_update_available.package);i.length>0&&a.push({label:v(l("Update %d","desktop-mode"),i.length),variant:"primary",run:()=>void So(e,i).then(o)})}if(n.activate){const i=s.filter(d=>d.status==="inactive");i.length>0&&a.push({label:l("Activate","desktop-mode"),variant:"primary",run:()=>void Ne(e,i,"activate").then(o)});const r=s.filter(d=>M(d.status));r.length>0&&a.push({label:l("Deactivate","desktop-mode"),variant:"secondary",run:()=>void Ne(e,r,"deactivate").then(o)})}if(n.delete){const i=s.filter(r=>r.status==="inactive");i.length>0&&a.push({label:l("Delete","desktop-mode"),variant:"danger",run:()=>void Ne(e,i,"delete").then(o)})}return a}async function Ne(e,t,o){const n=t.map(a=>a.plugin);if(await e.dispatch("bulk",{plugins:n,do:o},o==="delete"?{confirm:{title:l("Delete selected plugins?","desktop-mode"),message:v(l("Permanently delete %d plugin(s)? Their files will be removed from disk. This cannot be undone.","desktop-mode"),t.length),label:l("Delete","desktop-mode"),danger:!0}}:{})){if(o!=="activate"&&n.some(a=>Ee(e,a))){Ae(e,o==="delete");return}e.broadcastChange({action:"bulk"},n)}}async function So(e,t){let o=0,n=0;for(const a of t){e.busy.updating.add(a.plugin),e.repaint();try{await ct(()=>e.rest.updateInstalledPlugin(a)),o++}catch{n++}finally{e.busy.updating.delete(a.plugin)}}e.repaint(),o>0&&e.broadcastChange({action:"bulk"},t.map(a=>a.plugin)),e.refresh(),e.refreshMenu();const s=l("updated","desktop-mode");e.toast(n===0?v(l("%1$d plugin(s) %2$s.","desktop-mode"),o,s):v(l("%1$d %3$s, %2$d failed.","desktop-mode"),o,n,s),5e3)}const P=class P extends HTMLElement{constructor(){super(),this._renderScheduled=!1,this._propValues={},this.constructor.shadow?(this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot):this._renderRoot=this,this._installPropAccessors()}static get observedAttributes(){return this.props.map(gt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(t,o,n){if(o===n)return;const s=$o(t);this._propValues[s]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(t){if(t==null){this.removeAttribute("class");return}const n=(Array.isArray(t)?t:String(t).split(/\s+/)).map(s=>String(s).trim()).filter(s=>s!=="");this.className=n.join(" ")}requestUpdate(){this._scheduleRender()}emit(t,o){return this.dispatchEvent(new CustomEvent(t,{detail:o,bubbles:!0,composed:!0}))}_installPropAccessors(){const t=this.constructor;for(const o of t.props){if(Object.getOwnPropertyDescriptor(this,o))continue;const n=gt(o);Object.defineProperty(this,o,{get:()=>o in this._propValues?this._propValues[o]:this.getAttribute(n),set:s=>{let a;s==null||s===!1?a=null:s===!0?a="":a=String(s),this._propValues[o]=a,a===null?this.removeAttribute(n):this.setAttribute(n,a),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&tt(this.render(),this._renderRoot)}))}_adoptStyles(){const t=this.constructor;if(t.styles.length!==0)if(t.shadow&&this.shadowRoot){const o=t.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=o,o.length!==t.styles.length){for(const n of t.styles)if(!n.sheet){const s=document.createElement("style");s.textContent=n.cssText,this.shadowRoot.appendChild(s)}}}else this._adoptLightStyles(t)}_adoptLightStyles(t){if(!P._lightStylesAdopted.has(t)){P._lightStylesAdopted.add(t);for(const o of t.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=o.cssText,document.head.appendChild(n)}}}};P.props=[],P.styles=[],P.shadow=!0,P._lightStylesAdopted=new WeakSet;let S=P;function $(e,t){customElements.get(e)||customElements.define(e,t)}function gt(e){return e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function $o(e){return e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}const No=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function k(e,...t){let o=e[0];for(let n=1;n<e.length;n++){const s=t[n-1];if(typeof s=="string"||typeof s=="number")o+=String(s);else if(s&&s.__wpdCss)o+=s.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof s);o+=e[n]}if(No){const n=new CSSStyleSheet;return n.replaceSync(o),{__wpdCss:!0,sheet:n,cssText:o}}return{__wpdCss:!0,sheet:null,cssText:o}}const B=k`:host{--_holo-fill:var( --os-ui-holo-fill,${"linear-gradient( 124deg, #afa2e8 0%, #f5a8ea 46%, #8ee9f7 100% )"} );--_holo-ink:var( --os-ui-holo-ink,#0c0b0f );--_holo-sheen:var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) );--_holo-edge:var( --os-ui-holo-edge,linear-gradient( 124deg,rgba( 154,242,255,0.7 ) 0%,rgba( 236,155,255,0.85 ) 38%,rgba( 242,82,252,0.7 ) 62%,rgba( 159,152,255,0.6 ) 100% ) );--_holo-edge-quiet:var( --os-ui-holo-edge-quiet,linear-gradient( 124deg,rgba( 154,242,255,0.22 ) 0%,rgba( 236,155,255,0.28 ) 38%,rgba( 242,82,252,0.22 ) 62%,rgba( 159,152,255,0.2 ) 100% ) );--_holo-glow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) );--_holo-glow-strong:var( --os-ui-holo-glow-strong,0 0 0 1px rgba( 242,82,252,0.42 ),0 4px 18px rgba( 242,82,252,0.38 ),0 1px 3px rgba( 12,11,15,0.6 ) );--_holo-track:var( --os-ui-holo-track,rgba( 255,251,255,0.16 ) );--_holo-track-edge:var( --os-ui-holo-track-edge,#8c8f94 );--_holo-ring-color:var( --os-ui-accent-dim,#2271b1 );--_holo-focus:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #f252fc,0 0 12px 2px rgba( 242,82,252,0.45 ) );--_holo-focus-field:var( --os-ui-focus-ring-field,0 0 0 1px #f252fc,0 0 0 4px rgba( 242,82,252,0.18 ) );--_holo-t:var( --os-ui-holo-transition,220ms );--_holo-t-fast:var( --os-ui-motion-fast,140ms );--_holo-t-slow:var( --os-ui-motion-slow,340ms );--_holo-t-ambient:var( --os-ui-motion-ambient,12s );--_holo-spring:var( --os-ui-ease-spring,cubic-bezier( 0.32,1.5,0.55,1 ) );--_holo-ease:var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) );--_holo-loop:var( --os-ui-ease-loop,cubic-bezier( 0.45,0,0.55,1 ) )}`,Lo=k` .os-holo-fill{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --_holo-ink );transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease}.os-holo-fill:hover{background-position:74% 66%}.os-holo-fill:active{background-position:88% 82%;filter:brightness( 0.94 )}@media ( prefers-reduced-motion:reduce ){.os-holo-fill{transition-duration:1ms}.os-holo-fill:hover,.os-holo-fill:active{background-position:22% 28%}}`,To=k` .os-holo-sheen{position:relative;isolation:isolate}.os-holo-sheen::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background-image:var( --_holo-sheen );background-size:200% 200%;background-position:20% 30%;opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) ease,background-position var( --_holo-t ) ease}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{opacity:1;background-position:76% 68%}@media ( prefers-reduced-motion:reduce ){.os-holo-sheen::before{transition-duration:1ms}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{background-position:20% 30%}}`,zo=k` .os-holo-edge{position:relative}.os-holo-edge::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge-quiet );opacity:0;pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude;transition:opacity var( --_holo-t ) ease}.os-holo-edge:hover::after,.os-holo-edge:focus-visible::after{background-image:var( --_holo-edge );opacity:1}.os-holo-edge.is-lit::after{background-image:var( --_holo-edge );opacity:1}@media ( prefers-reduced-motion:reduce ){.os-holo-edge::after{transition-duration:1ms}}`,mt=k` .os-holo-glint{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}.os-holo-glint::before{content:'';position:absolute;top:-60%;bottom:-60%;width:45%;inset-inline-start:-60%;background:linear-gradient( 90deg,transparent 0%,rgba( 255,251,255,0.14 ) 45%,rgba( 255,251,255,0.22 ) 50%,rgba( 255,251,255,0.14 ) 55%,transparent 100% );transform:rotate( 18deg ) translateX( 0 );opacity:0}:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:os-holo-glint var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-glint{0%{opacity:0;transform:rotate( 18deg ) translateX( 0 )}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:rotate( 18deg ) translateX( 240vw )}}@media ( prefers-reduced-motion:reduce ){:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:none}}`,Po=k` .os-holo-ring{position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 var( --_holo-ring-color );opacity:0;pointer-events:none}:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:os-holo-ring var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-ring{0%{opacity:0.45;box-shadow:0 0 0 0 var( --_holo-ring-color )}100%{opacity:0;box-shadow:0 0 0 10px transparent}}@media ( prefers-reduced-motion:reduce ){:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:none}}`,Mo=k` .os-holo-shimmer{background-image:var( --_holo-fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}@keyframes os-holo-shimmer{0%{background-position:0% 50%}100%{background-position:100% 50%}}@media ( prefers-reduced-motion:reduce ){.os-holo-shimmer{animation:none;background-position:30% 50%}}`,Do=k` .os-holo-enter{animation:os-holo-enter var( --_holo-t ) var( --_holo-spring )}@keyframes os-holo-enter{from{opacity:0;transform:scale( 0.96 )}}@media ( prefers-reduced-motion:reduce ){.os-holo-enter{animation:none}}`,qo=k` input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):hover:not(:disabled ),select:hover:not(:disabled ),textarea:hover:not(:disabled ){border-color:var( --os-ui-border-strong,#8c8f94 )}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus,input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}input::placeholder,textarea::placeholder{color:var( --os-ui-fg-faint,#8c8f94 );opacity:1}input::selection,textarea::selection{background:var( --os-ui-selection-bg,rgba( 159,152,255,0.6 ) );color:var( --os-ui-selection-fg,#fffbff )}@media ( prefers-reduced-motion:reduce ){input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition-duration:1ms}}`,Io=k` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-fg-on-accent,#fff );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,Ro=k` @keyframes os-holo-drift{0%{background-position:16% 26%}50%{background-position:84% 74%}100%{background-position:16% 26%}}.os-holo-alive{animation:os-holo-drift var( --_holo-t-ambient ) var( --_holo-loop ) infinite}@media ( prefers-reduced-motion:reduce ){.os-holo-alive{animation:none}}`;k` ${B} ${Lo} ${To} ${zo} ${mt} ${Po} ${Mo} ${Do} ${qo} ${Io} ${Ro} `;const Uo=k` ${B} ${mt}:host(:not( [ interactive ] ) ) .os-holo-glint,:host( [ disabled ] ) .os-holo-glint{display:none}:host{display:flex;flex-direction:column;position:relative;gap:var( --os-ui-card-gap,12px );padding:var( --os-ui-card-padding,16px );border:1px solid var( --os-ui-card-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );border-radius:var( --os-ui-card-radius,12px );background:var( --os-ui-card-bg,var( --os-ui-surface,#fff ) );background-image:var( --os-ui-panel-bg-image,none );background-repeat:var( --os-ui-panel-bg-image-repeat,repeat );background-size:var( --os-ui-panel-bg-image-size,auto );background-position:var( --os-ui-panel-bg-image-position,center );color:var( --os-ui-card-fg,inherit );box-sizing:border-box;min-width:0;transition:transform 180ms ease,box-shadow 180ms ease,border-color 180ms ease}:host( [ hidden ] ){display:none}:host( [ compact ] ){padding:var( --os-ui-card-padding-compact,10px );gap:var( --os-ui-card-gap-compact,6px );border-radius:var( --os-ui-card-radius-compact,8px )}:host( [ interactive ] ){cursor:pointer;outline-offset:2px}:host( [ interactive ]:hover ),:host( [ interactive ]:focus-visible ){transform:translateY( -2px );box-shadow:var( --os-ui-card-shadow-hover,0 4px 16px rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-card-border-hover,var( --os-ui-border-strong,rgba( 0,0,0,0.16 ) ) )}:host( [ interactive ]:focus-visible ){outline:none;box-shadow:var( --_holo-focus )}:host( [ selected ] ){border-color:var( --os-ui-card-border-selected,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --os-ui-card-shadow-selected,0 0 0 1px var( --wp-admin-theme-color,#2271b1 ) inset )}:host( [ selected ] )::after{content:'';position:absolute;inset:-1px;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}:host( [ disabled ] ){opacity:0.55;pointer-events:none;cursor:not-allowed}@media ( prefers-reduced-motion:reduce ){:host{transition:none}:host( [ interactive ]:hover ),:host( [ interactive ]:focus-visible ){transform:none}}::slotted( header ){display:flex;align-items:center;gap:12px;min-width:0}::slotted( footer ){display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}`,ft="[data-noclick]",Z=class Z extends S{constructor(){super(...arguments),this._onClick=t=>{!this.hasAttribute("interactive")||this.hasAttribute("disabled")||t.target?.closest(ft)||this._emitCardClick(t)},this._onKeyDown=t=>{if(!this.hasAttribute("interactive")||this.hasAttribute("disabled")||t.key!=="Enter"&&t.key!==" "&&t.key!=="Spacebar")return;const o=t.target;o&&o!==this&&o.closest(ft)||o instanceof HTMLElement&&o!==this&&(o.tagName==="BUTTON"||o.tagName==="A"||o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT")||(t.preventDefault(),this._emitCardClick(t))}}connectedCallback(){super.connectedCallback(),this._syncRoles(),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown)}render(){return this._syncRoles(),_`<span class="os-holo-glint" aria-hidden="true"></span
14 - ><slot name="header"></slot><slot></slot><slot name="footer"></slot>`}_syncRoles(){const t=this.hasAttribute("interactive"),o=this.hasAttribute("disabled");t?(this.hasAttribute("role")||this.setAttribute("role","button"),this.setAttribute("tabindex",o?"-1":"0"),this.setAttribute("aria-disabled",o?"true":"false")):(this.removeAttribute("role"),this.removeAttribute("tabindex"),this.removeAttribute("aria-disabled"))}_emitCardClick(t){this.dispatchEvent(new CustomEvent("os-card-click",{detail:{originalEvent:t},bubbles:!0,composed:!0}))}};Z.props=["interactive","selected","compact","disabled"],Z.styles=[Uo],Z.help=void 0;let Le=Z;$("os-card",Le);const Ho=new Set(["A","ABBR","B","BLOCKQUOTE","BR","CODE","DD","DEL","DIV","DL","DT","EM","FIGCAPTION","FIGURE","H1","H2","H3","H4","H5","H6","HR","I","IMG","KBD","LI","OL","P","PRE","Q","S","SMALL","SPAN","STRONG","SUB","SUP","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","U","UL"]),jo=new Set(["href","src","alt","title","name","rel","target","colspan","rowspan"]),Te="noopener noreferrer";function ce(e){return new DOMParser().parseFromString(`<body>${e}</body>`,"text/html").body}function Fo(e){const o=Array.from(e).filter(n=>n.charCodeAt(0)>32).join("").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/);return o?["http","https","mailto","tel"].includes(o[1]):!0}function bt(e){const t=ce(e),o=[];for(const n of Array.from(t.querySelectorAll("*"))){if(!Ho.has(n.tagName)){o.push(n);continue}for(const s of Array.from(n.attributes))jo.has(s.name.toLowerCase())||n.removeAttribute(s.name);for(const s of["href","src"]){const a=n.getAttribute(s)??"";a&&!Fo(a)&&n.removeAttribute(s)}}for(const n of o.reverse())n.replaceWith(t.ownerDocument.createTextNode(n.textContent??""));return t.innerHTML}function z(e){return e?ce(e).textContent??"":""}function vt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ze(e,t){const o=document.createElement("div");return o.className=t,o.innerHTML=bt(e),_t(o),o}function _t(e){e.querySelectorAll("a").forEach(t=>{t.setAttribute("target","_blank"),t.setAttribute("rel",Te),t.setAttribute("data-noclick","")})}function V(e,t,o=""){const n=document.createElement("a");return n.href=e,n.target="_blank",n.rel=Te,n.textContent=t,o&&(n.className=o),n.setAttribute("data-noclick",""),n}function U(e,t,o,n){const s=document.createElement("os-button");return s.setAttribute("variant",e),s.setAttribute("size",n),s.textContent=t,s.setAttribute("data-noclick",""),s.addEventListener("click",()=>{window.open(o,"_blank",Te.replace(" ",","))}),s}function D(e=""){const t=document.createElement("span");return t.className=`dashicons dashicons-admin-plugins${e?" "+e:""}`,t.setAttribute("aria-hidden","true"),t}function ue(e,t=""){return`https://wordpress.org/plugins/${encodeURIComponent(e)}/${t}`}function Bo(e,t,o){const n=document.createElement("os-card");n.classList.add("os-plugins__card"),n.setAttribute("interactive",""),n.dataset.slug=e.slug,n.setAttribute("aria-label",v(l("View details for %s","desktop-mode"),e.name));const s=document.createElement("header");s.className="os-plugins__card-header",s.setAttribute("slot","header");const a=document.createElement("div");a.className="os-plugins__card-icon";const i=he(e.icons);if(i){const m=document.createElement("img");m.src=i,m.alt="",m.loading="lazy",m.decoding="async",m.addEventListener("load",()=>m.classList.add("is-loaded")),m.addEventListener("error",()=>{a.replaceChildren(D("os-plugins__card-icon-fallback"))}),a.appendChild(m)}else a.appendChild(D("os-plugins__card-icon-fallback"));const r=document.createElement("div");r.className="os-plugins__card-titleblock";const d=document.createElement("h3");d.className="os-plugins__card-title",d.textContent=ke(e.name);const c=document.createElement("p");c.className="os-plugins__card-byline",c.textContent=v(l("by %s","desktop-mode"),z(e.author??"")),r.append(d,c),s.append(a,r);const u=document.createElement("p");u.className="os-plugins__card-desc",u.textContent=ke(e.short_description??"");const p=document.createElement("footer");p.className="os-plugins__card-footer",p.setAttribute("slot","footer");const h=document.createElement("div");h.className="os-plugins__card-meta",h.appendChild(pe(e.rating??0,e.num_ratings??0));const b=document.createElement("span");return b.className="os-plugins__card-installs",b.textContent=Oo(e.active_installs??0),h.appendChild(b),p.append(h,yt(e,t,o,n)),n.append(s,u,p),n.addEventListener("os-card-click",()=>{o.onOpen(e.slug,e)}),n}function Vo(e,t,o,n){const s=e.querySelector(".os-plugins__card-footer");s&&(s.querySelector("[data-plugin-card-cta]")?.remove(),s.appendChild(yt(t,o,n,e)))}function yt(e,t,o,n){const s=t.get(e.slug),a=document.createElement("os-button");return a.setAttribute("data-plugin-card-cta",""),a.setAttribute("data-noclick",""),s?M(s.status)?(a.setAttribute("variant","ghost"),a.setAttribute("disabled",""),a.textContent=l("Active","desktop-mode")):(a.setAttribute("variant","primary"),a.textContent=l("Activate","desktop-mode"),a.addEventListener("click",i=>{i.stopPropagation(),o.onActivate(s,n)})):(a.setAttribute("variant","primary"),a.textContent=l("Install","desktop-mode"),a.addEventListener("click",i=>{i.stopPropagation(),o.onInstall(e,n)})),a}function pe(e,t){const o=document.createElement("span");o.className="os-plugins__stars";const n=Math.max(0,Math.min(5,e/100*5));o.setAttribute("aria-label",v(l("Rated %s out of 5","desktop-mode"),n.toFixed(1)));const s=Math.floor(n),a=n-s>=.5?1:0,i=[...Array(s).fill("dashicons-star-filled"),...Array(a).fill("dashicons-star-half"),...Array(5-s-a).fill("dashicons-star-empty")];for(const r of i){const d=document.createElement("span");d.className="os-plugins__star",d.setAttribute("aria-hidden","true");const c=document.createElement("span");c.className=`dashicons ${r}`,d.appendChild(c),o.appendChild(d)}if(t>0){const r=document.createElement("span");r.className="os-plugins__stars-count",r.textContent=`(${xt(t)})`,o.appendChild(r)}return o}function he(e){return e?e.svg??e[256]??e["256x256"]??e[128]??e["128x128"]??e["2x"]??e["1x"]??e.default??Object.values(e)[0]??null:null}function Oo(e){if(e<=0)return l("Fewer than 10 active","desktop-mode");if(e>=1e6)return v(l("%d+ million active","desktop-mode"),Math.floor(e/1e6));const t=e>=1e3?Wo(e):e;return v(l("%s+ active","desktop-mode"),xt(t))}function Wo(e){const t=Math.pow(10,Math.floor(Math.log10(e))-2);return Math.floor(e/t)*t}function xt(e){try{return new Intl.NumberFormat().format(e)}catch{return String(e)}}function Pe(){const e=document.createElement("os-card");e.classList.add("os-plugins__card","os-plugins__card--skeleton"),e.setAttribute("aria-hidden","true");for(let t=0;t<4;t++){const o=document.createElement("span");o.className="os-plugins__skeleton-line",o.style.width=`${50+t*17%50}%`,e.appendChild(o)}return e}function Zo(e,t){e.dataset.dragWired!=="1"&&(e.dataset.dragWired="1",e.addEventListener("pointerdown",o=>{const n=window.wp?.os?.dragManager;n&&(o.target?.closest("[data-plugin-card-cta]")||n.start({payload:{type:"wporg-plugin",source:e,data:{slug:t.slug,name:t.name,iconUrl:he(t.icons)??null,homepage:t.homepage??"",authorName:z(t.author??""),shortDescription:t.short_description??""},ghost:Xo(t,e,o)},origin:o,onClickOnly:()=>{}}))}))}function Ko(){const e=window.wp?.os,t=e?.dragManager,o=Go();if(!e||!t||!o)return()=>{};const n=t.registerDropTarget({id:"desktop-mode-plugins/dock",element:o,accept:s=>s.type==="wporg-plugin",onEnter:()=>{o.setAttribute("data-plugins-card-drop-active","")},onLeave:()=>{o.removeAttribute("data-plugins-card-drop-active")},onDrop:s=>{o.removeAttribute("data-plugins-card-drop-active");const a=s.payload.data,i=String(a.slug??"");if(!i)return;const r=String(a.name??i),d=typeof a.iconUrl=="string"&&a.iconUrl?a.iconUrl:"dashicons-admin-plugins",c=String(a.homepage??""),u=c!==""?c:ue(i);e.registerSystemTile({id:`wporg-plugin-${i}`,title:r,icon:d,onOpen:()=>{window.open(u,"_blank","noopener,noreferrer")}}),e.showToast({message:v(l("Pinned %s to the dock.","desktop-mode"),r),duration:3500})}});return()=>{try{n()}catch{}}}function Go(){return document.querySelector(".os-bottom-dock")??document.querySelector(".os-dock")??document.querySelector("[data-os-dock]")}function Xo(e,t,o){const n=t.getBoundingClientRect(),s=document.createElement("div");s.className="os-plugins__drag-ghost";const a=he(e.icons);if(a){const r=document.createElement("img");r.src=a,r.alt="",s.appendChild(r)}else s.appendChild(D("os-plugins__drag-ghost-fallback"));const i=document.createElement("span");return i.textContent=e.name,s.appendChild(i),{offsetX:o.clientX-n.left,offsetY:o.clientY-n.top,element:s}}const Qo=k`:host{position:absolute;width:var( --os-ui-ribbon-size,90px );height:var( --os-ui-ribbon-size,90px );overflow:hidden;pointer-events:none;z-index:var( --os-ui-ribbon-z,2 )}:host( [ hidden ] ){display:none}.banner{position:absolute;display:block;width:var( --os-ui-ribbon-banner-width,140px );padding:var( --os-ui-ribbon-padding,4px 0 );text-align:center;font:var( --os-ui-ribbon-font,700 10px/1.4 var( --os-font,system-ui ) );letter-spacing:var( --os-ui-ribbon-tracking,0.06em );text-transform:uppercase;color:var( --os-ui-ribbon-fg,var( --os-ui-fg-on-accent,#fff ) );background:var( --os-ui-ribbon-bg,var( --wp-admin-theme-color,#2271b1 ) );background-size:260% 260%;background-position:30% 40%;box-shadow:var( --os-ui-ribbon-shadow,0 2px 4px rgba( 0,0,0,0.2 ) )}:host(:not( [ placement ] ) ),:host( [ placement='top-end' ] ){inset-block-start:0;inset-inline-end:0}:host(:not( [ placement ] ) ) .banner,:host( [ placement='top-end' ] ) .banner{inset-block-start:var( --os-ui-ribbon-banner-offset,20px );inset-inline-end:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( 45deg )}:host( [ placement='top-start' ] ){inset-block-start:0;inset-inline-start:0}:host( [ placement='top-start' ] ) .banner{inset-block-start:var( --os-ui-ribbon-banner-offset,20px );inset-inline-start:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( -45deg )}:host( [ placement='bottom-end' ] ){inset-block-end:0;inset-inline-end:0}:host( [ placement='bottom-end' ] ) .banner{inset-block-end:var( --os-ui-ribbon-banner-offset,20px );inset-inline-end:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( -45deg )}:host( [ placement='bottom-start' ] ){inset-block-end:0;inset-inline-start:0}:host( [ placement='bottom-start' ] ) .banner{inset-block-end:var( --os-ui-ribbon-banner-offset,20px );inset-inline-start:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host(:not( [ placement ] ) ) .banner,:host-context( [ dir='rtl' ] ):host( [ placement='top-end' ] ) .banner{transform:rotate( -45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='top-start' ] ) .banner{transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='bottom-end' ] ) .banner{transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='bottom-start' ] ) .banner{transform:rotate( -45deg )}:host( [ tone='success' ] ) .banner{background:var( --os-ui-ribbon-success,var( --os-ui-success-fg,#1a7f37 ) )}:host( [ tone='warning' ] ) .banner{background:var( --os-ui-ribbon-warning,var( --os-ui-warning-bg,#9a6700 ) )}:host( [ tone='danger' ] ) .banner{background:var( --os-ui-ribbon-danger,var( --os-ui-danger,#cf222e ) )}:host( [ tone='info' ] ) .banner{background:var( --os-ui-ribbon-info,var( --os-ui-info-bg,#0969da ) )}:host( [ tone='neutral' ] ) .banner{background:var( --os-ui-ribbon-neutral,var( --os-ui-surface,#57606a ) )}`,K=class K extends S{render(){return _`<span class="banner" part="banner"><slot></slot></span>`}};K.props=["placement","tone"],K.styles=[Qo],K.help=void 0;let Me=K;$("os-ribbon",Me);const kt={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 wt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Yo(e){return Object.prototype.hasOwnProperty.call(kt,e)?kt[e]:null}function De(e,t={}){const o=Yo(e);if(!o)return"";const{size:n=24,className:s,title:a,rotate:i}=t,r=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];n!=null&&r.push(`width="${n}"`,`height="${n}"`),r.push(o.a),s&&r.push(`class="${wt(s)}"`),a?r.push('role="img"',`aria-label="${wt(a)}"`):r.push('aria-hidden="true"','focusable="false"');const d=i?`<g transform="rotate(${i} 12 12)">${o.b}</g>`:o.b;return`<svg ${r.join(" ")}>${d}</svg>`}function Jo(e,t={}){const o=De(e,t),n=document.createElement("div");n.innerHTML=o;const s=n.firstElementChild;return s instanceof SVGSVGElement?s:document.createElementNS("http://www.w3.org/2000/svg","svg")}const en=k`:host{display:flex;gap:4px;margin-bottom:10px;border-bottom:1px solid var( --os-ui-border,#dcdcde )}:host( [ orientation='vertical' ] ){flex-direction:column;align-items:stretch;gap:0;margin-bottom:0;border-bottom:0}`,tn=k`:host{display:block}:host( [ hidden ] ){display:none}:host(:focus-visible ){outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px;border-radius:4px}`,on=k` ${B}:host{display:inline-block}:host( [ data-orientation='vertical' ] ){display:block;--_tab-edge:var( --os-ui-tab-edge,linear-gradient( var( --os-ui-accent,#f252fc ),var( --os-ui-accent,#f252fc ) ) );--_tab-wash:var( --os-ui-tab-wash,linear-gradient( 90deg,rgba( 242,82,252,0.16 ) 0%,rgba( 255,251,255,0.04 ) 42%,transparent 100% ) );--_tab-bloom:var( --os-ui-tab-bloom,linear-gradient( 90deg,rgba( 242,82,252,0.26 ),transparent ) )}:host( [ data-orientation='vertical' ] ) button{display:flex;align-items:center;gap:11px;isolation:isolate;width:100%;min-height:40px;padding:0 14px 0 20px;margin-bottom:0;border-radius:0;text-align:start;font-size:14px;font-weight:400;line-height:1.5;white-space:nowrap}:host( [ data-orientation='vertical' ] ) slot::slotted( svg ){flex:0 0 17px;width:17px;height:17px;opacity:0.8;transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button:hover slot::slotted( svg ),:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) slot::slotted( svg ){opacity:1}:host( [ data-orientation='vertical' ] ) button::after{inset-inline:0 auto;inset-block:0;z-index:-1;width:2px;height:auto;border-radius:0;background-image:var( --_tab-edge );transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button::before{content:'';position:absolute;inset-inline:0 auto;inset-block:0;z-index:-1;width:44px;background-image:var( --_tab-bloom );filter:blur( 8px );opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button:hover::after{inset-inline:0 auto;opacity:0}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button{background-image:var( --_tab-wash );font-weight:400}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button::after,:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button:hover::after{inset-inline:0 auto;opacity:1}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button::before{opacity:1}@media ( prefers-reduced-motion:reduce ){:host( [ data-orientation='vertical' ] ) button::before,:host( [ data-orientation='vertical' ] ) slot::slotted( svg ){transition-duration:1ms}}button{appearance:none;position:relative;padding:6px 10px 8px;border:none;background:transparent;color:var( --os-ui-fg-muted,#50575e );font:inherit;font-size:12px;font-weight:500;cursor:pointer;margin-bottom:-1px;transition:color var( --_holo-t ) ease}button::after{content:'';position:absolute;inset-inline:50%;bottom:0;height:2px;border-radius:2px 2px 0 0;background-image:linear-gradient( var( --os-ui-accent,#2271b1 ),var( --os-ui-accent,#2271b1 ) );background-size:100% 100%;opacity:0;transition:inset-inline var( --_holo-t ) ease,opacity var( --_holo-t ) ease}button:hover{color:var( --os-ui-fg,#1d2327 )}button:hover::after{inset-inline:30%;opacity:0.45}button:focus-visible{outline:none;box-shadow:var( --_holo-focus );border-radius:4px}:host( [ aria-selected='true' ] ) button{color:var( --os-ui-fg,#1d2327 );font-weight:600}:host( [ aria-selected='true' ] ) button::after,:host( [ aria-selected='true' ] ) button:hover::after{inset-inline:0;opacity:1}@media ( prefers-reduced-motion:reduce ){button::after{transition-duration:1ms}}`,G=class G extends S{render(){return this.setAttribute("role","tab"),_`
9 + os-bind=${o.bind}
10 + os-action=${o.action}
11 + value=${o.value}
12 + label=${o.label}
13 + >${o.segments.map(t=>f`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function Fo(o,e){const t=e.local??{},s={id:o,hasLocal:a=>Object.prototype.hasOwnProperty.call(t,a),runLocal:(a,r,l,c)=>{const p=t[a];if(!p)return r;const u={...r},g=p(u,l,c);return g===void 0?u:g},render:a=>{W(e.view(a),a.root),e.updated?.(a)},mounted:a=>e.mounted?.(a)},{placeholder:n}=e;n&&(s.placeholder=a=>n(a));const i=window;return(i.openStationApps??(i.openStationApps={}))[o]=s,s}function Pe(o){const e=document.createElement("textarea");return e.innerHTML=o,e.value}`${btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="6" stroke-linejoin="round"><rect x="6" y="6" width="27" height="27" rx="5"/><rect x="43" y="6" width="15" height="15" rx="5"/><rect x="43" y="31" width="15" height="27" rx="5"/><rect x="6" y="43" width="27" height="15" rx="5"/></svg>')}`,`${btoa('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="6" stroke-linecap="round"><path d="M10 22h44M10 42h44"/><circle cx="24" cy="22" r="7" fill="currentColor" stroke="none"/><circle cx="42" cy="42" r="7" fill="currentColor" stroke="none"/></svg>')}`;function Vo(o){try{(window.top??window).location.assign(o)}catch{window.location.assign(o)}}const Wo=800;function jo(o,e=Wo){window.setTimeout(()=>{if(o){Vo(o);return}try{(window.top??window).location.reload()}catch{window.location.reload()}},e)}const Et="os.plugin.changed",St="plugins-app";function qe(o){return o.textdomain||o.plugin}function N(o){return o==="active"||o==="network-active"}function I(o){return o instanceof Error?o.message:String(o)}function De(o){return o.endsWith(".php")?o:o+".php"}function Oo(o){let e=4294967295;for(let t=0;t<o.length;t++){e^=o.charCodeAt(t)&255;for(let s=0;s<8;s++)e=e&1?e>>>1^3988292384:e>>>1}return Math.max(1,(e^4294967295)>>>0)}function Me(o,e){if(!o.rest.isOpenStationSelf(e))return!1;const t=o.installed.find(s=>s.plugin===e);return!t||!N(t.status)}function Ie(o,e){o.toast(d(e?"OpenStation deleted. Reloading…":"OpenStation deactivated. Reloading…","desktop-mode"),2e3),jo(o.extra.adminUrl??"")}async function $t(o,e){if(!e.some(s=>o.rest.isOpenStationSelf(s)))return;const t=o.extra.deactivationFeedback;if(t)try{const s=window.wp?.os;let n=s?.deactivationFeedback??window.openStationDeactivationFeedback;if(!n&&t.script.url&&typeof s?.loadVendorScript=="function"&&(await s.loadVendorScript(t.script.url,{handle:"os-deactivation-feedback",translations:t.script.translations}),n=s.deactivationFeedback??window.openStationDeactivationFeedback),!n)return;await n.ask({plugin:o.extra.selfPluginFile+".php",restUrl:t.restUrl,restNonce:"",context:"app",styleUrl:t.styleUrl})}catch{}}async function He(o,e){const t=await o.dispatch("activate",{plugin:e.plugin});return t&&o.broadcastChange({plugin:e.plugin,action:"activate"}),t}async function Bo(o,e){return await $t(o,[e.plugin]),await o.dispatch("deactivate",{plugin:e.plugin})?Me(o,e.plugin)?(Ie(o,!1),!0):(o.broadcastChange({plugin:e.plugin,action:"deactivate"}),!0):!1}async function Ko(o,e){return await o.dispatch("delete",{plugin:e.plugin},{confirm:{title:d("Delete plugin?","desktop-mode"),message:y(d("Permanently delete %s? Its files will be removed from disk. This cannot be undone.","desktop-mode"),e.name||e.plugin),label:d("Delete","desktop-mode"),danger:!0}})?Me(o,e.plugin)?(Ie(o,!0),!0):(o.broadcastChange({plugin:e.plugin,action:"delete"}),!0):!1}async function zt(o,e,t){try{await o.rest.installPluginBySlug(e)}catch(s){return o.toast(y(d("Install failed: %s","desktop-mode"),I(s)),6e3),!1}return await o.refresh(),o.toast(y(d("Installed %s.","desktop-mode"),Pe(t))),o.broadcastChange({plugin:e,action:"install"}),o.refreshMenu(),!0}const Zo=6e4,Nt=[];let Ue=!1;function Go(o,e=Zo){return new Promise((t,s)=>{Nt.push({run:o,resolve:t,reject:s,timeoutMs:e}),Lt()})}async function Lt(){if(Ue)return;const o=Nt.shift();if(!o)return;Ue=!0;let e=null;try{const t=new Promise((n,i)=>{e=setTimeout(()=>{i(new Error("Update request timed out"))},o.timeoutMs)}),s=await Promise.race([o.run(),t]);o.resolve(s)}catch(t){o.reject(t)}finally{e!==null&&clearTimeout(e),Ue=!1,Promise.resolve().then(Lt)}}const Yo=()=>({updating:new Set,autoUpdating:new Set,optimistic:new Map});function ke(o,e,t="small"){const s=document.createElement("os-button");return s.setAttribute("variant",e),t&&s.setAttribute("size",t),s.textContent=o,s}function O(o,e){if(!o)return()=>{};const t=o.textContent??"";return o.setAttribute("busy",""),o.setAttribute("disabled",""),o.setAttribute("aria-busy","true"),e!==void 0&&(o.textContent=e),()=>{o.removeAttribute("busy"),o.removeAttribute("disabled"),o.removeAttribute("aria-busy"),o.textContent=t}}function xe(o){return o.openstation_can_manage??{activate:o.status==="inactive",deactivate:N(o.status),delete:o.status==="inactive"}}function Tt(o,e,t={}){const s=t.size??"small",n=l=>c=>t.onDone?.(c!==!1,l),i=[],a=xe(e),r=e.openstation_update_available;if(o.extra.caps.update&&r?.available)if(r.package){const l=o.busy.updating.has(e.plugin),c=ke(d(l?"Updating…":"Update","desktop-mode"),"primary",s);l&&(c.setAttribute("disabled",""),c.setAttribute("aria-busy","true")),c.addEventListener("click",p=>{p.stopPropagation(),Xo(o,e).then(n("update"))}),i.push(c)}else{const l=document.createElement("span");l.className="os-plugins__update-hint",l.textContent=d("Auto-update unavailable","desktop-mode"),l.title=d("This plugin does not ship a wp.org download package. Update it manually from its source.","desktop-mode"),i.push(l)}if(o.extra.caps.activate&&a.activate){const l=ke(d("Activate","desktop-mode"),"primary",s);l.addEventListener("click",c=>{c.stopPropagation(),Rt(o,e,"active",()=>He(o,e)).then(n("activate"))}),i.push(l)}else if(o.extra.caps.activate&&a.deactivate){const l=ke(d("Deactivate","desktop-mode"),"secondary",s);l.addEventListener("click",c=>{c.stopPropagation(),Rt(o,e,"inactive",()=>Bo(o,e)).then(n("deactivate"))}),i.push(l)}if(o.extra.caps.delete&&a.delete){const l=ke(d("Delete","desktop-mode"),"danger",s);l.addEventListener("click",c=>{c.stopPropagation(),Ko(o,e).then(n("delete"))}),i.push(l)}return i}async function Rt(o,e,t,s){o.busy.optimistic.set(e.plugin,t),o.repaint();try{return await s()}finally{o.busy.optimistic.delete(e.plugin),o.repaint()}}async function Pt(o,e){return Go(async()=>{try{return await o.rest.updateInstalledPlugin(e)}finally{await o.refresh()}})}async function Xo(o,e){if(o.busy.updating.has(e.plugin))return!1;o.busy.updating.add(e.plugin),o.repaint();let t=!1;try{const s=await Pt(o,e);o.toast(y(d("%1$s updated to %2$s.","desktop-mode"),e.name||e.plugin,s.newVersion)),o.broadcastChange({plugin:e.plugin,action:"update"}),t=!0}catch(s){Qo(s)?(o.toast(y(d("%s is already up to date.","desktop-mode"),e.name||e.plugin)),o.broadcastChange({plugin:e.plugin,action:"update"}),t=!0):o.toast(y(d("Update of %1$s failed: %2$s","desktop-mode"),e.name||e.plugin,I(s)),6e3)}finally{o.busy.updating.delete(e.plugin),o.repaint(),o.refreshMenu()}return t}function Qo(o){if(o?.code==="up_to_date")return!0;const t=o?.message,s=window.wp?.i18n?.__?.("The plugin is at the latest version.");return!!s&&t===s}async function Jo(o,e){const t=e.openstation_auto_update;if(o.busy.autoUpdating.has(e.plugin)||!t||t.forced!==null||!t.supported)return;const s=t.enabled;o.busy.autoUpdating.add(e.plugin),o.repaint();try{await o.rest.toggleAutoUpdate(e,s?"disable":"enable"),o.toast(y(d(s?"Auto-updates disabled for %s.":"Auto-updates enabled for %s.","desktop-mode"),e.name||e.plugin)),o.broadcastChange({plugin:e.plugin,action:"auto-update"}),await o.refresh()}catch(n){o.toast(y(d("Could not toggle auto-updates for %1$s: %2$s","desktop-mode"),e.name||e.plugin,I(n)),6e3)}finally{o.busy.autoUpdating.delete(e.plugin),o.repaint()}}function es(o,e,t){const{caps:s}=o.extra,n=o.installed.filter(a=>e.includes(a.plugin)),i=[];if(s.update){const a=n.filter(r=>!!r.openstation_update_available?.available&&!!r.openstation_update_available.package);a.length>0&&i.push({label:y(d("Update %d","desktop-mode"),a.length),variant:"primary",run:()=>void ts(o,a).then(t)})}if(s.activate){const a=n.filter(l=>l.status==="inactive"&&xe(l).activate);a.length>0&&i.push({label:d("Activate","desktop-mode"),variant:"primary",run:()=>void Fe(o,a,"activate").then(t)});const r=n.filter(l=>N(l.status)&&xe(l).deactivate);r.length>0&&i.push({label:d("Deactivate","desktop-mode"),variant:"secondary",run:()=>void Fe(o,r,"deactivate").then(t)})}if(s.delete){const a=n.filter(r=>r.status==="inactive"&&xe(r).delete);a.length>0&&i.push({label:d("Delete","desktop-mode"),variant:"danger",run:()=>void Fe(o,a,"delete").then(t)})}return i}async function Fe(o,e,t){const s=e.map(i=>i.plugin);if(t==="deactivate"&&await $t(o,s),!!await o.dispatch("bulk",{plugins:s,do:t},t==="delete"?{confirm:{title:d("Delete selected plugins?","desktop-mode"),message:y(d("Permanently delete %d plugin(s)? Their files will be removed from disk. This cannot be undone.","desktop-mode"),e.length),label:d("Delete","desktop-mode"),danger:!0}}:{})){if(t!=="activate"&&s.some(i=>Me(o,i))){Ie(o,t==="delete");return}o.broadcastChange({action:"bulk"},s)}}async function ts(o,e){let t=0,s=0;for(const i of e){o.busy.updating.add(i.plugin),o.repaint();try{await Pt(o,i),t++}catch{s++}finally{o.busy.updating.delete(i.plugin),o.repaint()}}t>0&&o.broadcastChange({action:"bulk"},e.map(i=>i.plugin)),o.refreshMenu();const n=d("updated","desktop-mode");o.toast(s===0?y(d("%1$d plugin(s) %2$s.","desktop-mode"),t,n):y(d("%1$d %3$s, %2$d failed.","desktop-mode"),t,s,n),5e3)}const q=class q extends HTMLElement{constructor(){super(),this._renderScheduled=!1,this._propValues={},this.constructor.shadow?(this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot):this._renderRoot=this,this._installPropAccessors()}static get observedAttributes(){return this.props.map(qt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,s){if(t===s)return;const n=os(e);this._propValues[n]=s,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const s=(Array.isArray(e)?e:String(e).split(/\s+/)).map(n=>String(n).trim()).filter(n=>n!=="");this.className=s.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const t of e.props){if(Object.getOwnPropertyDescriptor(this,t))continue;const s=qt(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(s),set:n=>{let i;n==null||n===!1?i=null:n===!0?i="":i=String(n),this._propValues[t]=i,i===null?this.removeAttribute(s):this.setAttribute(s,i),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&W(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(s=>s.sheet).filter(s=>s!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const s of e.styles)if(!s.sheet){const n=document.createElement("style");n.textContent=s.cssText,this.shadowRoot.appendChild(n)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!q._lightStylesAdopted.has(e)){q._lightStylesAdopted.add(e);for(const t of e.styles){const s=document.createElement("style");s.dataset.osUi=this.tagName.toLowerCase(),s.textContent=t.cssText,document.head.appendChild(s)}}}};q.props=[],q.styles=[],q.shadow=!0,q._lightStylesAdopted=new WeakSet;let C=q;function E(o,e){customElements.get(o)||customElements.define(o,e)}function qt(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function os(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const ss=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function k(o,...e){let t=o[0];for(let s=1;s<o.length;s++){const n=e[s-1];if(typeof n=="string"||typeof n=="number")t+=String(n);else if(n&&n.__wpdCss)t+=n.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof n);t+=o[s]}if(ss){const s=new CSSStyleSheet;return s.replaceSync(t),{__wpdCss:!0,sheet:s,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}const T=k`:host{--_holo-fill:var( --os-ui-holo-fill,${"linear-gradient( 124deg, #afa2e8 0%, #f5a8ea 46%, #8ee9f7 100% )"} );--_holo-ink:var( --os-ui-holo-ink,#0c0b0f );--_holo-sheen:var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) );--_holo-edge:var( --os-ui-holo-edge,linear-gradient( 124deg,rgba( 154,242,255,0.7 ) 0%,rgba( 236,155,255,0.85 ) 38%,rgba( 242,82,252,0.7 ) 62%,rgba( 159,152,255,0.6 ) 100% ) );--_holo-edge-quiet:var( --os-ui-holo-edge-quiet,linear-gradient( 124deg,rgba( 154,242,255,0.22 ) 0%,rgba( 236,155,255,0.28 ) 38%,rgba( 242,82,252,0.22 ) 62%,rgba( 159,152,255,0.2 ) 100% ) );--_holo-glow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) );--_holo-glow-strong:var( --os-ui-holo-glow-strong,0 0 0 1px rgba( 242,82,252,0.42 ),0 4px 18px rgba( 242,82,252,0.38 ),0 1px 3px rgba( 12,11,15,0.6 ) );--_holo-track:var( --os-ui-holo-track,rgba( 255,251,255,0.16 ) );--_holo-track-edge:var( --os-ui-holo-track-edge,#8c8f94 );--_holo-ring-color:var( --os-ui-accent-dim,#2271b1 );--_holo-focus:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #f252fc,0 0 12px 2px rgba( 242,82,252,0.45 ) );--_holo-focus-field:var( --os-ui-focus-ring-field,0 0 0 1px #f252fc,0 0 0 4px rgba( 242,82,252,0.18 ) );--_holo-t:var( --os-ui-holo-transition,220ms );--_holo-t-fast:var( --os-ui-motion-fast,140ms );--_holo-t-slow:var( --os-ui-motion-slow,340ms );--_holo-t-ambient:var( --os-ui-motion-ambient,12s );--_holo-spring:var( --os-ui-ease-spring,cubic-bezier( 0.32,1.5,0.55,1 ) );--_holo-ease:var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) );--_holo-loop:var( --os-ui-ease-loop,cubic-bezier( 0.45,0,0.55,1 ) )}`,ns=k` .os-holo-fill{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --_holo-ink );transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease}.os-holo-fill:hover{background-position:74% 66%}.os-holo-fill:active{background-position:88% 82%;filter:brightness( 0.94 )}@media ( prefers-reduced-motion:reduce ){.os-holo-fill{transition-duration:1ms}.os-holo-fill:hover,.os-holo-fill:active{background-position:22% 28%}}`,Dt=k` .os-holo-sheen{position:relative;isolation:isolate}.os-holo-sheen::before{content:'';position:absolute;inset:0;z-index:-1;border-radius:inherit;background-image:var( --_holo-sheen );background-size:200% 200%;background-position:20% 30%;opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) ease,background-position var( --_holo-t ) ease}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{opacity:1;background-position:76% 68%}@media ( prefers-reduced-motion:reduce ){.os-holo-sheen::before{transition-duration:1ms}.os-holo-sheen:hover::before,.os-holo-sheen:focus-visible::before{background-position:20% 30%}}`,Mt=k` .os-holo-edge{position:relative}.os-holo-edge::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge-quiet );opacity:0;pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude;transition:opacity var( --_holo-t ) ease}.os-holo-edge:hover::after,.os-holo-edge:focus-visible::after{background-image:var( --_holo-edge );opacity:1}.os-holo-edge.is-lit::after{background-image:var( --_holo-edge );opacity:1}@media ( prefers-reduced-motion:reduce ){.os-holo-edge::after{transition-duration:1ms}}`,Ve=k` .os-holo-glint{position:absolute;inset:0;border-radius:inherit;overflow:hidden;pointer-events:none}.os-holo-glint::before{content:'';position:absolute;top:-60%;bottom:-60%;width:45%;inset-inline-start:-60%;background:linear-gradient( 90deg,transparent 0%,rgba( 255,251,255,0.14 ) 45%,rgba( 255,251,255,0.22 ) 50%,rgba( 255,251,255,0.14 ) 55%,transparent 100% );transform:rotate( 18deg ) translateX( 0 );opacity:0}:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:os-holo-glint var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-glint{0%{opacity:0;transform:rotate( 18deg ) translateX( 0 )}15%{opacity:1}85%{opacity:1}100%{opacity:0;transform:rotate( 18deg ) translateX( 240vw )}}@media ( prefers-reduced-motion:reduce ){:hover>.os-holo-glint::before,:focus-visible>.os-holo-glint::before,:host(:hover )>.os-holo-glint::before,:host(:focus-visible )>.os-holo-glint::before{animation:none}}`,It=k` .os-holo-ring{position:absolute;inset:0;border-radius:inherit;box-shadow:0 0 0 0 var( --_holo-ring-color );opacity:0;pointer-events:none}:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:os-holo-ring var( --_holo-t-slow ) var( --_holo-ease )}@keyframes os-holo-ring{0%{opacity:0.45;box-shadow:0 0 0 0 var( --_holo-ring-color )}100%{opacity:0;box-shadow:0 0 0 10px transparent}}@media ( prefers-reduced-motion:reduce ){:active:not(:disabled )>.os-holo-ring,:host(:active:not( [ disabled ] ) )>.os-holo-ring{animation:none}}`,is=k` .os-holo-shimmer{background-image:var( --_holo-fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}@keyframes os-holo-shimmer{0%{background-position:0% 50%}100%{background-position:100% 50%}}@media ( prefers-reduced-motion:reduce ){.os-holo-shimmer{animation:none;background-position:30% 50%}}`,Ht=k` .os-holo-enter{animation:os-holo-enter var( --_holo-t ) var( --_holo-spring )}@keyframes os-holo-enter{from{opacity:0;transform:scale( 0.96 )}}@media ( prefers-reduced-motion:reduce ){.os-holo-enter{animation:none}}`,as=k` input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):hover:not(:disabled ),select:hover:not(:disabled ),textarea:hover:not(:disabled ){border-color:var( --os-ui-border-strong,#8c8f94 )}input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus,input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ):focus-visible,select:focus,select:focus-visible,textarea:focus,textarea:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}input::placeholder,textarea::placeholder{color:var( --os-ui-fg-faint,#8c8f94 );opacity:1}input::selection,textarea::selection{background:var( --os-ui-selection-bg,rgba( 159,152,255,0.6 ) );color:var( --os-ui-selection-fg,#fffbff )}@media ( prefers-reduced-motion:reduce ){input:where(:not( [ type='checkbox' ] ):not( [ type='radio' ] ) ),select,textarea{transition-duration:1ms}}`,We=k` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,Ut=k` @keyframes os-holo-drift{0%{background-position:16% 26%}50%{background-position:84% 74%}100%{background-position:16% 26%}}.os-holo-alive{animation:os-holo-drift var( --_holo-t-ambient ) var( --_holo-loop ) infinite}@media ( prefers-reduced-motion:reduce ){.os-holo-alive{animation:none}}`;k` ${T} ${ns} ${Dt} ${Mt} ${Ve} ${It} ${is} ${Ht} ${as} ${We} ${Ut} `;const rs=k` ${T} ${Ve}:host(:not( [ interactive ] ) ) .os-holo-glint,:host( [ disabled ] ) .os-holo-glint{display:none}:host{display:flex;flex-direction:column;position:relative;gap:var( --os-ui-card-gap,12px );padding:var( --os-ui-card-padding,16px );border:1px solid var( --os-ui-card-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );border-radius:var( --os-ui-card-radius,12px );background:var( --os-ui-card-bg,var( --os-ui-surface,#fff ) );background-image:var( --os-ui-panel-bg-image,none );background-repeat:var( --os-ui-panel-bg-image-repeat,repeat );background-size:var( --os-ui-panel-bg-image-size,auto );background-position:var( --os-ui-panel-bg-image-position,center );color:var( --os-ui-card-fg,inherit );box-sizing:border-box;min-width:0;transition:transform 180ms ease,box-shadow 180ms ease,border-color 180ms ease}:host( [ hidden ] ){display:none}:host( [ compact ] ){padding:var( --os-ui-card-padding-compact,10px );gap:var( --os-ui-card-gap-compact,6px );border-radius:var( --os-ui-card-radius-compact,8px )}:host( [ interactive ] ){cursor:pointer;outline-offset:2px}:host( [ interactive ]:hover ),:host( [ interactive ]:focus-visible ){transform:translateY( -2px );box-shadow:var( --os-ui-card-shadow-hover,0 4px 16px rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-card-border-hover,var( --os-ui-border-strong,rgba( 0,0,0,0.16 ) ) )}:host( [ interactive ]:focus-visible ){outline:none;box-shadow:var( --_holo-focus )}:host( [ selected ] ){border-color:var( --os-ui-card-border-selected,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --os-ui-card-shadow-selected,0 0 0 1px var( --wp-admin-theme-color,#2271b1 ) inset )}:host( [ selected ] )::after{content:'';position:absolute;inset:-1px;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}:host( [ disabled ] ){opacity:0.55;pointer-events:none;cursor:not-allowed}@media ( prefers-reduced-motion:reduce ){:host{transition:none}:host( [ interactive ]:hover ),:host( [ interactive ]:focus-visible ){transform:none}}::slotted( header ){display:flex;align-items:center;gap:12px;min-width:0}::slotted( footer ){display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}`,Ft="[data-noclick]",Q=class Q extends C{constructor(){super(...arguments),this._onClick=e=>{!this.hasAttribute("interactive")||this.hasAttribute("disabled")||e.target?.closest(Ft)||this._emitCardClick(e)},this._onKeyDown=e=>{if(!this.hasAttribute("interactive")||this.hasAttribute("disabled")||e.key!=="Enter"&&e.key!==" "&&e.key!=="Spacebar")return;const t=e.target;t&&t!==this&&t.closest(Ft)||t instanceof HTMLElement&&t!==this&&(t.tagName==="BUTTON"||t.tagName==="A"||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")||(e.preventDefault(),this._emitCardClick(e))}}connectedCallback(){super.connectedCallback(),this._syncRoles(),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown)}render(){return this._syncRoles(),f`<span class="os-holo-glint" aria-hidden="true"></span
14 + ><slot name="header"></slot><slot></slot><slot name="footer"></slot>`}_syncRoles(){const e=this.hasAttribute("interactive"),t=this.hasAttribute("disabled");e?(this.hasAttribute("role")||this.setAttribute("role","button"),this.setAttribute("tabindex",t?"-1":"0"),this.setAttribute("aria-disabled",t?"true":"false")):(this.removeAttribute("role"),this.removeAttribute("tabindex"),this.removeAttribute("aria-disabled"))}_emitCardClick(e){this.dispatchEvent(new CustomEvent("os-card-click",{detail:{originalEvent:e},bubbles:!0,composed:!0}))}};Q.props=["interactive","selected","compact","disabled"],Q.styles=[rs],Q.help=void 0;let je=Q;E("os-card",je);const ls=new Set(["A","ABBR","B","BLOCKQUOTE","BR","CODE","DD","DEL","DIV","DL","DT","EM","FIGCAPTION","FIGURE","H1","H2","H3","H4","H5","H6","HR","I","IMG","KBD","LI","OL","P","PRE","Q","S","SMALL","SPAN","STRONG","SUB","SUP","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","U","UL"]),ds=new Set(["href","src","alt","title","name","rel","target","colspan","rowspan"]),Oe="noopener noreferrer";function we(o){return new DOMParser().parseFromString(`<body>${o}</body>`,"text/html").body}function cs(o){const t=Array.from(o).filter(s=>s.charCodeAt(0)>32).join("").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/);return t?["http","https","mailto","tel"].includes(t[1]):!0}function Vt(o){const e=we(o),t=[];for(const s of Array.from(e.querySelectorAll("*"))){if(!ls.has(s.tagName)){t.push(s);continue}for(const n of Array.from(s.attributes))ds.has(n.name.toLowerCase())||s.removeAttribute(n.name);for(const n of["href","src"]){const i=s.getAttribute(n)??"";i&&!cs(i)&&s.removeAttribute(n)}}for(const s of t.reverse())s.replaceWith(e.ownerDocument.createTextNode(s.textContent??""));return e.innerHTML}function $(o){return o?we(o).textContent??"":""}function Wt(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Be(o,e){const t=document.createElement("div");return t.className=e,t.innerHTML=Vt(o),jt(t),t}function jt(o){o.querySelectorAll("a").forEach(e=>{e.setAttribute("target","_blank"),e.setAttribute("rel",Oe),e.setAttribute("data-noclick","")})}function B(o,e,t=""){const s=document.createElement("a");return s.href=o,s.target="_blank",s.rel=Oe,s.textContent=e,t&&(s.className=t),s.setAttribute("data-noclick",""),s}function H(o,e,t,s){const n=document.createElement("os-button");return n.setAttribute("variant",o),n.setAttribute("size",s),n.textContent=e,n.setAttribute("data-noclick",""),n.addEventListener("click",()=>{window.open(t,"_blank",Oe.replace(" ",","))}),n}function K(o=""){const e=document.createElement("span");return e.className=`dashicons dashicons-admin-plugins${o?" "+o:""}`,e.setAttribute("aria-hidden","true"),e}function Ce(o,e=""){return`https://wordpress.org/plugins/${encodeURIComponent(o)}/${e}`}function us(o,e,t){const s=document.createElement("os-card");s.classList.add("os-plugins__card"),s.setAttribute("interactive",""),s.dataset.slug=o.slug,s.setAttribute("aria-label",y(d("View details for %s","desktop-mode"),o.name));const n=document.createElement("header");n.className="os-plugins__card-header",n.setAttribute("slot","header");const i=document.createElement("div");i.className="os-plugins__card-icon";const a=Ee(o.icons);if(a){const h=document.createElement("img");h.src=a,h.alt="",h.loading="lazy",h.decoding="async",h.addEventListener("load",()=>h.classList.add("is-loaded")),h.addEventListener("error",()=>{i.replaceChildren(K("os-plugins__card-icon-fallback"))}),i.appendChild(h)}else i.appendChild(K("os-plugins__card-icon-fallback"));const r=document.createElement("div");r.className="os-plugins__card-titleblock";const l=document.createElement("h3");l.className="os-plugins__card-title",l.textContent=Pe(o.name);const c=document.createElement("p");c.className="os-plugins__card-byline",c.textContent=y(d("by %s","desktop-mode"),$(o.author??"")),r.append(l,c),n.append(i,r);const p=document.createElement("p");p.className="os-plugins__card-desc",p.textContent=Pe(o.short_description??"");const u=document.createElement("footer");u.className="os-plugins__card-footer",u.setAttribute("slot","footer");const g=document.createElement("div");g.className="os-plugins__card-meta",g.appendChild(Ae(o.rating??0,o.num_ratings??0));const b=document.createElement("span");return b.className="os-plugins__card-installs",b.textContent=hs(o.active_installs??0),g.appendChild(b),u.append(g,Ot(o,e,t,s)),s.append(n,p,u),s.addEventListener("os-card-click",()=>{t.onOpen(o.slug,o)}),s}function ps(o,e,t,s){const n=o.querySelector(".os-plugins__card-footer");n&&(n.querySelector("[data-plugin-card-cta]")?.remove(),n.appendChild(Ot(e,t,s,o)))}function Ot(o,e,t,s){const n=e.get(o.slug),i=document.createElement("os-button");return i.setAttribute("data-plugin-card-cta",""),i.setAttribute("data-noclick",""),n?N(n.status)?(i.setAttribute("variant","ghost"),i.setAttribute("disabled",""),i.textContent=d("Active","desktop-mode")):(i.setAttribute("variant","primary"),i.textContent=d("Activate","desktop-mode"),i.addEventListener("click",a=>{a.stopPropagation(),t.onActivate(n,s)})):(i.setAttribute("variant","primary"),i.textContent=d("Install","desktop-mode"),i.addEventListener("click",a=>{a.stopPropagation(),t.onInstall(o,s)})),i}function Ae(o,e){const t=document.createElement("span");t.className="os-plugins__stars";const s=Math.max(0,Math.min(5,o/100*5));t.setAttribute("aria-label",y(d("Rated %s out of 5","desktop-mode"),s.toFixed(1)));const n=Math.floor(s),i=s-n>=.5?1:0,a=[...Array(n).fill("dashicons-star-filled"),...Array(i).fill("dashicons-star-half"),...Array(5-n-i).fill("dashicons-star-empty")];for(const r of a){const l=document.createElement("span");l.className="os-plugins__star",l.setAttribute("aria-hidden","true");const c=document.createElement("span");c.className=`dashicons ${r}`,l.appendChild(c),t.appendChild(l)}if(e>0){const r=document.createElement("span");r.className="os-plugins__stars-count",r.textContent=`(${Bt(e)})`,t.appendChild(r)}return t}function Ee(o){return o?o.svg??o[256]??o["256x256"]??o[128]??o["128x128"]??o["2x"]??o["1x"]??o.default??Object.values(o)[0]??null:null}function hs(o){if(o<=0)return d("Fewer than 10 active","desktop-mode");if(o>=1e6)return y(d("%d+ million active","desktop-mode"),Math.floor(o/1e6));const e=o>=1e3?gs(o):o;return y(d("%s+ active","desktop-mode"),Bt(e))}function gs(o){const e=Math.pow(10,Math.floor(Math.log10(o))-2);return Math.floor(o/e)*e}function Bt(o){try{return new Intl.NumberFormat().format(o)}catch{return String(o)}}function Ke(){const o=document.createElement("os-card");o.classList.add("os-plugins__card","os-plugins__card--skeleton"),o.setAttribute("aria-hidden","true");for(let e=0;e<4;e++){const t=document.createElement("span");t.className="os-plugins__skeleton-line",t.style.width=`${50+e*17%50}%`,o.appendChild(t)}return o}function fs(o,e){o.dataset.dragWired!=="1"&&(o.dataset.dragWired="1",o.addEventListener("pointerdown",t=>{const s=window.wp?.os?.dragManager;s&&(t.target?.closest("[data-plugin-card-cta]")||s.start({payload:{type:"wporg-plugin",source:o,data:{slug:e.slug,name:e.name,iconUrl:Ee(e.icons)??null,homepage:e.homepage??"",authorName:$(e.author??""),shortDescription:e.short_description??""},ghost:vs(e,o,t)},origin:t,onClickOnly:()=>{}}))}))}function bs(){const o=window.wp?.os,e=o?.dragManager,t=ms();if(!o||!e||!t)return()=>{};const s=e.registerDropTarget({id:"desktop-mode-plugins/dock",element:t,accept:n=>n.type==="wporg-plugin",onEnter:()=>{t.setAttribute("data-plugins-card-drop-active","")},onLeave:()=>{t.removeAttribute("data-plugins-card-drop-active")},onDrop:n=>{t.removeAttribute("data-plugins-card-drop-active");const i=n.payload.data,a=String(i.slug??"");if(!a)return;const r=String(i.name??a),l=typeof i.iconUrl=="string"&&i.iconUrl?i.iconUrl:"dashicons-admin-plugins",c=String(i.homepage??""),p=c!==""?c:Ce(a);o.registerSystemTile({id:`wporg-plugin-${a}`,title:r,icon:l,onOpen:()=>{window.open(p,"_blank","noopener,noreferrer")}}),o.showToast({message:y(d("Pinned %s to the dock.","desktop-mode"),r),duration:3500})}});return()=>{try{s()}catch{}}}function ms(){return document.querySelector(".os-bottom-dock")??document.querySelector(".os-dock")??document.querySelector("[data-os-dock]")}function vs(o,e,t){const s=e.getBoundingClientRect(),n=document.createElement("div");n.className="os-plugins__drag-ghost";const i=Ee(o.icons);if(i){const r=document.createElement("img");r.src=i,r.alt="",n.appendChild(r)}else n.appendChild(K("os-plugins__drag-ghost-fallback"));const a=document.createElement("span");return a.textContent=o.name,n.appendChild(a),{offsetX:t.clientX-s.left,offsetY:t.clientY-s.top,element:n}}const _s=k`:host{position:absolute;width:var( --os-ui-ribbon-size,90px );height:var( --os-ui-ribbon-size,90px );overflow:hidden;pointer-events:none;z-index:var( --os-ui-ribbon-z,2 )}:host( [ hidden ] ){display:none}.banner{position:absolute;display:block;width:var( --os-ui-ribbon-banner-width,140px );padding:var( --os-ui-ribbon-padding,4px 0 );text-align:center;font:var( --os-ui-ribbon-font,700 10px/1.4 var( --os-font,system-ui ) );letter-spacing:var( --os-ui-ribbon-tracking,0.06em );text-transform:uppercase;color:var( --os-ui-ribbon-fg,var( --os-ui-fg-on-accent,#fff ) );background:var( --os-ui-ribbon-bg,var( --wp-admin-theme-color,#2271b1 ) );background-size:260% 260%;background-position:30% 40%;box-shadow:var( --os-ui-ribbon-shadow,0 2px 4px rgba( 0,0,0,0.2 ) )}:host(:not( [ placement ] ) ),:host( [ placement='top-end' ] ){inset-block-start:0;inset-inline-end:0}:host(:not( [ placement ] ) ) .banner,:host( [ placement='top-end' ] ) .banner{inset-block-start:var( --os-ui-ribbon-banner-offset,20px );inset-inline-end:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( 45deg )}:host( [ placement='top-start' ] ){inset-block-start:0;inset-inline-start:0}:host( [ placement='top-start' ] ) .banner{inset-block-start:var( --os-ui-ribbon-banner-offset,20px );inset-inline-start:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( -45deg )}:host( [ placement='bottom-end' ] ){inset-block-end:0;inset-inline-end:0}:host( [ placement='bottom-end' ] ) .banner{inset-block-end:var( --os-ui-ribbon-banner-offset,20px );inset-inline-end:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( -45deg )}:host( [ placement='bottom-start' ] ){inset-block-end:0;inset-inline-start:0}:host( [ placement='bottom-start' ] ) .banner{inset-block-end:var( --os-ui-ribbon-banner-offset,20px );inset-inline-start:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host(:not( [ placement ] ) ) .banner,:host-context( [ dir='rtl' ] ):host( [ placement='top-end' ] ) .banner{transform:rotate( -45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='top-start' ] ) .banner{transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='bottom-end' ] ) .banner{transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='bottom-start' ] ) .banner{transform:rotate( -45deg )}:host( [ tone='success' ] ) .banner{background:var( --os-ui-ribbon-success,var( --os-ui-success-fg,#1a7f37 ) )}:host( [ tone='warning' ] ) .banner{background:var( --os-ui-ribbon-warning,var( --os-ui-warning-bg,#9a6700 ) )}:host( [ tone='danger' ] ) .banner{background:var( --os-ui-ribbon-danger,var( --os-ui-danger,#cf222e ) )}:host( [ tone='info' ] ) .banner{background:var( --os-ui-ribbon-info,var( --os-ui-info-bg,#0969da ) )}:host( [ tone='neutral' ] ) .banner{background:var( --os-ui-ribbon-neutral,var( --os-ui-surface,#57606a ) )}`,J=class J extends C{render(){return f`<span class="banner" part="banner"><slot></slot></span>`}};J.props=["placement","tone"],J.styles=[_s],J.help=void 0;let Ze=J;E("os-ribbon",Ze);const Kt={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 Zt(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ys(o){return Object.prototype.hasOwnProperty.call(Kt,o)?Kt[o]:null}function Ge(o,e={}){const t=ys(o);if(!t)return"";const{size:s=24,className:n,title:i,rotate:a}=e,r=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];s!=null&&r.push(`width="${s}"`,`height="${s}"`),r.push(t.a),n&&r.push(`class="${Zt(n)}"`),i?r.push('role="img"',`aria-label="${Zt(i)}"`):r.push('aria-hidden="true"','focusable="false"');const l=a?`<g transform="rotate(${a} 12 12)">${t.b}</g>`:t.b;return`<svg ${r.join(" ")}>${l}</svg>`}function ks(o,e={}){const t=Ge(o,e),s=document.createElement("div");s.innerHTML=t;const n=s.firstElementChild;return n instanceof SVGSVGElement?n:document.createElementNS("http://www.w3.org/2000/svg","svg")}const xs=k`:host{display:flex;gap:4px;margin-bottom:10px;border-bottom:1px solid var( --os-ui-border,#dcdcde )}:host( [ orientation='vertical' ] ){flex-direction:column;align-items:stretch;gap:0;margin-bottom:0;border-bottom:0}`,ws=k`:host{display:block}:host( [ hidden ] ){display:none}:host(:focus-visible ){outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px;border-radius:4px}`,Cs=k` ${T}:host{display:inline-block}:host( [ data-orientation='vertical' ] ){display:block;--_tab-edge:var( --os-ui-tab-edge,linear-gradient( var( --os-ui-accent,#f252fc ),var( --os-ui-accent,#f252fc ) ) );--_tab-wash:var( --os-ui-tab-wash,linear-gradient( 90deg,rgba( 242,82,252,0.16 ) 0%,rgba( 255,251,255,0.04 ) 42%,transparent 100% ) );--_tab-bloom:var( --os-ui-tab-bloom,linear-gradient( 90deg,rgba( 242,82,252,0.26 ),transparent ) );--_tab-edge-w:var( --os-ui-tab-edge-width,2px );--_tab-bloom-o:var( --os-ui-tab-bloom-opacity,1 );--_tab-fill:var( --os-ui-tab-fill,transparent );--_tab-radius:var( --os-ui-tab-radius,0px );--_tab-inset:var( --os-ui-tab-inset,0px )}:host( [ data-orientation='vertical' ] ) button{display:flex;align-items:center;gap:11px;isolation:isolate;overflow:hidden;width:calc( 100% - 2 * var( --_tab-inset ) );min-height:40px;padding:0 14px 0 calc( 20px - var( --_tab-inset ) );margin-bottom:0;margin-inline:var( --_tab-inset );border-radius:var( --_tab-radius );text-align:start;font-size:14px;font-weight:400;line-height:1.5;white-space:nowrap}:host( [ data-orientation='vertical' ] ) slot::slotted( svg ){flex:0 0 17px;width:17px;height:17px;opacity:0.8;transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button:hover slot::slotted( svg ),:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) slot::slotted( svg ){opacity:1}:host( [ data-orientation='vertical' ] ) button::after{inset-inline:0 auto;inset-block:0;z-index:-1;width:var( --_tab-edge-w );height:auto;border-radius:0;background-image:var( --_tab-edge );transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button::before{content:'';position:absolute;inset-inline:0 auto;inset-block:0;z-index:-1;width:44px;background-image:var( --_tab-bloom );filter:blur( 8px );opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button:hover::after{inset-inline:0 auto;opacity:0}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button{background-color:var( --_tab-fill );background-image:var( --_tab-wash );font-weight:400}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button::after,:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button:hover::after{inset-inline:0 auto;opacity:1}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button::before{opacity:var( --_tab-bloom-o )}@media ( prefers-reduced-motion:reduce ){:host( [ data-orientation='vertical' ] ) button::before,:host( [ data-orientation='vertical' ] ) slot::slotted( svg ){transition-duration:1ms}}button{appearance:none;position:relative;padding:6px 10px 8px;border:none;background:transparent;color:var( --os-ui-fg-muted,#50575e );font:inherit;font-size:12px;font-weight:500;cursor:pointer;margin-bottom:-1px;transition:color var( --_holo-t ) ease}button::after{content:'';position:absolute;inset-inline:50%;bottom:0;height:2px;border-radius:2px 2px 0 0;background-image:linear-gradient( var( --os-ui-accent,#2271b1 ),var( --os-ui-accent,#2271b1 ) );background-size:100% 100%;opacity:0;transition:inset-inline var( --_holo-t ) ease,opacity var( --_holo-t ) ease}button:hover{color:var( --os-ui-fg,#1d2327 )}button:hover::after{inset-inline:30%;opacity:0.45}button:focus-visible{outline:none;box-shadow:var( --_holo-focus );border-radius:4px}:host( [ aria-selected='true' ] ) button{color:var( --os-ui-fg,#1d2327 );font-weight:600}:host( [ aria-selected='true' ] ) button::after,:host( [ aria-selected='true' ] ) button:hover::after{inset-inline:0;opacity:1}@media ( prefers-reduced-motion:reduce ){button::after{transition-duration:1ms}}`,ee=class ee extends C{render(){return this.setAttribute("role","tab"),f`
15 15 <button type="button" @click=${()=>this._onPick()}>
16 16 <slot></slot>
17 17 </button>
18 - `}_onPick(){this.emit("os-tab-pick",{value:this.value})}};G.props=["value"],G.styles=[on],G.help=void 0;let qe=G;$("os-tab",qe);const X=class X extends S{constructor(){super(...arguments),this._tabObserver=null,this._onKeyDown=t=>{const o=this.orientation==="vertical",n=o?"ArrowDown":"ArrowRight",s=o?"ArrowUp":"ArrowLeft";if(t.key!==n&&t.key!==s&&t.key!=="Home"&&t.key!=="End")return;const a=Array.from(this.querySelectorAll("os-tab")).filter(u=>!u.hasAttribute("data-search-hidden"));if(a.length===0)return;const i=this.value,r=a.findIndex(u=>u.getAttribute("value")===i);let d=0;if(t.key==="End")d=a.length-1;else if(t.key!=="Home"){const u=t.key===n?1:-1;d=(r+u+a.length)%a.length}const c=a[d]?.getAttribute("value");!c||c===i||(t.preventDefault(),this.value=c,this.emit("os-tab-change",{value:c}),queueMicrotask(()=>{a[d]?.focus()}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("os-tab-pick",t=>{const o=t.detail;t.stopPropagation(),this.value=o.value,this.emit("os-tab-change",{value:o.value})}),this.addEventListener("keydown",this._onKeyDown),this._tabObserver=new MutationObserver(()=>this.requestUpdate()),this._tabObserver.observe(this,{childList:!0})}disconnectedCallback(){this._tabObserver?.disconnect(),this._tabObserver=null,this.removeEventListener("keydown",this._onKeyDown)}set items(t){nn(this,"os-tab",t);const o=this.value;!(o!==null&&t.some(s=>s.value===o))&&t.length>0?this.value=t[0].value:this.requestUpdate()}render(){this.setAttribute("role","tablist");const t=this.label||"";t&&this.setAttribute("aria-label",t);const o=this.orientation==="vertical";this.setAttribute("aria-orientation",o?"vertical":"horizontal");for(const s of Array.from(this.querySelectorAll("os-tab")))o?s.setAttribute("data-orientation","vertical"):s.removeAttribute("data-orientation");const n=this.value;return queueMicrotask(()=>{const s=this.querySelectorAll("os-tab");for(const a of Array.from(s)){const i=a.getAttribute("value");a.setAttribute("aria-selected",i===n?"true":"false"),a.setAttribute("tabindex",i===n?"0":"-1")}Ct(this,n)}),_`<slot></slot>`}};X.props=["value","label","orientation"],X.styles=[en],X.help={title:"Tabs",summary:'Underline-accent tab strip. Pair with sibling <os-tabpanel for="…"> elements and the strip auto-toggles their hidden attribute on selection. Set orientation="vertical" for a sidebar instead of a strip.',status:"stable",props:[{name:"value",type:"string",description:"Currently active tab value. Mirrored to child <os-tab> aria-selected."},{name:"label",type:"string",description:"aria-label for the tablist — describe the tab group for assistive tech."},{name:"orientation",type:"'horizontal' | 'vertical'",description:"Lay the tabs across the top (default) or down the side. Vertical also sets aria-orientation and moves each tab's accent from an underline to a leading edge."}],slots:[{name:"(default)",description:'<os-tab value="…"> children forming the strip.'}],events:[{name:"os-tab-change",description:"Fires when the active tab changes.",detail:"{ value: string }"}],example:_`
18 + `}_onPick(){this.emit("os-tab-pick",{value:this.value})}};ee.props=["value"],ee.styles=[Cs],ee.help=void 0;let Ye=ee;E("os-tab",Ye);const te=class te extends C{constructor(){super(...arguments),this._tabObserver=null,this._onKeyDown=e=>{const t=this.orientation==="vertical",s=t?"ArrowDown":"ArrowRight",n=t?"ArrowUp":"ArrowLeft";if(e.key!==s&&e.key!==n&&e.key!=="Home"&&e.key!=="End")return;const i=Array.from(this.querySelectorAll("os-tab")).filter(p=>!p.hasAttribute("data-search-hidden"));if(i.length===0)return;const a=this.value,r=i.findIndex(p=>p.getAttribute("value")===a);let l=0;if(e.key==="End")l=i.length-1;else if(e.key!=="Home"){const p=e.key===s?1:-1;l=(r+p+i.length)%i.length}const c=i[l]?.getAttribute("value");!c||c===a||(e.preventDefault(),this.value=c,this.emit("os-tab-change",{value:c}),queueMicrotask(()=>{i[l]?.focus()}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("os-tab-pick",e=>{const t=e.detail;e.stopPropagation(),this.value=t.value,this.emit("os-tab-change",{value:t.value})}),this.addEventListener("keydown",this._onKeyDown),this._tabObserver=new MutationObserver(()=>this.requestUpdate()),this._tabObserver.observe(this,{childList:!0})}disconnectedCallback(){this._tabObserver?.disconnect(),this._tabObserver=null,this.removeEventListener("keydown",this._onKeyDown)}set items(e){As(this,"os-tab",e);const t=this.value;!(t!==null&&e.some(n=>n.value===t))&&e.length>0?this.value=e[0].value:this.requestUpdate()}render(){this.setAttribute("role","tablist");const e=this.label||"";e&&this.setAttribute("aria-label",e);const t=this.orientation==="vertical";this.setAttribute("aria-orientation",t?"vertical":"horizontal");for(const n of Array.from(this.querySelectorAll("os-tab")))t?n.setAttribute("data-orientation","vertical"):n.removeAttribute("data-orientation");const s=this.value;return queueMicrotask(()=>{const n=this.querySelectorAll("os-tab");for(const i of Array.from(n)){const a=i.getAttribute("value");i.setAttribute("aria-selected",a===s?"true":"false"),i.setAttribute("tabindex",a===s?"0":"-1")}Gt(this,s)}),f`<slot></slot>`}};te.props=["value","label","orientation"],te.styles=[xs],te.help={title:"Tabs",summary:'Underline-accent tab strip. Pair with sibling <os-tabpanel for="…"> elements and the strip auto-toggles their hidden attribute on selection. Set orientation="vertical" for a sidebar instead of a strip.',status:"stable",props:[{name:"value",type:"string",description:"Currently active tab value. Mirrored to child <os-tab> aria-selected."},{name:"label",type:"string",description:"aria-label for the tablist — describe the tab group for assistive tech."},{name:"orientation",type:"'horizontal' | 'vertical'",description:"Lay the tabs across the top (default) or down the side. Vertical also sets aria-orientation and moves each tab's accent from an underline to a leading edge."}],slots:[{name:"(default)",description:'<os-tab value="…"> children forming the strip.'}],events:[{name:"os-tab-change",description:"Fires when the active tab changes.",detail:"{ value: string }"}],example:f`
19 19 <os-tabs value="one" label="Demo tabs">
20 20 <os-tab value="one">One</os-tab>
21 21 <os-tab value="two">Two</os-tab>
22 22 <os-tab value="three">Three</os-tab>
@@ -23,9 +23,9 @@
23 23 </os-tabs>
24 24 <os-tabpanel for="one">First panel.</os-tabpanel>
25 25 <os-tabpanel for="two">Second panel.</os-tabpanel>
26 26 <os-tabpanel for="three">Third panel.</os-tabpanel>
27 - `};let Ie=X;$("os-tabs",Ie);const Q=class Q extends S{connectedCallback(){super.connectedCallback(),this.setAttribute("role","tabpanel"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const t=sn(this);t&&Ct(t,t.getAttribute("value"))}render(){return _`<slot></slot>`}};Q.props=["for"],Q.styles=[tn],Q.help={title:"Tab panel",summary:'Auto-managed panel paired with a sibling <os-tabs>. Declares which tab it belongs to via `for="<tab-value>"`; the parent strip toggles `hidden` whenever the active tab changes. role="tabpanel" and tabindex="0" are set automatically.',status:"stable",props:[{name:"for",type:"string",description:"Matches the `value` of the owning <os-tab>. Panel is shown when its parent tabs strip is on that value."}],slots:[{name:"(default)",description:"Panel body content."}],example:_`
27 + `};let Xe=te;E("os-tabs",Xe);const oe=class oe extends C{connectedCallback(){super.connectedCallback(),this.setAttribute("role","tabpanel"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const e=Es(this);e&&Gt(e,e.getAttribute("value"))}render(){return f`<slot></slot>`}};oe.props=["for"],oe.styles=[ws],oe.help={title:"Tab panel",summary:'Auto-managed panel paired with a sibling <os-tabs>. Declares which tab it belongs to via `for="<tab-value>"`; the parent strip toggles `hidden` whenever the active tab changes. role="tabpanel" and tabindex="0" are set automatically.',status:"stable",props:[{name:"for",type:"string",description:"Matches the `value` of the owning <os-tab>. Panel is shown when its parent tabs strip is on that value."}],slots:[{name:"(default)",description:"Panel body content."}],example:f`
28 28 <os-tabs value="two" label="Demo tabs">
29 29 <os-tab value="one">One</os-tab>
30 30 <os-tab value="two">Two</os-tab>
31 31 </os-tabs>
@@ -35,46 +35,46 @@
35 35 <os-tabpanel for="two">
36 36 Visible, because this panel's <code>for</code> matches the
37 37 strip's <code>value</code>.
38 38 </os-tabpanel>
39 - `};let Re=Q;$("os-tabpanel",Re);function nn(e,t,o){const n=e.querySelectorAll(`:scope > ${t}`);for(const s of Array.from(n))s.remove();for(const s of o){const a=document.createElement(t);a.setAttribute("value",s.value),a.textContent=s.label,e.appendChild(a)}}function sn(e){const t=e.parentElement;if(!t)return null;const o=t.querySelector(":scope > os-tabs");return o||e.closest("os-tabs")}function Ct(e,t){const o=new Set,n=e.parentElement;if(n)for(const s of Array.from(n.querySelectorAll(":scope > os-tabpanel")))o.add(s);for(const s of Array.from(e.querySelectorAll(":scope > os-tabpanel")))o.add(s);for(const s of o){const a=s.getAttribute("for"),i=a!==null&&a===t;i?s.removeAttribute("hidden"):s.setAttribute("hidden",""),s.setAttribute("aria-hidden",i?"false":"true")}}const an=k`:host{display:inline-flex;align-items:center;justify-content:center;width:var( --os-ui-icon-size,16px );height:var( --os-ui-icon-size,16px );color:inherit;line-height:1}:host( [ hidden ] ){display:none}.os-icon__glyph{font-size:var( --os-ui-icon-size,16px );width:var( --os-ui-icon-size,16px );height:var( --os-ui-icon-size,16px );line-height:1;color:inherit;display:inline-flex;align-items:center;justify-content:center}.os-icon__glyph--char{font-family:dashicons;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;speak:none}.os-icon__glyph.dashicons{font-family:dashicons}`;let ge=null;function rn(e){let t=e.trim();if(t==="")return null;(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1,-1));const o=t.match(/^\\([0-9a-f]{1,6})\s?$/i);return o?String.fromCodePoint(parseInt(o[1],16)):t||null}function Et(){const e=new Map;if(typeof document>"u")return e;const t=Array.from(document.styleSheets??[]);for(const o of t){let n=null;try{n=o.cssRules}catch{continue}if(n)for(const s of Array.from(n)){const a=s;if(!a||!a.selectorText)continue;const i=a.selectorText.match(/\.dashicons-([a-z0-9-]+)::?before/i);if(!i)continue;const r=a.style?.content;if(!r)continue;const d=rn(r);d&&e.set(i[1],d)}}return e}function ln(e){ge||(ge=Et());const t=e.startsWith("dashicons-")?e.slice(10):e;return ge.get(t)??null}function dn(){ge=Et()}let At=!1;function cn(){if(At||typeof window>"u")return;At=!0;const e=()=>{dn()};document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",e,{once:!0}),window.addEventListener("load",e,{once:!0})}cn();const Y=class Y extends S{render(){const t=this.name||"",o=t.startsWith("dashicons-")?t.slice(10):t,n=this.size;n&&/^\d+$/.test(n)&&this.style.setProperty("--os-ui-icon-size",`${n}px`);const s=ln(o);return s?_`<span
40 - class="os-icon__glyph os-icon__glyph--char dashicons dashicons-${o}"
39 + `};let Qe=oe;E("os-tabpanel",Qe);function As(o,e,t){const s=o.querySelectorAll(`:scope > ${e}`);for(const n of Array.from(s))n.remove();for(const n of t){const i=document.createElement(e);i.setAttribute("value",n.value),i.textContent=n.label,o.appendChild(i)}}function Es(o){const e=o.parentElement;if(!e)return null;const t=e.querySelector(":scope > os-tabs");return t||o.closest("os-tabs")}function Gt(o,e){const t=new Set,s=o.parentElement;if(s)for(const n of Array.from(s.querySelectorAll(":scope > os-tabpanel")))t.add(n);for(const n of Array.from(o.querySelectorAll(":scope > os-tabpanel")))t.add(n);for(const n of t){const i=n.getAttribute("for"),a=i!==null&&i===e;a?n.removeAttribute("hidden"):n.setAttribute("hidden",""),n.setAttribute("aria-hidden",a?"false":"true")}}const Ss=k`:host{display:inline-flex;align-items:center;justify-content:center;width:var( --os-ui-icon-size,16px );height:var( --os-ui-icon-size,16px );color:inherit;line-height:1}:host( [ hidden ] ){display:none}.os-icon__glyph{font-size:var( --os-ui-icon-size,16px );width:var( --os-ui-icon-size,16px );height:var( --os-ui-icon-size,16px );line-height:1;color:inherit;display:inline-flex;align-items:center;justify-content:center}.os-icon__glyph--char{font-family:dashicons;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;speak:none}.os-icon__glyph.dashicons{font-family:dashicons}`;let Se=null;function $s(o){let e=o.trim();if(e==="")return null;(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1));const t=e.match(/^\\([0-9a-f]{1,6})\s?$/i);return t?String.fromCodePoint(parseInt(t[1],16)):e||null}function Yt(){const o=new Map;if(typeof document>"u")return o;const e=Array.from(document.styleSheets??[]);for(const t of e){let s=null;try{s=t.cssRules}catch{continue}if(s)for(const n of Array.from(s)){const i=n;if(!i||!i.selectorText)continue;const a=i.selectorText.match(/\.dashicons-([a-z0-9-]+)::?before/i);if(!a)continue;const r=i.style?.content;if(!r)continue;const l=$s(r);l&&o.set(a[1],l)}}return o}function zs(o){Se||(Se=Yt());const e=o.startsWith("dashicons-")?o.slice(10):o;return Se.get(e)??null}function Ns(){Se=Yt()}let Xt=!1;function Ls(){if(Xt||typeof window>"u")return;Xt=!0;const o=()=>{Ns()};document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",o,{once:!0}),window.addEventListener("load",o,{once:!0})}Ls();const se=class se extends C{render(){const e=this.name||"",t=e.startsWith("dashicons-")?e.slice(10):e,s=this.size;s&&/^\d+$/.test(s)&&this.style.setProperty("--os-ui-icon-size",`${s}px`);const n=zs(t);return n?f`<span
40 + class="os-icon__glyph os-icon__glyph--char dashicons dashicons-${t}"
41 41 aria-hidden="true"
42 - >${s}</span>`:_`<span
43 - class="os-icon__glyph dashicons dashicons-${o}"
42 + >${n}</span>`:f`<span
43 + class="os-icon__glyph dashicons dashicons-${t}"
44 44 aria-hidden="true"
45 - ></span>`}};Y.props=["name","size"],Y.styles=[an],Y.help=void 0;let Ue=Y;$("os-icon",Ue);const un=k`:host{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px 24px;text-align:center;color:var( --os-ui-empty-state-fg,var( --os-ui-fg-muted,#646970 ) )}:host( [ hidden ] ){display:none}.os-empty-state__icon{margin-bottom:4px;color:var( --os-ui-empty-state-icon-color,currentColor );opacity:0.75}.os-empty-state__heading{margin:0;font-size:14px;font-weight:600;color:var( --os-ui-fg,#1d2327 )}.os-empty-state__description{margin:0;font-size:12px;line-height:1.4;max-width:48ch}.os-empty-state__description:empty{display:none}.os-empty-state__cta{margin-top:8px}.os-empty-state__cta:empty{display:none}`,J=class J extends S{render(){const t=this.icon||"",o=this.heading||"",n=this.description||"";return _`
46 - ${t?_`<os-icon
45 + ></span>`}};se.props=["name","size"],se.styles=[Ss],se.help=void 0;let Je=se;E("os-icon",Je);const Ts=k`:host{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px 24px;text-align:center;color:var( --os-ui-empty-state-fg,var( --os-ui-fg-muted,#646970 ) )}:host( [ hidden ] ){display:none}.os-empty-state__icon{margin-bottom:4px;color:var( --os-ui-empty-state-icon-color,currentColor );opacity:0.75}.os-empty-state__heading{margin:0;font-size:14px;font-weight:600;color:var( --os-ui-fg,#1d2327 )}.os-empty-state__description{margin:0;font-size:12px;line-height:1.4;max-width:48ch}.os-empty-state__description:empty{display:none}.os-empty-state__cta{margin-top:8px}.os-empty-state__cta:empty{display:none}`,ne=class ne extends C{render(){const e=this.icon||"",t=this.heading||"",s=this.description||"";return f`
46 + ${e?f`<os-icon
47 47 class="os-empty-state__icon"
48 - name=${t}
48 + name=${e}
49 49 size="28"
50 50 ></os-icon>`:null}
51 - <h3 class="os-empty-state__heading">${o}</h3>
52 - <p class="os-empty-state__description">${n}</p>
51 + <h3 class="os-empty-state__heading">${t}</h3>
52 + <p class="os-empty-state__description">${s}</p>
53 53 <div class="os-empty-state__cta">
54 54 <slot name="cta"></slot>
55 55 </div>
56 56 <slot></slot>
57 - `}};J.props=["icon","heading","description"],J.styles=[un],J.help=void 0;let He=J;$("os-empty-state",He);const pn=k`:host{display:block;--_track:var( --os-ui-rating-track,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_fill:var( --os-ui-rating-fill,linear-gradient( 90deg,#f5af00 0%,#ffd245 100% ) );--_star:var( --os-ui-rating-star,#f5af00 );--_star-empty:var( --os-ui-rating-star-empty,var( --os-ui-fg-faint,rgba( 0,0,0,0.18 ) ) );--_surface:var( --os-ui-rating-surface,var( --os-ui-surface-elevated,rgba( 255,255,255,0.7 ) ) );--_border:var( --os-ui-rating-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_fg:var( --os-ui-rating-fg,var( --os-ui-fg,inherit ) );--_fg-muted:var( --os-ui-rating-fg-muted,var( --os-ui-fg-muted,#666 ) )}:host( [ hidden ] ){display:none}.summary-card{display:grid;grid-template-columns:minmax( 140px,180px ) 1fr;gap:28px;align-items:center;padding:18px 20px;background:var( --_surface );border:1px solid var( --_border );border-radius:14px;color:var( --_fg )}.summary{display:flex;flex-direction:column;align-items:center;gap:8px;padding-inline-end:20px;border-inline-end:1px solid var( --_border )}.big{font-size:44px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-0.02em;color:var( --_fg )}.stars{display:inline-flex;gap:2px;color:var( --_star )}.stars svg{width:16px;height:16px;display:block}.stars .empty{color:var( --_star-empty )}.total{font-size:12px;color:var( --_fg-muted )}.bars{display:grid;gap:6px;min-width:0}.row{display:grid;grid-template-columns:42px 1fr 60px;gap:12px;align-items:center;font-size:12.5px;color:var( --_fg-muted )}.row__label{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;font-weight:600}.row__label svg{width:11px;height:11px;color:var( --_star )}.row__track{position:relative;height:10px;background:var( --_track );border-radius:999px;overflow:hidden}.row__fill{position:absolute;inset:0;background:var( --_fill );border-radius:999px;transform-origin:left center;transform:scaleX( var( --ratio,0 ) );transition:transform 600ms cubic-bezier( 0.2,0.8,0.2,1 )}:host(:dir( rtl ) ) .row__fill,:host-context( [ dir='rtl' ] ) .row__fill{transform-origin:right center}.row__count{text-align:end;font-variant-numeric:tabular-nums;color:var( --_fg )}@media ( prefers-reduced-motion:reduce ){.row__fill{transition:none}}@media ( max-width:540px ){.summary-card{grid-template-columns:1fr;gap:16px}.summary{padding-inline-end:0;border-inline-end:0;border-block-end:1px solid var( --_border );padding-block-end:14px}}`,ee=class ee extends S{constructor(){super(...arguments),this._ratings={}}get ratings(){return{...this._ratings}}set ratings(t){this._ratings=t?{...t}:{},this.requestUpdate()}render(){const t=hn(St(this,"rating")),o=t/100*5,n=St(this,"total"),s=n>0?n:(this._ratings[5]??0)+(this._ratings[4]??0)+(this._ratings[3]??0)+(this._ratings[2]??0)+(this._ratings[1]??0),a=new Intl.NumberFormat,i=t>0?(t/100*5).toFixed(1):"—";return _`
58 - <div class="summary-card" role="img" aria-label=${gn(t,s)}>
57 + `}};ne.props=["icon","heading","description"],ne.styles=[Ts],ne.help=void 0;let et=ne;E("os-empty-state",et);const Rs=k`:host{display:block;--_track:var( --os-ui-rating-track,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_fill:var( --os-ui-rating-fill,linear-gradient( 90deg,#f5af00 0%,#ffd245 100% ) );--_star:var( --os-ui-rating-star,#f5af00 );--_star-empty:var( --os-ui-rating-star-empty,var( --os-ui-fg-faint,rgba( 0,0,0,0.18 ) ) );--_surface:var( --os-ui-rating-surface,var( --os-ui-surface-elevated,rgba( 255,255,255,0.7 ) ) );--_border:var( --os-ui-rating-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_fg:var( --os-ui-rating-fg,var( --os-ui-fg,inherit ) );--_fg-muted:var( --os-ui-rating-fg-muted,var( --os-ui-fg-muted,#666 ) )}:host( [ hidden ] ){display:none}.summary-card{display:grid;grid-template-columns:minmax( 140px,180px ) 1fr;gap:28px;align-items:center;padding:18px 20px;background:var( --_surface );border:1px solid var( --_border );border-radius:14px;color:var( --_fg )}.summary{display:flex;flex-direction:column;align-items:center;gap:8px;padding-inline-end:20px;border-inline-end:1px solid var( --_border )}.big{font-size:44px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-0.02em;color:var( --_fg )}.stars{display:inline-flex;gap:2px;color:var( --_star )}.stars svg{width:16px;height:16px;display:block}.stars .empty{color:var( --_star-empty )}.total{font-size:12px;color:var( --_fg-muted )}.bars{display:grid;gap:6px;min-width:0}.row{display:grid;grid-template-columns:42px 1fr 60px;gap:12px;align-items:center;font-size:12.5px;color:var( --_fg-muted )}.row__label{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;font-weight:600}.row__label svg{width:11px;height:11px;color:var( --_star )}.row__track{position:relative;height:10px;background:var( --_track );border-radius:999px;overflow:hidden}.row__fill{position:absolute;inset:0;background:var( --_fill );border-radius:999px;transform-origin:left center;transform:scaleX( var( --ratio,0 ) );transition:transform 600ms cubic-bezier( 0.2,0.8,0.2,1 )}:host(:dir( rtl ) ) .row__fill,:host-context( [ dir='rtl' ] ) .row__fill{transform-origin:right center}.row__count{text-align:end;font-variant-numeric:tabular-nums;color:var( --_fg )}@media ( prefers-reduced-motion:reduce ){.row__fill{transition:none}}@media ( max-width:540px ){.summary-card{grid-template-columns:1fr;gap:16px}.summary{padding-inline-end:0;border-inline-end:0;border-block-end:1px solid var( --_border );padding-block-end:14px}}`,ie=class ie extends C{constructor(){super(...arguments),this._ratings={}}get ratings(){return{...this._ratings}}set ratings(e){this._ratings=e?{...e}:{},this.requestUpdate()}render(){const e=Ps(Qt(this,"rating")),t=e/100*5,s=Qt(this,"total"),n=s>0?s:(this._ratings[5]??0)+(this._ratings[4]??0)+(this._ratings[3]??0)+(this._ratings[2]??0)+(this._ratings[1]??0),i=new Intl.NumberFormat,a=e>0?(e/100*5).toFixed(1):"—";return f`
58 + <div class="summary-card" role="img" aria-label=${qs(e,n)}>
59 59 <div class="summary">
60 - <div class="big">${i}</div>
60 + <div class="big">${a}</div>
61 61 <div class="stars" aria-hidden="true">
62 - ${mn(o)}
62 + ${Ds(t)}
63 63 </div>
64 64 <div class="total">
65 - ${s===1?"1 rating":`${a.format(s)} ratings`}
65 + ${n===1?"1 rating":`${i.format(n)} ratings`}
66 66 </div>
67 67 </div>
68 68 <div class="bars">
69 - ${[5,4,3,2,1].map(r=>{const d=this._ratings[String(r)]??0,c=s===0?0:d/s;return _`
69 + ${[5,4,3,2,1].map(r=>{const l=this._ratings[String(r)]??0,c=n===0?0:l/n;return f`
70 70 <div
71 71 class="row"
72 72 role="presentation"
73 - aria-label=${`${r} stars: ${a.format(d)}`}
73 + aria-label=${`${r} stars: ${i.format(l)}`}
74 74 >
75 75 <span class="row__label">
76 - ${r} ${$t()}
76 + ${r} ${Jt()}
77 77 </span>
78 78 <span class="row__track">
79 79 <span
80 80 class="row__fill"
@@ -80,20 +80,20 @@
80 80 class="row__fill"
81 81 style=${`--ratio: ${c.toFixed(4)}`}
82 82 ></span>
83 83 </span>
84 - <span class="row__count">${a.format(d)}</span>
84 + <span class="row__count">${i.format(l)}</span>
85 85 </div>
86 86 `})}
87 87 </div>
88 88 </div>
89 - `}};ee.props=["rating","total"],ee.styles=[pn],ee.help=void 0;let je=ee;function St(e,t){const o=e.getAttribute(t);if(o===null||o==="")return 0;const n=Number(o);return Number.isFinite(n)?n:0}function hn(e){return e<0?0:e>100?100:e}function gn(e,t){return t===0?"No ratings yet":`Average rating ${(e/100*5).toFixed(1)} out of 5, from ${t} ratings`}function mn(e){const t=Math.floor(e),o=e-t>=.5?1:0,n=5-t-o,s=[];for(let a=0;a<t;a++)s.push($t());for(let a=0;a<o;a++)s.push(fn());for(let a=0;a<n;a++)s.push(bn());return s}function $t(){return _`
89 + `}};ie.props=["rating","total"],ie.styles=[Rs],ie.help=void 0;let tt=ie;function Qt(o,e){const t=o.getAttribute(e);if(t===null||t==="")return 0;const s=Number(t);return Number.isFinite(s)?s:0}function Ps(o){return o<0?0:o>100?100:o}function qs(o,e){return e===0?"No ratings yet":`Average rating ${(o/100*5).toFixed(1)} out of 5, from ${e} ratings`}function Ds(o){const e=Math.floor(o),t=o-e>=.5?1:0,s=5-e-t,n=[];for(let i=0;i<e;i++)n.push(Jt());for(let i=0;i<t;i++)n.push(Ms());for(let i=0;i<s;i++)n.push(Is());return n}function Jt(){return f`
90 90 <svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
91 91 <path
92 92 d="M8 1.5l2.06 4.17 4.6.67-3.33 3.25.79 4.58L8 12L3.88 14.17l.79-4.58L1.34 6.34l4.6-.67L8 1.5z"
93 93 />
94 94 </svg>
95 - `}function fn(){return _`
95 + `}function Ms(){return f`
96 96 <svg viewBox="0 0 16 16" aria-hidden="true">
97 97 <defs>
98 98 <linearGradient id="os-half-star">
99 99 <stop offset="50%" stop-color="currentColor" />
@@ -108,9 +108,9 @@
108 108 fill="url(#os-half-star)"
109 109 d="M8 1.5l2.06 4.17 4.6.67-3.33 3.25.79 4.58L8 12L3.88 14.17l.79-4.58L1.34 6.34l4.6-.67L8 1.5z"
110 110 />
111 111 </svg>
112 - `}function bn(){return _`
112 + `}function Is(){return f`
113 113 <svg
114 114 class="empty"
115 115 viewBox="0 0 16 16"
116 116 fill="currentColor"
@@ -119,9 +119,9 @@
119 119 <path
120 120 d="M8 1.5l2.06 4.17 4.6.67-3.33 3.25.79 4.58L8 12L3.88 14.17l.79-4.58L1.34 6.34l4.6-.67L8 1.5z"
121 121 />
122 122 </svg>
123 - `}$("os-rating-summary",je);const Nt=`
123 + `}E("os-rating-summary",tt);const eo=`
124 124 .os-plugins__reviews { display: flex; flex-direction: column; gap: 16px; }
125 125 .os-plugins__reviews-grid { display: grid; grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) ); gap: 12px; }
126 126 .os-plugins__reviews-more, .os-plugins__reviews-cta { display: flex; justify-content: center; padding-top: 12px; }
127 127 .os-plugins__review { width: 100%; height: 100%; box-sizing: border-box; }
@@ -130,47 +130,75 @@
130 130 .os-plugins__review-body { margin: 0; font-size: 13px; color: var( --os-ui-fg, inherit ); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
131 131 .os-plugins__review-link { font-size: 12px; font-weight: 600; color: var( --wp-admin-theme-color, #2271b1 ); text-decoration: none; }
132 132 .os-plugins__review-link:hover { text-decoration: underline; }
133 133 .os-plugins__reviews-loading { display: inline-flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var( --os-ui-surface-raised, rgba( 255, 255, 255, 0.7 ) ); border: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ); color: var( --os-ui-fg-muted, #666 ); font-size: 13px; }
134 -`;function vn(e){const t=document.createElement("os-rating-summary");typeof e.rating=="number"&&t.setAttribute("rating",String(e.rating)),e.num_ratings&&t.setAttribute("total",String(e.num_ratings));const o={},n=e.ratings??{};for(const s of["1","2","3","4","5"]){const a=n[s];typeof a=="number"&&(o[s]=a)}return t.ratings=o,t}function O(e){const t=document.createElement("div");t.className="os-plugins__reviews-loading";const o=document.createElement("os-spinner");o.setAttribute("preset","classic"),o.setAttribute("size","20");const n=document.createElement("span");return n.textContent=e,t.append(o,n),t}function W(e,t,o){const n=document.createElement("os-empty-state");return n.setAttribute("icon",`dashicons-${e}`),n.setAttribute("heading",t),n.setAttribute("description",o),n}function Lt(e,t,o){const n=document.createElement("div");if(n.className="os-plugins__reviews",!o)return n.appendChild(O(l("Loading from WordPress.org…","desktop-mode"))),n;n.appendChild(vn(o));const s=document.createElement("div");n.appendChild(s);const a=e.caches.reviews.get(t);return a?(Tt(s,a,t),n):(s.appendChild(O(l("Loading recent reviews…","desktop-mode"))),(async()=>{try{const i=await e.rest.fetchPluginReviews(t);e.caches.reviews.set(t,i),s.isConnected&&Tt(s,i,t)}catch{s.isConnected&&s.replaceChildren(W("warning",l("Couldn’t load reviews","desktop-mode"),l("WordPress.org didn’t respond. Try again in a moment.","desktop-mode")))}})(),n)}function Tt(e,t,o){e.replaceChildren();const n=ue(o,"#reviews");if(!t.parsed){const i=W("external",l("Reviews live on WordPress.org","desktop-mode"),l("We couldn’t pull the review feed here. Open the full thread on WordPress.org to read every review.","desktop-mode")),r=U("primary",l("Open reviews on WordPress.org ↗","desktop-mode"),n,"small");r.setAttribute("slot","cta"),i.appendChild(r),e.appendChild(i);return}if(t.items.length===0){const i=document.createElement("div");i.className="os-plugins__reviews-cta",i.appendChild(U("primary",l("Write a review on WordPress.org ↗","desktop-mode"),`https://wordpress.org/support/plugin/${encodeURIComponent(o)}/reviews/#new-post`,"small")),e.appendChild(i);return}const s=document.createElement("div");s.className="os-plugins__reviews-grid";for(const i of t.items)s.appendChild(_n(i));e.appendChild(s);const a=document.createElement("div");a.className="os-plugins__reviews-more",a.appendChild(U("ghost",l("Read all reviews on WordPress.org ↗","desktop-mode"),n,"small")),e.appendChild(a)}function _n(e){const t=document.createElement("os-card");t.setAttribute("compact",""),t.className="os-plugins__review";const o=document.createElement("div");o.setAttribute("slot","header"),o.className="os-plugins__review-head";const n=document.createElement("strong");if(n.textContent=e.author||l("Anonymous","desktop-mode"),o.append(n,pe(e.stars/5*100,0)),e.date){const s=document.createElement("span");s.className="os-plugins__review-date",s.textContent=e.date,o.appendChild(s)}if(t.appendChild(o),e.excerpt){const s=document.createElement("p");s.className="os-plugins__review-body",s.textContent=e.excerpt,t.appendChild(s)}if(e.url){const s=document.createElement("div");s.setAttribute("slot","footer"),s.appendChild(V(e.url,l("Read full review ↗","desktop-mode"),"os-plugins__review-link")),t.appendChild(s)}return t}let zt=0;function yn(e,t,o,n){const s=++zt,a=()=>s===zt&&e.isConnected;e.replaceChildren();const i=document.createElement("div");i.className="os-plugins__flyout";const r=document.createElement("style");r.textContent=Nt;const d=xn(o),c=kn(),u=document.createElement("div");u.className="os-plugins__flyout-body";const p=document.createElement("footer");p.className="os-plugins__flyout-footer",i.append(r,d.root,c.root,u,p),e.appendChild(i),e.setAttribute("open","");let h=n.caches.info.get(t)??null;const b=()=>{An(p,t,h,n,()=>e.removeAttribute("open"),b)};b();const m=y=>wn(u,y,h,t,n);c.onChange(m),h&&Mt(d,h),m("overview"),!h&&(async()=>{try{const y=await n.rest.fetchPluginInfo(t);if(n.caches.info.set(t,y),!a())return;h=y,Mt(d,h),b(),m(c.current())}catch(y){if(!a())return;const f=document.createElement("p");f.className="os-plugins__flyout-error",f.textContent=y instanceof Error?y.message:l("Could not load plugin details.","desktop-mode"),u.replaceChildren(f)}})()}function xn(e){const t=document.createElement("header");t.className="os-plugins__flyout-hero";const o=document.createElement("div");o.className="os-plugins__flyout-banner",t.appendChild(o);const n=document.createElement("div");n.className="os-plugins__flyout-hero-inner";const s=document.createElement("div");s.className="os-plugins__flyout-hero-icon";const a=document.createElement("div");a.className="os-plugins__flyout-hero-text";const i=document.createElement("h2");i.className="os-plugins__flyout-hero-title";const r=document.createElement("p");r.className="os-plugins__flyout-hero-byline";const d=document.createElement("div"),c=document.createElement("div");d.appendChild(c),a.append(i,r,d),n.append(s,a),t.appendChild(n);const u=document.createElement("button");u.type="button",u.className="os-plugins__flyout-close",u.setAttribute("data-flyout-close",""),u.setAttribute("aria-label",l("Close plugin details","desktop-mode")),u.innerHTML=De("close",{size:20}),t.appendChild(u);const p={root:t,icon:s,title:i,byline:r,stars:c,meta:d,banner:o};return e&&Pt(p,e),p}function Pt(e,t){e.title.textContent=t.name,e.byline.textContent=v(l("by %s","desktop-mode"),z(t.author??"")),e.icon.replaceChildren();const o=he(t.icons);if(o){const n=document.createElement("img");n.src=o,n.alt="",e.icon.appendChild(n)}e.stars.replaceChildren(pe(t.rating??0,t.num_ratings??0))}function Mt(e,t){Pt(e,t);const o=t.banners?.high??t.banners?.low;o&&(e.banner.style.backgroundImage=`url("${o}")`,e.banner.classList.add("has-banner")),e.meta.querySelectorAll(":scope > .os-plugins__flyout-meta-row").forEach(i=>i.remove());const n=document.createElement("div");n.className="os-plugins__flyout-meta-row";const s=document.createElement("span");s.textContent=v(l("%s+ active","desktop-mode"),new Intl.NumberFormat().format(t.active_installs??0));const a=document.createElement("span");if(a.textContent=v(l("Updated %s","desktop-mode"),t.last_updated?nt(t.last_updated.slice(0,10),"long"):"—"),n.append(s,a),t.tested){const i=document.createElement("span");i.textContent=v(l("Tested up to WordPress %s","desktop-mode"),t.tested),n.appendChild(i)}e.meta.appendChild(n)}function kn(){const e=document.createElement("os-tabs");e.className="os-plugins__flyout-tabs",e.setAttribute("value","overview");const t=[{value:"overview",label:l("Overview","desktop-mode")},{value:"screenshots",label:l("Screenshots","desktop-mode")},{value:"reviews",label:l("Reviews","desktop-mode")},{value:"changelog",label:l("Changelog","desktop-mode")},{value:"faq",label:l("FAQ","desktop-mode")}];for(const s of t){const a=document.createElement("os-tab");a.setAttribute("value",s.value),a.textContent=s.label,e.appendChild(a)}let o="overview";const n=new Set;return e.addEventListener("os-tab-change",s=>{o=s.detail?.value??"overview";for(const i of n)i(o)}),{root:e,current:()=>o,onChange:s=>n.add(s)}}function wn(e,t,o,n,s){if(e.replaceChildren(),!o){e.appendChild(En(4));return}t==="overview"?e.appendChild(Fe(o.sections?.description??o.short_description??"")):t==="screenshots"?e.appendChild(Cn(o.screenshots)):t==="changelog"?e.appendChild(Fe(o.sections?.changelog??"")):t==="faq"?e.appendChild(Fe(o.sections?.faq??"")):e.appendChild(Lt(s,n,o))}function Fe(e){if(!e){const t=document.createElement("div");return t.className="os-plugins__html",t.appendChild(Dt(l("No content available.","desktop-mode"))),t}return ze(e,"os-plugins__html")}function Dt(e){const t=document.createElement("p");return t.className="os-plugins__empty-line",t.textContent=e,t}function Cn(e){const t=document.createElement("div");t.className="os-plugins__screenshots";const o=e?Object.values(e):[];if(o.length===0)return t.appendChild(Dt(l("This plugin doesn’t ship screenshots.","desktop-mode"))),t;for(const n of o){const s=document.createElement("figure");s.className="os-plugins__screenshot";const a=document.createElement("img");if(a.src=n.src,a.loading="lazy",a.alt=z(n.caption??""),s.appendChild(a),n.caption){const i=document.createElement("figcaption");i.innerHTML=bt(n.caption),_t(i),s.appendChild(i)}t.appendChild(s)}return t}function En(e){const t=document.createElement("div");t.className="os-plugins__skeleton";for(let o=0;o<e;o++){const n=document.createElement("span");n.className="os-plugins__skeleton-line",n.style.width=`${60+o*10%40}%`,t.appendChild(n)}return t}function An(e,t,o,n,s,a){e.replaceChildren();const i=n.extra.caps,r=n.installedFor(t),d=document.createElement("div");d.appendChild(V(ue(t),l("View on WordPress.org ↗","desktop-mode"),"os-plugins__flyout-wporg"));const c=document.createElement("div");if(c.className="os-plugins__flyout-footer-right",r)c.append(...pt(n,r,{size:"",onDone:(u,p)=>{u&&p==="delete"?s():a()}}));else if(i.install){const u=document.createElement("os-button");u.setAttribute("variant","primary"),u.textContent=l("Install","desktop-mode"),u.addEventListener("click",()=>{F(u,l("Installing…","desktop-mode")),lt(n,t,o?.name??t).catch(p=>n.toast(R(p),6e3)).finally(a)}),c.appendChild(u)}e.append(d,c)}const qt=24;function It(e){const{host:t}=e,o=new Map,n=()=>new Map(t.installed.map(r=>[we(r),r])),s=r=>r.querySelector("[data-plugin-card-cta]"),a={onOpen:(r,d)=>{const c=e.flyout();c&&yn(c,r,d,t)},onInstall:async(r,d)=>{const c=F(s(d),l("Installing…","desktop-mode"));await lt(t,r.slug,r.name)||c(),i()},onActivate:async(r,d)=>{const c=F(s(d),l("Activating…","desktop-mode"));await Se(t,r)||c(),i()}},i=()=>{const r=n();for(const{plugin:d,card:c}of o.values())Vo(c,d,r,a)};return{plugins:o,callbacks:a,installedIndex:n,repaintCtas:i,addCard:(r,d,c,u)=>{const p=Bo(d,n(),a);if(u){p.classList.add("os-plugins__card--featured");const h=document.createElement("os-ribbon");h.textContent=l("Featured","desktop-mode"),p.prepend(h)}Zo(p,d),r.insertBefore(p,c),o.set(d.slug,{plugin:d,card:p})},clear:()=>o.clear(),showStatus:(r,d)=>{r.hidden=!1,r.textContent=d},hideStatus:r=>{r.hidden=!0,r.textContent=""}}}function Sn(e){const t=It(e),o=document.createElement("div");o.className="os-plugins__gallery-sentinel",o.setAttribute("aria-hidden","true");let n=null,s=null,a=null,i="",r="featured",d="",c=1,u=0,p=!1,h=!1;const b=[],m=async()=>{if(n){c=1,u=0,h=!1,t.clear(),n.replaceChildren();for(let f=0;f<6;f++)n.appendChild(Pe());n.appendChild(o),await y()}},y=async()=>{if(!(!n||!s||p||h)){if(p=!0,c>1&&b.length===0)for(let f=0;f<4;f++){const w=Pe();n.insertBefore(w,o),b.push(w)}try{const f=await e.host.rest.browsePlugins({browse:d===""?r:void 0,search:d===""?void 0:d,page:c,perPage:qt});c===1&&(n.replaceChildren(),n.appendChild(o));const w=f.info??{};typeof w.pages=="number"&&w.pages>0&&(u=w.pages);const x=f.plugins??[];if(x.length===0){h=!0,c===1&&t.showStatus(s,l("No plugins matched.","desktop-mode"));return}for(const E of x)E?.slug&&!t.plugins.has(E.slug)&&t.addCard(n,E,o,!1);c++,(u>0?c>u:x.length<qt)&&(h=!0),t.hideStatus(s)}catch(f){t.showStatus(s,v(l("Could not load plugins: %s","desktop-mode"),R(f)))}finally{for(const f of b)f.remove();b.length=0,p=!1}}};return{sync:f=>{s=f.status,f.gallery!==n&&(n=f.gallery,a?.disconnect(),a=null,i="",n&&(a=new IntersectionObserver(x=>{x.some(E=>E.isIntersecting)&&y()},{root:n,rootMargin:"240px",threshold:0}),a.observe(o)));const w=`${f.filter}|${f.query}`;n&&f.active&&w!==i&&(i=w,r=f.filter,d=f.query,m())},reset:()=>void m(),repaintCtas:t.repaintCtas,dispose:()=>{a?.disconnect(),a=null}}}function $n(e){const t=It(e);let o=null,n=!1;const s=async a=>{if(o){n=!0,o.replaceChildren(),t.clear();for(let i=0;i<3;i++)o.appendChild(Pe());try{const i=await e.host.rest.fetchFeaturedPlugins();o.replaceChildren();for(const r of i.plugins??[])r?.slug&&t.addCard(o,r,null,!!r.featured);a&&(t.plugins.size===0?t.showStatus(a,l("No featured plugins yet.","desktop-mode")):t.hideStatus(a))}catch(i){o.replaceChildren(),n=!1,a&&t.showStatus(a,v(l("Could not load featured plugins: %s","desktop-mode"),R(i)))}}};return{sync:a=>{a.gallery&&a.gallery!==o&&(o=a.gallery,n=!1),o&&a.active&&!n&&s(a.status)},repaintCtas:t.repaintCtas}}const Nn=/^(https:\/\/ps\.w\.org\/[a-z0-9-]+\/assets\/)icon\.svg$/i;function Ln(e){const t=e.match(Nn);if(!t)return[e];const o=t[1];return[e,o+"icon-256x256.png",o+"icon-256x256.jpg",o+"icon-256x256.jpeg",o+"icon-256x256.gif",o+"icon-128x128.png",o+"icon-128x128.jpg",o+"icon-128x128.jpeg",o+"icon-128x128.gif"]}function Rt(e,t,o){const n=Ln(t);let s=0;return e.addEventListener("error",()=>{if(s+=1,s<n.length){e.src=n[s];return}o()}),n[0]}const Tn=k` ${B}:host{display:inline-flex;align-items:center;gap:var( --os-ui-badge-gap,6px );padding:var( --os-ui-badge-padding,2px 8px );font:var( --os-ui-badge-font,500 12px/1.4 var( --os-font,system-ui ) );color:var( --os-ui-badge-color,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-badge-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );border:var( --os-ui-badge-border,1px solid transparent );border-radius:var( --os-ui-badge-border-radius,999px );white-space:nowrap;vertical-align:baseline}:host( [ hidden ] ){display:none}.dot{width:var( --os-ui-badge-dot-size,8px );height:var( --os-ui-badge-dot-size,8px );border-radius:50%;background:currentColor;flex:0 0 auto}:host( [ tone="success" ] ){--os-ui-badge-color:var( --os-ui-badge-success,var( --os-ui-success-fg,#1a7f37 ) );--os-ui-badge-bg:var( --os-ui-badge-success-bg,rgba( 26,127,55,0.12 ) )}:host( [ tone="warning" ] ){--os-ui-badge-color:var( --os-ui-badge-warning,var( --os-ui-warning-fg,#9a6700 ) );--os-ui-badge-bg:var( --os-ui-badge-warning-bg,rgba( 154,103,0,0.12 ) )}:host( [ tone="danger" ] ){--os-ui-badge-color:var( --os-ui-badge-danger,var( --os-ui-danger,#cf222e ) );--os-ui-badge-bg:var( --os-ui-badge-danger-bg,rgba( 207,34,46,0.12 ) )}:host( [ tone="info" ] ){--os-ui-badge-color:var( --os-ui-badge-info,var( --os-ui-info-fg,#0969da ) );--os-ui-badge-bg:var( --os-ui-badge-info-bg,rgba( 9,105,218,0.12 ) )}:host( [ tone="neutral" ] ){--os-ui-badge-color:var( --os-ui-badge-neutral,var( --os-ui-fg-muted,#57606a ) );--os-ui-badge-bg:var( --os-ui-badge-neutral-bg,rgba( 87,96,106,0.12 ) )}:host( [ tone="accent" ] ){--os-ui-badge-color:var( --os-ui-badge-accent,var( --_holo-ink ) );background-color:transparent;background-image:var( --os-ui-badge-accent-bg,var( --_holo-fill ) );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;box-shadow:var( --_holo-glow );font-weight:600}:host( [ tone="accent" ] ) .dot{display:none}:host( [ no-dot ] ) .dot{display:none}`,te=class te extends S{render(){return _`<span class="dot" aria-hidden="true"></span><slot></slot>`}};te.props=["tone","noDot"],te.styles=[Tn],te.help=void 0;let Be=te;$("os-badge",Be);const zn=k` ${B}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,oe=class oe extends S{constructor(){super(...arguments),this._onHostKeyDown=t=>{if(this.dismissible!==null&&(t.key==="Backspace"||t.key==="Delete")){if(t.preventDefault(),this.disabled!==null)return;const s=this.label??"";this.emit("os-chip-dismiss",{label:s})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const t=this.label??"",o=this.dismissible!==null,n=this.disabled!==null;return _`
135 - <span part="chip" class="os-chip">
136 - <span class="os-chip__icon">
137 - <slot name="icon"></slot>
138 - </span>
139 - <span class="os-chip__label">
140 - ${t===""?_`<slot></slot>`:t}
141 - </span>
142 - ${o?_`
143 - <button
144 - part="dismiss"
145 - class="os-chip__dismiss"
146 - type="button"
147 - aria-label=${`Remove ${t||"chip"}`}
148 - ?disabled=${n}
149 - @click=${s=>this._onDismiss(s)}
150 - >
151 - ${Jo("close",{size:null})}
152 - </button>
153 - `:_``}
154 - </span>
155 - `}_onDismiss(t){if(t.stopPropagation(),this.disabled!==null)return;const n=this.label??"";this.emit("os-chip-dismiss",{label:n})}};oe.props=["label","tone","size","dismissible","disabled","pending","selected"],oe.styles=[zn],oe.help=void 0;let Ve=oe;$("os-chip",Ve);const Pn=k`:host{display:flex;flex-direction:row;flex-wrap:wrap;gap:var( --os-ui-cluster-gap,8px );justify-content:var( --os-ui-cluster-justify,flex-start );align-items:var( --os-ui-cluster-align,center )}:host( [ hidden ] ){display:none}`,ne=class ne extends S{render(){const t=this.gap,o=this.justify,n=this.align,s=t&&/^\d+$/.test(t)?`${t}px`:"";return s&&this.style.setProperty("--os-ui-cluster-gap",s),o&&this.style.setProperty("--os-ui-cluster-justify",o),n&&this.style.setProperty("--os-ui-cluster-align",n),_`<slot></slot>`}};ne.props=["gap","justify","align"],ne.styles=[Pn],ne.help=void 0;let Oe=ne;$("os-cluster",Oe);const Mn=k`:host{display:grid;grid-template-columns:var( --os-ui-grid-columns,1fr );grid-template-rows:var( --os-ui-grid-rows,auto );gap:var( --os-ui-grid-gap,8px );column-gap:var( --os-ui-grid-column-gap,var( --os-ui-grid-gap,8px ) );row-gap:var( --os-ui-grid-row-gap,var( --os-ui-grid-gap,8px ) )}:host( [ hidden ] ){display:none}`,se=class se extends S{render(){const t=this.columns,o=this.rows,n=this.gap,s=this["column-gap"],a=this["row-gap"];return t&&/^\d+$/.test(t)&&this.style.setProperty("--os-ui-grid-columns",`repeat(${t}, minmax(0, 1fr))`),o&&/^\d+$/.test(o)&&this.style.setProperty("--os-ui-grid-rows",`repeat(${o}, minmax(0, 1fr))`),n&&/^\d+$/.test(n)&&this.style.setProperty("--os-ui-grid-gap",`${n}px`),s&&/^\d+$/.test(s)&&this.style.setProperty("--os-ui-grid-column-gap",`${s}px`),a&&/^\d+$/.test(a)&&this.style.setProperty("--os-ui-grid-row-gap",`${a}px`),_`<slot></slot>`}};se.props=["columns","rows","gap","column-gap","row-gap"],se.styles=[Mn],se.help=void 0;let We=se;$("os-grid",We);const Dn=k`:host{display:flex;flex-direction:column;gap:var( --os-ui-stack-gap,12px );align-items:var( --os-ui-stack-align,stretch );padding:var( --os-ui-stack-padding,0 )}:host( [ hidden ] ){display:none}`,ae=class ae extends S{render(){const t=this.gap,o=this.align,n=this.padding,s=t&&/^\d+$/.test(t)?`${t}px`:"";return s&&this.style.setProperty("--os-ui-stack-gap",s),o&&this.style.setProperty("--os-ui-stack-align",o),n!==null&&/^\d+$/.test(n)&&this.style.setProperty("--os-ui-stack-padding",`${n}px`),_`<slot></slot>`}};ae.props=["gap","align","padding"],ae.styles=[Dn],ae.help=void 0;let Ze=ae;$("os-stack",Ze);const me=e=>ze(e,"os-plugins__detail-html");function qn(e){const t=ce(e),o=[];let n=null;const s=/([0-9]+\.[0-9]+(?:\.[0-9]+)?(?:[\w.+-]*)?)/,a=()=>{n&&(o.push({version:n.version,body:n.html.trim()}),n=null)};for(const i of Array.from(t.childNodes)){if(i.nodeType===Node.ELEMENT_NODE){const r=i,d=/^H[1-6]$/.test(r.tagName),c=(r.textContent??"").trim().replace(/^=+\s*|\s*=+$/g,"").trim();if(d&&s.test(c)){a(),n={version:c,html:""};continue}n&&(n.html+=r.outerHTML);continue}i.nodeType===Node.TEXT_NODE&&n&&Ut(n,i.textContent??"")}return a(),o}function Ut(e,t){if(t.trim()===""){e.html!==""&&(e.html+=t);return}e.html+=`<p>${vt(t)}</p>`}function In(e){const t=ce(e),o=Array.from(t.querySelectorAll(":scope > dt"));if(o.length>0)return o.map(Rn).filter(r=>r.question!=="");const n=t.querySelector(":scope > dl");if(n){const r=[];let d=null;for(const c of Array.from(n.children))c.tagName==="DT"?(d&&r.push({question:d.q,answer:d.html.trim()}),d={q:(c.textContent??"").trim(),html:""}):d&&(d.html+=c.tagName==="DD"?c.innerHTML:c.outerHTML);return d&&r.push({question:d.q,answer:d.html.trim()}),r.filter(c=>c.question!=="")}const s=[];let a=null;const i=()=>{a&&(s.push({question:a.q,answer:a.html.trim()}),a=null)};for(const r of Array.from(t.childNodes)){if(r.nodeType===Node.ELEMENT_NODE){const d=r,c=(d.textContent??"").trim();if(/^H[1-6]$/.test(d.tagName)&&c){i(),a={q:c,html:""};continue}a&&(a.html+=d.outerHTML);continue}r.nodeType===Node.TEXT_NODE&&a&&Ut(a,r.textContent??"")}return i(),s.filter(r=>r.question!=="")}function Rn(e){let t="",o="",n=!1;for(const s of Array.from(e.childNodes)){if(s.nodeType===Node.TEXT_NODE){const i=s.textContent??"";n?i.trim()!==""&&(o+=`<p>${vt(i)}</p>`):t+=i;continue}if(s.nodeType!==Node.ELEMENT_NODE)continue;const a=s;a.tagName==="P"&&(a.textContent??"").trim()===""||(n=!0,o+=a.outerHTML)}return{question:t.replace(/\s+/g," ").trim(),answer:o.trim()}}function Un(e){if(!e)return O(l("Loading from WordPress.org…","desktop-mode"));const t=e.sections?.changelog;if(!t)return W("list-view",l("No changelog","desktop-mode"),l("This plugin doesn’t ship a changelog.","desktop-mode"));const o=qn(t);if(o.length===0)return me(t);const n=document.createElement("os-stack");return n.setAttribute("gap","12"),n.className="os-plugins__detail-changelog",o.forEach((s,a)=>{const i=document.createElement("os-card");i.className="os-plugins__detail-changelog-entry";const r=document.createElement("div");r.setAttribute("slot","header"),r.className="os-plugins__detail-changelog-head";const d=document.createElement("os-badge");if(d.setAttribute("tone",a===0?"success":"neutral"),d.textContent=s.version,r.appendChild(d),a===0){const c=document.createElement("span");c.className="os-plugins__detail-changelog-latest",c.textContent=l("Latest","desktop-mode"),r.appendChild(c)}i.appendChild(r),i.appendChild(me(s.body)),n.appendChild(i)}),n}function Hn(e){if(!e)return O(l("Loading from WordPress.org…","desktop-mode"));const t=e.sections?.faq;if(!t)return W("editor-help",l("No FAQ","desktop-mode"),l("This plugin doesn’t ship an FAQ.","desktop-mode"));const o=In(t);if(o.length===0)return me(t);const n=document.createElement("os-stack");return n.setAttribute("gap","8"),n.className="os-plugins__detail-faq",o.forEach((s,a)=>{const i=document.createElement("details");i.className="os-plugins__detail-faq-item",a===0&&i.setAttribute("open","");const r=document.createElement("summary");r.className="os-plugins__detail-faq-q";const d=document.createElement("span");d.className="os-plugins__detail-faq-q-text",d.textContent=s.question;const c=document.createElement("span");c.className="os-plugins__detail-faq-chevron",c.setAttribute("aria-hidden","true"),c.innerHTML=De("chevron-right",{size:16,rotate:90}),r.append(d,c);const u=me(s.answer);u.classList.add("os-plugins__detail-faq-a"),i.append(r,u),n.appendChild(i)}),n}function jn(e,t){const o=document.createElement("div");o.className="os-plugins__detail",o.setAttribute("data-noclick","");const n=Zn(e);o.appendChild(Fn(e));const s=document.createElement("div");s.className="os-plugins__detail-tabs-wrap",o.appendChild(s);const a=document.createElement("div");a.className="os-plugins__detail-body",o.appendChild(a);const i=document.createElement("os-tabs");i.className="os-plugins__detail-tabs",i.setAttribute("value","overview");const r=[{value:"overview",label:l("Overview","desktop-mode"),show:!0},{value:"details",label:l("Details","desktop-mode"),show:!0},{value:"changelog",label:l("Changelog","desktop-mode"),show:!!n},{value:"faq",label:l("FAQ","desktop-mode"),show:!!n},{value:"reviews",label:l("Reviews","desktop-mode"),show:!!n}];for(const b of r){if(!b.show)continue;const m=document.createElement("os-tab");m.setAttribute("value",b.value),m.textContent=b.label,i.appendChild(m)}s.appendChild(i);let d=n?t.caches.info.get(n)??null:null,c=!1,u="overview";const p=()=>{a.replaceChildren(Bn(u,e,n,d,t))},h=()=>{!n||d||c||(c=!0,(async()=>{try{d=await t.rest.fetchPluginInfo(n),t.caches.info.set(n,d)}catch{}finally{c=!1,o.isConnected&&p()}})())};return i.addEventListener("os-tab-change",b=>{u=b.detail?.value??"overview",n&&u!=="overview"&&u!=="details"&&h(),p()}),p(),o}function Fn(e){const t=document.createElement("div");t.className="os-plugins__detail-hero";const o=document.createElement("div");o.className="os-plugins__detail-hero-inner";const n=document.createElement("div");n.className="os-plugins__detail-hero-icon";const s=e.openstation_icon_url;if(s){const p=document.createElement("img");p.alt="",p.loading="lazy",p.decoding="async",p.src=Rt(p,s,()=>{n.replaceChildren(D())}),n.appendChild(p)}else n.appendChild(D());const a=document.createElement("os-stack");a.setAttribute("gap","6"),a.className="os-plugins__detail-hero-text";const i=document.createElement("os-cluster");i.setAttribute("gap","10"),i.setAttribute("align","center");const r=document.createElement("h3");if(r.className="os-plugins__detail-title",r.textContent=e.name||e.plugin,i.appendChild(r),e.version){const p=document.createElement("os-badge");p.setAttribute("tone","neutral"),p.setAttribute("no-dot",""),p.textContent=v(l("v%s","desktop-mode"),e.version),i.appendChild(p)}i.appendChild(Ht(e));const d=e.openstation_update_available;if(d?.available&&d.new_version){const p=document.createElement("os-badge");p.setAttribute("tone","warning"),p.textContent=v(l("Update to %s","desktop-mode"),d.new_version),i.appendChild(p)}a.appendChild(i);const c=document.createElement("p");c.className="os-plugins__detail-byline";const u=z(e.author??"")||l("Unknown author","desktop-mode");return e.author_uri?c.append(l("by","desktop-mode")+" ",V(e.author_uri,u)):c.textContent=v(l("by %s","desktop-mode"),u),a.appendChild(c),o.append(n,a),t.appendChild(o),t}function Ht(e){const t=M(e.status),o=document.createElement("os-badge");return o.setAttribute("tone",t?"success":"neutral"),o.textContent=l(t?"Active":"Inactive","desktop-mode"),o}function Bn(e,t,o,n,s){return e==="overview"?Vn(t,o,n):e==="details"?Wn(t):e==="changelog"?Un(n):e==="faq"?Hn(n):Lt(s,o,n)}function Vn(e,t,o){const n=document.createElement("os-stack");n.setAttribute("gap","20");const s=On(e,o);s.children.length>0&&n.appendChild(s);const a=o?.sections?.description??o?.short_description??Kn(e);a?n.appendChild(ze(a,"os-plugins__detail-html")):t&&!o?n.appendChild(O(l("Loading description…","desktop-mode"))):n.appendChild(W("admin-plugins",l("No description","desktop-mode"),l("This plugin doesn’t ship a description in its header.","desktop-mode")));const i=document.createElement("os-cluster");return i.setAttribute("gap","8"),i.className="os-plugins__detail-actions",t&&i.appendChild(U("primary",l("View on WordPress.org","desktop-mode"),ue(t),"small")),e.plugin_uri&&i.appendChild(U("secondary",l("Plugin website","desktop-mode"),e.plugin_uri,"small")),e.author_uri&&i.appendChild(U("ghost",l("Author website","desktop-mode"),e.author_uri,"small")),i.children.length>0&&n.appendChild(i),n}function On(e,t){const o=document.createElement("os-cluster");if(o.setAttribute("gap","8"),o.className="os-plugins__detail-chip-strip",t){if(typeof t.rating=="number"&&t.rating>0){const n=document.createElement("span");n.className="os-plugins__detail-stars-pill",n.appendChild(pe(t.rating,t.num_ratings??0)),o.appendChild(n)}t.active_installs&&o.appendChild(H("admin-users",v(l("%s+ active installs","desktop-mode"),new Intl.NumberFormat().format(t.active_installs)))),t.last_updated&&o.appendChild(H("update",v(l("Updated %s","desktop-mode"),nt(t.last_updated.slice(0,10),"long")))),t.tested&&o.appendChild(H("wordpress-alt",v(l("Tested up to WP %s","desktop-mode"),t.tested)))}return e.requires_wp&&o.appendChild(H("wordpress",v(l("Requires WP %s+","desktop-mode"),e.requires_wp))),e.requires_php&&o.appendChild(H("editor-code",v(l("Requires PHP %s+","desktop-mode"),e.requires_php))),e.network_only&&o.appendChild(H("networking",l("Network only","desktop-mode"))),o}function Wn(e){const t=document.createElement("os-grid");t.setAttribute("columns","2"),t.setAttribute("gap","12"),t.className="os-plugins__detail-grid";const o=M(e.status);return N(t,"media-document",l("Plugin file","desktop-mode"),jt(e.plugin)),e.version&&N(t,"tag",l("Version","desktop-mode"),e.version),e.openstation_size_kb!==null&&e.openstation_size_kb!==void 0&&N(t,"database",l("Size on disk","desktop-mode"),ye(e.openstation_size_kb*1024)),e.requires_wp&&N(t,"wordpress-alt",l("Requires WordPress","desktop-mode"),v(l("%s+","desktop-mode"),e.requires_wp)),e.requires_php&&N(t,"editor-code",l("Requires PHP","desktop-mode"),v(l("%s+","desktop-mode"),e.requires_php)),e.textdomain&&N(t,"translation",l("Text domain","desktop-mode"),jt(String(e.textdomain))),e.plugin_uri&&N(t,"admin-links",l("Plugin URL","desktop-mode"),V(e.plugin_uri,e.plugin_uri)),e.author_uri&&N(t,"admin-users",l("Author URL","desktop-mode"),V(e.author_uri,e.author_uri)),e.network_only&&N(t,"networking",l("Scope","desktop-mode"),l("Network only","desktop-mode")),N(t,o?"yes-alt":"marker",l("Status","desktop-mode"),l(o?"Active":"Inactive","desktop-mode")),t}function N(e,t,o,n){const s=document.createElement("os-card");s.setAttribute("compact",""),s.className="os-plugins__detail-fact";const a=document.createElement("div");a.setAttribute("slot","header"),a.className="os-plugins__detail-fact-head";const i=document.createElement("span");i.className=`dashicons dashicons-${t}`,i.setAttribute("aria-hidden","true");const r=document.createElement("span");r.textContent=o,a.append(i,r),s.appendChild(a);const d=document.createElement("div");d.className="os-plugins__detail-fact-value",typeof n=="string"?d.textContent=n:d.appendChild(n),s.appendChild(d),e.appendChild(s)}function H(e,t){const o=document.createElement("os-chip");o.setAttribute("label",t),o.setAttribute("tone","neutral");const n=document.createElement("span");return n.setAttribute("slot","icon"),n.className=`dashicons dashicons-${e}`,n.setAttribute("aria-hidden","true"),o.appendChild(n),o}function jt(e){const t=document.createElement("code");return t.textContent=e,t}function Zn(e){const t=e.openstation_wporg_slug;return typeof t=="string"?t:""}function Kn(e){const t=e.description;return t?typeof t=="string"?t:t.rendered||t.raw||"":""}const Gn=`
156 -.os-plugins__name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; padding-block: 4px; }
157 -.os-plugins__name-icon { flex: 0 0 32px; width: 32px; height: 32px; max-width: 32px; max-height: 32px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var( --os-ui-surface-sunken, rgba( 0, 0, 0, 0.04 ) ); box-sizing: border-box; }
158 -.os-plugins__name-icon img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
159 -.os-plugins__name-icon .dashicons { font-size: 18px; width: 18px; height: 18px; line-height: 18px; color: var( --os-ui-fg-muted, #888 ); }
160 -.os-plugins__name-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; line-height: 1.35; }
161 -.os-plugins__name-text > strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
162 -.os-plugins__name-path { display: block; font-size: 0.78em; color: var( --os-ui-fg-muted, #888 ); font-family: var( --os-ui-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace ); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
163 -.os-plugins__version-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
164 -.os-plugins__update-badge { font-size: 0.78em; background: var( --os-ui-badge-warning-bg, rgba( 245, 175, 0, 0.18 ) ); color: var( --os-ui-warning-fg, #915f00 ); padding: 1px 7px; border-radius: 999px; font-weight: 600; }
165 -.os-plugins__author-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
166 -.os-plugins__auto-update { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
167 -.os-plugins__auto-update-fixed { color: var( --os-ui-fg-muted, #50575e ); }
168 -.os-plugins__auto-update-none { color: var( --os-ui-fg-faint, #787c82 ); }
169 -.os-plugins__row-actions { display: inline-flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
170 -.os-plugins__row-actions os-button { flex: 0 0 auto; }
171 -.os-plugins__update-hint { font-size: 0.78em; color: var( --os-ui-fg-muted, #50575e ); }
172 -`+`
134 +`;function Hs(o){const e=document.createElement("os-rating-summary");typeof o.rating=="number"&&e.setAttribute("rating",String(o.rating)),o.num_ratings&&e.setAttribute("total",String(o.num_ratings));const t={},s=o.ratings??{};for(const n of["1","2","3","4","5"]){const i=s[n];typeof i=="number"&&(t[n]=i)}return e.ratings=t,e}function Z(o){const e=document.createElement("div");e.className="os-plugins__reviews-loading";const t=document.createElement("os-spinner");t.setAttribute("preset","classic"),t.setAttribute("size","20");const s=document.createElement("span");return s.textContent=o,e.append(t,s),e}function G(o,e,t){const s=document.createElement("os-empty-state");return s.setAttribute("icon",`dashicons-${o}`),s.setAttribute("heading",e),s.setAttribute("description",t),s}function to(o,e,t){const s=document.createElement("div");if(s.className="os-plugins__reviews",!t)return s.appendChild(Z(d("Loading from WordPress.org…","desktop-mode"))),s;s.appendChild(Hs(t));const n=document.createElement("div");s.appendChild(n);const i=o.caches.reviews.get(e);return i?(oo(n,i,e),s):(n.appendChild(Z(d("Loading recent reviews…","desktop-mode"))),(async()=>{try{const a=await o.rest.fetchPluginReviews(e);o.caches.reviews.set(e,a),n.isConnected&&oo(n,a,e)}catch{n.isConnected&&n.replaceChildren(G("warning",d("Couldn’t load reviews","desktop-mode"),d("WordPress.org didn’t respond. Try again in a moment.","desktop-mode")))}})(),s)}function oo(o,e,t){o.replaceChildren();const s=Ce(t,"#reviews");if(!e.parsed){const a=G("external",d("Reviews live on WordPress.org","desktop-mode"),d("We couldn’t pull the review feed here. Open the full thread on WordPress.org to read every review.","desktop-mode")),r=H("primary",d("Open reviews on WordPress.org ↗","desktop-mode"),s,"small");r.setAttribute("slot","cta"),a.appendChild(r),o.appendChild(a);return}if(e.items.length===0){const a=document.createElement("div");a.className="os-plugins__reviews-cta",a.appendChild(H("primary",d("Write a review on WordPress.org ↗","desktop-mode"),`https://wordpress.org/support/plugin/${encodeURIComponent(t)}/reviews/#new-post`,"small")),o.appendChild(a);return}const n=document.createElement("div");n.className="os-plugins__reviews-grid";for(const a of e.items)n.appendChild(Us(a));o.appendChild(n);const i=document.createElement("div");i.className="os-plugins__reviews-more",i.appendChild(H("ghost",d("Read all reviews on WordPress.org ↗","desktop-mode"),s,"small")),o.appendChild(i)}function Us(o){const e=document.createElement("os-card");e.setAttribute("compact",""),e.className="os-plugins__review";const t=document.createElement("div");t.setAttribute("slot","header"),t.className="os-plugins__review-head";const s=document.createElement("strong");if(s.textContent=o.author||d("Anonymous","desktop-mode"),t.append(s,Ae(o.stars/5*100,0)),o.date){const n=document.createElement("span");n.className="os-plugins__review-date",n.textContent=o.date,t.appendChild(n)}if(e.appendChild(t),o.excerpt){const n=document.createElement("p");n.className="os-plugins__review-body",n.textContent=o.excerpt,e.appendChild(n)}if(o.url){const n=document.createElement("div");n.setAttribute("slot","footer"),n.appendChild(B(o.url,d("Read full review ↗","desktop-mode"),"os-plugins__review-link")),e.appendChild(n)}return e}let so=0;function Fs(o,e,t,s){const n=++so,i=()=>n===so&&o.isConnected;o.replaceChildren();const a=document.createElement("div");a.className="os-plugins__flyout";const r=document.createElement("style");r.textContent=eo;const l=Vs(t),c=Ws(),p=document.createElement("div");p.className="os-plugins__flyout-body";const u=document.createElement("footer");u.className="os-plugins__flyout-footer",a.append(r,l.root,c.root,p,u),o.appendChild(a),o.setAttribute("open","");let g=s.caches.info.get(e)??null;const b=()=>{Ks(u,e,g,s,()=>o.removeAttribute("open"),b)};b();const h=_=>js(p,_,g,e,s);c.onChange(h),g&&io(l,g),h("overview"),!g&&(async()=>{try{const _=await s.rest.fetchPluginInfo(e);if(s.caches.info.set(e,_),!i())return;g=_,io(l,g),b(),h(c.current())}catch(_){if(!i())return;const m=document.createElement("p");m.className="os-plugins__flyout-error",m.textContent=_ instanceof Error?_.message:d("Could not load plugin details.","desktop-mode"),p.replaceChildren(m)}})()}function Vs(o){const e=document.createElement("header");e.className="os-plugins__flyout-hero";const t=document.createElement("div");t.className="os-plugins__flyout-banner",e.appendChild(t);const s=document.createElement("div");s.className="os-plugins__flyout-hero-inner";const n=document.createElement("div");n.className="os-plugins__flyout-hero-icon";const i=document.createElement("div");i.className="os-plugins__flyout-hero-text";const a=document.createElement("h2");a.className="os-plugins__flyout-hero-title";const r=document.createElement("p");r.className="os-plugins__flyout-hero-byline";const l=document.createElement("div"),c=document.createElement("div");l.appendChild(c),i.append(a,r,l),s.append(n,i),e.appendChild(s);const p=document.createElement("button");p.type="button",p.className="os-plugins__flyout-close",p.setAttribute("data-flyout-close",""),p.setAttribute("aria-label",d("Close plugin details","desktop-mode")),p.innerHTML=Ge("close",{size:20}),e.appendChild(p);const u={root:e,icon:n,title:a,byline:r,stars:c,meta:l,banner:t};return o&&no(u,o),u}function no(o,e){o.title.textContent=$(e.name),o.byline.textContent=y(d("by %s","desktop-mode"),$(e.author??"")),o.icon.replaceChildren();const t=Ee(e.icons);if(t){const s=document.createElement("img");s.src=t,s.alt="",o.icon.appendChild(s)}o.stars.replaceChildren(Ae(e.rating??0,e.num_ratings??0))}function io(o,e){no(o,e);const t=e.banners?.high??e.banners?.low;t&&(o.banner.style.backgroundImage=`url("${t}")`,o.banner.classList.add("has-banner")),o.meta.querySelectorAll(":scope > .os-plugins__flyout-meta-row").forEach(a=>a.remove());const s=document.createElement("div");s.className="os-plugins__flyout-meta-row";const n=document.createElement("span");n.textContent=y(d("%s+ active","desktop-mode"),new Intl.NumberFormat().format(e.active_installs??0));const i=document.createElement("span");if(i.textContent=y(d("Updated %s","desktop-mode"),e.last_updated?Ct(e.last_updated.slice(0,10),"long"):"—"),s.append(n,i),e.tested){const a=document.createElement("span");a.textContent=y(d("Tested up to WordPress %s","desktop-mode"),e.tested),s.appendChild(a)}o.meta.appendChild(s)}function Ws(){const o=document.createElement("os-tabs");o.className="os-plugins__flyout-tabs",o.setAttribute("value","overview");const e=[{value:"overview",label:d("Overview","desktop-mode")},{value:"screenshots",label:d("Screenshots","desktop-mode")},{value:"reviews",label:d("Reviews","desktop-mode")},{value:"changelog",label:d("Changelog","desktop-mode")},{value:"faq",label:d("FAQ","desktop-mode")}];for(const n of e){const i=document.createElement("os-tab");i.setAttribute("value",n.value),i.textContent=n.label,o.appendChild(i)}let t="overview";const s=new Set;return o.addEventListener("os-tab-change",n=>{t=n.detail?.value??"overview";for(const a of s)a(t)}),{root:o,current:()=>t,onChange:n=>s.add(n)}}function js(o,e,t,s,n){if(o.replaceChildren(),!t){o.appendChild(Bs(4));return}e==="overview"?o.appendChild(ot(t.sections?.description??t.short_description??"")):e==="screenshots"?o.appendChild(Os(t.screenshots)):e==="changelog"?o.appendChild(ot(t.sections?.changelog??"")):e==="faq"?o.appendChild(ot(t.sections?.faq??"")):o.appendChild(to(n,s,t))}function ot(o){if(!o){const e=document.createElement("div");return e.className="os-plugins__html",e.appendChild(ao(d("No content available.","desktop-mode"))),e}return Be(o,"os-plugins__html")}function ao(o){const e=document.createElement("p");return e.className="os-plugins__empty-line",e.textContent=o,e}function Os(o){const e=document.createElement("div");e.className="os-plugins__screenshots";const t=o?Object.values(o):[];if(t.length===0)return e.appendChild(ao(d("This plugin doesn’t ship screenshots.","desktop-mode"))),e;for(const s of t){const n=document.createElement("figure");n.className="os-plugins__screenshot";const i=document.createElement("img");if(i.src=s.src,i.loading="lazy",i.alt=$(s.caption??""),n.appendChild(i),s.caption){const a=document.createElement("figcaption");a.innerHTML=Vt(s.caption),jt(a),n.appendChild(a)}e.appendChild(n)}return e}function Bs(o){const e=document.createElement("div");e.className="os-plugins__skeleton";for(let t=0;t<o;t++){const s=document.createElement("span");s.className="os-plugins__skeleton-line",s.style.width=`${60+t*10%40}%`,e.appendChild(s)}return e}function Ks(o,e,t,s,n,i){o.replaceChildren();const a=s.extra.caps,r=s.installedFor(e),l=document.createElement("div");l.appendChild(B(Ce(e),d("View on WordPress.org ↗","desktop-mode"),"os-plugins__flyout-wporg"));const c=document.createElement("div");if(c.className="os-plugins__flyout-footer-right",r)c.append(...Tt(s,r,{size:"",onDone:(p,u)=>{p&&u==="delete"?n():i()}}));else if(a.install){const p=document.createElement("os-button");p.setAttribute("variant","primary"),p.textContent=d("Install","desktop-mode"),p.addEventListener("click",()=>{O(p,d("Installing…","desktop-mode")),zt(s,e,t?.name??e).catch(u=>s.toast(I(u),6e3)).finally(i)}),c.appendChild(p)}o.append(l,c)}const ro=24;function lo(o){const{host:e}=o,t=new Map,s=()=>new Map(e.installed.map(r=>[qe(r),r])),n=r=>r.querySelector("[data-plugin-card-cta]"),i={onOpen:(r,l)=>{const c=o.flyout();c&&Fs(c,r,l,e)},onInstall:async(r,l)=>{const c=O(n(l),d("Installing…","desktop-mode"));await zt(e,r.slug,r.name)||c(),a()},onActivate:async(r,l)=>{const c=O(n(l),d("Activating…","desktop-mode"));await He(e,r)||c(),a()}},a=()=>{const r=s();for(const{plugin:l,card:c}of t.values())ps(c,l,r,i)};return{plugins:t,callbacks:i,installedIndex:s,repaintCtas:a,addCard:(r,l,c,p)=>{const u=us(l,s(),i);if(p){u.classList.add("os-plugins__card--featured");const g=document.createElement("os-ribbon");g.textContent=d("Featured","desktop-mode"),u.prepend(g)}fs(u,l),r.insertBefore(u,c),t.set(l.slug,{plugin:l,card:u})},clear:()=>t.clear(),showStatus:(r,l)=>{r.hidden=!1,r.textContent=l},hideStatus:r=>{r.hidden=!0,r.textContent=""}}}function Zs(o){const e=lo(o),t=document.createElement("div");t.className="os-plugins__gallery-sentinel",t.setAttribute("aria-hidden","true");let s=null,n=null,i=null,a="",r="featured",l="",c=1,p=0,u=!1,g=!1;const b=[],h=async()=>{if(s){c=1,p=0,g=!1,e.clear(),s.replaceChildren();for(let m=0;m<6;m++)s.appendChild(Ke());s.appendChild(t),await _()}},_=async()=>{if(!(!s||!n||u||g)){if(u=!0,c>1&&b.length===0)for(let m=0;m<4;m++){const w=Ke();s.insertBefore(w,t),b.push(w)}try{const m=await o.host.rest.browsePlugins({browse:l===""?r:void 0,search:l===""?void 0:l,page:c,perPage:ro});c===1&&(s.replaceChildren(),s.appendChild(t));const w=m.info??{};typeof w.pages=="number"&&w.pages>0&&(p=w.pages);const x=m.plugins??[];if(x.length===0){g=!0,c===1&&e.showStatus(n,d("No plugins matched.","desktop-mode"));return}for(const S of x)S?.slug&&!e.plugins.has(S.slug)&&e.addCard(s,S,t,!1);c++,(p>0?c>p:x.length<ro)&&(g=!0),e.hideStatus(n)}catch(m){e.showStatus(n,y(d("Could not load plugins: %s","desktop-mode"),I(m)))}finally{for(const m of b)m.remove();b.length=0,u=!1}}};return{sync:m=>{n=m.status,m.gallery!==s&&(s=m.gallery,i?.disconnect(),i=null,a="",s&&(i=new IntersectionObserver(x=>{x.some(S=>S.isIntersecting)&&_()},{root:s,rootMargin:"240px",threshold:0}),i.observe(t)));const w=`${m.filter}|${m.query}`;s&&m.active&&w!==a&&(a=w,r=m.filter,l=m.query,h())},reset:()=>void h(),repaintCtas:e.repaintCtas,dispose:()=>{i?.disconnect(),i=null}}}function Gs(o){const e=lo(o);let t=null,s=!1;const n=async i=>{if(t){s=!0,t.replaceChildren(),e.clear();for(let a=0;a<3;a++)t.appendChild(Ke());try{const a=await o.host.rest.fetchFeaturedPlugins();t.replaceChildren();for(const r of a.plugins??[])r?.slug&&e.addCard(t,r,null,!!r.featured);i&&(e.plugins.size===0?e.showStatus(i,d("No featured plugins yet.","desktop-mode")):e.hideStatus(i))}catch(a){t.replaceChildren(),s=!1,i&&e.showStatus(i,y(d("Could not load featured plugins: %s","desktop-mode"),I(a)))}}};return{sync:i=>{i.gallery&&i.gallery!==t&&(t=i.gallery,s=!1),t&&i.active&&!s&&n(i.status)},repaintCtas:e.repaintCtas}}const Ys=k` ${T} ${Dt} ${Mt} ${Ve} ${It} ${Ut}:host{display:inline-flex}:host( [ fill-cell ] ){display:flex;width:100%}button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var( --os-ui-button-padding,6px 12px );border-radius:var( --os-ui-button-border-radius,6px );font:inherit;font-weight:500;cursor:pointer;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,transform 80ms ease;background:var( --os-ui-button-bg,transparent );background-image:var( --os-ui-button-bg-image,none );background-repeat:var( --os-ui-button-bg-image-repeat,repeat );background-size:var( --os-ui-button-bg-image-size,auto );background-position:var( --os-ui-button-bg-image-position,center );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid var( --os-ui-border,#c3c4c7 ) )}:host( [ fill-cell ] ) button{width:100%;min-height:var( --os-ui-button-min-height,44px )}button:disabled{opacity:0.5;cursor:not-allowed}button:active:not(:disabled ){transform:translateY( 1px )}button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button:disabled::before,button:disabled::after,button:disabled .os-holo-glint{opacity:0 !important}:host( [ variant='primary' ] ) button{background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );color:var( --os-ui-button-fg,var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='primary' ] ) button:hover:not(:disabled ){filter:brightness( 1.06 );background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --_holo-glow )}:host( [ variant='holo' ] ) button{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --os-ui-button-fg,var( --_holo-ink ) );border:var( --os-ui-button-border,1px solid transparent );box-shadow:var( --_holo-glow );font-weight:600;transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease,transform 80ms ease}:host( [ variant='holo' ] ) button:hover:not(:disabled ){background-color:transparent;background-position:74% 66%;box-shadow:var( --_holo-glow-strong )}:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:88% 82%;filter:brightness( 0.94 )}:host( [ variant='holo' ] ) button::before{display:none}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ] ) button:hover:not(:disabled ),:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:22% 28%}}:host( [ variant='secondary' ] ) button{background-color:var( --os-ui-button-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='secondary' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.1 ) ) )}:host( [ variant='danger' ] ) button{background-color:var( --os-ui-button-bg,transparent );color:var( --os-ui-button-fg,var( --os-ui-danger,#d63638 ) );border:var( --os-ui-button-border,1px solid currentColor )}:host( [ variant='danger' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}:host( [ variant='danger' ] ) button::after{display:none}:host( [ variant='link' ] ) button{background-color:transparent;background-image:none;color:var( --os-ui-button-fg,var( --wp-admin-theme-color,#2271b1 ) );border:0;padding:0;text-decoration:underline}:host( [ variant='link' ] ) button::before,:host( [ variant='link' ] ) button::after,:host( [ variant='link' ] ) .os-holo-glint,:host( [ variant='link' ] ) .os-holo-ring{display:none}:host( [ variant='link' ] ) button:active:not(:disabled ){transform:none}:host( [ busy ] ) button{pointer-events:none;opacity:0.75}:host( [ variant='holo' ][ busy ] ) button{animation:os-holo-drift 12s ease-in-out infinite}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ][ busy ] ) button{animation:none}}.os-button__spinner{box-sizing:border-box;display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:os-button-spin 0.6s linear infinite;flex-shrink:0}@keyframes os-button-spin{to{transform:rotate( 360deg )}}`,ae=class ae extends C{static get observedAttributes(){return[...super.observedAttributes,"aria-label"]}render(){const e=this.disabled!==null,t=this.busy!==null,s=this.type||"button",n=this.getAttribute("aria-label")||"";return f`
135 + <button
136 + part="button"
137 + class="os-holo-edge os-holo-sheen"
138 + type=${s}
139 + ?disabled=${e||t}
140 + aria-busy=${t?"true":"false"}
141 + aria-label=${n}
142 + >
143 + ${t?f`<span class="os-button__spinner" aria-hidden="true"></span>`:""}
144 + <slot></slot>
145 + <!--
146 + The two motion layers. Elements rather than
147 + pseudo-elements because the sheen and the hairline
148 + have already taken this button's ::before and
149 + ::after — see the pseudo-element budget note in
150 + src/ui/holo.ts. Both are inert and aria-hidden.
151 + -->
152 + <span class="os-holo-glint" aria-hidden="true"></span>
153 + <span class="os-holo-ring" aria-hidden="true"></span>
154 + </button>
155 + `}};ae.props=["variant","disabled","type","busy","fill-cell"],ae.styles=[Ys],ae.help=void 0;let st=ae;E("os-button",st);const Xs=k` ${T} ${We}:host{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var( --os-ui-fg,#1d2327 );cursor:pointer}:host( [ disabled ] ){cursor:not-allowed;opacity:0.55}:host( [ block ] ){display:flex;cursor:default}:host( [ block ] ) label{cursor:pointer}:host( [ block ][ disabled ] ) label{cursor:not-allowed}label{display:inline-flex;align-items:center;gap:6px;cursor:inherit}.os-checkbox__label{line-height:1.3}.os-checkbox__label:empty{display:none}`,re=class re extends C{render(){const e=this.checked!==null,t=this.disabled!==null,s=this.label||"",n=this.value;return f`
156 + <label>
157 + <input
158 + type="checkbox"
159 + .checked=${e}
160 + ?disabled=${t}
161 + .value=${n??""}
162 + @change=${i=>this._onChange(i)}
163 + />
164 + <span class="os-checkbox__label">${s}</span>
165 + </label>
166 + `}_onChange(e){const s=e.target.checked;s?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:s,value:this.value})}};re.props=["checked","value","label","disabled"],re.styles=[Xs],re.help=void 0;let nt=re;E("os-checkbox",nt);const Qs=k`:host{display:grid;min-inline-size:0;min-block-size:0;grid-template-columns:var( --os-ui-grid-columns,1fr );grid-template-rows:var( --os-ui-grid-rows,auto );gap:var( --os-ui-grid-gap,8px );column-gap:var( --os-ui-grid-column-gap,var( --os-ui-grid-gap,8px ) );row-gap:var( --os-ui-grid-row-gap,var( --os-ui-grid-gap,8px ) )}:host( [ hidden ] ){display:none}::slotted( * ){min-inline-size:0}::slotted( [ col-span='1' ] ){grid-column:span min( 1,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='1' ] ){grid-row:span 1}::slotted( [ col-span='2' ] ){grid-column:span min( 2,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='2' ] ){grid-row:span 2}::slotted( [ col-span='3' ] ){grid-column:span min( 3,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='3' ] ){grid-row:span 3}::slotted( [ col-span='4' ] ){grid-column:span min( 4,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='4' ] ){grid-row:span 4}::slotted( [ col-span='5' ] ){grid-column:span min( 5,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='5' ] ){grid-row:span 5}::slotted( [ col-span='6' ] ){grid-column:span min( 6,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='6' ] ){grid-row:span 6}::slotted( [ col-span='7' ] ){grid-column:span min( 7,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='7' ] ){grid-row:span 7}::slotted( [ col-span='8' ] ){grid-column:span min( 8,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='8' ] ){grid-row:span 8}::slotted( [ col-span='9' ] ){grid-column:span min( 9,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='9' ] ){grid-row:span 9}::slotted( [ col-span='10' ] ){grid-column:span min( 10,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='10' ] ){grid-row:span 10}::slotted( [ col-span='11' ] ){grid-column:span min( 11,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='11' ] ){grid-row:span 11}::slotted( [ col-span='12' ] ){grid-column:span min( 12,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='12' ] ){grid-row:span 12}:host( [ data-single-column ] ){grid-template-rows:none}:host( [ data-single-column ] )::slotted( [ row-span ] ){grid-row:auto}`,le=class le extends C{constructor(){super(...arguments),this.observer=null,this.availableWidth=0,this.overrides=new Map}overrideToken(e,t){if(t!==null)this.overrides.has(e)||this.overrides.set(e,{value:this.style.getPropertyValue(e),priority:this.style.getPropertyPriority(e)}),this.style.setProperty(e,t);else{const s=this.overrides.get(e);s&&(s.value?this.style.setProperty(e,s.value,s.priority):this.style.removeProperty(e),this.overrides.delete(e))}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(e=>{this.availableWidth=e[0].contentRect.width,this.updateTracks()}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.observer=null}updateTracks(){const e=Number(this.getAttribute("min-item-width")),t=Number.isFinite(e)&&e>0,s=parseFloat(getComputedStyle(this).columnGap)||0,n=Number(this.getAttribute("columns")),i=Number.isSafeInteger(n)&&n>0?n:1,a=t?Math.max(1,Math.floor((this.availableWidth+s)/(e+s))):i;this.style.setProperty("--_os-grid-tracks",String(a)),this.toggleAttribute("data-single-column",t&&a===1),t||Number.isSafeInteger(n)&&n>0?this.overrideToken("--os-ui-grid-columns",`repeat(${a}, minmax(0, 1fr))`):this.overrideToken("--os-ui-grid-columns",null)}render(){const e=this.getAttribute("rows");e&&/^[1-9]\d*$/.test(e)?this.overrideToken("--os-ui-grid-rows",`repeat(${e}, minmax(0, 1fr))`):this.overrideToken("--os-ui-grid-rows",null);for(const t of["gap","column-gap","row-gap"]){const s=this.getAttribute(t);s!==null&&/^\d+$/.test(s)?this.overrideToken(`--os-ui-grid-${t}`,`${s}px`):this.overrideToken(`--os-ui-grid-${t}`,null)}return this.updateTracks(),f`<slot></slot>`}};le.props=["columns","rows","gap","column-gap","row-gap","min-item-width"],le.styles=[Qs],le.help=void 0;let it=le;E("os-grid",it);async function Js(o,e,t){if(o.loading||e.savingView||t!=="cards"&&t!=="table"||t===o.state.installedView)return;const s=o.state.installedView;e.savingView=!0,o.state.installedView=t,o.repaint();try{await o.dispatch("save_view",{view:t})||(o.state.installedView=s)}catch{o.state.installedView=s}finally{e.savingView=!1,o.repaint()}}const en=k` ${T} ${We}:host{display:block;--_bg:var( --os-ui-table-bg,var( --os-ui-surface,#fff ) );--_border:var( --os-ui-table-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_column-border:var( --os-ui-table-column-border,var( --os-ui-border-strong,rgba( 0,0,0,0.14 ) ) );--_header-bg:var( --os-ui-table-header-bg,var( --os-ui-surface-elevated,#f6f7f7 ) );--_row-hover:var( --os-ui-table-row-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );--_stripe:var( --os-ui-table-stripe,var( --os-ui-surface-subtle,rgba( 0,0,0,0.03 ) ) );--_cell-padding:var( --os-ui-table-cell-padding,8px 12px );--_font-size:var( --os-ui-table-font-size,13px );--_max-height:var( --os-ui-table-max-height,none );font-size:var( --_font-size );color:inherit}:host( [ hidden ] ){display:none}.scroll{position:relative;overflow:auto;max-height:var( --_max-height );border:1px solid var( --_border );border-radius:4px;background:var( --_bg )}table{width:100%;border-collapse:separate;border-spacing:0;background:var( --_bg )}thead th{text-align:start;font-weight:600;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );padding:var( --_cell-padding );border-bottom:1px solid var( --_border );white-space:nowrap}tbody td{padding:var( --_cell-padding );border-bottom:1px solid var( --_border );background-color:var( --_bg );vertical-align:middle}tbody tr:last-child td{border-bottom:0}:host( [ striped ] ) tbody tr:nth-child( odd ) td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ hover ] ) tbody tr:hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) ),linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ compact ] ){--os-ui-table-cell-padding:4px 8px;--os-ui-table-font-size:12px}:host( [ bordered ] ) thead th,:host( [ bordered ] ) tbody td{border-inline-end:1px solid var( --_column-border )}:host( [ bordered ] ) thead th:last-child,:host( [ bordered ] ) tbody td:last-child{border-inline-end:0}th.is-sticky,td.is-sticky{position:sticky;z-index:10}tbody td.is-sticky{background-color:var( --_bg )}thead th.is-sticky{background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );z-index:30}:host( [ sticky-header ] ) thead th{position:sticky;top:0;z-index:20}:host( [ sticky-header ] ) thead tr.filter-row th{top:var( --os-ui-table-header-height,33px );z-index:20}:host( [ sticky-header ] ) thead th.is-sticky{z-index:40}:host( [ sticky-header ] ) thead tr.filter-row th.is-sticky{z-index:40}th.is-sticky-edge,td.is-sticky-edge{border-inline-end:var( --os-ui-table-sticky-edge,2px solid var( --_border ) )}.align-center{text-align:center}.align-end{text-align:end}.filter-row th{padding:4px 8px;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );border-bottom:1px solid var( --_border );font-weight:400}.filter-input,.filter-select{width:100%;min-width:60px;box-sizing:border-box;padding:4px 6px;font:inherit;color:inherit;background-color:var( --_bg );border:1px solid var( --_border );border-radius:3px}.filter-input:focus,.filter-select:focus{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.expander{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:3px;font-size:11px;line-height:1}.expander:hover{background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}td.col-expander,th.col-expander{width:36px;min-width:36px;padding-left:0;padding-right:0;text-align:center}tr.subtable td{padding:0;background-color:var( --_bg );background-image:linear-gradient( var( --_stripe ),var( --_stripe ) );border-bottom:1px solid var( --_border )}tr.subtable .subtable-inner{padding:8px 12px 8px 32px}tr.empty td{padding:24px;text-align:center;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );font-style:italic}thead th.is-sortable{cursor:pointer;user-select:none}thead th.is-sortable:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}thead th.is-sortable:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.sort-indicator{font-size:10px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );margin-inline-start:2px}thead th.sort-asc .sort-indicator,thead th.sort-desc .sort-indicator{color:var( --wp-admin-theme-color,#2271b1 )}td.col-select,th.col-select{width:40px;min-width:40px;padding-left:0;padding-right:0;text-align:center}.select-all-checkbox,.select-row-checkbox{cursor:pointer;margin:0}tbody tr.is-selected td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none}tbody tr.is-selected:hover td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 16%,var( --_bg ) )}tbody tr.is-selected td:first-child{box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}tbody:dir( rtl ) tr.is-selected td:first-child{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) .scroll{border:0;border-radius:0}:host( [ stacked ] ) table,:host( [ stacked ] ) tbody{display:block;width:100%}:host( [ stacked ] ) colgroup,:host( [ stacked ] ) thead{display:none}:host( [ stacked ] ) tbody tr{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-bottom:1px solid var( --_border );background-color:var( --_bg )}:host( [ stacked ] ) tbody tr:last-child{border-bottom:0}:host( [ stacked ] ) tbody td{display:block;padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none;min-width:0;width:auto;vertical-align:baseline}:host( [ stacked ] ) tbody tr.is-selected td,:host( [ stacked ] ) tbody tr.is-selected:hover td,:host( [ stacked ][ striped ] ) tbody tr:nth-child( odd ) td,:host( [ stacked ][ hover ] ) tbody tr:hover td,:host( [ stacked ][ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td,:host( [ stacked ][ bordered ] ) tbody td{padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none}:host( [ stacked ][ hover ] ) tbody tr:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ stacked ] ) tbody tr.is-selected,:host( [ stacked ] ) tbody tr.is-selected:hover{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none;box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody:dir( rtl ) tr.is-selected{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody td.col-select,:host( [ stacked ] ) tbody td.col-expander{flex:0 0 auto;display:flex;align-items:center;justify-content:center;min-width:0}:host( [ stacked ] ) tbody td.col-select{width:44px;height:44px;margin:-11px 0 -11px -11px;cursor:pointer}:host( [ stacked ] ) .select-row-checkbox{width:22px;height:22px}:host( [ stacked ] ) tbody td.col-expander{width:28px;height:22px;margin-inline-start:-4px}:host( [ stacked ] ) tbody td.stack-body{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;min-width:0}.stack-cell{display:flex;align-items:baseline;gap:6px;min-width:0;line-height:1.4}.stack-title{font-size:15px;font-weight:600;line-height:1.35}.stack-meta{font-size:13px}.stack-label{flex:0 0 auto;font-size:12px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) )}.stack-label::after{content:'·';margin-inline-start:6px}.stack-value{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.stack-actions{margin-block-start:6px}.stack-actions .stack-value{gap:8px}.stack-actions .stack-value>*{justify-content:flex-start;max-width:100%}:host( [ stacked ] ) tr.subtable,:host( [ stacked ] ) tr.empty{display:block;padding:0}:host( [ stacked ] ) tr.subtable td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ stacked ] ) tr.subtable .subtable-inner{padding:8px 14px 12px}:host( [ stacked ] ) tr.empty td{padding:24px}:host( [ stacked ] ) tr.skeleton{display:block;padding:14px;border-bottom:1px solid var( --_border )}:host( [ stacked ] ) tr.skeleton td.stack-body{gap:8px}:host( [ stacked ] ) tr.skeleton .skeleton-bar:first-child{height:15px}tbody tr.skeleton td{padding:var( --_cell-padding )}.skeleton-bar{display:block;height:12px;border-radius:3px;background:linear-gradient( 90deg,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 0%,var( --os-ui-table-skeleton-highlight,var( --os-ui-hover,rgba( 0,0,0,0.14 ) ) ) 50%,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 100% );background-size:200% 100%;animation:os-table-skeleton-pulse 1.4s ease-in-out infinite}@keyframes os-table-skeleton-pulse{0%{background-position:200% 50%}100%{background-position:-200% 50%}}@media ( prefers-reduced-motion:reduce ){.skeleton-bar{animation:none}}`,U="__wpd_expander__",F="__wpd_select__",de=class de extends C{constructor(){super(...arguments),this._data=[],this._columns=[],this._filters={},this._expanded=new Set,this._subTable=null,this._sort=null,this._selection=new Set,this._getRowId=(e,t)=>t,this._filterCache=new Map,this._paintScheduled=!1,this._stacked=!1,this._stickyHeaderWarned=!1,this._stickyRaceWarned=!1,this._resizeObserver=null,this._stickyMicroScheduled=!1,this._stickyRafHandle=null,this._loadingDesyncWarned=!1,this._lastStickyIndex=-1}get data(){return this._data}set data(e){this._data=Array.isArray(e)?e.slice():[],this._expanded.clear(),this._schedulePaint()}get columns(){return this._columns}set columns(e){this._columns=Array.isArray(e)?e.slice():[];const t=new Set(this._columns.map(s=>s.key));for(const s of Object.keys(this._filters))t.has(s)||delete this._filters[s];for(const s of Array.from(this._filterCache.keys()))t.has(s)||this._filterCache.delete(s);this._sort&&!t.has(this._sort.key)&&(this._sort=null),this._schedulePaint()}get filters(){return{...this._filters}}set filters(e){this._filters=e?{...e}:{},this._schedulePaint()}get sort(){return this._sort?{...this._sort}:null}set sort(e){this._sort=e?{...e}:null,this._schedulePaint()}get selection(){return new Set(this._selection)}set selection(e){this._selection=new Set(e??[]),this._schedulePaint()}get selectedRows(){const e=[];return this._data.forEach((t,s)=>{this._selection.has(this._getRowId(t,s))&&e.push(t)}),e}get visibleRows(){return this._filteredRows().map(e=>e.row)}get getRowId(){return this._getRowId}set getRowId(e){this._getRowId=typeof e=="function"?e:(t,s)=>s,this._schedulePaint()}get subTable(){return this._subTable}set subTable(e){this._subTable=typeof e=="function"?e:null,this._expanded.clear(),this._schedulePaint()}get expanded(){return new Set(this._expanded)}set expanded(e){this._expanded=new Set(e??[]),this._schedulePaint()}expand(e){e<0||e>=this._data.length||this._expanded.has(e)||(this._expanded.add(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!0}),this._schedulePaint())}collapse(e){this._expanded.has(e)&&(this._expanded.delete(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!1}),this._schedulePaint())}expandAll(){if(!this._subTable)return;let e=!1;for(let t=0;t<this._data.length;t++)this._subTable(this._data[t],t)&&(this._expanded.has(t)||(this._expanded.add(t),e=!0));e&&this._schedulePaint()}collapseAll(){this._expanded.size!==0&&(this._expanded.clear(),this._schedulePaint())}isExpanded(e){return this._expanded.has(e)}clearFilters(){Object.keys(this._filters).length!==0&&(this._filters={},this.emit("os-table-filter-change",{filters:{}}),this._schedulePaint())}clearSort(){this._sort!==null&&(this._sort=null,this.emit("os-table-sort-change",{sort:null}),this._schedulePaint())}select(e){if(this._selection.has(e))return;const t=this._readSelectable(),s=t==="single"?Array.from(this._selection):[];t==="single"&&this._selection.clear(),this._selection.add(e),this._emitSelectionChange(),this._syncSelectionDom([e,...s])}deselect(e){this._selection.delete(e)&&(this._emitSelectionChange(),this._syncSelectionDom([e]))}selectAll(){if(this._readSelectable()==="multi"){for(const{row:e,index:t}of this._filteredRows())this._selection.add(this._getRowId(e,t));this._emitSelectionChange(),this._syncSelectionDom("all")}}clearSelection(){this._selection.size!==0&&(this._selection.clear(),this._emitSelectionChange(),this._syncSelectionDom("all"))}_syncSelectionDom(e){const t=this.shadowRoot;if(!t)return;const s=t.querySelector("tbody");if(!s)return;let n=null;if(e!=="all"){n=new Set;for(const r of e)n.add(String(r))}const i=s.querySelectorAll("tr[data-row-id]");for(const r of i){const l=r.dataset.rowId;if(l===void 0||n&&!n.has(l))continue;const c=Number(r.dataset.rowIndex);if(!Number.isFinite(c))continue;const p=this._data[c];if(p===void 0)continue;const u=this._getRowId(p,c),g=this._selection.has(u);r.classList.toggle("is-selected",g);const b=r.querySelector("input.select-row-checkbox");b&&b.checked!==g&&(b.checked=g)}const a=t.querySelector("thead .select-all-checkbox");if(a){const{total:r,selected:l}=this._visibleSelectionStats();a.checked=r>0&&l===r,a.indeterminate=l>0&&l<r}}scrollToRow(e){const t=this.shadowRoot;if(!t)return;const n=t.querySelectorAll("tbody tr:not(.subtable):not(.empty):not(.skeleton)")[e];n&&n.scrollIntoView({block:"nearest",inline:"nearest"})}connectedCallback(){super.connectedCallback(),this._schedulePaint()}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null,this._stickyRafHandle!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this._stickyRafHandle),this._stickyRafHandle=null)}recomputeLayout(){this._applyStickyOffsets(),this._measureHeaderHeight()}render(){return f`
167 + <div class="scroll" part="scroll">
168 + <table part="table">
169 + <colgroup></colgroup>
170 + <thead></thead>
171 + <tbody></tbody>
172 + </table>
173 + </div>
174 + `}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){const e=this.shadowRoot;if(!e)return;e.querySelector("tbody")||W(this.render(),e);const t=e.querySelector("colgroup"),s=e.querySelector("thead"),n=e.querySelector("tbody");if(!t||!s||!n)return;const i=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const a=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(i,a),this._paintColgroup(t,i),this._paintHead(s,i,a),this._paintBody(n,i,a),this._applyStickyOffsets(),this._measureHeaderHeight(),this._scheduleStickyOffsets(),this._maybeWarnStickyHeader(),this._maybeWarnLoadingDesync(n),this._ensureResizeObserver()}_maybeWarnLoadingDesync(e){this._loadingDesyncWarned||this.hasAttribute("loading")&&(e.querySelector("tr.skeleton")||(this._loadingDesyncWarned=!0,console.warn("[os-table] `loading` attribute is set but no skeleton rows rendered. Either attributeChangedCallback didn't route through requestUpdate (framework regression), or `loading` was set after the most recent paint and no follow-up trigger ran. Toggling `data` will force a paint as a workaround.")))}_scheduleStickyOffsets(){this._stickyMicroScheduled||(this._stickyMicroScheduled=!0,queueMicrotask(()=>{this._stickyMicroScheduled=!1,this.isConnected&&this._applyStickyOffsets()})),this._stickyRafHandle===null&&typeof requestAnimationFrame<"u"&&(this._stickyRafHandle=requestAnimationFrame(()=>{this._stickyRafHandle=null,this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight())}))}_ensureResizeObserver(){if(this._resizeObserver||typeof ResizeObserver>"u")return;const e=this.shadowRoot?.querySelector(".scroll");e&&(this._resizeObserver=new ResizeObserver(()=>{this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight(),this._stickyHeaderWarned=!1,this._maybeWarnStickyHeader())}),this._resizeObserver.observe(e),this._resizeObserver.observe(this))}_paintColgroup(e,t){const s=[];for(const n of t){const i=document.createElement("col");n.width&&(i.style.width=n.width),s.push(i)}e.replaceChildren(...s)}_paintHead(e,t,s){const n=document.createElement("tr");n.setAttribute("part","header-row");for(let l=0;l<t.length;l++)n.appendChild(this._buildHeaderCell(t[l],l,s));const i=e.querySelector(':scope > tr[part="header-row"]');i?e.replaceChild(n,i):e.insertBefore(n,e.firstChild);const a=t.some(l=>l.filter||Array.isArray(l.filterOptions)||typeof l.filterRender=="function");let r=e.querySelector(":scope > tr.filter-row");if(a){const l=[];for(let u=0;u<t.length;u++)l.push(this._buildFilterCell(t[u],u,s));r||(r=document.createElement("tr"),r.classList.add("filter-row"),r.setAttribute("part","filter-row"),e.appendChild(r));const c=Array.from(r.children);let p=c.length===l.length;if(p){for(let u=0;u<l.length;u++)if(c[u]!==l[u]){p=!1;break}}if(!p){const u=new Set(l);for(const g of l)r.appendChild(g);for(const g of Array.from(r.children))u.has(g)||r.removeChild(g)}}else r&&r.remove()}_buildHeaderCell(e,t,s){const n=document.createElement("th");if(n.setAttribute("scope","col"),n.dataset.key=e.key,this._applyCellClasses(n,e,t,s),e.minWidth&&(n.style.minWidth=e.minWidth),e.key===F){if(this._readSelectable()==="multi"){const a=document.createElement("input");a.type="checkbox",a.className="select-all-checkbox",a.setAttribute("data-noclick",""),a.setAttribute("aria-label","Select all rows");const{total:r,selected:l}=this._visibleSelectionStats();a.checked=r>0&&l===r,a.indeterminate=l>0&&l<r,a.addEventListener("change",()=>{a.checked?this.selectAll():this.clearSelection()}),n.appendChild(a)}return n}if(n.textContent=e.label??(e.key===U?"":e.key),e.sortable){n.classList.add("is-sortable");const i=this._sort?.key===e.key,a=document.createElement("span");a.className="sort-indicator";let r="";i&&(r=this._sort.direction==="asc"?" ▲":" ▼"),a.textContent=r,n.appendChild(a),i&&n.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),n.addEventListener("click",()=>this._cycleSort(e.key))}return n}_buildFilterCell(e,t,s){const n=this._filterCache.get(e.key),i=Array.isArray(e.filterOptions),a=typeof e.filterRender=="function";let r;if(!e.filter&&!i&&!a||e.key===U||e.key===F?r="none":a?r="custom":e.filter==="select"||i?r="select":r="text",n&&n.kind===r){if(n.th.className="",this._applyCellClasses(n.th,e,t,s),r==="select"){const u=n.control,g=this._resolveFilterOptions(e),b=g.map(h=>h.value).join("|");b!==n.optionsKey?(this._populateSelect(u,g,this._filters[e.key]??""),n.optionsKey=b):u.value=this._filters[e.key]??""}else if(r==="text"){const u=n.control,g=this._filters[e.key]??"";u.value!==g&&u.ownerDocument.activeElement!==u&&(u.value=g)}else r==="custom"&&e.filterRender&&e.filterRender(n.th,{value:this._filters[e.key]??"",setValue:u=>this._onFilterChange(e.key,u),col:e});return n.th}const l=document.createElement("th");if(this._applyCellClasses(l,e,t,s),r==="none")return this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"none"}),l;if(r==="custom"&&e.filterRender)return e.filterRender(l,{value:this._filters[e.key]??"",setValue:u=>this._onFilterChange(e.key,u),col:e}),this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"custom"}),l;let c,p="";if(r==="select"){const u=document.createElement("select");u.classList.add("filter-select"),u.setAttribute("data-noclick",""),u.setAttribute("aria-label",`Filter ${e.label??e.key}`);const g=this._resolveFilterOptions(e);this._populateSelect(u,g,this._filters[e.key]??""),p=g.map(b=>b.value).join("|"),u.addEventListener("change",()=>{this._onFilterChange(e.key,u.value)}),c=u}else{const u=document.createElement("input");u.type="search",u.classList.add("filter-input"),u.setAttribute("data-noclick",""),u.setAttribute("placeholder","Filter…"),u.setAttribute("aria-label",`Filter ${e.label??e.key}`),u.value=this._filters[e.key]??"",u.addEventListener("input",()=>{this._onFilterChange(e.key,u.value)}),c=u}return l.appendChild(c),this._filterCache.set(e.key,{th:l,control:c,optionsKey:p,kind:r}),l}_populateSelect(e,t,s){e.replaceChildren();const n=document.createElement("option");n.value="",n.textContent="All",e.appendChild(n);for(const i of t){const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.value===s&&(a.selected=!0),e.appendChild(a)}e.value=s}_resolveFilterOptions(e){return Array.isArray(e.filterOptions)?e.filterOptions:this._uniqueValues(e.key).map(t=>({value:t,label:t}))}_paintBody(e,t,s){if(e.replaceChildren(),this.hasAttribute("loading")){const i=this._readLoadingRows();for(let a=0;a<i;a++)e.appendChild(this._buildSkeletonRow(t,a));return}const n=this._sortedRows(this._filteredRows());if(n.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:i,index:a}of n)if(e.appendChild(this._stacked?this._buildStackedRow(i,a,t):this._buildBodyRow(i,a,t,s)),this._expanded.has(a)&&this._subTable){const r=this._subTable(i,a);r&&e.appendChild(this._buildSubTableRow(r,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const s=document.createElement("td");s.colSpan=e;const n=document.createElement("slot");return n.name="empty",n.textContent=this.getAttribute("empty")||"No data",s.appendChild(n),t.appendChild(s),t}_buildSkeletonRow(e,t){const s=document.createElement("tr");if(s.classList.add("skeleton"),s.setAttribute("aria-hidden","true"),this._stacked){s.classList.add("stack-row");const n=document.createElement("td");n.className="stack-body",n.colSpan=Math.max(1,e.length);for(const i of[55+t*7%25,30+t*11%15]){const a=document.createElement("span");a.className="skeleton-bar",a.style.width=`${i}%`,n.appendChild(a)}return s.appendChild(n),s}for(const n of e){const i=document.createElement("td"),a=document.createElement("span");a.className="skeleton-bar";const r=50+(t*7+s.children.length*13)%40;a.style.width=`${r}%`,i.appendChild(a),s.appendChild(i)}return s}_buildBodyRow(e,t,s,n){const i=document.createElement("tr");i.setAttribute("part","row"),i.dataset.rowIndex=String(t);const a=this._getRowId(e,t);i.dataset.rowId=String(a),this._selection.has(a)&&i.classList.add("is-selected"),i.addEventListener("click",r=>{this._onRowClick(e,t,r)});for(let r=0;r<s.length;r++)i.appendChild(this._buildBodyCell(s[r],r,e,t,n));return i}_buildStackedRow(e,t,s){const n=document.createElement("tr");n.setAttribute("part","row"),n.classList.add("stack-row"),n.dataset.rowIndex=String(t);const i=this._getRowId(e,t);n.dataset.rowId=String(i),this._selection.has(i)&&n.classList.add("is-selected"),n.addEventListener("click",c=>{this._onRowClick(e,t,c)});const a=document.createElement("td");a.className="stack-body";let r=0,l=0;for(let c=0;c<s.length;c++){const p=s[c];if(p.key===F||p.key===U){n.appendChild(this._buildBodyCell(p,c,e,t,0));continue}l++;const u=tn(p,r++);if(u==="hidden")continue;const g=document.createElement("div");if(g.className=`stack-cell stack-${u}`,g.dataset.key=p.key,u==="meta"&&p.label){const m=document.createElement("span");m.className="stack-label",m.textContent=p.label,g.appendChild(m)}const b=document.createElement("span");b.className="stack-value";const h=e[p.key],_=$e(h);p.render?this._mountCellContent(b,p.render(h,e,t)):_!==null?b.appendChild(this._slotFor(_)):h!=null&&(b.textContent=String(h)),g.appendChild(b),a.appendChild(g)}return a.colSpan=Math.max(1,l),n.appendChild(a),n}_buildBodyCell(e,t,s,n,i){const a=document.createElement("td");if(this._applyCellClasses(a,e,t,i),e.minWidth&&(a.style.minWidth=e.minWidth),e.key===F){const c=this._getRowId(s,n),p=document.createElement("input");return p.type="checkbox",p.className="select-row-checkbox",p.setAttribute("data-noclick",""),p.setAttribute("aria-label","Select row"),p.checked=this._selection.has(c),p.addEventListener("change",()=>{p.checked?this.select(c):this.deselect(c)}),a.appendChild(p),this._stacked&&(a.setAttribute("data-noclick",""),a.addEventListener("click",u=>{u.target===a&&(p.checked=!p.checked,p.dispatchEvent(new Event("change")))})),a}if(e.key===U){if(!(this._subTable?!!this._subTable(s,n):!1))return a;const p=this._expanded.has(n),u=document.createElement("button");return u.type="button",u.className="expander",u.setAttribute("data-noclick",""),u.setAttribute("aria-expanded",p?"true":"false"),u.setAttribute("aria-label",p?"Collapse row":"Expand row"),u.textContent=p?"▾":"▸",u.addEventListener("click",g=>{this._toggleRow(n,s,g)}),a.appendChild(u),a}const r=s[e.key],l=$e(r);if(e.render){const c=e.render(r,s,n);this._mountCellContent(a,c)}else l!==null?a.appendChild(this._slotFor(l)):r!=null&&(a.textContent=String(r));return a}_slotFor(e){const t=document.createElement("slot");return t.name=e,t}_buildSubTableRow(e,t){const s=document.createElement("tr");s.classList.add("subtable"),s.setAttribute("part","subtable-row");const n=document.createElement("td");n.colSpan=t;const i=document.createElement("div");if(i.classList.add("subtable-inner"),e instanceof Node)i.appendChild(e);else if(co(e))W(e,i);else{const a=document.createElement("os-table");a.columns=e.columns,a.data=e.data,e.subTable&&(a.subTable=e.subTable),i.appendChild(a)}return n.appendChild(i),s.appendChild(n),s}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}co(t)&&W(t,e)}_onFilterChange(e,t){t===""?delete this._filters[e]:this._filters[e]=t,this.emit("os-table-filter-change",{filters:{...this._filters}});const n=this.shadowRoot?.querySelector("tbody");if(n){const i=this._effectiveColumns(),a=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(i,a),this._paintBody(n,i,a),this._applyStickyOffsets()}}_onRowClick(e,t,s){const n=s.composedPath?.()??[];for(const i of n){if(i instanceof Element&&i.hasAttribute("data-noclick"))return;if(i===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:s})}_toggleRow(e,t,s){s.stopPropagation();const n=this._expanded.has(e);n?this._expanded.delete(e):this._expanded.add(e),this.emit("os-table-expand-change",{row:t,index:e,expanded:!n}),this._schedulePaint()}_cycleSort(e){!this._sort||this._sort.key!==e?this._sort={key:e,direction:"asc"}:this._sort.direction==="asc"?this._sort={key:e,direction:"desc"}:this._sort=null,this.emit("os-table-sort-change",{sort:this._sort?{...this._sort}:null}),this._schedulePaint()}_emitSelectionChange(){this.emit("os-table-selection-change",{selection:Array.from(this._selection),rows:this.selectedRows})}_filteredRows(){const e=[],t=Object.keys(this._filters).filter(s=>this._filters[s]!=="");for(let s=0;s<this._data.length;s++){const n=this._data[s];let i=!0;for(const a of t){const r=this._columns.find(u=>u.key===a);if(r&&typeof r.filterRender=="function")continue;const l=this._filters[a]??"",c=n[a],p=rt(c);if(r?.filter==="select"){if(p!==l){i=!1;break}}else if(!p.toLowerCase().includes(l.toLowerCase())){i=!1;break}}i&&e.push({row:n,index:s})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(i=>i.key===this._sort.key);if(!t)return e;const s=this._sort.direction==="desc"?-1:1,n=e.slice();return n.sort((i,a)=>{const r=i.row[t.key],l=a.row[t.key],c=t.sortValue?t.sortValue(i.row,r):uo(r),p=t.sortValue?t.sortValue(a.row,l):uo(l);return on(c,p)*s}),n}_uniqueValues(e){const t=new Set;for(const s of this._data){const n=s[e];n!=null&&t.add(rt(n))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:s,index:n}of this._filteredRows())e++,this._selection.has(this._getRowId(s,n))&&t++;return{total:e,selected:t}}_readStickyColumns(){const e=parseInt(this.getAttribute("sticky-columns")||"0",10);return Number.isFinite(e)&&e>0?e:0}_readLoadingRows(){const e=parseInt(this.getAttribute("loading-rows")||"5",10);return Number.isFinite(e)&&e>0?Math.min(e,100):5}_readSelectable(){const e=this.getAttribute("selectable");return e==="single"?"single":e==="multi"||e===""?"multi":null}_isStickyIndex(e,t,s){return this._stacked||s.sticky===!1?!1:s.sticky===!0?!0:e<t}_computeLastStickyIndex(e,t){let s=-1;for(let n=0;n<e.length;n++)this._isStickyIndex(n,t,e[n])&&(s=n);return s}_applyCellClasses(e,t,s,n){t.key===U&&e.classList.add("col-expander"),t.key===F&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(s,n,t)&&(e.classList.add("is-sticky"),s===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:F,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:U,label:"",width:"36px",align:"center"}),e.push(...this._columns),e}_applyStickyOffsets(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const s=Array.from(t.children),n=[];let i=0;for(let r=0;r<s.length;r++)n[r]=i,s[r].classList.contains("is-sticky")&&(i+=s[r].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(r=>{const l=Array.from(r.children);for(let c=0;c<l.length;c++)l[c].classList.contains("is-sticky")&&(l[c].style.insetInlineStart=`${n[c]}px`)}),this._maybeWarnStickyOffsetRace(s,n)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const s=this._readStickyColumns();if(s<2)return;const n=Math.min(s-1,e.length-1);if(n<=0||t[n]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const i=e[0]?.offsetWidth??0;console.warn(`[os-table] sticky-columns: column ${n} resolved to inset-inline-start: 0px while the host is visible. ths[0].offsetWidth was ${i}px at measurement time. Likely a layout race — call recomputeLayout() after the panel finishes its mount/transition, or wrap the assignment of \`data\` in a requestAnimationFrame.`)}_measureHeaderHeight(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const s=t.offsetHeight;s>0&&this.style.setProperty("--os-ui-table-header-height",`${s}px`)}_maybeWarnStickyHeader(){if(this._stickyHeaderWarned||!this.hasAttribute("sticky-header")||this.hasAttribute("loading")||this._data.length<8)return;const e=this.shadowRoot?.querySelector(".scroll");e&&e.offsetWidth!==0&&e.scrollHeight<=e.clientHeight+1&&(this._stickyHeaderWarned=!0,console.warn("[os-table] sticky-header is set but the table has no scroll container. Set --os-ui-table-max-height on the host (or wrap it in a scrolling parent) so the header has something to stick to."))}};de.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],de.styles=[en],de.help=void 0;let at=de;function co(o){return!!o&&o.__wpdHtml===!0}function tn(o,e){return o.stack?o.stack:e===0?"title":o.label?"meta":"actions"}function $e(o){return o&&typeof o=="object"&&typeof o.slot=="string"?o.slot:null}function rt(o){if(o==null)return"";if($e(o)!==null){const e=o.text;return e==null?"":String(e)}return String(o)}function uo(o){return $e(o)!==null?rt(o):o}function on(o,e){if(o===e)return 0;if(o==null)return-1;if(e==null)return 1;if(typeof o=="number"&&typeof e=="number")return o-e;if(o instanceof Date&&e instanceof Date)return o.getTime()-e.getTime();const t=Number(o),s=Number(e);return Number.isFinite(t)&&Number.isFinite(s)?t-s:String(o).localeCompare(String(e))}E("os-table",at);const sn=k` ${T} ${Ht}:host{display:none;position:fixed;min-width:180px;background-color:var( --os-ui-context-menu-bg,#1d2327 );background-image:var( --os-ui-menu-bg-image,none );background-repeat:var( --os-ui-menu-bg-image-repeat,repeat );background-size:var( --os-ui-menu-bg-image-size,auto );background-position:var( --os-ui-menu-bg-image-position,center );color:var( --os-ui-context-menu-fg,var( --os-fg,#fff ) );border:1px solid var( --os-ui-border,rgba( 255,255,255,0.08 ) );border-radius:8px;box-shadow:0 8px 24px rgba( 0,0,0,0.45 );padding:4px;font-size:13px;line-height:1.3;z-index:9999}:host( [ open ] ){display:block;animation:os-holo-enter var( --_holo-t-fast ) var( --_holo-ease );transform-origin:top left;box-sizing:border-box;max-block-size:calc( 100vh - 16px );max-block-size:calc( 100dvh - 16px );overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}:host( [ open ]:dir( rtl ) ){transform-origin:top right}@media ( prefers-reduced-motion:reduce ){:host( [ open ] ){animation:none}}`,nn=k`:host{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:transparent;color:inherit;text-align:start;cursor:pointer;border-radius:4px;box-sizing:border-box;user-select:none}:host(:hover ),:host( [ active ] ){background:var( --os-ui-hover,rgba( 255,255,255,0.1 ) );outline:none}:host( [ disabled ] ){opacity:0.45;cursor:not-allowed}:host( [ danger ] ){color:var( --os-ui-danger-hover,#ff8a8a )}:host( [ danger ]:hover ){background:var( --os-ui-badge-danger-bg,rgba( 255,90,90,0.18 ) )}:host( [ heading ] ){padding:8px 10px 4px;font-size:10px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:var( --os-ui-context-menu-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.5 ) ) );pointer-events:none}.icon{display:inline-flex;align-items:center;justify-content:center;font-size:18px;width:20px;height:20px}.label{flex:1}.chevron{margin-inline-start:auto;padding-inline-start:8px;font-size:16px;line-height:1;opacity:0.7}.check{display:inline-flex;align-items:center;justify-content:center;width:14px;font-size:13px;line-height:1;opacity:0.95}`,ce=class ce extends C{render(){return f`
175 + <slot></slot>
176 + `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}};ce.props=["open"],ce.styles=[sn],ce.help=void 0;let lt=ce;E("os-context-menu",lt);const ue=class ue extends C{constructor(){super(...arguments),this._onActivate=e=>{if(this.hasAttribute("disabled")||this.hasAttribute("heading"))return;const t=e.target;t&&t!==this&&t.closest("os-context-menu-option")!==this||this.emit("os-context-menu-pick",{id:this.dataset.menuItemId??this.id??"",value:this.getAttribute("value")??""})},this._onKey=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._onActivate(e))}}connectedCallback(){super.connectedCallback();const e=this.hasAttribute("heading");this.setAttribute("role",e?"presentation":"menuitem"),e||this.setAttribute("tabindex","0"),this.addEventListener("click",this._onActivate),this.addEventListener("keydown",this._onKey)}disconnectedCallback(){this.removeEventListener("click",this._onActivate),this.removeEventListener("keydown",this._onKey)}render(){const e=this.getAttribute("icon"),t=this.hasAttribute("has-children"),s=this.hasAttribute("checked");return f`
177 + ${s?f`<span class="check" aria-hidden="true">✓</span>`:f``}
178 + ${e?f`<span class="icon dashicons ${e}" aria-hidden="true"></span>`:f``}
179 + <span class="label"><slot></slot></span>
180 + ${t?f`<span class="chevron" aria-hidden="true">›</span>`:f``}
181 + `}};ue.props=["value","icon","disabled","danger","heading","has-children","checked"],ue.styles=[nn],ue.help={title:"Context menu option",summary:"Single row inside <os-context-menu>. Use `icon` for a leading dashicon, `danger` for destructive items, `heading` for a non-interactive section header, `has-children` to render a trailing chevron.",status:"stable",props:[{name:"value",type:"string",description:"Forwarded as `detail.value` on activation."},{name:"icon",type:"string",description:"Dashicon class (e.g. `dashicons-trash`)."},{name:"disabled",type:"boolean attribute",description:"Renders the option dimmed; clicks are ignored."},{name:"danger",type:"boolean attribute",description:"Destructive styling — red text, red hover."},{name:"heading",type:"boolean attribute",description:"Non-interactive section header. Ignores clicks."},{name:"has-children",type:"boolean attribute",description:"Renders a trailing chevron to suggest a submenu."},{name:"checked",type:"boolean attribute",description:"Renders a leading check mark — for radio-style picks inside a submenu (e.g. the active Sort By order)."}],slots:[{name:"(default)",description:"Visible label."}],events:[{name:"os-context-menu-pick",description:"Bubbled on click / Enter for non-heading non-disabled options. Detail: `{ id, value }`."}],example:f`
182 + <os-context-menu open style="position: relative; z-index: 0">
183 + <os-context-menu-option heading>Every variant</os-context-menu-option>
184 + <os-context-menu-option value="plain">Plain</os-context-menu-option>
185 + <os-context-menu-option value="icon" icon="dashicons-admin-page">
186 + With an icon
187 + </os-context-menu-option>
188 + <os-context-menu-option value="checked" checked>
189 + Checked
190 + </os-context-menu-option>
191 + <os-context-menu-option value="children" has-children>
192 + With a submenu
193 + </os-context-menu-option>
194 + <os-context-menu-option value="off" disabled>Disabled</os-context-menu-option>
195 + <os-context-menu-option value="del" danger icon="dashicons-trash">
196 + Danger
197 + </os-context-menu-option>
198 + </os-context-menu>
199 + `};let dt=ue;E("os-context-menu-option",dt);function an(o,e){o.style.visibility="hidden";const t=()=>{o.isConnected&&(e(o.getBoundingClientRect()),o.style.visibility="")};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}const rn=k`:host{display:inline-block}:host([hidden]){display:none}.panel{position:fixed;inset:auto;margin:0;padding:0;border:0;background:transparent;overflow:visible;max-inline-size:calc(100vw - 16px)}.panel[hidden]{display:none}os-context-menu{position:relative;inset:auto;max-inline-size:calc(100vw - 16px)}os-button::part(button){min-block-size:30px}.chevron{display:inline-block;inline-size:5px;block-size:5px;border-inline-end:1.5px solid currentColor;border-block-end:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);margin-inline-start:5px;vertical-align:middle}:host(:dir(rtl)) .chevron{transform:translateY(-2px) rotate(-45deg)}`,pe=class pe extends C{constructor(){super(...arguments),this.opened=!1,this.listeners=null,this.onKey=e=>{if(e.key==="Escape"||e.key==="Tab"){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation()),this.close();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;e.preventDefault(),e.stopPropagation();const t=this.options();let n=t.indexOf(this.ownerDocument.activeElement)+(e.key==="ArrowUp"?-1:1);e.key==="Home"&&(n=0),e.key==="End"&&(n=t.length-1),t[(n+t.length)%t.length]?.focus()}}get panel(){return this.shadowRoot?.querySelector(".panel")??null}get trigger(){return this.shadowRoot?.querySelector("os-button")?.shadowRoot?.querySelector("button")??null}options(){return Array.from(this.querySelectorAll("os-context-menu-option:not([heading]):not([disabled])"))}render(){return f`<os-button variant="ghost" @click=${()=>this.opened?this.close():this.show()} @keydown=${e=>{(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),this.show(e.key==="ArrowUp"))}}>${this.getAttribute("text")||"Actions"} <span class="chevron" aria-hidden="true"></span></os-button>
200 + <div class="panel" popover="manual" hidden><os-context-menu open aria-label=${this.getAttribute("label")||"Actions"}><slot></slot></os-context-menu></div>`}requestUpdate(){this.opened&&this.close(!1),super.requestUpdate(),queueMicrotask(()=>queueMicrotask(()=>this.syncTrigger()))}syncTrigger(){this.trigger?.setAttribute("aria-label",this.getAttribute("label")||"Actions"),this.trigger?.setAttribute("aria-haspopup","menu"),this.trigger?.setAttribute("aria-expanded",String(this.opened))}show(e=!1){if(this.opened||!this.panel)return;this.opened=!0,this.panel.hidden=!1,this.panel.showPopover?.(),this.syncTrigger();const t=this.panel;an(t,n=>{if(!this.opened)return;const i=this.getBoundingClientRect(),a=getComputedStyle(this).direction==="rtl";t.style.left=`${Math.max(8,Math.min(a?i.left:i.right-n.width,window.innerWidth-n.width-8))}px`,t.style.top=`${Math.max(8,Math.min(i.bottom+5+n.height<=window.innerHeight-8?i.bottom+5:i.top-n.height-5,window.innerHeight-n.height-8))}px`;const r=this.options();r[e?r.length-1:0]?.focus({preventScroll:!0})}),this.listeners=new AbortController;const{signal:s}=this.listeners;document.addEventListener("pointerdown",n=>{n.composedPath().includes(this)||this.close(!1)},{capture:!0,signal:s}),document.addEventListener("focusin",n=>{n.composedPath().includes(this)||this.close(!1)},{signal:s}),document.addEventListener("scroll",n=>{n.composedPath().includes(t)||this.close(!1)},{capture:!0,signal:s}),window.addEventListener("resize",()=>this.close(!1),{signal:s}),this.addEventListener("keydown",this.onKey,{signal:s}),this.addEventListener("os-context-menu-pick",()=>this.close(),{capture:!0,signal:s})}close(e=!0){this.opened&&(this.opened=!1,this.listeners?.abort(),this.listeners=null,this.panel?.isConnected&&this.panel.hidePopover?.(),this.panel&&(this.panel.hidden=!0),this.syncTrigger(),e&&this.isConnected&&this.trigger?.focus({preventScroll:!0}))}disconnectedCallback(){this.close(!1)}};pe.props=["label","text"],pe.styles=[rn],pe.help=void 0;let ct=pe;E("os-action-menu",ct);const ln=k`:host{min-inline-size:0;min-block-size:0}.scroll{block-size:100%;box-sizing:border-box;scrollbar-gutter:stable;overscroll-behavior:contain;border-radius:10px}table{table-layout:fixed;min-inline-size:880px}thead th{block-size:42px;box-sizing:border-box;font-size:11px}tbody td{block-size:76px;box-sizing:border-box;padding-block:10px;overflow:hidden}.os-plugins__table-identity{display:flex;align-items:center;gap:12px;min-inline-size:0}.os-plugins__table-copy{flex:1;min-inline-size:0;overflow:hidden}.os-plugins__table-title{color:var(--os-ui-fg,#1d2327);font-weight:600}.os-plugins__table-line{display:block;min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.6}.os-plugins__table-secondary{color:var(--os-ui-fg-muted,#646970);font-size:11px}.os-plugins__table-version{font-variant-numeric:tabular-nums}.os-plugins__table-update{color:var(--os-ui-warning-fg,#996800);font-size:11px}.os-plugins__table-state{display:flex;align-items:center;gap:7px;min-inline-size:0;font-size:12px}.os-plugins__table-state::before{content:'';flex:0 0 6px;block-size:6px;border-radius:50%;background:var(--os-ui-fg-faint,#a7aaad)}.os-plugins__table-state[data-active='true']::before{background:var(--os-ui-success-fg,#008a20)}.os-plugins__table-actions{display:flex;align-items:center;justify-content:end;gap:6px;min-inline-size:0}.os-plugins__table-actions>os-button{inline-size:90px;min-inline-size:0}.os-plugins__table-actions>os-button::part(button){inline-size:100%;overflow:hidden;white-space:nowrap;padding-inline:8px}.os-plugins__table-actions>os-action-menu{flex:0 0 auto}.os-plugins__module-icon{display:grid;position:relative;place-items:center;flex:0 0 36px;inline-size:36px;block-size:36px;border-radius:9px;overflow:hidden;background:var(--os-ui-surface-sunken,#f0f0f1);color:var(--os-ui-fg-muted,#646970)}.os-plugins__module-icon img{position:absolute;inset:0;inline-size:100%;block-size:100%;object-fit:contain;opacity:0;background:var(--os-ui-surface,#fff)}.os-plugins__module-icon img.is-loaded{opacity:1}.os-plugins__monogram{font-size:14px;font-weight:600}`,dn=`
173 201 .os-plugins__detail { display: block; background: var( --os-ui-surface-subtle, rgba( 0, 0, 0, 0.025 ) ); border-block-start: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ); border-block-end: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ); color: var( --os-ui-fg, inherit ); font-size: 13px; line-height: 1.55; }
174 202 .os-plugins__detail-hero { background: var( --os-ui-surface-raised, rgba( 255, 255, 255, 0.6 ) ); border-block-end: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ); }
175 203 .os-plugins__detail-hero-inner { display: flex; align-items: center; gap: 14px; padding: 14px 24px; }
176 204 .os-plugins__detail-hero-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var( --os-ui-surface, rgba( 0, 0, 0, 0.04 ) ); box-shadow: 0 0 0 1px var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ) inset; display: flex; align-items: center; justify-content: center; }
@@ -220,78 +248,255 @@
220 248 .os-plugins__detail-faq-q::-webkit-details-marker { display: none; }
221 249 .os-plugins__detail-faq-q:hover { background: var( --os-ui-hover, rgba( 0, 0, 0, 0.025 ) ); }
222 250 .os-plugins__detail-faq-q-text { flex: 1 1 auto; font-size: 14px; font-weight: 600; color: var( --os-ui-fg, inherit ); line-height: 1.4; }
223 251 .os-plugins__detail-faq-chevron { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var( --os-ui-hover, rgba( 0, 0, 0, 0.05 ) ); color: var( --os-ui-fg-muted, #555 ); transition: transform 200ms cubic-bezier( 0.2, 0.8, 0.2, 1 ), background 160ms ease; }
224 -.os-plugins__detail-faq-item[open] .os-plugins__detail-faq-chevron { transform: rotate( 180deg ); background: var( --wp-admin-theme-color, #2271b1 ); color: var( --os-ui-fg-on-accent, #fff ); }
252 +.os-plugins__detail-faq-item[open] .os-plugins__detail-faq-chevron { transform: rotate( 180deg ); background: var( --wp-admin-theme-color, #2271b1 ); color: var( --os-ui-accent-ink, var( --os-ui-fg-on-accent, #fff ) ); }
225 253 .os-plugins__detail-faq-a { padding: 4px 16px 16px; border-block-start: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.06 ) ); background: var( --os-ui-surface-subtle, rgba( 0, 0, 0, 0.012 ) ); }
226 254 @media ( prefers-reduced-motion: reduce ) { .os-plugins__detail-faq-chevron, .os-plugins__detail-faq-item { transition: none; } }
227 255 @media ( max-width: 720px ) { .os-plugins__reviews-grid, .os-plugins__detail-grid { grid-template-columns: 1fr !important; } }
228 -`+Nt,Ft=new WeakMap;function Xn(e,t,o){let n=Ft.get(e);if(n||(n=new Set,Ft.set(e,n)),n.has(t))return;if(n.add(t),"adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype){const a=new CSSStyleSheet;a.replaceSync(o),e.adoptedStyleSheets=[...e.adoptedStyleSheets,a];return}const s=document.createElement("style");s.setAttribute("data-os-plugins-styles",t),s.textContent=o,e.appendChild(s)}const Qn=new Set(["name","status","version","author","_actions"]),Yn=()=>({selected:[],table:ho(),haystacks:{source:null,byPlugin:new Map}});function Jn(e,t){return t.source!==e&&(t.source=e,t.byPlugin=new Map(e.map(o=>[o.plugin,`${o.name??""} ${o.plugin} ${z(o.author??"")}`.toLowerCase()]))),t.byPlugin}function es(e,t,o,n){const s=o.trim().toLowerCase();return e.filter(a=>!(t==="active"&&!M(a.status)||t==="inactive"&&a.status!=="inactive"||t==="update"&&!a.openstation_update_available?.available||s!==""&&!(n?.get(a.plugin)??`${a.name??""} ${a.plugin} ${z(a.author??"")}`.toLowerCase()).includes(s)))}function ts(e){return e.filter(t=>!!t.openstation_update_available?.available).length}function os(e,t,o,n){const s=es(t.installed,n.status,n.search,Jn(t.installed,o.haystacks)).map(a=>t.busy.optimistic.has(a.plugin)?{...a,status:t.busy.optimistic.get(a.plugin)}:a);o.table.sync({table:e,rows:s,listKey:`${n.status}|${n.search}`,fingerprint:ns(s,t),rowId:a=>a.plugin,columns:a=>ss(t,a),wire:a=>{e.shadowRoot&&Xn(e.shadowRoot,"plugins",Gn),e.getRowId=(i,r)=>i.plugin||String(r),e.subTable=i=>jn(i,t),a.addEventListener("os-table-row-click",i=>{const r=i.detail;r&&(e.isExpanded(r.index)?e.collapse(r.index):e.expand(r.index))}),a.addEventListener("os-table-selection-change",()=>{o.selected=Array.from(e.selection??[],String),t.repaint()})},onSelection:a=>{o.selected=a}})}function ns(e,t){return`${e.map(n=>`${n.plugin}:${n.status}:${n.version??""}:${n.openstation_update_available?.available?n.openstation_update_available.new_version:""}:${n.openstation_auto_update?.enabled?1:0}`).join("|")}#${Array.from(t.busy.updating).join(",")}#${Array.from(t.busy.autoUpdating).join(",")}`}function ss(e,t){const{caps:o,autoUpdatesEnabled:n}=e.extra,s=[{key:"name",label:l("Plugin","desktop-mode"),sortable:!0,sticky:!0,render:(a,i)=>as(i)},{key:"status",label:l("Status","desktop-mode"),sortable:!0,render:(a,i)=>Ht(i)},{key:"version",label:l("Version","desktop-mode"),sortable:!0,render:(a,i)=>is(i)},{key:"author",label:l("Author","desktop-mode"),render:(a,i)=>rs(i)},{key:"openstation_size_kb",label:l("Size","desktop-mode"),align:"end",sortable:!0,sortValue:a=>a.openstation_size_kb??0,render:(a,i)=>i.openstation_size_kb===null||i.openstation_size_kb===void 0?"—":ye(i.openstation_size_kb*1024)}];return n&&s.push({key:"auto_updates",label:l("Automatic Updates","desktop-mode"),sortable:!0,sortValue:a=>a.openstation_auto_update?.enabled?1:0,render:(a,i)=>ls(e,i)}),(o.activate||o.delete)&&s.push({key:"_actions",label:"",align:"end",render:(a,i)=>ds(e,i)}),t?s.filter(a=>Qn.has(a.key)):s}function as(e){const t=document.createElement("div");t.className="os-plugins__name-cell";const o=document.createElement("div");o.className="os-plugins__name-icon";const n=e.openstation_icon_url;if(n){const r=document.createElement("img");r.alt="",r.loading="lazy",r.decoding="async",r.src=Rt(r,n,()=>{o.replaceChildren(D())}),o.appendChild(r)}else o.appendChild(D());const s=document.createElement("div");s.className="os-plugins__name-text";const a=document.createElement("strong");a.textContent=e.name||e.plugin;const i=document.createElement("span");return i.className="os-plugins__name-path",i.textContent=e.plugin,s.append(a,i),t.append(o,s),t}function is(e){const t=document.createElement("div");t.className="os-plugins__version-cell";const o=document.createElement("span");o.textContent=e.version??"—",t.appendChild(o);const n=e.openstation_update_available;if(n?.available&&n.new_version){const s=document.createElement("span");s.className="os-plugins__update-badge",s.textContent=v(l("→ %s","desktop-mode"),n.new_version),t.appendChild(s)}return t}function rs(e){const t=document.createElement("span");return t.className="os-plugins__author-cell",t.textContent=z(e.author??"")||l("Unknown","desktop-mode"),t}function ls(e,t){const o=document.createElement("div");o.setAttribute("data-noclick",""),o.className="os-plugins__auto-update";const n=t.openstation_auto_update,s=n?.forced??null;if(s!==null){const d=document.createElement("span");return d.className="os-plugins__auto-update-fixed",d.textContent=l(s?"Auto-updates enabled":"Auto-updates disabled","desktop-mode"),o.appendChild(d),o}if(!n?.supported){const d=document.createElement("span");return d.className="os-plugins__auto-update-none",d.textContent="—",d.title=l("This plugin does not check in with WordPress.org, so automatic updates can't be scheduled.","desktop-mode"),o.appendChild(d),o}const a=!!n.enabled,i=e.busy.autoUpdating.has(t.plugin),r=document.createElement("os-button");return r.setAttribute("variant","link"),r.setAttribute("size","small"),r.setAttribute("data-wp-action",a?"disable":"enable"),i?(r.setAttribute("busy",""),r.setAttribute("disabled",""),r.setAttribute("aria-busy","true"),r.textContent=l(a?"Disabling…":"Enabling…","desktop-mode")):r.textContent=l(a?"Disable auto-updates":"Enable auto-updates","desktop-mode"),r.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),Eo(e,t)}),o.appendChild(r),o}function ds(e,t){const o=document.createElement("div");return o.className="os-plugins__row-actions",o.setAttribute("data-noclick",""),o.append(...pt(e,t)),o}function cs(e,t){const o=async(s,a={},i="ajax")=>{const r=e(),d=new URLSearchParams;d.set("action",s),d.set("_ajax_nonce",i==="updates"?r.updatesNonce:r.ajaxNonce);for(const[u,p]of Object.entries(a))p!==void 0&&d.set(u,String(p));const c=await t(r.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:d});return Vt(await Bt(c),c.status)},n=async(s,a)=>{const i=e();a.set("action",s),a.has("_ajax_nonce")||a.set("_ajax_nonce",i.ajaxNonce);const r=await t(i.ajaxUrl,{method:"POST",body:a});return Vt(await Bt(r),r.status)};return{browsePlugins:(s={})=>o("openstation_plugins_browse",{browse:s.browse,search:s.search,page:s.page,per_page:s.perPage}),fetchPluginInfo:s=>o("openstation_plugins_info",{slug:s}),fetchPluginReviews:s=>o("openstation_plugins_reviews",{slug:s}),fetchFeaturedPlugins:()=>o("openstation_plugins_featured"),installPluginBySlug:s=>o("install-plugin",{slug:s},"updates"),updateInstalledPlugin:s=>o("update-plugin",{plugin:Ce(s.plugin),slug:s.openstation_update_available?.slug||s.textdomain||s.plugin.split("/")[0]},"updates"),toggleAutoUpdate:async(s,a)=>{await o("toggle-auto-updates",{type:"plugin",asset:Ce(s.plugin),state:a},"updates")},uploadPluginZip:(s,a={})=>{const i=new FormData;return i.set("pluginzip",s),a.overwrite&&i.set("overwrite","1"),n("openstation_plugins_upload",i)},isOpenStationSelf:s=>{const a=e().selfPluginFile??"",i=r=>r.endsWith(".php")?r.slice(0,-4):r;return a!==""&&i(a)===i(s)}}}async function Bt(e){let t;try{t=await e.json()}catch(o){throw new Error(`Server returned ${e.status} with non-JSON body. (${String(o)})`)}if(!e.ok){const o=typeof t=="object"&&t!==null&&"success"in t&&t.success===!1?t.data:t;throw Ot(o,e.status)}return t}function Vt(e,t){if(typeof e=="object"&&e!==null&&"success"in e){const o=e;if(o.success)return o.data??null;throw Ot(o.data,t)}return e}function Ot(e,t){if(typeof e=="object"&&e!==null){const o=e,n=o.message??o.errorMessage??o.code??o.errorCode;if(typeof n=="string"&&n!==""){const s=new Error(n);return s.code=o.code??o.errorCode,s.status=t,s}}return new Error(`Request failed (${t}).`)}function Wt(e,t){return new Promise(o=>{const n=document.createElement("div");n.className="os-plugins__upload-overlay";const s=document.createElement("div");s.className="os-plugins__upload-card",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",l("Upload a plugin .zip","desktop-mode"));const a=document.createElement("h2");a.className="os-plugins__upload-heading",a.textContent=l("Upload a plugin","desktop-mode");const i=document.createElement("p");i.className="os-plugins__upload-lede",i.textContent=l("Pick a .zip file from your computer, or drop one onto the area below.","desktop-mode");const r=document.createElement("div");r.className="os-plugins__upload-dropzone",r.tabIndex=0,r.setAttribute("role","button"),r.setAttribute("aria-label",l("Drop a .zip plugin file here, or click to choose a file.","desktop-mode"));const d=document.createElement("span");d.className="dashicons dashicons-upload os-plugins__upload-icon",d.setAttribute("aria-hidden","true");const c=document.createElement("p");c.className="os-plugins__upload-hint",c.textContent=l("Drop your .zip here or click to browse","desktop-mode");const u=document.createElement("p");u.className="os-plugins__upload-filename",u.hidden=!0;const p=document.createElement("input");p.type="file",p.accept=".zip,application/zip,application/x-zip-compressed",p.style.display="none",r.append(d,c,u,p);const h=document.createElement("p");h.className="os-plugins__upload-status",h.hidden=!0;const b=document.createElement("div");b.className="os-plugins__upload-actions";const m=document.createElement("os-button");m.setAttribute("variant","ghost"),m.textContent=l("Cancel","desktop-mode");const y=document.createElement("os-button");y.setAttribute("variant","primary"),y.textContent=l("Install","desktop-mode"),y.setAttribute("disabled",""),b.append(m,y),s.append(a,i,r,h,b),n.appendChild(s),e.root.appendChild(n);const f=g=>{g.preventDefault(),g.stopPropagation()};n.addEventListener("dragenter",f),n.addEventListener("dragover",f),n.addEventListener("drop",f);let w=null,x=!1;const E=(g,C)=>{h.hidden=!1,h.dataset.tone=C,h.textContent=g},q=g=>{w=g,r.classList.toggle("has-file",!!g),u.hidden=!g,g?(u.textContent=v(l("%1$s · %2$s","desktop-mode"),g.name,ye(g.size)),y.removeAttribute("disabled")):y.setAttribute("disabled","")};r.addEventListener("click",g=>{g.target?.tagName!=="INPUT"&&p.click()}),r.addEventListener("keydown",g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p.click())}),r.addEventListener("dragover",g=>{g.preventDefault(),g.stopPropagation(),r.classList.add("is-hovered")}),r.addEventListener("dragleave",g=>{g.stopPropagation(),r.classList.remove("is-hovered")}),r.addEventListener("drop",g=>{g.preventDefault(),g.stopPropagation(),r.classList.remove("is-hovered");const C=g.dataTransfer?.files?.[0];C&&Ke(C)?q(C):C&&E(l("Only .zip files are accepted.","desktop-mode"),"error")}),p.addEventListener("change",()=>{const g=p.files?.[0];g&&Ke(g)&&q(g)});const fe=g=>{n.remove(),o(g)};n.addEventListener("keydown",g=>{g.key==="Escape"&&!x&&fe(null)}),m.addEventListener("click",()=>{x||fe(null)}),y.addEventListener("click",()=>{w&&!x&&Qt()}),n.addEventListener("click",g=>{g.target===n&&!x&&fe(null)}),t&&Ke(t)&&q(t);let Xe=null;const Xt=g=>{x=g,g?(Xe=F(y),m.setAttribute("disabled","")):(Xe?.(),Xe=null,m.removeAttribute("disabled"))};async function Qt(g=!1){if(w){Xt(!0),E(l(g?"Replacing existing plugin…":"Uploading and installing…","desktop-mode"),"info");try{const C=await e.rest.uploadPluginZip(w,{overwrite:g});e.refresh(),e.broadcastChange({plugin:C.plugin_file,action:"install"}),e.refreshMenu(),xs(C)}catch(C){const ie=C.status,be=C.code;if(Xt(!1),!g&&(ie===409||be==="folder_exists")){E(l("A plugin with the same folder name is already installed.","desktop-mode"),"info"),await e.confirm({title:l("Replace existing plugin?","desktop-mode"),message:l("A plugin with the same folder name is already installed. Replacing it overwrites the installed files. Any local edits to the plugin will be lost. The plugin will keep its activation state.","desktop-mode"),confirmLabel:l("Replace","desktop-mode"),cancelLabel:l("Cancel","desktop-mode"),danger:!0})&&await Qt(!0);return}E(v(l("Upload failed: %s","desktop-mode"),C instanceof Error?C.message:String(C)),"error")}}}function xs(g){x=!1,r.remove(),b.remove(),h.hidden=!0;const C=document.createElement("h3");C.className="os-plugins__upload-success-heading",C.textContent=l("Plugin installed successfully.","desktop-mode");const ie=document.createElement("p");ie.className="os-plugins__upload-success-detail";const be=g.plugin_name||g.plugin_file;ie.textContent=g.plugin_version?v(l("%1$s %2$s","desktop-mode"),be,g.plugin_version):be;const ve=document.createElement("div");ve.className="os-plugins__upload-actions";const L=document.createElement("os-button");L.setAttribute("variant","ghost"),L.textContent=l("Close","desktop-mode");const I=document.createElement("os-button");I.setAttribute("variant","primary"),I.textContent=l("Activate Plugin","desktop-mode"),ve.append(L,I),s.append(C,ie,ve),L.addEventListener("click",()=>{x||fe(g)}),I.addEventListener("click",()=>{if(x)return;x=!0;const ks=F(I);L.setAttribute("disabled","");const ws=g.plugin_file.endsWith(".php")?g.plugin_file.slice(0,-4):g.plugin_file;Se(e,{plugin:ws}).then(Cs=>{if(x=!1,L.removeAttribute("disabled"),!Cs){ks();return}C.textContent=l("Plugin activated.","desktop-mode"),I.remove(),L.setAttribute("variant","primary"),L.textContent=l("Done","desktop-mode"),L.focus?.()})}),window.setTimeout(()=>I.focus?.(),16)}window.setTimeout(()=>r.focus(),16)})}function Ke(e){return e.size<=0?!1:e.name.toLowerCase().endsWith(".zip")?!0:e.type==="application/zip"||e.type==="application/x-zip-compressed"}const us="desktop-mode-plugins",ps="heartbeat",hs=5*60*1e3;function gs(e,t){const o=()=>e.extra,n=cs(o,(s,a)=>e.fetch(s,a));return{get extra(){return o()},get installed(){return e.data?.installed??[]},rest:n,root:e.root,busy:xo(),caches:{info:new Map,reviews:new Map},dispatch:e.dispatch,refresh:()=>e.dispatch("refresh"),repaint:()=>e.repaint(),toast:(s,a=3500)=>e.host.toast?.({message:s,duration:a}),confirm:s=>e.host.confirm?.({title:s.title,message:s.message,label:s.confirmLabel,confirmLabel:s.confirmLabel,danger:s.danger})??Promise.resolve(!0),refreshMenu:()=>e.host.refreshMenu?.(),installedFor:s=>(e.data?.installed??[]).find(a=>we(a)===s),broadcastChange:(s,a=[])=>{const i=Date.now();for(const d of[s.plugin,...a])d&&t.set(vo(Ce(d)),i);const r=window.wp?.os;typeof r?.broadcast=="function"&&r.broadcast(it,{source:rt,...s})}}}function ms(e,t){const o=Date.now();for(const[n,s]of e)o-s>hs&&e.delete(n);return!!t&&t.length>0&&t.every(n=>e.has(n))}const Ge=e=>e.ui(()=>{const t=new Map;return{host:gs(e,t),installed:Yn(),browse:null,featured:null,ctaKey:"",dragDepth:0,ownChanges:t,teardown:[]}}),Zt=e=>e.root.querySelector("[data-os-plugins-table]"),Kt=e=>e.root.querySelector("[data-os-plugins-flyout]");function Gt(e,t,o){const n=()=>{Zt(e)?.clearSelection(),t.installed.selected=[],e.repaint()},s=Ao(t.host,t.installed.selected,n);return _`<div
229 - class="os-app-list__toolbar-right${o?" os-app-list__bulk--footer":""}"
230 - ?hidden=${t.installed.selected.length===0}
256 +`+eo,po=new WeakMap;function ho(o,e,t){let s=po.get(o);if(s||(s=new Set,po.set(o,s)),s.has(e))return;if(s.add(e),"adoptedStyleSheets"in o&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype){const i=new CSSStyleSheet;i.replaceSync(t),o.adoptedStyleSheets=[...o.adoptedStyleSheets,i];return}const n=document.createElement("style");n.setAttribute("data-os-plugins-styles",e),n.textContent=t,o.appendChild(n)}function Y(o,e=""){return f`<span class="os-plugins__table-line ${e}" title=${o}>${o}</span>`}function cn(o){return[{key:"name",label:d("Plugin","desktop-mode"),render:(e,t)=>{const s=$(t.name)||t.plugin;return f`<div class="os-plugins__table-identity">${o.icon(t)}<div class="os-plugins__table-copy">
257 + <span class="os-plugins__table-line os-plugins__table-title" data-plugin-title title=${s}>${s}</span>
258 + ${Y($(t.author??"")||t.plugin,"os-plugins__table-secondary")}
259 + </div></div>`}},{key:"status",label:d("Status","desktop-mode"),width:"140px",render:(e,t)=>{const s=N(t.status);let n=d(s?"Active":"Inactive","desktop-mode");return t.status==="network-active"&&(n=d("Network active","desktop-mode")),o.host.busy.optimistic.has(t.plugin)&&(n=d("Changing…","desktop-mode")),f`<div class="os-plugins__table-state" data-active=${String(s)}>${Y(n)}</div>`}},{key:"version",label:d("Version","desktop-mode"),width:"142px",render:(e,t)=>f`<div class="os-plugins__table-version">${Y(t.version||"—")}
260 + ${t.openstation_update_available?.available?Y(y(d("Update to %s","desktop-mode"),t.openstation_update_available.new_version||"—"),"os-plugins__table-update"):""}</div>`},{key:"size",label:d("Size","desktop-mode"),width:"92px",align:"end",render:(e,t)=>Y(typeof t.openstation_size_kb=="number"?ye(t.openstation_size_kb*1024):"—","os-plugins__table-version")},{key:"actions",label:d("Actions","desktop-mode"),width:"186px",align:"end",render:(e,t)=>{const s=o.actions(t).filter(i=>i.tagName==="OS-BUTTON"),n=$(t.name)||t.plugin;return f`<div class="os-plugins__table-actions" data-noclick>${s[0]??""}
261 + <os-action-menu data-plugin-actions=${t.plugin} text="⋯" label=${y(d("Actions for %s","desktop-mode"),n)}
262 + @os-context-menu-pick=${i=>{const a=i.detail.value;if(a==="details")o.open(t);else{const r=s[Number(a)];r&&!r.hasAttribute("disabled")&&r.click()}}}>
263 + <os-context-menu-option value="details">${d("Plugin details","desktop-mode")}</os-context-menu-option>
264 + ${s.slice(1).map((i,a)=>f`<os-context-menu-option value=${String(a+1)}
265 + ?disabled=${i.hasAttribute("disabled")}>${i.textContent}</os-context-menu-option>`)}
266 + </os-action-menu></div>`}}]}function un(o,e){const t=e.root.querySelector("[data-os-plugins-table]");if(!t){o.element=null,o.key="";return}o.element!==t&&(o.element=t,o.key="",t.getRowId=n=>n.plugin,t.columns=cn(e),t.addEventListener("os-table-row-click",n=>e.open(n.detail.row)),t.addEventListener("os-table-selection-change",()=>e.onSelection(Array.from(t.selection,String))),queueMicrotask(()=>{t.isConnected&&t.shadowRoot&&ho(t.shadowRoot,"installed-table",ln.cssText)}));const s=JSON.stringify([e.rows,e.host.extra.caps,[...e.host.busy.updating],[...e.host.busy.optimistic]]);o.key!==s&&(o.key=s,t.data=e.rows),JSON.stringify(Array.from(t.selection,String))!==JSON.stringify(e.selected)&&(t.selection=e.selected)}const pn=k` .desktop-mode-plugins [hidden]{display:none !important}.os-plugins__workspace{display:flex;flex:1;min-block-size:0;min-inline-size:0;overflow:hidden}.os-plugins__library{display:flex;flex-direction:column;flex:1;min-block-size:0;min-inline-size:0;container:plugin-library / inline-size;background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-plugins__library-head{padding:24px 24px 0;flex:0 0 auto}.os-plugins__library-intro{display:flex;align-items:center;justify-content:space-between;gap:12px}.os-plugins__eyebrow{font-size:10px;font-weight:600;letter-spacing:0.13em;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__library-intro h2{font-size:clamp( 20px,3cqi,28px );font-weight:600;letter-spacing:-0.035em;line-height:1.2;margin:7px 0 20px;color:var( --os-ui-fg,#1d2327 )}.os-plugins__collections{display:grid;grid-template-columns:repeat( 4,minmax( 0,1fr ) );gap:8px}.os-plugins__collection{min-inline-size:0;border-radius:12px;border:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-plugins__collection::part( button ){inline-size:100%;padding:13px 14px;justify-content:start;gap:8px;border-radius:12px}.os-plugins__collection strong{font-size:20px;font-weight:600;margin-inline-start:auto;font-variant-numeric:tabular-nums;letter-spacing:-0.03em}.os-plugins__collection .dashicons{font-size:17px;inline-size:17px;block-size:17px;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__collection[aria-pressed="true"]{border-color:var( --os-ui-accent,#2271b1 );background:var( --os-ui-accent-soft,#f0f6fc )}.os-plugins__collection[aria-pressed="true"] .dashicons{color:var( --os-ui-accent,#2271b1 )}.os-plugins__library-tools{display:flex;align-items:center;gap:10px;padding:18px 24px 14px;flex:0 0 auto}.os-plugins__library-tools .os-app-list__search{flex:1;min-inline-size:100px;max-inline-size:none}.os-plugins__library-tools os-select{flex:0 0 152px;min-inline-size:0}.os-plugins__view-switch{display:flex;flex:0 0 auto;gap:2px;padding:3px;border:1px solid var(--os-ui-border,#dcdcde);border-radius:8px;background:var(--os-ui-surface,#fff)}.os-plugins__view-switch .dashicons{font-size:16px;inline-size:16px;block-size:16px}.os-plugins__library-scroll{overflow:auto;scrollbar-gutter:stable;flex:1;min-block-size:0;padding:0 24px 28px;overscroll-behavior:contain}.os-plugins__workspace[data-view="table"] .os-plugins__library-scroll{display:flex;flex-direction:column;overflow:hidden;padding-block-end:16px}.os-plugins__library-scroll>os-table{flex:1;min-block-size:0;min-inline-size:0;--os-ui-table-font-size:12px}.os-plugins__inspector-bar>span{min-inline-size:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.os-plugins__shelf + .os-plugins__shelf{margin-block-start:30px}.os-plugins__shelf-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-block:14px}.os-plugins__shelf-heading h3{margin:0;font-size:15px;font-weight:600;letter-spacing:-0.015em}.os-plugins__shelf-heading h3>span{margin-inline-start:6px;font-size:12px;color:var( --os-ui-fg-muted,#646970 );font-weight:400}.os-plugins__shelf-heading p{margin:4px 0 0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__module{min-inline-size:0;--os-ui-card-padding:18px;--os-ui-card-radius:14px;--os-ui-card-gap:14px}.os-plugins__module[data-lane="update"]{border-block-start:2px solid var( --os-ui-warning-fg,#dba617 )}.os-plugins__module-top{display:flex;align-items:center;gap:12px;min-inline-size:0}.os-plugins__module-icon{display:grid;flex:0 0 44px;inline-size:44px;block-size:44px;position:relative;place-items:center;overflow:hidden;border-radius:11px;background:var( --os-ui-surface-sunken,#f0f0f1 );color:var( --os-ui-fg-muted,#646970 )}.os-plugins__module-icon img{position:absolute;inset:0;inline-size:100%;block-size:100%;object-fit:contain;z-index:1;opacity:0;background:var( --os-ui-surface,#fff )}.os-plugins__module-icon img.is-loaded{opacity:1}.os-plugins__monogram{font-size:16px;font-weight:600;letter-spacing:-0.04em}.os-plugins__module-identity{min-inline-size:0;flex:1}.os-plugins__module-identity h3{font-size:14px;line-height:1.35;margin:0 0 3px;font-weight:600;overflow-wrap:anywhere;color:var( --os-ui-fg,#1d2327 )}.os-plugins__module-identity>span{display:block;color:var( --os-ui-fg-muted,#646970 );font-size:11px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.os-plugins__pick{flex:0 0 auto;max-inline-size:22px;overflow:hidden}.os-plugins__module-description{margin:0;color:var( --os-ui-fg-muted,#646970 );font-size:12px;line-height:1.6;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-block-size:3.2em;overflow-wrap:anywhere}.os-plugins__module-meta{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;color:var( --os-ui-fg-muted,#646970 );font-size:11px;margin-block-start:auto}.os-plugins__state{display:inline-flex;align-items:center;gap:6px}.os-plugins__state::before{content:'';inline-size:6px;block-size:6px;border-radius:50%;background:var( --os-ui-fg-faint,#a7aaad )}.os-plugins__state[data-active="true"]::before{background:var( --os-ui-success-fg,#008a20 )}.os-plugins__next-version{color:var( --os-ui-warning-fg,#996800 );font-weight:600}.os-plugins__module-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px;padding-block-start:12px;border-block-start:1px solid var( --os-ui-border,#dcdcde )}.os-plugins__module-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-inline-size:0}.os-plugins__module-actions os-button{max-inline-size:100%}.os-plugins__module-actions os-button::part( button ){white-space:normal;overflow-wrap:anywhere}.os-plugins__update-hint{font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__selection{flex:0 0 auto;display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 20px;border-block-start:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-plugins__selection-count{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__selection-actions{display:flex;gap:6px;flex-wrap:wrap;margin-inline-start:auto}.os-plugins__inspector{display:flex;flex-direction:column;flex:0 0 43%;min-inline-size:340px;max-inline-size:540px;min-block-size:0;border-inline-start:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-plugins__inspector-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-plugins__inspector-bar>span{font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__inspector-updates{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 16px;font-size:11px;flex-wrap:wrap}.os-plugins__inspector>.os-plugins__module-actions{padding:12px 16px;border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-plugins__inspector-scroll{flex:1;min-block-size:0;overflow:auto;overscroll-behavior:contain}.os-plugins__auto-update-fixed,.os-plugins__auto-update-none{color:var( --os-ui-fg-muted,#646970 )}.os-plugins__library-empty{padding:48px 12px;text-align:center}.os-plugins__library-empty>.dashicons{font-size:32px;inline-size:32px;block-size:32px;color:var( --os-ui-fg-muted,#646970 )}.os-plugins__library-empty h3{font-size:18px;font-weight:500}.os-plugins__library-empty p{color:var( --os-ui-fg-muted,#646970 );margin-block-end:20px}.os-plugins__loading{display:grid;gap:16px;padding:36px 12px;color:var( --os-ui-fg-muted,#646970 )}@container plugin-library ( max-width:660px ){.os-plugins__library-tools{flex-wrap:wrap}.os-plugins__library-tools .os-app-list__search{flex-basis:100%}.os-plugins__library-tools os-select{flex:1}.os-plugins__library-head{padding:16px 16px 0}.os-plugins__library-tools{padding:14px 16px 10px}.os-plugins__library-scroll{padding-inline:16px}.os-plugins__collection::part( button ){padding:10px 8px;flex-wrap:wrap;gap:4px;font-size:11px}.os-plugins__collection .dashicons{display:none}.os-plugins__collection strong{font-size:17px}.os-plugins__collections{gap:5px}}@container ( max-width:760px ){.os-plugins__workspace[data-detail-open="true"]>.os-plugins__library{display:none}.os-plugins__inspector{flex:1;min-inline-size:0;max-inline-size:none;border-inline-start:0}}@container plugin-library ( max-width:420px ){.os-plugins__library-intro h2{font-size:21px;margin-block-end:14px}.os-plugins__eyebrow{font-size:9px}.os-plugins__library-tools{flex-wrap:wrap;gap:8px}.os-plugins__library-tools .os-app-list__search{flex-basis:100%}.os-plugins__library-tools os-select{flex:1}.os-plugins__collection::part( button ){flex-direction:column-reverse;padding:8px 4px}.os-plugins__collection strong{margin-inline-start:0}.os-plugins__shelf-heading p{display:none}.os-plugins__selection{gap:8px;padding:10px 12px}.os-plugins__selection-actions{order:1;flex-basis:100%}}`,hn=/^(https:\/\/ps\.w\.org\/[a-z0-9-]+\/assets\/)icon\.svg$/i;function gn(o){const e=o.match(hn);if(!e)return[o];const t=e[1];return[o,t+"icon-256x256.png",t+"icon-256x256.jpg",t+"icon-256x256.jpeg",t+"icon-256x256.gif",t+"icon-128x128.png",t+"icon-128x128.jpg",t+"icon-128x128.jpeg",t+"icon-128x128.gif"]}function go(o,e,t){const s=gn(e);let n=0;return o.addEventListener("error",()=>{if(n+=1,n<s.length){o.src=s[n];return}t()}),s[0]}const fn=k` ${T}:host{display:inline-flex;align-items:center;gap:var( --os-ui-badge-gap,6px );padding:var( --os-ui-badge-padding,2px 8px );font:var( --os-ui-badge-font,500 12px/1.4 var( --os-font,system-ui ) );color:var( --os-ui-badge-color,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-badge-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );border:var( --os-ui-badge-border,1px solid transparent );border-radius:var( --os-ui-badge-border-radius,999px );white-space:nowrap;vertical-align:baseline}:host( [ hidden ] ){display:none}.dot{width:var( --os-ui-badge-dot-size,8px );height:var( --os-ui-badge-dot-size,8px );border-radius:50%;background:currentColor;flex:0 0 auto}:host( [ tone="success" ] ){--os-ui-badge-color:var( --os-ui-badge-success,var( --os-ui-success-fg,#1a7f37 ) );--os-ui-badge-bg:var( --os-ui-badge-success-bg,rgba( 26,127,55,0.12 ) )}:host( [ tone="warning" ] ){--os-ui-badge-color:var( --os-ui-badge-warning,var( --os-ui-warning-fg,#9a6700 ) );--os-ui-badge-bg:var( --os-ui-badge-warning-bg,rgba( 154,103,0,0.12 ) )}:host( [ tone="danger" ] ){--os-ui-badge-color:var( --os-ui-badge-danger,var( --os-ui-danger,#cf222e ) );--os-ui-badge-bg:var( --os-ui-badge-danger-bg,rgba( 207,34,46,0.12 ) )}:host( [ tone="info" ] ){--os-ui-badge-color:var( --os-ui-badge-info,var( --os-ui-info-fg,#0969da ) );--os-ui-badge-bg:var( --os-ui-badge-info-bg,rgba( 9,105,218,0.12 ) )}:host( [ tone="neutral" ] ){--os-ui-badge-color:var( --os-ui-badge-neutral,var( --os-ui-fg-muted,#57606a ) );--os-ui-badge-bg:var( --os-ui-badge-neutral-bg,rgba( 87,96,106,0.12 ) )}:host( [ tone="accent" ] ){--os-ui-badge-color:var( --os-ui-badge-accent,var( --_holo-ink ) );background-color:transparent;background-image:var( --os-ui-badge-accent-bg,var( --_holo-fill ) );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;box-shadow:var( --_holo-glow );font-weight:600}:host( [ tone="accent" ] ) .dot{display:none}:host( [ no-dot ] ) .dot{display:none}`,he=class he extends C{render(){return f`<span class="dot" aria-hidden="true"></span><slot></slot>`}};he.props=["tone","noDot"],he.styles=[fn],he.help=void 0;let ut=he;E("os-badge",ut);const bn=k` ${T}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,ge=class ge extends C{constructor(){super(...arguments),this._onHostKeyDown=e=>{if(this.dismissible!==null&&(e.key==="Backspace"||e.key==="Delete")){if(e.preventDefault(),this.disabled!==null)return;const n=this.label??"";this.emit("os-chip-dismiss",{label:n})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const e=this.label??"",t=this.dismissible!==null,s=this.disabled!==null;return f`
267 + <span part="chip" class="os-chip">
268 + <span class="os-chip__icon">
269 + <slot name="icon"></slot>
270 + </span>
271 + <span class="os-chip__label">
272 + ${e===""?f`<slot></slot>`:e}
273 + </span>
274 + ${t?f`
275 + <button
276 + part="dismiss"
277 + class="os-chip__dismiss"
278 + type="button"
279 + aria-label=${`Remove ${e||"chip"}`}
280 + ?disabled=${s}
281 + @click=${n=>this._onDismiss(n)}
282 + >
283 + ${ks("close",{size:null})}
284 + </button>
285 + `:f``}
286 + </span>
287 + `}_onDismiss(e){if(e.stopPropagation(),this.disabled!==null)return;const s=this.label??"";this.emit("os-chip-dismiss",{label:s})}};ge.props=["label","tone","size","dismissible","disabled","pending","selected"],ge.styles=[bn],ge.help=void 0;let pt=ge;E("os-chip",pt);const mn=k`:host{display:flex;flex-direction:row;flex-wrap:wrap;gap:var( --os-ui-cluster-gap,8px );justify-content:var( --os-ui-cluster-justify,flex-start );align-items:var( --os-ui-cluster-align,center )}:host( [ hidden ] ){display:none}`,fe=class fe extends C{render(){const e=this.gap,t=this.justify,s=this.align,n=e&&/^\d+$/.test(e)?`${e}px`:"";return n&&this.style.setProperty("--os-ui-cluster-gap",n),t&&this.style.setProperty("--os-ui-cluster-justify",t),s&&this.style.setProperty("--os-ui-cluster-align",s),f`<slot></slot>`}};fe.props=["gap","justify","align"],fe.styles=[mn],fe.help=void 0;let ht=fe;E("os-cluster",ht);const vn=k`:host{display:flex;flex-direction:column;gap:var( --os-ui-stack-gap,12px );align-items:var( --os-ui-stack-align,stretch );padding:var( --os-ui-stack-padding,0 )}:host( [ hidden ] ){display:none}`,be=class be extends C{render(){const e=this.gap,t=this.align,s=this.padding,n=e&&/^\d+$/.test(e)?`${e}px`:"";return n&&this.style.setProperty("--os-ui-stack-gap",n),t&&this.style.setProperty("--os-ui-stack-align",t),s!==null&&/^\d+$/.test(s)&&this.style.setProperty("--os-ui-stack-padding",`${s}px`),f`<slot></slot>`}};be.props=["gap","align","padding"],be.styles=[vn],be.help=void 0;let gt=be;E("os-stack",gt);const ze=o=>Be(o,"os-plugins__detail-html");function _n(o){const e=we(o),t=[];let s=null;const n=/([0-9]+\.[0-9]+(?:\.[0-9]+)?(?:[\w.+-]*)?)/,i=()=>{s&&(t.push({version:s.version,body:s.html.trim()}),s=null)};for(const a of Array.from(e.childNodes)){if(a.nodeType===Node.ELEMENT_NODE){const r=a,l=/^H[1-6]$/.test(r.tagName),c=(r.textContent??"").trim().replace(/^=+\s*|\s*=+$/g,"").trim();if(l&&n.test(c)){i(),s={version:c,html:""};continue}s&&(s.html+=r.outerHTML);continue}a.nodeType===Node.TEXT_NODE&&s&&fo(s,a.textContent??"")}return i(),t}function fo(o,e){if(e.trim()===""){o.html!==""&&(o.html+=e);return}o.html+=`<p>${Wt(e)}</p>`}function yn(o){const e=we(o),t=Array.from(e.querySelectorAll(":scope > dt"));if(t.length>0)return t.map(kn).filter(r=>r.question!=="");const s=e.querySelector(":scope > dl");if(s){const r=[];let l=null;for(const c of Array.from(s.children))c.tagName==="DT"?(l&&r.push({question:l.q,answer:l.html.trim()}),l={q:(c.textContent??"").trim(),html:""}):l&&(l.html+=c.tagName==="DD"?c.innerHTML:c.outerHTML);return l&&r.push({question:l.q,answer:l.html.trim()}),r.filter(c=>c.question!=="")}const n=[];let i=null;const a=()=>{i&&(n.push({question:i.q,answer:i.html.trim()}),i=null)};for(const r of Array.from(e.childNodes)){if(r.nodeType===Node.ELEMENT_NODE){const l=r,c=(l.textContent??"").trim();if(/^H[1-6]$/.test(l.tagName)&&c){a(),i={q:c,html:""};continue}i&&(i.html+=l.outerHTML);continue}r.nodeType===Node.TEXT_NODE&&i&&fo(i,r.textContent??"")}return a(),n.filter(r=>r.question!=="")}function kn(o){let e="",t="",s=!1;for(const n of Array.from(o.childNodes)){if(n.nodeType===Node.TEXT_NODE){const a=n.textContent??"";s?a.trim()!==""&&(t+=`<p>${Wt(a)}</p>`):e+=a;continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;const i=n;i.tagName==="P"&&(i.textContent??"").trim()===""||(s=!0,t+=i.outerHTML)}return{question:e.replace(/\s+/g," ").trim(),answer:t.trim()}}function xn(o){if(!o)return Z(d("Loading from WordPress.org…","desktop-mode"));const e=o.sections?.changelog;if(!e)return G("list-view",d("No changelog","desktop-mode"),d("This plugin doesn’t ship a changelog.","desktop-mode"));const t=_n(e);if(t.length===0)return ze(e);const s=document.createElement("os-stack");return s.setAttribute("gap","12"),s.className="os-plugins__detail-changelog",t.forEach((n,i)=>{const a=document.createElement("os-card");a.className="os-plugins__detail-changelog-entry";const r=document.createElement("div");r.setAttribute("slot","header"),r.className="os-plugins__detail-changelog-head";const l=document.createElement("os-badge");if(l.setAttribute("tone",i===0?"success":"neutral"),l.textContent=n.version,r.appendChild(l),i===0){const c=document.createElement("span");c.className="os-plugins__detail-changelog-latest",c.textContent=d("Latest","desktop-mode"),r.appendChild(c)}a.appendChild(r),a.appendChild(ze(n.body)),s.appendChild(a)}),s}function wn(o){if(!o)return Z(d("Loading from WordPress.org…","desktop-mode"));const e=o.sections?.faq;if(!e)return G("editor-help",d("No FAQ","desktop-mode"),d("This plugin doesn’t ship an FAQ.","desktop-mode"));const t=yn(e);if(t.length===0)return ze(e);const s=document.createElement("os-stack");return s.setAttribute("gap","8"),s.className="os-plugins__detail-faq",t.forEach((n,i)=>{const a=document.createElement("details");a.className="os-plugins__detail-faq-item",i===0&&a.setAttribute("open","");const r=document.createElement("summary");r.className="os-plugins__detail-faq-q";const l=document.createElement("span");l.className="os-plugins__detail-faq-q-text",l.textContent=n.question;const c=document.createElement("span");c.className="os-plugins__detail-faq-chevron",c.setAttribute("aria-hidden","true"),c.innerHTML=Ge("chevron-right",{size:16,rotate:90}),r.append(l,c);const p=ze(n.answer);p.classList.add("os-plugins__detail-faq-a"),a.append(r,p),s.appendChild(a)}),s}function Cn(o,e){const t=document.createElement("div");t.className="os-plugins__detail",t.setAttribute("data-noclick","");const s=Ln(o);t.appendChild(An(o));const n=document.createElement("div");n.className="os-plugins__detail-tabs-wrap",t.appendChild(n);const i=document.createElement("div");i.className="os-plugins__detail-body",t.appendChild(i);const a=document.createElement("os-tabs");a.className="os-plugins__detail-tabs",a.setAttribute("value","overview");const r=[{value:"overview",label:d("Overview","desktop-mode"),show:!0},{value:"details",label:d("Details","desktop-mode"),show:!0},{value:"changelog",label:d("Changelog","desktop-mode"),show:!!s},{value:"faq",label:d("FAQ","desktop-mode"),show:!!s},{value:"reviews",label:d("Reviews","desktop-mode"),show:!!s}];for(const b of r){if(!b.show)continue;const h=document.createElement("os-tab");h.setAttribute("value",b.value),h.textContent=b.label,a.appendChild(h)}n.appendChild(a);let l=s?e.caches.info.get(s)??null:null,c=!1,p="overview";const u=()=>{i.replaceChildren(Sn(p,o,s,l,e))},g=()=>{!s||l||c||(c=!0,(async()=>{try{l=await e.rest.fetchPluginInfo(s),e.caches.info.set(s,l)}catch{}finally{c=!1,t.isConnected&&u()}})())};return a.addEventListener("os-tab-change",b=>{p=b.detail?.value??"overview",s&&p!=="overview"&&p!=="details"&&g(),u()}),u(),t}function An(o){const e=document.createElement("div");e.className="os-plugins__detail-hero";const t=document.createElement("div");t.className="os-plugins__detail-hero-inner";const s=document.createElement("div");s.className="os-plugins__detail-hero-icon";const n=o.openstation_icon_url;if(n){const u=document.createElement("img");u.alt="",u.loading="lazy",u.decoding="async",u.src=go(u,n,()=>{s.replaceChildren(K())}),s.appendChild(u)}else s.appendChild(K());const i=document.createElement("os-stack");i.setAttribute("gap","6"),i.className="os-plugins__detail-hero-text";const a=document.createElement("os-cluster");a.setAttribute("gap","10"),a.setAttribute("align","center");const r=document.createElement("h3");if(r.className="os-plugins__detail-title",r.textContent=$(o.name)||o.plugin,a.appendChild(r),o.version){const u=document.createElement("os-badge");u.setAttribute("tone","neutral"),u.setAttribute("no-dot",""),u.textContent=y(d("v%s","desktop-mode"),o.version),a.appendChild(u)}a.appendChild(En(o));const l=o.openstation_update_available;if(l?.available&&l.new_version){const u=document.createElement("os-badge");u.setAttribute("tone","warning"),u.textContent=y(d("Update to %s","desktop-mode"),l.new_version),a.appendChild(u)}i.appendChild(a);const c=document.createElement("p");c.className="os-plugins__detail-byline";const p=$(o.author??"")||d("Unknown author","desktop-mode");return o.author_uri?c.append(d("by","desktop-mode")+" ",B(o.author_uri,p)):c.textContent=y(d("by %s","desktop-mode"),p),i.appendChild(c),t.append(s,i),e.appendChild(t),e}function En(o){const e=N(o.status),t=document.createElement("os-badge");return t.setAttribute("tone",e?"success":"neutral"),t.textContent=d(e?"Active":"Inactive","desktop-mode"),t}function Sn(o,e,t,s,n){return o==="overview"?$n(e,t,s):o==="details"?Nn(e):o==="changelog"?xn(s):o==="faq"?wn(s):to(n,t,s)}function $n(o,e,t){const s=document.createElement("os-stack");s.setAttribute("gap","20");const n=zn(o,t);n.children.length>0&&s.appendChild(n);const i=t?.sections?.description??t?.short_description??Tn(o);i?s.appendChild(Be(i,"os-plugins__detail-html")):e&&!t?s.appendChild(Z(d("Loading description…","desktop-mode"))):s.appendChild(G("admin-plugins",d("No description","desktop-mode"),d("This plugin doesn’t ship a description in its header.","desktop-mode")));const a=document.createElement("os-cluster");return a.setAttribute("gap","8"),a.className="os-plugins__detail-actions",e&&a.appendChild(H("primary",d("View on WordPress.org","desktop-mode"),Ce(e),"small")),o.plugin_uri&&a.appendChild(H("secondary",d("Plugin website","desktop-mode"),o.plugin_uri,"small")),o.author_uri&&a.appendChild(H("ghost",d("Author website","desktop-mode"),o.author_uri,"small")),a.children.length>0&&s.appendChild(a),s}function zn(o,e){const t=document.createElement("os-cluster");if(t.setAttribute("gap","8"),t.className="os-plugins__detail-chip-strip",e){if(typeof e.rating=="number"&&e.rating>0){const s=document.createElement("span");s.className="os-plugins__detail-stars-pill",s.appendChild(Ae(e.rating,e.num_ratings??0)),t.appendChild(s)}e.active_installs&&t.appendChild(V("admin-users",y(d("%s+ active installs","desktop-mode"),new Intl.NumberFormat().format(e.active_installs)))),e.last_updated&&t.appendChild(V("update",y(d("Updated %s","desktop-mode"),Ct(e.last_updated.slice(0,10),"long")))),e.tested&&t.appendChild(V("wordpress-alt",y(d("Tested up to WP %s","desktop-mode"),e.tested)))}return o.requires_wp&&t.appendChild(V("wordpress",y(d("Requires WP %s+","desktop-mode"),o.requires_wp))),o.requires_php&&t.appendChild(V("editor-code",y(d("Requires PHP %s+","desktop-mode"),o.requires_php))),o.network_only&&t.appendChild(V("networking",d("Network only","desktop-mode"))),t}function Nn(o){const e=document.createElement("os-grid");e.setAttribute("columns","2"),e.setAttribute("gap","12"),e.className="os-plugins__detail-grid";const t=N(o.status);return L(e,"media-document",d("Plugin file","desktop-mode"),bo(o.plugin)),o.version&&L(e,"tag",d("Version","desktop-mode"),o.version),o.openstation_size_kb!==null&&o.openstation_size_kb!==void 0&&L(e,"database",d("Size on disk","desktop-mode"),ye(o.openstation_size_kb*1024)),o.requires_wp&&L(e,"wordpress-alt",d("Requires WordPress","desktop-mode"),y(d("%s+","desktop-mode"),o.requires_wp)),o.requires_php&&L(e,"editor-code",d("Requires PHP","desktop-mode"),y(d("%s+","desktop-mode"),o.requires_php)),o.textdomain&&L(e,"translation",d("Text domain","desktop-mode"),bo(String(o.textdomain))),o.plugin_uri&&L(e,"admin-links",d("Plugin URL","desktop-mode"),B(o.plugin_uri,o.plugin_uri)),o.author_uri&&L(e,"admin-users",d("Author URL","desktop-mode"),B(o.author_uri,o.author_uri)),o.network_only&&L(e,"networking",d("Scope","desktop-mode"),d("Network only","desktop-mode")),L(e,t?"yes-alt":"marker",d("Status","desktop-mode"),d(t?"Active":"Inactive","desktop-mode")),e}function L(o,e,t,s){const n=document.createElement("os-card");n.setAttribute("compact",""),n.className="os-plugins__detail-fact";const i=document.createElement("div");i.setAttribute("slot","header"),i.className="os-plugins__detail-fact-head";const a=document.createElement("span");a.className=`dashicons dashicons-${e}`,a.setAttribute("aria-hidden","true");const r=document.createElement("span");r.textContent=t,i.append(a,r),n.appendChild(i);const l=document.createElement("div");l.className="os-plugins__detail-fact-value",typeof s=="string"?l.textContent=s:l.appendChild(s),n.appendChild(l),o.appendChild(n)}function V(o,e){const t=document.createElement("os-chip");t.setAttribute("label",e),t.setAttribute("tone","neutral");const s=document.createElement("span");return s.setAttribute("slot","icon"),s.className=`dashicons dashicons-${o}`,s.setAttribute("aria-hidden","true"),t.appendChild(s),t}function bo(o){const e=document.createElement("code");return e.textContent=o,e}function Ln(o){const e=o.openstation_wporg_slug;return typeof e=="string"?e:""}function Tn(o){const e=o.description;return e?typeof e=="string"?e:e.rendered||e.raw||"":""}const Rn=()=>({selected:[],savingView:!1,table:{element:null,key:""},rows:[],focused:"",sort:"attention",layoutKey:"",haystacks:{source:null,byPlugin:new Map},controls:new Map,detail:null,icons:new Map,autoUpdate:null});function Pn(o,e){return e.source!==o&&(e.source=o,e.byPlugin=new Map(o.map(t=>[t.plugin,`${t.name??""} ${t.plugin} ${$(t.author??"")}`.toLowerCase()]))),e.byPlugin}function qn(o,e,t,s){const n=t.trim().toLowerCase();return o.filter(i=>!(e==="active"&&!N(i.status)||e==="inactive"&&i.status!=="inactive"||e==="update"&&!i.openstation_update_available?.available||n!==""&&!(s?.get(i.plugin)??`${i.name??""} ${i.plugin} ${$(i.author??"")}`.toLowerCase()).includes(n)))}function Dn(o){return o.filter(e=>!!e.openstation_update_available?.available).length}function X(o){return o.openstation_update_available?.available?"update":N(o.status)?"active":"inactive"}function ft(o,e,t,s="card"){const n=JSON.stringify([t,o.extra.caps,o.busy.updating.has(t.plugin),o.busy.optimistic.has(t.plugin)]);let i=e.controls.get(`${s}:${t.plugin}`);if(!i||i.key!==n){const a=Tt(o,t);if(o.busy.optimistic.has(t.plugin)||o.busy.updating.has(t.plugin))for(const r of a)r.setAttribute("disabled",""),r.setAttribute("aria-busy","true");i={key:n,actions:a},e.controls.set(`${s}:${t.plugin}`,i)}return i.actions}function mo(o,e){const t=e.focused;e.focused="",o.repaint();const s=Array.from(o.root.querySelectorAll("[data-plugin-card]")).find(i=>i.dataset.pluginCard===t),n=Array.from(e.table.element?.shadowRoot?.querySelectorAll("[data-plugin-actions]")??[]).find(i=>i.getAttribute("data-plugin-actions")===t);queueMicrotask(()=>{(n?.shadowRoot?.querySelector("os-button")??s?.querySelector("[data-plugin-details]"))?.shadowRoot?.querySelector("button")?.focus()})}function Mn(o,e,t,s){const n=$(s.name)||s.plugin,i=N(s.status),a=e.busy.updating.has(s.plugin),r=e.busy.optimistic.has(s.plugin),l=s.openstation_update_available;let c=d(i?"Active":"Inactive","desktop-mode");s.status==="network-active"&&(c=d("Network active","desktop-mode")),r&&(c=d("Changing status…","desktop-mode"));const p=typeof s.description=="string"?s.description:s.description?.rendered||s.description?.raw||"",u=()=>{t.focused=s.plugin,o.repaint(),queueMicrotask(()=>o.root.querySelector("[data-plugin-back]")?.shadowRoot?.querySelector("button")?.focus())},g=b=>{const h=b.detail.checked;t.selected=h?[...new Set([...t.selected,s.plugin])]:t.selected.filter(_=>_!==s.plugin),o.repaint()};return f`<os-card
288 + class="os-plugins__module"
289 + data-plugin-card=${s.plugin}
290 + os-key=${s.plugin}
291 + ?selected=${t.focused===s.plugin||t.selected.includes(s.plugin)}
292 + data-lane=${X(s)}
293 + aria-label=${n}
231 294 >
232 - <span class="os-app-list__count">${v(l("%d selected","desktop-mode"),t.installed.selected.length)}</span>
233 - <span class="os-app-list__bulk-actions">
234 - ${s.map(a=>_`<os-button variant=${a.variant} size="small" @click=${a.run}>${a.label}</os-button>`)}
235 - </span>
236 - </div>`}function fs(e,t,o){const{state:n,data:s}=e,a=ts(s.installed),i=[{value:"",label:l("All","desktop-mode")},{value:"active",label:l("Active","desktop-mode")},{value:"inactive",label:l("Inactive","desktop-mode")},{value:"update",label:a>0?v(l("Update available (%d)","desktop-mode"),a):l("Update available","desktop-mode")}];return _`
237 - <header class="os-app-list__toolbar">
238 - <div class="os-app-list__toolbar-left">
239 - ${st({segments:i,value:n.status,bind:"status",action:"set",label:l("Filter by status","desktop-mode"),phone:o})}
295 + <div class="os-plugins__module-top">
296 + ${vo(t,s)}
297 + <div class="os-plugins__module-identity">
298 + <h3>${n}</h3>
299 + <span>${$(s.author??"")||d("Independent plugin","desktop-mode")}</span>
300 + </div>
301 + <os-checkbox
302 + class="os-plugins__pick"
303 + ?checked=${t.selected.includes(s.plugin)}
304 + aria-label=${y(d("Select %s","desktop-mode"),n)}
305 + @os-checkbox-change=${g}
306 + ></os-checkbox>
307 + </div>
308 + <p class="os-plugins__module-description">
309 + ${$(p)||d("No description provided.","desktop-mode")}
310 + </p>
311 + <div class="os-plugins__module-meta">
312 + <span class="os-plugins__state" data-active=${i?"true":"false"}> ${c} </span>
313 + <span
314 + >${t.sort==="size"&&typeof s.openstation_size_kb=="number"?f`<span>${ye(s.openstation_size_kb*1024)} · </span>`:""}${s.version||"—"}${l?.available&&l.new_version?f`<span class="os-plugins__next-version"> → ${l.new_version}</span>`:""}</span
315 + >
316 + </div>
317 + <footer class="os-plugins__module-footer">
318 + <div class="os-plugins__module-actions" aria-busy=${a||r?"true":"false"}>
319 + ${ft(e,t,s)}
320 + </div>
321 + <os-button
322 + variant="ghost"
323 + size="small"
324 + data-plugin-details
325 + aria-label=${y(d("Details for %s","desktop-mode"),n)}
326 + @click=${u}
327 + >${d("Details","desktop-mode")}<span aria-hidden="true"> ↗</span></os-button
328 + >
329 + </footer>
330 + </os-card>`}function In(o,e,t){const s=e.installed.find(a=>a.plugin===t.focused);if(!s)return"";const n=JSON.stringify(s),i=JSON.stringify([s,e.busy.autoUpdating.has(s.plugin)]);if(t.autoUpdate?.key!==i&&(t.autoUpdate={key:i,node:Fn(e,s)}),t.detail?.key!==n){const a=document.createElement("div");a.className="os-plugins__inspector-content";const r=a.attachShadow({mode:"open"});ho(r,"plugins",dn),r.appendChild(Cn(s,e)),t.detail={key:n,node:a}}return f`<aside
331 + class="os-plugins__inspector"
332 + aria-label=${$(s.name)||s.plugin}
333 + @keydown=${a=>{a.key==="Escape"&&(a.stopPropagation(),mo(o,t))}}
334 + >
335 + <header class="os-plugins__inspector-bar">
336 + <os-button variant="ghost" size="small" data-plugin-back @click=${()=>mo(o,t)}>
337 + <span aria-hidden="true">← </span>${d("Library","desktop-mode")}
338 + </os-button>
339 + <span>${$(s.name)||s.plugin}</span>
340 + </header>
341 + <div class="os-plugins__module-actions">${ft(e,t,s,"inspector")}</div>
342 + ${e.extra.autoUpdatesEnabled?f`<div class="os-plugins__inspector-updates">
343 + <span>${d("Automatic updates","desktop-mode")}</span>${t.autoUpdate.node}
344 + </div>`:""}
345 + <div class="os-plugins__inspector-scroll">${t.detail.node}</div>
346 + </aside>`}function Hn(o,e,t,s){const n=()=>{t.selected=[],o.repaint()},i=es(e,t.selected,n),a=e.busy.updating.size>0||e.busy.optimistic.size>0;return f`<div class="os-plugins__selection" ?hidden=${t.selected.length===0}>
347 + <os-checkbox
348 + label=${d("Select visible","desktop-mode")}
349 + ?checked=${s.length>0&&s.every(r=>t.selected.includes(r.plugin))}
350 + ?disabled=${s.length===0}
351 + @os-checkbox-change=${r=>{t.selected=r.detail.checked?s.map(l=>l.plugin):[],o.repaint()}}
352 + ></os-checkbox>
353 + <span class="os-plugins__selection-count" role="status"
354 + >${y(d("%d selected","desktop-mode"),t.selected.length)}</span
355 + >
356 + <div class="os-plugins__selection-actions">
357 + ${i.map(r=>f`<os-button size="small" variant=${r.variant} ?disabled=${a} @click=${r.run}
358 + >${r.label}</os-button
359 + >`)}
360 + </div>
361 + <os-button
362 + variant="ghost"
363 + size="small"
364 + @click=${()=>{n()}}
365 + >${d("Done","desktop-mode")}</os-button
366 + >
367 + </div>`}function Un(o,e,t){const{state:s,data:n}=o,i=qn(n.installed,s.status,s.search,Pn(n.installed,t.haystacks)),a=new Set(i.map(h=>h.plugin));t.selected=t.selected.filter(h=>a.has(h)),a.has(t.focused)||(t.focused="",t.detail=null,t.autoUpdate=null);const r=new Set(n.installed.map(h=>h.plugin));for(const h of t.icons.keys())r.has(h)||t.icons.delete(h);for(const h of t.controls.keys())r.has(h.slice(h.indexOf(":")+1))||t.controls.delete(h);i.sort((h,_)=>t.sort==="size"&&(_.openstation_size_kb??0)-(h.openstation_size_kb??0)||h.name.localeCompare(_.name));const l=JSON.stringify([s.installedView,s.status,s.search,t.sort,i.map(h=>[h.plugin,X(h)])]);if(t.layoutKey!==l&&(t.layoutKey=l,t.controls.clear(),t.icons.clear()),t.sort==="attention"){const h=["update","active","inactive"];i.sort((_,m)=>h.indexOf(X(_))-h.indexOf(X(m)))}t.rows=i;const c=Dn(n.installed),p=n.installed.filter(h=>N(h.status)).length,u=[{value:"",label:d("All plugins","desktop-mode"),count:n.installed.length,icon:"screenoptions"},{value:"update",label:d("Updates","desktop-mode"),count:c,icon:"update"},{value:"active",label:d("Active","desktop-mode"),count:p,icon:"yes-alt"},{value:"inactive",label:d("Inactive","desktop-mode"),count:n.installed.length-p,icon:"marker"}],g=t.sort==="attention"&&!s.status?[{id:"update",title:d("Ready for an update","desktop-mode"),hint:d("The next versions of your tools are here.","desktop-mode")},{id:"active",title:d("Powering your site","desktop-mode"),hint:d("Your everyday tools, switched on.","desktop-mode")},{id:"inactive",title:d("On standby","desktop-mode"),hint:d("Ready when you need them.","desktop-mode")}]:[{id:"",title:u.find(h=>h.value===s.status)?.label||d("All plugins","desktop-mode"),hint:""}],b=()=>{s.status="",s.search="",o.repaint()};return f`<div class="os-plugins__workspace" data-view=${s.installedView} data-detail-open=${t.focused?"true":"false"}><style>${pn.cssText}</style>
368 + <div class="os-plugins__library">
369 + <header class="os-plugins__library-head">
370 + <div class="os-plugins__library-intro">
371 + <div>
372 + <span class="os-plugins__eyebrow">${d("YOUR WORDPRESS, EXTENDED","desktop-mode")}</span>
373 + <h2>${d("Make room for possibility.","desktop-mode")}</h2>
374 + </div>
375 + <os-button
376 + variant="ghost"
377 + size="small"
378 + os-action="reload"
379 + aria-label=${d("Refresh plugins","desktop-mode")}
380 + title=${d("Refresh plugins","desktop-mode")}
381 + >
382 + <span class="dashicons dashicons-update" aria-hidden="true"></span>
383 + </os-button>
384 + </div>
385 + <nav class="os-plugins__collections" aria-label=${d("Filter plugins","desktop-mode")}>
386 + ${u.map(h=>f`<os-button
387 + class="os-plugins__collection"
388 + variant="ghost"
389 + data-filter=${h.value||"all"}
390 + aria-pressed=${s.status===h.value?"true":"false"}
391 + @click=${()=>{s.status=h.value,o.repaint()}}
392 + >
393 + <span class="dashicons dashicons-${h.icon}" aria-hidden="true"></span>
394 + <span>${h.label}</span><strong>${o.loading?"—":h.count}</strong>
395 + </os-button>`)}
396 + </nav>
397 + </header>
398 + <div class="os-plugins__library-tools">
240 399 <os-text-field
400 + id=${`${o.windowId}-plugins-search`}
241 401 class="os-app-list__search"
242 402 os-bind="search"
243 403 os-debounce="200"
244 - placeholder=${l("Search installed plugins…","desktop-mode")}
404 + value=${s.search}
405 + aria-label=${d("Search installed plugins","desktop-mode")}
406 + placeholder=${d("Find a plugin or author…","desktop-mode")}
245 407 ></os-text-field>
408 + <os-select
409 + id=${`${o.windowId}-plugins-sort`}
410 + value=${t.sort}
411 + aria-label=${d("Sort plugins","desktop-mode")}
412 + @os-pick=${h=>{t.sort=h.detail.value,o.repaint()}}
413 + >
414 + <os-option value="attention">${d("Attention first","desktop-mode")}</os-option>
415 + <os-option value="name">${d("Name A–Z","desktop-mode")}</os-option>
416 + <os-option value="size">${d("Largest first","desktop-mode")}</os-option>
417 + </os-select>
418 + <div class="os-plugins__view-switch" role="group" aria-label=${d("Plugin view","desktop-mode")} aria-busy=${String(t.savingView)}>
419 + ${["cards","table"].map(h=>f`<os-button size="small"
420 + variant=${!o.loading&&s.installedView===h?"secondary":"ghost"}
421 + data-plugin-view=${h} aria-pressed=${String(!o.loading&&s.installedView===h)}
422 + ?disabled=${o.loading||t.savingView}
423 + @click=${()=>void Js(o,t,h)}>
424 + <span class="dashicons dashicons-${h==="table"?"list-view":"grid-view"}" aria-hidden="true"></span>
425 + ${d(h==="table"?"Table":"Cards","desktop-mode")}
426 + </os-button>`)}
427 + </div>
246 428 </div>
247 - ${o?"":Gt(e,t,!1)}
248 - <div class="os-app-list__toolbar-trailing">
249 - <os-button variant="ghost" os-action="reload" title=${l("Refresh","desktop-mode")}>
250 - <span class="dashicons dashicons-update" aria-hidden="true"></span>
251 - </os-button>
429 + <div class="os-plugins__library-scroll" aria-busy=${o.loading?"true":"false"}>
430 + ${n.error?f`<os-notice tone="error"
431 + >${y(d("Could not load plugins: %s","desktop-mode"),n.error)}</os-notice
432 + >`:""}
433 + ${o.loading?f`<div class="os-plugins__loading" role="status">
434 + ${d("Opening your plugin library…","desktop-mode")}<os-progress-bar
435 + indeterminate
436 + ></os-progress-bar>
437 + </div>`:""}
438 + ${!o.loading&&!i.length&&!n.error?f`<div class="os-plugins__library-empty">
439 + <span class="dashicons dashicons-admin-plugins" aria-hidden="true"></span>
440 + <h3>
441 + ${n.installed.length?d("Nothing here. More possibilities elsewhere.","desktop-mode"):d("Your next possibility starts here.","desktop-mode")}
442 + </h3>
443 + <p>${d("Try another collection or a different search.","desktop-mode")}</p>
444 + <os-button variant="secondary" @click=${b}
445 + >${d("Show all plugins","desktop-mode")}</os-button
446 + >
447 + </div>`:""}
448 + ${s.installedView==="table"?f`<os-table data-os-plugins-table os-preserve
449 + aria-label=${d("Installed plugins","desktop-mode")} selectable="multi" sticky-header sticky-columns="2" hover
450 + ?hidden=${o.loading||!i.length}></os-table>`:g.map(h=>{const _=h.id?i.filter(m=>X(m)===h.id):i;return _.length?f`<section class="os-plugins__shelf" data-shelf=${h.id} aria-label=${h.title}>
451 + <div class="os-plugins__shelf-heading">
452 + <div>
453 + <h3>${h.title} <span>${_.length}</span></h3>
454 + <p ?hidden=${!h.hint}>${h.hint}</p>
455 + </div>
456 + ${(h.id==="update"||s.status==="update")&&e.extra.caps.update?f`<os-button
457 + variant="secondary"
458 + size="small"
459 + @click=${()=>{t.selected=[...new Set([...t.selected,..._.filter(m=>!!m.openstation_update_available?.package).map(m=>m.plugin)])],o.repaint()}}
460 + >${d("Select updates","desktop-mode")}</os-button
461 + >`:""}
462 + </div>
463 + <os-grid class="os-plugins__module-grid" min-item-width="310" gap="12">
464 + ${_.map(m=>Mn(o,e,t,m))}
465 + </os-grid>
466 + </section>`:""})}
252 467 </div>
253 - </header>
254 - <div class="os-app-list__body">
255 - ${s.error?_`<p class="os-plugins__gallery-status">${v(l("Could not load plugins: %s","desktop-mode"),s.error)}</p>`:""}
256 - <os-table
257 - data-os-plugins-table
258 - data-installed-rows
259 - os-preserve
260 - selectable="multi"
261 - sticky-header
262 - sticky-columns="1"
263 - hover
264 - striped
265 - bordered
266 - >
267 - <div slot="empty" class="os-app-list__empty">
268 - <span class="dashicons dashicons-admin-plugins" aria-hidden="true"></span>
269 - <p>${l("No plugins match your filters.","desktop-mode")}</p>
270 - </div>
271 - </os-table>
468 + ${Hn(o,e,t,i)}
272 469 </div>
273 - ${o?Gt(e,t,!0):""}
274 - `}const bs=[{value:"featured",label:()=>l("Featured","desktop-mode")},{value:"popular",label:()=>l("Popular","desktop-mode")},{value:"recommended",label:()=>l("Recommended","desktop-mode")},{value:"favorites",label:()=>l("Favorites","desktop-mode")},{value:"new",label:()=>l("New","desktop-mode")},{value:"beta",label:()=>l("Beta","desktop-mode")}];function vs(e,t,o){const{state:n}=e;return _`
470 + ${In(o,e,t)}
471 + </div>`}function Fn(o,e){const t=document.createElement("div");t.setAttribute("data-noclick",""),t.className="os-plugins__auto-update";const s=e.openstation_auto_update,n=s?.forced??null;if(n!==null||!o.extra.caps.update){const l=document.createElement("span");return l.className="os-plugins__auto-update-fixed",l.textContent=n??s?.enabled?d("Auto-updates enabled","desktop-mode"):d("Auto-updates disabled","desktop-mode"),t.appendChild(l),t}if(!s?.supported){const l=document.createElement("span");return l.className="os-plugins__auto-update-none",l.textContent="—",l.title=d("This plugin does not check in with WordPress.org, so automatic updates can't be scheduled.","desktop-mode"),t.appendChild(l),t}const i=!!s.enabled,a=o.busy.autoUpdating.has(e.plugin),r=document.createElement("os-button");return r.setAttribute("variant","link"),r.setAttribute("size","small"),r.setAttribute("data-wp-action",i?"disable":"enable"),a?(r.setAttribute("busy",""),r.setAttribute("disabled",""),r.setAttribute("aria-busy","true"),r.textContent=d(i?"Disabling…":"Enabling…","desktop-mode")):r.textContent=d(i?"Disable auto-updates":"Enable auto-updates","desktop-mode"),r.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),Jo(o,e)}),t.appendChild(r),t}function Vn(o){queueMicrotask(()=>{for(const e of o.querySelectorAll(".os-plugins__workspace os-button, .os-plugins__workspace os-text-field, .os-plugins__pick")){const t=e.shadowRoot?.querySelector("button, input");for(const s of["aria-label","aria-pressed"]){const n=e.getAttribute(s);n!==null&&t?.setAttribute(s,n)}}})}function vo(o,e){const t=JSON.stringify([e.name,e.openstation_icon_url]);let s=o.icons.get(e.plugin);if(!s||s.key!==t){const n=document.createElement("span");n.className="os-plugins__module-icon",n.setAttribute("aria-hidden","true");const i=document.createElement("span");if(i.className="os-plugins__monogram",i.textContent=($(e.name)||e.plugin).slice(0,2).toUpperCase(),n.append(i),e.openstation_icon_url){const a=document.createElement("img");a.alt="",a.loading="lazy",a.decoding="async",a.addEventListener("load",()=>a.classList.add("is-loaded")),a.src=go(a,e.openstation_icon_url,()=>a.remove()),n.append(a)}s={key:t,node:n},o.icons.set(e.plugin,s)}return s.node}function Wn(o,e,t){un(t.table,{root:o.root,host:e,rows:t.rows,selected:t.selected,onSelection:s=>{t.selected=s,o.repaint()},icon:s=>vo(t,s),actions:s=>ft(e,t,s,"table"),open:s=>{t.focused=s.plugin,o.repaint(),queueMicrotask(()=>o.root.querySelector("[data-plugin-back]")?.shadowRoot?.querySelector("button")?.focus())}})}function jn(o,e){const t=async(n,i={},a="ajax")=>{const r=o(),l=new URLSearchParams;l.set("action",n),l.set("_ajax_nonce",a==="updates"?r.updatesNonce:r.ajaxNonce);for(const[p,u]of Object.entries(i))u!==void 0&&l.set(p,String(u));const c=await e(r.ajaxUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:l});return yo(await _o(c),c.status)},s=async(n,i)=>{const a=o();i.set("action",n),i.has("_ajax_nonce")||i.set("_ajax_nonce",a.ajaxNonce);const r=await e(a.ajaxUrl,{method:"POST",body:i});return yo(await _o(r),r.status)};return{browsePlugins:(n={})=>t("openstation_plugins_browse",{browse:n.browse,search:n.search,page:n.page,per_page:n.perPage}),fetchPluginInfo:n=>t("openstation_plugins_info",{slug:n}),fetchPluginReviews:n=>t("openstation_plugins_reviews",{slug:n}),fetchFeaturedPlugins:()=>t("openstation_plugins_featured"),installPluginBySlug:n=>t("install-plugin",{slug:n},"updates"),updateInstalledPlugin:n=>t("update-plugin",{plugin:De(n.plugin),slug:n.openstation_update_available?.slug||n.textdomain||n.plugin.split("/")[0]},"updates"),toggleAutoUpdate:async(n,i)=>{await t("toggle-auto-updates",{type:"plugin",asset:De(n.plugin),state:i},"updates")},uploadPluginZip:(n,i={})=>{const a=new FormData;return a.set("pluginzip",n),i.overwrite&&a.set("overwrite","1"),s("openstation_plugins_upload",a)},isOpenStationSelf:n=>{const i=o().selfPluginFile??"",a=r=>r.endsWith(".php")?r.slice(0,-4):r;return i!==""&&a(i)===a(n)}}}async function _o(o){let e;try{e=await o.json()}catch(t){throw new Error(`Server returned ${o.status} with non-JSON body. (${String(t)})`)}if(!o.ok){const t=typeof e=="object"&&e!==null&&"success"in e&&e.success===!1?e.data:e;throw ko(t,o.status)}return e}function yo(o,e){if(typeof o=="object"&&o!==null&&"success"in o){const t=o;if(t.success)return t.data??null;throw ko(t.data,e)}return o}function ko(o,e){if(typeof o=="object"&&o!==null){const t=o,s=t.message??t.errorMessage??t.code??t.errorCode;if(typeof s=="string"&&s!==""){const n=new Error(s);return n.code=t.code??t.errorCode,n.status=e,n}}return new Error(`Request failed (${e}).`)}function xo(o,e){return new Promise(t=>{const s=document.createElement("div");s.className="os-plugins__upload-overlay";const n=document.createElement("div");n.className="os-plugins__upload-card",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-label",d("Upload a plugin .zip","desktop-mode"));const i=document.createElement("h2");i.className="os-plugins__upload-heading",i.textContent=d("Upload a plugin","desktop-mode");const a=document.createElement("p");a.className="os-plugins__upload-lede",a.textContent=d("Pick a .zip file from your computer, or drop one onto the area below.","desktop-mode");const r=document.createElement("div");r.className="os-plugins__upload-dropzone",r.tabIndex=0,r.setAttribute("role","button"),r.setAttribute("aria-label",d("Drop a .zip plugin file here, or click to choose a file.","desktop-mode"));const l=document.createElement("span");l.className="dashicons dashicons-upload os-plugins__upload-icon",l.setAttribute("aria-hidden","true");const c=document.createElement("p");c.className="os-plugins__upload-hint",c.textContent=d("Drop your .zip here or click to browse","desktop-mode");const p=document.createElement("p");p.className="os-plugins__upload-filename",p.hidden=!0;const u=document.createElement("input");u.type="file",u.accept=".zip,application/zip,application/x-zip-compressed",u.style.display="none",r.append(l,c,p,u);const g=document.createElement("p");g.className="os-plugins__upload-status",g.hidden=!0;const b=document.createElement("div");b.className="os-plugins__upload-actions";const h=document.createElement("os-button");h.setAttribute("variant","ghost"),h.textContent=d("Cancel","desktop-mode");const _=document.createElement("os-button");_.setAttribute("variant","primary"),_.textContent=d("Install","desktop-mode"),_.setAttribute("disabled",""),b.append(h,_),n.append(i,a,r,g,b),s.appendChild(n),o.root.appendChild(s);const m=v=>{v.preventDefault(),v.stopPropagation()};s.addEventListener("dragenter",m),s.addEventListener("dragover",m),s.addEventListener("drop",m);let w=null,x=!1;const S=(v,A)=>{g.hidden=!1,g.dataset.tone=A,g.textContent=v},D=v=>{w=v,r.classList.toggle("has-file",!!v),p.hidden=!v,v?(p.textContent=y(d("%1$s · %2$s","desktop-mode"),v.name,ye(v.size)),_.removeAttribute("disabled")):_.setAttribute("disabled","")};r.addEventListener("click",v=>{v.target?.tagName!=="INPUT"&&u.click()}),r.addEventListener("keydown",v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),u.click())}),r.addEventListener("dragover",v=>{v.preventDefault(),v.stopPropagation(),r.classList.add("is-hovered")}),r.addEventListener("dragleave",v=>{v.stopPropagation(),r.classList.remove("is-hovered")}),r.addEventListener("drop",v=>{v.preventDefault(),v.stopPropagation(),r.classList.remove("is-hovered");const A=v.dataTransfer?.files?.[0];A&&bt(A)?D(A):A&&S(d("Only .zip files are accepted.","desktop-mode"),"error")}),u.addEventListener("change",()=>{const v=u.files?.[0];v&&bt(v)&&D(v)});const Ne=v=>{s.remove(),t(v)};s.addEventListener("keydown",v=>{v.key==="Escape"&&!x&&Ne(null)}),h.addEventListener("click",()=>{x||Ne(null)}),_.addEventListener("click",()=>{w&&!x&&Eo()}),s.addEventListener("click",v=>{v.target===s&&!x&&Ne(null)}),e&&bt(e)&&D(e);let vt=null;const Ao=v=>{x=v,v?(vt=O(_),h.setAttribute("disabled","")):(vt?.(),vt=null,h.removeAttribute("disabled"))};async function Eo(v=!1){if(w){Ao(!0),S(d(v?"Replacing existing plugin…":"Uploading and installing…","desktop-mode"),"info");try{const A=await o.rest.uploadPluginZip(w,{overwrite:v});o.refresh(),o.broadcastChange({plugin:A.plugin_file,action:"install"}),o.refreshMenu(),si(A)}catch(A){const me=A.status,Le=A.code;if(Ao(!1),!v&&(me===409||Le==="folder_exists")){S(d("A plugin with the same folder name is already installed.","desktop-mode"),"info"),await o.confirm({title:d("Replace existing plugin?","desktop-mode"),message:d("A plugin with the same folder name is already installed. Replacing it overwrites the installed files. Any local edits to the plugin will be lost. The plugin will keep its activation state.","desktop-mode"),confirmLabel:d("Replace","desktop-mode"),cancelLabel:d("Cancel","desktop-mode"),danger:!0})&&await Eo(!0);return}S(y(d("Upload failed: %s","desktop-mode"),A instanceof Error?A.message:String(A)),"error")}}}function si(v){x=!1,r.remove(),b.remove(),g.hidden=!0;const A=document.createElement("h3");A.className="os-plugins__upload-success-heading",A.textContent=d("Plugin installed successfully.","desktop-mode");const me=document.createElement("p");me.className="os-plugins__upload-success-detail";const Le=v.plugin_name||v.plugin_file;me.textContent=v.plugin_version?y(d("%1$s %2$s","desktop-mode"),Le,v.plugin_version):Le;const Te=document.createElement("div");Te.className="os-plugins__upload-actions";const R=document.createElement("os-button");R.setAttribute("variant","ghost"),R.textContent=d("Close","desktop-mode");const M=document.createElement("os-button");M.setAttribute("variant","primary"),M.textContent=d("Activate Plugin","desktop-mode"),Te.append(R,M),n.append(A,me,Te),R.addEventListener("click",()=>{x||Ne(v)}),M.addEventListener("click",()=>{if(x)return;x=!0;const ni=O(M);R.setAttribute("disabled","");const ii=v.plugin_file.endsWith(".php")?v.plugin_file.slice(0,-4):v.plugin_file;He(o,{plugin:ii}).then(ai=>{if(x=!1,R.removeAttribute("disabled"),!ai){ni();return}A.textContent=d("Plugin activated.","desktop-mode"),M.remove(),R.setAttribute("variant","primary"),R.textContent=d("Done","desktop-mode"),R.focus?.()})}),window.setTimeout(()=>M.focus?.(),16)}window.setTimeout(()=>r.focus(),16)})}function bt(o){return o.size<=0?!1:o.name.toLowerCase().endsWith(".zip")?!0:o.type==="application/zip"||o.type==="application/x-zip-compressed"}const On="desktop-mode-plugins",Bn="heartbeat",Kn=5*60*1e3;function Zn(o,e){const t=()=>o.extra,s=jn(t,(n,i)=>o.fetch(n,i));return{get extra(){return t()},get installed(){return o.data?.installed??[]},rest:s,root:o.root,busy:Yo(),caches:{info:new Map,reviews:new Map},dispatch:o.dispatch,refresh:()=>o.dispatch("refresh"),repaint:()=>o.repaint(),toast:(n,i=3500)=>o.host.toast?.({message:n,duration:i}),confirm:n=>o.host.confirm?.({title:n.title,message:n.message,label:n.confirmLabel,confirmLabel:n.confirmLabel,danger:n.danger})??Promise.resolve(!0),refreshMenu:()=>o.host.refreshMenu?.(),installedFor:n=>(o.data?.installed??[]).find(i=>qe(i)===n),broadcastChange:(n,i=[])=>{const a=Date.now();for(const l of[n.plugin,...i])l&&e.set(Oo(De(l)),a);const r=window.wp?.os;typeof r?.broadcast=="function"&&r.broadcast(Et,{source:St,...n})}}}function Gn(o,e){const t=Date.now();for(const[s,n]of o)t-n>Kn&&o.delete(s);return!!e&&e.length>0&&e.every(s=>o.has(s))}const mt=o=>o.ui(()=>{const e=new Map;return{host:Zn(o,e),installed:Rn(),browse:null,featured:null,ctaKey:"",dragDepth:0,ownChanges:e,teardown:[]}}),wo=o=>o.root.querySelector("[data-os-plugins-flyout]"),Co="plugin-editor";function Yn(o){return o.extra.menuTabs??[]}function Xn(o,e){const t=e.host.extra.editorUrl;if(!t)return"";const s=d("Plugin File Editor","desktop-mode"),n=()=>o.host.openUrl?.(t,s,"dashicons-admin-plugins");return f`<os-tab
472 + value=${Co}
473 + data-os-plugins-editor
474 + title=${d("Opens in its own window","desktop-mode")}
475 + @os-tab-pick=${i=>{i.stopPropagation(),n()}}
476 + @keydown=${i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),n())}}
477 + >${s} ↗</os-tab>`}function Qn(o,e){e.detail?.value===Co&&(e.stopPropagation(),e.currentTarget.value=o.state.tab)}const Jn=[{value:"featured",label:()=>d("Featured","desktop-mode")},{value:"popular",label:()=>d("Popular","desktop-mode")},{value:"recommended",label:()=>d("Recommended","desktop-mode")},{value:"favorites",label:()=>d("Favorites","desktop-mode")},{value:"new",label:()=>d("New","desktop-mode")},{value:"beta",label:()=>d("Beta","desktop-mode")}];function ei(o,e,t){const{state:s}=o;return f`
275 478 <header class="os-app-list__toolbar">
276 479 <div class="os-app-list__toolbar-left">
277 - ${st({segments:bs.map(s=>({value:s.value,label:s.label()})),value:n.browse,bind:"browse",action:"set",label:l("Browse","desktop-mode"),phone:o})}
480 + ${Uo({segments:Jn.map(n=>({value:n.value,label:n.label()})),value:s.browse,bind:"browse",action:"set",label:d("Browse","desktop-mode"),phone:t})}
278 481 <os-text-field
279 482 class="os-app-list__search"
483 + label=${d("Search WordPress.org","desktop-mode")}
484 + hide-label
280 485 os-bind="query"
281 486 os-debounce="300"
282 - placeholder=${l("Search WordPress.org…","desktop-mode")}
487 + placeholder=${d("Search WordPress.org…","desktop-mode")}
283 488 ></os-text-field>
284 489 </div>
285 490 <div class="os-app-list__toolbar-trailing">
286 - ${t.host.extra.caps.upload?_`<os-button variant="secondary" @click=${()=>void Wt(t.host,null)}>
491 + ${e.host.extra.caps.upload?f`<os-button variant="secondary" @click=${()=>void xo(e.host,null)}>
287 492 <span class="dashicons dashicons-upload" aria-hidden="true"></span>
288 - ${l("Upload Plugin","desktop-mode")}
493 + ${d("Upload Plugin","desktop-mode")}
289 494 </os-button>`:""}
290 495 <os-button
291 496 variant="ghost"
292 - title=${l("Refresh","desktop-mode")}
293 - @click=${()=>{t.host.refresh(),t.browse?.reset()}}
497 + title=${d("Refresh","desktop-mode")}
498 + @click=${()=>{e.host.refresh(),e.browse?.reset()}}
294 499 >
295 500 <span class="dashicons dashicons-update" aria-hidden="true"></span>
296 501 </os-button>
297 502 </div>
@@ -297,40 +502,45 @@
297 502 </div>
298 503 </header>
299 504 <div class="os-plugins__gallery" os-preserve data-os-plugins-gallery="browse"></div>
300 505 <p class="os-plugins__gallery-status" hidden data-os-plugins-gallery-status="browse"></p>
301 - `}const _s=()=>_`
506 + `}const ti=()=>f`
302 507 <header class="os-plugins__featured-intro">
303 - <h2 class="os-plugins__featured-heading">${l("Made for OpenStation","desktop-mode")}</h2>
304 - <p class="os-plugins__featured-blurb">${l("Plugins that extend OpenStation — desktop decorations, native windows, widgets, and other companions.","desktop-mode")}</p>
508 + <h2 class="os-plugins__featured-heading">${d("Made for OpenStation","desktop-mode")}</h2>
509 + <p class="os-plugins__featured-blurb">${d("Plugins that extend OpenStation — desktop decorations, native windows, widgets, and other companions.","desktop-mode")}</p>
305 510 </header>
306 511 <div class="os-plugins__gallery" os-preserve data-os-plugins-gallery="featured"></div>
307 512 <p class="os-plugins__gallery-status" hidden data-os-plugins-gallery-status="featured"></p>
308 -`,ys=go(us,{local:{set:()=>{}},placeholder:()=>({installed:[],error:""}),view:e=>{const t=Ge(e),{caps:o}=t.host.extra,n=xe(),s=e.state.tab;return _`
513 +`,oi=Fo(On,{local:{set:()=>{}},placeholder:()=>({installed:[],error:""}),view:o=>{const e=mt(o),{caps:t}=e.host.extra,s=At(),n=o.state.tab;return f`
309 514 <div class="os-app-list desktop-mode-plugins" data-os-plugins-root>
310 - <os-tabs value=${s} class="os-app-list__tabs os-plugins__tabs" data-os-plugins-tabs os-bind="tab">
311 - <os-tab value="installed">${l("Installed","desktop-mode")}</os-tab>
312 - ${o.install?_`<os-tab value="browse">${l("Add Plugin","desktop-mode")}</os-tab>
313 - <os-tab value="featured">${l("OpenStation plugins","desktop-mode")}</os-tab>`:""}
515 + <os-tabs
516 + value=${n}
517 + class="os-app-list__tabs os-plugins__tabs"
518 + data-os-plugins-tabs
519 + os-bind="tab"
520 + @os-tab-change=${i=>Qn(o,i)}
521 + >
522 + ${Yn(o).map(i=>f`<os-tab value=${i.id}>${i.label}</os-tab>`)}
523 + ${Xn(o,e)}
314 524 </os-tabs>
315 - <os-tabpanel for="installed" class="os-app-list__panel os-plugins__panel" ?hidden=${s!=="installed"}>
525 + <os-tabpanel for="installed" class="os-app-list__panel os-plugins__panel" ?hidden=${n!=="installed"}>
316 526 <div class="os-plugins__installed" data-os-plugins-installed-host>
317 - ${fs(e,t,n)}
527 + ${Un(o,e.host,e.installed)}
318 528 </div>
319 529 </os-tabpanel>
320 - ${o.install?_`<os-tabpanel for="browse" class="os-app-list__panel os-plugins__panel" ?hidden=${s!=="browse"}>
321 - <div class="os-plugins__browse" data-os-plugins-browse-host>${vs(e,t,n)}</div>
530 + ${t.install?f`<os-tabpanel for="browse" class="os-app-list__panel os-plugins__panel" ?hidden=${n!=="browse"}>
531 + <div class="os-plugins__browse" data-os-plugins-browse-host>${ei(o,e,s)}</div>
322 532 </os-tabpanel>
323 - <os-tabpanel for="featured" class="os-app-list__panel os-plugins__panel" ?hidden=${s!=="featured"}>
324 - <div class="os-plugins__featured" data-os-plugins-featured-host>${_s()}</div>
533 + <os-tabpanel for="featured" class="os-app-list__panel os-plugins__panel" ?hidden=${n!=="featured"}>
534 + <div class="os-plugins__featured" data-os-plugins-featured-host>${ti()}</div>
325 535 </os-tabpanel>`:""}
326 536 <os-flyout
327 537 placement="end"
328 538 data-os-plugins-flyout
329 539 os-preserve
330 - aria-label=${l("Plugin details","desktop-mode")}
540 + aria-label=${d("Plugin details","desktop-mode")}
331 541 ></os-flyout>
332 542 <div class="os-plugins__window-drop" aria-hidden="true">
333 - <p>${l("Drop the .zip to install.","desktop-mode")}</p>
543 + <p>${d("Drop the .zip to install.","desktop-mode")}</p>
334 544 </div>
335 545 </div>
336 - `},mounted:e=>{const t=Ge(e),{host:o}=t,n=e.root,s=e.host.onBroadcast?.(it,(h,b)=>{const m=b;!m||m.source===rt||m.source===ps&&ms(t.ownChanges,m.ids)||o.refresh()});s&&t.teardown.push(s),o.extra.caps.install&&t.teardown.push(Ko());const a=h=>!!h.dataTransfer?.types.includes("Files"),i=()=>!!o.extra.caps.upload,r=h=>{i()&&a(h)&&(t.dragDepth++,n.classList.add("has-zip-dragover"))},d=h=>{i()&&a(h)&&(t.dragDepth=Math.max(0,t.dragDepth-1),t.dragDepth===0&&n.classList.remove("has-zip-dragover"))},c=h=>{i()&&a(h)&&h.preventDefault()},u=h=>{if(!i())return;t.dragDepth=0,n.classList.remove("has-zip-dragover");const b=h.dataTransfer?.files?.[0];b&&(h.preventDefault(),Wt(o,b))};n.addEventListener("dragenter",r),n.addEventListener("dragleave",d),n.addEventListener("dragover",c),n.addEventListener("drop",u),t.teardown.push(()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragleave",d),n.removeEventListener("dragover",c),n.removeEventListener("drop",u)});const p=()=>e.repaint();return document.addEventListener("os-mode-changed",p),t.teardown.push(()=>document.removeEventListener("os-mode-changed",p)),()=>{for(const h of t.teardown)h();t.teardown.length=0,t.browse?.dispose()}},updated:e=>{const t=Ge(e),{host:o}=t,n=Zt(e);if(n&&(os(n,o,t.installed,{status:e.state.status,search:e.state.search}),n.toggleAttribute("loading",e.loading)),o.extra.caps.install){const s=r=>e.root.querySelector(`[data-os-plugins-gallery="${r}"]`),a=r=>e.root.querySelector(`[data-os-plugins-gallery-status="${r}"]`);t.browse??(t.browse=Sn({host:o,flyout:()=>Kt(e)})),t.browse.sync({gallery:s("browse"),status:a("browse"),filter:e.state.browse,query:e.state.query,active:e.state.tab==="browse"}),t.featured??(t.featured=$n({host:o,flyout:()=>Kt(e)})),t.featured.sync({gallery:s("featured"),status:a("featured"),active:e.state.tab==="featured"});const i=o.installed.map(r=>`${we(r)}:${r.status}`).join("|");i!==t.ctaKey&&(t.ctaKey=i,t.browse.repaintCtas(),t.featured.repaintCtas())}}});return _e.default=ys,Object.defineProperties(_e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),_e}({});
546 + `},mounted:o=>{const e=mt(o),{host:t}=e,s=o.root,n=o.host.onBroadcast?.(Et,(g,b)=>{const h=b;!h||h.source===St||h.source===Bn&&Gn(e.ownChanges,h.ids)||t.refresh()});n&&e.teardown.push(n),t.extra.caps.install&&e.teardown.push(bs());const i=g=>!!g.dataTransfer?.types.includes("Files"),a=()=>!!t.extra.caps.upload,r=g=>{a()&&i(g)&&(e.dragDepth++,s.classList.add("has-zip-dragover"))},l=g=>{a()&&i(g)&&(e.dragDepth=Math.max(0,e.dragDepth-1),e.dragDepth===0&&s.classList.remove("has-zip-dragover"))},c=g=>{a()&&i(g)&&g.preventDefault()},p=g=>{if(!a())return;e.dragDepth=0,s.classList.remove("has-zip-dragover");const b=g.dataTransfer?.files?.[0];b&&(g.preventDefault(),xo(t,b))};s.addEventListener("dragenter",r),s.addEventListener("dragleave",l),s.addEventListener("dragover",c),s.addEventListener("drop",p),e.teardown.push(()=>{s.removeEventListener("dragenter",r),s.removeEventListener("dragleave",l),s.removeEventListener("dragover",c),s.removeEventListener("drop",p)});const u=()=>o.repaint();return document.addEventListener("os-mode-changed",u),e.teardown.push(()=>document.removeEventListener("os-mode-changed",u)),()=>{for(const g of e.teardown)g();e.teardown.length=0,e.browse?.dispose()}},updated:o=>{Vn(o.root);const e=mt(o),{host:t}=e;if(Wn(o,t,e.installed),t.extra.caps.install){const s=a=>o.root.querySelector(`[data-os-plugins-gallery="${a}"]`),n=a=>o.root.querySelector(`[data-os-plugins-gallery-status="${a}"]`);e.browse??(e.browse=Zs({host:t,flyout:()=>wo(o)})),e.browse.sync({gallery:s("browse"),status:n("browse"),filter:o.state.browse,query:o.state.query,active:o.state.tab==="browse"}),e.featured??(e.featured=Gs({host:t,flyout:()=>wo(o)})),e.featured.sync({gallery:s("featured"),status:n("featured"),active:o.state.tab==="featured"});const i=t.installed.map(a=>`${qe(a)}:${a.status}`).join("|");i!==e.ctaKey&&(e.ctaKey=i,e.browse.repaintCtas(),e.featured.repaintCtas())}}});return Re.default=oi,Object.defineProperties(Re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Re}({});